From: support
Date: Tue, 5 Apr 2022 07:23:15 +0000 (+0000)
Subject: Built motion from commit 54cdaf16.|2.6.6
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22javascript:void%28%27%7BtitleJs%7D%27%29/%22%22%29%20%27?a=commitdiff_plain;h=15ceaf62c6a3e6d3191c466d82848d57f5289b0a;p=motion2.git
Built motion from commit 54cdaf16.|2.6.6
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index a7709f9..1787d93 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-04T07:35:44.153Z",
+ "time": "2022-04-05T07:13:16.004Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index d3ebfc4..fd00633 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-04T07:35:44.153Z",
+ "time": "2022-04-05T07:13:16.004Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/package.json b/package.json
index 4868cbe..faf35dd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.7",
+ "version": "2.6.6",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index b9ecbfe..5e6d606 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 _0x6a4f=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[headers],\x20browser[wsindowHeight]','exports','VIRTUAL','getDataValue','contactManager','integration','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x2678d6,_0x4e2001){var _0x475503=function(_0x34b23d){while(--_0x34b23d){_0x2678d6['push'](_0x2678d6['shift']());}};_0x475503(++_0x4e2001);}(_0x6a4f,0x17d));var _0xf6a4=function(_0xaaf083,_0x4b75cf){_0xaaf083=_0xaaf083-0x0;var _0x203df4=_0x6a4f[_0xaaf083];return _0x203df4;};'use strict';var Sequelize=require('sequelize');module[_0xf6a4('0x0')]={'name':{'type':Sequelize[_0xf6a4('0x1')],'get':function(_0x5c91aa){return this[_0xf6a4('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xf6a4('0x3'),_0xf6a4('0x4'),'motionbar',_0xf6a4('0x5'),_0xf6a4('0x6'),'browser',_0xf6a4('0x7'),_0xf6a4('0x8')]],'msg':_0xf6a4('0x9')}},'comment':_0xf6a4('0x9')},'data1':{'type':Sequelize[_0xf6a4('0xa')](0x1000),'comment':_0xf6a4('0xb')},'data2':{'type':Sequelize[_0xf6a4('0xa')](0x1000),'comment':_0xf6a4('0xc')},'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[_0xf6a4('0xa')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xf6a4('0xa')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xf6a4('0xa')],'comments':_0xf6a4('0xd')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x4f94=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','bot'];(function(_0x1eb4e0,_0x4ebc2d){var _0x18ec21=function(_0x28c9a9){while(--_0x28c9a9){_0x1eb4e0['push'](_0x1eb4e0['shift']());}};_0x18ec21(++_0x4ebc2d);}(_0x4f94,0x1a9));var _0x44f9=function(_0x23a8e3,_0x3a26ac){_0x23a8e3=_0x23a8e3-0x0;var _0x5d3e58=_0x4f94[_0x23a8e3];return _0x5d3e58;};'use strict';var Sequelize=require(_0x44f9('0x0'));module[_0x44f9('0x1')]={'name':{'type':Sequelize[_0x44f9('0x2')],'get':function(_0x477bca){return this[_0x44f9('0x3')](_0x44f9('0x4'));}},'action':{'type':Sequelize[_0x44f9('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x44f9('0x6'),_0x44f9('0x7'),_0x44f9('0x8'),'jscripty','urlForward','browser',_0x44f9('0x9'),_0x44f9('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x44f9('0xb')},'data1':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comment':_0x44f9('0xc')},'data4':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comments':_0x44f9('0xd')},'data5':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x44f9('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x44f9('0xe')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 975ea89..cbc8ef9 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 _0x3d4f=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','end','error','name','send','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x29915f,_0x47cf5f){var _0x418b5c=function(_0x40c350){while(--_0x40c350){_0x29915f['push'](_0x29915f['shift']());}};_0x418b5c(++_0x47cf5f);}(_0x3d4f,0x17f));var _0xf3d4=function(_0x3fdae4,_0x16182d){_0x3fdae4=_0x3fdae4-0x0;var _0x5c4538=_0x3d4f[_0x3fdae4];return _0x5c4538;};'use strict';var emlformat=require(_0xf3d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3d4('0x1'));var jsonpatch=require(_0xf3d4('0x2'));var rp=require(_0xf3d4('0x3'));var moment=require(_0xf3d4('0x4'));var BPromise=require(_0xf3d4('0x5'));var Mustache=require(_0xf3d4('0x6'));var util=require(_0xf3d4('0x7'));var path=require('path');var sox=require(_0xf3d4('0x8'));var csv=require(_0xf3d4('0x9'));var ejs=require(_0xf3d4('0xa'));var fs=require('fs');var fs_extra=require(_0xf3d4('0xb'));var _=require(_0xf3d4('0xc'));var squel=require('squel');var crypto=require(_0xf3d4('0xd'));var jsforce=require(_0xf3d4('0xe'));var deskjs=require(_0xf3d4('0xf'));var toCsv=require(_0xf3d4('0x9'));var querystring=require(_0xf3d4('0x10'));var Papa=require(_0xf3d4('0x11'));var Redis=require(_0xf3d4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf3d4('0x13'));var as=require(_0xf3d4('0x14'));var hardwareService=require(_0xf3d4('0x15'));var logger=require(_0xf3d4('0x16'))(_0xf3d4('0x17'));var utils=require(_0xf3d4('0x18'));var config=require(_0xf3d4('0x19'));var licenseUtil=require(_0xf3d4('0x1a'));var db=require(_0xf3d4('0x1b'))['db'];function respondWithStatusCode(_0x432d0f,_0x5ac29e){_0x5ac29e=_0x5ac29e||0xcc;return function(_0x3a640b){if(_0x3a640b){return _0x432d0f[_0xf3d4('0x1c')](_0x5ac29e);}return _0x432d0f[_0xf3d4('0x1d')](_0x5ac29e)['end']();};}function respondWithResult(_0x5d0e73,_0x75909a){_0x75909a=_0x75909a||0xc8;return function(_0x2e901b){if(_0x2e901b){return _0x5d0e73[_0xf3d4('0x1d')](_0x75909a)['json'](_0x2e901b);}};}function respondWithFilteredResult(_0x4c0d84,_0x45dbf1){return function(_0x259dac){if(_0x259dac){var _0x1102c8=typeof _0x45dbf1[_0xf3d4('0x1e')]==='undefined'&&typeof _0x45dbf1[_0xf3d4('0x1f')]===_0xf3d4('0x20');var _0x40eb5f=_0x259dac[_0xf3d4('0x21')];var _0x57d763=_0x1102c8?0x0:_0x45dbf1['offset'];var _0xc3009c=_0x1102c8?_0x259dac[_0xf3d4('0x21')]:_0x45dbf1[_0xf3d4('0x1e')]+_0x45dbf1[_0xf3d4('0x1f')];var _0x598b91;if(_0xc3009c>=_0x40eb5f){_0xc3009c=_0x40eb5f;_0x598b91=0xc8;}else{_0x598b91=0xce;}_0x4c0d84[_0xf3d4('0x1d')](_0x598b91);return _0x4c0d84[_0xf3d4('0x22')](_0xf3d4('0x23'),_0x57d763+'-'+_0xc3009c+'/'+_0x40eb5f)[_0xf3d4('0x24')](_0x259dac);}return null;};}function patchUpdates(_0x382cf6){return function(_0x250f80){try{jsonpatch['apply'](_0x250f80,_0x382cf6,!![]);}catch(_0x5b7812){return BPromise[_0xf3d4('0x25')](_0x5b7812);}return _0x250f80['save']();};}function saveUpdates(_0x351bde,_0x3b2a57){return function(_0x55a0d6){if(_0x55a0d6){return _0x55a0d6[_0xf3d4('0x26')](_0x351bde)[_0xf3d4('0x27')](function(_0x417912){return _0x417912;});}return null;};}function removeEntity(_0x2895ff,_0x5a408b){return function(_0x143551){if(_0x143551){return _0x143551[_0xf3d4('0x28')]()['then'](function(){_0x2895ff[_0xf3d4('0x1d')](0xcc)[_0xf3d4('0x29')]();});}};}function handleEntityNotFound(_0x5ee4ce,_0x4a29a9){return function(_0xd28e8a){if(!_0xd28e8a){_0x5ee4ce[_0xf3d4('0x1c')](0x194);}return _0xd28e8a;};}function handleError(_0x19b679,_0x5b9c61){_0x5b9c61=_0x5b9c61||0x1f4;return function(_0x437454){logger[_0xf3d4('0x2a')](_0x437454['stack']);if(_0x437454[_0xf3d4('0x2b')]){delete _0x437454[_0xf3d4('0x2b')];}_0x19b679['status'](_0x5b9c61)[_0xf3d4('0x2c')](_0x437454);};}exports[_0xf3d4('0x26')]=function(_0x3531f0,_0x7f288f){if(_0x3531f0[_0xf3d4('0x2d')]['id']){delete _0x3531f0[_0xf3d4('0x2d')]['id'];}return db[_0xf3d4('0x2e')][_0xf3d4('0x2f')]({'where':{'id':_0x3531f0[_0xf3d4('0x30')]['id']}})['then'](handleEntityNotFound(_0x7f288f,null))['then'](saveUpdates(_0x3531f0[_0xf3d4('0x2d')],null))[_0xf3d4('0x27')](respondWithResult(_0x7f288f,null))[_0xf3d4('0x31')](handleError(_0x7f288f,null));};exports[_0xf3d4('0x28')]=function(_0x2a0ba9,_0x34c5a6){return db[_0xf3d4('0x2e')][_0xf3d4('0x2f')]({'where':{'id':_0x2a0ba9['params']['id']}})['then'](handleEntityNotFound(_0x34c5a6,null))[_0xf3d4('0x27')](removeEntity(_0x34c5a6,null))[_0xf3d4('0x31')](handleError(_0x34c5a6,null));};
\ No newline at end of file
+var _0x2714=['sendStatus','error','name','body','Action','find','params','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy'];(function(_0xcb016b,_0x54f052){var _0x187501=function(_0x59d61f){while(--_0x59d61f){_0xcb016b['push'](_0xcb016b['shift']());}};_0x187501(++_0x54f052);}(_0x2714,0x178));var _0x4271=function(_0x3673ee,_0x37b638){_0x3673ee=_0x3673ee-0x0;var _0x7a5b8d=_0x2714[_0x3673ee];return _0x7a5b8d;};'use strict';var emlformat=require(_0x4271('0x0'));var rimraf=require(_0x4271('0x1'));var zipdir=require(_0x4271('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4271('0x3'));var moment=require(_0x4271('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4271('0x5'));var util=require(_0x4271('0x6'));var path=require('path');var sox=require(_0x4271('0x7'));var csv=require('to-csv');var ejs=require(_0x4271('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4271('0x9'));var squel=require(_0x4271('0xa'));var crypto=require('crypto');var jsforce=require(_0x4271('0xb'));var deskjs=require(_0x4271('0xc'));var toCsv=require(_0x4271('0xd'));var querystring=require(_0x4271('0xe'));var Papa=require(_0x4271('0xf'));var Redis=require(_0x4271('0x10'));var authService=require(_0x4271('0x11'));var qs=require(_0x4271('0x12'));var as=require(_0x4271('0x13'));var hardwareService=require(_0x4271('0x14'));var logger=require(_0x4271('0x15'))(_0x4271('0x16'));var utils=require(_0x4271('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4271('0x18'))['db'];function respondWithStatusCode(_0x1ce90c,_0x535c57){_0x535c57=_0x535c57||0xcc;return function(_0x4bee4b){if(_0x4bee4b){return _0x1ce90c['sendStatus'](_0x535c57);}return _0x1ce90c['status'](_0x535c57)[_0x4271('0x19')]();};}function respondWithResult(_0x493d40,_0xb24ae8){_0xb24ae8=_0xb24ae8||0xc8;return function(_0x126e0a){if(_0x126e0a){return _0x493d40[_0x4271('0x1a')](_0xb24ae8)[_0x4271('0x1b')](_0x126e0a);}};}function respondWithFilteredResult(_0x4a64b4,_0x25b99a){return function(_0x3fe4a2){if(_0x3fe4a2){var _0x1e09ae=typeof _0x25b99a['offset']===_0x4271('0x1c')&&typeof _0x25b99a[_0x4271('0x1d')]===_0x4271('0x1c');var _0x87d981=_0x3fe4a2[_0x4271('0x1e')];var _0x538645=_0x1e09ae?0x0:_0x25b99a[_0x4271('0x1f')];var _0x3081de=_0x1e09ae?_0x3fe4a2['count']:_0x25b99a['offset']+_0x25b99a['limit'];var _0x22b9f3;if(_0x3081de>=_0x87d981){_0x3081de=_0x87d981;_0x22b9f3=0xc8;}else{_0x22b9f3=0xce;}_0x4a64b4[_0x4271('0x1a')](_0x22b9f3);return _0x4a64b4[_0x4271('0x20')](_0x4271('0x21'),_0x538645+'-'+_0x3081de+'/'+_0x87d981)[_0x4271('0x1b')](_0x3fe4a2);}return null;};}function patchUpdates(_0x3377e6){return function(_0x1594e7){try{jsonpatch[_0x4271('0x22')](_0x1594e7,_0x3377e6,!![]);}catch(_0x266d10){return BPromise['reject'](_0x266d10);}return _0x1594e7[_0x4271('0x23')]();};}function saveUpdates(_0x1ae4e5,_0x3a2a55){return function(_0x5314b9){if(_0x5314b9){return _0x5314b9['update'](_0x1ae4e5)[_0x4271('0x24')](function(_0x3f6cdb){return _0x3f6cdb;});}return null;};}function removeEntity(_0x2bc87b,_0x11d904){return function(_0xfaec14){if(_0xfaec14){return _0xfaec14[_0x4271('0x25')]()[_0x4271('0x24')](function(){_0x2bc87b['status'](0xcc)[_0x4271('0x19')]();});}};}function handleEntityNotFound(_0x5b7e15,_0x49e1ac){return function(_0x41ebb5){if(!_0x41ebb5){_0x5b7e15[_0x4271('0x26')](0x194);}return _0x41ebb5;};}function handleError(_0x4f3375,_0x4c80f6){_0x4c80f6=_0x4c80f6||0x1f4;return function(_0x249c9c){logger[_0x4271('0x27')](_0x249c9c['stack']);if(_0x249c9c[_0x4271('0x28')]){delete _0x249c9c['name'];}_0x4f3375['status'](_0x4c80f6)['send'](_0x249c9c);};}exports['update']=function(_0x9bb196,_0x4e3caa){if(_0x9bb196[_0x4271('0x29')]['id']){delete _0x9bb196[_0x4271('0x29')]['id'];}return db[_0x4271('0x2a')][_0x4271('0x2b')]({'where':{'id':_0x9bb196[_0x4271('0x2c')]['id']}})[_0x4271('0x24')](handleEntityNotFound(_0x4e3caa,null))['then'](saveUpdates(_0x9bb196[_0x4271('0x29')],null))[_0x4271('0x24')](respondWithResult(_0x4e3caa,null))[_0x4271('0x2d')](handleError(_0x4e3caa,null));};exports['destroy']=function(_0x118dbe,_0x2cf896){return db[_0x4271('0x2a')][_0x4271('0x2b')]({'where':{'id':_0x118dbe['params']['id']}})[_0x4271('0x24')](handleEntityNotFound(_0x2cf896,null))['then'](removeEntity(_0x2cf896,null))[_0x4271('0x2d')](handleError(_0x2cf896,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index f83836c..390e53b 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 _0x8bb2=['exports','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8bb2,0x13b));var _0x28bb=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x8bb2[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x28bb('0x0'));var util=require('util');var logger=require(_0x28bb('0x1'))(_0x28bb('0x2'));var moment=require(_0x28bb('0x3'));var BPromise=require(_0x28bb('0x4'));var rp=require(_0x28bb('0x5'));var fs=require('fs');var path=require(_0x28bb('0x6'));var rimraf=require(_0x28bb('0x7'));var config=require(_0x28bb('0x8'));var attributes=require(_0x28bb('0x9'));module[_0x28bb('0xa')]=function(_0x13bf70,_0x233eb9){return _0x13bf70['define'](_0x28bb('0xb'),attributes,{'tableName':_0x28bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25e1=['bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','../../config/logger','api','moment'];(function(_0x4135f3,_0x23e172){var _0xbb97c=function(_0xfe1eee){while(--_0xfe1eee){_0x4135f3['push'](_0x4135f3['shift']());}};_0xbb97c(++_0x23e172);}(_0x25e1,0x1d0));var _0x125e=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x25e1[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x125e('0x0'));var util=require('util');var logger=require(_0x125e('0x1'))(_0x125e('0x2'));var moment=require(_0x125e('0x3'));var BPromise=require(_0x125e('0x4'));var rp=require(_0x125e('0x5'));var fs=require('fs');var path=require(_0x125e('0x6'));var rimraf=require(_0x125e('0x7'));var config=require(_0x125e('0x8'));var attributes=require(_0x125e('0x9'));module[_0x125e('0xa')]=function(_0x2b16c4,_0x158400){return _0x2b16c4[_0x125e('0xb')](_0x125e('0xc'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 978b596..67792be 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x53ec,0x192));var _0xc53e=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0x53ec[_0x541095];return _0x5a2c40;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5d0c41,_0x4802ae){var _0x468d86=function(_0x25638e){while(--_0x25638e){_0x5d0c41['push'](_0x5d0c41['shift']());}};_0x468d86(++_0x4802ae);}(_0x326f,0xd1));var _0xf326=function(_0x4fde0f,_0x7acd1c){_0x4fde0f=_0x4fde0f-0x0;var _0x1de7a4=_0x326f[_0x4fde0f];return _0x1de7a4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 3b021a2..1d3216d 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 _0x8be1=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller','isAuthenticated','delete','/:id','destroy','exports'];(function(_0x11f249,_0x4ca4a8){var _0x5c3656=function(_0x27c9f8){while(--_0x27c9f8){_0x11f249['push'](_0x11f249['shift']());}};_0x5c3656(++_0x4ca4a8);}(_0x8be1,0x193));var _0x18be=function(_0x3752ed,_0xbebd9){_0x3752ed=_0x3752ed-0x0;var _0x3cb417=_0x8be1[_0x3752ed];return _0x3cb417;};'use strict';var multer=require(_0x18be('0x0'));var util=require(_0x18be('0x1'));var path=require('path');var timeout=require(_0x18be('0x2'));var express=require(_0x18be('0x3'));var router=express['Router']();var fs_extra=require(_0x18be('0x4'));var auth=require(_0x18be('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x18be('0x6'));var controller=require(_0x18be('0x7'));router['put']('/:id',auth[_0x18be('0x8')](),controller['update']);router[_0x18be('0x9')](_0x18be('0xa'),auth[_0x18be('0x8')](),controller[_0x18be('0xb')]);module[_0x18be('0xc')]=router;
\ No newline at end of file
+var _0x2c04=['delete','isAuthenticated','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update'];(function(_0x57868e,_0x868060){var _0x4b7c99=function(_0x481f03){while(--_0x481f03){_0x57868e['push'](_0x57868e['shift']());}};_0x4b7c99(++_0x868060);}(_0x2c04,0x144));var _0x42c0=function(_0x158002,_0xe44f8d){_0x158002=_0x158002-0x0;var _0xb6f745=_0x2c04[_0x158002];return _0xb6f745;};'use strict';var multer=require(_0x42c0('0x0'));var util=require('util');var path=require(_0x42c0('0x1'));var timeout=require(_0x42c0('0x2'));var express=require(_0x42c0('0x3'));var router=express['Router']();var fs_extra=require(_0x42c0('0x4'));var auth=require(_0x42c0('0x5'));var interaction=require(_0x42c0('0x6'));var config=require(_0x42c0('0x7'));var controller=require(_0x42c0('0x8'));router[_0x42c0('0x9')](_0x42c0('0xa'),auth['isAuthenticated'](),controller[_0x42c0('0xb')]);router[_0x42c0('0xc')](_0x42c0('0xa'),auth[_0x42c0('0xd')](),controller[_0x42c0('0xe')]);module[_0x42c0('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 aa83096..dabb623 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x5c9865,_0x1a299a){var _0x54c22b=function(_0x538537){while(--_0x538537){_0x5c9865['push'](_0x5c9865['shift']());}};_0x54c22b(++_0x1a299a);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2eb2[_0x3b380d];return _0x54502b;};'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
+var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x4123f5,_0x398add){var _0x1af894=function(_0x568329){while(--_0x568329){_0x4123f5['push'](_0x4123f5['shift']());}};_0x1af894(++_0x398add);}(_0xabce,0x103));var _0xeabc=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xabce[_0x1ddedd];return _0xa3e1ac;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 2ee4424..7d2d7db 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 _0x56e9=['map','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','AnalyticCustomReport','includeAll','rows','catch','show','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','keyBy','output','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','../../files/reports','savename','COUNT(*)','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','operator','value','ValidationErrorItem','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','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','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack'];(function(_0x129534,_0x560a44){var _0x430eb4=function(_0x3454ab){while(--_0x3454ab){_0x129534['push'](_0x129534['shift']());}};_0x430eb4(++_0x560a44);}(_0x56e9,0x11c));var _0x956e=function(_0x5f44c3,_0x460f76){_0x5f44c3=_0x5f44c3-0x0;var _0x577bf7=_0x56e9[_0x5f44c3];return _0x577bf7;};'use strict';var emlformat=require(_0x956e('0x0'));var rimraf=require(_0x956e('0x1'));var zipdir=require(_0x956e('0x2'));var jsonpatch=require(_0x956e('0x3'));var rp=require(_0x956e('0x4'));var moment=require(_0x956e('0x5'));var BPromise=require(_0x956e('0x6'));var Mustache=require(_0x956e('0x7'));var util=require(_0x956e('0x8'));var path=require(_0x956e('0x9'));var sox=require(_0x956e('0xa'));var csv=require('to-csv');var ejs=require(_0x956e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x956e('0xc'));var squel=require(_0x956e('0xd'));var crypto=require('crypto');var jsforce=require(_0x956e('0xe'));var deskjs=require(_0x956e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x956e('0x10'));var Papa=require(_0x956e('0x11'));var Redis=require(_0x956e('0x12'));var authService=require(_0x956e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x956e('0x14'));var hardwareService=require(_0x956e('0x15'));var logger=require(_0x956e('0x16'))(_0x956e('0x17'));var utils=require(_0x956e('0x18'));var config=require(_0x956e('0x19'));var licenseUtil=require(_0x956e('0x1a'));var db=require(_0x956e('0x1b'))['db'];var dbH=require(_0x956e('0x1b'))['dbH'];function respondWithStatusCode(_0x3c3436,_0x4d2527){_0x4d2527=_0x4d2527||0xcc;return function(_0x487000){if(_0x487000){return _0x3c3436[_0x956e('0x1c')](_0x4d2527);}return _0x3c3436[_0x956e('0x1d')](_0x4d2527)[_0x956e('0x1e')]();};}function respondWithResult(_0x46bf35,_0x3b3ced){_0x3b3ced=_0x3b3ced||0xc8;return function(_0x584d22){if(_0x584d22){return _0x46bf35[_0x956e('0x1d')](_0x3b3ced)[_0x956e('0x1f')](_0x584d22);}};}function respondWithFilteredResult(_0x250b6d,_0x152736){return function(_0x3c6857){if(_0x3c6857){var _0x5e7d30=typeof _0x152736['offset']==='undefined'&&typeof _0x152736[_0x956e('0x20')]==='undefined';var _0x36ab1e=_0x3c6857[_0x956e('0x21')];var _0x51c11b=_0x5e7d30?0x0:_0x152736[_0x956e('0x22')];var _0x118fe5=_0x5e7d30?_0x3c6857['count']:_0x152736['offset']+_0x152736[_0x956e('0x20')];var _0x366825;if(_0x118fe5>=_0x36ab1e){_0x118fe5=_0x36ab1e;_0x366825=0xc8;}else{_0x366825=0xce;}_0x250b6d[_0x956e('0x1d')](_0x366825);return _0x250b6d['set'](_0x956e('0x23'),_0x51c11b+'-'+_0x118fe5+'/'+_0x36ab1e)[_0x956e('0x1f')](_0x3c6857);}return null;};}function patchUpdates(_0x3e87ca){return function(_0x27324b){try{jsonpatch[_0x956e('0x24')](_0x27324b,_0x3e87ca,!![]);}catch(_0x95cac6){return BPromise['reject'](_0x95cac6);}return _0x27324b[_0x956e('0x25')]();};}function saveUpdates(_0x3bfebf,_0x33d859){return function(_0xeab724){if(_0xeab724){return _0xeab724[_0x956e('0x26')](_0x3bfebf)[_0x956e('0x27')](function(_0x4415a3){return _0x4415a3;});}return null;};}function removeEntity(_0x4d83b0,_0x2c4742){return function(_0x20471e){if(_0x20471e){return _0x20471e[_0x956e('0x28')]()[_0x956e('0x27')](function(){var _0x3b34ab=_0x20471e[_0x956e('0x29')]({'plain':!![]});var _0x3c8f8a=_0x956e('0x2a');return db[_0x956e('0x2b')][_0x956e('0x28')]({'where':{'type':_0x3c8f8a,'resourceId':_0x3b34ab['id']}})['then'](function(){return _0x20471e;});})[_0x956e('0x27')](function(){_0x4d83b0[_0x956e('0x1d')](0xcc)[_0x956e('0x1e')]();});}};}function handleEntityNotFound(_0x57b0b1,_0x5aad98){return function(_0x38f96c){if(!_0x38f96c){_0x57b0b1[_0x956e('0x1c')](0x194);}return _0x38f96c;};}function handleError(_0x1eb857,_0x4265b5){_0x4265b5=_0x4265b5||0x1f4;return function(_0x4af671){logger[_0x956e('0x2c')](_0x4af671[_0x956e('0x2d')]);if(_0x4af671['name']){delete _0x4af671['name'];}_0x1eb857[_0x956e('0x1d')](_0x4265b5)['send'](_0x4af671);};}exports['index']=function(_0x26cb24,_0x71dbca){var _0x7336ea={},_0x2db4a0={},_0x33c932={'count':0x0,'rows':[]};var _0x55d39c=_[_0x956e('0x2e')](db['AnalyticCustomReport'][_0x956e('0x2f')],function(_0x3cc043){return{'name':_0x3cc043[_0x956e('0x30')],'type':_0x3cc043['type'][_0x956e('0x31')]};});_0x2db4a0['model']=_['map'](_0x55d39c,_0x956e('0x32'));_0x2db4a0[_0x956e('0x33')]=_[_0x956e('0x34')](_0x26cb24[_0x956e('0x33')]);_0x2db4a0[_0x956e('0x35')]=_['intersection'](_0x2db4a0[_0x956e('0x36')],_0x2db4a0['query']);_0x7336ea[_0x956e('0x37')]=_[_0x956e('0x38')](_0x2db4a0[_0x956e('0x36')],qs[_0x956e('0x39')](_0x26cb24[_0x956e('0x33')][_0x956e('0x39')]));_0x7336ea[_0x956e('0x37')]=_0x7336ea[_0x956e('0x37')][_0x956e('0x3a')]?_0x7336ea[_0x956e('0x37')]:_0x2db4a0[_0x956e('0x36')];if(!_0x26cb24[_0x956e('0x33')][_0x956e('0x3b')](_0x956e('0x3c'))){_0x7336ea[_0x956e('0x20')]=qs[_0x956e('0x20')](_0x26cb24['query'][_0x956e('0x20')]);_0x7336ea[_0x956e('0x22')]=qs[_0x956e('0x22')](_0x26cb24[_0x956e('0x33')][_0x956e('0x22')]);}_0x7336ea[_0x956e('0x3d')]=qs[_0x956e('0x3e')](_0x26cb24[_0x956e('0x33')][_0x956e('0x3e')]);_0x7336ea['where']=qs['filters'](_[_0x956e('0x3f')](_0x26cb24[_0x956e('0x33')],_0x2db4a0[_0x956e('0x35')]),_0x55d39c);if(_0x26cb24[_0x956e('0x33')][_0x956e('0x40')]){_0x7336ea[_0x956e('0x41')]=_[_0x956e('0x42')](_0x7336ea[_0x956e('0x41')],{'$or':_[_0x956e('0x2e')](_0x55d39c,function(_0x3d83f3){if(_0x3d83f3[_0x956e('0x43')]!==_0x956e('0x44')){var _0x19e943={};_0x19e943[_0x3d83f3['name']]={'$like':'%'+_0x26cb24[_0x956e('0x33')]['filter']+'%'};return _0x19e943;}})});}_0x7336ea=_['merge']({},_0x7336ea,_0x26cb24['options']);var _0x57cef7={'where':_0x7336ea[_0x956e('0x41')]};return db[_0x956e('0x45')][_0x956e('0x21')](_0x57cef7)[_0x956e('0x27')](function(_0x4440b1){_0x33c932[_0x956e('0x21')]=_0x4440b1;if(_0x26cb24['query'][_0x956e('0x46')]){_0x7336ea['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x7336ea);})[_0x956e('0x27')](function(_0x1989fa){_0x33c932[_0x956e('0x47')]=_0x1989fa;return _0x33c932;})[_0x956e('0x27')](respondWithFilteredResult(_0x71dbca,_0x7336ea))[_0x956e('0x48')](handleError(_0x71dbca,null));};exports[_0x956e('0x49')]=function(_0x3d77e8,_0x3bb9cd){var _0x4e9cc3={'raw':![],'where':{'id':_0x3d77e8['params']['id']}},_0x3c4fc1={};_0x3c4fc1[_0x956e('0x36')]=_[_0x956e('0x34')](db['AnalyticCustomReport']['rawAttributes']);_0x3c4fc1[_0x956e('0x33')]=_[_0x956e('0x34')](_0x3d77e8['query']);_0x3c4fc1[_0x956e('0x35')]=_[_0x956e('0x38')](_0x3c4fc1[_0x956e('0x36')],_0x3c4fc1['query']);_0x4e9cc3[_0x956e('0x37')]=_[_0x956e('0x38')](_0x3c4fc1[_0x956e('0x36')],qs[_0x956e('0x39')](_0x3d77e8[_0x956e('0x33')][_0x956e('0x39')]));_0x4e9cc3['attributes']=_0x4e9cc3[_0x956e('0x37')][_0x956e('0x3a')]?_0x4e9cc3[_0x956e('0x37')]:_0x3c4fc1[_0x956e('0x36')];if(_0x3d77e8[_0x956e('0x33')]['includeAll']){_0x4e9cc3[_0x956e('0x4a')]=[{'all':!![]}];}_0x4e9cc3=_[_0x956e('0x42')]({},_0x4e9cc3,_0x3d77e8[_0x956e('0x4b')]);return db[_0x956e('0x45')][_0x956e('0x4c')](_0x4e9cc3)[_0x956e('0x27')](handleEntityNotFound(_0x3bb9cd,null))['then'](respondWithResult(_0x3bb9cd,null))['catch'](handleError(_0x3bb9cd,null));};exports[_0x956e('0x4d')]=function(_0x482c55,_0x3c5bb1){return db[_0x956e('0x45')][_0x956e('0x4d')](_0x482c55[_0x956e('0x4e')],{})[_0x956e('0x27')](function(_0x3f7145){var _0x37b1dc=_0x482c55[_0x956e('0x4f')]['get']({'plain':!![]});if(!_0x37b1dc)throw new Error(_0x956e('0x50'));if(_0x37b1dc['role']===_0x956e('0x4f')){var _0x595b32=_0x3f7145[_0x956e('0x29')]({'plain':!![]});var _0x45f0a1='Reports';return db[_0x956e('0x51')]['find']({'where':{'name':_0x45f0a1,'userProfileId':_0x37b1dc[_0x956e('0x52')]},'raw':!![]})['then'](function(_0x25e797){if(_0x25e797&&_0x25e797[_0x956e('0x53')]===0x0){return db['UserProfileResource'][_0x956e('0x4d')]({'name':_0x595b32[_0x956e('0x32')],'resourceId':_0x595b32['id'],'type':_0x956e('0x2a'),'sectionId':_0x25e797['id']},{})[_0x956e('0x27')](function(){return _0x3f7145;});}else{return _0x3f7145;}})[_0x956e('0x48')](function(_0xc35934){logger[_0x956e('0x2c')](_0x956e('0x54'),_0xc35934);throw _0xc35934;});}return _0x3f7145;})['then'](respondWithResult(_0x3c5bb1,0xc9))[_0x956e('0x48')](handleError(_0x3c5bb1,null));};exports['update']=function(_0x576723,_0x2790fe){if(_0x576723[_0x956e('0x4e')]['id']){delete _0x576723['body']['id'];}return db[_0x956e('0x45')]['find']({'where':{'id':_0x576723[_0x956e('0x55')]['id']}})['then'](handleEntityNotFound(_0x2790fe,null))[_0x956e('0x27')](saveUpdates(_0x576723[_0x956e('0x4e')],null))['then'](respondWithResult(_0x2790fe,null))[_0x956e('0x48')](handleError(_0x2790fe,null));};exports[_0x956e('0x28')]=function(_0x515a61,_0xf0ce6f){return db['AnalyticCustomReport'][_0x956e('0x4c')]({'where':{'id':_0x515a61[_0x956e('0x55')]['id']}})[_0x956e('0x27')](handleEntityNotFound(_0xf0ce6f,null))[_0x956e('0x27')](removeEntity(_0xf0ce6f,null))['catch'](handleError(_0xf0ce6f,null));};exports[_0x956e('0x56')]=function(_0x3a9d46,_0x510226){var _0x43f7b5=0xa;var _0x53b29a=[_0x956e('0x57'),_0x956e('0x58'),_0x956e('0x59'),'cross_join'];var _0xfe0bc4={'SUM':_0x956e('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x956e('0x5b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x956e('0x5c'),'GROUP_CONCAT ASC':_0x956e('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x330035={'SEC_TO_TIME':_0x956e('0x5e'),'DATE':_0x956e('0x5f'),'HOUR':_0x956e('0x60'),'ROUND':_0x956e('0x61'),'UNIX_TIMESTAMP':_0x956e('0x62')};var _0xb317ba=function(_0xf139b4){return!_[_0x956e('0x63')](['IS\x20NULL',_0x956e('0x64'),_0x956e('0x65'),_0x956e('0x66')],_0xf139b4);};var _0x186aa9=function(_0x233eff){if(!_0x233eff||!_0x233eff[_0x956e('0x67')][_0x956e('0x3a')]){return'';}for(var _0x368b74='(',_0x5c2acd=0x0;_0x5c2acd<_0x233eff['rules'][_0x956e('0x3a')];_0x5c2acd+=0x1){_0x5c2acd>0x0&&(_0x368b74+='\x20'+_0x233eff['operator']+'\x20');_0x368b74+=_0x233eff['rules'][_0x5c2acd][_0x956e('0x68')]?_0x186aa9(_0x233eff[_0x956e('0x67')][_0x5c2acd][_0x956e('0x68')]):_0x233eff[_0x956e('0x67')][_0x5c2acd][_0x956e('0x69')]+'\x20'+_0x233eff['rules'][_0x5c2acd]['condition']+(_0xb317ba(_0x233eff['rules'][_0x5c2acd][_0x956e('0x6a')])?'\x20'+_0x233eff[_0x956e('0x67')][_0x5c2acd]['value']:'');}return _0x368b74+')';};var _0x4dd183={'where':{'id':_0x3a9d46[_0x956e('0x55')]['id']}},_0x2d9ee1,_0x43cbf7,_0x15f635,_0x8b7e79,_0x5f0e62;_0x4dd183=_[_0x956e('0x42')]({},_0x4dd183,_0x3a9d46[_0x956e('0x4b')]);return db[_0x956e('0x45')][_0x956e('0x4c')](_0x4dd183)['then'](function(_0xd60d6d){if(_0xd60d6d){_0x2d9ee1=_0xd60d6d;return _0xd60d6d[_0x956e('0x6b')]();}return null;})['then'](function(_0x59da0e){if(_0x59da0e){if(!_0x59da0e[_0x956e('0x3a')]){throw new db[(_0x956e('0x6c'))]['ValidationErrorItem'](_0x956e('0x6d'),0x193);}_0x43cbf7=_0x59da0e;return db[_0x956e('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x557ccc){if(_0x557ccc){_0x15f635=_['keyBy'](_0x557ccc,'id');var _0x114248;var _0x13440e=squel[_0x956e('0x6f')]();_0x13440e[_0x956e('0x70')](_0x2d9ee1[_0x956e('0x71')]);for(var _0x26b94a=0x0;_0x26b94a<_0x43cbf7[_0x956e('0x3a')];_0x26b94a+=0x1){_0x114248=_0x43cbf7[_0x26b94a][_0x956e('0x72')]?_0x15f635[_0x43cbf7[_0x26b94a]['MetricId']][_0x956e('0x73')]:_0x43cbf7[_0x26b94a][_0x956e('0x69')];_0x114248=_0x43cbf7[_0x26b94a][_0x956e('0x74')]?_[_0x956e('0x75')](_0xfe0bc4[_0x43cbf7[_0x26b94a][_0x956e('0x74')]],'%s',_0x114248):_0x114248;_0x114248=_0x43cbf7[_0x26b94a][_0x956e('0x76')]?_[_0x956e('0x75')](_0x330035[_0x43cbf7[_0x26b94a]['format']],'%s',_0x114248):_0x114248;if(_0x43cbf7[_0x26b94a][_0x956e('0x77')]){_0x13440e[_0x956e('0x68')](_0x114248);}_0x43cbf7[_0x26b94a]['orderBy']&&_0x13440e[_0x956e('0x3d')](_0x114248,_0x43cbf7[_0x26b94a][_0x956e('0x78')]===_0x956e('0x79')?![]:!![]);_0x13440e['field'](_0x114248,_0x43cbf7[_0x26b94a][_0x956e('0x7a')]||_0x114248);}if(_0x2d9ee1[_0x956e('0x7b')]){_0x2d9ee1[_0x956e('0x7b')]=JSON[_0x956e('0x7c')](_0x2d9ee1[_0x956e('0x7b')]);for(var _0x5ae077=0x0;_0x5ae077<_0x2d9ee1['joins']['length'];_0x5ae077+=0x1){if(_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x43')]&&_['includes'](_0x53b29a,_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x43')])&&_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x7d')]&&_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x7e')]&&_0x2d9ee1['joins'][_0x5ae077][_0x956e('0x7f')]){_0x13440e[_0x2d9ee1[_0x956e('0x7b')][_0x5ae077]['type']](_0x2d9ee1['joins'][_0x5ae077][_0x956e('0x7e')],null,util[_0x956e('0x76')](_0x956e('0x80'),_0x2d9ee1[_0x956e('0x71')],_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x7d')],_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x7e')],_0x2d9ee1['joins'][_0x5ae077][_0x956e('0x7f')]));}}}if(_0x2d9ee1[_0x956e('0x81')]){_0x2d9ee1[_0x956e('0x81')]=JSON[_0x956e('0x7c')](_0x2d9ee1[_0x956e('0x81')]);_0x13440e[_0x956e('0x41')](_0x186aa9(_0x2d9ee1['conditions']['group']));}_0x5f0e62=_0x13440e[_0x956e('0x82')]();_0x13440e[_0x956e('0x20')](_0x43f7b5);_0x13440e['offset'](0x0);logger[_0x956e('0x83')](_0x956e('0x84'),_0x13440e[_0x956e('0x85')]());return dbH['sequelize'][_0x956e('0x33')](_0x13440e[_0x956e('0x85')](),{'type':dbH[_0x956e('0x86')][_0x956e('0x87')][_0x956e('0x88')]});}})['then'](respondWithResult(_0x510226,null))[_0x956e('0x48')](handleError(_0x510226,null));};function runReport(_0x252a23,_0x2b2942,_0x460398){var _0x218e13=_0x2b2942['name'];var _0x525ed7=0xa;var _0x3675b3=[_0x956e('0x57'),_0x956e('0x58'),_0x956e('0x59'),_0x956e('0x89')];var _0x560716={'SUM':'SUM(%s)','COUNT':_0x956e('0x8a'),'COUNT DISTINCT':_0x956e('0x8b'),'MAX':_0x956e('0x5b'),'MIN':_0x956e('0x8c'),'AVG':_0x956e('0x8d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x956e('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4112a2={'SEC_TO_TIME':_0x956e('0x5e'),'DATE':_0x956e('0x5f'),'HOUR':_0x956e('0x60'),'ROUND':_0x956e('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x47c682=function(_0x5eab44){return!_[_0x956e('0x63')](['IS\x20NULL',_0x956e('0x64'),_0x956e('0x65'),_0x956e('0x66')],_0x5eab44);};var _0x25ada9=function(_0x1fabe5){if(!_0x1fabe5||!_0x1fabe5[_0x956e('0x67')]['length']){return'';}for(var _0x3e9306='(',_0x2929ac=0x0;_0x2929ac<_0x1fabe5[_0x956e('0x67')]['length'];_0x2929ac+=0x1){_0x2929ac>0x0&&(_0x3e9306+='\x20'+_0x1fabe5['operator']+'\x20');_0x3e9306+=_0x1fabe5[_0x956e('0x67')][_0x2929ac][_0x956e('0x68')]?_0x25ada9(_0x1fabe5[_0x956e('0x67')][_0x2929ac]['group']):_0x1fabe5[_0x956e('0x67')][_0x2929ac]['field']+'\x20'+_0x1fabe5[_0x956e('0x67')][_0x2929ac][_0x956e('0x6a')]+(_0x47c682(_0x1fabe5[_0x956e('0x67')][_0x2929ac][_0x956e('0x6a')])?'\x20'+_0x1fabe5[_0x956e('0x67')][_0x2929ac]['value']:'');}return _0x3e9306+')';};var _0x392a48={'where':{'id':_0x252a23['id']}},_0x59640a,_0x222ce7,_0x3967df,_0x41e714,_0x24fa7a;_0x392a48=_[_0x956e('0x42')]({},_0x392a48,_0x460398);return db[_0x956e('0x45')][_0x956e('0x4c')](_0x392a48)[_0x956e('0x27')](function(_0x5bda9c){if(_0x5bda9c){_0x59640a=_0x5bda9c;return _0x5bda9c['getFields']();}return null;})[_0x956e('0x27')](function(_0x2127c9){if(_0x2127c9){if(!_0x2127c9[_0x956e('0x3a')]){throw new db[(_0x956e('0x6c'))]['ValidationErrorItem'](_0x956e('0x6d'),0x193);}_0x222ce7=_0x2127c9;return db[_0x956e('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xa1866e){if(_0xa1866e){_0x3967df=_[_0x956e('0x8e')](_0xa1866e,'id');var _0x43c68d;var _0x2a2f3c=squel[_0x956e('0x6f')]();_0x2a2f3c['from'](_0x59640a[_0x956e('0x71')]);for(var _0x1e10c3=0x0;_0x1e10c3<_0x222ce7[_0x956e('0x3a')];_0x1e10c3+=0x1){_0x43c68d=_0x222ce7[_0x1e10c3][_0x956e('0x72')]?_0x3967df[_0x222ce7[_0x1e10c3]['MetricId']][_0x956e('0x73')]:_0x222ce7[_0x1e10c3][_0x956e('0x69')];_0x43c68d=_0x222ce7[_0x1e10c3][_0x956e('0x74')]?_[_0x956e('0x75')](_0x560716[_0x222ce7[_0x1e10c3][_0x956e('0x74')]],'%s',_0x43c68d):_0x43c68d;_0x43c68d=_0x222ce7[_0x1e10c3]['format']?_[_0x956e('0x75')](_0x4112a2[_0x222ce7[_0x1e10c3][_0x956e('0x76')]],'%s',_0x43c68d):_0x43c68d;if(_0x222ce7[_0x1e10c3][_0x956e('0x77')]){_0x2a2f3c['group'](_0x43c68d);}_0x222ce7[_0x1e10c3][_0x956e('0x78')]&&_0x2a2f3c[_0x956e('0x3d')](_0x43c68d,_0x222ce7[_0x1e10c3][_0x956e('0x78')]===_0x956e('0x79')?![]:!![]);_0x2a2f3c[_0x956e('0x69')](_0x43c68d,_0x222ce7[_0x1e10c3][_0x956e('0x7a')]||_0x43c68d);}if(_0x59640a[_0x956e('0x7b')]){_0x59640a[_0x956e('0x7b')]=JSON[_0x956e('0x7c')](_0x59640a[_0x956e('0x7b')]);for(var _0x398e80=0x0;_0x398e80<_0x59640a[_0x956e('0x7b')][_0x956e('0x3a')];_0x398e80+=0x1){if(_0x59640a['joins'][_0x398e80][_0x956e('0x43')]&&_[_0x956e('0x63')](_0x3675b3,_0x59640a['joins'][_0x398e80][_0x956e('0x43')])&&_0x59640a[_0x956e('0x7b')][_0x398e80]['parentKey']&&_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x7e')]&&_0x59640a['joins'][_0x398e80][_0x956e('0x7f')]){_0x2a2f3c[_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x43')]](_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x7e')],null,util[_0x956e('0x76')](_0x956e('0x80'),_0x59640a['table'],_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x7d')],_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x7e')],_0x59640a['joins'][_0x398e80][_0x956e('0x7f')]));}}}if(_0x59640a[_0x956e('0x81')]){_0x59640a[_0x956e('0x81')]=JSON['parse'](_0x59640a['conditions']);_0x2a2f3c[_0x956e('0x41')](_0x25ada9(_0x59640a[_0x956e('0x81')]['group']));}_0x24fa7a=_0x2a2f3c[_0x956e('0x82')]();_0x2a2f3c['limit'](_0x525ed7);_0x2a2f3c[_0x956e('0x22')](0x0);return;}})[_0x956e('0x27')](function(){if(_0x2b2942[_0x956e('0x8f')]==='web'){return null;}var _0x4c56a3=_[_0x956e('0x42')](_0x2b2942,{'name':_0x2b2942['fullPath']||_0x2b2942[_0x956e('0x32')]||_0x59640a[_0x956e('0x32')],'basename':_0x218e13,'savename':util['format'](_0x956e('0x90'),_0x2b2942[_0x956e('0x32')]||_0x59640a[_0x956e('0x32')],require(_0x956e('0x91'))[_0x956e('0x92')](0x4),_0x2b2942[_0x956e('0x8f')]||'csv'),'reportId':_0x59640a['id'],'reportType':_0x956e('0x93')});return db[_0x956e('0x94')][_0x956e('0x4d')](_0x4c56a3,{'raw':!![]});})['then'](function(_0x18c6ff){if(_0x59640a[_0x956e('0x71')]===_0x956e('0x95')){_0x24fa7a['where'](_0x59640a[_0x956e('0x71')]+_0x956e('0x96'),_0x2b2942[_0x956e('0x97')],_0x2b2942[_0x956e('0x98')]);}else{_0x24fa7a[_0x956e('0x41')](_0x59640a[_0x956e('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b2942[_0x956e('0x97')],_0x2b2942['endDate']);}if(_0x18c6ff){logger[_0x956e('0x99')](_0x956e('0x9a'),_0x24fa7a[_0x956e('0x85')]());require('child_process')['fork'](path[_0x956e('0x57')](__dirname,'../../components/export/',_0x18c6ff[_0x956e('0x8f')]),[_0x18c6ff['id'],_0x24fa7a['toString'](),path[_0x956e('0x57')](__dirname,_0x956e('0x9b'),_0x18c6ff[_0x956e('0x9c')]),_0x218e13]);return _0x18c6ff;}else{var _0xc9d0ae=squel[_0x956e('0x6f')]();_0xc9d0ae[_0x956e('0x70')]('('+_0x24fa7a['toString']()+')','countTable');_0xc9d0ae['field'](_0x956e('0x9d'),'count');_0x24fa7a[_0x956e('0x20')](_0x2b2942[_0x956e('0x20')]||_0x525ed7);_0x24fa7a[_0x956e('0x22')](_0x2b2942['offset']||0x0);return dbH['sequelize'][_0x956e('0x33')](_0xc9d0ae['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x956e('0x88')]})['then'](function(_0x1b55b9){if(!_0x1b55b9[_0x956e('0x3a')]){_0x41e714=0x0;}else{_0x41e714=_0x1b55b9[0x0][_0x956e('0x21')]||0x0;}return dbH[_0x956e('0x86')][_0x956e('0x33')](_0x24fa7a[_0x956e('0x85')](),{'type':dbH[_0x956e('0x86')][_0x956e('0x87')][_0x956e('0x88')]});})[_0x956e('0x27')](function(_0x47e36a){return{'rows':_0x47e36a||[],'count':_0x41e714};});}});}exports[_0x956e('0x9e')]=function(_0xb6ba8e,_0x57cc25){return runReport(_0xb6ba8e['params'],_0xb6ba8e[_0x956e('0x33')],_0xb6ba8e['options'])[_0x956e('0x27')](respondWithResult(_0x57cc25,null))['catch'](handleError(_0x57cc25,null));};exports['runReport']=runReport;exports['query']=function(_0x405a0f,_0x313dbf){var _0x5894b1=0xa;var _0x38995f=['join','left_join',_0x956e('0x59'),_0x956e('0x89')];var _0x4a1c6b={'SUM':_0x956e('0x5a'),'COUNT':_0x956e('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x956e('0x5b'),'MIN':_0x956e('0x8c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x956e('0x5c'),'GROUP_CONCAT ASC':_0x956e('0x5d'),'GROUP_CONCAT DESC':_0x956e('0x9f')};var _0x5b5eba={'SEC_TO_TIME':_0x956e('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x956e('0x61'),'UNIX_TIMESTAMP':_0x956e('0x62')};var _0x480987=function(_0x5b7430){return!_[_0x956e('0x63')]([_0x956e('0xa0'),_0x956e('0x64'),_0x956e('0x65'),_0x956e('0x66')],_0x5b7430);};var _0x414fdd=function(_0x29fbe0){if(!_0x29fbe0||!_0x29fbe0[_0x956e('0x67')][_0x956e('0x3a')]){return'';}for(var _0x24c07b='(',_0x340158=0x0;_0x340158<_0x29fbe0['rules'][_0x956e('0x3a')];_0x340158+=0x1){_0x340158>0x0&&(_0x24c07b+='\x20'+_0x29fbe0[_0x956e('0xa1')]+'\x20');_0x24c07b+=_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0x68')]?_0x414fdd(_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0x68')]):_0x29fbe0[_0x956e('0x67')][_0x340158]['field']+'\x20'+_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0x6a')]+(_0x480987(_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0x6a')])?'\x20'+_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0xa2')]:'');}return _0x24c07b+')';};var _0x29f5d5={'where':{'id':_0x405a0f['params']['id']}},_0x3696c5,_0x4bd965,_0x282d6c,_0x112319,_0xcd54ad;_0x29f5d5=_[_0x956e('0x42')]({},_0x29f5d5,_0x405a0f[_0x956e('0x4b')]);return db[_0x956e('0x45')][_0x956e('0x4c')](_0x29f5d5)[_0x956e('0x27')](function(_0x56cdc6){if(_0x56cdc6){_0x3696c5=_0x56cdc6;return _0x56cdc6[_0x956e('0x6b')]();}return null;})[_0x956e('0x27')](function(_0x5bd31c){if(_0x5bd31c){if(!_0x5bd31c['length']){throw new db[(_0x956e('0x6c'))][(_0x956e('0xa3'))](_0x956e('0x6d'),0x193);}_0x4bd965=_0x5bd31c;return db[_0x956e('0x6e')][_0x956e('0xa4')]({'raw':!![]});}return null;})[_0x956e('0x27')](function(_0x36eff1){if(_0x36eff1){_0x282d6c=_[_0x956e('0x8e')](_0x36eff1,'id');var _0x3d128e;var _0x312e45=squel[_0x956e('0x6f')]();_0x312e45[_0x956e('0x70')](_0x3696c5[_0x956e('0x71')]);for(var _0x84594f=0x0;_0x84594f<_0x4bd965[_0x956e('0x3a')];_0x84594f+=0x1){_0x3d128e=_0x4bd965[_0x84594f][_0x956e('0x72')]?_0x282d6c[_0x4bd965[_0x84594f]['MetricId']][_0x956e('0x73')]:_0x4bd965[_0x84594f]['field'];_0x3d128e=_0x4bd965[_0x84594f][_0x956e('0x74')]?_[_0x956e('0x75')](_0x4a1c6b[_0x4bd965[_0x84594f][_0x956e('0x74')]],'%s',_0x3d128e):_0x3d128e;_0x3d128e=_0x4bd965[_0x84594f][_0x956e('0x76')]?_['replace'](_0x5b5eba[_0x4bd965[_0x84594f]['format']],'%s',_0x3d128e):_0x3d128e;if(_0x4bd965[_0x84594f][_0x956e('0x77')]){_0x312e45[_0x956e('0x68')](_0x3d128e);}_0x4bd965[_0x84594f][_0x956e('0x78')]&&_0x312e45[_0x956e('0x3d')](_0x3d128e,_0x4bd965[_0x84594f]['orderBy']===_0x956e('0x79')?![]:!![]);_0x312e45[_0x956e('0x69')](_0x3d128e,_0x4bd965[_0x84594f][_0x956e('0x7a')]||_0x3d128e);}if(_0x3696c5[_0x956e('0x7b')]){_0x3696c5[_0x956e('0x7b')]=JSON[_0x956e('0x7c')](_0x3696c5[_0x956e('0x7b')]);for(var _0x4a1541=0x0;_0x4a1541<_0x3696c5['joins'][_0x956e('0x3a')];_0x4a1541+=0x1){if(_0x3696c5['joins'][_0x4a1541][_0x956e('0x43')]&&_[_0x956e('0x63')](_0x38995f,_0x3696c5['joins'][_0x4a1541][_0x956e('0x43')])&&_0x3696c5['joins'][_0x4a1541][_0x956e('0x7d')]&&_0x3696c5[_0x956e('0x7b')][_0x4a1541][_0x956e('0x7e')]&&_0x3696c5[_0x956e('0x7b')][_0x4a1541][_0x956e('0x7f')]){_0x312e45[_0x3696c5[_0x956e('0x7b')][_0x4a1541]['type']](_0x3696c5['joins'][_0x4a1541]['foreignTable'],null,util[_0x956e('0x76')](_0x956e('0x80'),_0x3696c5[_0x956e('0x71')],_0x3696c5['joins'][_0x4a1541][_0x956e('0x7d')],_0x3696c5[_0x956e('0x7b')][_0x4a1541][_0x956e('0x7e')],_0x3696c5[_0x956e('0x7b')][_0x4a1541][_0x956e('0x7f')]));}}}if(_0x3696c5[_0x956e('0x81')]){_0x3696c5[_0x956e('0x81')]=JSON[_0x956e('0x7c')](_0x3696c5[_0x956e('0x81')]);_0x312e45[_0x956e('0x41')](_0x414fdd(_0x3696c5['conditions'][_0x956e('0x68')]));}_0xcd54ad=_0x312e45['clone']();_0x312e45[_0x956e('0x20')](_0x5894b1);_0x312e45[_0x956e('0x22')](0x0);logger['debug'](_0x956e('0x84'),_0x312e45[_0x956e('0x85')]());return dbH[_0x956e('0x86')][_0x956e('0x33')](_0x312e45[_0x956e('0x85')](),{'type':dbH[_0x956e('0x86')][_0x956e('0x87')][_0x956e('0x88')]});}})[_0x956e('0x27')](function(){return{'sql':_0xcd54ad[_0x956e('0x85')]()};})[_0x956e('0x27')](respondWithResult(_0x313dbf,null))[_0x956e('0x48')](handleError(_0x313dbf,null));};
\ No newline at end of file
+var _0xb714=['Run\x20Query:','../../files/reports','savename','countTable','runReport','value','MetricId','%s.%s\x20=\x20%s.%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','save','update','destroy','then','CustomReports','UserProfileResource','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','keys','include','catch','create','body','user','get','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','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)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','from','table','metric','replace','function','format','order','field','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','getFields','keyBy','groupBy','orderBy','DESC','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info'];(function(_0x322ff3,_0x4c91bc){var _0x3e6830=function(_0x2786ac){while(--_0x2786ac){_0x322ff3['push'](_0x322ff3['shift']());}};_0x3e6830(++_0x4c91bc);}(_0xb714,0xa9));var _0x4b71=function(_0x46c9a5,_0x1cb9e7){_0x46c9a5=_0x46c9a5-0x0;var _0x5e3eec=_0xb714[_0x46c9a5];return _0x5e3eec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b71('0x0'));var zipdir=require(_0x4b71('0x1'));var jsonpatch=require(_0x4b71('0x2'));var rp=require(_0x4b71('0x3'));var moment=require('moment');var BPromise=require(_0x4b71('0x4'));var Mustache=require(_0x4b71('0x5'));var util=require(_0x4b71('0x6'));var path=require(_0x4b71('0x7'));var sox=require(_0x4b71('0x8'));var csv=require(_0x4b71('0x9'));var ejs=require(_0x4b71('0xa'));var fs=require('fs');var fs_extra=require(_0x4b71('0xb'));var _=require(_0x4b71('0xc'));var squel=require(_0x4b71('0xd'));var crypto=require(_0x4b71('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4b71('0xf'));var toCsv=require(_0x4b71('0x9'));var querystring=require('querystring');var Papa=require(_0x4b71('0x10'));var Redis=require(_0x4b71('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4b71('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b71('0x13'))(_0x4b71('0x14'));var utils=require('../../config/utils');var config=require(_0x4b71('0x15'));var licenseUtil=require(_0x4b71('0x16'));var db=require(_0x4b71('0x17'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x194f7a,_0x30c114){_0x30c114=_0x30c114||0xcc;return function(_0xae1e44){if(_0xae1e44){return _0x194f7a[_0x4b71('0x18')](_0x30c114);}return _0x194f7a[_0x4b71('0x19')](_0x30c114)[_0x4b71('0x1a')]();};}function respondWithResult(_0x331d2f,_0x460784){_0x460784=_0x460784||0xc8;return function(_0x395e68){if(_0x395e68){return _0x331d2f[_0x4b71('0x19')](_0x460784)['json'](_0x395e68);}};}function respondWithFilteredResult(_0x5aa097,_0x131019){return function(_0x59bd9d){if(_0x59bd9d){var _0x2918b1=typeof _0x131019['offset']===_0x4b71('0x1b')&&typeof _0x131019[_0x4b71('0x1c')]==='undefined';var _0x41b8e0=_0x59bd9d[_0x4b71('0x1d')];var _0x374477=_0x2918b1?0x0:_0x131019[_0x4b71('0x1e')];var _0x3121cf=_0x2918b1?_0x59bd9d['count']:_0x131019[_0x4b71('0x1e')]+_0x131019[_0x4b71('0x1c')];var _0x19e716;if(_0x3121cf>=_0x41b8e0){_0x3121cf=_0x41b8e0;_0x19e716=0xc8;}else{_0x19e716=0xce;}_0x5aa097[_0x4b71('0x19')](_0x19e716);return _0x5aa097[_0x4b71('0x1f')]('Content-Range',_0x374477+'-'+_0x3121cf+'/'+_0x41b8e0)['json'](_0x59bd9d);}return null;};}function patchUpdates(_0x277a29){return function(_0x271751){try{jsonpatch[_0x4b71('0x20')](_0x271751,_0x277a29,!![]);}catch(_0x40fdb0){return BPromise['reject'](_0x40fdb0);}return _0x271751[_0x4b71('0x21')]();};}function saveUpdates(_0xb0888d,_0x5e2c3b){return function(_0x12d591){if(_0x12d591){return _0x12d591[_0x4b71('0x22')](_0xb0888d)['then'](function(_0x1a2d1f){return _0x1a2d1f;});}return null;};}function removeEntity(_0xc5f76d,_0x232dfe){return function(_0x4f05b1){if(_0x4f05b1){return _0x4f05b1[_0x4b71('0x23')]()[_0x4b71('0x24')](function(){var _0x2e8402=_0x4f05b1['get']({'plain':!![]});var _0x3d632f=_0x4b71('0x25');return db[_0x4b71('0x26')][_0x4b71('0x23')]({'where':{'type':_0x3d632f,'resourceId':_0x2e8402['id']}})[_0x4b71('0x24')](function(){return _0x4f05b1;});})[_0x4b71('0x24')](function(){_0xc5f76d[_0x4b71('0x19')](0xcc)[_0x4b71('0x1a')]();});}};}function handleEntityNotFound(_0x1eeab4,_0x5d6908){return function(_0x50af00){if(!_0x50af00){_0x1eeab4[_0x4b71('0x18')](0x194);}return _0x50af00;};}function handleError(_0x23add9,_0x31deff){_0x31deff=_0x31deff||0x1f4;return function(_0x394ae0){logger[_0x4b71('0x27')](_0x394ae0[_0x4b71('0x28')]);if(_0x394ae0[_0x4b71('0x29')]){delete _0x394ae0[_0x4b71('0x29')];}_0x23add9['status'](_0x31deff)[_0x4b71('0x2a')](_0x394ae0);};}exports['index']=function(_0x502488,_0x3aaf60){var _0xaaf767={},_0x33c175={},_0x99f279={'count':0x0,'rows':[]};var _0x2d68cb=_[_0x4b71('0x2b')](db[_0x4b71('0x2c')][_0x4b71('0x2d')],function(_0x18ff25){return{'name':_0x18ff25[_0x4b71('0x2e')],'type':_0x18ff25[_0x4b71('0x2f')][_0x4b71('0x30')]};});_0x33c175['model']=_['map'](_0x2d68cb,_0x4b71('0x29'));_0x33c175[_0x4b71('0x31')]=_['keys'](_0x502488['query']);_0x33c175[_0x4b71('0x32')]=_[_0x4b71('0x33')](_0x33c175[_0x4b71('0x34')],_0x33c175[_0x4b71('0x31')]);_0xaaf767[_0x4b71('0x35')]=_[_0x4b71('0x33')](_0x33c175[_0x4b71('0x34')],qs[_0x4b71('0x36')](_0x502488[_0x4b71('0x31')][_0x4b71('0x36')]));_0xaaf767['attributes']=_0xaaf767[_0x4b71('0x35')][_0x4b71('0x37')]?_0xaaf767[_0x4b71('0x35')]:_0x33c175['model'];if(!_0x502488['query'][_0x4b71('0x38')]('nolimit')){_0xaaf767[_0x4b71('0x1c')]=qs[_0x4b71('0x1c')](_0x502488['query'][_0x4b71('0x1c')]);_0xaaf767[_0x4b71('0x1e')]=qs[_0x4b71('0x1e')](_0x502488[_0x4b71('0x31')][_0x4b71('0x1e')]);}_0xaaf767['order']=qs[_0x4b71('0x39')](_0x502488[_0x4b71('0x31')][_0x4b71('0x39')]);_0xaaf767[_0x4b71('0x3a')]=qs[_0x4b71('0x32')](_[_0x4b71('0x3b')](_0x502488[_0x4b71('0x31')],_0x33c175['filters']),_0x2d68cb);if(_0x502488[_0x4b71('0x31')][_0x4b71('0x3c')]){_0xaaf767[_0x4b71('0x3a')]=_[_0x4b71('0x3d')](_0xaaf767[_0x4b71('0x3a')],{'$or':_['map'](_0x2d68cb,function(_0x3e01fd){if(_0x3e01fd['type']!==_0x4b71('0x3e')){var _0x5bcc17={};_0x5bcc17[_0x3e01fd[_0x4b71('0x29')]]={'$like':'%'+_0x502488[_0x4b71('0x31')][_0x4b71('0x3c')]+'%'};return _0x5bcc17;}})});}_0xaaf767=_[_0x4b71('0x3d')]({},_0xaaf767,_0x502488[_0x4b71('0x3f')]);var _0x499a86={'where':_0xaaf767[_0x4b71('0x3a')]};return db[_0x4b71('0x2c')][_0x4b71('0x1d')](_0x499a86)[_0x4b71('0x24')](function(_0xc177eb){_0x99f279[_0x4b71('0x1d')]=_0xc177eb;if(_0x502488[_0x4b71('0x31')][_0x4b71('0x40')]){_0xaaf767['include']=[{'all':!![]}];}return db[_0x4b71('0x2c')]['findAll'](_0xaaf767);})[_0x4b71('0x24')](function(_0x580b59){_0x99f279[_0x4b71('0x41')]=_0x580b59;return _0x99f279;})[_0x4b71('0x24')](respondWithFilteredResult(_0x3aaf60,_0xaaf767))['catch'](handleError(_0x3aaf60,null));};exports[_0x4b71('0x42')]=function(_0x4daa18,_0xc362e1){var _0xb3616f={'raw':![],'where':{'id':_0x4daa18[_0x4b71('0x43')]['id']}},_0x26f9f9={};_0x26f9f9[_0x4b71('0x34')]=_[_0x4b71('0x44')](db[_0x4b71('0x2c')][_0x4b71('0x2d')]);_0x26f9f9[_0x4b71('0x31')]=_[_0x4b71('0x44')](_0x4daa18[_0x4b71('0x31')]);_0x26f9f9['filters']=_[_0x4b71('0x33')](_0x26f9f9[_0x4b71('0x34')],_0x26f9f9[_0x4b71('0x31')]);_0xb3616f[_0x4b71('0x35')]=_['intersection'](_0x26f9f9[_0x4b71('0x34')],qs[_0x4b71('0x36')](_0x4daa18[_0x4b71('0x31')][_0x4b71('0x36')]));_0xb3616f[_0x4b71('0x35')]=_0xb3616f[_0x4b71('0x35')][_0x4b71('0x37')]?_0xb3616f[_0x4b71('0x35')]:_0x26f9f9[_0x4b71('0x34')];if(_0x4daa18[_0x4b71('0x31')][_0x4b71('0x40')]){_0xb3616f[_0x4b71('0x45')]=[{'all':!![]}];}_0xb3616f=_[_0x4b71('0x3d')]({},_0xb3616f,_0x4daa18['options']);return db['AnalyticCustomReport']['find'](_0xb3616f)[_0x4b71('0x24')](handleEntityNotFound(_0xc362e1,null))[_0x4b71('0x24')](respondWithResult(_0xc362e1,null))[_0x4b71('0x46')](handleError(_0xc362e1,null));};exports[_0x4b71('0x47')]=function(_0x30b62f,_0x42d5a1){return db[_0x4b71('0x2c')]['create'](_0x30b62f[_0x4b71('0x48')],{})[_0x4b71('0x24')](function(_0x3483bf){var _0x3acb9b=_0x30b62f[_0x4b71('0x49')][_0x4b71('0x4a')]({'plain':!![]});if(!_0x3acb9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3acb9b['role']===_0x4b71('0x49')){var _0x46d423=_0x3483bf[_0x4b71('0x4a')]({'plain':!![]});var _0x40ca69=_0x4b71('0x4b');return db[_0x4b71('0x4c')]['find']({'where':{'name':_0x40ca69,'userProfileId':_0x3acb9b['userProfileId']},'raw':!![]})[_0x4b71('0x24')](function(_0x43a205){if(_0x43a205&&_0x43a205[_0x4b71('0x4d')]===0x0){return db[_0x4b71('0x26')][_0x4b71('0x47')]({'name':_0x46d423['name'],'resourceId':_0x46d423['id'],'type':'CustomReports','sectionId':_0x43a205['id']},{})[_0x4b71('0x24')](function(){return _0x3483bf;});}else{return _0x3483bf;}})[_0x4b71('0x46')](function(_0x320759){logger[_0x4b71('0x27')](_0x4b71('0x4e'),_0x320759);throw _0x320759;});}return _0x3483bf;})[_0x4b71('0x24')](respondWithResult(_0x42d5a1,0xc9))[_0x4b71('0x46')](handleError(_0x42d5a1,null));};exports[_0x4b71('0x22')]=function(_0x351cec,_0x53cd0d){if(_0x351cec['body']['id']){delete _0x351cec[_0x4b71('0x48')]['id'];}return db[_0x4b71('0x2c')][_0x4b71('0x4f')]({'where':{'id':_0x351cec[_0x4b71('0x43')]['id']}})[_0x4b71('0x24')](handleEntityNotFound(_0x53cd0d,null))['then'](saveUpdates(_0x351cec[_0x4b71('0x48')],null))[_0x4b71('0x24')](respondWithResult(_0x53cd0d,null))[_0x4b71('0x46')](handleError(_0x53cd0d,null));};exports['destroy']=function(_0x54574c,_0x53c024){return db[_0x4b71('0x2c')][_0x4b71('0x4f')]({'where':{'id':_0x54574c[_0x4b71('0x43')]['id']}})[_0x4b71('0x24')](handleEntityNotFound(_0x53c024,null))['then'](removeEntity(_0x53c024,null))[_0x4b71('0x46')](handleError(_0x53c024,null));};exports[_0x4b71('0x50')]=function(_0x4e6a2b,_0x5756ab){var _0x54c4f5=0xa;var _0x3653f9=[_0x4b71('0x51'),_0x4b71('0x52'),_0x4b71('0x53'),_0x4b71('0x54')];var _0x1e7857={'SUM':_0x4b71('0x55'),'COUNT':_0x4b71('0x56'),'COUNT DISTINCT':_0x4b71('0x57'),'MAX':_0x4b71('0x58'),'MIN':_0x4b71('0x59'),'AVG':_0x4b71('0x5a'),'GROUP_CONCAT':_0x4b71('0x5b'),'GROUP_CONCAT ASC':_0x4b71('0x5c'),'GROUP_CONCAT DESC':_0x4b71('0x5d')};var _0x3cfedf={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4b71('0x5e'),'HOUR':_0x4b71('0x5f'),'ROUND':_0x4b71('0x60'),'UNIX_TIMESTAMP':_0x4b71('0x61')};var _0x2bde99=function(_0x342847){return!_[_0x4b71('0x62')]([_0x4b71('0x63'),_0x4b71('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x342847);};var _0x5dd822=function(_0x3c705f){if(!_0x3c705f||!_0x3c705f[_0x4b71('0x65')][_0x4b71('0x37')]){return'';}for(var _0x2f00c1='(',_0x5e0923=0x0;_0x5e0923<_0x3c705f[_0x4b71('0x65')][_0x4b71('0x37')];_0x5e0923+=0x1){_0x5e0923>0x0&&(_0x2f00c1+='\x20'+_0x3c705f[_0x4b71('0x66')]+'\x20');_0x2f00c1+=_0x3c705f[_0x4b71('0x65')][_0x5e0923][_0x4b71('0x67')]?_0x5dd822(_0x3c705f['rules'][_0x5e0923][_0x4b71('0x67')]):_0x3c705f['rules'][_0x5e0923]['field']+'\x20'+_0x3c705f[_0x4b71('0x65')][_0x5e0923][_0x4b71('0x68')]+(_0x2bde99(_0x3c705f[_0x4b71('0x65')][_0x5e0923][_0x4b71('0x68')])?'\x20'+_0x3c705f[_0x4b71('0x65')][_0x5e0923]['value']:'');}return _0x2f00c1+')';};var _0x20a060={'where':{'id':_0x4e6a2b[_0x4b71('0x43')]['id']}},_0x35fed2,_0xcb9ce6,_0x1303aa,_0x575855,_0x3d1ab7;_0x20a060=_[_0x4b71('0x3d')]({},_0x20a060,_0x4e6a2b['options']);return db[_0x4b71('0x2c')][_0x4b71('0x4f')](_0x20a060)[_0x4b71('0x24')](function(_0x44cf20){if(_0x44cf20){_0x35fed2=_0x44cf20;return _0x44cf20['getFields']();}return null;})[_0x4b71('0x24')](function(_0x3a812e){if(_0x3a812e){if(!_0x3a812e[_0x4b71('0x37')]){throw new db[(_0x4b71('0x69'))][(_0x4b71('0x6a'))](_0x4b71('0x6b'),0x193);}_0xcb9ce6=_0x3a812e;return db[_0x4b71('0x6c')][_0x4b71('0x6d')]({'raw':!![]});}return null;})[_0x4b71('0x24')](function(_0x2a53f3){if(_0x2a53f3){_0x1303aa=_['keyBy'](_0x2a53f3,'id');var _0x3fb333;var _0x266145=squel[_0x4b71('0x6e')]();_0x266145[_0x4b71('0x6f')](_0x35fed2[_0x4b71('0x70')]);for(var _0x576a51=0x0;_0x576a51<_0xcb9ce6[_0x4b71('0x37')];_0x576a51+=0x1){_0x3fb333=_0xcb9ce6[_0x576a51]['MetricId']?_0x1303aa[_0xcb9ce6[_0x576a51]['MetricId']][_0x4b71('0x71')]:_0xcb9ce6[_0x576a51]['field'];_0x3fb333=_0xcb9ce6[_0x576a51]['function']?_[_0x4b71('0x72')](_0x1e7857[_0xcb9ce6[_0x576a51][_0x4b71('0x73')]],'%s',_0x3fb333):_0x3fb333;_0x3fb333=_0xcb9ce6[_0x576a51][_0x4b71('0x74')]?_[_0x4b71('0x72')](_0x3cfedf[_0xcb9ce6[_0x576a51][_0x4b71('0x74')]],'%s',_0x3fb333):_0x3fb333;if(_0xcb9ce6[_0x576a51]['groupBy']){_0x266145[_0x4b71('0x67')](_0x3fb333);}_0xcb9ce6[_0x576a51]['orderBy']&&_0x266145[_0x4b71('0x75')](_0x3fb333,_0xcb9ce6[_0x576a51]['orderBy']==='DESC'?![]:!![]);_0x266145[_0x4b71('0x76')](_0x3fb333,_0xcb9ce6[_0x576a51][_0x4b71('0x77')]||_0x3fb333);}if(_0x35fed2[_0x4b71('0x78')]){_0x35fed2['joins']=JSON[_0x4b71('0x79')](_0x35fed2[_0x4b71('0x78')]);for(var _0x593afd=0x0;_0x593afd<_0x35fed2[_0x4b71('0x78')]['length'];_0x593afd+=0x1){if(_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x2f')]&&_[_0x4b71('0x62')](_0x3653f9,_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x2f')])&&_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7a')]&&_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7b')]&&_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7c')]){_0x266145[_0x35fed2['joins'][_0x593afd]['type']](_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7b')],null,util[_0x4b71('0x74')]('%s.%s\x20=\x20%s.%s',_0x35fed2[_0x4b71('0x70')],_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7a')],_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7b')],_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7c')]));}}}if(_0x35fed2['conditions']){_0x35fed2[_0x4b71('0x7d')]=JSON['parse'](_0x35fed2[_0x4b71('0x7d')]);_0x266145['where'](_0x5dd822(_0x35fed2['conditions'][_0x4b71('0x67')]));}_0x3d1ab7=_0x266145[_0x4b71('0x7e')]();_0x266145[_0x4b71('0x1c')](_0x54c4f5);_0x266145[_0x4b71('0x1e')](0x0);logger[_0x4b71('0x7f')]('Limited\x20Query:',_0x266145[_0x4b71('0x80')]());return dbH['sequelize'][_0x4b71('0x31')](_0x266145[_0x4b71('0x80')](),{'type':dbH[_0x4b71('0x81')][_0x4b71('0x82')][_0x4b71('0x83')]});}})[_0x4b71('0x24')](respondWithResult(_0x5756ab,null))[_0x4b71('0x46')](handleError(_0x5756ab,null));};function runReport(_0x4b1063,_0x37edce,_0x385587){var _0xb146fc=_0x37edce['name'];var _0x573b4d=0xa;var _0x54b3a7=['join',_0x4b71('0x52'),_0x4b71('0x53'),'cross_join'];var _0x1db998={'SUM':'SUM(%s)','COUNT':_0x4b71('0x56'),'COUNT DISTINCT':_0x4b71('0x57'),'MAX':_0x4b71('0x58'),'MIN':'MIN(%s)','AVG':_0x4b71('0x5a'),'GROUP_CONCAT':_0x4b71('0x5b'),'GROUP_CONCAT ASC':_0x4b71('0x5c'),'GROUP_CONCAT DESC':_0x4b71('0x5d')};var _0x48b06a={'SEC_TO_TIME':_0x4b71('0x84'),'DATE':_0x4b71('0x5e'),'HOUR':_0x4b71('0x5f'),'ROUND':_0x4b71('0x60'),'UNIX_TIMESTAMP':_0x4b71('0x61')};var _0x94aa54=function(_0x137ec9){return!_['includes']([_0x4b71('0x63'),_0x4b71('0x64'),_0x4b71('0x85'),_0x4b71('0x86')],_0x137ec9);};var _0x5e2eac=function(_0x5b67d1){if(!_0x5b67d1||!_0x5b67d1[_0x4b71('0x65')][_0x4b71('0x37')]){return'';}for(var _0x52696c='(',_0x28ff05=0x0;_0x28ff05<_0x5b67d1[_0x4b71('0x65')]['length'];_0x28ff05+=0x1){_0x28ff05>0x0&&(_0x52696c+='\x20'+_0x5b67d1[_0x4b71('0x66')]+'\x20');_0x52696c+=_0x5b67d1[_0x4b71('0x65')][_0x28ff05][_0x4b71('0x67')]?_0x5e2eac(_0x5b67d1['rules'][_0x28ff05][_0x4b71('0x67')]):_0x5b67d1['rules'][_0x28ff05]['field']+'\x20'+_0x5b67d1[_0x4b71('0x65')][_0x28ff05][_0x4b71('0x68')]+(_0x94aa54(_0x5b67d1['rules'][_0x28ff05]['condition'])?'\x20'+_0x5b67d1[_0x4b71('0x65')][_0x28ff05]['value']:'');}return _0x52696c+')';};var _0x4ddb65={'where':{'id':_0x4b1063['id']}},_0x1abe2b,_0x3843f7,_0x33acf6,_0x344a97,_0x353a80;_0x4ddb65=_[_0x4b71('0x3d')]({},_0x4ddb65,_0x385587);return db['AnalyticCustomReport'][_0x4b71('0x4f')](_0x4ddb65)['then'](function(_0x1a962b){if(_0x1a962b){_0x1abe2b=_0x1a962b;return _0x1a962b[_0x4b71('0x87')]();}return null;})['then'](function(_0xcc826e){if(_0xcc826e){if(!_0xcc826e[_0x4b71('0x37')]){throw new db[(_0x4b71('0x69'))][(_0x4b71('0x6a'))](_0x4b71('0x6b'),0x193);}_0x3843f7=_0xcc826e;return db[_0x4b71('0x6c')][_0x4b71('0x6d')]({'raw':!![]});}return null;})[_0x4b71('0x24')](function(_0x4b6439){if(_0x4b6439){_0x33acf6=_[_0x4b71('0x88')](_0x4b6439,'id');var _0xefed23;var _0x43c4dc=squel[_0x4b71('0x6e')]();_0x43c4dc[_0x4b71('0x6f')](_0x1abe2b[_0x4b71('0x70')]);for(var _0x2b0769=0x0;_0x2b0769<_0x3843f7[_0x4b71('0x37')];_0x2b0769+=0x1){_0xefed23=_0x3843f7[_0x2b0769]['MetricId']?_0x33acf6[_0x3843f7[_0x2b0769]['MetricId']][_0x4b71('0x71')]:_0x3843f7[_0x2b0769][_0x4b71('0x76')];_0xefed23=_0x3843f7[_0x2b0769][_0x4b71('0x73')]?_['replace'](_0x1db998[_0x3843f7[_0x2b0769][_0x4b71('0x73')]],'%s',_0xefed23):_0xefed23;_0xefed23=_0x3843f7[_0x2b0769][_0x4b71('0x74')]?_[_0x4b71('0x72')](_0x48b06a[_0x3843f7[_0x2b0769][_0x4b71('0x74')]],'%s',_0xefed23):_0xefed23;if(_0x3843f7[_0x2b0769][_0x4b71('0x89')]){_0x43c4dc[_0x4b71('0x67')](_0xefed23);}_0x3843f7[_0x2b0769][_0x4b71('0x8a')]&&_0x43c4dc[_0x4b71('0x75')](_0xefed23,_0x3843f7[_0x2b0769][_0x4b71('0x8a')]===_0x4b71('0x8b')?![]:!![]);_0x43c4dc[_0x4b71('0x76')](_0xefed23,_0x3843f7[_0x2b0769]['alias']||_0xefed23);}if(_0x1abe2b[_0x4b71('0x78')]){_0x1abe2b['joins']=JSON['parse'](_0x1abe2b[_0x4b71('0x78')]);for(var _0x40b2bf=0x0;_0x40b2bf<_0x1abe2b[_0x4b71('0x78')][_0x4b71('0x37')];_0x40b2bf+=0x1){if(_0x1abe2b[_0x4b71('0x78')][_0x40b2bf]['type']&&_['includes'](_0x54b3a7,_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x2f')])&&_0x1abe2b[_0x4b71('0x78')][_0x40b2bf]['parentKey']&&_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x7b')]&&_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x7c')]){_0x43c4dc[_0x1abe2b['joins'][_0x40b2bf][_0x4b71('0x2f')]](_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x7b')],null,util[_0x4b71('0x74')]('%s.%s\x20=\x20%s.%s',_0x1abe2b[_0x4b71('0x70')],_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x7a')],_0x1abe2b['joins'][_0x40b2bf]['foreignTable'],_0x1abe2b[_0x4b71('0x78')][_0x40b2bf]['foreignKey']));}}}if(_0x1abe2b[_0x4b71('0x7d')]){_0x1abe2b['conditions']=JSON[_0x4b71('0x79')](_0x1abe2b[_0x4b71('0x7d')]);_0x43c4dc[_0x4b71('0x3a')](_0x5e2eac(_0x1abe2b[_0x4b71('0x7d')]['group']));}_0x353a80=_0x43c4dc[_0x4b71('0x7e')]();_0x43c4dc[_0x4b71('0x1c')](_0x573b4d);_0x43c4dc[_0x4b71('0x1e')](0x0);return;}})['then'](function(){if(_0x37edce[_0x4b71('0x8c')]==='web'){return null;}var _0x27158e=_[_0x4b71('0x3d')](_0x37edce,{'name':_0x37edce[_0x4b71('0x8d')]||_0x37edce[_0x4b71('0x29')]||_0x1abe2b[_0x4b71('0x29')],'basename':_0xb146fc,'savename':util[_0x4b71('0x74')](_0x4b71('0x8e'),_0x37edce[_0x4b71('0x29')]||_0x1abe2b['name'],require(_0x4b71('0x8f'))[_0x4b71('0x90')](0x4),_0x37edce['output']||_0x4b71('0x91')),'reportId':_0x1abe2b['id'],'reportType':_0x4b71('0x92')});return db[_0x4b71('0x93')][_0x4b71('0x47')](_0x27158e,{'raw':!![]});})[_0x4b71('0x24')](function(_0x44afca){if(_0x1abe2b[_0x4b71('0x70')]===_0x4b71('0x94')){_0x353a80[_0x4b71('0x3a')](_0x1abe2b[_0x4b71('0x70')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x37edce['startDate'],_0x37edce[_0x4b71('0x95')]);}else{_0x353a80[_0x4b71('0x3a')](_0x1abe2b['table']+_0x4b71('0x96'),_0x37edce[_0x4b71('0x97')],_0x37edce[_0x4b71('0x95')]);}if(_0x44afca){logger[_0x4b71('0x98')](_0x4b71('0x99'),_0x353a80[_0x4b71('0x80')]());require('child_process')['fork'](path[_0x4b71('0x51')](__dirname,'../../components/export/',_0x44afca['output']),[_0x44afca['id'],_0x353a80[_0x4b71('0x80')](),path['join'](__dirname,_0x4b71('0x9a'),_0x44afca[_0x4b71('0x9b')]),_0xb146fc]);return _0x44afca;}else{var _0x5de31e=squel['select']();_0x5de31e['from']('('+_0x353a80[_0x4b71('0x80')]()+')',_0x4b71('0x9c'));_0x5de31e['field']('COUNT(*)',_0x4b71('0x1d'));_0x353a80[_0x4b71('0x1c')](_0x37edce[_0x4b71('0x1c')]||_0x573b4d);_0x353a80[_0x4b71('0x1e')](_0x37edce['offset']||0x0);return dbH[_0x4b71('0x81')]['query'](_0x5de31e[_0x4b71('0x80')](),{'type':dbH['sequelize'][_0x4b71('0x82')][_0x4b71('0x83')]})['then'](function(_0x2d95f4){if(!_0x2d95f4[_0x4b71('0x37')]){_0x344a97=0x0;}else{_0x344a97=_0x2d95f4[0x0]['count']||0x0;}return dbH[_0x4b71('0x81')][_0x4b71('0x31')](_0x353a80[_0x4b71('0x80')](),{'type':dbH['sequelize'][_0x4b71('0x82')][_0x4b71('0x83')]});})[_0x4b71('0x24')](function(_0x554338){return{'rows':_0x554338||[],'count':_0x344a97};});}});}exports['run']=function(_0x1f6bdb,_0x37a0ce){return runReport(_0x1f6bdb[_0x4b71('0x43')],_0x1f6bdb[_0x4b71('0x31')],_0x1f6bdb[_0x4b71('0x3f')])[_0x4b71('0x24')](respondWithResult(_0x37a0ce,null))['catch'](handleError(_0x37a0ce,null));};exports[_0x4b71('0x9d')]=runReport;exports['query']=function(_0x462f4b,_0x3dfb39){var _0x5f5613=0xa;var _0x1b5d62=[_0x4b71('0x51'),_0x4b71('0x52'),_0x4b71('0x53'),_0x4b71('0x54')];var _0x26a454={'SUM':_0x4b71('0x55'),'COUNT':_0x4b71('0x56'),'COUNT DISTINCT':_0x4b71('0x57'),'MAX':_0x4b71('0x58'),'MIN':_0x4b71('0x59'),'AVG':_0x4b71('0x5a'),'GROUP_CONCAT':_0x4b71('0x5b'),'GROUP_CONCAT ASC':_0x4b71('0x5c'),'GROUP_CONCAT DESC':_0x4b71('0x5d')};var _0x3bf11e={'SEC_TO_TIME':_0x4b71('0x84'),'DATE':_0x4b71('0x5e'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4b71('0x61')};var _0xbe10dc=function(_0x26337b){return!_[_0x4b71('0x62')](['IS\x20NULL',_0x4b71('0x64'),_0x4b71('0x85'),'IS\x20NOT\x20EMPTY'],_0x26337b);};var _0x3c49a5=function(_0x54b2b8){if(!_0x54b2b8||!_0x54b2b8[_0x4b71('0x65')]['length']){return'';}for(var _0x48490b='(',_0x331421=0x0;_0x331421<_0x54b2b8[_0x4b71('0x65')][_0x4b71('0x37')];_0x331421+=0x1){_0x331421>0x0&&(_0x48490b+='\x20'+_0x54b2b8[_0x4b71('0x66')]+'\x20');_0x48490b+=_0x54b2b8['rules'][_0x331421][_0x4b71('0x67')]?_0x3c49a5(_0x54b2b8['rules'][_0x331421][_0x4b71('0x67')]):_0x54b2b8[_0x4b71('0x65')][_0x331421]['field']+'\x20'+_0x54b2b8[_0x4b71('0x65')][_0x331421][_0x4b71('0x68')]+(_0xbe10dc(_0x54b2b8[_0x4b71('0x65')][_0x331421][_0x4b71('0x68')])?'\x20'+_0x54b2b8[_0x4b71('0x65')][_0x331421][_0x4b71('0x9e')]:'');}return _0x48490b+')';};var _0x118f1e={'where':{'id':_0x462f4b[_0x4b71('0x43')]['id']}},_0x30cf30,_0xef3c53,_0x3eefb6,_0x61fc54,_0x58d07b;_0x118f1e=_['merge']({},_0x118f1e,_0x462f4b[_0x4b71('0x3f')]);return db['AnalyticCustomReport'][_0x4b71('0x4f')](_0x118f1e)['then'](function(_0x1a206d){if(_0x1a206d){_0x30cf30=_0x1a206d;return _0x1a206d['getFields']();}return null;})[_0x4b71('0x24')](function(_0x14f65c){if(_0x14f65c){if(!_0x14f65c[_0x4b71('0x37')]){throw new db[(_0x4b71('0x69'))][(_0x4b71('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xef3c53=_0x14f65c;return db[_0x4b71('0x6c')][_0x4b71('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x2cf171){if(_0x2cf171){_0x3eefb6=_[_0x4b71('0x88')](_0x2cf171,'id');var _0x1a2be9;var _0x4151f7=squel[_0x4b71('0x6e')]();_0x4151f7['from'](_0x30cf30[_0x4b71('0x70')]);for(var _0xc8907e=0x0;_0xc8907e<_0xef3c53[_0x4b71('0x37')];_0xc8907e+=0x1){_0x1a2be9=_0xef3c53[_0xc8907e][_0x4b71('0x9f')]?_0x3eefb6[_0xef3c53[_0xc8907e][_0x4b71('0x9f')]][_0x4b71('0x71')]:_0xef3c53[_0xc8907e][_0x4b71('0x76')];_0x1a2be9=_0xef3c53[_0xc8907e]['function']?_[_0x4b71('0x72')](_0x26a454[_0xef3c53[_0xc8907e][_0x4b71('0x73')]],'%s',_0x1a2be9):_0x1a2be9;_0x1a2be9=_0xef3c53[_0xc8907e][_0x4b71('0x74')]?_[_0x4b71('0x72')](_0x3bf11e[_0xef3c53[_0xc8907e][_0x4b71('0x74')]],'%s',_0x1a2be9):_0x1a2be9;if(_0xef3c53[_0xc8907e][_0x4b71('0x89')]){_0x4151f7['group'](_0x1a2be9);}_0xef3c53[_0xc8907e][_0x4b71('0x8a')]&&_0x4151f7[_0x4b71('0x75')](_0x1a2be9,_0xef3c53[_0xc8907e][_0x4b71('0x8a')]===_0x4b71('0x8b')?![]:!![]);_0x4151f7[_0x4b71('0x76')](_0x1a2be9,_0xef3c53[_0xc8907e][_0x4b71('0x77')]||_0x1a2be9);}if(_0x30cf30[_0x4b71('0x78')]){_0x30cf30[_0x4b71('0x78')]=JSON[_0x4b71('0x79')](_0x30cf30[_0x4b71('0x78')]);for(var _0x1f0e35=0x0;_0x1f0e35<_0x30cf30[_0x4b71('0x78')][_0x4b71('0x37')];_0x1f0e35+=0x1){if(_0x30cf30['joins'][_0x1f0e35][_0x4b71('0x2f')]&&_[_0x4b71('0x62')](_0x1b5d62,_0x30cf30[_0x4b71('0x78')][_0x1f0e35]['type'])&&_0x30cf30[_0x4b71('0x78')][_0x1f0e35]['parentKey']&&_0x30cf30['joins'][_0x1f0e35]['foreignTable']&&_0x30cf30['joins'][_0x1f0e35][_0x4b71('0x7c')]){_0x4151f7[_0x30cf30['joins'][_0x1f0e35][_0x4b71('0x2f')]](_0x30cf30['joins'][_0x1f0e35]['foreignTable'],null,util['format'](_0x4b71('0xa0'),_0x30cf30['table'],_0x30cf30[_0x4b71('0x78')][_0x1f0e35][_0x4b71('0x7a')],_0x30cf30[_0x4b71('0x78')][_0x1f0e35][_0x4b71('0x7b')],_0x30cf30['joins'][_0x1f0e35]['foreignKey']));}}}if(_0x30cf30[_0x4b71('0x7d')]){_0x30cf30[_0x4b71('0x7d')]=JSON[_0x4b71('0x79')](_0x30cf30[_0x4b71('0x7d')]);_0x4151f7[_0x4b71('0x3a')](_0x3c49a5(_0x30cf30[_0x4b71('0x7d')][_0x4b71('0x67')]));}_0x58d07b=_0x4151f7[_0x4b71('0x7e')]();_0x4151f7['limit'](_0x5f5613);_0x4151f7['offset'](0x0);logger['debug']('Limited\x20Query:',_0x4151f7[_0x4b71('0x80')]());return dbH[_0x4b71('0x81')]['query'](_0x4151f7[_0x4b71('0x80')](),{'type':dbH[_0x4b71('0x81')][_0x4b71('0x82')][_0x4b71('0x83')]});}})['then'](function(){return{'sql':_0x58d07b[_0x4b71('0x80')]()};})[_0x4b71('0x24')](respondWithResult(_0x3dfb39,null))[_0x4b71('0x46')](handleError(_0x3dfb39,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index e60e570..14eb8e8 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 _0xcdf7=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3f11cb,_0x39f8fd){var _0x818b35=function(_0x38d95b){while(--_0x38d95b){_0x3f11cb['push'](_0x3f11cb['shift']());}};_0x818b35(++_0x39f8fd);}(_0xcdf7,0x17a));var _0x7cdf=function(_0x264c3b,_0x474ae2){_0x264c3b=_0x264c3b-0x0;var _0x1977ef=_0xcdf7[_0x264c3b];return _0x1977ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7cdf('0x0'))(_0x7cdf('0x1'));var moment=require(_0x7cdf('0x2'));var BPromise=require(_0x7cdf('0x3'));var rp=require(_0x7cdf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cdf('0x5'));var config=require(_0x7cdf('0x6'));var attributes=require(_0x7cdf('0x7'));module[_0x7cdf('0x8')]=function(_0x29877c,_0x54906d){return _0x29877c[_0x7cdf('0x9')](_0x7cdf('0xa'),attributes,{'tableName':_0x7cdf('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf611=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0xf611,0x65));var _0x1f61=function(_0x1e62b8,_0x5eed4c){_0x1e62b8=_0x1e62b8-0x0;var _0x2ab271=_0xf611[_0x1e62b8];return _0x2ab271;};'use strict';var _=require(_0x1f61('0x0'));var util=require(_0x1f61('0x1'));var logger=require('../../config/logger')(_0x1f61('0x2'));var moment=require(_0x1f61('0x3'));var BPromise=require(_0x1f61('0x4'));var rp=require(_0x1f61('0x5'));var fs=require('fs');var path=require(_0x1f61('0x6'));var rimraf=require(_0x1f61('0x7'));var config=require(_0x1f61('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x1f61('0x9')]=function(_0x111773,_0x2553e7){return _0x111773[_0x1f61('0xa')](_0x1f61('0xb'),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 a3c14cd..99dbf38 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 _0x0a25=['error','code','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x0a25,0x1a9));var _0x50a2=function(_0x425a95,_0x2743b6){_0x425a95=_0x425a95-0x0;var _0x270c10=_0x0a25[_0x425a95];return _0x270c10;};'use strict';var _=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var moment=require(_0x50a2('0x2'));var BPromise=require(_0x50a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50a2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x50a2('0x5'));var logger=require(_0x50a2('0x6'))(_0x50a2('0x7'));var config=require('../../config/environment');var jayson=require(_0x50a2('0x8'));var client=jayson[_0x50a2('0x9')][_0x50a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548ab2,_0x11dde6,_0x1caac0){return new BPromise(function(_0x694333,_0x33c1c1){return client['request'](_0x548ab2,_0x1caac0)[_0x50a2('0xb')](function(_0x103a7f){logger[_0x50a2('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x11dde6,'request\x20sent');logger['debug'](_0x50a2('0xd'),_0x11dde6,_0x50a2('0xe'),JSON[_0x50a2('0xf')](_0x103a7f));if(_0x103a7f['error']){if(_0x103a7f[_0x50a2('0x10')][_0x50a2('0x11')]===0x1f4){logger[_0x50a2('0x10')](_0x50a2('0x12'),_0x11dde6,_0x103a7f[_0x50a2('0x10')]['message']);return _0x33c1c1(_0x103a7f[_0x50a2('0x10')][_0x50a2('0x13')]);}logger['error'](_0x50a2('0x12'),_0x11dde6,_0x103a7f[_0x50a2('0x10')][_0x50a2('0x13')]);return _0x694333(_0x103a7f[_0x50a2('0x10')][_0x50a2('0x13')]);}else{logger[_0x50a2('0xc')](_0x50a2('0x12'),_0x11dde6,_0x50a2('0xe'));_0x694333(_0x103a7f['result']['message']);}})[_0x50a2('0x14')](function(_0x5b1de4){logger[_0x50a2('0x10')](_0x50a2('0x12'),_0x11dde6,_0x5b1de4);_0x33c1c1(_0x5b1de4);});});}
\ No newline at end of file
+var _0x09e8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis'];(function(_0x5534fe,_0x43c22e){var _0x3d1dc2=function(_0x9df12){while(--_0x9df12){_0x5534fe['push'](_0x5534fe['shift']());}};_0x3d1dc2(++_0x43c22e);}(_0x09e8,0x70));var _0x809e=function(_0x374db6,_0x43919b){_0x374db6=_0x374db6-0x0;var _0x179262=_0x09e8[_0x374db6];return _0x179262;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x809e('0x0'));var rs=require(_0x809e('0x1'));var fs=require('fs');var Redis=require(_0x809e('0x2'));var db=require(_0x809e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x809e('0x4'))(_0x809e('0x5'));var config=require(_0x809e('0x6'));var jayson=require(_0x809e('0x7'));var client=jayson[_0x809e('0x8')][_0x809e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55bf91,_0x4a61fa,_0x219dfc){return new BPromise(function(_0x28545f,_0x122dbe){return client[_0x809e('0xa')](_0x55bf91,_0x219dfc)[_0x809e('0xb')](function(_0x25c64c){logger[_0x809e('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4a61fa,_0x809e('0xd'));logger[_0x809e('0xe')](_0x809e('0xf'),_0x4a61fa,'request\x20sent',JSON[_0x809e('0x10')](_0x25c64c));if(_0x25c64c[_0x809e('0x11')]){if(_0x25c64c[_0x809e('0x11')][_0x809e('0x12')]===0x1f4){logger[_0x809e('0x11')](_0x809e('0x13'),_0x4a61fa,_0x25c64c[_0x809e('0x11')][_0x809e('0x14')]);return _0x122dbe(_0x25c64c[_0x809e('0x11')][_0x809e('0x14')]);}logger[_0x809e('0x11')](_0x809e('0x13'),_0x4a61fa,_0x25c64c[_0x809e('0x11')][_0x809e('0x14')]);return _0x28545f(_0x25c64c['error'][_0x809e('0x14')]);}else{logger[_0x809e('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4a61fa,_0x809e('0xd'));_0x28545f(_0x25c64c[_0x809e('0x15')]['message']);}})[_0x809e('0x16')](function(_0x2af89c){logger['error'](_0x809e('0x13'),_0x4a61fa,_0x2af89c);_0x122dbe(_0x2af89c);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 7b9a12c..65bdb4e 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 _0x9412=['get','/:id','show','/:id/preview','run','query','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index'];(function(_0x489618,_0x233987){var _0x3d34b8=function(_0xe4ffd0){while(--_0xe4ffd0){_0x489618['push'](_0x489618['shift']());}};_0x3d34b8(++_0x233987);}(_0x9412,0x197));var _0x2941=function(_0x360206,_0x7c26ef){_0x360206=_0x360206-0x0;var _0x48eaad=_0x9412[_0x360206];return _0x48eaad;};'use strict';var multer=require(_0x2941('0x0'));var util=require('util');var path=require(_0x2941('0x1'));var timeout=require(_0x2941('0x2'));var express=require(_0x2941('0x3'));var router=express[_0x2941('0x4')]();var fs_extra=require(_0x2941('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2941('0x6'));var config=require(_0x2941('0x7'));var controller=require(_0x2941('0x8'));router['get']('/',auth[_0x2941('0x9')](),controller[_0x2941('0xa')]);router[_0x2941('0xb')](_0x2941('0xc'),auth[_0x2941('0x9')](),controller[_0x2941('0xd')]);router[_0x2941('0xb')](_0x2941('0xe'),auth[_0x2941('0x9')](),controller['preview']);router[_0x2941('0xb')]('/:id/run',auth[_0x2941('0x9')](),controller[_0x2941('0xf')]);router[_0x2941('0xb')]('/:id/query',auth[_0x2941('0x9')](),controller[_0x2941('0x10')]);router[_0x2941('0x11')]('/',auth[_0x2941('0x9')](),controller[_0x2941('0x12')]);router[_0x2941('0x13')](_0x2941('0xc'),auth[_0x2941('0x9')](),controller['update']);router['delete'](_0x2941('0xc'),auth['isAuthenticated'](),controller[_0x2941('0x14')]);module[_0x2941('0x15')]=router;
\ No newline at end of file
+var _0x2c6f=['/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x2c6f,0x1c6));var _0xf2c6=function(_0x5413a5,_0x3e3c8b){_0x5413a5=_0x5413a5-0x0;var _0xed3967=_0x2c6f[_0x5413a5];return _0xed3967;};'use strict';var multer=require('multer');var util=require(_0xf2c6('0x0'));var path=require('path');var timeout=require(_0xf2c6('0x1'));var express=require(_0xf2c6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf2c6('0x3'));var interaction=require(_0xf2c6('0x4'));var config=require(_0xf2c6('0x5'));var controller=require(_0xf2c6('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf2c6('0x7')](_0xf2c6('0x8'),auth[_0xf2c6('0x9')](),controller[_0xf2c6('0xa')]);router[_0xf2c6('0x7')](_0xf2c6('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0xf2c6('0x7')](_0xf2c6('0xc'),auth[_0xf2c6('0x9')](),controller[_0xf2c6('0xd')]);router[_0xf2c6('0x7')](_0xf2c6('0xe'),auth[_0xf2c6('0x9')](),controller['query']);router[_0xf2c6('0xf')]('/',auth['isAuthenticated'](),controller[_0xf2c6('0x10')]);router[_0xf2c6('0x11')](_0xf2c6('0x8'),auth[_0xf2c6('0x9')](),controller[_0xf2c6('0x12')]);router[_0xf2c6('0x13')](_0xf2c6('0x8'),auth[_0xf2c6('0x9')](),controller[_0xf2c6('0x14')]);module[_0xf2c6('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 3cc4ad6..6bee773 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 _0x8958=['TEXT','exports'];(function(_0x7b544a,_0x33c45a){var _0x33dcb4=function(_0x5ebc7f){while(--_0x5ebc7f){_0x7b544a['push'](_0x7b544a['shift']());}};_0x33dcb4(++_0x33c45a);}(_0x8958,0x93));var _0x8895=function(_0x436e22,_0x2f6821){_0x436e22=_0x436e22-0x0;var _0x524f42=_0x8958[_0x436e22];return _0x524f42;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5d58=['TEXT','STRING'];(function(_0x4747ce,_0x31e43c){var _0x307ed5=function(_0x28ed8){while(--_0x28ed8){_0x4747ce['push'](_0x4747ce['shift']());}};_0x307ed5(++_0x31e43c);}(_0x5d58,0x187));var _0x85d5=function(_0x235d34,_0x3a8ab5){_0x235d34=_0x235d34-0x0;var _0x113859=_0x5d58[_0x235d34];return _0x113859;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'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 24dc81b..7218c52 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xabce[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
+var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4acdd0,_0x4d1f59){var _0x392ba5=function(_0x30cab7){while(--_0x30cab7){_0x4acdd0['push'](_0x4acdd0['shift']());}};_0x392ba5(++_0x4d1f59);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index fec1947..9cb50a7 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 _0x1c00=['define','analytics_default_reports','lodash','util','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x35fa7a,_0x25f079){var _0x1d0cb0=function(_0x5c7047){while(--_0x5c7047){_0x35fa7a['push'](_0x35fa7a['shift']());}};_0x1d0cb0(++_0x25f079);}(_0x1c00,0x1a6));var _0x01c0=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x1c00[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x01c0('0x0'));var util=require(_0x01c0('0x1'));var logger=require('../../config/logger')(_0x01c0('0x2'));var moment=require(_0x01c0('0x3'));var BPromise=require(_0x01c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x01c0('0x5'));var config=require(_0x01c0('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x01c0('0x7')]=function(_0x5353e3,_0xe98ddb){return _0x5353e3[_0x01c0('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x01c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa03=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x113c32,_0x555a00){var _0x1e50c0=function(_0x440a25){while(--_0x440a25){_0x113c32['push'](_0x113c32['shift']());}};_0x1e50c0(++_0x555a00);}(_0xfa03,0x111));var _0x3fa0=function(_0x15162b,_0x341587){_0x15162b=_0x15162b-0x0;var _0x147c6b=_0xfa03[_0x15162b];return _0x147c6b;};'use strict';var _=require(_0x3fa0('0x0'));var util=require(_0x3fa0('0x1'));var logger=require(_0x3fa0('0x2'))(_0x3fa0('0x3'));var moment=require(_0x3fa0('0x4'));var BPromise=require('bluebird');var rp=require(_0x3fa0('0x5'));var fs=require('fs');var path=require(_0x3fa0('0x6'));var rimraf=require(_0x3fa0('0x7'));var config=require(_0x3fa0('0x8'));var attributes=require(_0x3fa0('0x9'));module[_0x3fa0('0xa')]=function(_0x593006,_0x4d3ee9){return _0x593006['define']('AnalyticDefaultReport',attributes,{'tableName':_0x3fa0('0xb'),'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 600c265..2bf8d6d 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 _0xaa4b=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x4efd61,_0x592cc1){var _0x572f78=function(_0x344d56){while(--_0x344d56){_0x4efd61['push'](_0x4efd61['shift']());}};_0x572f78(++_0x592cc1);}(_0xaa4b,0x1df));var _0xbaa4=function(_0x314312,_0x31a84e){_0x314312=_0x314312-0x0;var _0x8bb27e=_0xaa4b[_0x314312];return _0x8bb27e;};'use strict';var _=require(_0xbaa4('0x0'));var util=require(_0xbaa4('0x1'));var moment=require(_0xbaa4('0x2'));var BPromise=require('bluebird');var rs=require(_0xbaa4('0x3'));var fs=require('fs');var Redis=require(_0xbaa4('0x4'));var db=require(_0xbaa4('0x5'))['db'];var utils=require(_0xbaa4('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbaa4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcf41e6,_0x1aa625,_0x414f7c){return new BPromise(function(_0x1404af,_0x48fbc7){return client[_0xbaa4('0x8')](_0xcf41e6,_0x414f7c)[_0xbaa4('0x9')](function(_0x2f7dc8){logger[_0xbaa4('0xa')](_0xbaa4('0xb'),_0x1aa625,_0xbaa4('0xc'));logger[_0xbaa4('0xd')](_0xbaa4('0xe'),_0x1aa625,_0xbaa4('0xc'),JSON['stringify'](_0x2f7dc8));if(_0x2f7dc8[_0xbaa4('0xf')]){if(_0x2f7dc8[_0xbaa4('0xf')]['code']===0x1f4){logger[_0xbaa4('0xf')](_0xbaa4('0xb'),_0x1aa625,_0x2f7dc8[_0xbaa4('0xf')][_0xbaa4('0x10')]);return _0x48fbc7(_0x2f7dc8['error'][_0xbaa4('0x10')]);}logger['error'](_0xbaa4('0xb'),_0x1aa625,_0x2f7dc8[_0xbaa4('0xf')]['message']);return _0x1404af(_0x2f7dc8[_0xbaa4('0xf')][_0xbaa4('0x10')]);}else{logger[_0xbaa4('0xa')](_0xbaa4('0xb'),_0x1aa625,_0xbaa4('0xc'));_0x1404af(_0x2f7dc8[_0xbaa4('0x11')][_0xbaa4('0x10')]);}})[_0xbaa4('0x12')](function(_0x25d0b6){logger[_0xbaa4('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1aa625,_0x25d0b6);_0x48fbc7(_0x25d0b6);});});}
\ No newline at end of file
+var _0x73f9=['message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x29a20c,_0x37a6c3){var _0x1fe64e=function(_0x2da12e){while(--_0x2da12e){_0x29a20c['push'](_0x29a20c['shift']());}};_0x1fe64e(++_0x37a6c3);}(_0x73f9,0x1f1));var _0x973f=function(_0x249ab1,_0xb48e57){_0x249ab1=_0x249ab1-0x0;var _0x5a9ed2=_0x73f9[_0x249ab1];return _0x5a9ed2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x973f('0x0'));var BPromise=require('bluebird');var rs=require(_0x973f('0x1'));var fs=require('fs');var Redis=require(_0x973f('0x2'));var db=require(_0x973f('0x3'))['db'];var utils=require(_0x973f('0x4'));var logger=require('../../config/logger')(_0x973f('0x5'));var config=require(_0x973f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x973f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe757ec,_0x301ef8,_0x33515b){return new BPromise(function(_0x25696b,_0x3dd9fe){return client['request'](_0xe757ec,_0x33515b)[_0x973f('0x8')](function(_0x807288){logger[_0x973f('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x301ef8,_0x973f('0xa'));logger[_0x973f('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x301ef8,'request\x20sent',JSON[_0x973f('0xc')](_0x807288));if(_0x807288[_0x973f('0xd')]){if(_0x807288['error'][_0x973f('0xe')]===0x1f4){logger[_0x973f('0xd')](_0x973f('0xf'),_0x301ef8,_0x807288[_0x973f('0xd')][_0x973f('0x10')]);return _0x3dd9fe(_0x807288[_0x973f('0xd')][_0x973f('0x10')]);}logger[_0x973f('0xd')](_0x973f('0xf'),_0x301ef8,_0x807288[_0x973f('0xd')][_0x973f('0x10')]);return _0x25696b(_0x807288[_0x973f('0xd')][_0x973f('0x10')]);}else{logger['info'](_0x973f('0xf'),_0x301ef8,'request\x20sent');_0x25696b(_0x807288[_0x973f('0x11')][_0x973f('0x10')]);}})[_0x973f('0x12')](function(_0x4a084a){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x301ef8,_0x4a084a);_0x3dd9fe(_0x4a084a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 099a1a7..0bd4c5d 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 _0x8d5d=['post','create','put','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','get','query'];(function(_0x57290a,_0x352aa7){var _0x39654b=function(_0x2e7b6b){while(--_0x2e7b6b){_0x57290a['push'](_0x57290a['shift']());}};_0x39654b(++_0x352aa7);}(_0x8d5d,0x10e));var _0xd8d5=function(_0x59ea00,_0x3c6b18){_0x59ea00=_0x59ea00-0x0;var _0x32bc55=_0x8d5d[_0x59ea00];return _0x32bc55;};'use strict';var multer=require(_0xd8d5('0x0'));var util=require(_0xd8d5('0x1'));var path=require(_0xd8d5('0x2'));var timeout=require(_0xd8d5('0x3'));var express=require('express');var router=express[_0xd8d5('0x4')]();var fs_extra=require(_0xd8d5('0x5'));var auth=require(_0xd8d5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd8d5('0x7'));var controller=require(_0xd8d5('0x8'));router['get']('/',auth[_0xd8d5('0x9')](),controller[_0xd8d5('0xa')]);router['get']('/:id',auth[_0xd8d5('0x9')](),controller[_0xd8d5('0xb')]);router['get'](_0xd8d5('0xc'),auth[_0xd8d5('0x9')](),controller[_0xd8d5('0xd')]);router['get'](_0xd8d5('0xe'),auth['isAuthenticated'](),controller[_0xd8d5('0xf')]);router[_0xd8d5('0x10')]('/:id/query',auth[_0xd8d5('0x9')](),controller[_0xd8d5('0x11')]);router[_0xd8d5('0x12')]('/',auth[_0xd8d5('0x9')](),controller[_0xd8d5('0x13')]);router[_0xd8d5('0x14')](_0xd8d5('0x15'),auth[_0xd8d5('0x9')](),controller[_0xd8d5('0x16')]);router[_0xd8d5('0x17')](_0xd8d5('0x15'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8b33=['index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x278bbb,_0x546e2f){var _0x444877=function(_0x399547){while(--_0x399547){_0x278bbb['push'](_0x278bbb['shift']());}};_0x444877(++_0x546e2f);}(_0x8b33,0x12e));var _0x38b3=function(_0x293e4c,_0x138c21){_0x293e4c=_0x293e4c-0x0;var _0x51099d=_0x8b33[_0x293e4c];return _0x51099d;};'use strict';var multer=require(_0x38b3('0x0'));var util=require(_0x38b3('0x1'));var path=require(_0x38b3('0x2'));var timeout=require('connect-timeout');var express=require(_0x38b3('0x3'));var router=express['Router']();var fs_extra=require(_0x38b3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x38b3('0x5'));var config=require(_0x38b3('0x6'));var controller=require(_0x38b3('0x7'));router[_0x38b3('0x8')]('/',auth[_0x38b3('0x9')](),controller[_0x38b3('0xa')]);router['get'](_0x38b3('0xb'),auth[_0x38b3('0x9')](),controller[_0x38b3('0xc')]);router['get'](_0x38b3('0xd'),auth[_0x38b3('0x9')](),controller[_0x38b3('0xe')]);router[_0x38b3('0x8')](_0x38b3('0xf'),auth[_0x38b3('0x9')](),controller[_0x38b3('0x10')]);router[_0x38b3('0x8')](_0x38b3('0x11'),auth[_0x38b3('0x9')](),controller[_0x38b3('0x12')]);router[_0x38b3('0x13')]('/',auth[_0x38b3('0x9')](),controller[_0x38b3('0x14')]);router[_0x38b3('0x15')]('/:id',auth[_0x38b3('0x9')](),controller[_0x38b3('0x16')]);router[_0x38b3('0x17')](_0x38b3('0xb'),auth[_0x38b3('0x9')](),controller[_0x38b3('0x18')]);module[_0x38b3('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 38f1169..8c5afc8 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 _0x9738=['UNSIGNED','sequelize','exports','STRING','ENUM','pdf','xlsx','csv','DATE','manual','scheduled'];(function(_0x2b5736,_0x31be75){var _0x3ef270=function(_0x519e8a){while(--_0x519e8a){_0x2b5736['push'](_0x2b5736['shift']());}};_0x3ef270(++_0x31be75);}(_0x9738,0x11f));var _0x8973=function(_0x4272e6,_0x2010bb){_0x4272e6=_0x4272e6-0x0;var _0x4b518b=_0x9738[_0x4272e6];return _0x4b518b;};'use strict';var Sequelize=require(_0x8973('0x0'));var moment=require('moment');module[_0x8973('0x1')]={'name':{'type':Sequelize[_0x8973('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8973('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8973('0x3')]('csv',_0x8973('0x4'),_0x8973('0x5')),'allowNull':![],'defaultValue':_0x8973('0x6')},'savename':{'type':Sequelize[_0x8973('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8973('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8973('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x8973('0x3')](_0x8973('0x8'),_0x8973('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8973('0xa')]},'reportType':{'type':Sequelize[_0x8973('0x2')]}};
\ No newline at end of file
+var _0xed65=['xlsx','DATE','Loading','manual','scheduled','INTEGER','exports','STRING','ENUM','csv','pdf'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xed65,0x1ea));var _0x5ed6=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xed65[_0x2e50a2];return _0x47e5de;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5ed6('0x0')]={'name':{'type':Sequelize[_0x5ed6('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x5ed6('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x5ed6('0x2')](_0x5ed6('0x3'),_0x5ed6('0x4'),_0x5ed6('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x5ed6('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5ed6('0x6')]},'endDate':{'type':Sequelize[_0x5ed6('0x6')]},'status':{'type':Sequelize[_0x5ed6('0x1')],'defaultValue':_0x5ed6('0x7')},'type':{'type':Sequelize['ENUM'](_0x5ed6('0x8'),_0x5ed6('0x9')),'allowNull':![],'defaultValue':_0x5ed6('0x8')},'reportId':{'type':Sequelize[_0x5ed6('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x5ed6('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 5b3a053..f60d0de 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 _0xc35b=['end','json','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','send','map','rawAttributes','type','key','name','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x2d1c7c,_0x2c6379){var _0x53fcae=function(_0x97594c){while(--_0x97594c){_0x2d1c7c['push'](_0x2d1c7c['shift']());}};_0x53fcae(++_0x2c6379);}(_0xc35b,0x1b0));var _0xbc35=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xc35b[_0x59c301];return _0x3866b9;};'use strict';var emlformat=require(_0xbc35('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc35('0x1'));var jsonpatch=require(_0xbc35('0x2'));var rp=require(_0xbc35('0x3'));var moment=require(_0xbc35('0x4'));var BPromise=require(_0xbc35('0x5'));var Mustache=require(_0xbc35('0x6'));var util=require(_0xbc35('0x7'));var path=require('path');var sox=require(_0xbc35('0x8'));var csv=require(_0xbc35('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc35('0xa'));var _=require('lodash');var squel=require(_0xbc35('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbc35('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbc35('0xd'));var Papa=require(_0xbc35('0xe'));var Redis=require(_0xbc35('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc35('0x10'))(_0xbc35('0x11'));var utils=require(_0xbc35('0x12'));var config=require(_0xbc35('0x13'));var licenseUtil=require(_0xbc35('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x598533,_0x4fac5a){_0x4fac5a=_0x4fac5a||0xcc;return function(_0x168317){if(_0x168317){return _0x598533[_0xbc35('0x15')](_0x4fac5a);}return _0x598533[_0xbc35('0x16')](_0x4fac5a)[_0xbc35('0x17')]();};}function respondWithResult(_0x8fd0,_0x5cff7d){_0x5cff7d=_0x5cff7d||0xc8;return function(_0x208eb3){if(_0x208eb3){return _0x8fd0[_0xbc35('0x16')](_0x5cff7d)[_0xbc35('0x18')](_0x208eb3);}};}function respondWithFilteredResult(_0x1ed563,_0xbbcfe4){return function(_0x54e8d5){if(_0x54e8d5){var _0x498fd5=typeof _0xbbcfe4['offset']==='undefined'&&typeof _0xbbcfe4['limit']===_0xbc35('0x19');var _0x13d210=_0x54e8d5['count'];var _0x628c5f=_0x498fd5?0x0:_0xbbcfe4['offset'];var _0x1c6682=_0x498fd5?_0x54e8d5[_0xbc35('0x1a')]:_0xbbcfe4[_0xbc35('0x1b')]+_0xbbcfe4['limit'];var _0x5d4b00;if(_0x1c6682>=_0x13d210){_0x1c6682=_0x13d210;_0x5d4b00=0xc8;}else{_0x5d4b00=0xce;}_0x1ed563[_0xbc35('0x16')](_0x5d4b00);return _0x1ed563['set'](_0xbc35('0x1c'),_0x628c5f+'-'+_0x1c6682+'/'+_0x13d210)[_0xbc35('0x18')](_0x54e8d5);}return null;};}function patchUpdates(_0x3f2fad){return function(_0x487406){try{jsonpatch['apply'](_0x487406,_0x3f2fad,!![]);}catch(_0x4821a3){return BPromise[_0xbc35('0x1d')](_0x4821a3);}return _0x487406[_0xbc35('0x1e')]();};}function saveUpdates(_0x4884ae,_0x4f0b5c){return function(_0x58f94e){if(_0x58f94e){return _0x58f94e[_0xbc35('0x1f')](_0x4884ae)[_0xbc35('0x20')](function(_0x11996d){return _0x11996d;});}return null;};}function removeEntity(_0x3158ad,_0x50500e){return function(_0x2abca5){if(_0x2abca5){return _0x2abca5[_0xbc35('0x21')]()[_0xbc35('0x20')](function(){var _0x3c724d=_0x2abca5[_0xbc35('0x22')]({'plain':!![]});var _0x3e867c=_0xbc35('0x23');return db[_0xbc35('0x24')]['destroy']({'where':{'type':_0x3e867c,'resourceId':_0x3c724d['id']}})[_0xbc35('0x20')](function(){return _0x2abca5;});})[_0xbc35('0x20')](function(){_0x3158ad[_0xbc35('0x16')](0xcc)[_0xbc35('0x17')]();});}};}function handleEntityNotFound(_0x6e30bb,_0x40ae03){return function(_0x3e063b){if(!_0x3e063b){_0x6e30bb[_0xbc35('0x15')](0x194);}return _0x3e063b;};}function handleError(_0xfe7805,_0x131447){_0x131447=_0x131447||0x1f4;return function(_0x23f3f9){logger['error'](_0x23f3f9[_0xbc35('0x25')]);if(_0x23f3f9['name']){delete _0x23f3f9['name'];}_0xfe7805[_0xbc35('0x16')](_0x131447)[_0xbc35('0x26')](_0x23f3f9);};}exports['index']=function(_0x1071ed,_0x30eed2){var _0x105f21={},_0xe8fd6a={},_0x489117={'count':0x0,'rows':[]};var _0x2dbaa4=_[_0xbc35('0x27')](db['AnalyticExtractedReport'][_0xbc35('0x28')],function(_0x4d3986){return{'name':_0x4d3986['fieldName'],'type':_0x4d3986[_0xbc35('0x29')][_0xbc35('0x2a')]};});_0xe8fd6a['model']=_['map'](_0x2dbaa4,_0xbc35('0x2b'));_0xe8fd6a[_0xbc35('0x2c')]=_[_0xbc35('0x2d')](_0x1071ed[_0xbc35('0x2c')]);_0xe8fd6a['filters']=_[_0xbc35('0x2e')](_0xe8fd6a[_0xbc35('0x2f')],_0xe8fd6a[_0xbc35('0x2c')]);_0x105f21[_0xbc35('0x30')]=_[_0xbc35('0x2e')](_0xe8fd6a[_0xbc35('0x2f')],qs[_0xbc35('0x31')](_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x31')]));_0x105f21[_0xbc35('0x30')]=_0x105f21[_0xbc35('0x30')]['length']?_0x105f21[_0xbc35('0x30')]:_0xe8fd6a[_0xbc35('0x2f')];if(!_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x32')](_0xbc35('0x33'))){_0x105f21[_0xbc35('0x34')]=qs[_0xbc35('0x34')](_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x34')]);_0x105f21['offset']=qs[_0xbc35('0x1b')](_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x1b')]);}_0x105f21[_0xbc35('0x35')]=qs[_0xbc35('0x36')](_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x36')]);_0x105f21['where']=qs[_0xbc35('0x37')](_['pick'](_0x1071ed[_0xbc35('0x2c')],_0xe8fd6a[_0xbc35('0x37')]),_0x2dbaa4);if(_0x1071ed['query'][_0xbc35('0x38')]){_0x105f21[_0xbc35('0x39')]=_[_0xbc35('0x3a')](_0x105f21[_0xbc35('0x39')],{'$or':_['map'](_0x2dbaa4,function(_0x3feef5){if(_0x3feef5[_0xbc35('0x29')]!==_0xbc35('0x3b')){var _0x2662c7={};_0x2662c7[_0x3feef5['name']]={'$like':'%'+_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x38')]+'%'};return _0x2662c7;}})});}_0x105f21=_[_0xbc35('0x3a')]({},_0x105f21,_0x1071ed[_0xbc35('0x3c')]);var _0x4f45ed={'where':_0x105f21[_0xbc35('0x39')]};return db[_0xbc35('0x3d')][_0xbc35('0x1a')](_0x4f45ed)[_0xbc35('0x20')](function(_0x5da34b){_0x489117[_0xbc35('0x1a')]=_0x5da34b;if(_0x1071ed['query'][_0xbc35('0x3e')]){_0x105f21[_0xbc35('0x3f')]=[{'all':!![]}];}return db[_0xbc35('0x3d')][_0xbc35('0x40')](_0x105f21);})[_0xbc35('0x20')](function(_0x325d3e){_0x489117[_0xbc35('0x41')]=_0x325d3e;return _0x489117;})[_0xbc35('0x20')](respondWithFilteredResult(_0x30eed2,_0x105f21))['catch'](handleError(_0x30eed2,null));};exports[_0xbc35('0x42')]=function(_0x10323f,_0xd529ff){var _0x4bb452={'raw':!![],'where':{'id':_0x10323f[_0xbc35('0x43')]['id']}},_0x558743={};_0x558743[_0xbc35('0x2f')]=_['keys'](db[_0xbc35('0x3d')]['rawAttributes']);_0x558743[_0xbc35('0x2c')]=_[_0xbc35('0x2d')](_0x10323f[_0xbc35('0x2c')]);_0x558743[_0xbc35('0x37')]=_[_0xbc35('0x2e')](_0x558743[_0xbc35('0x2f')],_0x558743['query']);_0x4bb452['attributes']=_[_0xbc35('0x2e')](_0x558743[_0xbc35('0x2f')],qs[_0xbc35('0x31')](_0x10323f['query'][_0xbc35('0x31')]));_0x4bb452[_0xbc35('0x30')]=_0x4bb452[_0xbc35('0x30')][_0xbc35('0x44')]?_0x4bb452[_0xbc35('0x30')]:_0x558743[_0xbc35('0x2f')];if(_0x10323f[_0xbc35('0x2c')]['includeAll']){_0x4bb452[_0xbc35('0x3f')]=[{'all':!![]}];}_0x4bb452=_[_0xbc35('0x3a')]({},_0x4bb452,_0x10323f[_0xbc35('0x3c')]);return db[_0xbc35('0x3d')][_0xbc35('0x45')](_0x4bb452)[_0xbc35('0x20')](handleEntityNotFound(_0xd529ff,null))[_0xbc35('0x20')](respondWithResult(_0xd529ff,null))[_0xbc35('0x46')](handleError(_0xd529ff,null));};exports[_0xbc35('0x47')]=function(_0x42e926,_0x164769){return db[_0xbc35('0x3d')][_0xbc35('0x47')](_0x42e926[_0xbc35('0x48')],{})[_0xbc35('0x20')](function(_0x501f57){var _0x5a12f4=_0x42e926[_0xbc35('0x49')][_0xbc35('0x22')]({'plain':!![]});if(!_0x5a12f4)throw new Error(_0xbc35('0x4a'));if(_0x5a12f4['role']===_0xbc35('0x49')){var _0x1b0907=_0x501f57[_0xbc35('0x22')]({'plain':!![]});var _0xc8eed='ExtractedReports';return db[_0xbc35('0x4b')]['find']({'where':{'name':_0xc8eed,'userProfileId':_0x5a12f4['userProfileId']},'raw':!![]})[_0xbc35('0x20')](function(_0x141147){if(_0x141147&&_0x141147['autoAssociation']===0x0){return db[_0xbc35('0x24')][_0xbc35('0x47')]({'name':_0x1b0907[_0xbc35('0x2b')],'resourceId':_0x1b0907['id'],'type':_0x141147['name'],'sectionId':_0x141147['id']},{})[_0xbc35('0x20')](function(){return _0x501f57;});}else{return _0x501f57;}})[_0xbc35('0x46')](function(_0x1a2a93){logger[_0xbc35('0x4c')](_0xbc35('0x4d'),_0x1a2a93);throw _0x1a2a93;});}return _0x501f57;})['then'](respondWithResult(_0x164769,0xc9))['catch'](handleError(_0x164769,null));};exports[_0xbc35('0x1f')]=function(_0x520d45,_0x253cbc){if(_0x520d45[_0xbc35('0x48')]['id']){delete _0x520d45[_0xbc35('0x48')]['id'];}return db[_0xbc35('0x3d')]['find']({'where':{'id':_0x520d45[_0xbc35('0x43')]['id']}})[_0xbc35('0x20')](handleEntityNotFound(_0x253cbc,null))[_0xbc35('0x20')](saveUpdates(_0x520d45[_0xbc35('0x48')],null))[_0xbc35('0x20')](respondWithResult(_0x253cbc,null))[_0xbc35('0x46')](handleError(_0x253cbc,null));};exports['destroy']=function(_0x16f308,_0x1cd7c8){return db[_0xbc35('0x3d')][_0xbc35('0x45')]({'where':{'id':_0x16f308[_0xbc35('0x43')]['id']}})['then'](handleEntityNotFound(_0x1cd7c8,null))[_0xbc35('0x20')](removeEntity(_0x1cd7c8,null))['catch'](handleError(_0x1cd7c8,null));};exports[_0xbc35('0x4e')]=function(_0x11b970,_0x39e740,_0x3b2d87){return db[_0xbc35('0x3d')]['find']({'where':{'id':_0x11b970['params']['id']},'attributes':[_0xbc35('0x2b'),_0xbc35('0x4f'),_0xbc35('0x50'),_0xbc35('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x39e740,null))['then'](function(_0x2bfc43){if(_0x2bfc43){if(!fs[_0xbc35('0x52')](path[_0xbc35('0x53')](config[_0xbc35('0x54')],_0xbc35('0x55'),_0x2bfc43[_0xbc35('0x50')]))){throw new db['Sequelize'][(_0xbc35('0x56'))](_0xbc35('0x57'));}if(_0x11b970['query'][_0xbc35('0x58')]){return _0x39e740[_0xbc35('0x15')](0xc8);}return _0x39e740[_0xbc35('0x4e')](path[_0xbc35('0x53')](config[_0xbc35('0x54')],_0xbc35('0x55'),_0x2bfc43['savename']),util['format'](_0xbc35('0x59'),_0x2bfc43['basename']||_0x2bfc43[_0xbc35('0x2b')],_0x2bfc43[_0xbc35('0x51')][_0xbc35('0x5a')]()));}})[_0xbc35('0x46')](handleError(_0x39e740,null));};
\ No newline at end of file
+var _0x13b7=['ExtractedReports','UserProfileResource','end','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','download','basename','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get'];(function(_0x4f2536,_0x1c0a21){var _0x164eb9=function(_0xcb8d76){while(--_0xcb8d76){_0x4f2536['push'](_0x4f2536['shift']());}};_0x164eb9(++_0x1c0a21);}(_0x13b7,0x14b));var _0x713b=function(_0x40c0c6,_0x49f7bb){_0x40c0c6=_0x40c0c6-0x0;var _0x2acfe2=_0x13b7[_0x40c0c6];return _0x2acfe2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x713b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x713b('0x1'));var rp=require(_0x713b('0x2'));var moment=require('moment');var BPromise=require(_0x713b('0x3'));var Mustache=require(_0x713b('0x4'));var util=require(_0x713b('0x5'));var path=require('path');var sox=require(_0x713b('0x6'));var csv=require(_0x713b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x713b('0x8'));var _=require(_0x713b('0x9'));var squel=require(_0x713b('0xa'));var crypto=require(_0x713b('0xb'));var jsforce=require(_0x713b('0xc'));var deskjs=require(_0x713b('0xd'));var toCsv=require(_0x713b('0x7'));var querystring=require('querystring');var Papa=require(_0x713b('0xe'));var Redis=require(_0x713b('0xf'));var authService=require(_0x713b('0x10'));var qs=require(_0x713b('0x11'));var as=require(_0x713b('0x12'));var hardwareService=require(_0x713b('0x13'));var logger=require('../../config/logger')(_0x713b('0x14'));var utils=require('../../config/utils');var config=require(_0x713b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x713b('0x16'))['db'];function respondWithStatusCode(_0x2bd6d0,_0x4c570b){_0x4c570b=_0x4c570b||0xcc;return function(_0x3a6a35){if(_0x3a6a35){return _0x2bd6d0[_0x713b('0x17')](_0x4c570b);}return _0x2bd6d0[_0x713b('0x18')](_0x4c570b)['end']();};}function respondWithResult(_0x1a93b1,_0x26d8a4){_0x26d8a4=_0x26d8a4||0xc8;return function(_0x23351b){if(_0x23351b){return _0x1a93b1['status'](_0x26d8a4)[_0x713b('0x19')](_0x23351b);}};}function respondWithFilteredResult(_0x488a8d,_0x5b55bc){return function(_0x28034e){if(_0x28034e){var _0x28b8b1=typeof _0x5b55bc[_0x713b('0x1a')]===_0x713b('0x1b')&&typeof _0x5b55bc[_0x713b('0x1c')]===_0x713b('0x1b');var _0x59705f=_0x28034e[_0x713b('0x1d')];var _0x56380c=_0x28b8b1?0x0:_0x5b55bc[_0x713b('0x1a')];var _0x37be83=_0x28b8b1?_0x28034e[_0x713b('0x1d')]:_0x5b55bc[_0x713b('0x1a')]+_0x5b55bc[_0x713b('0x1c')];var _0x434fbd;if(_0x37be83>=_0x59705f){_0x37be83=_0x59705f;_0x434fbd=0xc8;}else{_0x434fbd=0xce;}_0x488a8d['status'](_0x434fbd);return _0x488a8d['set'](_0x713b('0x1e'),_0x56380c+'-'+_0x37be83+'/'+_0x59705f)[_0x713b('0x19')](_0x28034e);}return null;};}function patchUpdates(_0x20b360){return function(_0x39ec7c){try{jsonpatch['apply'](_0x39ec7c,_0x20b360,!![]);}catch(_0x389168){return BPromise[_0x713b('0x1f')](_0x389168);}return _0x39ec7c[_0x713b('0x20')]();};}function saveUpdates(_0x3884aa,_0x4be940){return function(_0x72ccf6){if(_0x72ccf6){return _0x72ccf6[_0x713b('0x21')](_0x3884aa)[_0x713b('0x22')](function(_0x585fdb){return _0x585fdb;});}return null;};}function removeEntity(_0x2ef6b2,_0x4dc28a){return function(_0x11ad8e){if(_0x11ad8e){return _0x11ad8e[_0x713b('0x23')]()[_0x713b('0x22')](function(){var _0x346096=_0x11ad8e[_0x713b('0x24')]({'plain':!![]});var _0x42dff3=_0x713b('0x25');return db[_0x713b('0x26')][_0x713b('0x23')]({'where':{'type':_0x42dff3,'resourceId':_0x346096['id']}})[_0x713b('0x22')](function(){return _0x11ad8e;});})['then'](function(){_0x2ef6b2[_0x713b('0x18')](0xcc)[_0x713b('0x27')]();});}};}function handleEntityNotFound(_0x2c9a8e,_0x175a52){return function(_0x1660c2){if(!_0x1660c2){_0x2c9a8e[_0x713b('0x17')](0x194);}return _0x1660c2;};}function handleError(_0x225632,_0x380896){_0x380896=_0x380896||0x1f4;return function(_0x1967a4){logger['error'](_0x1967a4[_0x713b('0x28')]);if(_0x1967a4[_0x713b('0x29')]){delete _0x1967a4['name'];}_0x225632[_0x713b('0x18')](_0x380896)[_0x713b('0x2a')](_0x1967a4);};}exports[_0x713b('0x2b')]=function(_0x101847,_0x23f6b5){var _0x4e7431={},_0x59df8b={},_0x4f7eab={'count':0x0,'rows':[]};var _0x3cea9d=_['map'](db[_0x713b('0x2c')][_0x713b('0x2d')],function(_0x346e3c){return{'name':_0x346e3c[_0x713b('0x2e')],'type':_0x346e3c[_0x713b('0x2f')][_0x713b('0x30')]};});_0x59df8b[_0x713b('0x31')]=_[_0x713b('0x32')](_0x3cea9d,_0x713b('0x29'));_0x59df8b[_0x713b('0x33')]=_['keys'](_0x101847['query']);_0x59df8b['filters']=_[_0x713b('0x34')](_0x59df8b[_0x713b('0x31')],_0x59df8b[_0x713b('0x33')]);_0x4e7431['attributes']=_[_0x713b('0x34')](_0x59df8b[_0x713b('0x31')],qs[_0x713b('0x35')](_0x101847[_0x713b('0x33')][_0x713b('0x35')]));_0x4e7431[_0x713b('0x36')]=_0x4e7431[_0x713b('0x36')][_0x713b('0x37')]?_0x4e7431[_0x713b('0x36')]:_0x59df8b[_0x713b('0x31')];if(!_0x101847[_0x713b('0x33')][_0x713b('0x38')]('nolimit')){_0x4e7431[_0x713b('0x1c')]=qs[_0x713b('0x1c')](_0x101847[_0x713b('0x33')][_0x713b('0x1c')]);_0x4e7431[_0x713b('0x1a')]=qs[_0x713b('0x1a')](_0x101847[_0x713b('0x33')][_0x713b('0x1a')]);}_0x4e7431[_0x713b('0x39')]=qs[_0x713b('0x3a')](_0x101847['query'][_0x713b('0x3a')]);_0x4e7431[_0x713b('0x3b')]=qs[_0x713b('0x3c')](_[_0x713b('0x3d')](_0x101847[_0x713b('0x33')],_0x59df8b[_0x713b('0x3c')]),_0x3cea9d);if(_0x101847[_0x713b('0x33')]['filter']){_0x4e7431['where']=_[_0x713b('0x3e')](_0x4e7431[_0x713b('0x3b')],{'$or':_[_0x713b('0x32')](_0x3cea9d,function(_0xb26fe0){if(_0xb26fe0[_0x713b('0x2f')]!==_0x713b('0x3f')){var _0x2aab12={};_0x2aab12[_0xb26fe0[_0x713b('0x29')]]={'$like':'%'+_0x101847[_0x713b('0x33')][_0x713b('0x40')]+'%'};return _0x2aab12;}})});}_0x4e7431=_['merge']({},_0x4e7431,_0x101847[_0x713b('0x41')]);var _0x41380b={'where':_0x4e7431[_0x713b('0x3b')]};return db[_0x713b('0x2c')][_0x713b('0x1d')](_0x41380b)[_0x713b('0x22')](function(_0xd879cd){_0x4f7eab[_0x713b('0x1d')]=_0xd879cd;if(_0x101847[_0x713b('0x33')][_0x713b('0x42')]){_0x4e7431['include']=[{'all':!![]}];}return db[_0x713b('0x2c')][_0x713b('0x43')](_0x4e7431);})[_0x713b('0x22')](function(_0x4abde9){_0x4f7eab[_0x713b('0x44')]=_0x4abde9;return _0x4f7eab;})[_0x713b('0x22')](respondWithFilteredResult(_0x23f6b5,_0x4e7431))[_0x713b('0x45')](handleError(_0x23f6b5,null));};exports[_0x713b('0x46')]=function(_0x4c4915,_0x5be995){var _0x38a52f={'raw':!![],'where':{'id':_0x4c4915[_0x713b('0x47')]['id']}},_0x266ede={};_0x266ede['model']=_[_0x713b('0x48')](db[_0x713b('0x2c')]['rawAttributes']);_0x266ede[_0x713b('0x33')]=_[_0x713b('0x48')](_0x4c4915[_0x713b('0x33')]);_0x266ede['filters']=_[_0x713b('0x34')](_0x266ede[_0x713b('0x31')],_0x266ede[_0x713b('0x33')]);_0x38a52f[_0x713b('0x36')]=_[_0x713b('0x34')](_0x266ede[_0x713b('0x31')],qs[_0x713b('0x35')](_0x4c4915[_0x713b('0x33')]['fields']));_0x38a52f['attributes']=_0x38a52f[_0x713b('0x36')][_0x713b('0x37')]?_0x38a52f[_0x713b('0x36')]:_0x266ede[_0x713b('0x31')];if(_0x4c4915['query'][_0x713b('0x42')]){_0x38a52f[_0x713b('0x49')]=[{'all':!![]}];}_0x38a52f=_['merge']({},_0x38a52f,_0x4c4915[_0x713b('0x41')]);return db['AnalyticExtractedReport']['find'](_0x38a52f)['then'](handleEntityNotFound(_0x5be995,null))[_0x713b('0x22')](respondWithResult(_0x5be995,null))[_0x713b('0x45')](handleError(_0x5be995,null));};exports[_0x713b('0x4a')]=function(_0x13f567,_0x321e69){return db[_0x713b('0x2c')][_0x713b('0x4a')](_0x13f567[_0x713b('0x4b')],{})[_0x713b('0x22')](function(_0x405576){var _0x346f5d=_0x13f567['user']['get']({'plain':!![]});if(!_0x346f5d)throw new Error(_0x713b('0x4c'));if(_0x346f5d[_0x713b('0x4d')]==='user'){var _0x386675=_0x405576[_0x713b('0x24')]({'plain':!![]});var _0x1144b2=_0x713b('0x25');return db['UserProfileSection'][_0x713b('0x4e')]({'where':{'name':_0x1144b2,'userProfileId':_0x346f5d['userProfileId']},'raw':!![]})['then'](function(_0x57a8f7){if(_0x57a8f7&&_0x57a8f7['autoAssociation']===0x0){return db[_0x713b('0x26')][_0x713b('0x4a')]({'name':_0x386675[_0x713b('0x29')],'resourceId':_0x386675['id'],'type':_0x57a8f7[_0x713b('0x29')],'sectionId':_0x57a8f7['id']},{})[_0x713b('0x22')](function(){return _0x405576;});}else{return _0x405576;}})['catch'](function(_0x417776){logger[_0x713b('0x4f')](_0x713b('0x50'),_0x417776);throw _0x417776;});}return _0x405576;})[_0x713b('0x22')](respondWithResult(_0x321e69,0xc9))['catch'](handleError(_0x321e69,null));};exports['update']=function(_0xe2b025,_0x16d776){if(_0xe2b025[_0x713b('0x4b')]['id']){delete _0xe2b025[_0x713b('0x4b')]['id'];}return db['AnalyticExtractedReport'][_0x713b('0x4e')]({'where':{'id':_0xe2b025[_0x713b('0x47')]['id']}})[_0x713b('0x22')](handleEntityNotFound(_0x16d776,null))['then'](saveUpdates(_0xe2b025[_0x713b('0x4b')],null))[_0x713b('0x22')](respondWithResult(_0x16d776,null))['catch'](handleError(_0x16d776,null));};exports['destroy']=function(_0x10ba65,_0x3ba30e){return db[_0x713b('0x2c')][_0x713b('0x4e')]({'where':{'id':_0x10ba65[_0x713b('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ba30e,null))['then'](removeEntity(_0x3ba30e,null))[_0x713b('0x45')](handleError(_0x3ba30e,null));};exports['download']=function(_0x44b96d,_0x488f63,_0x18f10c){return db[_0x713b('0x2c')]['find']({'where':{'id':_0x44b96d[_0x713b('0x47')]['id']},'attributes':[_0x713b('0x29'),'basename',_0x713b('0x51'),_0x713b('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x488f63,null))[_0x713b('0x22')](function(_0x44951e){if(_0x44951e){if(!fs[_0x713b('0x53')](path[_0x713b('0x54')](config[_0x713b('0x55')],_0x713b('0x56'),_0x44951e[_0x713b('0x51')]))){throw new db[(_0x713b('0x57'))][(_0x713b('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x44b96d[_0x713b('0x33')][_0x713b('0x59')]){return _0x488f63['sendStatus'](0xc8);}return _0x488f63[_0x713b('0x5a')](path[_0x713b('0x54')](config[_0x713b('0x55')],_0x713b('0x56'),_0x44951e[_0x713b('0x51')]),util['format']('%s.%s',_0x44951e[_0x713b('0x5b')]||_0x44951e[_0x713b('0x29')],_0x44951e[_0x713b('0x52')]['toLowerCase']()));}})['catch'](handleError(_0x488f63,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 9b70316..3113a45 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 _0x6ee4=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util'];(function(_0x110f18,_0x36ea5c){var _0x36ccbf=function(_0xe113f4){while(--_0xe113f4){_0x110f18['push'](_0x110f18['shift']());}};_0x36ccbf(++_0x36ea5c);}(_0x6ee4,0x197));var _0x46ee=function(_0x39add0,_0x855b75){_0x39add0=_0x39add0-0x0;var _0x191987=_0x6ee4[_0x39add0];return _0x191987;};'use strict';var _=require('lodash');var util=require(_0x46ee('0x0'));var logger=require(_0x46ee('0x1'))(_0x46ee('0x2'));var moment=require(_0x46ee('0x3'));var BPromise=require(_0x46ee('0x4'));var rp=require(_0x46ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46ee('0x6'));var config=require(_0x46ee('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x46ee('0x8')]=function(_0x3b1583,_0x3f65d8){return _0x3b1583[_0x46ee('0x9')](_0x46ee('0xa'),attributes,{'tableName':_0x46ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6647=['bluebird','request-promise','rimraf','../../config/environment','define','analytics_extracted_reports','util','../../config/logger','api'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x6647,0x14a));var _0x7664=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6647[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x7664('0x0'));var logger=require(_0x7664('0x1'))(_0x7664('0x2'));var moment=require('moment');var BPromise=require(_0x7664('0x3'));var rp=require(_0x7664('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7664('0x5'));var config=require(_0x7664('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x7e472e,_0x13dc00){return _0x7e472e[_0x7664('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0x7664('0x8'),'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 2e7e985..d3ec5bd 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 _0x8ce1=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2769ea,_0x4e63ed){var _0x7a61a4=function(_0x21bfd8){while(--_0x21bfd8){_0x2769ea['push'](_0x2769ea['shift']());}};_0x7a61a4(++_0x4e63ed);}(_0x8ce1,0xc7));var _0x18ce=function(_0x2ed1a2,_0x10ad1d){_0x2ed1a2=_0x2ed1a2-0x0;var _0x2c03ef=_0x8ce1[_0x2ed1a2];return _0x2c03ef;};'use strict';var _=require(_0x18ce('0x0'));var util=require('util');var moment=require(_0x18ce('0x1'));var BPromise=require(_0x18ce('0x2'));var rs=require(_0x18ce('0x3'));var fs=require('fs');var Redis=require(_0x18ce('0x4'));var db=require(_0x18ce('0x5'))['db'];var utils=require(_0x18ce('0x6'));var logger=require(_0x18ce('0x7'))(_0x18ce('0x8'));var config=require('../../config/environment');var jayson=require(_0x18ce('0x9'));var client=jayson[_0x18ce('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31f7c4,_0x37334e,_0x5843b1){return new BPromise(function(_0x367129,_0x2a5a41){return client[_0x18ce('0xb')](_0x31f7c4,_0x5843b1)['then'](function(_0x437b22){logger[_0x18ce('0xc')](_0x18ce('0xd'),_0x37334e,_0x18ce('0xe'));logger[_0x18ce('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x37334e,_0x18ce('0xe'),JSON[_0x18ce('0x10')](_0x437b22));if(_0x437b22[_0x18ce('0x11')]){if(_0x437b22[_0x18ce('0x11')][_0x18ce('0x12')]===0x1f4){logger[_0x18ce('0x11')](_0x18ce('0xd'),_0x37334e,_0x437b22[_0x18ce('0x11')]['message']);return _0x2a5a41(_0x437b22[_0x18ce('0x11')][_0x18ce('0x13')]);}logger['error'](_0x18ce('0xd'),_0x37334e,_0x437b22[_0x18ce('0x11')]['message']);return _0x367129(_0x437b22[_0x18ce('0x11')][_0x18ce('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x37334e,'request\x20sent');_0x367129(_0x437b22[_0x18ce('0x14')][_0x18ce('0x13')]);}})[_0x18ce('0x15')](function(_0x2f33cc){logger[_0x18ce('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x37334e,_0x2f33cc);_0x2a5a41(_0x2f33cc);});});}
\ No newline at end of file
+var _0x157f=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x2a03fa,_0xb1d8dd){var _0xf84bf7=function(_0x5a6e50){while(--_0x5a6e50){_0x2a03fa['push'](_0x2a03fa['shift']());}};_0xf84bf7(++_0xb1d8dd);}(_0x157f,0x141));var _0xf157=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x157f[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xf157('0x0'));var util=require(_0xf157('0x1'));var moment=require(_0xf157('0x2'));var BPromise=require(_0xf157('0x3'));var rs=require(_0xf157('0x4'));var fs=require('fs');var Redis=require(_0xf157('0x5'));var db=require(_0xf157('0x6'))['db'];var utils=require(_0xf157('0x7'));var logger=require(_0xf157('0x8'))(_0xf157('0x9'));var config=require(_0xf157('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf157('0xb')][_0xf157('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50b3f3,_0x34d1d3,_0x456434){return new BPromise(function(_0x4fb474,_0x11a655){return client[_0xf157('0xd')](_0x50b3f3,_0x456434)[_0xf157('0xe')](function(_0xaa0699){logger[_0xf157('0xf')](_0xf157('0x10'),_0x34d1d3,'request\x20sent');logger[_0xf157('0x11')](_0xf157('0x12'),_0x34d1d3,_0xf157('0x13'),JSON[_0xf157('0x14')](_0xaa0699));if(_0xaa0699[_0xf157('0x15')]){if(_0xaa0699['error'][_0xf157('0x16')]===0x1f4){logger[_0xf157('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x34d1d3,_0xaa0699[_0xf157('0x15')]['message']);return _0x11a655(_0xaa0699[_0xf157('0x15')][_0xf157('0x17')]);}logger[_0xf157('0x15')](_0xf157('0x10'),_0x34d1d3,_0xaa0699[_0xf157('0x15')][_0xf157('0x17')]);return _0x4fb474(_0xaa0699[_0xf157('0x15')]['message']);}else{logger[_0xf157('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x34d1d3,'request\x20sent');_0x4fb474(_0xaa0699[_0xf157('0x18')][_0xf157('0x17')]);}})[_0xf157('0x19')](function(_0x208746){logger[_0xf157('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x34d1d3,_0x208746);_0x11a655(_0x208746);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 945d1e2..0e7061e 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 _0x98aa=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98aa,0x7e));var _0xa98a=function(_0x19e013,_0x5c74e0){_0x19e013=_0x19e013-0x0;var _0x58c128=_0x98aa[_0x19e013];return _0x58c128;};'use strict';var multer=require(_0xa98a('0x0'));var util=require(_0xa98a('0x1'));var path=require(_0xa98a('0x2'));var timeout=require(_0xa98a('0x3'));var express=require(_0xa98a('0x4'));var router=express[_0xa98a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa98a('0x6'));var config=require(_0xa98a('0x7'));var controller=require(_0xa98a('0x8'));router[_0xa98a('0x9')]('/',auth[_0xa98a('0xa')](),controller[_0xa98a('0xb')]);router[_0xa98a('0x9')](_0xa98a('0xc'),auth[_0xa98a('0xa')](),controller[_0xa98a('0xd')]);router[_0xa98a('0x9')](_0xa98a('0xe'),auth[_0xa98a('0xa')](),controller[_0xa98a('0xf')]);router[_0xa98a('0x10')]('/',auth[_0xa98a('0xa')](),controller['create']);router[_0xa98a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa98a('0x12')]);router[_0xa98a('0x13')]('/:id',auth[_0xa98a('0xa')](),controller[_0xa98a('0x14')]);module[_0xa98a('0x15')]=router;
\ No newline at end of file
+var _0x4036=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','delete','destroy','exports','multer','util'];(function(_0x2a1a0b,_0x52086b){var _0x58a15d=function(_0x36989e){while(--_0x36989e){_0x2a1a0b['push'](_0x2a1a0b['shift']());}};_0x58a15d(++_0x52086b);}(_0x4036,0x9e));var _0x6403=function(_0x5ebfb1,_0x15a7bb){_0x5ebfb1=_0x5ebfb1-0x0;var _0x291643=_0x4036[_0x5ebfb1];return _0x291643;};'use strict';var multer=require(_0x6403('0x0'));var util=require(_0x6403('0x1'));var path=require(_0x6403('0x2'));var timeout=require(_0x6403('0x3'));var express=require(_0x6403('0x4'));var router=express[_0x6403('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6403('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6403('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x6403('0x8')]('/',auth[_0x6403('0x9')](),controller[_0x6403('0xa')]);router['get'](_0x6403('0xb'),auth[_0x6403('0x9')](),controller[_0x6403('0xc')]);router[_0x6403('0x8')](_0x6403('0xd'),auth[_0x6403('0x9')](),controller[_0x6403('0xe')]);router[_0x6403('0xf')]('/',auth[_0x6403('0x9')](),controller['create']);router[_0x6403('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6403('0x11')](_0x6403('0xb'),auth[_0x6403('0x9')](),controller[_0x6403('0x12')]);module[_0x6403('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index d978386..2d18cb1 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 _0x73fc=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x5dc073,_0x3d21d2){var _0x2c7c3a=function(_0x41c036){while(--_0x41c036){_0x5dc073['push'](_0x5dc073['shift']());}};_0x2c7c3a(++_0x3d21d2);}(_0x73fc,0x152));var _0xc73f=function(_0x140beb,_0x57472d){_0x140beb=_0x140beb-0x0;var _0x265f48=_0x73fc[_0x140beb];return _0x265f48;};'use strict';var Sequelize=require(_0xc73f('0x0'));module[_0xc73f('0x1')]={'field':{'type':Sequelize[_0xc73f('0x2')]},'alias':{'type':Sequelize[_0xc73f('0x3')]},'function':{'type':Sequelize[_0xc73f('0x3')]},'format':{'type':Sequelize[_0xc73f('0x3')]},'groupBy':{'type':Sequelize[_0xc73f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc73f('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2ee0=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x1dbf70,_0x3bcdb8){var _0x20adb4=function(_0x374fa3){while(--_0x374fa3){_0x1dbf70['push'](_0x1dbf70['shift']());}};_0x20adb4(++_0x3bcdb8);}(_0x2ee0,0x110));var _0x02ee=function(_0x418ed8,_0x441581){_0x418ed8=_0x418ed8-0x0;var _0xac0bc8=_0x2ee0[_0x418ed8];return _0xac0bc8;};'use strict';var Sequelize=require(_0x02ee('0x0'));module[_0x02ee('0x1')]={'field':{'type':Sequelize[_0x02ee('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x02ee('0x3')]},'format':{'type':Sequelize[_0x02ee('0x3')]},'groupBy':{'type':Sequelize[_0x02ee('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x02ee('0x3')]},'custom':{'type':Sequelize[_0x02ee('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 5718efa..159d7ee 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 _0x374f=['destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','create','bulkCreate','body','find','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x374f,0x13f));var _0xf374=function(_0x4cdd01,_0x465a1c){_0x4cdd01=_0x4cdd01-0x0;var _0x476661=_0x374f[_0x4cdd01];return _0x476661;};'use strict';var emlformat=require(_0xf374('0x0'));var rimraf=require(_0xf374('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf374('0x2'));var rp=require(_0xf374('0x3'));var moment=require(_0xf374('0x4'));var BPromise=require(_0xf374('0x5'));var Mustache=require(_0xf374('0x6'));var util=require(_0xf374('0x7'));var path=require(_0xf374('0x8'));var sox=require(_0xf374('0x9'));var csv=require(_0xf374('0xa'));var ejs=require(_0xf374('0xb'));var fs=require('fs');var fs_extra=require(_0xf374('0xc'));var _=require(_0xf374('0xd'));var squel=require(_0xf374('0xe'));var crypto=require(_0xf374('0xf'));var jsforce=require(_0xf374('0x10'));var deskjs=require(_0xf374('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf374('0x12'));var Papa=require(_0xf374('0x13'));var Redis=require(_0xf374('0x14'));var authService=require(_0xf374('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xf374('0x16'));var hardwareService=require(_0xf374('0x17'));var logger=require(_0xf374('0x18'))(_0xf374('0x19'));var utils=require(_0xf374('0x1a'));var config=require(_0xf374('0x1b'));var licenseUtil=require(_0xf374('0x1c'));var db=require(_0xf374('0x1d'))['db'];function respondWithStatusCode(_0x2fe28e,_0x25f4c0){_0x25f4c0=_0x25f4c0||0xcc;return function(_0x2ac881){if(_0x2ac881){return _0x2fe28e[_0xf374('0x1e')](_0x25f4c0);}return _0x2fe28e['status'](_0x25f4c0)[_0xf374('0x1f')]();};}function respondWithResult(_0x12983f,_0x1d580e){_0x1d580e=_0x1d580e||0xc8;return function(_0x140bdd){if(_0x140bdd){return _0x12983f[_0xf374('0x20')](_0x1d580e)['json'](_0x140bdd);}};}function respondWithFilteredResult(_0x36e19e,_0x106c95){return function(_0x4f3f78){if(_0x4f3f78){var _0x3fe252=typeof _0x106c95[_0xf374('0x21')]===_0xf374('0x22')&&typeof _0x106c95[_0xf374('0x23')]===_0xf374('0x22');var _0x5b79c7=_0x4f3f78[_0xf374('0x24')];var _0x52bb31=_0x3fe252?0x0:_0x106c95[_0xf374('0x21')];var _0x55a2dd=_0x3fe252?_0x4f3f78['count']:_0x106c95[_0xf374('0x21')]+_0x106c95['limit'];var _0x37321c;if(_0x55a2dd>=_0x5b79c7){_0x55a2dd=_0x5b79c7;_0x37321c=0xc8;}else{_0x37321c=0xce;}_0x36e19e[_0xf374('0x20')](_0x37321c);return _0x36e19e[_0xf374('0x25')](_0xf374('0x26'),_0x52bb31+'-'+_0x55a2dd+'/'+_0x5b79c7)[_0xf374('0x27')](_0x4f3f78);}return null;};}function patchUpdates(_0x4a45c1){return function(_0xc99a43){try{jsonpatch[_0xf374('0x28')](_0xc99a43,_0x4a45c1,!![]);}catch(_0x49df64){return BPromise[_0xf374('0x29')](_0x49df64);}return _0xc99a43[_0xf374('0x2a')]();};}function saveUpdates(_0x34f811,_0x39b3e0){return function(_0x13788b){if(_0x13788b){return _0x13788b[_0xf374('0x2b')](_0x34f811)[_0xf374('0x2c')](function(_0xa2d4c1){return _0xa2d4c1;});}return null;};}function removeEntity(_0x48e06a,_0xeb9fc6){return function(_0x5d611e){if(_0x5d611e){return _0x5d611e[_0xf374('0x2d')]()[_0xf374('0x2c')](function(){_0x48e06a[_0xf374('0x20')](0xcc)[_0xf374('0x1f')]();});}};}function handleEntityNotFound(_0x296816,_0x4c79f4){return function(_0x1d74d7){if(!_0x1d74d7){_0x296816[_0xf374('0x1e')](0x194);}return _0x1d74d7;};}function handleError(_0x1ba198,_0x9bcd4c){_0x9bcd4c=_0x9bcd4c||0x1f4;return function(_0x3733c4){logger['error'](_0x3733c4[_0xf374('0x2e')]);if(_0x3733c4[_0xf374('0x2f')]){delete _0x3733c4['name'];}_0x1ba198['status'](_0x9bcd4c)[_0xf374('0x30')](_0x3733c4);};}exports[_0xf374('0x31')]=function(_0x5246b0,_0x3c3b67){var _0x428154={},_0x33b1cc={},_0x57ecc7={'count':0x0,'rows':[]};var _0x59e890=_[_0xf374('0x32')](db[_0xf374('0x33')][_0xf374('0x34')],function(_0x425750){return{'name':_0x425750[_0xf374('0x35')],'type':_0x425750[_0xf374('0x36')][_0xf374('0x37')]};});_0x33b1cc[_0xf374('0x38')]=_['map'](_0x59e890,_0xf374('0x2f'));_0x33b1cc[_0xf374('0x39')]=_[_0xf374('0x3a')](_0x5246b0[_0xf374('0x39')]);_0x33b1cc['filters']=_[_0xf374('0x3b')](_0x33b1cc[_0xf374('0x38')],_0x33b1cc[_0xf374('0x39')]);_0x428154[_0xf374('0x3c')]=_['intersection'](_0x33b1cc[_0xf374('0x38')],qs[_0xf374('0x3d')](_0x5246b0['query'][_0xf374('0x3d')]));_0x428154['attributes']=_0x428154[_0xf374('0x3c')][_0xf374('0x3e')]?_0x428154[_0xf374('0x3c')]:_0x33b1cc[_0xf374('0x38')];if(!_0x5246b0[_0xf374('0x39')][_0xf374('0x3f')](_0xf374('0x40'))){_0x428154[_0xf374('0x23')]=qs[_0xf374('0x23')](_0x5246b0[_0xf374('0x39')]['limit']);_0x428154[_0xf374('0x21')]=qs[_0xf374('0x21')](_0x5246b0['query'][_0xf374('0x21')]);}_0x428154[_0xf374('0x41')]=qs[_0xf374('0x42')](_0x5246b0['query'][_0xf374('0x42')]);_0x428154[_0xf374('0x43')]=qs[_0xf374('0x44')](_[_0xf374('0x45')](_0x5246b0[_0xf374('0x39')],_0x33b1cc[_0xf374('0x44')]),_0x59e890);if(_0x5246b0[_0xf374('0x39')][_0xf374('0x46')]){_0x428154[_0xf374('0x43')]=_[_0xf374('0x47')](_0x428154['where'],{'$or':_['map'](_0x59e890,function(_0x15ec51){if(_0x15ec51[_0xf374('0x36')]!==_0xf374('0x48')){var _0x5e9027={};_0x5e9027[_0x15ec51['name']]={'$like':'%'+_0x5246b0[_0xf374('0x39')][_0xf374('0x46')]+'%'};return _0x5e9027;}})});}_0x428154=_[_0xf374('0x47')]({},_0x428154,_0x5246b0[_0xf374('0x49')]);var _0x2c16e5={'where':_0x428154[_0xf374('0x43')]};return db[_0xf374('0x33')]['count'](_0x2c16e5)[_0xf374('0x2c')](function(_0x4eb530){_0x57ecc7['count']=_0x4eb530;if(_0x5246b0[_0xf374('0x39')][_0xf374('0x4a')]){_0x428154['include']=[{'all':!![]}];}return db[_0xf374('0x33')][_0xf374('0x4b')](_0x428154);})['then'](function(_0x5bde7c){_0x57ecc7[_0xf374('0x4c')]=_0x5bde7c;return _0x57ecc7;})['then'](respondWithFilteredResult(_0x3c3b67,_0x428154))[_0xf374('0x4d')](handleError(_0x3c3b67,null));};exports['show']=function(_0x486784,_0x1e3397){var _0x1b3c29={'raw':![],'where':{'id':_0x486784[_0xf374('0x4e')]['id']}},_0x3aef83={};_0x3aef83[_0xf374('0x38')]=_[_0xf374('0x3a')](db['AnalyticFieldReport']['rawAttributes']);_0x3aef83['query']=_[_0xf374('0x3a')](_0x486784[_0xf374('0x39')]);_0x3aef83[_0xf374('0x44')]=_[_0xf374('0x3b')](_0x3aef83[_0xf374('0x38')],_0x3aef83[_0xf374('0x39')]);_0x1b3c29[_0xf374('0x3c')]=_[_0xf374('0x3b')](_0x3aef83[_0xf374('0x38')],qs[_0xf374('0x3d')](_0x486784[_0xf374('0x39')]['fields']));_0x1b3c29[_0xf374('0x3c')]=_0x1b3c29[_0xf374('0x3c')][_0xf374('0x3e')]?_0x1b3c29[_0xf374('0x3c')]:_0x3aef83[_0xf374('0x38')];if(_0x486784[_0xf374('0x39')]['includeAll']){_0x1b3c29[_0xf374('0x4f')]=[{'all':!![]}];}_0x1b3c29=_[_0xf374('0x47')]({},_0x1b3c29,_0x486784['options']);return db[_0xf374('0x33')]['find'](_0x1b3c29)[_0xf374('0x2c')](handleEntityNotFound(_0x1e3397,null))[_0xf374('0x2c')](respondWithResult(_0x1e3397,null))[_0xf374('0x4d')](handleError(_0x1e3397,null));};exports['create']=function(_0x4c27d6,_0xfb9de2){return db[_0xf374('0x33')][_0xf374('0x50')](_0x4c27d6['body'],{})['then'](respondWithResult(_0xfb9de2,0xc9))['catch'](handleError(_0xfb9de2,null));};exports[_0xf374('0x51')]=function(_0x2c7088,_0x25a241){return db[_0xf374('0x33')][_0xf374('0x51')](_0x2c7088['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x25a241,0xc9))[_0xf374('0x4d')](handleError(_0x25a241,null));};exports['update']=function(_0x20f016,_0xfb2908){if(_0x20f016[_0xf374('0x52')]['id']){delete _0x20f016[_0xf374('0x52')]['id'];}return db[_0xf374('0x33')][_0xf374('0x53')]({'where':{'id':_0x20f016['params']['id']}})['then'](handleEntityNotFound(_0xfb2908,null))[_0xf374('0x2c')](saveUpdates(_0x20f016[_0xf374('0x52')],null))[_0xf374('0x2c')](respondWithResult(_0xfb2908,null))[_0xf374('0x4d')](handleError(_0xfb2908,null));};exports[_0xf374('0x2d')]=function(_0x45b4b9,_0x41489a){return db[_0xf374('0x33')]['find']({'where':{'id':_0x45b4b9[_0xf374('0x4e')]['id']}})['then'](handleEntityNotFound(_0x41489a,null))[_0xf374('0x2c')](removeEntity(_0x41489a,null))[_0xf374('0x4d')](handleError(_0x41489a,null));};exports[_0xf374('0x54')]=function(_0x324a97,_0x56dc14){return db[_0xf374('0x33')][_0xf374('0x2d')]({'where':{'id':_0x324a97[_0xf374('0x39')][_0xf374('0x55')]||[]},'raw':![],'individualHooks':!![]})[_0xf374('0x2c')](respondWithResult(_0x56dc14,0xcc))[_0xf374('0x4d')](handleError(_0x56dc14,null));};exports['addFields']=function(_0x2a19b4,_0x27b4b1,_0x32da9a){return db[_0xf374('0x56')][_0xf374('0x57')]({'where':{'id':_0x2a19b4[_0xf374('0x4e')]['id']}})[_0xf374('0x2c')](handleEntityNotFound(_0x27b4b1,null))[_0xf374('0x2c')](function(_0x331081){if(_0x331081){return db[_0xf374('0x58')][_0xf374('0x59')](function(_0x8c26c7){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x2a19b4[_0xf374('0x4e')]['id']},'transaction':_0x8c26c7})['then'](function(_0x48f2c6){var _0x513b84=_[_0xf374('0x32')](_0x2a19b4['body'],function(_0x31b22c){delete _0x31b22c['id'];_0x31b22c[_0xf374('0x5a')]=_0x2a19b4[_0xf374('0x4e')]['id'];return _0x31b22c;});return db[_0xf374('0x33')][_0xf374('0x51')](_0x513b84,{'transaction':_0x8c26c7});});})['then'](function(){return db[_0xf374('0x33')][_0xf374('0x4b')]({'where':{'CustomReportId':_0x2a19b4[_0xf374('0x4e')]['id']}});});}})['then'](respondWithResult(_0x27b4b1,null))[_0xf374('0x4d')](handleError(_0x27b4b1,null));};
\ No newline at end of file
+var _0x8ed2=['AnalyticCustomReport','findOne','sequelize','transaction','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','AnalyticFieldReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','includeAll','findAll','catch','show','rawAttributes','include','bulkCreate','body','update','find','params','bulkDestroy','ids','addFields'];(function(_0x292e60,_0x186dbb){var _0x30227b=function(_0x5fdcd7){while(--_0x5fdcd7){_0x292e60['push'](_0x292e60['shift']());}};_0x30227b(++_0x186dbb);}(_0x8ed2,0xe8));var _0x28ed=function(_0x5b7448,_0x708cff){_0x5b7448=_0x5b7448-0x0;var _0x35d571=_0x8ed2[_0x5b7448];return _0x35d571;};'use strict';var emlformat=require(_0x28ed('0x0'));var rimraf=require(_0x28ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x28ed('0x2'));var moment=require('moment');var BPromise=require(_0x28ed('0x3'));var Mustache=require('mustache');var util=require(_0x28ed('0x4'));var path=require('path');var sox=require(_0x28ed('0x5'));var csv=require(_0x28ed('0x6'));var ejs=require(_0x28ed('0x7'));var fs=require('fs');var fs_extra=require(_0x28ed('0x8'));var _=require(_0x28ed('0x9'));var squel=require('squel');var crypto=require(_0x28ed('0xa'));var jsforce=require(_0x28ed('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28ed('0xc'));var Papa=require('papaparse');var Redis=require(_0x28ed('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28ed('0xe'));var hardwareService=require(_0x28ed('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x28ed('0x10'));var licenseUtil=require(_0x28ed('0x11'));var db=require(_0x28ed('0x12'))['db'];function respondWithStatusCode(_0x2f36d0,_0x36fc99){_0x36fc99=_0x36fc99||0xcc;return function(_0x4d5f0a){if(_0x4d5f0a){return _0x2f36d0[_0x28ed('0x13')](_0x36fc99);}return _0x2f36d0[_0x28ed('0x14')](_0x36fc99)[_0x28ed('0x15')]();};}function respondWithResult(_0xf37952,_0x31e641){_0x31e641=_0x31e641||0xc8;return function(_0x346b1f){if(_0x346b1f){return _0xf37952[_0x28ed('0x14')](_0x31e641)['json'](_0x346b1f);}};}function respondWithFilteredResult(_0x44dff8,_0x4ed412){return function(_0x20bf59){if(_0x20bf59){var _0x42c6db=typeof _0x4ed412[_0x28ed('0x16')]==='undefined'&&typeof _0x4ed412[_0x28ed('0x17')]===_0x28ed('0x18');var _0x3e0f17=_0x20bf59['count'];var _0x4bb0b9=_0x42c6db?0x0:_0x4ed412[_0x28ed('0x16')];var _0x12162e=_0x42c6db?_0x20bf59[_0x28ed('0x19')]:_0x4ed412[_0x28ed('0x16')]+_0x4ed412['limit'];var _0x3cc0c4;if(_0x12162e>=_0x3e0f17){_0x12162e=_0x3e0f17;_0x3cc0c4=0xc8;}else{_0x3cc0c4=0xce;}_0x44dff8[_0x28ed('0x14')](_0x3cc0c4);return _0x44dff8[_0x28ed('0x1a')](_0x28ed('0x1b'),_0x4bb0b9+'-'+_0x12162e+'/'+_0x3e0f17)['json'](_0x20bf59);}return null;};}function patchUpdates(_0x5ca178){return function(_0x4bc609){try{jsonpatch[_0x28ed('0x1c')](_0x4bc609,_0x5ca178,!![]);}catch(_0x170bc9){return BPromise[_0x28ed('0x1d')](_0x170bc9);}return _0x4bc609[_0x28ed('0x1e')]();};}function saveUpdates(_0x350dd5,_0x22ba11){return function(_0x1426f4){if(_0x1426f4){return _0x1426f4['update'](_0x350dd5)['then'](function(_0x52ef1d){return _0x52ef1d;});}return null;};}function removeEntity(_0x508ecf,_0x5dfe6b){return function(_0x27f5b7){if(_0x27f5b7){return _0x27f5b7[_0x28ed('0x1f')]()[_0x28ed('0x20')](function(){_0x508ecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d5939,_0x4bad7b){return function(_0x301755){if(!_0x301755){_0x3d5939[_0x28ed('0x13')](0x194);}return _0x301755;};}function handleError(_0xc14f9e,_0x46017d){_0x46017d=_0x46017d||0x1f4;return function(_0x36fd86){logger[_0x28ed('0x21')](_0x36fd86['stack']);if(_0x36fd86[_0x28ed('0x22')]){delete _0x36fd86[_0x28ed('0x22')];}_0xc14f9e['status'](_0x46017d)[_0x28ed('0x23')](_0x36fd86);};}exports[_0x28ed('0x24')]=function(_0x5e9890,_0x383295){var _0x2961fb={},_0x553480={},_0x32c154={'count':0x0,'rows':[]};var _0x254720=_[_0x28ed('0x25')](db[_0x28ed('0x26')]['rawAttributes'],function(_0x5e9406){return{'name':_0x5e9406[_0x28ed('0x27')],'type':_0x5e9406['type'][_0x28ed('0x28')]};});_0x553480[_0x28ed('0x29')]=_[_0x28ed('0x25')](_0x254720,_0x28ed('0x22'));_0x553480[_0x28ed('0x2a')]=_[_0x28ed('0x2b')](_0x5e9890[_0x28ed('0x2a')]);_0x553480[_0x28ed('0x2c')]=_[_0x28ed('0x2d')](_0x553480['model'],_0x553480[_0x28ed('0x2a')]);_0x2961fb[_0x28ed('0x2e')]=_[_0x28ed('0x2d')](_0x553480[_0x28ed('0x29')],qs[_0x28ed('0x2f')](_0x5e9890['query']['fields']));_0x2961fb[_0x28ed('0x2e')]=_0x2961fb[_0x28ed('0x2e')][_0x28ed('0x30')]?_0x2961fb[_0x28ed('0x2e')]:_0x553480[_0x28ed('0x29')];if(!_0x5e9890[_0x28ed('0x2a')][_0x28ed('0x31')]('nolimit')){_0x2961fb[_0x28ed('0x17')]=qs[_0x28ed('0x17')](_0x5e9890[_0x28ed('0x2a')]['limit']);_0x2961fb['offset']=qs[_0x28ed('0x16')](_0x5e9890[_0x28ed('0x2a')][_0x28ed('0x16')]);}_0x2961fb[_0x28ed('0x32')]=qs[_0x28ed('0x33')](_0x5e9890['query'][_0x28ed('0x33')]);_0x2961fb[_0x28ed('0x34')]=qs['filters'](_[_0x28ed('0x35')](_0x5e9890[_0x28ed('0x2a')],_0x553480[_0x28ed('0x2c')]),_0x254720);if(_0x5e9890['query'][_0x28ed('0x36')]){_0x2961fb[_0x28ed('0x34')]=_['merge'](_0x2961fb[_0x28ed('0x34')],{'$or':_['map'](_0x254720,function(_0x44a4c7){if(_0x44a4c7[_0x28ed('0x37')]!=='VIRTUAL'){var _0x1401f5={};_0x1401f5[_0x44a4c7[_0x28ed('0x22')]]={'$like':'%'+_0x5e9890[_0x28ed('0x2a')][_0x28ed('0x36')]+'%'};return _0x1401f5;}})});}_0x2961fb=_[_0x28ed('0x38')]({},_0x2961fb,_0x5e9890[_0x28ed('0x39')]);var _0x389a0b={'where':_0x2961fb[_0x28ed('0x34')]};return db[_0x28ed('0x26')][_0x28ed('0x19')](_0x389a0b)[_0x28ed('0x20')](function(_0x2bd450){_0x32c154['count']=_0x2bd450;if(_0x5e9890[_0x28ed('0x2a')][_0x28ed('0x3a')]){_0x2961fb['include']=[{'all':!![]}];}return db[_0x28ed('0x26')][_0x28ed('0x3b')](_0x2961fb);})[_0x28ed('0x20')](function(_0x359a04){_0x32c154['rows']=_0x359a04;return _0x32c154;})[_0x28ed('0x20')](respondWithFilteredResult(_0x383295,_0x2961fb))[_0x28ed('0x3c')](handleError(_0x383295,null));};exports[_0x28ed('0x3d')]=function(_0x28290f,_0x1032bd){var _0x4ab177={'raw':![],'where':{'id':_0x28290f['params']['id']}},_0x2c3ed8={};_0x2c3ed8[_0x28ed('0x29')]=_[_0x28ed('0x2b')](db['AnalyticFieldReport'][_0x28ed('0x3e')]);_0x2c3ed8['query']=_['keys'](_0x28290f[_0x28ed('0x2a')]);_0x2c3ed8[_0x28ed('0x2c')]=_[_0x28ed('0x2d')](_0x2c3ed8['model'],_0x2c3ed8[_0x28ed('0x2a')]);_0x4ab177['attributes']=_[_0x28ed('0x2d')](_0x2c3ed8[_0x28ed('0x29')],qs[_0x28ed('0x2f')](_0x28290f[_0x28ed('0x2a')][_0x28ed('0x2f')]));_0x4ab177[_0x28ed('0x2e')]=_0x4ab177['attributes'][_0x28ed('0x30')]?_0x4ab177['attributes']:_0x2c3ed8['model'];if(_0x28290f['query'][_0x28ed('0x3a')]){_0x4ab177[_0x28ed('0x3f')]=[{'all':!![]}];}_0x4ab177=_[_0x28ed('0x38')]({},_0x4ab177,_0x28290f[_0x28ed('0x39')]);return db[_0x28ed('0x26')]['find'](_0x4ab177)['then'](handleEntityNotFound(_0x1032bd,null))[_0x28ed('0x20')](respondWithResult(_0x1032bd,null))[_0x28ed('0x3c')](handleError(_0x1032bd,null));};exports['create']=function(_0x2d01f3,_0x35715f){return db[_0x28ed('0x26')]['create'](_0x2d01f3['body'],{})['then'](respondWithResult(_0x35715f,0xc9))['catch'](handleError(_0x35715f,null));};exports['bulkCreate']=function(_0x4451a7,_0x4b2338){return db[_0x28ed('0x26')][_0x28ed('0x40')](_0x4451a7[_0x28ed('0x41')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4b2338,0xc9))[_0x28ed('0x3c')](handleError(_0x4b2338,null));};exports[_0x28ed('0x42')]=function(_0x18a4a0,_0x484ccd){if(_0x18a4a0[_0x28ed('0x41')]['id']){delete _0x18a4a0[_0x28ed('0x41')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x18a4a0['params']['id']}})[_0x28ed('0x20')](handleEntityNotFound(_0x484ccd,null))[_0x28ed('0x20')](saveUpdates(_0x18a4a0[_0x28ed('0x41')],null))[_0x28ed('0x20')](respondWithResult(_0x484ccd,null))[_0x28ed('0x3c')](handleError(_0x484ccd,null));};exports['destroy']=function(_0x5df10a,_0x39d9a9){return db[_0x28ed('0x26')][_0x28ed('0x43')]({'where':{'id':_0x5df10a[_0x28ed('0x44')]['id']}})[_0x28ed('0x20')](handleEntityNotFound(_0x39d9a9,null))[_0x28ed('0x20')](removeEntity(_0x39d9a9,null))[_0x28ed('0x3c')](handleError(_0x39d9a9,null));};exports[_0x28ed('0x45')]=function(_0x54a941,_0x47ca5d){return db[_0x28ed('0x26')][_0x28ed('0x1f')]({'where':{'id':_0x54a941[_0x28ed('0x2a')][_0x28ed('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x28ed('0x20')](respondWithResult(_0x47ca5d,0xcc))['catch'](handleError(_0x47ca5d,null));};exports[_0x28ed('0x47')]=function(_0x2bf646,_0x1bcea6,_0xe7cf8a){return db[_0x28ed('0x48')][_0x28ed('0x49')]({'where':{'id':_0x2bf646[_0x28ed('0x44')]['id']}})[_0x28ed('0x20')](handleEntityNotFound(_0x1bcea6,null))['then'](function(_0x2e2f2e){if(_0x2e2f2e){return db[_0x28ed('0x4a')][_0x28ed('0x4b')](function(_0x4664c8){return db[_0x28ed('0x26')][_0x28ed('0x1f')]({'where':{'CustomReportId':_0x2bf646['params']['id']},'transaction':_0x4664c8})['then'](function(_0x1595d1){var _0x48b3f3=_[_0x28ed('0x25')](_0x2bf646[_0x28ed('0x41')],function(_0x187a1a){delete _0x187a1a['id'];_0x187a1a['CustomReportId']=_0x2bf646[_0x28ed('0x44')]['id'];return _0x187a1a;});return db['AnalyticFieldReport'][_0x28ed('0x40')](_0x48b3f3,{'transaction':_0x4664c8});});})[_0x28ed('0x20')](function(){return db['AnalyticFieldReport'][_0x28ed('0x3b')]({'where':{'CustomReportId':_0x2bf646[_0x28ed('0x44')]['id']}});});}})[_0x28ed('0x20')](respondWithResult(_0x1bcea6,null))[_0x28ed('0x3c')](handleError(_0x1bcea6,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 628b7b4..d3ffca6 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 _0xdd9c=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x2339ba,_0x206746){var _0x52d482=function(_0x154923){while(--_0x154923){_0x2339ba['push'](_0x2339ba['shift']());}};_0x52d482(++_0x206746);}(_0xdd9c,0x66));var _0xcdd9=function(_0x3d86bf,_0x189cfa){_0x3d86bf=_0x3d86bf-0x0;var _0x40bfba=_0xdd9c[_0x3d86bf];return _0x40bfba;};'use strict';var _=require(_0xcdd9('0x0'));var util=require(_0xcdd9('0x1'));var logger=require(_0xcdd9('0x2'))(_0xcdd9('0x3'));var moment=require('moment');var BPromise=require(_0xcdd9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcdd9('0x5'));var config=require(_0xcdd9('0x6'));var attributes=require(_0xcdd9('0x7'));module['exports']=function(_0x43330c,_0x4d2941){return _0x43330c['define'](_0xcdd9('0x8'),attributes,{'tableName':_0xcdd9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c57=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','util','../../config/logger'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x9c57,0x1b9));var _0x79c5=function(_0x333edc,_0x338e2f){_0x333edc=_0x333edc-0x0;var _0x27418d=_0x9c57[_0x333edc];return _0x27418d;};'use strict';var _=require(_0x79c5('0x0'));var util=require(_0x79c5('0x1'));var logger=require(_0x79c5('0x2'))(_0x79c5('0x3'));var moment=require(_0x79c5('0x4'));var BPromise=require(_0x79c5('0x5'));var rp=require(_0x79c5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79c5('0x7'));var config=require(_0x79c5('0x8'));var attributes=require(_0x79c5('0x9'));module['exports']=function(_0x17b13d,_0x42c850){return _0x17b13d[_0x79c5('0xa')](_0x79c5('0xb'),attributes,{'tableName':'analytics_report_fields','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 a6da7e7..ef313b2 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 _0x0a69=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message'];(function(_0x421366,_0x7163df){var _0x4a0aad=function(_0x163b2f){while(--_0x163b2f){_0x421366['push'](_0x421366['shift']());}};_0x4a0aad(++_0x7163df);}(_0x0a69,0x152));var _0x90a6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0a69[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x90a6('0x0'));var util=require(_0x90a6('0x1'));var moment=require(_0x90a6('0x2'));var BPromise=require(_0x90a6('0x3'));var rs=require(_0x90a6('0x4'));var fs=require('fs');var Redis=require(_0x90a6('0x5'));var db=require(_0x90a6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x90a6('0x7'))(_0x90a6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x90a6('0x9')][_0x90a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ef235,_0x366787,_0x220218){return new BPromise(function(_0x300dbf,_0x1783f9){return client[_0x90a6('0xb')](_0x5ef235,_0x220218)[_0x90a6('0xc')](function(_0x54ee79){logger[_0x90a6('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x366787,_0x90a6('0xe'));logger[_0x90a6('0xf')](_0x90a6('0x10'),_0x366787,_0x90a6('0xe'),JSON[_0x90a6('0x11')](_0x54ee79));if(_0x54ee79[_0x90a6('0x12')]){if(_0x54ee79[_0x90a6('0x12')][_0x90a6('0x13')]===0x1f4){logger[_0x90a6('0x12')](_0x90a6('0x14'),_0x366787,_0x54ee79['error'][_0x90a6('0x15')]);return _0x1783f9(_0x54ee79[_0x90a6('0x12')][_0x90a6('0x15')]);}logger['error'](_0x90a6('0x14'),_0x366787,_0x54ee79[_0x90a6('0x12')][_0x90a6('0x15')]);return _0x300dbf(_0x54ee79[_0x90a6('0x12')][_0x90a6('0x15')]);}else{logger[_0x90a6('0xd')](_0x90a6('0x14'),_0x366787,_0x90a6('0xe'));_0x300dbf(_0x54ee79[_0x90a6('0x16')][_0x90a6('0x15')]);}})[_0x90a6('0x17')](function(_0x33bf7a){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x366787,_0x33bf7a);_0x1783f9(_0x33bf7a);});});}
\ No newline at end of file
+var _0xce5a=['client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x554d29,_0x28c27e){var _0x395e80=function(_0x559c25){while(--_0x559c25){_0x554d29['push'](_0x554d29['shift']());}};_0x395e80(++_0x28c27e);}(_0xce5a,0x141));var _0xace5=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0xce5a[_0x5a6961];return _0x4af0a6;};'use strict';var _=require(_0xace5('0x0'));var util=require('util');var moment=require(_0xace5('0x1'));var BPromise=require(_0xace5('0x2'));var rs=require(_0xace5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xace5('0x4'))['db'];var utils=require(_0xace5('0x5'));var logger=require('../../config/logger')(_0xace5('0x6'));var config=require(_0xace5('0x7'));var jayson=require(_0xace5('0x8'));var client=jayson[_0xace5('0x9')][_0xace5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cceca,_0x1c29b7,_0x34e83a){return new BPromise(function(_0x5322a3,_0x2ef11c){return client[_0xace5('0xb')](_0x4cceca,_0x34e83a)['then'](function(_0x587805){logger[_0xace5('0xc')](_0xace5('0xd'),_0x1c29b7,_0xace5('0xe'));logger[_0xace5('0xf')](_0xace5('0x10'),_0x1c29b7,'request\x20sent',JSON[_0xace5('0x11')](_0x587805));if(_0x587805['error']){if(_0x587805['error'][_0xace5('0x12')]===0x1f4){logger[_0xace5('0x13')](_0xace5('0xd'),_0x1c29b7,_0x587805[_0xace5('0x13')]['message']);return _0x2ef11c(_0x587805[_0xace5('0x13')]['message']);}logger[_0xace5('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1c29b7,_0x587805[_0xace5('0x13')][_0xace5('0x14')]);return _0x5322a3(_0x587805[_0xace5('0x13')]['message']);}else{logger[_0xace5('0xc')](_0xace5('0xd'),_0x1c29b7,_0xace5('0xe'));_0x5322a3(_0x587805[_0xace5('0x15')]['message']);}})['catch'](function(_0x3abcf1){logger[_0xace5('0x13')](_0xace5('0xd'),_0x1c29b7,_0x3abcf1);_0x2ef11c(_0x3abcf1);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 5a3fa9a..1dda60e 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(_0x49e1c5,_0x1f4a4f){var _0x576240=function(_0x1f5672){while(--_0x1f5672){_0x49e1c5['push'](_0x49e1c5['shift']());}};_0x576240(++_0x1f4a4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x4db4e5,_0x1e1289){var _0xc7329c=function(_0x59e3f7){while(--_0x59e3f7){_0x4db4e5['push'](_0x4db4e5['shift']());}};_0xc7329c(++_0x1e1289);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 9ba3997..67362ee 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 _0x851a=['STRING','name','TEXT','sequelize'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x851a,0x19b));var _0xa851=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x851a[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xa851('0x0'));module['exports']={'name':{'type':Sequelize[_0xa851('0x1')],'allowNull':![],'unique':_0xa851('0x2')},'table':{'type':Sequelize[_0xa851('0x1')]},'metric':{'type':Sequelize[_0xa851('0x3')]},'description':{'type':Sequelize[_0xa851('0x1')]}};
\ No newline at end of file
+var _0xcecc=['sequelize','STRING','TEXT'];(function(_0x4a944e,_0x4143d8){var _0x1da079=function(_0x425393){while(--_0x425393){_0x4a944e['push'](_0x4a944e['shift']());}};_0x1da079(++_0x4143d8);}(_0xcecc,0x186));var _0xccec=function(_0x2f146c,_0x1ecc99){_0x2f146c=_0x2f146c-0x0;var _0x11fccd=_0xcecc[_0x2f146c];return _0x11fccd;};'use strict';var Sequelize=require(_0xccec('0x0'));module['exports']={'name':{'type':Sequelize[_0xccec('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xccec('0x2')]},'description':{'type':Sequelize[_0xccec('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 2f8f7b1..18b12e3 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 _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(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0x6aa7,0x178));var _0x76aa=function(_0x56d9a7,_0xd18b64){_0x56d9a7=_0x56d9a7-0x0;var _0x39b910=_0x6aa7[_0x56d9a7];return _0x39b910;};'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
+var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3a1b5f,_0xdd8290){var _0x12c585=function(_0x30626e){while(--_0x30626e){_0x3a1b5f['push'](_0x3a1b5f['shift']());}};_0x12c585(++_0xdd8290);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5f031a,_0x5c070f){_0x5f031a=_0x5f031a-0x0;var _0x4da4ca=_0x8ef6[_0x5f031a];return _0x4da4ca;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index e7ccbbb..267d308 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 _0xbc1c=['path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','util','api','bluebird','request-promise'];(function(_0x52922a,_0x5d457f){var _0x21ca07=function(_0x5f31d9){while(--_0x5f31d9){_0x52922a['push'](_0x52922a['shift']());}};_0x21ca07(++_0x5d457f);}(_0xbc1c,0xd8));var _0xcbc1=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0xbc1c[_0x267d8d];return _0x11a98f;};'use strict';var _=require('lodash');var util=require(_0xcbc1('0x0'));var logger=require('../../config/logger')(_0xcbc1('0x1'));var moment=require('moment');var BPromise=require(_0xcbc1('0x2'));var rp=require(_0xcbc1('0x3'));var fs=require('fs');var path=require(_0xcbc1('0x4'));var rimraf=require(_0xcbc1('0x5'));var config=require('../../config/environment');var attributes=require(_0xcbc1('0x6'));module[_0xcbc1('0x7')]=function(_0x54c13c,_0x27da8d){return _0x54c13c[_0xcbc1('0x8')](_0xcbc1('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4553=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','util','../../config/logger','api','request-promise','path'];(function(_0x5d3620,_0x34b31f){var _0x4723f5=function(_0xb8bf90){while(--_0xb8bf90){_0x5d3620['push'](_0x5d3620['shift']());}};_0x4723f5(++_0x34b31f);}(_0x4553,0x1be));var _0x3455=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x4553[_0x3c4737];return _0x2bb926;};'use strict';var _=require('lodash');var util=require(_0x3455('0x0'));var logger=require(_0x3455('0x1'))(_0x3455('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3455('0x3'));var fs=require('fs');var path=require(_0x3455('0x4'));var rimraf=require(_0x3455('0x5'));var config=require(_0x3455('0x6'));var attributes=require(_0x3455('0x7'));module[_0x3455('0x8')]=function(_0x2aa1ed,_0x4010cd){return _0x2aa1ed[_0x3455('0x9')]('AnalyticMetric',attributes,{'tableName':_0x3455('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 2aa3d33..deb001b 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 _0xaa03=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x1f286d,_0x190c4c){var _0x88842b=function(_0x198d36){while(--_0x198d36){_0x1f286d['push'](_0x1f286d['shift']());}};_0x88842b(++_0x190c4c);}(_0xaa03,0x13d));var _0x3aa0=function(_0x2f3fb3,_0x33100){_0x2f3fb3=_0x2f3fb3-0x0;var _0xed14fc=_0xaa03[_0x2f3fb3];return _0xed14fc;};'use strict';var _=require(_0x3aa0('0x0'));var util=require(_0x3aa0('0x1'));var moment=require(_0x3aa0('0x2'));var BPromise=require(_0x3aa0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3aa0('0x4'))['db'];var utils=require(_0x3aa0('0x5'));var logger=require(_0x3aa0('0x6'))(_0x3aa0('0x7'));var config=require(_0x3aa0('0x8'));var jayson=require(_0x3aa0('0x9'));var client=jayson[_0x3aa0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b9632,_0x134a39,_0x210ac9){return new BPromise(function(_0x4cc2d5,_0x59e424){return client['request'](_0x1b9632,_0x210ac9)[_0x3aa0('0xb')](function(_0x1396bf){logger[_0x3aa0('0xc')](_0x3aa0('0xd'),_0x134a39,_0x3aa0('0xe'));logger[_0x3aa0('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x134a39,'request\x20sent',JSON[_0x3aa0('0x10')](_0x1396bf));if(_0x1396bf[_0x3aa0('0x11')]){if(_0x1396bf[_0x3aa0('0x11')][_0x3aa0('0x12')]===0x1f4){logger['error'](_0x3aa0('0xd'),_0x134a39,_0x1396bf[_0x3aa0('0x11')]['message']);return _0x59e424(_0x1396bf[_0x3aa0('0x11')][_0x3aa0('0x13')]);}logger[_0x3aa0('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x134a39,_0x1396bf[_0x3aa0('0x11')][_0x3aa0('0x13')]);return _0x4cc2d5(_0x1396bf[_0x3aa0('0x11')][_0x3aa0('0x13')]);}else{logger[_0x3aa0('0xc')](_0x3aa0('0xd'),_0x134a39,_0x3aa0('0xe'));_0x4cc2d5(_0x1396bf[_0x3aa0('0x14')][_0x3aa0('0x13')]);}})[_0x3aa0('0x15')](function(_0x1a820b){logger[_0x3aa0('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x134a39,_0x1a820b);_0x59e424(_0x1a820b);});});}
\ No newline at end of file
+var _0x98ae=['request\x20sent','debug','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x5dc4ff,_0x5e2436){var _0x5478ab=function(_0x21f709){while(--_0x21f709){_0x5dc4ff['push'](_0x5dc4ff['shift']());}};_0x5478ab(++_0x5e2436);}(_0x98ae,0x79));var _0xe98a=function(_0x4fc00d,_0x325659){_0x4fc00d=_0x4fc00d-0x0;var _0x3a62c7=_0x98ae[_0x4fc00d];return _0x3a62c7;};'use strict';var _=require('lodash');var util=require(_0xe98a('0x0'));var moment=require(_0xe98a('0x1'));var BPromise=require('bluebird');var rs=require(_0xe98a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe98a('0x3'));var logger=require(_0xe98a('0x4'))(_0xe98a('0x5'));var config=require(_0xe98a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe98a('0x7')][_0xe98a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a7ccb,_0x33ea9c,_0x283e11){return new BPromise(function(_0x23613d,_0x3a534f){return client['request'](_0x4a7ccb,_0x283e11)[_0xe98a('0x9')](function(_0x40dca9){logger[_0xe98a('0xa')](_0xe98a('0xb'),_0x33ea9c,_0xe98a('0xc'));logger[_0xe98a('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x33ea9c,_0xe98a('0xc'),JSON[_0xe98a('0xe')](_0x40dca9));if(_0x40dca9['error']){if(_0x40dca9[_0xe98a('0xf')][_0xe98a('0x10')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x33ea9c,_0x40dca9[_0xe98a('0xf')]['message']);return _0x3a534f(_0x40dca9['error'][_0xe98a('0x11')]);}logger['error'](_0xe98a('0xb'),_0x33ea9c,_0x40dca9['error'][_0xe98a('0x11')]);return _0x23613d(_0x40dca9[_0xe98a('0xf')][_0xe98a('0x11')]);}else{logger['info'](_0xe98a('0xb'),_0x33ea9c,_0xe98a('0xc'));_0x23613d(_0x40dca9[_0xe98a('0x12')][_0xe98a('0x11')]);}})['catch'](function(_0x2c7517){logger[_0xe98a('0xf')](_0xe98a('0xb'),_0x33ea9c,_0x2c7517);_0x3a534f(_0x2c7517);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 603a25c..a3e059c 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 _0x0dec=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x406ce7,_0x2db8b1){var _0x557881=function(_0x3af7b7){while(--_0x3af7b7){_0x406ce7['push'](_0x406ce7['shift']());}};_0x557881(++_0x2db8b1);}(_0x0dec,0x11c));var _0xc0de=function(_0x4c23e8,_0x2cbe43){_0x4c23e8=_0x4c23e8-0x0;var _0x35f49a=_0x0dec[_0x4c23e8];return _0x35f49a;};'use strict';var multer=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var path=require(_0xc0de('0x2'));var timeout=require(_0xc0de('0x3'));var express=require('express');var router=express[_0xc0de('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0de('0x5'));var config=require(_0xc0de('0x6'));var controller=require(_0xc0de('0x7'));router[_0xc0de('0x8')]('/',auth[_0xc0de('0x9')](),controller[_0xc0de('0xa')]);router[_0xc0de('0x8')](_0xc0de('0xb'),auth[_0xc0de('0x9')](),controller[_0xc0de('0xc')]);router[_0xc0de('0xd')]('/',auth[_0xc0de('0x9')](),controller[_0xc0de('0xe')]);router[_0xc0de('0xf')](_0xc0de('0xb'),auth[_0xc0de('0x9')](),controller[_0xc0de('0x10')]);router[_0xc0de('0x11')](_0xc0de('0xb'),auth[_0xc0de('0x9')](),controller[_0xc0de('0x12')]);module[_0xc0de('0x13')]=router;
\ No newline at end of file
+var _0xe314=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x3e1572,_0x1b8ad4){var _0x136237=function(_0x5b4e4c){while(--_0x5b4e4c){_0x3e1572['push'](_0x3e1572['shift']());}};_0x136237(++_0x1b8ad4);}(_0xe314,0x7c));var _0x4e31=function(_0x2744c5,_0x3caacd){_0x2744c5=_0x2744c5-0x0;var _0x4d044b=_0xe314[_0x2744c5];return _0x4d044b;};'use strict';var multer=require('multer');var util=require(_0x4e31('0x0'));var path=require(_0x4e31('0x1'));var timeout=require(_0x4e31('0x2'));var express=require(_0x4e31('0x3'));var router=express[_0x4e31('0x4')]();var fs_extra=require(_0x4e31('0x5'));var auth=require(_0x4e31('0x6'));var interaction=require(_0x4e31('0x7'));var config=require(_0x4e31('0x8'));var controller=require(_0x4e31('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e31('0xa')]);router[_0x4e31('0xb')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0xe')]);router[_0x4e31('0xf')]('/',auth['isAuthenticated'](),controller[_0x4e31('0x10')]);router[_0x4e31('0x11')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller['update']);router[_0x4e31('0x12')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0x13')]);module[_0x4e31('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 34cbf5e..86f50b6 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 _0x5fa7=['sequelize','TEXT'];(function(_0x3a9aec,_0x318f70){var _0x3e7fd6=function(_0x475604){while(--_0x475604){_0x3a9aec['push'](_0x3a9aec['shift']());}};_0x3e7fd6(++_0x318f70);}(_0x5fa7,0xa0));var _0x75fa=function(_0x277995,_0x1112b3){_0x277995=_0x277995-0x0;var _0x235320=_0x5fa7[_0x277995];return _0x235320;};'use strict';var Sequelize=require(_0x75fa('0x0'));module['exports']={'tree':{'type':Sequelize[_0x75fa('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x6327=['exports','TEXT','sequelize'];(function(_0x365a31,_0x542d3f){var _0xe860a5=function(_0x59a0c5){while(--_0x59a0c5){_0x365a31['push'](_0x365a31['shift']());}};_0xe860a5(++_0x542d3f);}(_0x6327,0x131));var _0x7632=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x6327[_0x291d3f];return _0x242080;};'use strict';var Sequelize=require(_0x7632('0x0'));module[_0x7632('0x1')]={'tree':{'type':Sequelize[_0x7632('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 d8fb159..006fab6 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 _0x9ed7=['params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x3d2b52,_0x361713){var _0x4a2180=function(_0x30d93f){while(--_0x30d93f){_0x3d2b52['push'](_0x3d2b52['shift']());}};_0x4a2180(++_0x361713);}(_0x9ed7,0x17b));var _0x79ed=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0x9ed7[_0x476b00];return _0x44ec8e;};'use strict';var emlformat=require(_0x79ed('0x0'));var rimraf=require(_0x79ed('0x1'));var zipdir=require(_0x79ed('0x2'));var jsonpatch=require(_0x79ed('0x3'));var rp=require(_0x79ed('0x4'));var moment=require(_0x79ed('0x5'));var BPromise=require(_0x79ed('0x6'));var Mustache=require(_0x79ed('0x7'));var util=require(_0x79ed('0x8'));var path=require('path');var sox=require(_0x79ed('0x9'));var csv=require('to-csv');var ejs=require(_0x79ed('0xa'));var fs=require('fs');var fs_extra=require(_0x79ed('0xb'));var _=require(_0x79ed('0xc'));var squel=require(_0x79ed('0xd'));var crypto=require(_0x79ed('0xe'));var jsforce=require(_0x79ed('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x79ed('0x10'));var querystring=require(_0x79ed('0x11'));var Papa=require('papaparse');var Redis=require(_0x79ed('0x12'));var authService=require(_0x79ed('0x13'));var qs=require(_0x79ed('0x14'));var as=require(_0x79ed('0x15'));var hardwareService=require(_0x79ed('0x16'));var logger=require(_0x79ed('0x17'))(_0x79ed('0x18'));var utils=require('../../config/utils');var config=require(_0x79ed('0x19'));var licenseUtil=require(_0x79ed('0x1a'));var db=require(_0x79ed('0x1b'))['db'];function respondWithStatusCode(_0x289110,_0x5b1950){_0x5b1950=_0x5b1950||0xcc;return function(_0x2629f0){if(_0x2629f0){return _0x289110['sendStatus'](_0x5b1950);}return _0x289110[_0x79ed('0x1c')](_0x5b1950)[_0x79ed('0x1d')]();};}function respondWithResult(_0x268bf4,_0x319194){_0x319194=_0x319194||0xc8;return function(_0x3f549b){if(_0x3f549b){return _0x268bf4[_0x79ed('0x1c')](_0x319194)[_0x79ed('0x1e')](_0x3f549b);}};}function respondWithFilteredResult(_0x2ff459,_0x5e4f2b){return function(_0x5d4a06){if(_0x5d4a06){var _0x2b3551=typeof _0x5e4f2b[_0x79ed('0x1f')]==='undefined'&&typeof _0x5e4f2b[_0x79ed('0x20')]===_0x79ed('0x21');var _0x1b7079=_0x5d4a06[_0x79ed('0x22')];var _0x5200f4=_0x2b3551?0x0:_0x5e4f2b['offset'];var _0x8ec1a6=_0x2b3551?_0x5d4a06[_0x79ed('0x22')]:_0x5e4f2b[_0x79ed('0x1f')]+_0x5e4f2b[_0x79ed('0x20')];var _0x56cb47;if(_0x8ec1a6>=_0x1b7079){_0x8ec1a6=_0x1b7079;_0x56cb47=0xc8;}else{_0x56cb47=0xce;}_0x2ff459[_0x79ed('0x1c')](_0x56cb47);return _0x2ff459['set'](_0x79ed('0x23'),_0x5200f4+'-'+_0x8ec1a6+'/'+_0x1b7079)[_0x79ed('0x1e')](_0x5d4a06);}return null;};}function patchUpdates(_0x5ac913){return function(_0xfa4bc3){try{jsonpatch['apply'](_0xfa4bc3,_0x5ac913,!![]);}catch(_0x585972){return BPromise[_0x79ed('0x24')](_0x585972);}return _0xfa4bc3[_0x79ed('0x25')]();};}function saveUpdates(_0x76b9f7,_0xe95aa9){return function(_0x5e0c22){if(_0x5e0c22){return _0x5e0c22[_0x79ed('0x26')](_0x76b9f7)[_0x79ed('0x27')](function(_0x28190f){return _0x28190f;});}return null;};}function removeEntity(_0x587aa7,_0x3f1270){return function(_0x3d560a){if(_0x3d560a){return _0x3d560a[_0x79ed('0x28')]()[_0x79ed('0x27')](function(){_0x587aa7[_0x79ed('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x364568,_0x519b19){return function(_0x482daa){if(!_0x482daa){_0x364568[_0x79ed('0x29')](0x194);}return _0x482daa;};}function handleError(_0x596298,_0x21d065){_0x21d065=_0x21d065||0x1f4;return function(_0x373a8c){logger[_0x79ed('0x2a')](_0x373a8c['stack']);if(_0x373a8c[_0x79ed('0x2b')]){delete _0x373a8c[_0x79ed('0x2b')];}_0x596298[_0x79ed('0x1c')](_0x21d065)[_0x79ed('0x2c')](_0x373a8c);};}exports['index']=function(_0x2e23af,_0x7421ca){var _0x4f3ef7={},_0x340b19={},_0xadfc32={'count':0x0,'rows':[]};var _0x2d4b37=_[_0x79ed('0x2d')](db[_0x79ed('0x2e')][_0x79ed('0x2f')],function(_0x87b03c){return{'name':_0x87b03c[_0x79ed('0x30')],'type':_0x87b03c[_0x79ed('0x31')][_0x79ed('0x32')]};});_0x340b19['model']=_['map'](_0x2d4b37,_0x79ed('0x2b'));_0x340b19[_0x79ed('0x33')]=_[_0x79ed('0x34')](_0x2e23af[_0x79ed('0x33')]);_0x340b19[_0x79ed('0x35')]=_[_0x79ed('0x36')](_0x340b19[_0x79ed('0x37')],_0x340b19[_0x79ed('0x33')]);_0x4f3ef7[_0x79ed('0x38')]=_[_0x79ed('0x36')](_0x340b19[_0x79ed('0x37')],qs[_0x79ed('0x39')](_0x2e23af[_0x79ed('0x33')]['fields']));_0x4f3ef7['attributes']=_0x4f3ef7['attributes'][_0x79ed('0x3a')]?_0x4f3ef7[_0x79ed('0x38')]:_0x340b19[_0x79ed('0x37')];if(!_0x2e23af[_0x79ed('0x33')][_0x79ed('0x3b')]('nolimit')){_0x4f3ef7[_0x79ed('0x20')]=qs[_0x79ed('0x20')](_0x2e23af[_0x79ed('0x33')]['limit']);_0x4f3ef7[_0x79ed('0x1f')]=qs[_0x79ed('0x1f')](_0x2e23af[_0x79ed('0x33')][_0x79ed('0x1f')]);}_0x4f3ef7[_0x79ed('0x3c')]=qs[_0x79ed('0x3d')](_0x2e23af[_0x79ed('0x33')][_0x79ed('0x3d')]);_0x4f3ef7['where']=qs[_0x79ed('0x35')](_['pick'](_0x2e23af[_0x79ed('0x33')],_0x340b19[_0x79ed('0x35')]),_0x2d4b37);if(_0x2e23af[_0x79ed('0x33')][_0x79ed('0x3e')]){_0x4f3ef7[_0x79ed('0x3f')]=_['merge'](_0x4f3ef7[_0x79ed('0x3f')],{'$or':_[_0x79ed('0x2d')](_0x2d4b37,function(_0x3aae23){if(_0x3aae23[_0x79ed('0x31')]!==_0x79ed('0x40')){var _0x2ef0c5={};_0x2ef0c5[_0x3aae23[_0x79ed('0x2b')]]={'$like':'%'+_0x2e23af[_0x79ed('0x33')]['filter']+'%'};return _0x2ef0c5;}})});}_0x4f3ef7=_['merge']({},_0x4f3ef7,_0x2e23af[_0x79ed('0x41')]);var _0x3ce6e1={'where':_0x4f3ef7[_0x79ed('0x3f')]};return db[_0x79ed('0x2e')][_0x79ed('0x22')](_0x3ce6e1)[_0x79ed('0x27')](function(_0xb400df){_0xadfc32[_0x79ed('0x22')]=_0xb400df;if(_0x2e23af[_0x79ed('0x33')][_0x79ed('0x42')]){_0x4f3ef7[_0x79ed('0x43')]=[{'all':!![]}];}return db[_0x79ed('0x2e')]['findAll'](_0x4f3ef7);})[_0x79ed('0x27')](function(_0x43d878){_0xadfc32[_0x79ed('0x44')]=_0x43d878;return _0xadfc32;})[_0x79ed('0x27')](respondWithFilteredResult(_0x7421ca,_0x4f3ef7))[_0x79ed('0x45')](handleError(_0x7421ca,null));};exports[_0x79ed('0x46')]=function(_0x48f33b,_0x11de8b){var _0x3012b6={'raw':!![],'where':{'id':_0x48f33b[_0x79ed('0x47')]['id']}},_0xace129={};_0xace129[_0x79ed('0x37')]=_['keys'](db[_0x79ed('0x2e')]['rawAttributes']);_0xace129[_0x79ed('0x33')]=_['keys'](_0x48f33b[_0x79ed('0x33')]);_0xace129[_0x79ed('0x35')]=_[_0x79ed('0x36')](_0xace129[_0x79ed('0x37')],_0xace129[_0x79ed('0x33')]);_0x3012b6[_0x79ed('0x38')]=_[_0x79ed('0x36')](_0xace129[_0x79ed('0x37')],qs[_0x79ed('0x39')](_0x48f33b['query']['fields']));_0x3012b6[_0x79ed('0x38')]=_0x3012b6[_0x79ed('0x38')][_0x79ed('0x3a')]?_0x3012b6[_0x79ed('0x38')]:_0xace129[_0x79ed('0x37')];if(_0x48f33b[_0x79ed('0x33')]['includeAll']){_0x3012b6[_0x79ed('0x43')]=[{'all':!![]}];}_0x3012b6=_['merge']({},_0x3012b6,_0x48f33b['options']);return db['AnalyticTreeReport'][_0x79ed('0x48')](_0x3012b6)[_0x79ed('0x27')](handleEntityNotFound(_0x11de8b,null))[_0x79ed('0x27')](respondWithResult(_0x11de8b,null))['catch'](handleError(_0x11de8b,null));};exports[_0x79ed('0x49')]=function(_0x26aa56,_0x133990){return db['AnalyticTreeReport'][_0x79ed('0x49')](_0x26aa56[_0x79ed('0x4a')],{})[_0x79ed('0x27')](respondWithResult(_0x133990,0xc9))[_0x79ed('0x45')](handleError(_0x133990,null));};exports[_0x79ed('0x26')]=function(_0x12c69b,_0x15ac71){if(_0x12c69b[_0x79ed('0x4a')]['id']){delete _0x12c69b['body']['id'];}return db['AnalyticTreeReport'][_0x79ed('0x48')]({'where':{'id':_0x12c69b[_0x79ed('0x47')]['id']}})[_0x79ed('0x27')](handleEntityNotFound(_0x15ac71,null))[_0x79ed('0x27')](saveUpdates(_0x12c69b[_0x79ed('0x4a')],null))['then'](respondWithResult(_0x15ac71,null))[_0x79ed('0x45')](handleError(_0x15ac71,null));};exports[_0x79ed('0x28')]=function(_0x710e65,_0x2ea0ba){return db['AnalyticTreeReport']['find']({'where':{'id':_0x710e65['params']['id']}})[_0x79ed('0x27')](handleEntityNotFound(_0x2ea0ba,null))['then'](removeEntity(_0x2ea0ba,null))[_0x79ed('0x45')](handleError(_0x2ea0ba,null));};
\ No newline at end of file
+var _0x0f63=['include','findAll','catch','show','params','options','find','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll'];(function(_0x1d6dea,_0x1f8978){var _0x1b5967=function(_0x4a95f6){while(--_0x4a95f6){_0x1d6dea['push'](_0x1d6dea['shift']());}};_0x1b5967(++_0x1f8978);}(_0x0f63,0xe6));var _0x30f6=function(_0x5b6f43,_0x2f5d8a){_0x5b6f43=_0x5b6f43-0x0;var _0x3d0477=_0x0f63[_0x5b6f43];return _0x3d0477;};'use strict';var emlformat=require(_0x30f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x30f6('0x1'));var rp=require(_0x30f6('0x2'));var moment=require('moment');var BPromise=require(_0x30f6('0x3'));var Mustache=require(_0x30f6('0x4'));var util=require(_0x30f6('0x5'));var path=require('path');var sox=require(_0x30f6('0x6'));var csv=require(_0x30f6('0x7'));var ejs=require(_0x30f6('0x8'));var fs=require('fs');var fs_extra=require(_0x30f6('0x9'));var _=require(_0x30f6('0xa'));var squel=require(_0x30f6('0xb'));var crypto=require(_0x30f6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x30f6('0x7'));var querystring=require('querystring');var Papa=require(_0x30f6('0xd'));var Redis=require(_0x30f6('0xe'));var authService=require(_0x30f6('0xf'));var qs=require(_0x30f6('0x10'));var as=require(_0x30f6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30f6('0x12'))(_0x30f6('0x13'));var utils=require(_0x30f6('0x14'));var config=require(_0x30f6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x30f6('0x16'))['db'];function respondWithStatusCode(_0x1cd36,_0x2df3a2){_0x2df3a2=_0x2df3a2||0xcc;return function(_0x26fc11){if(_0x26fc11){return _0x1cd36[_0x30f6('0x17')](_0x2df3a2);}return _0x1cd36[_0x30f6('0x18')](_0x2df3a2)[_0x30f6('0x19')]();};}function respondWithResult(_0x1efffe,_0x5c7b1a){_0x5c7b1a=_0x5c7b1a||0xc8;return function(_0x23197f){if(_0x23197f){return _0x1efffe[_0x30f6('0x18')](_0x5c7b1a)['json'](_0x23197f);}};}function respondWithFilteredResult(_0x1b5526,_0x3ae331){return function(_0x79999b){if(_0x79999b){var _0x3f2a5b=typeof _0x3ae331['offset']===_0x30f6('0x1a')&&typeof _0x3ae331['limit']===_0x30f6('0x1a');var _0x106ffc=_0x79999b['count'];var _0x3b6d8b=_0x3f2a5b?0x0:_0x3ae331[_0x30f6('0x1b')];var _0x3b06cb=_0x3f2a5b?_0x79999b[_0x30f6('0x1c')]:_0x3ae331[_0x30f6('0x1b')]+_0x3ae331['limit'];var _0x425f54;if(_0x3b06cb>=_0x106ffc){_0x3b06cb=_0x106ffc;_0x425f54=0xc8;}else{_0x425f54=0xce;}_0x1b5526[_0x30f6('0x18')](_0x425f54);return _0x1b5526[_0x30f6('0x1d')](_0x30f6('0x1e'),_0x3b6d8b+'-'+_0x3b06cb+'/'+_0x106ffc)[_0x30f6('0x1f')](_0x79999b);}return null;};}function patchUpdates(_0x5dec7){return function(_0x533ae2){try{jsonpatch[_0x30f6('0x20')](_0x533ae2,_0x5dec7,!![]);}catch(_0x546c61){return BPromise[_0x30f6('0x21')](_0x546c61);}return _0x533ae2[_0x30f6('0x22')]();};}function saveUpdates(_0xced398,_0x20e7c2){return function(_0x56e2d1){if(_0x56e2d1){return _0x56e2d1[_0x30f6('0x23')](_0xced398)[_0x30f6('0x24')](function(_0x585dea){return _0x585dea;});}return null;};}function removeEntity(_0x410b4c,_0x26888f){return function(_0x313d85){if(_0x313d85){return _0x313d85[_0x30f6('0x25')]()['then'](function(){_0x410b4c[_0x30f6('0x18')](0xcc)[_0x30f6('0x19')]();});}};}function handleEntityNotFound(_0x5c832b,_0x2cb456){return function(_0x2ec3a8){if(!_0x2ec3a8){_0x5c832b[_0x30f6('0x17')](0x194);}return _0x2ec3a8;};}function handleError(_0x37ddc9,_0x59bb4d){_0x59bb4d=_0x59bb4d||0x1f4;return function(_0x26c04d){logger['error'](_0x26c04d[_0x30f6('0x26')]);if(_0x26c04d[_0x30f6('0x27')]){delete _0x26c04d[_0x30f6('0x27')];}_0x37ddc9[_0x30f6('0x18')](_0x59bb4d)[_0x30f6('0x28')](_0x26c04d);};}exports[_0x30f6('0x29')]=function(_0x410ac9,_0x41ef76){var _0x1ad26a={},_0x237d77={},_0x378cb5={'count':0x0,'rows':[]};var _0x2640b2=_['map'](db[_0x30f6('0x2a')][_0x30f6('0x2b')],function(_0x381c1c){return{'name':_0x381c1c[_0x30f6('0x2c')],'type':_0x381c1c[_0x30f6('0x2d')][_0x30f6('0x2e')]};});_0x237d77[_0x30f6('0x2f')]=_[_0x30f6('0x30')](_0x2640b2,_0x30f6('0x27'));_0x237d77['query']=_[_0x30f6('0x31')](_0x410ac9[_0x30f6('0x32')]);_0x237d77[_0x30f6('0x33')]=_[_0x30f6('0x34')](_0x237d77['model'],_0x237d77[_0x30f6('0x32')]);_0x1ad26a[_0x30f6('0x35')]=_[_0x30f6('0x34')](_0x237d77[_0x30f6('0x2f')],qs[_0x30f6('0x36')](_0x410ac9[_0x30f6('0x32')][_0x30f6('0x36')]));_0x1ad26a['attributes']=_0x1ad26a[_0x30f6('0x35')][_0x30f6('0x37')]?_0x1ad26a[_0x30f6('0x35')]:_0x237d77[_0x30f6('0x2f')];if(!_0x410ac9['query'][_0x30f6('0x38')](_0x30f6('0x39'))){_0x1ad26a[_0x30f6('0x3a')]=qs[_0x30f6('0x3a')](_0x410ac9[_0x30f6('0x32')]['limit']);_0x1ad26a[_0x30f6('0x1b')]=qs[_0x30f6('0x1b')](_0x410ac9[_0x30f6('0x32')][_0x30f6('0x1b')]);}_0x1ad26a[_0x30f6('0x3b')]=qs[_0x30f6('0x3c')](_0x410ac9[_0x30f6('0x32')]['sort']);_0x1ad26a[_0x30f6('0x3d')]=qs[_0x30f6('0x33')](_['pick'](_0x410ac9[_0x30f6('0x32')],_0x237d77[_0x30f6('0x33')]),_0x2640b2);if(_0x410ac9['query'][_0x30f6('0x3e')]){_0x1ad26a[_0x30f6('0x3d')]=_[_0x30f6('0x3f')](_0x1ad26a[_0x30f6('0x3d')],{'$or':_['map'](_0x2640b2,function(_0x265a78){if(_0x265a78[_0x30f6('0x2d')]!==_0x30f6('0x40')){var _0x546da7={};_0x546da7[_0x265a78[_0x30f6('0x27')]]={'$like':'%'+_0x410ac9[_0x30f6('0x32')][_0x30f6('0x3e')]+'%'};return _0x546da7;}})});}_0x1ad26a=_['merge']({},_0x1ad26a,_0x410ac9['options']);var _0x22f4c7={'where':_0x1ad26a['where']};return db[_0x30f6('0x2a')][_0x30f6('0x1c')](_0x22f4c7)[_0x30f6('0x24')](function(_0x3f137a){_0x378cb5[_0x30f6('0x1c')]=_0x3f137a;if(_0x410ac9['query'][_0x30f6('0x41')]){_0x1ad26a[_0x30f6('0x42')]=[{'all':!![]}];}return db[_0x30f6('0x2a')][_0x30f6('0x43')](_0x1ad26a);})['then'](function(_0x202466){_0x378cb5['rows']=_0x202466;return _0x378cb5;})[_0x30f6('0x24')](respondWithFilteredResult(_0x41ef76,_0x1ad26a))[_0x30f6('0x44')](handleError(_0x41ef76,null));};exports[_0x30f6('0x45')]=function(_0x43fb71,_0x5bbeaa){var _0x665b73={'raw':!![],'where':{'id':_0x43fb71[_0x30f6('0x46')]['id']}},_0x2924fe={};_0x2924fe[_0x30f6('0x2f')]=_[_0x30f6('0x31')](db['AnalyticTreeReport'][_0x30f6('0x2b')]);_0x2924fe[_0x30f6('0x32')]=_['keys'](_0x43fb71[_0x30f6('0x32')]);_0x2924fe['filters']=_[_0x30f6('0x34')](_0x2924fe['model'],_0x2924fe['query']);_0x665b73['attributes']=_[_0x30f6('0x34')](_0x2924fe['model'],qs['fields'](_0x43fb71[_0x30f6('0x32')][_0x30f6('0x36')]));_0x665b73[_0x30f6('0x35')]=_0x665b73[_0x30f6('0x35')][_0x30f6('0x37')]?_0x665b73[_0x30f6('0x35')]:_0x2924fe['model'];if(_0x43fb71[_0x30f6('0x32')][_0x30f6('0x41')]){_0x665b73[_0x30f6('0x42')]=[{'all':!![]}];}_0x665b73=_[_0x30f6('0x3f')]({},_0x665b73,_0x43fb71[_0x30f6('0x47')]);return db[_0x30f6('0x2a')][_0x30f6('0x48')](_0x665b73)[_0x30f6('0x24')](handleEntityNotFound(_0x5bbeaa,null))[_0x30f6('0x24')](respondWithResult(_0x5bbeaa,null))['catch'](handleError(_0x5bbeaa,null));};exports['create']=function(_0x40cef8,_0x16b49a){return db[_0x30f6('0x2a')]['create'](_0x40cef8[_0x30f6('0x49')],{})['then'](respondWithResult(_0x16b49a,0xc9))[_0x30f6('0x44')](handleError(_0x16b49a,null));};exports[_0x30f6('0x23')]=function(_0x23d09a,_0x3e7ed8){if(_0x23d09a['body']['id']){delete _0x23d09a['body']['id'];}return db[_0x30f6('0x2a')][_0x30f6('0x48')]({'where':{'id':_0x23d09a['params']['id']}})[_0x30f6('0x24')](handleEntityNotFound(_0x3e7ed8,null))[_0x30f6('0x24')](saveUpdates(_0x23d09a[_0x30f6('0x49')],null))[_0x30f6('0x24')](respondWithResult(_0x3e7ed8,null))['catch'](handleError(_0x3e7ed8,null));};exports['destroy']=function(_0x11422b,_0x48bd28){return db['AnalyticTreeReport'][_0x30f6('0x48')]({'where':{'id':_0x11422b['params']['id']}})['then'](handleEntityNotFound(_0x48bd28,null))[_0x30f6('0x24')](removeEntity(_0x48bd28,null))[_0x30f6('0x44')](handleError(_0x48bd28,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 751ed21..c334251 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 _0xf172=['path','rimraf','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3c6614,_0x2c8250){var _0x4da19b=function(_0x36b8ca){while(--_0x36b8ca){_0x3c6614['push'](_0x3c6614['shift']());}};_0x4da19b(++_0x2c8250);}(_0xf172,0xf0));var _0x2f17=function(_0x1fed23,_0x899c14){_0x1fed23=_0x1fed23-0x0;var _0x35735f=_0xf172[_0x1fed23];return _0x35735f;};'use strict';var _=require(_0x2f17('0x0'));var util=require(_0x2f17('0x1'));var logger=require(_0x2f17('0x2'))(_0x2f17('0x3'));var moment=require(_0x2f17('0x4'));var BPromise=require(_0x2f17('0x5'));var rp=require(_0x2f17('0x6'));var fs=require('fs');var path=require(_0x2f17('0x7'));var rimraf=require(_0x2f17('0x8'));var config=require(_0x2f17('0x9'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x3be5cf,_0x25bd0c){return _0x3be5cf[_0x2f17('0xa')](_0x2f17('0xb'),attributes,{'tableName':_0x2f17('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed4f=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','path'];(function(_0x4b08be,_0xa3caac){var _0x30b817=function(_0x7624aa){while(--_0x7624aa){_0x4b08be['push'](_0x4b08be['shift']());}};_0x30b817(++_0xa3caac);}(_0xed4f,0x7c));var _0xfed4=function(_0x1bf7c6,_0x2d9527){_0x1bf7c6=_0x1bf7c6-0x0;var _0x162c30=_0xed4f[_0x1bf7c6];return _0x162c30;};'use strict';var _=require(_0xfed4('0x0'));var util=require(_0xfed4('0x1'));var logger=require(_0xfed4('0x2'))(_0xfed4('0x3'));var moment=require(_0xfed4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfed4('0x5'));var rimraf=require(_0xfed4('0x6'));var config=require(_0xfed4('0x7'));var attributes=require(_0xfed4('0x8'));module[_0xfed4('0x9')]=function(_0x527536,_0x25f386){return _0x527536[_0xfed4('0xa')](_0xfed4('0xb'),attributes,{'tableName':_0xfed4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 1903407..2bca7ef 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(_0x2f64c0,_0x5b6f26){var _0x38cb5f=function(_0x4cf5c4){while(--_0x4cf5c4){_0x2f64c0['push'](_0x2f64c0['shift']());}};_0x38cb5f(++_0x5b6f26);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1136a4,_0x5ae392){var _0x4acef5=function(_0x481cf6){while(--_0x481cf6){_0x1136a4['push'](_0x1136a4['shift']());}};_0x4acef5(++_0x5ae392);}(_0xdb28,0x106));var _0x8db2=function(_0x15fb31,_0x7e636e){_0x15fb31=_0x15fb31-0x0;var _0x36011b=_0xdb28[_0x15fb31];return _0x36011b;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 7e5096d..eff191d 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 _0x05b7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','path'];(function(_0x3b2d9d,_0x1f73b0){var _0x48142e=function(_0x5e9c7f){while(--_0x5e9c7f){_0x3b2d9d['push'](_0x3b2d9d['shift']());}};_0x48142e(++_0x1f73b0);}(_0x05b7,0x173));var _0x705b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x05b7[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x705b('0x0'));var util=require(_0x705b('0x1'));var path=require(_0x705b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x705b('0x3')]();var fs_extra=require(_0x705b('0x4'));var auth=require(_0x705b('0x5'));var interaction=require(_0x705b('0x6'));var config=require(_0x705b('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x705b('0x8')]('/',auth[_0x705b('0x9')](),controller[_0x705b('0xa')]);router[_0x705b('0x8')](_0x705b('0xb'),auth[_0x705b('0x9')](),controller[_0x705b('0xc')]);router['post']('/',auth[_0x705b('0x9')](),controller['create']);router[_0x705b('0xd')](_0x705b('0xb'),auth[_0x705b('0x9')](),controller[_0x705b('0xe')]);router['delete']('/:id',auth[_0x705b('0x9')](),controller[_0x705b('0xf')]);module[_0x705b('0x10')]=router;
\ No newline at end of file
+var _0xf00c=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5f15c3,_0x5657e1){var _0x48405e=function(_0x1052c4){while(--_0x1052c4){_0x5f15c3['push'](_0x5f15c3['shift']());}};_0x48405e(++_0x5657e1);}(_0xf00c,0x14d));var _0xcf00=function(_0x645c00,_0x46fe36){_0x645c00=_0x645c00-0x0;var _0x26776d=_0xf00c[_0x645c00];return _0x26776d;};'use strict';var multer=require(_0xcf00('0x0'));var util=require('util');var path=require(_0xcf00('0x1'));var timeout=require(_0xcf00('0x2'));var express=require(_0xcf00('0x3'));var router=express[_0xcf00('0x4')]();var fs_extra=require(_0xcf00('0x5'));var auth=require(_0xcf00('0x6'));var interaction=require(_0xcf00('0x7'));var config=require(_0xcf00('0x8'));var controller=require(_0xcf00('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcf00('0xa')]('/:id',auth[_0xcf00('0xb')](),controller[_0xcf00('0xc')]);router[_0xcf00('0xd')]('/',auth[_0xcf00('0xb')](),controller[_0xcf00('0xe')]);router[_0xcf00('0xf')](_0xcf00('0x10'),auth[_0xcf00('0xb')](),controller[_0xcf00('0x11')]);router[_0xcf00('0x12')](_0xcf00('0x10'),auth[_0xcf00('0xb')](),controller['destroy']);module[_0xcf00('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index f8aeeaa..e94e631 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 _0x5cd8=['sequelize','STRING'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x27755a,_0x1a2a4e){_0x27755a=_0x27755a-0x0;var _0x2a57b2=_0x5cd8[_0x27755a];return _0x2a57b2;};'use strict';var Sequelize=require(_0x85cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x85cd('0x1')]},'basename':{'type':Sequelize[_0x85cd('0x1')]},'type':{'type':Sequelize[_0x85cd('0x1')]}};
\ No newline at end of file
+var _0x61df=['STRING'];(function(_0x1e0f14,_0x4140c6){var _0x34fd61=function(_0x5a427f){while(--_0x5a427f){_0x1e0f14['push'](_0x1e0f14['shift']());}};_0x34fd61(++_0x4140c6);}(_0x61df,0xbd));var _0xf61d=function(_0x93d894,_0x209806){_0x93d894=_0x93d894-0x0;var _0x4919da=_0x61df[_0x93d894];return _0x4919da;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xf61d('0x0')]},'type':{'type':Sequelize[_0xf61d('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 5c44fb4..ff10203 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 _0xc316=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','reject','then','destroy','sendStatus','stack','name','send','Attachment','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','clone','get','omit','createdAt','updatedAt','create','body','update','find','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','offline-chat/','zip-dir','moment','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x495235,_0x3bc3dc){var _0x51cb41=function(_0x434259){while(--_0x434259){_0x495235['push'](_0x495235['shift']());}};_0x51cb41(++_0x3bc3dc);}(_0xc316,0x99));var _0x6c31=function(_0x37689d,_0x429426){_0x37689d=_0x37689d-0x0;var _0x25fc9e=_0xc316[_0x37689d];return _0x25fc9e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6c31('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6c31('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6c31('0x2'));var sox=require(_0x6c31('0x3'));var csv=require(_0x6c31('0x4'));var ejs=require(_0x6c31('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c31('0x6'));var squel=require(_0x6c31('0x7'));var crypto=require(_0x6c31('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c31('0x4'));var querystring=require(_0x6c31('0x9'));var Papa=require(_0x6c31('0xa'));var Redis=require(_0x6c31('0xb'));var authService=require(_0x6c31('0xc'));var qs=require(_0x6c31('0xd'));var as=require(_0x6c31('0xe'));var hardwareService=require(_0x6c31('0xf'));var logger=require(_0x6c31('0x10'))(_0x6c31('0x11'));var utils=require(_0x6c31('0x12'));var config=require(_0x6c31('0x13'));var licenseUtil=require(_0x6c31('0x14'));var db=require(_0x6c31('0x15'))['db'];function respondWithStatusCode(_0x4eef0b,_0x55fd66){_0x55fd66=_0x55fd66||0xcc;return function(_0x3136e0){if(_0x3136e0){return _0x4eef0b['sendStatus'](_0x55fd66);}return _0x4eef0b['status'](_0x55fd66)[_0x6c31('0x16')]();};}function respondWithResult(_0x2afe1a,_0x542bc4){_0x542bc4=_0x542bc4||0xc8;return function(_0x855337){if(_0x855337){return _0x2afe1a['status'](_0x542bc4)[_0x6c31('0x17')](_0x855337);}};}function respondWithFilteredResult(_0x420563,_0x232764){return function(_0x5c2a86){if(_0x5c2a86){var _0x3887e0=typeof _0x232764[_0x6c31('0x18')]===_0x6c31('0x19')&&typeof _0x232764[_0x6c31('0x1a')]===_0x6c31('0x19');var _0x119c8b=_0x5c2a86[_0x6c31('0x1b')];var _0x5ecec0=_0x3887e0?0x0:_0x232764['offset'];var _0x56c16f=_0x3887e0?_0x5c2a86['count']:_0x232764[_0x6c31('0x18')]+_0x232764['limit'];var _0x52c31a;if(_0x56c16f>=_0x119c8b){_0x56c16f=_0x119c8b;_0x52c31a=0xc8;}else{_0x52c31a=0xce;}_0x420563[_0x6c31('0x1c')](_0x52c31a);return _0x420563[_0x6c31('0x1d')]('Content-Range',_0x5ecec0+'-'+_0x56c16f+'/'+_0x119c8b)[_0x6c31('0x17')](_0x5c2a86);}return null;};}function patchUpdates(_0x4448b7){return function(_0x37b060){try{jsonpatch['apply'](_0x37b060,_0x4448b7,!![]);}catch(_0xf2bba6){return BPromise[_0x6c31('0x1e')](_0xf2bba6);}return _0x37b060['save']();};}function saveUpdates(_0x3f752f,_0x450c9a){return function(_0x33004f){if(_0x33004f){return _0x33004f['update'](_0x3f752f)[_0x6c31('0x1f')](function(_0x1f1de7){return _0x1f1de7;});}return null;};}function removeEntity(_0x209de0,_0x33b42c){return function(_0xeb386a){if(_0xeb386a){return _0xeb386a[_0x6c31('0x20')]()[_0x6c31('0x1f')](function(){_0x209de0[_0x6c31('0x1c')](0xcc)[_0x6c31('0x16')]();});}};}function handleEntityNotFound(_0x2cf828,_0xfcee0f){return function(_0x259c26){if(!_0x259c26){_0x2cf828[_0x6c31('0x21')](0x194);}return _0x259c26;};}function handleError(_0x43a906,_0x530c15){_0x530c15=_0x530c15||0x1f4;return function(_0x416953){logger['error'](_0x416953[_0x6c31('0x22')]);if(_0x416953[_0x6c31('0x23')]){delete _0x416953[_0x6c31('0x23')];}_0x43a906[_0x6c31('0x1c')](_0x530c15)[_0x6c31('0x24')](_0x416953);};}exports['index']=function(_0x46c0cb,_0x345b63){var _0x536790={},_0x3d3139={},_0x5eba0e={'count':0x0,'rows':[]};var _0x28b6d1=_['map'](db[_0x6c31('0x25')][_0x6c31('0x26')],function(_0x913404){return{'name':_0x913404['fieldName'],'type':_0x913404[_0x6c31('0x27')]['key']};});_0x3d3139[_0x6c31('0x28')]=_[_0x6c31('0x29')](_0x28b6d1,_0x6c31('0x23'));_0x3d3139[_0x6c31('0x2a')]=_[_0x6c31('0x2b')](_0x46c0cb[_0x6c31('0x2a')]);_0x3d3139[_0x6c31('0x2c')]=_[_0x6c31('0x2d')](_0x3d3139[_0x6c31('0x28')],_0x3d3139['query']);_0x536790[_0x6c31('0x2e')]=_['intersection'](_0x3d3139[_0x6c31('0x28')],qs[_0x6c31('0x2f')](_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x2f')]));_0x536790[_0x6c31('0x2e')]=_0x536790['attributes'][_0x6c31('0x30')]?_0x536790[_0x6c31('0x2e')]:_0x3d3139[_0x6c31('0x28')];if(!_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x31')](_0x6c31('0x32'))){_0x536790[_0x6c31('0x1a')]=qs['limit'](_0x46c0cb['query']['limit']);_0x536790['offset']=qs[_0x6c31('0x18')](_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x18')]);}_0x536790[_0x6c31('0x33')]=qs['sort'](_0x46c0cb['query'][_0x6c31('0x34')]);_0x536790[_0x6c31('0x35')]=qs[_0x6c31('0x2c')](_[_0x6c31('0x36')](_0x46c0cb[_0x6c31('0x2a')],_0x3d3139['filters']),_0x28b6d1);if(_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x37')]){_0x536790[_0x6c31('0x35')]=_[_0x6c31('0x38')](_0x536790[_0x6c31('0x35')],{'$or':_[_0x6c31('0x29')](_0x28b6d1,function(_0x24ea6e){if(_0x24ea6e[_0x6c31('0x27')]!==_0x6c31('0x39')){var _0x1a2fb2={};_0x1a2fb2[_0x24ea6e[_0x6c31('0x23')]]={'$like':'%'+_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x37')]+'%'};return _0x1a2fb2;}})});}_0x536790=_[_0x6c31('0x38')]({},_0x536790,_0x46c0cb[_0x6c31('0x3a')]);var _0x5a5876={'where':_0x536790[_0x6c31('0x35')]};return db['Attachment']['count'](_0x5a5876)[_0x6c31('0x1f')](function(_0x1084e4){_0x5eba0e[_0x6c31('0x1b')]=_0x1084e4;if(_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x3b')]){_0x536790['include']=[{'all':!![]}];}return db[_0x6c31('0x25')][_0x6c31('0x3c')](_0x536790);})[_0x6c31('0x1f')](function(_0x5046f7){_0x5eba0e[_0x6c31('0x3d')]=_0x5046f7;return _0x5eba0e;})[_0x6c31('0x1f')](respondWithFilteredResult(_0x345b63,_0x536790))[_0x6c31('0x3e')](handleError(_0x345b63,null));};exports['show']=function(_0x1ae2ad,_0x565a77){var _0x482400={'raw':!![],'where':{'id':_0x1ae2ad[_0x6c31('0x3f')]['id']}},_0x20fdb5={};_0x20fdb5[_0x6c31('0x28')]=_[_0x6c31('0x2b')](db['Attachment']['rawAttributes']);_0x20fdb5[_0x6c31('0x2a')]=_['keys'](_0x1ae2ad[_0x6c31('0x2a')]);_0x20fdb5['filters']=_[_0x6c31('0x2d')](_0x20fdb5[_0x6c31('0x28')],_0x20fdb5['query']);_0x482400['attributes']=_[_0x6c31('0x2d')](_0x20fdb5[_0x6c31('0x28')],qs[_0x6c31('0x2f')](_0x1ae2ad[_0x6c31('0x2a')][_0x6c31('0x2f')]));_0x482400[_0x6c31('0x2e')]=_0x482400[_0x6c31('0x2e')][_0x6c31('0x30')]?_0x482400[_0x6c31('0x2e')]:_0x20fdb5[_0x6c31('0x28')];if(_0x1ae2ad[_0x6c31('0x2a')][_0x6c31('0x3b')]){_0x482400[_0x6c31('0x40')]=[{'all':!![]}];}_0x482400=_[_0x6c31('0x38')]({},_0x482400,_0x1ae2ad['options']);return db[_0x6c31('0x25')]['find'](_0x482400)[_0x6c31('0x1f')](handleEntityNotFound(_0x565a77,null))[_0x6c31('0x1f')](respondWithResult(_0x565a77,null))[_0x6c31('0x3e')](handleError(_0x565a77,null));};exports[_0x6c31('0x41')]=function(_0x1e89a2,_0x2220eb){var _0xb5d509={'where':{'id':_0x1e89a2[_0x6c31('0x3f')]['id']}},_0x3035e0={};_0x3035e0[_0x6c31('0x28')]=_[_0x6c31('0x2b')](db['Attachment'][_0x6c31('0x26')]);_0xb5d509[_0x6c31('0x2e')]=_[_0x6c31('0x2d')](_0x3035e0[_0x6c31('0x28')],qs[_0x6c31('0x2f')](_0x1e89a2[_0x6c31('0x2a')][_0x6c31('0x2f')]));_0xb5d509[_0x6c31('0x2e')]=_0xb5d509[_0x6c31('0x2e')]['length']?_0xb5d509['attributes']:_0x3035e0[_0x6c31('0x28')];if(_0x1e89a2[_0x6c31('0x2a')]['includeAll']){_0xb5d509[_0x6c31('0x40')]=[{'all':!![]}];}_0xb5d509=_['merge']({},_0xb5d509,_0x1e89a2['options']);return db[_0x6c31('0x25')]['find'](_0xb5d509)[_0x6c31('0x1f')](handleEntityNotFound(_0x2220eb,null))[_0x6c31('0x1f')](function(_0x28f484){if(_0x28f484){var _0x430b08=_0x28f484[_0x6c31('0x42')]({'plain':!![]});_0x430b08=qs[_0x6c31('0x43')](_0x430b08,['id',_0x6c31('0x44'),'updatedAt']);_0x1e89a2['body']=_[_0x6c31('0x43')](_0x1e89a2['body'],['id',_0x6c31('0x44'),_0x6c31('0x45')]);return db[_0x6c31('0x25')][_0x6c31('0x46')](_[_0x6c31('0x38')](_0x430b08,_0x1e89a2[_0x6c31('0x47')]),{'include':_0x1e89a2[_0x6c31('0x2a')][_0x6c31('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2220eb,0xc9))['catch'](handleError(_0x2220eb,null));};exports[_0x6c31('0x48')]=function(_0x4bef7c,_0x372634){if(_0x4bef7c[_0x6c31('0x47')]['id']){delete _0x4bef7c[_0x6c31('0x47')]['id'];}return db[_0x6c31('0x25')][_0x6c31('0x49')]({'where':{'id':_0x4bef7c[_0x6c31('0x3f')]['id']}})[_0x6c31('0x1f')](handleEntityNotFound(_0x372634,null))[_0x6c31('0x1f')](saveUpdates(_0x4bef7c[_0x6c31('0x47')],null))[_0x6c31('0x1f')](respondWithResult(_0x372634,null))[_0x6c31('0x3e')](handleError(_0x372634,null));};exports['destroy']=function(_0x529814,_0x5882ad){return db[_0x6c31('0x25')][_0x6c31('0x49')]({'where':{'id':_0x529814[_0x6c31('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5882ad,null))[_0x6c31('0x1f')](removeEntity(_0x5882ad,null))['catch'](handleError(_0x5882ad,null));};exports[_0x6c31('0x46')]=function(_0x3a84b2,_0x2f0f32,_0xfb0ed7){_0x3a84b2['body'][_0x6c31('0x23')]=_0x3a84b2[_0x6c31('0x4a')][_0x6c31('0x4b')];_0x3a84b2[_0x6c31('0x47')][_0x6c31('0x4c')]=_0x3a84b2[_0x6c31('0x4a')]['filename'];_0x3a84b2['body'][_0x6c31('0x27')]=_0x3a84b2[_0x6c31('0x4a')][_0x6c31('0x4d')];return db[_0x6c31('0x25')][_0x6c31('0x46')](_0x3a84b2[_0x6c31('0x47')])[_0x6c31('0x1f')](respondWithResult(_0x2f0f32,0xc9))[_0x6c31('0x3e')](handleError(_0x2f0f32,null));};exports[_0x6c31('0x4e')]=function(_0x5a28f4,_0x27ffcb,_0x2087a5){return db[_0x6c31('0x25')][_0x6c31('0x4f')]({'where':{'id':_0x5a28f4[_0x6c31('0x3f')]['id']},'raw':!![]})[_0x6c31('0x1f')](handleEntityNotFound(_0x27ffcb,null))['then'](function(_0x29511f){if(_0x29511f){var _0x9f8848=_0x29511f[_0x6c31('0x50')]!==null;var _0x2d1155=path[_0x6c31('0x51')](config['root'],'server/files/attachments/');if(_0x9f8848){_0x2d1155=path[_0x6c31('0x51')](_0x2d1155,_0x6c31('0x52'));}var _0x3a830d=path[_0x6c31('0x51')](_0x2d1155,_0x29511f[_0x6c31('0x4c')]);return _0x27ffcb['download'](_0x3a830d);}})['catch'](handleError(_0x27ffcb,null));};
\ No newline at end of file
+var _0x1f15=['catch','show','params','keys','fields','includeAll','find','clone','omit','createdAt','body','updatedAt','create','file','basename','filename','mimetype','download','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','nolimit','order','sort','where','filters','merge','filter','options','Attachment','include','findAll','rows','then'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0x1f15,0xc8));var _0x51f1=function(_0x2e4ffa,_0xeb3d5){_0x2e4ffa=_0x2e4ffa-0x0;var _0x205ff7=_0x1f15[_0x2e4ffa];return _0x205ff7;};'use strict';var emlformat=require(_0x51f1('0x0'));var rimraf=require(_0x51f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51f1('0x2'));var rp=require(_0x51f1('0x3'));var moment=require(_0x51f1('0x4'));var BPromise=require(_0x51f1('0x5'));var Mustache=require(_0x51f1('0x6'));var util=require('util');var path=require(_0x51f1('0x7'));var sox=require('sox');var csv=require(_0x51f1('0x8'));var ejs=require(_0x51f1('0x9'));var fs=require('fs');var fs_extra=require(_0x51f1('0xa'));var _=require(_0x51f1('0xb'));var squel=require('squel');var crypto=require(_0x51f1('0xc'));var jsforce=require(_0x51f1('0xd'));var deskjs=require(_0x51f1('0xe'));var toCsv=require(_0x51f1('0x8'));var querystring=require(_0x51f1('0xf'));var Papa=require(_0x51f1('0x10'));var Redis=require(_0x51f1('0x11'));var authService=require(_0x51f1('0x12'));var qs=require(_0x51f1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51f1('0x14'));var logger=require(_0x51f1('0x15'))(_0x51f1('0x16'));var utils=require(_0x51f1('0x17'));var config=require(_0x51f1('0x18'));var licenseUtil=require(_0x51f1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5da936,_0x1b636e){_0x1b636e=_0x1b636e||0xcc;return function(_0x4a8017){if(_0x4a8017){return _0x5da936[_0x51f1('0x1a')](_0x1b636e);}return _0x5da936[_0x51f1('0x1b')](_0x1b636e)[_0x51f1('0x1c')]();};}function respondWithResult(_0x351930,_0x50bf1d){_0x50bf1d=_0x50bf1d||0xc8;return function(_0x39462f){if(_0x39462f){return _0x351930[_0x51f1('0x1b')](_0x50bf1d)[_0x51f1('0x1d')](_0x39462f);}};}function respondWithFilteredResult(_0x51402c,_0x31a5a5){return function(_0x25cd3d){if(_0x25cd3d){var _0x2dba9d=typeof _0x31a5a5[_0x51f1('0x1e')]===_0x51f1('0x1f')&&typeof _0x31a5a5[_0x51f1('0x20')]===_0x51f1('0x1f');var _0x1468f8=_0x25cd3d[_0x51f1('0x21')];var _0x5c7430=_0x2dba9d?0x0:_0x31a5a5[_0x51f1('0x1e')];var _0x4aab50=_0x2dba9d?_0x25cd3d['count']:_0x31a5a5[_0x51f1('0x1e')]+_0x31a5a5[_0x51f1('0x20')];var _0x4d294f;if(_0x4aab50>=_0x1468f8){_0x4aab50=_0x1468f8;_0x4d294f=0xc8;}else{_0x4d294f=0xce;}_0x51402c['status'](_0x4d294f);return _0x51402c['set'](_0x51f1('0x22'),_0x5c7430+'-'+_0x4aab50+'/'+_0x1468f8)['json'](_0x25cd3d);}return null;};}function patchUpdates(_0x2aa6d0){return function(_0x428e1b){try{jsonpatch[_0x51f1('0x23')](_0x428e1b,_0x2aa6d0,!![]);}catch(_0x415b86){return BPromise[_0x51f1('0x24')](_0x415b86);}return _0x428e1b['save']();};}function saveUpdates(_0x452a51,_0x3bc6d2){return function(_0x3c7490){if(_0x3c7490){return _0x3c7490[_0x51f1('0x25')](_0x452a51)['then'](function(_0x427033){return _0x427033;});}return null;};}function removeEntity(_0x2abd8e,_0x330723){return function(_0x3b9c2d){if(_0x3b9c2d){return _0x3b9c2d[_0x51f1('0x26')]()['then'](function(){_0x2abd8e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc4e0ca,_0x193823){return function(_0x666a52){if(!_0x666a52){_0xc4e0ca['sendStatus'](0x194);}return _0x666a52;};}function handleError(_0x3c9a75,_0x196e42){_0x196e42=_0x196e42||0x1f4;return function(_0x3737b7){logger[_0x51f1('0x27')](_0x3737b7[_0x51f1('0x28')]);if(_0x3737b7[_0x51f1('0x29')]){delete _0x3737b7[_0x51f1('0x29')];}_0x3c9a75[_0x51f1('0x1b')](_0x196e42)[_0x51f1('0x2a')](_0x3737b7);};}exports[_0x51f1('0x2b')]=function(_0x50602c,_0x2387bd){var _0x15b89d={},_0x2ad0d9={},_0x5a3572={'count':0x0,'rows':[]};var _0x30cd66=_[_0x51f1('0x2c')](db['Attachment'][_0x51f1('0x2d')],function(_0x77d552){return{'name':_0x77d552[_0x51f1('0x2e')],'type':_0x77d552[_0x51f1('0x2f')][_0x51f1('0x30')]};});_0x2ad0d9[_0x51f1('0x31')]=_['map'](_0x30cd66,_0x51f1('0x29'));_0x2ad0d9[_0x51f1('0x32')]=_['keys'](_0x50602c[_0x51f1('0x32')]);_0x2ad0d9['filters']=_[_0x51f1('0x33')](_0x2ad0d9['model'],_0x2ad0d9[_0x51f1('0x32')]);_0x15b89d[_0x51f1('0x34')]=_[_0x51f1('0x33')](_0x2ad0d9['model'],qs['fields'](_0x50602c[_0x51f1('0x32')]['fields']));_0x15b89d[_0x51f1('0x34')]=_0x15b89d[_0x51f1('0x34')][_0x51f1('0x35')]?_0x15b89d[_0x51f1('0x34')]:_0x2ad0d9['model'];if(!_0x50602c[_0x51f1('0x32')]['hasOwnProperty'](_0x51f1('0x36'))){_0x15b89d[_0x51f1('0x20')]=qs['limit'](_0x50602c['query'][_0x51f1('0x20')]);_0x15b89d[_0x51f1('0x1e')]=qs['offset'](_0x50602c[_0x51f1('0x32')][_0x51f1('0x1e')]);}_0x15b89d[_0x51f1('0x37')]=qs[_0x51f1('0x38')](_0x50602c[_0x51f1('0x32')][_0x51f1('0x38')]);_0x15b89d[_0x51f1('0x39')]=qs[_0x51f1('0x3a')](_['pick'](_0x50602c[_0x51f1('0x32')],_0x2ad0d9['filters']),_0x30cd66);if(_0x50602c[_0x51f1('0x32')]['filter']){_0x15b89d[_0x51f1('0x39')]=_[_0x51f1('0x3b')](_0x15b89d[_0x51f1('0x39')],{'$or':_[_0x51f1('0x2c')](_0x30cd66,function(_0x5514ff){if(_0x5514ff['type']!=='VIRTUAL'){var _0x466ca0={};_0x466ca0[_0x5514ff['name']]={'$like':'%'+_0x50602c[_0x51f1('0x32')][_0x51f1('0x3c')]+'%'};return _0x466ca0;}})});}_0x15b89d=_[_0x51f1('0x3b')]({},_0x15b89d,_0x50602c[_0x51f1('0x3d')]);var _0xb3e688={'where':_0x15b89d[_0x51f1('0x39')]};return db[_0x51f1('0x3e')][_0x51f1('0x21')](_0xb3e688)['then'](function(_0x4435bd){_0x5a3572[_0x51f1('0x21')]=_0x4435bd;if(_0x50602c[_0x51f1('0x32')]['includeAll']){_0x15b89d[_0x51f1('0x3f')]=[{'all':!![]}];}return db[_0x51f1('0x3e')][_0x51f1('0x40')](_0x15b89d);})['then'](function(_0x419d7f){_0x5a3572[_0x51f1('0x41')]=_0x419d7f;return _0x5a3572;})[_0x51f1('0x42')](respondWithFilteredResult(_0x2387bd,_0x15b89d))[_0x51f1('0x43')](handleError(_0x2387bd,null));};exports[_0x51f1('0x44')]=function(_0x73dbd1,_0x327bc5){var _0x3643ed={'raw':!![],'where':{'id':_0x73dbd1[_0x51f1('0x45')]['id']}},_0x144e7d={};_0x144e7d[_0x51f1('0x31')]=_[_0x51f1('0x46')](db[_0x51f1('0x3e')][_0x51f1('0x2d')]);_0x144e7d[_0x51f1('0x32')]=_[_0x51f1('0x46')](_0x73dbd1[_0x51f1('0x32')]);_0x144e7d[_0x51f1('0x3a')]=_['intersection'](_0x144e7d[_0x51f1('0x31')],_0x144e7d[_0x51f1('0x32')]);_0x3643ed[_0x51f1('0x34')]=_[_0x51f1('0x33')](_0x144e7d[_0x51f1('0x31')],qs[_0x51f1('0x47')](_0x73dbd1[_0x51f1('0x32')][_0x51f1('0x47')]));_0x3643ed[_0x51f1('0x34')]=_0x3643ed[_0x51f1('0x34')][_0x51f1('0x35')]?_0x3643ed[_0x51f1('0x34')]:_0x144e7d[_0x51f1('0x31')];if(_0x73dbd1[_0x51f1('0x32')][_0x51f1('0x48')]){_0x3643ed[_0x51f1('0x3f')]=[{'all':!![]}];}_0x3643ed=_[_0x51f1('0x3b')]({},_0x3643ed,_0x73dbd1[_0x51f1('0x3d')]);return db['Attachment'][_0x51f1('0x49')](_0x3643ed)['then'](handleEntityNotFound(_0x327bc5,null))[_0x51f1('0x42')](respondWithResult(_0x327bc5,null))[_0x51f1('0x43')](handleError(_0x327bc5,null));};exports[_0x51f1('0x4a')]=function(_0x97ce69,_0x8f2350){var _0x48a7b9={'where':{'id':_0x97ce69[_0x51f1('0x45')]['id']}},_0x5f5d63={};_0x5f5d63['model']=_['keys'](db[_0x51f1('0x3e')][_0x51f1('0x2d')]);_0x48a7b9[_0x51f1('0x34')]=_[_0x51f1('0x33')](_0x5f5d63['model'],qs[_0x51f1('0x47')](_0x97ce69[_0x51f1('0x32')][_0x51f1('0x47')]));_0x48a7b9[_0x51f1('0x34')]=_0x48a7b9[_0x51f1('0x34')]['length']?_0x48a7b9['attributes']:_0x5f5d63[_0x51f1('0x31')];if(_0x97ce69[_0x51f1('0x32')][_0x51f1('0x48')]){_0x48a7b9['include']=[{'all':!![]}];}_0x48a7b9=_[_0x51f1('0x3b')]({},_0x48a7b9,_0x97ce69['options']);return db[_0x51f1('0x3e')][_0x51f1('0x49')](_0x48a7b9)[_0x51f1('0x42')](handleEntityNotFound(_0x8f2350,null))['then'](function(_0x25cdba){if(_0x25cdba){var _0x22125f=_0x25cdba['get']({'plain':!![]});_0x22125f=qs[_0x51f1('0x4b')](_0x22125f,['id',_0x51f1('0x4c'),'updatedAt']);_0x97ce69[_0x51f1('0x4d')]=_[_0x51f1('0x4b')](_0x97ce69[_0x51f1('0x4d')],['id',_0x51f1('0x4c'),_0x51f1('0x4e')]);return db['Attachment'][_0x51f1('0x4f')](_[_0x51f1('0x3b')](_0x22125f,_0x97ce69[_0x51f1('0x4d')]),{'include':_0x97ce69[_0x51f1('0x32')][_0x51f1('0x48')]?[{'all':!![]}]:undefined});}})[_0x51f1('0x42')](respondWithResult(_0x8f2350,0xc9))[_0x51f1('0x43')](handleError(_0x8f2350,null));};exports[_0x51f1('0x25')]=function(_0x3b9778,_0x4fde1c){if(_0x3b9778['body']['id']){delete _0x3b9778[_0x51f1('0x4d')]['id'];}return db[_0x51f1('0x3e')][_0x51f1('0x49')]({'where':{'id':_0x3b9778[_0x51f1('0x45')]['id']}})[_0x51f1('0x42')](handleEntityNotFound(_0x4fde1c,null))[_0x51f1('0x42')](saveUpdates(_0x3b9778[_0x51f1('0x4d')],null))[_0x51f1('0x42')](respondWithResult(_0x4fde1c,null))[_0x51f1('0x43')](handleError(_0x4fde1c,null));};exports[_0x51f1('0x26')]=function(_0x25e00a,_0x299d4c){return db[_0x51f1('0x3e')][_0x51f1('0x49')]({'where':{'id':_0x25e00a['params']['id']}})[_0x51f1('0x42')](handleEntityNotFound(_0x299d4c,null))[_0x51f1('0x42')](removeEntity(_0x299d4c,null))[_0x51f1('0x43')](handleError(_0x299d4c,null));};exports['create']=function(_0x49ae95,_0x4ca370,_0x56bc0e){_0x49ae95[_0x51f1('0x4d')][_0x51f1('0x29')]=_0x49ae95[_0x51f1('0x50')]['originalname'];_0x49ae95[_0x51f1('0x4d')][_0x51f1('0x51')]=_0x49ae95['file'][_0x51f1('0x52')];_0x49ae95[_0x51f1('0x4d')][_0x51f1('0x2f')]=_0x49ae95[_0x51f1('0x50')][_0x51f1('0x53')];return db['Attachment'][_0x51f1('0x4f')](_0x49ae95[_0x51f1('0x4d')])['then'](respondWithResult(_0x4ca370,0xc9))[_0x51f1('0x43')](handleError(_0x4ca370,null));};exports[_0x51f1('0x54')]=function(_0x10ee77,_0x657336,_0x4e17de){return db['Attachment']['findOne']({'where':{'id':_0x10ee77[_0x51f1('0x45')]['id']},'raw':!![]})[_0x51f1('0x42')](handleEntityNotFound(_0x657336,null))[_0x51f1('0x42')](function(_0x1d3a3d){if(_0x1d3a3d){var _0x57ed2b=_0x1d3a3d['ChatOfflineMessageId']!==null;var _0x5622d5=path[_0x51f1('0x55')](config[_0x51f1('0x56')],_0x51f1('0x57'));if(_0x57ed2b){_0x5622d5=path[_0x51f1('0x55')](_0x5622d5,_0x51f1('0x58'));}var _0x58d28d=path[_0x51f1('0x55')](_0x5622d5,_0x1d3a3d['basename']);return _0x657336[_0x51f1('0x54')](_0x58d28d);}})['catch'](handleError(_0x657336,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a868f9a..250227e 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 _0xe6a1=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0xe6a1,0x153));var _0x1e6a=function(_0x3beefb,_0x24f918){_0x3beefb=_0x3beefb-0x0;var _0x58807a=_0xe6a1[_0x3beefb];return _0x58807a;};'use strict';var _=require(_0x1e6a('0x0'));var util=require(_0x1e6a('0x1'));var logger=require(_0x1e6a('0x2'))(_0x1e6a('0x3'));var moment=require(_0x1e6a('0x4'));var BPromise=require(_0x1e6a('0x5'));var rp=require(_0x1e6a('0x6'));var fs=require('fs');var path=require(_0x1e6a('0x7'));var rimraf=require(_0x1e6a('0x8'));var config=require(_0x1e6a('0x9'));var attributes=require(_0x1e6a('0xa'));module[_0x1e6a('0xb')]=function(_0x36b92b,_0x16458f){return _0x36b92b[_0x1e6a('0xc')](_0x1e6a('0xd'),attributes,{'tableName':_0x1e6a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd10f=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','Attachment','attachments','lodash'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0xd10f,0x6b));var _0xfd10=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd10f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfd10('0x0'));var util=require(_0xfd10('0x1'));var logger=require(_0xfd10('0x2'))(_0xfd10('0x3'));var moment=require('moment');var BPromise=require(_0xfd10('0x4'));var rp=require(_0xfd10('0x5'));var fs=require('fs');var path=require(_0xfd10('0x6'));var rimraf=require(_0xfd10('0x7'));var config=require('../../config/environment');var attributes=require(_0xfd10('0x8'));module[_0xfd10('0x9')]=function(_0x2bef22,_0x41f8e1){return _0x2bef22['define'](_0xfd10('0xa'),attributes,{'tableName':_0xfd10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index f343cb2..e9716c8 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 _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(_0x4583a9,_0x16aef1){var _0x4c3559=function(_0x232bd0){while(--_0x232bd0){_0x4583a9['push'](_0x4583a9['shift']());}};_0x4c3559(++_0x16aef1);}(_0xee11,0x146));var _0x1ee1=function(_0x14510c,_0x3f66f0){_0x14510c=_0x14510c-0x0;var _0x31c5f8=_0xee11[_0x14510c];return _0x31c5f8;};'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
+var _0xa0bc=['options','raw','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','create','body'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var moment=require(_0xca0b('0x1'));var BPromise=require('bluebird');var rs=require(_0xca0b('0x2'));var fs=require('fs');var Redis=require(_0xca0b('0x3'));var db=require(_0xca0b('0x4'))['db'];var utils=require(_0xca0b('0x5'));var logger=require(_0xca0b('0x6'))(_0xca0b('0x7'));var config=require(_0xca0b('0x8'));var jayson=require(_0xca0b('0x9'));var client=jayson[_0xca0b('0xa')][_0xca0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe64c7,_0x30202d,_0xa506a4){return new BPromise(function(_0x19acc2,_0x55a1de){return client[_0xca0b('0xc')](_0xbe64c7,_0xa506a4)[_0xca0b('0xd')](function(_0x3e3909){logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));logger['debug'](_0xca0b('0x11'),_0x30202d,_0xca0b('0x10'),JSON[_0xca0b('0x12')](_0x3e3909));if(_0x3e3909[_0xca0b('0x13')]){if(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x14')]===0x1f4){logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);return _0x55a1de(_0x3e3909['error'][_0xca0b('0x15')]);}logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909['error'][_0xca0b('0x15')]);return _0x19acc2(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);}else{logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));_0x19acc2(_0x3e3909['result'][_0xca0b('0x15')]);}})[_0xca0b('0x16')](function(_0x4d9b16){logger[_0xca0b('0x13')]('Attachment,\x20%s,\x20%s',_0x30202d,_0x4d9b16);_0x55a1de(_0x4d9b16);});});}exports[_0xca0b('0x17')]=function(_0x5050b7){var _0x236503=this;return new Promise(function(_0x32eff7,_0x97be82){return db['Attachment'][_0xca0b('0x18')](_0x5050b7[_0xca0b('0x19')],{'raw':_0x5050b7['options']?_0x5050b7[_0xca0b('0x1a')][_0xca0b('0x1b')]===undefined?!![]:![]:!![]})[_0xca0b('0xd')](function(_0x59bda9){logger[_0xca0b('0xe')](_0xca0b('0x17'),_0x5050b7);logger[_0xca0b('0x1c')](_0xca0b('0x17'),_0x5050b7,JSON[_0xca0b('0x12')](_0x59bda9));_0x32eff7(_0x59bda9);})[_0xca0b('0x16')](function(_0x49e695){logger[_0xca0b('0x13')](_0xca0b('0x17'),_0x49e695[_0xca0b('0x15')],_0x5050b7);_0x97be82(_0x236503['error'](0x1f4,_0x49e695['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 88e7185..08192d0 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x302088,_0x521f67){var _0xbfe239=function(_0x2e8fd7){while(--_0x2e8fd7){_0x302088['push'](_0x302088['shift']());}};_0xbfe239(++_0x521f67);}(_0x757a,0xde));var _0xa757=function(_0x349b8b,_0x1b8e0b){_0x349b8b=_0x349b8b-0x0;var _0x2f5cac=_0x757a[_0x349b8b];return _0x2f5cac;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x3baad0,_0x5a76fc){var _0x33651d=function(_0x36561c){while(--_0x36561c){_0x3baad0['push'](_0x3baad0['shift']());}};_0x33651d(++_0x5a76fc);}(_0x757a,0xde));var _0xa757=function(_0x454b26,_0x29e187){_0x454b26=_0x454b26-0x0;var _0x3f3121=_0x757a[_0x454b26];return _0x3f3121;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index d5534de..3cc802f 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 _0xefdb=['activedirectory','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','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','disabled','blocked','blockedAt','user','agent','domain','minutes','clearBlockUser','getLicense','catch','status','send','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','User','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../config/utils','../../config/logger','undefined'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xefdb,0x1c3));var _0xbefd=function(_0x29f7db,_0x5c1a37){_0x29f7db=_0x29f7db-0x0;var _0x1349d6=_0xefdb[_0x29f7db];return _0x1349d6;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xbefd('0x0'))[_0xbefd('0x1')];var moment=require(_0xbefd('0x2'));var ActiveDirectory=require(_0xbefd('0x3'));var BPromise=require(_0xbefd('0x4'));var util=require(_0xbefd('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xbefd('0x6'));var config=require('../../config/environment');var logger=require(_0xbefd('0x7'))('api');function isActiveDirectoryConfigured(_0xd337a9){var _0x56a545=![];if(typeof _0xd337a9['activedirectory']!==_0xbefd('0x8')){_0x56a545=_0xd337a9[_0xbefd('0x9')][_0xbefd('0xa')]&&_0xd337a9[_0xbefd('0x9')][_0xbefd('0xb')]&&_0xd337a9[_0xbefd('0x9')]['domain'];}return _0x56a545;}function adAuthenticate(_0x309e40,_0x55284d,_0x15f850){return new BPromise(function(_0x51d92d,_0x4b26e4){try{var _0x47d8fe=new ActiveDirectory(_0x309e40);_0x47d8fe['authenticate'](_0x55284d,_0x15f850,function(_0x4ef43d,_0x508f2e){if(_0x4ef43d){logger[_0xbefd('0xc')](_0xbefd('0xd'),_0x55284d,util['inspect'](_0x4ef43d,{'showHidden':![],'depth':null}));_0x4b26e4(_0xbefd('0xe'));}else if(!_0x508f2e){logger[_0xbefd('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x55284d);_0x4b26e4(_0xbefd('0xe'));}else{_0x51d92d(_0x508f2e);}});}catch(_0x216dc0){_0x4b26e4(_0x216dc0);}});}function ActiveDirectoryAuthenticate(_0x172bad,_0x15941d,_0x458751,_0x48def7){var _0xdad20f,_0xb1d2e4;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xbefd('0xf'),_0x15941d);return _0x48def7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xbefd('0x10')][_0xbefd('0x11')]({'where':{'id':0x1},'attributes':[_0xbefd('0x12'),_0xbefd('0x13')],'raw':!![]})[_0xbefd('0x14')](function(_0x313a80){_0xdad20f=_0x313a80;if(!_0xdad20f['adSsoEnabled']){logger[_0xbefd('0xc')](_0xbefd('0x15'),_0x15941d);throw new Error(_0xbefd('0xe'));}return _0x172bad[_0xbefd('0x11')]({'attributes':['id',_0xbefd('0x16'),_0xbefd('0x17'),_0xbefd('0x18'),_0xbefd('0x19'),_0xbefd('0x1a'),_0xbefd('0x1b'),_0xbefd('0x1c'),'online'],'where':{'name':_0x15941d,'role':{'$or':['admin',_0xbefd('0x1d'),_0xbefd('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x40ea93){if(!_0x40ea93||_0x40ea93&&_0x40ea93[_0xbefd('0x16')]!==_0x15941d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0xb1d2e4=_0x40ea93;var _0x1f467e=_0xb1d2e4[_0xbefd('0x16')]+'@'+config[_0xbefd('0x9')][_0xbefd('0x1f')];return adAuthenticate(config[_0xbefd('0x9')],_0x1f467e,_0x458751);})['then'](function(_0x2f2d05){if(_0xb1d2e4[_0xbefd('0x1a')]){throw new Error(_0xbefd('0xe'));}if(_0xdad20f[_0xbefd('0x13')]>0x0){if(_0xb1d2e4['blocked']){if(moment(_0xb1d2e4[_0xbefd('0x1c')])['add'](_0xdad20f[_0xbefd('0x13')],_0xbefd('0x20'))>moment()){throw new Error(_0xbefd('0xe'));}return utils[_0xbefd('0x21')](_0xb1d2e4,0x0,![],null)['then'](function(){return utils['getLicense'](_0xb1d2e4);})['then'](function(){return _0x48def7(null,_0xb1d2e4);});}else{return utils[_0xbefd('0x22')](_0xb1d2e4)[_0xbefd('0x14')](function(){return _0x48def7(null,_0xb1d2e4);});}}else{return utils['getLicense'](_0xb1d2e4)[_0xbefd('0x14')](function(){return _0x48def7(null,_0xb1d2e4);});}})[_0xbefd('0x23')](function(_0x5a1590){return _0x48def7(null,![],_0x5a1590);});}function handleError(_0x505765,_0x2d3b29,_0x237d65){return _0x505765[_0xbefd('0x24')](_0x2d3b29||0x1f4)[_0xbefd('0x25')]({'message':_0x237d65?_0x237d65['message']||_0x237d65:''});}exports[_0xbefd('0x26')]=function(_0xeea723,_0x2ae229,_0x2d0cb8){passport[_0xbefd('0x27')](_0xbefd('0x28'),function(_0x31475c,_0x42abfc,_0x2ca292){var _0x4ab056=_0x31475c||_0x2ca292;if(_0x4ab056){return handleError(_0x2ae229,0x191,_0x4ab056);}if(!_0x42abfc){return handleError(_0x2ae229,0x194,{'message':_0xbefd('0x29')});}else{var _0x17f777={'payload':{'id':_0x42abfc['id'],'role':_0x42abfc[_0xbefd('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0xbefd('0x2a')](_0x17f777)[_0xbefd('0x14')](function(_0x2a0ff0){_0x2ae229[_0xbefd('0x2b')]({'id':_0x42abfc['id'],'token':_0x2a0ff0,'statusCall':'','isAlreadyLogged':_0x42abfc[_0xbefd('0x2c')]});});}})(_0xeea723,_0x2ae229,_0x2d0cb8);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0xbefd('0x16'),'passwordField':_0xbefd('0x17')},function(_0x2d3fbb,_0xa5c471,_0x71c850){return ActiveDirectoryAuthenticate(db[_0xbefd('0x2d')],_0x2d3fbb,_0xa5c471,_0x71c850);}));
\ No newline at end of file
+var _0xde7f=['blocked','blockedAt','online','agent','blockDuration','add','clearBlockUser','getLicense','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','use','moment','activedirectory2','util','api','undefined','activedirectory','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','name','password','salt','disabled'];(function(_0xcd7a10,_0x59b6cd){var _0x4dd6cb=function(_0x4bd6bc){while(--_0x4bd6bc){_0xcd7a10['push'](_0xcd7a10['shift']());}};_0x4dd6cb(++_0x59b6cd);}(_0xde7f,0x1f0));var _0xfde7=function(_0xe11d55,_0xf10bdf){_0xe11d55=_0xe11d55-0x0;var _0x2087cb=_0xde7f[_0xe11d55];return _0x2087cb;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xfde7('0x0'));var ActiveDirectory=require(_0xfde7('0x1'));var BPromise=require('bluebird');var util=require(_0xfde7('0x2'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')(_0xfde7('0x3'));function isActiveDirectoryConfigured(_0x2c6045){var _0x15c7f5=![];if(typeof _0x2c6045['activedirectory']!==_0xfde7('0x4')){_0x15c7f5=_0x2c6045[_0xfde7('0x5')]['baseDN']&&_0x2c6045[_0xfde7('0x5')][_0xfde7('0x6')]&&_0x2c6045[_0xfde7('0x5')]['domain'];}return _0x15c7f5;}function adAuthenticate(_0x1aeae4,_0x3b7df5,_0x1914b4){return new BPromise(function(_0x1cf57e,_0x4c440e){try{var _0x387f0d=new ActiveDirectory(_0x1aeae4);_0x387f0d[_0xfde7('0x7')](_0x3b7df5,_0x1914b4,function(_0x317b89,_0x32016a){if(_0x317b89){logger[_0xfde7('0x8')](_0xfde7('0x9'),_0x3b7df5,util[_0xfde7('0xa')](_0x317b89,{'showHidden':![],'depth':null}));_0x4c440e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x32016a){logger['error'](_0xfde7('0xb'),_0x3b7df5);_0x4c440e(_0xfde7('0xc'));}else{_0x1cf57e(_0x32016a);}});}catch(_0x33a664){_0x4c440e(_0x33a664);}});}function ActiveDirectoryAuthenticate(_0x352ded,_0xe7097c,_0x36d637,_0x5af4a8){var _0xb19ec2,_0x3edbfc;if(!isActiveDirectoryConfigured(config)){logger[_0xfde7('0x8')](_0xfde7('0xd'),_0xe7097c);return _0x5af4a8(null,![],{'message':_0xfde7('0xc')});}return db[_0xfde7('0xe')][_0xfde7('0xf')]({'where':{'id':0x1},'attributes':[_0xfde7('0x10'),'blockDuration'],'raw':!![]})[_0xfde7('0x11')](function(_0x10d007){_0xb19ec2=_0x10d007;if(!_0xb19ec2['adSsoEnabled']){logger[_0xfde7('0x8')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0xe7097c);throw new Error(_0xfde7('0xc'));}return _0x352ded[_0xfde7('0xf')]({'attributes':['id',_0xfde7('0x12'),_0xfde7('0x13'),_0xfde7('0x14'),'role',_0xfde7('0x15'),_0xfde7('0x16'),_0xfde7('0x17'),_0xfde7('0x18')],'where':{'name':_0xe7097c,'role':{'$or':['admin','user',_0xfde7('0x19')]},'adSsoEnabled':!![]}});})['then'](function(_0x727546){if(!_0x727546||_0x727546&&_0x727546[_0xfde7('0x12')]!==_0xe7097c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x3edbfc=_0x727546;var _0x35cf7f=_0x3edbfc[_0xfde7('0x12')]+'@'+config[_0xfde7('0x5')]['domain'];return adAuthenticate(config['activedirectory'],_0x35cf7f,_0x36d637);})[_0xfde7('0x11')](function(_0x27ed39){if(_0x3edbfc[_0xfde7('0x15')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0xb19ec2[_0xfde7('0x1a')]>0x0){if(_0x3edbfc['blocked']){if(moment(_0x3edbfc['blockedAt'])[_0xfde7('0x1b')](_0xb19ec2[_0xfde7('0x1a')],'minutes')>moment()){throw new Error(_0xfde7('0xc'));}return utils[_0xfde7('0x1c')](_0x3edbfc,0x0,![],null)[_0xfde7('0x11')](function(){return utils[_0xfde7('0x1d')](_0x3edbfc);})[_0xfde7('0x11')](function(){return _0x5af4a8(null,_0x3edbfc);});}else{return utils[_0xfde7('0x1d')](_0x3edbfc)['then'](function(){return _0x5af4a8(null,_0x3edbfc);});}}else{return utils[_0xfde7('0x1d')](_0x3edbfc)[_0xfde7('0x11')](function(){return _0x5af4a8(null,_0x3edbfc);});}})['catch'](function(_0x576a0c){return _0x5af4a8(null,![],_0x576a0c);});}function handleError(_0x1ae353,_0x11fb12,_0x394017){return _0x1ae353[_0xfde7('0x1e')](_0x11fb12||0x1f4)[_0xfde7('0x1f')]({'message':_0x394017?_0x394017[_0xfde7('0x20')]||_0x394017:''});}exports['login']=function(_0x494ab5,_0x1190e4,_0x2a9ea8){passport[_0xfde7('0x7')](_0xfde7('0x21'),function(_0x460981,_0x113a1e,_0x219008){var _0x440daf=_0x460981||_0x219008;if(_0x440daf){return handleError(_0x1190e4,0x191,_0x440daf);}if(!_0x113a1e){return handleError(_0x1190e4,0x194,{'message':_0xfde7('0x22')});}else{var _0x5a38a8={'payload':{'id':_0x113a1e['id'],'role':_0x113a1e[_0xfde7('0x23')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5a38a8)[_0xfde7('0x11')](function(_0x3ee1e4){_0x1190e4['json']({'id':_0x113a1e['id'],'token':_0x3ee1e4,'statusCall':'','isAlreadyLogged':_0x113a1e['online']});});}})(_0x494ab5,_0x1190e4,_0x2a9ea8);};passport[_0xfde7('0x24')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x512dfb,_0xe01162,_0x1ad046){return ActiveDirectoryAuthenticate(db['User'],_0x512dfb,_0xe01162,_0x1ad046);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 15a957e..f15173a 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 _0x90c2=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x90c2,0x131));var _0x290c=function(_0x24ffab,_0x496256){_0x24ffab=_0x24ffab-0x0;var _0x464b68=_0x90c2[_0x24ffab];return _0x464b68;};'use strict';var express=require('express');var router=express[_0x290c('0x0')]();var controller=require(_0x290c('0x1'));router[_0x290c('0x2')]('/',controller[_0x290c('0x3')]);module[_0x290c('0x4')]=router;
\ No newline at end of file
+var _0x508e=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x508e,0x1b8));var _0xe508=function(_0x58c1e0,_0x1b061a){_0x58c1e0=_0x58c1e0-0x0;var _0x5e8e0e=_0x508e[_0x58c1e0];return _0x5e8e0e;};'use strict';var express=require('express');var router=express[_0xe508('0x0')]();var controller=require(_0xe508('0x1'));router[_0xe508('0x2')]('/',controller[_0xe508('0x3')]);module[_0xe508('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 7ddbbdf..e5e90ce 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3ba4ef,_0x2667e9){var _0x35edf9=function(_0x52f6ba){while(--_0x52f6ba){_0x3ba4ef['push'](_0x3ba4ef['shift']());}};_0x35edf9(++_0x2667e9);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x7a54,0x106));var _0x47a5=function(_0x14e3fd,_0x37e13c){_0x14e3fd=_0x14e3fd-0x0;var _0x17befc=_0x7a54[_0x14e3fd];return _0x17befc;};'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 a0d3931..2e749b2 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 _0x2aaa=['../../components/auth/service','login','/callback','isMiddleware','exports','passport','Router','./authGoogle.controller'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x2aaa,0x185));var _0xa2aa=function(_0x4b91e5,_0x44b343){_0x4b91e5=_0x4b91e5-0x0;var _0xc57634=_0x2aaa[_0x4b91e5];return _0xc57634;};'use strict';var express=require('express');var passport=require(_0xa2aa('0x0'));var router=express[_0xa2aa('0x1')]();var controller=require(_0xa2aa('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xa2aa('0x3'));router['get']('/',controller[_0xa2aa('0x4')]);router['get'](_0xa2aa('0x5'),controller['callback'],authService[_0xa2aa('0x6')],userController['login'],authService['setTokenCookie']);module[_0xa2aa('0x7')]=router;
\ No newline at end of file
+var _0x20c0=['isMiddleware','login','passport','Router','../user/user.controller.js','../../components/auth/service','get','/callback','callback'];(function(_0x4c045d,_0x4f2995){var _0x1e381d=function(_0x184d8f){while(--_0x184d8f){_0x4c045d['push'](_0x4c045d['shift']());}};_0x1e381d(++_0x4f2995);}(_0x20c0,0x13d));var _0x020c=function(_0x4e0471,_0x4f1b1c){_0x4e0471=_0x4e0471-0x0;var _0x196d80=_0x20c0[_0x4e0471];return _0x196d80;};'use strict';var express=require('express');var passport=require(_0x020c('0x0'));var router=express[_0x020c('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x020c('0x2'));var authService=require(_0x020c('0x3'));router[_0x020c('0x4')]('/',controller['login']);router['get'](_0x020c('0x5'),controller[_0x020c('0x6')],authService[_0x020c('0x7')],userController[_0x020c('0x8')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 2ab6099..9f66c43 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 _0x6a8b=['online','forgot','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','Password\x20reset!','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','blockDuration','findOne','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x105659,_0x523ac9){var _0xd390c2=function(_0x3bc15e){while(--_0x3bc15e){_0x105659['push'](_0x105659['shift']());}};_0xd390c2(++_0x523ac9);}(_0x6a8b,0x71));var _0xb6a8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6a8b[_0x3ab51d];return _0x29a04e;};'use strict';var util=require('util');var passport=require(_0xb6a8('0x0'));var LocalStrategy=require(_0xb6a8('0x1'))[_0xb6a8('0x2')];var jayson=require(_0xb6a8('0x3'));var _=require(_0xb6a8('0x4'));var rs=require(_0xb6a8('0x5'));var moment=require(_0xb6a8('0x6'));var db=require(_0xb6a8('0x7'))['db'];var authService=require(_0xb6a8('0x8'));var utils=require('../../config/utils');var client=jayson[_0xb6a8('0x9')][_0xb6a8('0xa')]({'port':0x232b});function localAuthenticate(_0x1c7e53,_0xbc33be,_0x7bed0,_0xd18f5c){var _0x13c818,_0x13a5f8;return db[_0xb6a8('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xb6a8('0xc'),_0xb6a8('0xd')],'raw':!![]})['then'](function(_0x558413){_0x13c818=_0x558413;return _0x1c7e53[_0xb6a8('0xe')]({'attributes':['id','name',_0xb6a8('0xf'),_0xb6a8('0x10'),_0xb6a8('0x11'),_0xb6a8('0x12'),_0xb6a8('0x13'),_0xb6a8('0x14'),_0xb6a8('0x15')],'where':{'name':_0xbc33be,'role':{'$or':[_0xb6a8('0x16'),_0xb6a8('0x17'),_0xb6a8('0x18')]}}});})[_0xb6a8('0x19')](function(_0x2d7d5b){if(!_0x2d7d5b||_0x2d7d5b&&_0x2d7d5b[_0xb6a8('0x1a')]!==_0xbc33be){throw new Error(_0xb6a8('0x1b'));}else{_0x13a5f8=_0x2d7d5b;return _0x13a5f8;}})[_0xb6a8('0x19')](function(){_0x13a5f8[_0xb6a8('0x1c')](_0x7bed0,function(_0x1094a6,_0x4c18aa){var _0x1e2cad=_0x13a5f8['loginAttempts']+0x1;if(_0x1094a6){return _0xd18f5c(_0x1094a6);}else if(!_0x4c18aa){if(_0x13a5f8[_0xb6a8('0x12')]){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}else if(_0x13c818[_0xb6a8('0xc')]>0x0){if(_0x13a5f8[_0xb6a8('0x13')]){if(_0x13c818[_0xb6a8('0xd')]>0x0){if(moment(_0x13a5f8[_0xb6a8('0x14')])[_0xb6a8('0x1d')](_0x13c818[_0xb6a8('0xd')],_0xb6a8('0x1e'))>moment()){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}else{return utils['clearBlockUser'](_0x13a5f8,_0x1e2cad,![],null)[_0xb6a8('0x19')](function(){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});});}}else{return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}}else{if(_0x1e2cad>=_0x13c818['allowedLoginAttempts']){return utils[_0xb6a8('0x1f')](_0x13a5f8,0x0,!![],moment())[_0xb6a8('0x19')](function(){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});});}else{return utils[_0xb6a8('0x1f')](_0x13a5f8,_0x1e2cad,![],null)[_0xb6a8('0x19')](function(){return _0xd18f5c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0xd18f5c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x13a5f8[_0xb6a8('0x12')]){return _0xd18f5c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x13c818['allowedLoginAttempts']>0x0){if(_0x13a5f8[_0xb6a8('0x13')]){if(_0x13c818[_0xb6a8('0xd')]>0x0){if(moment(_0x13a5f8['blockedAt'])['add'](_0x13c818[_0xb6a8('0xd')],_0xb6a8('0x1e'))>moment()){return _0xd18f5c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xb6a8('0x1f')](_0x13a5f8,0x0,![],null)[_0xb6a8('0x19')](function(){return utils[_0xb6a8('0x20')](_0x13a5f8);})[_0xb6a8('0x19')](function(){return _0xd18f5c(null,_0x13a5f8);});}}else{return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}}else{return utils[_0xb6a8('0x1f')](_0x13a5f8,0x0,![],null)[_0xb6a8('0x19')](function(){return utils[_0xb6a8('0x20')](_0x13a5f8);})[_0xb6a8('0x19')](function(){return _0xd18f5c(null,_0x13a5f8);})[_0xb6a8('0x21')](function(_0x5a439b){return _0xd18f5c(null,![],_0x5a439b);});}}else{if(_0x13a5f8[_0xb6a8('0x13')]){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}else{return utils[_0xb6a8('0x20')](_0x13a5f8)[_0xb6a8('0x19')](function(){return _0xd18f5c(null,_0x13a5f8);});}}}});})[_0xb6a8('0x21')](function(_0x6a8f20){return _0xd18f5c(null,![],_0x6a8f20);});}function sendServiceMail(_0x19a257){return db[_0xb6a8('0x22')][_0xb6a8('0x23')]({'where':{'service':!![]},'attributes':['id',_0xb6a8('0x1a'),_0xb6a8('0x24')],'include':[{'model':db[_0xb6a8('0x25')],'as':_0xb6a8('0x26'),'include':[{'model':db[_0xb6a8('0x27')],'as':'CloudProvider'}]}]})[_0xb6a8('0x19')](function(_0xa53b6b){if(!_0xa53b6b){throw new Error(_0xb6a8('0x28'));}var _0x4195b9=_0xa53b6b['getSmtpOptions']();var _0x2f3968={'account':_0x4195b9,'message':_[_0xb6a8('0x29')]({'from':util['format'](_0xb6a8('0x2a'),_0xa53b6b[_0xb6a8('0x1a')],_0xa53b6b[_0xb6a8('0x24')]||_0xa53b6b['Smtp'][_0xb6a8('0x17')])},_0x19a257)};return client[_0xb6a8('0x2b')](_0xb6a8('0x2c'),_0x2f3968);})[_0xb6a8('0x19')](function(_0x49500f){if(_0x49500f[_0xb6a8('0x2d')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x49500f[_0xb6a8('0x2d')][_0xb6a8('0x2e')]||JSON[_0xb6a8('0x2f')](_0x49500f[_0xb6a8('0x2d')])));}return!![];});}function handleError(_0x524b3c,_0x18cc00,_0x313aff){return _0x524b3c[_0xb6a8('0x30')](_0x18cc00||0x1f4)[_0xb6a8('0x31')]({'message':_0x313aff?_0x313aff[_0xb6a8('0x2e')]||_0x313aff:''});}exports[_0xb6a8('0x32')]=function(_0x2bea98,_0x21c767,_0x92fd99){passport[_0xb6a8('0x1c')](_0xb6a8('0x33'),function(_0x2461c8,_0x3b7fc3,_0x41d2f0){var _0x3c7bf4=_0x2461c8||_0x41d2f0;if(_0x3c7bf4){return handleError(_0x21c767,0x191,_0x3c7bf4);}if(!_0x3b7fc3){return handleError(_0x21c767,0x194,{'message':_0xb6a8('0x34')});}else{var _0x963022={'payload':{'id':_0x3b7fc3['id'],'role':_0x3b7fc3['role']},'options':{'expiresIn':0x15180}};return authService[_0xb6a8('0x35')](_0x963022)[_0xb6a8('0x19')](function(_0x17d3ef){_0x21c767[_0xb6a8('0x36')]({'id':_0x3b7fc3['id'],'token':_0x17d3ef,'statusCall':'','isAlreadyLogged':_0x3b7fc3[_0xb6a8('0x37')]});});}})(_0x2bea98,_0x21c767,_0x92fd99);};exports[_0xb6a8('0x38')]=function(_0xb91cb7,_0x556ff2){if(!_0xb91cb7['body'][_0xb6a8('0x24')]){return handleError(_0x556ff2,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x57e9b2=rs['generate']();_0xb91cb7[_0xb6a8('0x39')][_0xb6a8('0x24')]=_0xb91cb7[_0xb6a8('0x39')]['email'][_0xb6a8('0x3a')]()[_0xb6a8('0x3b')]();var _0x4db719;return db[_0xb6a8('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xb6a8('0xc'),_0xb6a8('0xd')],'raw':!![]})['then'](function(_0x15b892){_0x4db719=_0x15b892;return db[_0xb6a8('0x3c')][_0xb6a8('0x23')]({'where':{'email':_0xb91cb7['body'][_0xb6a8('0x24')]}});})[_0xb6a8('0x19')](function(_0x4ce91a){if(!_0x4ce91a){throw new Error(_0xb6a8('0x3d'));}if(_0x4ce91a[_0xb6a8('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4ce91a[_0xb6a8('0x13')]){if(moment(_0x4ce91a[_0xb6a8('0x14')])['add'](_0x4db719['blockDuration'],_0xb6a8('0x1e'))>moment()){throw new Error(_0xb6a8('0x3e'));}else{_0x4ce91a[_0xb6a8('0x13')]=![];_0x4ce91a['blockedAt']=null;}}_0x4ce91a[_0xb6a8('0x3f')]=_0x57e9b2;_0x4ce91a[_0xb6a8('0x40')]=Date[_0xb6a8('0x41')]()+0x36ee80;return _0x4ce91a[_0xb6a8('0x42')]();})[_0xb6a8('0x19')](function(){return sendServiceMail({'to':_0xb91cb7[_0xb6a8('0x39')][_0xb6a8('0x24')],'subject':_0xb6a8('0x43'),'text':_0xb6a8('0x44')+_0xb6a8('0x45')+_0xb6a8('0x46')+_0xb91cb7['headers'][_0xb6a8('0x47')]+_0xb6a8('0x48')+_0x57e9b2+'\x0a\x0a'+_0xb6a8('0x49')});})[_0xb6a8('0x19')](function(){_0x556ff2[_0xb6a8('0x30')](0xc8)[_0xb6a8('0x31')]({'message':'Reset\x20Email\x20sent!'});})[_0xb6a8('0x21')](function(_0x291bdd){return handleError(_0x556ff2,0x1f4,_0x291bdd);});};exports[_0xb6a8('0x4a')]=function(_0x84851c,_0x30e64a){return db['User'][_0xb6a8('0x23')]({'where':{'resetPasswordToken':_0x84851c[_0xb6a8('0x4b')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x34f827){if(!_0x34f827){throw new Error(_0xb6a8('0x4c'));}return db['Setting'][_0xb6a8('0xe')]({'attributes':['id',_0xb6a8('0x4d'),'enforcePasswordHistory',_0xb6a8('0x4e')]})[_0xb6a8('0x19')](function(_0x3583ac){if(_0x3583ac[_0xb6a8('0x4d')])authService[_0xb6a8('0x4f')](_0x84851c[_0xb6a8('0x39')][_0xb6a8('0xf')]);if(!_0x3583ac[_0xb6a8('0x50')]||!_0x34f827['previousPasswords'])return _0x34f827;authService[_0xb6a8('0x51')](_0x84851c[_0xb6a8('0x39')][_0xb6a8('0xf')],_0x34f827[_0xb6a8('0x52')],_0x3583ac['passwordHistoryLimit']);return _0x34f827;})[_0xb6a8('0x19')](function(){_0x34f827[_0xb6a8('0xf')]=_0x84851c[_0xb6a8('0x39')][_0xb6a8('0xf')];_0x34f827[_0xb6a8('0x3f')]=null;_0x34f827[_0xb6a8('0x40')]=null;return _0x34f827[_0xb6a8('0x42')]();});})['then'](function(){_0x30e64a[_0xb6a8('0x30')](0xc8)[_0xb6a8('0x31')]({'message':_0xb6a8('0x53')});})['catch'](function(_0x387a5d){return handleError(_0x30e64a,0x1f4,_0x387a5d);});};passport['use'](_0xb6a8('0x33'),new LocalStrategy({'usernameField':_0xb6a8('0x1a'),'passwordField':_0xb6a8('0xf')},function(_0x2759c4,_0xaf6ee2,_0x559d69){return localAuthenticate(db['User'],_0x2759c4,_0xaf6ee2,_0x559d69);}));
\ No newline at end of file
+var _0x96f3=['admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','add','clearBlockUser','blockedAt','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','email','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','send','login','signToken','json','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','Password\x20reset!','use','local-login','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','loginAttempts'];(function(_0x2dc9b7,_0x45bf6f){var _0x5da719=function(_0x2930de){while(--_0x2930de){_0x2dc9b7['push'](_0x2dc9b7['shift']());}};_0x5da719(++_0x45bf6f);}(_0x96f3,0x8d));var _0x396f=function(_0x417059,_0x49da59){_0x417059=_0x417059-0x0;var _0x429c7b=_0x96f3[_0x417059];return _0x429c7b;};'use strict';var util=require(_0x396f('0x0'));var passport=require(_0x396f('0x1'));var LocalStrategy=require(_0x396f('0x2'))[_0x396f('0x3')];var jayson=require(_0x396f('0x4'));var _=require(_0x396f('0x5'));var rs=require('randomstring');var moment=require(_0x396f('0x6'));var db=require(_0x396f('0x7'))['db'];var authService=require(_0x396f('0x8'));var utils=require(_0x396f('0x9'));var client=jayson[_0x396f('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x50c466,_0x1c6467,_0x2d2806,_0x1503ad){var _0x596f76,_0x55045e;return db[_0x396f('0xb')][_0x396f('0xc')]({'where':{'id':0x1},'attributes':[_0x396f('0xd'),_0x396f('0xe')],'raw':!![]})[_0x396f('0xf')](function(_0x48ac72){_0x596f76=_0x48ac72;return _0x50c466[_0x396f('0xc')]({'attributes':['id',_0x396f('0x10'),_0x396f('0x11'),_0x396f('0x12'),_0x396f('0x13'),'disabled','blocked','blockedAt',_0x396f('0x14')],'where':{'name':_0x1c6467,'role':{'$or':[_0x396f('0x15'),_0x396f('0x16'),_0x396f('0x17')]}}});})[_0x396f('0xf')](function(_0x5a58e7){if(!_0x5a58e7||_0x5a58e7&&_0x5a58e7[_0x396f('0x10')]!==_0x1c6467){throw new Error(_0x396f('0x18'));}else{_0x55045e=_0x5a58e7;return _0x55045e;}})[_0x396f('0xf')](function(){_0x55045e[_0x396f('0x19')](_0x2d2806,function(_0x18d37f,_0x433aec){var _0x39306e=_0x55045e[_0x396f('0x14')]+0x1;if(_0x18d37f){return _0x1503ad(_0x18d37f);}else if(!_0x433aec){if(_0x55045e[_0x396f('0x1a')]){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else if(_0x596f76[_0x396f('0xd')]>0x0){if(_0x55045e[_0x396f('0x1b')]){if(_0x596f76['blockDuration']>0x0){if(moment(_0x55045e['blockedAt'])[_0x396f('0x1c')](_0x596f76[_0x396f('0xe')],'minutes')>moment()){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else{return utils[_0x396f('0x1d')](_0x55045e,_0x39306e,![],null)['then'](function(){return _0x1503ad(null,![],{'message':_0x396f('0x18')});});}}else{return _0x1503ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x39306e>=_0x596f76[_0x396f('0xd')]){return utils[_0x396f('0x1d')](_0x55045e,0x0,!![],moment())[_0x396f('0xf')](function(){return _0x1503ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x396f('0x1d')](_0x55045e,_0x39306e,![],null)[_0x396f('0xf')](function(){return _0x1503ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1503ad(null,![],{'message':_0x396f('0x18')});}}else{if(_0x55045e[_0x396f('0x1a')]){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else if(_0x596f76[_0x396f('0xd')]>0x0){if(_0x55045e[_0x396f('0x1b')]){if(_0x596f76[_0x396f('0xe')]>0x0){if(moment(_0x55045e[_0x396f('0x1e')])[_0x396f('0x1c')](_0x596f76[_0x396f('0xe')],_0x396f('0x1f'))>moment()){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else{return utils[_0x396f('0x1d')](_0x55045e,0x0,![],null)[_0x396f('0xf')](function(){return utils[_0x396f('0x20')](_0x55045e);})[_0x396f('0xf')](function(){return _0x1503ad(null,_0x55045e);});}}else{return _0x1503ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x396f('0x1d')](_0x55045e,0x0,![],null)[_0x396f('0xf')](function(){return utils[_0x396f('0x20')](_0x55045e);})[_0x396f('0xf')](function(){return _0x1503ad(null,_0x55045e);})['catch'](function(_0x5d6c20){return _0x1503ad(null,![],_0x5d6c20);});}}else{if(_0x55045e[_0x396f('0x1b')]){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else{return utils[_0x396f('0x20')](_0x55045e)['then'](function(){return _0x1503ad(null,_0x55045e);});}}}});})[_0x396f('0x21')](function(_0x127556){return _0x1503ad(null,![],_0x127556);});}function sendServiceMail(_0x5436b8){return db[_0x396f('0x22')][_0x396f('0x23')]({'where':{'service':!![]},'attributes':['id',_0x396f('0x10'),'email'],'include':[{'model':db[_0x396f('0x24')],'as':_0x396f('0x25'),'include':[{'model':db[_0x396f('0x26')],'as':'CloudProvider'}]}]})['then'](function(_0x47c538){if(!_0x47c538){throw new Error(_0x396f('0x27'));}var _0xd84683=_0x47c538['getSmtpOptions']();var _0x5531b7={'account':_0xd84683,'message':_['merge']({'from':util['format']('\x22%s\x22\x20<%s>',_0x47c538[_0x396f('0x10')],_0x47c538[_0x396f('0x28')]||_0x47c538[_0x396f('0x25')][_0x396f('0x16')])},_0x5436b8)};return client[_0x396f('0x29')](_0x396f('0x2a'),_0x5531b7);})[_0x396f('0xf')](function(_0x572754){if(_0x572754['error']){throw new Error(util[_0x396f('0x2b')](_0x396f('0x2c'),_0x572754[_0x396f('0x2d')][_0x396f('0x2e')]||JSON['stringify'](_0x572754[_0x396f('0x2d')])));}return!![];});}function handleError(_0xff8628,_0x591482,_0xc20eac){return _0xff8628[_0x396f('0x2f')](_0x591482||0x1f4)[_0x396f('0x30')]({'message':_0xc20eac?_0xc20eac[_0x396f('0x2e')]||_0xc20eac:''});}exports[_0x396f('0x31')]=function(_0x5038e3,_0x104e48,_0x15e330){passport[_0x396f('0x19')]('local-login',function(_0x4522e8,_0x136e4d,_0x9045b1){var _0x4ef281=_0x4522e8||_0x9045b1;if(_0x4ef281){return handleError(_0x104e48,0x191,_0x4ef281);}if(!_0x136e4d){return handleError(_0x104e48,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x232b26={'payload':{'id':_0x136e4d['id'],'role':_0x136e4d[_0x396f('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x396f('0x32')](_0x232b26)[_0x396f('0xf')](function(_0xefc881){_0x104e48[_0x396f('0x33')]({'id':_0x136e4d['id'],'token':_0xefc881,'statusCall':'','isAlreadyLogged':_0x136e4d['online']});});}})(_0x5038e3,_0x104e48,_0x15e330);};exports['forgot']=function(_0x4e7f3b,_0x100f8e){if(!_0x4e7f3b['body'][_0x396f('0x28')]){return handleError(_0x100f8e,0x1f4,{'message':_0x396f('0x34')});}var _0x28f64e=rs[_0x396f('0x35')]();_0x4e7f3b['body'][_0x396f('0x28')]=_0x4e7f3b[_0x396f('0x36')]['email'][_0x396f('0x37')]()[_0x396f('0x38')]();var _0x19a69e;return db['Setting'][_0x396f('0xc')]({'where':{'id':0x1},'attributes':[_0x396f('0xd'),'blockDuration'],'raw':!![]})[_0x396f('0xf')](function(_0xbf97ae){_0x19a69e=_0xbf97ae;return db[_0x396f('0x39')][_0x396f('0x23')]({'where':{'email':_0x4e7f3b[_0x396f('0x36')]['email']}});})[_0x396f('0xf')](function(_0x42ce47){if(!_0x42ce47){throw new Error(_0x396f('0x3a'));}if(_0x42ce47['disabled']){throw new Error(_0x396f('0x3b'));}if(_0x42ce47['blocked']){if(moment(_0x42ce47[_0x396f('0x1e')])[_0x396f('0x1c')](_0x19a69e['blockDuration'],_0x396f('0x1f'))>moment()){throw new Error(_0x396f('0x3c'));}else{_0x42ce47[_0x396f('0x1b')]=![];_0x42ce47['blockedAt']=null;}}_0x42ce47['resetPasswordToken']=_0x28f64e;_0x42ce47[_0x396f('0x3d')]=Date[_0x396f('0x3e')]()+0x36ee80;return _0x42ce47[_0x396f('0x3f')]();})[_0x396f('0xf')](function(){return sendServiceMail({'to':_0x4e7f3b[_0x396f('0x36')][_0x396f('0x28')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x396f('0x40')+'https://'+_0x4e7f3b[_0x396f('0x41')]['host']+_0x396f('0x42')+_0x28f64e+'\x0a\x0a'+_0x396f('0x43')});})[_0x396f('0xf')](function(){_0x100f8e[_0x396f('0x2f')](0xc8)['send']({'message':_0x396f('0x44')});})[_0x396f('0x21')](function(_0x2414cc){return handleError(_0x100f8e,0x1f4,_0x2414cc);});};exports['reset']=function(_0x553b89,_0x18ae92){return db[_0x396f('0x39')][_0x396f('0x23')]({'where':{'resetPasswordToken':_0x553b89[_0x396f('0x45')][_0x396f('0x46')],'resetPasswordExpires':{'$gt':Date[_0x396f('0x3e')]()}}})[_0x396f('0xf')](function(_0x39395b){if(!_0x39395b){throw new Error(_0x396f('0x47'));}return db['Setting'][_0x396f('0xc')]({'attributes':['id',_0x396f('0x48'),'enforcePasswordHistory',_0x396f('0x49')]})[_0x396f('0xf')](function(_0x4f79db){if(_0x4f79db[_0x396f('0x48')])authService[_0x396f('0x4a')](_0x553b89[_0x396f('0x36')][_0x396f('0x11')]);if(!_0x4f79db[_0x396f('0x4b')]||!_0x39395b['previousPasswords'])return _0x39395b;authService[_0x396f('0x4c')](_0x553b89[_0x396f('0x36')][_0x396f('0x11')],_0x39395b[_0x396f('0x4d')],_0x4f79db[_0x396f('0x49')]);return _0x39395b;})[_0x396f('0xf')](function(){_0x39395b['password']=_0x553b89['body'][_0x396f('0x11')];_0x39395b['resetPasswordToken']=null;_0x39395b['resetPasswordExpires']=null;return _0x39395b[_0x396f('0x3f')]();});})[_0x396f('0xf')](function(){_0x18ae92[_0x396f('0x2f')](0xc8)[_0x396f('0x30')]({'message':_0x396f('0x4e')});})[_0x396f('0x21')](function(_0x1d9a54){return handleError(_0x18ae92,0x1f4,_0x1d9a54);});};passport[_0x396f('0x4f')](_0x396f('0x50'),new LocalStrategy({'usernameField':_0x396f('0x10'),'passwordField':'password'},function(_0x37a3ce,_0x31117c,_0x4d89d8){return localAuthenticate(db['User'],_0x37a3ce,_0x31117c,_0x4d89d8);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index acefc6b..8a12e60 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 _0x10b7=['/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller','post','login'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x10b7,0x67));var _0x710b=function(_0x4a19f7,_0x34f60a){_0x4a19f7=_0x4a19f7-0x0;var _0x11372a=_0x10b7[_0x4a19f7];return _0x11372a;};'use strict';var express=require(_0x710b('0x0'));var router=express[_0x710b('0x1')]();var controller=require(_0x710b('0x2'));router[_0x710b('0x3')]('/',controller[_0x710b('0x4')]);router[_0x710b('0x3')](_0x710b('0x5'),controller[_0x710b('0x6')]);router[_0x710b('0x3')](_0x710b('0x7'),controller['reset']);module[_0x710b('0x8')]=router;
\ No newline at end of file
+var _0xc703=['Router','post','login','forgot','/reset/:token','exports','express'];(function(_0x104be8,_0x51a270){var _0x49b8cf=function(_0x21ee42){while(--_0x21ee42){_0x104be8['push'](_0x104be8['shift']());}};_0x49b8cf(++_0x51a270);}(_0xc703,0x1f0));var _0x3c70=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc703[_0x4a9fb1];return _0x348672;};'use strict';var express=require(_0x3c70('0x0'));var router=express[_0x3c70('0x1')]();var controller=require('./authLocal.controller');router[_0x3c70('0x2')]('/',controller[_0x3c70('0x3')]);router['post']('/forgot',controller[_0x3c70('0x4')]);router[_0x3c70('0x2')](_0x3c70('0x5'),controller['reset']);module[_0x3c70('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 7816df6..70f3e36 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 _0x2f6e=['STRING','INTEGER','exports'];(function(_0x2c9fd9,_0x1984d0){var _0x4727e1=function(_0x1f0e27){while(--_0x1f0e27){_0x2c9fd9['push'](_0x2c9fd9['shift']());}};_0x4727e1(++_0x1984d0);}(_0x2f6e,0xec));var _0xe2f6=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2f6e[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0xe2f6('0x0')]={'name':{'type':Sequelize[_0xe2f6('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe2f6('0x1')]},'description':{'type':Sequelize[_0xe2f6('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe2f6('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa025=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x145e87,_0x244827){var _0xbdddad=function(_0x106153){while(--_0x106153){_0x145e87['push'](_0x145e87['shift']());}};_0xbdddad(++_0x244827);}(_0xa025,0x9c));var _0x5a02=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0xa025[_0x540133];return _0x26b6e9;};'use strict';var Sequelize=require(_0x5a02('0x0'));module[_0x5a02('0x1')]={'name':{'type':Sequelize[_0x5a02('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5a02('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5a02('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 3c4aebe..9231a3d 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 _0x101d=['rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','then','error','stack','name','send','index','Automation','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','keys','create','body','find','Condition','ids','omit','getConditions','findOne','addActions','getActions','Action','eml-format'];(function(_0x190572,_0x130dbc){var _0x281dab=function(_0x3bdeb3){while(--_0x3bdeb3){_0x190572['push'](_0x190572['shift']());}};_0x281dab(++_0x130dbc);}(_0x101d,0xec));var _0xd101=function(_0x222054,_0x45620f){_0x222054=_0x222054-0x0;var _0x5de492=_0x101d[_0x222054];return _0x5de492;};'use strict';var emlformat=require(_0xd101('0x0'));var rimraf=require(_0xd101('0x1'));var zipdir=require(_0xd101('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd101('0x3'));var moment=require(_0xd101('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd101('0x5'));var util=require(_0xd101('0x6'));var path=require(_0xd101('0x7'));var sox=require('sox');var csv=require(_0xd101('0x8'));var ejs=require(_0xd101('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd101('0xa'));var squel=require(_0xd101('0xb'));var crypto=require('crypto');var jsforce=require(_0xd101('0xc'));var deskjs=require(_0xd101('0xd'));var toCsv=require(_0xd101('0x8'));var querystring=require(_0xd101('0xe'));var Papa=require(_0xd101('0xf'));var Redis=require(_0xd101('0x10'));var authService=require(_0xd101('0x11'));var qs=require(_0xd101('0x12'));var as=require(_0xd101('0x13'));var hardwareService=require(_0xd101('0x14'));var logger=require(_0xd101('0x15'))(_0xd101('0x16'));var utils=require(_0xd101('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd101('0x18'));var db=require(_0xd101('0x19'))['db'];function respondWithStatusCode(_0x5b7111,_0x97b42e){_0x97b42e=_0x97b42e||0xcc;return function(_0x34e5fb){if(_0x34e5fb){return _0x5b7111[_0xd101('0x1a')](_0x97b42e);}return _0x5b7111[_0xd101('0x1b')](_0x97b42e)[_0xd101('0x1c')]();};}function respondWithResult(_0x52d73c,_0x32ef53){_0x32ef53=_0x32ef53||0xc8;return function(_0x284ac2){if(_0x284ac2){return _0x52d73c[_0xd101('0x1b')](_0x32ef53)[_0xd101('0x1d')](_0x284ac2);}};}function respondWithFilteredResult(_0x270453,_0x27b159){return function(_0x174664){if(_0x174664){var _0x26666c=typeof _0x27b159['offset']==='undefined'&&typeof _0x27b159['limit']==='undefined';var _0x214ebb=_0x174664[_0xd101('0x1e')];var _0x5169d5=_0x26666c?0x0:_0x27b159['offset'];var _0x5660c7=_0x26666c?_0x174664[_0xd101('0x1e')]:_0x27b159[_0xd101('0x1f')]+_0x27b159[_0xd101('0x20')];var _0xc40af6;if(_0x5660c7>=_0x214ebb){_0x5660c7=_0x214ebb;_0xc40af6=0xc8;}else{_0xc40af6=0xce;}_0x270453['status'](_0xc40af6);return _0x270453[_0xd101('0x21')](_0xd101('0x22'),_0x5169d5+'-'+_0x5660c7+'/'+_0x214ebb)[_0xd101('0x1d')](_0x174664);}return null;};}function patchUpdates(_0x42c82f){return function(_0x3503ba){try{jsonpatch['apply'](_0x3503ba,_0x42c82f,!![]);}catch(_0x370727){return BPromise['reject'](_0x370727);}return _0x3503ba[_0xd101('0x23')]();};}function saveUpdates(_0x15eac0,_0x388fae){return function(_0x334fc7){if(_0x334fc7){return _0x334fc7['update'](_0x15eac0)[_0xd101('0x24')](function(_0x572d68){return _0x572d68;});}return null;};}function removeEntity(_0x4f9eee,_0x4803cb){return function(_0x575af7){if(_0x575af7){return _0x575af7['destroy']()['then'](function(){_0x4f9eee[_0xd101('0x1b')](0xcc)[_0xd101('0x1c')]();});}};}function handleEntityNotFound(_0x468e19,_0x292abf){return function(_0x78d669){if(!_0x78d669){_0x468e19[_0xd101('0x1a')](0x194);}return _0x78d669;};}function handleError(_0xb7db9b,_0x4b9520){_0x4b9520=_0x4b9520||0x1f4;return function(_0x46e94a){logger[_0xd101('0x25')](_0x46e94a[_0xd101('0x26')]);if(_0x46e94a[_0xd101('0x27')]){delete _0x46e94a[_0xd101('0x27')];}_0xb7db9b[_0xd101('0x1b')](_0x4b9520)[_0xd101('0x28')](_0x46e94a);};}exports[_0xd101('0x29')]=function(_0x4674e2,_0x61f8ac){var _0x199526={},_0x5a94fd={},_0x9e178e={'count':0x0,'rows':[]};var _0x361d49=_['map'](db[_0xd101('0x2a')][_0xd101('0x2b')],function(_0x40b3c4){return{'name':_0x40b3c4['fieldName'],'type':_0x40b3c4[_0xd101('0x2c')]['key']};});_0x5a94fd[_0xd101('0x2d')]=_['map'](_0x361d49,'name');_0x5a94fd['query']=_['keys'](_0x4674e2[_0xd101('0x2e')]);_0x5a94fd[_0xd101('0x2f')]=_[_0xd101('0x30')](_0x5a94fd[_0xd101('0x2d')],_0x5a94fd[_0xd101('0x2e')]);_0x199526['attributes']=_[_0xd101('0x30')](_0x5a94fd[_0xd101('0x2d')],qs[_0xd101('0x31')](_0x4674e2[_0xd101('0x2e')][_0xd101('0x31')]));_0x199526[_0xd101('0x32')]=_0x199526['attributes'][_0xd101('0x33')]?_0x199526[_0xd101('0x32')]:_0x5a94fd[_0xd101('0x2d')];if(!_0x4674e2[_0xd101('0x2e')][_0xd101('0x34')]('nolimit')){_0x199526['limit']=qs[_0xd101('0x20')](_0x4674e2[_0xd101('0x2e')][_0xd101('0x20')]);_0x199526[_0xd101('0x1f')]=qs[_0xd101('0x1f')](_0x4674e2[_0xd101('0x2e')]['offset']);}_0x199526[_0xd101('0x35')]=qs[_0xd101('0x36')](_0x4674e2[_0xd101('0x2e')]['sort']);_0x199526[_0xd101('0x37')]=qs[_0xd101('0x2f')](_[_0xd101('0x38')](_0x4674e2[_0xd101('0x2e')],_0x5a94fd[_0xd101('0x2f')]),_0x361d49);if(_0x4674e2[_0xd101('0x2e')][_0xd101('0x39')]){_0x199526[_0xd101('0x37')]=_[_0xd101('0x3a')](_0x199526['where'],{'$or':_[_0xd101('0x3b')](_0x361d49,function(_0x3d0d2f){if(_0x3d0d2f['type']!=='VIRTUAL'){var _0x4f5f7b={};_0x4f5f7b[_0x3d0d2f[_0xd101('0x27')]]={'$like':'%'+_0x4674e2['query'][_0xd101('0x39')]+'%'};return _0x4f5f7b;}})});}_0x199526=_['merge']({},_0x199526,_0x4674e2[_0xd101('0x3c')]);var _0x5188b2={'where':_0x199526['where']};return db[_0xd101('0x2a')]['count'](_0x5188b2)[_0xd101('0x24')](function(_0x29dccc){_0x9e178e[_0xd101('0x1e')]=_0x29dccc;if(_0x4674e2[_0xd101('0x2e')][_0xd101('0x3d')]){_0x199526[_0xd101('0x3e')]=[{'all':!![]}];}return db[_0xd101('0x2a')][_0xd101('0x3f')](_0x199526);})['then'](function(_0x59368f){_0x9e178e['rows']=_0x59368f;return _0x9e178e;})[_0xd101('0x24')](respondWithFilteredResult(_0x61f8ac,_0x199526))[_0xd101('0x40')](handleError(_0x61f8ac,null));};exports[_0xd101('0x41')]=function(_0x12b59a,_0x2c2018){var _0x16b778={'raw':![],'where':{'id':_0x12b59a[_0xd101('0x42')]['id']}},_0x22283b={};_0x22283b[_0xd101('0x2d')]=_['keys'](db[_0xd101('0x2a')]['rawAttributes']);_0x22283b[_0xd101('0x2e')]=_[_0xd101('0x43')](_0x12b59a[_0xd101('0x2e')]);_0x22283b['filters']=_[_0xd101('0x30')](_0x22283b['model'],_0x22283b['query']);_0x16b778[_0xd101('0x32')]=_[_0xd101('0x30')](_0x22283b[_0xd101('0x2d')],qs['fields'](_0x12b59a[_0xd101('0x2e')][_0xd101('0x31')]));_0x16b778['attributes']=_0x16b778[_0xd101('0x32')][_0xd101('0x33')]?_0x16b778[_0xd101('0x32')]:_0x22283b[_0xd101('0x2d')];if(_0x12b59a[_0xd101('0x2e')][_0xd101('0x3d')]){_0x16b778[_0xd101('0x3e')]=[{'all':!![]}];}_0x16b778=_[_0xd101('0x3a')]({},_0x16b778,_0x12b59a[_0xd101('0x3c')]);return db['Automation']['find'](_0x16b778)[_0xd101('0x24')](handleEntityNotFound(_0x2c2018,null))[_0xd101('0x24')](respondWithResult(_0x2c2018,null))[_0xd101('0x40')](handleError(_0x2c2018,null));};exports[_0xd101('0x44')]=function(_0x13540a,_0x3eccc7){return db[_0xd101('0x2a')]['create'](_0x13540a[_0xd101('0x45')],{})['then'](respondWithResult(_0x3eccc7,0xc9))[_0xd101('0x40')](handleError(_0x3eccc7,null));};exports['update']=function(_0xbaa1ad,_0x351a08){if(_0xbaa1ad['body']['id']){delete _0xbaa1ad['body']['id'];}return db[_0xd101('0x2a')]['find']({'where':{'id':_0xbaa1ad['params']['id']}})['then'](handleEntityNotFound(_0x351a08,null))[_0xd101('0x24')](saveUpdates(_0xbaa1ad['body'],null))['then'](respondWithResult(_0x351a08,null))[_0xd101('0x40')](handleError(_0x351a08,null));};exports['destroy']=function(_0x5a77d7,_0x2ee277){return db[_0xd101('0x2a')][_0xd101('0x46')]({'where':{'id':_0x5a77d7[_0xd101('0x42')]['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x2ee277,null))[_0xd101('0x24')](removeEntity(_0x2ee277,null))['catch'](handleError(_0x2ee277,null));};exports['addConditions']=function(_0x4ec672,_0x1f925b,_0x206cd8){return db[_0xd101('0x47')][_0xd101('0x46')]({'where':{'id':_0x4ec672[_0xd101('0x42')]['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x1f925b,null))['then'](function(_0x3b43a4){if(_0x3b43a4){return _0x3b43a4['addConditions'](_0x4ec672[_0xd101('0x45')][_0xd101('0x48')],_[_0xd101('0x49')](_0x4ec672[_0xd101('0x45')],[_0xd101('0x48'),'id'])||{});}})[_0xd101('0x24')](respondWithResult(_0x1f925b,null))[_0xd101('0x40')](handleError(_0x1f925b,null));};exports[_0xd101('0x4a')]=function(_0x1eea00,_0x1a0c70,_0x5a7b9a){var _0x23b35d={};var _0x562593={};var _0x230580;var _0x49cf21;return db[_0xd101('0x2a')][_0xd101('0x4b')]({'where':{'id':_0x1eea00[_0xd101('0x42')]['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x1a0c70,null))['then'](function(_0x93f895){if(_0x93f895){_0x230580=_0x93f895;_0x562593['model']=_['keys'](db[_0xd101('0x47')][_0xd101('0x2b')]);_0x562593['query']=_['keys'](_0x1eea00['query']);_0x562593[_0xd101('0x2f')]=_[_0xd101('0x30')](_0x562593['model'],_0x562593[_0xd101('0x2e')]);_0x23b35d[_0xd101('0x32')]=_['intersection'](_0x562593[_0xd101('0x2d')],qs['fields'](_0x1eea00[_0xd101('0x2e')][_0xd101('0x31')]));_0x23b35d['attributes']=_0x23b35d['attributes'][_0xd101('0x33')]?_0x23b35d[_0xd101('0x32')]:_0x562593[_0xd101('0x2d')];_0x23b35d[_0xd101('0x35')]=qs[_0xd101('0x36')](_0x1eea00[_0xd101('0x2e')][_0xd101('0x36')]);_0x23b35d[_0xd101('0x37')]=qs['filters'](_[_0xd101('0x38')](_0x1eea00[_0xd101('0x2e')],_0x562593['filters']));if(_0x1eea00[_0xd101('0x2e')][_0xd101('0x39')]){_0x23b35d['where']=_[_0xd101('0x3a')](_0x23b35d['where'],{'$or':_['map'](_0x23b35d[_0xd101('0x32')],function(_0x317a47){var _0x14f9a1={};_0x14f9a1[_0x317a47]={'$like':'%'+_0x1eea00[_0xd101('0x2e')][_0xd101('0x39')]+'%'};return _0x14f9a1;})});}_0x23b35d=_[_0xd101('0x3a')]({},_0x23b35d,_0x1eea00[_0xd101('0x3c')]);return _0x230580['getConditions'](_0x23b35d);}})[_0xd101('0x24')](function(_0x2e369a){if(_0x2e369a){_0x49cf21=_0x2e369a['length'];if(!_0x1eea00[_0xd101('0x2e')][_0xd101('0x34')]('nolimit')){_0x23b35d[_0xd101('0x20')]=qs[_0xd101('0x20')](_0x1eea00[_0xd101('0x2e')][_0xd101('0x20')]);_0x23b35d['offset']=qs[_0xd101('0x1f')](_0x1eea00[_0xd101('0x2e')][_0xd101('0x1f')]);}return _0x230580[_0xd101('0x4a')](_0x23b35d);}})[_0xd101('0x24')](function(_0x1cc83b){if(_0x1cc83b){return _0x1cc83b?{'count':_0x49cf21,'rows':_0x1cc83b}:null;}})[_0xd101('0x24')](respondWithResult(_0x1a0c70,null))['catch'](handleError(_0x1a0c70,null));};exports['addActions']=function(_0x2ab4e8,_0x5a079d,_0x398bdf){return db['Action'][_0xd101('0x46')]({'where':{'id':_0x2ab4e8['params']['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x5a079d,null))['then'](function(_0x1192f0){if(_0x1192f0){return _0x1192f0[_0xd101('0x4c')](_0x2ab4e8[_0xd101('0x45')][_0xd101('0x48')],_['omit'](_0x2ab4e8[_0xd101('0x45')],[_0xd101('0x48'),'id'])||{});}})['then'](respondWithResult(_0x5a079d,null))[_0xd101('0x40')](handleError(_0x5a079d,null));};exports[_0xd101('0x4d')]=function(_0x258f9b,_0x2f93b9,_0x51c94c){var _0x2f56e4={};var _0x147d5e={};var _0x3dff82;var _0x177fbd;return db[_0xd101('0x2a')]['findOne']({'where':{'id':_0x258f9b[_0xd101('0x42')]['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x2f93b9,null))[_0xd101('0x24')](function(_0x4279e8){if(_0x4279e8){_0x3dff82=_0x4279e8;_0x147d5e[_0xd101('0x2d')]=_[_0xd101('0x43')](db[_0xd101('0x4e')][_0xd101('0x2b')]);_0x147d5e[_0xd101('0x2e')]=_[_0xd101('0x43')](_0x258f9b[_0xd101('0x2e')]);_0x147d5e['filters']=_[_0xd101('0x30')](_0x147d5e[_0xd101('0x2d')],_0x147d5e[_0xd101('0x2e')]);_0x2f56e4[_0xd101('0x32')]=_[_0xd101('0x30')](_0x147d5e[_0xd101('0x2d')],qs[_0xd101('0x31')](_0x258f9b[_0xd101('0x2e')][_0xd101('0x31')]));_0x2f56e4[_0xd101('0x32')]=_0x2f56e4[_0xd101('0x32')][_0xd101('0x33')]?_0x2f56e4['attributes']:_0x147d5e[_0xd101('0x2d')];_0x2f56e4[_0xd101('0x35')]=qs[_0xd101('0x36')](_0x258f9b[_0xd101('0x2e')][_0xd101('0x36')]);_0x2f56e4['where']=qs[_0xd101('0x2f')](_[_0xd101('0x38')](_0x258f9b[_0xd101('0x2e')],_0x147d5e['filters']));if(_0x258f9b[_0xd101('0x2e')][_0xd101('0x39')]){_0x2f56e4[_0xd101('0x37')]=_[_0xd101('0x3a')](_0x2f56e4[_0xd101('0x37')],{'$or':_[_0xd101('0x3b')](_0x2f56e4[_0xd101('0x32')],function(_0x30c8c6){var _0x261dee={};_0x261dee[_0x30c8c6]={'$like':'%'+_0x258f9b[_0xd101('0x2e')][_0xd101('0x39')]+'%'};return _0x261dee;})});}_0x2f56e4=_[_0xd101('0x3a')]({},_0x2f56e4,_0x258f9b['options']);return _0x3dff82[_0xd101('0x4d')](_0x2f56e4);}})[_0xd101('0x24')](function(_0x4a8351){if(_0x4a8351){_0x177fbd=_0x4a8351['length'];if(!_0x258f9b[_0xd101('0x2e')][_0xd101('0x34')]('nolimit')){_0x2f56e4[_0xd101('0x20')]=qs[_0xd101('0x20')](_0x258f9b[_0xd101('0x2e')][_0xd101('0x20')]);_0x2f56e4[_0xd101('0x1f')]=qs[_0xd101('0x1f')](_0x258f9b['query'][_0xd101('0x1f')]);}return _0x3dff82[_0xd101('0x4d')](_0x2f56e4);}})[_0xd101('0x24')](function(_0x2f10a1){if(_0x2f10a1){return _0x2f10a1?{'count':_0x177fbd,'rows':_0x2f10a1}:null;}})[_0xd101('0x24')](respondWithResult(_0x2f93b9,null))[_0xd101('0x40')](handleError(_0x2f93b9,null));};
\ No newline at end of file
+var _0x64e6=['save','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','find','create','update','body','addConditions','Condition','ids','omit','getConditions','order','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0xab8c7f,_0x5f0c5b){var _0x51e138=function(_0x1807f8){while(--_0x1807f8){_0xab8c7f['push'](_0xab8c7f['shift']());}};_0x51e138(++_0x5f0c5b);}(_0x64e6,0xdb));var _0x664e=function(_0x527f7d,_0x1fe947){_0x527f7d=_0x527f7d-0x0;var _0x1127c4=_0x64e6[_0x527f7d];return _0x1127c4;};'use strict';var emlformat=require(_0x664e('0x0'));var rimraf=require(_0x664e('0x1'));var zipdir=require(_0x664e('0x2'));var jsonpatch=require(_0x664e('0x3'));var rp=require(_0x664e('0x4'));var moment=require(_0x664e('0x5'));var BPromise=require(_0x664e('0x6'));var Mustache=require(_0x664e('0x7'));var util=require('util');var path=require(_0x664e('0x8'));var sox=require(_0x664e('0x9'));var csv=require(_0x664e('0xa'));var ejs=require(_0x664e('0xb'));var fs=require('fs');var fs_extra=require(_0x664e('0xc'));var _=require(_0x664e('0xd'));var squel=require('squel');var crypto=require(_0x664e('0xe'));var jsforce=require(_0x664e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x664e('0xa'));var querystring=require('querystring');var Papa=require(_0x664e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x664e('0x11'));var logger=require(_0x664e('0x12'))(_0x664e('0x13'));var utils=require(_0x664e('0x14'));var config=require(_0x664e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x664e('0x16'))['db'];function respondWithStatusCode(_0x1d6cff,_0x34479b){_0x34479b=_0x34479b||0xcc;return function(_0x1d77bc){if(_0x1d77bc){return _0x1d6cff[_0x664e('0x17')](_0x34479b);}return _0x1d6cff[_0x664e('0x18')](_0x34479b)['end']();};}function respondWithResult(_0x27d09e,_0x48cd14){_0x48cd14=_0x48cd14||0xc8;return function(_0x503c3a){if(_0x503c3a){return _0x27d09e[_0x664e('0x18')](_0x48cd14)[_0x664e('0x19')](_0x503c3a);}};}function respondWithFilteredResult(_0x57e5d1,_0x1de99f){return function(_0xbed73b){if(_0xbed73b){var _0x288c9a=typeof _0x1de99f[_0x664e('0x1a')]===_0x664e('0x1b')&&typeof _0x1de99f[_0x664e('0x1c')]===_0x664e('0x1b');var _0x2b85fd=_0xbed73b[_0x664e('0x1d')];var _0x154e44=_0x288c9a?0x0:_0x1de99f[_0x664e('0x1a')];var _0x2803b8=_0x288c9a?_0xbed73b[_0x664e('0x1d')]:_0x1de99f[_0x664e('0x1a')]+_0x1de99f[_0x664e('0x1c')];var _0x455773;if(_0x2803b8>=_0x2b85fd){_0x2803b8=_0x2b85fd;_0x455773=0xc8;}else{_0x455773=0xce;}_0x57e5d1[_0x664e('0x18')](_0x455773);return _0x57e5d1[_0x664e('0x1e')](_0x664e('0x1f'),_0x154e44+'-'+_0x2803b8+'/'+_0x2b85fd)[_0x664e('0x19')](_0xbed73b);}return null;};}function patchUpdates(_0x1df8eb){return function(_0x10036d){try{jsonpatch['apply'](_0x10036d,_0x1df8eb,!![]);}catch(_0x520e37){return BPromise[_0x664e('0x20')](_0x520e37);}return _0x10036d[_0x664e('0x21')]();};}function saveUpdates(_0x32edd9,_0x4b93cf){return function(_0x3d4503){if(_0x3d4503){return _0x3d4503['update'](_0x32edd9)[_0x664e('0x22')](function(_0x30b0d5){return _0x30b0d5;});}return null;};}function removeEntity(_0x5e6f2f,_0x47475a){return function(_0x50bb88){if(_0x50bb88){return _0x50bb88[_0x664e('0x23')]()['then'](function(){_0x5e6f2f[_0x664e('0x18')](0xcc)[_0x664e('0x24')]();});}};}function handleEntityNotFound(_0x5b296c,_0x28110b){return function(_0x1445b2){if(!_0x1445b2){_0x5b296c[_0x664e('0x17')](0x194);}return _0x1445b2;};}function handleError(_0x317a19,_0x56d1c8){_0x56d1c8=_0x56d1c8||0x1f4;return function(_0x4b4f18){logger[_0x664e('0x25')](_0x4b4f18[_0x664e('0x26')]);if(_0x4b4f18[_0x664e('0x27')]){delete _0x4b4f18[_0x664e('0x27')];}_0x317a19['status'](_0x56d1c8)[_0x664e('0x28')](_0x4b4f18);};}exports[_0x664e('0x29')]=function(_0x122781,_0x2e1bb9){var _0x257fb5={},_0xd8e01e={},_0x881c39={'count':0x0,'rows':[]};var _0x488767=_[_0x664e('0x2a')](db[_0x664e('0x2b')][_0x664e('0x2c')],function(_0x99a2f5){return{'name':_0x99a2f5[_0x664e('0x2d')],'type':_0x99a2f5['type'][_0x664e('0x2e')]};});_0xd8e01e['model']=_[_0x664e('0x2a')](_0x488767,_0x664e('0x27'));_0xd8e01e[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x122781[_0x664e('0x2f')]);_0xd8e01e[_0x664e('0x31')]=_[_0x664e('0x32')](_0xd8e01e[_0x664e('0x33')],_0xd8e01e[_0x664e('0x2f')]);_0x257fb5[_0x664e('0x34')]=_[_0x664e('0x32')](_0xd8e01e[_0x664e('0x33')],qs[_0x664e('0x35')](_0x122781[_0x664e('0x2f')][_0x664e('0x35')]));_0x257fb5[_0x664e('0x34')]=_0x257fb5[_0x664e('0x34')][_0x664e('0x36')]?_0x257fb5['attributes']:_0xd8e01e[_0x664e('0x33')];if(!_0x122781[_0x664e('0x2f')][_0x664e('0x37')](_0x664e('0x38'))){_0x257fb5[_0x664e('0x1c')]=qs[_0x664e('0x1c')](_0x122781[_0x664e('0x2f')][_0x664e('0x1c')]);_0x257fb5[_0x664e('0x1a')]=qs[_0x664e('0x1a')](_0x122781['query'][_0x664e('0x1a')]);}_0x257fb5['order']=qs[_0x664e('0x39')](_0x122781['query'][_0x664e('0x39')]);_0x257fb5[_0x664e('0x3a')]=qs[_0x664e('0x31')](_[_0x664e('0x3b')](_0x122781[_0x664e('0x2f')],_0xd8e01e[_0x664e('0x31')]),_0x488767);if(_0x122781[_0x664e('0x2f')]['filter']){_0x257fb5['where']=_['merge'](_0x257fb5[_0x664e('0x3a')],{'$or':_['map'](_0x488767,function(_0x3064b1){if(_0x3064b1[_0x664e('0x3c')]!==_0x664e('0x3d')){var _0x1cb223={};_0x1cb223[_0x3064b1['name']]={'$like':'%'+_0x122781[_0x664e('0x2f')][_0x664e('0x3e')]+'%'};return _0x1cb223;}})});}_0x257fb5=_[_0x664e('0x3f')]({},_0x257fb5,_0x122781[_0x664e('0x40')]);var _0x197272={'where':_0x257fb5['where']};return db[_0x664e('0x2b')][_0x664e('0x1d')](_0x197272)[_0x664e('0x22')](function(_0x2423cf){_0x881c39[_0x664e('0x1d')]=_0x2423cf;if(_0x122781[_0x664e('0x2f')][_0x664e('0x41')]){_0x257fb5[_0x664e('0x42')]=[{'all':!![]}];}return db[_0x664e('0x2b')][_0x664e('0x43')](_0x257fb5);})[_0x664e('0x22')](function(_0x4ec734){_0x881c39['rows']=_0x4ec734;return _0x881c39;})[_0x664e('0x22')](respondWithFilteredResult(_0x2e1bb9,_0x257fb5))[_0x664e('0x44')](handleError(_0x2e1bb9,null));};exports['show']=function(_0x23991e,_0x3b5d6a){var _0x31fd14={'raw':![],'where':{'id':_0x23991e[_0x664e('0x45')]['id']}},_0x3164f6={};_0x3164f6[_0x664e('0x33')]=_[_0x664e('0x30')](db[_0x664e('0x2b')][_0x664e('0x2c')]);_0x3164f6[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x23991e[_0x664e('0x2f')]);_0x3164f6[_0x664e('0x31')]=_[_0x664e('0x32')](_0x3164f6['model'],_0x3164f6['query']);_0x31fd14[_0x664e('0x34')]=_[_0x664e('0x32')](_0x3164f6[_0x664e('0x33')],qs[_0x664e('0x35')](_0x23991e[_0x664e('0x2f')][_0x664e('0x35')]));_0x31fd14[_0x664e('0x34')]=_0x31fd14[_0x664e('0x34')][_0x664e('0x36')]?_0x31fd14[_0x664e('0x34')]:_0x3164f6[_0x664e('0x33')];if(_0x23991e['query']['includeAll']){_0x31fd14[_0x664e('0x42')]=[{'all':!![]}];}_0x31fd14=_[_0x664e('0x3f')]({},_0x31fd14,_0x23991e[_0x664e('0x40')]);return db[_0x664e('0x2b')][_0x664e('0x46')](_0x31fd14)['then'](handleEntityNotFound(_0x3b5d6a,null))['then'](respondWithResult(_0x3b5d6a,null))[_0x664e('0x44')](handleError(_0x3b5d6a,null));};exports[_0x664e('0x47')]=function(_0x112509,_0x3e632f){return db['Automation'][_0x664e('0x47')](_0x112509['body'],{})['then'](respondWithResult(_0x3e632f,0xc9))[_0x664e('0x44')](handleError(_0x3e632f,null));};exports[_0x664e('0x48')]=function(_0x51655d,_0x43a6dd){if(_0x51655d[_0x664e('0x49')]['id']){delete _0x51655d[_0x664e('0x49')]['id'];}return db[_0x664e('0x2b')][_0x664e('0x46')]({'where':{'id':_0x51655d[_0x664e('0x45')]['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x43a6dd,null))['then'](saveUpdates(_0x51655d[_0x664e('0x49')],null))[_0x664e('0x22')](respondWithResult(_0x43a6dd,null))['catch'](handleError(_0x43a6dd,null));};exports[_0x664e('0x23')]=function(_0x3f0544,_0x46111f){return db['Automation'][_0x664e('0x46')]({'where':{'id':_0x3f0544[_0x664e('0x45')]['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x46111f,null))['then'](removeEntity(_0x46111f,null))['catch'](handleError(_0x46111f,null));};exports[_0x664e('0x4a')]=function(_0x5e105c,_0x30db89,_0x15d750){return db[_0x664e('0x4b')]['find']({'where':{'id':_0x5e105c[_0x664e('0x45')]['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x30db89,null))[_0x664e('0x22')](function(_0xccc764){if(_0xccc764){return _0xccc764[_0x664e('0x4a')](_0x5e105c['body'][_0x664e('0x4c')],_[_0x664e('0x4d')](_0x5e105c[_0x664e('0x49')],[_0x664e('0x4c'),'id'])||{});}})[_0x664e('0x22')](respondWithResult(_0x30db89,null))[_0x664e('0x44')](handleError(_0x30db89,null));};exports[_0x664e('0x4e')]=function(_0x2c844b,_0x757554,_0x3dc289){var _0x3792a4={};var _0x3d222d={};var _0x3c02fe;var _0x27331e;return db['Automation']['findOne']({'where':{'id':_0x2c844b['params']['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x757554,null))['then'](function(_0x5e2711){if(_0x5e2711){_0x3c02fe=_0x5e2711;_0x3d222d[_0x664e('0x33')]=_[_0x664e('0x30')](db[_0x664e('0x4b')]['rawAttributes']);_0x3d222d[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x2c844b[_0x664e('0x2f')]);_0x3d222d[_0x664e('0x31')]=_[_0x664e('0x32')](_0x3d222d[_0x664e('0x33')],_0x3d222d[_0x664e('0x2f')]);_0x3792a4[_0x664e('0x34')]=_['intersection'](_0x3d222d[_0x664e('0x33')],qs[_0x664e('0x35')](_0x2c844b[_0x664e('0x2f')][_0x664e('0x35')]));_0x3792a4[_0x664e('0x34')]=_0x3792a4[_0x664e('0x34')][_0x664e('0x36')]?_0x3792a4[_0x664e('0x34')]:_0x3d222d[_0x664e('0x33')];_0x3792a4[_0x664e('0x4f')]=qs[_0x664e('0x39')](_0x2c844b[_0x664e('0x2f')][_0x664e('0x39')]);_0x3792a4[_0x664e('0x3a')]=qs[_0x664e('0x31')](_[_0x664e('0x3b')](_0x2c844b[_0x664e('0x2f')],_0x3d222d['filters']));if(_0x2c844b[_0x664e('0x2f')][_0x664e('0x3e')]){_0x3792a4[_0x664e('0x3a')]=_[_0x664e('0x3f')](_0x3792a4[_0x664e('0x3a')],{'$or':_[_0x664e('0x2a')](_0x3792a4[_0x664e('0x34')],function(_0x31f797){var _0x36ec29={};_0x36ec29[_0x31f797]={'$like':'%'+_0x2c844b[_0x664e('0x2f')][_0x664e('0x3e')]+'%'};return _0x36ec29;})});}_0x3792a4=_['merge']({},_0x3792a4,_0x2c844b[_0x664e('0x40')]);return _0x3c02fe['getConditions'](_0x3792a4);}})[_0x664e('0x22')](function(_0x18d7c5){if(_0x18d7c5){_0x27331e=_0x18d7c5[_0x664e('0x36')];if(!_0x2c844b[_0x664e('0x2f')][_0x664e('0x37')]('nolimit')){_0x3792a4['limit']=qs[_0x664e('0x1c')](_0x2c844b[_0x664e('0x2f')][_0x664e('0x1c')]);_0x3792a4['offset']=qs[_0x664e('0x1a')](_0x2c844b[_0x664e('0x2f')][_0x664e('0x1a')]);}return _0x3c02fe['getConditions'](_0x3792a4);}})[_0x664e('0x22')](function(_0x2775fd){if(_0x2775fd){return _0x2775fd?{'count':_0x27331e,'rows':_0x2775fd}:null;}})[_0x664e('0x22')](respondWithResult(_0x757554,null))[_0x664e('0x44')](handleError(_0x757554,null));};exports[_0x664e('0x50')]=function(_0x3e6722,_0x20dd77,_0x2d1c34){return db[_0x664e('0x51')][_0x664e('0x46')]({'where':{'id':_0x3e6722[_0x664e('0x45')]['id']}})['then'](handleEntityNotFound(_0x20dd77,null))[_0x664e('0x22')](function(_0x46193){if(_0x46193){return _0x46193['addActions'](_0x3e6722['body'][_0x664e('0x4c')],_[_0x664e('0x4d')](_0x3e6722[_0x664e('0x49')],['ids','id'])||{});}})[_0x664e('0x22')](respondWithResult(_0x20dd77,null))[_0x664e('0x44')](handleError(_0x20dd77,null));};exports[_0x664e('0x52')]=function(_0x408ff6,_0x4c9a57,_0x467b9e){var _0x5f58e3={};var _0x266fc4={};var _0x1a3169;var _0x4b1fc5;return db[_0x664e('0x2b')][_0x664e('0x53')]({'where':{'id':_0x408ff6[_0x664e('0x45')]['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x4c9a57,null))[_0x664e('0x22')](function(_0x1ab6b0){if(_0x1ab6b0){_0x1a3169=_0x1ab6b0;_0x266fc4[_0x664e('0x33')]=_[_0x664e('0x30')](db[_0x664e('0x51')][_0x664e('0x2c')]);_0x266fc4[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x408ff6[_0x664e('0x2f')]);_0x266fc4[_0x664e('0x31')]=_[_0x664e('0x32')](_0x266fc4[_0x664e('0x33')],_0x266fc4[_0x664e('0x2f')]);_0x5f58e3['attributes']=_['intersection'](_0x266fc4[_0x664e('0x33')],qs[_0x664e('0x35')](_0x408ff6[_0x664e('0x2f')]['fields']));_0x5f58e3[_0x664e('0x34')]=_0x5f58e3[_0x664e('0x34')][_0x664e('0x36')]?_0x5f58e3[_0x664e('0x34')]:_0x266fc4[_0x664e('0x33')];_0x5f58e3[_0x664e('0x4f')]=qs[_0x664e('0x39')](_0x408ff6[_0x664e('0x2f')][_0x664e('0x39')]);_0x5f58e3[_0x664e('0x3a')]=qs['filters'](_[_0x664e('0x3b')](_0x408ff6[_0x664e('0x2f')],_0x266fc4['filters']));if(_0x408ff6[_0x664e('0x2f')][_0x664e('0x3e')]){_0x5f58e3['where']=_[_0x664e('0x3f')](_0x5f58e3[_0x664e('0x3a')],{'$or':_[_0x664e('0x2a')](_0x5f58e3[_0x664e('0x34')],function(_0x59f728){var _0x1d15e1={};_0x1d15e1[_0x59f728]={'$like':'%'+_0x408ff6['query'][_0x664e('0x3e')]+'%'};return _0x1d15e1;})});}_0x5f58e3=_[_0x664e('0x3f')]({},_0x5f58e3,_0x408ff6[_0x664e('0x40')]);return _0x1a3169[_0x664e('0x52')](_0x5f58e3);}})[_0x664e('0x22')](function(_0x22b963){if(_0x22b963){_0x4b1fc5=_0x22b963['length'];if(!_0x408ff6[_0x664e('0x2f')]['hasOwnProperty']('nolimit')){_0x5f58e3[_0x664e('0x1c')]=qs['limit'](_0x408ff6[_0x664e('0x2f')][_0x664e('0x1c')]);_0x5f58e3[_0x664e('0x1a')]=qs[_0x664e('0x1a')](_0x408ff6['query'][_0x664e('0x1a')]);}return _0x1a3169[_0x664e('0x52')](_0x5f58e3);}})['then'](function(_0x500795){if(_0x500795){return _0x500795?{'count':_0x4b1fc5,'rows':_0x500795}:null;}})[_0x664e('0x22')](respondWithResult(_0x4c9a57,null))[_0x664e('0x44')](handleError(_0x4c9a57,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index db66157..04836af 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 _0xdc85=['util','../../config/logger','api','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xdc85,0x196));var _0x5dc8=function(_0x2f2a8b,_0x377a31){_0x2f2a8b=_0x2f2a8b-0x0;var _0x3f795b=_0xdc85[_0x2f2a8b];return _0x3f795b;};'use strict';var _=require(_0x5dc8('0x0'));var util=require(_0x5dc8('0x1'));var logger=require(_0x5dc8('0x2'))(_0x5dc8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5dc8('0x4'));var rimraf=require(_0x5dc8('0x5'));var config=require('../../config/environment');var attributes=require(_0x5dc8('0x6'));module[_0x5dc8('0x7')]=function(_0x39c1d4,_0x28f784){return _0x39c1d4[_0x5dc8('0x8')](_0x5dc8('0x9'),attributes,{'tableName':_0x5dc8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x26b3=['bluebird','request-promise','./automation.attributes','define','Automation','tools_automations','util','../../config/logger','api'];(function(_0x404fa0,_0xf828f7){var _0x1d7c6b=function(_0x40b247){while(--_0x40b247){_0x404fa0['push'](_0x404fa0['shift']());}};_0x1d7c6b(++_0xf828f7);}(_0x26b3,0x84));var _0x326b=function(_0x1743c8,_0x331a38){_0x1743c8=_0x1743c8-0x0;var _0x1e975c=_0x26b3[_0x1743c8];return _0x1e975c;};'use strict';var _=require('lodash');var util=require(_0x326b('0x0'));var logger=require(_0x326b('0x1'))(_0x326b('0x2'));var moment=require('moment');var BPromise=require(_0x326b('0x3'));var rp=require(_0x326b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x326b('0x5'));module['exports']=function(_0x5a6652,_0x5033f7){return _0x5a6652[_0x326b('0x6')](_0x326b('0x7'),attributes,{'tableName':_0x326b('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 a358126..2dc01f0 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 _0xd824=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xd824,0xc2));var _0x4d82=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd824[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('Automation,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});}
\ No newline at end of file
+var _0x8a9a=['rpc','../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19cb2e,_0x1ae057){var _0x5abc62=function(_0x39cfe6){while(--_0x39cfe6){_0x19cb2e['push'](_0x19cb2e['shift']());}};_0x5abc62(++_0x1ae057);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8a9a[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var moment=require(_0xa8a9('0x1'));var BPromise=require(_0xa8a9('0x2'));var rs=require(_0xa8a9('0x3'));var fs=require('fs');var Redis=require(_0xa8a9('0x4'));var db=require(_0xa8a9('0x5'))['db'];var utils=require(_0xa8a9('0x6'));var logger=require(_0xa8a9('0x7'))(_0xa8a9('0x8'));var config=require(_0xa8a9('0x9'));var jayson=require(_0xa8a9('0xa'));var client=jayson[_0xa8a9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24a2bc,_0x4a091d,_0x1b4873){return new BPromise(function(_0x129e9f,_0x1477b0){return client[_0xa8a9('0xc')](_0x24a2bc,_0x1b4873)[_0xa8a9('0xd')](function(_0x4ebe24){logger[_0xa8a9('0xe')](_0xa8a9('0xf'),_0x4a091d,'request\x20sent');logger[_0xa8a9('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'),JSON[_0xa8a9('0x12')](_0x4ebe24));if(_0x4ebe24['error']){if(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x14')]===0x1f4){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);return _0x1477b0(_0x4ebe24['error'][_0xa8a9('0x15')]);}logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24['error']['message']);return _0x129e9f(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);}else{logger[_0xa8a9('0xe')]('Automation,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'));_0x129e9f(_0x4ebe24[_0xa8a9('0x16')]['message']);}})['catch'](function(_0x1039c9){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x1039c9);_0x1477b0(_0x1039c9);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index c8b2d68..ec4a264 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 _0x740a=['get','/:id','show','getConditions','/:id/actions','post','/:id/conditions','addConditions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x1d9be9,_0x4dfc4e){var _0x571e2d=function(_0x1fd7e1){while(--_0x1fd7e1){_0x1d9be9['push'](_0x1d9be9['shift']());}};_0x571e2d(++_0x4dfc4e);}(_0x740a,0x175));var _0xa740=function(_0x4c0a30,_0x196192){_0x4c0a30=_0x4c0a30-0x0;var _0x219ed8=_0x740a[_0x4c0a30];return _0x219ed8;};'use strict';var multer=require(_0xa740('0x0'));var util=require(_0xa740('0x1'));var path=require(_0xa740('0x2'));var timeout=require(_0xa740('0x3'));var express=require(_0xa740('0x4'));var router=express[_0xa740('0x5')]();var fs_extra=require(_0xa740('0x6'));var auth=require(_0xa740('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa740('0x8'));var controller=require('./automation.controller');router['get']('/',auth[_0xa740('0x9')](),controller[_0xa740('0xa')]);router[_0xa740('0xb')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0xd')]);router[_0xa740('0xb')]('/:id/conditions',auth[_0xa740('0x9')](),controller[_0xa740('0xe')]);router[_0xa740('0xb')](_0xa740('0xf'),auth[_0xa740('0x9')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa740('0x10')](_0xa740('0x11'),auth[_0xa740('0x9')](),controller[_0xa740('0x12')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller[_0xa740('0x13')]);router[_0xa740('0x14')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0x15')]);router[_0xa740('0x16')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x0a34=['index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x188fa4,_0x3e93f0){var _0x5b1d9b=function(_0x176bc1){while(--_0x176bc1){_0x188fa4['push'](_0x188fa4['shift']());}};_0x5b1d9b(++_0x3e93f0);}(_0x0a34,0x12a));var _0x40a3=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x0a34[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var path=require('path');var timeout=require(_0x40a3('0x2'));var express=require(_0x40a3('0x3'));var router=express[_0x40a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x40a3('0x5'));var interaction=require(_0x40a3('0x6'));var config=require(_0x40a3('0x7'));var controller=require('./automation.controller');router[_0x40a3('0x8')]('/',auth[_0x40a3('0x9')](),controller[_0x40a3('0xa')]);router[_0x40a3('0x8')](_0x40a3('0xb'),auth[_0x40a3('0x9')](),controller['show']);router[_0x40a3('0x8')](_0x40a3('0xc'),auth[_0x40a3('0x9')](),controller[_0x40a3('0xd')]);router[_0x40a3('0x8')](_0x40a3('0xe'),auth['isAuthenticated'](),controller[_0x40a3('0xf')]);router[_0x40a3('0x10')]('/',auth[_0x40a3('0x9')](),controller['create']);router[_0x40a3('0x10')](_0x40a3('0xc'),auth['isAuthenticated'](),controller[_0x40a3('0x11')]);router[_0x40a3('0x10')]('/:id/actions',auth[_0x40a3('0x9')](),controller[_0x40a3('0x12')]);router['put'](_0x40a3('0xb'),auth[_0x40a3('0x9')](),controller[_0x40a3('0x13')]);router[_0x40a3('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x40a3('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 990c764..c36bfae 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 _0xbaaa=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x2b9cce,_0xbb8890){var _0x4e4ddf=function(_0x5ef3cd){while(--_0x5ef3cd){_0x2b9cce['push'](_0x2b9cce['shift']());}};_0x4e4ddf(++_0xbb8890);}(_0xbaaa,0x137));var _0xabaa=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xbaaa[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xabaa('0x0'));module['exports']={'name':{'type':Sequelize[_0xabaa('0x1')],'unique':_0xabaa('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xabaa('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xabaa('0x4')},'description':{'type':Sequelize[_0xabaa('0x1')]},'active':{'type':Sequelize[_0xabaa('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xabaa('0x6')](0x4)[_0xabaa('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xabaa('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xabaa('0xc')},'dialTimezone':{'type':Sequelize[_0xabaa('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xabaa('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xabaa('0xe'),_0xabaa('0xf'),_0xabaa('0x10')),'defaultValue':_0xabaa('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xabaa('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xabaa('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xabaa('0x12')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xabaa('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xabaa('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xabaa('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xabaa('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xabaa('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xabaa('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xabaa('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xabaa('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xabaa('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xabaa('0x1a'),_0xabaa('0x1b')),'defaultValue':_0xabaa('0x1a')},'dialPrefix':{'type':Sequelize[_0xabaa('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xabaa('0x1c')},'dialCutDigit':{'type':Sequelize[_0xabaa('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xabaa('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0x24')}};
\ No newline at end of file
+var _0xf71f=['#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x47003d,_0x5e27ac){var _0x20715b=function(_0x260128){while(--_0x260128){_0x47003d['push'](_0x47003d['shift']());}};_0x20715b(++_0x5e27ac);}(_0xf71f,0xcb));var _0xff71=function(_0x54d6d0,_0x1edbb1){_0x54d6d0=_0x54d6d0-0x0;var _0x599158=_0xf71f[_0x54d6d0];return _0x599158;};'use strict';var Sequelize=require(_0xff71('0x0'));module[_0xff71('0x1')]={'name':{'type':Sequelize[_0xff71('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xff71('0x3')](_0xff71('0x4')),'allowNull':![],'defaultValue':_0xff71('0x4')},'description':{'type':Sequelize[_0xff71('0x2')]},'active':{'type':Sequelize[_0xff71('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xff71('0x6')](0x4)[_0xff71('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xff71('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xff71('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'comment':_0xff71('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xff71('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xff71('0x2')],'defaultValue':_0xff71('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xff71('0x3')]('always','never',_0xff71('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xff71('0x5')],'defaultValue':0x0,'comment':_0xff71('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xff71('0x6')](0x9)[_0xff71('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xff71('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xff71('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xff71('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xff71('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xff71('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xff71('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xff71('0x6')](0x9)[_0xff71('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xff71('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xff71('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xff71('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xff71('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xff71('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xff71('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xff71('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xff71('0x6')](0x9)[_0xff71('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xff71('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xff71('0x3')]('DESC',_0xff71('0x1b')),'defaultValue':_0xff71('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xff71('0x1d')},'dialCutDigit':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xff71('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 8397c07..4d7871d 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 _0x7cd6=['omit','user','update','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ListId','field','NOW()','ContactId','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','phone\x20IS\x20NOT\x20NULL','cm_contacts','insert','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','error','stack','send','index','Campaign','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','length','nolimit','order','sort','pick','merge','where','map','filter','count','includeAll','include','findAll','rows','catch','params','fields','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x735d48,_0x54ff20){_0x735d48=_0x735d48-0x0;var _0x34441e=_0x7cd6[_0x735d48];return _0x34441e;};'use strict';var emlformat=require(_0x67cd('0x0'));var rimraf=require(_0x67cd('0x1'));var zipdir=require(_0x67cd('0x2'));var jsonpatch=require(_0x67cd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67cd('0x4'));var Mustache=require(_0x67cd('0x5'));var util=require(_0x67cd('0x6'));var path=require('path');var sox=require(_0x67cd('0x7'));var csv=require('to-csv');var ejs=require(_0x67cd('0x8'));var fs=require('fs');var fs_extra=require(_0x67cd('0x9'));var _=require(_0x67cd('0xa'));var squel=require(_0x67cd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x67cd('0xc'));var querystring=require(_0x67cd('0xd'));var Papa=require('papaparse');var Redis=require(_0x67cd('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67cd('0xf'));var logger=require(_0x67cd('0x10'))(_0x67cd('0x11'));var utils=require(_0x67cd('0x12'));var config=require(_0x67cd('0x13'));var licenseUtil=require(_0x67cd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0a05,_0x39c6ca){_0x39c6ca=_0x39c6ca||0xcc;return function(_0x1693d7){if(_0x1693d7){return _0x2a0a05[_0x67cd('0x15')](_0x39c6ca);}return _0x2a0a05[_0x67cd('0x16')](_0x39c6ca)[_0x67cd('0x17')]();};}function respondWithResult(_0x158bf0,_0x2d5aca){_0x2d5aca=_0x2d5aca||0xc8;return function(_0x15da7d){if(_0x15da7d){return _0x158bf0[_0x67cd('0x16')](_0x2d5aca)[_0x67cd('0x18')](_0x15da7d);}};}function respondWithFilteredResult(_0xc3fb41,_0x4c5b6d){return function(_0x3fdccf){if(_0x3fdccf){var _0x465590=typeof _0x4c5b6d[_0x67cd('0x19')]===_0x67cd('0x1a')&&typeof _0x4c5b6d[_0x67cd('0x1b')]==='undefined';var _0xb147d8=_0x3fdccf['count'];var _0x30cb35=_0x465590?0x0:_0x4c5b6d['offset'];var _0x5596e0=_0x465590?_0x3fdccf['count']:_0x4c5b6d[_0x67cd('0x19')]+_0x4c5b6d[_0x67cd('0x1b')];var _0x4370e0;if(_0x5596e0>=_0xb147d8){_0x5596e0=_0xb147d8;_0x4370e0=0xc8;}else{_0x4370e0=0xce;}_0xc3fb41[_0x67cd('0x16')](_0x4370e0);return _0xc3fb41[_0x67cd('0x1c')](_0x67cd('0x1d'),_0x30cb35+'-'+_0x5596e0+'/'+_0xb147d8)[_0x67cd('0x18')](_0x3fdccf);}return null;};}function patchUpdates(_0x2011e5){return function(_0x1fff15){try{jsonpatch[_0x67cd('0x1e')](_0x1fff15,_0x2011e5,!![]);}catch(_0x591019){return BPromise[_0x67cd('0x1f')](_0x591019);}return _0x1fff15[_0x67cd('0x20')]();};}function saveUpdates(_0x1003b6,_0x22b153){return function(_0x512760){if(_0x512760){return _0x512760['update'](_0x1003b6)[_0x67cd('0x21')](function(_0x35ba2f){return _0x35ba2f;});}return null;};}function removeEntity(_0x21d5f1,_0x5f042c){return function(_0x2230c1){if(_0x2230c1){return _0x2230c1[_0x67cd('0x22')]()['then'](function(){var _0x3428aa=_0x2230c1['get']({'plain':!![]});var _0x6b9e7=_0x67cd('0x23');return db[_0x67cd('0x24')][_0x67cd('0x22')]({'where':{'type':_0x6b9e7,'resourceId':_0x3428aa['id']}})[_0x67cd('0x21')](function(){return _0x2230c1;});})['then'](function(){_0x21d5f1[_0x67cd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x104b8e,_0x46002e){return function(_0x363b24){if(!_0x363b24){_0x104b8e[_0x67cd('0x15')](0x194);}return _0x363b24;};}function handleError(_0x55caae,_0x4c1d39){_0x4c1d39=_0x4c1d39||0x1f4;return function(_0x1f252d){logger[_0x67cd('0x25')](_0x1f252d[_0x67cd('0x26')]);if(_0x1f252d['name']){delete _0x1f252d['name'];}_0x55caae[_0x67cd('0x16')](_0x4c1d39)[_0x67cd('0x27')](_0x1f252d);};}exports[_0x67cd('0x28')]=function(_0x3868af,_0x49e1e2){var _0x1578ce={},_0x2fbcca={},_0x331aba={'count':0x0,'rows':[]};var _0x554566=_['map'](db[_0x67cd('0x29')][_0x67cd('0x2a')],function(_0x528bb2){return{'name':_0x528bb2[_0x67cd('0x2b')],'type':_0x528bb2[_0x67cd('0x2c')][_0x67cd('0x2d')]};});_0x2fbcca[_0x67cd('0x2e')]=_['map'](_0x554566,_0x67cd('0x2f'));_0x2fbcca[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x3868af[_0x67cd('0x30')]);_0x2fbcca[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x2fbcca[_0x67cd('0x2e')],_0x2fbcca[_0x67cd('0x30')]);_0x1578ce[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x2fbcca['model'],qs['fields'](_0x3868af[_0x67cd('0x30')]['fields']));_0x1578ce[_0x67cd('0x34')]=_0x1578ce[_0x67cd('0x34')][_0x67cd('0x35')]?_0x1578ce['attributes']:_0x2fbcca[_0x67cd('0x2e')];if(!_0x3868af[_0x67cd('0x30')]['hasOwnProperty'](_0x67cd('0x36'))){_0x1578ce['limit']=qs[_0x67cd('0x1b')](_0x3868af[_0x67cd('0x30')]['limit']);_0x1578ce[_0x67cd('0x19')]=qs[_0x67cd('0x19')](_0x3868af[_0x67cd('0x30')][_0x67cd('0x19')]);}_0x1578ce[_0x67cd('0x37')]=qs[_0x67cd('0x38')](_0x3868af[_0x67cd('0x30')][_0x67cd('0x38')]);_0x1578ce['where']=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x3868af[_0x67cd('0x30')],_0x2fbcca[_0x67cd('0x32')]),_0x554566);if(_0x3868af[_0x67cd('0x30')]['filter']){_0x1578ce['where']=_[_0x67cd('0x3a')](_0x1578ce[_0x67cd('0x3b')],{'$or':_[_0x67cd('0x3c')](_0x554566,function(_0x2bb9d1){if(_0x2bb9d1['type']!=='VIRTUAL'){var _0x8f018e={};_0x8f018e[_0x2bb9d1[_0x67cd('0x2f')]]={'$like':'%'+_0x3868af[_0x67cd('0x30')][_0x67cd('0x3d')]+'%'};return _0x8f018e;}})});}_0x1578ce=_[_0x67cd('0x3a')]({},_0x1578ce,_0x3868af['options']);var _0x363c49={'where':_0x1578ce[_0x67cd('0x3b')]};return db[_0x67cd('0x29')][_0x67cd('0x3e')](_0x363c49)['then'](function(_0x2bccd4){_0x331aba[_0x67cd('0x3e')]=_0x2bccd4;if(_0x3868af[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x1578ce[_0x67cd('0x40')]=[{'all':!![]}];}return db[_0x67cd('0x29')][_0x67cd('0x41')](_0x1578ce);})[_0x67cd('0x21')](function(_0x9ab74f){_0x331aba[_0x67cd('0x42')]=_0x9ab74f;return _0x331aba;})['then'](respondWithFilteredResult(_0x49e1e2,_0x1578ce))[_0x67cd('0x43')](handleError(_0x49e1e2,null));};exports['show']=function(_0x418859,_0x595ed3){var _0xbcaa74={'raw':![],'where':{'id':_0x418859[_0x67cd('0x44')]['id']}},_0x956307={};_0x956307[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x29')][_0x67cd('0x2a')]);_0x956307[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x418859[_0x67cd('0x30')]);_0x956307[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x956307[_0x67cd('0x2e')],_0x956307[_0x67cd('0x30')]);_0xbcaa74[_0x67cd('0x34')]=_['intersection'](_0x956307[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x418859[_0x67cd('0x30')]['fields']));_0xbcaa74[_0x67cd('0x34')]=_0xbcaa74['attributes'][_0x67cd('0x35')]?_0xbcaa74[_0x67cd('0x34')]:_0x956307['model'];if(_0x418859[_0x67cd('0x30')][_0x67cd('0x3f')]){_0xbcaa74[_0x67cd('0x40')]=[{'all':!![]}];}_0xbcaa74=_[_0x67cd('0x3a')]({},_0xbcaa74,_0x418859[_0x67cd('0x46')]);return db[_0x67cd('0x29')][_0x67cd('0x47')](_0xbcaa74)[_0x67cd('0x21')](handleEntityNotFound(_0x595ed3,null))[_0x67cd('0x21')](respondWithResult(_0x595ed3,null))[_0x67cd('0x43')](handleError(_0x595ed3,null));};exports['create']=function(_0x227278,_0x591450){return db[_0x67cd('0x29')][_0x67cd('0x48')](_0x227278['body'],{})['then'](function(_0x5a0cb9){var _0x1fd7f0=_0x227278['user']['get']({'plain':!![]});if(!_0x1fd7f0)throw new Error(_0x67cd('0x49'));if(_0x1fd7f0[_0x67cd('0x4a')]==='user'){var _0x5bdafb=_0x5a0cb9[_0x67cd('0x4b')]({'plain':!![]});var _0x7c94ac='IvrCampaigns';return db[_0x67cd('0x4c')][_0x67cd('0x47')]({'where':{'name':_0x7c94ac,'userProfileId':_0x1fd7f0[_0x67cd('0x4d')]},'raw':!![]})[_0x67cd('0x21')](function(_0x49d2f5){if(_0x49d2f5&&_0x49d2f5[_0x67cd('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x5bdafb['name'],'resourceId':_0x5bdafb['id'],'type':_0x49d2f5[_0x67cd('0x2f')],'sectionId':_0x49d2f5['id']},{})[_0x67cd('0x21')](function(){return _0x5a0cb9;});}else{return _0x5a0cb9;}})['catch'](function(_0x4f357f){logger[_0x67cd('0x25')](_0x67cd('0x4f'),_0x4f357f);throw _0x4f357f;});}return _0x5a0cb9;})[_0x67cd('0x21')](respondWithResult(_0x591450,0xc9))[_0x67cd('0x43')](handleError(_0x591450,null));};exports[_0x67cd('0x50')]=function(_0x2ba07f,_0x5f382d){var _0x19bc5d={'where':{'id':_0x2ba07f[_0x67cd('0x44')]['id']}},_0x4a07bb={};_0x4a07bb[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x29')][_0x67cd('0x2a')]);_0x19bc5d[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x4a07bb[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x2ba07f['query']['fields']));_0x19bc5d[_0x67cd('0x34')]=_0x19bc5d[_0x67cd('0x34')][_0x67cd('0x35')]?_0x19bc5d[_0x67cd('0x34')]:_0x4a07bb[_0x67cd('0x2e')];if(_0x2ba07f['query'][_0x67cd('0x3f')]){_0x19bc5d[_0x67cd('0x40')]=[{'all':!![]}];}_0x19bc5d=_[_0x67cd('0x3a')]({},_0x19bc5d,_0x2ba07f['options']);return db[_0x67cd('0x29')]['find'](_0x19bc5d)['then'](handleEntityNotFound(_0x5f382d,null))[_0x67cd('0x21')](function(_0x3dacaa){if(_0x3dacaa){var _0x15234d=_0x3dacaa[_0x67cd('0x4b')]({'plain':!![]});_0x15234d=qs['omit'](_0x15234d,['id',_0x67cd('0x51'),_0x67cd('0x52')]);_0x2ba07f[_0x67cd('0x53')]=_[_0x67cd('0x54')](_0x2ba07f[_0x67cd('0x53')],['id',_0x67cd('0x51'),_0x67cd('0x52')]);return db['Campaign'][_0x67cd('0x48')](_[_0x67cd('0x3a')](_0x15234d,_0x2ba07f[_0x67cd('0x53')]),{'include':_0x2ba07f[_0x67cd('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x67cd('0x21')](function(_0x149a39){var _0x391558=_0x2ba07f['user'][_0x67cd('0x4b')]({'plain':!![]});if(!_0x391558)throw new Error(_0x67cd('0x49'));if(_0x391558[_0x67cd('0x4a')]===_0x67cd('0x55')){var _0x5632db=_0x149a39[_0x67cd('0x4b')]({'plain':!![]});var _0x4e944e=_0x67cd('0x23');return db['UserProfileSection'][_0x67cd('0x47')]({'where':{'name':_0x4e944e,'userProfileId':_0x391558[_0x67cd('0x4d')]},'raw':!![]})[_0x67cd('0x21')](function(_0x506cdb){if(_0x506cdb&&_0x506cdb[_0x67cd('0x4e')]===0x0){return db[_0x67cd('0x24')][_0x67cd('0x48')]({'name':_0x5632db['name'],'resourceId':_0x5632db['id'],'type':_0x506cdb[_0x67cd('0x2f')],'sectionId':_0x506cdb['id']},{})[_0x67cd('0x21')](function(){return _0x149a39;});}else{return _0x149a39;}})['catch'](function(_0x30b6b1){logger['error'](_0x67cd('0x4f'),_0x30b6b1);throw _0x30b6b1;});}return _0x149a39;});}})[_0x67cd('0x21')](respondWithResult(_0x5f382d,0xc9))[_0x67cd('0x43')](handleError(_0x5f382d,null));};exports[_0x67cd('0x56')]=function(_0x52fdbe,_0x2745b0){if(_0x52fdbe[_0x67cd('0x53')]['id']){delete _0x52fdbe[_0x67cd('0x53')]['id'];}return db['Campaign']['find']({'where':{'id':_0x52fdbe[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x2745b0,null))[_0x67cd('0x21')](saveUpdates(_0x52fdbe['body'],null))[_0x67cd('0x21')](respondWithResult(_0x2745b0,null))['catch'](handleError(_0x2745b0,null));};exports[_0x67cd('0x22')]=function(_0x361df7,_0x35d3e1){return db['Campaign']['find']({'where':{'id':_0x361df7[_0x67cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x35d3e1,null))[_0x67cd('0x21')](removeEntity(_0x35d3e1,null))['catch'](handleError(_0x35d3e1,null));};exports[_0x67cd('0x57')]=function(_0x238ea9,_0x168124,_0x16a22e){var _0x492873={'raw':!![],'where':{}};var _0x5dcb0c={};var _0x185f40={'count':0x0,'rows':[]};return db[_0x67cd('0x29')][_0x67cd('0x58')]({'where':{'id':_0x238ea9[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x168124,null))[_0x67cd('0x21')](function(_0x3d745d){if(_0x3d745d){_0x5dcb0c[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x59')][_0x67cd('0x2a')]);_0x5dcb0c['query']=_[_0x67cd('0x31')](_0x238ea9[_0x67cd('0x30')]);_0x5dcb0c[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x5dcb0c[_0x67cd('0x2e')],_0x5dcb0c[_0x67cd('0x30')]);_0x492873[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x5dcb0c[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x238ea9['query'][_0x67cd('0x45')]));_0x492873[_0x67cd('0x34')]=_0x492873[_0x67cd('0x34')][_0x67cd('0x35')]?_0x492873['attributes']:_0x5dcb0c[_0x67cd('0x2e')];if(!_0x238ea9[_0x67cd('0x30')][_0x67cd('0x5a')]('nolimit')){_0x492873[_0x67cd('0x1b')]=qs[_0x67cd('0x1b')](_0x238ea9[_0x67cd('0x30')][_0x67cd('0x1b')]);_0x492873['offset']=qs[_0x67cd('0x19')](_0x238ea9[_0x67cd('0x30')][_0x67cd('0x19')]);}_0x492873[_0x67cd('0x37')]=qs[_0x67cd('0x38')](_0x238ea9[_0x67cd('0x30')][_0x67cd('0x38')]);_0x492873[_0x67cd('0x3b')]=qs[_0x67cd('0x32')](_['pick'](_0x238ea9[_0x67cd('0x30')],_0x5dcb0c[_0x67cd('0x32')]));_0x492873[_0x67cd('0x3b')][_0x67cd('0x5b')]=_0x3d745d['id'];if(_0x238ea9[_0x67cd('0x30')][_0x67cd('0x3d')]){_0x492873[_0x67cd('0x3b')]=_[_0x67cd('0x3a')](_0x492873[_0x67cd('0x3b')],{'$or':_[_0x67cd('0x3c')](_0x492873[_0x67cd('0x34')],function(_0x8d313d){var _0x11e473={};_0x11e473[_0x8d313d]={'$like':'%'+_0x238ea9[_0x67cd('0x30')][_0x67cd('0x3d')]+'%'};return _0x11e473;})});}_0x492873=_[_0x67cd('0x3a')]({},_0x492873,_0x238ea9[_0x67cd('0x46')]);return db[_0x67cd('0x59')]['count']({'where':_0x492873[_0x67cd('0x3b')]})['then'](function(_0xfed9d5){_0x185f40['count']=_0xfed9d5;if(_0x238ea9[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x492873['include']=[{'all':!![]}];}return db[_0x67cd('0x59')][_0x67cd('0x41')](_0x492873);})[_0x67cd('0x21')](function(_0x54e89d){_0x185f40['rows']=_0x54e89d;return _0x185f40;});}})[_0x67cd('0x21')](respondWithFilteredResult(_0x168124,_0x492873))[_0x67cd('0x43')](handleError(_0x168124,null));};exports[_0x67cd('0x5c')]=function(_0x392235,_0x33aa3d,_0x2adc5f){var _0x17ce4a={'raw':!![],'where':{}};var _0x198652={};var _0x58afd1={'count':0x0,'rows':[]};return db[_0x67cd('0x29')][_0x67cd('0x58')]({'where':{'id':_0x392235[_0x67cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x33aa3d,null))[_0x67cd('0x21')](function(_0x23fab3){if(_0x23fab3){_0x198652['model']=_[_0x67cd('0x31')](db[_0x67cd('0x5d')]['rawAttributes']);_0x198652['query']=_[_0x67cd('0x31')](_0x392235['query']);_0x198652[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x198652['model'],_0x198652[_0x67cd('0x30')]);_0x17ce4a[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x198652[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x392235[_0x67cd('0x30')][_0x67cd('0x45')]));_0x17ce4a[_0x67cd('0x34')]=_0x17ce4a['attributes'][_0x67cd('0x35')]?_0x17ce4a['attributes']:_0x198652['model'];if(!_0x392235[_0x67cd('0x30')][_0x67cd('0x5a')](_0x67cd('0x36'))){_0x17ce4a[_0x67cd('0x1b')]=qs['limit'](_0x392235[_0x67cd('0x30')][_0x67cd('0x1b')]);_0x17ce4a[_0x67cd('0x19')]=qs['offset'](_0x392235[_0x67cd('0x30')][_0x67cd('0x19')]);}_0x17ce4a[_0x67cd('0x37')]=qs['sort'](_0x392235[_0x67cd('0x30')][_0x67cd('0x38')]);_0x17ce4a['where']=qs[_0x67cd('0x32')](_['pick'](_0x392235['query'],_0x198652[_0x67cd('0x32')]));_0x17ce4a[_0x67cd('0x3b')][_0x67cd('0x5b')]=_0x23fab3['id'];if(_0x392235[_0x67cd('0x30')][_0x67cd('0x3d')]){_0x17ce4a['where']=_[_0x67cd('0x3a')](_0x17ce4a[_0x67cd('0x3b')],{'$or':_['map'](_0x17ce4a['attributes'],function(_0x4f9060){var _0x5932b2={};_0x5932b2[_0x4f9060]={'$like':'%'+_0x392235['query'][_0x67cd('0x3d')]+'%'};return _0x5932b2;})});}_0x17ce4a=_[_0x67cd('0x3a')]({},_0x17ce4a,_0x392235[_0x67cd('0x46')]);return db[_0x67cd('0x5d')][_0x67cd('0x3e')]({'where':_0x17ce4a[_0x67cd('0x3b')]})[_0x67cd('0x21')](function(_0x18ba85){_0x58afd1['count']=_0x18ba85;if(_0x392235[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x17ce4a['include']=[{'all':!![]}];}return db[_0x67cd('0x5d')][_0x67cd('0x41')](_0x17ce4a);})['then'](function(_0x63f484){_0x58afd1[_0x67cd('0x42')]=_0x63f484;return _0x58afd1;});}})['then'](respondWithFilteredResult(_0x33aa3d,_0x17ce4a))[_0x67cd('0x43')](handleError(_0x33aa3d,null));};exports[_0x67cd('0x5e')]=function(_0x19d061,_0x49025d,_0x4ecb85){var _0x17260c={'raw':!![],'where':{}};var _0x32c769={};var _0x56c50a={'count':0x0,'rows':[]};return db['Campaign'][_0x67cd('0x58')]({'where':{'id':_0x19d061[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x49025d,null))[_0x67cd('0x21')](function(_0x526982){if(_0x526982){_0x32c769[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x5f')][_0x67cd('0x2a')]);_0x32c769[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x19d061[_0x67cd('0x30')]);_0x32c769['filters']=_['intersection'](_0x32c769[_0x67cd('0x2e')],_0x32c769['query']);_0x17260c[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x32c769[_0x67cd('0x2e')],qs['fields'](_0x19d061[_0x67cd('0x30')][_0x67cd('0x45')]));_0x17260c[_0x67cd('0x34')]=_0x17260c[_0x67cd('0x34')][_0x67cd('0x35')]?_0x17260c[_0x67cd('0x34')]:_0x32c769['model'];if(!_0x19d061[_0x67cd('0x30')][_0x67cd('0x5a')](_0x67cd('0x36'))){_0x17260c[_0x67cd('0x1b')]=qs[_0x67cd('0x1b')](_0x19d061[_0x67cd('0x30')]['limit']);_0x17260c[_0x67cd('0x19')]=qs[_0x67cd('0x19')](_0x19d061[_0x67cd('0x30')][_0x67cd('0x19')]);}_0x17260c['order']=qs[_0x67cd('0x38')](_0x19d061[_0x67cd('0x30')]['sort']);_0x17260c['where']=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x19d061[_0x67cd('0x30')],_0x32c769['filters']));_0x17260c[_0x67cd('0x3b')][_0x67cd('0x5b')]=_0x526982['id'];if(_0x19d061['query']['filter']){_0x17260c[_0x67cd('0x3b')]=_[_0x67cd('0x3a')](_0x17260c[_0x67cd('0x3b')],{'$or':_[_0x67cd('0x3c')](_0x17260c[_0x67cd('0x34')],function(_0x4ea3f5){var _0x4fbe6b={};_0x4fbe6b[_0x4ea3f5]={'$like':'%'+_0x19d061[_0x67cd('0x30')][_0x67cd('0x3d')]+'%'};return _0x4fbe6b;})});}_0x17260c=_[_0x67cd('0x3a')]({},_0x17260c,_0x19d061['options']);return db[_0x67cd('0x5f')][_0x67cd('0x3e')]({'where':_0x17260c[_0x67cd('0x3b')]})[_0x67cd('0x21')](function(_0x57997b){_0x56c50a[_0x67cd('0x3e')]=_0x57997b;if(_0x19d061[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x17260c['include']=[{'all':!![]}];}return db[_0x67cd('0x5f')][_0x67cd('0x41')](_0x17260c);})[_0x67cd('0x21')](function(_0x153531){_0x56c50a[_0x67cd('0x42')]=_0x153531;return _0x56c50a;});}})[_0x67cd('0x21')](respondWithFilteredResult(_0x49025d,_0x17260c))['catch'](handleError(_0x49025d,null));};exports[_0x67cd('0x60')]=function(_0x5722d2,_0x30ee6a,_0x3c0ad6){var _0x523216={'raw':!![],'where':{}};var _0x411b54={};var _0x4af7e4={'count':0x0,'rows':[]};return db[_0x67cd('0x29')]['findOne']({'where':{'id':_0x5722d2['params']['id']}})['then'](handleEntityNotFound(_0x30ee6a,null))[_0x67cd('0x21')](function(_0x73271c){if(_0x73271c){_0x411b54[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x61')]['rawAttributes']);_0x411b54[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x5722d2[_0x67cd('0x30')]);_0x411b54['filters']=_[_0x67cd('0x33')](_0x411b54['model'],_0x411b54[_0x67cd('0x30')]);_0x523216[_0x67cd('0x34')]=_['intersection'](_0x411b54[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x5722d2[_0x67cd('0x30')][_0x67cd('0x45')]));_0x523216[_0x67cd('0x34')]=_0x523216[_0x67cd('0x34')][_0x67cd('0x35')]?_0x523216[_0x67cd('0x34')]:_0x411b54[_0x67cd('0x2e')];if(!_0x5722d2[_0x67cd('0x30')][_0x67cd('0x5a')](_0x67cd('0x36'))){_0x523216[_0x67cd('0x1b')]=qs[_0x67cd('0x1b')](_0x5722d2[_0x67cd('0x30')][_0x67cd('0x1b')]);_0x523216['offset']=qs[_0x67cd('0x19')](_0x5722d2[_0x67cd('0x30')]['offset']);}_0x523216[_0x67cd('0x37')]=qs['sort'](_0x5722d2[_0x67cd('0x30')][_0x67cd('0x38')]);_0x523216[_0x67cd('0x3b')]=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x5722d2[_0x67cd('0x30')],_0x411b54['filters']));_0x523216[_0x67cd('0x3b')][_0x67cd('0x5b')]=_0x73271c['id'];if(_0x5722d2[_0x67cd('0x30')][_0x67cd('0x3d')]){_0x523216['where']=_['merge'](_0x523216['where'],{'$or':_[_0x67cd('0x3c')](_0x523216[_0x67cd('0x34')],function(_0x2f2933){var _0xdce66d={};_0xdce66d[_0x2f2933]={'$like':'%'+_0x5722d2['query'][_0x67cd('0x3d')]+'%'};return _0xdce66d;})});}_0x523216=_[_0x67cd('0x3a')]({},_0x523216,_0x5722d2[_0x67cd('0x46')]);return db['CmHopperBlack'][_0x67cd('0x3e')]({'where':_0x523216[_0x67cd('0x3b')]})['then'](function(_0x2a8068){_0x4af7e4[_0x67cd('0x3e')]=_0x2a8068;if(_0x5722d2[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x523216[_0x67cd('0x40')]=[{'all':!![]}];}return db[_0x67cd('0x61')][_0x67cd('0x41')](_0x523216);})[_0x67cd('0x21')](function(_0x427bbc){_0x4af7e4['rows']=_0x427bbc;return _0x4af7e4;});}})['then'](respondWithFilteredResult(_0x30ee6a,_0x523216))['catch'](handleError(_0x30ee6a,null));};exports['getLists']=function(_0x44afe,_0x102b0d,_0x4e8932){var _0x571d08={};var _0x55907b={};var _0x3ba364;var _0xda520e;return db[_0x67cd('0x29')][_0x67cd('0x58')]({'where':{'id':_0x44afe[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x102b0d,null))[_0x67cd('0x21')](function(_0x3b082f){if(_0x3b082f){_0x3ba364=_0x3b082f;_0x55907b['model']=_[_0x67cd('0x31')](db['CmList'][_0x67cd('0x2a')]);_0x55907b[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x44afe['query']);_0x55907b[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x55907b[_0x67cd('0x2e')],_0x55907b['query']);_0x571d08[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x55907b['model'],qs['fields'](_0x44afe[_0x67cd('0x30')][_0x67cd('0x45')]));_0x571d08[_0x67cd('0x34')]=_0x571d08[_0x67cd('0x34')][_0x67cd('0x35')]?_0x571d08[_0x67cd('0x34')]:_0x55907b[_0x67cd('0x2e')];_0x571d08[_0x67cd('0x37')]=qs['sort'](_0x44afe[_0x67cd('0x30')]['sort']);_0x571d08[_0x67cd('0x3b')]=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x44afe[_0x67cd('0x30')],_0x55907b[_0x67cd('0x32')]));if(_0x44afe['query'][_0x67cd('0x3d')]){_0x571d08[_0x67cd('0x3b')]=_[_0x67cd('0x3a')](_0x571d08['where'],{'$or':_[_0x67cd('0x3c')](_0x571d08[_0x67cd('0x34')],function(_0x5b930b){var _0x4d962e={};_0x4d962e[_0x5b930b]={'$like':'%'+_0x44afe['query'][_0x67cd('0x3d')]+'%'};return _0x4d962e;})});}_0x571d08=_[_0x67cd('0x3a')]({},_0x571d08,_0x44afe['options']);return _0x3ba364[_0x67cd('0x62')](_0x571d08);}})['then'](function(_0x3ac4c3){if(_0x3ac4c3){_0xda520e=_0x3ac4c3[_0x67cd('0x35')];if(!_0x44afe[_0x67cd('0x30')][_0x67cd('0x5a')]('nolimit')){_0x571d08[_0x67cd('0x1b')]=qs[_0x67cd('0x1b')](_0x44afe['query'][_0x67cd('0x1b')]);_0x571d08[_0x67cd('0x19')]=qs['offset'](_0x44afe[_0x67cd('0x30')][_0x67cd('0x19')]);}return _0x3ba364['getLists'](_0x571d08);}})[_0x67cd('0x21')](function(_0x23b4db){if(_0x23b4db){return _0x23b4db?{'count':_0xda520e,'rows':_0x23b4db}:null;}})[_0x67cd('0x21')](respondWithResult(_0x102b0d,null))[_0x67cd('0x43')](handleError(_0x102b0d,null));};exports[_0x67cd('0x63')]=function(_0x22e9d7,_0x348a86,_0x2b987a){var _0x3ac334,_0x3e9c6d;var _0x44bf95=[];var _0xfb8e19=moment()[_0x67cd('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x67cd('0x29')]['find']({'where':{'id':_0x22e9d7[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x348a86,null))[_0x67cd('0x21')](function(_0x78ca70){if(_0x78ca70){_0x3e9c6d=_0x78ca70;return _0x78ca70['addLists'](_0x22e9d7['body']['ids'],_['omit'](_0x22e9d7[_0x67cd('0x53')],[_0x67cd('0x65'),'id'])||{});}return null;})[_0x67cd('0x66')](function(_0x2eb7cd){var _0x2509dd;var _0x4bdef2;_0x3ac334=_0x2eb7cd||[];var _0x5341ab=[];if(_0x2eb7cd){for(var _0x9a6549=0x0;_0x9a6549<_0x2eb7cd[_0x67cd('0x35')];_0x9a6549+=0x1){var _0x47c329=_0x2eb7cd[_0x9a6549][_0x67cd('0x4b')]({'plain':!![]});_0x3e9c6d[_0x67cd('0x67')]=_0x22e9d7[_0x67cd('0x53')][_0x67cd('0x67')]?_0x22e9d7[_0x67cd('0x53')][_0x67cd('0x67')]:_0x3e9c6d[_0x67cd('0x67')];switch(_0x3e9c6d[_0x67cd('0x67')]){case _0x67cd('0x68'):_0x2509dd=squel['insert']()[_0x67cd('0x69')]('cm_hopper')[_0x67cd('0x6a')]([_0x67cd('0x6b'),_0x67cd('0x6c'),'ContactId',_0x67cd('0x6d'),_0x67cd('0x5b'),'createdAt',_0x67cd('0x52')],squel['select']()['field'](_0x67cd('0x6b'),'phone')[_0x67cd('0x6e')](_0x67cd('0x6f'),'scheduledAt')[_0x67cd('0x6e')]('id',_0x67cd('0x70'))[_0x67cd('0x6e')](_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')](),_0x67cd('0x6d'))[_0x67cd('0x6e')](_0x22e9d7['params']['id']['toString'](),_0x67cd('0x5b'))['field']('\x27'+_0xfb8e19+'\x27',_0x67cd('0x51'))[_0x67cd('0x6e')]('\x27'+_0xfb8e19+'\x27','updatedAt')['from']('cm_contacts')[_0x67cd('0x3b')](_0x67cd('0x73'))[_0x67cd('0x3b')](_0x67cd('0x74'),_0x47c329['CmListId'][_0x67cd('0x72')]())[_0x67cd('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x67cd('0x3b')](_0x67cd('0x75'),squel[_0x67cd('0x76')]()[_0x67cd('0x6e')](_0x67cd('0x77'))[_0x67cd('0x78')]('cm_hopper_final')['where'](_0x67cd('0x79'),_0x22e9d7[_0x67cd('0x44')]['id'][_0x67cd('0x72')]()))['where'](_0x67cd('0x75'),squel[_0x67cd('0x76')]()['field'](_0x67cd('0x7a'))[_0x67cd('0x78')](_0x67cd('0x7b'))['where'](_0x67cd('0x79'),_0x22e9d7['params']['id'][_0x67cd('0x72')]())))[_0x67cd('0x72')]();break;case'onlyIfOpen':_0x2509dd=squel['insert']()[_0x67cd('0x69')](_0x67cd('0x7b'))['fromQuery']([_0x67cd('0x6b'),_0x67cd('0x6c'),_0x67cd('0x70'),'ListId',_0x67cd('0x5b'),_0x67cd('0x51'),_0x67cd('0x52')],squel[_0x67cd('0x76')]()[_0x67cd('0x6e')](_0x67cd('0x6b'),_0x67cd('0x6b'))[_0x67cd('0x6e')]('NOW()','scheduledAt')[_0x67cd('0x6e')]('id',_0x67cd('0x70'))[_0x67cd('0x6e')](_0x47c329['CmListId'][_0x67cd('0x72')](),_0x67cd('0x6d'))[_0x67cd('0x6e')](_0x22e9d7['params']['id'][_0x67cd('0x72')](),_0x67cd('0x5b'))['field']('\x27'+_0xfb8e19+'\x27','createdAt')['field']('\x27'+_0xfb8e19+'\x27',_0x67cd('0x52'))[_0x67cd('0x78')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x67cd('0x3b')](_0x67cd('0x74'),_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')]())['where'](_0x67cd('0x7c'))[_0x67cd('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x67cd('0x76')]()['field']('COALESCE(phone,\x27\x27)')[_0x67cd('0x78')](_0x67cd('0x7b'))[_0x67cd('0x3b')](_0x67cd('0x79'),_0x22e9d7[_0x67cd('0x44')]['id'][_0x67cd('0x72')]())))['toString']();break;default:_0x2509dd=squel['insert']()[_0x67cd('0x69')](_0x67cd('0x7b'))[_0x67cd('0x6a')]([_0x67cd('0x6b'),_0x67cd('0x6c'),_0x67cd('0x70'),'ListId',_0x67cd('0x5b'),_0x67cd('0x51'),_0x67cd('0x52')],squel[_0x67cd('0x76')]()[_0x67cd('0x6e')]('phone',_0x67cd('0x6b'))[_0x67cd('0x6e')]('NOW()',_0x67cd('0x6c'))[_0x67cd('0x6e')]('id',_0x67cd('0x70'))[_0x67cd('0x6e')](_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')](),_0x67cd('0x6d'))[_0x67cd('0x6e')](_0x22e9d7['params']['id'][_0x67cd('0x72')](),'CampaignId')['field']('\x27'+_0xfb8e19+'\x27',_0x67cd('0x51'))['field']('\x27'+_0xfb8e19+'\x27',_0x67cd('0x52'))[_0x67cd('0x78')](_0x67cd('0x7d'))['where'](_0x67cd('0x73'))[_0x67cd('0x3b')](_0x67cd('0x74'),_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')]())['where'](_0x67cd('0x7c')))[_0x67cd('0x72')]();}_0x4bdef2=squel[_0x67cd('0x7e')]()['into'](_0x67cd('0x7f'))['fromQuery'](['cmHopperId',_0x67cd('0x6c'),_0x67cd('0x6b'),_0x67cd('0x80'),_0x67cd('0x51'),_0x67cd('0x52')],squel['select']()[_0x67cd('0x6e')](_0x67cd('0x81'),'id')[_0x67cd('0x6e')](_0x67cd('0x6f'),'scheduledAt')[_0x67cd('0x6e')](_0x67cd('0x82'),'phone')[_0x67cd('0x6e')](_0x67cd('0x83'),_0x67cd('0x80'))[_0x67cd('0x6e')]('\x27'+_0xfb8e19+'\x27',_0x67cd('0x51'))[_0x67cd('0x6e')]('\x27'+_0xfb8e19+'\x27',_0x67cd('0x52'))[_0x67cd('0x78')]('cm_contact_has_items','ci')[_0x67cd('0x84')]('cm_hopper','h',_0x67cd('0x85'))[_0x67cd('0x3b')](_0x67cd('0x86'),_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')]())[_0x67cd('0x3b')](_0x67cd('0x87'),_0x22e9d7['params']['id'][_0x67cd('0x72')]())[_0x67cd('0x3b')](_0x67cd('0x88'),_0xfb8e19))[_0x67cd('0x72')]();_0x5341ab[_0x67cd('0x89')](db['sequelize']['query'](_0x2509dd));_0x44bf95[_0x67cd('0x89')](db['sequelize'][_0x67cd('0x30')](_0x4bdef2));}return BPromise[_0x67cd('0x8a')](_0x5341ab);}})[_0x67cd('0x21')](function(){return BPromise[_0x67cd('0x8a')](_0x44bf95);})['then'](function(){return _0x3ac334;})[_0x67cd('0x21')](respondWithResult(_0x348a86,null))['catch'](handleError(_0x348a86,null));};exports[_0x67cd('0x8b')]=function(_0x5f0184,_0x478a7a,_0x5a30aa){return db[_0x67cd('0x29')]['find']({'where':{'id':_0x5f0184['params']['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x478a7a,null))[_0x67cd('0x21')](function(_0xf92096){if(_0xf92096){return _0xf92096[_0x67cd('0x8b')](_0x5f0184[_0x67cd('0x30')]['ids']);}})[_0x67cd('0x21')](function(_0x4f21db){if(_0x4f21db){return db[_0x67cd('0x59')][_0x67cd('0x22')]({'where':{'ListId':_0x5f0184[_0x67cd('0x30')][_0x67cd('0x65')],'CampaignId':_0x5f0184[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](function(){return _0x4f21db;});}})[_0x67cd('0x21')](respondWithStatusCode(_0x478a7a,null))[_0x67cd('0x43')](handleError(_0x478a7a,null));};exports[_0x67cd('0x8c')]=function(_0x36e2cd,_0x6ef969,_0x4091a7){var _0xbe2366={};var _0x507038={};var _0x49a160;var _0x16aa8f;return db['Campaign'][_0x67cd('0x58')]({'where':{'id':_0x36e2cd['params']['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x6ef969,null))['then'](function(_0x90992a){if(_0x90992a){_0x49a160=_0x90992a;_0x507038['model']=_[_0x67cd('0x31')](db[_0x67cd('0x8d')][_0x67cd('0x2a')]);_0x507038[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x36e2cd[_0x67cd('0x30')]);_0x507038[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x507038['model'],_0x507038[_0x67cd('0x30')]);_0xbe2366[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x507038[_0x67cd('0x2e')],qs['fields'](_0x36e2cd['query'][_0x67cd('0x45')]));_0xbe2366[_0x67cd('0x34')]=_0xbe2366['attributes']['length']?_0xbe2366['attributes']:_0x507038['model'];_0xbe2366[_0x67cd('0x37')]=qs[_0x67cd('0x38')](_0x36e2cd[_0x67cd('0x30')][_0x67cd('0x38')]);_0xbe2366['where']=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x36e2cd[_0x67cd('0x30')],_0x507038[_0x67cd('0x32')]));if(_0x36e2cd[_0x67cd('0x30')][_0x67cd('0x3d')]){_0xbe2366['where']=_[_0x67cd('0x3a')](_0xbe2366[_0x67cd('0x3b')],{'$or':_[_0x67cd('0x3c')](_0xbe2366[_0x67cd('0x34')],function(_0x268c32){var _0x206b85={};_0x206b85[_0x268c32]={'$like':'%'+_0x36e2cd[_0x67cd('0x30')][_0x67cd('0x3d')]+'%'};return _0x206b85;})});}_0xbe2366=_[_0x67cd('0x3a')]({},_0xbe2366,_0x36e2cd[_0x67cd('0x46')]);return _0x49a160[_0x67cd('0x8c')](_0xbe2366);}})[_0x67cd('0x21')](function(_0x4e2cbe){if(_0x4e2cbe){_0x16aa8f=_0x4e2cbe[_0x67cd('0x35')];if(!_0x36e2cd['query'][_0x67cd('0x5a')](_0x67cd('0x36'))){_0xbe2366[_0x67cd('0x1b')]=qs['limit'](_0x36e2cd[_0x67cd('0x30')][_0x67cd('0x1b')]);_0xbe2366[_0x67cd('0x19')]=qs[_0x67cd('0x19')](_0x36e2cd[_0x67cd('0x30')]['offset']);}return _0x49a160[_0x67cd('0x8c')](_0xbe2366);}})[_0x67cd('0x21')](function(_0x3d20d7){if(_0x3d20d7){return _0x3d20d7?{'count':_0x16aa8f,'rows':_0x3d20d7}:null;}})[_0x67cd('0x21')](respondWithResult(_0x6ef969,null))['catch'](handleError(_0x6ef969,null));};exports[_0x67cd('0x8e')]=function(_0x2d414c,_0x312f65,_0x336159){var _0x4b8be1,_0x5d8939;var _0x424470=[];var _0x2ad2ed=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign']['find']({'where':{'id':_0x2d414c[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x312f65,null))[_0x67cd('0x21')](function(_0x40b42e){if(_0x40b42e){_0x5d8939=_0x40b42e;return _0x40b42e[_0x67cd('0x8e')](_0x2d414c[_0x67cd('0x53')]['ids'],_[_0x67cd('0x54')](_0x2d414c[_0x67cd('0x53')],['ids','id'])||{});}return null;})[_0x67cd('0x66')](function(_0x369290){var _0x1580d4;var _0x82241;_0x4b8be1=_0x369290||[];var _0x3930f0=[];if(_0x369290){for(var _0x4bd0f1=0x0;_0x4bd0f1<_0x369290['length'];_0x4bd0f1+=0x1){var _0x459e17=_0x369290[_0x4bd0f1][_0x67cd('0x4b')]({'plain':!![]});_0x1580d4=squel[_0x67cd('0x7e')]()[_0x67cd('0x69')](_0x67cd('0x8f'))[_0x67cd('0x6a')](['phone',_0x67cd('0x70'),_0x67cd('0x6d'),'CampaignId',_0x67cd('0x51'),_0x67cd('0x52')],squel[_0x67cd('0x76')]()['field'](_0x67cd('0x6b'),_0x67cd('0x6b'))['field']('id','ContactId')[_0x67cd('0x6e')](_0x459e17[_0x67cd('0x71')][_0x67cd('0x72')](),_0x67cd('0x6d'))['field'](_0x2d414c[_0x67cd('0x44')]['id'][_0x67cd('0x72')](),'CampaignId')['field'](_0x67cd('0x6f'),_0x67cd('0x51'))[_0x67cd('0x6e')](_0x67cd('0x6f'),'updatedAt')[_0x67cd('0x78')](_0x67cd('0x7d'))[_0x67cd('0x3b')]('deletedAt\x20IS\x20NULL')[_0x67cd('0x3b')](_0x67cd('0x74'),_0x459e17[_0x67cd('0x71')][_0x67cd('0x72')]())[_0x67cd('0x3b')](_0x67cd('0x7c')))['toString']();_0x3930f0[_0x67cd('0x89')](db[_0x67cd('0x90')][_0x67cd('0x30')](_0x1580d4));}return BPromise[_0x67cd('0x8a')](_0x3930f0);}})[_0x67cd('0x21')](function(){return _0x4b8be1;})['then'](respondWithResult(_0x312f65,null))[_0x67cd('0x43')](handleError(_0x312f65,null));};exports[_0x67cd('0x91')]=function(_0x22b551,_0x103419,_0x1e1cc7){return db[_0x67cd('0x29')]['find']({'where':{'id':_0x22b551['params']['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x103419,null))[_0x67cd('0x21')](function(_0x45ecd7){if(_0x45ecd7){return _0x45ecd7[_0x67cd('0x91')](_0x22b551['query']['ids']);}})['then'](function(_0x3e6eea){if(_0x3e6eea){return db[_0x67cd('0x61')]['destroy']({'where':{'ListId':_0x22b551['query']['ids'],'CampaignId':_0x22b551[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](function(){return _0x3e6eea;});}})[_0x67cd('0x21')](respondWithStatusCode(_0x103419,null))[_0x67cd('0x43')](handleError(_0x103419,null));};
\ No newline at end of file
+var _0xd23d=['ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','omit','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','Campaign','findAll','rows','catch','show','params','rawAttributes','fields','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','createdAt','updatedAt','autoAssociation','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','cm_hopper','phone','scheduledAt','ContactId','field','CmListId','ListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','onlyIfOpen','into','fromQuery','NOW()','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','OrderBy','h.id'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0xd23d,0xa0));var _0xdd23=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0xd23d[_0x478c8a];return _0x3b6b3e;};'use strict';var emlformat=require(_0xdd23('0x0'));var rimraf=require(_0xdd23('0x1'));var zipdir=require(_0xdd23('0x2'));var jsonpatch=require(_0xdd23('0x3'));var rp=require(_0xdd23('0x4'));var moment=require(_0xdd23('0x5'));var BPromise=require(_0xdd23('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdd23('0x7'));var csv=require(_0xdd23('0x8'));var ejs=require(_0xdd23('0x9'));var fs=require('fs');var fs_extra=require(_0xdd23('0xa'));var _=require(_0xdd23('0xb'));var squel=require(_0xdd23('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdd23('0xd'));var toCsv=require(_0xdd23('0x8'));var querystring=require(_0xdd23('0xe'));var Papa=require(_0xdd23('0xf'));var Redis=require(_0xdd23('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdd23('0x11'));var as=require(_0xdd23('0x12'));var hardwareService=require(_0xdd23('0x13'));var logger=require('../../config/logger')(_0xdd23('0x14'));var utils=require(_0xdd23('0x15'));var config=require(_0xdd23('0x16'));var licenseUtil=require(_0xdd23('0x17'));var db=require(_0xdd23('0x18'))['db'];function respondWithStatusCode(_0x103a43,_0x1484d7){_0x1484d7=_0x1484d7||0xcc;return function(_0x1e4739){if(_0x1e4739){return _0x103a43[_0xdd23('0x19')](_0x1484d7);}return _0x103a43['status'](_0x1484d7)['end']();};}function respondWithResult(_0x294683,_0x27a280){_0x27a280=_0x27a280||0xc8;return function(_0x2f2869){if(_0x2f2869){return _0x294683['status'](_0x27a280)[_0xdd23('0x1a')](_0x2f2869);}};}function respondWithFilteredResult(_0x21f67a,_0x2abcd7){return function(_0x3743cf){if(_0x3743cf){var _0x5d0087=typeof _0x2abcd7[_0xdd23('0x1b')]===_0xdd23('0x1c')&&typeof _0x2abcd7[_0xdd23('0x1d')]===_0xdd23('0x1c');var _0x111e0f=_0x3743cf[_0xdd23('0x1e')];var _0x49d959=_0x5d0087?0x0:_0x2abcd7['offset'];var _0x7f3048=_0x5d0087?_0x3743cf[_0xdd23('0x1e')]:_0x2abcd7[_0xdd23('0x1b')]+_0x2abcd7[_0xdd23('0x1d')];var _0x3d2720;if(_0x7f3048>=_0x111e0f){_0x7f3048=_0x111e0f;_0x3d2720=0xc8;}else{_0x3d2720=0xce;}_0x21f67a[_0xdd23('0x1f')](_0x3d2720);return _0x21f67a[_0xdd23('0x20')](_0xdd23('0x21'),_0x49d959+'-'+_0x7f3048+'/'+_0x111e0f)[_0xdd23('0x1a')](_0x3743cf);}return null;};}function patchUpdates(_0x198059){return function(_0x7d557d){try{jsonpatch[_0xdd23('0x22')](_0x7d557d,_0x198059,!![]);}catch(_0x46056c){return BPromise['reject'](_0x46056c);}return _0x7d557d['save']();};}function saveUpdates(_0x4f53fa,_0x5b874b){return function(_0x4ee5e3){if(_0x4ee5e3){return _0x4ee5e3[_0xdd23('0x23')](_0x4f53fa)[_0xdd23('0x24')](function(_0x98a2be){return _0x98a2be;});}return null;};}function removeEntity(_0x151dd5,_0x65feab){return function(_0x15d80c){if(_0x15d80c){return _0x15d80c[_0xdd23('0x25')]()[_0xdd23('0x24')](function(){var _0x395b2e=_0x15d80c[_0xdd23('0x26')]({'plain':!![]});var _0x21834a=_0xdd23('0x27');return db[_0xdd23('0x28')][_0xdd23('0x25')]({'where':{'type':_0x21834a,'resourceId':_0x395b2e['id']}})['then'](function(){return _0x15d80c;});})['then'](function(){_0x151dd5[_0xdd23('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x300a79,_0x494640){return function(_0x4be3b3){if(!_0x4be3b3){_0x300a79[_0xdd23('0x19')](0x194);}return _0x4be3b3;};}function handleError(_0x3b6eee,_0x4ba8f6){_0x4ba8f6=_0x4ba8f6||0x1f4;return function(_0x25149e){logger[_0xdd23('0x29')](_0x25149e[_0xdd23('0x2a')]);if(_0x25149e['name']){delete _0x25149e[_0xdd23('0x2b')];}_0x3b6eee[_0xdd23('0x1f')](_0x4ba8f6)[_0xdd23('0x2c')](_0x25149e);};}exports[_0xdd23('0x2d')]=function(_0x2da49d,_0x1d3cfd){var _0x1bca59={},_0x46c432={},_0x4aa771={'count':0x0,'rows':[]};var _0x22a302=_[_0xdd23('0x2e')](db['Campaign']['rawAttributes'],function(_0x2f59f3){return{'name':_0x2f59f3['fieldName'],'type':_0x2f59f3[_0xdd23('0x2f')][_0xdd23('0x30')]};});_0x46c432[_0xdd23('0x31')]=_[_0xdd23('0x2e')](_0x22a302,_0xdd23('0x2b'));_0x46c432[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0x2da49d['query']);_0x46c432[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x46c432[_0xdd23('0x31')],_0x46c432[_0xdd23('0x32')]);_0x1bca59['attributes']=_[_0xdd23('0x35')](_0x46c432[_0xdd23('0x31')],qs['fields'](_0x2da49d[_0xdd23('0x32')]['fields']));_0x1bca59['attributes']=_0x1bca59[_0xdd23('0x36')]['length']?_0x1bca59[_0xdd23('0x36')]:_0x46c432[_0xdd23('0x31')];if(!_0x2da49d[_0xdd23('0x32')][_0xdd23('0x37')](_0xdd23('0x38'))){_0x1bca59['limit']=qs['limit'](_0x2da49d[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x1bca59[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x2da49d['query'][_0xdd23('0x1b')]);}_0x1bca59[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x2da49d[_0xdd23('0x32')]['sort']);_0x1bca59[_0xdd23('0x3b')]=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x2da49d[_0xdd23('0x32')],_0x46c432[_0xdd23('0x34')]),_0x22a302);if(_0x2da49d[_0xdd23('0x32')][_0xdd23('0x3d')]){_0x1bca59[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x1bca59[_0xdd23('0x3b')],{'$or':_['map'](_0x22a302,function(_0x1f64e2){if(_0x1f64e2[_0xdd23('0x2f')]!=='VIRTUAL'){var _0x7930a6={};_0x7930a6[_0x1f64e2[_0xdd23('0x2b')]]={'$like':'%'+_0x2da49d[_0xdd23('0x32')][_0xdd23('0x3d')]+'%'};return _0x7930a6;}})});}_0x1bca59=_['merge']({},_0x1bca59,_0x2da49d[_0xdd23('0x3f')]);var _0x4967f9={'where':_0x1bca59[_0xdd23('0x3b')]};return db['Campaign']['count'](_0x4967f9)['then'](function(_0x4b2024){_0x4aa771[_0xdd23('0x1e')]=_0x4b2024;if(_0x2da49d[_0xdd23('0x32')][_0xdd23('0x40')]){_0x1bca59['include']=[{'all':!![]}];}return db[_0xdd23('0x41')][_0xdd23('0x42')](_0x1bca59);})[_0xdd23('0x24')](function(_0x32cb33){_0x4aa771[_0xdd23('0x43')]=_0x32cb33;return _0x4aa771;})[_0xdd23('0x24')](respondWithFilteredResult(_0x1d3cfd,_0x1bca59))[_0xdd23('0x44')](handleError(_0x1d3cfd,null));};exports[_0xdd23('0x45')]=function(_0x2f6d90,_0x3075a1){var _0x2fd6f9={'raw':![],'where':{'id':_0x2f6d90[_0xdd23('0x46')]['id']}},_0x59a7de={};_0x59a7de[_0xdd23('0x31')]=_[_0xdd23('0x33')](db[_0xdd23('0x41')][_0xdd23('0x47')]);_0x59a7de[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0x2f6d90[_0xdd23('0x32')]);_0x59a7de[_0xdd23('0x34')]=_['intersection'](_0x59a7de['model'],_0x59a7de['query']);_0x2fd6f9[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x59a7de[_0xdd23('0x31')],qs[_0xdd23('0x48')](_0x2f6d90['query'][_0xdd23('0x48')]));_0x2fd6f9[_0xdd23('0x36')]=_0x2fd6f9[_0xdd23('0x36')][_0xdd23('0x49')]?_0x2fd6f9[_0xdd23('0x36')]:_0x59a7de['model'];if(_0x2f6d90[_0xdd23('0x32')][_0xdd23('0x40')]){_0x2fd6f9['include']=[{'all':!![]}];}_0x2fd6f9=_[_0xdd23('0x3e')]({},_0x2fd6f9,_0x2f6d90['options']);return db[_0xdd23('0x41')][_0xdd23('0x4a')](_0x2fd6f9)[_0xdd23('0x24')](handleEntityNotFound(_0x3075a1,null))['then'](respondWithResult(_0x3075a1,null))['catch'](handleError(_0x3075a1,null));};exports[_0xdd23('0x4b')]=function(_0x411e2f,_0x298a17){return db[_0xdd23('0x41')][_0xdd23('0x4b')](_0x411e2f[_0xdd23('0x4c')],{})[_0xdd23('0x24')](function(_0x300c1a){var _0x409339=_0x411e2f['user'][_0xdd23('0x26')]({'plain':!![]});if(!_0x409339)throw new Error(_0xdd23('0x4d'));if(_0x409339[_0xdd23('0x4e')]===_0xdd23('0x4f')){var _0x51aaee=_0x300c1a[_0xdd23('0x26')]({'plain':!![]});var _0x3a9039=_0xdd23('0x27');return db[_0xdd23('0x50')][_0xdd23('0x4a')]({'where':{'name':_0x3a9039,'userProfileId':_0x409339[_0xdd23('0x51')]},'raw':!![]})['then'](function(_0x4f2b2f){if(_0x4f2b2f&&_0x4f2b2f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x51aaee['name'],'resourceId':_0x51aaee['id'],'type':_0x4f2b2f[_0xdd23('0x2b')],'sectionId':_0x4f2b2f['id']},{})[_0xdd23('0x24')](function(){return _0x300c1a;});}else{return _0x300c1a;}})['catch'](function(_0x4b3020){logger[_0xdd23('0x29')](_0xdd23('0x52'),_0x4b3020);throw _0x4b3020;});}return _0x300c1a;})[_0xdd23('0x24')](respondWithResult(_0x298a17,0xc9))[_0xdd23('0x44')](handleError(_0x298a17,null));};exports[_0xdd23('0x53')]=function(_0x1eb8a8,_0x3c8caf){var _0x1f4552={'where':{'id':_0x1eb8a8[_0xdd23('0x46')]['id']}},_0x153111={};_0x153111[_0xdd23('0x31')]=_[_0xdd23('0x33')](db[_0xdd23('0x41')]['rawAttributes']);_0x1f4552[_0xdd23('0x36')]=_['intersection'](_0x153111[_0xdd23('0x31')],qs['fields'](_0x1eb8a8[_0xdd23('0x32')][_0xdd23('0x48')]));_0x1f4552[_0xdd23('0x36')]=_0x1f4552[_0xdd23('0x36')][_0xdd23('0x49')]?_0x1f4552[_0xdd23('0x36')]:_0x153111[_0xdd23('0x31')];if(_0x1eb8a8[_0xdd23('0x32')][_0xdd23('0x40')]){_0x1f4552[_0xdd23('0x54')]=[{'all':!![]}];}_0x1f4552=_[_0xdd23('0x3e')]({},_0x1f4552,_0x1eb8a8[_0xdd23('0x3f')]);return db[_0xdd23('0x41')][_0xdd23('0x4a')](_0x1f4552)[_0xdd23('0x24')](handleEntityNotFound(_0x3c8caf,null))[_0xdd23('0x24')](function(_0x437432){if(_0x437432){var _0x44344e=_0x437432[_0xdd23('0x26')]({'plain':!![]});_0x44344e=qs['omit'](_0x44344e,['id',_0xdd23('0x55'),'updatedAt']);_0x1eb8a8[_0xdd23('0x4c')]=_['omit'](_0x1eb8a8[_0xdd23('0x4c')],['id',_0xdd23('0x55'),_0xdd23('0x56')]);return db[_0xdd23('0x41')][_0xdd23('0x4b')](_[_0xdd23('0x3e')](_0x44344e,_0x1eb8a8[_0xdd23('0x4c')]),{'include':_0x1eb8a8[_0xdd23('0x32')][_0xdd23('0x40')]?[{'all':!![]}]:undefined})[_0xdd23('0x24')](function(_0x37ed33){var _0x5e16b0=_0x1eb8a8[_0xdd23('0x4f')][_0xdd23('0x26')]({'plain':!![]});if(!_0x5e16b0)throw new Error(_0xdd23('0x4d'));if(_0x5e16b0[_0xdd23('0x4e')]===_0xdd23('0x4f')){var _0x235af3=_0x37ed33['get']({'plain':!![]});var _0x430ecf='IvrCampaigns';return db[_0xdd23('0x50')][_0xdd23('0x4a')]({'where':{'name':_0x430ecf,'userProfileId':_0x5e16b0[_0xdd23('0x51')]},'raw':!![]})[_0xdd23('0x24')](function(_0x34ab17){if(_0x34ab17&&_0x34ab17[_0xdd23('0x57')]===0x0){return db['UserProfileResource'][_0xdd23('0x4b')]({'name':_0x235af3[_0xdd23('0x2b')],'resourceId':_0x235af3['id'],'type':_0x34ab17['name'],'sectionId':_0x34ab17['id']},{})[_0xdd23('0x24')](function(){return _0x37ed33;});}else{return _0x37ed33;}})['catch'](function(_0x40eca1){logger[_0xdd23('0x29')](_0xdd23('0x52'),_0x40eca1);throw _0x40eca1;});}return _0x37ed33;});}})[_0xdd23('0x24')](respondWithResult(_0x3c8caf,0xc9))[_0xdd23('0x44')](handleError(_0x3c8caf,null));};exports[_0xdd23('0x23')]=function(_0x1aebe8,_0x516705){if(_0x1aebe8[_0xdd23('0x4c')]['id']){delete _0x1aebe8['body']['id'];}return db['Campaign'][_0xdd23('0x4a')]({'where':{'id':_0x1aebe8[_0xdd23('0x46')]['id']}})['then'](handleEntityNotFound(_0x516705,null))[_0xdd23('0x24')](saveUpdates(_0x1aebe8[_0xdd23('0x4c')],null))['then'](respondWithResult(_0x516705,null))['catch'](handleError(_0x516705,null));};exports[_0xdd23('0x25')]=function(_0x3c7e07,_0x4b84b3){return db[_0xdd23('0x41')]['find']({'where':{'id':_0x3c7e07[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x4b84b3,null))[_0xdd23('0x24')](removeEntity(_0x4b84b3,null))[_0xdd23('0x44')](handleError(_0x4b84b3,null));};exports[_0xdd23('0x58')]=function(_0xf90c83,_0x3d214d,_0x405edc){var _0x4bdcef={'raw':!![],'where':{}};var _0x5581b6={};var _0x4fc65c={'count':0x0,'rows':[]};return db[_0xdd23('0x41')][_0xdd23('0x59')]({'where':{'id':_0xf90c83[_0xdd23('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d214d,null))[_0xdd23('0x24')](function(_0xac8e67){if(_0xac8e67){_0x5581b6[_0xdd23('0x31')]=_[_0xdd23('0x33')](db['CmHopper'][_0xdd23('0x47')]);_0x5581b6[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0xf90c83[_0xdd23('0x32')]);_0x5581b6[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x5581b6[_0xdd23('0x31')],_0x5581b6['query']);_0x4bdcef[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x5581b6['model'],qs[_0xdd23('0x48')](_0xf90c83[_0xdd23('0x32')][_0xdd23('0x48')]));_0x4bdcef['attributes']=_0x4bdcef[_0xdd23('0x36')][_0xdd23('0x49')]?_0x4bdcef[_0xdd23('0x36')]:_0x5581b6[_0xdd23('0x31')];if(!_0xf90c83[_0xdd23('0x32')][_0xdd23('0x37')](_0xdd23('0x38'))){_0x4bdcef['limit']=qs['limit'](_0xf90c83[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x4bdcef[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0xf90c83['query'][_0xdd23('0x1b')]);}_0x4bdcef[_0xdd23('0x39')]=qs['sort'](_0xf90c83[_0xdd23('0x32')][_0xdd23('0x3a')]);_0x4bdcef[_0xdd23('0x3b')]=qs['filters'](_[_0xdd23('0x3c')](_0xf90c83[_0xdd23('0x32')],_0x5581b6['filters']));_0x4bdcef['where'][_0xdd23('0x5a')]=_0xac8e67['id'];if(_0xf90c83[_0xdd23('0x32')][_0xdd23('0x3d')]){_0x4bdcef[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x4bdcef[_0xdd23('0x3b')],{'$or':_[_0xdd23('0x2e')](_0x4bdcef['attributes'],function(_0x1b32d5){var _0x4816f2={};_0x4816f2[_0x1b32d5]={'$like':'%'+_0xf90c83[_0xdd23('0x32')]['filter']+'%'};return _0x4816f2;})});}_0x4bdcef=_[_0xdd23('0x3e')]({},_0x4bdcef,_0xf90c83[_0xdd23('0x3f')]);return db['CmHopper']['count']({'where':_0x4bdcef[_0xdd23('0x3b')]})[_0xdd23('0x24')](function(_0x40307d){_0x4fc65c[_0xdd23('0x1e')]=_0x40307d;if(_0xf90c83[_0xdd23('0x32')]['includeAll']){_0x4bdcef[_0xdd23('0x54')]=[{'all':!![]}];}return db[_0xdd23('0x5b')][_0xdd23('0x42')](_0x4bdcef);})[_0xdd23('0x24')](function(_0x10b29a){_0x4fc65c['rows']=_0x10b29a;return _0x4fc65c;});}})[_0xdd23('0x24')](respondWithFilteredResult(_0x3d214d,_0x4bdcef))[_0xdd23('0x44')](handleError(_0x3d214d,null));};exports[_0xdd23('0x5c')]=function(_0x5684cf,_0x54d366,_0x1d277e){var _0x4a2491={'raw':!![],'where':{}};var _0x156108={};var _0x5925b9={'count':0x0,'rows':[]};return db['Campaign'][_0xdd23('0x59')]({'where':{'id':_0x5684cf[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x54d366,null))[_0xdd23('0x24')](function(_0x533e64){if(_0x533e64){_0x156108[_0xdd23('0x31')]=_[_0xdd23('0x33')](db['CmHopperHistory'][_0xdd23('0x47')]);_0x156108[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0x5684cf['query']);_0x156108[_0xdd23('0x34')]=_['intersection'](_0x156108[_0xdd23('0x31')],_0x156108[_0xdd23('0x32')]);_0x4a2491[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x156108['model'],qs[_0xdd23('0x48')](_0x5684cf['query'][_0xdd23('0x48')]));_0x4a2491[_0xdd23('0x36')]=_0x4a2491[_0xdd23('0x36')][_0xdd23('0x49')]?_0x4a2491[_0xdd23('0x36')]:_0x156108[_0xdd23('0x31')];if(!_0x5684cf[_0xdd23('0x32')][_0xdd23('0x37')](_0xdd23('0x38'))){_0x4a2491[_0xdd23('0x1d')]=qs[_0xdd23('0x1d')](_0x5684cf[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x4a2491[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x5684cf['query']['offset']);}_0x4a2491[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x5684cf['query'][_0xdd23('0x3a')]);_0x4a2491[_0xdd23('0x3b')]=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x5684cf[_0xdd23('0x32')],_0x156108[_0xdd23('0x34')]));_0x4a2491[_0xdd23('0x3b')][_0xdd23('0x5a')]=_0x533e64['id'];if(_0x5684cf[_0xdd23('0x32')]['filter']){_0x4a2491[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x4a2491[_0xdd23('0x3b')],{'$or':_['map'](_0x4a2491[_0xdd23('0x36')],function(_0x4f963e){var _0x5e1fd6={};_0x5e1fd6[_0x4f963e]={'$like':'%'+_0x5684cf[_0xdd23('0x32')]['filter']+'%'};return _0x5e1fd6;})});}_0x4a2491=_[_0xdd23('0x3e')]({},_0x4a2491,_0x5684cf['options']);return db[_0xdd23('0x5d')][_0xdd23('0x1e')]({'where':_0x4a2491[_0xdd23('0x3b')]})[_0xdd23('0x24')](function(_0x19f38c){_0x5925b9[_0xdd23('0x1e')]=_0x19f38c;if(_0x5684cf[_0xdd23('0x32')][_0xdd23('0x40')]){_0x4a2491[_0xdd23('0x54')]=[{'all':!![]}];}return db[_0xdd23('0x5d')][_0xdd23('0x42')](_0x4a2491);})['then'](function(_0x419803){_0x5925b9[_0xdd23('0x43')]=_0x419803;return _0x5925b9;});}})[_0xdd23('0x24')](respondWithFilteredResult(_0x54d366,_0x4a2491))['catch'](handleError(_0x54d366,null));};exports[_0xdd23('0x5e')]=function(_0x384c50,_0xcf2142,_0x5605d7){var _0x4144c5={'raw':!![],'where':{}};var _0x5d1146={};var _0x28a07e={'count':0x0,'rows':[]};return db[_0xdd23('0x41')][_0xdd23('0x59')]({'where':{'id':_0x384c50['params']['id']}})['then'](handleEntityNotFound(_0xcf2142,null))['then'](function(_0x9ef648){if(_0x9ef648){_0x5d1146['model']=_[_0xdd23('0x33')](db['CmHopperFinal'][_0xdd23('0x47')]);_0x5d1146['query']=_[_0xdd23('0x33')](_0x384c50[_0xdd23('0x32')]);_0x5d1146[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x5d1146['model'],_0x5d1146[_0xdd23('0x32')]);_0x4144c5[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x5d1146['model'],qs['fields'](_0x384c50[_0xdd23('0x32')]['fields']));_0x4144c5['attributes']=_0x4144c5[_0xdd23('0x36')][_0xdd23('0x49')]?_0x4144c5[_0xdd23('0x36')]:_0x5d1146['model'];if(!_0x384c50[_0xdd23('0x32')][_0xdd23('0x37')](_0xdd23('0x38'))){_0x4144c5[_0xdd23('0x1d')]=qs['limit'](_0x384c50[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x4144c5[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x384c50[_0xdd23('0x32')][_0xdd23('0x1b')]);}_0x4144c5['order']=qs[_0xdd23('0x3a')](_0x384c50[_0xdd23('0x32')][_0xdd23('0x3a')]);_0x4144c5['where']=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x384c50[_0xdd23('0x32')],_0x5d1146[_0xdd23('0x34')]));_0x4144c5[_0xdd23('0x3b')][_0xdd23('0x5a')]=_0x9ef648['id'];if(_0x384c50['query'][_0xdd23('0x3d')]){_0x4144c5[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x4144c5[_0xdd23('0x3b')],{'$or':_[_0xdd23('0x2e')](_0x4144c5['attributes'],function(_0x18c8e8){var _0x382975={};_0x382975[_0x18c8e8]={'$like':'%'+_0x384c50['query'][_0xdd23('0x3d')]+'%'};return _0x382975;})});}_0x4144c5=_[_0xdd23('0x3e')]({},_0x4144c5,_0x384c50[_0xdd23('0x3f')]);return db[_0xdd23('0x5f')][_0xdd23('0x1e')]({'where':_0x4144c5[_0xdd23('0x3b')]})['then'](function(_0x2fdf72){_0x28a07e[_0xdd23('0x1e')]=_0x2fdf72;if(_0x384c50['query'][_0xdd23('0x40')]){_0x4144c5[_0xdd23('0x54')]=[{'all':!![]}];}return db[_0xdd23('0x5f')]['findAll'](_0x4144c5);})['then'](function(_0x55e784){_0x28a07e[_0xdd23('0x43')]=_0x55e784;return _0x28a07e;});}})[_0xdd23('0x24')](respondWithFilteredResult(_0xcf2142,_0x4144c5))[_0xdd23('0x44')](handleError(_0xcf2142,null));};exports[_0xdd23('0x60')]=function(_0x4c1f07,_0x516bfe,_0x44353a){var _0xa92e0f={'raw':!![],'where':{}};var _0xca94e7={};var _0xf9054={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4c1f07[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x516bfe,null))['then'](function(_0xe88418){if(_0xe88418){_0xca94e7['model']=_[_0xdd23('0x33')](db[_0xdd23('0x61')]['rawAttributes']);_0xca94e7[_0xdd23('0x32')]=_['keys'](_0x4c1f07['query']);_0xca94e7['filters']=_[_0xdd23('0x35')](_0xca94e7[_0xdd23('0x31')],_0xca94e7['query']);_0xa92e0f[_0xdd23('0x36')]=_['intersection'](_0xca94e7[_0xdd23('0x31')],qs[_0xdd23('0x48')](_0x4c1f07['query'][_0xdd23('0x48')]));_0xa92e0f['attributes']=_0xa92e0f[_0xdd23('0x36')][_0xdd23('0x49')]?_0xa92e0f[_0xdd23('0x36')]:_0xca94e7[_0xdd23('0x31')];if(!_0x4c1f07[_0xdd23('0x32')]['hasOwnProperty'](_0xdd23('0x38'))){_0xa92e0f[_0xdd23('0x1d')]=qs[_0xdd23('0x1d')](_0x4c1f07[_0xdd23('0x32')][_0xdd23('0x1d')]);_0xa92e0f[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x4c1f07['query'][_0xdd23('0x1b')]);}_0xa92e0f[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x4c1f07[_0xdd23('0x32')]['sort']);_0xa92e0f[_0xdd23('0x3b')]=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x4c1f07[_0xdd23('0x32')],_0xca94e7[_0xdd23('0x34')]));_0xa92e0f[_0xdd23('0x3b')][_0xdd23('0x5a')]=_0xe88418['id'];if(_0x4c1f07[_0xdd23('0x32')][_0xdd23('0x3d')]){_0xa92e0f['where']=_[_0xdd23('0x3e')](_0xa92e0f[_0xdd23('0x3b')],{'$or':_['map'](_0xa92e0f[_0xdd23('0x36')],function(_0x3a0a98){var _0x35c7ec={};_0x35c7ec[_0x3a0a98]={'$like':'%'+_0x4c1f07['query'][_0xdd23('0x3d')]+'%'};return _0x35c7ec;})});}_0xa92e0f=_['merge']({},_0xa92e0f,_0x4c1f07[_0xdd23('0x3f')]);return db['CmHopperBlack'][_0xdd23('0x1e')]({'where':_0xa92e0f[_0xdd23('0x3b')]})[_0xdd23('0x24')](function(_0x319c68){_0xf9054[_0xdd23('0x1e')]=_0x319c68;if(_0x4c1f07['query'][_0xdd23('0x40')]){_0xa92e0f[_0xdd23('0x54')]=[{'all':!![]}];}return db[_0xdd23('0x61')][_0xdd23('0x42')](_0xa92e0f);})[_0xdd23('0x24')](function(_0x278dbe){_0xf9054[_0xdd23('0x43')]=_0x278dbe;return _0xf9054;});}})['then'](respondWithFilteredResult(_0x516bfe,_0xa92e0f))[_0xdd23('0x44')](handleError(_0x516bfe,null));};exports[_0xdd23('0x62')]=function(_0x20d298,_0xd76c54,_0x3aa381){var _0x2d05fc={};var _0x52501a={};var _0x5112ee;var _0x10bbeb;return db[_0xdd23('0x41')][_0xdd23('0x59')]({'where':{'id':_0x20d298[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0xd76c54,null))[_0xdd23('0x24')](function(_0x4dc0a6){if(_0x4dc0a6){_0x5112ee=_0x4dc0a6;_0x52501a['model']=_['keys'](db[_0xdd23('0x63')]['rawAttributes']);_0x52501a[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0x20d298['query']);_0x52501a[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x52501a['model'],_0x52501a[_0xdd23('0x32')]);_0x2d05fc[_0xdd23('0x36')]=_['intersection'](_0x52501a[_0xdd23('0x31')],qs[_0xdd23('0x48')](_0x20d298[_0xdd23('0x32')][_0xdd23('0x48')]));_0x2d05fc['attributes']=_0x2d05fc[_0xdd23('0x36')][_0xdd23('0x49')]?_0x2d05fc[_0xdd23('0x36')]:_0x52501a[_0xdd23('0x31')];_0x2d05fc[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x20d298[_0xdd23('0x32')][_0xdd23('0x3a')]);_0x2d05fc['where']=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x20d298[_0xdd23('0x32')],_0x52501a[_0xdd23('0x34')]));if(_0x20d298[_0xdd23('0x32')]['filter']){_0x2d05fc[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x2d05fc[_0xdd23('0x3b')],{'$or':_['map'](_0x2d05fc[_0xdd23('0x36')],function(_0x2b0d8d){var _0x56486c={};_0x56486c[_0x2b0d8d]={'$like':'%'+_0x20d298[_0xdd23('0x32')][_0xdd23('0x3d')]+'%'};return _0x56486c;})});}_0x2d05fc=_[_0xdd23('0x3e')]({},_0x2d05fc,_0x20d298[_0xdd23('0x3f')]);return _0x5112ee[_0xdd23('0x62')](_0x2d05fc);}})[_0xdd23('0x24')](function(_0x3c28c1){if(_0x3c28c1){_0x10bbeb=_0x3c28c1[_0xdd23('0x49')];if(!_0x20d298[_0xdd23('0x32')][_0xdd23('0x37')]('nolimit')){_0x2d05fc[_0xdd23('0x1d')]=qs[_0xdd23('0x1d')](_0x20d298[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x2d05fc[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x20d298[_0xdd23('0x32')][_0xdd23('0x1b')]);}return _0x5112ee[_0xdd23('0x62')](_0x2d05fc);}})[_0xdd23('0x24')](function(_0x1f2d3a){if(_0x1f2d3a){return _0x1f2d3a?{'count':_0x10bbeb,'rows':_0x1f2d3a}:null;}})[_0xdd23('0x24')](respondWithResult(_0xd76c54,null))[_0xdd23('0x44')](handleError(_0xd76c54,null));};exports[_0xdd23('0x64')]=function(_0x422272,_0x52710b,_0x28ce54){var _0x2026e3,_0x366598;var _0x3b2fc=[];var _0x71b74=moment()[_0xdd23('0x65')](_0xdd23('0x66'));return db[_0xdd23('0x41')][_0xdd23('0x4a')]({'where':{'id':_0x422272[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x52710b,null))['then'](function(_0x1bfe43){if(_0x1bfe43){_0x366598=_0x1bfe43;return _0x1bfe43['addLists'](_0x422272[_0xdd23('0x4c')][_0xdd23('0x67')],_['omit'](_0x422272['body'],[_0xdd23('0x67'),'id'])||{});}return null;})[_0xdd23('0x68')](function(_0x386362){var _0x567587;var _0x4ad48e;_0x2026e3=_0x386362||[];var _0x19cb65=[];if(_0x386362){for(var _0x2b8b32=0x0;_0x2b8b32<_0x386362[_0xdd23('0x49')];_0x2b8b32+=0x1){var _0x11e198=_0x386362[_0x2b8b32]['get']({'plain':!![]});_0x366598['dialCheckDuplicateType']=_0x422272[_0xdd23('0x4c')][_0xdd23('0x69')]?_0x422272[_0xdd23('0x4c')]['dialCheckDuplicateType']:_0x366598[_0xdd23('0x69')];switch(_0x366598[_0xdd23('0x69')]){case'always':_0x567587=squel[_0xdd23('0x6a')]()['into'](_0xdd23('0x6b'))['fromQuery']([_0xdd23('0x6c'),_0xdd23('0x6d'),_0xdd23('0x6e'),'ListId','CampaignId',_0xdd23('0x55'),_0xdd23('0x56')],squel['select']()[_0xdd23('0x6f')]('phone','phone')[_0xdd23('0x6f')]('NOW()',_0xdd23('0x6d'))[_0xdd23('0x6f')]('id',_0xdd23('0x6e'))['field'](_0x11e198[_0xdd23('0x70')]['toString'](),_0xdd23('0x71'))[_0xdd23('0x6f')](_0x422272[_0xdd23('0x46')]['id'][_0xdd23('0x72')](),_0xdd23('0x5a'))[_0xdd23('0x6f')]('\x27'+_0x71b74+'\x27','createdAt')['field']('\x27'+_0x71b74+'\x27',_0xdd23('0x56'))['from'](_0xdd23('0x73'))[_0xdd23('0x3b')](_0xdd23('0x74'))[_0xdd23('0x3b')](_0xdd23('0x75'),_0x11e198['CmListId'][_0xdd23('0x72')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xdd23('0x76'),squel[_0xdd23('0x77')]()[_0xdd23('0x6f')](_0xdd23('0x78'))[_0xdd23('0x79')]('cm_hopper_final')[_0xdd23('0x3b')](_0xdd23('0x7a'),_0x422272[_0xdd23('0x46')]['id'][_0xdd23('0x72')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xdd23('0x77')]()[_0xdd23('0x6f')]('COALESCE(phone,\x27\x27)')[_0xdd23('0x79')](_0xdd23('0x6b'))[_0xdd23('0x3b')]('CampaignId\x20=\x20?',_0x422272['params']['id']['toString']())))[_0xdd23('0x72')]();break;case _0xdd23('0x7b'):_0x567587=squel[_0xdd23('0x6a')]()[_0xdd23('0x7c')](_0xdd23('0x6b'))[_0xdd23('0x7d')](['phone','scheduledAt','ContactId',_0xdd23('0x71'),_0xdd23('0x5a'),'createdAt',_0xdd23('0x56')],squel[_0xdd23('0x77')]()[_0xdd23('0x6f')](_0xdd23('0x6c'),'phone')[_0xdd23('0x6f')](_0xdd23('0x7e'),_0xdd23('0x6d'))[_0xdd23('0x6f')]('id','ContactId')[_0xdd23('0x6f')](_0x11e198[_0xdd23('0x70')][_0xdd23('0x72')](),'ListId')['field'](_0x422272[_0xdd23('0x46')]['id']['toString'](),'CampaignId')[_0xdd23('0x6f')]('\x27'+_0x71b74+'\x27',_0xdd23('0x55'))[_0xdd23('0x6f')]('\x27'+_0x71b74+'\x27',_0xdd23('0x56'))['from'](_0xdd23('0x73'))[_0xdd23('0x3b')](_0xdd23('0x74'))[_0xdd23('0x3b')](_0xdd23('0x75'),_0x11e198[_0xdd23('0x70')][_0xdd23('0x72')]())[_0xdd23('0x3b')](_0xdd23('0x7f'))['where'](_0xdd23('0x76'),squel[_0xdd23('0x77')]()[_0xdd23('0x6f')](_0xdd23('0x80'))[_0xdd23('0x79')]('cm_hopper')['where'](_0xdd23('0x7a'),_0x422272['params']['id'][_0xdd23('0x72')]())))[_0xdd23('0x72')]();break;default:_0x567587=squel[_0xdd23('0x6a')]()[_0xdd23('0x7c')](_0xdd23('0x6b'))[_0xdd23('0x7d')](['phone',_0xdd23('0x6d'),_0xdd23('0x6e'),_0xdd23('0x71'),_0xdd23('0x5a'),_0xdd23('0x55'),_0xdd23('0x56')],squel[_0xdd23('0x77')]()[_0xdd23('0x6f')](_0xdd23('0x6c'),'phone')[_0xdd23('0x6f')](_0xdd23('0x7e'),_0xdd23('0x6d'))[_0xdd23('0x6f')]('id',_0xdd23('0x6e'))[_0xdd23('0x6f')](_0x11e198[_0xdd23('0x70')][_0xdd23('0x72')](),_0xdd23('0x71'))[_0xdd23('0x6f')](_0x422272[_0xdd23('0x46')]['id'][_0xdd23('0x72')](),_0xdd23('0x5a'))[_0xdd23('0x6f')]('\x27'+_0x71b74+'\x27','createdAt')['field']('\x27'+_0x71b74+'\x27','updatedAt')['from'](_0xdd23('0x73'))[_0xdd23('0x3b')](_0xdd23('0x74'))[_0xdd23('0x3b')](_0xdd23('0x75'),_0x11e198[_0xdd23('0x70')]['toString']())['where'](_0xdd23('0x7f')))[_0xdd23('0x72')]();}_0x4ad48e=squel[_0xdd23('0x6a')]()[_0xdd23('0x7c')](_0xdd23('0x81'))[_0xdd23('0x7d')](['cmHopperId',_0xdd23('0x6d'),_0xdd23('0x6c'),_0xdd23('0x82'),'createdAt',_0xdd23('0x56')],squel[_0xdd23('0x77')]()['field'](_0xdd23('0x83'),'id')[_0xdd23('0x6f')](_0xdd23('0x7e'),'scheduledAt')[_0xdd23('0x6f')]('ci.item',_0xdd23('0x6c'))[_0xdd23('0x6f')](_0xdd23('0x84'),_0xdd23('0x82'))['field']('\x27'+_0x71b74+'\x27','createdAt')['field']('\x27'+_0x71b74+'\x27',_0xdd23('0x56'))[_0xdd23('0x79')]('cm_contact_has_items','ci')['join'](_0xdd23('0x6b'),'h',_0xdd23('0x85'))[_0xdd23('0x3b')](_0xdd23('0x86'),_0x11e198[_0xdd23('0x70')][_0xdd23('0x72')]())[_0xdd23('0x3b')](_0xdd23('0x87'),_0x422272['params']['id']['toString']())[_0xdd23('0x3b')](_0xdd23('0x88'),_0x71b74))[_0xdd23('0x72')]();_0x19cb65[_0xdd23('0x89')](db[_0xdd23('0x8a')]['query'](_0x567587));_0x3b2fc[_0xdd23('0x89')](db[_0xdd23('0x8a')]['query'](_0x4ad48e));}return BPromise[_0xdd23('0x8b')](_0x19cb65);}})[_0xdd23('0x24')](function(){return BPromise[_0xdd23('0x8b')](_0x3b2fc);})[_0xdd23('0x24')](function(){return _0x2026e3;})[_0xdd23('0x24')](respondWithResult(_0x52710b,null))[_0xdd23('0x44')](handleError(_0x52710b,null));};exports[_0xdd23('0x8c')]=function(_0x57da4f,_0x55f2b1,_0x5ef3d3){return db[_0xdd23('0x41')][_0xdd23('0x4a')]({'where':{'id':_0x57da4f['params']['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x55f2b1,null))[_0xdd23('0x24')](function(_0x49aaed){if(_0x49aaed){return _0x49aaed[_0xdd23('0x8c')](_0x57da4f['query'][_0xdd23('0x67')]);}})[_0xdd23('0x24')](function(_0x2e56f3){if(_0x2e56f3){return db['CmHopper']['destroy']({'where':{'ListId':_0x57da4f[_0xdd23('0x32')][_0xdd23('0x67')],'CampaignId':_0x57da4f['params']['id']}})[_0xdd23('0x24')](function(){return _0x2e56f3;});}})['then'](respondWithStatusCode(_0x55f2b1,null))['catch'](handleError(_0x55f2b1,null));};exports[_0xdd23('0x8d')]=function(_0x5e9b6c,_0x34ae36,_0x133cc3){var _0x163d5a={};var _0x285fd9={};var _0x489c29;var _0x1e15fc;return db[_0xdd23('0x41')][_0xdd23('0x59')]({'where':{'id':_0x5e9b6c['params']['id']}})['then'](handleEntityNotFound(_0x34ae36,null))[_0xdd23('0x24')](function(_0x3c2965){if(_0x3c2965){_0x489c29=_0x3c2965;_0x285fd9[_0xdd23('0x31')]=_[_0xdd23('0x33')](db[_0xdd23('0x63')]['rawAttributes']);_0x285fd9[_0xdd23('0x32')]=_['keys'](_0x5e9b6c[_0xdd23('0x32')]);_0x285fd9[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x285fd9[_0xdd23('0x31')],_0x285fd9['query']);_0x163d5a[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x285fd9[_0xdd23('0x31')],qs[_0xdd23('0x48')](_0x5e9b6c['query']['fields']));_0x163d5a[_0xdd23('0x36')]=_0x163d5a[_0xdd23('0x36')][_0xdd23('0x49')]?_0x163d5a[_0xdd23('0x36')]:_0x285fd9[_0xdd23('0x31')];_0x163d5a[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x5e9b6c[_0xdd23('0x32')][_0xdd23('0x3a')]);_0x163d5a[_0xdd23('0x3b')]=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x5e9b6c[_0xdd23('0x32')],_0x285fd9[_0xdd23('0x34')]));if(_0x5e9b6c[_0xdd23('0x32')][_0xdd23('0x3d')]){_0x163d5a[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x163d5a[_0xdd23('0x3b')],{'$or':_['map'](_0x163d5a['attributes'],function(_0x23e241){var _0xfa10aa={};_0xfa10aa[_0x23e241]={'$like':'%'+_0x5e9b6c[_0xdd23('0x32')][_0xdd23('0x3d')]+'%'};return _0xfa10aa;})});}_0x163d5a=_['merge']({},_0x163d5a,_0x5e9b6c[_0xdd23('0x3f')]);return _0x489c29['getBlackLists'](_0x163d5a);}})[_0xdd23('0x24')](function(_0x256464){if(_0x256464){_0x1e15fc=_0x256464[_0xdd23('0x49')];if(!_0x5e9b6c['query'][_0xdd23('0x37')](_0xdd23('0x38'))){_0x163d5a[_0xdd23('0x1d')]=qs[_0xdd23('0x1d')](_0x5e9b6c[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x163d5a[_0xdd23('0x1b')]=qs['offset'](_0x5e9b6c['query'][_0xdd23('0x1b')]);}return _0x489c29['getBlackLists'](_0x163d5a);}})[_0xdd23('0x24')](function(_0x5eb022){if(_0x5eb022){return _0x5eb022?{'count':_0x1e15fc,'rows':_0x5eb022}:null;}})[_0xdd23('0x24')](respondWithResult(_0x34ae36,null))[_0xdd23('0x44')](handleError(_0x34ae36,null));};exports[_0xdd23('0x8e')]=function(_0x254bc3,_0x359f29,_0x321478){var _0x86a25d,_0x553764;var _0x38b37c=[];var _0x17a30f=moment()[_0xdd23('0x65')](_0xdd23('0x66'));return db[_0xdd23('0x41')][_0xdd23('0x4a')]({'where':{'id':_0x254bc3['params']['id']}})['then'](handleEntityNotFound(_0x359f29,null))[_0xdd23('0x24')](function(_0x5caec4){if(_0x5caec4){_0x553764=_0x5caec4;return _0x5caec4[_0xdd23('0x8e')](_0x254bc3[_0xdd23('0x4c')]['ids'],_[_0xdd23('0x8f')](_0x254bc3[_0xdd23('0x4c')],['ids','id'])||{});}return null;})[_0xdd23('0x68')](function(_0x3d4903){var _0x13acf2;var _0x3765bc;_0x86a25d=_0x3d4903||[];var _0x23b230=[];if(_0x3d4903){for(var _0x3cc9f2=0x0;_0x3cc9f2<_0x3d4903[_0xdd23('0x49')];_0x3cc9f2+=0x1){var _0x24afca=_0x3d4903[_0x3cc9f2][_0xdd23('0x26')]({'plain':!![]});_0x13acf2=squel['insert']()['into'](_0xdd23('0x90'))['fromQuery'](['phone',_0xdd23('0x6e'),'ListId',_0xdd23('0x5a'),_0xdd23('0x55'),'updatedAt'],squel[_0xdd23('0x77')]()['field'](_0xdd23('0x6c'),_0xdd23('0x6c'))[_0xdd23('0x6f')]('id',_0xdd23('0x6e'))[_0xdd23('0x6f')](_0x24afca[_0xdd23('0x70')][_0xdd23('0x72')](),'ListId')[_0xdd23('0x6f')](_0x254bc3[_0xdd23('0x46')]['id'][_0xdd23('0x72')](),_0xdd23('0x5a'))[_0xdd23('0x6f')](_0xdd23('0x7e'),_0xdd23('0x55'))[_0xdd23('0x6f')]('NOW()',_0xdd23('0x56'))[_0xdd23('0x79')](_0xdd23('0x73'))['where'](_0xdd23('0x74'))['where'](_0xdd23('0x75'),_0x24afca[_0xdd23('0x70')][_0xdd23('0x72')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xdd23('0x72')]();_0x23b230[_0xdd23('0x89')](db[_0xdd23('0x8a')]['query'](_0x13acf2));}return BPromise[_0xdd23('0x8b')](_0x23b230);}})[_0xdd23('0x24')](function(){return _0x86a25d;})[_0xdd23('0x24')](respondWithResult(_0x359f29,null))[_0xdd23('0x44')](handleError(_0x359f29,null));};exports[_0xdd23('0x91')]=function(_0x53608c,_0x557686,_0x1c2938){return db[_0xdd23('0x41')][_0xdd23('0x4a')]({'where':{'id':_0x53608c[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x557686,null))['then'](function(_0x173122){if(_0x173122){return _0x173122[_0xdd23('0x91')](_0x53608c['query'][_0xdd23('0x67')]);}})[_0xdd23('0x24')](function(_0xfd512e){if(_0xfd512e){return db[_0xdd23('0x61')][_0xdd23('0x25')]({'where':{'ListId':_0x53608c[_0xdd23('0x32')][_0xdd23('0x67')],'CampaignId':_0x53608c[_0xdd23('0x46')]['id']}})['then'](function(){return _0xfd512e;});}})['then'](respondWithStatusCode(_0x557686,null))['catch'](handleError(_0x557686,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 63a95d1..e897087 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(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x405a7a,_0x5937ac){var _0x4c9a54=function(_0x826698){while(--_0x826698){_0x405a7a['push'](_0x405a7a['shift']());}};_0x4c9a54(++_0x5937ac);}(_0x7a54,0x106));var _0x47a5=function(_0xb6699e,_0x67ec85){_0xb6699e=_0xb6699e-0x0;var _0x53d746=_0x7a54[_0xb6699e];return _0x53d746;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 3c58b73..32dd702 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 _0xa101=['then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','include','model','map','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xa101,0x15f));var _0x1a10=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0xa101[_0x540133];return _0x26b6e9;};'use strict';var _=require(_0x1a10('0x0'));var util=require(_0x1a10('0x1'));var moment=require('moment');var BPromise=require(_0x1a10('0x2'));var rs=require(_0x1a10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a10('0x4'))['db'];var utils=require(_0x1a10('0x5'));var logger=require('../../config/logger')(_0x1a10('0x6'));var config=require(_0x1a10('0x7'));var jayson=require(_0x1a10('0x8'));var client=jayson[_0x1a10('0x9')][_0x1a10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b95f3,_0x5eea77,_0x4f0cd4){return new BPromise(function(_0x3c90fa,_0x2df5ef){return client[_0x1a10('0xb')](_0x2b95f3,_0x4f0cd4)[_0x1a10('0xc')](function(_0x7c7a8a){logger[_0x1a10('0xd')](_0x1a10('0xe'),_0x5eea77,'request\x20sent');logger[_0x1a10('0xf')](_0x1a10('0x10'),_0x5eea77,_0x1a10('0x11'),JSON['stringify'](_0x7c7a8a));if(_0x7c7a8a[_0x1a10('0x12')]){if(_0x7c7a8a[_0x1a10('0x12')][_0x1a10('0x13')]===0x1f4){logger['error'](_0x1a10('0xe'),_0x5eea77,_0x7c7a8a[_0x1a10('0x12')][_0x1a10('0x14')]);return _0x2df5ef(_0x7c7a8a[_0x1a10('0x12')][_0x1a10('0x14')]);}logger['error'](_0x1a10('0xe'),_0x5eea77,_0x7c7a8a['error']['message']);return _0x3c90fa(_0x7c7a8a['error'][_0x1a10('0x14')]);}else{logger[_0x1a10('0xd')](_0x1a10('0xe'),_0x5eea77,_0x1a10('0x11'));_0x3c90fa(_0x7c7a8a['result'][_0x1a10('0x14')]);}})[_0x1a10('0x15')](function(_0x5395b4){logger[_0x1a10('0x12')](_0x1a10('0xe'),_0x5eea77,_0x5395b4);_0x2df5ef(_0x5395b4);});});}exports[_0x1a10('0x16')]=function(_0x457e2f){var _0x4a3813=this;return new Promise(function(_0x169cf2,_0x1b394c){return db[_0x1a10('0x17')][_0x1a10('0x18')]({'raw':_0x457e2f[_0x1a10('0x19')]?_0x457e2f[_0x1a10('0x19')][_0x1a10('0x1a')]===undefined?!![]:![]:!![],'where':_0x457e2f[_0x1a10('0x19')]?_0x457e2f[_0x1a10('0x19')][_0x1a10('0x1b')]||null:null,'attributes':_0x457e2f[_0x1a10('0x19')]?_0x457e2f[_0x1a10('0x19')][_0x1a10('0x1c')]||null:null,'limit':_0x457e2f[_0x1a10('0x19')]?_0x457e2f[_0x1a10('0x19')]['limit']||null:null,'include':_0x457e2f[_0x1a10('0x19')]?_0x457e2f['options'][_0x1a10('0x1d')]?_['map'](_0x457e2f[_0x1a10('0x19')]['include'],function(_0x11148c){return{'model':db[_0x11148c[_0x1a10('0x1e')]],'as':_0x11148c['as'],'attributes':_0x11148c['attributes'],'include':_0x11148c[_0x1a10('0x1d')]?_[_0x1a10('0x1f')](_0x11148c[_0x1a10('0x1d')],function(_0x43cae0){return{'model':db[_0x43cae0['model']],'as':_0x43cae0['as'],'attributes':_0x43cae0[_0x1a10('0x1c')],'include':_0x43cae0[_0x1a10('0x1d')]?_[_0x1a10('0x1f')](_0x43cae0[_0x1a10('0x1d')],function(_0xc093f6){return{'model':db[_0xc093f6[_0x1a10('0x1e')]],'as':_0xc093f6['as'],'attributes':_0xc093f6[_0x1a10('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1a10('0xc')](function(_0x4ba1a2){logger['info']('GetCampaign',_0x457e2f);logger[_0x1a10('0xf')](_0x1a10('0x16'),_0x457e2f,JSON[_0x1a10('0x20')](_0x4ba1a2));_0x169cf2(_0x4ba1a2);})[_0x1a10('0x15')](function(_0x4c2d92){logger[_0x1a10('0x12')](_0x1a10('0x16'),_0x4c2d92['message'],_0x457e2f);_0x1b394c(_0x4a3813[_0x1a10('0x12')](0x1f4,_0x4c2d92[_0x1a10('0x14')]));});});};
\ No newline at end of file
+var _0xe14d=['limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes'];(function(_0x45b29d,_0x44ce43){var _0x32d74=function(_0x559eff){while(--_0x559eff){_0x45b29d['push'](_0x45b29d['shift']());}};_0x32d74(++_0x44ce43);}(_0xe14d,0x1ee));var _0xde14=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xe14d[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('Campaign,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});}exports[_0xde14('0x19')]=function(_0x3cc317){var _0x10c4ab=this;return new Promise(function(_0x590a8b,_0x3f5fcf){return db[_0xde14('0x1a')][_0xde14('0x1b')]({'raw':_0x3cc317[_0xde14('0x1c')]?_0x3cc317['options'][_0xde14('0x1d')]===undefined?!![]:![]:!![],'where':_0x3cc317['options']?_0x3cc317[_0xde14('0x1c')]['where']||null:null,'attributes':_0x3cc317[_0xde14('0x1c')]?_0x3cc317[_0xde14('0x1c')][_0xde14('0x1e')]||null:null,'limit':_0x3cc317[_0xde14('0x1c')]?_0x3cc317[_0xde14('0x1c')][_0xde14('0x1f')]||null:null,'include':_0x3cc317[_0xde14('0x1c')]?_0x3cc317[_0xde14('0x1c')][_0xde14('0x20')]?_[_0xde14('0x21')](_0x3cc317[_0xde14('0x1c')][_0xde14('0x20')],function(_0x8f8033){return{'model':db[_0x8f8033['model']],'as':_0x8f8033['as'],'attributes':_0x8f8033[_0xde14('0x1e')],'include':_0x8f8033[_0xde14('0x20')]?_[_0xde14('0x21')](_0x8f8033[_0xde14('0x20')],function(_0x1bb7be){return{'model':db[_0x1bb7be[_0xde14('0x22')]],'as':_0x1bb7be['as'],'attributes':_0x1bb7be[_0xde14('0x1e')],'include':_0x1bb7be[_0xde14('0x20')]?_[_0xde14('0x21')](_0x1bb7be[_0xde14('0x20')],function(_0x4eff65){return{'model':db[_0x4eff65[_0xde14('0x22')]],'as':_0x4eff65['as'],'attributes':_0x4eff65[_0xde14('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xde14('0xd')](function(_0xf8279a){logger['info'](_0xde14('0x19'),_0x3cc317);logger[_0xde14('0x10')](_0xde14('0x19'),_0x3cc317,JSON['stringify'](_0xf8279a));_0x590a8b(_0xf8279a);})[_0xde14('0x18')](function(_0x582537){logger[_0xde14('0x14')](_0xde14('0x19'),_0x582537[_0xde14('0x16')],_0x3cc317);_0x3f5fcf(_0x10c4ab[_0xde14('0x14')](0x1f4,_0x582537[_0xde14('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 03693d7..96a695a 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 _0x9e93=['create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','multer','path','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e93,0xca));var _0x39e9=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x9e93[_0x1b25c1];return _0x1e4447;};'use strict';var multer=require(_0x39e9('0x0'));var util=require('util');var path=require(_0x39e9('0x1'));var timeout=require('connect-timeout');var express=require(_0x39e9('0x2'));var router=express[_0x39e9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x39e9('0x4'));var config=require(_0x39e9('0x5'));var controller=require(_0x39e9('0x6'));router[_0x39e9('0x7')]('/',auth[_0x39e9('0x8')](),controller['index']);router['get'](_0x39e9('0x9'),auth['isAuthenticated'](),controller[_0x39e9('0xa')]);router[_0x39e9('0x7')](_0x39e9('0xb'),auth['isAuthenticated'](),controller[_0x39e9('0xc')]);router['get'](_0x39e9('0xd'),auth[_0x39e9('0x8')](),controller[_0x39e9('0xe')]);router[_0x39e9('0x7')](_0x39e9('0xf'),auth[_0x39e9('0x8')](),controller['getHopperFinals']);router[_0x39e9('0x7')](_0x39e9('0x10'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x11')]);router[_0x39e9('0x7')](_0x39e9('0x12'),auth[_0x39e9('0x8')](),controller['getLists']);router[_0x39e9('0x7')](_0x39e9('0x13'),auth['isAuthenticated'](),controller[_0x39e9('0x14')]);router[_0x39e9('0x15')]('/',auth['isAuthenticated'](),controller[_0x39e9('0x16')]);router[_0x39e9('0x15')](_0x39e9('0x17'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x18')]);router['post']('/:id/lists',auth[_0x39e9('0x8')](),controller[_0x39e9('0x19')]);router['post']('/:id/blacklists',auth[_0x39e9('0x8')](),controller[_0x39e9('0x1a')]);router['put'](_0x39e9('0x9'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x1b')]);router[_0x39e9('0x1c')](_0x39e9('0x9'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x1d')]);router[_0x39e9('0x1c')](_0x39e9('0x12'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x1e')]);router[_0x39e9('0x1c')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x39e9('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0xbb7f=['/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x420030,_0x323141){var _0x2cbd2a=function(_0x5c005f){while(--_0x5c005f){_0x420030['push'](_0x420030['shift']());}};_0x2cbd2a(++_0x323141);}(_0xbb7f,0xe3));var _0xfbb7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbb7f[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xfbb7('0x0'));var util=require(_0xfbb7('0x1'));var path=require('path');var timeout=require(_0xfbb7('0x2'));var express=require(_0xfbb7('0x3'));var router=express[_0xfbb7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfbb7('0x5'));var interaction=require(_0xfbb7('0x6'));var config=require(_0xfbb7('0x7'));var controller=require(_0xfbb7('0x8'));router['get']('/',auth[_0xfbb7('0x9')](),controller[_0xfbb7('0xa')]);router[_0xfbb7('0xb')](_0xfbb7('0xc'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0xd')]);router['get'](_0xfbb7('0xe'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0xf')]);router[_0xfbb7('0xb')](_0xfbb7('0x10'),auth[_0xfbb7('0x9')](),controller['getHopperHistories']);router[_0xfbb7('0xb')](_0xfbb7('0x11'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x12')]);router[_0xfbb7('0xb')]('/:id/hopper_black',auth[_0xfbb7('0x9')](),controller['getHopperBlacks']);router[_0xfbb7('0xb')](_0xfbb7('0x13'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x14')]);router[_0xfbb7('0xb')](_0xfbb7('0x15'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x16')]);router[_0xfbb7('0x17')]('/',auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x18')]);router[_0xfbb7('0x17')](_0xfbb7('0x19'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1a')]);router[_0xfbb7('0x17')](_0xfbb7('0x13'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1b')]);router['post'](_0xfbb7('0x15'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1c')]);router[_0xfbb7('0x1d')](_0xfbb7('0xc'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1e')]);router['delete']('/:id',auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1f')]);router[_0xfbb7('0x20')](_0xfbb7('0x13'),auth['isAuthenticated'](),controller[_0xfbb7('0x21')]);router[_0xfbb7('0x20')](_0xfbb7('0x15'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x22')]);module[_0xfbb7('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index df02eb3..a8fcdc4 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 _0x2db5=['getDataValue','key','STRING','VIRTUAL'];(function(_0x13048a,_0xa3d206){var _0x53297c=function(_0x360580){while(--_0x360580){_0x13048a['push'](_0x13048a['shift']());}};_0x53297c(++_0xa3d206);}(_0x2db5,0x12e));var _0x52db=function(_0x1193ea,_0xc04ef0){_0x1193ea=_0x1193ea-0x0;var _0x5e4000=_0x2db5[_0x1193ea];return _0x5e4000;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x52db('0x0')]},'name':{'type':Sequelize[_0x52db('0x1')],'get':function(){return this[_0x52db('0x2')](_0x52db('0x3'));}}};
\ No newline at end of file
+var _0x1067=['STRING','TEXT','VIRTUAL','key','sequelize'];(function(_0x5cfc3c,_0x5a40d3){var _0x55fdab=function(_0x4ef059){while(--_0x4ef059){_0x5cfc3c['push'](_0x5cfc3c['shift']());}};_0x55fdab(++_0x5a40d3);}(_0x1067,0x171));var _0x7106=function(_0x32d788,_0xbaa65e){_0x32d788=_0x32d788-0x0;var _0x1b671a=_0x1067[_0x32d788];return _0x1b671a;};'use strict';var Sequelize=require(_0x7106('0x0'));module['exports']={'key':{'type':Sequelize[_0x7106('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7106('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7106('0x1')]},'name':{'type':Sequelize[_0x7106('0x3')],'get':function(){return this['getDataValue'](_0x7106('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 0b54533..1e0bda4 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 _0x55df=['include','find','update','destroy','body','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','catch','show','params','keys','length'];(function(_0x18fe69,_0x209621){var _0x2905b0=function(_0x56d2d5){while(--_0x56d2d5){_0x18fe69['push'](_0x18fe69['shift']());}};_0x2905b0(++_0x209621);}(_0x55df,0x1ce));var _0xf55d=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x55df[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0xf55d('0x0'));var rimraf=require(_0xf55d('0x1'));var zipdir=require(_0xf55d('0x2'));var jsonpatch=require(_0xf55d('0x3'));var rp=require(_0xf55d('0x4'));var moment=require('moment');var BPromise=require(_0xf55d('0x5'));var Mustache=require(_0xf55d('0x6'));var util=require('util');var path=require(_0xf55d('0x7'));var sox=require(_0xf55d('0x8'));var csv=require(_0xf55d('0x9'));var ejs=require(_0xf55d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf55d('0xb'));var squel=require(_0xf55d('0xc'));var crypto=require(_0xf55d('0xd'));var jsforce=require(_0xf55d('0xe'));var deskjs=require(_0xf55d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf55d('0x10'));var Redis=require('ioredis');var authService=require(_0xf55d('0x11'));var qs=require(_0xf55d('0x12'));var as=require(_0xf55d('0x13'));var hardwareService=require(_0xf55d('0x14'));var logger=require(_0xf55d('0x15'))(_0xf55d('0x16'));var utils=require(_0xf55d('0x17'));var config=require(_0xf55d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf55d('0x19'))['db'];function respondWithStatusCode(_0x34c7f3,_0x2dee42){_0x2dee42=_0x2dee42||0xcc;return function(_0x3dd3e6){if(_0x3dd3e6){return _0x34c7f3[_0xf55d('0x1a')](_0x2dee42);}return _0x34c7f3[_0xf55d('0x1b')](_0x2dee42)[_0xf55d('0x1c')]();};}function respondWithResult(_0x295468,_0xb7b786){_0xb7b786=_0xb7b786||0xc8;return function(_0x3962db){if(_0x3962db){return _0x295468[_0xf55d('0x1b')](_0xb7b786)[_0xf55d('0x1d')](_0x3962db);}};}function respondWithFilteredResult(_0x21144c,_0x54518c){return function(_0x2444e3){if(_0x2444e3){var _0xf016ac=typeof _0x54518c[_0xf55d('0x1e')]===_0xf55d('0x1f')&&typeof _0x54518c[_0xf55d('0x20')]===_0xf55d('0x1f');var _0x475901=_0x2444e3[_0xf55d('0x21')];var _0x3eff98=_0xf016ac?0x0:_0x54518c[_0xf55d('0x1e')];var _0x54e645=_0xf016ac?_0x2444e3[_0xf55d('0x21')]:_0x54518c[_0xf55d('0x1e')]+_0x54518c[_0xf55d('0x20')];var _0x224af8;if(_0x54e645>=_0x475901){_0x54e645=_0x475901;_0x224af8=0xc8;}else{_0x224af8=0xce;}_0x21144c['status'](_0x224af8);return _0x21144c[_0xf55d('0x22')](_0xf55d('0x23'),_0x3eff98+'-'+_0x54e645+'/'+_0x475901)[_0xf55d('0x1d')](_0x2444e3);}return null;};}function patchUpdates(_0x4b5c64){return function(_0x43824d){try{jsonpatch[_0xf55d('0x24')](_0x43824d,_0x4b5c64,!![]);}catch(_0x384993){return BPromise[_0xf55d('0x25')](_0x384993);}return _0x43824d[_0xf55d('0x26')]();};}function saveUpdates(_0x459171,_0x231e87){return function(_0x17ac78){if(_0x17ac78){return _0x17ac78['update'](_0x459171)[_0xf55d('0x27')](function(_0xcea301){return _0xcea301;});}return null;};}function removeEntity(_0x1d4f01,_0x2350d5){return function(_0x5ade54){if(_0x5ade54){return _0x5ade54['destroy']()[_0xf55d('0x27')](function(){var _0x36a319=_0x5ade54[_0xf55d('0x28')]({'plain':!![]});var _0x28d97d='CannedAnswers';return db[_0xf55d('0x29')]['destroy']({'where':{'type':_0x28d97d,'resourceId':_0x36a319['id']}})[_0xf55d('0x27')](function(){return _0x5ade54;});})[_0xf55d('0x27')](function(){_0x1d4f01[_0xf55d('0x1b')](0xcc)[_0xf55d('0x1c')]();});}};}function handleEntityNotFound(_0x1676f3,_0x6c5f55){return function(_0x447292){if(!_0x447292){_0x1676f3[_0xf55d('0x1a')](0x194);}return _0x447292;};}function handleError(_0x460991,_0x3442ae){_0x3442ae=_0x3442ae||0x1f4;return function(_0x455f4f){logger[_0xf55d('0x2a')](_0x455f4f['stack']);if(_0x455f4f[_0xf55d('0x2b')]){delete _0x455f4f[_0xf55d('0x2b')];}_0x460991['status'](_0x3442ae)[_0xf55d('0x2c')](_0x455f4f);};}exports[_0xf55d('0x2d')]=function(_0x419033,_0x55ab60){var _0x2f7c10={},_0x2b76bc={},_0x144dfd={'count':0x0,'rows':[]};var _0xafc6be=_[_0xf55d('0x2e')](db[_0xf55d('0x2f')][_0xf55d('0x30')],function(_0x25cc4c){return{'name':_0x25cc4c[_0xf55d('0x31')],'type':_0x25cc4c[_0xf55d('0x32')][_0xf55d('0x33')]};});_0x2b76bc[_0xf55d('0x34')]=_[_0xf55d('0x2e')](_0xafc6be,_0xf55d('0x2b'));_0x2b76bc[_0xf55d('0x35')]=_['keys'](_0x419033['query']);_0x2b76bc[_0xf55d('0x36')]=_[_0xf55d('0x37')](_0x2b76bc['model'],_0x2b76bc[_0xf55d('0x35')]);_0x2f7c10[_0xf55d('0x38')]=_['intersection'](_0x2b76bc[_0xf55d('0x34')],qs[_0xf55d('0x39')](_0x419033[_0xf55d('0x35')][_0xf55d('0x39')]));_0x2f7c10['attributes']=_0x2f7c10[_0xf55d('0x38')]['length']?_0x2f7c10[_0xf55d('0x38')]:_0x2b76bc[_0xf55d('0x34')];if(!_0x419033['query']['hasOwnProperty'](_0xf55d('0x3a'))){_0x2f7c10[_0xf55d('0x20')]=qs[_0xf55d('0x20')](_0x419033[_0xf55d('0x35')]['limit']);_0x2f7c10[_0xf55d('0x1e')]=qs[_0xf55d('0x1e')](_0x419033['query']['offset']);}_0x2f7c10[_0xf55d('0x3b')]=qs[_0xf55d('0x3c')](_0x419033[_0xf55d('0x35')][_0xf55d('0x3c')]);_0x2f7c10[_0xf55d('0x3d')]=qs[_0xf55d('0x36')](_['pick'](_0x419033[_0xf55d('0x35')],_0x2b76bc[_0xf55d('0x36')]),_0xafc6be);if(_0x419033[_0xf55d('0x35')]['filter']){_0x2f7c10['where']=_[_0xf55d('0x3e')](_0x2f7c10[_0xf55d('0x3d')],{'$or':[{'key':{'$like':'%'+_0x419033['query'][_0xf55d('0x3f')]+'%'}},{'value':{'$like':'%'+_0x419033[_0xf55d('0x35')][_0xf55d('0x3f')]+'%'}}]});}_0x2f7c10=_[_0xf55d('0x3e')]({},_0x2f7c10,_0x419033[_0xf55d('0x40')]);var _0x6ece21={'where':_0x2f7c10[_0xf55d('0x3d')]};return db[_0xf55d('0x2f')]['count'](_0x6ece21)[_0xf55d('0x27')](function(_0x1eda9d){_0x144dfd[_0xf55d('0x21')]=_0x1eda9d;if(_0x419033[_0xf55d('0x35')][_0xf55d('0x41')]){_0x2f7c10['include']=[{'all':!![]}];}return db[_0xf55d('0x2f')][_0xf55d('0x42')](_0x2f7c10);})['then'](function(_0x533137){_0x144dfd['rows']=_0x533137;return _0x144dfd;})[_0xf55d('0x27')](respondWithFilteredResult(_0x55ab60,_0x2f7c10))[_0xf55d('0x43')](handleError(_0x55ab60,null));};exports[_0xf55d('0x44')]=function(_0x2671bf,_0x1c1023){var _0x21f979={'raw':!![],'where':{'id':_0x2671bf[_0xf55d('0x45')]['id']}},_0x345ee2={};_0x345ee2['model']=_['keys'](db[_0xf55d('0x2f')][_0xf55d('0x30')]);_0x345ee2[_0xf55d('0x35')]=_[_0xf55d('0x46')](_0x2671bf[_0xf55d('0x35')]);_0x345ee2[_0xf55d('0x36')]=_['intersection'](_0x345ee2[_0xf55d('0x34')],_0x345ee2[_0xf55d('0x35')]);_0x21f979['attributes']=_['intersection'](_0x345ee2[_0xf55d('0x34')],qs[_0xf55d('0x39')](_0x2671bf[_0xf55d('0x35')][_0xf55d('0x39')]));_0x21f979['attributes']=_0x21f979[_0xf55d('0x38')][_0xf55d('0x47')]?_0x21f979[_0xf55d('0x38')]:_0x345ee2[_0xf55d('0x34')];if(_0x2671bf[_0xf55d('0x35')][_0xf55d('0x41')]){_0x21f979[_0xf55d('0x48')]=[{'all':!![]}];}_0x21f979=_[_0xf55d('0x3e')]({},_0x21f979,_0x2671bf['options']);return db[_0xf55d('0x2f')][_0xf55d('0x49')](_0x21f979)[_0xf55d('0x27')](handleEntityNotFound(_0x1c1023,null))[_0xf55d('0x27')](respondWithResult(_0x1c1023,null))[_0xf55d('0x43')](handleError(_0x1c1023,null));};exports[_0xf55d('0x4a')]=function(_0x19b0ba,_0x5832bd){if(_0x19b0ba['body']['id']){delete _0x19b0ba['body']['id'];}return db[_0xf55d('0x2f')]['find']({'where':{'id':_0x19b0ba[_0xf55d('0x45')]['id']}})['then'](handleEntityNotFound(_0x5832bd,null))[_0xf55d('0x27')](saveUpdates(_0x19b0ba['body'],null))[_0xf55d('0x27')](respondWithResult(_0x5832bd,null))[_0xf55d('0x43')](handleError(_0x5832bd,null));};exports[_0xf55d('0x4b')]=function(_0x1e6fcb,_0x370f0e){return db[_0xf55d('0x2f')][_0xf55d('0x49')]({'where':{'id':_0x1e6fcb[_0xf55d('0x45')]['id']}})[_0xf55d('0x27')](handleEntityNotFound(_0x370f0e,null))['then'](removeEntity(_0x370f0e,null))[_0xf55d('0x43')](handleError(_0x370f0e,null));};exports['create']=function(_0x42f01b,_0x5b5073){var _0x4bfacf={'key':_0x42f01b['body'][_0xf55d('0x33')]};if(_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4d')]){_0x4bfacf['MailAccountId']=_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4d')];}else if(_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4e')]){_0x4bfacf[_0xf55d('0x4e')]=_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4e')];}else if(_0x42f01b[_0xf55d('0x4c')]['OpenchannelAccountId']){_0x4bfacf['OpenchannelAccountId']=_0x42f01b[_0xf55d('0x4c')]['OpenchannelAccountId'];}else if(_0x42f01b[_0xf55d('0x4c')]['ChatWebsiteId']){_0x4bfacf[_0xf55d('0x4f')]=_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4f')];}return db[_0xf55d('0x2f')][_0xf55d('0x49')]({'where':_0x4bfacf})[_0xf55d('0x27')](function(_0x3ba7fa){if(_0x3ba7fa){throw new db[(_0xf55d('0x50'))]['ValidationError'](_0xf55d('0x51'));}return db[_0xf55d('0x2f')][_0xf55d('0x52')](_0x42f01b[_0xf55d('0x4c')]);})[_0xf55d('0x27')](function(_0x1b3da6){var _0x4ba254=_0x42f01b[_0xf55d('0x53')][_0xf55d('0x28')]({'plain':!![]});if(!_0x4ba254)throw new Error(_0xf55d('0x54'));if(_0x4ba254[_0xf55d('0x55')]===_0xf55d('0x53')){var _0x5742c4=_0x1b3da6['get']({'plain':!![]});return db['UserProfileSection'][_0xf55d('0x49')]({'where':{'name':_0xf55d('0x56'),'userProfileId':_0x4ba254[_0xf55d('0x57')]},'raw':!![]})[_0xf55d('0x27')](function(_0x2dd087){if(_0x2dd087&&_0x2dd087[_0xf55d('0x58')]===0x0){return db[_0xf55d('0x29')][_0xf55d('0x52')]({'name':_0x5742c4[_0xf55d('0x2b')],'resourceId':_0x5742c4['id'],'type':_0x2dd087[_0xf55d('0x2b')],'sectionId':_0x2dd087['id']},{})['then'](function(){return _0x1b3da6;});}else{return _0x1b3da6;}})[_0xf55d('0x43')](function(_0x40773b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40773b);throw _0x40773b;});}return _0x1b3da6;})[_0xf55d('0x27')](respondWithResult(_0x5b5073,0xc9))[_0xf55d('0x43')](handleError(_0x5b5073,null));};
\ No newline at end of file
+var _0x6da9=['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','status','undefined','offset','count','set','Content-Range','json','apply','reject','save','then','CannedAnswers','UserProfileResource','destroy','end','error','send','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','options','CannedAnswer','include','findAll','rows','catch','show','params','includeAll','merge','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x28d885,_0x22d916){var _0x54e080=function(_0x1b9e76){while(--_0x1b9e76){_0x28d885['push'](_0x28d885['shift']());}};_0x54e080(++_0x22d916);}(_0x6da9,0xaa));var _0x96da=function(_0x1f4a2f,_0x39c4a5){_0x1f4a2f=_0x1f4a2f-0x0;var _0x4b060e=_0x6da9[_0x1f4a2f];return _0x4b060e;};'use strict';var emlformat=require(_0x96da('0x0'));var rimraf=require(_0x96da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96da('0x2'));var rp=require(_0x96da('0x3'));var moment=require(_0x96da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x96da('0x5'));var util=require(_0x96da('0x6'));var path=require(_0x96da('0x7'));var sox=require(_0x96da('0x8'));var csv=require(_0x96da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96da('0xa'));var _=require('lodash');var squel=require(_0x96da('0xb'));var crypto=require('crypto');var jsforce=require(_0x96da('0xc'));var deskjs=require(_0x96da('0xd'));var toCsv=require(_0x96da('0x9'));var querystring=require(_0x96da('0xe'));var Papa=require(_0x96da('0xf'));var Redis=require(_0x96da('0x10'));var authService=require(_0x96da('0x11'));var qs=require(_0x96da('0x12'));var as=require(_0x96da('0x13'));var hardwareService=require(_0x96da('0x14'));var logger=require(_0x96da('0x15'))(_0x96da('0x16'));var utils=require(_0x96da('0x17'));var config=require(_0x96da('0x18'));var licenseUtil=require(_0x96da('0x19'));var db=require(_0x96da('0x1a'))['db'];function respondWithStatusCode(_0x59727a,_0x242d6a){_0x242d6a=_0x242d6a||0xcc;return function(_0x1b4e02){if(_0x1b4e02){return _0x59727a['sendStatus'](_0x242d6a);}return _0x59727a[_0x96da('0x1b')](_0x242d6a)['end']();};}function respondWithResult(_0x4a6000,_0x4855fe){_0x4855fe=_0x4855fe||0xc8;return function(_0x227e35){if(_0x227e35){return _0x4a6000['status'](_0x4855fe)['json'](_0x227e35);}};}function respondWithFilteredResult(_0x4ec6e4,_0xedfc7c){return function(_0x2d9a87){if(_0x2d9a87){var _0x1afa6b=typeof _0xedfc7c['offset']===_0x96da('0x1c')&&typeof _0xedfc7c['limit']==='undefined';var _0x13a6c1=_0x2d9a87['count'];var _0x19960e=_0x1afa6b?0x0:_0xedfc7c[_0x96da('0x1d')];var _0x53141d=_0x1afa6b?_0x2d9a87[_0x96da('0x1e')]:_0xedfc7c['offset']+_0xedfc7c['limit'];var _0x480231;if(_0x53141d>=_0x13a6c1){_0x53141d=_0x13a6c1;_0x480231=0xc8;}else{_0x480231=0xce;}_0x4ec6e4['status'](_0x480231);return _0x4ec6e4[_0x96da('0x1f')](_0x96da('0x20'),_0x19960e+'-'+_0x53141d+'/'+_0x13a6c1)[_0x96da('0x21')](_0x2d9a87);}return null;};}function patchUpdates(_0xf887da){return function(_0x17f646){try{jsonpatch[_0x96da('0x22')](_0x17f646,_0xf887da,!![]);}catch(_0xa75e1e){return BPromise[_0x96da('0x23')](_0xa75e1e);}return _0x17f646[_0x96da('0x24')]();};}function saveUpdates(_0x1e8be9,_0x5282b9){return function(_0x5186fe){if(_0x5186fe){return _0x5186fe['update'](_0x1e8be9)[_0x96da('0x25')](function(_0x466278){return _0x466278;});}return null;};}function removeEntity(_0x4b01ad,_0x374908){return function(_0x47764f){if(_0x47764f){return _0x47764f['destroy']()[_0x96da('0x25')](function(){var _0x10ae4c=_0x47764f['get']({'plain':!![]});var _0x461b19=_0x96da('0x26');return db[_0x96da('0x27')][_0x96da('0x28')]({'where':{'type':_0x461b19,'resourceId':_0x10ae4c['id']}})[_0x96da('0x25')](function(){return _0x47764f;});})['then'](function(){_0x4b01ad[_0x96da('0x1b')](0xcc)[_0x96da('0x29')]();});}};}function handleEntityNotFound(_0x34a70b,_0x11a552){return function(_0x36a4c1){if(!_0x36a4c1){_0x34a70b['sendStatus'](0x194);}return _0x36a4c1;};}function handleError(_0x2d5adb,_0x485f3c){_0x485f3c=_0x485f3c||0x1f4;return function(_0xeac755){logger[_0x96da('0x2a')](_0xeac755['stack']);if(_0xeac755['name']){delete _0xeac755['name'];}_0x2d5adb[_0x96da('0x1b')](_0x485f3c)[_0x96da('0x2b')](_0xeac755);};}exports['index']=function(_0x8e4979,_0x437cda){var _0x2a7d35={},_0x58251c={},_0xd57e3={'count':0x0,'rows':[]};var _0x383205=_[_0x96da('0x2c')](db['CannedAnswer'][_0x96da('0x2d')],function(_0x3bd7c6){return{'name':_0x3bd7c6['fieldName'],'type':_0x3bd7c6['type'][_0x96da('0x2e')]};});_0x58251c[_0x96da('0x2f')]=_[_0x96da('0x2c')](_0x383205,'name');_0x58251c[_0x96da('0x30')]=_[_0x96da('0x31')](_0x8e4979[_0x96da('0x30')]);_0x58251c[_0x96da('0x32')]=_[_0x96da('0x33')](_0x58251c[_0x96da('0x2f')],_0x58251c['query']);_0x2a7d35[_0x96da('0x34')]=_[_0x96da('0x33')](_0x58251c[_0x96da('0x2f')],qs[_0x96da('0x35')](_0x8e4979[_0x96da('0x30')][_0x96da('0x35')]));_0x2a7d35[_0x96da('0x34')]=_0x2a7d35['attributes'][_0x96da('0x36')]?_0x2a7d35[_0x96da('0x34')]:_0x58251c[_0x96da('0x2f')];if(!_0x8e4979[_0x96da('0x30')][_0x96da('0x37')](_0x96da('0x38'))){_0x2a7d35[_0x96da('0x39')]=qs[_0x96da('0x39')](_0x8e4979[_0x96da('0x30')][_0x96da('0x39')]);_0x2a7d35[_0x96da('0x1d')]=qs[_0x96da('0x1d')](_0x8e4979[_0x96da('0x30')][_0x96da('0x1d')]);}_0x2a7d35[_0x96da('0x3a')]=qs[_0x96da('0x3b')](_0x8e4979[_0x96da('0x30')]['sort']);_0x2a7d35[_0x96da('0x3c')]=qs[_0x96da('0x32')](_[_0x96da('0x3d')](_0x8e4979[_0x96da('0x30')],_0x58251c['filters']),_0x383205);if(_0x8e4979[_0x96da('0x30')]['filter']){_0x2a7d35[_0x96da('0x3c')]=_['merge'](_0x2a7d35['where'],{'$or':[{'key':{'$like':'%'+_0x8e4979[_0x96da('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x8e4979['query']['filter']+'%'}}]});}_0x2a7d35=_['merge']({},_0x2a7d35,_0x8e4979[_0x96da('0x3e')]);var _0x49a978={'where':_0x2a7d35[_0x96da('0x3c')]};return db[_0x96da('0x3f')]['count'](_0x49a978)[_0x96da('0x25')](function(_0x550cff){_0xd57e3[_0x96da('0x1e')]=_0x550cff;if(_0x8e4979[_0x96da('0x30')]['includeAll']){_0x2a7d35[_0x96da('0x40')]=[{'all':!![]}];}return db[_0x96da('0x3f')][_0x96da('0x41')](_0x2a7d35);})['then'](function(_0x4bf247){_0xd57e3[_0x96da('0x42')]=_0x4bf247;return _0xd57e3;})[_0x96da('0x25')](respondWithFilteredResult(_0x437cda,_0x2a7d35))[_0x96da('0x43')](handleError(_0x437cda,null));};exports[_0x96da('0x44')]=function(_0x26e812,_0x4844e9){var _0x4e9dfc={'raw':!![],'where':{'id':_0x26e812[_0x96da('0x45')]['id']}},_0x5168b4={};_0x5168b4[_0x96da('0x2f')]=_['keys'](db['CannedAnswer'][_0x96da('0x2d')]);_0x5168b4[_0x96da('0x30')]=_[_0x96da('0x31')](_0x26e812['query']);_0x5168b4['filters']=_['intersection'](_0x5168b4[_0x96da('0x2f')],_0x5168b4[_0x96da('0x30')]);_0x4e9dfc[_0x96da('0x34')]=_[_0x96da('0x33')](_0x5168b4[_0x96da('0x2f')],qs[_0x96da('0x35')](_0x26e812[_0x96da('0x30')][_0x96da('0x35')]));_0x4e9dfc[_0x96da('0x34')]=_0x4e9dfc[_0x96da('0x34')][_0x96da('0x36')]?_0x4e9dfc['attributes']:_0x5168b4[_0x96da('0x2f')];if(_0x26e812[_0x96da('0x30')][_0x96da('0x46')]){_0x4e9dfc[_0x96da('0x40')]=[{'all':!![]}];}_0x4e9dfc=_[_0x96da('0x47')]({},_0x4e9dfc,_0x26e812[_0x96da('0x3e')]);return db[_0x96da('0x3f')][_0x96da('0x48')](_0x4e9dfc)['then'](handleEntityNotFound(_0x4844e9,null))[_0x96da('0x25')](respondWithResult(_0x4844e9,null))[_0x96da('0x43')](handleError(_0x4844e9,null));};exports[_0x96da('0x49')]=function(_0x14bdb1,_0x3a9f54){if(_0x14bdb1[_0x96da('0x4a')]['id']){delete _0x14bdb1[_0x96da('0x4a')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x14bdb1[_0x96da('0x45')]['id']}})[_0x96da('0x25')](handleEntityNotFound(_0x3a9f54,null))['then'](saveUpdates(_0x14bdb1[_0x96da('0x4a')],null))[_0x96da('0x25')](respondWithResult(_0x3a9f54,null))[_0x96da('0x43')](handleError(_0x3a9f54,null));};exports[_0x96da('0x28')]=function(_0x1de6c2,_0x3fb280){return db['CannedAnswer'][_0x96da('0x48')]({'where':{'id':_0x1de6c2['params']['id']}})[_0x96da('0x25')](handleEntityNotFound(_0x3fb280,null))['then'](removeEntity(_0x3fb280,null))['catch'](handleError(_0x3fb280,null));};exports[_0x96da('0x4b')]=function(_0x4cc7ea,_0xaaa833){var _0x267e70={'key':_0x4cc7ea[_0x96da('0x4a')]['key']};if(_0x4cc7ea['body'][_0x96da('0x4c')]){_0x267e70[_0x96da('0x4c')]=_0x4cc7ea[_0x96da('0x4a')]['MailAccountId'];}else if(_0x4cc7ea[_0x96da('0x4a')]['SmsAccountId']){_0x267e70['SmsAccountId']=_0x4cc7ea[_0x96da('0x4a')][_0x96da('0x4d')];}else if(_0x4cc7ea[_0x96da('0x4a')]['OpenchannelAccountId']){_0x267e70[_0x96da('0x4e')]=_0x4cc7ea[_0x96da('0x4a')]['OpenchannelAccountId'];}else if(_0x4cc7ea[_0x96da('0x4a')][_0x96da('0x4f')]){_0x267e70[_0x96da('0x4f')]=_0x4cc7ea[_0x96da('0x4a')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x267e70})['then'](function(_0x27a7de){if(_0x27a7de){throw new db[(_0x96da('0x50'))][(_0x96da('0x51'))](_0x96da('0x52'));}return db[_0x96da('0x3f')][_0x96da('0x4b')](_0x4cc7ea[_0x96da('0x4a')]);})[_0x96da('0x25')](function(_0x2690dc){var _0x563332=_0x4cc7ea[_0x96da('0x53')][_0x96da('0x54')]({'plain':!![]});if(!_0x563332)throw new Error(_0x96da('0x55'));if(_0x563332[_0x96da('0x56')]===_0x96da('0x53')){var _0x486b50=_0x2690dc['get']({'plain':!![]});return db[_0x96da('0x57')][_0x96da('0x48')]({'where':{'name':_0x96da('0x26'),'userProfileId':_0x563332['userProfileId']},'raw':!![]})['then'](function(_0x1df54f){if(_0x1df54f&&_0x1df54f[_0x96da('0x58')]===0x0){return db[_0x96da('0x27')][_0x96da('0x4b')]({'name':_0x486b50[_0x96da('0x59')],'resourceId':_0x486b50['id'],'type':_0x1df54f[_0x96da('0x59')],'sectionId':_0x1df54f['id']},{})['then'](function(){return _0x2690dc;});}else{return _0x2690dc;}})[_0x96da('0x43')](function(_0xfd9044){logger[_0x96da('0x2a')](_0x96da('0x5a'),_0xfd9044);throw _0xfd9044;});}return _0x2690dc;})[_0x96da('0x25')](respondWithResult(_0xaaa833,0xc9))[_0x96da('0x43')](handleError(_0xaaa833,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 6bc90aa..161f914 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 _0xe511=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise'];(function(_0x519876,_0x9d0dbc){var _0x1c1771=function(_0x57dcc0){while(--_0x57dcc0){_0x519876['push'](_0x519876['shift']());}};_0x1c1771(++_0x9d0dbc);}(_0xe511,0x16f));var _0x1e51=function(_0xd75d34,_0x2d31c6){_0xd75d34=_0xd75d34-0x0;var _0x8c5975=_0xe511[_0xd75d34];return _0x8c5975;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var attributes=require(_0x1e51('0x7'));module[_0x1e51('0x8')]=function(_0x480cca,_0x26b22c){return _0x480cca[_0x1e51('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e51('0xa'),'collate':_0x1e51('0xb')});};
\ No newline at end of file
+var _0xf4fb=['exports','define','CannedAnswer','utf8mb4','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xf4fb,0x12d));var _0xbf4f=function(_0x239b90,_0xb0bf10){_0x239b90=_0x239b90-0x0;var _0x57f19b=_0xf4fb[_0x239b90];return _0x57f19b;};'use strict';var _=require(_0xbf4f('0x0'));var util=require('util');var logger=require(_0xbf4f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbf4f('0x2'));var rp=require(_0xbf4f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4f('0x4'));var config=require(_0xbf4f('0x5'));var attributes=require(_0xbf4f('0x6'));module[_0xbf4f('0x7')]=function(_0x5ce884,_0x977e51){return _0x5ce884[_0xbf4f('0x8')](_0xbf4f('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbf4f('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 9e40984..a4f2da0 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(_0x55e934,_0x5c7a2e){var _0x289755=function(_0x17fc22){while(--_0x17fc22){_0x55e934['push'](_0x55e934['shift']());}};_0x289755(++_0x5c7a2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x41baa3,_0x557b11){var _0x380294=function(_0x63e9e7){while(--_0x63e9e7){_0x41baa3['push'](_0x41baa3['shift']());}};_0x380294(++_0x557b11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 e98a6f3..8a0b757 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 _0x023e=['delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','update'];(function(_0x54cd0b,_0x182ab9){var _0x2dbfb7=function(_0x41d47e){while(--_0x41d47e){_0x54cd0b['push'](_0x54cd0b['shift']());}};_0x2dbfb7(++_0x182ab9);}(_0x023e,0x1a3));var _0xe023=function(_0x4ddfa5,_0x5c7c33){_0x4ddfa5=_0x4ddfa5-0x0;var _0xb53e0=_0x023e[_0x4ddfa5];return _0xb53e0;};'use strict';var multer=require(_0xe023('0x0'));var util=require(_0xe023('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe023('0x2'));var router=express['Router']();var fs_extra=require(_0xe023('0x3'));var auth=require(_0xe023('0x4'));var interaction=require(_0xe023('0x5'));var config=require(_0xe023('0x6'));var controller=require('./cannedAnswer.controller');router[_0xe023('0x7')]('/',auth[_0xe023('0x8')](),controller[_0xe023('0x9')]);router[_0xe023('0x7')](_0xe023('0xa'),auth[_0xe023('0x8')](),controller[_0xe023('0xb')]);router['post']('/',auth[_0xe023('0x8')](),controller['create']);router['put'](_0xe023('0xa'),auth[_0xe023('0x8')](),controller[_0xe023('0xc')]);router[_0xe023('0xd')](_0xe023('0xa'),auth[_0xe023('0x8')](),controller[_0xe023('0xe')]);module[_0xe023('0xf')]=router;
\ No newline at end of file
+var _0x4889=['destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x4889,0x1c3));var _0x9488=function(_0x30730c,_0x5e00f2){_0x30730c=_0x30730c-0x0;var _0x554424=_0x4889[_0x30730c];return _0x554424;};'use strict';var multer=require(_0x9488('0x0'));var util=require(_0x9488('0x1'));var path=require(_0x9488('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9488('0x3')]();var fs_extra=require(_0x9488('0x4'));var auth=require(_0x9488('0x5'));var interaction=require(_0x9488('0x6'));var config=require('../../config/environment');var controller=require(_0x9488('0x7'));router[_0x9488('0x8')]('/',auth[_0x9488('0x9')](),controller[_0x9488('0xa')]);router[_0x9488('0x8')](_0x9488('0xb'),auth[_0x9488('0x9')](),controller[_0x9488('0xc')]);router[_0x9488('0xd')]('/',auth[_0x9488('0x9')](),controller[_0x9488('0xe')]);router[_0x9488('0xf')](_0x9488('0xb'),auth[_0x9488('0x9')](),controller[_0x9488('0x10')]);router['delete']('/:id',auth[_0x9488('0x9')](),controller[_0x9488('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index df8fc6e..ec47348 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 _0xf2c7=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x39ea42,_0x3c1f50){_0x39ea42=_0x39ea42-0x0;var _0x33f5b7=_0xf2c7[_0x39ea42];return _0x33f5b7;};'use strict';var Sequelize=require(_0x7f2c('0x0'));module[_0x7f2c('0x1')]={'calldate':{'type':Sequelize[_0x7f2c('0x2')],'allowNull':![],'defaultValue':_0x7f2c('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x7f2c('0x4')]},'dst':{'type':Sequelize[_0x7f2c('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x7f2c('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x7f2c('0x4')]},'duration':{'type':Sequelize[_0x7f2c('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7f2c('0x4')]},'amaflags':{'type':Sequelize[_0x7f2c('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7f2c('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7f2c('0x4')]},'linkedid':{'type':Sequelize[_0x7f2c('0x4')]},'sequence':{'type':Sequelize[_0x7f2c('0x4')]},'peeraccount':{'type':Sequelize[_0x7f2c('0x4')]},'type':{'type':Sequelize[_0x7f2c('0x4')]},'tag':{'type':Sequelize[_0x7f2c('0x4')]}};
\ No newline at end of file
+var _0xbf3f=['INTEGER','sequelize','STRING'];(function(_0x1de329,_0x36924c){var _0xc91708=function(_0x4a12f0){while(--_0x4a12f0){_0x1de329['push'](_0x1de329['shift']());}};_0xc91708(++_0x36924c);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfbf3('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xfbf3('0x1')]},'dcontext':{'type':Sequelize[_0xfbf3('0x1')]},'channel':{'type':Sequelize[_0xfbf3('0x1')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xfbf3('0x1')]},'lastdata':{'type':Sequelize[_0xfbf3('0x1')]},'duration':{'type':Sequelize[_0xfbf3('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xfbf3('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfbf3('0x1')]},'amaflags':{'type':Sequelize[_0xfbf3('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfbf3('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfbf3('0x1')]},'linkedid':{'type':Sequelize[_0xfbf3('0x1')]},'sequence':{'type':Sequelize[_0xfbf3('0x1')]},'peeraccount':{'type':Sequelize[_0xfbf3('0x1')]},'type':{'type':Sequelize[_0xfbf3('0x1')]},'tag':{'type':Sequelize[_0xfbf3('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 0411e41..64db42a 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 _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','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','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','Cdr','fieldName','type','model','name','keys'];(function(_0x3e5bd9,_0x17e1c1){var _0x545659=function(_0x4ddd25){while(--_0x4ddd25){_0x3e5bd9['push'](_0x3e5bd9['shift']());}};_0x545659(++_0x17e1c1);}(_0x7217,0x19e));var _0x7721=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x7217[_0x34bf97];return _0x292719;};'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(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));};
\ No newline at end of file
+var _0xafdd=['pick','filter','merge','type','VIRTUAL','options','Cdr','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','fieldName','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x564d53,_0x31ac8a){var _0x1ba891=function(_0x51cad3){while(--_0x51cad3){_0x564d53['push'](_0x564d53['shift']());}};_0x1ba891(++_0x31ac8a);}(_0xafdd,0x19a));var _0xdafd=function(_0x59aa87,_0x4b0699){_0x59aa87=_0x59aa87-0x0;var _0x3e96bb=_0xafdd[_0x59aa87];return _0x3e96bb;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x166176,_0x594f47){_0x594f47=_0x594f47||0xcc;return function(_0x553508){if(_0x553508){return _0x166176[_0xdafd('0x1b')](_0x594f47);}return _0x166176[_0xdafd('0x1c')](_0x594f47)['end']();};}function respondWithResult(_0x43a716,_0x490382){_0x490382=_0x490382||0xc8;return function(_0x4b09da){if(_0x4b09da){return _0x43a716[_0xdafd('0x1c')](_0x490382)[_0xdafd('0x1d')](_0x4b09da);}};}function respondWithFilteredResult(_0x583b1d,_0x267bfc){return function(_0x186379){if(_0x186379){var _0x496515=typeof _0x267bfc[_0xdafd('0x1e')]===_0xdafd('0x1f')&&typeof _0x267bfc[_0xdafd('0x20')]==='undefined';var _0xb382ca=_0x186379[_0xdafd('0x21')];var _0x4fc3a4=_0x496515?0x0:_0x267bfc['offset'];var _0x2569b2=_0x496515?_0x186379['count']:_0x267bfc[_0xdafd('0x1e')]+_0x267bfc[_0xdafd('0x20')];var _0x1e64d3;if(_0x2569b2>=_0xb382ca){_0x2569b2=_0xb382ca;_0x1e64d3=0xc8;}else{_0x1e64d3=0xce;}_0x583b1d[_0xdafd('0x1c')](_0x1e64d3);return _0x583b1d[_0xdafd('0x22')](_0xdafd('0x23'),_0x4fc3a4+'-'+_0x2569b2+'/'+_0xb382ca)[_0xdafd('0x1d')](_0x186379);}return null;};}function patchUpdates(_0x42e0f9){return function(_0x8480a8){try{jsonpatch[_0xdafd('0x24')](_0x8480a8,_0x42e0f9,!![]);}catch(_0xee767e){return BPromise[_0xdafd('0x25')](_0xee767e);}return _0x8480a8[_0xdafd('0x26')]();};}function saveUpdates(_0xf4a521,_0x491d96){return function(_0x230495){if(_0x230495){return _0x230495['update'](_0xf4a521)[_0xdafd('0x27')](function(_0x5e96cc){return _0x5e96cc;});}return null;};}function removeEntity(_0x439bbf,_0x35ef78){return function(_0x7f10f6){if(_0x7f10f6){return _0x7f10f6[_0xdafd('0x28')]()[_0xdafd('0x27')](function(){_0x439bbf[_0xdafd('0x1c')](0xcc)[_0xdafd('0x29')]();});}};}function handleEntityNotFound(_0x30cba9,_0x3846dd){return function(_0x5cd11d){if(!_0x5cd11d){_0x30cba9[_0xdafd('0x1b')](0x194);}return _0x5cd11d;};}function handleError(_0x2ab575,_0x18554c){_0x18554c=_0x18554c||0x1f4;return function(_0x1feb5b){logger[_0xdafd('0x2a')](_0x1feb5b[_0xdafd('0x2b')]);if(_0x1feb5b[_0xdafd('0x2c')]){delete _0x1feb5b[_0xdafd('0x2c')];}_0x2ab575[_0xdafd('0x1c')](_0x18554c)[_0xdafd('0x2d')](_0x1feb5b);};}exports['index']=function(_0x243182,_0x14626b){var _0x13ab81={},_0x249743={},_0x21edb6={'count':0x0,'rows':[]};var _0x324f0f=_['map'](db['Cdr']['rawAttributes'],function(_0xcca4f){return{'name':_0xcca4f[_0xdafd('0x2e')],'type':_0xcca4f['type']['key']};});_0x249743[_0xdafd('0x2f')]=_[_0xdafd('0x30')](_0x324f0f,_0xdafd('0x2c'));_0x249743[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0x243182[_0xdafd('0x31')]);_0x249743[_0xdafd('0x33')]=_['intersection'](_0x249743[_0xdafd('0x2f')],_0x249743[_0xdafd('0x31')]);_0x13ab81[_0xdafd('0x34')]=_['intersection'](_0x249743[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0x243182['query'][_0xdafd('0x35')]));_0x13ab81[_0xdafd('0x34')]=_0x13ab81[_0xdafd('0x34')]['length']?_0x13ab81[_0xdafd('0x34')]:_0x249743[_0xdafd('0x2f')];if(!_0x243182[_0xdafd('0x31')][_0xdafd('0x36')](_0xdafd('0x37'))){_0x13ab81[_0xdafd('0x20')]=qs[_0xdafd('0x20')](_0x243182['query'][_0xdafd('0x20')]);_0x13ab81[_0xdafd('0x1e')]=qs[_0xdafd('0x1e')](_0x243182[_0xdafd('0x31')][_0xdafd('0x1e')]);}_0x13ab81['order']=qs[_0xdafd('0x38')](_0x243182[_0xdafd('0x31')]['sort']);_0x13ab81[_0xdafd('0x39')]=qs[_0xdafd('0x33')](_[_0xdafd('0x3a')](_0x243182[_0xdafd('0x31')],_0x249743[_0xdafd('0x33')]),_0x324f0f);if(_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]){_0x13ab81[_0xdafd('0x39')]=_[_0xdafd('0x3c')](_0x13ab81[_0xdafd('0x39')],{'$or':_[_0xdafd('0x30')](_0x324f0f,function(_0x245163){if(_0x245163[_0xdafd('0x3d')]!==_0xdafd('0x3e')){var _0xb1e264={};_0xb1e264[_0x245163[_0xdafd('0x2c')]]={'$like':'%'+_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]+'%'};return _0xb1e264;}})});}_0x13ab81=_[_0xdafd('0x3c')]({},_0x13ab81,_0x243182[_0xdafd('0x3f')]);var _0x3f25c2={'where':_0x13ab81[_0xdafd('0x39')]};return db[_0xdafd('0x40')][_0xdafd('0x21')](_0x3f25c2)[_0xdafd('0x27')](function(_0x21d43d){_0x21edb6['count']=_0x21d43d;if(_0x243182['query'][_0xdafd('0x41')]){_0x13ab81['include']=[{'all':!![]}];}return db[_0xdafd('0x40')][_0xdafd('0x42')](_0x13ab81);})['then'](function(_0x4b463c){_0x21edb6[_0xdafd('0x43')]=_0x4b463c;return _0x21edb6;})[_0xdafd('0x27')](respondWithFilteredResult(_0x14626b,_0x13ab81))[_0xdafd('0x44')](handleError(_0x14626b,null));};exports[_0xdafd('0x45')]=function(_0xbc5159,_0x184a59){var _0x3a3a14={'raw':!![],'where':{'id':_0xbc5159[_0xdafd('0x46')]['id']}},_0x2417f8={};_0x2417f8['model']=_['keys'](db[_0xdafd('0x40')][_0xdafd('0x47')]);_0x2417f8[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0xbc5159[_0xdafd('0x31')]);_0x2417f8[_0xdafd('0x33')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],_0x2417f8[_0xdafd('0x31')]);_0x3a3a14[_0xdafd('0x34')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0xbc5159['query'][_0xdafd('0x35')]));_0x3a3a14['attributes']=_0x3a3a14[_0xdafd('0x34')]['length']?_0x3a3a14[_0xdafd('0x34')]:_0x2417f8[_0xdafd('0x2f')];if(_0xbc5159[_0xdafd('0x31')][_0xdafd('0x41')]){_0x3a3a14[_0xdafd('0x49')]=[{'all':!![]}];}_0x3a3a14=_[_0xdafd('0x3c')]({},_0x3a3a14,_0xbc5159['options']);return db[_0xdafd('0x40')][_0xdafd('0x4a')](_0x3a3a14)[_0xdafd('0x27')](handleEntityNotFound(_0x184a59,null))[_0xdafd('0x27')](respondWithResult(_0x184a59,null))[_0xdafd('0x44')](handleError(_0x184a59,null));};exports['create']=function(_0x48cc85,_0x189d61){return db[_0xdafd('0x40')][_0xdafd('0x4b')](_0x48cc85[_0xdafd('0x4c')],{})[_0xdafd('0x27')](respondWithResult(_0x189d61,0xc9))[_0xdafd('0x44')](handleError(_0x189d61,null));};exports[_0xdafd('0x4d')]=function(_0x2f5e4c,_0x2ae4cd){if(_0x2f5e4c['body']['id']){delete _0x2f5e4c[_0xdafd('0x4c')]['id'];}return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x2f5e4c[_0xdafd('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ae4cd,null))[_0xdafd('0x27')](saveUpdates(_0x2f5e4c[_0xdafd('0x4c')],null))[_0xdafd('0x27')](respondWithResult(_0x2ae4cd,null))[_0xdafd('0x44')](handleError(_0x2ae4cd,null));};exports[_0xdafd('0x28')]=function(_0x4b6fbb,_0x5af1a8){return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x4b6fbb['params']['id']}})['then'](handleEntityNotFound(_0x5af1a8,null))[_0xdafd('0x27')](removeEntity(_0x5af1a8,null))[_0xdafd('0x44')](handleError(_0x5af1a8,null));};exports['describe']=function(_0x2dde06,_0x5dc9a0){return db[_0xdafd('0x40')]['describe']()['then'](respondWithResult(_0x5dc9a0,null))[_0xdafd('0x44')](handleError(_0x5dc9a0,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 3c61736..65e3a61 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x351b03,_0x1bae0f){var _0x5bce92=function(_0x1df940){while(--_0x1df940){_0x351b03['push'](_0x351b03['shift']());}};_0x5bce92(++_0x1bae0f);}(_0x7a54,0x106));var _0x47a5=function(_0x56cc59,_0x28d603){_0x56cc59=_0x56cc59-0x0;var _0x4dc1aa=_0x7a54[_0x56cc59];return _0x4dc1aa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4f16bd,_0x2f9263){var _0x2dd933=function(_0x3acb70){while(--_0x3acb70){_0x4f16bd['push'](_0x4f16bd['shift']());}};_0x2dd933(++_0x2f9263);}(_0x7a54,0x106));var _0x47a5=function(_0x33720c,_0x5d7320){_0x33720c=_0x33720c-0x0;var _0x5939ff=_0x7a54[_0x33720c];return _0x5939ff;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 04c77f1..3e85dc8 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 _0xba93=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x5e139c,_0x3c357b){var _0x1fc429=function(_0x420f69){while(--_0x420f69){_0x5e139c['push'](_0x5e139c['shift']());}};_0x1fc429(++_0x3c357b);}(_0xba93,0x74));var _0x3ba9=function(_0x5e8b8c,_0xf51661){_0x5e8b8c=_0x5e8b8c-0x0;var _0x3902dc=_0xba93[_0x5e8b8c];return _0x3902dc;};'use strict';var _=require(_0x3ba9('0x0'));var util=require(_0x3ba9('0x1'));var moment=require(_0x3ba9('0x2'));var BPromise=require(_0x3ba9('0x3'));var rs=require(_0x3ba9('0x4'));var fs=require('fs');var Redis=require(_0x3ba9('0x5'));var db=require(_0x3ba9('0x6'))['db'];var utils=require(_0x3ba9('0x7'));var logger=require(_0x3ba9('0x8'))(_0x3ba9('0x9'));var config=require(_0x3ba9('0xa'));var jayson=require(_0x3ba9('0xb'));var client=jayson[_0x3ba9('0xc')][_0x3ba9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xda2d73,_0x1dc9a2,_0x416f57){return new BPromise(function(_0x1934e7,_0x7d64e9){return client[_0x3ba9('0xe')](_0xda2d73,_0x416f57)['then'](function(_0x1e5d50){logger[_0x3ba9('0xf')](_0x3ba9('0x10'),_0x1dc9a2,_0x3ba9('0x11'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x1dc9a2,_0x3ba9('0x11'),JSON[_0x3ba9('0x12')](_0x1e5d50));if(_0x1e5d50['error']){if(_0x1e5d50[_0x3ba9('0x13')][_0x3ba9('0x14')]===0x1f4){logger[_0x3ba9('0x13')](_0x3ba9('0x10'),_0x1dc9a2,_0x1e5d50[_0x3ba9('0x13')][_0x3ba9('0x15')]);return _0x7d64e9(_0x1e5d50[_0x3ba9('0x13')][_0x3ba9('0x15')]);}logger[_0x3ba9('0x13')]('Cdr,\x20%s,\x20%s',_0x1dc9a2,_0x1e5d50[_0x3ba9('0x13')]['message']);return _0x1934e7(_0x1e5d50[_0x3ba9('0x13')][_0x3ba9('0x15')]);}else{logger['info'](_0x3ba9('0x10'),_0x1dc9a2,'request\x20sent');_0x1934e7(_0x1e5d50[_0x3ba9('0x16')][_0x3ba9('0x15')]);}})['catch'](function(_0x24b7c2){logger[_0x3ba9('0x13')]('Cdr,\x20%s,\x20%s',_0x1dc9a2,_0x24b7c2);_0x7d64e9(_0x24b7c2);});});}
\ No newline at end of file
+var _0x34c3=['debug','code','error','message','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x34c3,0xe1));var _0x334c=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x34c3[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x334c('0x0'));var util=require(_0x334c('0x1'));var moment=require(_0x334c('0x2'));var BPromise=require(_0x334c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x334c('0x4'));var logger=require(_0x334c('0x5'))(_0x334c('0x6'));var config=require('../../config/environment');var jayson=require(_0x334c('0x7'));var client=jayson[_0x334c('0x8')][_0x334c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x486dfe,_0x47e52e,_0x1e9a43){return new BPromise(function(_0x43f5c2,_0xe6b6a9){return client[_0x334c('0xa')](_0x486dfe,_0x1e9a43)[_0x334c('0xb')](function(_0x2c39af){logger[_0x334c('0xc')](_0x334c('0xd'),_0x47e52e,_0x334c('0xe'));logger[_0x334c('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x47e52e,_0x334c('0xe'),JSON['stringify'](_0x2c39af));if(_0x2c39af['error']){if(_0x2c39af['error'][_0x334c('0x10')]===0x1f4){logger[_0x334c('0x11')](_0x334c('0xd'),_0x47e52e,_0x2c39af[_0x334c('0x11')]['message']);return _0xe6b6a9(_0x2c39af[_0x334c('0x11')][_0x334c('0x12')]);}logger[_0x334c('0x11')](_0x334c('0xd'),_0x47e52e,_0x2c39af[_0x334c('0x11')][_0x334c('0x12')]);return _0x43f5c2(_0x2c39af[_0x334c('0x11')][_0x334c('0x12')]);}else{logger[_0x334c('0xc')](_0x334c('0xd'),_0x47e52e,_0x334c('0xe'));_0x43f5c2(_0x2c39af['result'][_0x334c('0x12')]);}})[_0x334c('0x13')](function(_0x3ac76e){logger[_0x334c('0x11')](_0x334c('0xd'),_0x47e52e,_0x3ac76e);_0xe6b6a9(_0x3ac76e);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index d852076..4719d10 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(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_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['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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2c4e1b,_0x48a2dc){var _0x335117=function(_0x3cac61){while(--_0x3cac61){_0x2c4e1b['push'](_0x2c4e1b['shift']());}};_0x335117(++_0x48a2dc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 5dcd7d6..941ffa3 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 _0xae4c=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x590195,_0x559e2a){var _0x4251a3=function(_0x2dd2ab){while(--_0x2dd2ab){_0x590195['push'](_0x590195['shift']());}};_0x4251a3(++_0x559e2a);}(_0xae4c,0xa2));var _0xcae4=function(_0x16de43,_0x2bb75f){_0x16de43=_0x16de43-0x0;var _0x2aaa5d=_0xae4c[_0x16de43];return _0x2aaa5d;};'use strict';var Sequelize=require(_0xcae4('0x0'));module[_0xcae4('0x1')]={'priority':{'type':Sequelize[_0xcae4('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcae4('0x3')},'appdata':{'type':Sequelize[_0xcae4('0x4')]()},'description':{'type':Sequelize[_0xcae4('0x5')]},'interval':{'type':Sequelize[_0xcae4('0x5')],'defaultValue':_0xcae4('0x6')}};
\ No newline at end of file
+var _0x4942=['noop','TEXT','STRING','exports','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4942,0x12a));var _0x2494=function(_0x18656b,_0x427122){_0x18656b=_0x18656b-0x0;var _0x2612ec=_0x4942[_0x18656b];return _0x2612ec;};'use strict';var Sequelize=require('sequelize');module[_0x2494('0x0')]={'priority':{'type':Sequelize[_0x2494('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2494('0x2')},'appdata':{'type':Sequelize[_0x2494('0x3')]()},'description':{'type':Sequelize[_0x2494('0x4')]},'interval':{'type':Sequelize[_0x2494('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 64abd4b..3ede5f1 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 _0x1c8a=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','model','keys','rawAttributes','query','attributes','intersection','fields','length','include','options','ChatApplication','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0x1c8a,0x140));var _0xa1c8=function(_0x5933e0,_0x5b4d80){_0x5933e0=_0x5933e0-0x0;var _0x91492d=_0x1c8a[_0x5933e0];return _0x91492d;};'use strict';var emlformat=require(_0xa1c8('0x0'));var rimraf=require(_0xa1c8('0x1'));var zipdir=require(_0xa1c8('0x2'));var jsonpatch=require(_0xa1c8('0x3'));var rp=require(_0xa1c8('0x4'));var moment=require('moment');var BPromise=require(_0xa1c8('0x5'));var Mustache=require('mustache');var util=require(_0xa1c8('0x6'));var path=require(_0xa1c8('0x7'));var sox=require(_0xa1c8('0x8'));var csv=require('to-csv');var ejs=require(_0xa1c8('0x9'));var fs=require('fs');var fs_extra=require(_0xa1c8('0xa'));var _=require(_0xa1c8('0xb'));var squel=require('squel');var crypto=require(_0xa1c8('0xc'));var jsforce=require(_0xa1c8('0xd'));var deskjs=require(_0xa1c8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1c8('0xf'));var Papa=require(_0xa1c8('0x10'));var Redis=require(_0xa1c8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1c8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1c8('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1c8('0x14'));var db=require(_0xa1c8('0x15'))['db'];function respondWithStatusCode(_0x2647fa,_0x707249){_0x707249=_0x707249||0xcc;return function(_0x644e9c){if(_0x644e9c){return _0x2647fa[_0xa1c8('0x16')](_0x707249);}return _0x2647fa['status'](_0x707249)[_0xa1c8('0x17')]();};}function respondWithResult(_0x282525,_0xcccc7b){_0xcccc7b=_0xcccc7b||0xc8;return function(_0x3797fe){if(_0x3797fe){return _0x282525[_0xa1c8('0x18')](_0xcccc7b)[_0xa1c8('0x19')](_0x3797fe);}};}function respondWithFilteredResult(_0x517130,_0x7f1128){return function(_0x51b1c3){if(_0x51b1c3){var _0x17d4d2=typeof _0x7f1128[_0xa1c8('0x1a')]===_0xa1c8('0x1b')&&typeof _0x7f1128['limit']===_0xa1c8('0x1b');var _0x59284a=_0x51b1c3['count'];var _0x1fe87f=_0x17d4d2?0x0:_0x7f1128[_0xa1c8('0x1a')];var _0x57fe23=_0x17d4d2?_0x51b1c3[_0xa1c8('0x1c')]:_0x7f1128[_0xa1c8('0x1a')]+_0x7f1128[_0xa1c8('0x1d')];var _0x4e967e;if(_0x57fe23>=_0x59284a){_0x57fe23=_0x59284a;_0x4e967e=0xc8;}else{_0x4e967e=0xce;}_0x517130[_0xa1c8('0x18')](_0x4e967e);return _0x517130[_0xa1c8('0x1e')](_0xa1c8('0x1f'),_0x1fe87f+'-'+_0x57fe23+'/'+_0x59284a)['json'](_0x51b1c3);}return null;};}function patchUpdates(_0x2eabb2){return function(_0x874b1f){try{jsonpatch['apply'](_0x874b1f,_0x2eabb2,!![]);}catch(_0x38008a){return BPromise[_0xa1c8('0x20')](_0x38008a);}return _0x874b1f[_0xa1c8('0x21')]();};}function saveUpdates(_0x2a7fa5,_0x19fe5a){return function(_0x23ff11){if(_0x23ff11){return _0x23ff11[_0xa1c8('0x22')](_0x2a7fa5)[_0xa1c8('0x23')](function(_0x40bb1d){return _0x40bb1d;});}return null;};}function removeEntity(_0x193077,_0x28473c){return function(_0x125047){if(_0x125047){return _0x125047[_0xa1c8('0x24')]()[_0xa1c8('0x23')](function(){_0x193077[_0xa1c8('0x18')](0xcc)[_0xa1c8('0x17')]();});}};}function handleEntityNotFound(_0x572362,_0x1e9a50){return function(_0x550b68){if(!_0x550b68){_0x572362[_0xa1c8('0x16')](0x194);}return _0x550b68;};}function handleError(_0x4efb73,_0x404cb8){_0x404cb8=_0x404cb8||0x1f4;return function(_0x508742){logger[_0xa1c8('0x25')](_0x508742['stack']);if(_0x508742[_0xa1c8('0x26')]){delete _0x508742[_0xa1c8('0x26')];}_0x4efb73[_0xa1c8('0x18')](_0x404cb8)[_0xa1c8('0x27')](_0x508742);};}exports['show']=function(_0x23131b,_0x404fa1){var _0x28b9e5={'raw':!![],'where':{'id':_0x23131b['params']['id']}},_0x4d0a4f={};_0x4d0a4f[_0xa1c8('0x28')]=_[_0xa1c8('0x29')](db['ChatApplication'][_0xa1c8('0x2a')]);_0x4d0a4f[_0xa1c8('0x2b')]=_[_0xa1c8('0x29')](_0x23131b['query']);_0x4d0a4f['filters']=_['intersection'](_0x4d0a4f[_0xa1c8('0x28')],_0x4d0a4f['query']);_0x28b9e5[_0xa1c8('0x2c')]=_[_0xa1c8('0x2d')](_0x4d0a4f[_0xa1c8('0x28')],qs[_0xa1c8('0x2e')](_0x23131b[_0xa1c8('0x2b')][_0xa1c8('0x2e')]));_0x28b9e5['attributes']=_0x28b9e5[_0xa1c8('0x2c')][_0xa1c8('0x2f')]?_0x28b9e5[_0xa1c8('0x2c')]:_0x4d0a4f[_0xa1c8('0x28')];if(_0x23131b['query']['includeAll']){_0x28b9e5[_0xa1c8('0x30')]=[{'all':!![]}];}_0x28b9e5=_['merge']({},_0x28b9e5,_0x23131b[_0xa1c8('0x31')]);return db[_0xa1c8('0x32')][_0xa1c8('0x33')](_0x28b9e5)[_0xa1c8('0x23')](handleEntityNotFound(_0x404fa1,null))[_0xa1c8('0x23')](respondWithResult(_0x404fa1,null))[_0xa1c8('0x34')](handleError(_0x404fa1,null));};exports[_0xa1c8('0x22')]=function(_0xb4441e,_0x55c485){if(_0xb4441e[_0xa1c8('0x35')]['id']){delete _0xb4441e[_0xa1c8('0x35')]['id'];}return db[_0xa1c8('0x32')][_0xa1c8('0x33')]({'where':{'id':_0xb4441e[_0xa1c8('0x36')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x55c485,null))[_0xa1c8('0x23')](saveUpdates(_0xb4441e[_0xa1c8('0x35')],null))[_0xa1c8('0x23')](respondWithResult(_0x55c485,null))[_0xa1c8('0x34')](handleError(_0x55c485,null));};exports[_0xa1c8('0x24')]=function(_0x4205f0,_0x3d6b35){return db[_0xa1c8('0x32')]['find']({'where':{'id':_0x4205f0['params']['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x3d6b35,null))[_0xa1c8('0x23')](removeEntity(_0x3d6b35,null))[_0xa1c8('0x34')](handleError(_0x3d6b35,null));};
\ No newline at end of file
+var _0xbfcc=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','reject','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','attributes','intersection','fields','options','find','catch','update','body','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto'];(function(_0xc39233,_0x1765bc){var _0xc8acb2=function(_0x2d67a4){while(--_0x2d67a4){_0xc39233['push'](_0xc39233['shift']());}};_0xc8acb2(++_0x1765bc);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbfcc[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];function respondWithStatusCode(_0x4e8b34,_0x3bfd05){_0x3bfd05=_0x3bfd05||0xcc;return function(_0x86f67c){if(_0x86f67c){return _0x4e8b34[_0xcbfc('0x16')](_0x3bfd05);}return _0x4e8b34['status'](_0x3bfd05)[_0xcbfc('0x17')]();};}function respondWithResult(_0x3ec338,_0x2f2bdd){_0x2f2bdd=_0x2f2bdd||0xc8;return function(_0x45a5cc){if(_0x45a5cc){return _0x3ec338[_0xcbfc('0x18')](_0x2f2bdd)['json'](_0x45a5cc);}};}function respondWithFilteredResult(_0x3c69ed,_0x1963de){return function(_0x1ec8c4){if(_0x1ec8c4){var _0x4317e4=typeof _0x1963de['offset']==='undefined'&&typeof _0x1963de[_0xcbfc('0x19')]===_0xcbfc('0x1a');var _0xa65368=_0x1ec8c4['count'];var _0x5b078f=_0x4317e4?0x0:_0x1963de[_0xcbfc('0x1b')];var _0x99b59d=_0x4317e4?_0x1ec8c4[_0xcbfc('0x1c')]:_0x1963de['offset']+_0x1963de[_0xcbfc('0x19')];var _0x552777;if(_0x99b59d>=_0xa65368){_0x99b59d=_0xa65368;_0x552777=0xc8;}else{_0x552777=0xce;}_0x3c69ed[_0xcbfc('0x18')](_0x552777);return _0x3c69ed[_0xcbfc('0x1d')](_0xcbfc('0x1e'),_0x5b078f+'-'+_0x99b59d+'/'+_0xa65368)[_0xcbfc('0x1f')](_0x1ec8c4);}return null;};}function patchUpdates(_0x25c167){return function(_0x2653b1){try{jsonpatch['apply'](_0x2653b1,_0x25c167,!![]);}catch(_0x9c79da){return BPromise[_0xcbfc('0x20')](_0x9c79da);}return _0x2653b1['save']();};}function saveUpdates(_0x1da958,_0x5a449b){return function(_0x4cc8b3){if(_0x4cc8b3){return _0x4cc8b3['update'](_0x1da958)[_0xcbfc('0x21')](function(_0x4a0fcb){return _0x4a0fcb;});}return null;};}function removeEntity(_0x4a1915,_0x1b3e42){return function(_0x34cffa){if(_0x34cffa){return _0x34cffa[_0xcbfc('0x22')]()[_0xcbfc('0x21')](function(){_0x4a1915['status'](0xcc)[_0xcbfc('0x17')]();});}};}function handleEntityNotFound(_0x51284a,_0x280b78){return function(_0x75bca0){if(!_0x75bca0){_0x51284a['sendStatus'](0x194);}return _0x75bca0;};}function handleError(_0x28bdcf,_0x3b73a3){_0x3b73a3=_0x3b73a3||0x1f4;return function(_0x4ab48e){logger[_0xcbfc('0x23')](_0x4ab48e[_0xcbfc('0x24')]);if(_0x4ab48e[_0xcbfc('0x25')]){delete _0x4ab48e[_0xcbfc('0x25')];}_0x28bdcf['status'](_0x3b73a3)[_0xcbfc('0x26')](_0x4ab48e);};}exports[_0xcbfc('0x27')]=function(_0x4f632a,_0x1f6a14){var _0x26463f={'raw':!![],'where':{'id':_0x4f632a[_0xcbfc('0x28')]['id']}},_0x7cbdfa={};_0x7cbdfa[_0xcbfc('0x29')]=_[_0xcbfc('0x2a')](db[_0xcbfc('0x2b')]['rawAttributes']);_0x7cbdfa[_0xcbfc('0x2c')]=_[_0xcbfc('0x2a')](_0x4f632a[_0xcbfc('0x2c')]);_0x7cbdfa[_0xcbfc('0x2d')]=_['intersection'](_0x7cbdfa[_0xcbfc('0x29')],_0x7cbdfa[_0xcbfc('0x2c')]);_0x26463f[_0xcbfc('0x2e')]=_[_0xcbfc('0x2f')](_0x7cbdfa[_0xcbfc('0x29')],qs[_0xcbfc('0x30')](_0x4f632a[_0xcbfc('0x2c')]['fields']));_0x26463f[_0xcbfc('0x2e')]=_0x26463f[_0xcbfc('0x2e')]['length']?_0x26463f[_0xcbfc('0x2e')]:_0x7cbdfa[_0xcbfc('0x29')];if(_0x4f632a[_0xcbfc('0x2c')]['includeAll']){_0x26463f['include']=[{'all':!![]}];}_0x26463f=_['merge']({},_0x26463f,_0x4f632a[_0xcbfc('0x31')]);return db[_0xcbfc('0x2b')][_0xcbfc('0x32')](_0x26463f)[_0xcbfc('0x21')](handleEntityNotFound(_0x1f6a14,null))[_0xcbfc('0x21')](respondWithResult(_0x1f6a14,null))[_0xcbfc('0x33')](handleError(_0x1f6a14,null));};exports[_0xcbfc('0x34')]=function(_0xc5176f,_0x49ad63){if(_0xc5176f[_0xcbfc('0x35')]['id']){delete _0xc5176f[_0xcbfc('0x35')]['id'];}return db['ChatApplication'][_0xcbfc('0x32')]({'where':{'id':_0xc5176f['params']['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x49ad63,null))[_0xcbfc('0x21')](saveUpdates(_0xc5176f[_0xcbfc('0x35')],null))['then'](respondWithResult(_0x49ad63,null))[_0xcbfc('0x33')](handleError(_0x49ad63,null));};exports['destroy']=function(_0x5af34d,_0x2baf2f){return db[_0xcbfc('0x2b')][_0xcbfc('0x32')]({'where':{'id':_0x5af34d[_0xcbfc('0x28')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x2baf2f,null))[_0xcbfc('0x21')](removeEntity(_0x2baf2f,null))[_0xcbfc('0x33')](handleError(_0x2baf2f,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index c8c69ea..844b944 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 _0xfb78=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x26ce09,_0x495d74){var _0x482a5a=function(_0x1778f8){while(--_0x1778f8){_0x26ce09['push'](_0x26ce09['shift']());}};_0x482a5a(++_0x495d74);}(_0xfb78,0x141));var _0x8fb7=function(_0x53ddab,_0x4ada9d){_0x53ddab=_0x53ddab-0x0;var _0x5819ac=_0xfb78[_0x53ddab];return _0x5819ac;};'use strict';var _=require(_0x8fb7('0x0'));var util=require(_0x8fb7('0x1'));var logger=require(_0x8fb7('0x2'))(_0x8fb7('0x3'));var moment=require('moment');var BPromise=require(_0x8fb7('0x4'));var rp=require(_0x8fb7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fb7('0x6'));var config=require(_0x8fb7('0x7'));var attributes=require(_0x8fb7('0x8'));module[_0x8fb7('0x9')]=function(_0x5ef4b0,_0x2db8ae){return _0x5ef4b0[_0x8fb7('0xa')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8fb7('0xb'),'collate':_0x8fb7('0xc')});};
\ No newline at end of file
+var _0x2ba4=['api','moment','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x18edae,_0x3496ef){var _0x562e93=function(_0x325375){while(--_0x325375){_0x18edae['push'](_0x18edae['shift']());}};_0x562e93(++_0x3496ef);}(_0x2ba4,0x184));var _0x42ba=function(_0x49870c,_0xf03aee){_0x49870c=_0x49870c-0x0;var _0x57434a=_0x2ba4[_0x49870c];return _0x57434a;};'use strict';var _=require(_0x42ba('0x0'));var util=require(_0x42ba('0x1'));var logger=require('../../config/logger')(_0x42ba('0x2'));var moment=require(_0x42ba('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x42ba('0x4'));var rimraf=require(_0x42ba('0x5'));var config=require(_0x42ba('0x6'));var attributes=require(_0x42ba('0x7'));module['exports']=function(_0x4a2987,_0x34b638){return _0x4a2987[_0x42ba('0x8')](_0x42ba('0x9'),attributes,{'tableName':_0x42ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x42ba('0xb'),'collate':_0x42ba('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 38591bd..8235dae 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 _0xc5f2=['ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x336f4d,_0xed10b0){var _0x4abef8=function(_0x2e70c4){while(--_0x2e70c4){_0x336f4d['push'](_0x336f4d['shift']());}};_0x4abef8(++_0xed10b0);}(_0xc5f2,0x1ea));var _0x2c5f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc5f2[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x2c5f('0x0'));var util=require(_0x2c5f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c5f('0x2'));var db=require(_0x2c5f('0x3'))['db'];var utils=require(_0x2c5f('0x4'));var logger=require(_0x2c5f('0x5'))(_0x2c5f('0x6'));var config=require(_0x2c5f('0x7'));var jayson=require(_0x2c5f('0x8'));var client=jayson[_0x2c5f('0x9')][_0x2c5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ad73,_0x6cfc10,_0x44fbbd){return new BPromise(function(_0x6c9da0,_0x218a43){return client[_0x2c5f('0xb')](_0x27ad73,_0x44fbbd)[_0x2c5f('0xc')](function(_0x2ecf2f){logger[_0x2c5f('0xd')](_0x2c5f('0xe'),_0x6cfc10,_0x2c5f('0xf'));logger['debug'](_0x2c5f('0x10'),_0x6cfc10,_0x2c5f('0xf'),JSON['stringify'](_0x2ecf2f));if(_0x2ecf2f[_0x2c5f('0x11')]){if(_0x2ecf2f[_0x2c5f('0x11')][_0x2c5f('0x12')]===0x1f4){logger[_0x2c5f('0x11')](_0x2c5f('0xe'),_0x6cfc10,_0x2ecf2f[_0x2c5f('0x11')][_0x2c5f('0x13')]);return _0x218a43(_0x2ecf2f[_0x2c5f('0x11')][_0x2c5f('0x13')]);}logger[_0x2c5f('0x11')](_0x2c5f('0xe'),_0x6cfc10,_0x2ecf2f[_0x2c5f('0x11')]['message']);return _0x6c9da0(_0x2ecf2f['error'][_0x2c5f('0x13')]);}else{logger[_0x2c5f('0xd')]('ChatApplication,\x20%s,\x20%s',_0x6cfc10,'request\x20sent');_0x6c9da0(_0x2ecf2f[_0x2c5f('0x14')][_0x2c5f('0x13')]);}})[_0x2c5f('0x15')](function(_0x44ab5b){logger[_0x2c5f('0x11')](_0x2c5f('0xe'),_0x6cfc10,_0x44ab5b);_0x218a43(_0x44ab5b);});});}
\ No newline at end of file
+var _0x30f4=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x12a58e,_0x443e99){var _0x3a81b7=function(_0x4b444f){while(--_0x4b444f){_0x12a58e['push'](_0x12a58e['shift']());}};_0x3a81b7(++_0x443e99);}(_0x30f4,0x1bf));var _0x430f=function(_0x5806cd,_0x1c26f4){_0x5806cd=_0x5806cd-0x0;var _0x47495e=_0x30f4[_0x5806cd];return _0x47495e;};'use strict';var _=require(_0x430f('0x0'));var util=require(_0x430f('0x1'));var moment=require('moment');var BPromise=require(_0x430f('0x2'));var rs=require(_0x430f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x430f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x430f('0x5'))(_0x430f('0x6'));var config=require(_0x430f('0x7'));var jayson=require(_0x430f('0x8'));var client=jayson[_0x430f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc955,_0x73877e,_0x7ac4c7){return new BPromise(function(_0x3ffe2c,_0x4d0ebf){return client[_0x430f('0xa')](_0x3cc955,_0x7ac4c7)[_0x430f('0xb')](function(_0x75345){logger[_0x430f('0xc')](_0x430f('0xd'),_0x73877e,_0x430f('0xe'));logger['debug'](_0x430f('0xf'),_0x73877e,_0x430f('0xe'),JSON[_0x430f('0x10')](_0x75345));if(_0x75345[_0x430f('0x11')]){if(_0x75345[_0x430f('0x11')][_0x430f('0x12')]===0x1f4){logger[_0x430f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x73877e,_0x75345['error']['message']);return _0x4d0ebf(_0x75345[_0x430f('0x11')]['message']);}logger[_0x430f('0x11')](_0x430f('0xd'),_0x73877e,_0x75345[_0x430f('0x11')][_0x430f('0x13')]);return _0x3ffe2c(_0x75345[_0x430f('0x11')][_0x430f('0x13')]);}else{logger['info'](_0x430f('0xd'),_0x73877e,_0x430f('0xe'));_0x3ffe2c(_0x75345[_0x430f('0x14')][_0x430f('0x13')]);}})['catch'](function(_0x50039b){logger[_0x430f('0x11')](_0x430f('0xd'),_0x73877e,_0x50039b);_0x4d0ebf(_0x50039b);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 905a2d7..a0009f7 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 _0x1fc2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','fs-extra'];(function(_0x29792f,_0x5ab098){var _0x300e7b=function(_0x32b5bb){while(--_0x32b5bb){_0x29792f['push'](_0x29792f['shift']());}};_0x300e7b(++_0x5ab098);}(_0x1fc2,0xcd));var _0x21fc=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x1fc2[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require(_0x21fc('0x0'));var path=require(_0x21fc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x21fc('0x2'));var auth=require(_0x21fc('0x3'));var interaction=require(_0x21fc('0x4'));var config=require(_0x21fc('0x5'));var controller=require(_0x21fc('0x6'));router[_0x21fc('0x7')](_0x21fc('0x8'),auth[_0x21fc('0x9')](),controller[_0x21fc('0xa')]);router[_0x21fc('0xb')](_0x21fc('0x8'),auth[_0x21fc('0x9')](),controller[_0x21fc('0xc')]);router[_0x21fc('0xd')](_0x21fc('0x8'),auth[_0x21fc('0x9')](),controller[_0x21fc('0xe')]);module[_0x21fc('0xf')]=router;
\ No newline at end of file
+var _0x5318=['get','/:id','isAuthenticated','show','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x4c1c6a,_0x4c1ef5){var _0x59a9df=function(_0x6825f8){while(--_0x6825f8){_0x4c1c6a['push'](_0x4c1c6a['shift']());}};_0x59a9df(++_0x4c1ef5);}(_0x5318,0xf1));var _0x8531=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0x5318[_0x2bf888];return _0x3038d6;};'use strict';var multer=require(_0x8531('0x0'));var util=require(_0x8531('0x1'));var path=require(_0x8531('0x2'));var timeout=require(_0x8531('0x3'));var express=require(_0x8531('0x4'));var router=express[_0x8531('0x5')]();var fs_extra=require(_0x8531('0x6'));var auth=require(_0x8531('0x7'));var interaction=require(_0x8531('0x8'));var config=require(_0x8531('0x9'));var controller=require(_0x8531('0xa'));router[_0x8531('0xb')](_0x8531('0xc'),auth[_0x8531('0xd')](),controller[_0x8531('0xe')]);router[_0x8531('0xf')](_0x8531('0xc'),auth['isAuthenticated'](),controller[_0x8531('0x10')]);router[_0x8531('0x11')](_0x8531('0xc'),auth[_0x8531('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 83992b3..0e99b1e 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 _0x398a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x398a,0x11a));var _0xa398=function(_0xb560d3,_0x88481){_0xb560d3=_0xb560d3-0x0;var _0x31eda6=_0x398a[_0xb560d3];return _0x31eda6;};'use strict';var Sequelize=require(_0xa398('0x0'));module[_0xa398('0x1')]={'name':{'type':Sequelize[_0xa398('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa398('0x2')]},'write':{'type':Sequelize[_0xa398('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xdf76=['BOOLEAN','sequelize','exports','STRING'];(function(_0x29ceb8,_0x4521b3){var _0x3608c8=function(_0x45595a){while(--_0x45595a){_0x29ceb8['push'](_0x29ceb8['shift']());}};_0x3608c8(++_0x4521b3);}(_0xdf76,0x1d5));var _0x6df7=function(_0x1d0fa7,_0x1ad70f){_0x1d0fa7=_0x1d0fa7-0x0;var _0x5b2d91=_0xdf76[_0x1d0fa7];return _0x5b2d91;};'use strict';var Sequelize=require(_0x6df7('0x0'));module[_0x6df7('0x1')]={'name':{'type':Sequelize[_0x6df7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6df7('0x2')]},'write':{'type':Sequelize[_0x6df7('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 6a7a343..8f5cb1a 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 _0x1638=['keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','getUnread','user','addMembers','ids','omit','getMembers','findOne','User','order','filter','nolimit','removeMembers','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','fieldName'];(function(_0x5b9717,_0x464976){var _0x375515=function(_0x24a749){while(--_0x24a749){_0x5b9717['push'](_0x5b9717['shift']());}};_0x375515(++_0x464976);}(_0x1638,0x1e8));var _0x8163=function(_0x45b1ad,_0x215b03){_0x45b1ad=_0x45b1ad-0x0;var _0x3d5696=_0x1638[_0x45b1ad];return _0x3d5696;};'use strict';var emlformat=require(_0x8163('0x0'));var rimraf=require(_0x8163('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8163('0x2'));var rp=require(_0x8163('0x3'));var moment=require(_0x8163('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8163('0x5'));var util=require(_0x8163('0x6'));var path=require(_0x8163('0x7'));var sox=require(_0x8163('0x8'));var csv=require(_0x8163('0x9'));var ejs=require(_0x8163('0xa'));var fs=require('fs');var fs_extra=require(_0x8163('0xb'));var _=require(_0x8163('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8163('0xd'));var toCsv=require(_0x8163('0x9'));var querystring=require(_0x8163('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8163('0xf'));var logger=require(_0x8163('0x10'))('api');var utils=require(_0x8163('0x11'));var config=require(_0x8163('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8163('0x13'))['db'];config['redis']=_['defaults'](config[_0x8163('0x14')],{'host':_0x8163('0x15'),'port':0x18eb});var socket=require(_0x8163('0x16'))(new Redis(config[_0x8163('0x14')]));require(_0x8163('0x17'))['register'](socket);function respondWithStatusCode(_0x250219,_0x1b0d71){_0x1b0d71=_0x1b0d71||0xcc;return function(_0x46f3f9){if(_0x46f3f9){return _0x250219['sendStatus'](_0x1b0d71);}return _0x250219['status'](_0x1b0d71)[_0x8163('0x18')]();};}function respondWithResult(_0xc84c26,_0x115f23){_0x115f23=_0x115f23||0xc8;return function(_0x3012b6){if(_0x3012b6){return _0xc84c26[_0x8163('0x19')](_0x115f23)['json'](_0x3012b6);}};}function respondWithFilteredResult(_0x486cdf,_0x50c03d){return function(_0xdc8c78){if(_0xdc8c78){var _0x489dc2=typeof _0x50c03d[_0x8163('0x1a')]===_0x8163('0x1b')&&typeof _0x50c03d[_0x8163('0x1c')]===_0x8163('0x1b');var _0x7183c9=_0xdc8c78[_0x8163('0x1d')];var _0x41d74e=_0x489dc2?0x0:_0x50c03d[_0x8163('0x1a')];var _0x4b002a=_0x489dc2?_0xdc8c78[_0x8163('0x1d')]:_0x50c03d['offset']+_0x50c03d[_0x8163('0x1c')];var _0x4f825d;if(_0x4b002a>=_0x7183c9){_0x4b002a=_0x7183c9;_0x4f825d=0xc8;}else{_0x4f825d=0xce;}_0x486cdf[_0x8163('0x19')](_0x4f825d);return _0x486cdf['set'](_0x8163('0x1e'),_0x41d74e+'-'+_0x4b002a+'/'+_0x7183c9)[_0x8163('0x1f')](_0xdc8c78);}return null;};}function patchUpdates(_0x282654){return function(_0x5e0307){try{jsonpatch[_0x8163('0x20')](_0x5e0307,_0x282654,!![]);}catch(_0x544afe){return BPromise[_0x8163('0x21')](_0x544afe);}return _0x5e0307['save']();};}function saveUpdates(_0x4aa156,_0x1b4ed2){return function(_0x22170f){if(_0x22170f){return _0x22170f[_0x8163('0x22')](_0x4aa156)[_0x8163('0x23')](function(_0x1794dc){return _0x1794dc;});}return null;};}function removeEntity(_0x176ece,_0x284045){return function(_0x1a0f19){if(_0x1a0f19){return _0x1a0f19[_0x8163('0x24')]()[_0x8163('0x23')](function(){_0x176ece[_0x8163('0x19')](0xcc)[_0x8163('0x18')]();});}};}function handleEntityNotFound(_0x35025c,_0x40c578){return function(_0x1944c4){if(!_0x1944c4){_0x35025c[_0x8163('0x25')](0x194);}return _0x1944c4;};}function handleError(_0x18b873,_0x18e807){_0x18e807=_0x18e807||0x1f4;return function(_0xfedc1d){logger[_0x8163('0x26')](_0xfedc1d[_0x8163('0x27')]);if(_0xfedc1d[_0x8163('0x28')]){delete _0xfedc1d[_0x8163('0x28')];}_0x18b873[_0x8163('0x19')](_0x18e807)[_0x8163('0x29')](_0xfedc1d);};}exports[_0x8163('0x2a')]=function(_0x23012b,_0x4a2b30){var _0x136151={},_0x1298a2={},_0x15eebd={'count':0x0,'rows':[]};var _0x2d3d63=_[_0x8163('0x2b')](db[_0x8163('0x2c')]['rawAttributes'],function(_0x45ada8){return{'name':_0x45ada8[_0x8163('0x2d')],'type':_0x45ada8['type']['key']};});_0x1298a2['model']=_['map'](_0x2d3d63,_0x8163('0x28'));_0x1298a2['query']=_[_0x8163('0x2e')](_0x23012b['query']);_0x1298a2[_0x8163('0x2f')]=_[_0x8163('0x30')](_0x1298a2[_0x8163('0x31')],_0x1298a2[_0x8163('0x32')]);_0x136151['attributes']=_[_0x8163('0x30')](_0x1298a2[_0x8163('0x31')],qs[_0x8163('0x33')](_0x23012b[_0x8163('0x32')][_0x8163('0x33')]));_0x136151[_0x8163('0x34')]=_0x136151['attributes'][_0x8163('0x35')]?_0x136151[_0x8163('0x34')]:_0x1298a2[_0x8163('0x31')];if(!_0x23012b[_0x8163('0x32')][_0x8163('0x36')]('nolimit')){_0x136151['limit']=qs[_0x8163('0x1c')](_0x23012b[_0x8163('0x32')][_0x8163('0x1c')]);_0x136151['offset']=qs[_0x8163('0x1a')](_0x23012b[_0x8163('0x32')][_0x8163('0x1a')]);}_0x136151['order']=qs[_0x8163('0x37')](_0x23012b[_0x8163('0x32')]['sort']);_0x136151[_0x8163('0x38')]=qs['filters'](_[_0x8163('0x39')](_0x23012b['query'],_0x1298a2[_0x8163('0x2f')]),_0x2d3d63);if(_0x23012b[_0x8163('0x32')]['filter']){_0x136151[_0x8163('0x38')]=_[_0x8163('0x3a')](_0x136151['where'],{'$or':_[_0x8163('0x2b')](_0x2d3d63,function(_0xb0c379){if(_0xb0c379[_0x8163('0x3b')]!==_0x8163('0x3c')){var _0x4b38fd={};_0x4b38fd[_0xb0c379[_0x8163('0x28')]]={'$like':'%'+_0x23012b[_0x8163('0x32')]['filter']+'%'};return _0x4b38fd;}})});}_0x136151=_['merge']({},_0x136151,_0x23012b[_0x8163('0x3d')]);var _0x1d1fd2={'where':_0x136151[_0x8163('0x38')]};return db['ChatGroup'][_0x8163('0x1d')](_0x1d1fd2)[_0x8163('0x23')](function(_0x1a1ba6){_0x15eebd['count']=_0x1a1ba6;if(_0x23012b[_0x8163('0x32')][_0x8163('0x3e')]){_0x136151['include']=[{'all':!![]}];}return db[_0x8163('0x2c')][_0x8163('0x3f')](_0x136151);})[_0x8163('0x23')](function(_0x4b257){_0x15eebd['rows']=_0x4b257;return _0x15eebd;})[_0x8163('0x23')](respondWithFilteredResult(_0x4a2b30,_0x136151))[_0x8163('0x40')](handleError(_0x4a2b30,null));};exports[_0x8163('0x41')]=function(_0x3a81a9,_0x231fe2){var _0x35daf3={'raw':!![],'where':{'id':_0x3a81a9[_0x8163('0x42')]['id']}},_0x2c0fc5={};_0x2c0fc5[_0x8163('0x31')]=_[_0x8163('0x2e')](db[_0x8163('0x2c')][_0x8163('0x43')]);_0x2c0fc5['query']=_[_0x8163('0x2e')](_0x3a81a9[_0x8163('0x32')]);_0x2c0fc5[_0x8163('0x2f')]=_[_0x8163('0x30')](_0x2c0fc5[_0x8163('0x31')],_0x2c0fc5[_0x8163('0x32')]);_0x35daf3[_0x8163('0x34')]=_['intersection'](_0x2c0fc5['model'],qs[_0x8163('0x33')](_0x3a81a9[_0x8163('0x32')][_0x8163('0x33')]));_0x35daf3[_0x8163('0x34')]=_0x35daf3[_0x8163('0x34')][_0x8163('0x35')]?_0x35daf3[_0x8163('0x34')]:_0x2c0fc5['model'];if(_0x3a81a9[_0x8163('0x32')][_0x8163('0x3e')]){_0x35daf3[_0x8163('0x44')]=[{'all':!![]}];}_0x35daf3=_['merge']({},_0x35daf3,_0x3a81a9[_0x8163('0x3d')]);return db[_0x8163('0x2c')][_0x8163('0x45')](_0x35daf3)['then'](handleEntityNotFound(_0x231fe2,null))[_0x8163('0x23')](respondWithResult(_0x231fe2,null))[_0x8163('0x40')](handleError(_0x231fe2,null));};exports['create']=function(_0x1342ee,_0x5f0073){return db[_0x8163('0x2c')][_0x8163('0x46')](_0x1342ee[_0x8163('0x47')],{})[_0x8163('0x23')](respondWithResult(_0x5f0073,0xc9))[_0x8163('0x40')](handleError(_0x5f0073,null));};exports[_0x8163('0x22')]=function(_0x3131e8,_0x55e463){if(_0x3131e8['body']['id']){delete _0x3131e8['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3131e8[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x55e463,null))[_0x8163('0x23')](saveUpdates(_0x3131e8[_0x8163('0x47')],null))[_0x8163('0x23')](respondWithResult(_0x55e463,null))[_0x8163('0x40')](handleError(_0x55e463,null));};exports[_0x8163('0x24')]=function(_0x4bd7af,_0xdbc67b){return db[_0x8163('0x2c')][_0x8163('0x45')]({'where':{'id':_0x4bd7af[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0xdbc67b,null))[_0x8163('0x23')](removeEntity(_0xdbc67b,null))[_0x8163('0x40')](handleError(_0xdbc67b,null));};exports['describe']=function(_0x9e32ac,_0x52749c){return db[_0x8163('0x2c')]['describe']()[_0x8163('0x23')](respondWithResult(_0x52749c,null))[_0x8163('0x40')](handleError(_0x52749c,null));};exports[_0x8163('0x48')]=function(_0x4a9ef3,_0x5cdae8,_0x99570e){return db['ChatInternalMessage'][_0x8163('0x1d')]({'where':{'ChatGroupId':_0x4a9ef3[_0x8163('0x42')]['id'],'ToId':_0x4a9ef3[_0x8163('0x49')]['id'],'read':![]}})[_0x8163('0x23')](function(_0x179756){return{'id':_['toInteger'](_0x4a9ef3['params']['id']),'count':_0x179756};})[_0x8163('0x23')](respondWithResult(_0x5cdae8,null))['catch'](handleError(_0x5cdae8,null));};exports['addMembers']=function(_0x3c85d0,_0x66547a,_0x20314f){return db[_0x8163('0x2c')][_0x8163('0x45')]({'where':{'id':_0x3c85d0[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x66547a,null))[_0x8163('0x23')](function(_0x1f2381){if(_0x1f2381){return _0x1f2381[_0x8163('0x4a')](_0x3c85d0[_0x8163('0x47')][_0x8163('0x4b')],_[_0x8163('0x4c')](_0x3c85d0[_0x8163('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x66547a,null))[_0x8163('0x40')](handleError(_0x66547a,null));};exports[_0x8163('0x4d')]=function(_0x372cef,_0x4e8a6c,_0x5c0cca){var _0x5c0591={};var _0x32e1aa={};var _0x2c500a;var _0x622200;return db[_0x8163('0x2c')][_0x8163('0x4e')]({'where':{'id':_0x372cef[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x4e8a6c,null))[_0x8163('0x23')](function(_0x39a1e0){if(_0x39a1e0){_0x2c500a=_0x39a1e0;_0x32e1aa['model']=_['keys'](db[_0x8163('0x4f')][_0x8163('0x43')]);_0x32e1aa[_0x8163('0x32')]=_[_0x8163('0x2e')](_0x372cef[_0x8163('0x32')]);_0x32e1aa['filters']=_['intersection'](_0x32e1aa['model'],_0x32e1aa['query']);_0x5c0591[_0x8163('0x34')]=_[_0x8163('0x30')](_0x32e1aa[_0x8163('0x31')],qs[_0x8163('0x33')](_0x372cef[_0x8163('0x32')]['fields']));_0x5c0591[_0x8163('0x34')]=_0x5c0591['attributes'][_0x8163('0x35')]?_0x5c0591[_0x8163('0x34')]:_0x32e1aa[_0x8163('0x31')];_0x5c0591[_0x8163('0x50')]=qs['sort'](_0x372cef[_0x8163('0x32')][_0x8163('0x37')]);_0x5c0591[_0x8163('0x38')]=qs[_0x8163('0x2f')](_[_0x8163('0x39')](_0x372cef[_0x8163('0x32')],_0x32e1aa[_0x8163('0x2f')]));if(_0x372cef['query'][_0x8163('0x51')]){_0x5c0591[_0x8163('0x38')]=_[_0x8163('0x3a')](_0x5c0591[_0x8163('0x38')],{'$or':_[_0x8163('0x2b')](_0x5c0591['attributes'],function(_0x46378b){var _0x6c7a2b={};_0x6c7a2b[_0x46378b]={'$like':'%'+_0x372cef[_0x8163('0x32')][_0x8163('0x51')]+'%'};return _0x6c7a2b;})});}_0x5c0591=_['merge']({},_0x5c0591,_0x372cef['options']);return _0x2c500a['getMembers'](_0x5c0591);}})['then'](function(_0x2231ee){if(_0x2231ee){_0x622200=_0x2231ee[_0x8163('0x35')];if(!_0x372cef[_0x8163('0x32')][_0x8163('0x36')](_0x8163('0x52'))){_0x5c0591[_0x8163('0x1c')]=qs['limit'](_0x372cef[_0x8163('0x32')]['limit']);_0x5c0591[_0x8163('0x1a')]=qs[_0x8163('0x1a')](_0x372cef[_0x8163('0x32')][_0x8163('0x1a')]);}return _0x2c500a[_0x8163('0x4d')](_0x5c0591);}})[_0x8163('0x23')](function(_0x234767){if(_0x234767){return _0x234767?{'count':_0x622200,'rows':_0x234767}:null;}})[_0x8163('0x23')](respondWithResult(_0x4e8a6c,null))[_0x8163('0x40')](handleError(_0x4e8a6c,null));};exports['removeMembers']=function(_0x195b64,_0x3ae9f3,_0x780c28){return db[_0x8163('0x2c')][_0x8163('0x45')]({'where':{'id':_0x195b64[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x3ae9f3,null))[_0x8163('0x23')](function(_0x4d37bb){if(_0x4d37bb){return _0x4d37bb[_0x8163('0x53')](_0x195b64[_0x8163('0x32')][_0x8163('0x4b')]);}})['then'](respondWithStatusCode(_0x3ae9f3,null))[_0x8163('0x40')](handleError(_0x3ae9f3,null));};exports['addMessage']=function(_0xc068e4,_0x2f2511,_0x24dfd6){if(_0xc068e4[_0x8163('0x47')]['id']){delete _0xc068e4[_0x8163('0x47')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0xc068e4[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x2f2511,null))[_0x8163('0x23')](function(_0xfe020f){if(_0xfe020f){_0xc068e4[_0x8163('0x47')]['ChatGroupId']=_0xfe020f['id'];return db[_0x8163('0x54')]['create'](_0xc068e4[_0x8163('0x47')]);}})[_0x8163('0x23')](respondWithResult(_0x2f2511,null))[_0x8163('0x40')](handleError(_0x2f2511,null));};exports[_0x8163('0x55')]=function(_0xcd42a7,_0x493a15,_0x17b957){var _0x241c02={};var _0x2cb229={};var _0xcdafa1;var _0x55c543;return db[_0x8163('0x2c')][_0x8163('0x4e')]({'where':{'id':_0xcd42a7[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x493a15,null))[_0x8163('0x23')](function(_0x272986){if(_0x272986){_0xcdafa1=_0x272986;_0x2cb229['model']=_['keys'](db[_0x8163('0x54')][_0x8163('0x43')]);_0x2cb229[_0x8163('0x32')]=_[_0x8163('0x2e')](_0xcd42a7[_0x8163('0x32')]);_0x2cb229[_0x8163('0x2f')]=_[_0x8163('0x30')](_0x2cb229[_0x8163('0x31')],_0x2cb229[_0x8163('0x32')]);_0x241c02[_0x8163('0x34')]=_[_0x8163('0x30')](_0x2cb229[_0x8163('0x31')],qs[_0x8163('0x33')](_0xcd42a7[_0x8163('0x32')]['fields']));_0x241c02[_0x8163('0x34')]=_0x241c02[_0x8163('0x34')][_0x8163('0x35')]?_0x241c02[_0x8163('0x34')]:_0x2cb229[_0x8163('0x31')];_0x241c02[_0x8163('0x50')]=qs[_0x8163('0x37')](_0xcd42a7['query'][_0x8163('0x37')]);_0x241c02[_0x8163('0x38')]=qs[_0x8163('0x2f')](_['pick'](_0xcd42a7[_0x8163('0x32')],_0x2cb229['filters']));if(_0xcd42a7[_0x8163('0x32')]['filter']){_0x241c02[_0x8163('0x38')]=_[_0x8163('0x3a')](_0x241c02['where'],{'$or':_[_0x8163('0x2b')](_0x241c02[_0x8163('0x34')],function(_0x5bb63f){var _0x318462={};_0x318462[_0x5bb63f]={'$like':'%'+_0xcd42a7[_0x8163('0x32')][_0x8163('0x51')]+'%'};return _0x318462;})});}if(_0xcd42a7['query'][_0x8163('0x56')]){var _0x5d4d76=_0xcd42a7['query'][_0x8163('0x56')][_0x8163('0x57')](',');var _0x44e5a2={};_0x44e5a2[_0x5d4d76[0x0]]={'$gte':moment(_0x5d4d76[0x1])[_0x8163('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x241c02['where']=_[_0x8163('0x3a')](_0x241c02[_0x8163('0x38')],_0x44e5a2);}_0x241c02=_[_0x8163('0x3a')]({},_0x241c02,_0xcd42a7[_0x8163('0x3d')]);return _0xcdafa1[_0x8163('0x55')](_0x241c02);}})[_0x8163('0x23')](function(_0xd5c520){if(_0xd5c520){_0x55c543=_0xd5c520[_0x8163('0x35')];if(!_0xcd42a7[_0x8163('0x32')][_0x8163('0x36')](_0x8163('0x52'))){_0x241c02[_0x8163('0x1c')]=qs[_0x8163('0x1c')](_0xcd42a7[_0x8163('0x32')][_0x8163('0x1c')]);_0x241c02[_0x8163('0x1a')]=qs['offset'](_0xcd42a7[_0x8163('0x32')]['offset']);}return _0xcdafa1[_0x8163('0x55')](_0x241c02);}})[_0x8163('0x23')](function(_0x4863d1){if(_0x4863d1){return _0x4863d1?{'count':_0x55c543,'rows':_0x4863d1}:null;}})[_0x8163('0x23')](respondWithResult(_0x493a15,null))[_0x8163('0x40')](handleError(_0x493a15,null));};
\ No newline at end of file
+var _0xe0f4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','query','keys','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','catch','params','fields','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','intersection','getMembers','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0xe0f4,0x1bf));var _0x4e0f=function(_0x33fa47,_0xfa22bc){_0x33fa47=_0x33fa47-0x0;var _0x4d34be=_0xe0f4[_0x33fa47];return _0x4d34be;};'use strict';var emlformat=require(_0x4e0f('0x0'));var rimraf=require(_0x4e0f('0x1'));var zipdir=require(_0x4e0f('0x2'));var jsonpatch=require(_0x4e0f('0x3'));var rp=require(_0x4e0f('0x4'));var moment=require(_0x4e0f('0x5'));var BPromise=require(_0x4e0f('0x6'));var Mustache=require(_0x4e0f('0x7'));var util=require(_0x4e0f('0x8'));var path=require(_0x4e0f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e0f('0xa'));var fs=require('fs');var fs_extra=require(_0x4e0f('0xb'));var _=require('lodash');var squel=require(_0x4e0f('0xc'));var crypto=require('crypto');var jsforce=require(_0x4e0f('0xd'));var deskjs=require(_0x4e0f('0xe'));var toCsv=require(_0x4e0f('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4e0f('0x10'));var authService=require(_0x4e0f('0x11'));var qs=require(_0x4e0f('0x12'));var as=require(_0x4e0f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e0f('0x14'))(_0x4e0f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4e0f('0x16'))['db'];config[_0x4e0f('0x17')]=_[_0x4e0f('0x18')](config['redis'],{'host':_0x4e0f('0x19'),'port':0x18eb});var socket=require(_0x4e0f('0x1a'))(new Redis(config[_0x4e0f('0x17')]));require(_0x4e0f('0x1b'))[_0x4e0f('0x1c')](socket);function respondWithStatusCode(_0xe2f4d5,_0x1561bb){_0x1561bb=_0x1561bb||0xcc;return function(_0x2dfaec){if(_0x2dfaec){return _0xe2f4d5['sendStatus'](_0x1561bb);}return _0xe2f4d5[_0x4e0f('0x1d')](_0x1561bb)[_0x4e0f('0x1e')]();};}function respondWithResult(_0x379133,_0x35cd01){_0x35cd01=_0x35cd01||0xc8;return function(_0x488ea2){if(_0x488ea2){return _0x379133[_0x4e0f('0x1d')](_0x35cd01)[_0x4e0f('0x1f')](_0x488ea2);}};}function respondWithFilteredResult(_0xf3668d,_0x11a999){return function(_0x5017b6){if(_0x5017b6){var _0x1a6498=typeof _0x11a999[_0x4e0f('0x20')]===_0x4e0f('0x21')&&typeof _0x11a999['limit']===_0x4e0f('0x21');var _0x25aaa6=_0x5017b6[_0x4e0f('0x22')];var _0x145959=_0x1a6498?0x0:_0x11a999[_0x4e0f('0x20')];var _0x24167a=_0x1a6498?_0x5017b6[_0x4e0f('0x22')]:_0x11a999[_0x4e0f('0x20')]+_0x11a999[_0x4e0f('0x23')];var _0x1a32cd;if(_0x24167a>=_0x25aaa6){_0x24167a=_0x25aaa6;_0x1a32cd=0xc8;}else{_0x1a32cd=0xce;}_0xf3668d[_0x4e0f('0x1d')](_0x1a32cd);return _0xf3668d[_0x4e0f('0x24')](_0x4e0f('0x25'),_0x145959+'-'+_0x24167a+'/'+_0x25aaa6)['json'](_0x5017b6);}return null;};}function patchUpdates(_0x179116){return function(_0x590990){try{jsonpatch['apply'](_0x590990,_0x179116,!![]);}catch(_0x6b5d5b){return BPromise[_0x4e0f('0x26')](_0x6b5d5b);}return _0x590990[_0x4e0f('0x27')]();};}function saveUpdates(_0x1a232b,_0x354508){return function(_0x554f64){if(_0x554f64){return _0x554f64[_0x4e0f('0x28')](_0x1a232b)[_0x4e0f('0x29')](function(_0x45a05a){return _0x45a05a;});}return null;};}function removeEntity(_0x2eb20d,_0x47dc4c){return function(_0x596248){if(_0x596248){return _0x596248['destroy']()[_0x4e0f('0x29')](function(){_0x2eb20d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c8381,_0x23c174){return function(_0x46acf1){if(!_0x46acf1){_0x8c8381[_0x4e0f('0x2a')](0x194);}return _0x46acf1;};}function handleError(_0x3fca87,_0x53a5f4){_0x53a5f4=_0x53a5f4||0x1f4;return function(_0x118644){logger[_0x4e0f('0x2b')](_0x118644[_0x4e0f('0x2c')]);if(_0x118644['name']){delete _0x118644[_0x4e0f('0x2d')];}_0x3fca87[_0x4e0f('0x1d')](_0x53a5f4)[_0x4e0f('0x2e')](_0x118644);};}exports[_0x4e0f('0x2f')]=function(_0x6e0318,_0x173a33){var _0x50d64b={},_0x3269c3={},_0x9154c1={'count':0x0,'rows':[]};var _0x5708db=_[_0x4e0f('0x30')](db[_0x4e0f('0x31')][_0x4e0f('0x32')],function(_0x50344d){return{'name':_0x50344d['fieldName'],'type':_0x50344d[_0x4e0f('0x33')]['key']};});_0x3269c3['model']=_[_0x4e0f('0x30')](_0x5708db,_0x4e0f('0x2d'));_0x3269c3[_0x4e0f('0x34')]=_[_0x4e0f('0x35')](_0x6e0318['query']);_0x3269c3[_0x4e0f('0x36')]=_['intersection'](_0x3269c3[_0x4e0f('0x37')],_0x3269c3[_0x4e0f('0x34')]);_0x50d64b[_0x4e0f('0x38')]=_['intersection'](_0x3269c3[_0x4e0f('0x37')],qs['fields'](_0x6e0318[_0x4e0f('0x34')]['fields']));_0x50d64b[_0x4e0f('0x38')]=_0x50d64b['attributes'][_0x4e0f('0x39')]?_0x50d64b[_0x4e0f('0x38')]:_0x3269c3[_0x4e0f('0x37')];if(!_0x6e0318[_0x4e0f('0x34')][_0x4e0f('0x3a')](_0x4e0f('0x3b'))){_0x50d64b[_0x4e0f('0x23')]=qs[_0x4e0f('0x23')](_0x6e0318[_0x4e0f('0x34')]['limit']);_0x50d64b[_0x4e0f('0x20')]=qs[_0x4e0f('0x20')](_0x6e0318['query'][_0x4e0f('0x20')]);}_0x50d64b[_0x4e0f('0x3c')]=qs[_0x4e0f('0x3d')](_0x6e0318[_0x4e0f('0x34')]['sort']);_0x50d64b['where']=qs[_0x4e0f('0x36')](_[_0x4e0f('0x3e')](_0x6e0318[_0x4e0f('0x34')],_0x3269c3['filters']),_0x5708db);if(_0x6e0318[_0x4e0f('0x34')][_0x4e0f('0x3f')]){_0x50d64b[_0x4e0f('0x40')]=_[_0x4e0f('0x41')](_0x50d64b['where'],{'$or':_['map'](_0x5708db,function(_0xda2d15){if(_0xda2d15['type']!=='VIRTUAL'){var _0x12a2fe={};_0x12a2fe[_0xda2d15['name']]={'$like':'%'+_0x6e0318[_0x4e0f('0x34')]['filter']+'%'};return _0x12a2fe;}})});}_0x50d64b=_[_0x4e0f('0x41')]({},_0x50d64b,_0x6e0318[_0x4e0f('0x42')]);var _0x519f4d={'where':_0x50d64b[_0x4e0f('0x40')]};return db[_0x4e0f('0x31')][_0x4e0f('0x22')](_0x519f4d)['then'](function(_0x5f27f2){_0x9154c1[_0x4e0f('0x22')]=_0x5f27f2;if(_0x6e0318[_0x4e0f('0x34')][_0x4e0f('0x43')]){_0x50d64b[_0x4e0f('0x44')]=[{'all':!![]}];}return db[_0x4e0f('0x31')]['findAll'](_0x50d64b);})[_0x4e0f('0x29')](function(_0x790f37){_0x9154c1['rows']=_0x790f37;return _0x9154c1;})[_0x4e0f('0x29')](respondWithFilteredResult(_0x173a33,_0x50d64b))[_0x4e0f('0x45')](handleError(_0x173a33,null));};exports['show']=function(_0x9ab0a8,_0x4f16ea){var _0xacf216={'raw':!![],'where':{'id':_0x9ab0a8[_0x4e0f('0x46')]['id']}},_0x11d641={};_0x11d641[_0x4e0f('0x37')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x11d641[_0x4e0f('0x34')]=_[_0x4e0f('0x35')](_0x9ab0a8[_0x4e0f('0x34')]);_0x11d641[_0x4e0f('0x36')]=_['intersection'](_0x11d641[_0x4e0f('0x37')],_0x11d641[_0x4e0f('0x34')]);_0xacf216[_0x4e0f('0x38')]=_['intersection'](_0x11d641[_0x4e0f('0x37')],qs[_0x4e0f('0x47')](_0x9ab0a8['query'][_0x4e0f('0x47')]));_0xacf216[_0x4e0f('0x38')]=_0xacf216[_0x4e0f('0x38')][_0x4e0f('0x39')]?_0xacf216[_0x4e0f('0x38')]:_0x11d641[_0x4e0f('0x37')];if(_0x9ab0a8['query']['includeAll']){_0xacf216[_0x4e0f('0x44')]=[{'all':!![]}];}_0xacf216=_[_0x4e0f('0x41')]({},_0xacf216,_0x9ab0a8[_0x4e0f('0x42')]);return db['ChatGroup'][_0x4e0f('0x48')](_0xacf216)[_0x4e0f('0x29')](handleEntityNotFound(_0x4f16ea,null))[_0x4e0f('0x29')](respondWithResult(_0x4f16ea,null))[_0x4e0f('0x45')](handleError(_0x4f16ea,null));};exports[_0x4e0f('0x49')]=function(_0x2fa9f5,_0x1afbeb){return db[_0x4e0f('0x31')][_0x4e0f('0x49')](_0x2fa9f5[_0x4e0f('0x4a')],{})['then'](respondWithResult(_0x1afbeb,0xc9))['catch'](handleError(_0x1afbeb,null));};exports[_0x4e0f('0x28')]=function(_0x16e640,_0x191720){if(_0x16e640['body']['id']){delete _0x16e640['body']['id'];}return db[_0x4e0f('0x31')]['find']({'where':{'id':_0x16e640[_0x4e0f('0x46')]['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x191720,null))[_0x4e0f('0x29')](saveUpdates(_0x16e640[_0x4e0f('0x4a')],null))[_0x4e0f('0x29')](respondWithResult(_0x191720,null))['catch'](handleError(_0x191720,null));};exports[_0x4e0f('0x4b')]=function(_0x4977eb,_0x3c0def){return db[_0x4e0f('0x31')][_0x4e0f('0x48')]({'where':{'id':_0x4977eb[_0x4e0f('0x46')]['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x3c0def,null))['then'](removeEntity(_0x3c0def,null))[_0x4e0f('0x45')](handleError(_0x3c0def,null));};exports[_0x4e0f('0x4c')]=function(_0x1ed3f5,_0x2307b0){return db[_0x4e0f('0x31')]['describe']()[_0x4e0f('0x29')](respondWithResult(_0x2307b0,null))[_0x4e0f('0x45')](handleError(_0x2307b0,null));};exports[_0x4e0f('0x4d')]=function(_0x3e07be,_0x43e52d,_0x54897c){return db[_0x4e0f('0x4e')]['count']({'where':{'ChatGroupId':_0x3e07be[_0x4e0f('0x46')]['id'],'ToId':_0x3e07be['user']['id'],'read':![]}})[_0x4e0f('0x29')](function(_0x30ac26){return{'id':_[_0x4e0f('0x4f')](_0x3e07be[_0x4e0f('0x46')]['id']),'count':_0x30ac26};})['then'](respondWithResult(_0x43e52d,null))[_0x4e0f('0x45')](handleError(_0x43e52d,null));};exports[_0x4e0f('0x50')]=function(_0x113dd2,_0x41ec49,_0x233555){return db[_0x4e0f('0x31')][_0x4e0f('0x48')]({'where':{'id':_0x113dd2['params']['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x41ec49,null))[_0x4e0f('0x29')](function(_0x124e94){if(_0x124e94){return _0x124e94[_0x4e0f('0x50')](_0x113dd2[_0x4e0f('0x4a')][_0x4e0f('0x51')],_[_0x4e0f('0x52')](_0x113dd2[_0x4e0f('0x4a')],[_0x4e0f('0x51'),'id'])||{});}})[_0x4e0f('0x29')](respondWithResult(_0x41ec49,null))['catch'](handleError(_0x41ec49,null));};exports['getMembers']=function(_0x479cb6,_0x43d455,_0x156df3){var _0x270721={};var _0x3054d3={};var _0x2b6a1f;var _0x14e49d;return db[_0x4e0f('0x31')][_0x4e0f('0x53')]({'where':{'id':_0x479cb6['params']['id']}})['then'](handleEntityNotFound(_0x43d455,null))[_0x4e0f('0x29')](function(_0x4d4af3){if(_0x4d4af3){_0x2b6a1f=_0x4d4af3;_0x3054d3['model']=_[_0x4e0f('0x35')](db['User'][_0x4e0f('0x32')]);_0x3054d3[_0x4e0f('0x34')]=_[_0x4e0f('0x35')](_0x479cb6['query']);_0x3054d3[_0x4e0f('0x36')]=_['intersection'](_0x3054d3['model'],_0x3054d3['query']);_0x270721['attributes']=_[_0x4e0f('0x54')](_0x3054d3['model'],qs[_0x4e0f('0x47')](_0x479cb6[_0x4e0f('0x34')][_0x4e0f('0x47')]));_0x270721['attributes']=_0x270721[_0x4e0f('0x38')][_0x4e0f('0x39')]?_0x270721[_0x4e0f('0x38')]:_0x3054d3[_0x4e0f('0x37')];_0x270721['order']=qs[_0x4e0f('0x3d')](_0x479cb6[_0x4e0f('0x34')][_0x4e0f('0x3d')]);_0x270721['where']=qs[_0x4e0f('0x36')](_[_0x4e0f('0x3e')](_0x479cb6['query'],_0x3054d3[_0x4e0f('0x36')]));if(_0x479cb6['query'][_0x4e0f('0x3f')]){_0x270721['where']=_[_0x4e0f('0x41')](_0x270721[_0x4e0f('0x40')],{'$or':_[_0x4e0f('0x30')](_0x270721['attributes'],function(_0x323221){var _0xcd244c={};_0xcd244c[_0x323221]={'$like':'%'+_0x479cb6['query'][_0x4e0f('0x3f')]+'%'};return _0xcd244c;})});}_0x270721=_[_0x4e0f('0x41')]({},_0x270721,_0x479cb6['options']);return _0x2b6a1f[_0x4e0f('0x55')](_0x270721);}})[_0x4e0f('0x29')](function(_0x552c6e){if(_0x552c6e){_0x14e49d=_0x552c6e[_0x4e0f('0x39')];if(!_0x479cb6['query']['hasOwnProperty']('nolimit')){_0x270721[_0x4e0f('0x23')]=qs[_0x4e0f('0x23')](_0x479cb6['query'][_0x4e0f('0x23')]);_0x270721[_0x4e0f('0x20')]=qs['offset'](_0x479cb6[_0x4e0f('0x34')][_0x4e0f('0x20')]);}return _0x2b6a1f[_0x4e0f('0x55')](_0x270721);}})[_0x4e0f('0x29')](function(_0x57d4c5){if(_0x57d4c5){return _0x57d4c5?{'count':_0x14e49d,'rows':_0x57d4c5}:null;}})[_0x4e0f('0x29')](respondWithResult(_0x43d455,null))[_0x4e0f('0x45')](handleError(_0x43d455,null));};exports[_0x4e0f('0x56')]=function(_0x4d0d4f,_0x1aec91,_0x3667f0){return db[_0x4e0f('0x31')]['find']({'where':{'id':_0x4d0d4f['params']['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x1aec91,null))[_0x4e0f('0x29')](function(_0x2269e7){if(_0x2269e7){return _0x2269e7[_0x4e0f('0x56')](_0x4d0d4f[_0x4e0f('0x34')]['ids']);}})[_0x4e0f('0x29')](respondWithStatusCode(_0x1aec91,null))[_0x4e0f('0x45')](handleError(_0x1aec91,null));};exports['addMessage']=function(_0x49dd7b,_0x3be7af,_0x2080ba){if(_0x49dd7b[_0x4e0f('0x4a')]['id']){delete _0x49dd7b['body']['id'];}return db[_0x4e0f('0x31')][_0x4e0f('0x48')]({'where':{'id':_0x49dd7b[_0x4e0f('0x46')]['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x3be7af,null))[_0x4e0f('0x29')](function(_0x3f56b4){if(_0x3f56b4){_0x49dd7b['body'][_0x4e0f('0x57')]=_0x3f56b4['id'];return db[_0x4e0f('0x4e')][_0x4e0f('0x49')](_0x49dd7b['body']);}})['then'](respondWithResult(_0x3be7af,null))[_0x4e0f('0x45')](handleError(_0x3be7af,null));};exports['getMessages']=function(_0xd25838,_0x4b0555,_0x3116f){var _0x57ef15={};var _0x51b391={};var _0x7715fb;var _0x5a431b;return db[_0x4e0f('0x31')][_0x4e0f('0x53')]({'where':{'id':_0xd25838[_0x4e0f('0x46')]['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x4b0555,null))['then'](function(_0x8de1a3){if(_0x8de1a3){_0x7715fb=_0x8de1a3;_0x51b391['model']=_['keys'](db[_0x4e0f('0x4e')][_0x4e0f('0x32')]);_0x51b391[_0x4e0f('0x34')]=_[_0x4e0f('0x35')](_0xd25838[_0x4e0f('0x34')]);_0x51b391[_0x4e0f('0x36')]=_[_0x4e0f('0x54')](_0x51b391[_0x4e0f('0x37')],_0x51b391[_0x4e0f('0x34')]);_0x57ef15[_0x4e0f('0x38')]=_[_0x4e0f('0x54')](_0x51b391[_0x4e0f('0x37')],qs[_0x4e0f('0x47')](_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x47')]));_0x57ef15[_0x4e0f('0x38')]=_0x57ef15[_0x4e0f('0x38')][_0x4e0f('0x39')]?_0x57ef15['attributes']:_0x51b391[_0x4e0f('0x37')];_0x57ef15[_0x4e0f('0x3c')]=qs['sort'](_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x3d')]);_0x57ef15[_0x4e0f('0x40')]=qs[_0x4e0f('0x36')](_[_0x4e0f('0x3e')](_0xd25838[_0x4e0f('0x34')],_0x51b391['filters']));if(_0xd25838['query'][_0x4e0f('0x3f')]){_0x57ef15[_0x4e0f('0x40')]=_['merge'](_0x57ef15[_0x4e0f('0x40')],{'$or':_[_0x4e0f('0x30')](_0x57ef15[_0x4e0f('0x38')],function(_0x56945f){var _0x54fe78={};_0x54fe78[_0x56945f]={'$like':'%'+_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x3f')]+'%'};return _0x54fe78;})});}if(_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x58')]){var _0x51ca6a=_0xd25838['query'][_0x4e0f('0x58')][_0x4e0f('0x59')](',');var _0x593f37={};_0x593f37[_0x51ca6a[0x0]]={'$gte':moment(_0x51ca6a[0x1])[_0x4e0f('0x5a')](_0x4e0f('0x5b'))};_0x57ef15['where']=_[_0x4e0f('0x41')](_0x57ef15['where'],_0x593f37);}_0x57ef15=_[_0x4e0f('0x41')]({},_0x57ef15,_0xd25838[_0x4e0f('0x42')]);return _0x7715fb[_0x4e0f('0x5c')](_0x57ef15);}})['then'](function(_0x13c4ab){if(_0x13c4ab){_0x5a431b=_0x13c4ab[_0x4e0f('0x39')];if(!_0xd25838[_0x4e0f('0x34')]['hasOwnProperty'](_0x4e0f('0x3b'))){_0x57ef15['limit']=qs[_0x4e0f('0x23')](_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x23')]);_0x57ef15[_0x4e0f('0x20')]=qs[_0x4e0f('0x20')](_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x20')]);}return _0x7715fb[_0x4e0f('0x5c')](_0x57ef15);}})[_0x4e0f('0x29')](function(_0x4e195a){if(_0x4e195a){return _0x4e195a?{'count':_0x5a431b,'rows':_0x4e195a}:null;}})[_0x4e0f('0x29')](respondWithResult(_0x4b0555,null))[_0x4e0f('0x45')](handleError(_0x4b0555,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 2b91ae6..0b596bd 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 _0xd2f5=['ChatGroup','setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x2b5d02,_0x164512){_0x2b5d02=_0x2b5d02-0x0;var _0x15661a=_0xd2f5[_0x2b5d02];return _0x15661a;};'use strict';var EventEmitter=require(_0x5d2f('0x0'));var ChatGroup=require(_0x5d2f('0x1'))['db'][_0x5d2f('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5d2f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d2f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4abf61){return function(_0x11bc44,_0x436447,_0x263891){ChatGroupEvents['emit'](_0x4abf61+':'+_0x11bc44['id'],_0x11bc44);ChatGroupEvents[_0x5d2f('0x5')](_0x4abf61,_0x11bc44);_0x263891(null);};}for(var e in events){if(events[_0x5d2f('0x6')](e)){var event=events[e];ChatGroup[_0x5d2f('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x9147=['remove','emit','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x293f81,_0x4c0c78){var _0x26e3a1=function(_0x32c554){while(--_0x32c554){_0x293f81['push'](_0x293f81['shift']());}};_0x26e3a1(++_0x4c0c78);}(_0x9147,0x81));var _0x7914=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x9147[_0xae7c2f];return _0x5d7001;};'use strict';var EventEmitter=require(_0x7914('0x0'));var ChatGroup=require(_0x7914('0x1'))['db'][_0x7914('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7914('0x3')](0x0);var events={'afterCreate':_0x7914('0x4'),'afterUpdate':_0x7914('0x5'),'afterDestroy':_0x7914('0x6')};function emitEvent(_0x53d9c7){return function(_0x21cae6,_0x1de2bc,_0x1f8716){ChatGroupEvents[_0x7914('0x7')](_0x53d9c7+':'+_0x21cae6['id'],_0x21cae6);ChatGroupEvents[_0x7914('0x7')](_0x53d9c7,_0x21cae6);_0x1f8716(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x7914('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 5f3acb2..3cbb750 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 _0xe3df=['api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger'];(function(_0x373ebb,_0x34cb54){var _0x58c179=function(_0x4a33c6){while(--_0x4a33c6){_0x373ebb['push'](_0x373ebb['shift']());}};_0x58c179(++_0x34cb54);}(_0xe3df,0x66));var _0xfe3d=function(_0x1ecb02,_0x4ede3e){_0x1ecb02=_0x1ecb02-0x0;var _0x328ab6=_0xe3df[_0x1ecb02];return _0x328ab6;};'use strict';var _=require('lodash');var util=require(_0xfe3d('0x0'));var logger=require(_0xfe3d('0x1'))(_0xfe3d('0x2'));var moment=require(_0xfe3d('0x3'));var BPromise=require(_0xfe3d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe3d('0x5'));var rimraf=require(_0xfe3d('0x6'));var config=require(_0xfe3d('0x7'));var attributes=require(_0xfe3d('0x8'));module[_0xfe3d('0x9')]=function(_0x4ee8e1,_0x3c1dcf){return _0x4ee8e1[_0xfe3d('0xa')](_0xfe3d('0xb'),attributes,{'tableName':_0xfe3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f4e=['rimraf','../../config/environment','./chatGroup.attributes','define','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x9f4e,0xd6));var _0xe9f4=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0x9f4e[_0x3522c8];return _0x22f498;};'use strict';var _=require(_0xe9f4('0x0'));var util=require(_0xe9f4('0x1'));var logger=require(_0xe9f4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe9f4('0x3'));var rp=require(_0xe9f4('0x4'));var fs=require('fs');var path=require(_0xe9f4('0x5'));var rimraf=require(_0xe9f4('0x6'));var config=require(_0xe9f4('0x7'));var attributes=require(_0xe9f4('0x8'));module['exports']=function(_0x5a1494,_0x1d9757){return _0x5a1494[_0xe9f4('0x9')]('ChatGroup',attributes,{'tableName':'chat_groups','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 48d8a1e..1b09553 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 _0x56e7=['defaults','localhost','./chatGroup.socket','register','request','info','debug','request\x20sent','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x5b466,_0x42e075){var _0x19a4c5=function(_0x49c92d){while(--_0x49c92d){_0x5b466['push'](_0x5b466['shift']());}};_0x19a4c5(++_0x42e075);}(_0x56e7,0x7b));var _0x756e=function(_0x5396b5,_0x1c0766){_0x5396b5=_0x5396b5-0x0;var _0x687961=_0x56e7[_0x5396b5];return _0x687961;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var moment=require(_0x756e('0x1'));var BPromise=require('bluebird');var rs=require(_0x756e('0x2'));var fs=require('fs');var Redis=require(_0x756e('0x3'));var db=require(_0x756e('0x4'))['db'];var utils=require(_0x756e('0x5'));var logger=require(_0x756e('0x6'))(_0x756e('0x7'));var config=require(_0x756e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x756e('0x9')][_0x756e('0xa')]({'port':0x232a});config[_0x756e('0xb')]=_[_0x756e('0xc')](config['redis'],{'host':_0x756e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x756e('0xb')]));require(_0x756e('0xe'))[_0x756e('0xf')](socket);function respondWithRpcPromise(_0x4738dc,_0x4adf8f,_0x5d5b90){return new BPromise(function(_0x324d36,_0x2be615){return client[_0x756e('0x10')](_0x4738dc,_0x5d5b90)['then'](function(_0x330076){logger[_0x756e('0x11')]('ChatGroup,\x20%s,\x20%s',_0x4adf8f,'request\x20sent');logger[_0x756e('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4adf8f,_0x756e('0x13'),JSON[_0x756e('0x14')](_0x330076));if(_0x330076[_0x756e('0x15')]){if(_0x330076[_0x756e('0x15')][_0x756e('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x2be615(_0x330076[_0x756e('0x15')]['message']);}logger['error'](_0x756e('0x18'),_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x324d36(_0x330076[_0x756e('0x15')][_0x756e('0x17')]);}else{logger[_0x756e('0x11')](_0x756e('0x18'),_0x4adf8f,_0x756e('0x13'));_0x324d36(_0x330076[_0x756e('0x19')]['message']);}})[_0x756e('0x1a')](function(_0x47c3c4){logger['error'](_0x756e('0x18'),_0x4adf8f,_0x47c3c4);_0x2be615(_0x47c3c4);});});}
\ No newline at end of file
+var _0xf360=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring'];(function(_0x372148,_0x433764){var _0x1b507b=function(_0x48a8f1){while(--_0x48a8f1){_0x372148['push'](_0x372148['shift']());}};_0x1b507b(++_0x433764);}(_0xf360,0x9e));var _0x0f36=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf360[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0f36('0x0'));var util=require(_0x0f36('0x1'));var moment=require(_0x0f36('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f36('0x4'))['db'];var utils=require(_0x0f36('0x5'));var logger=require(_0x0f36('0x6'))('rpc');var config=require(_0x0f36('0x7'));var jayson=require(_0x0f36('0x8'));var client=jayson[_0x0f36('0x9')][_0x0f36('0xa')]({'port':0x232a});config[_0x0f36('0xb')]=_[_0x0f36('0xc')](config[_0x0f36('0xb')],{'host':_0x0f36('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f36('0xb')]));require(_0x0f36('0xe'))[_0x0f36('0xf')](socket);function respondWithRpcPromise(_0x4036b5,_0x146814,_0x4015fc){return new BPromise(function(_0x4963fb,_0x35d5ee){return client[_0x0f36('0x10')](_0x4036b5,_0x4015fc)[_0x0f36('0x11')](function(_0x5044af){logger[_0x0f36('0x12')]('ChatGroup,\x20%s,\x20%s',_0x146814,'request\x20sent');logger[_0x0f36('0x13')](_0x0f36('0x14'),_0x146814,'request\x20sent',JSON[_0x0f36('0x15')](_0x5044af));if(_0x5044af[_0x0f36('0x16')]){if(_0x5044af[_0x0f36('0x16')][_0x0f36('0x17')]===0x1f4){logger['error'](_0x0f36('0x18'),_0x146814,_0x5044af['error'][_0x0f36('0x19')]);return _0x35d5ee(_0x5044af[_0x0f36('0x16')][_0x0f36('0x19')]);}logger[_0x0f36('0x16')](_0x0f36('0x18'),_0x146814,_0x5044af[_0x0f36('0x16')][_0x0f36('0x19')]);return _0x4963fb(_0x5044af['error']['message']);}else{logger[_0x0f36('0x12')](_0x0f36('0x18'),_0x146814,'request\x20sent');_0x4963fb(_0x5044af['result'][_0x0f36('0x19')]);}})[_0x0f36('0x1a')](function(_0x523c43){logger[_0x0f36('0x16')](_0x0f36('0x18'),_0x146814,_0x523c43);_0x35d5ee(_0x523c43);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index fd08778..3a43a26 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 _0xb7bd=['save','remove','update','removeListener','register','length','./chatGroup.events'];(function(_0x3592fc,_0x3c8a44){var _0x27c04f=function(_0x183a69){while(--_0x183a69){_0x3592fc['push'](_0x3592fc['shift']());}};_0x27c04f(++_0x3c8a44);}(_0xb7bd,0x164));var _0xdb7b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb7bd[_0x2641f9];return _0x585741;};'use strict';var ChatGroupEvents=require(_0xdb7b('0x0'));var events=[_0xdb7b('0x1'),_0xdb7b('0x2'),_0xdb7b('0x3')];function createListener(_0x183b20,_0x50b6a6){return function(_0x2ef171){_0x50b6a6['emit'](_0x183b20,_0x2ef171);};}function removeListener(_0x3dbb40,_0x159db5){return function(){ChatGroupEvents[_0xdb7b('0x4')](_0x3dbb40,_0x159db5);};}exports[_0xdb7b('0x5')]=function(_0x802c30){for(var _0x49a27d=0x0,_0x55acd0=events[_0xdb7b('0x6')];_0x49a27d<_0x55acd0;_0x49a27d++){var _0x1b797c=events[_0x49a27d];var _0x23f0f0=createListener('chatGroup:'+_0x1b797c,_0x802c30);ChatGroupEvents['on'](_0x1b797c,_0x23f0f0);}};
\ No newline at end of file
+var _0x8c8d=['update','register','length','chatGroup:','save','remove'];(function(_0x742c21,_0x44bb26){var _0x1abc0f=function(_0x4b9515){while(--_0x4b9515){_0x742c21['push'](_0x742c21['shift']());}};_0x1abc0f(++_0x44bb26);}(_0x8c8d,0x12a));var _0xd8c8=function(_0x2f0166,_0x2c9892){_0x2f0166=_0x2f0166-0x0;var _0x1ba662=_0x8c8d[_0x2f0166];return _0x1ba662;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xd8c8('0x0'),_0xd8c8('0x1'),_0xd8c8('0x2')];function createListener(_0x412f20,_0x4e1c16){return function(_0x5d8058){_0x4e1c16['emit'](_0x412f20,_0x5d8058);};}function removeListener(_0x46cc1e,_0x3f7332){return function(){ChatGroupEvents['removeListener'](_0x46cc1e,_0x3f7332);};}exports[_0xd8c8('0x3')]=function(_0x266b78){for(var _0x1e994a=0x0,_0x37168e=events[_0xd8c8('0x4')];_0x1e994a<_0x37168e;_0x1e994a++){var _0x5cf3ba=events[_0x1e994a];var _0x2d6b25=createListener(_0xd8c8('0x5')+_0x5cf3ba,_0x266b78);ChatGroupEvents['on'](_0x5cf3ba,_0x2d6b25);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 37ccfec..a649071 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 _0x92c3=['update','delete','removeMembers','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x92c3,0xc8));var _0x392c=function(_0x115570,_0x22a206){_0x115570=_0x115570-0x0;var _0x16568e=_0x92c3[_0x115570];return _0x16568e;};'use strict';var multer=require('multer');var util=require(_0x392c('0x0'));var path=require(_0x392c('0x1'));var timeout=require('connect-timeout');var express=require(_0x392c('0x2'));var router=express[_0x392c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x392c('0x4'));var interaction=require(_0x392c('0x5'));var config=require(_0x392c('0x6'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x392c('0x7')](),controller[_0x392c('0x8')]);router[_0x392c('0x9')](_0x392c('0xa'),auth[_0x392c('0x7')](),controller[_0x392c('0xb')]);router[_0x392c('0x9')](_0x392c('0xc'),auth[_0x392c('0x7')](),controller[_0x392c('0xd')]);router[_0x392c('0x9')](_0x392c('0xe'),auth[_0x392c('0x7')](),controller[_0x392c('0xf')]);router['get'](_0x392c('0x10'),auth[_0x392c('0x7')](),controller[_0x392c('0x11')]);router[_0x392c('0x9')](_0x392c('0x12'),auth[_0x392c('0x7')](),controller[_0x392c('0x13')]);router[_0x392c('0x14')]('/',auth['isAuthenticated'](),controller[_0x392c('0x15')]);router[_0x392c('0x14')](_0x392c('0x10'),auth[_0x392c('0x7')](),controller[_0x392c('0x16')]);router[_0x392c('0x14')](_0x392c('0x12'),auth[_0x392c('0x7')](),controller['addMessage']);router[_0x392c('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x392c('0x18')]);router['delete']('/:id',auth[_0x392c('0x7')](),controller['destroy']);router[_0x392c('0x19')](_0x392c('0x10'),auth[_0x392c('0x7')](),controller[_0x392c('0x1a')]);module[_0x392c('0x1b')]=router;
\ No newline at end of file
+var _0xf5eb=['getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','put','update','delete','removeMembers','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','get','/:id','isAuthenticated','show','/:id/unread'];(function(_0x402c71,_0x7d3f25){var _0xdac8b5=function(_0x223ca7){while(--_0x223ca7){_0x402c71['push'](_0x402c71['shift']());}};_0xdac8b5(++_0x7d3f25);}(_0xf5eb,0x14f));var _0xbf5e=function(_0x5cf101,_0x48e000){_0x5cf101=_0x5cf101-0x0;var _0x54ddb4=_0xf5eb[_0x5cf101];return _0x54ddb4;};'use strict';var multer=require(_0xbf5e('0x0'));var util=require(_0xbf5e('0x1'));var path=require(_0xbf5e('0x2'));var timeout=require(_0xbf5e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbf5e('0x4'));var auth=require(_0xbf5e('0x5'));var interaction=require(_0xbf5e('0x6'));var config=require(_0xbf5e('0x7'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbf5e('0x8')]);router['get'](_0xbf5e('0x9'),auth['isAuthenticated'](),controller[_0xbf5e('0xa')]);router[_0xbf5e('0xb')](_0xbf5e('0xc'),auth[_0xbf5e('0xd')](),controller[_0xbf5e('0xe')]);router[_0xbf5e('0xb')](_0xbf5e('0xf'),auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x10')]);router[_0xbf5e('0xb')](_0xbf5e('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbf5e('0xb')](_0xbf5e('0x12'),auth['isAuthenticated'](),controller[_0xbf5e('0x13')]);router[_0xbf5e('0x14')]('/',auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x15')]);router[_0xbf5e('0x14')]('/:id/members',auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x16')]);router[_0xbf5e('0x14')](_0xbf5e('0x12'),auth[_0xbf5e('0xd')](),controller['addMessage']);router[_0xbf5e('0x17')](_0xbf5e('0xc'),auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x18')]);router[_0xbf5e('0x19')](_0xbf5e('0xc'),auth[_0xbf5e('0xd')](),controller['destroy']);router['delete'](_0xbf5e('0x11'),auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x1a')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 044e58d..e631581 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 _0xe9ad=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out','sequelize','exports'];(function(_0x29bd18,_0x5103e8){var _0x4b9e7e=function(_0x588741){while(--_0x588741){_0x29bd18['push'](_0x29bd18['shift']());}};_0x4b9e7e(++_0x5103e8);}(_0xe9ad,0x82));var _0xde9a=function(_0x133851,_0x4d6780){_0x133851=_0x133851-0x0;var _0x188215=_0xe9ad[_0x133851];return _0x188215;};'use strict';var Sequelize=require(_0xde9a('0x0'));module[_0xde9a('0x1')]={'closed':{'type':Sequelize[_0xde9a('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xde9a('0x3')]},'ratingType':{'type':Sequelize[_0xde9a('0x4')](_0xde9a('0x5'),_0xde9a('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xde9a('0x7')]},'pathTranscript':{'type':Sequelize[_0xde9a('0x7')]},'mailTranscript':{'type':Sequelize[_0xde9a('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xde9a('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xde9a('0x8')]},'thirdDisposition':{'type':Sequelize[_0xde9a('0x8')]},'note':{'type':Sequelize[_0xde9a('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xde9a('0x8')]},'osName':{'type':Sequelize[_0xde9a('0x8')]},'osVersion':{'type':Sequelize[_0xde9a('0x8')]},'deviceModel':{'type':Sequelize[_0xde9a('0x8')]},'deviceVendor':{'type':Sequelize[_0xde9a('0x8')]},'deviceType':{'type':Sequelize[_0xde9a('0x8')]},'referer':{'type':Sequelize[_0xde9a('0x7')]},'customerIp':{'type':Sequelize[_0xde9a('0x8')]},'formData':{'type':Sequelize[_0xde9a('0x7')]('long')},'read1stAt':{'type':Sequelize[_0xde9a('0x9')]},'lastMsgAt':{'type':Sequelize[_0xde9a('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xde9a('0x4')]('in',_0xde9a('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xde9a('0x8')]},'customerPort':{'type':Sequelize[_0xde9a('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xde9a('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xde9a('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x56bd=['DATE','ENUM','out','exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING'];(function(_0x2301c1,_0x3c5a47){var _0x28f1eb=function(_0x6a6bb){while(--_0x6a6bb){_0x2301c1['push'](_0x2301c1['shift']());}};_0x28f1eb(++_0x3c5a47);}(_0x56bd,0xe9));var _0xd56b=function(_0x490aad,_0x1c7c91){_0x490aad=_0x490aad-0x0;var _0x54582a=_0x56bd[_0x490aad];return _0x54582a;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'closed':{'type':Sequelize[_0xd56b('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd56b('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xd56b('0x3'),_0xd56b('0x4')),'defaultValue':_0xd56b('0x3')},'ratingMessage':{'type':Sequelize[_0xd56b('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xd56b('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd56b('0x7')]},'disposition':{'type':Sequelize[_0xd56b('0x6')]},'secondDisposition':{'type':Sequelize[_0xd56b('0x6')]},'thirdDisposition':{'type':Sequelize[_0xd56b('0x6')]},'note':{'type':Sequelize[_0xd56b('0x6')]},'browserName':{'type':Sequelize[_0xd56b('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xd56b('0x6')]},'osVersion':{'type':Sequelize[_0xd56b('0x6')]},'deviceModel':{'type':Sequelize[_0xd56b('0x6')]},'deviceVendor':{'type':Sequelize[_0xd56b('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xd56b('0x6')]},'formData':{'type':Sequelize[_0xd56b('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xd56b('0x7')]},'lastMsgAt':{'type':Sequelize[_0xd56b('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xd56b('0x8')]('in',_0xd56b('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd56b('0x6')]},'customerPort':{'type':Sequelize[_0xd56b('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xd56b('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xd56b('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index a1f5446..48ce81e 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 _0x21e1=['transcript-%d-%s.zip','lastName','direction','read','Account','Owner','mkdirSync','Chat','N.A.','browserName','customerIp','customerPort','tail','createReadStream','createWriteStream','firstName','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','key','getOptions','findAll','chat','query','user','show','params','model','rawAttributes','filters','intersection','fields','attributes','length','includeAll','include','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','type','mimetype','Attachment','create','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','close','server/files/chat/upload/','transcript-%s.txt','now','Messages','User','ContactId','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','ChatMessage','addMessage','ids','omit','keys','hasOwnProperty','nolimit','sort','pick','ChatInteractionId','where','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','order','filter','secret','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments'];(function(_0x4953c9,_0x24591d){var _0x263a5e=function(_0x4181bf){while(--_0x4181bf){_0x4953c9['push'](_0x4953c9['shift']());}};_0x263a5e(++_0x24591d);}(_0x21e1,0x1cd));var _0x121e=function(_0x367839,_0x2ccb36){_0x367839=_0x367839-0x0;var _0x5c8360=_0x21e1[_0x367839];return _0x5c8360;};'use strict';var rimraf=require(_0x121e('0x0'));var zipdir=require(_0x121e('0x1'));var rp=require(_0x121e('0x2'));var moment=require(_0x121e('0x3'));var BPromise=require(_0x121e('0x4'));var Mustache=require(_0x121e('0x5'));var util=require(_0x121e('0x6'));var path=require(_0x121e('0x7'));var ejs=require(_0x121e('0x8'));var fs=require('fs');var _=require(_0x121e('0x9'));var Redis=require(_0x121e('0xa'));var interaction=require(_0x121e('0xb'));var qs=require(_0x121e('0xc'));var pdf=require(_0x121e('0xd'));var logger=require(_0x121e('0xe'))(_0x121e('0xf'));var config=require(_0x121e('0x10'));var db=require(_0x121e('0x11'))['db'];config[_0x121e('0x12')]=_[_0x121e('0x13')](config[_0x121e('0x12')],{'host':_0x121e('0x14'),'port':0x18eb});var socket=require(_0x121e('0x15'))(new Redis(config['redis']));require(_0x121e('0x16'))[_0x121e('0x17')](socket);var jayson=require(_0x121e('0x18'));var client=jayson[_0x121e('0x19')][_0x121e('0x1a')]({'port':0x232b});var client9004=jayson[_0x121e('0x19')][_0x121e('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x152fe2,_0x3a7e01,_0x15fd52,_0x387b45){return new BPromise(function(_0x5e0283,_0x11740c){var _0xa32bde=_0x387b45||client;return _0xa32bde[_0x121e('0x1b')](_0x152fe2,_0x15fd52)[_0x121e('0x1c')](function(_0x92e065){logger[_0x121e('0x1d')](_0x121e('0x1e'),_0x3a7e01,_0x121e('0x1f'));logger[_0x121e('0x20')](_0x121e('0x21'),_0x3a7e01,_0x121e('0x1f'),JSON[_0x121e('0x22')](_0x92e065));if(_0x92e065[_0x121e('0x23')]){if(_0x92e065['error']['code']===0x1f4){logger[_0x121e('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x3a7e01,_0x92e065[_0x121e('0x23')]['message']);return _0x11740c(_0x92e065['error']['message']);}logger['error'](_0x121e('0x1e'),_0x3a7e01,_0x92e065[_0x121e('0x23')][_0x121e('0x24')]);return _0x5e0283(_0x92e065[_0x121e('0x23')]['message']);}else{logger['info'](_0x121e('0x1e'),_0x3a7e01,_0x121e('0x1f'));_0x5e0283(_0x92e065['result']['message']);}})[_0x121e('0x25')](function(_0x234bff){logger[_0x121e('0x23')](_0x121e('0x1e'),_0x3a7e01,_0x234bff);_0x11740c(_0x234bff);});});}function respondWithStatusCode(_0x3e5fbe,_0x49130d){_0x49130d=_0x49130d||0xcc;return function(_0x1a1761){if(_0x1a1761){return _0x3e5fbe[_0x121e('0x26')](_0x49130d);}return _0x3e5fbe[_0x121e('0x27')](_0x49130d)['end']();};}function respondWithResult(_0x370c56,_0x4ced7b){_0x4ced7b=_0x4ced7b||0xc8;return function(_0xdad874){if(_0xdad874){return _0x370c56['status'](_0x4ced7b)[_0x121e('0x28')](_0xdad874);}};}function respondWithFilteredResult(_0x425871,_0x2c66e7){return function(_0x4806c3){if(_0x4806c3){var _0x44804e=typeof _0x2c66e7[_0x121e('0x29')]===_0x121e('0x2a')&&typeof _0x2c66e7[_0x121e('0x2b')]==='undefined';var _0x136054=_0x4806c3[_0x121e('0x2c')];var _0x2e8380=_0x44804e?0x0:_0x2c66e7['offset'];var _0x3d2927=_0x44804e?_0x4806c3[_0x121e('0x2c')]:_0x2c66e7[_0x121e('0x29')]+_0x2c66e7[_0x121e('0x2b')];var _0x300aac;if(_0x3d2927>=_0x136054){_0x3d2927=_0x136054;_0x300aac=0xc8;}else{_0x300aac=0xce;}_0x425871[_0x121e('0x27')](_0x300aac);return _0x425871['set'](_0x121e('0x2d'),_0x2e8380+'-'+_0x3d2927+'/'+_0x136054)[_0x121e('0x28')](_0x4806c3);}return null;};}function saveUpdates(_0x2883c5){return function(_0xfb6e4d){if(_0xfb6e4d){return _0xfb6e4d[_0x121e('0x2e')](_0x2883c5)[_0x121e('0x1c')](function(_0x5a81db){return _0x5a81db;});}return null;};}function removeEntity(_0x3a4a23){return function(_0x46e38e){if(_0x46e38e){return _0x46e38e[_0x121e('0x2f')]()[_0x121e('0x1c')](function(){_0x3a4a23[_0x121e('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519011){return function(_0x16c000){if(!_0x16c000){_0x519011[_0x121e('0x26')](0x194);}return _0x16c000;};}function handleError(_0xa21411,_0x426fa6){_0x426fa6=_0x426fa6||0x1f4;return function(_0x234088){logger[_0x121e('0x23')](_0x234088[_0x121e('0x30')]);if(_0x234088[_0x121e('0x31')]){delete _0x234088[_0x121e('0x31')];}_0xa21411[_0x121e('0x27')](_0x426fa6)[_0x121e('0x32')](_0x234088);};}function getMustacheRender(_0xa20f16,_0x56cf66){return Mustache[_0x121e('0x33')](_0xa20f16,_[_0x121e('0x34')](_0x56cf66[_0x121e('0x35')],{'contact':_0x56cf66[_0x121e('0x36')],'message':_0x56cf66['message'],'agent':_0x56cf66[_0x121e('0x37')],'interaction':_0x56cf66[_0x121e('0x38')],'account':_0x56cf66[_0x121e('0x39')]}))||'';}exports[_0x121e('0x3a')]=function(_0x3039bb,_0x499eb6){var _0xa8c9f8={};var _0x161048=_[_0x121e('0x3b')](db[_0x121e('0x3c')]['rawAttributes'],function(_0x18d8d7){return{'name':_0x18d8d7[_0x121e('0x3d')],'type':_0x18d8d7['type'][_0x121e('0x3e')]};});_0xa8c9f8=qs[_0x121e('0x3f')](_0x161048,_0x3039bb);return interaction[_0x121e('0x40')](_0x121e('0x41'),_0x3039bb[_0x121e('0x42')],_0x3039bb[_0x121e('0x43')],_0xa8c9f8,_0x161048)[_0x121e('0x1c')](respondWithFilteredResult(_0x499eb6,_0xa8c9f8))['catch'](handleError(_0x499eb6,null));};exports[_0x121e('0x44')]=function(_0x34746b,_0x11eef5){var _0x246051={'raw':![],'where':{'id':_0x34746b[_0x121e('0x45')]['id']}},_0x938c3d={};_0x938c3d[_0x121e('0x46')]=_['keys'](db['ChatInteraction'][_0x121e('0x47')]);_0x938c3d[_0x121e('0x42')]=_['keys'](_0x34746b['query']);_0x938c3d[_0x121e('0x48')]=_[_0x121e('0x49')](_0x938c3d[_0x121e('0x46')],_0x938c3d[_0x121e('0x42')]);_0x246051['attributes']=_[_0x121e('0x49')](_0x938c3d['model'],qs[_0x121e('0x4a')](_0x34746b['query'][_0x121e('0x4a')]));_0x246051[_0x121e('0x4b')]=_0x246051[_0x121e('0x4b')][_0x121e('0x4c')]?_0x246051['attributes']:_0x938c3d['model'];if(_0x34746b[_0x121e('0x42')][_0x121e('0x4d')]){_0x246051[_0x121e('0x4e')]=[{'all':!![]}];}_0x246051=_[_0x121e('0x34')]({},_0x246051,_0x34746b['options']);return db['ChatInteraction'][_0x121e('0x4f')](_0x246051)[_0x121e('0x1c')](handleEntityNotFound(_0x11eef5,null))[_0x121e('0x1c')](respondWithResult(_0x11eef5,null))[_0x121e('0x25')](handleError(_0x11eef5,null));};exports['create']=function(_0x48b04f,_0xb4696a){return db['ChatInteraction']['create'](_0x48b04f['body'],{})[_0x121e('0x1c')](respondWithResult(_0xb4696a,0xc9))['catch'](handleError(_0xb4696a,null));};exports[_0x121e('0x2e')]=function(_0x1d48dc,_0x292dd6){if(_0x1d48dc[_0x121e('0x35')]['id']){delete _0x1d48dc[_0x121e('0x35')]['id'];}return db[_0x121e('0x3c')]['find']({'where':{'id':_0x1d48dc[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x292dd6,null))[_0x121e('0x1c')](saveUpdates(_0x1d48dc[_0x121e('0x35')],null))[_0x121e('0x1c')](respondWithResult(_0x292dd6,null))[_0x121e('0x25')](handleError(_0x292dd6,null));};exports[_0x121e('0x2f')]=function(_0x5f2e5c,_0x2d0ff8){return db[_0x121e('0x3c')][_0x121e('0x4f')]({'where':{'id':_0x5f2e5c[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x2d0ff8,null))[_0x121e('0x1c')](removeEntity(_0x2d0ff8,null))[_0x121e('0x25')](handleError(_0x2d0ff8,null));};exports[_0x121e('0x50')]=function(_0x336042,_0x4a1486){return db[_0x121e('0x3c')][_0x121e('0x50')]()[_0x121e('0x1c')](respondWithResult(_0x4a1486,null))[_0x121e('0x25')](handleError(_0x4a1486,null));};exports[_0x121e('0x51')]=function(_0x107cb4,_0x495f2e){var _0x11e6be=_0x107cb4[_0x121e('0x45')]['id'];var _0x8d8729;var _0xe312f2;var _0x599f8d;return db[_0x121e('0x3c')][_0x121e('0x52')]({'where':{'id':_0x11e6be}})[_0x121e('0x1c')](function(_0x2d332c){_0x8d8729=_0x2d332c;return db[_0x121e('0x53')][_0x121e('0x52')]({'where':{'id':_0x2d332c[_0x121e('0x54')]},'attributes':['id','vidaooApiKey',_0x121e('0x55'),_0x121e('0x56'),_0x121e('0x57'),_0x121e('0x58')],'raw':!![]});})[_0x121e('0x1c')](function(_0x75facc){if(_0x75facc&&_0x75facc[_0x121e('0x59')]&&_0x75facc[_0x121e('0x55')]){_0xe312f2=_0x75facc;var _0x32c5e7={'interaction':{'id':_0x11e6be},'agent':{'id':_0x107cb4[_0x121e('0x43')]['id'],'name':_0x107cb4[_0x121e('0x43')][_0x121e('0x31')],'fullname':_0x107cb4[_0x121e('0x43')][_0x121e('0x5a')],'email':_0x107cb4[_0x121e('0x43')]['email']},'contact':_0x107cb4[_0x121e('0x35')][_0x121e('0x36')],'account':_0x107cb4[_0x121e('0x35')][_0x121e('0x39')]};var _0x364b79={'rejectUnauthorized':![],'method':_0x121e('0x5b'),'url':_0x121e('0x5c'),'headers':{'X-APIKEY':_0x75facc[_0x121e('0x59')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x107cb4[_0x121e('0x43')]['email']],'buttons':null,'topic':_0xe312f2[_0x121e('0x56')],'note':_[_0x121e('0x5d')](_0xe312f2[_0x121e('0x57')])?null:getMustacheRender(_0xe312f2['vidaooNote'],_0x32c5e7),'metadata':null},'redirect':_0x121e('0x5e'),'json':!![]};try{if(!_[_0x121e('0x5d')](_0xe312f2[_0x121e('0x58')])){var _0x588c6c=getMustacheRender(_0xe312f2[_0x121e('0x58')],_0x32c5e7);var _0x4f691e=JSON[_0x121e('0x5f')](_0x588c6c);_0x364b79[_0x121e('0x35')]['metadata']=_0x4f691e;}}catch(_0xb9fccb){throw new db['Sequelize'][(_0x121e('0x60'))](_0x121e('0x61'));}return rp(_0x364b79);}else{throw new db[(_0x121e('0x62'))][(_0x121e('0x60'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x121e('0x1c')](function(_0x357122){_0x599f8d=_0x357122;if(_0x599f8d['id']){var _0x2b15e5={'body':_0x599f8d[_0x121e('0x63')],'ChatWebsiteId':_0xe312f2['id'],'ChatInteractionId':_0x8d8729['id'],'direction':_0x121e('0x64'),'UserId':_0x107cb4[_0x121e('0x43')]['id']};return db['ChatMessage']['create'](_0x2b15e5,{});}else{throw new db[(_0x121e('0x62'))]['ValidationError'](_0x121e('0x65'));}})[_0x121e('0x1c')](function(){return _0x8d8729['updateAttributes']({'vidaooSessionId':_0x599f8d['id']});})[_0x121e('0x1c')](respondWithResult(_0x495f2e,null))[_0x121e('0x25')](handleError(_0x495f2e,null));};exports[_0x121e('0x66')]=function(_0x2407f9,_0x46ff71){if(_0x2407f9[_0x121e('0x35')]['id']){delete _0x2407f9[_0x121e('0x35')]['id'];}return db[_0x121e('0x3c')][_0x121e('0x4f')]({'where':{'id':_0x2407f9[_0x121e('0x45')]['id']},'include':[{'model':db[_0x121e('0x67')],'as':_0x121e('0x68')}]})[_0x121e('0x1c')](handleEntityNotFound(_0x46ff71,null))[_0x121e('0x1c')](saveUpdates(_0x2407f9[_0x121e('0x35')],null))['then'](respondWithResult(_0x46ff71,null))[_0x121e('0x25')](handleError(_0x46ff71,null));};exports[_0x121e('0x69')]=function(_0x2bbb08,_0x51eba3){if(_0x2bbb08[_0x121e('0x35')]['id']){delete _0x2bbb08['body']['id'];}return db[_0x121e('0x3c')][_0x121e('0x4f')]({'where':{'id':_0x2bbb08[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](function(_0x2148f5){if(!_0x2148f5){logger['error'](_0x121e('0x6a'),'abandon',0x194,_0x121e('0x6b'));_0x51eba3['sendStatus'](0x194);}else{if(_0x2148f5[_0x121e('0x6c')]){throw new db['Sequelize'][(_0x121e('0x60'))](_0x121e('0x6d'));}}return _0x2148f5;})[_0x121e('0x1c')](function(_0x5bc026){if(_0x5bc026){return _0x5bc026[_0x121e('0x2e')]({'closed':_0x2bbb08['body'][_0x121e('0x6e')],'disposition':_0x2bbb08[_0x121e('0x35')][_0x121e('0x6f')]})['then'](function(_0xeb7eab){return _0xeb7eab;});}})[_0x121e('0x1c')](function(){return respondWithRpcPromise(_0x121e('0x70'),_0x121e('0x69'),_0x2bbb08[_0x121e('0x35')],client9004);})[_0x121e('0x1c')](respondWithResult(_0x51eba3,null))[_0x121e('0x25')](handleError(_0x51eba3,null));};exports[_0x121e('0x71')]=function(_0x112ab5,_0x5bbac6){_0x112ab5[_0x121e('0x35')]['name']=_0x112ab5[_0x121e('0x72')][_0x121e('0x73')];_0x112ab5[_0x121e('0x35')]['basename']=_0x112ab5[_0x121e('0x72')][_0x121e('0x74')];_0x112ab5[_0x121e('0x35')][_0x121e('0x75')]=_0x112ab5[_0x121e('0x72')][_0x121e('0x76')];return db[_0x121e('0x77')][_0x121e('0x78')](_0x112ab5['body'])['then'](respondWithResult(_0x5bbac6,0xc9))[_0x121e('0x25')](handleError(_0x5bbac6,null));};exports[_0x121e('0x79')]=function(_0xe8f66c,_0x16793c){return db[_0x121e('0x3c')][_0x121e('0x52')]({'where':{'id':_0xe8f66c[_0x121e('0x45')]['id']},'raw':!![]})[_0x121e('0x1c')](handleEntityNotFound(_0x16793c,null))[_0x121e('0x1c')](function(_0x264303){if(_0x264303){if(_0x264303[_0x121e('0x6e')]){return _0x16793c['status'](0x193)[_0x121e('0x28')]({'status':0x193,'message':_0x121e('0x7a')});}return db[_0x121e('0x77')]['findOne']({'where':{'id':_0xe8f66c['query'][_0x121e('0x7b')]},'raw':!![]})[_0x121e('0x1c')](handleEntityNotFound(_0x16793c,null));}})['then'](function(_0x2241e7){if(_0x2241e7){var _0x10afb9=_0x2241e7[_0x121e('0x7c')]!==null;var _0x51ca8b=path[_0x121e('0x7d')](config[_0x121e('0x7e')],_0x121e('0x7f'));if(_0x10afb9){_0x51ca8b=path[_0x121e('0x7d')](_0x51ca8b,_0x121e('0x80'));}var _0x3e1ec3=path[_0x121e('0x7d')](_0x51ca8b,_0x2241e7[_0x121e('0x81')]);return _0x16793c['download'](_0x3e1ec3);}})[_0x121e('0x25')](handleError(_0x16793c,null));};exports[_0x121e('0x82')]=function(_0x638733,_0x573095){var _0x44c139=null;var _0x11e2e6=null;var _0x2ccda7=null;if(_0x638733[_0x121e('0x35')]['id']){delete _0x638733[_0x121e('0x35')]['id'];}if(_0x638733[_0x121e('0x35')]['mailTranscript']){_0x2ccda7=path[_0x121e('0x7d')](config[_0x121e('0x7e')],_0x121e('0x83'),util['format'](_0x121e('0x84'),Date[_0x121e('0x85')]()));_0x638733['body']['pathTranscript']=_0x2ccda7;}return db[_0x121e('0x3c')]['find']({'where':{'id':_0x638733[_0x121e('0x45')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x121e('0x86'),'include':[{'model':db[_0x121e('0x87')],'as':'User'}]}]})[_0x121e('0x1c')](handleEntityNotFound(_0x573095,null))['then'](saveUpdates(_0x638733[_0x121e('0x35')],null))[_0x121e('0x1c')](function(_0x13b5f6){if(_0x13b5f6){_0x44c139=_0x13b5f6;return db[_0x121e('0x53')][_0x121e('0x4f')]({'where':{'id':_0x44c139[_0x121e('0x54')]}});}})['then'](function(_0x69ebf6){if(_0x69ebf6){_0x11e2e6=_0x69ebf6;return db[_0x121e('0x67')][_0x121e('0x4f')]({'where':{'id':_0x44c139[_0x121e('0x88')]}});}})[_0x121e('0x1c')](function(_0x3dd7e7){if(_0x3dd7e7){if(_0x2ccda7){var _0x5e5cc4=null;for(var _0x2b4a82=0x1;_0x2b4a82<_0x44c139['Messages'][_0x121e('0x4c')];++_0x2b4a82){_0x5e5cc4=_0x44c139['Messages'][_0x2b4a82];var _0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?util[_0x121e('0x89')]('%s%d',_0x11e2e6[_0x121e('0x8a')],_0x5e5cc4[_0x121e('0x6c')]):_0x121e('0x8b');var _0x38c05f=_0x638733[_0x121e('0x35')][_0x121e('0x8c')]||util['format'](_0x121e('0x8d'),_0x121e('0x8e'),_0x5e5cc4[_0x121e('0x88')]);switch(_0x11e2e6[_0x121e('0x8f')]){case _0x121e('0x90'):_0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?util[_0x121e('0x89')](_0x121e('0x8d'),_0x11e2e6[_0x121e('0x8a')],_0x5e5cc4['UserId']):_0x121e('0x8b');break;case _0x121e('0x91'):_0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?_0x5e5cc4[_0x121e('0x87')][_0x121e('0x92')]||_0x5e5cc4[_0x121e('0x87')]['fullname']:_0x121e('0x8b');break;case _0x121e('0x93'):_0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?_0x5e5cc4['User'][_0x121e('0x5a')]:'System';break;default:_0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?util[_0x121e('0x89')](_0x121e('0x8d'),_0x11e2e6[_0x121e('0x8a')],_0x5e5cc4['UserId']):'System';}var _0x58f38a=util[_0x121e('0x89')]('[%s]\x20%s:\x20%s\x0a',moment(_0x5e5cc4[_0x121e('0x94')])[_0x121e('0x89')](_0x121e('0x95')),_0x5e5cc4['direction']==='in'?_0x38c05f:_0x1af90a,_0x5e5cc4[_0x121e('0x35')]);if(!_0x5e5cc4['secret']){fs[_0x121e('0x96')](_0x2ccda7,_0x58f38a);}}return db[_0x121e('0x97')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x121e('0x98')],'as':_0x121e('0x99'),'raw':!![],'include':[{'model':db[_0x121e('0x9a')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0xc1d2f7){if(!_0xc1d2f7||!_0xc1d2f7[_0x121e('0x99')]||!_0x638733[_0x121e('0x35')])return _0x44c139;var _0x44e101=_0xc1d2f7['getSmtpOptions']();return respondWithRpcPromise(_0x121e('0x9b'),_0x121e('0x9c'),{'account':_0x44e101,'message':{'from':util['format'](_0x121e('0x9d'),_0xc1d2f7[_0x121e('0x31')],_0xc1d2f7[_0x121e('0x9e')]||_0xc1d2f7[_0x121e('0x99')]['user']),'to':_0x638733[_0x121e('0x35')][_0x121e('0x9f')],'subject':_0x121e('0xa0'),'text':util[_0x121e('0x89')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x638733[_0x121e('0x35')][_0x121e('0x9f')]),'attachments':[{'path':_0x2ccda7}]}})[_0x121e('0x1c')](function(){return _0x44c139;})[_0x121e('0x25')](function(_0x5577f4){logger[_0x121e('0x23')](_0x5577f4);});})['then'](respondWithStatusCode(_0x573095,0xc8))[_0x121e('0x25')](handleError(_0x573095,null));};exports['addMessage']=function(_0xffce4d,_0x3e6e40){return db[_0x121e('0xa1')][_0x121e('0x4f')]({'where':{'id':_0xffce4d[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x3e6e40,null))['then'](function(_0x5f491a){if(_0x5f491a){return _0x5f491a[_0x121e('0xa2')](_0xffce4d['body'][_0x121e('0xa3')],_[_0x121e('0xa4')](_0xffce4d[_0x121e('0x35')],[_0x121e('0xa3'),'id'])||{});}})[_0x121e('0x1c')](respondWithResult(_0x3e6e40,null))[_0x121e('0x25')](handleError(_0x3e6e40,null));};exports['getMessages']=function(_0xc5e636,_0x68a692){var _0x757807={'raw':![],'where':{}};var _0x4d809a={};var _0x25aa5e={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xc5e636[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x68a692,null))[_0x121e('0x1c')](function(_0x2417a6){if(_0x2417a6){_0x4d809a[_0x121e('0x46')]=_[_0x121e('0xa5')](db[_0x121e('0xa1')][_0x121e('0x47')]);_0x4d809a['query']=_[_0x121e('0xa5')](_0xc5e636[_0x121e('0x42')]);_0x4d809a['filters']=_['intersection'](_0x4d809a[_0x121e('0x46')],_0x4d809a[_0x121e('0x42')]);_0x757807[_0x121e('0x4b')]=_[_0x121e('0x49')](_0x4d809a[_0x121e('0x46')],qs[_0x121e('0x4a')](_0xc5e636[_0x121e('0x42')][_0x121e('0x4a')]));_0x757807['attributes']=_0x757807['attributes']['length']?_0x757807[_0x121e('0x4b')]:_0x4d809a[_0x121e('0x46')];if(!_0xc5e636[_0x121e('0x42')][_0x121e('0xa6')](_0x121e('0xa7'))){_0x757807[_0x121e('0x2b')]=qs['limit'](_0xc5e636[_0x121e('0x42')][_0x121e('0x2b')]);_0x757807['offset']=qs[_0x121e('0x29')](_0xc5e636[_0x121e('0x42')][_0x121e('0x29')]);}_0x757807['order']=qs[_0x121e('0xa8')](_0xc5e636[_0x121e('0x42')][_0x121e('0xa8')]);_0x757807['where']=qs[_0x121e('0x48')](_[_0x121e('0xa9')](_0xc5e636[_0x121e('0x42')],_0x4d809a['filters']));_0x757807['where'][_0x121e('0xaa')]=_0x2417a6['id'];if(_0xc5e636['query']['filter']){_0x757807['where']=_[_0x121e('0x34')](_0x757807[_0x121e('0xab')],{'$or':_[_0x121e('0x3b')](_0x757807['attributes'],function(_0x31a969){var _0x11c4cc={};_0x11c4cc[_0x31a969]={'$like':'%'+_0xc5e636[_0x121e('0x42')]['filter']+'%'};return _0x11c4cc;})});}if(_0xc5e636[_0x121e('0x42')][_0x121e('0xac')]){var _0xae1016=_0xc5e636[_0x121e('0x42')][_0x121e('0xac')][_0x121e('0xad')](',');var _0x3faba0={};_0x3faba0[_0xae1016[0x0]]={'$gte':moment(_0xae1016[0x1])[_0x121e('0x89')](_0x121e('0xae'))};_0x757807[_0x121e('0xab')]=_[_0x121e('0x34')](_0x757807['where'],_0x3faba0);}_0x757807=_[_0x121e('0x34')]({},_0x757807,_0xc5e636[_0x121e('0xaf')]);return db[_0x121e('0xa1')][_0x121e('0x2c')]({'where':_0x757807[_0x121e('0xab')]})[_0x121e('0x1c')](function(_0x1b9872){_0x25aa5e[_0x121e('0x2c')]=_0x1b9872;if(_0xc5e636[_0x121e('0x42')][_0x121e('0x4d')]){_0x757807[_0x121e('0x4e')]=[{'all':!![]}];}return db[_0x121e('0xa1')][_0x121e('0x40')](_0x757807);})['then'](function(_0x37e4b8){_0x25aa5e[_0x121e('0xb0')]=_0x37e4b8;return _0x25aa5e;});}})[_0x121e('0x1c')](respondWithFilteredResult(_0x68a692,_0x757807))[_0x121e('0x25')](handleError(_0x68a692,null));};exports[_0x121e('0xb1')]=function(_0x22b285,_0x479e23){var _0x35727f={'where':{}},_0x18c2ce={},_0x1e8f3f={'count':0x0,'rows':[]};return db[_0x121e('0x3c')][_0x121e('0x52')]({'where':{'id':_0x22b285[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x479e23,null))[_0x121e('0x1c')](function(_0x155a52){if(_0x155a52){_0x18c2ce[_0x121e('0x46')]=_[_0x121e('0xa5')](db[_0x121e('0xa1')][_0x121e('0x47')]);_0x18c2ce[_0x121e('0x42')]=_[_0x121e('0xa5')](_0x22b285[_0x121e('0x42')]);_0x18c2ce['filters']=_['intersection'](_0x18c2ce[_0x121e('0x46')],_0x18c2ce['query']);_0x35727f[_0x121e('0x4b')]=_[_0x121e('0x49')](_0x18c2ce[_0x121e('0x46')],qs['fields'](_0x22b285[_0x121e('0x42')][_0x121e('0x4a')]));_0x35727f['attributes']=_0x35727f[_0x121e('0x4b')][_0x121e('0x4c')]?_0x35727f[_0x121e('0x4b')]:_0x18c2ce[_0x121e('0x46')];if(!_0x22b285['query'][_0x121e('0xa6')](_0x121e('0xa7'))){_0x35727f[_0x121e('0x2b')]=qs[_0x121e('0x2b')](_0x22b285[_0x121e('0x42')][_0x121e('0x2b')]);_0x35727f[_0x121e('0x29')]=qs['offset'](_0x22b285['query'][_0x121e('0x29')]);}_0x35727f[_0x121e('0xb2')]=qs[_0x121e('0xa8')](_0x22b285[_0x121e('0x42')]['sort']);_0x35727f['where']=qs[_0x121e('0x48')](_[_0x121e('0xa9')](_0x22b285[_0x121e('0x42')],_0x18c2ce[_0x121e('0x48')]));_0x35727f[_0x121e('0xab')][_0x121e('0xaa')]=_0x155a52['id'];if(_0x22b285[_0x121e('0x42')][_0x121e('0xb3')]){_0x35727f['where']=_[_0x121e('0x34')](_0x35727f[_0x121e('0xab')],{'$or':_[_0x121e('0x3b')](_0x35727f[_0x121e('0x4b')],function(_0x25c78f){var _0x4c1e46={};_0x4c1e46[_0x25c78f]={'$like':'%'+_0x22b285['query']['filter']+'%'};return _0x4c1e46;})});}_0x35727f['where'][_0x121e('0xb4')]=![];if(_0x22b285['query']['id']){_0x35727f[_0x121e('0xab')]['id']={'$gt':_0x22b285[_0x121e('0x42')]['id']};}_0x35727f=_['merge']({},_0x35727f,_0x22b285[_0x121e('0xaf')]);return db[_0x121e('0xa1')][_0x121e('0x2c')]({'where':_0x35727f['where']})[_0x121e('0x1c')](function(_0x112d90){_0x1e8f3f['count']=_0x112d90;_0x35727f[_0x121e('0x4e')]=[];if(_0x22b285['query'][_0x121e('0xb5')]){_0x35727f['include'][_0x121e('0xb6')]({'model':db[_0x121e('0x87')],'as':_0x121e('0x87'),'attributes':['id','fullname',_0x121e('0x92')]});}if(_0x22b285['query'][_0x121e('0x4d')]){_0x35727f[_0x121e('0x4e')]=[{'all':!![]}];}return db[_0x121e('0xa1')][_0x121e('0x40')](_0x35727f);})[_0x121e('0x1c')](function(_0x2a5b99){_0x1e8f3f[_0x121e('0xb0')]=_0x2a5b99;return _0x1e8f3f;});}})[_0x121e('0x1c')](respondWithFilteredResult(_0x479e23,_0x35727f))[_0x121e('0x25')](handleError(_0x479e23,null));};exports['addTags']=function(_0x4f69ee,_0x282a47){return db[_0x121e('0x3c')]['find']({'where':{'id':_0x4f69ee[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x282a47,null))[_0x121e('0x1c')](function(_0x3d3dcf){if(_0x3d3dcf){return _0x3d3dcf[_0x121e('0xb7')](_0x4f69ee['body'][_0x121e('0xa3')],_['omit'](_0x4f69ee[_0x121e('0x35')],['ids','id'])||{})[_0x121e('0xb8')](function(){return db[_0x121e('0xb9')][_0x121e('0x40')]({'attributes':['id',_0x121e('0x31'),'color'],'where':{'id':_0x4f69ee['body'][_0x121e('0xa3')]}});})[_0x121e('0x1c')](function(_0x2a7b2f){socket[_0x121e('0xba')](_0x121e('0xbb'),{'id':Number(_0x4f69ee[_0x121e('0x45')]['id']),'tags':_0x2a7b2f||[]});return{'id':Number(_0x4f69ee[_0x121e('0x45')]['id']),'tags':_0x2a7b2f||[]};});}})[_0x121e('0x1c')](respondWithResult(_0x282a47,null))[_0x121e('0x25')](handleError(_0x282a47,null));};exports[_0x121e('0xbc')]=function(_0x1a98e9,_0x26c8b0){return db[_0x121e('0x3c')][_0x121e('0x4f')]({'where':{'id':_0x1a98e9[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x26c8b0,null))[_0x121e('0x1c')](function(_0xffef0){if(_0xffef0){return _0xffef0[_0x121e('0xbc')](_0x1a98e9['query']['ids']);}})[_0x121e('0x1c')](respondWithStatusCode(_0x26c8b0,null))['catch'](handleError(_0x26c8b0,null));};exports[_0x121e('0xbd')]=function(_0x255d40,_0x586c88){var _0x538c3f=moment()[_0x121e('0xbe')]()[_0x121e('0xbf')]();var _0x2f5b6e=path[_0x121e('0x7d')](config[_0x121e('0x7e')],_0x121e('0xc0'),_0x121e('0xc1'),_0x121e('0xc2'));var _0x5ec2=path[_0x121e('0x7d')](config[_0x121e('0x7e')],'server',_0x121e('0xc1'),_0x121e('0xc3'));var _0x2a9477=path[_0x121e('0x7d')](_0x2f5b6e,_0x538c3f);var _0x5f4c68=util[_0x121e('0x89')](_0x121e('0xc4'),_0x255d40[_0x121e('0x45')]['id'],_0x538c3f);var _0x5a68a5=path['join'](_0x2f5b6e,_0x5f4c68);var _0x13cf3b=[];_0x13cf3b[_0x121e('0xb6')]({'model':db[_0x121e('0x87')],'as':'User','attributes':['id',_0x121e('0x5a')],'raw':!![]});_0x13cf3b[_0x121e('0xb6')]({'model':db[_0x121e('0x67')],'as':_0x121e('0x68'),'attributes':['id','firstName',_0x121e('0xc5')],'raw':!![]});if(_0x255d40['query']['attachments']){_0x13cf3b[_0x121e('0xb6')]({'model':db[_0x121e('0x77')],'as':_0x121e('0x77'),'raw':!![]});}var _0x224d1a=[{'model':db[_0x121e('0xa1')],'as':'Messages','attributes':['id','body','createdAt',_0x121e('0xc6'),'secret',_0x121e('0xc7')],'include':_0x13cf3b}];_0x224d1a['push']({'model':db['ChatWebsite'],'as':_0x121e('0xc8'),'attributes':['id',_0x121e('0x31')]});_0x224d1a['push']({'model':db['User'],'as':_0x121e('0xc9'),'attributes':['id',_0x121e('0x5a')]});return db[_0x121e('0x3c')]['find']({'where':{'id':_0x255d40['params']['id']},'include':_0x224d1a})[_0x121e('0x1c')](handleEntityNotFound(_0x586c88,null))[_0x121e('0x1c')](function(_0x34f31a){if(_0x34f31a){var _0x3da3dc=_0x34f31a['get']({'plain':!![]});fs[_0x121e('0xca')](_0x2a9477);var _0x1b3229={'channel':_0x121e('0xcb'),'account':_0x3da3dc[_0x121e('0xc8')][_0x121e('0x31')],'agent':_0x3da3dc[_0x121e('0xc9')]?_0x3da3dc[_0x121e('0xc9')][_0x121e('0x5a')]:_0x121e('0xcc'),'createdAt':moment(_0x3da3dc['createdAt'])[_0x121e('0x89')]('YYYY-MM-DD\x20HH:mm:ss')[_0x121e('0xbf')](),'closedAt':_0x3da3dc['closed']?moment(_0x3da3dc['closedAt'])[_0x121e('0x89')](_0x121e('0xae'))[_0x121e('0xbf')]():'','disposition':_0x3da3dc['disposition'],'chatInfo':{'browser':_0x3da3dc[_0x121e('0xcd')],'os':_0x3da3dc['osName'],'referer':_0x3da3dc['referer'],'customerIp':_0x3da3dc[_0x121e('0xce')],'customerPort':_0x3da3dc[_0x121e('0xcf')]?_0x3da3dc['customerPort']:'N.A.'},'messages':_(_0x3da3dc[_0x121e('0x86')])[_0x121e('0xd0')]()[_0x121e('0xb3')]({'secret':![]})[_0x121e('0x3b')](function(_0x5b8a25){if(_0x5b8a25['Attachment']){var _0x15af1a=path['join'](_0x5ec2,_0x5b8a25[_0x121e('0x77')][_0x121e('0x81')]);if(fs['existsSync'](_0x15af1a)){fs[_0x121e('0xd1')](_0x15af1a)['pipe'](fs[_0x121e('0xd2')](path[_0x121e('0x7d')](_0x2a9477,_0x5b8a25['Attachment'][_0x121e('0x81')])));}}return{'date':moment(_0x5b8a25[_0x121e('0x94')])[_0x121e('0x89')](_0x121e('0xae'))[_0x121e('0xbf')](),'sender':_0x5b8a25[_0x121e('0xc6')]===_0x121e('0x64')?_0x5b8a25['User']?_0x5b8a25[_0x121e('0x87')][_0x121e('0x5a')]:_0x121e('0x8b'):_0x5b8a25[_0x121e('0x68')][_0x121e('0xd3')]+(_0x5b8a25[_0x121e('0x68')][_0x121e('0xc5')]?'\x20'+_0x5b8a25[_0x121e('0x68')][_0x121e('0xc5')]:''),'body':_0x5b8a25[_0x121e('0x77')]?_0x5b8a25[_0x121e('0x77')]['basename']:_0x5b8a25[_0x121e('0x35')],'direction':_0x5b8a25['direction']==='out'?'A':'C','secret':_0x5b8a25['secret'],'read':_0x5b8a25[_0x121e('0xc7')],'attachment':_0x5b8a25[_0x121e('0x77')]};})[_0x121e('0xd4')]()};return ejs['renderFile'](path[_0x121e('0x7d')](config[_0x121e('0x7e')],'server','views',_0x121e('0xd5')),{'interaction':_0x1b3229})[_0x121e('0x1c')](function(_0x1431cd){var _0x1c433e=path[_0x121e('0x7d')](_0x2a9477,_0x121e('0xd6')+_0x3da3dc['id']+'-'+_0x538c3f+_0x121e('0xd7'));var _0x3bcba8={'path':_0x1c433e,'channel':'Chat','interactionId':_0x3da3dc['id']};return pdf[_0x121e('0xd8')](_0x1431cd,_0x3bcba8);})[_0x121e('0x1c')](function(){return new Promise(function(_0x475a4c,_0x123d80){zipdir(_0x2a9477,{'saveTo':_0x5a68a5},function(_0x125118,_0x1e38ce){if(_0x125118)return _0x123d80(_0x125118);return _0x475a4c(_0x1e38ce);});})[_0x121e('0x1c')](function(){return new BPromise(function(_0x255ddd,_0x930df9){rimraf(_0x2a9477,function(_0x4b1a5e){if(_0x4b1a5e)_0x930df9(_0x4b1a5e);return _0x255ddd();});});})[_0x121e('0x1c')](function(){return _0x586c88[_0x121e('0xbd')](_0x5a68a5,_0x5f4c68,function(_0x23a343){if(_0x23a343){logger[_0x121e('0x23')](_0x121e('0xd9'),_0x23a343);}else{fs[_0x121e('0xda')](_0x5a68a5);}});});});}else{return _0x586c88[_0x121e('0x26')](0xc8);}})[_0x121e('0x25')](handleError(_0x586c88,null));};
\ No newline at end of file
+var _0x3fd4=['limit','count','set','Content-Range','update','destroy','name','send','render','merge','agent','interaction','account','index','map','rawAttributes','fieldName','type','getOptions','findAll','user','show','keys','ChatInteraction','query','filters','intersection','model','fields','attributes','length','includeAll','include','options','find','create','body','params','describe','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','createdAt','direction','secret','appendFileSync','MailServerOut','Smtp','SendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','getMyMessages','order','push','rows','addTags','setTags','spread','Tag','color','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','ChatWebsite','get','mkdirSync','Chat','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','toString','browserName','osName','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','request-promise','bluebird','mustache','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ChatInteraction,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3fd4,0x165));var _0x43fd=function(_0x43d440,_0x30a005){_0x43d440=_0x43d440-0x0;var _0x58a4ed=_0x3fd4[_0x43d440];return _0x58a4ed;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x43fd('0x0'));var moment=require('moment');var BPromise=require(_0x43fd('0x1'));var Mustache=require(_0x43fd('0x2'));var util=require('util');var path=require('path');var ejs=require(_0x43fd('0x3'));var fs=require('fs');var _=require(_0x43fd('0x4'));var Redis=require(_0x43fd('0x5'));var interaction=require(_0x43fd('0x6'));var qs=require(_0x43fd('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x43fd('0x8'))(_0x43fd('0x9'));var config=require(_0x43fd('0xa'));var db=require('../../mysqldb')['db'];config[_0x43fd('0xb')]=_[_0x43fd('0xc')](config[_0x43fd('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x43fd('0xd'))(new Redis(config[_0x43fd('0xb')]));require('./chatInteraction.socket')[_0x43fd('0xe')](socket);var jayson=require(_0x43fd('0xf'));var client=jayson[_0x43fd('0x10')][_0x43fd('0x11')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x291a2f,_0x15dcba,_0x3903c3,_0x28f1ec){return new BPromise(function(_0x5c3248,_0x5c4cce){var _0x3eae2d=_0x28f1ec||client;return _0x3eae2d[_0x43fd('0x12')](_0x291a2f,_0x3903c3)[_0x43fd('0x13')](function(_0x2dc839){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x15dcba,_0x43fd('0x14'));logger[_0x43fd('0x15')](_0x43fd('0x16'),_0x15dcba,'request\x20sent',JSON[_0x43fd('0x17')](_0x2dc839));if(_0x2dc839['error']){if(_0x2dc839['error'][_0x43fd('0x18')]===0x1f4){logger[_0x43fd('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x15dcba,_0x2dc839['error'][_0x43fd('0x1a')]);return _0x5c4cce(_0x2dc839[_0x43fd('0x19')][_0x43fd('0x1a')]);}logger['error'](_0x43fd('0x1b'),_0x15dcba,_0x2dc839[_0x43fd('0x19')][_0x43fd('0x1a')]);return _0x5c3248(_0x2dc839[_0x43fd('0x19')][_0x43fd('0x1a')]);}else{logger['info'](_0x43fd('0x1b'),_0x15dcba,_0x43fd('0x14'));_0x5c3248(_0x2dc839['result'][_0x43fd('0x1a')]);}})[_0x43fd('0x1c')](function(_0x23c381){logger[_0x43fd('0x19')](_0x43fd('0x1b'),_0x15dcba,_0x23c381);_0x5c4cce(_0x23c381);});});}function respondWithStatusCode(_0x3c199c,_0x53fbf6){_0x53fbf6=_0x53fbf6||0xcc;return function(_0x2c283d){if(_0x2c283d){return _0x3c199c[_0x43fd('0x1d')](_0x53fbf6);}return _0x3c199c[_0x43fd('0x1e')](_0x53fbf6)[_0x43fd('0x1f')]();};}function respondWithResult(_0x12cdda,_0x7ee0ab){_0x7ee0ab=_0x7ee0ab||0xc8;return function(_0x45bfd2){if(_0x45bfd2){return _0x12cdda['status'](_0x7ee0ab)[_0x43fd('0x20')](_0x45bfd2);}};}function respondWithFilteredResult(_0x57e5eb,_0x34b44b){return function(_0x98b728){if(_0x98b728){var _0x1ca613=typeof _0x34b44b[_0x43fd('0x21')]===_0x43fd('0x22')&&typeof _0x34b44b[_0x43fd('0x23')]===_0x43fd('0x22');var _0x2679c3=_0x98b728[_0x43fd('0x24')];var _0x57ce36=_0x1ca613?0x0:_0x34b44b[_0x43fd('0x21')];var _0x48bafe=_0x1ca613?_0x98b728[_0x43fd('0x24')]:_0x34b44b[_0x43fd('0x21')]+_0x34b44b[_0x43fd('0x23')];var _0x1bae69;if(_0x48bafe>=_0x2679c3){_0x48bafe=_0x2679c3;_0x1bae69=0xc8;}else{_0x1bae69=0xce;}_0x57e5eb[_0x43fd('0x1e')](_0x1bae69);return _0x57e5eb[_0x43fd('0x25')](_0x43fd('0x26'),_0x57ce36+'-'+_0x48bafe+'/'+_0x2679c3)[_0x43fd('0x20')](_0x98b728);}return null;};}function saveUpdates(_0x3869c3){return function(_0x3bd390){if(_0x3bd390){return _0x3bd390[_0x43fd('0x27')](_0x3869c3)['then'](function(_0x36e547){return _0x36e547;});}return null;};}function removeEntity(_0x3a7153){return function(_0x3cde15){if(_0x3cde15){return _0x3cde15[_0x43fd('0x28')]()[_0x43fd('0x13')](function(){_0x3a7153[_0x43fd('0x1e')](0xcc)[_0x43fd('0x1f')]();});}};}function handleEntityNotFound(_0x43f14c){return function(_0x5750ef){if(!_0x5750ef){_0x43f14c['sendStatus'](0x194);}return _0x5750ef;};}function handleError(_0x53caa1,_0x1785a5){_0x1785a5=_0x1785a5||0x1f4;return function(_0x34af13){logger[_0x43fd('0x19')](_0x34af13['stack']);if(_0x34af13[_0x43fd('0x29')]){delete _0x34af13[_0x43fd('0x29')];}_0x53caa1[_0x43fd('0x1e')](_0x1785a5)[_0x43fd('0x2a')](_0x34af13);};}function getMustacheRender(_0x1275ce,_0x469be0){return Mustache[_0x43fd('0x2b')](_0x1275ce,_[_0x43fd('0x2c')](_0x469be0['body'],{'contact':_0x469be0['contact'],'message':_0x469be0[_0x43fd('0x1a')],'agent':_0x469be0[_0x43fd('0x2d')],'interaction':_0x469be0[_0x43fd('0x2e')],'account':_0x469be0[_0x43fd('0x2f')]}))||'';}exports[_0x43fd('0x30')]=function(_0xa9a204,_0x5ea1cd){var _0x1038ff={};var _0x178e02=_[_0x43fd('0x31')](db['ChatInteraction'][_0x43fd('0x32')],function(_0x2bf6c8){return{'name':_0x2bf6c8[_0x43fd('0x33')],'type':_0x2bf6c8[_0x43fd('0x34')]['key']};});_0x1038ff=qs[_0x43fd('0x35')](_0x178e02,_0xa9a204);return interaction[_0x43fd('0x36')]('chat',_0xa9a204['query'],_0xa9a204[_0x43fd('0x37')],_0x1038ff,_0x178e02)['then'](respondWithFilteredResult(_0x5ea1cd,_0x1038ff))[_0x43fd('0x1c')](handleError(_0x5ea1cd,null));};exports[_0x43fd('0x38')]=function(_0xfcff7c,_0x1a02fa){var _0x478367={'raw':![],'where':{'id':_0xfcff7c['params']['id']}},_0x1c2987={};_0x1c2987['model']=_[_0x43fd('0x39')](db[_0x43fd('0x3a')][_0x43fd('0x32')]);_0x1c2987[_0x43fd('0x3b')]=_[_0x43fd('0x39')](_0xfcff7c[_0x43fd('0x3b')]);_0x1c2987[_0x43fd('0x3c')]=_[_0x43fd('0x3d')](_0x1c2987[_0x43fd('0x3e')],_0x1c2987[_0x43fd('0x3b')]);_0x478367['attributes']=_[_0x43fd('0x3d')](_0x1c2987[_0x43fd('0x3e')],qs[_0x43fd('0x3f')](_0xfcff7c[_0x43fd('0x3b')][_0x43fd('0x3f')]));_0x478367[_0x43fd('0x40')]=_0x478367[_0x43fd('0x40')][_0x43fd('0x41')]?_0x478367[_0x43fd('0x40')]:_0x1c2987[_0x43fd('0x3e')];if(_0xfcff7c['query'][_0x43fd('0x42')]){_0x478367[_0x43fd('0x43')]=[{'all':!![]}];}_0x478367=_[_0x43fd('0x2c')]({},_0x478367,_0xfcff7c[_0x43fd('0x44')]);return db[_0x43fd('0x3a')][_0x43fd('0x45')](_0x478367)[_0x43fd('0x13')](handleEntityNotFound(_0x1a02fa,null))[_0x43fd('0x13')](respondWithResult(_0x1a02fa,null))[_0x43fd('0x1c')](handleError(_0x1a02fa,null));};exports[_0x43fd('0x46')]=function(_0x186420,_0x74a1e3){return db[_0x43fd('0x3a')]['create'](_0x186420[_0x43fd('0x47')],{})[_0x43fd('0x13')](respondWithResult(_0x74a1e3,0xc9))[_0x43fd('0x1c')](handleError(_0x74a1e3,null));};exports['update']=function(_0x675566,_0x14d4ad){if(_0x675566[_0x43fd('0x47')]['id']){delete _0x675566['body']['id'];}return db[_0x43fd('0x3a')][_0x43fd('0x45')]({'where':{'id':_0x675566[_0x43fd('0x48')]['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0x14d4ad,null))[_0x43fd('0x13')](saveUpdates(_0x675566[_0x43fd('0x47')],null))[_0x43fd('0x13')](respondWithResult(_0x14d4ad,null))['catch'](handleError(_0x14d4ad,null));};exports[_0x43fd('0x28')]=function(_0x2a72b8,_0xd98a8b){return db['ChatInteraction'][_0x43fd('0x45')]({'where':{'id':_0x2a72b8[_0x43fd('0x48')]['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0xd98a8b,null))[_0x43fd('0x13')](removeEntity(_0xd98a8b,null))[_0x43fd('0x1c')](handleError(_0xd98a8b,null));};exports[_0x43fd('0x49')]=function(_0x1dabb6,_0x183036){return db[_0x43fd('0x3a')][_0x43fd('0x49')]()[_0x43fd('0x13')](respondWithResult(_0x183036,null))[_0x43fd('0x1c')](handleError(_0x183036,null));};exports['createVidaooSession']=function(_0x33c9f6,_0x440bb1){var _0x2bbb89=_0x33c9f6[_0x43fd('0x48')]['id'];var _0x23eb7e;var _0x1c3e81;var _0x4af990;return db[_0x43fd('0x3a')][_0x43fd('0x4a')]({'where':{'id':_0x2bbb89}})[_0x43fd('0x13')](function(_0x5f3834){_0x23eb7e=_0x5f3834;return db['ChatWebsite'][_0x43fd('0x4a')]({'where':{'id':_0x5f3834[_0x43fd('0x4b')]},'attributes':['id','vidaooApiKey',_0x43fd('0x4c'),_0x43fd('0x4d'),_0x43fd('0x4e'),_0x43fd('0x4f')],'raw':!![]});})[_0x43fd('0x13')](function(_0x22456b){if(_0x22456b&&_0x22456b['vidaooApiKey']&&_0x22456b['vidaooEscalation']){_0x1c3e81=_0x22456b;var _0x4fd3b3={'interaction':{'id':_0x2bbb89},'agent':{'id':_0x33c9f6['user']['id'],'name':_0x33c9f6[_0x43fd('0x37')][_0x43fd('0x29')],'fullname':_0x33c9f6[_0x43fd('0x37')]['fullname'],'email':_0x33c9f6[_0x43fd('0x37')][_0x43fd('0x50')]},'contact':_0x33c9f6['body'][_0x43fd('0x51')],'account':_0x33c9f6['body']['account']};var _0x4c437b={'rejectUnauthorized':![],'method':_0x43fd('0x52'),'url':_0x43fd('0x53'),'headers':{'X-APIKEY':_0x22456b['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x33c9f6[_0x43fd('0x37')][_0x43fd('0x50')]],'buttons':null,'topic':_0x1c3e81[_0x43fd('0x4d')],'note':_[_0x43fd('0x54')](_0x1c3e81['vidaooNote'])?null:getMustacheRender(_0x1c3e81[_0x43fd('0x4e')],_0x4fd3b3),'metadata':null},'redirect':_0x43fd('0x55'),'json':!![]};try{if(!_['isNull'](_0x1c3e81['vidaooMetadata'])){var _0x433b60=getMustacheRender(_0x1c3e81['vidaooMetadata'],_0x4fd3b3);var _0x509036=JSON[_0x43fd('0x56')](_0x433b60);_0x4c437b[_0x43fd('0x47')]['metadata']=_0x509036;}}catch(_0x2939bd){throw new db[(_0x43fd('0x57'))][(_0x43fd('0x58'))](_0x43fd('0x59'));}return rp(_0x4c437b);}else{throw new db['Sequelize'][(_0x43fd('0x58'))](_0x43fd('0x5a'));}})['then'](function(_0x524e98){_0x4af990=_0x524e98;if(_0x4af990['id']){var _0x32d75e={'body':_0x4af990[_0x43fd('0x5b')],'ChatWebsiteId':_0x1c3e81['id'],'ChatInteractionId':_0x23eb7e['id'],'direction':'out','UserId':_0x33c9f6[_0x43fd('0x37')]['id']};return db[_0x43fd('0x5c')][_0x43fd('0x46')](_0x32d75e,{});}else{throw new db[(_0x43fd('0x57'))][(_0x43fd('0x58'))](_0x43fd('0x5d'));}})[_0x43fd('0x13')](function(){return _0x23eb7e[_0x43fd('0x5e')]({'vidaooSessionId':_0x4af990['id']});})[_0x43fd('0x13')](respondWithResult(_0x440bb1,null))['catch'](handleError(_0x440bb1,null));};exports[_0x43fd('0x5f')]=function(_0x1296a9,_0x114149){if(_0x1296a9[_0x43fd('0x47')]['id']){delete _0x1296a9[_0x43fd('0x47')]['id'];}return db[_0x43fd('0x3a')][_0x43fd('0x45')]({'where':{'id':_0x1296a9[_0x43fd('0x48')]['id']},'include':[{'model':db[_0x43fd('0x60')],'as':_0x43fd('0x61')}]})[_0x43fd('0x13')](handleEntityNotFound(_0x114149,null))['then'](saveUpdates(_0x1296a9['body'],null))[_0x43fd('0x13')](respondWithResult(_0x114149,null))[_0x43fd('0x1c')](handleError(_0x114149,null));};exports[_0x43fd('0x62')]=function(_0x3eab69,_0x2cdd6e){if(_0x3eab69['body']['id']){delete _0x3eab69[_0x43fd('0x47')]['id'];}return db[_0x43fd('0x3a')][_0x43fd('0x45')]({'where':{'id':_0x3eab69['params']['id']}})[_0x43fd('0x13')](function(_0x734a5f){if(!_0x734a5f){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x43fd('0x62'),0x194,_0x43fd('0x63'));_0x2cdd6e['sendStatus'](0x194);}else{if(_0x734a5f[_0x43fd('0x64')]){throw new db['Sequelize'][(_0x43fd('0x58'))](_0x43fd('0x65'));}}return _0x734a5f;})['then'](function(_0x418252){if(_0x418252){return _0x418252[_0x43fd('0x27')]({'closed':_0x3eab69[_0x43fd('0x47')][_0x43fd('0x66')],'disposition':_0x3eab69['body'][_0x43fd('0x67')]})['then'](function(_0x40f734){return _0x40f734;});}})[_0x43fd('0x13')](function(){return respondWithRpcPromise('AbandonInteraction',_0x43fd('0x62'),_0x3eab69[_0x43fd('0x47')],client9004);})[_0x43fd('0x13')](respondWithResult(_0x2cdd6e,null))[_0x43fd('0x1c')](handleError(_0x2cdd6e,null));};exports[_0x43fd('0x68')]=function(_0x19e916,_0x3a0302){_0x19e916[_0x43fd('0x47')][_0x43fd('0x29')]=_0x19e916[_0x43fd('0x69')]['originalname'];_0x19e916[_0x43fd('0x47')]['basename']=_0x19e916[_0x43fd('0x69')]['filename'];_0x19e916[_0x43fd('0x47')]['type']=_0x19e916['file'][_0x43fd('0x6a')];return db[_0x43fd('0x6b')][_0x43fd('0x46')](_0x19e916['body'])[_0x43fd('0x13')](respondWithResult(_0x3a0302,0xc9))[_0x43fd('0x1c')](handleError(_0x3a0302,null));};exports[_0x43fd('0x6c')]=function(_0xbe5beb,_0x45b7ee){return db[_0x43fd('0x3a')][_0x43fd('0x4a')]({'where':{'id':_0xbe5beb['params']['id']},'raw':!![]})[_0x43fd('0x13')](handleEntityNotFound(_0x45b7ee,null))[_0x43fd('0x13')](function(_0x51b465){if(_0x51b465){if(_0x51b465[_0x43fd('0x66')]){return _0x45b7ee[_0x43fd('0x1e')](0x193)[_0x43fd('0x20')]({'status':0x193,'message':_0x43fd('0x6d')});}return db[_0x43fd('0x6b')][_0x43fd('0x4a')]({'where':{'id':_0xbe5beb[_0x43fd('0x3b')]['attachId']},'raw':!![]})[_0x43fd('0x13')](handleEntityNotFound(_0x45b7ee,null));}})[_0x43fd('0x13')](function(_0x2b8e25){if(_0x2b8e25){var _0x23983c=_0x2b8e25[_0x43fd('0x6e')]!==null;var _0x11e661=path[_0x43fd('0x6f')](config[_0x43fd('0x70')],'server/files/attachments/');if(_0x23983c){_0x11e661=path[_0x43fd('0x6f')](_0x11e661,'offline-chat/');}var _0x4a8eb2=path[_0x43fd('0x6f')](_0x11e661,_0x2b8e25['basename']);return _0x45b7ee[_0x43fd('0x71')](_0x4a8eb2);}})[_0x43fd('0x1c')](handleError(_0x45b7ee,null));};exports['close']=function(_0x1d7533,_0x9b30b0){var _0x588364=null;var _0x15a491=null;var _0x2258bd=null;if(_0x1d7533[_0x43fd('0x47')]['id']){delete _0x1d7533[_0x43fd('0x47')]['id'];}if(_0x1d7533['body'][_0x43fd('0x72')]){_0x2258bd=path['join'](config[_0x43fd('0x70')],_0x43fd('0x73'),util[_0x43fd('0x74')](_0x43fd('0x75'),Date[_0x43fd('0x76')]()));_0x1d7533[_0x43fd('0x47')][_0x43fd('0x77')]=_0x2258bd;}return db[_0x43fd('0x3a')]['find']({'where':{'id':_0x1d7533[_0x43fd('0x48')]['id']},'include':[{'model':db[_0x43fd('0x5c')],'as':_0x43fd('0x78'),'include':[{'model':db['User'],'as':_0x43fd('0x79')}]}]})['then'](handleEntityNotFound(_0x9b30b0,null))[_0x43fd('0x13')](saveUpdates(_0x1d7533[_0x43fd('0x47')],null))[_0x43fd('0x13')](function(_0x508dda){if(_0x508dda){_0x588364=_0x508dda;return db['ChatWebsite'][_0x43fd('0x45')]({'where':{'id':_0x588364[_0x43fd('0x4b')]}});}})[_0x43fd('0x13')](function(_0x13f0cb){if(_0x13f0cb){_0x15a491=_0x13f0cb;return db['CmContact'][_0x43fd('0x45')]({'where':{'id':_0x588364[_0x43fd('0x7a')]}});}})['then'](function(_0x2b003d){if(_0x2b003d){if(_0x2258bd){var _0x4e8753=null;for(var _0x1c37ae=0x1;_0x1c37ae<_0x588364['Messages'][_0x43fd('0x41')];++_0x1c37ae){_0x4e8753=_0x588364[_0x43fd('0x78')][_0x1c37ae];var _0x1eed7b=_0x4e8753[_0x43fd('0x64')]?util[_0x43fd('0x74')](_0x43fd('0x7b'),_0x15a491[_0x43fd('0x7c')],_0x4e8753[_0x43fd('0x64')]):_0x43fd('0x7d');var _0x5c70f0=_0x1d7533[_0x43fd('0x47')]['customer']||util[_0x43fd('0x74')]('%s%d',_0x43fd('0x7e'),_0x4e8753[_0x43fd('0x7a')]);switch(_0x15a491[_0x43fd('0x7f')]){case _0x43fd('0x80'):_0x1eed7b=_0x4e8753[_0x43fd('0x64')]?util['format']('%s%d',_0x15a491['agentAlias'],_0x4e8753[_0x43fd('0x64')]):_0x43fd('0x7d');break;case _0x43fd('0x81'):_0x1eed7b=_0x4e8753['UserId']?_0x4e8753['User'][_0x43fd('0x82')]||_0x4e8753[_0x43fd('0x79')][_0x43fd('0x83')]:'System';break;case _0x43fd('0x84'):_0x1eed7b=_0x4e8753['UserId']?_0x4e8753[_0x43fd('0x79')][_0x43fd('0x83')]:_0x43fd('0x7d');break;default:_0x1eed7b=_0x4e8753[_0x43fd('0x64')]?util[_0x43fd('0x74')]('%s%d',_0x15a491[_0x43fd('0x7c')],_0x4e8753[_0x43fd('0x64')]):_0x43fd('0x7d');}var _0x417ae8=util[_0x43fd('0x74')]('[%s]\x20%s:\x20%s\x0a',moment(_0x4e8753[_0x43fd('0x85')])[_0x43fd('0x74')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4e8753[_0x43fd('0x86')]==='in'?_0x5c70f0:_0x1eed7b,_0x4e8753[_0x43fd('0x47')]);if(!_0x4e8753[_0x43fd('0x87')]){fs[_0x43fd('0x88')](_0x2258bd,_0x417ae8);}}return db['MailAccount'][_0x43fd('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0x43fd('0x89')],'as':_0x43fd('0x8a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x5a7165){if(!_0x5a7165||!_0x5a7165['Smtp']||!_0x1d7533[_0x43fd('0x47')])return _0x588364;var _0x396f26=_0x5a7165['getSmtpOptions']();return respondWithRpcPromise(_0x43fd('0x8b'),'sendMail',{'account':_0x396f26,'message':{'from':util[_0x43fd('0x74')](_0x43fd('0x8c'),_0x5a7165[_0x43fd('0x29')],_0x5a7165[_0x43fd('0x50')]||_0x5a7165[_0x43fd('0x8a')][_0x43fd('0x37')]),'to':_0x1d7533[_0x43fd('0x47')][_0x43fd('0x72')],'subject':'Mail\x20Transcript','text':util[_0x43fd('0x74')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1d7533['body']['mailTranscript']),'attachments':[{'path':_0x2258bd}]}})[_0x43fd('0x13')](function(){return _0x588364;})[_0x43fd('0x1c')](function(_0x77f9a4){logger[_0x43fd('0x19')](_0x77f9a4);});})['then'](respondWithStatusCode(_0x9b30b0,0xc8))['catch'](handleError(_0x9b30b0,null));};exports[_0x43fd('0x8d')]=function(_0x3adcfe,_0x15953f){return db[_0x43fd('0x5c')]['find']({'where':{'id':_0x3adcfe['params']['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0x15953f,null))[_0x43fd('0x13')](function(_0x32b70f){if(_0x32b70f){return _0x32b70f[_0x43fd('0x8d')](_0x3adcfe[_0x43fd('0x47')][_0x43fd('0x8e')],_[_0x43fd('0x8f')](_0x3adcfe[_0x43fd('0x47')],[_0x43fd('0x8e'),'id'])||{});}})[_0x43fd('0x13')](respondWithResult(_0x15953f,null))['catch'](handleError(_0x15953f,null));};exports[_0x43fd('0x90')]=function(_0x24f167,_0x5b7c46){var _0x562b8b={'raw':![],'where':{}};var _0x30c2e9={};var _0x4fcec7={'count':0x0,'rows':[]};return db[_0x43fd('0x3a')][_0x43fd('0x4a')]({'where':{'id':_0x24f167[_0x43fd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b7c46,null))[_0x43fd('0x13')](function(_0x58a475){if(_0x58a475){_0x30c2e9[_0x43fd('0x3e')]=_['keys'](db[_0x43fd('0x5c')][_0x43fd('0x32')]);_0x30c2e9[_0x43fd('0x3b')]=_[_0x43fd('0x39')](_0x24f167[_0x43fd('0x3b')]);_0x30c2e9[_0x43fd('0x3c')]=_[_0x43fd('0x3d')](_0x30c2e9[_0x43fd('0x3e')],_0x30c2e9[_0x43fd('0x3b')]);_0x562b8b[_0x43fd('0x40')]=_['intersection'](_0x30c2e9[_0x43fd('0x3e')],qs[_0x43fd('0x3f')](_0x24f167[_0x43fd('0x3b')][_0x43fd('0x3f')]));_0x562b8b[_0x43fd('0x40')]=_0x562b8b[_0x43fd('0x40')][_0x43fd('0x41')]?_0x562b8b[_0x43fd('0x40')]:_0x30c2e9['model'];if(!_0x24f167[_0x43fd('0x3b')][_0x43fd('0x91')](_0x43fd('0x92'))){_0x562b8b[_0x43fd('0x23')]=qs[_0x43fd('0x23')](_0x24f167[_0x43fd('0x3b')][_0x43fd('0x23')]);_0x562b8b[_0x43fd('0x21')]=qs['offset'](_0x24f167[_0x43fd('0x3b')][_0x43fd('0x21')]);}_0x562b8b['order']=qs[_0x43fd('0x93')](_0x24f167[_0x43fd('0x3b')][_0x43fd('0x93')]);_0x562b8b[_0x43fd('0x94')]=qs[_0x43fd('0x3c')](_[_0x43fd('0x95')](_0x24f167[_0x43fd('0x3b')],_0x30c2e9[_0x43fd('0x3c')]));_0x562b8b[_0x43fd('0x94')][_0x43fd('0x96')]=_0x58a475['id'];if(_0x24f167[_0x43fd('0x3b')][_0x43fd('0x97')]){_0x562b8b[_0x43fd('0x94')]=_[_0x43fd('0x2c')](_0x562b8b[_0x43fd('0x94')],{'$or':_[_0x43fd('0x31')](_0x562b8b[_0x43fd('0x40')],function(_0x345191){var _0x1575c6={};_0x1575c6[_0x345191]={'$like':'%'+_0x24f167[_0x43fd('0x3b')][_0x43fd('0x97')]+'%'};return _0x1575c6;})});}if(_0x24f167[_0x43fd('0x3b')][_0x43fd('0x98')]){var _0x24acd1=_0x24f167[_0x43fd('0x3b')][_0x43fd('0x98')]['split'](',');var _0x541703={};_0x541703[_0x24acd1[0x0]]={'$gte':moment(_0x24acd1[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x562b8b[_0x43fd('0x94')]=_[_0x43fd('0x2c')](_0x562b8b['where'],_0x541703);}_0x562b8b=_['merge']({},_0x562b8b,_0x24f167['options']);return db[_0x43fd('0x5c')]['count']({'where':_0x562b8b[_0x43fd('0x94')]})[_0x43fd('0x13')](function(_0x47790e){_0x4fcec7[_0x43fd('0x24')]=_0x47790e;if(_0x24f167[_0x43fd('0x3b')]['includeAll']){_0x562b8b[_0x43fd('0x43')]=[{'all':!![]}];}return db[_0x43fd('0x5c')][_0x43fd('0x36')](_0x562b8b);})[_0x43fd('0x13')](function(_0x47b450){_0x4fcec7['rows']=_0x47b450;return _0x4fcec7;});}})[_0x43fd('0x13')](respondWithFilteredResult(_0x5b7c46,_0x562b8b))[_0x43fd('0x1c')](handleError(_0x5b7c46,null));};exports[_0x43fd('0x99')]=function(_0x4677c8,_0x427637){var _0x356ad2={'where':{}},_0x30a2ca={},_0xaf54bc={'count':0x0,'rows':[]};return db[_0x43fd('0x3a')][_0x43fd('0x4a')]({'where':{'id':_0x4677c8[_0x43fd('0x48')]['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0x427637,null))[_0x43fd('0x13')](function(_0x9cb030){if(_0x9cb030){_0x30a2ca[_0x43fd('0x3e')]=_['keys'](db['ChatMessage'][_0x43fd('0x32')]);_0x30a2ca[_0x43fd('0x3b')]=_[_0x43fd('0x39')](_0x4677c8[_0x43fd('0x3b')]);_0x30a2ca[_0x43fd('0x3c')]=_[_0x43fd('0x3d')](_0x30a2ca[_0x43fd('0x3e')],_0x30a2ca[_0x43fd('0x3b')]);_0x356ad2[_0x43fd('0x40')]=_[_0x43fd('0x3d')](_0x30a2ca[_0x43fd('0x3e')],qs[_0x43fd('0x3f')](_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x3f')]));_0x356ad2['attributes']=_0x356ad2[_0x43fd('0x40')][_0x43fd('0x41')]?_0x356ad2['attributes']:_0x30a2ca['model'];if(!_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x91')](_0x43fd('0x92'))){_0x356ad2[_0x43fd('0x23')]=qs[_0x43fd('0x23')](_0x4677c8['query']['limit']);_0x356ad2[_0x43fd('0x21')]=qs[_0x43fd('0x21')](_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x21')]);}_0x356ad2[_0x43fd('0x9a')]=qs[_0x43fd('0x93')](_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x93')]);_0x356ad2[_0x43fd('0x94')]=qs['filters'](_[_0x43fd('0x95')](_0x4677c8[_0x43fd('0x3b')],_0x30a2ca[_0x43fd('0x3c')]));_0x356ad2[_0x43fd('0x94')][_0x43fd('0x96')]=_0x9cb030['id'];if(_0x4677c8[_0x43fd('0x3b')]['filter']){_0x356ad2[_0x43fd('0x94')]=_[_0x43fd('0x2c')](_0x356ad2[_0x43fd('0x94')],{'$or':_[_0x43fd('0x31')](_0x356ad2['attributes'],function(_0x27fd9b){var _0x17f65a={};_0x17f65a[_0x27fd9b]={'$like':'%'+_0x4677c8[_0x43fd('0x3b')]['filter']+'%'};return _0x17f65a;})});}_0x356ad2[_0x43fd('0x94')][_0x43fd('0x87')]=![];if(_0x4677c8[_0x43fd('0x3b')]['id']){_0x356ad2['where']['id']={'$gt':_0x4677c8['query']['id']};}_0x356ad2=_[_0x43fd('0x2c')]({},_0x356ad2,_0x4677c8[_0x43fd('0x44')]);return db[_0x43fd('0x5c')][_0x43fd('0x24')]({'where':_0x356ad2[_0x43fd('0x94')]})['then'](function(_0x227def){_0xaf54bc[_0x43fd('0x24')]=_0x227def;_0x356ad2[_0x43fd('0x43')]=[];if(_0x4677c8[_0x43fd('0x3b')]['includeAgent']){_0x356ad2[_0x43fd('0x43')][_0x43fd('0x9b')]({'model':db['User'],'as':_0x43fd('0x79'),'attributes':['id',_0x43fd('0x83'),'alias']});}if(_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x42')]){_0x356ad2[_0x43fd('0x43')]=[{'all':!![]}];}return db[_0x43fd('0x5c')][_0x43fd('0x36')](_0x356ad2);})[_0x43fd('0x13')](function(_0x1f6582){_0xaf54bc[_0x43fd('0x9c')]=_0x1f6582;return _0xaf54bc;});}})['then'](respondWithFilteredResult(_0x427637,_0x356ad2))['catch'](handleError(_0x427637,null));};exports[_0x43fd('0x9d')]=function(_0xdc5539,_0x1f2893){return db['ChatInteraction'][_0x43fd('0x45')]({'where':{'id':_0xdc5539[_0x43fd('0x48')]['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0x1f2893,null))[_0x43fd('0x13')](function(_0x1abec0){if(_0x1abec0){return _0x1abec0[_0x43fd('0x9e')](_0xdc5539[_0x43fd('0x47')][_0x43fd('0x8e')],_[_0x43fd('0x8f')](_0xdc5539[_0x43fd('0x47')],[_0x43fd('0x8e'),'id'])||{})[_0x43fd('0x9f')](function(){return db[_0x43fd('0xa0')][_0x43fd('0x36')]({'attributes':['id',_0x43fd('0x29'),_0x43fd('0xa1')],'where':{'id':_0xdc5539['body']['ids']}});})[_0x43fd('0x13')](function(_0x18cb14){socket['emit']('chatInteractionTags:save',{'id':Number(_0xdc5539['params']['id']),'tags':_0x18cb14||[]});return{'id':Number(_0xdc5539[_0x43fd('0x48')]['id']),'tags':_0x18cb14||[]};});}})[_0x43fd('0x13')](respondWithResult(_0x1f2893,null))[_0x43fd('0x1c')](handleError(_0x1f2893,null));};exports[_0x43fd('0xa2')]=function(_0x47661b,_0x5235ab){return db[_0x43fd('0x3a')][_0x43fd('0x45')]({'where':{'id':_0x47661b[_0x43fd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5235ab,null))[_0x43fd('0x13')](function(_0x564064){if(_0x564064){return _0x564064[_0x43fd('0xa2')](_0x47661b['query'][_0x43fd('0x8e')]);}})[_0x43fd('0x13')](respondWithStatusCode(_0x5235ab,null))[_0x43fd('0x1c')](handleError(_0x5235ab,null));};exports[_0x43fd('0x71')]=function(_0x2280ca,_0x25fd70){var _0x44431c=moment()[_0x43fd('0xa3')]()['toString']();var _0x456180=path['join'](config[_0x43fd('0x70')],'server','files',_0x43fd('0xa4'));var _0x46d8bd=path[_0x43fd('0x6f')](config[_0x43fd('0x70')],_0x43fd('0xa5'),_0x43fd('0xa6'),_0x43fd('0xa7'));var _0x554d5d=path[_0x43fd('0x6f')](_0x456180,_0x44431c);var _0x2738f1=util[_0x43fd('0x74')](_0x43fd('0xa8'),_0x2280ca[_0x43fd('0x48')]['id'],_0x44431c);var _0x331fd4=path[_0x43fd('0x6f')](_0x456180,_0x2738f1);var _0x56f882=[];_0x56f882[_0x43fd('0x9b')]({'model':db['User'],'as':_0x43fd('0x79'),'attributes':['id',_0x43fd('0x83')],'raw':!![]});_0x56f882[_0x43fd('0x9b')]({'model':db[_0x43fd('0x60')],'as':_0x43fd('0x61'),'attributes':['id',_0x43fd('0xa9'),_0x43fd('0xaa')],'raw':!![]});if(_0x2280ca[_0x43fd('0x3b')][_0x43fd('0xa7')]){_0x56f882[_0x43fd('0x9b')]({'model':db[_0x43fd('0x6b')],'as':_0x43fd('0x6b'),'raw':!![]});}var _0x5deb37=[{'model':db[_0x43fd('0x5c')],'as':'Messages','attributes':['id',_0x43fd('0x47'),_0x43fd('0x85'),_0x43fd('0x86'),_0x43fd('0x87'),_0x43fd('0xab')],'include':_0x56f882}];_0x5deb37[_0x43fd('0x9b')]({'model':db[_0x43fd('0xac')],'as':'Account','attributes':['id',_0x43fd('0x29')]});_0x5deb37['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x43fd('0x83')]});return db[_0x43fd('0x3a')]['find']({'where':{'id':_0x2280ca[_0x43fd('0x48')]['id']},'include':_0x5deb37})[_0x43fd('0x13')](handleEntityNotFound(_0x25fd70,null))[_0x43fd('0x13')](function(_0x4d71df){if(_0x4d71df){var _0x490fab=_0x4d71df[_0x43fd('0xad')]({'plain':!![]});fs[_0x43fd('0xae')](_0x554d5d);var _0x32d145={'channel':_0x43fd('0xaf'),'account':_0x490fab[_0x43fd('0xb0')][_0x43fd('0x29')],'agent':_0x490fab[_0x43fd('0xb1')]?_0x490fab['Owner']['fullname']:'N.A.','createdAt':moment(_0x490fab['createdAt'])[_0x43fd('0x74')](_0x43fd('0xb2'))[_0x43fd('0xb3')](),'closedAt':_0x490fab['closed']?moment(_0x490fab['closedAt'])[_0x43fd('0x74')](_0x43fd('0xb2'))[_0x43fd('0xb3')]():'','disposition':_0x490fab['disposition'],'chatInfo':{'browser':_0x490fab[_0x43fd('0xb4')],'os':_0x490fab[_0x43fd('0xb5')],'referer':_0x490fab['referer'],'customerIp':_0x490fab['customerIp'],'customerPort':_0x490fab[_0x43fd('0xb6')]?_0x490fab[_0x43fd('0xb6')]:_0x43fd('0xb7')},'messages':_(_0x490fab[_0x43fd('0x78')])[_0x43fd('0xb8')]()[_0x43fd('0x97')]({'secret':![]})[_0x43fd('0x31')](function(_0xb548cb){if(_0xb548cb[_0x43fd('0x6b')]){var _0x315763=path[_0x43fd('0x6f')](_0x46d8bd,_0xb548cb[_0x43fd('0x6b')]['basename']);if(fs[_0x43fd('0xb9')](_0x315763)){fs[_0x43fd('0xba')](_0x315763)['pipe'](fs[_0x43fd('0xbb')](path[_0x43fd('0x6f')](_0x554d5d,_0xb548cb[_0x43fd('0x6b')]['basename'])));}}return{'date':moment(_0xb548cb[_0x43fd('0x85')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x43fd('0xb3')](),'sender':_0xb548cb[_0x43fd('0x86')]===_0x43fd('0xbc')?_0xb548cb['User']?_0xb548cb[_0x43fd('0x79')]['fullname']:_0x43fd('0x7d'):_0xb548cb[_0x43fd('0x61')]['firstName']+(_0xb548cb['Contact'][_0x43fd('0xaa')]?'\x20'+_0xb548cb['Contact'][_0x43fd('0xaa')]:''),'body':_0xb548cb[_0x43fd('0x6b')]?_0xb548cb[_0x43fd('0x6b')]['basename']:_0xb548cb[_0x43fd('0x47')],'direction':_0xb548cb[_0x43fd('0x86')]===_0x43fd('0xbc')?'A':'C','secret':_0xb548cb[_0x43fd('0x87')],'read':_0xb548cb[_0x43fd('0xab')],'attachment':_0xb548cb['Attachment']};})[_0x43fd('0xbd')]()};return ejs[_0x43fd('0xbe')](path['join'](config[_0x43fd('0x70')],_0x43fd('0xa5'),_0x43fd('0xbf'),_0x43fd('0xc0')),{'interaction':_0x32d145})['then'](function(_0x3709ca){var _0x50a8ef=path[_0x43fd('0x6f')](_0x554d5d,_0x43fd('0xc1')+_0x490fab['id']+'-'+_0x44431c+'.pdf');var _0x5b9d52={'path':_0x50a8ef,'channel':_0x43fd('0xaf'),'interactionId':_0x490fab['id']};return pdf[_0x43fd('0xc2')](_0x3709ca,_0x5b9d52);})[_0x43fd('0x13')](function(){return new Promise(function(_0x8ad329,_0x1a120e){zipdir(_0x554d5d,{'saveTo':_0x331fd4},function(_0x7f082e,_0x4a49c4){if(_0x7f082e)return _0x1a120e(_0x7f082e);return _0x8ad329(_0x4a49c4);});})[_0x43fd('0x13')](function(){return new BPromise(function(_0x2a7cac,_0x2408fb){rimraf(_0x554d5d,function(_0x25c9fb){if(_0x25c9fb)_0x2408fb(_0x25c9fb);return _0x2a7cac();});});})[_0x43fd('0x13')](function(){return _0x25fd70['download'](_0x331fd4,_0x2738f1,function(_0x3112ef){if(_0x3112ef){logger[_0x43fd('0x19')](_0x43fd('0xc3'),_0x3112ef);}else{fs['unlinkSync'](_0x331fd4);}});});});}else{return _0x25fd70[_0x43fd('0x1d')](0xc8);}})[_0x43fd('0x1c')](handleError(_0x25fd70,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d51fbac..c375213 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 _0x5214=['getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update'];(function(_0x19fe31,_0x4664eb){var _0x1ed7d0=function(_0x200b11){while(--_0x200b11){_0x19fe31['push'](_0x19fe31['shift']());}};_0x1ed7d0(++_0x4664eb);}(_0x5214,0x1d6));var _0x4521=function(_0x53fa47,_0xdff043){_0x53fa47=_0x53fa47-0x0;var _0x471ddb=_0x5214[_0x53fa47];return _0x471ddb;};'use strict';var EventEmitter=require(_0x4521('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4521('0x1')];var ChatMessage=require(_0x4521('0x2'))['db'][_0x4521('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4521('0x4'),'afterUpdate':_0x4521('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1ecbbe){return function(_0x39e0f4,_0x494a57,_0x2acea1){_0x39e0f4[_0x4521('0x6')]({'attributes':['id'],'raw':!![]})[_0x4521('0x7')](function(_0x3a4a08){_0x39e0f4[_0x4521('0x8')]('Users',_0x3a4a08[_0x4521('0x9')](function(_0x1760eb){return{'id':_0x1760eb['id']};}));return ChatMessage[_0x4521('0xa')]({'where':{'ChatInteractionId':_0x39e0f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4521('0x7')](function(_0xa4f2c6){_0x39e0f4['setDataValue']('unreadMessages',_0xa4f2c6[_0x4521('0xb')]);ChatInteractionEvents[_0x4521('0xc')](_0x1ecbbe+':'+_0x39e0f4['id'],_0x39e0f4);ChatInteractionEvents[_0x4521('0xc')](_0x1ecbbe,_0x39e0f4);_0x2acea1(null);})[_0x4521('0xd')](_0x2acea1(null));};}for(var e in events){if(events[_0x4521('0xe')](e)){var event=events[e];ChatInteraction[_0x4521('0xf')](e,emitEvent(event));}}module[_0x4521('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x3c14=['catch','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','length','emit'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x3c14,0x1f3));var _0x43c1=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x3c14[_0x5d6456];return _0x4d66c1;};'use strict';var EventEmitter=require(_0x43c1('0x0'));var ChatInteraction=require(_0x43c1('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x43c1('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x43c1('0x2')](0x0);var events={'afterCreate':_0x43c1('0x3'),'afterUpdate':_0x43c1('0x4'),'afterDestroy':_0x43c1('0x5')};function emitEvent(_0x288982){return function(_0x197783,_0x203fa9,_0x503962){_0x197783[_0x43c1('0x6')]({'attributes':['id'],'raw':!![]})[_0x43c1('0x7')](function(_0x58d78a){_0x197783[_0x43c1('0x8')]('Users',_0x58d78a[_0x43c1('0x9')](function(_0x2aad79){return{'id':_0x2aad79['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x197783['id'],'direction':'in','read':![]},'raw':!![]});})[_0x43c1('0x7')](function(_0x2024e0){_0x197783[_0x43c1('0x8')](_0x43c1('0xa'),_0x2024e0[_0x43c1('0xb')]);ChatInteractionEvents[_0x43c1('0xc')](_0x288982+':'+_0x197783['id'],_0x197783);ChatInteractionEvents['emit'](_0x288982,_0x197783);_0x503962(null);})[_0x43c1('0xd')](_0x503962(null));};}for(var e in events){if(events[_0x43c1('0xe')](e)){var event=events[e];ChatInteraction[_0x43c1('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 24d05bf..4041cd9 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 _0xd2c6=['ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xd2c6,0xc7));var _0x6d2c=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xd2c6[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require('lodash');var util=require(_0x6d2c('0x0'));var logger=require('../../config/logger')(_0x6d2c('0x1'));var moment=require(_0x6d2c('0x2'));var BPromise=require(_0x6d2c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d2c('0x4'));var rimraf=require(_0x6d2c('0x5'));var config=require(_0x6d2c('0x6'));var attributes=require(_0x6d2c('0x7'));module['exports']=function(_0x58839b,_0x3413f7){return _0x58839b[_0x6d2c('0x8')](_0x6d2c('0x9'),attributes,{'tableName':_0x6d2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c5864,_0x1f3845,_0x38775e){if(_0x3c5864[_0x6d2c('0xb')]('closed')){_0x3c5864[_0x6d2c('0xc')]=moment()[_0x6d2c('0xd')](_0x6d2c('0xe'));}_0x38775e(null,_0x3c5864);}},'charset':'utf8mb4','collate':_0x6d2c('0xf')});};
\ No newline at end of file
+var _0xf194=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closedAt'];(function(_0x1ca37b,_0x5a279a){var _0x3cdd9e=function(_0xdbb5ae){while(--_0xdbb5ae){_0x1ca37b['push'](_0x1ca37b['shift']());}};_0x3cdd9e(++_0x5a279a);}(_0xf194,0xdc));var _0x4f19=function(_0x1d1e05,_0x27eaed){_0x1d1e05=_0x1d1e05-0x0;var _0x2f49cf=_0xf194[_0x1d1e05];return _0x2f49cf;};'use strict';var _=require(_0x4f19('0x0'));var util=require('util');var logger=require(_0x4f19('0x1'))(_0x4f19('0x2'));var moment=require(_0x4f19('0x3'));var BPromise=require(_0x4f19('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f19('0x5'));var rimraf=require(_0x4f19('0x6'));var config=require(_0x4f19('0x7'));var attributes=require(_0x4f19('0x8'));module['exports']=function(_0x5c8973,_0x4fb25a){return _0x5c8973[_0x4f19('0x9')](_0x4f19('0xa'),attributes,{'tableName':_0x4f19('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36fce1,_0x36420b,_0x2ab265){if(_0x36fce1[_0x4f19('0xc')]('closed')){_0x36fce1[_0x4f19('0xd')]=moment()[_0x4f19('0xe')](_0x4f19('0xf'));}_0x2ab265(null,_0x36fce1);}},'charset':_0x4f19('0x10'),'collate':_0x4f19('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 7712ad8..7ad1de7 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 _0xb9ba=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','debug','stringify','find','addTags','ids','omit','AddTags','lodash','util','moment'];(function(_0x36d67a,_0xfd65a5){var _0x29bdcb=function(_0x172698){while(--_0x172698){_0x36d67a['push'](_0x36d67a['shift']());}};_0x29bdcb(++_0xfd65a5);}(_0xb9ba,0x1c0));var _0xab9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb9ba[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xab9b('0x0'));var util=require(_0xab9b('0x1'));var moment=require(_0xab9b('0x2'));var BPromise=require(_0xab9b('0x3'));var rs=require(_0xab9b('0x4'));var fs=require('fs');var Redis=require(_0xab9b('0x5'));var db=require(_0xab9b('0x6'))['db'];var utils=require(_0xab9b('0x7'));var logger=require(_0xab9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xab9b('0x9'));var client=jayson['client'][_0xab9b('0xa')]({'port':0x232a});config[_0xab9b('0xb')]=_[_0xab9b('0xc')](config[_0xab9b('0xb')],{'host':_0xab9b('0xd'),'port':0x18eb});var socket=require(_0xab9b('0xe'))(new Redis(config[_0xab9b('0xb')]));require(_0xab9b('0xf'))[_0xab9b('0x10')](socket);function respondWithRpcPromise(_0x26808d,_0x230050,_0x36c4be){return new BPromise(function(_0x4797c9,_0x4e3ced){return client['request'](_0x26808d,_0x36c4be)[_0xab9b('0x11')](function(_0x597715){logger[_0xab9b('0x12')](_0xab9b('0x13'),_0x230050,'request\x20sent');logger['debug'](_0xab9b('0x14'),_0x230050,_0xab9b('0x15'),JSON['stringify'](_0x597715));if(_0x597715[_0xab9b('0x16')]){if(_0x597715[_0xab9b('0x16')][_0xab9b('0x17')]===0x1f4){logger[_0xab9b('0x16')](_0xab9b('0x13'),_0x230050,_0x597715[_0xab9b('0x16')][_0xab9b('0x18')]);return _0x4e3ced(_0x597715[_0xab9b('0x16')]['message']);}logger['error'](_0xab9b('0x13'),_0x230050,_0x597715[_0xab9b('0x16')][_0xab9b('0x18')]);return _0x4797c9(_0x597715['error'][_0xab9b('0x18')]);}else{logger[_0xab9b('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x230050,_0xab9b('0x15'));_0x4797c9(_0x597715['result'][_0xab9b('0x18')]);}})[_0xab9b('0x19')](function(_0x3a5ec9){logger[_0xab9b('0x16')](_0xab9b('0x13'),_0x230050,_0x3a5ec9);_0x4e3ced(_0x3a5ec9);});});}exports[_0xab9b('0x1a')]=function(_0x475be9){var _0x4740f8=this;return new Promise(function(_0x25517d,_0x79ec0){return db[_0xab9b('0x1b')]['update'](_0x475be9[_0xab9b('0x1c')],{'raw':_0x475be9['options']?_0x475be9[_0xab9b('0x1d')][_0xab9b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x475be9[_0xab9b('0x1d')]?_0x475be9[_0xab9b('0x1d')][_0xab9b('0x1f')]||null:null,'attributes':_0x475be9['options']?_0x475be9[_0xab9b('0x1d')][_0xab9b('0x20')]||null:null,'limit':_0x475be9[_0xab9b('0x1d')]?_0x475be9[_0xab9b('0x1d')][_0xab9b('0x21')]||null:null})[_0xab9b('0x11')](function(_0x24579c){logger['info'](_0xab9b('0x1a'),_0x475be9);logger[_0xab9b('0x22')](_0xab9b('0x1a'),_0x475be9,JSON[_0xab9b('0x23')](_0x24579c));_0x25517d(_0x24579c);})[_0xab9b('0x19')](function(_0x18145b){logger['error'](_0xab9b('0x1a'),_0x18145b[_0xab9b('0x18')],_0x475be9);_0x79ec0(_0x4740f8[_0xab9b('0x16')](0x1f4,_0x18145b[_0xab9b('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x5b03ed){return new Promise(function(_0x23e5ad,_0x19f0d3){return db[_0xab9b('0x1b')][_0xab9b('0x24')]({'where':_0x5b03ed[_0xab9b('0x1d')]?_0x5b03ed[_0xab9b('0x1d')]['where']||null:null})[_0xab9b('0x11')](function(_0x5e36fe){if(_0x5e36fe){return _0x5e36fe[_0xab9b('0x25')](_0x5b03ed[_0xab9b('0x1c')][_0xab9b('0x26')],_[_0xab9b('0x27')](_0x5b03ed[_0xab9b('0x1c')],[_0xab9b('0x26'),'id'])||{});}})['spread'](function(_0x5e1bf9){logger[_0xab9b('0x12')](_0xab9b('0x28'),_0x5b03ed);logger[_0xab9b('0x22')](_0xab9b('0x28'),_0x5b03ed,JSON['stringify'](_0x5e1bf9));_0x23e5ad(_0x5e1bf9);})['catch'](function(_0x245ee2){logger[_0xab9b('0x16')](_0xab9b('0x28'),_0x245ee2[_0xab9b('0x18')],_0x5b03ed);_0x19f0d3(_this[_0xab9b('0x16')](0x1f4,_0x245ee2[_0xab9b('0x18')]));});});};
\ No newline at end of file
+var _0x95fa=['omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','body','options','where','attributes','limit','UpdateChatInteraction','debug','AddTagsToChatInteraction','find','ids'];(function(_0x50dcd7,_0x34b6e6){var _0x2d2017=function(_0x1592b0){while(--_0x1592b0){_0x50dcd7['push'](_0x50dcd7['shift']());}};_0x2d2017(++_0x34b6e6);}(_0x95fa,0x143));var _0xa95f=function(_0x828291,_0x576a49){_0x828291=_0x828291-0x0;var _0x306620=_0x95fa[_0x828291];return _0x306620;};'use strict';var _=require('lodash');var util=require(_0xa95f('0x0'));var moment=require(_0xa95f('0x1'));var BPromise=require(_0xa95f('0x2'));var rs=require(_0xa95f('0x3'));var fs=require('fs');var Redis=require(_0xa95f('0x4'));var db=require(_0xa95f('0x5'))['db'];var utils=require(_0xa95f('0x6'));var logger=require(_0xa95f('0x7'))('rpc');var config=require(_0xa95f('0x8'));var jayson=require(_0xa95f('0x9'));var client=jayson[_0xa95f('0xa')][_0xa95f('0xb')]({'port':0x232a});config[_0xa95f('0xc')]=_['defaults'](config[_0xa95f('0xc')],{'host':_0xa95f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa95f('0xc')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x37687c,_0x22b727,_0x34c357){return new BPromise(function(_0x2aee13,_0x5033ae){return client[_0xa95f('0xe')](_0x37687c,_0x34c357)[_0xa95f('0xf')](function(_0x1e97d2){logger[_0xa95f('0x10')](_0xa95f('0x11'),_0x22b727,_0xa95f('0x12'));logger['debug'](_0xa95f('0x13'),_0x22b727,_0xa95f('0x12'),JSON[_0xa95f('0x14')](_0x1e97d2));if(_0x1e97d2[_0xa95f('0x15')]){if(_0x1e97d2['error'][_0xa95f('0x16')]===0x1f4){logger['error'](_0xa95f('0x11'),_0x22b727,_0x1e97d2['error'][_0xa95f('0x17')]);return _0x5033ae(_0x1e97d2[_0xa95f('0x15')][_0xa95f('0x17')]);}logger[_0xa95f('0x15')](_0xa95f('0x11'),_0x22b727,_0x1e97d2[_0xa95f('0x15')][_0xa95f('0x17')]);return _0x2aee13(_0x1e97d2[_0xa95f('0x15')]['message']);}else{logger[_0xa95f('0x10')](_0xa95f('0x11'),_0x22b727,_0xa95f('0x12'));_0x2aee13(_0x1e97d2[_0xa95f('0x18')][_0xa95f('0x17')]);}})[_0xa95f('0x19')](function(_0x26c06a){logger[_0xa95f('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x22b727,_0x26c06a);_0x5033ae(_0x26c06a);});});}exports['UpdateChatInteraction']=function(_0x30d197){var _0xbcb447=this;return new Promise(function(_0x19b6ec,_0x3cbb85){return db[_0xa95f('0x1a')]['update'](_0x30d197[_0xa95f('0x1b')],{'raw':_0x30d197['options']?_0x30d197[_0xa95f('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30d197['options']?_0x30d197[_0xa95f('0x1c')][_0xa95f('0x1d')]||null:null,'attributes':_0x30d197[_0xa95f('0x1c')]?_0x30d197[_0xa95f('0x1c')][_0xa95f('0x1e')]||null:null,'limit':_0x30d197[_0xa95f('0x1c')]?_0x30d197[_0xa95f('0x1c')][_0xa95f('0x1f')]||null:null})[_0xa95f('0xf')](function(_0x240e44){logger[_0xa95f('0x10')](_0xa95f('0x20'),_0x30d197);logger[_0xa95f('0x21')](_0xa95f('0x20'),_0x30d197,JSON[_0xa95f('0x14')](_0x240e44));_0x19b6ec(_0x240e44);})[_0xa95f('0x19')](function(_0x241d9f){logger[_0xa95f('0x15')](_0xa95f('0x20'),_0x241d9f['message'],_0x30d197);_0x3cbb85(_0xbcb447[_0xa95f('0x15')](0x1f4,_0x241d9f[_0xa95f('0x17')]));});});};exports[_0xa95f('0x22')]=function(_0x3032aa){return new Promise(function(_0x2a328d,_0x3b0e2c){return db[_0xa95f('0x1a')][_0xa95f('0x23')]({'where':_0x3032aa[_0xa95f('0x1c')]?_0x3032aa['options'][_0xa95f('0x1d')]||null:null})[_0xa95f('0xf')](function(_0x540342){if(_0x540342){return _0x540342['addTags'](_0x3032aa[_0xa95f('0x1b')][_0xa95f('0x24')],_[_0xa95f('0x25')](_0x3032aa[_0xa95f('0x1b')],['ids','id'])||{});}})[_0xa95f('0x26')](function(_0x3a9d55){logger[_0xa95f('0x10')](_0xa95f('0x27'),_0x3032aa);logger[_0xa95f('0x21')](_0xa95f('0x27'),_0x3032aa,JSON[_0xa95f('0x14')](_0x3a9d55));_0x2a328d(_0x3a9d55);})[_0xa95f('0x19')](function(_0x2d2f62){logger[_0xa95f('0x15')](_0xa95f('0x27'),_0x2d2f62[_0xa95f('0x17')],_0x3032aa);_0x3b0e2c(_this[_0xa95f('0x15')](0x1f4,_0x2d2f62[_0xa95f('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0f11fcd..277cba0 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 _0x1c3d=['length','chatInteraction:','./chatInteraction.events','remove','emit','removeListener','register'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1c3d,0x12f));var _0xd1c3=function(_0x292ec9,_0x3f304d){_0x292ec9=_0x292ec9-0x0;var _0xce9423=_0x1c3d[_0x292ec9];return _0xce9423;};'use strict';var ChatInteractionEvents=require(_0xd1c3('0x0'));var events=['save',_0xd1c3('0x1'),'update'];function createListener(_0x1340d9,_0x549868){return function(_0x485529){_0x549868[_0xd1c3('0x2')](_0x1340d9,_0x485529);};}function removeListener(_0x5ec6f3,_0x3ebeec){return function(){ChatInteractionEvents[_0xd1c3('0x3')](_0x5ec6f3,_0x3ebeec);};}exports[_0xd1c3('0x4')]=function(_0x57e488){for(var _0x4998c5=0x0,_0x336da5=events[_0xd1c3('0x5')];_0x4998c5<_0x336da5;_0x4998c5++){var _0x436399=events[_0x4998c5];var _0x3762db=createListener(_0xd1c3('0x6')+_0x436399,_0x57e488);ChatInteractionEvents['on'](_0x436399,_0x3762db);}};
\ No newline at end of file
+var _0x46f4=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x46f4,0x115));var _0x446f=function(_0x1d07ab,_0x22f50f){_0x1d07ab=_0x1d07ab-0x0;var _0x572ce3=_0x46f4[_0x1d07ab];return _0x572ce3;};'use strict';var ChatInteractionEvents=require(_0x446f('0x0'));var events=[_0x446f('0x1'),_0x446f('0x2'),_0x446f('0x3')];function createListener(_0x411989,_0xf8e0e4){return function(_0x5064f0){_0xf8e0e4[_0x446f('0x4')](_0x411989,_0x5064f0);};}function removeListener(_0x47f9d0,_0x4b5d43){return function(){ChatInteractionEvents[_0x446f('0x5')](_0x47f9d0,_0x4b5d43);};}exports['register']=function(_0xb6054){for(var _0x3c822c=0x0,_0x2e1761=events[_0x446f('0x6')];_0x3c822c<_0x2e1761;_0x3c822c++){var _0x14b76f=events[_0x3c822c];var _0xce5535=createListener(_0x446f('0x7')+_0x14b76f,_0xb6054);ChatInteractionEvents['on'](_0x14b76f,_0xce5535);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index cd16454..2e911e7 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 _0xf2e5=['/:id/close','delete','chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','/:id','chat','update','customUpdate','/:id/abandon','abandon'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf2e5,0x109));var _0x5f2e=function(_0x1aece3,_0x4ce790){_0x1aece3=_0x1aece3-0x0;var _0x36254e=_0xf2e5[_0x1aece3];return _0x36254e;};'use strict';var multer=require('multer');var util=require(_0x5f2e('0x0'));var path=require(_0x5f2e('0x1'));var timeout=require(_0x5f2e('0x2'));var express=require(_0x5f2e('0x3'));var router=express[_0x5f2e('0x4')]();var fs_extra=require(_0x5f2e('0x5'));var auth=require(_0x5f2e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f2e('0x7'));var controller=require('./chatInteraction.controller');router[_0x5f2e('0x8')]('/',auth[_0x5f2e('0x9')](),controller['index']);router[_0x5f2e('0x8')](_0x5f2e('0xa'),auth[_0x5f2e('0x9')](),controller[_0x5f2e('0xb')]);router[_0x5f2e('0x8')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x5f2e('0xc')]);router[_0x5f2e('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x5f2e('0xd')]);router[_0x5f2e('0x8')](_0x5f2e('0xe'),auth[_0x5f2e('0x9')](),controller[_0x5f2e('0xf')]);router[_0x5f2e('0x8')](_0x5f2e('0x10'),auth[_0x5f2e('0x11')](),controller[_0x5f2e('0x12')]);router[_0x5f2e('0x8')](_0x5f2e('0x13'),auth[_0x5f2e('0x9')](),controller[_0x5f2e('0x14')]);router[_0x5f2e('0x15')]('/',auth[_0x5f2e('0x9')](),controller[_0x5f2e('0x16')]);router[_0x5f2e('0x15')]('/:id/vidaoo',auth[_0x5f2e('0x9')](),controller[_0x5f2e('0x17')]);var upload=multer({'storage':multer[_0x5f2e('0x18')]({'destination':function(_0x243ac0,_0xe5a034,_0x4ac1cf){_0x4ac1cf(null,path[_0x5f2e('0x19')](config[_0x5f2e('0x1a')],_0x5f2e('0x1b')));},'filename':function(_0xabedff,_0x7006f4,_0x4f9b90){_0x4f9b90(null,util[_0x5f2e('0x1c')]('%s-%s',Date[_0x5f2e('0x1d')](),_0x7006f4[_0x5f2e('0x1e')][_0x5f2e('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5f2e('0x15')](_0x5f2e('0x20'),upload[_0x5f2e('0x21')](_0x5f2e('0x22')),controller['attachmentUpload']);router[_0x5f2e('0x15')](_0x5f2e('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x5f2e('0x23')]);router[_0x5f2e('0x15')](_0x5f2e('0x24'),auth[_0x5f2e('0x9')](),interaction[_0x5f2e('0x25')]('chat',_0x5f2e('0x26')),controller[_0x5f2e('0x27')]);router[_0x5f2e('0x28')](_0x5f2e('0x29'),auth[_0x5f2e('0x9')](),interaction['tracked'](_0x5f2e('0x2a'),'chatinteraction:update'),controller[_0x5f2e('0x2b')]);router[_0x5f2e('0x28')]('/:id/custom_update',controller[_0x5f2e('0x2c')]);router[_0x5f2e('0x28')](_0x5f2e('0x2d'),auth[_0x5f2e('0x11')](),controller[_0x5f2e('0x2e')]);router[_0x5f2e('0x28')](_0x5f2e('0x2f'),controller['close']);router[_0x5f2e('0x30')](_0x5f2e('0x29'),auth['isAuthenticated'](),interaction[_0x5f2e('0x25')](_0x5f2e('0x2a'),_0x5f2e('0x31')),controller[_0x5f2e('0x32')]);router[_0x5f2e('0x30')](_0x5f2e('0x24'),auth[_0x5f2e('0x9')](),controller[_0x5f2e('0x33')]);module['exports']=router;
\ No newline at end of file
+var _0x3f41=['show','/:id/attachment_download','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','%s-%s','originalname','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','close','delete','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','isChatInteractionAuthorized'];(function(_0x38f0fe,_0xebf141){var _0x9ace4a=function(_0x30bb5b){while(--_0x30bb5b){_0x38f0fe['push'](_0x38f0fe['shift']());}};_0x9ace4a(++_0xebf141);}(_0x3f41,0xa3));var _0x13f4=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x3f41[_0x39e283];return _0x7de89f;};'use strict';var multer=require('multer');var util=require(_0x13f4('0x0'));var path=require(_0x13f4('0x1'));var timeout=require(_0x13f4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x13f4('0x3'));var auth=require(_0x13f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x13f4('0x5'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x13f4('0x6')](),controller[_0x13f4('0x7')]);router['get'](_0x13f4('0x8'),auth['isAuthenticated'](),controller[_0x13f4('0x9')]);router[_0x13f4('0xa')](_0x13f4('0xb'),auth[_0x13f4('0xc')](),controller[_0x13f4('0xd')]);router['get'](_0x13f4('0xe'),auth[_0x13f4('0xc')](),controller['attachmentDownload']);router['get']('/:id/messages',auth[_0x13f4('0x6')](),controller[_0x13f4('0xf')]);router[_0x13f4('0xa')](_0x13f4('0x10'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x11')]);router[_0x13f4('0xa')](_0x13f4('0x12'),auth[_0x13f4('0x6')](),controller['download']);router[_0x13f4('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x13f4('0x13')](_0x13f4('0x14'),auth['isAuthenticated'](),controller[_0x13f4('0x15')]);var upload=multer({'storage':multer[_0x13f4('0x16')]({'destination':function(_0x1ca8da,_0x198889,_0x1f17f3){_0x1f17f3(null,path[_0x13f4('0x17')](config['root'],'server/files/attachments/'));},'filename':function(_0x2d2cbe,_0x609c58,_0x36356e){_0x36356e(null,util['format'](_0x13f4('0x18'),Date['now'](),_0x609c58[_0x13f4('0x19')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x13f4('0x13')]('/:id/attachment_upload',upload[_0x13f4('0x1a')](_0x13f4('0x1b')),controller[_0x13f4('0x1c')]);router[_0x13f4('0x13')](_0x13f4('0x1d'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x1e')]);router[_0x13f4('0x13')](_0x13f4('0x1f'),auth[_0x13f4('0x6')](),interaction[_0x13f4('0x20')](_0x13f4('0x21'),'chatinteraction:addtags'),controller[_0x13f4('0x22')]);router[_0x13f4('0x23')](_0x13f4('0xb'),auth[_0x13f4('0x6')](),interaction[_0x13f4('0x20')](_0x13f4('0x21'),_0x13f4('0x24')),controller[_0x13f4('0x25')]);router[_0x13f4('0x23')]('/:id/custom_update',controller[_0x13f4('0x26')]);router[_0x13f4('0x23')](_0x13f4('0x27'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x28')]);router[_0x13f4('0x23')]('/:id/close',controller[_0x13f4('0x29')]);router[_0x13f4('0x2a')](_0x13f4('0xb'),auth['isAuthenticated'](),interaction[_0x13f4('0x20')](_0x13f4('0x21'),'chatinteraction:destroy'),controller['destroy']);router['delete'](_0x13f4('0x1f'),auth[_0x13f4('0x6')](),controller['removeTags']);module[_0x13f4('0x2b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index d5f84e9..7c9d76d 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 _0x335a=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x5c98ea,_0xa782aa){var _0x51e853=function(_0x57d5b0){while(--_0x57d5b0){_0x5c98ea['push'](_0x5c98ea['shift']());}};_0x51e853(++_0xa782aa);}(_0x335a,0x17f));var _0xa335=function(_0x16001a,_0x29e9af){_0x16001a=_0x16001a-0x0;var _0x1ab682=_0x335a[_0x16001a];return _0x1ab682;};'use strict';var Sequelize=require(_0xa335('0x0'));module[_0xa335('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa335('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa335('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa335('0x4')]}};
\ No newline at end of file
+var _0x07ca=['exports','TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x3695fe,_0x47bd31){var _0x42fbdd=function(_0x23ec1a){while(--_0x23ec1a){_0x3695fe['push'](_0x3695fe['shift']());}};_0x42fbdd(++_0x47bd31);}(_0x07ca,0x18f));var _0xa07c=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x07ca[_0x5180c3];return _0x55c975;};'use strict';var Sequelize=require(_0xa07c('0x0'));module[_0xa07c('0x1')]={'body':{'type':Sequelize[_0xa07c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa07c('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa07c('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 8b14708..a777912 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 _0xfead=['push','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatInternalMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','type','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','showWebBar','-online','VoiceQueue','VoiceQueues','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId'];(function(_0x5f2a01,_0x7f2015){var _0x14e9f9=function(_0x28dd19){while(--_0x28dd19){_0x5f2a01['push'](_0x5f2a01['shift']());}};_0x14e9f9(++_0x7f2015);}(_0xfead,0x14f));var _0xdfea=function(_0x47d4d3,_0x34a248){_0x47d4d3=_0x47d4d3-0x0;var _0x554bdc=_0xfead[_0x47d4d3];return _0x554bdc;};'use strict';var emlformat=require(_0xdfea('0x0'));var rimraf=require(_0xdfea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfea('0x2'));var rp=require(_0xdfea('0x3'));var moment=require('moment');var BPromise=require(_0xdfea('0x4'));var Mustache=require(_0xdfea('0x5'));var util=require(_0xdfea('0x6'));var path=require(_0xdfea('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdfea('0x8'));var fs=require('fs');var fs_extra=require(_0xdfea('0x9'));var _=require(_0xdfea('0xa'));var squel=require(_0xdfea('0xb'));var crypto=require(_0xdfea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdfea('0xd'));var toCsv=require(_0xdfea('0xe'));var querystring=require(_0xdfea('0xf'));var Papa=require('papaparse');var Redis=require(_0xdfea('0x10'));var authService=require(_0xdfea('0x11'));var qs=require(_0xdfea('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfea('0x13'))(_0xdfea('0x14'));var utils=require(_0xdfea('0x15'));var config=require(_0xdfea('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdfea('0x17')]=_['defaults'](config[_0xdfea('0x17')],{'host':_0xdfea('0x18'),'port':0x18eb});var socket=require(_0xdfea('0x19'))(new Redis(config[_0xdfea('0x17')]));require(_0xdfea('0x1a'))[_0xdfea('0x1b')](socket);function respondWithStatusCode(_0x2d8f6c,_0x2166b2){_0x2166b2=_0x2166b2||0xcc;return function(_0x27c5c1){if(_0x27c5c1){return _0x2d8f6c[_0xdfea('0x1c')](_0x2166b2);}return _0x2d8f6c['status'](_0x2166b2)[_0xdfea('0x1d')]();};}function respondWithResult(_0x583d96,_0x3a2a6a){_0x3a2a6a=_0x3a2a6a||0xc8;return function(_0x32fa7d){if(_0x32fa7d){return _0x583d96[_0xdfea('0x1e')](_0x3a2a6a)[_0xdfea('0x1f')](_0x32fa7d);}};}function respondWithFilteredResult(_0x5a38e4,_0x1e3448){return function(_0x180f60){if(_0x180f60){var _0x171351=typeof _0x1e3448[_0xdfea('0x20')]==='undefined'&&typeof _0x1e3448['limit']===_0xdfea('0x21');var _0x2f55d7=_0x180f60['count'];var _0x3f53de=_0x171351?0x0:_0x1e3448[_0xdfea('0x20')];var _0x9b4138=_0x171351?_0x180f60['count']:_0x1e3448[_0xdfea('0x20')]+_0x1e3448[_0xdfea('0x22')];var _0x32135a;if(_0x9b4138>=_0x2f55d7){_0x9b4138=_0x2f55d7;_0x32135a=0xc8;}else{_0x32135a=0xce;}_0x5a38e4[_0xdfea('0x1e')](_0x32135a);return _0x5a38e4[_0xdfea('0x23')](_0xdfea('0x24'),_0x3f53de+'-'+_0x9b4138+'/'+_0x2f55d7)[_0xdfea('0x1f')](_0x180f60);}return null;};}function patchUpdates(_0x58dbc0){return function(_0x2409ea){try{jsonpatch[_0xdfea('0x25')](_0x2409ea,_0x58dbc0,!![]);}catch(_0x274db6){return BPromise[_0xdfea('0x26')](_0x274db6);}return _0x2409ea[_0xdfea('0x27')]();};}function saveUpdates(_0x386f32,_0x1e8f9e){return function(_0x57b65d){if(_0x57b65d){return _0x57b65d['update'](_0x386f32)[_0xdfea('0x28')](function(_0x188837){return _0x188837;});}return null;};}function removeEntity(_0x2b0aca,_0x5e51e8){return function(_0x3b61f5){if(_0x3b61f5){return _0x3b61f5[_0xdfea('0x29')]()[_0xdfea('0x28')](function(){_0x2b0aca[_0xdfea('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18128b,_0x24fcb8){return function(_0x22fb23){if(!_0x22fb23){_0x18128b[_0xdfea('0x1c')](0x194);}return _0x22fb23;};}function handleError(_0x2ab94d,_0x55058b){_0x55058b=_0x55058b||0x1f4;return function(_0x12cb23){logger['error'](_0x12cb23['stack']);if(_0x12cb23[_0xdfea('0x2a')]){delete _0x12cb23[_0xdfea('0x2a')];}_0x2ab94d[_0xdfea('0x1e')](_0x55058b)[_0xdfea('0x2b')](_0x12cb23);};}exports[_0xdfea('0x2c')]=function(_0x5af228,_0x1d826d){var _0x342422={},_0x22c590={},_0x5bb613={'count':0x0,'rows':[]};var _0x2996d8=_[_0xdfea('0x2d')](db[_0xdfea('0x2e')][_0xdfea('0x2f')],function(_0x21052c){return{'name':_0x21052c['fieldName'],'type':_0x21052c['type']['key']};});_0x22c590[_0xdfea('0x30')]=_[_0xdfea('0x2d')](_0x2996d8,_0xdfea('0x2a'));_0x22c590['query']=_[_0xdfea('0x31')](_0x5af228[_0xdfea('0x32')]);_0x22c590['filters']=_[_0xdfea('0x33')](_0x22c590['model'],_0x22c590[_0xdfea('0x32')]);_0x342422[_0xdfea('0x34')]=_[_0xdfea('0x33')](_0x22c590[_0xdfea('0x30')],qs[_0xdfea('0x35')](_0x5af228['query'][_0xdfea('0x35')]));_0x342422['attributes']=_0x342422[_0xdfea('0x34')][_0xdfea('0x36')]?_0x342422['attributes']:_0x22c590[_0xdfea('0x30')];if(!_0x5af228['query'][_0xdfea('0x37')](_0xdfea('0x38'))){_0x342422[_0xdfea('0x22')]=qs[_0xdfea('0x22')](_0x5af228[_0xdfea('0x32')][_0xdfea('0x22')]);_0x342422[_0xdfea('0x20')]=qs[_0xdfea('0x20')](_0x5af228[_0xdfea('0x32')][_0xdfea('0x20')]);}_0x342422[_0xdfea('0x39')]=qs['sort'](_0x5af228['query'][_0xdfea('0x3a')]);_0x342422['where']=qs[_0xdfea('0x3b')](_['pick'](_0x5af228[_0xdfea('0x32')],_0x22c590[_0xdfea('0x3b')]),_0x2996d8);if(_0x5af228[_0xdfea('0x32')][_0xdfea('0x3c')]){_0x342422[_0xdfea('0x3d')]=_['merge'](_0x342422[_0xdfea('0x3d')],{'$or':_[_0xdfea('0x2d')](_0x2996d8,function(_0x2d7a80){if(_0x2d7a80[_0xdfea('0x3e')]!==_0xdfea('0x3f')){var _0x4c0810={};_0x4c0810[_0x2d7a80[_0xdfea('0x2a')]]={'$like':'%'+_0x5af228[_0xdfea('0x32')][_0xdfea('0x3c')]+'%'};return _0x4c0810;}})});}_0x342422=_[_0xdfea('0x40')]({},_0x342422,_0x5af228[_0xdfea('0x41')]);var _0x54ad70={'where':_0x342422[_0xdfea('0x3d')]};return db[_0xdfea('0x2e')][_0xdfea('0x42')](_0x54ad70)['then'](function(_0x48cab7){_0x5bb613[_0xdfea('0x42')]=_0x48cab7;if(_0x5af228[_0xdfea('0x32')][_0xdfea('0x43')]){_0x342422['include']=[{'all':!![]}];}return db[_0xdfea('0x2e')][_0xdfea('0x44')](_0x342422);})['then'](function(_0x57b5b8){_0x5bb613[_0xdfea('0x45')]=_0x57b5b8;return _0x5bb613;})['then'](respondWithFilteredResult(_0x1d826d,_0x342422))[_0xdfea('0x46')](handleError(_0x1d826d,null));};exports[_0xdfea('0x47')]=function(_0x5de738,_0x2eda2b){var _0x4fd35b={'raw':!![],'where':{'id':_0x5de738[_0xdfea('0x48')]['id']}},_0x1ce4d0={};_0x1ce4d0[_0xdfea('0x30')]=_['keys'](db[_0xdfea('0x2e')]['rawAttributes']);_0x1ce4d0[_0xdfea('0x32')]=_[_0xdfea('0x31')](_0x5de738[_0xdfea('0x32')]);_0x1ce4d0[_0xdfea('0x3b')]=_[_0xdfea('0x33')](_0x1ce4d0[_0xdfea('0x30')],_0x1ce4d0[_0xdfea('0x32')]);_0x4fd35b[_0xdfea('0x34')]=_[_0xdfea('0x33')](_0x1ce4d0[_0xdfea('0x30')],qs['fields'](_0x5de738[_0xdfea('0x32')][_0xdfea('0x35')]));_0x4fd35b['attributes']=_0x4fd35b[_0xdfea('0x34')][_0xdfea('0x36')]?_0x4fd35b['attributes']:_0x1ce4d0[_0xdfea('0x30')];if(_0x5de738[_0xdfea('0x32')]['includeAll']){_0x4fd35b[_0xdfea('0x49')]=[{'all':!![]}];}_0x4fd35b=_[_0xdfea('0x40')]({},_0x4fd35b,_0x5de738[_0xdfea('0x41')]);return db[_0xdfea('0x2e')]['find'](_0x4fd35b)['then'](handleEntityNotFound(_0x2eda2b,null))[_0xdfea('0x28')](respondWithResult(_0x2eda2b,null))[_0xdfea('0x46')](handleError(_0x2eda2b,null));};exports[_0xdfea('0x4a')]=function(_0x446acc,_0x12adb3){return db[_0xdfea('0x2e')][_0xdfea('0x4a')](_0x446acc[_0xdfea('0x4b')],{})['then'](respondWithResult(_0x12adb3,0xc9))[_0xdfea('0x46')](handleError(_0x12adb3,null));};exports[_0xdfea('0x4c')]=function(_0x1e08fc,_0x5b1189){if(_0x1e08fc[_0xdfea('0x4b')]['id']){delete _0x1e08fc[_0xdfea('0x4b')]['id'];}return db['ChatInternalMessage'][_0xdfea('0x4d')]({'where':{'id':_0x1e08fc['params']['id']}})[_0xdfea('0x28')](handleEntityNotFound(_0x5b1189,null))[_0xdfea('0x28')](saveUpdates(_0x1e08fc[_0xdfea('0x4b')],null))[_0xdfea('0x28')](respondWithResult(_0x5b1189,null))['catch'](handleError(_0x5b1189,null));};exports[_0xdfea('0x29')]=function(_0x12218e,_0x1a8dd1){return db[_0xdfea('0x2e')]['find']({'where':{'id':_0x12218e['params']['id']}})[_0xdfea('0x28')](handleEntityNotFound(_0x1a8dd1,null))[_0xdfea('0x28')](removeEntity(_0x1a8dd1,null))[_0xdfea('0x46')](handleError(_0x1a8dd1,null));};exports['describe']=function(_0x2e0fc7,_0x3009b0){return db[_0xdfea('0x2e')][_0xdfea('0x4e')]()['then'](respondWithResult(_0x3009b0,null))['catch'](handleError(_0x3009b0,null));};function wrapUser(_0x58ccf2){return function(_0x39860b){var _0x2b9c9c=_0x58ccf2['get']({'plain':!![]});_0x2b9c9c[_0xdfea('0x4f')]=[];if(_0x39860b){_0x2b9c9c[_0xdfea('0x50')]=_0x39860b[_0xdfea('0x51')];_0x2b9c9c[_0xdfea('0x52')]=_0x39860b;}else{_0x2b9c9c['lastMessageAt']=moment(0x0)[_0xdfea('0x53')](_0xdfea('0x54'));_0x2b9c9c[_0xdfea('0x52')]={};}return _0x2b9c9c;};}exports[_0xdfea('0x55')]=function(_0x4331de,_0x16bc84,_0x293a2f){var _0x1cca25=[];return db['User'][_0xdfea('0x44')]({'where':{'role':[_0xdfea('0x56'),_0xdfea('0x57'),_0xdfea('0x58')]},'attributes':['id',_0xdfea('0x59'),_0xdfea('0x2a'),_0xdfea('0x5a'),_0xdfea('0x5b'),_0xdfea('0x5c'),'online','lastLoginAt','allowmessenger',_0xdfea('0x5d')],'order':qs['sort'](_0xdfea('0x5e')),'include':[{'model':db[_0xdfea('0x5f')],'as':_0xdfea('0x60'),'attributes':['id',_0xdfea('0x2a'),_0xdfea('0x3e')],'through':{'attributes':[]}}]})[_0xdfea('0x28')](function(_0x5d8e2f){if(_0x5d8e2f){var _0x3327b9=_0x4331de[_0xdfea('0x58')][_0xdfea('0x61')]({'plain':!![]});if(!_0x3327b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3327b9[_0xdfea('0x5a')]==='user'){return db[_0xdfea('0x62')][_0xdfea('0x4d')]({'where':{'name':_0xdfea('0x63'),'userProfileId':_0x3327b9[_0xdfea('0x64')]},'raw':!![]})[_0xdfea('0x28')](function(_0x252162){if(_0x252162){if(_0x252162[_0xdfea('0x65')]===0x0){return db[_0xdfea('0x66')][_0xdfea('0x44')]({'where':{'sectionId':_0x252162['id']},'raw':!![]})[_0xdfea('0x28')](function(_0x2e88d6){var _0x5c206e=[];if(_[_0xdfea('0x67')](_0x2e88d6)){_0x5c206e=_[_0xdfea('0x3c')](_0x5d8e2f,function(_0x584231){if(_0x584231[_0xdfea('0x5a')]!==_0xdfea('0x56')){return _0x584231;}});return _0x5c206e;}else{for(var _0x344583=0x0;_0x344583<_0x5d8e2f[_0xdfea('0x36')];_0x344583++){var _0x3d6f37=_0x5d8e2f[_0x344583];if(_0x3d6f37[_0xdfea('0x5a')]===_0xdfea('0x56')){var _0xdb1cf0=_[_0xdfea('0x4d')](_0x2e88d6,function(_0x529fa5){return _0x529fa5[_0xdfea('0x68')]===_0x3d6f37['id'];});if(_0xdb1cf0)_0x5c206e[_0xdfea('0x69')](_0x3d6f37);}else{_0x5c206e['push'](_0x3d6f37);}}return _0x5c206e;}});}else{return _0x5d8e2f;}}else{var _0xd7c352=_['filter'](_0x5d8e2f,function(_0x1a9c2d){if(_0x1a9c2d[_0xdfea('0x5a')]!=='agent'){return _0x1a9c2d;}});return _0xd7c352;}});}else{return _0x5d8e2f;}}})[_0xdfea('0x28')](function(_0x86c1be){var _0x56b9ae=[];if(_0x86c1be){_0x1cca25=_0x86c1be;for(var _0xc18b4=0x0;_0xc18b4<_0x86c1be[_0xdfea('0x36')];_0xc18b4+=0x1){_0x1cca25[_0xc18b4]['messages']=[];_0x56b9ae[_0xdfea('0x69')](db[_0xdfea('0x2e')]['find']({'where':{'FromId':[_0x4331de[_0xdfea('0x58')]['id'],_0x86c1be[_0xc18b4]['id']],'ToId':[_0x4331de[_0xdfea('0x58')]['id'],_0x86c1be[_0xc18b4]['id']],'ChatGroupId':null},'attributes':['id',_0xdfea('0x51'),'FromId',_0xdfea('0x6a'),_0xdfea('0x6b'),_0xdfea('0x4b')],'order':qs[_0xdfea('0x3a')](_0xdfea('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdfea('0x28')](wrapUser(_0x86c1be[_0xc18b4])));}return BPromise[_0xdfea('0x6d')](_0x56b9ae);}return[];})[_0xdfea('0x28')](function(_0x18c66e){return{'rows':_0x18c66e,'count':_0x18c66e[_0xdfea('0x36')]};})['then'](respondWithResult(_0x16bc84,null))[_0xdfea('0x46')](handleError(_0x16bc84,null));};
\ No newline at end of file
+var _0x1e9f=['moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','ChatInternalMessage','includeAll','findAll','catch','keys','include','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','user','role','userpic','internal','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','length','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xc1c4,_0x1e9763){var _0x3b83a4=function(_0x546e81){while(--_0x546e81){_0xc1c4['push'](_0xc1c4['shift']());}};_0x3b83a4(++_0x1e9763);}(_0x1e9f,0x140));var _0xf1e9=function(_0x245b3b,_0x161dff){_0x245b3b=_0x245b3b-0x0;var _0x249d89=_0x1e9f[_0x245b3b];return _0x249d89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1e9('0x0'));var zipdir=require(_0xf1e9('0x1'));var jsonpatch=require(_0xf1e9('0x2'));var rp=require(_0xf1e9('0x3'));var moment=require(_0xf1e9('0x4'));var BPromise=require(_0xf1e9('0x5'));var Mustache=require('mustache');var util=require(_0xf1e9('0x6'));var path=require(_0xf1e9('0x7'));var sox=require(_0xf1e9('0x8'));var csv=require(_0xf1e9('0x9'));var ejs=require(_0xf1e9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1e9('0xb'));var squel=require(_0xf1e9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf1e9('0xd'));var toCsv=require(_0xf1e9('0x9'));var querystring=require('querystring');var Papa=require(_0xf1e9('0xe'));var Redis=require(_0xf1e9('0xf'));var authService=require(_0xf1e9('0x10'));var qs=require(_0xf1e9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1e9('0x12'));var logger=require(_0xf1e9('0x13'))(_0xf1e9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf1e9('0x15'));var db=require(_0xf1e9('0x16'))['db'];config[_0xf1e9('0x17')]=_[_0xf1e9('0x18')](config[_0xf1e9('0x17')],{'host':_0xf1e9('0x19'),'port':0x18eb});var socket=require(_0xf1e9('0x1a'))(new Redis(config[_0xf1e9('0x17')]));require(_0xf1e9('0x1b'))[_0xf1e9('0x1c')](socket);function respondWithStatusCode(_0x568af4,_0x244c63){_0x244c63=_0x244c63||0xcc;return function(_0x35c442){if(_0x35c442){return _0x568af4[_0xf1e9('0x1d')](_0x244c63);}return _0x568af4['status'](_0x244c63)[_0xf1e9('0x1e')]();};}function respondWithResult(_0x40a3b0,_0x117c7f){_0x117c7f=_0x117c7f||0xc8;return function(_0x1cc778){if(_0x1cc778){return _0x40a3b0[_0xf1e9('0x1f')](_0x117c7f)[_0xf1e9('0x20')](_0x1cc778);}};}function respondWithFilteredResult(_0x53e3db,_0x4bf6b6){return function(_0x54312f){if(_0x54312f){var _0x5348e3=typeof _0x4bf6b6[_0xf1e9('0x21')]===_0xf1e9('0x22')&&typeof _0x4bf6b6[_0xf1e9('0x23')]===_0xf1e9('0x22');var _0x1f5239=_0x54312f[_0xf1e9('0x24')];var _0x5ecf23=_0x5348e3?0x0:_0x4bf6b6[_0xf1e9('0x21')];var _0x43b7d0=_0x5348e3?_0x54312f[_0xf1e9('0x24')]:_0x4bf6b6[_0xf1e9('0x21')]+_0x4bf6b6[_0xf1e9('0x23')];var _0x59790e;if(_0x43b7d0>=_0x1f5239){_0x43b7d0=_0x1f5239;_0x59790e=0xc8;}else{_0x59790e=0xce;}_0x53e3db[_0xf1e9('0x1f')](_0x59790e);return _0x53e3db['set']('Content-Range',_0x5ecf23+'-'+_0x43b7d0+'/'+_0x1f5239)[_0xf1e9('0x20')](_0x54312f);}return null;};}function patchUpdates(_0x5169d7){return function(_0x8819dd){try{jsonpatch[_0xf1e9('0x25')](_0x8819dd,_0x5169d7,!![]);}catch(_0x46640b){return BPromise[_0xf1e9('0x26')](_0x46640b);}return _0x8819dd[_0xf1e9('0x27')]();};}function saveUpdates(_0x4b77c2,_0x180b8d){return function(_0x321874){if(_0x321874){return _0x321874[_0xf1e9('0x28')](_0x4b77c2)['then'](function(_0x37744b){return _0x37744b;});}return null;};}function removeEntity(_0x4919c8,_0x414be1){return function(_0x50c83e){if(_0x50c83e){return _0x50c83e[_0xf1e9('0x29')]()[_0xf1e9('0x2a')](function(){_0x4919c8[_0xf1e9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a00e7,_0x423b1e){return function(_0x3879d9){if(!_0x3879d9){_0x4a00e7['sendStatus'](0x194);}return _0x3879d9;};}function handleError(_0x240b50,_0x3f516e){_0x3f516e=_0x3f516e||0x1f4;return function(_0x48211b){logger[_0xf1e9('0x2b')](_0x48211b['stack']);if(_0x48211b[_0xf1e9('0x2c')]){delete _0x48211b[_0xf1e9('0x2c')];}_0x240b50['status'](_0x3f516e)[_0xf1e9('0x2d')](_0x48211b);};}exports[_0xf1e9('0x2e')]=function(_0x2d1b93,_0x443ad4){var _0x47ec95={},_0x3ca6e6={},_0x51a4c7={'count':0x0,'rows':[]};var _0x4676c5=_['map'](db['ChatInternalMessage'][_0xf1e9('0x2f')],function(_0x2dfde0){return{'name':_0x2dfde0[_0xf1e9('0x30')],'type':_0x2dfde0[_0xf1e9('0x31')][_0xf1e9('0x32')]};});_0x3ca6e6[_0xf1e9('0x33')]=_[_0xf1e9('0x34')](_0x4676c5,_0xf1e9('0x2c'));_0x3ca6e6[_0xf1e9('0x35')]=_['keys'](_0x2d1b93[_0xf1e9('0x35')]);_0x3ca6e6[_0xf1e9('0x36')]=_[_0xf1e9('0x37')](_0x3ca6e6['model'],_0x3ca6e6[_0xf1e9('0x35')]);_0x47ec95['attributes']=_[_0xf1e9('0x37')](_0x3ca6e6[_0xf1e9('0x33')],qs['fields'](_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x38')]));_0x47ec95['attributes']=_0x47ec95[_0xf1e9('0x39')]['length']?_0x47ec95[_0xf1e9('0x39')]:_0x3ca6e6[_0xf1e9('0x33')];if(!_0x2d1b93['query'][_0xf1e9('0x3a')](_0xf1e9('0x3b'))){_0x47ec95[_0xf1e9('0x23')]=qs[_0xf1e9('0x23')](_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x23')]);_0x47ec95[_0xf1e9('0x21')]=qs[_0xf1e9('0x21')](_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x21')]);}_0x47ec95[_0xf1e9('0x3c')]=qs[_0xf1e9('0x3d')](_0x2d1b93[_0xf1e9('0x35')]['sort']);_0x47ec95['where']=qs[_0xf1e9('0x36')](_['pick'](_0x2d1b93[_0xf1e9('0x35')],_0x3ca6e6[_0xf1e9('0x36')]),_0x4676c5);if(_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x3e')]){_0x47ec95['where']=_['merge'](_0x47ec95[_0xf1e9('0x3f')],{'$or':_[_0xf1e9('0x34')](_0x4676c5,function(_0x2b1a63){if(_0x2b1a63[_0xf1e9('0x31')]!==_0xf1e9('0x40')){var _0x5eb5df={};_0x5eb5df[_0x2b1a63['name']]={'$like':'%'+_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x3e')]+'%'};return _0x5eb5df;}})});}_0x47ec95=_[_0xf1e9('0x41')]({},_0x47ec95,_0x2d1b93[_0xf1e9('0x42')]);var _0x68a24c={'where':_0x47ec95[_0xf1e9('0x3f')]};return db[_0xf1e9('0x43')][_0xf1e9('0x24')](_0x68a24c)[_0xf1e9('0x2a')](function(_0x37784c){_0x51a4c7[_0xf1e9('0x24')]=_0x37784c;if(_0x2d1b93['query'][_0xf1e9('0x44')]){_0x47ec95['include']=[{'all':!![]}];}return db[_0xf1e9('0x43')][_0xf1e9('0x45')](_0x47ec95);})[_0xf1e9('0x2a')](function(_0x1ca10d){_0x51a4c7['rows']=_0x1ca10d;return _0x51a4c7;})[_0xf1e9('0x2a')](respondWithFilteredResult(_0x443ad4,_0x47ec95))[_0xf1e9('0x46')](handleError(_0x443ad4,null));};exports['show']=function(_0x34929e,_0x3c21d5){var _0x380a02={'raw':!![],'where':{'id':_0x34929e['params']['id']}},_0x3f8dee={};_0x3f8dee['model']=_[_0xf1e9('0x47')](db[_0xf1e9('0x43')][_0xf1e9('0x2f')]);_0x3f8dee[_0xf1e9('0x35')]=_[_0xf1e9('0x47')](_0x34929e[_0xf1e9('0x35')]);_0x3f8dee[_0xf1e9('0x36')]=_[_0xf1e9('0x37')](_0x3f8dee[_0xf1e9('0x33')],_0x3f8dee[_0xf1e9('0x35')]);_0x380a02[_0xf1e9('0x39')]=_['intersection'](_0x3f8dee[_0xf1e9('0x33')],qs['fields'](_0x34929e['query'][_0xf1e9('0x38')]));_0x380a02[_0xf1e9('0x39')]=_0x380a02[_0xf1e9('0x39')]['length']?_0x380a02[_0xf1e9('0x39')]:_0x3f8dee[_0xf1e9('0x33')];if(_0x34929e['query'][_0xf1e9('0x44')]){_0x380a02[_0xf1e9('0x48')]=[{'all':!![]}];}_0x380a02=_[_0xf1e9('0x41')]({},_0x380a02,_0x34929e[_0xf1e9('0x42')]);return db[_0xf1e9('0x43')][_0xf1e9('0x49')](_0x380a02)[_0xf1e9('0x2a')](handleEntityNotFound(_0x3c21d5,null))['then'](respondWithResult(_0x3c21d5,null))['catch'](handleError(_0x3c21d5,null));};exports[_0xf1e9('0x4a')]=function(_0x4c3d43,_0x5e5a7b){return db[_0xf1e9('0x43')][_0xf1e9('0x4a')](_0x4c3d43[_0xf1e9('0x4b')],{})[_0xf1e9('0x2a')](respondWithResult(_0x5e5a7b,0xc9))[_0xf1e9('0x46')](handleError(_0x5e5a7b,null));};exports['update']=function(_0x332af4,_0x1f6522){if(_0x332af4[_0xf1e9('0x4b')]['id']){delete _0x332af4[_0xf1e9('0x4b')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x332af4[_0xf1e9('0x4c')]['id']}})[_0xf1e9('0x2a')](handleEntityNotFound(_0x1f6522,null))[_0xf1e9('0x2a')](saveUpdates(_0x332af4[_0xf1e9('0x4b')],null))[_0xf1e9('0x2a')](respondWithResult(_0x1f6522,null))[_0xf1e9('0x46')](handleError(_0x1f6522,null));};exports[_0xf1e9('0x29')]=function(_0x55bee9,_0x5990c7){return db[_0xf1e9('0x43')]['find']({'where':{'id':_0x55bee9[_0xf1e9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5990c7,null))[_0xf1e9('0x2a')](removeEntity(_0x5990c7,null))[_0xf1e9('0x46')](handleError(_0x5990c7,null));};exports[_0xf1e9('0x4d')]=function(_0x5f2f75,_0x3fd160){return db[_0xf1e9('0x43')][_0xf1e9('0x4d')]()[_0xf1e9('0x2a')](respondWithResult(_0x3fd160,null))[_0xf1e9('0x46')](handleError(_0x3fd160,null));};function wrapUser(_0x2ddc8b){return function(_0x17f759){var _0x2aebb0=_0x2ddc8b[_0xf1e9('0x4e')]({'plain':!![]});_0x2aebb0[_0xf1e9('0x4f')]=[];if(_0x17f759){_0x2aebb0[_0xf1e9('0x50')]=_0x17f759[_0xf1e9('0x51')];_0x2aebb0['lastMessage']=_0x17f759;}else{_0x2aebb0[_0xf1e9('0x50')]=moment(0x0)[_0xf1e9('0x52')](_0xf1e9('0x53'));_0x2aebb0[_0xf1e9('0x54')]={};}return _0x2aebb0;};}exports[_0xf1e9('0x55')]=function(_0x48ee7a,_0x44e890,_0x12cb39){var _0x5bc962=[];return db[_0xf1e9('0x56')]['findAll']({'where':{'role':[_0xf1e9('0x57'),'admin',_0xf1e9('0x58')]},'attributes':['id','fullname',_0xf1e9('0x2c'),_0xf1e9('0x59'),_0xf1e9('0x5a'),_0xf1e9('0x5b'),'online',_0xf1e9('0x5c'),'allowmessenger',_0xf1e9('0x5d')],'order':qs[_0xf1e9('0x3d')]('-online'),'include':[{'model':db[_0xf1e9('0x5e')],'as':_0xf1e9('0x5f'),'attributes':['id','name',_0xf1e9('0x31')],'through':{'attributes':[]}}]})[_0xf1e9('0x2a')](function(_0x13f02c){if(_0x13f02c){var _0x1bebb5=_0x48ee7a[_0xf1e9('0x58')][_0xf1e9('0x4e')]({'plain':!![]});if(!_0x1bebb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bebb5[_0xf1e9('0x59')]===_0xf1e9('0x58')){return db[_0xf1e9('0x60')][_0xf1e9('0x49')]({'where':{'name':_0xf1e9('0x61'),'userProfileId':_0x1bebb5[_0xf1e9('0x62')]},'raw':!![]})[_0xf1e9('0x2a')](function(_0x1c5ea4){if(_0x1c5ea4){if(_0x1c5ea4[_0xf1e9('0x63')]===0x0){return db[_0xf1e9('0x64')][_0xf1e9('0x45')]({'where':{'sectionId':_0x1c5ea4['id']},'raw':!![]})[_0xf1e9('0x2a')](function(_0x5f2a9b){var _0x5c097a=[];if(_['isEmpty'](_0x5f2a9b)){_0x5c097a=_[_0xf1e9('0x3e')](_0x13f02c,function(_0x2d3873){if(_0x2d3873[_0xf1e9('0x59')]!==_0xf1e9('0x57')){return _0x2d3873;}});return _0x5c097a;}else{for(var _0x3216b8=0x0;_0x3216b8<_0x13f02c[_0xf1e9('0x65')];_0x3216b8++){var _0x2ad208=_0x13f02c[_0x3216b8];if(_0x2ad208[_0xf1e9('0x59')]===_0xf1e9('0x57')){var _0x1075b5=_[_0xf1e9('0x49')](_0x5f2a9b,function(_0x43af9d){return _0x43af9d['resourceId']===_0x2ad208['id'];});if(_0x1075b5)_0x5c097a[_0xf1e9('0x66')](_0x2ad208);}else{_0x5c097a[_0xf1e9('0x66')](_0x2ad208);}}return _0x5c097a;}});}else{return _0x13f02c;}}else{var _0x2792cc=_[_0xf1e9('0x3e')](_0x13f02c,function(_0x5b8e1c){if(_0x5b8e1c[_0xf1e9('0x59')]!==_0xf1e9('0x57')){return _0x5b8e1c;}});return _0x2792cc;}});}else{return _0x13f02c;}}})[_0xf1e9('0x2a')](function(_0x25327c){var _0xb37281=[];if(_0x25327c){_0x5bc962=_0x25327c;for(var _0x101b28=0x0;_0x101b28<_0x25327c[_0xf1e9('0x65')];_0x101b28+=0x1){_0x5bc962[_0x101b28]['messages']=[];_0xb37281['push'](db['ChatInternalMessage'][_0xf1e9('0x49')]({'where':{'FromId':[_0x48ee7a[_0xf1e9('0x58')]['id'],_0x25327c[_0x101b28]['id']],'ToId':[_0x48ee7a[_0xf1e9('0x58')]['id'],_0x25327c[_0x101b28]['id']],'ChatGroupId':null},'attributes':['id',_0xf1e9('0x51'),_0xf1e9('0x67'),_0xf1e9('0x68'),_0xf1e9('0x69'),_0xf1e9('0x4b')],'order':qs['sort'](_0xf1e9('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf1e9('0x2a')](wrapUser(_0x25327c[_0x101b28])));}return BPromise[_0xf1e9('0x6b')](_0xb37281);}return[];})[_0xf1e9('0x2a')](function(_0x14f375){return{'rows':_0x14f375,'count':_0x14f375[_0xf1e9('0x65')]};})['then'](respondWithResult(_0x44e890,null))[_0xf1e9('0x46')](handleError(_0x44e890,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 91fce77..9f7a248 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 _0xc021=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc021,0x15d));var _0x1c02=function(_0x386958,_0x55d171){_0x386958=_0x386958-0x0;var _0x33119a=_0xc021[_0x386958];return _0x33119a;};'use strict';var EventEmitter=require(_0x1c02('0x0'));var ChatInternalMessage=require(_0x1c02('0x1'))['db'][_0x1c02('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1c02('0x3')](0x0);var events={'afterCreate':_0x1c02('0x4'),'afterUpdate':_0x1c02('0x5'),'afterDestroy':_0x1c02('0x6')};function emitEvent(_0x2399ff){return function(_0x2784e5,_0x14ed3d,_0x271897){ChatInternalMessageEvents[_0x1c02('0x7')](_0x2399ff+':'+_0x2784e5['id'],_0x2784e5);ChatInternalMessageEvents[_0x1c02('0x7')](_0x2399ff,_0x2784e5);_0x271897(null);};}for(var e in events){if(events[_0x1c02('0x8')](e)){var event=events[e];ChatInternalMessage[_0x1c02('0x9')](e,emitEvent(event));}}module[_0x1c02('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xdde1=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x53d510,_0x539932){var _0x2a7907=function(_0x4aa1f6){while(--_0x4aa1f6){_0x53d510['push'](_0x53d510['shift']());}};_0x2a7907(++_0x539932);}(_0xdde1,0xf5));var _0x1dde=function(_0x35f154,_0x50c6e2){_0x35f154=_0x35f154-0x0;var _0x3302b6=_0xdde1[_0x35f154];return _0x3302b6;};'use strict';var EventEmitter=require(_0x1dde('0x0'));var ChatInternalMessage=require(_0x1dde('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1dde('0x2')](0x0);var events={'afterCreate':_0x1dde('0x3'),'afterUpdate':_0x1dde('0x4'),'afterDestroy':_0x1dde('0x5')};function emitEvent(_0x4690a7){return function(_0x15078c,_0x4af0a1,_0x180389){ChatInternalMessageEvents[_0x1dde('0x6')](_0x4690a7+':'+_0x15078c['id'],_0x15078c);ChatInternalMessageEvents[_0x1dde('0x6')](_0x4690a7,_0x15078c);_0x180389(null);};}for(var e in events){if(events[_0x1dde('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](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 87b9d1c..4e858f1 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 _0xc545=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x4132bf,_0x53eae1){var _0x1f55a8=function(_0x129cd6){while(--_0x129cd6){_0x4132bf['push'](_0x4132bf['shift']());}};_0x1f55a8(++_0x53eae1);}(_0xc545,0x153));var _0x5c54=function(_0x1cb693,_0x20aab3){_0x1cb693=_0x1cb693-0x0;var _0x1726dc=_0xc545[_0x1cb693];return _0x1726dc;};'use strict';var _=require(_0x5c54('0x0'));var util=require(_0x5c54('0x1'));var logger=require(_0x5c54('0x2'))(_0x5c54('0x3'));var moment=require(_0x5c54('0x4'));var BPromise=require(_0x5c54('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5c54('0x6'));var config=require(_0x5c54('0x7'));var attributes=require(_0x5c54('0x8'));module[_0x5c54('0x9')]=function(_0x5d5185,_0x86654d){return _0x5d5185[_0x5c54('0xa')](_0x5c54('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5c54('0xc')});};
\ No newline at end of file
+var _0x31db=['path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','api','request-promise'];(function(_0x289c3e,_0x3614b5){var _0x25a4b3=function(_0x1ea94b){while(--_0x1ea94b){_0x289c3e['push'](_0x289c3e['shift']());}};_0x25a4b3(++_0x3614b5);}(_0x31db,0x96));var _0xb31d=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x31db[_0x3c4dad];return _0x1a4f49;};'use strict';var _=require(_0xb31d('0x0'));var util=require(_0xb31d('0x1'));var logger=require('../../config/logger')(_0xb31d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb31d('0x3'));var fs=require('fs');var path=require(_0xb31d('0x4'));var rimraf=require(_0xb31d('0x5'));var config=require('../../config/environment');var attributes=require(_0xb31d('0x6'));module[_0xb31d('0x7')]=function(_0x2fc845,_0x4a0f4d){return _0x2fc845['define'](_0xb31d('0x8'),attributes,{'tableName':_0xb31d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb31d('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 10ab74e..c85fb7e 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 _0x1d4d=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d4d,0x160));var _0xd1d4=function(_0x28f19b,_0x55b03d){_0x28f19b=_0x28f19b-0x0;var _0x3ab54b=_0x1d4d[_0x28f19b];return _0x3ab54b;};'use strict';var _=require(_0xd1d4('0x0'));var util=require(_0xd1d4('0x1'));var moment=require(_0xd1d4('0x2'));var BPromise=require(_0xd1d4('0x3'));var rs=require(_0xd1d4('0x4'));var fs=require('fs');var Redis=require(_0xd1d4('0x5'));var db=require(_0xd1d4('0x6'))['db'];var utils=require(_0xd1d4('0x7'));var logger=require(_0xd1d4('0x8'))(_0xd1d4('0x9'));var config=require('../../config/environment');var jayson=require(_0xd1d4('0xa'));var client=jayson[_0xd1d4('0xb')][_0xd1d4('0xc')]({'port':0x232a});config[_0xd1d4('0xd')]=_[_0xd1d4('0xe')](config[_0xd1d4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd1d4('0xf'))(new Redis(config['redis']));require(_0xd1d4('0x10'))['register'](socket);function respondWithRpcPromise(_0xbebf18,_0x8167a3,_0x203d7f){return new BPromise(function(_0x52ecbc,_0x5bba6a){return client[_0xd1d4('0x11')](_0xbebf18,_0x203d7f)[_0xd1d4('0x12')](function(_0x32405d){logger[_0xd1d4('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x8167a3,_0xd1d4('0x14'));logger['debug'](_0xd1d4('0x15'),_0x8167a3,'request\x20sent',JSON[_0xd1d4('0x16')](_0x32405d));if(_0x32405d[_0xd1d4('0x17')]){if(_0x32405d[_0xd1d4('0x17')][_0xd1d4('0x18')]===0x1f4){logger[_0xd1d4('0x17')](_0xd1d4('0x19'),_0x8167a3,_0x32405d[_0xd1d4('0x17')][_0xd1d4('0x1a')]);return _0x5bba6a(_0x32405d[_0xd1d4('0x17')][_0xd1d4('0x1a')]);}logger[_0xd1d4('0x17')](_0xd1d4('0x19'),_0x8167a3,_0x32405d[_0xd1d4('0x17')]['message']);return _0x52ecbc(_0x32405d[_0xd1d4('0x17')][_0xd1d4('0x1a')]);}else{logger[_0xd1d4('0x13')](_0xd1d4('0x19'),_0x8167a3,'request\x20sent');_0x52ecbc(_0x32405d['result'][_0xd1d4('0x1a')]);}})['catch'](function(_0x5883aa){logger['error'](_0xd1d4('0x19'),_0x8167a3,_0x5883aa);_0x5bba6a(_0x5883aa);});});}
\ No newline at end of file
+var _0x9f62=['code','ChatInternalMessage,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f62,0x154));var _0x29f6=function(_0x4ec303,_0x5d4eb5){_0x4ec303=_0x4ec303-0x0;var _0x5516fe=_0x9f62[_0x4ec303];return _0x5516fe;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 3baba37..e51b755 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 _0x30a0=['update','emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x15fd57,_0xd96a98){var _0x1c9251=function(_0x4ea2ba){while(--_0x4ea2ba){_0x15fd57['push'](_0x15fd57['shift']());}};_0x1c9251(++_0xd96a98);}(_0x30a0,0x16a));var _0x030a=function(_0xa6de8a,_0x2a9578){_0xa6de8a=_0xa6de8a-0x0;var _0x40654c=_0x30a0[_0xa6de8a];return _0x40654c;};'use strict';var ChatInternalMessageEvents=require(_0x030a('0x0'));var events=[_0x030a('0x1'),'remove',_0x030a('0x2')];function createListener(_0x5de685,_0x5c79db){return function(_0x5e4dd1){_0x5c79db[_0x030a('0x3')](_0x5de685,_0x5e4dd1);};}function removeListener(_0x198172,_0xa3a894){return function(){ChatInternalMessageEvents[_0x030a('0x4')](_0x198172,_0xa3a894);};}exports['register']=function(_0x17bdb5){for(var _0xb521b3=0x0,_0xdfcb24=events[_0x030a('0x5')];_0xb521b3<_0xdfcb24;_0xb521b3++){var _0x14918f=events[_0xb521b3];var _0x4dd88c=createListener(_0x030a('0x6')+_0x14918f,_0x17bdb5);ChatInternalMessageEvents['on'](_0x14918f,_0x4dd88c);}};
\ No newline at end of file
+var _0x07e0=['remove','emit','removeListener','register','length','chatInternalMessage:','save'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x07e0,0x117));var _0x007e=function(_0x1eba37,_0x4e5cfa){_0x1eba37=_0x1eba37-0x0;var _0xdea13=_0x07e0[_0x1eba37];return _0xdea13;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x007e('0x0'),_0x007e('0x1'),'update'];function createListener(_0x54b4b5,_0x26335b){return function(_0x5b721e){_0x26335b[_0x007e('0x2')](_0x54b4b5,_0x5b721e);};}function removeListener(_0xcfe18c,_0x2eff14){return function(){ChatInternalMessageEvents[_0x007e('0x3')](_0xcfe18c,_0x2eff14);};}exports[_0x007e('0x4')]=function(_0x5dd24a){for(var _0x5bc5a7=0x0,_0x2e61a8=events[_0x007e('0x5')];_0x5bc5a7<_0x2e61a8;_0x5bc5a7++){var _0x62255d=events[_0x5bc5a7];var _0x3c0a3d=createListener(_0x007e('0x6')+_0x62255d,_0x5dd24a);ChatInternalMessageEvents['on'](_0x62255d,_0x3c0a3d);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index f6d3338..d076747 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 _0xeb50=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/users','getUsers','create','put','/:id','destroy','exports','util','path','connect-timeout','express'];(function(_0x29507e,_0x5cbf20){var _0x1ec3eb=function(_0x51d250){while(--_0x51d250){_0x29507e['push'](_0x29507e['shift']());}};_0x1ec3eb(++_0x5cbf20);}(_0xeb50,0x152));var _0x0eb5=function(_0x527a53,_0x3265d6){_0x527a53=_0x527a53-0x0;var _0x2332f5=_0xeb50[_0x527a53];return _0x2332f5;};'use strict';var multer=require('multer');var util=require(_0x0eb5('0x0'));var path=require(_0x0eb5('0x1'));var timeout=require(_0x0eb5('0x2'));var express=require(_0x0eb5('0x3'));var router=express[_0x0eb5('0x4')]();var fs_extra=require(_0x0eb5('0x5'));var auth=require(_0x0eb5('0x6'));var interaction=require(_0x0eb5('0x7'));var config=require(_0x0eb5('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x0eb5('0x9')]('/',auth[_0x0eb5('0xa')](),controller['index']);router['get']('/describe',auth[_0x0eb5('0xa')](),controller[_0x0eb5('0xb')]);router[_0x0eb5('0x9')](_0x0eb5('0xc'),auth[_0x0eb5('0xa')](),controller[_0x0eb5('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x0eb5('0xe')]);router[_0x0eb5('0xf')]('/:id',controller['update']);router['delete'](_0x0eb5('0x10'),auth[_0x0eb5('0xa')](),controller[_0x0eb5('0x11')]);module[_0x0eb5('0x12')]=router;
\ No newline at end of file
+var _0xb49d=['describe','/users','getUsers','create','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated'];(function(_0xf81b04,_0x348467){var _0x3efc97=function(_0x9e0f00){while(--_0x9e0f00){_0xf81b04['push'](_0xf81b04['shift']());}};_0x3efc97(++_0x348467);}(_0xb49d,0x182));var _0xdb49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb49d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdb49('0x0'));var util=require(_0xdb49('0x1'));var path=require(_0xdb49('0x2'));var timeout=require('connect-timeout');var express=require(_0xdb49('0x3'));var router=express[_0xdb49('0x4')]();var fs_extra=require(_0xdb49('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdb49('0x6'));var config=require(_0xdb49('0x7'));var controller=require(_0xdb49('0x8'));router[_0xdb49('0x9')]('/',auth['isAuthenticated'](),controller[_0xdb49('0xa')]);router[_0xdb49('0x9')](_0xdb49('0xb'),auth[_0xdb49('0xc')](),controller[_0xdb49('0xd')]);router[_0xdb49('0x9')](_0xdb49('0xe'),auth[_0xdb49('0xc')](),controller[_0xdb49('0xf')]);router[_0xdb49('0x9')]('/:id',auth[_0xdb49('0xc')](),controller['show']);router['post']('/',auth[_0xdb49('0xc')](),controller[_0xdb49('0x10')]);router['put'](_0xdb49('0x11'),controller[_0xdb49('0x12')]);router[_0xdb49('0x13')](_0xdb49('0x11'),auth[_0xdb49('0xc')](),controller['destroy']);module[_0xdb49('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 71244f6..9704829 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 _0x56bd=['out','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0xf32c6d,_0x372704){var _0x156c11=function(_0x34ef76){while(--_0x34ef76){_0xf32c6d['push'](_0xf32c6d['shift']());}};_0x156c11(++_0x372704);}(_0x56bd,0xe9));var _0xd56b=function(_0x5cd565,_0x3145de){_0x5cd565=_0x5cd565-0x0;var _0x4da3ef=_0x56bd[_0x5cd565];return _0x4da3ef;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'body':{'type':Sequelize[_0xd56b('0x1')](_0xd56b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd56b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd56b('0x4')]('in',_0xd56b('0x5')),'defaultValue':_0xd56b('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xd56b('0x6')]},'providerResponse':{'type':Sequelize[_0xd56b('0x1')]}};
\ No newline at end of file
+var _0x61d0=['STRING','sequelize','TEXT','medium','BOOLEAN','out'];(function(_0x34cafc,_0x419a2a){var _0x2a3051=function(_0xaf9b5c){while(--_0xaf9b5c){_0x34cafc['push'](_0x34cafc['shift']());}};_0x2a3051(++_0x419a2a);}(_0x61d0,0x187));var _0x061d=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x61d0[_0x285800];return _0x4b809e;};'use strict';var Sequelize=require(_0x061d('0x0'));module['exports']={'body':{'type':Sequelize[_0x061d('0x1')](_0x061d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x061d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x061d('0x4')),'defaultValue':_0x061d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x061d('0x5')]},'providerResponse':{'type':Sequelize[_0x061d('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 7e8922c..7b379e2 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 _0x6f49=['code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','ChatInteraction','isNil','read1stAt','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','interface','format','channel','event','parse','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','fullname','email','internal','SIP/%s','motionChannel','EventManager','formData','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa3588a,_0x4483e5){var _0x2bd1fc=function(_0x5f316b){while(--_0x5f316b){_0xa3588a['push'](_0xa3588a['shift']());}};_0x2bd1fc(++_0x4483e5);}(_0x6f49,0x168));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x96f4('0x0'));var rimraf=require(_0x96f4('0x1'));var zipdir=require(_0x96f4('0x2'));var jsonpatch=require(_0x96f4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x96f4('0x4'));var Mustache=require(_0x96f4('0x5'));var util=require(_0x96f4('0x6'));var path=require(_0x96f4('0x7'));var sox=require(_0x96f4('0x8'));var csv=require('to-csv');var ejs=require(_0x96f4('0x9'));var fs=require('fs');var fs_extra=require(_0x96f4('0xa'));var _=require(_0x96f4('0xb'));var squel=require(_0x96f4('0xc'));var crypto=require(_0x96f4('0xd'));var jsforce=require(_0x96f4('0xe'));var deskjs=require(_0x96f4('0xf'));var toCsv=require(_0x96f4('0x10'));var querystring=require(_0x96f4('0x11'));var Papa=require(_0x96f4('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x96f4('0x13'));var hardwareService=require(_0x96f4('0x14'));var logger=require(_0x96f4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x96f4('0x16'));var licenseUtil=require(_0x96f4('0x17'));var db=require('../../mysqldb')['db'];config[_0x96f4('0x18')]=_['defaults'](config[_0x96f4('0x18')],{'host':_0x96f4('0x19'),'port':0x18eb});var socket=require(_0x96f4('0x1a'))(new Redis(config[_0x96f4('0x18')]));require(_0x96f4('0x1b'))[_0x96f4('0x1c')](socket);var jayson=require(_0x96f4('0x1d'));var client=jayson['client'][_0x96f4('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x96f4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x240091,_0x4afbf0,_0x34fc0c,_0x536c0b){return new BPromise(function(_0x479d5b,_0xd1415b){var _0x4af9ab=_0x536c0b||client;return _0x4af9ab[_0x96f4('0x1f')](_0x240091,_0x34fc0c)[_0x96f4('0x20')](function(_0x1eedf1){logger['info'](_0x96f4('0x21'),_0x4afbf0,_0x96f4('0x22'));logger[_0x96f4('0x23')](_0x96f4('0x24'),_0x4afbf0,_0x96f4('0x22'),JSON[_0x96f4('0x25')](_0x1eedf1));if(_0x1eedf1[_0x96f4('0x26')]){if(_0x1eedf1['error'][_0x96f4('0x27')]===0x1f4){logger['error'](_0x96f4('0x21'),_0x4afbf0,_0x1eedf1['error'][_0x96f4('0x28')]);return _0xd1415b(_0x1eedf1[_0x96f4('0x26')]['message']);}logger[_0x96f4('0x26')](_0x96f4('0x21'),_0x4afbf0,_0x1eedf1['error']['message']);return _0x479d5b(_0x1eedf1['error'][_0x96f4('0x28')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x4afbf0,_0x96f4('0x22'));_0x479d5b(_0x1eedf1[_0x96f4('0x29')][_0x96f4('0x28')]);}})[_0x96f4('0x2a')](function(_0x42bd84){logger['error'](_0x96f4('0x21'),_0x4afbf0,_0x42bd84);_0xd1415b(_0x42bd84);});});}function respondWithStatusCode(_0x1a25c0,_0x4cf763){_0x4cf763=_0x4cf763||0xcc;return function(_0x3b9677){if(_0x3b9677){return _0x1a25c0[_0x96f4('0x2b')](_0x4cf763);}return _0x1a25c0[_0x96f4('0x2c')](_0x4cf763)['end']();};}function respondWithResult(_0x2eafdf,_0x252b60){_0x252b60=_0x252b60||0xc8;return function(_0x1f1274){if(_0x1f1274){return _0x2eafdf[_0x96f4('0x2c')](_0x252b60)[_0x96f4('0x2d')](_0x1f1274);}};}function respondWithFilteredResult(_0xc64dd1,_0x4df310){return function(_0x4bd31e){if(_0x4bd31e){var _0x5481f4=typeof _0x4df310[_0x96f4('0x2e')]===_0x96f4('0x2f')&&typeof _0x4df310[_0x96f4('0x30')]===_0x96f4('0x2f');var _0x390e1c=_0x4bd31e[_0x96f4('0x31')];var _0xc9da3b=_0x5481f4?0x0:_0x4df310['offset'];var _0x48869e=_0x5481f4?_0x4bd31e[_0x96f4('0x31')]:_0x4df310[_0x96f4('0x2e')]+_0x4df310[_0x96f4('0x30')];var _0x511719;if(_0x48869e>=_0x390e1c){_0x48869e=_0x390e1c;_0x511719=0xc8;}else{_0x511719=0xce;}_0xc64dd1[_0x96f4('0x2c')](_0x511719);return _0xc64dd1[_0x96f4('0x32')](_0x96f4('0x33'),_0xc9da3b+'-'+_0x48869e+'/'+_0x390e1c)[_0x96f4('0x2d')](_0x4bd31e);}return null;};}function patchUpdates(_0xb2823d){return function(_0x341896){try{jsonpatch['apply'](_0x341896,_0xb2823d,!![]);}catch(_0x2d34ae){return BPromise[_0x96f4('0x34')](_0x2d34ae);}return _0x341896[_0x96f4('0x35')]();};}function saveUpdates(_0x29b701,_0x3e27f5){return function(_0xfc086){if(_0xfc086){return _0xfc086[_0x96f4('0x36')](_0x29b701)['then'](function(_0x2550f1){return _0x2550f1;});}return null;};}function removeEntity(_0x8d85a4,_0x46b627){return function(_0x4ff6b3){if(_0x4ff6b3){return _0x4ff6b3[_0x96f4('0x37')]()['then'](function(){_0x8d85a4['status'](0xcc)[_0x96f4('0x38')]();});}};}function handleEntityNotFound(_0x3f0915,_0x4d0a06){return function(_0x2b9c7f){if(!_0x2b9c7f){_0x3f0915[_0x96f4('0x2b')](0x194);}return _0x2b9c7f;};}function handleError(_0xc5ea27,_0x2f2b38){_0x2f2b38=_0x2f2b38||0x1f4;return function(_0x4f62e0){logger[_0x96f4('0x26')](_0x4f62e0[_0x96f4('0x39')]);if(_0x4f62e0['name']){delete _0x4f62e0[_0x96f4('0x3a')];}_0xc5ea27[_0x96f4('0x2c')](_0x2f2b38)[_0x96f4('0x3b')](_0x4f62e0);};}exports['index']=function(_0x3246a1,_0x398ec7){var _0xe20012={},_0x27b095={},_0x1328b2={'count':0x0,'rows':[]};var _0x514a7b=_[_0x96f4('0x3c')](db[_0x96f4('0x3d')][_0x96f4('0x3e')],function(_0x353bc2){return{'name':_0x353bc2[_0x96f4('0x3f')],'type':_0x353bc2['type'][_0x96f4('0x40')]};});_0x27b095[_0x96f4('0x41')]=_[_0x96f4('0x3c')](_0x514a7b,'name');_0x27b095['query']=_[_0x96f4('0x42')](_0x3246a1[_0x96f4('0x43')]);_0x27b095['filters']=_[_0x96f4('0x44')](_0x27b095[_0x96f4('0x41')],_0x27b095[_0x96f4('0x43')]);_0xe20012[_0x96f4('0x45')]=_[_0x96f4('0x44')](_0x27b095[_0x96f4('0x41')],qs['fields'](_0x3246a1[_0x96f4('0x43')][_0x96f4('0x46')]));_0xe20012['attributes']=_0xe20012['attributes'][_0x96f4('0x47')]?_0xe20012[_0x96f4('0x45')]:_0x27b095['model'];if(!_0x3246a1[_0x96f4('0x43')]['hasOwnProperty'](_0x96f4('0x48'))){_0xe20012['limit']=qs[_0x96f4('0x30')](_0x3246a1[_0x96f4('0x43')][_0x96f4('0x30')]);_0xe20012['offset']=qs[_0x96f4('0x2e')](_0x3246a1['query']['offset']);}_0xe20012[_0x96f4('0x49')]=qs[_0x96f4('0x4a')](_0x3246a1[_0x96f4('0x43')]['sort']);_0xe20012['where']=qs['filters'](_[_0x96f4('0x4b')](_0x3246a1[_0x96f4('0x43')],_0x27b095[_0x96f4('0x4c')]),_0x514a7b);if(_0x3246a1[_0x96f4('0x43')][_0x96f4('0x4d')]){_0xe20012['where']=_[_0x96f4('0x4e')](_0xe20012['where'],{'$or':_[_0x96f4('0x3c')](_0x514a7b,function(_0x212649){if(_0x212649[_0x96f4('0x4f')]!==_0x96f4('0x50')){var _0x3e74db={};_0x3e74db[_0x212649[_0x96f4('0x3a')]]={'$like':'%'+_0x3246a1[_0x96f4('0x43')][_0x96f4('0x4d')]+'%'};return _0x3e74db;}})});}_0xe20012=_[_0x96f4('0x4e')]({},_0xe20012,_0x3246a1[_0x96f4('0x51')]);var _0xec1d45={'where':_0xe20012[_0x96f4('0x52')]};return db[_0x96f4('0x3d')][_0x96f4('0x31')](_0xec1d45)[_0x96f4('0x20')](function(_0x554d1a){_0x1328b2[_0x96f4('0x31')]=_0x554d1a;if(_0x3246a1['query'][_0x96f4('0x53')]){_0xe20012[_0x96f4('0x54')]=[{'all':!![]}];}return db[_0x96f4('0x3d')][_0x96f4('0x55')](_0xe20012);})['then'](function(_0x38246c){_0x1328b2[_0x96f4('0x56')]=_0x38246c;return _0x1328b2;})[_0x96f4('0x20')](respondWithFilteredResult(_0x398ec7,_0xe20012))[_0x96f4('0x2a')](handleError(_0x398ec7,null));};exports[_0x96f4('0x57')]=function(_0x2524ae,_0x33dbe1){var _0x20544b={'raw':!![],'where':{'id':_0x2524ae[_0x96f4('0x58')]['id']}},_0x5e47b0={};_0x5e47b0['model']=_[_0x96f4('0x42')](db[_0x96f4('0x3d')]['rawAttributes']);_0x5e47b0[_0x96f4('0x43')]=_[_0x96f4('0x42')](_0x2524ae[_0x96f4('0x43')]);_0x5e47b0[_0x96f4('0x4c')]=_['intersection'](_0x5e47b0['model'],_0x5e47b0[_0x96f4('0x43')]);_0x20544b[_0x96f4('0x45')]=_[_0x96f4('0x44')](_0x5e47b0['model'],qs[_0x96f4('0x46')](_0x2524ae['query'][_0x96f4('0x46')]));_0x20544b[_0x96f4('0x45')]=_0x20544b[_0x96f4('0x45')][_0x96f4('0x47')]?_0x20544b['attributes']:_0x5e47b0['model'];if(_0x2524ae[_0x96f4('0x43')]['includeAll']){_0x20544b[_0x96f4('0x54')]=[{'all':!![]}];}_0x20544b=_[_0x96f4('0x4e')]({},_0x20544b,_0x2524ae[_0x96f4('0x51')]);return db[_0x96f4('0x3d')][_0x96f4('0x59')](_0x20544b)[_0x96f4('0x20')](handleEntityNotFound(_0x33dbe1,null))['then'](respondWithResult(_0x33dbe1,null))[_0x96f4('0x2a')](handleError(_0x33dbe1,null));};exports[_0x96f4('0x5a')]=function(_0xe75229,_0x571bd0){return db[_0x96f4('0x3d')]['create'](_0xe75229[_0x96f4('0x5b')],{})['then'](respondWithResult(_0x571bd0,0xc9))[_0x96f4('0x2a')](handleError(_0x571bd0,null));};exports['update']=function(_0x2c4d40,_0x20aafe){if(_0x2c4d40['body']['id']){delete _0x2c4d40[_0x96f4('0x5b')]['id'];}return db[_0x96f4('0x3d')][_0x96f4('0x59')]({'where':{'id':_0x2c4d40[_0x96f4('0x58')]['id']}})['then'](handleEntityNotFound(_0x20aafe,null))[_0x96f4('0x20')](saveUpdates(_0x2c4d40['body'],null))[_0x96f4('0x20')](respondWithResult(_0x20aafe,null))[_0x96f4('0x2a')](handleError(_0x20aafe,null));};exports[_0x96f4('0x37')]=function(_0x177340,_0x80c3a6){return db[_0x96f4('0x3d')][_0x96f4('0x59')]({'where':{'id':_0x177340[_0x96f4('0x58')]['id']}})[_0x96f4('0x20')](handleEntityNotFound(_0x80c3a6,null))[_0x96f4('0x20')](removeEntity(_0x80c3a6,null))['catch'](handleError(_0x80c3a6,null));};exports[_0x96f4('0x5c')]=function(_0x1e3eb8,_0x518453){return db[_0x96f4('0x3d')][_0x96f4('0x5c')]()[_0x96f4('0x20')](respondWithResult(_0x518453,null))['catch'](handleError(_0x518453,null));};var interaction_log=require(_0x96f4('0x15'))(_0x96f4('0x5d'));exports[_0x96f4('0x5e')]=function(_0x226cfc,_0xfb232b,_0x5951c0){var _0x5227cf={'agent':{},'channel':'chat'};if(_0x226cfc[_0x96f4('0x5b')]['id']){delete _0x226cfc[_0x96f4('0x5b')]['id'];}_0x226cfc[_0x96f4('0x5b')]['read']=!![];_0x226cfc[_0x96f4('0x5b')][_0x96f4('0x5f')]=moment()['format'](_0x96f4('0x60'));_0x226cfc[_0x96f4('0x5b')]['UserId']=_0x226cfc[_0x96f4('0x5b')]['UserId']||_0x226cfc[_0x96f4('0x61')]['id'];_0x5227cf[_0x96f4('0x62')]['id']=_0x226cfc['body'][_0x96f4('0x63')];return db[_0x96f4('0x3d')][_0x96f4('0x59')]({'where':{'id':_0x226cfc[_0x96f4('0x58')]['id'],'UserId':null}})[_0x96f4('0x20')](handleEntityNotFound(_0xfb232b,null))[_0x96f4('0x20')](saveUpdates(_0x226cfc[_0x96f4('0x5b')],null))[_0x96f4('0x20')](function(_0x5221f6){if(_0x5221f6){_0x5227cf[_0x96f4('0x28')]=_0x5221f6[_0x96f4('0x64')]({'plain':!![]});return db[_0x96f4('0x65')][_0x96f4('0x59')]({'where':{'id':_0x5221f6['ChatInteractionId']}});}return null;})[_0x96f4('0x20')](handleEntityNotFound(_0xfb232b,null))[_0x96f4('0x20')](function(_0x3bedc4){if(_0x3bedc4){return _0x3bedc4[_0x96f4('0x36')]({'UserId':_0x226cfc[_0x96f4('0x5b')][_0x96f4('0x63')],'read1stAt':_[_0x96f4('0x66')](_0x3bedc4[_0x96f4('0x67')])?moment()['format'](_0x96f4('0x60')):undefined});}return null;})[_0x96f4('0x20')](function(_0x57565e){if(_0x57565e){_0x5227cf[_0x96f4('0x68')]=_0x57565e[_0x96f4('0x64')]({'plain':!![]});interaction_log[_0x96f4('0x69')](_0x96f4('0x6a'),_0x226cfc['user']['id'],_0x226cfc['user'][_0x96f4('0x3a')],_0x226cfc[_0x96f4('0x61')]['role'],_0x5227cf[_0x96f4('0x68')]['id'],_0x226cfc[_0x96f4('0x5b')]?JSON[_0x96f4('0x25')](_0x226cfc[_0x96f4('0x5b')]):_0x96f4('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5227cf);}return null;})[_0x96f4('0x20')](function(_0x4a3381){var _0x3d071e=_0x96f4('0x6c')+_0x4a3381[_0x96f4('0x28')][_0x96f4('0x6d')];return db[_0x96f4('0x6e')]['query'](_0x3d071e,{'type':db['Sequelize'][_0x96f4('0x6f')][_0x96f4('0x70')],'raw':!![]})[_0x96f4('0x20')](function(_0x237977){return _0x237977;});})[_0x96f4('0x20')](function(_0x1f455e){if(_0x1f455e){_0x5227cf[_0x96f4('0x28')][_0x96f4('0x71')]=_0x1f455e[0x0];if(!_0x226cfc['body'][_0x96f4('0x63')])return;return db[_0x96f4('0x72')][_0x96f4('0x59')]({'where':{'id':_0x226cfc[_0x96f4('0x5b')][_0x96f4('0x63')],'role':_0x96f4('0x62')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0x96f4('0x20')](function(_0x43f7ad){if(!_0x43f7ad)return null;_0x5227cf['message'][_0x96f4('0x62')]=_0x43f7ad;return _0x5227cf;})[_0x96f4('0x20')](function(_0xaff078){if(_0xaff078){if(_0x226cfc['body']['manual']){_0x5227cf['message'][_0x96f4('0x73')]=util[_0x96f4('0x74')]('SIP/%s',_0x226cfc[_0x96f4('0x61')][_0x96f4('0x3a')]);_0x5227cf[_0x96f4('0x28')][_0x96f4('0x75')]=_0x5227cf[_0x96f4('0x75')];_0x5227cf[_0x96f4('0x28')]['motionChannel']=_0x5227cf[_0x96f4('0x75')];_0x5227cf[_0x96f4('0x28')][_0x96f4('0x76')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0x96f4('0x4e')](_0x5227cf['message'],JSON[_0x96f4('0x77')](_0x5227cf[_0x96f4('0x68')]['formData']))},client9002)[_0x96f4('0x20')](function(){return _0x5227cf;});}return _0x5227cf;}return null;})[_0x96f4('0x20')](respondWithResult(_0xfb232b,null))[_0x96f4('0x2a')](handleError(_0xfb232b,null));};var interaction_log=require(_0x96f4('0x15'))(_0x96f4('0x5d'));exports[_0x96f4('0x34')]=function(_0x18751c,_0x21f8d8,_0x37795d){var _0x2e6174={'agent':{},'channel':_0x96f4('0x78')};if(_0x18751c['body']['id']){delete _0x18751c[_0x96f4('0x5b')]['id'];}_0x18751c[_0x96f4('0x5b')][_0x96f4('0x63')]=_0x18751c[_0x96f4('0x5b')][_0x96f4('0x63')]||_0x18751c[_0x96f4('0x61')]['id'];_0x2e6174[_0x96f4('0x62')]['id']=_0x18751c[_0x96f4('0x5b')]['UserId'];return db[_0x96f4('0x3d')]['find']({'where':{'id':_0x18751c['params']['id'],'UserId':null}})[_0x96f4('0x20')](handleEntityNotFound(_0x21f8d8,null))['then'](function(_0x50a5d3){if(_0x50a5d3){_0x2e6174['message']=_0x50a5d3[_0x96f4('0x64')]({'plain':!![]});return db[_0x96f4('0x65')][_0x96f4('0x59')]({'where':{'id':_0x50a5d3['ChatInteractionId']}});}return null;})[_0x96f4('0x20')](handleEntityNotFound(_0x21f8d8,null))[_0x96f4('0x20')](function(_0x283e73){if(_0x283e73){_0x2e6174[_0x96f4('0x68')]=_0x283e73['get']({'plain':!![]});interaction_log[_0x96f4('0x69')](_0x96f4('0x79'),_0x18751c[_0x96f4('0x61')]['id'],_0x18751c[_0x96f4('0x61')][_0x96f4('0x3a')],_0x18751c[_0x96f4('0x61')][_0x96f4('0x7a')],_0x2e6174[_0x96f4('0x68')]['id'],_0x18751c[_0x96f4('0x5b')]?JSON['stringify'](_0x18751c[_0x96f4('0x5b')]):'null');return respondWithRpcPromise(_0x96f4('0x7b'),_0x96f4('0x7c'),_0x2e6174);}return null;})[_0x96f4('0x20')](function(_0x24349d){var _0x4f6359=_0x96f4('0x6c')+_0x24349d[_0x96f4('0x28')]['ContactId'];return db[_0x96f4('0x6e')]['query'](_0x4f6359,{'type':db[_0x96f4('0x7d')][_0x96f4('0x6f')][_0x96f4('0x70')],'raw':!![]})[_0x96f4('0x20')](function(_0x5a43eb){return _0x5a43eb;});})['then'](function(_0x508734){if(_0x508734){_0x2e6174[_0x96f4('0x28')]['contact']=_0x508734[0x0];if(!_0x18751c[_0x96f4('0x5b')][_0x96f4('0x63')])return;return db[_0x96f4('0x72')][_0x96f4('0x59')]({'where':{'id':_0x18751c['body']['UserId'],'role':'agent'},'attributes':['id',_0x96f4('0x3a'),_0x96f4('0x7e'),_0x96f4('0x7f'),_0x96f4('0x80')],'raw':!![]});}return null;})[_0x96f4('0x20')](function(_0x1b84d4){if(!_0x1b84d4)return null;_0x2e6174[_0x96f4('0x28')][_0x96f4('0x62')]=_0x1b84d4;return _0x2e6174;})[_0x96f4('0x20')](function(_0x1f2405){if(_0x1f2405){_0x1f2405['message']['interface']=util['format'](_0x96f4('0x81'),_0x18751c['user']['name']);_0x1f2405[_0x96f4('0x28')][_0x96f4('0x75')]=_0x2e6174['channel'];_0x1f2405['message'][_0x96f4('0x82')]=_0x2e6174[_0x96f4('0x75')];_0x1f2405['message'][_0x96f4('0x76')]=_0x96f4('0x34');respondWithRpcPromise(_0x96f4('0x83'),_0x96f4('0x83'),{'event':'rejectmessage','message':_['merge'](_0x2e6174[_0x96f4('0x28')],JSON[_0x96f4('0x77')](_0x2e6174[_0x96f4('0x68')][_0x96f4('0x84')]))},client9002);return _0x2e6174;}return null;})[_0x96f4('0x20')](respondWithResult(_0x21f8d8,null))[_0x96f4('0x2a')](handleError(_0x21f8d8,null));};
\ No newline at end of file
+var _0x1025=['catch','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatMessage','count','includeAll','include','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','chat','format','UserId','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','agent','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','sequelize','SIP/%s','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result'];(function(_0x36f6fb,_0x249aa3){var _0x39c006=function(_0x2ba353){while(--_0x2ba353){_0x36f6fb['push'](_0x36f6fb['shift']());}};_0x39c006(++_0x249aa3);}(_0x1025,0x15b));var _0x5102=function(_0x514a57,_0x3f68f0){_0x514a57=_0x514a57-0x0;var _0x5814ac=_0x1025[_0x514a57];return _0x5814ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5102('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5102('0x1'));var rp=require(_0x5102('0x2'));var moment=require(_0x5102('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5102('0x4'));var path=require(_0x5102('0x5'));var sox=require(_0x5102('0x6'));var csv=require('to-csv');var ejs=require(_0x5102('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5102('0x8'));var squel=require(_0x5102('0x9'));var crypto=require('crypto');var jsforce=require(_0x5102('0xa'));var deskjs=require(_0x5102('0xb'));var toCsv=require(_0x5102('0xc'));var querystring=require('querystring');var Papa=require(_0x5102('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5102('0xe'));var as=require(_0x5102('0xf'));var hardwareService=require(_0x5102('0x10'));var logger=require(_0x5102('0x11'))(_0x5102('0x12'));var utils=require(_0x5102('0x13'));var config=require(_0x5102('0x14'));var licenseUtil=require(_0x5102('0x15'));var db=require(_0x5102('0x16'))['db'];config[_0x5102('0x17')]=_['defaults'](config['redis'],{'host':_0x5102('0x18'),'port':0x18eb});var socket=require(_0x5102('0x19'))(new Redis(config[_0x5102('0x17')]));require('./chatMessage.socket')[_0x5102('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5102('0x1b')][_0x5102('0x1c')]({'port':0x232c});var client9002=jayson[_0x5102('0x1b')][_0x5102('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d51bd,_0x5e19a8,_0x3a02b9,_0x380a87){return new BPromise(function(_0x238e10,_0x2fbb60){var _0xae64c4=_0x380a87||client;return _0xae64c4[_0x5102('0x1d')](_0x5d51bd,_0x3a02b9)['then'](function(_0x157c9d){logger[_0x5102('0x1e')](_0x5102('0x1f'),_0x5e19a8,'request\x20sent');logger['debug'](_0x5102('0x20'),_0x5e19a8,'request\x20sent',JSON['stringify'](_0x157c9d));if(_0x157c9d[_0x5102('0x21')]){if(_0x157c9d[_0x5102('0x21')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x5e19a8,_0x157c9d[_0x5102('0x21')][_0x5102('0x22')]);return _0x2fbb60(_0x157c9d[_0x5102('0x21')][_0x5102('0x22')]);}logger[_0x5102('0x21')](_0x5102('0x1f'),_0x5e19a8,_0x157c9d[_0x5102('0x21')]['message']);return _0x238e10(_0x157c9d[_0x5102('0x21')][_0x5102('0x22')]);}else{logger['info'](_0x5102('0x1f'),_0x5e19a8,_0x5102('0x23'));_0x238e10(_0x157c9d[_0x5102('0x24')][_0x5102('0x22')]);}})[_0x5102('0x25')](function(_0x34e0f4){logger[_0x5102('0x21')]('ChatMessage,\x20%s,\x20%s',_0x5e19a8,_0x34e0f4);_0x2fbb60(_0x34e0f4);});});}function respondWithStatusCode(_0x468f5b,_0x3e9ad6){_0x3e9ad6=_0x3e9ad6||0xcc;return function(_0xc82fab){if(_0xc82fab){return _0x468f5b[_0x5102('0x26')](_0x3e9ad6);}return _0x468f5b[_0x5102('0x27')](_0x3e9ad6)['end']();};}function respondWithResult(_0x53927a,_0x4dd6eb){_0x4dd6eb=_0x4dd6eb||0xc8;return function(_0x314812){if(_0x314812){return _0x53927a[_0x5102('0x27')](_0x4dd6eb)[_0x5102('0x28')](_0x314812);}};}function respondWithFilteredResult(_0x3fd58a,_0xaea7cb){return function(_0x232306){if(_0x232306){var _0x1c4eb5=typeof _0xaea7cb['offset']===_0x5102('0x29')&&typeof _0xaea7cb[_0x5102('0x2a')]==='undefined';var _0x5bd69d=_0x232306['count'];var _0x22e214=_0x1c4eb5?0x0:_0xaea7cb[_0x5102('0x2b')];var _0x1fbabe=_0x1c4eb5?_0x232306['count']:_0xaea7cb[_0x5102('0x2b')]+_0xaea7cb[_0x5102('0x2a')];var _0x20b298;if(_0x1fbabe>=_0x5bd69d){_0x1fbabe=_0x5bd69d;_0x20b298=0xc8;}else{_0x20b298=0xce;}_0x3fd58a[_0x5102('0x27')](_0x20b298);return _0x3fd58a[_0x5102('0x2c')](_0x5102('0x2d'),_0x22e214+'-'+_0x1fbabe+'/'+_0x5bd69d)[_0x5102('0x28')](_0x232306);}return null;};}function patchUpdates(_0x3af300){return function(_0x4bca14){try{jsonpatch[_0x5102('0x2e')](_0x4bca14,_0x3af300,!![]);}catch(_0x328835){return BPromise[_0x5102('0x2f')](_0x328835);}return _0x4bca14[_0x5102('0x30')]();};}function saveUpdates(_0x518948,_0x4134c3){return function(_0x3e1a26){if(_0x3e1a26){return _0x3e1a26[_0x5102('0x31')](_0x518948)[_0x5102('0x32')](function(_0x7e2774){return _0x7e2774;});}return null;};}function removeEntity(_0x46acc3,_0x3f72fe){return function(_0x4d78d8){if(_0x4d78d8){return _0x4d78d8[_0x5102('0x33')]()['then'](function(){_0x46acc3[_0x5102('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b257a,_0x23321b){return function(_0x3cf41c){if(!_0x3cf41c){_0x4b257a[_0x5102('0x26')](0x194);}return _0x3cf41c;};}function handleError(_0x335a82,_0x5711c3){_0x5711c3=_0x5711c3||0x1f4;return function(_0x4c5f02){logger[_0x5102('0x21')](_0x4c5f02[_0x5102('0x34')]);if(_0x4c5f02[_0x5102('0x35')]){delete _0x4c5f02[_0x5102('0x35')];}_0x335a82[_0x5102('0x27')](_0x5711c3)[_0x5102('0x36')](_0x4c5f02);};}exports[_0x5102('0x37')]=function(_0x115555,_0x44e5af){var _0x2ccd5d={},_0x4ab014={},_0x51c6b3={'count':0x0,'rows':[]};var _0x273569=_[_0x5102('0x38')](db['ChatMessage'][_0x5102('0x39')],function(_0xefb324){return{'name':_0xefb324[_0x5102('0x3a')],'type':_0xefb324['type'][_0x5102('0x3b')]};});_0x4ab014[_0x5102('0x3c')]=_[_0x5102('0x38')](_0x273569,_0x5102('0x35'));_0x4ab014[_0x5102('0x3d')]=_[_0x5102('0x3e')](_0x115555[_0x5102('0x3d')]);_0x4ab014[_0x5102('0x3f')]=_['intersection'](_0x4ab014[_0x5102('0x3c')],_0x4ab014[_0x5102('0x3d')]);_0x2ccd5d[_0x5102('0x40')]=_[_0x5102('0x41')](_0x4ab014[_0x5102('0x3c')],qs[_0x5102('0x42')](_0x115555[_0x5102('0x3d')][_0x5102('0x42')]));_0x2ccd5d[_0x5102('0x40')]=_0x2ccd5d[_0x5102('0x40')][_0x5102('0x43')]?_0x2ccd5d['attributes']:_0x4ab014['model'];if(!_0x115555[_0x5102('0x3d')][_0x5102('0x44')](_0x5102('0x45'))){_0x2ccd5d[_0x5102('0x2a')]=qs[_0x5102('0x2a')](_0x115555[_0x5102('0x3d')][_0x5102('0x2a')]);_0x2ccd5d['offset']=qs[_0x5102('0x2b')](_0x115555[_0x5102('0x3d')][_0x5102('0x2b')]);}_0x2ccd5d[_0x5102('0x46')]=qs[_0x5102('0x47')](_0x115555[_0x5102('0x3d')][_0x5102('0x47')]);_0x2ccd5d[_0x5102('0x48')]=qs[_0x5102('0x3f')](_[_0x5102('0x49')](_0x115555[_0x5102('0x3d')],_0x4ab014[_0x5102('0x3f')]),_0x273569);if(_0x115555[_0x5102('0x3d')][_0x5102('0x4a')]){_0x2ccd5d[_0x5102('0x48')]=_[_0x5102('0x4b')](_0x2ccd5d[_0x5102('0x48')],{'$or':_[_0x5102('0x38')](_0x273569,function(_0x340597){if(_0x340597[_0x5102('0x4c')]!==_0x5102('0x4d')){var _0x3a3701={};_0x3a3701[_0x340597[_0x5102('0x35')]]={'$like':'%'+_0x115555['query'][_0x5102('0x4a')]+'%'};return _0x3a3701;}})});}_0x2ccd5d=_['merge']({},_0x2ccd5d,_0x115555[_0x5102('0x4e')]);var _0x33d15b={'where':_0x2ccd5d['where']};return db[_0x5102('0x4f')][_0x5102('0x50')](_0x33d15b)[_0x5102('0x32')](function(_0x3bc43b){_0x51c6b3['count']=_0x3bc43b;if(_0x115555[_0x5102('0x3d')][_0x5102('0x51')]){_0x2ccd5d[_0x5102('0x52')]=[{'all':!![]}];}return db[_0x5102('0x4f')][_0x5102('0x53')](_0x2ccd5d);})[_0x5102('0x32')](function(_0x2458ec){_0x51c6b3[_0x5102('0x54')]=_0x2458ec;return _0x51c6b3;})[_0x5102('0x32')](respondWithFilteredResult(_0x44e5af,_0x2ccd5d))[_0x5102('0x25')](handleError(_0x44e5af,null));};exports[_0x5102('0x55')]=function(_0x5a1e88,_0x11cbec){var _0x48d4de={'raw':!![],'where':{'id':_0x5a1e88[_0x5102('0x56')]['id']}},_0x1d6bc0={};_0x1d6bc0[_0x5102('0x3c')]=_[_0x5102('0x3e')](db['ChatMessage'][_0x5102('0x39')]);_0x1d6bc0[_0x5102('0x3d')]=_[_0x5102('0x3e')](_0x5a1e88[_0x5102('0x3d')]);_0x1d6bc0[_0x5102('0x3f')]=_['intersection'](_0x1d6bc0[_0x5102('0x3c')],_0x1d6bc0[_0x5102('0x3d')]);_0x48d4de[_0x5102('0x40')]=_[_0x5102('0x41')](_0x1d6bc0['model'],qs[_0x5102('0x42')](_0x5a1e88['query'][_0x5102('0x42')]));_0x48d4de[_0x5102('0x40')]=_0x48d4de[_0x5102('0x40')][_0x5102('0x43')]?_0x48d4de['attributes']:_0x1d6bc0[_0x5102('0x3c')];if(_0x5a1e88['query'][_0x5102('0x51')]){_0x48d4de[_0x5102('0x52')]=[{'all':!![]}];}_0x48d4de=_[_0x5102('0x4b')]({},_0x48d4de,_0x5a1e88[_0x5102('0x4e')]);return db[_0x5102('0x4f')][_0x5102('0x57')](_0x48d4de)[_0x5102('0x32')](handleEntityNotFound(_0x11cbec,null))[_0x5102('0x32')](respondWithResult(_0x11cbec,null))['catch'](handleError(_0x11cbec,null));};exports[_0x5102('0x58')]=function(_0xf6ef92,_0x25cdff){return db[_0x5102('0x4f')]['create'](_0xf6ef92['body'],{})[_0x5102('0x32')](respondWithResult(_0x25cdff,0xc9))[_0x5102('0x25')](handleError(_0x25cdff,null));};exports[_0x5102('0x31')]=function(_0x3d9fb1,_0x5dc983){if(_0x3d9fb1[_0x5102('0x59')]['id']){delete _0x3d9fb1[_0x5102('0x59')]['id'];}return db[_0x5102('0x4f')][_0x5102('0x57')]({'where':{'id':_0x3d9fb1[_0x5102('0x56')]['id']}})['then'](handleEntityNotFound(_0x5dc983,null))[_0x5102('0x32')](saveUpdates(_0x3d9fb1[_0x5102('0x59')],null))[_0x5102('0x32')](respondWithResult(_0x5dc983,null))['catch'](handleError(_0x5dc983,null));};exports[_0x5102('0x33')]=function(_0x21aaef,_0x70f6f5){return db[_0x5102('0x4f')][_0x5102('0x57')]({'where':{'id':_0x21aaef[_0x5102('0x56')]['id']}})[_0x5102('0x32')](handleEntityNotFound(_0x70f6f5,null))['then'](removeEntity(_0x70f6f5,null))[_0x5102('0x25')](handleError(_0x70f6f5,null));};exports[_0x5102('0x5a')]=function(_0x15b896,_0x18d1fd){return db[_0x5102('0x4f')][_0x5102('0x5a')]()[_0x5102('0x32')](respondWithResult(_0x18d1fd,null))[_0x5102('0x25')](handleError(_0x18d1fd,null));};var interaction_log=require(_0x5102('0x11'))(_0x5102('0x5b'));exports[_0x5102('0x5c')]=function(_0x4f2dd2,_0x4714b4,_0x373082){var _0x5e959a={'agent':{},'channel':_0x5102('0x5d')};if(_0x4f2dd2['body']['id']){delete _0x4f2dd2[_0x5102('0x59')]['id'];}_0x4f2dd2[_0x5102('0x59')]['read']=!![];_0x4f2dd2[_0x5102('0x59')]['readAt']=moment()[_0x5102('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f2dd2[_0x5102('0x59')][_0x5102('0x5f')]=_0x4f2dd2[_0x5102('0x59')][_0x5102('0x5f')]||_0x4f2dd2['user']['id'];_0x5e959a['agent']['id']=_0x4f2dd2[_0x5102('0x59')][_0x5102('0x5f')];return db[_0x5102('0x4f')]['find']({'where':{'id':_0x4f2dd2['params']['id'],'UserId':null}})[_0x5102('0x32')](handleEntityNotFound(_0x4714b4,null))[_0x5102('0x32')](saveUpdates(_0x4f2dd2['body'],null))[_0x5102('0x32')](function(_0x217946){if(_0x217946){_0x5e959a['message']=_0x217946['get']({'plain':!![]});return db['ChatInteraction'][_0x5102('0x57')]({'where':{'id':_0x217946[_0x5102('0x60')]}});}return null;})[_0x5102('0x32')](handleEntityNotFound(_0x4714b4,null))[_0x5102('0x32')](function(_0x4e3008){if(_0x4e3008){return _0x4e3008['update']({'UserId':_0x4f2dd2['body'][_0x5102('0x5f')],'read1stAt':_[_0x5102('0x61')](_0x4e3008['read1stAt'])?moment()[_0x5102('0x5e')](_0x5102('0x62')):undefined});}return null;})[_0x5102('0x32')](function(_0x12d3e8){if(_0x12d3e8){_0x5e959a['interaction']=_0x12d3e8['get']({'plain':!![]});interaction_log[_0x5102('0x1e')](_0x5102('0x63'),_0x4f2dd2[_0x5102('0x64')]['id'],_0x4f2dd2[_0x5102('0x64')]['name'],_0x4f2dd2[_0x5102('0x64')][_0x5102('0x65')],_0x5e959a[_0x5102('0x66')]['id'],_0x4f2dd2[_0x5102('0x59')]?JSON[_0x5102('0x67')](_0x4f2dd2['body']):'null');return respondWithRpcPromise(_0x5102('0x68'),'acceptMessage',_0x5e959a);}return null;})[_0x5102('0x32')](function(_0x248ee7){var _0x1c5d28=_0x5102('0x69')+_0x248ee7['message'][_0x5102('0x6a')];return db['sequelize'][_0x5102('0x3d')](_0x1c5d28,{'type':db[_0x5102('0x6b')]['QueryTypes'][_0x5102('0x6c')],'raw':!![]})[_0x5102('0x32')](function(_0x1688de){return _0x1688de;});})[_0x5102('0x32')](function(_0x4518ff){if(_0x4518ff){_0x5e959a[_0x5102('0x22')][_0x5102('0x6d')]=_0x4518ff[0x0];if(!_0x4f2dd2['body'][_0x5102('0x5f')])return;return db[_0x5102('0x6e')][_0x5102('0x57')]({'where':{'id':_0x4f2dd2[_0x5102('0x59')][_0x5102('0x5f')],'role':_0x5102('0x6f')},'attributes':['id',_0x5102('0x35'),'fullname',_0x5102('0x70'),_0x5102('0x71')],'raw':!![]});}return null;})[_0x5102('0x32')](function(_0x302b8f){if(!_0x302b8f)return null;_0x5e959a[_0x5102('0x22')]['agent']=_0x302b8f;return _0x5e959a;})[_0x5102('0x32')](function(_0x1952ea){if(_0x1952ea){if(_0x4f2dd2[_0x5102('0x59')][_0x5102('0x72')]){_0x5e959a[_0x5102('0x22')][_0x5102('0x73')]=util[_0x5102('0x5e')]('SIP/%s',_0x4f2dd2[_0x5102('0x64')][_0x5102('0x35')]);_0x5e959a[_0x5102('0x22')][_0x5102('0x74')]=_0x5e959a[_0x5102('0x74')];_0x5e959a[_0x5102('0x22')][_0x5102('0x75')]=_0x5e959a[_0x5102('0x74')];_0x5e959a[_0x5102('0x22')][_0x5102('0x76')]=_0x5102('0x5c');return respondWithRpcPromise('EventManager',_0x5102('0x77'),{'event':_0x5102('0x78'),'message':_['merge'](_0x5e959a['message'],JSON[_0x5102('0x79')](_0x5e959a[_0x5102('0x66')]['formData']))},client9002)[_0x5102('0x32')](function(){return _0x5e959a;});}return _0x5e959a;}return null;})['then'](respondWithResult(_0x4714b4,null))[_0x5102('0x25')](handleError(_0x4714b4,null));};var interaction_log=require(_0x5102('0x11'))(_0x5102('0x5b'));exports[_0x5102('0x2f')]=function(_0x18a839,_0x29ea66,_0x2a96c2){var _0x17ae74={'agent':{},'channel':_0x5102('0x5d')};if(_0x18a839[_0x5102('0x59')]['id']){delete _0x18a839[_0x5102('0x59')]['id'];}_0x18a839['body'][_0x5102('0x5f')]=_0x18a839['body']['UserId']||_0x18a839[_0x5102('0x64')]['id'];_0x17ae74[_0x5102('0x6f')]['id']=_0x18a839[_0x5102('0x59')][_0x5102('0x5f')];return db[_0x5102('0x4f')][_0x5102('0x57')]({'where':{'id':_0x18a839[_0x5102('0x56')]['id'],'UserId':null}})[_0x5102('0x32')](handleEntityNotFound(_0x29ea66,null))[_0x5102('0x32')](function(_0x319f98){if(_0x319f98){_0x17ae74[_0x5102('0x22')]=_0x319f98[_0x5102('0x7a')]({'plain':!![]});return db['ChatInteraction'][_0x5102('0x57')]({'where':{'id':_0x319f98[_0x5102('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x29ea66,null))[_0x5102('0x32')](function(_0x3072ba){if(_0x3072ba){_0x17ae74[_0x5102('0x66')]=_0x3072ba[_0x5102('0x7a')]({'plain':!![]});interaction_log[_0x5102('0x1e')](_0x5102('0x7b'),_0x18a839[_0x5102('0x64')]['id'],_0x18a839[_0x5102('0x64')][_0x5102('0x35')],_0x18a839[_0x5102('0x64')][_0x5102('0x65')],_0x17ae74['interaction']['id'],_0x18a839['body']?JSON[_0x5102('0x67')](_0x18a839[_0x5102('0x59')]):_0x5102('0x7c'));return respondWithRpcPromise('RejectMessage',_0x5102('0x7d'),_0x17ae74);}return null;})[_0x5102('0x32')](function(_0x5e4992){var _0x515b8e=_0x5102('0x69')+_0x5e4992[_0x5102('0x22')][_0x5102('0x6a')];return db[_0x5102('0x7e')]['query'](_0x515b8e,{'type':db['Sequelize']['QueryTypes'][_0x5102('0x6c')],'raw':!![]})[_0x5102('0x32')](function(_0x2dae00){return _0x2dae00;});})[_0x5102('0x32')](function(_0x4f2f3b){if(_0x4f2f3b){_0x17ae74[_0x5102('0x22')][_0x5102('0x6d')]=_0x4f2f3b[0x0];if(!_0x18a839['body'][_0x5102('0x5f')])return;return db[_0x5102('0x6e')][_0x5102('0x57')]({'where':{'id':_0x18a839[_0x5102('0x59')][_0x5102('0x5f')],'role':_0x5102('0x6f')},'attributes':['id',_0x5102('0x35'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x5102('0x32')](function(_0xee3a65){if(!_0xee3a65)return null;_0x17ae74[_0x5102('0x22')][_0x5102('0x6f')]=_0xee3a65;return _0x17ae74;})[_0x5102('0x32')](function(_0x260aff){if(_0x260aff){_0x260aff[_0x5102('0x22')][_0x5102('0x73')]=util[_0x5102('0x5e')](_0x5102('0x7f'),_0x18a839[_0x5102('0x64')][_0x5102('0x35')]);_0x260aff[_0x5102('0x22')]['channel']=_0x17ae74[_0x5102('0x74')];_0x260aff[_0x5102('0x22')][_0x5102('0x75')]=_0x17ae74['channel'];_0x260aff[_0x5102('0x22')]['event']='reject';respondWithRpcPromise(_0x5102('0x77'),_0x5102('0x77'),{'event':'rejectmessage','message':_[_0x5102('0x4b')](_0x17ae74[_0x5102('0x22')],JSON[_0x5102('0x79')](_0x17ae74[_0x5102('0x66')]['formData']))},client9002);return _0x17ae74;}return null;})[_0x5102('0x32')](respondWithResult(_0x29ea66,null))[_0x5102('0x25')](handleError(_0x29ea66,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c46230a..027b88a 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 _0xdda1=['remove','emit','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x437536,_0x923c6e){var _0x518a23=function(_0x9b6bbc){while(--_0x9b6bbc){_0x437536['push'](_0x437536['shift']());}};_0x518a23(++_0x923c6e);}(_0xdda1,0x11b));var _0x1dda=function(_0xa88c4d,_0x5660d5){_0xa88c4d=_0xa88c4d-0x0;var _0x10c20c=_0xdda1[_0xa88c4d];return _0x10c20c;};'use strict';var EventEmitter=require(_0x1dda('0x0'));var ChatMessage=require(_0x1dda('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1dda('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1dda('0x3'),'afterDestroy':_0x1dda('0x4')};function emitEvent(_0x178159){return function(_0x1a62e4,_0x1d9f4f,_0x19d657){ChatMessageEvents[_0x1dda('0x5')](_0x178159+':'+_0x1a62e4['id'],_0x1a62e4);ChatMessageEvents[_0x1dda('0x5')](_0x178159,_0x1a62e4);_0x19d657(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1dda('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xa312=['exports','../../mysqldb','ChatMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x5a2436,_0x11375a){var _0x2d8468=function(_0x5b77b9){while(--_0x5b77b9){_0x5a2436['push'](_0x5a2436['shift']());}};_0x2d8468(++_0x11375a);}(_0xa312,0x1f1));var _0x2a31=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0xa312[_0x55ef8b];return _0x359c84;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x2a31('0x0'))['db'][_0x2a31('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2a31('0x2'),'afterUpdate':_0x2a31('0x3'),'afterDestroy':_0x2a31('0x4')};function emitEvent(_0x417c17){return function(_0x57fd8b,_0x197584,_0x54de06){ChatMessageEvents[_0x2a31('0x5')](_0x417c17+':'+_0x57fd8b['id'],_0x57fd8b);ChatMessageEvents[_0x2a31('0x5')](_0x417c17,_0x57fd8b);_0x54de06(null);};}for(var e in events){if(events[_0x2a31('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x2a31('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index c0f03ca..a3368cf 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 _0xe58b=['api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','UserId','ChatInteraction','findOne','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x75854d,_0x15f62d){var _0x3284b4=function(_0x46a214){while(--_0x46a214){_0x75854d['push'](_0x75854d['shift']());}};_0x3284b4(++_0x15f62d);}(_0xe58b,0x1e3));var _0xbe58=function(_0xd274ec,_0x6b590b){_0xd274ec=_0xd274ec-0x0;var _0x5345c8=_0xe58b[_0xd274ec];return _0x5345c8;};'use strict';var _=require(_0xbe58('0x0'));var util=require(_0xbe58('0x1'));var logger=require(_0xbe58('0x2'))(_0xbe58('0x3'));var moment=require(_0xbe58('0x4'));var BPromise=require(_0xbe58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe58('0x6'));var rimraf=require(_0xbe58('0x7'));var config=require(_0xbe58('0x8'));var attributes=require(_0xbe58('0x9'));module[_0xbe58('0xa')]=function(_0x29f976,_0x514fca){return _0x29f976[_0xbe58('0xb')]('ChatMessage',attributes,{'tableName':_0xbe58('0xc'),'paranoid':![],'indexes':[{'name':_0xbe58('0xd'),'fields':[_0xbe58('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29091c,_0x351a41,_0xbcc9d8){var _0x47048f=_0x29f976[_0xbe58('0xf')];var _0x23bc78=_0x29091c[_0xbe58('0x10')]({'plain':!![]});if(_0x23bc78[_0xbe58('0x11')][_0xbe58('0x12')]()==='in'||_0x23bc78[_0xbe58('0x11')]['toLowerCase']()==='out'&&!_0x23bc78['secret']&&!_['isNil'](_0x23bc78[_0xbe58('0x13')])){_0x47048f[_0xbe58('0x14')][_0xbe58('0x15')]({'where':{'id':_0x23bc78['ChatInteractionId']}})['then'](function(_0x35dea0){if(_0x35dea0){_0x35dea0['update']({'lastMsgAt':_0x23bc78[_0xbe58('0x16')],'lastMsgDirection':_0x23bc78[_0xbe58('0x11')][_0xbe58('0x12')]()});}})[_0xbe58('0x17')](function(_0x588632){console[_0xbe58('0x18')](_0x588632);});}_0xbcc9d8();}},'charset':_0xbe58('0x19'),'collate':_0xbe58('0x1a')});};
\ No newline at end of file
+var _0x3c79=['ChatInteraction','findOne','ChatInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x1fab82,_0x587291){var _0x4e3378=function(_0x364a28){while(--_0x364a28){_0x1fab82['push'](_0x1fab82['shift']());}};_0x4e3378(++_0x587291);}(_0x3c79,0xef));var _0x93c7=function(_0x183878,_0x23a8a2){_0x183878=_0x183878-0x0;var _0x4688cf=_0x3c79[_0x183878];return _0x4688cf;};'use strict';var _=require(_0x93c7('0x0'));var util=require(_0x93c7('0x1'));var logger=require('../../config/logger')(_0x93c7('0x2'));var moment=require(_0x93c7('0x3'));var BPromise=require(_0x93c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x93c7('0x5'));var rimraf=require(_0x93c7('0x6'));var config=require('../../config/environment');var attributes=require(_0x93c7('0x7'));module[_0x93c7('0x8')]=function(_0x1827d4,_0x363419){return _0x1827d4[_0x93c7('0x9')](_0x93c7('0xa'),attributes,{'tableName':_0x93c7('0xb'),'paranoid':![],'indexes':[{'name':_0x93c7('0xc'),'fields':[_0x93c7('0xd')],'type':_0x93c7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbc7194,_0x1a331a,_0xdea5a5){var _0x93c935=_0x1827d4[_0x93c7('0xf')];var _0xa25754=_0xbc7194['get']({'plain':!![]});if(_0xa25754[_0x93c7('0x10')][_0x93c7('0x11')]()==='in'||_0xa25754['direction']['toLowerCase']()===_0x93c7('0x12')&&!_0xa25754[_0x93c7('0x13')]&&!_[_0x93c7('0x14')](_0xa25754[_0x93c7('0x15')])){_0x93c935[_0x93c7('0x16')][_0x93c7('0x17')]({'where':{'id':_0xa25754[_0x93c7('0x18')]}})['then'](function(_0xc2c892){if(_0xc2c892){_0xc2c892[_0x93c7('0x19')]({'lastMsgAt':_0xa25754['createdAt'],'lastMsgDirection':_0xa25754['direction']['toLowerCase']()});}})[_0x93c7('0x1a')](function(_0x1b291f){console['error'](_0x1b291f);});}_0xdea5a5();}},'charset':_0x93c7('0x1b'),'collate':_0x93c7('0x1c')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 3718da9..932577a 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 _0xaefe=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x414653,_0x4d4b43){var _0x1504fa=function(_0x304a59){while(--_0x304a59){_0x414653['push'](_0x414653['shift']());}};_0x1504fa(++_0x4d4b43);}(_0xaefe,0x91));var _0xeaef=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0xaefe[_0x1809c5];return _0x5254a4;};'use strict';var _=require(_0xeaef('0x0'));var util=require(_0xeaef('0x1'));var moment=require(_0xeaef('0x2'));var BPromise=require(_0xeaef('0x3'));var rs=require(_0xeaef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaef('0x5'))['db'];var utils=require(_0xeaef('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xeaef('0x7'));var jayson=require(_0xeaef('0x8'));var client=jayson['client'][_0xeaef('0x9')]({'port':0x232a});config[_0xeaef('0xa')]=_[_0xeaef('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeaef('0xc'))(new Redis(config[_0xeaef('0xa')]));require(_0xeaef('0xd'))[_0xeaef('0xe')](socket);function respondWithRpcPromise(_0x52db36,_0x5ba94d,_0x5494e2){return new BPromise(function(_0xccb571,_0x252d17){return client['request'](_0x52db36,_0x5494e2)[_0xeaef('0xf')](function(_0x5a7a9b){logger[_0xeaef('0x10')](_0xeaef('0x11'),_0x5ba94d,_0xeaef('0x12'));logger[_0xeaef('0x13')](_0xeaef('0x14'),_0x5ba94d,_0xeaef('0x12'),JSON[_0xeaef('0x15')](_0x5a7a9b));if(_0x5a7a9b[_0xeaef('0x16')]){if(_0x5a7a9b[_0xeaef('0x16')][_0xeaef('0x17')]===0x1f4){logger[_0xeaef('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5ba94d,_0x5a7a9b[_0xeaef('0x16')][_0xeaef('0x18')]);return _0x252d17(_0x5a7a9b['error'][_0xeaef('0x18')]);}logger[_0xeaef('0x16')](_0xeaef('0x11'),_0x5ba94d,_0x5a7a9b['error'][_0xeaef('0x18')]);return _0xccb571(_0x5a7a9b[_0xeaef('0x16')][_0xeaef('0x18')]);}else{logger[_0xeaef('0x10')]('ChatMessage,\x20%s,\x20%s',_0x5ba94d,_0xeaef('0x12'));_0xccb571(_0x5a7a9b[_0xeaef('0x19')][_0xeaef('0x18')]);}})[_0xeaef('0x1a')](function(_0x2bccb2){logger[_0xeaef('0x16')](_0xeaef('0x11'),_0x5ba94d,_0x2bccb2);_0x252d17(_0x2bccb2);});});}exports[_0xeaef('0x1b')]=function(_0x574cd6){var _0x1322eb=this;return new Promise(function(_0x2e480f,_0x4bfa88){return db[_0xeaef('0x1c')][_0xeaef('0x1d')](_0x574cd6[_0xeaef('0x1e')],{'raw':_0x574cd6[_0xeaef('0x1f')]?_0x574cd6[_0xeaef('0x1f')][_0xeaef('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x3689ae){logger[_0xeaef('0x10')]('CreateChatMessage',_0x574cd6);logger[_0xeaef('0x13')](_0xeaef('0x1b'),_0x574cd6,JSON[_0xeaef('0x15')](_0x3689ae));_0x2e480f(_0x3689ae);})[_0xeaef('0x1a')](function(_0x48e83c){logger[_0xeaef('0x16')]('CreateChatMessage',_0x48e83c['message'],_0x574cd6);_0x4bfa88(_0x1322eb[_0xeaef('0x16')](0x1f4,_0x48e83c[_0xeaef('0x18')]));});});};
\ No newline at end of file
+var _0xc677=['error','code','message','result','catch','CreateChatMessage','ChatMessage','body','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0xc677,0x18a));var _0x7c67=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc677[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7c67('0x0'));var util=require(_0x7c67('0x1'));var moment=require(_0x7c67('0x2'));var BPromise=require(_0x7c67('0x3'));var rs=require(_0x7c67('0x4'));var fs=require('fs');var Redis=require(_0x7c67('0x5'));var db=require(_0x7c67('0x6'))['db'];var utils=require(_0x7c67('0x7'));var logger=require(_0x7c67('0x8'))(_0x7c67('0x9'));var config=require(_0x7c67('0xa'));var jayson=require(_0x7c67('0xb'));var client=jayson[_0x7c67('0xc')]['http']({'port':0x232a});config[_0x7c67('0xd')]=_['defaults'](config[_0x7c67('0xd')],{'host':_0x7c67('0xe'),'port':0x18eb});var socket=require(_0x7c67('0xf'))(new Redis(config[_0x7c67('0xd')]));require(_0x7c67('0x10'))[_0x7c67('0x11')](socket);function respondWithRpcPromise(_0x82e663,_0x290c3d,_0x3e9cc0){return new BPromise(function(_0x3e35d6,_0x3219a3){return client[_0x7c67('0x12')](_0x82e663,_0x3e9cc0)[_0x7c67('0x13')](function(_0x27a0e8){logger[_0x7c67('0x14')](_0x7c67('0x15'),_0x290c3d,'request\x20sent');logger[_0x7c67('0x16')](_0x7c67('0x17'),_0x290c3d,_0x7c67('0x18'),JSON[_0x7c67('0x19')](_0x27a0e8));if(_0x27a0e8[_0x7c67('0x1a')]){if(_0x27a0e8[_0x7c67('0x1a')][_0x7c67('0x1b')]===0x1f4){logger[_0x7c67('0x1a')](_0x7c67('0x15'),_0x290c3d,_0x27a0e8[_0x7c67('0x1a')][_0x7c67('0x1c')]);return _0x3219a3(_0x27a0e8[_0x7c67('0x1a')]['message']);}logger[_0x7c67('0x1a')](_0x7c67('0x15'),_0x290c3d,_0x27a0e8[_0x7c67('0x1a')]['message']);return _0x3e35d6(_0x27a0e8[_0x7c67('0x1a')]['message']);}else{logger['info'](_0x7c67('0x15'),_0x290c3d,_0x7c67('0x18'));_0x3e35d6(_0x27a0e8[_0x7c67('0x1d')][_0x7c67('0x1c')]);}})[_0x7c67('0x1e')](function(_0x17319d){logger[_0x7c67('0x1a')](_0x7c67('0x15'),_0x290c3d,_0x17319d);_0x3219a3(_0x17319d);});});}exports[_0x7c67('0x1f')]=function(_0x55d4a9){var _0xd4045f=this;return new Promise(function(_0x2092fd,_0xb1f6a3){return db[_0x7c67('0x20')]['create'](_0x55d4a9[_0x7c67('0x21')],{'raw':_0x55d4a9['options']?_0x55d4a9['options'][_0x7c67('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x339e9f){logger['info']('CreateChatMessage',_0x55d4a9);logger[_0x7c67('0x16')](_0x7c67('0x1f'),_0x55d4a9,JSON[_0x7c67('0x19')](_0x339e9f));_0x2092fd(_0x339e9f);})['catch'](function(_0x4f7b05){logger[_0x7c67('0x1a')]('CreateChatMessage',_0x4f7b05[_0x7c67('0x1c')],_0x55d4a9);_0xb1f6a3(_0xd4045f[_0x7c67('0x1a')](0x1f4,_0x4f7b05['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 05ff693..276c18e 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 _0x1670=['./chatMessage.events','save','update','emit','register','length','chatMessage:'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0x1670,0x9a));var _0x0167=function(_0x1b2e34,_0x8d3ab5){_0x1b2e34=_0x1b2e34-0x0;var _0x13c2b9=_0x1670[_0x1b2e34];return _0x13c2b9;};'use strict';var ChatMessageEvents=require(_0x0167('0x0'));var events=[_0x0167('0x1'),'remove',_0x0167('0x2')];function createListener(_0x4dc6f6,_0x1c7a08){return function(_0x45bbfd){_0x1c7a08[_0x0167('0x3')](_0x4dc6f6,_0x45bbfd);};}function removeListener(_0x6f87ae,_0x5786d8){return function(){ChatMessageEvents['removeListener'](_0x6f87ae,_0x5786d8);};}exports[_0x0167('0x4')]=function(_0x1ae650){for(var _0x295e51=0x0,_0x3e1507=events[_0x0167('0x5')];_0x295e51<_0x3e1507;_0x295e51++){var _0x149956=events[_0x295e51];var _0xcdfc5=createListener(_0x0167('0x6')+_0x149956,_0x1ae650);ChatMessageEvents['on'](_0x149956,_0xcdfc5);}};
\ No newline at end of file
+var _0x42b0=['register','length','./chatMessage.events','save','update','removeListener'];(function(_0x76d2c0,_0x1f52f1){var _0x46d590=function(_0x50e08b){while(--_0x50e08b){_0x76d2c0['push'](_0x76d2c0['shift']());}};_0x46d590(++_0x1f52f1);}(_0x42b0,0xbc));var _0x042b=function(_0x18bccf,_0x515956){_0x18bccf=_0x18bccf-0x0;var _0x3d07bd=_0x42b0[_0x18bccf];return _0x3d07bd;};'use strict';var ChatMessageEvents=require(_0x042b('0x0'));var events=[_0x042b('0x1'),'remove',_0x042b('0x2')];function createListener(_0x4bf494,_0x1d7aa3){return function(_0x5a7e27){_0x1d7aa3['emit'](_0x4bf494,_0x5a7e27);};}function removeListener(_0x401a0c,_0xd73d53){return function(){ChatMessageEvents[_0x042b('0x3')](_0x401a0c,_0xd73d53);};}exports[_0x042b('0x4')]=function(_0x135bc1){for(var _0x5d194a=0x0,_0x51c41c=events[_0x042b('0x5')];_0x5d194a<_0x51c41c;_0x5d194a++){var _0x1ec28f=events[_0x5d194a];var _0x49ab70=createListener('chatMessage:'+_0x1ec28f,_0x135bc1);ChatMessageEvents['on'](_0x1ec28f,_0x49ab70);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 42e036b..7aa027e 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 _0x1231=['chatmessage:create','create','put','/:id','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','index','get','/describe','isAuthenticated','post'];(function(_0x144220,_0x24a156){var _0x3c92a4=function(_0x299fb3){while(--_0x299fb3){_0x144220['push'](_0x144220['shift']());}};_0x3c92a4(++_0x24a156);}(_0x1231,0x1cc));var _0x1123=function(_0xb5c2e1,_0x3b2db2){_0xb5c2e1=_0xb5c2e1-0x0;var _0x3c5a5b=_0x1231[_0xb5c2e1];return _0x3c5a5b;};'use strict';var multer=require(_0x1123('0x0'));var util=require(_0x1123('0x1'));var path=require(_0x1123('0x2'));var timeout=require(_0x1123('0x3'));var express=require(_0x1123('0x4'));var router=express[_0x1123('0x5')]();var fs_extra=require(_0x1123('0x6'));var auth=require(_0x1123('0x7'));var interaction=require(_0x1123('0x8'));var config=require('../../config/environment');var controller=require(_0x1123('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1123('0xa')]);router[_0x1123('0xb')](_0x1123('0xc'),auth[_0x1123('0xd')](),controller['describe']);router[_0x1123('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1123('0xe')]('/',auth[_0x1123('0xd')](),interaction['tracked']('chat',_0x1123('0xf')),controller[_0x1123('0x10')]);router[_0x1123('0x11')](_0x1123('0x12'),controller['update']);router[_0x1123('0x11')](_0x1123('0x13'),auth[_0x1123('0xd')](),controller['accept']);router['put'](_0x1123('0x14'),auth[_0x1123('0xd')](),controller[_0x1123('0x15')]);router[_0x1123('0x16')](_0x1123('0x12'),auth[_0x1123('0xd')](),controller[_0x1123('0x17')]);module[_0x1123('0x18')]=router;
\ No newline at end of file
+var _0x685d=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','tracked','chatmessage:create','create','/:id','put','/:id/accept','/:id/reject'];(function(_0xa74972,_0x4148b3){var _0x172494=function(_0x3e2a3d){while(--_0x3e2a3d){_0xa74972['push'](_0xa74972['shift']());}};_0x172494(++_0x4148b3);}(_0x685d,0x99));var _0xd685=function(_0x292d80,_0x18a9ab){_0x292d80=_0x292d80-0x0;var _0x464d14=_0x685d[_0x292d80];return _0x464d14;};'use strict';var multer=require(_0xd685('0x0'));var util=require(_0xd685('0x1'));var path=require(_0xd685('0x2'));var timeout=require(_0xd685('0x3'));var express=require(_0xd685('0x4'));var router=express['Router']();var fs_extra=require(_0xd685('0x5'));var auth=require(_0xd685('0x6'));var interaction=require(_0xd685('0x7'));var config=require(_0xd685('0x8'));var controller=require(_0xd685('0x9'));router[_0xd685('0xa')]('/',auth[_0xd685('0xb')](),controller['index']);router['get'](_0xd685('0xc'),auth['isAuthenticated'](),controller[_0xd685('0xd')]);router[_0xd685('0xa')]('/:id',auth[_0xd685('0xb')](),controller[_0xd685('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xd685('0xf')]('chat',_0xd685('0x10')),controller[_0xd685('0x11')]);router['put'](_0xd685('0x12'),controller['update']);router[_0xd685('0x13')](_0xd685('0x14'),auth[_0xd685('0xb')](),controller['accept']);router[_0xd685('0x13')](_0xd685('0x15'),auth[_0xd685('0xb')](),controller['reject']);router[_0xd685('0x16')](_0xd685('0x12'),auth['isAuthenticated'](),controller[_0xd685('0x17')]);module[_0xd685('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index b29667d..e6bfa3c 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 _0x2032=['medium','exports','TEXT'];(function(_0x295876,_0x3e51c0){var _0x2b7b65=function(_0x586d48){while(--_0x586d48){_0x295876['push'](_0x295876['shift']());}};_0x2b7b65(++_0x3e51c0);}(_0x2032,0xd9));var _0x2203=function(_0x244f37,_0x3121a3){_0x244f37=_0x244f37-0x0;var _0x5b3cd7=_0x2032[_0x244f37];return _0x5b3cd7;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x1b1ed8,_0x2b0f38){var _0x33e1d6=function(_0x545491){while(--_0x545491){_0x1b1ed8['push'](_0x1b1ed8['shift']());}};_0x33e1d6(++_0x2b0f38);}(_0x2032,0xd9));var _0x2203=function(_0x39b4b4,_0x2255c1){_0x39b4b4=_0x39b4b4-0x0;var _0x142af1=_0x2032[_0x39b4b4];return _0x142af1;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index a8c9406..9b4a7ba 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2ef3f7,_0x596a24){var _0x17afcc=function(_0x47f557){while(--_0x47f557){_0x2ef3f7['push'](_0x2ef3f7['shift']());}};_0x17afcc(++_0x596a24);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x7a54,0x106));var _0x47a5=function(_0x55d236,_0x33e798){_0x55d236=_0x55d236-0x0;var _0x1bc851=_0x7a54[_0x55d236];return _0x1bc851;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 5ddb134..ede407e 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 _0xb5f1=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x520ef4,_0x424164){var _0x59908f=function(_0xfcf439){while(--_0xfcf439){_0x520ef4['push'](_0x520ef4['shift']());}};_0x59908f(++_0x424164);}(_0xb5f1,0x150));var _0x1b5f=function(_0x15201a,_0x10eedb){_0x15201a=_0x15201a-0x0;var _0x5640ee=_0xb5f1[_0x15201a];return _0x5640ee;};'use strict';var EventEmitter=require(_0x1b5f('0x0'));var ChatOfflineMessage=require(_0x1b5f('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1b5f('0x2')](0x0);var events={'afterCreate':_0x1b5f('0x3'),'afterUpdate':_0x1b5f('0x4'),'afterDestroy':_0x1b5f('0x5')};function emitEvent(_0x361326){return function(_0x49f2a6,_0x6c0add,_0x40ee35){ChatOfflineMessageEvents[_0x1b5f('0x6')](_0x361326+':'+_0x49f2a6['id'],_0x49f2a6);ChatOfflineMessageEvents['emit'](_0x361326,_0x49f2a6);_0x40ee35(null);};}for(var e in events){if(events[_0x1b5f('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x1b5f('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x4a6d=['hook','exports','../../mysqldb','save','update','remove','hasOwnProperty'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4a6d,0x121));var _0xd4a6=function(_0x45c943,_0xb1e866){_0x45c943=_0x45c943-0x0;var _0x5a254b=_0x4a6d[_0x45c943];return _0x5a254b;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xd4a6('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4a6('0x1'),'afterUpdate':_0xd4a6('0x2'),'afterDestroy':_0xd4a6('0x3')};function emitEvent(_0x9cfdf){return function(_0x49994a,_0x13fd34,_0x4ec60f){ChatOfflineMessageEvents['emit'](_0x9cfdf+':'+_0x49994a['id'],_0x49994a);ChatOfflineMessageEvents['emit'](_0x9cfdf,_0x49994a);_0x4ec60f(null);};}for(var e in events){if(events[_0xd4a6('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xd4a6('0x5')](e,emitEvent(event));}}module[_0xd4a6('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 7e16df9..b0efea4 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 _0x9459=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4d2fae,_0x24b77e){var _0x1c7710=function(_0x5279fa){while(--_0x5279fa){_0x4d2fae['push'](_0x4d2fae['shift']());}};_0x1c7710(++_0x24b77e);}(_0x9459,0xe7));var _0x9945=function(_0x67cfd6,_0x13725a){_0x67cfd6=_0x67cfd6-0x0;var _0x59d49e=_0x9459[_0x67cfd6];return _0x59d49e;};'use strict';var attributes=require(_0x9945('0x0'));module[_0x9945('0x1')]=function(_0x527611){return _0x527611[_0x9945('0x2')](_0x9945('0x3'),attributes,{'tableName':_0x9945('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9945('0x5'),'collate':_0x9945('0x6')});};
\ No newline at end of file
+var _0xca48=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xca48,0x181));var _0x8ca4=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0xca48[_0x283127];return _0x43da5d;};'use strict';var attributes=require(_0x8ca4('0x0'));module['exports']=function(_0x1c10d5){return _0x1c10d5[_0x8ca4('0x1')](_0x8ca4('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8ca4('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 4c9e6d8..8e7d480 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 _0x2e49=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2e49,0x175));var _0x92e4=function(_0x30bfbe,_0xa5df3f){_0x30bfbe=_0x30bfbe-0x0;var _0x2d672c=_0x2e49[_0x30bfbe];return _0x2d672c;};'use strict';var _=require(_0x92e4('0x0'));var util=require(_0x92e4('0x1'));var moment=require('moment');var BPromise=require(_0x92e4('0x2'));var rs=require(_0x92e4('0x3'));var fs=require('fs');var Redis=require(_0x92e4('0x4'));var db=require(_0x92e4('0x5'))['db'];var utils=require(_0x92e4('0x6'));var logger=require(_0x92e4('0x7'))(_0x92e4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x92e4('0x9')][_0x92e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3af5fe,_0x5ac19f,_0x57c9cd){return new BPromise(function(_0x44ac6a,_0x37d6d9){return client[_0x92e4('0xb')](_0x3af5fe,_0x57c9cd)[_0x92e4('0xc')](function(_0x299f59){logger['info'](_0x92e4('0xd'),_0x5ac19f,'request\x20sent');logger['debug'](_0x92e4('0xe'),_0x5ac19f,_0x92e4('0xf'),JSON[_0x92e4('0x10')](_0x299f59));if(_0x299f59[_0x92e4('0x11')]){if(_0x299f59[_0x92e4('0x11')]['code']===0x1f4){logger[_0x92e4('0x11')](_0x92e4('0xd'),_0x5ac19f,_0x299f59['error'][_0x92e4('0x12')]);return _0x37d6d9(_0x299f59[_0x92e4('0x11')][_0x92e4('0x12')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5ac19f,_0x299f59['error'][_0x92e4('0x12')]);return _0x44ac6a(_0x299f59['error']['message']);}else{logger[_0x92e4('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5ac19f,_0x92e4('0xf'));_0x44ac6a(_0x299f59[_0x92e4('0x14')]['message']);}})[_0x92e4('0x15')](function(_0x1003b6){logger['error'](_0x92e4('0xd'),_0x5ac19f,_0x1003b6);_0x37d6d9(_0x1003b6);});});}
\ No newline at end of file
+var _0x3836=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment'];(function(_0x11ec5d,_0x144772){var _0x45d165=function(_0x45b124){while(--_0x45b124){_0x11ec5d['push'](_0x11ec5d['shift']());}};_0x45d165(++_0x144772);}(_0x3836,0x140));var _0x6383=function(_0x2304c0,_0xea170e){_0x2304c0=_0x2304c0-0x0;var _0x28eb5e=_0x3836[_0x2304c0];return _0x28eb5e;};'use strict';var _=require(_0x6383('0x0'));var util=require('util');var moment=require(_0x6383('0x1'));var BPromise=require(_0x6383('0x2'));var rs=require(_0x6383('0x3'));var fs=require('fs');var Redis=require(_0x6383('0x4'));var db=require(_0x6383('0x5'))['db'];var utils=require(_0x6383('0x6'));var logger=require('../../config/logger')(_0x6383('0x7'));var config=require(_0x6383('0x8'));var jayson=require(_0x6383('0x9'));var client=jayson[_0x6383('0xa')][_0x6383('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x338653,_0x26e828,_0x25c287){return new BPromise(function(_0x3d2182,_0x5a249e){return client['request'](_0x338653,_0x25c287)[_0x6383('0xc')](function(_0x24b7a4){logger[_0x6383('0xd')](_0x6383('0xe'),_0x26e828,_0x6383('0xf'));logger[_0x6383('0x10')](_0x6383('0x11'),_0x26e828,'request\x20sent',JSON['stringify'](_0x24b7a4));if(_0x24b7a4[_0x6383('0x12')]){if(_0x24b7a4[_0x6383('0x12')][_0x6383('0x13')]===0x1f4){logger[_0x6383('0x12')](_0x6383('0xe'),_0x26e828,_0x24b7a4[_0x6383('0x12')][_0x6383('0x14')]);return _0x5a249e(_0x24b7a4['error']['message']);}logger[_0x6383('0x12')](_0x6383('0xe'),_0x26e828,_0x24b7a4[_0x6383('0x12')][_0x6383('0x14')]);return _0x3d2182(_0x24b7a4[_0x6383('0x12')][_0x6383('0x14')]);}else{logger[_0x6383('0xd')](_0x6383('0xe'),_0x26e828,_0x6383('0xf'));_0x3d2182(_0x24b7a4[_0x6383('0x15')]['message']);}})[_0x6383('0x16')](function(_0x5a0634){logger[_0x6383('0x12')](_0x6383('0xe'),_0x26e828,_0x5a0634);_0x5a249e(_0x5a0634);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 7e8bf64..bbd5522 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 _0x1ea3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x1ea3,0x75));var _0x31ea=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x1ea3[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require(_0x31ea('0x0'));var path=require(_0x31ea('0x1'));var timeout=require(_0x31ea('0x2'));var express=require('express');var router=express[_0x31ea('0x3')]();var fs_extra=require(_0x31ea('0x4'));var auth=require(_0x31ea('0x5'));var interaction=require(_0x31ea('0x6'));var config=require(_0x31ea('0x7'));var controller=require(_0x31ea('0x8'));router[_0x31ea('0x9')]('/',auth[_0x31ea('0xa')](),controller['index']);router[_0x31ea('0x9')]('/describe',auth[_0x31ea('0xa')](),controller[_0x31ea('0xb')]);router[_0x31ea('0x9')](_0x31ea('0xc'),auth[_0x31ea('0xa')](),controller[_0x31ea('0xd')]);router[_0x31ea('0xe')]('/',auth['isAuthenticated'](),controller[_0x31ea('0xf')]);router[_0x31ea('0x10')](_0x31ea('0xc'),auth[_0x31ea('0xa')](),controller['update']);router[_0x31ea('0x11')]('/:id',auth[_0x31ea('0xa')](),controller[_0x31ea('0x12')]);module[_0x31ea('0x13')]=router;
\ No newline at end of file
+var _0x9671=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x11bc7e,_0x999be1){var _0x5056d3=function(_0x5b315f){while(--_0x5b315f){_0x11bc7e['push'](_0x11bc7e['shift']());}};_0x5056d3(++_0x999be1);}(_0x9671,0x6d));var _0x1967=function(_0x279ce7,_0x192ba8){_0x279ce7=_0x279ce7-0x0;var _0x2e4d69=_0x9671[_0x279ce7];return _0x2e4d69;};'use strict';var multer=require(_0x1967('0x0'));var util=require(_0x1967('0x1'));var path=require(_0x1967('0x2'));var timeout=require(_0x1967('0x3'));var express=require(_0x1967('0x4'));var router=express['Router']();var fs_extra=require(_0x1967('0x5'));var auth=require(_0x1967('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1967('0x7'));var controller=require(_0x1967('0x8'));router[_0x1967('0x9')]('/',auth[_0x1967('0xa')](),controller['index']);router[_0x1967('0x9')](_0x1967('0xb'),auth[_0x1967('0xa')](),controller[_0x1967('0xc')]);router[_0x1967('0x9')](_0x1967('0xd'),auth[_0x1967('0xa')](),controller['show']);router[_0x1967('0xe')]('/',auth[_0x1967('0xa')](),controller[_0x1967('0xf')]);router[_0x1967('0x10')]('/:id',auth[_0x1967('0xa')](),controller[_0x1967('0x11')]);router['delete'](_0x1967('0xd'),auth[_0x1967('0xa')](),controller['destroy']);module[_0x1967('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index f645be5..b90fbf3 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 _0xd978=['sequelize','exports','STRING','ENUM','mouseOver','INTEGER'];(function(_0x462d39,_0x275eaa){var _0x2f852e=function(_0x39f232){while(--_0x39f232){_0x462d39['push'](_0x462d39['shift']());}};_0x2f852e(++_0x275eaa);}(_0xd978,0x132));var _0x8d97=function(_0xcb8fde,_0x24399c){_0xcb8fde=_0xcb8fde-0x0;var _0x16dd77=_0xd978[_0xcb8fde];return _0x16dd77;};'use strict';var Sequelize=require(_0x8d97('0x0'));module[_0x8d97('0x1')]={'name':{'type':Sequelize[_0x8d97('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8d97('0x3')](_0x8d97('0x4'),'timeout'),'defaultValue':_0x8d97('0x4')},'selector':{'type':Sequelize[_0x8d97('0x2')]},'timeout':{'type':Sequelize[_0x8d97('0x5')]}};
\ No newline at end of file
+var _0xce5e=['exports','ENUM','mouseOver','timeout','STRING'];(function(_0x1bcad6,_0x1ac0c){var _0x3c8778=function(_0x4d07a9){while(--_0x4d07a9){_0x1bcad6['push'](_0x1bcad6['shift']());}};_0x3c8778(++_0x1ac0c);}(_0xce5e,0x64));var _0xece5=function(_0x230bd0,_0x56529b){_0x230bd0=_0x230bd0-0x0;var _0x1ae9a1=_0xce5e[_0x230bd0];return _0x1ae9a1;};'use strict';var Sequelize=require('sequelize');module[_0xece5('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xece5('0x1')](_0xece5('0x2'),_0xece5('0x3')),'defaultValue':_0xece5('0x2')},'selector':{'type':Sequelize[_0xece5('0x4')]},'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 de81ac4..477d42a 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 _0xf23b=['show','params','ChatProactiveAction','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name'];(function(_0x3f767e,_0x89132c){var _0x4db93f=function(_0xa1419c){while(--_0xa1419c){_0x3f767e['push'](_0x3f767e['shift']());}};_0x4db93f(++_0x89132c);}(_0xf23b,0x133));var _0xbf23=function(_0x300e0d,_0x19220e){_0x300e0d=_0x300e0d-0x0;var _0x46e6f2=_0xf23b[_0x300e0d];return _0x46e6f2;};'use strict';var emlformat=require(_0xbf23('0x0'));var rimraf=require(_0xbf23('0x1'));var zipdir=require(_0xbf23('0x2'));var jsonpatch=require(_0xbf23('0x3'));var rp=require(_0xbf23('0x4'));var moment=require('moment');var BPromise=require(_0xbf23('0x5'));var Mustache=require(_0xbf23('0x6'));var util=require(_0xbf23('0x7'));var path=require('path');var sox=require(_0xbf23('0x8'));var csv=require(_0xbf23('0x9'));var ejs=require(_0xbf23('0xa'));var fs=require('fs');var fs_extra=require(_0xbf23('0xb'));var _=require(_0xbf23('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbf23('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbf23('0x9'));var querystring=require(_0xbf23('0xe'));var Papa=require(_0xbf23('0xf'));var Redis=require(_0xbf23('0x10'));var authService=require(_0xbf23('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbf23('0x12'));var hardwareService=require(_0xbf23('0x13'));var logger=require(_0xbf23('0x14'))(_0xbf23('0x15'));var utils=require(_0xbf23('0x16'));var config=require(_0xbf23('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf23('0x18'))['db'];function respondWithStatusCode(_0x51e816,_0xd01a98){_0xd01a98=_0xd01a98||0xcc;return function(_0x4aea28){if(_0x4aea28){return _0x51e816[_0xbf23('0x19')](_0xd01a98);}return _0x51e816[_0xbf23('0x1a')](_0xd01a98)['end']();};}function respondWithResult(_0xb6880,_0x5a738f){_0x5a738f=_0x5a738f||0xc8;return function(_0x4db531){if(_0x4db531){return _0xb6880[_0xbf23('0x1a')](_0x5a738f)[_0xbf23('0x1b')](_0x4db531);}};}function respondWithFilteredResult(_0x5dd4f9,_0x4cb2a8){return function(_0x1cc52b){if(_0x1cc52b){var _0x581f9a=typeof _0x4cb2a8[_0xbf23('0x1c')]===_0xbf23('0x1d')&&typeof _0x4cb2a8[_0xbf23('0x1e')]===_0xbf23('0x1d');var _0x4c1cca=_0x1cc52b['count'];var _0x58b78f=_0x581f9a?0x0:_0x4cb2a8[_0xbf23('0x1c')];var _0x39f4f3=_0x581f9a?_0x1cc52b[_0xbf23('0x1f')]:_0x4cb2a8[_0xbf23('0x1c')]+_0x4cb2a8['limit'];var _0x9259ca;if(_0x39f4f3>=_0x4c1cca){_0x39f4f3=_0x4c1cca;_0x9259ca=0xc8;}else{_0x9259ca=0xce;}_0x5dd4f9[_0xbf23('0x1a')](_0x9259ca);return _0x5dd4f9[_0xbf23('0x20')]('Content-Range',_0x58b78f+'-'+_0x39f4f3+'/'+_0x4c1cca)[_0xbf23('0x1b')](_0x1cc52b);}return null;};}function patchUpdates(_0x3b6f7e){return function(_0x2bc340){try{jsonpatch[_0xbf23('0x21')](_0x2bc340,_0x3b6f7e,!![]);}catch(_0x570c84){return BPromise[_0xbf23('0x22')](_0x570c84);}return _0x2bc340['save']();};}function saveUpdates(_0xc683e8,_0x5858c7){return function(_0x190d99){if(_0x190d99){return _0x190d99[_0xbf23('0x23')](_0xc683e8)[_0xbf23('0x24')](function(_0x16e0f8){return _0x16e0f8;});}return null;};}function removeEntity(_0x5a4852,_0x5e65c8){return function(_0x5c6e8c){if(_0x5c6e8c){return _0x5c6e8c[_0xbf23('0x25')]()[_0xbf23('0x24')](function(){_0x5a4852['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1896f1,_0xa39dbc){return function(_0x130be4){if(!_0x130be4){_0x1896f1[_0xbf23('0x19')](0x194);}return _0x130be4;};}function handleError(_0x2faf90,_0x1fa3f3){_0x1fa3f3=_0x1fa3f3||0x1f4;return function(_0x30ce6a){logger[_0xbf23('0x26')](_0x30ce6a[_0xbf23('0x27')]);if(_0x30ce6a[_0xbf23('0x28')]){delete _0x30ce6a[_0xbf23('0x28')];}_0x2faf90['status'](_0x1fa3f3)['send'](_0x30ce6a);};}exports[_0xbf23('0x29')]=function(_0x5e6804,_0x2a7baf){var _0x16189f={'raw':!![],'where':{'id':_0x5e6804[_0xbf23('0x2a')]['id']}},_0x58d130={};_0x58d130['model']=_['keys'](db[_0xbf23('0x2b')]['rawAttributes']);_0x58d130[_0xbf23('0x2c')]=_[_0xbf23('0x2d')](_0x5e6804[_0xbf23('0x2c')]);_0x58d130[_0xbf23('0x2e')]=_[_0xbf23('0x2f')](_0x58d130[_0xbf23('0x30')],_0x58d130[_0xbf23('0x2c')]);_0x16189f[_0xbf23('0x31')]=_['intersection'](_0x58d130[_0xbf23('0x30')],qs[_0xbf23('0x32')](_0x5e6804['query']['fields']));_0x16189f[_0xbf23('0x31')]=_0x16189f['attributes'][_0xbf23('0x33')]?_0x16189f[_0xbf23('0x31')]:_0x58d130[_0xbf23('0x30')];if(_0x5e6804[_0xbf23('0x2c')][_0xbf23('0x34')]){_0x16189f[_0xbf23('0x35')]=[{'all':!![]}];}_0x16189f=_['merge']({},_0x16189f,_0x5e6804['options']);return db[_0xbf23('0x2b')][_0xbf23('0x36')](_0x16189f)['then'](handleEntityNotFound(_0x2a7baf,null))[_0xbf23('0x24')](respondWithResult(_0x2a7baf,null))['catch'](handleError(_0x2a7baf,null));};exports['create']=function(_0x1011f0,_0x3c821b){return db[_0xbf23('0x2b')][_0xbf23('0x37')](_0x1011f0['body'],{})[_0xbf23('0x24')](respondWithResult(_0x3c821b,0xc9))[_0xbf23('0x38')](handleError(_0x3c821b,null));};exports[_0xbf23('0x23')]=function(_0x3c9859,_0x272069){if(_0x3c9859['body']['id']){delete _0x3c9859['body']['id'];}return db['ChatProactiveAction'][_0xbf23('0x36')]({'where':{'id':_0x3c9859[_0xbf23('0x2a')]['id']}})['then'](handleEntityNotFound(_0x272069,null))['then'](saveUpdates(_0x3c9859[_0xbf23('0x39')],null))[_0xbf23('0x24')](respondWithResult(_0x272069,null))['catch'](handleError(_0x272069,null));};exports[_0xbf23('0x25')]=function(_0x441e51,_0x4d2ba4){return db[_0xbf23('0x2b')][_0xbf23('0x36')]({'where':{'id':_0x441e51[_0xbf23('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4d2ba4,null))['then'](removeEntity(_0x4d2ba4,null))[_0xbf23('0x38')](handleError(_0x4d2ba4,null));};
\ No newline at end of file
+var _0xc5c7=['query','filters','intersection','attributes','fields','length','include','merge','options','ChatProactiveAction','create','body','catch','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','name','send','show','params','model','keys','rawAttributes'];(function(_0x2900ca,_0x17a523){var _0x36342f=function(_0xeda161){while(--_0xeda161){_0x2900ca['push'](_0x2900ca['shift']());}};_0x36342f(++_0x17a523);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x162ea6,_0x4aecdc){_0x162ea6=_0x162ea6-0x0;var _0x4319ef=_0xc5c7[_0x162ea6];return _0x4319ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c5c('0x0'));var zipdir=require(_0x7c5c('0x1'));var jsonpatch=require(_0x7c5c('0x2'));var rp=require(_0x7c5c('0x3'));var moment=require(_0x7c5c('0x4'));var BPromise=require(_0x7c5c('0x5'));var Mustache=require('mustache');var util=require(_0x7c5c('0x6'));var path=require(_0x7c5c('0x7'));var sox=require(_0x7c5c('0x8'));var csv=require(_0x7c5c('0x9'));var ejs=require(_0x7c5c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7c5c('0xb'));var crypto=require('crypto');var jsforce=require(_0x7c5c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7c5c('0x9'));var querystring=require(_0x7c5c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7c5c('0xe'));var qs=require(_0x7c5c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c5c('0x10'));var logger=require('../../config/logger')(_0x7c5c('0x11'));var utils=require('../../config/utils');var config=require(_0x7c5c('0x12'));var licenseUtil=require(_0x7c5c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207464,_0x326230){_0x326230=_0x326230||0xcc;return function(_0x3f1bb4){if(_0x3f1bb4){return _0x207464[_0x7c5c('0x14')](_0x326230);}return _0x207464[_0x7c5c('0x15')](_0x326230)[_0x7c5c('0x16')]();};}function respondWithResult(_0x184f0f,_0x33a9d2){_0x33a9d2=_0x33a9d2||0xc8;return function(_0x2f2285){if(_0x2f2285){return _0x184f0f[_0x7c5c('0x15')](_0x33a9d2)[_0x7c5c('0x17')](_0x2f2285);}};}function respondWithFilteredResult(_0x31bfdb,_0x2af6b3){return function(_0x1ac739){if(_0x1ac739){var _0x4c5b9d=typeof _0x2af6b3['offset']===_0x7c5c('0x18')&&typeof _0x2af6b3[_0x7c5c('0x19')]===_0x7c5c('0x18');var _0x266aea=_0x1ac739['count'];var _0x41bbee=_0x4c5b9d?0x0:_0x2af6b3[_0x7c5c('0x1a')];var _0x3f9704=_0x4c5b9d?_0x1ac739[_0x7c5c('0x1b')]:_0x2af6b3[_0x7c5c('0x1a')]+_0x2af6b3['limit'];var _0x568a95;if(_0x3f9704>=_0x266aea){_0x3f9704=_0x266aea;_0x568a95=0xc8;}else{_0x568a95=0xce;}_0x31bfdb[_0x7c5c('0x15')](_0x568a95);return _0x31bfdb[_0x7c5c('0x1c')](_0x7c5c('0x1d'),_0x41bbee+'-'+_0x3f9704+'/'+_0x266aea)['json'](_0x1ac739);}return null;};}function patchUpdates(_0x170896){return function(_0x1bf163){try{jsonpatch[_0x7c5c('0x1e')](_0x1bf163,_0x170896,!![]);}catch(_0x469b29){return BPromise[_0x7c5c('0x1f')](_0x469b29);}return _0x1bf163['save']();};}function saveUpdates(_0x28a95f,_0x42a551){return function(_0x116528){if(_0x116528){return _0x116528['update'](_0x28a95f)[_0x7c5c('0x20')](function(_0x42d9a0){return _0x42d9a0;});}return null;};}function removeEntity(_0x536916,_0xccd178){return function(_0x4641f3){if(_0x4641f3){return _0x4641f3[_0x7c5c('0x21')]()[_0x7c5c('0x20')](function(){_0x536916[_0x7c5c('0x15')](0xcc)[_0x7c5c('0x16')]();});}};}function handleEntityNotFound(_0x348da0,_0x348930){return function(_0x4673f8){if(!_0x4673f8){_0x348da0[_0x7c5c('0x14')](0x194);}return _0x4673f8;};}function handleError(_0x56a351,_0x4b9dd8){_0x4b9dd8=_0x4b9dd8||0x1f4;return function(_0x43d38b){logger['error'](_0x43d38b['stack']);if(_0x43d38b[_0x7c5c('0x22')]){delete _0x43d38b['name'];}_0x56a351[_0x7c5c('0x15')](_0x4b9dd8)[_0x7c5c('0x23')](_0x43d38b);};}exports[_0x7c5c('0x24')]=function(_0x1b8d20,_0x54094c){var _0x5de2c1={'raw':!![],'where':{'id':_0x1b8d20[_0x7c5c('0x25')]['id']}},_0x447e0d={};_0x447e0d[_0x7c5c('0x26')]=_[_0x7c5c('0x27')](db['ChatProactiveAction'][_0x7c5c('0x28')]);_0x447e0d[_0x7c5c('0x29')]=_[_0x7c5c('0x27')](_0x1b8d20[_0x7c5c('0x29')]);_0x447e0d[_0x7c5c('0x2a')]=_[_0x7c5c('0x2b')](_0x447e0d[_0x7c5c('0x26')],_0x447e0d['query']);_0x5de2c1[_0x7c5c('0x2c')]=_[_0x7c5c('0x2b')](_0x447e0d['model'],qs[_0x7c5c('0x2d')](_0x1b8d20[_0x7c5c('0x29')][_0x7c5c('0x2d')]));_0x5de2c1[_0x7c5c('0x2c')]=_0x5de2c1['attributes'][_0x7c5c('0x2e')]?_0x5de2c1['attributes']:_0x447e0d[_0x7c5c('0x26')];if(_0x1b8d20[_0x7c5c('0x29')]['includeAll']){_0x5de2c1[_0x7c5c('0x2f')]=[{'all':!![]}];}_0x5de2c1=_[_0x7c5c('0x30')]({},_0x5de2c1,_0x1b8d20[_0x7c5c('0x31')]);return db['ChatProactiveAction']['find'](_0x5de2c1)[_0x7c5c('0x20')](handleEntityNotFound(_0x54094c,null))[_0x7c5c('0x20')](respondWithResult(_0x54094c,null))['catch'](handleError(_0x54094c,null));};exports['create']=function(_0x311f65,_0x49e8ee){return db[_0x7c5c('0x32')][_0x7c5c('0x33')](_0x311f65[_0x7c5c('0x34')],{})[_0x7c5c('0x20')](respondWithResult(_0x49e8ee,0xc9))[_0x7c5c('0x35')](handleError(_0x49e8ee,null));};exports[_0x7c5c('0x36')]=function(_0x4a76f9,_0x27bc9b){if(_0x4a76f9['body']['id']){delete _0x4a76f9[_0x7c5c('0x34')]['id'];}return db[_0x7c5c('0x32')][_0x7c5c('0x37')]({'where':{'id':_0x4a76f9['params']['id']}})[_0x7c5c('0x20')](handleEntityNotFound(_0x27bc9b,null))[_0x7c5c('0x20')](saveUpdates(_0x4a76f9[_0x7c5c('0x34')],null))[_0x7c5c('0x20')](respondWithResult(_0x27bc9b,null))[_0x7c5c('0x35')](handleError(_0x27bc9b,null));};exports[_0x7c5c('0x21')]=function(_0x22e459,_0x2f1734){return db['ChatProactiveAction'][_0x7c5c('0x37')]({'where':{'id':_0x22e459[_0x7c5c('0x25')]['id']}})[_0x7c5c('0x20')](handleEntityNotFound(_0x2f1734,null))[_0x7c5c('0x20')](removeEntity(_0x2f1734,null))[_0x7c5c('0x35')](handleError(_0x2f1734,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 7c081be..7f71701 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 _0xa2fc=['util','../../config/logger','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','lodash'];(function(_0x4a7193,_0x5fa9a5){var _0x417395=function(_0x10e155){while(--_0x10e155){_0x4a7193['push'](_0x4a7193['shift']());}};_0x417395(++_0x5fa9a5);}(_0xa2fc,0x8f));var _0xca2f=function(_0x4b7e4d,_0x82d2ab){_0x4b7e4d=_0x4b7e4d-0x0;var _0x38d6af=_0xa2fc[_0x4b7e4d];return _0x38d6af;};'use strict';var _=require(_0xca2f('0x0'));var util=require(_0xca2f('0x1'));var logger=require(_0xca2f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xca2f('0x3'));var rp=require(_0xca2f('0x4'));var fs=require('fs');var path=require(_0xca2f('0x5'));var rimraf=require(_0xca2f('0x6'));var config=require('../../config/environment');var attributes=require(_0xca2f('0x7'));module[_0xca2f('0x8')]=function(_0x374dc0,_0x4d414c){return _0x374dc0['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cc3=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','util'];(function(_0x1af9ed,_0x313f91){var _0x30206e=function(_0x211c37){while(--_0x211c37){_0x1af9ed['push'](_0x1af9ed['shift']());}};_0x30206e(++_0x313f91);}(_0x7cc3,0x1a1));var _0x37cc=function(_0x221853,_0xe338ab){_0x221853=_0x221853-0x0;var _0x3d725f=_0x7cc3[_0x221853];return _0x3d725f;};'use strict';var _=require('lodash');var util=require(_0x37cc('0x0'));var logger=require(_0x37cc('0x1'))(_0x37cc('0x2'));var moment=require(_0x37cc('0x3'));var BPromise=require('bluebird');var rp=require(_0x37cc('0x4'));var fs=require('fs');var path=require(_0x37cc('0x5'));var rimraf=require('rimraf');var config=require(_0x37cc('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x37cc('0x7')]=function(_0x53ecc8,_0x3f4bb9){return _0x53ecc8[_0x37cc('0x8')](_0x37cc('0x9'),attributes,{'tableName':_0x37cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 9ceb7d7..bd6bb43 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 _0x8403=['request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise'];(function(_0x27d614,_0x4bf4d6){var _0x378d4e=function(_0x489e04){while(--_0x489e04){_0x27d614['push'](_0x27d614['shift']());}};_0x378d4e(++_0x4bf4d6);}(_0x8403,0x119));var _0x3840=function(_0x239de7,_0x4f2574){_0x239de7=_0x239de7-0x0;var _0x4020a0=_0x8403[_0x239de7];return _0x4020a0;};'use strict';var _=require('lodash');var util=require(_0x3840('0x0'));var moment=require(_0x3840('0x1'));var BPromise=require(_0x3840('0x2'));var rs=require(_0x3840('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3840('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x3840('0x5'));var jayson=require(_0x3840('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x298ed1,_0x283cba,_0x29c078){return new BPromise(function(_0x52d449,_0x3a5c4a){return client[_0x3840('0x7')](_0x298ed1,_0x29c078)['then'](function(_0x235b12){logger['info'](_0x3840('0x8'),_0x283cba,_0x3840('0x9'));logger[_0x3840('0xa')](_0x3840('0xb'),_0x283cba,_0x3840('0x9'),JSON[_0x3840('0xc')](_0x235b12));if(_0x235b12[_0x3840('0xd')]){if(_0x235b12[_0x3840('0xd')][_0x3840('0xe')]===0x1f4){logger[_0x3840('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x283cba,_0x235b12[_0x3840('0xd')][_0x3840('0xf')]);return _0x3a5c4a(_0x235b12[_0x3840('0xd')][_0x3840('0xf')]);}logger[_0x3840('0xd')](_0x3840('0x8'),_0x283cba,_0x235b12[_0x3840('0xd')][_0x3840('0xf')]);return _0x52d449(_0x235b12[_0x3840('0xd')][_0x3840('0xf')]);}else{logger[_0x3840('0x10')](_0x3840('0x8'),_0x283cba,_0x3840('0x9'));_0x52d449(_0x235b12['result'][_0x3840('0xf')]);}})[_0x3840('0x11')](function(_0x3ae7cb){logger['error'](_0x3840('0x8'),_0x283cba,_0x3ae7cb);_0x3a5c4a(_0x3ae7cb);});});}
\ No newline at end of file
+var _0xfb2c=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x13327e,_0x855c59){var _0x10dae8=function(_0x4eab79){while(--_0x4eab79){_0x13327e['push'](_0x13327e['shift']());}};_0x10dae8(++_0x855c59);}(_0xfb2c,0x9b));var _0xcfb2=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xfb2c[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0xcfb2('0x0'));var util=require(_0xcfb2('0x1'));var moment=require('moment');var BPromise=require(_0xcfb2('0x2'));var rs=require(_0xcfb2('0x3'));var fs=require('fs');var Redis=require(_0xcfb2('0x4'));var db=require(_0xcfb2('0x5'))['db'];var utils=require(_0xcfb2('0x6'));var logger=require(_0xcfb2('0x7'))(_0xcfb2('0x8'));var config=require(_0xcfb2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcfb2('0xa')][_0xcfb2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x423b8a,_0x5a674a,_0x47ee54){return new BPromise(function(_0xa67587,_0x45ac06){return client['request'](_0x423b8a,_0x47ee54)[_0xcfb2('0xc')](function(_0x1131aa){logger['info'](_0xcfb2('0xd'),_0x5a674a,_0xcfb2('0xe'));logger[_0xcfb2('0xf')](_0xcfb2('0x10'),_0x5a674a,_0xcfb2('0xe'),JSON[_0xcfb2('0x11')](_0x1131aa));if(_0x1131aa['error']){if(_0x1131aa[_0xcfb2('0x12')]['code']===0x1f4){logger[_0xcfb2('0x12')](_0xcfb2('0xd'),_0x5a674a,_0x1131aa[_0xcfb2('0x12')]['message']);return _0x45ac06(_0x1131aa[_0xcfb2('0x12')][_0xcfb2('0x13')]);}logger[_0xcfb2('0x12')](_0xcfb2('0xd'),_0x5a674a,_0x1131aa[_0xcfb2('0x12')][_0xcfb2('0x13')]);return _0xa67587(_0x1131aa[_0xcfb2('0x12')][_0xcfb2('0x13')]);}else{logger[_0xcfb2('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x5a674a,'request\x20sent');_0xa67587(_0x1131aa[_0xcfb2('0x15')][_0xcfb2('0x13')]);}})[_0xcfb2('0x16')](function(_0x29645f){logger['error'](_0xcfb2('0xd'),_0x5a674a,_0x29645f);_0x45ac06(_0x29645f);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c856977..2c582e2 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 _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xb138,0x1dd));var _0x8b13=function(_0x28f51b,_0x2a063b){_0x28f51b=_0x28f51b-0x0;var _0x2dc6ff=_0xb138[_0x28f51b];return _0x2dc6ff;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router;
\ No newline at end of file
+var _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x8c697,_0x5f32fd){var _0x290bd5=function(_0x35d768){while(--_0x35d768){_0x8c697['push'](_0x8c697['shift']());}};_0x290bd5(++_0x5f32fd);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x36147b,_0x57f40b){_0x36147b=_0x36147b-0x0;var _0x141351=_0xf2ca[_0x36147b];return _0x141351;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index a6a71e0..9336c88 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 _0x5aa1=['STRING','name','ENUM','sequelize','exports'];(function(_0x18f9e6,_0x6ec00){var _0x3aa805=function(_0x2e32ff){while(--_0x2e32ff){_0x18f9e6['push'](_0x18f9e6['shift']());}};_0x3aa805(++_0x6ec00);}(_0x5aa1,0xbc));var _0x15aa=function(_0xaef3d3,_0x174e0a){_0xaef3d3=_0xaef3d3-0x0;var _0x16c2db=_0x5aa1[_0xaef3d3];return _0x16c2db;};'use strict';var Sequelize=require(_0x15aa('0x0'));module[_0x15aa('0x1')]={'name':{'type':Sequelize[_0x15aa('0x2')],'unique':_0x15aa('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x15aa('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x15aa('0x4')]('rrmemory','beepall','roundrobin')}};
\ No newline at end of file
+var _0x5414=['beepall','roundrobin','sequelize','exports','name','STRING','ENUM'];(function(_0x1ad659,_0x1ab26a){var _0x56d7e2=function(_0x3c3f02){while(--_0x3c3f02){_0x1ad659['push'](_0x1ad659['shift']());}};_0x56d7e2(++_0x1ab26a);}(_0x5414,0x121));var _0x4541=function(_0x1bf956,_0x88182a){_0x1bf956=_0x1bf956-0x0;var _0x10b8dc=_0x5414[_0x1bf956];return _0x10b8dc;};'use strict';var Sequelize=require(_0x4541('0x0'));module[_0x4541('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4541('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4541('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4541('0x4')]('rrmemory',_0x4541('0x5'),_0x4541('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c2e2d92..13fccf4 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 _0x8dc4=['intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','hasOwnProperty','pick','ChatQueueId','filter','User','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','addTeams','each','UserChatQueue','findOrCreate','emit','select','tq.TeamId','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','get','ChatQueues','UserProfileResource','stack','name','index','ChatQueue','rawAttributes','fieldName','type','key','map','query','filters'];(function(_0x8261bb,_0x48e718){var _0x530867=function(_0x4b2b4e){while(--_0x4b2b4e){_0x8261bb['push'](_0x8261bb['shift']());}};_0x530867(++_0x48e718);}(_0x8dc4,0x185));var _0x48dc=function(_0x566269,_0x423f18){_0x566269=_0x566269-0x0;var _0x4ffd0a=_0x8dc4[_0x566269];return _0x4ffd0a;};'use strict';var emlformat=require(_0x48dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48dc('0x1'));var jsonpatch=require(_0x48dc('0x2'));var rp=require(_0x48dc('0x3'));var moment=require(_0x48dc('0x4'));var BPromise=require(_0x48dc('0x5'));var Mustache=require(_0x48dc('0x6'));var util=require(_0x48dc('0x7'));var path=require(_0x48dc('0x8'));var sox=require(_0x48dc('0x9'));var csv=require(_0x48dc('0xa'));var ejs=require(_0x48dc('0xb'));var fs=require('fs');var fs_extra=require(_0x48dc('0xc'));var _=require('lodash');var squel=require(_0x48dc('0xd'));var crypto=require(_0x48dc('0xe'));var jsforce=require(_0x48dc('0xf'));var deskjs=require(_0x48dc('0x10'));var toCsv=require(_0x48dc('0xa'));var querystring=require(_0x48dc('0x11'));var Papa=require('papaparse');var Redis=require(_0x48dc('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x48dc('0x13'));var hardwareService=require(_0x48dc('0x14'));var logger=require(_0x48dc('0x15'))('api');var utils=require(_0x48dc('0x16'));var config=require(_0x48dc('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x48dc('0x18')],{'host':_0x48dc('0x19'),'port':0x18eb});var socket=require(_0x48dc('0x1a'))(new Redis(config[_0x48dc('0x18')]));require(_0x48dc('0x1b'))[_0x48dc('0x1c')](socket);var jayson=require(_0x48dc('0x1d'));var client=jayson[_0x48dc('0x1e')][_0x48dc('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x522238,_0x25cba8,_0x911d77,_0x1a3b5d){return new BPromise(function(_0x3866c7,_0x29c82f){var _0x59cdf4=_0x1a3b5d||client;return _0x59cdf4[_0x48dc('0x20')](_0x522238,_0x911d77)[_0x48dc('0x21')](function(_0x143996){logger[_0x48dc('0x22')]('ChatQueue,\x20%s,\x20%s',_0x25cba8,_0x48dc('0x23'));logger[_0x48dc('0x24')](_0x48dc('0x25'),_0x25cba8,_0x48dc('0x23'),JSON[_0x48dc('0x26')](_0x143996));if(_0x143996[_0x48dc('0x27')]){if(_0x143996[_0x48dc('0x27')]['code']===0x1f4){logger[_0x48dc('0x27')](_0x48dc('0x28'),_0x25cba8,_0x143996['error'][_0x48dc('0x29')]);return _0x29c82f(_0x143996[_0x48dc('0x27')]['message']);}logger[_0x48dc('0x27')]('ChatQueue,\x20%s,\x20%s',_0x25cba8,_0x143996[_0x48dc('0x27')]['message']);return _0x3866c7(_0x143996[_0x48dc('0x27')][_0x48dc('0x29')]);}else{logger[_0x48dc('0x22')](_0x48dc('0x28'),_0x25cba8,_0x48dc('0x23'));_0x3866c7(_0x143996[_0x48dc('0x2a')][_0x48dc('0x29')]);}})[_0x48dc('0x2b')](function(_0x39397b){logger[_0x48dc('0x27')](_0x48dc('0x28'),_0x25cba8,_0x39397b);_0x29c82f(_0x39397b);});});}function respondWithStatusCode(_0x555041,_0x14b8d6){_0x14b8d6=_0x14b8d6||0xcc;return function(_0x15fb91){if(_0x15fb91){return _0x555041[_0x48dc('0x2c')](_0x14b8d6);}return _0x555041['status'](_0x14b8d6)[_0x48dc('0x2d')]();};}function respondWithResult(_0x4061cf,_0x5b3138){_0x5b3138=_0x5b3138||0xc8;return function(_0x54dd1d){if(_0x54dd1d){return _0x4061cf[_0x48dc('0x2e')](_0x5b3138)[_0x48dc('0x2f')](_0x54dd1d);}};}function respondWithFilteredResult(_0x4a4b33,_0x430a21){return function(_0x1dd02c){if(_0x1dd02c){var _0x58be07=typeof _0x430a21[_0x48dc('0x30')]===_0x48dc('0x31')&&typeof _0x430a21[_0x48dc('0x32')]===_0x48dc('0x31');var _0x25b637=_0x1dd02c['count'];var _0x5d50f7=_0x58be07?0x0:_0x430a21['offset'];var _0x54c7c7=_0x58be07?_0x1dd02c[_0x48dc('0x33')]:_0x430a21[_0x48dc('0x30')]+_0x430a21[_0x48dc('0x32')];var _0x2c0fa1;if(_0x54c7c7>=_0x25b637){_0x54c7c7=_0x25b637;_0x2c0fa1=0xc8;}else{_0x2c0fa1=0xce;}_0x4a4b33[_0x48dc('0x2e')](_0x2c0fa1);return _0x4a4b33['set'](_0x48dc('0x34'),_0x5d50f7+'-'+_0x54c7c7+'/'+_0x25b637)[_0x48dc('0x2f')](_0x1dd02c);}return null;};}function patchUpdates(_0x30b1f5){return function(_0x13cd3e){try{jsonpatch[_0x48dc('0x35')](_0x13cd3e,_0x30b1f5,!![]);}catch(_0x1767c5){return BPromise['reject'](_0x1767c5);}return _0x13cd3e[_0x48dc('0x36')]();};}function saveUpdates(_0x39904c,_0x243c1b){return function(_0x5a6d96){if(_0x5a6d96){return _0x5a6d96['update'](_0x39904c)[_0x48dc('0x21')](function(_0x51c562){return _0x51c562;});}return null;};}function removeEntity(_0x33be66,_0x35630c){return function(_0x1bf5e1){if(_0x1bf5e1){return _0x1bf5e1[_0x48dc('0x37')]()['then'](function(){var _0xad5762=_0x1bf5e1[_0x48dc('0x38')]({'plain':!![]});var _0x2d5f30=_0x48dc('0x39');return db[_0x48dc('0x3a')][_0x48dc('0x37')]({'where':{'type':_0x2d5f30,'resourceId':_0xad5762['id']}})[_0x48dc('0x21')](function(){return _0x1bf5e1;});})[_0x48dc('0x21')](function(){_0x33be66[_0x48dc('0x2e')](0xcc)[_0x48dc('0x2d')]();});}};}function handleEntityNotFound(_0xe4449c,_0x2ed60d){return function(_0x592e88){if(!_0x592e88){_0xe4449c[_0x48dc('0x2c')](0x194);}return _0x592e88;};}function handleError(_0x951b35,_0x2958a){_0x2958a=_0x2958a||0x1f4;return function(_0x545f68){logger[_0x48dc('0x27')](_0x545f68[_0x48dc('0x3b')]);if(_0x545f68['name']){delete _0x545f68[_0x48dc('0x3c')];}_0x951b35[_0x48dc('0x2e')](_0x2958a)['send'](_0x545f68);};}exports[_0x48dc('0x3d')]=function(_0x4f090e,_0x14a667){var _0xbd022c={},_0x3817fe={},_0x54bc1d={'count':0x0,'rows':[]};var _0x2478bc=_['map'](db[_0x48dc('0x3e')][_0x48dc('0x3f')],function(_0x299017){return{'name':_0x299017[_0x48dc('0x40')],'type':_0x299017[_0x48dc('0x41')][_0x48dc('0x42')]};});_0x3817fe['model']=_[_0x48dc('0x43')](_0x2478bc,_0x48dc('0x3c'));_0x3817fe[_0x48dc('0x44')]=_['keys'](_0x4f090e[_0x48dc('0x44')]);_0x3817fe[_0x48dc('0x45')]=_[_0x48dc('0x46')](_0x3817fe[_0x48dc('0x47')],_0x3817fe[_0x48dc('0x44')]);_0xbd022c[_0x48dc('0x48')]=_[_0x48dc('0x46')](_0x3817fe[_0x48dc('0x47')],qs[_0x48dc('0x49')](_0x4f090e[_0x48dc('0x44')]['fields']));_0xbd022c[_0x48dc('0x48')]=_0xbd022c['attributes'][_0x48dc('0x4a')]?_0xbd022c[_0x48dc('0x48')]:_0x3817fe[_0x48dc('0x47')];if(!_0x4f090e[_0x48dc('0x44')]['hasOwnProperty'](_0x48dc('0x4b'))){_0xbd022c[_0x48dc('0x32')]=qs[_0x48dc('0x32')](_0x4f090e[_0x48dc('0x44')][_0x48dc('0x32')]);_0xbd022c[_0x48dc('0x30')]=qs['offset'](_0x4f090e['query'][_0x48dc('0x30')]);}_0xbd022c[_0x48dc('0x4c')]=qs[_0x48dc('0x4d')](_0x4f090e[_0x48dc('0x44')]['sort']);_0xbd022c[_0x48dc('0x4e')]=qs[_0x48dc('0x45')](_['pick'](_0x4f090e['query'],_0x3817fe[_0x48dc('0x45')]),_0x2478bc);if(_0x4f090e[_0x48dc('0x44')]['filter']){_0xbd022c['where']=_[_0x48dc('0x4f')](_0xbd022c[_0x48dc('0x4e')],{'$or':_[_0x48dc('0x43')](_0x2478bc,function(_0x3eb7a5){if(_0x3eb7a5[_0x48dc('0x41')]!==_0x48dc('0x50')){var _0x2b09e3={};_0x2b09e3[_0x3eb7a5[_0x48dc('0x3c')]]={'$like':'%'+_0x4f090e[_0x48dc('0x44')]['filter']+'%'};return _0x2b09e3;}})});}_0xbd022c=_[_0x48dc('0x4f')]({},_0xbd022c,_0x4f090e[_0x48dc('0x51')]);var _0x17e566={'where':_0xbd022c[_0x48dc('0x4e')]};return db[_0x48dc('0x3e')][_0x48dc('0x33')](_0x17e566)['then'](function(_0x2754a8){_0x54bc1d[_0x48dc('0x33')]=_0x2754a8;if(_0x4f090e[_0x48dc('0x44')][_0x48dc('0x52')]){_0xbd022c[_0x48dc('0x53')]=[{'all':!![]}];}return db[_0x48dc('0x3e')][_0x48dc('0x54')](_0xbd022c);})[_0x48dc('0x21')](function(_0x4a7c2f){_0x54bc1d['rows']=_0x4a7c2f;return _0x54bc1d;})[_0x48dc('0x21')](respondWithFilteredResult(_0x14a667,_0xbd022c))['catch'](handleError(_0x14a667,null));};exports[_0x48dc('0x55')]=function(_0x1bcf7c,_0xa45291){var _0x3a422f={'raw':!![],'where':{'id':_0x1bcf7c[_0x48dc('0x56')]['id']}},_0x52aa39={};_0x52aa39[_0x48dc('0x47')]=_['keys'](db[_0x48dc('0x3e')][_0x48dc('0x3f')]);_0x52aa39[_0x48dc('0x44')]=_[_0x48dc('0x57')](_0x1bcf7c[_0x48dc('0x44')]);_0x52aa39['filters']=_[_0x48dc('0x46')](_0x52aa39['model'],_0x52aa39['query']);_0x3a422f['attributes']=_['intersection'](_0x52aa39[_0x48dc('0x47')],qs[_0x48dc('0x49')](_0x1bcf7c[_0x48dc('0x44')]['fields']));_0x3a422f[_0x48dc('0x48')]=_0x3a422f[_0x48dc('0x48')][_0x48dc('0x4a')]?_0x3a422f[_0x48dc('0x48')]:_0x52aa39[_0x48dc('0x47')];if(_0x1bcf7c[_0x48dc('0x44')][_0x48dc('0x52')]){_0x3a422f[_0x48dc('0x53')]=[{'all':!![]}];}_0x3a422f=_[_0x48dc('0x4f')]({},_0x3a422f,_0x1bcf7c[_0x48dc('0x51')]);return db[_0x48dc('0x3e')][_0x48dc('0x58')](_0x3a422f)['then'](handleEntityNotFound(_0xa45291,null))[_0x48dc('0x21')](respondWithResult(_0xa45291,null))[_0x48dc('0x2b')](handleError(_0xa45291,null));};exports[_0x48dc('0x59')]=function(_0x1da67f,_0x3fc6c5){return db[_0x48dc('0x3e')][_0x48dc('0x59')](_0x1da67f[_0x48dc('0x5a')],{})[_0x48dc('0x21')](function(_0xe8306d){var _0x2d9312=_0x1da67f['user'][_0x48dc('0x38')]({'plain':!![]});if(!_0x2d9312)throw new Error(_0x48dc('0x5b'));if(_0x2d9312[_0x48dc('0x5c')]==='user'){var _0x58cb3f=_0xe8306d['get']({'plain':!![]});var _0x471c5c=_0x48dc('0x39');return db[_0x48dc('0x5d')][_0x48dc('0x58')]({'where':{'name':_0x471c5c,'userProfileId':_0x2d9312[_0x48dc('0x5e')]},'raw':!![]})['then'](function(_0x30e99b){if(_0x30e99b&&_0x30e99b[_0x48dc('0x5f')]===0x0){return db['UserProfileResource'][_0x48dc('0x59')]({'name':_0x58cb3f['name'],'resourceId':_0x58cb3f['id'],'type':_0x30e99b['name'],'sectionId':_0x30e99b['id']},{})['then'](function(){return _0xe8306d;});}else{return _0xe8306d;}})[_0x48dc('0x2b')](function(_0x3e1711){logger[_0x48dc('0x27')](_0x48dc('0x60'),_0x3e1711);throw _0x3e1711;});}return _0xe8306d;})[_0x48dc('0x21')](respondWithResult(_0x3fc6c5,0xc9))[_0x48dc('0x2b')](handleError(_0x3fc6c5,null));};exports[_0x48dc('0x61')]=function(_0x107bee,_0x28f08a){if(_0x107bee['body']['id']){delete _0x107bee[_0x48dc('0x5a')]['id'];}return db['ChatQueue'][_0x48dc('0x58')]({'where':{'id':_0x107bee['params']['id']}})['then'](handleEntityNotFound(_0x28f08a,null))[_0x48dc('0x21')](saveUpdates(_0x107bee[_0x48dc('0x5a')],null))[_0x48dc('0x21')](respondWithResult(_0x28f08a,null))['catch'](handleError(_0x28f08a,null));};exports['destroy']=function(_0x384810,_0x30e112){return db['ChatQueue'][_0x48dc('0x58')]({'where':{'id':_0x384810[_0x48dc('0x56')]['id']}})['then'](handleEntityNotFound(_0x30e112,null))['then'](removeEntity(_0x30e112,null))[_0x48dc('0x2b')](handleError(_0x30e112,null));};exports['describe']=function(_0x5f009f,_0x1a772f){return db[_0x48dc('0x3e')][_0x48dc('0x62')]()[_0x48dc('0x21')](respondWithResult(_0x1a772f,null))[_0x48dc('0x2b')](handleError(_0x1a772f,null));};exports[_0x48dc('0x63')]=function(_0x562e84,_0x3f95bc,_0x5d944d){var _0x2319af={'raw':!![],'where':{}},_0x251f33={},_0x552e45;return db[_0x48dc('0x3e')][_0x48dc('0x64')]({'where':{'id':_0x562e84[_0x48dc('0x56')]['id']}})[_0x48dc('0x21')](handleEntityNotFound(_0x3f95bc,null))[_0x48dc('0x21')](function(_0x32bb1c){if(_0x32bb1c){_0x552e45=_0x32bb1c[_0x48dc('0x38')]({'plain':!![]});_0x251f33['model']=_[_0x48dc('0x57')](db['UserChatQueue'][_0x48dc('0x3f')]);_0x251f33[_0x48dc('0x44')]=_[_0x48dc('0x57')](_0x562e84['query']);_0x251f33['filters']=_[_0x48dc('0x46')](_0x251f33[_0x48dc('0x47')],_0x251f33[_0x48dc('0x44')]);_0x2319af[_0x48dc('0x48')]=_[_0x48dc('0x46')](_0x251f33[_0x48dc('0x47')],qs[_0x48dc('0x49')](_0x562e84[_0x48dc('0x44')][_0x48dc('0x49')]));_0x2319af[_0x48dc('0x48')]=_0x2319af[_0x48dc('0x48')]['length']?_0x2319af[_0x48dc('0x48')]:_0x251f33[_0x48dc('0x47')];if(!_0x562e84[_0x48dc('0x44')][_0x48dc('0x65')](_0x48dc('0x4b'))){_0x2319af[_0x48dc('0x32')]=qs['limit'](_0x562e84['query'][_0x48dc('0x32')]);_0x2319af[_0x48dc('0x30')]=qs['offset'](_0x562e84[_0x48dc('0x44')][_0x48dc('0x30')]);}_0x2319af[_0x48dc('0x4c')]=qs[_0x48dc('0x4d')](_0x562e84[_0x48dc('0x44')][_0x48dc('0x4d')]);_0x2319af[_0x48dc('0x4e')]=qs[_0x48dc('0x45')](_[_0x48dc('0x66')](_0x562e84[_0x48dc('0x44')],_0x251f33[_0x48dc('0x45')]));_0x2319af['where'][_0x48dc('0x67')]=_0x32bb1c['id'];if(_0x562e84[_0x48dc('0x44')][_0x48dc('0x68')]){_0x2319af[_0x48dc('0x4e')]=_['merge'](_0x2319af[_0x48dc('0x4e')],{'$or':_[_0x48dc('0x43')](_0x2319af['attributes'],function(_0x4f96a8){var _0x5244ff={};_0x5244ff[_0x4f96a8]={'$like':'%'+_0x562e84[_0x48dc('0x44')][_0x48dc('0x68')]+'%'};return _0x5244ff;})});}_0x2319af=_['merge']({},_0x2319af,_0x562e84[_0x48dc('0x51')]);return db['UserChatQueue'][_0x48dc('0x54')](_0x2319af);}})[_0x48dc('0x21')](function(_0x21fbcb){if(_0x21fbcb){return db[_0x48dc('0x69')]['findAndCountAll']({'where':{'id':_[_0x48dc('0x43')](_0x21fbcb,'UserId'),'role':_0x48dc('0x6a')},'attributes':['id','name',_0x48dc('0x6b'),_0x48dc('0x6c'),_0x48dc('0x6d')]});}})['then'](function(_0x34d813){if(_0x34d813){return{'count':_0x34d813[_0x48dc('0x33')],'rows':_[_0x48dc('0x43')](_0x34d813[_0x48dc('0x6e')],function(_0xbc485f){return{'membername':_0xbc485f[_0x48dc('0x3c')],'UserId':_0xbc485f['id'],'queue_name':_0x552e45['name'],'ChatQueueId':_0x552e45['id'],'interface':util[_0x48dc('0x6f')](_0x48dc('0x70'),_0x48dc('0x71'),_0xbc485f[_0x48dc('0x3c')]),'penalty':0x0,'paused':_0xbc485f['chatPause'],'createdAt':_0xbc485f[_0x48dc('0x6d')],'updatedAt':_0xbc485f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x48dc('0x21')](respondWithFilteredResult(_0x3f95bc,_0x2319af))[_0x48dc('0x2b')](handleError(_0x3f95bc,null));};exports[_0x48dc('0x72')]=function(_0x104e71,_0x133bc8,_0x49a142){var _0x5e2f9c={};var _0x5df683={};var _0x1c6b8d;var _0xff09fe;return db[_0x48dc('0x3e')][_0x48dc('0x64')]({'where':{'id':_0x104e71[_0x48dc('0x56')]['id']}})[_0x48dc('0x21')](handleEntityNotFound(_0x133bc8,null))[_0x48dc('0x21')](function(_0x39fef3){if(_0x39fef3){_0x1c6b8d=_0x39fef3;_0x5df683[_0x48dc('0x47')]=_[_0x48dc('0x57')](db[_0x48dc('0x73')][_0x48dc('0x3f')]);_0x5df683[_0x48dc('0x44')]=_[_0x48dc('0x57')](_0x104e71[_0x48dc('0x44')]);_0x5df683[_0x48dc('0x45')]=_[_0x48dc('0x46')](_0x5df683[_0x48dc('0x47')],_0x5df683[_0x48dc('0x44')]);_0x5e2f9c[_0x48dc('0x48')]=_[_0x48dc('0x46')](_0x5df683[_0x48dc('0x47')],qs[_0x48dc('0x49')](_0x104e71[_0x48dc('0x44')]['fields']));_0x5e2f9c[_0x48dc('0x48')]=_0x5e2f9c[_0x48dc('0x48')][_0x48dc('0x4a')]?_0x5e2f9c[_0x48dc('0x48')]:_0x5df683['model'];_0x5e2f9c[_0x48dc('0x4c')]=qs[_0x48dc('0x4d')](_0x104e71[_0x48dc('0x44')][_0x48dc('0x4d')]);_0x5e2f9c[_0x48dc('0x4e')]=qs[_0x48dc('0x45')](_[_0x48dc('0x66')](_0x104e71[_0x48dc('0x44')],_0x5df683[_0x48dc('0x45')]));if(_0x104e71['query'][_0x48dc('0x68')]){_0x5e2f9c[_0x48dc('0x4e')]=_['merge'](_0x5e2f9c['where'],{'$or':_['map'](_0x5e2f9c['attributes'],function(_0x59d534){var _0xeaafc5={};_0xeaafc5[_0x59d534]={'$like':'%'+_0x104e71['query'][_0x48dc('0x68')]+'%'};return _0xeaafc5;})});}_0x5e2f9c=_['merge']({},_0x5e2f9c,_0x104e71[_0x48dc('0x51')]);return _0x1c6b8d['getTeams'](_0x5e2f9c);}})[_0x48dc('0x21')](function(_0x314f6a){if(_0x314f6a){_0xff09fe=_0x314f6a[_0x48dc('0x4a')];if(!_0x104e71[_0x48dc('0x44')][_0x48dc('0x65')](_0x48dc('0x4b'))){_0x5e2f9c[_0x48dc('0x32')]=qs[_0x48dc('0x32')](_0x104e71[_0x48dc('0x44')][_0x48dc('0x32')]);_0x5e2f9c['offset']=qs[_0x48dc('0x30')](_0x104e71[_0x48dc('0x44')]['offset']);}return _0x1c6b8d[_0x48dc('0x72')](_0x5e2f9c);}})[_0x48dc('0x21')](function(_0x23da6f){if(_0x23da6f){return _0x23da6f?{'count':_0xff09fe,'rows':_0x23da6f}:null;}})['then'](respondWithResult(_0x133bc8,null))[_0x48dc('0x2b')](handleError(_0x133bc8,null));};exports['addTeams']=function(_0xa0d2b9,_0x11e0fb,_0x56a72f){var _0x9f58b0=_0xa0d2b9[_0x48dc('0x5a')][_0x48dc('0x74')];return db[_0x48dc('0x73')][_0x48dc('0x54')]({'where':{'id':_0x9f58b0},'attributes':['id'],'include':[{'model':db[_0x48dc('0x69')],'as':_0x48dc('0x75'),'attributes':['id',_0x48dc('0x3c'),'online',_0x48dc('0x76'),_0x48dc('0x77')],'raw':!![]}]})['then'](function(_0x557be3){if(_0x557be3){var _0x5b1a01=_[_0x48dc('0x78')](_0x557be3,function(_0x57ab89){var _0x58568d=_0x57ab89['get']({'plain':!![]});return _0x58568d[_0x48dc('0x75')];});return db[_0x48dc('0x3e')][_0x48dc('0x58')]({'where':{'id':_0xa0d2b9[_0x48dc('0x56')]['id']}})['then'](function(_0x12bde6){return db[_0x48dc('0x79')]['transaction'](function(_0x4028a0){return _0x12bde6[_0x48dc('0x7a')](_0x9f58b0,{'transaction':_0x4028a0})[_0x48dc('0x21')](function(){return BPromise[_0x48dc('0x7b')](_0x5b1a01,function(_0x4f9a6c){return db[_0x48dc('0x7c')][_0x48dc('0x7d')]({'where':{'UserId':_0x4f9a6c['id'],'ChatQueueId':_0xa0d2b9[_0x48dc('0x56')]['id']},'transaction':_0x4028a0});});})[_0x48dc('0x21')](function(){_0x5b1a01['forEach'](function(_0x5e0c2c){socket[_0x48dc('0x7e')]('userChatQueue:save',{'UserId':_0x5e0c2c['id'],'ChatQueueId':_0x12bde6['id']});});});});});}})[_0x48dc('0x21')](respondWithStatusCode(_0x11e0fb,null))['catch'](handleError(_0x11e0fb,null));};exports['removeTeams']=function(_0x1ef6b4,_0x3b611,_0x1bb77d){return db[_0x48dc('0x73')][_0x48dc('0x54')]({'where':{'id':_0x1ef6b4[_0x48dc('0x44')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x48dc('0x75'),'attributes':['id'],'raw':!![]}]})[_0x48dc('0x21')](handleEntityNotFound(_0x3b611,null))[_0x48dc('0x21')](function(_0x50fd3e){var _0x930140=_[_0x48dc('0x43')](_0x50fd3e,'id');var _0x2e5e0d=[];var _0x18d1bc=[];var _0xac0e7f=squel[_0x48dc('0x7f')]();_0xac0e7f['field'](_0x48dc('0x80'))['from'](_0x48dc('0x81'),'tq')[_0x48dc('0x82')]('user_has_teams','ut',_0x48dc('0x83'))[_0x48dc('0x4e')]('ChatQueueId\x20=\x20?',_0x1ef6b4[_0x48dc('0x56')]['id']);for(var _0x41ea1a=0x0;_0x41ea1a<_0x50fd3e[_0x48dc('0x4a')];_0x41ea1a+=0x1){let _0x355f0f=_0x50fd3e[_0x41ea1a];for(var _0x4c2b3e=0x0;_0x4c2b3e<_0x355f0f['Agents'][_0x48dc('0x4a')];_0x4c2b3e+=0x1){let _0x2feab1=_0x355f0f[_0x48dc('0x75')][_0x4c2b3e];var _0x421d88=_0xac0e7f[_0x48dc('0x84')]();_0x421d88[_0x48dc('0x4e')](_0x48dc('0x85'),_0x2feab1['id']);_0x18d1bc[_0x48dc('0x86')](db[_0x48dc('0x79')][_0x48dc('0x44')](_0x421d88['toString'](),{'type':db[_0x48dc('0x79')][_0x48dc('0x87')][_0x48dc('0x88')]})[_0x48dc('0x21')](function(_0x497e30){if(_0x497e30[_0x48dc('0x4a')]===0x1){return _0x2feab1['id'];}else{var _0x4320e8=_[_0x48dc('0x89')](_['map'](_0x497e30,'TeamId'),function(_0x5e61fa){return _[_0x48dc('0x8a')](_0x930140,_0x5e61fa);});if(_0x4320e8){return _0x2feab1['id'];}}}));}}return BPromise[_0x48dc('0x8b')](_0x18d1bc)['then'](function(_0x3a8c83){_0x2e5e0d=_(_0x2e5e0d)[_0x48dc('0x8c')](_0x3a8c83)[_0x48dc('0x8d')]()[_0x48dc('0x8e')]();return db[_0x48dc('0x3e')]['find']({'where':{'id':_0x1ef6b4['params']['id']}})[_0x48dc('0x21')](function(_0x241d2d){return db[_0x48dc('0x79')][_0x48dc('0x8f')](function(_0x385d3c){return _0x241d2d[_0x48dc('0x90')](_0x1ef6b4['query'][_0x48dc('0x74')],{'transaction':_0x385d3c})['then'](function(){if(!_[_0x48dc('0x91')](_0x2e5e0d)){return _0x241d2d[_0x48dc('0x92')](_0x2e5e0d,{'transaction':_0x385d3c});}})[_0x48dc('0x21')](function(){_0x2e5e0d['forEach'](function(_0x5afc83){socket[_0x48dc('0x7e')](_0x48dc('0x93'),{'UserId':_0x5afc83,'ChatQueueId':_0x241d2d['id']});});});});});});})[_0x48dc('0x21')](respondWithStatusCode(_0x3b611,null))['catch'](handleError(_0x3b611,null));};exports[_0x48dc('0x94')]=function(_0xf0c674,_0x3a1ad2,_0x11a90b){return db[_0x48dc('0x3e')][_0x48dc('0x58')]({'where':{'id':_0xf0c674[_0x48dc('0x56')]['id']}})['then'](handleEntityNotFound(_0x3a1ad2,null))[_0x48dc('0x21')](function(_0x132b8a){if(_0x132b8a){return _0x132b8a[_0x48dc('0x94')](_0xf0c674['body'][_0x48dc('0x74')],_[_0x48dc('0x95')](_0xf0c674[_0x48dc('0x5a')],[_0x48dc('0x74'),'id'])||{})[_0x48dc('0x96')](function(_0x223375){for(var _0x404e47=0x0;_0x404e47<_0xf0c674['body']['ids'][_0x48dc('0x4a')];_0x404e47+=0x1){socket[_0x48dc('0x7e')](_0x48dc('0x97'),{'UserId':Number(_0xf0c674[_0x48dc('0x5a')][_0x48dc('0x74')][_0x404e47]),'ChatQueueId':Number(_0xf0c674[_0x48dc('0x56')]['id'])});}return _0x223375;});}})[_0x48dc('0x21')](respondWithResult(_0x3a1ad2,null))[_0x48dc('0x2b')](handleError(_0x3a1ad2,null));};exports['removeAgents']=function(_0x5490bf,_0x38ca41,_0x48517b){return db[_0x48dc('0x3e')][_0x48dc('0x58')]({'where':{'id':_0x5490bf['params']['id']}})[_0x48dc('0x21')](handleEntityNotFound(_0x38ca41,null))[_0x48dc('0x21')](function(_0x11c7e9){if(_0x11c7e9){return _0x11c7e9[_0x48dc('0x92')](_0x5490bf[_0x48dc('0x44')]['ids'])[_0x48dc('0x21')](function(){if(_['isArray'](_0x5490bf['query'][_0x48dc('0x74')])){for(var _0x433bd0=0x0;_0x433bd0<_0x5490bf[_0x48dc('0x44')][_0x48dc('0x74')][_0x48dc('0x4a')];_0x433bd0+=0x1){socket[_0x48dc('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x5490bf[_0x48dc('0x44')]['ids'][_0x433bd0]),'ChatQueueId':Number(_0x5490bf[_0x48dc('0x56')]['id'])});}}else{socket[_0x48dc('0x7e')](_0x48dc('0x93'),{'UserId':Number(_0x5490bf[_0x48dc('0x44')][_0x48dc('0x74')]),'ChatQueueId':Number(_0x5490bf[_0x48dc('0x56')]['id'])});}});}})[_0x48dc('0x21')](respondWithStatusCode(_0x38ca41,null))[_0x48dc('0x2b')](handleError(_0x38ca41,null));};exports[_0x48dc('0x98')]=function(_0x34cd8e,_0x3f493d,_0x31009c){var _0x2667dc={};var _0x21d52d={};var _0xa0edcb;var _0x2a8474;return db[_0x48dc('0x3e')][_0x48dc('0x64')]({'where':{'id':_0x34cd8e[_0x48dc('0x56')]['id']}})[_0x48dc('0x21')](handleEntityNotFound(_0x3f493d,null))['then'](function(_0x30361b){if(_0x30361b){_0xa0edcb=_0x30361b;_0x21d52d[_0x48dc('0x47')]=_[_0x48dc('0x57')](db[_0x48dc('0x69')][_0x48dc('0x3f')]);_0x21d52d[_0x48dc('0x44')]=_['keys'](_0x34cd8e['query']);_0x21d52d[_0x48dc('0x45')]=_[_0x48dc('0x46')](_0x21d52d['model'],_0x21d52d['query']);_0x2667dc[_0x48dc('0x48')]=_[_0x48dc('0x46')](_0x21d52d[_0x48dc('0x47')],qs['fields'](_0x34cd8e[_0x48dc('0x44')]['fields']));_0x2667dc['attributes']=_0x2667dc['attributes'][_0x48dc('0x4a')]?_0x2667dc[_0x48dc('0x48')]:_0x21d52d[_0x48dc('0x47')];_0x2667dc[_0x48dc('0x4c')]=qs[_0x48dc('0x4d')](_0x34cd8e[_0x48dc('0x44')][_0x48dc('0x4d')]);_0x2667dc[_0x48dc('0x4e')]=qs['filters'](_[_0x48dc('0x66')](_0x34cd8e[_0x48dc('0x44')],_0x21d52d[_0x48dc('0x45')]));if(_0x34cd8e[_0x48dc('0x44')][_0x48dc('0x68')]){_0x2667dc[_0x48dc('0x4e')]=_[_0x48dc('0x4f')](_0x2667dc[_0x48dc('0x4e')],{'$or':_[_0x48dc('0x43')](_0x2667dc['attributes'],function(_0x2c1ad6){var _0x4d894c={};_0x4d894c[_0x2c1ad6]={'$like':'%'+_0x34cd8e[_0x48dc('0x44')]['filter']+'%'};return _0x4d894c;})});}_0x2667dc=_['merge']({},_0x2667dc,_0x34cd8e[_0x48dc('0x51')]);return _0xa0edcb[_0x48dc('0x98')](_0x2667dc);}})[_0x48dc('0x21')](function(_0x53dc3d){if(_0x53dc3d){_0x2a8474=_0x53dc3d['length'];if(!_0x34cd8e['query'][_0x48dc('0x65')]('nolimit')){_0x2667dc['limit']=qs['limit'](_0x34cd8e[_0x48dc('0x44')]['limit']);_0x2667dc[_0x48dc('0x30')]=qs[_0x48dc('0x30')](_0x34cd8e[_0x48dc('0x44')][_0x48dc('0x30')]);}return _0xa0edcb[_0x48dc('0x98')](_0x2667dc);}})[_0x48dc('0x21')](function(_0x4c88c3){if(_0x4c88c3){return _0x4c88c3?{'count':_0x2a8474,'rows':_0x4c88c3}:null;}})[_0x48dc('0x21')](respondWithResult(_0x3f493d,null))['catch'](handleError(_0x3f493d,null));};
\ No newline at end of file
+var _0x510e=['../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','then','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','get','ChatQueues','name','send','map','ChatQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','findOne','UserChatQueue','ChatQueueId','findAll','findAndCountAll','UserId','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','User','online','voicePause','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','every','all','value','sequelize','isEmpty','removeAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x3281f7,_0x4d613c){var _0x47f6ee=function(_0x404ee7){while(--_0x404ee7){_0x3281f7['push'](_0x3281f7['shift']());}};_0x47f6ee(++_0x4d613c);}(_0x510e,0x1a1));var _0xe510=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x510e[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0xe510('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe510('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe510('0x2'));var moment=require(_0xe510('0x3'));var BPromise=require(_0xe510('0x4'));var Mustache=require(_0xe510('0x5'));var util=require('util');var path=require(_0xe510('0x6'));var sox=require(_0xe510('0x7'));var csv=require(_0xe510('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe510('0x9'));var _=require(_0xe510('0xa'));var squel=require('squel');var crypto=require(_0xe510('0xb'));var jsforce=require(_0xe510('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe510('0x8'));var querystring=require(_0xe510('0xd'));var Papa=require('papaparse');var Redis=require(_0xe510('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe510('0xf'));var as=require(_0xe510('0x10'));var hardwareService=require(_0xe510('0x11'));var logger=require(_0xe510('0x12'))(_0xe510('0x13'));var utils=require('../../config/utils');var config=require(_0xe510('0x14'));var licenseUtil=require(_0xe510('0x15'));var db=require(_0xe510('0x16'))['db'];config[_0xe510('0x17')]=_[_0xe510('0x18')](config[_0xe510('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe510('0x19'))(new Redis(config[_0xe510('0x17')]));require('./chatQueue.socket')[_0xe510('0x1a')](socket);var jayson=require(_0xe510('0x1b'));var client=jayson[_0xe510('0x1c')][_0xe510('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x13421a,_0x57cdfb,_0x5efb07,_0x1660c2){return new BPromise(function(_0x4f4719,_0x4b1fdd){var _0x4bee31=_0x1660c2||client;return _0x4bee31['request'](_0x13421a,_0x5efb07)[_0xe510('0x1e')](function(_0x5c6f50){logger['info'](_0xe510('0x1f'),_0x57cdfb,'request\x20sent');logger[_0xe510('0x20')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x57cdfb,_0xe510('0x21'),JSON[_0xe510('0x22')](_0x5c6f50));if(_0x5c6f50[_0xe510('0x23')]){if(_0x5c6f50[_0xe510('0x23')][_0xe510('0x24')]===0x1f4){logger[_0xe510('0x23')](_0xe510('0x1f'),_0x57cdfb,_0x5c6f50[_0xe510('0x23')][_0xe510('0x25')]);return _0x4b1fdd(_0x5c6f50[_0xe510('0x23')]['message']);}logger[_0xe510('0x23')](_0xe510('0x1f'),_0x57cdfb,_0x5c6f50['error'][_0xe510('0x25')]);return _0x4f4719(_0x5c6f50[_0xe510('0x23')]['message']);}else{logger[_0xe510('0x26')](_0xe510('0x1f'),_0x57cdfb,_0xe510('0x21'));_0x4f4719(_0x5c6f50[_0xe510('0x27')][_0xe510('0x25')]);}})[_0xe510('0x28')](function(_0x25dd79){logger[_0xe510('0x23')](_0xe510('0x1f'),_0x57cdfb,_0x25dd79);_0x4b1fdd(_0x25dd79);});});}function respondWithStatusCode(_0x1718f8,_0x36adc2){_0x36adc2=_0x36adc2||0xcc;return function(_0x5cdc37){if(_0x5cdc37){return _0x1718f8[_0xe510('0x29')](_0x36adc2);}return _0x1718f8[_0xe510('0x2a')](_0x36adc2)[_0xe510('0x2b')]();};}function respondWithResult(_0xaee073,_0x3bf7be){_0x3bf7be=_0x3bf7be||0xc8;return function(_0x11cb7a){if(_0x11cb7a){return _0xaee073[_0xe510('0x2a')](_0x3bf7be)[_0xe510('0x2c')](_0x11cb7a);}};}function respondWithFilteredResult(_0x557bc2,_0xd50367){return function(_0x46e755){if(_0x46e755){var _0x184128=typeof _0xd50367['offset']==='undefined'&&typeof _0xd50367[_0xe510('0x2d')]===_0xe510('0x2e');var _0x586d31=_0x46e755[_0xe510('0x2f')];var _0x52596a=_0x184128?0x0:_0xd50367[_0xe510('0x30')];var _0x124a69=_0x184128?_0x46e755[_0xe510('0x2f')]:_0xd50367['offset']+_0xd50367[_0xe510('0x2d')];var _0x422d3c;if(_0x124a69>=_0x586d31){_0x124a69=_0x586d31;_0x422d3c=0xc8;}else{_0x422d3c=0xce;}_0x557bc2['status'](_0x422d3c);return _0x557bc2[_0xe510('0x31')](_0xe510('0x32'),_0x52596a+'-'+_0x124a69+'/'+_0x586d31)[_0xe510('0x2c')](_0x46e755);}return null;};}function patchUpdates(_0x57ab6b){return function(_0x518eb8){try{jsonpatch[_0xe510('0x33')](_0x518eb8,_0x57ab6b,!![]);}catch(_0x1f8f8f){return BPromise[_0xe510('0x34')](_0x1f8f8f);}return _0x518eb8[_0xe510('0x35')]();};}function saveUpdates(_0x49df44,_0x2d3aef){return function(_0x2e475d){if(_0x2e475d){return _0x2e475d['update'](_0x49df44)[_0xe510('0x1e')](function(_0x49b9b4){return _0x49b9b4;});}return null;};}function removeEntity(_0x1c375c,_0x17fbed){return function(_0x21ebaa){if(_0x21ebaa){return _0x21ebaa[_0xe510('0x36')]()[_0xe510('0x1e')](function(){var _0x5d9a48=_0x21ebaa[_0xe510('0x37')]({'plain':!![]});var _0x623ad3=_0xe510('0x38');return db['UserProfileResource'][_0xe510('0x36')]({'where':{'type':_0x623ad3,'resourceId':_0x5d9a48['id']}})[_0xe510('0x1e')](function(){return _0x21ebaa;});})['then'](function(){_0x1c375c[_0xe510('0x2a')](0xcc)[_0xe510('0x2b')]();});}};}function handleEntityNotFound(_0x3785a9,_0xd4737e){return function(_0x13bc56){if(!_0x13bc56){_0x3785a9[_0xe510('0x29')](0x194);}return _0x13bc56;};}function handleError(_0x4aa9bb,_0x1d0576){_0x1d0576=_0x1d0576||0x1f4;return function(_0x28a5d0){logger['error'](_0x28a5d0['stack']);if(_0x28a5d0[_0xe510('0x39')]){delete _0x28a5d0['name'];}_0x4aa9bb[_0xe510('0x2a')](_0x1d0576)[_0xe510('0x3a')](_0x28a5d0);};}exports['index']=function(_0xe02c57,_0x3720b4){var _0x4aea21={},_0x265033={},_0x26ae3a={'count':0x0,'rows':[]};var _0x37a05a=_[_0xe510('0x3b')](db[_0xe510('0x3c')]['rawAttributes'],function(_0x56815e){return{'name':_0x56815e[_0xe510('0x3d')],'type':_0x56815e[_0xe510('0x3e')][_0xe510('0x3f')]};});_0x265033[_0xe510('0x40')]=_[_0xe510('0x3b')](_0x37a05a,'name');_0x265033[_0xe510('0x41')]=_[_0xe510('0x42')](_0xe02c57[_0xe510('0x41')]);_0x265033['filters']=_[_0xe510('0x43')](_0x265033['model'],_0x265033[_0xe510('0x41')]);_0x4aea21[_0xe510('0x44')]=_[_0xe510('0x43')](_0x265033[_0xe510('0x40')],qs[_0xe510('0x45')](_0xe02c57['query'][_0xe510('0x45')]));_0x4aea21[_0xe510('0x44')]=_0x4aea21[_0xe510('0x44')][_0xe510('0x46')]?_0x4aea21[_0xe510('0x44')]:_0x265033[_0xe510('0x40')];if(!_0xe02c57[_0xe510('0x41')][_0xe510('0x47')](_0xe510('0x48'))){_0x4aea21['limit']=qs[_0xe510('0x2d')](_0xe02c57[_0xe510('0x41')]['limit']);_0x4aea21[_0xe510('0x30')]=qs['offset'](_0xe02c57[_0xe510('0x41')][_0xe510('0x30')]);}_0x4aea21[_0xe510('0x49')]=qs[_0xe510('0x4a')](_0xe02c57[_0xe510('0x41')]['sort']);_0x4aea21[_0xe510('0x4b')]=qs['filters'](_[_0xe510('0x4c')](_0xe02c57['query'],_0x265033[_0xe510('0x4d')]),_0x37a05a);if(_0xe02c57[_0xe510('0x41')][_0xe510('0x4e')]){_0x4aea21['where']=_[_0xe510('0x4f')](_0x4aea21['where'],{'$or':_[_0xe510('0x3b')](_0x37a05a,function(_0xada5b3){if(_0xada5b3['type']!==_0xe510('0x50')){var _0x4ee891={};_0x4ee891[_0xada5b3[_0xe510('0x39')]]={'$like':'%'+_0xe02c57[_0xe510('0x41')][_0xe510('0x4e')]+'%'};return _0x4ee891;}})});}_0x4aea21=_['merge']({},_0x4aea21,_0xe02c57[_0xe510('0x51')]);var _0x360f04={'where':_0x4aea21[_0xe510('0x4b')]};return db['ChatQueue'][_0xe510('0x2f')](_0x360f04)[_0xe510('0x1e')](function(_0x4c0edf){_0x26ae3a['count']=_0x4c0edf;if(_0xe02c57['query'][_0xe510('0x52')]){_0x4aea21[_0xe510('0x53')]=[{'all':!![]}];}return db[_0xe510('0x3c')]['findAll'](_0x4aea21);})[_0xe510('0x1e')](function(_0x38be30){_0x26ae3a[_0xe510('0x54')]=_0x38be30;return _0x26ae3a;})[_0xe510('0x1e')](respondWithFilteredResult(_0x3720b4,_0x4aea21))[_0xe510('0x28')](handleError(_0x3720b4,null));};exports[_0xe510('0x55')]=function(_0x3c26c1,_0xe2d63f){var _0x5d2e7d={'raw':!![],'where':{'id':_0x3c26c1[_0xe510('0x56')]['id']}},_0x3e021b={};_0x3e021b[_0xe510('0x40')]=_['keys'](db[_0xe510('0x3c')][_0xe510('0x57')]);_0x3e021b[_0xe510('0x41')]=_[_0xe510('0x42')](_0x3c26c1[_0xe510('0x41')]);_0x3e021b[_0xe510('0x4d')]=_[_0xe510('0x43')](_0x3e021b[_0xe510('0x40')],_0x3e021b[_0xe510('0x41')]);_0x5d2e7d[_0xe510('0x44')]=_[_0xe510('0x43')](_0x3e021b['model'],qs[_0xe510('0x45')](_0x3c26c1[_0xe510('0x41')]['fields']));_0x5d2e7d[_0xe510('0x44')]=_0x5d2e7d['attributes'][_0xe510('0x46')]?_0x5d2e7d[_0xe510('0x44')]:_0x3e021b[_0xe510('0x40')];if(_0x3c26c1[_0xe510('0x41')][_0xe510('0x52')]){_0x5d2e7d[_0xe510('0x53')]=[{'all':!![]}];}_0x5d2e7d=_[_0xe510('0x4f')]({},_0x5d2e7d,_0x3c26c1[_0xe510('0x51')]);return db[_0xe510('0x3c')][_0xe510('0x58')](_0x5d2e7d)[_0xe510('0x1e')](handleEntityNotFound(_0xe2d63f,null))[_0xe510('0x1e')](respondWithResult(_0xe2d63f,null))[_0xe510('0x28')](handleError(_0xe2d63f,null));};exports[_0xe510('0x59')]=function(_0x440f41,_0x277bd9){return db[_0xe510('0x3c')][_0xe510('0x59')](_0x440f41[_0xe510('0x5a')],{})['then'](function(_0x41db27){var _0x5ac162=_0x440f41[_0xe510('0x5b')][_0xe510('0x37')]({'plain':!![]});if(!_0x5ac162)throw new Error(_0xe510('0x5c'));if(_0x5ac162[_0xe510('0x5d')]===_0xe510('0x5b')){var _0x3b04dc=_0x41db27[_0xe510('0x37')]({'plain':!![]});var _0x3b3ca3=_0xe510('0x38');return db[_0xe510('0x5e')][_0xe510('0x58')]({'where':{'name':_0x3b3ca3,'userProfileId':_0x5ac162[_0xe510('0x5f')]},'raw':!![]})['then'](function(_0x475763){if(_0x475763&&_0x475763[_0xe510('0x60')]===0x0){return db[_0xe510('0x61')][_0xe510('0x59')]({'name':_0x3b04dc[_0xe510('0x39')],'resourceId':_0x3b04dc['id'],'type':_0x475763[_0xe510('0x39')],'sectionId':_0x475763['id']},{})[_0xe510('0x1e')](function(){return _0x41db27;});}else{return _0x41db27;}})[_0xe510('0x28')](function(_0x3d5746){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5746);throw _0x3d5746;});}return _0x41db27;})['then'](respondWithResult(_0x277bd9,0xc9))[_0xe510('0x28')](handleError(_0x277bd9,null));};exports[_0xe510('0x62')]=function(_0x13920a,_0x44434e){if(_0x13920a[_0xe510('0x5a')]['id']){delete _0x13920a[_0xe510('0x5a')]['id'];}return db['ChatQueue'][_0xe510('0x58')]({'where':{'id':_0x13920a[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0x44434e,null))[_0xe510('0x1e')](saveUpdates(_0x13920a[_0xe510('0x5a')],null))[_0xe510('0x1e')](respondWithResult(_0x44434e,null))['catch'](handleError(_0x44434e,null));};exports['destroy']=function(_0x418cc6,_0x2d7abc){return db[_0xe510('0x3c')][_0xe510('0x58')]({'where':{'id':_0x418cc6['params']['id']}})['then'](handleEntityNotFound(_0x2d7abc,null))[_0xe510('0x1e')](removeEntity(_0x2d7abc,null))[_0xe510('0x28')](handleError(_0x2d7abc,null));};exports[_0xe510('0x63')]=function(_0x2a0328,_0x2e8c7b){return db['ChatQueue'][_0xe510('0x63')]()[_0xe510('0x1e')](respondWithResult(_0x2e8c7b,null))[_0xe510('0x28')](handleError(_0x2e8c7b,null));};exports['getMembers']=function(_0x437d98,_0xbcf813,_0x2517c9){var _0x93b09f={'raw':!![],'where':{}},_0x39e8d8={},_0x5116cb;return db[_0xe510('0x3c')][_0xe510('0x64')]({'where':{'id':_0x437d98[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0xbcf813,null))[_0xe510('0x1e')](function(_0x53348a){if(_0x53348a){_0x5116cb=_0x53348a[_0xe510('0x37')]({'plain':!![]});_0x39e8d8[_0xe510('0x40')]=_[_0xe510('0x42')](db[_0xe510('0x65')][_0xe510('0x57')]);_0x39e8d8[_0xe510('0x41')]=_[_0xe510('0x42')](_0x437d98[_0xe510('0x41')]);_0x39e8d8[_0xe510('0x4d')]=_[_0xe510('0x43')](_0x39e8d8[_0xe510('0x40')],_0x39e8d8['query']);_0x93b09f[_0xe510('0x44')]=_[_0xe510('0x43')](_0x39e8d8[_0xe510('0x40')],qs[_0xe510('0x45')](_0x437d98['query'][_0xe510('0x45')]));_0x93b09f[_0xe510('0x44')]=_0x93b09f[_0xe510('0x44')][_0xe510('0x46')]?_0x93b09f[_0xe510('0x44')]:_0x39e8d8[_0xe510('0x40')];if(!_0x437d98[_0xe510('0x41')][_0xe510('0x47')](_0xe510('0x48'))){_0x93b09f[_0xe510('0x2d')]=qs[_0xe510('0x2d')](_0x437d98[_0xe510('0x41')][_0xe510('0x2d')]);_0x93b09f[_0xe510('0x30')]=qs[_0xe510('0x30')](_0x437d98[_0xe510('0x41')][_0xe510('0x30')]);}_0x93b09f[_0xe510('0x49')]=qs[_0xe510('0x4a')](_0x437d98[_0xe510('0x41')][_0xe510('0x4a')]);_0x93b09f[_0xe510('0x4b')]=qs[_0xe510('0x4d')](_[_0xe510('0x4c')](_0x437d98[_0xe510('0x41')],_0x39e8d8[_0xe510('0x4d')]));_0x93b09f[_0xe510('0x4b')][_0xe510('0x66')]=_0x53348a['id'];if(_0x437d98[_0xe510('0x41')][_0xe510('0x4e')]){_0x93b09f['where']=_[_0xe510('0x4f')](_0x93b09f[_0xe510('0x4b')],{'$or':_[_0xe510('0x3b')](_0x93b09f[_0xe510('0x44')],function(_0x1dd363){var _0x4f8e3f={};_0x4f8e3f[_0x1dd363]={'$like':'%'+_0x437d98[_0xe510('0x41')][_0xe510('0x4e')]+'%'};return _0x4f8e3f;})});}_0x93b09f=_['merge']({},_0x93b09f,_0x437d98['options']);return db[_0xe510('0x65')][_0xe510('0x67')](_0x93b09f);}})[_0xe510('0x1e')](function(_0x2d7bce){if(_0x2d7bce){return db['User'][_0xe510('0x68')]({'where':{'id':_[_0xe510('0x3b')](_0x2d7bce,_0xe510('0x69')),'role':'agent'},'attributes':['id','name',_0xe510('0x6a'),'updatedAt',_0xe510('0x6b')]});}})[_0xe510('0x1e')](function(_0xc9d116){if(_0xc9d116){return{'count':_0xc9d116[_0xe510('0x2f')],'rows':_[_0xe510('0x3b')](_0xc9d116['rows'],function(_0x961cf1){return{'membername':_0x961cf1[_0xe510('0x39')],'UserId':_0x961cf1['id'],'queue_name':_0x5116cb[_0xe510('0x39')],'ChatQueueId':_0x5116cb['id'],'interface':util['format'](_0xe510('0x6c'),_0xe510('0x6d'),_0x961cf1['name']),'penalty':0x0,'paused':_0x961cf1[_0xe510('0x6a')],'createdAt':_0x961cf1[_0xe510('0x6b')],'updatedAt':_0x961cf1[_0xe510('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe510('0x1e')](respondWithFilteredResult(_0xbcf813,_0x93b09f))[_0xe510('0x28')](handleError(_0xbcf813,null));};exports[_0xe510('0x6f')]=function(_0x594778,_0x509298,_0x6c7277){var _0x438146={};var _0x18b162={};var _0x43ede1;var _0x25b3fb;return db['ChatQueue'][_0xe510('0x64')]({'where':{'id':_0x594778[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0x509298,null))[_0xe510('0x1e')](function(_0x24c9f7){if(_0x24c9f7){_0x43ede1=_0x24c9f7;_0x18b162['model']=_[_0xe510('0x42')](db[_0xe510('0x70')]['rawAttributes']);_0x18b162[_0xe510('0x41')]=_[_0xe510('0x42')](_0x594778[_0xe510('0x41')]);_0x18b162['filters']=_[_0xe510('0x43')](_0x18b162['model'],_0x18b162[_0xe510('0x41')]);_0x438146['attributes']=_[_0xe510('0x43')](_0x18b162['model'],qs['fields'](_0x594778[_0xe510('0x41')][_0xe510('0x45')]));_0x438146[_0xe510('0x44')]=_0x438146[_0xe510('0x44')][_0xe510('0x46')]?_0x438146['attributes']:_0x18b162[_0xe510('0x40')];_0x438146[_0xe510('0x49')]=qs[_0xe510('0x4a')](_0x594778['query'][_0xe510('0x4a')]);_0x438146[_0xe510('0x4b')]=qs[_0xe510('0x4d')](_['pick'](_0x594778[_0xe510('0x41')],_0x18b162[_0xe510('0x4d')]));if(_0x594778[_0xe510('0x41')][_0xe510('0x4e')]){_0x438146[_0xe510('0x4b')]=_[_0xe510('0x4f')](_0x438146[_0xe510('0x4b')],{'$or':_['map'](_0x438146['attributes'],function(_0x1218f0){var _0x2e9215={};_0x2e9215[_0x1218f0]={'$like':'%'+_0x594778[_0xe510('0x41')][_0xe510('0x4e')]+'%'};return _0x2e9215;})});}_0x438146=_[_0xe510('0x4f')]({},_0x438146,_0x594778[_0xe510('0x51')]);return _0x43ede1[_0xe510('0x6f')](_0x438146);}})['then'](function(_0x492f03){if(_0x492f03){_0x25b3fb=_0x492f03[_0xe510('0x46')];if(!_0x594778[_0xe510('0x41')][_0xe510('0x47')](_0xe510('0x48'))){_0x438146[_0xe510('0x2d')]=qs[_0xe510('0x2d')](_0x594778[_0xe510('0x41')][_0xe510('0x2d')]);_0x438146[_0xe510('0x30')]=qs[_0xe510('0x30')](_0x594778[_0xe510('0x41')][_0xe510('0x30')]);}return _0x43ede1['getTeams'](_0x438146);}})[_0xe510('0x1e')](function(_0x33a8d4){if(_0x33a8d4){return _0x33a8d4?{'count':_0x25b3fb,'rows':_0x33a8d4}:null;}})['then'](respondWithResult(_0x509298,null))[_0xe510('0x28')](handleError(_0x509298,null));};exports[_0xe510('0x71')]=function(_0xde9dcd,_0x5e6769,_0x50119c){var _0x473684=_0xde9dcd['body'][_0xe510('0x72')];return db[_0xe510('0x70')][_0xe510('0x67')]({'where':{'id':_0x473684},'attributes':['id'],'include':[{'model':db[_0xe510('0x73')],'as':'Agents','attributes':['id',_0xe510('0x39'),_0xe510('0x74'),_0xe510('0x75'),'interface'],'raw':!![]}]})[_0xe510('0x1e')](function(_0x2337cd){if(_0x2337cd){var _0x29f7fb=_['flatMap'](_0x2337cd,function(_0x4eb3bb){var _0x409a8b=_0x4eb3bb[_0xe510('0x37')]({'plain':!![]});return _0x409a8b['Agents'];});return db['ChatQueue'][_0xe510('0x58')]({'where':{'id':_0xde9dcd['params']['id']}})[_0xe510('0x1e')](function(_0x3ff24c){return db['sequelize'][_0xe510('0x76')](function(_0x568914){return _0x3ff24c[_0xe510('0x71')](_0x473684,{'transaction':_0x568914})[_0xe510('0x1e')](function(){return BPromise[_0xe510('0x77')](_0x29f7fb,function(_0x2cdd07){return db['UserChatQueue'][_0xe510('0x78')]({'where':{'UserId':_0x2cdd07['id'],'ChatQueueId':_0xde9dcd[_0xe510('0x56')]['id']},'transaction':_0x568914});});})[_0xe510('0x1e')](function(){_0x29f7fb[_0xe510('0x79')](function(_0x317250){socket[_0xe510('0x7a')](_0xe510('0x7b'),{'UserId':_0x317250['id'],'ChatQueueId':_0x3ff24c['id']});});});});});}})[_0xe510('0x1e')](respondWithStatusCode(_0x5e6769,null))[_0xe510('0x28')](handleError(_0x5e6769,null));};exports[_0xe510('0x7c')]=function(_0x5828e7,_0x55ba1f,_0x411792){return db[_0xe510('0x70')]['findAll']({'where':{'id':_0x5828e7['query'][_0xe510('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe510('0x7d'),'attributes':['id'],'raw':!![]}]})[_0xe510('0x1e')](handleEntityNotFound(_0x55ba1f,null))[_0xe510('0x1e')](function(_0x371fa2){var _0x3e49a3=_['map'](_0x371fa2,'id');var _0x1405ff=[];var _0x2bd3a5=[];var _0x31f79b=squel[_0xe510('0x7e')]();_0x31f79b[_0xe510('0x7f')](_0xe510('0x80'))[_0xe510('0x81')](_0xe510('0x82'),'tq')['join'](_0xe510('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x5828e7['params']['id']);for(var _0x362cba=0x0;_0x362cba<_0x371fa2[_0xe510('0x46')];_0x362cba+=0x1){let _0x14c6e7=_0x371fa2[_0x362cba];for(var _0x499efb=0x0;_0x499efb<_0x14c6e7[_0xe510('0x7d')][_0xe510('0x46')];_0x499efb+=0x1){let _0x14b23d=_0x14c6e7[_0xe510('0x7d')][_0x499efb];var _0x9df798=_0x31f79b[_0xe510('0x84')]();_0x9df798[_0xe510('0x4b')](_0xe510('0x85'),_0x14b23d['id']);_0x2bd3a5[_0xe510('0x86')](db['sequelize'][_0xe510('0x41')](_0x9df798['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xe510('0x1e')](function(_0x346a4c){if(_0x346a4c[_0xe510('0x46')]===0x1){return _0x14b23d['id'];}else{var _0x47fca3=_[_0xe510('0x87')](_[_0xe510('0x3b')](_0x346a4c,'TeamId'),function(_0x1112bb){return _['includes'](_0x3e49a3,_0x1112bb);});if(_0x47fca3){return _0x14b23d['id'];}}}));}}return BPromise[_0xe510('0x88')](_0x2bd3a5)['then'](function(_0x33cc4a){_0x1405ff=_(_0x1405ff)['union'](_0x33cc4a)['compact']()[_0xe510('0x89')]();return db['ChatQueue'][_0xe510('0x58')]({'where':{'id':_0x5828e7[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](function(_0x57f4b4){return db[_0xe510('0x8a')]['transaction'](function(_0x1e5886){return _0x57f4b4[_0xe510('0x7c')](_0x5828e7[_0xe510('0x41')]['ids'],{'transaction':_0x1e5886})[_0xe510('0x1e')](function(){if(!_[_0xe510('0x8b')](_0x1405ff)){return _0x57f4b4[_0xe510('0x8c')](_0x1405ff,{'transaction':_0x1e5886});}})[_0xe510('0x1e')](function(){_0x1405ff[_0xe510('0x79')](function(_0x33ed07){socket['emit']('userChatQueue:remove',{'UserId':_0x33ed07,'ChatQueueId':_0x57f4b4['id']});});});});});});})[_0xe510('0x1e')](respondWithStatusCode(_0x55ba1f,null))[_0xe510('0x28')](handleError(_0x55ba1f,null));};exports['addAgents']=function(_0x25464a,_0x1ea073,_0x337122){return db['ChatQueue'][_0xe510('0x58')]({'where':{'id':_0x25464a[_0xe510('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ea073,null))[_0xe510('0x1e')](function(_0x5ae6be){if(_0x5ae6be){return _0x5ae6be['addAgents'](_0x25464a[_0xe510('0x5a')][_0xe510('0x72')],_[_0xe510('0x8d')](_0x25464a[_0xe510('0x5a')],['ids','id'])||{})[_0xe510('0x8e')](function(_0xd1b551){for(var _0x4b6a66=0x0;_0x4b6a66<_0x25464a[_0xe510('0x5a')][_0xe510('0x72')][_0xe510('0x46')];_0x4b6a66+=0x1){socket[_0xe510('0x7a')](_0xe510('0x7b'),{'UserId':Number(_0x25464a[_0xe510('0x5a')][_0xe510('0x72')][_0x4b6a66]),'ChatQueueId':Number(_0x25464a[_0xe510('0x56')]['id'])});}return _0xd1b551;});}})[_0xe510('0x1e')](respondWithResult(_0x1ea073,null))[_0xe510('0x28')](handleError(_0x1ea073,null));};exports[_0xe510('0x8c')]=function(_0x5698bd,_0x21dde2,_0x4fefd8){return db[_0xe510('0x3c')]['find']({'where':{'id':_0x5698bd[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0x21dde2,null))[_0xe510('0x1e')](function(_0x587fc6){if(_0x587fc6){return _0x587fc6[_0xe510('0x8c')](_0x5698bd['query'][_0xe510('0x72')])[_0xe510('0x1e')](function(){if(_[_0xe510('0x8f')](_0x5698bd['query'][_0xe510('0x72')])){for(var _0x32aab7=0x0;_0x32aab7<_0x5698bd['query'][_0xe510('0x72')][_0xe510('0x46')];_0x32aab7+=0x1){socket['emit'](_0xe510('0x90'),{'UserId':Number(_0x5698bd['query'][_0xe510('0x72')][_0x32aab7]),'ChatQueueId':Number(_0x5698bd[_0xe510('0x56')]['id'])});}}else{socket[_0xe510('0x7a')](_0xe510('0x90'),{'UserId':Number(_0x5698bd['query'][_0xe510('0x72')]),'ChatQueueId':Number(_0x5698bd[_0xe510('0x56')]['id'])});}});}})[_0xe510('0x1e')](respondWithStatusCode(_0x21dde2,null))[_0xe510('0x28')](handleError(_0x21dde2,null));};exports[_0xe510('0x91')]=function(_0x2afe5e,_0x498ef0,_0x18e6ed){var _0x4f58ac={};var _0x2e7df1={};var _0x131b7a;var _0x132e73;return db[_0xe510('0x3c')][_0xe510('0x64')]({'where':{'id':_0x2afe5e[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0x498ef0,null))[_0xe510('0x1e')](function(_0xecfa45){if(_0xecfa45){_0x131b7a=_0xecfa45;_0x2e7df1[_0xe510('0x40')]=_['keys'](db['User']['rawAttributes']);_0x2e7df1['query']=_['keys'](_0x2afe5e[_0xe510('0x41')]);_0x2e7df1['filters']=_[_0xe510('0x43')](_0x2e7df1[_0xe510('0x40')],_0x2e7df1[_0xe510('0x41')]);_0x4f58ac[_0xe510('0x44')]=_[_0xe510('0x43')](_0x2e7df1[_0xe510('0x40')],qs['fields'](_0x2afe5e['query'][_0xe510('0x45')]));_0x4f58ac[_0xe510('0x44')]=_0x4f58ac['attributes'][_0xe510('0x46')]?_0x4f58ac[_0xe510('0x44')]:_0x2e7df1['model'];_0x4f58ac[_0xe510('0x49')]=qs['sort'](_0x2afe5e[_0xe510('0x41')][_0xe510('0x4a')]);_0x4f58ac['where']=qs['filters'](_[_0xe510('0x4c')](_0x2afe5e['query'],_0x2e7df1[_0xe510('0x4d')]));if(_0x2afe5e[_0xe510('0x41')][_0xe510('0x4e')]){_0x4f58ac[_0xe510('0x4b')]=_[_0xe510('0x4f')](_0x4f58ac[_0xe510('0x4b')],{'$or':_['map'](_0x4f58ac[_0xe510('0x44')],function(_0x3343cd){var _0x305132={};_0x305132[_0x3343cd]={'$like':'%'+_0x2afe5e[_0xe510('0x41')]['filter']+'%'};return _0x305132;})});}_0x4f58ac=_[_0xe510('0x4f')]({},_0x4f58ac,_0x2afe5e[_0xe510('0x51')]);return _0x131b7a[_0xe510('0x91')](_0x4f58ac);}})[_0xe510('0x1e')](function(_0x4b043c){if(_0x4b043c){_0x132e73=_0x4b043c['length'];if(!_0x2afe5e[_0xe510('0x41')][_0xe510('0x47')](_0xe510('0x48'))){_0x4f58ac[_0xe510('0x2d')]=qs[_0xe510('0x2d')](_0x2afe5e[_0xe510('0x41')][_0xe510('0x2d')]);_0x4f58ac[_0xe510('0x30')]=qs['offset'](_0x2afe5e[_0xe510('0x41')][_0xe510('0x30')]);}return _0x131b7a[_0xe510('0x91')](_0x4f58ac);}})['then'](function(_0x3ce968){if(_0x3ce968){return _0x3ce968?{'count':_0x132e73,'rows':_0x3ce968}:null;}})['then'](respondWithResult(_0x498ef0,null))['catch'](handleError(_0x498ef0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 42df1f8..3c78c59 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 _0x3f95=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x3f95,0x153));var _0x53f9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3f95[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x53f9('0x0'));var ChatQueue=require(_0x53f9('0x1'))['db'][_0x53f9('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x53f9('0x3')](0x0);var events={'afterCreate':_0x53f9('0x4'),'afterUpdate':_0x53f9('0x5'),'afterDestroy':_0x53f9('0x6')};function emitEvent(_0x2c4985){return function(_0x604c5a,_0xa86209,_0x41bfe3){ChatQueueEvents[_0x53f9('0x7')](_0x2c4985+':'+_0x604c5a['id'],_0x604c5a);ChatQueueEvents[_0x53f9('0x7')](_0x2c4985,_0x604c5a);_0x41bfe3(null);};}for(var e in events){if(events[_0x53f9('0x8')](e)){var event=events[e];ChatQueue[_0x53f9('0x9')](e,emitEvent(event));}}module[_0x53f9('0xa')]=ChatQueueEvents;
\ No newline at end of file
+var _0x3bde=['../../mysqldb','ChatQueue','setMaxListeners','emit','hasOwnProperty','hook','events'];(function(_0x2840f7,_0x443096){var _0x9c65da=function(_0x5a30d6){while(--_0x5a30d6){_0x2840f7['push'](_0x2840f7['shift']());}};_0x9c65da(++_0x443096);}(_0x3bde,0x68));var _0xe3bd=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x3bde[_0x1573ea];return _0x51c0e2;};'use strict';var EventEmitter=require(_0xe3bd('0x0'));var ChatQueue=require(_0xe3bd('0x1'))['db'][_0xe3bd('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe3bd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a9511){return function(_0x4a2a7f,_0x17c2bd,_0x276ae8){ChatQueueEvents[_0xe3bd('0x4')](_0x4a9511+':'+_0x4a2a7f['id'],_0x4a2a7f);ChatQueueEvents[_0xe3bd('0x4')](_0x4a9511,_0x4a2a7f);_0x276ae8(null);};}for(var e in events){if(events[_0xe3bd('0x5')](e)){var event=events[e];ChatQueue[_0xe3bd('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 7686a80..096d733 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 _0xf6e3=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x4bab56,_0xb67586){var _0x49ccdc=function(_0x407c67){while(--_0x407c67){_0x4bab56['push'](_0x4bab56['shift']());}};_0x49ccdc(++_0xb67586);}(_0xf6e3,0xb9));var _0x3f6e=function(_0x2e033f,_0x1517ba){_0x2e033f=_0x2e033f-0x0;var _0x452338=_0xf6e3[_0x2e033f];return _0x452338;};'use strict';var _=require(_0x3f6e('0x0'));var util=require(_0x3f6e('0x1'));var logger=require(_0x3f6e('0x2'))(_0x3f6e('0x3'));var moment=require(_0x3f6e('0x4'));var BPromise=require(_0x3f6e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3f6e('0x6'));var config=require(_0x3f6e('0x7'));var attributes=require(_0x3f6e('0x8'));module[_0x3f6e('0x9')]=function(_0x12bbcd,_0x12c191){return _0x12bbcd[_0x3f6e('0xa')](_0x3f6e('0xb'),attributes,{'tableName':_0x3f6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdb0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue'];(function(_0x39c43e,_0x2a01e0){var _0x5458ad=function(_0x8c710c){while(--_0x8c710c){_0x39c43e['push'](_0x39c43e['shift']());}};_0x5458ad(++_0x2a01e0);}(_0xfdb0,0x6c));var _0x0fdb=function(_0xd21f9c,_0x869969){_0xd21f9c=_0xd21f9c-0x0;var _0x5bd476=_0xfdb0[_0xd21f9c];return _0x5bd476;};'use strict';var _=require(_0x0fdb('0x0'));var util=require(_0x0fdb('0x1'));var logger=require(_0x0fdb('0x2'))(_0x0fdb('0x3'));var moment=require(_0x0fdb('0x4'));var BPromise=require(_0x0fdb('0x5'));var rp=require(_0x0fdb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fdb('0x7'));var config=require(_0x0fdb('0x8'));var attributes=require(_0x0fdb('0x9'));module[_0x0fdb('0xa')]=function(_0x4e5ca7,_0x1bb39a){return _0x4e5ca7['define'](_0x0fdb('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 2ab82fa..dcd7717 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 _0xb4e5=['GetChatQueue','findAll','options','raw','attributes','limit','include','model','map','then','ShowChatQueue','ChatQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0xb4e5,0x104));var _0x5b4e=function(_0x575871,_0x4449c8){_0x575871=_0x575871-0x0;var _0x44d15c=_0xb4e5[_0x575871];return _0x44d15c;};'use strict';var _=require(_0x5b4e('0x0'));var util=require('util');var moment=require(_0x5b4e('0x1'));var BPromise=require(_0x5b4e('0x2'));var rs=require(_0x5b4e('0x3'));var fs=require('fs');var Redis=require(_0x5b4e('0x4'));var db=require(_0x5b4e('0x5'))['db'];var utils=require(_0x5b4e('0x6'));var logger=require(_0x5b4e('0x7'))(_0x5b4e('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b4e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x5b4e('0xa')]=_[_0x5b4e('0xb')](config['redis'],{'host':_0x5b4e('0xc'),'port':0x18eb});var socket=require(_0x5b4e('0xd'))(new Redis(config[_0x5b4e('0xa')]));require(_0x5b4e('0xe'))[_0x5b4e('0xf')](socket);function respondWithRpcPromise(_0x36944e,_0x3ff333,_0x161d8e){return new BPromise(function(_0x4143c4,_0x2b8afd){return client[_0x5b4e('0x10')](_0x36944e,_0x161d8e)['then'](function(_0x186c47){logger[_0x5b4e('0x11')](_0x5b4e('0x12'),_0x3ff333,_0x5b4e('0x13'));logger[_0x5b4e('0x14')](_0x5b4e('0x15'),_0x3ff333,_0x5b4e('0x13'),JSON[_0x5b4e('0x16')](_0x186c47));if(_0x186c47['error']){if(_0x186c47[_0x5b4e('0x17')]['code']===0x1f4){logger[_0x5b4e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x3ff333,_0x186c47[_0x5b4e('0x17')][_0x5b4e('0x18')]);return _0x2b8afd(_0x186c47[_0x5b4e('0x17')][_0x5b4e('0x18')]);}logger[_0x5b4e('0x17')](_0x5b4e('0x12'),_0x3ff333,_0x186c47['error'][_0x5b4e('0x18')]);return _0x4143c4(_0x186c47[_0x5b4e('0x17')]['message']);}else{logger[_0x5b4e('0x11')](_0x5b4e('0x12'),_0x3ff333,_0x5b4e('0x13'));_0x4143c4(_0x186c47[_0x5b4e('0x19')][_0x5b4e('0x18')]);}})[_0x5b4e('0x1a')](function(_0x22f4d0){logger['error'](_0x5b4e('0x12'),_0x3ff333,_0x22f4d0);_0x2b8afd(_0x22f4d0);});});}exports[_0x5b4e('0x1b')]=function(_0x241947){var _0x2d798d=this;return new Promise(function(_0x32439f,_0x4fa79a){return db['ChatQueue'][_0x5b4e('0x1c')]({'raw':_0x241947['options']?_0x241947[_0x5b4e('0x1d')][_0x5b4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x241947['options']?_0x241947[_0x5b4e('0x1d')]['where']||null:null,'attributes':_0x241947[_0x5b4e('0x1d')]?_0x241947[_0x5b4e('0x1d')][_0x5b4e('0x1f')]||null:null,'limit':_0x241947['options']?_0x241947[_0x5b4e('0x1d')][_0x5b4e('0x20')]||null:null,'include':_0x241947[_0x5b4e('0x1d')]?_0x241947[_0x5b4e('0x1d')]['include']?_['map'](_0x241947['options'][_0x5b4e('0x21')],function(_0x36bfaf){return{'model':db[_0x36bfaf[_0x5b4e('0x22')]],'as':_0x36bfaf['as'],'attributes':_0x36bfaf[_0x5b4e('0x1f')],'include':_0x36bfaf[_0x5b4e('0x21')]?_[_0x5b4e('0x23')](_0x36bfaf[_0x5b4e('0x21')],function(_0x2a9aa6){return{'model':db[_0x2a9aa6[_0x5b4e('0x22')]],'as':_0x2a9aa6['as'],'attributes':_0x2a9aa6[_0x5b4e('0x1f')],'include':_0x2a9aa6[_0x5b4e('0x21')]?_[_0x5b4e('0x23')](_0x2a9aa6['include'],function(_0x37e4fd){return{'model':db[_0x37e4fd[_0x5b4e('0x22')]],'as':_0x37e4fd['as'],'attributes':_0x37e4fd[_0x5b4e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5b4e('0x24')](function(_0x305e68){logger['info'](_0x5b4e('0x1b'),_0x241947);logger['debug'](_0x5b4e('0x1b'),_0x241947,JSON['stringify'](_0x305e68));_0x32439f(_0x305e68);})['catch'](function(_0x3a22ea){logger[_0x5b4e('0x17')](_0x5b4e('0x1b'),_0x3a22ea[_0x5b4e('0x18')],_0x241947);_0x4fa79a(_0x2d798d[_0x5b4e('0x17')](0x1f4,_0x3a22ea[_0x5b4e('0x18')]));});});};exports[_0x5b4e('0x25')]=function(_0x432ae0){var _0x1e3f8f=this;return new Promise(function(_0x363a5a,_0x38c0d2){return db[_0x5b4e('0x26')][_0x5b4e('0x27')]({'raw':_0x432ae0[_0x5b4e('0x1d')]?_0x432ae0[_0x5b4e('0x1d')][_0x5b4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x432ae0[_0x5b4e('0x1d')]?_0x432ae0[_0x5b4e('0x1d')][_0x5b4e('0x28')]||null:null,'attributes':_0x432ae0[_0x5b4e('0x1d')]?_0x432ae0[_0x5b4e('0x1d')][_0x5b4e('0x1f')]||null:null,'include':_0x432ae0['options']?_0x432ae0['options'][_0x5b4e('0x21')]?_[_0x5b4e('0x23')](_0x432ae0[_0x5b4e('0x1d')]['include'],function(_0x268dcc){return{'model':db[_0x268dcc[_0x5b4e('0x22')]],'as':_0x268dcc['as'],'attributes':_0x268dcc[_0x5b4e('0x1f')],'include':_0x268dcc['include']?_[_0x5b4e('0x23')](_0x268dcc[_0x5b4e('0x21')],function(_0x4bff4d){return{'model':db[_0x4bff4d[_0x5b4e('0x22')]],'as':_0x4bff4d['as'],'attributes':_0x4bff4d['attributes'],'include':_0x4bff4d[_0x5b4e('0x21')]?_[_0x5b4e('0x23')](_0x4bff4d[_0x5b4e('0x21')],function(_0x53da7f){return{'model':db[_0x53da7f['model']],'as':_0x53da7f['as'],'attributes':_0x53da7f[_0x5b4e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x200f78){logger[_0x5b4e('0x11')](_0x5b4e('0x25'),_0x432ae0);logger[_0x5b4e('0x14')](_0x5b4e('0x25'),_0x432ae0,JSON[_0x5b4e('0x16')](_0x200f78));_0x363a5a(_0x200f78);})['catch'](function(_0x599110){logger[_0x5b4e('0x17')](_0x5b4e('0x25'),_0x599110[_0x5b4e('0x18')],_0x432ae0);_0x38c0d2(_0x1e3f8f[_0x5b4e('0x17')](0x1f4,_0x599110[_0x5b4e('0x18')]));});});};
\ No newline at end of file
+var _0xab40=['GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','catch','ShowChatQueue','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xab40,0xcd));var _0x0ab4=function(_0x90db4,_0x5911db){_0x90db4=_0x90db4-0x0;var _0x3d4960=_0xab40[_0x90db4];return _0x3d4960;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});config[_0x0ab4('0x8')]=_[_0x0ab4('0x9')](config[_0x0ab4('0x8')],{'host':_0x0ab4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x0ab4('0xb')](socket);function respondWithRpcPromise(_0x30e726,_0x40e4d1,_0x464f7e){return new BPromise(function(_0x413d9b,_0x24c6c1){return client[_0x0ab4('0xc')](_0x30e726,_0x464f7e)[_0x0ab4('0xd')](function(_0x4e1708){logger['info'](_0x0ab4('0xe'),_0x40e4d1,'request\x20sent');logger[_0x0ab4('0xf')](_0x0ab4('0x10'),_0x40e4d1,_0x0ab4('0x11'),JSON[_0x0ab4('0x12')](_0x4e1708));if(_0x4e1708[_0x0ab4('0x13')]){if(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x14')]===0x1f4){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x24c6c1(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);}logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x413d9b(_0x4e1708[_0x0ab4('0x13')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x40e4d1,_0x0ab4('0x11'));_0x413d9b(_0x4e1708[_0x0ab4('0x16')][_0x0ab4('0x15')]);}})['catch'](function(_0x1e3fe2){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x1e3fe2);_0x24c6c1(_0x1e3fe2);});});}exports[_0x0ab4('0x17')]=function(_0x4e7852){var _0x4ff836=this;return new Promise(function(_0xdb0797,_0x5b1ed5){return db[_0x0ab4('0x18')][_0x0ab4('0x19')]({'raw':_0x4e7852['options']?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1c')]||null:null,'attributes':_0x4e7852['options']?_0x4e7852['options'][_0x0ab4('0x1d')]||null:null,'limit':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1e')]||null:null,'include':_0x4e7852['options']?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x4e7852['options']['include'],function(_0x176ff1){return{'model':db[_0x176ff1[_0x0ab4('0x21')]],'as':_0x176ff1['as'],'attributes':_0x176ff1[_0x0ab4('0x1d')],'include':_0x176ff1['include']?_['map'](_0x176ff1['include'],function(_0x19ecc6){return{'model':db[_0x19ecc6['model']],'as':_0x19ecc6['as'],'attributes':_0x19ecc6[_0x0ab4('0x1d')],'include':_0x19ecc6[_0x0ab4('0x1f')]?_['map'](_0x19ecc6['include'],function(_0x4d0cc1){return{'model':db[_0x4d0cc1[_0x0ab4('0x21')]],'as':_0x4d0cc1['as'],'attributes':_0x4d0cc1[_0x0ab4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0ab4('0xd')](function(_0x3f61cb){logger[_0x0ab4('0x22')]('GetChatQueue',_0x4e7852);logger['debug']('GetChatQueue',_0x4e7852,JSON[_0x0ab4('0x12')](_0x3f61cb));_0xdb0797(_0x3f61cb);})[_0x0ab4('0x23')](function(_0x155d96){logger[_0x0ab4('0x13')](_0x0ab4('0x17'),_0x155d96['message'],_0x4e7852);_0x5b1ed5(_0x4ff836['error'](0x1f4,_0x155d96[_0x0ab4('0x15')]));});});};exports[_0x0ab4('0x24')]=function(_0x361f7c){var _0x4819be=this;return new Promise(function(_0x48e430,_0x1b19db){return db['ChatQueue'][_0x0ab4('0x25')]({'raw':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![],'where':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')]['where']||null:null,'attributes':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1d')]||null:null,'include':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c['options']['include']?_[_0x0ab4('0x20')](_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1f')],function(_0x4fca1b){return{'model':db[_0x4fca1b['model']],'as':_0x4fca1b['as'],'attributes':_0x4fca1b['attributes'],'include':_0x4fca1b[_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x4fca1b[_0x0ab4('0x1f')],function(_0x53d1fc){return{'model':db[_0x53d1fc['model']],'as':_0x53d1fc['as'],'attributes':_0x53d1fc['attributes'],'include':_0x53d1fc[_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x53d1fc[_0x0ab4('0x1f')],function(_0x39d99b){return{'model':db[_0x39d99b[_0x0ab4('0x21')]],'as':_0x39d99b['as'],'attributes':_0x39d99b[_0x0ab4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0ab4('0xd')](function(_0xfb7f92){logger[_0x0ab4('0x22')](_0x0ab4('0x24'),_0x361f7c);logger['debug'](_0x0ab4('0x24'),_0x361f7c,JSON[_0x0ab4('0x12')](_0xfb7f92));_0x48e430(_0xfb7f92);})[_0x0ab4('0x23')](function(_0x97d4ad){logger[_0x0ab4('0x13')](_0x0ab4('0x24'),_0x97d4ad[_0x0ab4('0x15')],_0x361f7c);_0x1b19db(_0x4819be[_0x0ab4('0x13')](0x1f4,_0x97d4ad[_0x0ab4('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index f23c9c3..a15b072 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3140=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x35dd20,_0x48eb70){var _0xcca198=function(_0x17d104){while(--_0x17d104){_0x35dd20['push'](_0x35dd20['shift']());}};_0xcca198(++_0x48eb70);}(_0x3140,0xaf));var _0x0314=function(_0x3ad1ab,_0x3c8799){_0x3ad1ab=_0x3ad1ab-0x0;var _0x26d4c9=_0x3140[_0x3ad1ab];return _0x26d4c9;};'use strict';var ChatQueueEvents=require(_0x0314('0x0'));var events=[_0x0314('0x1'),_0x0314('0x2'),_0x0314('0x3')];function createListener(_0x4ac557,_0x4cf353){return function(_0x285be5){_0x4cf353[_0x0314('0x4')](_0x4ac557,_0x285be5);};}function removeListener(_0x1c0f66,_0x3e4284){return function(){ChatQueueEvents[_0x0314('0x5')](_0x1c0f66,_0x3e4284);};}exports[_0x0314('0x6')]=function(_0x9e308d){for(var _0xf87d26=0x0,_0x11ee94=events[_0x0314('0x7')];_0xf87d26<_0x11ee94;_0xf87d26++){var _0x176944=events[_0xf87d26];var _0x495b27=createListener(_0x0314('0x8')+_0x176944,_0x9e308d);ChatQueueEvents['on'](_0x176944,_0x495b27);}};
\ No newline at end of file
+var _0x68fc=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x2cde2a,_0x4325c4){var _0x110f55=function(_0x4927f5){while(--_0x4927f5){_0x2cde2a['push'](_0x2cde2a['shift']());}};_0x110f55(++_0x4325c4);}(_0x68fc,0xa5));var _0xc68f=function(_0x58335a,_0x44b6bf){_0x58335a=_0x58335a-0x0;var _0x5be056=_0x68fc[_0x58335a];return _0x5be056;};'use strict';var ChatQueueEvents=require(_0xc68f('0x0'));var events=[_0xc68f('0x1'),_0xc68f('0x2'),'update'];function createListener(_0x49aa95,_0x26513f){return function(_0x506fb5){_0x26513f[_0xc68f('0x3')](_0x49aa95,_0x506fb5);};}function removeListener(_0x593648,_0x5899ea){return function(){ChatQueueEvents[_0xc68f('0x4')](_0x593648,_0x5899ea);};}exports[_0xc68f('0x5')]=function(_0x1c6df9){for(var _0x363cdf=0x0,_0x4fcce4=events['length'];_0x363cdf<_0x4fcce4;_0x363cdf++){var _0x9f2705=events[_0x363cdf];var _0x2bf3fd=createListener(_0xc68f('0x6')+_0x9f2705,_0x1c6df9);ChatQueueEvents['on'](_0x9f2705,_0x2bf3fd);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 5be0d81..13a6641 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(_0x361f37,_0x297b1d){var _0x3f151f=function(_0x71140){while(--_0x71140){_0x361f37['push'](_0x361f37['shift']());}};_0x3f151f(++_0x297b1d);}(_0x814b,0x1a2));var _0xb814=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x814b[_0x4b2b03];return _0x1bf0ed;};'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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5573ee,_0x3db368){var _0x123163=function(_0x5a92db){while(--_0x5a92db){_0x5573ee['push'](_0x5573ee['shift']());}};_0x123163(++_0x3db368);}(_0x008c,0x188));var _0xc008=function(_0x568d30,_0x50fceb){_0x568d30=_0x568d30-0x0;var _0xabb817=_0x008c[_0x568d30];return _0xabb817;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index f425b4d..dac5702 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 _0x7511=['sequelize','exports','STRING','DATE','moment'];(function(_0x5846b4,_0x2a47f9){var _0x49a222=function(_0x1387cb){while(--_0x1387cb){_0x5846b4['push'](_0x5846b4['shift']());}};_0x49a222(++_0x2a47f9);}(_0x7511,0x86));var _0x1751=function(_0x544463,_0x214963){_0x544463=_0x544463-0x0;var _0x1add2a=_0x7511[_0x544463];return _0x1add2a;};'use strict';var moment=require(_0x1751('0x0'));var Sequelize=require(_0x1751('0x1'));module[_0x1751('0x2')]={'uniqueid':{'type':Sequelize[_0x1751('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1751('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1751('0x4')]},'exitAt':{'type':Sequelize[_0x1751('0x4')]},'reason':{'type':Sequelize[_0x1751('0x3')]}};
\ No newline at end of file
+var _0xd88c=['sequelize','exports','STRING','DATE','moment'];(function(_0xbcb09a,_0x4ce38b){var _0x2cf112=function(_0x4a3849){while(--_0x4a3849){_0xbcb09a['push'](_0xbcb09a['shift']());}};_0x2cf112(++_0x4ce38b);}(_0xd88c,0x162));var _0xcd88=function(_0x39d711,_0xe11eb7){_0x39d711=_0x39d711-0x0;var _0xee1d0c=_0xd88c[_0x39d711];return _0xee1d0c;};'use strict';var moment=require(_0xcd88('0x0'));var Sequelize=require(_0xcd88('0x1'));module[_0xcd88('0x2')]={'uniqueid':{'type':Sequelize[_0xcd88('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcd88('0x4')]},'leaveAt':{'type':Sequelize[_0xcd88('0x4')]},'acceptAt':{'type':Sequelize[_0xcd88('0x4')]},'exitAt':{'type':Sequelize[_0xcd88('0x4')]},'reason':{'type':Sequelize[_0xcd88('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 27fa9e1..d64238d 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbb9=['map','ChatQueueReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','stack','name','index'];(function(_0x20c47c,_0x116409){var _0x4793e9=function(_0x4d0cfa){while(--_0x4d0cfa){_0x20c47c['push'](_0x20c47c['shift']());}};_0x4793e9(++_0x116409);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x16021e,_0x418f89){_0x16021e=_0x16021e-0x0;var _0x8bd8cb=_0xdbb9[_0x16021e];return _0x8bd8cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9dbb('0x0'));var zipdir=require(_0x9dbb('0x1'));var jsonpatch=require(_0x9dbb('0x2'));var rp=require(_0x9dbb('0x3'));var moment=require('moment');var BPromise=require(_0x9dbb('0x4'));var Mustache=require(_0x9dbb('0x5'));var util=require(_0x9dbb('0x6'));var path=require(_0x9dbb('0x7'));var sox=require(_0x9dbb('0x8'));var csv=require(_0x9dbb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dbb('0xa'));var crypto=require(_0x9dbb('0xb'));var jsforce=require(_0x9dbb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9dbb('0xd'));var Papa=require(_0x9dbb('0xe'));var Redis=require(_0x9dbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9dbb('0x10'));var as=require(_0x9dbb('0x11'));var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))('api');var utils=require(_0x9dbb('0x14'));var config=require(_0x9dbb('0x15'));var licenseUtil=require(_0x9dbb('0x16'));var db=require(_0x9dbb('0x17'))['db'];function respondWithStatusCode(_0x3fe0bd,_0x4468e8){_0x4468e8=_0x4468e8||0xcc;return function(_0x382cc6){if(_0x382cc6){return _0x3fe0bd[_0x9dbb('0x18')](_0x4468e8);}return _0x3fe0bd[_0x9dbb('0x19')](_0x4468e8)[_0x9dbb('0x1a')]();};}function respondWithResult(_0x293028,_0x2c36d3){_0x2c36d3=_0x2c36d3||0xc8;return function(_0x24b20b){if(_0x24b20b){return _0x293028[_0x9dbb('0x19')](_0x2c36d3)[_0x9dbb('0x1b')](_0x24b20b);}};}function respondWithFilteredResult(_0x464df5,_0x528110){return function(_0x1366b2){if(_0x1366b2){var _0x30add1=typeof _0x528110[_0x9dbb('0x1c')]===_0x9dbb('0x1d')&&typeof _0x528110[_0x9dbb('0x1e')]==='undefined';var _0x382d61=_0x1366b2[_0x9dbb('0x1f')];var _0x2383cf=_0x30add1?0x0:_0x528110[_0x9dbb('0x1c')];var _0x45c6f5=_0x30add1?_0x1366b2['count']:_0x528110[_0x9dbb('0x1c')]+_0x528110['limit'];var _0x3de435;if(_0x45c6f5>=_0x382d61){_0x45c6f5=_0x382d61;_0x3de435=0xc8;}else{_0x3de435=0xce;}_0x464df5['status'](_0x3de435);return _0x464df5[_0x9dbb('0x20')]('Content-Range',_0x2383cf+'-'+_0x45c6f5+'/'+_0x382d61)[_0x9dbb('0x1b')](_0x1366b2);}return null;};}function patchUpdates(_0x192eb5){return function(_0x188c75){try{jsonpatch['apply'](_0x188c75,_0x192eb5,!![]);}catch(_0x50e5e3){return BPromise['reject'](_0x50e5e3);}return _0x188c75[_0x9dbb('0x21')]();};}function saveUpdates(_0x35c136,_0x48bb65){return function(_0x4a07ef){if(_0x4a07ef){return _0x4a07ef['update'](_0x35c136)[_0x9dbb('0x22')](function(_0x245d12){return _0x245d12;});}return null;};}function removeEntity(_0x10c06a,_0x55e2ef){return function(_0x1f30ec){if(_0x1f30ec){return _0x1f30ec[_0x9dbb('0x23')]()[_0x9dbb('0x22')](function(){_0x10c06a[_0x9dbb('0x19')](0xcc)[_0x9dbb('0x1a')]();});}};}function handleEntityNotFound(_0x3e51ca,_0x668f7b){return function(_0x187486){if(!_0x187486){_0x3e51ca[_0x9dbb('0x18')](0x194);}return _0x187486;};}function handleError(_0x127742,_0x25614a){_0x25614a=_0x25614a||0x1f4;return function(_0x27a6f6){logger['error'](_0x27a6f6[_0x9dbb('0x24')]);if(_0x27a6f6['name']){delete _0x27a6f6[_0x9dbb('0x25')];}_0x127742[_0x9dbb('0x19')](_0x25614a)['send'](_0x27a6f6);};}exports[_0x9dbb('0x26')]=function(_0x4ebd57,_0x4b5ce1){var _0x589f63={},_0x25555c={},_0x3578b3={'count':0x0,'rows':[]};var _0x491324=_[_0x9dbb('0x27')](db[_0x9dbb('0x28')]['rawAttributes'],function(_0x71692a){return{'name':_0x71692a[_0x9dbb('0x29')],'type':_0x71692a[_0x9dbb('0x2a')]['key']};});_0x25555c[_0x9dbb('0x2b')]=_['map'](_0x491324,_0x9dbb('0x25'));_0x25555c[_0x9dbb('0x2c')]=_[_0x9dbb('0x2d')](_0x4ebd57[_0x9dbb('0x2c')]);_0x25555c[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],_0x25555c[_0x9dbb('0x2c')]);_0x589f63[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],qs['fields'](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x31')]));_0x589f63[_0x9dbb('0x30')]=_0x589f63[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x589f63[_0x9dbb('0x30')]:_0x25555c[_0x9dbb('0x2b')];if(!_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x33')](_0x9dbb('0x34'))){_0x589f63[_0x9dbb('0x1e')]=qs[_0x9dbb('0x1e')](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x1e')]);_0x589f63[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x4ebd57[_0x9dbb('0x2c')]['offset']);}_0x589f63[_0x9dbb('0x35')]=qs[_0x9dbb('0x36')](_0x4ebd57[_0x9dbb('0x2c')]['sort']);_0x589f63[_0x9dbb('0x37')]=qs[_0x9dbb('0x2e')](_[_0x9dbb('0x38')](_0x4ebd57[_0x9dbb('0x2c')],_0x25555c[_0x9dbb('0x2e')]),_0x491324);if(_0x4ebd57[_0x9dbb('0x2c')]['filter']){_0x589f63[_0x9dbb('0x37')]=_['merge'](_0x589f63[_0x9dbb('0x37')],{'$or':_[_0x9dbb('0x27')](_0x491324,function(_0xa3bc3){if(_0xa3bc3[_0x9dbb('0x2a')]!=='VIRTUAL'){var _0x1a5eeb={};_0x1a5eeb[_0xa3bc3['name']]={'$like':'%'+_0x4ebd57[_0x9dbb('0x2c')]['filter']+'%'};return _0x1a5eeb;}})});}_0x589f63=_[_0x9dbb('0x39')]({},_0x589f63,_0x4ebd57[_0x9dbb('0x3a')]);var _0x34524e={'where':_0x589f63[_0x9dbb('0x37')]};return db[_0x9dbb('0x28')]['count'](_0x34524e)[_0x9dbb('0x22')](function(_0x59eea1){_0x3578b3[_0x9dbb('0x1f')]=_0x59eea1;if(_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x3b')]){_0x589f63[_0x9dbb('0x3c')]=[{'all':!![]}];}return db[_0x9dbb('0x28')][_0x9dbb('0x3d')](_0x589f63);})[_0x9dbb('0x22')](function(_0x49e63f){_0x3578b3[_0x9dbb('0x3e')]=_0x49e63f;return _0x3578b3;})['then'](respondWithFilteredResult(_0x4b5ce1,_0x589f63))[_0x9dbb('0x3f')](handleError(_0x4b5ce1,null));};exports[_0x9dbb('0x40')]=function(_0x34c114,_0x104ec5){var _0x490833={'raw':!![],'where':{'id':_0x34c114['params']['id']}},_0x2f99ed={};_0x2f99ed[_0x9dbb('0x2b')]=_['keys'](db[_0x9dbb('0x28')][_0x9dbb('0x41')]);_0x2f99ed['query']=_['keys'](_0x34c114[_0x9dbb('0x2c')]);_0x2f99ed[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],_0x2f99ed[_0x9dbb('0x2c')]);_0x490833[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],qs[_0x9dbb('0x31')](_0x34c114['query'][_0x9dbb('0x31')]));_0x490833['attributes']=_0x490833[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x490833[_0x9dbb('0x30')]:_0x2f99ed[_0x9dbb('0x2b')];if(_0x34c114['query'][_0x9dbb('0x3b')]){_0x490833['include']=[{'all':!![]}];}_0x490833=_['merge']({},_0x490833,_0x34c114[_0x9dbb('0x3a')]);return db[_0x9dbb('0x28')][_0x9dbb('0x42')](_0x490833)[_0x9dbb('0x22')](handleEntityNotFound(_0x104ec5,null))[_0x9dbb('0x22')](respondWithResult(_0x104ec5,null))[_0x9dbb('0x3f')](handleError(_0x104ec5,null));};exports['create']=function(_0x202235,_0x56d319){return db[_0x9dbb('0x28')][_0x9dbb('0x43')](_0x202235[_0x9dbb('0x44')],{})[_0x9dbb('0x22')](respondWithResult(_0x56d319,0xc9))[_0x9dbb('0x3f')](handleError(_0x56d319,null));};exports[_0x9dbb('0x45')]=function(_0x34304a,_0x31c532){if(_0x34304a['body']['id']){delete _0x34304a[_0x9dbb('0x44')]['id'];}return db['ChatQueueReport'][_0x9dbb('0x42')]({'where':{'id':_0x34304a[_0x9dbb('0x46')]['id']}})['then'](handleEntityNotFound(_0x31c532,null))[_0x9dbb('0x22')](saveUpdates(_0x34304a['body'],null))['then'](respondWithResult(_0x31c532,null))['catch'](handleError(_0x31c532,null));};exports[_0x9dbb('0x23')]=function(_0x3c19bb,_0x5c398b){return db[_0x9dbb('0x28')]['find']({'where':{'id':_0x3c19bb[_0x9dbb('0x46')]['id']}})[_0x9dbb('0x22')](handleEntityNotFound(_0x5c398b,null))[_0x9dbb('0x22')](removeEntity(_0x5c398b,null))[_0x9dbb('0x3f')](handleError(_0x5c398b,null));};exports[_0x9dbb('0x47')]=function(_0x6a6f55,_0x56ac9a){return db['ChatQueueReport'][_0x9dbb('0x47')]()[_0x9dbb('0x22')](respondWithResult(_0x56ac9a,null))['catch'](handleError(_0x56ac9a,null));};
\ No newline at end of file
+var _0x77f7=['name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1ac279,_0x4127cb){var _0x3ecefa=function(_0x144441){while(--_0x144441){_0x1ac279['push'](_0x1ac279['shift']());}};_0x3ecefa(++_0x4127cb);}(_0x77f7,0xbd));var _0x777f=function(_0xe5fedd,_0x5eda04){_0xe5fedd=_0xe5fedd-0x0;var _0x123fd0=_0x77f7[_0xe5fedd];return _0x123fd0;};'use strict';var emlformat=require(_0x777f('0x0'));var rimraf=require(_0x777f('0x1'));var zipdir=require(_0x777f('0x2'));var jsonpatch=require(_0x777f('0x3'));var rp=require(_0x777f('0x4'));var moment=require(_0x777f('0x5'));var BPromise=require(_0x777f('0x6'));var Mustache=require(_0x777f('0x7'));var util=require(_0x777f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x777f('0x9'));var ejs=require(_0x777f('0xa'));var fs=require('fs');var fs_extra=require(_0x777f('0xb'));var _=require(_0x777f('0xc'));var squel=require(_0x777f('0xd'));var crypto=require(_0x777f('0xe'));var jsforce=require(_0x777f('0xf'));var deskjs=require(_0x777f('0x10'));var toCsv=require(_0x777f('0x9'));var querystring=require(_0x777f('0x11'));var Papa=require('papaparse');var Redis=require(_0x777f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x777f('0x13'));var as=require(_0x777f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x777f('0x15'))(_0x777f('0x16'));var utils=require(_0x777f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x777f('0x18'));var db=require(_0x777f('0x19'))['db'];function respondWithStatusCode(_0x285bf7,_0x30f31b){_0x30f31b=_0x30f31b||0xcc;return function(_0xee481c){if(_0xee481c){return _0x285bf7[_0x777f('0x1a')](_0x30f31b);}return _0x285bf7['status'](_0x30f31b)[_0x777f('0x1b')]();};}function respondWithResult(_0x2cef15,_0x5468c0){_0x5468c0=_0x5468c0||0xc8;return function(_0x36652d){if(_0x36652d){return _0x2cef15[_0x777f('0x1c')](_0x5468c0)[_0x777f('0x1d')](_0x36652d);}};}function respondWithFilteredResult(_0x43d45a,_0xf4d60b){return function(_0x217e98){if(_0x217e98){var _0x41855a=typeof _0xf4d60b['offset']===_0x777f('0x1e')&&typeof _0xf4d60b[_0x777f('0x1f')]===_0x777f('0x1e');var _0x1ef1c5=_0x217e98[_0x777f('0x20')];var _0x3aeb58=_0x41855a?0x0:_0xf4d60b[_0x777f('0x21')];var _0x4e1153=_0x41855a?_0x217e98['count']:_0xf4d60b[_0x777f('0x21')]+_0xf4d60b[_0x777f('0x1f')];var _0x31f786;if(_0x4e1153>=_0x1ef1c5){_0x4e1153=_0x1ef1c5;_0x31f786=0xc8;}else{_0x31f786=0xce;}_0x43d45a[_0x777f('0x1c')](_0x31f786);return _0x43d45a[_0x777f('0x22')](_0x777f('0x23'),_0x3aeb58+'-'+_0x4e1153+'/'+_0x1ef1c5)[_0x777f('0x1d')](_0x217e98);}return null;};}function patchUpdates(_0x143f3d){return function(_0x5d31f1){try{jsonpatch[_0x777f('0x24')](_0x5d31f1,_0x143f3d,!![]);}catch(_0x5637d0){return BPromise[_0x777f('0x25')](_0x5637d0);}return _0x5d31f1[_0x777f('0x26')]();};}function saveUpdates(_0x1cc281,_0x38e32f){return function(_0x3a0c1d){if(_0x3a0c1d){return _0x3a0c1d[_0x777f('0x27')](_0x1cc281)[_0x777f('0x28')](function(_0x5732c6){return _0x5732c6;});}return null;};}function removeEntity(_0x780490,_0x17f1ed){return function(_0x5089ba){if(_0x5089ba){return _0x5089ba[_0x777f('0x29')]()['then'](function(){_0x780490[_0x777f('0x1c')](0xcc)[_0x777f('0x1b')]();});}};}function handleEntityNotFound(_0x109a8e,_0x3fe93d){return function(_0x43a7c1){if(!_0x43a7c1){_0x109a8e[_0x777f('0x1a')](0x194);}return _0x43a7c1;};}function handleError(_0x2c9edc,_0x1c0984){_0x1c0984=_0x1c0984||0x1f4;return function(_0x104b86){logger['error'](_0x104b86['stack']);if(_0x104b86[_0x777f('0x2a')]){delete _0x104b86[_0x777f('0x2a')];}_0x2c9edc[_0x777f('0x1c')](_0x1c0984)[_0x777f('0x2b')](_0x104b86);};}exports[_0x777f('0x2c')]=function(_0x32007e,_0x221dda){var _0x5b0504={},_0x2ebed8={},_0x3940cb={'count':0x0,'rows':[]};var _0x5b78b8=_[_0x777f('0x2d')](db[_0x777f('0x2e')]['rawAttributes'],function(_0x502924){return{'name':_0x502924[_0x777f('0x2f')],'type':_0x502924[_0x777f('0x30')][_0x777f('0x31')]};});_0x2ebed8[_0x777f('0x32')]=_[_0x777f('0x2d')](_0x5b78b8,_0x777f('0x2a'));_0x2ebed8[_0x777f('0x33')]=_[_0x777f('0x34')](_0x32007e[_0x777f('0x33')]);_0x2ebed8[_0x777f('0x35')]=_['intersection'](_0x2ebed8[_0x777f('0x32')],_0x2ebed8[_0x777f('0x33')]);_0x5b0504[_0x777f('0x36')]=_[_0x777f('0x37')](_0x2ebed8[_0x777f('0x32')],qs[_0x777f('0x38')](_0x32007e['query'][_0x777f('0x38')]));_0x5b0504[_0x777f('0x36')]=_0x5b0504['attributes'][_0x777f('0x39')]?_0x5b0504['attributes']:_0x2ebed8['model'];if(!_0x32007e[_0x777f('0x33')][_0x777f('0x3a')](_0x777f('0x3b'))){_0x5b0504[_0x777f('0x1f')]=qs[_0x777f('0x1f')](_0x32007e[_0x777f('0x33')][_0x777f('0x1f')]);_0x5b0504[_0x777f('0x21')]=qs['offset'](_0x32007e['query'][_0x777f('0x21')]);}_0x5b0504[_0x777f('0x3c')]=qs[_0x777f('0x3d')](_0x32007e[_0x777f('0x33')][_0x777f('0x3d')]);_0x5b0504[_0x777f('0x3e')]=qs[_0x777f('0x35')](_[_0x777f('0x3f')](_0x32007e['query'],_0x2ebed8[_0x777f('0x35')]),_0x5b78b8);if(_0x32007e[_0x777f('0x33')][_0x777f('0x40')]){_0x5b0504[_0x777f('0x3e')]=_[_0x777f('0x41')](_0x5b0504[_0x777f('0x3e')],{'$or':_[_0x777f('0x2d')](_0x5b78b8,function(_0x1f32ad){if(_0x1f32ad['type']!=='VIRTUAL'){var _0x19795e={};_0x19795e[_0x1f32ad['name']]={'$like':'%'+_0x32007e[_0x777f('0x33')][_0x777f('0x40')]+'%'};return _0x19795e;}})});}_0x5b0504=_[_0x777f('0x41')]({},_0x5b0504,_0x32007e[_0x777f('0x42')]);var _0x2727d0={'where':_0x5b0504['where']};return db[_0x777f('0x2e')][_0x777f('0x20')](_0x2727d0)[_0x777f('0x28')](function(_0x3a5d34){_0x3940cb[_0x777f('0x20')]=_0x3a5d34;if(_0x32007e['query'][_0x777f('0x43')]){_0x5b0504[_0x777f('0x44')]=[{'all':!![]}];}return db[_0x777f('0x2e')][_0x777f('0x45')](_0x5b0504);})[_0x777f('0x28')](function(_0x43e53d){_0x3940cb[_0x777f('0x46')]=_0x43e53d;return _0x3940cb;})[_0x777f('0x28')](respondWithFilteredResult(_0x221dda,_0x5b0504))['catch'](handleError(_0x221dda,null));};exports['show']=function(_0x2924e9,_0x4a4eb6){var _0x5ac30a={'raw':!![],'where':{'id':_0x2924e9[_0x777f('0x47')]['id']}},_0xdfb525={};_0xdfb525[_0x777f('0x32')]=_['keys'](db['ChatQueueReport'][_0x777f('0x48')]);_0xdfb525[_0x777f('0x33')]=_[_0x777f('0x34')](_0x2924e9[_0x777f('0x33')]);_0xdfb525['filters']=_[_0x777f('0x37')](_0xdfb525[_0x777f('0x32')],_0xdfb525[_0x777f('0x33')]);_0x5ac30a[_0x777f('0x36')]=_[_0x777f('0x37')](_0xdfb525[_0x777f('0x32')],qs[_0x777f('0x38')](_0x2924e9[_0x777f('0x33')][_0x777f('0x38')]));_0x5ac30a[_0x777f('0x36')]=_0x5ac30a[_0x777f('0x36')][_0x777f('0x39')]?_0x5ac30a[_0x777f('0x36')]:_0xdfb525[_0x777f('0x32')];if(_0x2924e9[_0x777f('0x33')]['includeAll']){_0x5ac30a[_0x777f('0x44')]=[{'all':!![]}];}_0x5ac30a=_[_0x777f('0x41')]({},_0x5ac30a,_0x2924e9[_0x777f('0x42')]);return db[_0x777f('0x2e')]['find'](_0x5ac30a)[_0x777f('0x28')](handleEntityNotFound(_0x4a4eb6,null))[_0x777f('0x28')](respondWithResult(_0x4a4eb6,null))[_0x777f('0x49')](handleError(_0x4a4eb6,null));};exports['create']=function(_0x486664,_0x364d41){return db['ChatQueueReport']['create'](_0x486664[_0x777f('0x4a')],{})[_0x777f('0x28')](respondWithResult(_0x364d41,0xc9))[_0x777f('0x49')](handleError(_0x364d41,null));};exports[_0x777f('0x27')]=function(_0x3ba76d,_0x45ea24){if(_0x3ba76d[_0x777f('0x4a')]['id']){delete _0x3ba76d[_0x777f('0x4a')]['id'];}return db['ChatQueueReport'][_0x777f('0x4b')]({'where':{'id':_0x3ba76d[_0x777f('0x47')]['id']}})[_0x777f('0x28')](handleEntityNotFound(_0x45ea24,null))[_0x777f('0x28')](saveUpdates(_0x3ba76d[_0x777f('0x4a')],null))[_0x777f('0x28')](respondWithResult(_0x45ea24,null))[_0x777f('0x49')](handleError(_0x45ea24,null));};exports[_0x777f('0x29')]=function(_0x124fc5,_0x145cbb){return db[_0x777f('0x2e')][_0x777f('0x4b')]({'where':{'id':_0x124fc5[_0x777f('0x47')]['id']}})[_0x777f('0x28')](handleEntityNotFound(_0x145cbb,null))[_0x777f('0x28')](removeEntity(_0x145cbb,null))[_0x777f('0x49')](handleError(_0x145cbb,null));};exports[_0x777f('0x4c')]=function(_0x4d9f46,_0x126b50){return db['ChatQueueReport'][_0x777f('0x4c')]()[_0x777f('0x28')](respondWithResult(_0x126b50,null))[_0x777f('0x49')](handleError(_0x126b50,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 885cc37..2d12130 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x4c9c81,_0x4387de){var _0x3b0c4c=function(_0x4f2205){while(--_0x4f2205){_0x4c9c81['push'](_0x4c9c81['shift']());}};_0x3b0c4c(++_0x4387de);}(_0xb7e7,0x121));var _0x7b7e=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xb7e7[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x5c9491,_0x387e70){var _0x72b4d=function(_0x49dc6a){while(--_0x49dc6a){_0x5c9491['push'](_0x5c9491['shift']());}};_0x72b4d(++_0x387e70);}(_0x757a,0xde));var _0xa757=function(_0x58abbf,_0x2a16f7){_0x58abbf=_0x58abbf-0x0;var _0x35e6e2=_0x757a[_0x58abbf];return _0x35e6e2;};'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 80d23e4..3c75244 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 _0x5c63=['options','raw','UpdateChatQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body'];(function(_0xd7907e,_0x360d98){var _0x308f94=function(_0x538e6e){while(--_0x538e6e){_0xd7907e['push'](_0xd7907e['shift']());}};_0x308f94(++_0x360d98);}(_0x5c63,0x15a));var _0x35c6=function(_0xe376cd,_0x4c9b68){_0xe376cd=_0xe376cd-0x0;var _0x4fcc56=_0x5c63[_0xe376cd];return _0x4fcc56;};'use strict';var _=require(_0x35c6('0x0'));var util=require('util');var moment=require(_0x35c6('0x1'));var BPromise=require(_0x35c6('0x2'));var rs=require(_0x35c6('0x3'));var fs=require('fs');var Redis=require(_0x35c6('0x4'));var db=require(_0x35c6('0x5'))['db'];var utils=require(_0x35c6('0x6'));var logger=require(_0x35c6('0x7'))('rpc');var config=require(_0x35c6('0x8'));var jayson=require(_0x35c6('0x9'));var client=jayson[_0x35c6('0xa')][_0x35c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x298986,_0x2498d3,_0x1e15c6){return new BPromise(function(_0x16490a,_0x1c75e9){return client[_0x35c6('0xc')](_0x298986,_0x1e15c6)[_0x35c6('0xd')](function(_0x2aa9e5){logger[_0x35c6('0xe')](_0x35c6('0xf'),_0x2498d3,_0x35c6('0x10'));logger[_0x35c6('0x11')](_0x35c6('0x12'),_0x2498d3,_0x35c6('0x10'),JSON[_0x35c6('0x13')](_0x2aa9e5));if(_0x2aa9e5['error']){if(_0x2aa9e5[_0x35c6('0x14')][_0x35c6('0x15')]===0x1f4){logger[_0x35c6('0x14')](_0x35c6('0xf'),_0x2498d3,_0x2aa9e5['error'][_0x35c6('0x16')]);return _0x1c75e9(_0x2aa9e5[_0x35c6('0x14')][_0x35c6('0x16')]);}logger[_0x35c6('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x2498d3,_0x2aa9e5['error'][_0x35c6('0x16')]);return _0x16490a(_0x2aa9e5[_0x35c6('0x14')][_0x35c6('0x16')]);}else{logger['info'](_0x35c6('0xf'),_0x2498d3,_0x35c6('0x10'));_0x16490a(_0x2aa9e5[_0x35c6('0x17')][_0x35c6('0x16')]);}})[_0x35c6('0x18')](function(_0x3ff58f){logger[_0x35c6('0x14')](_0x35c6('0xf'),_0x2498d3,_0x3ff58f);_0x1c75e9(_0x3ff58f);});});}exports[_0x35c6('0x19')]=function(_0x2566c5){var _0x4a383c=this;return new Promise(function(_0x24f72c,_0x41cf63){return db[_0x35c6('0x1a')]['create'](_0x2566c5[_0x35c6('0x1b')],{'raw':_0x2566c5[_0x35c6('0x1c')]?_0x2566c5['options'][_0x35c6('0x1d')]===undefined?!![]:![]:!![]})[_0x35c6('0xd')](function(_0x5e2a8e){logger[_0x35c6('0xe')](_0x35c6('0x19'),_0x2566c5);logger[_0x35c6('0x11')](_0x35c6('0x19'),_0x2566c5,JSON[_0x35c6('0x13')](_0x5e2a8e));_0x24f72c(_0x5e2a8e);})[_0x35c6('0x18')](function(_0x48aecb){logger[_0x35c6('0x14')](_0x35c6('0x19'),_0x48aecb['message'],_0x2566c5);_0x41cf63(_0x4a383c['error'](0x1f4,_0x48aecb[_0x35c6('0x16')]));});});};exports[_0x35c6('0x1e')]=function(_0x21721f){var _0x47a5e6=this;return new Promise(function(_0x4ef813,_0x226dbf){return db[_0x35c6('0x1a')][_0x35c6('0x1f')](_0x21721f[_0x35c6('0x1b')],{'raw':_0x21721f[_0x35c6('0x1c')]?_0x21721f[_0x35c6('0x1c')][_0x35c6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21721f['options']?_0x21721f[_0x35c6('0x1c')][_0x35c6('0x20')]||null:null,'attributes':_0x21721f['options']?_0x21721f['options']['attributes']||null:null,'limit':_0x21721f[_0x35c6('0x1c')]?_0x21721f[_0x35c6('0x1c')][_0x35c6('0x21')]||null:null})[_0x35c6('0xd')](function(_0x236c46){logger[_0x35c6('0xe')]('UpdateChatQueueReport',_0x21721f);logger[_0x35c6('0x11')](_0x35c6('0x1e'),_0x21721f,JSON[_0x35c6('0x13')](_0x236c46));_0x4ef813(_0x236c46);})[_0x35c6('0x18')](function(_0x413482){logger['error'](_0x35c6('0x1e'),_0x413482['message'],_0x21721f);_0x226dbf(_0x47a5e6[_0x35c6('0x14')](0x1f4,_0x413482[_0x35c6('0x16')]));});});};
\ No newline at end of file
+var _0xd67c=['../../config/environment','jayson/promise','client','http','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xd67c,0x177));var _0xcd67=function(_0xcafb2b,_0x2cc85e){_0xcafb2b=_0xcafb2b-0x0;var _0x539f9a=_0xd67c[_0xcafb2b];return _0x539f9a;};'use strict';var _=require(_0xcd67('0x0'));var util=require(_0xcd67('0x1'));var moment=require(_0xcd67('0x2'));var BPromise=require(_0xcd67('0x3'));var rs=require(_0xcd67('0x4'));var fs=require('fs');var Redis=require(_0xcd67('0x5'));var db=require(_0xcd67('0x6'))['db'];var utils=require(_0xcd67('0x7'));var logger=require(_0xcd67('0x8'))(_0xcd67('0x9'));var config=require(_0xcd67('0xa'));var jayson=require(_0xcd67('0xb'));var client=jayson[_0xcd67('0xc')][_0xcd67('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4e925b,_0x247fbe,_0x5f9757){return new BPromise(function(_0xcd56a,_0x1c7c85){return client['request'](_0x4e925b,_0x5f9757)['then'](function(_0x3fa769){logger['info'](_0xcd67('0xe'),_0x247fbe,'request\x20sent');logger[_0xcd67('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x247fbe,_0xcd67('0x10'),JSON[_0xcd67('0x11')](_0x3fa769));if(_0x3fa769[_0xcd67('0x12')]){if(_0x3fa769[_0xcd67('0x12')][_0xcd67('0x13')]===0x1f4){logger[_0xcd67('0x12')](_0xcd67('0xe'),_0x247fbe,_0x3fa769[_0xcd67('0x12')]['message']);return _0x1c7c85(_0x3fa769['error'][_0xcd67('0x14')]);}logger['error'](_0xcd67('0xe'),_0x247fbe,_0x3fa769[_0xcd67('0x12')][_0xcd67('0x14')]);return _0xcd56a(_0x3fa769[_0xcd67('0x12')]['message']);}else{logger[_0xcd67('0x15')](_0xcd67('0xe'),_0x247fbe,_0xcd67('0x10'));_0xcd56a(_0x3fa769[_0xcd67('0x16')][_0xcd67('0x14')]);}})[_0xcd67('0x17')](function(_0x2e9992){logger['error'](_0xcd67('0xe'),_0x247fbe,_0x2e9992);_0x1c7c85(_0x2e9992);});});}exports[_0xcd67('0x18')]=function(_0x5ef506){var _0x2c22cb=this;return new Promise(function(_0x3ab890,_0xa54e5f){return db[_0xcd67('0x19')][_0xcd67('0x1a')](_0x5ef506[_0xcd67('0x1b')],{'raw':_0x5ef506[_0xcd67('0x1c')]?_0x5ef506['options'][_0xcd67('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5dc2d2){logger[_0xcd67('0x15')](_0xcd67('0x18'),_0x5ef506);logger[_0xcd67('0xf')](_0xcd67('0x18'),_0x5ef506,JSON[_0xcd67('0x11')](_0x5dc2d2));_0x3ab890(_0x5dc2d2);})[_0xcd67('0x17')](function(_0x381957){logger['error']('CreateChatQueueReport',_0x381957[_0xcd67('0x14')],_0x5ef506);_0xa54e5f(_0x2c22cb[_0xcd67('0x12')](0x1f4,_0x381957['message']));});});};exports[_0xcd67('0x1e')]=function(_0x42a85f){var _0x5e3728=this;return new Promise(function(_0x28282d,_0x45c431){return db[_0xcd67('0x19')][_0xcd67('0x1f')](_0x42a85f[_0xcd67('0x1b')],{'raw':_0x42a85f[_0xcd67('0x1c')]?_0x42a85f[_0xcd67('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42a85f[_0xcd67('0x1c')]?_0x42a85f[_0xcd67('0x1c')]['where']||null:null,'attributes':_0x42a85f[_0xcd67('0x1c')]?_0x42a85f['options'][_0xcd67('0x20')]||null:null,'limit':_0x42a85f['options']?_0x42a85f[_0xcd67('0x1c')][_0xcd67('0x21')]||null:null})[_0xcd67('0x22')](function(_0x4b8e9d){logger[_0xcd67('0x15')](_0xcd67('0x1e'),_0x42a85f);logger[_0xcd67('0xf')]('UpdateChatQueueReport',_0x42a85f,JSON[_0xcd67('0x11')](_0x4b8e9d));_0x28282d(_0x4b8e9d);})[_0xcd67('0x17')](function(_0x1a678e){logger[_0xcd67('0x12')]('UpdateChatQueueReport',_0x1a678e[_0xcd67('0x14')],_0x42a85f);_0x45c431(_0x5e3728['error'](0x1f4,_0x1a678e[_0xcd67('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index f83b5cf..92a85bc 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 _0xa051=['delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','update'];(function(_0x5ca644,_0x3d2165){var _0x5c87a2=function(_0x3dc7d9){while(--_0x3dc7d9){_0x5ca644['push'](_0x5ca644['shift']());}};_0x5c87a2(++_0x3d2165);}(_0xa051,0x16c));var _0x1a05=function(_0x154f3a,_0x2d6844){_0x154f3a=_0x154f3a-0x0;var _0x40fb44=_0xa051[_0x154f3a];return _0x40fb44;};'use strict';var multer=require(_0x1a05('0x0'));var util=require('util');var path=require(_0x1a05('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1a05('0x2'));var auth=require(_0x1a05('0x3'));var interaction=require(_0x1a05('0x4'));var config=require(_0x1a05('0x5'));var controller=require(_0x1a05('0x6'));router['get']('/',auth[_0x1a05('0x7')](),controller[_0x1a05('0x8')]);router[_0x1a05('0x9')](_0x1a05('0xa'),auth[_0x1a05('0x7')](),controller['describe']);router[_0x1a05('0x9')](_0x1a05('0xb'),auth[_0x1a05('0x7')](),controller[_0x1a05('0xc')]);router['post']('/',auth[_0x1a05('0x7')](),controller[_0x1a05('0xd')]);router[_0x1a05('0xe')](_0x1a05('0xb'),auth[_0x1a05('0x7')](),controller[_0x1a05('0xf')]);router[_0x1a05('0x10')]('/:id',auth[_0x1a05('0x7')](),controller[_0x1a05('0x11')]);module[_0x1a05('0x12')]=router;
\ No newline at end of file
+var _0x4b95=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','/describe','get','/:id','create','put','util'];(function(_0x17d831,_0x1f0cc2){var _0x15a6c2=function(_0x2ed3f1){while(--_0x2ed3f1){_0x17d831['push'](_0x17d831['shift']());}};_0x15a6c2(++_0x1f0cc2);}(_0x4b95,0x137));var _0x54b9=function(_0x57702a,_0x57c215){_0x57702a=_0x57702a-0x0;var _0x487e5a=_0x4b95[_0x57702a];return _0x487e5a;};'use strict';var multer=require('multer');var util=require(_0x54b9('0x0'));var path=require('path');var timeout=require(_0x54b9('0x1'));var express=require(_0x54b9('0x2'));var router=express[_0x54b9('0x3')]();var fs_extra=require(_0x54b9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x54b9('0x5'));var config=require('../../config/environment');var controller=require(_0x54b9('0x6'));router['get']('/',auth[_0x54b9('0x7')](),controller['index']);router['get'](_0x54b9('0x8'),auth[_0x54b9('0x7')](),controller['describe']);router[_0x54b9('0x9')](_0x54b9('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x54b9('0xb')]);router[_0x54b9('0xc')](_0x54b9('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x54b9('0xa'),auth[_0x54b9('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index b9f819d..62decbc 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x11fbaa,_0x52dc16){var _0x1831fd=function(_0x2bbced){while(--_0x2bbced){_0x11fbaa['push'](_0x11fbaa['shift']());}};_0x1831fd(++_0x52dc16);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1cd0a7,_0x50fb43){var _0x3c965b=function(_0x57d309){while(--_0x57d309){_0x1cd0a7['push'](_0x1cd0a7['shift']());}};_0x3c965b(++_0x50fb43);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0xcb91[_0x3ba924];return _0x4cc1df;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index e8d298d..d5d3875 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 _0x4d13=['then','destroy','end','error','stack','name','send','map','ChatTransferReport','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','findAll','rows','params','rawAttributes','includeAll','find','create','body','catch','describe','eml-format','rimraf','fast-json-patch','bluebird','path','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x20c66b,_0x31b9dd){var _0x54c011=function(_0x349b90){while(--_0x349b90){_0x20c66b['push'](_0x20c66b['shift']());}};_0x54c011(++_0x31b9dd);}(_0x4d13,0xa6));var _0x34d1=function(_0x1f18bc,_0x184ce0){_0x1f18bc=_0x1f18bc-0x0;var _0x35f109=_0x4d13[_0x1f18bc];return _0x35f109;};'use strict';var emlformat=require(_0x34d1('0x0'));var rimraf=require(_0x34d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34d1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34d1('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x34d1('0x4'));var sox=require('sox');var csv=require(_0x34d1('0x5'));var ejs=require(_0x34d1('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34d1('0x7'));var squel=require('squel');var crypto=require(_0x34d1('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x34d1('0x9'));var toCsv=require('to-csv');var querystring=require(_0x34d1('0xa'));var Papa=require('papaparse');var Redis=require(_0x34d1('0xb'));var authService=require(_0x34d1('0xc'));var qs=require(_0x34d1('0xd'));var as=require(_0x34d1('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x34d1('0xf'));var licenseUtil=require(_0x34d1('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a8d05,_0x5f1155){_0x5f1155=_0x5f1155||0xcc;return function(_0x254300){if(_0x254300){return _0x4a8d05[_0x34d1('0x11')](_0x5f1155);}return _0x4a8d05[_0x34d1('0x12')](_0x5f1155)['end']();};}function respondWithResult(_0x352796,_0x186f12){_0x186f12=_0x186f12||0xc8;return function(_0x23be9e){if(_0x23be9e){return _0x352796[_0x34d1('0x12')](_0x186f12)[_0x34d1('0x13')](_0x23be9e);}};}function respondWithFilteredResult(_0x181b3e,_0x4a4afb){return function(_0x5b11a6){if(_0x5b11a6){var _0x15fb95=typeof _0x4a4afb[_0x34d1('0x14')]===_0x34d1('0x15')&&typeof _0x4a4afb[_0x34d1('0x16')]==='undefined';var _0x29a5cb=_0x5b11a6[_0x34d1('0x17')];var _0x5040c2=_0x15fb95?0x0:_0x4a4afb[_0x34d1('0x14')];var _0x1ff3a3=_0x15fb95?_0x5b11a6[_0x34d1('0x17')]:_0x4a4afb['offset']+_0x4a4afb['limit'];var _0x53a97e;if(_0x1ff3a3>=_0x29a5cb){_0x1ff3a3=_0x29a5cb;_0x53a97e=0xc8;}else{_0x53a97e=0xce;}_0x181b3e[_0x34d1('0x12')](_0x53a97e);return _0x181b3e[_0x34d1('0x18')](_0x34d1('0x19'),_0x5040c2+'-'+_0x1ff3a3+'/'+_0x29a5cb)[_0x34d1('0x13')](_0x5b11a6);}return null;};}function patchUpdates(_0x41bc06){return function(_0x1a6f69){try{jsonpatch[_0x34d1('0x1a')](_0x1a6f69,_0x41bc06,!![]);}catch(_0x49e40a){return BPromise['reject'](_0x49e40a);}return _0x1a6f69[_0x34d1('0x1b')]();};}function saveUpdates(_0x46c5a9,_0x18b71d){return function(_0x9b2bee){if(_0x9b2bee){return _0x9b2bee[_0x34d1('0x1c')](_0x46c5a9)[_0x34d1('0x1d')](function(_0x12655b){return _0x12655b;});}return null;};}function removeEntity(_0x43601a,_0x5cf668){return function(_0xd7798){if(_0xd7798){return _0xd7798[_0x34d1('0x1e')]()[_0x34d1('0x1d')](function(){_0x43601a['status'](0xcc)[_0x34d1('0x1f')]();});}};}function handleEntityNotFound(_0x11f42d,_0xfa6571){return function(_0x5952bd){if(!_0x5952bd){_0x11f42d[_0x34d1('0x11')](0x194);}return _0x5952bd;};}function handleError(_0x2dee0f,_0x4de47d){_0x4de47d=_0x4de47d||0x1f4;return function(_0xc1b69b){logger[_0x34d1('0x20')](_0xc1b69b[_0x34d1('0x21')]);if(_0xc1b69b[_0x34d1('0x22')]){delete _0xc1b69b[_0x34d1('0x22')];}_0x2dee0f[_0x34d1('0x12')](_0x4de47d)[_0x34d1('0x23')](_0xc1b69b);};}exports['index']=function(_0x2d4bce,_0x1ea86b){var _0x261a9a={},_0x4c9b75={},_0x1ef510={'count':0x0,'rows':[]};var _0x1f4241=_[_0x34d1('0x24')](db[_0x34d1('0x25')]['rawAttributes'],function(_0x587730){return{'name':_0x587730[_0x34d1('0x26')],'type':_0x587730[_0x34d1('0x27')]['key']};});_0x4c9b75[_0x34d1('0x28')]=_[_0x34d1('0x24')](_0x1f4241,_0x34d1('0x22'));_0x4c9b75['query']=_[_0x34d1('0x29')](_0x2d4bce[_0x34d1('0x2a')]);_0x4c9b75[_0x34d1('0x2b')]=_['intersection'](_0x4c9b75[_0x34d1('0x28')],_0x4c9b75[_0x34d1('0x2a')]);_0x261a9a[_0x34d1('0x2c')]=_[_0x34d1('0x2d')](_0x4c9b75[_0x34d1('0x28')],qs[_0x34d1('0x2e')](_0x2d4bce['query'][_0x34d1('0x2e')]));_0x261a9a['attributes']=_0x261a9a[_0x34d1('0x2c')][_0x34d1('0x2f')]?_0x261a9a[_0x34d1('0x2c')]:_0x4c9b75[_0x34d1('0x28')];if(!_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x30')](_0x34d1('0x31'))){_0x261a9a[_0x34d1('0x16')]=qs['limit'](_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x16')]);_0x261a9a[_0x34d1('0x14')]=qs['offset'](_0x2d4bce['query'][_0x34d1('0x14')]);}_0x261a9a['order']=qs[_0x34d1('0x32')](_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x32')]);_0x261a9a[_0x34d1('0x33')]=qs[_0x34d1('0x2b')](_['pick'](_0x2d4bce[_0x34d1('0x2a')],_0x4c9b75[_0x34d1('0x2b')]),_0x1f4241);if(_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x34')]){_0x261a9a[_0x34d1('0x33')]=_[_0x34d1('0x35')](_0x261a9a[_0x34d1('0x33')],{'$or':_[_0x34d1('0x24')](_0x1f4241,function(_0x3e18ff){if(_0x3e18ff['type']!=='VIRTUAL'){var _0x584a9a={};_0x584a9a[_0x3e18ff[_0x34d1('0x22')]]={'$like':'%'+_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x34')]+'%'};return _0x584a9a;}})});}_0x261a9a=_['merge']({},_0x261a9a,_0x2d4bce[_0x34d1('0x36')]);var _0x442fee={'where':_0x261a9a['where']};return db[_0x34d1('0x25')][_0x34d1('0x17')](_0x442fee)[_0x34d1('0x1d')](function(_0x36d2d3){_0x1ef510[_0x34d1('0x17')]=_0x36d2d3;if(_0x2d4bce[_0x34d1('0x2a')]['includeAll']){_0x261a9a['include']=[{'all':!![]}];}return db[_0x34d1('0x25')][_0x34d1('0x37')](_0x261a9a);})['then'](function(_0x40520e){_0x1ef510[_0x34d1('0x38')]=_0x40520e;return _0x1ef510;})[_0x34d1('0x1d')](respondWithFilteredResult(_0x1ea86b,_0x261a9a))['catch'](handleError(_0x1ea86b,null));};exports['show']=function(_0x2592c2,_0x3dc9ae){var _0x3cf010={'raw':!![],'where':{'id':_0x2592c2[_0x34d1('0x39')]['id']}},_0x7fbcc9={};_0x7fbcc9[_0x34d1('0x28')]=_[_0x34d1('0x29')](db[_0x34d1('0x25')][_0x34d1('0x3a')]);_0x7fbcc9[_0x34d1('0x2a')]=_[_0x34d1('0x29')](_0x2592c2[_0x34d1('0x2a')]);_0x7fbcc9[_0x34d1('0x2b')]=_[_0x34d1('0x2d')](_0x7fbcc9[_0x34d1('0x28')],_0x7fbcc9[_0x34d1('0x2a')]);_0x3cf010[_0x34d1('0x2c')]=_[_0x34d1('0x2d')](_0x7fbcc9[_0x34d1('0x28')],qs[_0x34d1('0x2e')](_0x2592c2['query']['fields']));_0x3cf010['attributes']=_0x3cf010[_0x34d1('0x2c')]['length']?_0x3cf010[_0x34d1('0x2c')]:_0x7fbcc9[_0x34d1('0x28')];if(_0x2592c2[_0x34d1('0x2a')][_0x34d1('0x3b')]){_0x3cf010['include']=[{'all':!![]}];}_0x3cf010=_['merge']({},_0x3cf010,_0x2592c2[_0x34d1('0x36')]);return db[_0x34d1('0x25')][_0x34d1('0x3c')](_0x3cf010)[_0x34d1('0x1d')](handleEntityNotFound(_0x3dc9ae,null))[_0x34d1('0x1d')](respondWithResult(_0x3dc9ae,null))['catch'](handleError(_0x3dc9ae,null));};exports[_0x34d1('0x3d')]=function(_0x5e5f15,_0x305a98){return db[_0x34d1('0x25')][_0x34d1('0x3d')](_0x5e5f15[_0x34d1('0x3e')],{})[_0x34d1('0x1d')](respondWithResult(_0x305a98,0xc9))[_0x34d1('0x3f')](handleError(_0x305a98,null));};exports[_0x34d1('0x1c')]=function(_0xb36e25,_0x2f366e){if(_0xb36e25[_0x34d1('0x3e')]['id']){delete _0xb36e25[_0x34d1('0x3e')]['id'];}return db[_0x34d1('0x25')][_0x34d1('0x3c')]({'where':{'id':_0xb36e25[_0x34d1('0x39')]['id']}})[_0x34d1('0x1d')](handleEntityNotFound(_0x2f366e,null))[_0x34d1('0x1d')](saveUpdates(_0xb36e25['body'],null))['then'](respondWithResult(_0x2f366e,null))[_0x34d1('0x3f')](handleError(_0x2f366e,null));};exports[_0x34d1('0x1e')]=function(_0x3630de,_0x55955e){return db[_0x34d1('0x25')][_0x34d1('0x3c')]({'where':{'id':_0x3630de[_0x34d1('0x39')]['id']}})['then'](handleEntityNotFound(_0x55955e,null))['then'](removeEntity(_0x55955e,null))[_0x34d1('0x3f')](handleError(_0x55955e,null));};exports[_0x34d1('0x40')]=function(_0x152230,_0x3331a1){return db[_0x34d1('0x25')][_0x34d1('0x40')]()[_0x34d1('0x1d')](respondWithResult(_0x3331a1,null))['catch'](handleError(_0x3331a1,null));};
\ No newline at end of file
+var _0x1cfc=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','keys','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4fc702,_0x590060){var _0x1357d3=function(_0x45a119){while(--_0x45a119){_0x4fc702['push'](_0x4fc702['shift']());}};_0x1357d3(++_0x590060);}(_0x1cfc,0x85));var _0xc1cf=function(_0x6a960a,_0x1d2e3c){_0x6a960a=_0x6a960a-0x0;var _0x2758da=_0x1cfc[_0x6a960a];return _0x2758da;};'use strict';var emlformat=require(_0xc1cf('0x0'));var rimraf=require(_0xc1cf('0x1'));var zipdir=require(_0xc1cf('0x2'));var jsonpatch=require(_0xc1cf('0x3'));var rp=require(_0xc1cf('0x4'));var moment=require(_0xc1cf('0x5'));var BPromise=require(_0xc1cf('0x6'));var Mustache=require(_0xc1cf('0x7'));var util=require(_0xc1cf('0x8'));var path=require(_0xc1cf('0x9'));var sox=require(_0xc1cf('0xa'));var csv=require(_0xc1cf('0xb'));var ejs=require(_0xc1cf('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1cf('0xd'));var squel=require('squel');var crypto=require(_0xc1cf('0xe'));var jsforce=require(_0xc1cf('0xf'));var deskjs=require(_0xc1cf('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc1cf('0x11'));var Papa=require(_0xc1cf('0x12'));var Redis=require('ioredis');var authService=require(_0xc1cf('0x13'));var qs=require(_0xc1cf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1cf('0x15'));var logger=require(_0xc1cf('0x16'))(_0xc1cf('0x17'));var utils=require(_0xc1cf('0x18'));var config=require(_0xc1cf('0x19'));var licenseUtil=require(_0xc1cf('0x1a'));var db=require(_0xc1cf('0x1b'))['db'];function respondWithStatusCode(_0x12cb77,_0x582ff4){_0x582ff4=_0x582ff4||0xcc;return function(_0x3b5018){if(_0x3b5018){return _0x12cb77['sendStatus'](_0x582ff4);}return _0x12cb77[_0xc1cf('0x1c')](_0x582ff4)[_0xc1cf('0x1d')]();};}function respondWithResult(_0x1c96a5,_0x1fcafa){_0x1fcafa=_0x1fcafa||0xc8;return function(_0x4eef75){if(_0x4eef75){return _0x1c96a5[_0xc1cf('0x1c')](_0x1fcafa)[_0xc1cf('0x1e')](_0x4eef75);}};}function respondWithFilteredResult(_0x430fba,_0x35fadf){return function(_0x1e87a4){if(_0x1e87a4){var _0x35bec7=typeof _0x35fadf['offset']==='undefined'&&typeof _0x35fadf['limit']===_0xc1cf('0x1f');var _0x4d2be7=_0x1e87a4[_0xc1cf('0x20')];var _0x31768c=_0x35bec7?0x0:_0x35fadf['offset'];var _0x3d0ee4=_0x35bec7?_0x1e87a4[_0xc1cf('0x20')]:_0x35fadf[_0xc1cf('0x21')]+_0x35fadf[_0xc1cf('0x22')];var _0x280ada;if(_0x3d0ee4>=_0x4d2be7){_0x3d0ee4=_0x4d2be7;_0x280ada=0xc8;}else{_0x280ada=0xce;}_0x430fba[_0xc1cf('0x1c')](_0x280ada);return _0x430fba['set'](_0xc1cf('0x23'),_0x31768c+'-'+_0x3d0ee4+'/'+_0x4d2be7)[_0xc1cf('0x1e')](_0x1e87a4);}return null;};}function patchUpdates(_0x31804b){return function(_0x2c146a){try{jsonpatch[_0xc1cf('0x24')](_0x2c146a,_0x31804b,!![]);}catch(_0x2da10c){return BPromise[_0xc1cf('0x25')](_0x2da10c);}return _0x2c146a[_0xc1cf('0x26')]();};}function saveUpdates(_0x2d2933,_0x5aac80){return function(_0x685021){if(_0x685021){return _0x685021[_0xc1cf('0x27')](_0x2d2933)[_0xc1cf('0x28')](function(_0x2d4c34){return _0x2d4c34;});}return null;};}function removeEntity(_0x51e9c1,_0x54745e){return function(_0x8304b5){if(_0x8304b5){return _0x8304b5[_0xc1cf('0x29')]()['then'](function(){_0x51e9c1[_0xc1cf('0x1c')](0xcc)[_0xc1cf('0x1d')]();});}};}function handleEntityNotFound(_0x5162f2,_0x34b687){return function(_0x689e29){if(!_0x689e29){_0x5162f2['sendStatus'](0x194);}return _0x689e29;};}function handleError(_0x3c7bb0,_0x1c6b5a){_0x1c6b5a=_0x1c6b5a||0x1f4;return function(_0x31a2d3){logger[_0xc1cf('0x2a')](_0x31a2d3['stack']);if(_0x31a2d3[_0xc1cf('0x2b')]){delete _0x31a2d3[_0xc1cf('0x2b')];}_0x3c7bb0[_0xc1cf('0x1c')](_0x1c6b5a)['send'](_0x31a2d3);};}exports[_0xc1cf('0x2c')]=function(_0x14822f,_0x289a16){var _0x17bdb9={},_0x4eda5c={},_0xed5d98={'count':0x0,'rows':[]};var _0x54e5a3=_[_0xc1cf('0x2d')](db[_0xc1cf('0x2e')][_0xc1cf('0x2f')],function(_0x38f81f){return{'name':_0x38f81f[_0xc1cf('0x30')],'type':_0x38f81f[_0xc1cf('0x31')][_0xc1cf('0x32')]};});_0x4eda5c[_0xc1cf('0x33')]=_['map'](_0x54e5a3,_0xc1cf('0x2b'));_0x4eda5c[_0xc1cf('0x34')]=_['keys'](_0x14822f[_0xc1cf('0x34')]);_0x4eda5c[_0xc1cf('0x35')]=_[_0xc1cf('0x36')](_0x4eda5c[_0xc1cf('0x33')],_0x4eda5c[_0xc1cf('0x34')]);_0x17bdb9[_0xc1cf('0x37')]=_[_0xc1cf('0x36')](_0x4eda5c['model'],qs[_0xc1cf('0x38')](_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x38')]));_0x17bdb9[_0xc1cf('0x37')]=_0x17bdb9[_0xc1cf('0x37')][_0xc1cf('0x39')]?_0x17bdb9[_0xc1cf('0x37')]:_0x4eda5c[_0xc1cf('0x33')];if(!_0x14822f[_0xc1cf('0x34')]['hasOwnProperty']('nolimit')){_0x17bdb9[_0xc1cf('0x22')]=qs[_0xc1cf('0x22')](_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x22')]);_0x17bdb9['offset']=qs[_0xc1cf('0x21')](_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x21')]);}_0x17bdb9[_0xc1cf('0x3a')]=qs[_0xc1cf('0x3b')](_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x3b')]);_0x17bdb9[_0xc1cf('0x3c')]=qs[_0xc1cf('0x35')](_[_0xc1cf('0x3d')](_0x14822f['query'],_0x4eda5c[_0xc1cf('0x35')]),_0x54e5a3);if(_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x3e')]){_0x17bdb9[_0xc1cf('0x3c')]=_[_0xc1cf('0x3f')](_0x17bdb9['where'],{'$or':_[_0xc1cf('0x2d')](_0x54e5a3,function(_0x298206){if(_0x298206[_0xc1cf('0x31')]!=='VIRTUAL'){var _0x42e861={};_0x42e861[_0x298206[_0xc1cf('0x2b')]]={'$like':'%'+_0x14822f[_0xc1cf('0x34')]['filter']+'%'};return _0x42e861;}})});}_0x17bdb9=_['merge']({},_0x17bdb9,_0x14822f['options']);var _0x471b03={'where':_0x17bdb9['where']};return db[_0xc1cf('0x2e')][_0xc1cf('0x20')](_0x471b03)['then'](function(_0x23cd3e){_0xed5d98[_0xc1cf('0x20')]=_0x23cd3e;if(_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x40')]){_0x17bdb9[_0xc1cf('0x41')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x17bdb9);})[_0xc1cf('0x28')](function(_0x516ff2){_0xed5d98[_0xc1cf('0x42')]=_0x516ff2;return _0xed5d98;})['then'](respondWithFilteredResult(_0x289a16,_0x17bdb9))[_0xc1cf('0x43')](handleError(_0x289a16,null));};exports[_0xc1cf('0x44')]=function(_0x5a53fd,_0x3c3d79){var _0x4f3d69={'raw':!![],'where':{'id':_0x5a53fd['params']['id']}},_0x3c399a={};_0x3c399a[_0xc1cf('0x33')]=_['keys'](db[_0xc1cf('0x2e')]['rawAttributes']);_0x3c399a['query']=_[_0xc1cf('0x45')](_0x5a53fd[_0xc1cf('0x34')]);_0x3c399a[_0xc1cf('0x35')]=_[_0xc1cf('0x36')](_0x3c399a['model'],_0x3c399a['query']);_0x4f3d69['attributes']=_['intersection'](_0x3c399a[_0xc1cf('0x33')],qs[_0xc1cf('0x38')](_0x5a53fd['query'][_0xc1cf('0x38')]));_0x4f3d69['attributes']=_0x4f3d69['attributes'][_0xc1cf('0x39')]?_0x4f3d69[_0xc1cf('0x37')]:_0x3c399a[_0xc1cf('0x33')];if(_0x5a53fd[_0xc1cf('0x34')]['includeAll']){_0x4f3d69[_0xc1cf('0x41')]=[{'all':!![]}];}_0x4f3d69=_[_0xc1cf('0x3f')]({},_0x4f3d69,_0x5a53fd[_0xc1cf('0x46')]);return db[_0xc1cf('0x2e')]['find'](_0x4f3d69)[_0xc1cf('0x28')](handleEntityNotFound(_0x3c3d79,null))[_0xc1cf('0x28')](respondWithResult(_0x3c3d79,null))[_0xc1cf('0x43')](handleError(_0x3c3d79,null));};exports[_0xc1cf('0x47')]=function(_0x2e2460,_0x1478df){return db[_0xc1cf('0x2e')]['create'](_0x2e2460[_0xc1cf('0x48')],{})[_0xc1cf('0x28')](respondWithResult(_0x1478df,0xc9))['catch'](handleError(_0x1478df,null));};exports[_0xc1cf('0x27')]=function(_0x1558f3,_0x62d047){if(_0x1558f3[_0xc1cf('0x48')]['id']){delete _0x1558f3[_0xc1cf('0x48')]['id'];}return db[_0xc1cf('0x2e')][_0xc1cf('0x49')]({'where':{'id':_0x1558f3[_0xc1cf('0x4a')]['id']}})[_0xc1cf('0x28')](handleEntityNotFound(_0x62d047,null))['then'](saveUpdates(_0x1558f3[_0xc1cf('0x48')],null))[_0xc1cf('0x28')](respondWithResult(_0x62d047,null))['catch'](handleError(_0x62d047,null));};exports['destroy']=function(_0x1625ca,_0x3e25f6){return db[_0xc1cf('0x2e')]['find']({'where':{'id':_0x1625ca[_0xc1cf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e25f6,null))[_0xc1cf('0x28')](removeEntity(_0x3e25f6,null))[_0xc1cf('0x43')](handleError(_0x3e25f6,null));};exports[_0xc1cf('0x4b')]=function(_0x92c64f,_0x4f66ad){return db[_0xc1cf('0x2e')]['describe']()[_0xc1cf('0x28')](respondWithResult(_0x4f66ad,null))['catch'](handleError(_0x4f66ad,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 49c14fb..f394958 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 _0xe8ea=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2b6a67,_0xae2af){var _0x393c8b=function(_0x16a97f){while(--_0x16a97f){_0x2b6a67['push'](_0x2b6a67['shift']());}};_0x393c8b(++_0xae2af);}(_0xe8ea,0x1cb));var _0xae8e=function(_0x3449b3,_0x10ed6e){_0x3449b3=_0x3449b3-0x0;var _0x4ff9ef=_0xe8ea[_0x3449b3];return _0x4ff9ef;};'use strict';var _=require(_0xae8e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xae8e('0x1'));var moment=require(_0xae8e('0x2'));var BPromise=require(_0xae8e('0x3'));var rp=require(_0xae8e('0x4'));var fs=require('fs');var path=require(_0xae8e('0x5'));var rimraf=require(_0xae8e('0x6'));var config=require(_0xae8e('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xae8e('0x8')]=function(_0xcea244,_0x3182d3){return _0xcea244[_0xae8e('0x9')](_0xae8e('0xa'),attributes,{'tableName':_0xae8e('0xb'),'paranoid':![],'indexes':[{'name':_0xae8e('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf4a=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0xaf4a,0x74));var _0xaaf4=function(_0x289c79,_0x2d17ba){_0x289c79=_0x289c79-0x0;var _0x2ad590=_0xaf4a[_0x289c79];return _0x2ad590;};'use strict';var _=require(_0xaaf4('0x0'));var util=require(_0xaaf4('0x1'));var logger=require(_0xaaf4('0x2'))(_0xaaf4('0x3'));var moment=require(_0xaaf4('0x4'));var BPromise=require(_0xaaf4('0x5'));var rp=require(_0xaaf4('0x6'));var fs=require('fs');var path=require(_0xaaf4('0x7'));var rimraf=require(_0xaaf4('0x8'));var config=require(_0xaaf4('0x9'));var attributes=require(_0xaaf4('0xa'));module[_0xaaf4('0xb')]=function(_0x1b3716,_0x10e716){return _0x1b3716[_0xaaf4('0xc')](_0xaaf4('0xd'),attributes,{'tableName':_0xaaf4('0xe'),'paranoid':![],'indexes':[{'name':_0xaaf4('0xf'),'fields':[_0xaaf4('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 7945d3d..2a5f95f 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 _0xcff3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x40e170,_0x3f5e22){var _0x3857fa=function(_0x1013ae){while(--_0x1013ae){_0x40e170['push'](_0x40e170['shift']());}};_0x3857fa(++_0x3f5e22);}(_0xcff3,0x101));var _0x3cff=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0xcff3[_0x13b330];return _0x1f666c;};'use strict';var _=require(_0x3cff('0x0'));var util=require(_0x3cff('0x1'));var moment=require(_0x3cff('0x2'));var BPromise=require(_0x3cff('0x3'));var rs=require(_0x3cff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cff('0x5'))['db'];var utils=require(_0x3cff('0x6'));var logger=require(_0x3cff('0x7'))(_0x3cff('0x8'));var config=require(_0x3cff('0x9'));var jayson=require(_0x3cff('0xa'));var client=jayson[_0x3cff('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57c51e,_0x27a250,_0xf8c6b){return new BPromise(function(_0x4e7857,_0x18658c){return client['request'](_0x57c51e,_0xf8c6b)[_0x3cff('0xc')](function(_0x287081){logger[_0x3cff('0xd')](_0x3cff('0xe'),_0x27a250,_0x3cff('0xf'));logger[_0x3cff('0x10')](_0x3cff('0x11'),_0x27a250,'request\x20sent',JSON[_0x3cff('0x12')](_0x287081));if(_0x287081[_0x3cff('0x13')]){if(_0x287081[_0x3cff('0x13')][_0x3cff('0x14')]===0x1f4){logger[_0x3cff('0x13')](_0x3cff('0xe'),_0x27a250,_0x287081['error'][_0x3cff('0x15')]);return _0x18658c(_0x287081[_0x3cff('0x13')][_0x3cff('0x15')]);}logger[_0x3cff('0x13')](_0x3cff('0xe'),_0x27a250,_0x287081[_0x3cff('0x13')][_0x3cff('0x15')]);return _0x4e7857(_0x287081[_0x3cff('0x13')][_0x3cff('0x15')]);}else{logger[_0x3cff('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x27a250,_0x3cff('0xf'));_0x4e7857(_0x287081[_0x3cff('0x16')][_0x3cff('0x15')]);}})[_0x3cff('0x17')](function(_0x2d62cc){logger[_0x3cff('0x13')](_0x3cff('0xe'),_0x27a250,_0x2d62cc);_0x18658c(_0x2d62cc);});});}
\ No newline at end of file
+var _0xdac0=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x50c8b9,_0x1c4951){var _0x3f184e=function(_0x2627c5){while(--_0x2627c5){_0x50c8b9['push'](_0x50c8b9['shift']());}};_0x3f184e(++_0x1c4951);}(_0xdac0,0x152));var _0x0dac=function(_0x528e77,_0x272034){_0x528e77=_0x528e77-0x0;var _0x2b858a=_0xdac0[_0x528e77];return _0x2b858a;};'use strict';var _=require(_0x0dac('0x0'));var util=require('util');var moment=require(_0x0dac('0x1'));var BPromise=require(_0x0dac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dac('0x3'));var db=require(_0x0dac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0dac('0x5'))(_0x0dac('0x6'));var config=require('../../config/environment');var jayson=require(_0x0dac('0x7'));var client=jayson[_0x0dac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x927883,_0x302a5c,_0x10d6e3){return new BPromise(function(_0x4a8fd8,_0x11a8d9){return client[_0x0dac('0x9')](_0x927883,_0x10d6e3)['then'](function(_0x423c87){logger[_0x0dac('0xa')](_0x0dac('0xb'),_0x302a5c,_0x0dac('0xc'));logger[_0x0dac('0xd')](_0x0dac('0xe'),_0x302a5c,_0x0dac('0xc'),JSON[_0x0dac('0xf')](_0x423c87));if(_0x423c87[_0x0dac('0x10')]){if(_0x423c87[_0x0dac('0x10')][_0x0dac('0x11')]===0x1f4){logger[_0x0dac('0x10')](_0x0dac('0xb'),_0x302a5c,_0x423c87[_0x0dac('0x10')]['message']);return _0x11a8d9(_0x423c87[_0x0dac('0x10')][_0x0dac('0x12')]);}logger['error'](_0x0dac('0xb'),_0x302a5c,_0x423c87[_0x0dac('0x10')][_0x0dac('0x12')]);return _0x4a8fd8(_0x423c87[_0x0dac('0x10')]['message']);}else{logger[_0x0dac('0xa')](_0x0dac('0xb'),_0x302a5c,'request\x20sent');_0x4a8fd8(_0x423c87[_0x0dac('0x13')][_0x0dac('0x12')]);}})[_0x0dac('0x14')](function(_0x266242){logger['error'](_0x0dac('0xb'),_0x302a5c,_0x266242);_0x11a8d9(_0x266242);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 255e502..8ae2660 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 _0x4f65=['create','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x44747b,_0x59d77c){var _0x81365f=function(_0x1a11bc){while(--_0x1a11bc){_0x44747b['push'](_0x44747b['shift']());}};_0x81365f(++_0x59d77c);}(_0x4f65,0x83));var _0x54f6=function(_0x326f2c,_0xf8ae42){_0x326f2c=_0x326f2c-0x0;var _0x4f2723=_0x4f65[_0x326f2c];return _0x4f2723;};'use strict';var multer=require(_0x54f6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x54f6('0x1'));var express=require(_0x54f6('0x2'));var router=express[_0x54f6('0x3')]();var fs_extra=require(_0x54f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x54f6('0x5'));var config=require(_0x54f6('0x6'));var controller=require(_0x54f6('0x7'));router[_0x54f6('0x8')]('/',auth[_0x54f6('0x9')](),controller[_0x54f6('0xa')]);router[_0x54f6('0x8')](_0x54f6('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x54f6('0xc'),auth[_0x54f6('0x9')](),controller['show']);router['post']('/',auth[_0x54f6('0x9')](),controller[_0x54f6('0xd')]);router[_0x54f6('0xe')](_0x54f6('0xc'),auth[_0x54f6('0x9')](),controller[_0x54f6('0xf')]);router['delete'](_0x54f6('0xc'),auth[_0x54f6('0x9')](),controller[_0x54f6('0x10')]);module[_0x54f6('0x11')]=router;
\ No newline at end of file
+var _0xbaad=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3dc56a,_0x407515){var _0x201c74=function(_0x447605){while(--_0x447605){_0x3dc56a['push'](_0x3dc56a['shift']());}};_0x201c74(++_0x407515);}(_0xbaad,0x15d));var _0xdbaa=function(_0x592ca9,_0x426497){_0x592ca9=_0x592ca9-0x0;var _0x360721=_0xbaad[_0x592ca9];return _0x360721;};'use strict';var multer=require(_0xdbaa('0x0'));var util=require(_0xdbaa('0x1'));var path=require(_0xdbaa('0x2'));var timeout=require(_0xdbaa('0x3'));var express=require(_0xdbaa('0x4'));var router=express[_0xdbaa('0x5')]();var fs_extra=require(_0xdbaa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdbaa('0x7'));var config=require(_0xdbaa('0x8'));var controller=require(_0xdbaa('0x9'));router[_0xdbaa('0xa')]('/',auth[_0xdbaa('0xb')](),controller['index']);router[_0xdbaa('0xa')](_0xdbaa('0xc'),auth[_0xdbaa('0xb')](),controller[_0xdbaa('0xd')]);router['get']('/:id',auth[_0xdbaa('0xb')](),controller[_0xdbaa('0xe')]);router[_0xdbaa('0xf')]('/',auth['isAuthenticated'](),controller[_0xdbaa('0x10')]);router[_0xdbaa('0x11')](_0xdbaa('0x12'),auth[_0xdbaa('0xb')](),controller[_0xdbaa('0x13')]);router['delete'](_0xdbaa('0x12'),auth[_0xdbaa('0xb')](),controller[_0xdbaa('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index e9b57e3..d822522 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 _0x91a7=['rounded','squared','We\x20are\x20here!','Send','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','ENUM','star','thumb','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN'];(function(_0x1f11bc,_0x4dd926){var _0xab5070=function(_0x347548){while(--_0x347548){_0x1f11bc['push'](_0x1f11bc['shift']());}};_0xab5070(++_0x4dd926);}(_0x91a7,0xe7));var _0x791a=function(_0x31bdc4,_0xf6f99a){_0x31bdc4=_0x31bdc4-0x0;var _0x1e2895=_0x91a7[_0x31bdc4];return _0x1e2895;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x791a('0x0'));module[_0x791a('0x1')]={'name':{'type':Sequelize[_0x791a('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x791a('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x4')},'key':{'type':Sequelize[_0x791a('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':_0x791a('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x791a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':_0x791a('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':_0x791a('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x791a('0x2')]},'animation':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x791a('0x9'),_0x791a('0xa')),'defaultValue':_0x791a('0x9')},'header_online':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0xb')},'start_chat_button':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0xc')},'header_offline':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x791a('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x791a('0xf')]},'closingQuestion':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x13')},'ratingType':{'type':Sequelize[_0x791a('0x14')](_0x791a('0x15'),_0x791a('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x791a('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x791a('0xf')],'defaultValue':function(){return JSON[_0x791a('0x17')]({'items':[{'type':_0x791a('0x18'),'variable':null,'config':{'placeholder':_0x791a('0x19'),'type':_0x791a('0x1a'),'required':!![]},'props':{'title':_0x791a('0x19'),'helpText':''}},{'type':_0x791a('0x18'),'props':{'title':_0x791a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x791a('0x4'),'type':_0x791a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x791a('0x1b'))?JSON[_0x791a('0x1c')](this[_0x791a('0x1d')](_0x791a('0x1b'))):{};},'set':function(_0x4d748a){return this[_0x791a('0x1e')](_0x791a('0x1b'),JSON['stringify'](_0x4d748a));}},'offlineForm':{'type':Sequelize[_0x791a('0xf')],'defaultValue':function(){return JSON[_0x791a('0x17')]({'items':[{'type':_0x791a('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x791a('0x4'),'type':_0x791a('0x4')},'variable':null},{'type':_0x791a('0x1f'),'config':{'placeholder':_0x791a('0x20')},'props':{'title':_0x791a('0x20'),'helpText':_0x791a('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x791a('0x1d')](_0x791a('0x22'))?JSON['parse'](this[_0x791a('0x1d')](_0x791a('0x22'))):{};},'set':function(_0x1b10a7){return this['setDataValue'](_0x791a('0x22'),JSON['stringify'](_0x1b10a7));}},'token':{'type':Sequelize[_0x791a('0x2')],'defaultValue':function(){return rs[_0x791a('0x23')]();}},'autoclose':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x791a('0x2')]},'forwardOffline':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x24')},'waitingMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x28')},'sendUnmanaged':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x791a('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x791a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x791a('0x2')]},'customerAvatar':{'type':Sequelize[_0x791a('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x791a('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x791a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x791a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x2b')},'systemAvatar':{'type':Sequelize[_0x791a('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x791a('0xd')],'comment':_0x791a('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x15f066){if(!_0x15f066)this[_0x791a('0x1e')](_0x791a('0x2d'),null);this['setDataValue'](_0x791a('0x2e'),_0x15f066);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x791a('0x2f')},'vidaooNote':{'type':Sequelize[_0x791a('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x791a('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x791a('0xf')]}};
\ No newline at end of file
+var _0xedd9=['mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Skip','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','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','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x196ce1,_0x46e836){var _0x360a64=function(_0x3f339f){while(--_0x3f339f){_0x196ce1['push'](_0x196ce1['shift']());}};_0x360a64(++_0x46e836);}(_0xedd9,0xfc));var _0x9edd=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0xedd9[_0x57d740];return _0x6607ef;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'name':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'unique':_0x9edd('0x3')},'description':{'type':Sequelize[_0x9edd('0x2')]},'mapKey':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x4')},'key':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9edd('0x2')]},'animation':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x9edd('0x9'),_0x9edd('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xb')},'start_chat_button':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xc')},'offline_chat_button':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xd')},'header_offline':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9edd('0x11')]},'closingQuestion':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x13')},'noteTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x14')},'closingMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x9edd('0x16'),_0x9edd('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return JSON[_0x9edd('0x18')]({'items':[{'type':_0x9edd('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x9edd('0x1a'),'required':!![]},'props':{'title':_0x9edd('0x1b'),'helpText':''}},{'type':_0x9edd('0x19'),'props':{'title':_0x9edd('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9edd('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9edd('0x1c')](_0x9edd('0x1d'))?JSON[_0x9edd('0x1e')](this[_0x9edd('0x1c')](_0x9edd('0x1d'))):{};},'set':function(_0x4d507f){return this['setDataValue'](_0x9edd('0x1d'),JSON[_0x9edd('0x18')](_0x4d507f));}},'offlineForm':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return JSON[_0x9edd('0x18')]({'items':[{'type':_0x9edd('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9edd('0x4')},'variable':null},{'type':_0x9edd('0x1f'),'config':{'placeholder':_0x9edd('0x20')},'props':{'title':'Comments','helpText':_0x9edd('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x9edd('0x1c')](_0x9edd('0x22'))?JSON[_0x9edd('0x1e')](this['getDataValue'](_0x9edd('0x22'))):{};},'set':function(_0x3fb556){return this[_0x9edd('0x23')](_0x9edd('0x22'),JSON[_0x9edd('0x18')](_0x3fb556));}},'token':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':function(){return rs[_0x9edd('0x24')]();}},'autoclose':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9edd('0x2')]},'forwardOffline':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9edd('0x2')]},'waitingTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x29')},'skipUnmanaged':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x15')},'sendUnmanaged':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9edd('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9edd('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9edd('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2b')},'messagesAlignment':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2c')},'defaultTitle':{'type':Sequelize[_0x9edd('0x2')]},'customerAvatar':{'type':Sequelize[_0x9edd('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2d')},'systemAvatar':{'type':Sequelize[_0x9edd('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9edd('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![],'comment':_0x9edd('0x2f'),'set':function(_0x48958a){if(!_0x48958a)this[_0x9edd('0x23')]('mandatoryDispositionPauseId',null);this[_0x9edd('0x23')](_0x9edd('0x30'),_0x48958a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9edd('0x2')]},'vidaooTopic':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x31')},'vidaooNote':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9edd('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 188a68b..6bae009 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 _0xa137=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','destroy','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','onlineForm','fromKey','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','api','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','pick','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','applications','list','orderBy','asc','account','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','labelText','textButtonColor','color_button','transaction'];(function(_0x53b5e5,_0xc27f6f){var _0x542342=function(_0xcddd50){while(--_0xcddd50){_0x53b5e5['push'](_0x53b5e5['shift']());}};_0x542342(++_0xc27f6f);}(_0xa137,0x13f));var _0x7a13=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa137[_0x4e676e];return _0x336a3c;};'use strict';var BPromise=require(_0x7a13('0x0'));var Mustache=require(_0x7a13('0x1'));var util=require(_0x7a13('0x2'));var path=require('path');var ejs=require(_0x7a13('0x3'));var fs=require('fs');var fs_extra=require(_0x7a13('0x4'));var _=require(_0x7a13('0x5'));var querystring=require('querystring');var Redis=require(_0x7a13('0x6'));var qs=require(_0x7a13('0x7'));var logger=require('../../config/logger')(_0x7a13('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7a13('0x9')]=_[_0x7a13('0xa')](config['redis'],{'host':_0x7a13('0xb'),'port':0x18eb});var socket=require(_0x7a13('0xc'))(new Redis(config[_0x7a13('0x9')]));require(_0x7a13('0xd'))[_0x7a13('0xe')](socket);var htmlToText=require(_0x7a13('0xf'));var jayson=require(_0x7a13('0x10'));var client=jayson['client'][_0x7a13('0x11')]({'port':0x232c});var client9002=jayson[_0x7a13('0x12')][_0x7a13('0x11')]({'port':0x232a});var client9003=jayson['client'][_0x7a13('0x11')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x1ace2a,_0x3ca95b,_0xeb5d7b,_0x3b8c2){return new BPromise(function(_0x4003c5,_0x5b18f4){var _0x5296c2=_0x3b8c2||client;return _0x5296c2['request'](_0x1ace2a,_0xeb5d7b)['then'](function(_0x5bb654){logger[_0x7a13('0x13')](_0x7a13('0x14'),_0x3ca95b,_0x7a13('0x15'));logger['debug'](_0x7a13('0x16'),_0x3ca95b,_0x7a13('0x15'),JSON[_0x7a13('0x17')](_0x5bb654));if(_0x5bb654[_0x7a13('0x18')]){if(_0x5bb654[_0x7a13('0x18')][_0x7a13('0x19')]===0x1f4){logger['error'](_0x7a13('0x14'),_0x3ca95b,_0x5bb654[_0x7a13('0x18')]['message']);return _0x5b18f4(_0x5bb654[_0x7a13('0x18')][_0x7a13('0x1a')]);}logger[_0x7a13('0x18')](_0x7a13('0x14'),_0x3ca95b,_0x5bb654['error'][_0x7a13('0x1a')]);return _0x4003c5(_0x5bb654[_0x7a13('0x18')]['message']);}else{logger[_0x7a13('0x13')](_0x7a13('0x14'),_0x3ca95b,_0x7a13('0x15'));_0x4003c5(_0x5bb654['result']['message']);}})['catch'](function(_0x47a684){logger[_0x7a13('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x3ca95b,_0x47a684);_0x5b18f4(_0x47a684);});});}function respondWithStatusCode(_0x18778f,_0x281394){_0x281394=_0x281394||0xcc;return function(_0x1d1878){if(_0x1d1878){return _0x18778f[_0x7a13('0x1b')](_0x281394);}return _0x18778f[_0x7a13('0x1c')](_0x281394)[_0x7a13('0x1d')]();};}function respondWithResult(_0x146fff,_0x5a11b0){_0x5a11b0=_0x5a11b0||0xc8;return function(_0x1a8b62){if(_0x1a8b62){return _0x146fff[_0x7a13('0x1c')](_0x5a11b0)[_0x7a13('0x1e')](_0x1a8b62);}};}function respondWithFilteredResult(_0x189700,_0x50552e){return function(_0x1e23cb){if(_0x1e23cb){var _0x2ea051=typeof _0x50552e[_0x7a13('0x1f')]===_0x7a13('0x20')&&typeof _0x50552e[_0x7a13('0x21')]==='undefined';var _0xe8c9ea=_0x1e23cb[_0x7a13('0x22')];var _0x49dc88=_0x2ea051?0x0:_0x50552e[_0x7a13('0x1f')];var _0x30be21=_0x2ea051?_0x1e23cb[_0x7a13('0x22')]:_0x50552e[_0x7a13('0x1f')]+_0x50552e[_0x7a13('0x21')];var _0x23bf65;if(_0x30be21>=_0xe8c9ea){_0x30be21=_0xe8c9ea;_0x23bf65=0xc8;}else{_0x23bf65=0xce;}_0x189700['status'](_0x23bf65);return _0x189700[_0x7a13('0x23')](_0x7a13('0x24'),_0x49dc88+'-'+_0x30be21+'/'+_0xe8c9ea)['json'](_0x1e23cb);}return null;};}function saveUpdates(_0x24c380){return function(_0x591575){if(_0x591575){return _0x591575[_0x7a13('0x25')](_0x24c380)[_0x7a13('0x26')](function(_0x18ae37){return _0x18ae37;});}return null;};}function removeEntity(_0x1a1750){return function(_0xf631ea){if(_0xf631ea){return _0xf631ea['destroy']()[_0x7a13('0x26')](function(){var _0x2075b8=_0xf631ea[_0x7a13('0x27')]({'plain':!![]});var _0x2b564b=_0x7a13('0x28');return db[_0x7a13('0x29')]['destroy']({'where':{'type':_0x2b564b,'resourceId':_0x2075b8['id']}})[_0x7a13('0x26')](function(){return _0xf631ea;});})['then'](function(){_0x1a1750[_0x7a13('0x1c')](0xcc)[_0x7a13('0x1d')]();});}};}function handleEntityNotFound(_0xeeb5b9){return function(_0x4d8a7a){if(!_0x4d8a7a){_0xeeb5b9[_0x7a13('0x1b')](0x194);}return _0x4d8a7a;};}function handleError(_0x2bc1dc,_0x59ef27){_0x59ef27=_0x59ef27||0x1f4;return function(_0x336042){logger[_0x7a13('0x18')](_0x336042[_0x7a13('0x2a')]);if(_0x336042[_0x7a13('0x2b')]){delete _0x336042['name'];}_0x2bc1dc[_0x7a13('0x1c')](_0x59ef27)[_0x7a13('0x2c')](_0x336042);};}exports[_0x7a13('0x2d')]=function(_0x310e7f,_0x2aa87c){var _0x46b6fa={'include':[{'model':db[_0x7a13('0x2e')],'as':_0x7a13('0x2f')}]},_0x1f9776={},_0x20979e={'count':0x0,'rows':[]};var _0x9fa037=_[_0x7a13('0x30')](db[_0x7a13('0x31')]['rawAttributes'],function(_0x33d19c){return{'name':_0x33d19c['fieldName'],'type':_0x33d19c[_0x7a13('0x32')][_0x7a13('0x33')]};});_0x1f9776[_0x7a13('0x34')]=_[_0x7a13('0x30')](_0x9fa037,_0x7a13('0x2b'));_0x1f9776[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x310e7f[_0x7a13('0x35')]);_0x1f9776[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x1f9776[_0x7a13('0x34')],_0x1f9776[_0x7a13('0x35')]);_0x46b6fa[_0x7a13('0x39')]=_['intersection'](_0x1f9776['model'],qs[_0x7a13('0x3a')](_0x310e7f[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x46b6fa[_0x7a13('0x39')]=_0x46b6fa[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x46b6fa[_0x7a13('0x39')]:_0x1f9776[_0x7a13('0x34')];if(!_0x310e7f[_0x7a13('0x35')][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x46b6fa[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x310e7f[_0x7a13('0x35')][_0x7a13('0x21')]);_0x46b6fa[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x310e7f['query'][_0x7a13('0x1f')]);}_0x46b6fa[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x310e7f[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x46b6fa[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_['pick'](_0x310e7f['query'],_0x1f9776['filters']),_0x9fa037);if(_0x310e7f['query'][_0x7a13('0x41')]){_0x46b6fa[_0x7a13('0x40')]=_['merge'](_0x46b6fa['where'],{'$or':_[_0x7a13('0x30')](_0x9fa037,function(_0x4142ec){if(_0x4142ec[_0x7a13('0x32')]!==_0x7a13('0x42')){var _0x185009={};_0x185009[_0x4142ec[_0x7a13('0x2b')]]={'$like':'%'+_0x310e7f['query'][_0x7a13('0x41')]+'%'};return _0x185009;}})});}_0x46b6fa=_[_0x7a13('0x43')]({},_0x46b6fa,_0x310e7f['options']);var _0x24ff2a={'where':_0x46b6fa[_0x7a13('0x40')]};return db[_0x7a13('0x31')][_0x7a13('0x22')](_0x24ff2a)[_0x7a13('0x26')](function(_0x1960f6){_0x20979e[_0x7a13('0x22')]=_0x1960f6;if(_0x310e7f[_0x7a13('0x35')][_0x7a13('0x44')]){_0x46b6fa[_0x7a13('0x45')]=[{'all':!![]}];}return db[_0x7a13('0x31')][_0x7a13('0x46')](_0x46b6fa);})[_0x7a13('0x26')](function(_0x46ef7c){_0x20979e[_0x7a13('0x47')]=_0x46ef7c;return _0x20979e;})[_0x7a13('0x26')](respondWithFilteredResult(_0x2aa87c,_0x46b6fa))[_0x7a13('0x48')](handleError(_0x2aa87c,null));};exports[_0x7a13('0x49')]=function(_0x155e6c,_0xd5b213){var _0x2e662c={'raw':![],'where':{'id':_0x155e6c[_0x7a13('0x4a')]['id']},'include':[{'model':db[_0x7a13('0x2e')],'as':_0x7a13('0x2f')}]},_0x5143ce={};_0x5143ce[_0x7a13('0x34')]=_[_0x7a13('0x36')](db[_0x7a13('0x31')]['rawAttributes']);_0x5143ce[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x155e6c[_0x7a13('0x35')]);_0x5143ce[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x5143ce[_0x7a13('0x34')],_0x5143ce[_0x7a13('0x35')]);_0x2e662c[_0x7a13('0x39')]=_[_0x7a13('0x38')](_0x5143ce[_0x7a13('0x34')],qs['fields'](_0x155e6c[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x2e662c['attributes']=_0x2e662c[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x2e662c[_0x7a13('0x39')]:_0x5143ce[_0x7a13('0x34')];if(_0x155e6c[_0x7a13('0x35')][_0x7a13('0x44')]){_0x2e662c[_0x7a13('0x45')]=[{'all':!![]}];}_0x2e662c=_[_0x7a13('0x43')]({},_0x2e662c,_0x155e6c[_0x7a13('0x4b')]);return db['ChatWebsite']['find'](_0x2e662c)[_0x7a13('0x26')](handleEntityNotFound(_0xd5b213,null))[_0x7a13('0x26')](respondWithResult(_0xd5b213,null))[_0x7a13('0x48')](handleError(_0xd5b213,null));};exports[_0x7a13('0x4c')]=function(_0x86525f,_0x202110){return db[_0x7a13('0x31')][_0x7a13('0x4c')](_0x86525f['body'],{})[_0x7a13('0x26')](function(_0x2ae71a){var _0x3e1ac1=_0x86525f[_0x7a13('0x4d')][_0x7a13('0x27')]({'plain':!![]});if(!_0x3e1ac1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1ac1[_0x7a13('0x4e')]==='user'){var _0x3a8728=_0x2ae71a[_0x7a13('0x27')]({'plain':!![]});var _0x410170='ChatWebsites';return db[_0x7a13('0x4f')][_0x7a13('0x50')]({'where':{'name':_0x410170,'userProfileId':_0x3e1ac1[_0x7a13('0x51')]},'raw':!![]})[_0x7a13('0x26')](function(_0x4a5740){if(_0x4a5740&&_0x4a5740[_0x7a13('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x3a8728[_0x7a13('0x2b')],'resourceId':_0x3a8728['id'],'type':_0x4a5740['name'],'sectionId':_0x4a5740['id']},{})[_0x7a13('0x26')](function(){return _0x2ae71a;});}else{return _0x2ae71a;}})[_0x7a13('0x48')](function(_0x345cdd){logger[_0x7a13('0x18')](_0x7a13('0x53'),_0x345cdd);throw _0x345cdd;});}return _0x2ae71a;})[_0x7a13('0x26')](respondWithResult(_0x202110,0xc9))['catch'](handleError(_0x202110,null));};exports[_0x7a13('0x25')]=function(_0x113064,_0x546a9d){if(_0x113064[_0x7a13('0x54')]['id']){delete _0x113064['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x113064['params']['id']},'include':[{'model':db[_0x7a13('0x2e')],'as':_0x7a13('0x2f')}]})['then'](handleEntityNotFound(_0x546a9d,null))['then'](saveUpdates(_0x113064['body'],null))[_0x7a13('0x26')](respondWithResult(_0x546a9d,null))[_0x7a13('0x48')](handleError(_0x546a9d,null));};exports['destroy']=function(_0x131a47,_0x2bc009){return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x131a47[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x2bc009,null))[_0x7a13('0x26')](removeEntity(_0x2bc009,null))[_0x7a13('0x48')](handleError(_0x2bc009,null));};exports[_0x7a13('0x55')]=function(_0x3a3d24,_0x3d36f1){return db['ChatWebsite'][_0x7a13('0x55')]()[_0x7a13('0x26')](respondWithResult(_0x3d36f1,null))[_0x7a13('0x48')](handleError(_0x3d36f1,null));};exports[_0x7a13('0x56')]=function(_0x3a4c96,_0x43d203){if(_0x3a4c96[_0x7a13('0x54')]['id']){delete _0x3a4c96['body']['id'];}return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x3a4c96[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x43d203,null))[_0x7a13('0x26')](function(_0x5b25d1){if(_0x5b25d1){_0x3a4c96[_0x7a13('0x54')][_0x7a13('0x57')]=_0x5b25d1['id'];return db[_0x7a13('0x58')]['create'](_0x3a4c96[_0x7a13('0x54')]);}})['then'](respondWithResult(_0x43d203,null))[_0x7a13('0x48')](handleError(_0x43d203,null));};exports[_0x7a13('0x59')]=function(_0x1ca865,_0x26207e){var _0x43c2d3={'raw':![],'where':{}};var _0x201d79={};var _0x36f7c1={'count':0x0,'rows':[]};return db[_0x7a13('0x31')][_0x7a13('0x5a')]({'where':{'id':_0x1ca865['params']['id']}})['then'](handleEntityNotFound(_0x26207e,null))[_0x7a13('0x26')](function(_0xb92f30){if(_0xb92f30){_0x201d79[_0x7a13('0x34')]=_['keys'](db[_0x7a13('0x58')][_0x7a13('0x5b')]);_0x201d79[_0x7a13('0x35')]=_['keys'](_0x1ca865[_0x7a13('0x35')]);_0x201d79['filters']=_[_0x7a13('0x38')](_0x201d79[_0x7a13('0x34')],_0x201d79['query']);_0x43c2d3['attributes']=_[_0x7a13('0x38')](_0x201d79['model'],qs[_0x7a13('0x3a')](_0x1ca865[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x43c2d3[_0x7a13('0x39')]=_0x43c2d3['attributes'][_0x7a13('0x3b')]?_0x43c2d3[_0x7a13('0x39')]:_0x201d79[_0x7a13('0x34')];if(!_0x1ca865['query'][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x43c2d3[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x1ca865['query']['limit']);_0x43c2d3[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x1ca865['query']['offset']);}_0x43c2d3[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x1ca865[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x43c2d3[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_[_0x7a13('0x5c')](_0x1ca865[_0x7a13('0x35')],_0x201d79[_0x7a13('0x37')]));_0x43c2d3[_0x7a13('0x40')][_0x7a13('0x57')]=_0xb92f30['id'];if(_0x1ca865[_0x7a13('0x35')][_0x7a13('0x41')]){_0x43c2d3[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x43c2d3[_0x7a13('0x40')],{'$or':_[_0x7a13('0x30')](_0x43c2d3[_0x7a13('0x39')],function(_0x28af9c){var _0x56d7a7={};_0x56d7a7[_0x28af9c]={'$like':'%'+_0x1ca865[_0x7a13('0x35')]['filter']+'%'};return _0x56d7a7;})});}_0x43c2d3=_[_0x7a13('0x43')]({},_0x43c2d3,_0x1ca865[_0x7a13('0x4b')]);return db[_0x7a13('0x58')][_0x7a13('0x22')]({'where':_0x43c2d3[_0x7a13('0x40')]})['then'](function(_0x3255f1){_0x36f7c1[_0x7a13('0x22')]=_0x3255f1;if(_0x1ca865[_0x7a13('0x35')]['includeAll']){_0x43c2d3['include']=[{'all':!![]}];}return db[_0x7a13('0x58')][_0x7a13('0x46')](_0x43c2d3);})[_0x7a13('0x26')](function(_0x4d2fc3){_0x36f7c1[_0x7a13('0x47')]=_0x4d2fc3;return _0x36f7c1;});}})[_0x7a13('0x26')](respondWithFilteredResult(_0x26207e,_0x43c2d3))[_0x7a13('0x48')](handleError(_0x26207e,null));};exports[_0x7a13('0x5d')]=function(_0x3b8ace,_0x3dd0cb){return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x3b8ace['params']['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x3dd0cb,null))[_0x7a13('0x26')](function(_0x5397fa){if(_0x5397fa){return _0x5397fa[_0x7a13('0x5d')](_0x3b8ace[_0x7a13('0x35')][_0x7a13('0x5e')]);}})[_0x7a13('0x26')](respondWithStatusCode(_0x3dd0cb,null))[_0x7a13('0x48')](handleError(_0x3dd0cb,null));};exports['addAnswer']=function(_0x51aab0,_0xe19a20){if(_0x51aab0[_0x7a13('0x54')]['id']){delete _0x51aab0[_0x7a13('0x54')]['id'];}return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x51aab0[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0xe19a20,null))[_0x7a13('0x26')](function(_0x400096){if(_0x400096){_0x51aab0[_0x7a13('0x54')][_0x7a13('0x57')]=_0x400096['id'];return db[_0x7a13('0x5f')]['create'](_0x51aab0[_0x7a13('0x54')]);}})[_0x7a13('0x26')](respondWithResult(_0xe19a20,null))['catch'](handleError(_0xe19a20,null));};exports[_0x7a13('0x60')]=function(_0xdf2947,_0x39f055){var _0x39a075={'raw':![],'where':{}};var _0x400ccf={};var _0x4c6ec1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7a13('0x5a')]({'where':{'id':_0xdf2947[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x39f055,null))[_0x7a13('0x26')](function(_0x2abc3b){if(_0x2abc3b){_0x400ccf[_0x7a13('0x34')]=_['keys'](db[_0x7a13('0x5f')]['rawAttributes']);_0x400ccf['query']=_['keys'](_0xdf2947[_0x7a13('0x35')]);_0x400ccf[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x400ccf[_0x7a13('0x34')],_0x400ccf[_0x7a13('0x35')]);_0x39a075[_0x7a13('0x39')]=_[_0x7a13('0x38')](_0x400ccf[_0x7a13('0x34')],qs[_0x7a13('0x3a')](_0xdf2947[_0x7a13('0x35')]['fields']));_0x39a075[_0x7a13('0x39')]=_0x39a075[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x39a075[_0x7a13('0x39')]:_0x400ccf[_0x7a13('0x34')];if(!_0xdf2947[_0x7a13('0x35')][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x39a075['limit']=qs[_0x7a13('0x21')](_0xdf2947[_0x7a13('0x35')]['limit']);_0x39a075[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0xdf2947['query'][_0x7a13('0x1f')]);}_0x39a075['order']=qs[_0x7a13('0x3f')](_0xdf2947[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x39a075[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_[_0x7a13('0x5c')](_0xdf2947[_0x7a13('0x35')],_0x400ccf[_0x7a13('0x37')]));_0x39a075[_0x7a13('0x40')]['ChatWebsiteId']=_0x2abc3b['id'];if(_0xdf2947[_0x7a13('0x35')][_0x7a13('0x41')]){_0x39a075[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x39a075[_0x7a13('0x40')],{'$or':_[_0x7a13('0x30')](_0x39a075[_0x7a13('0x39')],function(_0x5be7fe){var _0x3bf2c8={};_0x3bf2c8[_0x5be7fe]={'$like':'%'+_0xdf2947[_0x7a13('0x35')][_0x7a13('0x41')]+'%'};return _0x3bf2c8;})});}_0x39a075=_[_0x7a13('0x43')]({},_0x39a075,_0xdf2947[_0x7a13('0x4b')]);return db[_0x7a13('0x5f')][_0x7a13('0x22')]({'where':_0x39a075['where']})['then'](function(_0x5445de){_0x4c6ec1['count']=_0x5445de;if(_0xdf2947[_0x7a13('0x35')][_0x7a13('0x44')]){_0x39a075['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x7a13('0x46')](_0x39a075);})[_0x7a13('0x26')](function(_0x435a1b){_0x4c6ec1[_0x7a13('0x47')]=_0x435a1b;return _0x4c6ec1;});}})[_0x7a13('0x26')](respondWithFilteredResult(_0x39f055,_0x39a075))['catch'](handleError(_0x39f055,null));};exports[_0x7a13('0x61')]=function(_0x4e3c72,_0x567a12){return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x4e3c72['params']['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x567a12,null))[_0x7a13('0x26')](function(_0xae128a){if(_0xae128a){return _0xae128a['removeAnswers'](_0x4e3c72['query'][_0x7a13('0x5e')]);}})['then'](respondWithStatusCode(_0x567a12,null))[_0x7a13('0x48')](handleError(_0x567a12,null));};exports[_0x7a13('0x62')]=function(_0x2d8e6c,_0x231321){_0x2d8e6c['body'][_0x7a13('0x63')]=_0x2d8e6c['file'][_0x7a13('0x64')];return db[_0x7a13('0x31')]['find']({'where':{'id':_0x2d8e6c[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x231321,null))[_0x7a13('0x26')](saveUpdates(_0x2d8e6c['body'],null))[_0x7a13('0x26')](respondWithResult(_0x231321,null))['catch'](handleError(_0x231321,null));};exports[_0x7a13('0x65')]=function(_0xa54855,_0x5f2855){_0xa54855[_0x7a13('0x54')]['agentAvatar']=_0xa54855[_0x7a13('0x66')]['filename'];return db[_0x7a13('0x31')]['find']({'where':{'id':_0xa54855[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x5f2855,null))[_0x7a13('0x26')](saveUpdates(_0xa54855[_0x7a13('0x54')],null))[_0x7a13('0x26')](respondWithResult(_0x5f2855,null))['catch'](handleError(_0x5f2855,null));};exports[_0x7a13('0x67')]=function(_0x426a17,_0x26ec1c){_0x426a17[_0x7a13('0x54')][_0x7a13('0x68')]=_0x426a17['file']['filename'];return db[_0x7a13('0x31')]['find']({'where':{'id':_0x426a17[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x26ec1c,null))[_0x7a13('0x26')](saveUpdates(_0x426a17['body'],null))['then'](respondWithResult(_0x26ec1c,null))[_0x7a13('0x48')](handleError(_0x26ec1c,null));};exports[_0x7a13('0x69')]=function(_0x4e8ceb,_0x3607d5){_0x4e8ceb[_0x7a13('0x54')][_0x7a13('0x6a')]=_0x4e8ceb['file'][_0x7a13('0x64')];return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x4e8ceb[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x3607d5,null))[_0x7a13('0x26')](saveUpdates(_0x4e8ceb['body'],null))[_0x7a13('0x26')](respondWithResult(_0x3607d5,null))[_0x7a13('0x48')](handleError(_0x3607d5,null));};exports[_0x7a13('0x6b')]=function(_0x2d09a2,_0x359a35){var _0x4331c2=path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],'server/files/images/logos/default_logo.svg');var _0x2f7bab={'where':{'id':_0x2d09a2['params']['id']},'attributes':['id',_0x7a13('0x63')],'raw':!![]};var _0x2dde42=![];return require(_0x7a13('0x6e'))['getLicense']()['then'](function(_0x516d23){if(_0x516d23){_0x2dde42=_0x516d23[_0x7a13('0x6f')];}})[_0x7a13('0x26')](function(){return db[_0x7a13('0x31')][_0x7a13('0x50')](_0x2f7bab);})[_0x7a13('0x26')](handleEntityNotFound(_0x359a35,null))['then'](function(_0xda9e77){if(_0xda9e77){if(!_[_0x7a13('0x70')](_0xda9e77[_0x7a13('0x63')])){if(fs[_0x7a13('0x71')](path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x72'),_0xda9e77[_0x7a13('0x63')]))&&_0x2dde42){_0x4331c2=path['join'](config['root'],_0x7a13('0x72'),_0xda9e77[_0x7a13('0x63')]);}}return _0x359a35[_0x7a13('0x73')](_0x4331c2);}})['catch'](handleError(_0x359a35,null));};exports[_0x7a13('0x74')]=function(_0x141793,_0x185152){var _0x54e909=path[_0x7a13('0x6c')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x498734={'where':{'id':_0x141793['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7a13('0x31')][_0x7a13('0x50')](_0x498734)['then'](handleEntityNotFound(_0x185152,null))['then'](function(_0xcd0f4c){if(_0xcd0f4c){if(!_['isNil'](_0xcd0f4c[_0x7a13('0x75')])){if(fs[_0x7a13('0x71')](path['join'](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0xcd0f4c[_0x7a13('0x75')]))){_0x54e909=path['join'](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0xcd0f4c['agentAvatar']);}}return _0x185152[_0x7a13('0x73')](_0x54e909);}})[_0x7a13('0x48')](handleError(_0x185152,null));};exports['getCustomerAvatar']=function(_0x64516a,_0x58cbc9){var _0x22c1ba=path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x77'));var _0x5329ed={'where':{'id':_0x64516a[_0x7a13('0x4a')]['id']},'attributes':['id',_0x7a13('0x68'),_0x7a13('0x78')],'raw':!![]};return db[_0x7a13('0x31')][_0x7a13('0x50')](_0x5329ed)[_0x7a13('0x26')](handleEntityNotFound(_0x58cbc9,null))[_0x7a13('0x26')](function(_0x360b5e){if(_0x360b5e){if(!_[_0x7a13('0x70')](_0x360b5e[_0x7a13('0x68')])){if(fs['existsSync'](path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0x360b5e[_0x7a13('0x68')]))&&_0x360b5e[_0x7a13('0x78')]){_0x22c1ba=path['join'](config['root'],'server/files/images/avatars/',_0x360b5e[_0x7a13('0x68')]);}}return _0x58cbc9['download'](_0x22c1ba);}})['catch'](handleError(_0x58cbc9,null));};exports[_0x7a13('0x79')]=function(_0x3b4bf,_0x425f81){var _0x42cae6=path['join'](config['root'],_0x7a13('0x7a'));var _0x119392={'where':{'id':_0x3b4bf[_0x7a13('0x4a')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x7a13('0x31')][_0x7a13('0x50')](_0x119392)[_0x7a13('0x26')](handleEntityNotFound(_0x425f81,null))[_0x7a13('0x26')](function(_0x495d8f){if(_0x495d8f){if(!_[_0x7a13('0x70')](_0x495d8f[_0x7a13('0x6a')])){if(fs[_0x7a13('0x71')](path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0x495d8f[_0x7a13('0x6a')]))){_0x42cae6=path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0x495d8f['systemAvatar']);}}return _0x425f81['download'](_0x42cae6);}})[_0x7a13('0x48')](handleError(_0x425f81,null));};exports[_0x7a13('0x7b')]=function(_0x169890,_0x4e70fb){var _0x11d2c7=require('user-agent-parser');var _0x44d0b0=new _0x11d2c7();var _0x5b81d7=_0x44d0b0[_0x7a13('0x7c')](_0x169890[_0x7a13('0x7d')][_0x7a13('0x7e')])[_0x7a13('0x7f')]();var _0x44c6ca={'body':_0x169890['body'],'channel':_0x7a13('0x80')};var _0x9cce9f=[];var _0x582f12=[];var _0x40b4ea={};var _0x3c0427=![];return db[_0x7a13('0x81')][_0x7a13('0x55')]()[_0x7a13('0x26')](function(_0x53dd24){if(!_0x53dd24){throw new db['Sequelize'][(_0x7a13('0x82'))](_0x7a13('0x83'));}_0x9cce9f=_[_0x7a13('0x84')](_['keys'](_0x53dd24),['createdAt',_0x7a13('0x85')]);_0x582f12=_['difference'](_[_0x7a13('0x36')](_0x53dd24),[_0x7a13('0x86'),_0x7a13('0x85'),_0x7a13('0x87'),'ListId']);if(_0x169890[_0x7a13('0x54')]['id']){delete _0x169890[_0x7a13('0x54')]['id'];}if(_['isNil'](_0x169890['body'][_0x7a13('0x88')])){throw new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))](_0x7a13('0x8a'));}if(_[_0x7a13('0x70')](_0x169890['body'][_0x7a13('0x54')])||_0x169890[_0x7a13('0x54')][_0x7a13('0x54')]===''){throw new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))](_0x7a13('0x8b'));}if(_[_0x7a13('0x70')](_0x169890[_0x7a13('0x54')][_0x7a13('0x8c')])){throw new db[(_0x7a13('0x89'))]['ValidationError'](_0x7a13('0x8d')+_0x582f12);}if(!_['includes'](_0x582f12,_0x169890['body'][_0x7a13('0x8c')])){throw new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x582f12);}_0x40b4ea[_0x169890[_0x7a13('0x54')][_0x7a13('0x8c')]]=_0x169890[_0x7a13('0x54')][_0x7a13('0x88')];})['then'](function(){return db['ChatWebsite'][_0x7a13('0x50')]({'where':{'id':_0x169890['params']['id']},'include':[{'model':db[_0x7a13('0x8e')],'as':_0x7a13('0x8f'),'include':[{'model':db[_0x7a13('0x81')],'as':_0x7a13('0x90'),'where':_0x40b4ea,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x7a13('0x91')],'as':_0x7a13('0x92')}]});})[_0x7a13('0x26')](handleEntityNotFound(_0x4e70fb,null))[_0x7a13('0x26')](function(_0x105baa){if(_0x105baa&&_0x105baa[_0x7a13('0x8f')]){_0x44c6ca['account']=_0x105baa;_0x44c6ca[_0x7a13('0x93')]=_0x105baa[_0x7a13('0x92')];_0x44c6ca[_0x7a13('0x94')]=_0x105baa[_0x7a13('0x8f')];_0x44c6ca[_0x7a13('0x93')]=_[_0x7a13('0x95')](_0x44c6ca[_0x7a13('0x93')],['priority'],[_0x7a13('0x96')]);if(_0x44c6ca[_0x7a13('0x97')][_0x7a13('0x92')]){delete _0x44c6ca['account'][_0x7a13('0x92')];}if(_0x44c6ca[_0x7a13('0x97')]['List']&&_0x44c6ca[_0x7a13('0x97')]['List'][_0x7a13('0x90')][_0x7a13('0x3b')]){return _0x44c6ca[_0x7a13('0x97')][_0x7a13('0x8f')]['Contacts'][0x0];}var _0x43543a=_[_0x7a13('0xa')](_0x169890[_0x7a13('0x54')],{'firstName':_0x169890[_0x7a13('0x54')][_0x7a13('0x88')],'ListId':_0x105baa[_0x7a13('0x98')]});_0x43543a[_0x169890[_0x7a13('0x54')][_0x7a13('0x8c')]]=_0x169890[_0x7a13('0x54')][_0x7a13('0x88')];return db[_0x7a13('0x81')][_0x7a13('0x4c')](_0x43543a,{'fields':_0x9cce9f,'raw':!![]});}})[_0x7a13('0x26')](handleEntityNotFound(_0x4e70fb,null))[_0x7a13('0x26')](function(_0x10d8ac){_0x44c6ca[_0x7a13('0x99')]=_0x10d8ac;var _0x317b89=_0x169890[_0x7a13('0x54')][_0x7a13('0x9a')];if(_0x169890[_0x7a13('0x7d')][_0x7a13('0x9b')]){_0x317b89=_0x169890[_0x7a13('0x7d')][_0x7a13('0x9b')];}else if(_0x169890['headers'][_0x7a13('0x9c')]){_0x317b89=_[_0x7a13('0x9d')](_0x169890[_0x7a13('0x7d')][_0x7a13('0x9c')][_0x7a13('0x9e')](','));}if(_0x10d8ac){var _0x10db6c={'ContactId':_0x10d8ac['id'],'ChatWebsiteId':_0x169890[_0x7a13('0x4a')]['id'],'from':(_0x10d8ac[_0x7a13('0x9f')]||'')+'\x20'+(_0x10d8ac[_0x7a13('0xa0')]||''),'customerIp':_0x317b89,'customerPort':_0x169890[_0x7a13('0x7d')][_0x7a13('0xa1')]?_0x169890[_0x7a13('0x7d')]['x-real-port']:null,'referer':_0x169890[_0x7a13('0x54')][_0x7a13('0xa2')],'browserName':_0x5b81d7['browser'][_0x7a13('0x2b')]&&_0x5b81d7[_0x7a13('0xa3')][_0x7a13('0xa4')]?util[_0x7a13('0xa5')](_0x7a13('0xa6'),_0x5b81d7['browser'][_0x7a13('0x2b')],_0x5b81d7[_0x7a13('0xa3')][_0x7a13('0xa4')]):_0x7a13('0xa7'),'browserVersion':_0x5b81d7['browser'][_0x7a13('0xa4')]||_0x7a13('0xa7'),'osName':util[_0x7a13('0xa5')](_0x7a13('0xa6'),_0x5b81d7['os'][_0x7a13('0x2b')],_0x5b81d7['os'][_0x7a13('0xa4')]),'osVersion':_0x5b81d7['os'][_0x7a13('0xa4')],'deviceModel':_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0x34')]&&_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0xa9')]?util[_0x7a13('0xa5')](_0x7a13('0xaa'),_0x5b81d7['device'][_0x7a13('0x34')],_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0xa9')],_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0x32')]):null,'deviceVendor':_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0xa9')],'deviceType':_0x5b81d7[_0x7a13('0xa8')]['type'],'formData':JSON[_0x7a13('0x17')](_0x169890[_0x7a13('0x54')])};var _0x5803e6={'ChatWebsiteId':_0x169890['params']['id'],'closed':![]};if(_0x169890['body'][_0x7a13('0xab')]){_0x5803e6[_0x7a13('0xab')]=_0x169890[_0x7a13('0x54')]['threadId'];return db[_0x7a13('0xac')]['find']({'where':_0x5803e6})['then'](function(_0x4b76f6){if(_0x4b76f6){return[_0x4b76f6,![]];}_0x10db6c['threadId']=_0x169890[_0x7a13('0x54')][_0x7a13('0xab')];_0x10db6c[_0x7a13('0xad')]=_0x169890[_0x7a13('0x54')][_0x7a13('0xad')];return db[_0x7a13('0xac')]['create'](_0x10db6c)[_0x7a13('0x26')](function(_0x2420b6){return[_0x2420b6,!![]];});});}_0x5803e6['ContactId']=_0x10d8ac['id'];if(_0x169890[_0x7a13('0x54')][_0x7a13('0xae')]&&_0x169890[_0x7a13('0x54')][_0x7a13('0xae')]['id']){_0x5803e6['id']=_0x169890[_0x7a13('0x54')][_0x7a13('0xae')]['id'];return db[_0x7a13('0xac')][_0x7a13('0x50')]({'where':_0x5803e6})[_0x7a13('0x26')](function(_0x3477d2){if(_0x3477d2){return[_0x3477d2,![]];}return db[_0x7a13('0xac')]['create'](_0x10db6c)[_0x7a13('0x26')](function(_0x33b9e1){return[_0x33b9e1,!![]];});});}return db[_0x7a13('0xac')][_0x7a13('0x4c')](_0x10db6c)[_0x7a13('0x26')](function(_0x53efe3){return[_0x53efe3,!![]];});}})[_0x7a13('0xaf')](function(_0x596cdc,_0x5ed2c9){if(_0x596cdc){_0x3c0427=_0x5ed2c9;if(!_0x5ed2c9){var _0xff4612={'from':(_0x44c6ca[_0x7a13('0x99')]['firstName']||'')+'\x20'+(_0x44c6ca[_0x7a13('0x99')][_0x7a13('0xa0')]||'')};if(_0x169890[_0x7a13('0x54')][_0x7a13('0xab')]&&_0x169890['body'][_0x7a13('0xb0')]&&_0x169890['body']['threadId']!=_0x169890[_0x7a13('0x54')][_0x7a13('0xb0')]){_0xff4612[_0x7a13('0xab')]=_0x169890['body'][_0x7a13('0xb0')];}return _0x596cdc[_0x7a13('0x25')](_0xff4612);}else{return _0x596cdc;}}})[_0x7a13('0x26')](function(_0x32b502){_0x44c6ca[_0x7a13('0xae')]=_0x32b502[_0x7a13('0x27')]({'plain':!![]});_0x44c6ca[_0x7a13('0xae')][_0x7a13('0xb1')]=_0x3c0427;if(_0x44c6ca[_0x7a13('0xae')][_0x7a13('0xb1')]){if(_0x44c6ca[_0x7a13('0x97')][_0x7a13('0xb2')]){_0x44c6ca[_0x7a13('0x93')]['push']({'id':0x0,'priority':_0x44c6ca[_0x7a13('0x93')][_0x7a13('0x3b')]+0x1,'app':_0x7a13('0xb3'),'appdata':_0x7a13('0xb4'),'interval':_0x7a13('0xb5')});}}return db[_0x7a13('0xb6')][_0x7a13('0x4c')]({'body':_0x169890[_0x7a13('0x54')]['body'],'ChatWebsiteId':_0x169890[_0x7a13('0x4a')]['id'],'ChatInteractionId':_0x32b502['id'],'direction':'in','ContactId':_0x44c6ca[_0x7a13('0x99')]['id'],'AttachmentId':_0x169890[_0x7a13('0x54')]['AttachmentId']});})[_0x7a13('0x26')](function(_0x40775c){_0x44c6ca['message']=_0x40775c;if(_0x44c6ca['interaction'][_0x7a13('0xb7')]){return db['User'][_0x7a13('0x50')]({'attributes':['id','name'],'where':{'id':_0x44c6ca[_0x7a13('0xae')][_0x7a13('0xb7')]}})['then'](function(_0x3a9cbb){if(_0x3a9cbb){_0x44c6ca[_0x7a13('0x93')][_0x7a13('0xb8')]({'id':0x0,'priority':0x0,'app':_0x7a13('0xb9'),'appdata':_0x3a9cbb[_0x7a13('0x2b')]+','+(_0x44c6ca[_0x7a13('0x97')][_0x7a13('0xba')]||0xa),'interval':_0x7a13('0xb5')});_0x44c6ca[_0x7a13('0xbb')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x44c6ca);});}return respondWithRpcPromise(_0x7a13('0xbc'),'startRouting',_0x44c6ca);})[_0x7a13('0x26')](function(_0xc71fd3){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0xc71fd3},client9002);return _0xc71fd3;})['then'](respondWithResult(_0x4e70fb,null))[_0x7a13('0x48')](handleError(_0x4e70fb,null));};exports[_0x7a13('0xbd')]=function(_0x581d89,_0xa91294){var _0x24ed8e,_0x1aa947,_0xe71c2b;var _0x3328cb=[];var _0x57059a={};var _0x370316=_0x581d89[_0x7a13('0xbe')]||[];var _0x58f507=[];var _0x7aea76;return db['CmContact'][_0x7a13('0x55')]()[_0x7a13('0x26')](function(_0x259f0d){if(!_0x259f0d){throw new db[(_0x7a13('0x89'))]['ValidationError'](_0x7a13('0x83'));}_0x3328cb=_[_0x7a13('0x84')](_[_0x7a13('0x36')](_0x259f0d),[_0x7a13('0x86'),_0x7a13('0x85'),_0x7a13('0x87'),_0x7a13('0x98')]);if(_0x581d89['body']['id']){delete _0x581d89[_0x7a13('0x54')]['id'];}if(_[_0x7a13('0x70')](_0x581d89['body'][_0x7a13('0x88')])){throw _0xa91294[_0x7a13('0x1c')](0x1f4)['send'](new db['Sequelize'][(_0x7a13('0x82'))](_0x7a13('0x8a')));}if(_[_0x7a13('0x70')](_0x581d89[_0x7a13('0x54')][_0x7a13('0x54')])||_0x581d89['body'][_0x7a13('0x54')]===''){throw _0xa91294[_0x7a13('0x1c')](0x1f4)[_0x7a13('0x2c')](new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))](_0x7a13('0x8b')));}if(_[_0x7a13('0x70')](_0x581d89[_0x7a13('0x54')][_0x7a13('0xbf')])){throw _0xa91294[_0x7a13('0x1c')](0x1f4)[_0x7a13('0x2c')](new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))](_0x7a13('0xc0')+_0x3328cb));}if(!_[_0x7a13('0xc1')](_0x3328cb,_0x581d89['body'][_0x7a13('0xbf')])){throw _0xa91294['status'](0x1f4)[_0x7a13('0x2c')](new db[(_0x7a13('0x89'))]['ValidationError'](_0x7a13('0xc2')+_0x3328cb));}_0x57059a[_0x581d89[_0x7a13('0x54')]['mapKeyOffline']]=_0x581d89[_0x7a13('0x54')]['from'];})[_0x7a13('0x26')](function(){return db[_0x7a13('0x31')]['find']({'where':{'id':_0x581d89['params']['id']},'include':[{'model':db[_0x7a13('0x8e')],'as':'List'},{'model':db[_0x7a13('0xc3')],'as':'MailAccount'}]});})[_0x7a13('0x26')](handleEntityNotFound(_0xa91294,null))[_0x7a13('0x26')](function(_0x2b9199){if(_0x2b9199&&_0x2b9199[_0x7a13('0x8f')]){_0x1aa947=_0x2b9199;var _0x274407=_[_0x7a13('0xa')](_0x581d89[_0x7a13('0x54')],{'firstName':_0x581d89[_0x7a13('0x54')][_0x7a13('0x88')],'phone':_0x581d89[_0x7a13('0x54')]['from'],'ListId':_0x2b9199[_0x7a13('0x98')]});_0x274407[_0x581d89['body']['mapKeyOffline']]=_0x581d89[_0x7a13('0x54')][_0x7a13('0x88')];return db[_0x7a13('0x81')][_0x7a13('0xc4')]({'where':_0x57059a,'defaults':_0x274407});}})[_0x7a13('0xaf')](function(_0x1d6269){if(_0x1d6269){_0xe71c2b=_0x1d6269;var _0x1128c5=fs[_0x7a13('0xc5')](path[_0x7a13('0x6c')](config['root'],_0x7a13('0xc6')),_0x7a13('0xc7'));var _0x5ba3e9=ejs['render'](_0x1128c5,{'body':_[_0x7a13('0xc8')](_0x581d89[_0x7a13('0x54')][_0x7a13('0x54')]),'bodyTitle':_0x1aa947[_0x7a13('0xc9')]});return db['ChatOfflineMessage'][_0x7a13('0x4c')]({'body':_0x5ba3e9,'plainBody':htmlToText['fromString'](_0x5ba3e9),'ContactId':_0x1d6269['id'],'ChatWebsiteId':_0x1aa947['id']});}})['then'](function(_0x514294){_0x7aea76=_0x514294;if(_0x370316['length']){var _0x3a57d4=_0x370316[_0x7a13('0x30')](function(_0x5ae2ee){return{'name':_0x5ae2ee[_0x7a13('0xca')],'basename':_0x5ae2ee[_0x7a13('0x64')],'type':_0x5ae2ee[_0x7a13('0xcb')],'ChatOfflineMessageId':_0x514294['id']};});_0x58f507=_0x3a57d4['map'](_0x2329fc=>{var _0x14a779={'filename':_0x2329fc['name'],'path':path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],'server',_0x7a13('0xbe'),_0x7a13('0xcc'),_0x7a13('0xcd'),_0x2329fc[_0x7a13('0xce')])};return _0x14a779;});if(!_0x1aa947[_0x7a13('0xcf')]){return db[_0x7a13('0xd0')]['transaction'](function(_0x13d228){return db[_0x7a13('0xd1')][_0x7a13('0xd2')](_0x3a57d4,{'transaction':_0x13d228});});}}})[_0x7a13('0x26')](function(){if(_0x7aea76){_0x24ed8e=_0x7aea76;return db['MailAccount'][_0x7a13('0x5a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x7a13('0xd3'),'raw':!![],'include':[{'model':db[_0x7a13('0xd4')],'as':_0x7a13('0xd4'),'raw':!![]}]}]});}})[_0x7a13('0x26')](function(_0x4af42b){if(_0x4af42b&&_0x4af42b[_0x7a13('0xd3')]&&_0x1aa947[_0x7a13('0xd5')]&&_0x1aa947['forwardOfflineAddress']){var _0xbb9a9e=_0x4af42b[_0x7a13('0xd6')]();return respondWithRpcPromise(_0x7a13('0xd7'),_0x7a13('0xd8'),{'account':_0xbb9a9e,'message':{'from':util[_0x7a13('0xa5')]('\x22%s\x22\x20<%s>',_0x4af42b[_0x7a13('0x2b')],_0x4af42b[_0x7a13('0xd9')]||_0x4af42b[_0x7a13('0xd3')]['user']),'to':_0x1aa947[_0x7a13('0xda')],'subject':_0x1aa947[_0x7a13('0xdb')],'html':_0x24ed8e[_0x7a13('0x54')],'attachments':_0x58f507}},client9003)[_0x7a13('0x26')](function(){return _0x24ed8e;})['catch'](function(_0x4497f1){logger[_0x7a13('0x18')](_0x4497f1);});}})[_0x7a13('0x26')](function(){if(_0x1aa947&&_0x1aa947['openNewInteraction']&&_0x1aa947[_0x7a13('0xdc')]){var _0x316497=[];if(_0x370316[_0x7a13('0x3b')]){_0x316497=_0x370316[_0x7a13('0x30')](function(_0x4854cd){return{'name':_0x4854cd[_0x7a13('0xca')],'basename':_0x4854cd[_0x7a13('0x64')],'type':_0x4854cd[_0x7a13('0xcb')],'ChatOfflineMessageId':_0x7aea76['id']};});}var _0x53a6d8;if(!_[_0x7a13('0x70')](_0x1aa947[_0x7a13('0xdd')])){var _0x5a197b=_[_0x7a13('0x30')](_0x581d89['body'],function(_0x3657a8){return _0x3657a8;});var _0x2b33cd=_[_0x7a13('0xde')](_0x5a197b)[0x0];var _0xd6d502=_[_0x7a13('0xdf')](_0x2b33cd,function(_0x211a02){return _0x211a02;});_0x53a6d8=_0xd6d502[0x1][_0x1aa947[_0x7a13('0xdd')]];}var _0x466102={'from':_0xe71c2b[_0x7a13('0xd9')],'firstName':_0xe71c2b['firstName'],'lastName':_0xe71c2b[_0x7a13('0xa0')],'mapKey':_0x7a13('0xd9'),'message':{'from':_0xe71c2b[_0x7a13('0xd9')],'to':_0x1aa947[_0x7a13('0xc3')][_0x7a13('0xd9')],'cc':'','subject':_['isNil'](_0x53a6d8)?_0x1aa947[_0x7a13('0xdb')]:_0x53a6d8,'messageId':'','sentAt':new Date(),'attach':_0x316497[_0x7a13('0x3b')],'attachments':_0x316497,'originChannel':'Chat','ChatWebsiteId':_0x1aa947['id'],'ChatOfflineMessageId':_0x24ed8e['id'],'originTo':_0x1aa947[_0x7a13('0xc3')][_0x7a13('0xd9')]},'body':_0x24ed8e[_0x7a13('0x54')]};var _0x307409={'account':{'id':_0x1aa947['MailAccountId']},'body':_0x466102,'log':_0x7a13('0xe0')};return respondWithRpcPromise('NotifyMailAccount',_0x7a13('0xe1'),_0x307409,client9001)[_0x7a13('0x26')](function(){return _0x24ed8e;})[_0x7a13('0x48')](function(_0x155df5){logger['error'](_0x155df5);});}return;})[_0x7a13('0x26')](function(){if(_0x24ed8e){return _0x24ed8e;}})['then'](respondWithResult(_0xa91294,null))[_0x7a13('0x48')](function(_0x5e3b2b){logger[_0x7a13('0x18')](_0x7a13('0x48'),_0x5e3b2b);for(var _0x2465f7 of _0x370316){var _0x17a307=path[_0x7a13('0x6c')](config['root'],'server',_0x7a13('0xbe'),'attachments',_0x7a13('0xcd'),_0x2465f7[_0x7a13('0x64')]);fs_extra[_0x7a13('0xe2')](_0x17a307)[_0x7a13('0x48')](function(_0x43ccac){logger[_0x7a13('0x18')](_0x7a13('0xe3'),_0x17a307,_0x43ccac);});}});};exports[_0x7a13('0xe4')]=function(_0xb169ee,_0x7b476){return db[_0x7a13('0xac')][_0x7a13('0x50')]({'where':{'id':_0xb169ee[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x7b476,null))[_0x7a13('0x26')](function(_0x25b305){if(_0x25b305){return _0x25b305[_0x7a13('0xe4')](_0xb169ee[_0x7a13('0x54')]['ids'],_['omit'](_0xb169ee[_0x7a13('0x54')],['ids','id'])||{});}})[_0x7a13('0x26')](respondWithResult(_0x7b476,null))[_0x7a13('0x48')](handleError(_0x7b476,null));};exports[_0x7a13('0xe5')]=function(_0x1c16e8,_0x218353){var _0x4c97e4={'raw':![],'where':{}};var _0xa8ac7={};var _0x7f709f={'count':0x0,'rows':[]};return db[_0x7a13('0x31')]['findOne']({'where':{'id':_0x1c16e8[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x218353,null))[_0x7a13('0x26')](function(_0xcd5ac4){if(_0xcd5ac4){_0xa8ac7['model']=_[_0x7a13('0x36')](db[_0x7a13('0xac')][_0x7a13('0x5b')]);_0xa8ac7[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x1c16e8[_0x7a13('0x35')]);_0xa8ac7[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0xa8ac7[_0x7a13('0x34')],_0xa8ac7[_0x7a13('0x35')]);_0x4c97e4[_0x7a13('0x39')]=_['intersection'](_0xa8ac7['model'],qs['fields'](_0x1c16e8[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x4c97e4[_0x7a13('0x39')]=_0x4c97e4['attributes'][_0x7a13('0x3b')]?_0x4c97e4['attributes']:_0xa8ac7[_0x7a13('0x34')];if(!_0x1c16e8[_0x7a13('0x35')][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x4c97e4[_0x7a13('0x21')]=qs['limit'](_0x1c16e8[_0x7a13('0x35')]['limit']);_0x4c97e4[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x1c16e8[_0x7a13('0x35')][_0x7a13('0x1f')]);}_0x4c97e4['order']=qs[_0x7a13('0x3f')](_0x1c16e8['query']['sort']);_0x4c97e4[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_['pick'](_0x1c16e8[_0x7a13('0x35')],_0xa8ac7[_0x7a13('0x37')]));_0x4c97e4[_0x7a13('0x40')][_0x7a13('0x57')]=_0xcd5ac4['id'];if(_0x1c16e8[_0x7a13('0x35')]['filter']){_0x4c97e4[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x4c97e4[_0x7a13('0x40')],{'$or':_[_0x7a13('0x30')](_0x4c97e4['attributes'],function(_0x2e017e){var _0xea214={};_0xea214[_0x2e017e]={'$like':'%'+_0x1c16e8['query'][_0x7a13('0x41')]+'%'};return _0xea214;})});}_0x4c97e4=_[_0x7a13('0x43')]({},_0x4c97e4,_0x1c16e8[_0x7a13('0x4b')]);return db[_0x7a13('0xac')][_0x7a13('0x22')]({'where':_0x4c97e4[_0x7a13('0x40')]})[_0x7a13('0x26')](function(_0x7dbc9e){_0x7f709f['count']=_0x7dbc9e;if(_0x1c16e8[_0x7a13('0x35')][_0x7a13('0x44')]){_0x4c97e4[_0x7a13('0x45')]=[{'model':db['CmContact'],'as':_0x7a13('0xe6'),'required':![]},{'model':db[_0x7a13('0xe7')],'as':_0x7a13('0xe8'),'attributes':[_0x7a13('0x2b'),_0x7a13('0xe9'),_0x7a13('0xea')],'required':![]},{'model':db[_0x7a13('0xeb')],'as':_0x7a13('0xec'),'attributes':['id',_0x7a13('0x2b'),_0x7a13('0xed')],'where':_0x1c16e8[_0x7a13('0x35')][_0x7a13('0xee')]?{'id':_0x1c16e8[_0x7a13('0x35')][_0x7a13('0xee')]}:undefined,'required':_0x1c16e8[_0x7a13('0x35')][_0x7a13('0xee')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x4c97e4);})['then'](function(_0x41431d){_0x7f709f['rows']=_0x41431d;return _0x7f709f;});}})[_0x7a13('0x26')](respondWithFilteredResult(_0x218353,_0x4c97e4))['catch'](handleError(_0x218353,null));};function iftimePromise(_0x3bc3dd,_0x16a4ab){return respondWithRpcPromise(_0x7a13('0xef'),_0x7a13('0xf0'),{'command':_0x16a4ab[_0x7a13('0xf1')]?util[_0x7a13('0xa5')](_0x7a13('0xf2'),_0x3bc3dd[_0x7a13('0xf3')],_0x16a4ab[_0x7a13('0xf1')]):util['format']('iftime\x20%s',_0x3bc3dd['interval'])},client9002)[_0x7a13('0x26')](function(_0x337ddf){var _0x1919fa=_0x337ddf&&_0x337ddf[_0x7a13('0xf4')](_0x7a13('0xf5'))>=0x0?!![]:![];logger[_0x7a13('0x13')](_0x7a13('0xf6'),_0x16a4ab['id'],_0x3bc3dd['id'],_0x3bc3dd[_0x7a13('0xf3')],_0x1919fa?_0x7a13('0xf7'):_0x7a13('0xf8'),_0x16a4ab[_0x7a13('0xf1')]?_0x16a4ab[_0x7a13('0xf1')]:_0x7a13('0xf9'));return _0x1919fa;})[_0x7a13('0x48')](function(_0x4dc9ae){logger['error'](_0x7a13('0xf6'),_0x16a4ab['id'],_0x3bc3dd['id'],_0x3bc3dd[_0x7a13('0xf3')],util[_0x7a13('0xfa')](_0x4dc9ae,{'showHidden':![],'depth':null}),_0x16a4ab[_0x7a13('0xf1')]?_0x16a4ab['timezone']:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x1757ce,_0x1a7102){var _0x3128a2=0x0;var _0x1ba247=0x0;var _0x594508=![];var _0x55f0fd;var _0x4e02dc;return db['ChatWebsite']['find']({'where':{'id':_0x1757ce['params']['id']},'include':[{'model':db[_0x7a13('0xfb')],'as':'Interval','include':[{'model':db[_0x7a13('0xfb')],'as':_0x7a13('0xfc'),'attributes':['id',_0x7a13('0xf3')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1a7102,null))['then'](function(_0x381bd0){if(_0x381bd0){_0x55f0fd=_0x381bd0;return _0x381bd0[_0x7a13('0xfd')]({'raw':!![]});}})[_0x7a13('0x26')](function(_0x645ace){if(_0x55f0fd){if(_0x645ace){_0x4e02dc=_0x645ace;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0xa47633){if(_0xa47633){_0x1ba247=_0xa47633[_0x7a13('0xfe')];_0x594508=_0xa47633[_0x7a13('0x6f')];}})[_0x7a13('0x26')](function(){return db[_0x7a13('0xac')]['count']({'where':{'closed':![]}});})[_0x7a13('0x26')](function(_0x241462){_0x3128a2=_0x241462;if(_0x1ba247&&_0x241462>_0x1ba247){return db[_0x7a13('0xff')]['findOne']({'where':{'id':0x1}})[_0x7a13('0x26')](function(_0x5555b3){if(_0x5555b3){_0x5555b3['increment'](_0x7a13('0x100'));}});}})[_0x7a13('0x26')](function(){if(_0x55f0fd['Interval']&&_0x55f0fd[_0x7a13('0xfb')][_0x7a13('0xfc')]){var _0x9e904d=[];for(var _0x186de5=0x0;_0x186de5<_0x55f0fd[_0x7a13('0xfb')][_0x7a13('0xfc')][_0x7a13('0x3b')];_0x186de5++){var _0x5e099e=_0x55f0fd['Interval'][_0x7a13('0xfc')][_0x186de5][_0x7a13('0x27')]({'plain':!![]});_0x9e904d[_0x7a13('0x101')](iftimePromise(_0x5e099e,_0x55f0fd));}return BPromise[_0x7a13('0x102')](_0x9e904d)[_0x7a13('0x26')](function(_0x4b90d6){return _[_0x7a13('0x103')](_0x4b90d6);});}else{return!![];}})[_0x7a13('0x26')](function(_0x413f4e){var _0x502039=fs[_0x7a13('0xc5')](path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x104')),_0x7a13('0xc7'));var _0x5d7ec5={'remote':_0x55f0fd['remote'],'query':querystring['stringify'](_[_0x7a13('0x43')](_0x55f0fd['get']({'plain':!![]}),{'customerIp':_0x1757ce[_0x7a13('0x7d')][_0x7a13('0x9c')]||_0x1757ce[_0x7a13('0x7d')][_0x7a13('0x105')]||_0x1757ce[_0x7a13('0x106')][_0x7a13('0x107')]||_0x1757ce['ip'],'referer':_0x1757ce[_0x7a13('0x7d')][_0x7a13('0xa2')],'openedInteractions':_0x3128a2,'maxInteractions':_0x1ba247,'virtual':_0x594508[_0x7a13('0xfe')],'online':_0x413f4e,'custom':_0x594508}))['replace'](/'/g,'\x5c\x27')};_0x1a7102['send'](ejs[_0x7a13('0x108')](Mustache[_0x7a13('0x108')](_0x502039,_0x5d7ec5),{'proactiveActions':_0x4e02dc,'alignment':_0x55f0fd[_0x7a13('0x109')],'verticalAlignment':_0x55f0fd[_0x7a13('0x10a')],'div_color':_0x55f0fd[_0x7a13('0xed')],'labelText':_0x55f0fd[_0x7a13('0x10b')],'text_color':_0x55f0fd['textColor'],'text_button_color':_0x55f0fd[_0x7a13('0x10c')],'button_color':_0x55f0fd[_0x7a13('0x10d')],'background_color':_0x55f0fd['backgroundColor'],'hideWhenOffline':_0x55f0fd['hideWhenOffline'],'interval':_0x55f0fd['IntervalId']}));})[_0x7a13('0x48')](handleError(_0x1a7102,null));};exports['addApplications']=function(_0x1266d5,_0x57f9bd){var _0x521d5d=_0x1266d5[_0x7a13('0x4a')]['id'];var _0xa5cc8b=_0x1266d5[_0x7a13('0x54')];var _0x54987f=0xc8;var _0x287e87=null;return db[_0x7a13('0xd0')][_0x7a13('0x10e')]({'isolationLevel':db[_0x7a13('0xd0')][_0x7a13('0x10f')][_0x7a13('0x110')][_0x7a13('0x111')]},function(_0x1351ed){return db[_0x7a13('0x31')][_0x7a13('0x5a')]({'where':{'id':_0x521d5d},'transaction':_0x1351ed})[_0x7a13('0x26')](function(_0x3858bb){if(_0x3858bb){return db[_0x7a13('0x91')][_0x7a13('0x112')]({'where':{'ChatWebsiteId':_0x521d5d},'transaction':_0x1351ed})[_0x7a13('0x26')](function(){var _0x58a116=_[_0x7a13('0x30')](_0xa5cc8b,function(_0x36a6e3){_0x36a6e3[_0x7a13('0x57')]=_0x521d5d;return _0x36a6e3;});return db[_0x7a13('0x91')][_0x7a13('0xd2')](_0x58a116,{'transaction':_0x1351ed});});}else{_0x54987f=0x194;_0x287e87=[];}});})[_0x7a13('0x26')](function(){if(_0x54987f!==0x194){return db[_0x7a13('0x91')][_0x7a13('0x113')]({'where':{'ChatWebsiteId':_0x521d5d},'order':'priority'})[_0x7a13('0x26')](function(_0x1e2e5e){_0x287e87=_0x1e2e5e;});}})['catch'](function(_0x8fc0ef){_0x54987f=0x1f4;logger['error'](_0x8fc0ef['stack']);if(_0x8fc0ef[_0x7a13('0x2b')]){delete _0x8fc0ef['name'];}_0x287e87=_0x8fc0ef;})[_0x7a13('0x114')](function(){if(_0x287e87===null){_0x57f9bd[_0x7a13('0x1b')](_0x54987f);}else{if(_0x54987f===0x1f4){_0x57f9bd['status'](_0x54987f)[_0x7a13('0x2c')](_0x287e87);}else{_0x57f9bd[_0x7a13('0x1c')](_0x54987f)[_0x7a13('0x1e')](_0x287e87);}}});};exports['getApplications']=function(_0x2fdb38,_0x48fef6){var _0x50fdba={};var _0x15da70={};var _0x6a5e5a;var _0x467316;return db['ChatWebsite'][_0x7a13('0x5a')]({'where':{'id':_0x2fdb38[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x48fef6,null))[_0x7a13('0x26')](function(_0x37dca5){if(_0x37dca5){_0x6a5e5a=_0x37dca5;_0x15da70[_0x7a13('0x34')]=_['keys'](db[_0x7a13('0x91')][_0x7a13('0x5b')]);_0x15da70[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x2fdb38[_0x7a13('0x35')]);_0x15da70[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x15da70[_0x7a13('0x34')],_0x15da70[_0x7a13('0x35')]);_0x50fdba[_0x7a13('0x39')]=_['intersection'](_0x15da70[_0x7a13('0x34')],qs[_0x7a13('0x3a')](_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x50fdba[_0x7a13('0x39')]=_0x50fdba[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x50fdba[_0x7a13('0x39')]:_0x15da70[_0x7a13('0x34')];_0x50fdba['order']=qs['sort'](_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x50fdba['where']=qs['filters'](_[_0x7a13('0x5c')](_0x2fdb38[_0x7a13('0x35')],_0x15da70[_0x7a13('0x37')]));if(_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x41')]){_0x50fdba[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x50fdba[_0x7a13('0x40')],{'$or':_['map'](_0x50fdba[_0x7a13('0x39')],function(_0x49deee){var _0x1fd448={};_0x1fd448[_0x49deee]={'$like':'%'+_0x2fdb38[_0x7a13('0x35')]['filter']+'%'};return _0x1fd448;})});}_0x50fdba=_[_0x7a13('0x43')]({},_0x50fdba,_0x2fdb38[_0x7a13('0x4b')]);return _0x6a5e5a[_0x7a13('0x115')](_0x50fdba);}})[_0x7a13('0x26')](function(_0x5b1e83){if(_0x5b1e83){_0x467316=_0x5b1e83[_0x7a13('0x3b')];if(!_0x2fdb38[_0x7a13('0x35')]['hasOwnProperty']('nolimit')){_0x50fdba[_0x7a13('0x21')]=qs['limit'](_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x21')]);_0x50fdba[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x1f')]);}return _0x6a5e5a[_0x7a13('0x115')](_0x50fdba);}})[_0x7a13('0x26')](function(_0x100565){if(_0x100565){return _0x100565?{'count':_0x467316,'rows':_0x100565}:null;}})[_0x7a13('0x26')](respondWithResult(_0x48fef6,null))[_0x7a13('0x48')](handleError(_0x48fef6,null));};exports[_0x7a13('0x116')]=function(_0x554d53,_0x136487){return db[_0x7a13('0x117')]['find']({'where':{'id':_0x554d53['params']['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x136487,null))['then'](function(_0x3d038b){if(_0x3d038b){return _0x3d038b['addProactiveActions'](_0x554d53['body'][_0x7a13('0x5e')],_[_0x7a13('0x118')](_0x554d53[_0x7a13('0x54')],['ids','id'])||{});}})[_0x7a13('0x26')](respondWithResult(_0x136487,null))[_0x7a13('0x48')](handleError(_0x136487,null));};exports[_0x7a13('0xfd')]=function(_0x514515,_0x3aeec0){var _0x1cba42={};var _0x3ce9e4={};var _0x2eea70;var _0x3a8877;return db[_0x7a13('0x31')][_0x7a13('0x5a')]({'where':{'id':_0x514515[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x3aeec0,null))['then'](function(_0x3105ae){if(_0x3105ae){_0x2eea70=_0x3105ae;_0x3ce9e4[_0x7a13('0x34')]=_[_0x7a13('0x36')](db[_0x7a13('0x119')]['rawAttributes']);_0x3ce9e4[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x514515[_0x7a13('0x35')]);_0x3ce9e4[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x3ce9e4[_0x7a13('0x34')],_0x3ce9e4[_0x7a13('0x35')]);_0x1cba42[_0x7a13('0x39')]=_[_0x7a13('0x38')](_0x3ce9e4['model'],qs[_0x7a13('0x3a')](_0x514515[_0x7a13('0x35')]['fields']));_0x1cba42[_0x7a13('0x39')]=_0x1cba42[_0x7a13('0x39')]['length']?_0x1cba42[_0x7a13('0x39')]:_0x3ce9e4[_0x7a13('0x34')];_0x1cba42[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x514515[_0x7a13('0x35')]['sort']);_0x1cba42['where']=qs[_0x7a13('0x37')](_['pick'](_0x514515[_0x7a13('0x35')],_0x3ce9e4['filters']));if(_0x514515[_0x7a13('0x35')][_0x7a13('0x41')]){_0x1cba42[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x1cba42[_0x7a13('0x40')],{'$or':_['map'](_0x1cba42[_0x7a13('0x39')],function(_0x5aa316){var _0x14f8ac={};_0x14f8ac[_0x5aa316]={'$like':'%'+_0x514515[_0x7a13('0x35')]['filter']+'%'};return _0x14f8ac;})});}_0x1cba42=_['merge']({},_0x1cba42,_0x514515[_0x7a13('0x4b')]);return _0x2eea70[_0x7a13('0xfd')](_0x1cba42);}})[_0x7a13('0x26')](function(_0x88be03){if(_0x88be03){_0x3a8877=_0x88be03['length'];if(!_0x514515[_0x7a13('0x35')]['hasOwnProperty'](_0x7a13('0x3d'))){_0x1cba42[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x514515[_0x7a13('0x35')][_0x7a13('0x21')]);_0x1cba42[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x514515[_0x7a13('0x35')][_0x7a13('0x1f')]);}return _0x2eea70[_0x7a13('0xfd')](_0x1cba42);}})[_0x7a13('0x26')](function(_0x42345d){if(_0x42345d){return _0x42345d?{'count':_0x3a8877,'rows':_0x42345d}:null;}})['then'](respondWithResult(_0x3aeec0,null))['catch'](handleError(_0x3aeec0,null));};exports[_0x7a13('0x11a')]=function(_0x31d24e,_0x25b4fd){var _0x35353a=_0x31d24e[_0x7a13('0x35')][_0x7a13('0x11b')]===_0x7a13('0x11c')?'offlineForm':_0x7a13('0x11d');return db['ChatWebsite'][_0x7a13('0x50')]({'attributes':['id',_0x35353a],'where':{'id':_0x31d24e[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x25b4fd,null))[_0x7a13('0x26')](function(_0xd2dff8){if(_0xd2dff8){var _0x2f7274=_0xd2dff8[_0x35353a];var _0x1fe942=_0x2f7274&&_0x2f7274['items']?_0x2f7274['items']:[];_0x25b4fd['send']({'fromKey':_[_0x7a13('0x70')](_0x2f7274[_0x7a13('0x11e')])?undefined:_0x2f7274[_0x7a13('0x11e')],'count':_0x1fe942['length'],'rows':_0x1fe942});}})['catch'](handleError(_0x25b4fd,null));};exports['getOfflineMessages']=function(_0x3e7d5c,_0x3dfb5d){var _0x590257={'raw':![],'where':{}};var _0x38cbcb={};var _0x5e3203={'count':0x0,'rows':[]};return db[_0x7a13('0x31')][_0x7a13('0x5a')]({'where':{'id':_0x3e7d5c[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x3dfb5d,null))[_0x7a13('0x26')](function(_0x1a287e){if(_0x1a287e){_0x38cbcb['model']=_['keys'](db['ChatOfflineMessage'][_0x7a13('0x5b')]);_0x38cbcb[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x3e7d5c[_0x7a13('0x35')]);_0x38cbcb['filters']=_[_0x7a13('0x38')](_0x38cbcb[_0x7a13('0x34')],_0x38cbcb[_0x7a13('0x35')]);_0x590257[_0x7a13('0x39')]=_[_0x7a13('0x38')](_0x38cbcb[_0x7a13('0x34')],qs[_0x7a13('0x3a')](_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x590257[_0x7a13('0x39')]=_0x590257['attributes'][_0x7a13('0x3b')]?_0x590257['attributes']:_0x38cbcb[_0x7a13('0x34')];if(!_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x590257[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x3e7d5c['query'][_0x7a13('0x21')]);_0x590257['offset']=qs['offset'](_0x3e7d5c[_0x7a13('0x35')]['offset']);}_0x590257[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x590257['where']=qs[_0x7a13('0x37')](_[_0x7a13('0x5c')](_0x3e7d5c[_0x7a13('0x35')],_0x38cbcb['filters']));_0x590257[_0x7a13('0x40')][_0x7a13('0x57')]=_0x1a287e['id'];if(_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x41')]){_0x590257[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x590257[_0x7a13('0x40')],{'$or':_['map'](_0x590257[_0x7a13('0x39')],function(_0x39dd70){var _0x1668e8={};_0x1668e8[_0x39dd70]={'$like':'%'+_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x41')]+'%'};return _0x1668e8;})});}_0x590257=_[_0x7a13('0x43')]({},_0x590257,_0x3e7d5c[_0x7a13('0x4b')]);return db[_0x7a13('0x11f')]['count']({'where':_0x590257[_0x7a13('0x40')]})[_0x7a13('0x26')](function(_0x5e2df9){_0x5e3203[_0x7a13('0x22')]=_0x5e2df9;if(_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x44')]){_0x590257[_0x7a13('0x45')]=[{'all':!![]}];}else{_0x590257[_0x7a13('0x45')]=[{'model':db['CmContact'],'as':_0x7a13('0xe6'),'required':![]},{'model':db[_0x7a13('0xd1')],'as':_0x7a13('0x120'),'required':![]}];}return db[_0x7a13('0x11f')]['findAll'](_0x590257);})[_0x7a13('0x26')](function(_0x3c6f90){_0x5e3203[_0x7a13('0x47')]=_0x3c6f90;return _0x5e3203;});}})[_0x7a13('0x26')](respondWithFilteredResult(_0x3dfb5d,_0x590257))[_0x7a13('0x48')](handleError(_0x3dfb5d,null));};exports[_0x7a13('0x121')]=function(_0x370b67,_0x1c4616){return db[_0x7a13('0x31')]['find']({'where':{'id':_0x370b67['params']['id']}})['then'](handleEntityNotFound(_0x1c4616,null))[_0x7a13('0x26')](function(_0x560ce8){if(_0x560ce8){return _0x560ce8['addAgents'](_0x370b67[_0x7a13('0x54')]['ids'],_[_0x7a13('0x118')](_0x370b67['body'],[_0x7a13('0x5e'),'id'])||{})[_0x7a13('0xaf')](function(_0x3f5bd5){for(var _0x10627d=0x0;_0x10627d<_0x370b67[_0x7a13('0x54')][_0x7a13('0x5e')][_0x7a13('0x3b')];_0x10627d+=0x1){socket['emit'](_0x7a13('0x122'),{'UserId':Number(_0x370b67[_0x7a13('0x54')][_0x7a13('0x5e')][_0x10627d]),'ChatWebsiteId':Number(_0x370b67['params']['id'])});}return _0x3f5bd5;});}})[_0x7a13('0x26')](respondWithResult(_0x1c4616,null))[_0x7a13('0x48')](handleError(_0x1c4616,null));};exports[_0x7a13('0x123')]=function(_0x1bf363,_0x31df00){return db[_0x7a13('0x31')]['find']({'where':{'id':_0x1bf363[_0x7a13('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31df00,null))[_0x7a13('0x26')](function(_0x2b07e0){if(_0x2b07e0){return _0x2b07e0[_0x7a13('0x123')](_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')])['then'](function(){if(_['isArray'](_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')])){for(var _0x260384=0x0;_0x260384<_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')][_0x7a13('0x3b')];_0x260384+=0x1){socket[_0x7a13('0x124')]('userChatWebsite:remove',{'UserId':Number(_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')][_0x260384]),'ChatWebsiteId':Number(_0x1bf363[_0x7a13('0x4a')]['id'])});}}else{socket[_0x7a13('0x124')](_0x7a13('0x125'),{'UserId':Number(_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')]),'ChatWebsiteId':Number(_0x1bf363[_0x7a13('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x31df00,null))['catch'](handleError(_0x31df00,null));};exports[_0x7a13('0x126')]=function(_0x36e8b2,_0x20d640){var _0x8182b6={};var _0x54b127={};var _0x553206;var _0x350170;return db[_0x7a13('0x31')]['findOne']({'where':{'id':_0x36e8b2['params']['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x20d640,null))['then'](function(_0x4ee4de){if(_0x4ee4de){_0x553206=_0x4ee4de;_0x54b127['model']=_[_0x7a13('0x36')](db[_0x7a13('0xe7')]['rawAttributes']);_0x54b127[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x36e8b2[_0x7a13('0x35')]);_0x54b127['filters']=_[_0x7a13('0x38')](_0x54b127[_0x7a13('0x34')],_0x54b127['query']);_0x8182b6[_0x7a13('0x39')]=_['intersection'](_0x54b127[_0x7a13('0x34')],qs[_0x7a13('0x3a')](_0x36e8b2['query']['fields']));_0x8182b6[_0x7a13('0x39')]=_0x8182b6[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x8182b6['attributes']:_0x54b127[_0x7a13('0x34')];_0x8182b6[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x36e8b2[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x8182b6[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_[_0x7a13('0x5c')](_0x36e8b2[_0x7a13('0x35')],_0x54b127[_0x7a13('0x37')]));if(_0x36e8b2['query'][_0x7a13('0x41')]){_0x8182b6[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x8182b6[_0x7a13('0x40')],{'$or':_[_0x7a13('0x30')](_0x8182b6[_0x7a13('0x39')],function(_0x359461){var _0x5d68a3={};_0x5d68a3[_0x359461]={'$like':'%'+_0x36e8b2[_0x7a13('0x35')]['filter']+'%'};return _0x5d68a3;})});}_0x8182b6=_[_0x7a13('0x43')]({},_0x8182b6,_0x36e8b2['options']);return _0x553206['getAgents'](_0x8182b6);}})[_0x7a13('0x26')](function(_0x667284){if(_0x667284){_0x350170=_0x667284['length'];if(!_0x36e8b2[_0x7a13('0x35')]['hasOwnProperty'](_0x7a13('0x3d'))){_0x8182b6[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x36e8b2[_0x7a13('0x35')][_0x7a13('0x21')]);_0x8182b6[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x36e8b2[_0x7a13('0x35')]['offset']);}return _0x553206[_0x7a13('0x126')](_0x8182b6);}})['then'](function(_0x299123){if(_0x299123){return _0x299123?{'count':_0x350170,'rows':_0x299123}:null;}})['then'](respondWithResult(_0x20d640,null))[_0x7a13('0x48')](handleError(_0x20d640,null));};
\ No newline at end of file
+var _0x591c=['agent','startRouting','EventManager','notify','offline','ListId','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','files','attachments','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','NotifyMailAccount','notifyMail','offline-chat','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','custom','License','increment','all','some','x-real-ip','connection','remoteAddress','referer','replace','render','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','path','lodash','querystring','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','end','json','offset','limit','undefined','count','status','set','Content-Range','update','get','ChatWebsites','destroy','sendStatus','stack','name','send','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatWebsite','includeAll','include','findAll','rows','show','mandatoryDispositionPause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','Pause','params','describe','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','getAnswers','map','CannedAnswer','removeAnswers','ids','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','getLicense','isNil','sitepic','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','asc','Contacts','CmContact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0x591c,0x1a1));var _0xc591=function(_0x27ff1a,_0x596dc2){_0x27ff1a=_0x27ff1a-0x0;var _0xa7f1d7=_0x591c[_0x27ff1a];return _0xa7f1d7;};'use strict';var BPromise=require(_0xc591('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc591('0x1'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc591('0x2'));var querystring=require(_0xc591('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc591('0x4'))(_0xc591('0x5'));var config=require(_0xc591('0x6'));var db=require(_0xc591('0x7'))['db'];config['redis']=_[_0xc591('0x8')](config[_0xc591('0x9')],{'host':_0xc591('0xa'),'port':0x18eb});var socket=require(_0xc591('0xb'))(new Redis(config[_0xc591('0x9')]));require(_0xc591('0xc'))[_0xc591('0xd')](socket);var htmlToText=require(_0xc591('0xe'));var jayson=require(_0xc591('0xf'));var client=jayson['client'][_0xc591('0x10')]({'port':0x232c});var client9002=jayson[_0xc591('0x11')][_0xc591('0x10')]({'port':0x232a});var client9003=jayson['client'][_0xc591('0x10')]({'port':0x232b});var client9001=jayson['client'][_0xc591('0x10')]({'port':0x2329});function respondWithRpcPromise(_0xcb9b99,_0x56a472,_0x417148,_0x517167){return new BPromise(function(_0x4925b0,_0x1732f9){var _0x566130=_0x517167||client;return _0x566130[_0xc591('0x12')](_0xcb9b99,_0x417148)[_0xc591('0x13')](function(_0x5d8c6c){logger['info'](_0xc591('0x14'),_0x56a472,_0xc591('0x15'));logger[_0xc591('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x56a472,_0xc591('0x15'),JSON[_0xc591('0x17')](_0x5d8c6c));if(_0x5d8c6c[_0xc591('0x18')]){if(_0x5d8c6c[_0xc591('0x18')][_0xc591('0x19')]===0x1f4){logger[_0xc591('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x56a472,_0x5d8c6c[_0xc591('0x18')][_0xc591('0x1a')]);return _0x1732f9(_0x5d8c6c[_0xc591('0x18')][_0xc591('0x1a')]);}logger[_0xc591('0x18')](_0xc591('0x14'),_0x56a472,_0x5d8c6c['error']['message']);return _0x4925b0(_0x5d8c6c[_0xc591('0x18')][_0xc591('0x1a')]);}else{logger[_0xc591('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x56a472,'request\x20sent');_0x4925b0(_0x5d8c6c[_0xc591('0x1c')]['message']);}})[_0xc591('0x1d')](function(_0x11d3b8){logger[_0xc591('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x56a472,_0x11d3b8);_0x1732f9(_0x11d3b8);});});}function respondWithStatusCode(_0x3310c2,_0x1330c6){_0x1330c6=_0x1330c6||0xcc;return function(_0x5580b4){if(_0x5580b4){return _0x3310c2['sendStatus'](_0x1330c6);}return _0x3310c2['status'](_0x1330c6)[_0xc591('0x1e')]();};}function respondWithResult(_0x460ff6,_0x3fdb3a){_0x3fdb3a=_0x3fdb3a||0xc8;return function(_0x149929){if(_0x149929){return _0x460ff6['status'](_0x3fdb3a)[_0xc591('0x1f')](_0x149929);}};}function respondWithFilteredResult(_0x13d07b,_0x5460fb){return function(_0x3d0674){if(_0x3d0674){var _0xae787=typeof _0x5460fb[_0xc591('0x20')]==='undefined'&&typeof _0x5460fb[_0xc591('0x21')]===_0xc591('0x22');var _0x32051e=_0x3d0674[_0xc591('0x23')];var _0x511131=_0xae787?0x0:_0x5460fb['offset'];var _0x6ba746=_0xae787?_0x3d0674[_0xc591('0x23')]:_0x5460fb['offset']+_0x5460fb[_0xc591('0x21')];var _0x4ae2c4;if(_0x6ba746>=_0x32051e){_0x6ba746=_0x32051e;_0x4ae2c4=0xc8;}else{_0x4ae2c4=0xce;}_0x13d07b[_0xc591('0x24')](_0x4ae2c4);return _0x13d07b[_0xc591('0x25')](_0xc591('0x26'),_0x511131+'-'+_0x6ba746+'/'+_0x32051e)[_0xc591('0x1f')](_0x3d0674);}return null;};}function saveUpdates(_0x3370fc){return function(_0x2f2108){if(_0x2f2108){return _0x2f2108[_0xc591('0x27')](_0x3370fc)['then'](function(_0x4626ed){return _0x4626ed;});}return null;};}function removeEntity(_0x3e64d3){return function(_0x37f967){if(_0x37f967){return _0x37f967['destroy']()[_0xc591('0x13')](function(){var _0x60a65d=_0x37f967[_0xc591('0x28')]({'plain':!![]});var _0x48396a=_0xc591('0x29');return db['UserProfileResource'][_0xc591('0x2a')]({'where':{'type':_0x48396a,'resourceId':_0x60a65d['id']}})[_0xc591('0x13')](function(){return _0x37f967;});})[_0xc591('0x13')](function(){_0x3e64d3[_0xc591('0x24')](0xcc)[_0xc591('0x1e')]();});}};}function handleEntityNotFound(_0x90f3a9){return function(_0x5876ca){if(!_0x5876ca){_0x90f3a9[_0xc591('0x2b')](0x194);}return _0x5876ca;};}function handleError(_0x5ad618,_0x14e7af){_0x14e7af=_0x14e7af||0x1f4;return function(_0x2cdc03){logger[_0xc591('0x18')](_0x2cdc03[_0xc591('0x2c')]);if(_0x2cdc03['name']){delete _0x2cdc03[_0xc591('0x2d')];}_0x5ad618['status'](_0x14e7af)[_0xc591('0x2e')](_0x2cdc03);};}exports['index']=function(_0x5d186c,_0xac07f5){var _0x8b2cc8={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x48782f={},_0x45eba8={'count':0x0,'rows':[]};var _0x8d831f=_['map'](db['ChatWebsite'][_0xc591('0x2f')],function(_0xdb2c5){return{'name':_0xdb2c5[_0xc591('0x30')],'type':_0xdb2c5[_0xc591('0x31')]['key']};});_0x48782f['model']=_['map'](_0x8d831f,_0xc591('0x2d'));_0x48782f[_0xc591('0x32')]=_[_0xc591('0x33')](_0x5d186c[_0xc591('0x32')]);_0x48782f[_0xc591('0x34')]=_[_0xc591('0x35')](_0x48782f[_0xc591('0x36')],_0x48782f[_0xc591('0x32')]);_0x8b2cc8['attributes']=_[_0xc591('0x35')](_0x48782f[_0xc591('0x36')],qs[_0xc591('0x37')](_0x5d186c[_0xc591('0x32')]['fields']));_0x8b2cc8[_0xc591('0x38')]=_0x8b2cc8['attributes'][_0xc591('0x39')]?_0x8b2cc8[_0xc591('0x38')]:_0x48782f[_0xc591('0x36')];if(!_0x5d186c[_0xc591('0x32')][_0xc591('0x3a')](_0xc591('0x3b'))){_0x8b2cc8[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x5d186c[_0xc591('0x32')][_0xc591('0x21')]);_0x8b2cc8['offset']=qs[_0xc591('0x20')](_0x5d186c[_0xc591('0x32')][_0xc591('0x20')]);}_0x8b2cc8[_0xc591('0x3c')]=qs['sort'](_0x5d186c[_0xc591('0x32')][_0xc591('0x3d')]);_0x8b2cc8[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x5d186c[_0xc591('0x32')],_0x48782f[_0xc591('0x34')]),_0x8d831f);if(_0x5d186c[_0xc591('0x32')]['filter']){_0x8b2cc8[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x8b2cc8['where'],{'$or':_['map'](_0x8d831f,function(_0x20fc86){if(_0x20fc86[_0xc591('0x31')]!==_0xc591('0x41')){var _0x31e028={};_0x31e028[_0x20fc86[_0xc591('0x2d')]]={'$like':'%'+_0x5d186c[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x31e028;}})});}_0x8b2cc8=_['merge']({},_0x8b2cc8,_0x5d186c[_0xc591('0x43')]);var _0x1ee7cc={'where':_0x8b2cc8[_0xc591('0x3e')]};return db[_0xc591('0x44')][_0xc591('0x23')](_0x1ee7cc)[_0xc591('0x13')](function(_0x498113){_0x45eba8[_0xc591('0x23')]=_0x498113;if(_0x5d186c['query'][_0xc591('0x45')]){_0x8b2cc8[_0xc591('0x46')]=[{'all':!![]}];}return db[_0xc591('0x44')][_0xc591('0x47')](_0x8b2cc8);})[_0xc591('0x13')](function(_0x694f7){_0x45eba8[_0xc591('0x48')]=_0x694f7;return _0x45eba8;})[_0xc591('0x13')](respondWithFilteredResult(_0xac07f5,_0x8b2cc8))[_0xc591('0x1d')](handleError(_0xac07f5,null));};exports[_0xc591('0x49')]=function(_0x4b9071,_0x3ea631){var _0x39bbd3={'raw':![],'where':{'id':_0x4b9071['params']['id']},'include':[{'model':db['Pause'],'as':_0xc591('0x4a')}]},_0x410b5e={};_0x410b5e[_0xc591('0x36')]=_[_0xc591('0x33')](db[_0xc591('0x44')][_0xc591('0x2f')]);_0x410b5e['query']=_[_0xc591('0x33')](_0x4b9071[_0xc591('0x32')]);_0x410b5e[_0xc591('0x34')]=_[_0xc591('0x35')](_0x410b5e[_0xc591('0x36')],_0x410b5e[_0xc591('0x32')]);_0x39bbd3['attributes']=_[_0xc591('0x35')](_0x410b5e[_0xc591('0x36')],qs['fields'](_0x4b9071[_0xc591('0x32')][_0xc591('0x37')]));_0x39bbd3['attributes']=_0x39bbd3[_0xc591('0x38')][_0xc591('0x39')]?_0x39bbd3['attributes']:_0x410b5e[_0xc591('0x36')];if(_0x4b9071['query'][_0xc591('0x45')]){_0x39bbd3[_0xc591('0x46')]=[{'all':!![]}];}_0x39bbd3=_[_0xc591('0x40')]({},_0x39bbd3,_0x4b9071[_0xc591('0x43')]);return db[_0xc591('0x44')]['find'](_0x39bbd3)['then'](handleEntityNotFound(_0x3ea631,null))[_0xc591('0x13')](respondWithResult(_0x3ea631,null))['catch'](handleError(_0x3ea631,null));};exports[_0xc591('0x4b')]=function(_0x1ae8fe,_0x4a349f){return db['ChatWebsite']['create'](_0x1ae8fe[_0xc591('0x4c')],{})[_0xc591('0x13')](function(_0x3a11a4){var _0x543716=_0x1ae8fe[_0xc591('0x4d')][_0xc591('0x28')]({'plain':!![]});if(!_0x543716)throw new Error(_0xc591('0x4e'));if(_0x543716[_0xc591('0x4f')]===_0xc591('0x4d')){var _0x2d3431=_0x3a11a4['get']({'plain':!![]});var _0x1d0b73='ChatWebsites';return db[_0xc591('0x50')]['find']({'where':{'name':_0x1d0b73,'userProfileId':_0x543716[_0xc591('0x51')]},'raw':!![]})[_0xc591('0x13')](function(_0xe38d5){if(_0xe38d5&&_0xe38d5[_0xc591('0x52')]===0x0){return db[_0xc591('0x53')]['create']({'name':_0x2d3431[_0xc591('0x2d')],'resourceId':_0x2d3431['id'],'type':_0xe38d5[_0xc591('0x2d')],'sectionId':_0xe38d5['id']},{})[_0xc591('0x13')](function(){return _0x3a11a4;});}else{return _0x3a11a4;}})[_0xc591('0x1d')](function(_0x5f2227){logger[_0xc591('0x18')](_0xc591('0x54'),_0x5f2227);throw _0x5f2227;});}return _0x3a11a4;})[_0xc591('0x13')](respondWithResult(_0x4a349f,0xc9))[_0xc591('0x1d')](handleError(_0x4a349f,null));};exports['update']=function(_0x1ee6ee,_0x2da3ae){if(_0x1ee6ee[_0xc591('0x4c')]['id']){delete _0x1ee6ee[_0xc591('0x4c')]['id'];}return db['ChatWebsite'][_0xc591('0x55')]({'where':{'id':_0x1ee6ee['params']['id']},'include':[{'model':db[_0xc591('0x56')],'as':'mandatoryDispositionPause'}]})[_0xc591('0x13')](handleEntityNotFound(_0x2da3ae,null))[_0xc591('0x13')](saveUpdates(_0x1ee6ee['body'],null))[_0xc591('0x13')](respondWithResult(_0x2da3ae,null))['catch'](handleError(_0x2da3ae,null));};exports[_0xc591('0x2a')]=function(_0x376180,_0x390272){return db['ChatWebsite'][_0xc591('0x55')]({'where':{'id':_0x376180[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x390272,null))[_0xc591('0x13')](removeEntity(_0x390272,null))[_0xc591('0x1d')](handleError(_0x390272,null));};exports['describe']=function(_0x337862,_0x41b471){return db[_0xc591('0x44')][_0xc591('0x58')]()['then'](respondWithResult(_0x41b471,null))[_0xc591('0x1d')](handleError(_0x41b471,null));};exports['addDisposition']=function(_0xfbc3f4,_0x3347f7){if(_0xfbc3f4[_0xc591('0x4c')]['id']){delete _0xfbc3f4[_0xc591('0x4c')]['id'];}return db[_0xc591('0x44')]['find']({'where':{'id':_0xfbc3f4[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x3347f7,null))[_0xc591('0x13')](function(_0x4db306){if(_0x4db306){_0xfbc3f4[_0xc591('0x4c')][_0xc591('0x59')]=_0x4db306['id'];return db['Disposition'][_0xc591('0x4b')](_0xfbc3f4[_0xc591('0x4c')]);}})[_0xc591('0x13')](respondWithResult(_0x3347f7,null))[_0xc591('0x1d')](handleError(_0x3347f7,null));};exports[_0xc591('0x5a')]=function(_0x364d50,_0x6251b){var _0x9e6443={'raw':![],'where':{}};var _0x291dfe={};var _0x57efa0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc591('0x5b')]({'where':{'id':_0x364d50[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x6251b,null))['then'](function(_0x4226b7){if(_0x4226b7){_0x291dfe[_0xc591('0x36')]=_['keys'](db['Disposition'][_0xc591('0x2f')]);_0x291dfe[_0xc591('0x32')]=_[_0xc591('0x33')](_0x364d50['query']);_0x291dfe['filters']=_[_0xc591('0x35')](_0x291dfe[_0xc591('0x36')],_0x291dfe[_0xc591('0x32')]);_0x9e6443[_0xc591('0x38')]=_[_0xc591('0x35')](_0x291dfe[_0xc591('0x36')],qs[_0xc591('0x37')](_0x364d50[_0xc591('0x32')][_0xc591('0x37')]));_0x9e6443[_0xc591('0x38')]=_0x9e6443[_0xc591('0x38')][_0xc591('0x39')]?_0x9e6443[_0xc591('0x38')]:_0x291dfe[_0xc591('0x36')];if(!_0x364d50['query'][_0xc591('0x3a')]('nolimit')){_0x9e6443['limit']=qs[_0xc591('0x21')](_0x364d50[_0xc591('0x32')]['limit']);_0x9e6443[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x364d50['query'][_0xc591('0x20')]);}_0x9e6443[_0xc591('0x3c')]=qs[_0xc591('0x3d')](_0x364d50['query']['sort']);_0x9e6443[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x364d50[_0xc591('0x32')],_0x291dfe['filters']));_0x9e6443['where'][_0xc591('0x59')]=_0x4226b7['id'];if(_0x364d50[_0xc591('0x32')][_0xc591('0x42')]){_0x9e6443[_0xc591('0x3e')]=_['merge'](_0x9e6443[_0xc591('0x3e')],{'$or':_['map'](_0x9e6443[_0xc591('0x38')],function(_0x55420b){var _0x25adbf={};_0x25adbf[_0x55420b]={'$like':'%'+_0x364d50[_0xc591('0x32')]['filter']+'%'};return _0x25adbf;})});}_0x9e6443=_[_0xc591('0x40')]({},_0x9e6443,_0x364d50[_0xc591('0x43')]);return db[_0xc591('0x5c')][_0xc591('0x23')]({'where':_0x9e6443[_0xc591('0x3e')]})[_0xc591('0x13')](function(_0x10b317){_0x57efa0[_0xc591('0x23')]=_0x10b317;if(_0x364d50['query']['includeAll']){_0x9e6443[_0xc591('0x46')]=[{'all':!![]}];}return db[_0xc591('0x5c')][_0xc591('0x47')](_0x9e6443);})[_0xc591('0x13')](function(_0x32101b){_0x57efa0[_0xc591('0x48')]=_0x32101b;return _0x57efa0;});}})[_0xc591('0x13')](respondWithFilteredResult(_0x6251b,_0x9e6443))['catch'](handleError(_0x6251b,null));};exports[_0xc591('0x5d')]=function(_0x10248c,_0x27780b){return db['ChatWebsite']['find']({'where':{'id':_0x10248c[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x27780b,null))[_0xc591('0x13')](function(_0x130c6d){if(_0x130c6d){return _0x130c6d[_0xc591('0x5d')](_0x10248c[_0xc591('0x32')]['ids']);}})[_0xc591('0x13')](respondWithStatusCode(_0x27780b,null))[_0xc591('0x1d')](handleError(_0x27780b,null));};exports[_0xc591('0x5e')]=function(_0x13233e,_0x4bbb69){if(_0x13233e[_0xc591('0x4c')]['id']){delete _0x13233e[_0xc591('0x4c')]['id'];}return db['ChatWebsite'][_0xc591('0x55')]({'where':{'id':_0x13233e[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x4bbb69,null))[_0xc591('0x13')](function(_0x183b3b){if(_0x183b3b){_0x13233e[_0xc591('0x4c')][_0xc591('0x59')]=_0x183b3b['id'];return db['CannedAnswer'][_0xc591('0x4b')](_0x13233e[_0xc591('0x4c')]);}})[_0xc591('0x13')](respondWithResult(_0x4bbb69,null))[_0xc591('0x1d')](handleError(_0x4bbb69,null));};exports[_0xc591('0x5f')]=function(_0x568e0a,_0x5f0908){var _0x2fcd39={'raw':![],'where':{}};var _0x467964={};var _0x2e0c59={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc591('0x5b')]({'where':{'id':_0x568e0a[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x5f0908,null))[_0xc591('0x13')](function(_0x3f38f7){if(_0x3f38f7){_0x467964[_0xc591('0x36')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x467964['query']=_[_0xc591('0x33')](_0x568e0a[_0xc591('0x32')]);_0x467964[_0xc591('0x34')]=_['intersection'](_0x467964[_0xc591('0x36')],_0x467964['query']);_0x2fcd39[_0xc591('0x38')]=_[_0xc591('0x35')](_0x467964[_0xc591('0x36')],qs['fields'](_0x568e0a[_0xc591('0x32')][_0xc591('0x37')]));_0x2fcd39[_0xc591('0x38')]=_0x2fcd39[_0xc591('0x38')][_0xc591('0x39')]?_0x2fcd39[_0xc591('0x38')]:_0x467964[_0xc591('0x36')];if(!_0x568e0a[_0xc591('0x32')][_0xc591('0x3a')](_0xc591('0x3b'))){_0x2fcd39['limit']=qs[_0xc591('0x21')](_0x568e0a['query'][_0xc591('0x21')]);_0x2fcd39[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x568e0a[_0xc591('0x32')][_0xc591('0x20')]);}_0x2fcd39['order']=qs[_0xc591('0x3d')](_0x568e0a[_0xc591('0x32')]['sort']);_0x2fcd39[_0xc591('0x3e')]=qs[_0xc591('0x34')](_['pick'](_0x568e0a[_0xc591('0x32')],_0x467964[_0xc591('0x34')]));_0x2fcd39[_0xc591('0x3e')][_0xc591('0x59')]=_0x3f38f7['id'];if(_0x568e0a[_0xc591('0x32')]['filter']){_0x2fcd39[_0xc591('0x3e')]=_['merge'](_0x2fcd39[_0xc591('0x3e')],{'$or':_[_0xc591('0x60')](_0x2fcd39[_0xc591('0x38')],function(_0x5d8563){var _0x3f33b9={};_0x3f33b9[_0x5d8563]={'$like':'%'+_0x568e0a[_0xc591('0x32')]['filter']+'%'};return _0x3f33b9;})});}_0x2fcd39=_[_0xc591('0x40')]({},_0x2fcd39,_0x568e0a[_0xc591('0x43')]);return db[_0xc591('0x61')][_0xc591('0x23')]({'where':_0x2fcd39[_0xc591('0x3e')]})[_0xc591('0x13')](function(_0xffee00){_0x2e0c59[_0xc591('0x23')]=_0xffee00;if(_0x568e0a[_0xc591('0x32')]['includeAll']){_0x2fcd39[_0xc591('0x46')]=[{'all':!![]}];}return db[_0xc591('0x61')][_0xc591('0x47')](_0x2fcd39);})[_0xc591('0x13')](function(_0x51007e){_0x2e0c59[_0xc591('0x48')]=_0x51007e;return _0x2e0c59;});}})[_0xc591('0x13')](respondWithFilteredResult(_0x5f0908,_0x2fcd39))[_0xc591('0x1d')](handleError(_0x5f0908,null));};exports[_0xc591('0x62')]=function(_0x53f440,_0x3f3272){return db[_0xc591('0x44')]['find']({'where':{'id':_0x53f440['params']['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x3f3272,null))[_0xc591('0x13')](function(_0x258262){if(_0x258262){return _0x258262[_0xc591('0x62')](_0x53f440['query'][_0xc591('0x63')]);}})[_0xc591('0x13')](respondWithStatusCode(_0x3f3272,null))['catch'](handleError(_0x3f3272,null));};exports[_0xc591('0x64')]=function(_0x1140e0,_0x5b75ee){_0x1140e0[_0xc591('0x4c')]['sitepic']=_0x1140e0[_0xc591('0x65')][_0xc591('0x66')];return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x1140e0[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b75ee,null))['then'](saveUpdates(_0x1140e0[_0xc591('0x4c')],null))[_0xc591('0x13')](respondWithResult(_0x5b75ee,null))[_0xc591('0x1d')](handleError(_0x5b75ee,null));};exports[_0xc591('0x67')]=function(_0x382590,_0x47e96a){_0x382590[_0xc591('0x4c')]['agentAvatar']=_0x382590[_0xc591('0x65')][_0xc591('0x66')];return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x382590[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x47e96a,null))[_0xc591('0x13')](saveUpdates(_0x382590['body'],null))[_0xc591('0x13')](respondWithResult(_0x47e96a,null))['catch'](handleError(_0x47e96a,null));};exports[_0xc591('0x68')]=function(_0x4207cd,_0x5b588d){_0x4207cd[_0xc591('0x4c')][_0xc591('0x69')]=_0x4207cd[_0xc591('0x65')]['filename'];return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x4207cd[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x5b588d,null))['then'](saveUpdates(_0x4207cd['body'],null))['then'](respondWithResult(_0x5b588d,null))[_0xc591('0x1d')](handleError(_0x5b588d,null));};exports[_0xc591('0x6a')]=function(_0x134908,_0x2f9b4e){_0x134908['body'][_0xc591('0x6b')]=_0x134908[_0xc591('0x65')][_0xc591('0x66')];return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x134908['params']['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x2f9b4e,null))[_0xc591('0x13')](saveUpdates(_0x134908[_0xc591('0x4c')],null))['then'](respondWithResult(_0x2f9b4e,null))['catch'](handleError(_0x2f9b4e,null));};exports[_0xc591('0x6c')]=function(_0x1952d,_0x1242b2){var _0x42d650=path[_0xc591('0x6d')](config['root'],_0xc591('0x6e'));var _0x7790c0={'where':{'id':_0x1952d[_0xc591('0x57')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xf58cf9=![];return require('../../config/license/util')[_0xc591('0x6f')]()[_0xc591('0x13')](function(_0x301b00){if(_0x301b00){_0xf58cf9=_0x301b00['custom'];}})['then'](function(){return db[_0xc591('0x44')][_0xc591('0x55')](_0x7790c0);})[_0xc591('0x13')](handleEntityNotFound(_0x1242b2,null))[_0xc591('0x13')](function(_0x3324d5){if(_0x3324d5){if(!_[_0xc591('0x70')](_0x3324d5[_0xc591('0x71')])){if(fs[_0xc591('0x72')](path['join'](config[_0xc591('0x73')],_0xc591('0x74'),_0x3324d5['sitepic']))&&_0xf58cf9){_0x42d650=path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0x74'),_0x3324d5[_0xc591('0x71')]);}}return _0x1242b2[_0xc591('0x75')](_0x42d650);}})[_0xc591('0x1d')](handleError(_0x1242b2,null));};exports[_0xc591('0x76')]=function(_0x50478d,_0xa05c78){var _0x3703cb=path['join'](config['root'],_0xc591('0x77'));var _0xe65d8c={'where':{'id':_0x50478d[_0xc591('0x57')]['id']},'attributes':['id',_0xc591('0x78')],'raw':!![]};return db[_0xc591('0x44')][_0xc591('0x55')](_0xe65d8c)['then'](handleEntityNotFound(_0xa05c78,null))[_0xc591('0x13')](function(_0x27c8ea){if(_0x27c8ea){if(!_[_0xc591('0x70')](_0x27c8ea[_0xc591('0x78')])){if(fs[_0xc591('0x72')](path[_0xc591('0x6d')](config[_0xc591('0x73')],'server/files/images/avatars/',_0x27c8ea['agentAvatar']))){_0x3703cb=path[_0xc591('0x6d')](config['root'],_0xc591('0x79'),_0x27c8ea[_0xc591('0x78')]);}}return _0xa05c78[_0xc591('0x75')](_0x3703cb);}})[_0xc591('0x1d')](handleError(_0xa05c78,null));};exports[_0xc591('0x7a')]=function(_0x1acec8,_0xc411f1){var _0x24d122=path['join'](config['root'],_0xc591('0x7b'));var _0x1bfc9d={'where':{'id':_0x1acec8['params']['id']},'attributes':['id',_0xc591('0x69'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x1bfc9d)[_0xc591('0x13')](handleEntityNotFound(_0xc411f1,null))['then'](function(_0x4757a0){if(_0x4757a0){if(!_['isNil'](_0x4757a0[_0xc591('0x69')])){if(fs[_0xc591('0x72')](path[_0xc591('0x6d')](config[_0xc591('0x73')],'server/files/images/avatars/',_0x4757a0['customerAvatar']))&&_0x4757a0[_0xc591('0x7c')]){_0x24d122=path['join'](config[_0xc591('0x73')],'server/files/images/avatars/',_0x4757a0[_0xc591('0x69')]);}}return _0xc411f1[_0xc591('0x75')](_0x24d122);}})['catch'](handleError(_0xc411f1,null));};exports[_0xc591('0x7d')]=function(_0x2b1763,_0x34deaa){var _0xd90e4a=path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0x7e'));var _0x454106={'where':{'id':_0x2b1763[_0xc591('0x57')]['id']},'attributes':['id',_0xc591('0x6b')],'raw':!![]};return db['ChatWebsite'][_0xc591('0x55')](_0x454106)['then'](handleEntityNotFound(_0x34deaa,null))[_0xc591('0x13')](function(_0x2a32b8){if(_0x2a32b8){if(!_[_0xc591('0x70')](_0x2a32b8[_0xc591('0x6b')])){if(fs['existsSync'](path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0x79'),_0x2a32b8['systemAvatar']))){_0xd90e4a=path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0x79'),_0x2a32b8[_0xc591('0x6b')]);}}return _0x34deaa[_0xc591('0x75')](_0xd90e4a);}})[_0xc591('0x1d')](handleError(_0x34deaa,null));};exports['notify']=function(_0x4a094f,_0x398800){var _0x370895=require(_0xc591('0x7f'));var _0x1e5191=new _0x370895();var _0x37f92b=_0x1e5191[_0xc591('0x80')](_0x4a094f['headers'][_0xc591('0x81')])[_0xc591('0x82')]();var _0x2841f2={'body':_0x4a094f['body'],'channel':_0xc591('0x83')};var _0x27397e=[];var _0x3e45a8=[];var _0x5640bd={};var _0x32739f=![];return db['CmContact'][_0xc591('0x58')]()['then'](function(_0x8750d3){if(!_0x8750d3){throw new db[(_0xc591('0x84'))][(_0xc591('0x85'))](_0xc591('0x86'));}_0x27397e=_['difference'](_[_0xc591('0x33')](_0x8750d3),['createdAt',_0xc591('0x87')]);_0x3e45a8=_[_0xc591('0x88')](_[_0xc591('0x33')](_0x8750d3),[_0xc591('0x89'),_0xc591('0x87'),_0xc591('0x8a'),'ListId']);if(_0x4a094f[_0xc591('0x4c')]['id']){delete _0x4a094f[_0xc591('0x4c')]['id'];}if(_[_0xc591('0x70')](_0x4a094f[_0xc591('0x4c')][_0xc591('0x8b')])){throw new db[(_0xc591('0x84'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xc591('0x70')](_0x4a094f[_0xc591('0x4c')][_0xc591('0x4c')])||_0x4a094f[_0xc591('0x4c')][_0xc591('0x4c')]===''){throw new db['Sequelize'][(_0xc591('0x85'))](_0xc591('0x8c'));}if(_[_0xc591('0x70')](_0x4a094f[_0xc591('0x4c')][_0xc591('0x8d')])){throw new db[(_0xc591('0x84'))][(_0xc591('0x85'))](_0xc591('0x8e')+_0x3e45a8);}if(!_['includes'](_0x3e45a8,_0x4a094f['body'][_0xc591('0x8d')])){throw new db[(_0xc591('0x84'))]['ValidationError'](_0xc591('0x8f')+_0x3e45a8);}_0x5640bd[_0x4a094f[_0xc591('0x4c')]['mapKey']]=_0x4a094f[_0xc591('0x4c')][_0xc591('0x8b')];})[_0xc591('0x13')](function(){return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x4a094f[_0xc591('0x57')]['id']},'include':[{'model':db[_0xc591('0x90')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5640bd,'limit':0x1,'order':[[_0xc591('0x87'),_0xc591('0x91')]]}]},{'model':db[_0xc591('0x92')],'as':_0xc591('0x93')}]});})['then'](handleEntityNotFound(_0x398800,null))[_0xc591('0x13')](function(_0x523dd7){if(_0x523dd7&&_0x523dd7[_0xc591('0x94')]){_0x2841f2[_0xc591('0x95')]=_0x523dd7;_0x2841f2[_0xc591('0x96')]=_0x523dd7['Applications'];_0x2841f2[_0xc591('0x97')]=_0x523dd7[_0xc591('0x94')];_0x2841f2['applications']=_[_0xc591('0x98')](_0x2841f2[_0xc591('0x96')],['priority'],[_0xc591('0x99')]);if(_0x2841f2[_0xc591('0x95')][_0xc591('0x93')]){delete _0x2841f2['account'][_0xc591('0x93')];}if(_0x2841f2[_0xc591('0x95')][_0xc591('0x94')]&&_0x2841f2[_0xc591('0x95')][_0xc591('0x94')][_0xc591('0x9a')][_0xc591('0x39')]){return _0x2841f2[_0xc591('0x95')]['List'][_0xc591('0x9a')][0x0];}var _0x299c2c=_[_0xc591('0x8')](_0x4a094f[_0xc591('0x4c')],{'firstName':_0x4a094f[_0xc591('0x4c')][_0xc591('0x8b')],'ListId':_0x523dd7['ListId']});_0x299c2c[_0x4a094f[_0xc591('0x4c')][_0xc591('0x8d')]]=_0x4a094f[_0xc591('0x4c')][_0xc591('0x8b')];return db[_0xc591('0x9b')][_0xc591('0x4b')](_0x299c2c,{'fields':_0x27397e,'raw':!![]});}})['then'](handleEntityNotFound(_0x398800,null))[_0xc591('0x13')](function(_0x539722){_0x2841f2['contact']=_0x539722;var _0x2115a3=_0x4a094f[_0xc591('0x4c')][_0xc591('0x9c')];if(_0x4a094f[_0xc591('0x9d')][_0xc591('0x9e')]){_0x2115a3=_0x4a094f[_0xc591('0x9d')][_0xc591('0x9e')];}else if(_0x4a094f[_0xc591('0x9d')][_0xc591('0x9f')]){_0x2115a3=_[_0xc591('0xa0')](_0x4a094f[_0xc591('0x9d')][_0xc591('0x9f')][_0xc591('0xa1')](','));}if(_0x539722){var _0xdfce15={'ContactId':_0x539722['id'],'ChatWebsiteId':_0x4a094f[_0xc591('0x57')]['id'],'from':(_0x539722[_0xc591('0xa2')]||'')+'\x20'+(_0x539722[_0xc591('0xa3')]||''),'customerIp':_0x2115a3,'customerPort':_0x4a094f[_0xc591('0x9d')][_0xc591('0xa4')]?_0x4a094f[_0xc591('0x9d')][_0xc591('0xa4')]:null,'referer':_0x4a094f['body']['referer'],'browserName':_0x37f92b[_0xc591('0xa5')][_0xc591('0x2d')]&&_0x37f92b[_0xc591('0xa5')][_0xc591('0xa6')]?util[_0xc591('0xa7')](_0xc591('0xa8'),_0x37f92b[_0xc591('0xa5')][_0xc591('0x2d')],_0x37f92b[_0xc591('0xa5')][_0xc591('0xa6')]):_0xc591('0xa9'),'browserVersion':_0x37f92b[_0xc591('0xa5')][_0xc591('0xa6')]||_0xc591('0xa9'),'osName':util['format'](_0xc591('0xa8'),_0x37f92b['os']['name'],_0x37f92b['os'][_0xc591('0xa6')]),'osVersion':_0x37f92b['os'][_0xc591('0xa6')],'deviceModel':_0x37f92b[_0xc591('0xaa')][_0xc591('0x36')]&&_0x37f92b[_0xc591('0xaa')][_0xc591('0xab')]?util['format'](_0xc591('0xac'),_0x37f92b[_0xc591('0xaa')][_0xc591('0x36')],_0x37f92b[_0xc591('0xaa')][_0xc591('0xab')],_0x37f92b[_0xc591('0xaa')][_0xc591('0x31')]):null,'deviceVendor':_0x37f92b[_0xc591('0xaa')][_0xc591('0xab')],'deviceType':_0x37f92b[_0xc591('0xaa')][_0xc591('0x31')],'formData':JSON[_0xc591('0x17')](_0x4a094f[_0xc591('0x4c')])};var _0x1725ab={'ChatWebsiteId':_0x4a094f[_0xc591('0x57')]['id'],'closed':![]};if(_0x4a094f['body'][_0xc591('0xad')]){_0x1725ab['threadId']=_0x4a094f[_0xc591('0x4c')][_0xc591('0xad')];return db[_0xc591('0xae')][_0xc591('0x55')]({'where':_0x1725ab})['then'](function(_0x1c70b7){if(_0x1c70b7){return[_0x1c70b7,![]];}_0xdfce15[_0xc591('0xad')]=_0x4a094f['body'][_0xc591('0xad')];_0xdfce15[_0xc591('0xaf')]=_0x4a094f[_0xc591('0x4c')][_0xc591('0xaf')];return db[_0xc591('0xae')][_0xc591('0x4b')](_0xdfce15)[_0xc591('0x13')](function(_0x4b20bf){return[_0x4b20bf,!![]];});});}_0x1725ab[_0xc591('0xb0')]=_0x539722['id'];if(_0x4a094f['body']['interaction']&&_0x4a094f[_0xc591('0x4c')]['interaction']['id']){_0x1725ab['id']=_0x4a094f[_0xc591('0x4c')][_0xc591('0xb1')]['id'];return db[_0xc591('0xae')][_0xc591('0x55')]({'where':_0x1725ab})[_0xc591('0x13')](function(_0x5672ef){if(_0x5672ef){return[_0x5672ef,![]];}return db[_0xc591('0xae')][_0xc591('0x4b')](_0xdfce15)['then'](function(_0x1d0220){return[_0x1d0220,!![]];});});}return db[_0xc591('0xae')][_0xc591('0x4b')](_0xdfce15)[_0xc591('0x13')](function(_0x1c0658){return[_0x1c0658,!![]];});}})[_0xc591('0xb2')](function(_0x2fd2df,_0x5bd375){if(_0x2fd2df){_0x32739f=_0x5bd375;if(!_0x5bd375){var _0x5d376e={'from':(_0x2841f2[_0xc591('0xb3')]['firstName']||'')+'\x20'+(_0x2841f2[_0xc591('0xb3')][_0xc591('0xa3')]||'')};if(_0x4a094f[_0xc591('0x4c')][_0xc591('0xad')]&&_0x4a094f[_0xc591('0x4c')]['messageId']&&_0x4a094f[_0xc591('0x4c')]['threadId']!=_0x4a094f[_0xc591('0x4c')][_0xc591('0xb4')]){_0x5d376e[_0xc591('0xad')]=_0x4a094f['body'][_0xc591('0xb4')];}return _0x2fd2df[_0xc591('0x27')](_0x5d376e);}else{return _0x2fd2df;}}})[_0xc591('0x13')](function(_0x17555a){_0x2841f2[_0xc591('0xb1')]=_0x17555a[_0xc591('0x28')]({'plain':!![]});_0x2841f2[_0xc591('0xb1')]['created']=_0x32739f;if(_0x2841f2['interaction'][_0xc591('0xb5')]){if(_0x2841f2[_0xc591('0x95')][_0xc591('0xb6')]){_0x2841f2[_0xc591('0x96')][_0xc591('0xb7')]({'id':0x0,'priority':_0x2841f2[_0xc591('0x96')][_0xc591('0x39')]+0x1,'app':_0xc591('0xb8'),'appdata':_0xc591('0xb9'),'interval':_0xc591('0xba')});}}return db[_0xc591('0xbb')][_0xc591('0x4b')]({'body':_0x4a094f[_0xc591('0x4c')]['body'],'ChatWebsiteId':_0x4a094f[_0xc591('0x57')]['id'],'ChatInteractionId':_0x17555a['id'],'direction':'in','ContactId':_0x2841f2['contact']['id'],'AttachmentId':_0x4a094f[_0xc591('0x4c')][_0xc591('0xbc')]});})[_0xc591('0x13')](function(_0x3fc4dc){_0x2841f2[_0xc591('0x1a')]=_0x3fc4dc;if(_0x2841f2['interaction'][_0xc591('0xbd')]){return db[_0xc591('0xbe')][_0xc591('0x55')]({'attributes':['id',_0xc591('0x2d')],'where':{'id':_0x2841f2[_0xc591('0xb1')]['UserId']}})[_0xc591('0x13')](function(_0x537394){if(_0x537394){_0x2841f2['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xc591('0xbf'),'appdata':_0x537394[_0xc591('0x2d')]+','+(_0x2841f2['account']['waitForTheAssignedAgent']||0xa),'interval':_0xc591('0xba')});_0x2841f2['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0xc591('0xc0'),_0x2841f2);});}return respondWithRpcPromise('Start',_0xc591('0xc0'),_0x2841f2);})[_0xc591('0x13')](function(_0x489786){respondWithRpcPromise(_0xc591('0xc1'),_0xc591('0xc1'),{'event':_0xc591('0xc2'),'message':_0x489786},client9002);return _0x489786;})[_0xc591('0x13')](respondWithResult(_0x398800,null))[_0xc591('0x1d')](handleError(_0x398800,null));};exports[_0xc591('0xc3')]=function(_0x31e8c4,_0x6779d1){var _0x4003be,_0x404d81,_0x5a00f7;var _0x1caa4b=[];var _0x1d7ec4={};var _0x4dae99=_0x31e8c4['files']||[];var _0x535daf=[];var _0xb2907b;return db[_0xc591('0x9b')][_0xc591('0x58')]()[_0xc591('0x13')](function(_0x1d4f98){if(!_0x1d4f98){throw new db[(_0xc591('0x84'))][(_0xc591('0x85'))]('no\x20available\x20attributes');}_0x1caa4b=_[_0xc591('0x88')](_[_0xc591('0x33')](_0x1d4f98),[_0xc591('0x89'),_0xc591('0x87'),_0xc591('0x8a'),_0xc591('0xc4')]);if(_0x31e8c4[_0xc591('0x4c')]['id']){delete _0x31e8c4[_0xc591('0x4c')]['id'];}if(_[_0xc591('0x70')](_0x31e8c4[_0xc591('0x4c')][_0xc591('0x8b')])){throw _0x6779d1['status'](0x1f4)[_0xc591('0x2e')](new db[(_0xc591('0x84'))][(_0xc591('0x85'))](_0xc591('0xc5')));}if(_[_0xc591('0x70')](_0x31e8c4[_0xc591('0x4c')][_0xc591('0x4c')])||_0x31e8c4[_0xc591('0x4c')][_0xc591('0x4c')]===''){throw _0x6779d1[_0xc591('0x24')](0x1f4)[_0xc591('0x2e')](new db[(_0xc591('0x84'))][(_0xc591('0x85'))](_0xc591('0x8c')));}if(_[_0xc591('0x70')](_0x31e8c4[_0xc591('0x4c')][_0xc591('0xc6')])){throw _0x6779d1['status'](0x1f4)[_0xc591('0x2e')](new db['Sequelize'][(_0xc591('0x85'))](_0xc591('0xc7')+_0x1caa4b));}if(!_[_0xc591('0xc8')](_0x1caa4b,_0x31e8c4[_0xc591('0x4c')][_0xc591('0xc6')])){throw _0x6779d1[_0xc591('0x24')](0x1f4)['send'](new db[(_0xc591('0x84'))]['ValidationError'](_0xc591('0xc9')+_0x1caa4b));}_0x1d7ec4[_0x31e8c4[_0xc591('0x4c')]['mapKeyOffline']]=_0x31e8c4[_0xc591('0x4c')][_0xc591('0x8b')];})[_0xc591('0x13')](function(){return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x31e8c4['params']['id']},'include':[{'model':db[_0xc591('0x90')],'as':'List'},{'model':db[_0xc591('0xca')],'as':_0xc591('0xca')}]});})[_0xc591('0x13')](handleEntityNotFound(_0x6779d1,null))[_0xc591('0x13')](function(_0x16e440){if(_0x16e440&&_0x16e440['List']){_0x404d81=_0x16e440;var _0xb857a7=_[_0xc591('0x8')](_0x31e8c4[_0xc591('0x4c')],{'firstName':_0x31e8c4['body'][_0xc591('0x8b')],'phone':_0x31e8c4[_0xc591('0x4c')]['from'],'ListId':_0x16e440[_0xc591('0xc4')]});_0xb857a7[_0x31e8c4['body'][_0xc591('0xc6')]]=_0x31e8c4[_0xc591('0x4c')]['from'];return db['CmContact']['findOrCreate']({'where':_0x1d7ec4,'defaults':_0xb857a7});}})[_0xc591('0xb2')](function(_0x4a14e0){if(_0x4a14e0){_0x5a00f7=_0x4a14e0;var _0x1d34d5=fs[_0xc591('0xcb')](path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0xcc')),_0xc591('0xcd'));var _0x3bac61=ejs['render'](_0x1d34d5,{'body':_[_0xc591('0xce')](_0x31e8c4[_0xc591('0x4c')][_0xc591('0x4c')]),'bodyTitle':_0x404d81['offlineMessageBody']});return db[_0xc591('0xcf')][_0xc591('0x4b')]({'body':_0x3bac61,'plainBody':htmlToText['fromString'](_0x3bac61),'ContactId':_0x4a14e0['id'],'ChatWebsiteId':_0x404d81['id']});}})['then'](function(_0x4d638d){_0xb2907b=_0x4d638d;if(_0x4dae99['length']){var _0x277570=_0x4dae99[_0xc591('0x60')](function(_0x1e8bbe){return{'name':_0x1e8bbe[_0xc591('0xd0')],'basename':_0x1e8bbe[_0xc591('0x66')],'type':_0x1e8bbe[_0xc591('0xd1')],'ChatOfflineMessageId':_0x4d638d['id']};});_0x535daf=_0x277570[_0xc591('0x60')](_0x2d7033=>{var _0x1d630d={'filename':_0x2d7033[_0xc591('0x2d')],'path':path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0xd2'),_0xc591('0xd3'),_0xc591('0xd4'),'offline-chat',_0x2d7033['basename'])};return _0x1d630d;});if(!_0x404d81[_0xc591('0xd5')]){return db[_0xc591('0xd6')][_0xc591('0xd7')](function(_0x361765){return db[_0xc591('0xd8')][_0xc591('0xd9')](_0x277570,{'transaction':_0x361765});});}}})[_0xc591('0x13')](function(){if(_0xb2907b){_0x4003be=_0xb2907b;return db['MailAccount'][_0xc591('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0xc591('0xda')],'as':_0xc591('0xdb'),'raw':!![],'include':[{'model':db[_0xc591('0xdc')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xc591('0x13')](function(_0x2820f3){if(_0x2820f3&&_0x2820f3['Smtp']&&_0x404d81['forwardOffline']&&_0x404d81['forwardOfflineAddress']){var _0x520457=_0x2820f3[_0xc591('0xdd')]();return respondWithRpcPromise(_0xc591('0xde'),'sendMail',{'account':_0x520457,'message':{'from':util[_0xc591('0xa7')](_0xc591('0xdf'),_0x2820f3['name'],_0x2820f3[_0xc591('0xe0')]||_0x2820f3[_0xc591('0xdb')][_0xc591('0x4d')]),'to':_0x404d81['forwardOfflineAddress'],'subject':_0x404d81['offlineMessageSubject'],'html':_0x4003be['body'],'attachments':_0x535daf}},client9003)[_0xc591('0x13')](function(){return _0x4003be;})[_0xc591('0x1d')](function(_0x3fb6d3){logger['error'](_0x3fb6d3);});}})[_0xc591('0x13')](function(){if(_0x404d81&&_0x404d81['openNewInteraction']&&_0x404d81[_0xc591('0xe1')]){var _0x29d080=[];if(_0x4dae99[_0xc591('0x39')]){_0x29d080=_0x4dae99['map'](function(_0x100959){return{'name':_0x100959[_0xc591('0xd0')],'basename':_0x100959[_0xc591('0x66')],'type':_0x100959['mimetype'],'ChatOfflineMessageId':_0xb2907b['id']};});}var _0x5d0cfa;if(!_[_0xc591('0x70')](_0x404d81[_0xc591('0xe2')])){var _0xaa77e8=_[_0xc591('0x60')](_0x31e8c4[_0xc591('0x4c')],function(_0xa6087c){return _0xa6087c;});var _0x2581dc=_[_0xc591('0xe3')](_0xaa77e8)[0x0];var _0x110ce6=_[_0xc591('0xe4')](_0x2581dc,function(_0x832cf8){return _0x832cf8;});_0x5d0cfa=_0x110ce6[0x1][_0x404d81[_0xc591('0xe2')]];}var _0xb2f53d={'from':_0x5a00f7[_0xc591('0xe0')],'firstName':_0x5a00f7[_0xc591('0xa2')],'lastName':_0x5a00f7[_0xc591('0xa3')],'mapKey':_0xc591('0xe0'),'message':{'from':_0x5a00f7[_0xc591('0xe0')],'to':_0x404d81[_0xc591('0xca')]['email'],'cc':'','subject':_[_0xc591('0x70')](_0x5d0cfa)?_0x404d81[_0xc591('0xe5')]:_0x5d0cfa,'messageId':'','sentAt':new Date(),'attach':_0x29d080[_0xc591('0x39')],'attachments':_0x29d080,'originChannel':'Chat','ChatWebsiteId':_0x404d81['id'],'ChatOfflineMessageId':_0x4003be['id'],'originTo':_0x404d81[_0xc591('0xca')][_0xc591('0xe0')]},'body':_0x4003be[_0xc591('0x4c')]};var _0x4a3498={'account':{'id':_0x404d81['MailAccountId']},'body':_0xb2f53d,'log':_0xc591('0xe6')};return respondWithRpcPromise(_0xc591('0xe6'),_0xc591('0xe7'),_0x4a3498,client9001)[_0xc591('0x13')](function(){return _0x4003be;})['catch'](function(_0x40e54d){logger[_0xc591('0x18')](_0x40e54d);});}return;})['then'](function(){if(_0x4003be){return _0x4003be;}})[_0xc591('0x13')](respondWithResult(_0x6779d1,null))['catch'](function(_0x2b8552){logger[_0xc591('0x18')]('catch',_0x2b8552);for(var _0x101460 of _0x4dae99){var _0x17f018=path[_0xc591('0x6d')](config['root'],_0xc591('0xd2'),_0xc591('0xd3'),'attachments',_0xc591('0xe8'),_0x101460['filename']);fs_extra['remove'](_0x17f018)['catch'](function(_0x1f77d2){logger[_0xc591('0x18')]('Could\x20not\x20remove\x20attachment\x20file',_0x17f018,_0x1f77d2);});}});};exports[_0xc591('0xe9')]=function(_0x8bc27c,_0x5c0647){return db[_0xc591('0xae')][_0xc591('0x55')]({'where':{'id':_0x8bc27c[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x5c0647,null))[_0xc591('0x13')](function(_0x36e7ee){if(_0x36e7ee){return _0x36e7ee[_0xc591('0xe9')](_0x8bc27c[_0xc591('0x4c')][_0xc591('0x63')],_[_0xc591('0xea')](_0x8bc27c['body'],[_0xc591('0x63'),'id'])||{});}})['then'](respondWithResult(_0x5c0647,null))[_0xc591('0x1d')](handleError(_0x5c0647,null));};exports[_0xc591('0xeb')]=function(_0x1f866f,_0x71fbc){var _0x50cd70={'raw':![],'where':{}};var _0x325890={};var _0x10b77a={'count':0x0,'rows':[]};return db[_0xc591('0x44')]['findOne']({'where':{'id':_0x1f866f['params']['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x71fbc,null))[_0xc591('0x13')](function(_0x2fe4ae){if(_0x2fe4ae){_0x325890['model']=_['keys'](db[_0xc591('0xae')]['rawAttributes']);_0x325890[_0xc591('0x32')]=_[_0xc591('0x33')](_0x1f866f[_0xc591('0x32')]);_0x325890['filters']=_[_0xc591('0x35')](_0x325890['model'],_0x325890[_0xc591('0x32')]);_0x50cd70[_0xc591('0x38')]=_[_0xc591('0x35')](_0x325890['model'],qs['fields'](_0x1f866f[_0xc591('0x32')][_0xc591('0x37')]));_0x50cd70[_0xc591('0x38')]=_0x50cd70[_0xc591('0x38')][_0xc591('0x39')]?_0x50cd70[_0xc591('0x38')]:_0x325890[_0xc591('0x36')];if(!_0x1f866f['query']['hasOwnProperty']('nolimit')){_0x50cd70[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x1f866f[_0xc591('0x32')][_0xc591('0x21')]);_0x50cd70['offset']=qs[_0xc591('0x20')](_0x1f866f[_0xc591('0x32')][_0xc591('0x20')]);}_0x50cd70[_0xc591('0x3c')]=qs[_0xc591('0x3d')](_0x1f866f[_0xc591('0x32')]['sort']);_0x50cd70['where']=qs[_0xc591('0x34')](_['pick'](_0x1f866f[_0xc591('0x32')],_0x325890['filters']));_0x50cd70[_0xc591('0x3e')][_0xc591('0x59')]=_0x2fe4ae['id'];if(_0x1f866f[_0xc591('0x32')]['filter']){_0x50cd70[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x50cd70['where'],{'$or':_[_0xc591('0x60')](_0x50cd70[_0xc591('0x38')],function(_0x50bce3){var _0x476de6={};_0x476de6[_0x50bce3]={'$like':'%'+_0x1f866f[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x476de6;})});}_0x50cd70=_[_0xc591('0x40')]({},_0x50cd70,_0x1f866f[_0xc591('0x43')]);return db[_0xc591('0xae')][_0xc591('0x23')]({'where':_0x50cd70[_0xc591('0x3e')]})[_0xc591('0x13')](function(_0x189652){_0x10b77a[_0xc591('0x23')]=_0x189652;if(_0x1f866f['query'][_0xc591('0x45')]){_0x50cd70['include']=[{'model':db[_0xc591('0x9b')],'as':_0xc591('0xec'),'required':![]},{'model':db[_0xc591('0xbe')],'as':_0xc591('0xed'),'attributes':[_0xc591('0x2d'),_0xc591('0xee'),_0xc591('0xef')],'required':![]},{'model':db[_0xc591('0xf0')],'as':_0xc591('0xf1'),'attributes':['id',_0xc591('0x2d'),_0xc591('0xf2')],'where':_0x1f866f[_0xc591('0x32')][_0xc591('0xf3')]?{'id':_0x1f866f[_0xc591('0x32')][_0xc591('0xf3')]}:undefined,'required':_0x1f866f[_0xc591('0x32')][_0xc591('0xf3')]?!![]:![]}];}return db[_0xc591('0xae')][_0xc591('0x47')](_0x50cd70);})['then'](function(_0x256655){_0x10b77a['rows']=_0x256655;return _0x10b77a;});}})[_0xc591('0x13')](respondWithFilteredResult(_0x71fbc,_0x50cd70))[_0xc591('0x1d')](handleError(_0x71fbc,null));};function iftimePromise(_0x102bf6,_0x241496){return respondWithRpcPromise(_0xc591('0xf4'),'getSnippet',{'command':_0x241496[_0xc591('0xf5')]?util[_0xc591('0xa7')](_0xc591('0xf6'),_0x102bf6[_0xc591('0xf7')],_0x241496['timezone']):util[_0xc591('0xa7')](_0xc591('0xf8'),_0x102bf6[_0xc591('0xf7')])},client9002)['then'](function(_0x55f9e1){var _0xcd512f=_0x55f9e1&&_0x55f9e1[_0xc591('0xf9')](_0xc591('0xfa'))>=0x0?!![]:![];logger[_0xc591('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x241496['id'],_0x102bf6['id'],_0x102bf6['interval'],_0xcd512f?'ONLINE':_0xc591('0xfb'),_0x241496['timezone']?_0x241496['timezone']:_0xc591('0xfc'));return _0xcd512f;})[_0xc591('0x1d')](function(_0x5240e2){logger['error'](_0xc591('0xfd'),_0x241496['id'],_0x102bf6['id'],_0x102bf6[_0xc591('0xf7')],util[_0xc591('0xfe')](_0x5240e2,{'showHidden':![],'depth':null}),_0x241496[_0xc591('0xf5')]?_0x241496[_0xc591('0xf5')]:_0xc591('0xfc'));return![];});}exports[_0xc591('0xff')]=function(_0x10e919,_0x4dc6ab){var _0x5cfe69=0x0;var _0x4f3ba3=0x0;var _0x27e647=![];var _0x29c91f;var _0x31a6d2;return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x10e919['params']['id']},'include':[{'model':db['Interval'],'as':_0xc591('0x100'),'include':[{'model':db['Interval'],'as':_0xc591('0x101'),'attributes':['id',_0xc591('0xf7')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4dc6ab,null))[_0xc591('0x13')](function(_0xe8266a){if(_0xe8266a){_0x29c91f=_0xe8266a;return _0xe8266a[_0xc591('0x102')]({'raw':!![]});}})[_0xc591('0x13')](function(_0x3f76f4){if(_0x29c91f){if(_0x3f76f4){_0x31a6d2=_0x3f76f4;}}return require(_0xc591('0x103'))[_0xc591('0x6f')]();})['then'](function(_0xe496cd){if(_0xe496cd){_0x4f3ba3=_0xe496cd[_0xc591('0x104')];_0x27e647=_0xe496cd[_0xc591('0x105')];}})[_0xc591('0x13')](function(){return db['ChatInteraction'][_0xc591('0x23')]({'where':{'closed':![]}});})['then'](function(_0x4385dc){_0x5cfe69=_0x4385dc;if(_0x4f3ba3&&_0x4385dc>_0x4f3ba3){return db[_0xc591('0x106')][_0xc591('0x5b')]({'where':{'id':0x1}})[_0xc591('0x13')](function(_0x5d7368){if(_0x5d7368){_0x5d7368[_0xc591('0x107')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x29c91f[_0xc591('0x100')]&&_0x29c91f[_0xc591('0x100')][_0xc591('0x101')]){var _0x18cbe0=[];for(var _0x581a78=0x0;_0x581a78<_0x29c91f[_0xc591('0x100')][_0xc591('0x101')][_0xc591('0x39')];_0x581a78++){var _0x3d9985=_0x29c91f[_0xc591('0x100')][_0xc591('0x101')][_0x581a78][_0xc591('0x28')]({'plain':!![]});_0x18cbe0[_0xc591('0xb7')](iftimePromise(_0x3d9985,_0x29c91f));}return BPromise[_0xc591('0x108')](_0x18cbe0)[_0xc591('0x13')](function(_0x173c16){return _[_0xc591('0x109')](_0x173c16);});}else{return!![];}})[_0xc591('0x13')](function(_0x2e047a){var _0x1521f7=fs[_0xc591('0xcb')](path[_0xc591('0x6d')](config[_0xc591('0x73')],'server/files/chat/iframe.ejs'),_0xc591('0xcd'));var _0x3d9c0e={'remote':_0x29c91f['remote'],'query':querystring['stringify'](_[_0xc591('0x40')](_0x29c91f['get']({'plain':!![]}),{'customerIp':_0x10e919['headers'][_0xc591('0x9f')]||_0x10e919[_0xc591('0x9d')][_0xc591('0x10a')]||_0x10e919[_0xc591('0x10b')][_0xc591('0x10c')]||_0x10e919['ip'],'referer':_0x10e919['headers'][_0xc591('0x10d')],'openedInteractions':_0x5cfe69,'maxInteractions':_0x4f3ba3,'virtual':_0x27e647[_0xc591('0x104')],'online':_0x2e047a,'custom':_0x27e647}))[_0xc591('0x10e')](/'/g,'\x5c\x27')};_0x4dc6ab[_0xc591('0x2e')](ejs[_0xc591('0x10f')](Mustache[_0xc591('0x10f')](_0x1521f7,_0x3d9c0e),{'proactiveActions':_0x31a6d2,'alignment':_0x29c91f['alignment'],'verticalAlignment':_0x29c91f[_0xc591('0x110')],'div_color':_0x29c91f[_0xc591('0xf2')],'labelText':_0x29c91f['labelText'],'text_color':_0x29c91f[_0xc591('0x111')],'text_button_color':_0x29c91f[_0xc591('0x112')],'button_color':_0x29c91f[_0xc591('0x113')],'background_color':_0x29c91f[_0xc591('0x114')],'hideWhenOffline':_0x29c91f[_0xc591('0x115')],'interval':_0x29c91f[_0xc591('0x116')]}));})[_0xc591('0x1d')](handleError(_0x4dc6ab,null));};exports[_0xc591('0x117')]=function(_0x5eddbc,_0x4e419f){var _0x54986b=_0x5eddbc['params']['id'];var _0x1496ef=_0x5eddbc[_0xc591('0x4c')];var _0x238ebd=0xc8;var _0x9671d0=null;return db[_0xc591('0xd6')][_0xc591('0xd7')]({'isolationLevel':db[_0xc591('0xd6')][_0xc591('0x118')][_0xc591('0x119')][_0xc591('0x11a')]},function(_0x4993a8){return db[_0xc591('0x44')][_0xc591('0x5b')]({'where':{'id':_0x54986b},'transaction':_0x4993a8})[_0xc591('0x13')](function(_0x1fcb11){if(_0x1fcb11){return db[_0xc591('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x54986b},'transaction':_0x4993a8})['then'](function(){var _0x2d89a1=_['map'](_0x1496ef,function(_0x57094a){_0x57094a[_0xc591('0x59')]=_0x54986b;return _0x57094a;});return db[_0xc591('0x92')][_0xc591('0xd9')](_0x2d89a1,{'transaction':_0x4993a8});});}else{_0x238ebd=0x194;_0x9671d0=[];}});})[_0xc591('0x13')](function(){if(_0x238ebd!==0x194){return db['ChatApplication'][_0xc591('0x11b')]({'where':{'ChatWebsiteId':_0x54986b},'order':_0xc591('0x11c')})[_0xc591('0x13')](function(_0x19b92b){_0x9671d0=_0x19b92b;});}})[_0xc591('0x1d')](function(_0x2d1cf9){_0x238ebd=0x1f4;logger[_0xc591('0x18')](_0x2d1cf9[_0xc591('0x2c')]);if(_0x2d1cf9[_0xc591('0x2d')]){delete _0x2d1cf9[_0xc591('0x2d')];}_0x9671d0=_0x2d1cf9;})[_0xc591('0x11d')](function(){if(_0x9671d0===null){_0x4e419f[_0xc591('0x2b')](_0x238ebd);}else{if(_0x238ebd===0x1f4){_0x4e419f[_0xc591('0x24')](_0x238ebd)[_0xc591('0x2e')](_0x9671d0);}else{_0x4e419f['status'](_0x238ebd)[_0xc591('0x1f')](_0x9671d0);}}});};exports['getApplications']=function(_0x3760b8,_0xc9023d){var _0x5f44ce={};var _0x40927d={};var _0xd6b6ff;var _0x24adfe;return db[_0xc591('0x44')][_0xc591('0x5b')]({'where':{'id':_0x3760b8[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0xc9023d,null))[_0xc591('0x13')](function(_0xcfd3){if(_0xcfd3){_0xd6b6ff=_0xcfd3;_0x40927d[_0xc591('0x36')]=_[_0xc591('0x33')](db[_0xc591('0x92')][_0xc591('0x2f')]);_0x40927d[_0xc591('0x32')]=_['keys'](_0x3760b8[_0xc591('0x32')]);_0x40927d['filters']=_[_0xc591('0x35')](_0x40927d[_0xc591('0x36')],_0x40927d[_0xc591('0x32')]);_0x5f44ce[_0xc591('0x38')]=_['intersection'](_0x40927d[_0xc591('0x36')],qs[_0xc591('0x37')](_0x3760b8[_0xc591('0x32')][_0xc591('0x37')]));_0x5f44ce['attributes']=_0x5f44ce[_0xc591('0x38')][_0xc591('0x39')]?_0x5f44ce[_0xc591('0x38')]:_0x40927d['model'];_0x5f44ce[_0xc591('0x3c')]=qs[_0xc591('0x3d')](_0x3760b8['query'][_0xc591('0x3d')]);_0x5f44ce[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x3760b8[_0xc591('0x32')],_0x40927d[_0xc591('0x34')]));if(_0x3760b8['query'][_0xc591('0x42')]){_0x5f44ce[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x5f44ce[_0xc591('0x3e')],{'$or':_[_0xc591('0x60')](_0x5f44ce['attributes'],function(_0x240e25){var _0x592e5c={};_0x592e5c[_0x240e25]={'$like':'%'+_0x3760b8[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x592e5c;})});}_0x5f44ce=_['merge']({},_0x5f44ce,_0x3760b8[_0xc591('0x43')]);return _0xd6b6ff[_0xc591('0x11e')](_0x5f44ce);}})['then'](function(_0x314ca6){if(_0x314ca6){_0x24adfe=_0x314ca6[_0xc591('0x39')];if(!_0x3760b8[_0xc591('0x32')][_0xc591('0x3a')]('nolimit')){_0x5f44ce[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x3760b8[_0xc591('0x32')][_0xc591('0x21')]);_0x5f44ce[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x3760b8[_0xc591('0x32')]['offset']);}return _0xd6b6ff[_0xc591('0x11e')](_0x5f44ce);}})['then'](function(_0x87ffe5){if(_0x87ffe5){return _0x87ffe5?{'count':_0x24adfe,'rows':_0x87ffe5}:null;}})[_0xc591('0x13')](respondWithResult(_0xc9023d,null))[_0xc591('0x1d')](handleError(_0xc9023d,null));};exports['addProactiveActions']=function(_0xac9686,_0x13871f){return db[_0xc591('0x11f')][_0xc591('0x55')]({'where':{'id':_0xac9686[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x13871f,null))[_0xc591('0x13')](function(_0x332455){if(_0x332455){return _0x332455['addProactiveActions'](_0xac9686[_0xc591('0x4c')][_0xc591('0x63')],_[_0xc591('0xea')](_0xac9686[_0xc591('0x4c')],[_0xc591('0x63'),'id'])||{});}})[_0xc591('0x13')](respondWithResult(_0x13871f,null))['catch'](handleError(_0x13871f,null));};exports['getProactiveActions']=function(_0x308c12,_0x1b06bc){var _0x3bb91a={};var _0x593c12={};var _0x5ad424;var _0xd615f9;return db[_0xc591('0x44')][_0xc591('0x5b')]({'where':{'id':_0x308c12[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x1b06bc,null))[_0xc591('0x13')](function(_0x31f816){if(_0x31f816){_0x5ad424=_0x31f816;_0x593c12['model']=_['keys'](db[_0xc591('0x120')][_0xc591('0x2f')]);_0x593c12['query']=_['keys'](_0x308c12[_0xc591('0x32')]);_0x593c12['filters']=_['intersection'](_0x593c12[_0xc591('0x36')],_0x593c12[_0xc591('0x32')]);_0x3bb91a[_0xc591('0x38')]=_[_0xc591('0x35')](_0x593c12[_0xc591('0x36')],qs[_0xc591('0x37')](_0x308c12[_0xc591('0x32')][_0xc591('0x37')]));_0x3bb91a[_0xc591('0x38')]=_0x3bb91a['attributes'][_0xc591('0x39')]?_0x3bb91a[_0xc591('0x38')]:_0x593c12['model'];_0x3bb91a[_0xc591('0x3c')]=qs[_0xc591('0x3d')](_0x308c12[_0xc591('0x32')]['sort']);_0x3bb91a[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x308c12[_0xc591('0x32')],_0x593c12[_0xc591('0x34')]));if(_0x308c12['query'][_0xc591('0x42')]){_0x3bb91a[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x3bb91a[_0xc591('0x3e')],{'$or':_['map'](_0x3bb91a[_0xc591('0x38')],function(_0x2548ad){var _0x4d530d={};_0x4d530d[_0x2548ad]={'$like':'%'+_0x308c12[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x4d530d;})});}_0x3bb91a=_[_0xc591('0x40')]({},_0x3bb91a,_0x308c12[_0xc591('0x43')]);return _0x5ad424['getProactiveActions'](_0x3bb91a);}})['then'](function(_0x27c0a9){if(_0x27c0a9){_0xd615f9=_0x27c0a9[_0xc591('0x39')];if(!_0x308c12['query']['hasOwnProperty'](_0xc591('0x3b'))){_0x3bb91a[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x308c12['query'][_0xc591('0x21')]);_0x3bb91a[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x308c12[_0xc591('0x32')]['offset']);}return _0x5ad424['getProactiveActions'](_0x3bb91a);}})[_0xc591('0x13')](function(_0x232c15){if(_0x232c15){return _0x232c15?{'count':_0xd615f9,'rows':_0x232c15}:null;}})[_0xc591('0x13')](respondWithResult(_0x1b06bc,null))['catch'](handleError(_0x1b06bc,null));};exports['getFields']=function(_0x10967b,_0x2ac2a7){var _0x3424f6=_0x10967b['query'][_0xc591('0x121')]===_0xc591('0x122')?_0xc591('0x123'):_0xc591('0x124');return db['ChatWebsite']['find']({'attributes':['id',_0x3424f6],'where':{'id':_0x10967b[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x2ac2a7,null))[_0xc591('0x13')](function(_0x35932b){if(_0x35932b){var _0x490411=_0x35932b[_0x3424f6];var _0x2abe6a=_0x490411&&_0x490411[_0xc591('0x125')]?_0x490411[_0xc591('0x125')]:[];_0x2ac2a7[_0xc591('0x2e')]({'fromKey':_[_0xc591('0x70')](_0x490411[_0xc591('0x126')])?undefined:_0x490411[_0xc591('0x126')],'count':_0x2abe6a[_0xc591('0x39')],'rows':_0x2abe6a});}})[_0xc591('0x1d')](handleError(_0x2ac2a7,null));};exports[_0xc591('0x127')]=function(_0x3664fc,_0x5a7c29){var _0x30b7c4={'raw':![],'where':{}};var _0x2b7902={};var _0x3685b5={'count':0x0,'rows':[]};return db[_0xc591('0x44')][_0xc591('0x5b')]({'where':{'id':_0x3664fc[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x5a7c29,null))['then'](function(_0x59c7f8){if(_0x59c7f8){_0x2b7902[_0xc591('0x36')]=_['keys'](db[_0xc591('0xcf')]['rawAttributes']);_0x2b7902['query']=_['keys'](_0x3664fc[_0xc591('0x32')]);_0x2b7902[_0xc591('0x34')]=_[_0xc591('0x35')](_0x2b7902[_0xc591('0x36')],_0x2b7902[_0xc591('0x32')]);_0x30b7c4['attributes']=_[_0xc591('0x35')](_0x2b7902[_0xc591('0x36')],qs[_0xc591('0x37')](_0x3664fc[_0xc591('0x32')][_0xc591('0x37')]));_0x30b7c4[_0xc591('0x38')]=_0x30b7c4['attributes'][_0xc591('0x39')]?_0x30b7c4['attributes']:_0x2b7902['model'];if(!_0x3664fc[_0xc591('0x32')][_0xc591('0x3a')]('nolimit')){_0x30b7c4[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x3664fc[_0xc591('0x32')]['limit']);_0x30b7c4[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x3664fc['query'][_0xc591('0x20')]);}_0x30b7c4[_0xc591('0x3c')]=qs['sort'](_0x3664fc[_0xc591('0x32')][_0xc591('0x3d')]);_0x30b7c4[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x3664fc[_0xc591('0x32')],_0x2b7902[_0xc591('0x34')]));_0x30b7c4[_0xc591('0x3e')]['ChatWebsiteId']=_0x59c7f8['id'];if(_0x3664fc[_0xc591('0x32')]['filter']){_0x30b7c4[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x30b7c4[_0xc591('0x3e')],{'$or':_[_0xc591('0x60')](_0x30b7c4[_0xc591('0x38')],function(_0x3a9bc2){var _0x3df9d8={};_0x3df9d8[_0x3a9bc2]={'$like':'%'+_0x3664fc[_0xc591('0x32')]['filter']+'%'};return _0x3df9d8;})});}_0x30b7c4=_['merge']({},_0x30b7c4,_0x3664fc[_0xc591('0x43')]);return db[_0xc591('0xcf')][_0xc591('0x23')]({'where':_0x30b7c4[_0xc591('0x3e')]})[_0xc591('0x13')](function(_0x44d883){_0x3685b5[_0xc591('0x23')]=_0x44d883;if(_0x3664fc[_0xc591('0x32')][_0xc591('0x45')]){_0x30b7c4['include']=[{'all':!![]}];}else{_0x30b7c4['include']=[{'model':db[_0xc591('0x9b')],'as':'Contact','required':![]},{'model':db[_0xc591('0xd8')],'as':_0xc591('0x128'),'required':![]}];}return db[_0xc591('0xcf')][_0xc591('0x47')](_0x30b7c4);})[_0xc591('0x13')](function(_0x5c05c2){_0x3685b5['rows']=_0x5c05c2;return _0x3685b5;});}})['then'](respondWithFilteredResult(_0x5a7c29,_0x30b7c4))[_0xc591('0x1d')](handleError(_0x5a7c29,null));};exports[_0xc591('0x129')]=function(_0x5cafbc,_0x4b28cb){return db['ChatWebsite'][_0xc591('0x55')]({'where':{'id':_0x5cafbc['params']['id']}})['then'](handleEntityNotFound(_0x4b28cb,null))[_0xc591('0x13')](function(_0x381165){if(_0x381165){return _0x381165[_0xc591('0x129')](_0x5cafbc[_0xc591('0x4c')][_0xc591('0x63')],_['omit'](_0x5cafbc[_0xc591('0x4c')],[_0xc591('0x63'),'id'])||{})[_0xc591('0xb2')](function(_0x294229){for(var _0x30beec=0x0;_0x30beec<_0x5cafbc[_0xc591('0x4c')][_0xc591('0x63')][_0xc591('0x39')];_0x30beec+=0x1){socket[_0xc591('0x12a')](_0xc591('0x12b'),{'UserId':Number(_0x5cafbc['body'][_0xc591('0x63')][_0x30beec]),'ChatWebsiteId':Number(_0x5cafbc['params']['id'])});}return _0x294229;});}})[_0xc591('0x13')](respondWithResult(_0x4b28cb,null))[_0xc591('0x1d')](handleError(_0x4b28cb,null));};exports[_0xc591('0x12c')]=function(_0x22fbda,_0x4e3c4b){return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x22fbda[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x4e3c4b,null))[_0xc591('0x13')](function(_0x181b12){if(_0x181b12){return _0x181b12[_0xc591('0x12c')](_0x22fbda[_0xc591('0x32')][_0xc591('0x63')])['then'](function(){if(_[_0xc591('0x12d')](_0x22fbda['query'][_0xc591('0x63')])){for(var _0x494694=0x0;_0x494694<_0x22fbda[_0xc591('0x32')][_0xc591('0x63')][_0xc591('0x39')];_0x494694+=0x1){socket[_0xc591('0x12a')](_0xc591('0x12e'),{'UserId':Number(_0x22fbda[_0xc591('0x32')]['ids'][_0x494694]),'ChatWebsiteId':Number(_0x22fbda[_0xc591('0x57')]['id'])});}}else{socket[_0xc591('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x22fbda[_0xc591('0x32')][_0xc591('0x63')]),'ChatWebsiteId':Number(_0x22fbda[_0xc591('0x57')]['id'])});}});}})[_0xc591('0x13')](respondWithStatusCode(_0x4e3c4b,null))[_0xc591('0x1d')](handleError(_0x4e3c4b,null));};exports[_0xc591('0x12f')]=function(_0x994470,_0x274311){var _0x2378cc={};var _0x4aac0c={};var _0x35c840;var _0x232421;return db[_0xc591('0x44')]['findOne']({'where':{'id':_0x994470[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x274311,null))[_0xc591('0x13')](function(_0x2d539a){if(_0x2d539a){_0x35c840=_0x2d539a;_0x4aac0c['model']=_['keys'](db[_0xc591('0xbe')]['rawAttributes']);_0x4aac0c['query']=_['keys'](_0x994470['query']);_0x4aac0c[_0xc591('0x34')]=_[_0xc591('0x35')](_0x4aac0c[_0xc591('0x36')],_0x4aac0c['query']);_0x2378cc['attributes']=_[_0xc591('0x35')](_0x4aac0c['model'],qs['fields'](_0x994470['query'][_0xc591('0x37')]));_0x2378cc['attributes']=_0x2378cc[_0xc591('0x38')]['length']?_0x2378cc[_0xc591('0x38')]:_0x4aac0c[_0xc591('0x36')];_0x2378cc[_0xc591('0x3c')]=qs['sort'](_0x994470[_0xc591('0x32')][_0xc591('0x3d')]);_0x2378cc[_0xc591('0x3e')]=qs[_0xc591('0x34')](_['pick'](_0x994470['query'],_0x4aac0c['filters']));if(_0x994470[_0xc591('0x32')]['filter']){_0x2378cc[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x2378cc[_0xc591('0x3e')],{'$or':_['map'](_0x2378cc[_0xc591('0x38')],function(_0x157455){var _0x351f12={};_0x351f12[_0x157455]={'$like':'%'+_0x994470[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x351f12;})});}_0x2378cc=_[_0xc591('0x40')]({},_0x2378cc,_0x994470[_0xc591('0x43')]);return _0x35c840[_0xc591('0x12f')](_0x2378cc);}})['then'](function(_0x531d92){if(_0x531d92){_0x232421=_0x531d92[_0xc591('0x39')];if(!_0x994470[_0xc591('0x32')][_0xc591('0x3a')](_0xc591('0x3b'))){_0x2378cc[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x994470[_0xc591('0x32')][_0xc591('0x21')]);_0x2378cc['offset']=qs[_0xc591('0x20')](_0x994470[_0xc591('0x32')][_0xc591('0x20')]);}return _0x35c840[_0xc591('0x12f')](_0x2378cc);}})[_0xc591('0x13')](function(_0x2b7201){if(_0x2b7201){return _0x2b7201?{'count':_0x232421,'rows':_0x2b7201}:null;}})[_0xc591('0x13')](respondWithResult(_0x274311,null))[_0xc591('0x1d')](handleError(_0x274311,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 14da8fd..723de2a 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 _0x0738=['hook','exports','events','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x1e3dfb,_0xfaf395){var _0x4b4100=function(_0x40a5a8){while(--_0x40a5a8){_0x1e3dfb['push'](_0x1e3dfb['shift']());}};_0x4b4100(++_0xfaf395);}(_0x0738,0x6e));var _0x8073=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0x0738[_0x40b2ed];return _0x18397d;};'use strict';var EventEmitter=require(_0x8073('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x8073('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8073('0x2')](0x0);var events={'afterCreate':_0x8073('0x3'),'afterUpdate':_0x8073('0x4'),'afterDestroy':_0x8073('0x5')};function emitEvent(_0xac9f0){return function(_0x176f52,_0x38b47d,_0x387cfe){ChatWebsiteEvents[_0x8073('0x6')](_0xac9f0+':'+_0x176f52['id'],_0x176f52);ChatWebsiteEvents[_0x8073('0x6')](_0xac9f0,_0x176f52);_0x387cfe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x8073('0x7')](e,emitEvent(event));}}module[_0x8073('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4b47=['update','remove','emit','exports','events','ChatWebsite','setMaxListeners','save'];(function(_0x1f23c0,_0x18fffd){var _0x56ab73=function(_0x340121){while(--_0x340121){_0x1f23c0['push'](_0x1f23c0['shift']());}};_0x56ab73(++_0x18fffd);}(_0x4b47,0x1b4));var _0x74b4=function(_0x6d5912,_0x2c82ac){_0x6d5912=_0x6d5912-0x0;var _0x1fdff9=_0x4b47[_0x6d5912];return _0x1fdff9;};'use strict';var EventEmitter=require(_0x74b4('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x74b4('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x74b4('0x2')](0x0);var events={'afterCreate':_0x74b4('0x3'),'afterUpdate':_0x74b4('0x4'),'afterDestroy':_0x74b4('0x5')};function emitEvent(_0x2795e9){return function(_0x565f6b,_0x4ed4fe,_0x27ddaf){ChatWebsiteEvents[_0x74b4('0x6')](_0x2795e9+':'+_0x565f6b['id'],_0x565f6b);ChatWebsiteEvents['emit'](_0x2795e9,_0x565f6b);_0x27ddaf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x74b4('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index de3a144..eb087b2 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 _0x174f=['moment','bluebird','request-promise','../../config/environment','define','ChatWebsite','chat_websites','lodash','../../config/logger'];(function(_0x5f3743,_0x50fe6b){var _0x2206f9=function(_0x4aa70f){while(--_0x4aa70f){_0x5f3743['push'](_0x5f3743['shift']());}};_0x2206f9(++_0x50fe6b);}(_0x174f,0x1a5));var _0xf174=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x174f[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xf174('0x0'));var util=require('util');var logger=require(_0xf174('0x1'))('api');var moment=require(_0xf174('0x2'));var BPromise=require(_0xf174('0x3'));var rp=require(_0xf174('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf174('0x5'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0xbd72b6,_0x3e3af5){return _0xbd72b6[_0xf174('0x6')](_0xf174('0x7'),attributes,{'tableName':_0xf174('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdcfd=['chat_websites','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x5e6cea,_0x24b02a){var _0x55a315=function(_0x395b80){while(--_0x395b80){_0x5e6cea['push'](_0x5e6cea['shift']());}};_0x55a315(++_0x24b02a);}(_0xdcfd,0x181));var _0xddcf=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0xdcfd[_0x4a8418];return _0x390174;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xddcf('0x0'))(_0xddcf('0x1'));var moment=require(_0xddcf('0x2'));var BPromise=require('bluebird');var rp=require(_0xddcf('0x3'));var fs=require('fs');var path=require(_0xddcf('0x4'));var rimraf=require(_0xddcf('0x5'));var config=require(_0xddcf('0x6'));var attributes=require(_0xddcf('0x7'));module[_0xddcf('0x8')]=function(_0x22ba4a,_0x4910a7){return _0x22ba4a[_0xddcf('0x9')](_0xddcf('0xa'),attributes,{'tableName':_0xddcf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 75d74dd..6abbc39 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 _0xa9f7=['ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatWebsite.socket','register','request','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9f7,0x1cf));var _0x7a9f=function(_0x51b6aa,_0x584154){_0x51b6aa=_0x51b6aa-0x0;var _0x4c3e43=_0xa9f7[_0x51b6aa];return _0x4c3e43;};'use strict';var _=require('lodash');var util=require(_0x7a9f('0x0'));var moment=require(_0x7a9f('0x1'));var BPromise=require(_0x7a9f('0x2'));var rs=require(_0x7a9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a9f('0x4'))['db'];var utils=require(_0x7a9f('0x5'));var logger=require('../../config/logger')(_0x7a9f('0x6'));var config=require(_0x7a9f('0x7'));var jayson=require(_0x7a9f('0x8'));var client=jayson[_0x7a9f('0x9')][_0x7a9f('0xa')]({'port':0x232a});config[_0x7a9f('0xb')]=_[_0x7a9f('0xc')](config[_0x7a9f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a9f('0xb')]));require(_0x7a9f('0xd'))[_0x7a9f('0xe')](socket);function respondWithRpcPromise(_0x491e93,_0x321bea,_0x33c6ea){return new BPromise(function(_0x35214e,_0x21cde6){return client[_0x7a9f('0xf')](_0x491e93,_0x33c6ea)['then'](function(_0x528f45){logger[_0x7a9f('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x321bea,'request\x20sent');logger[_0x7a9f('0x11')](_0x7a9f('0x12'),_0x321bea,_0x7a9f('0x13'),JSON[_0x7a9f('0x14')](_0x528f45));if(_0x528f45[_0x7a9f('0x15')]){if(_0x528f45[_0x7a9f('0x15')][_0x7a9f('0x16')]===0x1f4){logger['error'](_0x7a9f('0x17'),_0x321bea,_0x528f45[_0x7a9f('0x15')][_0x7a9f('0x18')]);return _0x21cde6(_0x528f45['error']['message']);}logger[_0x7a9f('0x15')](_0x7a9f('0x17'),_0x321bea,_0x528f45[_0x7a9f('0x15')][_0x7a9f('0x18')]);return _0x35214e(_0x528f45[_0x7a9f('0x15')]['message']);}else{logger[_0x7a9f('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x321bea,_0x7a9f('0x13'));_0x35214e(_0x528f45[_0x7a9f('0x19')]['message']);}})[_0x7a9f('0x1a')](function(_0xfe8ced){logger[_0x7a9f('0x15')](_0x7a9f('0x17'),_0x321bea,_0xfe8ced);_0x21cde6(_0xfe8ced);});});}
\ No newline at end of file
+var _0xe580=['jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x596386,_0x58583e){var _0x2d33db=function(_0x4b59cd){while(--_0x4b59cd){_0x596386['push'](_0x596386['shift']());}};_0x2d33db(++_0x58583e);}(_0xe580,0x101));var _0x0e58=function(_0x514ea3,_0x38b18f){_0x514ea3=_0x514ea3-0x0;var _0x2654ae=_0xe580[_0x514ea3];return _0x2654ae;};'use strict';var _=require(_0x0e58('0x0'));var util=require(_0x0e58('0x1'));var moment=require(_0x0e58('0x2'));var BPromise=require(_0x0e58('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e58('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e58('0x5'));var logger=require(_0x0e58('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0e58('0x7'));var client=jayson['client'][_0x0e58('0x8')]({'port':0x232a});config[_0x0e58('0x9')]=_[_0x0e58('0xa')](config[_0x0e58('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e58('0xb'))(new Redis(config['redis']));require(_0x0e58('0xc'))['register'](socket);function respondWithRpcPromise(_0x594ac6,_0x154d80,_0x574bfb){return new BPromise(function(_0x52a2de,_0x59a224){return client[_0x0e58('0xd')](_0x594ac6,_0x574bfb)[_0x0e58('0xe')](function(_0x54648a){logger[_0x0e58('0xf')](_0x0e58('0x10'),_0x154d80,'request\x20sent');logger['debug'](_0x0e58('0x11'),_0x154d80,_0x0e58('0x12'),JSON[_0x0e58('0x13')](_0x54648a));if(_0x54648a[_0x0e58('0x14')]){if(_0x54648a[_0x0e58('0x14')]['code']===0x1f4){logger[_0x0e58('0x14')](_0x0e58('0x10'),_0x154d80,_0x54648a['error'][_0x0e58('0x15')]);return _0x59a224(_0x54648a[_0x0e58('0x14')][_0x0e58('0x15')]);}logger[_0x0e58('0x14')](_0x0e58('0x10'),_0x154d80,_0x54648a[_0x0e58('0x14')][_0x0e58('0x15')]);return _0x52a2de(_0x54648a['error'][_0x0e58('0x15')]);}else{logger[_0x0e58('0xf')](_0x0e58('0x10'),_0x154d80,_0x0e58('0x12'));_0x52a2de(_0x54648a[_0x0e58('0x16')][_0x0e58('0x15')]);}})[_0x0e58('0x17')](function(_0x3e07ea){logger['error'](_0x0e58('0x10'),_0x154d80,_0x3e07ea);_0x59a224(_0x3e07ea);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 99292c6..a808080 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 _0xbc80=['update','emit','removeListener','register','length','./chatWebsite.events','remove'];(function(_0x2ee93b,_0x82445f){var _0x37c343=function(_0x1632b8){while(--_0x1632b8){_0x2ee93b['push'](_0x2ee93b['shift']());}};_0x37c343(++_0x82445f);}(_0xbc80,0x1da));var _0x0bc8=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xbc80[_0x1d8119];return _0x3e30f6;};'use strict';var ChatWebsiteEvents=require(_0x0bc8('0x0'));var events=['save',_0x0bc8('0x1'),_0x0bc8('0x2')];function createListener(_0x20e2cd,_0x3f1d33){return function(_0x399b6e){_0x3f1d33[_0x0bc8('0x3')](_0x20e2cd,_0x399b6e);};}function removeListener(_0x3d0574,_0x505b72){return function(){ChatWebsiteEvents[_0x0bc8('0x4')](_0x3d0574,_0x505b72);};}exports[_0x0bc8('0x5')]=function(_0x3c0d7a){for(var _0x28602b=0x0,_0x6a3e3e=events[_0x0bc8('0x6')];_0x28602b<_0x6a3e3e;_0x28602b++){var _0x201e2a=events[_0x28602b];var _0x3029cf=createListener('chatWebsite:'+_0x201e2a,_0x3c0d7a);ChatWebsiteEvents['on'](_0x201e2a,_0x3029cf);}};
\ No newline at end of file
+var _0x6df0=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x2ad3d4,_0x17cc94){var _0x268254=function(_0xfb2ec){while(--_0xfb2ec){_0x2ad3d4['push'](_0x2ad3d4['shift']());}};_0x268254(++_0x17cc94);}(_0x6df0,0x18a));var _0x06df=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x6df0[_0x37ffea];return _0x2e2615;};'use strict';var ChatWebsiteEvents=require(_0x06df('0x0'));var events=[_0x06df('0x1'),_0x06df('0x2'),_0x06df('0x3')];function createListener(_0x33c327,_0x2169e6){return function(_0x264f8b){_0x2169e6[_0x06df('0x4')](_0x33c327,_0x264f8b);};}function removeListener(_0xc374f4,_0x2560bc){return function(){ChatWebsiteEvents[_0x06df('0x5')](_0xc374f4,_0x2560bc);};}exports[_0x06df('0x6')]=function(_0x201535){for(var _0x43b36f=0x0,_0x762a12=events[_0x06df('0x7')];_0x43b36f<_0x762a12;_0x43b36f++){var _0x34f247=events[_0x43b36f];var _0x24952a=createListener(_0x06df('0x8')+_0x34f247,_0x201535);ChatWebsiteEvents['on'](_0x34f247,_0x24952a);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index ac486df..e381044 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 _0xf53a=['removeAnswers','removeAgents','exports','multer','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','/:id/logo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','root','%s-%s','now','single','file','addLogo','diskStorage','join','server/files/images/avatars/','originalname','addAvatar','format','addCustomerAvatar','addSystemAvatar','attachments','offline-chat','ensureDir','extname','/:id/offline','any','/:id/interactions','/:id/proactive_actions','addProactiveActions','addAgents','delete'];(function(_0x447d04,_0x17d2ce){var _0x36a9e7=function(_0x49aa85){while(--_0x49aa85){_0x447d04['push'](_0x447d04['shift']());}};_0x36a9e7(++_0x17d2ce);}(_0xf53a,0x85));var _0xaf53=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xf53a[_0x576170];return _0x397c70;};'use strict';var multer=require(_0xaf53('0x0'));var util=require('util');var path=require(_0xaf53('0x1'));var timeout=require(_0xaf53('0x2'));var express=require(_0xaf53('0x3'));var router=express[_0xaf53('0x4')]();var fs_extra=require(_0xaf53('0x5'));var auth=require(_0xaf53('0x6'));var interaction=require(_0xaf53('0x7'));var config=require(_0xaf53('0x8'));var controller=require(_0xaf53('0x9'));router[_0xaf53('0xa')]('/',auth[_0xaf53('0xb')](),controller[_0xaf53('0xc')]);router[_0xaf53('0xa')](_0xaf53('0xd'),auth[_0xaf53('0xb')](),controller[_0xaf53('0xe')]);router[_0xaf53('0xa')](_0xaf53('0xf'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x10')]);router['get'](_0xaf53('0x11'),auth[_0xaf53('0xb')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xaf53('0xa')](_0xaf53('0x12'),controller['getLogo']);router[_0xaf53('0xa')](_0xaf53('0x13'),controller['getAvatar']);router['get'](_0xaf53('0x14'),controller['getCustomerAvatar']);router[_0xaf53('0xa')](_0xaf53('0x15'),controller[_0xaf53('0x16')]);router[_0xaf53('0xa')]('/:id/interactions',auth[_0xaf53('0xb')](),controller[_0xaf53('0x17')]);router[_0xaf53('0xa')](_0xaf53('0x18'),controller['getSnippet']);router[_0xaf53('0xa')](_0xaf53('0x19'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x1a')]);router[_0xaf53('0xa')]('/:id/proactive_actions',auth[_0xaf53('0xb')](),controller[_0xaf53('0x1b')]);router[_0xaf53('0xa')]('/:id/fields',controller[_0xaf53('0x1c')]);router[_0xaf53('0xa')](_0xaf53('0x1d'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x1e')]);router['get'](_0xaf53('0x1f'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x20')]);router[_0xaf53('0x21')]('/',auth[_0xaf53('0xb')](),controller[_0xaf53('0x22')]);router[_0xaf53('0x21')](_0xaf53('0x11'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x23')]);router[_0xaf53('0x21')](_0xaf53('0x24'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43ffbf,_0x29980c,_0x4097f8){_0x4097f8(null,path['join'](config[_0xaf53('0x25')],'server/files/images/logos/'));},'filename':function(_0x240c69,_0x3c711a,_0x30453f){_0x30453f(null,util['format'](_0xaf53('0x26'),Date[_0xaf53('0x27')](),_0x3c711a['originalname']));}})});router['post'](_0xaf53('0x12'),upload[_0xaf53('0x28')](_0xaf53('0x29')),controller[_0xaf53('0x2a')]);var upload=multer({'storage':multer[_0xaf53('0x2b')]({'destination':function(_0x1e62ad,_0xe0a3d5,_0x335cb8){_0x335cb8(null,path[_0xaf53('0x2c')](config[_0xaf53('0x25')],_0xaf53('0x2d')));},'filename':function(_0x5f5025,_0x599a23,_0x434fa3){_0x434fa3(null,util['format'](_0xaf53('0x26'),Date['now'](),_0x599a23[_0xaf53('0x2e')]));}})});router['post']('/:id/avatar',upload[_0xaf53('0x28')]('file'),controller[_0xaf53('0x2f')]);var upload=multer({'storage':multer[_0xaf53('0x2b')]({'destination':function(_0x3a1c4d,_0xea548e,_0x22234f){_0x22234f(null,path[_0xaf53('0x2c')](config['root'],_0xaf53('0x2d')));},'filename':function(_0x54181b,_0x15f3fb,_0x4bb7d5){_0x4bb7d5(null,util[_0xaf53('0x30')](_0xaf53('0x26'),Date[_0xaf53('0x27')](),_0x15f3fb[_0xaf53('0x2e')]));}})});router[_0xaf53('0x21')](_0xaf53('0x14'),upload[_0xaf53('0x28')](_0xaf53('0x29')),controller[_0xaf53('0x31')]);var upload=multer({'storage':multer[_0xaf53('0x2b')]({'destination':function(_0x15e1bc,_0x257e5a,_0x44dba5){_0x44dba5(null,path[_0xaf53('0x2c')](config[_0xaf53('0x25')],_0xaf53('0x2d')));},'filename':function(_0x297cec,_0xc8ddec,_0x4b6241){_0x4b6241(null,util['format'](_0xaf53('0x26'),Date[_0xaf53('0x27')](),_0xc8ddec[_0xaf53('0x2e')]));}})});router[_0xaf53('0x21')](_0xaf53('0x15'),upload[_0xaf53('0x28')](_0xaf53('0x29')),controller[_0xaf53('0x32')]);router[_0xaf53('0x21')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xaf53('0x2b')]({'destination':function(_0xe24aaf,_0x5b0625,_0x6c78c7){const _0x3bbe58=path[_0xaf53('0x2c')](config['root'],'server/files',_0xaf53('0x33'),_0xaf53('0x34'));fs_extra[_0xaf53('0x35')](_0x3bbe58,function(){_0x6c78c7(null,_0x3bbe58);});},'filename':function(_0x4bb7f2,_0x4cd7f8,_0x1c16a4){const _0x340ca2=_0x4cd7f8['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x574780=path[_0xaf53('0x36')](_0x340ca2);const _0x5ba018=Date[_0xaf53('0x27')]()+'-'+_0x340ca2['replace'](_0x574780,'')+_0x574780;_0x1c16a4(null,_0x5ba018);}})});router[_0xaf53('0x21')](_0xaf53('0x37'),offlineUploadMulter[_0xaf53('0x38')](),controller['offline']);router[_0xaf53('0x21')](_0xaf53('0x39'),auth[_0xaf53('0xb')](),controller['addInteraction']);router[_0xaf53('0x21')]('/:id/applications',auth[_0xaf53('0xb')](),controller['addApplications']);router[_0xaf53('0x21')](_0xaf53('0x3a'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x3b')]);router[_0xaf53('0x21')](_0xaf53('0x1f'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x3c')]);router['put']('/:id',auth[_0xaf53('0xb')](),controller['update']);router[_0xaf53('0x3d')](_0xaf53('0xf'),auth[_0xaf53('0xb')](),controller['destroy']);router[_0xaf53('0x3d')](_0xaf53('0x11'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xaf53('0x24'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x3e')]);router[_0xaf53('0x3d')](_0xaf53('0x1f'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x3f')]);module[_0xaf53('0x40')]=router;
\ No newline at end of file
+var _0x8b1e=['/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b1e,0x175));var _0xe8b1=function(_0x238b1e,_0x3cdef9){_0x238b1e=_0x238b1e-0x0;var _0x175491=_0x8b1e[_0x238b1e];return _0x175491;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe8b1('0x0'));var timeout=require(_0xe8b1('0x1'));var express=require(_0xe8b1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8b1('0x3'));var interaction=require(_0xe8b1('0x4'));var config=require(_0xe8b1('0x5'));var controller=require(_0xe8b1('0x6'));router[_0xe8b1('0x7')]('/',auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x9')]);router['get'](_0xe8b1('0xa'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0xb')]);router[_0xe8b1('0x7')](_0xe8b1('0xc'),auth['isAuthenticated'](),controller[_0xe8b1('0xd')]);router['get'](_0xe8b1('0xe'),auth[_0xe8b1('0x8')](),controller['getDispositions']);router[_0xe8b1('0x7')](_0xe8b1('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xe8b1('0x7')](_0xe8b1('0x10'),controller[_0xe8b1('0x11')]);router[_0xe8b1('0x7')]('/:id/avatar',controller['getAvatar']);router[_0xe8b1('0x7')]('/:id/customer_avatar',controller[_0xe8b1('0x12')]);router[_0xe8b1('0x7')](_0xe8b1('0x13'),controller['getSystemAvatar']);router['get'](_0xe8b1('0x14'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x15')]);router[_0xe8b1('0x7')]('/:id/snippet',controller[_0xe8b1('0x16')]);router[_0xe8b1('0x7')](_0xe8b1('0x17'),auth['isAuthenticated'](),controller[_0xe8b1('0x18')]);router['get'](_0xe8b1('0x19'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xe8b1('0x7')](_0xe8b1('0x1a'),controller[_0xe8b1('0x1b')]);router[_0xe8b1('0x7')](_0xe8b1('0x1c'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x1d')]);router['get']('/:id/users',auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x1e')]);router[_0xe8b1('0x1f')]('/',auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x20')]);router[_0xe8b1('0x1f')](_0xe8b1('0xe'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x21')]);router[_0xe8b1('0x1f')](_0xe8b1('0xf'),auth[_0xe8b1('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x13f451,_0x760ff2,_0x296e0f){_0x296e0f(null,path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x25')));},'filename':function(_0x54ebc7,_0x2b471c,_0x34ab8f){_0x34ab8f(null,util[_0xe8b1('0x26')](_0xe8b1('0x27'),Date[_0xe8b1('0x28')](),_0x2b471c[_0xe8b1('0x29')]));}})});router[_0xe8b1('0x1f')](_0xe8b1('0x10'),upload[_0xe8b1('0x2a')](_0xe8b1('0x2b')),controller[_0xe8b1('0x2c')]);var upload=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x364423,_0x4a5d1e,_0x3aa5a6){_0x3aa5a6(null,path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x2d')));},'filename':function(_0x57c362,_0x14e0f0,_0x215c78){_0x215c78(null,util['format'](_0xe8b1('0x27'),Date[_0xe8b1('0x28')](),_0x14e0f0['originalname']));}})});router[_0xe8b1('0x1f')](_0xe8b1('0x2e'),upload[_0xe8b1('0x2a')](_0xe8b1('0x2b')),controller[_0xe8b1('0x2f')]);var upload=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x212fd8,_0x491183,_0x124979){_0x124979(null,path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x2d')));},'filename':function(_0xe94d90,_0x13bb30,_0x18083b){_0x18083b(null,util[_0xe8b1('0x26')](_0xe8b1('0x27'),Date[_0xe8b1('0x28')](),_0x13bb30['originalname']));}})});router[_0xe8b1('0x1f')]('/:id/customer_avatar',upload['single'](_0xe8b1('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x356f7a,_0x36e0ca,_0x97c3f9){_0x97c3f9(null,path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x2d')));},'filename':function(_0xa0b936,_0x4ccbc0,_0x163a70){_0x163a70(null,util[_0xe8b1('0x26')](_0xe8b1('0x27'),Date[_0xe8b1('0x28')](),_0x4ccbc0[_0xe8b1('0x29')]));}})});router[_0xe8b1('0x1f')]('/:id/system_avatar',upload[_0xe8b1('0x2a')](_0xe8b1('0x2b')),controller[_0xe8b1('0x30')]);router[_0xe8b1('0x1f')](_0xe8b1('0x31'),controller[_0xe8b1('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x5c33e0,_0x5f1619,_0x4e1dc7){const _0x4cc22e=path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x33'),_0xe8b1('0x34'),_0xe8b1('0x35'));fs_extra[_0xe8b1('0x36')](_0x4cc22e,function(){_0x4e1dc7(null,_0x4cc22e);});},'filename':function(_0x37258a,_0x368fff,_0x5efc19){const _0x49e2ab=_0x368fff[_0xe8b1('0x29')][_0xe8b1('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x176f2b=path['extname'](_0x49e2ab);const _0x1bcf9b=Date[_0xe8b1('0x28')]()+'-'+_0x49e2ab[_0xe8b1('0x37')](_0x176f2b,'')+_0x176f2b;_0x5efc19(null,_0x1bcf9b);}})});router[_0xe8b1('0x1f')](_0xe8b1('0x38'),offlineUploadMulter[_0xe8b1('0x39')](),controller['offline']);router[_0xe8b1('0x1f')](_0xe8b1('0x14'),auth[_0xe8b1('0x8')](),controller['addInteraction']);router[_0xe8b1('0x1f')]('/:id/applications',auth[_0xe8b1('0x8')](),controller['addApplications']);router[_0xe8b1('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xe8b1('0x1f')](_0xe8b1('0x3a'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x3b')]);router['put'](_0xe8b1('0xc'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x3c')]);router[_0xe8b1('0x3d')](_0xe8b1('0xc'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x3e')]);router['delete'](_0xe8b1('0xe'),auth['isAuthenticated'](),controller[_0xe8b1('0x3f')]);router[_0xe8b1('0x3d')](_0xe8b1('0xf'),auth[_0xe8b1('0x8')](),controller['removeAnswers']);router[_0xe8b1('0x3d')](_0xe8b1('0x3a'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x40')]);module[_0xe8b1('0x41')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index ecd1bdf..6f8378c 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 _0xe801=['../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x466bc5,_0x3a0f2a){var _0x138952=function(_0x392fa2){while(--_0x392fa2){_0x466bc5['push'](_0x466bc5['shift']());}};_0x138952(++_0x3a0f2a);}(_0xe801,0xfe));var _0x1e80=function(_0x2e28ca,_0x4d6a16){_0x2e28ca=_0x2e28ca-0x0;var _0x45d143=_0xe801[_0x2e28ca];return _0x45d143;};var beaverLogger=require(_0x1e80('0x0'));var express=require(_0x1e80('0x1'));var auth=require(_0x1e80('0x2'));var config=require(_0x1e80('0x3'));var router=express[_0x1e80('0x4')]();var isProduction=config[_0x1e80('0x5')]===_0x1e80('0x6')||![];function clientSideLogs(_0x50f3b5,_0x4e1af4,_0x40cbda){var _0x23c4d2=_0x50f3b5[_0x1e80('0x7')][_0x1e80('0x8')](_0x1e80('0x9'));if(!_0x23c4d2){throw new Error(_0x1e80('0xa'));}return beaverLogger[_0x1e80('0xb')]({'uri':_0x1e80('0xc'),'logger':_0x23c4d2,'enableCors':!isProduction})(_0x50f3b5,_0x4e1af4,_0x40cbda);}router[_0x1e80('0xd')](auth[_0x1e80('0xe')](),clientSideLogs);module[_0x1e80('0xf')]=router;
\ No newline at end of file
+var _0x647c=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x21549c,_0x24d668){var _0x25ad23=function(_0x517d14){while(--_0x517d14){_0x21549c['push'](_0x21549c['shift']());}};_0x25ad23(++_0x24d668);}(_0x647c,0x10c));var _0xc647=function(_0x59bd6a,_0x540db8){_0x59bd6a=_0x59bd6a-0x0;var _0x54ffd0=_0x647c[_0x59bd6a];return _0x54ffd0;};var beaverLogger=require(_0xc647('0x0'));var express=require(_0xc647('0x1'));var auth=require(_0xc647('0x2'));var config=require(_0xc647('0x3'));var router=express['Router']();var isProduction=config[_0xc647('0x4')]===_0xc647('0x5')||![];function clientSideLogs(_0x40629c,_0x2dedb5,_0x15726f){var _0x818d86=_0x40629c[_0xc647('0x6')][_0xc647('0x7')]('client-side-logger');if(!_0x818d86){throw new Error(_0xc647('0x8'));}return beaverLogger[_0xc647('0x9')]({'uri':_0xc647('0xa'),'logger':_0x818d86,'enableCors':!isProduction})(_0x40629c,_0x2dedb5,_0x15726f);}router[_0xc647('0xb')](auth[_0xc647('0xc')](),clientSideLogs);module[_0xc647('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index dd5de88..b957fce 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 _0x6fc7=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure'];(function(_0x57259d,_0x5da1b1){var _0x3c4c75=function(_0x18f5f0){while(--_0x18f5f0){_0x57259d['push'](_0x57259d['shift']());}};_0x3c4c75(++_0x5da1b1);}(_0x6fc7,0x8f));var _0x76fc=function(_0x39410c,_0x4b8259){_0x39410c=_0x39410c-0x0;var _0x11e99a=_0x6fc7[_0x39410c];return _0x11e99a;};'use strict';var Sequelize=require(_0x76fc('0x0'));module[_0x76fc('0x1')]={'name':{'type':Sequelize[_0x76fc('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x76fc('0x3')](_0x76fc('0x4'),_0x76fc('0x5'),_0x76fc('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x76fc('0x7'),_0x76fc('0x8'))},'data1':{'type':Sequelize[_0x76fc('0x2')],'comment':_0x76fc('0x9')},'data2':{'type':Sequelize[_0x76fc('0x2')],'comment':_0x76fc('0xa')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x76fc('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0x76fc('0xc')},'data6':{'type':Sequelize[_0x76fc('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x76fc('0xd')],'comment':_0x76fc('0xe')}};
\ No newline at end of file
+var _0x2e92=['Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x22e429,_0x274567){var _0x39bde9=function(_0x34d023){while(--_0x34d023){_0x22e429['push'](_0x22e429['shift']());}};_0x39bde9(++_0x274567);}(_0x2e92,0xdb));var _0x22e9=function(_0x5927f8,_0x420239){_0x5927f8=_0x5927f8-0x0;var _0x399a2f=_0x2e92[_0x5927f8];return _0x399a2f;};'use strict';var Sequelize=require(_0x22e9('0x0'));module[_0x22e9('0x1')]={'name':{'type':Sequelize[_0x22e9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x22e9('0x3')](_0x22e9('0x4'),_0x22e9('0x5'),_0x22e9('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x22e9('0x3')](_0x22e9('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x22e9('0x2')],'comment':_0x22e9('0x8')},'data2':{'type':Sequelize[_0x22e9('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x22e9('0x2')],'comment':_0x22e9('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x22e9('0xa')},'data5':{'type':Sequelize[_0x22e9('0xb')],'comment':_0x22e9('0xc')},'data6':{'type':Sequelize[_0x22e9('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x22e9('0xb')],'comment':_0x22e9('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 7ef932c..b834ed5 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 _0x3722=['redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','update','then','error','stack','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','name','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','include','options','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults'];(function(_0x38bd4c,_0x44ee91){var _0x3284cc=function(_0x5365b1){while(--_0x5365b1){_0x38bd4c['push'](_0x38bd4c['shift']());}};_0x3284cc(++_0x44ee91);}(_0x3722,0x1c4));var _0x2372=function(_0x3faea4,_0x410619){_0x3faea4=_0x3faea4-0x0;var _0x24f357=_0x3722[_0x3faea4];return _0x24f357;};'use strict';var _=require(_0x2372('0x0'));var Redis=require(_0x2372('0x1'));var qs=require(_0x2372('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x2372('0x3'))(_0x2372('0x4'));var db=require(_0x2372('0x5'))['db'];var oauth=require(_0x2372('0x6'));config['redis']=_[_0x2372('0x7')](config[_0x2372('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2372('0x9'))(new Redis(config[_0x2372('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x52cb40,_0x20a00d){_0x20a00d=_0x20a00d||0xcc;return function(_0x39629d){if(_0x39629d){return _0x52cb40[_0x2372('0xa')](_0x20a00d);}return _0x52cb40[_0x2372('0xb')](_0x20a00d)[_0x2372('0xc')]();};}function respondWithResult(_0x39649c,_0x4bee6e){_0x4bee6e=_0x4bee6e||0xc8;return function(_0x1bde9a){if(_0x1bde9a){return _0x39649c[_0x2372('0xb')](_0x4bee6e)[_0x2372('0xd')](_0x1bde9a);}};}function respondWithFilteredResult(_0x5c4de5,_0x93800c){return function(_0x14da25){if(_0x14da25){var _0x21ad06=typeof _0x93800c[_0x2372('0xe')]===_0x2372('0xf')&&typeof _0x93800c[_0x2372('0x10')]===_0x2372('0xf');var _0x2141f3=_0x14da25['count'];var _0x420a92=_0x21ad06?0x0:_0x93800c[_0x2372('0xe')];var _0x3b974f=_0x21ad06?_0x14da25[_0x2372('0x11')]:_0x93800c[_0x2372('0xe')]+_0x93800c[_0x2372('0x10')];var _0x42b79a;if(_0x3b974f>=_0x2141f3){_0x3b974f=_0x2141f3;_0x42b79a=0xc8;}else{_0x42b79a=0xce;}_0x5c4de5[_0x2372('0xb')](_0x42b79a);return _0x5c4de5['set']('Content-Range',_0x420a92+'-'+_0x3b974f+'/'+_0x2141f3)[_0x2372('0xd')](_0x14da25);}return null;};}function saveUpdates(_0x46ff6a){return function(_0x3a5865){if(_0x3a5865){return _0x3a5865[_0x2372('0x12')](_0x46ff6a)[_0x2372('0x13')](function(_0x5ba21d){return _0x5ba21d;});}return null;};}function removeEntity(_0x6adba3){return function(_0x387fc7){if(_0x387fc7){return _0x387fc7['destroy']()[_0x2372('0x13')](function(){_0x6adba3[_0x2372('0xb')](0xcc)[_0x2372('0xc')]();});}};}function handleEntityNotFound(_0x4f4da8){return function(_0x326ba7){if(!_0x326ba7){_0x4f4da8[_0x2372('0xa')](0x194);}return _0x326ba7;};}function handleError(_0x2e9b4b,_0x500195){_0x500195=_0x500195||0x1f4;return function(_0x2c5a1d){logger[_0x2372('0x14')](_0x2c5a1d[_0x2372('0x15')]);if(_0x2c5a1d['name']){delete _0x2c5a1d['name'];}_0x2e9b4b['status'](_0x500195)[_0x2372('0x16')](_0x2c5a1d);};}function maskClientSecret(_0x40583b){return _[_0x2372('0x17')](_0x40583b['slice'](0x0,0x3),0x14,'*');}exports[_0x2372('0x18')]=function(_0x55b444,_0x29c9a0){var _0x5e288a={},_0x444458={},_0x5f40ee={'count':0x0,'rows':[]};var _0x2a3eb4=_[_0x2372('0x19')](db[_0x2372('0x1a')][_0x2372('0x1b')],function(_0x3c9973){return{'name':_0x3c9973[_0x2372('0x1c')],'type':_0x3c9973['type'][_0x2372('0x1d')]};});_0x444458[_0x2372('0x1e')]=_['map'](_0x2a3eb4,'name');_0x444458['query']=_[_0x2372('0x1f')](_0x55b444[_0x2372('0x20')]);_0x444458[_0x2372('0x21')]=_['intersection'](_0x444458[_0x2372('0x1e')],_0x444458[_0x2372('0x20')]);_0x5e288a[_0x2372('0x22')]=_[_0x2372('0x23')](_0x444458[_0x2372('0x1e')],qs[_0x2372('0x24')](_0x55b444['query'][_0x2372('0x24')]));_0x5e288a['attributes']=_0x5e288a[_0x2372('0x22')][_0x2372('0x25')]?_0x5e288a[_0x2372('0x22')]:_0x444458[_0x2372('0x1e')];if(!_0x55b444[_0x2372('0x20')][_0x2372('0x26')]('nolimit')){_0x5e288a[_0x2372('0x10')]=qs[_0x2372('0x10')](_0x55b444['query'][_0x2372('0x10')]);_0x5e288a['offset']=qs[_0x2372('0xe')](_0x55b444[_0x2372('0x20')][_0x2372('0xe')]);}_0x5e288a[_0x2372('0x27')]=qs[_0x2372('0x28')](_0x55b444[_0x2372('0x20')][_0x2372('0x28')]);_0x5e288a[_0x2372('0x29')]=qs[_0x2372('0x21')](_[_0x2372('0x2a')](_0x55b444[_0x2372('0x20')],_0x444458[_0x2372('0x21')]),_0x2a3eb4);if(_0x55b444[_0x2372('0x20')][_0x2372('0x2b')]){_0x5e288a[_0x2372('0x29')]=_[_0x2372('0x2c')](_0x5e288a[_0x2372('0x29')],{'$or':_['map'](_0x2a3eb4,function(_0x520a4a){if(_0x520a4a[_0x2372('0x2d')]!=='VIRTUAL'){var _0x124713={};_0x124713[_0x520a4a[_0x2372('0x2e')]]={'$like':'%'+_0x55b444[_0x2372('0x20')][_0x2372('0x2b')]+'%'};return _0x124713;}})});}_0x5e288a=_[_0x2372('0x2c')]({},_0x5e288a,_0x55b444['options']);var _0x2314d7={'where':_0x5e288a[_0x2372('0x29')]};return db[_0x2372('0x1a')][_0x2372('0x11')](_0x2314d7)[_0x2372('0x13')](function(_0x493f4f){_0x5f40ee[_0x2372('0x11')]=_0x493f4f;if(_0x55b444[_0x2372('0x20')]['includeAll']){_0x5e288a['include']=[{'all':!![]}];}return db[_0x2372('0x1a')]['findAll'](_0x5e288a);})['then'](function(_0x2e1e03){_0x5f40ee[_0x2372('0x2f')]=_[_0x2372('0x19')](_0x2e1e03,function(_0x39fb16){if(_0x39fb16[_0x2372('0x30')]===_0x2372('0x31')){var _0x11b011=encryptor[_0x2372('0x32')](_0x39fb16[_0x2372('0x33')]);_0x39fb16['data3']=maskClientSecret(_0x11b011);}return _0x39fb16;});return _0x5f40ee;})[_0x2372('0x13')](respondWithFilteredResult(_0x29c9a0,_0x5e288a))[_0x2372('0x34')](handleError(_0x29c9a0,null));};exports[_0x2372('0x35')]=function(_0x5f2f35,_0x42557d){var _0x4cd0c7={'raw':!![],'where':{'id':_0x5f2f35[_0x2372('0x36')]['id']}},_0x5c82b1={};_0x5c82b1[_0x2372('0x1e')]=_[_0x2372('0x1f')](db[_0x2372('0x1a')][_0x2372('0x1b')]);_0x5c82b1['query']=_['keys'](_0x5f2f35[_0x2372('0x20')]);_0x5c82b1[_0x2372('0x21')]=_[_0x2372('0x23')](_0x5c82b1[_0x2372('0x1e')],_0x5c82b1[_0x2372('0x20')]);_0x4cd0c7[_0x2372('0x22')]=_[_0x2372('0x23')](_0x5c82b1[_0x2372('0x1e')],qs[_0x2372('0x24')](_0x5f2f35[_0x2372('0x20')][_0x2372('0x24')]));_0x4cd0c7['attributes']=_0x4cd0c7['attributes'][_0x2372('0x25')]?_0x4cd0c7['attributes']:_0x5c82b1[_0x2372('0x1e')];if(_0x5f2f35['query']['includeAll']){_0x4cd0c7[_0x2372('0x37')]=[{'all':!![]}];}_0x4cd0c7=_['merge']({},_0x4cd0c7,_0x5f2f35[_0x2372('0x38')]);return db[_0x2372('0x1a')][_0x2372('0x39')](_0x4cd0c7)[_0x2372('0x13')](handleEntityNotFound(_0x42557d,null))[_0x2372('0x13')](function(_0x42ce78){if(_0x42ce78[_0x2372('0x30')]==='MicrosoftAzure'){var _0xe8f171=encryptor[_0x2372('0x32')](_0x42ce78[_0x2372('0x33')]);_0x42ce78[_0x2372('0x33')]=maskClientSecret(_0xe8f171);}return _0x42ce78;})[_0x2372('0x13')](respondWithResult(_0x42557d,null))[_0x2372('0x34')](handleError(_0x42557d,null));};exports[_0x2372('0x3a')]=function(_0x4e0c93,_0x5e52cb){if(!_0x4e0c93[_0x2372('0x3b')][_0x2372('0x2e')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4e0c93[_0x2372('0x3b')][_0x2372('0x30')])throw new Error(_0x2372('0x3c'));var _0x2c493b=db['CloudProvider'][_0x2372('0x1b')][_0x2372('0x30')][_0x2372('0x3d')];if(!_0x2c493b[_0x2372('0x3e')](_0x4e0c93['body']['service']))throw new Error(_0x2372('0x3f')+_0x2c493b[_0x2372('0x40')](',\x20'));if(_0x4e0c93[_0x2372('0x3b')]['service']===_0x2372('0x31')&&_0x4e0c93[_0x2372('0x3b')]['data3']){_0x4e0c93['body']['data3']=encryptor[_0x2372('0x41')](_0x4e0c93[_0x2372('0x3b')][_0x2372('0x33')]);}return db[_0x2372('0x1a')][_0x2372('0x3a')](_0x4e0c93['body'],{})[_0x2372('0x13')](respondWithResult(_0x5e52cb,0xc9))[_0x2372('0x34')](handleError(_0x5e52cb,null));};exports['update']=function(_0x5deb09,_0x533900){if(_0x5deb09[_0x2372('0x3b')]['id']){delete _0x5deb09[_0x2372('0x3b')]['id'];}return db[_0x2372('0x1a')]['find']({'where':{'id':_0x5deb09[_0x2372('0x36')]['id']}})[_0x2372('0x13')](handleEntityNotFound(_0x533900,null))[_0x2372('0x13')](function(_0x18f46e){if(_0x18f46e[_0x2372('0x30')]==='MicrosoftAzure'&&_0x5deb09['body'][_0x2372('0x33')]){_0x5deb09[_0x2372('0x3b')][_0x2372('0x33')]=encryptor[_0x2372('0x41')](_0x5deb09[_0x2372('0x3b')][_0x2372('0x33')]);}return _0x18f46e;})[_0x2372('0x13')](saveUpdates(_0x5deb09['body'],null))['then'](respondWithResult(_0x533900,null))[_0x2372('0x34')](handleError(_0x533900,null));};exports[_0x2372('0x42')]=function(_0x5014a2,_0xd59051){return db['CloudProvider'][_0x2372('0x39')]({'where':{'id':_0x5014a2[_0x2372('0x36')]['id']}})[_0x2372('0x13')](handleEntityNotFound(_0xd59051,null))[_0x2372('0x13')](removeEntity(_0xd59051,null))[_0x2372('0x34')](handleError(_0xd59051,null));};exports[_0x2372('0x43')]=function(_0x495ef3,_0x21df07){return db[_0x2372('0x1a')]['findOne']({'where':{'id':_0x495ef3['params']['id']},'raw':!![]})[_0x2372('0x13')](function(_0x26bab9){if(!_0x26bab9)return _0x21df07['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x26bab9,_0x495ef3[_0x2372('0x44')]['id'])};})[_0x2372('0x13')](respondWithResult(_0x21df07,null))[_0x2372('0x34')](handleError(_0x21df07,null));};exports[_0x2372('0x45')]=function(_0x2e6099,_0x2eca00){var _0x11d4e7=_0x2e6099[_0x2372('0x3b')];var _0x4fdecc;var _0x4e11d2;if(_0x11d4e7[_0x2372('0x14')])throw _0x11d4e7;redis[_0x2372('0x46')](_0x11d4e7[_0x2372('0x47')])[_0x2372('0x13')](function(_0x3c1608){if(!_0x3c1608)throw new Error(_0x2372('0x48'));_0x4fdecc=JSON['parse'](_0x3c1608);var _0x2903b3=Buffer[_0x2372('0x49')](_0x11d4e7[_0x2372('0x47')],_0x2372('0x4a'))[_0x2372('0x4b')]('ascii');_0x4e11d2=JSON[_0x2372('0x4c')](_0x2903b3);if(!oauth[_0x2372('0x4d')](_0x11d4e7[_0x2372('0x4e')],_0x4fdecc[_0x2372('0x4f')]))throw new Error(_0x2372('0x50'));redis[_0x2372('0x51')](_0x11d4e7['state']);return oauth[_0x2372('0x52')](_0x11d4e7[_0x2372('0x53')],_0x4fdecc);})['then'](function(_0x5a1d20){_0x4fdecc[_0x2372('0x54')]=_0x5a1d20[_0x2372('0x55')];_0x4fdecc[_0x2372('0x56')]=_0x5a1d20[_0x2372('0x57')];return db[_0x2372('0x1a')][_0x2372('0x12')]({'data5':_0x4fdecc[_0x2372('0x54')],'data6':_0x4fdecc['data6']},{'where':{'id':_0x4fdecc['id']}});})['then'](function(){oauth[_0x2372('0x58')](_0x4fdecc);socket[_0x2372('0x59')](_0x2372('0x5a'),{'id':_0x4e11d2['id']});return;})[_0x2372('0x13')](respondWithStatusCode(_0x2eca00,null))[_0x2372('0x34')](function(_0x3bfb92){if(_0x4e11d2){socket['emit']('microsoftAuthorization:error',{'id':_0x4e11d2['id']});}if(!_0x4fdecc){logger[_0x2372('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0x3bfb92);return _0x2eca00[_0x2372('0xb')](0x1f4)[_0x2372('0x16')](_0x3bfb92['message']);}logger[_0x2372('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4fdecc['id'],JSON[_0x2372('0x5b')](_0x3bfb92));});};
\ No newline at end of file
+var _0xc711=['includeAll','include','options','MicrosoftAzure','create','body','Service\x20parameter\x20not\x20specified','includes','join','find','params','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','status','end','offset','undefined','limit','set','json','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','keys','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','count','rows','service','decryptString','data3','catch','show','length'];(function(_0x15b281,_0x571cb4){var _0x372ee8=function(_0x16f32f){while(--_0x16f32f){_0x15b281['push'](_0x15b281['shift']());}};_0x372ee8(++_0x571cb4);}(_0xc711,0x13b));var _0x1c71=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0xc711[_0x2cd1fb];return _0x48fd2b;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x1c71('0x0'));var config=require('../../config/environment');var logger=require(_0x1c71('0x1'))(_0x1c71('0x2'));var db=require(_0x1c71('0x3'))['db'];var oauth=require(_0x1c71('0x4'));config[_0x1c71('0x5')]=_[_0x1c71('0x6')](config[_0x1c71('0x5')],{'host':_0x1c71('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c71('0x5')]));var redis=new Redis(config[_0x1c71('0x5')]);function respondWithStatusCode(_0x361251,_0x295e12){_0x295e12=_0x295e12||0xcc;return function(_0x114cfe){if(_0x114cfe){return _0x361251['sendStatus'](_0x295e12);}return _0x361251[_0x1c71('0x8')](_0x295e12)[_0x1c71('0x9')]();};}function respondWithResult(_0x507ddc,_0x1b1416){_0x1b1416=_0x1b1416||0xc8;return function(_0x29f651){if(_0x29f651){return _0x507ddc[_0x1c71('0x8')](_0x1b1416)['json'](_0x29f651);}};}function respondWithFilteredResult(_0x1e0acf,_0x1d0908){return function(_0x1631e1){if(_0x1631e1){var _0x46cb3f=typeof _0x1d0908[_0x1c71('0xa')]===_0x1c71('0xb')&&typeof _0x1d0908['limit']==='undefined';var _0x384a81=_0x1631e1['count'];var _0x26440f=_0x46cb3f?0x0:_0x1d0908['offset'];var _0x56b325=_0x46cb3f?_0x1631e1['count']:_0x1d0908[_0x1c71('0xa')]+_0x1d0908[_0x1c71('0xc')];var _0x8c04b7;if(_0x56b325>=_0x384a81){_0x56b325=_0x384a81;_0x8c04b7=0xc8;}else{_0x8c04b7=0xce;}_0x1e0acf['status'](_0x8c04b7);return _0x1e0acf[_0x1c71('0xd')]('Content-Range',_0x26440f+'-'+_0x56b325+'/'+_0x384a81)[_0x1c71('0xe')](_0x1631e1);}return null;};}function saveUpdates(_0x2bc642){return function(_0xe6b8b0){if(_0xe6b8b0){return _0xe6b8b0[_0x1c71('0xf')](_0x2bc642)[_0x1c71('0x10')](function(_0x50aa36){return _0x50aa36;});}return null;};}function removeEntity(_0x5f31e4){return function(_0x487317){if(_0x487317){return _0x487317[_0x1c71('0x11')]()[_0x1c71('0x10')](function(){_0x5f31e4[_0x1c71('0x8')](0xcc)[_0x1c71('0x9')]();});}};}function handleEntityNotFound(_0x36e1b3){return function(_0x55c78c){if(!_0x55c78c){_0x36e1b3[_0x1c71('0x12')](0x194);}return _0x55c78c;};}function handleError(_0x3b169b,_0x45aab0){_0x45aab0=_0x45aab0||0x1f4;return function(_0x410d02){logger[_0x1c71('0x13')](_0x410d02[_0x1c71('0x14')]);if(_0x410d02['name']){delete _0x410d02[_0x1c71('0x15')];}_0x3b169b[_0x1c71('0x8')](_0x45aab0)[_0x1c71('0x16')](_0x410d02);};}function maskClientSecret(_0x540727){return _[_0x1c71('0x17')](_0x540727[_0x1c71('0x18')](0x0,0x3),0x14,'*');}exports[_0x1c71('0x19')]=function(_0x1f788f,_0x555555){var _0x3282a1={},_0x44e73f={},_0x567c04={'count':0x0,'rows':[]};var _0x56b987=_[_0x1c71('0x1a')](db[_0x1c71('0x1b')][_0x1c71('0x1c')],function(_0x24f7a8){return{'name':_0x24f7a8[_0x1c71('0x1d')],'type':_0x24f7a8[_0x1c71('0x1e')]['key']};});_0x44e73f['model']=_['map'](_0x56b987,_0x1c71('0x15'));_0x44e73f['query']=_[_0x1c71('0x1f')](_0x1f788f[_0x1c71('0x20')]);_0x44e73f['filters']=_['intersection'](_0x44e73f[_0x1c71('0x21')],_0x44e73f[_0x1c71('0x20')]);_0x3282a1[_0x1c71('0x22')]=_[_0x1c71('0x23')](_0x44e73f['model'],qs[_0x1c71('0x24')](_0x1f788f[_0x1c71('0x20')][_0x1c71('0x24')]));_0x3282a1[_0x1c71('0x22')]=_0x3282a1[_0x1c71('0x22')]['length']?_0x3282a1[_0x1c71('0x22')]:_0x44e73f[_0x1c71('0x21')];if(!_0x1f788f[_0x1c71('0x20')][_0x1c71('0x25')](_0x1c71('0x26'))){_0x3282a1[_0x1c71('0xc')]=qs[_0x1c71('0xc')](_0x1f788f['query'][_0x1c71('0xc')]);_0x3282a1[_0x1c71('0xa')]=qs[_0x1c71('0xa')](_0x1f788f['query']['offset']);}_0x3282a1['order']=qs['sort'](_0x1f788f['query'][_0x1c71('0x27')]);_0x3282a1[_0x1c71('0x28')]=qs['filters'](_[_0x1c71('0x29')](_0x1f788f[_0x1c71('0x20')],_0x44e73f['filters']),_0x56b987);if(_0x1f788f['query']['filter']){_0x3282a1['where']=_[_0x1c71('0x2a')](_0x3282a1[_0x1c71('0x28')],{'$or':_['map'](_0x56b987,function(_0xae89b7){if(_0xae89b7[_0x1c71('0x1e')]!==_0x1c71('0x2b')){var _0x8baff7={};_0x8baff7[_0xae89b7['name']]={'$like':'%'+_0x1f788f[_0x1c71('0x20')][_0x1c71('0x2c')]+'%'};return _0x8baff7;}})});}_0x3282a1=_[_0x1c71('0x2a')]({},_0x3282a1,_0x1f788f['options']);var _0x7923cf={'where':_0x3282a1['where']};return db[_0x1c71('0x1b')][_0x1c71('0x2d')](_0x7923cf)[_0x1c71('0x10')](function(_0x3f0760){_0x567c04[_0x1c71('0x2d')]=_0x3f0760;if(_0x1f788f[_0x1c71('0x20')]['includeAll']){_0x3282a1['include']=[{'all':!![]}];}return db[_0x1c71('0x1b')]['findAll'](_0x3282a1);})['then'](function(_0x1f8b36){_0x567c04[_0x1c71('0x2e')]=_[_0x1c71('0x1a')](_0x1f8b36,function(_0x14c63c){if(_0x14c63c[_0x1c71('0x2f')]==='MicrosoftAzure'){var _0x49ba46=encryptor[_0x1c71('0x30')](_0x14c63c[_0x1c71('0x31')]);_0x14c63c[_0x1c71('0x31')]=maskClientSecret(_0x49ba46);}return _0x14c63c;});return _0x567c04;})['then'](respondWithFilteredResult(_0x555555,_0x3282a1))[_0x1c71('0x32')](handleError(_0x555555,null));};exports[_0x1c71('0x33')]=function(_0x390b6f,_0x274e0c){var _0x582e5f={'raw':!![],'where':{'id':_0x390b6f['params']['id']}},_0x9b5c3d={};_0x9b5c3d[_0x1c71('0x21')]=_[_0x1c71('0x1f')](db[_0x1c71('0x1b')]['rawAttributes']);_0x9b5c3d['query']=_[_0x1c71('0x1f')](_0x390b6f['query']);_0x9b5c3d['filters']=_[_0x1c71('0x23')](_0x9b5c3d[_0x1c71('0x21')],_0x9b5c3d[_0x1c71('0x20')]);_0x582e5f[_0x1c71('0x22')]=_[_0x1c71('0x23')](_0x9b5c3d[_0x1c71('0x21')],qs[_0x1c71('0x24')](_0x390b6f[_0x1c71('0x20')][_0x1c71('0x24')]));_0x582e5f[_0x1c71('0x22')]=_0x582e5f[_0x1c71('0x22')][_0x1c71('0x34')]?_0x582e5f['attributes']:_0x9b5c3d['model'];if(_0x390b6f['query'][_0x1c71('0x35')]){_0x582e5f[_0x1c71('0x36')]=[{'all':!![]}];}_0x582e5f=_[_0x1c71('0x2a')]({},_0x582e5f,_0x390b6f[_0x1c71('0x37')]);return db['CloudProvider']['find'](_0x582e5f)[_0x1c71('0x10')](handleEntityNotFound(_0x274e0c,null))[_0x1c71('0x10')](function(_0x102989){if(_0x102989[_0x1c71('0x2f')]===_0x1c71('0x38')){var _0x556659=encryptor['decryptString'](_0x102989[_0x1c71('0x31')]);_0x102989[_0x1c71('0x31')]=maskClientSecret(_0x556659);}return _0x102989;})['then'](respondWithResult(_0x274e0c,null))[_0x1c71('0x32')](handleError(_0x274e0c,null));};exports[_0x1c71('0x39')]=function(_0x43108d,_0x26c48e){if(!_0x43108d[_0x1c71('0x3a')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x43108d[_0x1c71('0x3a')][_0x1c71('0x2f')])throw new Error(_0x1c71('0x3b'));var _0x51f4f0=db[_0x1c71('0x1b')][_0x1c71('0x1c')][_0x1c71('0x2f')]['values'];if(!_0x51f4f0[_0x1c71('0x3c')](_0x43108d['body'][_0x1c71('0x2f')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x51f4f0[_0x1c71('0x3d')](',\x20'));if(_0x43108d[_0x1c71('0x3a')][_0x1c71('0x2f')]===_0x1c71('0x38')&&_0x43108d['body'][_0x1c71('0x31')]){_0x43108d['body'][_0x1c71('0x31')]=encryptor['encryptString'](_0x43108d['body'][_0x1c71('0x31')]);}return db[_0x1c71('0x1b')]['create'](_0x43108d[_0x1c71('0x3a')],{})[_0x1c71('0x10')](respondWithResult(_0x26c48e,0xc9))['catch'](handleError(_0x26c48e,null));};exports[_0x1c71('0xf')]=function(_0x51bf15,_0x1cc1ba){if(_0x51bf15[_0x1c71('0x3a')]['id']){delete _0x51bf15[_0x1c71('0x3a')]['id'];}return db[_0x1c71('0x1b')][_0x1c71('0x3e')]({'where':{'id':_0x51bf15[_0x1c71('0x3f')]['id']}})[_0x1c71('0x10')](handleEntityNotFound(_0x1cc1ba,null))[_0x1c71('0x10')](function(_0x909c4b){if(_0x909c4b[_0x1c71('0x2f')]===_0x1c71('0x38')&&_0x51bf15[_0x1c71('0x3a')][_0x1c71('0x31')]){_0x51bf15[_0x1c71('0x3a')][_0x1c71('0x31')]=encryptor[_0x1c71('0x40')](_0x51bf15[_0x1c71('0x3a')][_0x1c71('0x31')]);}return _0x909c4b;})[_0x1c71('0x10')](saveUpdates(_0x51bf15['body'],null))[_0x1c71('0x10')](respondWithResult(_0x1cc1ba,null))[_0x1c71('0x32')](handleError(_0x1cc1ba,null));};exports[_0x1c71('0x11')]=function(_0xb86059,_0x383634){return db[_0x1c71('0x1b')][_0x1c71('0x3e')]({'where':{'id':_0xb86059[_0x1c71('0x3f')]['id']}})[_0x1c71('0x10')](handleEntityNotFound(_0x383634,null))[_0x1c71('0x10')](removeEntity(_0x383634,null))['catch'](handleError(_0x383634,null));};exports[_0x1c71('0x41')]=function(_0x52399b,_0x445ea7){return db[_0x1c71('0x1b')]['findOne']({'where':{'id':_0x52399b[_0x1c71('0x3f')]['id']},'raw':!![]})['then'](function(_0x1e73a6){if(!_0x1e73a6)return _0x445ea7['sendStatus'](0x194);return{'url':oauth[_0x1c71('0x42')](_0x1e73a6,_0x52399b[_0x1c71('0x43')]['id'])};})[_0x1c71('0x10')](respondWithResult(_0x445ea7,null))['catch'](handleError(_0x445ea7,null));};exports[_0x1c71('0x44')]=function(_0x25901d,_0x5766da){var _0x21039e=_0x25901d[_0x1c71('0x3a')];var _0xf19e1c;var _0x5a93e0;if(_0x21039e[_0x1c71('0x13')])throw _0x21039e;redis[_0x1c71('0x45')](_0x21039e['state'])[_0x1c71('0x10')](function(_0x5bf094){if(!_0x5bf094)throw new Error(_0x1c71('0x46'));_0xf19e1c=JSON[_0x1c71('0x47')](_0x5bf094);var _0x3af11d=Buffer[_0x1c71('0x48')](_0x21039e['state'],_0x1c71('0x49'))[_0x1c71('0x4a')](_0x1c71('0x4b'));_0x5a93e0=JSON[_0x1c71('0x47')](_0x3af11d);if(!oauth[_0x1c71('0x4c')](_0x21039e['id_token'],_0xf19e1c['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x1c71('0x4d')](_0x21039e[_0x1c71('0x4e')]);return oauth[_0x1c71('0x4f')](_0x21039e[_0x1c71('0x50')],_0xf19e1c);})['then'](function(_0x2d961b){_0xf19e1c[_0x1c71('0x51')]=_0x2d961b[_0x1c71('0x52')];_0xf19e1c[_0x1c71('0x53')]=_0x2d961b[_0x1c71('0x54')];return db[_0x1c71('0x1b')][_0x1c71('0xf')]({'data5':_0xf19e1c[_0x1c71('0x51')],'data6':_0xf19e1c[_0x1c71('0x53')]},{'where':{'id':_0xf19e1c['id']}});})[_0x1c71('0x10')](function(){oauth['startRefreshInterval'](_0xf19e1c);socket[_0x1c71('0x55')](_0x1c71('0x56'),{'id':_0x5a93e0['id']});return;})[_0x1c71('0x10')](respondWithStatusCode(_0x5766da,null))[_0x1c71('0x32')](function(_0x244a07){if(_0x5a93e0){socket[_0x1c71('0x55')](_0x1c71('0x57'),{'id':_0x5a93e0['id']});}if(!_0xf19e1c){logger[_0x1c71('0x13')](_0x1c71('0x58'),_0x244a07);return _0x5766da['status'](0x1f4)[_0x1c71('0x16')](_0x244a07[_0x1c71('0x59')]);}logger[_0x1c71('0x13')](_0x1c71('0x5a'),_0xf19e1c['id'],JSON[_0x1c71('0x5b')](_0x244a07));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index f80261b..dbc51e4 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 _0x275d=['../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','api','moment','request-promise','path','rimraf'];(function(_0x375fa9,_0x2505fa){var _0x5c8f27=function(_0x655c3){while(--_0x655c3){_0x375fa9['push'](_0x375fa9['shift']());}};_0x5c8f27(++_0x2505fa);}(_0x275d,0x13b));var _0xd275=function(_0x16cb03,_0x43ea58){_0x16cb03=_0x16cb03-0x0;var _0x10944e=_0x275d[_0x16cb03];return _0x10944e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd275('0x0'));var moment=require(_0xd275('0x1'));var BPromise=require('bluebird');var rp=require(_0xd275('0x2'));var fs=require('fs');var path=require(_0xd275('0x3'));var rimraf=require(_0xd275('0x4'));var config=require(_0xd275('0x5'));var attributes=require(_0xd275('0x6'));module[_0xd275('0x7')]=function(_0x3c7716,_0x1b853e){return _0x3c7716['define'](_0xd275('0x8'),attributes,{'tableName':_0xd275('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc5e6=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util'];(function(_0x5b306b,_0x19f1d5){var _0x3ab72d=function(_0x385f58){while(--_0x385f58){_0x5b306b['push'](_0x5b306b['shift']());}};_0x3ab72d(++_0x19f1d5);}(_0xc5e6,0xbe));var _0x6c5e=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0xc5e6[_0x40df5f];return _0x1573f1;};'use strict';var _=require(_0x6c5e('0x0'));var util=require(_0x6c5e('0x1'));var logger=require(_0x6c5e('0x2'))('api');var moment=require(_0x6c5e('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c5e('0x4'));var fs=require('fs');var path=require(_0x6c5e('0x5'));var rimraf=require(_0x6c5e('0x6'));var config=require(_0x6c5e('0x7'));var attributes=require(_0x6c5e('0x8'));module[_0x6c5e('0x9')]=function(_0x5849be,_0x173bcf){return _0x5849be[_0x6c5e('0xa')]('CloudProvider',attributes,{'tableName':_0x6c5e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 111144a..fc23a16 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 _0x3bb4=['set','iss','issuer','aud','isAfter','unix','exp','then','data3','CloudProvider','refresh_token','decryptString','POST','access_token','data6','update','data5','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','catch','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','data7','/.default','join','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','code','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','map','oauth2Claims','oauth2/'];(function(_0x5bd741,_0x481b9c){var _0xd3be3d=function(_0x4fc75c){while(--_0x4fc75c){_0x5bd741['push'](_0x5bd741['shift']());}};_0xd3be3d(++_0x481b9c);}(_0x3bb4,0x66));var _0x43bb=function(_0x2bc196,_0x53e04d){_0x2bc196=_0x2bc196-0x0;var _0x164869=_0x3bb4[_0x2bc196];return _0x164869;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x43bb('0x0'));var moment=require(_0x43bb('0x1'));var Redis=require('ioredis');var rp=require(_0x43bb('0x2'));var util=require(_0x43bb('0x3'));var encryptor=require(_0x43bb('0x4'));var config=require('../../config/environment');var logger=require(_0x43bb('0x5'))(_0x43bb('0x6'));var schedule=require(_0x43bb('0x7'));var db=require(_0x43bb('0x8'))['db'];config[_0x43bb('0x9')]=_[_0x43bb('0xa')](config['redis'],{'host':_0x43bb('0xb'),'port':0x18eb});var redis=new Redis(config[_0x43bb('0x9')]);var MICROSOFT_AUTH_URL=_0x43bb('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x43bb('0xd'),_0x43bb('0xe'),'email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x43bb('0xf'),_0x43bb('0x10')],'Dynamics365':[_0x43bb('0xd'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x43bb('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x43bb('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4a6a5c){var _0x5f0a1d=_['map'](AZURE_AUTH_SCOPES[_0x4a6a5c[_0x43bb('0x13')]]);if(_0x4a6a5c[_0x43bb('0x13')]==='Dynamics365')_0x5f0a1d['push'](_0x4a6a5c[_0x43bb('0x14')]+_0x43bb('0x15'));return _0x5f0a1d[_0x43bb('0x16')]('\x20');}function getAccessTokenScope(_0x3bf477){if(_0x3bf477[_0x43bb('0x13')]==='Outlook365')return _0x43bb('0x17');if(_0x3bf477[_0x43bb('0x13')]==='Dynamics365')return _0x3bf477[_0x43bb('0x14')]+_0x43bb('0x15');}function generateMicrosoftAuthorizationUrl(_0x3b9c81,_0x1bb4bc){var _0x1a75c8=MICROSOFT_AUTH_URL[_0x43bb('0x18')](_0x43bb('0x19'),_0x3b9c81[_0x43bb('0x1a')]);var _0x4df53f=[_0x43bb('0x1b'),'id_token'];var _0x3196b1=Buffer['from'](JSON[_0x43bb('0x1c')]({'id':_0x1bb4bc}))[_0x43bb('0x1d')](_0x43bb('0x1e'));var _0x1293e6=crypto[_0x43bb('0x1f')](0x10)[_0x43bb('0x1d')](_0x43bb('0x20'));var _0xbb365c=getAuthorizationScopes(_0x3b9c81);var _0xd680e9=[{'key':_0x43bb('0x21'),'value':_0x3b9c81[_0x43bb('0x22')]},{'key':_0x43bb('0x23'),'value':encodeURIComponent(_0x4df53f[_0x43bb('0x16')]('\x20'))},{'key':_0x43bb('0x24'),'value':_0x3b9c81[_0x43bb('0x25')]},{'key':_0x43bb('0x26'),'value':_0x43bb('0x27')},{'key':'scope','value':encodeURIComponent(_0xbb365c)},{'key':_0x43bb('0x28'),'value':_0x3196b1},{'key':_0x43bb('0x29'),'value':_0x1293e6},{'key':_0x43bb('0x2a'),'value':'login'}];var _0x1448fd=_0x1a75c8+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x43bb('0x2b')](_0xd680e9,function(_0x3620f9){return _0x3620f9['key']+'='+_0x3620f9['value'];})[_0x43bb('0x16')]('&');_0x3b9c81[_0x43bb('0x2c')]={'issuer':_0x1a75c8[_0x43bb('0x18')](_0x43bb('0x2d'),''),'audience':_0x3b9c81[_0x43bb('0x22')],'state':_0x3196b1,'nonce':_0x1293e6};redis[_0x43bb('0x2e')](_0x3196b1,JSON[_0x43bb('0x1c')](_0x3b9c81));return _0x1448fd;}function isValidIdToken(_0x2ce71b,_0x33e99b){try{var _0x57b333=jwt['decode'](_0x2ce71b,{'complete':!![]});var _0x41a5d5=_0x57b333['payload'];if(_0x41a5d5[_0x43bb('0x2f')]!==_0x33e99b[_0x43bb('0x30')])return![];if(_0x41a5d5[_0x43bb('0x31')]!==_0x33e99b['audience'])return![];if(_0x41a5d5[_0x43bb('0x29')]!==_0x33e99b['nonce'])return![];if(moment()[_0x43bb('0x32')](moment[_0x43bb('0x33')](_0x41a5d5[_0x43bb('0x34')])))return![];return!![];}catch(_0x411405){throw _0x411405;}}function refreshOauth2MicrosoftAccessToken(_0x105dbd){return Promise['resolve']()[_0x43bb('0x35')](function(){if(_0x105dbd[_0x43bb('0x36')])return _0x105dbd;return db[_0x43bb('0x37')]['findOne']({'where':{'id':_0x105dbd['id']},'raw':!![]});})[_0x43bb('0x35')](function(_0x287ec6){var _0x742a3={'grant_type':_0x43bb('0x38'),'refresh_token':_0x287ec6['data6'],'scope':getAccessTokenScope(_0x287ec6),'redirect_uri':_0x287ec6[_0x43bb('0x25')],'client_id':_0x287ec6['data1'],'client_secret':encryptor[_0x43bb('0x39')](_0x287ec6['data3'])};var _0x2a1e6e={'method':_0x43bb('0x3a'),'uri':MICROSOFT_AUTH_URL['replace'](_0x43bb('0x19'),_0x287ec6['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x742a3,'json':!![]};return rp(_0x2a1e6e);})['then'](function(_0x1211c7){_0x105dbd['data5']=_0x1211c7[_0x43bb('0x3b')];_0x105dbd[_0x43bb('0x3c')]=_0x1211c7['refresh_token'];return db[_0x43bb('0x37')][_0x43bb('0x3d')]({'data5':_0x105dbd[_0x43bb('0x3e')],'data6':_0x105dbd[_0x43bb('0x3c')]},{'where':{'id':_0x105dbd['id']}});})[_0x43bb('0x35')](function(){return _0x105dbd;})['catch'](function(_0x36a91d){logger['error'](_0x43bb('0x3f'),_0x105dbd['id'],_0x36a91d);});}function getOauth2MicrosoftAccessToken(_0x36e4e4,_0x28c8c4){var _0x33b11f={'grant_type':_0x43bb('0x40'),'code':_0x36e4e4,'scope':getAccessTokenScope(_0x28c8c4),'redirect_uri':_0x28c8c4[_0x43bb('0x25')],'client_id':_0x28c8c4['data1'],'client_secret':encryptor[_0x43bb('0x39')](_0x28c8c4[_0x43bb('0x36')])};var _0x12a4f2={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x43bb('0x18')]('{TENANT_ID}',_0x28c8c4[_0x43bb('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x33b11f,'json':!![]};return rp(_0x12a4f2);}function startRefreshInterval(_0x15c53b){var _0x3f7fdb=schedule[_0x43bb('0x41')];if(_0x3f7fdb[_0x15c53b['id']])clearInterval(_0x3f7fdb[_0x15c53b['id']]);_0x3f7fdb[_0x15c53b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x43bb('0x42')](this,{'id':_0x15c53b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x43bb('0x41')]=_0x3f7fdb;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x43bb('0x43')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x43bb('0x35')](function(_0x42d490){var _0xe66612=_0x42d490[_0x43bb('0x2b')](function(_0x34e03c){return refreshOauth2MicrosoftAccessToken(_0x34e03c)[_0x43bb('0x35')](function(_0x40ffb2){startRefreshInterval(_0x40ffb2);});});return Promise[_0x43bb('0x44')](_0xe66612);})[_0x43bb('0x45')](function(_0x5e17ed){var _0x331103=_0x5e17ed?util[_0x43bb('0x46')](_0x5e17ed,{'showHidden':![],'depth':null}):'';logger[_0x43bb('0x47')](_0x43bb('0x48'),_0x331103);});}module[_0x43bb('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x5e8a=['isAfter','resolve','then','data3','CloudProvider','refresh_token','decryptString','{TENANT_ID}','access_token','data6','update','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','catch','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','offline_access','/authorize','map','type','data7','/.default','join','Dynamics365','replace','data2','code','toString','base64','hex','client_id','data1','response_type','data4','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience'];(function(_0x367f24,_0x3dc831){var _0x25fa11=function(_0x9f01b3){while(--_0x9f01b3){_0x367f24['push'](_0x367f24['shift']());}};_0x25fa11(++_0x3dc831);}(_0x5e8a,0x13e));var _0xa5e8=function(_0x1d290e,_0x54d916){_0x1d290e=_0x1d290e-0x0;var _0x37314b=_0x5e8a[_0x1d290e];return _0x37314b;};'use strict';var _=require(_0xa5e8('0x0'));var crypto=require(_0xa5e8('0x1'));var jwt=require(_0xa5e8('0x2'));var moment=require(_0xa5e8('0x3'));var Redis=require(_0xa5e8('0x4'));var rp=require(_0xa5e8('0x5'));var util=require(_0xa5e8('0x6'));var encryptor=require(_0xa5e8('0x7'));var config=require(_0xa5e8('0x8'));var logger=require('../../config/logger')(_0xa5e8('0x9'));var schedule=require(_0xa5e8('0xa'));var db=require('../../mysqldb')['db'];config[_0xa5e8('0xb')]=_[_0xa5e8('0xc')](config[_0xa5e8('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xa5e8('0xb')]);var MICROSOFT_AUTH_URL=_0xa5e8('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa5e8('0xe'),_0xa5e8('0xf'),'email','offline_access',_0xa5e8('0x10'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xa5e8('0xe'),_0xa5e8('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xa5e8('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x417327){var _0x31d926=_[_0xa5e8('0x13')](AZURE_AUTH_SCOPES[_0x417327[_0xa5e8('0x14')]]);if(_0x417327[_0xa5e8('0x14')]==='Dynamics365')_0x31d926['push'](_0x417327[_0xa5e8('0x15')]+_0xa5e8('0x16'));return _0x31d926[_0xa5e8('0x17')]('\x20');}function getAccessTokenScope(_0x149f59){if(_0x149f59[_0xa5e8('0x14')]==='Outlook365')return _0xa5e8('0x10');if(_0x149f59[_0xa5e8('0x14')]===_0xa5e8('0x18'))return _0x149f59[_0xa5e8('0x15')]+_0xa5e8('0x16');}function generateMicrosoftAuthorizationUrl(_0x50ecb3,_0x35f405){var _0x350d1a=MICROSOFT_AUTH_URL[_0xa5e8('0x19')]('{TENANT_ID}',_0x50ecb3[_0xa5e8('0x1a')]);var _0x5c1989=[_0xa5e8('0x1b'),'id_token'];var _0x4548da=Buffer['from'](JSON['stringify']({'id':_0x35f405}))[_0xa5e8('0x1c')](_0xa5e8('0x1d'));var _0x1160b1=crypto['randomBytes'](0x10)[_0xa5e8('0x1c')](_0xa5e8('0x1e'));var _0x365c1f=getAuthorizationScopes(_0x50ecb3);var _0x3df6bd=[{'key':_0xa5e8('0x1f'),'value':_0x50ecb3[_0xa5e8('0x20')]},{'key':_0xa5e8('0x21'),'value':encodeURIComponent(_0x5c1989[_0xa5e8('0x17')]('\x20'))},{'key':'redirect_uri','value':_0x50ecb3[_0xa5e8('0x22')]},{'key':'response_mode','value':_0xa5e8('0x23')},{'key':_0xa5e8('0x24'),'value':encodeURIComponent(_0x365c1f)},{'key':_0xa5e8('0x25'),'value':_0x4548da},{'key':_0xa5e8('0x26'),'value':_0x1160b1},{'key':_0xa5e8('0x27'),'value':_0xa5e8('0x28')}];var _0x4b9ce3=_0x350d1a+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa5e8('0x13')](_0x3df6bd,function(_0x591765){return _0x591765[_0xa5e8('0x29')]+'='+_0x591765[_0xa5e8('0x2a')];})['join']('&');_0x50ecb3[_0xa5e8('0x2b')]={'issuer':_0x350d1a[_0xa5e8('0x19')](_0xa5e8('0x2c'),''),'audience':_0x50ecb3[_0xa5e8('0x20')],'state':_0x4548da,'nonce':_0x1160b1};redis[_0xa5e8('0x2d')](_0x4548da,JSON['stringify'](_0x50ecb3));return _0x4b9ce3;}function isValidIdToken(_0x325a74,_0x54d07c){try{var _0xfc1fd1=jwt[_0xa5e8('0x2e')](_0x325a74,{'complete':!![]});var _0x213386=_0xfc1fd1[_0xa5e8('0x2f')];if(_0x213386[_0xa5e8('0x30')]!==_0x54d07c[_0xa5e8('0x31')])return![];if(_0x213386[_0xa5e8('0x32')]!==_0x54d07c[_0xa5e8('0x33')])return![];if(_0x213386[_0xa5e8('0x26')]!==_0x54d07c[_0xa5e8('0x26')])return![];if(moment()[_0xa5e8('0x34')](moment['unix'](_0x213386['exp'])))return![];return!![];}catch(_0x4c26ca){throw _0x4c26ca;}}function refreshOauth2MicrosoftAccessToken(_0x4233c8){return Promise[_0xa5e8('0x35')]()[_0xa5e8('0x36')](function(){if(_0x4233c8[_0xa5e8('0x37')])return _0x4233c8;return db[_0xa5e8('0x38')]['findOne']({'where':{'id':_0x4233c8['id']},'raw':!![]});})['then'](function(_0xb7a6d6){var _0x11a6d7={'grant_type':_0xa5e8('0x39'),'refresh_token':_0xb7a6d6['data6'],'scope':getAccessTokenScope(_0xb7a6d6),'redirect_uri':_0xb7a6d6[_0xa5e8('0x22')],'client_id':_0xb7a6d6['data1'],'client_secret':encryptor[_0xa5e8('0x3a')](_0xb7a6d6[_0xa5e8('0x37')])};var _0x50b62c={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa5e8('0x19')](_0xa5e8('0x3b'),_0xb7a6d6[_0xa5e8('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11a6d7,'json':!![]};return rp(_0x50b62c);})[_0xa5e8('0x36')](function(_0x4e072f){_0x4233c8['data5']=_0x4e072f[_0xa5e8('0x3c')];_0x4233c8[_0xa5e8('0x3d')]=_0x4e072f[_0xa5e8('0x39')];return db[_0xa5e8('0x38')][_0xa5e8('0x3e')]({'data5':_0x4233c8[_0xa5e8('0x3f')],'data6':_0x4233c8[_0xa5e8('0x3d')]},{'where':{'id':_0x4233c8['id']}});})[_0xa5e8('0x36')](function(){return _0x4233c8;})['catch'](function(_0x7a9406){logger[_0xa5e8('0x40')](_0xa5e8('0x41'),_0x4233c8['id'],_0x7a9406);});}function getOauth2MicrosoftAccessToken(_0x205c0d,_0x35ff83){var _0x5c83b0={'grant_type':_0xa5e8('0x42'),'code':_0x205c0d,'scope':getAccessTokenScope(_0x35ff83),'redirect_uri':_0x35ff83[_0xa5e8('0x22')],'client_id':_0x35ff83['data1'],'client_secret':encryptor[_0xa5e8('0x3a')](_0x35ff83[_0xa5e8('0x37')])};var _0x111940={'method':_0xa5e8('0x43'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa5e8('0x3b'),_0x35ff83[_0xa5e8('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5c83b0,'json':!![]};return rp(_0x111940);}function startRefreshInterval(_0x42c3e0){var _0x56ac3a=schedule[_0xa5e8('0x44')];if(_0x56ac3a[_0x42c3e0['id']])clearInterval(_0x56ac3a[_0x42c3e0['id']]);_0x56ac3a[_0x42c3e0['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa5e8('0x45')](this,{'id':_0x42c3e0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa5e8('0x44')]=_0x56ac3a;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xa5e8('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa5e8('0x36')](function(_0x3879fc){var _0x452323=_0x3879fc[_0xa5e8('0x13')](function(_0x2b4fef){return refreshOauth2MicrosoftAccessToken(_0x2b4fef)[_0xa5e8('0x36')](function(_0x5352a6){startRefreshInterval(_0x5352a6);});});return Promise[_0xa5e8('0x47')](_0x452323);})[_0xa5e8('0x48')](function(_0x3e42ec){var _0x41f1fa=_0x3e42ec?util['inspect'](_0x3e42ec,{'showHidden':![],'depth':null}):'';logger[_0xa5e8('0x40')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x41f1fa);});}module[_0xa5e8('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index b75f656..bc625d2 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 _0x4213=['CloudProvider,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x494ae9,_0x36971c){var _0x119e70=function(_0x3aafd7){while(--_0x3aafd7){_0x494ae9['push'](_0x494ae9['shift']());}};_0x119e70(++_0x36971c);}(_0x4213,0x77));var _0x3421=function(_0x25018f,_0x2f7d26){_0x25018f=_0x25018f-0x0;var _0x20e940=_0x4213[_0x25018f];return _0x20e940;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var moment=require(_0x3421('0x2'));var BPromise=require(_0x3421('0x3'));var rs=require(_0x3421('0x4'));var fs=require('fs');var Redis=require(_0x3421('0x5'));var db=require(_0x3421('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3421('0x7'))('rpc');var config=require(_0x3421('0x8'));var jayson=require(_0x3421('0x9'));var client=jayson[_0x3421('0xa')][_0x3421('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5469d8,_0x50e464,_0x1b152f){return new BPromise(function(_0x130625,_0x1cf6a0){return client[_0x3421('0xc')](_0x5469d8,_0x1b152f)['then'](function(_0x1f20cf){logger['info']('CloudProvider,\x20%s,\x20%s',_0x50e464,_0x3421('0xd'));logger['debug'](_0x3421('0xe'),_0x50e464,_0x3421('0xd'),JSON[_0x3421('0xf')](_0x1f20cf));if(_0x1f20cf[_0x3421('0x10')]){if(_0x1f20cf[_0x3421('0x10')][_0x3421('0x11')]===0x1f4){logger[_0x3421('0x10')]('CloudProvider,\x20%s,\x20%s',_0x50e464,_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);return _0x1cf6a0(_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);}logger[_0x3421('0x10')](_0x3421('0x13'),_0x50e464,_0x1f20cf[_0x3421('0x10')]['message']);return _0x130625(_0x1f20cf[_0x3421('0x10')]['message']);}else{logger[_0x3421('0x14')](_0x3421('0x13'),_0x50e464,'request\x20sent');_0x130625(_0x1f20cf[_0x3421('0x15')]['message']);}})[_0x3421('0x16')](function(_0x23694b){logger['error'](_0x3421('0x13'),_0x50e464,_0x23694b);_0x1cf6a0(_0x23694b);});});}
\ No newline at end of file
+var _0x5464=['info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x184c37,_0x275925){var _0x5473a7=function(_0x532106){while(--_0x532106){_0x184c37['push'](_0x184c37['shift']());}};_0x5473a7(++_0x275925);}(_0x5464,0x15d));var _0x4546=function(_0x23427e,_0x43d445){_0x23427e=_0x23427e-0x0;var _0x46c8b=_0x5464[_0x23427e];return _0x46c8b;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('CloudProvider,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('CloudProvider,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 724217a..8b52309 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(_0x2e61ea,_0x57f270){var _0x6c630=function(_0x434976){while(--_0x434976){_0x2e61ea['push'](_0x2e61ea['shift']());}};_0x6c630(++_0x57f270);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x3fa296,_0x2bd315){var _0x10b19f=function(_0x2c868d){while(--_0x2c868d){_0x3fa296['push'](_0x3fa296['shift']());}};_0x10b19f(++_0x2bd315);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4b98e0,_0x442fa3){_0x4b98e0=_0x4b98e0-0x0;var _0x1cf1f2=_0x5f2f[_0x4b98e0];return _0x1cf1f2;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index da9538c..0190822 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 _0xd58c=['sequelize','exports','STRING','name'];(function(_0x653c4e,_0x17dc30){var _0x43e975=function(_0x21c37a){while(--_0x21c37a){_0x653c4e['push'](_0x653c4e['shift']());}};_0x43e975(++_0x17dc30);}(_0xd58c,0x70));var _0xcd58=function(_0x18ee78,_0x5d1bf2){_0x18ee78=_0x18ee78-0x0;var _0x581884=_0xd58c[_0x18ee78];return _0x581884;};'use strict';var Sequelize=require(_0xcd58('0x0'));module[_0xcd58('0x1')]={'name':{'type':Sequelize[_0xcd58('0x2')],'unique':_0xcd58('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcd58('0x2')]},'companyId':{'type':Sequelize[_0xcd58('0x2')]},'website':{'type':Sequelize[_0xcd58('0x2')]},'phone':{'type':Sequelize[_0xcd58('0x2')]},'fax':{'type':Sequelize[_0xcd58('0x2')]},'type':{'type':Sequelize[_0xcd58('0x2')]},'street':{'type':Sequelize[_0xcd58('0x2')]},'postalCode':{'type':Sequelize[_0xcd58('0x2')]},'city':{'type':Sequelize[_0xcd58('0x2')]},'country':{'type':Sequelize[_0xcd58('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xcd58('0x2')]},'sPostalCode':{'type':Sequelize[_0xcd58('0x2')]},'sCity':{'type':Sequelize[_0xcd58('0x2')]},'sCountry':{'type':Sequelize[_0xcd58('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf879=['exports','STRING','sequelize'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xf879,0x158));var _0x9f87=function(_0x199c16,_0x43f421){_0x199c16=_0x199c16-0x0;var _0x3a69de=_0xf879[_0x199c16];return _0x3a69de;};'use strict';var Sequelize=require(_0x9f87('0x0'));module[_0x9f87('0x1')]={'name':{'type':Sequelize[_0x9f87('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x9f87('0x2')]},'website':{'type':Sequelize[_0x9f87('0x2')]},'phone':{'type':Sequelize[_0x9f87('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9f87('0x2')]},'street':{'type':Sequelize[_0x9f87('0x2')]},'postalCode':{'type':Sequelize[_0x9f87('0x2')]},'city':{'type':Sequelize[_0x9f87('0x2')]},'country':{'type':Sequelize[_0x9f87('0x2')]},'email':{'type':Sequelize[_0x9f87('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9f87('0x2')]},'sStreet':{'type':Sequelize[_0x9f87('0x2')]},'sPostalCode':{'type':Sequelize[_0x9f87('0x2')]},'sCity':{'type':Sequelize[_0x9f87('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index daabc6d..7400847 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 _0x5d7a=['map','filter','options','includeAll','include','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','addContacts','ids','getContacts','findOne','CmContact','rawAttributes','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge'];(function(_0x24c554,_0x1032c0){var _0x15f619=function(_0x7fdefa){while(--_0x7fdefa){_0x24c554['push'](_0x24c554['shift']());}};_0x15f619(++_0x1032c0);}(_0x5d7a,0x11c));var _0xa5d7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5d7a[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xa5d7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa5d7('0x1'));var rp=require(_0xa5d7('0x2'));var moment=require(_0xa5d7('0x3'));var BPromise=require(_0xa5d7('0x4'));var Mustache=require(_0xa5d7('0x5'));var util=require(_0xa5d7('0x6'));var path=require(_0xa5d7('0x7'));var sox=require(_0xa5d7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5d7('0x9'));var _=require('lodash');var squel=require(_0xa5d7('0xa'));var crypto=require(_0xa5d7('0xb'));var jsforce=require(_0xa5d7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa5d7('0xd'));var querystring=require(_0xa5d7('0xe'));var Papa=require(_0xa5d7('0xf'));var Redis=require('ioredis');var authService=require(_0xa5d7('0x10'));var qs=require(_0xa5d7('0x11'));var as=require(_0xa5d7('0x12'));var hardwareService=require(_0xa5d7('0x13'));var logger=require(_0xa5d7('0x14'))(_0xa5d7('0x15'));var utils=require(_0xa5d7('0x16'));var config=require(_0xa5d7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5d7('0x18'))['db'];function respondWithStatusCode(_0x2e23f8,_0xdd22fa){_0xdd22fa=_0xdd22fa||0xcc;return function(_0x366776){if(_0x366776){return _0x2e23f8[_0xa5d7('0x19')](_0xdd22fa);}return _0x2e23f8['status'](_0xdd22fa)[_0xa5d7('0x1a')]();};}function respondWithResult(_0x3caf1c,_0x5c80fa){_0x5c80fa=_0x5c80fa||0xc8;return function(_0x41e319){if(_0x41e319){return _0x3caf1c[_0xa5d7('0x1b')](_0x5c80fa)[_0xa5d7('0x1c')](_0x41e319);}};}function respondWithFilteredResult(_0x4d0adb,_0x3e2a27){return function(_0x352a12){if(_0x352a12){var _0x255e50=typeof _0x3e2a27[_0xa5d7('0x1d')]==='undefined'&&typeof _0x3e2a27['limit']===_0xa5d7('0x1e');var _0x220ed8=_0x352a12[_0xa5d7('0x1f')];var _0x165057=_0x255e50?0x0:_0x3e2a27[_0xa5d7('0x1d')];var _0x42bc51=_0x255e50?_0x352a12[_0xa5d7('0x1f')]:_0x3e2a27[_0xa5d7('0x1d')]+_0x3e2a27[_0xa5d7('0x20')];var _0x3160b4;if(_0x42bc51>=_0x220ed8){_0x42bc51=_0x220ed8;_0x3160b4=0xc8;}else{_0x3160b4=0xce;}_0x4d0adb['status'](_0x3160b4);return _0x4d0adb[_0xa5d7('0x21')](_0xa5d7('0x22'),_0x165057+'-'+_0x42bc51+'/'+_0x220ed8)[_0xa5d7('0x1c')](_0x352a12);}return null;};}function patchUpdates(_0x314317){return function(_0x2c2d33){try{jsonpatch[_0xa5d7('0x23')](_0x2c2d33,_0x314317,!![]);}catch(_0x43b208){return BPromise['reject'](_0x43b208);}return _0x2c2d33[_0xa5d7('0x24')]();};}function saveUpdates(_0x49fb87,_0x5438d5){return function(_0x53563d){if(_0x53563d){return _0x53563d[_0xa5d7('0x25')](_0x49fb87)['then'](function(_0x5d6eb3){return _0x5d6eb3;});}return null;};}function removeEntity(_0x2513dd,_0x5a7d19){return function(_0x53e2f4){if(_0x53e2f4){return _0x53e2f4[_0xa5d7('0x26')]()[_0xa5d7('0x27')](function(){var _0x537c9c=_0x53e2f4[_0xa5d7('0x28')]({'plain':!![]});var _0x32e982=_0xa5d7('0x29');return db[_0xa5d7('0x2a')][_0xa5d7('0x26')]({'where':{'type':_0x32e982,'resourceId':_0x537c9c['id']}})[_0xa5d7('0x27')](function(){return _0x53e2f4;});})[_0xa5d7('0x27')](function(){_0x2513dd[_0xa5d7('0x1b')](0xcc)[_0xa5d7('0x1a')]();});}};}function handleEntityNotFound(_0x1fb045,_0x90a2dd){return function(_0x419259){if(!_0x419259){_0x1fb045['sendStatus'](0x194);}return _0x419259;};}function handleError(_0x4c518d,_0x2c163b){_0x2c163b=_0x2c163b||0x1f4;return function(_0x21bc75){logger[_0xa5d7('0x2b')](_0x21bc75[_0xa5d7('0x2c')]);if(_0x21bc75[_0xa5d7('0x2d')]){delete _0x21bc75[_0xa5d7('0x2d')];}_0x4c518d[_0xa5d7('0x1b')](_0x2c163b)['send'](_0x21bc75);};}exports[_0xa5d7('0x2e')]=function(_0x59eac2,_0xd6813){var _0x4de64c={},_0x3d1028={},_0x38eca1={'count':0x0,'rows':[]};return db[_0xa5d7('0x2f')][_0xa5d7('0x30')]()['then'](function(_0x60e58b){_0x3d1028[_0xa5d7('0x31')]=_[_0xa5d7('0x32')](_0x60e58b);_0x3d1028['query']=_['keys'](_0x59eac2[_0xa5d7('0x33')]);_0x3d1028['filters']=_['intersection'](_0x3d1028['model'],_0x3d1028['query']);_0x4de64c[_0xa5d7('0x34')]=_[_0xa5d7('0x35')](_0x3d1028[_0xa5d7('0x31')],qs[_0xa5d7('0x36')](_0x59eac2['query'][_0xa5d7('0x36')]));_0x4de64c[_0xa5d7('0x34')]=_0x4de64c[_0xa5d7('0x34')][_0xa5d7('0x37')]?_0x4de64c[_0xa5d7('0x34')]:_0x3d1028['model'];if(!_0x59eac2['query'][_0xa5d7('0x38')](_0xa5d7('0x39'))){_0x4de64c[_0xa5d7('0x20')]=qs[_0xa5d7('0x20')](_0x59eac2['query']['limit']);_0x4de64c[_0xa5d7('0x1d')]=qs[_0xa5d7('0x1d')](_0x59eac2[_0xa5d7('0x33')]['offset']);}_0x4de64c[_0xa5d7('0x3a')]=qs[_0xa5d7('0x3b')](_0x59eac2[_0xa5d7('0x33')]['sort']);_0x4de64c[_0xa5d7('0x3c')]=qs[_0xa5d7('0x3d')](_[_0xa5d7('0x3e')](_0x59eac2[_0xa5d7('0x33')],_0x3d1028[_0xa5d7('0x3d')]),_0x60e58b);if(_0x59eac2[_0xa5d7('0x33')]['filter']){_0x4de64c['where']=_[_0xa5d7('0x3f')](_0x4de64c['where'],{'$or':_[_0xa5d7('0x40')](_0x4de64c[_0xa5d7('0x34')],function(_0x136772){var _0x20f8d1={};_0x20f8d1[_0x136772]={'$like':'%'+_0x59eac2[_0xa5d7('0x33')][_0xa5d7('0x41')]+'%'};return _0x20f8d1;})});}_0x4de64c=_[_0xa5d7('0x3f')]({},_0x4de64c,_0x59eac2[_0xa5d7('0x42')]);var _0x39c59c={'where':_0x4de64c[_0xa5d7('0x3c')]};return db[_0xa5d7('0x2f')]['count'](_0x39c59c)[_0xa5d7('0x27')](function(_0x5b58a4){_0x38eca1[_0xa5d7('0x1f')]=_0x5b58a4;if(_0x59eac2[_0xa5d7('0x33')][_0xa5d7('0x43')]){_0x4de64c[_0xa5d7('0x44')]=[{'all':!![]}];}return db[_0xa5d7('0x2f')]['findAll'](_0x4de64c);})[_0xa5d7('0x27')](function(_0x262b3a){_0x38eca1['rows']=_0x262b3a;return _0x38eca1;})[_0xa5d7('0x27')](respondWithFilteredResult(_0xd6813,_0x4de64c))['catch'](handleError(_0xd6813,null));})['catch'](handleError(_0xd6813,null));};exports[_0xa5d7('0x45')]=function(_0x33d941,_0x577aa9){var _0x2f2ec1={'raw':![],'where':{'id':_0x33d941[_0xa5d7('0x46')]['id']}},_0x476a21={};_0x476a21[_0xa5d7('0x31')]=_['keys'](db[_0xa5d7('0x2f')]['rawAttributes']);_0x476a21[_0xa5d7('0x33')]=_[_0xa5d7('0x32')](_0x33d941[_0xa5d7('0x33')]);_0x476a21[_0xa5d7('0x3d')]=_[_0xa5d7('0x35')](_0x476a21['model'],_0x476a21[_0xa5d7('0x33')]);_0x2f2ec1['attributes']=_[_0xa5d7('0x35')](_0x476a21['model'],qs['fields'](_0x33d941[_0xa5d7('0x33')]['fields']));_0x2f2ec1[_0xa5d7('0x34')]=_0x2f2ec1[_0xa5d7('0x34')][_0xa5d7('0x37')]?_0x2f2ec1[_0xa5d7('0x34')]:_0x476a21['model'];if(_0x33d941[_0xa5d7('0x33')][_0xa5d7('0x43')]){_0x2f2ec1[_0xa5d7('0x44')]=[{'all':!![]}];}_0x2f2ec1=_[_0xa5d7('0x3f')]({},_0x2f2ec1,_0x33d941['options']);return db[_0xa5d7('0x2f')][_0xa5d7('0x47')](_0x2f2ec1)[_0xa5d7('0x27')](handleEntityNotFound(_0x577aa9,null))[_0xa5d7('0x27')](respondWithResult(_0x577aa9,null))[_0xa5d7('0x48')](handleError(_0x577aa9,null));};exports[_0xa5d7('0x49')]=function(_0x1655c3,_0x736ce2){return db[_0xa5d7('0x2f')][_0xa5d7('0x49')](_0x1655c3[_0xa5d7('0x4a')],{})[_0xa5d7('0x27')](function(_0x26f07a){var _0x4d7715=_0x1655c3['user']['get']({'plain':!![]});if(!_0x4d7715)throw new Error(_0xa5d7('0x4b'));if(_0x4d7715[_0xa5d7('0x4c')]===_0xa5d7('0x4d')){var _0x80b0e9=_0x26f07a[_0xa5d7('0x28')]({'plain':!![]});var _0x1c6c7e=_0xa5d7('0x29');return db[_0xa5d7('0x4e')][_0xa5d7('0x47')]({'where':{'name':_0x1c6c7e,'userProfileId':_0x4d7715[_0xa5d7('0x4f')]},'raw':!![]})[_0xa5d7('0x27')](function(_0x4cc714){if(_0x4cc714&&_0x4cc714[_0xa5d7('0x50')]===0x0){return db['UserProfileResource'][_0xa5d7('0x49')]({'name':_0x80b0e9[_0xa5d7('0x2d')],'resourceId':_0x80b0e9['id'],'type':_0x4cc714[_0xa5d7('0x2d')],'sectionId':_0x4cc714['id']},{})['then'](function(){return _0x26f07a;});}else{return _0x26f07a;}})[_0xa5d7('0x48')](function(_0x559ec0){logger[_0xa5d7('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x559ec0);throw _0x559ec0;});}return _0x26f07a;})['then'](respondWithResult(_0x736ce2,0xc9))[_0xa5d7('0x48')](handleError(_0x736ce2,null));};exports[_0xa5d7('0x25')]=function(_0x52a141,_0x2c667d){if(_0x52a141[_0xa5d7('0x4a')]['id']){delete _0x52a141[_0xa5d7('0x4a')]['id'];}return db[_0xa5d7('0x2f')][_0xa5d7('0x47')]({'where':{'id':_0x52a141[_0xa5d7('0x46')]['id']}})[_0xa5d7('0x27')](handleEntityNotFound(_0x2c667d,null))[_0xa5d7('0x27')](saveUpdates(_0x52a141['body'],null))[_0xa5d7('0x27')](respondWithResult(_0x2c667d,null))[_0xa5d7('0x48')](handleError(_0x2c667d,null));};exports['destroy']=function(_0x11f090,_0x304ded){return db[_0xa5d7('0x2f')]['find']({'where':{'id':_0x11f090[_0xa5d7('0x46')]['id']}})[_0xa5d7('0x27')](handleEntityNotFound(_0x304ded,null))[_0xa5d7('0x27')](removeEntity(_0x304ded,null))['catch'](handleError(_0x304ded,null));};exports[_0xa5d7('0x30')]=function(_0x59904c,_0x38aa43){return db[_0xa5d7('0x2f')][_0xa5d7('0x30')]()[_0xa5d7('0x27')](respondWithResult(_0x38aa43,null))[_0xa5d7('0x48')](handleError(_0x38aa43,null));};exports[_0xa5d7('0x51')]=function(_0xc22959,_0x23c138,_0x56c3ff){return db['CmContact'][_0xa5d7('0x47')]({'where':{'id':_0xc22959[_0xa5d7('0x46')]['id']}})[_0xa5d7('0x27')](handleEntityNotFound(_0x23c138,null))[_0xa5d7('0x27')](function(_0x32328f){if(_0x32328f){return _0x32328f[_0xa5d7('0x51')](_0xc22959[_0xa5d7('0x4a')][_0xa5d7('0x52')],_['omit'](_0xc22959[_0xa5d7('0x4a')],[_0xa5d7('0x52'),'id'])||{});}})['then'](respondWithResult(_0x23c138,null))[_0xa5d7('0x48')](handleError(_0x23c138,null));};exports[_0xa5d7('0x53')]=function(_0x2a7a3d,_0x100af1,_0x2b6962){var _0xe12fe4={};var _0x1e4291={};var _0x3e76e2;var _0x53a42c;return db[_0xa5d7('0x2f')][_0xa5d7('0x54')]({'where':{'id':_0x2a7a3d[_0xa5d7('0x46')]['id']}})[_0xa5d7('0x27')](handleEntityNotFound(_0x100af1,null))[_0xa5d7('0x27')](function(_0x1f7d5c){if(_0x1f7d5c){_0x3e76e2=_0x1f7d5c;_0x1e4291['model']=_[_0xa5d7('0x32')](db[_0xa5d7('0x55')][_0xa5d7('0x56')]);_0x1e4291['query']=_[_0xa5d7('0x32')](_0x2a7a3d[_0xa5d7('0x33')]);_0x1e4291[_0xa5d7('0x3d')]=_[_0xa5d7('0x35')](_0x1e4291['model'],_0x1e4291['query']);_0xe12fe4['attributes']=_[_0xa5d7('0x35')](_0x1e4291[_0xa5d7('0x31')],qs['fields'](_0x2a7a3d[_0xa5d7('0x33')]['fields']));_0xe12fe4[_0xa5d7('0x34')]=_0xe12fe4[_0xa5d7('0x34')][_0xa5d7('0x37')]?_0xe12fe4[_0xa5d7('0x34')]:_0x1e4291[_0xa5d7('0x31')];_0xe12fe4[_0xa5d7('0x3a')]=qs[_0xa5d7('0x3b')](_0x2a7a3d[_0xa5d7('0x33')][_0xa5d7('0x3b')]);_0xe12fe4['where']=qs['filters'](_['pick'](_0x2a7a3d[_0xa5d7('0x33')],_0x1e4291['filters']));if(_0x2a7a3d['query']['filter']){_0xe12fe4[_0xa5d7('0x3c')]=_[_0xa5d7('0x3f')](_0xe12fe4[_0xa5d7('0x3c')],{'$or':_['map'](_0xe12fe4['attributes'],function(_0x397ee2){var _0x1cc7e2={};_0x1cc7e2[_0x397ee2]={'$like':'%'+_0x2a7a3d['query'][_0xa5d7('0x41')]+'%'};return _0x1cc7e2;})});}_0xe12fe4=_[_0xa5d7('0x3f')]({},_0xe12fe4,_0x2a7a3d['options']);return _0x3e76e2[_0xa5d7('0x53')](_0xe12fe4);}})[_0xa5d7('0x27')](function(_0x243b31){if(_0x243b31){_0x53a42c=_0x243b31[_0xa5d7('0x37')];if(!_0x2a7a3d[_0xa5d7('0x33')][_0xa5d7('0x38')]('nolimit')){_0xe12fe4[_0xa5d7('0x20')]=qs['limit'](_0x2a7a3d['query'][_0xa5d7('0x20')]);_0xe12fe4[_0xa5d7('0x1d')]=qs[_0xa5d7('0x1d')](_0x2a7a3d[_0xa5d7('0x33')]['offset']);}return _0x3e76e2[_0xa5d7('0x53')](_0xe12fe4);}})['then'](function(_0x4898b2){if(_0x4898b2){return _0x4898b2?{'count':_0x53a42c,'rows':_0x4898b2}:null;}})[_0xa5d7('0x27')](respondWithResult(_0x100af1,null))[_0xa5d7('0x48')](handleError(_0x100af1,null));};
\ No newline at end of file
+var _0x5a46=['count','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','options','includeAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','pick','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x2c4996,_0x118be3){var _0x2152c0=function(_0x30b4f9){while(--_0x30b4f9){_0x2c4996['push'](_0x2c4996['shift']());}};_0x2152c0(++_0x118be3);}(_0x5a46,0x86));var _0x65a4=function(_0x365a95,_0x5ae25c){_0x365a95=_0x365a95-0x0;var _0x24bf15=_0x5a46[_0x365a95];return _0x24bf15;};'use strict';var emlformat=require(_0x65a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65a4('0x1'));var jsonpatch=require(_0x65a4('0x2'));var rp=require(_0x65a4('0x3'));var moment=require(_0x65a4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65a4('0x5'));var util=require(_0x65a4('0x6'));var path=require(_0x65a4('0x7'));var sox=require(_0x65a4('0x8'));var csv=require('to-csv');var ejs=require(_0x65a4('0x9'));var fs=require('fs');var fs_extra=require(_0x65a4('0xa'));var _=require(_0x65a4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x65a4('0xc'));var deskjs=require(_0x65a4('0xd'));var toCsv=require(_0x65a4('0xe'));var querystring=require('querystring');var Papa=require(_0x65a4('0xf'));var Redis=require('ioredis');var authService=require(_0x65a4('0x10'));var qs=require(_0x65a4('0x11'));var as=require(_0x65a4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65a4('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x65a4('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4baac3,_0x3d8ae1){_0x3d8ae1=_0x3d8ae1||0xcc;return function(_0x252270){if(_0x252270){return _0x4baac3[_0x65a4('0x15')](_0x3d8ae1);}return _0x4baac3[_0x65a4('0x16')](_0x3d8ae1)[_0x65a4('0x17')]();};}function respondWithResult(_0x12810c,_0x53d5bd){_0x53d5bd=_0x53d5bd||0xc8;return function(_0x333204){if(_0x333204){return _0x12810c[_0x65a4('0x16')](_0x53d5bd)[_0x65a4('0x18')](_0x333204);}};}function respondWithFilteredResult(_0x163e3b,_0x1b8f64){return function(_0x1432b0){if(_0x1432b0){var _0x53152a=typeof _0x1b8f64[_0x65a4('0x19')]==='undefined'&&typeof _0x1b8f64[_0x65a4('0x1a')]===_0x65a4('0x1b');var _0x31f624=_0x1432b0[_0x65a4('0x1c')];var _0x362084=_0x53152a?0x0:_0x1b8f64[_0x65a4('0x19')];var _0x128c49=_0x53152a?_0x1432b0[_0x65a4('0x1c')]:_0x1b8f64[_0x65a4('0x19')]+_0x1b8f64['limit'];var _0x15f206;if(_0x128c49>=_0x31f624){_0x128c49=_0x31f624;_0x15f206=0xc8;}else{_0x15f206=0xce;}_0x163e3b['status'](_0x15f206);return _0x163e3b['set'](_0x65a4('0x1d'),_0x362084+'-'+_0x128c49+'/'+_0x31f624)[_0x65a4('0x18')](_0x1432b0);}return null;};}function patchUpdates(_0x2e6647){return function(_0xea5e3d){try{jsonpatch[_0x65a4('0x1e')](_0xea5e3d,_0x2e6647,!![]);}catch(_0x42a47b){return BPromise['reject'](_0x42a47b);}return _0xea5e3d[_0x65a4('0x1f')]();};}function saveUpdates(_0x39e82b,_0x47d908){return function(_0x32c59b){if(_0x32c59b){return _0x32c59b[_0x65a4('0x20')](_0x39e82b)[_0x65a4('0x21')](function(_0xb1bf62){return _0xb1bf62;});}return null;};}function removeEntity(_0x16cd6c,_0x35fe23){return function(_0x616017){if(_0x616017){return _0x616017[_0x65a4('0x22')]()[_0x65a4('0x21')](function(){var _0x4374b8=_0x616017[_0x65a4('0x23')]({'plain':!![]});var _0x18e421=_0x65a4('0x24');return db[_0x65a4('0x25')][_0x65a4('0x22')]({'where':{'type':_0x18e421,'resourceId':_0x4374b8['id']}})[_0x65a4('0x21')](function(){return _0x616017;});})[_0x65a4('0x21')](function(){_0x16cd6c[_0x65a4('0x16')](0xcc)[_0x65a4('0x17')]();});}};}function handleEntityNotFound(_0x2a8b8f,_0x97632d){return function(_0x269121){if(!_0x269121){_0x2a8b8f[_0x65a4('0x15')](0x194);}return _0x269121;};}function handleError(_0x114252,_0x4e4b7b){_0x4e4b7b=_0x4e4b7b||0x1f4;return function(_0x3adc1a){logger[_0x65a4('0x26')](_0x3adc1a['stack']);if(_0x3adc1a['name']){delete _0x3adc1a[_0x65a4('0x27')];}_0x114252[_0x65a4('0x16')](_0x4e4b7b)[_0x65a4('0x28')](_0x3adc1a);};}exports[_0x65a4('0x29')]=function(_0x13ed75,_0x1ce309){var _0x273505={},_0x4dcb6d={},_0x241daa={'count':0x0,'rows':[]};return db[_0x65a4('0x2a')][_0x65a4('0x2b')]()[_0x65a4('0x21')](function(_0x5a7e72){_0x4dcb6d[_0x65a4('0x2c')]=_['keys'](_0x5a7e72);_0x4dcb6d[_0x65a4('0x2d')]=_[_0x65a4('0x2e')](_0x13ed75['query']);_0x4dcb6d[_0x65a4('0x2f')]=_[_0x65a4('0x30')](_0x4dcb6d[_0x65a4('0x2c')],_0x4dcb6d[_0x65a4('0x2d')]);_0x273505[_0x65a4('0x31')]=_['intersection'](_0x4dcb6d[_0x65a4('0x2c')],qs[_0x65a4('0x32')](_0x13ed75[_0x65a4('0x2d')][_0x65a4('0x32')]));_0x273505[_0x65a4('0x31')]=_0x273505['attributes'][_0x65a4('0x33')]?_0x273505['attributes']:_0x4dcb6d['model'];if(!_0x13ed75['query'][_0x65a4('0x34')](_0x65a4('0x35'))){_0x273505[_0x65a4('0x1a')]=qs[_0x65a4('0x1a')](_0x13ed75[_0x65a4('0x2d')][_0x65a4('0x1a')]);_0x273505[_0x65a4('0x19')]=qs['offset'](_0x13ed75[_0x65a4('0x2d')][_0x65a4('0x19')]);}_0x273505['order']=qs[_0x65a4('0x36')](_0x13ed75['query'][_0x65a4('0x36')]);_0x273505[_0x65a4('0x37')]=qs[_0x65a4('0x2f')](_['pick'](_0x13ed75[_0x65a4('0x2d')],_0x4dcb6d[_0x65a4('0x2f')]),_0x5a7e72);if(_0x13ed75['query']['filter']){_0x273505[_0x65a4('0x37')]=_[_0x65a4('0x38')](_0x273505[_0x65a4('0x37')],{'$or':_['map'](_0x273505[_0x65a4('0x31')],function(_0x471272){var _0x509a3a={};_0x509a3a[_0x471272]={'$like':'%'+_0x13ed75[_0x65a4('0x2d')][_0x65a4('0x39')]+'%'};return _0x509a3a;})});}_0x273505=_[_0x65a4('0x38')]({},_0x273505,_0x13ed75[_0x65a4('0x3a')]);var _0x4b1bba={'where':_0x273505[_0x65a4('0x37')]};return db[_0x65a4('0x2a')][_0x65a4('0x1c')](_0x4b1bba)[_0x65a4('0x21')](function(_0x1eed94){_0x241daa['count']=_0x1eed94;if(_0x13ed75['query'][_0x65a4('0x3b')]){_0x273505['include']=[{'all':!![]}];}return db[_0x65a4('0x2a')]['findAll'](_0x273505);})[_0x65a4('0x21')](function(_0x463e58){_0x241daa[_0x65a4('0x3c')]=_0x463e58;return _0x241daa;})['then'](respondWithFilteredResult(_0x1ce309,_0x273505))[_0x65a4('0x3d')](handleError(_0x1ce309,null));})[_0x65a4('0x3d')](handleError(_0x1ce309,null));};exports[_0x65a4('0x3e')]=function(_0x4d1e52,_0x9d9971){var _0x11fac={'raw':![],'where':{'id':_0x4d1e52[_0x65a4('0x3f')]['id']}},_0x234da0={};_0x234da0[_0x65a4('0x2c')]=_[_0x65a4('0x2e')](db[_0x65a4('0x2a')]['rawAttributes']);_0x234da0[_0x65a4('0x2d')]=_[_0x65a4('0x2e')](_0x4d1e52[_0x65a4('0x2d')]);_0x234da0[_0x65a4('0x2f')]=_['intersection'](_0x234da0[_0x65a4('0x2c')],_0x234da0['query']);_0x11fac[_0x65a4('0x31')]=_[_0x65a4('0x30')](_0x234da0[_0x65a4('0x2c')],qs['fields'](_0x4d1e52[_0x65a4('0x2d')]['fields']));_0x11fac[_0x65a4('0x31')]=_0x11fac['attributes'][_0x65a4('0x33')]?_0x11fac[_0x65a4('0x31')]:_0x234da0[_0x65a4('0x2c')];if(_0x4d1e52[_0x65a4('0x2d')]['includeAll']){_0x11fac['include']=[{'all':!![]}];}_0x11fac=_[_0x65a4('0x38')]({},_0x11fac,_0x4d1e52[_0x65a4('0x3a')]);return db[_0x65a4('0x2a')]['find'](_0x11fac)[_0x65a4('0x21')](handleEntityNotFound(_0x9d9971,null))[_0x65a4('0x21')](respondWithResult(_0x9d9971,null))[_0x65a4('0x3d')](handleError(_0x9d9971,null));};exports[_0x65a4('0x40')]=function(_0x3409a2,_0x25f438){return db[_0x65a4('0x2a')][_0x65a4('0x40')](_0x3409a2[_0x65a4('0x41')],{})['then'](function(_0x1e56ab){var _0x2b75bc=_0x3409a2['user'][_0x65a4('0x23')]({'plain':!![]});if(!_0x2b75bc)throw new Error(_0x65a4('0x42'));if(_0x2b75bc[_0x65a4('0x43')]==='user'){var _0x1baff1=_0x1e56ab[_0x65a4('0x23')]({'plain':!![]});var _0x1b1380=_0x65a4('0x24');return db[_0x65a4('0x44')]['find']({'where':{'name':_0x1b1380,'userProfileId':_0x2b75bc['userProfileId']},'raw':!![]})['then'](function(_0x44aee9){if(_0x44aee9&&_0x44aee9[_0x65a4('0x45')]===0x0){return db['UserProfileResource'][_0x65a4('0x40')]({'name':_0x1baff1['name'],'resourceId':_0x1baff1['id'],'type':_0x44aee9['name'],'sectionId':_0x44aee9['id']},{})[_0x65a4('0x21')](function(){return _0x1e56ab;});}else{return _0x1e56ab;}})['catch'](function(_0x1091fe){logger['error'](_0x65a4('0x46'),_0x1091fe);throw _0x1091fe;});}return _0x1e56ab;})[_0x65a4('0x21')](respondWithResult(_0x25f438,0xc9))[_0x65a4('0x3d')](handleError(_0x25f438,null));};exports[_0x65a4('0x20')]=function(_0x2dc864,_0x2d9317){if(_0x2dc864[_0x65a4('0x41')]['id']){delete _0x2dc864[_0x65a4('0x41')]['id'];}return db[_0x65a4('0x2a')][_0x65a4('0x47')]({'where':{'id':_0x2dc864[_0x65a4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2d9317,null))[_0x65a4('0x21')](saveUpdates(_0x2dc864[_0x65a4('0x41')],null))[_0x65a4('0x21')](respondWithResult(_0x2d9317,null))[_0x65a4('0x3d')](handleError(_0x2d9317,null));};exports['destroy']=function(_0x221c89,_0x48bcd1){return db[_0x65a4('0x2a')][_0x65a4('0x47')]({'where':{'id':_0x221c89[_0x65a4('0x3f')]['id']}})[_0x65a4('0x21')](handleEntityNotFound(_0x48bcd1,null))[_0x65a4('0x21')](removeEntity(_0x48bcd1,null))[_0x65a4('0x3d')](handleError(_0x48bcd1,null));};exports[_0x65a4('0x2b')]=function(_0x3df4be,_0x2550bb){return db[_0x65a4('0x2a')]['describe']()[_0x65a4('0x21')](respondWithResult(_0x2550bb,null))[_0x65a4('0x3d')](handleError(_0x2550bb,null));};exports[_0x65a4('0x48')]=function(_0x3878ba,_0x1dc29f,_0x1d3adc){return db[_0x65a4('0x49')][_0x65a4('0x47')]({'where':{'id':_0x3878ba['params']['id']}})[_0x65a4('0x21')](handleEntityNotFound(_0x1dc29f,null))['then'](function(_0x10e978){if(_0x10e978){return _0x10e978['addContacts'](_0x3878ba['body'][_0x65a4('0x4a')],_[_0x65a4('0x4b')](_0x3878ba['body'],[_0x65a4('0x4a'),'id'])||{});}})[_0x65a4('0x21')](respondWithResult(_0x1dc29f,null))['catch'](handleError(_0x1dc29f,null));};exports[_0x65a4('0x4c')]=function(_0x13cab7,_0x259077,_0x109e4f){var _0x1f3cd6={};var _0x50d4c6={};var _0x1a38df;var _0x2c6b8d;return db[_0x65a4('0x2a')][_0x65a4('0x4d')]({'where':{'id':_0x13cab7[_0x65a4('0x3f')]['id']}})[_0x65a4('0x21')](handleEntityNotFound(_0x259077,null))[_0x65a4('0x21')](function(_0x477463){if(_0x477463){_0x1a38df=_0x477463;_0x50d4c6[_0x65a4('0x2c')]=_[_0x65a4('0x2e')](db[_0x65a4('0x49')][_0x65a4('0x4e')]);_0x50d4c6[_0x65a4('0x2d')]=_[_0x65a4('0x2e')](_0x13cab7[_0x65a4('0x2d')]);_0x50d4c6['filters']=_['intersection'](_0x50d4c6[_0x65a4('0x2c')],_0x50d4c6[_0x65a4('0x2d')]);_0x1f3cd6[_0x65a4('0x31')]=_[_0x65a4('0x30')](_0x50d4c6['model'],qs[_0x65a4('0x32')](_0x13cab7['query']['fields']));_0x1f3cd6[_0x65a4('0x31')]=_0x1f3cd6['attributes']['length']?_0x1f3cd6[_0x65a4('0x31')]:_0x50d4c6[_0x65a4('0x2c')];_0x1f3cd6['order']=qs[_0x65a4('0x36')](_0x13cab7[_0x65a4('0x2d')]['sort']);_0x1f3cd6['where']=qs[_0x65a4('0x2f')](_[_0x65a4('0x4f')](_0x13cab7[_0x65a4('0x2d')],_0x50d4c6[_0x65a4('0x2f')]));if(_0x13cab7[_0x65a4('0x2d')][_0x65a4('0x39')]){_0x1f3cd6[_0x65a4('0x37')]=_[_0x65a4('0x38')](_0x1f3cd6[_0x65a4('0x37')],{'$or':_[_0x65a4('0x50')](_0x1f3cd6[_0x65a4('0x31')],function(_0x38de54){var _0xc98299={};_0xc98299[_0x38de54]={'$like':'%'+_0x13cab7['query'][_0x65a4('0x39')]+'%'};return _0xc98299;})});}_0x1f3cd6=_[_0x65a4('0x38')]({},_0x1f3cd6,_0x13cab7['options']);return _0x1a38df[_0x65a4('0x4c')](_0x1f3cd6);}})[_0x65a4('0x21')](function(_0x4f0ddb){if(_0x4f0ddb){_0x2c6b8d=_0x4f0ddb[_0x65a4('0x33')];if(!_0x13cab7['query'][_0x65a4('0x34')](_0x65a4('0x35'))){_0x1f3cd6['limit']=qs[_0x65a4('0x1a')](_0x13cab7[_0x65a4('0x2d')][_0x65a4('0x1a')]);_0x1f3cd6[_0x65a4('0x19')]=qs[_0x65a4('0x19')](_0x13cab7['query']['offset']);}return _0x1a38df[_0x65a4('0x4c')](_0x1f3cd6);}})[_0x65a4('0x21')](function(_0x4b7fa7){if(_0x4b7fa7){return _0x4b7fa7?{'count':_0x2c6b8d,'rows':_0x4b7fa7}:null;}})['then'](respondWithResult(_0x259077,null))[_0x65a4('0x3d')](handleError(_0x259077,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index d5d3099..015cac5 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 _0x722f=['moment','bluebird','path','../../config/environment','./cmCompany.attributes','define','cm_companies','util','../../config/logger'];(function(_0x496d91,_0x5371f6){var _0x1e5f62=function(_0x83ab9b){while(--_0x83ab9b){_0x496d91['push'](_0x496d91['shift']());}};_0x1e5f62(++_0x5371f6);}(_0x722f,0x1ed));var _0xf722=function(_0x19baab,_0x3b2716){_0x19baab=_0x19baab-0x0;var _0x317bf6=_0x722f[_0x19baab];return _0x317bf6;};'use strict';var _=require('lodash');var util=require(_0xf722('0x0'));var logger=require(_0xf722('0x1'))('api');var moment=require(_0xf722('0x2'));var BPromise=require(_0xf722('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf722('0x4'));var rimraf=require('rimraf');var config=require(_0xf722('0x5'));var attributes=require(_0xf722('0x6'));module['exports']=function(_0x7188e4,_0x40127d){return _0x7188e4[_0xf722('0x7')]('CmCompany',attributes,{'tableName':_0xf722('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7301=['bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0x7301,0xbe));var _0x1730=function(_0x103495,_0x2b18ce){_0x103495=_0x103495-0x0;var _0x4fc9c1=_0x7301[_0x103495];return _0x4fc9c1;};'use strict';var _=require(_0x1730('0x0'));var util=require(_0x1730('0x1'));var logger=require(_0x1730('0x2'))(_0x1730('0x3'));var moment=require(_0x1730('0x4'));var BPromise=require(_0x1730('0x5'));var rp=require(_0x1730('0x6'));var fs=require('fs');var path=require(_0x1730('0x7'));var rimraf=require(_0x1730('0x8'));var config=require('../../config/environment');var attributes=require(_0x1730('0x9'));module[_0x1730('0xa')]=function(_0xe4f2ce,_0x2527e8){return _0xe4f2ce['define'](_0x1730('0xb'),attributes,{'tableName':_0x1730('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index bc1f1fe..1625445 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 _0xcc8d=['stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x43eb54,_0x35e944){var _0x3892ac=function(_0xbc2e6b){while(--_0xbc2e6b){_0x43eb54['push'](_0x43eb54['shift']());}};_0x3892ac(++_0x35e944);}(_0xcc8d,0x1a8));var _0xdcc8=function(_0x43e885,_0x5700f1){_0x43e885=_0x43e885-0x0;var _0x18df65=_0xcc8d[_0x43e885];return _0x18df65;};'use strict';var _=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var moment=require(_0xdcc8('0x2'));var BPromise=require('bluebird');var rs=require(_0xdcc8('0x3'));var fs=require('fs');var Redis=require(_0xdcc8('0x4'));var db=require(_0xdcc8('0x5'))['db'];var utils=require(_0xdcc8('0x6'));var logger=require(_0xdcc8('0x7'))(_0xdcc8('0x8'));var config=require('../../config/environment');var jayson=require(_0xdcc8('0x9'));var client=jayson[_0xdcc8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27caea,_0x20b619,_0x467e2d){return new BPromise(function(_0x5149f5,_0x12f180){return client[_0xdcc8('0xb')](_0x27caea,_0x467e2d)[_0xdcc8('0xc')](function(_0x472e5d){logger[_0xdcc8('0xd')]('CmCompany,\x20%s,\x20%s',_0x20b619,_0xdcc8('0xe'));logger[_0xdcc8('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x20b619,_0xdcc8('0xe'),JSON[_0xdcc8('0x10')](_0x472e5d));if(_0x472e5d[_0xdcc8('0x11')]){if(_0x472e5d[_0xdcc8('0x11')][_0xdcc8('0x12')]===0x1f4){logger[_0xdcc8('0x11')]('CmCompany,\x20%s,\x20%s',_0x20b619,_0x472e5d[_0xdcc8('0x11')][_0xdcc8('0x13')]);return _0x12f180(_0x472e5d[_0xdcc8('0x11')][_0xdcc8('0x13')]);}logger['error'](_0xdcc8('0x14'),_0x20b619,_0x472e5d['error'][_0xdcc8('0x13')]);return _0x5149f5(_0x472e5d[_0xdcc8('0x11')][_0xdcc8('0x13')]);}else{logger[_0xdcc8('0xd')]('CmCompany,\x20%s,\x20%s',_0x20b619,_0xdcc8('0xe'));_0x5149f5(_0x472e5d[_0xdcc8('0x15')][_0xdcc8('0x13')]);}})['catch'](function(_0x29ac81){logger[_0xdcc8('0x11')](_0xdcc8('0x14'),_0x20b619,_0x29ac81);_0x12f180(_0x29ac81);});});}
\ No newline at end of file
+var _0xf0ce=['message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x25b022,_0x394a08){var _0x2e13a5=function(_0xe9495d){while(--_0xe9495d){_0x25b022['push'](_0x25b022['shift']());}};_0x2e13a5(++_0x394a08);}(_0xf0ce,0xde));var _0xef0c=function(_0xb44ced,_0x369a5c){_0xb44ced=_0xb44ced-0x0;var _0x4c14af=_0xf0ce[_0xb44ced];return _0x4c14af;};'use strict';var _=require(_0xef0c('0x0'));var util=require(_0xef0c('0x1'));var moment=require('moment');var BPromise=require(_0xef0c('0x2'));var rs=require(_0xef0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef0c('0x4'))['db'];var utils=require(_0xef0c('0x5'));var logger=require(_0xef0c('0x6'))('rpc');var config=require(_0xef0c('0x7'));var jayson=require(_0xef0c('0x8'));var client=jayson[_0xef0c('0x9')][_0xef0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e4819,_0x10a419,_0x143bea){return new BPromise(function(_0x228c40,_0x41bac5){return client['request'](_0x5e4819,_0x143bea)[_0xef0c('0xb')](function(_0x1976d8){logger[_0xef0c('0xc')](_0xef0c('0xd'),_0x10a419,'request\x20sent');logger[_0xef0c('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x10a419,_0xef0c('0xf'),JSON[_0xef0c('0x10')](_0x1976d8));if(_0x1976d8[_0xef0c('0x11')]){if(_0x1976d8[_0xef0c('0x11')]['code']===0x1f4){logger[_0xef0c('0x11')](_0xef0c('0xd'),_0x10a419,_0x1976d8[_0xef0c('0x11')][_0xef0c('0x12')]);return _0x41bac5(_0x1976d8['error'][_0xef0c('0x12')]);}logger['error'](_0xef0c('0xd'),_0x10a419,_0x1976d8[_0xef0c('0x11')]['message']);return _0x228c40(_0x1976d8[_0xef0c('0x11')][_0xef0c('0x12')]);}else{logger[_0xef0c('0xc')]('CmCompany,\x20%s,\x20%s',_0x10a419,'request\x20sent');_0x228c40(_0x1976d8[_0xef0c('0x13')][_0xef0c('0x12')]);}})['catch'](function(_0x15b698){logger[_0xef0c('0x11')](_0xef0c('0xd'),_0x10a419,_0x15b698);_0x41bac5(_0x15b698);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index fd94c6b..8c2e0d6 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 _0x48c5=['describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x48c5,0x14e));var _0x548c=function(_0x509318,_0xf0d257){_0x509318=_0x509318-0x0;var _0x39289a=_0x48c5[_0x509318];return _0x39289a;};'use strict';var multer=require('multer');var util=require(_0x548c('0x0'));var path=require(_0x548c('0x1'));var timeout=require(_0x548c('0x2'));var express=require(_0x548c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x548c('0x4'));var config=require(_0x548c('0x5'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x548c('0x6')](),controller['index']);router[_0x548c('0x7')]('/describe',auth[_0x548c('0x6')](),controller[_0x548c('0x8')]);router[_0x548c('0x7')](_0x548c('0x9'),auth[_0x548c('0x6')](),controller[_0x548c('0xa')]);router[_0x548c('0x7')](_0x548c('0xb'),auth[_0x548c('0x6')](),controller[_0x548c('0xc')]);router[_0x548c('0xd')]('/',auth[_0x548c('0x6')](),controller[_0x548c('0xe')]);router[_0x548c('0xd')]('/:id/contacts',auth[_0x548c('0x6')](),controller[_0x548c('0xf')]);router[_0x548c('0x10')](_0x548c('0x9'),auth[_0x548c('0x6')](),controller[_0x548c('0x11')]);router[_0x548c('0x12')](_0x548c('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x906b=['./cmCompany.controller','index','get','/describe','isAuthenticated','describe','/:id/contacts','getContacts','post','create','addContacts','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x906b,0x1ef));var _0xb906=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x906b[_0x11c573];return _0x6b72de;};'use strict';var multer=require(_0xb906('0x0'));var util=require(_0xb906('0x1'));var path=require(_0xb906('0x2'));var timeout=require(_0xb906('0x3'));var express=require(_0xb906('0x4'));var router=express[_0xb906('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb906('0x6'));var interaction=require(_0xb906('0x7'));var config=require(_0xb906('0x8'));var controller=require(_0xb906('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb906('0xa')]);router[_0xb906('0xb')](_0xb906('0xc'),auth[_0xb906('0xd')](),controller[_0xb906('0xe')]);router['get']('/:id',auth[_0xb906('0xd')](),controller['show']);router['get'](_0xb906('0xf'),auth[_0xb906('0xd')](),controller[_0xb906('0x10')]);router[_0xb906('0x11')]('/',auth['isAuthenticated'](),controller[_0xb906('0x12')]);router[_0xb906('0x11')](_0xb906('0xf'),auth[_0xb906('0xd')](),controller[_0xb906('0x13')]);router[_0xb906('0x14')](_0xb906('0x15'),auth[_0xb906('0xd')](),controller['update']);router['delete'](_0xb906('0x15'),auth[_0xb906('0xd')](),controller[_0xb906('0x16')]);module[_0xb906('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index bb58ad7..bfd36fb 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 _0xfbae=['sequelize','exports','STRING','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0xfbae,0x1b7));var _0xefba=function(_0x52256e,_0xdb5686){_0x52256e=_0x52256e-0x0;var _0x1c951c=_0xfbae[_0x52256e];return _0x1c951c;};'use strict';var _=require(_0xefba('0x0'));var Sequelize=require(_0xefba('0x1'));module[_0xefba('0x2')]={'firstName':{'type':Sequelize[_0xefba('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xefba('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xefba('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xefba('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xefba('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xefba('0x3')]},'url':{'type':Sequelize[_0xefba('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xefba('0x3')]},'skype':{'type':Sequelize[_0xefba('0x3')]},'teams':{'type':Sequelize[_0xefba('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xefba('0x3')]},'wechat':{'type':Sequelize[_0xefba('0x3')]},'telegram':{'type':Sequelize[_0xefba('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xefba('0x3')]},'priority':{'type':Sequelize[_0xefba('0x4')](0x2)[_0xefba('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xefba('0x6')],'defaultValue':Sequelize[_0xefba('0x7')]},'dialTimezone':{'type':Sequelize[_0xefba('0x3')]},'utcOffset':{'type':Sequelize[_0xefba('0x4')]}};
\ No newline at end of file
+var _0x891a=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x3a3e88,_0x4801a0){var _0x1f4fc8=function(_0x1536a4){while(--_0x1536a4){_0x3a3e88['push'](_0x3a3e88['shift']());}};_0x1f4fc8(++_0x4801a0);}(_0x891a,0x178));var _0xa891=function(_0x115cdd,_0x1db606){_0x115cdd=_0x115cdd-0x0;var _0x3bd6d5=_0x891a[_0x115cdd];return _0x3bd6d5;};'use strict';var _=require(_0xa891('0x0'));var Sequelize=require(_0xa891('0x1'));module[_0xa891('0x2')]={'firstName':{'type':Sequelize[_0xa891('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa891('0x3')]},'street':{'type':Sequelize[_0xa891('0x3')]},'postalCode':{'type':Sequelize[_0xa891('0x3')]},'city':{'type':Sequelize[_0xa891('0x3')]},'country':{'type':Sequelize[_0xa891('0x3')]},'dateOfBirth':{'type':Sequelize[_0xa891('0x3')]},'description':{'type':Sequelize[_0xa891('0x4')]},'phone':{'type':Sequelize[_0xa891('0x3')]},'mobile':{'type':Sequelize[_0xa891('0x3')]},'fax':{'type':Sequelize[_0xa891('0x3')]},'email':{'type':Sequelize[_0xa891('0x3')]},'url':{'type':Sequelize[_0xa891('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xa891('0x3')]},'twitter':{'type':Sequelize[_0xa891('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xa891('0x3')]},'viber':{'type':Sequelize[_0xa891('0x3')]},'line':{'type':Sequelize[_0xa891('0x3')]},'wechat':{'type':Sequelize[_0xa891('0x3')]},'telegram':{'type':Sequelize[_0xa891('0x3')]},'UserId':{'type':Sequelize[_0xa891('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xa891('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xa891('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa891('0x7')],'defaultValue':Sequelize[_0xa891('0x8')]},'dialTimezone':{'type':Sequelize[_0xa891('0x3')]},'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 5ce1e7b..bb3e52b 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments'];(function(_0x911fe2,_0x1f3d34){var _0x8b0826=function(_0x35290a){while(--_0x35290a){_0x911fe2['push'](_0x911fe2['shift']());}};_0x8b0826(++_0x1f3d34);}(_0xdb7c,0x1d5));var _0xcdb7=function(_0x5f0f7a,_0x244c53){_0x5f0f7a=_0x5f0f7a-0x0;var _0x8742e7=_0xdb7c[_0x5f0f7a];return _0x8742e7;};'use strict';var _=require(_0xcdb7('0x0'));var moment=require(_0xcdb7('0x1'));var random=require(_0xcdb7('0x2'));var fs=require('fs');var path=require(_0xcdb7('0x3'));var util=require(_0xcdb7('0x4'));var tnef=require(_0xcdb7('0x5'));var logger=require(_0xcdb7('0x6'))(_0xcdb7('0x7'));var config=require(_0xcdb7('0x8'));function getAddress(_0x58811d){var _0x343831=_[_0xcdb7('0x9')](_0x58811d['value']);return _0x343831&&_0x343831['address']?_0x343831['address']:_0xcdb7('0xa')+random[_0xcdb7('0xb')](0x6)+_0xcdb7('0xc');}function getFirstName(_0x58ffff){var _0x6fefca=_[_0xcdb7('0x9')](_0x58ffff['value']);if(_0x6fefca&&_0x6fefca[_0xcdb7('0xd')]){if(_0x6fefca[_0xcdb7('0xd')]==_0x6fefca[_0xcdb7('0xe')]){return _0x6fefca['name'][_0xcdb7('0xf')](0x0,_0x6fefca[_0xcdb7('0xd')][_0xcdb7('0x10')]('@'));}var _0x5143dd=_0x6fefca[_0xcdb7('0xd')][_0xcdb7('0x11')](/\s+/);return _0x5143dd[_0xcdb7('0x12')]>0x1?_0x5143dd[_0xcdb7('0x13')](0x0,-0x1)['join']('\x20'):_0x6fefca[_0xcdb7('0xd')];}return _0xcdb7('0x14');}function getLastName(_0x3d0453){var _0x51adb1=_[_0xcdb7('0x9')](_0x3d0453[_0xcdb7('0x15')]);if(_0x51adb1&&_0x51adb1[_0xcdb7('0xd')]){var _0x34fa0f=_0x51adb1['name']['split'](/\s+/);return _0x34fa0f['length']>0x1?_0x34fa0f[_0xcdb7('0x16')]():'';}return'';}function getMails(_0x34136e,_0x2ec455){var _0xc24744='';for(var _0x3e2fe8=0x0;_0x3e2fe8<_0x2ec455[_0xcdb7('0x15')]['length'];_0x3e2fe8+=0x1){if(_0x2ec455['value'][_0x3e2fe8][_0xcdb7('0xe')]!==_0x34136e){if(!_['isEmpty'](_0xc24744)){_0xc24744+=',';}_0xc24744+=_0x2ec455[_0xcdb7('0x15')][_0x3e2fe8][_0xcdb7('0xd')]||_0x2ec455[_0xcdb7('0x15')][_0x3e2fe8][_0xcdb7('0xe')]||'';_0xc24744+='\x20<';_0xc24744+=_0x2ec455[_0xcdb7('0x15')][_0x3e2fe8][_0xcdb7('0xe')]?_0x2ec455[_0xcdb7('0x15')][_0x3e2fe8]['address']:_0xcdb7('0xa')+random[_0xcdb7('0xb')](0x6)+_0xcdb7('0xc');_0xc24744+='>';}}return _0xc24744;}function parseEmail(_0x33134a,_0x34c71d,_0x22b07d){if(_0x34c71d[_0xcdb7('0x17')]){var _0x2e3443=/