From: support
Date: Wed, 15 Mar 2023 17:12:26 +0000 (+0000)
Subject: Built motion from commit f57cc866.|2.6.31
X-Git-Url: http://repos.xcallymotion.com/base//%22./banner.jpg/%22?a=commitdiff_plain;h=6b8f670b70c93a2eb7d0063c31a1ba4f9ac9a33d;p=motion2.git
Built motion from commit f57cc866.|2.6.31
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index c4317ea..76f5613 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-14T10:45:33.556Z",
+ "time": "2023-03-15T17:04:45.905Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 0aacbfe..8d569c7 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-14T10:45:33.556Z",
+ "time": "2023-03-15T17:04:45.905Z",
"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 c9c7f39..8b57356 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 _0x5679=['sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x536bc2,_0x35c4bf){var _0x551b56=function(_0x4637a6){while(--_0x4637a6){_0x536bc2['push'](_0x536bc2['shift']());}};_0x551b56(++_0x35c4bf);}(_0x5679,0x104));var _0x9567=function(_0x1f5100,_0xf6d616){_0x1f5100=_0x1f5100-0x0;var _0x32d9c7=_0x5679[_0x1f5100];return _0x32d9c7;};'use strict';var Sequelize=require(_0x9567('0x0'));module[_0x9567('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1525f4){return this[_0x9567('0x2')](_0x9567('0x3'));}},'action':{'type':Sequelize[_0x9567('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9567('0x5'),_0x9567('0x6'),_0x9567('0x7'),'jscripty',_0x9567('0x8'),_0x9567('0x9'),_0x9567('0xa'),_0x9567('0xb')]],'msg':_0x9567('0xc')}},'comment':_0x9567('0xc')},'data1':{'type':Sequelize[_0x9567('0x4')](0x1000),'comment':_0x9567('0xd')},'data2':{'type':Sequelize[_0x9567('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[_0x9567('0x4')](0x1000),'comment':_0x9567('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x9567('0xf')},'data5':{'type':Sequelize[_0x9567('0x4')](0x1000),'comments':_0x9567('0x10')},'data6':{'type':Sequelize[_0x9567('0x4')],'comments':_0x9567('0x11')},'data7':{'type':Sequelize[_0x9567('0x12')],'comments':_0x9567('0x13')}};
\ No newline at end of file
+var _0x52a6=['urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','getDataValue','action','contactManager','motionbar','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x434db2,_0x113541){var _0x4e9284=function(_0x5d59b4){while(--_0x5d59b4){_0x434db2['push'](_0x434db2['shift']());}};_0x4e9284(++_0x113541);}(_0x52a6,0x16e));var _0x652a=function(_0x429db2,_0x1fe28d){_0x429db2=_0x429db2-0x0;var _0xa15965=_0x52a6[_0x429db2];return _0xa15965;};'use strict';var Sequelize=require(_0x652a('0x0'));module[_0x652a('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f6465){return this[_0x652a('0x2')](_0x652a('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x652a('0x4'),'integration',_0x652a('0x5'),'jscripty',_0x652a('0x6'),'browser','bot',_0x652a('0x7')]],'msg':_0x652a('0x8')}},'comment':_0x652a('0x8')},'data1':{'type':Sequelize[_0x652a('0x9')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x652a('0x9')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x652a('0xa')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x652a('0xb')},'data6':{'type':Sequelize[_0x652a('0x9')],'comments':_0x652a('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0x652a('0xd')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 9017fc6..39655d6 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 _0x6ed8=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','name','send','update','body','Action','find','params','catch','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x6ed8,0xa1));var _0x86ed=function(_0x1fda27,_0x2b5c2d){_0x1fda27=_0x1fda27-0x0;var _0x2be4ff=_0x6ed8[_0x1fda27];return _0x2be4ff;};'use strict';var emlformat=require(_0x86ed('0x0'));var rimraf=require(_0x86ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86ed('0x2'));var rp=require(_0x86ed('0x3'));var moment=require(_0x86ed('0x4'));var BPromise=require(_0x86ed('0x5'));var Mustache=require(_0x86ed('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x86ed('0x7'));var ejs=require(_0x86ed('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86ed('0x9'));var squel=require('squel');var crypto=require(_0x86ed('0xa'));var jsforce=require(_0x86ed('0xb'));var deskjs=require(_0x86ed('0xc'));var toCsv=require(_0x86ed('0x7'));var querystring=require(_0x86ed('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86ed('0xe'));var qs=require(_0x86ed('0xf'));var as=require(_0x86ed('0x10'));var hardwareService=require(_0x86ed('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x86ed('0x12'));var config=require(_0x86ed('0x13'));var licenseUtil=require(_0x86ed('0x14'));var db=require(_0x86ed('0x15'))['db'];function respondWithStatusCode(_0x530e7c,_0x4eac50){_0x4eac50=_0x4eac50||0xcc;return function(_0x574ded){if(_0x574ded){return _0x530e7c[_0x86ed('0x16')](_0x4eac50);}return _0x530e7c[_0x86ed('0x17')](_0x4eac50)[_0x86ed('0x18')]();};}function respondWithResult(_0x527ef1,_0x10dc8d){_0x10dc8d=_0x10dc8d||0xc8;return function(_0x45fde2){if(_0x45fde2){return _0x527ef1[_0x86ed('0x17')](_0x10dc8d)[_0x86ed('0x19')](_0x45fde2);}};}function respondWithFilteredResult(_0xbd27f3,_0x1ed9c0){return function(_0x52f7d6){if(_0x52f7d6){var _0x4b7743=typeof _0x1ed9c0[_0x86ed('0x1a')]===_0x86ed('0x1b')&&typeof _0x1ed9c0[_0x86ed('0x1c')]===_0x86ed('0x1b');var _0x162da4=_0x52f7d6[_0x86ed('0x1d')];var _0x4968c8=_0x4b7743?0x0:_0x1ed9c0['offset'];var _0x34039b=_0x4b7743?_0x52f7d6[_0x86ed('0x1d')]:_0x1ed9c0[_0x86ed('0x1a')]+_0x1ed9c0[_0x86ed('0x1c')];var _0x582f99;if(_0x34039b>=_0x162da4){_0x34039b=_0x162da4;_0x582f99=0xc8;}else{_0x582f99=0xce;}_0xbd27f3[_0x86ed('0x17')](_0x582f99);return _0xbd27f3['set'](_0x86ed('0x1e'),_0x4968c8+'-'+_0x34039b+'/'+_0x162da4)[_0x86ed('0x19')](_0x52f7d6);}return null;};}function patchUpdates(_0x3abacb){return function(_0x471267){try{jsonpatch[_0x86ed('0x1f')](_0x471267,_0x3abacb,!![]);}catch(_0x3a2bb6){return BPromise[_0x86ed('0x20')](_0x3a2bb6);}return _0x471267[_0x86ed('0x21')]();};}function saveUpdates(_0x5d0720,_0x146fdc){return function(_0x5ad334){if(_0x5ad334){return _0x5ad334['update'](_0x5d0720)['then'](function(_0x31091d){return _0x31091d;});}return null;};}function removeEntity(_0x3f2ec9,_0x59d2c7){return function(_0x3cfba6){if(_0x3cfba6){return _0x3cfba6['destroy']()[_0x86ed('0x22')](function(){_0x3f2ec9[_0x86ed('0x17')](0xcc)[_0x86ed('0x18')]();});}};}function handleEntityNotFound(_0x4d858e,_0x527122){return function(_0x1acc2d){if(!_0x1acc2d){_0x4d858e[_0x86ed('0x16')](0x194);}return _0x1acc2d;};}function handleError(_0x4cde7c,_0x2dd1bb){_0x2dd1bb=_0x2dd1bb||0x1f4;return function(_0x456c04){logger['error'](_0x456c04['stack']);if(_0x456c04[_0x86ed('0x23')]){delete _0x456c04[_0x86ed('0x23')];}_0x4cde7c[_0x86ed('0x17')](_0x2dd1bb)[_0x86ed('0x24')](_0x456c04);};}exports[_0x86ed('0x25')]=function(_0x4a50ba,_0x47c39f){if(_0x4a50ba['body']['id']){delete _0x4a50ba[_0x86ed('0x26')]['id'];}return db[_0x86ed('0x27')][_0x86ed('0x28')]({'where':{'id':_0x4a50ba[_0x86ed('0x29')]['id']}})[_0x86ed('0x22')](handleEntityNotFound(_0x47c39f,null))[_0x86ed('0x22')](saveUpdates(_0x4a50ba[_0x86ed('0x26')],null))[_0x86ed('0x22')](respondWithResult(_0x47c39f,null))[_0x86ed('0x2a')](handleError(_0x47c39f,null));};exports[_0x86ed('0x2b')]=function(_0x3a7cbc,_0x4af69e){return db[_0x86ed('0x27')]['find']({'where':{'id':_0x3a7cbc[_0x86ed('0x29')]['id']}})['then'](handleEntityNotFound(_0x4af69e,null))[_0x86ed('0x22')](removeEntity(_0x4af69e,null))['catch'](handleError(_0x4af69e,null));};
\ No newline at end of file
+var _0x1a62=['Action','find','params','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','body'];(function(_0x42752b,_0x1e1cbb){var _0x450eed=function(_0x2091ee){while(--_0x2091ee){_0x42752b['push'](_0x42752b['shift']());}};_0x450eed(++_0x1e1cbb);}(_0x1a62,0xef));var _0x21a6=function(_0x388402,_0x1de21f){_0x388402=_0x388402-0x0;var _0xb1830e=_0x1a62[_0x388402];return _0xb1830e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x21a6('0x0'));var jsonpatch=require(_0x21a6('0x1'));var rp=require(_0x21a6('0x2'));var moment=require(_0x21a6('0x3'));var BPromise=require(_0x21a6('0x4'));var Mustache=require(_0x21a6('0x5'));var util=require(_0x21a6('0x6'));var path=require(_0x21a6('0x7'));var sox=require(_0x21a6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x21a6('0x9'));var _=require('lodash');var squel=require(_0x21a6('0xa'));var crypto=require(_0x21a6('0xb'));var jsforce=require(_0x21a6('0xc'));var deskjs=require(_0x21a6('0xd'));var toCsv=require(_0x21a6('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x21a6('0xf'));var authService=require(_0x21a6('0x10'));var qs=require(_0x21a6('0x11'));var as=require(_0x21a6('0x12'));var hardwareService=require(_0x21a6('0x13'));var logger=require(_0x21a6('0x14'))(_0x21a6('0x15'));var utils=require(_0x21a6('0x16'));var config=require(_0x21a6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x21a6('0x18'))['db'];function respondWithStatusCode(_0x32dcfa,_0x243dfa){_0x243dfa=_0x243dfa||0xcc;return function(_0x4a085b){if(_0x4a085b){return _0x32dcfa[_0x21a6('0x19')](_0x243dfa);}return _0x32dcfa[_0x21a6('0x1a')](_0x243dfa)['end']();};}function respondWithResult(_0x3eeaa7,_0x3c29d8){_0x3c29d8=_0x3c29d8||0xc8;return function(_0x2548f8){if(_0x2548f8){return _0x3eeaa7[_0x21a6('0x1a')](_0x3c29d8)[_0x21a6('0x1b')](_0x2548f8);}};}function respondWithFilteredResult(_0x27960f,_0x5a3e02){return function(_0x116ed4){if(_0x116ed4){var _0x2982f0=typeof _0x5a3e02[_0x21a6('0x1c')]==='undefined'&&typeof _0x5a3e02[_0x21a6('0x1d')]==='undefined';var _0x582243=_0x116ed4[_0x21a6('0x1e')];var _0xfc631b=_0x2982f0?0x0:_0x5a3e02[_0x21a6('0x1c')];var _0x2af5c7=_0x2982f0?_0x116ed4[_0x21a6('0x1e')]:_0x5a3e02['offset']+_0x5a3e02[_0x21a6('0x1d')];var _0x379374;if(_0x2af5c7>=_0x582243){_0x2af5c7=_0x582243;_0x379374=0xc8;}else{_0x379374=0xce;}_0x27960f[_0x21a6('0x1a')](_0x379374);return _0x27960f[_0x21a6('0x1f')](_0x21a6('0x20'),_0xfc631b+'-'+_0x2af5c7+'/'+_0x582243)[_0x21a6('0x1b')](_0x116ed4);}return null;};}function patchUpdates(_0x1d28bf){return function(_0x37b77d){try{jsonpatch[_0x21a6('0x21')](_0x37b77d,_0x1d28bf,!![]);}catch(_0x56394d){return BPromise[_0x21a6('0x22')](_0x56394d);}return _0x37b77d[_0x21a6('0x23')]();};}function saveUpdates(_0x35d39c,_0x1bcb35){return function(_0x10c5fb){if(_0x10c5fb){return _0x10c5fb[_0x21a6('0x24')](_0x35d39c)[_0x21a6('0x25')](function(_0x401a06){return _0x401a06;});}return null;};}function removeEntity(_0x31e166,_0x100ee9){return function(_0x32f33e){if(_0x32f33e){return _0x32f33e[_0x21a6('0x26')]()[_0x21a6('0x25')](function(){_0x31e166[_0x21a6('0x1a')](0xcc)[_0x21a6('0x27')]();});}};}function handleEntityNotFound(_0x3f3de3,_0x45d307){return function(_0x104e4b){if(!_0x104e4b){_0x3f3de3[_0x21a6('0x19')](0x194);}return _0x104e4b;};}function handleError(_0x4fcc96,_0x4455d5){_0x4455d5=_0x4455d5||0x1f4;return function(_0x14f196){logger['error'](_0x14f196[_0x21a6('0x28')]);if(_0x14f196[_0x21a6('0x29')]){delete _0x14f196[_0x21a6('0x29')];}_0x4fcc96[_0x21a6('0x1a')](_0x4455d5)['send'](_0x14f196);};}exports[_0x21a6('0x24')]=function(_0x1af751,_0x2396d2){if(_0x1af751[_0x21a6('0x2a')]['id']){delete _0x1af751['body']['id'];}return db[_0x21a6('0x2b')][_0x21a6('0x2c')]({'where':{'id':_0x1af751[_0x21a6('0x2d')]['id']}})[_0x21a6('0x25')](handleEntityNotFound(_0x2396d2,null))['then'](saveUpdates(_0x1af751[_0x21a6('0x2a')],null))[_0x21a6('0x25')](respondWithResult(_0x2396d2,null))['catch'](handleError(_0x2396d2,null));};exports[_0x21a6('0x26')]=function(_0xcb6af4,_0x5817ca){return db[_0x21a6('0x2b')][_0x21a6('0x2c')]({'where':{'id':_0xcb6af4[_0x21a6('0x2d')]['id']}})[_0x21a6('0x25')](handleEntityNotFound(_0x5817ca,null))[_0x21a6('0x25')](removeEntity(_0x5817ca,null))[_0x21a6('0x2e')](handleError(_0x5817ca,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 503e475..3c46cc9 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 _0x6ecb=['util','../../config/logger','api','moment','bluebird','rimraf','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x6ecb,0x14f));var _0xb6ec=function(_0x4e4c69,_0x5d7f1c){_0x4e4c69=_0x4e4c69-0x0;var _0x35def9=_0x6ecb[_0x4e4c69];return _0x35def9;};'use strict';var _=require(_0xb6ec('0x0'));var util=require(_0xb6ec('0x1'));var logger=require(_0xb6ec('0x2'))(_0xb6ec('0x3'));var moment=require(_0xb6ec('0x4'));var BPromise=require(_0xb6ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb6ec('0x6'));var config=require('../../config/environment');var attributes=require(_0xb6ec('0x7'));module[_0xb6ec('0x8')]=function(_0x5bab6,_0x2e7b4e){return _0x5bab6[_0xb6ec('0x9')](_0xb6ec('0xa'),attributes,{'tableName':_0xb6ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c07=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','tools_actions','lodash','util','../../config/logger','api'];(function(_0x2d4e13,_0x544831){var _0x487523=function(_0x186095){while(--_0x186095){_0x2d4e13['push'](_0x2d4e13['shift']());}};_0x487523(++_0x544831);}(_0x0c07,0x8b));var _0x70c0=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0x0c07[_0x17bb31];return _0x505c71;};'use strict';var _=require(_0x70c0('0x0'));var util=require(_0x70c0('0x1'));var logger=require(_0x70c0('0x2'))(_0x70c0('0x3'));var moment=require(_0x70c0('0x4'));var BPromise=require(_0x70c0('0x5'));var rp=require(_0x70c0('0x6'));var fs=require('fs');var path=require(_0x70c0('0x7'));var rimraf=require(_0x70c0('0x8'));var config=require(_0x70c0('0x9'));var attributes=require(_0x70c0('0xa'));module[_0x70c0('0xb')]=function(_0x5b920d,_0x379689){return _0x5b920d['define']('Action',attributes,{'tableName':_0x70c0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index fbdda82..2e1db98 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x4975,0x86));var _0x5497=function(_0x35c2ea,_0x3bedd8){_0x35c2ea=_0x35c2ea-0x0;var _0x330815=_0x4975[_0x35c2ea];return _0x330815;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x38d979,_0x87025f){var _0x2839bd=function(_0x37d603){while(--_0x37d603){_0x38d979['push'](_0x38d979['shift']());}};_0x2839bd(++_0x87025f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index ab48a6f..43c578b 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 _0x2e52=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','delete'];(function(_0x52da76,_0x4b4be5){var _0x3ce510=function(_0x2b8acd){while(--_0x2b8acd){_0x52da76['push'](_0x52da76['shift']());}};_0x3ce510(++_0x4b4be5);}(_0x2e52,0xc6));var _0x22e5=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x2e52[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require('multer');var util=require(_0x22e5('0x0'));var path=require(_0x22e5('0x1'));var timeout=require(_0x22e5('0x2'));var express=require(_0x22e5('0x3'));var router=express[_0x22e5('0x4')]();var fs_extra=require(_0x22e5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22e5('0x6'));var config=require(_0x22e5('0x7'));var controller=require('./action.controller');router['put'](_0x22e5('0x8'),auth[_0x22e5('0x9')](),controller[_0x22e5('0xa')]);router[_0x22e5('0xb')](_0x22e5('0x8'),auth['isAuthenticated'](),controller[_0x22e5('0xc')]);module[_0x22e5('0xd')]=router;
\ No newline at end of file
+var _0x1931=['../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x583f82,_0xf23fcd){var _0x710688=function(_0x1b9777){while(--_0x1b9777){_0x583f82['push'](_0x583f82['shift']());}};_0x710688(++_0xf23fcd);}(_0x1931,0xb9));var _0x1193=function(_0x394659,_0x46f5d9){_0x394659=_0x394659-0x0;var _0x63dc75=_0x1931[_0x394659];return _0x63dc75;};'use strict';var multer=require(_0x1193('0x0'));var util=require(_0x1193('0x1'));var path=require('path');var timeout=require(_0x1193('0x2'));var express=require(_0x1193('0x3'));var router=express[_0x1193('0x4')]();var fs_extra=require(_0x1193('0x5'));var auth=require(_0x1193('0x6'));var interaction=require(_0x1193('0x7'));var config=require('../../config/environment');var controller=require(_0x1193('0x8'));router[_0x1193('0x9')](_0x1193('0xa'),auth[_0x1193('0xb')](),controller[_0x1193('0xc')]);router[_0x1193('0xd')](_0x1193('0xa'),auth[_0x1193('0xb')](),controller[_0x1193('0xe')]);module[_0x1193('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 9eebb33..1ae2699 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 _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x58b9ee,_0x1ad7a7){var _0x10b356=function(_0x18d48f){while(--_0x18d48f){_0x58b9ee['push'](_0x58b9ee['shift']());}};_0x10b356(++_0x1ad7a7);}(_0xd8fb,0x99));var _0xbd8f=function(_0x12624f,_0x17bdd6){_0x12624f=_0x12624f-0x0;var _0x83fc5e=_0xd8fb[_0x12624f];return _0x83fc5e;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
+var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x2203ec,_0x1831e1){var _0x28a943=function(_0x4aee27){while(--_0x4aee27){_0x2203ec['push'](_0x2203ec['shift']());}};_0x28a943(++_0x1831e1);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2ce261,_0x444d40){_0x2ce261=_0x2ce261-0x0;var _0x4a26a8=_0x3f8a[_0x2ce261];return _0x4a26a8;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f42bb0c..7daf767 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 _0x9d62=['Run\x20Query:','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','Please\x20insert\x20at\x20least\x20one\x20field','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','get','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','Reports','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','DATE(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','keyBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate'];(function(_0x131df6,_0x1c9ed0){var _0x44f2e5=function(_0x2bb0de){while(--_0x2bb0de){_0x131df6['push'](_0x131df6['shift']());}};_0x44f2e5(++_0x1c9ed0);}(_0x9d62,0xaf));var _0x29d6=function(_0x4812a9,_0x136b24){_0x4812a9=_0x4812a9-0x0;var _0x8a930f=_0x9d62[_0x4812a9];return _0x8a930f;};'use strict';var emlformat=require(_0x29d6('0x0'));var rimraf=require(_0x29d6('0x1'));var zipdir=require(_0x29d6('0x2'));var jsonpatch=require(_0x29d6('0x3'));var rp=require(_0x29d6('0x4'));var moment=require('moment');var BPromise=require(_0x29d6('0x5'));var Mustache=require(_0x29d6('0x6'));var util=require(_0x29d6('0x7'));var path=require(_0x29d6('0x8'));var sox=require(_0x29d6('0x9'));var csv=require('to-csv');var ejs=require(_0x29d6('0xa'));var fs=require('fs');var fs_extra=require(_0x29d6('0xb'));var _=require(_0x29d6('0xc'));var squel=require(_0x29d6('0xd'));var crypto=require(_0x29d6('0xe'));var jsforce=require(_0x29d6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x29d6('0x10'));var querystring=require(_0x29d6('0x11'));var Papa=require(_0x29d6('0x12'));var Redis=require(_0x29d6('0x13'));var authService=require(_0x29d6('0x14'));var qs=require(_0x29d6('0x15'));var as=require(_0x29d6('0x16'));var hardwareService=require(_0x29d6('0x17'));var logger=require('../../config/logger')(_0x29d6('0x18'));var utils=require(_0x29d6('0x19'));var config=require(_0x29d6('0x1a'));var licenseUtil=require(_0x29d6('0x1b'));var db=require(_0x29d6('0x1c'))['db'];var dbH=require(_0x29d6('0x1c'))[_0x29d6('0x1d')];function respondWithStatusCode(_0x4bb3e2,_0x32d024){_0x32d024=_0x32d024||0xcc;return function(_0x5d7e8a){if(_0x5d7e8a){return _0x4bb3e2[_0x29d6('0x1e')](_0x32d024);}return _0x4bb3e2[_0x29d6('0x1f')](_0x32d024)[_0x29d6('0x20')]();};}function respondWithResult(_0x305a69,_0x5aba64){_0x5aba64=_0x5aba64||0xc8;return function(_0x4b5142){if(_0x4b5142){return _0x305a69['status'](_0x5aba64)[_0x29d6('0x21')](_0x4b5142);}};}function respondWithFilteredResult(_0x30d39f,_0x261225){return function(_0x93bf56){if(_0x93bf56){var _0x40cac1=typeof _0x261225[_0x29d6('0x22')]===_0x29d6('0x23')&&typeof _0x261225['limit']===_0x29d6('0x23');var _0x46307e=_0x93bf56[_0x29d6('0x24')];var _0x50c734=_0x40cac1?0x0:_0x261225[_0x29d6('0x22')];var _0x431496=_0x40cac1?_0x93bf56[_0x29d6('0x24')]:_0x261225[_0x29d6('0x22')]+_0x261225[_0x29d6('0x25')];var _0xc193d;if(_0x431496>=_0x46307e){_0x431496=_0x46307e;_0xc193d=0xc8;}else{_0xc193d=0xce;}_0x30d39f[_0x29d6('0x1f')](_0xc193d);return _0x30d39f[_0x29d6('0x26')]('Content-Range',_0x50c734+'-'+_0x431496+'/'+_0x46307e)[_0x29d6('0x21')](_0x93bf56);}return null;};}function patchUpdates(_0x425263){return function(_0x5c2774){try{jsonpatch[_0x29d6('0x27')](_0x5c2774,_0x425263,!![]);}catch(_0x3f5d3d){return BPromise[_0x29d6('0x28')](_0x3f5d3d);}return _0x5c2774['save']();};}function saveUpdates(_0x53f285,_0x1d8d32){return function(_0x4a7414){if(_0x4a7414){return _0x4a7414[_0x29d6('0x29')](_0x53f285)[_0x29d6('0x2a')](function(_0x51cff7){return _0x51cff7;});}return null;};}function removeEntity(_0x8d91f5,_0x28370b){return function(_0xbb646a){if(_0xbb646a){return _0xbb646a[_0x29d6('0x2b')]()[_0x29d6('0x2a')](function(){var _0x4d0f45=_0xbb646a[_0x29d6('0x2c')]({'plain':!![]});var _0x4c6583='CustomReports';return db['UserProfileResource'][_0x29d6('0x2b')]({'where':{'type':_0x4c6583,'resourceId':_0x4d0f45['id']}})['then'](function(){return _0xbb646a;});})[_0x29d6('0x2a')](function(){_0x8d91f5[_0x29d6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x210ee1,_0x53830a){return function(_0x469c2f){if(!_0x469c2f){_0x210ee1['sendStatus'](0x194);}return _0x469c2f;};}function handleError(_0x4af26f,_0x110dc5){_0x110dc5=_0x110dc5||0x1f4;return function(_0x20ab9b){logger['error'](_0x20ab9b[_0x29d6('0x2d')]);if(_0x20ab9b[_0x29d6('0x2e')]){delete _0x20ab9b[_0x29d6('0x2e')];}_0x4af26f[_0x29d6('0x1f')](_0x110dc5)['send'](_0x20ab9b);};}exports[_0x29d6('0x2f')]=function(_0x5eb783,_0x49abc9){var _0x47ebba={},_0x420a15={},_0x7665c4={'count':0x0,'rows':[]};var _0x5a7d8d=_[_0x29d6('0x30')](db[_0x29d6('0x31')][_0x29d6('0x32')],function(_0x2c8ef2){return{'name':_0x2c8ef2[_0x29d6('0x33')],'type':_0x2c8ef2['type'][_0x29d6('0x34')]};});_0x420a15[_0x29d6('0x35')]=_[_0x29d6('0x30')](_0x5a7d8d,_0x29d6('0x2e'));_0x420a15['query']=_[_0x29d6('0x36')](_0x5eb783[_0x29d6('0x37')]);_0x420a15[_0x29d6('0x38')]=_[_0x29d6('0x39')](_0x420a15[_0x29d6('0x35')],_0x420a15['query']);_0x47ebba[_0x29d6('0x3a')]=_[_0x29d6('0x39')](_0x420a15[_0x29d6('0x35')],qs[_0x29d6('0x3b')](_0x5eb783[_0x29d6('0x37')][_0x29d6('0x3b')]));_0x47ebba[_0x29d6('0x3a')]=_0x47ebba[_0x29d6('0x3a')][_0x29d6('0x3c')]?_0x47ebba[_0x29d6('0x3a')]:_0x420a15[_0x29d6('0x35')];if(!_0x5eb783[_0x29d6('0x37')]['hasOwnProperty']('nolimit')){_0x47ebba['limit']=qs[_0x29d6('0x25')](_0x5eb783[_0x29d6('0x37')]['limit']);_0x47ebba[_0x29d6('0x22')]=qs[_0x29d6('0x22')](_0x5eb783[_0x29d6('0x37')][_0x29d6('0x22')]);}_0x47ebba[_0x29d6('0x3d')]=qs[_0x29d6('0x3e')](_0x5eb783['query'][_0x29d6('0x3e')]);_0x47ebba[_0x29d6('0x3f')]=qs[_0x29d6('0x38')](_[_0x29d6('0x40')](_0x5eb783[_0x29d6('0x37')],_0x420a15[_0x29d6('0x38')]),_0x5a7d8d);if(_0x5eb783[_0x29d6('0x37')][_0x29d6('0x41')]){_0x47ebba[_0x29d6('0x3f')]=_[_0x29d6('0x42')](_0x47ebba[_0x29d6('0x3f')],{'$or':_[_0x29d6('0x30')](_0x5a7d8d,function(_0xaa6d97){if(_0xaa6d97[_0x29d6('0x43')]!==_0x29d6('0x44')){var _0x23b31f={};_0x23b31f[_0xaa6d97[_0x29d6('0x2e')]]={'$like':'%'+_0x5eb783['query']['filter']+'%'};return _0x23b31f;}})});}_0x47ebba=_[_0x29d6('0x42')]({},_0x47ebba,_0x5eb783[_0x29d6('0x45')]);var _0x281cdc={'where':_0x47ebba[_0x29d6('0x3f')]};return db[_0x29d6('0x31')][_0x29d6('0x24')](_0x281cdc)[_0x29d6('0x2a')](function(_0x2b004e){_0x7665c4['count']=_0x2b004e;if(_0x5eb783[_0x29d6('0x37')][_0x29d6('0x46')]){_0x47ebba[_0x29d6('0x47')]=[{'all':!![]}];}return db[_0x29d6('0x31')][_0x29d6('0x48')](_0x47ebba);})[_0x29d6('0x2a')](function(_0xbbce8b){_0x7665c4[_0x29d6('0x49')]=_0xbbce8b;return _0x7665c4;})['then'](respondWithFilteredResult(_0x49abc9,_0x47ebba))[_0x29d6('0x4a')](handleError(_0x49abc9,null));};exports[_0x29d6('0x4b')]=function(_0x2c3cd5,_0x43042d){var _0x5038ef={'raw':![],'where':{'id':_0x2c3cd5[_0x29d6('0x4c')]['id']}},_0x170acc={};_0x170acc[_0x29d6('0x35')]=_[_0x29d6('0x36')](db[_0x29d6('0x31')][_0x29d6('0x32')]);_0x170acc[_0x29d6('0x37')]=_['keys'](_0x2c3cd5[_0x29d6('0x37')]);_0x170acc[_0x29d6('0x38')]=_[_0x29d6('0x39')](_0x170acc['model'],_0x170acc['query']);_0x5038ef[_0x29d6('0x3a')]=_[_0x29d6('0x39')](_0x170acc[_0x29d6('0x35')],qs[_0x29d6('0x3b')](_0x2c3cd5[_0x29d6('0x37')]['fields']));_0x5038ef[_0x29d6('0x3a')]=_0x5038ef[_0x29d6('0x3a')]['length']?_0x5038ef['attributes']:_0x170acc['model'];if(_0x2c3cd5[_0x29d6('0x37')][_0x29d6('0x46')]){_0x5038ef[_0x29d6('0x47')]=[{'all':!![]}];}_0x5038ef=_[_0x29d6('0x42')]({},_0x5038ef,_0x2c3cd5[_0x29d6('0x45')]);return db[_0x29d6('0x31')][_0x29d6('0x4d')](_0x5038ef)['then'](handleEntityNotFound(_0x43042d,null))[_0x29d6('0x2a')](respondWithResult(_0x43042d,null))[_0x29d6('0x4a')](handleError(_0x43042d,null));};exports[_0x29d6('0x4e')]=function(_0x570a3c,_0x82e621){return db[_0x29d6('0x31')][_0x29d6('0x4e')](_0x570a3c[_0x29d6('0x4f')],{})[_0x29d6('0x2a')](function(_0x3341f2){var _0x2ac52a=_0x570a3c[_0x29d6('0x50')][_0x29d6('0x2c')]({'plain':!![]});if(!_0x2ac52a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ac52a[_0x29d6('0x51')]===_0x29d6('0x50')){var _0x1acbac=_0x3341f2[_0x29d6('0x2c')]({'plain':!![]});var _0x22cfb4=_0x29d6('0x52');return db[_0x29d6('0x53')][_0x29d6('0x4d')]({'where':{'name':_0x22cfb4,'userProfileId':_0x2ac52a['userProfileId']},'raw':!![]})[_0x29d6('0x2a')](function(_0x43dc87){if(_0x43dc87&&_0x43dc87[_0x29d6('0x54')]===0x0){return db['UserProfileResource'][_0x29d6('0x4e')]({'name':_0x1acbac[_0x29d6('0x2e')],'resourceId':_0x1acbac['id'],'type':'CustomReports','sectionId':_0x43dc87['id']},{})[_0x29d6('0x2a')](function(){return _0x3341f2;});}else{return _0x3341f2;}})[_0x29d6('0x4a')](function(_0x2184a4){logger[_0x29d6('0x55')](_0x29d6('0x56'),_0x2184a4);throw _0x2184a4;});}return _0x3341f2;})[_0x29d6('0x2a')](respondWithResult(_0x82e621,0xc9))['catch'](handleError(_0x82e621,null));};exports[_0x29d6('0x29')]=function(_0x59f9ea,_0x49e2fe){if(_0x59f9ea[_0x29d6('0x4f')]['id']){delete _0x59f9ea[_0x29d6('0x4f')]['id'];}return db['AnalyticCustomReport'][_0x29d6('0x4d')]({'where':{'id':_0x59f9ea[_0x29d6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x49e2fe,null))[_0x29d6('0x2a')](saveUpdates(_0x59f9ea[_0x29d6('0x4f')],null))[_0x29d6('0x2a')](respondWithResult(_0x49e2fe,null))[_0x29d6('0x4a')](handleError(_0x49e2fe,null));};exports[_0x29d6('0x2b')]=function(_0x279ec8,_0x36c7ce){return db[_0x29d6('0x31')][_0x29d6('0x4d')]({'where':{'id':_0x279ec8['params']['id']}})[_0x29d6('0x2a')](handleEntityNotFound(_0x36c7ce,null))[_0x29d6('0x2a')](removeEntity(_0x36c7ce,null))['catch'](handleError(_0x36c7ce,null));};exports[_0x29d6('0x57')]=function(_0x52c285,_0x13c26a){var _0x1502f3=0xa;var _0x3a46aa=[_0x29d6('0x58'),_0x29d6('0x59'),_0x29d6('0x5a'),_0x29d6('0x5b')];var _0xbdc27b={'SUM':_0x29d6('0x5c'),'COUNT':_0x29d6('0x5d'),'COUNT DISTINCT':_0x29d6('0x5e'),'MAX':_0x29d6('0x5f'),'MIN':_0x29d6('0x60'),'AVG':_0x29d6('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x29d6('0x62'),'GROUP_CONCAT DESC':_0x29d6('0x63')};var _0x367a1e={'SEC_TO_TIME':_0x29d6('0x64'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x29d6('0x65'),'UNIX_TIMESTAMP':_0x29d6('0x66')};var _0x42bc78=function(_0x2e6796){return!_[_0x29d6('0x67')]([_0x29d6('0x68'),'IS\x20NOT\x20NULL',_0x29d6('0x69'),'IS\x20NOT\x20EMPTY'],_0x2e6796);};var _0x5d227a=function(_0x37c370){if(!_0x37c370||!_0x37c370[_0x29d6('0x6a')][_0x29d6('0x3c')]){return'';}for(var _0x25123d='(',_0xd6d6de=0x0;_0xd6d6de<_0x37c370['rules'][_0x29d6('0x3c')];_0xd6d6de+=0x1){_0xd6d6de>0x0&&(_0x25123d+='\x20'+_0x37c370[_0x29d6('0x6b')]+'\x20');_0x25123d+=_0x37c370[_0x29d6('0x6a')][_0xd6d6de][_0x29d6('0x6c')]?_0x5d227a(_0x37c370[_0x29d6('0x6a')][_0xd6d6de]['group']):_0x37c370[_0x29d6('0x6a')][_0xd6d6de][_0x29d6('0x6d')]+'\x20'+_0x37c370['rules'][_0xd6d6de][_0x29d6('0x6e')]+(_0x42bc78(_0x37c370[_0x29d6('0x6a')][_0xd6d6de][_0x29d6('0x6e')])?'\x20'+_0x37c370['rules'][_0xd6d6de]['value']:'');}return _0x25123d+')';};var _0x54ab3b={'where':{'id':_0x52c285['params']['id']}},_0x13132e,_0x3800fe,_0x12201b,_0x25a71c,_0x3d4f9e;_0x54ab3b=_[_0x29d6('0x42')]({},_0x54ab3b,_0x52c285['options']);return db[_0x29d6('0x31')]['find'](_0x54ab3b)['then'](function(_0x56049a){if(_0x56049a){_0x13132e=_0x56049a;return _0x56049a[_0x29d6('0x6f')]();}return null;})[_0x29d6('0x2a')](function(_0x4b79af){if(_0x4b79af){if(!_0x4b79af[_0x29d6('0x3c')]){throw new db[(_0x29d6('0x70'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3800fe=_0x4b79af;return db[_0x29d6('0x71')]['findAll']({'raw':!![]});}return null;})[_0x29d6('0x2a')](function(_0x4a12cd){if(_0x4a12cd){_0x12201b=_['keyBy'](_0x4a12cd,'id');var _0x56f05f;var _0x353c4c=squel[_0x29d6('0x72')]();_0x353c4c[_0x29d6('0x73')](_0x13132e[_0x29d6('0x74')]);for(var _0x3765de=0x0;_0x3765de<_0x3800fe[_0x29d6('0x3c')];_0x3765de+=0x1){_0x56f05f=_0x3800fe[_0x3765de][_0x29d6('0x75')]?_0x12201b[_0x3800fe[_0x3765de][_0x29d6('0x75')]][_0x29d6('0x76')]:_0x3800fe[_0x3765de][_0x29d6('0x6d')];_0x56f05f=_0x3800fe[_0x3765de]['function']?_[_0x29d6('0x77')](_0xbdc27b[_0x3800fe[_0x3765de][_0x29d6('0x78')]],'%s',_0x56f05f):_0x56f05f;_0x56f05f=_0x3800fe[_0x3765de]['format']?_['replace'](_0x367a1e[_0x3800fe[_0x3765de][_0x29d6('0x79')]],'%s',_0x56f05f):_0x56f05f;if(_0x3800fe[_0x3765de][_0x29d6('0x7a')]){_0x353c4c[_0x29d6('0x6c')](_0x56f05f);}_0x3800fe[_0x3765de][_0x29d6('0x7b')]&&_0x353c4c[_0x29d6('0x3d')](_0x56f05f,_0x3800fe[_0x3765de][_0x29d6('0x7b')]===_0x29d6('0x7c')?![]:!![]);_0x353c4c[_0x29d6('0x6d')](_0x56f05f,_0x3800fe[_0x3765de][_0x29d6('0x7d')]||_0x56f05f);}if(_0x13132e[_0x29d6('0x7e')]){_0x13132e[_0x29d6('0x7e')]=JSON[_0x29d6('0x7f')](_0x13132e['joins']);for(var _0x4db9b6=0x0;_0x4db9b6<_0x13132e[_0x29d6('0x7e')][_0x29d6('0x3c')];_0x4db9b6+=0x1){if(_0x13132e['joins'][_0x4db9b6][_0x29d6('0x43')]&&_[_0x29d6('0x67')](_0x3a46aa,_0x13132e[_0x29d6('0x7e')][_0x4db9b6][_0x29d6('0x43')])&&_0x13132e[_0x29d6('0x7e')][_0x4db9b6][_0x29d6('0x80')]&&_0x13132e[_0x29d6('0x7e')][_0x4db9b6][_0x29d6('0x81')]&&_0x13132e[_0x29d6('0x7e')][_0x4db9b6][_0x29d6('0x82')]){_0x353c4c[_0x13132e[_0x29d6('0x7e')][_0x4db9b6][_0x29d6('0x43')]](_0x13132e[_0x29d6('0x7e')][_0x4db9b6][_0x29d6('0x81')],null,util[_0x29d6('0x79')]('%s.%s\x20=\x20%s.%s',_0x13132e[_0x29d6('0x74')],_0x13132e[_0x29d6('0x7e')][_0x4db9b6][_0x29d6('0x80')],_0x13132e[_0x29d6('0x7e')][_0x4db9b6][_0x29d6('0x81')],_0x13132e['joins'][_0x4db9b6][_0x29d6('0x82')]));}}}if(_0x13132e[_0x29d6('0x83')]){_0x13132e[_0x29d6('0x83')]=JSON[_0x29d6('0x7f')](_0x13132e[_0x29d6('0x83')]);_0x353c4c[_0x29d6('0x3f')](_0x5d227a(_0x13132e[_0x29d6('0x83')][_0x29d6('0x6c')]));}_0x3d4f9e=_0x353c4c[_0x29d6('0x84')]();_0x353c4c[_0x29d6('0x25')](_0x1502f3);_0x353c4c[_0x29d6('0x22')](0x0);logger['debug']('Limited\x20Query:',_0x353c4c[_0x29d6('0x85')]());return dbH[_0x29d6('0x86')][_0x29d6('0x37')](_0x353c4c['toString'](),{'type':dbH[_0x29d6('0x86')][_0x29d6('0x87')][_0x29d6('0x88')]});}})['then'](respondWithResult(_0x13c26a,null))['catch'](handleError(_0x13c26a,null));};function runReport(_0x2160cb,_0x40e0a4,_0x3bc4b7){var _0x367900=_0x40e0a4[_0x29d6('0x2e')];var _0xaa8c47=0xa;var _0x37523a=[_0x29d6('0x58'),_0x29d6('0x59'),_0x29d6('0x5a'),_0x29d6('0x5b')];var _0x29a070={'SUM':_0x29d6('0x5c'),'COUNT':_0x29d6('0x5d'),'COUNT DISTINCT':_0x29d6('0x5e'),'MAX':_0x29d6('0x5f'),'MIN':_0x29d6('0x60'),'AVG':_0x29d6('0x61'),'GROUP_CONCAT':_0x29d6('0x89'),'GROUP_CONCAT ASC':_0x29d6('0x62'),'GROUP_CONCAT DESC':_0x29d6('0x63')};var _0x18cc18={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x29d6('0x8a'),'HOUR':'HOUR(%s)','ROUND':_0x29d6('0x65'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5c3075=function(_0x2fb57c){return!_['includes']([_0x29d6('0x68'),_0x29d6('0x8b'),_0x29d6('0x69'),_0x29d6('0x8c')],_0x2fb57c);};var _0x392a06=function(_0x39728e){if(!_0x39728e||!_0x39728e[_0x29d6('0x6a')][_0x29d6('0x3c')]){return'';}for(var _0x4d1447='(',_0x4a7e32=0x0;_0x4a7e32<_0x39728e['rules']['length'];_0x4a7e32+=0x1){_0x4a7e32>0x0&&(_0x4d1447+='\x20'+_0x39728e['operator']+'\x20');_0x4d1447+=_0x39728e[_0x29d6('0x6a')][_0x4a7e32][_0x29d6('0x6c')]?_0x392a06(_0x39728e[_0x29d6('0x6a')][_0x4a7e32]['group']):_0x39728e[_0x29d6('0x6a')][_0x4a7e32][_0x29d6('0x6d')]+'\x20'+_0x39728e[_0x29d6('0x6a')][_0x4a7e32][_0x29d6('0x6e')]+(_0x5c3075(_0x39728e[_0x29d6('0x6a')][_0x4a7e32]['condition'])?'\x20'+_0x39728e[_0x29d6('0x6a')][_0x4a7e32][_0x29d6('0x8d')]:'');}return _0x4d1447+')';};var _0x3858c2={'where':{'id':_0x2160cb['id']}},_0x1fa11b,_0x2f2ada,_0x4e4f3b,_0x500540,_0x26bd09;_0x3858c2=_[_0x29d6('0x42')]({},_0x3858c2,_0x3bc4b7);return db[_0x29d6('0x31')][_0x29d6('0x4d')](_0x3858c2)['then'](function(_0x5daea5){if(_0x5daea5){_0x1fa11b=_0x5daea5;return _0x5daea5[_0x29d6('0x6f')]();}return null;})[_0x29d6('0x2a')](function(_0x5dd181){if(_0x5dd181){if(!_0x5dd181['length']){throw new db[(_0x29d6('0x70'))][(_0x29d6('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2f2ada=_0x5dd181;return db['AnalyticMetric'][_0x29d6('0x48')]({'raw':!![]});}return null;})[_0x29d6('0x2a')](function(_0x14f895){if(_0x14f895){_0x4e4f3b=_[_0x29d6('0x8f')](_0x14f895,'id');var _0x2e02ac;var _0xbf4e80=squel[_0x29d6('0x72')]();_0xbf4e80[_0x29d6('0x73')](_0x1fa11b[_0x29d6('0x74')]);for(var _0x43b3ff=0x0;_0x43b3ff<_0x2f2ada['length'];_0x43b3ff+=0x1){_0x2e02ac=_0x2f2ada[_0x43b3ff]['MetricId']?_0x4e4f3b[_0x2f2ada[_0x43b3ff]['MetricId']][_0x29d6('0x76')]:_0x2f2ada[_0x43b3ff][_0x29d6('0x6d')];_0x2e02ac=_0x2f2ada[_0x43b3ff][_0x29d6('0x78')]?_[_0x29d6('0x77')](_0x29a070[_0x2f2ada[_0x43b3ff][_0x29d6('0x78')]],'%s',_0x2e02ac):_0x2e02ac;_0x2e02ac=_0x2f2ada[_0x43b3ff][_0x29d6('0x79')]?_['replace'](_0x18cc18[_0x2f2ada[_0x43b3ff][_0x29d6('0x79')]],'%s',_0x2e02ac):_0x2e02ac;if(_0x2f2ada[_0x43b3ff][_0x29d6('0x7a')]){_0xbf4e80['group'](_0x2e02ac);}_0x2f2ada[_0x43b3ff][_0x29d6('0x7b')]&&_0xbf4e80[_0x29d6('0x3d')](_0x2e02ac,_0x2f2ada[_0x43b3ff][_0x29d6('0x7b')]===_0x29d6('0x7c')?![]:!![]);_0xbf4e80['field'](_0x2e02ac,_0x2f2ada[_0x43b3ff][_0x29d6('0x7d')]||_0x2e02ac);}if(_0x1fa11b['joins']){_0x1fa11b[_0x29d6('0x7e')]=JSON[_0x29d6('0x7f')](_0x1fa11b['joins']);for(var _0x463528=0x0;_0x463528<_0x1fa11b[_0x29d6('0x7e')][_0x29d6('0x3c')];_0x463528+=0x1){if(_0x1fa11b[_0x29d6('0x7e')][_0x463528][_0x29d6('0x43')]&&_['includes'](_0x37523a,_0x1fa11b[_0x29d6('0x7e')][_0x463528][_0x29d6('0x43')])&&_0x1fa11b[_0x29d6('0x7e')][_0x463528]['parentKey']&&_0x1fa11b[_0x29d6('0x7e')][_0x463528][_0x29d6('0x81')]&&_0x1fa11b[_0x29d6('0x7e')][_0x463528][_0x29d6('0x82')]){_0xbf4e80[_0x1fa11b[_0x29d6('0x7e')][_0x463528][_0x29d6('0x43')]](_0x1fa11b['joins'][_0x463528][_0x29d6('0x81')],null,util[_0x29d6('0x79')](_0x29d6('0x90'),_0x1fa11b[_0x29d6('0x74')],_0x1fa11b[_0x29d6('0x7e')][_0x463528][_0x29d6('0x80')],_0x1fa11b['joins'][_0x463528][_0x29d6('0x81')],_0x1fa11b[_0x29d6('0x7e')][_0x463528][_0x29d6('0x82')]));}}}if(_0x1fa11b[_0x29d6('0x83')]){_0x1fa11b[_0x29d6('0x83')]=JSON[_0x29d6('0x7f')](_0x1fa11b['conditions']);_0xbf4e80[_0x29d6('0x3f')](_0x392a06(_0x1fa11b[_0x29d6('0x83')]['group']));}_0x26bd09=_0xbf4e80[_0x29d6('0x84')]();_0xbf4e80[_0x29d6('0x25')](_0xaa8c47);_0xbf4e80[_0x29d6('0x22')](0x0);return;}})[_0x29d6('0x2a')](function(){if(_0x40e0a4[_0x29d6('0x91')]===_0x29d6('0x92')){return null;}var _0x2d00fb=_[_0x29d6('0x42')](_0x40e0a4,{'name':_0x40e0a4[_0x29d6('0x93')]||_0x40e0a4[_0x29d6('0x2e')]||_0x1fa11b[_0x29d6('0x2e')],'basename':_0x367900,'savename':util[_0x29d6('0x79')](_0x29d6('0x94'),_0x40e0a4[_0x29d6('0x2e')]||_0x1fa11b[_0x29d6('0x2e')],require(_0x29d6('0x95'))[_0x29d6('0x96')](0x4),_0x40e0a4[_0x29d6('0x91')]||_0x29d6('0x97')),'reportId':_0x1fa11b['id'],'reportType':_0x29d6('0x98')});return db[_0x29d6('0x99')][_0x29d6('0x4e')](_0x2d00fb,{'raw':!![]});})['then'](function(_0x2a44b5){if(_0x1fa11b[_0x29d6('0x74')]==='cdr'){_0x26bd09[_0x29d6('0x3f')](_0x1fa11b[_0x29d6('0x74')]+_0x29d6('0x9a'),_0x40e0a4[_0x29d6('0x9b')],_0x40e0a4[_0x29d6('0x9c')]);}else{_0x26bd09[_0x29d6('0x3f')](_0x1fa11b[_0x29d6('0x74')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x40e0a4[_0x29d6('0x9b')],_0x40e0a4[_0x29d6('0x9c')]);}if(_0x2a44b5){logger['info'](_0x29d6('0x9d'),_0x26bd09[_0x29d6('0x85')]());require('child_process')['fork'](path['join'](__dirname,_0x29d6('0x9e'),_0x2a44b5[_0x29d6('0x91')]),[_0x2a44b5['id'],_0x26bd09[_0x29d6('0x85')](),path['join'](__dirname,_0x29d6('0x9f'),_0x2a44b5[_0x29d6('0xa0')]),_0x367900]);return _0x2a44b5;}else{var _0x243e35=squel['select']();_0x243e35['from']('('+_0x26bd09[_0x29d6('0x85')]()+')','countTable');_0x243e35['field'](_0x29d6('0xa1'),_0x29d6('0x24'));_0x26bd09[_0x29d6('0x25')](_0x40e0a4['limit']||_0xaa8c47);_0x26bd09[_0x29d6('0x22')](_0x40e0a4[_0x29d6('0x22')]||0x0);return dbH[_0x29d6('0x86')][_0x29d6('0x37')](_0x243e35[_0x29d6('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x29d6('0x88')]})[_0x29d6('0x2a')](function(_0xa59f7){if(!_0xa59f7['length']){_0x500540=0x0;}else{_0x500540=_0xa59f7[0x0][_0x29d6('0x24')]||0x0;}return dbH['sequelize'][_0x29d6('0x37')](_0x26bd09[_0x29d6('0x85')](),{'type':dbH[_0x29d6('0x86')][_0x29d6('0x87')][_0x29d6('0x88')]});})['then'](function(_0x34e975){return{'rows':_0x34e975||[],'count':_0x500540};});}});}exports[_0x29d6('0xa2')]=function(_0x5f2e01,_0x16961c){return runReport(_0x5f2e01['params'],_0x5f2e01['query'],_0x5f2e01[_0x29d6('0x45')])['then'](respondWithResult(_0x16961c,null))[_0x29d6('0x4a')](handleError(_0x16961c,null));};exports[_0x29d6('0xa3')]=runReport;exports[_0x29d6('0x37')]=function(_0x5a7755,_0x2b8865){var _0x36df6a=0xa;var _0x369f77=[_0x29d6('0x58'),_0x29d6('0x59'),_0x29d6('0x5a'),_0x29d6('0x5b')];var _0x1bdf87={'SUM':_0x29d6('0x5c'),'COUNT':_0x29d6('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x29d6('0x5f'),'MIN':_0x29d6('0x60'),'AVG':_0x29d6('0x61'),'GROUP_CONCAT':_0x29d6('0x89'),'GROUP_CONCAT ASC':_0x29d6('0x62'),'GROUP_CONCAT DESC':_0x29d6('0x63')};var _0x3e5cec={'SEC_TO_TIME':_0x29d6('0x64'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x29d6('0x65'),'UNIX_TIMESTAMP':_0x29d6('0x66')};var _0x488cc3=function(_0x23bc52){return!_[_0x29d6('0x67')](['IS\x20NULL',_0x29d6('0x8b'),_0x29d6('0x69'),_0x29d6('0x8c')],_0x23bc52);};var _0x59e6de=function(_0x34ef47){if(!_0x34ef47||!_0x34ef47[_0x29d6('0x6a')]['length']){return'';}for(var _0x21502e='(',_0x3af990=0x0;_0x3af990<_0x34ef47[_0x29d6('0x6a')][_0x29d6('0x3c')];_0x3af990+=0x1){_0x3af990>0x0&&(_0x21502e+='\x20'+_0x34ef47[_0x29d6('0x6b')]+'\x20');_0x21502e+=_0x34ef47['rules'][_0x3af990][_0x29d6('0x6c')]?_0x59e6de(_0x34ef47[_0x29d6('0x6a')][_0x3af990][_0x29d6('0x6c')]):_0x34ef47[_0x29d6('0x6a')][_0x3af990][_0x29d6('0x6d')]+'\x20'+_0x34ef47['rules'][_0x3af990][_0x29d6('0x6e')]+(_0x488cc3(_0x34ef47[_0x29d6('0x6a')][_0x3af990][_0x29d6('0x6e')])?'\x20'+_0x34ef47[_0x29d6('0x6a')][_0x3af990][_0x29d6('0x8d')]:'');}return _0x21502e+')';};var _0x11d54c={'where':{'id':_0x5a7755[_0x29d6('0x4c')]['id']}},_0x550551,_0x59ed14,_0x29c97a,_0x20d7d6,_0x149c51;_0x11d54c=_[_0x29d6('0x42')]({},_0x11d54c,_0x5a7755['options']);return db[_0x29d6('0x31')]['find'](_0x11d54c)['then'](function(_0x21a636){if(_0x21a636){_0x550551=_0x21a636;return _0x21a636[_0x29d6('0x6f')]();}return null;})[_0x29d6('0x2a')](function(_0x5a39d5){if(_0x5a39d5){if(!_0x5a39d5[_0x29d6('0x3c')]){throw new db[(_0x29d6('0x70'))]['ValidationErrorItem'](_0x29d6('0xa4'),0x193);}_0x59ed14=_0x5a39d5;return db[_0x29d6('0x71')][_0x29d6('0x48')]({'raw':!![]});}return null;})[_0x29d6('0x2a')](function(_0x4df64b){if(_0x4df64b){_0x29c97a=_[_0x29d6('0x8f')](_0x4df64b,'id');var _0x54095c;var _0x1012fa=squel[_0x29d6('0x72')]();_0x1012fa[_0x29d6('0x73')](_0x550551[_0x29d6('0x74')]);for(var _0x3671ac=0x0;_0x3671ac<_0x59ed14[_0x29d6('0x3c')];_0x3671ac+=0x1){_0x54095c=_0x59ed14[_0x3671ac][_0x29d6('0x75')]?_0x29c97a[_0x59ed14[_0x3671ac]['MetricId']][_0x29d6('0x76')]:_0x59ed14[_0x3671ac][_0x29d6('0x6d')];_0x54095c=_0x59ed14[_0x3671ac][_0x29d6('0x78')]?_['replace'](_0x1bdf87[_0x59ed14[_0x3671ac][_0x29d6('0x78')]],'%s',_0x54095c):_0x54095c;_0x54095c=_0x59ed14[_0x3671ac][_0x29d6('0x79')]?_[_0x29d6('0x77')](_0x3e5cec[_0x59ed14[_0x3671ac][_0x29d6('0x79')]],'%s',_0x54095c):_0x54095c;if(_0x59ed14[_0x3671ac]['groupBy']){_0x1012fa[_0x29d6('0x6c')](_0x54095c);}_0x59ed14[_0x3671ac][_0x29d6('0x7b')]&&_0x1012fa['order'](_0x54095c,_0x59ed14[_0x3671ac][_0x29d6('0x7b')]===_0x29d6('0x7c')?![]:!![]);_0x1012fa[_0x29d6('0x6d')](_0x54095c,_0x59ed14[_0x3671ac][_0x29d6('0x7d')]||_0x54095c);}if(_0x550551[_0x29d6('0x7e')]){_0x550551[_0x29d6('0x7e')]=JSON[_0x29d6('0x7f')](_0x550551[_0x29d6('0x7e')]);for(var _0x24d859=0x0;_0x24d859<_0x550551[_0x29d6('0x7e')]['length'];_0x24d859+=0x1){if(_0x550551[_0x29d6('0x7e')][_0x24d859][_0x29d6('0x43')]&&_[_0x29d6('0x67')](_0x369f77,_0x550551['joins'][_0x24d859][_0x29d6('0x43')])&&_0x550551[_0x29d6('0x7e')][_0x24d859][_0x29d6('0x80')]&&_0x550551[_0x29d6('0x7e')][_0x24d859][_0x29d6('0x81')]&&_0x550551[_0x29d6('0x7e')][_0x24d859][_0x29d6('0x82')]){_0x1012fa[_0x550551['joins'][_0x24d859][_0x29d6('0x43')]](_0x550551[_0x29d6('0x7e')][_0x24d859][_0x29d6('0x81')],null,util[_0x29d6('0x79')](_0x29d6('0x90'),_0x550551['table'],_0x550551[_0x29d6('0x7e')][_0x24d859][_0x29d6('0x80')],_0x550551[_0x29d6('0x7e')][_0x24d859][_0x29d6('0x81')],_0x550551[_0x29d6('0x7e')][_0x24d859][_0x29d6('0x82')]));}}}if(_0x550551[_0x29d6('0x83')]){_0x550551['conditions']=JSON['parse'](_0x550551[_0x29d6('0x83')]);_0x1012fa[_0x29d6('0x3f')](_0x59e6de(_0x550551[_0x29d6('0x83')]['group']));}_0x149c51=_0x1012fa[_0x29d6('0x84')]();_0x1012fa[_0x29d6('0x25')](_0x36df6a);_0x1012fa['offset'](0x0);logger[_0x29d6('0xa5')]('Limited\x20Query:',_0x1012fa[_0x29d6('0x85')]());return dbH['sequelize'][_0x29d6('0x37')](_0x1012fa[_0x29d6('0x85')](),{'type':dbH['sequelize'][_0x29d6('0x87')][_0x29d6('0x88')]});}})[_0x29d6('0x2a')](function(){return{'sql':_0x149c51[_0x29d6('0x85')]()};})[_0x29d6('0x2a')](respondWithResult(_0x2b8865,null))[_0x29d6('0x4a')](handleError(_0x2b8865,null));};
\ No newline at end of file
+var _0x0f51=['COUNT(*)','run','runReport','cross_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','Content-Range','save','update','then','destroy','get','CustomReports','error','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%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\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','AVG(%s)','getFields','Please\x20insert\x20at\x20least\x20one\x20field','metric','order','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','custom','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable'];(function(_0x47266b,_0x31700c){var _0x231604=function(_0x1af61c){while(--_0x1af61c){_0x47266b['push'](_0x47266b['shift']());}};_0x231604(++_0x31700c);}(_0x0f51,0x1ef));var _0x10f5=function(_0x2fa5a8,_0x3d422e){_0x2fa5a8=_0x2fa5a8-0x0;var _0x1728ad=_0x0f51[_0x2fa5a8];return _0x1728ad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x10f5('0x0'));var jsonpatch=require(_0x10f5('0x1'));var rp=require(_0x10f5('0x2'));var moment=require(_0x10f5('0x3'));var BPromise=require(_0x10f5('0x4'));var Mustache=require(_0x10f5('0x5'));var util=require('util');var path=require(_0x10f5('0x6'));var sox=require(_0x10f5('0x7'));var csv=require(_0x10f5('0x8'));var ejs=require(_0x10f5('0x9'));var fs=require('fs');var fs_extra=require(_0x10f5('0xa'));var _=require('lodash');var squel=require(_0x10f5('0xb'));var crypto=require('crypto');var jsforce=require(_0x10f5('0xc'));var deskjs=require(_0x10f5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x10f5('0xe'));var Papa=require('papaparse');var Redis=require(_0x10f5('0xf'));var authService=require(_0x10f5('0x10'));var qs=require(_0x10f5('0x11'));var as=require(_0x10f5('0x12'));var hardwareService=require(_0x10f5('0x13'));var logger=require(_0x10f5('0x14'))(_0x10f5('0x15'));var utils=require('../../config/utils');var config=require(_0x10f5('0x16'));var licenseUtil=require(_0x10f5('0x17'));var db=require(_0x10f5('0x18'))['db'];var dbH=require(_0x10f5('0x18'))[_0x10f5('0x19')];function respondWithStatusCode(_0x1d7309,_0x2973c5){_0x2973c5=_0x2973c5||0xcc;return function(_0x38d27d){if(_0x38d27d){return _0x1d7309[_0x10f5('0x1a')](_0x2973c5);}return _0x1d7309[_0x10f5('0x1b')](_0x2973c5)[_0x10f5('0x1c')]();};}function respondWithResult(_0x4b653e,_0x259634){_0x259634=_0x259634||0xc8;return function(_0x22d55b){if(_0x22d55b){return _0x4b653e[_0x10f5('0x1b')](_0x259634)['json'](_0x22d55b);}};}function respondWithFilteredResult(_0x882b5f,_0x3818fd){return function(_0x2a108f){if(_0x2a108f){var _0x14adf1=typeof _0x3818fd[_0x10f5('0x1d')]===_0x10f5('0x1e')&&typeof _0x3818fd[_0x10f5('0x1f')]===_0x10f5('0x1e');var _0x2c31d2=_0x2a108f['count'];var _0x4e325d=_0x14adf1?0x0:_0x3818fd[_0x10f5('0x1d')];var _0x592c08=_0x14adf1?_0x2a108f[_0x10f5('0x20')]:_0x3818fd[_0x10f5('0x1d')]+_0x3818fd[_0x10f5('0x1f')];var _0x1d6a16;if(_0x592c08>=_0x2c31d2){_0x592c08=_0x2c31d2;_0x1d6a16=0xc8;}else{_0x1d6a16=0xce;}_0x882b5f['status'](_0x1d6a16);return _0x882b5f['set'](_0x10f5('0x21'),_0x4e325d+'-'+_0x592c08+'/'+_0x2c31d2)['json'](_0x2a108f);}return null;};}function patchUpdates(_0x28521a){return function(_0x260fd6){try{jsonpatch['apply'](_0x260fd6,_0x28521a,!![]);}catch(_0x37f15d){return BPromise['reject'](_0x37f15d);}return _0x260fd6[_0x10f5('0x22')]();};}function saveUpdates(_0x37f344,_0xf298f6){return function(_0x2e748b){if(_0x2e748b){return _0x2e748b[_0x10f5('0x23')](_0x37f344)[_0x10f5('0x24')](function(_0x4fe426){return _0x4fe426;});}return null;};}function removeEntity(_0x312e61,_0x140646){return function(_0x342c73){if(_0x342c73){return _0x342c73[_0x10f5('0x25')]()[_0x10f5('0x24')](function(){var _0x22c158=_0x342c73[_0x10f5('0x26')]({'plain':!![]});var _0x408fe4=_0x10f5('0x27');return db['UserProfileResource'][_0x10f5('0x25')]({'where':{'type':_0x408fe4,'resourceId':_0x22c158['id']}})[_0x10f5('0x24')](function(){return _0x342c73;});})[_0x10f5('0x24')](function(){_0x312e61[_0x10f5('0x1b')](0xcc)[_0x10f5('0x1c')]();});}};}function handleEntityNotFound(_0x41c653,_0x427ffb){return function(_0x4ed39c){if(!_0x4ed39c){_0x41c653[_0x10f5('0x1a')](0x194);}return _0x4ed39c;};}function handleError(_0x373556,_0x489a96){_0x489a96=_0x489a96||0x1f4;return function(_0x16b9f1){logger[_0x10f5('0x28')](_0x16b9f1['stack']);if(_0x16b9f1[_0x10f5('0x29')]){delete _0x16b9f1[_0x10f5('0x29')];}_0x373556[_0x10f5('0x1b')](_0x489a96)[_0x10f5('0x2a')](_0x16b9f1);};}exports['index']=function(_0x1db91e,_0xc284ef){var _0x103f0d={},_0x439326={},_0x5a408b={'count':0x0,'rows':[]};var _0x269c23=_[_0x10f5('0x2b')](db[_0x10f5('0x2c')][_0x10f5('0x2d')],function(_0x5529f9){return{'name':_0x5529f9[_0x10f5('0x2e')],'type':_0x5529f9[_0x10f5('0x2f')][_0x10f5('0x30')]};});_0x439326[_0x10f5('0x31')]=_[_0x10f5('0x2b')](_0x269c23,_0x10f5('0x29'));_0x439326[_0x10f5('0x32')]=_[_0x10f5('0x33')](_0x1db91e[_0x10f5('0x32')]);_0x439326[_0x10f5('0x34')]=_[_0x10f5('0x35')](_0x439326[_0x10f5('0x31')],_0x439326[_0x10f5('0x32')]);_0x103f0d['attributes']=_[_0x10f5('0x35')](_0x439326[_0x10f5('0x31')],qs['fields'](_0x1db91e[_0x10f5('0x32')][_0x10f5('0x36')]));_0x103f0d[_0x10f5('0x37')]=_0x103f0d[_0x10f5('0x37')]['length']?_0x103f0d[_0x10f5('0x37')]:_0x439326[_0x10f5('0x31')];if(!_0x1db91e[_0x10f5('0x32')]['hasOwnProperty']('nolimit')){_0x103f0d[_0x10f5('0x1f')]=qs[_0x10f5('0x1f')](_0x1db91e[_0x10f5('0x32')][_0x10f5('0x1f')]);_0x103f0d[_0x10f5('0x1d')]=qs[_0x10f5('0x1d')](_0x1db91e[_0x10f5('0x32')][_0x10f5('0x1d')]);}_0x103f0d['order']=qs['sort'](_0x1db91e[_0x10f5('0x32')]['sort']);_0x103f0d[_0x10f5('0x38')]=qs['filters'](_[_0x10f5('0x39')](_0x1db91e[_0x10f5('0x32')],_0x439326[_0x10f5('0x34')]),_0x269c23);if(_0x1db91e[_0x10f5('0x32')][_0x10f5('0x3a')]){_0x103f0d['where']=_[_0x10f5('0x3b')](_0x103f0d[_0x10f5('0x38')],{'$or':_[_0x10f5('0x2b')](_0x269c23,function(_0x58ebb4){if(_0x58ebb4[_0x10f5('0x2f')]!==_0x10f5('0x3c')){var _0x52dd46={};_0x52dd46[_0x58ebb4[_0x10f5('0x29')]]={'$like':'%'+_0x1db91e[_0x10f5('0x32')][_0x10f5('0x3a')]+'%'};return _0x52dd46;}})});}_0x103f0d=_[_0x10f5('0x3b')]({},_0x103f0d,_0x1db91e[_0x10f5('0x3d')]);var _0x7aa794={'where':_0x103f0d[_0x10f5('0x38')]};return db[_0x10f5('0x2c')][_0x10f5('0x20')](_0x7aa794)[_0x10f5('0x24')](function(_0x3aa8d6){_0x5a408b[_0x10f5('0x20')]=_0x3aa8d6;if(_0x1db91e[_0x10f5('0x32')]['includeAll']){_0x103f0d[_0x10f5('0x3e')]=[{'all':!![]}];}return db[_0x10f5('0x2c')][_0x10f5('0x3f')](_0x103f0d);})['then'](function(_0x333b56){_0x5a408b[_0x10f5('0x40')]=_0x333b56;return _0x5a408b;})[_0x10f5('0x24')](respondWithFilteredResult(_0xc284ef,_0x103f0d))[_0x10f5('0x41')](handleError(_0xc284ef,null));};exports[_0x10f5('0x42')]=function(_0x4c74c6,_0xc888ba){var _0x2b5037={'raw':![],'where':{'id':_0x4c74c6[_0x10f5('0x43')]['id']}},_0x2eda34={};_0x2eda34[_0x10f5('0x31')]=_[_0x10f5('0x33')](db[_0x10f5('0x2c')][_0x10f5('0x2d')]);_0x2eda34[_0x10f5('0x32')]=_[_0x10f5('0x33')](_0x4c74c6[_0x10f5('0x32')]);_0x2eda34['filters']=_[_0x10f5('0x35')](_0x2eda34[_0x10f5('0x31')],_0x2eda34['query']);_0x2b5037[_0x10f5('0x37')]=_['intersection'](_0x2eda34[_0x10f5('0x31')],qs[_0x10f5('0x36')](_0x4c74c6[_0x10f5('0x32')][_0x10f5('0x36')]));_0x2b5037['attributes']=_0x2b5037['attributes'][_0x10f5('0x44')]?_0x2b5037[_0x10f5('0x37')]:_0x2eda34[_0x10f5('0x31')];if(_0x4c74c6[_0x10f5('0x32')][_0x10f5('0x45')]){_0x2b5037[_0x10f5('0x3e')]=[{'all':!![]}];}_0x2b5037=_[_0x10f5('0x3b')]({},_0x2b5037,_0x4c74c6[_0x10f5('0x3d')]);return db[_0x10f5('0x2c')]['find'](_0x2b5037)[_0x10f5('0x24')](handleEntityNotFound(_0xc888ba,null))[_0x10f5('0x24')](respondWithResult(_0xc888ba,null))[_0x10f5('0x41')](handleError(_0xc888ba,null));};exports[_0x10f5('0x46')]=function(_0x1429d2,_0x6ce4d4){return db[_0x10f5('0x2c')][_0x10f5('0x46')](_0x1429d2[_0x10f5('0x47')],{})[_0x10f5('0x24')](function(_0x48f760){var _0x21f97e=_0x1429d2[_0x10f5('0x48')][_0x10f5('0x26')]({'plain':!![]});if(!_0x21f97e)throw new Error(_0x10f5('0x49'));if(_0x21f97e[_0x10f5('0x4a')]===_0x10f5('0x48')){var _0xbe46a1=_0x48f760[_0x10f5('0x26')]({'plain':!![]});var _0x5a3208=_0x10f5('0x4b');return db['UserProfileSection'][_0x10f5('0x4c')]({'where':{'name':_0x5a3208,'userProfileId':_0x21f97e[_0x10f5('0x4d')]},'raw':!![]})[_0x10f5('0x24')](function(_0x4e0d52){if(_0x4e0d52&&_0x4e0d52[_0x10f5('0x4e')]===0x0){return db[_0x10f5('0x4f')][_0x10f5('0x46')]({'name':_0xbe46a1['name'],'resourceId':_0xbe46a1['id'],'type':_0x10f5('0x27'),'sectionId':_0x4e0d52['id']},{})[_0x10f5('0x24')](function(){return _0x48f760;});}else{return _0x48f760;}})['catch'](function(_0x117ff7){logger[_0x10f5('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x117ff7);throw _0x117ff7;});}return _0x48f760;})[_0x10f5('0x24')](respondWithResult(_0x6ce4d4,0xc9))['catch'](handleError(_0x6ce4d4,null));};exports[_0x10f5('0x23')]=function(_0x3afca7,_0x1f9738){if(_0x3afca7['body']['id']){delete _0x3afca7[_0x10f5('0x47')]['id'];}return db[_0x10f5('0x2c')]['find']({'where':{'id':_0x3afca7[_0x10f5('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f9738,null))['then'](saveUpdates(_0x3afca7[_0x10f5('0x47')],null))['then'](respondWithResult(_0x1f9738,null))[_0x10f5('0x41')](handleError(_0x1f9738,null));};exports[_0x10f5('0x25')]=function(_0x10d991,_0x1cec3a){return db['AnalyticCustomReport'][_0x10f5('0x4c')]({'where':{'id':_0x10d991[_0x10f5('0x43')]['id']}})[_0x10f5('0x24')](handleEntityNotFound(_0x1cec3a,null))[_0x10f5('0x24')](removeEntity(_0x1cec3a,null))['catch'](handleError(_0x1cec3a,null));};exports['preview']=function(_0x1cce00,_0x392865){var _0x3aed18=0xa;var _0x50282d=['join',_0x10f5('0x50'),'right_join','cross_join'];var _0x412a29={'SUM':_0x10f5('0x51'),'COUNT':_0x10f5('0x52'),'COUNT DISTINCT':_0x10f5('0x53'),'MAX':_0x10f5('0x54'),'MIN':_0x10f5('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x10f5('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x10f5('0x57')};var _0x11ed6e={'SEC_TO_TIME':_0x10f5('0x58'),'DATE':_0x10f5('0x59'),'HOUR':_0x10f5('0x5a'),'ROUND':_0x10f5('0x5b'),'UNIX_TIMESTAMP':_0x10f5('0x5c')};var _0x530222=function(_0x399c51){return!_[_0x10f5('0x5d')]([_0x10f5('0x5e'),_0x10f5('0x5f'),_0x10f5('0x60'),_0x10f5('0x61')],_0x399c51);};var _0x4e377c=function(_0x3b8a08){if(!_0x3b8a08||!_0x3b8a08[_0x10f5('0x62')][_0x10f5('0x44')]){return'';}for(var _0x184a9e='(',_0x844572=0x0;_0x844572<_0x3b8a08[_0x10f5('0x62')]['length'];_0x844572+=0x1){_0x844572>0x0&&(_0x184a9e+='\x20'+_0x3b8a08[_0x10f5('0x63')]+'\x20');_0x184a9e+=_0x3b8a08[_0x10f5('0x62')][_0x844572][_0x10f5('0x64')]?_0x4e377c(_0x3b8a08['rules'][_0x844572]['group']):_0x3b8a08[_0x10f5('0x62')][_0x844572][_0x10f5('0x65')]+'\x20'+_0x3b8a08['rules'][_0x844572]['condition']+(_0x530222(_0x3b8a08[_0x10f5('0x62')][_0x844572][_0x10f5('0x66')])?'\x20'+_0x3b8a08[_0x10f5('0x62')][_0x844572][_0x10f5('0x67')]:'');}return _0x184a9e+')';};var _0x436c26={'where':{'id':_0x1cce00[_0x10f5('0x43')]['id']}},_0x34a6b3,_0x26e1f8,_0x377661,_0x810134,_0x41570f;_0x436c26=_['merge']({},_0x436c26,_0x1cce00[_0x10f5('0x3d')]);return db['AnalyticCustomReport'][_0x10f5('0x4c')](_0x436c26)[_0x10f5('0x24')](function(_0x2dd0ce){if(_0x2dd0ce){_0x34a6b3=_0x2dd0ce;return _0x2dd0ce['getFields']();}return null;})[_0x10f5('0x24')](function(_0x208ae5){if(_0x208ae5){if(!_0x208ae5['length']){throw new db[(_0x10f5('0x68'))][(_0x10f5('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x26e1f8=_0x208ae5;return db[_0x10f5('0x6a')][_0x10f5('0x3f')]({'raw':!![]});}return null;})[_0x10f5('0x24')](function(_0x3dfdf2){if(_0x3dfdf2){_0x377661=_[_0x10f5('0x6b')](_0x3dfdf2,'id');var _0x239320;var _0x190ae7=squel[_0x10f5('0x6c')]();_0x190ae7[_0x10f5('0x6d')](_0x34a6b3[_0x10f5('0x6e')]);for(var _0x10cef3=0x0;_0x10cef3<_0x26e1f8[_0x10f5('0x44')];_0x10cef3+=0x1){_0x239320=_0x26e1f8[_0x10cef3][_0x10f5('0x6f')]?_0x377661[_0x26e1f8[_0x10cef3]['MetricId']]['metric']:_0x26e1f8[_0x10cef3][_0x10f5('0x65')];_0x239320=_0x26e1f8[_0x10cef3]['function']?_[_0x10f5('0x70')](_0x412a29[_0x26e1f8[_0x10cef3][_0x10f5('0x71')]],'%s',_0x239320):_0x239320;_0x239320=_0x26e1f8[_0x10cef3][_0x10f5('0x72')]?_[_0x10f5('0x70')](_0x11ed6e[_0x26e1f8[_0x10cef3][_0x10f5('0x72')]],'%s',_0x239320):_0x239320;if(_0x26e1f8[_0x10cef3][_0x10f5('0x73')]){_0x190ae7[_0x10f5('0x64')](_0x239320);}_0x26e1f8[_0x10cef3][_0x10f5('0x74')]&&_0x190ae7['order'](_0x239320,_0x26e1f8[_0x10cef3][_0x10f5('0x74')]===_0x10f5('0x75')?![]:!![]);_0x190ae7['field'](_0x239320,_0x26e1f8[_0x10cef3][_0x10f5('0x76')]||_0x239320);}if(_0x34a6b3[_0x10f5('0x77')]){_0x34a6b3[_0x10f5('0x77')]=JSON[_0x10f5('0x78')](_0x34a6b3[_0x10f5('0x77')]);for(var _0x45a879=0x0;_0x45a879<_0x34a6b3['joins'][_0x10f5('0x44')];_0x45a879+=0x1){if(_0x34a6b3['joins'][_0x45a879][_0x10f5('0x2f')]&&_[_0x10f5('0x5d')](_0x50282d,_0x34a6b3['joins'][_0x45a879][_0x10f5('0x2f')])&&_0x34a6b3[_0x10f5('0x77')][_0x45a879][_0x10f5('0x79')]&&_0x34a6b3[_0x10f5('0x77')][_0x45a879]['foreignTable']&&_0x34a6b3[_0x10f5('0x77')][_0x45a879]['foreignKey']){_0x190ae7[_0x34a6b3[_0x10f5('0x77')][_0x45a879][_0x10f5('0x2f')]](_0x34a6b3[_0x10f5('0x77')][_0x45a879][_0x10f5('0x7a')],null,util[_0x10f5('0x72')]('%s.%s\x20=\x20%s.%s',_0x34a6b3['table'],_0x34a6b3['joins'][_0x45a879]['parentKey'],_0x34a6b3['joins'][_0x45a879][_0x10f5('0x7a')],_0x34a6b3[_0x10f5('0x77')][_0x45a879][_0x10f5('0x7b')]));}}}if(_0x34a6b3['conditions']){_0x34a6b3[_0x10f5('0x7c')]=JSON[_0x10f5('0x78')](_0x34a6b3[_0x10f5('0x7c')]);_0x190ae7[_0x10f5('0x38')](_0x4e377c(_0x34a6b3['conditions'][_0x10f5('0x64')]));}_0x41570f=_0x190ae7[_0x10f5('0x7d')]();_0x190ae7[_0x10f5('0x1f')](_0x3aed18);_0x190ae7[_0x10f5('0x1d')](0x0);logger['debug'](_0x10f5('0x7e'),_0x190ae7[_0x10f5('0x7f')]());return dbH['sequelize']['query'](_0x190ae7[_0x10f5('0x7f')](),{'type':dbH[_0x10f5('0x80')][_0x10f5('0x81')][_0x10f5('0x82')]});}})[_0x10f5('0x24')](respondWithResult(_0x392865,null))[_0x10f5('0x41')](handleError(_0x392865,null));};function runReport(_0x18a653,_0x405f44,_0x46c3da){var _0x177808=_0x405f44[_0x10f5('0x29')];var _0xce3072=0xa;var _0x4c4f70=['join',_0x10f5('0x50'),_0x10f5('0x83'),'cross_join'];var _0xe38f57={'SUM':_0x10f5('0x51'),'COUNT':_0x10f5('0x52'),'COUNT DISTINCT':_0x10f5('0x53'),'MAX':_0x10f5('0x54'),'MIN':_0x10f5('0x55'),'AVG':_0x10f5('0x84'),'GROUP_CONCAT':_0x10f5('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xea13a7={'SEC_TO_TIME':_0x10f5('0x58'),'DATE':_0x10f5('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x10f5('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2912e7=function(_0x20558d){return!_[_0x10f5('0x5d')]([_0x10f5('0x5e'),_0x10f5('0x5f'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x20558d);};var _0x464237=function(_0x563bd8){if(!_0x563bd8||!_0x563bd8[_0x10f5('0x62')]['length']){return'';}for(var _0x341a23='(',_0x3fd140=0x0;_0x3fd140<_0x563bd8[_0x10f5('0x62')][_0x10f5('0x44')];_0x3fd140+=0x1){_0x3fd140>0x0&&(_0x341a23+='\x20'+_0x563bd8['operator']+'\x20');_0x341a23+=_0x563bd8[_0x10f5('0x62')][_0x3fd140][_0x10f5('0x64')]?_0x464237(_0x563bd8[_0x10f5('0x62')][_0x3fd140]['group']):_0x563bd8[_0x10f5('0x62')][_0x3fd140][_0x10f5('0x65')]+'\x20'+_0x563bd8[_0x10f5('0x62')][_0x3fd140][_0x10f5('0x66')]+(_0x2912e7(_0x563bd8[_0x10f5('0x62')][_0x3fd140][_0x10f5('0x66')])?'\x20'+_0x563bd8[_0x10f5('0x62')][_0x3fd140][_0x10f5('0x67')]:'');}return _0x341a23+')';};var _0x236eb6={'where':{'id':_0x18a653['id']}},_0x3157b6,_0x309d96,_0x29c319,_0x116ebc,_0x15dd1d;_0x236eb6=_[_0x10f5('0x3b')]({},_0x236eb6,_0x46c3da);return db[_0x10f5('0x2c')][_0x10f5('0x4c')](_0x236eb6)[_0x10f5('0x24')](function(_0x21b23b){if(_0x21b23b){_0x3157b6=_0x21b23b;return _0x21b23b[_0x10f5('0x85')]();}return null;})[_0x10f5('0x24')](function(_0x4e2487){if(_0x4e2487){if(!_0x4e2487[_0x10f5('0x44')]){throw new db[(_0x10f5('0x68'))]['ValidationErrorItem'](_0x10f5('0x86'),0x193);}_0x309d96=_0x4e2487;return db[_0x10f5('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x10f5('0x24')](function(_0x153020){if(_0x153020){_0x29c319=_['keyBy'](_0x153020,'id');var _0x2475ce;var _0x350844=squel[_0x10f5('0x6c')]();_0x350844[_0x10f5('0x6d')](_0x3157b6[_0x10f5('0x6e')]);for(var _0x75d897=0x0;_0x75d897<_0x309d96[_0x10f5('0x44')];_0x75d897+=0x1){_0x2475ce=_0x309d96[_0x75d897][_0x10f5('0x6f')]?_0x29c319[_0x309d96[_0x75d897][_0x10f5('0x6f')]][_0x10f5('0x87')]:_0x309d96[_0x75d897][_0x10f5('0x65')];_0x2475ce=_0x309d96[_0x75d897][_0x10f5('0x71')]?_[_0x10f5('0x70')](_0xe38f57[_0x309d96[_0x75d897][_0x10f5('0x71')]],'%s',_0x2475ce):_0x2475ce;_0x2475ce=_0x309d96[_0x75d897][_0x10f5('0x72')]?_[_0x10f5('0x70')](_0xea13a7[_0x309d96[_0x75d897][_0x10f5('0x72')]],'%s',_0x2475ce):_0x2475ce;if(_0x309d96[_0x75d897]['groupBy']){_0x350844['group'](_0x2475ce);}_0x309d96[_0x75d897][_0x10f5('0x74')]&&_0x350844[_0x10f5('0x88')](_0x2475ce,_0x309d96[_0x75d897]['orderBy']===_0x10f5('0x75')?![]:!![]);_0x350844['field'](_0x2475ce,_0x309d96[_0x75d897]['alias']||_0x2475ce);}if(_0x3157b6[_0x10f5('0x77')]){_0x3157b6[_0x10f5('0x77')]=JSON[_0x10f5('0x78')](_0x3157b6[_0x10f5('0x77')]);for(var _0x1702b6=0x0;_0x1702b6<_0x3157b6['joins'][_0x10f5('0x44')];_0x1702b6+=0x1){if(_0x3157b6[_0x10f5('0x77')][_0x1702b6][_0x10f5('0x2f')]&&_['includes'](_0x4c4f70,_0x3157b6[_0x10f5('0x77')][_0x1702b6][_0x10f5('0x2f')])&&_0x3157b6[_0x10f5('0x77')][_0x1702b6][_0x10f5('0x79')]&&_0x3157b6[_0x10f5('0x77')][_0x1702b6][_0x10f5('0x7a')]&&_0x3157b6['joins'][_0x1702b6][_0x10f5('0x7b')]){_0x350844[_0x3157b6['joins'][_0x1702b6][_0x10f5('0x2f')]](_0x3157b6[_0x10f5('0x77')][_0x1702b6][_0x10f5('0x7a')],null,util[_0x10f5('0x72')](_0x10f5('0x89'),_0x3157b6[_0x10f5('0x6e')],_0x3157b6[_0x10f5('0x77')][_0x1702b6][_0x10f5('0x79')],_0x3157b6[_0x10f5('0x77')][_0x1702b6]['foreignTable'],_0x3157b6[_0x10f5('0x77')][_0x1702b6][_0x10f5('0x7b')]));}}}if(_0x3157b6['conditions']){_0x3157b6[_0x10f5('0x7c')]=JSON[_0x10f5('0x78')](_0x3157b6[_0x10f5('0x7c')]);_0x350844[_0x10f5('0x38')](_0x464237(_0x3157b6[_0x10f5('0x7c')][_0x10f5('0x64')]));}_0x15dd1d=_0x350844[_0x10f5('0x7d')]();_0x350844[_0x10f5('0x1f')](_0xce3072);_0x350844[_0x10f5('0x1d')](0x0);return;}})[_0x10f5('0x24')](function(){if(_0x405f44[_0x10f5('0x8a')]===_0x10f5('0x8b')){return null;}var _0x2d1658=_[_0x10f5('0x3b')](_0x405f44,{'name':_0x405f44[_0x10f5('0x8c')]||_0x405f44['name']||_0x3157b6[_0x10f5('0x29')],'basename':_0x177808,'savename':util[_0x10f5('0x72')]('%s-%s.%s',_0x405f44[_0x10f5('0x29')]||_0x3157b6[_0x10f5('0x29')],require(_0x10f5('0x8d'))[_0x10f5('0x8e')](0x4),_0x405f44['output']||_0x10f5('0x8f')),'reportId':_0x3157b6['id'],'reportType':_0x10f5('0x90')});return db['AnalyticExtractedReport'][_0x10f5('0x46')](_0x2d1658,{'raw':!![]});})[_0x10f5('0x24')](function(_0x5e6cb6){if(_0x3157b6[_0x10f5('0x6e')]===_0x10f5('0x91')){_0x15dd1d['where'](_0x3157b6['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x405f44['startDate'],_0x405f44[_0x10f5('0x92')]);}else{_0x15dd1d[_0x10f5('0x38')](_0x3157b6[_0x10f5('0x6e')]+_0x10f5('0x93'),_0x405f44[_0x10f5('0x94')],_0x405f44[_0x10f5('0x92')]);}if(_0x5e6cb6){logger[_0x10f5('0x95')](_0x10f5('0x96'),_0x15dd1d[_0x10f5('0x7f')]());require(_0x10f5('0x97'))[_0x10f5('0x98')](path[_0x10f5('0x99')](__dirname,'../../components/export/',_0x5e6cb6[_0x10f5('0x8a')]),[_0x5e6cb6['id'],_0x15dd1d[_0x10f5('0x7f')](),path['join'](__dirname,_0x10f5('0x9a'),_0x5e6cb6[_0x10f5('0x9b')]),_0x177808]);return _0x5e6cb6;}else{var _0x2d1c85=squel[_0x10f5('0x6c')]();_0x2d1c85[_0x10f5('0x6d')]('('+_0x15dd1d[_0x10f5('0x7f')]()+')',_0x10f5('0x9c'));_0x2d1c85[_0x10f5('0x65')](_0x10f5('0x9d'),_0x10f5('0x20'));_0x15dd1d[_0x10f5('0x1f')](_0x405f44[_0x10f5('0x1f')]||_0xce3072);_0x15dd1d['offset'](_0x405f44['offset']||0x0);return dbH[_0x10f5('0x80')][_0x10f5('0x32')](_0x2d1c85[_0x10f5('0x7f')](),{'type':dbH[_0x10f5('0x80')][_0x10f5('0x81')][_0x10f5('0x82')]})[_0x10f5('0x24')](function(_0x2f5137){if(!_0x2f5137['length']){_0x116ebc=0x0;}else{_0x116ebc=_0x2f5137[0x0]['count']||0x0;}return dbH['sequelize'][_0x10f5('0x32')](_0x15dd1d[_0x10f5('0x7f')](),{'type':dbH[_0x10f5('0x80')][_0x10f5('0x81')][_0x10f5('0x82')]});})[_0x10f5('0x24')](function(_0x1795c5){return{'rows':_0x1795c5||[],'count':_0x116ebc};});}});}exports[_0x10f5('0x9e')]=function(_0x571c0d,_0x1fe4bd){return runReport(_0x571c0d[_0x10f5('0x43')],_0x571c0d[_0x10f5('0x32')],_0x571c0d[_0x10f5('0x3d')])[_0x10f5('0x24')](respondWithResult(_0x1fe4bd,null))[_0x10f5('0x41')](handleError(_0x1fe4bd,null));};exports[_0x10f5('0x9f')]=runReport;exports[_0x10f5('0x32')]=function(_0x22c763,_0x3c7ee7){var _0x1d27d3=0xa;var _0x33f67a=[_0x10f5('0x99'),_0x10f5('0x50'),_0x10f5('0x83'),_0x10f5('0xa0')];var _0xdf05de={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x10f5('0x53'),'MAX':'MAX(%s)','MIN':_0x10f5('0x55'),'AVG':_0x10f5('0x84'),'GROUP_CONCAT':_0x10f5('0x56'),'GROUP_CONCAT ASC':_0x10f5('0xa1'),'GROUP_CONCAT DESC':_0x10f5('0x57')};var _0x2e802a={'SEC_TO_TIME':_0x10f5('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x10f5('0x5c')};var _0x1ee5b6=function(_0x95d4f){return!_[_0x10f5('0x5d')](['IS\x20NULL',_0x10f5('0x5f'),_0x10f5('0x60'),_0x10f5('0x61')],_0x95d4f);};var _0x45bf70=function(_0x508940){if(!_0x508940||!_0x508940[_0x10f5('0x62')][_0x10f5('0x44')]){return'';}for(var _0x5688ad='(',_0x15e98e=0x0;_0x15e98e<_0x508940[_0x10f5('0x62')][_0x10f5('0x44')];_0x15e98e+=0x1){_0x15e98e>0x0&&(_0x5688ad+='\x20'+_0x508940[_0x10f5('0x63')]+'\x20');_0x5688ad+=_0x508940[_0x10f5('0x62')][_0x15e98e][_0x10f5('0x64')]?_0x45bf70(_0x508940[_0x10f5('0x62')][_0x15e98e][_0x10f5('0x64')]):_0x508940[_0x10f5('0x62')][_0x15e98e][_0x10f5('0x65')]+'\x20'+_0x508940[_0x10f5('0x62')][_0x15e98e][_0x10f5('0x66')]+(_0x1ee5b6(_0x508940[_0x10f5('0x62')][_0x15e98e][_0x10f5('0x66')])?'\x20'+_0x508940[_0x10f5('0x62')][_0x15e98e][_0x10f5('0x67')]:'');}return _0x5688ad+')';};var _0x2b08ea={'where':{'id':_0x22c763[_0x10f5('0x43')]['id']}},_0x1b4872,_0x360d48,_0x27686d,_0x1b41f1,_0x236104;_0x2b08ea=_[_0x10f5('0x3b')]({},_0x2b08ea,_0x22c763[_0x10f5('0x3d')]);return db[_0x10f5('0x2c')]['find'](_0x2b08ea)[_0x10f5('0x24')](function(_0x352e2b){if(_0x352e2b){_0x1b4872=_0x352e2b;return _0x352e2b['getFields']();}return null;})[_0x10f5('0x24')](function(_0x1e80ad){if(_0x1e80ad){if(!_0x1e80ad[_0x10f5('0x44')]){throw new db[(_0x10f5('0x68'))][(_0x10f5('0x69'))](_0x10f5('0x86'),0x193);}_0x360d48=_0x1e80ad;return db['AnalyticMetric'][_0x10f5('0x3f')]({'raw':!![]});}return null;})[_0x10f5('0x24')](function(_0x3701f5){if(_0x3701f5){_0x27686d=_['keyBy'](_0x3701f5,'id');var _0x107583;var _0x395329=squel[_0x10f5('0x6c')]();_0x395329['from'](_0x1b4872[_0x10f5('0x6e')]);for(var _0x157172=0x0;_0x157172<_0x360d48['length'];_0x157172+=0x1){_0x107583=_0x360d48[_0x157172][_0x10f5('0x6f')]?_0x27686d[_0x360d48[_0x157172]['MetricId']][_0x10f5('0x87')]:_0x360d48[_0x157172][_0x10f5('0x65')];_0x107583=_0x360d48[_0x157172][_0x10f5('0x71')]?_[_0x10f5('0x70')](_0xdf05de[_0x360d48[_0x157172][_0x10f5('0x71')]],'%s',_0x107583):_0x107583;_0x107583=_0x360d48[_0x157172]['format']?_[_0x10f5('0x70')](_0x2e802a[_0x360d48[_0x157172][_0x10f5('0x72')]],'%s',_0x107583):_0x107583;if(_0x360d48[_0x157172]['groupBy']){_0x395329[_0x10f5('0x64')](_0x107583);}_0x360d48[_0x157172]['orderBy']&&_0x395329['order'](_0x107583,_0x360d48[_0x157172]['orderBy']===_0x10f5('0x75')?![]:!![]);_0x395329[_0x10f5('0x65')](_0x107583,_0x360d48[_0x157172][_0x10f5('0x76')]||_0x107583);}if(_0x1b4872[_0x10f5('0x77')]){_0x1b4872['joins']=JSON['parse'](_0x1b4872[_0x10f5('0x77')]);for(var _0x3ffb41=0x0;_0x3ffb41<_0x1b4872[_0x10f5('0x77')]['length'];_0x3ffb41+=0x1){if(_0x1b4872[_0x10f5('0x77')][_0x3ffb41][_0x10f5('0x2f')]&&_[_0x10f5('0x5d')](_0x33f67a,_0x1b4872[_0x10f5('0x77')][_0x3ffb41][_0x10f5('0x2f')])&&_0x1b4872[_0x10f5('0x77')][_0x3ffb41][_0x10f5('0x79')]&&_0x1b4872[_0x10f5('0x77')][_0x3ffb41][_0x10f5('0x7a')]&&_0x1b4872['joins'][_0x3ffb41][_0x10f5('0x7b')]){_0x395329[_0x1b4872[_0x10f5('0x77')][_0x3ffb41]['type']](_0x1b4872[_0x10f5('0x77')][_0x3ffb41][_0x10f5('0x7a')],null,util[_0x10f5('0x72')](_0x10f5('0x89'),_0x1b4872[_0x10f5('0x6e')],_0x1b4872[_0x10f5('0x77')][_0x3ffb41][_0x10f5('0x79')],_0x1b4872[_0x10f5('0x77')][_0x3ffb41][_0x10f5('0x7a')],_0x1b4872[_0x10f5('0x77')][_0x3ffb41][_0x10f5('0x7b')]));}}}if(_0x1b4872['conditions']){_0x1b4872['conditions']=JSON[_0x10f5('0x78')](_0x1b4872[_0x10f5('0x7c')]);_0x395329['where'](_0x45bf70(_0x1b4872[_0x10f5('0x7c')][_0x10f5('0x64')]));}_0x236104=_0x395329[_0x10f5('0x7d')]();_0x395329[_0x10f5('0x1f')](_0x1d27d3);_0x395329['offset'](0x0);logger[_0x10f5('0xa2')]('Limited\x20Query:',_0x395329[_0x10f5('0x7f')]());return dbH[_0x10f5('0x80')][_0x10f5('0x32')](_0x395329['toString'](),{'type':dbH[_0x10f5('0x80')][_0x10f5('0x81')][_0x10f5('0x82')]});}})[_0x10f5('0x24')](function(){return{'sql':_0x236104['toString']()};})[_0x10f5('0x24')](respondWithResult(_0x3c7ee7,null))[_0x10f5('0x41')](handleError(_0x3c7ee7,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 7636a69..77cbfc3 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 _0x8eb3=['moment','bluebird','path','rimraf','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0x8eb3,0x17c));var _0x38eb=function(_0x4beae1,_0x954ba3){_0x4beae1=_0x4beae1-0x0;var _0x55a1e1=_0x8eb3[_0x4beae1];return _0x55a1e1;};'use strict';var _=require(_0x38eb('0x0'));var util=require(_0x38eb('0x1'));var logger=require(_0x38eb('0x2'))(_0x38eb('0x3'));var moment=require(_0x38eb('0x4'));var BPromise=require(_0x38eb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38eb('0x6'));var rimraf=require(_0x38eb('0x7'));var config=require('../../config/environment');var attributes=require(_0x38eb('0x8'));module[_0x38eb('0x9')]=function(_0x19aa05,_0x825c1f){return _0x19aa05[_0x38eb('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x38eb('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x85b0=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define'];(function(_0x11d0f3,_0x2c52c7){var _0x1a0f83=function(_0x25b7f8){while(--_0x25b7f8){_0x11d0f3['push'](_0x11d0f3['shift']());}};_0x1a0f83(++_0x2c52c7);}(_0x85b0,0x171));var _0x085b=function(_0x2bc0f5,_0x44f336){_0x2bc0f5=_0x2bc0f5-0x0;var _0x42c6ac=_0x85b0[_0x2bc0f5];return _0x42c6ac;};'use strict';var _=require('lodash');var util=require(_0x085b('0x0'));var logger=require(_0x085b('0x1'))('api');var moment=require(_0x085b('0x2'));var BPromise=require('bluebird');var rp=require(_0x085b('0x3'));var fs=require('fs');var path=require(_0x085b('0x4'));var rimraf=require(_0x085b('0x5'));var config=require(_0x085b('0x6'));var attributes=require(_0x085b('0x7'));module['exports']=function(_0x5f3cdd,_0x159df5){return _0x5f3cdd[_0x085b('0x8')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','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 9c39abd..b3d1bdf 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 _0xf7d7=['client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2820c2,_0x350e5d){var _0x495916=function(_0xaa1b98){while(--_0xaa1b98){_0x2820c2['push'](_0x2820c2['shift']());}};_0x495916(++_0x350e5d);}(_0xf7d7,0x160));var _0x7f7d=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xf7d7[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0x7f7d('0x0'));var util=require('util');var moment=require(_0x7f7d('0x1'));var BPromise=require('bluebird');var rs=require(_0x7f7d('0x2'));var fs=require('fs');var Redis=require(_0x7f7d('0x3'));var db=require(_0x7f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f7d('0x5'))(_0x7f7d('0x6'));var config=require(_0x7f7d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7f7d('0x8')][_0x7f7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x497e75,_0x4d98bf,_0x1a41d3){return new BPromise(function(_0x4257a6,_0x1a9ca7){return client['request'](_0x497e75,_0x1a41d3)[_0x7f7d('0xa')](function(_0x248ec8){logger[_0x7f7d('0xb')](_0x7f7d('0xc'),_0x4d98bf,_0x7f7d('0xd'));logger[_0x7f7d('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4d98bf,_0x7f7d('0xd'),JSON[_0x7f7d('0xf')](_0x248ec8));if(_0x248ec8[_0x7f7d('0x10')]){if(_0x248ec8['error']['code']===0x1f4){logger[_0x7f7d('0x10')](_0x7f7d('0xc'),_0x4d98bf,_0x248ec8[_0x7f7d('0x10')]['message']);return _0x1a9ca7(_0x248ec8[_0x7f7d('0x10')]['message']);}logger[_0x7f7d('0x10')](_0x7f7d('0xc'),_0x4d98bf,_0x248ec8[_0x7f7d('0x10')][_0x7f7d('0x11')]);return _0x4257a6(_0x248ec8[_0x7f7d('0x10')][_0x7f7d('0x11')]);}else{logger['info'](_0x7f7d('0xc'),_0x4d98bf,_0x7f7d('0xd'));_0x4257a6(_0x248ec8[_0x7f7d('0x12')][_0x7f7d('0x11')]);}})[_0x7f7d('0x13')](function(_0x5213be){logger[_0x7f7d('0x10')](_0x7f7d('0xc'),_0x4d98bf,_0x5213be);_0x1a9ca7(_0x5213be);});});}
\ No newline at end of file
+var _0xfc7e=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x40a0a4,_0x5d30d0){var _0x50cc17=function(_0x4ea52d){while(--_0x4ea52d){_0x40a0a4['push'](_0x40a0a4['shift']());}};_0x50cc17(++_0x5d30d0);}(_0xfc7e,0x9c));var _0xefc7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfc7e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xefc7('0x0'));var moment=require(_0xefc7('0x1'));var BPromise=require(_0xefc7('0x2'));var rs=require(_0xefc7('0x3'));var fs=require('fs');var Redis=require(_0xefc7('0x4'));var db=require(_0xefc7('0x5'))['db'];var utils=require(_0xefc7('0x6'));var logger=require(_0xefc7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xefc7('0x8'));var client=jayson[_0xefc7('0x9')][_0xefc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cabee,_0x13faf5,_0xff5334){return new BPromise(function(_0x172262,_0x3f9591){return client[_0xefc7('0xb')](_0x3cabee,_0xff5334)[_0xefc7('0xc')](function(_0x5dd50d){logger['info'](_0xefc7('0xd'),_0x13faf5,_0xefc7('0xe'));logger[_0xefc7('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x13faf5,_0xefc7('0xe'),JSON[_0xefc7('0x10')](_0x5dd50d));if(_0x5dd50d['error']){if(_0x5dd50d[_0xefc7('0x11')][_0xefc7('0x12')]===0x1f4){logger[_0xefc7('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x13faf5,_0x5dd50d[_0xefc7('0x11')][_0xefc7('0x13')]);return _0x3f9591(_0x5dd50d[_0xefc7('0x11')]['message']);}logger['error'](_0xefc7('0xd'),_0x13faf5,_0x5dd50d['error'][_0xefc7('0x13')]);return _0x172262(_0x5dd50d[_0xefc7('0x11')][_0xefc7('0x13')]);}else{logger[_0xefc7('0x14')](_0xefc7('0xd'),_0x13faf5,_0xefc7('0xe'));_0x172262(_0x5dd50d[_0xefc7('0x15')][_0xefc7('0x13')]);}})[_0xefc7('0x16')](function(_0x1ae880){logger['error'](_0xefc7('0xd'),_0x13faf5,_0x1ae880);_0x3f9591(_0x1ae880);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index d384b01..ff15d20 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 _0xd8b1=['/:id/preview','preview','get','/:id/query','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','index','/:id','show'];(function(_0x3acd79,_0x302a58){var _0x2ff0d5=function(_0x1459fe){while(--_0x1459fe){_0x3acd79['push'](_0x3acd79['shift']());}};_0x2ff0d5(++_0x302a58);}(_0xd8b1,0x191));var _0x1d8b=function(_0x3f6c66,_0x31e3cd){_0x3f6c66=_0x3f6c66-0x0;var _0x1b541a=_0xd8b1[_0x3f6c66];return _0x1b541a;};'use strict';var multer=require('multer');var util=require(_0x1d8b('0x0'));var path=require(_0x1d8b('0x1'));var timeout=require(_0x1d8b('0x2'));var express=require(_0x1d8b('0x3'));var router=express[_0x1d8b('0x4')]();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require(_0x1d8b('0x7'));var config=require('../../config/environment');var controller=require(_0x1d8b('0x8'));router['get']('/',auth[_0x1d8b('0x9')](),controller[_0x1d8b('0xa')]);router['get'](_0x1d8b('0xb'),auth[_0x1d8b('0x9')](),controller[_0x1d8b('0xc')]);router['get'](_0x1d8b('0xd'),auth[_0x1d8b('0x9')](),controller[_0x1d8b('0xe')]);router[_0x1d8b('0xf')]('/:id/run',auth['isAuthenticated'](),controller['run']);router['get'](_0x1d8b('0x10'),auth[_0x1d8b('0x9')](),controller['query']);router[_0x1d8b('0x11')]('/',auth['isAuthenticated'](),controller[_0x1d8b('0x12')]);router[_0x1d8b('0x13')](_0x1d8b('0xb'),auth[_0x1d8b('0x9')](),controller[_0x1d8b('0x14')]);router[_0x1d8b('0x15')](_0x1d8b('0xb'),auth['isAuthenticated'](),controller[_0x1d8b('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xe85f=['delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','run','/:id/query','post','create','put','update'];(function(_0x157bf7,_0x211fb0){var _0x4f08cc=function(_0x3f8844){while(--_0x3f8844){_0x157bf7['push'](_0x157bf7['shift']());}};_0x4f08cc(++_0x211fb0);}(_0xe85f,0xb2));var _0xfe85=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xe85f[_0x556bb1];return _0x45455f;};'use strict';var multer=require(_0xfe85('0x0'));var util=require(_0xfe85('0x1'));var path=require('path');var timeout=require(_0xfe85('0x2'));var express=require('express');var router=express[_0xfe85('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfe85('0x4'));var interaction=require(_0xfe85('0x5'));var config=require(_0xfe85('0x6'));var controller=require(_0xfe85('0x7'));router[_0xfe85('0x8')]('/',auth[_0xfe85('0x9')](),controller[_0xfe85('0xa')]);router[_0xfe85('0x8')](_0xfe85('0xb'),auth[_0xfe85('0x9')](),controller[_0xfe85('0xc')]);router[_0xfe85('0x8')](_0xfe85('0xd'),auth[_0xfe85('0x9')](),controller['preview']);router['get']('/:id/run',auth[_0xfe85('0x9')](),controller[_0xfe85('0xe')]);router[_0xfe85('0x8')](_0xfe85('0xf'),auth['isAuthenticated'](),controller['query']);router[_0xfe85('0x10')]('/',auth[_0xfe85('0x9')](),controller[_0xfe85('0x11')]);router[_0xfe85('0x12')](_0xfe85('0xb'),auth['isAuthenticated'](),controller[_0xfe85('0x13')]);router[_0xfe85('0x14')](_0xfe85('0xb'),auth[_0xfe85('0x9')](),controller[_0xfe85('0x15')]);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 33650ee..7277328 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x1ea053,_0x22aecc){var _0x444b08=function(_0x14576a){while(--_0x14576a){_0x1ea053['push'](_0x1ea053['shift']());}};_0x444b08(++_0x22aecc);}(_0x5fab,0x177));var _0xb5fa=function(_0x581aae,_0x2b18ee){_0x581aae=_0x581aae-0x0;var _0x539df2=_0x5fab[_0x581aae];return _0x539df2;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
+var _0x2eb2=['TEXT','exports','STRING'];(function(_0x4b6651,_0x40dcb4){var _0x5e8c87=function(_0x5c1238){while(--_0x5c1238){_0x4b6651['push'](_0x4b6651['shift']());}};_0x5e8c87(++_0x40dcb4);}(_0x2eb2,0x19f));var _0x22eb=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x2eb2[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'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 9d0c002..85c7892 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 _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x18a77c,_0x34eeb8){var _0x18fa1f=function(_0xd0778c){while(--_0xd0778c){_0x18a77c['push'](_0x18a77c['shift']());}};_0x18fa1f(++_0x34eeb8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x5fc3[_0x209fcd];return _0x501d5e;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));};
\ No newline at end of file
+var _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x12b6d1,_0x3e41cb){var _0x55d498=function(_0x5d3e54){while(--_0x5d3e54){_0x12b6d1['push'](_0x12b6d1['shift']());}};_0x55d498(++_0x3e41cb);}(_0x524e,0x15e));var _0xe524=function(_0x344899,_0x564837){_0x344899=_0x344899-0x0;var _0x290165=_0x524e[_0x344899];return _0x290165;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 45f3e29..f63f226 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 _0xc452=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','request-promise'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xc452,0x1b7));var _0x2c45=function(_0x82542b,_0xf0f271){_0x82542b=_0x82542b-0x0;var _0x14528d=_0xc452[_0x82542b];return _0x14528d;};'use strict';var _=require(_0x2c45('0x0'));var util=require(_0x2c45('0x1'));var logger=require('../../config/logger')(_0x2c45('0x2'));var moment=require(_0x2c45('0x3'));var BPromise=require('bluebird');var rp=require(_0x2c45('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c45('0x5'));var config=require(_0x2c45('0x6'));var attributes=require(_0x2c45('0x7'));module[_0x2c45('0x8')]=function(_0xfe7499,_0x4a0323){return _0xfe7499[_0x2c45('0x9')](_0x2c45('0xa'),attributes,{'tableName':_0x2c45('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe344=['rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0xe344,0x1e9));var _0x4e34=function(_0x13be95,_0x4efb8c){_0x13be95=_0x13be95-0x0;var _0x5e7f93=_0xe344[_0x13be95];return _0x5e7f93;};'use strict';var _=require(_0x4e34('0x0'));var util=require('util');var logger=require(_0x4e34('0x1'))('api');var moment=require(_0x4e34('0x2'));var BPromise=require(_0x4e34('0x3'));var rp=require(_0x4e34('0x4'));var fs=require('fs');var path=require(_0x4e34('0x5'));var rimraf=require(_0x4e34('0x6'));var config=require(_0x4e34('0x7'));var attributes=require(_0x4e34('0x8'));module['exports']=function(_0x43821b,_0x13892a){return _0x43821b[_0x4e34('0x9')](_0x4e34('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 40180a2..d28b715 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 _0xab96=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xab96,0x164));var _0x6ab9=function(_0x3f7ee2,_0x3b4c28){_0x3f7ee2=_0x3f7ee2-0x0;var _0x3ee417=_0xab96[_0x3f7ee2];return _0x3ee417;};'use strict';var _=require(_0x6ab9('0x0'));var util=require(_0x6ab9('0x1'));var moment=require(_0x6ab9('0x2'));var BPromise=require(_0x6ab9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ab9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ab9('0x5'));var logger=require(_0x6ab9('0x6'))('rpc');var config=require(_0x6ab9('0x7'));var jayson=require(_0x6ab9('0x8'));var client=jayson[_0x6ab9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5aa735,_0x2301a9,_0x295488){return new BPromise(function(_0x772d34,_0xb7aa30){return client[_0x6ab9('0xa')](_0x5aa735,_0x295488)[_0x6ab9('0xb')](function(_0x5b104e){logger[_0x6ab9('0xc')](_0x6ab9('0xd'),_0x2301a9,_0x6ab9('0xe'));logger[_0x6ab9('0xf')](_0x6ab9('0x10'),_0x2301a9,_0x6ab9('0xe'),JSON[_0x6ab9('0x11')](_0x5b104e));if(_0x5b104e['error']){if(_0x5b104e[_0x6ab9('0x12')][_0x6ab9('0x13')]===0x1f4){logger[_0x6ab9('0x12')](_0x6ab9('0xd'),_0x2301a9,_0x5b104e[_0x6ab9('0x12')][_0x6ab9('0x14')]);return _0xb7aa30(_0x5b104e['error'][_0x6ab9('0x14')]);}logger[_0x6ab9('0x12')](_0x6ab9('0xd'),_0x2301a9,_0x5b104e[_0x6ab9('0x12')][_0x6ab9('0x14')]);return _0x772d34(_0x5b104e[_0x6ab9('0x12')]['message']);}else{logger[_0x6ab9('0xc')](_0x6ab9('0xd'),_0x2301a9,_0x6ab9('0xe'));_0x772d34(_0x5b104e[_0x6ab9('0x15')][_0x6ab9('0x14')]);}})[_0x6ab9('0x16')](function(_0x33d6cc){logger[_0x6ab9('0x12')](_0x6ab9('0xd'),_0x2301a9,_0x33d6cc);_0xb7aa30(_0x33d6cc);});});}
\ No newline at end of file
+var _0x14bc=['code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error'];(function(_0xec696,_0x1176b6){var _0x43de02=function(_0xd7f83c){while(--_0xd7f83c){_0xec696['push'](_0xec696['shift']());}};_0x43de02(++_0x1176b6);}(_0x14bc,0xd4));var _0xc14b=function(_0x4934ab,_0xa434e5){_0x4934ab=_0x4934ab-0x0;var _0x49fc8a=_0x14bc[_0x4934ab];return _0x49fc8a;};'use strict';var _=require(_0xc14b('0x0'));var util=require(_0xc14b('0x1'));var moment=require(_0xc14b('0x2'));var BPromise=require(_0xc14b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc14b('0x4'))['db'];var utils=require(_0xc14b('0x5'));var logger=require(_0xc14b('0x6'))(_0xc14b('0x7'));var config=require(_0xc14b('0x8'));var jayson=require(_0xc14b('0x9'));var client=jayson[_0xc14b('0xa')][_0xc14b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45c246,_0x459861,_0x550941){return new BPromise(function(_0x1b9b0c,_0x269140){return client[_0xc14b('0xc')](_0x45c246,_0x550941)[_0xc14b('0xd')](function(_0x304048){logger[_0xc14b('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x459861,_0xc14b('0xf'));logger['debug'](_0xc14b('0x10'),_0x459861,'request\x20sent',JSON['stringify'](_0x304048));if(_0x304048[_0xc14b('0x11')]){if(_0x304048['error'][_0xc14b('0x12')]===0x1f4){logger[_0xc14b('0x11')](_0xc14b('0x13'),_0x459861,_0x304048[_0xc14b('0x11')]['message']);return _0x269140(_0x304048[_0xc14b('0x11')][_0xc14b('0x14')]);}logger[_0xc14b('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x459861,_0x304048[_0xc14b('0x11')][_0xc14b('0x14')]);return _0x1b9b0c(_0x304048[_0xc14b('0x11')][_0xc14b('0x14')]);}else{logger[_0xc14b('0xe')](_0xc14b('0x13'),_0x459861,_0xc14b('0xf'));_0x1b9b0c(_0x304048[_0xc14b('0x15')][_0xc14b('0x14')]);}})[_0xc14b('0x16')](function(_0x4b4b2e){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x459861,_0x4b4b2e);_0x269140(_0x4b4b2e);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 5925072..c999a5a 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 _0x8d8e=['update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x59ef83,_0x1616f4){var _0x404afa=function(_0x576ac9){while(--_0x576ac9){_0x59ef83['push'](_0x59ef83['shift']());}};_0x404afa(++_0x1616f4);}(_0x8d8e,0x15a));var _0xe8d8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8d8e[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xe8d8('0x0'));var util=require('util');var path=require(_0xe8d8('0x1'));var timeout=require(_0xe8d8('0x2'));var express=require(_0xe8d8('0x3'));var router=express[_0xe8d8('0x4')]();var fs_extra=require(_0xe8d8('0x5'));var auth=require(_0xe8d8('0x6'));var interaction=require(_0xe8d8('0x7'));var config=require(_0xe8d8('0x8'));var controller=require(_0xe8d8('0x9'));router['get']('/',auth[_0xe8d8('0xa')](),controller[_0xe8d8('0xb')]);router[_0xe8d8('0xc')](_0xe8d8('0xd'),auth[_0xe8d8('0xa')](),controller['show']);router[_0xe8d8('0xc')]('/:id/preview',auth[_0xe8d8('0xa')](),controller[_0xe8d8('0xe')]);router[_0xe8d8('0xc')](_0xe8d8('0xf'),auth[_0xe8d8('0xa')](),controller[_0xe8d8('0x10')]);router[_0xe8d8('0xc')](_0xe8d8('0x11'),auth['isAuthenticated'](),controller[_0xe8d8('0x12')]);router[_0xe8d8('0x13')]('/',auth[_0xe8d8('0xa')](),controller[_0xe8d8('0x14')]);router[_0xe8d8('0x15')]('/:id',auth[_0xe8d8('0xa')](),controller[_0xe8d8('0x16')]);router['delete'](_0xe8d8('0xd'),auth[_0xe8d8('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6888=['/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x6888,0x146));var _0x8688=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x6888[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x8688('0x0'));var util=require(_0x8688('0x1'));var path=require(_0x8688('0x2'));var timeout=require(_0x8688('0x3'));var express=require(_0x8688('0x4'));var router=express[_0x8688('0x5')]();var fs_extra=require(_0x8688('0x6'));var auth=require(_0x8688('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8688('0x8'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x8688('0x9')](),controller[_0x8688('0xa')]);router[_0x8688('0xb')](_0x8688('0xc'),auth[_0x8688('0x9')](),controller[_0x8688('0xd')]);router['get'](_0x8688('0xe'),auth[_0x8688('0x9')](),controller[_0x8688('0xf')]);router[_0x8688('0xb')](_0x8688('0x10'),auth[_0x8688('0x9')](),controller[_0x8688('0x11')]);router['get'](_0x8688('0x12'),auth[_0x8688('0x9')](),controller[_0x8688('0x13')]);router['post']('/',auth[_0x8688('0x9')](),controller[_0x8688('0x14')]);router[_0x8688('0x15')](_0x8688('0xc'),auth['isAuthenticated'](),controller[_0x8688('0x16')]);router[_0x8688('0x17')](_0x8688('0xc'),auth[_0x8688('0x9')](),controller[_0x8688('0x18')]);module[_0x8688('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 36c50a4..994360e 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 _0x2492=['csv','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','moment','exports','STRING','ENUM'];(function(_0x3f9215,_0x4690f2){var _0x5a2a89=function(_0x187021){while(--_0x187021){_0x3f9215['push'](_0x3f9215['shift']());}};_0x5a2a89(++_0x4690f2);}(_0x2492,0x1e8));var _0x2249=function(_0x53439d,_0x556850){_0x53439d=_0x53439d-0x0;var _0xefd77b=_0x2492[_0x53439d];return _0xefd77b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2249('0x0'));module[_0x2249('0x1')]={'name':{'type':Sequelize[_0x2249('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x2249('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x2249('0x3')](_0x2249('0x4'),_0x2249('0x5'),_0x2249('0x6')),'allowNull':![],'defaultValue':_0x2249('0x4')},'savename':{'type':Sequelize[_0x2249('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2249('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x2249('0x2')],'defaultValue':_0x2249('0x8')},'type':{'type':Sequelize[_0x2249('0x3')]('manual',_0x2249('0x9')),'allowNull':![],'defaultValue':_0x2249('0xa')},'reportId':{'type':Sequelize[_0x2249('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa8a6=['sequelize','moment','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled','UNSIGNED'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa8a6,0x1c3));var _0x6a8a=function(_0xdfb99b,_0x11c085){_0xdfb99b=_0xdfb99b-0x0;var _0x67dd87=_0xa8a6[_0xdfb99b];return _0x67dd87;};'use strict';var Sequelize=require(_0x6a8a('0x0'));var moment=require(_0x6a8a('0x1'));module['exports']={'name':{'type':Sequelize[_0x6a8a('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x6a8a('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x6a8a('0x3')](_0x6a8a('0x4'),_0x6a8a('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x6a8a('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x6a8a('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x6a8a('0x2')],'defaultValue':_0x6a8a('0x7')},'type':{'type':Sequelize[_0x6a8a('0x3')](_0x6a8a('0x8'),_0x6a8a('0x9')),'allowNull':![],'defaultValue':_0x6a8a('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x6a8a('0xa')]},'reportType':{'type':Sequelize[_0x6a8a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 69fafd6..3ffd889 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 _0xf920=['filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick'];(function(_0x22d36b,_0x1a2358){var _0x4e4f7a=function(_0x43dddd){while(--_0x43dddd){_0x22d36b['push'](_0x22d36b['shift']());}};_0x4e4f7a(++_0x1a2358);}(_0xf920,0x125));var _0x0f92=function(_0x3a24b8,_0x1b7651){_0x3a24b8=_0x3a24b8-0x0;var _0x502dd8=_0xf920[_0x3a24b8];return _0x502dd8;};'use strict';var emlformat=require(_0x0f92('0x0'));var rimraf=require(_0x0f92('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f92('0x2'));var rp=require(_0x0f92('0x3'));var moment=require('moment');var BPromise=require(_0x0f92('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0f92('0x5'));var sox=require(_0x0f92('0x6'));var csv=require('to-csv');var ejs=require(_0x0f92('0x7'));var fs=require('fs');var fs_extra=require(_0x0f92('0x8'));var _=require('lodash');var squel=require(_0x0f92('0x9'));var crypto=require('crypto');var jsforce=require(_0x0f92('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0f92('0xb'));var Papa=require(_0x0f92('0xc'));var Redis=require(_0x0f92('0xd'));var authService=require(_0x0f92('0xe'));var qs=require(_0x0f92('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f92('0x10'));var logger=require(_0x0f92('0x11'))('api');var utils=require(_0x0f92('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0f92('0x13'));var db=require(_0x0f92('0x14'))['db'];function respondWithStatusCode(_0x3b9f17,_0x4b26cc){_0x4b26cc=_0x4b26cc||0xcc;return function(_0x193e6c){if(_0x193e6c){return _0x3b9f17[_0x0f92('0x15')](_0x4b26cc);}return _0x3b9f17[_0x0f92('0x16')](_0x4b26cc)[_0x0f92('0x17')]();};}function respondWithResult(_0x3e4915,_0x736667){_0x736667=_0x736667||0xc8;return function(_0x36563e){if(_0x36563e){return _0x3e4915[_0x0f92('0x16')](_0x736667)[_0x0f92('0x18')](_0x36563e);}};}function respondWithFilteredResult(_0x34b509,_0xd1d248){return function(_0x324c9f){if(_0x324c9f){var _0x51dbbd=typeof _0xd1d248[_0x0f92('0x19')]===_0x0f92('0x1a')&&typeof _0xd1d248[_0x0f92('0x1b')]===_0x0f92('0x1a');var _0x5861af=_0x324c9f['count'];var _0x291252=_0x51dbbd?0x0:_0xd1d248[_0x0f92('0x19')];var _0x3c8158=_0x51dbbd?_0x324c9f[_0x0f92('0x1c')]:_0xd1d248['offset']+_0xd1d248['limit'];var _0x225b68;if(_0x3c8158>=_0x5861af){_0x3c8158=_0x5861af;_0x225b68=0xc8;}else{_0x225b68=0xce;}_0x34b509[_0x0f92('0x16')](_0x225b68);return _0x34b509[_0x0f92('0x1d')]('Content-Range',_0x291252+'-'+_0x3c8158+'/'+_0x5861af)[_0x0f92('0x18')](_0x324c9f);}return null;};}function patchUpdates(_0x5d3c3f){return function(_0x26f37e){try{jsonpatch[_0x0f92('0x1e')](_0x26f37e,_0x5d3c3f,!![]);}catch(_0x28a2e8){return BPromise[_0x0f92('0x1f')](_0x28a2e8);}return _0x26f37e[_0x0f92('0x20')]();};}function saveUpdates(_0x197a2f,_0xa3332){return function(_0x400900){if(_0x400900){return _0x400900[_0x0f92('0x21')](_0x197a2f)[_0x0f92('0x22')](function(_0x28749f){return _0x28749f;});}return null;};}function removeEntity(_0x28bfab,_0x4502cb){return function(_0x469fe1){if(_0x469fe1){return _0x469fe1[_0x0f92('0x23')]()[_0x0f92('0x22')](function(){var _0x14ccd0=_0x469fe1['get']({'plain':!![]});var _0x1e4f1b=_0x0f92('0x24');return db[_0x0f92('0x25')][_0x0f92('0x23')]({'where':{'type':_0x1e4f1b,'resourceId':_0x14ccd0['id']}})[_0x0f92('0x22')](function(){return _0x469fe1;});})['then'](function(){_0x28bfab[_0x0f92('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3551f8,_0x10ad43){return function(_0x235d8c){if(!_0x235d8c){_0x3551f8[_0x0f92('0x15')](0x194);}return _0x235d8c;};}function handleError(_0x18c52f,_0x940d45){_0x940d45=_0x940d45||0x1f4;return function(_0x4c5cf9){logger[_0x0f92('0x26')](_0x4c5cf9[_0x0f92('0x27')]);if(_0x4c5cf9[_0x0f92('0x28')]){delete _0x4c5cf9[_0x0f92('0x28')];}_0x18c52f[_0x0f92('0x16')](_0x940d45)[_0x0f92('0x29')](_0x4c5cf9);};}exports[_0x0f92('0x2a')]=function(_0x597991,_0x3f0032){var _0x311398={},_0x104086={},_0x3e8ea1={'count':0x0,'rows':[]};var _0x20ef55=_[_0x0f92('0x2b')](db[_0x0f92('0x2c')]['rawAttributes'],function(_0x228ce4){return{'name':_0x228ce4[_0x0f92('0x2d')],'type':_0x228ce4['type'][_0x0f92('0x2e')]};});_0x104086[_0x0f92('0x2f')]=_[_0x0f92('0x2b')](_0x20ef55,_0x0f92('0x28'));_0x104086[_0x0f92('0x30')]=_[_0x0f92('0x31')](_0x597991[_0x0f92('0x30')]);_0x104086['filters']=_[_0x0f92('0x32')](_0x104086[_0x0f92('0x2f')],_0x104086[_0x0f92('0x30')]);_0x311398[_0x0f92('0x33')]=_[_0x0f92('0x32')](_0x104086[_0x0f92('0x2f')],qs[_0x0f92('0x34')](_0x597991[_0x0f92('0x30')][_0x0f92('0x34')]));_0x311398['attributes']=_0x311398[_0x0f92('0x33')][_0x0f92('0x35')]?_0x311398[_0x0f92('0x33')]:_0x104086[_0x0f92('0x2f')];if(!_0x597991[_0x0f92('0x30')][_0x0f92('0x36')]('nolimit')){_0x311398[_0x0f92('0x1b')]=qs[_0x0f92('0x1b')](_0x597991[_0x0f92('0x30')][_0x0f92('0x1b')]);_0x311398[_0x0f92('0x19')]=qs[_0x0f92('0x19')](_0x597991[_0x0f92('0x30')][_0x0f92('0x19')]);}_0x311398['order']=qs[_0x0f92('0x37')](_0x597991[_0x0f92('0x30')][_0x0f92('0x37')]);_0x311398[_0x0f92('0x38')]=qs[_0x0f92('0x39')](_[_0x0f92('0x3a')](_0x597991[_0x0f92('0x30')],_0x104086[_0x0f92('0x39')]),_0x20ef55);if(_0x597991[_0x0f92('0x30')][_0x0f92('0x3b')]){_0x311398[_0x0f92('0x38')]=_['merge'](_0x311398[_0x0f92('0x38')],{'$or':_[_0x0f92('0x2b')](_0x20ef55,function(_0x15e329){if(_0x15e329['type']!=='VIRTUAL'){var _0x13f7e2={};_0x13f7e2[_0x15e329[_0x0f92('0x28')]]={'$like':'%'+_0x597991[_0x0f92('0x30')][_0x0f92('0x3b')]+'%'};return _0x13f7e2;}})});}_0x311398=_[_0x0f92('0x3c')]({},_0x311398,_0x597991['options']);var _0x94f560={'where':_0x311398[_0x0f92('0x38')]};return db['AnalyticExtractedReport']['count'](_0x94f560)['then'](function(_0x3835c3){_0x3e8ea1[_0x0f92('0x1c')]=_0x3835c3;if(_0x597991[_0x0f92('0x30')][_0x0f92('0x3d')]){_0x311398[_0x0f92('0x3e')]=[{'all':!![]}];}return db[_0x0f92('0x2c')][_0x0f92('0x3f')](_0x311398);})[_0x0f92('0x22')](function(_0x5c9954){_0x3e8ea1['rows']=_0x5c9954;return _0x3e8ea1;})['then'](respondWithFilteredResult(_0x3f0032,_0x311398))[_0x0f92('0x40')](handleError(_0x3f0032,null));};exports[_0x0f92('0x41')]=function(_0x1f0789,_0x2d0936){var _0x72ecf0={'raw':!![],'where':{'id':_0x1f0789[_0x0f92('0x42')]['id']}},_0x5571c8={};_0x5571c8[_0x0f92('0x2f')]=_['keys'](db['AnalyticExtractedReport']['rawAttributes']);_0x5571c8[_0x0f92('0x30')]=_[_0x0f92('0x31')](_0x1f0789[_0x0f92('0x30')]);_0x5571c8['filters']=_[_0x0f92('0x32')](_0x5571c8[_0x0f92('0x2f')],_0x5571c8[_0x0f92('0x30')]);_0x72ecf0['attributes']=_[_0x0f92('0x32')](_0x5571c8[_0x0f92('0x2f')],qs['fields'](_0x1f0789[_0x0f92('0x30')][_0x0f92('0x34')]));_0x72ecf0[_0x0f92('0x33')]=_0x72ecf0[_0x0f92('0x33')][_0x0f92('0x35')]?_0x72ecf0[_0x0f92('0x33')]:_0x5571c8[_0x0f92('0x2f')];if(_0x1f0789[_0x0f92('0x30')]['includeAll']){_0x72ecf0[_0x0f92('0x3e')]=[{'all':!![]}];}_0x72ecf0=_[_0x0f92('0x3c')]({},_0x72ecf0,_0x1f0789[_0x0f92('0x43')]);return db[_0x0f92('0x2c')][_0x0f92('0x44')](_0x72ecf0)[_0x0f92('0x22')](handleEntityNotFound(_0x2d0936,null))['then'](respondWithResult(_0x2d0936,null))['catch'](handleError(_0x2d0936,null));};exports[_0x0f92('0x45')]=function(_0x4a84ad,_0x27c26e){return db[_0x0f92('0x2c')][_0x0f92('0x45')](_0x4a84ad[_0x0f92('0x46')],{})[_0x0f92('0x22')](function(_0x31905b){var _0x3906eb=_0x4a84ad[_0x0f92('0x47')][_0x0f92('0x48')]({'plain':!![]});if(!_0x3906eb)throw new Error(_0x0f92('0x49'));if(_0x3906eb['role']===_0x0f92('0x47')){var _0x2fdb34=_0x31905b['get']({'plain':!![]});var _0x139fdf='ExtractedReports';return db[_0x0f92('0x4a')][_0x0f92('0x44')]({'where':{'name':_0x139fdf,'userProfileId':_0x3906eb['userProfileId']},'raw':!![]})['then'](function(_0x1f6cfc){if(_0x1f6cfc&&_0x1f6cfc[_0x0f92('0x4b')]===0x0){return db['UserProfileResource'][_0x0f92('0x45')]({'name':_0x2fdb34[_0x0f92('0x28')],'resourceId':_0x2fdb34['id'],'type':_0x1f6cfc[_0x0f92('0x28')],'sectionId':_0x1f6cfc['id']},{})[_0x0f92('0x22')](function(){return _0x31905b;});}else{return _0x31905b;}})[_0x0f92('0x40')](function(_0x2a83f8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a83f8);throw _0x2a83f8;});}return _0x31905b;})[_0x0f92('0x22')](respondWithResult(_0x27c26e,0xc9))[_0x0f92('0x40')](handleError(_0x27c26e,null));};exports['update']=function(_0x1976cf,_0x172f40){if(_0x1976cf[_0x0f92('0x46')]['id']){delete _0x1976cf[_0x0f92('0x46')]['id'];}return db[_0x0f92('0x2c')][_0x0f92('0x44')]({'where':{'id':_0x1976cf[_0x0f92('0x42')]['id']}})[_0x0f92('0x22')](handleEntityNotFound(_0x172f40,null))[_0x0f92('0x22')](saveUpdates(_0x1976cf['body'],null))[_0x0f92('0x22')](respondWithResult(_0x172f40,null))[_0x0f92('0x40')](handleError(_0x172f40,null));};exports[_0x0f92('0x23')]=function(_0x54acbd,_0x29b3fd){return db[_0x0f92('0x2c')][_0x0f92('0x44')]({'where':{'id':_0x54acbd[_0x0f92('0x42')]['id']}})[_0x0f92('0x22')](handleEntityNotFound(_0x29b3fd,null))[_0x0f92('0x22')](removeEntity(_0x29b3fd,null))[_0x0f92('0x40')](handleError(_0x29b3fd,null));};exports[_0x0f92('0x4c')]=function(_0x84fb1c,_0x57013d,_0x5672fd){return db[_0x0f92('0x2c')][_0x0f92('0x44')]({'where':{'id':_0x84fb1c[_0x0f92('0x42')]['id']},'attributes':[_0x0f92('0x28'),_0x0f92('0x4d'),_0x0f92('0x4e'),_0x0f92('0x4f')],'raw':!![]})[_0x0f92('0x22')](handleEntityNotFound(_0x57013d,null))[_0x0f92('0x22')](function(_0x2eda06){if(_0x2eda06){if(!fs['existsSync'](path[_0x0f92('0x50')](config[_0x0f92('0x51')],_0x0f92('0x52'),_0x2eda06[_0x0f92('0x4e')]))){throw new db[(_0x0f92('0x53'))][(_0x0f92('0x54'))](_0x0f92('0x55'));}if(_0x84fb1c[_0x0f92('0x30')][_0x0f92('0x56')]){return _0x57013d['sendStatus'](0xc8);}return _0x57013d['download'](path[_0x0f92('0x50')](config[_0x0f92('0x51')],_0x0f92('0x52'),_0x2eda06[_0x0f92('0x4e')]),util['format'](_0x0f92('0x57'),_0x2eda06['basename']||_0x2eda06['name'],_0x2eda06[_0x0f92('0x4f')]['toLowerCase']()));}})[_0x0f92('0x40')](handleError(_0x57013d,null));};
\ No newline at end of file
+var _0xc264=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','name','map','AnalyticExtractedReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','role','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','basename','savename','output','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x336c8b,_0x56b55b){var _0x4dd2f6=function(_0x169a0f){while(--_0x169a0f){_0x336c8b['push'](_0x336c8b['shift']());}};_0x4dd2f6(++_0x56b55b);}(_0xc264,0x16c));var _0x4c26=function(_0x18e52b,_0x1fae35){_0x18e52b=_0x18e52b-0x0;var _0x3d3062=_0xc264[_0x18e52b];return _0x3d3062;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c26('0x0'));var zipdir=require(_0x4c26('0x1'));var jsonpatch=require(_0x4c26('0x2'));var rp=require(_0x4c26('0x3'));var moment=require('moment');var BPromise=require(_0x4c26('0x4'));var Mustache=require(_0x4c26('0x5'));var util=require(_0x4c26('0x6'));var path=require(_0x4c26('0x7'));var sox=require('sox');var csv=require(_0x4c26('0x8'));var ejs=require(_0x4c26('0x9'));var fs=require('fs');var fs_extra=require(_0x4c26('0xa'));var _=require(_0x4c26('0xb'));var squel=require(_0x4c26('0xc'));var crypto=require(_0x4c26('0xd'));var jsforce=require(_0x4c26('0xe'));var deskjs=require(_0x4c26('0xf'));var toCsv=require(_0x4c26('0x8'));var querystring=require(_0x4c26('0x10'));var Papa=require('papaparse');var Redis=require(_0x4c26('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4c26('0x12'));var hardwareService=require(_0x4c26('0x13'));var logger=require(_0x4c26('0x14'))(_0x4c26('0x15'));var utils=require(_0x4c26('0x16'));var config=require(_0x4c26('0x17'));var licenseUtil=require(_0x4c26('0x18'));var db=require(_0x4c26('0x19'))['db'];function respondWithStatusCode(_0x4f361b,_0xff68e4){_0xff68e4=_0xff68e4||0xcc;return function(_0x112e6d){if(_0x112e6d){return _0x4f361b[_0x4c26('0x1a')](_0xff68e4);}return _0x4f361b[_0x4c26('0x1b')](_0xff68e4)[_0x4c26('0x1c')]();};}function respondWithResult(_0x520096,_0xfa0ab3){_0xfa0ab3=_0xfa0ab3||0xc8;return function(_0x6d5208){if(_0x6d5208){return _0x520096[_0x4c26('0x1b')](_0xfa0ab3)[_0x4c26('0x1d')](_0x6d5208);}};}function respondWithFilteredResult(_0x3c060b,_0x57747b){return function(_0x49183e){if(_0x49183e){var _0x96d797=typeof _0x57747b[_0x4c26('0x1e')]===_0x4c26('0x1f')&&typeof _0x57747b[_0x4c26('0x20')]==='undefined';var _0x147ea3=_0x49183e[_0x4c26('0x21')];var _0x549a8a=_0x96d797?0x0:_0x57747b[_0x4c26('0x1e')];var _0x255c54=_0x96d797?_0x49183e[_0x4c26('0x21')]:_0x57747b[_0x4c26('0x1e')]+_0x57747b[_0x4c26('0x20')];var _0x386722;if(_0x255c54>=_0x147ea3){_0x255c54=_0x147ea3;_0x386722=0xc8;}else{_0x386722=0xce;}_0x3c060b[_0x4c26('0x1b')](_0x386722);return _0x3c060b[_0x4c26('0x22')](_0x4c26('0x23'),_0x549a8a+'-'+_0x255c54+'/'+_0x147ea3)[_0x4c26('0x1d')](_0x49183e);}return null;};}function patchUpdates(_0x4098df){return function(_0x421dec){try{jsonpatch[_0x4c26('0x24')](_0x421dec,_0x4098df,!![]);}catch(_0x1993b6){return BPromise['reject'](_0x1993b6);}return _0x421dec[_0x4c26('0x25')]();};}function saveUpdates(_0x177e65,_0x3e70fa){return function(_0x4df47a){if(_0x4df47a){return _0x4df47a[_0x4c26('0x26')](_0x177e65)[_0x4c26('0x27')](function(_0x443a4f){return _0x443a4f;});}return null;};}function removeEntity(_0x7fc7e1,_0x4ac61f){return function(_0x22c441){if(_0x22c441){return _0x22c441[_0x4c26('0x28')]()['then'](function(){var _0x4282bb=_0x22c441['get']({'plain':!![]});var _0x5519a6=_0x4c26('0x29');return db[_0x4c26('0x2a')]['destroy']({'where':{'type':_0x5519a6,'resourceId':_0x4282bb['id']}})[_0x4c26('0x27')](function(){return _0x22c441;});})[_0x4c26('0x27')](function(){_0x7fc7e1[_0x4c26('0x1b')](0xcc)[_0x4c26('0x1c')]();});}};}function handleEntityNotFound(_0x2c7027,_0x2de833){return function(_0x14016b){if(!_0x14016b){_0x2c7027['sendStatus'](0x194);}return _0x14016b;};}function handleError(_0x5ea9a7,_0x4e453f){_0x4e453f=_0x4e453f||0x1f4;return function(_0x3995e6){logger['error'](_0x3995e6['stack']);if(_0x3995e6[_0x4c26('0x2b')]){delete _0x3995e6['name'];}_0x5ea9a7[_0x4c26('0x1b')](_0x4e453f)['send'](_0x3995e6);};}exports['index']=function(_0x26cbe5,_0x755346){var _0x4f30ec={},_0x180273={},_0x661912={'count':0x0,'rows':[]};var _0x36eada=_[_0x4c26('0x2c')](db[_0x4c26('0x2d')]['rawAttributes'],function(_0x41bb7f){return{'name':_0x41bb7f[_0x4c26('0x2e')],'type':_0x41bb7f[_0x4c26('0x2f')]['key']};});_0x180273[_0x4c26('0x30')]=_[_0x4c26('0x2c')](_0x36eada,_0x4c26('0x2b'));_0x180273[_0x4c26('0x31')]=_[_0x4c26('0x32')](_0x26cbe5[_0x4c26('0x31')]);_0x180273[_0x4c26('0x33')]=_[_0x4c26('0x34')](_0x180273['model'],_0x180273[_0x4c26('0x31')]);_0x4f30ec[_0x4c26('0x35')]=_[_0x4c26('0x34')](_0x180273[_0x4c26('0x30')],qs[_0x4c26('0x36')](_0x26cbe5['query'][_0x4c26('0x36')]));_0x4f30ec['attributes']=_0x4f30ec[_0x4c26('0x35')][_0x4c26('0x37')]?_0x4f30ec['attributes']:_0x180273['model'];if(!_0x26cbe5[_0x4c26('0x31')]['hasOwnProperty'](_0x4c26('0x38'))){_0x4f30ec[_0x4c26('0x20')]=qs[_0x4c26('0x20')](_0x26cbe5['query']['limit']);_0x4f30ec['offset']=qs[_0x4c26('0x1e')](_0x26cbe5[_0x4c26('0x31')][_0x4c26('0x1e')]);}_0x4f30ec[_0x4c26('0x39')]=qs[_0x4c26('0x3a')](_0x26cbe5[_0x4c26('0x31')][_0x4c26('0x3a')]);_0x4f30ec[_0x4c26('0x3b')]=qs[_0x4c26('0x33')](_['pick'](_0x26cbe5['query'],_0x180273[_0x4c26('0x33')]),_0x36eada);if(_0x26cbe5[_0x4c26('0x31')][_0x4c26('0x3c')]){_0x4f30ec['where']=_[_0x4c26('0x3d')](_0x4f30ec['where'],{'$or':_[_0x4c26('0x2c')](_0x36eada,function(_0x4534c6){if(_0x4534c6[_0x4c26('0x2f')]!==_0x4c26('0x3e')){var _0x143fc5={};_0x143fc5[_0x4534c6[_0x4c26('0x2b')]]={'$like':'%'+_0x26cbe5['query'][_0x4c26('0x3c')]+'%'};return _0x143fc5;}})});}_0x4f30ec=_['merge']({},_0x4f30ec,_0x26cbe5['options']);var _0x31a962={'where':_0x4f30ec['where']};return db['AnalyticExtractedReport'][_0x4c26('0x21')](_0x31a962)[_0x4c26('0x27')](function(_0x52ee44){_0x661912[_0x4c26('0x21')]=_0x52ee44;if(_0x26cbe5[_0x4c26('0x31')][_0x4c26('0x3f')]){_0x4f30ec[_0x4c26('0x40')]=[{'all':!![]}];}return db[_0x4c26('0x2d')][_0x4c26('0x41')](_0x4f30ec);})['then'](function(_0x2dfb84){_0x661912[_0x4c26('0x42')]=_0x2dfb84;return _0x661912;})[_0x4c26('0x27')](respondWithFilteredResult(_0x755346,_0x4f30ec))[_0x4c26('0x43')](handleError(_0x755346,null));};exports[_0x4c26('0x44')]=function(_0x70f814,_0x155061){var _0x5ab83d={'raw':!![],'where':{'id':_0x70f814[_0x4c26('0x45')]['id']}},_0x37d666={};_0x37d666[_0x4c26('0x30')]=_['keys'](db[_0x4c26('0x2d')]['rawAttributes']);_0x37d666['query']=_[_0x4c26('0x32')](_0x70f814[_0x4c26('0x31')]);_0x37d666[_0x4c26('0x33')]=_[_0x4c26('0x34')](_0x37d666[_0x4c26('0x30')],_0x37d666[_0x4c26('0x31')]);_0x5ab83d[_0x4c26('0x35')]=_[_0x4c26('0x34')](_0x37d666['model'],qs[_0x4c26('0x36')](_0x70f814[_0x4c26('0x31')][_0x4c26('0x36')]));_0x5ab83d[_0x4c26('0x35')]=_0x5ab83d[_0x4c26('0x35')]['length']?_0x5ab83d['attributes']:_0x37d666[_0x4c26('0x30')];if(_0x70f814['query']['includeAll']){_0x5ab83d[_0x4c26('0x40')]=[{'all':!![]}];}_0x5ab83d=_[_0x4c26('0x3d')]({},_0x5ab83d,_0x70f814[_0x4c26('0x46')]);return db['AnalyticExtractedReport']['find'](_0x5ab83d)['then'](handleEntityNotFound(_0x155061,null))[_0x4c26('0x27')](respondWithResult(_0x155061,null))[_0x4c26('0x43')](handleError(_0x155061,null));};exports[_0x4c26('0x47')]=function(_0x5cbb21,_0xcd6312){return db['AnalyticExtractedReport']['create'](_0x5cbb21[_0x4c26('0x48')],{})[_0x4c26('0x27')](function(_0x49c894){var _0x46ec51=_0x5cbb21['user']['get']({'plain':!![]});if(!_0x46ec51)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46ec51[_0x4c26('0x49')]===_0x4c26('0x4a')){var _0x427145=_0x49c894[_0x4c26('0x4b')]({'plain':!![]});var _0x4c8f71='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x4c8f71,'userProfileId':_0x46ec51[_0x4c26('0x4c')]},'raw':!![]})[_0x4c26('0x27')](function(_0x155f58){if(_0x155f58&&_0x155f58[_0x4c26('0x4d')]===0x0){return db[_0x4c26('0x2a')]['create']({'name':_0x427145['name'],'resourceId':_0x427145['id'],'type':_0x155f58[_0x4c26('0x2b')],'sectionId':_0x155f58['id']},{})[_0x4c26('0x27')](function(){return _0x49c894;});}else{return _0x49c894;}})[_0x4c26('0x43')](function(_0x4dd310){logger['error'](_0x4c26('0x4e'),_0x4dd310);throw _0x4dd310;});}return _0x49c894;})['then'](respondWithResult(_0xcd6312,0xc9))[_0x4c26('0x43')](handleError(_0xcd6312,null));};exports[_0x4c26('0x26')]=function(_0x151d52,_0x3fdd60){if(_0x151d52[_0x4c26('0x48')]['id']){delete _0x151d52[_0x4c26('0x48')]['id'];}return db[_0x4c26('0x2d')]['find']({'where':{'id':_0x151d52['params']['id']}})['then'](handleEntityNotFound(_0x3fdd60,null))['then'](saveUpdates(_0x151d52['body'],null))[_0x4c26('0x27')](respondWithResult(_0x3fdd60,null))[_0x4c26('0x43')](handleError(_0x3fdd60,null));};exports[_0x4c26('0x28')]=function(_0x25835f,_0x1b0dec){return db[_0x4c26('0x2d')]['find']({'where':{'id':_0x25835f['params']['id']}})[_0x4c26('0x27')](handleEntityNotFound(_0x1b0dec,null))['then'](removeEntity(_0x1b0dec,null))['catch'](handleError(_0x1b0dec,null));};exports['download']=function(_0x54c2d8,_0x91984f,_0x3c01aa){return db['AnalyticExtractedReport'][_0x4c26('0x4f')]({'where':{'id':_0x54c2d8['params']['id']},'attributes':[_0x4c26('0x2b'),_0x4c26('0x50'),_0x4c26('0x51'),_0x4c26('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x91984f,null))['then'](function(_0x50f629){if(_0x50f629){if(!fs['existsSync'](path[_0x4c26('0x53')](config[_0x4c26('0x54')],'server/files/reports',_0x50f629[_0x4c26('0x51')]))){throw new db[(_0x4c26('0x55'))]['ValidationError'](_0x4c26('0x56'));}if(_0x54c2d8[_0x4c26('0x31')][_0x4c26('0x57')]){return _0x91984f[_0x4c26('0x1a')](0xc8);}return _0x91984f[_0x4c26('0x58')](path['join'](config[_0x4c26('0x54')],'server/files/reports',_0x50f629[_0x4c26('0x51')]),util[_0x4c26('0x59')](_0x4c26('0x5a'),_0x50f629[_0x4c26('0x50')]||_0x50f629[_0x4c26('0x2b')],_0x50f629[_0x4c26('0x52')][_0x4c26('0x5b')]()));}})[_0x4c26('0x43')](handleError(_0x91984f,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index c9b7b58..9b7396b 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 _0x6e96=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x4f9939,_0x56fa3b){var _0x5e8326=function(_0x46752d){while(--_0x46752d){_0x4f9939['push'](_0x4f9939['shift']());}};_0x5e8326(++_0x56fa3b);}(_0x6e96,0x15e));var _0x66e9=function(_0x1eca8f,_0x118d68){_0x1eca8f=_0x1eca8f-0x0;var _0x3701ce=_0x6e96[_0x1eca8f];return _0x3701ce;};'use strict';var _=require('lodash');var util=require(_0x66e9('0x0'));var logger=require(_0x66e9('0x1'))(_0x66e9('0x2'));var moment=require(_0x66e9('0x3'));var BPromise=require(_0x66e9('0x4'));var rp=require(_0x66e9('0x5'));var fs=require('fs');var path=require(_0x66e9('0x6'));var rimraf=require(_0x66e9('0x7'));var config=require(_0x66e9('0x8'));var attributes=require(_0x66e9('0x9'));module[_0x66e9('0xa')]=function(_0x16ebfa,_0x4bca55){return _0x16ebfa[_0x66e9('0xb')](_0x66e9('0xc'),attributes,{'tableName':_0x66e9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0833=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d829d,_0x324003){var _0x52bfbd=function(_0xcea689){while(--_0xcea689){_0x3d829d['push'](_0x3d829d['shift']());}};_0x52bfbd(++_0x324003);}(_0x0833,0x161));var _0x3083=function(_0x240653,_0x4192c7){_0x240653=_0x240653-0x0;var _0x7e99c2=_0x0833[_0x240653];return _0x7e99c2;};'use strict';var _=require(_0x3083('0x0'));var util=require(_0x3083('0x1'));var logger=require(_0x3083('0x2'))(_0x3083('0x3'));var moment=require(_0x3083('0x4'));var BPromise=require(_0x3083('0x5'));var rp=require(_0x3083('0x6'));var fs=require('fs');var path=require(_0x3083('0x7'));var rimraf=require(_0x3083('0x8'));var config=require(_0x3083('0x9'));var attributes=require(_0x3083('0xa'));module['exports']=function(_0x9cd568,_0x5f3605){return _0x9cd568['define'](_0x3083('0xb'),attributes,{'tableName':'analytics_extracted_reports','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 903b48f..6553aa5 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 _0x0f8e=['info','debug','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x131b66,_0x54f2b9){var _0xea6fe4=function(_0x2a020e){while(--_0x2a020e){_0x131b66['push'](_0x131b66['shift']());}};_0xea6fe4(++_0x54f2b9);}(_0x0f8e,0x7a));var _0xe0f8=function(_0x5bcdb9,_0x2bef44){_0x5bcdb9=_0x5bcdb9-0x0;var _0x4f0dda=_0x0f8e[_0x5bcdb9];return _0x4f0dda;};'use strict';var _=require('lodash');var util=require(_0xe0f8('0x0'));var moment=require(_0xe0f8('0x1'));var BPromise=require(_0xe0f8('0x2'));var rs=require(_0xe0f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0f8('0x4'))['db'];var utils=require(_0xe0f8('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe0f8('0x6'));var client=jayson[_0xe0f8('0x7')][_0xe0f8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46a28f,_0x560534,_0x13a816){return new BPromise(function(_0x5938b7,_0x6ce02d){return client[_0xe0f8('0x9')](_0x46a28f,_0x13a816)[_0xe0f8('0xa')](function(_0x375013){logger[_0xe0f8('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x560534,'request\x20sent');logger[_0xe0f8('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x560534,'request\x20sent',JSON[_0xe0f8('0xd')](_0x375013));if(_0x375013['error']){if(_0x375013[_0xe0f8('0xe')]['code']===0x1f4){logger['error'](_0xe0f8('0xf'),_0x560534,_0x375013[_0xe0f8('0xe')][_0xe0f8('0x10')]);return _0x6ce02d(_0x375013[_0xe0f8('0xe')][_0xe0f8('0x10')]);}logger[_0xe0f8('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x560534,_0x375013[_0xe0f8('0xe')][_0xe0f8('0x10')]);return _0x5938b7(_0x375013['error'][_0xe0f8('0x10')]);}else{logger[_0xe0f8('0xb')](_0xe0f8('0xf'),_0x560534,'request\x20sent');_0x5938b7(_0x375013[_0xe0f8('0x11')][_0xe0f8('0x10')]);}})[_0xe0f8('0x12')](function(_0xa07f64){logger[_0xe0f8('0xe')](_0xe0f8('0xf'),_0x560534,_0xa07f64);_0x6ce02d(_0xa07f64);});});}
\ No newline at end of file
+var _0x3e23=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x1bfb22,_0x11bf71){var _0x52c53c=function(_0x16152e){while(--_0x16152e){_0x1bfb22['push'](_0x1bfb22['shift']());}};_0x52c53c(++_0x11bf71);}(_0x3e23,0x9c));var _0x33e2=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0x3e23[_0x413727];return _0x5f46d7;};'use strict';var _=require(_0x33e2('0x0'));var util=require(_0x33e2('0x1'));var moment=require(_0x33e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x33e2('0x3'));var fs=require('fs');var Redis=require(_0x33e2('0x4'));var db=require(_0x33e2('0x5'))['db'];var utils=require(_0x33e2('0x6'));var logger=require('../../config/logger')(_0x33e2('0x7'));var config=require(_0x33e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x33e2('0x9')][_0x33e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42e6a0,_0x5da45c,_0x21501f){return new BPromise(function(_0x567392,_0x35ff3a){return client[_0x33e2('0xb')](_0x42e6a0,_0x21501f)['then'](function(_0x58fda9){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5da45c,_0x33e2('0xc'));logger[_0x33e2('0xd')](_0x33e2('0xe'),_0x5da45c,'request\x20sent',JSON[_0x33e2('0xf')](_0x58fda9));if(_0x58fda9[_0x33e2('0x10')]){if(_0x58fda9[_0x33e2('0x10')]['code']===0x1f4){logger[_0x33e2('0x10')](_0x33e2('0x11'),_0x5da45c,_0x58fda9[_0x33e2('0x10')][_0x33e2('0x12')]);return _0x35ff3a(_0x58fda9[_0x33e2('0x10')][_0x33e2('0x12')]);}logger[_0x33e2('0x10')](_0x33e2('0x11'),_0x5da45c,_0x58fda9[_0x33e2('0x10')][_0x33e2('0x12')]);return _0x567392(_0x58fda9[_0x33e2('0x10')][_0x33e2('0x12')]);}else{logger['info'](_0x33e2('0x11'),_0x5da45c,_0x33e2('0xc'));_0x567392(_0x58fda9[_0x33e2('0x13')][_0x33e2('0x12')]);}})[_0x33e2('0x14')](function(_0x1fa7b5){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5da45c,_0x1fa7b5);_0x35ff3a(_0x1fa7b5);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index b994581..190290f 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 _0x8665=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','download','post','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x1ee7ef,_0x3a7b95){var _0x3203f1=function(_0x94c74d){while(--_0x94c74d){_0x1ee7ef['push'](_0x1ee7ef['shift']());}};_0x3203f1(++_0x3a7b95);}(_0x8665,0x175));var _0x5866=function(_0x3ce3d0,_0x597f99){_0x3ce3d0=_0x3ce3d0-0x0;var _0x23cbe9=_0x8665[_0x3ce3d0];return _0x23cbe9;};'use strict';var multer=require(_0x5866('0x0'));var util=require(_0x5866('0x1'));var path=require(_0x5866('0x2'));var timeout=require(_0x5866('0x3'));var express=require(_0x5866('0x4'));var router=express[_0x5866('0x5')]();var fs_extra=require(_0x5866('0x6'));var auth=require(_0x5866('0x7'));var interaction=require(_0x5866('0x8'));var config=require(_0x5866('0x9'));var controller=require(_0x5866('0xa'));router[_0x5866('0xb')]('/',auth[_0x5866('0xc')](),controller['index']);router['get'](_0x5866('0xd'),auth[_0x5866('0xc')](),controller['show']);router['get'](_0x5866('0xe'),auth[_0x5866('0xc')](),controller[_0x5866('0xf')]);router[_0x5866('0x10')]('/',auth[_0x5866('0xc')](),controller[_0x5866('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5866('0x12')]);router[_0x5866('0x13')]('/:id',auth[_0x5866('0xc')](),controller[_0x5866('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x15d3=['connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','post','create','put','/:id','update','delete','exports','util','path'];(function(_0x5c467f,_0x2f5eba){var _0x431ede=function(_0x16ba14){while(--_0x16ba14){_0x5c467f['push'](_0x5c467f['shift']());}};_0x431ede(++_0x2f5eba);}(_0x15d3,0x130));var _0x315d=function(_0x26a608,_0x5e5693){_0x26a608=_0x26a608-0x0;var _0x4271c5=_0x15d3[_0x26a608];return _0x4271c5;};'use strict';var multer=require('multer');var util=require(_0x315d('0x0'));var path=require(_0x315d('0x1'));var timeout=require(_0x315d('0x2'));var express=require('express');var router=express[_0x315d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x315d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x315d('0x5'));var controller=require(_0x315d('0x6'));router[_0x315d('0x7')]('/',auth[_0x315d('0x8')](),controller['index']);router[_0x315d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x315d('0x9')]);router[_0x315d('0x7')](_0x315d('0xa'),auth['isAuthenticated'](),controller['download']);router[_0x315d('0xb')]('/',auth[_0x315d('0x8')](),controller[_0x315d('0xc')]);router[_0x315d('0xd')](_0x315d('0xe'),auth[_0x315d('0x8')](),controller[_0x315d('0xf')]);router[_0x315d('0x10')](_0x315d('0xe'),auth[_0x315d('0x8')](),controller['destroy']);module[_0x315d('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 61b9237..6160b22 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 _0x90cd=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0x90cd,0xfa));var _0xd90c=function(_0x5b22fd,_0x5f706d){_0x5b22fd=_0x5b22fd-0x0;var _0xae3688=_0x90cd[_0x5b22fd];return _0xae3688;};'use strict';var Sequelize=require(_0xd90c('0x0'));module[_0xd90c('0x1')]={'field':{'type':Sequelize[_0xd90c('0x2')]},'alias':{'type':Sequelize[_0xd90c('0x3')]},'function':{'type':Sequelize[_0xd90c('0x3')]},'format':{'type':Sequelize[_0xd90c('0x3')]},'groupBy':{'type':Sequelize[_0xd90c('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd90c('0x3')]},'custom':{'type':Sequelize[_0xd90c('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2824=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2824,0x12a));var _0x4282=function(_0x5df1bb,_0x25d79e){_0x5df1bb=_0x5df1bb-0x0;var _0x3a98bf=_0x2824[_0x5df1bb];return _0x3a98bf;};'use strict';var Sequelize=require(_0x4282('0x0'));module['exports']={'field':{'type':Sequelize[_0x4282('0x1')]},'alias':{'type':Sequelize[_0x4282('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4282('0x2')]},'groupBy':{'type':Sequelize[_0x4282('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x4282('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 0c07012..3b9d563 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 _0xe456=['AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','create','catch','bulkCreate','body','destroy','ids','addFields'];(function(_0x4f1f67,_0x119f0f){var _0x412cee=function(_0x37dda1){while(--_0x37dda1){_0x4f1f67['push'](_0x4f1f67['shift']());}};_0x412cee(++_0x119f0f);}(_0xe456,0xa3));var _0x6e45=function(_0x1c48cb,_0x533eeb){_0x1c48cb=_0x1c48cb-0x0;var _0x405af7=_0xe456[_0x1c48cb];return _0x405af7;};'use strict';var emlformat=require(_0x6e45('0x0'));var rimraf=require(_0x6e45('0x1'));var zipdir=require(_0x6e45('0x2'));var jsonpatch=require(_0x6e45('0x3'));var rp=require(_0x6e45('0x4'));var moment=require(_0x6e45('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6e45('0x6'));var util=require(_0x6e45('0x7'));var path=require('path');var sox=require(_0x6e45('0x8'));var csv=require(_0x6e45('0x9'));var ejs=require(_0x6e45('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e45('0xb'));var squel=require('squel');var crypto=require(_0x6e45('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6e45('0x9'));var querystring=require(_0x6e45('0xd'));var Papa=require(_0x6e45('0xe'));var Redis=require(_0x6e45('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6e45('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6e45('0x11'));var utils=require(_0x6e45('0x12'));var config=require(_0x6e45('0x13'));var licenseUtil=require(_0x6e45('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22b34e,_0x130d79){_0x130d79=_0x130d79||0xcc;return function(_0x2640f3){if(_0x2640f3){return _0x22b34e[_0x6e45('0x15')](_0x130d79);}return _0x22b34e['status'](_0x130d79)[_0x6e45('0x16')]();};}function respondWithResult(_0x5795e0,_0x3073e8){_0x3073e8=_0x3073e8||0xc8;return function(_0x3d8434){if(_0x3d8434){return _0x5795e0[_0x6e45('0x17')](_0x3073e8)[_0x6e45('0x18')](_0x3d8434);}};}function respondWithFilteredResult(_0xc8c780,_0x503ba8){return function(_0x2131de){if(_0x2131de){var _0x17daba=typeof _0x503ba8[_0x6e45('0x19')]==='undefined'&&typeof _0x503ba8[_0x6e45('0x1a')]==='undefined';var _0x52401a=_0x2131de[_0x6e45('0x1b')];var _0x17aa9e=_0x17daba?0x0:_0x503ba8[_0x6e45('0x19')];var _0x838790=_0x17daba?_0x2131de['count']:_0x503ba8[_0x6e45('0x19')]+_0x503ba8[_0x6e45('0x1a')];var _0x28276f;if(_0x838790>=_0x52401a){_0x838790=_0x52401a;_0x28276f=0xc8;}else{_0x28276f=0xce;}_0xc8c780[_0x6e45('0x17')](_0x28276f);return _0xc8c780['set'](_0x6e45('0x1c'),_0x17aa9e+'-'+_0x838790+'/'+_0x52401a)[_0x6e45('0x18')](_0x2131de);}return null;};}function patchUpdates(_0x5b85bc){return function(_0x131986){try{jsonpatch[_0x6e45('0x1d')](_0x131986,_0x5b85bc,!![]);}catch(_0x2dc0e4){return BPromise[_0x6e45('0x1e')](_0x2dc0e4);}return _0x131986[_0x6e45('0x1f')]();};}function saveUpdates(_0x408efb,_0x18e2fd){return function(_0x2874b4){if(_0x2874b4){return _0x2874b4[_0x6e45('0x20')](_0x408efb)[_0x6e45('0x21')](function(_0x49ebc1){return _0x49ebc1;});}return null;};}function removeEntity(_0x13d3b9,_0x44d501){return function(_0x3fadee){if(_0x3fadee){return _0x3fadee['destroy']()['then'](function(){_0x13d3b9[_0x6e45('0x17')](0xcc)[_0x6e45('0x16')]();});}};}function handleEntityNotFound(_0x38fb85,_0x31de80){return function(_0x675f16){if(!_0x675f16){_0x38fb85[_0x6e45('0x15')](0x194);}return _0x675f16;};}function handleError(_0x1889c0,_0x4a55a1){_0x4a55a1=_0x4a55a1||0x1f4;return function(_0x5b3e4a){logger[_0x6e45('0x22')](_0x5b3e4a[_0x6e45('0x23')]);if(_0x5b3e4a[_0x6e45('0x24')]){delete _0x5b3e4a[_0x6e45('0x24')];}_0x1889c0[_0x6e45('0x17')](_0x4a55a1)[_0x6e45('0x25')](_0x5b3e4a);};}exports['index']=function(_0xc6b940,_0x475c2b){var _0xa27d31={},_0x550633={},_0x28009b={'count':0x0,'rows':[]};var _0x563224=_[_0x6e45('0x26')](db[_0x6e45('0x27')][_0x6e45('0x28')],function(_0xce0189){return{'name':_0xce0189['fieldName'],'type':_0xce0189[_0x6e45('0x29')]['key']};});_0x550633['model']=_[_0x6e45('0x26')](_0x563224,_0x6e45('0x24'));_0x550633[_0x6e45('0x2a')]=_[_0x6e45('0x2b')](_0xc6b940['query']);_0x550633[_0x6e45('0x2c')]=_[_0x6e45('0x2d')](_0x550633['model'],_0x550633['query']);_0xa27d31[_0x6e45('0x2e')]=_[_0x6e45('0x2d')](_0x550633[_0x6e45('0x2f')],qs['fields'](_0xc6b940[_0x6e45('0x2a')][_0x6e45('0x30')]));_0xa27d31[_0x6e45('0x2e')]=_0xa27d31['attributes']['length']?_0xa27d31[_0x6e45('0x2e')]:_0x550633[_0x6e45('0x2f')];if(!_0xc6b940[_0x6e45('0x2a')][_0x6e45('0x31')](_0x6e45('0x32'))){_0xa27d31[_0x6e45('0x1a')]=qs['limit'](_0xc6b940[_0x6e45('0x2a')][_0x6e45('0x1a')]);_0xa27d31[_0x6e45('0x19')]=qs[_0x6e45('0x19')](_0xc6b940[_0x6e45('0x2a')][_0x6e45('0x19')]);}_0xa27d31[_0x6e45('0x33')]=qs[_0x6e45('0x34')](_0xc6b940[_0x6e45('0x2a')]['sort']);_0xa27d31[_0x6e45('0x35')]=qs[_0x6e45('0x2c')](_[_0x6e45('0x36')](_0xc6b940[_0x6e45('0x2a')],_0x550633[_0x6e45('0x2c')]),_0x563224);if(_0xc6b940['query'][_0x6e45('0x37')]){_0xa27d31[_0x6e45('0x35')]=_[_0x6e45('0x38')](_0xa27d31[_0x6e45('0x35')],{'$or':_['map'](_0x563224,function(_0x2c5a6e){if(_0x2c5a6e[_0x6e45('0x29')]!==_0x6e45('0x39')){var _0x387e3f={};_0x387e3f[_0x2c5a6e[_0x6e45('0x24')]]={'$like':'%'+_0xc6b940['query'][_0x6e45('0x37')]+'%'};return _0x387e3f;}})});}_0xa27d31=_[_0x6e45('0x38')]({},_0xa27d31,_0xc6b940[_0x6e45('0x3a')]);var _0xa081f0={'where':_0xa27d31[_0x6e45('0x35')]};return db['AnalyticFieldReport'][_0x6e45('0x1b')](_0xa081f0)['then'](function(_0x28ad44){_0x28009b[_0x6e45('0x1b')]=_0x28ad44;if(_0xc6b940['query'][_0x6e45('0x3b')]){_0xa27d31['include']=[{'all':!![]}];}return db[_0x6e45('0x27')][_0x6e45('0x3c')](_0xa27d31);})['then'](function(_0x247bad){_0x28009b[_0x6e45('0x3d')]=_0x247bad;return _0x28009b;})[_0x6e45('0x21')](respondWithFilteredResult(_0x475c2b,_0xa27d31))['catch'](handleError(_0x475c2b,null));};exports[_0x6e45('0x3e')]=function(_0x555fcf,_0x5182ac){var _0x581b1b={'raw':![],'where':{'id':_0x555fcf[_0x6e45('0x3f')]['id']}},_0x17e632={};_0x17e632[_0x6e45('0x2f')]=_[_0x6e45('0x2b')](db[_0x6e45('0x27')]['rawAttributes']);_0x17e632[_0x6e45('0x2a')]=_[_0x6e45('0x2b')](_0x555fcf[_0x6e45('0x2a')]);_0x17e632[_0x6e45('0x2c')]=_['intersection'](_0x17e632[_0x6e45('0x2f')],_0x17e632[_0x6e45('0x2a')]);_0x581b1b[_0x6e45('0x2e')]=_[_0x6e45('0x2d')](_0x17e632['model'],qs['fields'](_0x555fcf['query'][_0x6e45('0x30')]));_0x581b1b[_0x6e45('0x2e')]=_0x581b1b[_0x6e45('0x2e')][_0x6e45('0x40')]?_0x581b1b[_0x6e45('0x2e')]:_0x17e632['model'];if(_0x555fcf[_0x6e45('0x2a')][_0x6e45('0x3b')]){_0x581b1b[_0x6e45('0x41')]=[{'all':!![]}];}_0x581b1b=_[_0x6e45('0x38')]({},_0x581b1b,_0x555fcf['options']);return db[_0x6e45('0x27')][_0x6e45('0x42')](_0x581b1b)[_0x6e45('0x21')](handleEntityNotFound(_0x5182ac,null))[_0x6e45('0x21')](respondWithResult(_0x5182ac,null))['catch'](handleError(_0x5182ac,null));};exports[_0x6e45('0x43')]=function(_0x56c88e,_0x48c87b){return db['AnalyticFieldReport'][_0x6e45('0x43')](_0x56c88e['body'],{})[_0x6e45('0x21')](respondWithResult(_0x48c87b,0xc9))[_0x6e45('0x44')](handleError(_0x48c87b,null));};exports[_0x6e45('0x45')]=function(_0x1e59b0,_0x6058eb){return db[_0x6e45('0x27')][_0x6e45('0x45')](_0x1e59b0['body'],{'raw':![],'individualHooks':!![]})[_0x6e45('0x21')](respondWithResult(_0x6058eb,0xc9))[_0x6e45('0x44')](handleError(_0x6058eb,null));};exports[_0x6e45('0x20')]=function(_0x17815a,_0x414a24){if(_0x17815a[_0x6e45('0x46')]['id']){delete _0x17815a[_0x6e45('0x46')]['id'];}return db[_0x6e45('0x27')][_0x6e45('0x42')]({'where':{'id':_0x17815a[_0x6e45('0x3f')]['id']}})[_0x6e45('0x21')](handleEntityNotFound(_0x414a24,null))[_0x6e45('0x21')](saveUpdates(_0x17815a[_0x6e45('0x46')],null))['then'](respondWithResult(_0x414a24,null))[_0x6e45('0x44')](handleError(_0x414a24,null));};exports[_0x6e45('0x47')]=function(_0x185aa6,_0x3053de){return db[_0x6e45('0x27')]['find']({'where':{'id':_0x185aa6[_0x6e45('0x3f')]['id']}})[_0x6e45('0x21')](handleEntityNotFound(_0x3053de,null))[_0x6e45('0x21')](removeEntity(_0x3053de,null))['catch'](handleError(_0x3053de,null));};exports['bulkDestroy']=function(_0x5b5b46,_0x15cdb7){return db[_0x6e45('0x27')]['destroy']({'where':{'id':_0x5b5b46['query'][_0x6e45('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x15cdb7,0xcc))[_0x6e45('0x44')](handleError(_0x15cdb7,null));};exports[_0x6e45('0x49')]=function(_0x590fdb,_0x11b67b,_0x580ce9){return db[_0x6e45('0x4a')][_0x6e45('0x4b')]({'where':{'id':_0x590fdb[_0x6e45('0x3f')]['id']}})['then'](handleEntityNotFound(_0x11b67b,null))[_0x6e45('0x21')](function(_0x162b6a){if(_0x162b6a){return db[_0x6e45('0x4c')][_0x6e45('0x4d')](function(_0xf23be5){return db[_0x6e45('0x27')][_0x6e45('0x47')]({'where':{'CustomReportId':_0x590fdb[_0x6e45('0x3f')]['id']},'transaction':_0xf23be5})[_0x6e45('0x21')](function(_0x2cbb05){var _0x4d0232=_[_0x6e45('0x26')](_0x590fdb[_0x6e45('0x46')],function(_0x4c8748){delete _0x4c8748['id'];_0x4c8748[_0x6e45('0x4e')]=_0x590fdb[_0x6e45('0x3f')]['id'];return _0x4c8748;});return db[_0x6e45('0x27')][_0x6e45('0x45')](_0x4d0232,{'transaction':_0xf23be5});});})[_0x6e45('0x21')](function(){return db[_0x6e45('0x27')][_0x6e45('0x3c')]({'where':{'CustomReportId':_0x590fdb[_0x6e45('0x3f')]['id']}});});}})['then'](respondWithResult(_0x11b67b,null))[_0x6e45('0x44')](handleError(_0x11b67b,null));};
\ No newline at end of file
+var _0xb0be=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3f77d0,_0x403a69){var _0x18e117=function(_0x6d7322){while(--_0x6d7322){_0x3f77d0['push'](_0x3f77d0['shift']());}};_0x18e117(++_0x403a69);}(_0xb0be,0xa8));var _0xeb0b=function(_0x4d216c,_0x363a80){_0x4d216c=_0x4d216c-0x0;var _0x36fe74=_0xb0be[_0x4d216c];return _0x36fe74;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb0b('0x0'));var jsonpatch=require(_0xeb0b('0x1'));var rp=require(_0xeb0b('0x2'));var moment=require(_0xeb0b('0x3'));var BPromise=require(_0xeb0b('0x4'));var Mustache=require(_0xeb0b('0x5'));var util=require(_0xeb0b('0x6'));var path=require(_0xeb0b('0x7'));var sox=require(_0xeb0b('0x8'));var csv=require(_0xeb0b('0x9'));var ejs=require(_0xeb0b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb0b('0xb'));var squel=require(_0xeb0b('0xc'));var crypto=require('crypto');var jsforce=require(_0xeb0b('0xd'));var deskjs=require(_0xeb0b('0xe'));var toCsv=require(_0xeb0b('0x9'));var querystring=require(_0xeb0b('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb0b('0x10'));var authService=require(_0xeb0b('0x11'));var qs=require(_0xeb0b('0x12'));var as=require(_0xeb0b('0x13'));var hardwareService=require(_0xeb0b('0x14'));var logger=require(_0xeb0b('0x15'))(_0xeb0b('0x16'));var utils=require(_0xeb0b('0x17'));var config=require(_0xeb0b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2074c,_0x5888bf){_0x5888bf=_0x5888bf||0xcc;return function(_0x1a70f2){if(_0x1a70f2){return _0x2074c[_0xeb0b('0x19')](_0x5888bf);}return _0x2074c['status'](_0x5888bf)['end']();};}function respondWithResult(_0xd4a139,_0x5be020){_0x5be020=_0x5be020||0xc8;return function(_0x3edeaf){if(_0x3edeaf){return _0xd4a139['status'](_0x5be020)[_0xeb0b('0x1a')](_0x3edeaf);}};}function respondWithFilteredResult(_0xf04b13,_0x40c692){return function(_0x1308ae){if(_0x1308ae){var _0x23cc7d=typeof _0x40c692[_0xeb0b('0x1b')]==='undefined'&&typeof _0x40c692[_0xeb0b('0x1c')]===_0xeb0b('0x1d');var _0x564888=_0x1308ae[_0xeb0b('0x1e')];var _0x44371b=_0x23cc7d?0x0:_0x40c692['offset'];var _0x3992e5=_0x23cc7d?_0x1308ae['count']:_0x40c692[_0xeb0b('0x1b')]+_0x40c692[_0xeb0b('0x1c')];var _0x472ac2;if(_0x3992e5>=_0x564888){_0x3992e5=_0x564888;_0x472ac2=0xc8;}else{_0x472ac2=0xce;}_0xf04b13[_0xeb0b('0x1f')](_0x472ac2);return _0xf04b13[_0xeb0b('0x20')](_0xeb0b('0x21'),_0x44371b+'-'+_0x3992e5+'/'+_0x564888)['json'](_0x1308ae);}return null;};}function patchUpdates(_0x45971c){return function(_0x2ae86b){try{jsonpatch[_0xeb0b('0x22')](_0x2ae86b,_0x45971c,!![]);}catch(_0xbb2d36){return BPromise[_0xeb0b('0x23')](_0xbb2d36);}return _0x2ae86b[_0xeb0b('0x24')]();};}function saveUpdates(_0x5c71bd,_0x481dba){return function(_0x302a49){if(_0x302a49){return _0x302a49[_0xeb0b('0x25')](_0x5c71bd)[_0xeb0b('0x26')](function(_0xe58bec){return _0xe58bec;});}return null;};}function removeEntity(_0xd30d6f,_0x2b33b9){return function(_0x1e59cf){if(_0x1e59cf){return _0x1e59cf['destroy']()[_0xeb0b('0x26')](function(){_0xd30d6f[_0xeb0b('0x1f')](0xcc)[_0xeb0b('0x27')]();});}};}function handleEntityNotFound(_0x452707,_0x2e11cb){return function(_0x5a331a){if(!_0x5a331a){_0x452707[_0xeb0b('0x19')](0x194);}return _0x5a331a;};}function handleError(_0x1a061c,_0x534bca){_0x534bca=_0x534bca||0x1f4;return function(_0x412986){logger[_0xeb0b('0x28')](_0x412986[_0xeb0b('0x29')]);if(_0x412986[_0xeb0b('0x2a')]){delete _0x412986[_0xeb0b('0x2a')];}_0x1a061c['status'](_0x534bca)['send'](_0x412986);};}exports[_0xeb0b('0x2b')]=function(_0x59f2bf,_0x586893){var _0x2763d5={},_0x149072={},_0x1446d3={'count':0x0,'rows':[]};var _0x3d9f49=_[_0xeb0b('0x2c')](db[_0xeb0b('0x2d')][_0xeb0b('0x2e')],function(_0x44f04a){return{'name':_0x44f04a[_0xeb0b('0x2f')],'type':_0x44f04a[_0xeb0b('0x30')]['key']};});_0x149072[_0xeb0b('0x31')]=_[_0xeb0b('0x2c')](_0x3d9f49,_0xeb0b('0x2a'));_0x149072[_0xeb0b('0x32')]=_[_0xeb0b('0x33')](_0x59f2bf[_0xeb0b('0x32')]);_0x149072[_0xeb0b('0x34')]=_[_0xeb0b('0x35')](_0x149072[_0xeb0b('0x31')],_0x149072[_0xeb0b('0x32')]);_0x2763d5['attributes']=_['intersection'](_0x149072[_0xeb0b('0x31')],qs[_0xeb0b('0x36')](_0x59f2bf[_0xeb0b('0x32')]['fields']));_0x2763d5[_0xeb0b('0x37')]=_0x2763d5['attributes'][_0xeb0b('0x38')]?_0x2763d5[_0xeb0b('0x37')]:_0x149072[_0xeb0b('0x31')];if(!_0x59f2bf[_0xeb0b('0x32')][_0xeb0b('0x39')](_0xeb0b('0x3a'))){_0x2763d5[_0xeb0b('0x1c')]=qs[_0xeb0b('0x1c')](_0x59f2bf[_0xeb0b('0x32')][_0xeb0b('0x1c')]);_0x2763d5[_0xeb0b('0x1b')]=qs[_0xeb0b('0x1b')](_0x59f2bf[_0xeb0b('0x32')][_0xeb0b('0x1b')]);}_0x2763d5[_0xeb0b('0x3b')]=qs['sort'](_0x59f2bf[_0xeb0b('0x32')][_0xeb0b('0x3c')]);_0x2763d5[_0xeb0b('0x3d')]=qs[_0xeb0b('0x34')](_[_0xeb0b('0x3e')](_0x59f2bf[_0xeb0b('0x32')],_0x149072['filters']),_0x3d9f49);if(_0x59f2bf[_0xeb0b('0x32')]['filter']){_0x2763d5['where']=_[_0xeb0b('0x3f')](_0x2763d5[_0xeb0b('0x3d')],{'$or':_[_0xeb0b('0x2c')](_0x3d9f49,function(_0x3a699c){if(_0x3a699c[_0xeb0b('0x30')]!==_0xeb0b('0x40')){var _0x14d2ff={};_0x14d2ff[_0x3a699c['name']]={'$like':'%'+_0x59f2bf[_0xeb0b('0x32')][_0xeb0b('0x41')]+'%'};return _0x14d2ff;}})});}_0x2763d5=_['merge']({},_0x2763d5,_0x59f2bf[_0xeb0b('0x42')]);var _0x150ab9={'where':_0x2763d5[_0xeb0b('0x3d')]};return db[_0xeb0b('0x2d')][_0xeb0b('0x1e')](_0x150ab9)[_0xeb0b('0x26')](function(_0x1aca2b){_0x1446d3[_0xeb0b('0x1e')]=_0x1aca2b;if(_0x59f2bf['query'][_0xeb0b('0x43')]){_0x2763d5[_0xeb0b('0x44')]=[{'all':!![]}];}return db[_0xeb0b('0x2d')][_0xeb0b('0x45')](_0x2763d5);})[_0xeb0b('0x26')](function(_0x48c3e9){_0x1446d3[_0xeb0b('0x46')]=_0x48c3e9;return _0x1446d3;})[_0xeb0b('0x26')](respondWithFilteredResult(_0x586893,_0x2763d5))['catch'](handleError(_0x586893,null));};exports[_0xeb0b('0x47')]=function(_0xc593fa,_0x2e2f78){var _0x4f3a7f={'raw':![],'where':{'id':_0xc593fa[_0xeb0b('0x48')]['id']}},_0x268b55={};_0x268b55[_0xeb0b('0x31')]=_[_0xeb0b('0x33')](db[_0xeb0b('0x2d')]['rawAttributes']);_0x268b55[_0xeb0b('0x32')]=_[_0xeb0b('0x33')](_0xc593fa['query']);_0x268b55[_0xeb0b('0x34')]=_[_0xeb0b('0x35')](_0x268b55[_0xeb0b('0x31')],_0x268b55[_0xeb0b('0x32')]);_0x4f3a7f[_0xeb0b('0x37')]=_[_0xeb0b('0x35')](_0x268b55[_0xeb0b('0x31')],qs[_0xeb0b('0x36')](_0xc593fa[_0xeb0b('0x32')][_0xeb0b('0x36')]));_0x4f3a7f[_0xeb0b('0x37')]=_0x4f3a7f[_0xeb0b('0x37')][_0xeb0b('0x38')]?_0x4f3a7f['attributes']:_0x268b55[_0xeb0b('0x31')];if(_0xc593fa[_0xeb0b('0x32')]['includeAll']){_0x4f3a7f[_0xeb0b('0x44')]=[{'all':!![]}];}_0x4f3a7f=_[_0xeb0b('0x3f')]({},_0x4f3a7f,_0xc593fa['options']);return db[_0xeb0b('0x2d')][_0xeb0b('0x49')](_0x4f3a7f)['then'](handleEntityNotFound(_0x2e2f78,null))['then'](respondWithResult(_0x2e2f78,null))['catch'](handleError(_0x2e2f78,null));};exports[_0xeb0b('0x4a')]=function(_0x5efe1c,_0x318ec7){return db[_0xeb0b('0x2d')][_0xeb0b('0x4a')](_0x5efe1c[_0xeb0b('0x4b')],{})[_0xeb0b('0x26')](respondWithResult(_0x318ec7,0xc9))[_0xeb0b('0x4c')](handleError(_0x318ec7,null));};exports['bulkCreate']=function(_0x1db534,_0x270e06){return db['AnalyticFieldReport'][_0xeb0b('0x4d')](_0x1db534[_0xeb0b('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x270e06,0xc9))[_0xeb0b('0x4c')](handleError(_0x270e06,null));};exports[_0xeb0b('0x25')]=function(_0x44b995,_0x53ba49){if(_0x44b995[_0xeb0b('0x4b')]['id']){delete _0x44b995[_0xeb0b('0x4b')]['id'];}return db[_0xeb0b('0x2d')][_0xeb0b('0x49')]({'where':{'id':_0x44b995[_0xeb0b('0x48')]['id']}})[_0xeb0b('0x26')](handleEntityNotFound(_0x53ba49,null))[_0xeb0b('0x26')](saveUpdates(_0x44b995[_0xeb0b('0x4b')],null))[_0xeb0b('0x26')](respondWithResult(_0x53ba49,null))[_0xeb0b('0x4c')](handleError(_0x53ba49,null));};exports[_0xeb0b('0x4e')]=function(_0x368475,_0x23d7e8){return db[_0xeb0b('0x2d')][_0xeb0b('0x49')]({'where':{'id':_0x368475[_0xeb0b('0x48')]['id']}})[_0xeb0b('0x26')](handleEntityNotFound(_0x23d7e8,null))[_0xeb0b('0x26')](removeEntity(_0x23d7e8,null))[_0xeb0b('0x4c')](handleError(_0x23d7e8,null));};exports[_0xeb0b('0x4f')]=function(_0x50006b,_0x59b6aa){return db[_0xeb0b('0x2d')]['destroy']({'where':{'id':_0x50006b[_0xeb0b('0x32')][_0xeb0b('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xeb0b('0x26')](respondWithResult(_0x59b6aa,0xcc))['catch'](handleError(_0x59b6aa,null));};exports[_0xeb0b('0x51')]=function(_0x200d8d,_0x34909c,_0x160076){return db[_0xeb0b('0x52')][_0xeb0b('0x53')]({'where':{'id':_0x200d8d[_0xeb0b('0x48')]['id']}})[_0xeb0b('0x26')](handleEntityNotFound(_0x34909c,null))[_0xeb0b('0x26')](function(_0xd55e62){if(_0xd55e62){return db['sequelize'][_0xeb0b('0x54')](function(_0x35582a){return db[_0xeb0b('0x2d')][_0xeb0b('0x4e')]({'where':{'CustomReportId':_0x200d8d[_0xeb0b('0x48')]['id']},'transaction':_0x35582a})[_0xeb0b('0x26')](function(_0xa10659){var _0x3ad6a7=_[_0xeb0b('0x2c')](_0x200d8d[_0xeb0b('0x4b')],function(_0xb5e40c){delete _0xb5e40c['id'];_0xb5e40c[_0xeb0b('0x55')]=_0x200d8d[_0xeb0b('0x48')]['id'];return _0xb5e40c;});return db[_0xeb0b('0x2d')]['bulkCreate'](_0x3ad6a7,{'transaction':_0x35582a});});})[_0xeb0b('0x26')](function(){return db[_0xeb0b('0x2d')][_0xeb0b('0x45')]({'where':{'CustomReportId':_0x200d8d[_0xeb0b('0x48')]['id']}});});}})['then'](respondWithResult(_0x34909c,null))[_0xeb0b('0x4c')](handleError(_0x34909c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 45602e4..015fa64 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 _0x6770=['analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x207db1,_0x19c38c){var _0x3744e1=function(_0x1cd678){while(--_0x1cd678){_0x207db1['push'](_0x207db1['shift']());}};_0x3744e1(++_0x19c38c);}(_0x6770,0x79));var _0x0677=function(_0x40e674,_0x2db263){_0x40e674=_0x40e674-0x0;var _0x4126fe=_0x6770[_0x40e674];return _0x4126fe;};'use strict';var _=require(_0x0677('0x0'));var util=require(_0x0677('0x1'));var logger=require(_0x0677('0x2'))(_0x0677('0x3'));var moment=require(_0x0677('0x4'));var BPromise=require('bluebird');var rp=require(_0x0677('0x5'));var fs=require('fs');var path=require(_0x0677('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0677('0x7'));module[_0x0677('0x8')]=function(_0x29f24e,_0x5c1025){return _0x29f24e[_0x0677('0x9')](_0x0677('0xa'),attributes,{'tableName':_0x0677('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad16=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x46f745,_0x496dfc){var _0x2ae22e=function(_0x505108){while(--_0x505108){_0x46f745['push'](_0x46f745['shift']());}};_0x2ae22e(++_0x496dfc);}(_0xad16,0xf6));var _0x6ad1=function(_0xb0ddc8,_0x372ff9){_0xb0ddc8=_0xb0ddc8-0x0;var _0x58b7f5=_0xad16[_0xb0ddc8];return _0x58b7f5;};'use strict';var _=require(_0x6ad1('0x0'));var util=require(_0x6ad1('0x1'));var logger=require(_0x6ad1('0x2'))(_0x6ad1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ad1('0x4'));var fs=require('fs');var path=require(_0x6ad1('0x5'));var rimraf=require(_0x6ad1('0x6'));var config=require(_0x6ad1('0x7'));var attributes=require(_0x6ad1('0x8'));module[_0x6ad1('0x9')]=function(_0x52c053,_0x5aeac9){return _0x52c053['define'](_0x6ad1('0xa'),attributes,{'tableName':_0x6ad1('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 2ae3ca6..d793fb8 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 _0x49eb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x2a9fb6,_0x2fd7da){var _0x22f071=function(_0x286488){while(--_0x286488){_0x2a9fb6['push'](_0x2a9fb6['shift']());}};_0x22f071(++_0x2fd7da);}(_0x49eb,0x110));var _0xb49e=function(_0x4d9480,_0x2f45ab){_0x4d9480=_0x4d9480-0x0;var _0x2d0eef=_0x49eb[_0x4d9480];return _0x2d0eef;};'use strict';var _=require(_0xb49e('0x0'));var util=require(_0xb49e('0x1'));var moment=require('moment');var BPromise=require(_0xb49e('0x2'));var rs=require(_0xb49e('0x3'));var fs=require('fs');var Redis=require(_0xb49e('0x4'));var db=require(_0xb49e('0x5'))['db'];var utils=require(_0xb49e('0x6'));var logger=require(_0xb49e('0x7'))('rpc');var config=require(_0xb49e('0x8'));var jayson=require(_0xb49e('0x9'));var client=jayson[_0xb49e('0xa')][_0xb49e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16a7d0,_0x51bdea,_0x50cd6c){return new BPromise(function(_0x2b143c,_0x1c20b0){return client[_0xb49e('0xc')](_0x16a7d0,_0x50cd6c)['then'](function(_0x1133c7){logger[_0xb49e('0xd')](_0xb49e('0xe'),_0x51bdea,_0xb49e('0xf'));logger[_0xb49e('0x10')](_0xb49e('0x11'),_0x51bdea,_0xb49e('0xf'),JSON[_0xb49e('0x12')](_0x1133c7));if(_0x1133c7[_0xb49e('0x13')]){if(_0x1133c7[_0xb49e('0x13')][_0xb49e('0x14')]===0x1f4){logger[_0xb49e('0x13')](_0xb49e('0xe'),_0x51bdea,_0x1133c7[_0xb49e('0x13')][_0xb49e('0x15')]);return _0x1c20b0(_0x1133c7[_0xb49e('0x13')][_0xb49e('0x15')]);}logger[_0xb49e('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x51bdea,_0x1133c7['error'][_0xb49e('0x15')]);return _0x2b143c(_0x1133c7['error'][_0xb49e('0x15')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x51bdea,_0xb49e('0xf'));_0x2b143c(_0x1133c7['result'][_0xb49e('0x15')]);}})[_0xb49e('0x16')](function(_0x26ea73){logger['error'](_0xb49e('0xe'),_0x51bdea,_0x26ea73);_0x1c20b0(_0x26ea73);});});}
\ No newline at end of file
+var _0x1d52=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4a9b68,_0x48e4f3){var _0x4beb40=function(_0x1a018a){while(--_0x1a018a){_0x4a9b68['push'](_0x4a9b68['shift']());}};_0x4beb40(++_0x48e4f3);}(_0x1d52,0x121));var _0x21d5=function(_0x490021,_0x34b606){_0x490021=_0x490021-0x0;var _0x12d809=_0x1d52[_0x490021];return _0x12d809;};'use strict';var _=require(_0x21d5('0x0'));var util=require(_0x21d5('0x1'));var moment=require(_0x21d5('0x2'));var BPromise=require(_0x21d5('0x3'));var rs=require(_0x21d5('0x4'));var fs=require('fs');var Redis=require(_0x21d5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x21d5('0x6'));var logger=require(_0x21d5('0x7'))(_0x21d5('0x8'));var config=require(_0x21d5('0x9'));var jayson=require(_0x21d5('0xa'));var client=jayson[_0x21d5('0xb')][_0x21d5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x90a26d,_0xe02af,_0x47da19){return new BPromise(function(_0x4de3db,_0x276a76){return client['request'](_0x90a26d,_0x47da19)[_0x21d5('0xd')](function(_0x2d97b7){logger['info'](_0x21d5('0xe'),_0xe02af,_0x21d5('0xf'));logger[_0x21d5('0x10')](_0x21d5('0x11'),_0xe02af,_0x21d5('0xf'),JSON[_0x21d5('0x12')](_0x2d97b7));if(_0x2d97b7[_0x21d5('0x13')]){if(_0x2d97b7[_0x21d5('0x13')][_0x21d5('0x14')]===0x1f4){logger[_0x21d5('0x13')](_0x21d5('0xe'),_0xe02af,_0x2d97b7['error']['message']);return _0x276a76(_0x2d97b7[_0x21d5('0x13')][_0x21d5('0x15')]);}logger[_0x21d5('0x13')](_0x21d5('0xe'),_0xe02af,_0x2d97b7[_0x21d5('0x13')][_0x21d5('0x15')]);return _0x4de3db(_0x2d97b7[_0x21d5('0x13')][_0x21d5('0x15')]);}else{logger[_0x21d5('0x16')](_0x21d5('0xe'),_0xe02af,_0x21d5('0xf'));_0x4de3db(_0x2d97b7[_0x21d5('0x17')][_0x21d5('0x15')]);}})['catch'](function(_0x510da0){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0xe02af,_0x510da0);_0x276a76(_0x510da0);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 3438b28..c81adf3 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(_0x354b97,_0x4e7682){var _0x5ee835=function(_0x2e0484){while(--_0x2e0484){_0x354b97['push'](_0x354b97['shift']());}};_0x5ee835(++_0x4e7682);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x7f971b,_0x32f797){var _0x16405f=function(_0x3cf8f1){while(--_0x3cf8f1){_0x7f971b['push'](_0x7f971b['shift']());}};_0x16405f(++_0x32f797);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 5f67386..3cb1ec1 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 _0x45c8=['STRING','name','TEXT','sequelize'];(function(_0x51e834,_0x16c70e){var _0x1f77b6=function(_0x14e429){while(--_0x14e429){_0x51e834['push'](_0x51e834['shift']());}};_0x1f77b6(++_0x16c70e);}(_0x45c8,0xef));var _0x845c=function(_0x1a9115,_0x301b4f){_0x1a9115=_0x1a9115-0x0;var _0x522a32=_0x45c8[_0x1a9115];return _0x522a32;};'use strict';var Sequelize=require(_0x845c('0x0'));module['exports']={'name':{'type':Sequelize[_0x845c('0x1')],'allowNull':![],'unique':_0x845c('0x2')},'table':{'type':Sequelize[_0x845c('0x1')]},'metric':{'type':Sequelize[_0x845c('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x980c=['TEXT','sequelize','exports','STRING','name'];(function(_0x41c7db,_0x2431a0){var _0x50b659=function(_0x317655){while(--_0x317655){_0x41c7db['push'](_0x41c7db['shift']());}};_0x50b659(++_0x2431a0);}(_0x980c,0x100));var _0xc980=function(_0x55c7e2,_0x353939){_0x55c7e2=_0x55c7e2-0x0;var _0x1c100b=_0x980c[_0x55c7e2];return _0x1c100b;};'use strict';var Sequelize=require(_0xc980('0x0'));module[_0xc980('0x1')]={'name':{'type':Sequelize[_0xc980('0x2')],'allowNull':![],'unique':_0xc980('0x3')},'table':{'type':Sequelize[_0xc980('0x2')]},'metric':{'type':Sequelize[_0xc980('0x4')]},'description':{'type':Sequelize[_0xc980('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 110088a..ab6a412 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 _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x124049,_0xb888a8){var _0x464b44=function(_0x10d80c){while(--_0x10d80c){_0x124049['push'](_0x124049['shift']());}};_0x464b44(++_0xb888a8);}(_0x7217,0x19e));var _0x7721=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x7217[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));};
\ No newline at end of file
+var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x536866,_0x54e594){var _0x3f8cee=function(_0x116c1e){while(--_0x116c1e){_0x536866['push'](_0x536866['shift']());}};_0x3f8cee(++_0x54e594);}(_0x6aa7,0x178));var _0x76aa=function(_0x55e99c,_0x260b75){_0x55e99c=_0x55e99c-0x0;var _0x3c1827=_0x6aa7[_0x55e99c];return _0x3c1827;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 14f2bc5..1162c49 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 _0xc9c3=['path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','../../config/logger','moment','bluebird','request-promise'];(function(_0x1ee0a1,_0x51058e){var _0x1d2d5b=function(_0x35cfb5){while(--_0x35cfb5){_0x1ee0a1['push'](_0x1ee0a1['shift']());}};_0x1d2d5b(++_0x51058e);}(_0xc9c3,0x96));var _0x3c9c=function(_0x35173a,_0x7ab79b){_0x35173a=_0x35173a-0x0;var _0x4cac41=_0xc9c3[_0x35173a];return _0x4cac41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3c9c('0x0'))('api');var moment=require(_0x3c9c('0x1'));var BPromise=require(_0x3c9c('0x2'));var rp=require(_0x3c9c('0x3'));var fs=require('fs');var path=require(_0x3c9c('0x4'));var rimraf=require(_0x3c9c('0x5'));var config=require(_0x3c9c('0x6'));var attributes=require(_0x3c9c('0x7'));module['exports']=function(_0x48b219,_0x5c86bd){return _0x48b219[_0x3c9c('0x8')](_0x3c9c('0x9'),attributes,{'tableName':_0x3c9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x30e0fc,_0x29914d){var _0x5ee926=function(_0x3452c3){while(--_0x3452c3){_0x30e0fc['push'](_0x30e0fc['shift']());}};_0x5ee926(++_0x29914d);}(_0x814b,0x1a2));var _0xb814=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x814b[_0x4907de];return _0x482054;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'analytics_metrics','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 9ad5fbd..1cfe9f6 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 _0xec16=['AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','debug'];(function(_0x243101,_0x2bda19){var _0x33570b=function(_0x3bfef3){while(--_0x3bfef3){_0x243101['push'](_0x243101['shift']());}};_0x33570b(++_0x2bda19);}(_0xec16,0x82));var _0x6ec1=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0xec16[_0x3ee55a];return _0x581800;};'use strict';var _=require(_0x6ec1('0x0'));var util=require(_0x6ec1('0x1'));var moment=require(_0x6ec1('0x2'));var BPromise=require(_0x6ec1('0x3'));var rs=require(_0x6ec1('0x4'));var fs=require('fs');var Redis=require(_0x6ec1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ec1('0x6'));var logger=require(_0x6ec1('0x7'))(_0x6ec1('0x8'));var config=require('../../config/environment');var jayson=require(_0x6ec1('0x9'));var client=jayson[_0x6ec1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcd474c,_0x54e5d7,_0x230d78){return new BPromise(function(_0x18c3cb,_0x20240c){return client[_0x6ec1('0xb')](_0xcd474c,_0x230d78)[_0x6ec1('0xc')](function(_0x439e99){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x54e5d7,'request\x20sent');logger[_0x6ec1('0xd')](_0x6ec1('0xe'),_0x54e5d7,_0x6ec1('0xf'),JSON[_0x6ec1('0x10')](_0x439e99));if(_0x439e99['error']){if(_0x439e99['error'][_0x6ec1('0x11')]===0x1f4){logger[_0x6ec1('0x12')](_0x6ec1('0x13'),_0x54e5d7,_0x439e99[_0x6ec1('0x12')][_0x6ec1('0x14')]);return _0x20240c(_0x439e99[_0x6ec1('0x12')][_0x6ec1('0x14')]);}logger[_0x6ec1('0x12')](_0x6ec1('0x13'),_0x54e5d7,_0x439e99[_0x6ec1('0x12')]['message']);return _0x18c3cb(_0x439e99[_0x6ec1('0x12')][_0x6ec1('0x14')]);}else{logger[_0x6ec1('0x15')](_0x6ec1('0x13'),_0x54e5d7,'request\x20sent');_0x18c3cb(_0x439e99[_0x6ec1('0x16')]['message']);}})[_0x6ec1('0x17')](function(_0x4bb886){logger[_0x6ec1('0x12')](_0x6ec1('0x13'),_0x54e5d7,_0x4bb886);_0x20240c(_0x4bb886);});});}
\ No newline at end of file
+var _0x07a3=['then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x19de42,_0x5326be){var _0x1fb492=function(_0x3714b6){while(--_0x3714b6){_0x19de42['push'](_0x19de42['shift']());}};_0x1fb492(++_0x5326be);}(_0x07a3,0xac));var _0x307a=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x07a3[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x307a('0x0'));var util=require(_0x307a('0x1'));var moment=require(_0x307a('0x2'));var BPromise=require(_0x307a('0x3'));var rs=require(_0x307a('0x4'));var fs=require('fs');var Redis=require(_0x307a('0x5'));var db=require(_0x307a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x307a('0x7'));var config=require(_0x307a('0x8'));var jayson=require(_0x307a('0x9'));var client=jayson['client'][_0x307a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x362883,_0x4f7631,_0x4aa13a){return new BPromise(function(_0x4a8fec,_0x25dd03){return client[_0x307a('0xb')](_0x362883,_0x4aa13a)[_0x307a('0xc')](function(_0x27c1af){logger[_0x307a('0xd')](_0x307a('0xe'),_0x4f7631,'request\x20sent');logger[_0x307a('0xf')](_0x307a('0x10'),_0x4f7631,_0x307a('0x11'),JSON[_0x307a('0x12')](_0x27c1af));if(_0x27c1af['error']){if(_0x27c1af[_0x307a('0x13')][_0x307a('0x14')]===0x1f4){logger[_0x307a('0x13')](_0x307a('0xe'),_0x4f7631,_0x27c1af[_0x307a('0x13')]['message']);return _0x25dd03(_0x27c1af['error'][_0x307a('0x15')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4f7631,_0x27c1af[_0x307a('0x13')]['message']);return _0x4a8fec(_0x27c1af[_0x307a('0x13')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x4f7631,'request\x20sent');_0x4a8fec(_0x27c1af[_0x307a('0x16')][_0x307a('0x15')]);}})['catch'](function(_0x48f9c5){logger['error'](_0x307a('0xe'),_0x4f7631,_0x48f9c5);_0x25dd03(_0x48f9c5);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index cc4d965..de88492 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 _0x6f47=['show','post','isAuthenticated','create','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id'];(function(_0x3ffdbd,_0x49de53){var _0xd3438d=function(_0x3c5382){while(--_0x3c5382){_0x3ffdbd['push'](_0x3ffdbd['shift']());}};_0xd3438d(++_0x49de53);}(_0x6f47,0xc7));var _0x76f4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6f47[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x76f4('0x8')]);router[_0x76f4('0x7')](_0x76f4('0x9'),auth['isAuthenticated'](),controller[_0x76f4('0xa')]);router[_0x76f4('0xb')]('/',auth[_0x76f4('0xc')](),controller[_0x76f4('0xd')]);router[_0x76f4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x76f4('0xf')]);router[_0x76f4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x76f4('0x11')]);module[_0x76f4('0x12')]=router;
\ No newline at end of file
+var _0xae24=['../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','path','express','Router'];(function(_0x440e18,_0xec5859){var _0x184847=function(_0x30ab69){while(--_0x30ab69){_0x440e18['push'](_0x440e18['shift']());}};_0x184847(++_0xec5859);}(_0xae24,0x182));var _0x4ae2=function(_0x523c05,_0x53156c){_0x523c05=_0x523c05-0x0;var _0x44e346=_0xae24[_0x523c05];return _0x44e346;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')]('/',auth[_0x4ae2('0x7')](),controller[_0x4ae2('0x8')]);router[_0x4ae2('0x6')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4ae2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ae2('0xb')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')](_0x4ae2('0x9'),auth[_0x4ae2('0x7')](),controller['destroy']);module[_0x4ae2('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 727de1e..ab2310e 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 _0x98b7=['sequelize'];(function(_0x84ce83,_0x98461d){var _0x4490be=function(_0x3a9a69){while(--_0x3a9a69){_0x84ce83['push'](_0x84ce83['shift']());}};_0x4490be(++_0x98461d);}(_0x98b7,0xcf));var _0x798b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x98b7[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x798b('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xac75=['sequelize','exports','TEXT'];(function(_0x4bf128,_0x17ba15){var _0x2c21e8=function(_0x1f62ad){while(--_0x1f62ad){_0x4bf128['push'](_0x4bf128['shift']());}};_0x2c21e8(++_0x17ba15);}(_0xac75,0x1b3));var _0x5ac7=function(_0xa2e6f3,_0x1e5734){_0xa2e6f3=_0xa2e6f3-0x0;var _0x4d21cc=_0xac75[_0xa2e6f3];return _0x4d21cc;};'use strict';var Sequelize=require(_0x5ac7('0x0'));module[_0x5ac7('0x1')]={'tree':{'type':Sequelize[_0x5ac7('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 607c9f5..116aac8 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 _0x0f6f=['then','destroy','error','stack','name','send','AnalyticTreeReport','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update'];(function(_0xa71e17,_0x2a6227){var _0x36c2e5=function(_0xedf8f5){while(--_0xedf8f5){_0xa71e17['push'](_0xa71e17['shift']());}};_0x36c2e5(++_0x2a6227);}(_0x0f6f,0x146));var _0xf0f6=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x0f6f[_0x1e2080];return _0x260111;};'use strict';var emlformat=require(_0xf0f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0f6('0x1'));var jsonpatch=require(_0xf0f6('0x2'));var rp=require('request-promise');var moment=require(_0xf0f6('0x3'));var BPromise=require(_0xf0f6('0x4'));var Mustache=require(_0xf0f6('0x5'));var util=require('util');var path=require(_0xf0f6('0x6'));var sox=require(_0xf0f6('0x7'));var csv=require(_0xf0f6('0x8'));var ejs=require(_0xf0f6('0x9'));var fs=require('fs');var fs_extra=require(_0xf0f6('0xa'));var _=require('lodash');var squel=require(_0xf0f6('0xb'));var crypto=require(_0xf0f6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf0f6('0xd'));var toCsv=require(_0xf0f6('0x8'));var querystring=require(_0xf0f6('0xe'));var Papa=require(_0xf0f6('0xf'));var Redis=require(_0xf0f6('0x10'));var authService=require(_0xf0f6('0x11'));var qs=require(_0xf0f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0f6('0x13'));var logger=require(_0xf0f6('0x14'))(_0xf0f6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cfee9,_0x2ae21d){_0x2ae21d=_0x2ae21d||0xcc;return function(_0x556137){if(_0x556137){return _0x4cfee9[_0xf0f6('0x16')](_0x2ae21d);}return _0x4cfee9[_0xf0f6('0x17')](_0x2ae21d)[_0xf0f6('0x18')]();};}function respondWithResult(_0x5c6061,_0x26f307){_0x26f307=_0x26f307||0xc8;return function(_0x2839ec){if(_0x2839ec){return _0x5c6061[_0xf0f6('0x17')](_0x26f307)[_0xf0f6('0x19')](_0x2839ec);}};}function respondWithFilteredResult(_0x3ac418,_0x29026b){return function(_0x272ed7){if(_0x272ed7){var _0x3f9e90=typeof _0x29026b[_0xf0f6('0x1a')]===_0xf0f6('0x1b')&&typeof _0x29026b[_0xf0f6('0x1c')]===_0xf0f6('0x1b');var _0x1fee45=_0x272ed7['count'];var _0x114afc=_0x3f9e90?0x0:_0x29026b['offset'];var _0x328e29=_0x3f9e90?_0x272ed7[_0xf0f6('0x1d')]:_0x29026b[_0xf0f6('0x1a')]+_0x29026b['limit'];var _0x5ee164;if(_0x328e29>=_0x1fee45){_0x328e29=_0x1fee45;_0x5ee164=0xc8;}else{_0x5ee164=0xce;}_0x3ac418[_0xf0f6('0x17')](_0x5ee164);return _0x3ac418[_0xf0f6('0x1e')](_0xf0f6('0x1f'),_0x114afc+'-'+_0x328e29+'/'+_0x1fee45)[_0xf0f6('0x19')](_0x272ed7);}return null;};}function patchUpdates(_0x575f65){return function(_0x3f137b){try{jsonpatch['apply'](_0x3f137b,_0x575f65,!![]);}catch(_0x52284d){return BPromise['reject'](_0x52284d);}return _0x3f137b[_0xf0f6('0x20')]();};}function saveUpdates(_0x40e460,_0x547a84){return function(_0x16d55b){if(_0x16d55b){return _0x16d55b[_0xf0f6('0x21')](_0x40e460)[_0xf0f6('0x22')](function(_0x210f3d){return _0x210f3d;});}return null;};}function removeEntity(_0xd339d7,_0x27bf58){return function(_0x4e9099){if(_0x4e9099){return _0x4e9099[_0xf0f6('0x23')]()[_0xf0f6('0x22')](function(){_0xd339d7[_0xf0f6('0x17')](0xcc)[_0xf0f6('0x18')]();});}};}function handleEntityNotFound(_0x585ee6,_0x247ff8){return function(_0xac8bfe){if(!_0xac8bfe){_0x585ee6[_0xf0f6('0x16')](0x194);}return _0xac8bfe;};}function handleError(_0x1974f4,_0x142daf){_0x142daf=_0x142daf||0x1f4;return function(_0x4ca0f9){logger[_0xf0f6('0x24')](_0x4ca0f9[_0xf0f6('0x25')]);if(_0x4ca0f9[_0xf0f6('0x26')]){delete _0x4ca0f9['name'];}_0x1974f4[_0xf0f6('0x17')](_0x142daf)[_0xf0f6('0x27')](_0x4ca0f9);};}exports['index']=function(_0x323f11,_0x577705){var _0x4554cd={},_0x3b8c47={},_0x4c9d43={'count':0x0,'rows':[]};var _0x23f745=_['map'](db[_0xf0f6('0x28')][_0xf0f6('0x29')],function(_0x28e8b0){return{'name':_0x28e8b0[_0xf0f6('0x2a')],'type':_0x28e8b0[_0xf0f6('0x2b')]['key']};});_0x3b8c47[_0xf0f6('0x2c')]=_['map'](_0x23f745,_0xf0f6('0x26'));_0x3b8c47['query']=_[_0xf0f6('0x2d')](_0x323f11[_0xf0f6('0x2e')]);_0x3b8c47[_0xf0f6('0x2f')]=_['intersection'](_0x3b8c47[_0xf0f6('0x2c')],_0x3b8c47[_0xf0f6('0x2e')]);_0x4554cd[_0xf0f6('0x30')]=_[_0xf0f6('0x31')](_0x3b8c47[_0xf0f6('0x2c')],qs['fields'](_0x323f11['query'][_0xf0f6('0x32')]));_0x4554cd[_0xf0f6('0x30')]=_0x4554cd['attributes'][_0xf0f6('0x33')]?_0x4554cd['attributes']:_0x3b8c47[_0xf0f6('0x2c')];if(!_0x323f11['query'][_0xf0f6('0x34')](_0xf0f6('0x35'))){_0x4554cd[_0xf0f6('0x1c')]=qs[_0xf0f6('0x1c')](_0x323f11[_0xf0f6('0x2e')][_0xf0f6('0x1c')]);_0x4554cd['offset']=qs[_0xf0f6('0x1a')](_0x323f11[_0xf0f6('0x2e')][_0xf0f6('0x1a')]);}_0x4554cd[_0xf0f6('0x36')]=qs['sort'](_0x323f11[_0xf0f6('0x2e')][_0xf0f6('0x37')]);_0x4554cd[_0xf0f6('0x38')]=qs[_0xf0f6('0x2f')](_[_0xf0f6('0x39')](_0x323f11[_0xf0f6('0x2e')],_0x3b8c47[_0xf0f6('0x2f')]),_0x23f745);if(_0x323f11[_0xf0f6('0x2e')][_0xf0f6('0x3a')]){_0x4554cd['where']=_[_0xf0f6('0x3b')](_0x4554cd[_0xf0f6('0x38')],{'$or':_[_0xf0f6('0x3c')](_0x23f745,function(_0x5ec868){if(_0x5ec868[_0xf0f6('0x2b')]!==_0xf0f6('0x3d')){var _0x1d582f={};_0x1d582f[_0x5ec868[_0xf0f6('0x26')]]={'$like':'%'+_0x323f11[_0xf0f6('0x2e')][_0xf0f6('0x3a')]+'%'};return _0x1d582f;}})});}_0x4554cd=_[_0xf0f6('0x3b')]({},_0x4554cd,_0x323f11[_0xf0f6('0x3e')]);var _0x21af95={'where':_0x4554cd['where']};return db[_0xf0f6('0x28')][_0xf0f6('0x1d')](_0x21af95)['then'](function(_0x28535e){_0x4c9d43[_0xf0f6('0x1d')]=_0x28535e;if(_0x323f11[_0xf0f6('0x2e')]['includeAll']){_0x4554cd[_0xf0f6('0x3f')]=[{'all':!![]}];}return db[_0xf0f6('0x28')][_0xf0f6('0x40')](_0x4554cd);})['then'](function(_0x448757){_0x4c9d43['rows']=_0x448757;return _0x4c9d43;})[_0xf0f6('0x22')](respondWithFilteredResult(_0x577705,_0x4554cd))[_0xf0f6('0x41')](handleError(_0x577705,null));};exports[_0xf0f6('0x42')]=function(_0xfbbbfb,_0xdd8256){var _0x4f10f9={'raw':!![],'where':{'id':_0xfbbbfb['params']['id']}},_0x94fa31={};_0x94fa31[_0xf0f6('0x2c')]=_[_0xf0f6('0x2d')](db[_0xf0f6('0x28')]['rawAttributes']);_0x94fa31[_0xf0f6('0x2e')]=_[_0xf0f6('0x2d')](_0xfbbbfb['query']);_0x94fa31[_0xf0f6('0x2f')]=_['intersection'](_0x94fa31[_0xf0f6('0x2c')],_0x94fa31[_0xf0f6('0x2e')]);_0x4f10f9[_0xf0f6('0x30')]=_['intersection'](_0x94fa31[_0xf0f6('0x2c')],qs['fields'](_0xfbbbfb[_0xf0f6('0x2e')]['fields']));_0x4f10f9['attributes']=_0x4f10f9['attributes'][_0xf0f6('0x33')]?_0x4f10f9[_0xf0f6('0x30')]:_0x94fa31[_0xf0f6('0x2c')];if(_0xfbbbfb[_0xf0f6('0x2e')][_0xf0f6('0x43')]){_0x4f10f9[_0xf0f6('0x3f')]=[{'all':!![]}];}_0x4f10f9=_['merge']({},_0x4f10f9,_0xfbbbfb[_0xf0f6('0x3e')]);return db[_0xf0f6('0x28')][_0xf0f6('0x44')](_0x4f10f9)[_0xf0f6('0x22')](handleEntityNotFound(_0xdd8256,null))[_0xf0f6('0x22')](respondWithResult(_0xdd8256,null))[_0xf0f6('0x41')](handleError(_0xdd8256,null));};exports[_0xf0f6('0x45')]=function(_0x20c60b,_0x50a525){return db[_0xf0f6('0x28')][_0xf0f6('0x45')](_0x20c60b[_0xf0f6('0x46')],{})[_0xf0f6('0x22')](respondWithResult(_0x50a525,0xc9))[_0xf0f6('0x41')](handleError(_0x50a525,null));};exports[_0xf0f6('0x21')]=function(_0x352733,_0x46fbdd){if(_0x352733[_0xf0f6('0x46')]['id']){delete _0x352733['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x352733[_0xf0f6('0x47')]['id']}})[_0xf0f6('0x22')](handleEntityNotFound(_0x46fbdd,null))[_0xf0f6('0x22')](saveUpdates(_0x352733[_0xf0f6('0x46')],null))['then'](respondWithResult(_0x46fbdd,null))[_0xf0f6('0x41')](handleError(_0x46fbdd,null));};exports[_0xf0f6('0x23')]=function(_0xe62319,_0x808352){return db['AnalyticTreeReport'][_0xf0f6('0x44')]({'where':{'id':_0xe62319['params']['id']}})[_0xf0f6('0x22')](handleEntityNotFound(_0x808352,null))[_0xf0f6('0x22')](removeEntity(_0x808352,null))[_0xf0f6('0x41')](handleError(_0x808352,null));};
\ No newline at end of file
+var _0x05df=['then','destroy','end','error','stack','name','send','map','AnalyticTreeReport','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x391ec5,_0x574eea){var _0x327de5=function(_0x385dcb){while(--_0x385dcb){_0x391ec5['push'](_0x391ec5['shift']());}};_0x327de5(++_0x574eea);}(_0x05df,0x72));var _0xf05d=function(_0x48bebf,_0x3287ab){_0x48bebf=_0x48bebf-0x0;var _0x747e8c=_0x05df[_0x48bebf];return _0x747e8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf05d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf05d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf05d('0x2'));var util=require(_0xf05d('0x3'));var path=require(_0xf05d('0x4'));var sox=require('sox');var csv=require(_0xf05d('0x5'));var ejs=require(_0xf05d('0x6'));var fs=require('fs');var fs_extra=require(_0xf05d('0x7'));var _=require(_0xf05d('0x8'));var squel=require(_0xf05d('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf05d('0xa'));var toCsv=require(_0xf05d('0x5'));var querystring=require(_0xf05d('0xb'));var Papa=require(_0xf05d('0xc'));var Redis=require(_0xf05d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xf05d('0xe'));var as=require(_0xf05d('0xf'));var hardwareService=require(_0xf05d('0x10'));var logger=require(_0xf05d('0x11'))('api');var utils=require(_0xf05d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf05d('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4056a9,_0x84ee27){_0x84ee27=_0x84ee27||0xcc;return function(_0x3c65cb){if(_0x3c65cb){return _0x4056a9[_0xf05d('0x14')](_0x84ee27);}return _0x4056a9['status'](_0x84ee27)['end']();};}function respondWithResult(_0xde3fd5,_0x18a61b){_0x18a61b=_0x18a61b||0xc8;return function(_0x17bf2e){if(_0x17bf2e){return _0xde3fd5[_0xf05d('0x15')](_0x18a61b)[_0xf05d('0x16')](_0x17bf2e);}};}function respondWithFilteredResult(_0x533afe,_0x5da83f){return function(_0xe58bb0){if(_0xe58bb0){var _0x4a8693=typeof _0x5da83f[_0xf05d('0x17')]===_0xf05d('0x18')&&typeof _0x5da83f[_0xf05d('0x19')]===_0xf05d('0x18');var _0x23d9e6=_0xe58bb0[_0xf05d('0x1a')];var _0x5da832=_0x4a8693?0x0:_0x5da83f[_0xf05d('0x17')];var _0x4f3e4c=_0x4a8693?_0xe58bb0['count']:_0x5da83f[_0xf05d('0x17')]+_0x5da83f[_0xf05d('0x19')];var _0xd8a4cf;if(_0x4f3e4c>=_0x23d9e6){_0x4f3e4c=_0x23d9e6;_0xd8a4cf=0xc8;}else{_0xd8a4cf=0xce;}_0x533afe['status'](_0xd8a4cf);return _0x533afe[_0xf05d('0x1b')](_0xf05d('0x1c'),_0x5da832+'-'+_0x4f3e4c+'/'+_0x23d9e6)[_0xf05d('0x16')](_0xe58bb0);}return null;};}function patchUpdates(_0x43be25){return function(_0x30588a){try{jsonpatch[_0xf05d('0x1d')](_0x30588a,_0x43be25,!![]);}catch(_0x166533){return BPromise[_0xf05d('0x1e')](_0x166533);}return _0x30588a['save']();};}function saveUpdates(_0xbbc9c9,_0x107a05){return function(_0x5de137){if(_0x5de137){return _0x5de137[_0xf05d('0x1f')](_0xbbc9c9)[_0xf05d('0x20')](function(_0x330184){return _0x330184;});}return null;};}function removeEntity(_0x41dda2,_0x4c19a8){return function(_0x516d29){if(_0x516d29){return _0x516d29[_0xf05d('0x21')]()[_0xf05d('0x20')](function(){_0x41dda2[_0xf05d('0x15')](0xcc)[_0xf05d('0x22')]();});}};}function handleEntityNotFound(_0x174dc9,_0x459ce8){return function(_0x151292){if(!_0x151292){_0x174dc9[_0xf05d('0x14')](0x194);}return _0x151292;};}function handleError(_0x4a7608,_0x1c762b){_0x1c762b=_0x1c762b||0x1f4;return function(_0x2c7b97){logger[_0xf05d('0x23')](_0x2c7b97[_0xf05d('0x24')]);if(_0x2c7b97[_0xf05d('0x25')]){delete _0x2c7b97[_0xf05d('0x25')];}_0x4a7608['status'](_0x1c762b)[_0xf05d('0x26')](_0x2c7b97);};}exports['index']=function(_0x5b6813,_0x2297a6){var _0x3aa60b={},_0x6c6277={},_0xa48c91={'count':0x0,'rows':[]};var _0x20d23a=_[_0xf05d('0x27')](db[_0xf05d('0x28')]['rawAttributes'],function(_0x1a597a){return{'name':_0x1a597a[_0xf05d('0x29')],'type':_0x1a597a[_0xf05d('0x2a')][_0xf05d('0x2b')]};});_0x6c6277['model']=_['map'](_0x20d23a,_0xf05d('0x25'));_0x6c6277[_0xf05d('0x2c')]=_['keys'](_0x5b6813[_0xf05d('0x2c')]);_0x6c6277[_0xf05d('0x2d')]=_['intersection'](_0x6c6277[_0xf05d('0x2e')],_0x6c6277['query']);_0x3aa60b[_0xf05d('0x2f')]=_[_0xf05d('0x30')](_0x6c6277[_0xf05d('0x2e')],qs[_0xf05d('0x31')](_0x5b6813[_0xf05d('0x2c')][_0xf05d('0x31')]));_0x3aa60b[_0xf05d('0x2f')]=_0x3aa60b['attributes'][_0xf05d('0x32')]?_0x3aa60b[_0xf05d('0x2f')]:_0x6c6277['model'];if(!_0x5b6813[_0xf05d('0x2c')][_0xf05d('0x33')](_0xf05d('0x34'))){_0x3aa60b[_0xf05d('0x19')]=qs[_0xf05d('0x19')](_0x5b6813[_0xf05d('0x2c')][_0xf05d('0x19')]);_0x3aa60b['offset']=qs['offset'](_0x5b6813[_0xf05d('0x2c')]['offset']);}_0x3aa60b[_0xf05d('0x35')]=qs[_0xf05d('0x36')](_0x5b6813[_0xf05d('0x2c')][_0xf05d('0x36')]);_0x3aa60b[_0xf05d('0x37')]=qs[_0xf05d('0x2d')](_[_0xf05d('0x38')](_0x5b6813[_0xf05d('0x2c')],_0x6c6277[_0xf05d('0x2d')]),_0x20d23a);if(_0x5b6813['query'][_0xf05d('0x39')]){_0x3aa60b['where']=_[_0xf05d('0x3a')](_0x3aa60b[_0xf05d('0x37')],{'$or':_['map'](_0x20d23a,function(_0xfc011){if(_0xfc011['type']!==_0xf05d('0x3b')){var _0x301fa5={};_0x301fa5[_0xfc011[_0xf05d('0x25')]]={'$like':'%'+_0x5b6813[_0xf05d('0x2c')][_0xf05d('0x39')]+'%'};return _0x301fa5;}})});}_0x3aa60b=_['merge']({},_0x3aa60b,_0x5b6813[_0xf05d('0x3c')]);var _0x612834={'where':_0x3aa60b['where']};return db['AnalyticTreeReport'][_0xf05d('0x1a')](_0x612834)[_0xf05d('0x20')](function(_0xce1562){_0xa48c91[_0xf05d('0x1a')]=_0xce1562;if(_0x5b6813[_0xf05d('0x2c')][_0xf05d('0x3d')]){_0x3aa60b[_0xf05d('0x3e')]=[{'all':!![]}];}return db[_0xf05d('0x28')][_0xf05d('0x3f')](_0x3aa60b);})['then'](function(_0x370ebf){_0xa48c91[_0xf05d('0x40')]=_0x370ebf;return _0xa48c91;})['then'](respondWithFilteredResult(_0x2297a6,_0x3aa60b))[_0xf05d('0x41')](handleError(_0x2297a6,null));};exports[_0xf05d('0x42')]=function(_0x4b2b6b,_0x58ac35){var _0x22de78={'raw':!![],'where':{'id':_0x4b2b6b[_0xf05d('0x43')]['id']}},_0x58f582={};_0x58f582['model']=_[_0xf05d('0x44')](db[_0xf05d('0x28')][_0xf05d('0x45')]);_0x58f582[_0xf05d('0x2c')]=_[_0xf05d('0x44')](_0x4b2b6b[_0xf05d('0x2c')]);_0x58f582[_0xf05d('0x2d')]=_[_0xf05d('0x30')](_0x58f582['model'],_0x58f582['query']);_0x22de78['attributes']=_[_0xf05d('0x30')](_0x58f582[_0xf05d('0x2e')],qs[_0xf05d('0x31')](_0x4b2b6b[_0xf05d('0x2c')][_0xf05d('0x31')]));_0x22de78['attributes']=_0x22de78[_0xf05d('0x2f')][_0xf05d('0x32')]?_0x22de78[_0xf05d('0x2f')]:_0x58f582[_0xf05d('0x2e')];if(_0x4b2b6b['query'][_0xf05d('0x3d')]){_0x22de78[_0xf05d('0x3e')]=[{'all':!![]}];}_0x22de78=_[_0xf05d('0x3a')]({},_0x22de78,_0x4b2b6b[_0xf05d('0x3c')]);return db[_0xf05d('0x28')][_0xf05d('0x46')](_0x22de78)[_0xf05d('0x20')](handleEntityNotFound(_0x58ac35,null))['then'](respondWithResult(_0x58ac35,null))[_0xf05d('0x41')](handleError(_0x58ac35,null));};exports[_0xf05d('0x47')]=function(_0xf5a80b,_0x863161){return db[_0xf05d('0x28')]['create'](_0xf5a80b[_0xf05d('0x48')],{})[_0xf05d('0x20')](respondWithResult(_0x863161,0xc9))[_0xf05d('0x41')](handleError(_0x863161,null));};exports['update']=function(_0x593916,_0x20835f){if(_0x593916[_0xf05d('0x48')]['id']){delete _0x593916[_0xf05d('0x48')]['id'];}return db[_0xf05d('0x28')][_0xf05d('0x46')]({'where':{'id':_0x593916['params']['id']}})[_0xf05d('0x20')](handleEntityNotFound(_0x20835f,null))[_0xf05d('0x20')](saveUpdates(_0x593916['body'],null))[_0xf05d('0x20')](respondWithResult(_0x20835f,null))['catch'](handleError(_0x20835f,null));};exports[_0xf05d('0x21')]=function(_0x40a50a,_0xc7bbe8){return db[_0xf05d('0x28')][_0xf05d('0x46')]({'where':{'id':_0x40a50a[_0xf05d('0x43')]['id']}})[_0xf05d('0x20')](handleEntityNotFound(_0xc7bbe8,null))[_0xf05d('0x20')](removeEntity(_0xc7bbe8,null))[_0xf05d('0x41')](handleError(_0xc7bbe8,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 267b868..ce23968 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 _0x0213=['request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','api','moment','bluebird'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0213,0x17b));var _0x3021=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0x0213[_0xfd9b19];return _0x514918;};'use strict';var _=require(_0x3021('0x0'));var util=require(_0x3021('0x1'));var logger=require('../../config/logger')(_0x3021('0x2'));var moment=require(_0x3021('0x3'));var BPromise=require(_0x3021('0x4'));var rp=require(_0x3021('0x5'));var fs=require('fs');var path=require(_0x3021('0x6'));var rimraf=require(_0x3021('0x7'));var config=require('../../config/environment');var attributes=require(_0x3021('0x8'));module[_0x3021('0x9')]=function(_0x1693b9,_0x59ef4c){return _0x1693b9[_0x3021('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x3021('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9778=['bluebird','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','../../config/logger'];(function(_0xb251f1,_0x51cc0e){var _0x17cb3f=function(_0x4f03e1){while(--_0x4f03e1){_0xb251f1['push'](_0xb251f1['shift']());}};_0x17cb3f(++_0x51cc0e);}(_0x9778,0xcd));var _0x8977=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0x9778[_0x44039a];return _0x525de5;};'use strict';var _=require(_0x8977('0x0'));var util=require('util');var logger=require(_0x8977('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8977('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8977('0x3'));var config=require(_0x8977('0x4'));var attributes=require(_0x8977('0x5'));module[_0x8977('0x6')]=function(_0x559ac6,_0x41882b){return _0x559ac6[_0x8977('0x7')](_0x8977('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 2ed4557..b5cd0b5 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 _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(_0x13cf69,_0x767b51){var _0x3dd617=function(_0x225252){while(--_0x225252){_0x13cf69['push'](_0x13cf69['shift']());}};_0x3dd617(++_0x767b51);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'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
+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(_0x5617dd,_0x15ad4f){var _0x92c09f=function(_0x24e678){while(--_0x24e678){_0x5617dd['push'](_0x5617dd['shift']());}};_0x92c09f(++_0x15ad4f);}(_0x1261,0x144));var _0x1126=function(_0x26df48,_0x22aa50){_0x26df48=_0x26df48-0x0;var _0x209047=_0x1261[_0x26df48];return _0x209047;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 3957043..6946dcf 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 _0xe6b0=['/:id','show','post','put','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x426783,_0x1e8068){var _0x1be40e=function(_0x3edbd5){while(--_0x3edbd5){_0x426783['push'](_0x426783['shift']());}};_0x1be40e(++_0x1e8068);}(_0xe6b0,0x180));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0e6b('0x0'));var util=require(_0x0e6b('0x1'));var path=require(_0x0e6b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e6b('0x3')]();var fs_extra=require(_0x0e6b('0x4'));var auth=require(_0x0e6b('0x5'));var interaction=require(_0x0e6b('0x6'));var config=require(_0x0e6b('0x7'));var controller=require(_0x0e6b('0x8'));router[_0x0e6b('0x9')]('/',auth[_0x0e6b('0xa')](),controller[_0x0e6b('0xb')]);router[_0x0e6b('0x9')](_0x0e6b('0xc'),auth[_0x0e6b('0xa')](),controller[_0x0e6b('0xd')]);router[_0x0e6b('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0e6b('0xf')](_0x0e6b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x0e6b('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0e6b('0x11')]=router;
\ No newline at end of file
+var _0xec61=['./analyticTreeReport.controller','isAuthenticated','index','get','/:id','post','create','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x47d21a,_0x2ccfa2){var _0x1de45e=function(_0x5667e1){while(--_0x5667e1){_0x47d21a['push'](_0x47d21a['shift']());}};_0x1de45e(++_0x2ccfa2);}(_0xec61,0x1d6));var _0x1ec6=function(_0x2710f9,_0x590ca1){_0x2710f9=_0x2710f9-0x0;var _0x51d93b=_0xec61[_0x2710f9];return _0x51d93b;};'use strict';var multer=require(_0x1ec6('0x0'));var util=require('util');var path=require(_0x1ec6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ec6('0x2')]();var fs_extra=require(_0x1ec6('0x3'));var auth=require(_0x1ec6('0x4'));var interaction=require(_0x1ec6('0x5'));var config=require('../../config/environment');var controller=require(_0x1ec6('0x6'));router['get']('/',auth[_0x1ec6('0x7')](),controller[_0x1ec6('0x8')]);router[_0x1ec6('0x9')](_0x1ec6('0xa'),auth[_0x1ec6('0x7')](),controller['show']);router[_0x1ec6('0xb')]('/',auth[_0x1ec6('0x7')](),controller[_0x1ec6('0xc')]);router['put'](_0x1ec6('0xa'),auth['isAuthenticated'](),controller[_0x1ec6('0xd')]);router[_0x1ec6('0xe')]('/:id',auth[_0x1ec6('0x7')](),controller[_0x1ec6('0xf')]);module[_0x1ec6('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 6f635bb..d45ed5b 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 _0x257e=['exports','STRING'];(function(_0x199392,_0x5192e1){var _0xaf70c8=function(_0x1c55c4){while(--_0x1c55c4){_0x199392['push'](_0x199392['shift']());}};_0xaf70c8(++_0x5192e1);}(_0x257e,0x1dc));var _0xe257=function(_0x1e17eb,_0x2e15c5){_0x1e17eb=_0x1e17eb-0x0;var _0x4de4c7=_0x257e[_0x1e17eb];return _0x4de4c7;};'use strict';var Sequelize=require('sequelize');module[_0xe257('0x0')]={'name':{'type':Sequelize[_0xe257('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe257('0x1')]}};
\ No newline at end of file
+var _0x2bbb=['STRING','exports'];(function(_0x5c2e65,_0x20e630){var _0x445359=function(_0x2588d4){while(--_0x2588d4){_0x5c2e65['push'](_0x5c2e65['shift']());}};_0x445359(++_0x20e630);}(_0x2bbb,0x85));var _0xb2bb=function(_0x2c73fb,_0xddad1a){_0x2c73fb=_0x2c73fb-0x0;var _0x10e6e9=_0x2bbb[_0x2c73fb];return _0x10e6e9;};'use strict';var Sequelize=require('sequelize');module[_0xb2bb('0x0')]={'name':{'type':Sequelize[_0xb2bb('0x1')]},'basename':{'type':Sequelize[_0xb2bb('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 97a9ad5..57b4901 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 _0x544e=['../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','sendStatus','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','includeAll','findAll','rows','catch','show','params','options','find','clone','include','get','updatedAt','body','omit','createdAt','create','update','destroy','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0x544e,0x9f));var _0xe544=function(_0x1fc2ff,_0x1b8c1f){_0x1fc2ff=_0x1fc2ff-0x0;var _0x5d7d8a=_0x544e[_0x1fc2ff];return _0x5d7d8a;};'use strict';var emlformat=require(_0xe544('0x0'));var rimraf=require(_0xe544('0x1'));var zipdir=require(_0xe544('0x2'));var jsonpatch=require(_0xe544('0x3'));var rp=require('request-promise');var moment=require(_0xe544('0x4'));var BPromise=require(_0xe544('0x5'));var Mustache=require(_0xe544('0x6'));var util=require(_0xe544('0x7'));var path=require(_0xe544('0x8'));var sox=require(_0xe544('0x9'));var csv=require(_0xe544('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe544('0xb'));var _=require('lodash');var squel=require(_0xe544('0xc'));var crypto=require('crypto');var jsforce=require(_0xe544('0xd'));var deskjs=require(_0xe544('0xe'));var toCsv=require(_0xe544('0xa'));var querystring=require(_0xe544('0xf'));var Papa=require(_0xe544('0x10'));var Redis=require(_0xe544('0x11'));var authService=require(_0xe544('0x12'));var qs=require(_0xe544('0x13'));var as=require(_0xe544('0x14'));var hardwareService=require(_0xe544('0x15'));var logger=require(_0xe544('0x16'))(_0xe544('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe544('0x18'));var db=require(_0xe544('0x19'))['db'];function respondWithStatusCode(_0x502eea,_0x38c565){_0x38c565=_0x38c565||0xcc;return function(_0x23fb27){if(_0x23fb27){return _0x502eea['sendStatus'](_0x38c565);}return _0x502eea[_0xe544('0x1a')](_0x38c565)[_0xe544('0x1b')]();};}function respondWithResult(_0x1c0361,_0x30d35b){_0x30d35b=_0x30d35b||0xc8;return function(_0x29fdfd){if(_0x29fdfd){return _0x1c0361['status'](_0x30d35b)[_0xe544('0x1c')](_0x29fdfd);}};}function respondWithFilteredResult(_0x3a0d97,_0x4dc40d){return function(_0x2545d3){if(_0x2545d3){var _0x1cc87b=typeof _0x4dc40d['offset']===_0xe544('0x1d')&&typeof _0x4dc40d[_0xe544('0x1e')]==='undefined';var _0x22766e=_0x2545d3[_0xe544('0x1f')];var _0x1da09f=_0x1cc87b?0x0:_0x4dc40d[_0xe544('0x20')];var _0x463f8e=_0x1cc87b?_0x2545d3[_0xe544('0x1f')]:_0x4dc40d['offset']+_0x4dc40d[_0xe544('0x1e')];var _0x360580;if(_0x463f8e>=_0x22766e){_0x463f8e=_0x22766e;_0x360580=0xc8;}else{_0x360580=0xce;}_0x3a0d97[_0xe544('0x1a')](_0x360580);return _0x3a0d97[_0xe544('0x21')](_0xe544('0x22'),_0x1da09f+'-'+_0x463f8e+'/'+_0x22766e)[_0xe544('0x1c')](_0x2545d3);}return null;};}function patchUpdates(_0x7abf66){return function(_0xd25bc8){try{jsonpatch[_0xe544('0x23')](_0xd25bc8,_0x7abf66,!![]);}catch(_0x10a379){return BPromise[_0xe544('0x24')](_0x10a379);}return _0xd25bc8['save']();};}function saveUpdates(_0x4c35d5,_0xeb5096){return function(_0x31e23f){if(_0x31e23f){return _0x31e23f['update'](_0x4c35d5)['then'](function(_0x17a2dc){return _0x17a2dc;});}return null;};}function removeEntity(_0x4fcb32,_0x592920){return function(_0x3fe3bd){if(_0x3fe3bd){return _0x3fe3bd['destroy']()[_0xe544('0x25')](function(){_0x4fcb32[_0xe544('0x1a')](0xcc)[_0xe544('0x1b')]();});}};}function handleEntityNotFound(_0x59a668,_0x3dec32){return function(_0x35a74d){if(!_0x35a74d){_0x59a668[_0xe544('0x26')](0x194);}return _0x35a74d;};}function handleError(_0x5b3b6a,_0x394883){_0x394883=_0x394883||0x1f4;return function(_0x1202bc){logger[_0xe544('0x27')](_0x1202bc[_0xe544('0x28')]);if(_0x1202bc['name']){delete _0x1202bc[_0xe544('0x29')];}_0x5b3b6a['status'](_0x394883)['send'](_0x1202bc);};}exports[_0xe544('0x2a')]=function(_0x1e5cca,_0x5e7693){var _0x231edf={},_0x15af7e={},_0x1b4057={'count':0x0,'rows':[]};var _0x4aa598=_[_0xe544('0x2b')](db[_0xe544('0x2c')][_0xe544('0x2d')],function(_0x45450a){return{'name':_0x45450a[_0xe544('0x2e')],'type':_0x45450a[_0xe544('0x2f')][_0xe544('0x30')]};});_0x15af7e[_0xe544('0x31')]=_[_0xe544('0x2b')](_0x4aa598,'name');_0x15af7e[_0xe544('0x32')]=_[_0xe544('0x33')](_0x1e5cca[_0xe544('0x32')]);_0x15af7e[_0xe544('0x34')]=_[_0xe544('0x35')](_0x15af7e['model'],_0x15af7e[_0xe544('0x32')]);_0x231edf[_0xe544('0x36')]=_[_0xe544('0x35')](_0x15af7e[_0xe544('0x31')],qs[_0xe544('0x37')](_0x1e5cca[_0xe544('0x32')][_0xe544('0x37')]));_0x231edf[_0xe544('0x36')]=_0x231edf[_0xe544('0x36')][_0xe544('0x38')]?_0x231edf[_0xe544('0x36')]:_0x15af7e[_0xe544('0x31')];if(!_0x1e5cca[_0xe544('0x32')][_0xe544('0x39')](_0xe544('0x3a'))){_0x231edf[_0xe544('0x1e')]=qs[_0xe544('0x1e')](_0x1e5cca[_0xe544('0x32')][_0xe544('0x1e')]);_0x231edf['offset']=qs[_0xe544('0x20')](_0x1e5cca[_0xe544('0x32')][_0xe544('0x20')]);}_0x231edf['order']=qs['sort'](_0x1e5cca['query']['sort']);_0x231edf[_0xe544('0x3b')]=qs[_0xe544('0x34')](_['pick'](_0x1e5cca[_0xe544('0x32')],_0x15af7e['filters']),_0x4aa598);if(_0x1e5cca[_0xe544('0x32')][_0xe544('0x3c')]){_0x231edf[_0xe544('0x3b')]=_['merge'](_0x231edf['where'],{'$or':_[_0xe544('0x2b')](_0x4aa598,function(_0x1719ed){if(_0x1719ed[_0xe544('0x2f')]!=='VIRTUAL'){var _0x13e944={};_0x13e944[_0x1719ed[_0xe544('0x29')]]={'$like':'%'+_0x1e5cca['query'][_0xe544('0x3c')]+'%'};return _0x13e944;}})});}_0x231edf=_[_0xe544('0x3d')]({},_0x231edf,_0x1e5cca['options']);var _0x5080c={'where':_0x231edf[_0xe544('0x3b')]};return db[_0xe544('0x2c')][_0xe544('0x1f')](_0x5080c)[_0xe544('0x25')](function(_0x1a1036){_0x1b4057[_0xe544('0x1f')]=_0x1a1036;if(_0x1e5cca['query'][_0xe544('0x3e')]){_0x231edf['include']=[{'all':!![]}];}return db[_0xe544('0x2c')][_0xe544('0x3f')](_0x231edf);})[_0xe544('0x25')](function(_0x2f8dc2){_0x1b4057[_0xe544('0x40')]=_0x2f8dc2;return _0x1b4057;})[_0xe544('0x25')](respondWithFilteredResult(_0x5e7693,_0x231edf))[_0xe544('0x41')](handleError(_0x5e7693,null));};exports[_0xe544('0x42')]=function(_0x3b8197,_0x3d6519){var _0x59a9bb={'raw':!![],'where':{'id':_0x3b8197[_0xe544('0x43')]['id']}},_0x5d6ce4={};_0x5d6ce4[_0xe544('0x31')]=_[_0xe544('0x33')](db[_0xe544('0x2c')]['rawAttributes']);_0x5d6ce4[_0xe544('0x32')]=_[_0xe544('0x33')](_0x3b8197[_0xe544('0x32')]);_0x5d6ce4[_0xe544('0x34')]=_['intersection'](_0x5d6ce4['model'],_0x5d6ce4[_0xe544('0x32')]);_0x59a9bb[_0xe544('0x36')]=_['intersection'](_0x5d6ce4['model'],qs[_0xe544('0x37')](_0x3b8197[_0xe544('0x32')][_0xe544('0x37')]));_0x59a9bb['attributes']=_0x59a9bb[_0xe544('0x36')]['length']?_0x59a9bb[_0xe544('0x36')]:_0x5d6ce4[_0xe544('0x31')];if(_0x3b8197[_0xe544('0x32')][_0xe544('0x3e')]){_0x59a9bb['include']=[{'all':!![]}];}_0x59a9bb=_[_0xe544('0x3d')]({},_0x59a9bb,_0x3b8197[_0xe544('0x44')]);return db[_0xe544('0x2c')][_0xe544('0x45')](_0x59a9bb)[_0xe544('0x25')](handleEntityNotFound(_0x3d6519,null))[_0xe544('0x25')](respondWithResult(_0x3d6519,null))[_0xe544('0x41')](handleError(_0x3d6519,null));};exports[_0xe544('0x46')]=function(_0x432c27,_0x57f676){var _0x1c9906={'where':{'id':_0x432c27[_0xe544('0x43')]['id']}},_0x4ae1f1={};_0x4ae1f1[_0xe544('0x31')]=_['keys'](db[_0xe544('0x2c')][_0xe544('0x2d')]);_0x1c9906['attributes']=_['intersection'](_0x4ae1f1[_0xe544('0x31')],qs['fields'](_0x432c27[_0xe544('0x32')][_0xe544('0x37')]));_0x1c9906[_0xe544('0x36')]=_0x1c9906[_0xe544('0x36')]['length']?_0x1c9906[_0xe544('0x36')]:_0x4ae1f1[_0xe544('0x31')];if(_0x432c27[_0xe544('0x32')]['includeAll']){_0x1c9906[_0xe544('0x47')]=[{'all':!![]}];}_0x1c9906=_[_0xe544('0x3d')]({},_0x1c9906,_0x432c27['options']);return db['Attachment']['find'](_0x1c9906)[_0xe544('0x25')](handleEntityNotFound(_0x57f676,null))['then'](function(_0x36d59c){if(_0x36d59c){var _0x6a7c2c=_0x36d59c[_0xe544('0x48')]({'plain':!![]});_0x6a7c2c=qs['omit'](_0x6a7c2c,['id','createdAt',_0xe544('0x49')]);_0x432c27[_0xe544('0x4a')]=_[_0xe544('0x4b')](_0x432c27['body'],['id',_0xe544('0x4c'),_0xe544('0x49')]);return db['Attachment'][_0xe544('0x4d')](_['merge'](_0x6a7c2c,_0x432c27['body']),{'include':_0x432c27[_0xe544('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x57f676,0xc9))[_0xe544('0x41')](handleError(_0x57f676,null));};exports[_0xe544('0x4e')]=function(_0x27f497,_0x23e4e9){if(_0x27f497[_0xe544('0x4a')]['id']){delete _0x27f497[_0xe544('0x4a')]['id'];}return db[_0xe544('0x2c')][_0xe544('0x45')]({'where':{'id':_0x27f497['params']['id']}})[_0xe544('0x25')](handleEntityNotFound(_0x23e4e9,null))[_0xe544('0x25')](saveUpdates(_0x27f497[_0xe544('0x4a')],null))[_0xe544('0x25')](respondWithResult(_0x23e4e9,null))['catch'](handleError(_0x23e4e9,null));};exports[_0xe544('0x4f')]=function(_0x2f59d9,_0x3e83cb){return db[_0xe544('0x2c')][_0xe544('0x45')]({'where':{'id':_0x2f59d9['params']['id']}})[_0xe544('0x25')](handleEntityNotFound(_0x3e83cb,null))[_0xe544('0x25')](removeEntity(_0x3e83cb,null))[_0xe544('0x41')](handleError(_0x3e83cb,null));};exports[_0xe544('0x4d')]=function(_0x496aca,_0x4be5b8,_0x761cac){_0x496aca[_0xe544('0x4a')][_0xe544('0x29')]=_0x496aca[_0xe544('0x50')][_0xe544('0x51')];_0x496aca[_0xe544('0x4a')]['basename']=_0x496aca[_0xe544('0x50')][_0xe544('0x52')];_0x496aca['body'][_0xe544('0x2f')]=_0x496aca['file'][_0xe544('0x53')];return db[_0xe544('0x2c')][_0xe544('0x4d')](_0x496aca[_0xe544('0x4a')])[_0xe544('0x25')](respondWithResult(_0x4be5b8,0xc9))[_0xe544('0x41')](handleError(_0x4be5b8,null));};exports[_0xe544('0x54')]=function(_0x14908b,_0x2e9e9d,_0x8a362c){return db[_0xe544('0x2c')][_0xe544('0x55')]({'where':{'id':_0x14908b['params']['id']},'raw':!![]})[_0xe544('0x25')](handleEntityNotFound(_0x2e9e9d,null))['then'](function(_0x174c15){if(_0x174c15){var _0x13f4a1=_0x174c15[_0xe544('0x56')]!==null;var _0x339ac3=path[_0xe544('0x57')](config[_0xe544('0x58')],_0xe544('0x59'));if(_0x13f4a1){_0x339ac3=path[_0xe544('0x57')](_0x339ac3,_0xe544('0x5a'));}var _0x36cb21=path[_0xe544('0x57')](_0x339ac3,_0x174c15[_0xe544('0x5b')]);return _0x2e9e9d[_0xe544('0x54')](_0x36cb21);}})[_0xe544('0x41')](handleError(_0x2e9e9d,null));};
\ No newline at end of file
+var _0x0d36=['reject','save','update','then','error','stack','name','send','index','map','Attachment','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','rawAttributes','omit','createdAt','updatedAt','create','body','destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply'];(function(_0x3a128a,_0x3e9bc2){var _0x59f104=function(_0x931e0d){while(--_0x931e0d){_0x3a128a['push'](_0x3a128a['shift']());}};_0x59f104(++_0x3e9bc2);}(_0x0d36,0x148));var _0x60d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d36[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x60d3('0x0'));var rimraf=require(_0x60d3('0x1'));var zipdir=require(_0x60d3('0x2'));var jsonpatch=require(_0x60d3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x60d3('0x4'));var Mustache=require('mustache');var util=require(_0x60d3('0x5'));var path=require(_0x60d3('0x6'));var sox=require(_0x60d3('0x7'));var csv=require(_0x60d3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x60d3('0x9'));var _=require(_0x60d3('0xa'));var squel=require(_0x60d3('0xb'));var crypto=require(_0x60d3('0xc'));var jsforce=require(_0x60d3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x60d3('0x8'));var querystring=require('querystring');var Papa=require(_0x60d3('0xe'));var Redis=require(_0x60d3('0xf'));var authService=require(_0x60d3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60d3('0x11'));var logger=require(_0x60d3('0x12'))(_0x60d3('0x13'));var utils=require(_0x60d3('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x60d3('0x15'))['db'];function respondWithStatusCode(_0x243836,_0x538230){_0x538230=_0x538230||0xcc;return function(_0x3d32de){if(_0x3d32de){return _0x243836[_0x60d3('0x16')](_0x538230);}return _0x243836['status'](_0x538230)[_0x60d3('0x17')]();};}function respondWithResult(_0x32be75,_0x37a3d3){_0x37a3d3=_0x37a3d3||0xc8;return function(_0xb00308){if(_0xb00308){return _0x32be75[_0x60d3('0x18')](_0x37a3d3)[_0x60d3('0x19')](_0xb00308);}};}function respondWithFilteredResult(_0x7a2695,_0x1ffe5b){return function(_0xfb086b){if(_0xfb086b){var _0x586e5f=typeof _0x1ffe5b[_0x60d3('0x1a')]==='undefined'&&typeof _0x1ffe5b[_0x60d3('0x1b')]===_0x60d3('0x1c');var _0x116e1f=_0xfb086b[_0x60d3('0x1d')];var _0x223c73=_0x586e5f?0x0:_0x1ffe5b['offset'];var _0x31cd78=_0x586e5f?_0xfb086b[_0x60d3('0x1d')]:_0x1ffe5b['offset']+_0x1ffe5b[_0x60d3('0x1b')];var _0x1d5133;if(_0x31cd78>=_0x116e1f){_0x31cd78=_0x116e1f;_0x1d5133=0xc8;}else{_0x1d5133=0xce;}_0x7a2695['status'](_0x1d5133);return _0x7a2695[_0x60d3('0x1e')]('Content-Range',_0x223c73+'-'+_0x31cd78+'/'+_0x116e1f)['json'](_0xfb086b);}return null;};}function patchUpdates(_0x2707a8){return function(_0x3a2545){try{jsonpatch[_0x60d3('0x1f')](_0x3a2545,_0x2707a8,!![]);}catch(_0x454fd3){return BPromise[_0x60d3('0x20')](_0x454fd3);}return _0x3a2545[_0x60d3('0x21')]();};}function saveUpdates(_0x4b48d3,_0x34d410){return function(_0x67e8cf){if(_0x67e8cf){return _0x67e8cf[_0x60d3('0x22')](_0x4b48d3)[_0x60d3('0x23')](function(_0x50412a){return _0x50412a;});}return null;};}function removeEntity(_0x80c96d,_0x5a2816){return function(_0x40ea3d){if(_0x40ea3d){return _0x40ea3d['destroy']()[_0x60d3('0x23')](function(){_0x80c96d[_0x60d3('0x18')](0xcc)[_0x60d3('0x17')]();});}};}function handleEntityNotFound(_0x232391,_0x14025c){return function(_0x36a6b8){if(!_0x36a6b8){_0x232391[_0x60d3('0x16')](0x194);}return _0x36a6b8;};}function handleError(_0x5cd893,_0x1ec5cd){_0x1ec5cd=_0x1ec5cd||0x1f4;return function(_0x31e98d){logger[_0x60d3('0x24')](_0x31e98d[_0x60d3('0x25')]);if(_0x31e98d['name']){delete _0x31e98d[_0x60d3('0x26')];}_0x5cd893['status'](_0x1ec5cd)[_0x60d3('0x27')](_0x31e98d);};}exports[_0x60d3('0x28')]=function(_0x1bc40a,_0x58b364){var _0x5abdbe={},_0x32398a={},_0xab8eea={'count':0x0,'rows':[]};var _0x27843c=_[_0x60d3('0x29')](db[_0x60d3('0x2a')]['rawAttributes'],function(_0x42123c){return{'name':_0x42123c[_0x60d3('0x2b')],'type':_0x42123c[_0x60d3('0x2c')][_0x60d3('0x2d')]};});_0x32398a['model']=_['map'](_0x27843c,_0x60d3('0x26'));_0x32398a[_0x60d3('0x2e')]=_[_0x60d3('0x2f')](_0x1bc40a['query']);_0x32398a[_0x60d3('0x30')]=_[_0x60d3('0x31')](_0x32398a[_0x60d3('0x32')],_0x32398a[_0x60d3('0x2e')]);_0x5abdbe['attributes']=_[_0x60d3('0x31')](_0x32398a[_0x60d3('0x32')],qs[_0x60d3('0x33')](_0x1bc40a[_0x60d3('0x2e')]['fields']));_0x5abdbe[_0x60d3('0x34')]=_0x5abdbe[_0x60d3('0x34')][_0x60d3('0x35')]?_0x5abdbe['attributes']:_0x32398a['model'];if(!_0x1bc40a['query'][_0x60d3('0x36')](_0x60d3('0x37'))){_0x5abdbe['limit']=qs['limit'](_0x1bc40a['query'][_0x60d3('0x1b')]);_0x5abdbe[_0x60d3('0x1a')]=qs[_0x60d3('0x1a')](_0x1bc40a['query'][_0x60d3('0x1a')]);}_0x5abdbe[_0x60d3('0x38')]=qs[_0x60d3('0x39')](_0x1bc40a[_0x60d3('0x2e')][_0x60d3('0x39')]);_0x5abdbe[_0x60d3('0x3a')]=qs[_0x60d3('0x30')](_[_0x60d3('0x3b')](_0x1bc40a[_0x60d3('0x2e')],_0x32398a['filters']),_0x27843c);if(_0x1bc40a[_0x60d3('0x2e')][_0x60d3('0x3c')]){_0x5abdbe[_0x60d3('0x3a')]=_[_0x60d3('0x3d')](_0x5abdbe[_0x60d3('0x3a')],{'$or':_['map'](_0x27843c,function(_0x26be0e){if(_0x26be0e[_0x60d3('0x2c')]!==_0x60d3('0x3e')){var _0x364c1a={};_0x364c1a[_0x26be0e[_0x60d3('0x26')]]={'$like':'%'+_0x1bc40a['query'][_0x60d3('0x3c')]+'%'};return _0x364c1a;}})});}_0x5abdbe=_['merge']({},_0x5abdbe,_0x1bc40a[_0x60d3('0x3f')]);var _0x1b21af={'where':_0x5abdbe[_0x60d3('0x3a')]};return db[_0x60d3('0x2a')][_0x60d3('0x1d')](_0x1b21af)[_0x60d3('0x23')](function(_0x423277){_0xab8eea[_0x60d3('0x1d')]=_0x423277;if(_0x1bc40a[_0x60d3('0x2e')][_0x60d3('0x40')]){_0x5abdbe[_0x60d3('0x41')]=[{'all':!![]}];}return db[_0x60d3('0x2a')][_0x60d3('0x42')](_0x5abdbe);})['then'](function(_0x34d3b4){_0xab8eea[_0x60d3('0x43')]=_0x34d3b4;return _0xab8eea;})[_0x60d3('0x23')](respondWithFilteredResult(_0x58b364,_0x5abdbe))[_0x60d3('0x44')](handleError(_0x58b364,null));};exports['show']=function(_0x563389,_0x48397f){var _0x2ff1b9={'raw':!![],'where':{'id':_0x563389[_0x60d3('0x45')]['id']}},_0x55b8fe={};_0x55b8fe[_0x60d3('0x32')]=_[_0x60d3('0x2f')](db[_0x60d3('0x2a')]['rawAttributes']);_0x55b8fe[_0x60d3('0x2e')]=_[_0x60d3('0x2f')](_0x563389[_0x60d3('0x2e')]);_0x55b8fe['filters']=_[_0x60d3('0x31')](_0x55b8fe[_0x60d3('0x32')],_0x55b8fe[_0x60d3('0x2e')]);_0x2ff1b9[_0x60d3('0x34')]=_[_0x60d3('0x31')](_0x55b8fe[_0x60d3('0x32')],qs[_0x60d3('0x33')](_0x563389[_0x60d3('0x2e')][_0x60d3('0x33')]));_0x2ff1b9[_0x60d3('0x34')]=_0x2ff1b9[_0x60d3('0x34')][_0x60d3('0x35')]?_0x2ff1b9[_0x60d3('0x34')]:_0x55b8fe[_0x60d3('0x32')];if(_0x563389[_0x60d3('0x2e')][_0x60d3('0x40')]){_0x2ff1b9[_0x60d3('0x41')]=[{'all':!![]}];}_0x2ff1b9=_[_0x60d3('0x3d')]({},_0x2ff1b9,_0x563389[_0x60d3('0x3f')]);return db[_0x60d3('0x2a')][_0x60d3('0x46')](_0x2ff1b9)[_0x60d3('0x23')](handleEntityNotFound(_0x48397f,null))[_0x60d3('0x23')](respondWithResult(_0x48397f,null))['catch'](handleError(_0x48397f,null));};exports['clone']=function(_0x387f46,_0x6f832e){var _0x50fedd={'where':{'id':_0x387f46[_0x60d3('0x45')]['id']}},_0x144041={};_0x144041[_0x60d3('0x32')]=_['keys'](db[_0x60d3('0x2a')][_0x60d3('0x47')]);_0x50fedd[_0x60d3('0x34')]=_[_0x60d3('0x31')](_0x144041[_0x60d3('0x32')],qs[_0x60d3('0x33')](_0x387f46[_0x60d3('0x2e')][_0x60d3('0x33')]));_0x50fedd[_0x60d3('0x34')]=_0x50fedd[_0x60d3('0x34')]['length']?_0x50fedd['attributes']:_0x144041[_0x60d3('0x32')];if(_0x387f46['query']['includeAll']){_0x50fedd['include']=[{'all':!![]}];}_0x50fedd=_[_0x60d3('0x3d')]({},_0x50fedd,_0x387f46['options']);return db[_0x60d3('0x2a')][_0x60d3('0x46')](_0x50fedd)[_0x60d3('0x23')](handleEntityNotFound(_0x6f832e,null))[_0x60d3('0x23')](function(_0x4f959b){if(_0x4f959b){var _0x1a481d=_0x4f959b['get']({'plain':!![]});_0x1a481d=qs[_0x60d3('0x48')](_0x1a481d,['id',_0x60d3('0x49'),_0x60d3('0x4a')]);_0x387f46['body']=_[_0x60d3('0x48')](_0x387f46['body'],['id',_0x60d3('0x49'),_0x60d3('0x4a')]);return db[_0x60d3('0x2a')][_0x60d3('0x4b')](_['merge'](_0x1a481d,_0x387f46[_0x60d3('0x4c')]),{'include':_0x387f46[_0x60d3('0x2e')][_0x60d3('0x40')]?[{'all':!![]}]:undefined});}})[_0x60d3('0x23')](respondWithResult(_0x6f832e,0xc9))[_0x60d3('0x44')](handleError(_0x6f832e,null));};exports[_0x60d3('0x22')]=function(_0x45a130,_0xe77502){if(_0x45a130[_0x60d3('0x4c')]['id']){delete _0x45a130[_0x60d3('0x4c')]['id'];}return db[_0x60d3('0x2a')]['find']({'where':{'id':_0x45a130[_0x60d3('0x45')]['id']}})[_0x60d3('0x23')](handleEntityNotFound(_0xe77502,null))[_0x60d3('0x23')](saveUpdates(_0x45a130[_0x60d3('0x4c')],null))[_0x60d3('0x23')](respondWithResult(_0xe77502,null))[_0x60d3('0x44')](handleError(_0xe77502,null));};exports[_0x60d3('0x4d')]=function(_0x5d77a2,_0x5c9c70){return db[_0x60d3('0x2a')]['find']({'where':{'id':_0x5d77a2[_0x60d3('0x45')]['id']}})[_0x60d3('0x23')](handleEntityNotFound(_0x5c9c70,null))['then'](removeEntity(_0x5c9c70,null))['catch'](handleError(_0x5c9c70,null));};exports['create']=function(_0xda2080,_0x56d0b0,_0x52d029){_0xda2080[_0x60d3('0x4c')][_0x60d3('0x26')]=_0xda2080[_0x60d3('0x4e')][_0x60d3('0x4f')];_0xda2080[_0x60d3('0x4c')][_0x60d3('0x50')]=_0xda2080['file'][_0x60d3('0x51')];_0xda2080[_0x60d3('0x4c')][_0x60d3('0x2c')]=_0xda2080[_0x60d3('0x4e')][_0x60d3('0x52')];return db[_0x60d3('0x2a')][_0x60d3('0x4b')](_0xda2080[_0x60d3('0x4c')])[_0x60d3('0x23')](respondWithResult(_0x56d0b0,0xc9))[_0x60d3('0x44')](handleError(_0x56d0b0,null));};exports[_0x60d3('0x53')]=function(_0x19f07f,_0x5d1be5,_0x23d4b9){return db[_0x60d3('0x2a')][_0x60d3('0x54')]({'where':{'id':_0x19f07f['params']['id']},'raw':!![]})[_0x60d3('0x23')](handleEntityNotFound(_0x5d1be5,null))[_0x60d3('0x23')](function(_0x75ce84){if(_0x75ce84){var _0x3f4fe8=_0x75ce84[_0x60d3('0x55')]!==null;var _0x34d0e6=path[_0x60d3('0x56')](config[_0x60d3('0x57')],_0x60d3('0x58'));if(_0x3f4fe8){_0x34d0e6=path['join'](_0x34d0e6,_0x60d3('0x59'));}var _0x3c061e=path['join'](_0x34d0e6,_0x75ce84[_0x60d3('0x50')]);return _0x5d1be5[_0x60d3('0x53')](_0x3c061e);}})[_0x60d3('0x44')](handleError(_0x5d1be5,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0332fe2..ce24855 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 _0xa063=['api','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger'];(function(_0x484fc9,_0x4598aa){var _0x89aa01=function(_0x5256e1){while(--_0x5256e1){_0x484fc9['push'](_0x484fc9['shift']());}};_0x89aa01(++_0x4598aa);}(_0xa063,0x166));var _0x3a06=function(_0x505168,_0x46cd26){_0x505168=_0x505168-0x0;var _0x3e73c0=_0xa063[_0x505168];return _0x3e73c0;};'use strict';var _=require('lodash');var util=require(_0x3a06('0x0'));var logger=require(_0x3a06('0x1'))(_0x3a06('0x2'));var moment=require('moment');var BPromise=require(_0x3a06('0x3'));var rp=require(_0x3a06('0x4'));var fs=require('fs');var path=require(_0x3a06('0x5'));var rimraf=require(_0x3a06('0x6'));var config=require(_0x3a06('0x7'));var attributes=require(_0x3a06('0x8'));module[_0x3a06('0x9')]=function(_0x4eb3e3,_0x304da9){return _0x4eb3e3[_0x3a06('0xa')]('Attachment',attributes,{'tableName':_0x3a06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb90=['bluebird','path','rimraf','../../config/environment','exports','define','util','api'];(function(_0x36a2be,_0x5c1d80){var _0x2cf441=function(_0x2939a6){while(--_0x2939a6){_0x36a2be['push'](_0x36a2be['shift']());}};_0x2cf441(++_0x5c1d80);}(_0xfb90,0xa6));var _0x0fb9=function(_0x15bf58,_0x170ea4){_0x15bf58=_0x15bf58-0x0;var _0x5d6c96=_0xfb90[_0x15bf58];return _0x5d6c96;};'use strict';var _=require('lodash');var util=require(_0x0fb9('0x0'));var logger=require('../../config/logger')(_0x0fb9('0x1'));var moment=require('moment');var BPromise=require(_0x0fb9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fb9('0x3'));var rimraf=require(_0x0fb9('0x4'));var config=require(_0x0fb9('0x5'));var attributes=require('./attachment.attributes');module[_0x0fb9('0x6')]=function(_0x107141,_0x393a1a){return _0x107141[_0x0fb9('0x7')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index a263d05..e9707ee 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 _0x1782=['code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1310c2,_0x102826){var _0x26aaad=function(_0x2b26d5){while(--_0x2b26d5){_0x1310c2['push'](_0x1310c2['shift']());}};_0x26aaad(++_0x102826);}(_0x1782,0x13e));var _0x2178=function(_0x4633ce,_0x1de251){_0x4633ce=_0x4633ce-0x0;var _0x364042=_0x1782[_0x4633ce];return _0x364042;};'use strict';var _=require(_0x2178('0x0'));var util=require('util');var moment=require(_0x2178('0x1'));var BPromise=require(_0x2178('0x2'));var rs=require(_0x2178('0x3'));var fs=require('fs');var Redis=require(_0x2178('0x4'));var db=require(_0x2178('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2178('0x6'))(_0x2178('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2178('0x8')][_0x2178('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad34,_0x53b9f9,_0x4cf22a){return new BPromise(function(_0x3b4115,_0x2b3991){return client[_0x2178('0xa')](_0x50ad34,_0x4cf22a)[_0x2178('0xb')](function(_0x1cb1e6){logger[_0x2178('0xc')]('Attachment,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));logger[_0x2178('0xe')](_0x2178('0xf'),_0x53b9f9,_0x2178('0xd'),JSON[_0x2178('0x10')](_0x1cb1e6));if(_0x1cb1e6[_0x2178('0x11')]){if(_0x1cb1e6[_0x2178('0x11')][_0x2178('0x12')]===0x1f4){logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6['error'][_0x2178('0x14')]);return _0x2b3991(_0x1cb1e6[_0x2178('0x11')]['message']);}logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6[_0x2178('0x11')][_0x2178('0x14')]);return _0x3b4115(_0x1cb1e6[_0x2178('0x11')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));_0x3b4115(_0x1cb1e6['result'][_0x2178('0x14')]);}})[_0x2178('0x15')](function(_0x5edc68){logger['error'](_0x2178('0x13'),_0x53b9f9,_0x5edc68);_0x2b3991(_0x5edc68);});});}exports[_0x2178('0x16')]=function(_0x561990){var _0x3d7e36=this;return new Promise(function(_0x39dd60,_0x1cece2){return db[_0x2178('0x17')][_0x2178('0x18')](_0x561990[_0x2178('0x19')],{'raw':_0x561990[_0x2178('0x1a')]?_0x561990[_0x2178('0x1a')][_0x2178('0x1b')]===undefined?!![]:![]:!![]})[_0x2178('0xb')](function(_0x1d2dd5){logger[_0x2178('0xc')]('CreateAttachment',_0x561990);logger[_0x2178('0xe')](_0x2178('0x16'),_0x561990,JSON[_0x2178('0x10')](_0x1d2dd5));_0x39dd60(_0x1d2dd5);})[_0x2178('0x15')](function(_0x4335f2){logger[_0x2178('0x11')](_0x2178('0x16'),_0x4335f2[_0x2178('0x14')],_0x561990);_0x1cece2(_0x3d7e36[_0x2178('0x11')](0x1f4,_0x4335f2[_0x2178('0x14')]));});});};
\ No newline at end of file
+var _0xee11=['options','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','result','CreateAttachment','Attachment','body'];(function(_0x19e050,_0x316ed0){var _0x4cc2d3=function(_0x560832){while(--_0x560832){_0x19e050['push'](_0x19e050['shift']());}};_0x4cc2d3(++_0x316ed0);}(_0xee11,0x146));var _0x1ee1=function(_0x1683cf,_0x20b3cb){_0x1683cf=_0x1683cf-0x0;var _0x1159ad=_0xee11[_0x1683cf];return _0x1159ad;};'use strict';var _=require(_0x1ee1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1ee1('0x1'));var rs=require(_0x1ee1('0x2'));var fs=require('fs');var Redis=require(_0x1ee1('0x3'));var db=require(_0x1ee1('0x4'))['db'];var utils=require(_0x1ee1('0x5'));var logger=require(_0x1ee1('0x6'))(_0x1ee1('0x7'));var config=require(_0x1ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ee1('0x9')][_0x1ee1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fdb3b,_0x289d4c,_0x356919){return new BPromise(function(_0x47f984,_0x48af4c){return client[_0x1ee1('0xb')](_0x3fdb3b,_0x356919)[_0x1ee1('0xc')](function(_0x5899ca){logger[_0x1ee1('0xd')]('Attachment,\x20%s,\x20%s',_0x289d4c,_0x1ee1('0xe'));logger['debug'](_0x1ee1('0xf'),_0x289d4c,_0x1ee1('0xe'),JSON[_0x1ee1('0x10')](_0x5899ca));if(_0x5899ca[_0x1ee1('0x11')]){if(_0x5899ca['error'][_0x1ee1('0x12')]===0x1f4){logger[_0x1ee1('0x11')]('Attachment,\x20%s,\x20%s',_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x48af4c(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x47f984(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}else{logger[_0x1ee1('0xd')](_0x1ee1('0x14'),_0x289d4c,_0x1ee1('0xe'));_0x47f984(_0x5899ca[_0x1ee1('0x15')]['message']);}})['catch'](function(_0x7ff856){logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x7ff856);_0x48af4c(_0x7ff856);});});}exports[_0x1ee1('0x16')]=function(_0x1e18b9){var _0xff3d76=this;return new Promise(function(_0x55abff,_0x39229e){return db[_0x1ee1('0x17')]['create'](_0x1e18b9[_0x1ee1('0x18')],{'raw':_0x1e18b9[_0x1ee1('0x19')]?_0x1e18b9['options']['raw']===undefined?!![]:![]:!![]})[_0x1ee1('0xc')](function(_0x1b6cdf){logger[_0x1ee1('0xd')](_0x1ee1('0x16'),_0x1e18b9);logger['debug'](_0x1ee1('0x16'),_0x1e18b9,JSON[_0x1ee1('0x10')](_0x1b6cdf));_0x55abff(_0x1b6cdf);})[_0x1ee1('0x1a')](function(_0x5093ff){logger[_0x1ee1('0x11')](_0x1ee1('0x16'),_0x5093ff[_0x1ee1('0x13')],_0x1e18b9);_0x39229e(_0xff3d76[_0x1ee1('0x11')](0x1f4,_0x5093ff[_0x1ee1('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 268a987..60cea99 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index d328609..997f950 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 _0xec47=['Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','admin','user','agent','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','passport','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','activedirectory','undefined','baseDN','url','domain','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xec47,0x170));var _0x7ec4=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xec47[_0x49b207];return _0x2dc8fa;};'use strict';var passport=require(_0x7ec4('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0x7ec4('0x1'));var ActiveDirectory=require(_0x7ec4('0x2'));var BPromise=require(_0x7ec4('0x3'));var util=require(_0x7ec4('0x4'));var db=require(_0x7ec4('0x5'))['db'];var authService=require(_0x7ec4('0x6'));var utils=require(_0x7ec4('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x2e9e88){var _0x265d66=![];if(typeof _0x2e9e88[_0x7ec4('0x8')]!==_0x7ec4('0x9')){_0x265d66=_0x2e9e88[_0x7ec4('0x8')][_0x7ec4('0xa')]&&_0x2e9e88[_0x7ec4('0x8')][_0x7ec4('0xb')]&&_0x2e9e88['activedirectory'][_0x7ec4('0xc')];}return _0x265d66;}function adAuthenticate(_0x57ce98,_0x40e2d8,_0x476300){return new BPromise(function(_0x38452d,_0x450b62){try{var _0x4aafdf=new ActiveDirectory(_0x57ce98);_0x4aafdf['authenticate'](_0x40e2d8,_0x476300,function(_0x279425,_0x12eb11){if(_0x279425){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x40e2d8,util[_0x7ec4('0xd')](_0x279425,{'showHidden':![],'depth':null}));_0x450b62(_0x7ec4('0xe'));}else if(!_0x12eb11){logger[_0x7ec4('0xf')](_0x7ec4('0x10'),_0x40e2d8);_0x450b62(_0x7ec4('0xe'));}else{_0x38452d(_0x12eb11);}});}catch(_0x1e6c99){_0x450b62(_0x1e6c99);}});}function ActiveDirectoryAuthenticate(_0x3a6265,_0x340e4f,_0x19bd89,_0x590db9){var _0x4f78a2,_0x564460;if(!isActiveDirectoryConfigured(config)){logger[_0x7ec4('0xf')](_0x7ec4('0x11'),_0x340e4f);return _0x590db9(null,![],{'message':_0x7ec4('0xe')});}return db[_0x7ec4('0x12')][_0x7ec4('0x13')]({'where':{'id':0x1},'attributes':[_0x7ec4('0x14'),_0x7ec4('0x15')],'raw':!![]})[_0x7ec4('0x16')](function(_0x38d57b){_0x4f78a2=_0x38d57b;if(!_0x4f78a2[_0x7ec4('0x14')]){logger[_0x7ec4('0xf')](_0x7ec4('0x17'),_0x340e4f);throw new Error(_0x7ec4('0xe'));}return _0x3a6265[_0x7ec4('0x13')]({'attributes':['id',_0x7ec4('0x18'),_0x7ec4('0x19'),_0x7ec4('0x1a'),_0x7ec4('0x1b'),'disabled',_0x7ec4('0x1c'),_0x7ec4('0x1d'),_0x7ec4('0x1e')],'where':{'name':_0x340e4f,'role':{'$or':[_0x7ec4('0x1f'),_0x7ec4('0x20'),_0x7ec4('0x21')]},'adSsoEnabled':!![]}});})[_0x7ec4('0x16')](function(_0x25a763){if(!_0x25a763||_0x25a763&&_0x25a763[_0x7ec4('0x18')]!==_0x340e4f){throw new Error(_0x7ec4('0xe'));}_0x564460=_0x25a763;var _0x589964=_0x564460[_0x7ec4('0x18')]+'@'+config[_0x7ec4('0x8')][_0x7ec4('0xc')];return adAuthenticate(config[_0x7ec4('0x8')],_0x589964,_0x19bd89);})['then'](function(_0x1884b9){if(_0x564460['disabled']){throw new Error(_0x7ec4('0xe'));}if(_0x4f78a2['blockDuration']>0x0){if(_0x564460[_0x7ec4('0x1c')]){if(moment(_0x564460[_0x7ec4('0x1d')])[_0x7ec4('0x22')](_0x4f78a2[_0x7ec4('0x15')],_0x7ec4('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x7ec4('0x24')](_0x564460,0x0,![],null)[_0x7ec4('0x16')](function(){return utils[_0x7ec4('0x25')](_0x564460);})['then'](function(){return _0x590db9(null,_0x564460);});}else{return utils['getLicense'](_0x564460)[_0x7ec4('0x16')](function(){return _0x590db9(null,_0x564460);});}}else{return utils[_0x7ec4('0x25')](_0x564460)[_0x7ec4('0x16')](function(){return _0x590db9(null,_0x564460);});}})[_0x7ec4('0x26')](function(_0x51b086){return _0x590db9(null,![],_0x51b086);});}function handleError(_0x763cb4,_0x59c7d6,_0x40ba2c){return _0x763cb4[_0x7ec4('0x27')](_0x59c7d6||0x1f4)[_0x7ec4('0x28')]({'message':_0x40ba2c?_0x40ba2c[_0x7ec4('0x29')]||_0x40ba2c:''});}exports[_0x7ec4('0x2a')]=function(_0x4d805d,_0x196f77,_0x556151){passport[_0x7ec4('0x2b')](_0x7ec4('0x2c'),function(_0x140932,_0x154804,_0x396055){var _0x4295a0=_0x140932||_0x396055;if(_0x4295a0){return handleError(_0x196f77,0x191,_0x4295a0);}if(!_0x154804){return handleError(_0x196f77,0x194,{'message':_0x7ec4('0x2d')});}else{var _0xc50b3a={'payload':{'id':_0x154804['id'],'role':_0x154804[_0x7ec4('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x7ec4('0x2e')](_0xc50b3a)['then'](function(_0x3c1958){_0x196f77[_0x7ec4('0x2f')]({'id':_0x154804['id'],'token':_0x3c1958,'statusCall':'','isAlreadyLogged':_0x154804[_0x7ec4('0x1e')]});});}})(_0x4d805d,_0x196f77,_0x556151);};passport['use']('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x7ec4('0x19')},function(_0xf349ba,_0x44ba80,_0x55a597){return ActiveDirectoryAuthenticate(db['User'],_0xf349ba,_0x44ba80,_0x55a597);}));
\ No newline at end of file
+var _0xd4e8=['bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','url','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','then','password','salt','role','disabled','blockedAt','online','admin','agent','name','domain','blockDuration','blocked','minutes','clearBlockUser','getLicense','catch','status','send','message','login','authenticate','ad-login','signToken','json','use','passport','passport-local','Strategy','moment'];(function(_0xf8e7f9,_0x27be3f){var _0x52d44c=function(_0xd0f711){while(--_0xd0f711){_0xf8e7f9['push'](_0xf8e7f9['shift']());}};_0x52d44c(++_0x27be3f);}(_0xd4e8,0xe7));var _0x8d4e=function(_0x52e272,_0x3ee0e3){_0x52e272=_0x52e272-0x0;var _0x34f3a2=_0xd4e8[_0x52e272];return _0x34f3a2;};'use strict';var passport=require(_0x8d4e('0x0'));var LocalStrategy=require(_0x8d4e('0x1'))[_0x8d4e('0x2')];var moment=require(_0x8d4e('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x8d4e('0x4'));var util=require(_0x8d4e('0x5'));var db=require(_0x8d4e('0x6'))['db'];var authService=require(_0x8d4e('0x7'));var utils=require(_0x8d4e('0x8'));var config=require(_0x8d4e('0x9'));var logger=require(_0x8d4e('0xa'))('api');function isActiveDirectoryConfigured(_0x37978b){var _0xfbddd=![];if(typeof _0x37978b['activedirectory']!==_0x8d4e('0xb')){_0xfbddd=_0x37978b[_0x8d4e('0xc')]['baseDN']&&_0x37978b[_0x8d4e('0xc')][_0x8d4e('0xd')]&&_0x37978b['activedirectory']['domain'];}return _0xfbddd;}function adAuthenticate(_0x15d530,_0x2f0aa8,_0x571da0){return new BPromise(function(_0x123cc3,_0x4387b7){try{var _0x3a19bf=new ActiveDirectory(_0x15d530);_0x3a19bf['authenticate'](_0x2f0aa8,_0x571da0,function(_0x1b3b00,_0x5aa0e5){if(_0x1b3b00){logger[_0x8d4e('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x2f0aa8,util[_0x8d4e('0xf')](_0x1b3b00,{'showHidden':![],'depth':null}));_0x4387b7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x5aa0e5){logger[_0x8d4e('0xe')](_0x8d4e('0x10'),_0x2f0aa8);_0x4387b7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x123cc3(_0x5aa0e5);}});}catch(_0x7109d9){_0x4387b7(_0x7109d9);}});}function ActiveDirectoryAuthenticate(_0x2c65c4,_0x7fc547,_0x3f1ee2,_0x42a517){var _0x23cd56,_0x25a6b2;if(!isActiveDirectoryConfigured(config)){logger[_0x8d4e('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x7fc547);return _0x42a517(null,![],{'message':_0x8d4e('0x11')});}return db[_0x8d4e('0x12')][_0x8d4e('0x13')]({'where':{'id':0x1},'attributes':[_0x8d4e('0x14'),'blockDuration'],'raw':!![]})[_0x8d4e('0x15')](function(_0x581bf9){_0x23cd56=_0x581bf9;if(!_0x23cd56['adSsoEnabled']){logger[_0x8d4e('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x7fc547);throw new Error(_0x8d4e('0x11'));}return _0x2c65c4[_0x8d4e('0x13')]({'attributes':['id','name',_0x8d4e('0x16'),_0x8d4e('0x17'),_0x8d4e('0x18'),_0x8d4e('0x19'),'blocked',_0x8d4e('0x1a'),_0x8d4e('0x1b')],'where':{'name':_0x7fc547,'role':{'$or':[_0x8d4e('0x1c'),'user',_0x8d4e('0x1d')]},'adSsoEnabled':!![]}});})[_0x8d4e('0x15')](function(_0x421067){if(!_0x421067||_0x421067&&_0x421067['name']!==_0x7fc547){throw new Error(_0x8d4e('0x11'));}_0x25a6b2=_0x421067;var _0x5d7ac2=_0x25a6b2[_0x8d4e('0x1e')]+'@'+config[_0x8d4e('0xc')][_0x8d4e('0x1f')];return adAuthenticate(config['activedirectory'],_0x5d7ac2,_0x3f1ee2);})['then'](function(_0xe09f9e){if(_0x25a6b2[_0x8d4e('0x19')]){throw new Error(_0x8d4e('0x11'));}if(_0x23cd56[_0x8d4e('0x20')]>0x0){if(_0x25a6b2[_0x8d4e('0x21')]){if(moment(_0x25a6b2['blockedAt'])['add'](_0x23cd56[_0x8d4e('0x20')],_0x8d4e('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x8d4e('0x23')](_0x25a6b2,0x0,![],null)[_0x8d4e('0x15')](function(){return utils[_0x8d4e('0x24')](_0x25a6b2);})[_0x8d4e('0x15')](function(){return _0x42a517(null,_0x25a6b2);});}else{return utils['getLicense'](_0x25a6b2)[_0x8d4e('0x15')](function(){return _0x42a517(null,_0x25a6b2);});}}else{return utils['getLicense'](_0x25a6b2)[_0x8d4e('0x15')](function(){return _0x42a517(null,_0x25a6b2);});}})[_0x8d4e('0x25')](function(_0x5dd1c3){return _0x42a517(null,![],_0x5dd1c3);});}function handleError(_0x414581,_0x17f57a,_0x504073){return _0x414581[_0x8d4e('0x26')](_0x17f57a||0x1f4)[_0x8d4e('0x27')]({'message':_0x504073?_0x504073[_0x8d4e('0x28')]||_0x504073:''});}exports[_0x8d4e('0x29')]=function(_0x36c496,_0x473a05,_0x7e103c){passport[_0x8d4e('0x2a')](_0x8d4e('0x2b'),function(_0x5d89ff,_0x1a1f13,_0x294d1b){var _0x26e072=_0x5d89ff||_0x294d1b;if(_0x26e072){return handleError(_0x473a05,0x191,_0x26e072);}if(!_0x1a1f13){return handleError(_0x473a05,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1e4e0c={'payload':{'id':_0x1a1f13['id'],'role':_0x1a1f13['role']},'options':{'expiresIn':0x15180}};return authService[_0x8d4e('0x2c')](_0x1e4e0c)[_0x8d4e('0x15')](function(_0x14efda){_0x473a05[_0x8d4e('0x2d')]({'id':_0x1a1f13['id'],'token':_0x14efda,'statusCall':'','isAlreadyLogged':_0x1a1f13[_0x8d4e('0x1b')]});});}})(_0x36c496,_0x473a05,_0x7e103c);};passport[_0x8d4e('0x2e')](_0x8d4e('0x2b'),new LocalStrategy({'usernameField':'name','passwordField':_0x8d4e('0x16')},function(_0x59f65c,_0x2f2a14,_0x5d4503){return ActiveDirectoryAuthenticate(db['User'],_0x59f65c,_0x2f2a14,_0x5d4503);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index b29ee7b..a14c96a 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 _0x48ae=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x27912e,_0x2bc1c5){var _0x2d2e12=function(_0x17e094){while(--_0x17e094){_0x27912e['push'](_0x27912e['shift']());}};_0x2d2e12(++_0x2bc1c5);}(_0x48ae,0x188));var _0xe48a=function(_0x2a7ec8,_0x5cdb6d){_0x2a7ec8=_0x2a7ec8-0x0;var _0x4cec08=_0x48ae[_0x2a7ec8];return _0x4cec08;};'use strict';var express=require(_0xe48a('0x0'));var router=express[_0xe48a('0x1')]();var controller=require(_0xe48a('0x2'));router[_0xe48a('0x3')]('/',controller[_0xe48a('0x4')]);module[_0xe48a('0x5')]=router;
\ No newline at end of file
+var _0x7945=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x7945,0xb7));var _0x5794=function(_0xa72a71,_0x52b9dd){_0xa72a71=_0xa72a71-0x0;var _0x4b39d9=_0x7945[_0xa72a71];return _0x4b39d9;};'use strict';var express=require(_0x5794('0x0'));var router=express[_0x5794('0x1')]();var controller=require(_0x5794('0x2'));router[_0x5794('0x3')]('/',controller[_0x5794('0x4')]);module[_0x5794('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 30b77d5..06fc65d 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x7a54,0x106));var _0x47a5=function(_0x3f4a5e,_0x119c3f){_0x3f4a5e=_0x3f4a5e-0x0;var _0x161a98=_0x7a54[_0x3f4a5e];return _0x161a98;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x7a54,0x106));var _0x47a5=function(_0x3ce6d3,_0x59206a){_0x3ce6d3=_0x3ce6d3-0x0;var _0xe1c45a=_0x7a54[_0x3ce6d3];return _0xe1c45a;};'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 084e60f..40f99c6 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 _0x4d29=['/callback','callback','setTokenCookie','exports','express','./authGoogle.controller','get','login'];(function(_0x43566c,_0x4feef2){var _0x54477d=function(_0x71d80f){while(--_0x71d80f){_0x43566c['push'](_0x43566c['shift']());}};_0x54477d(++_0x4feef2);}(_0x4d29,0x13c));var _0x94d2=function(_0x44a863,_0x1bc824){_0x44a863=_0x44a863-0x0;var _0x3c23e7=_0x4d29[_0x44a863];return _0x3c23e7;};'use strict';var express=require(_0x94d2('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x94d2('0x1'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x94d2('0x2')]('/',controller[_0x94d2('0x3')]);router[_0x94d2('0x2')](_0x94d2('0x4'),controller[_0x94d2('0x5')],authService['isMiddleware'],userController[_0x94d2('0x3')],authService[_0x94d2('0x6')]);module[_0x94d2('0x7')]=router;
\ No newline at end of file
+var _0xf0e5=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','exports','Router'];(function(_0x30927f,_0x1a6b55){var _0x4dd593=function(_0x515645){while(--_0x515645){_0x30927f['push'](_0x30927f['shift']());}};_0x4dd593(++_0x1a6b55);}(_0xf0e5,0x1e3));var _0x5f0e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xf0e5[_0x1a36a5];return _0x746243;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x5f0e('0x0')]();var controller=require(_0x5f0e('0x1'));var userController=require(_0x5f0e('0x2'));var authService=require(_0x5f0e('0x3'));router['get']('/',controller[_0x5f0e('0x4')]);router[_0x5f0e('0x5')](_0x5f0e('0x6'),controller[_0x5f0e('0x7')],authService[_0x5f0e('0x8')],userController[_0x5f0e('0x4')],authService[_0x5f0e('0x9')]);module[_0x5f0e('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 d1b8556..8effd3d 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 _0x7c11=['stringify','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','generate','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','User','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','passwordHistoryLimit','resetPasswordToken','resetPasswordExpires','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','email','user','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x5951b9,_0x52b706){var _0x16623b=function(_0x25af2b){while(--_0x25af2b){_0x5951b9['push'](_0x5951b9['shift']());}};_0x16623b(++_0x52b706);}(_0x7c11,0x1b9));var _0x17c1=function(_0x139482,_0x5a2084){_0x139482=_0x139482-0x0;var _0x1bba06=_0x7c11[_0x139482];return _0x1bba06;};'use strict';var util=require(_0x17c1('0x0'));var passport=require(_0x17c1('0x1'));var LocalStrategy=require(_0x17c1('0x2'))['Strategy'];var jayson=require(_0x17c1('0x3'));var _=require(_0x17c1('0x4'));var rs=require(_0x17c1('0x5'));var moment=require(_0x17c1('0x6'));var db=require(_0x17c1('0x7'))['db'];var authService=require(_0x17c1('0x8'));var utils=require(_0x17c1('0x9'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0xa45146,_0x5e1e32,_0x1453e9,_0x5e66b0){var _0x486feb,_0x15a5d8;return db[_0x17c1('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x17c1('0xb'),_0x17c1('0xc')],'raw':!![]})[_0x17c1('0xd')](function(_0x24b12e){_0x486feb=_0x24b12e;return _0xa45146[_0x17c1('0xe')]({'attributes':['id',_0x17c1('0xf'),_0x17c1('0x10'),_0x17c1('0x11'),_0x17c1('0x12'),_0x17c1('0x13'),'blocked',_0x17c1('0x14'),_0x17c1('0x15')],'where':{'name':_0x5e1e32,'role':{'$or':[_0x17c1('0x16'),'user','agent']}}});})[_0x17c1('0xd')](function(_0x38169c){if(!_0x38169c||_0x38169c&&_0x38169c[_0x17c1('0xf')]!==_0x5e1e32){throw new Error(_0x17c1('0x17'));}else{_0x15a5d8=_0x38169c;return _0x15a5d8;}})[_0x17c1('0xd')](function(){_0x15a5d8[_0x17c1('0x18')](_0x1453e9,function(_0x2e645e,_0x9c41e7){var _0x5f289c=_0x15a5d8['loginAttempts']+0x1;if(_0x2e645e){return _0x5e66b0(_0x2e645e);}else if(!_0x9c41e7){if(_0x15a5d8['disabled']){return _0x5e66b0(null,![],{'message':_0x17c1('0x17')});}else if(_0x486feb[_0x17c1('0xb')]>0x0){if(_0x15a5d8[_0x17c1('0x19')]){if(_0x486feb[_0x17c1('0xc')]>0x0){if(moment(_0x15a5d8[_0x17c1('0x14')])[_0x17c1('0x1a')](_0x486feb[_0x17c1('0xc')],_0x17c1('0x1b'))>moment()){return _0x5e66b0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x15a5d8,_0x5f289c,![],null)['then'](function(){return _0x5e66b0(null,![],{'message':_0x17c1('0x17')});});}}else{return _0x5e66b0(null,![],{'message':_0x17c1('0x17')});}}else{if(_0x5f289c>=_0x486feb[_0x17c1('0xb')]){return utils['clearBlockUser'](_0x15a5d8,0x0,!![],moment())[_0x17c1('0xd')](function(){return _0x5e66b0(null,![],{'message':_0x17c1('0x17')});});}else{return utils[_0x17c1('0x1c')](_0x15a5d8,_0x5f289c,![],null)[_0x17c1('0xd')](function(){return _0x5e66b0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5e66b0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x15a5d8[_0x17c1('0x13')]){return _0x5e66b0(null,![],{'message':_0x17c1('0x17')});}else if(_0x486feb[_0x17c1('0xb')]>0x0){if(_0x15a5d8[_0x17c1('0x19')]){if(_0x486feb[_0x17c1('0xc')]>0x0){if(moment(_0x15a5d8[_0x17c1('0x14')])[_0x17c1('0x1a')](_0x486feb[_0x17c1('0xc')],_0x17c1('0x1b'))>moment()){return _0x5e66b0(null,![],{'message':_0x17c1('0x17')});}else{return utils[_0x17c1('0x1c')](_0x15a5d8,0x0,![],null)['then'](function(){return utils[_0x17c1('0x1d')](_0x15a5d8);})[_0x17c1('0xd')](function(){return _0x5e66b0(null,_0x15a5d8);});}}else{return _0x5e66b0(null,![],{'message':_0x17c1('0x17')});}}else{return utils[_0x17c1('0x1c')](_0x15a5d8,0x0,![],null)['then'](function(){return utils['getLicense'](_0x15a5d8);})[_0x17c1('0xd')](function(){return _0x5e66b0(null,_0x15a5d8);})[_0x17c1('0x1e')](function(_0x4332ce){return _0x5e66b0(null,![],_0x4332ce);});}}else{if(_0x15a5d8[_0x17c1('0x19')]){return _0x5e66b0(null,![],{'message':_0x17c1('0x17')});}else{return utils[_0x17c1('0x1d')](_0x15a5d8)[_0x17c1('0xd')](function(){return _0x5e66b0(null,_0x15a5d8);});}}}});})[_0x17c1('0x1e')](function(_0x66e045){return _0x5e66b0(null,![],_0x66e045);});}function sendServiceMail(_0x12484d){return db['MailAccount'][_0x17c1('0x1f')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x17c1('0x20')],'as':_0x17c1('0x21'),'include':[{'model':db['CloudProvider'],'as':_0x17c1('0x22')}]}]})[_0x17c1('0xd')](function(_0x2fe251){if(!_0x2fe251){throw new Error(_0x17c1('0x23'));}var _0x229021=_0x2fe251['getSmtpOptions']();var _0x4e9dd1={'account':_0x229021,'message':_[_0x17c1('0x24')]({'from':util[_0x17c1('0x25')](_0x17c1('0x26'),_0x2fe251[_0x17c1('0xf')],_0x2fe251[_0x17c1('0x27')]||_0x2fe251[_0x17c1('0x21')][_0x17c1('0x28')])},_0x12484d)};return client['request'](_0x17c1('0x29'),_0x4e9dd1);})[_0x17c1('0xd')](function(_0x3b9665){if(_0x3b9665[_0x17c1('0x2a')]){throw new Error(util['format'](_0x17c1('0x2b'),_0x3b9665[_0x17c1('0x2a')][_0x17c1('0x2c')]||JSON[_0x17c1('0x2d')](_0x3b9665[_0x17c1('0x2a')])));}return!![];});}function handleError(_0x558ac6,_0x5ad8e2,_0x573bb4){return _0x558ac6[_0x17c1('0x2e')](_0x5ad8e2||0x1f4)['send']({'message':_0x573bb4?_0x573bb4[_0x17c1('0x2c')]||_0x573bb4:''});}exports[_0x17c1('0x2f')]=function(_0x5bc412,_0x5cd544,_0xbbc0df){passport['authenticate']('local-login',function(_0x549065,_0x3382fd,_0x2cf566){var _0x289fdd=_0x549065||_0x2cf566;if(_0x289fdd){return handleError(_0x5cd544,0x191,_0x289fdd);}if(!_0x3382fd){return handleError(_0x5cd544,0x194,{'message':_0x17c1('0x30')});}else{var _0x4ade3a={'payload':{'id':_0x3382fd['id'],'role':_0x3382fd[_0x17c1('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x17c1('0x31')](_0x4ade3a)[_0x17c1('0xd')](function(_0x151e6e){_0x5cd544['json']({'id':_0x3382fd['id'],'token':_0x151e6e,'statusCall':'','isAlreadyLogged':_0x3382fd['online']});});}})(_0x5bc412,_0x5cd544,_0xbbc0df);};exports[_0x17c1('0x32')]=function(_0xa0e7f9,_0x144481){if(!_0xa0e7f9[_0x17c1('0x33')][_0x17c1('0x27')]){return handleError(_0x144481,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xdf0bf0=rs[_0x17c1('0x34')]();_0xa0e7f9['body']['email']=_0xa0e7f9[_0x17c1('0x33')][_0x17c1('0x27')][_0x17c1('0x35')]()['toLowerCase']();var _0x58ddba;return db[_0x17c1('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x17c1('0xb'),_0x17c1('0xc')],'raw':!![]})[_0x17c1('0xd')](function(_0x251930){_0x58ddba=_0x251930;return db['User']['find']({'where':{'email':_0xa0e7f9[_0x17c1('0x33')][_0x17c1('0x27')]}});})[_0x17c1('0xd')](function(_0x6a31d1){if(!_0x6a31d1){throw new Error(_0x17c1('0x36'));}if(_0x6a31d1[_0x17c1('0x13')]){throw new Error(_0x17c1('0x37'));}if(_0x6a31d1['blocked']){if(moment(_0x6a31d1[_0x17c1('0x14')])['add'](_0x58ddba[_0x17c1('0xc')],'minutes')>moment()){throw new Error(_0x17c1('0x38'));}else{_0x6a31d1['blocked']=![];_0x6a31d1[_0x17c1('0x14')]=null;}}_0x6a31d1['resetPasswordToken']=_0xdf0bf0;_0x6a31d1['resetPasswordExpires']=Date[_0x17c1('0x39')]()+0x36ee80;return _0x6a31d1[_0x17c1('0x3a')]();})[_0x17c1('0xd')](function(){return sendServiceMail({'to':_0xa0e7f9['body']['email'],'subject':_0x17c1('0x3b'),'text':_0x17c1('0x3c')+_0x17c1('0x3d')+_0x17c1('0x3e')+_0xa0e7f9['headers'][_0x17c1('0x3f')]+_0x17c1('0x40')+_0xdf0bf0+'\x0a\x0a'+_0x17c1('0x41')});})[_0x17c1('0xd')](function(){_0x144481[_0x17c1('0x2e')](0xc8)[_0x17c1('0x42')]({'message':'Reset\x20Email\x20sent!'});})[_0x17c1('0x1e')](function(_0x269359){return handleError(_0x144481,0x1f4,_0x269359);});};exports['reset']=function(_0x512ca2,_0x4099ed){return db[_0x17c1('0x43')][_0x17c1('0x1f')]({'where':{'resetPasswordToken':_0x512ca2[_0x17c1('0x44')]['token'],'resetPasswordExpires':{'$gt':Date[_0x17c1('0x39')]()}}})['then'](function(_0x3753f8){if(!_0x3753f8){throw new Error(_0x17c1('0x45'));}return db[_0x17c1('0xa')][_0x17c1('0xe')]({'attributes':['id','securePassword',_0x17c1('0x46'),'passwordHistoryLimit']})[_0x17c1('0xd')](function(_0x574b24){if(_0x574b24[_0x17c1('0x47')])authService[_0x17c1('0x48')](_0x512ca2[_0x17c1('0x33')]['password']);if(!_0x574b24['enforcePasswordHistory']||!_0x3753f8['previousPasswords'])return _0x3753f8;authService[_0x17c1('0x49')](_0x512ca2[_0x17c1('0x33')]['password'],_0x3753f8[_0x17c1('0x4a')],_0x574b24[_0x17c1('0x4b')]);return _0x3753f8;})['then'](function(){_0x3753f8[_0x17c1('0x10')]=_0x512ca2[_0x17c1('0x33')]['password'];_0x3753f8[_0x17c1('0x4c')]=null;_0x3753f8[_0x17c1('0x4d')]=null;return _0x3753f8[_0x17c1('0x3a')]();});})['then'](function(){_0x4099ed[_0x17c1('0x2e')](0xc8)['send']({'message':_0x17c1('0x4e')});})[_0x17c1('0x1e')](function(_0x579501){return handleError(_0x4099ed,0x1f4,_0x579501);});};passport[_0x17c1('0x4f')](_0x17c1('0x50'),new LocalStrategy({'usernameField':_0x17c1('0xf'),'passwordField':_0x17c1('0x10')},function(_0x70c18a,_0x1d44eb,_0x2e3b4e){return localAuthenticate(db[_0x17c1('0x43')],_0x70c18a,_0x1d44eb,_0x2e3b4e);}));
\ No newline at end of file
+var _0xb790=['This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','catch','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','local-login','passport-local','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','blockedAt','loginAttempts','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase'];(function(_0x460b72,_0x43f16d){var _0x4c7291=function(_0x2a6097){while(--_0x2a6097){_0x460b72['push'](_0x460b72['shift']());}};_0x4c7291(++_0x43f16d);}(_0xb790,0x1a6));var _0x0b79=function(_0x309991,_0x457e73){_0x309991=_0x309991-0x0;var _0x4ca94d=_0xb790[_0x309991];return _0x4ca94d;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x0b79('0x0'))[_0x0b79('0x1')];var jayson=require(_0x0b79('0x2'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x0b79('0x3'));var db=require(_0x0b79('0x4'))['db'];var authService=require(_0x0b79('0x5'));var utils=require(_0x0b79('0x6'));var client=jayson['client'][_0x0b79('0x7')]({'port':0x232b});function localAuthenticate(_0x249f67,_0x5144fe,_0x13fefb,_0x18359c){var _0x32444d,_0x34ac99;return db[_0x0b79('0x8')][_0x0b79('0x9')]({'where':{'id':0x1},'attributes':[_0x0b79('0xa'),_0x0b79('0xb')],'raw':!![]})[_0x0b79('0xc')](function(_0x30a23a){_0x32444d=_0x30a23a;return _0x249f67[_0x0b79('0x9')]({'attributes':['id',_0x0b79('0xd'),'password',_0x0b79('0xe'),_0x0b79('0xf'),'disabled',_0x0b79('0x10'),_0x0b79('0x11'),_0x0b79('0x12')],'where':{'name':_0x5144fe,'role':{'$or':['admin',_0x0b79('0x13'),_0x0b79('0x14')]}}});})[_0x0b79('0xc')](function(_0x2e8a2d){if(!_0x2e8a2d||_0x2e8a2d&&_0x2e8a2d['name']!==_0x5144fe){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x34ac99=_0x2e8a2d;return _0x34ac99;}})[_0x0b79('0xc')](function(){_0x34ac99['authenticate'](_0x13fefb,function(_0x543087,_0x4b2822){var _0x9ddcd5=_0x34ac99[_0x0b79('0x12')]+0x1;if(_0x543087){return _0x18359c(_0x543087);}else if(!_0x4b2822){if(_0x34ac99[_0x0b79('0x15')]){return _0x18359c(null,![],{'message':_0x0b79('0x16')});}else if(_0x32444d[_0x0b79('0xa')]>0x0){if(_0x34ac99[_0x0b79('0x10')]){if(_0x32444d[_0x0b79('0xb')]>0x0){if(moment(_0x34ac99['blockedAt'])[_0x0b79('0x17')](_0x32444d[_0x0b79('0xb')],'minutes')>moment()){return _0x18359c(null,![],{'message':_0x0b79('0x16')});}else{return utils['clearBlockUser'](_0x34ac99,_0x9ddcd5,![],null)[_0x0b79('0xc')](function(){return _0x18359c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x18359c(null,![],{'message':_0x0b79('0x16')});}}else{if(_0x9ddcd5>=_0x32444d[_0x0b79('0xa')]){return utils[_0x0b79('0x18')](_0x34ac99,0x0,!![],moment())['then'](function(){return _0x18359c(null,![],{'message':_0x0b79('0x16')});});}else{return utils[_0x0b79('0x18')](_0x34ac99,_0x9ddcd5,![],null)[_0x0b79('0xc')](function(){return _0x18359c(null,![],{'message':_0x0b79('0x16')});});}}}else{return _0x18359c(null,![],{'message':_0x0b79('0x16')});}}else{if(_0x34ac99[_0x0b79('0x15')]){return _0x18359c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x32444d['allowedLoginAttempts']>0x0){if(_0x34ac99[_0x0b79('0x10')]){if(_0x32444d[_0x0b79('0xb')]>0x0){if(moment(_0x34ac99[_0x0b79('0x11')])['add'](_0x32444d[_0x0b79('0xb')],_0x0b79('0x19'))>moment()){return _0x18359c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0b79('0x18')](_0x34ac99,0x0,![],null)[_0x0b79('0xc')](function(){return utils[_0x0b79('0x1a')](_0x34ac99);})[_0x0b79('0xc')](function(){return _0x18359c(null,_0x34ac99);});}}else{return _0x18359c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x34ac99,0x0,![],null)[_0x0b79('0xc')](function(){return utils['getLicense'](_0x34ac99);})[_0x0b79('0xc')](function(){return _0x18359c(null,_0x34ac99);})['catch'](function(_0x4615da){return _0x18359c(null,![],_0x4615da);});}}else{if(_0x34ac99[_0x0b79('0x10')]){return _0x18359c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0b79('0x1a')](_0x34ac99)[_0x0b79('0xc')](function(){return _0x18359c(null,_0x34ac99);});}}}});})['catch'](function(_0x57df4b){return _0x18359c(null,![],_0x57df4b);});}function sendServiceMail(_0x3b0911){return db[_0x0b79('0x1b')][_0x0b79('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x0b79('0xd'),_0x0b79('0x1d')],'include':[{'model':db[_0x0b79('0x1e')],'as':'Smtp','include':[{'model':db[_0x0b79('0x1f')],'as':_0x0b79('0x1f')}]}]})[_0x0b79('0xc')](function(_0x350178){if(!_0x350178){throw new Error(_0x0b79('0x20'));}var _0x110144=_0x350178['getSmtpOptions']();var _0x60af56={'account':_0x110144,'message':_[_0x0b79('0x21')]({'from':util[_0x0b79('0x22')](_0x0b79('0x23'),_0x350178['name'],_0x350178[_0x0b79('0x1d')]||_0x350178['Smtp'][_0x0b79('0x13')])},_0x3b0911)};return client[_0x0b79('0x24')]('SendMail',_0x60af56);})[_0x0b79('0xc')](function(_0x290f2e){if(_0x290f2e[_0x0b79('0x25')]){throw new Error(util[_0x0b79('0x22')](_0x0b79('0x26'),_0x290f2e['error'][_0x0b79('0x27')]||JSON[_0x0b79('0x28')](_0x290f2e[_0x0b79('0x25')])));}return!![];});}function handleError(_0x2b51e1,_0x54e1ee,_0x3906fa){return _0x2b51e1[_0x0b79('0x29')](_0x54e1ee||0x1f4)[_0x0b79('0x2a')]({'message':_0x3906fa?_0x3906fa[_0x0b79('0x27')]||_0x3906fa:''});}exports['login']=function(_0x530876,_0x438591,_0x30af8c){passport[_0x0b79('0x2b')]('local-login',function(_0x39b949,_0x948792,_0x751121){var _0x14f619=_0x39b949||_0x751121;if(_0x14f619){return handleError(_0x438591,0x191,_0x14f619);}if(!_0x948792){return handleError(_0x438591,0x194,{'message':_0x0b79('0x2c')});}else{var _0x53f6cf={'payload':{'id':_0x948792['id'],'role':_0x948792[_0x0b79('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x53f6cf)[_0x0b79('0xc')](function(_0x89b7ef){_0x438591[_0x0b79('0x2d')]({'id':_0x948792['id'],'token':_0x89b7ef,'statusCall':'','isAlreadyLogged':_0x948792[_0x0b79('0x2e')]});});}})(_0x530876,_0x438591,_0x30af8c);};exports[_0x0b79('0x2f')]=function(_0x523179,_0x5d1c66){if(!_0x523179['body'][_0x0b79('0x1d')]){return handleError(_0x5d1c66,0x1f4,{'message':_0x0b79('0x30')});}var _0x39af12=rs['generate']();_0x523179[_0x0b79('0x31')][_0x0b79('0x1d')]=_0x523179[_0x0b79('0x31')]['email'][_0x0b79('0x32')]()[_0x0b79('0x33')]();var _0xbd8ac2;return db[_0x0b79('0x8')][_0x0b79('0x9')]({'where':{'id':0x1},'attributes':[_0x0b79('0xa'),_0x0b79('0xb')],'raw':!![]})[_0x0b79('0xc')](function(_0x54b2ef){_0xbd8ac2=_0x54b2ef;return db['User']['find']({'where':{'email':_0x523179[_0x0b79('0x31')]['email']}});})[_0x0b79('0xc')](function(_0x1cf4fc){if(!_0x1cf4fc){throw new Error(_0x0b79('0x34'));}if(_0x1cf4fc[_0x0b79('0x15')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x1cf4fc[_0x0b79('0x10')]){if(moment(_0x1cf4fc[_0x0b79('0x11')])['add'](_0xbd8ac2[_0x0b79('0xb')],'minutes')>moment()){throw new Error(_0x0b79('0x35'));}else{_0x1cf4fc[_0x0b79('0x10')]=![];_0x1cf4fc['blockedAt']=null;}}_0x1cf4fc[_0x0b79('0x36')]=_0x39af12;_0x1cf4fc['resetPasswordExpires']=Date[_0x0b79('0x37')]()+0x36ee80;return _0x1cf4fc[_0x0b79('0x38')]();})[_0x0b79('0xc')](function(){return sendServiceMail({'to':_0x523179[_0x0b79('0x31')]['email'],'subject':_0x0b79('0x39'),'text':_0x0b79('0x3a')+_0x0b79('0x3b')+_0x0b79('0x3c')+_0x523179['headers']['host']+_0x0b79('0x3d')+_0x39af12+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0b79('0xc')](function(){_0x5d1c66[_0x0b79('0x29')](0xc8)[_0x0b79('0x2a')]({'message':'Reset\x20Email\x20sent!'});})[_0x0b79('0x3e')](function(_0x408288){return handleError(_0x5d1c66,0x1f4,_0x408288);});};exports[_0x0b79('0x3f')]=function(_0x31ad55,_0x4a5945){return db[_0x0b79('0x40')][_0x0b79('0x1c')]({'where':{'resetPasswordToken':_0x31ad55[_0x0b79('0x41')][_0x0b79('0x42')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x40e106){if(!_0x40e106){throw new Error(_0x0b79('0x43'));}return db['Setting']['findOne']({'attributes':['id',_0x0b79('0x44'),_0x0b79('0x45'),_0x0b79('0x46')]})[_0x0b79('0xc')](function(_0x2bdfbf){if(_0x2bdfbf['securePassword'])authService[_0x0b79('0x47')](_0x31ad55['body'][_0x0b79('0x48')]);if(!_0x2bdfbf[_0x0b79('0x45')]||!_0x40e106[_0x0b79('0x49')])return _0x40e106;authService[_0x0b79('0x4a')](_0x31ad55['body'][_0x0b79('0x48')],_0x40e106[_0x0b79('0x49')],_0x2bdfbf['passwordHistoryLimit']);return _0x40e106;})['then'](function(){_0x40e106[_0x0b79('0x48')]=_0x31ad55['body']['password'];_0x40e106[_0x0b79('0x36')]=null;_0x40e106[_0x0b79('0x4b')]=null;return _0x40e106[_0x0b79('0x38')]();});})[_0x0b79('0xc')](function(){_0x4a5945['status'](0xc8)[_0x0b79('0x2a')]({'message':_0x0b79('0x4c')});})['catch'](function(_0x32f7a1){return handleError(_0x4a5945,0x1f4,_0x32f7a1);});};passport[_0x0b79('0x4d')](_0x0b79('0x4e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x232b18,_0xe691ae,_0x31d119){return localAuthenticate(db[_0x0b79('0x40')],_0x232b18,_0xe691ae,_0x31d119);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index d046d0c..7cce2ef 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 _0x6091=['forgot','reset','exports','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0x334280,_0x3a7b8a){var _0x27ea14=function(_0x5f5c1f){while(--_0x5f5c1f){_0x334280['push'](_0x334280['shift']());}};_0x27ea14(++_0x3a7b8a);}(_0x6091,0x135));var _0x1609=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x6091[_0x3f5dca];return _0x5b833a;};'use strict';var express=require(_0x1609('0x0'));var router=express[_0x1609('0x1')]();var controller=require(_0x1609('0x2'));router[_0x1609('0x3')]('/',controller[_0x1609('0x4')]);router[_0x1609('0x3')](_0x1609('0x5'),controller[_0x1609('0x6')]);router['post']('/reset/:token',controller[_0x1609('0x7')]);module[_0x1609('0x8')]=router;
\ No newline at end of file
+var _0xc408=['./authLocal.controller','post','login','/forgot','/reset/:token','exports','Router'];(function(_0x47c902,_0x220fd2){var _0x1ad6a0=function(_0xf9fdb0){while(--_0xf9fdb0){_0x47c902['push'](_0x47c902['shift']());}};_0x1ad6a0(++_0x220fd2);}(_0xc408,0x164));var _0x8c40=function(_0x9b3e69,_0x3a01d8){_0x9b3e69=_0x9b3e69-0x0;var _0x1bae34=_0xc408[_0x9b3e69];return _0x1bae34;};'use strict';var express=require('express');var router=express[_0x8c40('0x0')]();var controller=require(_0x8c40('0x1'));router[_0x8c40('0x2')]('/',controller[_0x8c40('0x3')]);router[_0x8c40('0x2')](_0x8c40('0x4'),controller['forgot']);router[_0x8c40('0x2')](_0x8c40('0x5'),controller['reset']);module[_0x8c40('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 3b7373f..b15c4db 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 _0xd635=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd635,0xfe));var _0x5d63=function(_0x419560,_0x16a92c){_0x419560=_0x419560-0x0;var _0x52a0a9=_0xd635[_0x419560];return _0x52a0a9;};'use strict';var Sequelize=require(_0x5d63('0x0'));module[_0x5d63('0x1')]={'name':{'type':Sequelize[_0x5d63('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5d63('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5d63('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5d63('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x304a=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x14f326,_0x4760a3){var _0x9e3123=function(_0x28b841){while(--_0x28b841){_0x14f326['push'](_0x14f326['shift']());}};_0x9e3123(++_0x4760a3);}(_0x304a,0x76));var _0xa304=function(_0x29ac67,_0xa35896){_0x29ac67=_0x29ac67-0x0;var _0x282c82=_0x304a[_0x29ac67];return _0x282c82;};'use strict';var Sequelize=require(_0xa304('0x0'));module[_0xa304('0x1')]={'name':{'type':Sequelize[_0xa304('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xa304('0x2')]},'description':{'type':Sequelize[_0xa304('0x2')]},'status':{'type':Sequelize[_0xa304('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa304('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 7bdd74a..b2f7b86 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 _0xa59a=['Action','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','Automation','include','findAll','rows','catch','show','params','fields','includeAll','find','body','Condition','addConditions','ids','omit','getConditions','order','nolimit','addActions','getActions','findOne'];(function(_0x3aa59a,_0x1efb6){var _0x431c78=function(_0x6b09a5){while(--_0x6b09a5){_0x3aa59a['push'](_0x3aa59a['shift']());}};_0x431c78(++_0x1efb6);}(_0xa59a,0x103));var _0xaa59=function(_0x37fd32,_0x3bc37a){_0x37fd32=_0x37fd32-0x0;var _0x41f971=_0xa59a[_0x37fd32];return _0x41f971;};'use strict';var emlformat=require(_0xaa59('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaa59('0x1'));var jsonpatch=require(_0xaa59('0x2'));var rp=require(_0xaa59('0x3'));var moment=require(_0xaa59('0x4'));var BPromise=require(_0xaa59('0x5'));var Mustache=require(_0xaa59('0x6'));var util=require(_0xaa59('0x7'));var path=require(_0xaa59('0x8'));var sox=require(_0xaa59('0x9'));var csv=require(_0xaa59('0xa'));var ejs=require(_0xaa59('0xb'));var fs=require('fs');var fs_extra=require(_0xaa59('0xc'));var _=require(_0xaa59('0xd'));var squel=require(_0xaa59('0xe'));var crypto=require('crypto');var jsforce=require(_0xaa59('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa59('0x10'));var Papa=require(_0xaa59('0x11'));var Redis=require(_0xaa59('0x12'));var authService=require(_0xaa59('0x13'));var qs=require(_0xaa59('0x14'));var as=require(_0xaa59('0x15'));var hardwareService=require(_0xaa59('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xaa59('0x17'));var config=require(_0xaa59('0x18'));var licenseUtil=require(_0xaa59('0x19'));var db=require(_0xaa59('0x1a'))['db'];function respondWithStatusCode(_0x2f831d,_0x2fbe67){_0x2fbe67=_0x2fbe67||0xcc;return function(_0x13f5b8){if(_0x13f5b8){return _0x2f831d[_0xaa59('0x1b')](_0x2fbe67);}return _0x2f831d['status'](_0x2fbe67)[_0xaa59('0x1c')]();};}function respondWithResult(_0x2e5303,_0x530235){_0x530235=_0x530235||0xc8;return function(_0x551753){if(_0x551753){return _0x2e5303[_0xaa59('0x1d')](_0x530235)[_0xaa59('0x1e')](_0x551753);}};}function respondWithFilteredResult(_0x5dbc38,_0x2bf80a){return function(_0x554984){if(_0x554984){var _0x481034=typeof _0x2bf80a[_0xaa59('0x1f')]===_0xaa59('0x20')&&typeof _0x2bf80a['limit']==='undefined';var _0x1611f2=_0x554984[_0xaa59('0x21')];var _0x566d4a=_0x481034?0x0:_0x2bf80a['offset'];var _0x39f2d3=_0x481034?_0x554984[_0xaa59('0x21')]:_0x2bf80a[_0xaa59('0x1f')]+_0x2bf80a['limit'];var _0x4d8752;if(_0x39f2d3>=_0x1611f2){_0x39f2d3=_0x1611f2;_0x4d8752=0xc8;}else{_0x4d8752=0xce;}_0x5dbc38['status'](_0x4d8752);return _0x5dbc38['set'](_0xaa59('0x22'),_0x566d4a+'-'+_0x39f2d3+'/'+_0x1611f2)[_0xaa59('0x1e')](_0x554984);}return null;};}function patchUpdates(_0x23c552){return function(_0x571d16){try{jsonpatch[_0xaa59('0x23')](_0x571d16,_0x23c552,!![]);}catch(_0x14a0a4){return BPromise[_0xaa59('0x24')](_0x14a0a4);}return _0x571d16[_0xaa59('0x25')]();};}function saveUpdates(_0x4fa652,_0xcb9b3){return function(_0x192c71){if(_0x192c71){return _0x192c71[_0xaa59('0x26')](_0x4fa652)[_0xaa59('0x27')](function(_0x42e1bb){return _0x42e1bb;});}return null;};}function removeEntity(_0x293950,_0x1a278d){return function(_0xecf09){if(_0xecf09){return _0xecf09[_0xaa59('0x28')]()[_0xaa59('0x27')](function(){_0x293950['status'](0xcc)[_0xaa59('0x1c')]();});}};}function handleEntityNotFound(_0x4c1783,_0x59394b){return function(_0x8c9827){if(!_0x8c9827){_0x4c1783[_0xaa59('0x1b')](0x194);}return _0x8c9827;};}function handleError(_0x3184a9,_0x2c1c35){_0x2c1c35=_0x2c1c35||0x1f4;return function(_0x4f305e){logger['error'](_0x4f305e[_0xaa59('0x29')]);if(_0x4f305e[_0xaa59('0x2a')]){delete _0x4f305e['name'];}_0x3184a9['status'](_0x2c1c35)['send'](_0x4f305e);};}exports['index']=function(_0x2a628c,_0x4e61a9){var _0x446520={},_0x2c64c0={},_0x24d873={'count':0x0,'rows':[]};var _0x133eb5=_['map'](db['Automation'][_0xaa59('0x2b')],function(_0x39910f){return{'name':_0x39910f[_0xaa59('0x2c')],'type':_0x39910f['type'][_0xaa59('0x2d')]};});_0x2c64c0[_0xaa59('0x2e')]=_[_0xaa59('0x2f')](_0x133eb5,_0xaa59('0x2a'));_0x2c64c0[_0xaa59('0x30')]=_[_0xaa59('0x31')](_0x2a628c['query']);_0x2c64c0[_0xaa59('0x32')]=_[_0xaa59('0x33')](_0x2c64c0[_0xaa59('0x2e')],_0x2c64c0['query']);_0x446520[_0xaa59('0x34')]=_['intersection'](_0x2c64c0[_0xaa59('0x2e')],qs['fields'](_0x2a628c[_0xaa59('0x30')]['fields']));_0x446520[_0xaa59('0x34')]=_0x446520[_0xaa59('0x34')][_0xaa59('0x35')]?_0x446520[_0xaa59('0x34')]:_0x2c64c0[_0xaa59('0x2e')];if(!_0x2a628c[_0xaa59('0x30')][_0xaa59('0x36')]('nolimit')){_0x446520[_0xaa59('0x37')]=qs['limit'](_0x2a628c['query'][_0xaa59('0x37')]);_0x446520[_0xaa59('0x1f')]=qs['offset'](_0x2a628c[_0xaa59('0x30')][_0xaa59('0x1f')]);}_0x446520['order']=qs[_0xaa59('0x38')](_0x2a628c[_0xaa59('0x30')][_0xaa59('0x38')]);_0x446520[_0xaa59('0x39')]=qs[_0xaa59('0x32')](_[_0xaa59('0x3a')](_0x2a628c[_0xaa59('0x30')],_0x2c64c0[_0xaa59('0x32')]),_0x133eb5);if(_0x2a628c[_0xaa59('0x30')][_0xaa59('0x3b')]){_0x446520['where']=_[_0xaa59('0x3c')](_0x446520['where'],{'$or':_[_0xaa59('0x2f')](_0x133eb5,function(_0x42e2ad){if(_0x42e2ad[_0xaa59('0x3d')]!==_0xaa59('0x3e')){var _0xf32977={};_0xf32977[_0x42e2ad[_0xaa59('0x2a')]]={'$like':'%'+_0x2a628c[_0xaa59('0x30')][_0xaa59('0x3b')]+'%'};return _0xf32977;}})});}_0x446520=_[_0xaa59('0x3c')]({},_0x446520,_0x2a628c[_0xaa59('0x3f')]);var _0x137820={'where':_0x446520[_0xaa59('0x39')]};return db[_0xaa59('0x40')]['count'](_0x137820)[_0xaa59('0x27')](function(_0x3a1ba5){_0x24d873[_0xaa59('0x21')]=_0x3a1ba5;if(_0x2a628c[_0xaa59('0x30')]['includeAll']){_0x446520[_0xaa59('0x41')]=[{'all':!![]}];}return db['Automation'][_0xaa59('0x42')](_0x446520);})['then'](function(_0x378259){_0x24d873[_0xaa59('0x43')]=_0x378259;return _0x24d873;})[_0xaa59('0x27')](respondWithFilteredResult(_0x4e61a9,_0x446520))[_0xaa59('0x44')](handleError(_0x4e61a9,null));};exports[_0xaa59('0x45')]=function(_0x390ddc,_0x2bae64){var _0x3e6fbf={'raw':![],'where':{'id':_0x390ddc[_0xaa59('0x46')]['id']}},_0x3d6a64={};_0x3d6a64[_0xaa59('0x2e')]=_[_0xaa59('0x31')](db[_0xaa59('0x40')][_0xaa59('0x2b')]);_0x3d6a64[_0xaa59('0x30')]=_[_0xaa59('0x31')](_0x390ddc[_0xaa59('0x30')]);_0x3d6a64[_0xaa59('0x32')]=_['intersection'](_0x3d6a64['model'],_0x3d6a64[_0xaa59('0x30')]);_0x3e6fbf['attributes']=_[_0xaa59('0x33')](_0x3d6a64[_0xaa59('0x2e')],qs[_0xaa59('0x47')](_0x390ddc[_0xaa59('0x30')]['fields']));_0x3e6fbf['attributes']=_0x3e6fbf['attributes']['length']?_0x3e6fbf['attributes']:_0x3d6a64['model'];if(_0x390ddc['query'][_0xaa59('0x48')]){_0x3e6fbf[_0xaa59('0x41')]=[{'all':!![]}];}_0x3e6fbf=_[_0xaa59('0x3c')]({},_0x3e6fbf,_0x390ddc[_0xaa59('0x3f')]);return db[_0xaa59('0x40')][_0xaa59('0x49')](_0x3e6fbf)[_0xaa59('0x27')](handleEntityNotFound(_0x2bae64,null))[_0xaa59('0x27')](respondWithResult(_0x2bae64,null))['catch'](handleError(_0x2bae64,null));};exports['create']=function(_0x4a9491,_0x3182bd){return db[_0xaa59('0x40')]['create'](_0x4a9491[_0xaa59('0x4a')],{})[_0xaa59('0x27')](respondWithResult(_0x3182bd,0xc9))[_0xaa59('0x44')](handleError(_0x3182bd,null));};exports[_0xaa59('0x26')]=function(_0x7d42c0,_0x2bb96c){if(_0x7d42c0['body']['id']){delete _0x7d42c0[_0xaa59('0x4a')]['id'];}return db['Automation'][_0xaa59('0x49')]({'where':{'id':_0x7d42c0[_0xaa59('0x46')]['id']}})[_0xaa59('0x27')](handleEntityNotFound(_0x2bb96c,null))[_0xaa59('0x27')](saveUpdates(_0x7d42c0[_0xaa59('0x4a')],null))['then'](respondWithResult(_0x2bb96c,null))[_0xaa59('0x44')](handleError(_0x2bb96c,null));};exports[_0xaa59('0x28')]=function(_0x1de6e5,_0x5ab558){return db['Automation']['find']({'where':{'id':_0x1de6e5[_0xaa59('0x46')]['id']}})[_0xaa59('0x27')](handleEntityNotFound(_0x5ab558,null))['then'](removeEntity(_0x5ab558,null))['catch'](handleError(_0x5ab558,null));};exports['addConditions']=function(_0x29e3ec,_0x504404,_0x4b75a6){return db[_0xaa59('0x4b')]['find']({'where':{'id':_0x29e3ec[_0xaa59('0x46')]['id']}})['then'](handleEntityNotFound(_0x504404,null))[_0xaa59('0x27')](function(_0x1b3b2a){if(_0x1b3b2a){return _0x1b3b2a[_0xaa59('0x4c')](_0x29e3ec[_0xaa59('0x4a')][_0xaa59('0x4d')],_[_0xaa59('0x4e')](_0x29e3ec['body'],['ids','id'])||{});}})[_0xaa59('0x27')](respondWithResult(_0x504404,null))['catch'](handleError(_0x504404,null));};exports[_0xaa59('0x4f')]=function(_0x512694,_0x341344,_0x537587){var _0x56cee0={};var _0x4c20a7={};var _0xa96d9;var _0x2174d0;return db['Automation']['findOne']({'where':{'id':_0x512694[_0xaa59('0x46')]['id']}})['then'](handleEntityNotFound(_0x341344,null))['then'](function(_0x357c0d){if(_0x357c0d){_0xa96d9=_0x357c0d;_0x4c20a7[_0xaa59('0x2e')]=_[_0xaa59('0x31')](db[_0xaa59('0x4b')]['rawAttributes']);_0x4c20a7[_0xaa59('0x30')]=_[_0xaa59('0x31')](_0x512694[_0xaa59('0x30')]);_0x4c20a7[_0xaa59('0x32')]=_['intersection'](_0x4c20a7[_0xaa59('0x2e')],_0x4c20a7['query']);_0x56cee0[_0xaa59('0x34')]=_[_0xaa59('0x33')](_0x4c20a7['model'],qs['fields'](_0x512694[_0xaa59('0x30')][_0xaa59('0x47')]));_0x56cee0['attributes']=_0x56cee0[_0xaa59('0x34')][_0xaa59('0x35')]?_0x56cee0[_0xaa59('0x34')]:_0x4c20a7[_0xaa59('0x2e')];_0x56cee0[_0xaa59('0x50')]=qs[_0xaa59('0x38')](_0x512694[_0xaa59('0x30')][_0xaa59('0x38')]);_0x56cee0['where']=qs[_0xaa59('0x32')](_['pick'](_0x512694['query'],_0x4c20a7[_0xaa59('0x32')]));if(_0x512694[_0xaa59('0x30')]['filter']){_0x56cee0['where']=_[_0xaa59('0x3c')](_0x56cee0[_0xaa59('0x39')],{'$or':_[_0xaa59('0x2f')](_0x56cee0[_0xaa59('0x34')],function(_0x2d4d63){var _0x1544c8={};_0x1544c8[_0x2d4d63]={'$like':'%'+_0x512694[_0xaa59('0x30')]['filter']+'%'};return _0x1544c8;})});}_0x56cee0=_['merge']({},_0x56cee0,_0x512694[_0xaa59('0x3f')]);return _0xa96d9[_0xaa59('0x4f')](_0x56cee0);}})[_0xaa59('0x27')](function(_0x32bced){if(_0x32bced){_0x2174d0=_0x32bced[_0xaa59('0x35')];if(!_0x512694['query'][_0xaa59('0x36')](_0xaa59('0x51'))){_0x56cee0[_0xaa59('0x37')]=qs[_0xaa59('0x37')](_0x512694['query'][_0xaa59('0x37')]);_0x56cee0['offset']=qs[_0xaa59('0x1f')](_0x512694['query'][_0xaa59('0x1f')]);}return _0xa96d9[_0xaa59('0x4f')](_0x56cee0);}})[_0xaa59('0x27')](function(_0x3cd791){if(_0x3cd791){return _0x3cd791?{'count':_0x2174d0,'rows':_0x3cd791}:null;}})[_0xaa59('0x27')](respondWithResult(_0x341344,null))[_0xaa59('0x44')](handleError(_0x341344,null));};exports[_0xaa59('0x52')]=function(_0x206d54,_0x5949d8,_0x3de698){return db['Action'][_0xaa59('0x49')]({'where':{'id':_0x206d54['params']['id']}})[_0xaa59('0x27')](handleEntityNotFound(_0x5949d8,null))[_0xaa59('0x27')](function(_0x53bdc3){if(_0x53bdc3){return _0x53bdc3[_0xaa59('0x52')](_0x206d54['body'][_0xaa59('0x4d')],_[_0xaa59('0x4e')](_0x206d54[_0xaa59('0x4a')],['ids','id'])||{});}})['then'](respondWithResult(_0x5949d8,null))[_0xaa59('0x44')](handleError(_0x5949d8,null));};exports[_0xaa59('0x53')]=function(_0x523e51,_0x230123,_0x345875){var _0x1f8a4f={};var _0x3e7431={};var _0x5a2551;var _0x7ef6c8;return db[_0xaa59('0x40')][_0xaa59('0x54')]({'where':{'id':_0x523e51[_0xaa59('0x46')]['id']}})[_0xaa59('0x27')](handleEntityNotFound(_0x230123,null))[_0xaa59('0x27')](function(_0x284ce0){if(_0x284ce0){_0x5a2551=_0x284ce0;_0x3e7431['model']=_['keys'](db[_0xaa59('0x55')][_0xaa59('0x2b')]);_0x3e7431['query']=_['keys'](_0x523e51['query']);_0x3e7431[_0xaa59('0x32')]=_[_0xaa59('0x33')](_0x3e7431[_0xaa59('0x2e')],_0x3e7431[_0xaa59('0x30')]);_0x1f8a4f[_0xaa59('0x34')]=_['intersection'](_0x3e7431[_0xaa59('0x2e')],qs[_0xaa59('0x47')](_0x523e51[_0xaa59('0x30')][_0xaa59('0x47')]));_0x1f8a4f[_0xaa59('0x34')]=_0x1f8a4f[_0xaa59('0x34')][_0xaa59('0x35')]?_0x1f8a4f[_0xaa59('0x34')]:_0x3e7431['model'];_0x1f8a4f[_0xaa59('0x50')]=qs[_0xaa59('0x38')](_0x523e51['query']['sort']);_0x1f8a4f[_0xaa59('0x39')]=qs[_0xaa59('0x32')](_[_0xaa59('0x3a')](_0x523e51[_0xaa59('0x30')],_0x3e7431[_0xaa59('0x32')]));if(_0x523e51[_0xaa59('0x30')]['filter']){_0x1f8a4f['where']=_[_0xaa59('0x3c')](_0x1f8a4f[_0xaa59('0x39')],{'$or':_['map'](_0x1f8a4f[_0xaa59('0x34')],function(_0x5d6984){var _0x49644={};_0x49644[_0x5d6984]={'$like':'%'+_0x523e51[_0xaa59('0x30')][_0xaa59('0x3b')]+'%'};return _0x49644;})});}_0x1f8a4f=_[_0xaa59('0x3c')]({},_0x1f8a4f,_0x523e51[_0xaa59('0x3f')]);return _0x5a2551[_0xaa59('0x53')](_0x1f8a4f);}})[_0xaa59('0x27')](function(_0x1a9225){if(_0x1a9225){_0x7ef6c8=_0x1a9225[_0xaa59('0x35')];if(!_0x523e51[_0xaa59('0x30')][_0xaa59('0x36')](_0xaa59('0x51'))){_0x1f8a4f[_0xaa59('0x37')]=qs[_0xaa59('0x37')](_0x523e51[_0xaa59('0x30')][_0xaa59('0x37')]);_0x1f8a4f[_0xaa59('0x1f')]=qs[_0xaa59('0x1f')](_0x523e51[_0xaa59('0x30')][_0xaa59('0x1f')]);}return _0x5a2551[_0xaa59('0x53')](_0x1f8a4f);}})[_0xaa59('0x27')](function(_0x3e6a23){if(_0x3e6a23){return _0x3e6a23?{'count':_0x7ef6c8,'rows':_0x3e6a23}:null;}})[_0xaa59('0x27')](respondWithResult(_0x230123,null))[_0xaa59('0x44')](handleError(_0x230123,null));};
\ No newline at end of file
+var _0x9589=['fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','addConditions','Condition','omit','ids','getConditions','findOne','order','addActions','getActions','Action','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Automation'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x9589,0x122));var _0x9958=function(_0xa6876a,_0x5bd2fb){_0xa6876a=_0xa6876a-0x0;var _0x106b65=_0x9589[_0xa6876a];return _0x106b65;};'use strict';var emlformat=require(_0x9958('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9958('0x1'));var jsonpatch=require(_0x9958('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9958('0x3'));var Mustache=require(_0x9958('0x4'));var util=require('util');var path=require(_0x9958('0x5'));var sox=require(_0x9958('0x6'));var csv=require(_0x9958('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9958('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9958('0x9'));var jsforce=require(_0x9958('0xa'));var deskjs=require(_0x9958('0xb'));var toCsv=require(_0x9958('0x7'));var querystring=require(_0x9958('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9958('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9958('0xe'));var hardwareService=require(_0x9958('0xf'));var logger=require(_0x9958('0x10'))(_0x9958('0x11'));var utils=require(_0x9958('0x12'));var config=require(_0x9958('0x13'));var licenseUtil=require(_0x9958('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18da26,_0x1f9268){_0x1f9268=_0x1f9268||0xcc;return function(_0x1d2153){if(_0x1d2153){return _0x18da26[_0x9958('0x15')](_0x1f9268);}return _0x18da26[_0x9958('0x16')](_0x1f9268)[_0x9958('0x17')]();};}function respondWithResult(_0x3f457d,_0x37aa7b){_0x37aa7b=_0x37aa7b||0xc8;return function(_0x4a18de){if(_0x4a18de){return _0x3f457d[_0x9958('0x16')](_0x37aa7b)['json'](_0x4a18de);}};}function respondWithFilteredResult(_0x2ec24b,_0x17752f){return function(_0x4342bf){if(_0x4342bf){var _0xa78b17=typeof _0x17752f[_0x9958('0x18')]==='undefined'&&typeof _0x17752f[_0x9958('0x19')]==='undefined';var _0x1584b6=_0x4342bf[_0x9958('0x1a')];var _0x3ffaa4=_0xa78b17?0x0:_0x17752f[_0x9958('0x18')];var _0x300724=_0xa78b17?_0x4342bf['count']:_0x17752f[_0x9958('0x18')]+_0x17752f[_0x9958('0x19')];var _0x318767;if(_0x300724>=_0x1584b6){_0x300724=_0x1584b6;_0x318767=0xc8;}else{_0x318767=0xce;}_0x2ec24b['status'](_0x318767);return _0x2ec24b[_0x9958('0x1b')]('Content-Range',_0x3ffaa4+'-'+_0x300724+'/'+_0x1584b6)[_0x9958('0x1c')](_0x4342bf);}return null;};}function patchUpdates(_0xd27bbd){return function(_0x589557){try{jsonpatch[_0x9958('0x1d')](_0x589557,_0xd27bbd,!![]);}catch(_0x392976){return BPromise[_0x9958('0x1e')](_0x392976);}return _0x589557[_0x9958('0x1f')]();};}function saveUpdates(_0x56537d,_0x179169){return function(_0x58551d){if(_0x58551d){return _0x58551d[_0x9958('0x20')](_0x56537d)['then'](function(_0x2c1114){return _0x2c1114;});}return null;};}function removeEntity(_0x30c80f,_0x3a1246){return function(_0x42a452){if(_0x42a452){return _0x42a452[_0x9958('0x21')]()[_0x9958('0x22')](function(){_0x30c80f['status'](0xcc)[_0x9958('0x17')]();});}};}function handleEntityNotFound(_0xc08de9,_0x28a458){return function(_0x17f67b){if(!_0x17f67b){_0xc08de9[_0x9958('0x15')](0x194);}return _0x17f67b;};}function handleError(_0x2e316d,_0x328d1c){_0x328d1c=_0x328d1c||0x1f4;return function(_0x2d2e52){logger[_0x9958('0x23')](_0x2d2e52[_0x9958('0x24')]);if(_0x2d2e52['name']){delete _0x2d2e52[_0x9958('0x25')];}_0x2e316d[_0x9958('0x16')](_0x328d1c)[_0x9958('0x26')](_0x2d2e52);};}exports[_0x9958('0x27')]=function(_0x1a4423,_0x13abf7){var _0x2b77e1={},_0x5d1e9b={},_0x27c123={'count':0x0,'rows':[]};var _0x34544e=_[_0x9958('0x28')](db[_0x9958('0x29')]['rawAttributes'],function(_0x833ded){return{'name':_0x833ded[_0x9958('0x2a')],'type':_0x833ded[_0x9958('0x2b')][_0x9958('0x2c')]};});_0x5d1e9b['model']=_[_0x9958('0x28')](_0x34544e,'name');_0x5d1e9b[_0x9958('0x2d')]=_[_0x9958('0x2e')](_0x1a4423['query']);_0x5d1e9b['filters']=_[_0x9958('0x2f')](_0x5d1e9b[_0x9958('0x30')],_0x5d1e9b[_0x9958('0x2d')]);_0x2b77e1[_0x9958('0x31')]=_[_0x9958('0x2f')](_0x5d1e9b['model'],qs[_0x9958('0x32')](_0x1a4423[_0x9958('0x2d')]['fields']));_0x2b77e1[_0x9958('0x31')]=_0x2b77e1['attributes']['length']?_0x2b77e1['attributes']:_0x5d1e9b[_0x9958('0x30')];if(!_0x1a4423[_0x9958('0x2d')][_0x9958('0x33')](_0x9958('0x34'))){_0x2b77e1['limit']=qs[_0x9958('0x19')](_0x1a4423[_0x9958('0x2d')][_0x9958('0x19')]);_0x2b77e1[_0x9958('0x18')]=qs[_0x9958('0x18')](_0x1a4423['query']['offset']);}_0x2b77e1['order']=qs[_0x9958('0x35')](_0x1a4423[_0x9958('0x2d')][_0x9958('0x35')]);_0x2b77e1[_0x9958('0x36')]=qs[_0x9958('0x37')](_[_0x9958('0x38')](_0x1a4423['query'],_0x5d1e9b['filters']),_0x34544e);if(_0x1a4423[_0x9958('0x2d')][_0x9958('0x39')]){_0x2b77e1[_0x9958('0x36')]=_[_0x9958('0x3a')](_0x2b77e1[_0x9958('0x36')],{'$or':_[_0x9958('0x28')](_0x34544e,function(_0xd71e6f){if(_0xd71e6f[_0x9958('0x2b')]!==_0x9958('0x3b')){var _0x582ee6={};_0x582ee6[_0xd71e6f['name']]={'$like':'%'+_0x1a4423[_0x9958('0x2d')][_0x9958('0x39')]+'%'};return _0x582ee6;}})});}_0x2b77e1=_[_0x9958('0x3a')]({},_0x2b77e1,_0x1a4423[_0x9958('0x3c')]);var _0xbcf443={'where':_0x2b77e1[_0x9958('0x36')]};return db[_0x9958('0x29')][_0x9958('0x1a')](_0xbcf443)[_0x9958('0x22')](function(_0x4962e0){_0x27c123[_0x9958('0x1a')]=_0x4962e0;if(_0x1a4423['query'][_0x9958('0x3d')]){_0x2b77e1[_0x9958('0x3e')]=[{'all':!![]}];}return db[_0x9958('0x29')][_0x9958('0x3f')](_0x2b77e1);})['then'](function(_0x440475){_0x27c123[_0x9958('0x40')]=_0x440475;return _0x27c123;})[_0x9958('0x22')](respondWithFilteredResult(_0x13abf7,_0x2b77e1))['catch'](handleError(_0x13abf7,null));};exports[_0x9958('0x41')]=function(_0x16e371,_0xd76a70){var _0x26b27f={'raw':![],'where':{'id':_0x16e371[_0x9958('0x42')]['id']}},_0x4c7a09={};_0x4c7a09[_0x9958('0x30')]=_[_0x9958('0x2e')](db[_0x9958('0x29')][_0x9958('0x43')]);_0x4c7a09['query']=_['keys'](_0x16e371[_0x9958('0x2d')]);_0x4c7a09[_0x9958('0x37')]=_[_0x9958('0x2f')](_0x4c7a09['model'],_0x4c7a09[_0x9958('0x2d')]);_0x26b27f['attributes']=_[_0x9958('0x2f')](_0x4c7a09[_0x9958('0x30')],qs[_0x9958('0x32')](_0x16e371['query'][_0x9958('0x32')]));_0x26b27f[_0x9958('0x31')]=_0x26b27f['attributes'][_0x9958('0x44')]?_0x26b27f[_0x9958('0x31')]:_0x4c7a09[_0x9958('0x30')];if(_0x16e371[_0x9958('0x2d')][_0x9958('0x3d')]){_0x26b27f['include']=[{'all':!![]}];}_0x26b27f=_[_0x9958('0x3a')]({},_0x26b27f,_0x16e371[_0x9958('0x3c')]);return db[_0x9958('0x29')][_0x9958('0x45')](_0x26b27f)['then'](handleEntityNotFound(_0xd76a70,null))['then'](respondWithResult(_0xd76a70,null))[_0x9958('0x46')](handleError(_0xd76a70,null));};exports[_0x9958('0x47')]=function(_0x4116f0,_0x2847f9){return db[_0x9958('0x29')]['create'](_0x4116f0[_0x9958('0x48')],{})[_0x9958('0x22')](respondWithResult(_0x2847f9,0xc9))[_0x9958('0x46')](handleError(_0x2847f9,null));};exports['update']=function(_0x45b070,_0x2b083c){if(_0x45b070[_0x9958('0x48')]['id']){delete _0x45b070[_0x9958('0x48')]['id'];}return db[_0x9958('0x29')][_0x9958('0x45')]({'where':{'id':_0x45b070['params']['id']}})[_0x9958('0x22')](handleEntityNotFound(_0x2b083c,null))[_0x9958('0x22')](saveUpdates(_0x45b070['body'],null))[_0x9958('0x22')](respondWithResult(_0x2b083c,null))[_0x9958('0x46')](handleError(_0x2b083c,null));};exports['destroy']=function(_0xa48256,_0x387c42){return db[_0x9958('0x29')][_0x9958('0x45')]({'where':{'id':_0xa48256[_0x9958('0x42')]['id']}})['then'](handleEntityNotFound(_0x387c42,null))['then'](removeEntity(_0x387c42,null))[_0x9958('0x46')](handleError(_0x387c42,null));};exports[_0x9958('0x49')]=function(_0x1c9266,_0x20463f,_0x34231d){return db[_0x9958('0x4a')][_0x9958('0x45')]({'where':{'id':_0x1c9266['params']['id']}})[_0x9958('0x22')](handleEntityNotFound(_0x20463f,null))[_0x9958('0x22')](function(_0x38acf7){if(_0x38acf7){return _0x38acf7[_0x9958('0x49')](_0x1c9266[_0x9958('0x48')]['ids'],_[_0x9958('0x4b')](_0x1c9266[_0x9958('0x48')],[_0x9958('0x4c'),'id'])||{});}})[_0x9958('0x22')](respondWithResult(_0x20463f,null))[_0x9958('0x46')](handleError(_0x20463f,null));};exports[_0x9958('0x4d')]=function(_0x15a59b,_0x543644,_0xfee4ab){var _0x584a7f={};var _0x81557a={};var _0x4204b7;var _0x325b94;return db['Automation'][_0x9958('0x4e')]({'where':{'id':_0x15a59b['params']['id']}})[_0x9958('0x22')](handleEntityNotFound(_0x543644,null))[_0x9958('0x22')](function(_0x523df7){if(_0x523df7){_0x4204b7=_0x523df7;_0x81557a[_0x9958('0x30')]=_[_0x9958('0x2e')](db[_0x9958('0x4a')]['rawAttributes']);_0x81557a['query']=_['keys'](_0x15a59b[_0x9958('0x2d')]);_0x81557a['filters']=_[_0x9958('0x2f')](_0x81557a[_0x9958('0x30')],_0x81557a[_0x9958('0x2d')]);_0x584a7f[_0x9958('0x31')]=_[_0x9958('0x2f')](_0x81557a[_0x9958('0x30')],qs['fields'](_0x15a59b[_0x9958('0x2d')][_0x9958('0x32')]));_0x584a7f[_0x9958('0x31')]=_0x584a7f[_0x9958('0x31')][_0x9958('0x44')]?_0x584a7f[_0x9958('0x31')]:_0x81557a[_0x9958('0x30')];_0x584a7f[_0x9958('0x4f')]=qs[_0x9958('0x35')](_0x15a59b[_0x9958('0x2d')][_0x9958('0x35')]);_0x584a7f[_0x9958('0x36')]=qs[_0x9958('0x37')](_['pick'](_0x15a59b[_0x9958('0x2d')],_0x81557a['filters']));if(_0x15a59b['query']['filter']){_0x584a7f[_0x9958('0x36')]=_[_0x9958('0x3a')](_0x584a7f[_0x9958('0x36')],{'$or':_[_0x9958('0x28')](_0x584a7f[_0x9958('0x31')],function(_0x5080d4){var _0x1b0aef={};_0x1b0aef[_0x5080d4]={'$like':'%'+_0x15a59b[_0x9958('0x2d')][_0x9958('0x39')]+'%'};return _0x1b0aef;})});}_0x584a7f=_['merge']({},_0x584a7f,_0x15a59b[_0x9958('0x3c')]);return _0x4204b7[_0x9958('0x4d')](_0x584a7f);}})[_0x9958('0x22')](function(_0x402af0){if(_0x402af0){_0x325b94=_0x402af0[_0x9958('0x44')];if(!_0x15a59b[_0x9958('0x2d')]['hasOwnProperty'](_0x9958('0x34'))){_0x584a7f['limit']=qs['limit'](_0x15a59b[_0x9958('0x2d')][_0x9958('0x19')]);_0x584a7f[_0x9958('0x18')]=qs[_0x9958('0x18')](_0x15a59b['query'][_0x9958('0x18')]);}return _0x4204b7[_0x9958('0x4d')](_0x584a7f);}})[_0x9958('0x22')](function(_0x539003){if(_0x539003){return _0x539003?{'count':_0x325b94,'rows':_0x539003}:null;}})[_0x9958('0x22')](respondWithResult(_0x543644,null))[_0x9958('0x46')](handleError(_0x543644,null));};exports[_0x9958('0x50')]=function(_0x26564d,_0x174010,_0x425b16){return db['Action'][_0x9958('0x45')]({'where':{'id':_0x26564d[_0x9958('0x42')]['id']}})['then'](handleEntityNotFound(_0x174010,null))[_0x9958('0x22')](function(_0x2febe2){if(_0x2febe2){return _0x2febe2[_0x9958('0x50')](_0x26564d[_0x9958('0x48')][_0x9958('0x4c')],_[_0x9958('0x4b')](_0x26564d[_0x9958('0x48')],[_0x9958('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x174010,null))[_0x9958('0x46')](handleError(_0x174010,null));};exports[_0x9958('0x51')]=function(_0x409a27,_0x1f2f29,_0x1b1f8d){var _0xe1bd9f={};var _0x123502={};var _0x3c4a1e;var _0x269cf4;return db[_0x9958('0x29')][_0x9958('0x4e')]({'where':{'id':_0x409a27[_0x9958('0x42')]['id']}})['then'](handleEntityNotFound(_0x1f2f29,null))[_0x9958('0x22')](function(_0x3ad016){if(_0x3ad016){_0x3c4a1e=_0x3ad016;_0x123502[_0x9958('0x30')]=_[_0x9958('0x2e')](db[_0x9958('0x52')]['rawAttributes']);_0x123502[_0x9958('0x2d')]=_['keys'](_0x409a27[_0x9958('0x2d')]);_0x123502[_0x9958('0x37')]=_[_0x9958('0x2f')](_0x123502['model'],_0x123502[_0x9958('0x2d')]);_0xe1bd9f[_0x9958('0x31')]=_[_0x9958('0x2f')](_0x123502[_0x9958('0x30')],qs[_0x9958('0x32')](_0x409a27['query'][_0x9958('0x32')]));_0xe1bd9f[_0x9958('0x31')]=_0xe1bd9f[_0x9958('0x31')][_0x9958('0x44')]?_0xe1bd9f[_0x9958('0x31')]:_0x123502['model'];_0xe1bd9f[_0x9958('0x4f')]=qs['sort'](_0x409a27[_0x9958('0x2d')]['sort']);_0xe1bd9f[_0x9958('0x36')]=qs[_0x9958('0x37')](_[_0x9958('0x38')](_0x409a27[_0x9958('0x2d')],_0x123502[_0x9958('0x37')]));if(_0x409a27[_0x9958('0x2d')][_0x9958('0x39')]){_0xe1bd9f[_0x9958('0x36')]=_['merge'](_0xe1bd9f[_0x9958('0x36')],{'$or':_[_0x9958('0x28')](_0xe1bd9f[_0x9958('0x31')],function(_0x38d943){var _0x4b310c={};_0x4b310c[_0x38d943]={'$like':'%'+_0x409a27[_0x9958('0x2d')][_0x9958('0x39')]+'%'};return _0x4b310c;})});}_0xe1bd9f=_['merge']({},_0xe1bd9f,_0x409a27[_0x9958('0x3c')]);return _0x3c4a1e[_0x9958('0x51')](_0xe1bd9f);}})['then'](function(_0xa5087a){if(_0xa5087a){_0x269cf4=_0xa5087a['length'];if(!_0x409a27[_0x9958('0x2d')][_0x9958('0x33')](_0x9958('0x34'))){_0xe1bd9f['limit']=qs[_0x9958('0x19')](_0x409a27[_0x9958('0x2d')][_0x9958('0x19')]);_0xe1bd9f['offset']=qs[_0x9958('0x18')](_0x409a27[_0x9958('0x2d')][_0x9958('0x18')]);}return _0x3c4a1e['getActions'](_0xe1bd9f);}})[_0x9958('0x22')](function(_0xb041e5){if(_0xb041e5){return _0xb041e5?{'count':_0x269cf4,'rows':_0xb041e5}:null;}})[_0x9958('0x22')](respondWithResult(_0x1f2f29,null))[_0x9958('0x46')](handleError(_0x1f2f29,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index e4d9492..093d414 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 _0x9708=['tools_automations','lodash','util','../../config/logger','api','bluebird','path','./automation.attributes','exports','define','Automation'];(function(_0x5c2b1f,_0x266443){var _0x55d367=function(_0xeb5790){while(--_0xeb5790){_0x5c2b1f['push'](_0x5c2b1f['shift']());}};_0x55d367(++_0x266443);}(_0x9708,0x85));var _0x8970=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0x9708[_0x221b8c];return _0x3fab9f;};'use strict';var _=require(_0x8970('0x0'));var util=require(_0x8970('0x1'));var logger=require(_0x8970('0x2'))(_0x8970('0x3'));var moment=require('moment');var BPromise=require(_0x8970('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8970('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8970('0x6'));module[_0x8970('0x7')]=function(_0x507dd5,_0x44b40a){return _0x507dd5[_0x8970('0x8')](_0x8970('0x9'),attributes,{'tableName':_0x8970('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2955=['moment','request-promise','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','../../config/logger','api'];(function(_0x3c1dd0,_0x490ac1){var _0x5f3c86=function(_0x389c40){while(--_0x389c40){_0x3c1dd0['push'](_0x3c1dd0['shift']());}};_0x5f3c86(++_0x490ac1);}(_0x2955,0x1ad));var _0x5295=function(_0x39fd87,_0x38899c){_0x39fd87=_0x39fd87-0x0;var _0x36a842=_0x2955[_0x39fd87];return _0x36a842;};'use strict';var _=require(_0x5295('0x0'));var util=require('util');var logger=require(_0x5295('0x1'))(_0x5295('0x2'));var moment=require(_0x5295('0x3'));var BPromise=require('bluebird');var rp=require(_0x5295('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5295('0x5'));var attributes=require(_0x5295('0x6'));module['exports']=function(_0x2b13c2,_0x1a6ddf){return _0x2b13c2['define'](_0x5295('0x7'),attributes,{'tableName':_0x5295('0x8'),'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 b9dbfb8..cfb9219 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 _0x8f4c=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0xc5c9ac,_0x57c492){var _0x3f4606=function(_0x2aa448){while(--_0x2aa448){_0xc5c9ac['push'](_0xc5c9ac['shift']());}};_0x3f4606(++_0x57c492);}(_0x8f4c,0x113));var _0xc8f4=function(_0x560239,_0xc329f6){_0x560239=_0x560239-0x0;var _0x344a6c=_0x8f4c[_0x560239];return _0x344a6c;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x520063,_0x373506,_0x48c39d){return new BPromise(function(_0x3ea9a2,_0x3a9ab1){return client[_0xc8f4('0xa')](_0x520063,_0x48c39d)[_0xc8f4('0xb')](function(_0x34f05f){logger['info'](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));logger[_0xc8f4('0xe')](_0xc8f4('0xf'),_0x373506,'request\x20sent',JSON[_0xc8f4('0x10')](_0x34f05f));if(_0x34f05f['error']){if(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x12')]===0x1f4){logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')]['message']);return _0x3a9ab1(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);}logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);return _0x3ea9a2(_0x34f05f['error'][_0xc8f4('0x13')]);}else{logger[_0xc8f4('0x14')](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));_0x3ea9a2(_0x34f05f[_0xc8f4('0x15')]['message']);}})[_0xc8f4('0x16')](function(_0x4d2b77){logger['error'](_0xc8f4('0xc'),_0x373506,_0x4d2b77);_0x3a9ab1(_0x4d2b77);});});}
\ No newline at end of file
+var _0x9f37=['lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x281224,_0x1e5fc1){var _0x343216=function(_0x16a98d){while(--_0x16a98d){_0x281224['push'](_0x281224['shift']());}};_0x343216(++_0x1e5fc1);}(_0x9f37,0xd1));var _0x79f3=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x9f37[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var moment=require('moment');var BPromise=require(_0x79f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79f3('0x3'))['db'];var utils=require(_0x79f3('0x4'));var logger=require(_0x79f3('0x5'))('rpc');var config=require(_0x79f3('0x6'));var jayson=require(_0x79f3('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x171940,_0x42b440,_0x2ad818){return new BPromise(function(_0xe4ed49,_0x59efc6){return client[_0x79f3('0x8')](_0x171940,_0x2ad818)[_0x79f3('0x9')](function(_0x4b4562){logger[_0x79f3('0xa')](_0x79f3('0xb'),_0x42b440,_0x79f3('0xc'));logger[_0x79f3('0xd')](_0x79f3('0xe'),_0x42b440,'request\x20sent',JSON[_0x79f3('0xf')](_0x4b4562));if(_0x4b4562[_0x79f3('0x10')]){if(_0x4b4562['error']['code']===0x1f4){logger[_0x79f3('0x10')](_0x79f3('0xb'),_0x42b440,_0x4b4562[_0x79f3('0x10')][_0x79f3('0x11')]);return _0x59efc6(_0x4b4562['error'][_0x79f3('0x11')]);}logger[_0x79f3('0x10')](_0x79f3('0xb'),_0x42b440,_0x4b4562[_0x79f3('0x10')][_0x79f3('0x11')]);return _0xe4ed49(_0x4b4562[_0x79f3('0x10')]['message']);}else{logger['info'](_0x79f3('0xb'),_0x42b440,_0x79f3('0xc'));_0xe4ed49(_0x4b4562['result'][_0x79f3('0x11')]);}})[_0x79f3('0x12')](function(_0x23874b){logger[_0x79f3('0x10')]('Automation,\x20%s,\x20%s',_0x42b440,_0x23874b);_0x59efc6(_0x23874b);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index f9a78f5..441cab3 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 _0xc964=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','post','create','/:id/actions','update','destroy','exports'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xc964,0x7e));var _0x4c96=function(_0x17fc43,_0x4a5a33){_0x17fc43=_0x17fc43-0x0;var _0x2691dc=_0xc964[_0x17fc43];return _0x2691dc;};'use strict';var multer=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var path=require('path');var timeout=require(_0x4c96('0x2'));var express=require(_0x4c96('0x3'));var router=express[_0x4c96('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4c96('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4c96('0x6'));var controller=require(_0x4c96('0x7'));router[_0x4c96('0x8')]('/',auth[_0x4c96('0x9')](),controller[_0x4c96('0xa')]);router[_0x4c96('0x8')](_0x4c96('0xb'),auth['isAuthenticated'](),controller[_0x4c96('0xc')]);router[_0x4c96('0x8')](_0x4c96('0xd'),auth['isAuthenticated'](),controller[_0x4c96('0xe')]);router[_0x4c96('0x8')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x4c96('0xf')]('/',auth[_0x4c96('0x9')](),controller[_0x4c96('0x10')]);router['post'](_0x4c96('0xd'),auth['isAuthenticated'](),controller['addConditions']);router[_0x4c96('0xf')](_0x4c96('0x11'),auth[_0x4c96('0x9')](),controller['addActions']);router['put'](_0x4c96('0xb'),auth[_0x4c96('0x9')](),controller[_0x4c96('0x12')]);router['delete'](_0x4c96('0xb'),auth[_0x4c96('0x9')](),controller[_0x4c96('0x13')]);module[_0x4c96('0x14')]=router;
\ No newline at end of file
+var _0xf429=['fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','index','get','/:id','isAuthenticated','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','exports','util','path','connect-timeout','Router'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0xf429,0xd4));var _0x9f42=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xf429[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require(_0x9f42('0x0'));var path=require(_0x9f42('0x1'));var timeout=require(_0x9f42('0x2'));var express=require('express');var router=express[_0x9f42('0x3')]();var fs_extra=require(_0x9f42('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f42('0x5'));var config=require(_0x9f42('0x6'));var controller=require(_0x9f42('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f42('0x8')]);router[_0x9f42('0x9')](_0x9f42('0xa'),auth[_0x9f42('0xb')](),controller['show']);router['get'](_0x9f42('0xc'),auth['isAuthenticated'](),controller[_0x9f42('0xd')]);router['get'](_0x9f42('0xe'),auth[_0x9f42('0xb')](),controller[_0x9f42('0xf')]);router[_0x9f42('0x10')]('/',auth[_0x9f42('0xb')](),controller[_0x9f42('0x11')]);router['post'](_0x9f42('0xc'),auth['isAuthenticated'](),controller[_0x9f42('0x12')]);router[_0x9f42('0x10')](_0x9f42('0xe'),auth[_0x9f42('0xb')](),controller[_0x9f42('0x13')]);router[_0x9f42('0x14')]('/:id',auth[_0x9f42('0xb')](),controller[_0x9f42('0x15')]);router[_0x9f42('0x16')](_0x9f42('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x9f42('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 0e3db79..842b70a 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 _0xf131=['Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','STRING','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#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)','07:00-22:00,*,*,*','ENUM','always','never','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4f637c,_0xb5e9de){var _0x307ee7=function(_0x3751d4){while(--_0x3751d4){_0x4f637c['push'](_0x4f637c['shift']());}};_0x307ee7(++_0xb5e9de);}(_0xf131,0x19d));var _0x1f13=function(_0x2f0b2c,_0x69226){_0x2f0b2c=_0x2f0b2c-0x0;var _0x4a4793=_0xf131[_0x2f0b2c];return _0x4a4793;};'use strict';var Sequelize=require(_0x1f13('0x0'));module[_0x1f13('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1f13('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1f13('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1f13('0x4')},'limitCalls':{'type':Sequelize[_0x1f13('0x5')](0x4)[_0x1f13('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1f13('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1f13('0x3')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1f13('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f13('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f13('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f13('0x8')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f13('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1f13('0x5')](0x5)[_0x1f13('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f13('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1f13('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1f13('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f13('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f13('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1f13('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1f13('0x3')],'defaultValue':_0x1f13('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x1f13('0xe')](_0x1f13('0xf'),_0x1f13('0x10'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1f13('0x11')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1f13('0x5')](0x9)[_0x1f13('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1f13('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x1f13('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1f13('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1f13('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1f13('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1f13('0x5')](0x9)[_0x1f13('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f13('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1f13('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1f13('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1f13('0x5')](0x9)[_0x1f13('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1f13('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1f13('0x5')](0x9)[_0x1f13('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1f13('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1f13('0x5')](0x5)[_0x1f13('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1f13('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1f13('0x5')](0x9)[_0x1f13('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f13('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1f13('0xe')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x1f13('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1f13('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f13('0x1b')},'dialCutDigit':{'type':Sequelize[_0x1f13('0x5')](0x3)[_0x1f13('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f13('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f13('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f13('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1f13('0x5')](0x5)[_0x1f13('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f13('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x1f13('0x5')](0x5)[_0x1f13('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f13('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f13('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1f13('0x5')](0x5)[_0x1f13('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f13('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x1f13('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f13('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1f13('0x5')](0x5)[_0x1f13('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f13('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1f13('0x5')](0x3)[_0x1f13('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1f13('0x5')](0x5)[_0x1f13('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f13('0x24')}};
\ No newline at end of file
+var _0x539d=['#Drop\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','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\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x167b84,_0x3233e2){var _0x30d147=function(_0xf8f1a6){while(--_0xf8f1a6){_0x167b84['push'](_0x167b84['shift']());}};_0x30d147(++_0x3233e2);}(_0x539d,0xc9));var _0xd539=function(_0x5adb18,_0x222326){_0x5adb18=_0x5adb18-0x0;var _0x420c98=_0x539d[_0x5adb18];return _0x420c98;};'use strict';var Sequelize=require(_0xd539('0x0'));module[_0xd539('0x1')]={'name':{'type':Sequelize[_0xd539('0x2')],'unique':_0xd539('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd539('0x4')](_0xd539('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xd539('0x2')]},'active':{'type':Sequelize[_0xd539('0x6')],'defaultValue':0x0,'comment':_0xd539('0x7')},'limitCalls':{'type':Sequelize[_0xd539('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd539('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd539('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd539('0x8')](0x3)[_0xd539('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd539('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd539('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd539('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xd539('0x8')](0x3)[_0xd539('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd539('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd539('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd539('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd539('0x8')](0x3)[_0xd539('0xa')],'defaultValue':0x3,'comment':_0xd539('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd539('0x8')](0x5)[_0xd539('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd539('0x8')](0x3)[_0xd539('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd539('0x10')},'dialTimezone':{'type':Sequelize[_0xd539('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd539('0x2')],'defaultValue':_0xd539('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xd539('0x4')](_0xd539('0x12'),'never',_0xd539('0x13')),'defaultValue':_0xd539('0x12')},'dialAMDActive':{'type':Sequelize[_0xd539('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd539('0x8')](0x9)[_0xd539('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd539('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xd539('0x8')](0x9)[_0xd539('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd539('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd539('0x8')](0x9)[_0xd539('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd539('0x8')](0x9)[_0xd539('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd539('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd539('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd539('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd539('0x8')](0x9)[_0xd539('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd539('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd539('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd539('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd539('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd539('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd539('0x4')](_0xd539('0x1a'),_0xd539('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd539('0x8')](0x3)[_0xd539('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xd539('0x8')](0x3)[_0xd539('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd539('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd539('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd539('0x8')](0x5)[_0xd539('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd539('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd539('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xd539('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd539('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd539('0x8')](0x5)[_0xd539('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd539('0x8')](0x3)[_0xd539('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd539('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd539('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd539('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd539('0x20')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index df05761..6dacac9 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 _0x49f8=['count','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','Campaign','fieldName','map','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','type','VIRTUAL','merge','options','includeAll','include','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','getHoppers','findOne','hasOwnProperty','CampaignId','filter','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','NOW()','ListId\x20=\x20?','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2dd1a2,_0xeea860){var _0x3f2e18=function(_0x49cd65){while(--_0x49cd65){_0x2dd1a2['push'](_0x2dd1a2['shift']());}};_0x3f2e18(++_0xeea860);}(_0x49f8,0xff));var _0x849f=function(_0x298f26,_0x20cbf2){_0x298f26=_0x298f26-0x0;var _0x4bd7a8=_0x49f8[_0x298f26];return _0x4bd7a8;};'use strict';var emlformat=require(_0x849f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x849f('0x1'));var rp=require(_0x849f('0x2'));var moment=require('moment');var BPromise=require(_0x849f('0x3'));var Mustache=require('mustache');var util=require(_0x849f('0x4'));var path=require('path');var sox=require(_0x849f('0x5'));var csv=require('to-csv');var ejs=require(_0x849f('0x6'));var fs=require('fs');var fs_extra=require(_0x849f('0x7'));var _=require(_0x849f('0x8'));var squel=require(_0x849f('0x9'));var crypto=require(_0x849f('0xa'));var jsforce=require(_0x849f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x849f('0xc'));var Redis=require(_0x849f('0xd'));var authService=require(_0x849f('0xe'));var qs=require(_0x849f('0xf'));var as=require(_0x849f('0x10'));var hardwareService=require(_0x849f('0x11'));var logger=require(_0x849f('0x12'))('api');var utils=require(_0x849f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x849f('0x14'));var db=require(_0x849f('0x15'))['db'];function respondWithStatusCode(_0x401480,_0x23c0ef){_0x23c0ef=_0x23c0ef||0xcc;return function(_0x58dede){if(_0x58dede){return _0x401480[_0x849f('0x16')](_0x23c0ef);}return _0x401480[_0x849f('0x17')](_0x23c0ef)[_0x849f('0x18')]();};}function respondWithResult(_0x425d0c,_0x176936){_0x176936=_0x176936||0xc8;return function(_0x49901e){if(_0x49901e){return _0x425d0c['status'](_0x176936)[_0x849f('0x19')](_0x49901e);}};}function respondWithFilteredResult(_0x5952d7,_0x26845f){return function(_0x204330){if(_0x204330){var _0x45b940=typeof _0x26845f[_0x849f('0x1a')]===_0x849f('0x1b')&&typeof _0x26845f[_0x849f('0x1c')]===_0x849f('0x1b');var _0x5ed88d=_0x204330[_0x849f('0x1d')];var _0x20bea7=_0x45b940?0x0:_0x26845f[_0x849f('0x1a')];var _0x541cd6=_0x45b940?_0x204330[_0x849f('0x1d')]:_0x26845f[_0x849f('0x1a')]+_0x26845f['limit'];var _0x1ca1d6;if(_0x541cd6>=_0x5ed88d){_0x541cd6=_0x5ed88d;_0x1ca1d6=0xc8;}else{_0x1ca1d6=0xce;}_0x5952d7[_0x849f('0x17')](_0x1ca1d6);return _0x5952d7['set']('Content-Range',_0x20bea7+'-'+_0x541cd6+'/'+_0x5ed88d)[_0x849f('0x19')](_0x204330);}return null;};}function patchUpdates(_0x11d183){return function(_0x1dc579){try{jsonpatch[_0x849f('0x1e')](_0x1dc579,_0x11d183,!![]);}catch(_0x24414f){return BPromise[_0x849f('0x1f')](_0x24414f);}return _0x1dc579[_0x849f('0x20')]();};}function saveUpdates(_0x2af70d,_0x4b29f1){return function(_0x1d0da5){if(_0x1d0da5){return _0x1d0da5[_0x849f('0x21')](_0x2af70d)[_0x849f('0x22')](function(_0x2229c0){return _0x2229c0;});}return null;};}function removeEntity(_0x909e11,_0x4fdf55){return function(_0x3a5724){if(_0x3a5724){return _0x3a5724[_0x849f('0x23')]()[_0x849f('0x22')](function(){var _0xe404c6=_0x3a5724[_0x849f('0x24')]({'plain':!![]});var _0x264e89=_0x849f('0x25');return db[_0x849f('0x26')][_0x849f('0x23')]({'where':{'type':_0x264e89,'resourceId':_0xe404c6['id']}})[_0x849f('0x22')](function(){return _0x3a5724;});})[_0x849f('0x22')](function(){_0x909e11[_0x849f('0x17')](0xcc)[_0x849f('0x18')]();});}};}function handleEntityNotFound(_0x529c3b,_0x3c3f0a){return function(_0x4aadde){if(!_0x4aadde){_0x529c3b[_0x849f('0x16')](0x194);}return _0x4aadde;};}function handleError(_0xf27d76,_0x3afe16){_0x3afe16=_0x3afe16||0x1f4;return function(_0x295008){logger[_0x849f('0x27')](_0x295008[_0x849f('0x28')]);if(_0x295008['name']){delete _0x295008[_0x849f('0x29')];}_0xf27d76[_0x849f('0x17')](_0x3afe16)[_0x849f('0x2a')](_0x295008);};}exports['index']=function(_0x347c93,_0x5b8580){var _0x2398a6={},_0x2ffa0a={},_0x7facd0={'count':0x0,'rows':[]};var _0xb29717=_['map'](db[_0x849f('0x2b')]['rawAttributes'],function(_0x492407){return{'name':_0x492407[_0x849f('0x2c')],'type':_0x492407['type']['key']};});_0x2ffa0a['model']=_[_0x849f('0x2d')](_0xb29717,_0x849f('0x29'));_0x2ffa0a[_0x849f('0x2e')]=_[_0x849f('0x2f')](_0x347c93[_0x849f('0x2e')]);_0x2ffa0a['filters']=_[_0x849f('0x30')](_0x2ffa0a[_0x849f('0x31')],_0x2ffa0a[_0x849f('0x2e')]);_0x2398a6[_0x849f('0x32')]=_[_0x849f('0x30')](_0x2ffa0a[_0x849f('0x31')],qs[_0x849f('0x33')](_0x347c93[_0x849f('0x2e')][_0x849f('0x33')]));_0x2398a6[_0x849f('0x32')]=_0x2398a6['attributes']['length']?_0x2398a6[_0x849f('0x32')]:_0x2ffa0a[_0x849f('0x31')];if(!_0x347c93[_0x849f('0x2e')]['hasOwnProperty'](_0x849f('0x34'))){_0x2398a6[_0x849f('0x1c')]=qs[_0x849f('0x1c')](_0x347c93[_0x849f('0x2e')]['limit']);_0x2398a6[_0x849f('0x1a')]=qs[_0x849f('0x1a')](_0x347c93[_0x849f('0x2e')][_0x849f('0x1a')]);}_0x2398a6[_0x849f('0x35')]=qs[_0x849f('0x36')](_0x347c93[_0x849f('0x2e')]['sort']);_0x2398a6[_0x849f('0x37')]=qs[_0x849f('0x38')](_[_0x849f('0x39')](_0x347c93['query'],_0x2ffa0a['filters']),_0xb29717);if(_0x347c93[_0x849f('0x2e')]['filter']){_0x2398a6[_0x849f('0x37')]=_['merge'](_0x2398a6[_0x849f('0x37')],{'$or':_[_0x849f('0x2d')](_0xb29717,function(_0x5eeb92){if(_0x5eeb92[_0x849f('0x3a')]!==_0x849f('0x3b')){var _0x1a5e28={};_0x1a5e28[_0x5eeb92[_0x849f('0x29')]]={'$like':'%'+_0x347c93['query']['filter']+'%'};return _0x1a5e28;}})});}_0x2398a6=_[_0x849f('0x3c')]({},_0x2398a6,_0x347c93[_0x849f('0x3d')]);var _0x4aa91b={'where':_0x2398a6[_0x849f('0x37')]};return db[_0x849f('0x2b')][_0x849f('0x1d')](_0x4aa91b)['then'](function(_0x29e808){_0x7facd0[_0x849f('0x1d')]=_0x29e808;if(_0x347c93[_0x849f('0x2e')][_0x849f('0x3e')]){_0x2398a6[_0x849f('0x3f')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x2398a6);})[_0x849f('0x22')](function(_0x2a7ed9){_0x7facd0['rows']=_0x2a7ed9;return _0x7facd0;})[_0x849f('0x22')](respondWithFilteredResult(_0x5b8580,_0x2398a6))[_0x849f('0x40')](handleError(_0x5b8580,null));};exports['show']=function(_0x2826f2,_0x138c78){var _0x1d6733={'raw':![],'where':{'id':_0x2826f2[_0x849f('0x41')]['id']}},_0x2276db={};_0x2276db[_0x849f('0x31')]=_[_0x849f('0x2f')](db[_0x849f('0x2b')][_0x849f('0x42')]);_0x2276db[_0x849f('0x2e')]=_[_0x849f('0x2f')](_0x2826f2[_0x849f('0x2e')]);_0x2276db[_0x849f('0x38')]=_[_0x849f('0x30')](_0x2276db['model'],_0x2276db[_0x849f('0x2e')]);_0x1d6733[_0x849f('0x32')]=_[_0x849f('0x30')](_0x2276db[_0x849f('0x31')],qs[_0x849f('0x33')](_0x2826f2[_0x849f('0x2e')]['fields']));_0x1d6733[_0x849f('0x32')]=_0x1d6733[_0x849f('0x32')][_0x849f('0x43')]?_0x1d6733[_0x849f('0x32')]:_0x2276db[_0x849f('0x31')];if(_0x2826f2['query'][_0x849f('0x3e')]){_0x1d6733['include']=[{'all':!![]}];}_0x1d6733=_[_0x849f('0x3c')]({},_0x1d6733,_0x2826f2[_0x849f('0x3d')]);return db[_0x849f('0x2b')][_0x849f('0x44')](_0x1d6733)[_0x849f('0x22')](handleEntityNotFound(_0x138c78,null))[_0x849f('0x22')](respondWithResult(_0x138c78,null))['catch'](handleError(_0x138c78,null));};exports[_0x849f('0x45')]=function(_0x1d7be3,_0x3f63fd){return db[_0x849f('0x2b')][_0x849f('0x45')](_0x1d7be3[_0x849f('0x46')],{})[_0x849f('0x22')](function(_0x3eafbc){var _0x20469e=_0x1d7be3[_0x849f('0x47')][_0x849f('0x24')]({'plain':!![]});if(!_0x20469e)throw new Error(_0x849f('0x48'));if(_0x20469e[_0x849f('0x49')]===_0x849f('0x47')){var _0x36e27c=_0x3eafbc[_0x849f('0x24')]({'plain':!![]});var _0x396abd='IvrCampaigns';return db[_0x849f('0x4a')]['find']({'where':{'name':_0x396abd,'userProfileId':_0x20469e[_0x849f('0x4b')]},'raw':!![]})[_0x849f('0x22')](function(_0x35dafb){if(_0x35dafb&&_0x35dafb[_0x849f('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x36e27c['name'],'resourceId':_0x36e27c['id'],'type':_0x35dafb['name'],'sectionId':_0x35dafb['id']},{})['then'](function(){return _0x3eafbc;});}else{return _0x3eafbc;}})['catch'](function(_0x1f6117){logger[_0x849f('0x27')](_0x849f('0x4d'),_0x1f6117);throw _0x1f6117;});}return _0x3eafbc;})[_0x849f('0x22')](respondWithResult(_0x3f63fd,0xc9))[_0x849f('0x40')](handleError(_0x3f63fd,null));};exports[_0x849f('0x4e')]=function(_0x3f653,_0x53add4){var _0x2ae2bc={'where':{'id':_0x3f653[_0x849f('0x41')]['id']}},_0xa7d9e2={};_0xa7d9e2[_0x849f('0x31')]=_[_0x849f('0x2f')](db[_0x849f('0x2b')][_0x849f('0x42')]);_0x2ae2bc[_0x849f('0x32')]=_['intersection'](_0xa7d9e2['model'],qs[_0x849f('0x33')](_0x3f653[_0x849f('0x2e')][_0x849f('0x33')]));_0x2ae2bc[_0x849f('0x32')]=_0x2ae2bc[_0x849f('0x32')][_0x849f('0x43')]?_0x2ae2bc[_0x849f('0x32')]:_0xa7d9e2[_0x849f('0x31')];if(_0x3f653[_0x849f('0x2e')][_0x849f('0x3e')]){_0x2ae2bc['include']=[{'all':!![]}];}_0x2ae2bc=_['merge']({},_0x2ae2bc,_0x3f653[_0x849f('0x3d')]);return db[_0x849f('0x2b')][_0x849f('0x44')](_0x2ae2bc)[_0x849f('0x22')](handleEntityNotFound(_0x53add4,null))[_0x849f('0x22')](function(_0xaee663){if(_0xaee663){var _0x548052=_0xaee663['get']({'plain':!![]});_0x548052=qs[_0x849f('0x4f')](_0x548052,['id','createdAt',_0x849f('0x50')]);_0x3f653['body']=_[_0x849f('0x4f')](_0x3f653[_0x849f('0x46')],['id',_0x849f('0x51'),_0x849f('0x50')]);return db[_0x849f('0x2b')][_0x849f('0x45')](_[_0x849f('0x3c')](_0x548052,_0x3f653['body']),{'include':_0x3f653[_0x849f('0x2e')][_0x849f('0x3e')]?[{'all':!![]}]:undefined})[_0x849f('0x22')](function(_0x36e35d){var _0x3a03d9=_0x3f653[_0x849f('0x47')][_0x849f('0x24')]({'plain':!![]});if(!_0x3a03d9)throw new Error(_0x849f('0x48'));if(_0x3a03d9[_0x849f('0x49')]==='user'){var _0x224535=_0x36e35d[_0x849f('0x24')]({'plain':!![]});var _0x15bc9a='IvrCampaigns';return db[_0x849f('0x4a')][_0x849f('0x44')]({'where':{'name':_0x15bc9a,'userProfileId':_0x3a03d9[_0x849f('0x4b')]},'raw':!![]})[_0x849f('0x22')](function(_0x236dda){if(_0x236dda&&_0x236dda['autoAssociation']===0x0){return db['UserProfileResource'][_0x849f('0x45')]({'name':_0x224535[_0x849f('0x29')],'resourceId':_0x224535['id'],'type':_0x236dda[_0x849f('0x29')],'sectionId':_0x236dda['id']},{})[_0x849f('0x22')](function(){return _0x36e35d;});}else{return _0x36e35d;}})['catch'](function(_0x1ed924){logger[_0x849f('0x27')](_0x849f('0x4d'),_0x1ed924);throw _0x1ed924;});}return _0x36e35d;});}})[_0x849f('0x22')](respondWithResult(_0x53add4,0xc9))['catch'](handleError(_0x53add4,null));};exports[_0x849f('0x21')]=function(_0x5e69fa,_0x11f379){if(_0x5e69fa[_0x849f('0x46')]['id']){delete _0x5e69fa[_0x849f('0x46')]['id'];}return db['Campaign']['find']({'where':{'id':_0x5e69fa[_0x849f('0x41')]['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x11f379,null))[_0x849f('0x22')](saveUpdates(_0x5e69fa[_0x849f('0x46')],null))[_0x849f('0x22')](respondWithResult(_0x11f379,null))[_0x849f('0x40')](handleError(_0x11f379,null));};exports[_0x849f('0x23')]=function(_0x53a5a9,_0x1c799e){return db[_0x849f('0x2b')][_0x849f('0x44')]({'where':{'id':_0x53a5a9[_0x849f('0x41')]['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x1c799e,null))['then'](removeEntity(_0x1c799e,null))['catch'](handleError(_0x1c799e,null));};exports[_0x849f('0x52')]=function(_0xd2b076,_0x2f8178,_0x28a0d2){var _0x2e9dec={'raw':!![],'where':{}};var _0xb03561={};var _0x2d9494={'count':0x0,'rows':[]};return db[_0x849f('0x2b')][_0x849f('0x53')]({'where':{'id':_0xd2b076[_0x849f('0x41')]['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x2f8178,null))[_0x849f('0x22')](function(_0x5f1192){if(_0x5f1192){_0xb03561['model']=_[_0x849f('0x2f')](db['CmHopper'][_0x849f('0x42')]);_0xb03561[_0x849f('0x2e')]=_[_0x849f('0x2f')](_0xd2b076[_0x849f('0x2e')]);_0xb03561[_0x849f('0x38')]=_[_0x849f('0x30')](_0xb03561[_0x849f('0x31')],_0xb03561[_0x849f('0x2e')]);_0x2e9dec[_0x849f('0x32')]=_[_0x849f('0x30')](_0xb03561[_0x849f('0x31')],qs[_0x849f('0x33')](_0xd2b076['query'][_0x849f('0x33')]));_0x2e9dec['attributes']=_0x2e9dec[_0x849f('0x32')][_0x849f('0x43')]?_0x2e9dec[_0x849f('0x32')]:_0xb03561[_0x849f('0x31')];if(!_0xd2b076[_0x849f('0x2e')][_0x849f('0x54')](_0x849f('0x34'))){_0x2e9dec[_0x849f('0x1c')]=qs[_0x849f('0x1c')](_0xd2b076[_0x849f('0x2e')][_0x849f('0x1c')]);_0x2e9dec[_0x849f('0x1a')]=qs[_0x849f('0x1a')](_0xd2b076[_0x849f('0x2e')][_0x849f('0x1a')]);}_0x2e9dec[_0x849f('0x35')]=qs[_0x849f('0x36')](_0xd2b076['query'][_0x849f('0x36')]);_0x2e9dec['where']=qs[_0x849f('0x38')](_[_0x849f('0x39')](_0xd2b076['query'],_0xb03561[_0x849f('0x38')]));_0x2e9dec['where'][_0x849f('0x55')]=_0x5f1192['id'];if(_0xd2b076[_0x849f('0x2e')][_0x849f('0x56')]){_0x2e9dec[_0x849f('0x37')]=_[_0x849f('0x3c')](_0x2e9dec[_0x849f('0x37')],{'$or':_['map'](_0x2e9dec[_0x849f('0x32')],function(_0x21617b){var _0xd29499={};_0xd29499[_0x21617b]={'$like':'%'+_0xd2b076[_0x849f('0x2e')][_0x849f('0x56')]+'%'};return _0xd29499;})});}_0x2e9dec=_[_0x849f('0x3c')]({},_0x2e9dec,_0xd2b076[_0x849f('0x3d')]);return db[_0x849f('0x57')][_0x849f('0x1d')]({'where':_0x2e9dec[_0x849f('0x37')]})[_0x849f('0x22')](function(_0x14c88f){_0x2d9494[_0x849f('0x1d')]=_0x14c88f;if(_0xd2b076[_0x849f('0x2e')][_0x849f('0x3e')]){_0x2e9dec[_0x849f('0x3f')]=[{'all':!![]}];}return db[_0x849f('0x57')][_0x849f('0x58')](_0x2e9dec);})[_0x849f('0x22')](function(_0x28fe31){_0x2d9494[_0x849f('0x59')]=_0x28fe31;return _0x2d9494;});}})['then'](respondWithFilteredResult(_0x2f8178,_0x2e9dec))[_0x849f('0x40')](handleError(_0x2f8178,null));};exports[_0x849f('0x5a')]=function(_0x2694ab,_0x131e03,_0x411003){var _0x586c3e={'raw':!![],'where':{}};var _0x22ebea={};var _0x2d379b={'count':0x0,'rows':[]};return db[_0x849f('0x2b')][_0x849f('0x53')]({'where':{'id':_0x2694ab[_0x849f('0x41')]['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x131e03,null))['then'](function(_0x3cf132){if(_0x3cf132){_0x22ebea[_0x849f('0x31')]=_[_0x849f('0x2f')](db[_0x849f('0x5b')][_0x849f('0x42')]);_0x22ebea[_0x849f('0x2e')]=_['keys'](_0x2694ab['query']);_0x22ebea['filters']=_['intersection'](_0x22ebea[_0x849f('0x31')],_0x22ebea[_0x849f('0x2e')]);_0x586c3e['attributes']=_['intersection'](_0x22ebea[_0x849f('0x31')],qs[_0x849f('0x33')](_0x2694ab[_0x849f('0x2e')]['fields']));_0x586c3e[_0x849f('0x32')]=_0x586c3e[_0x849f('0x32')][_0x849f('0x43')]?_0x586c3e['attributes']:_0x22ebea[_0x849f('0x31')];if(!_0x2694ab[_0x849f('0x2e')][_0x849f('0x54')](_0x849f('0x34'))){_0x586c3e['limit']=qs['limit'](_0x2694ab['query'][_0x849f('0x1c')]);_0x586c3e[_0x849f('0x1a')]=qs[_0x849f('0x1a')](_0x2694ab[_0x849f('0x2e')]['offset']);}_0x586c3e[_0x849f('0x35')]=qs['sort'](_0x2694ab[_0x849f('0x2e')]['sort']);_0x586c3e['where']=qs[_0x849f('0x38')](_[_0x849f('0x39')](_0x2694ab[_0x849f('0x2e')],_0x22ebea[_0x849f('0x38')]));_0x586c3e[_0x849f('0x37')][_0x849f('0x55')]=_0x3cf132['id'];if(_0x2694ab['query'][_0x849f('0x56')]){_0x586c3e['where']=_[_0x849f('0x3c')](_0x586c3e[_0x849f('0x37')],{'$or':_[_0x849f('0x2d')](_0x586c3e[_0x849f('0x32')],function(_0x508eb4){var _0xe0c1eb={};_0xe0c1eb[_0x508eb4]={'$like':'%'+_0x2694ab[_0x849f('0x2e')][_0x849f('0x56')]+'%'};return _0xe0c1eb;})});}_0x586c3e=_[_0x849f('0x3c')]({},_0x586c3e,_0x2694ab[_0x849f('0x3d')]);return db[_0x849f('0x5b')][_0x849f('0x1d')]({'where':_0x586c3e[_0x849f('0x37')]})[_0x849f('0x22')](function(_0x533d2d){_0x2d379b[_0x849f('0x1d')]=_0x533d2d;if(_0x2694ab[_0x849f('0x2e')]['includeAll']){_0x586c3e[_0x849f('0x3f')]=[{'all':!![]}];}return db[_0x849f('0x5b')][_0x849f('0x58')](_0x586c3e);})[_0x849f('0x22')](function(_0xb03b73){_0x2d379b[_0x849f('0x59')]=_0xb03b73;return _0x2d379b;});}})['then'](respondWithFilteredResult(_0x131e03,_0x586c3e))[_0x849f('0x40')](handleError(_0x131e03,null));};exports[_0x849f('0x5c')]=function(_0x1bebe0,_0x10d225,_0x1a1dd9){var _0x123eb6={'raw':!![],'where':{}};var _0x2009bc={};var _0x2789f0={'count':0x0,'rows':[]};return db[_0x849f('0x2b')][_0x849f('0x53')]({'where':{'id':_0x1bebe0[_0x849f('0x41')]['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x10d225,null))['then'](function(_0x265b2b){if(_0x265b2b){_0x2009bc['model']=_[_0x849f('0x2f')](db[_0x849f('0x5d')][_0x849f('0x42')]);_0x2009bc['query']=_[_0x849f('0x2f')](_0x1bebe0[_0x849f('0x2e')]);_0x2009bc[_0x849f('0x38')]=_[_0x849f('0x30')](_0x2009bc[_0x849f('0x31')],_0x2009bc[_0x849f('0x2e')]);_0x123eb6[_0x849f('0x32')]=_[_0x849f('0x30')](_0x2009bc[_0x849f('0x31')],qs[_0x849f('0x33')](_0x1bebe0[_0x849f('0x2e')][_0x849f('0x33')]));_0x123eb6[_0x849f('0x32')]=_0x123eb6['attributes'][_0x849f('0x43')]?_0x123eb6['attributes']:_0x2009bc[_0x849f('0x31')];if(!_0x1bebe0[_0x849f('0x2e')]['hasOwnProperty'](_0x849f('0x34'))){_0x123eb6[_0x849f('0x1c')]=qs[_0x849f('0x1c')](_0x1bebe0['query'][_0x849f('0x1c')]);_0x123eb6[_0x849f('0x1a')]=qs[_0x849f('0x1a')](_0x1bebe0[_0x849f('0x2e')]['offset']);}_0x123eb6[_0x849f('0x35')]=qs[_0x849f('0x36')](_0x1bebe0[_0x849f('0x2e')][_0x849f('0x36')]);_0x123eb6[_0x849f('0x37')]=qs['filters'](_['pick'](_0x1bebe0[_0x849f('0x2e')],_0x2009bc[_0x849f('0x38')]));_0x123eb6['where']['CampaignId']=_0x265b2b['id'];if(_0x1bebe0[_0x849f('0x2e')][_0x849f('0x56')]){_0x123eb6[_0x849f('0x37')]=_[_0x849f('0x3c')](_0x123eb6['where'],{'$or':_[_0x849f('0x2d')](_0x123eb6[_0x849f('0x32')],function(_0x3b6f6d){var _0x2f2fb1={};_0x2f2fb1[_0x3b6f6d]={'$like':'%'+_0x1bebe0[_0x849f('0x2e')]['filter']+'%'};return _0x2f2fb1;})});}_0x123eb6=_[_0x849f('0x3c')]({},_0x123eb6,_0x1bebe0[_0x849f('0x3d')]);return db[_0x849f('0x5d')]['count']({'where':_0x123eb6[_0x849f('0x37')]})[_0x849f('0x22')](function(_0x319c14){_0x2789f0[_0x849f('0x1d')]=_0x319c14;if(_0x1bebe0[_0x849f('0x2e')][_0x849f('0x3e')]){_0x123eb6[_0x849f('0x3f')]=[{'all':!![]}];}return db[_0x849f('0x5d')][_0x849f('0x58')](_0x123eb6);})[_0x849f('0x22')](function(_0x2b8355){_0x2789f0[_0x849f('0x59')]=_0x2b8355;return _0x2789f0;});}})['then'](respondWithFilteredResult(_0x10d225,_0x123eb6))['catch'](handleError(_0x10d225,null));};exports[_0x849f('0x5e')]=function(_0x3f51ee,_0x1e3461,_0x302364){var _0xe8d97={'raw':!![],'where':{}};var _0x13b92d={};var _0x2b31ed={'count':0x0,'rows':[]};return db['Campaign'][_0x849f('0x53')]({'where':{'id':_0x3f51ee['params']['id']}})['then'](handleEntityNotFound(_0x1e3461,null))[_0x849f('0x22')](function(_0x26fedc){if(_0x26fedc){_0x13b92d[_0x849f('0x31')]=_[_0x849f('0x2f')](db['CmHopperBlack']['rawAttributes']);_0x13b92d[_0x849f('0x2e')]=_['keys'](_0x3f51ee[_0x849f('0x2e')]);_0x13b92d['filters']=_[_0x849f('0x30')](_0x13b92d[_0x849f('0x31')],_0x13b92d['query']);_0xe8d97['attributes']=_[_0x849f('0x30')](_0x13b92d[_0x849f('0x31')],qs[_0x849f('0x33')](_0x3f51ee[_0x849f('0x2e')]['fields']));_0xe8d97[_0x849f('0x32')]=_0xe8d97[_0x849f('0x32')][_0x849f('0x43')]?_0xe8d97[_0x849f('0x32')]:_0x13b92d[_0x849f('0x31')];if(!_0x3f51ee['query'][_0x849f('0x54')](_0x849f('0x34'))){_0xe8d97[_0x849f('0x1c')]=qs['limit'](_0x3f51ee[_0x849f('0x2e')]['limit']);_0xe8d97[_0x849f('0x1a')]=qs[_0x849f('0x1a')](_0x3f51ee[_0x849f('0x2e')]['offset']);}_0xe8d97[_0x849f('0x35')]=qs[_0x849f('0x36')](_0x3f51ee['query'][_0x849f('0x36')]);_0xe8d97[_0x849f('0x37')]=qs['filters'](_[_0x849f('0x39')](_0x3f51ee[_0x849f('0x2e')],_0x13b92d[_0x849f('0x38')]));_0xe8d97[_0x849f('0x37')][_0x849f('0x55')]=_0x26fedc['id'];if(_0x3f51ee[_0x849f('0x2e')][_0x849f('0x56')]){_0xe8d97[_0x849f('0x37')]=_[_0x849f('0x3c')](_0xe8d97[_0x849f('0x37')],{'$or':_['map'](_0xe8d97[_0x849f('0x32')],function(_0x434659){var _0x34f768={};_0x34f768[_0x434659]={'$like':'%'+_0x3f51ee[_0x849f('0x2e')][_0x849f('0x56')]+'%'};return _0x34f768;})});}_0xe8d97=_[_0x849f('0x3c')]({},_0xe8d97,_0x3f51ee[_0x849f('0x3d')]);return db[_0x849f('0x5f')]['count']({'where':_0xe8d97[_0x849f('0x37')]})[_0x849f('0x22')](function(_0x5925d0){_0x2b31ed[_0x849f('0x1d')]=_0x5925d0;if(_0x3f51ee[_0x849f('0x2e')]['includeAll']){_0xe8d97[_0x849f('0x3f')]=[{'all':!![]}];}return db[_0x849f('0x5f')][_0x849f('0x58')](_0xe8d97);})[_0x849f('0x22')](function(_0x4001aa){_0x2b31ed['rows']=_0x4001aa;return _0x2b31ed;});}})['then'](respondWithFilteredResult(_0x1e3461,_0xe8d97))[_0x849f('0x40')](handleError(_0x1e3461,null));};exports[_0x849f('0x60')]=function(_0x1aa094,_0x282b81,_0x34dcb1){var _0x20cb2a={};var _0x4a628f={};var _0x598a69;var _0x38973f;return db['Campaign'][_0x849f('0x53')]({'where':{'id':_0x1aa094[_0x849f('0x41')]['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x282b81,null))[_0x849f('0x22')](function(_0x26de80){if(_0x26de80){_0x598a69=_0x26de80;_0x4a628f[_0x849f('0x31')]=_[_0x849f('0x2f')](db[_0x849f('0x61')][_0x849f('0x42')]);_0x4a628f[_0x849f('0x2e')]=_[_0x849f('0x2f')](_0x1aa094[_0x849f('0x2e')]);_0x4a628f[_0x849f('0x38')]=_['intersection'](_0x4a628f['model'],_0x4a628f[_0x849f('0x2e')]);_0x20cb2a[_0x849f('0x32')]=_[_0x849f('0x30')](_0x4a628f[_0x849f('0x31')],qs['fields'](_0x1aa094[_0x849f('0x2e')][_0x849f('0x33')]));_0x20cb2a[_0x849f('0x32')]=_0x20cb2a[_0x849f('0x32')][_0x849f('0x43')]?_0x20cb2a[_0x849f('0x32')]:_0x4a628f[_0x849f('0x31')];_0x20cb2a[_0x849f('0x35')]=qs[_0x849f('0x36')](_0x1aa094[_0x849f('0x2e')][_0x849f('0x36')]);_0x20cb2a[_0x849f('0x37')]=qs[_0x849f('0x38')](_[_0x849f('0x39')](_0x1aa094[_0x849f('0x2e')],_0x4a628f[_0x849f('0x38')]));if(_0x1aa094[_0x849f('0x2e')][_0x849f('0x56')]){_0x20cb2a[_0x849f('0x37')]=_[_0x849f('0x3c')](_0x20cb2a['where'],{'$or':_[_0x849f('0x2d')](_0x20cb2a[_0x849f('0x32')],function(_0x24215f){var _0x78bd4={};_0x78bd4[_0x24215f]={'$like':'%'+_0x1aa094['query'][_0x849f('0x56')]+'%'};return _0x78bd4;})});}_0x20cb2a=_[_0x849f('0x3c')]({},_0x20cb2a,_0x1aa094[_0x849f('0x3d')]);return _0x598a69['getLists'](_0x20cb2a);}})['then'](function(_0x28d438){if(_0x28d438){_0x38973f=_0x28d438[_0x849f('0x43')];if(!_0x1aa094[_0x849f('0x2e')][_0x849f('0x54')](_0x849f('0x34'))){_0x20cb2a[_0x849f('0x1c')]=qs[_0x849f('0x1c')](_0x1aa094[_0x849f('0x2e')]['limit']);_0x20cb2a[_0x849f('0x1a')]=qs[_0x849f('0x1a')](_0x1aa094[_0x849f('0x2e')][_0x849f('0x1a')]);}return _0x598a69[_0x849f('0x60')](_0x20cb2a);}})[_0x849f('0x22')](function(_0x337688){if(_0x337688){return _0x337688?{'count':_0x38973f,'rows':_0x337688}:null;}})[_0x849f('0x22')](respondWithResult(_0x282b81,null))[_0x849f('0x40')](handleError(_0x282b81,null));};exports[_0x849f('0x62')]=function(_0x3c084f,_0x113a33,_0x2f59eb){var _0x53d35f,_0x18a2a0;var _0x5f4e27=[];var _0x42f1ef=moment()[_0x849f('0x63')](_0x849f('0x64'));return db[_0x849f('0x2b')][_0x849f('0x44')]({'where':{'id':_0x3c084f['params']['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x113a33,null))[_0x849f('0x22')](function(_0x2508a2){if(_0x2508a2){_0x18a2a0=_0x2508a2;return _0x2508a2[_0x849f('0x62')](_0x3c084f[_0x849f('0x46')]['ids'],_['omit'](_0x3c084f[_0x849f('0x46')],[_0x849f('0x65'),'id'])||{});}return null;})[_0x849f('0x66')](function(_0x4e28c6){var _0x1dbb05;var _0x53dc6e;_0x53d35f=_0x4e28c6||[];var _0x5d9784=[];if(_0x4e28c6){for(var _0x58a26d=0x0;_0x58a26d<_0x4e28c6[_0x849f('0x43')];_0x58a26d+=0x1){var _0x2489f0=_0x4e28c6[_0x58a26d][_0x849f('0x24')]({'plain':!![]});_0x18a2a0['dialCheckDuplicateType']=_0x3c084f[_0x849f('0x46')][_0x849f('0x67')]?_0x3c084f[_0x849f('0x46')][_0x849f('0x67')]:_0x18a2a0['dialCheckDuplicateType'];switch(_0x18a2a0[_0x849f('0x67')]){case'always':_0x1dbb05=squel[_0x849f('0x68')]()[_0x849f('0x69')](_0x849f('0x6a'))['fromQuery']([_0x849f('0x6b'),_0x849f('0x6c'),_0x849f('0x6d'),_0x849f('0x6e'),_0x849f('0x55'),'createdAt',_0x849f('0x50')],squel[_0x849f('0x6f')]()[_0x849f('0x70')](_0x849f('0x6b'),_0x849f('0x6b'))[_0x849f('0x70')]('NOW()',_0x849f('0x6c'))[_0x849f('0x70')]('id',_0x849f('0x6d'))[_0x849f('0x70')](_0x2489f0[_0x849f('0x71')]['toString'](),'ListId')['field'](_0x3c084f[_0x849f('0x41')]['id'][_0x849f('0x72')](),_0x849f('0x55'))['field']('\x27'+_0x42f1ef+'\x27',_0x849f('0x51'))[_0x849f('0x70')]('\x27'+_0x42f1ef+'\x27',_0x849f('0x50'))[_0x849f('0x73')](_0x849f('0x74'))[_0x849f('0x37')](_0x849f('0x75'))[_0x849f('0x37')]('ListId\x20=\x20?',_0x2489f0['CmListId']['toString']())[_0x849f('0x37')](_0x849f('0x76'))[_0x849f('0x37')](_0x849f('0x77'),squel[_0x849f('0x6f')]()[_0x849f('0x70')]('COALESCE(calleridnum,\x27\x27)')[_0x849f('0x73')]('cm_hopper_final')[_0x849f('0x37')](_0x849f('0x78'),_0x3c084f[_0x849f('0x41')]['id'][_0x849f('0x72')]()))[_0x849f('0x37')](_0x849f('0x77'),squel[_0x849f('0x6f')]()[_0x849f('0x70')](_0x849f('0x79'))[_0x849f('0x73')](_0x849f('0x6a'))['where'](_0x849f('0x78'),_0x3c084f[_0x849f('0x41')]['id']['toString']())))[_0x849f('0x72')]();break;case _0x849f('0x7a'):_0x1dbb05=squel[_0x849f('0x68')]()[_0x849f('0x69')](_0x849f('0x6a'))[_0x849f('0x7b')]([_0x849f('0x6b'),_0x849f('0x6c'),'ContactId',_0x849f('0x6e'),_0x849f('0x55'),'createdAt',_0x849f('0x50')],squel[_0x849f('0x6f')]()[_0x849f('0x70')]('phone','phone')[_0x849f('0x70')](_0x849f('0x7c'),_0x849f('0x6c'))['field']('id','ContactId')['field'](_0x2489f0[_0x849f('0x71')][_0x849f('0x72')](),_0x849f('0x6e'))[_0x849f('0x70')](_0x3c084f[_0x849f('0x41')]['id'][_0x849f('0x72')](),'CampaignId')[_0x849f('0x70')]('\x27'+_0x42f1ef+'\x27','createdAt')[_0x849f('0x70')]('\x27'+_0x42f1ef+'\x27','updatedAt')['from'](_0x849f('0x74'))[_0x849f('0x37')](_0x849f('0x75'))[_0x849f('0x37')](_0x849f('0x7d'),_0x2489f0[_0x849f('0x71')][_0x849f('0x72')]())[_0x849f('0x37')](_0x849f('0x76'))['where'](_0x849f('0x77'),squel['select']()[_0x849f('0x70')](_0x849f('0x79'))[_0x849f('0x73')]('cm_hopper')[_0x849f('0x37')](_0x849f('0x78'),_0x3c084f['params']['id'][_0x849f('0x72')]())))['toString']();break;default:_0x1dbb05=squel[_0x849f('0x68')]()[_0x849f('0x69')]('cm_hopper')[_0x849f('0x7b')]([_0x849f('0x6b'),_0x849f('0x6c'),_0x849f('0x6d'),'ListId',_0x849f('0x55'),_0x849f('0x51'),'updatedAt'],squel[_0x849f('0x6f')]()[_0x849f('0x70')]('phone','phone')[_0x849f('0x70')]('NOW()',_0x849f('0x6c'))['field']('id',_0x849f('0x6d'))['field'](_0x2489f0['CmListId'][_0x849f('0x72')](),_0x849f('0x6e'))[_0x849f('0x70')](_0x3c084f['params']['id']['toString'](),'CampaignId')[_0x849f('0x70')]('\x27'+_0x42f1ef+'\x27',_0x849f('0x51'))[_0x849f('0x70')]('\x27'+_0x42f1ef+'\x27',_0x849f('0x50'))[_0x849f('0x73')](_0x849f('0x74'))[_0x849f('0x37')](_0x849f('0x75'))[_0x849f('0x37')](_0x849f('0x7d'),_0x2489f0[_0x849f('0x71')]['toString']())[_0x849f('0x37')](_0x849f('0x76')))['toString']();}_0x53dc6e=squel[_0x849f('0x68')]()['into'](_0x849f('0x7e'))[_0x849f('0x7b')](['cmHopperId',_0x849f('0x6c'),_0x849f('0x6b'),_0x849f('0x7f'),_0x849f('0x51'),_0x849f('0x50')],squel[_0x849f('0x6f')]()[_0x849f('0x70')](_0x849f('0x80'),'id')[_0x849f('0x70')](_0x849f('0x7c'),'scheduledAt')[_0x849f('0x70')](_0x849f('0x81'),_0x849f('0x6b'))[_0x849f('0x70')](_0x849f('0x82'),_0x849f('0x7f'))[_0x849f('0x70')]('\x27'+_0x42f1ef+'\x27','createdAt')[_0x849f('0x70')]('\x27'+_0x42f1ef+'\x27',_0x849f('0x50'))[_0x849f('0x73')]('cm_contact_has_items','ci')['join'](_0x849f('0x6a'),'h',_0x849f('0x83'))['where'](_0x849f('0x84'),_0x2489f0['CmListId'][_0x849f('0x72')]())[_0x849f('0x37')](_0x849f('0x85'),_0x3c084f['params']['id'][_0x849f('0x72')]())[_0x849f('0x37')]('h.createdAt\x20=\x20?',_0x42f1ef))['toString']();_0x5d9784[_0x849f('0x86')](db[_0x849f('0x87')][_0x849f('0x2e')](_0x1dbb05));_0x5f4e27[_0x849f('0x86')](db[_0x849f('0x87')][_0x849f('0x2e')](_0x53dc6e));}return BPromise[_0x849f('0x88')](_0x5d9784);}})[_0x849f('0x22')](function(){return BPromise[_0x849f('0x88')](_0x5f4e27);})['then'](function(){return _0x53d35f;})[_0x849f('0x22')](respondWithResult(_0x113a33,null))[_0x849f('0x40')](handleError(_0x113a33,null));};exports[_0x849f('0x89')]=function(_0x3081f3,_0x242eef,_0x20c8ce){return db[_0x849f('0x2b')][_0x849f('0x44')]({'where':{'id':_0x3081f3[_0x849f('0x41')]['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x242eef,null))[_0x849f('0x22')](function(_0x1c8480){if(_0x1c8480){return _0x1c8480[_0x849f('0x89')](_0x3081f3['query'][_0x849f('0x65')]);}})[_0x849f('0x22')](function(_0x4f0a06){if(_0x4f0a06){return db[_0x849f('0x57')][_0x849f('0x23')]({'where':{'ListId':_0x3081f3[_0x849f('0x2e')]['ids'],'CampaignId':_0x3081f3[_0x849f('0x41')]['id']}})['then'](function(){return _0x4f0a06;});}})[_0x849f('0x22')](respondWithStatusCode(_0x242eef,null))['catch'](handleError(_0x242eef,null));};exports[_0x849f('0x8a')]=function(_0x2fcf8b,_0x2b5821,_0xbfb0d4){var _0x4471bf={};var _0x2e28dd={};var _0x466679;var _0x506c61;return db[_0x849f('0x2b')]['findOne']({'where':{'id':_0x2fcf8b[_0x849f('0x41')]['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x2b5821,null))[_0x849f('0x22')](function(_0x4f4408){if(_0x4f4408){_0x466679=_0x4f4408;_0x2e28dd[_0x849f('0x31')]=_['keys'](db['CmList']['rawAttributes']);_0x2e28dd[_0x849f('0x2e')]=_[_0x849f('0x2f')](_0x2fcf8b['query']);_0x2e28dd[_0x849f('0x38')]=_[_0x849f('0x30')](_0x2e28dd['model'],_0x2e28dd[_0x849f('0x2e')]);_0x4471bf[_0x849f('0x32')]=_[_0x849f('0x30')](_0x2e28dd[_0x849f('0x31')],qs[_0x849f('0x33')](_0x2fcf8b['query']['fields']));_0x4471bf['attributes']=_0x4471bf[_0x849f('0x32')][_0x849f('0x43')]?_0x4471bf[_0x849f('0x32')]:_0x2e28dd[_0x849f('0x31')];_0x4471bf['order']=qs[_0x849f('0x36')](_0x2fcf8b[_0x849f('0x2e')][_0x849f('0x36')]);_0x4471bf[_0x849f('0x37')]=qs[_0x849f('0x38')](_[_0x849f('0x39')](_0x2fcf8b['query'],_0x2e28dd[_0x849f('0x38')]));if(_0x2fcf8b[_0x849f('0x2e')]['filter']){_0x4471bf[_0x849f('0x37')]=_[_0x849f('0x3c')](_0x4471bf[_0x849f('0x37')],{'$or':_['map'](_0x4471bf['attributes'],function(_0x1acbb4){var _0x28cd4a={};_0x28cd4a[_0x1acbb4]={'$like':'%'+_0x2fcf8b['query']['filter']+'%'};return _0x28cd4a;})});}_0x4471bf=_[_0x849f('0x3c')]({},_0x4471bf,_0x2fcf8b[_0x849f('0x3d')]);return _0x466679[_0x849f('0x8a')](_0x4471bf);}})[_0x849f('0x22')](function(_0x254a9b){if(_0x254a9b){_0x506c61=_0x254a9b['length'];if(!_0x2fcf8b['query']['hasOwnProperty']('nolimit')){_0x4471bf[_0x849f('0x1c')]=qs[_0x849f('0x1c')](_0x2fcf8b[_0x849f('0x2e')]['limit']);_0x4471bf[_0x849f('0x1a')]=qs['offset'](_0x2fcf8b[_0x849f('0x2e')][_0x849f('0x1a')]);}return _0x466679[_0x849f('0x8a')](_0x4471bf);}})['then'](function(_0x321683){if(_0x321683){return _0x321683?{'count':_0x506c61,'rows':_0x321683}:null;}})[_0x849f('0x22')](respondWithResult(_0x2b5821,null))[_0x849f('0x40')](handleError(_0x2b5821,null));};exports[_0x849f('0x8b')]=function(_0x54be0d,_0xb93b30,_0x1209d2){var _0x11a23f,_0x119a72;var _0x31a157=[];var _0x2afa28=moment()[_0x849f('0x63')](_0x849f('0x64'));return db[_0x849f('0x2b')]['find']({'where':{'id':_0x54be0d['params']['id']}})['then'](handleEntityNotFound(_0xb93b30,null))[_0x849f('0x22')](function(_0x562aab){if(_0x562aab){_0x119a72=_0x562aab;return _0x562aab[_0x849f('0x8b')](_0x54be0d[_0x849f('0x46')][_0x849f('0x65')],_['omit'](_0x54be0d[_0x849f('0x46')],[_0x849f('0x65'),'id'])||{});}return null;})['spread'](function(_0x271ff7){var _0x216297;var _0x269ab4;_0x11a23f=_0x271ff7||[];var _0x1a7b1f=[];if(_0x271ff7){for(var _0x238f17=0x0;_0x238f17<_0x271ff7[_0x849f('0x43')];_0x238f17+=0x1){var _0x15074e=_0x271ff7[_0x238f17][_0x849f('0x24')]({'plain':!![]});_0x216297=squel['insert']()[_0x849f('0x69')](_0x849f('0x8c'))['fromQuery'](['phone',_0x849f('0x6d'),_0x849f('0x6e'),_0x849f('0x55'),_0x849f('0x51'),_0x849f('0x50')],squel['select']()[_0x849f('0x70')]('phone',_0x849f('0x6b'))[_0x849f('0x70')]('id',_0x849f('0x6d'))[_0x849f('0x70')](_0x15074e[_0x849f('0x71')]['toString'](),_0x849f('0x6e'))[_0x849f('0x70')](_0x54be0d['params']['id'][_0x849f('0x72')](),'CampaignId')[_0x849f('0x70')](_0x849f('0x7c'),_0x849f('0x51'))[_0x849f('0x70')](_0x849f('0x7c'),_0x849f('0x50'))['from'](_0x849f('0x74'))['where'](_0x849f('0x75'))['where'](_0x849f('0x7d'),_0x15074e[_0x849f('0x71')]['toString']())[_0x849f('0x37')](_0x849f('0x76')))[_0x849f('0x72')]();_0x1a7b1f['push'](db[_0x849f('0x87')][_0x849f('0x2e')](_0x216297));}return BPromise['all'](_0x1a7b1f);}})[_0x849f('0x22')](function(){return _0x11a23f;})[_0x849f('0x22')](respondWithResult(_0xb93b30,null))['catch'](handleError(_0xb93b30,null));};exports['removeBlackLists']=function(_0x3e6e01,_0x2ec620,_0x15ff5a){return db[_0x849f('0x2b')][_0x849f('0x44')]({'where':{'id':_0x3e6e01['params']['id']}})[_0x849f('0x22')](handleEntityNotFound(_0x2ec620,null))[_0x849f('0x22')](function(_0x170060){if(_0x170060){return _0x170060[_0x849f('0x8d')](_0x3e6e01[_0x849f('0x2e')][_0x849f('0x65')]);}})[_0x849f('0x22')](function(_0x52d594){if(_0x52d594){return db[_0x849f('0x5f')]['destroy']({'where':{'ListId':_0x3e6e01[_0x849f('0x2e')][_0x849f('0x65')],'CampaignId':_0x3e6e01[_0x849f('0x41')]['id']}})[_0x849f('0x22')](function(){return _0x52d594;});}})['then'](respondWithStatusCode(_0x2ec620,null))['catch'](handleError(_0x2ec620,null));};
\ No newline at end of file
+var _0x57f8=['destroy','then','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','onlyIfOpen','insert','cm_contacts','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','format','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update'];(function(_0x2e8328,_0x540028){var _0x3130e7=function(_0xe755d1){while(--_0xe755d1){_0x2e8328['push'](_0x2e8328['shift']());}};_0x3130e7(++_0x540028);}(_0x57f8,0x198));var _0x857f=function(_0x389a03,_0x380e6c){_0x389a03=_0x389a03-0x0;var _0xaf19ea=_0x57f8[_0x389a03];return _0xaf19ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x857f('0x0'));var zipdir=require(_0x857f('0x1'));var jsonpatch=require(_0x857f('0x2'));var rp=require(_0x857f('0x3'));var moment=require(_0x857f('0x4'));var BPromise=require(_0x857f('0x5'));var Mustache=require(_0x857f('0x6'));var util=require(_0x857f('0x7'));var path=require(_0x857f('0x8'));var sox=require(_0x857f('0x9'));var csv=require(_0x857f('0xa'));var ejs=require(_0x857f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xa'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var licenseUtil=require(_0x857f('0x19'));var db=require(_0x857f('0x1a'))['db'];function respondWithStatusCode(_0x533631,_0x2e1eda){_0x2e1eda=_0x2e1eda||0xcc;return function(_0x2d5e26){if(_0x2d5e26){return _0x533631[_0x857f('0x1b')](_0x2e1eda);}return _0x533631[_0x857f('0x1c')](_0x2e1eda)[_0x857f('0x1d')]();};}function respondWithResult(_0x4a25ec,_0x4bc590){_0x4bc590=_0x4bc590||0xc8;return function(_0x3b09d9){if(_0x3b09d9){return _0x4a25ec['status'](_0x4bc590)[_0x857f('0x1e')](_0x3b09d9);}};}function respondWithFilteredResult(_0x4ac81f,_0x1d47bf){return function(_0x134a4f){if(_0x134a4f){var _0x5c3a69=typeof _0x1d47bf[_0x857f('0x1f')]===_0x857f('0x20')&&typeof _0x1d47bf[_0x857f('0x21')]===_0x857f('0x20');var _0x279e74=_0x134a4f[_0x857f('0x22')];var _0x1a9ef8=_0x5c3a69?0x0:_0x1d47bf[_0x857f('0x1f')];var _0x1014ca=_0x5c3a69?_0x134a4f[_0x857f('0x22')]:_0x1d47bf[_0x857f('0x1f')]+_0x1d47bf['limit'];var _0x1729d8;if(_0x1014ca>=_0x279e74){_0x1014ca=_0x279e74;_0x1729d8=0xc8;}else{_0x1729d8=0xce;}_0x4ac81f[_0x857f('0x1c')](_0x1729d8);return _0x4ac81f['set'](_0x857f('0x23'),_0x1a9ef8+'-'+_0x1014ca+'/'+_0x279e74)[_0x857f('0x1e')](_0x134a4f);}return null;};}function patchUpdates(_0x377587){return function(_0x484035){try{jsonpatch['apply'](_0x484035,_0x377587,!![]);}catch(_0x12ee77){return BPromise[_0x857f('0x24')](_0x12ee77);}return _0x484035[_0x857f('0x25')]();};}function saveUpdates(_0x4fa031,_0x118237){return function(_0x17a98e){if(_0x17a98e){return _0x17a98e[_0x857f('0x26')](_0x4fa031)['then'](function(_0x1961ea){return _0x1961ea;});}return null;};}function removeEntity(_0x14a8ce,_0x50bfb7){return function(_0x3bc543){if(_0x3bc543){return _0x3bc543[_0x857f('0x27')]()[_0x857f('0x28')](function(){var _0x44ff23=_0x3bc543[_0x857f('0x29')]({'plain':!![]});var _0x3b23a7=_0x857f('0x2a');return db[_0x857f('0x2b')][_0x857f('0x27')]({'where':{'type':_0x3b23a7,'resourceId':_0x44ff23['id']}})[_0x857f('0x28')](function(){return _0x3bc543;});})[_0x857f('0x28')](function(){_0x14a8ce[_0x857f('0x1c')](0xcc)[_0x857f('0x1d')]();});}};}function handleEntityNotFound(_0x46761e,_0x570905){return function(_0x17e415){if(!_0x17e415){_0x46761e[_0x857f('0x1b')](0x194);}return _0x17e415;};}function handleError(_0x23afb8,_0x2c5792){_0x2c5792=_0x2c5792||0x1f4;return function(_0x58c2de){logger[_0x857f('0x2c')](_0x58c2de['stack']);if(_0x58c2de[_0x857f('0x2d')]){delete _0x58c2de[_0x857f('0x2d')];}_0x23afb8[_0x857f('0x1c')](_0x2c5792)[_0x857f('0x2e')](_0x58c2de);};}exports[_0x857f('0x2f')]=function(_0x464e8f,_0x1c4fff){var _0xe79241={},_0x17e7b6={},_0x41f832={'count':0x0,'rows':[]};var _0x24adc2=_[_0x857f('0x30')](db[_0x857f('0x31')]['rawAttributes'],function(_0x3078cf){return{'name':_0x3078cf[_0x857f('0x32')],'type':_0x3078cf['type'][_0x857f('0x33')]};});_0x17e7b6[_0x857f('0x34')]=_['map'](_0x24adc2,_0x857f('0x2d'));_0x17e7b6[_0x857f('0x35')]=_['keys'](_0x464e8f[_0x857f('0x35')]);_0x17e7b6[_0x857f('0x36')]=_[_0x857f('0x37')](_0x17e7b6[_0x857f('0x34')],_0x17e7b6['query']);_0xe79241['attributes']=_[_0x857f('0x37')](_0x17e7b6[_0x857f('0x34')],qs['fields'](_0x464e8f[_0x857f('0x35')]['fields']));_0xe79241[_0x857f('0x38')]=_0xe79241[_0x857f('0x38')][_0x857f('0x39')]?_0xe79241[_0x857f('0x38')]:_0x17e7b6[_0x857f('0x34')];if(!_0x464e8f['query']['hasOwnProperty'](_0x857f('0x3a'))){_0xe79241['limit']=qs[_0x857f('0x21')](_0x464e8f[_0x857f('0x35')][_0x857f('0x21')]);_0xe79241['offset']=qs[_0x857f('0x1f')](_0x464e8f[_0x857f('0x35')][_0x857f('0x1f')]);}_0xe79241[_0x857f('0x3b')]=qs[_0x857f('0x3c')](_0x464e8f[_0x857f('0x35')][_0x857f('0x3c')]);_0xe79241['where']=qs[_0x857f('0x36')](_[_0x857f('0x3d')](_0x464e8f[_0x857f('0x35')],_0x17e7b6[_0x857f('0x36')]),_0x24adc2);if(_0x464e8f[_0x857f('0x35')][_0x857f('0x3e')]){_0xe79241[_0x857f('0x3f')]=_['merge'](_0xe79241[_0x857f('0x3f')],{'$or':_[_0x857f('0x30')](_0x24adc2,function(_0xcd5959){if(_0xcd5959[_0x857f('0x40')]!==_0x857f('0x41')){var _0x1c119f={};_0x1c119f[_0xcd5959['name']]={'$like':'%'+_0x464e8f[_0x857f('0x35')][_0x857f('0x3e')]+'%'};return _0x1c119f;}})});}_0xe79241=_[_0x857f('0x42')]({},_0xe79241,_0x464e8f[_0x857f('0x43')]);var _0x3938ee={'where':_0xe79241[_0x857f('0x3f')]};return db[_0x857f('0x31')][_0x857f('0x22')](_0x3938ee)['then'](function(_0x40fb37){_0x41f832[_0x857f('0x22')]=_0x40fb37;if(_0x464e8f[_0x857f('0x35')][_0x857f('0x44')]){_0xe79241[_0x857f('0x45')]=[{'all':!![]}];}return db[_0x857f('0x31')][_0x857f('0x46')](_0xe79241);})[_0x857f('0x28')](function(_0xb4d7c2){_0x41f832[_0x857f('0x47')]=_0xb4d7c2;return _0x41f832;})[_0x857f('0x28')](respondWithFilteredResult(_0x1c4fff,_0xe79241))[_0x857f('0x48')](handleError(_0x1c4fff,null));};exports[_0x857f('0x49')]=function(_0x376f71,_0x5d4c2a){var _0xe0e078={'raw':![],'where':{'id':_0x376f71[_0x857f('0x4a')]['id']}},_0x5b2baa={};_0x5b2baa[_0x857f('0x34')]=_[_0x857f('0x4b')](db[_0x857f('0x31')][_0x857f('0x4c')]);_0x5b2baa[_0x857f('0x35')]=_[_0x857f('0x4b')](_0x376f71[_0x857f('0x35')]);_0x5b2baa[_0x857f('0x36')]=_[_0x857f('0x37')](_0x5b2baa[_0x857f('0x34')],_0x5b2baa['query']);_0xe0e078['attributes']=_[_0x857f('0x37')](_0x5b2baa['model'],qs[_0x857f('0x4d')](_0x376f71['query'][_0x857f('0x4d')]));_0xe0e078[_0x857f('0x38')]=_0xe0e078[_0x857f('0x38')][_0x857f('0x39')]?_0xe0e078[_0x857f('0x38')]:_0x5b2baa[_0x857f('0x34')];if(_0x376f71[_0x857f('0x35')][_0x857f('0x44')]){_0xe0e078['include']=[{'all':!![]}];}_0xe0e078=_[_0x857f('0x42')]({},_0xe0e078,_0x376f71[_0x857f('0x43')]);return db[_0x857f('0x31')][_0x857f('0x4e')](_0xe0e078)['then'](handleEntityNotFound(_0x5d4c2a,null))[_0x857f('0x28')](respondWithResult(_0x5d4c2a,null))[_0x857f('0x48')](handleError(_0x5d4c2a,null));};exports[_0x857f('0x4f')]=function(_0x736ef6,_0x67563){return db['Campaign'][_0x857f('0x4f')](_0x736ef6[_0x857f('0x50')],{})['then'](function(_0xfd1679){var _0x847879=_0x736ef6['user'][_0x857f('0x29')]({'plain':!![]});if(!_0x847879)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x847879[_0x857f('0x51')]===_0x857f('0x52')){var _0x446fe9=_0xfd1679[_0x857f('0x29')]({'plain':!![]});var _0x58bf27=_0x857f('0x2a');return db[_0x857f('0x53')][_0x857f('0x4e')]({'where':{'name':_0x58bf27,'userProfileId':_0x847879[_0x857f('0x54')]},'raw':!![]})[_0x857f('0x28')](function(_0x4f9d24){if(_0x4f9d24&&_0x4f9d24[_0x857f('0x55')]===0x0){return db[_0x857f('0x2b')][_0x857f('0x4f')]({'name':_0x446fe9[_0x857f('0x2d')],'resourceId':_0x446fe9['id'],'type':_0x4f9d24[_0x857f('0x2d')],'sectionId':_0x4f9d24['id']},{})[_0x857f('0x28')](function(){return _0xfd1679;});}else{return _0xfd1679;}})[_0x857f('0x48')](function(_0x59164a){logger[_0x857f('0x2c')](_0x857f('0x56'),_0x59164a);throw _0x59164a;});}return _0xfd1679;})[_0x857f('0x28')](respondWithResult(_0x67563,0xc9))[_0x857f('0x48')](handleError(_0x67563,null));};exports[_0x857f('0x57')]=function(_0x153e4e,_0x4bb5fc){var _0x2cf62c={'where':{'id':_0x153e4e[_0x857f('0x4a')]['id']}},_0xe7e09b={};_0xe7e09b[_0x857f('0x34')]=_[_0x857f('0x4b')](db[_0x857f('0x31')][_0x857f('0x4c')]);_0x2cf62c[_0x857f('0x38')]=_['intersection'](_0xe7e09b['model'],qs[_0x857f('0x4d')](_0x153e4e[_0x857f('0x35')][_0x857f('0x4d')]));_0x2cf62c[_0x857f('0x38')]=_0x2cf62c[_0x857f('0x38')][_0x857f('0x39')]?_0x2cf62c['attributes']:_0xe7e09b[_0x857f('0x34')];if(_0x153e4e[_0x857f('0x35')]['includeAll']){_0x2cf62c[_0x857f('0x45')]=[{'all':!![]}];}_0x2cf62c=_['merge']({},_0x2cf62c,_0x153e4e[_0x857f('0x43')]);return db[_0x857f('0x31')]['find'](_0x2cf62c)[_0x857f('0x28')](handleEntityNotFound(_0x4bb5fc,null))[_0x857f('0x28')](function(_0x3520d3){if(_0x3520d3){var _0x464208=_0x3520d3[_0x857f('0x29')]({'plain':!![]});_0x464208=qs[_0x857f('0x58')](_0x464208,['id',_0x857f('0x59'),_0x857f('0x5a')]);_0x153e4e['body']=_[_0x857f('0x58')](_0x153e4e[_0x857f('0x50')],['id',_0x857f('0x59'),_0x857f('0x5a')]);return db[_0x857f('0x31')][_0x857f('0x4f')](_[_0x857f('0x42')](_0x464208,_0x153e4e[_0x857f('0x50')]),{'include':_0x153e4e[_0x857f('0x35')][_0x857f('0x44')]?[{'all':!![]}]:undefined})[_0x857f('0x28')](function(_0x5631fb){var _0x390f86=_0x153e4e[_0x857f('0x52')][_0x857f('0x29')]({'plain':!![]});if(!_0x390f86)throw new Error(_0x857f('0x5b'));if(_0x390f86['role']===_0x857f('0x52')){var _0x4b6e13=_0x5631fb[_0x857f('0x29')]({'plain':!![]});var _0x36d746=_0x857f('0x2a');return db[_0x857f('0x53')]['find']({'where':{'name':_0x36d746,'userProfileId':_0x390f86['userProfileId']},'raw':!![]})[_0x857f('0x28')](function(_0x3ee981){if(_0x3ee981&&_0x3ee981[_0x857f('0x55')]===0x0){return db['UserProfileResource'][_0x857f('0x4f')]({'name':_0x4b6e13['name'],'resourceId':_0x4b6e13['id'],'type':_0x3ee981[_0x857f('0x2d')],'sectionId':_0x3ee981['id']},{})[_0x857f('0x28')](function(){return _0x5631fb;});}else{return _0x5631fb;}})[_0x857f('0x48')](function(_0x47fa5a){logger['error'](_0x857f('0x56'),_0x47fa5a);throw _0x47fa5a;});}return _0x5631fb;});}})[_0x857f('0x28')](respondWithResult(_0x4bb5fc,0xc9))[_0x857f('0x48')](handleError(_0x4bb5fc,null));};exports[_0x857f('0x26')]=function(_0x41f9d8,_0x3eecda){if(_0x41f9d8[_0x857f('0x50')]['id']){delete _0x41f9d8[_0x857f('0x50')]['id'];}return db['Campaign']['find']({'where':{'id':_0x41f9d8[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x3eecda,null))[_0x857f('0x28')](saveUpdates(_0x41f9d8[_0x857f('0x50')],null))[_0x857f('0x28')](respondWithResult(_0x3eecda,null))[_0x857f('0x48')](handleError(_0x3eecda,null));};exports['destroy']=function(_0x16cfe0,_0x3ac1de){return db[_0x857f('0x31')][_0x857f('0x4e')]({'where':{'id':_0x16cfe0[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x3ac1de,null))[_0x857f('0x28')](removeEntity(_0x3ac1de,null))[_0x857f('0x48')](handleError(_0x3ac1de,null));};exports[_0x857f('0x5c')]=function(_0x338670,_0x4b1110,_0x1cb405){var _0x4a17ea={'raw':!![],'where':{}};var _0x5ec513={};var _0x35cd3e={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x338670[_0x857f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b1110,null))[_0x857f('0x28')](function(_0x4da63c){if(_0x4da63c){_0x5ec513[_0x857f('0x34')]=_[_0x857f('0x4b')](db[_0x857f('0x5d')][_0x857f('0x4c')]);_0x5ec513['query']=_[_0x857f('0x4b')](_0x338670[_0x857f('0x35')]);_0x5ec513[_0x857f('0x36')]=_[_0x857f('0x37')](_0x5ec513[_0x857f('0x34')],_0x5ec513[_0x857f('0x35')]);_0x4a17ea[_0x857f('0x38')]=_['intersection'](_0x5ec513['model'],qs[_0x857f('0x4d')](_0x338670[_0x857f('0x35')][_0x857f('0x4d')]));_0x4a17ea[_0x857f('0x38')]=_0x4a17ea[_0x857f('0x38')][_0x857f('0x39')]?_0x4a17ea['attributes']:_0x5ec513[_0x857f('0x34')];if(!_0x338670[_0x857f('0x35')][_0x857f('0x5e')]('nolimit')){_0x4a17ea['limit']=qs[_0x857f('0x21')](_0x338670['query']['limit']);_0x4a17ea[_0x857f('0x1f')]=qs[_0x857f('0x1f')](_0x338670['query'][_0x857f('0x1f')]);}_0x4a17ea[_0x857f('0x3b')]=qs['sort'](_0x338670[_0x857f('0x35')][_0x857f('0x3c')]);_0x4a17ea[_0x857f('0x3f')]=qs[_0x857f('0x36')](_[_0x857f('0x3d')](_0x338670[_0x857f('0x35')],_0x5ec513[_0x857f('0x36')]));_0x4a17ea[_0x857f('0x3f')][_0x857f('0x5f')]=_0x4da63c['id'];if(_0x338670[_0x857f('0x35')][_0x857f('0x3e')]){_0x4a17ea[_0x857f('0x3f')]=_['merge'](_0x4a17ea['where'],{'$or':_['map'](_0x4a17ea[_0x857f('0x38')],function(_0x310b18){var _0x2c2422={};_0x2c2422[_0x310b18]={'$like':'%'+_0x338670[_0x857f('0x35')][_0x857f('0x3e')]+'%'};return _0x2c2422;})});}_0x4a17ea=_[_0x857f('0x42')]({},_0x4a17ea,_0x338670[_0x857f('0x43')]);return db['CmHopper'][_0x857f('0x22')]({'where':_0x4a17ea['where']})[_0x857f('0x28')](function(_0x4d7b27){_0x35cd3e['count']=_0x4d7b27;if(_0x338670[_0x857f('0x35')]['includeAll']){_0x4a17ea[_0x857f('0x45')]=[{'all':!![]}];}return db[_0x857f('0x5d')][_0x857f('0x46')](_0x4a17ea);})['then'](function(_0x45be3d){_0x35cd3e[_0x857f('0x47')]=_0x45be3d;return _0x35cd3e;});}})[_0x857f('0x28')](respondWithFilteredResult(_0x4b1110,_0x4a17ea))[_0x857f('0x48')](handleError(_0x4b1110,null));};exports[_0x857f('0x60')]=function(_0x8a1d41,_0x11b818,_0x3b8093){var _0x3e7cc1={'raw':!![],'where':{}};var _0x53a75d={};var _0x1f29e5={'count':0x0,'rows':[]};return db[_0x857f('0x31')][_0x857f('0x61')]({'where':{'id':_0x8a1d41[_0x857f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x11b818,null))[_0x857f('0x28')](function(_0x59cdfb){if(_0x59cdfb){_0x53a75d[_0x857f('0x34')]=_[_0x857f('0x4b')](db[_0x857f('0x62')][_0x857f('0x4c')]);_0x53a75d['query']=_[_0x857f('0x4b')](_0x8a1d41['query']);_0x53a75d['filters']=_[_0x857f('0x37')](_0x53a75d[_0x857f('0x34')],_0x53a75d['query']);_0x3e7cc1['attributes']=_[_0x857f('0x37')](_0x53a75d[_0x857f('0x34')],qs[_0x857f('0x4d')](_0x8a1d41[_0x857f('0x35')]['fields']));_0x3e7cc1[_0x857f('0x38')]=_0x3e7cc1[_0x857f('0x38')][_0x857f('0x39')]?_0x3e7cc1[_0x857f('0x38')]:_0x53a75d[_0x857f('0x34')];if(!_0x8a1d41['query']['hasOwnProperty'](_0x857f('0x3a'))){_0x3e7cc1['limit']=qs['limit'](_0x8a1d41[_0x857f('0x35')][_0x857f('0x21')]);_0x3e7cc1[_0x857f('0x1f')]=qs[_0x857f('0x1f')](_0x8a1d41[_0x857f('0x35')][_0x857f('0x1f')]);}_0x3e7cc1[_0x857f('0x3b')]=qs[_0x857f('0x3c')](_0x8a1d41[_0x857f('0x35')][_0x857f('0x3c')]);_0x3e7cc1[_0x857f('0x3f')]=qs[_0x857f('0x36')](_[_0x857f('0x3d')](_0x8a1d41[_0x857f('0x35')],_0x53a75d[_0x857f('0x36')]));_0x3e7cc1[_0x857f('0x3f')][_0x857f('0x5f')]=_0x59cdfb['id'];if(_0x8a1d41[_0x857f('0x35')][_0x857f('0x3e')]){_0x3e7cc1[_0x857f('0x3f')]=_[_0x857f('0x42')](_0x3e7cc1[_0x857f('0x3f')],{'$or':_['map'](_0x3e7cc1['attributes'],function(_0x4cbe64){var _0x2c4bf9={};_0x2c4bf9[_0x4cbe64]={'$like':'%'+_0x8a1d41[_0x857f('0x35')]['filter']+'%'};return _0x2c4bf9;})});}_0x3e7cc1=_[_0x857f('0x42')]({},_0x3e7cc1,_0x8a1d41[_0x857f('0x43')]);return db['CmHopperHistory'][_0x857f('0x22')]({'where':_0x3e7cc1['where']})[_0x857f('0x28')](function(_0x522dff){_0x1f29e5[_0x857f('0x22')]=_0x522dff;if(_0x8a1d41[_0x857f('0x35')][_0x857f('0x44')]){_0x3e7cc1[_0x857f('0x45')]=[{'all':!![]}];}return db[_0x857f('0x62')][_0x857f('0x46')](_0x3e7cc1);})[_0x857f('0x28')](function(_0x18a010){_0x1f29e5[_0x857f('0x47')]=_0x18a010;return _0x1f29e5;});}})['then'](respondWithFilteredResult(_0x11b818,_0x3e7cc1))[_0x857f('0x48')](handleError(_0x11b818,null));};exports['getHopperFinals']=function(_0x302ee3,_0x3a2cfe,_0x4ca37f){var _0x48eace={'raw':!![],'where':{}};var _0x4d9c25={};var _0x14ba78={'count':0x0,'rows':[]};return db[_0x857f('0x31')][_0x857f('0x61')]({'where':{'id':_0x302ee3['params']['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x3a2cfe,null))['then'](function(_0x2df9b8){if(_0x2df9b8){_0x4d9c25[_0x857f('0x34')]=_[_0x857f('0x4b')](db[_0x857f('0x63')]['rawAttributes']);_0x4d9c25[_0x857f('0x35')]=_[_0x857f('0x4b')](_0x302ee3['query']);_0x4d9c25[_0x857f('0x36')]=_['intersection'](_0x4d9c25[_0x857f('0x34')],_0x4d9c25[_0x857f('0x35')]);_0x48eace[_0x857f('0x38')]=_[_0x857f('0x37')](_0x4d9c25[_0x857f('0x34')],qs[_0x857f('0x4d')](_0x302ee3[_0x857f('0x35')][_0x857f('0x4d')]));_0x48eace[_0x857f('0x38')]=_0x48eace['attributes'][_0x857f('0x39')]?_0x48eace[_0x857f('0x38')]:_0x4d9c25['model'];if(!_0x302ee3[_0x857f('0x35')]['hasOwnProperty'](_0x857f('0x3a'))){_0x48eace['limit']=qs[_0x857f('0x21')](_0x302ee3['query'][_0x857f('0x21')]);_0x48eace[_0x857f('0x1f')]=qs[_0x857f('0x1f')](_0x302ee3[_0x857f('0x35')][_0x857f('0x1f')]);}_0x48eace[_0x857f('0x3b')]=qs['sort'](_0x302ee3[_0x857f('0x35')]['sort']);_0x48eace[_0x857f('0x3f')]=qs[_0x857f('0x36')](_['pick'](_0x302ee3[_0x857f('0x35')],_0x4d9c25[_0x857f('0x36')]));_0x48eace[_0x857f('0x3f')]['CampaignId']=_0x2df9b8['id'];if(_0x302ee3[_0x857f('0x35')]['filter']){_0x48eace[_0x857f('0x3f')]=_[_0x857f('0x42')](_0x48eace['where'],{'$or':_[_0x857f('0x30')](_0x48eace['attributes'],function(_0x2e349f){var _0x333b8a={};_0x333b8a[_0x2e349f]={'$like':'%'+_0x302ee3['query'][_0x857f('0x3e')]+'%'};return _0x333b8a;})});}_0x48eace=_[_0x857f('0x42')]({},_0x48eace,_0x302ee3[_0x857f('0x43')]);return db['CmHopperFinal'][_0x857f('0x22')]({'where':_0x48eace[_0x857f('0x3f')]})[_0x857f('0x28')](function(_0x1ea073){_0x14ba78['count']=_0x1ea073;if(_0x302ee3[_0x857f('0x35')][_0x857f('0x44')]){_0x48eace[_0x857f('0x45')]=[{'all':!![]}];}return db[_0x857f('0x63')][_0x857f('0x46')](_0x48eace);})['then'](function(_0x5394a9){_0x14ba78[_0x857f('0x47')]=_0x5394a9;return _0x14ba78;});}})[_0x857f('0x28')](respondWithFilteredResult(_0x3a2cfe,_0x48eace))[_0x857f('0x48')](handleError(_0x3a2cfe,null));};exports[_0x857f('0x64')]=function(_0x1ea377,_0x4f9468,_0x4b1406){var _0x3fed74={'raw':!![],'where':{}};var _0x2e43fd={};var _0x6bdaba={'count':0x0,'rows':[]};return db[_0x857f('0x31')][_0x857f('0x61')]({'where':{'id':_0x1ea377[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x4f9468,null))['then'](function(_0x32f05c){if(_0x32f05c){_0x2e43fd[_0x857f('0x34')]=_['keys'](db[_0x857f('0x65')][_0x857f('0x4c')]);_0x2e43fd[_0x857f('0x35')]=_[_0x857f('0x4b')](_0x1ea377['query']);_0x2e43fd[_0x857f('0x36')]=_[_0x857f('0x37')](_0x2e43fd[_0x857f('0x34')],_0x2e43fd[_0x857f('0x35')]);_0x3fed74[_0x857f('0x38')]=_['intersection'](_0x2e43fd[_0x857f('0x34')],qs[_0x857f('0x4d')](_0x1ea377[_0x857f('0x35')]['fields']));_0x3fed74['attributes']=_0x3fed74[_0x857f('0x38')][_0x857f('0x39')]?_0x3fed74[_0x857f('0x38')]:_0x2e43fd[_0x857f('0x34')];if(!_0x1ea377[_0x857f('0x35')][_0x857f('0x5e')]('nolimit')){_0x3fed74['limit']=qs['limit'](_0x1ea377['query'][_0x857f('0x21')]);_0x3fed74[_0x857f('0x1f')]=qs[_0x857f('0x1f')](_0x1ea377[_0x857f('0x35')][_0x857f('0x1f')]);}_0x3fed74[_0x857f('0x3b')]=qs[_0x857f('0x3c')](_0x1ea377['query'][_0x857f('0x3c')]);_0x3fed74[_0x857f('0x3f')]=qs[_0x857f('0x36')](_[_0x857f('0x3d')](_0x1ea377['query'],_0x2e43fd[_0x857f('0x36')]));_0x3fed74[_0x857f('0x3f')][_0x857f('0x5f')]=_0x32f05c['id'];if(_0x1ea377[_0x857f('0x35')][_0x857f('0x3e')]){_0x3fed74[_0x857f('0x3f')]=_[_0x857f('0x42')](_0x3fed74[_0x857f('0x3f')],{'$or':_['map'](_0x3fed74[_0x857f('0x38')],function(_0x1f2333){var _0xda999={};_0xda999[_0x1f2333]={'$like':'%'+_0x1ea377['query'][_0x857f('0x3e')]+'%'};return _0xda999;})});}_0x3fed74=_[_0x857f('0x42')]({},_0x3fed74,_0x1ea377[_0x857f('0x43')]);return db[_0x857f('0x65')][_0x857f('0x22')]({'where':_0x3fed74[_0x857f('0x3f')]})[_0x857f('0x28')](function(_0x2aa819){_0x6bdaba['count']=_0x2aa819;if(_0x1ea377[_0x857f('0x35')][_0x857f('0x44')]){_0x3fed74['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x3fed74);})[_0x857f('0x28')](function(_0x27290d){_0x6bdaba[_0x857f('0x47')]=_0x27290d;return _0x6bdaba;});}})['then'](respondWithFilteredResult(_0x4f9468,_0x3fed74))[_0x857f('0x48')](handleError(_0x4f9468,null));};exports['getLists']=function(_0xe4e5ef,_0x14c3ac,_0x45ce2e){var _0x19d80f={};var _0x9aadf4={};var _0x14a077;var _0x5a63b8;return db[_0x857f('0x31')][_0x857f('0x61')]({'where':{'id':_0xe4e5ef[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x14c3ac,null))[_0x857f('0x28')](function(_0x4f01ee){if(_0x4f01ee){_0x14a077=_0x4f01ee;_0x9aadf4[_0x857f('0x34')]=_['keys'](db[_0x857f('0x66')][_0x857f('0x4c')]);_0x9aadf4[_0x857f('0x35')]=_[_0x857f('0x4b')](_0xe4e5ef[_0x857f('0x35')]);_0x9aadf4[_0x857f('0x36')]=_[_0x857f('0x37')](_0x9aadf4[_0x857f('0x34')],_0x9aadf4[_0x857f('0x35')]);_0x19d80f['attributes']=_[_0x857f('0x37')](_0x9aadf4[_0x857f('0x34')],qs[_0x857f('0x4d')](_0xe4e5ef[_0x857f('0x35')][_0x857f('0x4d')]));_0x19d80f['attributes']=_0x19d80f[_0x857f('0x38')][_0x857f('0x39')]?_0x19d80f[_0x857f('0x38')]:_0x9aadf4[_0x857f('0x34')];_0x19d80f['order']=qs[_0x857f('0x3c')](_0xe4e5ef[_0x857f('0x35')][_0x857f('0x3c')]);_0x19d80f['where']=qs[_0x857f('0x36')](_[_0x857f('0x3d')](_0xe4e5ef[_0x857f('0x35')],_0x9aadf4[_0x857f('0x36')]));if(_0xe4e5ef[_0x857f('0x35')][_0x857f('0x3e')]){_0x19d80f[_0x857f('0x3f')]=_['merge'](_0x19d80f[_0x857f('0x3f')],{'$or':_[_0x857f('0x30')](_0x19d80f[_0x857f('0x38')],function(_0x27908e){var _0x5c9051={};_0x5c9051[_0x27908e]={'$like':'%'+_0xe4e5ef['query'][_0x857f('0x3e')]+'%'};return _0x5c9051;})});}_0x19d80f=_[_0x857f('0x42')]({},_0x19d80f,_0xe4e5ef[_0x857f('0x43')]);return _0x14a077[_0x857f('0x67')](_0x19d80f);}})['then'](function(_0x1606bf){if(_0x1606bf){_0x5a63b8=_0x1606bf[_0x857f('0x39')];if(!_0xe4e5ef[_0x857f('0x35')][_0x857f('0x5e')](_0x857f('0x3a'))){_0x19d80f['limit']=qs['limit'](_0xe4e5ef['query'][_0x857f('0x21')]);_0x19d80f['offset']=qs[_0x857f('0x1f')](_0xe4e5ef['query']['offset']);}return _0x14a077[_0x857f('0x67')](_0x19d80f);}})[_0x857f('0x28')](function(_0x412ab5){if(_0x412ab5){return _0x412ab5?{'count':_0x5a63b8,'rows':_0x412ab5}:null;}})[_0x857f('0x28')](respondWithResult(_0x14c3ac,null))[_0x857f('0x48')](handleError(_0x14c3ac,null));};exports[_0x857f('0x68')]=function(_0x1113bf,_0x28c2db,_0x4e40d7){var _0x6fcc36,_0x39a738;var _0x35e5a2=[];var _0x13e6ec=moment()['format'](_0x857f('0x69'));return db['Campaign'][_0x857f('0x4e')]({'where':{'id':_0x1113bf[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x28c2db,null))[_0x857f('0x28')](function(_0x4787e0){if(_0x4787e0){_0x39a738=_0x4787e0;return _0x4787e0[_0x857f('0x68')](_0x1113bf[_0x857f('0x50')][_0x857f('0x6a')],_[_0x857f('0x58')](_0x1113bf[_0x857f('0x50')],['ids','id'])||{});}return null;})['spread'](function(_0x37f001){var _0x3e146b;var _0x52f1e2;_0x6fcc36=_0x37f001||[];var _0x17a939=[];if(_0x37f001){for(var _0x570ccc=0x0;_0x570ccc<_0x37f001[_0x857f('0x39')];_0x570ccc+=0x1){var _0x41deb9=_0x37f001[_0x570ccc][_0x857f('0x29')]({'plain':!![]});_0x39a738[_0x857f('0x6b')]=_0x1113bf['body']['dialCheckDuplicateType']?_0x1113bf[_0x857f('0x50')]['dialCheckDuplicateType']:_0x39a738['dialCheckDuplicateType'];switch(_0x39a738['dialCheckDuplicateType']){case _0x857f('0x6c'):_0x3e146b=squel['insert']()[_0x857f('0x6d')](_0x857f('0x6e'))[_0x857f('0x6f')]([_0x857f('0x70'),_0x857f('0x71'),_0x857f('0x72'),_0x857f('0x73'),_0x857f('0x5f'),_0x857f('0x59'),'updatedAt'],squel['select']()[_0x857f('0x74')](_0x857f('0x70'),_0x857f('0x70'))[_0x857f('0x74')](_0x857f('0x75'),'scheduledAt')[_0x857f('0x74')]('id',_0x857f('0x72'))['field'](_0x41deb9[_0x857f('0x76')]['toString'](),_0x857f('0x73'))[_0x857f('0x74')](_0x1113bf['params']['id'][_0x857f('0x77')](),_0x857f('0x5f'))['field']('\x27'+_0x13e6ec+'\x27',_0x857f('0x59'))['field']('\x27'+_0x13e6ec+'\x27',_0x857f('0x5a'))['from']('cm_contacts')['where'](_0x857f('0x78'))[_0x857f('0x3f')](_0x857f('0x79'),_0x41deb9[_0x857f('0x76')][_0x857f('0x77')]())[_0x857f('0x3f')](_0x857f('0x7a'))['where'](_0x857f('0x7b'),squel[_0x857f('0x7c')]()[_0x857f('0x74')](_0x857f('0x7d'))['from']('cm_hopper_final')[_0x857f('0x3f')](_0x857f('0x7e'),_0x1113bf[_0x857f('0x4a')]['id'][_0x857f('0x77')]()))[_0x857f('0x3f')](_0x857f('0x7b'),squel[_0x857f('0x7c')]()[_0x857f('0x74')](_0x857f('0x7f'))[_0x857f('0x80')](_0x857f('0x6e'))[_0x857f('0x3f')](_0x857f('0x7e'),_0x1113bf[_0x857f('0x4a')]['id'][_0x857f('0x77')]())))['toString']();break;case _0x857f('0x81'):_0x3e146b=squel[_0x857f('0x82')]()[_0x857f('0x6d')]('cm_hopper')['fromQuery']([_0x857f('0x70'),_0x857f('0x71'),_0x857f('0x72'),'ListId',_0x857f('0x5f'),_0x857f('0x59'),_0x857f('0x5a')],squel[_0x857f('0x7c')]()[_0x857f('0x74')]('phone','phone')[_0x857f('0x74')]('NOW()',_0x857f('0x71'))[_0x857f('0x74')]('id','ContactId')['field'](_0x41deb9[_0x857f('0x76')]['toString'](),_0x857f('0x73'))[_0x857f('0x74')](_0x1113bf[_0x857f('0x4a')]['id'][_0x857f('0x77')](),_0x857f('0x5f'))[_0x857f('0x74')]('\x27'+_0x13e6ec+'\x27',_0x857f('0x59'))['field']('\x27'+_0x13e6ec+'\x27','updatedAt')[_0x857f('0x80')](_0x857f('0x83'))['where'](_0x857f('0x78'))[_0x857f('0x3f')](_0x857f('0x79'),_0x41deb9[_0x857f('0x76')]['toString']())[_0x857f('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x857f('0x7b'),squel[_0x857f('0x7c')]()['field'](_0x857f('0x7f'))[_0x857f('0x80')](_0x857f('0x6e'))['where'](_0x857f('0x7e'),_0x1113bf[_0x857f('0x4a')]['id'][_0x857f('0x77')]())))[_0x857f('0x77')]();break;default:_0x3e146b=squel[_0x857f('0x82')]()[_0x857f('0x6d')](_0x857f('0x6e'))[_0x857f('0x6f')]([_0x857f('0x70'),_0x857f('0x71'),'ContactId',_0x857f('0x73'),_0x857f('0x5f'),'createdAt',_0x857f('0x5a')],squel[_0x857f('0x7c')]()[_0x857f('0x74')](_0x857f('0x70'),_0x857f('0x70'))[_0x857f('0x74')](_0x857f('0x75'),_0x857f('0x71'))['field']('id',_0x857f('0x72'))[_0x857f('0x74')](_0x41deb9[_0x857f('0x76')][_0x857f('0x77')](),_0x857f('0x73'))['field'](_0x1113bf[_0x857f('0x4a')]['id'][_0x857f('0x77')](),_0x857f('0x5f'))[_0x857f('0x74')]('\x27'+_0x13e6ec+'\x27',_0x857f('0x59'))[_0x857f('0x74')]('\x27'+_0x13e6ec+'\x27',_0x857f('0x5a'))[_0x857f('0x80')](_0x857f('0x83'))[_0x857f('0x3f')]('deletedAt\x20IS\x20NULL')[_0x857f('0x3f')](_0x857f('0x79'),_0x41deb9[_0x857f('0x76')]['toString']())['where'](_0x857f('0x7a')))[_0x857f('0x77')]();}_0x52f1e2=squel['insert']()['into'](_0x857f('0x84'))['fromQuery'](['cmHopperId',_0x857f('0x71'),_0x857f('0x70'),_0x857f('0x85'),_0x857f('0x59'),_0x857f('0x5a')],squel[_0x857f('0x7c')]()[_0x857f('0x74')]('h.id','id')['field'](_0x857f('0x75'),'scheduledAt')['field']('ci.item',_0x857f('0x70'))[_0x857f('0x74')]('ci.OrderBY',_0x857f('0x85'))['field']('\x27'+_0x13e6ec+'\x27',_0x857f('0x59'))['field']('\x27'+_0x13e6ec+'\x27',_0x857f('0x5a'))[_0x857f('0x80')](_0x857f('0x86'),'ci')[_0x857f('0x87')]('cm_hopper','h',_0x857f('0x88'))[_0x857f('0x3f')]('h.ListId\x20=\x20?',_0x41deb9[_0x857f('0x76')][_0x857f('0x77')]())['where'](_0x857f('0x89'),_0x1113bf['params']['id'][_0x857f('0x77')]())[_0x857f('0x3f')](_0x857f('0x8a'),_0x13e6ec))[_0x857f('0x77')]();_0x17a939['push'](db[_0x857f('0x8b')][_0x857f('0x35')](_0x3e146b));_0x35e5a2[_0x857f('0x8c')](db['sequelize'][_0x857f('0x35')](_0x52f1e2));}return BPromise['all'](_0x17a939);}})[_0x857f('0x28')](function(){return BPromise[_0x857f('0x8d')](_0x35e5a2);})['then'](function(){return _0x6fcc36;})[_0x857f('0x28')](respondWithResult(_0x28c2db,null))[_0x857f('0x48')](handleError(_0x28c2db,null));};exports['removeLists']=function(_0x24b69a,_0x2435ee,_0x59f735){return db[_0x857f('0x31')][_0x857f('0x4e')]({'where':{'id':_0x24b69a['params']['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x2435ee,null))['then'](function(_0x5d2fbf){if(_0x5d2fbf){return _0x5d2fbf[_0x857f('0x8e')](_0x24b69a[_0x857f('0x35')][_0x857f('0x6a')]);}})[_0x857f('0x28')](function(_0x110cbc){if(_0x110cbc){return db[_0x857f('0x5d')][_0x857f('0x27')]({'where':{'ListId':_0x24b69a[_0x857f('0x35')][_0x857f('0x6a')],'CampaignId':_0x24b69a[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](function(){return _0x110cbc;});}})[_0x857f('0x28')](respondWithStatusCode(_0x2435ee,null))[_0x857f('0x48')](handleError(_0x2435ee,null));};exports['getBlackLists']=function(_0x5a7cb2,_0x320036,_0x31d896){var _0x12a0d3={};var _0x1b3bb3={};var _0x3269d0;var _0x4077d7;return db[_0x857f('0x31')]['findOne']({'where':{'id':_0x5a7cb2[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x320036,null))['then'](function(_0xb49bfc){if(_0xb49bfc){_0x3269d0=_0xb49bfc;_0x1b3bb3[_0x857f('0x34')]=_[_0x857f('0x4b')](db[_0x857f('0x66')][_0x857f('0x4c')]);_0x1b3bb3[_0x857f('0x35')]=_[_0x857f('0x4b')](_0x5a7cb2['query']);_0x1b3bb3[_0x857f('0x36')]=_[_0x857f('0x37')](_0x1b3bb3[_0x857f('0x34')],_0x1b3bb3[_0x857f('0x35')]);_0x12a0d3[_0x857f('0x38')]=_[_0x857f('0x37')](_0x1b3bb3['model'],qs[_0x857f('0x4d')](_0x5a7cb2['query'][_0x857f('0x4d')]));_0x12a0d3[_0x857f('0x38')]=_0x12a0d3['attributes'][_0x857f('0x39')]?_0x12a0d3['attributes']:_0x1b3bb3[_0x857f('0x34')];_0x12a0d3[_0x857f('0x3b')]=qs[_0x857f('0x3c')](_0x5a7cb2['query'][_0x857f('0x3c')]);_0x12a0d3[_0x857f('0x3f')]=qs[_0x857f('0x36')](_['pick'](_0x5a7cb2['query'],_0x1b3bb3['filters']));if(_0x5a7cb2[_0x857f('0x35')]['filter']){_0x12a0d3[_0x857f('0x3f')]=_['merge'](_0x12a0d3[_0x857f('0x3f')],{'$or':_['map'](_0x12a0d3[_0x857f('0x38')],function(_0x3c6112){var _0x4bd52a={};_0x4bd52a[_0x3c6112]={'$like':'%'+_0x5a7cb2[_0x857f('0x35')]['filter']+'%'};return _0x4bd52a;})});}_0x12a0d3=_[_0x857f('0x42')]({},_0x12a0d3,_0x5a7cb2[_0x857f('0x43')]);return _0x3269d0[_0x857f('0x8f')](_0x12a0d3);}})[_0x857f('0x28')](function(_0x5488d2){if(_0x5488d2){_0x4077d7=_0x5488d2[_0x857f('0x39')];if(!_0x5a7cb2[_0x857f('0x35')][_0x857f('0x5e')](_0x857f('0x3a'))){_0x12a0d3[_0x857f('0x21')]=qs[_0x857f('0x21')](_0x5a7cb2[_0x857f('0x35')][_0x857f('0x21')]);_0x12a0d3['offset']=qs[_0x857f('0x1f')](_0x5a7cb2[_0x857f('0x35')][_0x857f('0x1f')]);}return _0x3269d0[_0x857f('0x8f')](_0x12a0d3);}})[_0x857f('0x28')](function(_0x336a06){if(_0x336a06){return _0x336a06?{'count':_0x4077d7,'rows':_0x336a06}:null;}})[_0x857f('0x28')](respondWithResult(_0x320036,null))[_0x857f('0x48')](handleError(_0x320036,null));};exports[_0x857f('0x90')]=function(_0x586d6c,_0x24bfe0,_0x3d5215){var _0x8896bd,_0x595b48;var _0x2560d8=[];var _0x38c523=moment()[_0x857f('0x91')](_0x857f('0x69'));return db['Campaign'][_0x857f('0x4e')]({'where':{'id':_0x586d6c[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x24bfe0,null))[_0x857f('0x28')](function(_0x1eeca5){if(_0x1eeca5){_0x595b48=_0x1eeca5;return _0x1eeca5['addBlackLists'](_0x586d6c['body'][_0x857f('0x6a')],_[_0x857f('0x58')](_0x586d6c[_0x857f('0x50')],['ids','id'])||{});}return null;})[_0x857f('0x92')](function(_0x14d2e8){var _0x2d1dc1;var _0x16cbe3;_0x8896bd=_0x14d2e8||[];var _0x41e261=[];if(_0x14d2e8){for(var _0x3282b5=0x0;_0x3282b5<_0x14d2e8[_0x857f('0x39')];_0x3282b5+=0x1){var _0x3e07ad=_0x14d2e8[_0x3282b5]['get']({'plain':!![]});_0x2d1dc1=squel['insert']()['into'](_0x857f('0x93'))[_0x857f('0x6f')]([_0x857f('0x70'),_0x857f('0x72'),_0x857f('0x73'),_0x857f('0x5f'),_0x857f('0x59'),_0x857f('0x5a')],squel[_0x857f('0x7c')]()[_0x857f('0x74')](_0x857f('0x70'),_0x857f('0x70'))[_0x857f('0x74')]('id',_0x857f('0x72'))[_0x857f('0x74')](_0x3e07ad[_0x857f('0x76')][_0x857f('0x77')](),'ListId')['field'](_0x586d6c['params']['id'][_0x857f('0x77')](),'CampaignId')[_0x857f('0x74')](_0x857f('0x75'),_0x857f('0x59'))[_0x857f('0x74')]('NOW()',_0x857f('0x5a'))[_0x857f('0x80')](_0x857f('0x83'))[_0x857f('0x3f')](_0x857f('0x78'))[_0x857f('0x3f')](_0x857f('0x79'),_0x3e07ad['CmListId'][_0x857f('0x77')]())[_0x857f('0x3f')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x41e261[_0x857f('0x8c')](db[_0x857f('0x8b')][_0x857f('0x35')](_0x2d1dc1));}return BPromise[_0x857f('0x8d')](_0x41e261);}})[_0x857f('0x28')](function(){return _0x8896bd;})[_0x857f('0x28')](respondWithResult(_0x24bfe0,null))[_0x857f('0x48')](handleError(_0x24bfe0,null));};exports['removeBlackLists']=function(_0x253a2b,_0x1a17af,_0x349f4f){return db['Campaign'][_0x857f('0x4e')]({'where':{'id':_0x253a2b[_0x857f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a17af,null))[_0x857f('0x28')](function(_0x52d5bc){if(_0x52d5bc){return _0x52d5bc[_0x857f('0x94')](_0x253a2b[_0x857f('0x35')][_0x857f('0x6a')]);}})['then'](function(_0x56d04f){if(_0x56d04f){return db['CmHopperBlack'][_0x857f('0x27')]({'where':{'ListId':_0x253a2b[_0x857f('0x35')]['ids'],'CampaignId':_0x253a2b[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](function(){return _0x56d04f;});}})['then'](respondWithStatusCode(_0x1a17af,null))[_0x857f('0x48')](handleError(_0x1a17af,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 464609b..0ed7cc1 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 93ddbc5..db1a51c 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 _0x202c=['client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','model','map','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4f9bdc,_0x10927b){var _0x146a4d=function(_0x56a392){while(--_0x56a392){_0x4f9bdc['push'](_0x4f9bdc['shift']());}};_0x146a4d(++_0x10927b);}(_0x202c,0x178));var _0xc202=function(_0x3f6dac,_0x2102c7){_0x3f6dac=_0x3f6dac-0x0;var _0x550fd3=_0x202c[_0x3f6dac];return _0x550fd3;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Campaign,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});}exports[_0xc202('0x16')]=function(_0x9620a0){var _0x591ecc=this;return new Promise(function(_0x16ec7c,_0x2c5557){return db[_0xc202('0x17')]['findAll']({'raw':_0x9620a0['options']?_0x9620a0[_0xc202('0x18')][_0xc202('0x19')]===undefined?!![]:![]:!![],'where':_0x9620a0[_0xc202('0x18')]?_0x9620a0[_0xc202('0x18')][_0xc202('0x1a')]||null:null,'attributes':_0x9620a0['options']?_0x9620a0['options'][_0xc202('0x1b')]||null:null,'limit':_0x9620a0['options']?_0x9620a0[_0xc202('0x18')][_0xc202('0x1c')]||null:null,'include':_0x9620a0['options']?_0x9620a0['options'][_0xc202('0x1d')]?_['map'](_0x9620a0[_0xc202('0x18')][_0xc202('0x1d')],function(_0x27f4cb){return{'model':db[_0x27f4cb[_0xc202('0x1e')]],'as':_0x27f4cb['as'],'attributes':_0x27f4cb[_0xc202('0x1b')],'include':_0x27f4cb['include']?_['map'](_0x27f4cb[_0xc202('0x1d')],function(_0x1076af){return{'model':db[_0x1076af[_0xc202('0x1e')]],'as':_0x1076af['as'],'attributes':_0x1076af['attributes'],'include':_0x1076af[_0xc202('0x1d')]?_[_0xc202('0x1f')](_0x1076af['include'],function(_0x54e0f1){return{'model':db[_0x54e0f1[_0xc202('0x1e')]],'as':_0x54e0f1['as'],'attributes':_0x54e0f1[_0xc202('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc202('0xb')](function(_0x6b291c){logger[_0xc202('0xc')]('GetCampaign',_0x9620a0);logger[_0xc202('0xf')](_0xc202('0x16'),_0x9620a0,JSON['stringify'](_0x6b291c));_0x16ec7c(_0x6b291c);})['catch'](function(_0x25a954){logger[_0xc202('0x12')](_0xc202('0x16'),_0x25a954[_0xc202('0x14')],_0x9620a0);_0x2c5557(_0x591ecc['error'](0x1f4,_0x25a954[_0xc202('0x14')]));});});};
\ No newline at end of file
+var _0x76bc=['findAll','options','raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign'];(function(_0x49700d,_0x293a09){var _0x164fd8=function(_0x27c85f){while(--_0x27c85f){_0x49700d['push'](_0x49700d['shift']());}};_0x164fd8(++_0x293a09);}(_0x76bc,0x17f));var _0xc76b=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0x76bc[_0xa9eaa0];return _0x30897a;};'use strict';var _=require(_0xc76b('0x0'));var util=require(_0xc76b('0x1'));var moment=require(_0xc76b('0x2'));var BPromise=require(_0xc76b('0x3'));var rs=require(_0xc76b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc76b('0x5'));var logger=require(_0xc76b('0x6'))(_0xc76b('0x7'));var config=require(_0xc76b('0x8'));var jayson=require(_0xc76b('0x9'));var client=jayson[_0xc76b('0xa')][_0xc76b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cbe53,_0x110f3b,_0x1cb174){return new BPromise(function(_0x235ff3,_0xaf195c){return client[_0xc76b('0xc')](_0x2cbe53,_0x1cb174)[_0xc76b('0xd')](function(_0x2803e9){logger[_0xc76b('0xe')]('Campaign,\x20%s,\x20%s',_0x110f3b,_0xc76b('0xf'));logger[_0xc76b('0x10')](_0xc76b('0x11'),_0x110f3b,_0xc76b('0xf'),JSON[_0xc76b('0x12')](_0x2803e9));if(_0x2803e9[_0xc76b('0x13')]){if(_0x2803e9['error'][_0xc76b('0x14')]===0x1f4){logger[_0xc76b('0x13')](_0xc76b('0x15'),_0x110f3b,_0x2803e9[_0xc76b('0x13')][_0xc76b('0x16')]);return _0xaf195c(_0x2803e9[_0xc76b('0x13')][_0xc76b('0x16')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x110f3b,_0x2803e9[_0xc76b('0x13')][_0xc76b('0x16')]);return _0x235ff3(_0x2803e9[_0xc76b('0x13')][_0xc76b('0x16')]);}else{logger[_0xc76b('0xe')]('Campaign,\x20%s,\x20%s',_0x110f3b,_0xc76b('0xf'));_0x235ff3(_0x2803e9[_0xc76b('0x17')][_0xc76b('0x16')]);}})['catch'](function(_0x4e759e){logger[_0xc76b('0x13')](_0xc76b('0x15'),_0x110f3b,_0x4e759e);_0xaf195c(_0x4e759e);});});}exports[_0xc76b('0x18')]=function(_0x3e716e){var _0x20e2a3=this;return new Promise(function(_0x55a61d,_0x48f9c0){return db['Campaign'][_0xc76b('0x19')]({'raw':_0x3e716e[_0xc76b('0x1a')]?_0x3e716e[_0xc76b('0x1a')][_0xc76b('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e716e[_0xc76b('0x1a')]?_0x3e716e[_0xc76b('0x1a')][_0xc76b('0x1c')]||null:null,'attributes':_0x3e716e[_0xc76b('0x1a')]?_0x3e716e[_0xc76b('0x1a')][_0xc76b('0x1d')]||null:null,'limit':_0x3e716e['options']?_0x3e716e[_0xc76b('0x1a')]['limit']||null:null,'include':_0x3e716e[_0xc76b('0x1a')]?_0x3e716e[_0xc76b('0x1a')][_0xc76b('0x1e')]?_[_0xc76b('0x1f')](_0x3e716e[_0xc76b('0x1a')][_0xc76b('0x1e')],function(_0xa6a862){return{'model':db[_0xa6a862[_0xc76b('0x20')]],'as':_0xa6a862['as'],'attributes':_0xa6a862[_0xc76b('0x1d')],'include':_0xa6a862['include']?_[_0xc76b('0x1f')](_0xa6a862[_0xc76b('0x1e')],function(_0x5f0a7b){return{'model':db[_0x5f0a7b[_0xc76b('0x20')]],'as':_0x5f0a7b['as'],'attributes':_0x5f0a7b[_0xc76b('0x1d')],'include':_0x5f0a7b[_0xc76b('0x1e')]?_[_0xc76b('0x1f')](_0x5f0a7b[_0xc76b('0x1e')],function(_0x451ee1){return{'model':db[_0x451ee1['model']],'as':_0x451ee1['as'],'attributes':_0x451ee1['attributes']};}):[]};}):[]};}):[]:[]})[_0xc76b('0xd')](function(_0x35feeb){logger[_0xc76b('0xe')](_0xc76b('0x18'),_0x3e716e);logger['debug'](_0xc76b('0x18'),_0x3e716e,JSON[_0xc76b('0x12')](_0x35feeb));_0x55a61d(_0x35feeb);})[_0xc76b('0x21')](function(_0x4a0918){logger[_0xc76b('0x13')](_0xc76b('0x18'),_0x4a0918[_0xc76b('0x16')],_0x3e716e);_0x48f9c0(_0x20e2a3[_0xc76b('0x13')](0x1f4,_0x4a0918['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 2ef9949..70f08fc 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 _0xeab4=['post','create','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','put','/:id','delete','removeLists','removeBlackLists','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getBlackLists'];(function(_0x50309e,_0x5ab9fb){var _0x4080ae=function(_0x4fa78b){while(--_0x4fa78b){_0x50309e['push'](_0x50309e['shift']());}};_0x4080ae(++_0x5ab9fb);}(_0xeab4,0x185));var _0x4eab=function(_0x2fb2f5,_0x4e42ce){_0x2fb2f5=_0x2fb2f5-0x0;var _0x1b1e4e=_0xeab4[_0x2fb2f5];return _0x1b1e4e;};'use strict';var multer=require('multer');var util=require(_0x4eab('0x0'));var path=require('path');var timeout=require(_0x4eab('0x1'));var express=require(_0x4eab('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4eab('0x3'));var interaction=require(_0x4eab('0x4'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x4eab('0x5')]('/',auth[_0x4eab('0x6')](),controller[_0x4eab('0x7')]);router[_0x4eab('0x5')]('/:id',auth[_0x4eab('0x6')](),controller[_0x4eab('0x8')]);router[_0x4eab('0x5')](_0x4eab('0x9'),auth[_0x4eab('0x6')](),controller[_0x4eab('0xa')]);router['get'](_0x4eab('0xb'),auth[_0x4eab('0x6')](),controller[_0x4eab('0xc')]);router[_0x4eab('0x5')](_0x4eab('0xd'),auth[_0x4eab('0x6')](),controller['getHopperFinals']);router[_0x4eab('0x5')](_0x4eab('0xe'),auth[_0x4eab('0x6')](),controller[_0x4eab('0xf')]);router[_0x4eab('0x5')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x4eab('0x5')]('/:id/blacklists',auth[_0x4eab('0x6')](),controller[_0x4eab('0x10')]);router[_0x4eab('0x11')]('/',auth[_0x4eab('0x6')](),controller[_0x4eab('0x12')]);router[_0x4eab('0x11')](_0x4eab('0x13'),auth[_0x4eab('0x6')](),controller[_0x4eab('0x14')]);router[_0x4eab('0x11')](_0x4eab('0x15'),auth['isAuthenticated'](),controller[_0x4eab('0x16')]);router[_0x4eab('0x11')](_0x4eab('0x17'),auth[_0x4eab('0x6')](),controller['addBlackLists']);router[_0x4eab('0x18')](_0x4eab('0x19'),auth[_0x4eab('0x6')](),controller['update']);router[_0x4eab('0x1a')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x4eab('0x1a')](_0x4eab('0x15'),auth[_0x4eab('0x6')](),controller[_0x4eab('0x1b')]);router[_0x4eab('0x1a')](_0x4eab('0x17'),auth['isAuthenticated'](),controller[_0x4eab('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x8e2b=['put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','fs-extra','get','index','/:id','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','clone','addLists'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x8e2b,0x19a));var _0xb8e2=function(_0xaa345e,_0x49f73b){_0xaa345e=_0xaa345e-0x0;var _0x24cbea=_0x8e2b[_0xaa345e];return _0x24cbea;};'use strict';var multer=require(_0xb8e2('0x0'));var util=require(_0xb8e2('0x1'));var path=require('path');var timeout=require(_0xb8e2('0x2'));var express=require(_0xb8e2('0x3'));var router=express[_0xb8e2('0x4')]();var fs_extra=require(_0xb8e2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xb8e2('0x6')]('/',auth['isAuthenticated'](),controller[_0xb8e2('0x7')]);router[_0xb8e2('0x6')](_0xb8e2('0x8'),auth[_0xb8e2('0x9')](),controller['show']);router[_0xb8e2('0x6')]('/:id/hoppers',auth[_0xb8e2('0x9')](),controller[_0xb8e2('0xa')]);router[_0xb8e2('0x6')](_0xb8e2('0xb'),auth[_0xb8e2('0x9')](),controller[_0xb8e2('0xc')]);router['get'](_0xb8e2('0xd'),auth['isAuthenticated'](),controller[_0xb8e2('0xe')]);router[_0xb8e2('0x6')](_0xb8e2('0xf'),auth[_0xb8e2('0x9')](),controller[_0xb8e2('0x10')]);router[_0xb8e2('0x6')](_0xb8e2('0x11'),auth[_0xb8e2('0x9')](),controller['getLists']);router['get'](_0xb8e2('0x12'),auth[_0xb8e2('0x9')](),controller['getBlackLists']);router[_0xb8e2('0x13')]('/',auth[_0xb8e2('0x9')](),controller[_0xb8e2('0x14')]);router[_0xb8e2('0x13')](_0xb8e2('0x15'),auth[_0xb8e2('0x9')](),controller[_0xb8e2('0x16')]);router[_0xb8e2('0x13')](_0xb8e2('0x11'),auth[_0xb8e2('0x9')](),controller[_0xb8e2('0x17')]);router['post'](_0xb8e2('0x12'),auth[_0xb8e2('0x9')](),controller['addBlackLists']);router[_0xb8e2('0x18')](_0xb8e2('0x8'),auth[_0xb8e2('0x9')](),controller[_0xb8e2('0x19')]);router['delete'](_0xb8e2('0x8'),auth[_0xb8e2('0x9')](),controller[_0xb8e2('0x1a')]);router[_0xb8e2('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xb8e2('0x1c')]);router[_0xb8e2('0x1b')](_0xb8e2('0x12'),auth[_0xb8e2('0x9')](),controller[_0xb8e2('0x1d')]);module[_0xb8e2('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 674ef0d..08d7ecc 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 _0xfb8f=['VIRTUAL','getDataValue','key','sequelize','exports','STRING','TEXT','medium'];(function(_0x201361,_0x3d6778){var _0x300db2=function(_0x3b3c10){while(--_0x3b3c10){_0x201361['push'](_0x201361['shift']());}};_0x300db2(++_0x3d6778);}(_0xfb8f,0x113));var _0xffb8=function(_0x404f13,_0x4fa35f){_0x404f13=_0x404f13-0x0;var _0x1f9dbb=_0xfb8f[_0x404f13];return _0x1f9dbb;};'use strict';var Sequelize=require(_0xffb8('0x0'));module[_0xffb8('0x1')]={'key':{'type':Sequelize[_0xffb8('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xffb8('0x3')],'length':_0xffb8('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xffb8('0x2')]},'name':{'type':Sequelize[_0xffb8('0x5')],'get':function(){return this[_0xffb8('0x6')](_0xffb8('0x7'));}}};
\ No newline at end of file
+var _0x2a8a=['VIRTUAL','getDataValue','key','exports','STRING','medium'];(function(_0x32f145,_0xf6a2ae){var _0xe274ba=function(_0x3c9b72){while(--_0x3c9b72){_0x32f145['push'](_0x32f145['shift']());}};_0xe274ba(++_0xf6a2ae);}(_0x2a8a,0x93));var _0xa2a8=function(_0xbc50d6,_0x275e33){_0xbc50d6=_0xbc50d6-0x0;var _0x30d8a7=_0x2a8a[_0xbc50d6];return _0x30d8a7;};'use strict';var Sequelize=require('sequelize');module[_0xa2a8('0x0')]={'key':{'type':Sequelize[_0xa2a8('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xa2a8('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa2a8('0x3')],'get':function(){return this[_0xa2a8('0x4')](_0xa2a8('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index e18ff3b..e36e4a2 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 _0x3079=['CannedAnswers','UserProfileResource','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','sort','pick','filter','merge','where','options','CannedAnswer','includeAll','findAll','rows','catch','keys','include','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get'];(function(_0x3367ee,_0xaea5bd){var _0xc50483=function(_0x40db59){while(--_0x40db59){_0x3367ee['push'](_0x3367ee['shift']());}};_0xc50483(++_0xaea5bd);}(_0x3079,0x190));var _0x9307=function(_0x150d0c,_0x32b918){_0x150d0c=_0x150d0c-0x0;var _0x2448bb=_0x3079[_0x150d0c];return _0x2448bb;};'use strict';var emlformat=require(_0x9307('0x0'));var rimraf=require(_0x9307('0x1'));var zipdir=require(_0x9307('0x2'));var jsonpatch=require(_0x9307('0x3'));var rp=require(_0x9307('0x4'));var moment=require(_0x9307('0x5'));var BPromise=require(_0x9307('0x6'));var Mustache=require(_0x9307('0x7'));var util=require(_0x9307('0x8'));var path=require('path');var sox=require(_0x9307('0x9'));var csv=require('to-csv');var ejs=require(_0x9307('0xa'));var fs=require('fs');var fs_extra=require(_0x9307('0xb'));var _=require('lodash');var squel=require(_0x9307('0xc'));var crypto=require('crypto');var jsforce=require(_0x9307('0xd'));var deskjs=require(_0x9307('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9307('0xf'));var Papa=require(_0x9307('0x10'));var Redis=require(_0x9307('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9307('0x12'));var hardwareService=require(_0x9307('0x13'));var logger=require(_0x9307('0x14'))(_0x9307('0x15'));var utils=require(_0x9307('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9307('0x17'));var db=require(_0x9307('0x18'))['db'];function respondWithStatusCode(_0x193331,_0x2ad580){_0x2ad580=_0x2ad580||0xcc;return function(_0x8c7165){if(_0x8c7165){return _0x193331['sendStatus'](_0x2ad580);}return _0x193331['status'](_0x2ad580)['end']();};}function respondWithResult(_0x12ba60,_0x198d6a){_0x198d6a=_0x198d6a||0xc8;return function(_0x1fc7a2){if(_0x1fc7a2){return _0x12ba60[_0x9307('0x19')](_0x198d6a)[_0x9307('0x1a')](_0x1fc7a2);}};}function respondWithFilteredResult(_0x3caeb5,_0x36f3d0){return function(_0x23f16e){if(_0x23f16e){var _0x16a541=typeof _0x36f3d0[_0x9307('0x1b')]===_0x9307('0x1c')&&typeof _0x36f3d0[_0x9307('0x1d')]===_0x9307('0x1c');var _0x1ca88e=_0x23f16e[_0x9307('0x1e')];var _0x3568e4=_0x16a541?0x0:_0x36f3d0[_0x9307('0x1b')];var _0x5f1e15=_0x16a541?_0x23f16e[_0x9307('0x1e')]:_0x36f3d0[_0x9307('0x1b')]+_0x36f3d0[_0x9307('0x1d')];var _0x376d5a;if(_0x5f1e15>=_0x1ca88e){_0x5f1e15=_0x1ca88e;_0x376d5a=0xc8;}else{_0x376d5a=0xce;}_0x3caeb5[_0x9307('0x19')](_0x376d5a);return _0x3caeb5[_0x9307('0x1f')](_0x9307('0x20'),_0x3568e4+'-'+_0x5f1e15+'/'+_0x1ca88e)[_0x9307('0x1a')](_0x23f16e);}return null;};}function patchUpdates(_0x3466c3){return function(_0x122a7d){try{jsonpatch[_0x9307('0x21')](_0x122a7d,_0x3466c3,!![]);}catch(_0x2f8e77){return BPromise[_0x9307('0x22')](_0x2f8e77);}return _0x122a7d[_0x9307('0x23')]();};}function saveUpdates(_0x55af7b,_0x122632){return function(_0x898c43){if(_0x898c43){return _0x898c43[_0x9307('0x24')](_0x55af7b)[_0x9307('0x25')](function(_0x1a4800){return _0x1a4800;});}return null;};}function removeEntity(_0x1d2ea6,_0x521f22){return function(_0x434643){if(_0x434643){return _0x434643[_0x9307('0x26')]()['then'](function(){var _0x431cd7=_0x434643[_0x9307('0x27')]({'plain':!![]});var _0x3893a9=_0x9307('0x28');return db[_0x9307('0x29')]['destroy']({'where':{'type':_0x3893a9,'resourceId':_0x431cd7['id']}})[_0x9307('0x25')](function(){return _0x434643;});})[_0x9307('0x25')](function(){_0x1d2ea6[_0x9307('0x19')](0xcc)[_0x9307('0x2a')]();});}};}function handleEntityNotFound(_0x1525d2,_0x468f7b){return function(_0x4ec61b){if(!_0x4ec61b){_0x1525d2[_0x9307('0x2b')](0x194);}return _0x4ec61b;};}function handleError(_0x95d06a,_0x27bf6b){_0x27bf6b=_0x27bf6b||0x1f4;return function(_0x34f5c0){logger[_0x9307('0x2c')](_0x34f5c0['stack']);if(_0x34f5c0[_0x9307('0x2d')]){delete _0x34f5c0[_0x9307('0x2d')];}_0x95d06a[_0x9307('0x19')](_0x27bf6b)[_0x9307('0x2e')](_0x34f5c0);};}exports[_0x9307('0x2f')]=function(_0x868159,_0x211eb2){var _0x45abd7={},_0x11e7e8={},_0xf6e1a5={'count':0x0,'rows':[]};var _0x145e56=_[_0x9307('0x30')](db['CannedAnswer'][_0x9307('0x31')],function(_0x966f07){return{'name':_0x966f07[_0x9307('0x32')],'type':_0x966f07[_0x9307('0x33')][_0x9307('0x34')]};});_0x11e7e8[_0x9307('0x35')]=_[_0x9307('0x30')](_0x145e56,_0x9307('0x2d'));_0x11e7e8['query']=_['keys'](_0x868159[_0x9307('0x36')]);_0x11e7e8[_0x9307('0x37')]=_['intersection'](_0x11e7e8[_0x9307('0x35')],_0x11e7e8[_0x9307('0x36')]);_0x45abd7['attributes']=_[_0x9307('0x38')](_0x11e7e8[_0x9307('0x35')],qs[_0x9307('0x39')](_0x868159[_0x9307('0x36')][_0x9307('0x39')]));_0x45abd7['attributes']=_0x45abd7[_0x9307('0x3a')][_0x9307('0x3b')]?_0x45abd7[_0x9307('0x3a')]:_0x11e7e8[_0x9307('0x35')];if(!_0x868159['query']['hasOwnProperty']('nolimit')){_0x45abd7['limit']=qs['limit'](_0x868159[_0x9307('0x36')]['limit']);_0x45abd7[_0x9307('0x1b')]=qs[_0x9307('0x1b')](_0x868159[_0x9307('0x36')]['offset']);}_0x45abd7['order']=qs[_0x9307('0x3c')](_0x868159[_0x9307('0x36')][_0x9307('0x3c')]);_0x45abd7['where']=qs[_0x9307('0x37')](_[_0x9307('0x3d')](_0x868159[_0x9307('0x36')],_0x11e7e8['filters']),_0x145e56);if(_0x868159['query'][_0x9307('0x3e')]){_0x45abd7['where']=_[_0x9307('0x3f')](_0x45abd7[_0x9307('0x40')],{'$or':[{'key':{'$like':'%'+_0x868159[_0x9307('0x36')][_0x9307('0x3e')]+'%'}},{'value':{'$like':'%'+_0x868159[_0x9307('0x36')]['filter']+'%'}}]});}_0x45abd7=_['merge']({},_0x45abd7,_0x868159[_0x9307('0x41')]);var _0x5795da={'where':_0x45abd7['where']};return db[_0x9307('0x42')][_0x9307('0x1e')](_0x5795da)['then'](function(_0x45086a){_0xf6e1a5[_0x9307('0x1e')]=_0x45086a;if(_0x868159[_0x9307('0x36')][_0x9307('0x43')]){_0x45abd7['include']=[{'all':!![]}];}return db[_0x9307('0x42')][_0x9307('0x44')](_0x45abd7);})[_0x9307('0x25')](function(_0x2a6bf0){_0xf6e1a5[_0x9307('0x45')]=_0x2a6bf0;return _0xf6e1a5;})[_0x9307('0x25')](respondWithFilteredResult(_0x211eb2,_0x45abd7))[_0x9307('0x46')](handleError(_0x211eb2,null));};exports['show']=function(_0x496049,_0x1670c6){var _0x7f9b49={'raw':!![],'where':{'id':_0x496049['params']['id']}},_0x138e3a={};_0x138e3a['model']=_[_0x9307('0x47')](db[_0x9307('0x42')][_0x9307('0x31')]);_0x138e3a['query']=_['keys'](_0x496049['query']);_0x138e3a[_0x9307('0x37')]=_[_0x9307('0x38')](_0x138e3a[_0x9307('0x35')],_0x138e3a['query']);_0x7f9b49['attributes']=_['intersection'](_0x138e3a[_0x9307('0x35')],qs[_0x9307('0x39')](_0x496049[_0x9307('0x36')][_0x9307('0x39')]));_0x7f9b49[_0x9307('0x3a')]=_0x7f9b49[_0x9307('0x3a')][_0x9307('0x3b')]?_0x7f9b49[_0x9307('0x3a')]:_0x138e3a[_0x9307('0x35')];if(_0x496049[_0x9307('0x36')]['includeAll']){_0x7f9b49[_0x9307('0x48')]=[{'all':!![]}];}_0x7f9b49=_[_0x9307('0x3f')]({},_0x7f9b49,_0x496049['options']);return db[_0x9307('0x42')]['find'](_0x7f9b49)['then'](handleEntityNotFound(_0x1670c6,null))[_0x9307('0x25')](respondWithResult(_0x1670c6,null))[_0x9307('0x46')](handleError(_0x1670c6,null));};exports['update']=function(_0x17e45b,_0x40cdf1){if(_0x17e45b[_0x9307('0x49')]['id']){delete _0x17e45b[_0x9307('0x49')]['id'];}return db[_0x9307('0x42')][_0x9307('0x4a')]({'where':{'id':_0x17e45b['params']['id']}})['then'](handleEntityNotFound(_0x40cdf1,null))[_0x9307('0x25')](saveUpdates(_0x17e45b['body'],null))['then'](respondWithResult(_0x40cdf1,null))['catch'](handleError(_0x40cdf1,null));};exports[_0x9307('0x26')]=function(_0x2a5a00,_0x3736da){return db[_0x9307('0x42')][_0x9307('0x4a')]({'where':{'id':_0x2a5a00[_0x9307('0x4b')]['id']}})[_0x9307('0x25')](handleEntityNotFound(_0x3736da,null))[_0x9307('0x25')](removeEntity(_0x3736da,null))[_0x9307('0x46')](handleError(_0x3736da,null));};exports[_0x9307('0x4c')]=function(_0x765079,_0x228141){var _0x3bc7a0={'key':_0x765079['body'][_0x9307('0x34')]};if(_0x765079[_0x9307('0x49')]['MailAccountId']){_0x3bc7a0[_0x9307('0x4d')]=_0x765079[_0x9307('0x49')]['MailAccountId'];}else if(_0x765079['body'][_0x9307('0x4e')]){_0x3bc7a0[_0x9307('0x4e')]=_0x765079[_0x9307('0x49')][_0x9307('0x4e')];}else if(_0x765079[_0x9307('0x49')][_0x9307('0x4f')]){_0x3bc7a0[_0x9307('0x4f')]=_0x765079[_0x9307('0x49')][_0x9307('0x4f')];}else if(_0x765079['body'][_0x9307('0x50')]){_0x3bc7a0['ChatWebsiteId']=_0x765079[_0x9307('0x49')]['ChatWebsiteId'];}return db[_0x9307('0x42')][_0x9307('0x4a')]({'where':_0x3bc7a0})[_0x9307('0x25')](function(_0x5abb94){if(_0x5abb94){throw new db[(_0x9307('0x51'))]['ValidationError'](_0x9307('0x52'));}return db['CannedAnswer'][_0x9307('0x4c')](_0x765079[_0x9307('0x49')]);})[_0x9307('0x25')](function(_0x330237){var _0x1c94f8=_0x765079['user'][_0x9307('0x27')]({'plain':!![]});if(!_0x1c94f8)throw new Error(_0x9307('0x53'));if(_0x1c94f8[_0x9307('0x54')]===_0x9307('0x55')){var _0x54da8c=_0x330237['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x9307('0x28'),'userProfileId':_0x1c94f8['userProfileId']},'raw':!![]})[_0x9307('0x25')](function(_0x2b73c3){if(_0x2b73c3&&_0x2b73c3[_0x9307('0x56')]===0x0){return db[_0x9307('0x29')][_0x9307('0x4c')]({'name':_0x54da8c['name'],'resourceId':_0x54da8c['id'],'type':_0x2b73c3['name'],'sectionId':_0x2b73c3['id']},{})['then'](function(){return _0x330237;});}else{return _0x330237;}})[_0x9307('0x46')](function(_0xfb60b0){logger[_0x9307('0x2c')](_0x9307('0x57'),_0xfb60b0);throw _0xfb60b0;});}return _0x330237;})[_0x9307('0x25')](respondWithResult(_0x228141,0xc9))[_0x9307('0x46')](handleError(_0x228141,null));};
\ No newline at end of file
+var _0x226b=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','CannedAnswer','includeAll','findAll','params','rawAttributes','filters','include','body','find','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','eml-format','rimraf','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x18e4ad,_0x4e1684){var _0x4c8d85=function(_0x320ea2){while(--_0x320ea2){_0x18e4ad['push'](_0x18e4ad['shift']());}};_0x4c8d85(++_0x4e1684);}(_0x226b,0x134));var _0xb226=function(_0x5f0f89,_0x1fc5cc){_0x5f0f89=_0x5f0f89-0x0;var _0x541945=_0x226b[_0x5f0f89];return _0x541945;};'use strict';var emlformat=require(_0xb226('0x0'));var rimraf=require(_0xb226('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb226('0x2'));var util=require(_0xb226('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0xb226('0x4'));var ejs=require(_0xb226('0x5'));var fs=require('fs');var fs_extra=require(_0xb226('0x6'));var _=require(_0xb226('0x7'));var squel=require(_0xb226('0x8'));var crypto=require(_0xb226('0x9'));var jsforce=require(_0xb226('0xa'));var deskjs=require(_0xb226('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb226('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb226('0xd'));var qs=require(_0xb226('0xe'));var as=require(_0xb226('0xf'));var hardwareService=require(_0xb226('0x10'));var logger=require(_0xb226('0x11'))(_0xb226('0x12'));var utils=require(_0xb226('0x13'));var config=require(_0xb226('0x14'));var licenseUtil=require(_0xb226('0x15'));var db=require(_0xb226('0x16'))['db'];function respondWithStatusCode(_0x1d19cb,_0xc04e32){_0xc04e32=_0xc04e32||0xcc;return function(_0xcb7f29){if(_0xcb7f29){return _0x1d19cb[_0xb226('0x17')](_0xc04e32);}return _0x1d19cb['status'](_0xc04e32)['end']();};}function respondWithResult(_0x19278f,_0x58cdc8){_0x58cdc8=_0x58cdc8||0xc8;return function(_0x17c444){if(_0x17c444){return _0x19278f[_0xb226('0x18')](_0x58cdc8)[_0xb226('0x19')](_0x17c444);}};}function respondWithFilteredResult(_0x57f47a,_0xc96b4d){return function(_0x3a2378){if(_0x3a2378){var _0x4c7075=typeof _0xc96b4d[_0xb226('0x1a')]===_0xb226('0x1b')&&typeof _0xc96b4d[_0xb226('0x1c')]===_0xb226('0x1b');var _0x123db2=_0x3a2378['count'];var _0x491218=_0x4c7075?0x0:_0xc96b4d[_0xb226('0x1a')];var _0x11e60f=_0x4c7075?_0x3a2378[_0xb226('0x1d')]:_0xc96b4d['offset']+_0xc96b4d['limit'];var _0x4d6806;if(_0x11e60f>=_0x123db2){_0x11e60f=_0x123db2;_0x4d6806=0xc8;}else{_0x4d6806=0xce;}_0x57f47a[_0xb226('0x18')](_0x4d6806);return _0x57f47a['set'](_0xb226('0x1e'),_0x491218+'-'+_0x11e60f+'/'+_0x123db2)['json'](_0x3a2378);}return null;};}function patchUpdates(_0x370b3e){return function(_0x42bc00){try{jsonpatch[_0xb226('0x1f')](_0x42bc00,_0x370b3e,!![]);}catch(_0x3b59d9){return BPromise[_0xb226('0x20')](_0x3b59d9);}return _0x42bc00[_0xb226('0x21')]();};}function saveUpdates(_0x2217b1,_0x3a58a0){return function(_0x1e3e2e){if(_0x1e3e2e){return _0x1e3e2e[_0xb226('0x22')](_0x2217b1)[_0xb226('0x23')](function(_0x2e6845){return _0x2e6845;});}return null;};}function removeEntity(_0x25aead,_0x597850){return function(_0x1eda86){if(_0x1eda86){return _0x1eda86[_0xb226('0x24')]()['then'](function(){var _0x627a07=_0x1eda86[_0xb226('0x25')]({'plain':!![]});var _0x47f25f='CannedAnswers';return db[_0xb226('0x26')]['destroy']({'where':{'type':_0x47f25f,'resourceId':_0x627a07['id']}})[_0xb226('0x23')](function(){return _0x1eda86;});})['then'](function(){_0x25aead[_0xb226('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x476d22,_0x122c08){return function(_0x4d43b7){if(!_0x4d43b7){_0x476d22['sendStatus'](0x194);}return _0x4d43b7;};}function handleError(_0x5247f1,_0x27f48b){_0x27f48b=_0x27f48b||0x1f4;return function(_0x24e002){logger['error'](_0x24e002[_0xb226('0x27')]);if(_0x24e002[_0xb226('0x28')]){delete _0x24e002[_0xb226('0x28')];}_0x5247f1['status'](_0x27f48b)[_0xb226('0x29')](_0x24e002);};}exports[_0xb226('0x2a')]=function(_0x2d3d0b,_0x5dae05){var _0x583f07={},_0x478931={},_0x47d492={'count':0x0,'rows':[]};var _0xa30c84=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x1431e1){return{'name':_0x1431e1['fieldName'],'type':_0x1431e1[_0xb226('0x2b')][_0xb226('0x2c')]};});_0x478931[_0xb226('0x2d')]=_[_0xb226('0x2e')](_0xa30c84,_0xb226('0x28'));_0x478931[_0xb226('0x2f')]=_[_0xb226('0x30')](_0x2d3d0b[_0xb226('0x2f')]);_0x478931['filters']=_[_0xb226('0x31')](_0x478931[_0xb226('0x2d')],_0x478931['query']);_0x583f07[_0xb226('0x32')]=_[_0xb226('0x31')](_0x478931[_0xb226('0x2d')],qs[_0xb226('0x33')](_0x2d3d0b[_0xb226('0x2f')][_0xb226('0x33')]));_0x583f07[_0xb226('0x32')]=_0x583f07[_0xb226('0x32')][_0xb226('0x34')]?_0x583f07['attributes']:_0x478931[_0xb226('0x2d')];if(!_0x2d3d0b[_0xb226('0x2f')][_0xb226('0x35')]('nolimit')){_0x583f07[_0xb226('0x1c')]=qs[_0xb226('0x1c')](_0x2d3d0b[_0xb226('0x2f')]['limit']);_0x583f07[_0xb226('0x1a')]=qs[_0xb226('0x1a')](_0x2d3d0b[_0xb226('0x2f')][_0xb226('0x1a')]);}_0x583f07[_0xb226('0x36')]=qs[_0xb226('0x37')](_0x2d3d0b['query'][_0xb226('0x37')]);_0x583f07['where']=qs['filters'](_[_0xb226('0x38')](_0x2d3d0b[_0xb226('0x2f')],_0x478931['filters']),_0xa30c84);if(_0x2d3d0b['query']['filter']){_0x583f07[_0xb226('0x39')]=_[_0xb226('0x3a')](_0x583f07[_0xb226('0x39')],{'$or':[{'key':{'$like':'%'+_0x2d3d0b[_0xb226('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0x2d3d0b[_0xb226('0x2f')][_0xb226('0x3b')]+'%'}}]});}_0x583f07=_['merge']({},_0x583f07,_0x2d3d0b[_0xb226('0x3c')]);var _0x1783d5={'where':_0x583f07['where']};return db[_0xb226('0x3d')][_0xb226('0x1d')](_0x1783d5)[_0xb226('0x23')](function(_0x137b43){_0x47d492[_0xb226('0x1d')]=_0x137b43;if(_0x2d3d0b[_0xb226('0x2f')][_0xb226('0x3e')]){_0x583f07['include']=[{'all':!![]}];}return db[_0xb226('0x3d')][_0xb226('0x3f')](_0x583f07);})['then'](function(_0x5c20bd){_0x47d492['rows']=_0x5c20bd;return _0x47d492;})[_0xb226('0x23')](respondWithFilteredResult(_0x5dae05,_0x583f07))['catch'](handleError(_0x5dae05,null));};exports['show']=function(_0x4b9978,_0x427a4a){var _0x70a8dd={'raw':!![],'where':{'id':_0x4b9978[_0xb226('0x40')]['id']}},_0x47f739={};_0x47f739[_0xb226('0x2d')]=_[_0xb226('0x30')](db['CannedAnswer'][_0xb226('0x41')]);_0x47f739[_0xb226('0x2f')]=_[_0xb226('0x30')](_0x4b9978[_0xb226('0x2f')]);_0x47f739[_0xb226('0x42')]=_[_0xb226('0x31')](_0x47f739[_0xb226('0x2d')],_0x47f739[_0xb226('0x2f')]);_0x70a8dd[_0xb226('0x32')]=_['intersection'](_0x47f739['model'],qs['fields'](_0x4b9978[_0xb226('0x2f')][_0xb226('0x33')]));_0x70a8dd[_0xb226('0x32')]=_0x70a8dd[_0xb226('0x32')][_0xb226('0x34')]?_0x70a8dd['attributes']:_0x47f739[_0xb226('0x2d')];if(_0x4b9978[_0xb226('0x2f')][_0xb226('0x3e')]){_0x70a8dd[_0xb226('0x43')]=[{'all':!![]}];}_0x70a8dd=_[_0xb226('0x3a')]({},_0x70a8dd,_0x4b9978[_0xb226('0x3c')]);return db[_0xb226('0x3d')]['find'](_0x70a8dd)[_0xb226('0x23')](handleEntityNotFound(_0x427a4a,null))[_0xb226('0x23')](respondWithResult(_0x427a4a,null))['catch'](handleError(_0x427a4a,null));};exports['update']=function(_0x193823,_0x3c12f5){if(_0x193823[_0xb226('0x44')]['id']){delete _0x193823[_0xb226('0x44')]['id'];}return db[_0xb226('0x3d')][_0xb226('0x45')]({'where':{'id':_0x193823[_0xb226('0x40')]['id']}})[_0xb226('0x23')](handleEntityNotFound(_0x3c12f5,null))['then'](saveUpdates(_0x193823['body'],null))[_0xb226('0x23')](respondWithResult(_0x3c12f5,null))[_0xb226('0x46')](handleError(_0x3c12f5,null));};exports[_0xb226('0x24')]=function(_0x3cb5b4,_0x30e106){return db[_0xb226('0x3d')]['find']({'where':{'id':_0x3cb5b4[_0xb226('0x40')]['id']}})['then'](handleEntityNotFound(_0x30e106,null))[_0xb226('0x23')](removeEntity(_0x30e106,null))[_0xb226('0x46')](handleError(_0x30e106,null));};exports['create']=function(_0x3b9acf,_0x26c293){var _0x3d31dd={'key':_0x3b9acf['body'][_0xb226('0x2c')]};if(_0x3b9acf[_0xb226('0x44')][_0xb226('0x47')]){_0x3d31dd[_0xb226('0x47')]=_0x3b9acf[_0xb226('0x44')]['MailAccountId'];}else if(_0x3b9acf['body'][_0xb226('0x48')]){_0x3d31dd[_0xb226('0x48')]=_0x3b9acf['body'][_0xb226('0x48')];}else if(_0x3b9acf[_0xb226('0x44')][_0xb226('0x49')]){_0x3d31dd[_0xb226('0x49')]=_0x3b9acf[_0xb226('0x44')]['OpenchannelAccountId'];}else if(_0x3b9acf['body'][_0xb226('0x4a')]){_0x3d31dd['ChatWebsiteId']=_0x3b9acf[_0xb226('0x44')]['ChatWebsiteId'];}return db[_0xb226('0x3d')][_0xb226('0x45')]({'where':_0x3d31dd})['then'](function(_0x23aba2){if(_0x23aba2){throw new db[(_0xb226('0x4b'))][(_0xb226('0x4c'))](_0xb226('0x4d'));}return db[_0xb226('0x3d')]['create'](_0x3b9acf[_0xb226('0x44')]);})[_0xb226('0x23')](function(_0x198a5c){var _0x1b8f35=_0x3b9acf[_0xb226('0x4e')][_0xb226('0x25')]({'plain':!![]});if(!_0x1b8f35)throw new Error(_0xb226('0x4f'));if(_0x1b8f35['role']===_0xb226('0x4e')){var _0x15e7fe=_0x198a5c[_0xb226('0x25')]({'plain':!![]});return db[_0xb226('0x50')][_0xb226('0x45')]({'where':{'name':'CannedAnswers','userProfileId':_0x1b8f35[_0xb226('0x51')]},'raw':!![]})[_0xb226('0x23')](function(_0x58e652){if(_0x58e652&&_0x58e652['autoAssociation']===0x0){return db[_0xb226('0x26')]['create']({'name':_0x15e7fe[_0xb226('0x28')],'resourceId':_0x15e7fe['id'],'type':_0x58e652[_0xb226('0x28')],'sectionId':_0x58e652['id']},{})['then'](function(){return _0x198a5c;});}else{return _0x198a5c;}})[_0xb226('0x46')](function(_0x571cac){logger[_0xb226('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x571cac);throw _0x571cac;});}return _0x198a5c;})[_0xb226('0x23')](respondWithResult(_0x26c293,0xc9))[_0xb226('0x46')](handleError(_0x26c293,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0cf1c3b..8531449 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 _0xa80f=['define','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x126f9b,_0x499df7){var _0x5983b7=function(_0x394e5a){while(--_0x394e5a){_0x126f9b['push'](_0x126f9b['shift']());}};_0x5983b7(++_0x499df7);}(_0xa80f,0xdf));var _0xfa80=function(_0x10e956,_0xd5fcf0){_0x10e956=_0x10e956-0x0;var _0x3312a0=_0xa80f[_0x10e956];return _0x3312a0;};'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(_0xfa80('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa80('0x7'));var config=require(_0xfa80('0x8'));var attributes=require(_0xfa80('0x9'));module[_0xfa80('0xa')]=function(_0x5638b8,_0x53d2d0){return _0x5638b8[_0xfa80('0xb')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa80('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2488=['path','rimraf','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0x2488,0xac));var _0x8248=function(_0x3b06f1,_0x2c2f9a){_0x3b06f1=_0x3b06f1-0x0;var _0x1ab7fd=_0x2488[_0x3b06f1];return _0x1ab7fd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8248('0x0'));var moment=require(_0x8248('0x1'));var BPromise=require(_0x8248('0x2'));var rp=require(_0x8248('0x3'));var fs=require('fs');var path=require(_0x8248('0x4'));var rimraf=require(_0x8248('0x5'));var config=require('../../config/environment');var attributes=require(_0x8248('0x6'));module['exports']=function(_0x31c9cf,_0x1eab54){return _0x31c9cf[_0x8248('0x7')]('CannedAnswer',attributes,{'tableName':_0x8248('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8248('0x9'),'collate':_0x8248('0xa')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 35a9766..8217294 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(_0x426573,_0x49f680){var _0x58f1c3=function(_0xef4b40){while(--_0xef4b40){_0x426573['push'](_0x426573['shift']());}};_0x58f1c3(++_0x49f680);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x3c3a49,_0x5b2296){var _0x57a239=function(_0x273e46){while(--_0x273e46){_0x3c3a49['push'](_0x3c3a49['shift']());}};_0x57a239(++_0x5b2296);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 51c2475..5f3028a 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 _0x822c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','exports','multer','util','path'];(function(_0x478501,_0x16bf10){var _0x1675b9=function(_0x22fca){while(--_0x22fca){_0x478501['push'](_0x478501['shift']());}};_0x1675b9(++_0x16bf10);}(_0x822c,0xb1));var _0xc822=function(_0x5816a1,_0x41793f){_0x5816a1=_0x5816a1-0x0;var _0x1ac5c2=_0x822c[_0x5816a1];return _0x1ac5c2;};'use strict';var multer=require(_0xc822('0x0'));var util=require(_0xc822('0x1'));var path=require(_0xc822('0x2'));var timeout=require(_0xc822('0x3'));var express=require(_0xc822('0x4'));var router=express[_0xc822('0x5')]();var fs_extra=require(_0xc822('0x6'));var auth=require(_0xc822('0x7'));var interaction=require(_0xc822('0x8'));var config=require('../../config/environment');var controller=require(_0xc822('0x9'));router[_0xc822('0xa')]('/',auth[_0xc822('0xb')](),controller[_0xc822('0xc')]);router[_0xc822('0xa')]('/:id',auth[_0xc822('0xb')](),controller[_0xc822('0xd')]);router[_0xc822('0xe')]('/',auth[_0xc822('0xb')](),controller[_0xc822('0xf')]);router[_0xc822('0x10')](_0xc822('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xc822('0x12')](_0xc822('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xc822('0x13')]=router;
\ No newline at end of file
+var _0x7b49=['../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x43e97d,_0x35c7ba){var _0x385d12=function(_0x5182b3){while(--_0x5182b3){_0x43e97d['push'](_0x43e97d['shift']());}};_0x385d12(++_0x35c7ba);}(_0x7b49,0xc7));var _0x97b4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7b49[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x97b4('0x0'));var timeout=require(_0x97b4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x97b4('0x2'));var auth=require(_0x97b4('0x3'));var interaction=require(_0x97b4('0x4'));var config=require(_0x97b4('0x5'));var controller=require(_0x97b4('0x6'));router[_0x97b4('0x7')]('/',auth[_0x97b4('0x8')](),controller['index']);router[_0x97b4('0x7')](_0x97b4('0x9'),auth['isAuthenticated'](),controller[_0x97b4('0xa')]);router[_0x97b4('0xb')]('/',auth[_0x97b4('0x8')](),controller[_0x97b4('0xc')]);router['put'](_0x97b4('0x9'),auth[_0x97b4('0x8')](),controller[_0x97b4('0xd')]);router[_0x97b4('0xe')](_0x97b4('0x9'),auth[_0x97b4('0x8')](),controller[_0x97b4('0xf')]);module[_0x97b4('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 51f2433..5d1fb86 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 _0xc524=['1970-01-01\x2000:00:01','STRING','INTEGER','DATE'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc524,0x1bf));var _0x4c52=function(_0x16459e,_0x25d909){_0x16459e=_0x16459e-0x0;var _0x263e0d=_0xc524[_0x16459e];return _0x263e0d;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x4c52('0x0')],'allowNull':![],'defaultValue':_0x4c52('0x1')},'clid':{'type':Sequelize[_0x4c52('0x2')]},'src':{'type':Sequelize[_0x4c52('0x2')]},'dst':{'type':Sequelize[_0x4c52('0x2')]},'dcontext':{'type':Sequelize[_0x4c52('0x2')]},'channel':{'type':Sequelize[_0x4c52('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x4c52('0x2')]},'duration':{'type':Sequelize[_0x4c52('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4c52('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4c52('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x4c52('0x2')]},'uniqueid':{'type':Sequelize[_0x4c52('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x4c52('0x2')]},'peeraccount':{'type':Sequelize[_0x4c52('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x4c52('0x2')]}};
\ No newline at end of file
+var _0x264f=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x31a503,_0x17154c){var _0x2188c6=function(_0x5e2f03){while(--_0x5e2f03){_0x31a503['push'](_0x31a503['shift']());}};_0x2188c6(++_0x17154c);}(_0x264f,0x19e));var _0xf264=function(_0x4fd143,_0x1f2dae){_0x4fd143=_0x4fd143-0x0;var _0x41eacf=_0x264f[_0x4fd143];return _0x41eacf;};'use strict';var Sequelize=require(_0xf264('0x0'));module[_0xf264('0x1')]={'calldate':{'type':Sequelize[_0xf264('0x2')],'allowNull':![],'defaultValue':_0xf264('0x3')},'clid':{'type':Sequelize[_0xf264('0x4')]},'src':{'type':Sequelize[_0xf264('0x4')]},'dst':{'type':Sequelize[_0xf264('0x4')]},'dcontext':{'type':Sequelize[_0xf264('0x4')]},'channel':{'type':Sequelize[_0xf264('0x4')]},'dstchannel':{'type':Sequelize[_0xf264('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf264('0x4')]},'duration':{'type':Sequelize[_0xf264('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf264('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf264('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf264('0x4')]},'userfield':{'type':Sequelize[_0xf264('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xf264('0x4')]},'sequence':{'type':Sequelize[_0xf264('0x4')]},'peeraccount':{'type':Sequelize[_0xf264('0x4')]},'type':{'type':Sequelize[_0xf264('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index a9fe60d..21869fe 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 _0x7a59=['describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','Cdr','findAll','show','params','keys','include','find','create','body','catch','update'];(function(_0x56c979,_0x57d83f){var _0x14d94e=function(_0x439708){while(--_0x439708){_0x56c979['push'](_0x56c979['shift']());}};_0x14d94e(++_0x57d83f);}(_0x7a59,0x16e));var _0x97a5=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x7a59[_0x4c445a];return _0x2f611c;};'use strict';var emlformat=require(_0x97a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a5('0x1'));var rp=require(_0x97a5('0x2'));var moment=require(_0x97a5('0x3'));var BPromise=require(_0x97a5('0x4'));var Mustache=require(_0x97a5('0x5'));var util=require('util');var path=require(_0x97a5('0x6'));var sox=require(_0x97a5('0x7'));var csv=require(_0x97a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a5('0x9'));var _=require(_0x97a5('0xa'));var squel=require(_0x97a5('0xb'));var crypto=require(_0x97a5('0xc'));var jsforce=require(_0x97a5('0xd'));var deskjs=require(_0x97a5('0xe'));var toCsv=require(_0x97a5('0x8'));var querystring=require('querystring');var Papa=require(_0x97a5('0xf'));var Redis=require(_0x97a5('0x10'));var authService=require(_0x97a5('0x11'));var qs=require(_0x97a5('0x12'));var as=require(_0x97a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97a5('0x14'));var utils=require(_0x97a5('0x15'));var config=require(_0x97a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x97a5('0x17'))['db'];function respondWithStatusCode(_0x350720,_0x55305a){_0x55305a=_0x55305a||0xcc;return function(_0x4f85a0){if(_0x4f85a0){return _0x350720[_0x97a5('0x18')](_0x55305a);}return _0x350720[_0x97a5('0x19')](_0x55305a)['end']();};}function respondWithResult(_0x595437,_0x51d5e2){_0x51d5e2=_0x51d5e2||0xc8;return function(_0x5a4471){if(_0x5a4471){return _0x595437[_0x97a5('0x19')](_0x51d5e2)[_0x97a5('0x1a')](_0x5a4471);}};}function respondWithFilteredResult(_0x3603e4,_0x4d8ba7){return function(_0x1a7a62){if(_0x1a7a62){var _0x3fa986=typeof _0x4d8ba7['offset']===_0x97a5('0x1b')&&typeof _0x4d8ba7['limit']===_0x97a5('0x1b');var _0x55071b=_0x1a7a62['count'];var _0x52ce92=_0x3fa986?0x0:_0x4d8ba7[_0x97a5('0x1c')];var _0x5c5740=_0x3fa986?_0x1a7a62[_0x97a5('0x1d')]:_0x4d8ba7[_0x97a5('0x1c')]+_0x4d8ba7[_0x97a5('0x1e')];var _0x1efe8c;if(_0x5c5740>=_0x55071b){_0x5c5740=_0x55071b;_0x1efe8c=0xc8;}else{_0x1efe8c=0xce;}_0x3603e4['status'](_0x1efe8c);return _0x3603e4['set'](_0x97a5('0x1f'),_0x52ce92+'-'+_0x5c5740+'/'+_0x55071b)[_0x97a5('0x1a')](_0x1a7a62);}return null;};}function patchUpdates(_0x4e3386){return function(_0x51858b){try{jsonpatch[_0x97a5('0x20')](_0x51858b,_0x4e3386,!![]);}catch(_0x3d7dba){return BPromise[_0x97a5('0x21')](_0x3d7dba);}return _0x51858b['save']();};}function saveUpdates(_0x34fb55,_0x3a5849){return function(_0x23f4f8){if(_0x23f4f8){return _0x23f4f8['update'](_0x34fb55)[_0x97a5('0x22')](function(_0x33d6da){return _0x33d6da;});}return null;};}function removeEntity(_0x4e2074,_0x5e731e){return function(_0x469592){if(_0x469592){return _0x469592[_0x97a5('0x23')]()[_0x97a5('0x22')](function(){_0x4e2074[_0x97a5('0x19')](0xcc)[_0x97a5('0x24')]();});}};}function handleEntityNotFound(_0x302d78,_0xf7ad1e){return function(_0x4743e0){if(!_0x4743e0){_0x302d78['sendStatus'](0x194);}return _0x4743e0;};}function handleError(_0x2038dd,_0x46ee45){_0x46ee45=_0x46ee45||0x1f4;return function(_0x2ca97c){logger[_0x97a5('0x25')](_0x2ca97c[_0x97a5('0x26')]);if(_0x2ca97c[_0x97a5('0x27')]){delete _0x2ca97c['name'];}_0x2038dd[_0x97a5('0x19')](_0x46ee45)[_0x97a5('0x28')](_0x2ca97c);};}exports['index']=function(_0x274ccb,_0x52248f){var _0x48f1c1={},_0x1bdb74={},_0x2eaae4={'count':0x0,'rows':[]};var _0x5c1c67=_[_0x97a5('0x29')](db['Cdr'][_0x97a5('0x2a')],function(_0x3c5d02){return{'name':_0x3c5d02[_0x97a5('0x2b')],'type':_0x3c5d02[_0x97a5('0x2c')]['key']};});_0x1bdb74['model']=_[_0x97a5('0x29')](_0x5c1c67,_0x97a5('0x27'));_0x1bdb74[_0x97a5('0x2d')]=_['keys'](_0x274ccb[_0x97a5('0x2d')]);_0x1bdb74[_0x97a5('0x2e')]=_['intersection'](_0x1bdb74[_0x97a5('0x2f')],_0x1bdb74[_0x97a5('0x2d')]);_0x48f1c1['attributes']=_[_0x97a5('0x30')](_0x1bdb74[_0x97a5('0x2f')],qs[_0x97a5('0x31')](_0x274ccb['query'][_0x97a5('0x31')]));_0x48f1c1[_0x97a5('0x32')]=_0x48f1c1[_0x97a5('0x32')][_0x97a5('0x33')]?_0x48f1c1[_0x97a5('0x32')]:_0x1bdb74[_0x97a5('0x2f')];if(!_0x274ccb[_0x97a5('0x2d')]['hasOwnProperty'](_0x97a5('0x34'))){_0x48f1c1[_0x97a5('0x1e')]=qs[_0x97a5('0x1e')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1e')]);_0x48f1c1[_0x97a5('0x1c')]=qs[_0x97a5('0x1c')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1c')]);}_0x48f1c1[_0x97a5('0x35')]=qs[_0x97a5('0x36')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x36')]);_0x48f1c1['where']=qs[_0x97a5('0x2e')](_[_0x97a5('0x37')](_0x274ccb[_0x97a5('0x2d')],_0x1bdb74[_0x97a5('0x2e')]),_0x5c1c67);if(_0x274ccb[_0x97a5('0x2d')]['filter']){_0x48f1c1['where']=_[_0x97a5('0x38')](_0x48f1c1[_0x97a5('0x39')],{'$or':_[_0x97a5('0x29')](_0x5c1c67,function(_0x45a548){if(_0x45a548[_0x97a5('0x2c')]!==_0x97a5('0x3a')){var _0x57333b={};_0x57333b[_0x45a548[_0x97a5('0x27')]]={'$like':'%'+_0x274ccb['query'][_0x97a5('0x3b')]+'%'};return _0x57333b;}})});}_0x48f1c1=_[_0x97a5('0x38')]({},_0x48f1c1,_0x274ccb[_0x97a5('0x3c')]);var _0x798318={'where':_0x48f1c1[_0x97a5('0x39')]};return db['Cdr'][_0x97a5('0x1d')](_0x798318)[_0x97a5('0x22')](function(_0x64505){_0x2eaae4[_0x97a5('0x1d')]=_0x64505;if(_0x274ccb[_0x97a5('0x2d')]['includeAll']){_0x48f1c1['include']=[{'all':!![]}];}return db[_0x97a5('0x3d')][_0x97a5('0x3e')](_0x48f1c1);})[_0x97a5('0x22')](function(_0x20dbc6){_0x2eaae4['rows']=_0x20dbc6;return _0x2eaae4;})[_0x97a5('0x22')](respondWithFilteredResult(_0x52248f,_0x48f1c1))['catch'](handleError(_0x52248f,null));};exports[_0x97a5('0x3f')]=function(_0x331108,_0x111e72){var _0x5baf77={'raw':!![],'where':{'id':_0x331108[_0x97a5('0x40')]['id']}},_0xefb019={};_0xefb019['model']=_[_0x97a5('0x41')](db[_0x97a5('0x3d')][_0x97a5('0x2a')]);_0xefb019[_0x97a5('0x2d')]=_[_0x97a5('0x41')](_0x331108[_0x97a5('0x2d')]);_0xefb019[_0x97a5('0x2e')]=_[_0x97a5('0x30')](_0xefb019[_0x97a5('0x2f')],_0xefb019[_0x97a5('0x2d')]);_0x5baf77[_0x97a5('0x32')]=_[_0x97a5('0x30')](_0xefb019['model'],qs[_0x97a5('0x31')](_0x331108[_0x97a5('0x2d')][_0x97a5('0x31')]));_0x5baf77['attributes']=_0x5baf77[_0x97a5('0x32')][_0x97a5('0x33')]?_0x5baf77[_0x97a5('0x32')]:_0xefb019[_0x97a5('0x2f')];if(_0x331108[_0x97a5('0x2d')]['includeAll']){_0x5baf77[_0x97a5('0x42')]=[{'all':!![]}];}_0x5baf77=_[_0x97a5('0x38')]({},_0x5baf77,_0x331108[_0x97a5('0x3c')]);return db[_0x97a5('0x3d')][_0x97a5('0x43')](_0x5baf77)['then'](handleEntityNotFound(_0x111e72,null))[_0x97a5('0x22')](respondWithResult(_0x111e72,null))['catch'](handleError(_0x111e72,null));};exports[_0x97a5('0x44')]=function(_0x235f9d,_0x330f6a){return db['Cdr'][_0x97a5('0x44')](_0x235f9d[_0x97a5('0x45')],{})[_0x97a5('0x22')](respondWithResult(_0x330f6a,0xc9))[_0x97a5('0x46')](handleError(_0x330f6a,null));};exports[_0x97a5('0x47')]=function(_0x42ced6,_0x49b215){if(_0x42ced6[_0x97a5('0x45')]['id']){delete _0x42ced6[_0x97a5('0x45')]['id'];}return db[_0x97a5('0x3d')][_0x97a5('0x43')]({'where':{'id':_0x42ced6['params']['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x49b215,null))[_0x97a5('0x22')](saveUpdates(_0x42ced6['body'],null))[_0x97a5('0x22')](respondWithResult(_0x49b215,null))[_0x97a5('0x46')](handleError(_0x49b215,null));};exports[_0x97a5('0x23')]=function(_0x56890f,_0x2a6fa0){return db[_0x97a5('0x3d')]['find']({'where':{'id':_0x56890f[_0x97a5('0x40')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x2a6fa0,null))[_0x97a5('0x22')](removeEntity(_0x2a6fa0,null))['catch'](handleError(_0x2a6fa0,null));};exports[_0x97a5('0x48')]=function(_0xc3c9e5,_0x7adad){return db['Cdr']['describe']()[_0x97a5('0x22')](respondWithResult(_0x7adad,null))[_0x97a5('0x46')](handleError(_0x7adad,null));};
\ No newline at end of file
+var _0x25fa=['json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Cdr','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25fa,0x109));var _0xa25f=function(_0x2538d4,_0x217b3f){_0x2538d4=_0x2538d4-0x0;var _0x26ca9f=_0x25fa[_0x2538d4];return _0x26ca9f;};'use strict';var emlformat=require(_0xa25f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa25f('0x1'));var jsonpatch=require(_0xa25f('0x2'));var rp=require('request-promise');var moment=require(_0xa25f('0x3'));var BPromise=require(_0xa25f('0x4'));var Mustache=require(_0xa25f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa25f('0x6'));var csv=require('to-csv');var ejs=require(_0xa25f('0x7'));var fs=require('fs');var fs_extra=require(_0xa25f('0x8'));var _=require(_0xa25f('0x9'));var squel=require(_0xa25f('0xa'));var crypto=require(_0xa25f('0xb'));var jsforce=require(_0xa25f('0xc'));var deskjs=require(_0xa25f('0xd'));var toCsv=require(_0xa25f('0xe'));var querystring=require(_0xa25f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa25f('0x10'));var authService=require(_0xa25f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa25f('0x12'));var hardwareService=require(_0xa25f('0x13'));var logger=require(_0xa25f('0x14'))(_0xa25f('0x15'));var utils=require('../../config/utils');var config=require(_0xa25f('0x16'));var licenseUtil=require(_0xa25f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e970c,_0x465e41){_0x465e41=_0x465e41||0xcc;return function(_0x50bb78){if(_0x50bb78){return _0x3e970c[_0xa25f('0x18')](_0x465e41);}return _0x3e970c[_0xa25f('0x19')](_0x465e41)[_0xa25f('0x1a')]();};}function respondWithResult(_0x4b3792,_0x199e18){_0x199e18=_0x199e18||0xc8;return function(_0x2a627f){if(_0x2a627f){return _0x4b3792[_0xa25f('0x19')](_0x199e18)[_0xa25f('0x1b')](_0x2a627f);}};}function respondWithFilteredResult(_0x465809,_0x2d2417){return function(_0x1e5836){if(_0x1e5836){var _0x1859ba=typeof _0x2d2417['offset']===_0xa25f('0x1c')&&typeof _0x2d2417[_0xa25f('0x1d')]===_0xa25f('0x1c');var _0x451a6e=_0x1e5836[_0xa25f('0x1e')];var _0x427105=_0x1859ba?0x0:_0x2d2417['offset'];var _0x292171=_0x1859ba?_0x1e5836['count']:_0x2d2417[_0xa25f('0x1f')]+_0x2d2417['limit'];var _0x559c89;if(_0x292171>=_0x451a6e){_0x292171=_0x451a6e;_0x559c89=0xc8;}else{_0x559c89=0xce;}_0x465809[_0xa25f('0x19')](_0x559c89);return _0x465809['set'](_0xa25f('0x20'),_0x427105+'-'+_0x292171+'/'+_0x451a6e)[_0xa25f('0x1b')](_0x1e5836);}return null;};}function patchUpdates(_0x2aaf3a){return function(_0x3c2665){try{jsonpatch[_0xa25f('0x21')](_0x3c2665,_0x2aaf3a,!![]);}catch(_0x504135){return BPromise[_0xa25f('0x22')](_0x504135);}return _0x3c2665[_0xa25f('0x23')]();};}function saveUpdates(_0x371716,_0x14b7f6){return function(_0x5d2803){if(_0x5d2803){return _0x5d2803[_0xa25f('0x24')](_0x371716)[_0xa25f('0x25')](function(_0x248c0c){return _0x248c0c;});}return null;};}function removeEntity(_0x3675b5,_0x4c6f4d){return function(_0x2b710f){if(_0x2b710f){return _0x2b710f[_0xa25f('0x26')]()[_0xa25f('0x25')](function(){_0x3675b5[_0xa25f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2812d7,_0x898446){return function(_0x53f011){if(!_0x53f011){_0x2812d7[_0xa25f('0x18')](0x194);}return _0x53f011;};}function handleError(_0x51dbf8,_0x2df893){_0x2df893=_0x2df893||0x1f4;return function(_0x4eb7b7){logger[_0xa25f('0x27')](_0x4eb7b7[_0xa25f('0x28')]);if(_0x4eb7b7['name']){delete _0x4eb7b7[_0xa25f('0x29')];}_0x51dbf8[_0xa25f('0x19')](_0x2df893)['send'](_0x4eb7b7);};}exports[_0xa25f('0x2a')]=function(_0x5d39c7,_0x1030c4){var _0x41a847={},_0x472114={},_0x208518={'count':0x0,'rows':[]};var _0x334629=_['map'](db[_0xa25f('0x2b')][_0xa25f('0x2c')],function(_0x119ffc){return{'name':_0x119ffc[_0xa25f('0x2d')],'type':_0x119ffc[_0xa25f('0x2e')]['key']};});_0x472114[_0xa25f('0x2f')]=_[_0xa25f('0x30')](_0x334629,_0xa25f('0x29'));_0x472114[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0x5d39c7[_0xa25f('0x31')]);_0x472114[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x472114[_0xa25f('0x2f')],_0x472114['query']);_0x41a847['attributes']=_['intersection'](_0x472114[_0xa25f('0x2f')],qs[_0xa25f('0x35')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x35')]));_0x41a847[_0xa25f('0x36')]=_0x41a847[_0xa25f('0x36')][_0xa25f('0x37')]?_0x41a847[_0xa25f('0x36')]:_0x472114[_0xa25f('0x2f')];if(!_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x38')]('nolimit')){_0x41a847['limit']=qs[_0xa25f('0x1d')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x1d')]);_0x41a847['offset']=qs['offset'](_0x5d39c7['query'][_0xa25f('0x1f')]);}_0x41a847[_0xa25f('0x39')]=qs[_0xa25f('0x3a')](_0x5d39c7['query']['sort']);_0x41a847[_0xa25f('0x3b')]=qs[_0xa25f('0x33')](_['pick'](_0x5d39c7['query'],_0x472114[_0xa25f('0x33')]),_0x334629);if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]){_0x41a847['where']=_[_0xa25f('0x3d')](_0x41a847[_0xa25f('0x3b')],{'$or':_[_0xa25f('0x30')](_0x334629,function(_0x49556e){if(_0x49556e['type']!==_0xa25f('0x3e')){var _0x44c9c8={};_0x44c9c8[_0x49556e[_0xa25f('0x29')]]={'$like':'%'+_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]+'%'};return _0x44c9c8;}})});}_0x41a847=_[_0xa25f('0x3d')]({},_0x41a847,_0x5d39c7[_0xa25f('0x3f')]);var _0x3382f4={'where':_0x41a847['where']};return db[_0xa25f('0x2b')][_0xa25f('0x1e')](_0x3382f4)[_0xa25f('0x25')](function(_0x2e886f){_0x208518[_0xa25f('0x1e')]=_0x2e886f;if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x40')]){_0x41a847[_0xa25f('0x41')]=[{'all':!![]}];}return db[_0xa25f('0x2b')][_0xa25f('0x42')](_0x41a847);})[_0xa25f('0x25')](function(_0x3267a0){_0x208518[_0xa25f('0x43')]=_0x3267a0;return _0x208518;})['then'](respondWithFilteredResult(_0x1030c4,_0x41a847))[_0xa25f('0x44')](handleError(_0x1030c4,null));};exports['show']=function(_0xace015,_0x320119){var _0x36afe4={'raw':!![],'where':{'id':_0xace015[_0xa25f('0x45')]['id']}},_0x559874={};_0x559874[_0xa25f('0x2f')]=_[_0xa25f('0x32')](db[_0xa25f('0x2b')]['rawAttributes']);_0x559874[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0xace015[_0xa25f('0x31')]);_0x559874[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x559874[_0xa25f('0x2f')],_0x559874['query']);_0x36afe4[_0xa25f('0x36')]=_[_0xa25f('0x34')](_0x559874['model'],qs[_0xa25f('0x35')](_0xace015[_0xa25f('0x31')][_0xa25f('0x35')]));_0x36afe4[_0xa25f('0x36')]=_0x36afe4[_0xa25f('0x36')][_0xa25f('0x37')]?_0x36afe4[_0xa25f('0x36')]:_0x559874[_0xa25f('0x2f')];if(_0xace015[_0xa25f('0x31')][_0xa25f('0x40')]){_0x36afe4[_0xa25f('0x41')]=[{'all':!![]}];}_0x36afe4=_[_0xa25f('0x3d')]({},_0x36afe4,_0xace015[_0xa25f('0x3f')]);return db['Cdr'][_0xa25f('0x46')](_0x36afe4)[_0xa25f('0x25')](handleEntityNotFound(_0x320119,null))[_0xa25f('0x25')](respondWithResult(_0x320119,null))[_0xa25f('0x44')](handleError(_0x320119,null));};exports['create']=function(_0x34717c,_0x43888b){return db[_0xa25f('0x2b')]['create'](_0x34717c[_0xa25f('0x47')],{})[_0xa25f('0x25')](respondWithResult(_0x43888b,0xc9))[_0xa25f('0x44')](handleError(_0x43888b,null));};exports[_0xa25f('0x24')]=function(_0x18c9f2,_0x3b6d34){if(_0x18c9f2[_0xa25f('0x47')]['id']){delete _0x18c9f2[_0xa25f('0x47')]['id'];}return db['Cdr'][_0xa25f('0x46')]({'where':{'id':_0x18c9f2[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0x3b6d34,null))[_0xa25f('0x25')](saveUpdates(_0x18c9f2[_0xa25f('0x47')],null))[_0xa25f('0x25')](respondWithResult(_0x3b6d34,null))[_0xa25f('0x44')](handleError(_0x3b6d34,null));};exports[_0xa25f('0x26')]=function(_0x26a096,_0xe04d67){return db[_0xa25f('0x2b')][_0xa25f('0x46')]({'where':{'id':_0x26a096[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0xe04d67,null))[_0xa25f('0x25')](removeEntity(_0xe04d67,null))[_0xa25f('0x44')](handleError(_0xe04d67,null));};exports[_0xa25f('0x48')]=function(_0x2fedba,_0x32f719){return db[_0xa25f('0x2b')][_0xa25f('0x48')]()[_0xa25f('0x25')](respondWithResult(_0x32f719,null))['catch'](handleError(_0x32f719,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index a2df47a..df5242d 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x17c21b,_0x164732){var _0x3611c7=function(_0xdffcb4){while(--_0xdffcb4){_0x17c21b['push'](_0x17c21b['shift']());}};_0x3611c7(++_0x164732);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3c9b67,_0x1b021e){var _0x565d95=function(_0x6e77b1){while(--_0x6e77b1){_0x3c9b67['push'](_0x3c9b67['shift']());}};_0x565d95(++_0x1b021e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 3814834..a7bfc44 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 _0x6ae9=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s'];(function(_0x35b8f8,_0x3d269e){var _0x2589ca=function(_0x51906c){while(--_0x51906c){_0x35b8f8['push'](_0x35b8f8['shift']());}};_0x2589ca(++_0x3d269e);}(_0x6ae9,0x76));var _0x96ae=function(_0x39195e,_0x520820){_0x39195e=_0x39195e-0x0;var _0x950e27=_0x6ae9[_0x39195e];return _0x950e27;};'use strict';var _=require(_0x96ae('0x0'));var util=require('util');var moment=require(_0x96ae('0x1'));var BPromise=require(_0x96ae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96ae('0x3'));var db=require(_0x96ae('0x4'))['db'];var utils=require(_0x96ae('0x5'));var logger=require(_0x96ae('0x6'))(_0x96ae('0x7'));var config=require(_0x96ae('0x8'));var jayson=require(_0x96ae('0x9'));var client=jayson[_0x96ae('0xa')][_0x96ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x115222,_0x2a639d,_0x3a6efe){return new BPromise(function(_0x3bf0fc,_0x4adb7c){return client[_0x96ae('0xc')](_0x115222,_0x3a6efe)[_0x96ae('0xd')](function(_0x40b582){logger[_0x96ae('0xe')]('Cdr,\x20%s,\x20%s',_0x2a639d,_0x96ae('0xf'));logger['debug'](_0x96ae('0x10'),_0x2a639d,_0x96ae('0xf'),JSON['stringify'](_0x40b582));if(_0x40b582[_0x96ae('0x11')]){if(_0x40b582[_0x96ae('0x11')][_0x96ae('0x12')]===0x1f4){logger[_0x96ae('0x11')](_0x96ae('0x13'),_0x2a639d,_0x40b582[_0x96ae('0x11')]['message']);return _0x4adb7c(_0x40b582[_0x96ae('0x11')][_0x96ae('0x14')]);}logger[_0x96ae('0x11')](_0x96ae('0x13'),_0x2a639d,_0x40b582[_0x96ae('0x11')][_0x96ae('0x14')]);return _0x3bf0fc(_0x40b582['error'][_0x96ae('0x14')]);}else{logger[_0x96ae('0xe')](_0x96ae('0x13'),_0x2a639d,_0x96ae('0xf'));_0x3bf0fc(_0x40b582[_0x96ae('0x15')][_0x96ae('0x14')]);}})[_0x96ae('0x16')](function(_0x2a0f52){logger[_0x96ae('0x11')](_0x96ae('0x13'),_0x2a639d,_0x2a0f52);_0x4adb7c(_0x2a0f52);});});}
\ No newline at end of file
+var _0x6d04=['http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x136dab,_0x398d92){var _0x1271d7=function(_0x4ee375){while(--_0x4ee375){_0x136dab['push'](_0x136dab['shift']());}};_0x1271d7(++_0x398d92);}(_0x6d04,0x138));var _0x46d0=function(_0x214e18,_0x13189b){_0x214e18=_0x214e18-0x0;var _0x323044=_0x6d04[_0x214e18];return _0x323044;};'use strict';var _=require('lodash');var util=require(_0x46d0('0x0'));var moment=require(_0x46d0('0x1'));var BPromise=require(_0x46d0('0x2'));var rs=require(_0x46d0('0x3'));var fs=require('fs');var Redis=require(_0x46d0('0x4'));var db=require(_0x46d0('0x5'))['db'];var utils=require(_0x46d0('0x6'));var logger=require(_0x46d0('0x7'))(_0x46d0('0x8'));var config=require(_0x46d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x46d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x71d52b,_0x3ad434,_0x2d7101){return new BPromise(function(_0x2c0cee,_0x1e0ae2){return client[_0x46d0('0xb')](_0x71d52b,_0x2d7101)[_0x46d0('0xc')](function(_0x2fd50c){logger[_0x46d0('0xd')](_0x46d0('0xe'),_0x3ad434,_0x46d0('0xf'));logger[_0x46d0('0x10')](_0x46d0('0x11'),_0x3ad434,_0x46d0('0xf'),JSON['stringify'](_0x2fd50c));if(_0x2fd50c['error']){if(_0x2fd50c['error'][_0x46d0('0x12')]===0x1f4){logger[_0x46d0('0x13')](_0x46d0('0xe'),_0x3ad434,_0x2fd50c[_0x46d0('0x13')][_0x46d0('0x14')]);return _0x1e0ae2(_0x2fd50c['error']['message']);}logger[_0x46d0('0x13')]('Cdr,\x20%s,\x20%s',_0x3ad434,_0x2fd50c[_0x46d0('0x13')]['message']);return _0x2c0cee(_0x2fd50c['error'][_0x46d0('0x14')]);}else{logger[_0x46d0('0xd')](_0x46d0('0xe'),_0x3ad434,_0x46d0('0xf'));_0x2c0cee(_0x2fd50c[_0x46d0('0x15')]['message']);}})[_0x46d0('0x16')](function(_0x173467){logger[_0x46d0('0x13')](_0x46d0('0xe'),_0x3ad434,_0x173467);_0x1e0ae2(_0x173467);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3a2b12a..dd1dc7e 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _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(_0x331e66,_0x51064f){var _0x48c43f=function(_0x2fce86){while(--_0x2fce86){_0x331e66['push'](_0x331e66['shift']());}};_0x48c43f(++_0x51064f);}(_0xb10b,0x12a));var _0xbb10=function(_0x10bd94,_0x46b509){_0x10bd94=_0x10bd94-0x0;var _0x364677=_0xb10b[_0x10bd94];return _0x364677;};'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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index dc45e48..1542709 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 _0x6493=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x19d920,_0x4300b4){var _0x7ad1d5=function(_0x2f8317){while(--_0x2f8317){_0x19d920['push'](_0x19d920['shift']());}};_0x7ad1d5(++_0x4300b4);}(_0x6493,0x111));var _0x3649=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x6493[_0x256e32];return _0x464070;};'use strict';var Sequelize=require(_0x3649('0x0'));module[_0x3649('0x1')]={'priority':{'type':Sequelize[_0x3649('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3649('0x3')],'allowNull':![],'defaultValue':_0x3649('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3649('0x3')],'defaultValue':_0x3649('0x5')}};
\ No newline at end of file
+var _0x5073=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0x5073,0x70));var _0x3507=function(_0x43ed38,_0x507af1){_0x43ed38=_0x43ed38-0x0;var _0x181497=_0x5073[_0x43ed38];return _0x181497;};'use strict';var Sequelize=require(_0x3507('0x0'));module[_0x3507('0x1')]={'priority':{'type':Sequelize[_0x3507('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3507('0x3')],'allowNull':![],'defaultValue':_0x3507('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3507('0x3')]},'interval':{'type':Sequelize[_0x3507('0x3')],'defaultValue':_0x3507('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 5560802..62aa8a2 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 _0xb240=['body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find'];(function(_0xffc809,_0x1d0346){var _0x565c72=function(_0x564866){while(--_0x564866){_0xffc809['push'](_0xffc809['shift']());}};_0x565c72(++_0x1d0346);}(_0xb240,0x7e));var _0x0b24=function(_0x449f93,_0x49837b){_0x449f93=_0x449f93-0x0;var _0x1ad49d=_0xb240[_0x449f93];return _0x1ad49d;};'use strict';var emlformat=require(_0x0b24('0x0'));var rimraf=require(_0x0b24('0x1'));var zipdir=require(_0x0b24('0x2'));var jsonpatch=require(_0x0b24('0x3'));var rp=require(_0x0b24('0x4'));var moment=require(_0x0b24('0x5'));var BPromise=require(_0x0b24('0x6'));var Mustache=require(_0x0b24('0x7'));var util=require(_0x0b24('0x8'));var path=require('path');var sox=require(_0x0b24('0x9'));var csv=require(_0x0b24('0xa'));var ejs=require(_0x0b24('0xb'));var fs=require('fs');var fs_extra=require(_0x0b24('0xc'));var _=require(_0x0b24('0xd'));var squel=require('squel');var crypto=require(_0x0b24('0xe'));var jsforce=require(_0x0b24('0xf'));var deskjs=require(_0x0b24('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0b24('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0b24('0x12'));var as=require(_0x0b24('0x13'));var hardwareService=require(_0x0b24('0x14'));var logger=require(_0x0b24('0x15'))(_0x0b24('0x16'));var utils=require(_0x0b24('0x17'));var config=require(_0x0b24('0x18'));var licenseUtil=require(_0x0b24('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46957d,_0x2381a1){_0x2381a1=_0x2381a1||0xcc;return function(_0x4bb796){if(_0x4bb796){return _0x46957d[_0x0b24('0x1a')](_0x2381a1);}return _0x46957d[_0x0b24('0x1b')](_0x2381a1)[_0x0b24('0x1c')]();};}function respondWithResult(_0x452889,_0x5dc21f){_0x5dc21f=_0x5dc21f||0xc8;return function(_0x4b60fc){if(_0x4b60fc){return _0x452889['status'](_0x5dc21f)['json'](_0x4b60fc);}};}function respondWithFilteredResult(_0x2ea61f,_0x1aae67){return function(_0x459bb1){if(_0x459bb1){var _0x5c2ee7=typeof _0x1aae67[_0x0b24('0x1d')]===_0x0b24('0x1e')&&typeof _0x1aae67[_0x0b24('0x1f')]===_0x0b24('0x1e');var _0xa28e7e=_0x459bb1[_0x0b24('0x20')];var _0x5518a5=_0x5c2ee7?0x0:_0x1aae67[_0x0b24('0x1d')];var _0x1d619f=_0x5c2ee7?_0x459bb1['count']:_0x1aae67[_0x0b24('0x1d')]+_0x1aae67['limit'];var _0x5b395f;if(_0x1d619f>=_0xa28e7e){_0x1d619f=_0xa28e7e;_0x5b395f=0xc8;}else{_0x5b395f=0xce;}_0x2ea61f[_0x0b24('0x1b')](_0x5b395f);return _0x2ea61f[_0x0b24('0x21')](_0x0b24('0x22'),_0x5518a5+'-'+_0x1d619f+'/'+_0xa28e7e)['json'](_0x459bb1);}return null;};}function patchUpdates(_0x2fec2b){return function(_0x3c0260){try{jsonpatch['apply'](_0x3c0260,_0x2fec2b,!![]);}catch(_0x20c5d5){return BPromise[_0x0b24('0x23')](_0x20c5d5);}return _0x3c0260[_0x0b24('0x24')]();};}function saveUpdates(_0x1e1746,_0x46124d){return function(_0x3302e4){if(_0x3302e4){return _0x3302e4[_0x0b24('0x25')](_0x1e1746)[_0x0b24('0x26')](function(_0x454500){return _0x454500;});}return null;};}function removeEntity(_0x59483c,_0x55ae1c){return function(_0x1f88cf){if(_0x1f88cf){return _0x1f88cf[_0x0b24('0x27')]()[_0x0b24('0x26')](function(){_0x59483c[_0x0b24('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x294d39,_0x4ef587){return function(_0x1efbfd){if(!_0x1efbfd){_0x294d39[_0x0b24('0x1a')](0x194);}return _0x1efbfd;};}function handleError(_0x2b2053,_0x48a06a){_0x48a06a=_0x48a06a||0x1f4;return function(_0x3cb461){logger[_0x0b24('0x28')](_0x3cb461[_0x0b24('0x29')]);if(_0x3cb461[_0x0b24('0x2a')]){delete _0x3cb461[_0x0b24('0x2a')];}_0x2b2053[_0x0b24('0x1b')](_0x48a06a)[_0x0b24('0x2b')](_0x3cb461);};}exports[_0x0b24('0x2c')]=function(_0xd47f05,_0x408511){var _0xf39f24={'raw':!![],'where':{'id':_0xd47f05[_0x0b24('0x2d')]['id']}},_0x1ab5ee={};_0x1ab5ee[_0x0b24('0x2e')]=_[_0x0b24('0x2f')](db[_0x0b24('0x30')]['rawAttributes']);_0x1ab5ee[_0x0b24('0x31')]=_['keys'](_0xd47f05[_0x0b24('0x31')]);_0x1ab5ee[_0x0b24('0x32')]=_['intersection'](_0x1ab5ee[_0x0b24('0x2e')],_0x1ab5ee[_0x0b24('0x31')]);_0xf39f24[_0x0b24('0x33')]=_[_0x0b24('0x34')](_0x1ab5ee['model'],qs[_0x0b24('0x35')](_0xd47f05[_0x0b24('0x31')]['fields']));_0xf39f24[_0x0b24('0x33')]=_0xf39f24[_0x0b24('0x33')][_0x0b24('0x36')]?_0xf39f24[_0x0b24('0x33')]:_0x1ab5ee[_0x0b24('0x2e')];if(_0xd47f05[_0x0b24('0x31')][_0x0b24('0x37')]){_0xf39f24[_0x0b24('0x38')]=[{'all':!![]}];}_0xf39f24=_[_0x0b24('0x39')]({},_0xf39f24,_0xd47f05[_0x0b24('0x3a')]);return db['ChatApplication'][_0x0b24('0x3b')](_0xf39f24)[_0x0b24('0x26')](handleEntityNotFound(_0x408511,null))[_0x0b24('0x26')](respondWithResult(_0x408511,null))['catch'](handleError(_0x408511,null));};exports[_0x0b24('0x25')]=function(_0x450ea9,_0x6335ff){if(_0x450ea9[_0x0b24('0x3c')]['id']){delete _0x450ea9['body']['id'];}return db[_0x0b24('0x30')][_0x0b24('0x3b')]({'where':{'id':_0x450ea9[_0x0b24('0x2d')]['id']}})[_0x0b24('0x26')](handleEntityNotFound(_0x6335ff,null))[_0x0b24('0x26')](saveUpdates(_0x450ea9[_0x0b24('0x3c')],null))[_0x0b24('0x26')](respondWithResult(_0x6335ff,null))[_0x0b24('0x3d')](handleError(_0x6335ff,null));};exports[_0x0b24('0x27')]=function(_0x248a6e,_0x21e940){return db[_0x0b24('0x30')][_0x0b24('0x3b')]({'where':{'id':_0x248a6e[_0x0b24('0x2d')]['id']}})[_0x0b24('0x26')](handleEntityNotFound(_0x21e940,null))[_0x0b24('0x26')](removeEntity(_0x21e940,null))[_0x0b24('0x3d')](handleError(_0x21e940,null));};
\ No newline at end of file
+var _0x2083=['destroy','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then'];(function(_0x49ab00,_0x4a6554){var _0x28acb2=function(_0x4e65c6){while(--_0x4e65c6){_0x49ab00['push'](_0x49ab00['shift']());}};_0x28acb2(++_0x4a6554);}(_0x2083,0x137));var _0x3208=function(_0x2036c4,_0x4b19d5){_0x2036c4=_0x2036c4-0x0;var _0x4ca2df=_0x2083[_0x2036c4];return _0x4ca2df;};'use strict';var emlformat=require(_0x3208('0x0'));var rimraf=require(_0x3208('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3208('0x2'));var rp=require(_0x3208('0x3'));var moment=require(_0x3208('0x4'));var BPromise=require(_0x3208('0x5'));var Mustache=require(_0x3208('0x6'));var util=require(_0x3208('0x7'));var path=require(_0x3208('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3208('0x9'));var _=require(_0x3208('0xa'));var squel=require(_0x3208('0xb'));var crypto=require(_0x3208('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3208('0xd'));var toCsv=require(_0x3208('0xe'));var querystring=require(_0x3208('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3208('0x10'));var qs=require(_0x3208('0x11'));var as=require(_0x3208('0x12'));var hardwareService=require(_0x3208('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3208('0x14'));var config=require(_0x3208('0x15'));var licenseUtil=require(_0x3208('0x16'));var db=require(_0x3208('0x17'))['db'];function respondWithStatusCode(_0x174620,_0x394883){_0x394883=_0x394883||0xcc;return function(_0xf232e5){if(_0xf232e5){return _0x174620[_0x3208('0x18')](_0x394883);}return _0x174620[_0x3208('0x19')](_0x394883)[_0x3208('0x1a')]();};}function respondWithResult(_0x3deca8,_0x14c24f){_0x14c24f=_0x14c24f||0xc8;return function(_0xa5067){if(_0xa5067){return _0x3deca8[_0x3208('0x19')](_0x14c24f)['json'](_0xa5067);}};}function respondWithFilteredResult(_0x2f1eaf,_0x153cf8){return function(_0x41cdcf){if(_0x41cdcf){var _0x1ef359=typeof _0x153cf8[_0x3208('0x1b')]==='undefined'&&typeof _0x153cf8[_0x3208('0x1c')]===_0x3208('0x1d');var _0x4c1e4d=_0x41cdcf[_0x3208('0x1e')];var _0x3590c5=_0x1ef359?0x0:_0x153cf8[_0x3208('0x1b')];var _0x28e291=_0x1ef359?_0x41cdcf[_0x3208('0x1e')]:_0x153cf8[_0x3208('0x1b')]+_0x153cf8['limit'];var _0x3d44bd;if(_0x28e291>=_0x4c1e4d){_0x28e291=_0x4c1e4d;_0x3d44bd=0xc8;}else{_0x3d44bd=0xce;}_0x2f1eaf[_0x3208('0x19')](_0x3d44bd);return _0x2f1eaf[_0x3208('0x1f')](_0x3208('0x20'),_0x3590c5+'-'+_0x28e291+'/'+_0x4c1e4d)[_0x3208('0x21')](_0x41cdcf);}return null;};}function patchUpdates(_0x46b227){return function(_0x468cca){try{jsonpatch['apply'](_0x468cca,_0x46b227,!![]);}catch(_0x42d97a){return BPromise[_0x3208('0x22')](_0x42d97a);}return _0x468cca['save']();};}function saveUpdates(_0x28d665,_0x361d1c){return function(_0x3c6e34){if(_0x3c6e34){return _0x3c6e34[_0x3208('0x23')](_0x28d665)[_0x3208('0x24')](function(_0x2ce30e){return _0x2ce30e;});}return null;};}function removeEntity(_0x4673c2,_0x523d75){return function(_0x54aa98){if(_0x54aa98){return _0x54aa98[_0x3208('0x25')]()[_0x3208('0x24')](function(){_0x4673c2[_0x3208('0x19')](0xcc)[_0x3208('0x1a')]();});}};}function handleEntityNotFound(_0x14e491,_0x21dc00){return function(_0x47a021){if(!_0x47a021){_0x14e491[_0x3208('0x18')](0x194);}return _0x47a021;};}function handleError(_0x125ae3,_0x270c69){_0x270c69=_0x270c69||0x1f4;return function(_0x10e471){logger['error'](_0x10e471[_0x3208('0x26')]);if(_0x10e471[_0x3208('0x27')]){delete _0x10e471[_0x3208('0x27')];}_0x125ae3['status'](_0x270c69)[_0x3208('0x28')](_0x10e471);};}exports[_0x3208('0x29')]=function(_0xf9e10c,_0x22b561){var _0x283193={'raw':!![],'where':{'id':_0xf9e10c[_0x3208('0x2a')]['id']}},_0x2b153f={};_0x2b153f[_0x3208('0x2b')]=_[_0x3208('0x2c')](db[_0x3208('0x2d')][_0x3208('0x2e')]);_0x2b153f[_0x3208('0x2f')]=_[_0x3208('0x2c')](_0xf9e10c[_0x3208('0x2f')]);_0x2b153f['filters']=_['intersection'](_0x2b153f[_0x3208('0x2b')],_0x2b153f[_0x3208('0x2f')]);_0x283193[_0x3208('0x30')]=_['intersection'](_0x2b153f[_0x3208('0x2b')],qs[_0x3208('0x31')](_0xf9e10c['query'][_0x3208('0x31')]));_0x283193[_0x3208('0x30')]=_0x283193[_0x3208('0x30')][_0x3208('0x32')]?_0x283193[_0x3208('0x30')]:_0x2b153f[_0x3208('0x2b')];if(_0xf9e10c[_0x3208('0x2f')][_0x3208('0x33')]){_0x283193[_0x3208('0x34')]=[{'all':!![]}];}_0x283193=_[_0x3208('0x35')]({},_0x283193,_0xf9e10c[_0x3208('0x36')]);return db[_0x3208('0x2d')][_0x3208('0x37')](_0x283193)['then'](handleEntityNotFound(_0x22b561,null))[_0x3208('0x24')](respondWithResult(_0x22b561,null))[_0x3208('0x38')](handleError(_0x22b561,null));};exports['update']=function(_0x93b8cd,_0x17f0f6){if(_0x93b8cd[_0x3208('0x39')]['id']){delete _0x93b8cd[_0x3208('0x39')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x93b8cd[_0x3208('0x2a')]['id']}})['then'](handleEntityNotFound(_0x17f0f6,null))[_0x3208('0x24')](saveUpdates(_0x93b8cd[_0x3208('0x39')],null))[_0x3208('0x24')](respondWithResult(_0x17f0f6,null))[_0x3208('0x38')](handleError(_0x17f0f6,null));};exports[_0x3208('0x25')]=function(_0x1588f4,_0x7544fc){return db[_0x3208('0x2d')][_0x3208('0x37')]({'where':{'id':_0x1588f4['params']['id']}})[_0x3208('0x24')](handleEntityNotFound(_0x7544fc,null))['then'](removeEntity(_0x7544fc,null))[_0x3208('0x38')](handleError(_0x7544fc,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 58b73eb..1e9a4bf 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 _0xb5fc=['chat_applications','utf8mb4','utf8mb4_unicode_ci','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0xb5fc,0x71));var _0xcb5f=function(_0x50b745,_0x21d186){_0x50b745=_0x50b745-0x0;var _0x5610b0=_0xb5fc[_0x50b745];return _0x5610b0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcb5f('0x0'));var BPromise=require('bluebird');var rp=require(_0xcb5f('0x1'));var fs=require('fs');var path=require(_0xcb5f('0x2'));var rimraf=require(_0xcb5f('0x3'));var config=require(_0xcb5f('0x4'));var attributes=require(_0xcb5f('0x5'));module[_0xcb5f('0x6')]=function(_0x11dbbd,_0x490028){return _0x11dbbd[_0xcb5f('0x7')]('ChatApplication',attributes,{'tableName':_0xcb5f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb5f('0x9'),'collate':_0xcb5f('0xa')});};
\ No newline at end of file
+var _0xae99=['bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x38d5a2,_0xb0c589){var _0xba6e14=function(_0x4ae367){while(--_0x4ae367){_0x38d5a2['push'](_0x38d5a2['shift']());}};_0xba6e14(++_0xb0c589);}(_0xae99,0x172));var _0x9ae9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xae99[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9ae9('0x0'));var util=require(_0x9ae9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9ae9('0x2'));var rp=require(_0x9ae9('0x3'));var fs=require('fs');var path=require(_0x9ae9('0x4'));var rimraf=require(_0x9ae9('0x5'));var config=require(_0x9ae9('0x6'));var attributes=require(_0x9ae9('0x7'));module[_0x9ae9('0x8')]=function(_0x49066e,_0x5a1ba5){return _0x49066e['define'](_0x9ae9('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ae9('0xa'),'collate':_0x9ae9('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index f88bf66..47df089 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 _0x3cf9=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','ChatApplication,\x20%s,\x20%s','info','result'];(function(_0x42cc87,_0x563421){var _0x30d03e=function(_0x5c7f4d){while(--_0x5c7f4d){_0x42cc87['push'](_0x42cc87['shift']());}};_0x30d03e(++_0x563421);}(_0x3cf9,0xb9));var _0x93cf=function(_0x504838,_0x20bd24){_0x504838=_0x504838-0x0;var _0x2eb0a2=_0x3cf9[_0x504838];return _0x2eb0a2;};'use strict';var _=require(_0x93cf('0x0'));var util=require(_0x93cf('0x1'));var moment=require('moment');var BPromise=require(_0x93cf('0x2'));var rs=require(_0x93cf('0x3'));var fs=require('fs');var Redis=require(_0x93cf('0x4'));var db=require(_0x93cf('0x5'))['db'];var utils=require(_0x93cf('0x6'));var logger=require(_0x93cf('0x7'))(_0x93cf('0x8'));var config=require('../../config/environment');var jayson=require(_0x93cf('0x9'));var client=jayson[_0x93cf('0xa')][_0x93cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ee7ca,_0x432b5c,_0x5729b4){return new BPromise(function(_0x37cfaa,_0x3c3757){return client[_0x93cf('0xc')](_0x4ee7ca,_0x5729b4)['then'](function(_0x3ae37a){logger['info']('ChatApplication,\x20%s,\x20%s',_0x432b5c,_0x93cf('0xd'));logger[_0x93cf('0xe')](_0x93cf('0xf'),_0x432b5c,'request\x20sent',JSON['stringify'](_0x3ae37a));if(_0x3ae37a[_0x93cf('0x10')]){if(_0x3ae37a['error'][_0x93cf('0x11')]===0x1f4){logger[_0x93cf('0x10')]('ChatApplication,\x20%s,\x20%s',_0x432b5c,_0x3ae37a[_0x93cf('0x10')][_0x93cf('0x12')]);return _0x3c3757(_0x3ae37a[_0x93cf('0x10')][_0x93cf('0x12')]);}logger[_0x93cf('0x10')](_0x93cf('0x13'),_0x432b5c,_0x3ae37a[_0x93cf('0x10')][_0x93cf('0x12')]);return _0x37cfaa(_0x3ae37a[_0x93cf('0x10')][_0x93cf('0x12')]);}else{logger[_0x93cf('0x14')](_0x93cf('0x13'),_0x432b5c,_0x93cf('0xd'));_0x37cfaa(_0x3ae37a[_0x93cf('0x15')]['message']);}})[_0x93cf('0x16')](function(_0x3b9a5d){logger[_0x93cf('0x10')](_0x93cf('0x13'),_0x432b5c,_0x3b9a5d);_0x3c3757(_0x3b9a5d);});});}
\ No newline at end of file
+var _0x1145=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0x1145,0xb7));var _0x5114=function(_0x509079,_0x5df8e4){_0x509079=_0x509079-0x0;var _0x3d2112=_0x1145[_0x509079];return _0x3d2112;};'use strict';var _=require(_0x5114('0x0'));var util=require('util');var moment=require(_0x5114('0x1'));var BPromise=require(_0x5114('0x2'));var rs=require(_0x5114('0x3'));var fs=require('fs');var Redis=require(_0x5114('0x4'));var db=require(_0x5114('0x5'))['db'];var utils=require(_0x5114('0x6'));var logger=require(_0x5114('0x7'))(_0x5114('0x8'));var config=require('../../config/environment');var jayson=require(_0x5114('0x9'));var client=jayson[_0x5114('0xa')][_0x5114('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a5b2f,_0x2ed2ba,_0x52f7f2){return new BPromise(function(_0x52d11d,_0x1d0670){return client['request'](_0x3a5b2f,_0x52f7f2)['then'](function(_0x24c868){logger[_0x5114('0xc')](_0x5114('0xd'),_0x2ed2ba,'request\x20sent');logger['debug'](_0x5114('0xe'),_0x2ed2ba,_0x5114('0xf'),JSON[_0x5114('0x10')](_0x24c868));if(_0x24c868[_0x5114('0x11')]){if(_0x24c868[_0x5114('0x11')][_0x5114('0x12')]===0x1f4){logger[_0x5114('0x11')]('ChatApplication,\x20%s,\x20%s',_0x2ed2ba,_0x24c868[_0x5114('0x11')]['message']);return _0x1d0670(_0x24c868[_0x5114('0x11')][_0x5114('0x13')]);}logger[_0x5114('0x11')](_0x5114('0xd'),_0x2ed2ba,_0x24c868[_0x5114('0x11')][_0x5114('0x13')]);return _0x52d11d(_0x24c868[_0x5114('0x11')][_0x5114('0x13')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x2ed2ba,_0x5114('0xf'));_0x52d11d(_0x24c868['result'][_0x5114('0x13')]);}})[_0x5114('0x14')](function(_0x47e4da){logger['error']('ChatApplication,\x20%s,\x20%s',_0x2ed2ba,_0x47e4da);_0x1d0670(_0x47e4da);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 7512d2b..5ed4777 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 _0x5ab4=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete'];(function(_0x375bfd,_0x7c9e97){var _0x5ae9af=function(_0x1b8e61){while(--_0x1b8e61){_0x375bfd['push'](_0x375bfd['shift']());}};_0x5ae9af(++_0x7c9e97);}(_0x5ab4,0x79));var _0x45ab=function(_0x31c212,_0x23883f){_0x31c212=_0x31c212-0x0;var _0x12a69c=_0x5ab4[_0x31c212];return _0x12a69c;};'use strict';var multer=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var path=require(_0x45ab('0x2'));var timeout=require(_0x45ab('0x3'));var express=require('express');var router=express[_0x45ab('0x4')]();var fs_extra=require(_0x45ab('0x5'));var auth=require(_0x45ab('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x45ab('0x7'));router[_0x45ab('0x8')](_0x45ab('0x9'),auth[_0x45ab('0xa')](),controller[_0x45ab('0xb')]);router[_0x45ab('0xc')](_0x45ab('0x9'),auth[_0x45ab('0xa')](),controller['update']);router[_0x45ab('0xd')](_0x45ab('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x45ab('0xe')]=router;
\ No newline at end of file
+var _0xbae6=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x4287cc,_0x56dffe){var _0x2979ac=function(_0x10cdca){while(--_0x10cdca){_0x4287cc['push'](_0x4287cc['shift']());}};_0x2979ac(++_0x56dffe);}(_0xbae6,0xe4));var _0x6bae=function(_0x222be1,_0x317d8a){_0x222be1=_0x222be1-0x0;var _0x2b1d5d=_0xbae6[_0x222be1];return _0x2b1d5d;};'use strict';var multer=require('multer');var util=require(_0x6bae('0x0'));var path=require(_0x6bae('0x1'));var timeout=require('connect-timeout');var express=require(_0x6bae('0x2'));var router=express[_0x6bae('0x3')]();var fs_extra=require(_0x6bae('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6bae('0x5'));var controller=require(_0x6bae('0x6'));router[_0x6bae('0x7')](_0x6bae('0x8'),auth[_0x6bae('0x9')](),controller[_0x6bae('0xa')]);router[_0x6bae('0xb')]('/:id',auth[_0x6bae('0x9')](),controller[_0x6bae('0xc')]);router[_0x6bae('0xd')](_0x6bae('0x8'),auth['isAuthenticated'](),controller[_0x6bae('0xe')]);module[_0x6bae('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 1e078a5..82117b6 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 _0x6657=['STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6657,0x17f));var _0x7665=function(_0x536696,_0x5e2859){_0x536696=_0x536696-0x0;var _0x2c3bea=_0x6657[_0x536696];return _0x2c3bea;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'name':{'type':Sequelize[_0x7665('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7665('0x1')]},'write':{'type':Sequelize[_0x7665('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xab00=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5dad79,_0x1432bd){var _0x5551d6=function(_0x37df52){while(--_0x37df52){_0x5dad79['push'](_0x5dad79['shift']());}};_0x5551d6(++_0x1432bd);}(_0xab00,0x1b9));var _0x0ab0=function(_0x3a9566,_0x1fb2d5){_0x3a9566=_0x3a9566-0x0;var _0x14c055=_0xab00[_0x3a9566];return _0x14c055;};'use strict';var Sequelize=require(_0x0ab0('0x0'));module[_0x0ab0('0x1')]={'name':{'type':Sequelize[_0x0ab0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x0ab0('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index ef1df9a..150ae77 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 _0x063c=['create','body','find','params','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','ChatGroupId','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','desk.js','../../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','./chatGroup.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','ChatGroup','catch','show','length'];(function(_0x2ef207,_0x3c1578){var _0x2c3da9=function(_0x2d51a4){while(--_0x2d51a4){_0x2ef207['push'](_0x2ef207['shift']());}};_0x2c3da9(++_0x3c1578);}(_0x063c,0x1e5));var _0xc063=function(_0x4cc6d6,_0xf3974c){_0x4cc6d6=_0x4cc6d6-0x0;var _0x2b2342=_0x063c[_0x4cc6d6];return _0x2b2342;};'use strict';var emlformat=require(_0xc063('0x0'));var rimraf=require(_0xc063('0x1'));var zipdir=require(_0xc063('0x2'));var jsonpatch=require(_0xc063('0x3'));var rp=require('request-promise');var moment=require(_0xc063('0x4'));var BPromise=require(_0xc063('0x5'));var Mustache=require('mustache');var util=require(_0xc063('0x6'));var path=require(_0xc063('0x7'));var sox=require(_0xc063('0x8'));var csv=require(_0xc063('0x9'));var ejs=require(_0xc063('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc063('0xb'));var toCsv=require(_0xc063('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc063('0xc'));var qs=require(_0xc063('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc063('0xe'));var logger=require(_0xc063('0xf'))(_0xc063('0x10'));var utils=require(_0xc063('0x11'));var config=require(_0xc063('0x12'));var licenseUtil=require(_0xc063('0x13'));var db=require(_0xc063('0x14'))['db'];config[_0xc063('0x15')]=_[_0xc063('0x16')](config['redis'],{'host':_0xc063('0x17'),'port':0x18eb});var socket=require(_0xc063('0x18'))(new Redis(config[_0xc063('0x15')]));require(_0xc063('0x19'))[_0xc063('0x1a')](socket);function respondWithStatusCode(_0xcddc54,_0x55c0bc){_0x55c0bc=_0x55c0bc||0xcc;return function(_0x3e995b){if(_0x3e995b){return _0xcddc54[_0xc063('0x1b')](_0x55c0bc);}return _0xcddc54['status'](_0x55c0bc)[_0xc063('0x1c')]();};}function respondWithResult(_0xb0752a,_0x129ccc){_0x129ccc=_0x129ccc||0xc8;return function(_0x2b19b0){if(_0x2b19b0){return _0xb0752a['status'](_0x129ccc)['json'](_0x2b19b0);}};}function respondWithFilteredResult(_0x320d19,_0x4d0a47){return function(_0x1f147e){if(_0x1f147e){var _0x4c3810=typeof _0x4d0a47[_0xc063('0x1d')]===_0xc063('0x1e')&&typeof _0x4d0a47[_0xc063('0x1f')]===_0xc063('0x1e');var _0x14d9c7=_0x1f147e[_0xc063('0x20')];var _0x53b107=_0x4c3810?0x0:_0x4d0a47[_0xc063('0x1d')];var _0x4fc921=_0x4c3810?_0x1f147e['count']:_0x4d0a47[_0xc063('0x1d')]+_0x4d0a47[_0xc063('0x1f')];var _0x175553;if(_0x4fc921>=_0x14d9c7){_0x4fc921=_0x14d9c7;_0x175553=0xc8;}else{_0x175553=0xce;}_0x320d19[_0xc063('0x21')](_0x175553);return _0x320d19[_0xc063('0x22')](_0xc063('0x23'),_0x53b107+'-'+_0x4fc921+'/'+_0x14d9c7)[_0xc063('0x24')](_0x1f147e);}return null;};}function patchUpdates(_0x2aacef){return function(_0x5c9613){try{jsonpatch['apply'](_0x5c9613,_0x2aacef,!![]);}catch(_0x28973a){return BPromise[_0xc063('0x25')](_0x28973a);}return _0x5c9613[_0xc063('0x26')]();};}function saveUpdates(_0xdad7a2,_0x5dcba5){return function(_0x261d56){if(_0x261d56){return _0x261d56[_0xc063('0x27')](_0xdad7a2)[_0xc063('0x28')](function(_0x426a42){return _0x426a42;});}return null;};}function removeEntity(_0x339b0b,_0xb64b58){return function(_0x534431){if(_0x534431){return _0x534431['destroy']()[_0xc063('0x28')](function(){_0x339b0b['status'](0xcc)[_0xc063('0x1c')]();});}};}function handleEntityNotFound(_0x5796b3,_0x2918eb){return function(_0x5cfe6a){if(!_0x5cfe6a){_0x5796b3[_0xc063('0x1b')](0x194);}return _0x5cfe6a;};}function handleError(_0x3d9da,_0x168fff){_0x168fff=_0x168fff||0x1f4;return function(_0x497d6a){logger[_0xc063('0x29')](_0x497d6a[_0xc063('0x2a')]);if(_0x497d6a[_0xc063('0x2b')]){delete _0x497d6a['name'];}_0x3d9da[_0xc063('0x21')](_0x168fff)[_0xc063('0x2c')](_0x497d6a);};}exports[_0xc063('0x2d')]=function(_0x3a8f90,_0x333de1){var _0x1edb26={},_0x34f05c={},_0x4c7308={'count':0x0,'rows':[]};var _0x526104=_[_0xc063('0x2e')](db['ChatGroup'][_0xc063('0x2f')],function(_0x16259c){return{'name':_0x16259c[_0xc063('0x30')],'type':_0x16259c[_0xc063('0x31')]['key']};});_0x34f05c['model']=_[_0xc063('0x2e')](_0x526104,_0xc063('0x2b'));_0x34f05c[_0xc063('0x32')]=_[_0xc063('0x33')](_0x3a8f90[_0xc063('0x32')]);_0x34f05c[_0xc063('0x34')]=_[_0xc063('0x35')](_0x34f05c[_0xc063('0x36')],_0x34f05c[_0xc063('0x32')]);_0x1edb26[_0xc063('0x37')]=_[_0xc063('0x35')](_0x34f05c[_0xc063('0x36')],qs[_0xc063('0x38')](_0x3a8f90[_0xc063('0x32')][_0xc063('0x38')]));_0x1edb26[_0xc063('0x37')]=_0x1edb26[_0xc063('0x37')]['length']?_0x1edb26[_0xc063('0x37')]:_0x34f05c[_0xc063('0x36')];if(!_0x3a8f90[_0xc063('0x32')][_0xc063('0x39')](_0xc063('0x3a'))){_0x1edb26[_0xc063('0x1f')]=qs[_0xc063('0x1f')](_0x3a8f90[_0xc063('0x32')][_0xc063('0x1f')]);_0x1edb26[_0xc063('0x1d')]=qs[_0xc063('0x1d')](_0x3a8f90[_0xc063('0x32')][_0xc063('0x1d')]);}_0x1edb26[_0xc063('0x3b')]=qs['sort'](_0x3a8f90[_0xc063('0x32')][_0xc063('0x3c')]);_0x1edb26[_0xc063('0x3d')]=qs['filters'](_[_0xc063('0x3e')](_0x3a8f90[_0xc063('0x32')],_0x34f05c[_0xc063('0x34')]),_0x526104);if(_0x3a8f90[_0xc063('0x32')]['filter']){_0x1edb26[_0xc063('0x3d')]=_['merge'](_0x1edb26['where'],{'$or':_[_0xc063('0x2e')](_0x526104,function(_0x2d756a){if(_0x2d756a[_0xc063('0x31')]!==_0xc063('0x3f')){var _0x4d3c12={};_0x4d3c12[_0x2d756a['name']]={'$like':'%'+_0x3a8f90['query'][_0xc063('0x40')]+'%'};return _0x4d3c12;}})});}_0x1edb26=_[_0xc063('0x41')]({},_0x1edb26,_0x3a8f90[_0xc063('0x42')]);var _0x331905={'where':_0x1edb26['where']};return db['ChatGroup']['count'](_0x331905)[_0xc063('0x28')](function(_0x4f781d){_0x4c7308[_0xc063('0x20')]=_0x4f781d;if(_0x3a8f90[_0xc063('0x32')][_0xc063('0x43')]){_0x1edb26[_0xc063('0x44')]=[{'all':!![]}];}return db[_0xc063('0x45')]['findAll'](_0x1edb26);})[_0xc063('0x28')](function(_0x2a8619){_0x4c7308['rows']=_0x2a8619;return _0x4c7308;})[_0xc063('0x28')](respondWithFilteredResult(_0x333de1,_0x1edb26))[_0xc063('0x46')](handleError(_0x333de1,null));};exports[_0xc063('0x47')]=function(_0x566252,_0x7b90a5){var _0x225347={'raw':!![],'where':{'id':_0x566252['params']['id']}},_0x121bda={};_0x121bda['model']=_[_0xc063('0x33')](db[_0xc063('0x45')][_0xc063('0x2f')]);_0x121bda[_0xc063('0x32')]=_[_0xc063('0x33')](_0x566252[_0xc063('0x32')]);_0x121bda[_0xc063('0x34')]=_[_0xc063('0x35')](_0x121bda[_0xc063('0x36')],_0x121bda[_0xc063('0x32')]);_0x225347[_0xc063('0x37')]=_['intersection'](_0x121bda[_0xc063('0x36')],qs[_0xc063('0x38')](_0x566252[_0xc063('0x32')][_0xc063('0x38')]));_0x225347[_0xc063('0x37')]=_0x225347[_0xc063('0x37')][_0xc063('0x48')]?_0x225347[_0xc063('0x37')]:_0x121bda[_0xc063('0x36')];if(_0x566252['query'][_0xc063('0x43')]){_0x225347[_0xc063('0x44')]=[{'all':!![]}];}_0x225347=_['merge']({},_0x225347,_0x566252[_0xc063('0x42')]);return db['ChatGroup']['find'](_0x225347)[_0xc063('0x28')](handleEntityNotFound(_0x7b90a5,null))[_0xc063('0x28')](respondWithResult(_0x7b90a5,null))[_0xc063('0x46')](handleError(_0x7b90a5,null));};exports[_0xc063('0x49')]=function(_0x5cd135,_0x24af35){return db[_0xc063('0x45')][_0xc063('0x49')](_0x5cd135[_0xc063('0x4a')],{})[_0xc063('0x28')](respondWithResult(_0x24af35,0xc9))[_0xc063('0x46')](handleError(_0x24af35,null));};exports[_0xc063('0x27')]=function(_0x120228,_0x4c0f54){if(_0x120228['body']['id']){delete _0x120228['body']['id'];}return db[_0xc063('0x45')][_0xc063('0x4b')]({'where':{'id':_0x120228[_0xc063('0x4c')]['id']}})[_0xc063('0x28')](handleEntityNotFound(_0x4c0f54,null))[_0xc063('0x28')](saveUpdates(_0x120228['body'],null))[_0xc063('0x28')](respondWithResult(_0x4c0f54,null))[_0xc063('0x46')](handleError(_0x4c0f54,null));};exports[_0xc063('0x4d')]=function(_0x15278b,_0x48aae1){return db['ChatGroup']['find']({'where':{'id':_0x15278b[_0xc063('0x4c')]['id']}})[_0xc063('0x28')](handleEntityNotFound(_0x48aae1,null))[_0xc063('0x28')](removeEntity(_0x48aae1,null))['catch'](handleError(_0x48aae1,null));};exports['describe']=function(_0x396a2c,_0x32f05a){return db['ChatGroup'][_0xc063('0x4e')]()['then'](respondWithResult(_0x32f05a,null))[_0xc063('0x46')](handleError(_0x32f05a,null));};exports[_0xc063('0x4f')]=function(_0x7c0e82,_0x42626d,_0x4f3c10){return db[_0xc063('0x50')][_0xc063('0x20')]({'where':{'ChatGroupId':_0x7c0e82['params']['id'],'ToId':_0x7c0e82['user']['id'],'read':![]}})['then'](function(_0x167570){return{'id':_[_0xc063('0x51')](_0x7c0e82[_0xc063('0x4c')]['id']),'count':_0x167570};})[_0xc063('0x28')](respondWithResult(_0x42626d,null))['catch'](handleError(_0x42626d,null));};exports[_0xc063('0x52')]=function(_0x2c71ab,_0x2852ee,_0x5b392c){return db['ChatGroup'][_0xc063('0x4b')]({'where':{'id':_0x2c71ab[_0xc063('0x4c')]['id']}})[_0xc063('0x28')](handleEntityNotFound(_0x2852ee,null))[_0xc063('0x28')](function(_0x789ec8){if(_0x789ec8){return _0x789ec8[_0xc063('0x52')](_0x2c71ab[_0xc063('0x4a')][_0xc063('0x53')],_[_0xc063('0x54')](_0x2c71ab[_0xc063('0x4a')],[_0xc063('0x53'),'id'])||{});}})['then'](respondWithResult(_0x2852ee,null))[_0xc063('0x46')](handleError(_0x2852ee,null));};exports[_0xc063('0x55')]=function(_0x35c458,_0x50dd29,_0x1140f3){var _0x4c93bd={};var _0x48eb48={};var _0x1e341e;var _0x4b7470;return db[_0xc063('0x45')][_0xc063('0x56')]({'where':{'id':_0x35c458[_0xc063('0x4c')]['id']}})['then'](handleEntityNotFound(_0x50dd29,null))[_0xc063('0x28')](function(_0x3031a7){if(_0x3031a7){_0x1e341e=_0x3031a7;_0x48eb48[_0xc063('0x36')]=_['keys'](db[_0xc063('0x57')]['rawAttributes']);_0x48eb48[_0xc063('0x32')]=_[_0xc063('0x33')](_0x35c458[_0xc063('0x32')]);_0x48eb48['filters']=_[_0xc063('0x35')](_0x48eb48[_0xc063('0x36')],_0x48eb48[_0xc063('0x32')]);_0x4c93bd['attributes']=_['intersection'](_0x48eb48['model'],qs['fields'](_0x35c458['query'][_0xc063('0x38')]));_0x4c93bd['attributes']=_0x4c93bd[_0xc063('0x37')][_0xc063('0x48')]?_0x4c93bd['attributes']:_0x48eb48['model'];_0x4c93bd[_0xc063('0x3b')]=qs[_0xc063('0x3c')](_0x35c458[_0xc063('0x32')][_0xc063('0x3c')]);_0x4c93bd[_0xc063('0x3d')]=qs[_0xc063('0x34')](_['pick'](_0x35c458[_0xc063('0x32')],_0x48eb48[_0xc063('0x34')]));if(_0x35c458[_0xc063('0x32')]['filter']){_0x4c93bd[_0xc063('0x3d')]=_[_0xc063('0x41')](_0x4c93bd[_0xc063('0x3d')],{'$or':_[_0xc063('0x2e')](_0x4c93bd[_0xc063('0x37')],function(_0x22ffe0){var _0x42e244={};_0x42e244[_0x22ffe0]={'$like':'%'+_0x35c458[_0xc063('0x32')][_0xc063('0x40')]+'%'};return _0x42e244;})});}_0x4c93bd=_[_0xc063('0x41')]({},_0x4c93bd,_0x35c458[_0xc063('0x42')]);return _0x1e341e[_0xc063('0x55')](_0x4c93bd);}})['then'](function(_0x451497){if(_0x451497){_0x4b7470=_0x451497['length'];if(!_0x35c458['query'][_0xc063('0x39')](_0xc063('0x3a'))){_0x4c93bd[_0xc063('0x1f')]=qs['limit'](_0x35c458[_0xc063('0x32')][_0xc063('0x1f')]);_0x4c93bd[_0xc063('0x1d')]=qs['offset'](_0x35c458[_0xc063('0x32')][_0xc063('0x1d')]);}return _0x1e341e['getMembers'](_0x4c93bd);}})['then'](function(_0xd2ff78){if(_0xd2ff78){return _0xd2ff78?{'count':_0x4b7470,'rows':_0xd2ff78}:null;}})[_0xc063('0x28')](respondWithResult(_0x50dd29,null))[_0xc063('0x46')](handleError(_0x50dd29,null));};exports[_0xc063('0x58')]=function(_0xeb6b2a,_0x951f7,_0x5b9cff){return db[_0xc063('0x45')][_0xc063('0x4b')]({'where':{'id':_0xeb6b2a[_0xc063('0x4c')]['id']}})['then'](handleEntityNotFound(_0x951f7,null))[_0xc063('0x28')](function(_0x464abd){if(_0x464abd){return _0x464abd[_0xc063('0x58')](_0xeb6b2a['query'][_0xc063('0x53')]);}})['then'](respondWithStatusCode(_0x951f7,null))[_0xc063('0x46')](handleError(_0x951f7,null));};exports['addMessage']=function(_0xa3f57c,_0x2be3ed,_0x16a04b){if(_0xa3f57c[_0xc063('0x4a')]['id']){delete _0xa3f57c[_0xc063('0x4a')]['id'];}return db[_0xc063('0x45')][_0xc063('0x4b')]({'where':{'id':_0xa3f57c[_0xc063('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2be3ed,null))[_0xc063('0x28')](function(_0x4fdb02){if(_0x4fdb02){_0xa3f57c[_0xc063('0x4a')][_0xc063('0x59')]=_0x4fdb02['id'];return db[_0xc063('0x50')][_0xc063('0x49')](_0xa3f57c['body']);}})['then'](respondWithResult(_0x2be3ed,null))[_0xc063('0x46')](handleError(_0x2be3ed,null));};exports[_0xc063('0x5a')]=function(_0x37d8d1,_0x522273,_0x1ae03c){var _0x381662={};var _0x215491={};var _0x3acfbc;var _0x431f81;return db[_0xc063('0x45')][_0xc063('0x56')]({'where':{'id':_0x37d8d1['params']['id']}})[_0xc063('0x28')](handleEntityNotFound(_0x522273,null))[_0xc063('0x28')](function(_0x4c363c){if(_0x4c363c){_0x3acfbc=_0x4c363c;_0x215491['model']=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x215491[_0xc063('0x32')]=_[_0xc063('0x33')](_0x37d8d1[_0xc063('0x32')]);_0x215491[_0xc063('0x34')]=_[_0xc063('0x35')](_0x215491[_0xc063('0x36')],_0x215491[_0xc063('0x32')]);_0x381662[_0xc063('0x37')]=_[_0xc063('0x35')](_0x215491[_0xc063('0x36')],qs['fields'](_0x37d8d1[_0xc063('0x32')][_0xc063('0x38')]));_0x381662[_0xc063('0x37')]=_0x381662['attributes'][_0xc063('0x48')]?_0x381662[_0xc063('0x37')]:_0x215491[_0xc063('0x36')];_0x381662[_0xc063('0x3b')]=qs['sort'](_0x37d8d1[_0xc063('0x32')][_0xc063('0x3c')]);_0x381662[_0xc063('0x3d')]=qs[_0xc063('0x34')](_[_0xc063('0x3e')](_0x37d8d1['query'],_0x215491[_0xc063('0x34')]));if(_0x37d8d1['query'][_0xc063('0x40')]){_0x381662[_0xc063('0x3d')]=_['merge'](_0x381662[_0xc063('0x3d')],{'$or':_['map'](_0x381662[_0xc063('0x37')],function(_0x29d5b1){var _0x300459={};_0x300459[_0x29d5b1]={'$like':'%'+_0x37d8d1[_0xc063('0x32')][_0xc063('0x40')]+'%'};return _0x300459;})});}if(_0x37d8d1[_0xc063('0x32')][_0xc063('0x5b')]){var _0x5d34e9=_0x37d8d1['query'][_0xc063('0x5b')]['split'](',');var _0x4d6dd3={};_0x4d6dd3[_0x5d34e9[0x0]]={'$gte':moment(_0x5d34e9[0x1])['format'](_0xc063('0x5c'))};_0x381662[_0xc063('0x3d')]=_[_0xc063('0x41')](_0x381662[_0xc063('0x3d')],_0x4d6dd3);}_0x381662=_[_0xc063('0x41')]({},_0x381662,_0x37d8d1[_0xc063('0x42')]);return _0x3acfbc[_0xc063('0x5a')](_0x381662);}})[_0xc063('0x28')](function(_0x2a76fe){if(_0x2a76fe){_0x431f81=_0x2a76fe['length'];if(!_0x37d8d1[_0xc063('0x32')][_0xc063('0x39')](_0xc063('0x3a'))){_0x381662[_0xc063('0x1f')]=qs['limit'](_0x37d8d1[_0xc063('0x32')][_0xc063('0x1f')]);_0x381662['offset']=qs[_0xc063('0x1d')](_0x37d8d1[_0xc063('0x32')]['offset']);}return _0x3acfbc[_0xc063('0x5a')](_0x381662);}})[_0xc063('0x28')](function(_0x4988f3){if(_0x4988f3){return _0x4988f3?{'count':_0x431f81,'rows':_0x4988f3}:null;}})[_0xc063('0x28')](respondWithResult(_0x522273,null))[_0xc063('0x46')](handleError(_0x522273,null));};
\ No newline at end of file
+var _0x0ab2=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','then','destroy','error','stack','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','name','includeAll','include','findAll','catch','params','keys','options','create','body','update','find','describe','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3b62d5,_0x4fa047){var _0x17f072=function(_0x3fc89b){while(--_0x3fc89b){_0x3b62d5['push'](_0x3b62d5['shift']());}};_0x17f072(++_0x4fa047);}(_0x0ab2,0x172));var _0x20ab=function(_0x176ce9,_0x99961b){_0x176ce9=_0x176ce9-0x0;var _0x5e8203=_0x0ab2[_0x176ce9];return _0x5e8203;};'use strict';var emlformat=require(_0x20ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20ab('0x1'));var jsonpatch=require(_0x20ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x20ab('0x3'));var util=require('util');var path=require(_0x20ab('0x4'));var sox=require('sox');var csv=require(_0x20ab('0x5'));var ejs=require(_0x20ab('0x6'));var fs=require('fs');var fs_extra=require(_0x20ab('0x7'));var _=require(_0x20ab('0x8'));var squel=require(_0x20ab('0x9'));var crypto=require(_0x20ab('0xa'));var jsforce=require(_0x20ab('0xb'));var deskjs=require(_0x20ab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x20ab('0xd'));var Papa=require(_0x20ab('0xe'));var Redis=require(_0x20ab('0xf'));var authService=require(_0x20ab('0x10'));var qs=require(_0x20ab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20ab('0x12'));var logger=require(_0x20ab('0x13'))(_0x20ab('0x14'));var utils=require(_0x20ab('0x15'));var config=require(_0x20ab('0x16'));var licenseUtil=require(_0x20ab('0x17'));var db=require(_0x20ab('0x18'))['db'];config[_0x20ab('0x19')]=_['defaults'](config[_0x20ab('0x19')],{'host':_0x20ab('0x1a'),'port':0x18eb});var socket=require(_0x20ab('0x1b'))(new Redis(config[_0x20ab('0x19')]));require(_0x20ab('0x1c'))[_0x20ab('0x1d')](socket);function respondWithStatusCode(_0x15efb7,_0x3866f8){_0x3866f8=_0x3866f8||0xcc;return function(_0x48c558){if(_0x48c558){return _0x15efb7[_0x20ab('0x1e')](_0x3866f8);}return _0x15efb7[_0x20ab('0x1f')](_0x3866f8)[_0x20ab('0x20')]();};}function respondWithResult(_0x40df52,_0x456afd){_0x456afd=_0x456afd||0xc8;return function(_0x3245e5){if(_0x3245e5){return _0x40df52[_0x20ab('0x1f')](_0x456afd)[_0x20ab('0x21')](_0x3245e5);}};}function respondWithFilteredResult(_0x5e5586,_0x3a221b){return function(_0x1881a0){if(_0x1881a0){var _0x39b036=typeof _0x3a221b[_0x20ab('0x22')]===_0x20ab('0x23')&&typeof _0x3a221b['limit']==='undefined';var _0x4f2ed3=_0x1881a0['count'];var _0x4ca819=_0x39b036?0x0:_0x3a221b[_0x20ab('0x22')];var _0x20b5c2=_0x39b036?_0x1881a0[_0x20ab('0x24')]:_0x3a221b[_0x20ab('0x22')]+_0x3a221b[_0x20ab('0x25')];var _0x69fba9;if(_0x20b5c2>=_0x4f2ed3){_0x20b5c2=_0x4f2ed3;_0x69fba9=0xc8;}else{_0x69fba9=0xce;}_0x5e5586[_0x20ab('0x1f')](_0x69fba9);return _0x5e5586[_0x20ab('0x26')]('Content-Range',_0x4ca819+'-'+_0x20b5c2+'/'+_0x4f2ed3)[_0x20ab('0x21')](_0x1881a0);}return null;};}function patchUpdates(_0x2e75b4){return function(_0x47d4e1){try{jsonpatch[_0x20ab('0x27')](_0x47d4e1,_0x2e75b4,!![]);}catch(_0x57222d){return BPromise['reject'](_0x57222d);}return _0x47d4e1[_0x20ab('0x28')]();};}function saveUpdates(_0x819d5c,_0x585586){return function(_0x4dc459){if(_0x4dc459){return _0x4dc459['update'](_0x819d5c)[_0x20ab('0x29')](function(_0x3dfa23){return _0x3dfa23;});}return null;};}function removeEntity(_0x1eebe9,_0x2f4449){return function(_0x5ccc7a){if(_0x5ccc7a){return _0x5ccc7a[_0x20ab('0x2a')]()[_0x20ab('0x29')](function(){_0x1eebe9[_0x20ab('0x1f')](0xcc)[_0x20ab('0x20')]();});}};}function handleEntityNotFound(_0x531dd3,_0x31fa4f){return function(_0x3af20a){if(!_0x3af20a){_0x531dd3[_0x20ab('0x1e')](0x194);}return _0x3af20a;};}function handleError(_0xa27cf6,_0x2f20b0){_0x2f20b0=_0x2f20b0||0x1f4;return function(_0x292272){logger[_0x20ab('0x2b')](_0x292272[_0x20ab('0x2c')]);if(_0x292272['name']){delete _0x292272['name'];}_0xa27cf6[_0x20ab('0x1f')](_0x2f20b0)['send'](_0x292272);};}exports[_0x20ab('0x2d')]=function(_0x154187,_0x49c996){var _0xa2b6e9={},_0x277f92={},_0x14c429={'count':0x0,'rows':[]};var _0x503801=_[_0x20ab('0x2e')](db[_0x20ab('0x2f')][_0x20ab('0x30')],function(_0x1d7082){return{'name':_0x1d7082[_0x20ab('0x31')],'type':_0x1d7082[_0x20ab('0x32')][_0x20ab('0x33')]};});_0x277f92[_0x20ab('0x34')]=_[_0x20ab('0x2e')](_0x503801,'name');_0x277f92[_0x20ab('0x35')]=_['keys'](_0x154187[_0x20ab('0x35')]);_0x277f92['filters']=_['intersection'](_0x277f92[_0x20ab('0x34')],_0x277f92[_0x20ab('0x35')]);_0xa2b6e9[_0x20ab('0x36')]=_[_0x20ab('0x37')](_0x277f92[_0x20ab('0x34')],qs[_0x20ab('0x38')](_0x154187['query'][_0x20ab('0x38')]));_0xa2b6e9[_0x20ab('0x36')]=_0xa2b6e9['attributes'][_0x20ab('0x39')]?_0xa2b6e9[_0x20ab('0x36')]:_0x277f92[_0x20ab('0x34')];if(!_0x154187['query'][_0x20ab('0x3a')]('nolimit')){_0xa2b6e9[_0x20ab('0x25')]=qs[_0x20ab('0x25')](_0x154187['query']['limit']);_0xa2b6e9[_0x20ab('0x22')]=qs[_0x20ab('0x22')](_0x154187['query']['offset']);}_0xa2b6e9[_0x20ab('0x3b')]=qs[_0x20ab('0x3c')](_0x154187[_0x20ab('0x35')][_0x20ab('0x3c')]);_0xa2b6e9['where']=qs[_0x20ab('0x3d')](_['pick'](_0x154187[_0x20ab('0x35')],_0x277f92['filters']),_0x503801);if(_0x154187[_0x20ab('0x35')][_0x20ab('0x3e')]){_0xa2b6e9[_0x20ab('0x3f')]=_[_0x20ab('0x40')](_0xa2b6e9[_0x20ab('0x3f')],{'$or':_['map'](_0x503801,function(_0x2ce300){if(_0x2ce300[_0x20ab('0x32')]!==_0x20ab('0x41')){var _0x3f36fb={};_0x3f36fb[_0x2ce300[_0x20ab('0x42')]]={'$like':'%'+_0x154187[_0x20ab('0x35')][_0x20ab('0x3e')]+'%'};return _0x3f36fb;}})});}_0xa2b6e9=_['merge']({},_0xa2b6e9,_0x154187['options']);var _0x4c87d2={'where':_0xa2b6e9['where']};return db[_0x20ab('0x2f')]['count'](_0x4c87d2)[_0x20ab('0x29')](function(_0x3a7ab3){_0x14c429[_0x20ab('0x24')]=_0x3a7ab3;if(_0x154187[_0x20ab('0x35')][_0x20ab('0x43')]){_0xa2b6e9[_0x20ab('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x20ab('0x45')](_0xa2b6e9);})[_0x20ab('0x29')](function(_0x321b5b){_0x14c429['rows']=_0x321b5b;return _0x14c429;})['then'](respondWithFilteredResult(_0x49c996,_0xa2b6e9))[_0x20ab('0x46')](handleError(_0x49c996,null));};exports['show']=function(_0x1c1e6c,_0x4f38c2){var _0x2647a8={'raw':!![],'where':{'id':_0x1c1e6c[_0x20ab('0x47')]['id']}},_0x2bd3a6={};_0x2bd3a6[_0x20ab('0x34')]=_['keys'](db['ChatGroup'][_0x20ab('0x30')]);_0x2bd3a6['query']=_[_0x20ab('0x48')](_0x1c1e6c[_0x20ab('0x35')]);_0x2bd3a6[_0x20ab('0x3d')]=_[_0x20ab('0x37')](_0x2bd3a6[_0x20ab('0x34')],_0x2bd3a6[_0x20ab('0x35')]);_0x2647a8[_0x20ab('0x36')]=_['intersection'](_0x2bd3a6['model'],qs[_0x20ab('0x38')](_0x1c1e6c[_0x20ab('0x35')][_0x20ab('0x38')]));_0x2647a8[_0x20ab('0x36')]=_0x2647a8['attributes'][_0x20ab('0x39')]?_0x2647a8['attributes']:_0x2bd3a6['model'];if(_0x1c1e6c[_0x20ab('0x35')][_0x20ab('0x43')]){_0x2647a8['include']=[{'all':!![]}];}_0x2647a8=_[_0x20ab('0x40')]({},_0x2647a8,_0x1c1e6c[_0x20ab('0x49')]);return db['ChatGroup']['find'](_0x2647a8)[_0x20ab('0x29')](handleEntityNotFound(_0x4f38c2,null))['then'](respondWithResult(_0x4f38c2,null))[_0x20ab('0x46')](handleError(_0x4f38c2,null));};exports[_0x20ab('0x4a')]=function(_0x557557,_0x24254f){return db[_0x20ab('0x2f')][_0x20ab('0x4a')](_0x557557[_0x20ab('0x4b')],{})['then'](respondWithResult(_0x24254f,0xc9))['catch'](handleError(_0x24254f,null));};exports[_0x20ab('0x4c')]=function(_0x5384ea,_0x125c67){if(_0x5384ea[_0x20ab('0x4b')]['id']){delete _0x5384ea[_0x20ab('0x4b')]['id'];}return db[_0x20ab('0x2f')][_0x20ab('0x4d')]({'where':{'id':_0x5384ea[_0x20ab('0x47')]['id']}})[_0x20ab('0x29')](handleEntityNotFound(_0x125c67,null))[_0x20ab('0x29')](saveUpdates(_0x5384ea[_0x20ab('0x4b')],null))[_0x20ab('0x29')](respondWithResult(_0x125c67,null))[_0x20ab('0x46')](handleError(_0x125c67,null));};exports[_0x20ab('0x2a')]=function(_0x18953f,_0x2a6b78){return db['ChatGroup']['find']({'where':{'id':_0x18953f[_0x20ab('0x47')]['id']}})[_0x20ab('0x29')](handleEntityNotFound(_0x2a6b78,null))['then'](removeEntity(_0x2a6b78,null))[_0x20ab('0x46')](handleError(_0x2a6b78,null));};exports[_0x20ab('0x4e')]=function(_0x371a78,_0x1da55b){return db[_0x20ab('0x2f')]['describe']()[_0x20ab('0x29')](respondWithResult(_0x1da55b,null))[_0x20ab('0x46')](handleError(_0x1da55b,null));};exports['getUnread']=function(_0x2ba77f,_0x49ee74,_0x437b77){return db['ChatInternalMessage'][_0x20ab('0x24')]({'where':{'ChatGroupId':_0x2ba77f[_0x20ab('0x47')]['id'],'ToId':_0x2ba77f['user']['id'],'read':![]}})[_0x20ab('0x29')](function(_0x5e9c0d){return{'id':_[_0x20ab('0x4f')](_0x2ba77f[_0x20ab('0x47')]['id']),'count':_0x5e9c0d};})[_0x20ab('0x29')](respondWithResult(_0x49ee74,null))[_0x20ab('0x46')](handleError(_0x49ee74,null));};exports['addMembers']=function(_0x25c85e,_0x40ba29,_0x2bb91c){return db[_0x20ab('0x2f')]['find']({'where':{'id':_0x25c85e[_0x20ab('0x47')]['id']}})[_0x20ab('0x29')](handleEntityNotFound(_0x40ba29,null))[_0x20ab('0x29')](function(_0x33ff97){if(_0x33ff97){return _0x33ff97[_0x20ab('0x50')](_0x25c85e[_0x20ab('0x4b')][_0x20ab('0x51')],_[_0x20ab('0x52')](_0x25c85e[_0x20ab('0x4b')],[_0x20ab('0x51'),'id'])||{});}})['then'](respondWithResult(_0x40ba29,null))['catch'](handleError(_0x40ba29,null));};exports[_0x20ab('0x53')]=function(_0x5b59b7,_0x20974a,_0x2f198b){var _0x428df3={};var _0x458c49={};var _0x2df496;var _0x2ae071;return db[_0x20ab('0x2f')][_0x20ab('0x54')]({'where':{'id':_0x5b59b7[_0x20ab('0x47')]['id']}})[_0x20ab('0x29')](handleEntityNotFound(_0x20974a,null))[_0x20ab('0x29')](function(_0x37df08){if(_0x37df08){_0x2df496=_0x37df08;_0x458c49['model']=_[_0x20ab('0x48')](db[_0x20ab('0x55')]['rawAttributes']);_0x458c49[_0x20ab('0x35')]=_[_0x20ab('0x48')](_0x5b59b7[_0x20ab('0x35')]);_0x458c49[_0x20ab('0x3d')]=_[_0x20ab('0x37')](_0x458c49['model'],_0x458c49[_0x20ab('0x35')]);_0x428df3['attributes']=_[_0x20ab('0x37')](_0x458c49[_0x20ab('0x34')],qs[_0x20ab('0x38')](_0x5b59b7['query'][_0x20ab('0x38')]));_0x428df3[_0x20ab('0x36')]=_0x428df3[_0x20ab('0x36')][_0x20ab('0x39')]?_0x428df3[_0x20ab('0x36')]:_0x458c49[_0x20ab('0x34')];_0x428df3[_0x20ab('0x3b')]=qs['sort'](_0x5b59b7[_0x20ab('0x35')][_0x20ab('0x3c')]);_0x428df3['where']=qs[_0x20ab('0x3d')](_[_0x20ab('0x56')](_0x5b59b7['query'],_0x458c49[_0x20ab('0x3d')]));if(_0x5b59b7['query'][_0x20ab('0x3e')]){_0x428df3['where']=_['merge'](_0x428df3[_0x20ab('0x3f')],{'$or':_[_0x20ab('0x2e')](_0x428df3[_0x20ab('0x36')],function(_0x5b1515){var _0x5717e3={};_0x5717e3[_0x5b1515]={'$like':'%'+_0x5b59b7['query']['filter']+'%'};return _0x5717e3;})});}_0x428df3=_[_0x20ab('0x40')]({},_0x428df3,_0x5b59b7['options']);return _0x2df496[_0x20ab('0x53')](_0x428df3);}})['then'](function(_0x4710c3){if(_0x4710c3){_0x2ae071=_0x4710c3['length'];if(!_0x5b59b7[_0x20ab('0x35')]['hasOwnProperty'](_0x20ab('0x57'))){_0x428df3[_0x20ab('0x25')]=qs[_0x20ab('0x25')](_0x5b59b7[_0x20ab('0x35')][_0x20ab('0x25')]);_0x428df3['offset']=qs[_0x20ab('0x22')](_0x5b59b7[_0x20ab('0x35')][_0x20ab('0x22')]);}return _0x2df496[_0x20ab('0x53')](_0x428df3);}})[_0x20ab('0x29')](function(_0x123a0b){if(_0x123a0b){return _0x123a0b?{'count':_0x2ae071,'rows':_0x123a0b}:null;}})[_0x20ab('0x29')](respondWithResult(_0x20974a,null))[_0x20ab('0x46')](handleError(_0x20974a,null));};exports[_0x20ab('0x58')]=function(_0x45f3ec,_0x3d864d,_0xe7e1b1){return db[_0x20ab('0x2f')]['find']({'where':{'id':_0x45f3ec[_0x20ab('0x47')]['id']}})[_0x20ab('0x29')](handleEntityNotFound(_0x3d864d,null))[_0x20ab('0x29')](function(_0x26bd0d){if(_0x26bd0d){return _0x26bd0d[_0x20ab('0x58')](_0x45f3ec[_0x20ab('0x35')][_0x20ab('0x51')]);}})[_0x20ab('0x29')](respondWithStatusCode(_0x3d864d,null))[_0x20ab('0x46')](handleError(_0x3d864d,null));};exports[_0x20ab('0x59')]=function(_0xda1b13,_0x226c4f,_0x4deff1){if(_0xda1b13[_0x20ab('0x4b')]['id']){delete _0xda1b13['body']['id'];}return db[_0x20ab('0x2f')][_0x20ab('0x4d')]({'where':{'id':_0xda1b13['params']['id']}})[_0x20ab('0x29')](handleEntityNotFound(_0x226c4f,null))['then'](function(_0x5ea258){if(_0x5ea258){_0xda1b13[_0x20ab('0x4b')][_0x20ab('0x5a')]=_0x5ea258['id'];return db['ChatInternalMessage'][_0x20ab('0x4a')](_0xda1b13[_0x20ab('0x4b')]);}})['then'](respondWithResult(_0x226c4f,null))[_0x20ab('0x46')](handleError(_0x226c4f,null));};exports['getMessages']=function(_0x353d01,_0x187516,_0x64bdcc){var _0x5d9c19={};var _0x17caba={};var _0x247ccf;var _0x5957c1;return db[_0x20ab('0x2f')][_0x20ab('0x54')]({'where':{'id':_0x353d01['params']['id']}})[_0x20ab('0x29')](handleEntityNotFound(_0x187516,null))[_0x20ab('0x29')](function(_0x4e5057){if(_0x4e5057){_0x247ccf=_0x4e5057;_0x17caba[_0x20ab('0x34')]=_[_0x20ab('0x48')](db[_0x20ab('0x5b')]['rawAttributes']);_0x17caba[_0x20ab('0x35')]=_[_0x20ab('0x48')](_0x353d01['query']);_0x17caba[_0x20ab('0x3d')]=_[_0x20ab('0x37')](_0x17caba[_0x20ab('0x34')],_0x17caba[_0x20ab('0x35')]);_0x5d9c19['attributes']=_[_0x20ab('0x37')](_0x17caba[_0x20ab('0x34')],qs['fields'](_0x353d01[_0x20ab('0x35')][_0x20ab('0x38')]));_0x5d9c19[_0x20ab('0x36')]=_0x5d9c19[_0x20ab('0x36')][_0x20ab('0x39')]?_0x5d9c19[_0x20ab('0x36')]:_0x17caba[_0x20ab('0x34')];_0x5d9c19[_0x20ab('0x3b')]=qs[_0x20ab('0x3c')](_0x353d01[_0x20ab('0x35')]['sort']);_0x5d9c19[_0x20ab('0x3f')]=qs['filters'](_[_0x20ab('0x56')](_0x353d01[_0x20ab('0x35')],_0x17caba[_0x20ab('0x3d')]));if(_0x353d01[_0x20ab('0x35')][_0x20ab('0x3e')]){_0x5d9c19[_0x20ab('0x3f')]=_[_0x20ab('0x40')](_0x5d9c19[_0x20ab('0x3f')],{'$or':_[_0x20ab('0x2e')](_0x5d9c19['attributes'],function(_0x236d62){var _0x3ca6bc={};_0x3ca6bc[_0x236d62]={'$like':'%'+_0x353d01[_0x20ab('0x35')][_0x20ab('0x3e')]+'%'};return _0x3ca6bc;})});}if(_0x353d01[_0x20ab('0x35')][_0x20ab('0x5c')]){var _0x434eda=_0x353d01['query'][_0x20ab('0x5c')]['split'](',');var _0x18103e={};_0x18103e[_0x434eda[0x0]]={'$gte':moment(_0x434eda[0x1])[_0x20ab('0x5d')](_0x20ab('0x5e'))};_0x5d9c19[_0x20ab('0x3f')]=_[_0x20ab('0x40')](_0x5d9c19[_0x20ab('0x3f')],_0x18103e);}_0x5d9c19=_[_0x20ab('0x40')]({},_0x5d9c19,_0x353d01[_0x20ab('0x49')]);return _0x247ccf[_0x20ab('0x5f')](_0x5d9c19);}})[_0x20ab('0x29')](function(_0xb2f8c4){if(_0xb2f8c4){_0x5957c1=_0xb2f8c4['length'];if(!_0x353d01[_0x20ab('0x35')][_0x20ab('0x3a')]('nolimit')){_0x5d9c19['limit']=qs[_0x20ab('0x25')](_0x353d01[_0x20ab('0x35')][_0x20ab('0x25')]);_0x5d9c19[_0x20ab('0x22')]=qs[_0x20ab('0x22')](_0x353d01[_0x20ab('0x35')][_0x20ab('0x22')]);}return _0x247ccf[_0x20ab('0x5f')](_0x5d9c19);}})[_0x20ab('0x29')](function(_0x448755){if(_0x448755){return _0x448755?{'count':_0x5957c1,'rows':_0x448755}:null;}})[_0x20ab('0x29')](respondWithResult(_0x187516,null))['catch'](handleError(_0x187516,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 38ddca7..901b110 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 _0x0e26=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','save'];(function(_0x3f2fea,_0x3c4ea8){var _0x69a4d5=function(_0x223109){while(--_0x223109){_0x3f2fea['push'](_0x3f2fea['shift']());}};_0x69a4d5(++_0x3c4ea8);}(_0x0e26,0x19b));var _0x60e2=function(_0x539957,_0x107c59){_0x539957=_0x539957-0x0;var _0x417ecb=_0x0e26[_0x539957];return _0x417ecb;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x60e2('0x0'))['db'][_0x60e2('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x60e2('0x2'),'afterUpdate':_0x60e2('0x3'),'afterDestroy':_0x60e2('0x4')};function emitEvent(_0xa4456c){return function(_0x431bba,_0x2c63c0,_0x432250){ChatGroupEvents['emit'](_0xa4456c+':'+_0x431bba['id'],_0x431bba);ChatGroupEvents[_0x60e2('0x5')](_0xa4456c,_0x431bba);_0x432250(null);};}for(var e in events){if(events[_0x60e2('0x6')](e)){var event=events[e];ChatGroup[_0x60e2('0x7')](e,emitEvent(event));}}module[_0x60e2('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xffaf=['exports','ChatGroup','setMaxListeners','remove','emit','hook'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xffaf,0x1c3));var _0xfffa=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xffaf[_0x295314];return _0x584b0c;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0xfffa('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xfffa('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfffa('0x2')};function emitEvent(_0x2ab24d){return function(_0x46fadf,_0x576b08,_0x5dc4be){ChatGroupEvents[_0xfffa('0x3')](_0x2ab24d+':'+_0x46fadf['id'],_0x46fadf);ChatGroupEvents['emit'](_0x2ab24d,_0x46fadf);_0x5dc4be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xfffa('0x4')](e,emitEvent(event));}}module[_0xfffa('0x5')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 09333d9..8fe502d 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 _0xb798=['moment','bluebird','request-promise','path','../../config/environment','exports','define','chat_groups','lodash','../../config/logger','api'];(function(_0x42cf36,_0x39aeac){var _0x2d75ba=function(_0x4ad868){while(--_0x4ad868){_0x42cf36['push'](_0x42cf36['shift']());}};_0x2d75ba(++_0x39aeac);}(_0xb798,0x1c0));var _0x8b79=function(_0x3a7910,_0x32e161){_0x3a7910=_0x3a7910-0x0;var _0x256e6e=_0xb798[_0x3a7910];return _0x256e6e;};'use strict';var _=require(_0x8b79('0x0'));var util=require('util');var logger=require(_0x8b79('0x1'))(_0x8b79('0x2'));var moment=require(_0x8b79('0x3'));var BPromise=require(_0x8b79('0x4'));var rp=require(_0x8b79('0x5'));var fs=require('fs');var path=require(_0x8b79('0x6'));var rimraf=require('rimraf');var config=require(_0x8b79('0x7'));var attributes=require('./chatGroup.attributes');module[_0x8b79('0x8')]=function(_0x55440d,_0x30c404){return _0x55440d[_0x8b79('0x9')]('ChatGroup',attributes,{'tableName':_0x8b79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x988a=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./chatGroup.attributes','exports','define','chat_groups'];(function(_0x5a89ea,_0x436388){var _0x21193d=function(_0x1a9118){while(--_0x1a9118){_0x5a89ea['push'](_0x5a89ea['shift']());}};_0x21193d(++_0x436388);}(_0x988a,0x1ef));var _0xa988=function(_0x4d800c,_0x256169){_0x4d800c=_0x4d800c-0x0;var _0x4cd0fd=_0x988a[_0x4d800c];return _0x4cd0fd;};'use strict';var _=require(_0xa988('0x0'));var util=require(_0xa988('0x1'));var logger=require(_0xa988('0x2'))(_0xa988('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa988('0x4'));var fs=require('fs');var path=require(_0xa988('0x5'));var rimraf=require(_0xa988('0x6'));var config=require('../../config/environment');var attributes=require(_0xa988('0x7'));module[_0xa988('0x8')]=function(_0x3ed90d,_0x16bf4a){return _0x3ed90d[_0xa988('0x9')]('ChatGroup',attributes,{'tableName':_0xa988('0xa'),'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 e53dfd9..6a92ca8 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 _0x3edc=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x3f2a44,_0xf70f4b){_0x3f2a44=_0x3f2a44-0x0;var _0x50d3cb=_0x3edc[_0x3f2a44];return _0x50d3cb;};'use strict';var _=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var moment=require(_0xc3ed('0x2'));var BPromise=require(_0xc3ed('0x3'));var rs=require(_0xc3ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3ed('0x6'))(_0xc3ed('0x7'));var config=require(_0xc3ed('0x8'));var jayson=require(_0xc3ed('0x9'));var client=jayson[_0xc3ed('0xa')]['http']({'port':0x232a});config[_0xc3ed('0xb')]=_[_0xc3ed('0xc')](config[_0xc3ed('0xb')],{'host':_0xc3ed('0xd'),'port':0x18eb});var socket=require(_0xc3ed('0xe'))(new Redis(config[_0xc3ed('0xb')]));require('./chatGroup.socket')[_0xc3ed('0xf')](socket);function respondWithRpcPromise(_0x32e102,_0x37c1fc,_0x51c2c4){return new BPromise(function(_0x57e75f,_0x5517a3){return client[_0xc3ed('0x10')](_0x32e102,_0x51c2c4)[_0xc3ed('0x11')](function(_0x1eb94b){logger[_0xc3ed('0x12')](_0xc3ed('0x13'),_0x37c1fc,_0xc3ed('0x14'));logger[_0xc3ed('0x15')](_0xc3ed('0x16'),_0x37c1fc,_0xc3ed('0x14'),JSON[_0xc3ed('0x17')](_0x1eb94b));if(_0x1eb94b['error']){if(_0x1eb94b[_0xc3ed('0x18')][_0xc3ed('0x19')]===0x1f4){logger[_0xc3ed('0x18')](_0xc3ed('0x13'),_0x37c1fc,_0x1eb94b['error']['message']);return _0x5517a3(_0x1eb94b['error']['message']);}logger[_0xc3ed('0x18')](_0xc3ed('0x13'),_0x37c1fc,_0x1eb94b['error'][_0xc3ed('0x1a')]);return _0x57e75f(_0x1eb94b[_0xc3ed('0x18')]['message']);}else{logger['info'](_0xc3ed('0x13'),_0x37c1fc,_0xc3ed('0x14'));_0x57e75f(_0x1eb94b['result'][_0xc3ed('0x1a')]);}})[_0xc3ed('0x1b')](function(_0x1db6e2){logger[_0xc3ed('0x18')](_0xc3ed('0x13'),_0x37c1fc,_0x1db6e2);_0x5517a3(_0x1db6e2);});});}
\ No newline at end of file
+var _0x946e=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','request','then','ChatGroup,\x20%s,\x20%s'];(function(_0x6fc282,_0xed83a0){var _0x11d36e=function(_0x28c536){while(--_0x28c536){_0x6fc282['push'](_0x6fc282['shift']());}};_0x11d36e(++_0xed83a0);}(_0x946e,0x1d0));var _0xe946=function(_0x138e27,_0x1eaf5f){_0x138e27=_0x138e27-0x0;var _0x3e1de7=_0x946e[_0x138e27];return _0x3e1de7;};'use strict';var _=require(_0xe946('0x0'));var util=require('util');var moment=require(_0xe946('0x1'));var BPromise=require('bluebird');var rs=require(_0xe946('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe946('0x3'));var logger=require(_0xe946('0x4'))(_0xe946('0x5'));var config=require(_0xe946('0x6'));var jayson=require(_0xe946('0x7'));var client=jayson['client'][_0xe946('0x8')]({'port':0x232a});config[_0xe946('0x9')]=_[_0xe946('0xa')](config['redis'],{'host':_0xe946('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe946('0x9')]));require(_0xe946('0xc'))['register'](socket);function respondWithRpcPromise(_0x47e7a1,_0x49e9fc,_0x286140){return new BPromise(function(_0x49b412,_0x5679f6){return client[_0xe946('0xd')](_0x47e7a1,_0x286140)[_0xe946('0xe')](function(_0x56d82e){logger['info'](_0xe946('0xf'),_0x49e9fc,_0xe946('0x10'));logger['debug'](_0xe946('0x11'),_0x49e9fc,_0xe946('0x10'),JSON[_0xe946('0x12')](_0x56d82e));if(_0x56d82e[_0xe946('0x13')]){if(_0x56d82e[_0xe946('0x13')][_0xe946('0x14')]===0x1f4){logger[_0xe946('0x13')]('ChatGroup,\x20%s,\x20%s',_0x49e9fc,_0x56d82e['error'][_0xe946('0x15')]);return _0x5679f6(_0x56d82e[_0xe946('0x13')][_0xe946('0x15')]);}logger['error'](_0xe946('0xf'),_0x49e9fc,_0x56d82e[_0xe946('0x13')][_0xe946('0x15')]);return _0x49b412(_0x56d82e['error'][_0xe946('0x15')]);}else{logger[_0xe946('0x16')](_0xe946('0xf'),_0x49e9fc,'request\x20sent');_0x49b412(_0x56d82e[_0xe946('0x17')][_0xe946('0x15')]);}})['catch'](function(_0x2b2b66){logger['error'](_0xe946('0xf'),_0x49e9fc,_0x2b2b66);_0x5679f6(_0x2b2b66);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 19ab4c6..6293613 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 _0xa3bf=['chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register','length'];(function(_0x211bf0,_0x1abfac){var _0x3b6cf2=function(_0xc6ccaf){while(--_0xc6ccaf){_0x211bf0['push'](_0x211bf0['shift']());}};_0x3b6cf2(++_0x1abfac);}(_0xa3bf,0xd1));var _0xfa3b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa3bf[_0x167cc1];return _0x10bc4b;};'use strict';var ChatGroupEvents=require(_0xfa3b('0x0'));var events=['save',_0xfa3b('0x1'),_0xfa3b('0x2')];function createListener(_0x1749c7,_0x20e268){return function(_0x1a3cd3){_0x20e268[_0xfa3b('0x3')](_0x1749c7,_0x1a3cd3);};}function removeListener(_0x22403e,_0x2d3c5a){return function(){ChatGroupEvents[_0xfa3b('0x4')](_0x22403e,_0x2d3c5a);};}exports[_0xfa3b('0x5')]=function(_0xef54ff){for(var _0x4fccf7=0x0,_0x4de812=events[_0xfa3b('0x6')];_0x4fccf7<_0x4de812;_0x4fccf7++){var _0x860979=events[_0x4fccf7];var _0x145d25=createListener(_0xfa3b('0x7')+_0x860979,_0xef54ff);ChatGroupEvents['on'](_0x860979,_0x145d25);}};
\ No newline at end of file
+var _0xa396=['register','length','./chatGroup.events','save','remove'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0xa396,0x1ba));var _0x6a39=function(_0xf8f29f,_0x487c16){_0xf8f29f=_0xf8f29f-0x0;var _0x5e99a6=_0xa396[_0xf8f29f];return _0x5e99a6;};'use strict';var ChatGroupEvents=require(_0x6a39('0x0'));var events=[_0x6a39('0x1'),_0x6a39('0x2'),'update'];function createListener(_0x2c0fb2,_0x54aa37){return function(_0x9fc397){_0x54aa37['emit'](_0x2c0fb2,_0x9fc397);};}function removeListener(_0x47cbf3,_0xdda14b){return function(){ChatGroupEvents['removeListener'](_0x47cbf3,_0xdda14b);};}exports[_0x6a39('0x3')]=function(_0x4729ac){for(var _0x19979c=0x0,_0x35ea39=events[_0x6a39('0x4')];_0x19979c<_0x35ea39;_0x19979c++){var _0x56fc41=events[_0x19979c];var _0xbe97fc=createListener('chatGroup:'+_0x56fc41,_0x4729ac);ChatGroupEvents['on'](_0x56fc41,_0xbe97fc);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 6d81c73..28460ed 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 _0x5de5=['get','/:id/unread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','put','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x39a578,_0x3b7263){var _0x1c12ca=function(_0x15882e){while(--_0x15882e){_0x39a578['push'](_0x39a578['shift']());}};_0x1c12ca(++_0x3b7263);}(_0x5de5,0x11e));var _0x55de=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5de5[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x55de('0x0'));var util=require('util');var path=require(_0x55de('0x1'));var timeout=require(_0x55de('0x2'));var express=require(_0x55de('0x3'));var router=express[_0x55de('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x55de('0x5'));var interaction=require(_0x55de('0x6'));var config=require(_0x55de('0x7'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x55de('0x8')](),controller[_0x55de('0x9')]);router['get'](_0x55de('0xa'),auth['isAuthenticated'](),controller[_0x55de('0xb')]);router['get'](_0x55de('0xc'),auth[_0x55de('0x8')](),controller[_0x55de('0xd')]);router[_0x55de('0xe')](_0x55de('0xf'),auth[_0x55de('0x8')](),controller['getUnread']);router[_0x55de('0xe')](_0x55de('0x10'),auth[_0x55de('0x8')](),controller[_0x55de('0x11')]);router[_0x55de('0xe')](_0x55de('0x12'),auth['isAuthenticated'](),controller['getMessages']);router[_0x55de('0x13')]('/',auth[_0x55de('0x8')](),controller[_0x55de('0x14')]);router['post'](_0x55de('0x10'),auth[_0x55de('0x8')](),controller[_0x55de('0x15')]);router[_0x55de('0x13')](_0x55de('0x12'),auth[_0x55de('0x8')](),controller[_0x55de('0x16')]);router[_0x55de('0x17')](_0x55de('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x55de('0x18')]('/:id',auth[_0x55de('0x8')](),controller['destroy']);router[_0x55de('0x18')](_0x55de('0x10'),auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x1707=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/describe','show','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMembers','addMessage','put','/:id','update','delete','destroy','removeMembers','exports','multer','path'];(function(_0x1759de,_0x270d4c){var _0x3e7d6b=function(_0x6a73ad){while(--_0x6a73ad){_0x1759de['push'](_0x1759de['shift']());}};_0x3e7d6b(++_0x270d4c);}(_0x1707,0xd6));var _0x7170=function(_0x587fa0,_0x232d71){_0x587fa0=_0x587fa0-0x0;var _0x52ee53=_0x1707[_0x587fa0];return _0x52ee53;};'use strict';var multer=require(_0x7170('0x0'));var util=require('util');var path=require(_0x7170('0x1'));var timeout=require(_0x7170('0x2'));var express=require(_0x7170('0x3'));var router=express[_0x7170('0x4')]();var fs_extra=require(_0x7170('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7170('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x7170('0x7')](),controller[_0x7170('0x8')]);router[_0x7170('0x9')](_0x7170('0xa'),auth[_0x7170('0x7')](),controller['describe']);router[_0x7170('0x9')]('/:id',auth[_0x7170('0x7')](),controller[_0x7170('0xb')]);router[_0x7170('0x9')]('/:id/unread',auth[_0x7170('0x7')](),controller[_0x7170('0xc')]);router[_0x7170('0x9')](_0x7170('0xd'),auth[_0x7170('0x7')](),controller[_0x7170('0xe')]);router['get'](_0x7170('0xf'),auth[_0x7170('0x7')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x7170('0x10')]);router[_0x7170('0x11')](_0x7170('0xd'),auth[_0x7170('0x7')](),controller[_0x7170('0x12')]);router[_0x7170('0x11')](_0x7170('0xf'),auth[_0x7170('0x7')](),controller[_0x7170('0x13')]);router[_0x7170('0x14')](_0x7170('0x15'),auth[_0x7170('0x7')](),controller[_0x7170('0x16')]);router[_0x7170('0x17')](_0x7170('0x15'),auth['isAuthenticated'](),controller[_0x7170('0x18')]);router[_0x7170('0x17')](_0x7170('0xd'),auth[_0x7170('0x7')](),controller[_0x7170('0x19')]);module[_0x7170('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 180c398..edf45dd 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 _0xeb96=['STRING','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xeb96,0x183));var _0x6eb9=function(_0x38290d,_0x2ec9e7){_0x38290d=_0x38290d-0x0;var _0x8adfac=_0xeb96[_0x38290d];return _0x8adfac;};'use strict';var Sequelize=require(_0x6eb9('0x0'));module[_0x6eb9('0x1')]={'closed':{'type':Sequelize[_0x6eb9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6eb9('0x3')]},'ratingType':{'type':Sequelize[_0x6eb9('0x4')](_0x6eb9('0x5'),_0x6eb9('0x6')),'defaultValue':_0x6eb9('0x5')},'ratingMessage':{'type':Sequelize[_0x6eb9('0x7')]},'pathTranscript':{'type':Sequelize[_0x6eb9('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6eb9('0x8')]},'disposition':{'type':Sequelize[_0x6eb9('0x9')]},'secondDisposition':{'type':Sequelize[_0x6eb9('0x9')]},'thirdDisposition':{'type':Sequelize[_0x6eb9('0x9')]},'note':{'type':Sequelize[_0x6eb9('0x9')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x6eb9('0x9')]},'osName':{'type':Sequelize[_0x6eb9('0x9')]},'osVersion':{'type':Sequelize[_0x6eb9('0x9')]},'deviceModel':{'type':Sequelize[_0x6eb9('0x9')]},'deviceVendor':{'type':Sequelize[_0x6eb9('0x9')]},'deviceType':{'type':Sequelize[_0x6eb9('0x9')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x6eb9('0x9')]},'formData':{'type':Sequelize[_0x6eb9('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x6eb9('0x8')]},'lastMsgAt':{'type':Sequelize[_0x6eb9('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x6eb9('0x4')]('in',_0x6eb9('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6eb9('0x9')]},'customerPort':{'type':Sequelize[_0x6eb9('0x9')]},'vidaooSessionId':{'type':Sequelize[_0x6eb9('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6eb9('0x3')]}};
\ No newline at end of file
+var _0x5db5=['STRING','DATE','long','ENUM','out','BOOLEAN','INTEGER','sequelize','exports','star','thumb','TEXT'];(function(_0x4b6804,_0x301b24){var _0x11b4f1=function(_0x31e66c){while(--_0x31e66c){_0x4b6804['push'](_0x4b6804['shift']());}};_0x11b4f1(++_0x301b24);}(_0x5db5,0x1e7));var _0x55db=function(_0x49f173,_0x3a479d){_0x49f173=_0x49f173-0x0;var _0x373943=_0x5db5[_0x49f173];return _0x373943;};'use strict';var Sequelize=require(_0x55db('0x0'));module[_0x55db('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x55db('0x2'),_0x55db('0x3')),'defaultValue':_0x55db('0x2')},'ratingMessage':{'type':Sequelize[_0x55db('0x4')]},'pathTranscript':{'type':Sequelize[_0x55db('0x4')]},'mailTranscript':{'type':Sequelize[_0x55db('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x55db('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x55db('0x5')]},'thirdDisposition':{'type':Sequelize[_0x55db('0x5')]},'note':{'type':Sequelize[_0x55db('0x5')]},'browserName':{'type':Sequelize[_0x55db('0x5')]},'browserVersion':{'type':Sequelize[_0x55db('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x55db('0x5')]},'deviceModel':{'type':Sequelize[_0x55db('0x5')]},'deviceVendor':{'type':Sequelize[_0x55db('0x5')]},'deviceType':{'type':Sequelize[_0x55db('0x5')]},'referer':{'type':Sequelize[_0x55db('0x4')]},'customerIp':{'type':Sequelize[_0x55db('0x5')]},'formData':{'type':Sequelize[_0x55db('0x4')](_0x55db('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x55db('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x55db('0x8')]('in',_0x55db('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x55db('0x5')]},'customerPort':{'type':Sequelize[_0x55db('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x55db('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x55db('0xb')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 7a709d1..cb52d06 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 _0xa4ce=['code','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','end','stack','name','send','render','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','key','getOptions','findAll','chat','query','user','catch','params','model','keys','filters','intersection','attributes','fields','includeAll','include','create','find','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','POST','isNull','vidaooNote','follow','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','CmContact','Contact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','type','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','User','ContactId','Messages','UserId','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','length','nolimit','sort','where','pick','ChatInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','hasOwnProperty','order','includeAgent','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','push','firstName','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','referer','customerIp','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','error'];(function(_0x4a944a,_0x28e33a){var _0x381e4b=function(_0x2d7883){while(--_0x2d7883){_0x4a944a['push'](_0x4a944a['shift']());}};_0x381e4b(++_0x28e33a);}(_0xa4ce,0xbb));var _0xea4c=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa4ce[_0x47a7d0];return _0xb9bd08;};'use strict';var rimraf=require(_0xea4c('0x0'));var zipdir=require(_0xea4c('0x1'));var rp=require(_0xea4c('0x2'));var moment=require(_0xea4c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xea4c('0x4'));var util=require('util');var path=require(_0xea4c('0x5'));var ejs=require(_0xea4c('0x6'));var fs=require('fs');var _=require(_0xea4c('0x7'));var Redis=require(_0xea4c('0x8'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xea4c('0x9'))(_0xea4c('0xa'));var config=require(_0xea4c('0xb'));var db=require(_0xea4c('0xc'))['db'];config[_0xea4c('0xd')]=_[_0xea4c('0xe')](config['redis'],{'host':_0xea4c('0xf'),'port':0x18eb});var socket=require(_0xea4c('0x10'))(new Redis(config[_0xea4c('0xd')]));require(_0xea4c('0x11'))[_0xea4c('0x12')](socket);var jayson=require(_0xea4c('0x13'));var client=jayson[_0xea4c('0x14')][_0xea4c('0x15')]({'port':0x232b});var client9004=jayson['client'][_0xea4c('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x4d5504,_0x378570,_0x51419c,_0x3d3b08){return new BPromise(function(_0x32f227,_0x4e9b05){var _0x1215b8=_0x3d3b08||client;return _0x1215b8[_0xea4c('0x16')](_0x4d5504,_0x51419c)[_0xea4c('0x17')](function(_0x5db049){logger[_0xea4c('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x378570,_0xea4c('0x19'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x378570,_0xea4c('0x19'),JSON['stringify'](_0x5db049));if(_0x5db049['error']){if(_0x5db049[_0xea4c('0x1a')][_0xea4c('0x1b')]===0x1f4){logger['error'](_0xea4c('0x1c'),_0x378570,_0x5db049[_0xea4c('0x1a')][_0xea4c('0x1d')]);return _0x4e9b05(_0x5db049[_0xea4c('0x1a')][_0xea4c('0x1d')]);}logger[_0xea4c('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x378570,_0x5db049['error'][_0xea4c('0x1d')]);return _0x32f227(_0x5db049['error'][_0xea4c('0x1d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x378570,_0xea4c('0x19'));_0x32f227(_0x5db049[_0xea4c('0x1e')]['message']);}})['catch'](function(_0x218aa4){logger['error'](_0xea4c('0x1c'),_0x378570,_0x218aa4);_0x4e9b05(_0x218aa4);});});}function respondWithStatusCode(_0x95d601,_0x20d0d0){_0x20d0d0=_0x20d0d0||0xcc;return function(_0x112738){if(_0x112738){return _0x95d601[_0xea4c('0x1f')](_0x20d0d0);}return _0x95d601[_0xea4c('0x20')](_0x20d0d0)['end']();};}function respondWithResult(_0x259125,_0x6d0a1d){_0x6d0a1d=_0x6d0a1d||0xc8;return function(_0x40213b){if(_0x40213b){return _0x259125[_0xea4c('0x20')](_0x6d0a1d)[_0xea4c('0x21')](_0x40213b);}};}function respondWithFilteredResult(_0x15feb8,_0x10364e){return function(_0x6dfb39){if(_0x6dfb39){var _0x2ab9db=typeof _0x10364e[_0xea4c('0x22')]===_0xea4c('0x23')&&typeof _0x10364e[_0xea4c('0x24')]===_0xea4c('0x23');var _0x855803=_0x6dfb39[_0xea4c('0x25')];var _0x3a795f=_0x2ab9db?0x0:_0x10364e[_0xea4c('0x22')];var _0x1e3e6e=_0x2ab9db?_0x6dfb39[_0xea4c('0x25')]:_0x10364e['offset']+_0x10364e[_0xea4c('0x24')];var _0x26b9f7;if(_0x1e3e6e>=_0x855803){_0x1e3e6e=_0x855803;_0x26b9f7=0xc8;}else{_0x26b9f7=0xce;}_0x15feb8['status'](_0x26b9f7);return _0x15feb8[_0xea4c('0x26')]('Content-Range',_0x3a795f+'-'+_0x1e3e6e+'/'+_0x855803)['json'](_0x6dfb39);}return null;};}function saveUpdates(_0x24a089){return function(_0x3f2d7c){if(_0x3f2d7c){return _0x3f2d7c[_0xea4c('0x27')](_0x24a089)[_0xea4c('0x17')](function(_0x1ab91){return _0x1ab91;});}return null;};}function removeEntity(_0x5e86f8){return function(_0x1188d4){if(_0x1188d4){return _0x1188d4[_0xea4c('0x28')]()[_0xea4c('0x17')](function(){_0x5e86f8['status'](0xcc)[_0xea4c('0x29')]();});}};}function handleEntityNotFound(_0x520e7d){return function(_0x279142){if(!_0x279142){_0x520e7d['sendStatus'](0x194);}return _0x279142;};}function handleError(_0x2df837,_0x287a67){_0x287a67=_0x287a67||0x1f4;return function(_0x322b8b){logger[_0xea4c('0x1a')](_0x322b8b[_0xea4c('0x2a')]);if(_0x322b8b[_0xea4c('0x2b')]){delete _0x322b8b[_0xea4c('0x2b')];}_0x2df837[_0xea4c('0x20')](_0x287a67)[_0xea4c('0x2c')](_0x322b8b);};}function getMustacheRender(_0x4fa8c1,_0x5e1c9d){return Mustache[_0xea4c('0x2d')](_0x4fa8c1,_['merge'](_0x5e1c9d[_0xea4c('0x2e')],{'contact':_0x5e1c9d[_0xea4c('0x2f')],'message':_0x5e1c9d[_0xea4c('0x1d')],'agent':_0x5e1c9d[_0xea4c('0x30')],'interaction':_0x5e1c9d[_0xea4c('0x31')],'account':_0x5e1c9d[_0xea4c('0x32')]}))||'';}exports['index']=function(_0x565689,_0x2bf186){var _0x62163={};var _0x13bfa5=_[_0xea4c('0x33')](db[_0xea4c('0x34')][_0xea4c('0x35')],function(_0x5bbbf8){return{'name':_0x5bbbf8[_0xea4c('0x36')],'type':_0x5bbbf8['type'][_0xea4c('0x37')]};});_0x62163=qs[_0xea4c('0x38')](_0x13bfa5,_0x565689);return interaction[_0xea4c('0x39')](_0xea4c('0x3a'),_0x565689[_0xea4c('0x3b')],_0x565689[_0xea4c('0x3c')],_0x62163,_0x13bfa5)[_0xea4c('0x17')](respondWithFilteredResult(_0x2bf186,_0x62163))[_0xea4c('0x3d')](handleError(_0x2bf186,null));};exports['show']=function(_0x52c452,_0x36bcd2){var _0x119a74={'raw':![],'where':{'id':_0x52c452[_0xea4c('0x3e')]['id']}},_0x3a027d={};_0x3a027d[_0xea4c('0x3f')]=_[_0xea4c('0x40')](db[_0xea4c('0x34')][_0xea4c('0x35')]);_0x3a027d['query']=_[_0xea4c('0x40')](_0x52c452[_0xea4c('0x3b')]);_0x3a027d[_0xea4c('0x41')]=_[_0xea4c('0x42')](_0x3a027d['model'],_0x3a027d[_0xea4c('0x3b')]);_0x119a74[_0xea4c('0x43')]=_[_0xea4c('0x42')](_0x3a027d[_0xea4c('0x3f')],qs[_0xea4c('0x44')](_0x52c452[_0xea4c('0x3b')]['fields']));_0x119a74[_0xea4c('0x43')]=_0x119a74[_0xea4c('0x43')]['length']?_0x119a74[_0xea4c('0x43')]:_0x3a027d[_0xea4c('0x3f')];if(_0x52c452[_0xea4c('0x3b')][_0xea4c('0x45')]){_0x119a74[_0xea4c('0x46')]=[{'all':!![]}];}_0x119a74=_['merge']({},_0x119a74,_0x52c452['options']);return db[_0xea4c('0x34')]['find'](_0x119a74)[_0xea4c('0x17')](handleEntityNotFound(_0x36bcd2,null))[_0xea4c('0x17')](respondWithResult(_0x36bcd2,null))[_0xea4c('0x3d')](handleError(_0x36bcd2,null));};exports[_0xea4c('0x47')]=function(_0x294bdc,_0x6d1513){return db[_0xea4c('0x34')][_0xea4c('0x47')](_0x294bdc[_0xea4c('0x2e')],{})['then'](respondWithResult(_0x6d1513,0xc9))['catch'](handleError(_0x6d1513,null));};exports[_0xea4c('0x27')]=function(_0x21ae57,_0x26be68){if(_0x21ae57['body']['id']){delete _0x21ae57[_0xea4c('0x2e')]['id'];}return db['ChatInteraction'][_0xea4c('0x48')]({'where':{'id':_0x21ae57[_0xea4c('0x3e')]['id']}})[_0xea4c('0x17')](handleEntityNotFound(_0x26be68,null))[_0xea4c('0x17')](saveUpdates(_0x21ae57['body'],null))[_0xea4c('0x17')](respondWithResult(_0x26be68,null))[_0xea4c('0x3d')](handleError(_0x26be68,null));};exports[_0xea4c('0x28')]=function(_0x56e7f3,_0x491b3a){return db['ChatInteraction'][_0xea4c('0x48')]({'where':{'id':_0x56e7f3[_0xea4c('0x3e')]['id']}})[_0xea4c('0x17')](handleEntityNotFound(_0x491b3a,null))[_0xea4c('0x17')](removeEntity(_0x491b3a,null))[_0xea4c('0x3d')](handleError(_0x491b3a,null));};exports[_0xea4c('0x49')]=function(_0x4bfe0c,_0x4490ab){return db[_0xea4c('0x34')][_0xea4c('0x49')]()[_0xea4c('0x17')](respondWithResult(_0x4490ab,null))[_0xea4c('0x3d')](handleError(_0x4490ab,null));};exports[_0xea4c('0x4a')]=function(_0x3e0007,_0x5bf8cb){var _0x516cfc=_0x3e0007[_0xea4c('0x3e')]['id'];var _0x19bf4e;var _0x3ee677;var _0x2844d9;return db[_0xea4c('0x34')]['findOne']({'where':{'id':_0x516cfc}})['then'](function(_0x57b3ab){_0x19bf4e=_0x57b3ab;return db[_0xea4c('0x4b')][_0xea4c('0x4c')]({'where':{'id':_0x57b3ab[_0xea4c('0x4d')]},'attributes':['id',_0xea4c('0x4e'),_0xea4c('0x4f'),_0xea4c('0x50'),'vidaooNote',_0xea4c('0x51')],'raw':!![]});})[_0xea4c('0x17')](function(_0x495f15){if(_0x495f15&&_0x495f15[_0xea4c('0x4e')]&&_0x495f15[_0xea4c('0x4f')]){_0x3ee677=_0x495f15;var _0x2a982b={'interaction':{'id':_0x516cfc},'agent':{'id':_0x3e0007[_0xea4c('0x3c')]['id'],'name':_0x3e0007[_0xea4c('0x3c')]['name'],'fullname':_0x3e0007[_0xea4c('0x3c')][_0xea4c('0x52')],'email':_0x3e0007[_0xea4c('0x3c')]['email']},'contact':_0x3e0007[_0xea4c('0x2e')]['contact'],'account':_0x3e0007[_0xea4c('0x2e')]['account']};var _0x4af5e6={'rejectUnauthorized':![],'method':_0xea4c('0x53'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x495f15[_0xea4c('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3e0007['user']['email']],'buttons':null,'topic':_0x3ee677['vidaooTopic'],'note':_[_0xea4c('0x54')](_0x3ee677[_0xea4c('0x55')])?null:getMustacheRender(_0x3ee677[_0xea4c('0x55')],_0x2a982b),'metadata':null},'redirect':_0xea4c('0x56'),'json':!![]};try{if(!_[_0xea4c('0x54')](_0x3ee677[_0xea4c('0x51')])){var _0x57bed4=getMustacheRender(_0x3ee677[_0xea4c('0x51')],_0x2a982b);var _0x196140=JSON[_0xea4c('0x57')](_0x57bed4);_0x4af5e6[_0xea4c('0x2e')]['metadata']=_0x196140;}}catch(_0xfaf936){throw new db[(_0xea4c('0x58'))]['ValidationError'](_0xea4c('0x59'));}return rp(_0x4af5e6);}else{throw new db['Sequelize'][(_0xea4c('0x5a'))](_0xea4c('0x5b'));}})[_0xea4c('0x17')](function(_0x4afb1f){_0x2844d9=_0x4afb1f;if(_0x2844d9['id']){var _0x25b273={'body':_0x2844d9[_0xea4c('0x5c')],'ChatWebsiteId':_0x3ee677['id'],'ChatInteractionId':_0x19bf4e['id'],'direction':_0xea4c('0x5d'),'UserId':_0x3e0007[_0xea4c('0x3c')]['id']};return db['ChatMessage'][_0xea4c('0x47')](_0x25b273,{});}else{throw new db[(_0xea4c('0x58'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x19bf4e[_0xea4c('0x5e')]({'vidaooSessionId':_0x2844d9['id']});})[_0xea4c('0x17')](respondWithResult(_0x5bf8cb,null))[_0xea4c('0x3d')](handleError(_0x5bf8cb,null));};exports['customUpdate']=function(_0x58b211,_0x2ead01){if(_0x58b211['body']['id']){delete _0x58b211[_0xea4c('0x2e')]['id'];}return db['ChatInteraction'][_0xea4c('0x48')]({'where':{'id':_0x58b211[_0xea4c('0x3e')]['id']},'include':[{'model':db[_0xea4c('0x5f')],'as':_0xea4c('0x60')}]})[_0xea4c('0x17')](handleEntityNotFound(_0x2ead01,null))[_0xea4c('0x17')](saveUpdates(_0x58b211[_0xea4c('0x2e')],null))[_0xea4c('0x17')](respondWithResult(_0x2ead01,null))[_0xea4c('0x3d')](handleError(_0x2ead01,null));};exports[_0xea4c('0x61')]=function(_0x3b39f2,_0x4fac11){if(_0x3b39f2[_0xea4c('0x2e')]['id']){delete _0x3b39f2['body']['id'];}return db[_0xea4c('0x34')][_0xea4c('0x48')]({'where':{'id':_0x3b39f2['params']['id']}})[_0xea4c('0x17')](function(_0x25bd8f){if(!_0x25bd8f){logger[_0xea4c('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xea4c('0x62'));_0x4fac11[_0xea4c('0x1f')](0x194);}else{if(_0x25bd8f['UserId']){throw new db[(_0xea4c('0x58'))][(_0xea4c('0x5a'))](_0xea4c('0x63'));}}return _0x25bd8f;})['then'](function(_0x438db8){if(_0x438db8){return _0x438db8[_0xea4c('0x27')]({'closed':_0x3b39f2[_0xea4c('0x2e')][_0xea4c('0x64')],'disposition':_0x3b39f2[_0xea4c('0x2e')][_0xea4c('0x65')]})[_0xea4c('0x17')](function(_0x4a734c){return _0x4a734c;});}})[_0xea4c('0x17')](function(){return respondWithRpcPromise('AbandonInteraction',_0xea4c('0x61'),_0x3b39f2[_0xea4c('0x2e')],client9004);})[_0xea4c('0x17')](respondWithResult(_0x4fac11,null))[_0xea4c('0x3d')](handleError(_0x4fac11,null));};exports[_0xea4c('0x66')]=function(_0x152a44,_0x3bdedb){_0x152a44[_0xea4c('0x2e')][_0xea4c('0x2b')]=_0x152a44[_0xea4c('0x67')][_0xea4c('0x68')];_0x152a44[_0xea4c('0x2e')]['basename']=_0x152a44[_0xea4c('0x67')][_0xea4c('0x69')];_0x152a44[_0xea4c('0x2e')][_0xea4c('0x6a')]=_0x152a44[_0xea4c('0x67')]['mimetype'];return db[_0xea4c('0x6b')][_0xea4c('0x47')](_0x152a44[_0xea4c('0x2e')])['then'](respondWithResult(_0x3bdedb,0xc9))[_0xea4c('0x3d')](handleError(_0x3bdedb,null));};exports[_0xea4c('0x6c')]=function(_0x4f72b2,_0x4f5704){return db[_0xea4c('0x34')][_0xea4c('0x4c')]({'where':{'id':_0x4f72b2[_0xea4c('0x3e')]['id']},'raw':!![]})[_0xea4c('0x17')](handleEntityNotFound(_0x4f5704,null))[_0xea4c('0x17')](function(_0x58f4b1){if(_0x58f4b1){if(_0x58f4b1[_0xea4c('0x64')]){return _0x4f5704['status'](0x193)[_0xea4c('0x21')]({'status':0x193,'message':_0xea4c('0x6d')});}return db['Attachment'][_0xea4c('0x4c')]({'where':{'id':_0x4f72b2[_0xea4c('0x3b')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x4f5704,null));}})[_0xea4c('0x17')](function(_0x18b5c7){if(_0x18b5c7){var _0x4e7f01=_0x18b5c7[_0xea4c('0x6e')]!==null;var _0x1d7115=path[_0xea4c('0x6f')](config[_0xea4c('0x70')],_0xea4c('0x71'));if(_0x4e7f01){_0x1d7115=path[_0xea4c('0x6f')](_0x1d7115,_0xea4c('0x72'));}var _0x42e395=path[_0xea4c('0x6f')](_0x1d7115,_0x18b5c7[_0xea4c('0x73')]);return _0x4f5704[_0xea4c('0x74')](_0x42e395);}})[_0xea4c('0x3d')](handleError(_0x4f5704,null));};exports[_0xea4c('0x75')]=function(_0x43df6d,_0x2bd05b){var _0x510245=null;var _0x12e8b4=null;var _0x32b07a=null;if(_0x43df6d[_0xea4c('0x2e')]['id']){delete _0x43df6d[_0xea4c('0x2e')]['id'];}if(_0x43df6d[_0xea4c('0x2e')]['mailTranscript']){_0x32b07a=path['join'](config['root'],_0xea4c('0x76'),util['format'](_0xea4c('0x77'),Date[_0xea4c('0x78')]()));_0x43df6d[_0xea4c('0x2e')][_0xea4c('0x79')]=_0x32b07a;}return db[_0xea4c('0x34')][_0xea4c('0x48')]({'where':{'id':_0x43df6d[_0xea4c('0x3e')]['id']},'include':[{'model':db[_0xea4c('0x7a')],'as':'Messages','include':[{'model':db[_0xea4c('0x7b')],'as':_0xea4c('0x7b')}]}]})[_0xea4c('0x17')](handleEntityNotFound(_0x2bd05b,null))[_0xea4c('0x17')](saveUpdates(_0x43df6d[_0xea4c('0x2e')],null))['then'](function(_0x491446){if(_0x491446){_0x510245=_0x491446;return db[_0xea4c('0x4b')][_0xea4c('0x48')]({'where':{'id':_0x510245['ChatWebsiteId']}});}})[_0xea4c('0x17')](function(_0x7b2b33){if(_0x7b2b33){_0x12e8b4=_0x7b2b33;return db['CmContact']['find']({'where':{'id':_0x510245[_0xea4c('0x7c')]}});}})['then'](function(_0x376414){if(_0x376414){if(_0x32b07a){var _0x12e6db=null;for(var _0x508840=0x1;_0x508840<_0x510245[_0xea4c('0x7d')]['length'];++_0x508840){_0x12e6db=_0x510245[_0xea4c('0x7d')][_0x508840];var _0x452aba=_0x12e6db[_0xea4c('0x7e')]?util[_0xea4c('0x7f')](_0xea4c('0x80'),_0x12e8b4[_0xea4c('0x81')],_0x12e6db[_0xea4c('0x7e')]):_0xea4c('0x82');var _0x5c48aa=_0x43df6d[_0xea4c('0x2e')][_0xea4c('0x83')]||util[_0xea4c('0x7f')](_0xea4c('0x80'),_0xea4c('0x84'),_0x12e6db[_0xea4c('0x7c')]);switch(_0x12e8b4[_0xea4c('0x85')]){case _0xea4c('0x86'):_0x452aba=_0x12e6db[_0xea4c('0x7e')]?util[_0xea4c('0x7f')](_0xea4c('0x80'),_0x12e8b4[_0xea4c('0x81')],_0x12e6db[_0xea4c('0x7e')]):_0xea4c('0x82');break;case _0xea4c('0x87'):_0x452aba=_0x12e6db[_0xea4c('0x7e')]?_0x12e6db[_0xea4c('0x7b')][_0xea4c('0x88')]||_0x12e6db[_0xea4c('0x7b')][_0xea4c('0x52')]:_0xea4c('0x82');break;case _0xea4c('0x89'):_0x452aba=_0x12e6db['UserId']?_0x12e6db[_0xea4c('0x7b')][_0xea4c('0x52')]:_0xea4c('0x82');break;default:_0x452aba=_0x12e6db[_0xea4c('0x7e')]?util[_0xea4c('0x7f')]('%s%d',_0x12e8b4[_0xea4c('0x81')],_0x12e6db[_0xea4c('0x7e')]):_0xea4c('0x82');}var _0x4f6ed2=util['format'](_0xea4c('0x8a'),moment(_0x12e6db[_0xea4c('0x8b')])['format'](_0xea4c('0x8c')),_0x12e6db[_0xea4c('0x8d')]==='in'?_0x5c48aa:_0x452aba,_0x12e6db[_0xea4c('0x2e')]);if(!_0x12e6db[_0xea4c('0x8e')]){fs[_0xea4c('0x8f')](_0x32b07a,_0x4f6ed2);}}return db[_0xea4c('0x90')][_0xea4c('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xea4c('0x91')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xea4c('0x92')],'as':_0xea4c('0x92'),'raw':!![]}]}]});}}})[_0xea4c('0x17')](function(_0x31ae01){if(!_0x31ae01||!_0x31ae01['Smtp']||!_0x43df6d[_0xea4c('0x2e')])return _0x510245;var _0x2ed113=_0x31ae01[_0xea4c('0x93')]();return respondWithRpcPromise(_0xea4c('0x94'),_0xea4c('0x95'),{'account':_0x2ed113,'message':{'from':util[_0xea4c('0x7f')](_0xea4c('0x96'),_0x31ae01[_0xea4c('0x2b')],_0x31ae01[_0xea4c('0x97')]||_0x31ae01[_0xea4c('0x98')][_0xea4c('0x3c')]),'to':_0x43df6d['body'][_0xea4c('0x99')],'subject':_0xea4c('0x9a'),'text':util[_0xea4c('0x7f')](_0xea4c('0x9b'),_0x43df6d['body']['mailTranscript']),'attachments':[{'path':_0x32b07a}]}})[_0xea4c('0x17')](function(){return _0x510245;})['catch'](function(_0x408ff0){logger[_0xea4c('0x1a')](_0x408ff0);});})['then'](respondWithStatusCode(_0x2bd05b,0xc8))[_0xea4c('0x3d')](handleError(_0x2bd05b,null));};exports['addMessage']=function(_0x63cc90,_0x3cd27a){return db[_0xea4c('0x7a')]['find']({'where':{'id':_0x63cc90[_0xea4c('0x3e')]['id']}})[_0xea4c('0x17')](handleEntityNotFound(_0x3cd27a,null))[_0xea4c('0x17')](function(_0x48ff7d){if(_0x48ff7d){return _0x48ff7d[_0xea4c('0x9c')](_0x63cc90[_0xea4c('0x2e')]['ids'],_[_0xea4c('0x9d')](_0x63cc90[_0xea4c('0x2e')],[_0xea4c('0x9e'),'id'])||{});}})[_0xea4c('0x17')](respondWithResult(_0x3cd27a,null))['catch'](handleError(_0x3cd27a,null));};exports[_0xea4c('0x9f')]=function(_0x473b85,_0x346bee){var _0x42c666={'raw':![],'where':{}};var _0x53e233={};var _0x5d13e4={'count':0x0,'rows':[]};return db[_0xea4c('0x34')][_0xea4c('0x4c')]({'where':{'id':_0x473b85[_0xea4c('0x3e')]['id']}})[_0xea4c('0x17')](handleEntityNotFound(_0x346bee,null))[_0xea4c('0x17')](function(_0x38175f){if(_0x38175f){_0x53e233['model']=_[_0xea4c('0x40')](db['ChatMessage'][_0xea4c('0x35')]);_0x53e233[_0xea4c('0x3b')]=_[_0xea4c('0x40')](_0x473b85[_0xea4c('0x3b')]);_0x53e233[_0xea4c('0x41')]=_['intersection'](_0x53e233[_0xea4c('0x3f')],_0x53e233['query']);_0x42c666[_0xea4c('0x43')]=_[_0xea4c('0x42')](_0x53e233[_0xea4c('0x3f')],qs['fields'](_0x473b85[_0xea4c('0x3b')][_0xea4c('0x44')]));_0x42c666[_0xea4c('0x43')]=_0x42c666['attributes'][_0xea4c('0xa0')]?_0x42c666['attributes']:_0x53e233[_0xea4c('0x3f')];if(!_0x473b85[_0xea4c('0x3b')]['hasOwnProperty'](_0xea4c('0xa1'))){_0x42c666['limit']=qs[_0xea4c('0x24')](_0x473b85[_0xea4c('0x3b')][_0xea4c('0x24')]);_0x42c666[_0xea4c('0x22')]=qs[_0xea4c('0x22')](_0x473b85[_0xea4c('0x3b')][_0xea4c('0x22')]);}_0x42c666['order']=qs[_0xea4c('0xa2')](_0x473b85[_0xea4c('0x3b')][_0xea4c('0xa2')]);_0x42c666[_0xea4c('0xa3')]=qs[_0xea4c('0x41')](_[_0xea4c('0xa4')](_0x473b85[_0xea4c('0x3b')],_0x53e233['filters']));_0x42c666[_0xea4c('0xa3')][_0xea4c('0xa5')]=_0x38175f['id'];if(_0x473b85['query'][_0xea4c('0xa6')]){_0x42c666['where']=_[_0xea4c('0xa7')](_0x42c666[_0xea4c('0xa3')],{'$or':_['map'](_0x42c666[_0xea4c('0x43')],function(_0x270cc9){var _0x437f82={};_0x437f82[_0x270cc9]={'$like':'%'+_0x473b85['query'][_0xea4c('0xa6')]+'%'};return _0x437f82;})});}if(_0x473b85[_0xea4c('0x3b')][_0xea4c('0xa8')]){var _0x2276ab=_0x473b85[_0xea4c('0x3b')][_0xea4c('0xa8')][_0xea4c('0xa9')](',');var _0x59b76c={};_0x59b76c[_0x2276ab[0x0]]={'$gte':moment(_0x2276ab[0x1])[_0xea4c('0x7f')](_0xea4c('0xaa'))};_0x42c666[_0xea4c('0xa3')]=_[_0xea4c('0xa7')](_0x42c666[_0xea4c('0xa3')],_0x59b76c);}_0x42c666=_[_0xea4c('0xa7')]({},_0x42c666,_0x473b85[_0xea4c('0xab')]);return db[_0xea4c('0x7a')]['count']({'where':_0x42c666[_0xea4c('0xa3')]})[_0xea4c('0x17')](function(_0x101e16){_0x5d13e4[_0xea4c('0x25')]=_0x101e16;if(_0x473b85['query'][_0xea4c('0x45')]){_0x42c666[_0xea4c('0x46')]=[{'all':!![]}];}return db[_0xea4c('0x7a')][_0xea4c('0x39')](_0x42c666);})[_0xea4c('0x17')](function(_0x4d2877){_0x5d13e4[_0xea4c('0xac')]=_0x4d2877;return _0x5d13e4;});}})[_0xea4c('0x17')](respondWithFilteredResult(_0x346bee,_0x42c666))[_0xea4c('0x3d')](handleError(_0x346bee,null));};exports[_0xea4c('0xad')]=function(_0x496af2,_0x498b93){var _0x171b7c={'where':{}},_0x2d57b7={},_0x44bb9d={'count':0x0,'rows':[]};return db[_0xea4c('0x34')][_0xea4c('0x4c')]({'where':{'id':_0x496af2[_0xea4c('0x3e')]['id']}})[_0xea4c('0x17')](handleEntityNotFound(_0x498b93,null))[_0xea4c('0x17')](function(_0x1706e5){if(_0x1706e5){_0x2d57b7['model']=_[_0xea4c('0x40')](db['ChatMessage'][_0xea4c('0x35')]);_0x2d57b7[_0xea4c('0x3b')]=_[_0xea4c('0x40')](_0x496af2[_0xea4c('0x3b')]);_0x2d57b7[_0xea4c('0x41')]=_[_0xea4c('0x42')](_0x2d57b7[_0xea4c('0x3f')],_0x2d57b7[_0xea4c('0x3b')]);_0x171b7c[_0xea4c('0x43')]=_['intersection'](_0x2d57b7[_0xea4c('0x3f')],qs[_0xea4c('0x44')](_0x496af2[_0xea4c('0x3b')][_0xea4c('0x44')]));_0x171b7c[_0xea4c('0x43')]=_0x171b7c[_0xea4c('0x43')][_0xea4c('0xa0')]?_0x171b7c[_0xea4c('0x43')]:_0x2d57b7['model'];if(!_0x496af2[_0xea4c('0x3b')][_0xea4c('0xae')](_0xea4c('0xa1'))){_0x171b7c[_0xea4c('0x24')]=qs[_0xea4c('0x24')](_0x496af2[_0xea4c('0x3b')][_0xea4c('0x24')]);_0x171b7c[_0xea4c('0x22')]=qs['offset'](_0x496af2[_0xea4c('0x3b')][_0xea4c('0x22')]);}_0x171b7c[_0xea4c('0xaf')]=qs[_0xea4c('0xa2')](_0x496af2[_0xea4c('0x3b')][_0xea4c('0xa2')]);_0x171b7c[_0xea4c('0xa3')]=qs[_0xea4c('0x41')](_[_0xea4c('0xa4')](_0x496af2[_0xea4c('0x3b')],_0x2d57b7[_0xea4c('0x41')]));_0x171b7c[_0xea4c('0xa3')][_0xea4c('0xa5')]=_0x1706e5['id'];if(_0x496af2['query'][_0xea4c('0xa6')]){_0x171b7c[_0xea4c('0xa3')]=_[_0xea4c('0xa7')](_0x171b7c['where'],{'$or':_['map'](_0x171b7c[_0xea4c('0x43')],function(_0x254cfe){var _0x345d97={};_0x345d97[_0x254cfe]={'$like':'%'+_0x496af2['query'][_0xea4c('0xa6')]+'%'};return _0x345d97;})});}_0x171b7c[_0xea4c('0xa3')][_0xea4c('0x8e')]=![];if(_0x496af2['query']['id']){_0x171b7c['where']['id']={'$gt':_0x496af2[_0xea4c('0x3b')]['id']};}_0x171b7c=_[_0xea4c('0xa7')]({},_0x171b7c,_0x496af2[_0xea4c('0xab')]);return db['ChatMessage'][_0xea4c('0x25')]({'where':_0x171b7c['where']})[_0xea4c('0x17')](function(_0x3d366e){_0x44bb9d['count']=_0x3d366e;_0x171b7c[_0xea4c('0x46')]=[];if(_0x496af2[_0xea4c('0x3b')][_0xea4c('0xb0')]){_0x171b7c['include']['push']({'model':db[_0xea4c('0x7b')],'as':_0xea4c('0x7b'),'attributes':['id',_0xea4c('0x52'),'alias']});}if(_0x496af2[_0xea4c('0x3b')][_0xea4c('0x45')]){_0x171b7c[_0xea4c('0x46')]=[{'all':!![]}];}return db[_0xea4c('0x7a')][_0xea4c('0x39')](_0x171b7c);})[_0xea4c('0x17')](function(_0x37eaa9){_0x44bb9d[_0xea4c('0xac')]=_0x37eaa9;return _0x44bb9d;});}})[_0xea4c('0x17')](respondWithFilteredResult(_0x498b93,_0x171b7c))['catch'](handleError(_0x498b93,null));};exports[_0xea4c('0xb1')]=function(_0x17d5d5,_0x293916){return db[_0xea4c('0x34')][_0xea4c('0x48')]({'where':{'id':_0x17d5d5[_0xea4c('0x3e')]['id']}})[_0xea4c('0x17')](handleEntityNotFound(_0x293916,null))['then'](function(_0x3d1f16){if(_0x3d1f16){return _0x3d1f16[_0xea4c('0xb2')](_0x17d5d5[_0xea4c('0x2e')]['ids'],_['omit'](_0x17d5d5['body'],[_0xea4c('0x9e'),'id'])||{})[_0xea4c('0xb3')](function(){return db[_0xea4c('0xb4')][_0xea4c('0x39')]({'attributes':['id',_0xea4c('0x2b'),_0xea4c('0xb5')],'where':{'id':_0x17d5d5[_0xea4c('0x2e')][_0xea4c('0x9e')]}});})['then'](function(_0x1884c4){socket[_0xea4c('0xb6')](_0xea4c('0xb7'),{'id':Number(_0x17d5d5[_0xea4c('0x3e')]['id']),'tags':_0x1884c4||[]});return{'id':Number(_0x17d5d5[_0xea4c('0x3e')]['id']),'tags':_0x1884c4||[]};});}})[_0xea4c('0x17')](respondWithResult(_0x293916,null))[_0xea4c('0x3d')](handleError(_0x293916,null));};exports[_0xea4c('0xb8')]=function(_0x397799,_0x34590d){return db[_0xea4c('0x34')][_0xea4c('0x48')]({'where':{'id':_0x397799[_0xea4c('0x3e')]['id']}})[_0xea4c('0x17')](handleEntityNotFound(_0x34590d,null))[_0xea4c('0x17')](function(_0x5d3cd2){if(_0x5d3cd2){return _0x5d3cd2[_0xea4c('0xb8')](_0x397799[_0xea4c('0x3b')]['ids']);}})[_0xea4c('0x17')](respondWithStatusCode(_0x34590d,null))[_0xea4c('0x3d')](handleError(_0x34590d,null));};exports[_0xea4c('0x74')]=function(_0xd1e55b,_0xefc6ed){var _0x47075e=moment()[_0xea4c('0xb9')]()['toString']();var _0x57440f=path[_0xea4c('0x6f')](config[_0xea4c('0x70')],_0xea4c('0xba'),_0xea4c('0xbb'),_0xea4c('0xbc'));var _0x2f39bb=path[_0xea4c('0x6f')](config[_0xea4c('0x70')],_0xea4c('0xba'),_0xea4c('0xbb'),_0xea4c('0xbd'));var _0x5bf231=path[_0xea4c('0x6f')](_0x57440f,_0x47075e);var _0x1329ae=util[_0xea4c('0x7f')]('transcript-%d-%s.zip',_0xd1e55b[_0xea4c('0x3e')]['id'],_0x47075e);var _0x278138=path[_0xea4c('0x6f')](_0x57440f,_0x1329ae);var _0x3452fc=[];_0x3452fc[_0xea4c('0xbe')]({'model':db[_0xea4c('0x7b')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x3452fc[_0xea4c('0xbe')]({'model':db['CmContact'],'as':_0xea4c('0x60'),'attributes':['id',_0xea4c('0xbf'),'lastName'],'raw':!![]});if(_0xd1e55b[_0xea4c('0x3b')][_0xea4c('0xbd')]){_0x3452fc[_0xea4c('0xbe')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x596ba4=[{'model':db[_0xea4c('0x7a')],'as':_0xea4c('0x7d'),'attributes':['id',_0xea4c('0x2e'),_0xea4c('0x8b'),_0xea4c('0x8d'),_0xea4c('0x8e'),_0xea4c('0xc0')],'include':_0x3452fc}];_0x596ba4[_0xea4c('0xbe')]({'model':db['ChatWebsite'],'as':_0xea4c('0xc1'),'attributes':['id','name']});_0x596ba4['push']({'model':db[_0xea4c('0x7b')],'as':_0xea4c('0xc2'),'attributes':['id',_0xea4c('0x52')]});return db[_0xea4c('0x34')]['find']({'where':{'id':_0xd1e55b[_0xea4c('0x3e')]['id']},'include':_0x596ba4})[_0xea4c('0x17')](handleEntityNotFound(_0xefc6ed,null))[_0xea4c('0x17')](function(_0xa365f6){if(_0xa365f6){var _0xbed595=_0xa365f6[_0xea4c('0xc3')]({'plain':!![]});fs[_0xea4c('0xc4')](_0x5bf231);var _0x27a32e={'channel':_0xea4c('0xc5'),'account':_0xbed595[_0xea4c('0xc1')]['name'],'agent':_0xbed595[_0xea4c('0xc2')]?_0xbed595['Owner'][_0xea4c('0x52')]:_0xea4c('0xc6'),'createdAt':moment(_0xbed595['createdAt'])[_0xea4c('0x7f')](_0xea4c('0xaa'))[_0xea4c('0xc7')](),'closedAt':_0xbed595[_0xea4c('0x64')]?moment(_0xbed595['closedAt'])[_0xea4c('0x7f')](_0xea4c('0xaa'))[_0xea4c('0xc7')]():'','disposition':_0xbed595['disposition'],'chatInfo':{'browser':_0xbed595['browserName'],'os':_0xbed595['osName'],'referer':_0xbed595[_0xea4c('0xc8')],'customerIp':_0xbed595[_0xea4c('0xc9')],'customerPort':_0xbed595['customerPort']?_0xbed595['customerPort']:'N.A.'},'messages':_(_0xbed595['Messages'])[_0xea4c('0xca')]()[_0xea4c('0xa6')]({'secret':![]})[_0xea4c('0x33')](function(_0xf606da){if(_0xf606da['Attachment']){var _0x285e26=path[_0xea4c('0x6f')](_0x2f39bb,_0xf606da[_0xea4c('0x6b')][_0xea4c('0x73')]);if(fs[_0xea4c('0xcb')](_0x285e26)){fs[_0xea4c('0xcc')](_0x285e26)[_0xea4c('0xcd')](fs[_0xea4c('0xce')](path['join'](_0x5bf231,_0xf606da['Attachment']['basename'])));}}return{'date':moment(_0xf606da[_0xea4c('0x8b')])['format'](_0xea4c('0xaa'))[_0xea4c('0xc7')](),'sender':_0xf606da[_0xea4c('0x8d')]===_0xea4c('0x5d')?_0xf606da[_0xea4c('0x7b')]?_0xf606da[_0xea4c('0x7b')][_0xea4c('0x52')]:'System':_0xf606da[_0xea4c('0x60')]['firstName']+(_0xf606da[_0xea4c('0x60')][_0xea4c('0xcf')]?'\x20'+_0xf606da[_0xea4c('0x60')][_0xea4c('0xcf')]:''),'body':_0xf606da[_0xea4c('0x6b')]?_0xf606da[_0xea4c('0x6b')][_0xea4c('0x73')]:_0xf606da[_0xea4c('0x2e')],'direction':_0xf606da[_0xea4c('0x8d')]===_0xea4c('0x5d')?'A':'C','secret':_0xf606da[_0xea4c('0x8e')],'read':_0xf606da['read'],'attachment':_0xf606da[_0xea4c('0x6b')]};})['value']()};return ejs[_0xea4c('0xd0')](path['join'](config['root'],'server','views',_0xea4c('0xd1')),{'interaction':_0x27a32e})[_0xea4c('0x17')](function(_0x325b40){var _0xa138f2=path[_0xea4c('0x6f')](_0x5bf231,_0xea4c('0xd2')+_0xbed595['id']+'-'+_0x47075e+_0xea4c('0xd3'));var _0x3077bd={'path':_0xa138f2,'channel':'Chat','interactionId':_0xbed595['id']};return pdf[_0xea4c('0xd4')](_0x325b40,_0x3077bd);})[_0xea4c('0x17')](function(){return new Promise(function(_0x16bde9,_0x2fbc40){zipdir(_0x5bf231,{'saveTo':_0x278138},function(_0x451b69,_0x2b23eb){if(_0x451b69)return _0x2fbc40(_0x451b69);return _0x16bde9(_0x2b23eb);});})['then'](function(){return new BPromise(function(_0x5d1b8f,_0x1bb394){rimraf(_0x5bf231,function(_0x8812e5){if(_0x8812e5)_0x1bb394(_0x8812e5);return _0x5d1b8f();});});})[_0xea4c('0x17')](function(){return _0xefc6ed[_0xea4c('0x74')](_0x278138,_0x1329ae,function(_0x5aa74f){if(_0x5aa74f){logger[_0xea4c('0x1a')]('err',_0x5aa74f);}else{fs[_0xea4c('0xd5')](_0x278138);}});});});}else{return _0xefc6ed[_0xea4c('0x1f')](0xc8);}})['catch'](handleError(_0xefc6ed,null));};
\ No newline at end of file
+var _0xc673=['vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','sendStatus','UserId','disposition','attachmentUpload','file','originalname','filename','mimetype','attachmentDownload','closed','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','close','mailTranscript','transcript-%s.txt','pathTranscript','User','ContactId','length','format','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','ids','omit','getMessages','keys','hasOwnProperty','nolimit','limit','order','sort','pick','where','filter','$gte','split','options','rows','getMyMessages','includeAgent','alias','addTags','setTags','spread','color','emit','removeTags','download','unix','toString','server','files','attachments','transcript-%d-%s.zip','push','lastName','Messages','read','ChatWebsite','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','osName','referer','customerIp','customerPort','tail','Attachment','pipe','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','mustache','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','status','json','undefined','count','offset','set','Content-Range','destroy','name','render','merge','body','agent','interaction','account','map','ChatInteraction','fieldName','type','findAll','chat','query','user','show','params','model','rawAttributes','filters','intersection','attributes','fields','includeAll','include','find','create','update','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation'];(function(_0x1ba857,_0xd9b7d9){var _0x255072=function(_0xddb0ce){while(--_0xddb0ce){_0x1ba857['push'](_0x1ba857['shift']());}};_0x255072(++_0xd9b7d9);}(_0xc673,0x159));var _0x3c67=function(_0x2467c3,_0x29d8fb){_0x2467c3=_0x2467c3-0x0;var _0x19b262=_0xc673[_0x2467c3];return _0x19b262;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x3c67('0x0'));var rp=require(_0x3c67('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3c67('0x2'));var util=require(_0x3c67('0x3'));var path=require(_0x3c67('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3c67('0x5'));var Redis=require('ioredis');var interaction=require(_0x3c67('0x6'));var qs=require(_0x3c67('0x7'));var pdf=require(_0x3c67('0x8'));var logger=require(_0x3c67('0x9'))(_0x3c67('0xa'));var config=require(_0x3c67('0xb'));var db=require(_0x3c67('0xc'))['db'];config['redis']=_[_0x3c67('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3c67('0xe'))(new Redis(config[_0x3c67('0xf')]));require('./chatInteraction.socket')[_0x3c67('0x10')](socket);var jayson=require(_0x3c67('0x11'));var client=jayson[_0x3c67('0x12')]['http']({'port':0x232b});var client9004=jayson[_0x3c67('0x12')][_0x3c67('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x1cd4dd,_0x2ffc18,_0x4d9f6a,_0x3ff34a){return new BPromise(function(_0x43ef2b,_0x3d6c3d){var _0x477ad9=_0x3ff34a||client;return _0x477ad9[_0x3c67('0x14')](_0x1cd4dd,_0x4d9f6a)[_0x3c67('0x15')](function(_0x25a9b2){logger['info'](_0x3c67('0x16'),_0x2ffc18,_0x3c67('0x17'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2ffc18,_0x3c67('0x17'),JSON['stringify'](_0x25a9b2));if(_0x25a9b2[_0x3c67('0x18')]){if(_0x25a9b2[_0x3c67('0x18')][_0x3c67('0x19')]===0x1f4){logger['error'](_0x3c67('0x16'),_0x2ffc18,_0x25a9b2[_0x3c67('0x18')]['message']);return _0x3d6c3d(_0x25a9b2['error'][_0x3c67('0x1a')]);}logger[_0x3c67('0x18')](_0x3c67('0x16'),_0x2ffc18,_0x25a9b2[_0x3c67('0x18')][_0x3c67('0x1a')]);return _0x43ef2b(_0x25a9b2[_0x3c67('0x18')][_0x3c67('0x1a')]);}else{logger[_0x3c67('0x1b')](_0x3c67('0x16'),_0x2ffc18,'request\x20sent');_0x43ef2b(_0x25a9b2[_0x3c67('0x1c')][_0x3c67('0x1a')]);}})[_0x3c67('0x1d')](function(_0x52bc48){logger[_0x3c67('0x18')](_0x3c67('0x16'),_0x2ffc18,_0x52bc48);_0x3d6c3d(_0x52bc48);});});}function respondWithStatusCode(_0x1cbc54,_0x604ad0){_0x604ad0=_0x604ad0||0xcc;return function(_0x5dc4b2){if(_0x5dc4b2){return _0x1cbc54['sendStatus'](_0x604ad0);}return _0x1cbc54[_0x3c67('0x1e')](_0x604ad0)['end']();};}function respondWithResult(_0x1dc63c,_0x1c1e92){_0x1c1e92=_0x1c1e92||0xc8;return function(_0x17fa56){if(_0x17fa56){return _0x1dc63c[_0x3c67('0x1e')](_0x1c1e92)[_0x3c67('0x1f')](_0x17fa56);}};}function respondWithFilteredResult(_0x41feb6,_0x1d70fd){return function(_0x342b79){if(_0x342b79){var _0x105218=typeof _0x1d70fd['offset']==='undefined'&&typeof _0x1d70fd['limit']===_0x3c67('0x20');var _0xe562d6=_0x342b79[_0x3c67('0x21')];var _0x3b75dc=_0x105218?0x0:_0x1d70fd[_0x3c67('0x22')];var _0x213a5c=_0x105218?_0x342b79[_0x3c67('0x21')]:_0x1d70fd[_0x3c67('0x22')]+_0x1d70fd['limit'];var _0x349d8e;if(_0x213a5c>=_0xe562d6){_0x213a5c=_0xe562d6;_0x349d8e=0xc8;}else{_0x349d8e=0xce;}_0x41feb6[_0x3c67('0x1e')](_0x349d8e);return _0x41feb6[_0x3c67('0x23')](_0x3c67('0x24'),_0x3b75dc+'-'+_0x213a5c+'/'+_0xe562d6)[_0x3c67('0x1f')](_0x342b79);}return null;};}function saveUpdates(_0x374055){return function(_0xe5d52f){if(_0xe5d52f){return _0xe5d52f['update'](_0x374055)[_0x3c67('0x15')](function(_0xa8c9a4){return _0xa8c9a4;});}return null;};}function removeEntity(_0x48626d){return function(_0xdf54f2){if(_0xdf54f2){return _0xdf54f2[_0x3c67('0x25')]()[_0x3c67('0x15')](function(){_0x48626d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269133){return function(_0x105271){if(!_0x105271){_0x269133['sendStatus'](0x194);}return _0x105271;};}function handleError(_0x5e4730,_0x192c36){_0x192c36=_0x192c36||0x1f4;return function(_0x34ea66){logger['error'](_0x34ea66['stack']);if(_0x34ea66[_0x3c67('0x26')]){delete _0x34ea66[_0x3c67('0x26')];}_0x5e4730['status'](_0x192c36)['send'](_0x34ea66);};}function getMustacheRender(_0x319bf4,_0x1d5a35){return Mustache[_0x3c67('0x27')](_0x319bf4,_[_0x3c67('0x28')](_0x1d5a35[_0x3c67('0x29')],{'contact':_0x1d5a35['contact'],'message':_0x1d5a35[_0x3c67('0x1a')],'agent':_0x1d5a35[_0x3c67('0x2a')],'interaction':_0x1d5a35[_0x3c67('0x2b')],'account':_0x1d5a35[_0x3c67('0x2c')]}))||'';}exports['index']=function(_0x159b69,_0x306002){var _0xcb862={};var _0x410349=_[_0x3c67('0x2d')](db[_0x3c67('0x2e')]['rawAttributes'],function(_0x5274e5){return{'name':_0x5274e5[_0x3c67('0x2f')],'type':_0x5274e5[_0x3c67('0x30')]['key']};});_0xcb862=qs['getOptions'](_0x410349,_0x159b69);return interaction[_0x3c67('0x31')](_0x3c67('0x32'),_0x159b69[_0x3c67('0x33')],_0x159b69[_0x3c67('0x34')],_0xcb862,_0x410349)[_0x3c67('0x15')](respondWithFilteredResult(_0x306002,_0xcb862))[_0x3c67('0x1d')](handleError(_0x306002,null));};exports[_0x3c67('0x35')]=function(_0x4ab912,_0x3fa80c){var _0x361395={'raw':![],'where':{'id':_0x4ab912[_0x3c67('0x36')]['id']}},_0x5b6f53={};_0x5b6f53[_0x3c67('0x37')]=_['keys'](db[_0x3c67('0x2e')][_0x3c67('0x38')]);_0x5b6f53[_0x3c67('0x33')]=_['keys'](_0x4ab912[_0x3c67('0x33')]);_0x5b6f53[_0x3c67('0x39')]=_[_0x3c67('0x3a')](_0x5b6f53[_0x3c67('0x37')],_0x5b6f53[_0x3c67('0x33')]);_0x361395[_0x3c67('0x3b')]=_['intersection'](_0x5b6f53[_0x3c67('0x37')],qs[_0x3c67('0x3c')](_0x4ab912['query'][_0x3c67('0x3c')]));_0x361395[_0x3c67('0x3b')]=_0x361395[_0x3c67('0x3b')]['length']?_0x361395[_0x3c67('0x3b')]:_0x5b6f53[_0x3c67('0x37')];if(_0x4ab912[_0x3c67('0x33')][_0x3c67('0x3d')]){_0x361395[_0x3c67('0x3e')]=[{'all':!![]}];}_0x361395=_[_0x3c67('0x28')]({},_0x361395,_0x4ab912['options']);return db[_0x3c67('0x2e')][_0x3c67('0x3f')](_0x361395)[_0x3c67('0x15')](handleEntityNotFound(_0x3fa80c,null))[_0x3c67('0x15')](respondWithResult(_0x3fa80c,null))[_0x3c67('0x1d')](handleError(_0x3fa80c,null));};exports[_0x3c67('0x40')]=function(_0x177e20,_0x42c05e){return db['ChatInteraction'][_0x3c67('0x40')](_0x177e20[_0x3c67('0x29')],{})[_0x3c67('0x15')](respondWithResult(_0x42c05e,0xc9))[_0x3c67('0x1d')](handleError(_0x42c05e,null));};exports[_0x3c67('0x41')]=function(_0x53902a,_0x1d05a2){if(_0x53902a[_0x3c67('0x29')]['id']){delete _0x53902a[_0x3c67('0x29')]['id'];}return db[_0x3c67('0x2e')][_0x3c67('0x3f')]({'where':{'id':_0x53902a[_0x3c67('0x36')]['id']}})[_0x3c67('0x15')](handleEntityNotFound(_0x1d05a2,null))['then'](saveUpdates(_0x53902a['body'],null))['then'](respondWithResult(_0x1d05a2,null))[_0x3c67('0x1d')](handleError(_0x1d05a2,null));};exports[_0x3c67('0x25')]=function(_0x285046,_0x231f34){return db[_0x3c67('0x2e')][_0x3c67('0x3f')]({'where':{'id':_0x285046['params']['id']}})['then'](handleEntityNotFound(_0x231f34,null))[_0x3c67('0x15')](removeEntity(_0x231f34,null))['catch'](handleError(_0x231f34,null));};exports[_0x3c67('0x42')]=function(_0x510910,_0x150e73){return db['ChatInteraction'][_0x3c67('0x42')]()['then'](respondWithResult(_0x150e73,null))['catch'](handleError(_0x150e73,null));};exports['createVidaooSession']=function(_0x5903dc,_0x4bf3e1){var _0x113ddb=_0x5903dc[_0x3c67('0x36')]['id'];var _0x51aa77;var _0x2350d;var _0x3055f9;return db[_0x3c67('0x2e')]['findOne']({'where':{'id':_0x113ddb}})[_0x3c67('0x15')](function(_0x1d8a74){_0x51aa77=_0x1d8a74;return db['ChatWebsite'][_0x3c67('0x43')]({'where':{'id':_0x1d8a74[_0x3c67('0x44')]},'attributes':['id',_0x3c67('0x45'),_0x3c67('0x46'),_0x3c67('0x47'),_0x3c67('0x48'),_0x3c67('0x49')],'raw':!![]});})[_0x3c67('0x15')](function(_0x224d7f){if(_0x224d7f&&_0x224d7f[_0x3c67('0x45')]&&_0x224d7f['vidaooEscalation']){_0x2350d=_0x224d7f;var _0x1d18aa={'interaction':{'id':_0x113ddb},'agent':{'id':_0x5903dc[_0x3c67('0x34')]['id'],'name':_0x5903dc[_0x3c67('0x34')]['name'],'fullname':_0x5903dc[_0x3c67('0x34')]['fullname'],'email':_0x5903dc[_0x3c67('0x34')][_0x3c67('0x4a')]},'contact':_0x5903dc['body'][_0x3c67('0x4b')],'account':_0x5903dc[_0x3c67('0x29')][_0x3c67('0x2c')]};var _0x58c177={'rejectUnauthorized':![],'method':_0x3c67('0x4c'),'url':_0x3c67('0x4d'),'headers':{'X-APIKEY':_0x224d7f[_0x3c67('0x45')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5903dc['user'][_0x3c67('0x4a')]],'buttons':null,'topic':_0x2350d[_0x3c67('0x47')],'note':_[_0x3c67('0x4e')](_0x2350d['vidaooNote'])?null:getMustacheRender(_0x2350d[_0x3c67('0x48')],_0x1d18aa),'metadata':null},'redirect':_0x3c67('0x4f'),'json':!![]};try{if(!_[_0x3c67('0x4e')](_0x2350d[_0x3c67('0x49')])){var _0x280f93=getMustacheRender(_0x2350d['vidaooMetadata'],_0x1d18aa);var _0x25430d=JSON[_0x3c67('0x50')](_0x280f93);_0x58c177[_0x3c67('0x29')][_0x3c67('0x51')]=_0x25430d;}}catch(_0x5cb44c){throw new db[(_0x3c67('0x52'))][(_0x3c67('0x53'))](_0x3c67('0x54'));}return rp(_0x58c177);}else{throw new db[(_0x3c67('0x52'))][(_0x3c67('0x53'))](_0x3c67('0x55'));}})[_0x3c67('0x15')](function(_0x8f4f42){_0x3055f9=_0x8f4f42;if(_0x3055f9['id']){var _0x33bf86={'body':_0x3055f9[_0x3c67('0x56')],'ChatWebsiteId':_0x2350d['id'],'ChatInteractionId':_0x51aa77['id'],'direction':_0x3c67('0x57'),'UserId':_0x5903dc[_0x3c67('0x34')]['id']};return db['ChatMessage'][_0x3c67('0x40')](_0x33bf86,{});}else{throw new db[(_0x3c67('0x52'))][(_0x3c67('0x53'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x3c67('0x15')](function(){return _0x51aa77[_0x3c67('0x58')]({'vidaooSessionId':_0x3055f9['id']});})[_0x3c67('0x15')](respondWithResult(_0x4bf3e1,null))[_0x3c67('0x1d')](handleError(_0x4bf3e1,null));};exports[_0x3c67('0x59')]=function(_0x16d735,_0x4d79bc){if(_0x16d735[_0x3c67('0x29')]['id']){delete _0x16d735['body']['id'];}return db[_0x3c67('0x2e')][_0x3c67('0x3f')]({'where':{'id':_0x16d735['params']['id']},'include':[{'model':db[_0x3c67('0x5a')],'as':_0x3c67('0x5b')}]})[_0x3c67('0x15')](handleEntityNotFound(_0x4d79bc,null))[_0x3c67('0x15')](saveUpdates(_0x16d735[_0x3c67('0x29')],null))[_0x3c67('0x15')](respondWithResult(_0x4d79bc,null))[_0x3c67('0x1d')](handleError(_0x4d79bc,null));};exports['abandon']=function(_0x29eb2e,_0xf862d1){if(_0x29eb2e[_0x3c67('0x29')]['id']){delete _0x29eb2e[_0x3c67('0x29')]['id'];}return db[_0x3c67('0x2e')][_0x3c67('0x3f')]({'where':{'id':_0x29eb2e[_0x3c67('0x36')]['id']}})['then'](function(_0xa552cc){if(!_0xa552cc){logger['error'](_0x3c67('0x5c'),_0x3c67('0x5d'),0x194,_0x3c67('0x5e'));_0xf862d1[_0x3c67('0x5f')](0x194);}else{if(_0xa552cc[_0x3c67('0x60')]){throw new db[(_0x3c67('0x52'))][(_0x3c67('0x53'))]('Interaction\x20already\x20assigned');}}return _0xa552cc;})[_0x3c67('0x15')](function(_0xd6aa93){if(_0xd6aa93){return _0xd6aa93[_0x3c67('0x41')]({'closed':_0x29eb2e[_0x3c67('0x29')]['closed'],'disposition':_0x29eb2e['body'][_0x3c67('0x61')]})[_0x3c67('0x15')](function(_0x477f1c){return _0x477f1c;});}})[_0x3c67('0x15')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x29eb2e[_0x3c67('0x29')],client9004);})[_0x3c67('0x15')](respondWithResult(_0xf862d1,null))[_0x3c67('0x1d')](handleError(_0xf862d1,null));};exports[_0x3c67('0x62')]=function(_0x1152ab,_0x2593d2){_0x1152ab[_0x3c67('0x29')][_0x3c67('0x26')]=_0x1152ab[_0x3c67('0x63')][_0x3c67('0x64')];_0x1152ab[_0x3c67('0x29')]['basename']=_0x1152ab[_0x3c67('0x63')][_0x3c67('0x65')];_0x1152ab['body'][_0x3c67('0x30')]=_0x1152ab[_0x3c67('0x63')][_0x3c67('0x66')];return db['Attachment']['create'](_0x1152ab['body'])[_0x3c67('0x15')](respondWithResult(_0x2593d2,0xc9))[_0x3c67('0x1d')](handleError(_0x2593d2,null));};exports[_0x3c67('0x67')]=function(_0x42d2b3,_0x11ee72){return db['ChatInteraction'][_0x3c67('0x43')]({'where':{'id':_0x42d2b3[_0x3c67('0x36')]['id']},'raw':!![]})[_0x3c67('0x15')](handleEntityNotFound(_0x11ee72,null))[_0x3c67('0x15')](function(_0x16f3bf){if(_0x16f3bf){if(_0x16f3bf[_0x3c67('0x68')]){return _0x11ee72[_0x3c67('0x1e')](0x193)[_0x3c67('0x1f')]({'status':0x193,'message':_0x3c67('0x69')});}return db['Attachment'][_0x3c67('0x43')]({'where':{'id':_0x42d2b3['query']['attachId']},'raw':!![]})[_0x3c67('0x15')](handleEntityNotFound(_0x11ee72,null));}})[_0x3c67('0x15')](function(_0x4d76f1){if(_0x4d76f1){var _0x4e4e6e=_0x4d76f1[_0x3c67('0x6a')]!==null;var _0x417635=path[_0x3c67('0x6b')](config[_0x3c67('0x6c')],_0x3c67('0x6d'));if(_0x4e4e6e){_0x417635=path[_0x3c67('0x6b')](_0x417635,_0x3c67('0x6e'));}var _0x528e4b=path[_0x3c67('0x6b')](_0x417635,_0x4d76f1[_0x3c67('0x6f')]);return _0x11ee72['download'](_0x528e4b);}})['catch'](handleError(_0x11ee72,null));};exports[_0x3c67('0x70')]=function(_0xdffbfb,_0x327e1c){var _0x3485c4=null;var _0x5fbe9d=null;var _0x1579fc=null;if(_0xdffbfb[_0x3c67('0x29')]['id']){delete _0xdffbfb[_0x3c67('0x29')]['id'];}if(_0xdffbfb[_0x3c67('0x29')][_0x3c67('0x71')]){_0x1579fc=path[_0x3c67('0x6b')](config[_0x3c67('0x6c')],'server/files/chat/upload/',util['format'](_0x3c67('0x72'),Date['now']()));_0xdffbfb[_0x3c67('0x29')][_0x3c67('0x73')]=_0x1579fc;}return db[_0x3c67('0x2e')][_0x3c67('0x3f')]({'where':{'id':_0xdffbfb['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db['User'],'as':_0x3c67('0x74')}]}]})[_0x3c67('0x15')](handleEntityNotFound(_0x327e1c,null))[_0x3c67('0x15')](saveUpdates(_0xdffbfb[_0x3c67('0x29')],null))[_0x3c67('0x15')](function(_0x3d1df7){if(_0x3d1df7){_0x3485c4=_0x3d1df7;return db['ChatWebsite']['find']({'where':{'id':_0x3485c4[_0x3c67('0x44')]}});}})[_0x3c67('0x15')](function(_0x397d48){if(_0x397d48){_0x5fbe9d=_0x397d48;return db[_0x3c67('0x5a')][_0x3c67('0x3f')]({'where':{'id':_0x3485c4[_0x3c67('0x75')]}});}})[_0x3c67('0x15')](function(_0x520ca4){if(_0x520ca4){if(_0x1579fc){var _0x51ee4c=null;for(var _0x6be2f9=0x1;_0x6be2f9<_0x3485c4['Messages'][_0x3c67('0x76')];++_0x6be2f9){_0x51ee4c=_0x3485c4['Messages'][_0x6be2f9];var _0x2482b2=_0x51ee4c[_0x3c67('0x60')]?util[_0x3c67('0x77')](_0x3c67('0x78'),_0x5fbe9d['agentAlias'],_0x51ee4c[_0x3c67('0x60')]):_0x3c67('0x79');var _0x13e12b=_0xdffbfb[_0x3c67('0x29')][_0x3c67('0x7a')]||util[_0x3c67('0x77')](_0x3c67('0x78'),_0x3c67('0x7b'),_0x51ee4c[_0x3c67('0x75')]);switch(_0x5fbe9d[_0x3c67('0x7c')]){case _0x3c67('0x7d'):_0x2482b2=_0x51ee4c[_0x3c67('0x60')]?util[_0x3c67('0x77')]('%s%d',_0x5fbe9d[_0x3c67('0x7e')],_0x51ee4c[_0x3c67('0x60')]):_0x3c67('0x79');break;case _0x3c67('0x7f'):_0x2482b2=_0x51ee4c[_0x3c67('0x60')]?_0x51ee4c[_0x3c67('0x74')]['alias']||_0x51ee4c[_0x3c67('0x74')][_0x3c67('0x80')]:_0x3c67('0x79');break;case _0x3c67('0x81'):_0x2482b2=_0x51ee4c[_0x3c67('0x60')]?_0x51ee4c[_0x3c67('0x74')][_0x3c67('0x80')]:_0x3c67('0x79');break;default:_0x2482b2=_0x51ee4c[_0x3c67('0x60')]?util[_0x3c67('0x77')]('%s%d',_0x5fbe9d[_0x3c67('0x7e')],_0x51ee4c[_0x3c67('0x60')]):_0x3c67('0x79');}var _0x427f90=util['format'](_0x3c67('0x82'),moment(_0x51ee4c[_0x3c67('0x83')])[_0x3c67('0x77')](_0x3c67('0x84')),_0x51ee4c[_0x3c67('0x85')]==='in'?_0x13e12b:_0x2482b2,_0x51ee4c[_0x3c67('0x29')]);if(!_0x51ee4c[_0x3c67('0x86')]){fs[_0x3c67('0x87')](_0x1579fc,_0x427f90);}}return db[_0x3c67('0x88')][_0x3c67('0x43')]({'where':{'service':!![]},'include':[{'model':db[_0x3c67('0x89')],'as':_0x3c67('0x8a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x3c67('0x15')](function(_0x1761e4){if(!_0x1761e4||!_0x1761e4[_0x3c67('0x8a')]||!_0xdffbfb[_0x3c67('0x29')])return _0x3485c4;var _0x196790=_0x1761e4[_0x3c67('0x8b')]();return respondWithRpcPromise(_0x3c67('0x8c'),_0x3c67('0x8d'),{'account':_0x196790,'message':{'from':util[_0x3c67('0x77')](_0x3c67('0x8e'),_0x1761e4[_0x3c67('0x26')],_0x1761e4[_0x3c67('0x4a')]||_0x1761e4[_0x3c67('0x8a')][_0x3c67('0x34')]),'to':_0xdffbfb[_0x3c67('0x29')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format'](_0x3c67('0x8f'),_0xdffbfb[_0x3c67('0x29')][_0x3c67('0x71')]),'attachments':[{'path':_0x1579fc}]}})['then'](function(){return _0x3485c4;})[_0x3c67('0x1d')](function(_0x4352e6){logger[_0x3c67('0x18')](_0x4352e6);});})[_0x3c67('0x15')](respondWithStatusCode(_0x327e1c,0xc8))['catch'](handleError(_0x327e1c,null));};exports[_0x3c67('0x90')]=function(_0x539d54,_0x39b5ec){return db[_0x3c67('0x91')][_0x3c67('0x3f')]({'where':{'id':_0x539d54['params']['id']}})[_0x3c67('0x15')](handleEntityNotFound(_0x39b5ec,null))[_0x3c67('0x15')](function(_0x432faf){if(_0x432faf){return _0x432faf[_0x3c67('0x90')](_0x539d54[_0x3c67('0x29')][_0x3c67('0x92')],_[_0x3c67('0x93')](_0x539d54[_0x3c67('0x29')],[_0x3c67('0x92'),'id'])||{});}})[_0x3c67('0x15')](respondWithResult(_0x39b5ec,null))['catch'](handleError(_0x39b5ec,null));};exports[_0x3c67('0x94')]=function(_0x3e3507,_0x30347d){var _0x33d902={'raw':![],'where':{}};var _0xcd4720={};var _0x2e25dc={'count':0x0,'rows':[]};return db[_0x3c67('0x2e')][_0x3c67('0x43')]({'where':{'id':_0x3e3507[_0x3c67('0x36')]['id']}})[_0x3c67('0x15')](handleEntityNotFound(_0x30347d,null))['then'](function(_0x2404dc){if(_0x2404dc){_0xcd4720[_0x3c67('0x37')]=_[_0x3c67('0x95')](db[_0x3c67('0x91')][_0x3c67('0x38')]);_0xcd4720[_0x3c67('0x33')]=_['keys'](_0x3e3507['query']);_0xcd4720['filters']=_[_0x3c67('0x3a')](_0xcd4720[_0x3c67('0x37')],_0xcd4720[_0x3c67('0x33')]);_0x33d902[_0x3c67('0x3b')]=_['intersection'](_0xcd4720[_0x3c67('0x37')],qs['fields'](_0x3e3507[_0x3c67('0x33')][_0x3c67('0x3c')]));_0x33d902[_0x3c67('0x3b')]=_0x33d902['attributes'][_0x3c67('0x76')]?_0x33d902['attributes']:_0xcd4720['model'];if(!_0x3e3507[_0x3c67('0x33')][_0x3c67('0x96')](_0x3c67('0x97'))){_0x33d902['limit']=qs[_0x3c67('0x98')](_0x3e3507['query']['limit']);_0x33d902[_0x3c67('0x22')]=qs[_0x3c67('0x22')](_0x3e3507[_0x3c67('0x33')][_0x3c67('0x22')]);}_0x33d902[_0x3c67('0x99')]=qs[_0x3c67('0x9a')](_0x3e3507[_0x3c67('0x33')][_0x3c67('0x9a')]);_0x33d902['where']=qs['filters'](_[_0x3c67('0x9b')](_0x3e3507[_0x3c67('0x33')],_0xcd4720[_0x3c67('0x39')]));_0x33d902[_0x3c67('0x9c')]['ChatInteractionId']=_0x2404dc['id'];if(_0x3e3507[_0x3c67('0x33')]['filter']){_0x33d902['where']=_[_0x3c67('0x28')](_0x33d902[_0x3c67('0x9c')],{'$or':_[_0x3c67('0x2d')](_0x33d902[_0x3c67('0x3b')],function(_0x3fadfa){var _0x258f8d={};_0x258f8d[_0x3fadfa]={'$like':'%'+_0x3e3507['query'][_0x3c67('0x9d')]+'%'};return _0x258f8d;})});}if(_0x3e3507['query'][_0x3c67('0x9e')]){var _0x454a60=_0x3e3507[_0x3c67('0x33')][_0x3c67('0x9e')][_0x3c67('0x9f')](',');var _0x7ec8e6={};_0x7ec8e6[_0x454a60[0x0]]={'$gte':moment(_0x454a60[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x33d902['where']=_[_0x3c67('0x28')](_0x33d902[_0x3c67('0x9c')],_0x7ec8e6);}_0x33d902=_['merge']({},_0x33d902,_0x3e3507[_0x3c67('0xa0')]);return db['ChatMessage'][_0x3c67('0x21')]({'where':_0x33d902[_0x3c67('0x9c')]})['then'](function(_0x567f0b){_0x2e25dc['count']=_0x567f0b;if(_0x3e3507[_0x3c67('0x33')][_0x3c67('0x3d')]){_0x33d902[_0x3c67('0x3e')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x33d902);})['then'](function(_0x5568e1){_0x2e25dc[_0x3c67('0xa1')]=_0x5568e1;return _0x2e25dc;});}})[_0x3c67('0x15')](respondWithFilteredResult(_0x30347d,_0x33d902))[_0x3c67('0x1d')](handleError(_0x30347d,null));};exports[_0x3c67('0xa2')]=function(_0x2dc92f,_0x49b8ed){var _0xe3b037={'where':{}},_0xe32a8a={},_0x518169={'count':0x0,'rows':[]};return db[_0x3c67('0x2e')][_0x3c67('0x43')]({'where':{'id':_0x2dc92f[_0x3c67('0x36')]['id']}})['then'](handleEntityNotFound(_0x49b8ed,null))[_0x3c67('0x15')](function(_0x3b8c5f){if(_0x3b8c5f){_0xe32a8a[_0x3c67('0x37')]=_[_0x3c67('0x95')](db['ChatMessage']['rawAttributes']);_0xe32a8a[_0x3c67('0x33')]=_[_0x3c67('0x95')](_0x2dc92f['query']);_0xe32a8a[_0x3c67('0x39')]=_[_0x3c67('0x3a')](_0xe32a8a[_0x3c67('0x37')],_0xe32a8a[_0x3c67('0x33')]);_0xe3b037[_0x3c67('0x3b')]=_[_0x3c67('0x3a')](_0xe32a8a['model'],qs[_0x3c67('0x3c')](_0x2dc92f['query'][_0x3c67('0x3c')]));_0xe3b037[_0x3c67('0x3b')]=_0xe3b037[_0x3c67('0x3b')][_0x3c67('0x76')]?_0xe3b037[_0x3c67('0x3b')]:_0xe32a8a[_0x3c67('0x37')];if(!_0x2dc92f[_0x3c67('0x33')][_0x3c67('0x96')](_0x3c67('0x97'))){_0xe3b037[_0x3c67('0x98')]=qs[_0x3c67('0x98')](_0x2dc92f['query'][_0x3c67('0x98')]);_0xe3b037['offset']=qs[_0x3c67('0x22')](_0x2dc92f[_0x3c67('0x33')][_0x3c67('0x22')]);}_0xe3b037[_0x3c67('0x99')]=qs[_0x3c67('0x9a')](_0x2dc92f[_0x3c67('0x33')]['sort']);_0xe3b037['where']=qs[_0x3c67('0x39')](_[_0x3c67('0x9b')](_0x2dc92f[_0x3c67('0x33')],_0xe32a8a['filters']));_0xe3b037['where']['ChatInteractionId']=_0x3b8c5f['id'];if(_0x2dc92f[_0x3c67('0x33')]['filter']){_0xe3b037[_0x3c67('0x9c')]=_[_0x3c67('0x28')](_0xe3b037[_0x3c67('0x9c')],{'$or':_['map'](_0xe3b037[_0x3c67('0x3b')],function(_0x6e1939){var _0x3eac02={};_0x3eac02[_0x6e1939]={'$like':'%'+_0x2dc92f['query']['filter']+'%'};return _0x3eac02;})});}_0xe3b037['where']['secret']=![];if(_0x2dc92f[_0x3c67('0x33')]['id']){_0xe3b037[_0x3c67('0x9c')]['id']={'$gt':_0x2dc92f[_0x3c67('0x33')]['id']};}_0xe3b037=_['merge']({},_0xe3b037,_0x2dc92f[_0x3c67('0xa0')]);return db['ChatMessage']['count']({'where':_0xe3b037['where']})[_0x3c67('0x15')](function(_0x3baa9c){_0x518169[_0x3c67('0x21')]=_0x3baa9c;_0xe3b037[_0x3c67('0x3e')]=[];if(_0x2dc92f[_0x3c67('0x33')][_0x3c67('0xa3')]){_0xe3b037[_0x3c67('0x3e')]['push']({'model':db[_0x3c67('0x74')],'as':'User','attributes':['id','fullname',_0x3c67('0xa4')]});}if(_0x2dc92f[_0x3c67('0x33')][_0x3c67('0x3d')]){_0xe3b037[_0x3c67('0x3e')]=[{'all':!![]}];}return db['ChatMessage'][_0x3c67('0x31')](_0xe3b037);})[_0x3c67('0x15')](function(_0x5bc87d){_0x518169[_0x3c67('0xa1')]=_0x5bc87d;return _0x518169;});}})[_0x3c67('0x15')](respondWithFilteredResult(_0x49b8ed,_0xe3b037))['catch'](handleError(_0x49b8ed,null));};exports[_0x3c67('0xa5')]=function(_0x3ebd3a,_0x5bf022){return db[_0x3c67('0x2e')][_0x3c67('0x3f')]({'where':{'id':_0x3ebd3a[_0x3c67('0x36')]['id']}})[_0x3c67('0x15')](handleEntityNotFound(_0x5bf022,null))[_0x3c67('0x15')](function(_0x77eec2){if(_0x77eec2){return _0x77eec2[_0x3c67('0xa6')](_0x3ebd3a[_0x3c67('0x29')][_0x3c67('0x92')],_[_0x3c67('0x93')](_0x3ebd3a[_0x3c67('0x29')],[_0x3c67('0x92'),'id'])||{})[_0x3c67('0xa7')](function(){return db['Tag'][_0x3c67('0x31')]({'attributes':['id',_0x3c67('0x26'),_0x3c67('0xa8')],'where':{'id':_0x3ebd3a['body'][_0x3c67('0x92')]}});})[_0x3c67('0x15')](function(_0x11c35c){socket[_0x3c67('0xa9')]('chatInteractionTags:save',{'id':Number(_0x3ebd3a['params']['id']),'tags':_0x11c35c||[]});return{'id':Number(_0x3ebd3a[_0x3c67('0x36')]['id']),'tags':_0x11c35c||[]};});}})['then'](respondWithResult(_0x5bf022,null))['catch'](handleError(_0x5bf022,null));};exports[_0x3c67('0xaa')]=function(_0xe144f9,_0x587bef){return db[_0x3c67('0x2e')][_0x3c67('0x3f')]({'where':{'id':_0xe144f9[_0x3c67('0x36')]['id']}})[_0x3c67('0x15')](handleEntityNotFound(_0x587bef,null))['then'](function(_0x9304cd){if(_0x9304cd){return _0x9304cd['removeTags'](_0xe144f9[_0x3c67('0x33')][_0x3c67('0x92')]);}})[_0x3c67('0x15')](respondWithStatusCode(_0x587bef,null))['catch'](handleError(_0x587bef,null));};exports[_0x3c67('0xab')]=function(_0x252f9d,_0x5be9e7){var _0x83a96d=moment()[_0x3c67('0xac')]()[_0x3c67('0xad')]();var _0x5827fe=path[_0x3c67('0x6b')](config[_0x3c67('0x6c')],_0x3c67('0xae'),_0x3c67('0xaf'),'tmp');var _0x1eb719=path['join'](config[_0x3c67('0x6c')],_0x3c67('0xae'),_0x3c67('0xaf'),_0x3c67('0xb0'));var _0x1b16dc=path[_0x3c67('0x6b')](_0x5827fe,_0x83a96d);var _0xdee6fa=util[_0x3c67('0x77')](_0x3c67('0xb1'),_0x252f9d[_0x3c67('0x36')]['id'],_0x83a96d);var _0x4ab6b1=path[_0x3c67('0x6b')](_0x5827fe,_0xdee6fa);var _0x396aff=[];_0x396aff['push']({'model':db[_0x3c67('0x74')],'as':'User','attributes':['id',_0x3c67('0x80')],'raw':!![]});_0x396aff[_0x3c67('0xb2')]({'model':db[_0x3c67('0x5a')],'as':_0x3c67('0x5b'),'attributes':['id','firstName',_0x3c67('0xb3')],'raw':!![]});if(_0x252f9d[_0x3c67('0x33')]['attachments']){_0x396aff[_0x3c67('0xb2')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x49ef57=[{'model':db[_0x3c67('0x91')],'as':_0x3c67('0xb4'),'attributes':['id','body',_0x3c67('0x83'),'direction','secret',_0x3c67('0xb5')],'include':_0x396aff}];_0x49ef57[_0x3c67('0xb2')]({'model':db[_0x3c67('0xb6')],'as':_0x3c67('0xb7'),'attributes':['id',_0x3c67('0x26')]});_0x49ef57[_0x3c67('0xb2')]({'model':db[_0x3c67('0x74')],'as':_0x3c67('0xb8'),'attributes':['id',_0x3c67('0x80')]});return db[_0x3c67('0x2e')][_0x3c67('0x3f')]({'where':{'id':_0x252f9d[_0x3c67('0x36')]['id']},'include':_0x49ef57})[_0x3c67('0x15')](handleEntityNotFound(_0x5be9e7,null))[_0x3c67('0x15')](function(_0x286b02){if(_0x286b02){var _0x3e8580=_0x286b02[_0x3c67('0xb9')]({'plain':!![]});fs[_0x3c67('0xba')](_0x1b16dc);var _0x2058f4={'channel':_0x3c67('0xbb'),'account':_0x3e8580[_0x3c67('0xb7')][_0x3c67('0x26')],'agent':_0x3e8580[_0x3c67('0xb8')]?_0x3e8580['Owner']['fullname']:_0x3c67('0xbc'),'createdAt':moment(_0x3e8580[_0x3c67('0x83')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3c67('0xad')](),'closedAt':_0x3e8580[_0x3c67('0x68')]?moment(_0x3e8580[_0x3c67('0xbd')])[_0x3c67('0x77')](_0x3c67('0xbe'))[_0x3c67('0xad')]():'','disposition':_0x3e8580[_0x3c67('0x61')],'chatInfo':{'browser':_0x3e8580['browserName'],'os':_0x3e8580[_0x3c67('0xbf')],'referer':_0x3e8580[_0x3c67('0xc0')],'customerIp':_0x3e8580[_0x3c67('0xc1')],'customerPort':_0x3e8580[_0x3c67('0xc2')]?_0x3e8580[_0x3c67('0xc2')]:_0x3c67('0xbc')},'messages':_(_0x3e8580['Messages'])[_0x3c67('0xc3')]()[_0x3c67('0x9d')]({'secret':![]})[_0x3c67('0x2d')](function(_0x292b39){if(_0x292b39['Attachment']){var _0x55a9a7=path[_0x3c67('0x6b')](_0x1eb719,_0x292b39[_0x3c67('0xc4')][_0x3c67('0x6f')]);if(fs['existsSync'](_0x55a9a7)){fs['createReadStream'](_0x55a9a7)[_0x3c67('0xc5')](fs['createWriteStream'](path[_0x3c67('0x6b')](_0x1b16dc,_0x292b39[_0x3c67('0xc4')][_0x3c67('0x6f')])));}}return{'date':moment(_0x292b39[_0x3c67('0x83')])['format'](_0x3c67('0xbe'))[_0x3c67('0xad')](),'sender':_0x292b39[_0x3c67('0x85')]==='out'?_0x292b39[_0x3c67('0x74')]?_0x292b39[_0x3c67('0x74')]['fullname']:_0x3c67('0x79'):_0x292b39[_0x3c67('0x5b')][_0x3c67('0xc6')]+(_0x292b39[_0x3c67('0x5b')][_0x3c67('0xb3')]?'\x20'+_0x292b39[_0x3c67('0x5b')]['lastName']:''),'body':_0x292b39[_0x3c67('0xc4')]?_0x292b39[_0x3c67('0xc4')][_0x3c67('0x6f')]:_0x292b39[_0x3c67('0x29')],'direction':_0x292b39[_0x3c67('0x85')]===_0x3c67('0x57')?'A':'C','secret':_0x292b39[_0x3c67('0x86')],'read':_0x292b39[_0x3c67('0xb5')],'attachment':_0x292b39['Attachment']};})[_0x3c67('0xc7')]()};return ejs[_0x3c67('0xc8')](path[_0x3c67('0x6b')](config['root'],_0x3c67('0xae'),_0x3c67('0xc9'),_0x3c67('0xca')),{'interaction':_0x2058f4})[_0x3c67('0x15')](function(_0x43e6b6){var _0x40a2a4=path['join'](_0x1b16dc,_0x3c67('0xcb')+_0x3e8580['id']+'-'+_0x83a96d+_0x3c67('0xcc'));var _0x270c94={'path':_0x40a2a4,'channel':_0x3c67('0xbb'),'interactionId':_0x3e8580['id']};return pdf[_0x3c67('0xcd')](_0x43e6b6,_0x270c94);})[_0x3c67('0x15')](function(){return new Promise(function(_0x1f404e,_0x1021f9){zipdir(_0x1b16dc,{'saveTo':_0x4ab6b1},function(_0x41ec16,_0x2cdb11){if(_0x41ec16)return _0x1021f9(_0x41ec16);return _0x1f404e(_0x2cdb11);});})[_0x3c67('0x15')](function(){return new BPromise(function(_0x1bd55b,_0x165301){rimraf(_0x1b16dc,function(_0x8c630){if(_0x8c630)_0x165301(_0x8c630);return _0x1bd55b();});});})[_0x3c67('0x15')](function(){return _0x5be9e7[_0x3c67('0xab')](_0x4ab6b1,_0xdee6fa,function(_0x2e21e6){if(_0x2e21e6){logger[_0x3c67('0x18')](_0x3c67('0xce'),_0x2e21e6);}else{fs[_0x3c67('0xcf')](_0x4ab6b1);}});});});}else{return _0x5be9e7[_0x3c67('0x5f')](0xc8);}})['catch'](handleError(_0x5be9e7,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index fd890f7..9902ee2 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 _0x6a14=['events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hook'];(function(_0x469760,_0x30d72b){var _0x4e23fb=function(_0x3dccdb){while(--_0x3dccdb){_0x469760['push'](_0x469760['shift']());}};_0x4e23fb(++_0x30d72b);}(_0x6a14,0x130));var _0x46a1=function(_0x27dcb2,_0xc726a1){_0x27dcb2=_0x27dcb2-0x0;var _0x4bf6e4=_0x6a14[_0x27dcb2];return _0x4bf6e4;};'use strict';var EventEmitter=require(_0x46a1('0x0'));var ChatInteraction=require(_0x46a1('0x1'))['db'][_0x46a1('0x2')];var ChatMessage=require(_0x46a1('0x1'))['db'][_0x46a1('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x46a1('0x4')](0x0);var events={'afterCreate':_0x46a1('0x5'),'afterUpdate':_0x46a1('0x6'),'afterDestroy':_0x46a1('0x7')};function emitEvent(_0x16ca90){return function(_0x27fa19,_0x58baa9,_0x577a5e){_0x27fa19[_0x46a1('0x8')]({'attributes':['id'],'raw':!![]})[_0x46a1('0x9')](function(_0x25ba94){_0x27fa19['setDataValue'](_0x46a1('0xa'),_0x25ba94[_0x46a1('0xb')](function(_0x48f4db){return{'id':_0x48f4db['id']};}));return ChatMessage[_0x46a1('0xc')]({'where':{'ChatInteractionId':_0x27fa19['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46a1('0x9')](function(_0x4bf137){_0x27fa19[_0x46a1('0xd')](_0x46a1('0xe'),_0x4bf137[_0x46a1('0xf')]);ChatInteractionEvents[_0x46a1('0x10')](_0x16ca90+':'+_0x27fa19['id'],_0x27fa19);ChatInteractionEvents[_0x46a1('0x10')](_0x16ca90,_0x27fa19);_0x577a5e(null);})[_0x46a1('0x11')](_0x577a5e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x46a1('0x12')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x333e=['events','../../mysqldb','ChatInteraction','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x4f2a6e,_0xd0be01){var _0x49ebfe=function(_0x3fdb9c){while(--_0x3fdb9c){_0x4f2a6e['push'](_0x4f2a6e['shift']());}};_0x49ebfe(++_0xd0be01);}(_0x333e,0xb0));var _0xe333=function(_0x2331f8,_0x446a3a){_0x2331f8=_0x2331f8-0x0;var _0x244773=_0x333e[_0x2331f8];return _0x244773;};'use strict';var EventEmitter=require(_0xe333('0x0'));var ChatInteraction=require(_0xe333('0x1'))['db'][_0xe333('0x2')];var ChatMessage=require(_0xe333('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe333('0x3'),'afterDestroy':_0xe333('0x4')};function emitEvent(_0x18eb3c){return function(_0x43f99b,_0x5934db,_0x10bce5){_0x43f99b[_0xe333('0x5')]({'attributes':['id'],'raw':!![]})[_0xe333('0x6')](function(_0x5f4413){_0x43f99b[_0xe333('0x7')]('Users',_0x5f4413[_0xe333('0x8')](function(_0x368536){return{'id':_0x368536['id']};}));return ChatMessage[_0xe333('0x9')]({'where':{'ChatInteractionId':_0x43f99b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe333('0x6')](function(_0x4908fb){_0x43f99b[_0xe333('0x7')](_0xe333('0xa'),_0x4908fb['length']);ChatInteractionEvents[_0xe333('0xb')](_0x18eb3c+':'+_0x43f99b['id'],_0x43f99b);ChatInteractionEvents[_0xe333('0xb')](_0x18eb3c,_0x43f99b);_0x10bce5(null);})[_0xe333('0xc')](_0x10bce5(null));};}for(var e in events){if(events[_0xe333('0xd')](e)){var event=events[e];ChatInteraction[_0xe333('0xe')](e,emitEvent(event));}}module[_0xe333('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index a3ec8b7..a68ac50 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 _0x59d0=['bluebird','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt','utf8mb4','lodash','util','api','moment'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x59d0,0xce));var _0x059d=function(_0x3f9415,_0x998a93){_0x3f9415=_0x3f9415-0x0;var _0x5dbdf6=_0x59d0[_0x3f9415];return _0x5dbdf6;};'use strict';var _=require(_0x059d('0x0'));var util=require(_0x059d('0x1'));var logger=require('../../config/logger')(_0x059d('0x2'));var moment=require(_0x059d('0x3'));var BPromise=require(_0x059d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x059d('0x5'));var config=require(_0x059d('0x6'));var attributes=require(_0x059d('0x7'));module['exports']=function(_0x4b93d2,_0x3abc28){return _0x4b93d2[_0x059d('0x8')](_0x059d('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xece9aa,_0x51faf2,_0x17fa36){if(_0xece9aa[_0x059d('0xa')](_0x059d('0xb'))){_0xece9aa[_0x059d('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x17fa36(null,_0xece9aa);}},'charset':_0x059d('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xeef6=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0xeef6,0xc3));var _0x6eef=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xeef6[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x6eef('0x0'));var logger=require('../../config/logger')(_0x6eef('0x1'));var moment=require(_0x6eef('0x2'));var BPromise=require(_0x6eef('0x3'));var rp=require(_0x6eef('0x4'));var fs=require('fs');var path=require(_0x6eef('0x5'));var rimraf=require(_0x6eef('0x6'));var config=require(_0x6eef('0x7'));var attributes=require(_0x6eef('0x8'));module[_0x6eef('0x9')]=function(_0x23dc2e,_0x23becb){return _0x23dc2e[_0x6eef('0xa')](_0x6eef('0xb'),attributes,{'tableName':_0x6eef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4dab95,_0x1b0926,_0x32015e){if(_0x4dab95[_0x6eef('0xd')](_0x6eef('0xe'))){_0x4dab95['closedAt']=moment()[_0x6eef('0xf')](_0x6eef('0x10'));}_0x32015e(null,_0x4dab95);}},'charset':_0x6eef('0x11'),'collate':_0x6eef('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e6347bc..5b1a0d2 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 _0x377e=['message','result','catch','UpdateChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x22ccd2,_0x32d6fc){var _0x128adc=function(_0x934036){while(--_0x934036){_0x22ccd2['push'](_0x22ccd2['shift']());}};_0x128adc(++_0x32d6fc);}(_0x377e,0x1aa));var _0xe377=function(_0x34421e,_0xf309a2){_0x34421e=_0x34421e-0x0;var _0x5725d7=_0x377e[_0x34421e];return _0x5725d7;};'use strict';var _=require(_0xe377('0x0'));var util=require(_0xe377('0x1'));var moment=require(_0xe377('0x2'));var BPromise=require(_0xe377('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe377('0x4'));var db=require(_0xe377('0x5'))['db'];var utils=require(_0xe377('0x6'));var logger=require(_0xe377('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe377('0x8'));var client=jayson[_0xe377('0x9')][_0xe377('0xa')]({'port':0x232a});config[_0xe377('0xb')]=_[_0xe377('0xc')](config[_0xe377('0xb')],{'host':_0xe377('0xd'),'port':0x18eb});var socket=require(_0xe377('0xe'))(new Redis(config[_0xe377('0xb')]));require(_0xe377('0xf'))['register'](socket);function respondWithRpcPromise(_0x218ccb,_0x163914,_0x1e6bd1){return new BPromise(function(_0x2fb5af,_0x369cff){return client[_0xe377('0x10')](_0x218ccb,_0x1e6bd1)[_0xe377('0x11')](function(_0x42c5c0){logger[_0xe377('0x12')](_0xe377('0x13'),_0x163914,_0xe377('0x14'));logger[_0xe377('0x15')](_0xe377('0x16'),_0x163914,_0xe377('0x14'),JSON[_0xe377('0x17')](_0x42c5c0));if(_0x42c5c0[_0xe377('0x18')]){if(_0x42c5c0[_0xe377('0x18')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x163914,_0x42c5c0[_0xe377('0x18')]['message']);return _0x369cff(_0x42c5c0[_0xe377('0x18')]['message']);}logger[_0xe377('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x163914,_0x42c5c0[_0xe377('0x18')][_0xe377('0x19')]);return _0x2fb5af(_0x42c5c0[_0xe377('0x18')][_0xe377('0x19')]);}else{logger[_0xe377('0x12')](_0xe377('0x13'),_0x163914,'request\x20sent');_0x2fb5af(_0x42c5c0[_0xe377('0x1a')][_0xe377('0x19')]);}})[_0xe377('0x1b')](function(_0x259b60){logger[_0xe377('0x18')](_0xe377('0x13'),_0x163914,_0x259b60);_0x369cff(_0x259b60);});});}exports[_0xe377('0x1c')]=function(_0x261abe){var _0x501b2a=this;return new Promise(function(_0x20db33,_0x564152){return db['ChatInteraction'][_0xe377('0x1d')](_0x261abe[_0xe377('0x1e')],{'raw':_0x261abe[_0xe377('0x1f')]?_0x261abe[_0xe377('0x1f')][_0xe377('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x261abe[_0xe377('0x1f')]?_0x261abe[_0xe377('0x1f')][_0xe377('0x21')]||null:null,'attributes':_0x261abe[_0xe377('0x1f')]?_0x261abe['options']['attributes']||null:null,'limit':_0x261abe['options']?_0x261abe[_0xe377('0x1f')][_0xe377('0x22')]||null:null})['then'](function(_0x4e10d1){logger[_0xe377('0x12')](_0xe377('0x1c'),_0x261abe);logger[_0xe377('0x15')](_0xe377('0x1c'),_0x261abe,JSON['stringify'](_0x4e10d1));_0x20db33(_0x4e10d1);})[_0xe377('0x1b')](function(_0x146a9e){logger[_0xe377('0x18')](_0xe377('0x1c'),_0x146a9e[_0xe377('0x19')],_0x261abe);_0x564152(_0x501b2a['error'](0x1f4,_0x146a9e[_0xe377('0x19')]));});});};exports[_0xe377('0x23')]=function(_0x4cc39f){return new Promise(function(_0x3a7396,_0x45bd06){return db['ChatInteraction'][_0xe377('0x24')]({'where':_0x4cc39f[_0xe377('0x1f')]?_0x4cc39f[_0xe377('0x1f')][_0xe377('0x21')]||null:null})[_0xe377('0x11')](function(_0x4fef91){if(_0x4fef91){return _0x4fef91[_0xe377('0x25')](_0x4cc39f[_0xe377('0x1e')][_0xe377('0x26')],_[_0xe377('0x27')](_0x4cc39f[_0xe377('0x1e')],['ids','id'])||{});}})['spread'](function(_0x44e030){logger[_0xe377('0x12')](_0xe377('0x28'),_0x4cc39f);logger['debug'](_0xe377('0x28'),_0x4cc39f,JSON['stringify'](_0x44e030));_0x3a7396(_0x44e030);})['catch'](function(_0x42deff){logger[_0xe377('0x18')](_0xe377('0x28'),_0x42deff[_0xe377('0x19')],_0x4cc39f);_0x45bd06(_this[_0xe377('0x18')](0x1f4,_0x42deff['message']));});});};
\ No newline at end of file
+var _0x02e6=['code','ChatInteraction,\x20%s,\x20%s','message','catch','ChatInteraction','body','options','limit','then','UpdateChatInteraction','AddTagsToChatInteraction','find','where','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x8e4e90,_0x6d7185){var _0x1d9d2b=function(_0x3a63e7){while(--_0x3a63e7){_0x8e4e90['push'](_0x8e4e90['shift']());}};_0x1d9d2b(++_0x6d7185);}(_0x02e6,0x137));var _0x602e=function(_0x1e7a4d,_0x519ca0){_0x1e7a4d=_0x1e7a4d-0x0;var _0x27b907=_0x02e6[_0x1e7a4d];return _0x27b907;};'use strict';var _=require(_0x602e('0x0'));var util=require(_0x602e('0x1'));var moment=require(_0x602e('0x2'));var BPromise=require(_0x602e('0x3'));var rs=require(_0x602e('0x4'));var fs=require('fs');var Redis=require(_0x602e('0x5'));var db=require(_0x602e('0x6'))['db'];var utils=require(_0x602e('0x7'));var logger=require(_0x602e('0x8'))(_0x602e('0x9'));var config=require(_0x602e('0xa'));var jayson=require(_0x602e('0xb'));var client=jayson[_0x602e('0xc')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x602e('0xd')],{'host':_0x602e('0xe'),'port':0x18eb});var socket=require(_0x602e('0xf'))(new Redis(config[_0x602e('0xd')]));require(_0x602e('0x10'))[_0x602e('0x11')](socket);function respondWithRpcPromise(_0x3b878a,_0x598aa5,_0x3c1a24){return new BPromise(function(_0x414e4e,_0x317ed0){return client[_0x602e('0x12')](_0x3b878a,_0x3c1a24)['then'](function(_0x384cdf){logger[_0x602e('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x598aa5,'request\x20sent');logger[_0x602e('0x14')](_0x602e('0x15'),_0x598aa5,_0x602e('0x16'),JSON[_0x602e('0x17')](_0x384cdf));if(_0x384cdf['error']){if(_0x384cdf[_0x602e('0x18')][_0x602e('0x19')]===0x1f4){logger['error'](_0x602e('0x1a'),_0x598aa5,_0x384cdf['error']['message']);return _0x317ed0(_0x384cdf['error'][_0x602e('0x1b')]);}logger[_0x602e('0x18')](_0x602e('0x1a'),_0x598aa5,_0x384cdf['error'][_0x602e('0x1b')]);return _0x414e4e(_0x384cdf[_0x602e('0x18')][_0x602e('0x1b')]);}else{logger[_0x602e('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x598aa5,'request\x20sent');_0x414e4e(_0x384cdf['result']['message']);}})[_0x602e('0x1c')](function(_0x29d05e){logger['error'](_0x602e('0x1a'),_0x598aa5,_0x29d05e);_0x317ed0(_0x29d05e);});});}exports['UpdateChatInteraction']=function(_0xf1cce6){var _0x2172b6=this;return new Promise(function(_0x16e831,_0x444621){return db[_0x602e('0x1d')]['update'](_0xf1cce6[_0x602e('0x1e')],{'raw':_0xf1cce6[_0x602e('0x1f')]?_0xf1cce6[_0x602e('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf1cce6[_0x602e('0x1f')]?_0xf1cce6[_0x602e('0x1f')]['where']||null:null,'attributes':_0xf1cce6[_0x602e('0x1f')]?_0xf1cce6['options']['attributes']||null:null,'limit':_0xf1cce6['options']?_0xf1cce6[_0x602e('0x1f')][_0x602e('0x20')]||null:null})[_0x602e('0x21')](function(_0x581de1){logger[_0x602e('0x13')](_0x602e('0x22'),_0xf1cce6);logger[_0x602e('0x14')](_0x602e('0x22'),_0xf1cce6,JSON[_0x602e('0x17')](_0x581de1));_0x16e831(_0x581de1);})[_0x602e('0x1c')](function(_0x38112e){logger[_0x602e('0x18')](_0x602e('0x22'),_0x38112e[_0x602e('0x1b')],_0xf1cce6);_0x444621(_0x2172b6[_0x602e('0x18')](0x1f4,_0x38112e[_0x602e('0x1b')]));});});};exports[_0x602e('0x23')]=function(_0x3a21e1){return new Promise(function(_0x1f6888,_0xb1797c){return db[_0x602e('0x1d')][_0x602e('0x24')]({'where':_0x3a21e1[_0x602e('0x1f')]?_0x3a21e1['options'][_0x602e('0x25')]||null:null})['then'](function(_0x3c2b06){if(_0x3c2b06){return _0x3c2b06['addTags'](_0x3a21e1[_0x602e('0x1e')][_0x602e('0x26')],_[_0x602e('0x27')](_0x3a21e1[_0x602e('0x1e')],[_0x602e('0x26'),'id'])||{});}})[_0x602e('0x28')](function(_0x25e84d){logger[_0x602e('0x13')](_0x602e('0x29'),_0x3a21e1);logger['debug'](_0x602e('0x29'),_0x3a21e1,JSON[_0x602e('0x17')](_0x25e84d));_0x1f6888(_0x25e84d);})[_0x602e('0x1c')](function(_0x198c82){logger['error'](_0x602e('0x29'),_0x198c82[_0x602e('0x1b')],_0x3a21e1);_0xb1797c(_this[_0x602e('0x18')](0x1f4,_0x198c82[_0x602e('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b20c00c..0d2376a 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 _0x4b74=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','length'];(function(_0x26e0c5,_0xb24454){var _0x4877e7=function(_0x1ebbef){while(--_0x1ebbef){_0x26e0c5['push'](_0x26e0c5['shift']());}};_0x4877e7(++_0xb24454);}(_0x4b74,0x111));var _0x44b7=function(_0x239c90,_0x169b07){_0x239c90=_0x239c90-0x0;var _0x11cc75=_0x4b74[_0x239c90];return _0x11cc75;};'use strict';var ChatInteractionEvents=require(_0x44b7('0x0'));var events=[_0x44b7('0x1'),_0x44b7('0x2'),_0x44b7('0x3')];function createListener(_0x2f3a50,_0x127a66){return function(_0x3c8eea){_0x127a66[_0x44b7('0x4')](_0x2f3a50,_0x3c8eea);};}function removeListener(_0x290aa9,_0x441b7b){return function(){ChatInteractionEvents[_0x44b7('0x5')](_0x290aa9,_0x441b7b);};}exports['register']=function(_0x497f3b){for(var _0x38aab5=0x0,_0x4d411=events[_0x44b7('0x6')];_0x38aab5<_0x4d411;_0x38aab5++){var _0x3e819b=events[_0x38aab5];var _0x9fc4f0=createListener(_0x44b7('0x7')+_0x3e819b,_0x497f3b);ChatInteractionEvents['on'](_0x3e819b,_0x9fc4f0);}};
\ No newline at end of file
+var _0x04a1=['register','length','remove','emit'];(function(_0x5951b9,_0x52b706){var _0x16623b=function(_0x25af2b){while(--_0x25af2b){_0x5951b9['push'](_0x5951b9['shift']());}};_0x16623b(++_0x52b706);}(_0x04a1,0x126));var _0x104a=function(_0xe228c4,_0x32140a){_0xe228c4=_0xe228c4-0x0;var _0x1730cb=_0x04a1[_0xe228c4];return _0x1730cb;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x104a('0x0'),'update'];function createListener(_0x26a953,_0x2cea38){return function(_0x309b67){_0x2cea38[_0x104a('0x1')](_0x26a953,_0x309b67);};}function removeListener(_0x29585e,_0x5c9514){return function(){ChatInteractionEvents['removeListener'](_0x29585e,_0x5c9514);};}exports[_0x104a('0x2')]=function(_0x3bca10){for(var _0x50707a=0x0,_0x40cd1d=events[_0x104a('0x3')];_0x50707a<_0x40cd1d;_0x50707a++){var _0x315abc=events[_0x50707a];var _0x559357=createListener('chatInteraction:'+_0x315abc,_0x3bca10);ChatInteractionEvents['on'](_0x315abc,_0x559357);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index b32aa54..83b2c0c 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 _0x6514=['exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','diskStorage','join','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags'];(function(_0xf867e9,_0x2e9cbd){var _0xc3d01f=function(_0x89e49e){while(--_0x89e49e){_0xf867e9['push'](_0xf867e9['shift']());}};_0xc3d01f(++_0x2e9cbd);}(_0x6514,0x166));var _0x4651=function(_0x1d5cda,_0x4eda97){_0x1d5cda=_0x1d5cda-0x0;var _0x5cb86b=_0x6514[_0x1d5cda];return _0x5cb86b;};'use strict';var multer=require(_0x4651('0x0'));var util=require('util');var path=require(_0x4651('0x1'));var timeout=require(_0x4651('0x2'));var express=require(_0x4651('0x3'));var router=express[_0x4651('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4651('0x5'));var config=require(_0x4651('0x6'));var controller=require(_0x4651('0x7'));router[_0x4651('0x8')]('/',auth[_0x4651('0x9')](),controller['index']);router[_0x4651('0x8')]('/describe',auth[_0x4651('0x9')](),controller[_0x4651('0xa')]);router[_0x4651('0x8')](_0x4651('0xb'),auth[_0x4651('0xc')](),controller[_0x4651('0xd')]);router[_0x4651('0x8')](_0x4651('0xe'),auth[_0x4651('0xc')](),controller['attachmentDownload']);router[_0x4651('0x8')](_0x4651('0xf'),auth['isAuthenticated'](),controller[_0x4651('0x10')]);router[_0x4651('0x8')](_0x4651('0x11'),auth[_0x4651('0xc')](),controller[_0x4651('0x12')]);router[_0x4651('0x8')]('/:id/download',auth[_0x4651('0x9')](),controller[_0x4651('0x13')]);router[_0x4651('0x14')]('/',auth[_0x4651('0x9')](),controller[_0x4651('0x15')]);router[_0x4651('0x14')]('/:id/vidaoo',auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4651('0x16')]({'destination':function(_0x474413,_0x3ba15e,_0x2fed77){_0x2fed77(null,path[_0x4651('0x17')](config['root'],_0x4651('0x18')));},'filename':function(_0x40dde3,_0xca7103,_0x3120f8){_0x3120f8(null,util[_0x4651('0x19')](_0x4651('0x1a'),Date[_0x4651('0x1b')](),_0xca7103['originalname'][_0x4651('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x4651('0x1d'),upload[_0x4651('0x1e')](_0x4651('0x1f')),controller[_0x4651('0x20')]);router[_0x4651('0x14')](_0x4651('0xf'),auth[_0x4651('0xc')](),controller[_0x4651('0x21')]);router['post']('/:id/tags',auth[_0x4651('0x9')](),interaction[_0x4651('0x22')]('chat',_0x4651('0x23')),controller[_0x4651('0x24')]);router[_0x4651('0x25')]('/:id',auth[_0x4651('0x9')](),interaction['tracked'](_0x4651('0x26'),_0x4651('0x27')),controller[_0x4651('0x28')]);router['put'](_0x4651('0x29'),controller[_0x4651('0x2a')]);router[_0x4651('0x25')]('/:id/abandon',auth[_0x4651('0xc')](),controller['abandon']);router[_0x4651('0x25')](_0x4651('0x2b'),controller[_0x4651('0x2c')]);router[_0x4651('0x2d')]('/:id',auth[_0x4651('0x9')](),interaction['tracked'](_0x4651('0x26'),_0x4651('0x2e')),controller[_0x4651('0x2f')]);router[_0x4651('0x2d')](_0x4651('0x30'),auth['isAuthenticated'](),controller[_0x4651('0x31')]);module[_0x4651('0x32')]=router;
\ No newline at end of file
+var _0x23a9=['removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','destroy','delete'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x23a9,0x1cd));var _0x923a=function(_0x3ec3a6,_0x10cb7f){_0x3ec3a6=_0x3ec3a6-0x0;var _0x4ce546=_0x23a9[_0x3ec3a6];return _0x4ce546;};'use strict';var multer=require(_0x923a('0x0'));var util=require(_0x923a('0x1'));var path=require(_0x923a('0x2'));var timeout=require(_0x923a('0x3'));var express=require('express');var router=express[_0x923a('0x4')]();var fs_extra=require(_0x923a('0x5'));var auth=require(_0x923a('0x6'));var interaction=require(_0x923a('0x7'));var config=require(_0x923a('0x8'));var controller=require(_0x923a('0x9'));router[_0x923a('0xa')]('/',auth[_0x923a('0xb')](),controller['index']);router[_0x923a('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x923a('0xc')]);router[_0x923a('0xa')](_0x923a('0xd'),auth[_0x923a('0xe')](),controller[_0x923a('0xf')]);router['get'](_0x923a('0x10'),auth[_0x923a('0xe')](),controller[_0x923a('0x11')]);router[_0x923a('0xa')](_0x923a('0x12'),auth[_0x923a('0xb')](),controller['getMessages']);router[_0x923a('0xa')]('/:id/my_messages',auth[_0x923a('0xe')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x923a('0xb')](),controller[_0x923a('0x13')]);router[_0x923a('0x14')]('/',auth['isAuthenticated'](),controller[_0x923a('0x15')]);router[_0x923a('0x14')](_0x923a('0x16'),auth[_0x923a('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x923a('0x17')]({'destination':function(_0x9fbd35,_0x5f44e2,_0x3dc505){_0x3dc505(null,path[_0x923a('0x18')](config[_0x923a('0x19')],_0x923a('0x1a')));},'filename':function(_0x1b27c4,_0x236a1b,_0xb53525){_0xb53525(null,util['format'](_0x923a('0x1b'),Date[_0x923a('0x1c')](),_0x236a1b['originalname'][_0x923a('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x923a('0x14')](_0x923a('0x1e'),upload[_0x923a('0x1f')](_0x923a('0x20')),controller[_0x923a('0x21')]);router[_0x923a('0x14')](_0x923a('0x12'),auth[_0x923a('0xe')](),controller[_0x923a('0x22')]);router[_0x923a('0x14')](_0x923a('0x23'),auth[_0x923a('0xb')](),interaction[_0x923a('0x24')](_0x923a('0x25'),_0x923a('0x26')),controller[_0x923a('0x27')]);router[_0x923a('0x28')](_0x923a('0xd'),auth[_0x923a('0xb')](),interaction[_0x923a('0x24')](_0x923a('0x25'),'chatinteraction:update'),controller[_0x923a('0x29')]);router['put'](_0x923a('0x2a'),controller[_0x923a('0x2b')]);router[_0x923a('0x28')](_0x923a('0x2c'),auth[_0x923a('0xe')](),controller[_0x923a('0x2d')]);router[_0x923a('0x28')]('/:id/close',controller[_0x923a('0x2e')]);router['delete'](_0x923a('0xd'),auth[_0x923a('0xb')](),interaction['tracked'](_0x923a('0x25'),'chatinteraction:destroy'),controller[_0x923a('0x2f')]);router[_0x923a('0x30')](_0x923a('0x23'),auth[_0x923a('0xb')](),controller[_0x923a('0x31')]);module[_0x923a('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 063bcb7..8281631 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 _0x1f70=['sequelize','TEXT'];(function(_0x5c44b6,_0x5f04da){var _0x318163=function(_0x2a3745){while(--_0x2a3745){_0x5c44b6['push'](_0x5c44b6['shift']());}};_0x318163(++_0x5f04da);}(_0x1f70,0x13e));var _0x01f7=function(_0x48cfbe,_0x4fc6eb){_0x48cfbe=_0x48cfbe-0x0;var _0x1f0ffc=_0x1f70[_0x48cfbe];return _0x1f0ffc;};'use strict';var Sequelize=require(_0x01f7('0x0'));module['exports']={'body':{'type':Sequelize[_0x01f7('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x449c=['sequelize','exports','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x449c,0x88));var _0xc449=function(_0x1e96d8,_0x2a4400){_0x1e96d8=_0x1e96d8-0x0;var _0x4139e9=_0x449c[_0x1e96d8];return _0x4139e9;};'use strict';var Sequelize=require(_0xc449('0x0'));module[_0xc449('0x1')]={'body':{'type':Sequelize[_0xc449('0x2')](_0xc449('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index c7c1272..508aed9 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 _0x7be3=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','agent','push','FromId','ToId','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./chatInternalMessage.socket','register','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','destroy','then','end','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','map','keys','filters','intersection','model','fields','attributes','hasOwnProperty','query','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','length','find','create','update','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','getUsers','User','findAll','admin','fullname','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user'];(function(_0x14ad4a,_0x4f35cc){var _0x348e81=function(_0x2d103f){while(--_0x2d103f){_0x14ad4a['push'](_0x14ad4a['shift']());}};_0x348e81(++_0x4f35cc);}(_0x7be3,0x75));var _0x37be=function(_0x22aabe,_0x1667d4){_0x22aabe=_0x22aabe-0x0;var _0x7ae05=_0x7be3[_0x22aabe];return _0x7ae05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37be('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x37be('0x1'));var moment=require('moment');var BPromise=require(_0x37be('0x2'));var Mustache=require('mustache');var util=require(_0x37be('0x3'));var path=require(_0x37be('0x4'));var sox=require(_0x37be('0x5'));var csv=require(_0x37be('0x6'));var ejs=require(_0x37be('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37be('0x8'));var squel=require(_0x37be('0x9'));var crypto=require(_0x37be('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x37be('0xb'));var toCsv=require(_0x37be('0x6'));var querystring=require(_0x37be('0xc'));var Papa=require(_0x37be('0xd'));var Redis=require(_0x37be('0xe'));var authService=require(_0x37be('0xf'));var qs=require(_0x37be('0x10'));var as=require(_0x37be('0x11'));var hardwareService=require(_0x37be('0x12'));var logger=require('../../config/logger')(_0x37be('0x13'));var utils=require(_0x37be('0x14'));var config=require(_0x37be('0x15'));var licenseUtil=require(_0x37be('0x16'));var db=require(_0x37be('0x17'))['db'];config['redis']=_[_0x37be('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37be('0x19')]));require(_0x37be('0x1a'))[_0x37be('0x1b')](socket);function respondWithStatusCode(_0x5ac5f7,_0x2fd3f5){_0x2fd3f5=_0x2fd3f5||0xcc;return function(_0x213976){if(_0x213976){return _0x5ac5f7['sendStatus'](_0x2fd3f5);}return _0x5ac5f7[_0x37be('0x1c')](_0x2fd3f5)['end']();};}function respondWithResult(_0x3d687b,_0x368764){_0x368764=_0x368764||0xc8;return function(_0x15bd37){if(_0x15bd37){return _0x3d687b[_0x37be('0x1c')](_0x368764)['json'](_0x15bd37);}};}function respondWithFilteredResult(_0x5d2b7f,_0x26483b){return function(_0xdc37a2){if(_0xdc37a2){var _0x53c692=typeof _0x26483b[_0x37be('0x1d')]===_0x37be('0x1e')&&typeof _0x26483b[_0x37be('0x1f')]==='undefined';var _0x3b5f49=_0xdc37a2['count'];var _0x11aa17=_0x53c692?0x0:_0x26483b[_0x37be('0x1d')];var _0x55f580=_0x53c692?_0xdc37a2['count']:_0x26483b[_0x37be('0x1d')]+_0x26483b['limit'];var _0x56a579;if(_0x55f580>=_0x3b5f49){_0x55f580=_0x3b5f49;_0x56a579=0xc8;}else{_0x56a579=0xce;}_0x5d2b7f[_0x37be('0x1c')](_0x56a579);return _0x5d2b7f[_0x37be('0x20')](_0x37be('0x21'),_0x11aa17+'-'+_0x55f580+'/'+_0x3b5f49)[_0x37be('0x22')](_0xdc37a2);}return null;};}function patchUpdates(_0x2eaa7a){return function(_0x4047ed){try{jsonpatch[_0x37be('0x23')](_0x4047ed,_0x2eaa7a,!![]);}catch(_0x45c756){return BPromise[_0x37be('0x24')](_0x45c756);}return _0x4047ed[_0x37be('0x25')]();};}function saveUpdates(_0x59d9af,_0x55a8ee){return function(_0x4dc257){if(_0x4dc257){return _0x4dc257['update'](_0x59d9af)['then'](function(_0x4fcf79){return _0x4fcf79;});}return null;};}function removeEntity(_0x279138,_0x1427e8){return function(_0x42e6de){if(_0x42e6de){return _0x42e6de[_0x37be('0x26')]()[_0x37be('0x27')](function(){_0x279138[_0x37be('0x1c')](0xcc)[_0x37be('0x28')]();});}};}function handleEntityNotFound(_0x325b94,_0x5e6255){return function(_0x164d98){if(!_0x164d98){_0x325b94['sendStatus'](0x194);}return _0x164d98;};}function handleError(_0x30960a,_0x5970ae){_0x5970ae=_0x5970ae||0x1f4;return function(_0x3d4596){logger[_0x37be('0x29')](_0x3d4596[_0x37be('0x2a')]);if(_0x3d4596[_0x37be('0x2b')]){delete _0x3d4596['name'];}_0x30960a[_0x37be('0x1c')](_0x5970ae)[_0x37be('0x2c')](_0x3d4596);};}exports[_0x37be('0x2d')]=function(_0x28e12c,_0x126973){var _0x33e685={},_0x1e7e14={},_0x2f8919={'count':0x0,'rows':[]};var _0x553746=_['map'](db[_0x37be('0x2e')][_0x37be('0x2f')],function(_0x1b9539){return{'name':_0x1b9539[_0x37be('0x30')],'type':_0x1b9539[_0x37be('0x31')]['key']};});_0x1e7e14['model']=_[_0x37be('0x32')](_0x553746,'name');_0x1e7e14['query']=_[_0x37be('0x33')](_0x28e12c['query']);_0x1e7e14[_0x37be('0x34')]=_[_0x37be('0x35')](_0x1e7e14[_0x37be('0x36')],_0x1e7e14['query']);_0x33e685['attributes']=_[_0x37be('0x35')](_0x1e7e14[_0x37be('0x36')],qs[_0x37be('0x37')](_0x28e12c['query']['fields']));_0x33e685[_0x37be('0x38')]=_0x33e685['attributes']['length']?_0x33e685[_0x37be('0x38')]:_0x1e7e14[_0x37be('0x36')];if(!_0x28e12c['query'][_0x37be('0x39')]('nolimit')){_0x33e685[_0x37be('0x1f')]=qs[_0x37be('0x1f')](_0x28e12c[_0x37be('0x3a')][_0x37be('0x1f')]);_0x33e685[_0x37be('0x1d')]=qs[_0x37be('0x1d')](_0x28e12c[_0x37be('0x3a')][_0x37be('0x1d')]);}_0x33e685['order']=qs[_0x37be('0x3b')](_0x28e12c[_0x37be('0x3a')][_0x37be('0x3b')]);_0x33e685[_0x37be('0x3c')]=qs[_0x37be('0x34')](_[_0x37be('0x3d')](_0x28e12c[_0x37be('0x3a')],_0x1e7e14['filters']),_0x553746);if(_0x28e12c['query']['filter']){_0x33e685[_0x37be('0x3c')]=_[_0x37be('0x3e')](_0x33e685['where'],{'$or':_[_0x37be('0x32')](_0x553746,function(_0x4cab45){if(_0x4cab45[_0x37be('0x31')]!==_0x37be('0x3f')){var _0x25ceb9={};_0x25ceb9[_0x4cab45['name']]={'$like':'%'+_0x28e12c['query'][_0x37be('0x40')]+'%'};return _0x25ceb9;}})});}_0x33e685=_[_0x37be('0x3e')]({},_0x33e685,_0x28e12c[_0x37be('0x41')]);var _0x4f5be2={'where':_0x33e685[_0x37be('0x3c')]};return db[_0x37be('0x2e')]['count'](_0x4f5be2)[_0x37be('0x27')](function(_0x12081b){_0x2f8919[_0x37be('0x42')]=_0x12081b;if(_0x28e12c['query'][_0x37be('0x43')]){_0x33e685[_0x37be('0x44')]=[{'all':!![]}];}return db[_0x37be('0x2e')]['findAll'](_0x33e685);})[_0x37be('0x27')](function(_0x529edf){_0x2f8919[_0x37be('0x45')]=_0x529edf;return _0x2f8919;})[_0x37be('0x27')](respondWithFilteredResult(_0x126973,_0x33e685))[_0x37be('0x46')](handleError(_0x126973,null));};exports[_0x37be('0x47')]=function(_0xb2b4bd,_0x12de65){var _0x55df10={'raw':!![],'where':{'id':_0xb2b4bd['params']['id']}},_0x55b347={};_0x55b347[_0x37be('0x36')]=_[_0x37be('0x33')](db[_0x37be('0x2e')][_0x37be('0x2f')]);_0x55b347[_0x37be('0x3a')]=_['keys'](_0xb2b4bd[_0x37be('0x3a')]);_0x55b347['filters']=_['intersection'](_0x55b347['model'],_0x55b347[_0x37be('0x3a')]);_0x55df10[_0x37be('0x38')]=_[_0x37be('0x35')](_0x55b347[_0x37be('0x36')],qs[_0x37be('0x37')](_0xb2b4bd[_0x37be('0x3a')][_0x37be('0x37')]));_0x55df10[_0x37be('0x38')]=_0x55df10['attributes'][_0x37be('0x48')]?_0x55df10['attributes']:_0x55b347[_0x37be('0x36')];if(_0xb2b4bd['query'][_0x37be('0x43')]){_0x55df10[_0x37be('0x44')]=[{'all':!![]}];}_0x55df10=_[_0x37be('0x3e')]({},_0x55df10,_0xb2b4bd[_0x37be('0x41')]);return db['ChatInternalMessage'][_0x37be('0x49')](_0x55df10)[_0x37be('0x27')](handleEntityNotFound(_0x12de65,null))[_0x37be('0x27')](respondWithResult(_0x12de65,null))[_0x37be('0x46')](handleError(_0x12de65,null));};exports[_0x37be('0x4a')]=function(_0x19fb1b,_0x2b1fbc){return db[_0x37be('0x2e')][_0x37be('0x4a')](_0x19fb1b['body'],{})[_0x37be('0x27')](respondWithResult(_0x2b1fbc,0xc9))[_0x37be('0x46')](handleError(_0x2b1fbc,null));};exports[_0x37be('0x4b')]=function(_0x45a4d8,_0x19fb23){if(_0x45a4d8[_0x37be('0x4c')]['id']){delete _0x45a4d8['body']['id'];}return db['ChatInternalMessage'][_0x37be('0x49')]({'where':{'id':_0x45a4d8['params']['id']}})['then'](handleEntityNotFound(_0x19fb23,null))['then'](saveUpdates(_0x45a4d8[_0x37be('0x4c')],null))['then'](respondWithResult(_0x19fb23,null))[_0x37be('0x46')](handleError(_0x19fb23,null));};exports[_0x37be('0x26')]=function(_0x2a0533,_0x413aca){return db[_0x37be('0x2e')]['find']({'where':{'id':_0x2a0533['params']['id']}})[_0x37be('0x27')](handleEntityNotFound(_0x413aca,null))[_0x37be('0x27')](removeEntity(_0x413aca,null))[_0x37be('0x46')](handleError(_0x413aca,null));};exports[_0x37be('0x4d')]=function(_0x469260,_0x228ff3){return db[_0x37be('0x2e')][_0x37be('0x4d')]()[_0x37be('0x27')](respondWithResult(_0x228ff3,null))['catch'](handleError(_0x228ff3,null));};function wrapUser(_0x3f3045){return function(_0x3413dd){var _0x55b49a=_0x3f3045[_0x37be('0x4e')]({'plain':!![]});_0x55b49a[_0x37be('0x4f')]=[];if(_0x3413dd){_0x55b49a[_0x37be('0x50')]=_0x3413dd[_0x37be('0x51')];_0x55b49a[_0x37be('0x52')]=_0x3413dd;}else{_0x55b49a[_0x37be('0x50')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x55b49a[_0x37be('0x52')]={};}return _0x55b49a;};}exports[_0x37be('0x53')]=function(_0x5a907b,_0x577da2,_0x14bdd2){var _0x4c5296=[];return db[_0x37be('0x54')][_0x37be('0x55')]({'where':{'role':['agent',_0x37be('0x56'),'user']},'attributes':['id',_0x37be('0x57'),_0x37be('0x2b'),_0x37be('0x58'),'userpic','internal',_0x37be('0x59'),_0x37be('0x5a'),_0x37be('0x5b'),_0x37be('0x5c')],'order':qs[_0x37be('0x3b')](_0x37be('0x5d')),'include':[{'model':db[_0x37be('0x5e')],'as':_0x37be('0x5f'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x37be('0x27')](function(_0x19c040){if(_0x19c040){var _0x73bcaf=_0x5a907b[_0x37be('0x60')][_0x37be('0x4e')]({'plain':!![]});if(!_0x73bcaf)throw new Error(_0x37be('0x61'));if(_0x73bcaf[_0x37be('0x58')]===_0x37be('0x60')){return db[_0x37be('0x62')][_0x37be('0x49')]({'where':{'name':_0x37be('0x63'),'userProfileId':_0x73bcaf[_0x37be('0x64')]},'raw':!![]})[_0x37be('0x27')](function(_0x4d78b2){if(_0x4d78b2){if(_0x4d78b2['autoAssociation']===0x0){return db[_0x37be('0x65')]['findAll']({'where':{'sectionId':_0x4d78b2['id']},'raw':!![]})[_0x37be('0x27')](function(_0x310753){var _0x3b4a8d=[];if(_[_0x37be('0x66')](_0x310753)){_0x3b4a8d=_[_0x37be('0x40')](_0x19c040,function(_0x190dc7){if(_0x190dc7[_0x37be('0x58')]!=='agent'){return _0x190dc7;}});return _0x3b4a8d;}else{for(var _0x35bfa2=0x0;_0x35bfa2<_0x19c040[_0x37be('0x48')];_0x35bfa2++){var _0x1bda24=_0x19c040[_0x35bfa2];if(_0x1bda24[_0x37be('0x58')]===_0x37be('0x67')){var _0x48c4e1=_[_0x37be('0x49')](_0x310753,function(_0x70e15f){return _0x70e15f['resourceId']===_0x1bda24['id'];});if(_0x48c4e1)_0x3b4a8d[_0x37be('0x68')](_0x1bda24);}else{_0x3b4a8d['push'](_0x1bda24);}}return _0x3b4a8d;}});}else{return _0x19c040;}}else{var _0x5241c0=_[_0x37be('0x40')](_0x19c040,function(_0x38bd10){if(_0x38bd10[_0x37be('0x58')]!=='agent'){return _0x38bd10;}});return _0x5241c0;}});}else{return _0x19c040;}}})[_0x37be('0x27')](function(_0x2eb36a){var _0xcaefb1=[];if(_0x2eb36a){_0x4c5296=_0x2eb36a;for(var _0x523300=0x0;_0x523300<_0x2eb36a[_0x37be('0x48')];_0x523300+=0x1){_0x4c5296[_0x523300][_0x37be('0x4f')]=[];_0xcaefb1[_0x37be('0x68')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x5a907b[_0x37be('0x60')]['id'],_0x2eb36a[_0x523300]['id']],'ToId':[_0x5a907b[_0x37be('0x60')]['id'],_0x2eb36a[_0x523300]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x37be('0x69'),_0x37be('0x6a'),'read','body'],'order':qs[_0x37be('0x3b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x37be('0x27')](wrapUser(_0x2eb36a[_0x523300])));}return BPromise['all'](_0xcaefb1);}return[];})[_0x37be('0x27')](function(_0xccf0b5){return{'rows':_0xccf0b5,'count':_0xccf0b5[_0x37be('0x48')]};})[_0x37be('0x27')](respondWithResult(_0x577da2,null))[_0x37be('0x46')](handleError(_0x577da2,null));};
\ No newline at end of file
+var _0x612a=['type','VIRTUAL','filter','options','includeAll','include','ChatInternalMessage','rows','catch','params','length','create','body','find','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','user','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','agent','createdAt','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge'];(function(_0x36ab88,_0x23f292){var _0x685d83=function(_0x73c21e){while(--_0x73c21e){_0x36ab88['push'](_0x36ab88['shift']());}};_0x685d83(++_0x23f292);}(_0x612a,0x11c));var _0xa612=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0x612a[_0x9307ea];return _0x295554;};'use strict';var emlformat=require(_0xa612('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa612('0x1'));var jsonpatch=require(_0xa612('0x2'));var rp=require(_0xa612('0x3'));var moment=require('moment');var BPromise=require(_0xa612('0x4'));var Mustache=require('mustache');var util=require(_0xa612('0x5'));var path=require(_0xa612('0x6'));var sox=require(_0xa612('0x7'));var csv=require(_0xa612('0x8'));var ejs=require(_0xa612('0x9'));var fs=require('fs');var fs_extra=require(_0xa612('0xa'));var _=require(_0xa612('0xb'));var squel=require(_0xa612('0xc'));var crypto=require(_0xa612('0xd'));var jsforce=require(_0xa612('0xe'));var deskjs=require(_0xa612('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa612('0x10'));var Papa=require(_0xa612('0x11'));var Redis=require(_0xa612('0x12'));var authService=require(_0xa612('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa612('0x14'));var hardwareService=require(_0xa612('0x15'));var logger=require(_0xa612('0x16'))(_0xa612('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa612('0x18'));var db=require(_0xa612('0x19'))['db'];config['redis']=_[_0xa612('0x1a')](config[_0xa612('0x1b')],{'host':_0xa612('0x1c'),'port':0x18eb});var socket=require(_0xa612('0x1d'))(new Redis(config[_0xa612('0x1b')]));require(_0xa612('0x1e'))[_0xa612('0x1f')](socket);function respondWithStatusCode(_0x28eadb,_0x5d8859){_0x5d8859=_0x5d8859||0xcc;return function(_0x19ba6b){if(_0x19ba6b){return _0x28eadb['sendStatus'](_0x5d8859);}return _0x28eadb[_0xa612('0x20')](_0x5d8859)[_0xa612('0x21')]();};}function respondWithResult(_0x2f9c8d,_0x199947){_0x199947=_0x199947||0xc8;return function(_0x223b21){if(_0x223b21){return _0x2f9c8d['status'](_0x199947)['json'](_0x223b21);}};}function respondWithFilteredResult(_0x5f0542,_0xcd7c89){return function(_0x25ac5d){if(_0x25ac5d){var _0x58cabc=typeof _0xcd7c89['offset']==='undefined'&&typeof _0xcd7c89[_0xa612('0x22')]===_0xa612('0x23');var _0x1e26de=_0x25ac5d['count'];var _0x4913bf=_0x58cabc?0x0:_0xcd7c89[_0xa612('0x24')];var _0x50ce78=_0x58cabc?_0x25ac5d[_0xa612('0x25')]:_0xcd7c89[_0xa612('0x24')]+_0xcd7c89[_0xa612('0x22')];var _0x506860;if(_0x50ce78>=_0x1e26de){_0x50ce78=_0x1e26de;_0x506860=0xc8;}else{_0x506860=0xce;}_0x5f0542[_0xa612('0x20')](_0x506860);return _0x5f0542[_0xa612('0x26')](_0xa612('0x27'),_0x4913bf+'-'+_0x50ce78+'/'+_0x1e26de)[_0xa612('0x28')](_0x25ac5d);}return null;};}function patchUpdates(_0xc25e94){return function(_0x23afbc){try{jsonpatch[_0xa612('0x29')](_0x23afbc,_0xc25e94,!![]);}catch(_0x4cdc05){return BPromise[_0xa612('0x2a')](_0x4cdc05);}return _0x23afbc[_0xa612('0x2b')]();};}function saveUpdates(_0x50c61d,_0x1a1fdb){return function(_0x31dad5){if(_0x31dad5){return _0x31dad5[_0xa612('0x2c')](_0x50c61d)[_0xa612('0x2d')](function(_0x507fce){return _0x507fce;});}return null;};}function removeEntity(_0x3f824f,_0x3e5b2e){return function(_0x33561c){if(_0x33561c){return _0x33561c[_0xa612('0x2e')]()[_0xa612('0x2d')](function(){_0x3f824f[_0xa612('0x20')](0xcc)[_0xa612('0x21')]();});}};}function handleEntityNotFound(_0x331724,_0x390de5){return function(_0x331491){if(!_0x331491){_0x331724['sendStatus'](0x194);}return _0x331491;};}function handleError(_0x24f274,_0x55dc2a){_0x55dc2a=_0x55dc2a||0x1f4;return function(_0x1754e3){logger['error'](_0x1754e3['stack']);if(_0x1754e3[_0xa612('0x2f')]){delete _0x1754e3[_0xa612('0x2f')];}_0x24f274[_0xa612('0x20')](_0x55dc2a)[_0xa612('0x30')](_0x1754e3);};}exports[_0xa612('0x31')]=function(_0x1e5cea,_0x53f230){var _0x3c9d2c={},_0x2c6afa={},_0x41e8fc={'count':0x0,'rows':[]};var _0x317738=_[_0xa612('0x32')](db['ChatInternalMessage'][_0xa612('0x33')],function(_0x1f5ae3){return{'name':_0x1f5ae3[_0xa612('0x34')],'type':_0x1f5ae3['type'][_0xa612('0x35')]};});_0x2c6afa[_0xa612('0x36')]=_['map'](_0x317738,'name');_0x2c6afa[_0xa612('0x37')]=_[_0xa612('0x38')](_0x1e5cea['query']);_0x2c6afa[_0xa612('0x39')]=_[_0xa612('0x3a')](_0x2c6afa['model'],_0x2c6afa[_0xa612('0x37')]);_0x3c9d2c[_0xa612('0x3b')]=_[_0xa612('0x3a')](_0x2c6afa[_0xa612('0x36')],qs[_0xa612('0x3c')](_0x1e5cea[_0xa612('0x37')][_0xa612('0x3c')]));_0x3c9d2c[_0xa612('0x3b')]=_0x3c9d2c['attributes']['length']?_0x3c9d2c[_0xa612('0x3b')]:_0x2c6afa[_0xa612('0x36')];if(!_0x1e5cea['query'][_0xa612('0x3d')](_0xa612('0x3e'))){_0x3c9d2c[_0xa612('0x22')]=qs[_0xa612('0x22')](_0x1e5cea[_0xa612('0x37')][_0xa612('0x22')]);_0x3c9d2c[_0xa612('0x24')]=qs[_0xa612('0x24')](_0x1e5cea['query'][_0xa612('0x24')]);}_0x3c9d2c['order']=qs['sort'](_0x1e5cea[_0xa612('0x37')][_0xa612('0x3f')]);_0x3c9d2c[_0xa612('0x40')]=qs['filters'](_[_0xa612('0x41')](_0x1e5cea['query'],_0x2c6afa[_0xa612('0x39')]),_0x317738);if(_0x1e5cea[_0xa612('0x37')]['filter']){_0x3c9d2c[_0xa612('0x40')]=_[_0xa612('0x42')](_0x3c9d2c[_0xa612('0x40')],{'$or':_['map'](_0x317738,function(_0x4c6620){if(_0x4c6620[_0xa612('0x43')]!==_0xa612('0x44')){var _0x1902ad={};_0x1902ad[_0x4c6620[_0xa612('0x2f')]]={'$like':'%'+_0x1e5cea[_0xa612('0x37')][_0xa612('0x45')]+'%'};return _0x1902ad;}})});}_0x3c9d2c=_[_0xa612('0x42')]({},_0x3c9d2c,_0x1e5cea[_0xa612('0x46')]);var _0x57c967={'where':_0x3c9d2c[_0xa612('0x40')]};return db['ChatInternalMessage'][_0xa612('0x25')](_0x57c967)[_0xa612('0x2d')](function(_0xffd025){_0x41e8fc[_0xa612('0x25')]=_0xffd025;if(_0x1e5cea['query'][_0xa612('0x47')]){_0x3c9d2c[_0xa612('0x48')]=[{'all':!![]}];}return db[_0xa612('0x49')]['findAll'](_0x3c9d2c);})[_0xa612('0x2d')](function(_0x476911){_0x41e8fc[_0xa612('0x4a')]=_0x476911;return _0x41e8fc;})[_0xa612('0x2d')](respondWithFilteredResult(_0x53f230,_0x3c9d2c))[_0xa612('0x4b')](handleError(_0x53f230,null));};exports['show']=function(_0x4fc70a,_0x1bd653){var _0x43d587={'raw':!![],'where':{'id':_0x4fc70a[_0xa612('0x4c')]['id']}},_0x4a7867={};_0x4a7867[_0xa612('0x36')]=_[_0xa612('0x38')](db[_0xa612('0x49')][_0xa612('0x33')]);_0x4a7867[_0xa612('0x37')]=_[_0xa612('0x38')](_0x4fc70a[_0xa612('0x37')]);_0x4a7867[_0xa612('0x39')]=_[_0xa612('0x3a')](_0x4a7867[_0xa612('0x36')],_0x4a7867[_0xa612('0x37')]);_0x43d587[_0xa612('0x3b')]=_[_0xa612('0x3a')](_0x4a7867['model'],qs['fields'](_0x4fc70a[_0xa612('0x37')][_0xa612('0x3c')]));_0x43d587[_0xa612('0x3b')]=_0x43d587[_0xa612('0x3b')][_0xa612('0x4d')]?_0x43d587[_0xa612('0x3b')]:_0x4a7867[_0xa612('0x36')];if(_0x4fc70a[_0xa612('0x37')]['includeAll']){_0x43d587[_0xa612('0x48')]=[{'all':!![]}];}_0x43d587=_[_0xa612('0x42')]({},_0x43d587,_0x4fc70a[_0xa612('0x46')]);return db[_0xa612('0x49')]['find'](_0x43d587)[_0xa612('0x2d')](handleEntityNotFound(_0x1bd653,null))[_0xa612('0x2d')](respondWithResult(_0x1bd653,null))['catch'](handleError(_0x1bd653,null));};exports[_0xa612('0x4e')]=function(_0x519ec8,_0x5a53ae){return db[_0xa612('0x49')][_0xa612('0x4e')](_0x519ec8[_0xa612('0x4f')],{})[_0xa612('0x2d')](respondWithResult(_0x5a53ae,0xc9))[_0xa612('0x4b')](handleError(_0x5a53ae,null));};exports[_0xa612('0x2c')]=function(_0x3eeea6,_0xb1b2e7){if(_0x3eeea6[_0xa612('0x4f')]['id']){delete _0x3eeea6['body']['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x3eeea6[_0xa612('0x4c')]['id']}})[_0xa612('0x2d')](handleEntityNotFound(_0xb1b2e7,null))[_0xa612('0x2d')](saveUpdates(_0x3eeea6[_0xa612('0x4f')],null))['then'](respondWithResult(_0xb1b2e7,null))['catch'](handleError(_0xb1b2e7,null));};exports[_0xa612('0x2e')]=function(_0x54cdb4,_0x19a37c){return db[_0xa612('0x49')][_0xa612('0x50')]({'where':{'id':_0x54cdb4[_0xa612('0x4c')]['id']}})[_0xa612('0x2d')](handleEntityNotFound(_0x19a37c,null))[_0xa612('0x2d')](removeEntity(_0x19a37c,null))[_0xa612('0x4b')](handleError(_0x19a37c,null));};exports['describe']=function(_0x7552c4,_0x4c3bec){return db[_0xa612('0x49')][_0xa612('0x51')]()[_0xa612('0x2d')](respondWithResult(_0x4c3bec,null))['catch'](handleError(_0x4c3bec,null));};function wrapUser(_0x507834){return function(_0x4255a8){var _0x238365=_0x507834[_0xa612('0x52')]({'plain':!![]});_0x238365[_0xa612('0x53')]=[];if(_0x4255a8){_0x238365[_0xa612('0x54')]=_0x4255a8['createdAt'];_0x238365[_0xa612('0x55')]=_0x4255a8;}else{_0x238365['lastMessageAt']=moment(0x0)[_0xa612('0x56')](_0xa612('0x57'));_0x238365['lastMessage']={};}return _0x238365;};}exports[_0xa612('0x58')]=function(_0x5e0430,_0x7b1055,_0x1f81b0){var _0xfb591a=[];return db[_0xa612('0x59')][_0xa612('0x5a')]({'where':{'role':['agent',_0xa612('0x5b'),_0xa612('0x5c')]},'attributes':['id',_0xa612('0x5d'),_0xa612('0x2f'),'role',_0xa612('0x5e'),'internal',_0xa612('0x5f'),_0xa612('0x60'),_0xa612('0x61'),_0xa612('0x62')],'order':qs[_0xa612('0x3f')]('-online'),'include':[{'model':db[_0xa612('0x63')],'as':'VoiceQueues','attributes':['id',_0xa612('0x2f'),'type'],'through':{'attributes':[]}}]})[_0xa612('0x2d')](function(_0xf5705e){if(_0xf5705e){var _0x35100d=_0x5e0430[_0xa612('0x5c')][_0xa612('0x52')]({'plain':!![]});if(!_0x35100d)throw new Error(_0xa612('0x64'));if(_0x35100d[_0xa612('0x65')]===_0xa612('0x5c')){return db[_0xa612('0x66')][_0xa612('0x50')]({'where':{'name':_0xa612('0x67'),'userProfileId':_0x35100d[_0xa612('0x68')]},'raw':!![]})[_0xa612('0x2d')](function(_0x26ff84){if(_0x26ff84){if(_0x26ff84[_0xa612('0x69')]===0x0){return db[_0xa612('0x6a')][_0xa612('0x5a')]({'where':{'sectionId':_0x26ff84['id']},'raw':!![]})[_0xa612('0x2d')](function(_0x43599f){var _0x72e52=[];if(_[_0xa612('0x6b')](_0x43599f)){_0x72e52=_[_0xa612('0x45')](_0xf5705e,function(_0x33eb44){if(_0x33eb44[_0xa612('0x65')]!=='agent'){return _0x33eb44;}});return _0x72e52;}else{for(var _0xcbfbab=0x0;_0xcbfbab<_0xf5705e['length'];_0xcbfbab++){var _0x3f62f0=_0xf5705e[_0xcbfbab];if(_0x3f62f0[_0xa612('0x65')]==='agent'){var _0x37c4b0=_[_0xa612('0x50')](_0x43599f,function(_0x9bd43d){return _0x9bd43d[_0xa612('0x6c')]===_0x3f62f0['id'];});if(_0x37c4b0)_0x72e52['push'](_0x3f62f0);}else{_0x72e52[_0xa612('0x6d')](_0x3f62f0);}}return _0x72e52;}});}else{return _0xf5705e;}}else{var _0xc83078=_[_0xa612('0x45')](_0xf5705e,function(_0x379866){if(_0x379866[_0xa612('0x65')]!==_0xa612('0x6e')){return _0x379866;}});return _0xc83078;}});}else{return _0xf5705e;}}})[_0xa612('0x2d')](function(_0x71346e){var _0x10cf1d=[];if(_0x71346e){_0xfb591a=_0x71346e;for(var _0x4b9d3a=0x0;_0x4b9d3a<_0x71346e[_0xa612('0x4d')];_0x4b9d3a+=0x1){_0xfb591a[_0x4b9d3a][_0xa612('0x53')]=[];_0x10cf1d[_0xa612('0x6d')](db[_0xa612('0x49')]['find']({'where':{'FromId':[_0x5e0430[_0xa612('0x5c')]['id'],_0x71346e[_0x4b9d3a]['id']],'ToId':[_0x5e0430[_0xa612('0x5c')]['id'],_0x71346e[_0x4b9d3a]['id']],'ChatGroupId':null},'attributes':['id',_0xa612('0x6f'),_0xa612('0x70'),_0xa612('0x71'),_0xa612('0x72'),'body'],'order':qs[_0xa612('0x3f')](_0xa612('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa612('0x2d')](wrapUser(_0x71346e[_0x4b9d3a])));}return BPromise[_0xa612('0x74')](_0x10cf1d);}return[];})[_0xa612('0x2d')](function(_0x31425e){return{'rows':_0x31425e,'count':_0x31425e[_0xa612('0x4d')]};})['then'](respondWithResult(_0x7b1055,null))['catch'](handleError(_0x7b1055,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index ebb6ff3..7be417f 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 _0x011c=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','remove','emit'];(function(_0x56ab92,_0x481307){var _0x4dcc9c=function(_0xee27d4){while(--_0xee27d4){_0x56ab92['push'](_0x56ab92['shift']());}};_0x4dcc9c(++_0x481307);}(_0x011c,0xf2));var _0xc011=function(_0x3541a6,_0x5b6604){_0x3541a6=_0x3541a6-0x0;var _0x3569c7=_0x011c[_0x3541a6];return _0x3569c7;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xc011('0x0'))['db'][_0xc011('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc011('0x2')};function emitEvent(_0x2914cc){return function(_0x72f7c3,_0x5a9135,_0x168eea){ChatInternalMessageEvents['emit'](_0x2914cc+':'+_0x72f7c3['id'],_0x72f7c3);ChatInternalMessageEvents[_0xc011('0x3')](_0x2914cc,_0x72f7c3);_0x168eea(null);};}for(var e in events){if(events[_0xc011('0x4')](e)){var event=events[e];ChatInternalMessage[_0xc011('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x9806=['hasOwnProperty','hook','events','ChatInternalMessage','setMaxListeners','save','update','emit'];(function(_0x783e4b,_0x193ea8){var _0x3696d1=function(_0x57fc78){while(--_0x57fc78){_0x783e4b['push'](_0x783e4b['shift']());}};_0x3696d1(++_0x193ea8);}(_0x9806,0x12a));var _0x6980=function(_0x487c1d,_0x187a29){_0x487c1d=_0x487c1d-0x0;var _0x528d47=_0x9806[_0x487c1d];return _0x528d47;};'use strict';var EventEmitter=require(_0x6980('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x6980('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6980('0x2')](0x0);var events={'afterCreate':_0x6980('0x3'),'afterUpdate':_0x6980('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a0e21){return function(_0x4f78d4,_0x1d7110,_0x26b3ea){ChatInternalMessageEvents[_0x6980('0x5')](_0x2a0e21+':'+_0x4f78d4['id'],_0x4f78d4);ChatInternalMessageEvents[_0x6980('0x5')](_0x2a0e21,_0x4f78d4);_0x26b3ea(null);};}for(var e in events){if(events[_0x6980('0x6')](e)){var event=events[e];ChatInternalMessage[_0x6980('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 0a454fc..f315090 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 _0xe660=['exports','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','./chatInternalMessage.attributes'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xe660,0xe0));var _0x0e66=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0xe660[_0x257495];return _0x3849aa;};'use strict';var _=require('lodash');var util=require(_0x0e66('0x0'));var logger=require(_0x0e66('0x1'))(_0x0e66('0x2'));var moment=require('moment');var BPromise=require(_0x0e66('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e66('0x4'));var rimraf=require(_0x0e66('0x5'));var config=require('../../config/environment');var attributes=require(_0x0e66('0x6'));module[_0x0e66('0x7')]=function(_0x173f7a,_0x127c69){return _0x173f7a['define'](_0x0e66('0x8'),attributes,{'tableName':_0x0e66('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0e66('0xa')});};
\ No newline at end of file
+var _0x7ab8=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7ab8,0x133));var _0x87ab=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7ab8[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x87ab('0x0'));var util=require(_0x87ab('0x1'));var logger=require(_0x87ab('0x2'))(_0x87ab('0x3'));var moment=require(_0x87ab('0x4'));var BPromise=require('bluebird');var rp=require(_0x87ab('0x5'));var fs=require('fs');var path=require(_0x87ab('0x6'));var rimraf=require(_0x87ab('0x7'));var config=require(_0x87ab('0x8'));var attributes=require(_0x87ab('0x9'));module[_0x87ab('0xa')]=function(_0x3b7f2d,_0x3a6027){return _0x3b7f2d['define'](_0x87ab('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87ab('0xc'),'collate':_0x87ab('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 4cb4ee6..fefd822 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 _0xc923=['redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1bfda4,_0x4a1d18){var _0x2a3741=function(_0x1db468){while(--_0x1db468){_0x1bfda4['push'](_0x1bfda4['shift']());}};_0x2a3741(++_0x4a1d18);}(_0xc923,0x1ef));var _0x3c92=function(_0x3ba646,_0x3c1666){_0x3ba646=_0x3ba646-0x0;var _0x3d05a1=_0xc923[_0x3ba646];return _0x3d05a1;};'use strict';var _=require(_0x3c92('0x0'));var util=require(_0x3c92('0x1'));var moment=require(_0x3c92('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3c92('0x3'))(_0x3c92('0x4'));var config=require(_0x3c92('0x5'));var jayson=require(_0x3c92('0x6'));var client=jayson[_0x3c92('0x7')][_0x3c92('0x8')]({'port':0x232a});config[_0x3c92('0x9')]=_[_0x3c92('0xa')](config[_0x3c92('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c92('0xb'))(new Redis(config[_0x3c92('0x9')]));require(_0x3c92('0xc'))[_0x3c92('0xd')](socket);function respondWithRpcPromise(_0x5dcd73,_0x2e1eeb,_0x59300c){return new BPromise(function(_0x31addc,_0x4c3628){return client[_0x3c92('0xe')](_0x5dcd73,_0x59300c)[_0x3c92('0xf')](function(_0x1be3a3){logger[_0x3c92('0x10')](_0x3c92('0x11'),_0x2e1eeb,_0x3c92('0x12'));logger['debug'](_0x3c92('0x13'),_0x2e1eeb,_0x3c92('0x12'),JSON['stringify'](_0x1be3a3));if(_0x1be3a3[_0x3c92('0x14')]){if(_0x1be3a3[_0x3c92('0x14')]['code']===0x1f4){logger['error'](_0x3c92('0x11'),_0x2e1eeb,_0x1be3a3[_0x3c92('0x14')][_0x3c92('0x15')]);return _0x4c3628(_0x1be3a3[_0x3c92('0x14')][_0x3c92('0x15')]);}logger[_0x3c92('0x14')](_0x3c92('0x11'),_0x2e1eeb,_0x1be3a3['error'][_0x3c92('0x15')]);return _0x31addc(_0x1be3a3[_0x3c92('0x14')]['message']);}else{logger[_0x3c92('0x10')](_0x3c92('0x11'),_0x2e1eeb,_0x3c92('0x12'));_0x31addc(_0x1be3a3[_0x3c92('0x16')]['message']);}})[_0x3c92('0x17')](function(_0x6a6264){logger['error'](_0x3c92('0x11'),_0x2e1eeb,_0x6a6264);_0x4c3628(_0x6a6264);});});}
\ No newline at end of file
+var _0x16c6=['error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x16c6,0x18d));var _0x616c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x16c6[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x616c('0x0'));var util=require('util');var moment=require(_0x616c('0x1'));var BPromise=require(_0x616c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x616c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x616c('0x4'));var logger=require(_0x616c('0x5'))(_0x616c('0x6'));var config=require(_0x616c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x616c('0x8')]({'port':0x232a});config[_0x616c('0x9')]=_[_0x616c('0xa')](config[_0x616c('0x9')],{'host':_0x616c('0xb'),'port':0x18eb});var socket=require(_0x616c('0xc'))(new Redis(config['redis']));require(_0x616c('0xd'))[_0x616c('0xe')](socket);function respondWithRpcPromise(_0x39a811,_0x5c7484,_0x3edcfa){return new BPromise(function(_0x257bce,_0x1404c2){return client[_0x616c('0xf')](_0x39a811,_0x3edcfa)[_0x616c('0x10')](function(_0x3d88e6){logger[_0x616c('0x11')](_0x616c('0x12'),_0x5c7484,'request\x20sent');logger[_0x616c('0x13')](_0x616c('0x14'),_0x5c7484,_0x616c('0x15'),JSON[_0x616c('0x16')](_0x3d88e6));if(_0x3d88e6[_0x616c('0x17')]){if(_0x3d88e6[_0x616c('0x17')][_0x616c('0x18')]===0x1f4){logger['error'](_0x616c('0x12'),_0x5c7484,_0x3d88e6['error']['message']);return _0x1404c2(_0x3d88e6['error'][_0x616c('0x19')]);}logger[_0x616c('0x17')](_0x616c('0x12'),_0x5c7484,_0x3d88e6[_0x616c('0x17')][_0x616c('0x19')]);return _0x257bce(_0x3d88e6['error'][_0x616c('0x19')]);}else{logger['info'](_0x616c('0x12'),_0x5c7484,'request\x20sent');_0x257bce(_0x3d88e6[_0x616c('0x1a')][_0x616c('0x19')]);}})[_0x616c('0x1b')](function(_0x2d38f8){logger[_0x616c('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x5c7484,_0x2d38f8);_0x1404c2(_0x2d38f8);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 7f416f3..64105d5 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 _0x9059=['remove','update','emit','register','length','./chatInternalMessage.events','save'];(function(_0x3c35a4,_0x355c06){var _0x7231c0=function(_0x3be986){while(--_0x3be986){_0x3c35a4['push'](_0x3c35a4['shift']());}};_0x7231c0(++_0x355c06);}(_0x9059,0x163));var _0x9905=function(_0xdcf359,_0x4cd24c){_0xdcf359=_0xdcf359-0x0;var _0x46af1c=_0x9059[_0xdcf359];return _0x46af1c;};'use strict';var ChatInternalMessageEvents=require(_0x9905('0x0'));var events=[_0x9905('0x1'),_0x9905('0x2'),_0x9905('0x3')];function createListener(_0x168c0a,_0x1ad9cf){return function(_0x4d785d){_0x1ad9cf[_0x9905('0x4')](_0x168c0a,_0x4d785d);};}function removeListener(_0x4354ed,_0x4c9c8a){return function(){ChatInternalMessageEvents['removeListener'](_0x4354ed,_0x4c9c8a);};}exports[_0x9905('0x5')]=function(_0x54773b){for(var _0x1bc098=0x0,_0x3626d9=events[_0x9905('0x6')];_0x1bc098<_0x3626d9;_0x1bc098++){var _0x50521c=events[_0x1bc098];var _0x2a278a=createListener('chatInternalMessage:'+_0x50521c,_0x54773b);ChatInternalMessageEvents['on'](_0x50521c,_0x2a278a);}};
\ No newline at end of file
+var _0x8806=['remove','update','register','length','./chatInternalMessage.events','save'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8806,0xfa));var _0x6880=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x8806[_0x3fba9f];return _0x192cf1;};'use strict';var ChatInternalMessageEvents=require(_0x6880('0x0'));var events=[_0x6880('0x1'),_0x6880('0x2'),_0x6880('0x3')];function createListener(_0x50330a,_0x45c659){return function(_0x28f95e){_0x45c659['emit'](_0x50330a,_0x28f95e);};}function removeListener(_0x2109f4,_0x431dcf){return function(){ChatInternalMessageEvents['removeListener'](_0x2109f4,_0x431dcf);};}exports[_0x6880('0x4')]=function(_0x2e122b){for(var _0x201960=0x0,_0x9e28d4=events[_0x6880('0x5')];_0x201960<_0x9e28d4;_0x201960++){var _0x53fb3b=events[_0x201960];var _0x7ec92=createListener('chatInternalMessage:'+_0x53fb3b,_0x2e122b);ChatInternalMessageEvents['on'](_0x53fb3b,_0x7ec92);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index b7c8d4d..c5fc059 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 _0x47d9=['show','post','put','update','delete','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id'];(function(_0x2dea58,_0x59d6f0){var _0x2b23c2=function(_0x3e5c44){while(--_0x3e5c44){_0x2dea58['push'](_0x2dea58['shift']());}};_0x2b23c2(++_0x59d6f0);}(_0x47d9,0x195));var _0x947d=function(_0x25b620,_0x35b70e){_0x25b620=_0x25b620-0x0;var _0x4a0254=_0x47d9[_0x25b620];return _0x4a0254;};'use strict';var multer=require(_0x947d('0x0'));var util=require(_0x947d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x947d('0x2'));var router=express['Router']();var fs_extra=require(_0x947d('0x3'));var auth=require(_0x947d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x947d('0x5'));var controller=require(_0x947d('0x6'));router[_0x947d('0x7')]('/',auth[_0x947d('0x8')](),controller[_0x947d('0x9')]);router[_0x947d('0x7')](_0x947d('0xa'),auth[_0x947d('0x8')](),controller[_0x947d('0xb')]);router[_0x947d('0x7')](_0x947d('0xc'),auth[_0x947d('0x8')](),controller[_0x947d('0xd')]);router[_0x947d('0x7')](_0x947d('0xe'),auth[_0x947d('0x8')](),controller[_0x947d('0xf')]);router[_0x947d('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x947d('0x11')](_0x947d('0xe'),controller[_0x947d('0x12')]);router[_0x947d('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x947d('0x14')]=router;
\ No newline at end of file
+var _0x55df=['../../config/environment','./chatInternalMessage.controller','index','get','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x55df,0x1c6));var _0xf55d=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x55df[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require('multer');var util=require(_0xf55d('0x0'));var path=require(_0xf55d('0x1'));var timeout=require(_0xf55d('0x2'));var express=require(_0xf55d('0x3'));var router=express[_0xf55d('0x4')]();var fs_extra=require(_0xf55d('0x5'));var auth=require(_0xf55d('0x6'));var interaction=require(_0xf55d('0x7'));var config=require(_0xf55d('0x8'));var controller=require(_0xf55d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf55d('0xa')]);router[_0xf55d('0xb')]('/describe',auth[_0xf55d('0xc')](),controller[_0xf55d('0xd')]);router[_0xf55d('0xb')]('/users',auth['isAuthenticated'](),controller['getUsers']);router['get']('/:id',auth[_0xf55d('0xc')](),controller[_0xf55d('0xe')]);router['post']('/',auth[_0xf55d('0xc')](),controller[_0xf55d('0xf')]);router[_0xf55d('0x10')](_0xf55d('0x11'),controller[_0xf55d('0x12')]);router[_0xf55d('0x13')](_0xf55d('0x11'),auth[_0xf55d('0xc')](),controller[_0xf55d('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index c69f5ba..b07791d 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 _0xd070=['medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','TEXT'];(function(_0xc0213d,_0x4a3b1d){var _0x1a93c4=function(_0xc683f3){while(--_0xc683f3){_0xc0213d['push'](_0xc0213d['shift']());}};_0x1a93c4(++_0x4a3b1d);}(_0xd070,0x8e));var _0x0d07=function(_0x202e27,_0x300fbc){_0x202e27=_0x202e27-0x0;var _0x333bd4=_0xd070[_0x202e27];return _0x333bd4;};'use strict';var Sequelize=require(_0x0d07('0x0'));module['exports']={'body':{'type':Sequelize[_0x0d07('0x1')](_0x0d07('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0d07('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0d07('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0d07('0x4')]('in',_0x0d07('0x5')),'defaultValue':_0x0d07('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0d07('0x6')]},'providerName':{'type':Sequelize[_0x0d07('0x7')]},'providerResponse':{'type':Sequelize[_0x0d07('0x1')]}};
\ No newline at end of file
+var _0x39c4=['exports','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x483315,_0x4b34d1){var _0xb6652d=function(_0x5d7fa0){while(--_0x5d7fa0){_0x483315['push'](_0x483315['shift']());}};_0xb6652d(++_0x4b34d1);}(_0x39c4,0x174));var _0x439c=function(_0x4d68bc,_0x24d31f){_0x4d68bc=_0x4d68bc-0x0;var _0x40571a=_0x39c4[_0x4d68bc];return _0x40571a;};'use strict';var Sequelize=require('sequelize');module[_0x439c('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x439c('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x439c('0x3')]},'providerName':{'type':Sequelize[_0x439c('0x4')]},'providerResponse':{'type':Sequelize[_0x439c('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 8fa14cd..c53fc3a 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 _0x3165=['chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','QueryTypes','formData','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','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','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','end','stack','send','map','ChatMessage','fieldName','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','describe','chat-interactions','read','readAt','user','agent','UserId','get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','reject'];(function(_0x32a122,_0x4e1fbf){var _0x3b814c=function(_0x1a190e){while(--_0x1a190e){_0x32a122['push'](_0x32a122['shift']());}};_0x3b814c(++_0x4e1fbf);}(_0x3165,0x91));var _0x5316=function(_0x339972,_0x484ac8){_0x339972=_0x339972-0x0;var _0x1acb17=_0x3165[_0x339972];return _0x1acb17;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5316('0x0'));var zipdir=require(_0x5316('0x1'));var jsonpatch=require(_0x5316('0x2'));var rp=require(_0x5316('0x3'));var moment=require('moment');var BPromise=require(_0x5316('0x4'));var Mustache=require(_0x5316('0x5'));var util=require(_0x5316('0x6'));var path=require(_0x5316('0x7'));var sox=require('sox');var csv=require(_0x5316('0x8'));var ejs=require(_0x5316('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5316('0xa'));var jsforce=require(_0x5316('0xb'));var deskjs=require(_0x5316('0xc'));var toCsv=require(_0x5316('0x8'));var querystring=require(_0x5316('0xd'));var Papa=require(_0x5316('0xe'));var Redis=require(_0x5316('0xf'));var authService=require(_0x5316('0x10'));var qs=require(_0x5316('0x11'));var as=require(_0x5316('0x12'));var hardwareService=require(_0x5316('0x13'));var logger=require(_0x5316('0x14'))('api');var utils=require(_0x5316('0x15'));var config=require(_0x5316('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5316('0x17'))['db'];config['redis']=_['defaults'](config[_0x5316('0x18')],{'host':_0x5316('0x19'),'port':0x18eb});var socket=require(_0x5316('0x1a'))(new Redis(config[_0x5316('0x18')]));require(_0x5316('0x1b'))[_0x5316('0x1c')](socket);var jayson=require(_0x5316('0x1d'));var client=jayson[_0x5316('0x1e')][_0x5316('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x5316('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1c4d54,_0x18c999,_0x2eace7,_0x46bc78){return new BPromise(function(_0x465ec8,_0x527bb8){var _0x1f83b0=_0x46bc78||client;return _0x1f83b0[_0x5316('0x20')](_0x1c4d54,_0x2eace7)[_0x5316('0x21')](function(_0x1a4bf6){logger[_0x5316('0x22')]('ChatMessage,\x20%s,\x20%s',_0x18c999,_0x5316('0x23'));logger[_0x5316('0x24')](_0x5316('0x25'),_0x18c999,_0x5316('0x23'),JSON[_0x5316('0x26')](_0x1a4bf6));if(_0x1a4bf6['error']){if(_0x1a4bf6[_0x5316('0x27')][_0x5316('0x28')]===0x1f4){logger['error'](_0x5316('0x29'),_0x18c999,_0x1a4bf6[_0x5316('0x27')][_0x5316('0x2a')]);return _0x527bb8(_0x1a4bf6[_0x5316('0x27')]['message']);}logger[_0x5316('0x27')](_0x5316('0x29'),_0x18c999,_0x1a4bf6[_0x5316('0x27')][_0x5316('0x2a')]);return _0x465ec8(_0x1a4bf6['error']['message']);}else{logger[_0x5316('0x22')](_0x5316('0x29'),_0x18c999,_0x5316('0x23'));_0x465ec8(_0x1a4bf6[_0x5316('0x2b')][_0x5316('0x2a')]);}})[_0x5316('0x2c')](function(_0x3c6689){logger[_0x5316('0x27')]('ChatMessage,\x20%s,\x20%s',_0x18c999,_0x3c6689);_0x527bb8(_0x3c6689);});});}function respondWithStatusCode(_0x1532bc,_0x19a519){_0x19a519=_0x19a519||0xcc;return function(_0x1362f8){if(_0x1362f8){return _0x1532bc[_0x5316('0x2d')](_0x19a519);}return _0x1532bc[_0x5316('0x2e')](_0x19a519)['end']();};}function respondWithResult(_0x1b2e39,_0xd895a8){_0xd895a8=_0xd895a8||0xc8;return function(_0x16b47f){if(_0x16b47f){return _0x1b2e39[_0x5316('0x2e')](_0xd895a8)[_0x5316('0x2f')](_0x16b47f);}};}function respondWithFilteredResult(_0x1f1fb0,_0x240eee){return function(_0x227d1d){if(_0x227d1d){var _0x49a2f2=typeof _0x240eee['offset']===_0x5316('0x30')&&typeof _0x240eee[_0x5316('0x31')]===_0x5316('0x30');var _0x340a86=_0x227d1d[_0x5316('0x32')];var _0x10456d=_0x49a2f2?0x0:_0x240eee[_0x5316('0x33')];var _0x447c52=_0x49a2f2?_0x227d1d[_0x5316('0x32')]:_0x240eee[_0x5316('0x33')]+_0x240eee[_0x5316('0x31')];var _0x526ce8;if(_0x447c52>=_0x340a86){_0x447c52=_0x340a86;_0x526ce8=0xc8;}else{_0x526ce8=0xce;}_0x1f1fb0[_0x5316('0x2e')](_0x526ce8);return _0x1f1fb0[_0x5316('0x34')](_0x5316('0x35'),_0x10456d+'-'+_0x447c52+'/'+_0x340a86)['json'](_0x227d1d);}return null;};}function patchUpdates(_0x3266a6){return function(_0xab6148){try{jsonpatch[_0x5316('0x36')](_0xab6148,_0x3266a6,!![]);}catch(_0x4c430c){return BPromise['reject'](_0x4c430c);}return _0xab6148[_0x5316('0x37')]();};}function saveUpdates(_0x5ccbd7,_0x1736f4){return function(_0x120e2b){if(_0x120e2b){return _0x120e2b['update'](_0x5ccbd7)[_0x5316('0x21')](function(_0x3e4716){return _0x3e4716;});}return null;};}function removeEntity(_0x3d3717,_0x37c750){return function(_0x1c1b44){if(_0x1c1b44){return _0x1c1b44[_0x5316('0x38')]()[_0x5316('0x21')](function(){_0x3d3717['status'](0xcc)[_0x5316('0x39')]();});}};}function handleEntityNotFound(_0x2eea4c,_0x1514ca){return function(_0x1400bf){if(!_0x1400bf){_0x2eea4c['sendStatus'](0x194);}return _0x1400bf;};}function handleError(_0xfd90b3,_0x4a888b){_0x4a888b=_0x4a888b||0x1f4;return function(_0x5aba20){logger[_0x5316('0x27')](_0x5aba20[_0x5316('0x3a')]);if(_0x5aba20['name']){delete _0x5aba20['name'];}_0xfd90b3[_0x5316('0x2e')](_0x4a888b)[_0x5316('0x3b')](_0x5aba20);};}exports['index']=function(_0x170468,_0x34b253){var _0xa5240c={},_0x20addc={},_0x1adabf={'count':0x0,'rows':[]};var _0x594111=_[_0x5316('0x3c')](db[_0x5316('0x3d')]['rawAttributes'],function(_0x4cc90b){return{'name':_0x4cc90b[_0x5316('0x3e')],'type':_0x4cc90b['type'][_0x5316('0x3f')]};});_0x20addc[_0x5316('0x40')]=_[_0x5316('0x3c')](_0x594111,_0x5316('0x41'));_0x20addc[_0x5316('0x42')]=_['keys'](_0x170468[_0x5316('0x42')]);_0x20addc[_0x5316('0x43')]=_['intersection'](_0x20addc['model'],_0x20addc[_0x5316('0x42')]);_0xa5240c['attributes']=_[_0x5316('0x44')](_0x20addc['model'],qs['fields'](_0x170468[_0x5316('0x42')][_0x5316('0x45')]));_0xa5240c[_0x5316('0x46')]=_0xa5240c[_0x5316('0x46')][_0x5316('0x47')]?_0xa5240c[_0x5316('0x46')]:_0x20addc[_0x5316('0x40')];if(!_0x170468[_0x5316('0x42')][_0x5316('0x48')]('nolimit')){_0xa5240c[_0x5316('0x31')]=qs[_0x5316('0x31')](_0x170468['query']['limit']);_0xa5240c['offset']=qs[_0x5316('0x33')](_0x170468[_0x5316('0x42')][_0x5316('0x33')]);}_0xa5240c[_0x5316('0x49')]=qs[_0x5316('0x4a')](_0x170468[_0x5316('0x42')][_0x5316('0x4a')]);_0xa5240c[_0x5316('0x4b')]=qs[_0x5316('0x43')](_[_0x5316('0x4c')](_0x170468[_0x5316('0x42')],_0x20addc[_0x5316('0x43')]),_0x594111);if(_0x170468['query'][_0x5316('0x4d')]){_0xa5240c[_0x5316('0x4b')]=_[_0x5316('0x4e')](_0xa5240c[_0x5316('0x4b')],{'$or':_[_0x5316('0x3c')](_0x594111,function(_0xc24c74){if(_0xc24c74[_0x5316('0x4f')]!=='VIRTUAL'){var _0x593c9f={};_0x593c9f[_0xc24c74[_0x5316('0x41')]]={'$like':'%'+_0x170468[_0x5316('0x42')][_0x5316('0x4d')]+'%'};return _0x593c9f;}})});}_0xa5240c=_[_0x5316('0x4e')]({},_0xa5240c,_0x170468['options']);var _0x3dfb4e={'where':_0xa5240c[_0x5316('0x4b')]};return db[_0x5316('0x3d')]['count'](_0x3dfb4e)[_0x5316('0x21')](function(_0x41ddc9){_0x1adabf[_0x5316('0x32')]=_0x41ddc9;if(_0x170468[_0x5316('0x42')][_0x5316('0x50')]){_0xa5240c[_0x5316('0x51')]=[{'all':!![]}];}return db['ChatMessage'][_0x5316('0x52')](_0xa5240c);})[_0x5316('0x21')](function(_0x2e628e){_0x1adabf[_0x5316('0x53')]=_0x2e628e;return _0x1adabf;})[_0x5316('0x21')](respondWithFilteredResult(_0x34b253,_0xa5240c))[_0x5316('0x2c')](handleError(_0x34b253,null));};exports[_0x5316('0x54')]=function(_0x3f378a,_0x5296a1){var _0x1e9d54={'raw':!![],'where':{'id':_0x3f378a[_0x5316('0x55')]['id']}},_0x4a5a89={};_0x4a5a89[_0x5316('0x40')]=_[_0x5316('0x56')](db[_0x5316('0x3d')]['rawAttributes']);_0x4a5a89[_0x5316('0x42')]=_[_0x5316('0x56')](_0x3f378a['query']);_0x4a5a89['filters']=_['intersection'](_0x4a5a89[_0x5316('0x40')],_0x4a5a89[_0x5316('0x42')]);_0x1e9d54[_0x5316('0x46')]=_['intersection'](_0x4a5a89['model'],qs[_0x5316('0x45')](_0x3f378a[_0x5316('0x42')][_0x5316('0x45')]));_0x1e9d54[_0x5316('0x46')]=_0x1e9d54['attributes'][_0x5316('0x47')]?_0x1e9d54[_0x5316('0x46')]:_0x4a5a89[_0x5316('0x40')];if(_0x3f378a['query'][_0x5316('0x50')]){_0x1e9d54[_0x5316('0x51')]=[{'all':!![]}];}_0x1e9d54=_[_0x5316('0x4e')]({},_0x1e9d54,_0x3f378a[_0x5316('0x57')]);return db[_0x5316('0x3d')][_0x5316('0x58')](_0x1e9d54)['then'](handleEntityNotFound(_0x5296a1,null))['then'](respondWithResult(_0x5296a1,null))[_0x5316('0x2c')](handleError(_0x5296a1,null));};exports[_0x5316('0x59')]=function(_0x1deebc,_0x4415c9){return db[_0x5316('0x3d')][_0x5316('0x59')](_0x1deebc[_0x5316('0x5a')],{})[_0x5316('0x21')](respondWithResult(_0x4415c9,0xc9))[_0x5316('0x2c')](handleError(_0x4415c9,null));};exports['update']=function(_0x160a52,_0x356777){if(_0x160a52[_0x5316('0x5a')]['id']){delete _0x160a52['body']['id'];}return db['ChatMessage'][_0x5316('0x58')]({'where':{'id':_0x160a52['params']['id']}})[_0x5316('0x21')](handleEntityNotFound(_0x356777,null))[_0x5316('0x21')](saveUpdates(_0x160a52[_0x5316('0x5a')],null))[_0x5316('0x21')](respondWithResult(_0x356777,null))[_0x5316('0x2c')](handleError(_0x356777,null));};exports[_0x5316('0x38')]=function(_0x53ee01,_0x565abb){return db['ChatMessage']['find']({'where':{'id':_0x53ee01[_0x5316('0x55')]['id']}})['then'](handleEntityNotFound(_0x565abb,null))[_0x5316('0x21')](removeEntity(_0x565abb,null))[_0x5316('0x2c')](handleError(_0x565abb,null));};exports[_0x5316('0x5b')]=function(_0x2bcb32,_0x4ab2f9){return db[_0x5316('0x3d')][_0x5316('0x5b')]()[_0x5316('0x21')](respondWithResult(_0x4ab2f9,null))[_0x5316('0x2c')](handleError(_0x4ab2f9,null));};var interaction_log=require(_0x5316('0x14'))(_0x5316('0x5c'));exports['accept']=function(_0x2d6578,_0x24f01a,_0x450255){var _0x5a5327={'agent':{},'channel':'chat'};if(_0x2d6578[_0x5316('0x5a')]['id']){delete _0x2d6578[_0x5316('0x5a')]['id'];}_0x2d6578[_0x5316('0x5a')][_0x5316('0x5d')]=!![];_0x2d6578[_0x5316('0x5a')][_0x5316('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2d6578[_0x5316('0x5a')]['UserId']=_0x2d6578[_0x5316('0x5a')]['UserId']||_0x2d6578[_0x5316('0x5f')]['id'];_0x5a5327[_0x5316('0x60')]['id']=_0x2d6578[_0x5316('0x5a')][_0x5316('0x61')];return db[_0x5316('0x3d')][_0x5316('0x58')]({'where':{'id':_0x2d6578[_0x5316('0x55')]['id'],'UserId':null}})[_0x5316('0x21')](handleEntityNotFound(_0x24f01a,null))[_0x5316('0x21')](saveUpdates(_0x2d6578['body'],null))['then'](function(_0x4709a3){if(_0x4709a3){_0x5a5327[_0x5316('0x2a')]=_0x4709a3[_0x5316('0x62')]({'plain':!![]});return db[_0x5316('0x63')][_0x5316('0x58')]({'where':{'id':_0x4709a3[_0x5316('0x64')]}});}return null;})[_0x5316('0x21')](handleEntityNotFound(_0x24f01a,null))[_0x5316('0x21')](function(_0x3f01c9){if(_0x3f01c9){return _0x3f01c9[_0x5316('0x65')]({'UserId':_0x2d6578[_0x5316('0x5a')][_0x5316('0x61')],'read1stAt':_[_0x5316('0x66')](_0x3f01c9[_0x5316('0x67')])?moment()[_0x5316('0x68')](_0x5316('0x69')):undefined});}return null;})[_0x5316('0x21')](function(_0x4c1a34){if(_0x4c1a34){_0x5a5327[_0x5316('0x6a')]=_0x4c1a34['get']({'plain':!![]});interaction_log[_0x5316('0x22')](_0x5316('0x6b'),_0x2d6578[_0x5316('0x5f')]['id'],_0x2d6578[_0x5316('0x5f')][_0x5316('0x41')],_0x2d6578[_0x5316('0x5f')]['role'],_0x5a5327[_0x5316('0x6a')]['id'],_0x2d6578[_0x5316('0x5a')]?JSON['stringify'](_0x2d6578[_0x5316('0x5a')]):'null');return respondWithRpcPromise(_0x5316('0x6c'),_0x5316('0x6d'),_0x5a5327);}return null;})[_0x5316('0x21')](function(_0x4fa13b){var _0xad8b6e=_0x5316('0x6e')+_0x4fa13b[_0x5316('0x2a')][_0x5316('0x6f')];return db[_0x5316('0x70')][_0x5316('0x42')](_0xad8b6e,{'type':db[_0x5316('0x71')]['QueryTypes'][_0x5316('0x72')],'raw':!![]})[_0x5316('0x21')](function(_0x1efda8){return _0x1efda8;});})[_0x5316('0x21')](function(_0x595b47){if(_0x595b47){_0x5a5327['message'][_0x5316('0x73')]=_0x595b47[0x0];if(!_0x2d6578[_0x5316('0x5a')][_0x5316('0x61')])return;return db[_0x5316('0x74')][_0x5316('0x58')]({'where':{'id':_0x2d6578[_0x5316('0x5a')]['UserId'],'role':'agent'},'attributes':['id','name',_0x5316('0x75'),_0x5316('0x76'),_0x5316('0x77')],'raw':!![]});}return null;})[_0x5316('0x21')](function(_0x24f663){if(!_0x24f663)return null;_0x5a5327[_0x5316('0x2a')][_0x5316('0x60')]=_0x24f663;return _0x5a5327;})[_0x5316('0x21')](function(_0x30f5c5){if(_0x30f5c5){if(_0x2d6578[_0x5316('0x5a')][_0x5316('0x78')]){_0x5a5327[_0x5316('0x2a')][_0x5316('0x79')]=util[_0x5316('0x68')](_0x5316('0x7a'),_0x2d6578['user'][_0x5316('0x41')]);_0x5a5327[_0x5316('0x2a')][_0x5316('0x7b')]=_0x5a5327['channel'];_0x5a5327[_0x5316('0x2a')][_0x5316('0x7c')]=_0x5a5327['channel'];_0x5a5327[_0x5316('0x2a')][_0x5316('0x7d')]=_0x5316('0x7e');return respondWithRpcPromise(_0x5316('0x7f'),_0x5316('0x7f'),{'event':_0x5316('0x80'),'message':_['merge'](_0x5a5327['message'],JSON[_0x5316('0x81')](_0x5a5327[_0x5316('0x6a')]['formData']))},client9002)[_0x5316('0x21')](function(){return _0x5a5327;});}return _0x5a5327;}return null;})['then'](respondWithResult(_0x24f01a,null))['catch'](handleError(_0x24f01a,null));};var interaction_log=require('../../config/logger')(_0x5316('0x5c'));exports[_0x5316('0x82')]=function(_0x3ec5e4,_0x5e7f02,_0x1ec637){var _0x5b8857={'agent':{},'channel':_0x5316('0x83')};if(_0x3ec5e4['body']['id']){delete _0x3ec5e4[_0x5316('0x5a')]['id'];}_0x3ec5e4[_0x5316('0x5a')][_0x5316('0x61')]=_0x3ec5e4[_0x5316('0x5a')][_0x5316('0x61')]||_0x3ec5e4[_0x5316('0x5f')]['id'];_0x5b8857[_0x5316('0x60')]['id']=_0x3ec5e4[_0x5316('0x5a')][_0x5316('0x61')];return db[_0x5316('0x3d')][_0x5316('0x58')]({'where':{'id':_0x3ec5e4[_0x5316('0x55')]['id'],'UserId':null}})[_0x5316('0x21')](handleEntityNotFound(_0x5e7f02,null))[_0x5316('0x21')](function(_0x1219c7){if(_0x1219c7){_0x5b8857[_0x5316('0x2a')]=_0x1219c7['get']({'plain':!![]});return db[_0x5316('0x63')][_0x5316('0x58')]({'where':{'id':_0x1219c7[_0x5316('0x64')]}});}return null;})[_0x5316('0x21')](handleEntityNotFound(_0x5e7f02,null))['then'](function(_0x126ae5){if(_0x126ae5){_0x5b8857[_0x5316('0x6a')]=_0x126ae5[_0x5316('0x62')]({'plain':!![]});interaction_log[_0x5316('0x22')](_0x5316('0x84'),_0x3ec5e4[_0x5316('0x5f')]['id'],_0x3ec5e4['user'][_0x5316('0x41')],_0x3ec5e4['user'][_0x5316('0x85')],_0x5b8857[_0x5316('0x6a')]['id'],_0x3ec5e4[_0x5316('0x5a')]?JSON[_0x5316('0x26')](_0x3ec5e4['body']):_0x5316('0x86'));return respondWithRpcPromise('RejectMessage',_0x5316('0x87'),_0x5b8857);}return null;})[_0x5316('0x21')](function(_0x2dfef0){var _0x24e3c3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2dfef0['message'][_0x5316('0x6f')];return db[_0x5316('0x70')][_0x5316('0x42')](_0x24e3c3,{'type':db[_0x5316('0x71')][_0x5316('0x88')][_0x5316('0x72')],'raw':!![]})[_0x5316('0x21')](function(_0x43e710){return _0x43e710;});})['then'](function(_0x1e812f){if(_0x1e812f){_0x5b8857[_0x5316('0x2a')][_0x5316('0x73')]=_0x1e812f[0x0];if(!_0x3ec5e4[_0x5316('0x5a')][_0x5316('0x61')])return;return db[_0x5316('0x74')][_0x5316('0x58')]({'where':{'id':_0x3ec5e4[_0x5316('0x5a')]['UserId'],'role':_0x5316('0x60')},'attributes':['id',_0x5316('0x41'),'fullname',_0x5316('0x76'),_0x5316('0x77')],'raw':!![]});}return null;})[_0x5316('0x21')](function(_0x40ad73){if(!_0x40ad73)return null;_0x5b8857[_0x5316('0x2a')]['agent']=_0x40ad73;return _0x5b8857;})[_0x5316('0x21')](function(_0x24990f){if(_0x24990f){_0x24990f[_0x5316('0x2a')]['interface']=util[_0x5316('0x68')]('SIP/%s',_0x3ec5e4[_0x5316('0x5f')]['name']);_0x24990f['message'][_0x5316('0x7b')]=_0x5b8857[_0x5316('0x7b')];_0x24990f[_0x5316('0x2a')][_0x5316('0x7c')]=_0x5b8857[_0x5316('0x7b')];_0x24990f['message'][_0x5316('0x7d')]=_0x5316('0x82');respondWithRpcPromise('EventManager',_0x5316('0x7f'),{'event':'rejectmessage','message':_[_0x5316('0x4e')](_0x5b8857[_0x5316('0x2a')],JSON[_0x5316('0x81')](_0x5b8857[_0x5316('0x6a')][_0x5316('0x89')]))},client9002);return _0x5b8857;}return null;})[_0x5316('0x21')](respondWithResult(_0x5e7f02,null))[_0x5316('0x2c')](handleError(_0x5e7f02,null));};
\ No newline at end of file
+var _0x7fd1=['describe','accept','acceptMessage','reject','chat','UserId','agent','get','ChatInteractionId','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','fullname','email','format','SIP/%s','channel','event','rejectmessage','parse','formData','util','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','chat-interactions','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','index','map','ChatMessage','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','rows','catch','show','rawAttributes','include','options','find','create','body'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x7fd1,0x80));var _0x17fd=function(_0x247002,_0x5b873e){_0x247002=_0x247002-0x0;var _0x1bc7f5=_0x7fd1[_0x247002];return _0x1bc7f5;};'use strict';var util=require(_0x17fd('0x0'));var _=require('lodash');var Redis=require(_0x17fd('0x1'));var interactionService=require(_0x17fd('0x2'));var qs=require(_0x17fd('0x3'));var logger=require(_0x17fd('0x4'))(_0x17fd('0x5'));var config=require(_0x17fd('0x6'));var db=require(_0x17fd('0x7'))['db'];config['redis']=_[_0x17fd('0x8')](config[_0x17fd('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x17fd('0xa'))(new Redis(config[_0x17fd('0x9')]));require(_0x17fd('0xb'))[_0x17fd('0xc')](socket);var jayson=require(_0x17fd('0xd'));var client=jayson['client'][_0x17fd('0xe')]({'port':0x232c});var client9002=jayson['client'][_0x17fd('0xe')]({'port':0x232a});var interaction_log=require(_0x17fd('0x4'))(_0x17fd('0xf'));function respondWithRpcPromise(_0x453b31,_0x19d743,_0x345e77,_0x258fbe){return new Promise(function(_0x106bcc,_0x3594d6){var _0x1f2c29=_0x258fbe||client;return _0x1f2c29[_0x17fd('0x10')](_0x453b31,_0x345e77)['then'](function(_0x234d6f){logger[_0x17fd('0x11')](_0x17fd('0x12'),_0x19d743,_0x17fd('0x13'));logger['debug'](_0x17fd('0x14'),_0x19d743,_0x17fd('0x13'),JSON[_0x17fd('0x15')](_0x234d6f));if(_0x234d6f[_0x17fd('0x16')]){if(_0x234d6f[_0x17fd('0x16')][_0x17fd('0x17')]===0x1f4){logger[_0x17fd('0x16')](_0x17fd('0x12'),_0x19d743,_0x234d6f[_0x17fd('0x16')][_0x17fd('0x18')]);return _0x3594d6(_0x234d6f[_0x17fd('0x16')][_0x17fd('0x18')]);}logger[_0x17fd('0x16')](_0x17fd('0x12'),_0x19d743,_0x234d6f[_0x17fd('0x16')][_0x17fd('0x18')]);return _0x106bcc(_0x234d6f[_0x17fd('0x16')][_0x17fd('0x18')]);}else{logger[_0x17fd('0x11')](_0x17fd('0x12'),_0x19d743,_0x17fd('0x13'));_0x106bcc(_0x234d6f['result'][_0x17fd('0x18')]);}})['catch'](function(_0x5dc16a){logger[_0x17fd('0x16')](_0x17fd('0x12'),_0x19d743,_0x5dc16a);_0x3594d6(_0x5dc16a);});});}function respondWithResult(_0x2a6476,_0x270cb0){_0x270cb0=_0x270cb0||0xc8;return function(_0x3b4458){if(_0x3b4458){return _0x2a6476[_0x17fd('0x19')](_0x270cb0)[_0x17fd('0x1a')](_0x3b4458);}};}function respondWithFilteredResult(_0x35a823,_0x502f96){return function(_0x3625e6){if(_0x3625e6){var _0x2c0ea0=typeof _0x502f96[_0x17fd('0x1b')]===_0x17fd('0x1c')&&typeof _0x502f96[_0x17fd('0x1d')]===_0x17fd('0x1c');var _0x46692b=_0x3625e6['count'];var _0x1b5d67=_0x2c0ea0?0x0:_0x502f96[_0x17fd('0x1b')];var _0x119c62=_0x2c0ea0?_0x3625e6[_0x17fd('0x1e')]:_0x502f96[_0x17fd('0x1b')]+_0x502f96[_0x17fd('0x1d')];var _0x11a76c;if(_0x119c62>=_0x46692b){_0x119c62=_0x46692b;_0x11a76c=0xc8;}else{_0x11a76c=0xce;}_0x35a823['status'](_0x11a76c);return _0x35a823[_0x17fd('0x1f')](_0x17fd('0x20'),_0x1b5d67+'-'+_0x119c62+'/'+_0x46692b)['json'](_0x3625e6);}return null;};}function saveUpdates(_0x33545c){return function(_0x5a8dff){if(_0x5a8dff){return _0x5a8dff[_0x17fd('0x21')](_0x33545c)[_0x17fd('0x22')](function(_0xaba446){return _0xaba446;});}return null;};}function removeEntity(_0x26c378){return function(_0xebe920){if(_0xebe920){return _0xebe920[_0x17fd('0x23')]()[_0x17fd('0x22')](function(){_0x26c378['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1737e7){return function(_0x46b886){if(!_0x46b886){_0x1737e7[_0x17fd('0x24')](0x194);}return _0x46b886;};}function handleError(_0x1b82ad,_0xcc30f8){_0xcc30f8=_0xcc30f8||0x1f4;return function(_0x3a08d8){logger[_0x17fd('0x16')](_0x3a08d8[_0x17fd('0x25')]);if(_0x3a08d8['name']){delete _0x3a08d8[_0x17fd('0x26')];}_0x1b82ad[_0x17fd('0x19')](_0xcc30f8)['send'](_0x3a08d8);};}exports[_0x17fd('0x27')]=function(_0x5d6a4b,_0x4ed749){var _0x439591={},_0x240a1a={},_0x2b8693={'count':0x0,'rows':[]};var _0x33e59f=_[_0x17fd('0x28')](db[_0x17fd('0x29')]['rawAttributes'],function(_0x3bac69){return{'name':_0x3bac69['fieldName'],'type':_0x3bac69[_0x17fd('0x2a')][_0x17fd('0x2b')]};});_0x240a1a[_0x17fd('0x2c')]=_['map'](_0x33e59f,_0x17fd('0x26'));_0x240a1a[_0x17fd('0x2d')]=_[_0x17fd('0x2e')](_0x5d6a4b['query']);_0x240a1a['filters']=_[_0x17fd('0x2f')](_0x240a1a[_0x17fd('0x2c')],_0x240a1a[_0x17fd('0x2d')]);_0x439591[_0x17fd('0x30')]=_[_0x17fd('0x2f')](_0x240a1a[_0x17fd('0x2c')],qs[_0x17fd('0x31')](_0x5d6a4b[_0x17fd('0x2d')][_0x17fd('0x31')]));_0x439591['attributes']=_0x439591[_0x17fd('0x30')]['length']?_0x439591[_0x17fd('0x30')]:_0x240a1a[_0x17fd('0x2c')];if(!_0x5d6a4b[_0x17fd('0x2d')][_0x17fd('0x32')](_0x17fd('0x33'))){_0x439591[_0x17fd('0x1d')]=qs['limit'](_0x5d6a4b[_0x17fd('0x2d')][_0x17fd('0x1d')]);_0x439591[_0x17fd('0x1b')]=qs[_0x17fd('0x1b')](_0x5d6a4b['query'][_0x17fd('0x1b')]);}_0x439591[_0x17fd('0x34')]=qs[_0x17fd('0x35')](_0x5d6a4b['query']['sort']);_0x439591[_0x17fd('0x36')]=qs[_0x17fd('0x37')](_[_0x17fd('0x38')](_0x5d6a4b['query'],_0x240a1a[_0x17fd('0x37')]),_0x33e59f);if(_0x5d6a4b[_0x17fd('0x2d')][_0x17fd('0x39')]){_0x439591[_0x17fd('0x36')]=_['merge'](_0x439591[_0x17fd('0x36')],{'$or':_[_0x17fd('0x28')](_0x33e59f,function(_0x3bb54b){if(_0x3bb54b[_0x17fd('0x2a')]!==_0x17fd('0x3a')){var _0x5d3491={};_0x5d3491[_0x3bb54b['name']]={'$like':'%'+_0x5d6a4b[_0x17fd('0x2d')][_0x17fd('0x39')]+'%'};return _0x5d3491;}})});}_0x439591=_[_0x17fd('0x3b')]({},_0x439591,_0x5d6a4b['options']);var _0x1e6e24={'where':_0x439591['where']};return db[_0x17fd('0x29')]['count'](_0x1e6e24)[_0x17fd('0x22')](function(_0xee0c27){_0x2b8693['count']=_0xee0c27;if(_0x5d6a4b[_0x17fd('0x2d')][_0x17fd('0x3c')]){_0x439591['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x439591);})[_0x17fd('0x22')](function(_0x4fc953){_0x2b8693[_0x17fd('0x3d')]=_0x4fc953;return _0x2b8693;})[_0x17fd('0x22')](respondWithFilteredResult(_0x4ed749,_0x439591))[_0x17fd('0x3e')](handleError(_0x4ed749,null));};exports[_0x17fd('0x3f')]=function(_0x144d4f,_0x5bd79f){var _0x199d2d={'raw':!![],'where':{'id':_0x144d4f['params']['id']}},_0x3b4102={};_0x3b4102[_0x17fd('0x2c')]=_[_0x17fd('0x2e')](db[_0x17fd('0x29')][_0x17fd('0x40')]);_0x3b4102[_0x17fd('0x2d')]=_[_0x17fd('0x2e')](_0x144d4f[_0x17fd('0x2d')]);_0x3b4102[_0x17fd('0x37')]=_[_0x17fd('0x2f')](_0x3b4102[_0x17fd('0x2c')],_0x3b4102['query']);_0x199d2d[_0x17fd('0x30')]=_[_0x17fd('0x2f')](_0x3b4102['model'],qs[_0x17fd('0x31')](_0x144d4f[_0x17fd('0x2d')][_0x17fd('0x31')]));_0x199d2d[_0x17fd('0x30')]=_0x199d2d[_0x17fd('0x30')]['length']?_0x199d2d[_0x17fd('0x30')]:_0x3b4102[_0x17fd('0x2c')];if(_0x144d4f['query'][_0x17fd('0x3c')]){_0x199d2d[_0x17fd('0x41')]=[{'all':!![]}];}_0x199d2d=_['merge']({},_0x199d2d,_0x144d4f[_0x17fd('0x42')]);return db[_0x17fd('0x29')][_0x17fd('0x43')](_0x199d2d)[_0x17fd('0x22')](handleEntityNotFound(_0x5bd79f,null))[_0x17fd('0x22')](respondWithResult(_0x5bd79f,null))[_0x17fd('0x3e')](handleError(_0x5bd79f,null));};exports[_0x17fd('0x44')]=function(_0x2663d2,_0x4cc307){return db[_0x17fd('0x29')][_0x17fd('0x44')](_0x2663d2[_0x17fd('0x45')],{})[_0x17fd('0x22')](respondWithResult(_0x4cc307,0xc9))['catch'](handleError(_0x4cc307,null));};exports[_0x17fd('0x21')]=function(_0x397086,_0x4dfb8f){if(_0x397086[_0x17fd('0x45')]['id']){delete _0x397086['body']['id'];}return db[_0x17fd('0x29')][_0x17fd('0x43')]({'where':{'id':_0x397086['params']['id']}})[_0x17fd('0x22')](handleEntityNotFound(_0x4dfb8f,null))[_0x17fd('0x22')](saveUpdates(_0x397086[_0x17fd('0x45')],null))[_0x17fd('0x22')](respondWithResult(_0x4dfb8f,null))[_0x17fd('0x3e')](handleError(_0x4dfb8f,null));};exports[_0x17fd('0x23')]=function(_0x438c8c,_0x4465ba){return db[_0x17fd('0x29')][_0x17fd('0x43')]({'where':{'id':_0x438c8c['params']['id']}})[_0x17fd('0x22')](handleEntityNotFound(_0x4465ba,null))['then'](removeEntity(_0x4465ba,null))[_0x17fd('0x3e')](handleError(_0x4465ba,null));};exports[_0x17fd('0x46')]=function(_0x4e4879,_0x3a9920){return db[_0x17fd('0x29')][_0x17fd('0x46')]()[_0x17fd('0x22')](respondWithResult(_0x3a9920,null))[_0x17fd('0x3e')](handleError(_0x3a9920,null));};exports[_0x17fd('0x47')]=function(_0x1aa8a9,_0x240c56){var _0x5e5f88='chat';return interactionService[_0x17fd('0x48')](_0x1aa8a9,_0x5e5f88)[_0x17fd('0x22')](respondWithResult(_0x240c56,null))[_0x17fd('0x3e')](handleError(_0x240c56,null));};exports[_0x17fd('0x49')]=function(_0x4973bd,_0x4ad3a7){var _0x567e95={'agent':{},'channel':_0x17fd('0x4a')};if(_0x4973bd[_0x17fd('0x45')]['id']){delete _0x4973bd[_0x17fd('0x45')]['id'];}_0x4973bd[_0x17fd('0x45')][_0x17fd('0x4b')]=_0x4973bd[_0x17fd('0x45')][_0x17fd('0x4b')]||_0x4973bd['user']['id'];_0x567e95[_0x17fd('0x4c')]['id']=_0x4973bd[_0x17fd('0x45')][_0x17fd('0x4b')];return db[_0x17fd('0x29')][_0x17fd('0x43')]({'where':{'id':_0x4973bd['params']['id'],'UserId':null}})[_0x17fd('0x22')](handleEntityNotFound(_0x4ad3a7,null))['then'](function(_0x105ac7){if(_0x105ac7){_0x567e95['message']=_0x105ac7[_0x17fd('0x4d')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x105ac7[_0x17fd('0x4e')]}});}return null;})[_0x17fd('0x22')](handleEntityNotFound(_0x4ad3a7,null))[_0x17fd('0x22')](function(_0x4a409d){if(_0x4a409d){_0x567e95[_0x17fd('0x4f')]=_0x4a409d[_0x17fd('0x4d')]({'plain':!![]});interaction_log['info'](_0x17fd('0x50'),_0x4973bd[_0x17fd('0x51')]['id'],_0x4973bd[_0x17fd('0x51')][_0x17fd('0x26')],_0x4973bd['user'][_0x17fd('0x52')],_0x567e95[_0x17fd('0x4f')]['id'],_0x4973bd[_0x17fd('0x45')]?JSON['stringify'](_0x4973bd[_0x17fd('0x45')]):'null');return respondWithRpcPromise(_0x17fd('0x53'),_0x17fd('0x54'),_0x567e95);}return null;})[_0x17fd('0x22')](function(_0x5b236e){var _0x1d6377=_0x17fd('0x55')+_0x5b236e[_0x17fd('0x18')]['ContactId'];return db['sequelize'][_0x17fd('0x2d')](_0x1d6377,{'type':db[_0x17fd('0x56')][_0x17fd('0x57')][_0x17fd('0x58')],'raw':!![]})[_0x17fd('0x22')](function(_0x2ee264){return _0x2ee264;});})[_0x17fd('0x22')](function(_0x4aa200){if(_0x4aa200){_0x567e95['message'][_0x17fd('0x59')]=_0x4aa200[0x0];if(!_0x4973bd['body'][_0x17fd('0x4b')])return;return db['User'][_0x17fd('0x43')]({'where':{'id':_0x4973bd['body'][_0x17fd('0x4b')],'role':_0x17fd('0x4c')},'attributes':['id','name',_0x17fd('0x5a'),_0x17fd('0x5b'),'internal'],'raw':!![]});}return null;})[_0x17fd('0x22')](function(_0x4075aa){if(!_0x4075aa)return null;_0x567e95[_0x17fd('0x18')][_0x17fd('0x4c')]=_0x4075aa;return _0x567e95;})[_0x17fd('0x22')](function(_0x49c0d4){if(_0x49c0d4){_0x49c0d4[_0x17fd('0x18')]['interface']=util[_0x17fd('0x5c')](_0x17fd('0x5d'),_0x4973bd[_0x17fd('0x51')][_0x17fd('0x26')]);_0x49c0d4[_0x17fd('0x18')][_0x17fd('0x5e')]=_0x567e95[_0x17fd('0x5e')];_0x49c0d4['message']['motionChannel']=_0x567e95[_0x17fd('0x5e')];_0x49c0d4[_0x17fd('0x18')][_0x17fd('0x5f')]=_0x17fd('0x49');respondWithRpcPromise('EventManager','EventManager',{'event':_0x17fd('0x60'),'message':_[_0x17fd('0x3b')](_0x567e95[_0x17fd('0x18')],JSON[_0x17fd('0x61')](_0x567e95[_0x17fd('0x4f')][_0x17fd('0x62')]))},client9002);return _0x567e95;}return null;})['then'](respondWithResult(_0x4ad3a7,null))['catch'](handleError(_0x4ad3a7,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index b45e778..eeffc36 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 _0xf006=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x43bfc3,_0x5dc8b8){var _0x3b6850=function(_0x203871){while(--_0x203871){_0x43bfc3['push'](_0x43bfc3['shift']());}};_0x3b6850(++_0x5dc8b8);}(_0xf006,0x1e4));var _0x6f00=function(_0x43551c,_0x4cf871){_0x43551c=_0x43551c-0x0;var _0x37594e=_0xf006[_0x43551c];return _0x37594e;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x6f00('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6f00('0x1')](0x0);var events={'afterCreate':_0x6f00('0x2'),'afterUpdate':_0x6f00('0x3'),'afterDestroy':'remove'};function emitEvent(_0x12b842){return function(_0xd00ceb,_0x3d6548,_0x2d80fa){ChatMessageEvents[_0x6f00('0x4')](_0x12b842+':'+_0xd00ceb['id'],_0xd00ceb);ChatMessageEvents['emit'](_0x12b842,_0xd00ceb);_0x2d80fa(null);};}for(var e in events){if(events[_0x6f00('0x5')](e)){var event=events[e];ChatMessage[_0x6f00('0x6')](e,emitEvent(event));}}module[_0x6f00('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x6b5a=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x4ef8c2,_0x5a4399){var _0x84f62=function(_0x5aa0df){while(--_0x5aa0df){_0x4ef8c2['push'](_0x4ef8c2['shift']());}};_0x84f62(++_0x5a4399);}(_0x6b5a,0x1d5));var _0xa6b5=function(_0x5d0a61,_0x3e866d){_0x5d0a61=_0x5d0a61-0x0;var _0x3a526f=_0x6b5a[_0x5d0a61];return _0x3a526f;};'use strict';var EventEmitter=require(_0xa6b5('0x0'));var ChatMessage=require(_0xa6b5('0x1'))['db'][_0xa6b5('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa6b5('0x3')](0x0);var events={'afterCreate':_0xa6b5('0x4'),'afterUpdate':_0xa6b5('0x5'),'afterDestroy':_0xa6b5('0x6')};function emitEvent(_0x4f4dce){return function(_0xd069c0,_0xc342fb,_0x27620c){ChatMessageEvents[_0xa6b5('0x7')](_0x4f4dce+':'+_0xd069c0['id'],_0xd069c0);ChatMessageEvents[_0xa6b5('0x7')](_0x4f4dce,_0xd069c0);_0x27620c(null);};}for(var e in events){if(events[_0xa6b5('0x8')](e)){var event=events[e];ChatMessage[_0xa6b5('0x9')](e,emitEvent(event));}}module[_0xa6b5('0xa')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 5c47fce..b20f246 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 _0x958f=['secret','UserId','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out'];(function(_0xc61db9,_0xe9447){var _0x1c6397=function(_0x107352){while(--_0x107352){_0xc61db9['push'](_0xc61db9['shift']());}};_0x1c6397(++_0xe9447);}(_0x958f,0x19f));var _0xf958=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x958f[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xf958('0x0'));var util=require('util');var logger=require(_0xf958('0x1'))('api');var moment=require(_0xf958('0x2'));var BPromise=require(_0xf958('0x3'));var rp=require(_0xf958('0x4'));var fs=require('fs');var path=require(_0xf958('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf958('0x6'));module[_0xf958('0x7')]=function(_0x1898d5,_0x399273){return _0x1898d5['define'](_0xf958('0x8'),attributes,{'tableName':_0xf958('0x9'),'paranoid':![],'indexes':[{'name':_0xf958('0xa'),'fields':[_0xf958('0xb')],'type':_0xf958('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57a600,_0x12aea1,_0x6b44f9){var _0x4e47fb=_0x1898d5[_0xf958('0xd')];var _0x39dda9=_0x57a600['get']({'plain':!![]});if(_0x39dda9[_0xf958('0xe')][_0xf958('0xf')]()==='in'||_0x39dda9[_0xf958('0xe')][_0xf958('0xf')]()===_0xf958('0x10')&&!_0x39dda9[_0xf958('0x11')]&&!_['isNil'](_0x39dda9[_0xf958('0x12')])){_0x4e47fb['ChatInteraction'][_0xf958('0x13')]({'where':{'id':_0x39dda9[_0xf958('0x14')]}})['then'](function(_0x3433f4){if(_0x3433f4){_0x3433f4[_0xf958('0x15')]({'lastMsgAt':_0x39dda9[_0xf958('0x16')],'lastMsgDirection':_0x39dda9[_0xf958('0xe')]['toLowerCase']()});}})[_0xf958('0x17')](function(_0x2e62f9){console[_0xf958('0x18')](_0x2e62f9);});}_0x6b44f9();}},'charset':_0xf958('0x19'),'collate':_0xf958('0x1a')});};
\ No newline at end of file
+var _0x6688=['../../config/logger','moment','request-promise','../../config/environment','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','toLowerCase','catch','error','utf8mb4','lodash','util'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0x6688,0x15d));var _0x8668=function(_0x42b691,_0x528f98){_0x42b691=_0x42b691-0x0;var _0x3e4b20=_0x6688[_0x42b691];return _0x3e4b20;};'use strict';var _=require(_0x8668('0x0'));var util=require(_0x8668('0x1'));var logger=require(_0x8668('0x2'))('api');var moment=require(_0x8668('0x3'));var BPromise=require('bluebird');var rp=require(_0x8668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8668('0x5'));var attributes=require('./chatMessage.attributes');module[_0x8668('0x6')]=function(_0x564391,_0x1dc92c){return _0x564391[_0x8668('0x7')](_0x8668('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x8668('0x9'),'fields':[_0x8668('0xa')],'type':_0x8668('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4241d4,_0x48ea44,_0x697997){var _0x1b3b9e=_0x564391[_0x8668('0xc')];var _0x402998=_0x4241d4[_0x8668('0xd')]({'plain':!![]});if(_0x402998['direction']['toLowerCase']()==='in'||_0x402998[_0x8668('0xe')]['toLowerCase']()==='out'&&!_0x402998[_0x8668('0xf')]&&!_[_0x8668('0x10')](_0x402998[_0x8668('0x11')])){_0x1b3b9e[_0x8668('0x12')]['findOne']({'where':{'id':_0x402998[_0x8668('0x13')]}})[_0x8668('0x14')](function(_0x139cde){if(_0x139cde){_0x139cde[_0x8668('0x15')]({'lastMsgAt':_0x402998[_0x8668('0x16')],'lastMsgDirection':_0x402998[_0x8668('0xe')][_0x8668('0x17')]()});}})[_0x8668('0x18')](function(_0x3b1ffe){console[_0x8668('0x19')](_0x3b1ffe);});}_0x697997();}},'charset':_0x8668('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 8a713cf..4e143a3 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 _0xa768=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatMessage','create','body','options','then','info','CreateChatMessage','stringify','util'];(function(_0xe959f3,_0x27c959){var _0xd2ee62=function(_0x2884ac){while(--_0x2884ac){_0xe959f3['push'](_0xe959f3['shift']());}};_0xd2ee62(++_0x27c959);}(_0xa768,0x1bb));var _0x8a76=function(_0x15efa6,_0xbd64f2){_0x15efa6=_0x15efa6-0x0;var _0x2b3752=_0xa768[_0x15efa6];return _0x2b3752;};'use strict';var _=require('lodash');var util=require(_0x8a76('0x0'));var moment=require(_0x8a76('0x1'));var BPromise=require(_0x8a76('0x2'));var rs=require(_0x8a76('0x3'));var fs=require('fs');var Redis=require(_0x8a76('0x4'));var db=require(_0x8a76('0x5'))['db'];var utils=require(_0x8a76('0x6'));var logger=require(_0x8a76('0x7'))(_0x8a76('0x8'));var config=require(_0x8a76('0x9'));var jayson=require(_0x8a76('0xa'));var client=jayson[_0x8a76('0xb')][_0x8a76('0xc')]({'port':0x232a});config[_0x8a76('0xd')]=_[_0x8a76('0xe')](config[_0x8a76('0xd')],{'host':_0x8a76('0xf'),'port':0x18eb});var socket=require(_0x8a76('0x10'))(new Redis(config[_0x8a76('0xd')]));require(_0x8a76('0x11'))[_0x8a76('0x12')](socket);function respondWithRpcPromise(_0x55178c,_0x427673,_0xe4b9f5){return new BPromise(function(_0x2ecabc,_0x59dace){return client[_0x8a76('0x13')](_0x55178c,_0xe4b9f5)['then'](function(_0x24ff78){logger['info'](_0x8a76('0x14'),_0x427673,_0x8a76('0x15'));logger[_0x8a76('0x16')](_0x8a76('0x17'),_0x427673,_0x8a76('0x15'),JSON['stringify'](_0x24ff78));if(_0x24ff78[_0x8a76('0x18')]){if(_0x24ff78[_0x8a76('0x18')][_0x8a76('0x19')]===0x1f4){logger[_0x8a76('0x18')](_0x8a76('0x14'),_0x427673,_0x24ff78[_0x8a76('0x18')]['message']);return _0x59dace(_0x24ff78[_0x8a76('0x18')][_0x8a76('0x1a')]);}logger['error'](_0x8a76('0x14'),_0x427673,_0x24ff78['error'][_0x8a76('0x1a')]);return _0x2ecabc(_0x24ff78[_0x8a76('0x18')][_0x8a76('0x1a')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x427673,_0x8a76('0x15'));_0x2ecabc(_0x24ff78[_0x8a76('0x1b')][_0x8a76('0x1a')]);}})[_0x8a76('0x1c')](function(_0x768043){logger['error']('ChatMessage,\x20%s,\x20%s',_0x427673,_0x768043);_0x59dace(_0x768043);});});}exports['CreateChatMessage']=function(_0xff238d){var _0x12802e=this;return new Promise(function(_0x43a0ef,_0x1725a4){return db[_0x8a76('0x1d')][_0x8a76('0x1e')](_0xff238d[_0x8a76('0x1f')],{'raw':_0xff238d[_0x8a76('0x20')]?_0xff238d[_0x8a76('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x8a76('0x21')](function(_0x20f6de){logger[_0x8a76('0x22')]('CreateChatMessage',_0xff238d);logger[_0x8a76('0x16')](_0x8a76('0x23'),_0xff238d,JSON[_0x8a76('0x24')](_0x20f6de));_0x43a0ef(_0x20f6de);})[_0x8a76('0x1c')](function(_0x5bc43a){logger['error'](_0x8a76('0x23'),_0x5bc43a[_0x8a76('0x1a')],_0xff238d);_0x1725a4(_0x12802e[_0x8a76('0x18')](0x1f4,_0x5bc43a['message']));});});};
\ No newline at end of file
+var _0x6066=['ChatMessage,\x20%s,\x20%s,\x20%s','error','ChatMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateChatMessage','ChatMessage','body','options','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','debug'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x6066,0x1c6));var _0x6606=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0x6066[_0x2bd88d];return _0x5516d4;};'use strict';var _=require(_0x6606('0x0'));var util=require('util');var moment=require(_0x6606('0x1'));var BPromise=require(_0x6606('0x2'));var rs=require(_0x6606('0x3'));var fs=require('fs');var Redis=require(_0x6606('0x4'));var db=require(_0x6606('0x5'))['db'];var utils=require(_0x6606('0x6'));var logger=require(_0x6606('0x7'))(_0x6606('0x8'));var config=require(_0x6606('0x9'));var jayson=require(_0x6606('0xa'));var client=jayson['client'][_0x6606('0xb')]({'port':0x232a});config[_0x6606('0xc')]=_[_0x6606('0xd')](config[_0x6606('0xc')],{'host':_0x6606('0xe'),'port':0x18eb});var socket=require(_0x6606('0xf'))(new Redis(config[_0x6606('0xc')]));require(_0x6606('0x10'))[_0x6606('0x11')](socket);function respondWithRpcPromise(_0x4cda3b,_0x32e6cb,_0x172c04){return new BPromise(function(_0x1786fe,_0x10e024){return client[_0x6606('0x12')](_0x4cda3b,_0x172c04)[_0x6606('0x13')](function(_0x359ce8){logger[_0x6606('0x14')]('ChatMessage,\x20%s,\x20%s',_0x32e6cb,'request\x20sent');logger[_0x6606('0x15')](_0x6606('0x16'),_0x32e6cb,'request\x20sent',JSON['stringify'](_0x359ce8));if(_0x359ce8[_0x6606('0x17')]){if(_0x359ce8['error']['code']===0x1f4){logger[_0x6606('0x17')](_0x6606('0x18'),_0x32e6cb,_0x359ce8[_0x6606('0x17')][_0x6606('0x19')]);return _0x10e024(_0x359ce8['error'][_0x6606('0x19')]);}logger[_0x6606('0x17')](_0x6606('0x18'),_0x32e6cb,_0x359ce8[_0x6606('0x17')]['message']);return _0x1786fe(_0x359ce8[_0x6606('0x17')][_0x6606('0x19')]);}else{logger[_0x6606('0x14')]('ChatMessage,\x20%s,\x20%s',_0x32e6cb,_0x6606('0x1a'));_0x1786fe(_0x359ce8[_0x6606('0x1b')][_0x6606('0x19')]);}})[_0x6606('0x1c')](function(_0xdeba1a){logger[_0x6606('0x17')](_0x6606('0x18'),_0x32e6cb,_0xdeba1a);_0x10e024(_0xdeba1a);});});}exports[_0x6606('0x1d')]=function(_0x22bb78){var _0x201e26=this;return new Promise(function(_0x575267,_0x314c9b){return db[_0x6606('0x1e')]['create'](_0x22bb78[_0x6606('0x1f')],{'raw':_0x22bb78[_0x6606('0x20')]?_0x22bb78[_0x6606('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5c5046){logger[_0x6606('0x14')](_0x6606('0x1d'),_0x22bb78);logger[_0x6606('0x15')](_0x6606('0x1d'),_0x22bb78,JSON[_0x6606('0x21')](_0x5c5046));_0x575267(_0x5c5046);})[_0x6606('0x1c')](function(_0x5ce07c){logger['error'](_0x6606('0x1d'),_0x5ce07c[_0x6606('0x19')],_0x22bb78);_0x314c9b(_0x201e26[_0x6606('0x17')](0x1f4,_0x5ce07c[_0x6606('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index d2c1657..6f1db66 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 _0xe0c3=['removeListener','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var ChatMessageEvents=require(_0x3e0c('0x0'));var events=['save',_0x3e0c('0x1'),_0x3e0c('0x2')];function createListener(_0x3bb243,_0x41c0bf){return function(_0x27e01a){_0x41c0bf[_0x3e0c('0x3')](_0x3bb243,_0x27e01a);};}function removeListener(_0x31851c,_0x26c964){return function(){ChatMessageEvents[_0x3e0c('0x4')](_0x31851c,_0x26c964);};}exports['register']=function(_0x530ebf){for(var _0x163adf=0x0,_0x1e339a=events[_0x3e0c('0x5')];_0x163adf<_0x1e339a;_0x163adf++){var _0x243b5b=events[_0x163adf];var _0x29673d=createListener(_0x3e0c('0x6')+_0x243b5b,_0x530ebf);ChatMessageEvents['on'](_0x243b5b,_0x29673d);}};
\ No newline at end of file
+var _0xa63f=['./chatMessage.events','save','remove','update','emit','length'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa63f,0x1b6));var _0xfa63=function(_0x574d9b,_0x2063da){_0x574d9b=_0x574d9b-0x0;var _0x31d2a5=_0xa63f[_0x574d9b];return _0x31d2a5;};'use strict';var ChatMessageEvents=require(_0xfa63('0x0'));var events=[_0xfa63('0x1'),_0xfa63('0x2'),_0xfa63('0x3')];function createListener(_0x3103ba,_0x2bbc5a){return function(_0x401dbf){_0x2bbc5a[_0xfa63('0x4')](_0x3103ba,_0x401dbf);};}function removeListener(_0x37e644,_0x138518){return function(){ChatMessageEvents['removeListener'](_0x37e644,_0x138518);};}exports['register']=function(_0x20d4f6){for(var _0x41efce=0x0,_0xb35bc5=events[_0xfa63('0x5')];_0x41efce<_0xb35bc5;_0x41efce++){var _0x486050=events[_0x41efce];var _0x505e1a=createListener('chatMessage:'+_0x486050,_0x20d4f6);ChatMessageEvents['on'](_0x486050,_0x505e1a);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 63e0d70..d84e9b7 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 _0x7445=['accept','/:id/reject','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','chat','put','update','/:id/accept'];(function(_0x7d2629,_0x4f5a68){var _0x4fe320=function(_0x3151ae){while(--_0x3151ae){_0x7d2629['push'](_0x7d2629['shift']());}};_0x4fe320(++_0x4f5a68);}(_0x7445,0x76));var _0x5744=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x7445[_0x23b655];return _0x364b32;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5744('0x0'));var timeout=require(_0x5744('0x1'));var express=require(_0x5744('0x2'));var router=express[_0x5744('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5744('0x4'));var interaction=require(_0x5744('0x5'));var config=require(_0x5744('0x6'));var controller=require(_0x5744('0x7'));router[_0x5744('0x8')]('/',auth[_0x5744('0x9')](),controller[_0x5744('0xa')]);router[_0x5744('0x8')](_0x5744('0xb'),auth[_0x5744('0x9')](),controller['describe']);router['get'](_0x5744('0xc'),auth[_0x5744('0x9')](),controller[_0x5744('0xd')]);router[_0x5744('0xe')]('/',auth[_0x5744('0x9')](),interaction[_0x5744('0xf')](_0x5744('0x10'),'chatmessage:create'),controller['create']);router[_0x5744('0x11')](_0x5744('0xc'),controller[_0x5744('0x12')]);router[_0x5744('0x11')](_0x5744('0x13'),auth[_0x5744('0x9')](),controller[_0x5744('0x14')]);router[_0x5744('0x11')](_0x5744('0x15'),auth[_0x5744('0x9')](),controller['reject']);router['delete'](_0x5744('0xc'),auth[_0x5744('0x9')](),controller[_0x5744('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xa703=['/:id','show','post','chat','create','put','update','/:id/reject','reject','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','isAuthenticated','get','/describe'];(function(_0x5f484c,_0x7172c2){var _0xd0f884=function(_0x182b02){while(--_0x182b02){_0x5f484c['push'](_0x5f484c['shift']());}};_0xd0f884(++_0x7172c2);}(_0xa703,0x9d));var _0x3a70=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xa703[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x3a70('0x0'));var util=require(_0x3a70('0x1'));var path=require('path');var timeout=require(_0x3a70('0x2'));var express=require(_0x3a70('0x3'));var router=express[_0x3a70('0x4')]();var fs_extra=require(_0x3a70('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a70('0x6'));var controller=require(_0x3a70('0x7'));router['get']('/',auth[_0x3a70('0x8')](),controller['index']);router[_0x3a70('0x9')](_0x3a70('0xa'),auth[_0x3a70('0x8')](),controller['describe']);router[_0x3a70('0x9')](_0x3a70('0xb'),auth['isAuthenticated'](),controller[_0x3a70('0xc')]);router[_0x3a70('0xd')]('/',auth[_0x3a70('0x8')](),interaction['tracked'](_0x3a70('0xe'),'chatmessage:create'),controller[_0x3a70('0xf')]);router[_0x3a70('0x10')](_0x3a70('0xb'),controller[_0x3a70('0x11')]);router[_0x3a70('0x10')]('/:id/accept',auth[_0x3a70('0x8')](),controller['accept']);router[_0x3a70('0x10')](_0x3a70('0x12'),auth['isAuthenticated'](),controller[_0x3a70('0x13')]);router['delete'](_0x3a70('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3a70('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 4755806..b4c0baa 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0xc590cd,_0x384edb){var _0x5e553c=function(_0x1bfdb2){while(--_0x1bfdb2){_0xc590cd['push'](_0xc590cd['shift']());}};_0x5e553c(++_0x384edb);}(_0xdb28,0x106));var _0x8db2=function(_0x2cdbcc,_0x2cea2b){_0x2cdbcc=_0x2cdbcc-0x0;var _0x412c6b=_0xdb28[_0x2cdbcc];return _0x412c6b;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x46534b,_0x3f6396){var _0x3237e1=function(_0x5b7012){while(--_0x5b7012){_0x46534b['push'](_0x46534b['shift']());}};_0x3237e1(++_0x3f6396);}(_0x5f2f,0x73));var _0xf5f2=function(_0x240f11,_0x1e5f12){_0x240f11=_0x240f11-0x0;var _0x1495e1=_0x5f2f[_0x240f11];return _0x1495e1;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 2f4aa3b..803b701 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x7a54,0x106));var _0x47a5=function(_0x2d18af,_0x2303e3){_0x2d18af=_0x2d18af-0x0;var _0x2f6355=_0x7a54[_0x2d18af];return _0x2f6355;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1a4f19,_0x21f778){var _0x34ee21=function(_0x5b9b7e){while(--_0x5b9b7e){_0x1a4f19['push'](_0x1a4f19['shift']());}};_0x34ee21(++_0x21f778);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 904fad7..cf6bc04 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 _0x06f8=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','save'];(function(_0x48aeec,_0xb2caca){var _0x581d1b=function(_0x31c8b2){while(--_0x31c8b2){_0x48aeec['push'](_0x48aeec['shift']());}};_0x581d1b(++_0xb2caca);}(_0x06f8,0x178));var _0x806f=function(_0x2035ef,_0x3f7d39){_0x2035ef=_0x2035ef-0x0;var _0x86c909=_0x06f8[_0x2035ef];return _0x86c909;};'use strict';var EventEmitter=require(_0x806f('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x806f('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x806f('0x2')](0x0);var events={'afterCreate':_0x806f('0x3'),'afterUpdate':_0x806f('0x4'),'afterDestroy':_0x806f('0x5')};function emitEvent(_0x44ed56){return function(_0x16d618,_0x40e69f,_0x29f185){ChatOfflineMessageEvents[_0x806f('0x6')](_0x44ed56+':'+_0x16d618['id'],_0x16d618);ChatOfflineMessageEvents[_0x806f('0x6')](_0x44ed56,_0x16d618);_0x29f185(null);};}for(var e in events){if(events[_0x806f('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x806f('0x8')](e,emitEvent(event));}}module[_0x806f('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xcb41=['../../mysqldb','ChatOfflineMessage','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x4b241f,_0x1dbb4d){var _0x7fe129=function(_0x2e4dfe){while(--_0x2e4dfe){_0x4b241f['push'](_0x4b241f['shift']());}};_0x7fe129(++_0x1dbb4d);}(_0xcb41,0x1df));var _0x1cb4=function(_0x42f6f8,_0x2bb249){_0x42f6f8=_0x42f6f8-0x0;var _0x1ee088=_0xcb41[_0x42f6f8];return _0x1ee088;};'use strict';var EventEmitter=require(_0x1cb4('0x0'));var ChatOfflineMessage=require(_0x1cb4('0x1'))['db'][_0x1cb4('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1cb4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1cb4('0x4'),'afterDestroy':'remove'};function emitEvent(_0xb12e88){return function(_0x31d7b5,_0x19b235,_0x6ef253){ChatOfflineMessageEvents[_0x1cb4('0x5')](_0xb12e88+':'+_0x31d7b5['id'],_0x31d7b5);ChatOfflineMessageEvents[_0x1cb4('0x5')](_0xb12e88,_0x31d7b5);_0x6ef253(null);};}for(var e in events){if(events[_0x1cb4('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x1cb4('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 674859a..c9b78ba 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 _0xdb3c=['utf8mb4_unicode_ci','exports','define','chat_offline_messages','utf8mb4'];(function(_0x4ac424,_0x554b5d){var _0xe1b890=function(_0x5e85c4){while(--_0x5e85c4){_0x4ac424['push'](_0x4ac424['shift']());}};_0xe1b890(++_0x554b5d);}(_0xdb3c,0x1d7));var _0xcdb3=function(_0x3dd3bc,_0x32950b){_0x3dd3bc=_0x3dd3bc-0x0;var _0x172373=_0xdb3c[_0x3dd3bc];return _0x172373;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xcdb3('0x0')]=function(_0x4a6bd8){return _0x4a6bd8[_0xcdb3('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0xcdb3('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcdb3('0x3'),'collate':_0xcdb3('0x4')});};
\ No newline at end of file
+var _0x2d38=['utf8mb4_unicode_ci','define','ChatOfflineMessage','utf8mb4'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x2d38,0x1b1));var _0x82d3=function(_0x169432,_0x130a1b){_0x169432=_0x169432-0x0;var _0x3bf91c=_0x2d38[_0x169432];return _0x3bf91c;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x82bc74){return _0x82bc74[_0x82d3('0x0')](_0x82d3('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x82d3('0x2'),'collate':_0x82d3('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 0ef07c6..ee58c89 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 _0xb905=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x34bf0e,_0x1485c9){var _0x54ee7b=function(_0x212d55){while(--_0x212d55){_0x34bf0e['push'](_0x34bf0e['shift']());}};_0x54ee7b(++_0x1485c9);}(_0xb905,0xa7));var _0x5b90=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xb905[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x5b90('0x0'));var util=require('util');var moment=require(_0x5b90('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b90('0x2'));var fs=require('fs');var Redis=require(_0x5b90('0x3'));var db=require(_0x5b90('0x4'))['db'];var utils=require(_0x5b90('0x5'));var logger=require(_0x5b90('0x6'))(_0x5b90('0x7'));var config=require(_0x5b90('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5b90('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x296cd0,_0x362fbb,_0x55f7cc){return new BPromise(function(_0xfe8529,_0x428eb9){return client['request'](_0x296cd0,_0x55f7cc)['then'](function(_0x3cff73){logger[_0x5b90('0xa')](_0x5b90('0xb'),_0x362fbb,_0x5b90('0xc'));logger[_0x5b90('0xd')](_0x5b90('0xe'),_0x362fbb,_0x5b90('0xc'),JSON[_0x5b90('0xf')](_0x3cff73));if(_0x3cff73[_0x5b90('0x10')]){if(_0x3cff73[_0x5b90('0x10')][_0x5b90('0x11')]===0x1f4){logger[_0x5b90('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x362fbb,_0x3cff73[_0x5b90('0x10')][_0x5b90('0x12')]);return _0x428eb9(_0x3cff73[_0x5b90('0x10')][_0x5b90('0x12')]);}logger['error'](_0x5b90('0xb'),_0x362fbb,_0x3cff73[_0x5b90('0x10')][_0x5b90('0x12')]);return _0xfe8529(_0x3cff73[_0x5b90('0x10')][_0x5b90('0x12')]);}else{logger[_0x5b90('0xa')](_0x5b90('0xb'),_0x362fbb,_0x5b90('0xc'));_0xfe8529(_0x3cff73[_0x5b90('0x13')][_0x5b90('0x12')]);}})[_0x5b90('0x14')](function(_0x14e829){logger[_0x5b90('0x10')](_0x5b90('0xb'),_0x362fbb,_0x14e829);_0x428eb9(_0x14e829);});});}
\ No newline at end of file
+var _0x943c=['stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x4f0ddb,_0x37c169){var _0x31c5c4=function(_0x3b06f3){while(--_0x3b06f3){_0x4f0ddb['push'](_0x4f0ddb['shift']());}};_0x31c5c4(++_0x37c169);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc943('0x0'));var util=require(_0xc943('0x1'));var moment=require(_0xc943('0x2'));var BPromise=require(_0xc943('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc943('0x4'))['db'];var utils=require(_0xc943('0x5'));var logger=require(_0xc943('0x6'))('rpc');var config=require(_0xc943('0x7'));var jayson=require(_0xc943('0x8'));var client=jayson[_0xc943('0x9')][_0xc943('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b73ad,_0x4091fd,_0x3f718f){return new BPromise(function(_0x56e665,_0x3ec7da){return client[_0xc943('0xb')](_0x1b73ad,_0x3f718f)[_0xc943('0xc')](function(_0x455eed){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x4091fd,_0xc943('0xd'));logger[_0xc943('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4091fd,'request\x20sent',JSON[_0xc943('0xf')](_0x455eed));if(_0x455eed[_0xc943('0x10')]){if(_0x455eed[_0xc943('0x10')][_0xc943('0x11')]===0x1f4){logger[_0xc943('0x10')](_0xc943('0x12'),_0x4091fd,_0x455eed['error'][_0xc943('0x13')]);return _0x3ec7da(_0x455eed[_0xc943('0x10')]['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x4091fd,_0x455eed[_0xc943('0x10')][_0xc943('0x13')]);return _0x56e665(_0x455eed['error'][_0xc943('0x13')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x4091fd,_0xc943('0xd'));_0x56e665(_0x455eed['result'][_0xc943('0x13')]);}})[_0xc943('0x14')](function(_0x1eb50a){logger[_0xc943('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4091fd,_0x1eb50a);_0x3ec7da(_0x1eb50a);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 6900f37..f094aa0 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 _0xaa0a=['../../components/auth/service','./chatOfflineMessage.controller','isAuthenticated','describe','get','post','create','put','/:id','update','delete','util','path','connect-timeout','express','fs-extra'];(function(_0x122290,_0x31c429){var _0x4be8a3=function(_0x4f0de5){while(--_0x4f0de5){_0x122290['push'](_0x122290['shift']());}};_0x4be8a3(++_0x31c429);}(_0xaa0a,0xeb));var _0xaaa0=function(_0x36f903,_0x98ddd8){_0x36f903=_0x36f903-0x0;var _0x5cbc0b=_0xaa0a[_0x36f903];return _0x5cbc0b;};'use strict';var multer=require('multer');var util=require(_0xaaa0('0x0'));var path=require(_0xaaa0('0x1'));var timeout=require(_0xaaa0('0x2'));var express=require(_0xaaa0('0x3'));var router=express['Router']();var fs_extra=require(_0xaaa0('0x4'));var auth=require(_0xaaa0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaaa0('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xaaa0('0x7')](),controller[_0xaaa0('0x8')]);router[_0xaaa0('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xaaa0('0xa')]('/',auth[_0xaaa0('0x7')](),controller[_0xaaa0('0xb')]);router[_0xaaa0('0xc')](_0xaaa0('0xd'),auth['isAuthenticated'](),controller[_0xaaa0('0xe')]);router[_0xaaa0('0xf')](_0xaaa0('0xd'),auth[_0xaaa0('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7637=['post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','describe','show'];(function(_0x151800,_0x7ab410){var _0x2ff45f=function(_0x124613){while(--_0x124613){_0x151800['push'](_0x151800['shift']());}};_0x2ff45f(++_0x7ab410);}(_0x7637,0x1c0));var _0x7763=function(_0x15efa6,_0xbd64f2){_0x15efa6=_0x15efa6-0x0;var _0x2b3752=_0x7637[_0x15efa6];return _0x2b3752;};'use strict';var multer=require(_0x7763('0x0'));var util=require(_0x7763('0x1'));var path=require('path');var timeout=require(_0x7763('0x2'));var express=require(_0x7763('0x3'));var router=express['Router']();var fs_extra=require(_0x7763('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7763('0x5'));var config=require('../../config/environment');var controller=require(_0x7763('0x6'));router['get']('/',auth[_0x7763('0x7')](),controller[_0x7763('0x8')]);router[_0x7763('0x9')]('/describe',auth[_0x7763('0x7')](),controller[_0x7763('0xa')]);router[_0x7763('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7763('0xb')]);router[_0x7763('0xc')]('/',auth[_0x7763('0x7')](),controller[_0x7763('0xd')]);router[_0x7763('0xe')]('/:id',auth[_0x7763('0x7')](),controller[_0x7763('0xf')]);router[_0x7763('0x10')](_0x7763('0x11'),auth[_0x7763('0x7')](),controller[_0x7763('0x12')]);module[_0x7763('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 71ad370..f749cdd 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 _0x7cee=['exports','STRING','ENUM','mouseOver','timeout','sequelize'];(function(_0x4a04de,_0x2e342c){var _0xbbe018=function(_0x39639c){while(--_0x39639c){_0x4a04de['push'](_0x4a04de['shift']());}};_0xbbe018(++_0x2e342c);}(_0x7cee,0x179));var _0xe7ce=function(_0x39d39d,_0x5586bd){_0x39d39d=_0x39d39d-0x0;var _0x577ac3=_0x7cee[_0x39d39d];return _0x577ac3;};'use strict';var Sequelize=require(_0xe7ce('0x0'));module[_0xe7ce('0x1')]={'name':{'type':Sequelize[_0xe7ce('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe7ce('0x3')](_0xe7ce('0x4'),_0xe7ce('0x5')),'defaultValue':_0xe7ce('0x4')},'selector':{'type':Sequelize[_0xe7ce('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x0269=['mouseOver','timeout','sequelize','ENUM'];(function(_0xe6830f,_0x420fff){var _0x57ad21=function(_0x38211c){while(--_0x38211c){_0xe6830f['push'](_0xe6830f['shift']());}};_0x57ad21(++_0x420fff);}(_0x0269,0x196));var _0x9026=function(_0x1f79e1,_0x240c24){_0x1f79e1=_0x1f79e1-0x0;var _0x5c60dd=_0x0269[_0x1f79e1];return _0x5c60dd;};'use strict';var Sequelize=require(_0x9026('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9026('0x1')](_0x9026('0x2'),_0x9026('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 161a670..8333c71 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 _0xbc17=['includeAll','merge','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length'];(function(_0x7714df,_0xf9787d){var _0x1e21a5=function(_0x49bf5c){while(--_0x49bf5c){_0x7714df['push'](_0x7714df['shift']());}};_0x1e21a5(++_0xf9787d);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x5b21eb,_0x540b6d){_0x5b21eb=_0x5b21eb-0x0;var _0x279c63=_0xbc17[_0x5b21eb];return _0x279c63;};'use strict';var emlformat=require(_0x7bc1('0x0'));var rimraf=require(_0x7bc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bc1('0x2'));var rp=require(_0x7bc1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7bc1('0x4'));var util=require(_0x7bc1('0x5'));var path=require('path');var sox=require(_0x7bc1('0x6'));var csv=require('to-csv');var ejs=require(_0x7bc1('0x7'));var fs=require('fs');var fs_extra=require(_0x7bc1('0x8'));var _=require(_0x7bc1('0x9'));var squel=require(_0x7bc1('0xa'));var crypto=require(_0x7bc1('0xb'));var jsforce=require(_0x7bc1('0xc'));var deskjs=require(_0x7bc1('0xd'));var toCsv=require(_0x7bc1('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7bc1('0xf'));var authService=require(_0x7bc1('0x10'));var qs=require(_0x7bc1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7bc1('0x12'));var logger=require(_0x7bc1('0x13'))(_0x7bc1('0x14'));var utils=require(_0x7bc1('0x15'));var config=require(_0x7bc1('0x16'));var licenseUtil=require(_0x7bc1('0x17'));var db=require(_0x7bc1('0x18'))['db'];function respondWithStatusCode(_0xb00dbd,_0x604f31){_0x604f31=_0x604f31||0xcc;return function(_0x54db30){if(_0x54db30){return _0xb00dbd[_0x7bc1('0x19')](_0x604f31);}return _0xb00dbd[_0x7bc1('0x1a')](_0x604f31)['end']();};}function respondWithResult(_0x34d427,_0x370c8b){_0x370c8b=_0x370c8b||0xc8;return function(_0x4bb73b){if(_0x4bb73b){return _0x34d427[_0x7bc1('0x1a')](_0x370c8b)[_0x7bc1('0x1b')](_0x4bb73b);}};}function respondWithFilteredResult(_0x48d35a,_0x10f5a9){return function(_0x26c89e){if(_0x26c89e){var _0x1eaf32=typeof _0x10f5a9[_0x7bc1('0x1c')]===_0x7bc1('0x1d')&&typeof _0x10f5a9['limit']===_0x7bc1('0x1d');var _0x47ab39=_0x26c89e[_0x7bc1('0x1e')];var _0x901465=_0x1eaf32?0x0:_0x10f5a9[_0x7bc1('0x1c')];var _0x22e6fd=_0x1eaf32?_0x26c89e[_0x7bc1('0x1e')]:_0x10f5a9[_0x7bc1('0x1c')]+_0x10f5a9[_0x7bc1('0x1f')];var _0x135025;if(_0x22e6fd>=_0x47ab39){_0x22e6fd=_0x47ab39;_0x135025=0xc8;}else{_0x135025=0xce;}_0x48d35a['status'](_0x135025);return _0x48d35a[_0x7bc1('0x20')](_0x7bc1('0x21'),_0x901465+'-'+_0x22e6fd+'/'+_0x47ab39)[_0x7bc1('0x1b')](_0x26c89e);}return null;};}function patchUpdates(_0x1ed10b){return function(_0x1d6674){try{jsonpatch['apply'](_0x1d6674,_0x1ed10b,!![]);}catch(_0x29276f){return BPromise['reject'](_0x29276f);}return _0x1d6674[_0x7bc1('0x22')]();};}function saveUpdates(_0x2e66c6,_0x3136aa){return function(_0x162efe){if(_0x162efe){return _0x162efe[_0x7bc1('0x23')](_0x2e66c6)['then'](function(_0x4b4a05){return _0x4b4a05;});}return null;};}function removeEntity(_0xb8a427,_0x306db7){return function(_0x48b09e){if(_0x48b09e){return _0x48b09e['destroy']()[_0x7bc1('0x24')](function(){_0xb8a427[_0x7bc1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e9b8a,_0x12ec4b){return function(_0x1e68c3){if(!_0x1e68c3){_0x1e9b8a[_0x7bc1('0x19')](0x194);}return _0x1e68c3;};}function handleError(_0x18e6ff,_0x2c8a0d){_0x2c8a0d=_0x2c8a0d||0x1f4;return function(_0x25d3a9){logger[_0x7bc1('0x25')](_0x25d3a9[_0x7bc1('0x26')]);if(_0x25d3a9[_0x7bc1('0x27')]){delete _0x25d3a9[_0x7bc1('0x27')];}_0x18e6ff[_0x7bc1('0x1a')](_0x2c8a0d)[_0x7bc1('0x28')](_0x25d3a9);};}exports[_0x7bc1('0x29')]=function(_0x58d79c,_0x1927ce){var _0xc2cd8b={'raw':!![],'where':{'id':_0x58d79c[_0x7bc1('0x2a')]['id']}},_0x26bf05={};_0x26bf05[_0x7bc1('0x2b')]=_[_0x7bc1('0x2c')](db[_0x7bc1('0x2d')][_0x7bc1('0x2e')]);_0x26bf05[_0x7bc1('0x2f')]=_[_0x7bc1('0x2c')](_0x58d79c[_0x7bc1('0x2f')]);_0x26bf05[_0x7bc1('0x30')]=_['intersection'](_0x26bf05[_0x7bc1('0x2b')],_0x26bf05[_0x7bc1('0x2f')]);_0xc2cd8b[_0x7bc1('0x31')]=_[_0x7bc1('0x32')](_0x26bf05[_0x7bc1('0x2b')],qs[_0x7bc1('0x33')](_0x58d79c[_0x7bc1('0x2f')]['fields']));_0xc2cd8b[_0x7bc1('0x31')]=_0xc2cd8b[_0x7bc1('0x31')][_0x7bc1('0x34')]?_0xc2cd8b[_0x7bc1('0x31')]:_0x26bf05['model'];if(_0x58d79c[_0x7bc1('0x2f')][_0x7bc1('0x35')]){_0xc2cd8b['include']=[{'all':!![]}];}_0xc2cd8b=_[_0x7bc1('0x36')]({},_0xc2cd8b,_0x58d79c['options']);return db['ChatProactiveAction'][_0x7bc1('0x37')](_0xc2cd8b)[_0x7bc1('0x24')](handleEntityNotFound(_0x1927ce,null))[_0x7bc1('0x24')](respondWithResult(_0x1927ce,null))[_0x7bc1('0x38')](handleError(_0x1927ce,null));};exports[_0x7bc1('0x39')]=function(_0x510bdb,_0x33c862){return db[_0x7bc1('0x2d')]['create'](_0x510bdb['body'],{})[_0x7bc1('0x24')](respondWithResult(_0x33c862,0xc9))['catch'](handleError(_0x33c862,null));};exports[_0x7bc1('0x23')]=function(_0x2e2cae,_0x3c1b53){if(_0x2e2cae[_0x7bc1('0x3a')]['id']){delete _0x2e2cae[_0x7bc1('0x3a')]['id'];}return db[_0x7bc1('0x2d')][_0x7bc1('0x37')]({'where':{'id':_0x2e2cae[_0x7bc1('0x2a')]['id']}})[_0x7bc1('0x24')](handleEntityNotFound(_0x3c1b53,null))[_0x7bc1('0x24')](saveUpdates(_0x2e2cae[_0x7bc1('0x3a')],null))[_0x7bc1('0x24')](respondWithResult(_0x3c1b53,null))[_0x7bc1('0x38')](handleError(_0x3c1b53,null));};exports[_0x7bc1('0x3b')]=function(_0x3e4344,_0x445f6c){return db[_0x7bc1('0x2d')][_0x7bc1('0x37')]({'where':{'id':_0x3e4344[_0x7bc1('0x2a')]['id']}})['then'](handleEntityNotFound(_0x445f6c,null))[_0x7bc1('0x24')](removeEntity(_0x445f6c,null))[_0x7bc1('0x38')](handleError(_0x445f6c,null));};
\ No newline at end of file
+var _0xa9b1=['count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','includeAll','merge','create','body','catch','find','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a9b('0x0'));var jsonpatch=require(_0x1a9b('0x1'));var rp=require(_0x1a9b('0x2'));var moment=require(_0x1a9b('0x3'));var BPromise=require(_0x1a9b('0x4'));var Mustache=require(_0x1a9b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1a9b('0x6'));var ejs=require(_0x1a9b('0x7'));var fs=require('fs');var fs_extra=require(_0x1a9b('0x8'));var _=require(_0x1a9b('0x9'));var squel=require(_0x1a9b('0xa'));var crypto=require(_0x1a9b('0xb'));var jsforce=require(_0x1a9b('0xc'));var deskjs=require(_0x1a9b('0xd'));var toCsv=require(_0x1a9b('0x6'));var querystring=require(_0x1a9b('0xe'));var Papa=require(_0x1a9b('0xf'));var Redis=require(_0x1a9b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a9b('0x11'));var hardwareService=require(_0x1a9b('0x12'));var logger=require(_0x1a9b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9b('0x14'));var db=require(_0x1a9b('0x15'))['db'];function respondWithStatusCode(_0x2c75cf,_0x11bf7e){_0x11bf7e=_0x11bf7e||0xcc;return function(_0x2c3170){if(_0x2c3170){return _0x2c75cf[_0x1a9b('0x16')](_0x11bf7e);}return _0x2c75cf['status'](_0x11bf7e)[_0x1a9b('0x17')]();};}function respondWithResult(_0x34f082,_0x245883){_0x245883=_0x245883||0xc8;return function(_0x53c725){if(_0x53c725){return _0x34f082[_0x1a9b('0x18')](_0x245883)[_0x1a9b('0x19')](_0x53c725);}};}function respondWithFilteredResult(_0x55a00d,_0x2a7d72){return function(_0x57ca87){if(_0x57ca87){var _0x439acd=typeof _0x2a7d72[_0x1a9b('0x1a')]===_0x1a9b('0x1b')&&typeof _0x2a7d72[_0x1a9b('0x1c')]===_0x1a9b('0x1b');var _0x20b8dc=_0x57ca87[_0x1a9b('0x1d')];var _0x205a0d=_0x439acd?0x0:_0x2a7d72[_0x1a9b('0x1a')];var _0x1281c2=_0x439acd?_0x57ca87['count']:_0x2a7d72[_0x1a9b('0x1a')]+_0x2a7d72[_0x1a9b('0x1c')];var _0x3df7d2;if(_0x1281c2>=_0x20b8dc){_0x1281c2=_0x20b8dc;_0x3df7d2=0xc8;}else{_0x3df7d2=0xce;}_0x55a00d[_0x1a9b('0x18')](_0x3df7d2);return _0x55a00d['set'](_0x1a9b('0x1e'),_0x205a0d+'-'+_0x1281c2+'/'+_0x20b8dc)[_0x1a9b('0x19')](_0x57ca87);}return null;};}function patchUpdates(_0x4b3cd3){return function(_0x23e327){try{jsonpatch[_0x1a9b('0x1f')](_0x23e327,_0x4b3cd3,!![]);}catch(_0x44cebf){return BPromise[_0x1a9b('0x20')](_0x44cebf);}return _0x23e327[_0x1a9b('0x21')]();};}function saveUpdates(_0x590568,_0x189e78){return function(_0x17b1dd){if(_0x17b1dd){return _0x17b1dd[_0x1a9b('0x22')](_0x590568)[_0x1a9b('0x23')](function(_0x36391a){return _0x36391a;});}return null;};}function removeEntity(_0x2e42f1,_0x28f937){return function(_0x488a33){if(_0x488a33){return _0x488a33[_0x1a9b('0x24')]()['then'](function(){_0x2e42f1[_0x1a9b('0x18')](0xcc)[_0x1a9b('0x17')]();});}};}function handleEntityNotFound(_0xad6541,_0x4e7234){return function(_0x213841){if(!_0x213841){_0xad6541[_0x1a9b('0x16')](0x194);}return _0x213841;};}function handleError(_0x1521f4,_0x181331){_0x181331=_0x181331||0x1f4;return function(_0x18c9dd){logger[_0x1a9b('0x25')](_0x18c9dd['stack']);if(_0x18c9dd[_0x1a9b('0x26')]){delete _0x18c9dd[_0x1a9b('0x26')];}_0x1521f4['status'](_0x181331)[_0x1a9b('0x27')](_0x18c9dd);};}exports[_0x1a9b('0x28')]=function(_0x5d70dc,_0x5d7e8c){var _0x3f8e98={'raw':!![],'where':{'id':_0x5d70dc['params']['id']}},_0x1d981e={};_0x1d981e[_0x1a9b('0x29')]=_[_0x1a9b('0x2a')](db[_0x1a9b('0x2b')][_0x1a9b('0x2c')]);_0x1d981e[_0x1a9b('0x2d')]=_[_0x1a9b('0x2a')](_0x5d70dc[_0x1a9b('0x2d')]);_0x1d981e['filters']=_[_0x1a9b('0x2e')](_0x1d981e[_0x1a9b('0x29')],_0x1d981e[_0x1a9b('0x2d')]);_0x3f8e98[_0x1a9b('0x2f')]=_[_0x1a9b('0x2e')](_0x1d981e[_0x1a9b('0x29')],qs[_0x1a9b('0x30')](_0x5d70dc[_0x1a9b('0x2d')][_0x1a9b('0x30')]));_0x3f8e98[_0x1a9b('0x2f')]=_0x3f8e98[_0x1a9b('0x2f')]['length']?_0x3f8e98['attributes']:_0x1d981e[_0x1a9b('0x29')];if(_0x5d70dc[_0x1a9b('0x2d')][_0x1a9b('0x31')]){_0x3f8e98['include']=[{'all':!![]}];}_0x3f8e98=_[_0x1a9b('0x32')]({},_0x3f8e98,_0x5d70dc['options']);return db[_0x1a9b('0x2b')]['find'](_0x3f8e98)[_0x1a9b('0x23')](handleEntityNotFound(_0x5d7e8c,null))[_0x1a9b('0x23')](respondWithResult(_0x5d7e8c,null))['catch'](handleError(_0x5d7e8c,null));};exports[_0x1a9b('0x33')]=function(_0x5f17e4,_0x917311){return db[_0x1a9b('0x2b')][_0x1a9b('0x33')](_0x5f17e4[_0x1a9b('0x34')],{})['then'](respondWithResult(_0x917311,0xc9))[_0x1a9b('0x35')](handleError(_0x917311,null));};exports[_0x1a9b('0x22')]=function(_0x26bcb6,_0x5ceda8){if(_0x26bcb6[_0x1a9b('0x34')]['id']){delete _0x26bcb6['body']['id'];}return db['ChatProactiveAction'][_0x1a9b('0x36')]({'where':{'id':_0x26bcb6[_0x1a9b('0x37')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x5ceda8,null))[_0x1a9b('0x23')](saveUpdates(_0x26bcb6[_0x1a9b('0x34')],null))[_0x1a9b('0x23')](respondWithResult(_0x5ceda8,null))[_0x1a9b('0x35')](handleError(_0x5ceda8,null));};exports['destroy']=function(_0x46f624,_0x230fc6){return db[_0x1a9b('0x2b')]['find']({'where':{'id':_0x46f624[_0x1a9b('0x37')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x230fc6,null))[_0x1a9b('0x23')](removeEntity(_0x230fc6,null))[_0x1a9b('0x35')](handleError(_0x230fc6,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 9342501..17335ef 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 _0x066b=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util'];(function(_0x546946,_0x31f1b9){var _0x5db2eb=function(_0x44fd3e){while(--_0x44fd3e){_0x546946['push'](_0x546946['shift']());}};_0x5db2eb(++_0x31f1b9);}(_0x066b,0x137));var _0xb066=function(_0x25e35c,_0x2f09b8){_0x25e35c=_0x25e35c-0x0;var _0x27dcc4=_0x066b[_0x25e35c];return _0x27dcc4;};'use strict';var _=require('lodash');var util=require(_0xb066('0x0'));var logger=require(_0xb066('0x1'))(_0xb066('0x2'));var moment=require('moment');var BPromise=require(_0xb066('0x3'));var rp=require(_0xb066('0x4'));var fs=require('fs');var path=require(_0xb066('0x5'));var rimraf=require(_0xb066('0x6'));var config=require(_0xb066('0x7'));var attributes=require(_0xb066('0x8'));module[_0xb066('0x9')]=function(_0x47123a,_0x21147d){return _0x47123a[_0xb066('0xa')](_0xb066('0xb'),attributes,{'tableName':_0xb066('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3422=['rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4e85be,_0x1193a9){var _0x22eb71=function(_0x31cde9){while(--_0x31cde9){_0x4e85be['push'](_0x4e85be['shift']());}};_0x22eb71(++_0x1193a9);}(_0x3422,0x117));var _0x2342=function(_0x37ee12,_0x47fbdf){_0x37ee12=_0x37ee12-0x0;var _0x4ad135=_0x3422[_0x37ee12];return _0x4ad135;};'use strict';var _=require(_0x2342('0x0'));var util=require(_0x2342('0x1'));var logger=require(_0x2342('0x2'))(_0x2342('0x3'));var moment=require(_0x2342('0x4'));var BPromise=require(_0x2342('0x5'));var rp=require(_0x2342('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2342('0x7'));var config=require(_0x2342('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x2342('0x9')]=function(_0x1bb84e,_0x4b03ad){return _0x1bb84e[_0x2342('0xa')](_0x2342('0xb'),attributes,{'tableName':_0x2342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index f7339a4..50bcba2 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 _0x3470=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2406b4,_0x2f9771){var _0x7f3752=function(_0x583971){while(--_0x583971){_0x2406b4['push'](_0x2406b4['shift']());}};_0x7f3752(++_0x2f9771);}(_0x3470,0xda));var _0x0347=function(_0x51a84b,_0x50a646){_0x51a84b=_0x51a84b-0x0;var _0xda27f0=_0x3470[_0x51a84b];return _0xda27f0;};'use strict';var _=require(_0x0347('0x0'));var util=require(_0x0347('0x1'));var moment=require(_0x0347('0x2'));var BPromise=require(_0x0347('0x3'));var rs=require(_0x0347('0x4'));var fs=require('fs');var Redis=require(_0x0347('0x5'));var db=require(_0x0347('0x6'))['db'];var utils=require(_0x0347('0x7'));var logger=require(_0x0347('0x8'))('rpc');var config=require(_0x0347('0x9'));var jayson=require(_0x0347('0xa'));var client=jayson[_0x0347('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x519776,_0x597103,_0x64a33e){return new BPromise(function(_0x183586,_0xec3bac){return client[_0x0347('0xc')](_0x519776,_0x64a33e)[_0x0347('0xd')](function(_0x44e447){logger[_0x0347('0xe')](_0x0347('0xf'),_0x597103,_0x0347('0x10'));logger[_0x0347('0x11')](_0x0347('0x12'),_0x597103,_0x0347('0x10'),JSON[_0x0347('0x13')](_0x44e447));if(_0x44e447[_0x0347('0x14')]){if(_0x44e447[_0x0347('0x14')][_0x0347('0x15')]===0x1f4){logger['error'](_0x0347('0xf'),_0x597103,_0x44e447[_0x0347('0x14')]['message']);return _0xec3bac(_0x44e447[_0x0347('0x14')][_0x0347('0x16')]);}logger[_0x0347('0x14')](_0x0347('0xf'),_0x597103,_0x44e447[_0x0347('0x14')]['message']);return _0x183586(_0x44e447[_0x0347('0x14')][_0x0347('0x16')]);}else{logger[_0x0347('0xe')](_0x0347('0xf'),_0x597103,_0x0347('0x10'));_0x183586(_0x44e447[_0x0347('0x17')]['message']);}})['catch'](function(_0x12955b){logger['error'](_0x0347('0xf'),_0x597103,_0x12955b);_0xec3bac(_0x12955b);});});}
\ No newline at end of file
+var _0xd5b4=['info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3601c6,_0x2fa72a){var _0xc1458f=function(_0x719435){while(--_0x719435){_0x3601c6['push'](_0x3601c6['shift']());}};_0xc1458f(++_0x2fa72a);}(_0xd5b4,0x13f));var _0x4d5b=function(_0x4c82e1,_0xbd65db){_0x4c82e1=_0x4c82e1-0x0;var _0x233e9a=_0xd5b4[_0x4c82e1];return _0x233e9a;};'use strict';var _=require('lodash');var util=require(_0x4d5b('0x0'));var moment=require(_0x4d5b('0x1'));var BPromise=require(_0x4d5b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d5b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d5b('0x4'))(_0x4d5b('0x5'));var config=require(_0x4d5b('0x6'));var jayson=require(_0x4d5b('0x7'));var client=jayson[_0x4d5b('0x8')][_0x4d5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfa1f6b,_0x44bba5,_0x422073){return new BPromise(function(_0x46e642,_0x3449cc){return client['request'](_0xfa1f6b,_0x422073)[_0x4d5b('0xa')](function(_0x784db4){logger[_0x4d5b('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x44bba5,'request\x20sent');logger[_0x4d5b('0xc')](_0x4d5b('0xd'),_0x44bba5,_0x4d5b('0xe'),JSON[_0x4d5b('0xf')](_0x784db4));if(_0x784db4['error']){if(_0x784db4[_0x4d5b('0x10')][_0x4d5b('0x11')]===0x1f4){logger[_0x4d5b('0x10')](_0x4d5b('0x12'),_0x44bba5,_0x784db4[_0x4d5b('0x10')][_0x4d5b('0x13')]);return _0x3449cc(_0x784db4[_0x4d5b('0x10')]['message']);}logger[_0x4d5b('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x44bba5,_0x784db4[_0x4d5b('0x10')][_0x4d5b('0x13')]);return _0x46e642(_0x784db4['error'][_0x4d5b('0x13')]);}else{logger[_0x4d5b('0xb')](_0x4d5b('0x12'),_0x44bba5,'request\x20sent');_0x46e642(_0x784db4[_0x4d5b('0x14')][_0x4d5b('0x13')]);}})[_0x4d5b('0x15')](function(_0x3dd9cb){logger[_0x4d5b('0x10')](_0x4d5b('0x12'),_0x44bba5,_0x3dd9cb);_0x3449cc(_0x3dd9cb);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index ed4459b..73a358c 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x3f316f,_0x59ac33){var _0x24b6b8=function(_0x100547){while(--_0x100547){_0x3f316f['push'](_0x3f316f['shift']());}};_0x24b6b8(++_0x59ac33);}(_0xd8fb,0x99));var _0xbd8f=function(_0x10b83f,_0x4d32d6){_0x10b83f=_0x10b83f-0x0;var _0x4b1ee3=_0xd8fb[_0x10b83f];return _0x4b1ee3;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router;
\ No newline at end of file
+var _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4239a6,_0x157e19){var _0x59728f=function(_0xc34db8){while(--_0xc34db8){_0x4239a6['push'](_0x4239a6['shift']());}};_0x59728f(++_0x157e19);}(_0x6aa7,0x178));var _0x76aa=function(_0x594508,_0x4e384d){_0x594508=_0x594508-0x0;var _0x37d50d=_0x6aa7[_0x594508];return _0x37d50d;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index a1adc38..92ce3c8 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 _0xc214=['INTEGER','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x484ad6,_0x4efaee){var _0x4950d0=function(_0x11afec){while(--_0x11afec){_0x484ad6['push'](_0x484ad6['shift']());}};_0x4950d0(++_0x4efaee);}(_0xc214,0x74));var _0x4c21=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc214[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0x4c21('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c21('0x1')],'unique':_0x4c21('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4c21('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4c21('0x4'),_0x4c21('0x5'),_0x4c21('0x6'))}};
\ No newline at end of file
+var _0xdd6b=['STRING','name','rrmemory','sequelize','exports'];(function(_0x1cdcab,_0x17a516){var _0x4393d0=function(_0x53b841){while(--_0x53b841){_0x1cdcab['push'](_0x1cdcab['shift']());}};_0x4393d0(++_0x17a516);}(_0xdd6b,0x198));var _0xbdd6=function(_0x5c16ae,_0x2c0bbf){_0x5c16ae=_0x5c16ae-0x0;var _0x207a29=_0xdd6b[_0x5c16ae];return _0x207a29;};'use strict';var Sequelize=require(_0xbdd6('0x0'));module[_0xbdd6('0x1')]={'name':{'type':Sequelize[_0xbdd6('0x2')],'unique':_0xbdd6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xbdd6('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 192d999..1429f15 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 _0xa697=['spread','isArray','userChatQueue:remove','getAgents','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','register','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','UserProfileResource','sendStatus','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','catch','params','keys','filters','intersection','model','attributes','fields','length','merge','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','find','userProfileId','autoAssociation','error','body','describe','getMembers','findOne','UserChatQueue','nolimit','order','sort','pick','filter','map','findAll','User','findAndCountAll','chatPause','format','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit'];(function(_0x2dd635,_0x4fa9ab){var _0x570d9a=function(_0x304cf7){while(--_0x304cf7){_0x2dd635['push'](_0x2dd635['shift']());}};_0x570d9a(++_0x4fa9ab);}(_0xa697,0x169));var _0x7a69=function(_0x37e168,_0x3ba12e){_0x37e168=_0x37e168-0x0;var _0x549896=_0xa697[_0x37e168];return _0x549896;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0x7a69('0x0'));var qs=require(_0x7a69('0x1'));var logger=require(_0x7a69('0x2'))(_0x7a69('0x3'));var config=require(_0x7a69('0x4'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7a69('0x5')](config[_0x7a69('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a69('0x7'))(new Redis(config[_0x7a69('0x6')]));require('./chatQueue.socket')[_0x7a69('0x8')](socket);function respondWithStatusCode(_0x45bedc,_0x1bc569){_0x1bc569=_0x1bc569||0xcc;return function(_0x5c1bd3){if(_0x5c1bd3){return _0x45bedc['sendStatus'](_0x1bc569);}return _0x45bedc[_0x7a69('0x9')](_0x1bc569)[_0x7a69('0xa')]();};}function respondWithResult(_0x48f1b2,_0x3ab5d5){_0x3ab5d5=_0x3ab5d5||0xc8;return function(_0x464b2e){if(_0x464b2e){return _0x48f1b2[_0x7a69('0x9')](_0x3ab5d5)[_0x7a69('0xb')](_0x464b2e);}};}function respondWithFilteredResult(_0x456c35,_0x3c4215){return function(_0x55e115){if(_0x55e115){var _0x3afa29=typeof _0x3c4215[_0x7a69('0xc')]==='undefined'&&typeof _0x3c4215[_0x7a69('0xd')]===_0x7a69('0xe');var _0x58e29b=_0x55e115[_0x7a69('0xf')];var _0x2695a0=_0x3afa29?0x0:_0x3c4215[_0x7a69('0xc')];var _0x52fbaa=_0x3afa29?_0x55e115['count']:_0x3c4215['offset']+_0x3c4215[_0x7a69('0xd')];var _0x4016a2;if(_0x52fbaa>=_0x58e29b){_0x52fbaa=_0x58e29b;_0x4016a2=0xc8;}else{_0x4016a2=0xce;}_0x456c35['status'](_0x4016a2);return _0x456c35[_0x7a69('0x10')](_0x7a69('0x11'),_0x2695a0+'-'+_0x52fbaa+'/'+_0x58e29b)[_0x7a69('0xb')](_0x55e115);}return null;};}function saveUpdates(_0x2a8f18){return function(_0x22dc2a){if(_0x22dc2a){return _0x22dc2a['update'](_0x2a8f18)[_0x7a69('0x12')](function(_0x48e8d9){return _0x48e8d9;});}return null;};}function removeEntity(_0x39d9f3){return function(_0x39374f){if(_0x39374f){return _0x39374f[_0x7a69('0x13')]()['then'](function(){var _0x25e77f=_0x39374f['get']({'plain':!![]});var _0x3c8552='ChatQueues';return db[_0x7a69('0x14')][_0x7a69('0x13')]({'where':{'type':_0x3c8552,'resourceId':_0x25e77f['id']}})[_0x7a69('0x12')](function(){return _0x39374f;});})[_0x7a69('0x12')](function(){_0x39d9f3[_0x7a69('0x9')](0xcc)[_0x7a69('0xa')]();});}};}function handleEntityNotFound(_0xcb4fd3){return function(_0x2f88c8){if(!_0x2f88c8){_0xcb4fd3[_0x7a69('0x15')](0x194);}return _0x2f88c8;};}function handleError(_0x5773db,_0x21b857){_0x21b857=_0x21b857||0x1f4;return function(_0x3a4e9f){logger['error'](_0x3a4e9f['stack']);if(_0x3a4e9f[_0x7a69('0x16')]){delete _0x3a4e9f[_0x7a69('0x16')];}_0x5773db['status'](_0x21b857)[_0x7a69('0x17')](_0x3a4e9f);};}exports[_0x7a69('0x18')]=function(_0x88aff,_0x455b20){var _0x39023e={};var _0x555793={'count':0x0,'rows':[]};var _0x3d1e87=_['map'](db[_0x7a69('0x19')][_0x7a69('0x1a')],function(_0x599157){return{'name':_0x599157[_0x7a69('0x1b')],'type':_0x599157[_0x7a69('0x1c')][_0x7a69('0x1d')]};});_0x39023e=qs[_0x7a69('0x1e')](_0x3d1e87,_0x88aff);var _0x438b6f={'where':_0x39023e[_0x7a69('0x1f')]};return db['ChatQueue']['count'](_0x438b6f)['then'](function(_0x22b512){_0x555793['count']=_0x22b512;_0x39023e['include']=qs[_0x7a69('0x20')](_0x88aff[_0x7a69('0x21')]);return db[_0x7a69('0x19')]['findAll'](_0x39023e);})[_0x7a69('0x12')](function(_0x4878f2){_0x555793[_0x7a69('0x22')]=_0x4878f2;return _0x555793;})[_0x7a69('0x12')](respondWithFilteredResult(_0x455b20,_0x39023e))[_0x7a69('0x23')](handleError(_0x455b20,null));};exports['show']=function(_0x27d56f,_0x107100){var _0x57e403={'raw':!![],'where':{'id':_0x27d56f[_0x7a69('0x24')]['id']}},_0x33c209={};_0x33c209['model']=_[_0x7a69('0x25')](db[_0x7a69('0x19')][_0x7a69('0x1a')]);_0x33c209[_0x7a69('0x21')]=_['keys'](_0x27d56f[_0x7a69('0x21')]);_0x33c209[_0x7a69('0x26')]=_[_0x7a69('0x27')](_0x33c209[_0x7a69('0x28')],_0x33c209['query']);_0x57e403[_0x7a69('0x29')]=_[_0x7a69('0x27')](_0x33c209[_0x7a69('0x28')],qs[_0x7a69('0x2a')](_0x27d56f[_0x7a69('0x21')][_0x7a69('0x2a')]));_0x57e403[_0x7a69('0x29')]=_0x57e403[_0x7a69('0x29')][_0x7a69('0x2b')]?_0x57e403['attributes']:_0x33c209[_0x7a69('0x28')];if(_0x27d56f[_0x7a69('0x21')]['includeAll']){_0x57e403[_0x7a69('0x20')]=[{'all':!![]}];}_0x57e403=_[_0x7a69('0x2c')]({},_0x57e403,_0x27d56f[_0x7a69('0x2d')]);return db[_0x7a69('0x19')]['find'](_0x57e403)[_0x7a69('0x12')](handleEntityNotFound(_0x107100,null))[_0x7a69('0x12')](respondWithResult(_0x107100,null))['catch'](handleError(_0x107100,null));};exports[_0x7a69('0x2e')]=function(_0x413bf3,_0x20b243){return db[_0x7a69('0x19')]['create'](_0x413bf3['body'],{})[_0x7a69('0x12')](function(_0x41a675){var _0x2a852a=_0x413bf3[_0x7a69('0x2f')][_0x7a69('0x30')]({'plain':!![]});if(!_0x2a852a)throw new Error(_0x7a69('0x31'));if(_0x2a852a[_0x7a69('0x32')]===_0x7a69('0x2f')){var _0x2189b2=_0x41a675['get']({'plain':!![]});var _0x2cd1f5=_0x7a69('0x33');return db[_0x7a69('0x34')][_0x7a69('0x35')]({'where':{'name':_0x2cd1f5,'userProfileId':_0x2a852a[_0x7a69('0x36')]},'raw':!![]})[_0x7a69('0x12')](function(_0x1c4ded){if(_0x1c4ded&&_0x1c4ded[_0x7a69('0x37')]===0x0){return db[_0x7a69('0x14')][_0x7a69('0x2e')]({'name':_0x2189b2['name'],'resourceId':_0x2189b2['id'],'type':_0x1c4ded[_0x7a69('0x16')],'sectionId':_0x1c4ded['id']},{})[_0x7a69('0x12')](function(){return _0x41a675;});}else{return _0x41a675;}})[_0x7a69('0x23')](function(_0x539279){logger[_0x7a69('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x539279);throw _0x539279;});}return _0x41a675;})[_0x7a69('0x12')](respondWithResult(_0x20b243,0xc9))[_0x7a69('0x23')](handleError(_0x20b243,null));};exports['update']=function(_0xb70aea,_0x5f243b){if(_0xb70aea[_0x7a69('0x39')]['id']){delete _0xb70aea[_0x7a69('0x39')]['id'];}return db['ChatQueue'][_0x7a69('0x35')]({'where':{'id':_0xb70aea[_0x7a69('0x24')]['id']}})[_0x7a69('0x12')](handleEntityNotFound(_0x5f243b,null))[_0x7a69('0x12')](saveUpdates(_0xb70aea[_0x7a69('0x39')],null))[_0x7a69('0x12')](respondWithResult(_0x5f243b,null))['catch'](handleError(_0x5f243b,null));};exports[_0x7a69('0x13')]=function(_0x5f23a3,_0x3aef1b){return db[_0x7a69('0x19')][_0x7a69('0x35')]({'where':{'id':_0x5f23a3[_0x7a69('0x24')]['id']}})[_0x7a69('0x12')](handleEntityNotFound(_0x3aef1b,null))[_0x7a69('0x12')](removeEntity(_0x3aef1b,null))[_0x7a69('0x23')](handleError(_0x3aef1b,null));};exports[_0x7a69('0x3a')]=function(_0x26d387,_0x46c6c8){return db[_0x7a69('0x19')][_0x7a69('0x3a')]()[_0x7a69('0x12')](respondWithResult(_0x46c6c8,null))[_0x7a69('0x23')](handleError(_0x46c6c8,null));};exports[_0x7a69('0x3b')]=function(_0x43e425,_0x79c538){var _0x247fd4={'raw':!![],'where':{}},_0xe9d845={},_0x3c8d29;return db[_0x7a69('0x19')][_0x7a69('0x3c')]({'where':{'id':_0x43e425['params']['id']}})['then'](handleEntityNotFound(_0x79c538,null))[_0x7a69('0x12')](function(_0x414c86){if(_0x414c86){_0x3c8d29=_0x414c86[_0x7a69('0x30')]({'plain':!![]});_0xe9d845[_0x7a69('0x28')]=_['keys'](db[_0x7a69('0x3d')][_0x7a69('0x1a')]);_0xe9d845[_0x7a69('0x21')]=_['keys'](_0x43e425[_0x7a69('0x21')]);_0xe9d845['filters']=_['intersection'](_0xe9d845[_0x7a69('0x28')],_0xe9d845[_0x7a69('0x21')]);_0x247fd4[_0x7a69('0x29')]=_[_0x7a69('0x27')](_0xe9d845[_0x7a69('0x28')],qs['fields'](_0x43e425[_0x7a69('0x21')][_0x7a69('0x2a')]));_0x247fd4[_0x7a69('0x29')]=_0x247fd4['attributes'][_0x7a69('0x2b')]?_0x247fd4['attributes']:_0xe9d845[_0x7a69('0x28')];if(!_0x43e425[_0x7a69('0x21')]['hasOwnProperty'](_0x7a69('0x3e'))){_0x247fd4['limit']=qs[_0x7a69('0xd')](_0x43e425[_0x7a69('0x21')]['limit']);_0x247fd4[_0x7a69('0xc')]=qs[_0x7a69('0xc')](_0x43e425[_0x7a69('0x21')]['offset']);}_0x247fd4[_0x7a69('0x3f')]=qs[_0x7a69('0x40')](_0x43e425['query'][_0x7a69('0x40')]);_0x247fd4[_0x7a69('0x1f')]=qs[_0x7a69('0x26')](_[_0x7a69('0x41')](_0x43e425[_0x7a69('0x21')],_0xe9d845[_0x7a69('0x26')]));_0x247fd4[_0x7a69('0x1f')]['ChatQueueId']=_0x414c86['id'];if(_0x43e425[_0x7a69('0x21')][_0x7a69('0x42')]){_0x247fd4[_0x7a69('0x1f')]=_[_0x7a69('0x2c')](_0x247fd4[_0x7a69('0x1f')],{'$or':_[_0x7a69('0x43')](_0x247fd4[_0x7a69('0x29')],function(_0x24183e){var _0x1fa9fb={};_0x1fa9fb[_0x24183e]={'$like':'%'+_0x43e425[_0x7a69('0x21')][_0x7a69('0x42')]+'%'};return _0x1fa9fb;})});}_0x247fd4=_[_0x7a69('0x2c')]({},_0x247fd4,_0x43e425['options']);return db['UserChatQueue'][_0x7a69('0x44')](_0x247fd4);}})[_0x7a69('0x12')](function(_0x305d1e){if(_0x305d1e){return db[_0x7a69('0x45')][_0x7a69('0x46')]({'where':{'id':_[_0x7a69('0x43')](_0x305d1e,'UserId'),'role':'agent'},'attributes':['id',_0x7a69('0x16'),_0x7a69('0x47'),'updatedAt','createdAt']});}})[_0x7a69('0x12')](function(_0x407629){if(_0x407629){return{'count':_0x407629['count'],'rows':_[_0x7a69('0x43')](_0x407629['rows'],function(_0x144802){return{'membername':_0x144802[_0x7a69('0x16')],'UserId':_0x144802['id'],'queue_name':_0x3c8d29[_0x7a69('0x16')],'ChatQueueId':_0x3c8d29['id'],'interface':util[_0x7a69('0x48')]('%s/%s',_0x7a69('0x49'),_0x144802['name']),'penalty':0x0,'paused':_0x144802[_0x7a69('0x47')],'createdAt':_0x144802[_0x7a69('0x4a')],'updatedAt':_0x144802[_0x7a69('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x79c538,_0x247fd4))[_0x7a69('0x23')](handleError(_0x79c538,null));};exports[_0x7a69('0x4c')]=function(_0x296bd3,_0x4c6c82){var _0x381400={};var _0x2bbff9={};var _0x157a3e;var _0x3361d2;return db[_0x7a69('0x19')][_0x7a69('0x3c')]({'where':{'id':_0x296bd3['params']['id']}})[_0x7a69('0x12')](handleEntityNotFound(_0x4c6c82,null))['then'](function(_0x404a55){if(_0x404a55){_0x157a3e=_0x404a55;_0x2bbff9[_0x7a69('0x28')]=_['keys'](db[_0x7a69('0x4d')][_0x7a69('0x1a')]);_0x2bbff9[_0x7a69('0x21')]=_['keys'](_0x296bd3[_0x7a69('0x21')]);_0x2bbff9['filters']=_[_0x7a69('0x27')](_0x2bbff9['model'],_0x2bbff9['query']);_0x381400['attributes']=_[_0x7a69('0x27')](_0x2bbff9[_0x7a69('0x28')],qs[_0x7a69('0x2a')](_0x296bd3['query']['fields']));_0x381400[_0x7a69('0x29')]=_0x381400[_0x7a69('0x29')][_0x7a69('0x2b')]?_0x381400[_0x7a69('0x29')]:_0x2bbff9[_0x7a69('0x28')];_0x381400[_0x7a69('0x3f')]=qs[_0x7a69('0x40')](_0x296bd3[_0x7a69('0x21')][_0x7a69('0x40')]);_0x381400[_0x7a69('0x1f')]=qs[_0x7a69('0x26')](_['pick'](_0x296bd3[_0x7a69('0x21')],_0x2bbff9[_0x7a69('0x26')]));if(_0x296bd3[_0x7a69('0x21')][_0x7a69('0x42')]){_0x381400[_0x7a69('0x1f')]=_[_0x7a69('0x2c')](_0x381400[_0x7a69('0x1f')],{'$or':_['map'](_0x381400[_0x7a69('0x29')],function(_0x35e5b8){var _0xaa5ec1={};_0xaa5ec1[_0x35e5b8]={'$like':'%'+_0x296bd3[_0x7a69('0x21')][_0x7a69('0x42')]+'%'};return _0xaa5ec1;})});}_0x381400=_[_0x7a69('0x2c')]({},_0x381400,_0x296bd3[_0x7a69('0x2d')]);return _0x157a3e[_0x7a69('0x4c')](_0x381400);}})[_0x7a69('0x12')](function(_0x5a812a){if(_0x5a812a){_0x3361d2=_0x5a812a[_0x7a69('0x2b')];if(!_0x296bd3[_0x7a69('0x21')]['hasOwnProperty'](_0x7a69('0x3e'))){_0x381400[_0x7a69('0xd')]=qs[_0x7a69('0xd')](_0x296bd3[_0x7a69('0x21')][_0x7a69('0xd')]);_0x381400[_0x7a69('0xc')]=qs['offset'](_0x296bd3[_0x7a69('0x21')]['offset']);}return _0x157a3e[_0x7a69('0x4c')](_0x381400);}})['then'](function(_0x37bb38){if(_0x37bb38){return _0x37bb38?{'count':_0x3361d2,'rows':_0x37bb38}:null;}})[_0x7a69('0x12')](respondWithResult(_0x4c6c82,null))[_0x7a69('0x23')](handleError(_0x4c6c82,null));};exports[_0x7a69('0x4e')]=function(_0x38d54b,_0x20b82b){var _0x2da226=_0x38d54b['body'][_0x7a69('0x4f')];return db[_0x7a69('0x4d')]['findAll']({'where':{'id':_0x2da226},'attributes':['id'],'include':[{'model':db[_0x7a69('0x45')],'as':_0x7a69('0x50'),'attributes':['id',_0x7a69('0x16'),'online',_0x7a69('0x51'),_0x7a69('0x52')],'raw':!![]}]})['then'](function(_0x3a6af8){if(_0x3a6af8){var _0x2144a1=_[_0x7a69('0x53')](_0x3a6af8,function(_0x38798f){var _0x2757c6=_0x38798f[_0x7a69('0x30')]({'plain':!![]});return _0x2757c6[_0x7a69('0x50')];});return db[_0x7a69('0x19')][_0x7a69('0x35')]({'where':{'id':_0x38d54b[_0x7a69('0x24')]['id']}})[_0x7a69('0x12')](function(_0x3e1fb3){return db[_0x7a69('0x54')][_0x7a69('0x55')](function(_0x30178a){return _0x3e1fb3[_0x7a69('0x4e')](_0x2da226,{'transaction':_0x30178a})[_0x7a69('0x12')](function(){return BPromise['each'](_0x2144a1,function(_0x2e7118){return db[_0x7a69('0x3d')][_0x7a69('0x56')]({'where':{'UserId':_0x2e7118['id'],'ChatQueueId':_0x38d54b['params']['id']},'transaction':_0x30178a});});})[_0x7a69('0x12')](function(){_0x2144a1['forEach'](function(_0xfa17b4){socket[_0x7a69('0x57')](_0x7a69('0x58'),{'UserId':_0xfa17b4['id'],'ChatQueueId':_0x3e1fb3['id']});});});});});}})[_0x7a69('0x12')](respondWithStatusCode(_0x20b82b,null))[_0x7a69('0x23')](handleError(_0x20b82b,null));};exports[_0x7a69('0x59')]=function(_0x2fc0e8,_0x561913){return db[_0x7a69('0x4d')][_0x7a69('0x44')]({'where':{'id':_0x2fc0e8['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7a69('0x50'),'attributes':['id'],'raw':!![]}]})[_0x7a69('0x12')](handleEntityNotFound(_0x561913,null))[_0x7a69('0x12')](function(_0x416cf9){var _0x46f985=_[_0x7a69('0x43')](_0x416cf9,'id');var _0x11a4b6=[];var _0x3d0d1b=[];var _0x48948c=squel[_0x7a69('0x5a')]();_0x48948c[_0x7a69('0x5b')](_0x7a69('0x5c'))[_0x7a69('0x5d')](_0x7a69('0x5e'),'tq')[_0x7a69('0x5f')](_0x7a69('0x60'),'ut',_0x7a69('0x61'))[_0x7a69('0x1f')](_0x7a69('0x62'),_0x2fc0e8[_0x7a69('0x24')]['id']);for(var _0x368657=0x0;_0x368657<_0x416cf9[_0x7a69('0x2b')];_0x368657+=0x1){let _0x183dcf=_0x416cf9[_0x368657];for(var _0x22fc2d=0x0;_0x22fc2d<_0x183dcf[_0x7a69('0x50')][_0x7a69('0x2b')];_0x22fc2d+=0x1){let _0x36c11b=_0x183dcf[_0x7a69('0x50')][_0x22fc2d];var _0x1dffb5=_0x48948c[_0x7a69('0x63')]();_0x1dffb5['where'](_0x7a69('0x64'),_0x36c11b['id']);_0x3d0d1b[_0x7a69('0x65')](db[_0x7a69('0x54')]['query'](_0x1dffb5['toString'](),{'type':db[_0x7a69('0x54')][_0x7a69('0x66')]['SELECT']})[_0x7a69('0x12')](function(_0x52280f){if(_0x52280f[_0x7a69('0x2b')]===0x1){return _0x36c11b['id'];}else{var _0x485675=_[_0x7a69('0x67')](_[_0x7a69('0x43')](_0x52280f,_0x7a69('0x68')),function(_0x307784){return _[_0x7a69('0x69')](_0x46f985,_0x307784);});if(_0x485675){return _0x36c11b['id'];}}}));}}return BPromise[_0x7a69('0x6a')](_0x3d0d1b)[_0x7a69('0x12')](function(_0x46c3f5){_0x11a4b6=_(_0x11a4b6)[_0x7a69('0x6b')](_0x46c3f5)[_0x7a69('0x6c')]()[_0x7a69('0x6d')]();return db[_0x7a69('0x19')][_0x7a69('0x35')]({'where':{'id':_0x2fc0e8['params']['id']}})[_0x7a69('0x12')](function(_0x549e44){return db['sequelize'][_0x7a69('0x55')](function(_0xf80626){return _0x549e44[_0x7a69('0x59')](_0x2fc0e8['query']['ids'],{'transaction':_0xf80626})['then'](function(){if(!_[_0x7a69('0x6e')](_0x11a4b6)){return _0x549e44[_0x7a69('0x6f')](_0x11a4b6,{'transaction':_0xf80626});}})[_0x7a69('0x12')](function(){_0x11a4b6[_0x7a69('0x70')](function(_0x50659d){socket[_0x7a69('0x57')]('userChatQueue:remove',{'UserId':_0x50659d,'ChatQueueId':_0x549e44['id']});});});});});});})[_0x7a69('0x12')](respondWithStatusCode(_0x561913,null))[_0x7a69('0x23')](handleError(_0x561913,null));};exports[_0x7a69('0x71')]=function(_0xf07bc0,_0x5be8cb){return db[_0x7a69('0x19')]['find']({'where':{'id':_0xf07bc0[_0x7a69('0x24')]['id']}})[_0x7a69('0x12')](handleEntityNotFound(_0x5be8cb,null))[_0x7a69('0x12')](function(_0x5eb5fe){if(_0x5eb5fe){return _0x5eb5fe['addAgents'](_0xf07bc0[_0x7a69('0x39')][_0x7a69('0x4f')],_[_0x7a69('0x72')](_0xf07bc0[_0x7a69('0x39')],[_0x7a69('0x4f'),'id'])||{})[_0x7a69('0x73')](function(_0x193648){for(var _0x5a9528=0x0;_0x5a9528<_0xf07bc0['body'][_0x7a69('0x4f')][_0x7a69('0x2b')];_0x5a9528+=0x1){socket[_0x7a69('0x57')](_0x7a69('0x58'),{'UserId':Number(_0xf07bc0[_0x7a69('0x39')][_0x7a69('0x4f')][_0x5a9528]),'ChatQueueId':Number(_0xf07bc0[_0x7a69('0x24')]['id'])});}return _0x193648;});}})[_0x7a69('0x12')](respondWithResult(_0x5be8cb,null))['catch'](handleError(_0x5be8cb,null));};exports['removeAgents']=function(_0xa2f86f,_0x27e7db){return db['ChatQueue'][_0x7a69('0x35')]({'where':{'id':_0xa2f86f[_0x7a69('0x24')]['id']}})[_0x7a69('0x12')](handleEntityNotFound(_0x27e7db,null))[_0x7a69('0x12')](function(_0x11ebc7){if(_0x11ebc7){return _0x11ebc7[_0x7a69('0x6f')](_0xa2f86f[_0x7a69('0x21')][_0x7a69('0x4f')])[_0x7a69('0x12')](function(){if(_[_0x7a69('0x74')](_0xa2f86f[_0x7a69('0x21')][_0x7a69('0x4f')])){for(var _0x39716f=0x0;_0x39716f<_0xa2f86f[_0x7a69('0x21')][_0x7a69('0x4f')][_0x7a69('0x2b')];_0x39716f+=0x1){socket[_0x7a69('0x57')](_0x7a69('0x75'),{'UserId':Number(_0xa2f86f[_0x7a69('0x21')]['ids'][_0x39716f]),'ChatQueueId':Number(_0xa2f86f['params']['id'])});}}else{socket[_0x7a69('0x57')](_0x7a69('0x75'),{'UserId':Number(_0xa2f86f[_0x7a69('0x21')][_0x7a69('0x4f')]),'ChatQueueId':Number(_0xa2f86f[_0x7a69('0x24')]['id'])});}});}})['then'](respondWithStatusCode(_0x27e7db,null))[_0x7a69('0x23')](handleError(_0x27e7db,null));};exports[_0x7a69('0x76')]=function(_0x109026,_0x5b7699){var _0x45d3ae={};var _0x6fb546={};var _0x2925f8;var _0x4061d9;return db[_0x7a69('0x19')][_0x7a69('0x3c')]({'where':{'id':_0x109026[_0x7a69('0x24')]['id']}})['then'](handleEntityNotFound(_0x5b7699,null))['then'](function(_0x4d7d57){if(_0x4d7d57){_0x2925f8=_0x4d7d57;_0x6fb546['model']=_['keys'](db['User'][_0x7a69('0x1a')]);_0x6fb546[_0x7a69('0x21')]=_[_0x7a69('0x25')](_0x109026[_0x7a69('0x21')]);_0x6fb546['filters']=_['intersection'](_0x6fb546[_0x7a69('0x28')],_0x6fb546['query']);_0x45d3ae[_0x7a69('0x29')]=_[_0x7a69('0x27')](_0x6fb546[_0x7a69('0x28')],qs['fields'](_0x109026[_0x7a69('0x21')]['fields']));_0x45d3ae['attributes']=_0x45d3ae[_0x7a69('0x29')][_0x7a69('0x2b')]?_0x45d3ae[_0x7a69('0x29')]:_0x6fb546[_0x7a69('0x28')];_0x45d3ae[_0x7a69('0x3f')]=qs['sort'](_0x109026[_0x7a69('0x21')][_0x7a69('0x40')]);_0x45d3ae['where']=qs['filters'](_[_0x7a69('0x41')](_0x109026[_0x7a69('0x21')],_0x6fb546[_0x7a69('0x26')]));if(_0x109026[_0x7a69('0x21')]['filter']){_0x45d3ae[_0x7a69('0x1f')]=_[_0x7a69('0x2c')](_0x45d3ae[_0x7a69('0x1f')],{'$or':_[_0x7a69('0x43')](_0x45d3ae[_0x7a69('0x29')],function(_0x13bbfa){var _0x2d0420={};_0x2d0420[_0x13bbfa]={'$like':'%'+_0x109026[_0x7a69('0x21')][_0x7a69('0x42')]+'%'};return _0x2d0420;})});}_0x45d3ae=_[_0x7a69('0x2c')]({},_0x45d3ae,_0x109026['options']);return _0x2925f8[_0x7a69('0x76')](_0x45d3ae);}})[_0x7a69('0x12')](function(_0x53be30){if(_0x53be30){_0x4061d9=_0x53be30['length'];if(!_0x109026[_0x7a69('0x21')]['hasOwnProperty'](_0x7a69('0x3e'))){_0x45d3ae[_0x7a69('0xd')]=qs['limit'](_0x109026['query'][_0x7a69('0xd')]);_0x45d3ae[_0x7a69('0xc')]=qs['offset'](_0x109026[_0x7a69('0x21')]['offset']);}return _0x2925f8[_0x7a69('0x76')](_0x45d3ae);}})['then'](function(_0x33e449){if(_0x33e449){return _0x33e449?{'count':_0x4061d9,'rows':_0x33e449}:null;}})[_0x7a69('0x12')](respondWithResult(_0x5b7699,null))[_0x7a69('0x23')](handleError(_0x5b7699,null));};
\ No newline at end of file
+var _0xdb35=['set','Content-Range','update','then','destroy','get','error','index','map','ChatQueue','rawAttributes','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','name','describe','getMembers','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','merge','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','Agents','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userChatQueue:save','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','count'];(function(_0xf9f76c,_0x82a886){var _0x19a4d3=function(_0x1e8eff){while(--_0x1e8eff){_0xf9f76c['push'](_0xf9f76c['shift']());}};_0x19a4d3(++_0x82a886);}(_0xdb35,0x15e));var _0x5db3=function(_0xfc959c,_0x4660c){_0xfc959c=_0xfc959c-0x0;var _0xa12959=_0xdb35[_0xfc959c];return _0xa12959;};'use strict';var BPromise=require(_0x5db3('0x0'));var util=require(_0x5db3('0x1'));var _=require('lodash');var squel=require(_0x5db3('0x2'));var Redis=require(_0x5db3('0x3'));var qs=require(_0x5db3('0x4'));var logger=require(_0x5db3('0x5'))(_0x5db3('0x6'));var config=require(_0x5db3('0x7'));var db=require(_0x5db3('0x8'))['db'];config[_0x5db3('0x9')]=_[_0x5db3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5db3('0xb'))(new Redis(config[_0x5db3('0x9')]));require(_0x5db3('0xc'))[_0x5db3('0xd')](socket);function respondWithStatusCode(_0x4f1c17,_0x470c51){_0x470c51=_0x470c51||0xcc;return function(_0x354b45){if(_0x354b45){return _0x4f1c17[_0x5db3('0xe')](_0x470c51);}return _0x4f1c17[_0x5db3('0xf')](_0x470c51)[_0x5db3('0x10')]();};}function respondWithResult(_0xf205f3,_0x24fcf6){_0x24fcf6=_0x24fcf6||0xc8;return function(_0x314333){if(_0x314333){return _0xf205f3[_0x5db3('0xf')](_0x24fcf6)[_0x5db3('0x11')](_0x314333);}};}function respondWithFilteredResult(_0x4cba84,_0x1b7448){return function(_0x153aaf){if(_0x153aaf){var _0x4e902b=typeof _0x1b7448['offset']===_0x5db3('0x12')&&typeof _0x1b7448[_0x5db3('0x13')]===_0x5db3('0x12');var _0x27d4e0=_0x153aaf['count'];var _0x35ae6a=_0x4e902b?0x0:_0x1b7448[_0x5db3('0x14')];var _0x15e6ff=_0x4e902b?_0x153aaf[_0x5db3('0x15')]:_0x1b7448[_0x5db3('0x14')]+_0x1b7448[_0x5db3('0x13')];var _0x3b874a;if(_0x15e6ff>=_0x27d4e0){_0x15e6ff=_0x27d4e0;_0x3b874a=0xc8;}else{_0x3b874a=0xce;}_0x4cba84[_0x5db3('0xf')](_0x3b874a);return _0x4cba84[_0x5db3('0x16')](_0x5db3('0x17'),_0x35ae6a+'-'+_0x15e6ff+'/'+_0x27d4e0)[_0x5db3('0x11')](_0x153aaf);}return null;};}function saveUpdates(_0x28fc9f){return function(_0xa30c81){if(_0xa30c81){return _0xa30c81[_0x5db3('0x18')](_0x28fc9f)[_0x5db3('0x19')](function(_0xa87fee){return _0xa87fee;});}return null;};}function removeEntity(_0x37ed4b){return function(_0x404304){if(_0x404304){return _0x404304[_0x5db3('0x1a')]()[_0x5db3('0x19')](function(){var _0x50d501=_0x404304[_0x5db3('0x1b')]({'plain':!![]});var _0x19e47f='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x19e47f,'resourceId':_0x50d501['id']}})[_0x5db3('0x19')](function(){return _0x404304;});})['then'](function(){_0x37ed4b[_0x5db3('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed3db){return function(_0x20fa51){if(!_0x20fa51){_0x1ed3db[_0x5db3('0xe')](0x194);}return _0x20fa51;};}function handleError(_0x423291,_0x10a45f){_0x10a45f=_0x10a45f||0x1f4;return function(_0x4a1663){logger[_0x5db3('0x1c')](_0x4a1663['stack']);if(_0x4a1663['name']){delete _0x4a1663['name'];}_0x423291[_0x5db3('0xf')](_0x10a45f)['send'](_0x4a1663);};}exports[_0x5db3('0x1d')]=function(_0x4f1f63,_0x30252d){var _0x1b15bf={};var _0x48c49f={'count':0x0,'rows':[]};var _0xb053b0=_[_0x5db3('0x1e')](db[_0x5db3('0x1f')][_0x5db3('0x20')],function(_0x466302){return{'name':_0x466302['fieldName'],'type':_0x466302['type']['key']};});_0x1b15bf=qs['getOptions'](_0xb053b0,_0x4f1f63);var _0x53f440={'where':_0x1b15bf[_0x5db3('0x21')]};return db[_0x5db3('0x1f')]['count'](_0x53f440)[_0x5db3('0x19')](function(_0x227ffa){_0x48c49f[_0x5db3('0x15')]=_0x227ffa;_0x1b15bf['include']=qs[_0x5db3('0x22')](_0x4f1f63[_0x5db3('0x23')]);return db[_0x5db3('0x1f')][_0x5db3('0x24')](_0x1b15bf);})[_0x5db3('0x19')](function(_0x2c5ded){_0x48c49f[_0x5db3('0x25')]=_0x2c5ded;return _0x48c49f;})[_0x5db3('0x19')](respondWithFilteredResult(_0x30252d,_0x1b15bf))[_0x5db3('0x26')](handleError(_0x30252d,null));};exports[_0x5db3('0x27')]=function(_0x43b0fa,_0x48d749){var _0xd6bbc0={'raw':!![],'where':{'id':_0x43b0fa[_0x5db3('0x28')]['id']}},_0x494900={};_0x494900[_0x5db3('0x29')]=_['keys'](db[_0x5db3('0x1f')][_0x5db3('0x20')]);_0x494900[_0x5db3('0x23')]=_[_0x5db3('0x2a')](_0x43b0fa['query']);_0x494900[_0x5db3('0x2b')]=_[_0x5db3('0x2c')](_0x494900[_0x5db3('0x29')],_0x494900['query']);_0xd6bbc0[_0x5db3('0x2d')]=_[_0x5db3('0x2c')](_0x494900['model'],qs['fields'](_0x43b0fa[_0x5db3('0x23')][_0x5db3('0x2e')]));_0xd6bbc0[_0x5db3('0x2d')]=_0xd6bbc0[_0x5db3('0x2d')][_0x5db3('0x2f')]?_0xd6bbc0['attributes']:_0x494900[_0x5db3('0x29')];if(_0x43b0fa[_0x5db3('0x23')][_0x5db3('0x30')]){_0xd6bbc0[_0x5db3('0x22')]=[{'all':!![]}];}_0xd6bbc0=_['merge']({},_0xd6bbc0,_0x43b0fa[_0x5db3('0x31')]);return db[_0x5db3('0x1f')][_0x5db3('0x32')](_0xd6bbc0)[_0x5db3('0x19')](handleEntityNotFound(_0x48d749,null))['then'](respondWithResult(_0x48d749,null))[_0x5db3('0x26')](handleError(_0x48d749,null));};exports[_0x5db3('0x33')]=function(_0x30782c,_0x38e7fe){return db[_0x5db3('0x1f')][_0x5db3('0x33')](_0x30782c[_0x5db3('0x34')],{})['then'](function(_0x5c9d04){var _0x3354eb=_0x30782c['user'][_0x5db3('0x1b')]({'plain':!![]});if(!_0x3354eb)throw new Error(_0x5db3('0x35'));if(_0x3354eb[_0x5db3('0x36')]===_0x5db3('0x37')){var _0xd8ac58=_0x5c9d04[_0x5db3('0x1b')]({'plain':!![]});var _0x1f0eff=_0x5db3('0x38');return db[_0x5db3('0x39')]['find']({'where':{'name':_0x1f0eff,'userProfileId':_0x3354eb[_0x5db3('0x3a')]},'raw':!![]})[_0x5db3('0x19')](function(_0x396159){if(_0x396159&&_0x396159[_0x5db3('0x3b')]===0x0){return db['UserProfileResource']['create']({'name':_0xd8ac58[_0x5db3('0x3c')],'resourceId':_0xd8ac58['id'],'type':_0x396159[_0x5db3('0x3c')],'sectionId':_0x396159['id']},{})[_0x5db3('0x19')](function(){return _0x5c9d04;});}else{return _0x5c9d04;}})['catch'](function(_0x2856c8){logger[_0x5db3('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2856c8);throw _0x2856c8;});}return _0x5c9d04;})['then'](respondWithResult(_0x38e7fe,0xc9))[_0x5db3('0x26')](handleError(_0x38e7fe,null));};exports[_0x5db3('0x18')]=function(_0x575dc0,_0x383c3e){if(_0x575dc0[_0x5db3('0x34')]['id']){delete _0x575dc0['body']['id'];}return db[_0x5db3('0x1f')][_0x5db3('0x32')]({'where':{'id':_0x575dc0[_0x5db3('0x28')]['id']}})[_0x5db3('0x19')](handleEntityNotFound(_0x383c3e,null))[_0x5db3('0x19')](saveUpdates(_0x575dc0['body'],null))[_0x5db3('0x19')](respondWithResult(_0x383c3e,null))[_0x5db3('0x26')](handleError(_0x383c3e,null));};exports[_0x5db3('0x1a')]=function(_0xa2814d,_0x92d399){return db[_0x5db3('0x1f')]['find']({'where':{'id':_0xa2814d[_0x5db3('0x28')]['id']}})['then'](handleEntityNotFound(_0x92d399,null))['then'](removeEntity(_0x92d399,null))[_0x5db3('0x26')](handleError(_0x92d399,null));};exports['describe']=function(_0x179d3f,_0x1b31ca){return db[_0x5db3('0x1f')][_0x5db3('0x3d')]()[_0x5db3('0x19')](respondWithResult(_0x1b31ca,null))[_0x5db3('0x26')](handleError(_0x1b31ca,null));};exports[_0x5db3('0x3e')]=function(_0x130f03,_0x529a8b){var _0x4c246c={'raw':!![],'where':{}},_0x2f7d1c={},_0x6f467e;return db[_0x5db3('0x1f')]['findOne']({'where':{'id':_0x130f03[_0x5db3('0x28')]['id']}})[_0x5db3('0x19')](handleEntityNotFound(_0x529a8b,null))[_0x5db3('0x19')](function(_0x2296dd){if(_0x2296dd){_0x6f467e=_0x2296dd[_0x5db3('0x1b')]({'plain':!![]});_0x2f7d1c[_0x5db3('0x29')]=_[_0x5db3('0x2a')](db['UserChatQueue'][_0x5db3('0x20')]);_0x2f7d1c[_0x5db3('0x23')]=_[_0x5db3('0x2a')](_0x130f03[_0x5db3('0x23')]);_0x2f7d1c[_0x5db3('0x2b')]=_[_0x5db3('0x2c')](_0x2f7d1c[_0x5db3('0x29')],_0x2f7d1c[_0x5db3('0x23')]);_0x4c246c[_0x5db3('0x2d')]=_[_0x5db3('0x2c')](_0x2f7d1c[_0x5db3('0x29')],qs[_0x5db3('0x2e')](_0x130f03['query'][_0x5db3('0x2e')]));_0x4c246c[_0x5db3('0x2d')]=_0x4c246c['attributes']['length']?_0x4c246c[_0x5db3('0x2d')]:_0x2f7d1c[_0x5db3('0x29')];if(!_0x130f03[_0x5db3('0x23')][_0x5db3('0x3f')](_0x5db3('0x40'))){_0x4c246c[_0x5db3('0x13')]=qs[_0x5db3('0x13')](_0x130f03[_0x5db3('0x23')][_0x5db3('0x13')]);_0x4c246c[_0x5db3('0x14')]=qs[_0x5db3('0x14')](_0x130f03[_0x5db3('0x23')][_0x5db3('0x14')]);}_0x4c246c[_0x5db3('0x41')]=qs[_0x5db3('0x42')](_0x130f03[_0x5db3('0x23')][_0x5db3('0x42')]);_0x4c246c[_0x5db3('0x21')]=qs['filters'](_[_0x5db3('0x43')](_0x130f03[_0x5db3('0x23')],_0x2f7d1c[_0x5db3('0x2b')]));_0x4c246c[_0x5db3('0x21')][_0x5db3('0x44')]=_0x2296dd['id'];if(_0x130f03['query'][_0x5db3('0x45')]){_0x4c246c[_0x5db3('0x21')]=_[_0x5db3('0x46')](_0x4c246c[_0x5db3('0x21')],{'$or':_[_0x5db3('0x1e')](_0x4c246c[_0x5db3('0x2d')],function(_0x4c57b1){var _0x32dd9f={};_0x32dd9f[_0x4c57b1]={'$like':'%'+_0x130f03[_0x5db3('0x23')]['filter']+'%'};return _0x32dd9f;})});}_0x4c246c=_[_0x5db3('0x46')]({},_0x4c246c,_0x130f03[_0x5db3('0x31')]);return db[_0x5db3('0x47')]['findAll'](_0x4c246c);}})['then'](function(_0x2dbc37){if(_0x2dbc37){return db[_0x5db3('0x48')][_0x5db3('0x49')]({'where':{'id':_[_0x5db3('0x1e')](_0x2dbc37,_0x5db3('0x4a')),'role':_0x5db3('0x4b')},'attributes':['id',_0x5db3('0x3c'),_0x5db3('0x4c'),_0x5db3('0x4d'),_0x5db3('0x4e')]});}})[_0x5db3('0x19')](function(_0x321880){if(_0x321880){return{'count':_0x321880['count'],'rows':_[_0x5db3('0x1e')](_0x321880[_0x5db3('0x25')],function(_0x525dcc){return{'membername':_0x525dcc[_0x5db3('0x3c')],'UserId':_0x525dcc['id'],'queue_name':_0x6f467e[_0x5db3('0x3c')],'ChatQueueId':_0x6f467e['id'],'interface':util['format'](_0x5db3('0x4f'),_0x5db3('0x50'),_0x525dcc[_0x5db3('0x3c')]),'penalty':0x0,'paused':_0x525dcc[_0x5db3('0x4c')],'createdAt':_0x525dcc[_0x5db3('0x4e')],'updatedAt':_0x525dcc[_0x5db3('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5db3('0x19')](respondWithFilteredResult(_0x529a8b,_0x4c246c))[_0x5db3('0x26')](handleError(_0x529a8b,null));};exports['getTeams']=function(_0x14aa59,_0x3b27a0){var _0x2b5b2e={};var _0x1f1dde={};var _0xbe21c6;var _0x4c9185;return db[_0x5db3('0x1f')][_0x5db3('0x51')]({'where':{'id':_0x14aa59[_0x5db3('0x28')]['id']}})['then'](handleEntityNotFound(_0x3b27a0,null))[_0x5db3('0x19')](function(_0xc7aace){if(_0xc7aace){_0xbe21c6=_0xc7aace;_0x1f1dde[_0x5db3('0x29')]=_[_0x5db3('0x2a')](db[_0x5db3('0x52')][_0x5db3('0x20')]);_0x1f1dde[_0x5db3('0x23')]=_[_0x5db3('0x2a')](_0x14aa59[_0x5db3('0x23')]);_0x1f1dde[_0x5db3('0x2b')]=_['intersection'](_0x1f1dde['model'],_0x1f1dde[_0x5db3('0x23')]);_0x2b5b2e['attributes']=_['intersection'](_0x1f1dde[_0x5db3('0x29')],qs[_0x5db3('0x2e')](_0x14aa59['query'][_0x5db3('0x2e')]));_0x2b5b2e[_0x5db3('0x2d')]=_0x2b5b2e['attributes']['length']?_0x2b5b2e['attributes']:_0x1f1dde[_0x5db3('0x29')];_0x2b5b2e[_0x5db3('0x41')]=qs[_0x5db3('0x42')](_0x14aa59[_0x5db3('0x23')][_0x5db3('0x42')]);_0x2b5b2e[_0x5db3('0x21')]=qs[_0x5db3('0x2b')](_[_0x5db3('0x43')](_0x14aa59['query'],_0x1f1dde[_0x5db3('0x2b')]));if(_0x14aa59[_0x5db3('0x23')][_0x5db3('0x45')]){_0x2b5b2e[_0x5db3('0x21')]=_[_0x5db3('0x46')](_0x2b5b2e[_0x5db3('0x21')],{'$or':_[_0x5db3('0x1e')](_0x2b5b2e[_0x5db3('0x2d')],function(_0x39c144){var _0x1e2d11={};_0x1e2d11[_0x39c144]={'$like':'%'+_0x14aa59[_0x5db3('0x23')][_0x5db3('0x45')]+'%'};return _0x1e2d11;})});}_0x2b5b2e=_[_0x5db3('0x46')]({},_0x2b5b2e,_0x14aa59[_0x5db3('0x31')]);return _0xbe21c6[_0x5db3('0x53')](_0x2b5b2e);}})[_0x5db3('0x19')](function(_0x31c7d0){if(_0x31c7d0){_0x4c9185=_0x31c7d0[_0x5db3('0x2f')];if(!_0x14aa59[_0x5db3('0x23')][_0x5db3('0x3f')](_0x5db3('0x40'))){_0x2b5b2e['limit']=qs[_0x5db3('0x13')](_0x14aa59['query']['limit']);_0x2b5b2e[_0x5db3('0x14')]=qs[_0x5db3('0x14')](_0x14aa59[_0x5db3('0x23')][_0x5db3('0x14')]);}return _0xbe21c6[_0x5db3('0x53')](_0x2b5b2e);}})[_0x5db3('0x19')](function(_0x2e706f){if(_0x2e706f){return _0x2e706f?{'count':_0x4c9185,'rows':_0x2e706f}:null;}})[_0x5db3('0x19')](respondWithResult(_0x3b27a0,null))['catch'](handleError(_0x3b27a0,null));};exports[_0x5db3('0x54')]=function(_0x12a129,_0x2a6ce3){var _0x489177=_0x12a129['body'][_0x5db3('0x55')];return db[_0x5db3('0x52')][_0x5db3('0x24')]({'where':{'id':_0x489177},'attributes':['id'],'include':[{'model':db[_0x5db3('0x48')],'as':_0x5db3('0x56'),'attributes':['id',_0x5db3('0x3c'),'online',_0x5db3('0x57'),_0x5db3('0x58')],'raw':!![]}]})[_0x5db3('0x19')](function(_0x1ce2db){if(_0x1ce2db){var _0xa4a2e7=_[_0x5db3('0x59')](_0x1ce2db,function(_0x454209){var _0x379c0f=_0x454209[_0x5db3('0x1b')]({'plain':!![]});return _0x379c0f['Agents'];});return db[_0x5db3('0x1f')][_0x5db3('0x32')]({'where':{'id':_0x12a129['params']['id']}})[_0x5db3('0x19')](function(_0x1675d1){return db['sequelize'][_0x5db3('0x5a')](function(_0x1a837b){return _0x1675d1[_0x5db3('0x54')](_0x489177,{'transaction':_0x1a837b})['then'](function(){return BPromise[_0x5db3('0x5b')](_0xa4a2e7,function(_0xd60b84){return db[_0x5db3('0x47')][_0x5db3('0x5c')]({'where':{'UserId':_0xd60b84['id'],'ChatQueueId':_0x12a129[_0x5db3('0x28')]['id']},'transaction':_0x1a837b});});})[_0x5db3('0x19')](function(){_0xa4a2e7[_0x5db3('0x5d')](function(_0x130024){socket['emit'](_0x5db3('0x5e'),{'UserId':_0x130024['id'],'ChatQueueId':_0x1675d1['id']});});});});});}})['then'](respondWithStatusCode(_0x2a6ce3,null))[_0x5db3('0x26')](handleError(_0x2a6ce3,null));};exports['removeTeams']=function(_0xbeedc,_0x38a133){return db[_0x5db3('0x52')][_0x5db3('0x24')]({'where':{'id':_0xbeedc[_0x5db3('0x23')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5db3('0x19')](handleEntityNotFound(_0x38a133,null))[_0x5db3('0x19')](function(_0x329dc9){var _0x3a5faf=_[_0x5db3('0x1e')](_0x329dc9,'id');var _0x1898c4=[];var _0x264ed7=[];var _0x391ad9=squel[_0x5db3('0x5f')]();_0x391ad9['field']('tq.TeamId')[_0x5db3('0x60')]('team_has_chat_queues','tq')[_0x5db3('0x61')](_0x5db3('0x62'),'ut',_0x5db3('0x63'))[_0x5db3('0x21')](_0x5db3('0x64'),_0xbeedc['params']['id']);for(var _0x537d10=0x0;_0x537d10<_0x329dc9[_0x5db3('0x2f')];_0x537d10+=0x1){let _0x5039ee=_0x329dc9[_0x537d10];for(var _0x5bf544=0x0;_0x5bf544<_0x5039ee[_0x5db3('0x56')][_0x5db3('0x2f')];_0x5bf544+=0x1){let _0x21a2ec=_0x5039ee[_0x5db3('0x56')][_0x5bf544];var _0x121f82=_0x391ad9['clone']();_0x121f82[_0x5db3('0x21')](_0x5db3('0x65'),_0x21a2ec['id']);_0x264ed7[_0x5db3('0x66')](db[_0x5db3('0x67')]['query'](_0x121f82[_0x5db3('0x68')](),{'type':db[_0x5db3('0x67')][_0x5db3('0x69')][_0x5db3('0x6a')]})[_0x5db3('0x19')](function(_0x532e25){if(_0x532e25['length']===0x1){return _0x21a2ec['id'];}else{var _0x113a49=_[_0x5db3('0x6b')](_[_0x5db3('0x1e')](_0x532e25,_0x5db3('0x6c')),function(_0x20a8dd){return _[_0x5db3('0x6d')](_0x3a5faf,_0x20a8dd);});if(_0x113a49){return _0x21a2ec['id'];}}}));}}return BPromise[_0x5db3('0x6e')](_0x264ed7)[_0x5db3('0x19')](function(_0x14751e){_0x1898c4=_(_0x1898c4)[_0x5db3('0x6f')](_0x14751e)[_0x5db3('0x70')]()[_0x5db3('0x71')]();return db[_0x5db3('0x1f')]['find']({'where':{'id':_0xbeedc[_0x5db3('0x28')]['id']}})[_0x5db3('0x19')](function(_0x127da1){return db[_0x5db3('0x67')][_0x5db3('0x5a')](function(_0x23d606){return _0x127da1[_0x5db3('0x72')](_0xbeedc[_0x5db3('0x23')]['ids'],{'transaction':_0x23d606})['then'](function(){if(!_[_0x5db3('0x73')](_0x1898c4)){return _0x127da1[_0x5db3('0x74')](_0x1898c4,{'transaction':_0x23d606});}})[_0x5db3('0x19')](function(){_0x1898c4[_0x5db3('0x5d')](function(_0x508d97){socket[_0x5db3('0x75')](_0x5db3('0x76'),{'UserId':_0x508d97,'ChatQueueId':_0x127da1['id']});});});});});});})[_0x5db3('0x19')](respondWithStatusCode(_0x38a133,null))[_0x5db3('0x26')](handleError(_0x38a133,null));};exports[_0x5db3('0x77')]=function(_0x1f37c5,_0x250b63){return db['ChatQueue'][_0x5db3('0x32')]({'where':{'id':_0x1f37c5[_0x5db3('0x28')]['id']}})['then'](handleEntityNotFound(_0x250b63,null))[_0x5db3('0x19')](function(_0x58dfa4){if(_0x58dfa4){return _0x58dfa4[_0x5db3('0x77')](_0x1f37c5[_0x5db3('0x34')][_0x5db3('0x55')],_[_0x5db3('0x78')](_0x1f37c5[_0x5db3('0x34')],['ids','id'])||{})[_0x5db3('0x79')](function(_0xca9143){for(var _0x3f7ff=0x0;_0x3f7ff<_0x1f37c5[_0x5db3('0x34')][_0x5db3('0x55')][_0x5db3('0x2f')];_0x3f7ff+=0x1){socket[_0x5db3('0x75')](_0x5db3('0x5e'),{'UserId':Number(_0x1f37c5[_0x5db3('0x34')]['ids'][_0x3f7ff]),'ChatQueueId':Number(_0x1f37c5[_0x5db3('0x28')]['id'])});}return _0xca9143;});}})['then'](respondWithResult(_0x250b63,null))[_0x5db3('0x26')](handleError(_0x250b63,null));};exports[_0x5db3('0x74')]=function(_0x5acf9a,_0x2dea47){return db['ChatQueue']['find']({'where':{'id':_0x5acf9a[_0x5db3('0x28')]['id']}})[_0x5db3('0x19')](handleEntityNotFound(_0x2dea47,null))[_0x5db3('0x19')](function(_0x12a7cb){if(_0x12a7cb){return _0x12a7cb['removeAgents'](_0x5acf9a[_0x5db3('0x23')]['ids'])['then'](function(){if(_[_0x5db3('0x7a')](_0x5acf9a['query'][_0x5db3('0x55')])){for(var _0x1d78f2=0x0;_0x1d78f2<_0x5acf9a[_0x5db3('0x23')]['ids'][_0x5db3('0x2f')];_0x1d78f2+=0x1){socket[_0x5db3('0x75')](_0x5db3('0x76'),{'UserId':Number(_0x5acf9a[_0x5db3('0x23')]['ids'][_0x1d78f2]),'ChatQueueId':Number(_0x5acf9a['params']['id'])});}}else{socket[_0x5db3('0x75')](_0x5db3('0x76'),{'UserId':Number(_0x5acf9a[_0x5db3('0x23')][_0x5db3('0x55')]),'ChatQueueId':Number(_0x5acf9a[_0x5db3('0x28')]['id'])});}});}})[_0x5db3('0x19')](respondWithStatusCode(_0x2dea47,null))[_0x5db3('0x26')](handleError(_0x2dea47,null));};exports[_0x5db3('0x7b')]=function(_0x3ca517,_0x189aa0){var _0x1d5ea9={};var _0x43e6b3={};var _0x55290c;var _0x14976b;return db[_0x5db3('0x1f')]['findOne']({'where':{'id':_0x3ca517['params']['id']}})[_0x5db3('0x19')](handleEntityNotFound(_0x189aa0,null))[_0x5db3('0x19')](function(_0x449ece){if(_0x449ece){_0x55290c=_0x449ece;_0x43e6b3['model']=_[_0x5db3('0x2a')](db[_0x5db3('0x48')][_0x5db3('0x20')]);_0x43e6b3['query']=_[_0x5db3('0x2a')](_0x3ca517[_0x5db3('0x23')]);_0x43e6b3['filters']=_[_0x5db3('0x2c')](_0x43e6b3['model'],_0x43e6b3[_0x5db3('0x23')]);_0x1d5ea9[_0x5db3('0x2d')]=_[_0x5db3('0x2c')](_0x43e6b3[_0x5db3('0x29')],qs[_0x5db3('0x2e')](_0x3ca517[_0x5db3('0x23')]['fields']));_0x1d5ea9[_0x5db3('0x2d')]=_0x1d5ea9['attributes'][_0x5db3('0x2f')]?_0x1d5ea9['attributes']:_0x43e6b3[_0x5db3('0x29')];_0x1d5ea9['order']=qs[_0x5db3('0x42')](_0x3ca517['query'][_0x5db3('0x42')]);_0x1d5ea9[_0x5db3('0x21')]=qs[_0x5db3('0x2b')](_[_0x5db3('0x43')](_0x3ca517[_0x5db3('0x23')],_0x43e6b3[_0x5db3('0x2b')]));if(_0x3ca517['query'][_0x5db3('0x45')]){_0x1d5ea9['where']=_['merge'](_0x1d5ea9[_0x5db3('0x21')],{'$or':_[_0x5db3('0x1e')](_0x1d5ea9[_0x5db3('0x2d')],function(_0x5e4823){var _0x3a53fb={};_0x3a53fb[_0x5e4823]={'$like':'%'+_0x3ca517[_0x5db3('0x23')][_0x5db3('0x45')]+'%'};return _0x3a53fb;})});}_0x1d5ea9=_[_0x5db3('0x46')]({},_0x1d5ea9,_0x3ca517[_0x5db3('0x31')]);return _0x55290c['getAgents'](_0x1d5ea9);}})[_0x5db3('0x19')](function(_0x5b986a){if(_0x5b986a){_0x14976b=_0x5b986a[_0x5db3('0x2f')];if(!_0x3ca517['query']['hasOwnProperty'](_0x5db3('0x40'))){_0x1d5ea9[_0x5db3('0x13')]=qs[_0x5db3('0x13')](_0x3ca517['query'][_0x5db3('0x13')]);_0x1d5ea9['offset']=qs[_0x5db3('0x14')](_0x3ca517['query'][_0x5db3('0x14')]);}return _0x55290c[_0x5db3('0x7b')](_0x1d5ea9);}})[_0x5db3('0x19')](function(_0x2e1c12){if(_0x2e1c12){return _0x2e1c12?{'count':_0x14976b,'rows':_0x2e1c12}:null;}})[_0x5db3('0x19')](respondWithResult(_0x189aa0,null))['catch'](handleError(_0x189aa0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index d045937..6960a2d 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 _0x07d5=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x8b4b73,_0x52d63b){var _0x488f96=function(_0x27a6cb){while(--_0x27a6cb){_0x8b4b73['push'](_0x8b4b73['shift']());}};_0x488f96(++_0x52d63b);}(_0x07d5,0x15c));var _0x507d=function(_0x318b5d,_0xaf3b7a){_0x318b5d=_0x318b5d-0x0;var _0x577ab8=_0x07d5[_0x318b5d];return _0x577ab8;};'use strict';var EventEmitter=require(_0x507d('0x0'));var ChatQueue=require(_0x507d('0x1'))['db'][_0x507d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x507d('0x3')](0x0);var events={'afterCreate':_0x507d('0x4'),'afterUpdate':_0x507d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2e732b){return function(_0x491d29,_0x23c1e2,_0x4560f6){ChatQueueEvents[_0x507d('0x6')](_0x2e732b+':'+_0x491d29['id'],_0x491d29);ChatQueueEvents[_0x507d('0x6')](_0x2e732b,_0x491d29);_0x4560f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x507d('0x7')](e,emitEvent(event));}}module[_0x507d('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x9eca=['emit','hook','exports','events','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x4e66dc,_0x304b2b){var _0x50126c=function(_0x4de7f4){while(--_0x4de7f4){_0x4e66dc['push'](_0x4e66dc['shift']());}};_0x50126c(++_0x304b2b);}(_0x9eca,0xd2));var _0xa9ec=function(_0x150a49,_0x47b070){_0x150a49=_0x150a49-0x0;var _0xe8c345=_0x9eca[_0x150a49];return _0xe8c345;};'use strict';var EventEmitter=require(_0xa9ec('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xa9ec('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa9ec('0x2')](0x0);var events={'afterCreate':_0xa9ec('0x3'),'afterUpdate':_0xa9ec('0x4'),'afterDestroy':_0xa9ec('0x5')};function emitEvent(_0x520561){return function(_0x331d90,_0x49e2ae,_0x493bcc){ChatQueueEvents[_0xa9ec('0x6')](_0x520561+':'+_0x331d90['id'],_0x331d90);ChatQueueEvents['emit'](_0x520561,_0x331d90);_0x493bcc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xa9ec('0x7')](e,emitEvent(event));}}module[_0xa9ec('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 5aa9bd2..17e2d6d 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 _0x59ed=['bluebird','path','rimraf','../../config/environment','exports','define','ChatQueue','lodash','util','../../config/logger','api','moment'];(function(_0x4e8656,_0x1f2774){var _0x299fa2=function(_0x25c2d4){while(--_0x25c2d4){_0x4e8656['push'](_0x4e8656['shift']());}};_0x299fa2(++_0x1f2774);}(_0x59ed,0x16f));var _0xd59e=function(_0x15fe68,_0xddc145){_0x15fe68=_0x15fe68-0x0;var _0x1d144c=_0x59ed[_0x15fe68];return _0x1d144c;};'use strict';var _=require(_0xd59e('0x0'));var util=require(_0xd59e('0x1'));var logger=require(_0xd59e('0x2'))(_0xd59e('0x3'));var moment=require(_0xd59e('0x4'));var BPromise=require(_0xd59e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd59e('0x6'));var rimraf=require(_0xd59e('0x7'));var config=require(_0xd59e('0x8'));var attributes=require('./chatQueue.attributes');module[_0xd59e('0x9')]=function(_0x4a686e,_0x25ff51){return _0x4a686e[_0xd59e('0xa')](_0xd59e('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd40c=['exports','define','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xd40c,0xfa));var _0xcd40=function(_0x331e4d,_0x57f3fa){_0x331e4d=_0x331e4d-0x0;var _0x2cf19d=_0xd40c[_0x331e4d];return _0x2cf19d;};'use strict';var _=require(_0xcd40('0x0'));var util=require(_0xcd40('0x1'));var logger=require(_0xcd40('0x2'))(_0xcd40('0x3'));var moment=require(_0xcd40('0x4'));var BPromise=require(_0xcd40('0x5'));var rp=require(_0xcd40('0x6'));var fs=require('fs');var path=require(_0xcd40('0x7'));var rimraf=require('rimraf');var config=require(_0xcd40('0x8'));var attributes=require(_0xcd40('0x9'));module[_0xcd40('0xa')]=function(_0x4770ed,_0x373c57){return _0x4770ed[_0xcd40('0xb')]('ChatQueue',attributes,{'tableName':_0xcd40('0xc'),'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 a853b03..4fece70 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 _0xc264=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetChatQueue','findAll','raw','options','where','limit','include','map','model','attributes','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2fc4ee,_0x2e5b4b){var _0x15958a=function(_0x2945ea){while(--_0x2945ea){_0x2fc4ee['push'](_0x2fc4ee['shift']());}};_0x15958a(++_0x2e5b4b);}(_0xc264,0x1a6));var _0x4c26=function(_0x44feb5,_0x3f7964){_0x44feb5=_0x44feb5-0x0;var _0x45e3b8=_0xc264[_0x44feb5];return _0x45e3b8;};'use strict';var _=require(_0x4c26('0x0'));var util=require(_0x4c26('0x1'));var moment=require(_0x4c26('0x2'));var BPromise=require(_0x4c26('0x3'));var rs=require(_0x4c26('0x4'));var fs=require('fs');var Redis=require(_0x4c26('0x5'));var db=require(_0x4c26('0x6'))['db'];var utils=require(_0x4c26('0x7'));var logger=require(_0x4c26('0x8'))('rpc');var config=require(_0x4c26('0x9'));var jayson=require(_0x4c26('0xa'));var client=jayson[_0x4c26('0xb')][_0x4c26('0xc')]({'port':0x232a});config[_0x4c26('0xd')]=_['defaults'](config[_0x4c26('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c26('0xe'))(new Redis(config[_0x4c26('0xd')]));require(_0x4c26('0xf'))[_0x4c26('0x10')](socket);function respondWithRpcPromise(_0x16cbaa,_0x36ee28,_0x5c9b4c){return new BPromise(function(_0x2fe8c3,_0x535543){return client['request'](_0x16cbaa,_0x5c9b4c)[_0x4c26('0x11')](function(_0xdd5ab5){logger[_0x4c26('0x12')](_0x4c26('0x13'),_0x36ee28,_0x4c26('0x14'));logger[_0x4c26('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x36ee28,_0x4c26('0x14'),JSON[_0x4c26('0x16')](_0xdd5ab5));if(_0xdd5ab5[_0x4c26('0x17')]){if(_0xdd5ab5[_0x4c26('0x17')][_0x4c26('0x18')]===0x1f4){logger[_0x4c26('0x17')](_0x4c26('0x13'),_0x36ee28,_0xdd5ab5['error'][_0x4c26('0x19')]);return _0x535543(_0xdd5ab5['error'][_0x4c26('0x19')]);}logger['error'](_0x4c26('0x13'),_0x36ee28,_0xdd5ab5[_0x4c26('0x17')][_0x4c26('0x19')]);return _0x2fe8c3(_0xdd5ab5[_0x4c26('0x17')][_0x4c26('0x19')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x36ee28,'request\x20sent');_0x2fe8c3(_0xdd5ab5['result'][_0x4c26('0x19')]);}})[_0x4c26('0x1a')](function(_0xca475a){logger[_0x4c26('0x17')](_0x4c26('0x13'),_0x36ee28,_0xca475a);_0x535543(_0xca475a);});});}exports[_0x4c26('0x1b')]=function(_0xe4f0e1){var _0x561b61=this;return new Promise(function(_0x442fc9,_0x2fca53){return db['ChatQueue'][_0x4c26('0x1c')]({'raw':_0xe4f0e1['options']?_0xe4f0e1['options'][_0x4c26('0x1d')]===undefined?!![]:![]:!![],'where':_0xe4f0e1[_0x4c26('0x1e')]?_0xe4f0e1[_0x4c26('0x1e')][_0x4c26('0x1f')]||null:null,'attributes':_0xe4f0e1[_0x4c26('0x1e')]?_0xe4f0e1[_0x4c26('0x1e')]['attributes']||null:null,'limit':_0xe4f0e1[_0x4c26('0x1e')]?_0xe4f0e1[_0x4c26('0x1e')][_0x4c26('0x20')]||null:null,'include':_0xe4f0e1[_0x4c26('0x1e')]?_0xe4f0e1[_0x4c26('0x1e')][_0x4c26('0x21')]?_[_0x4c26('0x22')](_0xe4f0e1[_0x4c26('0x1e')][_0x4c26('0x21')],function(_0x394676){return{'model':db[_0x394676[_0x4c26('0x23')]],'as':_0x394676['as'],'attributes':_0x394676[_0x4c26('0x24')],'include':_0x394676['include']?_[_0x4c26('0x22')](_0x394676[_0x4c26('0x21')],function(_0x42d357){return{'model':db[_0x42d357[_0x4c26('0x23')]],'as':_0x42d357['as'],'attributes':_0x42d357['attributes'],'include':_0x42d357[_0x4c26('0x21')]?_[_0x4c26('0x22')](_0x42d357['include'],function(_0x580ef7){return{'model':db[_0x580ef7[_0x4c26('0x23')]],'as':_0x580ef7['as'],'attributes':_0x580ef7[_0x4c26('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4812fe){logger[_0x4c26('0x12')](_0x4c26('0x1b'),_0xe4f0e1);logger[_0x4c26('0x15')]('GetChatQueue',_0xe4f0e1,JSON[_0x4c26('0x16')](_0x4812fe));_0x442fc9(_0x4812fe);})[_0x4c26('0x1a')](function(_0x6ebe28){logger['error']('GetChatQueue',_0x6ebe28[_0x4c26('0x19')],_0xe4f0e1);_0x2fca53(_0x561b61['error'](0x1f4,_0x6ebe28[_0x4c26('0x19')]));});});};exports[_0x4c26('0x25')]=function(_0x3f5ef3){var _0xf8a60f=this;return new Promise(function(_0x36c2fd,_0x3e3c57){return db['ChatQueue'][_0x4c26('0x26')]({'raw':_0x3f5ef3[_0x4c26('0x1e')]?_0x3f5ef3[_0x4c26('0x1e')][_0x4c26('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f5ef3['options']?_0x3f5ef3[_0x4c26('0x1e')][_0x4c26('0x1f')]||null:null,'attributes':_0x3f5ef3['options']?_0x3f5ef3['options'][_0x4c26('0x24')]||null:null,'include':_0x3f5ef3[_0x4c26('0x1e')]?_0x3f5ef3[_0x4c26('0x1e')]['include']?_[_0x4c26('0x22')](_0x3f5ef3[_0x4c26('0x1e')]['include'],function(_0x34a1af){return{'model':db[_0x34a1af[_0x4c26('0x23')]],'as':_0x34a1af['as'],'attributes':_0x34a1af[_0x4c26('0x24')],'include':_0x34a1af['include']?_[_0x4c26('0x22')](_0x34a1af[_0x4c26('0x21')],function(_0x39209a){return{'model':db[_0x39209a[_0x4c26('0x23')]],'as':_0x39209a['as'],'attributes':_0x39209a[_0x4c26('0x24')],'include':_0x39209a[_0x4c26('0x21')]?_[_0x4c26('0x22')](_0x39209a[_0x4c26('0x21')],function(_0x3b4ecd){return{'model':db[_0x3b4ecd['model']],'as':_0x3b4ecd['as'],'attributes':_0x3b4ecd[_0x4c26('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4c26('0x11')](function(_0x23b3c1){logger[_0x4c26('0x12')](_0x4c26('0x25'),_0x3f5ef3);logger[_0x4c26('0x15')](_0x4c26('0x25'),_0x3f5ef3,JSON[_0x4c26('0x16')](_0x23b3c1));_0x36c2fd(_0x23b3c1);})[_0x4c26('0x1a')](function(_0x1cceb0){logger[_0x4c26('0x17')](_0x4c26('0x25'),_0x1cceb0[_0x4c26('0x19')],_0x3f5ef3);_0x3e3c57(_0xf8a60f[_0x4c26('0x17')](0x1f4,_0x1cceb0['message']));});});};
\ No newline at end of file
+var _0xa63a=['defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','attributes','model','ShowChatQueue','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xa63a,0x154));var _0xaa63=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xa63a[_0x26f702];return _0x11417d;};'use strict';var _=require('lodash');var util=require(_0xaa63('0x0'));var moment=require(_0xaa63('0x1'));var BPromise=require(_0xaa63('0x2'));var rs=require(_0xaa63('0x3'));var fs=require('fs');var Redis=require(_0xaa63('0x4'));var db=require(_0xaa63('0x5'))['db'];var utils=require(_0xaa63('0x6'));var logger=require(_0xaa63('0x7'))(_0xaa63('0x8'));var config=require(_0xaa63('0x9'));var jayson=require(_0xaa63('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xaa63('0xb')](config['redis'],{'host':_0xaa63('0xc'),'port':0x18eb});var socket=require(_0xaa63('0xd'))(new Redis(config['redis']));require(_0xaa63('0xe'))[_0xaa63('0xf')](socket);function respondWithRpcPromise(_0x1ac54f,_0x2e0dcf,_0x7d1c77){return new BPromise(function(_0x12de55,_0xc170dd){return client['request'](_0x1ac54f,_0x7d1c77)[_0xaa63('0x10')](function(_0xddfb8b){logger[_0xaa63('0x11')](_0xaa63('0x12'),_0x2e0dcf,_0xaa63('0x13'));logger[_0xaa63('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2e0dcf,'request\x20sent',JSON['stringify'](_0xddfb8b));if(_0xddfb8b['error']){if(_0xddfb8b[_0xaa63('0x15')][_0xaa63('0x16')]===0x1f4){logger[_0xaa63('0x15')](_0xaa63('0x12'),_0x2e0dcf,_0xddfb8b[_0xaa63('0x15')][_0xaa63('0x17')]);return _0xc170dd(_0xddfb8b[_0xaa63('0x15')][_0xaa63('0x17')]);}logger['error'](_0xaa63('0x12'),_0x2e0dcf,_0xddfb8b[_0xaa63('0x15')][_0xaa63('0x17')]);return _0x12de55(_0xddfb8b[_0xaa63('0x15')][_0xaa63('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2e0dcf,_0xaa63('0x13'));_0x12de55(_0xddfb8b[_0xaa63('0x18')][_0xaa63('0x17')]);}})[_0xaa63('0x19')](function(_0x222d44){logger[_0xaa63('0x15')](_0xaa63('0x12'),_0x2e0dcf,_0x222d44);_0xc170dd(_0x222d44);});});}exports[_0xaa63('0x1a')]=function(_0x1d7691){var _0x560527=this;return new Promise(function(_0x2778d0,_0x4bb43e){return db[_0xaa63('0x1b')][_0xaa63('0x1c')]({'raw':_0x1d7691[_0xaa63('0x1d')]?_0x1d7691[_0xaa63('0x1d')][_0xaa63('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d7691[_0xaa63('0x1d')]?_0x1d7691[_0xaa63('0x1d')][_0xaa63('0x1f')]||null:null,'attributes':_0x1d7691[_0xaa63('0x1d')]?_0x1d7691[_0xaa63('0x1d')]['attributes']||null:null,'limit':_0x1d7691[_0xaa63('0x1d')]?_0x1d7691[_0xaa63('0x1d')][_0xaa63('0x20')]||null:null,'include':_0x1d7691[_0xaa63('0x1d')]?_0x1d7691['options'][_0xaa63('0x21')]?_[_0xaa63('0x22')](_0x1d7691[_0xaa63('0x1d')][_0xaa63('0x21')],function(_0xf4abb4){return{'model':db[_0xf4abb4['model']],'as':_0xf4abb4['as'],'attributes':_0xf4abb4[_0xaa63('0x23')],'include':_0xf4abb4[_0xaa63('0x21')]?_[_0xaa63('0x22')](_0xf4abb4[_0xaa63('0x21')],function(_0x2dcaac){return{'model':db[_0x2dcaac[_0xaa63('0x24')]],'as':_0x2dcaac['as'],'attributes':_0x2dcaac['attributes'],'include':_0x2dcaac[_0xaa63('0x21')]?_[_0xaa63('0x22')](_0x2dcaac['include'],function(_0x134d17){return{'model':db[_0x134d17[_0xaa63('0x24')]],'as':_0x134d17['as'],'attributes':_0x134d17[_0xaa63('0x23')]};}):[]};}):[]};}):[]:[]})[_0xaa63('0x10')](function(_0xa3ff02){logger[_0xaa63('0x11')](_0xaa63('0x1a'),_0x1d7691);logger['debug'](_0xaa63('0x1a'),_0x1d7691,JSON['stringify'](_0xa3ff02));_0x2778d0(_0xa3ff02);})[_0xaa63('0x19')](function(_0x1ce261){logger[_0xaa63('0x15')]('GetChatQueue',_0x1ce261[_0xaa63('0x17')],_0x1d7691);_0x4bb43e(_0x560527[_0xaa63('0x15')](0x1f4,_0x1ce261[_0xaa63('0x17')]));});});};exports[_0xaa63('0x25')]=function(_0x1908ae){var _0x26d2a3=this;return new Promise(function(_0xa7bb44,_0x5497d8){return db['ChatQueue']['find']({'raw':_0x1908ae[_0xaa63('0x1d')]?_0x1908ae[_0xaa63('0x1d')][_0xaa63('0x1e')]===undefined?!![]:![]:!![],'where':_0x1908ae[_0xaa63('0x1d')]?_0x1908ae[_0xaa63('0x1d')][_0xaa63('0x1f')]||null:null,'attributes':_0x1908ae['options']?_0x1908ae['options'][_0xaa63('0x23')]||null:null,'include':_0x1908ae[_0xaa63('0x1d')]?_0x1908ae['options'][_0xaa63('0x21')]?_[_0xaa63('0x22')](_0x1908ae[_0xaa63('0x1d')][_0xaa63('0x21')],function(_0x1d7974){return{'model':db[_0x1d7974[_0xaa63('0x24')]],'as':_0x1d7974['as'],'attributes':_0x1d7974[_0xaa63('0x23')],'include':_0x1d7974['include']?_['map'](_0x1d7974[_0xaa63('0x21')],function(_0x4f4c3a){return{'model':db[_0x4f4c3a[_0xaa63('0x24')]],'as':_0x4f4c3a['as'],'attributes':_0x4f4c3a[_0xaa63('0x23')],'include':_0x4f4c3a[_0xaa63('0x21')]?_[_0xaa63('0x22')](_0x4f4c3a['include'],function(_0x260371){return{'model':db[_0x260371[_0xaa63('0x24')]],'as':_0x260371['as'],'attributes':_0x260371[_0xaa63('0x23')]};}):[]};}):[]};}):[]:[]})[_0xaa63('0x10')](function(_0x491a6b){logger[_0xaa63('0x11')](_0xaa63('0x25'),_0x1908ae);logger[_0xaa63('0x14')](_0xaa63('0x25'),_0x1908ae,JSON[_0xaa63('0x26')](_0x491a6b));_0xa7bb44(_0x491a6b);})[_0xaa63('0x19')](function(_0x3dece5){logger[_0xaa63('0x15')]('ShowChatQueue',_0x3dece5['message'],_0x1908ae);_0x5497d8(_0x26d2a3[_0xaa63('0x15')](0x1f4,_0x3dece5[_0xaa63('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 34d24d3..c0e9e3a 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb903=['update','emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0xb903,0x185));var _0x3b90=function(_0xbefdda,_0xbef687){_0xbefdda=_0xbefdda-0x0;var _0x3fe607=_0xb903[_0xbefdda];return _0x3fe607;};'use strict';var ChatQueueEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){ChatQueueEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);ChatQueueEvents['on'](_0x153283,_0x2e4c06);}};
\ No newline at end of file
+var _0x9c44=['emit','removeListener','length','chatQueue:','remove','update'];(function(_0x2d0f87,_0x23395a){var _0x47bea0=function(_0x55e3eb){while(--_0x55e3eb){_0x2d0f87['push'](_0x2d0f87['shift']());}};_0x47bea0(++_0x23395a);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){ChatQueueEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);ChatQueueEvents['on'](_0x436234,_0x511d53);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 53e44ed..2ee2103 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x4628bc,_0x211dcc){var _0x3b5fd9=function(_0x360870){while(--_0x360870){_0x4628bc['push'](_0x4628bc['shift']());}};_0x3b5fd9(++_0x211dcc);}(_0x814b,0x1a2));var _0xb814=function(_0x39f375,_0x3aa8ec){_0x39f375=_0x39f375-0x0;var _0x463f93=_0x814b[_0x39f375];return _0x463f93;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x52d59e,_0x3c546d){var _0x364739=function(_0x3cd5aa){while(--_0x3cd5aa){_0x52d59e['push'](_0x52d59e['shift']());}};_0x364739(++_0x3c546d);}(_0x814b,0x1a2));var _0xb814=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x814b[_0x3a73bc];return _0x32891b;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 7e36097..cd5426c 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 _0x472c=['STRING','DATE','sequelize'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x472c,0x1a9));var _0xc472=function(_0x446aaa,_0x4db59a){_0x446aaa=_0x446aaa-0x0;var _0x4a5009=_0x472c[_0x446aaa];return _0x4a5009;};'use strict';var moment=require('moment');var Sequelize=require(_0xc472('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc472('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc472('0x2')]},'leaveAt':{'type':Sequelize[_0xc472('0x2')]},'acceptAt':{'type':Sequelize[_0xc472('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc472('0x1')]}};
\ No newline at end of file
+var _0xdc6c=['exports','STRING','DATE','sequelize'];(function(_0x31a81b,_0x5649eb){var _0x13b57b=function(_0x1c7d33){while(--_0x1c7d33){_0x31a81b['push'](_0x31a81b['shift']());}};_0x13b57b(++_0x5649eb);}(_0xdc6c,0x157));var _0xcdc6=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xdc6c[_0xf79bae];return _0x5d2cb7;};'use strict';var moment=require('moment');var Sequelize=require(_0xcdc6('0x0'));module[_0xcdc6('0x1')]={'uniqueid':{'type':Sequelize[_0xcdc6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xcdc6('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xcdc6('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcdc6('0x3')]},'reason':{'type':Sequelize[_0xcdc6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index f15eb06..3cb22f6 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 _0x27eb=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x27eb,0xd0));var _0xb27e=function(_0x4c0b4b,_0x8ceef){_0x4c0b4b=_0x4c0b4b-0x0;var _0x5e56a3=_0x27eb[_0x4c0b4b];return _0x5e56a3;};'use strict';var emlformat=require(_0xb27e('0x0'));var rimraf=require(_0xb27e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb27e('0x2'));var moment=require(_0xb27e('0x3'));var BPromise=require(_0xb27e('0x4'));var Mustache=require('mustache');var util=require(_0xb27e('0x5'));var path=require(_0xb27e('0x6'));var sox=require(_0xb27e('0x7'));var csv=require(_0xb27e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb27e('0x9'));var _=require(_0xb27e('0xa'));var squel=require(_0xb27e('0xb'));var crypto=require(_0xb27e('0xc'));var jsforce=require(_0xb27e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb27e('0x8'));var querystring=require(_0xb27e('0xe'));var Papa=require(_0xb27e('0xf'));var Redis=require(_0xb27e('0x10'));var authService=require(_0xb27e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb27e('0x12'));var hardwareService=require(_0xb27e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb27e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb27e('0x15'));var db=require(_0xb27e('0x16'))['db'];function respondWithStatusCode(_0x4d0b5d,_0x58b37f){_0x58b37f=_0x58b37f||0xcc;return function(_0x48c914){if(_0x48c914){return _0x4d0b5d[_0xb27e('0x17')](_0x58b37f);}return _0x4d0b5d['status'](_0x58b37f)[_0xb27e('0x18')]();};}function respondWithResult(_0x54657b,_0x1b55e2){_0x1b55e2=_0x1b55e2||0xc8;return function(_0x5aa86f){if(_0x5aa86f){return _0x54657b[_0xb27e('0x19')](_0x1b55e2)[_0xb27e('0x1a')](_0x5aa86f);}};}function respondWithFilteredResult(_0x28cc6d,_0x522bbf){return function(_0x26ec32){if(_0x26ec32){var _0x1d14bb=typeof _0x522bbf[_0xb27e('0x1b')]===_0xb27e('0x1c')&&typeof _0x522bbf[_0xb27e('0x1d')]===_0xb27e('0x1c');var _0x25ce70=_0x26ec32[_0xb27e('0x1e')];var _0x317f4e=_0x1d14bb?0x0:_0x522bbf['offset'];var _0x8be243=_0x1d14bb?_0x26ec32[_0xb27e('0x1e')]:_0x522bbf[_0xb27e('0x1b')]+_0x522bbf['limit'];var _0x352856;if(_0x8be243>=_0x25ce70){_0x8be243=_0x25ce70;_0x352856=0xc8;}else{_0x352856=0xce;}_0x28cc6d['status'](_0x352856);return _0x28cc6d['set'](_0xb27e('0x1f'),_0x317f4e+'-'+_0x8be243+'/'+_0x25ce70)[_0xb27e('0x1a')](_0x26ec32);}return null;};}function patchUpdates(_0x4ec66c){return function(_0x2a78c0){try{jsonpatch[_0xb27e('0x20')](_0x2a78c0,_0x4ec66c,!![]);}catch(_0x16c950){return BPromise[_0xb27e('0x21')](_0x16c950);}return _0x2a78c0['save']();};}function saveUpdates(_0x3c9e21,_0x5a3cdf){return function(_0x19c0f2){if(_0x19c0f2){return _0x19c0f2[_0xb27e('0x22')](_0x3c9e21)['then'](function(_0x58fc84){return _0x58fc84;});}return null;};}function removeEntity(_0x2146c0,_0xfbc258){return function(_0x3703ab){if(_0x3703ab){return _0x3703ab[_0xb27e('0x23')]()[_0xb27e('0x24')](function(){_0x2146c0['status'](0xcc)[_0xb27e('0x18')]();});}};}function handleEntityNotFound(_0x4cba0b,_0x3972bc){return function(_0x1ac460){if(!_0x1ac460){_0x4cba0b[_0xb27e('0x17')](0x194);}return _0x1ac460;};}function handleError(_0x3fbc78,_0x3254fb){_0x3254fb=_0x3254fb||0x1f4;return function(_0x4dab95){logger[_0xb27e('0x25')](_0x4dab95['stack']);if(_0x4dab95[_0xb27e('0x26')]){delete _0x4dab95[_0xb27e('0x26')];}_0x3fbc78[_0xb27e('0x19')](_0x3254fb)[_0xb27e('0x27')](_0x4dab95);};}exports[_0xb27e('0x28')]=function(_0x35169a,_0xd27061){var _0x125c0b={},_0x42c5de={},_0x4ef0e6={'count':0x0,'rows':[]};var _0x377d79=_[_0xb27e('0x29')](db[_0xb27e('0x2a')][_0xb27e('0x2b')],function(_0x58a1a9){return{'name':_0x58a1a9[_0xb27e('0x2c')],'type':_0x58a1a9[_0xb27e('0x2d')][_0xb27e('0x2e')]};});_0x42c5de[_0xb27e('0x2f')]=_[_0xb27e('0x29')](_0x377d79,_0xb27e('0x26'));_0x42c5de[_0xb27e('0x30')]=_['keys'](_0x35169a['query']);_0x42c5de[_0xb27e('0x31')]=_['intersection'](_0x42c5de[_0xb27e('0x2f')],_0x42c5de['query']);_0x125c0b[_0xb27e('0x32')]=_[_0xb27e('0x33')](_0x42c5de[_0xb27e('0x2f')],qs[_0xb27e('0x34')](_0x35169a[_0xb27e('0x30')][_0xb27e('0x34')]));_0x125c0b['attributes']=_0x125c0b[_0xb27e('0x32')]['length']?_0x125c0b[_0xb27e('0x32')]:_0x42c5de['model'];if(!_0x35169a[_0xb27e('0x30')]['hasOwnProperty'](_0xb27e('0x35'))){_0x125c0b[_0xb27e('0x1d')]=qs['limit'](_0x35169a['query'][_0xb27e('0x1d')]);_0x125c0b['offset']=qs['offset'](_0x35169a['query'][_0xb27e('0x1b')]);}_0x125c0b[_0xb27e('0x36')]=qs['sort'](_0x35169a[_0xb27e('0x30')][_0xb27e('0x37')]);_0x125c0b['where']=qs['filters'](_[_0xb27e('0x38')](_0x35169a['query'],_0x42c5de[_0xb27e('0x31')]),_0x377d79);if(_0x35169a['query'][_0xb27e('0x39')]){_0x125c0b[_0xb27e('0x3a')]=_[_0xb27e('0x3b')](_0x125c0b[_0xb27e('0x3a')],{'$or':_[_0xb27e('0x29')](_0x377d79,function(_0x1239d4){if(_0x1239d4[_0xb27e('0x2d')]!==_0xb27e('0x3c')){var _0x533343={};_0x533343[_0x1239d4[_0xb27e('0x26')]]={'$like':'%'+_0x35169a[_0xb27e('0x30')][_0xb27e('0x39')]+'%'};return _0x533343;}})});}_0x125c0b=_[_0xb27e('0x3b')]({},_0x125c0b,_0x35169a[_0xb27e('0x3d')]);var _0x564699={'where':_0x125c0b['where']};return db[_0xb27e('0x2a')][_0xb27e('0x1e')](_0x564699)[_0xb27e('0x24')](function(_0x5c7742){_0x4ef0e6[_0xb27e('0x1e')]=_0x5c7742;if(_0x35169a[_0xb27e('0x30')][_0xb27e('0x3e')]){_0x125c0b[_0xb27e('0x3f')]=[{'all':!![]}];}return db[_0xb27e('0x2a')][_0xb27e('0x40')](_0x125c0b);})[_0xb27e('0x24')](function(_0x4d90bf){_0x4ef0e6['rows']=_0x4d90bf;return _0x4ef0e6;})[_0xb27e('0x24')](respondWithFilteredResult(_0xd27061,_0x125c0b))[_0xb27e('0x41')](handleError(_0xd27061,null));};exports[_0xb27e('0x42')]=function(_0x3272ba,_0x11fafd){var _0x42f5e3={'raw':!![],'where':{'id':_0x3272ba[_0xb27e('0x43')]['id']}},_0x2959f5={};_0x2959f5['model']=_[_0xb27e('0x44')](db[_0xb27e('0x2a')][_0xb27e('0x2b')]);_0x2959f5[_0xb27e('0x30')]=_['keys'](_0x3272ba[_0xb27e('0x30')]);_0x2959f5['filters']=_['intersection'](_0x2959f5[_0xb27e('0x2f')],_0x2959f5[_0xb27e('0x30')]);_0x42f5e3['attributes']=_[_0xb27e('0x33')](_0x2959f5[_0xb27e('0x2f')],qs[_0xb27e('0x34')](_0x3272ba[_0xb27e('0x30')][_0xb27e('0x34')]));_0x42f5e3[_0xb27e('0x32')]=_0x42f5e3[_0xb27e('0x32')]['length']?_0x42f5e3[_0xb27e('0x32')]:_0x2959f5['model'];if(_0x3272ba[_0xb27e('0x30')][_0xb27e('0x3e')]){_0x42f5e3[_0xb27e('0x3f')]=[{'all':!![]}];}_0x42f5e3=_[_0xb27e('0x3b')]({},_0x42f5e3,_0x3272ba[_0xb27e('0x3d')]);return db[_0xb27e('0x2a')]['find'](_0x42f5e3)['then'](handleEntityNotFound(_0x11fafd,null))[_0xb27e('0x24')](respondWithResult(_0x11fafd,null))[_0xb27e('0x41')](handleError(_0x11fafd,null));};exports[_0xb27e('0x45')]=function(_0x15b5cb,_0x238bb9){return db['ChatQueueReport'][_0xb27e('0x45')](_0x15b5cb[_0xb27e('0x46')],{})[_0xb27e('0x24')](respondWithResult(_0x238bb9,0xc9))[_0xb27e('0x41')](handleError(_0x238bb9,null));};exports[_0xb27e('0x22')]=function(_0x16a71b,_0x320b9c){if(_0x16a71b[_0xb27e('0x46')]['id']){delete _0x16a71b[_0xb27e('0x46')]['id'];}return db[_0xb27e('0x2a')][_0xb27e('0x47')]({'where':{'id':_0x16a71b['params']['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x320b9c,null))['then'](saveUpdates(_0x16a71b[_0xb27e('0x46')],null))[_0xb27e('0x24')](respondWithResult(_0x320b9c,null))[_0xb27e('0x41')](handleError(_0x320b9c,null));};exports[_0xb27e('0x23')]=function(_0x91095,_0x1af27d){return db[_0xb27e('0x2a')][_0xb27e('0x47')]({'where':{'id':_0x91095['params']['id']}})['then'](handleEntityNotFound(_0x1af27d,null))[_0xb27e('0x24')](removeEntity(_0x1af27d,null))[_0xb27e('0x41')](handleError(_0x1af27d,null));};exports[_0xb27e('0x48')]=function(_0x583293,_0x1c4846){return db['ChatQueueReport'][_0xb27e('0x48')]()[_0xb27e('0x24')](respondWithResult(_0x1c4846,null))[_0xb27e('0x41')](handleError(_0x1c4846,null));};
\ No newline at end of file
+var _0x1c63=['merge','options','ChatQueueReport','findAll','rows','keys','includeAll','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','update','then','destroy','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x55415b,_0x5349ab){var _0x231dc9=function(_0x4a4d3b){while(--_0x4a4d3b){_0x55415b['push'](_0x55415b['shift']());}};_0x231dc9(++_0x5349ab);}(_0x1c63,0xdc));var _0x31c6=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0x1c63[_0x4f0c2b];return _0x526436;};'use strict';var emlformat=require(_0x31c6('0x0'));var rimraf=require(_0x31c6('0x1'));var zipdir=require(_0x31c6('0x2'));var jsonpatch=require(_0x31c6('0x3'));var rp=require('request-promise');var moment=require(_0x31c6('0x4'));var BPromise=require(_0x31c6('0x5'));var Mustache=require(_0x31c6('0x6'));var util=require('util');var path=require(_0x31c6('0x7'));var sox=require(_0x31c6('0x8'));var csv=require(_0x31c6('0x9'));var ejs=require(_0x31c6('0xa'));var fs=require('fs');var fs_extra=require(_0x31c6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x31c6('0xc'));var jsforce=require(_0x31c6('0xd'));var deskjs=require(_0x31c6('0xe'));var toCsv=require(_0x31c6('0x9'));var querystring=require(_0x31c6('0xf'));var Papa=require('papaparse');var Redis=require(_0x31c6('0x10'));var authService=require(_0x31c6('0x11'));var qs=require(_0x31c6('0x12'));var as=require(_0x31c6('0x13'));var hardwareService=require(_0x31c6('0x14'));var logger=require('../../config/logger')(_0x31c6('0x15'));var utils=require('../../config/utils');var config=require(_0x31c6('0x16'));var licenseUtil=require(_0x31c6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53c23d,_0x3424f0){_0x3424f0=_0x3424f0||0xcc;return function(_0x12f99c){if(_0x12f99c){return _0x53c23d[_0x31c6('0x18')](_0x3424f0);}return _0x53c23d[_0x31c6('0x19')](_0x3424f0)[_0x31c6('0x1a')]();};}function respondWithResult(_0x4d1710,_0x11e6a4){_0x11e6a4=_0x11e6a4||0xc8;return function(_0x3995cc){if(_0x3995cc){return _0x4d1710[_0x31c6('0x19')](_0x11e6a4)[_0x31c6('0x1b')](_0x3995cc);}};}function respondWithFilteredResult(_0x7a8c46,_0x5f1d49){return function(_0x5f2c85){if(_0x5f2c85){var _0x497264=typeof _0x5f1d49['offset']===_0x31c6('0x1c')&&typeof _0x5f1d49['limit']===_0x31c6('0x1c');var _0x2a4780=_0x5f2c85[_0x31c6('0x1d')];var _0xf352af=_0x497264?0x0:_0x5f1d49[_0x31c6('0x1e')];var _0x4c7f34=_0x497264?_0x5f2c85[_0x31c6('0x1d')]:_0x5f1d49[_0x31c6('0x1e')]+_0x5f1d49['limit'];var _0x593d2b;if(_0x4c7f34>=_0x2a4780){_0x4c7f34=_0x2a4780;_0x593d2b=0xc8;}else{_0x593d2b=0xce;}_0x7a8c46['status'](_0x593d2b);return _0x7a8c46[_0x31c6('0x1f')](_0x31c6('0x20'),_0xf352af+'-'+_0x4c7f34+'/'+_0x2a4780)[_0x31c6('0x1b')](_0x5f2c85);}return null;};}function patchUpdates(_0x24602f){return function(_0x4f17e5){try{jsonpatch['apply'](_0x4f17e5,_0x24602f,!![]);}catch(_0x4070f6){return BPromise[_0x31c6('0x21')](_0x4070f6);}return _0x4f17e5['save']();};}function saveUpdates(_0x339588,_0x1c6fda){return function(_0x392723){if(_0x392723){return _0x392723[_0x31c6('0x22')](_0x339588)[_0x31c6('0x23')](function(_0x509bed){return _0x509bed;});}return null;};}function removeEntity(_0x287c59,_0x536e57){return function(_0x8773d4){if(_0x8773d4){return _0x8773d4[_0x31c6('0x24')]()['then'](function(){_0x287c59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412a8a,_0x250ab1){return function(_0x551291){if(!_0x551291){_0x412a8a[_0x31c6('0x18')](0x194);}return _0x551291;};}function handleError(_0x44bf50,_0x2c9d78){_0x2c9d78=_0x2c9d78||0x1f4;return function(_0x2fb5f3){logger['error'](_0x2fb5f3['stack']);if(_0x2fb5f3['name']){delete _0x2fb5f3['name'];}_0x44bf50[_0x31c6('0x19')](_0x2c9d78)['send'](_0x2fb5f3);};}exports['index']=function(_0x1e24fa,_0x2034cc){var _0x5e3ed0={},_0x41100c={},_0x47a0cd={'count':0x0,'rows':[]};var _0x1d5ab5=_[_0x31c6('0x25')](db['ChatQueueReport'][_0x31c6('0x26')],function(_0x3840de){return{'name':_0x3840de[_0x31c6('0x27')],'type':_0x3840de[_0x31c6('0x28')][_0x31c6('0x29')]};});_0x41100c[_0x31c6('0x2a')]=_['map'](_0x1d5ab5,_0x31c6('0x2b'));_0x41100c[_0x31c6('0x2c')]=_['keys'](_0x1e24fa[_0x31c6('0x2c')]);_0x41100c[_0x31c6('0x2d')]=_['intersection'](_0x41100c['model'],_0x41100c['query']);_0x5e3ed0[_0x31c6('0x2e')]=_[_0x31c6('0x2f')](_0x41100c['model'],qs[_0x31c6('0x30')](_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x30')]));_0x5e3ed0[_0x31c6('0x2e')]=_0x5e3ed0[_0x31c6('0x2e')]['length']?_0x5e3ed0[_0x31c6('0x2e')]:_0x41100c[_0x31c6('0x2a')];if(!_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x31')](_0x31c6('0x32'))){_0x5e3ed0[_0x31c6('0x33')]=qs[_0x31c6('0x33')](_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x33')]);_0x5e3ed0['offset']=qs[_0x31c6('0x1e')](_0x1e24fa[_0x31c6('0x2c')]['offset']);}_0x5e3ed0[_0x31c6('0x34')]=qs[_0x31c6('0x35')](_0x1e24fa['query'][_0x31c6('0x35')]);_0x5e3ed0[_0x31c6('0x36')]=qs[_0x31c6('0x2d')](_['pick'](_0x1e24fa[_0x31c6('0x2c')],_0x41100c['filters']),_0x1d5ab5);if(_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x37')]){_0x5e3ed0[_0x31c6('0x36')]=_['merge'](_0x5e3ed0[_0x31c6('0x36')],{'$or':_[_0x31c6('0x25')](_0x1d5ab5,function(_0xdf5348){if(_0xdf5348[_0x31c6('0x28')]!=='VIRTUAL'){var _0x506491={};_0x506491[_0xdf5348[_0x31c6('0x2b')]]={'$like':'%'+_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x37')]+'%'};return _0x506491;}})});}_0x5e3ed0=_[_0x31c6('0x38')]({},_0x5e3ed0,_0x1e24fa[_0x31c6('0x39')]);var _0xeed7d7={'where':_0x5e3ed0[_0x31c6('0x36')]};return db[_0x31c6('0x3a')][_0x31c6('0x1d')](_0xeed7d7)[_0x31c6('0x23')](function(_0x4dba99){_0x47a0cd[_0x31c6('0x1d')]=_0x4dba99;if(_0x1e24fa[_0x31c6('0x2c')]['includeAll']){_0x5e3ed0['include']=[{'all':!![]}];}return db[_0x31c6('0x3a')][_0x31c6('0x3b')](_0x5e3ed0);})[_0x31c6('0x23')](function(_0xd85393){_0x47a0cd[_0x31c6('0x3c')]=_0xd85393;return _0x47a0cd;})[_0x31c6('0x23')](respondWithFilteredResult(_0x2034cc,_0x5e3ed0))['catch'](handleError(_0x2034cc,null));};exports['show']=function(_0x31c919,_0x5195b0){var _0x2c2129={'raw':!![],'where':{'id':_0x31c919['params']['id']}},_0x1f0b73={};_0x1f0b73[_0x31c6('0x2a')]=_[_0x31c6('0x3d')](db[_0x31c6('0x3a')][_0x31c6('0x26')]);_0x1f0b73[_0x31c6('0x2c')]=_[_0x31c6('0x3d')](_0x31c919['query']);_0x1f0b73[_0x31c6('0x2d')]=_[_0x31c6('0x2f')](_0x1f0b73[_0x31c6('0x2a')],_0x1f0b73[_0x31c6('0x2c')]);_0x2c2129[_0x31c6('0x2e')]=_['intersection'](_0x1f0b73[_0x31c6('0x2a')],qs[_0x31c6('0x30')](_0x31c919[_0x31c6('0x2c')][_0x31c6('0x30')]));_0x2c2129['attributes']=_0x2c2129[_0x31c6('0x2e')]['length']?_0x2c2129[_0x31c6('0x2e')]:_0x1f0b73[_0x31c6('0x2a')];if(_0x31c919[_0x31c6('0x2c')][_0x31c6('0x3e')]){_0x2c2129[_0x31c6('0x3f')]=[{'all':!![]}];}_0x2c2129=_['merge']({},_0x2c2129,_0x31c919[_0x31c6('0x39')]);return db[_0x31c6('0x3a')][_0x31c6('0x40')](_0x2c2129)[_0x31c6('0x23')](handleEntityNotFound(_0x5195b0,null))[_0x31c6('0x23')](respondWithResult(_0x5195b0,null))[_0x31c6('0x41')](handleError(_0x5195b0,null));};exports['create']=function(_0x36fc66,_0x52d06d){return db[_0x31c6('0x3a')]['create'](_0x36fc66['body'],{})[_0x31c6('0x23')](respondWithResult(_0x52d06d,0xc9))[_0x31c6('0x41')](handleError(_0x52d06d,null));};exports['update']=function(_0xf33b6c,_0x129197){if(_0xf33b6c[_0x31c6('0x42')]['id']){delete _0xf33b6c['body']['id'];}return db['ChatQueueReport'][_0x31c6('0x40')]({'where':{'id':_0xf33b6c[_0x31c6('0x43')]['id']}})[_0x31c6('0x23')](handleEntityNotFound(_0x129197,null))[_0x31c6('0x23')](saveUpdates(_0xf33b6c[_0x31c6('0x42')],null))[_0x31c6('0x23')](respondWithResult(_0x129197,null))[_0x31c6('0x41')](handleError(_0x129197,null));};exports[_0x31c6('0x24')]=function(_0x21ead7,_0x10f5b1){return db[_0x31c6('0x3a')][_0x31c6('0x40')]({'where':{'id':_0x21ead7['params']['id']}})['then'](handleEntityNotFound(_0x10f5b1,null))['then'](removeEntity(_0x10f5b1,null))[_0x31c6('0x41')](handleError(_0x10f5b1,null));};exports[_0x31c6('0x44')]=function(_0x1b0999,_0x433a63){return db[_0x31c6('0x3a')][_0x31c6('0x44')]()[_0x31c6('0x23')](respondWithResult(_0x433a63,null))['catch'](handleError(_0x433a63,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 2776eb7..b23d3f0 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x47f79b,_0x7ec50e){var _0x105e91=function(_0x35eb7b){while(--_0x35eb7b){_0x47f79b['push'](_0x47f79b['shift']());}};_0x105e91(++_0x7ec50e);}(_0x757a,0xde));var _0xa757=function(_0x4752da,_0x16f8e5){_0x4752da=_0x4752da-0x0;var _0x45099f=_0x757a[_0x4752da];return _0x45099f;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 9e91023..68d893a 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 _0x6d73=['raw','stringify','update','where','attributes','UpdateChatQueueReport','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options'];(function(_0x174d4d,_0x2c3337){var _0x5f0635=function(_0x33be5a){while(--_0x33be5a){_0x174d4d['push'](_0x174d4d['shift']());}};_0x5f0635(++_0x2c3337);}(_0x6d73,0x132));var _0x36d7=function(_0x2536ee,_0x38153b){_0x2536ee=_0x2536ee-0x0;var _0x318b70=_0x6d73[_0x2536ee];return _0x318b70;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x36d7('0x0'));var BPromise=require(_0x36d7('0x1'));var rs=require(_0x36d7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x36d7('0x3'))['db'];var utils=require(_0x36d7('0x4'));var logger=require(_0x36d7('0x5'))('rpc');var config=require(_0x36d7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x36d7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x583a46,_0x5b7cb2,_0x1052c8){return new BPromise(function(_0x4954fe,_0x3e80ae){return client[_0x36d7('0x8')](_0x583a46,_0x1052c8)[_0x36d7('0x9')](function(_0x5d1d01){logger[_0x36d7('0xa')](_0x36d7('0xb'),_0x5b7cb2,_0x36d7('0xc'));logger[_0x36d7('0xd')](_0x36d7('0xe'),_0x5b7cb2,_0x36d7('0xc'),JSON['stringify'](_0x5d1d01));if(_0x5d1d01[_0x36d7('0xf')]){if(_0x5d1d01[_0x36d7('0xf')][_0x36d7('0x10')]===0x1f4){logger[_0x36d7('0xf')](_0x36d7('0xb'),_0x5b7cb2,_0x5d1d01['error'][_0x36d7('0x11')]);return _0x3e80ae(_0x5d1d01['error']['message']);}logger[_0x36d7('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x5b7cb2,_0x5d1d01[_0x36d7('0xf')][_0x36d7('0x11')]);return _0x4954fe(_0x5d1d01['error'][_0x36d7('0x11')]);}else{logger[_0x36d7('0xa')](_0x36d7('0xb'),_0x5b7cb2,_0x36d7('0xc'));_0x4954fe(_0x5d1d01[_0x36d7('0x12')][_0x36d7('0x11')]);}})[_0x36d7('0x13')](function(_0x22e606){logger[_0x36d7('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x5b7cb2,_0x22e606);_0x3e80ae(_0x22e606);});});}exports[_0x36d7('0x14')]=function(_0x1562d8){var _0x2b55fb=this;return new Promise(function(_0x49b9bc,_0x5d5d80){return db[_0x36d7('0x15')]['create'](_0x1562d8[_0x36d7('0x16')],{'raw':_0x1562d8[_0x36d7('0x17')]?_0x1562d8[_0x36d7('0x17')][_0x36d7('0x18')]===undefined?!![]:![]:!![]})[_0x36d7('0x9')](function(_0x38a4c4){logger['info'](_0x36d7('0x14'),_0x1562d8);logger[_0x36d7('0xd')](_0x36d7('0x14'),_0x1562d8,JSON[_0x36d7('0x19')](_0x38a4c4));_0x49b9bc(_0x38a4c4);})['catch'](function(_0x46764f){logger[_0x36d7('0xf')](_0x36d7('0x14'),_0x46764f[_0x36d7('0x11')],_0x1562d8);_0x5d5d80(_0x2b55fb[_0x36d7('0xf')](0x1f4,_0x46764f['message']));});});};exports['UpdateChatQueueReport']=function(_0x375c30){var _0x17c045=this;return new Promise(function(_0x3ab567,_0x10e020){return db[_0x36d7('0x15')][_0x36d7('0x1a')](_0x375c30[_0x36d7('0x16')],{'raw':_0x375c30[_0x36d7('0x17')]?_0x375c30['options'][_0x36d7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x375c30[_0x36d7('0x17')]?_0x375c30[_0x36d7('0x17')][_0x36d7('0x1b')]||null:null,'attributes':_0x375c30[_0x36d7('0x17')]?_0x375c30['options'][_0x36d7('0x1c')]||null:null,'limit':_0x375c30[_0x36d7('0x17')]?_0x375c30[_0x36d7('0x17')]['limit']||null:null})['then'](function(_0x153501){logger[_0x36d7('0xa')]('UpdateChatQueueReport',_0x375c30);logger[_0x36d7('0xd')](_0x36d7('0x1d'),_0x375c30,JSON['stringify'](_0x153501));_0x3ab567(_0x153501);})[_0x36d7('0x13')](function(_0x55daa7){logger['error']('UpdateChatQueueReport',_0x55daa7[_0x36d7('0x11')],_0x375c30);_0x10e020(_0x17c045[_0x36d7('0xf')](0x1f4,_0x55daa7[_0x36d7('0x11')]));});});};
\ No newline at end of file
+var _0x89d9=['error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','UpdateChatQueueReport','options','attributes','stringify','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x14a6cb,_0x541724){var _0xcb4b15=function(_0x7c169){while(--_0x7c169){_0x14a6cb['push'](_0x14a6cb['shift']());}};_0xcb4b15(++_0x541724);}(_0x89d9,0x1c0));var _0x989d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x89d9[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x989d('0x0'));var util=require(_0x989d('0x1'));var moment=require('moment');var BPromise=require(_0x989d('0x2'));var rs=require(_0x989d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x989d('0x4'));var logger=require(_0x989d('0x5'))(_0x989d('0x6'));var config=require(_0x989d('0x7'));var jayson=require(_0x989d('0x8'));var client=jayson[_0x989d('0x9')][_0x989d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x70ccd4,_0xa17c24,_0x21e60f){return new BPromise(function(_0x2e1327,_0x400580){return client['request'](_0x70ccd4,_0x21e60f)[_0x989d('0xb')](function(_0x3eef17){logger[_0x989d('0xc')](_0x989d('0xd'),_0xa17c24,_0x989d('0xe'));logger[_0x989d('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0xa17c24,_0x989d('0xe'),JSON['stringify'](_0x3eef17));if(_0x3eef17['error']){if(_0x3eef17[_0x989d('0x10')][_0x989d('0x11')]===0x1f4){logger[_0x989d('0x10')](_0x989d('0xd'),_0xa17c24,_0x3eef17[_0x989d('0x10')][_0x989d('0x12')]);return _0x400580(_0x3eef17['error'][_0x989d('0x12')]);}logger[_0x989d('0x10')](_0x989d('0xd'),_0xa17c24,_0x3eef17[_0x989d('0x10')][_0x989d('0x12')]);return _0x2e1327(_0x3eef17[_0x989d('0x10')][_0x989d('0x12')]);}else{logger['info'](_0x989d('0xd'),_0xa17c24,_0x989d('0xe'));_0x2e1327(_0x3eef17['result']['message']);}})[_0x989d('0x13')](function(_0xb71b5d){logger['error'](_0x989d('0xd'),_0xa17c24,_0xb71b5d);_0x400580(_0xb71b5d);});});}exports[_0x989d('0x14')]=function(_0x46ee00){var _0x552205=this;return new Promise(function(_0xbc698a,_0x3ef7aa){return db[_0x989d('0x15')][_0x989d('0x16')](_0x46ee00[_0x989d('0x17')],{'raw':_0x46ee00['options']?_0x46ee00['options'][_0x989d('0x18')]===undefined?!![]:![]:!![]})[_0x989d('0xb')](function(_0x5c0fcd){logger[_0x989d('0xc')](_0x989d('0x14'),_0x46ee00);logger[_0x989d('0xf')](_0x989d('0x14'),_0x46ee00,JSON['stringify'](_0x5c0fcd));_0xbc698a(_0x5c0fcd);})[_0x989d('0x13')](function(_0x355822){logger['error'](_0x989d('0x14'),_0x355822['message'],_0x46ee00);_0x3ef7aa(_0x552205['error'](0x1f4,_0x355822[_0x989d('0x12')]));});});};exports[_0x989d('0x19')]=function(_0x4c67f8){var _0x22f28e=this;return new Promise(function(_0x23da76,_0x5218ab){return db[_0x989d('0x15')]['update'](_0x4c67f8[_0x989d('0x17')],{'raw':_0x4c67f8['options']?_0x4c67f8[_0x989d('0x1a')][_0x989d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c67f8[_0x989d('0x1a')]?_0x4c67f8[_0x989d('0x1a')]['where']||null:null,'attributes':_0x4c67f8[_0x989d('0x1a')]?_0x4c67f8[_0x989d('0x1a')][_0x989d('0x1b')]||null:null,'limit':_0x4c67f8['options']?_0x4c67f8['options']['limit']||null:null})[_0x989d('0xb')](function(_0x4647f){logger['info'](_0x989d('0x19'),_0x4c67f8);logger[_0x989d('0xf')](_0x989d('0x19'),_0x4c67f8,JSON[_0x989d('0x1c')](_0x4647f));_0x23da76(_0x4647f);})['catch'](function(_0x52e605){logger[_0x989d('0x10')](_0x989d('0x19'),_0x52e605[_0x989d('0x12')],_0x4c67f8);_0x5218ab(_0x22f28e[_0x989d('0x10')](0x1f4,_0x52e605[_0x989d('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 3e5dc06..f870a52 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 _0x8ea5=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','connect-timeout','Router','../../components/auth/service'];(function(_0x4ea599,_0x489c25){var _0x563cb8=function(_0x117757){while(--_0x117757){_0x4ea599['push'](_0x4ea599['shift']());}};_0x563cb8(++_0x489c25);}(_0x8ea5,0xe7));var _0x58ea=function(_0x5e3aa6,_0x14eb73){_0x5e3aa6=_0x5e3aa6-0x0;var _0x57f589=_0x8ea5[_0x5e3aa6];return _0x57f589;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x58ea('0x0'));var express=require('express');var router=express[_0x58ea('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x58ea('0x2'));var interaction=require(_0x58ea('0x3'));var config=require(_0x58ea('0x4'));var controller=require(_0x58ea('0x5'));router[_0x58ea('0x6')]('/',auth[_0x58ea('0x7')](),controller[_0x58ea('0x8')]);router[_0x58ea('0x6')](_0x58ea('0x9'),auth[_0x58ea('0x7')](),controller[_0x58ea('0xa')]);router[_0x58ea('0x6')](_0x58ea('0xb'),auth['isAuthenticated'](),controller[_0x58ea('0xc')]);router[_0x58ea('0xd')]('/',auth[_0x58ea('0x7')](),controller['create']);router['put'](_0x58ea('0xb'),auth['isAuthenticated'](),controller[_0x58ea('0xe')]);router[_0x58ea('0xf')](_0x58ea('0xb'),auth[_0x58ea('0x7')](),controller[_0x58ea('0x10')]);module[_0x58ea('0x11')]=router;
\ No newline at end of file
+var _0x8919=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','update','delete','destroy'];(function(_0x15ee80,_0x317bc4){var _0x4809ed=function(_0x1a6516){while(--_0x1a6516){_0x15ee80['push'](_0x15ee80['shift']());}};_0x4809ed(++_0x317bc4);}(_0x8919,0x10b));var _0x9891=function(_0xca4cf,_0x27f020){_0xca4cf=_0xca4cf-0x0;var _0x1152ac=_0x8919[_0xca4cf];return _0x1152ac;};'use strict';var multer=require(_0x9891('0x0'));var util=require(_0x9891('0x1'));var path=require(_0x9891('0x2'));var timeout=require(_0x9891('0x3'));var express=require(_0x9891('0x4'));var router=express[_0x9891('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9891('0x6'));var config=require('../../config/environment');var controller=require(_0x9891('0x7'));router[_0x9891('0x8')]('/',auth[_0x9891('0x9')](),controller['index']);router[_0x9891('0x8')](_0x9891('0xa'),auth[_0x9891('0x9')](),controller[_0x9891('0xb')]);router[_0x9891('0x8')](_0x9891('0xc'),auth[_0x9891('0x9')](),controller[_0x9891('0xd')]);router[_0x9891('0xe')]('/',auth[_0x9891('0x9')](),controller['create']);router['put'](_0x9891('0xc'),auth[_0x9891('0x9')](),controller[_0x9891('0xf')]);router[_0x9891('0x10')]('/:id',auth[_0x9891('0x9')](),controller[_0x9891('0x11')]);module[_0x9891('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 51547c7..649ec6f 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1df9c4,_0x31ed6d){var _0x54a9fe=function(_0x540de8){while(--_0x540de8){_0x1df9c4['push'](_0x1df9c4['shift']());}};_0x54a9fe(++_0x31ed6d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x562a00,_0x30239f){_0x562a00=_0x562a00-0x0;var _0x529272=_0x9bde[_0x562a00];return _0x529272;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 5c0ba12..476357f 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 _0x13d6=['status','end','json','undefined','limit','count','offset','reject','save','then','destroy','error','name','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','rows','catch','show','params','rawAttributes','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x17ef11,_0x41e000){var _0x2e5fee=function(_0x3adcbe){while(--_0x3adcbe){_0x17ef11['push'](_0x17ef11['shift']());}};_0x2e5fee(++_0x41e000);}(_0x13d6,0x196));var _0x613d=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0x13d6[_0x21b359];return _0x57b8e7;};'use strict';var emlformat=require(_0x613d('0x0'));var rimraf=require(_0x613d('0x1'));var zipdir=require(_0x613d('0x2'));var jsonpatch=require(_0x613d('0x3'));var rp=require(_0x613d('0x4'));var moment=require(_0x613d('0x5'));var BPromise=require(_0x613d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x613d('0x7'));var sox=require(_0x613d('0x8'));var csv=require(_0x613d('0x9'));var ejs=require(_0x613d('0xa'));var fs=require('fs');var fs_extra=require(_0x613d('0xb'));var _=require(_0x613d('0xc'));var squel=require(_0x613d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613d('0xe'));var toCsv=require(_0x613d('0x9'));var querystring=require(_0x613d('0xf'));var Papa=require(_0x613d('0x10'));var Redis=require('ioredis');var authService=require(_0x613d('0x11'));var qs=require(_0x613d('0x12'));var as=require(_0x613d('0x13'));var hardwareService=require(_0x613d('0x14'));var logger=require('../../config/logger')(_0x613d('0x15'));var utils=require(_0x613d('0x16'));var config=require(_0x613d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x613d('0x18'))['db'];function respondWithStatusCode(_0x44d823,_0x3f6008){_0x3f6008=_0x3f6008||0xcc;return function(_0x5887fa){if(_0x5887fa){return _0x44d823[_0x613d('0x19')](_0x3f6008);}return _0x44d823[_0x613d('0x1a')](_0x3f6008)[_0x613d('0x1b')]();};}function respondWithResult(_0x15b989,_0x28dc5d){_0x28dc5d=_0x28dc5d||0xc8;return function(_0x566583){if(_0x566583){return _0x15b989[_0x613d('0x1a')](_0x28dc5d)[_0x613d('0x1c')](_0x566583);}};}function respondWithFilteredResult(_0x532465,_0x2f2683){return function(_0x404d4c){if(_0x404d4c){var _0x5bb993=typeof _0x2f2683['offset']===_0x613d('0x1d')&&typeof _0x2f2683[_0x613d('0x1e')]===_0x613d('0x1d');var _0x3571b7=_0x404d4c[_0x613d('0x1f')];var _0x3a4c6e=_0x5bb993?0x0:_0x2f2683[_0x613d('0x20')];var _0x4017a8=_0x5bb993?_0x404d4c[_0x613d('0x1f')]:_0x2f2683['offset']+_0x2f2683['limit'];var _0x16d5d2;if(_0x4017a8>=_0x3571b7){_0x4017a8=_0x3571b7;_0x16d5d2=0xc8;}else{_0x16d5d2=0xce;}_0x532465[_0x613d('0x1a')](_0x16d5d2);return _0x532465['set']('Content-Range',_0x3a4c6e+'-'+_0x4017a8+'/'+_0x3571b7)['json'](_0x404d4c);}return null;};}function patchUpdates(_0x34191e){return function(_0xf2fecc){try{jsonpatch['apply'](_0xf2fecc,_0x34191e,!![]);}catch(_0x1f67e4){return BPromise[_0x613d('0x21')](_0x1f67e4);}return _0xf2fecc[_0x613d('0x22')]();};}function saveUpdates(_0x3c44cb,_0x1cf186){return function(_0x37fd5a){if(_0x37fd5a){return _0x37fd5a['update'](_0x3c44cb)[_0x613d('0x23')](function(_0x8cc199){return _0x8cc199;});}return null;};}function removeEntity(_0x51b8a8,_0x1c85a9){return function(_0x199a0f){if(_0x199a0f){return _0x199a0f[_0x613d('0x24')]()['then'](function(){_0x51b8a8['status'](0xcc)[_0x613d('0x1b')]();});}};}function handleEntityNotFound(_0x5d6b80,_0x436de4){return function(_0x4dd122){if(!_0x4dd122){_0x5d6b80[_0x613d('0x19')](0x194);}return _0x4dd122;};}function handleError(_0x585ddc,_0x41d3cf){_0x41d3cf=_0x41d3cf||0x1f4;return function(_0x35faf5){logger[_0x613d('0x25')](_0x35faf5['stack']);if(_0x35faf5['name']){delete _0x35faf5[_0x613d('0x26')];}_0x585ddc[_0x613d('0x1a')](_0x41d3cf)['send'](_0x35faf5);};}exports[_0x613d('0x27')]=function(_0xc06fad,_0x3fb0fd){var _0x5ccac3={},_0x204212={},_0x35b1dc={'count':0x0,'rows':[]};var _0x422fc2=_[_0x613d('0x28')](db[_0x613d('0x29')]['rawAttributes'],function(_0x5c0b88){return{'name':_0x5c0b88[_0x613d('0x2a')],'type':_0x5c0b88[_0x613d('0x2b')][_0x613d('0x2c')]};});_0x204212[_0x613d('0x2d')]=_[_0x613d('0x28')](_0x422fc2,_0x613d('0x26'));_0x204212[_0x613d('0x2e')]=_[_0x613d('0x2f')](_0xc06fad[_0x613d('0x2e')]);_0x204212[_0x613d('0x30')]=_[_0x613d('0x31')](_0x204212[_0x613d('0x2d')],_0x204212[_0x613d('0x2e')]);_0x5ccac3[_0x613d('0x32')]=_[_0x613d('0x31')](_0x204212['model'],qs[_0x613d('0x33')](_0xc06fad['query'][_0x613d('0x33')]));_0x5ccac3[_0x613d('0x32')]=_0x5ccac3['attributes'][_0x613d('0x34')]?_0x5ccac3[_0x613d('0x32')]:_0x204212[_0x613d('0x2d')];if(!_0xc06fad[_0x613d('0x2e')]['hasOwnProperty'](_0x613d('0x35'))){_0x5ccac3[_0x613d('0x1e')]=qs[_0x613d('0x1e')](_0xc06fad[_0x613d('0x2e')][_0x613d('0x1e')]);_0x5ccac3[_0x613d('0x20')]=qs['offset'](_0xc06fad['query'][_0x613d('0x20')]);}_0x5ccac3[_0x613d('0x36')]=qs[_0x613d('0x37')](_0xc06fad['query'][_0x613d('0x37')]);_0x5ccac3['where']=qs[_0x613d('0x30')](_['pick'](_0xc06fad['query'],_0x204212[_0x613d('0x30')]),_0x422fc2);if(_0xc06fad['query']['filter']){_0x5ccac3[_0x613d('0x38')]=_['merge'](_0x5ccac3[_0x613d('0x38')],{'$or':_[_0x613d('0x28')](_0x422fc2,function(_0x1579df){if(_0x1579df[_0x613d('0x2b')]!==_0x613d('0x39')){var _0x402a55={};_0x402a55[_0x1579df['name']]={'$like':'%'+_0xc06fad[_0x613d('0x2e')][_0x613d('0x3a')]+'%'};return _0x402a55;}})});}_0x5ccac3=_[_0x613d('0x3b')]({},_0x5ccac3,_0xc06fad['options']);var _0x12b315={'where':_0x5ccac3[_0x613d('0x38')]};return db[_0x613d('0x29')]['count'](_0x12b315)[_0x613d('0x23')](function(_0x5af1c0){_0x35b1dc['count']=_0x5af1c0;if(_0xc06fad['query'][_0x613d('0x3c')]){_0x5ccac3[_0x613d('0x3d')]=[{'all':!![]}];}return db[_0x613d('0x29')]['findAll'](_0x5ccac3);})[_0x613d('0x23')](function(_0x3d8fc4){_0x35b1dc[_0x613d('0x3e')]=_0x3d8fc4;return _0x35b1dc;})[_0x613d('0x23')](respondWithFilteredResult(_0x3fb0fd,_0x5ccac3))[_0x613d('0x3f')](handleError(_0x3fb0fd,null));};exports[_0x613d('0x40')]=function(_0x569720,_0x143758){var _0x5e9e26={'raw':!![],'where':{'id':_0x569720[_0x613d('0x41')]['id']}},_0x142fcf={};_0x142fcf[_0x613d('0x2d')]=_[_0x613d('0x2f')](db[_0x613d('0x29')][_0x613d('0x42')]);_0x142fcf[_0x613d('0x2e')]=_['keys'](_0x569720[_0x613d('0x2e')]);_0x142fcf[_0x613d('0x30')]=_['intersection'](_0x142fcf[_0x613d('0x2d')],_0x142fcf[_0x613d('0x2e')]);_0x5e9e26['attributes']=_[_0x613d('0x31')](_0x142fcf[_0x613d('0x2d')],qs[_0x613d('0x33')](_0x569720['query'][_0x613d('0x33')]));_0x5e9e26[_0x613d('0x32')]=_0x5e9e26[_0x613d('0x32')][_0x613d('0x34')]?_0x5e9e26[_0x613d('0x32')]:_0x142fcf['model'];if(_0x569720[_0x613d('0x2e')][_0x613d('0x3c')]){_0x5e9e26[_0x613d('0x3d')]=[{'all':!![]}];}_0x5e9e26=_['merge']({},_0x5e9e26,_0x569720['options']);return db[_0x613d('0x29')]['find'](_0x5e9e26)[_0x613d('0x23')](handleEntityNotFound(_0x143758,null))[_0x613d('0x23')](respondWithResult(_0x143758,null))[_0x613d('0x3f')](handleError(_0x143758,null));};exports[_0x613d('0x43')]=function(_0xbbee16,_0x4cdd02){return db[_0x613d('0x29')]['create'](_0xbbee16[_0x613d('0x44')],{})[_0x613d('0x23')](respondWithResult(_0x4cdd02,0xc9))['catch'](handleError(_0x4cdd02,null));};exports[_0x613d('0x45')]=function(_0x1982cc,_0x1b2a2f){if(_0x1982cc[_0x613d('0x44')]['id']){delete _0x1982cc[_0x613d('0x44')]['id'];}return db[_0x613d('0x29')][_0x613d('0x46')]({'where':{'id':_0x1982cc[_0x613d('0x41')]['id']}})[_0x613d('0x23')](handleEntityNotFound(_0x1b2a2f,null))['then'](saveUpdates(_0x1982cc[_0x613d('0x44')],null))[_0x613d('0x23')](respondWithResult(_0x1b2a2f,null))[_0x613d('0x3f')](handleError(_0x1b2a2f,null));};exports[_0x613d('0x24')]=function(_0x95cfe7,_0x718d90){return db[_0x613d('0x29')][_0x613d('0x46')]({'where':{'id':_0x95cfe7['params']['id']}})[_0x613d('0x23')](handleEntityNotFound(_0x718d90,null))[_0x613d('0x23')](removeEntity(_0x718d90,null))[_0x613d('0x3f')](handleError(_0x718d90,null));};exports[_0x613d('0x47')]=function(_0x5b209f,_0x577acd){return db['ChatTransferReport'][_0x613d('0x47')]()[_0x613d('0x23')](respondWithResult(_0x577acd,null))[_0x613d('0x3f')](handleError(_0x577acd,null));};
\ No newline at end of file
+var _0x3948=['type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3948,0x6c));var _0x8394=function(_0x2db9e8,_0x535e57){_0x2db9e8=_0x2db9e8-0x0;var _0x4640cd=_0x3948[_0x2db9e8];return _0x4640cd;};'use strict';var emlformat=require(_0x8394('0x0'));var rimraf=require(_0x8394('0x1'));var zipdir=require(_0x8394('0x2'));var jsonpatch=require(_0x8394('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8394('0x4'));var Mustache=require(_0x8394('0x5'));var util=require(_0x8394('0x6'));var path=require(_0x8394('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8394('0x8'));var fs=require('fs');var fs_extra=require(_0x8394('0x9'));var _=require('lodash');var squel=require(_0x8394('0xa'));var crypto=require(_0x8394('0xb'));var jsforce=require(_0x8394('0xc'));var deskjs=require(_0x8394('0xd'));var toCsv=require(_0x8394('0xe'));var querystring=require(_0x8394('0xf'));var Papa=require(_0x8394('0x10'));var Redis=require(_0x8394('0x11'));var authService=require(_0x8394('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8394('0x13'));var logger=require('../../config/logger')(_0x8394('0x14'));var utils=require(_0x8394('0x15'));var config=require(_0x8394('0x16'));var licenseUtil=require(_0x8394('0x17'));var db=require(_0x8394('0x18'))['db'];function respondWithStatusCode(_0x546445,_0x4e9258){_0x4e9258=_0x4e9258||0xcc;return function(_0x2dbde0){if(_0x2dbde0){return _0x546445[_0x8394('0x19')](_0x4e9258);}return _0x546445[_0x8394('0x1a')](_0x4e9258)['end']();};}function respondWithResult(_0x58ceb,_0x43fef6){_0x43fef6=_0x43fef6||0xc8;return function(_0x548751){if(_0x548751){return _0x58ceb['status'](_0x43fef6)[_0x8394('0x1b')](_0x548751);}};}function respondWithFilteredResult(_0x1e75a1,_0xf29e01){return function(_0x4133d6){if(_0x4133d6){var _0x481735=typeof _0xf29e01[_0x8394('0x1c')]===_0x8394('0x1d')&&typeof _0xf29e01['limit']===_0x8394('0x1d');var _0x2f185e=_0x4133d6[_0x8394('0x1e')];var _0x58f537=_0x481735?0x0:_0xf29e01['offset'];var _0x22af45=_0x481735?_0x4133d6[_0x8394('0x1e')]:_0xf29e01[_0x8394('0x1c')]+_0xf29e01[_0x8394('0x1f')];var _0x37257f;if(_0x22af45>=_0x2f185e){_0x22af45=_0x2f185e;_0x37257f=0xc8;}else{_0x37257f=0xce;}_0x1e75a1[_0x8394('0x1a')](_0x37257f);return _0x1e75a1[_0x8394('0x20')](_0x8394('0x21'),_0x58f537+'-'+_0x22af45+'/'+_0x2f185e)[_0x8394('0x1b')](_0x4133d6);}return null;};}function patchUpdates(_0x4007a6){return function(_0x3d41cf){try{jsonpatch[_0x8394('0x22')](_0x3d41cf,_0x4007a6,!![]);}catch(_0x2907e1){return BPromise[_0x8394('0x23')](_0x2907e1);}return _0x3d41cf[_0x8394('0x24')]();};}function saveUpdates(_0x321215,_0x364cfd){return function(_0x4c7f1b){if(_0x4c7f1b){return _0x4c7f1b[_0x8394('0x25')](_0x321215)[_0x8394('0x26')](function(_0x1bac9d){return _0x1bac9d;});}return null;};}function removeEntity(_0x5d09f4,_0x219c2b){return function(_0x4cf8b9){if(_0x4cf8b9){return _0x4cf8b9['destroy']()[_0x8394('0x26')](function(){_0x5d09f4[_0x8394('0x1a')](0xcc)[_0x8394('0x27')]();});}};}function handleEntityNotFound(_0x3aabfc,_0x27d153){return function(_0x31b866){if(!_0x31b866){_0x3aabfc[_0x8394('0x19')](0x194);}return _0x31b866;};}function handleError(_0x1cb67f,_0x4e9eaf){_0x4e9eaf=_0x4e9eaf||0x1f4;return function(_0x125d89){logger[_0x8394('0x28')](_0x125d89[_0x8394('0x29')]);if(_0x125d89[_0x8394('0x2a')]){delete _0x125d89[_0x8394('0x2a')];}_0x1cb67f[_0x8394('0x1a')](_0x4e9eaf)[_0x8394('0x2b')](_0x125d89);};}exports[_0x8394('0x2c')]=function(_0x15a289,_0x25d2e2){var _0x3c9125={},_0x48d766={},_0x23ed92={'count':0x0,'rows':[]};var _0xbe8f99=_['map'](db[_0x8394('0x2d')][_0x8394('0x2e')],function(_0xf6a5f7){return{'name':_0xf6a5f7[_0x8394('0x2f')],'type':_0xf6a5f7[_0x8394('0x30')]['key']};});_0x48d766[_0x8394('0x31')]=_[_0x8394('0x32')](_0xbe8f99,_0x8394('0x2a'));_0x48d766[_0x8394('0x33')]=_[_0x8394('0x34')](_0x15a289[_0x8394('0x33')]);_0x48d766[_0x8394('0x35')]=_[_0x8394('0x36')](_0x48d766[_0x8394('0x31')],_0x48d766[_0x8394('0x33')]);_0x3c9125['attributes']=_[_0x8394('0x36')](_0x48d766[_0x8394('0x31')],qs['fields'](_0x15a289[_0x8394('0x33')][_0x8394('0x37')]));_0x3c9125[_0x8394('0x38')]=_0x3c9125['attributes'][_0x8394('0x39')]?_0x3c9125[_0x8394('0x38')]:_0x48d766[_0x8394('0x31')];if(!_0x15a289['query'][_0x8394('0x3a')](_0x8394('0x3b'))){_0x3c9125[_0x8394('0x1f')]=qs[_0x8394('0x1f')](_0x15a289[_0x8394('0x33')][_0x8394('0x1f')]);_0x3c9125['offset']=qs[_0x8394('0x1c')](_0x15a289[_0x8394('0x33')][_0x8394('0x1c')]);}_0x3c9125[_0x8394('0x3c')]=qs[_0x8394('0x3d')](_0x15a289[_0x8394('0x33')]['sort']);_0x3c9125[_0x8394('0x3e')]=qs[_0x8394('0x35')](_[_0x8394('0x3f')](_0x15a289[_0x8394('0x33')],_0x48d766[_0x8394('0x35')]),_0xbe8f99);if(_0x15a289[_0x8394('0x33')]['filter']){_0x3c9125[_0x8394('0x3e')]=_[_0x8394('0x40')](_0x3c9125[_0x8394('0x3e')],{'$or':_[_0x8394('0x32')](_0xbe8f99,function(_0x1c5145){if(_0x1c5145[_0x8394('0x30')]!==_0x8394('0x41')){var _0x45dfcc={};_0x45dfcc[_0x1c5145[_0x8394('0x2a')]]={'$like':'%'+_0x15a289[_0x8394('0x33')]['filter']+'%'};return _0x45dfcc;}})});}_0x3c9125=_[_0x8394('0x40')]({},_0x3c9125,_0x15a289[_0x8394('0x42')]);var _0x5dcc09={'where':_0x3c9125['where']};return db[_0x8394('0x2d')][_0x8394('0x1e')](_0x5dcc09)[_0x8394('0x26')](function(_0x15e38b){_0x23ed92[_0x8394('0x1e')]=_0x15e38b;if(_0x15a289[_0x8394('0x33')]['includeAll']){_0x3c9125[_0x8394('0x43')]=[{'all':!![]}];}return db[_0x8394('0x2d')][_0x8394('0x44')](_0x3c9125);})[_0x8394('0x26')](function(_0xceb943){_0x23ed92['rows']=_0xceb943;return _0x23ed92;})[_0x8394('0x26')](respondWithFilteredResult(_0x25d2e2,_0x3c9125))[_0x8394('0x45')](handleError(_0x25d2e2,null));};exports[_0x8394('0x46')]=function(_0x4e7a8b,_0x14191d){var _0x429b41={'raw':!![],'where':{'id':_0x4e7a8b[_0x8394('0x47')]['id']}},_0x5f58fb={};_0x5f58fb[_0x8394('0x31')]=_['keys'](db['ChatTransferReport'][_0x8394('0x2e')]);_0x5f58fb[_0x8394('0x33')]=_['keys'](_0x4e7a8b[_0x8394('0x33')]);_0x5f58fb['filters']=_[_0x8394('0x36')](_0x5f58fb[_0x8394('0x31')],_0x5f58fb['query']);_0x429b41[_0x8394('0x38')]=_[_0x8394('0x36')](_0x5f58fb[_0x8394('0x31')],qs[_0x8394('0x37')](_0x4e7a8b['query'][_0x8394('0x37')]));_0x429b41[_0x8394('0x38')]=_0x429b41['attributes'][_0x8394('0x39')]?_0x429b41[_0x8394('0x38')]:_0x5f58fb[_0x8394('0x31')];if(_0x4e7a8b['query'][_0x8394('0x48')]){_0x429b41[_0x8394('0x43')]=[{'all':!![]}];}_0x429b41=_[_0x8394('0x40')]({},_0x429b41,_0x4e7a8b[_0x8394('0x42')]);return db[_0x8394('0x2d')]['find'](_0x429b41)['then'](handleEntityNotFound(_0x14191d,null))['then'](respondWithResult(_0x14191d,null))[_0x8394('0x45')](handleError(_0x14191d,null));};exports[_0x8394('0x49')]=function(_0x43f922,_0x1e52b2){return db['ChatTransferReport']['create'](_0x43f922[_0x8394('0x4a')],{})[_0x8394('0x26')](respondWithResult(_0x1e52b2,0xc9))[_0x8394('0x45')](handleError(_0x1e52b2,null));};exports[_0x8394('0x25')]=function(_0x4c9f88,_0x13c0de){if(_0x4c9f88['body']['id']){delete _0x4c9f88[_0x8394('0x4a')]['id'];}return db[_0x8394('0x2d')][_0x8394('0x4b')]({'where':{'id':_0x4c9f88[_0x8394('0x47')]['id']}})[_0x8394('0x26')](handleEntityNotFound(_0x13c0de,null))[_0x8394('0x26')](saveUpdates(_0x4c9f88['body'],null))[_0x8394('0x26')](respondWithResult(_0x13c0de,null))[_0x8394('0x45')](handleError(_0x13c0de,null));};exports[_0x8394('0x4c')]=function(_0x420147,_0x962672){return db[_0x8394('0x2d')][_0x8394('0x4b')]({'where':{'id':_0x420147['params']['id']}})[_0x8394('0x26')](handleEntityNotFound(_0x962672,null))[_0x8394('0x26')](removeEntity(_0x962672,null))[_0x8394('0x45')](handleError(_0x962672,null));};exports[_0x8394('0x4d')]=function(_0x33d157,_0x3f636e){return db[_0x8394('0x2d')][_0x8394('0x4d')]()[_0x8394('0x26')](respondWithResult(_0x3f636e,null))[_0x8394('0x45')](handleError(_0x3f636e,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 694cca9..a18f69b 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 _0xd6e2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api'];(function(_0x3627cb,_0x5a9d03){var _0xd3adf3=function(_0x5cd5bc){while(--_0x5cd5bc){_0x3627cb['push'](_0x3627cb['shift']());}};_0xd3adf3(++_0x5a9d03);}(_0xd6e2,0x1a1));var _0x2d6e=function(_0xc066a,_0x3b09bd){_0xc066a=_0xc066a-0x0;var _0x6b065b=_0xd6e2[_0xc066a];return _0x6b065b;};'use strict';var _=require('lodash');var util=require(_0x2d6e('0x0'));var logger=require(_0x2d6e('0x1'))(_0x2d6e('0x2'));var moment=require(_0x2d6e('0x3'));var BPromise=require(_0x2d6e('0x4'));var rp=require(_0x2d6e('0x5'));var fs=require('fs');var path=require(_0x2d6e('0x6'));var rimraf=require(_0x2d6e('0x7'));var config=require(_0x2d6e('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0x2d6e('0x9')]=function(_0x1859c3,_0x36e0da){return _0x1859c3[_0x2d6e('0xa')](_0x2d6e('0xb'),attributes,{'tableName':_0x2d6e('0xc'),'paranoid':![],'indexes':[{'name':_0x2d6e('0xd'),'fields':[_0x2d6e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc178=['bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment'];(function(_0x2b6b92,_0x57303d){var _0x2233dc=function(_0x310e88){while(--_0x310e88){_0x2b6b92['push'](_0x2b6b92['shift']());}};_0x2233dc(++_0x57303d);}(_0xc178,0x1a1));var _0x8c17=function(_0x402015,_0x178bb7){_0x402015=_0x402015-0x0;var _0x16a7b7=_0xc178[_0x402015];return _0x16a7b7;};'use strict';var _=require(_0x8c17('0x0'));var util=require('util');var logger=require(_0x8c17('0x1'))('api');var moment=require(_0x8c17('0x2'));var BPromise=require(_0x8c17('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c17('0x4'));var rimraf=require(_0x8c17('0x5'));var config=require(_0x8c17('0x6'));var attributes=require(_0x8c17('0x7'));module[_0x8c17('0x8')]=function(_0x4964db,_0x3c1f75){return _0x4964db['define'](_0x8c17('0x9'),attributes,{'tableName':_0x8c17('0xa'),'paranoid':![],'indexes':[{'name':_0x8c17('0xb'),'fields':[_0x8c17('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 43d6bd2..9c52d3f 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 _0x5c9a=['catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3bc190,_0x2eea47){var _0x5773d3=function(_0x31a8e5){while(--_0x31a8e5){_0x3bc190['push'](_0x3bc190['shift']());}};_0x5773d3(++_0x2eea47);}(_0x5c9a,0x13c));var _0xa5c9=function(_0x358fb5,_0x4407b8){_0x358fb5=_0x358fb5-0x0;var _0x4abfeb=_0x5c9a[_0x358fb5];return _0x4abfeb;};'use strict';var _=require('lodash');var util=require(_0xa5c9('0x0'));var moment=require(_0xa5c9('0x1'));var BPromise=require(_0xa5c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5c9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5c9('0x4'));var logger=require(_0xa5c9('0x5'))(_0xa5c9('0x6'));var config=require(_0xa5c9('0x7'));var jayson=require(_0xa5c9('0x8'));var client=jayson[_0xa5c9('0x9')][_0xa5c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x234ec0,_0xb5f8a0,_0x5061ea){return new BPromise(function(_0x46f21e,_0x52e0fe){return client[_0xa5c9('0xb')](_0x234ec0,_0x5061ea)['then'](function(_0x2c5f7){logger['info'](_0xa5c9('0xc'),_0xb5f8a0,_0xa5c9('0xd'));logger[_0xa5c9('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xb5f8a0,_0xa5c9('0xd'),JSON[_0xa5c9('0xf')](_0x2c5f7));if(_0x2c5f7[_0xa5c9('0x10')]){if(_0x2c5f7[_0xa5c9('0x10')][_0xa5c9('0x11')]===0x1f4){logger[_0xa5c9('0x10')](_0xa5c9('0xc'),_0xb5f8a0,_0x2c5f7[_0xa5c9('0x10')]['message']);return _0x52e0fe(_0x2c5f7[_0xa5c9('0x10')]['message']);}logger['error'](_0xa5c9('0xc'),_0xb5f8a0,_0x2c5f7[_0xa5c9('0x10')][_0xa5c9('0x12')]);return _0x46f21e(_0x2c5f7[_0xa5c9('0x10')]['message']);}else{logger['info'](_0xa5c9('0xc'),_0xb5f8a0,'request\x20sent');_0x46f21e(_0x2c5f7[_0xa5c9('0x13')]['message']);}})[_0xa5c9('0x14')](function(_0x39ea49){logger[_0xa5c9('0x10')](_0xa5c9('0xc'),_0xb5f8a0,_0x39ea49);_0x52e0fe(_0x39ea49);});});}
\ No newline at end of file
+var _0xf1e4=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info'];(function(_0x3a3fff,_0x3e7a6b){var _0x25ddff=function(_0x20b901){while(--_0x20b901){_0x3a3fff['push'](_0x3a3fff['shift']());}};_0x25ddff(++_0x3e7a6b);}(_0xf1e4,0x92));var _0x4f1e=function(_0xe9d59f,_0x3f603e){_0xe9d59f=_0xe9d59f-0x0;var _0x972885=_0xf1e4[_0xe9d59f];return _0x972885;};'use strict';var _=require(_0x4f1e('0x0'));var util=require(_0x4f1e('0x1'));var moment=require(_0x4f1e('0x2'));var BPromise=require(_0x4f1e('0x3'));var rs=require(_0x4f1e('0x4'));var fs=require('fs');var Redis=require(_0x4f1e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f1e('0x6'));var logger=require(_0x4f1e('0x7'))(_0x4f1e('0x8'));var config=require(_0x4f1e('0x9'));var jayson=require(_0x4f1e('0xa'));var client=jayson[_0x4f1e('0xb')][_0x4f1e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18b848,_0x4a53cf,_0x2b3465){return new BPromise(function(_0x87b2d,_0x39b17b){return client[_0x4f1e('0xd')](_0x18b848,_0x2b3465)[_0x4f1e('0xe')](function(_0x5e673d){logger['info'](_0x4f1e('0xf'),_0x4a53cf,'request\x20sent');logger[_0x4f1e('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4a53cf,_0x4f1e('0x11'),JSON['stringify'](_0x5e673d));if(_0x5e673d[_0x4f1e('0x12')]){if(_0x5e673d[_0x4f1e('0x12')][_0x4f1e('0x13')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4a53cf,_0x5e673d[_0x4f1e('0x12')][_0x4f1e('0x14')]);return _0x39b17b(_0x5e673d['error'][_0x4f1e('0x14')]);}logger[_0x4f1e('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x4a53cf,_0x5e673d['error']['message']);return _0x87b2d(_0x5e673d[_0x4f1e('0x12')][_0x4f1e('0x14')]);}else{logger[_0x4f1e('0x15')](_0x4f1e('0xf'),_0x4a53cf,'request\x20sent');_0x87b2d(_0x5e673d[_0x4f1e('0x16')][_0x4f1e('0x14')]);}})[_0x4f1e('0x17')](function(_0x3ddeac){logger[_0x4f1e('0x12')](_0x4f1e('0xf'),_0x4a53cf,_0x3ddeac);_0x39b17b(_0x3ddeac);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 48b6e81..880a523 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 _0xeb58=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xeb58,0x1a2));var _0x8eb5=function(_0x3b91ad,_0x4feee7){_0x3b91ad=_0x3b91ad-0x0;var _0x36f0cc=_0xeb58[_0x3b91ad];return _0x36f0cc;};'use strict';var multer=require(_0x8eb5('0x0'));var util=require(_0x8eb5('0x1'));var path=require(_0x8eb5('0x2'));var timeout=require(_0x8eb5('0x3'));var express=require(_0x8eb5('0x4'));var router=express[_0x8eb5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8eb5('0x6'));var interaction=require(_0x8eb5('0x7'));var config=require(_0x8eb5('0x8'));var controller=require(_0x8eb5('0x9'));router[_0x8eb5('0xa')]('/',auth[_0x8eb5('0xb')](),controller['index']);router['get'](_0x8eb5('0xc'),auth[_0x8eb5('0xb')](),controller[_0x8eb5('0xd')]);router[_0x8eb5('0xa')](_0x8eb5('0xe'),auth[_0x8eb5('0xb')](),controller[_0x8eb5('0xf')]);router[_0x8eb5('0x10')]('/',auth[_0x8eb5('0xb')](),controller['create']);router[_0x8eb5('0x11')](_0x8eb5('0xe'),auth[_0x8eb5('0xb')](),controller[_0x8eb5('0x12')]);router[_0x8eb5('0x13')]('/:id',auth[_0x8eb5('0xb')](),controller[_0x8eb5('0x14')]);module[_0x8eb5('0x15')]=router;
\ No newline at end of file
+var _0x6a18=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x6a18,0xb8));var _0x86a1=function(_0x1c8e04,_0x6fb850){_0x1c8e04=_0x1c8e04-0x0;var _0x474bd5=_0x6a18[_0x1c8e04];return _0x474bd5;};'use strict';var multer=require(_0x86a1('0x0'));var util=require('util');var path=require(_0x86a1('0x1'));var timeout=require('connect-timeout');var express=require(_0x86a1('0x2'));var router=express[_0x86a1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x86a1('0x4'));var interaction=require(_0x86a1('0x5'));var config=require('../../config/environment');var controller=require(_0x86a1('0x6'));router[_0x86a1('0x7')]('/',auth[_0x86a1('0x8')](),controller[_0x86a1('0x9')]);router[_0x86a1('0x7')](_0x86a1('0xa'),auth['isAuthenticated'](),controller[_0x86a1('0xb')]);router[_0x86a1('0x7')](_0x86a1('0xc'),auth[_0x86a1('0x8')](),controller[_0x86a1('0xd')]);router[_0x86a1('0xe')]('/',auth[_0x86a1('0x8')](),controller['create']);router['put'](_0x86a1('0xc'),auth['isAuthenticated'](),controller[_0x86a1('0xf')]);router[_0x86a1('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x86a1('0x11')]);module[_0x86a1('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 57259aa..13807c6 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 _0x51d5=['ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN'];(function(_0x3901eb,_0x43d721){var _0x5595be=function(_0x1ae975){while(--_0x1ae975){_0x3901eb['push'](_0x3901eb['shift']());}};_0x5595be(++_0x43d721);}(_0x51d5,0x122));var _0x551d=function(_0x53732a,_0x4d7d50){_0x53732a=_0x53732a-0x0;var _0x4abe36=_0x51d5[_0x53732a];return _0x4abe36;};'use strict';var Sequelize=require(_0x551d('0x0'));var rs=require(_0x551d('0x1'));module[_0x551d('0x2')]={'name':{'type':Sequelize[_0x551d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x551d('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x551d('0x3')]},'mapKey':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x4')},'mapKeyOffline':{'type':Sequelize[_0x551d('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x551d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x5')},'customerAlias':{'type':Sequelize[_0x551d('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x551d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x551d('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x551d('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x551d('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x551d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x551d('0x3')]},'animation':{'type':Sequelize[_0x551d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x551d('0xa')](_0x551d('0xb'),_0x551d('0xc')),'defaultValue':_0x551d('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x551d('0xd')},'start_chat_button':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0xe')},'offline_chat_button':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0xf')},'header_offline':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x10')},'download_transcript':{'type':Sequelize[_0x551d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x551d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x551d('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x551d('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x551d('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x551d('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x14')},'noteTitle':{'type':Sequelize[_0x551d('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x16')},'conditionAgreement':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x17')},'ratingType':{'type':Sequelize[_0x551d('0xa')](_0x551d('0x18'),_0x551d('0x19')),'defaultValue':_0x551d('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x551d('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x551d('0x1a'),'variable':null,'config':{'placeholder':_0x551d('0x1b'),'type':_0x551d('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x551d('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x551d('0x4'),'type':_0x551d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x551d('0x1d')](_0x551d('0x1e'))?JSON[_0x551d('0x1f')](this['getDataValue'](_0x551d('0x1e'))):{};},'set':function(_0x68ffd1){return this[_0x551d('0x20')]('onlineForm',JSON[_0x551d('0x21')](_0x68ffd1));}},'offlineForm':{'type':Sequelize[_0x551d('0x11')],'defaultValue':function(){return JSON[_0x551d('0x21')]({'items':[{'type':_0x551d('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x551d('0x4'),'type':'email'},'variable':null},{'type':_0x551d('0x22'),'config':{'placeholder':_0x551d('0x23')},'props':{'title':_0x551d('0x23'),'helpText':_0x551d('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x551d('0x1d')]('offlineForm')?JSON['parse'](this[_0x551d('0x1d')]('offlineForm')):{};},'set':function(_0x136d05){return this['setDataValue'](_0x551d('0x25'),JSON['stringify'](_0x136d05));}},'token':{'type':Sequelize[_0x551d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x551d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x551d('0x3')]},'waitingTitle':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x26')},'waitingMessage':{'type':Sequelize[_0x551d('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x551d('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x551d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x551d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x27')},'skipUnmanaged':{'type':Sequelize[_0x551d('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x551d('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x551d('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x551d('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x551d('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x551d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x29')},'verticalAlignment':{'type':Sequelize[_0x551d('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x2a')},'messagesAlignment':{'type':Sequelize[_0x551d('0x3')],'defaultValue':_0x551d('0x2b')},'defaultTitle':{'type':Sequelize[_0x551d('0x3')]},'customerAvatar':{'type':Sequelize[_0x551d('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x551d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x551d('0x3')],'allowNull':![],'defaultValue':_0x551d('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x551d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x551d('0x2d')},'systemAvatar':{'type':Sequelize[_0x551d('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x551d('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![],'comment':_0x551d('0x2f'),'set':function(_0x3547aa){if(!_0x3547aa)this[_0x551d('0x20')]('mandatoryDispositionPauseId',null);this[_0x551d('0x20')](_0x551d('0x30'),_0x3547aa);}},'vidaooEscalation':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x551d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x551d('0x3')],'allowNull':![],'defaultValue':_0x551d('0x31')},'vidaooNote':{'type':Sequelize[_0x551d('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x551d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x551d('0x11')]}};
\ No newline at end of file
+var _0x9fde=['We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','INTEGER','stringify','name','getDataValue','onlineForm','setDataValue','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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.','website_alias','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','ENUM','rounded','squared'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x9fde,0x1d2));var _0xe9fd=function(_0x550e29,_0x4047f){_0x550e29=_0x550e29-0x0;var _0x3515b6=_0x9fde[_0x550e29];return _0x3515b6;};'use strict';var Sequelize=require(_0xe9fd('0x0'));var rs=require(_0xe9fd('0x1'));module[_0xe9fd('0x2')]={'name':{'type':Sequelize[_0xe9fd('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe9fd('0x4')},'description':{'type':Sequelize[_0xe9fd('0x3')]},'mapKey':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x5')},'mapKeyOffline':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xe9fd('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe9fd('0x3')],'allowNull':![],'defaultValue':_0xe9fd('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe9fd('0x3')],'allowNull':![],'defaultValue':_0xe9fd('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xe9fd('0x3')],'allowNull':![],'defaultValue':_0xe9fd('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe9fd('0x8')](_0xe9fd('0x9'),_0xe9fd('0xa')),'defaultValue':_0xe9fd('0x9')},'header_online':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0xb')},'start_chat_button':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0xd')},'download_transcript':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe9fd('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x12')},'noteTitle':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe9fd('0x14')},'closingMessage':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x15')},'closingMessageButton':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x16')},'skipMessageButton':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x18')},'ratingType':{'type':Sequelize[_0xe9fd('0x8')](_0xe9fd('0x19'),_0xe9fd('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xe9fd('0x1b')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe9fd('0x10')],'defaultValue':function(){return JSON[_0xe9fd('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xe9fd('0x1d'),'type':'text','required':!![]},'props':{'title':_0xe9fd('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0xe9fd('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xe9fd('0x5'),'type':_0xe9fd('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe9fd('0x1e')]('onlineForm')?JSON['parse'](this[_0xe9fd('0x1e')](_0xe9fd('0x1f'))):{};},'set':function(_0x2654e5){return this[_0xe9fd('0x20')]('onlineForm',JSON[_0xe9fd('0x1c')](_0x2654e5));}},'offlineForm':{'type':Sequelize[_0xe9fd('0x10')],'defaultValue':function(){return JSON[_0xe9fd('0x1c')]({'items':[{'type':_0xe9fd('0x21'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xe9fd('0x5'),'type':'email'},'variable':null},{'type':_0xe9fd('0x22'),'config':{'placeholder':_0xe9fd('0x23')},'props':{'title':_0xe9fd('0x23'),'helpText':_0xe9fd('0x24')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xe9fd('0x25'))?JSON[_0xe9fd('0x26')](this[_0xe9fd('0x1e')](_0xe9fd('0x25'))):{};},'set':function(_0x12c35d){return this[_0xe9fd('0x20')](_0xe9fd('0x25'),JSON[_0xe9fd('0x1c')](_0x12c35d));}},'token':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':function(){return rs[_0xe9fd('0x27')]();}},'autoclose':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe9fd('0x3')]},'forwardOffline':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe9fd('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xe9fd('0x28')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe9fd('0x29')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xe9fd('0x2a')},'offlineMessageBody':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x2b')},'enableUnmanagedNote':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x2c')},'skipUnmanaged':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x17')},'sendUnmanaged':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x16')},'enableCustomerAttachment':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe9fd('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe9fd('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe9fd('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0xe9fd('0x1b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe9fd('0x1b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xe9fd('0x1b')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xe9fd('0x3')]},'customerAvatar':{'type':Sequelize[_0xe9fd('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe9fd('0x1b')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe9fd('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe9fd('0x1b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':_0xe9fd('0x2f')},'systemAvatar':{'type':Sequelize[_0xe9fd('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe9fd('0x1b')],'comment':_0xe9fd('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![],'comment':_0xe9fd('0x31'),'set':function(_0x3214f6){if(!_0x3214f6)this[_0xe9fd('0x20')](_0xe9fd('0x32'),null);this[_0xe9fd('0x20')](_0xe9fd('0x33'),_0x3214f6);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xe9fd('0x3')],'allowNull':![],'defaultValue':_0xe9fd('0x34')},'vidaooNote':{'type':Sequelize[_0xe9fd('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xe9fd('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xe9fd('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index d770ce4..3152954 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 _0x98a8=['emit','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','socket.io-emitter','./chatWebsite.socket','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','stringify','error','message','result','catch','end','status','json','limit','undefined','count','offset','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','then','sendStatus','name','user-agent-parser','setUA','customerIp','x-forwarded-for','first','split','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','params','Pause','rawAttributes','includeAll','find','create','body','forEach','trim','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','address','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','describe','addDisposition','ChatWebsiteId','findOne','Disposition','hasOwnProperty','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','referer','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','Contacts','ChatApplication','interval','account','applications','orderBy','Applications','priority','asc','list','List','defaults','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','contact','messageId','created','autoclose','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','files','Sequelize','no\x20available\x20attributes','difference','ValidationError','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','email','firstName','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','getSnippet','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','utf8','3.13.0','headers','origin','http://localhost:9000','x-real-ip','verticalAlignment','textButtonColor','color_button','backgroundColor','IntervalId','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x98a8,0x12c));var _0x898a=function(_0x1940a7,_0x517fbf){_0x1940a7=_0x1940a7-0x0;var _0x11afb8=_0x98a8[_0x1940a7];return _0x11afb8;};'use strict';var Mustache=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var ejs=require(_0x898a('0x3'));var fs=require('fs');var fs_extra=require(_0x898a('0x4'));var _=require(_0x898a('0x5'));var querystring=require(_0x898a('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0x898a('0x7'));var jayson=require(_0x898a('0x8'));var qs=require(_0x898a('0x9'));var logger=require(_0x898a('0xa'))(_0x898a('0xb'));var config=require('../../config/environment');var APIBadRequestError=require(_0x898a('0xc'))['APIBadRequestError'];var APINotFoundError=require(_0x898a('0xc'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x898a('0xc'))[_0x898a('0xd')];var APIHandleError=require(_0x898a('0xc'))[_0x898a('0xe')];var APIConflictError=require(_0x898a('0xc'))[_0x898a('0xf')];var wildcardUtils=require(_0x898a('0x10'));var URL=require(_0x898a('0x11'))[_0x898a('0x12')];var db=require('../../mysqldb')['db'];config[_0x898a('0x13')]=_['defaults'](config[_0x898a('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x898a('0x14'))(new Redis(config[_0x898a('0x13')]));require(_0x898a('0x15'))['register'](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x898a('0x16')][_0x898a('0x17')]({'port':0x232a});var client9003=jayson[_0x898a('0x16')][_0x898a('0x17')]({'port':0x232b});var client9001=jayson[_0x898a('0x16')][_0x898a('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x506023,_0x47033c,_0x53a4b8,_0x3fec7a){return new Promise(function(_0x5c96a6,_0x303321){var _0x4fb05b=_0x3fec7a||client;return _0x4fb05b[_0x898a('0x18')](_0x506023,_0x53a4b8)['then'](function(_0xee4408){logger[_0x898a('0x19')](_0x898a('0x1a'),_0x47033c,'request\x20sent');logger[_0x898a('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x47033c,'request\x20sent',JSON[_0x898a('0x1c')](_0xee4408));if(_0xee4408[_0x898a('0x1d')]){if(_0xee4408['error']['code']===0x1f4){logger[_0x898a('0x1d')](_0x898a('0x1a'),_0x47033c,_0xee4408[_0x898a('0x1d')][_0x898a('0x1e')]);return _0x303321(_0xee4408[_0x898a('0x1d')][_0x898a('0x1e')]);}logger[_0x898a('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x47033c,_0xee4408[_0x898a('0x1d')][_0x898a('0x1e')]);return _0x5c96a6(_0xee4408[_0x898a('0x1d')][_0x898a('0x1e')]);}else{logger[_0x898a('0x19')](_0x898a('0x1a'),_0x47033c,'request\x20sent');_0x5c96a6(_0xee4408[_0x898a('0x1f')][_0x898a('0x1e')]);}})[_0x898a('0x20')](function(_0x32eca5){logger[_0x898a('0x1d')](_0x898a('0x1a'),_0x47033c,_0x32eca5);_0x303321(_0x32eca5);});});}function respondWithStatusCode(_0x5b7719,_0x20bde0){_0x20bde0=_0x20bde0||0xcc;return function(_0x51d501){if(_0x51d501){return _0x5b7719['sendStatus'](_0x20bde0);}return _0x5b7719['status'](_0x20bde0)[_0x898a('0x21')]();};}function respondWithResult(_0x1f4d86,_0x420b25){_0x420b25=_0x420b25||0xc8;return function(_0x40b3db){if(_0x40b3db){return _0x1f4d86[_0x898a('0x22')](_0x420b25)[_0x898a('0x23')](_0x40b3db);}};}function respondWithFilteredResult(_0x398e98,_0xac1fc4){return function(_0xd31922){if(_0xd31922){var _0x58149d=typeof _0xac1fc4['offset']==='undefined'&&typeof _0xac1fc4[_0x898a('0x24')]===_0x898a('0x25');var _0x3b7704=_0xd31922[_0x898a('0x26')];var _0x34f447=_0x58149d?0x0:_0xac1fc4[_0x898a('0x27')];var _0xe3c983=_0x58149d?_0xd31922[_0x898a('0x26')]:_0xac1fc4[_0x898a('0x27')]+_0xac1fc4[_0x898a('0x24')];var _0x44c5d2;if(_0xe3c983>=_0x3b7704){_0xe3c983=_0x3b7704;_0x44c5d2=0xc8;}else{_0x44c5d2=0xce;}_0x398e98[_0x898a('0x22')](_0x44c5d2);return _0x398e98['set'](_0x898a('0x28'),_0x34f447+'-'+_0xe3c983+'/'+_0x3b7704)[_0x898a('0x23')](_0xd31922);}return null;};}function saveUpdates(_0x26eead){return function(_0x17a980){if(_0x17a980){return _0x17a980[_0x898a('0x29')](_0x26eead)['then'](function(_0x48cefb){return _0x48cefb;});}return null;};}function removeEntity(_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x2a')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x2b')]({'plain':!![]});var _0x5eafc7=_0x898a('0x2c');return db[_0x898a('0x2d')][_0x898a('0x2a')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x2e')](function(){return _0x1e2fd4;});})[_0x898a('0x2e')](function(){_0x20a3fe['status'](0xcc)[_0x898a('0x21')]();});}};}function handleEntityNotFound(_0x5baf5b){return function(_0x573eb3){if(!_0x573eb3){_0x5baf5b[_0x898a('0x2f')](0x194);}return _0x573eb3;};}function handleError(_0x58d997,_0x3c9588){_0x3c9588=_0x3c9588||0x1f4;return function(_0x4b3aac){logger[_0x898a('0x1d')](_0x4b3aac['stack']);if(_0x4b3aac[_0x898a('0x30')]){delete _0x4b3aac[_0x898a('0x30')];}_0x58d997[_0x898a('0x22')](_0x3c9588)['send'](_0x4b3aac);};}function createInteractionObject(_0x554897,_0x47966e,_0x1575d2,_0x429c32){var _0x5a228f=require(_0x898a('0x31'));var _0x3d3463=new _0x5a228f();var _0xe84f7e=_0x3d3463[_0x898a('0x32')](_0x1575d2['user-agent'])['getResult']();var _0x3aed01=_0x47966e[_0x898a('0x33')];if(_0x1575d2['cf-connecting-ip']){_0x3aed01=_0x1575d2['cf-connecting-ip'];}else if(_0x1575d2[_0x898a('0x34')]){_0x3aed01=_[_0x898a('0x35')](_0x1575d2[_0x898a('0x34')][_0x898a('0x36')](','));}return{'ContactId':_0x429c32['id'],'ChatWebsiteId':_0x554897,'from':(_0x429c32['firstName']||'')+'\x20'+(_0x429c32[_0x898a('0x37')]||''),'customerIp':_0x3aed01,'customerPort':_0x1575d2[_0x898a('0x38')]?_0x1575d2['x-real-port']:null,'referer':_0x47966e['referer'],'browserName':_0xe84f7e['browser'][_0x898a('0x30')]&&_0xe84f7e[_0x898a('0x39')][_0x898a('0x3a')]?util[_0x898a('0x3b')](_0x898a('0x3c'),_0xe84f7e[_0x898a('0x39')][_0x898a('0x30')],_0xe84f7e[_0x898a('0x39')][_0x898a('0x3a')]):_0x898a('0x3d'),'browserVersion':_0xe84f7e[_0x898a('0x39')][_0x898a('0x3a')]||_0x898a('0x3d'),'osName':util[_0x898a('0x3b')](_0x898a('0x3c'),_0xe84f7e['os']['name'],_0xe84f7e['os'][_0x898a('0x3a')]),'osVersion':_0xe84f7e['os'][_0x898a('0x3a')],'deviceModel':_0xe84f7e[_0x898a('0x3e')]['model']&&_0xe84f7e[_0x898a('0x3e')][_0x898a('0x3f')]?util[_0x898a('0x3b')](_0x898a('0x40'),_0xe84f7e[_0x898a('0x3e')][_0x898a('0x41')],_0xe84f7e[_0x898a('0x3e')][_0x898a('0x3f')],_0xe84f7e['device'][_0x898a('0x42')]):null,'deviceVendor':_0xe84f7e[_0x898a('0x3e')][_0x898a('0x3f')],'deviceType':_0xe84f7e[_0x898a('0x3e')]['type'],'formData':JSON[_0x898a('0x1c')](_0x47966e)};}exports[_0x898a('0x43')]=function(_0x5964df,_0x241677){var _0x4ce00e={'include':[{'model':db['Pause'],'as':_0x898a('0x44')}]},_0x56a40c={},_0x5137c4={'count':0x0,'rows':[]};var _0x49e603=_[_0x898a('0x45')](db[_0x898a('0x46')]['rawAttributes'],function(_0x247347){return{'name':_0x247347[_0x898a('0x47')],'type':_0x247347['type'][_0x898a('0x48')]};});_0x56a40c[_0x898a('0x41')]=_[_0x898a('0x45')](_0x49e603,_0x898a('0x30'));_0x56a40c['query']=_[_0x898a('0x49')](_0x5964df[_0x898a('0x4a')]);_0x56a40c['filters']=_[_0x898a('0x4b')](_0x56a40c[_0x898a('0x41')],_0x56a40c['query']);_0x4ce00e[_0x898a('0x4c')]=_['intersection'](_0x56a40c[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x5964df[_0x898a('0x4a')]['fields']));_0x4ce00e[_0x898a('0x4c')]=_0x4ce00e[_0x898a('0x4c')][_0x898a('0x4e')]?_0x4ce00e[_0x898a('0x4c')]:_0x56a40c['model'];if(!_0x5964df[_0x898a('0x4a')]['hasOwnProperty'](_0x898a('0x4f'))){_0x4ce00e[_0x898a('0x24')]=qs[_0x898a('0x24')](_0x5964df['query'][_0x898a('0x24')]);_0x4ce00e[_0x898a('0x27')]=qs[_0x898a('0x27')](_0x5964df['query']['offset']);}_0x4ce00e[_0x898a('0x50')]=qs[_0x898a('0x51')](_0x5964df[_0x898a('0x4a')][_0x898a('0x51')]);_0x4ce00e[_0x898a('0x52')]=qs[_0x898a('0x53')](_[_0x898a('0x54')](_0x5964df[_0x898a('0x4a')],_0x56a40c[_0x898a('0x53')]),_0x49e603);if(_0x5964df[_0x898a('0x4a')][_0x898a('0x55')]){_0x4ce00e['where']=_[_0x898a('0x56')](_0x4ce00e[_0x898a('0x52')],{'$or':_['map'](_0x49e603,function(_0x36d7aa){if(_0x36d7aa['type']!=='VIRTUAL'){var _0x15f11e={};_0x15f11e[_0x36d7aa[_0x898a('0x30')]]={'$like':'%'+_0x5964df[_0x898a('0x4a')]['filter']+'%'};return _0x15f11e;}})});}_0x4ce00e=_['merge']({},_0x4ce00e,_0x5964df[_0x898a('0x57')]);var _0x1f5e4b={'where':_0x4ce00e['where']};return db[_0x898a('0x46')][_0x898a('0x26')](_0x1f5e4b)['then'](function(_0x299a6d){_0x5137c4[_0x898a('0x26')]=_0x299a6d;if(_0x5964df[_0x898a('0x4a')]['includeAll']){_0x4ce00e[_0x898a('0x58')]=[{'all':!![]}];}return db[_0x898a('0x46')][_0x898a('0x59')](_0x4ce00e);})[_0x898a('0x2e')](function(_0xd37f94){_0x5137c4[_0x898a('0x5a')]=_0xd37f94;return _0x5137c4;})['then'](respondWithFilteredResult(_0x241677,_0x4ce00e))[_0x898a('0x20')](handleError(_0x241677,null));};exports['show']=function(_0x253f51,_0x1dc177){var _0x15b203={'raw':![],'where':{'id':_0x253f51[_0x898a('0x5b')]['id']},'include':[{'model':db[_0x898a('0x5c')],'as':_0x898a('0x44')}]},_0x43780e={};_0x43780e[_0x898a('0x41')]=_[_0x898a('0x49')](db['ChatWebsite'][_0x898a('0x5d')]);_0x43780e[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x253f51[_0x898a('0x4a')]);_0x43780e[_0x898a('0x53')]=_[_0x898a('0x4b')](_0x43780e[_0x898a('0x41')],_0x43780e[_0x898a('0x4a')]);_0x15b203[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x43780e[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x253f51[_0x898a('0x4a')][_0x898a('0x4d')]));_0x15b203[_0x898a('0x4c')]=_0x15b203['attributes'][_0x898a('0x4e')]?_0x15b203[_0x898a('0x4c')]:_0x43780e['model'];if(_0x253f51[_0x898a('0x4a')][_0x898a('0x5e')]){_0x15b203['include']=[{'all':!![]}];}_0x15b203=_[_0x898a('0x56')]({},_0x15b203,_0x253f51[_0x898a('0x57')]);return db[_0x898a('0x46')][_0x898a('0x5f')](_0x15b203)['then'](handleEntityNotFound(_0x1dc177,null))[_0x898a('0x2e')](respondWithResult(_0x1dc177,null))[_0x898a('0x20')](handleError(_0x1dc177,null));};exports[_0x898a('0x60')]=function(_0xf86633,_0x5b4e60){var _0x285ec9=null;_0xf86633[_0x898a('0x61')]['address'][_0x898a('0x36')](',')[_0x898a('0x62')](_0x5b7019=>{if(_0x5b7019[_0x898a('0x63')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x5b7019[_0x898a('0x63')]())){_0x285ec9=new APIBadRequestError('\x22'+_0x5b7019['trim']()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x285ec9){return handleError(_0x5b4e60,null)(_0x285ec9);}return db['ChatWebsite'][_0x898a('0x60')](_0xf86633[_0x898a('0x61')],{})[_0x898a('0x2e')](function(_0x37c6f6){var _0x5e0535=_0xf86633['user'][_0x898a('0x2b')]({'plain':!![]});if(!_0x5e0535)throw new Error(_0x898a('0x64'));if(_0x5e0535[_0x898a('0x65')]===_0x898a('0x66')){var _0x3d9966=_0x37c6f6[_0x898a('0x2b')]({'plain':!![]});var _0x30051d=_0x898a('0x2c');return db['UserProfileSection'][_0x898a('0x5f')]({'where':{'name':_0x30051d,'userProfileId':_0x5e0535[_0x898a('0x67')]},'raw':!![]})['then'](function(_0x42fda8){if(_0x42fda8&&_0x42fda8[_0x898a('0x68')]===0x0){return db[_0x898a('0x2d')][_0x898a('0x60')]({'name':_0x3d9966[_0x898a('0x30')],'resourceId':_0x3d9966['id'],'type':_0x42fda8[_0x898a('0x30')],'sectionId':_0x42fda8['id']},{})[_0x898a('0x2e')](function(){return _0x37c6f6;});}else{return _0x37c6f6;}})[_0x898a('0x20')](function(_0x16c48d){logger[_0x898a('0x1d')](_0x898a('0x69'),_0x16c48d);throw _0x16c48d;});}return _0x37c6f6;})[_0x898a('0x2e')](respondWithResult(_0x5b4e60,0xc9))[_0x898a('0x20')](handleError(_0x5b4e60,null));};exports['update']=function(_0x2d9a9c,_0x554cb7){var _0x2be3a8=null;_0x2d9a9c[_0x898a('0x61')][_0x898a('0x6a')]['split'](',')[_0x898a('0x62')](_0x3f0d9f=>{if(_0x3f0d9f[_0x898a('0x63')]()!==''&&!wildcardUtils[_0x898a('0x6b')](_0x3f0d9f[_0x898a('0x63')]())){_0x2be3a8=new APIBadRequestError('\x22'+_0x3f0d9f['trim']()+_0x898a('0x6c'));}});if(_0x2be3a8){return handleError(_0x554cb7,null)(_0x2be3a8);}if(_0x2d9a9c[_0x898a('0x61')]['id']){delete _0x2d9a9c[_0x898a('0x61')]['id'];}return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x2d9a9c['params']['id']},'include':[{'model':db[_0x898a('0x5c')],'as':_0x898a('0x44')}]})[_0x898a('0x2e')](handleEntityNotFound(_0x554cb7,null))[_0x898a('0x2e')](saveUpdates(_0x2d9a9c[_0x898a('0x61')],null))[_0x898a('0x2e')](respondWithResult(_0x554cb7,null))[_0x898a('0x20')](handleError(_0x554cb7,null));};exports[_0x898a('0x2a')]=function(_0x51836c,_0x32a207){return db[_0x898a('0x46')]['find']({'where':{'id':_0x51836c[_0x898a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x32a207,null))[_0x898a('0x2e')](removeEntity(_0x32a207,null))['catch'](handleError(_0x32a207,null));};exports[_0x898a('0x6d')]=function(_0x387f2c,_0x3b07dc){return db[_0x898a('0x46')][_0x898a('0x6d')]()[_0x898a('0x2e')](respondWithResult(_0x3b07dc,null))[_0x898a('0x20')](handleError(_0x3b07dc,null));};exports[_0x898a('0x6e')]=function(_0x1f46b5,_0x59073f){if(_0x1f46b5[_0x898a('0x61')]['id']){delete _0x1f46b5[_0x898a('0x61')]['id'];}return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x1f46b5[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x59073f,null))[_0x898a('0x2e')](function(_0x4bcf85){if(_0x4bcf85){_0x1f46b5[_0x898a('0x61')][_0x898a('0x6f')]=_0x4bcf85['id'];return db['Disposition']['create'](_0x1f46b5[_0x898a('0x61')]);}})[_0x898a('0x2e')](respondWithResult(_0x59073f,null))['catch'](handleError(_0x59073f,null));};exports['getDispositions']=function(_0x34e1f2,_0x4a79a4){var _0x2fdeb5={'raw':![],'where':{}};var _0x41077f={};var _0x5dbe6c={'count':0x0,'rows':[]};return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0x34e1f2[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x4a79a4,null))[_0x898a('0x2e')](function(_0x2d047a){if(_0x2d047a){_0x41077f[_0x898a('0x41')]=_['keys'](db[_0x898a('0x71')][_0x898a('0x5d')]);_0x41077f[_0x898a('0x4a')]=_['keys'](_0x34e1f2[_0x898a('0x4a')]);_0x41077f[_0x898a('0x53')]=_['intersection'](_0x41077f[_0x898a('0x41')],_0x41077f['query']);_0x2fdeb5['attributes']=_['intersection'](_0x41077f[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x34e1f2[_0x898a('0x4a')][_0x898a('0x4d')]));_0x2fdeb5[_0x898a('0x4c')]=_0x2fdeb5[_0x898a('0x4c')][_0x898a('0x4e')]?_0x2fdeb5['attributes']:_0x41077f[_0x898a('0x41')];if(!_0x34e1f2['query'][_0x898a('0x72')](_0x898a('0x4f'))){_0x2fdeb5['limit']=qs[_0x898a('0x24')](_0x34e1f2[_0x898a('0x4a')][_0x898a('0x24')]);_0x2fdeb5[_0x898a('0x27')]=qs[_0x898a('0x27')](_0x34e1f2['query']['offset']);}_0x2fdeb5['order']=qs[_0x898a('0x51')](_0x34e1f2[_0x898a('0x4a')][_0x898a('0x51')]);_0x2fdeb5['where']=qs[_0x898a('0x53')](_['pick'](_0x34e1f2['query'],_0x41077f[_0x898a('0x53')]));_0x2fdeb5[_0x898a('0x52')][_0x898a('0x6f')]=_0x2d047a['id'];if(_0x34e1f2[_0x898a('0x4a')][_0x898a('0x55')]){_0x2fdeb5[_0x898a('0x52')]=_[_0x898a('0x56')](_0x2fdeb5[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x2fdeb5[_0x898a('0x4c')],function(_0x5ce499){var _0x122682={};_0x122682[_0x5ce499]={'$like':'%'+_0x34e1f2[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x122682;})});}_0x2fdeb5=_[_0x898a('0x56')]({},_0x2fdeb5,_0x34e1f2[_0x898a('0x57')]);return db['Disposition'][_0x898a('0x26')]({'where':_0x2fdeb5[_0x898a('0x52')]})[_0x898a('0x2e')](function(_0xc187e7){_0x5dbe6c[_0x898a('0x26')]=_0xc187e7;if(_0x34e1f2[_0x898a('0x4a')][_0x898a('0x5e')]){_0x2fdeb5[_0x898a('0x58')]=[{'all':!![]}];}return db[_0x898a('0x71')][_0x898a('0x59')](_0x2fdeb5);})[_0x898a('0x2e')](function(_0x381071){_0x5dbe6c['rows']=_0x381071;return _0x5dbe6c;});}})[_0x898a('0x2e')](respondWithFilteredResult(_0x4a79a4,_0x2fdeb5))['catch'](handleError(_0x4a79a4,null));};exports[_0x898a('0x73')]=function(_0x34e463,_0xc510c0){return db['ChatWebsite'][_0x898a('0x5f')]({'where':{'id':_0x34e463[_0x898a('0x5b')]['id']}})['then'](handleEntityNotFound(_0xc510c0,null))[_0x898a('0x2e')](function(_0x3ebb81){if(_0x3ebb81){return _0x3ebb81[_0x898a('0x73')](_0x34e463[_0x898a('0x4a')][_0x898a('0x74')]);}})[_0x898a('0x2e')](respondWithStatusCode(_0xc510c0,null))['catch'](handleError(_0xc510c0,null));};exports['addAnswer']=function(_0x19b6f4,_0x4b7334){if(_0x19b6f4[_0x898a('0x61')]['id']){delete _0x19b6f4[_0x898a('0x61')]['id'];}return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x19b6f4[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x4b7334,null))['then'](function(_0x4d7431){if(_0x4d7431){_0x19b6f4[_0x898a('0x61')]['ChatWebsiteId']=_0x4d7431['id'];return db[_0x898a('0x75')][_0x898a('0x60')](_0x19b6f4['body']);}})[_0x898a('0x2e')](respondWithResult(_0x4b7334,null))['catch'](handleError(_0x4b7334,null));};exports[_0x898a('0x76')]=function(_0xc8763f,_0xed8829){var _0x5ef14d={'raw':![],'where':{}};var _0x546c80={};var _0x541241={'count':0x0,'rows':[]};return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0xc8763f[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0xed8829,null))[_0x898a('0x2e')](function(_0x1c989f){if(_0x1c989f){_0x546c80['model']=_[_0x898a('0x49')](db[_0x898a('0x75')]['rawAttributes']);_0x546c80['query']=_[_0x898a('0x49')](_0xc8763f[_0x898a('0x4a')]);_0x546c80['filters']=_[_0x898a('0x4b')](_0x546c80['model'],_0x546c80[_0x898a('0x4a')]);_0x5ef14d[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x546c80[_0x898a('0x41')],qs[_0x898a('0x4d')](_0xc8763f[_0x898a('0x4a')][_0x898a('0x4d')]));_0x5ef14d[_0x898a('0x4c')]=_0x5ef14d[_0x898a('0x4c')][_0x898a('0x4e')]?_0x5ef14d[_0x898a('0x4c')]:_0x546c80[_0x898a('0x41')];if(!_0xc8763f[_0x898a('0x4a')][_0x898a('0x72')](_0x898a('0x4f'))){_0x5ef14d['limit']=qs['limit'](_0xc8763f['query'][_0x898a('0x24')]);_0x5ef14d['offset']=qs[_0x898a('0x27')](_0xc8763f[_0x898a('0x4a')][_0x898a('0x27')]);}_0x5ef14d[_0x898a('0x50')]=qs[_0x898a('0x51')](_0xc8763f[_0x898a('0x4a')][_0x898a('0x51')]);_0x5ef14d[_0x898a('0x52')]=qs['filters'](_[_0x898a('0x54')](_0xc8763f['query'],_0x546c80['filters']));_0x5ef14d['where'][_0x898a('0x6f')]=_0x1c989f['id'];if(_0xc8763f['query'][_0x898a('0x55')]){_0x5ef14d[_0x898a('0x52')]=_[_0x898a('0x56')](_0x5ef14d['where'],{'$or':_['map'](_0x5ef14d[_0x898a('0x4c')],function(_0x2f3d65){var _0x3a1bc5={};_0x3a1bc5[_0x2f3d65]={'$like':'%'+_0xc8763f[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x3a1bc5;})});}_0x5ef14d=_[_0x898a('0x56')]({},_0x5ef14d,_0xc8763f[_0x898a('0x57')]);return db[_0x898a('0x75')][_0x898a('0x26')]({'where':_0x5ef14d['where']})[_0x898a('0x2e')](function(_0x21a4f6){_0x541241['count']=_0x21a4f6;if(_0xc8763f[_0x898a('0x4a')][_0x898a('0x5e')]){_0x5ef14d[_0x898a('0x58')]=[{'all':!![]}];}return db[_0x898a('0x75')][_0x898a('0x59')](_0x5ef14d);})['then'](function(_0xe3fea){_0x541241[_0x898a('0x5a')]=_0xe3fea;return _0x541241;});}})[_0x898a('0x2e')](respondWithFilteredResult(_0xed8829,_0x5ef14d))[_0x898a('0x20')](handleError(_0xed8829,null));};exports['removeAnswers']=function(_0x58f08e,_0x2724e1){return db['ChatWebsite'][_0x898a('0x5f')]({'where':{'id':_0x58f08e[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x2724e1,null))[_0x898a('0x2e')](function(_0x32cbfa){if(_0x32cbfa){return _0x32cbfa[_0x898a('0x77')](_0x58f08e[_0x898a('0x4a')]['ids']);}})[_0x898a('0x2e')](respondWithStatusCode(_0x2724e1,null))['catch'](handleError(_0x2724e1,null));};exports[_0x898a('0x78')]=function(_0x110a2d,_0x5b8504){_0x110a2d[_0x898a('0x61')][_0x898a('0x79')]=_0x110a2d[_0x898a('0x7a')][_0x898a('0x7b')];return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x110a2d[_0x898a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5b8504,null))[_0x898a('0x2e')](saveUpdates(_0x110a2d[_0x898a('0x61')],null))[_0x898a('0x2e')](respondWithResult(_0x5b8504,null))[_0x898a('0x20')](handleError(_0x5b8504,null));};exports[_0x898a('0x7c')]=function(_0x171691,_0x1259f0){_0x171691['body'][_0x898a('0x7d')]=_0x171691[_0x898a('0x7a')]['filename'];return db['ChatWebsite'][_0x898a('0x5f')]({'where':{'id':_0x171691['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x1259f0,null))[_0x898a('0x2e')](saveUpdates(_0x171691[_0x898a('0x61')],null))['then'](respondWithResult(_0x1259f0,null))[_0x898a('0x20')](handleError(_0x1259f0,null));};exports[_0x898a('0x7e')]=function(_0xdef811,_0x1777a9){_0xdef811[_0x898a('0x61')][_0x898a('0x7f')]=_0xdef811[_0x898a('0x7a')][_0x898a('0x7b')];return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0xdef811['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x1777a9,null))[_0x898a('0x2e')](saveUpdates(_0xdef811[_0x898a('0x61')],null))[_0x898a('0x2e')](respondWithResult(_0x1777a9,null))[_0x898a('0x20')](handleError(_0x1777a9,null));};exports[_0x898a('0x80')]=function(_0x31b0d8,_0x4863aa){_0x31b0d8['body'][_0x898a('0x81')]=_0x31b0d8[_0x898a('0x7a')]['filename'];return db[_0x898a('0x46')]['find']({'where':{'id':_0x31b0d8[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x4863aa,null))['then'](saveUpdates(_0x31b0d8[_0x898a('0x61')],null))[_0x898a('0x2e')](respondWithResult(_0x4863aa,null))[_0x898a('0x20')](handleError(_0x4863aa,null));};exports['getLogo']=function(_0x5b7790,_0x5a0689){var _0x1cabde=path[_0x898a('0x82')](config['root'],_0x898a('0x83'));var _0x4a9c3b={'where':{'id':_0x5b7790[_0x898a('0x5b')]['id']},'attributes':['id',_0x898a('0x79')],'raw':!![]};var _0x210ce7=![];return require(_0x898a('0x84'))[_0x898a('0x85')]()[_0x898a('0x2e')](function(_0x389fda){if(_0x389fda){_0x210ce7=_0x389fda[_0x898a('0x86')];}})[_0x898a('0x2e')](function(){return db[_0x898a('0x46')][_0x898a('0x5f')](_0x4a9c3b);})[_0x898a('0x2e')](handleEntityNotFound(_0x5a0689,null))[_0x898a('0x2e')](function(_0x5e76f2){if(_0x5e76f2){if(!_['isNil'](_0x5e76f2[_0x898a('0x79')])){if(fs[_0x898a('0x87')](path[_0x898a('0x82')](config[_0x898a('0x88')],_0x898a('0x89'),_0x5e76f2[_0x898a('0x79')]))&&_0x210ce7){_0x1cabde=path[_0x898a('0x82')](config['root'],_0x898a('0x89'),_0x5e76f2[_0x898a('0x79')]);}}return _0x5a0689[_0x898a('0x8a')](_0x1cabde);}})[_0x898a('0x20')](handleError(_0x5a0689,null));};exports['getAvatar']=function(_0x41b9e1,_0x1cbc52){var _0xbadb62=path[_0x898a('0x82')](config['root'],_0x898a('0x8b'));var _0xba9062={'where':{'id':_0x41b9e1[_0x898a('0x5b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0xba9062)[_0x898a('0x2e')](handleEntityNotFound(_0x1cbc52,null))['then'](function(_0x40b532){if(_0x40b532){if(!_[_0x898a('0x8c')](_0x40b532[_0x898a('0x7d')])){if(fs[_0x898a('0x87')](path[_0x898a('0x82')](config['root'],_0x898a('0x8d'),_0x40b532[_0x898a('0x7d')]))){_0xbadb62=path[_0x898a('0x82')](config[_0x898a('0x88')],_0x898a('0x8d'),_0x40b532[_0x898a('0x7d')]);}}return _0x1cbc52[_0x898a('0x8a')](_0xbadb62);}})[_0x898a('0x20')](handleError(_0x1cbc52,null));};exports['getCustomerAvatar']=function(_0x2f1a65,_0x167a4d){var _0x2614e7=path[_0x898a('0x82')](config[_0x898a('0x88')],_0x898a('0x8e'));var _0x1779db={'where':{'id':_0x2f1a65[_0x898a('0x5b')]['id']},'attributes':['id',_0x898a('0x7f'),_0x898a('0x8f')],'raw':!![]};return db['ChatWebsite']['find'](_0x1779db)['then'](handleEntityNotFound(_0x167a4d,null))[_0x898a('0x2e')](function(_0x380ae7){if(_0x380ae7){if(!_[_0x898a('0x8c')](_0x380ae7[_0x898a('0x7f')])){if(fs[_0x898a('0x87')](path['join'](config[_0x898a('0x88')],_0x898a('0x8d'),_0x380ae7[_0x898a('0x7f')]))&&_0x380ae7[_0x898a('0x8f')]){_0x2614e7=path['join'](config[_0x898a('0x88')],_0x898a('0x8d'),_0x380ae7[_0x898a('0x7f')]);}}return _0x167a4d[_0x898a('0x8a')](_0x2614e7);}})[_0x898a('0x20')](handleError(_0x167a4d,null));};exports['getSystemAvatar']=function(_0x199a17,_0x4a862e){var _0x5367d5=path[_0x898a('0x82')](config['root'],_0x898a('0x90'));var _0x3359c1={'where':{'id':_0x199a17[_0x898a('0x5b')]['id']},'attributes':['id',_0x898a('0x81')],'raw':!![]};return db[_0x898a('0x46')][_0x898a('0x5f')](_0x3359c1)[_0x898a('0x2e')](handleEntityNotFound(_0x4a862e,null))[_0x898a('0x2e')](function(_0xa1c4a2){if(_0xa1c4a2){if(!_[_0x898a('0x8c')](_0xa1c4a2[_0x898a('0x81')])){if(fs[_0x898a('0x87')](path[_0x898a('0x82')](config['root'],_0x898a('0x8d'),_0xa1c4a2['systemAvatar']))){_0x5367d5=path[_0x898a('0x82')](config[_0x898a('0x88')],'server/files/images/avatars/',_0xa1c4a2[_0x898a('0x81')]);}}return _0x4a862e['download'](_0x5367d5);}})[_0x898a('0x20')](handleError(_0x4a862e,null));};function checkWebsiteInterval(_0x8054b){var _0x5aa358=_0x8054b[_0x898a('0x91')];if(!_0x5aa358){return Promise[_0x898a('0x92')](_0x8054b);}var _0x877820=_0x8054b[_0x898a('0x93')]||undefined;return _0x5aa358[_0x898a('0x94')](_0x877820)['then'](function(_0x285f0e){if(!_0x285f0e){throw new APIOutOfIntervalError();}return _0x8054b;});}exports[_0x898a('0x95')]=function(_0x4e759e,_0x4f1ff1){var _0xb64850={'body':_0x4e759e[_0x898a('0x61')],'channel':'chat'};var _0x51c0c2=[];var _0x1bfbc3=[];var _0x4de42c={};var _0xb1d9c4=![];if(_0x4e759e['body']['id']){delete _0x4e759e[_0x898a('0x61')]['id'];}if(_['isNil'](_0x4e759e['body'][_0x898a('0x96')])){throw new APIBadRequestError(_0x898a('0x97'));}if(_[_0x898a('0x8c')](_0x4e759e[_0x898a('0x61')][_0x898a('0x98')])){throw new APIBadRequestError(_0x898a('0x99'));}if(_[_0x898a('0x9a')](_0x4e759e[_0x898a('0x61')][_0x898a('0x61')])){throw new APIBadRequestError(_0x898a('0x9b'));}var _0x2dd49c=_0x4e759e['body'][_0x898a('0x33')]&&_0x4e759e[_0x898a('0x61')][_0x898a('0x9c')];return db[_0x898a('0x9d')]['describe']()['then'](function(_0x3522d2){if(!_0x3522d2){throw new Error(_0x898a('0x9e'));}_0x51c0c2=Object[_0x898a('0x49')](_0x3522d2)['filter'](function(_0x3f622a){return![_0x898a('0x9f'),_0x898a('0xa0')][_0x898a('0xa1')](_0x3f622a);});_0x1bfbc3=Object[_0x898a('0x49')](_0x3522d2)[_0x898a('0x55')](function(_0x54de91){return![_0x898a('0x9f'),_0x898a('0xa0'),_0x898a('0xa2'),_0x898a('0xa3')][_0x898a('0xa1')](_0x54de91);});if(!_[_0x898a('0xa1')](_0x1bfbc3,_0x4e759e['body'][_0x898a('0x98')])){throw new APIBadRequestError(_0x898a('0xa4')+_0x1bfbc3[_0x898a('0x82')](',\x20'));}_0x4de42c[_0x4e759e[_0x898a('0x61')]['mapKey']]=_0x4e759e[_0x898a('0x61')][_0x898a('0x96')];})[_0x898a('0x2e')](function(){return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x4e759e['params']['id']},'include':[{'model':db[_0x898a('0xa5')],'as':'List','include':[{'model':db[_0x898a('0x9d')],'as':_0x898a('0xa6'),'where':_0x4de42c,'limit':0x1,'order':[[_0x898a('0xa0'),'DESC']]}]},{'model':db[_0x898a('0xa7')],'as':'Applications'},{'model':db[_0x898a('0x91')],'as':_0x898a('0x91'),'include':[{'model':db[_0x898a('0x91')],'as':'Intervals','attributes':['id',_0x898a('0xa8')],'raw':!![]}]}]});})[_0x898a('0x2e')](function(_0x5a5762){if(!_0x5a5762){throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x4e759e[_0x898a('0x5b')]['id']));}if(_0x2dd49c){return checkWebsiteInterval(_0x5a5762);}return _0x5a5762;})[_0x898a('0x2e')](function(_0x4e5adf){_0xb64850[_0x898a('0xa9')]=_0x4e5adf;_0xb64850[_0x898a('0xaa')]=_[_0x898a('0xab')](_0x4e5adf[_0x898a('0xac')],[_0x898a('0xad')],[_0x898a('0xae')]);if(_0xb64850['account']['Applications']){delete _0xb64850[_0x898a('0xa9')][_0x898a('0xac')];}_0xb64850[_0x898a('0xaf')]=_0x4e5adf[_0x898a('0xb0')]||{'id':_0x4e5adf[_0x898a('0xa3')]};if(_0xb64850[_0x898a('0xaf')]&&_0xb64850[_0x898a('0xaf')][_0x898a('0xa6')][_0x898a('0x4e')]){return _0xb64850[_0x898a('0xaf')][_0x898a('0xa6')][0x0];}var _0x271a04=_[_0x898a('0xb1')](_0x4e759e['body'],{'firstName':_0x4e759e[_0x898a('0x61')]['from'],'ListId':_0x4e5adf[_0x898a('0xa3')]});_0x271a04[_0x4e759e[_0x898a('0x61')]['mapKey']]=_0x4e759e[_0x898a('0x61')][_0x898a('0x96')];return db['CmContact']['create'](_0x271a04,{'fields':_0x51c0c2,'raw':!![]});})[_0x898a('0x2e')](function(_0x4a791f){_0xb64850['contact']=_0x4a791f;var _0x2e0593=createInteractionObject(_0x4e759e[_0x898a('0x5b')]['id'],_0x4e759e[_0x898a('0x61')],_0x4e759e['headers'],_0x4a791f);var _0x2f675e={'ChatWebsiteId':_0x4e759e[_0x898a('0x5b')]['id']};if(_0x4e759e[_0x898a('0x61')][_0x898a('0xb2')]){_0x2f675e[_0x898a('0xb2')]=_0x4e759e['body'][_0x898a('0xb2')];_0x2f675e[_0x898a('0xb3')]=![];return db[_0x898a('0xb4')][_0x898a('0x5f')]({'where':_0x2f675e})[_0x898a('0x2e')](function(_0x539518){var _0x3bd71e=_0x4e759e[_0x898a('0x61')][_0x898a('0x33')]&&_0x4e759e[_0x898a('0x61')][_0x898a('0x9c')];if(_0x539518){_0xb1d9c4=!![];return _0x539518;}else if(!_0x3bd71e&&_0x539518&&_0x539518[_0x898a('0xb3')]){throw new APIConflictError(_0x898a('0xb5'));}_0x2e0593[_0x898a('0xb2')]=_0x4e759e[_0x898a('0x61')][_0x898a('0xb2')];_0x2e0593[_0x898a('0xb6')]=_0x4e759e['body'][_0x898a('0xb6')];return db[_0x898a('0xb4')][_0x898a('0x60')](_0x2e0593);});}_0x2f675e[_0x898a('0xb7')]=_0x4a791f['id'];if(_0x4e759e[_0x898a('0x61')][_0x898a('0xb8')]&&_0x4e759e[_0x898a('0x61')]['interaction']['id']){_0x2f675e['id']=_0x4e759e[_0x898a('0x61')]['interaction']['id'];return db[_0x898a('0xb4')][_0x898a('0x5f')]({'where':_0x2f675e})[_0x898a('0x2e')](function(_0x5acc72){var _0x55b9ca=_0x4e759e[_0x898a('0x61')][_0x898a('0x33')]&&_0x4e759e[_0x898a('0x61')][_0x898a('0x9c')];if(!_0x55b9ca&&_0x5acc72&&_0x5acc72[_0x898a('0xb3')]){throw new APIConflictError(_0x898a('0xb5'));}else if(_0x5acc72){_0xb1d9c4=!![];return _0x5acc72;}else{return db[_0x898a('0xb4')][_0x898a('0x60')](_0x2e0593);}});}return db['ChatInteraction'][_0x898a('0x60')](_0x2e0593);})[_0x898a('0x2e')](function(_0x390503){if(!_0xb1d9c4){return _0x390503;}var _0x237a1c={'from':(_0xb64850['contact']['firstName']||'')+'\x20'+(_0xb64850[_0x898a('0xb9')][_0x898a('0x37')]||'')};if(_0x4e759e[_0x898a('0x61')]['threadId']&&_0x4e759e[_0x898a('0x61')]['messageId']&&_0x4e759e[_0x898a('0x61')][_0x898a('0xb2')]!=_0x4e759e[_0x898a('0x61')][_0x898a('0xba')]){_0x237a1c[_0x898a('0xb2')]=_0x4e759e[_0x898a('0x61')]['messageId'];}return _0x390503[_0x898a('0x29')](_0x237a1c);})[_0x898a('0x2e')](function(_0x1d6dff){_0xb64850['interaction']=_0x1d6dff['get']({'plain':!![]});_0xb64850[_0x898a('0xb8')]['created']=!_0xb1d9c4;if(_0xb64850[_0x898a('0xb8')][_0x898a('0xbb')]){if(_0xb64850[_0x898a('0xa9')][_0x898a('0xbc')]){_0xb64850[_0x898a('0xaa')]['push']({'id':0x0,'priority':_0xb64850[_0x898a('0xaa')][_0x898a('0x4e')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x898a('0xbd')});}}return db[_0x898a('0xbe')][_0x898a('0x60')]({'body':_0x4e759e[_0x898a('0x61')][_0x898a('0x61')],'ChatWebsiteId':_0x4e759e['params']['id'],'ChatInteractionId':_0x1d6dff['id'],'direction':'in','ContactId':_0xb64850[_0x898a('0xb9')]['id'],'AttachmentId':_0x4e759e[_0x898a('0x61')][_0x898a('0xbf')]});})[_0x898a('0x2e')](function(_0x4b0c1b){_0xb64850[_0x898a('0x1e')]=_0x4b0c1b;if(!_0xb64850[_0x898a('0xb8')][_0x898a('0xc0')]){return;}return db[_0x898a('0xc1')][_0x898a('0x5f')]({'attributes':['id','name'],'where':{'id':_0xb64850['interaction'][_0x898a('0xc0')]}});})[_0x898a('0x2e')](function(_0x24366d){if(_0x24366d){_0xb64850[_0x898a('0xaa')][_0x898a('0xc2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x24366d[_0x898a('0x30')]+','+(_0xb64850[_0x898a('0xa9')][_0x898a('0xc3')]||0xa),'interval':_0x898a('0xbd')});_0xb64850[_0x898a('0xc4')]=!![];}if(!_0xb64850[_0x898a('0xb8')][_0x898a('0xc5')]){return;}return db[_0x898a('0xc6')][_0x898a('0x5f')]({'attributes':['id',_0x898a('0x30')],'where':{'id':_0xb64850[_0x898a('0xb8')][_0x898a('0xc5')]}});})[_0x898a('0x2e')](function(_0x46f2c5){if(_0x46f2c5){_0xb64850['applications'][_0x898a('0xc2')]({'id':0x0,'priority':0x1,'app':_0x898a('0xc7'),'appdata':_0x46f2c5[_0x898a('0x30')]+','+(_0xb64850[_0x898a('0xa9')][_0x898a('0xc8')]||0x12c),'interval':_0x898a('0xbd')});}return respondWithRpcPromise(_0x898a('0xc9'),_0x898a('0xca'),_0xb64850);})['then'](function(_0x2ca7ee){respondWithRpcPromise(_0x898a('0xcb'),_0x898a('0xcb'),{'event':'notify','message':_0x2ca7ee},client9002);return _0x2ca7ee;})[_0x898a('0x2e')](respondWithResult(_0x4f1ff1,null))[_0x898a('0x20')](APIHandleError(_0x4f1ff1));};exports['offline']=function(_0xf8a823,_0x3dc746){var _0x3ed2bf,_0x1def1b,_0x2ffba3;var _0x12ff13=[];var _0x2314a2={};var _0x2c5037=_0xf8a823[_0x898a('0xcc')]||[];var _0x57f3e1=[];var _0x230030;return db[_0x898a('0x9d')][_0x898a('0x6d')]()[_0x898a('0x2e')](function(_0x9a3e8c){if(!_0x9a3e8c){throw new db[(_0x898a('0xcd'))]['ValidationError'](_0x898a('0xce'));}_0x12ff13=_[_0x898a('0xcf')](_[_0x898a('0x49')](_0x9a3e8c),[_0x898a('0x9f'),_0x898a('0xa0'),_0x898a('0xa2'),'ListId']);if(_0xf8a823[_0x898a('0x61')]['id']){delete _0xf8a823[_0x898a('0x61')]['id'];}if(_[_0x898a('0x8c')](_0xf8a823[_0x898a('0x61')][_0x898a('0x96')])){throw _0x3dc746['status'](0x1f4)['send'](new db['Sequelize'][(_0x898a('0xd0'))]('from\x20is\x20mandatory'));}if(_[_0x898a('0x8c')](_0xf8a823[_0x898a('0x61')][_0x898a('0x61')])||_0xf8a823[_0x898a('0x61')][_0x898a('0x61')]===''){throw _0x3dc746[_0x898a('0x22')](0x1f4)[_0x898a('0xd1')](new db[(_0x898a('0xcd'))][(_0x898a('0xd0'))](_0x898a('0xd2')));}if(_[_0x898a('0x8c')](_0xf8a823[_0x898a('0x61')][_0x898a('0xd3')])){throw _0x3dc746['status'](0x1f4)[_0x898a('0xd1')](new db[(_0x898a('0xcd'))]['ValidationError'](_0x898a('0xd4')+_0x12ff13));}if(!_[_0x898a('0xa1')](_0x12ff13,_0xf8a823[_0x898a('0x61')][_0x898a('0xd3')])){throw _0x3dc746[_0x898a('0x22')](0x1f4)[_0x898a('0xd1')](new db[(_0x898a('0xcd'))][(_0x898a('0xd0'))](_0x898a('0xd5')+_0x12ff13));}_0x2314a2[_0xf8a823['body'][_0x898a('0xd3')]]=_0xf8a823[_0x898a('0x61')][_0x898a('0x96')];})[_0x898a('0x2e')](function(){return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0xf8a823[_0x898a('0x5b')]['id']},'include':[{'model':db[_0x898a('0xa5')],'as':_0x898a('0xb0')},{'model':db[_0x898a('0xd6')],'as':_0x898a('0xd6')}]});})[_0x898a('0x2e')](handleEntityNotFound(_0x3dc746,null))[_0x898a('0x2e')](function(_0x3549f6){if(_0x3549f6&&_0x3549f6[_0x898a('0xb0')]){_0x1def1b=_0x3549f6;var _0x95287e=_[_0x898a('0xb1')](_0xf8a823['body'],{'firstName':_0xf8a823['body']['from'],'phone':_0xf8a823[_0x898a('0x61')][_0x898a('0x96')],'ListId':_0x3549f6[_0x898a('0xa3')]});_0x95287e[_0xf8a823[_0x898a('0x61')]['mapKeyOffline']]=_0xf8a823['body'][_0x898a('0x96')];return db[_0x898a('0x9d')][_0x898a('0xd7')]({'where':_0x2314a2,'defaults':_0x95287e});}})[_0x898a('0xd8')](function(_0xaa3b87){if(_0xaa3b87){_0x2ffba3=_0xaa3b87;var _0x1b4b54=fs['readFileSync'](path[_0x898a('0x82')](config['root'],_0x898a('0xd9')),'utf8');var _0x4d1b8b=ejs[_0x898a('0xda')](_0x1b4b54,{'body':_['toPairs'](_0xf8a823[_0x898a('0x61')][_0x898a('0x61')]),'bodyTitle':_0x1def1b[_0x898a('0xdb')]});return db[_0x898a('0xdc')][_0x898a('0x60')]({'body':_0x4d1b8b,'plainBody':htmlToText[_0x898a('0xdd')](_0x4d1b8b),'ContactId':_0xaa3b87['id'],'ChatWebsiteId':_0x1def1b['id']});}})[_0x898a('0x2e')](function(_0x3da4a5){_0x230030=_0x3da4a5;if(_0x2c5037['length']){var _0x194181=_0x2c5037['map'](function(_0x15663d){return{'name':_0x15663d[_0x898a('0xde')],'basename':_0x15663d[_0x898a('0x7b')],'type':_0x15663d[_0x898a('0xdf')],'ChatOfflineMessageId':_0x3da4a5['id']};});_0x57f3e1=_0x194181[_0x898a('0x45')](_0x4da5c9=>{var _0x2ae8b6={'filename':_0x4da5c9[_0x898a('0x30')],'path':path[_0x898a('0x82')](config[_0x898a('0x88')],_0x898a('0xe0'),'files',_0x898a('0xe1'),'offline-chat',_0x4da5c9['basename'])};return _0x2ae8b6;});if(!_0x1def1b[_0x898a('0xe2')]){return db[_0x898a('0xe3')][_0x898a('0xe4')](function(_0x3ab9b6){return db[_0x898a('0xe5')][_0x898a('0xe6')](_0x194181,{'transaction':_0x3ab9b6});});}}})[_0x898a('0x2e')](function(){if(_0x230030){_0x3ed2bf=_0x230030;return db[_0x898a('0xd6')][_0x898a('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x898a('0xe7')],'as':_0x898a('0xe8'),'raw':!![],'include':[{'model':db[_0x898a('0xe9')],'as':_0x898a('0xe9'),'raw':!![]}]}]});}})['then'](function(_0x4b2f30){if(_0x4b2f30&&_0x4b2f30[_0x898a('0xe8')]&&_0x1def1b['forwardOffline']&&_0x1def1b[_0x898a('0xea')]){var _0x216e76=_0x4b2f30['getSmtpOptions']();return respondWithRpcPromise(_0x898a('0xeb'),_0x898a('0xec'),{'account':_0x216e76,'message':{'from':util[_0x898a('0x3b')](_0x898a('0xed'),_0x4b2f30[_0x898a('0x30')],_0x4b2f30['email']||_0x4b2f30[_0x898a('0xe8')][_0x898a('0x66')]),'to':_0x1def1b[_0x898a('0xea')],'subject':_0x1def1b[_0x898a('0xee')],'html':_0x3ed2bf[_0x898a('0x61')],'attachments':_0x57f3e1}},client9003)[_0x898a('0x2e')](function(){return _0x3ed2bf;})[_0x898a('0x20')](function(_0x179513){logger[_0x898a('0x1d')](_0x179513);});}})[_0x898a('0x2e')](function(){if(_0x1def1b&&_0x1def1b[_0x898a('0xe2')]&&_0x1def1b[_0x898a('0xef')]){var _0x3d85b2=[];if(_0x2c5037[_0x898a('0x4e')]){_0x3d85b2=_0x2c5037[_0x898a('0x45')](function(_0x3065a2){return{'name':_0x3065a2[_0x898a('0xde')],'basename':_0x3065a2[_0x898a('0x7b')],'type':_0x3065a2['mimetype'],'ChatOfflineMessageId':_0x230030['id']};});}var _0x4dd1aa;if(!_[_0x898a('0x8c')](_0x1def1b['subjectOffline'])){var _0x46696c=_[_0x898a('0x45')](_0xf8a823[_0x898a('0x61')],function(_0x1fefd0){return _0x1fefd0;});var _0x244b0e=_['toPairsIn'](_0x46696c)[0x0];var _0x2ba5f8=_['mapValues'](_0x244b0e,function(_0x3c46d2){return _0x3c46d2;});_0x4dd1aa=_0x2ba5f8[0x1][_0x1def1b['subjectOffline']];}var _0x44f4c3={'from':_0x2ffba3[_0x898a('0xf0')],'firstName':_0x2ffba3[_0x898a('0xf1')],'lastName':_0x2ffba3[_0x898a('0x37')],'mapKey':_0x898a('0xf0'),'message':{'from':_0x2ffba3[_0x898a('0xf0')],'to':_0x1def1b['MailAccount'][_0x898a('0xf0')],'cc':'','subject':_['isNil'](_0x4dd1aa)?_0x1def1b['offlineMessageSubject']:_0x4dd1aa,'messageId':'','sentAt':new Date(),'attach':_0x3d85b2[_0x898a('0x4e')],'attachments':_0x3d85b2,'originChannel':_0x898a('0xf2'),'ChatWebsiteId':_0x1def1b['id'],'ChatOfflineMessageId':_0x3ed2bf['id'],'originTo':_0x1def1b['MailAccount'][_0x898a('0xf0')]},'body':_0x3ed2bf[_0x898a('0x61')]};var _0x4663fe={'account':{'id':_0x1def1b[_0x898a('0xef')]},'body':_0x44f4c3,'log':_0x898a('0xf3')};return respondWithRpcPromise('NotifyMailAccount',_0x898a('0xf4'),_0x4663fe,client9001)[_0x898a('0x2e')](function(){return _0x3ed2bf;})[_0x898a('0x20')](function(_0x456365){logger['error'](_0x456365);});}return;})[_0x898a('0x2e')](function(){if(_0x3ed2bf){return _0x3ed2bf;}})['then'](respondWithResult(_0x3dc746,null))[_0x898a('0x20')](function(){for(var _0x3712b0 of _0x2c5037){var _0x51f314=path['join'](config[_0x898a('0x88')],_0x898a('0xe0'),'files',_0x898a('0xe1'),'offline-chat',_0x3712b0[_0x898a('0x7b')]);fs_extra[_0x898a('0xf5')](_0x51f314)[_0x898a('0x20')](function(_0x4fc478){logger[_0x898a('0x1d')]('Could\x20not\x20remove\x20attachment\x20file',_0x51f314,_0x4fc478);});}});};exports[_0x898a('0xf6')]=function(_0x351def,_0x51ede4){return db[_0x898a('0xb4')]['find']({'where':{'id':_0x351def[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x51ede4,null))[_0x898a('0x2e')](function(_0x2e6706){if(_0x2e6706){return _0x2e6706['addInteraction'](_0x351def[_0x898a('0x61')][_0x898a('0x74')],_[_0x898a('0xf7')](_0x351def[_0x898a('0x61')],[_0x898a('0x74'),'id'])||{});}})[_0x898a('0x2e')](respondWithResult(_0x51ede4,null))[_0x898a('0x20')](handleError(_0x51ede4,null));};exports[_0x898a('0xf8')]=function(_0x19e347,_0x19c8ca){var _0x47a5bf={'raw':![],'where':{}};var _0xcc083a={};var _0x1370aa={'count':0x0,'rows':[]};return db[_0x898a('0x46')]['findOne']({'where':{'id':_0x19e347['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x19c8ca,null))[_0x898a('0x2e')](function(_0x349289){if(_0x349289){_0xcc083a[_0x898a('0x41')]=_['keys'](db['ChatInteraction'][_0x898a('0x5d')]);_0xcc083a[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x19e347[_0x898a('0x4a')]);_0xcc083a['filters']=_[_0x898a('0x4b')](_0xcc083a[_0x898a('0x41')],_0xcc083a[_0x898a('0x4a')]);_0x47a5bf[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0xcc083a['model'],qs[_0x898a('0x4d')](_0x19e347[_0x898a('0x4a')][_0x898a('0x4d')]));_0x47a5bf[_0x898a('0x4c')]=_0x47a5bf[_0x898a('0x4c')]['length']?_0x47a5bf[_0x898a('0x4c')]:_0xcc083a['model'];if(!_0x19e347['query'][_0x898a('0x72')](_0x898a('0x4f'))){_0x47a5bf[_0x898a('0x24')]=qs['limit'](_0x19e347['query'][_0x898a('0x24')]);_0x47a5bf[_0x898a('0x27')]=qs['offset'](_0x19e347[_0x898a('0x4a')][_0x898a('0x27')]);}_0x47a5bf[_0x898a('0x50')]=qs['sort'](_0x19e347[_0x898a('0x4a')][_0x898a('0x51')]);_0x47a5bf[_0x898a('0x52')]=qs['filters'](_[_0x898a('0x54')](_0x19e347[_0x898a('0x4a')],_0xcc083a[_0x898a('0x53')]));_0x47a5bf[_0x898a('0x52')]['ChatWebsiteId']=_0x349289['id'];if(_0x19e347[_0x898a('0x4a')][_0x898a('0x55')]){_0x47a5bf[_0x898a('0x52')]=_['merge'](_0x47a5bf[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x47a5bf[_0x898a('0x4c')],function(_0x9ddbdd){var _0x2f3fba={};_0x2f3fba[_0x9ddbdd]={'$like':'%'+_0x19e347[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x2f3fba;})});}_0x47a5bf=_[_0x898a('0x56')]({},_0x47a5bf,_0x19e347['options']);return db['ChatInteraction']['count']({'where':_0x47a5bf[_0x898a('0x52')]})[_0x898a('0x2e')](function(_0x77571d){_0x1370aa[_0x898a('0x26')]=_0x77571d;if(_0x19e347[_0x898a('0x4a')][_0x898a('0x5e')]){_0x47a5bf[_0x898a('0x58')]=[{'model':db[_0x898a('0x9d')],'as':_0x898a('0xf9'),'required':![]},{'model':db[_0x898a('0xc1')],'as':_0x898a('0xfa'),'attributes':[_0x898a('0x30'),_0x898a('0xfb'),_0x898a('0xfc')],'required':![]},{'model':db[_0x898a('0xfd')],'as':'Tags','attributes':['id',_0x898a('0x30'),_0x898a('0xfe')],'where':_0x19e347[_0x898a('0x4a')][_0x898a('0xff')]?{'id':_0x19e347[_0x898a('0x4a')][_0x898a('0xff')]}:undefined,'required':_0x19e347[_0x898a('0x4a')][_0x898a('0xff')]?!![]:![]}];}return db[_0x898a('0xb4')]['findAll'](_0x47a5bf);})[_0x898a('0x2e')](function(_0x33cf8c){_0x1370aa[_0x898a('0x5a')]=_0x33cf8c;return _0x1370aa;});}})[_0x898a('0x2e')](respondWithFilteredResult(_0x19c8ca,_0x47a5bf))[_0x898a('0x20')](handleError(_0x19c8ca,null));};exports[_0x898a('0x100')]=function(_0x3bdd73,_0x51691a){var _0x4fede7=0x0;var _0x2ee5e0=0x0;var _0x47dece=![];var _0x33ab74;var _0xfc0299;return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x3bdd73[_0x898a('0x5b')]['id']},'include':[{'model':db[_0x898a('0x91')],'as':_0x898a('0x91'),'include':[{'model':db[_0x898a('0x91')],'as':_0x898a('0x101'),'attributes':['id',_0x898a('0xa8')]}]}]})['then'](handleEntityNotFound(_0x51691a,null))['then'](function(_0x284113){if(_0x284113){_0x33ab74=_0x284113;return _0x284113[_0x898a('0x102')]({'raw':!![]});}})[_0x898a('0x2e')](function(_0x16e208){if(_0x33ab74){if(_0x16e208){_0xfc0299=_0x16e208;}}return require(_0x898a('0x84'))['getLicense']();})[_0x898a('0x2e')](function(_0x18ac46){if(_0x18ac46){_0x2ee5e0=_0x18ac46[_0x898a('0x103')];_0x47dece=_0x18ac46[_0x898a('0x86')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x898a('0x2e')](function(_0x481584){_0x4fede7=_0x481584;if(_0x2ee5e0&&_0x481584>_0x2ee5e0){return db[_0x898a('0x104')][_0x898a('0x70')]({'where':{'id':0x1}})[_0x898a('0x2e')](function(_0x228aa0){if(_0x228aa0){_0x228aa0[_0x898a('0x105')](_0x898a('0x106'));}});}})['then'](function(){var _0x43ff97=_0x33ab74[_0x898a('0x91')];var _0x1bdfd2=_0x33ab74[_0x898a('0x93')]||undefined;return _0x43ff97?_0x43ff97[_0x898a('0x94')](_0x1bdfd2):!![];})[_0x898a('0x2e')](function(_0x41d16d){var _0x275c04=fs['readFileSync'](path[_0x898a('0x82')](config[_0x898a('0x88')],'server/files/chat/iframe.ejs'),_0x898a('0x107'));var _0x22ebe9=_0x898a('0x108');var _0x355f0c=![];var _0x2b10c4,_0x3d1004;if(_0x3bdd73[_0x898a('0x109')][_0x898a('0x9c')]){_0x2b10c4=new URL(_0x3bdd73['headers'][_0x898a('0x9c')])['origin'];}else if(_0x3bdd73[_0x898a('0x109')][_0x898a('0x10a')]){_0x2b10c4=new URL(_0x3bdd73['headers'][_0x898a('0x10a')])[_0x898a('0x10a')];}else{_0x2b10c4=_0x898a('0x10b');}_0x3d1004=typeof _0x33ab74[_0x898a('0x6a')][_0x898a('0x36')](',')[_0x898a('0x5f')](function(_0x4bbe0d){return wildcardUtils['testWebsiteWithWildcard'](_0x4bbe0d,_0x2b10c4);})!==_0x898a('0x25');var _0x575c4c={'chatVersion':_0x22ebe9,'chatWebsiteAddressOrigin':_0x3d1004?_0x2b10c4:_0x33ab74['address'],'remote':_0x33ab74['remote'],'query':querystring[_0x898a('0x1c')](_[_0x898a('0x56')](_0x33ab74[_0x898a('0x2b')]({'plain':!![]}),{'customerIp':_0x3bdd73[_0x898a('0x109')][_0x898a('0x34')]||_0x3bdd73['headers'][_0x898a('0x10c')]||_0x3bdd73['connection']['remoteAddress']||_0x3bdd73['ip'],'referer':_0x3bdd73[_0x898a('0x109')][_0x898a('0x9c')],'openedInteractions':_0x4fede7,'maxInteractions':_0x2ee5e0,'virtual':_0x47dece['virtual'],'online':_0x41d16d,'custom':_0x47dece,'address':_0x3d1004?_0x2b10c4:null}))['replace'](/'/g,'\x5c\x27')};_0x51691a[_0x898a('0xd1')](ejs[_0x898a('0xda')](Mustache['render'](_0x275c04,_0x575c4c),{'proactiveActions':_0xfc0299,'alignment':_0x33ab74['alignment'],'verticalAlignment':_0x33ab74[_0x898a('0x10d')],'div_color':_0x33ab74['color'],'labelText':_0x33ab74['labelText'],'text_color':_0x33ab74['textColor'],'text_button_color':_0x33ab74[_0x898a('0x10e')],'button_color':_0x33ab74[_0x898a('0x10f')],'background_color':_0x33ab74[_0x898a('0x110')],'hideWhenOffline':_0x33ab74['hideWhenOffline'],'intervalId':_0x33ab74[_0x898a('0x111')],'isDevelopment':_0x355f0c,'chatVersion':_0x22ebe9}));})[_0x898a('0x20')](handleError(_0x51691a,null));};exports['addApplications']=function(_0x4dbc0e,_0x2d4890){var _0x1f1d55=_0x4dbc0e[_0x898a('0x5b')]['id'];var _0x1d1f9c=_0x4dbc0e[_0x898a('0x61')];var _0x358118=0xc8;var _0xd58e7d=null;return db[_0x898a('0xe3')][_0x898a('0xe4')]({'isolationLevel':db[_0x898a('0xe3')]['Transaction'][_0x898a('0x112')][_0x898a('0x113')]},function(_0x4a0e51){return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0x1f1d55},'transaction':_0x4a0e51})[_0x898a('0x2e')](function(_0x725e3f){if(_0x725e3f){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x1f1d55},'transaction':_0x4a0e51})['then'](function(){var _0x347450=_[_0x898a('0x45')](_0x1d1f9c,function(_0x343bf3){_0x343bf3[_0x898a('0x6f')]=_0x1f1d55;return _0x343bf3;});return db['ChatApplication']['bulkCreate'](_0x347450,{'transaction':_0x4a0e51});});}else{_0x358118=0x194;_0xd58e7d=[];}});})[_0x898a('0x2e')](function(){if(_0x358118!==0x194){return db[_0x898a('0xa7')][_0x898a('0x114')]({'where':{'ChatWebsiteId':_0x1f1d55},'order':'priority'})['then'](function(_0x8b63e0){_0xd58e7d=_0x8b63e0;});}})[_0x898a('0x20')](function(_0x21a249){_0x358118=0x1f4;logger[_0x898a('0x1d')](_0x21a249[_0x898a('0x115')]);if(_0x21a249[_0x898a('0x30')]){delete _0x21a249[_0x898a('0x30')];}_0xd58e7d=_0x21a249;})[_0x898a('0x116')](function(){if(_0xd58e7d===null){_0x2d4890[_0x898a('0x2f')](_0x358118);}else{if(_0x358118===0x1f4){_0x2d4890[_0x898a('0x22')](_0x358118)['send'](_0xd58e7d);}else{_0x2d4890[_0x898a('0x22')](_0x358118)[_0x898a('0x23')](_0xd58e7d);}}});};exports[_0x898a('0x117')]=function(_0x26bc49,_0x1ed373){var _0x59200f={};var _0x3b84bb={};var _0x1b5e6a;var _0x210f31;return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0x26bc49['params']['id']}})['then'](handleEntityNotFound(_0x1ed373,null))[_0x898a('0x2e')](function(_0x1e57a2){if(_0x1e57a2){_0x1b5e6a=_0x1e57a2;_0x3b84bb['model']=_[_0x898a('0x49')](db['ChatApplication'][_0x898a('0x5d')]);_0x3b84bb[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x26bc49['query']);_0x3b84bb[_0x898a('0x53')]=_[_0x898a('0x4b')](_0x3b84bb[_0x898a('0x41')],_0x3b84bb['query']);_0x59200f[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x3b84bb[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x26bc49[_0x898a('0x4a')][_0x898a('0x4d')]));_0x59200f[_0x898a('0x4c')]=_0x59200f[_0x898a('0x4c')][_0x898a('0x4e')]?_0x59200f[_0x898a('0x4c')]:_0x3b84bb[_0x898a('0x41')];_0x59200f[_0x898a('0x50')]=qs['sort'](_0x26bc49[_0x898a('0x4a')]['sort']);_0x59200f[_0x898a('0x52')]=qs['filters'](_[_0x898a('0x54')](_0x26bc49[_0x898a('0x4a')],_0x3b84bb[_0x898a('0x53')]));if(_0x26bc49['query'][_0x898a('0x55')]){_0x59200f[_0x898a('0x52')]=_[_0x898a('0x56')](_0x59200f[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x59200f[_0x898a('0x4c')],function(_0x5db4ae){var _0xa752f6={};_0xa752f6[_0x5db4ae]={'$like':'%'+_0x26bc49[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0xa752f6;})});}_0x59200f=_[_0x898a('0x56')]({},_0x59200f,_0x26bc49[_0x898a('0x57')]);return _0x1b5e6a[_0x898a('0x117')](_0x59200f);}})[_0x898a('0x2e')](function(_0x2caedd){if(_0x2caedd){_0x210f31=_0x2caedd[_0x898a('0x4e')];if(!_0x26bc49['query']['hasOwnProperty']('nolimit')){_0x59200f[_0x898a('0x24')]=qs[_0x898a('0x24')](_0x26bc49[_0x898a('0x4a')][_0x898a('0x24')]);_0x59200f[_0x898a('0x27')]=qs[_0x898a('0x27')](_0x26bc49['query']['offset']);}return _0x1b5e6a['getApplications'](_0x59200f);}})[_0x898a('0x2e')](function(_0x514f08){if(_0x514f08){return _0x514f08?{'count':_0x210f31,'rows':_0x514f08}:null;}})[_0x898a('0x2e')](respondWithResult(_0x1ed373,null))[_0x898a('0x20')](handleError(_0x1ed373,null));};exports[_0x898a('0x118')]=function(_0x3930bd,_0xaa6842){return db[_0x898a('0x119')][_0x898a('0x5f')]({'where':{'id':_0x3930bd[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0xaa6842,null))[_0x898a('0x2e')](function(_0x162efb){if(_0x162efb){return _0x162efb[_0x898a('0x118')](_0x3930bd[_0x898a('0x61')][_0x898a('0x74')],_['omit'](_0x3930bd[_0x898a('0x61')],['ids','id'])||{});}})[_0x898a('0x2e')](respondWithResult(_0xaa6842,null))[_0x898a('0x20')](handleError(_0xaa6842,null));};exports[_0x898a('0x102')]=function(_0x5710fc,_0x3347f0){var _0x4fe5a6={};var _0xf18619={};var _0x59e163;var _0x2c56ff;return db[_0x898a('0x46')]['findOne']({'where':{'id':_0x5710fc[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x3347f0,null))[_0x898a('0x2e')](function(_0x1e2d7a){if(_0x1e2d7a){_0x59e163=_0x1e2d7a;_0xf18619['model']=_['keys'](db['ChatProactiveAction'][_0x898a('0x5d')]);_0xf18619[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x5710fc[_0x898a('0x4a')]);_0xf18619[_0x898a('0x53')]=_[_0x898a('0x4b')](_0xf18619[_0x898a('0x41')],_0xf18619[_0x898a('0x4a')]);_0x4fe5a6[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0xf18619['model'],qs[_0x898a('0x4d')](_0x5710fc['query'][_0x898a('0x4d')]));_0x4fe5a6[_0x898a('0x4c')]=_0x4fe5a6[_0x898a('0x4c')][_0x898a('0x4e')]?_0x4fe5a6[_0x898a('0x4c')]:_0xf18619[_0x898a('0x41')];_0x4fe5a6[_0x898a('0x50')]=qs[_0x898a('0x51')](_0x5710fc[_0x898a('0x4a')][_0x898a('0x51')]);_0x4fe5a6[_0x898a('0x52')]=qs['filters'](_['pick'](_0x5710fc[_0x898a('0x4a')],_0xf18619['filters']));if(_0x5710fc[_0x898a('0x4a')][_0x898a('0x55')]){_0x4fe5a6[_0x898a('0x52')]=_[_0x898a('0x56')](_0x4fe5a6[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x4fe5a6['attributes'],function(_0x360da6){var _0x24bec4={};_0x24bec4[_0x360da6]={'$like':'%'+_0x5710fc[_0x898a('0x4a')]['filter']+'%'};return _0x24bec4;})});}_0x4fe5a6=_[_0x898a('0x56')]({},_0x4fe5a6,_0x5710fc[_0x898a('0x57')]);return _0x59e163[_0x898a('0x102')](_0x4fe5a6);}})[_0x898a('0x2e')](function(_0x26afad){if(_0x26afad){_0x2c56ff=_0x26afad[_0x898a('0x4e')];if(!_0x5710fc[_0x898a('0x4a')][_0x898a('0x72')](_0x898a('0x4f'))){_0x4fe5a6['limit']=qs[_0x898a('0x24')](_0x5710fc[_0x898a('0x4a')]['limit']);_0x4fe5a6[_0x898a('0x27')]=qs['offset'](_0x5710fc[_0x898a('0x4a')][_0x898a('0x27')]);}return _0x59e163['getProactiveActions'](_0x4fe5a6);}})[_0x898a('0x2e')](function(_0x2213f4){if(_0x2213f4){return _0x2213f4?{'count':_0x2c56ff,'rows':_0x2213f4}:null;}})[_0x898a('0x2e')](respondWithResult(_0x3347f0,null))[_0x898a('0x20')](handleError(_0x3347f0,null));};exports[_0x898a('0x11a')]=function(_0x526133,_0x555cae){var _0x361eba=_0x526133['query'][_0x898a('0x11b')]==='false'?_0x898a('0x11c'):_0x898a('0x11d');return db[_0x898a('0x46')]['find']({'attributes':['id',_0x361eba],'where':{'id':_0x526133['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x555cae,null))[_0x898a('0x2e')](function(_0x1d430e){if(_0x1d430e){var _0x18c54f=_0x1d430e[_0x361eba];var _0x14c03e=_0x18c54f&&_0x18c54f[_0x898a('0x11e')]?_0x18c54f[_0x898a('0x11e')]:[];_0x555cae[_0x898a('0xd1')]({'fromKey':_[_0x898a('0x8c')](_0x18c54f['fromKey'])?undefined:_0x18c54f[_0x898a('0x11f')],'count':_0x14c03e['length'],'rows':_0x14c03e});}})[_0x898a('0x20')](handleError(_0x555cae,null));};exports[_0x898a('0x120')]=function(_0x545403,_0x546610){var _0x1e4625={'raw':![],'where':{}};var _0x405be4={};var _0x1b1e9a={'count':0x0,'rows':[]};return db[_0x898a('0x46')][_0x898a('0x70')]({'where':{'id':_0x545403[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x546610,null))[_0x898a('0x2e')](function(_0x521d01){if(_0x521d01){_0x405be4[_0x898a('0x41')]=_[_0x898a('0x49')](db[_0x898a('0xdc')]['rawAttributes']);_0x405be4[_0x898a('0x4a')]=_['keys'](_0x545403[_0x898a('0x4a')]);_0x405be4[_0x898a('0x53')]=_[_0x898a('0x4b')](_0x405be4[_0x898a('0x41')],_0x405be4[_0x898a('0x4a')]);_0x1e4625[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x405be4['model'],qs[_0x898a('0x4d')](_0x545403[_0x898a('0x4a')][_0x898a('0x4d')]));_0x1e4625[_0x898a('0x4c')]=_0x1e4625[_0x898a('0x4c')][_0x898a('0x4e')]?_0x1e4625[_0x898a('0x4c')]:_0x405be4[_0x898a('0x41')];if(!_0x545403['query'][_0x898a('0x72')]('nolimit')){_0x1e4625['limit']=qs['limit'](_0x545403[_0x898a('0x4a')][_0x898a('0x24')]);_0x1e4625[_0x898a('0x27')]=qs[_0x898a('0x27')](_0x545403[_0x898a('0x4a')][_0x898a('0x27')]);}_0x1e4625[_0x898a('0x50')]=qs[_0x898a('0x51')](_0x545403['query'][_0x898a('0x51')]);_0x1e4625[_0x898a('0x52')]=qs['filters'](_[_0x898a('0x54')](_0x545403[_0x898a('0x4a')],_0x405be4['filters']));_0x1e4625[_0x898a('0x52')]['ChatWebsiteId']=_0x521d01['id'];if(_0x545403[_0x898a('0x4a')][_0x898a('0x55')]){_0x1e4625[_0x898a('0x52')]=_[_0x898a('0x56')](_0x1e4625['where'],{'$or':_[_0x898a('0x45')](_0x1e4625[_0x898a('0x4c')],function(_0x525d61){var _0x844e5e={};_0x844e5e[_0x525d61]={'$like':'%'+_0x545403[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x844e5e;})});}_0x1e4625=_[_0x898a('0x56')]({},_0x1e4625,_0x545403[_0x898a('0x57')]);return db[_0x898a('0xdc')][_0x898a('0x26')]({'where':_0x1e4625[_0x898a('0x52')]})[_0x898a('0x2e')](function(_0x10be38){_0x1b1e9a[_0x898a('0x26')]=_0x10be38;if(_0x545403[_0x898a('0x4a')][_0x898a('0x5e')]){_0x1e4625['include']=[{'all':!![]}];}else{_0x1e4625[_0x898a('0x58')]=[{'model':db[_0x898a('0x9d')],'as':_0x898a('0xf9'),'required':![]},{'model':db['Attachment'],'as':_0x898a('0x121'),'required':![]}];}return db[_0x898a('0xdc')][_0x898a('0x59')](_0x1e4625);})['then'](function(_0x199be5){_0x1b1e9a[_0x898a('0x5a')]=_0x199be5;return _0x1b1e9a;});}})['then'](respondWithFilteredResult(_0x546610,_0x1e4625))[_0x898a('0x20')](handleError(_0x546610,null));};exports[_0x898a('0x122')]=function(_0x13d875,_0x448fd7){return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x13d875['params']['id']}})['then'](handleEntityNotFound(_0x448fd7,null))['then'](function(_0x85aa2d){if(_0x85aa2d){return _0x85aa2d['addAgents'](_0x13d875[_0x898a('0x61')]['ids'],_[_0x898a('0xf7')](_0x13d875[_0x898a('0x61')],[_0x898a('0x74'),'id'])||{})['spread'](function(_0x3d092e){for(var _0x4f4e79=0x0;_0x4f4e79<_0x13d875['body']['ids'][_0x898a('0x4e')];_0x4f4e79+=0x1){socket['emit'](_0x898a('0x123'),{'UserId':Number(_0x13d875[_0x898a('0x61')][_0x898a('0x74')][_0x4f4e79]),'ChatWebsiteId':Number(_0x13d875[_0x898a('0x5b')]['id'])});}return _0x3d092e;});}})[_0x898a('0x2e')](respondWithResult(_0x448fd7,null))['catch'](handleError(_0x448fd7,null));};exports[_0x898a('0x124')]=function(_0x27e060,_0x2eff5c){return db[_0x898a('0x46')][_0x898a('0x5f')]({'where':{'id':_0x27e060[_0x898a('0x5b')]['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x2eff5c,null))[_0x898a('0x2e')](function(_0x31e8fa){if(_0x31e8fa){return _0x31e8fa['removeAgents'](_0x27e060[_0x898a('0x4a')][_0x898a('0x74')])['then'](function(){if(_[_0x898a('0x125')](_0x27e060[_0x898a('0x4a')][_0x898a('0x74')])){for(var _0x224868=0x0;_0x224868<_0x27e060[_0x898a('0x4a')][_0x898a('0x74')]['length'];_0x224868+=0x1){socket[_0x898a('0x126')](_0x898a('0x127'),{'UserId':Number(_0x27e060['query'][_0x898a('0x74')][_0x224868]),'ChatWebsiteId':Number(_0x27e060[_0x898a('0x5b')]['id'])});}}else{socket[_0x898a('0x126')](_0x898a('0x127'),{'UserId':Number(_0x27e060[_0x898a('0x4a')][_0x898a('0x74')]),'ChatWebsiteId':Number(_0x27e060['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2eff5c,null))[_0x898a('0x20')](handleError(_0x2eff5c,null));};exports[_0x898a('0x128')]=function(_0x227787,_0x3acb2f){var _0x35737f={};var _0x21c989={};var _0x1c02c5;var _0x1e93fa;return db[_0x898a('0x46')]['findOne']({'where':{'id':_0x227787['params']['id']}})[_0x898a('0x2e')](handleEntityNotFound(_0x3acb2f,null))[_0x898a('0x2e')](function(_0x255766){if(_0x255766){_0x1c02c5=_0x255766;_0x21c989[_0x898a('0x41')]=_[_0x898a('0x49')](db[_0x898a('0xc1')][_0x898a('0x5d')]);_0x21c989[_0x898a('0x4a')]=_[_0x898a('0x49')](_0x227787[_0x898a('0x4a')]);_0x21c989['filters']=_['intersection'](_0x21c989[_0x898a('0x41')],_0x21c989['query']);_0x35737f[_0x898a('0x4c')]=_[_0x898a('0x4b')](_0x21c989[_0x898a('0x41')],qs[_0x898a('0x4d')](_0x227787['query'][_0x898a('0x4d')]));_0x35737f[_0x898a('0x4c')]=_0x35737f[_0x898a('0x4c')]['length']?_0x35737f[_0x898a('0x4c')]:_0x21c989[_0x898a('0x41')];_0x35737f['order']=qs[_0x898a('0x51')](_0x227787[_0x898a('0x4a')][_0x898a('0x51')]);_0x35737f[_0x898a('0x52')]=qs[_0x898a('0x53')](_['pick'](_0x227787[_0x898a('0x4a')],_0x21c989['filters']));if(_0x227787['query']['filter']){_0x35737f[_0x898a('0x52')]=_[_0x898a('0x56')](_0x35737f[_0x898a('0x52')],{'$or':_[_0x898a('0x45')](_0x35737f[_0x898a('0x4c')],function(_0x3c57ac){var _0x54d0b2={};_0x54d0b2[_0x3c57ac]={'$like':'%'+_0x227787[_0x898a('0x4a')][_0x898a('0x55')]+'%'};return _0x54d0b2;})});}_0x35737f=_[_0x898a('0x56')]({},_0x35737f,_0x227787[_0x898a('0x57')]);return _0x1c02c5['getAgents'](_0x35737f);}})[_0x898a('0x2e')](function(_0x413331){if(_0x413331){_0x1e93fa=_0x413331[_0x898a('0x4e')];if(!_0x227787[_0x898a('0x4a')][_0x898a('0x72')](_0x898a('0x4f'))){_0x35737f[_0x898a('0x24')]=qs[_0x898a('0x24')](_0x227787['query'][_0x898a('0x24')]);_0x35737f[_0x898a('0x27')]=qs['offset'](_0x227787[_0x898a('0x4a')][_0x898a('0x27')]);}return _0x1c02c5[_0x898a('0x128')](_0x35737f);}})[_0x898a('0x2e')](function(_0x183ff5){if(_0x183ff5){return _0x183ff5?{'count':_0x1e93fa,'rows':_0x183ff5}:null;}})[_0x898a('0x2e')](respondWithResult(_0x3acb2f,null))[_0x898a('0x20')](handleError(_0x3acb2f,null));};
\ No newline at end of file
+var _0x8ef6=['model','vendor','type','index','Pause','ChatWebsite','rawAttributes','fieldName','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','mandatoryDispositionPause','include','options','find','create','body','split','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','role','get','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','address','forEach','testWildcardValidity','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','agentAvatar','addCustomerAvatar','customerAvatar','filename','systemAvatar','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','Interval','timezone','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','referer','CmContact','describe','createdAt','updatedAt','includes','ListId','from','CmList','List','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','orderBy','priority','asc','list','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','applications','close','unmanaged','ChatMessage','AttachmentId','User','UserId','unshift','agent','forcedOwnership','queueId','queue','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','EventManager','ValidationError','CompanyId','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','subjectOffline','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','fullname','internal','Tag','color','tag','getSnippet','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','ifTime','server/files/chat/iframe.ejs','utf8','3.13.0','origin','http://localhost:9000','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','labelText','color_button','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../errors/api','APIBadRequestError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','ChatWebsites','stack','name','status','send','setUA','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device'];(function(_0x493552,_0x2cd527){var _0x243ea8=function(_0x531f6e){while(--_0x531f6e){_0x493552['push'](_0x493552['shift']());}};_0x243ea8(++_0x2cd527);}(_0x8ef6,0xf2));var _0x68ef=function(_0x50c8dd,_0x21cbfe){_0x50c8dd=_0x50c8dd-0x0;var _0x50e4c5=_0x8ef6[_0x50c8dd];return _0x50e4c5;};'use strict';var Mustache=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var ejs=require(_0x68ef('0x3'));var fs=require('fs');var fs_extra=require(_0x68ef('0x4'));var _=require(_0x68ef('0x5'));var querystring=require(_0x68ef('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0x68ef('0x7'));var jayson=require(_0x68ef('0x8'));var qs=require(_0x68ef('0x9'));var logger=require(_0x68ef('0xa'))('api');var config=require('../../config/environment');var APIBadRequestError=require(_0x68ef('0xb'))[_0x68ef('0xc')];var APINotFoundError=require(_0x68ef('0xb'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x68ef('0xb'))[_0x68ef('0xd')];var APIHandleError=require(_0x68ef('0xb'))[_0x68ef('0xe')];var APIConflictError=require(_0x68ef('0xb'))[_0x68ef('0xf')];var wildcardUtils=require(_0x68ef('0x10'));var URL=require(_0x68ef('0x11'))[_0x68ef('0x12')];var db=require(_0x68ef('0x13'))['db'];config[_0x68ef('0x14')]=_[_0x68ef('0x15')](config['redis'],{'host':_0x68ef('0x16'),'port':0x18eb});var socket=require(_0x68ef('0x17'))(new Redis(config[_0x68ef('0x14')]));require(_0x68ef('0x18'))[_0x68ef('0x19')](socket);var client=jayson[_0x68ef('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x68ef('0x1a')][_0x68ef('0x1b')]({'port':0x232a});var client9003=jayson[_0x68ef('0x1a')]['http']({'port':0x232b});var client9001=jayson[_0x68ef('0x1a')][_0x68ef('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x24682d,_0x5005ba,_0x35493d,_0x37c4cc){return new Promise(function(_0x3d1e90,_0x3780a4){var _0x5c4456=_0x37c4cc||client;return _0x5c4456[_0x68ef('0x1c')](_0x24682d,_0x35493d)['then'](function(_0x5cbb78){logger[_0x68ef('0x1d')](_0x68ef('0x1e'),_0x5005ba,'request\x20sent');logger['debug'](_0x68ef('0x1f'),_0x5005ba,_0x68ef('0x20'),JSON[_0x68ef('0x21')](_0x5cbb78));if(_0x5cbb78['error']){if(_0x5cbb78[_0x68ef('0x22')][_0x68ef('0x23')]===0x1f4){logger[_0x68ef('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x5005ba,_0x5cbb78[_0x68ef('0x22')][_0x68ef('0x24')]);return _0x3780a4(_0x5cbb78['error'][_0x68ef('0x24')]);}logger[_0x68ef('0x22')](_0x68ef('0x1e'),_0x5005ba,_0x5cbb78['error']['message']);return _0x3d1e90(_0x5cbb78['error'][_0x68ef('0x24')]);}else{logger[_0x68ef('0x1d')](_0x68ef('0x1e'),_0x5005ba,_0x68ef('0x20'));_0x3d1e90(_0x5cbb78[_0x68ef('0x25')][_0x68ef('0x24')]);}})[_0x68ef('0x26')](function(_0x49374f){logger[_0x68ef('0x22')](_0x68ef('0x1e'),_0x5005ba,_0x49374f);_0x3780a4(_0x49374f);});});}function respondWithStatusCode(_0x5e4dbe,_0x178460){_0x178460=_0x178460||0xcc;return function(_0x57f9ee){if(_0x57f9ee){return _0x5e4dbe['sendStatus'](_0x178460);}return _0x5e4dbe['status'](_0x178460)[_0x68ef('0x27')]();};}function respondWithResult(_0x268f32,_0x123041){_0x123041=_0x123041||0xc8;return function(_0x29518e){if(_0x29518e){return _0x268f32['status'](_0x123041)['json'](_0x29518e);}};}function respondWithFilteredResult(_0x1cbe4f,_0x28907a){return function(_0x7bf96){if(_0x7bf96){var _0x263b30=typeof _0x28907a[_0x68ef('0x28')]===_0x68ef('0x29')&&typeof _0x28907a[_0x68ef('0x2a')]===_0x68ef('0x29');var _0x5a6dfd=_0x7bf96[_0x68ef('0x2b')];var _0x4314bd=_0x263b30?0x0:_0x28907a[_0x68ef('0x28')];var _0x4c25aa=_0x263b30?_0x7bf96[_0x68ef('0x2b')]:_0x28907a['offset']+_0x28907a[_0x68ef('0x2a')];var _0x17588a;if(_0x4c25aa>=_0x5a6dfd){_0x4c25aa=_0x5a6dfd;_0x17588a=0xc8;}else{_0x17588a=0xce;}_0x1cbe4f['status'](_0x17588a);return _0x1cbe4f['set'](_0x68ef('0x2c'),_0x4314bd+'-'+_0x4c25aa+'/'+_0x5a6dfd)[_0x68ef('0x2d')](_0x7bf96);}return null;};}function saveUpdates(_0x4b8fc8){return function(_0xf58fa1){if(_0xf58fa1){return _0xf58fa1[_0x68ef('0x2e')](_0x4b8fc8)[_0x68ef('0x2f')](function(_0x2d1e9f){return _0x2d1e9f;});}return null;};}function removeEntity(_0x59e9fb){return function(_0x2c8bd0){if(_0x2c8bd0){return _0x2c8bd0[_0x68ef('0x30')]()['then'](function(){var _0x2f8de2=_0x2c8bd0['get']({'plain':!![]});var _0x14581d=_0x68ef('0x31');return db['UserProfileResource'][_0x68ef('0x30')]({'where':{'type':_0x14581d,'resourceId':_0x2f8de2['id']}})['then'](function(){return _0x2c8bd0;});})[_0x68ef('0x2f')](function(){_0x59e9fb['status'](0xcc)[_0x68ef('0x27')]();});}};}function handleEntityNotFound(_0x1444e0){return function(_0x798276){if(!_0x798276){_0x1444e0['sendStatus'](0x194);}return _0x798276;};}function handleError(_0x1f91c7,_0x485dc3){_0x485dc3=_0x485dc3||0x1f4;return function(_0x476938){logger['error'](_0x476938[_0x68ef('0x32')]);if(_0x476938[_0x68ef('0x33')]){delete _0x476938[_0x68ef('0x33')];}_0x1f91c7[_0x68ef('0x34')](_0x485dc3)[_0x68ef('0x35')](_0x476938);};}function createInteractionObject(_0xefd1d,_0x51ba3d,_0x294fba,_0x15a6ab){var _0x32074a=require('user-agent-parser');var _0x32eddd=new _0x32074a();var _0x3c5de6=_0x32eddd[_0x68ef('0x36')](_0x294fba['user-agent'])['getResult']();var _0x14f0fc=_0x51ba3d[_0x68ef('0x37')];if(_0x294fba[_0x68ef('0x38')]){_0x14f0fc=_0x294fba[_0x68ef('0x38')];}else if(_0x294fba[_0x68ef('0x39')]){_0x14f0fc=_[_0x68ef('0x3a')](_0x294fba[_0x68ef('0x39')]['split'](','));}return{'ContactId':_0x15a6ab['id'],'ChatWebsiteId':_0xefd1d,'from':(_0x15a6ab[_0x68ef('0x3b')]||'')+'\x20'+(_0x15a6ab[_0x68ef('0x3c')]||''),'customerIp':_0x14f0fc,'customerPort':_0x294fba[_0x68ef('0x3d')]?_0x294fba[_0x68ef('0x3d')]:null,'referer':_0x51ba3d['referer'],'browserName':_0x3c5de6[_0x68ef('0x3e')][_0x68ef('0x33')]&&_0x3c5de6[_0x68ef('0x3e')][_0x68ef('0x3f')]?util[_0x68ef('0x40')](_0x68ef('0x41'),_0x3c5de6['browser'][_0x68ef('0x33')],_0x3c5de6[_0x68ef('0x3e')][_0x68ef('0x3f')]):_0x68ef('0x42'),'browserVersion':_0x3c5de6[_0x68ef('0x3e')][_0x68ef('0x3f')]||_0x68ef('0x42'),'osName':util[_0x68ef('0x40')](_0x68ef('0x41'),_0x3c5de6['os']['name'],_0x3c5de6['os'][_0x68ef('0x3f')]),'osVersion':_0x3c5de6['os'][_0x68ef('0x3f')],'deviceModel':_0x3c5de6[_0x68ef('0x43')][_0x68ef('0x44')]&&_0x3c5de6[_0x68ef('0x43')][_0x68ef('0x45')]?util[_0x68ef('0x40')]('%s\x20%s\x20%s',_0x3c5de6[_0x68ef('0x43')]['model'],_0x3c5de6[_0x68ef('0x43')][_0x68ef('0x45')],_0x3c5de6[_0x68ef('0x43')][_0x68ef('0x46')]):null,'deviceVendor':_0x3c5de6['device'][_0x68ef('0x45')],'deviceType':_0x3c5de6['device'][_0x68ef('0x46')],'formData':JSON['stringify'](_0x51ba3d)};}exports[_0x68ef('0x47')]=function(_0xa2358b,_0x105e8c){var _0x5c4a66={'include':[{'model':db[_0x68ef('0x48')],'as':'mandatoryDispositionPause'}]},_0x59b148={},_0x4044d5={'count':0x0,'rows':[]};var _0x589688=_['map'](db[_0x68ef('0x49')][_0x68ef('0x4a')],function(_0x173fb7){return{'name':_0x173fb7[_0x68ef('0x4b')],'type':_0x173fb7[_0x68ef('0x46')]['key']};});_0x59b148['model']=_[_0x68ef('0x4c')](_0x589688,_0x68ef('0x33'));_0x59b148[_0x68ef('0x4d')]=_[_0x68ef('0x4e')](_0xa2358b['query']);_0x59b148[_0x68ef('0x4f')]=_[_0x68ef('0x50')](_0x59b148[_0x68ef('0x44')],_0x59b148[_0x68ef('0x4d')]);_0x5c4a66['attributes']=_['intersection'](_0x59b148[_0x68ef('0x44')],qs[_0x68ef('0x51')](_0xa2358b['query'][_0x68ef('0x51')]));_0x5c4a66[_0x68ef('0x52')]=_0x5c4a66[_0x68ef('0x52')][_0x68ef('0x53')]?_0x5c4a66[_0x68ef('0x52')]:_0x59b148['model'];if(!_0xa2358b[_0x68ef('0x4d')][_0x68ef('0x54')](_0x68ef('0x55'))){_0x5c4a66['limit']=qs[_0x68ef('0x2a')](_0xa2358b[_0x68ef('0x4d')][_0x68ef('0x2a')]);_0x5c4a66['offset']=qs[_0x68ef('0x28')](_0xa2358b['query']['offset']);}_0x5c4a66[_0x68ef('0x56')]=qs['sort'](_0xa2358b[_0x68ef('0x4d')][_0x68ef('0x57')]);_0x5c4a66[_0x68ef('0x58')]=qs[_0x68ef('0x4f')](_[_0x68ef('0x59')](_0xa2358b[_0x68ef('0x4d')],_0x59b148[_0x68ef('0x4f')]),_0x589688);if(_0xa2358b[_0x68ef('0x4d')][_0x68ef('0x5a')]){_0x5c4a66[_0x68ef('0x58')]=_['merge'](_0x5c4a66['where'],{'$or':_[_0x68ef('0x4c')](_0x589688,function(_0x27a449){if(_0x27a449[_0x68ef('0x46')]!==_0x68ef('0x5b')){var _0x82df12={};_0x82df12[_0x27a449[_0x68ef('0x33')]]={'$like':'%'+_0xa2358b[_0x68ef('0x4d')][_0x68ef('0x5a')]+'%'};return _0x82df12;}})});}_0x5c4a66=_[_0x68ef('0x5c')]({},_0x5c4a66,_0xa2358b['options']);var _0x5685bb={'where':_0x5c4a66[_0x68ef('0x58')]};return db['ChatWebsite'][_0x68ef('0x2b')](_0x5685bb)['then'](function(_0x1b2436){_0x4044d5[_0x68ef('0x2b')]=_0x1b2436;if(_0xa2358b['query'][_0x68ef('0x5d')]){_0x5c4a66['include']=[{'all':!![]}];}return db[_0x68ef('0x49')][_0x68ef('0x5e')](_0x5c4a66);})[_0x68ef('0x2f')](function(_0x304434){_0x4044d5[_0x68ef('0x5f')]=_0x304434;return _0x4044d5;})[_0x68ef('0x2f')](respondWithFilteredResult(_0x105e8c,_0x5c4a66))['catch'](handleError(_0x105e8c,null));};exports[_0x68ef('0x60')]=function(_0x1f770f,_0x3cfd89){var _0x20dc7f={'raw':![],'where':{'id':_0x1f770f[_0x68ef('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0x68ef('0x62')}]},_0x4107d3={};_0x4107d3[_0x68ef('0x44')]=_['keys'](db[_0x68ef('0x49')][_0x68ef('0x4a')]);_0x4107d3[_0x68ef('0x4d')]=_['keys'](_0x1f770f[_0x68ef('0x4d')]);_0x4107d3['filters']=_['intersection'](_0x4107d3[_0x68ef('0x44')],_0x4107d3['query']);_0x20dc7f[_0x68ef('0x52')]=_['intersection'](_0x4107d3[_0x68ef('0x44')],qs[_0x68ef('0x51')](_0x1f770f[_0x68ef('0x4d')][_0x68ef('0x51')]));_0x20dc7f[_0x68ef('0x52')]=_0x20dc7f[_0x68ef('0x52')]['length']?_0x20dc7f[_0x68ef('0x52')]:_0x4107d3['model'];if(_0x1f770f[_0x68ef('0x4d')]['includeAll']){_0x20dc7f[_0x68ef('0x63')]=[{'all':!![]}];}_0x20dc7f=_[_0x68ef('0x5c')]({},_0x20dc7f,_0x1f770f[_0x68ef('0x64')]);return db[_0x68ef('0x49')][_0x68ef('0x65')](_0x20dc7f)[_0x68ef('0x2f')](handleEntityNotFound(_0x3cfd89,null))[_0x68ef('0x2f')](respondWithResult(_0x3cfd89,null))['catch'](handleError(_0x3cfd89,null));};exports[_0x68ef('0x66')]=function(_0x11bab3,_0x43eba8){var _0x450f98=null;_0x11bab3[_0x68ef('0x67')]['address'][_0x68ef('0x68')](',')['forEach'](_0x1ed172=>{if(_0x1ed172['trim']()!==''&&!wildcardUtils['testWildcardValidity'](_0x1ed172[_0x68ef('0x69')]())){_0x450f98=new APIBadRequestError('\x22'+_0x1ed172[_0x68ef('0x69')]()+_0x68ef('0x6a'));}});if(_0x450f98){return handleError(_0x43eba8,null)(_0x450f98);}return db[_0x68ef('0x49')]['create'](_0x11bab3[_0x68ef('0x67')],{})['then'](function(_0x2460d8){var _0x2d916e=_0x11bab3[_0x68ef('0x6b')]['get']({'plain':!![]});if(!_0x2d916e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d916e[_0x68ef('0x6c')]===_0x68ef('0x6b')){var _0x24d7f7=_0x2460d8[_0x68ef('0x6d')]({'plain':!![]});var _0x5b41e1=_0x68ef('0x31');return db[_0x68ef('0x6e')][_0x68ef('0x65')]({'where':{'name':_0x5b41e1,'userProfileId':_0x2d916e[_0x68ef('0x6f')]},'raw':!![]})['then'](function(_0x3f56a7){if(_0x3f56a7&&_0x3f56a7['autoAssociation']===0x0){return db[_0x68ef('0x70')][_0x68ef('0x66')]({'name':_0x24d7f7[_0x68ef('0x33')],'resourceId':_0x24d7f7['id'],'type':_0x3f56a7[_0x68ef('0x33')],'sectionId':_0x3f56a7['id']},{})[_0x68ef('0x2f')](function(){return _0x2460d8;});}else{return _0x2460d8;}})['catch'](function(_0x24285){logger[_0x68ef('0x22')](_0x68ef('0x71'),_0x24285);throw _0x24285;});}return _0x2460d8;})['then'](respondWithResult(_0x43eba8,0xc9))[_0x68ef('0x26')](handleError(_0x43eba8,null));};exports['update']=function(_0x69b1c,_0x535f65){var _0x4c70c0=null;_0x69b1c[_0x68ef('0x67')][_0x68ef('0x72')][_0x68ef('0x68')](',')[_0x68ef('0x73')](_0x501004=>{if(_0x501004[_0x68ef('0x69')]()!==''&&!wildcardUtils[_0x68ef('0x74')](_0x501004[_0x68ef('0x69')]())){_0x4c70c0=new APIBadRequestError('\x22'+_0x501004['trim']()+_0x68ef('0x6a'));}});if(_0x4c70c0){return handleError(_0x535f65,null)(_0x4c70c0);}if(_0x69b1c[_0x68ef('0x67')]['id']){delete _0x69b1c[_0x68ef('0x67')]['id'];}return db[_0x68ef('0x49')][_0x68ef('0x65')]({'where':{'id':_0x69b1c[_0x68ef('0x61')]['id']},'include':[{'model':db[_0x68ef('0x48')],'as':_0x68ef('0x62')}]})[_0x68ef('0x2f')](handleEntityNotFound(_0x535f65,null))[_0x68ef('0x2f')](saveUpdates(_0x69b1c[_0x68ef('0x67')],null))[_0x68ef('0x2f')](respondWithResult(_0x535f65,null))['catch'](handleError(_0x535f65,null));};exports[_0x68ef('0x30')]=function(_0x391a81,_0x5db443){return db['ChatWebsite'][_0x68ef('0x65')]({'where':{'id':_0x391a81['params']['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x5db443,null))[_0x68ef('0x2f')](removeEntity(_0x5db443,null))['catch'](handleError(_0x5db443,null));};exports['describe']=function(_0x31a336,_0x5c500c){return db[_0x68ef('0x49')]['describe']()[_0x68ef('0x2f')](respondWithResult(_0x5c500c,null))['catch'](handleError(_0x5c500c,null));};exports[_0x68ef('0x75')]=function(_0x428c13,_0x57e811){if(_0x428c13[_0x68ef('0x67')]['id']){delete _0x428c13[_0x68ef('0x67')]['id'];}return db[_0x68ef('0x49')][_0x68ef('0x65')]({'where':{'id':_0x428c13['params']['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x57e811,null))[_0x68ef('0x2f')](function(_0x5b2e89){if(_0x5b2e89){_0x428c13[_0x68ef('0x67')][_0x68ef('0x76')]=_0x5b2e89['id'];return db[_0x68ef('0x77')]['create'](_0x428c13[_0x68ef('0x67')]);}})['then'](respondWithResult(_0x57e811,null))[_0x68ef('0x26')](handleError(_0x57e811,null));};exports[_0x68ef('0x78')]=function(_0x4f1a65,_0x4b0fb4){var _0x51101a={'raw':![],'where':{}};var _0x564ef7={};var _0x4370b1={'count':0x0,'rows':[]};return db[_0x68ef('0x49')][_0x68ef('0x79')]({'where':{'id':_0x4f1a65[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x4b0fb4,null))[_0x68ef('0x2f')](function(_0x842cfe){if(_0x842cfe){_0x564ef7[_0x68ef('0x44')]=_[_0x68ef('0x4e')](db[_0x68ef('0x77')][_0x68ef('0x4a')]);_0x564ef7[_0x68ef('0x4d')]=_[_0x68ef('0x4e')](_0x4f1a65['query']);_0x564ef7[_0x68ef('0x4f')]=_['intersection'](_0x564ef7[_0x68ef('0x44')],_0x564ef7['query']);_0x51101a['attributes']=_[_0x68ef('0x50')](_0x564ef7[_0x68ef('0x44')],qs[_0x68ef('0x51')](_0x4f1a65[_0x68ef('0x4d')]['fields']));_0x51101a['attributes']=_0x51101a[_0x68ef('0x52')][_0x68ef('0x53')]?_0x51101a[_0x68ef('0x52')]:_0x564ef7['model'];if(!_0x4f1a65[_0x68ef('0x4d')][_0x68ef('0x54')](_0x68ef('0x55'))){_0x51101a[_0x68ef('0x2a')]=qs['limit'](_0x4f1a65[_0x68ef('0x4d')][_0x68ef('0x2a')]);_0x51101a[_0x68ef('0x28')]=qs[_0x68ef('0x28')](_0x4f1a65[_0x68ef('0x4d')][_0x68ef('0x28')]);}_0x51101a['order']=qs[_0x68ef('0x57')](_0x4f1a65['query'][_0x68ef('0x57')]);_0x51101a[_0x68ef('0x58')]=qs[_0x68ef('0x4f')](_[_0x68ef('0x59')](_0x4f1a65['query'],_0x564ef7[_0x68ef('0x4f')]));_0x51101a['where'][_0x68ef('0x76')]=_0x842cfe['id'];if(_0x4f1a65[_0x68ef('0x4d')]['filter']){_0x51101a['where']=_[_0x68ef('0x5c')](_0x51101a['where'],{'$or':_[_0x68ef('0x4c')](_0x51101a['attributes'],function(_0x34d825){var _0x3eafd2={};_0x3eafd2[_0x34d825]={'$like':'%'+_0x4f1a65[_0x68ef('0x4d')][_0x68ef('0x5a')]+'%'};return _0x3eafd2;})});}_0x51101a=_[_0x68ef('0x5c')]({},_0x51101a,_0x4f1a65[_0x68ef('0x64')]);return db['Disposition'][_0x68ef('0x2b')]({'where':_0x51101a[_0x68ef('0x58')]})[_0x68ef('0x2f')](function(_0x380437){_0x4370b1[_0x68ef('0x2b')]=_0x380437;if(_0x4f1a65[_0x68ef('0x4d')][_0x68ef('0x5d')]){_0x51101a['include']=[{'all':!![]}];}return db[_0x68ef('0x77')][_0x68ef('0x5e')](_0x51101a);})[_0x68ef('0x2f')](function(_0x2e20aa){_0x4370b1[_0x68ef('0x5f')]=_0x2e20aa;return _0x4370b1;});}})[_0x68ef('0x2f')](respondWithFilteredResult(_0x4b0fb4,_0x51101a))[_0x68ef('0x26')](handleError(_0x4b0fb4,null));};exports[_0x68ef('0x7a')]=function(_0x1bcbbb,_0x580fe0){return db[_0x68ef('0x49')]['find']({'where':{'id':_0x1bcbbb['params']['id']}})['then'](handleEntityNotFound(_0x580fe0,null))[_0x68ef('0x2f')](function(_0x2ef857){if(_0x2ef857){return _0x2ef857[_0x68ef('0x7a')](_0x1bcbbb['query']['ids']);}})['then'](respondWithStatusCode(_0x580fe0,null))[_0x68ef('0x26')](handleError(_0x580fe0,null));};exports[_0x68ef('0x7b')]=function(_0x239d05,_0x40996e){if(_0x239d05[_0x68ef('0x67')]['id']){delete _0x239d05[_0x68ef('0x67')]['id'];}return db['ChatWebsite'][_0x68ef('0x65')]({'where':{'id':_0x239d05[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x40996e,null))[_0x68ef('0x2f')](function(_0x598c45){if(_0x598c45){_0x239d05[_0x68ef('0x67')][_0x68ef('0x76')]=_0x598c45['id'];return db[_0x68ef('0x7c')][_0x68ef('0x66')](_0x239d05[_0x68ef('0x67')]);}})[_0x68ef('0x2f')](respondWithResult(_0x40996e,null))[_0x68ef('0x26')](handleError(_0x40996e,null));};exports[_0x68ef('0x7d')]=function(_0x4cdc78,_0x16dbaf){var _0x210ba6={'raw':![],'where':{}};var _0x4d54df={};var _0xdaed94={'count':0x0,'rows':[]};return db[_0x68ef('0x49')][_0x68ef('0x79')]({'where':{'id':_0x4cdc78[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x16dbaf,null))[_0x68ef('0x2f')](function(_0x189909){if(_0x189909){_0x4d54df[_0x68ef('0x44')]=_[_0x68ef('0x4e')](db[_0x68ef('0x7c')][_0x68ef('0x4a')]);_0x4d54df[_0x68ef('0x4d')]=_[_0x68ef('0x4e')](_0x4cdc78[_0x68ef('0x4d')]);_0x4d54df[_0x68ef('0x4f')]=_[_0x68ef('0x50')](_0x4d54df[_0x68ef('0x44')],_0x4d54df[_0x68ef('0x4d')]);_0x210ba6['attributes']=_[_0x68ef('0x50')](_0x4d54df[_0x68ef('0x44')],qs[_0x68ef('0x51')](_0x4cdc78[_0x68ef('0x4d')][_0x68ef('0x51')]));_0x210ba6['attributes']=_0x210ba6[_0x68ef('0x52')][_0x68ef('0x53')]?_0x210ba6['attributes']:_0x4d54df[_0x68ef('0x44')];if(!_0x4cdc78['query']['hasOwnProperty']('nolimit')){_0x210ba6['limit']=qs[_0x68ef('0x2a')](_0x4cdc78['query'][_0x68ef('0x2a')]);_0x210ba6['offset']=qs['offset'](_0x4cdc78['query'][_0x68ef('0x28')]);}_0x210ba6[_0x68ef('0x56')]=qs[_0x68ef('0x57')](_0x4cdc78[_0x68ef('0x4d')][_0x68ef('0x57')]);_0x210ba6['where']=qs[_0x68ef('0x4f')](_[_0x68ef('0x59')](_0x4cdc78[_0x68ef('0x4d')],_0x4d54df[_0x68ef('0x4f')]));_0x210ba6['where'][_0x68ef('0x76')]=_0x189909['id'];if(_0x4cdc78['query']['filter']){_0x210ba6['where']=_[_0x68ef('0x5c')](_0x210ba6[_0x68ef('0x58')],{'$or':_[_0x68ef('0x4c')](_0x210ba6[_0x68ef('0x52')],function(_0x38bad5){var _0x167812={};_0x167812[_0x38bad5]={'$like':'%'+_0x4cdc78[_0x68ef('0x4d')][_0x68ef('0x5a')]+'%'};return _0x167812;})});}_0x210ba6=_[_0x68ef('0x5c')]({},_0x210ba6,_0x4cdc78[_0x68ef('0x64')]);return db[_0x68ef('0x7c')][_0x68ef('0x2b')]({'where':_0x210ba6['where']})['then'](function(_0x481bec){_0xdaed94[_0x68ef('0x2b')]=_0x481bec;if(_0x4cdc78[_0x68ef('0x4d')][_0x68ef('0x5d')]){_0x210ba6['include']=[{'all':!![]}];}return db[_0x68ef('0x7c')]['findAll'](_0x210ba6);})[_0x68ef('0x2f')](function(_0xc07b77){_0xdaed94[_0x68ef('0x5f')]=_0xc07b77;return _0xdaed94;});}})['then'](respondWithFilteredResult(_0x16dbaf,_0x210ba6))[_0x68ef('0x26')](handleError(_0x16dbaf,null));};exports[_0x68ef('0x7e')]=function(_0x546b0d,_0x3f0d93){return db[_0x68ef('0x49')][_0x68ef('0x65')]({'where':{'id':_0x546b0d[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x3f0d93,null))[_0x68ef('0x2f')](function(_0x4381ee){if(_0x4381ee){return _0x4381ee['removeAnswers'](_0x546b0d[_0x68ef('0x4d')][_0x68ef('0x7f')]);}})[_0x68ef('0x2f')](respondWithStatusCode(_0x3f0d93,null))[_0x68ef('0x26')](handleError(_0x3f0d93,null));};exports[_0x68ef('0x80')]=function(_0x46c87e,_0x20a131){_0x46c87e[_0x68ef('0x67')][_0x68ef('0x81')]=_0x46c87e[_0x68ef('0x82')]['filename'];return db['ChatWebsite'][_0x68ef('0x65')]({'where':{'id':_0x46c87e['params']['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x20a131,null))[_0x68ef('0x2f')](saveUpdates(_0x46c87e[_0x68ef('0x67')],null))[_0x68ef('0x2f')](respondWithResult(_0x20a131,null))[_0x68ef('0x26')](handleError(_0x20a131,null));};exports['addAvatar']=function(_0x80fa59,_0x1c3449){_0x80fa59[_0x68ef('0x67')][_0x68ef('0x83')]=_0x80fa59['file']['filename'];return db[_0x68ef('0x49')][_0x68ef('0x65')]({'where':{'id':_0x80fa59[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x1c3449,null))[_0x68ef('0x2f')](saveUpdates(_0x80fa59[_0x68ef('0x67')],null))[_0x68ef('0x2f')](respondWithResult(_0x1c3449,null))[_0x68ef('0x26')](handleError(_0x1c3449,null));};exports[_0x68ef('0x84')]=function(_0x2a0f59,_0x1d437e){_0x2a0f59['body'][_0x68ef('0x85')]=_0x2a0f59[_0x68ef('0x82')][_0x68ef('0x86')];return db[_0x68ef('0x49')][_0x68ef('0x65')]({'where':{'id':_0x2a0f59[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x1d437e,null))[_0x68ef('0x2f')](saveUpdates(_0x2a0f59[_0x68ef('0x67')],null))[_0x68ef('0x2f')](respondWithResult(_0x1d437e,null))['catch'](handleError(_0x1d437e,null));};exports['addSystemAvatar']=function(_0x34465c,_0x3ddfe0){_0x34465c[_0x68ef('0x67')][_0x68ef('0x87')]=_0x34465c[_0x68ef('0x82')][_0x68ef('0x86')];return db[_0x68ef('0x49')]['find']({'where':{'id':_0x34465c[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x3ddfe0,null))[_0x68ef('0x2f')](saveUpdates(_0x34465c[_0x68ef('0x67')],null))['then'](respondWithResult(_0x3ddfe0,null))[_0x68ef('0x26')](handleError(_0x3ddfe0,null));};exports['getLogo']=function(_0x4704dc,_0x322733){var _0x3d3a70=path['join'](config['root'],_0x68ef('0x88'));var _0x5ed1de={'where':{'id':_0x4704dc[_0x68ef('0x61')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x476202=![];return require(_0x68ef('0x89'))['getLicense']()['then'](function(_0x3604b1){if(_0x3604b1){_0x476202=_0x3604b1[_0x68ef('0x8a')];}})['then'](function(){return db[_0x68ef('0x49')][_0x68ef('0x65')](_0x5ed1de);})[_0x68ef('0x2f')](handleEntityNotFound(_0x322733,null))['then'](function(_0x4d483d){if(_0x4d483d){if(!_[_0x68ef('0x8b')](_0x4d483d['sitepic'])){if(fs[_0x68ef('0x8c')](path[_0x68ef('0x8d')](config[_0x68ef('0x8e')],_0x68ef('0x8f'),_0x4d483d[_0x68ef('0x81')]))&&_0x476202){_0x3d3a70=path[_0x68ef('0x8d')](config['root'],'server/files/images/logos/',_0x4d483d[_0x68ef('0x81')]);}}return _0x322733[_0x68ef('0x90')](_0x3d3a70);}})[_0x68ef('0x26')](handleError(_0x322733,null));};exports[_0x68ef('0x91')]=function(_0x2d97db,_0x4929ee){var _0x3e77b3=path[_0x68ef('0x8d')](config[_0x68ef('0x8e')],_0x68ef('0x92'));var _0x11c872={'where':{'id':_0x2d97db[_0x68ef('0x61')]['id']},'attributes':['id',_0x68ef('0x83')],'raw':!![]};return db[_0x68ef('0x49')]['find'](_0x11c872)[_0x68ef('0x2f')](handleEntityNotFound(_0x4929ee,null))[_0x68ef('0x2f')](function(_0x23317f){if(_0x23317f){if(!_[_0x68ef('0x8b')](_0x23317f[_0x68ef('0x83')])){if(fs[_0x68ef('0x8c')](path['join'](config[_0x68ef('0x8e')],_0x68ef('0x93'),_0x23317f[_0x68ef('0x83')]))){_0x3e77b3=path[_0x68ef('0x8d')](config[_0x68ef('0x8e')],'server/files/images/avatars/',_0x23317f[_0x68ef('0x83')]);}}return _0x4929ee[_0x68ef('0x90')](_0x3e77b3);}})['catch'](handleError(_0x4929ee,null));};exports['getCustomerAvatar']=function(_0x222b76,_0x43cf36){var _0x35999a=path['join'](config['root'],_0x68ef('0x94'));var _0x10a3f9={'where':{'id':_0x222b76[_0x68ef('0x61')]['id']},'attributes':['id',_0x68ef('0x85'),_0x68ef('0x95')],'raw':!![]};return db[_0x68ef('0x49')][_0x68ef('0x65')](_0x10a3f9)[_0x68ef('0x2f')](handleEntityNotFound(_0x43cf36,null))[_0x68ef('0x2f')](function(_0x156d3a){if(_0x156d3a){if(!_[_0x68ef('0x8b')](_0x156d3a[_0x68ef('0x85')])){if(fs[_0x68ef('0x8c')](path[_0x68ef('0x8d')](config['root'],'server/files/images/avatars/',_0x156d3a[_0x68ef('0x85')]))&&_0x156d3a[_0x68ef('0x95')]){_0x35999a=path[_0x68ef('0x8d')](config[_0x68ef('0x8e')],'server/files/images/avatars/',_0x156d3a[_0x68ef('0x85')]);}}return _0x43cf36[_0x68ef('0x90')](_0x35999a);}})['catch'](handleError(_0x43cf36,null));};exports['getSystemAvatar']=function(_0x30b77e,_0x33aae0){var _0xc3617b=path['join'](config[_0x68ef('0x8e')],_0x68ef('0x96'));var _0x3fb16d={'where':{'id':_0x30b77e['params']['id']},'attributes':['id',_0x68ef('0x87')],'raw':!![]};return db['ChatWebsite'][_0x68ef('0x65')](_0x3fb16d)[_0x68ef('0x2f')](handleEntityNotFound(_0x33aae0,null))['then'](function(_0x686e5b){if(_0x686e5b){if(!_[_0x68ef('0x8b')](_0x686e5b[_0x68ef('0x87')])){if(fs[_0x68ef('0x8c')](path[_0x68ef('0x8d')](config[_0x68ef('0x8e')],_0x68ef('0x93'),_0x686e5b[_0x68ef('0x87')]))){_0xc3617b=path[_0x68ef('0x8d')](config['root'],_0x68ef('0x93'),_0x686e5b[_0x68ef('0x87')]);}}return _0x33aae0[_0x68ef('0x90')](_0xc3617b);}})[_0x68ef('0x26')](handleError(_0x33aae0,null));};function checkWebsiteInterval(_0x3e3775){var _0x89d119=_0x3e3775[_0x68ef('0x97')];if(!_0x89d119){return Promise['resolve'](_0x3e3775);}var _0x509593=_0x3e3775[_0x68ef('0x98')]||undefined;return _0x89d119['ifTime'](_0x509593)[_0x68ef('0x2f')](function(_0x158e68){if(!_0x158e68){throw new APIOutOfIntervalError();}return _0x3e3775;});}exports[_0x68ef('0x99')]=function(_0x4762db,_0x52d821){var _0x728df1={'body':_0x4762db[_0x68ef('0x67')],'channel':_0x68ef('0x9a')};var _0x5df9bb=[];var _0xe18083=[];var _0xe82f3a={};var _0x4af131=![];if(_0x4762db[_0x68ef('0x67')]['id']){delete _0x4762db[_0x68ef('0x67')]['id'];}if(_['isNil'](_0x4762db['body']['from'])){throw new APIBadRequestError(_0x68ef('0x9b'));}if(_[_0x68ef('0x8b')](_0x4762db[_0x68ef('0x67')][_0x68ef('0x9c')])){throw new APIBadRequestError(_0x68ef('0x9d'));}if(_[_0x68ef('0x9e')](_0x4762db[_0x68ef('0x67')][_0x68ef('0x67')])){throw new APIBadRequestError(_0x68ef('0x9f'));}var _0x4b393e=_0x4762db[_0x68ef('0x67')][_0x68ef('0x37')]&&_0x4762db['body'][_0x68ef('0xa0')];return db[_0x68ef('0xa1')][_0x68ef('0xa2')]()['then'](function(_0x19e0fe){if(!_0x19e0fe){throw new Error('No\x20available\x20attributes');}_0x5df9bb=Object[_0x68ef('0x4e')](_0x19e0fe)[_0x68ef('0x5a')](function(_0x324f33){return![_0x68ef('0xa3'),_0x68ef('0xa4')][_0x68ef('0xa5')](_0x324f33);});_0xe18083=Object[_0x68ef('0x4e')](_0x19e0fe)[_0x68ef('0x5a')](function(_0x491464){return![_0x68ef('0xa3'),_0x68ef('0xa4'),'CompanyId',_0x68ef('0xa6')][_0x68ef('0xa5')](_0x491464);});if(!_[_0x68ef('0xa5')](_0xe18083,_0x4762db[_0x68ef('0x67')][_0x68ef('0x9c')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0xe18083[_0x68ef('0x8d')](',\x20'));}_0xe82f3a[_0x4762db[_0x68ef('0x67')][_0x68ef('0x9c')]]=_0x4762db[_0x68ef('0x67')][_0x68ef('0xa7')];})['then'](function(){return db[_0x68ef('0x49')]['find']({'where':{'id':_0x4762db['params']['id']},'include':[{'model':db[_0x68ef('0xa8')],'as':_0x68ef('0xa9'),'include':[{'model':db[_0x68ef('0xa1')],'as':_0x68ef('0xaa'),'where':_0xe82f3a,'limit':0x1,'order':[[_0x68ef('0xa4'),_0x68ef('0xab')]]}]},{'model':db[_0x68ef('0xac')],'as':_0x68ef('0xad')},{'model':db['Interval'],'as':_0x68ef('0x97'),'include':[{'model':db[_0x68ef('0x97')],'as':_0x68ef('0xae'),'attributes':['id',_0x68ef('0xaf')],'raw':!![]}]}]});})[_0x68ef('0x2f')](function(_0xc9fb85){if(!_0xc9fb85){throw new APINotFoundError(util[_0x68ef('0x40')](_0x68ef('0xb0'),_0x4762db[_0x68ef('0x61')]['id']));}if(_0x4b393e){return checkWebsiteInterval(_0xc9fb85);}return _0xc9fb85;})[_0x68ef('0x2f')](function(_0x2eb015){_0x728df1[_0x68ef('0xb1')]=_0x2eb015;_0x728df1['applications']=_[_0x68ef('0xb2')](_0x2eb015[_0x68ef('0xad')],[_0x68ef('0xb3')],[_0x68ef('0xb4')]);if(_0x728df1['account'][_0x68ef('0xad')]){delete _0x728df1[_0x68ef('0xb1')][_0x68ef('0xad')];}_0x728df1['list']=_0x2eb015[_0x68ef('0xa9')]||{'id':_0x2eb015['ListId']};if(_0x728df1[_0x68ef('0xb5')]&&_0x728df1[_0x68ef('0xb5')][_0x68ef('0xaa')][_0x68ef('0x53')]){return _0x728df1[_0x68ef('0xb5')]['Contacts'][0x0];}var _0x5c5770=_['defaults'](_0x4762db[_0x68ef('0x67')],{'firstName':_0x4762db[_0x68ef('0x67')]['from'],'ListId':_0x2eb015[_0x68ef('0xa6')]});_0x5c5770[_0x4762db[_0x68ef('0x67')][_0x68ef('0x9c')]]=_0x4762db[_0x68ef('0x67')][_0x68ef('0xa7')];return db[_0x68ef('0xa1')][_0x68ef('0x66')](_0x5c5770,{'fields':_0x5df9bb,'raw':!![]});})[_0x68ef('0x2f')](function(_0x328f87){_0x728df1[_0x68ef('0xb6')]=_0x328f87;var _0x2cb454=createInteractionObject(_0x4762db[_0x68ef('0x61')]['id'],_0x4762db[_0x68ef('0x67')],_0x4762db[_0x68ef('0xb7')],_0x328f87);var _0x3702bf={'ChatWebsiteId':_0x4762db[_0x68ef('0x61')]['id']};if(_0x4762db['body'][_0x68ef('0xb8')]){_0x3702bf[_0x68ef('0xb8')]=_0x4762db['body'][_0x68ef('0xb8')];_0x3702bf[_0x68ef('0xb9')]=![];return db[_0x68ef('0xba')][_0x68ef('0x65')]({'where':_0x3702bf})[_0x68ef('0x2f')](function(_0x42db9a){var _0x3459c1=_0x4762db['body']['customerIp']&&_0x4762db[_0x68ef('0x67')][_0x68ef('0xa0')];if(_0x42db9a){_0x4af131=!![];return _0x42db9a;}else if(!_0x3459c1&&_0x42db9a&&_0x42db9a['closed']){throw new APIConflictError(_0x68ef('0xbb'));}_0x2cb454['threadId']=_0x4762db[_0x68ef('0x67')]['threadId'];_0x2cb454[_0x68ef('0xbc')]=_0x4762db[_0x68ef('0x67')][_0x68ef('0xbc')];return db[_0x68ef('0xba')][_0x68ef('0x66')](_0x2cb454);});}_0x3702bf[_0x68ef('0xbd')]=_0x328f87['id'];if(_0x4762db[_0x68ef('0x67')][_0x68ef('0xbe')]&&_0x4762db['body'][_0x68ef('0xbe')]['id']){_0x3702bf['id']=_0x4762db[_0x68ef('0x67')][_0x68ef('0xbe')]['id'];return db[_0x68ef('0xba')][_0x68ef('0x65')]({'where':_0x3702bf})[_0x68ef('0x2f')](function(_0x3a6e25){var _0x1a0eb0=_0x4762db[_0x68ef('0x67')]['customerIp']&&_0x4762db[_0x68ef('0x67')][_0x68ef('0xa0')];if(!_0x1a0eb0&&_0x3a6e25&&_0x3a6e25[_0x68ef('0xb9')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x3a6e25){_0x4af131=!![];return _0x3a6e25;}else{return db[_0x68ef('0xba')][_0x68ef('0x66')](_0x2cb454);}});}return db[_0x68ef('0xba')][_0x68ef('0x66')](_0x2cb454);})[_0x68ef('0x2f')](function(_0x868549){if(!_0x4af131){return _0x868549;}var _0x3768ff={'from':(_0x728df1[_0x68ef('0xb6')][_0x68ef('0x3b')]||'')+'\x20'+(_0x728df1[_0x68ef('0xb6')][_0x68ef('0x3c')]||'')};if(_0x4762db[_0x68ef('0x67')][_0x68ef('0xb8')]&&_0x4762db[_0x68ef('0x67')][_0x68ef('0xbf')]&&_0x4762db['body'][_0x68ef('0xb8')]!=_0x4762db[_0x68ef('0x67')]['messageId']){_0x3768ff[_0x68ef('0xb8')]=_0x4762db['body'][_0x68ef('0xbf')];}return _0x868549[_0x68ef('0x2e')](_0x3768ff);})[_0x68ef('0x2f')](function(_0x85a62d){_0x728df1[_0x68ef('0xbe')]=_0x85a62d[_0x68ef('0x6d')]({'plain':!![]});_0x728df1[_0x68ef('0xbe')][_0x68ef('0xc0')]=!_0x4af131;if(_0x728df1[_0x68ef('0xbe')][_0x68ef('0xc0')]){if(_0x728df1[_0x68ef('0xb1')][_0x68ef('0xc1')]){_0x728df1[_0x68ef('0xc2')]['push']({'id':0x0,'priority':_0x728df1[_0x68ef('0xc2')][_0x68ef('0x53')]+0x1,'app':_0x68ef('0xc3'),'appdata':_0x68ef('0xc4'),'interval':'*,*,*,*'});}}return db[_0x68ef('0xc5')][_0x68ef('0x66')]({'body':_0x4762db[_0x68ef('0x67')]['body'],'ChatWebsiteId':_0x4762db[_0x68ef('0x61')]['id'],'ChatInteractionId':_0x85a62d['id'],'direction':'in','ContactId':_0x728df1[_0x68ef('0xb6')]['id'],'AttachmentId':_0x4762db[_0x68ef('0x67')][_0x68ef('0xc6')]});})[_0x68ef('0x2f')](function(_0x2a5f7e){_0x728df1[_0x68ef('0x24')]=_0x2a5f7e;if(!_0x728df1['interaction']['UserId']){return;}return db[_0x68ef('0xc7')][_0x68ef('0x65')]({'attributes':['id','name'],'where':{'id':_0x728df1['interaction'][_0x68ef('0xc8')]}});})[_0x68ef('0x2f')](function(_0x26e952){if(_0x26e952){_0x728df1[_0x68ef('0xc2')][_0x68ef('0xc9')]({'id':0x0,'priority':0x0,'app':_0x68ef('0xca'),'appdata':_0x26e952[_0x68ef('0x33')]+','+(_0x728df1[_0x68ef('0xb1')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x728df1[_0x68ef('0xcb')]=!![];}if(!_0x728df1[_0x68ef('0xbe')][_0x68ef('0xcc')]){return;}return db['ChatQueue'][_0x68ef('0x65')]({'attributes':['id',_0x68ef('0x33')],'where':{'id':_0x728df1[_0x68ef('0xbe')][_0x68ef('0xcc')]}});})['then'](function(_0x4a4947){if(_0x4a4947){_0x728df1[_0x68ef('0xc2')][_0x68ef('0xc9')]({'id':0x0,'priority':0x1,'app':_0x68ef('0xcd'),'appdata':_0x4a4947['name']+','+(_0x728df1[_0x68ef('0xb1')][_0x68ef('0xce')]||0x12c),'interval':_0x68ef('0xcf')});}return respondWithRpcPromise(_0x68ef('0xd0'),_0x68ef('0xd1'),_0x728df1);})[_0x68ef('0x2f')](function(_0x381b19){respondWithRpcPromise(_0x68ef('0xd2'),_0x68ef('0xd2'),{'event':'notify','message':_0x381b19},client9002);return _0x381b19;})[_0x68ef('0x2f')](respondWithResult(_0x52d821,null))[_0x68ef('0x26')](APIHandleError(_0x52d821));};exports['offline']=function(_0x3671bb,_0xd81e7a){var _0x44195b,_0x15c109,_0x48e9ff;var _0x28ea44=[];var _0x21f7d3={};var _0x24870b=_0x3671bb['files']||[];var _0x1fdc6a=[];var _0x57cf19;return db['CmContact']['describe']()[_0x68ef('0x2f')](function(_0xe0a8a6){if(!_0xe0a8a6){throw new db['Sequelize'][(_0x68ef('0xd3'))]('no\x20available\x20attributes');}_0x28ea44=_['difference'](_[_0x68ef('0x4e')](_0xe0a8a6),[_0x68ef('0xa3'),_0x68ef('0xa4'),_0x68ef('0xd4'),_0x68ef('0xa6')]);if(_0x3671bb[_0x68ef('0x67')]['id']){delete _0x3671bb[_0x68ef('0x67')]['id'];}if(_[_0x68ef('0x8b')](_0x3671bb[_0x68ef('0x67')][_0x68ef('0xa7')])){throw _0xd81e7a[_0x68ef('0x34')](0x1f4)['send'](new db[(_0x68ef('0xd5'))][(_0x68ef('0xd3'))]('from\x20is\x20mandatory'));}if(_[_0x68ef('0x8b')](_0x3671bb['body'][_0x68ef('0x67')])||_0x3671bb[_0x68ef('0x67')][_0x68ef('0x67')]===''){throw _0xd81e7a['status'](0x1f4)[_0x68ef('0x35')](new db[(_0x68ef('0xd5'))][(_0x68ef('0xd3'))](_0x68ef('0xd6')));}if(_[_0x68ef('0x8b')](_0x3671bb[_0x68ef('0x67')]['mapKeyOffline'])){throw _0xd81e7a['status'](0x1f4)[_0x68ef('0x35')](new db['Sequelize'][(_0x68ef('0xd3'))](_0x68ef('0xd7')+_0x28ea44));}if(!_[_0x68ef('0xa5')](_0x28ea44,_0x3671bb[_0x68ef('0x67')][_0x68ef('0xd8')])){throw _0xd81e7a[_0x68ef('0x34')](0x1f4)[_0x68ef('0x35')](new db[(_0x68ef('0xd5'))]['ValidationError'](_0x68ef('0xd9')+_0x28ea44));}_0x21f7d3[_0x3671bb[_0x68ef('0x67')][_0x68ef('0xd8')]]=_0x3671bb['body'][_0x68ef('0xa7')];})[_0x68ef('0x2f')](function(){return db[_0x68ef('0x49')][_0x68ef('0x65')]({'where':{'id':_0x3671bb[_0x68ef('0x61')]['id']},'include':[{'model':db[_0x68ef('0xa8')],'as':_0x68ef('0xa9')},{'model':db[_0x68ef('0xda')],'as':_0x68ef('0xda')}]});})['then'](handleEntityNotFound(_0xd81e7a,null))['then'](function(_0x307741){if(_0x307741&&_0x307741[_0x68ef('0xa9')]){_0x15c109=_0x307741;var _0x532d04=_[_0x68ef('0x15')](_0x3671bb[_0x68ef('0x67')],{'firstName':_0x3671bb['body']['from'],'phone':_0x3671bb['body']['from'],'ListId':_0x307741[_0x68ef('0xa6')]});_0x532d04[_0x3671bb['body'][_0x68ef('0xd8')]]=_0x3671bb['body'][_0x68ef('0xa7')];return db[_0x68ef('0xa1')]['findOrCreate']({'where':_0x21f7d3,'defaults':_0x532d04});}})['spread'](function(_0x55591c){if(_0x55591c){_0x48e9ff=_0x55591c;var _0x3c3ad4=fs[_0x68ef('0xdb')](path[_0x68ef('0x8d')](config['root'],_0x68ef('0xdc')),'utf8');var _0x22a810=ejs['render'](_0x3c3ad4,{'body':_[_0x68ef('0xdd')](_0x3671bb[_0x68ef('0x67')][_0x68ef('0x67')]),'bodyTitle':_0x15c109[_0x68ef('0xde')]});return db[_0x68ef('0xdf')][_0x68ef('0x66')]({'body':_0x22a810,'plainBody':htmlToText[_0x68ef('0xe0')](_0x22a810),'ContactId':_0x55591c['id'],'ChatWebsiteId':_0x15c109['id']});}})['then'](function(_0x274a7a){_0x57cf19=_0x274a7a;if(_0x24870b[_0x68ef('0x53')]){var _0x362a87=_0x24870b[_0x68ef('0x4c')](function(_0x3e5e1e){return{'name':_0x3e5e1e[_0x68ef('0xe1')],'basename':_0x3e5e1e[_0x68ef('0x86')],'type':_0x3e5e1e['mimetype'],'ChatOfflineMessageId':_0x274a7a['id']};});_0x1fdc6a=_0x362a87[_0x68ef('0x4c')](_0x382fcf=>{var _0x455770={'filename':_0x382fcf[_0x68ef('0x33')],'path':path[_0x68ef('0x8d')](config[_0x68ef('0x8e')],_0x68ef('0xe2'),_0x68ef('0xe3'),_0x68ef('0xe4'),_0x68ef('0xe5'),_0x382fcf[_0x68ef('0xe6')])};return _0x455770;});if(!_0x15c109[_0x68ef('0xe7')]){return db['sequelize'][_0x68ef('0xe8')](function(_0x14b845){return db[_0x68ef('0xe9')][_0x68ef('0xea')](_0x362a87,{'transaction':_0x14b845});});}}})['then'](function(){if(_0x57cf19){_0x44195b=_0x57cf19;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x68ef('0xeb')],'as':_0x68ef('0xec'),'raw':!![],'include':[{'model':db[_0x68ef('0xed')],'as':_0x68ef('0xed'),'raw':!![]}]}]});}})['then'](function(_0x4987c7){if(_0x4987c7&&_0x4987c7['Smtp']&&_0x15c109[_0x68ef('0xee')]&&_0x15c109[_0x68ef('0xef')]){var _0x547e6d=_0x4987c7['getSmtpOptions']();return respondWithRpcPromise(_0x68ef('0xf0'),_0x68ef('0xf1'),{'account':_0x547e6d,'message':{'from':util[_0x68ef('0x40')](_0x68ef('0xf2'),_0x4987c7[_0x68ef('0x33')],_0x4987c7[_0x68ef('0xf3')]||_0x4987c7[_0x68ef('0xec')]['user']),'to':_0x15c109[_0x68ef('0xef')],'subject':_0x15c109[_0x68ef('0xf4')],'html':_0x44195b[_0x68ef('0x67')],'attachments':_0x1fdc6a}},client9003)[_0x68ef('0x2f')](function(){return _0x44195b;})[_0x68ef('0x26')](function(_0x585daf){logger[_0x68ef('0x22')](_0x585daf);});}})[_0x68ef('0x2f')](function(){if(_0x15c109&&_0x15c109['openNewInteraction']&&_0x15c109[_0x68ef('0xf5')]){var _0x356b49=[];if(_0x24870b[_0x68ef('0x53')]){_0x356b49=_0x24870b[_0x68ef('0x4c')](function(_0x572f56){return{'name':_0x572f56[_0x68ef('0xe1')],'basename':_0x572f56['filename'],'type':_0x572f56[_0x68ef('0xf6')],'ChatOfflineMessageId':_0x57cf19['id']};});}var _0x7a3535;if(!_[_0x68ef('0x8b')](_0x15c109['subjectOffline'])){var _0x345431=_[_0x68ef('0x4c')](_0x3671bb['body'],function(_0x4d3b93){return _0x4d3b93;});var _0x392c0=_[_0x68ef('0xf7')](_0x345431)[0x0];var _0x5785e4=_['mapValues'](_0x392c0,function(_0x3394c5){return _0x3394c5;});_0x7a3535=_0x5785e4[0x1][_0x15c109[_0x68ef('0xf8')]];}var _0x25affd={'from':_0x48e9ff[_0x68ef('0xf3')],'firstName':_0x48e9ff[_0x68ef('0x3b')],'lastName':_0x48e9ff[_0x68ef('0x3c')],'mapKey':_0x68ef('0xf3'),'message':{'from':_0x48e9ff['email'],'to':_0x15c109[_0x68ef('0xda')][_0x68ef('0xf3')],'cc':'','subject':_[_0x68ef('0x8b')](_0x7a3535)?_0x15c109[_0x68ef('0xf4')]:_0x7a3535,'messageId':'','sentAt':new Date(),'attach':_0x356b49[_0x68ef('0x53')],'attachments':_0x356b49,'originChannel':_0x68ef('0xf9'),'ChatWebsiteId':_0x15c109['id'],'ChatOfflineMessageId':_0x44195b['id'],'originTo':_0x15c109[_0x68ef('0xda')][_0x68ef('0xf3')]},'body':_0x44195b[_0x68ef('0x67')]};var _0x1c83dc={'account':{'id':_0x15c109[_0x68ef('0xf5')]},'body':_0x25affd,'log':_0x68ef('0xfa')};return respondWithRpcPromise(_0x68ef('0xfa'),_0x68ef('0xfb'),_0x1c83dc,client9001)[_0x68ef('0x2f')](function(){return _0x44195b;})['catch'](function(_0x5cb37d){logger[_0x68ef('0x22')](_0x5cb37d);});}return;})[_0x68ef('0x2f')](function(){if(_0x44195b){return _0x44195b;}})[_0x68ef('0x2f')](respondWithResult(_0xd81e7a,null))[_0x68ef('0x26')](function(){for(var _0x492f6a of _0x24870b){var _0x42ad5b=path[_0x68ef('0x8d')](config['root'],'server','files',_0x68ef('0xe4'),_0x68ef('0xe5'),_0x492f6a[_0x68ef('0x86')]);fs_extra['remove'](_0x42ad5b)[_0x68ef('0x26')](function(_0x4bd7ab){logger[_0x68ef('0x22')](_0x68ef('0xfc'),_0x42ad5b,_0x4bd7ab);});}});};exports[_0x68ef('0xfd')]=function(_0x26539a,_0x5c48fb){return db[_0x68ef('0xba')][_0x68ef('0x65')]({'where':{'id':_0x26539a[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x5c48fb,null))[_0x68ef('0x2f')](function(_0xbf4eee){if(_0xbf4eee){return _0xbf4eee[_0x68ef('0xfd')](_0x26539a['body'][_0x68ef('0x7f')],_[_0x68ef('0xfe')](_0x26539a[_0x68ef('0x67')],[_0x68ef('0x7f'),'id'])||{});}})[_0x68ef('0x2f')](respondWithResult(_0x5c48fb,null))[_0x68ef('0x26')](handleError(_0x5c48fb,null));};exports['getInteractions']=function(_0x29a5ab,_0x26b50b){var _0x5925cd={'raw':![],'where':{}};var _0x40aa5c={};var _0x50ad60={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x68ef('0x79')]({'where':{'id':_0x29a5ab['params']['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x26b50b,null))[_0x68ef('0x2f')](function(_0x11a6c3){if(_0x11a6c3){_0x40aa5c[_0x68ef('0x44')]=_[_0x68ef('0x4e')](db[_0x68ef('0xba')][_0x68ef('0x4a')]);_0x40aa5c[_0x68ef('0x4d')]=_[_0x68ef('0x4e')](_0x29a5ab[_0x68ef('0x4d')]);_0x40aa5c[_0x68ef('0x4f')]=_[_0x68ef('0x50')](_0x40aa5c[_0x68ef('0x44')],_0x40aa5c[_0x68ef('0x4d')]);_0x5925cd[_0x68ef('0x52')]=_[_0x68ef('0x50')](_0x40aa5c[_0x68ef('0x44')],qs[_0x68ef('0x51')](_0x29a5ab[_0x68ef('0x4d')]['fields']));_0x5925cd['attributes']=_0x5925cd[_0x68ef('0x52')][_0x68ef('0x53')]?_0x5925cd[_0x68ef('0x52')]:_0x40aa5c[_0x68ef('0x44')];if(!_0x29a5ab[_0x68ef('0x4d')][_0x68ef('0x54')]('nolimit')){_0x5925cd[_0x68ef('0x2a')]=qs[_0x68ef('0x2a')](_0x29a5ab[_0x68ef('0x4d')][_0x68ef('0x2a')]);_0x5925cd[_0x68ef('0x28')]=qs['offset'](_0x29a5ab['query'][_0x68ef('0x28')]);}_0x5925cd[_0x68ef('0x56')]=qs[_0x68ef('0x57')](_0x29a5ab[_0x68ef('0x4d')][_0x68ef('0x57')]);_0x5925cd[_0x68ef('0x58')]=qs[_0x68ef('0x4f')](_['pick'](_0x29a5ab['query'],_0x40aa5c[_0x68ef('0x4f')]));_0x5925cd[_0x68ef('0x58')][_0x68ef('0x76')]=_0x11a6c3['id'];if(_0x29a5ab['query'][_0x68ef('0x5a')]){_0x5925cd[_0x68ef('0x58')]=_[_0x68ef('0x5c')](_0x5925cd[_0x68ef('0x58')],{'$or':_[_0x68ef('0x4c')](_0x5925cd[_0x68ef('0x52')],function(_0x16e114){var _0x279761={};_0x279761[_0x16e114]={'$like':'%'+_0x29a5ab['query'][_0x68ef('0x5a')]+'%'};return _0x279761;})});}_0x5925cd=_['merge']({},_0x5925cd,_0x29a5ab[_0x68ef('0x64')]);return db[_0x68ef('0xba')][_0x68ef('0x2b')]({'where':_0x5925cd['where']})[_0x68ef('0x2f')](function(_0x1b57f7){_0x50ad60[_0x68ef('0x2b')]=_0x1b57f7;if(_0x29a5ab[_0x68ef('0x4d')][_0x68ef('0x5d')]){_0x5925cd[_0x68ef('0x63')]=[{'model':db[_0x68ef('0xa1')],'as':_0x68ef('0xff'),'required':![]},{'model':db[_0x68ef('0xc7')],'as':'Owner','attributes':['name',_0x68ef('0x100'),_0x68ef('0x101')],'required':![]},{'model':db[_0x68ef('0x102')],'as':'Tags','attributes':['id',_0x68ef('0x33'),_0x68ef('0x103')],'where':_0x29a5ab[_0x68ef('0x4d')]['tag']?{'id':_0x29a5ab['query'][_0x68ef('0x104')]}:undefined,'required':_0x29a5ab[_0x68ef('0x4d')][_0x68ef('0x104')]?!![]:![]}];}return db[_0x68ef('0xba')][_0x68ef('0x5e')](_0x5925cd);})[_0x68ef('0x2f')](function(_0x51bd64){_0x50ad60['rows']=_0x51bd64;return _0x50ad60;});}})[_0x68ef('0x2f')](respondWithFilteredResult(_0x26b50b,_0x5925cd))[_0x68ef('0x26')](handleError(_0x26b50b,null));};exports[_0x68ef('0x105')]=function(_0x5b5bd6,_0x3407f7){var _0x148e0c=0x0;var _0x5c7004=0x0;var _0x45c033=![];var _0x13bd14;var _0x48ae28;return db[_0x68ef('0x49')][_0x68ef('0x65')]({'where':{'id':_0x5b5bd6[_0x68ef('0x61')]['id']},'include':[{'model':db['Interval'],'as':_0x68ef('0x97'),'include':[{'model':db[_0x68ef('0x97')],'as':_0x68ef('0xae'),'attributes':['id',_0x68ef('0xaf')]}]}]})[_0x68ef('0x2f')](handleEntityNotFound(_0x3407f7,null))[_0x68ef('0x2f')](function(_0x3b8f19){if(_0x3b8f19){_0x13bd14=_0x3b8f19;return _0x3b8f19[_0x68ef('0x106')]({'raw':!![]});}})['then'](function(_0x1873b5){if(_0x13bd14){if(_0x1873b5){_0x48ae28=_0x1873b5;}}return require(_0x68ef('0x89'))[_0x68ef('0x107')]();})[_0x68ef('0x2f')](function(_0x58ed21){if(_0x58ed21){_0x5c7004=_0x58ed21[_0x68ef('0x108')];_0x45c033=_0x58ed21[_0x68ef('0x8a')];}})[_0x68ef('0x2f')](function(){return db[_0x68ef('0xba')][_0x68ef('0x2b')]({'where':{'closed':![]}});})['then'](function(_0x5b41f0){_0x148e0c=_0x5b41f0;if(_0x5c7004&&_0x5b41f0>_0x5c7004){return db[_0x68ef('0x109')]['findOne']({'where':{'id':0x1}})['then'](function(_0x14b359){if(_0x14b359){_0x14b359[_0x68ef('0x10a')](_0x68ef('0x10b'));}});}})[_0x68ef('0x2f')](function(){var _0x176f93=_0x13bd14[_0x68ef('0x97')];var _0x3ee069=_0x13bd14['timezone']||undefined;return _0x176f93?_0x176f93[_0x68ef('0x10c')](_0x3ee069):!![];})[_0x68ef('0x2f')](function(_0x794d1e){var _0x266f6c=fs[_0x68ef('0xdb')](path['join'](config[_0x68ef('0x8e')],_0x68ef('0x10d')),_0x68ef('0x10e'));var _0x2b5994=_0x68ef('0x10f');var _0x23a982=![];var _0x36ae4e,_0x4356f3;if(_0x5b5bd6['headers'][_0x68ef('0xa0')]){_0x36ae4e=new URL(_0x5b5bd6[_0x68ef('0xb7')][_0x68ef('0xa0')])[_0x68ef('0x110')];}else if(_0x5b5bd6[_0x68ef('0xb7')][_0x68ef('0x110')]){_0x36ae4e=new URL(_0x5b5bd6[_0x68ef('0xb7')][_0x68ef('0x110')])['origin'];}else{_0x36ae4e=_0x68ef('0x111');}_0x4356f3=typeof _0x13bd14[_0x68ef('0x72')][_0x68ef('0x68')](',')[_0x68ef('0x65')](function(_0x12fed3){return wildcardUtils['testWebsiteWithWildcard'](_0x12fed3,_0x36ae4e);})!==_0x68ef('0x29');var _0x3dbdeb={'chatVersion':_0x2b5994,'chatWebsiteAddressOrigin':_0x4356f3?_0x36ae4e:_0x13bd14[_0x68ef('0x72')],'remote':_0x13bd14[_0x68ef('0x112')],'query':querystring[_0x68ef('0x21')](_[_0x68ef('0x5c')](_0x13bd14[_0x68ef('0x6d')]({'plain':!![]}),{'customerIp':_0x5b5bd6[_0x68ef('0xb7')][_0x68ef('0x39')]||_0x5b5bd6[_0x68ef('0xb7')][_0x68ef('0x113')]||_0x5b5bd6[_0x68ef('0x114')][_0x68ef('0x115')]||_0x5b5bd6['ip'],'referer':_0x5b5bd6['headers'][_0x68ef('0xa0')],'openedInteractions':_0x148e0c,'maxInteractions':_0x5c7004,'virtual':_0x45c033[_0x68ef('0x108')],'online':_0x794d1e,'custom':_0x45c033,'address':_0x4356f3?_0x36ae4e:null}))[_0x68ef('0x116')](/'/g,'\x5c\x27')};_0x3407f7[_0x68ef('0x35')](ejs[_0x68ef('0x117')](Mustache['render'](_0x266f6c,_0x3dbdeb),{'proactiveActions':_0x48ae28,'alignment':_0x13bd14[_0x68ef('0x118')],'verticalAlignment':_0x13bd14['verticalAlignment'],'div_color':_0x13bd14['color'],'labelText':_0x13bd14[_0x68ef('0x119')],'text_color':_0x13bd14['textColor'],'text_button_color':_0x13bd14['textButtonColor'],'button_color':_0x13bd14[_0x68ef('0x11a')],'background_color':_0x13bd14['backgroundColor'],'hideWhenOffline':_0x13bd14[_0x68ef('0x11b')],'intervalId':_0x13bd14[_0x68ef('0x11c')],'isDevelopment':_0x23a982,'chatVersion':_0x2b5994}));})[_0x68ef('0x26')](handleError(_0x3407f7,null));};exports[_0x68ef('0x11d')]=function(_0x1dd466,_0x190290){var _0x432e84=_0x1dd466[_0x68ef('0x61')]['id'];var _0x5af158=_0x1dd466['body'];var _0x11245b=0xc8;var _0x477f02=null;return db[_0x68ef('0x11e')][_0x68ef('0xe8')]({'isolationLevel':db[_0x68ef('0x11e')][_0x68ef('0x11f')][_0x68ef('0x120')][_0x68ef('0x121')]},function(_0x29662c){return db[_0x68ef('0x49')][_0x68ef('0x79')]({'where':{'id':_0x432e84},'transaction':_0x29662c})[_0x68ef('0x2f')](function(_0x53612f){if(_0x53612f){return db[_0x68ef('0xac')]['destroy']({'where':{'ChatWebsiteId':_0x432e84},'transaction':_0x29662c})[_0x68ef('0x2f')](function(){var _0x2bc0c=_[_0x68ef('0x4c')](_0x5af158,function(_0x398b25){_0x398b25['ChatWebsiteId']=_0x432e84;return _0x398b25;});return db[_0x68ef('0xac')][_0x68ef('0xea')](_0x2bc0c,{'transaction':_0x29662c});});}else{_0x11245b=0x194;_0x477f02=[];}});})[_0x68ef('0x2f')](function(){if(_0x11245b!==0x194){return db[_0x68ef('0xac')][_0x68ef('0x122')]({'where':{'ChatWebsiteId':_0x432e84},'order':_0x68ef('0xb3')})['then'](function(_0x433cf3){_0x477f02=_0x433cf3;});}})['catch'](function(_0x30709a){_0x11245b=0x1f4;logger[_0x68ef('0x22')](_0x30709a[_0x68ef('0x32')]);if(_0x30709a[_0x68ef('0x33')]){delete _0x30709a[_0x68ef('0x33')];}_0x477f02=_0x30709a;})[_0x68ef('0x123')](function(){if(_0x477f02===null){_0x190290['sendStatus'](_0x11245b);}else{if(_0x11245b===0x1f4){_0x190290['status'](_0x11245b)['send'](_0x477f02);}else{_0x190290[_0x68ef('0x34')](_0x11245b)[_0x68ef('0x2d')](_0x477f02);}}});};exports['getApplications']=function(_0x973845,_0x3ad9d8){var _0x3d7d2b={};var _0x119b22={};var _0x49f352;var _0xc997d5;return db[_0x68ef('0x49')][_0x68ef('0x79')]({'where':{'id':_0x973845[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x3ad9d8,null))[_0x68ef('0x2f')](function(_0x2ec497){if(_0x2ec497){_0x49f352=_0x2ec497;_0x119b22[_0x68ef('0x44')]=_[_0x68ef('0x4e')](db[_0x68ef('0xac')]['rawAttributes']);_0x119b22[_0x68ef('0x4d')]=_[_0x68ef('0x4e')](_0x973845[_0x68ef('0x4d')]);_0x119b22[_0x68ef('0x4f')]=_['intersection'](_0x119b22[_0x68ef('0x44')],_0x119b22[_0x68ef('0x4d')]);_0x3d7d2b[_0x68ef('0x52')]=_[_0x68ef('0x50')](_0x119b22['model'],qs[_0x68ef('0x51')](_0x973845[_0x68ef('0x4d')][_0x68ef('0x51')]));_0x3d7d2b['attributes']=_0x3d7d2b['attributes']['length']?_0x3d7d2b[_0x68ef('0x52')]:_0x119b22['model'];_0x3d7d2b['order']=qs[_0x68ef('0x57')](_0x973845['query'][_0x68ef('0x57')]);_0x3d7d2b[_0x68ef('0x58')]=qs[_0x68ef('0x4f')](_[_0x68ef('0x59')](_0x973845['query'],_0x119b22[_0x68ef('0x4f')]));if(_0x973845[_0x68ef('0x4d')][_0x68ef('0x5a')]){_0x3d7d2b['where']=_[_0x68ef('0x5c')](_0x3d7d2b[_0x68ef('0x58')],{'$or':_[_0x68ef('0x4c')](_0x3d7d2b['attributes'],function(_0x4c6756){var _0x476b42={};_0x476b42[_0x4c6756]={'$like':'%'+_0x973845['query'][_0x68ef('0x5a')]+'%'};return _0x476b42;})});}_0x3d7d2b=_['merge']({},_0x3d7d2b,_0x973845['options']);return _0x49f352['getApplications'](_0x3d7d2b);}})[_0x68ef('0x2f')](function(_0xc001){if(_0xc001){_0xc997d5=_0xc001[_0x68ef('0x53')];if(!_0x973845[_0x68ef('0x4d')][_0x68ef('0x54')]('nolimit')){_0x3d7d2b[_0x68ef('0x2a')]=qs[_0x68ef('0x2a')](_0x973845[_0x68ef('0x4d')]['limit']);_0x3d7d2b[_0x68ef('0x28')]=qs[_0x68ef('0x28')](_0x973845[_0x68ef('0x4d')][_0x68ef('0x28')]);}return _0x49f352[_0x68ef('0x124')](_0x3d7d2b);}})[_0x68ef('0x2f')](function(_0x5bf525){if(_0x5bf525){return _0x5bf525?{'count':_0xc997d5,'rows':_0x5bf525}:null;}})[_0x68ef('0x2f')](respondWithResult(_0x3ad9d8,null))[_0x68ef('0x26')](handleError(_0x3ad9d8,null));};exports[_0x68ef('0x125')]=function(_0x2e7038,_0x48b20b){return db[_0x68ef('0x126')][_0x68ef('0x65')]({'where':{'id':_0x2e7038[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x48b20b,null))[_0x68ef('0x2f')](function(_0x2b37a8){if(_0x2b37a8){return _0x2b37a8[_0x68ef('0x125')](_0x2e7038[_0x68ef('0x67')][_0x68ef('0x7f')],_[_0x68ef('0xfe')](_0x2e7038[_0x68ef('0x67')],[_0x68ef('0x7f'),'id'])||{});}})['then'](respondWithResult(_0x48b20b,null))[_0x68ef('0x26')](handleError(_0x48b20b,null));};exports['getProactiveActions']=function(_0x56492c,_0x2ee1d9){var _0x57f491={};var _0x8c89f={};var _0x347c54;var _0x4a3e5f;return db[_0x68ef('0x49')][_0x68ef('0x79')]({'where':{'id':_0x56492c['params']['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x2ee1d9,null))[_0x68ef('0x2f')](function(_0x44f2e4){if(_0x44f2e4){_0x347c54=_0x44f2e4;_0x8c89f[_0x68ef('0x44')]=_[_0x68ef('0x4e')](db[_0x68ef('0x127')][_0x68ef('0x4a')]);_0x8c89f[_0x68ef('0x4d')]=_['keys'](_0x56492c[_0x68ef('0x4d')]);_0x8c89f['filters']=_['intersection'](_0x8c89f[_0x68ef('0x44')],_0x8c89f[_0x68ef('0x4d')]);_0x57f491['attributes']=_['intersection'](_0x8c89f['model'],qs[_0x68ef('0x51')](_0x56492c['query'][_0x68ef('0x51')]));_0x57f491[_0x68ef('0x52')]=_0x57f491[_0x68ef('0x52')][_0x68ef('0x53')]?_0x57f491[_0x68ef('0x52')]:_0x8c89f[_0x68ef('0x44')];_0x57f491['order']=qs['sort'](_0x56492c[_0x68ef('0x4d')]['sort']);_0x57f491[_0x68ef('0x58')]=qs[_0x68ef('0x4f')](_[_0x68ef('0x59')](_0x56492c[_0x68ef('0x4d')],_0x8c89f['filters']));if(_0x56492c[_0x68ef('0x4d')]['filter']){_0x57f491[_0x68ef('0x58')]=_[_0x68ef('0x5c')](_0x57f491[_0x68ef('0x58')],{'$or':_[_0x68ef('0x4c')](_0x57f491[_0x68ef('0x52')],function(_0x50e707){var _0x5254db={};_0x5254db[_0x50e707]={'$like':'%'+_0x56492c[_0x68ef('0x4d')][_0x68ef('0x5a')]+'%'};return _0x5254db;})});}_0x57f491=_['merge']({},_0x57f491,_0x56492c[_0x68ef('0x64')]);return _0x347c54[_0x68ef('0x106')](_0x57f491);}})[_0x68ef('0x2f')](function(_0x169281){if(_0x169281){_0x4a3e5f=_0x169281[_0x68ef('0x53')];if(!_0x56492c['query']['hasOwnProperty'](_0x68ef('0x55'))){_0x57f491[_0x68ef('0x2a')]=qs[_0x68ef('0x2a')](_0x56492c[_0x68ef('0x4d')][_0x68ef('0x2a')]);_0x57f491[_0x68ef('0x28')]=qs[_0x68ef('0x28')](_0x56492c[_0x68ef('0x4d')][_0x68ef('0x28')]);}return _0x347c54[_0x68ef('0x106')](_0x57f491);}})['then'](function(_0x5dd039){if(_0x5dd039){return _0x5dd039?{'count':_0x4a3e5f,'rows':_0x5dd039}:null;}})[_0x68ef('0x2f')](respondWithResult(_0x2ee1d9,null))[_0x68ef('0x26')](handleError(_0x2ee1d9,null));};exports[_0x68ef('0x128')]=function(_0x2b8ec2,_0x30ea3c){var _0x4ef81e=_0x2b8ec2[_0x68ef('0x4d')]['online']===_0x68ef('0x129')?_0x68ef('0x12a'):_0x68ef('0x12b');return db[_0x68ef('0x49')][_0x68ef('0x65')]({'attributes':['id',_0x4ef81e],'where':{'id':_0x2b8ec2['params']['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x30ea3c,null))[_0x68ef('0x2f')](function(_0xc66418){if(_0xc66418){var _0x28addd=_0xc66418[_0x4ef81e];var _0x2ded22=_0x28addd&&_0x28addd['items']?_0x28addd[_0x68ef('0x12c')]:[];_0x30ea3c[_0x68ef('0x35')]({'fromKey':_[_0x68ef('0x8b')](_0x28addd[_0x68ef('0x12d')])?undefined:_0x28addd[_0x68ef('0x12d')],'count':_0x2ded22[_0x68ef('0x53')],'rows':_0x2ded22});}})['catch'](handleError(_0x30ea3c,null));};exports[_0x68ef('0x12e')]=function(_0x236a7d,_0x2998ed){var _0x5149b2={'raw':![],'where':{}};var _0x3f6f27={};var _0x3a78a2={'count':0x0,'rows':[]};return db[_0x68ef('0x49')][_0x68ef('0x79')]({'where':{'id':_0x236a7d['params']['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x2998ed,null))[_0x68ef('0x2f')](function(_0x31a3ab){if(_0x31a3ab){_0x3f6f27[_0x68ef('0x44')]=_['keys'](db[_0x68ef('0xdf')][_0x68ef('0x4a')]);_0x3f6f27[_0x68ef('0x4d')]=_[_0x68ef('0x4e')](_0x236a7d[_0x68ef('0x4d')]);_0x3f6f27['filters']=_['intersection'](_0x3f6f27['model'],_0x3f6f27['query']);_0x5149b2[_0x68ef('0x52')]=_['intersection'](_0x3f6f27[_0x68ef('0x44')],qs[_0x68ef('0x51')](_0x236a7d['query'][_0x68ef('0x51')]));_0x5149b2[_0x68ef('0x52')]=_0x5149b2[_0x68ef('0x52')][_0x68ef('0x53')]?_0x5149b2['attributes']:_0x3f6f27[_0x68ef('0x44')];if(!_0x236a7d[_0x68ef('0x4d')]['hasOwnProperty'](_0x68ef('0x55'))){_0x5149b2[_0x68ef('0x2a')]=qs[_0x68ef('0x2a')](_0x236a7d['query']['limit']);_0x5149b2[_0x68ef('0x28')]=qs[_0x68ef('0x28')](_0x236a7d['query'][_0x68ef('0x28')]);}_0x5149b2[_0x68ef('0x56')]=qs[_0x68ef('0x57')](_0x236a7d[_0x68ef('0x4d')][_0x68ef('0x57')]);_0x5149b2[_0x68ef('0x58')]=qs[_0x68ef('0x4f')](_['pick'](_0x236a7d['query'],_0x3f6f27['filters']));_0x5149b2['where'][_0x68ef('0x76')]=_0x31a3ab['id'];if(_0x236a7d[_0x68ef('0x4d')][_0x68ef('0x5a')]){_0x5149b2['where']=_[_0x68ef('0x5c')](_0x5149b2[_0x68ef('0x58')],{'$or':_[_0x68ef('0x4c')](_0x5149b2[_0x68ef('0x52')],function(_0x316d61){var _0x239d0d={};_0x239d0d[_0x316d61]={'$like':'%'+_0x236a7d['query'][_0x68ef('0x5a')]+'%'};return _0x239d0d;})});}_0x5149b2=_[_0x68ef('0x5c')]({},_0x5149b2,_0x236a7d[_0x68ef('0x64')]);return db['ChatOfflineMessage'][_0x68ef('0x2b')]({'where':_0x5149b2[_0x68ef('0x58')]})[_0x68ef('0x2f')](function(_0x674f00){_0x3a78a2['count']=_0x674f00;if(_0x236a7d[_0x68ef('0x4d')][_0x68ef('0x5d')]){_0x5149b2[_0x68ef('0x63')]=[{'all':!![]}];}else{_0x5149b2[_0x68ef('0x63')]=[{'model':db[_0x68ef('0xa1')],'as':_0x68ef('0xff'),'required':![]},{'model':db[_0x68ef('0xe9')],'as':_0x68ef('0x12f'),'required':![]}];}return db[_0x68ef('0xdf')][_0x68ef('0x5e')](_0x5149b2);})[_0x68ef('0x2f')](function(_0x297f8f){_0x3a78a2['rows']=_0x297f8f;return _0x3a78a2;});}})[_0x68ef('0x2f')](respondWithFilteredResult(_0x2998ed,_0x5149b2))[_0x68ef('0x26')](handleError(_0x2998ed,null));};exports[_0x68ef('0x130')]=function(_0x5bacf5,_0x5aa7c2){return db[_0x68ef('0x49')]['find']({'where':{'id':_0x5bacf5[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x5aa7c2,null))[_0x68ef('0x2f')](function(_0x5b912c){if(_0x5b912c){return _0x5b912c[_0x68ef('0x130')](_0x5bacf5[_0x68ef('0x67')]['ids'],_[_0x68ef('0xfe')](_0x5bacf5['body'],['ids','id'])||{})['spread'](function(_0x53f901){for(var _0x630c64=0x0;_0x630c64<_0x5bacf5[_0x68ef('0x67')][_0x68ef('0x7f')][_0x68ef('0x53')];_0x630c64+=0x1){socket[_0x68ef('0x131')]('userChatWebsite:save',{'UserId':Number(_0x5bacf5[_0x68ef('0x67')][_0x68ef('0x7f')][_0x630c64]),'ChatWebsiteId':Number(_0x5bacf5['params']['id'])});}return _0x53f901;});}})[_0x68ef('0x2f')](respondWithResult(_0x5aa7c2,null))[_0x68ef('0x26')](handleError(_0x5aa7c2,null));};exports[_0x68ef('0x132')]=function(_0xbd336f,_0xd5bac2){return db[_0x68ef('0x49')]['find']({'where':{'id':_0xbd336f[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0xd5bac2,null))['then'](function(_0x2db182){if(_0x2db182){return _0x2db182['removeAgents'](_0xbd336f[_0x68ef('0x4d')]['ids'])[_0x68ef('0x2f')](function(){if(_[_0x68ef('0x133')](_0xbd336f['query'][_0x68ef('0x7f')])){for(var _0x51d8e8=0x0;_0x51d8e8<_0xbd336f[_0x68ef('0x4d')][_0x68ef('0x7f')][_0x68ef('0x53')];_0x51d8e8+=0x1){socket[_0x68ef('0x131')]('userChatWebsite:remove',{'UserId':Number(_0xbd336f[_0x68ef('0x4d')][_0x68ef('0x7f')][_0x51d8e8]),'ChatWebsiteId':Number(_0xbd336f['params']['id'])});}}else{socket[_0x68ef('0x131')](_0x68ef('0x134'),{'UserId':Number(_0xbd336f['query'][_0x68ef('0x7f')]),'ChatWebsiteId':Number(_0xbd336f[_0x68ef('0x61')]['id'])});}});}})[_0x68ef('0x2f')](respondWithStatusCode(_0xd5bac2,null))['catch'](handleError(_0xd5bac2,null));};exports[_0x68ef('0x135')]=function(_0x454d6d,_0x599cb1){var _0x261f4c={};var _0x5dc4ec={};var _0x2bc808;var _0x283b1e;return db['ChatWebsite'][_0x68ef('0x79')]({'where':{'id':_0x454d6d[_0x68ef('0x61')]['id']}})[_0x68ef('0x2f')](handleEntityNotFound(_0x599cb1,null))[_0x68ef('0x2f')](function(_0x15db92){if(_0x15db92){_0x2bc808=_0x15db92;_0x5dc4ec['model']=_[_0x68ef('0x4e')](db['User'][_0x68ef('0x4a')]);_0x5dc4ec[_0x68ef('0x4d')]=_[_0x68ef('0x4e')](_0x454d6d['query']);_0x5dc4ec['filters']=_[_0x68ef('0x50')](_0x5dc4ec[_0x68ef('0x44')],_0x5dc4ec[_0x68ef('0x4d')]);_0x261f4c[_0x68ef('0x52')]=_[_0x68ef('0x50')](_0x5dc4ec[_0x68ef('0x44')],qs[_0x68ef('0x51')](_0x454d6d[_0x68ef('0x4d')][_0x68ef('0x51')]));_0x261f4c['attributes']=_0x261f4c[_0x68ef('0x52')][_0x68ef('0x53')]?_0x261f4c[_0x68ef('0x52')]:_0x5dc4ec[_0x68ef('0x44')];_0x261f4c['order']=qs[_0x68ef('0x57')](_0x454d6d[_0x68ef('0x4d')]['sort']);_0x261f4c[_0x68ef('0x58')]=qs[_0x68ef('0x4f')](_[_0x68ef('0x59')](_0x454d6d[_0x68ef('0x4d')],_0x5dc4ec[_0x68ef('0x4f')]));if(_0x454d6d[_0x68ef('0x4d')]['filter']){_0x261f4c[_0x68ef('0x58')]=_[_0x68ef('0x5c')](_0x261f4c['where'],{'$or':_['map'](_0x261f4c[_0x68ef('0x52')],function(_0xb93145){var _0x4fd0f2={};_0x4fd0f2[_0xb93145]={'$like':'%'+_0x454d6d[_0x68ef('0x4d')][_0x68ef('0x5a')]+'%'};return _0x4fd0f2;})});}_0x261f4c=_[_0x68ef('0x5c')]({},_0x261f4c,_0x454d6d[_0x68ef('0x64')]);return _0x2bc808['getAgents'](_0x261f4c);}})['then'](function(_0x4726d0){if(_0x4726d0){_0x283b1e=_0x4726d0[_0x68ef('0x53')];if(!_0x454d6d[_0x68ef('0x4d')][_0x68ef('0x54')]('nolimit')){_0x261f4c['limit']=qs['limit'](_0x454d6d[_0x68ef('0x4d')][_0x68ef('0x2a')]);_0x261f4c[_0x68ef('0x28')]=qs[_0x68ef('0x28')](_0x454d6d['query'][_0x68ef('0x28')]);}return _0x2bc808['getAgents'](_0x261f4c);}})[_0x68ef('0x2f')](function(_0x44e981){if(_0x44e981){return _0x44e981?{'count':_0x283b1e,'rows':_0x44e981}:null;}})[_0x68ef('0x2f')](respondWithResult(_0x599cb1,null))[_0x68ef('0x26')](handleError(_0x599cb1,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index e4dbc1c..0519f7b 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 _0x8c32=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x559cc4,_0x44ce57){var _0x138971=function(_0x7a9eda){while(--_0x7a9eda){_0x559cc4['push'](_0x559cc4['shift']());}};_0x138971(++_0x44ce57);}(_0x8c32,0x130));var _0x28c3=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x8c32[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require(_0x28c3('0x0'));var ChatWebsite=require(_0x28c3('0x1'))['db'][_0x28c3('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x28c3('0x3')](0x0);var events={'afterCreate':_0x28c3('0x4'),'afterUpdate':_0x28c3('0x5'),'afterDestroy':_0x28c3('0x6')};function emitEvent(_0x14a446){return function(_0x2f94e0,_0x40df22,_0x21259c){ChatWebsiteEvents[_0x28c3('0x7')](_0x14a446+':'+_0x2f94e0['id'],_0x2f94e0);ChatWebsiteEvents['emit'](_0x14a446,_0x2f94e0);_0x21259c(null);};}for(var e in events){if(events[_0x28c3('0x8')](e)){var event=events[e];ChatWebsite[_0x28c3('0x9')](e,emitEvent(event));}}module[_0x28c3('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x2494=['remove','emit','hasOwnProperty','hook','events','ChatWebsite','setMaxListeners','save','update'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x2494,0x82));var _0x4249=function(_0x2d7a65,_0x446492){_0x2d7a65=_0x2d7a65-0x0;var _0x5b12dc=_0x2494[_0x2d7a65];return _0x5b12dc;};'use strict';var EventEmitter=require(_0x4249('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4249('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4249('0x2')](0x0);var events={'afterCreate':_0x4249('0x3'),'afterUpdate':_0x4249('0x4'),'afterDestroy':_0x4249('0x5')};function emitEvent(_0x3fbecf){return function(_0x5decbd,_0x4fdc12,_0x3d42fb){ChatWebsiteEvents['emit'](_0x3fbecf+':'+_0x5decbd['id'],_0x5decbd);ChatWebsiteEvents[_0x4249('0x6')](_0x3fbecf,_0x5decbd);_0x3d42fb(null);};}for(var e in events){if(events[_0x4249('0x7')](e)){var event=events[e];ChatWebsite[_0x4249('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 2c1bd8f..2a264ca 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 _0xade3=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment'];(function(_0x17930e,_0x186d6d){var _0xd60cfa=function(_0xeb0cbe){while(--_0xeb0cbe){_0x17930e['push'](_0x17930e['shift']());}};_0xd60cfa(++_0x186d6d);}(_0xade3,0xe6));var _0x3ade=function(_0x1dddca,_0x22ce3e){_0x1dddca=_0x1dddca-0x0;var _0x4cc028=_0xade3[_0x1dddca];return _0x4cc028;};'use strict';var _=require(_0x3ade('0x0'));var util=require(_0x3ade('0x1'));var logger=require(_0x3ade('0x2'))('api');var moment=require(_0x3ade('0x3'));var BPromise=require(_0x3ade('0x4'));var rp=require(_0x3ade('0x5'));var fs=require('fs');var path=require(_0x3ade('0x6'));var rimraf=require(_0x3ade('0x7'));var config=require(_0x3ade('0x8'));var attributes=require(_0x3ade('0x9'));module[_0x3ade('0xa')]=function(_0x156f40,_0x42da16){return _0x156f40['define'](_0x3ade('0xb'),attributes,{'tableName':_0x3ade('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeff2=['chat_websites','util','../../config/logger','api','moment','bluebird','request-promise','exports','define','ChatWebsite'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeff2,0xe7));var _0x2eff=function(_0x4ccbe5,_0x297c05){_0x4ccbe5=_0x4ccbe5-0x0;var _0x2fcd09=_0xeff2[_0x4ccbe5];return _0x2fcd09;};'use strict';var _=require('lodash');var util=require(_0x2eff('0x0'));var logger=require(_0x2eff('0x1'))(_0x2eff('0x2'));var moment=require(_0x2eff('0x3'));var BPromise=require(_0x2eff('0x4'));var rp=require(_0x2eff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x2eff('0x6')]=function(_0x2cc58c,_0x5add65){return _0x2cc58c[_0x2eff('0x7')](_0x2eff('0x8'),attributes,{'tableName':_0x2eff('0x9'),'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 94e8d48..e08bb45 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 _0x8756=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4a8e2d,_0x3705c4){var _0x55e2b6=function(_0x295ab8){while(--_0x295ab8){_0x4a8e2d['push'](_0x4a8e2d['shift']());}};_0x55e2b6(++_0x3705c4);}(_0x8756,0x88));var _0x6875=function(_0x2d0d4f,_0x85a80c){_0x2d0d4f=_0x2d0d4f-0x0;var _0x5a0406=_0x8756[_0x2d0d4f];return _0x5a0406;};'use strict';var _=require(_0x6875('0x0'));var util=require(_0x6875('0x1'));var moment=require(_0x6875('0x2'));var BPromise=require(_0x6875('0x3'));var rs=require(_0x6875('0x4'));var fs=require('fs');var Redis=require(_0x6875('0x5'));var db=require(_0x6875('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6875('0x7'));var config=require(_0x6875('0x8'));var jayson=require(_0x6875('0x9'));var client=jayson[_0x6875('0xa')][_0x6875('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6875('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6875('0xc')]));require(_0x6875('0xd'))[_0x6875('0xe')](socket);function respondWithRpcPromise(_0x481460,_0x455eca,_0x3f4f7e){return new BPromise(function(_0x4c661b,_0x598243){return client[_0x6875('0xf')](_0x481460,_0x3f4f7e)['then'](function(_0x262fb8){logger['info'](_0x6875('0x10'),_0x455eca,_0x6875('0x11'));logger[_0x6875('0x12')](_0x6875('0x13'),_0x455eca,_0x6875('0x11'),JSON[_0x6875('0x14')](_0x262fb8));if(_0x262fb8['error']){if(_0x262fb8[_0x6875('0x15')][_0x6875('0x16')]===0x1f4){logger[_0x6875('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x455eca,_0x262fb8[_0x6875('0x15')]['message']);return _0x598243(_0x262fb8[_0x6875('0x15')][_0x6875('0x17')]);}logger[_0x6875('0x15')](_0x6875('0x10'),_0x455eca,_0x262fb8[_0x6875('0x15')][_0x6875('0x17')]);return _0x4c661b(_0x262fb8[_0x6875('0x15')][_0x6875('0x17')]);}else{logger[_0x6875('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x455eca,'request\x20sent');_0x4c661b(_0x262fb8[_0x6875('0x19')][_0x6875('0x17')]);}})[_0x6875('0x1a')](function(_0x10779e){logger[_0x6875('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x455eca,_0x10779e);_0x598243(_0x10779e);});});}
\ No newline at end of file
+var _0x397a=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x357444,_0x3af105){var _0x816800=function(_0x20052f){while(--_0x20052f){_0x357444['push'](_0x357444['shift']());}};_0x816800(++_0x3af105);}(_0x397a,0xf4));var _0xa397=function(_0x8dc74d,_0x3fdf7e){_0x8dc74d=_0x8dc74d-0x0;var _0x25b623=_0x397a[_0x8dc74d];return _0x25b623;};'use strict';var _=require(_0xa397('0x0'));var util=require(_0xa397('0x1'));var moment=require(_0xa397('0x2'));var BPromise=require(_0xa397('0x3'));var rs=require(_0xa397('0x4'));var fs=require('fs');var Redis=require(_0xa397('0x5'));var db=require(_0xa397('0x6'))['db'];var utils=require(_0xa397('0x7'));var logger=require(_0xa397('0x8'))(_0xa397('0x9'));var config=require('../../config/environment');var jayson=require(_0xa397('0xa'));var client=jayson[_0xa397('0xb')][_0xa397('0xc')]({'port':0x232a});config['redis']=_[_0xa397('0xd')](config[_0xa397('0xe')],{'host':_0xa397('0xf'),'port':0x18eb});var socket=require(_0xa397('0x10'))(new Redis(config['redis']));require(_0xa397('0x11'))[_0xa397('0x12')](socket);function respondWithRpcPromise(_0x17b564,_0x1a020d,_0xb11379){return new BPromise(function(_0x930de2,_0x22efb6){return client[_0xa397('0x13')](_0x17b564,_0xb11379)[_0xa397('0x14')](function(_0xa77a62){logger[_0xa397('0x15')](_0xa397('0x16'),_0x1a020d,_0xa397('0x17'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1a020d,_0xa397('0x17'),JSON[_0xa397('0x18')](_0xa77a62));if(_0xa77a62[_0xa397('0x19')]){if(_0xa77a62[_0xa397('0x19')][_0xa397('0x1a')]===0x1f4){logger[_0xa397('0x19')](_0xa397('0x16'),_0x1a020d,_0xa77a62[_0xa397('0x19')]['message']);return _0x22efb6(_0xa77a62['error'][_0xa397('0x1b')]);}logger['error'](_0xa397('0x16'),_0x1a020d,_0xa77a62['error'][_0xa397('0x1b')]);return _0x930de2(_0xa77a62[_0xa397('0x19')][_0xa397('0x1b')]);}else{logger[_0xa397('0x15')](_0xa397('0x16'),_0x1a020d,'request\x20sent');_0x930de2(_0xa77a62[_0xa397('0x1c')][_0xa397('0x1b')]);}})[_0xa397('0x1d')](function(_0x3a2b2e){logger[_0xa397('0x19')](_0xa397('0x16'),_0x1a020d,_0x3a2b2e);_0x22efb6(_0x3a2b2e);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e6876bc..a1c3e17 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 _0xfc28=['chatWebsite:','./chatWebsite.events','remove','update','emit','register'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0xfc28,0x1d5));var _0x8fc2=function(_0x455bd2,_0x249b94){_0x455bd2=_0x455bd2-0x0;var _0x1839c7=_0xfc28[_0x455bd2];return _0x1839c7;};'use strict';var ChatWebsiteEvents=require(_0x8fc2('0x0'));var events=['save',_0x8fc2('0x1'),_0x8fc2('0x2')];function createListener(_0x4aeb02,_0x1044bd){return function(_0x5b7388){_0x1044bd[_0x8fc2('0x3')](_0x4aeb02,_0x5b7388);};}function removeListener(_0x20f574,_0x2e7255){return function(){ChatWebsiteEvents['removeListener'](_0x20f574,_0x2e7255);};}exports[_0x8fc2('0x4')]=function(_0x39e5a8){for(var _0x5bc922=0x0,_0x116b7a=events['length'];_0x5bc922<_0x116b7a;_0x5bc922++){var _0x4cf732=events[_0x5bc922];var _0x553d34=createListener(_0x8fc2('0x5')+_0x4cf732,_0x39e5a8);ChatWebsiteEvents['on'](_0x4cf732,_0x553d34);}};
\ No newline at end of file
+var _0xd1b3=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x2d7306,_0xc2b92c){var _0x4f1dbe=function(_0x2008ea){while(--_0x2008ea){_0x2d7306['push'](_0x2d7306['shift']());}};_0x4f1dbe(++_0xc2b92c);}(_0xd1b3,0x1ea));var _0x3d1b=function(_0x2b18d8,_0x21778e){_0x2b18d8=_0x2b18d8-0x0;var _0x2bcce2=_0xd1b3[_0x2b18d8];return _0x2bcce2;};'use strict';var ChatWebsiteEvents=require(_0x3d1b('0x0'));var events=[_0x3d1b('0x1'),_0x3d1b('0x2'),_0x3d1b('0x3')];function createListener(_0xd45ef4,_0x129e70){return function(_0x16231f){_0x129e70[_0x3d1b('0x4')](_0xd45ef4,_0x16231f);};}function removeListener(_0x491626,_0x16b8ee){return function(){ChatWebsiteEvents[_0x3d1b('0x5')](_0x491626,_0x16b8ee);};}exports[_0x3d1b('0x6')]=function(_0x4e378c){for(var _0x50fb00=0x0,_0x4f9e6c=events[_0x3d1b('0x7')];_0x50fb00<_0x4f9e6c;_0x50fb00++){var _0xf1aad1=events[_0x50fb00];var _0x21be12=createListener(_0x3d1b('0x8')+_0xf1aad1,_0x4e378c);ChatWebsiteEvents['on'](_0xf1aad1,_0x21be12);}};
\ 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 3e49202..e120c4d 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 _0x80c4=['exports','../../../utils/misc','url','URL','replace','localhost','test','trim','([\x5cw]+)'];(function(_0x117bdd,_0x29a86e){var _0x93ed36=function(_0x473358){while(--_0x473358){_0x117bdd['push'](_0x117bdd['shift']());}};_0x93ed36(++_0x29a86e);}(_0x80c4,0xa3));var _0x480c=function(_0x58fb5a,_0x265e47){_0x58fb5a=_0x58fb5a-0x0;var _0x4a453a=_0x80c4[_0x58fb5a];return _0x4a453a;};var escapeRegExp=require(_0x480c('0x0'))['escapeRegExp'];var URL=require(_0x480c('0x1'))[_0x480c('0x2')];function testWildcardValidity(_0x33fc1a){var _0x44e9d7=!![];try{new URL(_0x33fc1a[_0x480c('0x3')]('*',_0x480c('0x4')));}catch(_0x58d24d){_0x44e9d7=![];}return _0x44e9d7&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x480c('0x5')](_0x33fc1a);}function testWebsiteWithWildcard(_0x3d0f2d,_0x20daac){var _0x1813b6;var _0x9805b5=escapeRegExp(_0x3d0f2d[_0x480c('0x6')]()[_0x480c('0x3')](/\/$/,''))[_0x480c('0x3')]('\x5c*',_0x480c('0x7'));try{new URL(_0x3d0f2d['replace']('\x5c*',_0x480c('0x4')));_0x1813b6=new RegExp(_0x9805b5)[_0x480c('0x5')](_0x20daac);}catch(_0x292aca){_0x1813b6=![];}return _0x1813b6;}module[_0x480c('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x556a=['../../../utils/misc','escapeRegExp','url','URL','replace','localhost','trim','([\x5cw]+)','exports'];(function(_0x58b115,_0x4312f2){var _0x36f6cd=function(_0x1fc4f7){while(--_0x1fc4f7){_0x58b115['push'](_0x58b115['shift']());}};_0x36f6cd(++_0x4312f2);}(_0x556a,0x1dd));var _0xa556=function(_0x1d59da,_0x367d95){_0x1d59da=_0x1d59da-0x0;var _0x4b9200=_0x556a[_0x1d59da];return _0x4b9200;};var escapeRegExp=require(_0xa556('0x0'))[_0xa556('0x1')];var URL=require(_0xa556('0x2'))[_0xa556('0x3')];function testWildcardValidity(_0x30a5ab){var _0x46087f=!![];try{new URL(_0x30a5ab[_0xa556('0x4')]('*',_0xa556('0x5')));}catch(_0x425bc3){_0x46087f=![];}return _0x46087f&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x30a5ab);}function testWebsiteWithWildcard(_0x1f302d,_0x42c7a2){var _0x3339aa;var _0x3095b0=escapeRegExp(_0x1f302d[_0xa556('0x6')]()['replace'](/\/$/,''))[_0xa556('0x4')]('\x5c*',_0xa556('0x7'));try{new URL(_0x1f302d[_0xa556('0x4')]('\x5c*',_0xa556('0x5')));_0x3339aa=new RegExp(_0x3095b0)['test'](_0x42c7a2);}catch(_0x44ea8e){_0x3339aa=![];}return _0x3339aa;}module[_0xa556('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 27d7da3..c500dd2 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 _0x6a3c=['removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','join','root','server/files/images/logos/','format','now','originalname','single','file','diskStorage','server/files/images/avatars/','%s-%s','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','/:id/interactions','addApplications','addProactiveActions','addAgents','put','update','delete','removeDispositions'];(function(_0x227ff2,_0x5bf697){var _0x297aff=function(_0x348ff8){while(--_0x348ff8){_0x227ff2['push'](_0x227ff2['shift']());}};_0x297aff(++_0x5bf697);}(_0x6a3c,0x133));var _0xc6a3=function(_0x43a862,_0x54e67d){_0x43a862=_0x43a862-0x0;var _0x44d8d6=_0x6a3c[_0x43a862];return _0x44d8d6;};'use strict';var multer=require(_0xc6a3('0x0'));var util=require(_0xc6a3('0x1'));var path=require(_0xc6a3('0x2'));var timeout=require(_0xc6a3('0x3'));var express=require(_0xc6a3('0x4'));var router=express[_0xc6a3('0x5')]();var fs_extra=require(_0xc6a3('0x6'));var auth=require(_0xc6a3('0x7'));var interaction=require(_0xc6a3('0x8'));var config=require(_0xc6a3('0x9'));var controller=require(_0xc6a3('0xa'));router[_0xc6a3('0xb')]('/',auth[_0xc6a3('0xc')](),controller[_0xc6a3('0xd')]);router[_0xc6a3('0xb')](_0xc6a3('0xe'),auth[_0xc6a3('0xc')](),controller[_0xc6a3('0xf')]);router[_0xc6a3('0xb')](_0xc6a3('0x10'),auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x11')]);router[_0xc6a3('0xb')](_0xc6a3('0x12'),auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x13')]);router[_0xc6a3('0xb')](_0xc6a3('0x14'),auth[_0xc6a3('0xc')](),controller['getAnswers']);router[_0xc6a3('0xb')](_0xc6a3('0x15'),controller['getLogo']);router[_0xc6a3('0xb')](_0xc6a3('0x16'),controller[_0xc6a3('0x17')]);router[_0xc6a3('0xb')](_0xc6a3('0x18'),controller[_0xc6a3('0x19')]);router[_0xc6a3('0xb')](_0xc6a3('0x1a'),controller[_0xc6a3('0x1b')]);router[_0xc6a3('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc6a3('0x1c')]);router[_0xc6a3('0xb')]('/:id/snippet',controller[_0xc6a3('0x1d')]);router[_0xc6a3('0xb')](_0xc6a3('0x1e'),auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x1f')]);router[_0xc6a3('0xb')](_0xc6a3('0x20'),auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x21')]);router[_0xc6a3('0xb')](_0xc6a3('0x22'),controller[_0xc6a3('0x23')]);router[_0xc6a3('0xb')]('/:id/offline_messages',auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x24')]);router['get'](_0xc6a3('0x25'),auth['isAuthenticated'](),controller[_0xc6a3('0x26')]);router[_0xc6a3('0x27')]('/',auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x28')]);router[_0xc6a3('0x27')](_0xc6a3('0x12'),auth[_0xc6a3('0xc')](),controller['addDisposition']);router[_0xc6a3('0x27')](_0xc6a3('0x14'),auth[_0xc6a3('0xc')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x298fec,_0x2087b9,_0x3a5535){_0x3a5535(null,path[_0xc6a3('0x29')](config[_0xc6a3('0x2a')],_0xc6a3('0x2b')));},'filename':function(_0x5232f3,_0x18ed7f,_0x97f669){_0x97f669(null,util[_0xc6a3('0x2c')]('%s-%s',Date[_0xc6a3('0x2d')](),_0x18ed7f[_0xc6a3('0x2e')]));}})});router['post'](_0xc6a3('0x15'),upload[_0xc6a3('0x2f')](_0xc6a3('0x30')),controller['addLogo']);var upload=multer({'storage':multer[_0xc6a3('0x31')]({'destination':function(_0x3ea88a,_0x5923a6,_0x5bce9f){_0x5bce9f(null,path['join'](config['root'],_0xc6a3('0x32')));},'filename':function(_0x39a0f2,_0x2ecf19,_0x587097){_0x587097(null,util[_0xc6a3('0x2c')](_0xc6a3('0x33'),Date[_0xc6a3('0x2d')](),_0x2ecf19[_0xc6a3('0x2e')]));}})});router[_0xc6a3('0x27')](_0xc6a3('0x16'),upload[_0xc6a3('0x2f')](_0xc6a3('0x30')),controller[_0xc6a3('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4e652a,_0x2aa313,_0x268cdc){_0x268cdc(null,path[_0xc6a3('0x29')](config[_0xc6a3('0x2a')],_0xc6a3('0x32')));},'filename':function(_0x3ddbd9,_0x9a5507,_0x1327e6){_0x1327e6(null,util[_0xc6a3('0x2c')]('%s-%s',Date[_0xc6a3('0x2d')](),_0x9a5507[_0xc6a3('0x2e')]));}})});router[_0xc6a3('0x27')](_0xc6a3('0x18'),upload[_0xc6a3('0x2f')](_0xc6a3('0x30')),controller[_0xc6a3('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x237876,_0x5c20a1,_0x2ac5e7){_0x2ac5e7(null,path[_0xc6a3('0x29')](config[_0xc6a3('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x56630e,_0x164397,_0x47de69){_0x47de69(null,util['format'](_0xc6a3('0x33'),Date[_0xc6a3('0x2d')](),_0x164397['originalname']));}})});router[_0xc6a3('0x27')]('/:id/system_avatar',upload['single'](_0xc6a3('0x30')),controller[_0xc6a3('0x36')]);router[_0xc6a3('0x27')](_0xc6a3('0x37'),controller[_0xc6a3('0x38')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3aff0f,_0x513198,_0x238a62){const _0x487c71=path[_0xc6a3('0x29')](config[_0xc6a3('0x2a')],_0xc6a3('0x39'),_0xc6a3('0x3a'),_0xc6a3('0x3b'));fs_extra[_0xc6a3('0x3c')](_0x487c71,function(){_0x238a62(null,_0x487c71);});},'filename':function(_0x15c93f,_0x36106e,_0x598591){const _0x12a6c4=_0x36106e['originalname'][_0xc6a3('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x217c9b=path[_0xc6a3('0x3e')](_0x12a6c4);const _0x556ad3=Date[_0xc6a3('0x2d')]()+'-'+_0x12a6c4[_0xc6a3('0x3d')](_0x217c9b,'')+_0x217c9b;_0x598591(null,_0x556ad3);}})});router[_0xc6a3('0x27')](_0xc6a3('0x3f'),offlineUploadMulter['any'](),controller[_0xc6a3('0x40')]);router['post'](_0xc6a3('0x41'),auth[_0xc6a3('0xc')](),controller['addInteraction']);router[_0xc6a3('0x27')](_0xc6a3('0x1e'),auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x42')]);router[_0xc6a3('0x27')](_0xc6a3('0x20'),auth['isAuthenticated'](),controller[_0xc6a3('0x43')]);router['post'](_0xc6a3('0x25'),auth['isAuthenticated'](),controller[_0xc6a3('0x44')]);router[_0xc6a3('0x45')](_0xc6a3('0x10'),auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x46')]);router[_0xc6a3('0x47')](_0xc6a3('0x10'),auth[_0xc6a3('0xc')](),controller['destroy']);router[_0xc6a3('0x47')](_0xc6a3('0x12'),auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x48')]);router[_0xc6a3('0x47')](_0xc6a3('0x14'),auth['isAuthenticated'](),controller[_0xc6a3('0x49')]);router['delete'](_0xc6a3('0x25'),auth[_0xc6a3('0xc')](),controller[_0xc6a3('0x4a')]);module[_0xc6a3('0x4b')]=router;
\ No newline at end of file
+var _0x5f0c=['get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','getOfflineMessages','getAgents','create','post','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','root','originalname','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace','/:id/offline','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x5f0c,0x85));var _0xc5f0=function(_0xfef90f,_0xc09e7e){_0xfef90f=_0xfef90f-0x0;var _0x483587=_0x5f0c[_0xfef90f];return _0x483587;};'use strict';var multer=require(_0xc5f0('0x0'));var util=require(_0xc5f0('0x1'));var path=require(_0xc5f0('0x2'));var timeout=require(_0xc5f0('0x3'));var express=require(_0xc5f0('0x4'));var router=express[_0xc5f0('0x5')]();var fs_extra=require(_0xc5f0('0x6'));var auth=require(_0xc5f0('0x7'));var interaction=require(_0xc5f0('0x8'));var config=require(_0xc5f0('0x9'));var controller=require(_0xc5f0('0xa'));router[_0xc5f0('0xb')]('/',auth[_0xc5f0('0xc')](),controller['index']);router['get']('/describe',auth[_0xc5f0('0xc')](),controller[_0xc5f0('0xd')]);router[_0xc5f0('0xb')](_0xc5f0('0xe'),auth['isAuthenticated'](),controller[_0xc5f0('0xf')]);router[_0xc5f0('0xb')](_0xc5f0('0x10'),auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x11')]);router[_0xc5f0('0xb')](_0xc5f0('0x12'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xc5f0('0xb')](_0xc5f0('0x13'),controller[_0xc5f0('0x14')]);router['get'](_0xc5f0('0x15'),controller['getAvatar']);router[_0xc5f0('0xb')](_0xc5f0('0x16'),controller['getCustomerAvatar']);router[_0xc5f0('0xb')](_0xc5f0('0x17'),controller[_0xc5f0('0x18')]);router['get'](_0xc5f0('0x19'),auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x1a')]);router[_0xc5f0('0xb')](_0xc5f0('0x1b'),controller['getSnippet']);router[_0xc5f0('0xb')]('/:id/applications',auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x1c')]);router[_0xc5f0('0xb')](_0xc5f0('0x1d'),auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x1e')]);router['get']('/:id/fields',controller['getFields']);router[_0xc5f0('0xb')]('/:id/offline_messages',auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x1f')]);router[_0xc5f0('0xb')]('/:id/users',auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x20')]);router['post']('/',auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x21')]);router[_0xc5f0('0x22')](_0xc5f0('0x10'),auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x23')]);router[_0xc5f0('0x22')](_0xc5f0('0x12'),auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x24')]);var upload=multer({'storage':multer[_0xc5f0('0x25')]({'destination':function(_0x4830b2,_0x207edf,_0x10cc43){_0x10cc43(null,path[_0xc5f0('0x26')](config['root'],_0xc5f0('0x27')));},'filename':function(_0x615fc3,_0xa59cb3,_0x10811e){_0x10811e(null,util[_0xc5f0('0x28')](_0xc5f0('0x29'),Date[_0xc5f0('0x2a')](),_0xa59cb3['originalname']));}})});router['post']('/:id/logo',upload[_0xc5f0('0x2b')](_0xc5f0('0x2c')),controller[_0xc5f0('0x2d')]);var upload=multer({'storage':multer[_0xc5f0('0x25')]({'destination':function(_0x777467,_0x1cfb51,_0x2dd9ab){_0x2dd9ab(null,path[_0xc5f0('0x26')](config[_0xc5f0('0x2e')],'server/files/images/avatars/'));},'filename':function(_0x3fa9dd,_0x42d118,_0x53fafc){_0x53fafc(null,util['format'](_0xc5f0('0x29'),Date['now'](),_0x42d118[_0xc5f0('0x2f')]));}})});router[_0xc5f0('0x22')](_0xc5f0('0x15'),upload[_0xc5f0('0x2b')](_0xc5f0('0x2c')),controller[_0xc5f0('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35249f,_0x1d9b99,_0x179337){_0x179337(null,path['join'](config[_0xc5f0('0x2e')],_0xc5f0('0x31')));},'filename':function(_0x5a3810,_0x57ae87,_0x98c50a){_0x98c50a(null,util[_0xc5f0('0x28')](_0xc5f0('0x29'),Date['now'](),_0x57ae87[_0xc5f0('0x2f')]));}})});router[_0xc5f0('0x22')](_0xc5f0('0x16'),upload[_0xc5f0('0x2b')](_0xc5f0('0x2c')),controller[_0xc5f0('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56964e,_0x32e752,_0x4d811d){_0x4d811d(null,path[_0xc5f0('0x26')](config['root'],_0xc5f0('0x31')));},'filename':function(_0xad4282,_0x476319,_0x3a757b){_0x3a757b(null,util[_0xc5f0('0x28')](_0xc5f0('0x29'),Date[_0xc5f0('0x2a')](),_0x476319['originalname']));}})});router[_0xc5f0('0x22')](_0xc5f0('0x17'),upload[_0xc5f0('0x2b')]('file'),controller[_0xc5f0('0x33')]);router['post'](_0xc5f0('0x34'),controller[_0xc5f0('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x447556,_0x306b5b,_0x3c89d7){const _0x11aee3=path[_0xc5f0('0x26')](config[_0xc5f0('0x2e')],_0xc5f0('0x36'),'attachments','offline-chat');fs_extra[_0xc5f0('0x37')](_0x11aee3,function(){_0x3c89d7(null,_0x11aee3);});},'filename':function(_0x2b0cca,_0x15fe36,_0x570cc1){const _0x35b8f7=_0x15fe36[_0xc5f0('0x2f')][_0xc5f0('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x364da2=path['extname'](_0x35b8f7);const _0x495082=Date[_0xc5f0('0x2a')]()+'-'+_0x35b8f7[_0xc5f0('0x38')](_0x364da2,'')+_0x364da2;_0x570cc1(null,_0x495082);}})});router[_0xc5f0('0x22')](_0xc5f0('0x39'),offlineUploadMulter['any'](),controller[_0xc5f0('0x3a')]);router['post'](_0xc5f0('0x19'),auth['isAuthenticated'](),controller[_0xc5f0('0x3b')]);router[_0xc5f0('0x22')](_0xc5f0('0x3c'),auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x3d')]);router[_0xc5f0('0x22')](_0xc5f0('0x1d'),auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x3e')]);router['post'](_0xc5f0('0x3f'),auth['isAuthenticated'](),controller[_0xc5f0('0x40')]);router[_0xc5f0('0x41')](_0xc5f0('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc5f0('0xe'),auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x42')]);router[_0xc5f0('0x43')]('/:id/dispositions',auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x44')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xc5f0('0x45')]);router[_0xc5f0('0x43')](_0xc5f0('0x3f'),auth[_0xc5f0('0xc')](),controller[_0xc5f0('0x46')]);module[_0xc5f0('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c4bf09b..a897161 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 _0x2c1b=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','env','production'];(function(_0x3e34bb,_0x6a2abb){var _0x4b8268=function(_0xe4092b){while(--_0xe4092b){_0x3e34bb['push'](_0x3e34bb['shift']());}};_0x4b8268(++_0x6a2abb);}(_0x2c1b,0x95));var _0xb2c1=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x2c1b[_0x2adbeb];return _0x5e18a6;};var beaverLogger=require(_0xb2c1('0x0'));var express=require('express');var auth=require(_0xb2c1('0x1'));var config=require(_0xb2c1('0x2'));var router=express['Router']();var isProduction=config[_0xb2c1('0x3')]===_0xb2c1('0x4')||![];function clientSideLogs(_0x595eef,_0x4d5be8,_0x7b7b3){var _0x334308=_0x595eef[_0xb2c1('0x5')][_0xb2c1('0x6')](_0xb2c1('0x7'));if(!_0x334308){throw new Error(_0xb2c1('0x8'));}return beaverLogger[_0xb2c1('0x9')]({'uri':_0xb2c1('0xa'),'logger':_0x334308,'enableCors':!isProduction})(_0x595eef,_0x4d5be8,_0x7b7b3);}router[_0xb2c1('0xb')](auth[_0xb2c1('0xc')](),clientSideLogs);module[_0xb2c1('0xd')]=router;
\ No newline at end of file
+var _0x8212=['/client-logs','isAuthenticated','exports','express','../config/environment','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x56bf30,_0x284c8b){var _0xaea08b=function(_0xf9d135){while(--_0xf9d135){_0x56bf30['push'](_0x56bf30['shift']());}};_0xaea08b(++_0x284c8b);}(_0x8212,0xdf));var _0x2821=function(_0x3578e4,_0x35a5e4){_0x3578e4=_0x3578e4-0x0;var _0xbee4f2=_0x8212[_0x3578e4];return _0xbee4f2;};var beaverLogger=require('beaver-logger/server');var express=require(_0x2821('0x0'));var auth=require('../components/auth/service');var config=require(_0x2821('0x1'));var router=express['Router']();var isProduction=config[_0x2821('0x2')]===_0x2821('0x3')||![];function clientSideLogs(_0x28071b,_0x4e9365,_0x5e6bf4){var _0x1da0e0=_0x28071b[_0x2821('0x4')]['get'](_0x2821('0x5'));if(!_0x1da0e0){throw new Error(_0x2821('0x6'));}return beaverLogger[_0x2821('0x7')]({'uri':_0x2821('0x8'),'logger':_0x1da0e0,'enableCors':!isProduction})(_0x28071b,_0x4e9365,_0x5e6bf4);}router['use'](auth[_0x2821('0x9')](),clientSideLogs);module[_0x2821('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 0436db3..61200ed 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 _0x3e10=['Google','MicrosoftAzure','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','ENUM','AmazonAWS'];(function(_0x4d122f,_0x5302bd){var _0x1ecec3=function(_0x13a1d7){while(--_0x13a1d7){_0x4d122f['push'](_0x4d122f['shift']());}};_0x1ecec3(++_0x5302bd);}(_0x3e10,0x1b7));var _0x03e1=function(_0x5cedd2,_0x152f4a){_0x5cedd2=_0x5cedd2-0x0;var _0x6ccb5d=_0x3e10[_0x5cedd2];return _0x6ccb5d;};'use strict';var Sequelize=require('sequelize');module[_0x03e1('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x03e1('0x1')](_0x03e1('0x2'),_0x03e1('0x3'),_0x03e1('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x03e1('0x5'))},'data1':{'type':Sequelize[_0x03e1('0x6')],'comment':_0x03e1('0x7')},'data2':{'type':Sequelize[_0x03e1('0x6')],'comment':_0x03e1('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0x03e1('0x9')},'data4':{'type':Sequelize[_0x03e1('0x6')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x03e1('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x03e1('0xa')],'comment':_0x03e1('0xb')},'data7':{'type':Sequelize[_0x03e1('0xa')],'comment':_0x03e1('0xc')}};
\ No newline at end of file
+var _0x1980=['Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM'];(function(_0x265f04,_0x164309){var _0x262570=function(_0x144e77){while(--_0x144e77){_0x265f04['push'](_0x265f04['shift']());}};_0x262570(++_0x164309);}(_0x1980,0x146));var _0x0198=function(_0x3b40d1,_0x5e37a2){_0x3b40d1=_0x3b40d1-0x0;var _0x1c5019=_0x1980[_0x3b40d1];return _0x1c5019;};'use strict';var Sequelize=require(_0x0198('0x0'));module[_0x0198('0x1')]={'name':{'type':Sequelize[_0x0198('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0198('0x3')]('AmazonAWS',_0x0198('0x4'),_0x0198('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x0198('0x6'))},'data1':{'type':Sequelize[_0x0198('0x2')],'comment':_0x0198('0x7')},'data2':{'type':Sequelize[_0x0198('0x2')],'comment':_0x0198('0x8')},'data3':{'type':Sequelize[_0x0198('0x2')],'comment':_0x0198('0x9')},'data4':{'type':Sequelize[_0x0198('0x2')],'comment':_0x0198('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0x0198('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x0198('0xc')},'data7':{'type':Sequelize[_0x0198('0xd')],'comment':_0x0198('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index b3773eb..788c1ac 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 _0x87a2=['index','map','CloudProvider','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','name','filter','options','includeAll','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','include','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','find','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','stack','padEnd','slice'];(function(_0x20e295,_0x308599){var _0x33ffbe=function(_0x2eeb46){while(--_0x2eeb46){_0x20e295['push'](_0x20e295['shift']());}};_0x33ffbe(++_0x308599);}(_0x87a2,0x110));var _0x287a=function(_0x2b6600,_0x24c497){_0x2b6600=_0x2b6600-0x0;var _0x912ee2=_0x87a2[_0x2b6600];return _0x912ee2;};'use strict';var _=require(_0x287a('0x0'));var Redis=require(_0x287a('0x1'));var qs=require(_0x287a('0x2'));var encryptor=require(_0x287a('0x3'));var config=require('../../config/environment');var logger=require(_0x287a('0x4'))(_0x287a('0x5'));var db=require(_0x287a('0x6'))['db'];var oauth=require(_0x287a('0x7'));config[_0x287a('0x8')]=_['defaults'](config[_0x287a('0x8')],{'host':_0x287a('0x9'),'port':0x18eb});var socket=require(_0x287a('0xa'))(new Redis(config[_0x287a('0x8')]));var redis=new Redis(config[_0x287a('0x8')]);function respondWithStatusCode(_0x48cec3,_0x51fa76){_0x51fa76=_0x51fa76||0xcc;return function(_0x2dbb9){if(_0x2dbb9){return _0x48cec3[_0x287a('0xb')](_0x51fa76);}return _0x48cec3[_0x287a('0xc')](_0x51fa76)[_0x287a('0xd')]();};}function respondWithResult(_0x4bb1ae,_0x43d861){_0x43d861=_0x43d861||0xc8;return function(_0xe41806){if(_0xe41806){return _0x4bb1ae['status'](_0x43d861)[_0x287a('0xe')](_0xe41806);}};}function respondWithFilteredResult(_0x26db0e,_0x1d2ec5){return function(_0x4fcca0){if(_0x4fcca0){var _0x365e79=typeof _0x1d2ec5[_0x287a('0xf')]===_0x287a('0x10')&&typeof _0x1d2ec5[_0x287a('0x11')]===_0x287a('0x10');var _0x1bd54e=_0x4fcca0[_0x287a('0x12')];var _0x1ae2c5=_0x365e79?0x0:_0x1d2ec5[_0x287a('0xf')];var _0x55488b=_0x365e79?_0x4fcca0['count']:_0x1d2ec5[_0x287a('0xf')]+_0x1d2ec5[_0x287a('0x11')];var _0x24f0dd;if(_0x55488b>=_0x1bd54e){_0x55488b=_0x1bd54e;_0x24f0dd=0xc8;}else{_0x24f0dd=0xce;}_0x26db0e[_0x287a('0xc')](_0x24f0dd);return _0x26db0e[_0x287a('0x13')](_0x287a('0x14'),_0x1ae2c5+'-'+_0x55488b+'/'+_0x1bd54e)[_0x287a('0xe')](_0x4fcca0);}return null;};}function saveUpdates(_0xcd3842){return function(_0x149d89){if(_0x149d89){return _0x149d89['update'](_0xcd3842)[_0x287a('0x15')](function(_0xd2ace1){return _0xd2ace1;});}return null;};}function removeEntity(_0x4d923d){return function(_0x293ac5){if(_0x293ac5){return _0x293ac5['destroy']()[_0x287a('0x15')](function(){_0x4d923d['status'](0xcc)[_0x287a('0xd')]();});}};}function handleEntityNotFound(_0x3c2952){return function(_0x4a53fc){if(!_0x4a53fc){_0x3c2952[_0x287a('0xb')](0x194);}return _0x4a53fc;};}function handleError(_0x412476,_0x3350ec){_0x3350ec=_0x3350ec||0x1f4;return function(_0x10a4b6){logger['error'](_0x10a4b6[_0x287a('0x16')]);if(_0x10a4b6['name']){delete _0x10a4b6['name'];}_0x412476[_0x287a('0xc')](_0x3350ec)['send'](_0x10a4b6);};}function maskClientSecret(_0x445b9d){return _[_0x287a('0x17')](_0x445b9d[_0x287a('0x18')](0x0,0x3),0x14,'*');}exports[_0x287a('0x19')]=function(_0x2ac2fe,_0x1611f9){var _0x27562e={},_0x5957a4={},_0x52e8cf={'count':0x0,'rows':[]};var _0x1a4f05=_[_0x287a('0x1a')](db[_0x287a('0x1b')][_0x287a('0x1c')],function(_0x5e1a1e){return{'name':_0x5e1a1e[_0x287a('0x1d')],'type':_0x5e1a1e[_0x287a('0x1e')]['key']};});_0x5957a4[_0x287a('0x1f')]=_[_0x287a('0x1a')](_0x1a4f05,'name');_0x5957a4[_0x287a('0x20')]=_[_0x287a('0x21')](_0x2ac2fe[_0x287a('0x20')]);_0x5957a4[_0x287a('0x22')]=_['intersection'](_0x5957a4['model'],_0x5957a4[_0x287a('0x20')]);_0x27562e['attributes']=_[_0x287a('0x23')](_0x5957a4['model'],qs['fields'](_0x2ac2fe['query'][_0x287a('0x24')]));_0x27562e[_0x287a('0x25')]=_0x27562e[_0x287a('0x25')][_0x287a('0x26')]?_0x27562e[_0x287a('0x25')]:_0x5957a4[_0x287a('0x1f')];if(!_0x2ac2fe['query'][_0x287a('0x27')]('nolimit')){_0x27562e['limit']=qs[_0x287a('0x11')](_0x2ac2fe[_0x287a('0x20')]['limit']);_0x27562e[_0x287a('0xf')]=qs[_0x287a('0xf')](_0x2ac2fe[_0x287a('0x20')][_0x287a('0xf')]);}_0x27562e[_0x287a('0x28')]=qs['sort'](_0x2ac2fe[_0x287a('0x20')][_0x287a('0x29')]);_0x27562e[_0x287a('0x2a')]=qs[_0x287a('0x22')](_[_0x287a('0x2b')](_0x2ac2fe[_0x287a('0x20')],_0x5957a4[_0x287a('0x22')]),_0x1a4f05);if(_0x2ac2fe[_0x287a('0x20')]['filter']){_0x27562e[_0x287a('0x2a')]=_[_0x287a('0x2c')](_0x27562e[_0x287a('0x2a')],{'$or':_[_0x287a('0x1a')](_0x1a4f05,function(_0xedac8f){if(_0xedac8f['type']!==_0x287a('0x2d')){var _0x521064={};_0x521064[_0xedac8f[_0x287a('0x2e')]]={'$like':'%'+_0x2ac2fe[_0x287a('0x20')][_0x287a('0x2f')]+'%'};return _0x521064;}})});}_0x27562e=_[_0x287a('0x2c')]({},_0x27562e,_0x2ac2fe[_0x287a('0x30')]);var _0x4a321c={'where':_0x27562e[_0x287a('0x2a')]};return db[_0x287a('0x1b')]['count'](_0x4a321c)[_0x287a('0x15')](function(_0x2ec924){_0x52e8cf[_0x287a('0x12')]=_0x2ec924;if(_0x2ac2fe[_0x287a('0x20')][_0x287a('0x31')]){_0x27562e['include']=[{'all':!![]}];}return db[_0x287a('0x1b')][_0x287a('0x32')](_0x27562e);})[_0x287a('0x15')](function(_0x249e13){_0x52e8cf[_0x287a('0x33')]=_[_0x287a('0x1a')](_0x249e13,function(_0x261204){if(_0x261204[_0x287a('0x34')]===_0x287a('0x35')){var _0x439243=encryptor['decryptString'](_0x261204['data3']);_0x261204[_0x287a('0x36')]=maskClientSecret(_0x439243);}return _0x261204;});return _0x52e8cf;})[_0x287a('0x15')](respondWithFilteredResult(_0x1611f9,_0x27562e))[_0x287a('0x37')](handleError(_0x1611f9,null));};exports[_0x287a('0x38')]=function(_0x1d8d68,_0x3c3197){var _0x292553={'raw':!![],'where':{'id':_0x1d8d68[_0x287a('0x39')]['id']}},_0x421623={};_0x421623['model']=_[_0x287a('0x21')](db[_0x287a('0x1b')]['rawAttributes']);_0x421623[_0x287a('0x20')]=_[_0x287a('0x21')](_0x1d8d68[_0x287a('0x20')]);_0x421623['filters']=_[_0x287a('0x23')](_0x421623[_0x287a('0x1f')],_0x421623[_0x287a('0x20')]);_0x292553[_0x287a('0x25')]=_[_0x287a('0x23')](_0x421623[_0x287a('0x1f')],qs[_0x287a('0x24')](_0x1d8d68[_0x287a('0x20')][_0x287a('0x24')]));_0x292553[_0x287a('0x25')]=_0x292553[_0x287a('0x25')][_0x287a('0x26')]?_0x292553['attributes']:_0x421623[_0x287a('0x1f')];if(_0x1d8d68[_0x287a('0x20')][_0x287a('0x31')]){_0x292553[_0x287a('0x3a')]=[{'all':!![]}];}_0x292553=_[_0x287a('0x2c')]({},_0x292553,_0x1d8d68[_0x287a('0x30')]);return db[_0x287a('0x1b')]['find'](_0x292553)[_0x287a('0x15')](handleEntityNotFound(_0x3c3197,null))[_0x287a('0x15')](function(_0x52426e){if(_0x52426e[_0x287a('0x34')]===_0x287a('0x35')){var _0x429d53=encryptor[_0x287a('0x3b')](_0x52426e[_0x287a('0x36')]);_0x52426e[_0x287a('0x36')]=maskClientSecret(_0x429d53);}return _0x52426e;})[_0x287a('0x15')](respondWithResult(_0x3c3197,null))['catch'](handleError(_0x3c3197,null));};exports[_0x287a('0x3c')]=function(_0x514df3,_0x2dda82){if(!_0x514df3[_0x287a('0x3d')]['name'])throw new Error(_0x287a('0x3e'));if(!_0x514df3[_0x287a('0x3d')][_0x287a('0x34')])throw new Error(_0x287a('0x3f'));var _0x53bdeb=db[_0x287a('0x1b')][_0x287a('0x1c')]['service'][_0x287a('0x40')];if(!_0x53bdeb['includes'](_0x514df3[_0x287a('0x3d')][_0x287a('0x34')]))throw new Error(_0x287a('0x41')+_0x53bdeb[_0x287a('0x42')](',\x20'));if(_0x514df3['body']['service']===_0x287a('0x35')&&_0x514df3[_0x287a('0x3d')][_0x287a('0x36')]){_0x514df3[_0x287a('0x3d')]['data3']=encryptor['encryptString'](_0x514df3[_0x287a('0x3d')]['data3']);}return db[_0x287a('0x1b')][_0x287a('0x3c')](_0x514df3[_0x287a('0x3d')],{})[_0x287a('0x15')](respondWithResult(_0x2dda82,0xc9))[_0x287a('0x37')](handleError(_0x2dda82,null));};exports['update']=function(_0x1a5dd1,_0x5590a2){if(_0x1a5dd1[_0x287a('0x3d')]['id']){delete _0x1a5dd1[_0x287a('0x3d')]['id'];}return db['CloudProvider'][_0x287a('0x43')]({'where':{'id':_0x1a5dd1[_0x287a('0x39')]['id']}})[_0x287a('0x15')](handleEntityNotFound(_0x5590a2,null))['then'](function(_0x38012c){if(_0x38012c['service']===_0x287a('0x35')&&_0x1a5dd1[_0x287a('0x3d')][_0x287a('0x36')]){_0x1a5dd1[_0x287a('0x3d')][_0x287a('0x36')]=encryptor[_0x287a('0x44')](_0x1a5dd1[_0x287a('0x3d')][_0x287a('0x36')]);}return _0x38012c;})[_0x287a('0x15')](saveUpdates(_0x1a5dd1[_0x287a('0x3d')],null))['then'](respondWithResult(_0x5590a2,null))['catch'](handleError(_0x5590a2,null));};exports[_0x287a('0x45')]=function(_0x335396,_0x117e79){return db['CloudProvider'][_0x287a('0x43')]({'where':{'id':_0x335396[_0x287a('0x39')]['id']}})[_0x287a('0x15')](handleEntityNotFound(_0x117e79,null))[_0x287a('0x15')](removeEntity(_0x117e79,null))['catch'](handleError(_0x117e79,null));};exports[_0x287a('0x46')]=function(_0x4dbf51,_0x40684c){return db['CloudProvider'][_0x287a('0x47')]({'where':{'id':_0x4dbf51['params']['id']},'raw':!![]})[_0x287a('0x15')](function(_0x3af4e9){if(!_0x3af4e9)return _0x40684c[_0x287a('0xb')](0x194);return{'url':oauth[_0x287a('0x48')](_0x3af4e9,_0x4dbf51['user']['id'])};})[_0x287a('0x15')](respondWithResult(_0x40684c,null))[_0x287a('0x37')](handleError(_0x40684c,null));};exports[_0x287a('0x49')]=function(_0x4af96c,_0x4e54fb){var _0x2f8a78=_0x4af96c[_0x287a('0x3d')];var _0x1cc546;var _0x167449;if(_0x2f8a78[_0x287a('0x4a')])throw _0x2f8a78;redis[_0x287a('0x4b')](_0x2f8a78[_0x287a('0x4c')])[_0x287a('0x15')](function(_0x1d0389){if(!_0x1d0389)throw new Error(_0x287a('0x4d'));_0x1cc546=JSON[_0x287a('0x4e')](_0x1d0389);var _0x161c36=Buffer['from'](_0x2f8a78[_0x287a('0x4c')],_0x287a('0x4f'))[_0x287a('0x50')](_0x287a('0x51'));_0x167449=JSON[_0x287a('0x4e')](_0x161c36);if(!oauth[_0x287a('0x52')](_0x2f8a78['id_token'],_0x1cc546[_0x287a('0x53')]))throw new Error(_0x287a('0x54'));redis[_0x287a('0x55')](_0x2f8a78[_0x287a('0x4c')]);return oauth[_0x287a('0x56')](_0x2f8a78[_0x287a('0x57')],_0x1cc546);})[_0x287a('0x15')](function(_0xa4a4f0){_0x1cc546['data5']=_0xa4a4f0[_0x287a('0x58')];_0x1cc546[_0x287a('0x59')]=_0xa4a4f0[_0x287a('0x5a')];return db[_0x287a('0x1b')]['update']({'data5':_0x1cc546[_0x287a('0x5b')],'data6':_0x1cc546[_0x287a('0x59')]},{'where':{'id':_0x1cc546['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x1cc546);socket[_0x287a('0x5c')](_0x287a('0x5d'),{'id':_0x167449['id']});return;})[_0x287a('0x15')](respondWithStatusCode(_0x4e54fb,null))['catch'](function(_0x5aac8b){if(_0x167449){socket[_0x287a('0x5c')]('microsoftAuthorization:error',{'id':_0x167449['id']});}if(!_0x1cc546){logger[_0x287a('0x4a')](_0x287a('0x5e'),_0x5aac8b);return _0x4e54fb[_0x287a('0xc')](0x1f4)[_0x287a('0x5f')](_0x5aac8b[_0x287a('0x60')]);}logger[_0x287a('0x4a')](_0x287a('0x61'),_0x1cc546['id'],JSON[_0x287a('0x62')](_0x5aac8b));});};
\ No newline at end of file
+var _0x59f9=['data3','catch','show','params','include','find','body','Service\x20parameter\x20not\x20specified','rawAttributes','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','sendStatus','generateMicrosoftAuthorizationUrl','user','parse','from','state','base64','ascii','isValidIdToken','id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','redis','defaults','socket.io-emitter','status','end','offset','undefined','count','limit','set','update','destroy','error','stack','name','padEnd','index','map','CloudProvider','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','then','rows','service','MicrosoftAzure','decryptString'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0x59f9,0xd9));var _0x959f=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x59f9[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x959f('0x0'));var Redis=require(_0x959f('0x1'));var qs=require(_0x959f('0x2'));var encryptor=require(_0x959f('0x3'));var config=require(_0x959f('0x4'));var logger=require(_0x959f('0x5'))('api');var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0x959f('0x6')]=_[_0x959f('0x7')](config[_0x959f('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x959f('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x959f('0x6')]);function respondWithStatusCode(_0x43ed4c,_0x3ef5df){_0x3ef5df=_0x3ef5df||0xcc;return function(_0x374a95){if(_0x374a95){return _0x43ed4c['sendStatus'](_0x3ef5df);}return _0x43ed4c[_0x959f('0x9')](_0x3ef5df)[_0x959f('0xa')]();};}function respondWithResult(_0x4c213f,_0x563e48){_0x563e48=_0x563e48||0xc8;return function(_0x1eff06){if(_0x1eff06){return _0x4c213f[_0x959f('0x9')](_0x563e48)['json'](_0x1eff06);}};}function respondWithFilteredResult(_0x11ef6c,_0xe7e7c9){return function(_0x1886ba){if(_0x1886ba){var _0x275794=typeof _0xe7e7c9[_0x959f('0xb')]===_0x959f('0xc')&&typeof _0xe7e7c9['limit']===_0x959f('0xc');var _0x5a6ee7=_0x1886ba[_0x959f('0xd')];var _0x57ebba=_0x275794?0x0:_0xe7e7c9[_0x959f('0xb')];var _0x2a8175=_0x275794?_0x1886ba[_0x959f('0xd')]:_0xe7e7c9['offset']+_0xe7e7c9[_0x959f('0xe')];var _0x385a54;if(_0x2a8175>=_0x5a6ee7){_0x2a8175=_0x5a6ee7;_0x385a54=0xc8;}else{_0x385a54=0xce;}_0x11ef6c['status'](_0x385a54);return _0x11ef6c[_0x959f('0xf')]('Content-Range',_0x57ebba+'-'+_0x2a8175+'/'+_0x5a6ee7)['json'](_0x1886ba);}return null;};}function saveUpdates(_0xc5fcd1){return function(_0x2d6be8){if(_0x2d6be8){return _0x2d6be8[_0x959f('0x10')](_0xc5fcd1)['then'](function(_0x114b80){return _0x114b80;});}return null;};}function removeEntity(_0x12e2b0){return function(_0x5a56dc){if(_0x5a56dc){return _0x5a56dc[_0x959f('0x11')]()['then'](function(){_0x12e2b0['status'](0xcc)[_0x959f('0xa')]();});}};}function handleEntityNotFound(_0x137d90){return function(_0x2e2a92){if(!_0x2e2a92){_0x137d90['sendStatus'](0x194);}return _0x2e2a92;};}function handleError(_0xc8d30c,_0x10f162){_0x10f162=_0x10f162||0x1f4;return function(_0x4463d5){logger[_0x959f('0x12')](_0x4463d5[_0x959f('0x13')]);if(_0x4463d5[_0x959f('0x14')]){delete _0x4463d5[_0x959f('0x14')];}_0xc8d30c[_0x959f('0x9')](_0x10f162)['send'](_0x4463d5);};}function maskClientSecret(_0x2d381b){return _[_0x959f('0x15')](_0x2d381b['slice'](0x0,0x3),0x14,'*');}exports[_0x959f('0x16')]=function(_0x19e8cb,_0x512352){var _0xdf30f={},_0x3f9f6b={},_0x3b302c={'count':0x0,'rows':[]};var _0x2204f1=_[_0x959f('0x17')](db[_0x959f('0x18')]['rawAttributes'],function(_0x8840e0){return{'name':_0x8840e0['fieldName'],'type':_0x8840e0['type']['key']};});_0x3f9f6b[_0x959f('0x19')]=_[_0x959f('0x17')](_0x2204f1,_0x959f('0x14'));_0x3f9f6b['query']=_[_0x959f('0x1a')](_0x19e8cb[_0x959f('0x1b')]);_0x3f9f6b[_0x959f('0x1c')]=_[_0x959f('0x1d')](_0x3f9f6b[_0x959f('0x19')],_0x3f9f6b[_0x959f('0x1b')]);_0xdf30f[_0x959f('0x1e')]=_['intersection'](_0x3f9f6b[_0x959f('0x19')],qs['fields'](_0x19e8cb['query'][_0x959f('0x1f')]));_0xdf30f[_0x959f('0x1e')]=_0xdf30f[_0x959f('0x1e')][_0x959f('0x20')]?_0xdf30f[_0x959f('0x1e')]:_0x3f9f6b[_0x959f('0x19')];if(!_0x19e8cb[_0x959f('0x1b')][_0x959f('0x21')](_0x959f('0x22'))){_0xdf30f[_0x959f('0xe')]=qs[_0x959f('0xe')](_0x19e8cb[_0x959f('0x1b')][_0x959f('0xe')]);_0xdf30f[_0x959f('0xb')]=qs['offset'](_0x19e8cb['query']['offset']);}_0xdf30f[_0x959f('0x23')]=qs['sort'](_0x19e8cb[_0x959f('0x1b')][_0x959f('0x24')]);_0xdf30f['where']=qs[_0x959f('0x1c')](_[_0x959f('0x25')](_0x19e8cb[_0x959f('0x1b')],_0x3f9f6b[_0x959f('0x1c')]),_0x2204f1);if(_0x19e8cb['query'][_0x959f('0x26')]){_0xdf30f[_0x959f('0x27')]=_[_0x959f('0x28')](_0xdf30f[_0x959f('0x27')],{'$or':_[_0x959f('0x17')](_0x2204f1,function(_0x1d9f8e){if(_0x1d9f8e[_0x959f('0x29')]!==_0x959f('0x2a')){var _0x6275bf={};_0x6275bf[_0x1d9f8e[_0x959f('0x14')]]={'$like':'%'+_0x19e8cb[_0x959f('0x1b')][_0x959f('0x26')]+'%'};return _0x6275bf;}})});}_0xdf30f=_[_0x959f('0x28')]({},_0xdf30f,_0x19e8cb[_0x959f('0x2b')]);var _0x5c4dd6={'where':_0xdf30f['where']};return db[_0x959f('0x18')]['count'](_0x5c4dd6)['then'](function(_0x139d95){_0x3b302c[_0x959f('0xd')]=_0x139d95;if(_0x19e8cb[_0x959f('0x1b')][_0x959f('0x2c')]){_0xdf30f['include']=[{'all':!![]}];}return db[_0x959f('0x18')]['findAll'](_0xdf30f);})[_0x959f('0x2d')](function(_0x51e9a8){_0x3b302c[_0x959f('0x2e')]=_[_0x959f('0x17')](_0x51e9a8,function(_0x2bc46e){if(_0x2bc46e[_0x959f('0x2f')]===_0x959f('0x30')){var _0x2ff336=encryptor[_0x959f('0x31')](_0x2bc46e[_0x959f('0x32')]);_0x2bc46e[_0x959f('0x32')]=maskClientSecret(_0x2ff336);}return _0x2bc46e;});return _0x3b302c;})[_0x959f('0x2d')](respondWithFilteredResult(_0x512352,_0xdf30f))[_0x959f('0x33')](handleError(_0x512352,null));};exports[_0x959f('0x34')]=function(_0x19affa,_0xf8317f){var _0xd711f7={'raw':!![],'where':{'id':_0x19affa[_0x959f('0x35')]['id']}},_0x381939={};_0x381939[_0x959f('0x19')]=_['keys'](db[_0x959f('0x18')]['rawAttributes']);_0x381939[_0x959f('0x1b')]=_[_0x959f('0x1a')](_0x19affa[_0x959f('0x1b')]);_0x381939[_0x959f('0x1c')]=_[_0x959f('0x1d')](_0x381939[_0x959f('0x19')],_0x381939[_0x959f('0x1b')]);_0xd711f7[_0x959f('0x1e')]=_[_0x959f('0x1d')](_0x381939[_0x959f('0x19')],qs[_0x959f('0x1f')](_0x19affa[_0x959f('0x1b')][_0x959f('0x1f')]));_0xd711f7[_0x959f('0x1e')]=_0xd711f7[_0x959f('0x1e')]['length']?_0xd711f7[_0x959f('0x1e')]:_0x381939[_0x959f('0x19')];if(_0x19affa[_0x959f('0x1b')][_0x959f('0x2c')]){_0xd711f7[_0x959f('0x36')]=[{'all':!![]}];}_0xd711f7=_[_0x959f('0x28')]({},_0xd711f7,_0x19affa[_0x959f('0x2b')]);return db['CloudProvider'][_0x959f('0x37')](_0xd711f7)[_0x959f('0x2d')](handleEntityNotFound(_0xf8317f,null))[_0x959f('0x2d')](function(_0x3c04c7){if(_0x3c04c7[_0x959f('0x2f')]===_0x959f('0x30')){var _0x2731c6=encryptor[_0x959f('0x31')](_0x3c04c7[_0x959f('0x32')]);_0x3c04c7[_0x959f('0x32')]=maskClientSecret(_0x2731c6);}return _0x3c04c7;})[_0x959f('0x2d')](respondWithResult(_0xf8317f,null))[_0x959f('0x33')](handleError(_0xf8317f,null));};exports['create']=function(_0x438c3b,_0x3b85cc){if(!_0x438c3b[_0x959f('0x38')][_0x959f('0x14')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x438c3b[_0x959f('0x38')][_0x959f('0x2f')])throw new Error(_0x959f('0x39'));var _0x4dfaaa=db['CloudProvider'][_0x959f('0x3a')][_0x959f('0x2f')][_0x959f('0x3b')];if(!_0x4dfaaa[_0x959f('0x3c')](_0x438c3b[_0x959f('0x38')][_0x959f('0x2f')]))throw new Error(_0x959f('0x3d')+_0x4dfaaa[_0x959f('0x3e')](',\x20'));if(_0x438c3b[_0x959f('0x38')][_0x959f('0x2f')]===_0x959f('0x30')&&_0x438c3b[_0x959f('0x38')][_0x959f('0x32')]){_0x438c3b['body'][_0x959f('0x32')]=encryptor[_0x959f('0x3f')](_0x438c3b[_0x959f('0x38')][_0x959f('0x32')]);}return db['CloudProvider']['create'](_0x438c3b[_0x959f('0x38')],{})[_0x959f('0x2d')](respondWithResult(_0x3b85cc,0xc9))['catch'](handleError(_0x3b85cc,null));};exports['update']=function(_0xd1f14a,_0x411e8){if(_0xd1f14a[_0x959f('0x38')]['id']){delete _0xd1f14a[_0x959f('0x38')]['id'];}return db[_0x959f('0x18')][_0x959f('0x37')]({'where':{'id':_0xd1f14a[_0x959f('0x35')]['id']}})['then'](handleEntityNotFound(_0x411e8,null))[_0x959f('0x2d')](function(_0x54373d){if(_0x54373d[_0x959f('0x2f')]===_0x959f('0x30')&&_0xd1f14a[_0x959f('0x38')]['data3']){_0xd1f14a['body'][_0x959f('0x32')]=encryptor[_0x959f('0x3f')](_0xd1f14a[_0x959f('0x38')][_0x959f('0x32')]);}return _0x54373d;})[_0x959f('0x2d')](saveUpdates(_0xd1f14a[_0x959f('0x38')],null))[_0x959f('0x2d')](respondWithResult(_0x411e8,null))[_0x959f('0x33')](handleError(_0x411e8,null));};exports['destroy']=function(_0x4be77f,_0x10e163){return db[_0x959f('0x18')][_0x959f('0x37')]({'where':{'id':_0x4be77f['params']['id']}})['then'](handleEntityNotFound(_0x10e163,null))['then'](removeEntity(_0x10e163,null))[_0x959f('0x33')](handleError(_0x10e163,null));};exports[_0x959f('0x40')]=function(_0x26b72a,_0x37420e){return db[_0x959f('0x18')]['findOne']({'where':{'id':_0x26b72a[_0x959f('0x35')]['id']},'raw':!![]})[_0x959f('0x2d')](function(_0x36dd7a){if(!_0x36dd7a)return _0x37420e[_0x959f('0x41')](0x194);return{'url':oauth[_0x959f('0x42')](_0x36dd7a,_0x26b72a[_0x959f('0x43')]['id'])};})['then'](respondWithResult(_0x37420e,null))['catch'](handleError(_0x37420e,null));};exports['oauth2MicrosoftCallback']=function(_0x283ebc,_0x122d88){var _0x26c8ed=_0x283ebc[_0x959f('0x38')];var _0x4d8e33;var _0x236d64;if(_0x26c8ed[_0x959f('0x12')])throw _0x26c8ed;redis['get'](_0x26c8ed['state'])[_0x959f('0x2d')](function(_0xb1c872){if(!_0xb1c872)throw new Error('Invalid\x20state\x20parameter');_0x4d8e33=JSON[_0x959f('0x44')](_0xb1c872);var _0x25ebbd=Buffer[_0x959f('0x45')](_0x26c8ed[_0x959f('0x46')],_0x959f('0x47'))['toString'](_0x959f('0x48'));_0x236d64=JSON[_0x959f('0x44')](_0x25ebbd);if(!oauth[_0x959f('0x49')](_0x26c8ed[_0x959f('0x4a')],_0x4d8e33['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x959f('0x4b')](_0x26c8ed[_0x959f('0x46')]);return oauth[_0x959f('0x4c')](_0x26c8ed[_0x959f('0x4d')],_0x4d8e33);})['then'](function(_0x3b9237){_0x4d8e33[_0x959f('0x4e')]=_0x3b9237[_0x959f('0x4f')];_0x4d8e33['data6']=_0x3b9237[_0x959f('0x50')];return db['CloudProvider'][_0x959f('0x10')]({'data5':_0x4d8e33['data5'],'data6':_0x4d8e33[_0x959f('0x51')]},{'where':{'id':_0x4d8e33['id']}});})[_0x959f('0x2d')](function(){oauth['startRefreshInterval'](_0x4d8e33);socket[_0x959f('0x52')](_0x959f('0x53'),{'id':_0x236d64['id']});return;})[_0x959f('0x2d')](respondWithStatusCode(_0x122d88,null))[_0x959f('0x33')](function(_0x164bb3){if(_0x236d64){socket[_0x959f('0x52')](_0x959f('0x54'),{'id':_0x236d64['id']});}if(!_0x4d8e33){logger[_0x959f('0x12')](_0x959f('0x55'),_0x164bb3);return _0x122d88[_0x959f('0x9')](0x1f4)['send'](_0x164bb3[_0x959f('0x56')]);}logger[_0x959f('0x12')](_0x959f('0x57'),_0x4d8e33['id'],JSON[_0x959f('0x58')](_0x164bb3));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 9ceec58..7e2e72e 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 _0x94e8=['CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x3ba13d,_0x4a0ae3){var _0x5bc83b=function(_0x439703){while(--_0x439703){_0x3ba13d['push'](_0x3ba13d['shift']());}};_0x5bc83b(++_0x4a0ae3);}(_0x94e8,0x9c));var _0x894e=function(_0x308a1d,_0x3d379d){_0x308a1d=_0x308a1d-0x0;var _0x5eb875=_0x94e8[_0x308a1d];return _0x5eb875;};'use strict';var _=require(_0x894e('0x0'));var util=require('util');var logger=require(_0x894e('0x1'))(_0x894e('0x2'));var moment=require('moment');var BPromise=require(_0x894e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x894e('0x4'));var rimraf=require(_0x894e('0x5'));var config=require(_0x894e('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x894e('0x7')]=function(_0x118c35,_0x17176d){return _0x118c35[_0x894e('0x8')](_0x894e('0x9'),attributes,{'tableName':_0x894e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e65=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0x7e65,0x10a));var _0x57e6=function(_0xddaaaa,_0x4fe73d){_0xddaaaa=_0xddaaaa-0x0;var _0x3c4cc5=_0x7e65[_0xddaaaa];return _0x3c4cc5;};'use strict';var _=require(_0x57e6('0x0'));var util=require(_0x57e6('0x1'));var logger=require(_0x57e6('0x2'))(_0x57e6('0x3'));var moment=require(_0x57e6('0x4'));var BPromise=require(_0x57e6('0x5'));var rp=require(_0x57e6('0x6'));var fs=require('fs');var path=require(_0x57e6('0x7'));var rimraf=require(_0x57e6('0x8'));var config=require(_0x57e6('0x9'));var attributes=require(_0x57e6('0xa'));module[_0x57e6('0xb')]=function(_0x47db6a,_0x5ea0f9){return _0x47db6a[_0x57e6('0xc')](_0x57e6('0xd'),attributes,{'tableName':_0x57e6('0xe'),'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 77da751..c19d75f 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 _0x13e2=['audience','isAfter','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','decryptString','POST','{TENANT_ID}','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','data7','replace','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','login','map','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud'];(function(_0xc7bd0f,_0x357ced){var _0x565704=function(_0x3e6c44){while(--_0x3e6c44){_0xc7bd0f['push'](_0xc7bd0f['shift']());}};_0x565704(++_0x357ced);}(_0x13e2,0x68));var _0x213e=function(_0x5ef739,_0x402957){_0x5ef739=_0x5ef739-0x0;var _0x2c6865=_0x13e2[_0x5ef739];return _0x2c6865;};'use strict';var _=require(_0x213e('0x0'));var crypto=require(_0x213e('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x213e('0x2'));var encryptor=require(_0x213e('0x3'));var config=require('../../config/environment');var logger=require(_0x213e('0x4'))(_0x213e('0x5'));var schedule=require(_0x213e('0x6'));var db=require(_0x213e('0x7'))['db'];config[_0x213e('0x8')]=_[_0x213e('0x9')](config[_0x213e('0x8')],{'host':_0x213e('0xa'),'port':0x18eb});var redis=new Redis(config[_0x213e('0x8')]);var MICROSOFT_AUTH_URL=_0x213e('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x213e('0xc'),'email',_0x213e('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x213e('0xe'),_0x213e('0xf')],'Dynamics365':['openid',_0x213e('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0x213e('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x213e('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x53815e){var _0x4c5219=_['map'](AZURE_AUTH_SCOPES[_0x53815e[_0x213e('0x12')]]);if(_0x53815e['type']===_0x213e('0x13'))_0x4c5219[_0x213e('0x14')](_0x53815e['data7']+_0x213e('0x15'));return _0x4c5219[_0x213e('0x16')]('\x20');}function getAccessTokenScope(_0x35007e){if(_0x35007e[_0x213e('0x12')]===_0x213e('0x17'))return _0x213e('0x18');if(_0x35007e[_0x213e('0x12')]===_0x213e('0x13'))return _0x35007e[_0x213e('0x19')]+_0x213e('0x15');}function generateMicrosoftAuthorizationUrl(_0x50c68d,_0x28aefa){var _0x35c64e=MICROSOFT_AUTH_URL[_0x213e('0x1a')]('{TENANT_ID}',_0x50c68d[_0x213e('0x1b')]);var _0x15c5ac=[_0x213e('0x1c'),_0x213e('0x1d')];var _0x3c5433=Buffer[_0x213e('0x1e')](JSON[_0x213e('0x1f')]({'id':_0x28aefa}))[_0x213e('0x20')](_0x213e('0x21'));var _0x47eeb2=crypto[_0x213e('0x22')](0x10)[_0x213e('0x20')](_0x213e('0x23'));var _0x5c851d=getAuthorizationScopes(_0x50c68d);var _0x2ae2a9=[{'key':_0x213e('0x24'),'value':_0x50c68d[_0x213e('0x25')]},{'key':_0x213e('0x26'),'value':encodeURIComponent(_0x15c5ac['join']('\x20'))},{'key':_0x213e('0x27'),'value':_0x50c68d[_0x213e('0x28')]},{'key':_0x213e('0x29'),'value':_0x213e('0x2a')},{'key':_0x213e('0x2b'),'value':encodeURIComponent(_0x5c851d)},{'key':_0x213e('0x2c'),'value':_0x3c5433},{'key':_0x213e('0x2d'),'value':_0x47eeb2},{'key':'prompt','value':_0x213e('0x2e')}];var _0x52a612=_0x35c64e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x213e('0x2f')](_0x2ae2a9,function(_0x3e82e0){return _0x3e82e0['key']+'='+_0x3e82e0['value'];})[_0x213e('0x16')]('&');_0x50c68d[_0x213e('0x30')]={'issuer':_0x35c64e['replace'](_0x213e('0x31'),''),'audience':_0x50c68d[_0x213e('0x25')],'state':_0x3c5433,'nonce':_0x47eeb2};redis[_0x213e('0x32')](_0x3c5433,JSON[_0x213e('0x1f')](_0x50c68d));return _0x52a612;}function isValidIdToken(_0x1b30f3,_0x4f6e40){try{var _0x3348cd=jwt[_0x213e('0x33')](_0x1b30f3,{'complete':!![]});var _0x53cc43=_0x3348cd[_0x213e('0x34')];if(_0x53cc43[_0x213e('0x35')]!==_0x4f6e40[_0x213e('0x36')])return![];if(_0x53cc43[_0x213e('0x37')]!==_0x4f6e40[_0x213e('0x38')])return![];if(_0x53cc43[_0x213e('0x2d')]!==_0x4f6e40[_0x213e('0x2d')])return![];if(moment()[_0x213e('0x39')](moment['unix'](_0x53cc43[_0x213e('0x3a')])))return![];return!![];}catch(_0xc5b48a){throw _0xc5b48a;}}function refreshOauth2MicrosoftAccessToken(_0x362bcc){return Promise[_0x213e('0x3b')]()['then'](function(){if(_0x362bcc[_0x213e('0x3c')])return _0x362bcc;return db[_0x213e('0x3d')][_0x213e('0x3e')]({'where':{'id':_0x362bcc['id']},'raw':!![]});})[_0x213e('0x3f')](function(_0x36bdc0){var _0x28c3e7={'grant_type':_0x213e('0x40'),'refresh_token':_0x36bdc0[_0x213e('0x41')],'scope':getAccessTokenScope(_0x36bdc0),'redirect_uri':_0x36bdc0[_0x213e('0x28')],'client_id':_0x36bdc0[_0x213e('0x25')],'client_secret':encryptor[_0x213e('0x42')](_0x36bdc0['data3'])};var _0x3b675f={'method':_0x213e('0x43'),'uri':MICROSOFT_AUTH_URL[_0x213e('0x1a')](_0x213e('0x44'),_0x36bdc0['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x28c3e7,'json':!![]};return rp(_0x3b675f);})[_0x213e('0x3f')](function(_0x5a6691){_0x362bcc[_0x213e('0x45')]=_0x5a6691['access_token'];_0x362bcc[_0x213e('0x41')]=_0x5a6691['refresh_token'];return db['CloudProvider'][_0x213e('0x46')]({'data5':_0x362bcc[_0x213e('0x45')],'data6':_0x362bcc[_0x213e('0x41')]},{'where':{'id':_0x362bcc['id']}});})[_0x213e('0x3f')](function(){return _0x362bcc;})[_0x213e('0x47')](function(_0x29f808){logger[_0x213e('0x48')](_0x213e('0x49'),_0x362bcc['id'],_0x29f808);});}function getOauth2MicrosoftAccessToken(_0x263607,_0x5b79da){var _0x65ed32={'grant_type':'authorization_code','code':_0x263607,'scope':getAccessTokenScope(_0x5b79da),'redirect_uri':_0x5b79da['data4'],'client_id':_0x5b79da[_0x213e('0x25')],'client_secret':encryptor[_0x213e('0x42')](_0x5b79da[_0x213e('0x3c')])};var _0x3a1cf7={'method':_0x213e('0x43'),'uri':MICROSOFT_AUTH_URL[_0x213e('0x1a')](_0x213e('0x44'),_0x5b79da['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x65ed32,'json':!![]};return rp(_0x3a1cf7);}function startRefreshInterval(_0x4a931f){var _0x2da907=schedule[_0x213e('0x4a')];if(_0x2da907[_0x4a931f['id']])clearInterval(_0x2da907[_0x4a931f['id']]);_0x2da907[_0x4a931f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x213e('0x4b')](this,{'id':_0x4a931f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x213e('0x4a')]=_0x2da907;}function startAllRefreshIntervals(){return db[_0x213e('0x3d')][_0x213e('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x213e('0x3f')](function(_0x2f7ad7){var _0x10d596=_0x2f7ad7[_0x213e('0x2f')](function(_0x4b32dd){return refreshOauth2MicrosoftAccessToken(_0x4b32dd)[_0x213e('0x3f')](function(_0x8db1){startRefreshInterval(_0x8db1);});});return Promise[_0x213e('0x4d')](_0x10d596);})[_0x213e('0x47')](function(_0x474eeb){var _0x11d914=_0x474eeb?util[_0x213e('0x4e')](_0x474eeb,{'showHidden':![],'depth':null}):'';logger['error'](_0x213e('0x4f'),_0x11d914);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xa90c=['data3','CloudProvider','findOne','refresh_token','data4','data1','POST','data5','access_token','data6','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','openid','/authorize','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','response_type','redirect_uri','form_post','scope','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','decode','payload','issuer','aud','isAfter','unix','exp','then'];(function(_0x2f6722,_0x121e8c){var _0xb6ebd5=function(_0x59fb51){while(--_0x59fb51){_0x2f6722['push'](_0x2f6722['shift']());}};_0xb6ebd5(++_0x121e8c);}(_0xa90c,0xb5));var _0xca90=function(_0x578f88,_0x5492ae){_0x578f88=_0x578f88-0x0;var _0x29df13=_0xa90c[_0x578f88];return _0x29df13;};'use strict';var _=require(_0xca90('0x0'));var crypto=require(_0xca90('0x1'));var jwt=require(_0xca90('0x2'));var moment=require(_0xca90('0x3'));var Redis=require('ioredis');var rp=require(_0xca90('0x4'));var util=require(_0xca90('0x5'));var encryptor=require(_0xca90('0x6'));var config=require(_0xca90('0x7'));var logger=require(_0xca90('0x8'))(_0xca90('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xca90('0xa'))['db'];config['redis']=_[_0xca90('0xb')](config[_0xca90('0xc')],{'host':_0xca90('0xd'),'port':0x18eb});var redis=new Redis(config[_0xca90('0xc')]);var MICROSOFT_AUTH_URL=_0xca90('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xca90('0xf'),_0xca90('0x10'),_0xca90('0x11'),_0xca90('0x12'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xca90('0x13'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xca90('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x25f10a){var _0x500205=_[_0xca90('0x15')](AZURE_AUTH_SCOPES[_0x25f10a[_0xca90('0x16')]]);if(_0x25f10a[_0xca90('0x16')]===_0xca90('0x17'))_0x500205['push'](_0x25f10a[_0xca90('0x18')]+_0xca90('0x19'));return _0x500205[_0xca90('0x1a')]('\x20');}function getAccessTokenScope(_0x2866a4){if(_0x2866a4[_0xca90('0x16')]===_0xca90('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2866a4['type']===_0xca90('0x17'))return _0x2866a4[_0xca90('0x18')]+_0xca90('0x19');}function generateMicrosoftAuthorizationUrl(_0x44fbab,_0x4c53ee){var _0x13a82a=MICROSOFT_AUTH_URL[_0xca90('0x1c')](_0xca90('0x1d'),_0x44fbab[_0xca90('0x1e')]);var _0x55e3c8=[_0xca90('0x1f'),_0xca90('0x20')];var _0x3b85bc=Buffer[_0xca90('0x21')](JSON[_0xca90('0x22')]({'id':_0x4c53ee}))[_0xca90('0x23')]('base64');var _0x131b6b=crypto[_0xca90('0x24')](0x10)['toString'](_0xca90('0x25'));var _0x445015=getAuthorizationScopes(_0x44fbab);var _0x3402a8=[{'key':_0xca90('0x26'),'value':_0x44fbab['data1']},{'key':_0xca90('0x27'),'value':encodeURIComponent(_0x55e3c8[_0xca90('0x1a')]('\x20'))},{'key':_0xca90('0x28'),'value':_0x44fbab['data4']},{'key':'response_mode','value':_0xca90('0x29')},{'key':_0xca90('0x2a'),'value':encodeURIComponent(_0x445015)},{'key':'state','value':_0x3b85bc},{'key':_0xca90('0x2b'),'value':_0x131b6b},{'key':_0xca90('0x2c'),'value':_0xca90('0x2d')}];var _0x106e0d=_0x13a82a+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xca90('0x15')](_0x3402a8,function(_0x485503){return _0x485503[_0xca90('0x2e')]+'='+_0x485503[_0xca90('0x2f')];})[_0xca90('0x1a')]('&');_0x44fbab[_0xca90('0x30')]={'issuer':_0x13a82a[_0xca90('0x1c')](_0xca90('0x31'),''),'audience':_0x44fbab['data1'],'state':_0x3b85bc,'nonce':_0x131b6b};redis[_0xca90('0x32')](_0x3b85bc,JSON[_0xca90('0x22')](_0x44fbab));return _0x106e0d;}function isValidIdToken(_0x34cce8,_0x160882){try{var _0x272397=jwt[_0xca90('0x33')](_0x34cce8,{'complete':!![]});var _0x2707ca=_0x272397[_0xca90('0x34')];if(_0x2707ca['iss']!==_0x160882[_0xca90('0x35')])return![];if(_0x2707ca[_0xca90('0x36')]!==_0x160882['audience'])return![];if(_0x2707ca['nonce']!==_0x160882[_0xca90('0x2b')])return![];if(moment()[_0xca90('0x37')](moment[_0xca90('0x38')](_0x2707ca[_0xca90('0x39')])))return![];return!![];}catch(_0xe4d0e8){throw _0xe4d0e8;}}function refreshOauth2MicrosoftAccessToken(_0x50daf6){return Promise['resolve']()[_0xca90('0x3a')](function(){if(_0x50daf6[_0xca90('0x3b')])return _0x50daf6;return db[_0xca90('0x3c')][_0xca90('0x3d')]({'where':{'id':_0x50daf6['id']},'raw':!![]});})[_0xca90('0x3a')](function(_0xb26a28){var _0x54299b={'grant_type':_0xca90('0x3e'),'refresh_token':_0xb26a28['data6'],'scope':getAccessTokenScope(_0xb26a28),'redirect_uri':_0xb26a28[_0xca90('0x3f')],'client_id':_0xb26a28[_0xca90('0x40')],'client_secret':encryptor['decryptString'](_0xb26a28['data3'])};var _0x26edce={'method':_0xca90('0x41'),'uri':MICROSOFT_AUTH_URL[_0xca90('0x1c')](_0xca90('0x1d'),_0xb26a28[_0xca90('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x54299b,'json':!![]};return rp(_0x26edce);})[_0xca90('0x3a')](function(_0x1add64){_0x50daf6[_0xca90('0x42')]=_0x1add64[_0xca90('0x43')];_0x50daf6[_0xca90('0x44')]=_0x1add64[_0xca90('0x3e')];return db['CloudProvider'][_0xca90('0x45')]({'data5':_0x50daf6['data5'],'data6':_0x50daf6[_0xca90('0x44')]},{'where':{'id':_0x50daf6['id']}});})[_0xca90('0x3a')](function(){return _0x50daf6;})[_0xca90('0x46')](function(_0x322146){logger[_0xca90('0x47')](_0xca90('0x48'),_0x50daf6['id'],_0x322146);});}function getOauth2MicrosoftAccessToken(_0xbf078a,_0x29000c){var _0x39b221={'grant_type':_0xca90('0x49'),'code':_0xbf078a,'scope':getAccessTokenScope(_0x29000c),'redirect_uri':_0x29000c['data4'],'client_id':_0x29000c['data1'],'client_secret':encryptor['decryptString'](_0x29000c[_0xca90('0x3b')])};var _0x3a7ace={'method':_0xca90('0x41'),'uri':MICROSOFT_AUTH_URL[_0xca90('0x1c')]('{TENANT_ID}',_0x29000c[_0xca90('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x39b221,'json':!![]};return rp(_0x3a7ace);}function startRefreshInterval(_0x496b92){var _0x525c25=schedule[_0xca90('0x4a')];if(_0x525c25[_0x496b92['id']])clearInterval(_0x525c25[_0x496b92['id']]);_0x525c25[_0x496b92['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xca90('0x4b')](this,{'id':_0x496b92['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xca90('0x4a')]=_0x525c25;}function startAllRefreshIntervals(){return db[_0xca90('0x3c')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xca90('0x3a')](function(_0x59b84d){var _0x3d6909=_0x59b84d[_0xca90('0x15')](function(_0xee72e4){return refreshOauth2MicrosoftAccessToken(_0xee72e4)[_0xca90('0x3a')](function(_0x1ba200){startRefreshInterval(_0x1ba200);});});return Promise[_0xca90('0x4c')](_0x3d6909);})[_0xca90('0x46')](function(_0x5a2601){var _0x23a6d8=_0x5a2601?util[_0xca90('0x4d')](_0x5a2601,{'showHidden':![],'depth':null}):'';logger[_0xca90('0x47')](_0xca90('0x4e'),_0x23a6d8);});}module[_0xca90('0x4f')]={'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 3e7fd2e..07ac9d0 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 _0x578c=['stringify','error','code','message','info','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x1c69b4,_0x306679){var _0x35bb79=function(_0x541c93){while(--_0x541c93){_0x1c69b4['push'](_0x1c69b4['shift']());}};_0x35bb79(++_0x306679);}(_0x578c,0x158));var _0xc578=function(_0x1e62e9,_0x53d12a){_0x1e62e9=_0x1e62e9-0x0;var _0x1b3e6f=_0x578c[_0x1e62e9];return _0x1b3e6f;};'use strict';var _=require(_0xc578('0x0'));var util=require(_0xc578('0x1'));var moment=require(_0xc578('0x2'));var BPromise=require('bluebird');var rs=require(_0xc578('0x3'));var fs=require('fs');var Redis=require(_0xc578('0x4'));var db=require(_0xc578('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc578('0x6'))(_0xc578('0x7'));var config=require(_0xc578('0x8'));var jayson=require(_0xc578('0x9'));var client=jayson[_0xc578('0xa')][_0xc578('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e619d,_0x703919,_0x198c3d){return new BPromise(function(_0x258f93,_0x1b6291){return client[_0xc578('0xc')](_0x3e619d,_0x198c3d)[_0xc578('0xd')](function(_0xaa68b3){logger['info']('CloudProvider,\x20%s,\x20%s',_0x703919,_0xc578('0xe'));logger['debug'](_0xc578('0xf'),_0x703919,_0xc578('0xe'),JSON[_0xc578('0x10')](_0xaa68b3));if(_0xaa68b3['error']){if(_0xaa68b3[_0xc578('0x11')][_0xc578('0x12')]===0x1f4){logger[_0xc578('0x11')]('CloudProvider,\x20%s,\x20%s',_0x703919,_0xaa68b3[_0xc578('0x11')][_0xc578('0x13')]);return _0x1b6291(_0xaa68b3[_0xc578('0x11')][_0xc578('0x13')]);}logger[_0xc578('0x11')]('CloudProvider,\x20%s,\x20%s',_0x703919,_0xaa68b3[_0xc578('0x11')][_0xc578('0x13')]);return _0x258f93(_0xaa68b3[_0xc578('0x11')][_0xc578('0x13')]);}else{logger[_0xc578('0x14')](_0xc578('0x15'),_0x703919,_0xc578('0xe'));_0x258f93(_0xaa68b3[_0xc578('0x16')][_0xc578('0x13')]);}})[_0xc578('0x17')](function(_0x2b76bc){logger[_0xc578('0x11')](_0xc578('0x15'),_0x703919,_0x2b76bc);_0x1b6291(_0x2b76bc);});});}
\ No newline at end of file
+var _0xb366=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0xb366,0xa4));var _0x6b36=function(_0x342fb8,_0x54a8cd){_0x342fb8=_0x342fb8-0x0;var _0x188abb=_0xb366[_0x342fb8];return _0x188abb;};'use strict';var _=require(_0x6b36('0x0'));var util=require('util');var moment=require(_0x6b36('0x1'));var BPromise=require(_0x6b36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b36('0x3'));var db=require(_0x6b36('0x4'))['db'];var utils=require(_0x6b36('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6b36('0x6'));var client=jayson[_0x6b36('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3997c0,_0x4fe38c,_0x4c6f4c){return new BPromise(function(_0x301a30,_0xee898a){return client[_0x6b36('0x8')](_0x3997c0,_0x4c6f4c)[_0x6b36('0x9')](function(_0x49c125){logger[_0x6b36('0xa')](_0x6b36('0xb'),_0x4fe38c,'request\x20sent');logger[_0x6b36('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x4fe38c,_0x6b36('0xd'),JSON[_0x6b36('0xe')](_0x49c125));if(_0x49c125[_0x6b36('0xf')]){if(_0x49c125[_0x6b36('0xf')][_0x6b36('0x10')]===0x1f4){logger[_0x6b36('0xf')]('CloudProvider,\x20%s,\x20%s',_0x4fe38c,_0x49c125[_0x6b36('0xf')][_0x6b36('0x11')]);return _0xee898a(_0x49c125['error'][_0x6b36('0x11')]);}logger['error'](_0x6b36('0xb'),_0x4fe38c,_0x49c125['error']['message']);return _0x301a30(_0x49c125['error'][_0x6b36('0x11')]);}else{logger[_0x6b36('0xa')](_0x6b36('0xb'),_0x4fe38c,'request\x20sent');_0x301a30(_0x49c125[_0x6b36('0x12')]['message']);}})[_0x6b36('0x13')](function(_0xf7b45a){logger[_0x6b36('0xf')]('CloudProvider,\x20%s,\x20%s',_0x4fe38c,_0xf7b45a);_0xee898a(_0xf7b45a);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 5a02057..993aa9d 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x27d1ad,_0x5bc39a){var _0x3ca40d=function(_0x9bdfab){while(--_0x9bdfab){_0x27d1ad['push'](_0x27d1ad['shift']());}};_0x3ca40d(++_0x5bc39a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x2ccbbe,_0x4ddab9){var _0x736bff=function(_0x2631c3){while(--_0x2631c3){_0x2ccbbe['push'](_0x2ccbbe['shift']());}};_0x736bff(++_0x4ddab9);}(_0xdb28,0x106));var _0x8db2=function(_0x2c79f8,_0x40b2b2){_0x2c79f8=_0x2c79f8-0x0;var _0x475248=_0xdb28[_0x2c79f8];return _0x475248;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9663239..145fe52 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 _0xac2c=['name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac2c,0x195));var _0xcac2=function(_0x2e1207,_0x2620c8){_0x2e1207=_0x2e1207-0x0;var _0x164111=_0xac2c[_0x2e1207];return _0x164111;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcac2('0x0')],'unique':_0xcac2('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcac2('0x0')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xcac2('0x0')]},'phone':{'type':Sequelize[_0xcac2('0x0')]},'fax':{'type':Sequelize[_0xcac2('0x0')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xcac2('0x0')]},'postalCode':{'type':Sequelize[_0xcac2('0x0')]},'city':{'type':Sequelize[_0xcac2('0x0')]},'country':{'type':Sequelize[_0xcac2('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xcac2('0x0')]},'sPostalCode':{'type':Sequelize[_0xcac2('0x0')]},'sCity':{'type':Sequelize[_0xcac2('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcac2('0x0')]}};
\ No newline at end of file
+var _0x9e0b=['STRING','sequelize'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x9e0b,0xc1));var _0xb9e0=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x9e0b[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xb9e0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb9e0('0x1')]},'companyId':{'type':Sequelize[_0xb9e0('0x1')]},'website':{'type':Sequelize[_0xb9e0('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xb9e0('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xb9e0('0x1')]},'postalCode':{'type':Sequelize[_0xb9e0('0x1')]},'city':{'type':Sequelize[_0xb9e0('0x1')]},'country':{'type':Sequelize[_0xb9e0('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb9e0('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xb9e0('0x1')]},'sCity':{'type':Sequelize[_0xb9e0('0x1')]},'sCountry':{'type':Sequelize[_0xb9e0('0x1')]},'description':{'type':Sequelize[_0xb9e0('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index d6e8940..d4cede7 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 _0x7246=['CmContact','addContacts','ids','omit','findOne','filter','getContacts','zip-dir','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','end','name','index','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','options','CmCompany','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe'];(function(_0x4877c1,_0x559891){var _0x114801=function(_0xb85fc7){while(--_0xb85fc7){_0x4877c1['push'](_0x4877c1['shift']());}};_0x114801(++_0x559891);}(_0x7246,0x1a6));var _0x6724=function(_0x4dc7d4,_0x21a542){_0x4dc7d4=_0x4dc7d4-0x0;var _0x109248=_0x7246[_0x4dc7d4];return _0x109248;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6724('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6724('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6724('0x2'));var path=require(_0x6724('0x3'));var sox=require(_0x6724('0x4'));var csv=require('to-csv');var ejs=require(_0x6724('0x5'));var fs=require('fs');var fs_extra=require(_0x6724('0x6'));var _=require(_0x6724('0x7'));var squel=require(_0x6724('0x8'));var crypto=require(_0x6724('0x9'));var jsforce=require(_0x6724('0xa'));var deskjs=require(_0x6724('0xb'));var toCsv=require(_0x6724('0xc'));var querystring=require(_0x6724('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6724('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6724('0xf'));var logger=require(_0x6724('0x10'))(_0x6724('0x11'));var utils=require('../../config/utils');var config=require(_0x6724('0x12'));var licenseUtil=require(_0x6724('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15fe87,_0x211c77){_0x211c77=_0x211c77||0xcc;return function(_0x4bc223){if(_0x4bc223){return _0x15fe87[_0x6724('0x14')](_0x211c77);}return _0x15fe87[_0x6724('0x15')](_0x211c77)['end']();};}function respondWithResult(_0x3fdc0a,_0x4ae76b){_0x4ae76b=_0x4ae76b||0xc8;return function(_0x213090){if(_0x213090){return _0x3fdc0a[_0x6724('0x15')](_0x4ae76b)[_0x6724('0x16')](_0x213090);}};}function respondWithFilteredResult(_0x42d17b,_0x451b9f){return function(_0x5b7359){if(_0x5b7359){var _0x200dee=typeof _0x451b9f['offset']===_0x6724('0x17')&&typeof _0x451b9f['limit']===_0x6724('0x17');var _0x930324=_0x5b7359[_0x6724('0x18')];var _0x3bb08a=_0x200dee?0x0:_0x451b9f[_0x6724('0x19')];var _0x403a5a=_0x200dee?_0x5b7359[_0x6724('0x18')]:_0x451b9f[_0x6724('0x19')]+_0x451b9f[_0x6724('0x1a')];var _0xf29b81;if(_0x403a5a>=_0x930324){_0x403a5a=_0x930324;_0xf29b81=0xc8;}else{_0xf29b81=0xce;}_0x42d17b[_0x6724('0x15')](_0xf29b81);return _0x42d17b[_0x6724('0x1b')](_0x6724('0x1c'),_0x3bb08a+'-'+_0x403a5a+'/'+_0x930324)['json'](_0x5b7359);}return null;};}function patchUpdates(_0x50db06){return function(_0x19cf8b){try{jsonpatch[_0x6724('0x1d')](_0x19cf8b,_0x50db06,!![]);}catch(_0x17b0cf){return BPromise['reject'](_0x17b0cf);}return _0x19cf8b[_0x6724('0x1e')]();};}function saveUpdates(_0x2164fd,_0x43cdf6){return function(_0x2b9aec){if(_0x2b9aec){return _0x2b9aec[_0x6724('0x1f')](_0x2164fd)[_0x6724('0x20')](function(_0x16d7fd){return _0x16d7fd;});}return null;};}function removeEntity(_0x59604a,_0x1607db){return function(_0x56d19a){if(_0x56d19a){return _0x56d19a[_0x6724('0x21')]()[_0x6724('0x20')](function(){var _0x41e606=_0x56d19a[_0x6724('0x22')]({'plain':!![]});var _0x5b7857=_0x6724('0x23');return db[_0x6724('0x24')]['destroy']({'where':{'type':_0x5b7857,'resourceId':_0x41e606['id']}})['then'](function(){return _0x56d19a;});})['then'](function(){_0x59604a['status'](0xcc)[_0x6724('0x25')]();});}};}function handleEntityNotFound(_0x3850ef,_0x35333c){return function(_0x3c0da4){if(!_0x3c0da4){_0x3850ef[_0x6724('0x14')](0x194);}return _0x3c0da4;};}function handleError(_0x788182,_0x8f610d){_0x8f610d=_0x8f610d||0x1f4;return function(_0x105201){logger['error'](_0x105201['stack']);if(_0x105201[_0x6724('0x26')]){delete _0x105201['name'];}_0x788182['status'](_0x8f610d)['send'](_0x105201);};}exports[_0x6724('0x27')]=function(_0xf9d05c,_0x4ac163){var _0x2873ab={},_0x271411={},_0x327ebd={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x6724('0x20')](function(_0xfb8933){_0x271411['model']=_['keys'](_0xfb8933);_0x271411[_0x6724('0x28')]=_[_0x6724('0x29')](_0xf9d05c[_0x6724('0x28')]);_0x271411[_0x6724('0x2a')]=_[_0x6724('0x2b')](_0x271411[_0x6724('0x2c')],_0x271411[_0x6724('0x28')]);_0x2873ab[_0x6724('0x2d')]=_[_0x6724('0x2b')](_0x271411[_0x6724('0x2c')],qs[_0x6724('0x2e')](_0xf9d05c[_0x6724('0x28')][_0x6724('0x2e')]));_0x2873ab[_0x6724('0x2d')]=_0x2873ab[_0x6724('0x2d')][_0x6724('0x2f')]?_0x2873ab[_0x6724('0x2d')]:_0x271411[_0x6724('0x2c')];if(!_0xf9d05c[_0x6724('0x28')][_0x6724('0x30')](_0x6724('0x31'))){_0x2873ab['limit']=qs['limit'](_0xf9d05c[_0x6724('0x28')][_0x6724('0x1a')]);_0x2873ab[_0x6724('0x19')]=qs[_0x6724('0x19')](_0xf9d05c[_0x6724('0x28')][_0x6724('0x19')]);}_0x2873ab[_0x6724('0x32')]=qs[_0x6724('0x33')](_0xf9d05c[_0x6724('0x28')][_0x6724('0x33')]);_0x2873ab[_0x6724('0x34')]=qs[_0x6724('0x2a')](_[_0x6724('0x35')](_0xf9d05c['query'],_0x271411[_0x6724('0x2a')]),_0xfb8933);if(_0xf9d05c['query']['filter']){_0x2873ab[_0x6724('0x34')]=_[_0x6724('0x36')](_0x2873ab[_0x6724('0x34')],{'$or':_[_0x6724('0x37')](_0x2873ab['attributes'],function(_0x4516a1){var _0x228f78={};_0x228f78[_0x4516a1]={'$like':'%'+_0xf9d05c[_0x6724('0x28')]['filter']+'%'};return _0x228f78;})});}_0x2873ab=_[_0x6724('0x36')]({},_0x2873ab,_0xf9d05c[_0x6724('0x38')]);var _0x50f783={'where':_0x2873ab[_0x6724('0x34')]};return db[_0x6724('0x39')][_0x6724('0x18')](_0x50f783)[_0x6724('0x20')](function(_0x285be1){_0x327ebd[_0x6724('0x18')]=_0x285be1;if(_0xf9d05c[_0x6724('0x28')][_0x6724('0x3a')]){_0x2873ab[_0x6724('0x3b')]=[{'all':!![]}];}return db['CmCompany'][_0x6724('0x3c')](_0x2873ab);})[_0x6724('0x20')](function(_0x496662){_0x327ebd['rows']=_0x496662;return _0x327ebd;})[_0x6724('0x20')](respondWithFilteredResult(_0x4ac163,_0x2873ab))[_0x6724('0x3d')](handleError(_0x4ac163,null));})['catch'](handleError(_0x4ac163,null));};exports[_0x6724('0x3e')]=function(_0x4e47e3,_0x354f62){var _0x1bb2a6={'raw':![],'where':{'id':_0x4e47e3[_0x6724('0x3f')]['id']}},_0x350570={};_0x350570[_0x6724('0x2c')]=_['keys'](db[_0x6724('0x39')][_0x6724('0x40')]);_0x350570[_0x6724('0x28')]=_['keys'](_0x4e47e3[_0x6724('0x28')]);_0x350570[_0x6724('0x2a')]=_[_0x6724('0x2b')](_0x350570[_0x6724('0x2c')],_0x350570[_0x6724('0x28')]);_0x1bb2a6[_0x6724('0x2d')]=_[_0x6724('0x2b')](_0x350570[_0x6724('0x2c')],qs['fields'](_0x4e47e3[_0x6724('0x28')][_0x6724('0x2e')]));_0x1bb2a6[_0x6724('0x2d')]=_0x1bb2a6['attributes']['length']?_0x1bb2a6[_0x6724('0x2d')]:_0x350570['model'];if(_0x4e47e3['query']['includeAll']){_0x1bb2a6['include']=[{'all':!![]}];}_0x1bb2a6=_['merge']({},_0x1bb2a6,_0x4e47e3['options']);return db[_0x6724('0x39')][_0x6724('0x41')](_0x1bb2a6)[_0x6724('0x20')](handleEntityNotFound(_0x354f62,null))[_0x6724('0x20')](respondWithResult(_0x354f62,null))['catch'](handleError(_0x354f62,null));};exports[_0x6724('0x42')]=function(_0x476777,_0x43586a){return db[_0x6724('0x39')]['create'](_0x476777[_0x6724('0x43')],{})[_0x6724('0x20')](function(_0x2c1576){var _0x5b279a=_0x476777[_0x6724('0x44')][_0x6724('0x22')]({'plain':!![]});if(!_0x5b279a)throw new Error(_0x6724('0x45'));if(_0x5b279a[_0x6724('0x46')]===_0x6724('0x44')){var _0x10249a=_0x2c1576[_0x6724('0x22')]({'plain':!![]});var _0x49e791='Companies';return db[_0x6724('0x47')]['find']({'where':{'name':_0x49e791,'userProfileId':_0x5b279a[_0x6724('0x48')]},'raw':!![]})['then'](function(_0x1f48e8){if(_0x1f48e8&&_0x1f48e8[_0x6724('0x49')]===0x0){return db[_0x6724('0x24')][_0x6724('0x42')]({'name':_0x10249a[_0x6724('0x26')],'resourceId':_0x10249a['id'],'type':_0x1f48e8['name'],'sectionId':_0x1f48e8['id']},{})['then'](function(){return _0x2c1576;});}else{return _0x2c1576;}})[_0x6724('0x3d')](function(_0x5bada7){logger['error'](_0x6724('0x4a'),_0x5bada7);throw _0x5bada7;});}return _0x2c1576;})[_0x6724('0x20')](respondWithResult(_0x43586a,0xc9))[_0x6724('0x3d')](handleError(_0x43586a,null));};exports[_0x6724('0x1f')]=function(_0x522ed2,_0x74dbdf){if(_0x522ed2[_0x6724('0x43')]['id']){delete _0x522ed2[_0x6724('0x43')]['id'];}return db[_0x6724('0x39')][_0x6724('0x41')]({'where':{'id':_0x522ed2[_0x6724('0x3f')]['id']}})[_0x6724('0x20')](handleEntityNotFound(_0x74dbdf,null))[_0x6724('0x20')](saveUpdates(_0x522ed2[_0x6724('0x43')],null))[_0x6724('0x20')](respondWithResult(_0x74dbdf,null))[_0x6724('0x3d')](handleError(_0x74dbdf,null));};exports['destroy']=function(_0x1e7c7d,_0x13f290){return db[_0x6724('0x39')]['find']({'where':{'id':_0x1e7c7d[_0x6724('0x3f')]['id']}})[_0x6724('0x20')](handleEntityNotFound(_0x13f290,null))[_0x6724('0x20')](removeEntity(_0x13f290,null))[_0x6724('0x3d')](handleError(_0x13f290,null));};exports[_0x6724('0x4b')]=function(_0x4f200c,_0x35fe52){return db['CmCompany'][_0x6724('0x4b')]()[_0x6724('0x20')](respondWithResult(_0x35fe52,null))[_0x6724('0x3d')](handleError(_0x35fe52,null));};exports['addContacts']=function(_0x34aea1,_0x4b4a26,_0x234957){return db[_0x6724('0x4c')][_0x6724('0x41')]({'where':{'id':_0x34aea1[_0x6724('0x3f')]['id']}})[_0x6724('0x20')](handleEntityNotFound(_0x4b4a26,null))[_0x6724('0x20')](function(_0x265aff){if(_0x265aff){return _0x265aff[_0x6724('0x4d')](_0x34aea1[_0x6724('0x43')][_0x6724('0x4e')],_[_0x6724('0x4f')](_0x34aea1[_0x6724('0x43')],[_0x6724('0x4e'),'id'])||{});}})[_0x6724('0x20')](respondWithResult(_0x4b4a26,null))[_0x6724('0x3d')](handleError(_0x4b4a26,null));};exports['getContacts']=function(_0x11ceca,_0x498249,_0x55c50f){var _0x35330a={};var _0x96be16={};var _0x25e006;var _0x18710f;return db['CmCompany'][_0x6724('0x50')]({'where':{'id':_0x11ceca[_0x6724('0x3f')]['id']}})['then'](handleEntityNotFound(_0x498249,null))[_0x6724('0x20')](function(_0x3dfbe5){if(_0x3dfbe5){_0x25e006=_0x3dfbe5;_0x96be16['model']=_[_0x6724('0x29')](db[_0x6724('0x4c')][_0x6724('0x40')]);_0x96be16['query']=_[_0x6724('0x29')](_0x11ceca[_0x6724('0x28')]);_0x96be16[_0x6724('0x2a')]=_[_0x6724('0x2b')](_0x96be16['model'],_0x96be16[_0x6724('0x28')]);_0x35330a['attributes']=_[_0x6724('0x2b')](_0x96be16[_0x6724('0x2c')],qs[_0x6724('0x2e')](_0x11ceca[_0x6724('0x28')][_0x6724('0x2e')]));_0x35330a[_0x6724('0x2d')]=_0x35330a[_0x6724('0x2d')][_0x6724('0x2f')]?_0x35330a[_0x6724('0x2d')]:_0x96be16[_0x6724('0x2c')];_0x35330a['order']=qs[_0x6724('0x33')](_0x11ceca['query'][_0x6724('0x33')]);_0x35330a['where']=qs['filters'](_['pick'](_0x11ceca[_0x6724('0x28')],_0x96be16['filters']));if(_0x11ceca[_0x6724('0x28')][_0x6724('0x51')]){_0x35330a['where']=_[_0x6724('0x36')](_0x35330a[_0x6724('0x34')],{'$or':_['map'](_0x35330a[_0x6724('0x2d')],function(_0x1b5379){var _0x219a8b={};_0x219a8b[_0x1b5379]={'$like':'%'+_0x11ceca[_0x6724('0x28')][_0x6724('0x51')]+'%'};return _0x219a8b;})});}_0x35330a=_[_0x6724('0x36')]({},_0x35330a,_0x11ceca[_0x6724('0x38')]);return _0x25e006[_0x6724('0x52')](_0x35330a);}})[_0x6724('0x20')](function(_0x382b45){if(_0x382b45){_0x18710f=_0x382b45[_0x6724('0x2f')];if(!_0x11ceca[_0x6724('0x28')][_0x6724('0x30')](_0x6724('0x31'))){_0x35330a[_0x6724('0x1a')]=qs[_0x6724('0x1a')](_0x11ceca[_0x6724('0x28')][_0x6724('0x1a')]);_0x35330a[_0x6724('0x19')]=qs['offset'](_0x11ceca[_0x6724('0x28')][_0x6724('0x19')]);}return _0x25e006[_0x6724('0x52')](_0x35330a);}})[_0x6724('0x20')](function(_0x4cf764){if(_0x4cf764){return _0x4cf764?{'count':_0x18710f,'rows':_0x4cf764}:null;}})['then'](respondWithResult(_0x498249,null))['catch'](handleError(_0x498249,null));};
\ No newline at end of file
+var _0xd696=['crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','apply','update','then','destroy','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','getContacts','pick','map','rimraf','zip-dir','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x5c693e,_0x5dc5a7){var _0x457ffe=function(_0x8fa6b6){while(--_0x8fa6b6){_0x5c693e['push'](_0x5c693e['shift']());}};_0x457ffe(++_0x5dc5a7);}(_0xd696,0x186));var _0x6d69=function(_0x35c718,_0x33a696){_0x35c718=_0x35c718-0x0;var _0x5c3099=_0xd696[_0x35c718];return _0x5c3099;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d69('0x0'));var zipdir=require(_0x6d69('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d69('0x2'));var moment=require(_0x6d69('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6d69('0x4'));var sox=require('sox');var csv=require(_0x6d69('0x5'));var ejs=require(_0x6d69('0x6'));var fs=require('fs');var fs_extra=require(_0x6d69('0x7'));var _=require(_0x6d69('0x8'));var squel=require(_0x6d69('0x9'));var crypto=require(_0x6d69('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6d69('0x5'));var querystring=require('querystring');var Papa=require(_0x6d69('0xb'));var Redis=require('ioredis');var authService=require(_0x6d69('0xc'));var qs=require(_0x6d69('0xd'));var as=require(_0x6d69('0xe'));var hardwareService=require(_0x6d69('0xf'));var logger=require(_0x6d69('0x10'))('api');var utils=require(_0x6d69('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6d69('0x12'));var db=require(_0x6d69('0x13'))['db'];function respondWithStatusCode(_0x392f35,_0x5bd9db){_0x5bd9db=_0x5bd9db||0xcc;return function(_0x3a9e8e){if(_0x3a9e8e){return _0x392f35['sendStatus'](_0x5bd9db);}return _0x392f35[_0x6d69('0x14')](_0x5bd9db)[_0x6d69('0x15')]();};}function respondWithResult(_0xece7fd,_0x1ad4b8){_0x1ad4b8=_0x1ad4b8||0xc8;return function(_0xbc1d37){if(_0xbc1d37){return _0xece7fd['status'](_0x1ad4b8)[_0x6d69('0x16')](_0xbc1d37);}};}function respondWithFilteredResult(_0xe74c08,_0x3df42c){return function(_0xc6cd18){if(_0xc6cd18){var _0x1df788=typeof _0x3df42c[_0x6d69('0x17')]===_0x6d69('0x18')&&typeof _0x3df42c['limit']===_0x6d69('0x18');var _0x48737a=_0xc6cd18[_0x6d69('0x19')];var _0x2ccd81=_0x1df788?0x0:_0x3df42c[_0x6d69('0x17')];var _0x117232=_0x1df788?_0xc6cd18[_0x6d69('0x19')]:_0x3df42c[_0x6d69('0x17')]+_0x3df42c[_0x6d69('0x1a')];var _0x5343e6;if(_0x117232>=_0x48737a){_0x117232=_0x48737a;_0x5343e6=0xc8;}else{_0x5343e6=0xce;}_0xe74c08['status'](_0x5343e6);return _0xe74c08['set']('Content-Range',_0x2ccd81+'-'+_0x117232+'/'+_0x48737a)[_0x6d69('0x16')](_0xc6cd18);}return null;};}function patchUpdates(_0x5a040b){return function(_0x42dad5){try{jsonpatch[_0x6d69('0x1b')](_0x42dad5,_0x5a040b,!![]);}catch(_0x26737d){return BPromise['reject'](_0x26737d);}return _0x42dad5['save']();};}function saveUpdates(_0x28e6b2,_0xc6269a){return function(_0x5c0310){if(_0x5c0310){return _0x5c0310[_0x6d69('0x1c')](_0x28e6b2)[_0x6d69('0x1d')](function(_0x5a4ed0){return _0x5a4ed0;});}return null;};}function removeEntity(_0x248f94,_0x21a666){return function(_0x3e40df){if(_0x3e40df){return _0x3e40df[_0x6d69('0x1e')]()[_0x6d69('0x1d')](function(){var _0x51bc3e=_0x3e40df['get']({'plain':!![]});var _0x3a9260=_0x6d69('0x1f');return db[_0x6d69('0x20')][_0x6d69('0x1e')]({'where':{'type':_0x3a9260,'resourceId':_0x51bc3e['id']}})['then'](function(){return _0x3e40df;});})[_0x6d69('0x1d')](function(){_0x248f94['status'](0xcc)[_0x6d69('0x15')]();});}};}function handleEntityNotFound(_0x148a7b,_0x27d99b){return function(_0x33fc1a){if(!_0x33fc1a){_0x148a7b[_0x6d69('0x21')](0x194);}return _0x33fc1a;};}function handleError(_0x1b1d20,_0x16dc76){_0x16dc76=_0x16dc76||0x1f4;return function(_0x26b50b){logger[_0x6d69('0x22')](_0x26b50b[_0x6d69('0x23')]);if(_0x26b50b[_0x6d69('0x24')]){delete _0x26b50b[_0x6d69('0x24')];}_0x1b1d20['status'](_0x16dc76)[_0x6d69('0x25')](_0x26b50b);};}exports[_0x6d69('0x26')]=function(_0x2d61e3,_0x3e57d9){var _0x5e8549={},_0x22ab05={},_0x4cecff={'count':0x0,'rows':[]};return db[_0x6d69('0x27')][_0x6d69('0x28')]()[_0x6d69('0x1d')](function(_0xa5a289){_0x22ab05[_0x6d69('0x29')]=_[_0x6d69('0x2a')](_0xa5a289);_0x22ab05[_0x6d69('0x2b')]=_[_0x6d69('0x2a')](_0x2d61e3[_0x6d69('0x2b')]);_0x22ab05[_0x6d69('0x2c')]=_[_0x6d69('0x2d')](_0x22ab05[_0x6d69('0x29')],_0x22ab05['query']);_0x5e8549[_0x6d69('0x2e')]=_[_0x6d69('0x2d')](_0x22ab05[_0x6d69('0x29')],qs['fields'](_0x2d61e3[_0x6d69('0x2b')][_0x6d69('0x2f')]));_0x5e8549[_0x6d69('0x2e')]=_0x5e8549[_0x6d69('0x2e')]['length']?_0x5e8549[_0x6d69('0x2e')]:_0x22ab05[_0x6d69('0x29')];if(!_0x2d61e3[_0x6d69('0x2b')][_0x6d69('0x30')](_0x6d69('0x31'))){_0x5e8549[_0x6d69('0x1a')]=qs[_0x6d69('0x1a')](_0x2d61e3['query'][_0x6d69('0x1a')]);_0x5e8549[_0x6d69('0x17')]=qs[_0x6d69('0x17')](_0x2d61e3[_0x6d69('0x2b')]['offset']);}_0x5e8549[_0x6d69('0x32')]=qs[_0x6d69('0x33')](_0x2d61e3['query']['sort']);_0x5e8549[_0x6d69('0x34')]=qs['filters'](_['pick'](_0x2d61e3[_0x6d69('0x2b')],_0x22ab05[_0x6d69('0x2c')]),_0xa5a289);if(_0x2d61e3[_0x6d69('0x2b')][_0x6d69('0x35')]){_0x5e8549[_0x6d69('0x34')]=_[_0x6d69('0x36')](_0x5e8549[_0x6d69('0x34')],{'$or':_['map'](_0x5e8549[_0x6d69('0x2e')],function(_0x6929f1){var _0x1b4a42={};_0x1b4a42[_0x6929f1]={'$like':'%'+_0x2d61e3[_0x6d69('0x2b')][_0x6d69('0x35')]+'%'};return _0x1b4a42;})});}_0x5e8549=_[_0x6d69('0x36')]({},_0x5e8549,_0x2d61e3[_0x6d69('0x37')]);var _0x2d3db0={'where':_0x5e8549['where']};return db['CmCompany'][_0x6d69('0x19')](_0x2d3db0)[_0x6d69('0x1d')](function(_0xf63aba){_0x4cecff['count']=_0xf63aba;if(_0x2d61e3['query'][_0x6d69('0x38')]){_0x5e8549[_0x6d69('0x39')]=[{'all':!![]}];}return db[_0x6d69('0x27')]['findAll'](_0x5e8549);})[_0x6d69('0x1d')](function(_0x1cd8f1){_0x4cecff[_0x6d69('0x3a')]=_0x1cd8f1;return _0x4cecff;})[_0x6d69('0x1d')](respondWithFilteredResult(_0x3e57d9,_0x5e8549))[_0x6d69('0x3b')](handleError(_0x3e57d9,null));})[_0x6d69('0x3b')](handleError(_0x3e57d9,null));};exports[_0x6d69('0x3c')]=function(_0x1bfd37,_0x3b3d48){var _0x5ab4a9={'raw':![],'where':{'id':_0x1bfd37[_0x6d69('0x3d')]['id']}},_0x5b977e={};_0x5b977e['model']=_[_0x6d69('0x2a')](db['CmCompany'][_0x6d69('0x3e')]);_0x5b977e[_0x6d69('0x2b')]=_['keys'](_0x1bfd37['query']);_0x5b977e[_0x6d69('0x2c')]=_['intersection'](_0x5b977e[_0x6d69('0x29')],_0x5b977e['query']);_0x5ab4a9[_0x6d69('0x2e')]=_[_0x6d69('0x2d')](_0x5b977e[_0x6d69('0x29')],qs[_0x6d69('0x2f')](_0x1bfd37['query'][_0x6d69('0x2f')]));_0x5ab4a9['attributes']=_0x5ab4a9['attributes'][_0x6d69('0x3f')]?_0x5ab4a9['attributes']:_0x5b977e['model'];if(_0x1bfd37[_0x6d69('0x2b')][_0x6d69('0x38')]){_0x5ab4a9['include']=[{'all':!![]}];}_0x5ab4a9=_[_0x6d69('0x36')]({},_0x5ab4a9,_0x1bfd37['options']);return db[_0x6d69('0x27')][_0x6d69('0x40')](_0x5ab4a9)[_0x6d69('0x1d')](handleEntityNotFound(_0x3b3d48,null))[_0x6d69('0x1d')](respondWithResult(_0x3b3d48,null))[_0x6d69('0x3b')](handleError(_0x3b3d48,null));};exports[_0x6d69('0x41')]=function(_0xaca25b,_0x52313a){return db[_0x6d69('0x27')]['create'](_0xaca25b['body'],{})[_0x6d69('0x1d')](function(_0x383a4b){var _0x9faba3=_0xaca25b[_0x6d69('0x42')][_0x6d69('0x43')]({'plain':!![]});if(!_0x9faba3)throw new Error(_0x6d69('0x44'));if(_0x9faba3[_0x6d69('0x45')]===_0x6d69('0x42')){var _0x4f8583=_0x383a4b[_0x6d69('0x43')]({'plain':!![]});var _0x345209=_0x6d69('0x1f');return db['UserProfileSection'][_0x6d69('0x40')]({'where':{'name':_0x345209,'userProfileId':_0x9faba3[_0x6d69('0x46')]},'raw':!![]})[_0x6d69('0x1d')](function(_0x3046b2){if(_0x3046b2&&_0x3046b2[_0x6d69('0x47')]===0x0){return db[_0x6d69('0x20')]['create']({'name':_0x4f8583['name'],'resourceId':_0x4f8583['id'],'type':_0x3046b2[_0x6d69('0x24')],'sectionId':_0x3046b2['id']},{})[_0x6d69('0x1d')](function(){return _0x383a4b;});}else{return _0x383a4b;}})['catch'](function(_0x3b4efe){logger[_0x6d69('0x22')](_0x6d69('0x48'),_0x3b4efe);throw _0x3b4efe;});}return _0x383a4b;})['then'](respondWithResult(_0x52313a,0xc9))['catch'](handleError(_0x52313a,null));};exports[_0x6d69('0x1c')]=function(_0x34ad17,_0x57edd7){if(_0x34ad17[_0x6d69('0x49')]['id']){delete _0x34ad17[_0x6d69('0x49')]['id'];}return db[_0x6d69('0x27')][_0x6d69('0x40')]({'where':{'id':_0x34ad17[_0x6d69('0x3d')]['id']}})[_0x6d69('0x1d')](handleEntityNotFound(_0x57edd7,null))[_0x6d69('0x1d')](saveUpdates(_0x34ad17[_0x6d69('0x49')],null))['then'](respondWithResult(_0x57edd7,null))[_0x6d69('0x3b')](handleError(_0x57edd7,null));};exports[_0x6d69('0x1e')]=function(_0x3e7999,_0x52fb18){return db[_0x6d69('0x27')]['find']({'where':{'id':_0x3e7999[_0x6d69('0x3d')]['id']}})[_0x6d69('0x1d')](handleEntityNotFound(_0x52fb18,null))[_0x6d69('0x1d')](removeEntity(_0x52fb18,null))[_0x6d69('0x3b')](handleError(_0x52fb18,null));};exports[_0x6d69('0x28')]=function(_0x530334,_0x158b89){return db[_0x6d69('0x27')][_0x6d69('0x28')]()[_0x6d69('0x1d')](respondWithResult(_0x158b89,null))[_0x6d69('0x3b')](handleError(_0x158b89,null));};exports[_0x6d69('0x4a')]=function(_0x2514e4,_0xcc064,_0x151d3a){return db[_0x6d69('0x4b')]['find']({'where':{'id':_0x2514e4[_0x6d69('0x3d')]['id']}})[_0x6d69('0x1d')](handleEntityNotFound(_0xcc064,null))['then'](function(_0x2bc09d){if(_0x2bc09d){return _0x2bc09d[_0x6d69('0x4a')](_0x2514e4[_0x6d69('0x49')]['ids'],_['omit'](_0x2514e4[_0x6d69('0x49')],[_0x6d69('0x4c'),'id'])||{});}})[_0x6d69('0x1d')](respondWithResult(_0xcc064,null))['catch'](handleError(_0xcc064,null));};exports[_0x6d69('0x4d')]=function(_0x399ea4,_0x1d264f,_0xf7ba7d){var _0x4706e4={};var _0xf1df6f={};var _0x430606;var _0xc6aa5e;return db[_0x6d69('0x27')]['findOne']({'where':{'id':_0x399ea4[_0x6d69('0x3d')]['id']}})[_0x6d69('0x1d')](handleEntityNotFound(_0x1d264f,null))['then'](function(_0x301531){if(_0x301531){_0x430606=_0x301531;_0xf1df6f[_0x6d69('0x29')]=_[_0x6d69('0x2a')](db[_0x6d69('0x4b')][_0x6d69('0x3e')]);_0xf1df6f[_0x6d69('0x2b')]=_['keys'](_0x399ea4[_0x6d69('0x2b')]);_0xf1df6f[_0x6d69('0x2c')]=_[_0x6d69('0x2d')](_0xf1df6f['model'],_0xf1df6f[_0x6d69('0x2b')]);_0x4706e4[_0x6d69('0x2e')]=_[_0x6d69('0x2d')](_0xf1df6f[_0x6d69('0x29')],qs[_0x6d69('0x2f')](_0x399ea4['query']['fields']));_0x4706e4[_0x6d69('0x2e')]=_0x4706e4[_0x6d69('0x2e')][_0x6d69('0x3f')]?_0x4706e4[_0x6d69('0x2e')]:_0xf1df6f['model'];_0x4706e4[_0x6d69('0x32')]=qs[_0x6d69('0x33')](_0x399ea4[_0x6d69('0x2b')]['sort']);_0x4706e4[_0x6d69('0x34')]=qs['filters'](_[_0x6d69('0x4e')](_0x399ea4[_0x6d69('0x2b')],_0xf1df6f['filters']));if(_0x399ea4[_0x6d69('0x2b')][_0x6d69('0x35')]){_0x4706e4[_0x6d69('0x34')]=_[_0x6d69('0x36')](_0x4706e4[_0x6d69('0x34')],{'$or':_[_0x6d69('0x4f')](_0x4706e4[_0x6d69('0x2e')],function(_0x141dda){var _0x27b4e8={};_0x27b4e8[_0x141dda]={'$like':'%'+_0x399ea4['query'][_0x6d69('0x35')]+'%'};return _0x27b4e8;})});}_0x4706e4=_[_0x6d69('0x36')]({},_0x4706e4,_0x399ea4[_0x6d69('0x37')]);return _0x430606[_0x6d69('0x4d')](_0x4706e4);}})[_0x6d69('0x1d')](function(_0x578504){if(_0x578504){_0xc6aa5e=_0x578504[_0x6d69('0x3f')];if(!_0x399ea4[_0x6d69('0x2b')][_0x6d69('0x30')](_0x6d69('0x31'))){_0x4706e4['limit']=qs[_0x6d69('0x1a')](_0x399ea4['query'][_0x6d69('0x1a')]);_0x4706e4[_0x6d69('0x17')]=qs[_0x6d69('0x17')](_0x399ea4[_0x6d69('0x2b')][_0x6d69('0x17')]);}return _0x430606[_0x6d69('0x4d')](_0x4706e4);}})[_0x6d69('0x1d')](function(_0x5ed1a5){if(_0x5ed1a5){return _0x5ed1a5?{'count':_0xc6aa5e,'rows':_0x5ed1a5}:null;}})[_0x6d69('0x1d')](respondWithResult(_0x1d264f,null))[_0x6d69('0x3b')](handleError(_0x1d264f,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 770c07a..e022062 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 _0x0f11=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0x0f11,0xd1));var _0x10f1=function(_0x2e8e60,_0x2f4b7c){_0x2e8e60=_0x2e8e60-0x0;var _0x660c09=_0x0f11[_0x2e8e60];return _0x660c09;};'use strict';var _=require(_0x10f1('0x0'));var util=require(_0x10f1('0x1'));var logger=require(_0x10f1('0x2'))(_0x10f1('0x3'));var moment=require(_0x10f1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x10f1('0x5'));var rimraf=require('rimraf');var config=require(_0x10f1('0x6'));var attributes=require(_0x10f1('0x7'));module[_0x10f1('0x8')]=function(_0x14a004,_0x321459){return _0x14a004[_0x10f1('0x9')](_0x10f1('0xa'),attributes,{'tableName':_0x10f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc93c=['request-promise','path','../../config/environment','exports','define','CmCompany','cm_companies','lodash','../../config/logger','bluebird'];(function(_0x5010c2,_0x5cdf1b){var _0xc37993=function(_0x5f4405){while(--_0x5f4405){_0x5010c2['push'](_0x5010c2['shift']());}};_0xc37993(++_0x5cdf1b);}(_0xc93c,0xbb));var _0xcc93=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc93c[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xcc93('0x0'));var util=require('util');var logger=require(_0xcc93('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcc93('0x2'));var rp=require(_0xcc93('0x3'));var fs=require('fs');var path=require(_0xcc93('0x4'));var rimraf=require('rimraf');var config=require(_0xcc93('0x5'));var attributes=require('./cmCompany.attributes');module[_0xcc93('0x6')]=function(_0x3357d0,_0x487486){return _0x3357d0[_0xcc93('0x7')](_0xcc93('0x8'),attributes,{'tableName':_0xcc93('0x9'),'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 bebd69c..5adc395 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 _0x543d=['CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x543d,0x159));var _0xd543=function(_0xdf5462,_0x66522a){_0xdf5462=_0xdf5462-0x0;var _0x12bcb0=_0x543d[_0xdf5462];return _0x12bcb0;};'use strict';var _=require(_0xd543('0x0'));var util=require(_0xd543('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd543('0x2'));var fs=require('fs');var Redis=require(_0xd543('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd543('0x4'))(_0xd543('0x5'));var config=require(_0xd543('0x6'));var jayson=require(_0xd543('0x7'));var client=jayson['client'][_0xd543('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fe03f,_0x16aa31,_0x50c672){return new BPromise(function(_0xeaaf6d,_0x33f750){return client[_0xd543('0x9')](_0x4fe03f,_0x50c672)[_0xd543('0xa')](function(_0x4d50b6){logger[_0xd543('0xb')](_0xd543('0xc'),_0x16aa31,'request\x20sent');logger[_0xd543('0xd')](_0xd543('0xe'),_0x16aa31,_0xd543('0xf'),JSON['stringify'](_0x4d50b6));if(_0x4d50b6[_0xd543('0x10')]){if(_0x4d50b6[_0xd543('0x10')][_0xd543('0x11')]===0x1f4){logger[_0xd543('0x10')](_0xd543('0xc'),_0x16aa31,_0x4d50b6[_0xd543('0x10')][_0xd543('0x12')]);return _0x33f750(_0x4d50b6[_0xd543('0x10')][_0xd543('0x12')]);}logger[_0xd543('0x10')](_0xd543('0xc'),_0x16aa31,_0x4d50b6[_0xd543('0x10')][_0xd543('0x12')]);return _0xeaaf6d(_0x4d50b6['error'][_0xd543('0x12')]);}else{logger[_0xd543('0xb')]('CmCompany,\x20%s,\x20%s',_0x16aa31,'request\x20sent');_0xeaaf6d(_0x4d50b6[_0xd543('0x13')][_0xd543('0x12')]);}})[_0xd543('0x14')](function(_0x434619){logger[_0xd543('0x10')](_0xd543('0xc'),_0x16aa31,_0x434619);_0x33f750(_0x434619);});});}
\ No newline at end of file
+var _0xde42=['stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x146dcd,_0x1b6e84){var _0x2ccc6c=function(_0x56e401){while(--_0x56e401){_0x146dcd['push'](_0x146dcd['shift']());}};_0x2ccc6c(++_0x1b6e84);}(_0xde42,0x1ea));var _0x2de4=function(_0x1d98da,_0x532964){_0x1d98da=_0x1d98da-0x0;var _0x2a56f2=_0xde42[_0x1d98da];return _0x2a56f2;};'use strict';var _=require('lodash');var util=require(_0x2de4('0x0'));var moment=require(_0x2de4('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2de4('0x2'))['db'];var utils=require(_0x2de4('0x3'));var logger=require(_0x2de4('0x4'))(_0x2de4('0x5'));var config=require(_0x2de4('0x6'));var jayson=require(_0x2de4('0x7'));var client=jayson[_0x2de4('0x8')][_0x2de4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e39e9,_0x2c690c,_0x4b6a08){return new BPromise(function(_0x50c525,_0x4a9414){return client[_0x2de4('0xa')](_0x1e39e9,_0x4b6a08)['then'](function(_0x3f652a){logger[_0x2de4('0xb')](_0x2de4('0xc'),_0x2c690c,_0x2de4('0xd'));logger[_0x2de4('0xe')](_0x2de4('0xf'),_0x2c690c,_0x2de4('0xd'),JSON[_0x2de4('0x10')](_0x3f652a));if(_0x3f652a['error']){if(_0x3f652a[_0x2de4('0x11')][_0x2de4('0x12')]===0x1f4){logger[_0x2de4('0x11')](_0x2de4('0xc'),_0x2c690c,_0x3f652a[_0x2de4('0x11')]['message']);return _0x4a9414(_0x3f652a[_0x2de4('0x11')][_0x2de4('0x13')]);}logger[_0x2de4('0x11')](_0x2de4('0xc'),_0x2c690c,_0x3f652a['error'][_0x2de4('0x13')]);return _0x50c525(_0x3f652a[_0x2de4('0x11')][_0x2de4('0x13')]);}else{logger[_0x2de4('0xb')](_0x2de4('0xc'),_0x2c690c,_0x2de4('0xd'));_0x50c525(_0x3f652a[_0x2de4('0x14')][_0x2de4('0x13')]);}})[_0x2de4('0x15')](function(_0x5a2554){logger[_0x2de4('0x11')](_0x2de4('0xc'),_0x2c690c,_0x5a2554);_0x4a9414(_0x5a2554);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index ac8f0fb..2b31e89 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 _0x5232=['/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xb165dd,_0x34087b){var _0x3c6f73=function(_0x57b889){while(--_0x57b889){_0xb165dd['push'](_0xb165dd['shift']());}};_0x3c6f73(++_0x34087b);}(_0x5232,0xc0));var _0x2523=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x5232[_0x209fcd];return _0x501d5e;};'use strict';var multer=require(_0x2523('0x0'));var util=require(_0x2523('0x1'));var path=require(_0x2523('0x2'));var timeout=require(_0x2523('0x3'));var express=require(_0x2523('0x4'));var router=express[_0x2523('0x5')]();var fs_extra=require(_0x2523('0x6'));var auth=require(_0x2523('0x7'));var interaction=require(_0x2523('0x8'));var config=require('../../config/environment');var controller=require(_0x2523('0x9'));router[_0x2523('0xa')]('/',auth[_0x2523('0xb')](),controller[_0x2523('0xc')]);router['get'](_0x2523('0xd'),auth['isAuthenticated'](),controller[_0x2523('0xe')]);router['get'](_0x2523('0xf'),auth[_0x2523('0xb')](),controller['show']);router[_0x2523('0xa')](_0x2523('0x10'),auth[_0x2523('0xb')](),controller[_0x2523('0x11')]);router[_0x2523('0x12')]('/',auth[_0x2523('0xb')](),controller[_0x2523('0x13')]);router[_0x2523('0x12')]('/:id/contacts',auth[_0x2523('0xb')](),controller[_0x2523('0x14')]);router[_0x2523('0x15')](_0x2523('0xf'),auth['isAuthenticated'](),controller[_0x2523('0x16')]);router[_0x2523('0x17')](_0x2523('0xf'),auth[_0x2523('0xb')](),controller[_0x2523('0x18')]);module[_0x2523('0x19')]=router;
\ No newline at end of file
+var _0x9ea6=['post','create','addContacts','delete','/:id','destroy','exports','multer','util','Router','fs-extra','./cmCompany.controller','index','/describe','describe','get','isAuthenticated','show','/:id/contacts','getContacts'];(function(_0x3fbdf0,_0x420bca){var _0x22501b=function(_0x40b327){while(--_0x40b327){_0x3fbdf0['push'](_0x3fbdf0['shift']());}};_0x22501b(++_0x420bca);}(_0x9ea6,0x15b));var _0x69ea=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9ea6[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x69ea('0x0'));var util=require(_0x69ea('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x69ea('0x2')]();var fs_extra=require(_0x69ea('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x69ea('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x69ea('0x5')]);router['get'](_0x69ea('0x6'),auth['isAuthenticated'](),controller[_0x69ea('0x7')]);router[_0x69ea('0x8')]('/:id',auth[_0x69ea('0x9')](),controller[_0x69ea('0xa')]);router[_0x69ea('0x8')](_0x69ea('0xb'),auth[_0x69ea('0x9')](),controller[_0x69ea('0xc')]);router[_0x69ea('0xd')]('/',auth['isAuthenticated'](),controller[_0x69ea('0xe')]);router[_0x69ea('0xd')]('/:id/contacts',auth[_0x69ea('0x9')](),controller[_0x69ea('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x69ea('0x10')](_0x69ea('0x11'),auth[_0x69ea('0x9')](),controller[_0x69ea('0x12')]);module[_0x69ea('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 01d2cc0..56aa848 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 _0x8d90=['TEXT','INTEGER','UNSIGNED','lodash','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8d90,0x141));var _0x08d9=function(_0x208e36,_0x21ef62){_0x208e36=_0x208e36-0x0;var _0x102757=_0x8d90[_0x208e36];return _0x102757;};'use strict';var _=require(_0x08d9('0x0'));var Sequelize=require('sequelize');module[_0x08d9('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x08d9('0x2')]},'street':{'type':Sequelize[_0x08d9('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x08d9('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x08d9('0x3')]},'phone':{'type':Sequelize[_0x08d9('0x2')]},'mobile':{'type':Sequelize[_0x08d9('0x2')]},'fax':{'type':Sequelize[_0x08d9('0x2')]},'email':{'type':Sequelize[_0x08d9('0x2')]},'url':{'type':Sequelize[_0x08d9('0x2')]},'facebook':{'type':Sequelize[_0x08d9('0x2')]},'fb_data':{'type':Sequelize[_0x08d9('0x2')]},'twitter':{'type':Sequelize[_0x08d9('0x2')]},'skype':{'type':Sequelize[_0x08d9('0x2')]},'teams':{'type':Sequelize[_0x08d9('0x2')]},'viber':{'type':Sequelize[_0x08d9('0x2')]},'line':{'type':Sequelize[_0x08d9('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x08d9('0x2')]},'UserId':{'type':Sequelize[_0x08d9('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x08d9('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x08d9('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x08d9('0x2')]},'utcOffset':{'type':Sequelize[_0x08d9('0x4')]}};
\ No newline at end of file
+var _0x536d=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0x536d,0x111));var _0xd536=function(_0x2aa4b2,_0x569a93){_0x2aa4b2=_0x2aa4b2-0x0;var _0x5301ae=_0x536d[_0x2aa4b2];return _0x5301ae;};'use strict';var _=require(_0xd536('0x0'));var Sequelize=require(_0xd536('0x1'));module[_0xd536('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xd536('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd536('0x3')]},'city':{'type':Sequelize[_0xd536('0x3')]},'country':{'type':Sequelize[_0xd536('0x3')]},'dateOfBirth':{'type':Sequelize[_0xd536('0x3')]},'description':{'type':Sequelize[_0xd536('0x4')]},'phone':{'type':Sequelize[_0xd536('0x3')]},'mobile':{'type':Sequelize[_0xd536('0x3')]},'fax':{'type':Sequelize[_0xd536('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xd536('0x3')]},'facebook':{'type':Sequelize[_0xd536('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xd536('0x3')]},'skype':{'type':Sequelize[_0xd536('0x3')]},'teams':{'type':Sequelize[_0xd536('0x3')]},'viber':{'type':Sequelize[_0xd536('0x3')]},'line':{'type':Sequelize[_0xd536('0x3')]},'wechat':{'type':Sequelize[_0xd536('0x3')]},'telegram':{'type':Sequelize[_0xd536('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xd536('0x3')]},'priority':{'type':Sequelize[_0xd536('0x5')](0x2)[_0xd536('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd536('0x7')],'defaultValue':Sequelize[_0xd536('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index c97eee8..aa3296e 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 _0x8ca9=['MailInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','dialTimezone','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','hasOwnProperty','contact','all','Tag','Tags','color','tag','Phones','ContactItemType','sequelize','literal','$and','omit','map','format','isNil','timezones','pickBy','cf_%d','isEmpty','table','cm_contacts','setFields','toParam','text','phone','getTags','findOne','rawAttributes','filters','intersection','model','attributes','order','sort','pick','filter','options','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','item','ItemType','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','`ItemType`.OrderBy','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','fields','ContactId','includeAll','include','rows','getHopperHistories','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','parse','meta','User','agent','binding','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','Invalid\x20channel','range','uniqueid','type','source','destination','callerid','starttime','note','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','startCase','chat','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','Interaction','Owner','sortBy','reverse','slice','moment','util','path','squel','papaparse','ioredis','../../components/contacts','api','../../config/environment/shared','defaults','socket.io-emitter','redis','./cmContact.socket','status','offset','undefined','limit','count','Content-Range','json','update','then','destroy','error','stack','name','send','index','describe','findAll','query','user','CmContact','find','params','catch','keys','length','startsWith','cf_','columnName','CmCustomField','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','mergeWith','isArray','tags','join','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage'];(function(_0x1feb2d,_0x3cdb25){var _0x3d27b7=function(_0xf37cd1){while(--_0xf37cd1){_0x1feb2d['push'](_0x1feb2d['shift']());}};_0x3d27b7(++_0x3cdb25);}(_0x8ca9,0x1a1));var _0x98ca=function(_0x24b948,_0x1b2ddc){_0x24b948=_0x24b948-0x0;var _0x2d38ec=_0x8ca9[_0x24b948];return _0x2d38ec;};'use strict';var moment=require(_0x98ca('0x0'));var BPromise=require('bluebird');var util=require(_0x98ca('0x1'));var path=require(_0x98ca('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x98ca('0x3'));var Papa=require(_0x98ca('0x4'));var Redis=require(_0x98ca('0x5'));var contacts=require(_0x98ca('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x98ca('0x7'));var config=require('../../config/environment');var shared=require(_0x98ca('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x98ca('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x98ca('0xa'))(new Redis(config[_0x98ca('0xb')]));require(_0x98ca('0xc'))['register'](socket);function respondWithResult(_0x499956,_0x43f7c0){_0x43f7c0=_0x43f7c0||0xc8;return function(_0x493431){if(_0x493431){return _0x499956[_0x98ca('0xd')](_0x43f7c0)['json'](_0x493431);}};}function respondWithFilteredResult(_0x5172a0,_0x2fb0ea){return function(_0x1f4df3){if(_0x1f4df3){var _0x45d6cb=typeof _0x2fb0ea[_0x98ca('0xe')]===_0x98ca('0xf')&&typeof _0x2fb0ea[_0x98ca('0x10')]===_0x98ca('0xf');var _0x39eff1=_0x1f4df3[_0x98ca('0x11')];var _0x3014c6=_0x45d6cb?0x0:_0x2fb0ea[_0x98ca('0xe')];var _0xc2bc01=_0x45d6cb?_0x1f4df3['count']:_0x2fb0ea[_0x98ca('0xe')]+_0x2fb0ea['limit'];var _0x149e9e;if(_0xc2bc01>=_0x39eff1){_0xc2bc01=_0x39eff1;_0x149e9e=0xc8;}else{_0x149e9e=0xce;}_0x5172a0[_0x98ca('0xd')](_0x149e9e);return _0x5172a0['set'](_0x98ca('0x12'),_0x3014c6+'-'+_0xc2bc01+'/'+_0x39eff1)[_0x98ca('0x13')](_0x1f4df3);}return null;};}function saveUpdates(_0xa92d5){return function(_0x1b43cc){if(_0x1b43cc){return _0x1b43cc[_0x98ca('0x14')](_0xa92d5)[_0x98ca('0x15')](function(_0x1a23db){return _0x1a23db;});}return null;};}function removeEntity(_0xa1a3eb){return function(_0x4d31db){if(_0x4d31db){return _0x4d31db[_0x98ca('0x16')]()[_0x98ca('0x15')](function(){_0xa1a3eb[_0x98ca('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ae4f9){return function(_0x49ec61){if(!_0x49ec61){_0x3ae4f9['sendStatus'](0x194);}return _0x49ec61;};}function handleError(_0x290ade,_0x305548){_0x305548=_0x305548||0x1f4;return function(_0x22c6c0){logger[_0x98ca('0x17')](_0x22c6c0[_0x98ca('0x18')]);if(_0x22c6c0[_0x98ca('0x19')]){delete _0x22c6c0['name'];}_0x290ade[_0x98ca('0xd')](_0x305548)[_0x98ca('0x1a')](_0x22c6c0);};}exports[_0x98ca('0x1b')]=function(_0x4bac1c,_0x4d60fc){var _0x218ae5={};return contacts[_0x98ca('0x1c')]()['then'](function(_0x13157c){_0x218ae5=qs['getOptions'](_0x13157c,_0x4bac1c);return contacts[_0x98ca('0x1d')](_0x4bac1c[_0x98ca('0x1e')],_0x4bac1c[_0x98ca('0x1f')],_0x218ae5,_0x13157c);})[_0x98ca('0x15')](respondWithFilteredResult(_0x4d60fc,_0x218ae5))['catch'](handleError(_0x4d60fc,null));};exports[_0x98ca('0x16')]=function(_0x54645e,_0x496773){return db[_0x98ca('0x20')][_0x98ca('0x21')]({'where':{'id':_0x54645e[_0x98ca('0x22')]['id']}})['then'](handleEntityNotFound(_0x496773,null))[_0x98ca('0x15')](removeEntity(_0x496773,null))[_0x98ca('0x23')](handleError(_0x496773,null));};exports[_0x98ca('0x1c')]=function(_0x19cad1,_0x3d6da9){return db[_0x98ca('0x20')]['describe']()['then'](function(_0x28041e){delete _0x28041e['tags'];for(var _0x2634db=0x0;_0x2634db
','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','base64','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value'];(function(_0x11b1c5,_0x2a6643){var _0x2f904e=function(_0x307551){while(--_0x307551){_0x11b1c5['push'](_0x11b1c5['shift']());}};_0x2f904e(++_0x2a6643);}(_0xe7ba,0x113));var _0xae7b=function(_0x4ed188,_0x340955){_0x4ed188=_0x4ed188-0x0;var _0x58b488=_0xe7ba[_0x4ed188];return _0x58b488;};'use strict';var _=require(_0xae7b('0x0'));var moment=require('moment');var random=require(_0xae7b('0x1'));var fs=require('fs');var path=require(_0xae7b('0x2'));var util=require(_0xae7b('0x3'));var tnef=require(_0xae7b('0x4'));var logger=require(_0xae7b('0x5'))(_0xae7b('0x6'));var config=require(_0xae7b('0x7'));function getAddress(_0x2a4468){var _0x59b348=_['head'](_0x2a4468[_0xae7b('0x8')]);return _0x59b348&&_0x59b348[_0xae7b('0x9')]?_0x59b348[_0xae7b('0x9')]:'anonymous'+random[_0xae7b('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x21fb70){var _0x507376=_['head'](_0x21fb70[_0xae7b('0x8')]);if(_0x507376&&_0x507376[_0xae7b('0xb')]){if(_0x507376[_0xae7b('0xb')]==_0x507376['address']){return _0x507376['name'][_0xae7b('0xc')](0x0,_0x507376[_0xae7b('0xb')][_0xae7b('0xd')]('@'));}var _0x5a5dc1=_0x507376[_0xae7b('0xb')][_0xae7b('0xe')](/\s+/);return _0x5a5dc1['length']>0x1?_0x5a5dc1[_0xae7b('0xf')](0x0,-0x1)[_0xae7b('0x10')]('\x20'):_0x507376[_0xae7b('0xb')];}return _0xae7b('0x11');}function getLastName(_0x242c34){var _0x558dd5=_[_0xae7b('0x12')](_0x242c34['value']);if(_0x558dd5&&_0x558dd5[_0xae7b('0xb')]){var _0x2a27a2=_0x558dd5[_0xae7b('0xb')]['split'](/\s+/);return _0x2a27a2[_0xae7b('0x13')]>0x1?_0x2a27a2[_0xae7b('0x14')]():'';}return'';}function getMails(_0x3c0a22,_0x5dfc8f){var _0x4b577f='';for(var _0x288059=0x0;_0x288059<_0x5dfc8f[_0xae7b('0x8')][_0xae7b('0x13')];_0x288059+=0x1){if(_0x5dfc8f[_0xae7b('0x8')][_0x288059]['address']!==_0x3c0a22){if(!_[_0xae7b('0x15')](_0x4b577f)){_0x4b577f+=',';}_0x4b577f+=_0x5dfc8f[_0xae7b('0x8')][_0x288059][_0xae7b('0xb')]||_0x5dfc8f[_0xae7b('0x8')][_0x288059][_0xae7b('0x9')]||'';_0x4b577f+='\x20<';_0x4b577f+=_0x5dfc8f[_0xae7b('0x8')][_0x288059][_0xae7b('0x9')]?_0x5dfc8f[_0xae7b('0x8')][_0x288059][_0xae7b('0x9')]:_0xae7b('0x16')+random[_0xae7b('0xa')](0x6)+_0xae7b('0x17');_0x4b577f+='>';}}return _0x4b577f;}function parseEmail(_0xd02bfc,_0x580497,_0x2da0a3){if(_0x580497[_0xae7b('0x18')]){var _0x1caeed=/