From: Andrea Amorese
Date: Thu, 23 Sep 2021 08:14:05 +0000 (+0200)
Subject: Built motion from commit d770e63b.|2.5.35
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22card-image.png//%27?a=commitdiff_plain;h=6fd89c377917f9944c640728ffc307f8b90ceec9;p=motion2.git
Built motion from commit d770e63b.|2.5.35
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 8b7881a..751c908 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-23T07:58:14.930Z",
+ "time": "2021-09-23T08:07:27.348Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index ca18e1a..524a5a0 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-23T07:58:14.930Z",
+ "time": "2021-09-23T08:07:27.348Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 0198b99..56c9429 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 _0x4317=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','bot'];(function(_0x265a85,_0x28374d){var _0xd35f61=function(_0x1fff20){while(--_0x1fff20){_0x265a85['push'](_0x265a85['shift']());}};_0xd35f61(++_0x28374d);}(_0x4317,0x7c));var _0x7431=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4317[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')],'get':function(_0x1ad054){return this['getDataValue'](_0x7431('0x2'));}},'action':{'type':Sequelize[_0x7431('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7431('0x4'),_0x7431('0x5'),_0x7431('0x6'),_0x7431('0x7'),'urlForward','browser',_0x7431('0x8'),_0x7431('0x9')]],'msg':_0x7431('0xa')}},'comment':_0x7431('0xa')},'data1':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xb')},'data2':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xc')},'data3':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xd')},'data4':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xe')},'data5':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xf')},'data6':{'type':Sequelize[_0x7431('0x3')],'comments':_0x7431('0x10')},'data7':{'type':Sequelize[_0x7431('0x11')],'comments':_0x7431('0x12')}};
\ No newline at end of file
+var _0xa46e=['urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','action','contactManager','motionbar'];(function(_0x3e367d,_0x3f3eba){var _0x45ac01=function(_0x258a25){while(--_0x258a25){_0x3e367d['push'](_0x3e367d['shift']());}};_0x45ac01(++_0x3f3eba);}(_0xa46e,0x8a));var _0xea46=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xa46e[_0x3132e8];return _0x43eb8c;};'use strict';var Sequelize=require(_0xea46('0x0'));module[_0xea46('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x372d94){return this[_0xea46('0x2')](_0xea46('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xea46('0x4'),'integration',_0xea46('0x5'),'jscripty',_0xea46('0x6'),'browser',_0xea46('0x7'),_0xea46('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xea46('0x9')},'data1':{'type':Sequelize[_0xea46('0xa')](0x1000),'comment':_0xea46('0xb')},'data2':{'type':Sequelize[_0xea46('0xa')](0x1000),'comment':_0xea46('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['STRING'](0x1000),'comments':_0xea46('0xd')},'data5':{'type':Sequelize[_0xea46('0xa')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize[_0xea46('0xa')],'comments':_0xea46('0xe')},'data7':{'type':Sequelize[_0xea46('0xf')],'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 e6c08ff..53d2355 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 _0x2f40=['lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','destroy','then','error','stack','name','body','find','catch','Action','params','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x2f40,0x172));var _0x02f4=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x2f40[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02f4('0x0'));var zipdir=require(_0x02f4('0x1'));var jsonpatch=require(_0x02f4('0x2'));var rp=require('request-promise');var moment=require(_0x02f4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02f4('0x4'));var path=require('path');var sox=require(_0x02f4('0x5'));var csv=require(_0x02f4('0x6'));var ejs=require(_0x02f4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02f4('0x8'));var squel=require(_0x02f4('0x9'));var crypto=require('crypto');var jsforce=require(_0x02f4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x02f4('0x6'));var querystring=require(_0x02f4('0xb'));var Papa=require(_0x02f4('0xc'));var Redis=require(_0x02f4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x02f4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02f4('0xf'));var logger=require('../../config/logger')(_0x02f4('0x10'));var utils=require(_0x02f4('0x11'));var config=require(_0x02f4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x02f4('0x13'))['db'];function respondWithStatusCode(_0x5cd62b,_0x1c069d){_0x1c069d=_0x1c069d||0xcc;return function(_0xafe7d3){if(_0xafe7d3){return _0x5cd62b[_0x02f4('0x14')](_0x1c069d);}return _0x5cd62b[_0x02f4('0x15')](_0x1c069d)[_0x02f4('0x16')]();};}function respondWithResult(_0xa4b49b,_0x65239){_0x65239=_0x65239||0xc8;return function(_0x2ca339){if(_0x2ca339){return _0xa4b49b[_0x02f4('0x15')](_0x65239)[_0x02f4('0x17')](_0x2ca339);}};}function respondWithFilteredResult(_0x2017de,_0x37733d){return function(_0x3a7f49){if(_0x3a7f49){var _0x4db4f3=typeof _0x37733d['offset']===_0x02f4('0x18')&&typeof _0x37733d['limit']==='undefined';var _0x542934=_0x3a7f49[_0x02f4('0x19')];var _0x4da85c=_0x4db4f3?0x0:_0x37733d[_0x02f4('0x1a')];var _0x5ddd77=_0x4db4f3?_0x3a7f49['count']:_0x37733d[_0x02f4('0x1a')]+_0x37733d[_0x02f4('0x1b')];var _0x59a0f9;if(_0x5ddd77>=_0x542934){_0x5ddd77=_0x542934;_0x59a0f9=0xc8;}else{_0x59a0f9=0xce;}_0x2017de[_0x02f4('0x15')](_0x59a0f9);return _0x2017de[_0x02f4('0x1c')]('Content-Range',_0x4da85c+'-'+_0x5ddd77+'/'+_0x542934)[_0x02f4('0x17')](_0x3a7f49);}return null;};}function patchUpdates(_0x2ee0fb){return function(_0x127bd6){try{jsonpatch['apply'](_0x127bd6,_0x2ee0fb,!![]);}catch(_0x4612f2){return BPromise[_0x02f4('0x1d')](_0x4612f2);}return _0x127bd6[_0x02f4('0x1e')]();};}function saveUpdates(_0xdd84c,_0x4b7ccf){return function(_0x194e21){if(_0x194e21){return _0x194e21[_0x02f4('0x1f')](_0xdd84c)['then'](function(_0x1cedbc){return _0x1cedbc;});}return null;};}function removeEntity(_0x46d77d,_0xf71cd0){return function(_0x237fe2){if(_0x237fe2){return _0x237fe2[_0x02f4('0x20')]()[_0x02f4('0x21')](function(){_0x46d77d[_0x02f4('0x15')](0xcc)[_0x02f4('0x16')]();});}};}function handleEntityNotFound(_0x16812c,_0x5a501f){return function(_0xa1c370){if(!_0xa1c370){_0x16812c[_0x02f4('0x14')](0x194);}return _0xa1c370;};}function handleError(_0x53a184,_0x369a95){_0x369a95=_0x369a95||0x1f4;return function(_0x570a5d){logger[_0x02f4('0x22')](_0x570a5d[_0x02f4('0x23')]);if(_0x570a5d[_0x02f4('0x24')]){delete _0x570a5d[_0x02f4('0x24')];}_0x53a184[_0x02f4('0x15')](_0x369a95)['send'](_0x570a5d);};}exports['update']=function(_0x38b3e5,_0x156d8d){if(_0x38b3e5[_0x02f4('0x25')]['id']){delete _0x38b3e5['body']['id'];}return db['Action'][_0x02f4('0x26')]({'where':{'id':_0x38b3e5['params']['id']}})[_0x02f4('0x21')](handleEntityNotFound(_0x156d8d,null))[_0x02f4('0x21')](saveUpdates(_0x38b3e5[_0x02f4('0x25')],null))[_0x02f4('0x21')](respondWithResult(_0x156d8d,null))[_0x02f4('0x27')](handleError(_0x156d8d,null));};exports[_0x02f4('0x20')]=function(_0x2724a4,_0x5eba52){return db[_0x02f4('0x28')]['find']({'where':{'id':_0x2724a4[_0x02f4('0x29')]['id']}})['then'](handleEntityNotFound(_0x5eba52,null))[_0x02f4('0x21')](removeEntity(_0x5eba52,null))[_0x02f4('0x27')](handleError(_0x5eba52,null));};
\ No newline at end of file
+var _0xe41a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','name','send','body','Action','params','catch','eml-format','rimraf','fast-json-patch','moment','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x223be2,_0x1db187){var _0x5dbb08=function(_0x538507){while(--_0x538507){_0x223be2['push'](_0x223be2['shift']());}};_0x5dbb08(++_0x1db187);}(_0xe41a,0xf5));var _0xae41=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xe41a[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require(_0xae41('0x0'));var rimraf=require(_0xae41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae41('0x2'));var rp=require('request-promise');var moment=require(_0xae41('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xae41('0x4'));var sox=require('sox');var csv=require(_0xae41('0x5'));var ejs=require(_0xae41('0x6'));var fs=require('fs');var fs_extra=require(_0xae41('0x7'));var _=require('lodash');var squel=require(_0xae41('0x8'));var crypto=require('crypto');var jsforce=require(_0xae41('0x9'));var deskjs=require(_0xae41('0xa'));var toCsv=require(_0xae41('0x5'));var querystring=require(_0xae41('0xb'));var Papa=require(_0xae41('0xc'));var Redis=require('ioredis');var authService=require(_0xae41('0xd'));var qs=require(_0xae41('0xe'));var as=require(_0xae41('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae41('0x10'))(_0xae41('0x11'));var utils=require(_0xae41('0x12'));var config=require(_0xae41('0x13'));var licenseUtil=require(_0xae41('0x14'));var db=require(_0xae41('0x15'))['db'];function respondWithStatusCode(_0x5596ea,_0x41369a){_0x41369a=_0x41369a||0xcc;return function(_0x380360){if(_0x380360){return _0x5596ea[_0xae41('0x16')](_0x41369a);}return _0x5596ea[_0xae41('0x17')](_0x41369a)[_0xae41('0x18')]();};}function respondWithResult(_0x19a3d5,_0x1a7e8b){_0x1a7e8b=_0x1a7e8b||0xc8;return function(_0xec424d){if(_0xec424d){return _0x19a3d5[_0xae41('0x17')](_0x1a7e8b)[_0xae41('0x19')](_0xec424d);}};}function respondWithFilteredResult(_0x1aa051,_0x19efac){return function(_0x3673bb){if(_0x3673bb){var _0x3e99ff=typeof _0x19efac['offset']==='undefined'&&typeof _0x19efac[_0xae41('0x1a')]==='undefined';var _0x1e906c=_0x3673bb[_0xae41('0x1b')];var _0x1c37ac=_0x3e99ff?0x0:_0x19efac[_0xae41('0x1c')];var _0x4d730e=_0x3e99ff?_0x3673bb['count']:_0x19efac[_0xae41('0x1c')]+_0x19efac[_0xae41('0x1a')];var _0xd69c3b;if(_0x4d730e>=_0x1e906c){_0x4d730e=_0x1e906c;_0xd69c3b=0xc8;}else{_0xd69c3b=0xce;}_0x1aa051['status'](_0xd69c3b);return _0x1aa051[_0xae41('0x1d')](_0xae41('0x1e'),_0x1c37ac+'-'+_0x4d730e+'/'+_0x1e906c)[_0xae41('0x19')](_0x3673bb);}return null;};}function patchUpdates(_0x5e8686){return function(_0x277d77){try{jsonpatch[_0xae41('0x1f')](_0x277d77,_0x5e8686,!![]);}catch(_0x5adec7){return BPromise[_0xae41('0x20')](_0x5adec7);}return _0x277d77[_0xae41('0x21')]();};}function saveUpdates(_0x5a7074,_0x2d4cd5){return function(_0x881278){if(_0x881278){return _0x881278['update'](_0x5a7074)['then'](function(_0x40a029){return _0x40a029;});}return null;};}function removeEntity(_0x378800,_0x9fa4f){return function(_0x221a94){if(_0x221a94){return _0x221a94[_0xae41('0x22')]()[_0xae41('0x23')](function(){_0x378800[_0xae41('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1167db,_0x195d0f){return function(_0x4cb1d1){if(!_0x4cb1d1){_0x1167db[_0xae41('0x16')](0x194);}return _0x4cb1d1;};}function handleError(_0x5ec26c,_0x264be0){_0x264be0=_0x264be0||0x1f4;return function(_0x16dc90){logger[_0xae41('0x24')](_0x16dc90['stack']);if(_0x16dc90[_0xae41('0x25')]){delete _0x16dc90[_0xae41('0x25')];}_0x5ec26c[_0xae41('0x17')](_0x264be0)[_0xae41('0x26')](_0x16dc90);};}exports['update']=function(_0x2300de,_0x26a38c){if(_0x2300de[_0xae41('0x27')]['id']){delete _0x2300de[_0xae41('0x27')]['id'];}return db[_0xae41('0x28')]['find']({'where':{'id':_0x2300de[_0xae41('0x29')]['id']}})[_0xae41('0x23')](handleEntityNotFound(_0x26a38c,null))[_0xae41('0x23')](saveUpdates(_0x2300de[_0xae41('0x27')],null))[_0xae41('0x23')](respondWithResult(_0x26a38c,null))[_0xae41('0x2a')](handleError(_0x26a38c,null));};exports[_0xae41('0x22')]=function(_0x4cf4a8,_0x216340){return db[_0xae41('0x28')]['find']({'where':{'id':_0x4cf4a8['params']['id']}})[_0xae41('0x23')](handleEntityNotFound(_0x216340,null))['then'](removeEntity(_0x216340,null))[_0xae41('0x2a')](handleError(_0x216340,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index b79df7a..c2c2360 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 _0x2dac=['define','Action','tools_actions','util','../../config/logger','moment','bluebird','request-promise','./action.attributes','exports'];(function(_0x5ff5c9,_0x3213de){var _0x23e4a8=function(_0x1ebd48){while(--_0x1ebd48){_0x5ff5c9['push'](_0x5ff5c9['shift']());}};_0x23e4a8(++_0x3213de);}(_0x2dac,0x107));var _0xc2da=function(_0x1f99c9,_0xb440a4){_0x1f99c9=_0x1f99c9-0x0;var _0x5d0fff=_0x2dac[_0x1f99c9];return _0x5d0fff;};'use strict';var _=require('lodash');var util=require(_0xc2da('0x0'));var logger=require(_0xc2da('0x1'))('api');var moment=require(_0xc2da('0x2'));var BPromise=require(_0xc2da('0x3'));var rp=require(_0xc2da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc2da('0x5'));module[_0xc2da('0x6')]=function(_0x2affd3,_0x3c879c){return _0x2affd3[_0xc2da('0x7')](_0xc2da('0x8'),attributes,{'tableName':_0xc2da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5469=['exports','define','Action','../../config/logger','moment','bluebird','rimraf','../../config/environment','./action.attributes'];(function(_0x6399d6,_0x1f26a8){var _0x220a36=function(_0xe40dc9){while(--_0xe40dc9){_0x6399d6['push'](_0x6399d6['shift']());}};_0x220a36(++_0x1f26a8);}(_0x5469,0xe4));var _0x9546=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x5469[_0x1e2080];return _0x260111;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9546('0x0'))('api');var moment=require(_0x9546('0x1'));var BPromise=require(_0x9546('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9546('0x3'));var config=require(_0x9546('0x4'));var attributes=require(_0x9546('0x5'));module[_0x9546('0x6')]=function(_0x3e9bf7,_0x57d0d9){return _0x3e9bf7[_0x9546('0x7')](_0x9546('0x8'),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 36387eb..66a6b04 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4c8fa9,_0x2a1337){var _0x192648=function(_0x6c8436){while(--_0x6c8436){_0x4c8fa9['push'](_0x4c8fa9['shift']());}};_0x192648(++_0x2a1337);}(_0x5fab,0x177));var _0xb5fa=function(_0x5d9a85,_0x55221e){_0x5d9a85=_0x5d9a85-0x0;var _0x1ef8aa=_0x5fab[_0x5d9a85];return _0x1ef8aa;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x18a63a,_0x259cec){var _0x2cca04=function(_0x556e74){while(--_0x556e74){_0x18a63a['push'](_0x18a63a['shift']());}};_0x2cca04(++_0x259cec);}(_0x5fab,0x177));var _0xb5fa=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x5fab[_0x7ad123];return _0x37d073;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index fcefa22..d419f3c 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 _0x922d=['../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','exports','util','path','connect-timeout','Router'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x922d,0xf8));var _0xd922=function(_0x27d16e,_0x461295){_0x27d16e=_0x27d16e-0x0;var _0x4005ac=_0x922d[_0x27d16e];return _0x4005ac;};'use strict';var multer=require('multer');var util=require(_0xd922('0x0'));var path=require(_0xd922('0x1'));var timeout=require(_0xd922('0x2'));var express=require('express');var router=express[_0xd922('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd922('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd922('0x5'));var controller=require(_0xd922('0x6'));router[_0xd922('0x7')](_0xd922('0x8'),auth[_0xd922('0x9')](),controller[_0xd922('0xa')]);router['delete'](_0xd922('0x8'),auth[_0xd922('0x9')](),controller['destroy']);module[_0xd922('0xb')]=router;
\ No newline at end of file
+var _0xf0ea=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf0ea,0x189));var _0xaf0e=function(_0x599a8e,_0x4816a0){_0x599a8e=_0x599a8e-0x0;var _0x4688c4=_0xf0ea[_0x599a8e];return _0x4688c4;};'use strict';var multer=require('multer');var util=require(_0xaf0e('0x0'));var path=require(_0xaf0e('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf0e('0x2'));var router=express[_0xaf0e('0x3')]();var fs_extra=require(_0xaf0e('0x4'));var auth=require(_0xaf0e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf0e('0x6'));var controller=require('./action.controller');router[_0xaf0e('0x7')](_0xaf0e('0x8'),auth[_0xaf0e('0x9')](),controller[_0xaf0e('0xa')]);router[_0xaf0e('0xb')]('/:id',auth[_0xaf0e('0x9')](),controller[_0xaf0e('0xc')]);module[_0xaf0e('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 0beac28..77f7eaa 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x1a9d8c,_0x8eb138){var _0x42f058=function(_0x35b9df){while(--_0x35b9df){_0x1a9d8c['push'](_0x1a9d8c['shift']());}};_0x42f058(++_0x8eb138);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x3098ea,_0x3a3a44){var _0x312f0d=function(_0x25fbf7){while(--_0x25fbf7){_0x3098ea['push'](_0x3098ea['shift']());}};_0x312f0d(++_0x3a3a44);}(_0x814b,0x1a2));var _0xb814=function(_0xf852,_0x4ddd76){_0xf852=_0xf852-0x0;var _0x5b2550=_0x814b[_0xf852];return _0x5b2550;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 38fe857..76c5596 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 _0x6f70=['VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','field','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','value','getFields','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','params','runReport','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','name','send','index','map','AnalyticCustomReport','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type'];(function(_0x2396a9,_0x448c2e){var _0x4deb7a=function(_0x1a1e3a){while(--_0x1a1e3a){_0x2396a9['push'](_0x2396a9['shift']());}};_0x4deb7a(++_0x448c2e);}(_0x6f70,0x110));var _0x06f7=function(_0x17b08b,_0x11e6cc){_0x17b08b=_0x17b08b-0x0;var _0x39853e=_0x6f70[_0x17b08b];return _0x39853e;};'use strict';var emlformat=require(_0x06f7('0x0'));var rimraf=require(_0x06f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06f7('0x2'));var rp=require('request-promise');var moment=require(_0x06f7('0x3'));var BPromise=require(_0x06f7('0x4'));var Mustache=require(_0x06f7('0x5'));var util=require(_0x06f7('0x6'));var path=require('path');var sox=require(_0x06f7('0x7'));var csv=require(_0x06f7('0x8'));var ejs=require(_0x06f7('0x9'));var fs=require('fs');var fs_extra=require(_0x06f7('0xa'));var _=require(_0x06f7('0xb'));var squel=require(_0x06f7('0xc'));var crypto=require(_0x06f7('0xd'));var jsforce=require(_0x06f7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x06f7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x06f7('0x10'));var hardwareService=require(_0x06f7('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x06f7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x06f7('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x06f7('0x14'))[_0x06f7('0x15')];function respondWithStatusCode(_0x2da6a7,_0xac42da){_0xac42da=_0xac42da||0xcc;return function(_0x11ddba){if(_0x11ddba){return _0x2da6a7[_0x06f7('0x16')](_0xac42da);}return _0x2da6a7[_0x06f7('0x17')](_0xac42da)['end']();};}function respondWithResult(_0x15cf8d,_0x28a6ab){_0x28a6ab=_0x28a6ab||0xc8;return function(_0x475f65){if(_0x475f65){return _0x15cf8d[_0x06f7('0x17')](_0x28a6ab)['json'](_0x475f65);}};}function respondWithFilteredResult(_0x5e2c8a,_0x50a8b3){return function(_0x1732d7){if(_0x1732d7){var _0x369e12=typeof _0x50a8b3[_0x06f7('0x18')]===_0x06f7('0x19')&&typeof _0x50a8b3['limit']===_0x06f7('0x19');var _0x58f2e9=_0x1732d7[_0x06f7('0x1a')];var _0x731f19=_0x369e12?0x0:_0x50a8b3[_0x06f7('0x18')];var _0x193200=_0x369e12?_0x1732d7[_0x06f7('0x1a')]:_0x50a8b3[_0x06f7('0x18')]+_0x50a8b3[_0x06f7('0x1b')];var _0x2872f5;if(_0x193200>=_0x58f2e9){_0x193200=_0x58f2e9;_0x2872f5=0xc8;}else{_0x2872f5=0xce;}_0x5e2c8a[_0x06f7('0x17')](_0x2872f5);return _0x5e2c8a[_0x06f7('0x1c')]('Content-Range',_0x731f19+'-'+_0x193200+'/'+_0x58f2e9)[_0x06f7('0x1d')](_0x1732d7);}return null;};}function patchUpdates(_0x24c34b){return function(_0xfb1e60){try{jsonpatch[_0x06f7('0x1e')](_0xfb1e60,_0x24c34b,!![]);}catch(_0x3776b8){return BPromise[_0x06f7('0x1f')](_0x3776b8);}return _0xfb1e60[_0x06f7('0x20')]();};}function saveUpdates(_0x40afa7,_0x18a6f0){return function(_0x5712cc){if(_0x5712cc){return _0x5712cc[_0x06f7('0x21')](_0x40afa7)[_0x06f7('0x22')](function(_0x3b7e36){return _0x3b7e36;});}return null;};}function removeEntity(_0x5b6d24,_0x22c207){return function(_0x2a2359){if(_0x2a2359){return _0x2a2359[_0x06f7('0x23')]()['then'](function(){var _0x4fbb4c=_0x2a2359[_0x06f7('0x24')]({'plain':!![]});var _0x35ea80=_0x06f7('0x25');return db[_0x06f7('0x26')][_0x06f7('0x23')]({'where':{'type':_0x35ea80,'resourceId':_0x4fbb4c['id']}})[_0x06f7('0x22')](function(){return _0x2a2359;});})[_0x06f7('0x22')](function(){_0x5b6d24[_0x06f7('0x17')](0xcc)[_0x06f7('0x27')]();});}};}function handleEntityNotFound(_0x23de7d,_0x417269){return function(_0x3a5b2d){if(!_0x3a5b2d){_0x23de7d['sendStatus'](0x194);}return _0x3a5b2d;};}function handleError(_0x5a6c70,_0x2b7f4e){_0x2b7f4e=_0x2b7f4e||0x1f4;return function(_0xb05cb7){logger[_0x06f7('0x28')](_0xb05cb7['stack']);if(_0xb05cb7[_0x06f7('0x29')]){delete _0xb05cb7[_0x06f7('0x29')];}_0x5a6c70['status'](_0x2b7f4e)[_0x06f7('0x2a')](_0xb05cb7);};}exports[_0x06f7('0x2b')]=function(_0x1644fc,_0x38bf98){var _0x599523={},_0x3dddb6={},_0x101953={'count':0x0,'rows':[]};var _0x3842da=_[_0x06f7('0x2c')](db[_0x06f7('0x2d')]['rawAttributes'],function(_0x2a7aae){return{'name':_0x2a7aae['fieldName'],'type':_0x2a7aae['type'][_0x06f7('0x2e')]};});_0x3dddb6['model']=_[_0x06f7('0x2c')](_0x3842da,'name');_0x3dddb6[_0x06f7('0x2f')]=_[_0x06f7('0x30')](_0x1644fc['query']);_0x3dddb6['filters']=_[_0x06f7('0x31')](_0x3dddb6[_0x06f7('0x32')],_0x3dddb6[_0x06f7('0x2f')]);_0x599523[_0x06f7('0x33')]=_[_0x06f7('0x31')](_0x3dddb6[_0x06f7('0x32')],qs[_0x06f7('0x34')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x34')]));_0x599523['attributes']=_0x599523[_0x06f7('0x33')][_0x06f7('0x35')]?_0x599523['attributes']:_0x3dddb6[_0x06f7('0x32')];if(!_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x36')](_0x06f7('0x37'))){_0x599523[_0x06f7('0x1b')]=qs[_0x06f7('0x1b')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x1b')]);_0x599523[_0x06f7('0x18')]=qs['offset'](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x18')]);}_0x599523['order']=qs[_0x06f7('0x38')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x38')]);_0x599523[_0x06f7('0x39')]=qs[_0x06f7('0x3a')](_[_0x06f7('0x3b')](_0x1644fc['query'],_0x3dddb6[_0x06f7('0x3a')]),_0x3842da);if(_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x3c')]){_0x599523[_0x06f7('0x39')]=_['merge'](_0x599523['where'],{'$or':_[_0x06f7('0x2c')](_0x3842da,function(_0x556582){if(_0x556582[_0x06f7('0x3d')]!==_0x06f7('0x3e')){var _0x46f107={};_0x46f107[_0x556582['name']]={'$like':'%'+_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x3c')]+'%'};return _0x46f107;}})});}_0x599523=_[_0x06f7('0x3f')]({},_0x599523,_0x1644fc[_0x06f7('0x40')]);var _0x3f2c8d={'where':_0x599523[_0x06f7('0x39')]};return db['AnalyticCustomReport'][_0x06f7('0x1a')](_0x3f2c8d)[_0x06f7('0x22')](function(_0x18e23c){_0x101953[_0x06f7('0x1a')]=_0x18e23c;if(_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x41')]){_0x599523['include']=[{'all':!![]}];}return db[_0x06f7('0x2d')][_0x06f7('0x42')](_0x599523);})['then'](function(_0x4d3b25){_0x101953[_0x06f7('0x43')]=_0x4d3b25;return _0x101953;})[_0x06f7('0x22')](respondWithFilteredResult(_0x38bf98,_0x599523))[_0x06f7('0x44')](handleError(_0x38bf98,null));};exports[_0x06f7('0x45')]=function(_0x325f82,_0x441887){var _0x1824a4={'raw':![],'where':{'id':_0x325f82['params']['id']}},_0x48c4ff={};_0x48c4ff[_0x06f7('0x32')]=_[_0x06f7('0x30')](db['AnalyticCustomReport'][_0x06f7('0x46')]);_0x48c4ff[_0x06f7('0x2f')]=_[_0x06f7('0x30')](_0x325f82[_0x06f7('0x2f')]);_0x48c4ff[_0x06f7('0x3a')]=_['intersection'](_0x48c4ff['model'],_0x48c4ff[_0x06f7('0x2f')]);_0x1824a4[_0x06f7('0x33')]=_[_0x06f7('0x31')](_0x48c4ff[_0x06f7('0x32')],qs[_0x06f7('0x34')](_0x325f82[_0x06f7('0x2f')][_0x06f7('0x34')]));_0x1824a4[_0x06f7('0x33')]=_0x1824a4[_0x06f7('0x33')][_0x06f7('0x35')]?_0x1824a4['attributes']:_0x48c4ff[_0x06f7('0x32')];if(_0x325f82[_0x06f7('0x2f')][_0x06f7('0x41')]){_0x1824a4[_0x06f7('0x47')]=[{'all':!![]}];}_0x1824a4=_[_0x06f7('0x3f')]({},_0x1824a4,_0x325f82[_0x06f7('0x40')]);return db[_0x06f7('0x2d')]['find'](_0x1824a4)[_0x06f7('0x22')](handleEntityNotFound(_0x441887,null))[_0x06f7('0x22')](respondWithResult(_0x441887,null))[_0x06f7('0x44')](handleError(_0x441887,null));};exports[_0x06f7('0x48')]=function(_0x4c85fd,_0x449ddb){return db[_0x06f7('0x2d')][_0x06f7('0x48')](_0x4c85fd[_0x06f7('0x49')],{})[_0x06f7('0x22')](function(_0x4f60ef){var _0x10e3f3=_0x4c85fd[_0x06f7('0x4a')][_0x06f7('0x24')]({'plain':!![]});if(!_0x10e3f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10e3f3[_0x06f7('0x4b')]===_0x06f7('0x4a')){var _0x4a0095=_0x4f60ef['get']({'plain':!![]});var _0x14ea54='Reports';return db[_0x06f7('0x4c')][_0x06f7('0x4d')]({'where':{'name':_0x14ea54,'userProfileId':_0x10e3f3['userProfileId']},'raw':!![]})['then'](function(_0x2546ad){if(_0x2546ad&&_0x2546ad[_0x06f7('0x4e')]===0x0){return db[_0x06f7('0x26')][_0x06f7('0x48')]({'name':_0x4a0095[_0x06f7('0x29')],'resourceId':_0x4a0095['id'],'type':_0x06f7('0x25'),'sectionId':_0x2546ad['id']},{})[_0x06f7('0x22')](function(){return _0x4f60ef;});}else{return _0x4f60ef;}})[_0x06f7('0x44')](function(_0x4f71a7){logger[_0x06f7('0x28')](_0x06f7('0x4f'),_0x4f71a7);throw _0x4f71a7;});}return _0x4f60ef;})[_0x06f7('0x22')](respondWithResult(_0x449ddb,0xc9))[_0x06f7('0x44')](handleError(_0x449ddb,null));};exports['update']=function(_0x44e755,_0x36ccfd){if(_0x44e755[_0x06f7('0x49')]['id']){delete _0x44e755['body']['id'];}return db[_0x06f7('0x2d')][_0x06f7('0x4d')]({'where':{'id':_0x44e755['params']['id']}})[_0x06f7('0x22')](handleEntityNotFound(_0x36ccfd,null))[_0x06f7('0x22')](saveUpdates(_0x44e755[_0x06f7('0x49')],null))[_0x06f7('0x22')](respondWithResult(_0x36ccfd,null))[_0x06f7('0x44')](handleError(_0x36ccfd,null));};exports[_0x06f7('0x23')]=function(_0x5572a3,_0x2e5f48){return db[_0x06f7('0x2d')][_0x06f7('0x4d')]({'where':{'id':_0x5572a3['params']['id']}})[_0x06f7('0x22')](handleEntityNotFound(_0x2e5f48,null))[_0x06f7('0x22')](removeEntity(_0x2e5f48,null))[_0x06f7('0x44')](handleError(_0x2e5f48,null));};exports['preview']=function(_0x5b9049,_0x154ad4){var _0x5cd840=0xa;var _0x217283=['join',_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x41518d={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':_0x06f7('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x06f7('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4f9733={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x5112b7=function(_0x4b9aae){return!_[_0x06f7('0x5b')]([_0x06f7('0x5c'),_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x4b9aae);};var _0x5666ab=function(_0x17bb46){if(!_0x17bb46||!_0x17bb46[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x38df88='(',_0xfcd92a=0x0;_0xfcd92a<_0x17bb46['rules'][_0x06f7('0x35')];_0xfcd92a+=0x1){_0xfcd92a>0x0&&(_0x38df88+='\x20'+_0x17bb46[_0x06f7('0x61')]+'\x20');_0x38df88+=_0x17bb46[_0x06f7('0x60')][_0xfcd92a]['group']?_0x5666ab(_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x62')]):_0x17bb46['rules'][_0xfcd92a]['field']+'\x20'+_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x63')]+(_0x5112b7(_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x63')])?'\x20'+_0x17bb46[_0x06f7('0x60')][_0xfcd92a]['value']:'');}return _0x38df88+')';};var _0xa43de5={'where':{'id':_0x5b9049['params']['id']}},_0x6113b4,_0x3b6eb1,_0xb6aead,_0x3f86f5,_0x5b364c;_0xa43de5=_[_0x06f7('0x3f')]({},_0xa43de5,_0x5b9049[_0x06f7('0x40')]);return db[_0x06f7('0x2d')][_0x06f7('0x4d')](_0xa43de5)[_0x06f7('0x22')](function(_0x5d0c4a){if(_0x5d0c4a){_0x6113b4=_0x5d0c4a;return _0x5d0c4a['getFields']();}return null;})[_0x06f7('0x22')](function(_0x4cff49){if(_0x4cff49){if(!_0x4cff49[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))][(_0x06f7('0x65'))](_0x06f7('0x66'),0x193);}_0x3b6eb1=_0x4cff49;return db[_0x06f7('0x67')]['findAll']({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x262237){if(_0x262237){_0xb6aead=_[_0x06f7('0x68')](_0x262237,'id');var _0x3e2be6;var _0x655f62=squel[_0x06f7('0x69')]();_0x655f62[_0x06f7('0x6a')](_0x6113b4['table']);for(var _0x9465c6=0x0;_0x9465c6<_0x3b6eb1[_0x06f7('0x35')];_0x9465c6+=0x1){_0x3e2be6=_0x3b6eb1[_0x9465c6]['MetricId']?_0xb6aead[_0x3b6eb1[_0x9465c6][_0x06f7('0x6b')]][_0x06f7('0x6c')]:_0x3b6eb1[_0x9465c6]['field'];_0x3e2be6=_0x3b6eb1[_0x9465c6][_0x06f7('0x6d')]?_[_0x06f7('0x6e')](_0x41518d[_0x3b6eb1[_0x9465c6]['function']],'%s',_0x3e2be6):_0x3e2be6;_0x3e2be6=_0x3b6eb1[_0x9465c6][_0x06f7('0x6f')]?_['replace'](_0x4f9733[_0x3b6eb1[_0x9465c6][_0x06f7('0x6f')]],'%s',_0x3e2be6):_0x3e2be6;if(_0x3b6eb1[_0x9465c6][_0x06f7('0x70')]){_0x655f62['group'](_0x3e2be6);}_0x3b6eb1[_0x9465c6][_0x06f7('0x71')]&&_0x655f62[_0x06f7('0x72')](_0x3e2be6,_0x3b6eb1[_0x9465c6]['orderBy']===_0x06f7('0x73')?![]:!![]);_0x655f62[_0x06f7('0x74')](_0x3e2be6,_0x3b6eb1[_0x9465c6][_0x06f7('0x75')]||_0x3e2be6);}if(_0x6113b4[_0x06f7('0x76')]){_0x6113b4[_0x06f7('0x76')]=JSON['parse'](_0x6113b4[_0x06f7('0x76')]);for(var _0x187d3e=0x0;_0x187d3e<_0x6113b4[_0x06f7('0x76')][_0x06f7('0x35')];_0x187d3e+=0x1){if(_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x217283,_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')])&&_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x77')]&&_0x6113b4[_0x06f7('0x76')][_0x187d3e]['foreignTable']&&_0x6113b4[_0x06f7('0x76')][_0x187d3e]['foreignKey']){_0x655f62[_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')]](_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x6113b4[_0x06f7('0x7a')],_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x77')],_0x6113b4['joins'][_0x187d3e][_0x06f7('0x78')],_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x7b')]));}}}if(_0x6113b4['conditions']){_0x6113b4[_0x06f7('0x7c')]=JSON[_0x06f7('0x7d')](_0x6113b4[_0x06f7('0x7c')]);_0x655f62['where'](_0x5666ab(_0x6113b4[_0x06f7('0x7c')][_0x06f7('0x62')]));}_0x5b364c=_0x655f62[_0x06f7('0x7e')]();_0x655f62[_0x06f7('0x1b')](_0x5cd840);_0x655f62['offset'](0x0);logger[_0x06f7('0x7f')](_0x06f7('0x80'),_0x655f62[_0x06f7('0x81')]());return dbH['sequelize'][_0x06f7('0x2f')](_0x655f62[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')][_0x06f7('0x84')]});}})[_0x06f7('0x22')](respondWithResult(_0x154ad4,null))[_0x06f7('0x44')](handleError(_0x154ad4,null));};function runReport(_0x1c0dbf,_0x5cd68e,_0x169ead){var _0x1bb74d=_0x5cd68e[_0x06f7('0x29')];var _0x38e044=0xa;var _0x46b999=[_0x06f7('0x85'),_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x3ae88f={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':_0x06f7('0x55'),'MAX':_0x06f7('0x86'),'MIN':_0x06f7('0x87'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x06f7('0x88'),'GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':_0x06f7('0x89')};var _0x51f50a={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':_0x06f7('0x8a'),'HOUR':_0x06f7('0x8b'),'ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x282a3b=function(_0x58150b){return!_[_0x06f7('0x5b')](['IS\x20NULL',_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x58150b);};var _0x1b07e0=function(_0x361c1f){if(!_0x361c1f||!_0x361c1f[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x386aa9='(',_0x44d669=0x0;_0x44d669<_0x361c1f[_0x06f7('0x60')][_0x06f7('0x35')];_0x44d669+=0x1){_0x44d669>0x0&&(_0x386aa9+='\x20'+_0x361c1f[_0x06f7('0x61')]+'\x20');_0x386aa9+=_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x62')]?_0x1b07e0(_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x62')]):_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x74')]+'\x20'+_0x361c1f['rules'][_0x44d669][_0x06f7('0x63')]+(_0x282a3b(_0x361c1f['rules'][_0x44d669]['condition'])?'\x20'+_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x8c')]:'');}return _0x386aa9+')';};var _0x30f1f0={'where':{'id':_0x1c0dbf['id']}},_0x246a1f,_0x502709,_0x469963,_0x361080,_0x1eaa8b;_0x30f1f0=_[_0x06f7('0x3f')]({},_0x30f1f0,_0x169ead);return db['AnalyticCustomReport'][_0x06f7('0x4d')](_0x30f1f0)['then'](function(_0x5b66a4){if(_0x5b66a4){_0x246a1f=_0x5b66a4;return _0x5b66a4[_0x06f7('0x8d')]();}return null;})[_0x06f7('0x22')](function(_0x4e8332){if(_0x4e8332){if(!_0x4e8332[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x502709=_0x4e8332;return db[_0x06f7('0x67')][_0x06f7('0x42')]({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x185ad8){if(_0x185ad8){_0x469963=_[_0x06f7('0x68')](_0x185ad8,'id');var _0x528a76;var _0x33bfe8=squel[_0x06f7('0x69')]();_0x33bfe8['from'](_0x246a1f[_0x06f7('0x7a')]);for(var _0x131931=0x0;_0x131931<_0x502709[_0x06f7('0x35')];_0x131931+=0x1){_0x528a76=_0x502709[_0x131931][_0x06f7('0x6b')]?_0x469963[_0x502709[_0x131931]['MetricId']][_0x06f7('0x6c')]:_0x502709[_0x131931][_0x06f7('0x74')];_0x528a76=_0x502709[_0x131931][_0x06f7('0x6d')]?_['replace'](_0x3ae88f[_0x502709[_0x131931][_0x06f7('0x6d')]],'%s',_0x528a76):_0x528a76;_0x528a76=_0x502709[_0x131931]['format']?_['replace'](_0x51f50a[_0x502709[_0x131931][_0x06f7('0x6f')]],'%s',_0x528a76):_0x528a76;if(_0x502709[_0x131931][_0x06f7('0x70')]){_0x33bfe8['group'](_0x528a76);}_0x502709[_0x131931]['orderBy']&&_0x33bfe8[_0x06f7('0x72')](_0x528a76,_0x502709[_0x131931][_0x06f7('0x71')]===_0x06f7('0x73')?![]:!![]);_0x33bfe8[_0x06f7('0x74')](_0x528a76,_0x502709[_0x131931][_0x06f7('0x75')]||_0x528a76);}if(_0x246a1f['joins']){_0x246a1f[_0x06f7('0x76')]=JSON['parse'](_0x246a1f[_0x06f7('0x76')]);for(var _0x486c30=0x0;_0x486c30<_0x246a1f[_0x06f7('0x76')]['length'];_0x486c30+=0x1){if(_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x46b999,_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x3d')])&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x77')]&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')]&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x7b')]){_0x33bfe8[_0x246a1f[_0x06f7('0x76')][_0x486c30]['type']](_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x246a1f[_0x06f7('0x7a')],_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x77')],_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')],_0x246a1f[_0x06f7('0x76')][_0x486c30]['foreignKey']));}}}if(_0x246a1f[_0x06f7('0x7c')]){_0x246a1f['conditions']=JSON['parse'](_0x246a1f['conditions']);_0x33bfe8['where'](_0x1b07e0(_0x246a1f[_0x06f7('0x7c')]['group']));}_0x1eaa8b=_0x33bfe8[_0x06f7('0x7e')]();_0x33bfe8[_0x06f7('0x1b')](_0x38e044);_0x33bfe8[_0x06f7('0x18')](0x0);return;}})[_0x06f7('0x22')](function(){if(_0x5cd68e[_0x06f7('0x8e')]===_0x06f7('0x8f')){return null;}var _0x5acaeb=_['merge'](_0x5cd68e,{'name':_0x5cd68e['fullPath']||_0x5cd68e[_0x06f7('0x29')]||_0x246a1f[_0x06f7('0x29')],'basename':_0x1bb74d,'savename':util[_0x06f7('0x6f')](_0x06f7('0x90'),_0x5cd68e['name']||_0x246a1f[_0x06f7('0x29')],require(_0x06f7('0x91'))[_0x06f7('0x92')](0x4),_0x5cd68e[_0x06f7('0x8e')]||_0x06f7('0x93')),'reportId':_0x246a1f['id'],'reportType':_0x06f7('0x94')});return db[_0x06f7('0x95')][_0x06f7('0x48')](_0x5acaeb,{'raw':!![]});})[_0x06f7('0x22')](function(_0x49e97e){if(_0x246a1f[_0x06f7('0x7a')]===_0x06f7('0x96')){_0x1eaa8b[_0x06f7('0x39')](_0x246a1f[_0x06f7('0x7a')]+_0x06f7('0x97'),_0x5cd68e[_0x06f7('0x98')],_0x5cd68e['endDate']);}else{_0x1eaa8b[_0x06f7('0x39')](_0x246a1f[_0x06f7('0x7a')]+_0x06f7('0x99'),_0x5cd68e[_0x06f7('0x98')],_0x5cd68e[_0x06f7('0x9a')]);}if(_0x49e97e){logger[_0x06f7('0x9b')](_0x06f7('0x9c'),_0x1eaa8b[_0x06f7('0x81')]());require(_0x06f7('0x9d'))[_0x06f7('0x9e')](path['join'](__dirname,_0x06f7('0x9f'),_0x49e97e[_0x06f7('0x8e')]),[_0x49e97e['id'],_0x1eaa8b[_0x06f7('0x81')](),path['join'](__dirname,_0x06f7('0xa0'),_0x49e97e[_0x06f7('0xa1')]),_0x1bb74d]);return _0x49e97e;}else{var _0x2b315f=squel[_0x06f7('0x69')]();_0x2b315f[_0x06f7('0x6a')]('('+_0x1eaa8b['toString']()+')',_0x06f7('0xa2'));_0x2b315f['field'](_0x06f7('0xa3'),_0x06f7('0x1a'));_0x1eaa8b[_0x06f7('0x1b')](_0x5cd68e[_0x06f7('0x1b')]||_0x38e044);_0x1eaa8b[_0x06f7('0x18')](_0x5cd68e[_0x06f7('0x18')]||0x0);return dbH['sequelize'][_0x06f7('0x2f')](_0x2b315f[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')][_0x06f7('0x84')]})['then'](function(_0x1873d3){if(!_0x1873d3[_0x06f7('0x35')]){_0x361080=0x0;}else{_0x361080=_0x1873d3[0x0][_0x06f7('0x1a')]||0x0;}return dbH[_0x06f7('0x82')]['query'](_0x1eaa8b[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')]['QueryTypes'][_0x06f7('0x84')]});})['then'](function(_0x4d82c4){return{'rows':_0x4d82c4||[],'count':_0x361080};});}});}exports[_0x06f7('0xa4')]=function(_0x8ae404,_0x12daf7){return runReport(_0x8ae404[_0x06f7('0xa5')],_0x8ae404[_0x06f7('0x2f')],_0x8ae404[_0x06f7('0x40')])[_0x06f7('0x22')](respondWithResult(_0x12daf7,null))[_0x06f7('0x44')](handleError(_0x12daf7,null));};exports[_0x06f7('0xa6')]=runReport;exports['query']=function(_0x3e2c25,_0x5efe03){var _0x2de4ec=0xa;var _0x21bddb=[_0x06f7('0x85'),_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x457c31={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x06f7('0x86'),'MIN':'MIN(%s)','AVG':_0x06f7('0x56'),'GROUP_CONCAT':_0x06f7('0x88'),'GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':_0x06f7('0x89')};var _0x568888={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':'DATE(%s)','HOUR':_0x06f7('0x8b'),'ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x4592c7=function(_0x21d1d){return!_[_0x06f7('0x5b')]([_0x06f7('0x5c'),_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x21d1d);};var _0x5cc7a1=function(_0x1ecc4c){if(!_0x1ecc4c||!_0x1ecc4c[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x447abd='(',_0x466a05=0x0;_0x466a05<_0x1ecc4c[_0x06f7('0x60')][_0x06f7('0x35')];_0x466a05+=0x1){_0x466a05>0x0&&(_0x447abd+='\x20'+_0x1ecc4c[_0x06f7('0x61')]+'\x20');_0x447abd+=_0x1ecc4c['rules'][_0x466a05]['group']?_0x5cc7a1(_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x62')]):_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x74')]+'\x20'+_0x1ecc4c['rules'][_0x466a05]['condition']+(_0x4592c7(_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x63')])?'\x20'+_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x8c')]:'');}return _0x447abd+')';};var _0x239735={'where':{'id':_0x3e2c25[_0x06f7('0xa5')]['id']}},_0x2d206f,_0x5bf1be,_0x18c530,_0xa7d33d,_0x501379;_0x239735=_[_0x06f7('0x3f')]({},_0x239735,_0x3e2c25[_0x06f7('0x40')]);return db[_0x06f7('0x2d')]['find'](_0x239735)[_0x06f7('0x22')](function(_0x221bf9){if(_0x221bf9){_0x2d206f=_0x221bf9;return _0x221bf9['getFields']();}return null;})[_0x06f7('0x22')](function(_0x37ef56){if(_0x37ef56){if(!_0x37ef56[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))][(_0x06f7('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5bf1be=_0x37ef56;return db[_0x06f7('0x67')][_0x06f7('0x42')]({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x4b1ab4){if(_0x4b1ab4){_0x18c530=_['keyBy'](_0x4b1ab4,'id');var _0x4bae37;var _0x4afb22=squel['select']();_0x4afb22[_0x06f7('0x6a')](_0x2d206f['table']);for(var _0x392f04=0x0;_0x392f04<_0x5bf1be[_0x06f7('0x35')];_0x392f04+=0x1){_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6b')]?_0x18c530[_0x5bf1be[_0x392f04][_0x06f7('0x6b')]][_0x06f7('0x6c')]:_0x5bf1be[_0x392f04][_0x06f7('0x74')];_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6d')]?_[_0x06f7('0x6e')](_0x457c31[_0x5bf1be[_0x392f04][_0x06f7('0x6d')]],'%s',_0x4bae37):_0x4bae37;_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6f')]?_['replace'](_0x568888[_0x5bf1be[_0x392f04][_0x06f7('0x6f')]],'%s',_0x4bae37):_0x4bae37;if(_0x5bf1be[_0x392f04][_0x06f7('0x70')]){_0x4afb22['group'](_0x4bae37);}_0x5bf1be[_0x392f04][_0x06f7('0x71')]&&_0x4afb22['order'](_0x4bae37,_0x5bf1be[_0x392f04][_0x06f7('0x71')]===_0x06f7('0x73')?![]:!![]);_0x4afb22[_0x06f7('0x74')](_0x4bae37,_0x5bf1be[_0x392f04][_0x06f7('0x75')]||_0x4bae37);}if(_0x2d206f[_0x06f7('0x76')]){_0x2d206f[_0x06f7('0x76')]=JSON['parse'](_0x2d206f[_0x06f7('0x76')]);for(var _0x47ac66=0x0;_0x47ac66<_0x2d206f[_0x06f7('0x76')][_0x06f7('0x35')];_0x47ac66+=0x1){if(_0x2d206f['joins'][_0x47ac66][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x21bddb,_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x3d')])&&_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x77')]&&_0x2d206f['joins'][_0x47ac66][_0x06f7('0x78')]&&_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x7b')]){_0x4afb22[_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x3d')]](_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x2d206f[_0x06f7('0x7a')],_0x2d206f['joins'][_0x47ac66][_0x06f7('0x77')],_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x78')],_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x7b')]));}}}if(_0x2d206f[_0x06f7('0x7c')]){_0x2d206f['conditions']=JSON[_0x06f7('0x7d')](_0x2d206f[_0x06f7('0x7c')]);_0x4afb22['where'](_0x5cc7a1(_0x2d206f[_0x06f7('0x7c')]['group']));}_0x501379=_0x4afb22['clone']();_0x4afb22[_0x06f7('0x1b')](_0x2de4ec);_0x4afb22[_0x06f7('0x18')](0x0);logger[_0x06f7('0x7f')](_0x06f7('0x80'),_0x4afb22[_0x06f7('0x81')]());return dbH[_0x06f7('0x82')]['query'](_0x4afb22[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')]['SELECT']});}})[_0x06f7('0x22')](function(){return{'sql':_0x501379[_0x06f7('0x81')]()};})[_0x06f7('0x22')](respondWithResult(_0x5efe03,null))[_0x06f7('0x44')](handleError(_0x5efe03,null));};
\ No newline at end of file
+var _0x65c5=['Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','group','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','includes','Sequelize','keyBy','from','order','foreignKey','clone','output','web','%s-%s.%s','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','SEC_TO_TIME(%s)','operator','value','groupBy','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','limit','set'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0x65c5,0x1c5));var _0x565c=function(_0x2c918a,_0x2e9338){_0x2c918a=_0x2c918a-0x0;var _0x43ff87=_0x65c5[_0x2c918a];return _0x43ff87;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x565c('0x0'));var jsonpatch=require(_0x565c('0x1'));var rp=require('request-promise');var moment=require(_0x565c('0x2'));var BPromise=require(_0x565c('0x3'));var Mustache=require(_0x565c('0x4'));var util=require('util');var path=require('path');var sox=require(_0x565c('0x5'));var csv=require(_0x565c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x565c('0x7'));var _=require(_0x565c('0x8'));var squel=require(_0x565c('0x9'));var crypto=require(_0x565c('0xa'));var jsforce=require(_0x565c('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x565c('0xc'));var Papa=require(_0x565c('0xd'));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(_0x565c('0xe'));var logger=require(_0x565c('0xf'))(_0x565c('0x10'));var utils=require(_0x565c('0x11'));var config=require(_0x565c('0x12'));var licenseUtil=require(_0x565c('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x565c('0x14'))['dbH'];function respondWithStatusCode(_0x438a38,_0x20abd8){_0x20abd8=_0x20abd8||0xcc;return function(_0x3a703b){if(_0x3a703b){return _0x438a38['sendStatus'](_0x20abd8);}return _0x438a38[_0x565c('0x15')](_0x20abd8)['end']();};}function respondWithResult(_0x5be86c,_0x5c1a53){_0x5c1a53=_0x5c1a53||0xc8;return function(_0x32da8d){if(_0x32da8d){return _0x5be86c[_0x565c('0x15')](_0x5c1a53)[_0x565c('0x16')](_0x32da8d);}};}function respondWithFilteredResult(_0x4624d0,_0x544292){return function(_0x491d4c){if(_0x491d4c){var _0x207135=typeof _0x544292[_0x565c('0x17')]==='undefined'&&typeof _0x544292['limit']==='undefined';var _0xc00936=_0x491d4c[_0x565c('0x18')];var _0x42bc0c=_0x207135?0x0:_0x544292[_0x565c('0x17')];var _0x32d6f0=_0x207135?_0x491d4c[_0x565c('0x18')]:_0x544292[_0x565c('0x17')]+_0x544292[_0x565c('0x19')];var _0x469a59;if(_0x32d6f0>=_0xc00936){_0x32d6f0=_0xc00936;_0x469a59=0xc8;}else{_0x469a59=0xce;}_0x4624d0[_0x565c('0x15')](_0x469a59);return _0x4624d0[_0x565c('0x1a')](_0x565c('0x1b'),_0x42bc0c+'-'+_0x32d6f0+'/'+_0xc00936)[_0x565c('0x16')](_0x491d4c);}return null;};}function patchUpdates(_0x358b6f){return function(_0x4d319c){try{jsonpatch[_0x565c('0x1c')](_0x4d319c,_0x358b6f,!![]);}catch(_0x5d38a4){return BPromise[_0x565c('0x1d')](_0x5d38a4);}return _0x4d319c['save']();};}function saveUpdates(_0x263ef4,_0x2e9943){return function(_0x4ce5e7){if(_0x4ce5e7){return _0x4ce5e7[_0x565c('0x1e')](_0x263ef4)[_0x565c('0x1f')](function(_0x1de035){return _0x1de035;});}return null;};}function removeEntity(_0xa0209d,_0xe2ad53){return function(_0x6cc7db){if(_0x6cc7db){return _0x6cc7db[_0x565c('0x20')]()[_0x565c('0x1f')](function(){var _0x5896ea=_0x6cc7db[_0x565c('0x21')]({'plain':!![]});var _0x84224a=_0x565c('0x22');return db[_0x565c('0x23')][_0x565c('0x20')]({'where':{'type':_0x84224a,'resourceId':_0x5896ea['id']}})[_0x565c('0x1f')](function(){return _0x6cc7db;});})[_0x565c('0x1f')](function(){_0xa0209d['status'](0xcc)[_0x565c('0x24')]();});}};}function handleEntityNotFound(_0x3a1064,_0x15e0a8){return function(_0x4dc101){if(!_0x4dc101){_0x3a1064[_0x565c('0x25')](0x194);}return _0x4dc101;};}function handleError(_0x3203a4,_0x4a12f2){_0x4a12f2=_0x4a12f2||0x1f4;return function(_0xc96ece){logger[_0x565c('0x26')](_0xc96ece[_0x565c('0x27')]);if(_0xc96ece['name']){delete _0xc96ece[_0x565c('0x28')];}_0x3203a4[_0x565c('0x15')](_0x4a12f2)[_0x565c('0x29')](_0xc96ece);};}exports[_0x565c('0x2a')]=function(_0x54aefc,_0x30ec79){var _0x1571c3={},_0x194f0d={},_0x465378={'count':0x0,'rows':[]};var _0x24c23b=_[_0x565c('0x2b')](db[_0x565c('0x2c')][_0x565c('0x2d')],function(_0x5cc78e){return{'name':_0x5cc78e[_0x565c('0x2e')],'type':_0x5cc78e['type'][_0x565c('0x2f')]};});_0x194f0d[_0x565c('0x30')]=_[_0x565c('0x2b')](_0x24c23b,'name');_0x194f0d['query']=_[_0x565c('0x31')](_0x54aefc[_0x565c('0x32')]);_0x194f0d[_0x565c('0x33')]=_[_0x565c('0x34')](_0x194f0d['model'],_0x194f0d['query']);_0x1571c3[_0x565c('0x35')]=_[_0x565c('0x34')](_0x194f0d[_0x565c('0x30')],qs[_0x565c('0x36')](_0x54aefc[_0x565c('0x32')][_0x565c('0x36')]));_0x1571c3[_0x565c('0x35')]=_0x1571c3[_0x565c('0x35')]['length']?_0x1571c3[_0x565c('0x35')]:_0x194f0d[_0x565c('0x30')];if(!_0x54aefc['query']['hasOwnProperty'](_0x565c('0x37'))){_0x1571c3[_0x565c('0x19')]=qs[_0x565c('0x19')](_0x54aefc[_0x565c('0x32')]['limit']);_0x1571c3['offset']=qs[_0x565c('0x17')](_0x54aefc['query'][_0x565c('0x17')]);}_0x1571c3['order']=qs['sort'](_0x54aefc[_0x565c('0x32')][_0x565c('0x38')]);_0x1571c3['where']=qs['filters'](_[_0x565c('0x39')](_0x54aefc[_0x565c('0x32')],_0x194f0d[_0x565c('0x33')]),_0x24c23b);if(_0x54aefc[_0x565c('0x32')][_0x565c('0x3a')]){_0x1571c3['where']=_[_0x565c('0x3b')](_0x1571c3[_0x565c('0x3c')],{'$or':_[_0x565c('0x2b')](_0x24c23b,function(_0x38ffcf){if(_0x38ffcf[_0x565c('0x3d')]!==_0x565c('0x3e')){var _0x1d8cf5={};_0x1d8cf5[_0x38ffcf[_0x565c('0x28')]]={'$like':'%'+_0x54aefc[_0x565c('0x32')]['filter']+'%'};return _0x1d8cf5;}})});}_0x1571c3=_['merge']({},_0x1571c3,_0x54aefc[_0x565c('0x3f')]);var _0x44dade={'where':_0x1571c3[_0x565c('0x3c')]};return db['AnalyticCustomReport'][_0x565c('0x18')](_0x44dade)[_0x565c('0x1f')](function(_0x7a6665){_0x465378[_0x565c('0x18')]=_0x7a6665;if(_0x54aefc[_0x565c('0x32')][_0x565c('0x40')]){_0x1571c3[_0x565c('0x41')]=[{'all':!![]}];}return db[_0x565c('0x2c')]['findAll'](_0x1571c3);})[_0x565c('0x1f')](function(_0x2faf19){_0x465378[_0x565c('0x42')]=_0x2faf19;return _0x465378;})[_0x565c('0x1f')](respondWithFilteredResult(_0x30ec79,_0x1571c3))[_0x565c('0x43')](handleError(_0x30ec79,null));};exports[_0x565c('0x44')]=function(_0x2ee727,_0xc9acb2){var _0x13e683={'raw':![],'where':{'id':_0x2ee727[_0x565c('0x45')]['id']}},_0x301b86={};_0x301b86[_0x565c('0x30')]=_[_0x565c('0x31')](db[_0x565c('0x2c')][_0x565c('0x2d')]);_0x301b86[_0x565c('0x32')]=_[_0x565c('0x31')](_0x2ee727[_0x565c('0x32')]);_0x301b86['filters']=_[_0x565c('0x34')](_0x301b86[_0x565c('0x30')],_0x301b86[_0x565c('0x32')]);_0x13e683[_0x565c('0x35')]=_[_0x565c('0x34')](_0x301b86['model'],qs[_0x565c('0x36')](_0x2ee727[_0x565c('0x32')][_0x565c('0x36')]));_0x13e683[_0x565c('0x35')]=_0x13e683[_0x565c('0x35')]['length']?_0x13e683[_0x565c('0x35')]:_0x301b86['model'];if(_0x2ee727[_0x565c('0x32')]['includeAll']){_0x13e683[_0x565c('0x41')]=[{'all':!![]}];}_0x13e683=_[_0x565c('0x3b')]({},_0x13e683,_0x2ee727[_0x565c('0x3f')]);return db[_0x565c('0x2c')][_0x565c('0x46')](_0x13e683)[_0x565c('0x1f')](handleEntityNotFound(_0xc9acb2,null))[_0x565c('0x1f')](respondWithResult(_0xc9acb2,null))[_0x565c('0x43')](handleError(_0xc9acb2,null));};exports['create']=function(_0x2f1d00,_0x422673){return db['AnalyticCustomReport'][_0x565c('0x47')](_0x2f1d00[_0x565c('0x48')],{})['then'](function(_0x50cd0d){var _0x25bfff=_0x2f1d00[_0x565c('0x49')][_0x565c('0x21')]({'plain':!![]});if(!_0x25bfff)throw new Error(_0x565c('0x4a'));if(_0x25bfff[_0x565c('0x4b')]===_0x565c('0x49')){var _0x1260cb=_0x50cd0d[_0x565c('0x21')]({'plain':!![]});var _0x2c94cf='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x2c94cf,'userProfileId':_0x25bfff[_0x565c('0x4c')]},'raw':!![]})[_0x565c('0x1f')](function(_0x45c509){if(_0x45c509&&_0x45c509[_0x565c('0x4d')]===0x0){return db['UserProfileResource'][_0x565c('0x47')]({'name':_0x1260cb[_0x565c('0x28')],'resourceId':_0x1260cb['id'],'type':'CustomReports','sectionId':_0x45c509['id']},{})[_0x565c('0x1f')](function(){return _0x50cd0d;});}else{return _0x50cd0d;}})[_0x565c('0x43')](function(_0x2f42ee){logger[_0x565c('0x26')](_0x565c('0x4e'),_0x2f42ee);throw _0x2f42ee;});}return _0x50cd0d;})['then'](respondWithResult(_0x422673,0xc9))[_0x565c('0x43')](handleError(_0x422673,null));};exports[_0x565c('0x1e')]=function(_0x107118,_0x47d842){if(_0x107118[_0x565c('0x48')]['id']){delete _0x107118[_0x565c('0x48')]['id'];}return db[_0x565c('0x2c')][_0x565c('0x46')]({'where':{'id':_0x107118[_0x565c('0x45')]['id']}})[_0x565c('0x1f')](handleEntityNotFound(_0x47d842,null))['then'](saveUpdates(_0x107118[_0x565c('0x48')],null))[_0x565c('0x1f')](respondWithResult(_0x47d842,null))[_0x565c('0x43')](handleError(_0x47d842,null));};exports[_0x565c('0x20')]=function(_0x518c21,_0x355585){return db[_0x565c('0x2c')][_0x565c('0x46')]({'where':{'id':_0x518c21[_0x565c('0x45')]['id']}})['then'](handleEntityNotFound(_0x355585,null))['then'](removeEntity(_0x355585,null))['catch'](handleError(_0x355585,null));};exports[_0x565c('0x4f')]=function(_0x4ab1cc,_0x250fe6){var _0x2b2f61=0xa;var _0x4d2617=[_0x565c('0x50'),_0x565c('0x51'),_0x565c('0x52'),_0x565c('0x53')];var _0x385b59={'SUM':_0x565c('0x54'),'COUNT':_0x565c('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x565c('0x56'),'MIN':_0x565c('0x57'),'AVG':_0x565c('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x565c('0x59'),'GROUP_CONCAT DESC':_0x565c('0x5a')};var _0x437b20={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x565c('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x565c('0x5c'),'UNIX_TIMESTAMP':_0x565c('0x5d')};var _0x2dfc07=function(_0x1c844e){return!_['includes']([_0x565c('0x5e'),_0x565c('0x5f'),_0x565c('0x60'),_0x565c('0x61')],_0x1c844e);};var _0x598dc9=function(_0xf51b17){if(!_0xf51b17||!_0xf51b17[_0x565c('0x62')][_0x565c('0x63')]){return'';}for(var _0x426755='(',_0x3f6b54=0x0;_0x3f6b54<_0xf51b17[_0x565c('0x62')][_0x565c('0x63')];_0x3f6b54+=0x1){_0x3f6b54>0x0&&(_0x426755+='\x20'+_0xf51b17['operator']+'\x20');_0x426755+=_0xf51b17[_0x565c('0x62')][_0x3f6b54][_0x565c('0x64')]?_0x598dc9(_0xf51b17[_0x565c('0x62')][_0x3f6b54]['group']):_0xf51b17[_0x565c('0x62')][_0x3f6b54]['field']+'\x20'+_0xf51b17[_0x565c('0x62')][_0x3f6b54][_0x565c('0x65')]+(_0x2dfc07(_0xf51b17['rules'][_0x3f6b54]['condition'])?'\x20'+_0xf51b17[_0x565c('0x62')][_0x3f6b54]['value']:'');}return _0x426755+')';};var _0x3b1c12={'where':{'id':_0x4ab1cc[_0x565c('0x45')]['id']}},_0x465016,_0x5c6bf9,_0x3bbb55,_0x1f7859,_0x189a7b;_0x3b1c12=_['merge']({},_0x3b1c12,_0x4ab1cc[_0x565c('0x3f')]);return db[_0x565c('0x2c')][_0x565c('0x46')](_0x3b1c12)[_0x565c('0x1f')](function(_0x2cad56){if(_0x2cad56){_0x465016=_0x2cad56;return _0x2cad56[_0x565c('0x66')]();}return null;})['then'](function(_0x331df5){if(_0x331df5){if(!_0x331df5['length']){throw new db['Sequelize'][(_0x565c('0x67'))](_0x565c('0x68'),0x193);}_0x5c6bf9=_0x331df5;return db[_0x565c('0x69')][_0x565c('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x5bbdde){if(_0x5bbdde){_0x3bbb55=_['keyBy'](_0x5bbdde,'id');var _0x239549;var _0x3c6394=squel[_0x565c('0x6b')]();_0x3c6394['from'](_0x465016[_0x565c('0x6c')]);for(var _0x31495a=0x0;_0x31495a<_0x5c6bf9['length'];_0x31495a+=0x1){_0x239549=_0x5c6bf9[_0x31495a][_0x565c('0x6d')]?_0x3bbb55[_0x5c6bf9[_0x31495a][_0x565c('0x6d')]][_0x565c('0x6e')]:_0x5c6bf9[_0x31495a][_0x565c('0x6f')];_0x239549=_0x5c6bf9[_0x31495a][_0x565c('0x70')]?_[_0x565c('0x71')](_0x385b59[_0x5c6bf9[_0x31495a]['function']],'%s',_0x239549):_0x239549;_0x239549=_0x5c6bf9[_0x31495a][_0x565c('0x72')]?_[_0x565c('0x71')](_0x437b20[_0x5c6bf9[_0x31495a][_0x565c('0x72')]],'%s',_0x239549):_0x239549;if(_0x5c6bf9[_0x31495a]['groupBy']){_0x3c6394[_0x565c('0x64')](_0x239549);}_0x5c6bf9[_0x31495a][_0x565c('0x73')]&&_0x3c6394['order'](_0x239549,_0x5c6bf9[_0x31495a][_0x565c('0x73')]===_0x565c('0x74')?![]:!![]);_0x3c6394['field'](_0x239549,_0x5c6bf9[_0x31495a][_0x565c('0x75')]||_0x239549);}if(_0x465016[_0x565c('0x76')]){_0x465016[_0x565c('0x76')]=JSON[_0x565c('0x77')](_0x465016['joins']);for(var _0x3288e3=0x0;_0x3288e3<_0x465016[_0x565c('0x76')][_0x565c('0x63')];_0x3288e3+=0x1){if(_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x3d')]&&_['includes'](_0x4d2617,_0x465016[_0x565c('0x76')][_0x3288e3]['type'])&&_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x78')]&&_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x79')]&&_0x465016[_0x565c('0x76')][_0x3288e3]['foreignKey']){_0x3c6394[_0x465016['joins'][_0x3288e3][_0x565c('0x3d')]](_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x79')],null,util[_0x565c('0x72')](_0x565c('0x7a'),_0x465016[_0x565c('0x6c')],_0x465016[_0x565c('0x76')][_0x3288e3][_0x565c('0x78')],_0x465016['joins'][_0x3288e3]['foreignTable'],_0x465016['joins'][_0x3288e3]['foreignKey']));}}}if(_0x465016[_0x565c('0x7b')]){_0x465016['conditions']=JSON[_0x565c('0x77')](_0x465016[_0x565c('0x7b')]);_0x3c6394[_0x565c('0x3c')](_0x598dc9(_0x465016[_0x565c('0x7b')][_0x565c('0x64')]));}_0x189a7b=_0x3c6394['clone']();_0x3c6394[_0x565c('0x19')](_0x2b2f61);_0x3c6394[_0x565c('0x17')](0x0);logger[_0x565c('0x7c')](_0x565c('0x7d'),_0x3c6394[_0x565c('0x7e')]());return dbH[_0x565c('0x7f')][_0x565c('0x32')](_0x3c6394[_0x565c('0x7e')](),{'type':dbH[_0x565c('0x7f')][_0x565c('0x80')][_0x565c('0x81')]});}})[_0x565c('0x1f')](respondWithResult(_0x250fe6,null))[_0x565c('0x43')](handleError(_0x250fe6,null));};function runReport(_0x5ee522,_0x36a860,_0x1be7cf){var _0x598f9b=_0x36a860[_0x565c('0x28')];var _0x2dd69e=0xa;var _0x270319=['join',_0x565c('0x51'),'right_join','cross_join'];var _0x8fa186={'SUM':_0x565c('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x565c('0x82'),'MAX':_0x565c('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x565c('0x83'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x21a956={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x565c('0x5b'),'HOUR':_0x565c('0x84'),'ROUND':_0x565c('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x29ef49=function(_0x4ba395){return!_[_0x565c('0x85')](['IS\x20NULL',_0x565c('0x5f'),_0x565c('0x60'),_0x565c('0x61')],_0x4ba395);};var _0x4fe4fc=function(_0x1c1e4a){if(!_0x1c1e4a||!_0x1c1e4a['rules']['length']){return'';}for(var _0x56e344='(',_0x64b33e=0x0;_0x64b33e<_0x1c1e4a[_0x565c('0x62')]['length'];_0x64b33e+=0x1){_0x64b33e>0x0&&(_0x56e344+='\x20'+_0x1c1e4a['operator']+'\x20');_0x56e344+=_0x1c1e4a['rules'][_0x64b33e][_0x565c('0x64')]?_0x4fe4fc(_0x1c1e4a['rules'][_0x64b33e]['group']):_0x1c1e4a[_0x565c('0x62')][_0x64b33e][_0x565c('0x6f')]+'\x20'+_0x1c1e4a[_0x565c('0x62')][_0x64b33e]['condition']+(_0x29ef49(_0x1c1e4a[_0x565c('0x62')][_0x64b33e]['condition'])?'\x20'+_0x1c1e4a[_0x565c('0x62')][_0x64b33e]['value']:'');}return _0x56e344+')';};var _0x3e2b3d={'where':{'id':_0x5ee522['id']}},_0x442281,_0x2bcc3a,_0x223a83,_0x66003d,_0x73b401;_0x3e2b3d=_[_0x565c('0x3b')]({},_0x3e2b3d,_0x1be7cf);return db[_0x565c('0x2c')][_0x565c('0x46')](_0x3e2b3d)[_0x565c('0x1f')](function(_0x15eb84){if(_0x15eb84){_0x442281=_0x15eb84;return _0x15eb84['getFields']();}return null;})[_0x565c('0x1f')](function(_0x1631f9){if(_0x1631f9){if(!_0x1631f9['length']){throw new db[(_0x565c('0x86'))]['ValidationErrorItem'](_0x565c('0x68'),0x193);}_0x2bcc3a=_0x1631f9;return db[_0x565c('0x69')][_0x565c('0x6a')]({'raw':!![]});}return null;})[_0x565c('0x1f')](function(_0x2315f5){if(_0x2315f5){_0x223a83=_[_0x565c('0x87')](_0x2315f5,'id');var _0x6602e2;var _0x3003a8=squel['select']();_0x3003a8[_0x565c('0x88')](_0x442281[_0x565c('0x6c')]);for(var _0x4f6ea4=0x0;_0x4f6ea4<_0x2bcc3a[_0x565c('0x63')];_0x4f6ea4+=0x1){_0x6602e2=_0x2bcc3a[_0x4f6ea4][_0x565c('0x6d')]?_0x223a83[_0x2bcc3a[_0x4f6ea4][_0x565c('0x6d')]][_0x565c('0x6e')]:_0x2bcc3a[_0x4f6ea4][_0x565c('0x6f')];_0x6602e2=_0x2bcc3a[_0x4f6ea4][_0x565c('0x70')]?_['replace'](_0x8fa186[_0x2bcc3a[_0x4f6ea4]['function']],'%s',_0x6602e2):_0x6602e2;_0x6602e2=_0x2bcc3a[_0x4f6ea4][_0x565c('0x72')]?_[_0x565c('0x71')](_0x21a956[_0x2bcc3a[_0x4f6ea4][_0x565c('0x72')]],'%s',_0x6602e2):_0x6602e2;if(_0x2bcc3a[_0x4f6ea4]['groupBy']){_0x3003a8[_0x565c('0x64')](_0x6602e2);}_0x2bcc3a[_0x4f6ea4][_0x565c('0x73')]&&_0x3003a8[_0x565c('0x89')](_0x6602e2,_0x2bcc3a[_0x4f6ea4]['orderBy']===_0x565c('0x74')?![]:!![]);_0x3003a8[_0x565c('0x6f')](_0x6602e2,_0x2bcc3a[_0x4f6ea4][_0x565c('0x75')]||_0x6602e2);}if(_0x442281[_0x565c('0x76')]){_0x442281[_0x565c('0x76')]=JSON[_0x565c('0x77')](_0x442281['joins']);for(var _0x5a5587=0x0;_0x5a5587<_0x442281[_0x565c('0x76')][_0x565c('0x63')];_0x5a5587+=0x1){if(_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x3d')]&&_[_0x565c('0x85')](_0x270319,_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x3d')])&&_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x78')]&&_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x79')]&&_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x8a')]){_0x3003a8[_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x3d')]](_0x442281[_0x565c('0x76')][_0x5a5587]['foreignTable'],null,util[_0x565c('0x72')](_0x565c('0x7a'),_0x442281['table'],_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x78')],_0x442281['joins'][_0x5a5587]['foreignTable'],_0x442281[_0x565c('0x76')][_0x5a5587][_0x565c('0x8a')]));}}}if(_0x442281['conditions']){_0x442281[_0x565c('0x7b')]=JSON[_0x565c('0x77')](_0x442281[_0x565c('0x7b')]);_0x3003a8[_0x565c('0x3c')](_0x4fe4fc(_0x442281[_0x565c('0x7b')]['group']));}_0x73b401=_0x3003a8[_0x565c('0x8b')]();_0x3003a8[_0x565c('0x19')](_0x2dd69e);_0x3003a8[_0x565c('0x17')](0x0);return;}})['then'](function(){if(_0x36a860[_0x565c('0x8c')]===_0x565c('0x8d')){return null;}var _0x460cd3=_[_0x565c('0x3b')](_0x36a860,{'name':_0x36a860['fullPath']||_0x36a860[_0x565c('0x28')]||_0x442281[_0x565c('0x28')],'basename':_0x598f9b,'savename':util['format'](_0x565c('0x8e'),_0x36a860[_0x565c('0x28')]||_0x442281[_0x565c('0x28')],require('randomstring')[_0x565c('0x8f')](0x4),_0x36a860['output']||_0x565c('0x90')),'reportId':_0x442281['id'],'reportType':'custom'});return db[_0x565c('0x91')][_0x565c('0x47')](_0x460cd3,{'raw':!![]});})[_0x565c('0x1f')](function(_0x2fefbd){if(_0x442281[_0x565c('0x6c')]==='cdr'){_0x73b401['where'](_0x442281[_0x565c('0x6c')]+_0x565c('0x92'),_0x36a860[_0x565c('0x93')],_0x36a860[_0x565c('0x94')]);}else{_0x73b401[_0x565c('0x3c')](_0x442281[_0x565c('0x6c')]+_0x565c('0x95'),_0x36a860[_0x565c('0x93')],_0x36a860[_0x565c('0x94')]);}if(_0x2fefbd){logger[_0x565c('0x96')]('Run\x20Query:',_0x73b401[_0x565c('0x7e')]());require('child_process')[_0x565c('0x97')](path['join'](__dirname,_0x565c('0x98'),_0x2fefbd[_0x565c('0x8c')]),[_0x2fefbd['id'],_0x73b401[_0x565c('0x7e')](),path[_0x565c('0x50')](__dirname,_0x565c('0x99'),_0x2fefbd['savename']),_0x598f9b]);return _0x2fefbd;}else{var _0x4c9e39=squel['select']();_0x4c9e39['from']('('+_0x73b401[_0x565c('0x7e')]()+')',_0x565c('0x9a'));_0x4c9e39[_0x565c('0x6f')](_0x565c('0x9b'),_0x565c('0x18'));_0x73b401['limit'](_0x36a860['limit']||_0x2dd69e);_0x73b401[_0x565c('0x17')](_0x36a860['offset']||0x0);return dbH['sequelize'][_0x565c('0x32')](_0x4c9e39['toString'](),{'type':dbH[_0x565c('0x7f')]['QueryTypes'][_0x565c('0x81')]})['then'](function(_0x4e38d7){if(!_0x4e38d7[_0x565c('0x63')]){_0x66003d=0x0;}else{_0x66003d=_0x4e38d7[0x0]['count']||0x0;}return dbH[_0x565c('0x7f')][_0x565c('0x32')](_0x73b401['toString'](),{'type':dbH[_0x565c('0x7f')][_0x565c('0x80')][_0x565c('0x81')]});})[_0x565c('0x1f')](function(_0x459bd4){return{'rows':_0x459bd4||[],'count':_0x66003d};});}});}exports['run']=function(_0x38dd27,_0x21058f){return runReport(_0x38dd27[_0x565c('0x45')],_0x38dd27['query'],_0x38dd27[_0x565c('0x3f')])[_0x565c('0x1f')](respondWithResult(_0x21058f,null))[_0x565c('0x43')](handleError(_0x21058f,null));};exports['runReport']=runReport;exports[_0x565c('0x32')]=function(_0x17db4e,_0x35a84d){var _0x4194a2=0xa;var _0x3076af=['join',_0x565c('0x51'),'right_join',_0x565c('0x53')];var _0x57ba46={'SUM':_0x565c('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x565c('0x82'),'MAX':_0x565c('0x56'),'MIN':_0x565c('0x57'),'AVG':_0x565c('0x58'),'GROUP_CONCAT':_0x565c('0x83'),'GROUP_CONCAT ASC':_0x565c('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x404065={'SEC_TO_TIME':_0x565c('0x9c'),'DATE':_0x565c('0x5b'),'HOUR':_0x565c('0x84'),'ROUND':_0x565c('0x5c'),'UNIX_TIMESTAMP':_0x565c('0x5d')};var _0x3a1bf4=function(_0x133143){return!_[_0x565c('0x85')]([_0x565c('0x5e'),_0x565c('0x5f'),_0x565c('0x60'),'IS\x20NOT\x20EMPTY'],_0x133143);};var _0x20272e=function(_0x128de5){if(!_0x128de5||!_0x128de5['rules'][_0x565c('0x63')]){return'';}for(var _0xb654b5='(',_0xd38e6f=0x0;_0xd38e6f<_0x128de5['rules'][_0x565c('0x63')];_0xd38e6f+=0x1){_0xd38e6f>0x0&&(_0xb654b5+='\x20'+_0x128de5[_0x565c('0x9d')]+'\x20');_0xb654b5+=_0x128de5['rules'][_0xd38e6f][_0x565c('0x64')]?_0x20272e(_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x64')]):_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x6f')]+'\x20'+_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x65')]+(_0x3a1bf4(_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x65')])?'\x20'+_0x128de5[_0x565c('0x62')][_0xd38e6f][_0x565c('0x9e')]:'');}return _0xb654b5+')';};var _0x5a2442={'where':{'id':_0x17db4e[_0x565c('0x45')]['id']}},_0x2427de,_0x20dc84,_0x5602ba,_0x53d00e,_0xcbb13d;_0x5a2442=_[_0x565c('0x3b')]({},_0x5a2442,_0x17db4e[_0x565c('0x3f')]);return db[_0x565c('0x2c')]['find'](_0x5a2442)[_0x565c('0x1f')](function(_0x3f2c87){if(_0x3f2c87){_0x2427de=_0x3f2c87;return _0x3f2c87[_0x565c('0x66')]();}return null;})[_0x565c('0x1f')](function(_0x50dad8){if(_0x50dad8){if(!_0x50dad8[_0x565c('0x63')]){throw new db[(_0x565c('0x86'))][(_0x565c('0x67'))](_0x565c('0x68'),0x193);}_0x20dc84=_0x50dad8;return db[_0x565c('0x69')][_0x565c('0x6a')]({'raw':!![]});}return null;})[_0x565c('0x1f')](function(_0x57c008){if(_0x57c008){_0x5602ba=_['keyBy'](_0x57c008,'id');var _0xf8ccc2;var _0x4f75c3=squel[_0x565c('0x6b')]();_0x4f75c3[_0x565c('0x88')](_0x2427de['table']);for(var _0x498005=0x0;_0x498005<_0x20dc84[_0x565c('0x63')];_0x498005+=0x1){_0xf8ccc2=_0x20dc84[_0x498005][_0x565c('0x6d')]?_0x5602ba[_0x20dc84[_0x498005][_0x565c('0x6d')]][_0x565c('0x6e')]:_0x20dc84[_0x498005]['field'];_0xf8ccc2=_0x20dc84[_0x498005]['function']?_[_0x565c('0x71')](_0x57ba46[_0x20dc84[_0x498005][_0x565c('0x70')]],'%s',_0xf8ccc2):_0xf8ccc2;_0xf8ccc2=_0x20dc84[_0x498005][_0x565c('0x72')]?_[_0x565c('0x71')](_0x404065[_0x20dc84[_0x498005][_0x565c('0x72')]],'%s',_0xf8ccc2):_0xf8ccc2;if(_0x20dc84[_0x498005][_0x565c('0x9f')]){_0x4f75c3[_0x565c('0x64')](_0xf8ccc2);}_0x20dc84[_0x498005]['orderBy']&&_0x4f75c3[_0x565c('0x89')](_0xf8ccc2,_0x20dc84[_0x498005][_0x565c('0x73')]===_0x565c('0x74')?![]:!![]);_0x4f75c3[_0x565c('0x6f')](_0xf8ccc2,_0x20dc84[_0x498005][_0x565c('0x75')]||_0xf8ccc2);}if(_0x2427de[_0x565c('0x76')]){_0x2427de[_0x565c('0x76')]=JSON[_0x565c('0x77')](_0x2427de[_0x565c('0x76')]);for(var _0x380d38=0x0;_0x380d38<_0x2427de[_0x565c('0x76')]['length'];_0x380d38+=0x1){if(_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x3d')]&&_[_0x565c('0x85')](_0x3076af,_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x3d')])&&_0x2427de['joins'][_0x380d38][_0x565c('0x78')]&&_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x79')]&&_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x8a')]){_0x4f75c3[_0x2427de['joins'][_0x380d38][_0x565c('0x3d')]](_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x79')],null,util[_0x565c('0x72')](_0x565c('0x7a'),_0x2427de[_0x565c('0x6c')],_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x78')],_0x2427de['joins'][_0x380d38]['foreignTable'],_0x2427de[_0x565c('0x76')][_0x380d38][_0x565c('0x8a')]));}}}if(_0x2427de[_0x565c('0x7b')]){_0x2427de[_0x565c('0x7b')]=JSON['parse'](_0x2427de[_0x565c('0x7b')]);_0x4f75c3[_0x565c('0x3c')](_0x20272e(_0x2427de[_0x565c('0x7b')][_0x565c('0x64')]));}_0xcbb13d=_0x4f75c3[_0x565c('0x8b')]();_0x4f75c3['limit'](_0x4194a2);_0x4f75c3['offset'](0x0);logger[_0x565c('0x7c')](_0x565c('0x7d'),_0x4f75c3[_0x565c('0x7e')]());return dbH['sequelize']['query'](_0x4f75c3[_0x565c('0x7e')](),{'type':dbH[_0x565c('0x7f')][_0x565c('0x80')][_0x565c('0x81')]});}})[_0x565c('0x1f')](function(){return{'sql':_0xcbb13d[_0x565c('0x7e')]()};})[_0x565c('0x1f')](respondWithResult(_0x35a84d,null))['catch'](handleError(_0x35a84d,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 7cbed83..8caf665 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 _0x28f9=['analytics_custom_reports','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','AnalyticCustomReport'];(function(_0x183964,_0x2dd9ac){var _0x311d8f=function(_0x1b8f9b){while(--_0x1b8f9b){_0x183964['push'](_0x183964['shift']());}};_0x311d8f(++_0x2dd9ac);}(_0x28f9,0x7a));var _0x928f=function(_0x158db6,_0x1ea45d){_0x158db6=_0x158db6-0x0;var _0x200753=_0x28f9[_0x158db6];return _0x200753;};'use strict';var _=require('lodash');var util=require(_0x928f('0x0'));var logger=require(_0x928f('0x1'))(_0x928f('0x2'));var moment=require(_0x928f('0x3'));var BPromise=require(_0x928f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x928f('0x5'));var rimraf=require(_0x928f('0x6'));var config=require(_0x928f('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x928f('0x8')]=function(_0x59794b,_0x1772f3){return _0x59794b['define'](_0x928f('0x9'),attributes,{'tableName':_0x928f('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3a2=['./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x521930,_0x2db99){var _0x340de4=function(_0x4fe715){while(--_0x4fe715){_0x521930['push'](_0x521930['shift']());}};_0x340de4(++_0x2db99);}(_0xf3a2,0xe1));var _0x2f3a=function(_0x1051d8,_0x1996ea){_0x1051d8=_0x1051d8-0x0;var _0x524ed6=_0xf3a2[_0x1051d8];return _0x524ed6;};'use strict';var _=require(_0x2f3a('0x0'));var util=require(_0x2f3a('0x1'));var logger=require('../../config/logger')(_0x2f3a('0x2'));var moment=require(_0x2f3a('0x3'));var BPromise=require(_0x2f3a('0x4'));var rp=require(_0x2f3a('0x5'));var fs=require('fs');var path=require(_0x2f3a('0x6'));var rimraf=require(_0x2f3a('0x7'));var config=require(_0x2f3a('0x8'));var attributes=require(_0x2f3a('0x9'));module[_0x2f3a('0xa')]=function(_0x40d8ee,_0x427d10){return _0x40d8ee[_0x2f3a('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0x2f3a('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index b2d78f1..935bb1b 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 _0xf6bd=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x206794,_0x26fd02){var _0x38a75b=function(_0x208082){while(--_0x208082){_0x206794['push'](_0x206794['shift']());}};_0x38a75b(++_0x26fd02);}(_0xf6bd,0x7b));var _0xdf6b=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0xf6bd[_0x4a8418];return _0x390174;};'use strict';var _=require('lodash');var util=require(_0xdf6b('0x0'));var moment=require(_0xdf6b('0x1'));var BPromise=require(_0xdf6b('0x2'));var rs=require(_0xdf6b('0x3'));var fs=require('fs');var Redis=require(_0xdf6b('0x4'));var db=require(_0xdf6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf6b('0x6'))(_0xdf6b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdf6b('0x8')][_0xdf6b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36cbd0,_0x2b31b8,_0x388f1a){return new BPromise(function(_0x1bbbb6,_0x63dc28){return client[_0xdf6b('0xa')](_0x36cbd0,_0x388f1a)[_0xdf6b('0xb')](function(_0x97aee1){logger[_0xdf6b('0xc')](_0xdf6b('0xd'),_0x2b31b8,_0xdf6b('0xe'));logger[_0xdf6b('0xf')](_0xdf6b('0x10'),_0x2b31b8,'request\x20sent',JSON[_0xdf6b('0x11')](_0x97aee1));if(_0x97aee1['error']){if(_0x97aee1[_0xdf6b('0x12')][_0xdf6b('0x13')]===0x1f4){logger[_0xdf6b('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0x97aee1[_0xdf6b('0x12')][_0xdf6b('0x14')]);return _0x63dc28(_0x97aee1['error'][_0xdf6b('0x14')]);}logger[_0xdf6b('0x12')](_0xdf6b('0xd'),_0x2b31b8,_0x97aee1[_0xdf6b('0x12')]['message']);return _0x1bbbb6(_0x97aee1['error'][_0xdf6b('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0xdf6b('0xe'));_0x1bbbb6(_0x97aee1['result']['message']);}})[_0xdf6b('0x15')](function(_0x45bc66){logger[_0xdf6b('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0x45bc66);_0x63dc28(_0x45bc66);});});}
\ No newline at end of file
+var _0x3a95=['error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0x3a95,0x1bd));var _0x53a9=function(_0x5a01fe,_0xf1fd07){_0x5a01fe=_0x5a01fe-0x0;var _0x68b31e=_0x3a95[_0x5a01fe];return _0x68b31e;};'use strict';var _=require(_0x53a9('0x0'));var util=require('util');var moment=require(_0x53a9('0x1'));var BPromise=require(_0x53a9('0x2'));var rs=require(_0x53a9('0x3'));var fs=require('fs');var Redis=require(_0x53a9('0x4'));var db=require(_0x53a9('0x5'))['db'];var utils=require(_0x53a9('0x6'));var logger=require('../../config/logger')(_0x53a9('0x7'));var config=require(_0x53a9('0x8'));var jayson=require(_0x53a9('0x9'));var client=jayson[_0x53a9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x307624,_0x322a43,_0x1c5497){return new BPromise(function(_0x9f5294,_0x41e596){return client[_0x53a9('0xb')](_0x307624,_0x1c5497)[_0x53a9('0xc')](function(_0x5bc51f){logger[_0x53a9('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x322a43,_0x53a9('0xe'));logger[_0x53a9('0xf')](_0x53a9('0x10'),_0x322a43,_0x53a9('0xe'),JSON['stringify'](_0x5bc51f));if(_0x5bc51f[_0x53a9('0x11')]){if(_0x5bc51f[_0x53a9('0x11')][_0x53a9('0x12')]===0x1f4){logger[_0x53a9('0x11')](_0x53a9('0x13'),_0x322a43,_0x5bc51f[_0x53a9('0x11')]['message']);return _0x41e596(_0x5bc51f['error'][_0x53a9('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x322a43,_0x5bc51f[_0x53a9('0x11')]['message']);return _0x9f5294(_0x5bc51f[_0x53a9('0x11')]['message']);}else{logger[_0x53a9('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x322a43,'request\x20sent');_0x9f5294(_0x5bc51f[_0x53a9('0x15')]['message']);}})['catch'](function(_0x4cb270){logger[_0x53a9('0x11')](_0x53a9('0x13'),_0x322a43,_0x4cb270);_0x41e596(_0x4cb270);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 82cd0f6..5537bb4 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 _0x4cc8=['/:id','get','/:id/preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index'];(function(_0x4030ee,_0x41fadd){var _0x27f309=function(_0x506771){while(--_0x506771){_0x4030ee['push'](_0x4030ee['shift']());}};_0x27f309(++_0x41fadd);}(_0x4cc8,0x157));var _0x84cc=function(_0x178ddb,_0x44c400){_0x178ddb=_0x178ddb-0x0;var _0x12ce4c=_0x4cc8[_0x178ddb];return _0x12ce4c;};'use strict';var multer=require(_0x84cc('0x0'));var util=require(_0x84cc('0x1'));var path=require(_0x84cc('0x2'));var timeout=require(_0x84cc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x84cc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x84cc('0x5'));var controller=require(_0x84cc('0x6'));router['get']('/',auth[_0x84cc('0x7')](),controller[_0x84cc('0x8')]);router['get'](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller['show']);router[_0x84cc('0xa')](_0x84cc('0xb'),auth[_0x84cc('0x7')](),controller['preview']);router[_0x84cc('0xa')](_0x84cc('0xc'),auth[_0x84cc('0x7')](),controller[_0x84cc('0xd')]);router[_0x84cc('0xa')](_0x84cc('0xe'),auth[_0x84cc('0x7')](),controller[_0x84cc('0xf')]);router['post']('/',auth[_0x84cc('0x7')](),controller[_0x84cc('0x10')]);router[_0x84cc('0x11')](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller[_0x84cc('0x12')]);router[_0x84cc('0x13')](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller[_0x84cc('0x14')]);module[_0x84cc('0x15')]=router;
\ No newline at end of file
+var _0x52f1=['/:id/preview','preview','run','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id'];(function(_0xe6569c,_0x2e94cc){var _0x2157b0=function(_0x10c4af){while(--_0x10c4af){_0xe6569c['push'](_0xe6569c['shift']());}};_0x2157b0(++_0x2e94cc);}(_0x52f1,0x7c));var _0x152f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x52f1[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x152f('0x0'));var util=require(_0x152f('0x1'));var path=require(_0x152f('0x2'));var timeout=require(_0x152f('0x3'));var express=require(_0x152f('0x4'));var router=express[_0x152f('0x5')]();var fs_extra=require(_0x152f('0x6'));var auth=require(_0x152f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x152f('0x8'));var controller=require(_0x152f('0x9'));router['get']('/',auth[_0x152f('0xa')](),controller[_0x152f('0xb')]);router[_0x152f('0xc')](_0x152f('0xd'),auth[_0x152f('0xa')](),controller['show']);router[_0x152f('0xc')](_0x152f('0xe'),auth[_0x152f('0xa')](),controller[_0x152f('0xf')]);router['get']('/:id/run',auth[_0x152f('0xa')](),controller[_0x152f('0x10')]);router['get']('/:id/query',auth[_0x152f('0xa')](),controller['query']);router[_0x152f('0x11')]('/',auth['isAuthenticated'](),controller[_0x152f('0x12')]);router[_0x152f('0x13')]('/:id',auth[_0x152f('0xa')](),controller[_0x152f('0x14')]);router['delete'](_0x152f('0xd'),auth[_0x152f('0xa')](),controller[_0x152f('0x15')]);module[_0x152f('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 4b89ece..adc94db 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 _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x7da7[_0x3c4062];return _0x3f5bf3;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','TEXT'];(function(_0x506463,_0x1bacf7){var _0x67756f=function(_0x6d012a){while(--_0x6d012a){_0x506463['push'](_0x506463['shift']());}};_0x67756f(++_0x1bacf7);}(_0x7217,0x19e));var _0x7721=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x7217[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 4c4c1fa..e6ebdac 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 _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(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'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
+var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x16ca39,_0x15abe3){var _0x5413d3=function(_0x17545f){while(--_0x17545f){_0x16ca39['push'](_0x16ca39['shift']());}};_0x5413d3(++_0x15abe3);}(_0xf494,0x1c6));var _0x4f49=function(_0x18455e,_0x19992e){_0x18455e=_0x18455e-0x0;var _0x3553bf=_0xf494[_0x18455e];return _0x3553bf;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index bbc4632..334c46a 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 _0xbdf0=['bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','api','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbdf0,0x15b));var _0x0bdf=function(_0x18cfc7,_0x27371b){_0x18cfc7=_0x18cfc7-0x0;var _0x3d0e73=_0xbdf0[_0x18cfc7];return _0x3d0e73;};'use strict';var _=require(_0x0bdf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0bdf('0x1'));var moment=require(_0x0bdf('0x2'));var BPromise=require(_0x0bdf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bdf('0x4'));var rimraf=require('rimraf');var config=require(_0x0bdf('0x5'));var attributes=require(_0x0bdf('0x6'));module[_0x0bdf('0x7')]=function(_0x49fa94,_0x4a4c72){return _0x49fa94[_0x0bdf('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x0bdf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x411b=['../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x4195aa,_0x5be549){var _0x44b99e=function(_0xc827fc){while(--_0xc827fc){_0x4195aa['push'](_0x4195aa['shift']());}};_0x44b99e(++_0x5be549);}(_0x411b,0xcb));var _0xb411=function(_0x381e8f,_0x5dc623){_0x381e8f=_0x381e8f-0x0;var _0x3b84e5=_0x411b[_0x381e8f];return _0x3b84e5;};'use strict';var _=require(_0xb411('0x0'));var util=require(_0xb411('0x1'));var logger=require('../../config/logger')(_0xb411('0x2'));var moment=require('moment');var BPromise=require(_0xb411('0x3'));var rp=require(_0xb411('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb411('0x5'));var config=require(_0xb411('0x6'));var attributes=require(_0xb411('0x7'));module[_0xb411('0x8')]=function(_0x20c7bc,_0x36146a){return _0x20c7bc[_0xb411('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0xb411('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 57f9b09..e62458c 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 _0x31d9=['stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x31d9,0x1d4));var _0x931d=function(_0x48795e,_0x46c47d){_0x48795e=_0x48795e-0x0;var _0xeed653=_0x31d9[_0x48795e];return _0xeed653;};'use strict';var _=require(_0x931d('0x0'));var util=require(_0x931d('0x1'));var moment=require(_0x931d('0x2'));var BPromise=require(_0x931d('0x3'));var rs=require(_0x931d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x931d('0x5'));var logger=require(_0x931d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x931d('0x7'));var client=jayson[_0x931d('0x8')][_0x931d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x95c99c,_0x101c36,_0x5878df){return new BPromise(function(_0x530efe,_0x34e66d){return client[_0x931d('0xa')](_0x95c99c,_0x5878df)[_0x931d('0xb')](function(_0x3a24eb){logger[_0x931d('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x101c36,_0x931d('0xd'));logger['debug'](_0x931d('0xe'),_0x101c36,_0x931d('0xd'),JSON[_0x931d('0xf')](_0x3a24eb));if(_0x3a24eb[_0x931d('0x10')]){if(_0x3a24eb[_0x931d('0x10')][_0x931d('0x11')]===0x1f4){logger['error'](_0x931d('0x12'),_0x101c36,_0x3a24eb[_0x931d('0x10')]['message']);return _0x34e66d(_0x3a24eb[_0x931d('0x10')][_0x931d('0x13')]);}logger[_0x931d('0x10')](_0x931d('0x12'),_0x101c36,_0x3a24eb['error'][_0x931d('0x13')]);return _0x530efe(_0x3a24eb[_0x931d('0x10')][_0x931d('0x13')]);}else{logger['info'](_0x931d('0x12'),_0x101c36,_0x931d('0xd'));_0x530efe(_0x3a24eb[_0x931d('0x14')][_0x931d('0x13')]);}})['catch'](function(_0x1a50d5){logger[_0x931d('0x10')](_0x931d('0x12'),_0x101c36,_0x1a50d5);_0x34e66d(_0x1a50d5);});});}
\ No newline at end of file
+var _0x75ed=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x36a957,_0x238eb5){var _0x2a1fae=function(_0x1d99ac){while(--_0x1d99ac){_0x36a957['push'](_0x36a957['shift']());}};_0x2a1fae(++_0x238eb5);}(_0x75ed,0xaa));var _0xd75e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x75ed[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xd75e('0x0'));var moment=require('moment');var BPromise=require(_0xd75e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd75e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd75e('0x3'));var logger=require(_0xd75e('0x4'))(_0xd75e('0x5'));var config=require(_0xd75e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd75e('0x7')][_0xd75e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x124199,_0x7bc86b,_0x5823fe){return new BPromise(function(_0x120d8a,_0x100f9a){return client[_0xd75e('0x9')](_0x124199,_0x5823fe)['then'](function(_0x4862cc){logger[_0xd75e('0xa')](_0xd75e('0xb'),_0x7bc86b,_0xd75e('0xc'));logger[_0xd75e('0xd')](_0xd75e('0xe'),_0x7bc86b,_0xd75e('0xc'),JSON['stringify'](_0x4862cc));if(_0x4862cc[_0xd75e('0xf')]){if(_0x4862cc[_0xd75e('0xf')][_0xd75e('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x7bc86b,_0x4862cc[_0xd75e('0xf')][_0xd75e('0x11')]);return _0x100f9a(_0x4862cc[_0xd75e('0xf')][_0xd75e('0x11')]);}logger['error'](_0xd75e('0xb'),_0x7bc86b,_0x4862cc['error'][_0xd75e('0x11')]);return _0x120d8a(_0x4862cc[_0xd75e('0xf')][_0xd75e('0x11')]);}else{logger[_0xd75e('0xa')](_0xd75e('0xb'),_0x7bc86b,'request\x20sent');_0x120d8a(_0x4862cc[_0xd75e('0x12')][_0xd75e('0x11')]);}})[_0xd75e('0x13')](function(_0xc0bd9d){logger[_0xd75e('0xf')](_0xd75e('0xb'),_0x7bc86b,_0xc0bd9d);_0x100f9a(_0xc0bd9d);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 9c6bcf2..bf4ebc6 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 _0x3311=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','/:id/query','post','create','put','update','delete','destroy','exports'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x3311,0x1d4));var _0x1331=function(_0x2c9841,_0x1a7e07){_0x2c9841=_0x2c9841-0x0;var _0x4f5641=_0x3311[_0x2c9841];return _0x4f5641;};'use strict';var multer=require(_0x1331('0x0'));var util=require(_0x1331('0x1'));var path=require(_0x1331('0x2'));var timeout=require(_0x1331('0x3'));var express=require(_0x1331('0x4'));var router=express[_0x1331('0x5')]();var fs_extra=require(_0x1331('0x6'));var auth=require(_0x1331('0x7'));var interaction=require(_0x1331('0x8'));var config=require(_0x1331('0x9'));var controller=require(_0x1331('0xa'));router[_0x1331('0xb')]('/',auth[_0x1331('0xc')](),controller[_0x1331('0xd')]);router[_0x1331('0xb')](_0x1331('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1331('0xb')](_0x1331('0xf'),auth[_0x1331('0xc')](),controller[_0x1331('0x10')]);router[_0x1331('0xb')]('/:id/run',auth[_0x1331('0xc')](),controller[_0x1331('0x11')]);router[_0x1331('0xb')](_0x1331('0x12'),auth[_0x1331('0xc')](),controller['query']);router[_0x1331('0x13')]('/',auth['isAuthenticated'](),controller[_0x1331('0x14')]);router[_0x1331('0x15')](_0x1331('0xe'),auth[_0x1331('0xc')](),controller[_0x1331('0x16')]);router[_0x1331('0x17')](_0x1331('0xe'),auth['isAuthenticated'](),controller[_0x1331('0x18')]);module[_0x1331('0x19')]=router;
\ No newline at end of file
+var _0xef27=['/:id','show','/:id/preview','preview','/:id/run','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x2be6d1,_0x3d31c9){var _0x19847a=function(_0x435507){while(--_0x435507){_0x2be6d1['push'](_0x2be6d1['shift']());}};_0x19847a(++_0x3d31c9);}(_0xef27,0x1c2));var _0x7ef2=function(_0x392cf9,_0x48512f){_0x392cf9=_0x392cf9-0x0;var _0x2ee970=_0xef27[_0x392cf9];return _0x2ee970;};'use strict';var multer=require(_0x7ef2('0x0'));var util=require(_0x7ef2('0x1'));var path=require(_0x7ef2('0x2'));var timeout=require(_0x7ef2('0x3'));var express=require('express');var router=express[_0x7ef2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7ef2('0x5'));var controller=require(_0x7ef2('0x6'));router[_0x7ef2('0x7')]('/',auth[_0x7ef2('0x8')](),controller[_0x7ef2('0x9')]);router[_0x7ef2('0x7')](_0x7ef2('0xa'),auth[_0x7ef2('0x8')](),controller[_0x7ef2('0xb')]);router[_0x7ef2('0x7')](_0x7ef2('0xc'),auth[_0x7ef2('0x8')](),controller[_0x7ef2('0xd')]);router[_0x7ef2('0x7')](_0x7ef2('0xe'),auth[_0x7ef2('0x8')](),controller['run']);router[_0x7ef2('0x7')]('/:id/query',auth[_0x7ef2('0x8')](),controller['query']);router['post']('/',auth[_0x7ef2('0x8')](),controller[_0x7ef2('0xf')]);router['put'](_0x7ef2('0xa'),auth[_0x7ef2('0x8')](),controller[_0x7ef2('0x10')]);router[_0x7ef2('0x11')]('/:id',auth[_0x7ef2('0x8')](),controller[_0x7ef2('0x12')]);module[_0x7ef2('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 19791f1..50c42bd 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 _0x2e14=['xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x5e6352,_0x3232f5){var _0x1e6f46=function(_0x4f2729){while(--_0x4f2729){_0x5e6352['push'](_0x5e6352['shift']());}};_0x1e6f46(++_0x3232f5);}(_0x2e14,0x77));var _0x42e1=function(_0x3356c5,_0x20a150){_0x3356c5=_0x3356c5-0x0;var _0x556859=_0x2e14[_0x3356c5];return _0x556859;};'use strict';var Sequelize=require(_0x42e1('0x0'));var moment=require(_0x42e1('0x1'));module[_0x42e1('0x2')]={'name':{'type':Sequelize[_0x42e1('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x42e1('0x4')](_0x42e1('0x5'),_0x42e1('0x6'),_0x42e1('0x7')),'allowNull':![],'defaultValue':_0x42e1('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x42e1('0x8')]},'endDate':{'type':Sequelize[_0x42e1('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x42e1('0x9')},'type':{'type':Sequelize[_0x42e1('0x4')](_0x42e1('0xa'),_0x42e1('0xb')),'allowNull':![],'defaultValue':_0x42e1('0xa')},'reportId':{'type':Sequelize[_0x42e1('0xc')](0xb)[_0x42e1('0xd')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6bf9=['pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv'];(function(_0xd9abae,_0x5172db){var _0x2a1b13=function(_0x2f2e13){while(--_0x2f2e13){_0xd9abae['push'](_0xd9abae['shift']());}};_0x2a1b13(++_0x5172db);}(_0x6bf9,0x1db));var _0x96bf=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x6bf9[_0x4b73a2];return _0x383c66;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x96bf('0x0'));module[_0x96bf('0x1')]={'name':{'type':Sequelize[_0x96bf('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x96bf('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x96bf('0x3')](_0x96bf('0x4'),_0x96bf('0x5'),_0x96bf('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x96bf('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x96bf('0x7')]},'endDate':{'type':Sequelize[_0x96bf('0x7')]},'status':{'type':Sequelize[_0x96bf('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x96bf('0x8'),_0x96bf('0x9')),'allowNull':![],'defaultValue':_0x96bf('0x8')},'reportId':{'type':Sequelize[_0x96bf('0xa')](0xb)[_0x96bf('0xb')]},'reportType':{'type':Sequelize[_0x96bf('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index bb9c873..199b423 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 _0xdfe8=['exists','format','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','keys','find','catch','create','body','user','role','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','root','server/files/reports','ValidationError'];(function(_0x5598ed,_0x366268){var _0x5368a4=function(_0x308473){while(--_0x308473){_0x5598ed['push'](_0x5598ed['shift']());}};_0x5368a4(++_0x366268);}(_0xdfe8,0x66));var _0x8dfe=function(_0x77d286,_0x1ddc6d){_0x77d286=_0x77d286-0x0;var _0x5446a5=_0xdfe8[_0x77d286];return _0x5446a5;};'use strict';var emlformat=require(_0x8dfe('0x0'));var rimraf=require(_0x8dfe('0x1'));var zipdir=require(_0x8dfe('0x2'));var jsonpatch=require(_0x8dfe('0x3'));var rp=require(_0x8dfe('0x4'));var moment=require(_0x8dfe('0x5'));var BPromise=require(_0x8dfe('0x6'));var Mustache=require(_0x8dfe('0x7'));var util=require(_0x8dfe('0x8'));var path=require(_0x8dfe('0x9'));var sox=require('sox');var csv=require(_0x8dfe('0xa'));var ejs=require(_0x8dfe('0xb'));var fs=require('fs');var fs_extra=require(_0x8dfe('0xc'));var _=require('lodash');var squel=require(_0x8dfe('0xd'));var crypto=require(_0x8dfe('0xe'));var jsforce=require(_0x8dfe('0xf'));var deskjs=require(_0x8dfe('0x10'));var toCsv=require(_0x8dfe('0xa'));var querystring=require(_0x8dfe('0x11'));var Papa=require(_0x8dfe('0x12'));var Redis=require('ioredis');var authService=require(_0x8dfe('0x13'));var qs=require(_0x8dfe('0x14'));var as=require(_0x8dfe('0x15'));var hardwareService=require(_0x8dfe('0x16'));var logger=require(_0x8dfe('0x17'))(_0x8dfe('0x18'));var utils=require(_0x8dfe('0x19'));var config=require(_0x8dfe('0x1a'));var licenseUtil=require(_0x8dfe('0x1b'));var db=require(_0x8dfe('0x1c'))['db'];function respondWithStatusCode(_0x3304e5,_0x5aa0b8){_0x5aa0b8=_0x5aa0b8||0xcc;return function(_0x45d203){if(_0x45d203){return _0x3304e5[_0x8dfe('0x1d')](_0x5aa0b8);}return _0x3304e5['status'](_0x5aa0b8)[_0x8dfe('0x1e')]();};}function respondWithResult(_0x2da34a,_0x1e9898){_0x1e9898=_0x1e9898||0xc8;return function(_0x4f1142){if(_0x4f1142){return _0x2da34a[_0x8dfe('0x1f')](_0x1e9898)[_0x8dfe('0x20')](_0x4f1142);}};}function respondWithFilteredResult(_0x194071,_0x164337){return function(_0x146846){if(_0x146846){var _0x3b8f5a=typeof _0x164337['offset']===_0x8dfe('0x21')&&typeof _0x164337[_0x8dfe('0x22')]===_0x8dfe('0x21');var _0x2ee5a1=_0x146846['count'];var _0x2b61ba=_0x3b8f5a?0x0:_0x164337[_0x8dfe('0x23')];var _0xc6d867=_0x3b8f5a?_0x146846[_0x8dfe('0x24')]:_0x164337[_0x8dfe('0x23')]+_0x164337[_0x8dfe('0x22')];var _0x2aad52;if(_0xc6d867>=_0x2ee5a1){_0xc6d867=_0x2ee5a1;_0x2aad52=0xc8;}else{_0x2aad52=0xce;}_0x194071['status'](_0x2aad52);return _0x194071[_0x8dfe('0x25')](_0x8dfe('0x26'),_0x2b61ba+'-'+_0xc6d867+'/'+_0x2ee5a1)['json'](_0x146846);}return null;};}function patchUpdates(_0xaa9b2f){return function(_0x5b33a0){try{jsonpatch[_0x8dfe('0x27')](_0x5b33a0,_0xaa9b2f,!![]);}catch(_0x2aeb06){return BPromise['reject'](_0x2aeb06);}return _0x5b33a0[_0x8dfe('0x28')]();};}function saveUpdates(_0x19c20a,_0x13f561){return function(_0x57b5d9){if(_0x57b5d9){return _0x57b5d9[_0x8dfe('0x29')](_0x19c20a)['then'](function(_0x54a31e){return _0x54a31e;});}return null;};}function removeEntity(_0x50b245,_0x2cb868){return function(_0x3c1694){if(_0x3c1694){return _0x3c1694[_0x8dfe('0x2a')]()[_0x8dfe('0x2b')](function(){var _0x576cef=_0x3c1694[_0x8dfe('0x2c')]({'plain':!![]});var _0x5098b8='ExtractedReports';return db[_0x8dfe('0x2d')]['destroy']({'where':{'type':_0x5098b8,'resourceId':_0x576cef['id']}})['then'](function(){return _0x3c1694;});})['then'](function(){_0x50b245['status'](0xcc)[_0x8dfe('0x1e')]();});}};}function handleEntityNotFound(_0x9a507d,_0x1e4d05){return function(_0x4f1859){if(!_0x4f1859){_0x9a507d[_0x8dfe('0x1d')](0x194);}return _0x4f1859;};}function handleError(_0x21ea6c,_0x50da9f){_0x50da9f=_0x50da9f||0x1f4;return function(_0x51d892){logger[_0x8dfe('0x2e')](_0x51d892['stack']);if(_0x51d892['name']){delete _0x51d892[_0x8dfe('0x2f')];}_0x21ea6c[_0x8dfe('0x1f')](_0x50da9f)[_0x8dfe('0x30')](_0x51d892);};}exports[_0x8dfe('0x31')]=function(_0x57e48a,_0x567ffa){var _0x37e59b={},_0x390068={},_0xdb23ab={'count':0x0,'rows':[]};var _0x448717=_[_0x8dfe('0x32')](db[_0x8dfe('0x33')][_0x8dfe('0x34')],function(_0x46d250){return{'name':_0x46d250[_0x8dfe('0x35')],'type':_0x46d250[_0x8dfe('0x36')][_0x8dfe('0x37')]};});_0x390068[_0x8dfe('0x38')]=_[_0x8dfe('0x32')](_0x448717,'name');_0x390068[_0x8dfe('0x39')]=_['keys'](_0x57e48a[_0x8dfe('0x39')]);_0x390068[_0x8dfe('0x3a')]=_['intersection'](_0x390068[_0x8dfe('0x38')],_0x390068[_0x8dfe('0x39')]);_0x37e59b[_0x8dfe('0x3b')]=_[_0x8dfe('0x3c')](_0x390068[_0x8dfe('0x38')],qs[_0x8dfe('0x3d')](_0x57e48a[_0x8dfe('0x39')]['fields']));_0x37e59b['attributes']=_0x37e59b[_0x8dfe('0x3b')][_0x8dfe('0x3e')]?_0x37e59b[_0x8dfe('0x3b')]:_0x390068[_0x8dfe('0x38')];if(!_0x57e48a['query'][_0x8dfe('0x3f')](_0x8dfe('0x40'))){_0x37e59b['limit']=qs[_0x8dfe('0x22')](_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x22')]);_0x37e59b[_0x8dfe('0x23')]=qs[_0x8dfe('0x23')](_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x23')]);}_0x37e59b['order']=qs['sort'](_0x57e48a[_0x8dfe('0x39')]['sort']);_0x37e59b['where']=qs[_0x8dfe('0x3a')](_[_0x8dfe('0x41')](_0x57e48a[_0x8dfe('0x39')],_0x390068[_0x8dfe('0x3a')]),_0x448717);if(_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x42')]){_0x37e59b[_0x8dfe('0x43')]=_[_0x8dfe('0x44')](_0x37e59b[_0x8dfe('0x43')],{'$or':_['map'](_0x448717,function(_0x134959){if(_0x134959['type']!==_0x8dfe('0x45')){var _0x3e956b={};_0x3e956b[_0x134959[_0x8dfe('0x2f')]]={'$like':'%'+_0x57e48a['query']['filter']+'%'};return _0x3e956b;}})});}_0x37e59b=_[_0x8dfe('0x44')]({},_0x37e59b,_0x57e48a[_0x8dfe('0x46')]);var _0x153510={'where':_0x37e59b['where']};return db['AnalyticExtractedReport'][_0x8dfe('0x24')](_0x153510)[_0x8dfe('0x2b')](function(_0x1aacaf){_0xdb23ab[_0x8dfe('0x24')]=_0x1aacaf;if(_0x57e48a['query'][_0x8dfe('0x47')]){_0x37e59b[_0x8dfe('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x37e59b);})[_0x8dfe('0x2b')](function(_0xac7a89){_0xdb23ab[_0x8dfe('0x49')]=_0xac7a89;return _0xdb23ab;})[_0x8dfe('0x2b')](respondWithFilteredResult(_0x567ffa,_0x37e59b))['catch'](handleError(_0x567ffa,null));};exports['show']=function(_0x1233e9,_0x148a3b){var _0xde276={'raw':!![],'where':{'id':_0x1233e9['params']['id']}},_0x48323c={};_0x48323c['model']=_[_0x8dfe('0x4a')](db[_0x8dfe('0x33')]['rawAttributes']);_0x48323c[_0x8dfe('0x39')]=_[_0x8dfe('0x4a')](_0x1233e9[_0x8dfe('0x39')]);_0x48323c[_0x8dfe('0x3a')]=_[_0x8dfe('0x3c')](_0x48323c[_0x8dfe('0x38')],_0x48323c['query']);_0xde276['attributes']=_[_0x8dfe('0x3c')](_0x48323c['model'],qs[_0x8dfe('0x3d')](_0x1233e9[_0x8dfe('0x39')][_0x8dfe('0x3d')]));_0xde276[_0x8dfe('0x3b')]=_0xde276[_0x8dfe('0x3b')][_0x8dfe('0x3e')]?_0xde276[_0x8dfe('0x3b')]:_0x48323c['model'];if(_0x1233e9[_0x8dfe('0x39')][_0x8dfe('0x47')]){_0xde276[_0x8dfe('0x48')]=[{'all':!![]}];}_0xde276=_['merge']({},_0xde276,_0x1233e9[_0x8dfe('0x46')]);return db[_0x8dfe('0x33')][_0x8dfe('0x4b')](_0xde276)[_0x8dfe('0x2b')](handleEntityNotFound(_0x148a3b,null))[_0x8dfe('0x2b')](respondWithResult(_0x148a3b,null))[_0x8dfe('0x4c')](handleError(_0x148a3b,null));};exports[_0x8dfe('0x4d')]=function(_0x22ab6f,_0x2b5390){return db[_0x8dfe('0x33')][_0x8dfe('0x4d')](_0x22ab6f[_0x8dfe('0x4e')],{})[_0x8dfe('0x2b')](function(_0x2d5990){var _0x3210cd=_0x22ab6f[_0x8dfe('0x4f')]['get']({'plain':!![]});if(!_0x3210cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3210cd[_0x8dfe('0x50')]==='user'){var _0x3c41fb=_0x2d5990['get']({'plain':!![]});var _0x17070d=_0x8dfe('0x51');return db[_0x8dfe('0x52')][_0x8dfe('0x4b')]({'where':{'name':_0x17070d,'userProfileId':_0x3210cd['userProfileId']},'raw':!![]})[_0x8dfe('0x2b')](function(_0x373d98){if(_0x373d98&&_0x373d98[_0x8dfe('0x53')]===0x0){return db[_0x8dfe('0x2d')][_0x8dfe('0x4d')]({'name':_0x3c41fb[_0x8dfe('0x2f')],'resourceId':_0x3c41fb['id'],'type':_0x373d98[_0x8dfe('0x2f')],'sectionId':_0x373d98['id']},{})[_0x8dfe('0x2b')](function(){return _0x2d5990;});}else{return _0x2d5990;}})['catch'](function(_0x4e2b05){logger['error'](_0x8dfe('0x54'),_0x4e2b05);throw _0x4e2b05;});}return _0x2d5990;})[_0x8dfe('0x2b')](respondWithResult(_0x2b5390,0xc9))[_0x8dfe('0x4c')](handleError(_0x2b5390,null));};exports[_0x8dfe('0x29')]=function(_0x5023f3,_0x85233d){if(_0x5023f3[_0x8dfe('0x4e')]['id']){delete _0x5023f3['body']['id'];}return db[_0x8dfe('0x33')][_0x8dfe('0x4b')]({'where':{'id':_0x5023f3[_0x8dfe('0x55')]['id']}})[_0x8dfe('0x2b')](handleEntityNotFound(_0x85233d,null))[_0x8dfe('0x2b')](saveUpdates(_0x5023f3[_0x8dfe('0x4e')],null))[_0x8dfe('0x2b')](respondWithResult(_0x85233d,null))['catch'](handleError(_0x85233d,null));};exports[_0x8dfe('0x2a')]=function(_0x1b9907,_0x59fba9){return db['AnalyticExtractedReport'][_0x8dfe('0x4b')]({'where':{'id':_0x1b9907[_0x8dfe('0x55')]['id']}})[_0x8dfe('0x2b')](handleEntityNotFound(_0x59fba9,null))['then'](removeEntity(_0x59fba9,null))[_0x8dfe('0x4c')](handleError(_0x59fba9,null));};exports[_0x8dfe('0x56')]=function(_0x970dda,_0x213cd0,_0x34362f){return db['AnalyticExtractedReport'][_0x8dfe('0x4b')]({'where':{'id':_0x970dda['params']['id']},'attributes':[_0x8dfe('0x2f'),'basename',_0x8dfe('0x57'),_0x8dfe('0x58')],'raw':!![]})[_0x8dfe('0x2b')](handleEntityNotFound(_0x213cd0,null))[_0x8dfe('0x2b')](function(_0x26a8d9){if(_0x26a8d9){if(!fs[_0x8dfe('0x59')](path[_0x8dfe('0x5a')](config[_0x8dfe('0x5b')],_0x8dfe('0x5c'),_0x26a8d9[_0x8dfe('0x57')]))){throw new db['Sequelize'][(_0x8dfe('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x970dda[_0x8dfe('0x39')][_0x8dfe('0x5e')]){return _0x213cd0[_0x8dfe('0x1d')](0xc8);}return _0x213cd0[_0x8dfe('0x56')](path[_0x8dfe('0x5a')](config[_0x8dfe('0x5b')],_0x8dfe('0x5c'),_0x26a8d9['savename']),util[_0x8dfe('0x5f')]('%s.%s',_0x26a8d9[_0x8dfe('0x60')]||_0x26a8d9['name'],_0x26a8d9[_0x8dfe('0x58')][_0x8dfe('0x61')]()));}})[_0x8dfe('0x4c')](handleError(_0x213cd0,null));};
\ No newline at end of file
+var _0x6d0d=['include','findAll','rows','catch','show','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','error','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x6d0d,0x141));var _0xd6d0=function(_0x41e9a4,_0x307b90){_0x41e9a4=_0x41e9a4-0x0;var _0x454f90=_0x6d0d[_0x41e9a4];return _0x454f90;};'use strict';var emlformat=require(_0xd6d0('0x0'));var rimraf=require(_0xd6d0('0x1'));var zipdir=require(_0xd6d0('0x2'));var jsonpatch=require(_0xd6d0('0x3'));var rp=require(_0xd6d0('0x4'));var moment=require(_0xd6d0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd6d0('0x6'));var util=require(_0xd6d0('0x7'));var path=require(_0xd6d0('0x8'));var sox=require(_0xd6d0('0x9'));var csv=require('to-csv');var ejs=require(_0xd6d0('0xa'));var fs=require('fs');var fs_extra=require(_0xd6d0('0xb'));var _=require(_0xd6d0('0xc'));var squel=require(_0xd6d0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd6d0('0xe'));var toCsv=require(_0xd6d0('0xf'));var querystring=require(_0xd6d0('0x10'));var Papa=require(_0xd6d0('0x11'));var Redis=require('ioredis');var authService=require(_0xd6d0('0x12'));var qs=require(_0xd6d0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6d0('0x14'));var logger=require(_0xd6d0('0x15'))('api');var utils=require(_0xd6d0('0x16'));var config=require(_0xd6d0('0x17'));var licenseUtil=require(_0xd6d0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32a830,_0x495515){_0x495515=_0x495515||0xcc;return function(_0xe85184){if(_0xe85184){return _0x32a830[_0xd6d0('0x19')](_0x495515);}return _0x32a830[_0xd6d0('0x1a')](_0x495515)[_0xd6d0('0x1b')]();};}function respondWithResult(_0x87a3b,_0x4d21c3){_0x4d21c3=_0x4d21c3||0xc8;return function(_0x284751){if(_0x284751){return _0x87a3b[_0xd6d0('0x1a')](_0x4d21c3)['json'](_0x284751);}};}function respondWithFilteredResult(_0x492982,_0x5edd26){return function(_0x297d18){if(_0x297d18){var _0x5654f0=typeof _0x5edd26[_0xd6d0('0x1c')]===_0xd6d0('0x1d')&&typeof _0x5edd26[_0xd6d0('0x1e')]===_0xd6d0('0x1d');var _0x4d74e3=_0x297d18[_0xd6d0('0x1f')];var _0xce8de2=_0x5654f0?0x0:_0x5edd26['offset'];var _0x3ff6be=_0x5654f0?_0x297d18[_0xd6d0('0x1f')]:_0x5edd26[_0xd6d0('0x1c')]+_0x5edd26[_0xd6d0('0x1e')];var _0x91f73c;if(_0x3ff6be>=_0x4d74e3){_0x3ff6be=_0x4d74e3;_0x91f73c=0xc8;}else{_0x91f73c=0xce;}_0x492982[_0xd6d0('0x1a')](_0x91f73c);return _0x492982[_0xd6d0('0x20')](_0xd6d0('0x21'),_0xce8de2+'-'+_0x3ff6be+'/'+_0x4d74e3)[_0xd6d0('0x22')](_0x297d18);}return null;};}function patchUpdates(_0x2bb517){return function(_0x479ab7){try{jsonpatch[_0xd6d0('0x23')](_0x479ab7,_0x2bb517,!![]);}catch(_0x587c9c){return BPromise[_0xd6d0('0x24')](_0x587c9c);}return _0x479ab7[_0xd6d0('0x25')]();};}function saveUpdates(_0x39265f,_0x3f7d05){return function(_0x1baa7c){if(_0x1baa7c){return _0x1baa7c[_0xd6d0('0x26')](_0x39265f)['then'](function(_0x3da08b){return _0x3da08b;});}return null;};}function removeEntity(_0x1cf98c,_0x38233f){return function(_0x42e4b6){if(_0x42e4b6){return _0x42e4b6[_0xd6d0('0x27')]()[_0xd6d0('0x28')](function(){var _0x29d500=_0x42e4b6[_0xd6d0('0x29')]({'plain':!![]});var _0x803e49=_0xd6d0('0x2a');return db[_0xd6d0('0x2b')][_0xd6d0('0x27')]({'where':{'type':_0x803e49,'resourceId':_0x29d500['id']}})[_0xd6d0('0x28')](function(){return _0x42e4b6;});})[_0xd6d0('0x28')](function(){_0x1cf98c[_0xd6d0('0x1a')](0xcc)[_0xd6d0('0x1b')]();});}};}function handleEntityNotFound(_0xff6bed,_0x2ce20f){return function(_0x5ea7ac){if(!_0x5ea7ac){_0xff6bed['sendStatus'](0x194);}return _0x5ea7ac;};}function handleError(_0x5c70e8,_0x360fef){_0x360fef=_0x360fef||0x1f4;return function(_0x151ed9){logger[_0xd6d0('0x2c')](_0x151ed9['stack']);if(_0x151ed9['name']){delete _0x151ed9[_0xd6d0('0x2d')];}_0x5c70e8[_0xd6d0('0x1a')](_0x360fef)[_0xd6d0('0x2e')](_0x151ed9);};}exports['index']=function(_0x575114,_0x552cb8){var _0x160a9a={},_0x20b33c={},_0x2a0d14={'count':0x0,'rows':[]};var _0x426792=_[_0xd6d0('0x2f')](db[_0xd6d0('0x30')][_0xd6d0('0x31')],function(_0x5e98b5){return{'name':_0x5e98b5[_0xd6d0('0x32')],'type':_0x5e98b5[_0xd6d0('0x33')][_0xd6d0('0x34')]};});_0x20b33c['model']=_['map'](_0x426792,_0xd6d0('0x2d'));_0x20b33c['query']=_[_0xd6d0('0x35')](_0x575114[_0xd6d0('0x36')]);_0x20b33c[_0xd6d0('0x37')]=_[_0xd6d0('0x38')](_0x20b33c['model'],_0x20b33c['query']);_0x160a9a[_0xd6d0('0x39')]=_[_0xd6d0('0x38')](_0x20b33c[_0xd6d0('0x3a')],qs[_0xd6d0('0x3b')](_0x575114[_0xd6d0('0x36')]['fields']));_0x160a9a[_0xd6d0('0x39')]=_0x160a9a['attributes']['length']?_0x160a9a['attributes']:_0x20b33c[_0xd6d0('0x3a')];if(!_0x575114[_0xd6d0('0x36')][_0xd6d0('0x3c')]('nolimit')){_0x160a9a[_0xd6d0('0x1e')]=qs[_0xd6d0('0x1e')](_0x575114[_0xd6d0('0x36')][_0xd6d0('0x1e')]);_0x160a9a[_0xd6d0('0x1c')]=qs['offset'](_0x575114[_0xd6d0('0x36')][_0xd6d0('0x1c')]);}_0x160a9a[_0xd6d0('0x3d')]=qs[_0xd6d0('0x3e')](_0x575114[_0xd6d0('0x36')][_0xd6d0('0x3e')]);_0x160a9a[_0xd6d0('0x3f')]=qs[_0xd6d0('0x37')](_['pick'](_0x575114[_0xd6d0('0x36')],_0x20b33c[_0xd6d0('0x37')]),_0x426792);if(_0x575114[_0xd6d0('0x36')][_0xd6d0('0x40')]){_0x160a9a['where']=_['merge'](_0x160a9a[_0xd6d0('0x3f')],{'$or':_['map'](_0x426792,function(_0x14b95c){if(_0x14b95c[_0xd6d0('0x33')]!==_0xd6d0('0x41')){var _0x5c02ef={};_0x5c02ef[_0x14b95c[_0xd6d0('0x2d')]]={'$like':'%'+_0x575114['query'][_0xd6d0('0x40')]+'%'};return _0x5c02ef;}})});}_0x160a9a=_[_0xd6d0('0x42')]({},_0x160a9a,_0x575114['options']);var _0x212518={'where':_0x160a9a[_0xd6d0('0x3f')]};return db[_0xd6d0('0x30')][_0xd6d0('0x1f')](_0x212518)['then'](function(_0x1f7b4f){_0x2a0d14[_0xd6d0('0x1f')]=_0x1f7b4f;if(_0x575114['query']['includeAll']){_0x160a9a[_0xd6d0('0x43')]=[{'all':!![]}];}return db[_0xd6d0('0x30')][_0xd6d0('0x44')](_0x160a9a);})[_0xd6d0('0x28')](function(_0x2acd7c){_0x2a0d14[_0xd6d0('0x45')]=_0x2acd7c;return _0x2a0d14;})[_0xd6d0('0x28')](respondWithFilteredResult(_0x552cb8,_0x160a9a))[_0xd6d0('0x46')](handleError(_0x552cb8,null));};exports[_0xd6d0('0x47')]=function(_0x304682,_0x47453e){var _0x109c38={'raw':!![],'where':{'id':_0x304682['params']['id']}},_0x2b0aeb={};_0x2b0aeb[_0xd6d0('0x3a')]=_['keys'](db[_0xd6d0('0x30')][_0xd6d0('0x31')]);_0x2b0aeb['query']=_[_0xd6d0('0x35')](_0x304682[_0xd6d0('0x36')]);_0x2b0aeb[_0xd6d0('0x37')]=_[_0xd6d0('0x38')](_0x2b0aeb[_0xd6d0('0x3a')],_0x2b0aeb[_0xd6d0('0x36')]);_0x109c38['attributes']=_['intersection'](_0x2b0aeb[_0xd6d0('0x3a')],qs[_0xd6d0('0x3b')](_0x304682[_0xd6d0('0x36')][_0xd6d0('0x3b')]));_0x109c38[_0xd6d0('0x39')]=_0x109c38[_0xd6d0('0x39')][_0xd6d0('0x48')]?_0x109c38[_0xd6d0('0x39')]:_0x2b0aeb[_0xd6d0('0x3a')];if(_0x304682[_0xd6d0('0x36')]['includeAll']){_0x109c38[_0xd6d0('0x43')]=[{'all':!![]}];}_0x109c38=_['merge']({},_0x109c38,_0x304682[_0xd6d0('0x49')]);return db['AnalyticExtractedReport']['find'](_0x109c38)['then'](handleEntityNotFound(_0x47453e,null))[_0xd6d0('0x28')](respondWithResult(_0x47453e,null))[_0xd6d0('0x46')](handleError(_0x47453e,null));};exports['create']=function(_0x599dde,_0x46c077){return db[_0xd6d0('0x30')][_0xd6d0('0x4a')](_0x599dde[_0xd6d0('0x4b')],{})['then'](function(_0x3c9844){var _0xb6a379=_0x599dde[_0xd6d0('0x4c')][_0xd6d0('0x29')]({'plain':!![]});if(!_0xb6a379)throw new Error(_0xd6d0('0x4d'));if(_0xb6a379[_0xd6d0('0x4e')]===_0xd6d0('0x4c')){var _0x4cce17=_0x3c9844[_0xd6d0('0x29')]({'plain':!![]});var _0x3102d0=_0xd6d0('0x2a');return db[_0xd6d0('0x4f')][_0xd6d0('0x50')]({'where':{'name':_0x3102d0,'userProfileId':_0xb6a379['userProfileId']},'raw':!![]})[_0xd6d0('0x28')](function(_0x108a96){if(_0x108a96&&_0x108a96[_0xd6d0('0x51')]===0x0){return db['UserProfileResource'][_0xd6d0('0x4a')]({'name':_0x4cce17[_0xd6d0('0x2d')],'resourceId':_0x4cce17['id'],'type':_0x108a96[_0xd6d0('0x2d')],'sectionId':_0x108a96['id']},{})[_0xd6d0('0x28')](function(){return _0x3c9844;});}else{return _0x3c9844;}})[_0xd6d0('0x46')](function(_0x409f28){logger[_0xd6d0('0x2c')](_0xd6d0('0x52'),_0x409f28);throw _0x409f28;});}return _0x3c9844;})[_0xd6d0('0x28')](respondWithResult(_0x46c077,0xc9))['catch'](handleError(_0x46c077,null));};exports[_0xd6d0('0x26')]=function(_0x5a905f,_0x339d97){if(_0x5a905f['body']['id']){delete _0x5a905f[_0xd6d0('0x4b')]['id'];}return db[_0xd6d0('0x30')][_0xd6d0('0x50')]({'where':{'id':_0x5a905f[_0xd6d0('0x53')]['id']}})[_0xd6d0('0x28')](handleEntityNotFound(_0x339d97,null))[_0xd6d0('0x28')](saveUpdates(_0x5a905f[_0xd6d0('0x4b')],null))[_0xd6d0('0x28')](respondWithResult(_0x339d97,null))['catch'](handleError(_0x339d97,null));};exports['destroy']=function(_0x34f8d4,_0x5a89cd){return db[_0xd6d0('0x30')]['find']({'where':{'id':_0x34f8d4[_0xd6d0('0x53')]['id']}})[_0xd6d0('0x28')](handleEntityNotFound(_0x5a89cd,null))['then'](removeEntity(_0x5a89cd,null))[_0xd6d0('0x46')](handleError(_0x5a89cd,null));};exports[_0xd6d0('0x54')]=function(_0x43e8ca,_0x5ddce3,_0x4f563e){return db['AnalyticExtractedReport'][_0xd6d0('0x50')]({'where':{'id':_0x43e8ca[_0xd6d0('0x53')]['id']},'attributes':[_0xd6d0('0x2d'),_0xd6d0('0x55'),_0xd6d0('0x56'),_0xd6d0('0x57')],'raw':!![]})[_0xd6d0('0x28')](handleEntityNotFound(_0x5ddce3,null))[_0xd6d0('0x28')](function(_0x169a63){if(_0x169a63){if(!fs[_0xd6d0('0x58')](path[_0xd6d0('0x59')](config[_0xd6d0('0x5a')],_0xd6d0('0x5b'),_0x169a63['savename']))){throw new db[(_0xd6d0('0x5c'))][(_0xd6d0('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x43e8ca[_0xd6d0('0x36')][_0xd6d0('0x5e')]){return _0x5ddce3[_0xd6d0('0x19')](0xc8);}return _0x5ddce3[_0xd6d0('0x54')](path['join'](config[_0xd6d0('0x5a')],_0xd6d0('0x5b'),_0x169a63['savename']),util[_0xd6d0('0x5f')](_0xd6d0('0x60'),_0x169a63[_0xd6d0('0x55')]||_0x169a63[_0xd6d0('0x2d')],_0x169a63[_0xd6d0('0x57')]['toLowerCase']()));}})[_0xd6d0('0x46')](handleError(_0x5ddce3,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 5d1511a..8367444 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 _0xacec=['request-promise','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment'];(function(_0x3a3a46,_0x111874){var _0xe4acdb=function(_0x44b041){while(--_0x44b041){_0x3a3a46['push'](_0x3a3a46['shift']());}};_0xe4acdb(++_0x111874);}(_0xacec,0x88));var _0xcace=function(_0x3bd4e5,_0x33854f){_0x3bd4e5=_0x3bd4e5-0x0;var _0x2d1522=_0xacec[_0x3bd4e5];return _0x2d1522;};'use strict';var _=require(_0xcace('0x0'));var util=require('util');var logger=require(_0xcace('0x1'))(_0xcace('0x2'));var moment=require(_0xcace('0x3'));var BPromise=require('bluebird');var rp=require(_0xcace('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcace('0x5'));var config=require('../../config/environment');var attributes=require(_0xcace('0x6'));module['exports']=function(_0x491f14,_0x24dd13){return _0x491f14[_0xcace('0x7')](_0xcace('0x8'),attributes,{'tableName':_0xcace('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x075f=['../../config/environment','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x8d3262,_0x439e73){var _0x45561c=function(_0x36581f){while(--_0x36581f){_0x8d3262['push'](_0x8d3262['shift']());}};_0x45561c(++_0x439e73);}(_0x075f,0x13c));var _0xf075=function(_0xc41295,_0x5ef31e){_0xc41295=_0xc41295-0x0;var _0xdc7b03=_0x075f[_0xc41295];return _0xdc7b03;};'use strict';var _=require(_0xf075('0x0'));var util=require(_0xf075('0x1'));var logger=require(_0xf075('0x2'))('api');var moment=require(_0xf075('0x3'));var BPromise=require(_0xf075('0x4'));var rp=require(_0xf075('0x5'));var fs=require('fs');var path=require(_0xf075('0x6'));var rimraf=require(_0xf075('0x7'));var config=require(_0xf075('0x8'));var attributes=require(_0xf075('0x9'));module[_0xf075('0xa')]=function(_0x3d52dd,_0x4d08db){return _0x3d52dd['define']('AnalyticExtractedReport',attributes,{'tableName':_0xf075('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 09f29b3..5950fde 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 _0x6633=['stringify','error','code','message','info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x6633,0xfd));var _0x3663=function(_0x1990f0,_0x427550){_0x1990f0=_0x1990f0-0x0;var _0x4b3cf7=_0x6633[_0x1990f0];return _0x4b3cf7;};'use strict';var _=require(_0x3663('0x0'));var util=require(_0x3663('0x1'));var moment=require(_0x3663('0x2'));var BPromise=require(_0x3663('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3663('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3663('0x5'))(_0x3663('0x6'));var config=require(_0x3663('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3663('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51604b,_0x47f3ad,_0x47f2a6){return new BPromise(function(_0x5c97fb,_0x418ba7){return client['request'](_0x51604b,_0x47f2a6)[_0x3663('0x9')](function(_0x1352e7){logger['info'](_0x3663('0xa'),_0x47f3ad,_0x3663('0xb'));logger['debug'](_0x3663('0xc'),_0x47f3ad,_0x3663('0xb'),JSON[_0x3663('0xd')](_0x1352e7));if(_0x1352e7['error']){if(_0x1352e7[_0x3663('0xe')][_0x3663('0xf')]===0x1f4){logger['error'](_0x3663('0xa'),_0x47f3ad,_0x1352e7[_0x3663('0xe')]['message']);return _0x418ba7(_0x1352e7['error'][_0x3663('0x10')]);}logger[_0x3663('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x1352e7[_0x3663('0xe')][_0x3663('0x10')]);return _0x5c97fb(_0x1352e7[_0x3663('0xe')][_0x3663('0x10')]);}else{logger[_0x3663('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x3663('0xb'));_0x5c97fb(_0x1352e7[_0x3663('0x12')][_0x3663('0x10')]);}})['catch'](function(_0x4e8086){logger[_0x3663('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x4e8086);_0x418ba7(_0x4e8086);});});}
\ No newline at end of file
+var _0x5c32=['http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1a20ce,_0x229c68){var _0x44dda3=function(_0x26ec52){while(--_0x26ec52){_0x1a20ce['push'](_0x1a20ce['shift']());}};_0x44dda3(++_0x229c68);}(_0x5c32,0xd3));var _0x25c3=function(_0x412c06,_0x100bae){_0x412c06=_0x412c06-0x0;var _0x69caa0=_0x5c32[_0x412c06];return _0x69caa0;};'use strict';var _=require(_0x25c3('0x0'));var util=require(_0x25c3('0x1'));var moment=require(_0x25c3('0x2'));var BPromise=require(_0x25c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25c3('0x4'))['db'];var utils=require(_0x25c3('0x5'));var logger=require(_0x25c3('0x6'))(_0x25c3('0x7'));var config=require('../../config/environment');var jayson=require(_0x25c3('0x8'));var client=jayson['client'][_0x25c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10bfad,_0x24f8d3,_0x5c47f){return new BPromise(function(_0x2ad066,_0x4b581a){return client['request'](_0x10bfad,_0x5c47f)['then'](function(_0x7dfd50){logger[_0x25c3('0xa')](_0x25c3('0xb'),_0x24f8d3,_0x25c3('0xc'));logger[_0x25c3('0xd')](_0x25c3('0xe'),_0x24f8d3,_0x25c3('0xc'),JSON[_0x25c3('0xf')](_0x7dfd50));if(_0x7dfd50['error']){if(_0x7dfd50[_0x25c3('0x10')][_0x25c3('0x11')]===0x1f4){logger[_0x25c3('0x10')](_0x25c3('0xb'),_0x24f8d3,_0x7dfd50[_0x25c3('0x10')]['message']);return _0x4b581a(_0x7dfd50['error'][_0x25c3('0x12')]);}logger[_0x25c3('0x10')](_0x25c3('0xb'),_0x24f8d3,_0x7dfd50[_0x25c3('0x10')][_0x25c3('0x12')]);return _0x2ad066(_0x7dfd50['error'][_0x25c3('0x12')]);}else{logger[_0x25c3('0xa')](_0x25c3('0xb'),_0x24f8d3,_0x25c3('0xc'));_0x2ad066(_0x7dfd50['result'][_0x25c3('0x12')]);}})[_0x25c3('0x13')](function(_0x27ab65){logger[_0x25c3('0x10')](_0x25c3('0xb'),_0x24f8d3,_0x27ab65);_0x4b581a(_0x27ab65);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 930ec1d..e550178 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 _0xf43c=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','post','create'];(function(_0x2e5fe4,_0x2889b8){var _0x1be065=function(_0x1e9cf5){while(--_0x1e9cf5){_0x2e5fe4['push'](_0x2e5fe4['shift']());}};_0x1be065(++_0x2889b8);}(_0xf43c,0xa4));var _0xcf43=function(_0x440178,_0x519854){_0x440178=_0x440178-0x0;var _0x22aa42=_0xf43c[_0x440178];return _0x22aa42;};'use strict';var multer=require(_0xcf43('0x0'));var util=require(_0xcf43('0x1'));var path=require(_0xcf43('0x2'));var timeout=require(_0xcf43('0x3'));var express=require('express');var router=express[_0xcf43('0x4')]();var fs_extra=require(_0xcf43('0x5'));var auth=require(_0xcf43('0x6'));var interaction=require(_0xcf43('0x7'));var config=require(_0xcf43('0x8'));var controller=require(_0xcf43('0x9'));router[_0xcf43('0xa')]('/',auth[_0xcf43('0xb')](),controller[_0xcf43('0xc')]);router[_0xcf43('0xa')]('/:id',auth[_0xcf43('0xb')](),controller[_0xcf43('0xd')]);router['get']('/:id/download',auth[_0xcf43('0xb')](),controller['download']);router[_0xcf43('0xe')]('/',auth[_0xcf43('0xb')](),controller[_0xcf43('0xf')]);router['put'](_0xcf43('0x10'),auth[_0xcf43('0xb')](),controller['update']);router[_0xcf43('0x11')](_0xcf43('0x10'),auth[_0xcf43('0xb')](),controller[_0xcf43('0x12')]);module[_0xcf43('0x13')]=router;
\ No newline at end of file
+var _0x5c09=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f3f1f,_0x28b7ea){var _0x16872b=function(_0xb81b23){while(--_0xb81b23){_0x3f3f1f['push'](_0x3f3f1f['shift']());}};_0x16872b(++_0x28b7ea);}(_0x5c09,0x1a4));var _0x95c0=function(_0x52848c,_0x4fc7c9){_0x52848c=_0x52848c-0x0;var _0x336fa0=_0x5c09[_0x52848c];return _0x336fa0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x95c0('0x0'));var express=require('express');var router=express[_0x95c0('0x1')]();var fs_extra=require(_0x95c0('0x2'));var auth=require(_0x95c0('0x3'));var interaction=require(_0x95c0('0x4'));var config=require(_0x95c0('0x5'));var controller=require(_0x95c0('0x6'));router[_0x95c0('0x7')]('/',auth[_0x95c0('0x8')](),controller[_0x95c0('0x9')]);router[_0x95c0('0x7')](_0x95c0('0xa'),auth[_0x95c0('0x8')](),controller['show']);router[_0x95c0('0x7')](_0x95c0('0xb'),auth[_0x95c0('0x8')](),controller[_0x95c0('0xc')]);router['post']('/',auth[_0x95c0('0x8')](),controller[_0x95c0('0xd')]);router[_0x95c0('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x95c0('0xf')](_0x95c0('0xa'),auth[_0x95c0('0x8')](),controller['destroy']);module[_0x95c0('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 19a520d..2501661 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 _0x0467=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1c83c0,_0x196063){var _0x24a775=function(_0x5e0b6b){while(--_0x5e0b6b){_0x1c83c0['push'](_0x1c83c0['shift']());}};_0x24a775(++_0x196063);}(_0x0467,0x153));var _0x7046=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0467[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7046('0x0'));module[_0x7046('0x1')]={'field':{'type':Sequelize[_0x7046('0x2')]},'alias':{'type':Sequelize[_0x7046('0x3')]},'function':{'type':Sequelize[_0x7046('0x3')]},'format':{'type':Sequelize[_0x7046('0x3')]},'groupBy':{'type':Sequelize[_0x7046('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7046('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbed8=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1829fd,_0x33b470){var _0x177d22=function(_0x595874){while(--_0x595874){_0x1829fd['push'](_0x1829fd['shift']());}};_0x177d22(++_0x33b470);}(_0xbed8,0x18a));var _0x8bed=function(_0x59aecc,_0x255014){_0x59aecc=_0x59aecc-0x0;var _0x46b112=_0xbed8[_0x59aecc];return _0x46b112;};'use strict';var Sequelize=require(_0x8bed('0x0'));module[_0x8bed('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x8bed('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x8bed('0x2')]},'groupBy':{'type':Sequelize[_0x8bed('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x8bed('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 93264f7..d4f846e 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 _0xe30f=['length','order','sort','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','catch','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','update','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe30f,0x15c));var _0xfe30=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe30f[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xfe30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe30('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe30('0x2'));var BPromise=require(_0xfe30('0x3'));var Mustache=require('mustache');var util=require(_0xfe30('0x4'));var path=require(_0xfe30('0x5'));var sox=require(_0xfe30('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe30('0x7'));var _=require(_0xfe30('0x8'));var squel=require(_0xfe30('0x9'));var crypto=require(_0xfe30('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfe30('0xb'));var toCsv=require(_0xfe30('0xc'));var querystring=require(_0xfe30('0xd'));var Papa=require('papaparse');var Redis=require(_0xfe30('0xe'));var authService=require(_0xfe30('0xf'));var qs=require(_0xfe30('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe30('0x11'));var logger=require(_0xfe30('0x12'))('api');var utils=require(_0xfe30('0x13'));var config=require(_0xfe30('0x14'));var licenseUtil=require(_0xfe30('0x15'));var db=require(_0xfe30('0x16'))['db'];function respondWithStatusCode(_0xd0f76f,_0x10710f){_0x10710f=_0x10710f||0xcc;return function(_0x2f17a1){if(_0x2f17a1){return _0xd0f76f[_0xfe30('0x17')](_0x10710f);}return _0xd0f76f['status'](_0x10710f)[_0xfe30('0x18')]();};}function respondWithResult(_0x3c52ed,_0x23638b){_0x23638b=_0x23638b||0xc8;return function(_0xfb5124){if(_0xfb5124){return _0x3c52ed['status'](_0x23638b)['json'](_0xfb5124);}};}function respondWithFilteredResult(_0x1e43ca,_0x47fbd6){return function(_0xdbc826){if(_0xdbc826){var _0x410fe3=typeof _0x47fbd6[_0xfe30('0x19')]===_0xfe30('0x1a')&&typeof _0x47fbd6[_0xfe30('0x1b')]===_0xfe30('0x1a');var _0x143144=_0xdbc826[_0xfe30('0x1c')];var _0x21b5ed=_0x410fe3?0x0:_0x47fbd6[_0xfe30('0x19')];var _0x47e21c=_0x410fe3?_0xdbc826['count']:_0x47fbd6['offset']+_0x47fbd6['limit'];var _0xe4dae4;if(_0x47e21c>=_0x143144){_0x47e21c=_0x143144;_0xe4dae4=0xc8;}else{_0xe4dae4=0xce;}_0x1e43ca[_0xfe30('0x1d')](_0xe4dae4);return _0x1e43ca['set'](_0xfe30('0x1e'),_0x21b5ed+'-'+_0x47e21c+'/'+_0x143144)[_0xfe30('0x1f')](_0xdbc826);}return null;};}function patchUpdates(_0x133a4d){return function(_0x2b85d9){try{jsonpatch[_0xfe30('0x20')](_0x2b85d9,_0x133a4d,!![]);}catch(_0x34ea1d){return BPromise[_0xfe30('0x21')](_0x34ea1d);}return _0x2b85d9['save']();};}function saveUpdates(_0x946589,_0x5d6be6){return function(_0x34800a){if(_0x34800a){return _0x34800a[_0xfe30('0x22')](_0x946589)['then'](function(_0x5fe62){return _0x5fe62;});}return null;};}function removeEntity(_0x5f1acd,_0x354006){return function(_0x152a39){if(_0x152a39){return _0x152a39[_0xfe30('0x23')]()[_0xfe30('0x24')](function(){_0x5f1acd[_0xfe30('0x1d')](0xcc)[_0xfe30('0x18')]();});}};}function handleEntityNotFound(_0x4763bd,_0x54e3ce){return function(_0x5a6d02){if(!_0x5a6d02){_0x4763bd[_0xfe30('0x17')](0x194);}return _0x5a6d02;};}function handleError(_0x26682a,_0x295040){_0x295040=_0x295040||0x1f4;return function(_0x57b8a6){logger['error'](_0x57b8a6[_0xfe30('0x25')]);if(_0x57b8a6[_0xfe30('0x26')]){delete _0x57b8a6[_0xfe30('0x26')];}_0x26682a[_0xfe30('0x1d')](_0x295040)['send'](_0x57b8a6);};}exports[_0xfe30('0x27')]=function(_0x5bf253,_0x5646c2){var _0x16747e={},_0x22878d={},_0x35326c={'count':0x0,'rows':[]};var _0x426c6e=_[_0xfe30('0x28')](db['AnalyticFieldReport'][_0xfe30('0x29')],function(_0x4a80c1){return{'name':_0x4a80c1[_0xfe30('0x2a')],'type':_0x4a80c1[_0xfe30('0x2b')][_0xfe30('0x2c')]};});_0x22878d['model']=_[_0xfe30('0x28')](_0x426c6e,_0xfe30('0x26'));_0x22878d['query']=_[_0xfe30('0x2d')](_0x5bf253['query']);_0x22878d[_0xfe30('0x2e')]=_[_0xfe30('0x2f')](_0x22878d[_0xfe30('0x30')],_0x22878d[_0xfe30('0x31')]);_0x16747e[_0xfe30('0x32')]=_['intersection'](_0x22878d['model'],qs['fields'](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x33')]));_0x16747e[_0xfe30('0x32')]=_0x16747e[_0xfe30('0x32')][_0xfe30('0x34')]?_0x16747e[_0xfe30('0x32')]:_0x22878d[_0xfe30('0x30')];if(!_0x5bf253[_0xfe30('0x31')]['hasOwnProperty']('nolimit')){_0x16747e[_0xfe30('0x1b')]=qs[_0xfe30('0x1b')](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x1b')]);_0x16747e[_0xfe30('0x19')]=qs[_0xfe30('0x19')](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x19')]);}_0x16747e[_0xfe30('0x35')]=qs[_0xfe30('0x36')](_0x5bf253[_0xfe30('0x31')]['sort']);_0x16747e['where']=qs[_0xfe30('0x2e')](_['pick'](_0x5bf253[_0xfe30('0x31')],_0x22878d['filters']),_0x426c6e);if(_0x5bf253[_0xfe30('0x31')][_0xfe30('0x37')]){_0x16747e[_0xfe30('0x38')]=_[_0xfe30('0x39')](_0x16747e['where'],{'$or':_[_0xfe30('0x28')](_0x426c6e,function(_0x99a5d9){if(_0x99a5d9[_0xfe30('0x2b')]!==_0xfe30('0x3a')){var _0x5e657b={};_0x5e657b[_0x99a5d9['name']]={'$like':'%'+_0x5bf253['query'][_0xfe30('0x37')]+'%'};return _0x5e657b;}})});}_0x16747e=_[_0xfe30('0x39')]({},_0x16747e,_0x5bf253[_0xfe30('0x3b')]);var _0x4b81ac={'where':_0x16747e[_0xfe30('0x38')]};return db[_0xfe30('0x3c')]['count'](_0x4b81ac)[_0xfe30('0x24')](function(_0x92c9b4){_0x35326c[_0xfe30('0x1c')]=_0x92c9b4;if(_0x5bf253[_0xfe30('0x31')][_0xfe30('0x3d')]){_0x16747e[_0xfe30('0x3e')]=[{'all':!![]}];}return db[_0xfe30('0x3c')][_0xfe30('0x3f')](_0x16747e);})[_0xfe30('0x24')](function(_0x500310){_0x35326c[_0xfe30('0x40')]=_0x500310;return _0x35326c;})[_0xfe30('0x24')](respondWithFilteredResult(_0x5646c2,_0x16747e))['catch'](handleError(_0x5646c2,null));};exports[_0xfe30('0x41')]=function(_0x19663a,_0x3cd371){var _0x19f813={'raw':![],'where':{'id':_0x19663a[_0xfe30('0x42')]['id']}},_0x33a11b={};_0x33a11b[_0xfe30('0x30')]=_[_0xfe30('0x2d')](db[_0xfe30('0x3c')][_0xfe30('0x29')]);_0x33a11b['query']=_[_0xfe30('0x2d')](_0x19663a['query']);_0x33a11b[_0xfe30('0x2e')]=_[_0xfe30('0x2f')](_0x33a11b['model'],_0x33a11b[_0xfe30('0x31')]);_0x19f813[_0xfe30('0x32')]=_[_0xfe30('0x2f')](_0x33a11b[_0xfe30('0x30')],qs['fields'](_0x19663a[_0xfe30('0x31')]['fields']));_0x19f813[_0xfe30('0x32')]=_0x19f813['attributes']['length']?_0x19f813[_0xfe30('0x32')]:_0x33a11b[_0xfe30('0x30')];if(_0x19663a['query'][_0xfe30('0x3d')]){_0x19f813['include']=[{'all':!![]}];}_0x19f813=_['merge']({},_0x19f813,_0x19663a[_0xfe30('0x3b')]);return db[_0xfe30('0x3c')]['find'](_0x19f813)['then'](handleEntityNotFound(_0x3cd371,null))[_0xfe30('0x24')](respondWithResult(_0x3cd371,null))[_0xfe30('0x43')](handleError(_0x3cd371,null));};exports[_0xfe30('0x44')]=function(_0x4e6dff,_0x2ce642){return db[_0xfe30('0x3c')][_0xfe30('0x44')](_0x4e6dff[_0xfe30('0x45')],{})[_0xfe30('0x24')](respondWithResult(_0x2ce642,0xc9))[_0xfe30('0x43')](handleError(_0x2ce642,null));};exports[_0xfe30('0x46')]=function(_0x187486,_0x2c9500){return db[_0xfe30('0x3c')][_0xfe30('0x46')](_0x187486[_0xfe30('0x45')],{'raw':![],'individualHooks':!![]})[_0xfe30('0x24')](respondWithResult(_0x2c9500,0xc9))[_0xfe30('0x43')](handleError(_0x2c9500,null));};exports[_0xfe30('0x22')]=function(_0x2f5f25,_0x43d682){if(_0x2f5f25[_0xfe30('0x45')]['id']){delete _0x2f5f25[_0xfe30('0x45')]['id'];}return db[_0xfe30('0x3c')][_0xfe30('0x47')]({'where':{'id':_0x2f5f25[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x43d682,null))[_0xfe30('0x24')](saveUpdates(_0x2f5f25['body'],null))['then'](respondWithResult(_0x43d682,null))[_0xfe30('0x43')](handleError(_0x43d682,null));};exports[_0xfe30('0x23')]=function(_0x3d535d,_0x1871c1){return db['AnalyticFieldReport'][_0xfe30('0x47')]({'where':{'id':_0x3d535d[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x1871c1,null))[_0xfe30('0x24')](removeEntity(_0x1871c1,null))[_0xfe30('0x43')](handleError(_0x1871c1,null));};exports[_0xfe30('0x48')]=function(_0x211514,_0x1f29ad){return db['AnalyticFieldReport'][_0xfe30('0x23')]({'where':{'id':_0x211514[_0xfe30('0x31')][_0xfe30('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xfe30('0x24')](respondWithResult(_0x1f29ad,0xcc))['catch'](handleError(_0x1f29ad,null));};exports[_0xfe30('0x4a')]=function(_0xc61b6f,_0x1b9631,_0x2f6299){return db[_0xfe30('0x4b')][_0xfe30('0x4c')]({'where':{'id':_0xc61b6f[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x1b9631,null))['then'](function(_0x2ef5ab){if(_0x2ef5ab){return db[_0xfe30('0x4d')][_0xfe30('0x4e')](function(_0x5527ba){return db[_0xfe30('0x3c')]['destroy']({'where':{'CustomReportId':_0xc61b6f['params']['id']},'transaction':_0x5527ba})['then'](function(_0x40180e){var _0x54cd13=_['map'](_0xc61b6f['body'],function(_0x15f216){delete _0x15f216['id'];_0x15f216[_0xfe30('0x4f')]=_0xc61b6f[_0xfe30('0x42')]['id'];return _0x15f216;});return db['AnalyticFieldReport'][_0xfe30('0x46')](_0x54cd13,{'transaction':_0x5527ba});});})['then'](function(){return db['AnalyticFieldReport'][_0xfe30('0x3f')]({'where':{'CustomReportId':_0xc61b6f[_0xfe30('0x42')]['id']}});});}})[_0xfe30('0x24')](respondWithResult(_0x1b9631,null))[_0xfe30('0x43')](handleError(_0x1b9631,null));};
\ No newline at end of file
+var _0xe2c7=['length','hasOwnProperty','nolimit','limit','sort','pick','where','filter','merge','options','include','findAll','rows','catch','show','params','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields'];(function(_0x43fb1b,_0x7b1161){var _0x347af3=function(_0xd612af){while(--_0xd612af){_0x43fb1b['push'](_0x43fb1b['shift']());}};_0x347af3(++_0x7b1161);}(_0xe2c7,0x69));var _0x7e2c=function(_0x10bf5d,_0x10a3a9){_0x10bf5d=_0x10bf5d-0x0;var _0x27f511=_0xe2c7[_0x10bf5d];return _0x27f511;};'use strict';var emlformat=require(_0x7e2c('0x0'));var rimraf=require(_0x7e2c('0x1'));var zipdir=require(_0x7e2c('0x2'));var jsonpatch=require(_0x7e2c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7e2c('0x4'));var util=require(_0x7e2c('0x5'));var path=require(_0x7e2c('0x6'));var sox=require(_0x7e2c('0x7'));var csv=require(_0x7e2c('0x8'));var ejs=require(_0x7e2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7e2c('0xa'));var _=require(_0x7e2c('0xb'));var squel=require('squel');var crypto=require(_0x7e2c('0xc'));var jsforce=require(_0x7e2c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7e2c('0x8'));var querystring=require('querystring');var Papa=require(_0x7e2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7e2c('0xf'));var qs=require(_0x7e2c('0x10'));var as=require(_0x7e2c('0x11'));var hardwareService=require(_0x7e2c('0x12'));var logger=require(_0x7e2c('0x13'))(_0x7e2c('0x14'));var utils=require(_0x7e2c('0x15'));var config=require(_0x7e2c('0x16'));var licenseUtil=require(_0x7e2c('0x17'));var db=require(_0x7e2c('0x18'))['db'];function respondWithStatusCode(_0x16c38a,_0xb1a4b7){_0xb1a4b7=_0xb1a4b7||0xcc;return function(_0x444074){if(_0x444074){return _0x16c38a['sendStatus'](_0xb1a4b7);}return _0x16c38a[_0x7e2c('0x19')](_0xb1a4b7)[_0x7e2c('0x1a')]();};}function respondWithResult(_0x56fea8,_0x37202e){_0x37202e=_0x37202e||0xc8;return function(_0x56f75d){if(_0x56f75d){return _0x56fea8[_0x7e2c('0x19')](_0x37202e)[_0x7e2c('0x1b')](_0x56f75d);}};}function respondWithFilteredResult(_0x5134e0,_0x4e881d){return function(_0x1fe8fc){if(_0x1fe8fc){var _0x4302af=typeof _0x4e881d[_0x7e2c('0x1c')]===_0x7e2c('0x1d')&&typeof _0x4e881d['limit']==='undefined';var _0x8d59ae=_0x1fe8fc[_0x7e2c('0x1e')];var _0x22f886=_0x4302af?0x0:_0x4e881d[_0x7e2c('0x1c')];var _0x104f30=_0x4302af?_0x1fe8fc['count']:_0x4e881d[_0x7e2c('0x1c')]+_0x4e881d['limit'];var _0x574b14;if(_0x104f30>=_0x8d59ae){_0x104f30=_0x8d59ae;_0x574b14=0xc8;}else{_0x574b14=0xce;}_0x5134e0[_0x7e2c('0x19')](_0x574b14);return _0x5134e0[_0x7e2c('0x1f')](_0x7e2c('0x20'),_0x22f886+'-'+_0x104f30+'/'+_0x8d59ae)[_0x7e2c('0x1b')](_0x1fe8fc);}return null;};}function patchUpdates(_0x3206df){return function(_0x545241){try{jsonpatch[_0x7e2c('0x21')](_0x545241,_0x3206df,!![]);}catch(_0x86a15e){return BPromise['reject'](_0x86a15e);}return _0x545241[_0x7e2c('0x22')]();};}function saveUpdates(_0x4a6743,_0x3416d5){return function(_0x1852f6){if(_0x1852f6){return _0x1852f6[_0x7e2c('0x23')](_0x4a6743)['then'](function(_0x20b04f){return _0x20b04f;});}return null;};}function removeEntity(_0x7afb1b,_0x29d621){return function(_0x27fc5e){if(_0x27fc5e){return _0x27fc5e[_0x7e2c('0x24')]()[_0x7e2c('0x25')](function(){_0x7afb1b['status'](0xcc)[_0x7e2c('0x1a')]();});}};}function handleEntityNotFound(_0x3a420c,_0x172a58){return function(_0x5459d7){if(!_0x5459d7){_0x3a420c[_0x7e2c('0x26')](0x194);}return _0x5459d7;};}function handleError(_0x215e8f,_0x7f6215){_0x7f6215=_0x7f6215||0x1f4;return function(_0x4a3307){logger[_0x7e2c('0x27')](_0x4a3307['stack']);if(_0x4a3307[_0x7e2c('0x28')]){delete _0x4a3307[_0x7e2c('0x28')];}_0x215e8f[_0x7e2c('0x19')](_0x7f6215)[_0x7e2c('0x29')](_0x4a3307);};}exports[_0x7e2c('0x2a')]=function(_0x508954,_0x464684){var _0x1d4b21={},_0x2f714b={},_0x3e6aac={'count':0x0,'rows':[]};var _0x24df06=_[_0x7e2c('0x2b')](db[_0x7e2c('0x2c')][_0x7e2c('0x2d')],function(_0x454cba){return{'name':_0x454cba[_0x7e2c('0x2e')],'type':_0x454cba[_0x7e2c('0x2f')]['key']};});_0x2f714b['model']=_['map'](_0x24df06,'name');_0x2f714b['query']=_[_0x7e2c('0x30')](_0x508954[_0x7e2c('0x31')]);_0x2f714b[_0x7e2c('0x32')]=_[_0x7e2c('0x33')](_0x2f714b[_0x7e2c('0x34')],_0x2f714b['query']);_0x1d4b21[_0x7e2c('0x35')]=_['intersection'](_0x2f714b['model'],qs[_0x7e2c('0x36')](_0x508954['query']['fields']));_0x1d4b21[_0x7e2c('0x35')]=_0x1d4b21['attributes'][_0x7e2c('0x37')]?_0x1d4b21['attributes']:_0x2f714b['model'];if(!_0x508954[_0x7e2c('0x31')][_0x7e2c('0x38')](_0x7e2c('0x39'))){_0x1d4b21[_0x7e2c('0x3a')]=qs['limit'](_0x508954[_0x7e2c('0x31')][_0x7e2c('0x3a')]);_0x1d4b21['offset']=qs['offset'](_0x508954[_0x7e2c('0x31')][_0x7e2c('0x1c')]);}_0x1d4b21['order']=qs[_0x7e2c('0x3b')](_0x508954[_0x7e2c('0x31')][_0x7e2c('0x3b')]);_0x1d4b21['where']=qs[_0x7e2c('0x32')](_[_0x7e2c('0x3c')](_0x508954['query'],_0x2f714b[_0x7e2c('0x32')]),_0x24df06);if(_0x508954['query']['filter']){_0x1d4b21[_0x7e2c('0x3d')]=_['merge'](_0x1d4b21[_0x7e2c('0x3d')],{'$or':_[_0x7e2c('0x2b')](_0x24df06,function(_0x2727ee){if(_0x2727ee['type']!=='VIRTUAL'){var _0x1c947c={};_0x1c947c[_0x2727ee[_0x7e2c('0x28')]]={'$like':'%'+_0x508954[_0x7e2c('0x31')][_0x7e2c('0x3e')]+'%'};return _0x1c947c;}})});}_0x1d4b21=_[_0x7e2c('0x3f')]({},_0x1d4b21,_0x508954[_0x7e2c('0x40')]);var _0x551ecc={'where':_0x1d4b21[_0x7e2c('0x3d')]};return db['AnalyticFieldReport']['count'](_0x551ecc)[_0x7e2c('0x25')](function(_0x310276){_0x3e6aac[_0x7e2c('0x1e')]=_0x310276;if(_0x508954[_0x7e2c('0x31')]['includeAll']){_0x1d4b21[_0x7e2c('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x7e2c('0x42')](_0x1d4b21);})['then'](function(_0x231244){_0x3e6aac[_0x7e2c('0x43')]=_0x231244;return _0x3e6aac;})[_0x7e2c('0x25')](respondWithFilteredResult(_0x464684,_0x1d4b21))[_0x7e2c('0x44')](handleError(_0x464684,null));};exports[_0x7e2c('0x45')]=function(_0x3f6dc1,_0x7316fd){var _0x2c0cea={'raw':![],'where':{'id':_0x3f6dc1[_0x7e2c('0x46')]['id']}},_0x7f847c={};_0x7f847c[_0x7e2c('0x34')]=_['keys'](db[_0x7e2c('0x2c')][_0x7e2c('0x2d')]);_0x7f847c[_0x7e2c('0x31')]=_[_0x7e2c('0x30')](_0x3f6dc1['query']);_0x7f847c[_0x7e2c('0x32')]=_['intersection'](_0x7f847c['model'],_0x7f847c[_0x7e2c('0x31')]);_0x2c0cea[_0x7e2c('0x35')]=_[_0x7e2c('0x33')](_0x7f847c['model'],qs[_0x7e2c('0x36')](_0x3f6dc1[_0x7e2c('0x31')][_0x7e2c('0x36')]));_0x2c0cea[_0x7e2c('0x35')]=_0x2c0cea['attributes']['length']?_0x2c0cea[_0x7e2c('0x35')]:_0x7f847c['model'];if(_0x3f6dc1['query']['includeAll']){_0x2c0cea[_0x7e2c('0x41')]=[{'all':!![]}];}_0x2c0cea=_[_0x7e2c('0x3f')]({},_0x2c0cea,_0x3f6dc1[_0x7e2c('0x40')]);return db[_0x7e2c('0x2c')]['find'](_0x2c0cea)[_0x7e2c('0x25')](handleEntityNotFound(_0x7316fd,null))['then'](respondWithResult(_0x7316fd,null))[_0x7e2c('0x44')](handleError(_0x7316fd,null));};exports['create']=function(_0x4da6b1,_0xd21687){return db[_0x7e2c('0x2c')]['create'](_0x4da6b1[_0x7e2c('0x47')],{})[_0x7e2c('0x25')](respondWithResult(_0xd21687,0xc9))[_0x7e2c('0x44')](handleError(_0xd21687,null));};exports['bulkCreate']=function(_0x20800e,_0x1adae0){return db[_0x7e2c('0x2c')][_0x7e2c('0x48')](_0x20800e[_0x7e2c('0x47')],{'raw':![],'individualHooks':!![]})[_0x7e2c('0x25')](respondWithResult(_0x1adae0,0xc9))[_0x7e2c('0x44')](handleError(_0x1adae0,null));};exports['update']=function(_0x280fe8,_0x2c2c24){if(_0x280fe8[_0x7e2c('0x47')]['id']){delete _0x280fe8[_0x7e2c('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7e2c('0x49')]({'where':{'id':_0x280fe8[_0x7e2c('0x46')]['id']}})[_0x7e2c('0x25')](handleEntityNotFound(_0x2c2c24,null))[_0x7e2c('0x25')](saveUpdates(_0x280fe8[_0x7e2c('0x47')],null))[_0x7e2c('0x25')](respondWithResult(_0x2c2c24,null))[_0x7e2c('0x44')](handleError(_0x2c2c24,null));};exports[_0x7e2c('0x24')]=function(_0x5edc52,_0x39746b){return db[_0x7e2c('0x2c')]['find']({'where':{'id':_0x5edc52[_0x7e2c('0x46')]['id']}})['then'](handleEntityNotFound(_0x39746b,null))['then'](removeEntity(_0x39746b,null))[_0x7e2c('0x44')](handleError(_0x39746b,null));};exports[_0x7e2c('0x4a')]=function(_0x19bd82,_0x3b2bec){return db[_0x7e2c('0x2c')][_0x7e2c('0x24')]({'where':{'id':_0x19bd82[_0x7e2c('0x31')][_0x7e2c('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x7e2c('0x25')](respondWithResult(_0x3b2bec,0xcc))['catch'](handleError(_0x3b2bec,null));};exports[_0x7e2c('0x4c')]=function(_0x1ae70e,_0x3d11c8,_0xcb642c){return db[_0x7e2c('0x4d')][_0x7e2c('0x4e')]({'where':{'id':_0x1ae70e['params']['id']}})['then'](handleEntityNotFound(_0x3d11c8,null))['then'](function(_0x2da4fe){if(_0x2da4fe){return db['sequelize'][_0x7e2c('0x4f')](function(_0x457e37){return db[_0x7e2c('0x2c')]['destroy']({'where':{'CustomReportId':_0x1ae70e[_0x7e2c('0x46')]['id']},'transaction':_0x457e37})[_0x7e2c('0x25')](function(_0x36896b){var _0x52b759=_[_0x7e2c('0x2b')](_0x1ae70e[_0x7e2c('0x47')],function(_0x49ef7e){delete _0x49ef7e['id'];_0x49ef7e['CustomReportId']=_0x1ae70e[_0x7e2c('0x46')]['id'];return _0x49ef7e;});return db[_0x7e2c('0x2c')][_0x7e2c('0x48')](_0x52b759,{'transaction':_0x457e37});});})[_0x7e2c('0x25')](function(){return db[_0x7e2c('0x2c')][_0x7e2c('0x42')]({'where':{'CustomReportId':_0x1ae70e['params']['id']}});});}})[_0x7e2c('0x25')](respondWithResult(_0x3d11c8,null))[_0x7e2c('0x44')](handleError(_0x3d11c8,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index aef0bf5..52408bc 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 _0x77bb=['api','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x27fe0f,_0x39cb63){var _0x28b7d3=function(_0x52be6f){while(--_0x52be6f){_0x27fe0f['push'](_0x27fe0f['shift']());}};_0x28b7d3(++_0x39cb63);}(_0x77bb,0xbb));var _0xb77b=function(_0x145cf3,_0x3bf0da){_0x145cf3=_0x145cf3-0x0;var _0x5db0bf=_0x77bb[_0x145cf3];return _0x5db0bf;};'use strict';var _=require(_0xb77b('0x0'));var util=require(_0xb77b('0x1'));var logger=require(_0xb77b('0x2'))(_0xb77b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb77b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb77b('0x5'));var attributes=require(_0xb77b('0x6'));module[_0xb77b('0x7')]=function(_0x41d3f6,_0x276c50){return _0x41d3f6['define'](_0xb77b('0x8'),attributes,{'tableName':_0xb77b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd828=['exports','define','analytics_report_fields','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x560c4d,_0xe4f0ba){var _0x381de1=function(_0x180361){while(--_0x180361){_0x560c4d['push'](_0x560c4d['shift']());}};_0x381de1(++_0xe4f0ba);}(_0xd828,0x177));var _0x8d82=function(_0xc95c4b,_0x35b487){_0xc95c4b=_0xc95c4b-0x0;var _0x23dbfa=_0xd828[_0xc95c4b];return _0x23dbfa;};'use strict';var _=require(_0x8d82('0x0'));var util=require('util');var logger=require(_0x8d82('0x1'))(_0x8d82('0x2'));var moment=require(_0x8d82('0x3'));var BPromise=require('bluebird');var rp=require(_0x8d82('0x4'));var fs=require('fs');var path=require(_0x8d82('0x5'));var rimraf=require(_0x8d82('0x6'));var config=require(_0x8d82('0x7'));var attributes=require(_0x8d82('0x8'));module[_0x8d82('0x9')]=function(_0x1d61ed,_0x4cebbe){return _0x1d61ed[_0x8d82('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x8d82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index edb6004..1a21db5 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 _0xfeca=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x3007b2,_0x4d0027){var _0x4597a9=function(_0x493679){while(--_0x493679){_0x3007b2['push'](_0x3007b2['shift']());}};_0x4597a9(++_0x4d0027);}(_0xfeca,0xf4));var _0xafec=function(_0x1866b7,_0x243cf7){_0x1866b7=_0x1866b7-0x0;var _0x5a0a82=_0xfeca[_0x1866b7];return _0x5a0a82;};'use strict';var _=require(_0xafec('0x0'));var util=require(_0xafec('0x1'));var moment=require(_0xafec('0x2'));var BPromise=require(_0xafec('0x3'));var rs=require(_0xafec('0x4'));var fs=require('fs');var Redis=require(_0xafec('0x5'));var db=require(_0xafec('0x6'))['db'];var utils=require(_0xafec('0x7'));var logger=require('../../config/logger')(_0xafec('0x8'));var config=require(_0xafec('0x9'));var jayson=require(_0xafec('0xa'));var client=jayson[_0xafec('0xb')][_0xafec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d9b88,_0x4080ea,_0x1248e9){return new BPromise(function(_0x1561be,_0xf6561b){return client[_0xafec('0xd')](_0x1d9b88,_0x1248e9)['then'](function(_0xe7c737){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4080ea,_0xafec('0xe'));logger['debug'](_0xafec('0xf'),_0x4080ea,_0xafec('0xe'),JSON[_0xafec('0x10')](_0xe7c737));if(_0xe7c737[_0xafec('0x11')]){if(_0xe7c737[_0xafec('0x11')][_0xafec('0x12')]===0x1f4){logger['error'](_0xafec('0x13'),_0x4080ea,_0xe7c737['error']['message']);return _0xf6561b(_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);}logger['error'](_0xafec('0x13'),_0x4080ea,_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);return _0x1561be(_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);}else{logger[_0xafec('0x15')](_0xafec('0x13'),_0x4080ea,_0xafec('0xe'));_0x1561be(_0xe7c737[_0xafec('0x16')]['message']);}})[_0xafec('0x17')](function(_0x5331dc){logger[_0xafec('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4080ea,_0x5331dc);_0xf6561b(_0x5331dc);});});}
\ No newline at end of file
+var _0x1841=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x3e19fb,_0x3258e2){var _0x5b19bd=function(_0x1f5bbe){while(--_0x1f5bbe){_0x3e19fb['push'](_0x3e19fb['shift']());}};_0x5b19bd(++_0x3258e2);}(_0x1841,0x18b));var _0x1184=function(_0x9253b9,_0x551d23){_0x9253b9=_0x9253b9-0x0;var _0x1722b8=_0x1841[_0x9253b9];return _0x1722b8;};'use strict';var _=require(_0x1184('0x0'));var util=require(_0x1184('0x1'));var moment=require(_0x1184('0x2'));var BPromise=require('bluebird');var rs=require(_0x1184('0x3'));var fs=require('fs');var Redis=require(_0x1184('0x4'));var db=require(_0x1184('0x5'))['db'];var utils=require(_0x1184('0x6'));var logger=require(_0x1184('0x7'))(_0x1184('0x8'));var config=require(_0x1184('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf699cb,_0x120a4a,_0x49abc4){return new BPromise(function(_0x55f0f0,_0x1e969f){return client[_0x1184('0xa')](_0xf699cb,_0x49abc4)[_0x1184('0xb')](function(_0x452e25){logger['info'](_0x1184('0xc'),_0x120a4a,_0x1184('0xd'));logger[_0x1184('0xe')](_0x1184('0xf'),_0x120a4a,_0x1184('0xd'),JSON['stringify'](_0x452e25));if(_0x452e25[_0x1184('0x10')]){if(_0x452e25[_0x1184('0x10')][_0x1184('0x11')]===0x1f4){logger['error'](_0x1184('0xc'),_0x120a4a,_0x452e25[_0x1184('0x10')][_0x1184('0x12')]);return _0x1e969f(_0x452e25['error']['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x120a4a,_0x452e25['error'][_0x1184('0x12')]);return _0x55f0f0(_0x452e25[_0x1184('0x10')][_0x1184('0x12')]);}else{logger[_0x1184('0x13')](_0x1184('0xc'),_0x120a4a,_0x1184('0xd'));_0x55f0f0(_0x452e25[_0x1184('0x14')][_0x1184('0x12')]);}})[_0x1184('0x15')](function(_0x49e934){logger[_0x1184('0x10')](_0x1184('0xc'),_0x120a4a,_0x49e934);_0x1e969f(_0x49e934);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 38d837c..7ba77fc 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(_0x974a42,_0x509392){var _0x1b801c=function(_0x37bb44){while(--_0x37bb44){_0x974a42['push'](_0x974a42['shift']());}};_0x1b801c(++_0x509392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x2df5b6,_0x272dd1){var _0x1c1010=function(_0x539cab){while(--_0x539cab){_0x2df5b6['push'](_0x2df5b6['shift']());}};_0x1c1010(++_0x272dd1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 7b97241..c56d813 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 _0xd757=['name','sequelize','exports','STRING'];(function(_0x187e2c,_0x1f0899){var _0x214c94=function(_0x51325c){while(--_0x51325c){_0x187e2c['push'](_0x187e2c['shift']());}};_0x214c94(++_0x1f0899);}(_0xd757,0x1e5));var _0x7d75=function(_0x46c6b5,_0x23f130){_0x46c6b5=_0x46c6b5-0x0;var _0x429113=_0xd757[_0x46c6b5];return _0x429113;};'use strict';var Sequelize=require(_0x7d75('0x0'));module[_0x7d75('0x1')]={'name':{'type':Sequelize[_0x7d75('0x2')],'allowNull':![],'unique':_0x7d75('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d75('0x2')]}};
\ No newline at end of file
+var _0x1bc6=['STRING','name','TEXT','sequelize','exports'];(function(_0x3f3c46,_0x33e972){var _0x7d1132=function(_0x2c7b56){while(--_0x2c7b56){_0x3f3c46['push'](_0x3f3c46['shift']());}};_0x7d1132(++_0x33e972);}(_0x1bc6,0x94));var _0x61bc=function(_0x5e0ac6,_0x40b94b){_0x5e0ac6=_0x5e0ac6-0x0;var _0x140494=_0x1bc6[_0x5e0ac6];return _0x140494;};'use strict';var Sequelize=require(_0x61bc('0x0'));module[_0x61bc('0x1')]={'name':{'type':Sequelize[_0x61bc('0x2')],'allowNull':![],'unique':_0x61bc('0x3')},'table':{'type':Sequelize[_0x61bc('0x2')]},'metric':{'type':Sequelize[_0x61bc('0x4')]},'description':{'type':Sequelize[_0x61bc('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 1564b10..e28b3d4 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x55279e,_0x52184e){var _0x2690c6=function(_0x2269c0){while(--_0x2269c0){_0x55279e['push'](_0x55279e['shift']());}};_0x2690c6(++_0x52184e);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2f00d7,_0x80b5e9){_0x2f00d7=_0x2f00d7-0x0;var _0x49a48f=_0xdc97[_0x2f00d7];return _0x49a48f;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
+var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0xc03ca6,_0x45a389){_0xc03ca6=_0xc03ca6-0x0;var _0x39d5a3=_0x8d0e[_0xc03ca6];return _0x39d5a3;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 5a7e938..fc554dd 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 _0x9865=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9865,0x1ba));var _0x5986=function(_0x2c2ab3,_0x593de1){_0x2c2ab3=_0x2c2ab3-0x0;var _0x1803f7=_0x9865[_0x2c2ab3];return _0x1803f7;};'use strict';var _=require(_0x5986('0x0'));var util=require(_0x5986('0x1'));var logger=require(_0x5986('0x2'))(_0x5986('0x3'));var moment=require(_0x5986('0x4'));var BPromise=require(_0x5986('0x5'));var rp=require(_0x5986('0x6'));var fs=require('fs');var path=require(_0x5986('0x7'));var rimraf=require(_0x5986('0x8'));var config=require(_0x5986('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x5986('0xa')]=function(_0x35e6f8,_0x3ac862){return _0x35e6f8[_0x5986('0xb')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','lodash','util'];(function(_0x3848b5,_0x3c8688){var _0x2fbc5c=function(_0x3cf951){while(--_0x3cf951){_0x3848b5['push'](_0x3848b5['shift']());}};_0x2fbc5c(++_0x3c8688);}(_0xf494,0x1c6));var _0x4f49=function(_0x5b503b,_0xe75bbe){_0x5b503b=_0x5b503b-0x0;var _0x43b949=_0xf494[_0x5b503b];return _0x43b949;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 78216a5..2bce41a 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 _0x5552=['stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x58c961,_0x15690a){var _0x1993bf=function(_0x5494e6){while(--_0x5494e6){_0x58c961['push'](_0x58c961['shift']());}};_0x1993bf(++_0x15690a);}(_0x5552,0x8a));var _0x2555=function(_0x352026,_0x14f939){_0x352026=_0x352026-0x0;var _0x1a3573=_0x5552[_0x352026];return _0x1a3573;};'use strict';var _=require(_0x2555('0x0'));var util=require(_0x2555('0x1'));var moment=require(_0x2555('0x2'));var BPromise=require(_0x2555('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2555('0x4'))['db'];var utils=require(_0x2555('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2555('0x6'));var jayson=require(_0x2555('0x7'));var client=jayson['client'][_0x2555('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32ad2c,_0x404070,_0x5c17e1){return new BPromise(function(_0x35c2f2,_0x23e68a){return client[_0x2555('0x9')](_0x32ad2c,_0x5c17e1)['then'](function(_0x440932){logger[_0x2555('0xa')](_0x2555('0xb'),_0x404070,_0x2555('0xc'));logger[_0x2555('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x404070,_0x2555('0xc'),JSON[_0x2555('0xe')](_0x440932));if(_0x440932[_0x2555('0xf')]){if(_0x440932['error'][_0x2555('0x10')]===0x1f4){logger['error'](_0x2555('0xb'),_0x404070,_0x440932[_0x2555('0xf')]['message']);return _0x23e68a(_0x440932[_0x2555('0xf')][_0x2555('0x11')]);}logger['error'](_0x2555('0xb'),_0x404070,_0x440932[_0x2555('0xf')][_0x2555('0x11')]);return _0x35c2f2(_0x440932['error'][_0x2555('0x11')]);}else{logger[_0x2555('0xa')](_0x2555('0xb'),_0x404070,_0x2555('0xc'));_0x35c2f2(_0x440932['result']['message']);}})[_0x2555('0x12')](function(_0x4c09e3){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x404070,_0x4c09e3);_0x23e68a(_0x4c09e3);});});}
\ No newline at end of file
+var _0xdef8=['http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0xf68ed,_0x44d25b){var _0x5a038d=function(_0x22fb59){while(--_0x22fb59){_0xf68ed['push'](_0xf68ed['shift']());}};_0x5a038d(++_0x44d25b);}(_0xdef8,0x8a));var _0x8def=function(_0x4ae172,_0x358493){_0x4ae172=_0x4ae172-0x0;var _0x2c93d8=_0xdef8[_0x4ae172];return _0x2c93d8;};'use strict';var _=require(_0x8def('0x0'));var util=require(_0x8def('0x1'));var moment=require(_0x8def('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8def('0x3'));var db=require(_0x8def('0x4'))['db'];var utils=require(_0x8def('0x5'));var logger=require(_0x8def('0x6'))(_0x8def('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8def('0x8')][_0x8def('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2284a0,_0xcabda,_0x30ae17){return new BPromise(function(_0x22c358,_0x560159){return client[_0x8def('0xa')](_0x2284a0,_0x30ae17)['then'](function(_0xc7145){logger[_0x8def('0xb')](_0x8def('0xc'),_0xcabda,_0x8def('0xd'));logger[_0x8def('0xe')](_0x8def('0xf'),_0xcabda,'request\x20sent',JSON[_0x8def('0x10')](_0xc7145));if(_0xc7145[_0x8def('0x11')]){if(_0xc7145[_0x8def('0x11')][_0x8def('0x12')]===0x1f4){logger[_0x8def('0x11')](_0x8def('0xc'),_0xcabda,_0xc7145[_0x8def('0x11')][_0x8def('0x13')]);return _0x560159(_0xc7145[_0x8def('0x11')][_0x8def('0x13')]);}logger[_0x8def('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0xcabda,_0xc7145[_0x8def('0x11')][_0x8def('0x13')]);return _0x22c358(_0xc7145['error']['message']);}else{logger['info'](_0x8def('0xc'),_0xcabda,'request\x20sent');_0x22c358(_0xc7145[_0x8def('0x14')][_0x8def('0x13')]);}})['catch'](function(_0x2bad21){logger[_0x8def('0x11')](_0x8def('0xc'),_0xcabda,_0x2bad21);_0x560159(_0x2bad21);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 232af2e..53b1d80 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 _0xa4dc=['put','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','post'];(function(_0x48ec16,_0x3536e0){var _0x272d42=function(_0x34051d){while(--_0x34051d){_0x48ec16['push'](_0x48ec16['shift']());}};_0x272d42(++_0x3536e0);}(_0xa4dc,0x16a));var _0xca4d=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xa4dc[_0x8a969d];return _0x1d8dc7;};'use strict';var multer=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca4d('0x2'));var router=express[_0xca4d('0x3')]();var fs_extra=require(_0xca4d('0x4'));var auth=require(_0xca4d('0x5'));var interaction=require(_0xca4d('0x6'));var config=require('../../config/environment');var controller=require(_0xca4d('0x7'));router[_0xca4d('0x8')]('/',auth[_0xca4d('0x9')](),controller['index']);router[_0xca4d('0x8')]('/:id',auth[_0xca4d('0x9')](),controller[_0xca4d('0xa')]);router[_0xca4d('0xb')]('/',auth[_0xca4d('0x9')](),controller['create']);router[_0xca4d('0xc')](_0xca4d('0xd'),auth['isAuthenticated'](),controller[_0xca4d('0xe')]);router['delete'](_0xca4d('0xd'),auth[_0xca4d('0x9')](),controller[_0xca4d('0xf')]);module[_0xca4d('0x10')]=router;
\ No newline at end of file
+var _0x1115=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x3f29bd,_0x20215c){var _0x1e91df=function(_0x3f4f9c){while(--_0x3f4f9c){_0x3f29bd['push'](_0x3f29bd['shift']());}};_0x1e91df(++_0x20215c);}(_0x1115,0x1b6));var _0x5111=function(_0x49aefa,_0x1112d9){_0x49aefa=_0x49aefa-0x0;var _0x3d2b66=_0x1115[_0x49aefa];return _0x3d2b66;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['show']);router[_0x5111('0xc')]('/',auth['isAuthenticated'](),controller[_0x5111('0xd')]);router[_0x5111('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5111('0xf')]);router['delete'](_0x5111('0xb'),auth['isAuthenticated'](),controller[_0x5111('0x10')]);module[_0x5111('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 793ea75..2fd8487 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 _0x7be8=['sequelize','TEXT'];(function(_0x1c89c3,_0x3c2348){var _0x62d305=function(_0x5441a2){while(--_0x5441a2){_0x1c89c3['push'](_0x1c89c3['shift']());}};_0x62d305(++_0x3c2348);}(_0x7be8,0x80));var _0x87be=function(_0x555014,_0xf5b10b){_0x555014=_0x555014-0x0;var _0x2dbe09=_0x7be8[_0x555014];return _0x2dbe09;};'use strict';var Sequelize=require(_0x87be('0x0'));module['exports']={'tree':{'type':Sequelize[_0x87be('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x9cb2=['TEXT','sequelize','exports'];(function(_0x1ba7b6,_0x1b58bb){var _0x2f41b3=function(_0xc6e978){while(--_0xc6e978){_0x1ba7b6['push'](_0x1ba7b6['shift']());}};_0x2f41b3(++_0x1b58bb);}(_0x9cb2,0x16f));var _0x29cb=function(_0x19e7ce,_0x46462f){_0x19e7ce=_0x19e7ce-0x0;var _0xcc5a5b=_0x9cb2[_0x19e7ce];return _0xcc5a5b;};'use strict';var Sequelize=require(_0x29cb('0x0'));module[_0x29cb('0x1')]={'tree':{'type':Sequelize[_0x29cb('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 97159ce..8c94184 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 _0xc206=['fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xc206,0xae));var _0x6c20=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xc206[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c20('0x0'));var zipdir=require(_0x6c20('0x1'));var jsonpatch=require(_0x6c20('0x2'));var rp=require(_0x6c20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6c20('0x4'));var util=require('util');var path=require(_0x6c20('0x5'));var sox=require(_0x6c20('0x6'));var csv=require('to-csv');var ejs=require(_0x6c20('0x7'));var fs=require('fs');var fs_extra=require(_0x6c20('0x8'));var _=require(_0x6c20('0x9'));var squel=require(_0x6c20('0xa'));var crypto=require(_0x6c20('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6c20('0xc'));var toCsv=require(_0x6c20('0xd'));var querystring=require(_0x6c20('0xe'));var Papa=require(_0x6c20('0xf'));var Redis=require(_0x6c20('0x10'));var authService=require(_0x6c20('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6c20('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6c20('0x13'));var utils=require(_0x6c20('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6c20('0x15'));var db=require(_0x6c20('0x16'))['db'];function respondWithStatusCode(_0x92280e,_0x484350){_0x484350=_0x484350||0xcc;return function(_0x5411f5){if(_0x5411f5){return _0x92280e['sendStatus'](_0x484350);}return _0x92280e[_0x6c20('0x17')](_0x484350)[_0x6c20('0x18')]();};}function respondWithResult(_0x456861,_0x2719df){_0x2719df=_0x2719df||0xc8;return function(_0x22805d){if(_0x22805d){return _0x456861['status'](_0x2719df)[_0x6c20('0x19')](_0x22805d);}};}function respondWithFilteredResult(_0x3634cc,_0x2eb939){return function(_0x37d4f8){if(_0x37d4f8){var _0x2bc2d3=typeof _0x2eb939[_0x6c20('0x1a')]==='undefined'&&typeof _0x2eb939[_0x6c20('0x1b')]===_0x6c20('0x1c');var _0x80ddea=_0x37d4f8[_0x6c20('0x1d')];var _0x22b0b2=_0x2bc2d3?0x0:_0x2eb939[_0x6c20('0x1a')];var _0x46ec47=_0x2bc2d3?_0x37d4f8[_0x6c20('0x1d')]:_0x2eb939['offset']+_0x2eb939[_0x6c20('0x1b')];var _0x7c88dd;if(_0x46ec47>=_0x80ddea){_0x46ec47=_0x80ddea;_0x7c88dd=0xc8;}else{_0x7c88dd=0xce;}_0x3634cc[_0x6c20('0x17')](_0x7c88dd);return _0x3634cc[_0x6c20('0x1e')](_0x6c20('0x1f'),_0x22b0b2+'-'+_0x46ec47+'/'+_0x80ddea)[_0x6c20('0x19')](_0x37d4f8);}return null;};}function patchUpdates(_0x2e77c6){return function(_0x510b6c){try{jsonpatch[_0x6c20('0x20')](_0x510b6c,_0x2e77c6,!![]);}catch(_0x2270bc){return BPromise['reject'](_0x2270bc);}return _0x510b6c['save']();};}function saveUpdates(_0x223c8f,_0x36da6e){return function(_0x767b77){if(_0x767b77){return _0x767b77[_0x6c20('0x21')](_0x223c8f)['then'](function(_0x1d865c){return _0x1d865c;});}return null;};}function removeEntity(_0x1f215a,_0x1b526f){return function(_0x4e8108){if(_0x4e8108){return _0x4e8108[_0x6c20('0x22')]()[_0x6c20('0x23')](function(){_0x1f215a[_0x6c20('0x17')](0xcc)[_0x6c20('0x18')]();});}};}function handleEntityNotFound(_0x4591d5,_0x457071){return function(_0x1665c8){if(!_0x1665c8){_0x4591d5[_0x6c20('0x24')](0x194);}return _0x1665c8;};}function handleError(_0x5d4695,_0x505ac1){_0x505ac1=_0x505ac1||0x1f4;return function(_0x533be1){logger[_0x6c20('0x25')](_0x533be1[_0x6c20('0x26')]);if(_0x533be1[_0x6c20('0x27')]){delete _0x533be1[_0x6c20('0x27')];}_0x5d4695['status'](_0x505ac1)[_0x6c20('0x28')](_0x533be1);};}exports[_0x6c20('0x29')]=function(_0x367491,_0x5791f7){var _0x461d2d={},_0x4892b6={},_0x246d82={'count':0x0,'rows':[]};var _0x84de8a=_[_0x6c20('0x2a')](db[_0x6c20('0x2b')][_0x6c20('0x2c')],function(_0x3b9739){return{'name':_0x3b9739[_0x6c20('0x2d')],'type':_0x3b9739[_0x6c20('0x2e')]['key']};});_0x4892b6[_0x6c20('0x2f')]=_['map'](_0x84de8a,_0x6c20('0x27'));_0x4892b6[_0x6c20('0x30')]=_['keys'](_0x367491[_0x6c20('0x30')]);_0x4892b6[_0x6c20('0x31')]=_['intersection'](_0x4892b6[_0x6c20('0x2f')],_0x4892b6['query']);_0x461d2d[_0x6c20('0x32')]=_[_0x6c20('0x33')](_0x4892b6[_0x6c20('0x2f')],qs[_0x6c20('0x34')](_0x367491[_0x6c20('0x30')][_0x6c20('0x34')]));_0x461d2d[_0x6c20('0x32')]=_0x461d2d[_0x6c20('0x32')][_0x6c20('0x35')]?_0x461d2d[_0x6c20('0x32')]:_0x4892b6['model'];if(!_0x367491['query'][_0x6c20('0x36')]('nolimit')){_0x461d2d[_0x6c20('0x1b')]=qs[_0x6c20('0x1b')](_0x367491[_0x6c20('0x30')]['limit']);_0x461d2d[_0x6c20('0x1a')]=qs['offset'](_0x367491['query'][_0x6c20('0x1a')]);}_0x461d2d[_0x6c20('0x37')]=qs[_0x6c20('0x38')](_0x367491[_0x6c20('0x30')][_0x6c20('0x38')]);_0x461d2d[_0x6c20('0x39')]=qs['filters'](_[_0x6c20('0x3a')](_0x367491[_0x6c20('0x30')],_0x4892b6[_0x6c20('0x31')]),_0x84de8a);if(_0x367491['query']['filter']){_0x461d2d[_0x6c20('0x39')]=_[_0x6c20('0x3b')](_0x461d2d[_0x6c20('0x39')],{'$or':_['map'](_0x84de8a,function(_0x2e4f93){if(_0x2e4f93[_0x6c20('0x2e')]!==_0x6c20('0x3c')){var _0x5cc0ff={};_0x5cc0ff[_0x2e4f93[_0x6c20('0x27')]]={'$like':'%'+_0x367491['query'][_0x6c20('0x3d')]+'%'};return _0x5cc0ff;}})});}_0x461d2d=_[_0x6c20('0x3b')]({},_0x461d2d,_0x367491[_0x6c20('0x3e')]);var _0x1d0669={'where':_0x461d2d[_0x6c20('0x39')]};return db['AnalyticTreeReport'][_0x6c20('0x1d')](_0x1d0669)[_0x6c20('0x23')](function(_0x40e716){_0x246d82[_0x6c20('0x1d')]=_0x40e716;if(_0x367491[_0x6c20('0x30')][_0x6c20('0x3f')]){_0x461d2d[_0x6c20('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x6c20('0x41')](_0x461d2d);})[_0x6c20('0x23')](function(_0x582922){_0x246d82['rows']=_0x582922;return _0x246d82;})[_0x6c20('0x23')](respondWithFilteredResult(_0x5791f7,_0x461d2d))['catch'](handleError(_0x5791f7,null));};exports[_0x6c20('0x42')]=function(_0x1d4e61,_0x51210f){var _0x5c2e51={'raw':!![],'where':{'id':_0x1d4e61[_0x6c20('0x43')]['id']}},_0x2c4d97={};_0x2c4d97[_0x6c20('0x2f')]=_[_0x6c20('0x44')](db[_0x6c20('0x2b')][_0x6c20('0x2c')]);_0x2c4d97[_0x6c20('0x30')]=_[_0x6c20('0x44')](_0x1d4e61[_0x6c20('0x30')]);_0x2c4d97['filters']=_[_0x6c20('0x33')](_0x2c4d97['model'],_0x2c4d97[_0x6c20('0x30')]);_0x5c2e51[_0x6c20('0x32')]=_['intersection'](_0x2c4d97[_0x6c20('0x2f')],qs[_0x6c20('0x34')](_0x1d4e61[_0x6c20('0x30')][_0x6c20('0x34')]));_0x5c2e51[_0x6c20('0x32')]=_0x5c2e51['attributes'][_0x6c20('0x35')]?_0x5c2e51[_0x6c20('0x32')]:_0x2c4d97[_0x6c20('0x2f')];if(_0x1d4e61[_0x6c20('0x30')][_0x6c20('0x3f')]){_0x5c2e51[_0x6c20('0x40')]=[{'all':!![]}];}_0x5c2e51=_['merge']({},_0x5c2e51,_0x1d4e61[_0x6c20('0x3e')]);return db[_0x6c20('0x2b')][_0x6c20('0x45')](_0x5c2e51)['then'](handleEntityNotFound(_0x51210f,null))['then'](respondWithResult(_0x51210f,null))[_0x6c20('0x46')](handleError(_0x51210f,null));};exports[_0x6c20('0x47')]=function(_0x20b386,_0xf11e7c){return db[_0x6c20('0x2b')][_0x6c20('0x47')](_0x20b386[_0x6c20('0x48')],{})[_0x6c20('0x23')](respondWithResult(_0xf11e7c,0xc9))[_0x6c20('0x46')](handleError(_0xf11e7c,null));};exports['update']=function(_0x181984,_0x44b973){if(_0x181984[_0x6c20('0x48')]['id']){delete _0x181984[_0x6c20('0x48')]['id'];}return db[_0x6c20('0x2b')][_0x6c20('0x45')]({'where':{'id':_0x181984[_0x6c20('0x43')]['id']}})[_0x6c20('0x23')](handleEntityNotFound(_0x44b973,null))['then'](saveUpdates(_0x181984[_0x6c20('0x48')],null))[_0x6c20('0x23')](respondWithResult(_0x44b973,null))['catch'](handleError(_0x44b973,null));};exports['destroy']=function(_0x8591c7,_0x22018b){return db[_0x6c20('0x2b')][_0x6c20('0x45')]({'where':{'id':_0x8591c7[_0x6c20('0x43')]['id']}})['then'](handleEntityNotFound(_0x22018b,null))[_0x6c20('0x23')](removeEntity(_0x22018b,null))['catch'](handleError(_0x22018b,null));};
\ No newline at end of file
+var _0x3f65=['destroy','error','stack','name','index','map','AnalyticTreeReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','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','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then'];(function(_0x1196b9,_0x15134a){var _0x405211=function(_0x55f78c){while(--_0x55f78c){_0x1196b9['push'](_0x1196b9['shift']());}};_0x405211(++_0x15134a);}(_0x3f65,0x70));var _0x53f6=function(_0x2d2906,_0x37ba99){_0x2d2906=_0x2d2906-0x0;var _0x5a62d3=_0x3f65[_0x2d2906];return _0x5a62d3;};'use strict';var emlformat=require(_0x53f6('0x0'));var rimraf=require(_0x53f6('0x1'));var zipdir=require(_0x53f6('0x2'));var jsonpatch=require(_0x53f6('0x3'));var rp=require(_0x53f6('0x4'));var moment=require(_0x53f6('0x5'));var BPromise=require(_0x53f6('0x6'));var Mustache=require(_0x53f6('0x7'));var util=require(_0x53f6('0x8'));var path=require(_0x53f6('0x9'));var sox=require('sox');var csv=require(_0x53f6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x53f6('0xb'));var _=require(_0x53f6('0xc'));var squel=require(_0x53f6('0xd'));var crypto=require(_0x53f6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x53f6('0xa'));var querystring=require(_0x53f6('0xf'));var Papa=require(_0x53f6('0x10'));var Redis=require(_0x53f6('0x11'));var authService=require(_0x53f6('0x12'));var qs=require(_0x53f6('0x13'));var as=require(_0x53f6('0x14'));var hardwareService=require(_0x53f6('0x15'));var logger=require(_0x53f6('0x16'))(_0x53f6('0x17'));var utils=require(_0x53f6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x53f6('0x19'));var db=require(_0x53f6('0x1a'))['db'];function respondWithStatusCode(_0x457c4c,_0x2fb631){_0x2fb631=_0x2fb631||0xcc;return function(_0x4e6501){if(_0x4e6501){return _0x457c4c[_0x53f6('0x1b')](_0x2fb631);}return _0x457c4c['status'](_0x2fb631)[_0x53f6('0x1c')]();};}function respondWithResult(_0x3c732a,_0xcd3f91){_0xcd3f91=_0xcd3f91||0xc8;return function(_0x19fd6c){if(_0x19fd6c){return _0x3c732a[_0x53f6('0x1d')](_0xcd3f91)['json'](_0x19fd6c);}};}function respondWithFilteredResult(_0x29f0d1,_0x1dbdca){return function(_0x4cff5a){if(_0x4cff5a){var _0x2cc549=typeof _0x1dbdca[_0x53f6('0x1e')]===_0x53f6('0x1f')&&typeof _0x1dbdca[_0x53f6('0x20')]===_0x53f6('0x1f');var _0x5908d8=_0x4cff5a[_0x53f6('0x21')];var _0x15d615=_0x2cc549?0x0:_0x1dbdca[_0x53f6('0x1e')];var _0x56d70c=_0x2cc549?_0x4cff5a[_0x53f6('0x21')]:_0x1dbdca[_0x53f6('0x1e')]+_0x1dbdca[_0x53f6('0x20')];var _0x4880c7;if(_0x56d70c>=_0x5908d8){_0x56d70c=_0x5908d8;_0x4880c7=0xc8;}else{_0x4880c7=0xce;}_0x29f0d1[_0x53f6('0x1d')](_0x4880c7);return _0x29f0d1[_0x53f6('0x22')](_0x53f6('0x23'),_0x15d615+'-'+_0x56d70c+'/'+_0x5908d8)[_0x53f6('0x24')](_0x4cff5a);}return null;};}function patchUpdates(_0x17e96e){return function(_0x59a939){try{jsonpatch[_0x53f6('0x25')](_0x59a939,_0x17e96e,!![]);}catch(_0x341542){return BPromise['reject'](_0x341542);}return _0x59a939[_0x53f6('0x26')]();};}function saveUpdates(_0x42fd61,_0x2e7fba){return function(_0x266848){if(_0x266848){return _0x266848['update'](_0x42fd61)[_0x53f6('0x27')](function(_0x302bf6){return _0x302bf6;});}return null;};}function removeEntity(_0x208b02,_0x40681c){return function(_0x31b0fa){if(_0x31b0fa){return _0x31b0fa[_0x53f6('0x28')]()[_0x53f6('0x27')](function(){_0x208b02[_0x53f6('0x1d')](0xcc)[_0x53f6('0x1c')]();});}};}function handleEntityNotFound(_0x9614b3,_0x2563b9){return function(_0x4bb822){if(!_0x4bb822){_0x9614b3[_0x53f6('0x1b')](0x194);}return _0x4bb822;};}function handleError(_0x3a4905,_0x529a5d){_0x529a5d=_0x529a5d||0x1f4;return function(_0x3e67a1){logger[_0x53f6('0x29')](_0x3e67a1[_0x53f6('0x2a')]);if(_0x3e67a1[_0x53f6('0x2b')]){delete _0x3e67a1[_0x53f6('0x2b')];}_0x3a4905[_0x53f6('0x1d')](_0x529a5d)['send'](_0x3e67a1);};}exports[_0x53f6('0x2c')]=function(_0x37a078,_0x106e77){var _0x1fc93f={},_0x237919={},_0x47519e={'count':0x0,'rows':[]};var _0xaefca1=_[_0x53f6('0x2d')](db[_0x53f6('0x2e')]['rawAttributes'],function(_0x4b5685){return{'name':_0x4b5685[_0x53f6('0x2f')],'type':_0x4b5685['type']['key']};});_0x237919[_0x53f6('0x30')]=_[_0x53f6('0x2d')](_0xaefca1,_0x53f6('0x2b'));_0x237919[_0x53f6('0x31')]=_[_0x53f6('0x32')](_0x37a078[_0x53f6('0x31')]);_0x237919[_0x53f6('0x33')]=_[_0x53f6('0x34')](_0x237919[_0x53f6('0x30')],_0x237919[_0x53f6('0x31')]);_0x1fc93f[_0x53f6('0x35')]=_[_0x53f6('0x34')](_0x237919[_0x53f6('0x30')],qs['fields'](_0x37a078[_0x53f6('0x31')][_0x53f6('0x36')]));_0x1fc93f[_0x53f6('0x35')]=_0x1fc93f[_0x53f6('0x35')][_0x53f6('0x37')]?_0x1fc93f[_0x53f6('0x35')]:_0x237919['model'];if(!_0x37a078['query'][_0x53f6('0x38')]('nolimit')){_0x1fc93f['limit']=qs[_0x53f6('0x20')](_0x37a078[_0x53f6('0x31')][_0x53f6('0x20')]);_0x1fc93f[_0x53f6('0x1e')]=qs[_0x53f6('0x1e')](_0x37a078[_0x53f6('0x31')][_0x53f6('0x1e')]);}_0x1fc93f['order']=qs[_0x53f6('0x39')](_0x37a078[_0x53f6('0x31')][_0x53f6('0x39')]);_0x1fc93f[_0x53f6('0x3a')]=qs['filters'](_[_0x53f6('0x3b')](_0x37a078['query'],_0x237919[_0x53f6('0x33')]),_0xaefca1);if(_0x37a078[_0x53f6('0x31')][_0x53f6('0x3c')]){_0x1fc93f['where']=_[_0x53f6('0x3d')](_0x1fc93f[_0x53f6('0x3a')],{'$or':_[_0x53f6('0x2d')](_0xaefca1,function(_0x3c9f28){if(_0x3c9f28[_0x53f6('0x3e')]!==_0x53f6('0x3f')){var _0x54492c={};_0x54492c[_0x3c9f28[_0x53f6('0x2b')]]={'$like':'%'+_0x37a078[_0x53f6('0x31')][_0x53f6('0x3c')]+'%'};return _0x54492c;}})});}_0x1fc93f=_[_0x53f6('0x3d')]({},_0x1fc93f,_0x37a078['options']);var _0x1c0ddc={'where':_0x1fc93f[_0x53f6('0x3a')]};return db[_0x53f6('0x2e')][_0x53f6('0x21')](_0x1c0ddc)[_0x53f6('0x27')](function(_0x56c6a2){_0x47519e['count']=_0x56c6a2;if(_0x37a078[_0x53f6('0x31')][_0x53f6('0x40')]){_0x1fc93f['include']=[{'all':!![]}];}return db[_0x53f6('0x2e')][_0x53f6('0x41')](_0x1fc93f);})['then'](function(_0x2db9ce){_0x47519e[_0x53f6('0x42')]=_0x2db9ce;return _0x47519e;})['then'](respondWithFilteredResult(_0x106e77,_0x1fc93f))[_0x53f6('0x43')](handleError(_0x106e77,null));};exports[_0x53f6('0x44')]=function(_0x1f5fe4,_0x218eb8){var _0x219397={'raw':!![],'where':{'id':_0x1f5fe4[_0x53f6('0x45')]['id']}},_0x44e8a8={};_0x44e8a8[_0x53f6('0x30')]=_[_0x53f6('0x32')](db[_0x53f6('0x2e')][_0x53f6('0x46')]);_0x44e8a8[_0x53f6('0x31')]=_[_0x53f6('0x32')](_0x1f5fe4['query']);_0x44e8a8[_0x53f6('0x33')]=_[_0x53f6('0x34')](_0x44e8a8['model'],_0x44e8a8[_0x53f6('0x31')]);_0x219397[_0x53f6('0x35')]=_[_0x53f6('0x34')](_0x44e8a8['model'],qs[_0x53f6('0x36')](_0x1f5fe4[_0x53f6('0x31')]['fields']));_0x219397['attributes']=_0x219397[_0x53f6('0x35')][_0x53f6('0x37')]?_0x219397[_0x53f6('0x35')]:_0x44e8a8[_0x53f6('0x30')];if(_0x1f5fe4[_0x53f6('0x31')][_0x53f6('0x40')]){_0x219397[_0x53f6('0x47')]=[{'all':!![]}];}_0x219397=_[_0x53f6('0x3d')]({},_0x219397,_0x1f5fe4['options']);return db[_0x53f6('0x2e')][_0x53f6('0x48')](_0x219397)[_0x53f6('0x27')](handleEntityNotFound(_0x218eb8,null))['then'](respondWithResult(_0x218eb8,null))[_0x53f6('0x43')](handleError(_0x218eb8,null));};exports['create']=function(_0x2504d4,_0x581387){return db[_0x53f6('0x2e')][_0x53f6('0x49')](_0x2504d4[_0x53f6('0x4a')],{})[_0x53f6('0x27')](respondWithResult(_0x581387,0xc9))[_0x53f6('0x43')](handleError(_0x581387,null));};exports[_0x53f6('0x4b')]=function(_0x39d37b,_0x38027e){if(_0x39d37b[_0x53f6('0x4a')]['id']){delete _0x39d37b[_0x53f6('0x4a')]['id'];}return db[_0x53f6('0x2e')][_0x53f6('0x48')]({'where':{'id':_0x39d37b[_0x53f6('0x45')]['id']}})[_0x53f6('0x27')](handleEntityNotFound(_0x38027e,null))[_0x53f6('0x27')](saveUpdates(_0x39d37b[_0x53f6('0x4a')],null))[_0x53f6('0x27')](respondWithResult(_0x38027e,null))[_0x53f6('0x43')](handleError(_0x38027e,null));};exports[_0x53f6('0x28')]=function(_0x52737a,_0x28fcd3){return db['AnalyticTreeReport'][_0x53f6('0x48')]({'where':{'id':_0x52737a[_0x53f6('0x45')]['id']}})[_0x53f6('0x27')](handleEntityNotFound(_0x28fcd3,null))[_0x53f6('0x27')](removeEntity(_0x28fcd3,null))[_0x53f6('0x43')](handleError(_0x28fcd3,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 124b728..f8fa109 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 _0x191d=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x4133fd,_0x1cd6ec){var _0x2365d6=function(_0x471734){while(--_0x471734){_0x4133fd['push'](_0x4133fd['shift']());}};_0x2365d6(++_0x1cd6ec);}(_0x191d,0x161));var _0xd191=function(_0x15a782,_0x25165f){_0x15a782=_0x15a782-0x0;var _0x376302=_0x191d[_0x15a782];return _0x376302;};'use strict';var _=require(_0xd191('0x0'));var util=require(_0xd191('0x1'));var logger=require(_0xd191('0x2'))(_0xd191('0x3'));var moment=require('moment');var BPromise=require(_0xd191('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd191('0x5'));var rimraf=require(_0xd191('0x6'));var config=require(_0xd191('0x7'));var attributes=require(_0xd191('0x8'));module[_0xd191('0x9')]=function(_0x4ffbd0,_0x56fe2c){return _0x4ffbd0[_0xd191('0xa')](_0xd191('0xb'),attributes,{'tableName':_0xd191('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9982=['exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes'];(function(_0x558abc,_0x58cc5b){var _0x2c0125=function(_0x85d138){while(--_0x85d138){_0x558abc['push'](_0x558abc['shift']());}};_0x2c0125(++_0x58cc5b);}(_0x9982,0x1b9));var _0x2998=function(_0x99bd01,_0x279ec8){_0x99bd01=_0x99bd01-0x0;var _0x228949=_0x9982[_0x99bd01];return _0x228949;};'use strict';var _=require(_0x2998('0x0'));var util=require(_0x2998('0x1'));var logger=require(_0x2998('0x2'))(_0x2998('0x3'));var moment=require(_0x2998('0x4'));var BPromise=require(_0x2998('0x5'));var rp=require(_0x2998('0x6'));var fs=require('fs');var path=require(_0x2998('0x7'));var rimraf=require('rimraf');var config=require(_0x2998('0x8'));var attributes=require(_0x2998('0x9'));module[_0x2998('0xa')]=function(_0x1ca6b4,_0x42266f){return _0x1ca6b4['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 57d5373..17c1d19 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x41c87b,_0x52f73e){_0x41c87b=_0x41c87b-0x0;var _0x22506f=_0x7a54[_0x41c87b];return _0x22506f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x239bdb,_0x180517){var _0x406f33=function(_0x3eb497){while(--_0x3eb497){_0x239bdb['push'](_0x239bdb['shift']());}};_0x406f33(++_0x180517);}(_0x1261,0x144));var _0x1126=function(_0x270e46,_0x122174){_0x270e46=_0x270e46-0x0;var _0x18ca4e=_0x1261[_0x270e46];return _0x18ca4e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index bb0b5e6..7182dd9 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 _0x60e4=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0xb2432a,_0x46ce8b){var _0x38ec39=function(_0x378ed7){while(--_0x378ed7){_0xb2432a['push'](_0xb2432a['shift']());}};_0x38ec39(++_0x46ce8b);}(_0x60e4,0xff));var _0x460e=function(_0x3e8096,_0xf1d389){_0x3e8096=_0x3e8096-0x0;var _0x3c2377=_0x60e4[_0x3e8096];return _0x3c2377;};'use strict';var multer=require(_0x460e('0x0'));var util=require(_0x460e('0x1'));var path=require(_0x460e('0x2'));var timeout=require(_0x460e('0x3'));var express=require(_0x460e('0x4'));var router=express[_0x460e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x460e('0x6'));var config=require(_0x460e('0x7'));var controller=require(_0x460e('0x8'));router['get']('/',auth[_0x460e('0x9')](),controller[_0x460e('0xa')]);router[_0x460e('0xb')](_0x460e('0xc'),auth[_0x460e('0x9')](),controller['show']);router[_0x460e('0xd')]('/',auth[_0x460e('0x9')](),controller[_0x460e('0xe')]);router['put'](_0x460e('0xc'),auth[_0x460e('0x9')](),controller['update']);router[_0x460e('0xf')]('/:id',auth[_0x460e('0x9')](),controller[_0x460e('0x10')]);module[_0x460e('0x11')]=router;
\ No newline at end of file
+var _0x0ca9=['get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ca9,0xc8));var _0x90ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ca9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x90ca('0x0'));var util=require(_0x90ca('0x1'));var path=require(_0x90ca('0x2'));var timeout=require(_0x90ca('0x3'));var express=require('express');var router=express[_0x90ca('0x4')]();var fs_extra=require(_0x90ca('0x5'));var auth=require(_0x90ca('0x6'));var interaction=require(_0x90ca('0x7'));var config=require(_0x90ca('0x8'));var controller=require(_0x90ca('0x9'));router[_0x90ca('0xa')]('/',auth[_0x90ca('0xb')](),controller[_0x90ca('0xc')]);router[_0x90ca('0xa')]('/:id',auth[_0x90ca('0xb')](),controller['show']);router[_0x90ca('0xd')]('/',auth[_0x90ca('0xb')](),controller[_0x90ca('0xe')]);router[_0x90ca('0xf')](_0x90ca('0x10'),auth[_0x90ca('0xb')](),controller[_0x90ca('0x11')]);router[_0x90ca('0x12')]('/:id',auth[_0x90ca('0xb')](),controller[_0x90ca('0x13')]);module[_0x90ca('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 4e1985b..201da1c 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 _0x89c3=['sequelize','exports','STRING'];(function(_0x2dcc80,_0x96b865){var _0x1289d9=function(_0x155eab){while(--_0x155eab){_0x2dcc80['push'](_0x2dcc80['shift']());}};_0x1289d9(++_0x96b865);}(_0x89c3,0xff));var _0x389c=function(_0x4a8829,_0x36f847){_0x4a8829=_0x4a8829-0x0;var _0x22dc42=_0x89c3[_0x4a8829];return _0x22dc42;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'name':{'type':Sequelize[_0x389c('0x2')]},'basename':{'type':Sequelize[_0x389c('0x2')]},'type':{'type':Sequelize[_0x389c('0x2')]}};
\ No newline at end of file
+var _0x28a2=['sequelize','exports','STRING'];(function(_0x151eb9,_0x409e99){var _0x31fc56=function(_0x409ce9){while(--_0x409ce9){_0x151eb9['push'](_0x151eb9['shift']());}};_0x31fc56(++_0x409e99);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x228a('0x0'));module[_0x228a('0x1')]={'name':{'type':Sequelize[_0x228a('0x2')]},'basename':{'type':Sequelize[_0x228a('0x2')]},'type':{'type':Sequelize[_0x228a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index b8948a4..3efe258 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 _0xecd4=['keys','find','clone','include','get','omit','createdAt','body','create','originalname','basename','file','filename','mimetype','download','server/files/attachments/','join','offline-chat/','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','name','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params'];(function(_0x5c3526,_0x2a1e90){var _0xec27a2=function(_0x5ac4e1){while(--_0x5ac4e1){_0x5c3526['push'](_0x5c3526['shift']());}};_0xec27a2(++_0x2a1e90);}(_0xecd4,0xc6));var _0x4ecd=function(_0x4cb0e3,_0x5e0445){_0x4cb0e3=_0x4cb0e3-0x0;var _0x46ea93=_0xecd4[_0x4cb0e3];return _0x46ea93;};'use strict';var emlformat=require(_0x4ecd('0x0'));var rimraf=require(_0x4ecd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ecd('0x2'));var Mustache=require(_0x4ecd('0x3'));var util=require('util');var path=require(_0x4ecd('0x4'));var sox=require(_0x4ecd('0x5'));var csv=require(_0x4ecd('0x6'));var ejs=require(_0x4ecd('0x7'));var fs=require('fs');var fs_extra=require(_0x4ecd('0x8'));var _=require(_0x4ecd('0x9'));var squel=require('squel');var crypto=require(_0x4ecd('0xa'));var jsforce=require(_0x4ecd('0xb'));var deskjs=require(_0x4ecd('0xc'));var toCsv=require(_0x4ecd('0x6'));var querystring=require(_0x4ecd('0xd'));var Papa=require(_0x4ecd('0xe'));var Redis=require('ioredis');var authService=require(_0x4ecd('0xf'));var qs=require(_0x4ecd('0x10'));var as=require(_0x4ecd('0x11'));var hardwareService=require(_0x4ecd('0x12'));var logger=require(_0x4ecd('0x13'))(_0x4ecd('0x14'));var utils=require(_0x4ecd('0x15'));var config=require(_0x4ecd('0x16'));var licenseUtil=require(_0x4ecd('0x17'));var db=require(_0x4ecd('0x18'))['db'];function respondWithStatusCode(_0x1bdeca,_0x31f01e){_0x31f01e=_0x31f01e||0xcc;return function(_0x1b6600){if(_0x1b6600){return _0x1bdeca['sendStatus'](_0x31f01e);}return _0x1bdeca[_0x4ecd('0x19')](_0x31f01e)[_0x4ecd('0x1a')]();};}function respondWithResult(_0x1a7041,_0x3227b3){_0x3227b3=_0x3227b3||0xc8;return function(_0x211fbc){if(_0x211fbc){return _0x1a7041[_0x4ecd('0x19')](_0x3227b3)[_0x4ecd('0x1b')](_0x211fbc);}};}function respondWithFilteredResult(_0x32254e,_0x30c062){return function(_0x3dc5dc){if(_0x3dc5dc){var _0x4483a5=typeof _0x30c062[_0x4ecd('0x1c')]===_0x4ecd('0x1d')&&typeof _0x30c062[_0x4ecd('0x1e')]===_0x4ecd('0x1d');var _0x45ece2=_0x3dc5dc[_0x4ecd('0x1f')];var _0x1dbdf5=_0x4483a5?0x0:_0x30c062[_0x4ecd('0x1c')];var _0x43f2aa=_0x4483a5?_0x3dc5dc[_0x4ecd('0x1f')]:_0x30c062[_0x4ecd('0x1c')]+_0x30c062[_0x4ecd('0x1e')];var _0x390ded;if(_0x43f2aa>=_0x45ece2){_0x43f2aa=_0x45ece2;_0x390ded=0xc8;}else{_0x390ded=0xce;}_0x32254e[_0x4ecd('0x19')](_0x390ded);return _0x32254e[_0x4ecd('0x20')]('Content-Range',_0x1dbdf5+'-'+_0x43f2aa+'/'+_0x45ece2)['json'](_0x3dc5dc);}return null;};}function patchUpdates(_0x38fea7){return function(_0x263273){try{jsonpatch[_0x4ecd('0x21')](_0x263273,_0x38fea7,!![]);}catch(_0xb2c982){return BPromise[_0x4ecd('0x22')](_0xb2c982);}return _0x263273[_0x4ecd('0x23')]();};}function saveUpdates(_0x17a63f,_0x5494dc){return function(_0x1af18e){if(_0x1af18e){return _0x1af18e[_0x4ecd('0x24')](_0x17a63f)['then'](function(_0x3ffa29){return _0x3ffa29;});}return null;};}function removeEntity(_0x83bce5,_0x325f8a){return function(_0x38ab8b){if(_0x38ab8b){return _0x38ab8b[_0x4ecd('0x25')]()[_0x4ecd('0x26')](function(){_0x83bce5['status'](0xcc)[_0x4ecd('0x1a')]();});}};}function handleEntityNotFound(_0x239e22,_0x1719f0){return function(_0x113c7a){if(!_0x113c7a){_0x239e22[_0x4ecd('0x27')](0x194);}return _0x113c7a;};}function handleError(_0x3b11f1,_0x14d42f){_0x14d42f=_0x14d42f||0x1f4;return function(_0x1d0598){logger[_0x4ecd('0x28')](_0x1d0598['stack']);if(_0x1d0598[_0x4ecd('0x29')]){delete _0x1d0598[_0x4ecd('0x29')];}_0x3b11f1[_0x4ecd('0x19')](_0x14d42f)['send'](_0x1d0598);};}exports[_0x4ecd('0x2a')]=function(_0xe4402e,_0x13432b){var _0x4d18c4={},_0x2fd398={},_0x276794={'count':0x0,'rows':[]};var _0x2a025a=_['map'](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')],function(_0x2ccebd){return{'name':_0x2ccebd[_0x4ecd('0x2d')],'type':_0x2ccebd[_0x4ecd('0x2e')][_0x4ecd('0x2f')]};});_0x2fd398[_0x4ecd('0x30')]=_[_0x4ecd('0x31')](_0x2a025a,_0x4ecd('0x29'));_0x2fd398[_0x4ecd('0x32')]=_['keys'](_0xe4402e[_0x4ecd('0x32')]);_0x2fd398['filters']=_[_0x4ecd('0x33')](_0x2fd398['model'],_0x2fd398[_0x4ecd('0x32')]);_0x4d18c4[_0x4ecd('0x34')]=_[_0x4ecd('0x33')](_0x2fd398['model'],qs[_0x4ecd('0x35')](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x35')]));_0x4d18c4[_0x4ecd('0x34')]=_0x4d18c4[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x4d18c4[_0x4ecd('0x34')]:_0x2fd398[_0x4ecd('0x30')];if(!_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x37')](_0x4ecd('0x38'))){_0x4d18c4[_0x4ecd('0x1e')]=qs[_0x4ecd('0x1e')](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x1e')]);_0x4d18c4[_0x4ecd('0x1c')]=qs['offset'](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x1c')]);}_0x4d18c4[_0x4ecd('0x39')]=qs[_0x4ecd('0x3a')](_0xe4402e['query'][_0x4ecd('0x3a')]);_0x4d18c4['where']=qs[_0x4ecd('0x3b')](_[_0x4ecd('0x3c')](_0xe4402e[_0x4ecd('0x32')],_0x2fd398[_0x4ecd('0x3b')]),_0x2a025a);if(_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x3d')]){_0x4d18c4[_0x4ecd('0x3e')]=_[_0x4ecd('0x3f')](_0x4d18c4[_0x4ecd('0x3e')],{'$or':_[_0x4ecd('0x31')](_0x2a025a,function(_0x335602){if(_0x335602[_0x4ecd('0x2e')]!==_0x4ecd('0x40')){var _0x4fb543={};_0x4fb543[_0x335602[_0x4ecd('0x29')]]={'$like':'%'+_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x3d')]+'%'};return _0x4fb543;}})});}_0x4d18c4=_[_0x4ecd('0x3f')]({},_0x4d18c4,_0xe4402e[_0x4ecd('0x41')]);var _0x38f25d={'where':_0x4d18c4[_0x4ecd('0x3e')]};return db[_0x4ecd('0x2b')][_0x4ecd('0x1f')](_0x38f25d)[_0x4ecd('0x26')](function(_0x47103e){_0x276794[_0x4ecd('0x1f')]=_0x47103e;if(_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x4d18c4['include']=[{'all':!![]}];}return db['Attachment'][_0x4ecd('0x43')](_0x4d18c4);})[_0x4ecd('0x26')](function(_0x3898c6){_0x276794[_0x4ecd('0x44')]=_0x3898c6;return _0x276794;})[_0x4ecd('0x26')](respondWithFilteredResult(_0x13432b,_0x4d18c4))[_0x4ecd('0x45')](handleError(_0x13432b,null));};exports[_0x4ecd('0x46')]=function(_0x166c94,_0x194118){var _0x805890={'raw':!![],'where':{'id':_0x166c94[_0x4ecd('0x47')]['id']}},_0x279c54={};_0x279c54['model']=_[_0x4ecd('0x48')](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')]);_0x279c54[_0x4ecd('0x32')]=_['keys'](_0x166c94['query']);_0x279c54['filters']=_['intersection'](_0x279c54[_0x4ecd('0x30')],_0x279c54[_0x4ecd('0x32')]);_0x805890[_0x4ecd('0x34')]=_['intersection'](_0x279c54['model'],qs[_0x4ecd('0x35')](_0x166c94[_0x4ecd('0x32')]['fields']));_0x805890[_0x4ecd('0x34')]=_0x805890[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x805890[_0x4ecd('0x34')]:_0x279c54['model'];if(_0x166c94[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x805890['include']=[{'all':!![]}];}_0x805890=_['merge']({},_0x805890,_0x166c94[_0x4ecd('0x41')]);return db[_0x4ecd('0x2b')][_0x4ecd('0x49')](_0x805890)[_0x4ecd('0x26')](handleEntityNotFound(_0x194118,null))[_0x4ecd('0x26')](respondWithResult(_0x194118,null))['catch'](handleError(_0x194118,null));};exports[_0x4ecd('0x4a')]=function(_0x3210a8,_0x3aa2c9){var _0x4cc1a1={'where':{'id':_0x3210a8[_0x4ecd('0x47')]['id']}},_0x2ebbf2={};_0x2ebbf2['model']=_[_0x4ecd('0x48')](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')]);_0x4cc1a1[_0x4ecd('0x34')]=_[_0x4ecd('0x33')](_0x2ebbf2[_0x4ecd('0x30')],qs[_0x4ecd('0x35')](_0x3210a8['query'][_0x4ecd('0x35')]));_0x4cc1a1[_0x4ecd('0x34')]=_0x4cc1a1[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x4cc1a1['attributes']:_0x2ebbf2[_0x4ecd('0x30')];if(_0x3210a8[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x4cc1a1[_0x4ecd('0x4b')]=[{'all':!![]}];}_0x4cc1a1=_[_0x4ecd('0x3f')]({},_0x4cc1a1,_0x3210a8[_0x4ecd('0x41')]);return db['Attachment'][_0x4ecd('0x49')](_0x4cc1a1)['then'](handleEntityNotFound(_0x3aa2c9,null))['then'](function(_0x2caded){if(_0x2caded){var _0x1280a5=_0x2caded[_0x4ecd('0x4c')]({'plain':!![]});_0x1280a5=qs[_0x4ecd('0x4d')](_0x1280a5,['id',_0x4ecd('0x4e'),'updatedAt']);_0x3210a8[_0x4ecd('0x4f')]=_['omit'](_0x3210a8['body'],['id',_0x4ecd('0x4e'),'updatedAt']);return db['Attachment'][_0x4ecd('0x50')](_[_0x4ecd('0x3f')](_0x1280a5,_0x3210a8['body']),{'include':_0x3210a8['query'][_0x4ecd('0x42')]?[{'all':!![]}]:undefined});}})[_0x4ecd('0x26')](respondWithResult(_0x3aa2c9,0xc9))[_0x4ecd('0x45')](handleError(_0x3aa2c9,null));};exports['update']=function(_0x289308,_0x1af643){if(_0x289308['body']['id']){delete _0x289308[_0x4ecd('0x4f')]['id'];}return db[_0x4ecd('0x2b')][_0x4ecd('0x49')]({'where':{'id':_0x289308[_0x4ecd('0x47')]['id']}})[_0x4ecd('0x26')](handleEntityNotFound(_0x1af643,null))[_0x4ecd('0x26')](saveUpdates(_0x289308[_0x4ecd('0x4f')],null))['then'](respondWithResult(_0x1af643,null))[_0x4ecd('0x45')](handleError(_0x1af643,null));};exports[_0x4ecd('0x25')]=function(_0x4fd831,_0x4ff466){return db[_0x4ecd('0x2b')][_0x4ecd('0x49')]({'where':{'id':_0x4fd831[_0x4ecd('0x47')]['id']}})[_0x4ecd('0x26')](handleEntityNotFound(_0x4ff466,null))['then'](removeEntity(_0x4ff466,null))[_0x4ecd('0x45')](handleError(_0x4ff466,null));};exports[_0x4ecd('0x50')]=function(_0x4a69f8,_0x2869cc,_0x12a0b3){_0x4a69f8[_0x4ecd('0x4f')]['name']=_0x4a69f8['file'][_0x4ecd('0x51')];_0x4a69f8[_0x4ecd('0x4f')][_0x4ecd('0x52')]=_0x4a69f8[_0x4ecd('0x53')][_0x4ecd('0x54')];_0x4a69f8[_0x4ecd('0x4f')][_0x4ecd('0x2e')]=_0x4a69f8['file'][_0x4ecd('0x55')];return db['Attachment'][_0x4ecd('0x50')](_0x4a69f8[_0x4ecd('0x4f')])[_0x4ecd('0x26')](respondWithResult(_0x2869cc,0xc9))[_0x4ecd('0x45')](handleError(_0x2869cc,null));};exports[_0x4ecd('0x56')]=function(_0x3ad04a,_0x3cb7da,_0x46d78d){return db['Attachment']['findOne']({'where':{'id':_0x3ad04a[_0x4ecd('0x47')]['id']},'raw':!![]})[_0x4ecd('0x26')](handleEntityNotFound(_0x3cb7da,null))[_0x4ecd('0x26')](function(_0x39b149){if(_0x39b149){var _0x39c1b2=_0x39b149['ChatOfflineMessageId']!==null;var _0x2be4be=path['join'](config['root'],_0x4ecd('0x57'));if(_0x39c1b2){_0x2be4be=path[_0x4ecd('0x58')](_0x2be4be,_0x4ecd('0x59'));}var _0x194b64=path[_0x4ecd('0x58')](_0x2be4be,_0x39b149[_0x4ecd('0x52')]);return _0x3cb7da['download'](_0x194b64);}})[_0x4ecd('0x45')](handleError(_0x3cb7da,null));};
\ No newline at end of file
+var _0xf9c3=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','then','includeAll','findAll','catch','show','include','options','find','params','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','name','send','map','Attachment','rawAttributes'];(function(_0x3c37e8,_0x2f7497){var _0xf03bf5=function(_0x3c1316){while(--_0x3c1316){_0x3c37e8['push'](_0x3c37e8['shift']());}};_0xf03bf5(++_0x2f7497);}(_0xf9c3,0x18c));var _0x3f9c=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0xf9c3[_0x4704dc];return _0x254d81;};'use strict';var emlformat=require(_0x3f9c('0x0'));var rimraf=require(_0x3f9c('0x1'));var zipdir=require(_0x3f9c('0x2'));var jsonpatch=require(_0x3f9c('0x3'));var rp=require(_0x3f9c('0x4'));var moment=require(_0x3f9c('0x5'));var BPromise=require(_0x3f9c('0x6'));var Mustache=require(_0x3f9c('0x7'));var util=require(_0x3f9c('0x8'));var path=require(_0x3f9c('0x9'));var sox=require(_0x3f9c('0xa'));var csv=require(_0x3f9c('0xb'));var ejs=require(_0x3f9c('0xc'));var fs=require('fs');var fs_extra=require(_0x3f9c('0xd'));var _=require(_0x3f9c('0xe'));var squel=require('squel');var crypto=require(_0x3f9c('0xf'));var jsforce=require(_0x3f9c('0x10'));var deskjs=require(_0x3f9c('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f9c('0x12'));var Redis=require(_0x3f9c('0x13'));var authService=require(_0x3f9c('0x14'));var qs=require(_0x3f9c('0x15'));var as=require(_0x3f9c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f9c('0x17'))('api');var utils=require(_0x3f9c('0x18'));var config=require(_0x3f9c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f9c('0x1a'))['db'];function respondWithStatusCode(_0x7b8507,_0x3e73c5){_0x3e73c5=_0x3e73c5||0xcc;return function(_0x2d9ead){if(_0x2d9ead){return _0x7b8507[_0x3f9c('0x1b')](_0x3e73c5);}return _0x7b8507[_0x3f9c('0x1c')](_0x3e73c5)[_0x3f9c('0x1d')]();};}function respondWithResult(_0x4783e3,_0x5c743d){_0x5c743d=_0x5c743d||0xc8;return function(_0x4a83c5){if(_0x4a83c5){return _0x4783e3[_0x3f9c('0x1c')](_0x5c743d)['json'](_0x4a83c5);}};}function respondWithFilteredResult(_0x3149aa,_0x3e5f00){return function(_0x975dc1){if(_0x975dc1){var _0x5c04c0=typeof _0x3e5f00[_0x3f9c('0x1e')]===_0x3f9c('0x1f')&&typeof _0x3e5f00[_0x3f9c('0x20')]==='undefined';var _0x356e92=_0x975dc1[_0x3f9c('0x21')];var _0x5872fc=_0x5c04c0?0x0:_0x3e5f00[_0x3f9c('0x1e')];var _0x294efe=_0x5c04c0?_0x975dc1[_0x3f9c('0x21')]:_0x3e5f00[_0x3f9c('0x1e')]+_0x3e5f00[_0x3f9c('0x20')];var _0x53f8f3;if(_0x294efe>=_0x356e92){_0x294efe=_0x356e92;_0x53f8f3=0xc8;}else{_0x53f8f3=0xce;}_0x3149aa[_0x3f9c('0x1c')](_0x53f8f3);return _0x3149aa[_0x3f9c('0x22')](_0x3f9c('0x23'),_0x5872fc+'-'+_0x294efe+'/'+_0x356e92)['json'](_0x975dc1);}return null;};}function patchUpdates(_0x34ed5c){return function(_0x480774){try{jsonpatch[_0x3f9c('0x24')](_0x480774,_0x34ed5c,!![]);}catch(_0x500053){return BPromise['reject'](_0x500053);}return _0x480774['save']();};}function saveUpdates(_0x3a127b,_0xfc6ca5){return function(_0x5d97a4){if(_0x5d97a4){return _0x5d97a4[_0x3f9c('0x25')](_0x3a127b)['then'](function(_0x38f33b){return _0x38f33b;});}return null;};}function removeEntity(_0x3dbe3d,_0x532510){return function(_0x632a86){if(_0x632a86){return _0x632a86[_0x3f9c('0x26')]()['then'](function(){_0x3dbe3d[_0x3f9c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2120d2,_0x1b02f8){return function(_0x397910){if(!_0x397910){_0x2120d2[_0x3f9c('0x1b')](0x194);}return _0x397910;};}function handleError(_0x2284ef,_0x2cba4f){_0x2cba4f=_0x2cba4f||0x1f4;return function(_0xa30c69){logger['error'](_0xa30c69['stack']);if(_0xa30c69[_0x3f9c('0x27')]){delete _0xa30c69[_0x3f9c('0x27')];}_0x2284ef['status'](_0x2cba4f)[_0x3f9c('0x28')](_0xa30c69);};}exports['index']=function(_0x182191,_0x4666c4){var _0x488d15={},_0x1e88f9={},_0x3db04b={'count':0x0,'rows':[]};var _0x46cdc6=_[_0x3f9c('0x29')](db[_0x3f9c('0x2a')][_0x3f9c('0x2b')],function(_0x1158ab){return{'name':_0x1158ab[_0x3f9c('0x2c')],'type':_0x1158ab[_0x3f9c('0x2d')][_0x3f9c('0x2e')]};});_0x1e88f9[_0x3f9c('0x2f')]=_[_0x3f9c('0x29')](_0x46cdc6,_0x3f9c('0x27'));_0x1e88f9[_0x3f9c('0x30')]=_[_0x3f9c('0x31')](_0x182191[_0x3f9c('0x30')]);_0x1e88f9[_0x3f9c('0x32')]=_[_0x3f9c('0x33')](_0x1e88f9['model'],_0x1e88f9[_0x3f9c('0x30')]);_0x488d15[_0x3f9c('0x34')]=_['intersection'](_0x1e88f9[_0x3f9c('0x2f')],qs[_0x3f9c('0x35')](_0x182191[_0x3f9c('0x30')]['fields']));_0x488d15[_0x3f9c('0x34')]=_0x488d15[_0x3f9c('0x34')][_0x3f9c('0x36')]?_0x488d15['attributes']:_0x1e88f9[_0x3f9c('0x2f')];if(!_0x182191[_0x3f9c('0x30')][_0x3f9c('0x37')](_0x3f9c('0x38'))){_0x488d15['limit']=qs['limit'](_0x182191[_0x3f9c('0x30')]['limit']);_0x488d15[_0x3f9c('0x1e')]=qs[_0x3f9c('0x1e')](_0x182191[_0x3f9c('0x30')][_0x3f9c('0x1e')]);}_0x488d15[_0x3f9c('0x39')]=qs['sort'](_0x182191['query'][_0x3f9c('0x3a')]);_0x488d15[_0x3f9c('0x3b')]=qs[_0x3f9c('0x32')](_['pick'](_0x182191['query'],_0x1e88f9['filters']),_0x46cdc6);if(_0x182191[_0x3f9c('0x30')][_0x3f9c('0x3c')]){_0x488d15[_0x3f9c('0x3b')]=_[_0x3f9c('0x3d')](_0x488d15['where'],{'$or':_[_0x3f9c('0x29')](_0x46cdc6,function(_0x298bf6){if(_0x298bf6[_0x3f9c('0x2d')]!==_0x3f9c('0x3e')){var _0x4a8fc2={};_0x4a8fc2[_0x298bf6['name']]={'$like':'%'+_0x182191['query'][_0x3f9c('0x3c')]+'%'};return _0x4a8fc2;}})});}_0x488d15=_['merge']({},_0x488d15,_0x182191['options']);var _0x279eb9={'where':_0x488d15[_0x3f9c('0x3b')]};return db[_0x3f9c('0x2a')][_0x3f9c('0x21')](_0x279eb9)[_0x3f9c('0x3f')](function(_0x3214b6){_0x3db04b[_0x3f9c('0x21')]=_0x3214b6;if(_0x182191['query'][_0x3f9c('0x40')]){_0x488d15['include']=[{'all':!![]}];}return db[_0x3f9c('0x2a')][_0x3f9c('0x41')](_0x488d15);})['then'](function(_0x5e466a){_0x3db04b['rows']=_0x5e466a;return _0x3db04b;})[_0x3f9c('0x3f')](respondWithFilteredResult(_0x4666c4,_0x488d15))[_0x3f9c('0x42')](handleError(_0x4666c4,null));};exports[_0x3f9c('0x43')]=function(_0x27692b,_0x3c9aa9){var _0x5b6e85={'raw':!![],'where':{'id':_0x27692b['params']['id']}},_0x468b69={};_0x468b69['model']=_['keys'](db['Attachment'][_0x3f9c('0x2b')]);_0x468b69['query']=_[_0x3f9c('0x31')](_0x27692b['query']);_0x468b69[_0x3f9c('0x32')]=_[_0x3f9c('0x33')](_0x468b69['model'],_0x468b69[_0x3f9c('0x30')]);_0x5b6e85[_0x3f9c('0x34')]=_['intersection'](_0x468b69[_0x3f9c('0x2f')],qs['fields'](_0x27692b[_0x3f9c('0x30')][_0x3f9c('0x35')]));_0x5b6e85[_0x3f9c('0x34')]=_0x5b6e85[_0x3f9c('0x34')]['length']?_0x5b6e85['attributes']:_0x468b69[_0x3f9c('0x2f')];if(_0x27692b[_0x3f9c('0x30')][_0x3f9c('0x40')]){_0x5b6e85[_0x3f9c('0x44')]=[{'all':!![]}];}_0x5b6e85=_[_0x3f9c('0x3d')]({},_0x5b6e85,_0x27692b[_0x3f9c('0x45')]);return db['Attachment'][_0x3f9c('0x46')](_0x5b6e85)['then'](handleEntityNotFound(_0x3c9aa9,null))['then'](respondWithResult(_0x3c9aa9,null))[_0x3f9c('0x42')](handleError(_0x3c9aa9,null));};exports['clone']=function(_0x4ae2a9,_0x49eba5){var _0x1ccbb8={'where':{'id':_0x4ae2a9[_0x3f9c('0x47')]['id']}},_0x2df8e2={};_0x2df8e2[_0x3f9c('0x2f')]=_[_0x3f9c('0x31')](db[_0x3f9c('0x2a')][_0x3f9c('0x2b')]);_0x1ccbb8[_0x3f9c('0x34')]=_[_0x3f9c('0x33')](_0x2df8e2[_0x3f9c('0x2f')],qs[_0x3f9c('0x35')](_0x4ae2a9[_0x3f9c('0x30')][_0x3f9c('0x35')]));_0x1ccbb8[_0x3f9c('0x34')]=_0x1ccbb8['attributes']['length']?_0x1ccbb8[_0x3f9c('0x34')]:_0x2df8e2[_0x3f9c('0x2f')];if(_0x4ae2a9[_0x3f9c('0x30')][_0x3f9c('0x40')]){_0x1ccbb8['include']=[{'all':!![]}];}_0x1ccbb8=_[_0x3f9c('0x3d')]({},_0x1ccbb8,_0x4ae2a9['options']);return db[_0x3f9c('0x2a')][_0x3f9c('0x46')](_0x1ccbb8)[_0x3f9c('0x3f')](handleEntityNotFound(_0x49eba5,null))['then'](function(_0x5261d0){if(_0x5261d0){var _0x5ef6ac=_0x5261d0['get']({'plain':!![]});_0x5ef6ac=qs[_0x3f9c('0x48')](_0x5ef6ac,['id',_0x3f9c('0x49'),_0x3f9c('0x4a')]);_0x4ae2a9[_0x3f9c('0x4b')]=_[_0x3f9c('0x48')](_0x4ae2a9[_0x3f9c('0x4b')],['id',_0x3f9c('0x49'),_0x3f9c('0x4a')]);return db[_0x3f9c('0x2a')][_0x3f9c('0x4c')](_[_0x3f9c('0x3d')](_0x5ef6ac,_0x4ae2a9[_0x3f9c('0x4b')]),{'include':_0x4ae2a9['query'][_0x3f9c('0x40')]?[{'all':!![]}]:undefined});}})[_0x3f9c('0x3f')](respondWithResult(_0x49eba5,0xc9))[_0x3f9c('0x42')](handleError(_0x49eba5,null));};exports[_0x3f9c('0x25')]=function(_0xd20d2,_0xfdc48b){if(_0xd20d2[_0x3f9c('0x4b')]['id']){delete _0xd20d2[_0x3f9c('0x4b')]['id'];}return db[_0x3f9c('0x2a')]['find']({'where':{'id':_0xd20d2[_0x3f9c('0x47')]['id']}})[_0x3f9c('0x3f')](handleEntityNotFound(_0xfdc48b,null))[_0x3f9c('0x3f')](saveUpdates(_0xd20d2[_0x3f9c('0x4b')],null))[_0x3f9c('0x3f')](respondWithResult(_0xfdc48b,null))[_0x3f9c('0x42')](handleError(_0xfdc48b,null));};exports[_0x3f9c('0x26')]=function(_0x2355fc,_0x1d4b57){return db[_0x3f9c('0x2a')][_0x3f9c('0x46')]({'where':{'id':_0x2355fc['params']['id']}})[_0x3f9c('0x3f')](handleEntityNotFound(_0x1d4b57,null))[_0x3f9c('0x3f')](removeEntity(_0x1d4b57,null))[_0x3f9c('0x42')](handleError(_0x1d4b57,null));};exports[_0x3f9c('0x4c')]=function(_0x361974,_0x2db4bf,_0x5bdd99){_0x361974[_0x3f9c('0x4b')][_0x3f9c('0x27')]=_0x361974[_0x3f9c('0x4d')][_0x3f9c('0x4e')];_0x361974[_0x3f9c('0x4b')][_0x3f9c('0x4f')]=_0x361974[_0x3f9c('0x4d')][_0x3f9c('0x50')];_0x361974[_0x3f9c('0x4b')][_0x3f9c('0x2d')]=_0x361974[_0x3f9c('0x4d')][_0x3f9c('0x51')];return db[_0x3f9c('0x2a')][_0x3f9c('0x4c')](_0x361974[_0x3f9c('0x4b')])[_0x3f9c('0x3f')](respondWithResult(_0x2db4bf,0xc9))[_0x3f9c('0x42')](handleError(_0x2db4bf,null));};exports[_0x3f9c('0x52')]=function(_0x32bb4e,_0x68deed,_0x268031){return db['Attachment'][_0x3f9c('0x53')]({'where':{'id':_0x32bb4e[_0x3f9c('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x68deed,null))[_0x3f9c('0x3f')](function(_0x31f36f){if(_0x31f36f){var _0x311f64=_0x31f36f[_0x3f9c('0x54')]!==null;var _0x4a3f03=path[_0x3f9c('0x55')](config[_0x3f9c('0x56')],'server/files/attachments/');if(_0x311f64){_0x4a3f03=path[_0x3f9c('0x55')](_0x4a3f03,_0x3f9c('0x57'));}var _0x3bacdd=path['join'](_0x4a3f03,_0x31f36f[_0x3f9c('0x4f')]);return _0x68deed[_0x3f9c('0x52')](_0x3bacdd);}})[_0x3f9c('0x42')](handleError(_0x68deed,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 72c908b..fe613c9 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 _0x3e73=['Attachment','attachments','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x43f9cb,_0x395f16){var _0x56e717=function(_0x49fb96){while(--_0x49fb96){_0x43f9cb['push'](_0x43f9cb['shift']());}};_0x56e717(++_0x395f16);}(_0x3e73,0x122));var _0x33e7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3e73[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x33e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x33e7('0x1'));var moment=require(_0x33e7('0x2'));var BPromise=require(_0x33e7('0x3'));var rp=require(_0x33e7('0x4'));var fs=require('fs');var path=require(_0x33e7('0x5'));var rimraf=require(_0x33e7('0x6'));var config=require(_0x33e7('0x7'));var attributes=require(_0x33e7('0x8'));module['exports']=function(_0x52b033,_0x4d31d4){return _0x52b033[_0x33e7('0x9')](_0x33e7('0xa'),attributes,{'tableName':_0x33e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde4b=['rimraf','../../config/environment','./attachment.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xde4b,0x130));var _0xbde4=function(_0x2b7804,_0x29f001){_0x2b7804=_0x2b7804-0x0;var _0x48811a=_0xde4b[_0x2b7804];return _0x48811a;};'use strict';var _=require(_0xbde4('0x0'));var util=require(_0xbde4('0x1'));var logger=require(_0xbde4('0x2'))(_0xbde4('0x3'));var moment=require(_0xbde4('0x4'));var BPromise=require(_0xbde4('0x5'));var rp=require(_0xbde4('0x6'));var fs=require('fs');var path=require(_0xbde4('0x7'));var rimraf=require(_0xbde4('0x8'));var config=require(_0xbde4('0x9'));var attributes=require(_0xbde4('0xa'));module['exports']=function(_0x1fcc5a,_0x1eab11){return _0x1fcc5a[_0xbde4('0xb')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index c4744ac..4255f57 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 _0x07c3=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x275e07,_0x3a2a1a){var _0x5b8eae=function(_0x3c1a99){while(--_0x3c1a99){_0x275e07['push'](_0x275e07['shift']());}};_0x5b8eae(++_0x3a2a1a);}(_0x07c3,0x1bf));var _0x307c=function(_0x46aaaa,_0x3af897){_0x46aaaa=_0x46aaaa-0x0;var _0x26d04e=_0x07c3[_0x46aaaa];return _0x26d04e;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}exports[_0x307c('0x1a')]=function(_0x2e21a6){var _0x3e05e2=this;return new Promise(function(_0x13f03b,_0xbfe2b4){return db['Attachment']['create'](_0x2e21a6[_0x307c('0x1b')],{'raw':_0x2e21a6['options']?_0x2e21a6[_0x307c('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bcc1a){logger[_0x307c('0xf')]('CreateAttachment',_0x2e21a6);logger[_0x307c('0x11')](_0x307c('0x1a'),_0x2e21a6,JSON['stringify'](_0x4bcc1a));_0x13f03b(_0x4bcc1a);})[_0x307c('0x19')](function(_0x45fe2){logger['error'](_0x307c('0x1a'),_0x45fe2[_0x307c('0x17')],_0x2e21a6);_0xbfe2b4(_0x3e05e2[_0x307c('0x16')](0x1f4,_0x45fe2[_0x307c('0x17')]));});});};
\ No newline at end of file
+var _0x1782=['code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x54887d,_0x252442){var _0x10099a=function(_0x1dc55e){while(--_0x1dc55e){_0x54887d['push'](_0x54887d['shift']());}};_0x10099a(++_0x252442);}(_0x1782,0x13e));var _0x2178=function(_0x143f66,_0xc137ba){_0x143f66=_0x143f66-0x0;var _0x52a5f3=_0x1782[_0x143f66];return _0x52a5f3;};'use strict';var _=require(_0x2178('0x0'));var util=require('util');var moment=require(_0x2178('0x1'));var BPromise=require(_0x2178('0x2'));var rs=require(_0x2178('0x3'));var fs=require('fs');var Redis=require(_0x2178('0x4'));var db=require(_0x2178('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2178('0x6'))(_0x2178('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2178('0x8')][_0x2178('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad34,_0x53b9f9,_0x4cf22a){return new BPromise(function(_0x3b4115,_0x2b3991){return client[_0x2178('0xa')](_0x50ad34,_0x4cf22a)[_0x2178('0xb')](function(_0x1cb1e6){logger[_0x2178('0xc')]('Attachment,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));logger[_0x2178('0xe')](_0x2178('0xf'),_0x53b9f9,_0x2178('0xd'),JSON[_0x2178('0x10')](_0x1cb1e6));if(_0x1cb1e6[_0x2178('0x11')]){if(_0x1cb1e6[_0x2178('0x11')][_0x2178('0x12')]===0x1f4){logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6['error'][_0x2178('0x14')]);return _0x2b3991(_0x1cb1e6[_0x2178('0x11')]['message']);}logger[_0x2178('0x11')](_0x2178('0x13'),_0x53b9f9,_0x1cb1e6[_0x2178('0x11')][_0x2178('0x14')]);return _0x3b4115(_0x1cb1e6[_0x2178('0x11')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x53b9f9,_0x2178('0xd'));_0x3b4115(_0x1cb1e6['result'][_0x2178('0x14')]);}})[_0x2178('0x15')](function(_0x5edc68){logger['error'](_0x2178('0x13'),_0x53b9f9,_0x5edc68);_0x2b3991(_0x5edc68);});});}exports[_0x2178('0x16')]=function(_0x561990){var _0x3d7e36=this;return new Promise(function(_0x39dd60,_0x1cece2){return db[_0x2178('0x17')][_0x2178('0x18')](_0x561990[_0x2178('0x19')],{'raw':_0x561990[_0x2178('0x1a')]?_0x561990[_0x2178('0x1a')][_0x2178('0x1b')]===undefined?!![]:![]:!![]})[_0x2178('0xb')](function(_0x1d2dd5){logger[_0x2178('0xc')]('CreateAttachment',_0x561990);logger[_0x2178('0xe')](_0x2178('0x16'),_0x561990,JSON[_0x2178('0x10')](_0x1d2dd5));_0x39dd60(_0x1d2dd5);})[_0x2178('0x15')](function(_0x4335f2){logger[_0x2178('0x11')](_0x2178('0x16'),_0x4335f2[_0x2178('0x14')],_0x561990);_0x1cece2(_0x3d7e36[_0x2178('0x11')](0x1f4,_0x4335f2[_0x2178('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index b4aac6d..8018352 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0x0b0e[_0xf31767];return _0x24bd0c;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x217a49,_0x5d9c5f){_0x217a49=_0x217a49-0x0;var _0x33ae2b=_0xdb28[_0x217a49];return _0x33ae2b;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 3b7485b..49339c6 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 _0xbe53=['disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','then','getLicense','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','google','/login','email','use','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','User','map','emails','user','agent'];(function(_0x550eaa,_0x4302ab){var _0x4db477=function(_0x59820c){while(--_0x59820c){_0x550eaa['push'](_0x550eaa['shift']());}};_0x4db477(++_0x4302ab);}(_0xbe53,0x1ba));var _0x3be5=function(_0x4b7a91,_0x3d7cd2){_0x4b7a91=_0x4b7a91-0x0;var _0x2fd4b9=_0xbe53[_0x4b7a91];return _0x2fd4b9;};'use strict';var _=require('lodash');var passport=require(_0x3be5('0x0'));var GoogleStrategy=require(_0x3be5('0x1'))['Strategy'];var moment=require(_0x3be5('0x2'));var db=require(_0x3be5('0x3'))['db'];var config=require(_0x3be5('0x4'));var signToken=require('../../components/auth/service')[_0x3be5('0x5')];var utils=require(_0x3be5('0x6'));exports['login']=passport[_0x3be5('0x7')](_0x3be5('0x8'),{'failureRedirect':_0x3be5('0x9'),'scope':['profile',_0x3be5('0xa')],'session':![]});exports['callback']=passport[_0x3be5('0x7')](_0x3be5('0x8'),{'failureRedirect':_0x3be5('0x9'),'session':![]});passport[_0x3be5('0xb')](new GoogleStrategy({'clientID':config[_0x3be5('0x8')]?config['google']['clientID']:'id','clientSecret':config[_0x3be5('0x8')]?config[_0x3be5('0x8')][_0x3be5('0xc')]:_0x3be5('0xd'),'callbackURL':config['google']?config[_0x3be5('0x8')][_0x3be5('0xe')]:''},function(_0x52e48f,_0xa358f9,_0x55b7e7,_0x328516){var _0xa25786,_0x35c0de;return db[_0x3be5('0xf')]['findOne']({'where':{'id':0x1},'attributes':[_0x3be5('0x10'),_0x3be5('0x11')],'raw':!![]})['then'](function(_0x1439ff){_0xa25786=_0x1439ff;return db[_0x3be5('0x12')]['find']({'where':{'email':_[_0x3be5('0x13')](_0x55b7e7[_0x3be5('0x14')],'value'),'role':{'$or':['admin',_0x3be5('0x15'),_0x3be5('0x16')]}}});})['then'](function(_0x49acca){_0x35c0de=_0x49acca;if(_0x35c0de){if(_0x35c0de[_0x3be5('0x17')]){return _0x328516(_0x3be5('0x18'));}else if(_0xa25786[_0x3be5('0x11')]>0x0){if(_0x35c0de[_0x3be5('0x19')]){if(moment(_0x35c0de[_0x3be5('0x1a')])['add'](_0xa25786[_0x3be5('0x11')],_0x3be5('0x1b'))>moment()){return _0x328516(_0x3be5('0x18'));}else{return utils[_0x3be5('0x1c')](_0x35c0de,0x0,![],null)[_0x3be5('0x1d')](function(){return utils[_0x3be5('0x1e')](_0x35c0de);})[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}else{return utils[_0x3be5('0x1e')](_0x35c0de)[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}else{return utils['getLicense'](_0x35c0de)[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}return _0x328516(_0x3be5('0x18'));})['catch'](function(_0x2a1dd8){_0x328516(_0x2a1dd8);});}));
\ No newline at end of file
+var _0x7e27=['use','google','clientID','clientSecret','callbackURL','findOne','allowedLoginAttempts','then','User','find','map','emails','value','admin','user','disabled','blocked','add','blockDuration','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','/login','profile'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x7e27,0x1f3));var _0x77e2=function(_0x33b95d,_0x58007a){_0x33b95d=_0x33b95d-0x0;var _0x48c1e7=_0x7e27[_0x33b95d];return _0x48c1e7;};'use strict';var _=require(_0x77e2('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x77e2('0x1'))[_0x77e2('0x2')];var moment=require(_0x77e2('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x77e2('0x4'));var signToken=require(_0x77e2('0x5'))[_0x77e2('0x6')];var utils=require(_0x77e2('0x7'));exports[_0x77e2('0x8')]=passport['authenticate']('google',{'failureRedirect':_0x77e2('0x9'),'scope':[_0x77e2('0xa'),'email'],'session':![]});exports['callback']=passport['authenticate']('google',{'failureRedirect':_0x77e2('0x9'),'session':![]});passport[_0x77e2('0xb')](new GoogleStrategy({'clientID':config[_0x77e2('0xc')]?config['google'][_0x77e2('0xd')]:'id','clientSecret':config['google']?config[_0x77e2('0xc')][_0x77e2('0xe')]:'secret','callbackURL':config['google']?config[_0x77e2('0xc')][_0x77e2('0xf')]:''},function(_0x4cc2c5,_0x4289f2,_0x4b518c,_0x1f1557){var _0x260e44,_0x487f52;return db['Setting'][_0x77e2('0x10')]({'where':{'id':0x1},'attributes':[_0x77e2('0x11'),'blockDuration'],'raw':!![]})[_0x77e2('0x12')](function(_0x517bfb){_0x260e44=_0x517bfb;return db[_0x77e2('0x13')][_0x77e2('0x14')]({'where':{'email':_[_0x77e2('0x15')](_0x4b518c[_0x77e2('0x16')],_0x77e2('0x17')),'role':{'$or':[_0x77e2('0x18'),_0x77e2('0x19'),'agent']}}});})[_0x77e2('0x12')](function(_0x52389c){_0x487f52=_0x52389c;if(_0x487f52){if(_0x487f52[_0x77e2('0x1a')]){return _0x1f1557('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x260e44['blockDuration']>0x0){if(_0x487f52[_0x77e2('0x1b')]){if(moment(_0x487f52['blockedAt'])[_0x77e2('0x1c')](_0x260e44[_0x77e2('0x1d')],_0x77e2('0x1e'))>moment()){return _0x1f1557(_0x77e2('0x1f'));}else{return utils['clearBlockUser'](_0x487f52,0x0,![],null)[_0x77e2('0x12')](function(){return utils['getLicense'](_0x487f52);})['then'](function(){return _0x1f1557(null,_0x487f52);});}}else{return utils[_0x77e2('0x20')](_0x487f52)[_0x77e2('0x12')](function(){return _0x1f1557(null,_0x487f52);});}}else{return utils[_0x77e2('0x20')](_0x487f52)[_0x77e2('0x12')](function(){return _0x1f1557(null,_0x487f52);});}}return _0x1f1557(_0x77e2('0x1f'));})[_0x77e2('0x21')](function(_0x5b1146){_0x1f1557(_0x5b1146);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 6a16d7d..423e2f6 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 _0x24d3=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x4efe2c,_0x4e01b0){var _0x146de7=function(_0x43216f){while(--_0x43216f){_0x4efe2c['push'](_0x4efe2c['shift']());}};_0x146de7(++_0x4e01b0);}(_0x24d3,0xcf));var _0x324d=function(_0x428751,_0x1eb9c3){_0x428751=_0x428751-0x0;var _0x147aff=_0x24d3[_0x428751];return _0x147aff;};'use strict';var express=require(_0x324d('0x0'));var passport=require(_0x324d('0x1'));var router=express[_0x324d('0x2')]();var controller=require(_0x324d('0x3'));var userController=require(_0x324d('0x4'));var authService=require(_0x324d('0x5'));router[_0x324d('0x6')]('/',controller[_0x324d('0x7')]);router['get'](_0x324d('0x8'),controller['callback'],authService[_0x324d('0x9')],userController[_0x324d('0x7')],authService[_0x324d('0xa')]);module[_0x324d('0xb')]=router;
\ No newline at end of file
+var _0xde88=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','Router','../user/user.controller.js'];(function(_0x40ef1f,_0x28e7a2){var _0x3a4704=function(_0x3b6878){while(--_0x3b6878){_0x40ef1f['push'](_0x40ef1f['shift']());}};_0x3a4704(++_0x28e7a2);}(_0xde88,0x8c));var _0x8de8=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0xde88[_0x3ef2d5];return _0x2fefb2;};'use strict';var express=require(_0x8de8('0x0'));var passport=require('passport');var router=express[_0x8de8('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x8de8('0x2'));var authService=require(_0x8de8('0x3'));router[_0x8de8('0x4')]('/',controller[_0x8de8('0x5')]);router[_0x8de8('0x4')](_0x8de8('0x6'),controller[_0x8de8('0x7')],authService[_0x8de8('0x8')],userController['login'],authService[_0x8de8('0x9')]);module[_0x8de8('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index a7c26a5..239b851 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 _0xb2e3=['then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','clearBlockUser','blocked','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts'];(function(_0x38fe24,_0x239dd9){var _0x245a09=function(_0x58862a){while(--_0x58862a){_0x38fe24['push'](_0x38fe24['shift']());}};_0x245a09(++_0x239dd9);}(_0xb2e3,0xf9));var _0x3b2e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2e3[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0x3b2e('0x0'));var passport=require(_0x3b2e('0x1'));var LocalStrategy=require(_0x3b2e('0x2'))[_0x3b2e('0x3')];var jayson=require(_0x3b2e('0x4'));var _=require(_0x3b2e('0x5'));var rs=require(_0x3b2e('0x6'));var moment=require('moment');var db=require(_0x3b2e('0x7'))['db'];var authService=require(_0x3b2e('0x8'));var utils=require(_0x3b2e('0x9'));var client=jayson[_0x3b2e('0xa')][_0x3b2e('0xb')]({'port':0x232b});function localAuthenticate(_0x44a2f2,_0x52a011,_0x1b6c7b,_0x3f0b9b){var _0x1191c4,_0x3f8b69;return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'where':{'id':0x1},'attributes':[_0x3b2e('0xe'),'blockDuration'],'raw':!![]})[_0x3b2e('0xf')](function(_0x17d3f4){_0x1191c4=_0x17d3f4;return _0x44a2f2[_0x3b2e('0xd')]({'attributes':['id',_0x3b2e('0x10'),_0x3b2e('0x11'),_0x3b2e('0x12'),_0x3b2e('0x13'),_0x3b2e('0x14'),'blocked',_0x3b2e('0x15'),_0x3b2e('0x16')],'where':{'name':_0x52a011,'role':{'$or':[_0x3b2e('0x17'),_0x3b2e('0x18'),_0x3b2e('0x19')]}}});})[_0x3b2e('0xf')](function(_0x4e2ff0){if(!_0x4e2ff0||_0x4e2ff0&&_0x4e2ff0[_0x3b2e('0x10')]!==_0x52a011){throw new Error(_0x3b2e('0x1a'));}else{_0x3f8b69=_0x4e2ff0;return _0x3f8b69;}})[_0x3b2e('0xf')](function(){_0x3f8b69['authenticate'](_0x1b6c7b,function(_0x37591c,_0x467925){var _0x256658=_0x3f8b69['loginAttempts']+0x1;if(_0x37591c){return _0x3f0b9b(_0x37591c);}else if(!_0x467925){if(_0x3f8b69[_0x3b2e('0x14')]){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else if(_0x1191c4[_0x3b2e('0xe')]>0x0){if(_0x3f8b69['blocked']){if(_0x1191c4[_0x3b2e('0x1b')]>0x0){if(moment(_0x3f8b69[_0x3b2e('0x15')])['add'](_0x1191c4['blockDuration'],'minutes')>moment()){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,_0x256658,![],null)['then'](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}}else{return _0x3f0b9b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x256658>=_0x1191c4[_0x3b2e('0xe')]){return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,!![],moment())[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,_0x256658,![],null)[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}}}else{return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}}else{if(_0x3f8b69['disabled']){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else if(_0x1191c4['allowedLoginAttempts']>0x0){if(_0x3f8b69[_0x3b2e('0x1d')]){if(_0x1191c4[_0x3b2e('0x1b')]>0x0){if(moment(_0x3f8b69[_0x3b2e('0x15')])['add'](_0x1191c4[_0x3b2e('0x1b')],_0x3b2e('0x1e'))>moment()){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,![],null)[_0x3b2e('0xf')](function(){return utils[_0x3b2e('0x1f')](_0x3f8b69);})[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,_0x3f8b69);});}}else{return _0x3f0b9b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,![],null)['then'](function(){return utils[_0x3b2e('0x1f')](_0x3f8b69);})['then'](function(){return _0x3f0b9b(null,_0x3f8b69);})[_0x3b2e('0x20')](function(_0xbbe540){return _0x3f0b9b(null,![],_0xbbe540);});}}else{if(_0x3f8b69[_0x3b2e('0x1d')]){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1f')](_0x3f8b69)[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,_0x3f8b69);});}}}});})[_0x3b2e('0x20')](function(_0xf119a4){return _0x3f0b9b(null,![],_0xf119a4);});}function sendServiceMail(_0x19d381){return db[_0x3b2e('0x21')][_0x3b2e('0x22')]({'where':{'service':!![]},'attributes':['id',_0x3b2e('0x10'),_0x3b2e('0x23')],'include':[{'model':db[_0x3b2e('0x24')],'as':'Smtp'}]})[_0x3b2e('0xf')](function(_0xf2a6f7){if(!_0xf2a6f7){throw new Error(_0x3b2e('0x25'));}var _0x434f52={'tls':{'rejectUnauthorized':![]}};if(_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x27')]){_0x434f52[_0x3b2e('0x27')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x27')];}else{_0x434f52[_0x3b2e('0x28')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x28')];_0x434f52[_0x3b2e('0x29')]=_0xf2a6f7['Smtp'][_0x3b2e('0x29')];_0x434f52[_0x3b2e('0x2a')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2a')];}if(_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2b')]){_0x434f52[_0x3b2e('0x2c')]={'user':_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x18')],'pass':_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2d')]};}var _0x2f107e={'account':_0x434f52,'message':_['merge']({'from':util['format'](_0x3b2e('0x2e'),_0xf2a6f7[_0x3b2e('0x10')],_0xf2a6f7[_0x3b2e('0x23')]||_0xf2a6f7[_0x3b2e('0x26')]['user'])},_0x19d381)};return client['request']('SendMail',_0x2f107e);})[_0x3b2e('0xf')](function(_0x1f0610){if(_0x1f0610[_0x3b2e('0x2f')]){throw new Error(util['format'](_0x3b2e('0x30'),_0x1f0610[_0x3b2e('0x2f')][_0x3b2e('0x31')]||JSON['stringify'](_0x1f0610[_0x3b2e('0x2f')])));}return!![];});}function handleError(_0xad25b2,_0x1d0a49,_0x811993){return _0xad25b2['status'](_0x1d0a49||0x1f4)[_0x3b2e('0x32')]({'message':_0x811993?_0x811993[_0x3b2e('0x31')]||_0x811993:''});}exports['login']=function(_0x57bf73,_0x487db1,_0x383bd1){passport[_0x3b2e('0x33')]('local',function(_0x3a281f,_0x58f05d,_0x421290){var _0x48ca40=_0x3a281f||_0x421290;if(_0x48ca40){return handleError(_0x487db1,0x191,_0x48ca40);}if(!_0x58f05d){return handleError(_0x487db1,0x194,{'message':_0x3b2e('0x34')});}else{var _0x899523={'payload':{'id':_0x58f05d['id'],'role':_0x58f05d[_0x3b2e('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x3b2e('0x35')](_0x899523)[_0x3b2e('0xf')](function(_0x18808a){_0x487db1['json']({'id':_0x58f05d['id'],'token':_0x18808a,'statusCall':'','isAlreadyLogged':_0x58f05d[_0x3b2e('0x36')]});});}})(_0x57bf73,_0x487db1,_0x383bd1);};exports[_0x3b2e('0x37')]=function(_0x194609,_0x451f68,_0x2633ae){if(!_0x194609[_0x3b2e('0x38')][_0x3b2e('0x23')]){return handleError(_0x451f68,0x1f4,{'message':_0x3b2e('0x39')});}var _0x29498c=rs[_0x3b2e('0x3a')]();_0x194609['body'][_0x3b2e('0x23')]=_0x194609['body'][_0x3b2e('0x23')][_0x3b2e('0x3b')]()[_0x3b2e('0x3c')]();var _0x35549c;return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'where':{'id':0x1},'attributes':[_0x3b2e('0xe'),'blockDuration'],'raw':!![]})[_0x3b2e('0xf')](function(_0x249b3f){_0x35549c=_0x249b3f;return db[_0x3b2e('0x3d')][_0x3b2e('0x22')]({'where':{'email':_0x194609[_0x3b2e('0x38')][_0x3b2e('0x23')]}});})['then'](function(_0x3b3ee6){if(!_0x3b3ee6){throw new Error(_0x3b2e('0x3e'));}if(_0x3b3ee6[_0x3b2e('0x14')]){throw new Error(_0x3b2e('0x3f'));}if(_0x3b3ee6[_0x3b2e('0x1d')]){if(moment(_0x3b3ee6['blockedAt'])[_0x3b2e('0x40')](_0x35549c[_0x3b2e('0x1b')],'minutes')>moment()){throw new Error(_0x3b2e('0x41'));}else{_0x3b3ee6[_0x3b2e('0x1d')]=![];_0x3b3ee6[_0x3b2e('0x15')]=null;}}_0x3b3ee6[_0x3b2e('0x42')]=_0x29498c;_0x3b3ee6[_0x3b2e('0x43')]=Date['now']()+0x36ee80;return _0x3b3ee6['save']();})[_0x3b2e('0xf')](function(){return sendServiceMail({'to':_0x194609[_0x3b2e('0x38')]['email'],'subject':_0x3b2e('0x44'),'text':_0x3b2e('0x45')+_0x3b2e('0x46')+_0x3b2e('0x47')+_0x194609[_0x3b2e('0x48')][_0x3b2e('0x28')]+_0x3b2e('0x49')+_0x29498c+'\x0a\x0a'+_0x3b2e('0x4a')});})['then'](function(){_0x451f68[_0x3b2e('0x4b')](0xc8)[_0x3b2e('0x32')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x12cc5f){return handleError(_0x451f68,0x1f4,_0x12cc5f);});};exports['reset']=function(_0x42a43b,_0x1f05c1,_0x235c5a){return db[_0x3b2e('0x3d')][_0x3b2e('0x22')]({'where':{'resetPasswordToken':_0x42a43b[_0x3b2e('0x4c')][_0x3b2e('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x3b2e('0x4e')]()}}})[_0x3b2e('0xf')](function(_0x542b33){if(!_0x542b33){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'attributes':['id',_0x3b2e('0x4f'),_0x3b2e('0x50'),_0x3b2e('0x51')]})[_0x3b2e('0xf')](function(_0x1f05b2){if(_0x1f05b2[_0x3b2e('0x4f')])authService[_0x3b2e('0x52')](_0x42a43b[_0x3b2e('0x38')]['password']);if(!_0x1f05b2['enforcePasswordHistory']||!_0x542b33[_0x3b2e('0x53')])return _0x542b33;authService[_0x3b2e('0x54')](_0x42a43b[_0x3b2e('0x38')][_0x3b2e('0x11')],_0x542b33[_0x3b2e('0x53')],_0x1f05b2['passwordHistoryLimit']);return _0x542b33;})[_0x3b2e('0xf')](function(){_0x542b33[_0x3b2e('0x11')]=_0x42a43b[_0x3b2e('0x38')][_0x3b2e('0x11')];_0x542b33[_0x3b2e('0x42')]=null;_0x542b33[_0x3b2e('0x43')]=null;return _0x542b33[_0x3b2e('0x55')]();});})[_0x3b2e('0xf')](function(){_0x1f05c1[_0x3b2e('0x4b')](0xc8)[_0x3b2e('0x32')]({'message':_0x3b2e('0x56')});})[_0x3b2e('0x20')](function(_0x3ece9f){return handleError(_0x1f05c1,0x1f4,_0x3ece9f);});};passport[_0x3b2e('0x57')](new LocalStrategy({'usernameField':_0x3b2e('0x10'),'passwordField':_0x3b2e('0x11')},function(_0x5033f2,_0x34869d,_0x5cfb10){return localAuthenticate(db['User'],_0x5033f2,_0x34869d,_0x5cfb10);}));
\ No newline at end of file
+var _0xe01d=['catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local','signToken','json','body','Email\x20parameter\x20is\x20missing','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','send','params','token','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','client','http','findOne','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blocked','add','minutes','clearBlockUser','getLicense'];(function(_0x23bf21,_0x284f3b){var _0x27636c=function(_0x533056){while(--_0x533056){_0x23bf21['push'](_0x23bf21['shift']());}};_0x27636c(++_0x284f3b);}(_0xe01d,0x1c2));var _0xde01=function(_0x29f6f8,_0x370292){_0x29f6f8=_0x29f6f8-0x0;var _0x379929=_0xe01d[_0x29f6f8];return _0x379929;};'use strict';var util=require(_0xde01('0x0'));var passport=require('passport');var LocalStrategy=require(_0xde01('0x1'))[_0xde01('0x2')];var jayson=require(_0xde01('0x3'));var _=require(_0xde01('0x4'));var rs=require(_0xde01('0x5'));var moment=require(_0xde01('0x6'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xde01('0x7')][_0xde01('0x8')]({'port':0x232b});function localAuthenticate(_0x331de0,_0xfc08f3,_0x3f2872,_0x1cd33e){var _0x557d52,_0xa416aa;return db['Setting'][_0xde01('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xde01('0xa')],'raw':!![]})[_0xde01('0xb')](function(_0x1522c8){_0x557d52=_0x1522c8;return _0x331de0[_0xde01('0x9')]({'attributes':['id',_0xde01('0xc'),_0xde01('0xd'),_0xde01('0xe'),_0xde01('0xf'),_0xde01('0x10'),'blocked',_0xde01('0x11'),_0xde01('0x12')],'where':{'name':_0xfc08f3,'role':{'$or':[_0xde01('0x13'),_0xde01('0x14'),_0xde01('0x15')]}}});})[_0xde01('0xb')](function(_0x563b5a){if(!_0x563b5a||_0x563b5a&&_0x563b5a[_0xde01('0xc')]!==_0xfc08f3){throw new Error(_0xde01('0x16'));}else{_0xa416aa=_0x563b5a;return _0xa416aa;}})[_0xde01('0xb')](function(){_0xa416aa[_0xde01('0x17')](_0x3f2872,function(_0xe3a2d3,_0xeb9e67){var _0x4b471f=_0xa416aa[_0xde01('0x12')]+0x1;if(_0xe3a2d3){return _0x1cd33e(_0xe3a2d3);}else if(!_0xeb9e67){if(_0xa416aa[_0xde01('0x10')]){return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x557d52[_0xde01('0x18')]>0x0){if(_0xa416aa[_0xde01('0x19')]){if(_0x557d52[_0xde01('0xa')]>0x0){if(moment(_0xa416aa['blockedAt'])[_0xde01('0x1a')](_0x557d52[_0xde01('0xa')],_0xde01('0x1b'))>moment()){return _0x1cd33e(null,![],{'message':_0xde01('0x16')});}else{return utils[_0xde01('0x1c')](_0xa416aa,_0x4b471f,![],null)[_0xde01('0xb')](function(){return _0x1cd33e(null,![],{'message':_0xde01('0x16')});});}}else{return _0x1cd33e(null,![],{'message':_0xde01('0x16')});}}else{if(_0x4b471f>=_0x557d52[_0xde01('0x18')]){return utils[_0xde01('0x1c')](_0xa416aa,0x0,!![],moment())[_0xde01('0xb')](function(){return _0x1cd33e(null,![],{'message':_0xde01('0x16')});});}else{return utils['clearBlockUser'](_0xa416aa,_0x4b471f,![],null)[_0xde01('0xb')](function(){return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xa416aa['disabled']){return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x557d52[_0xde01('0x18')]>0x0){if(_0xa416aa[_0xde01('0x19')]){if(_0x557d52['blockDuration']>0x0){if(moment(_0xa416aa[_0xde01('0x11')])[_0xde01('0x1a')](_0x557d52[_0xde01('0xa')],_0xde01('0x1b'))>moment()){return _0x1cd33e(null,![],{'message':_0xde01('0x16')});}else{return utils[_0xde01('0x1c')](_0xa416aa,0x0,![],null)[_0xde01('0xb')](function(){return utils[_0xde01('0x1d')](_0xa416aa);})['then'](function(){return _0x1cd33e(null,_0xa416aa);});}}else{return _0x1cd33e(null,![],{'message':_0xde01('0x16')});}}else{return utils[_0xde01('0x1c')](_0xa416aa,0x0,![],null)[_0xde01('0xb')](function(){return utils[_0xde01('0x1d')](_0xa416aa);})[_0xde01('0xb')](function(){return _0x1cd33e(null,_0xa416aa);})[_0xde01('0x1e')](function(_0x3b2299){return _0x1cd33e(null,![],_0x3b2299);});}}else{if(_0xa416aa[_0xde01('0x19')]){return _0x1cd33e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0xa416aa)[_0xde01('0xb')](function(){return _0x1cd33e(null,_0xa416aa);});}}}});})[_0xde01('0x1e')](function(_0x25d259){return _0x1cd33e(null,![],_0x25d259);});}function sendServiceMail(_0x149652){return db[_0xde01('0x1f')][_0xde01('0x20')]({'where':{'service':!![]},'attributes':['id',_0xde01('0xc'),_0xde01('0x21')],'include':[{'model':db[_0xde01('0x22')],'as':'Smtp'}]})[_0xde01('0xb')](function(_0x2ac2d4){if(!_0x2ac2d4){throw new Error(_0xde01('0x23'));}var _0x55355e={'tls':{'rejectUnauthorized':![]}};if(_0x2ac2d4[_0xde01('0x24')]['service']){_0x55355e[_0xde01('0x25')]=_0x2ac2d4['Smtp'][_0xde01('0x25')];}else{_0x55355e['host']=_0x2ac2d4[_0xde01('0x24')][_0xde01('0x26')];_0x55355e[_0xde01('0x27')]=_0x2ac2d4[_0xde01('0x24')][_0xde01('0x27')];_0x55355e[_0xde01('0x28')]=_0x2ac2d4[_0xde01('0x24')][_0xde01('0x28')];}if(_0x2ac2d4['Smtp']['authentication']){_0x55355e[_0xde01('0x29')]={'user':_0x2ac2d4[_0xde01('0x24')]['user'],'pass':_0x2ac2d4[_0xde01('0x24')][_0xde01('0x2a')]};}var _0x1dda89={'account':_0x55355e,'message':_[_0xde01('0x2b')]({'from':util[_0xde01('0x2c')](_0xde01('0x2d'),_0x2ac2d4[_0xde01('0xc')],_0x2ac2d4[_0xde01('0x21')]||_0x2ac2d4['Smtp'][_0xde01('0x14')])},_0x149652)};return client['request'](_0xde01('0x2e'),_0x1dda89);})['then'](function(_0x372b57){if(_0x372b57[_0xde01('0x2f')]){throw new Error(util['format'](_0xde01('0x30'),_0x372b57[_0xde01('0x2f')][_0xde01('0x31')]||JSON[_0xde01('0x32')](_0x372b57[_0xde01('0x2f')])));}return!![];});}function handleError(_0x5450fd,_0x447744,_0x3e2be2){return _0x5450fd[_0xde01('0x33')](_0x447744||0x1f4)['send']({'message':_0x3e2be2?_0x3e2be2[_0xde01('0x31')]||_0x3e2be2:''});}exports[_0xde01('0x34')]=function(_0xf71815,_0x7d9daa,_0xc99983){passport[_0xde01('0x17')](_0xde01('0x35'),function(_0x4f3478,_0x3ae835,_0x4839d5){var _0x4ea1a9=_0x4f3478||_0x4839d5;if(_0x4ea1a9){return handleError(_0x7d9daa,0x191,_0x4ea1a9);}if(!_0x3ae835){return handleError(_0x7d9daa,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2f6d1b={'payload':{'id':_0x3ae835['id'],'role':_0x3ae835[_0xde01('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xde01('0x36')](_0x2f6d1b)[_0xde01('0xb')](function(_0x48f3a5){_0x7d9daa[_0xde01('0x37')]({'id':_0x3ae835['id'],'token':_0x48f3a5,'statusCall':'','isAlreadyLogged':_0x3ae835['online']});});}})(_0xf71815,_0x7d9daa,_0xc99983);};exports['forgot']=function(_0x5b87da,_0x1abd14,_0x2f0a07){if(!_0x5b87da[_0xde01('0x38')][_0xde01('0x21')]){return handleError(_0x1abd14,0x1f4,{'message':_0xde01('0x39')});}var _0x27863b=rs['generate']();_0x5b87da[_0xde01('0x38')]['email']=_0x5b87da[_0xde01('0x38')][_0xde01('0x21')]['trim']()[_0xde01('0x3a')]();var _0x5dad68;return db[_0xde01('0x3b')]['findOne']({'where':{'id':0x1},'attributes':[_0xde01('0x18'),_0xde01('0xa')],'raw':!![]})[_0xde01('0xb')](function(_0xb8cc6d){_0x5dad68=_0xb8cc6d;return db[_0xde01('0x3c')][_0xde01('0x20')]({'where':{'email':_0x5b87da[_0xde01('0x38')][_0xde01('0x21')]}});})[_0xde01('0xb')](function(_0x4428c6){if(!_0x4428c6){throw new Error(_0xde01('0x3d'));}if(_0x4428c6[_0xde01('0x10')]){throw new Error(_0xde01('0x3e'));}if(_0x4428c6['blocked']){if(moment(_0x4428c6[_0xde01('0x11')])['add'](_0x5dad68['blockDuration'],_0xde01('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4428c6[_0xde01('0x19')]=![];_0x4428c6[_0xde01('0x11')]=null;}}_0x4428c6[_0xde01('0x3f')]=_0x27863b;_0x4428c6[_0xde01('0x40')]=Date[_0xde01('0x41')]()+0x36ee80;return _0x4428c6['save']();})[_0xde01('0xb')](function(){return sendServiceMail({'to':_0x5b87da[_0xde01('0x38')][_0xde01('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xde01('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xde01('0x43')+_0x5b87da[_0xde01('0x44')]['host']+_0xde01('0x45')+_0x27863b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xde01('0xb')](function(){_0x1abd14[_0xde01('0x33')](0xc8)[_0xde01('0x46')]({'message':'Reset\x20Email\x20sent!'});})[_0xde01('0x1e')](function(_0x1bcb6e){return handleError(_0x1abd14,0x1f4,_0x1bcb6e);});};exports['reset']=function(_0x56352e,_0x279502,_0x347903){return db[_0xde01('0x3c')][_0xde01('0x20')]({'where':{'resetPasswordToken':_0x56352e[_0xde01('0x47')][_0xde01('0x48')],'resetPasswordExpires':{'$gt':Date[_0xde01('0x41')]()}}})[_0xde01('0xb')](function(_0x198d80){if(!_0x198d80){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xde01('0x3b')][_0xde01('0x9')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xde01('0x49')]})['then'](function(_0x39503a){if(_0x39503a[_0xde01('0x4a')])authService['validatePasswordPattern'](_0x56352e['body'][_0xde01('0xd')]);if(!_0x39503a['enforcePasswordHistory']||!_0x198d80[_0xde01('0x4b')])return _0x198d80;authService[_0xde01('0x4c')](_0x56352e[_0xde01('0x38')][_0xde01('0xd')],_0x198d80[_0xde01('0x4b')],_0x39503a[_0xde01('0x49')]);return _0x198d80;})[_0xde01('0xb')](function(){_0x198d80[_0xde01('0xd')]=_0x56352e[_0xde01('0x38')]['password'];_0x198d80['resetPasswordToken']=null;_0x198d80[_0xde01('0x40')]=null;return _0x198d80[_0xde01('0x4d')]();});})[_0xde01('0xb')](function(){_0x279502[_0xde01('0x33')](0xc8)['send']({'message':_0xde01('0x4e')});})[_0xde01('0x1e')](function(_0x1d4425){return handleError(_0x279502,0x1f4,_0x1d4425);});};passport[_0xde01('0x4f')](new LocalStrategy({'usernameField':_0xde01('0xc'),'passwordField':_0xde01('0xd')},function(_0x57f025,_0x2c2913,_0x4c3e48){return localAuthenticate(db[_0xde01('0x3c')],_0x57f025,_0x2c2913,_0x4c3e48);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a855aa6..5067479 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 _0x6f46=['exports','express','Router','./authLocal.controller','post','login','forgot','/reset/:token','reset'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x6f46,0x10f));var _0x66f4=function(_0xda5c7c,_0x40f3b4){_0xda5c7c=_0xda5c7c-0x0;var _0x2bb2c2=_0x6f46[_0xda5c7c];return _0x2bb2c2;};'use strict';var express=require(_0x66f4('0x0'));var router=express[_0x66f4('0x1')]();var controller=require(_0x66f4('0x2'));router[_0x66f4('0x3')]('/',controller[_0x66f4('0x4')]);router[_0x66f4('0x3')]('/forgot',controller[_0x66f4('0x5')]);router[_0x66f4('0x3')](_0x66f4('0x6'),controller[_0x66f4('0x7')]);module[_0x66f4('0x8')]=router;
\ No newline at end of file
+var _0x494c=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x1d80ec,_0x4caf89){var _0x5561f0=function(_0x141a43){while(--_0x141a43){_0x1d80ec['push'](_0x1d80ec['shift']());}};_0x5561f0(++_0x4caf89);}(_0x494c,0x1c1));var _0xc494=function(_0x13122e,_0x5524a6){_0x13122e=_0x13122e-0x0;var _0x5f54a6=_0x494c[_0x13122e];return _0x5f54a6;};'use strict';var express=require(_0xc494('0x0'));var router=express[_0xc494('0x1')]();var controller=require(_0xc494('0x2'));router[_0xc494('0x3')]('/',controller[_0xc494('0x4')]);router['post'](_0xc494('0x5'),controller[_0xc494('0x6')]);router[_0xc494('0x3')](_0xc494('0x7'),controller[_0xc494('0x8')]);module[_0xc494('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index e160958..4daf49c 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 _0x3a3e=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x225c0b,_0x1cbbc5){var _0x37c039=function(_0x519219){while(--_0x519219){_0x225c0b['push'](_0x225c0b['shift']());}};_0x37c039(++_0x1cbbc5);}(_0x3a3e,0x13b));var _0xe3a3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x3a3e[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0xe3a3('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3a3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe3a3('0x1')]},'description':{'type':Sequelize[_0xe3a3('0x1')]},'status':{'type':Sequelize[_0xe3a3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe3a3('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3016=['exports','STRING','BOOLEAN','sequelize'];(function(_0x29fc9f,_0x40409f){var _0xc7faad=function(_0x26ac31){while(--_0x26ac31){_0x29fc9f['push'](_0x29fc9f['shift']());}};_0xc7faad(++_0x40409f);}(_0x3016,0x143));var _0x6301=function(_0x27b156,_0x3b1c2c){_0x27b156=_0x27b156-0x0;var _0x15db45=_0x3016[_0x27b156];return _0x15db45;};'use strict';var Sequelize=require(_0x6301('0x0'));module[_0x6301('0x1')]={'name':{'type':Sequelize[_0x6301('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6301('0x2')]},'status':{'type':Sequelize[_0x6301('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 f19cfc5..3008020 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 _0x8329=['filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','Condition','addConditions','ids','getConditions','findOne','addActions','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','stack','name','send','index','map','Automation','rawAttributes','key','model','query','keys','intersection','fields','length','attributes','nolimit','limit','order','sort','where'];(function(_0x46032a,_0xaca6f8){var _0x12766f=function(_0x52cb8d){while(--_0x52cb8d){_0x46032a['push'](_0x46032a['shift']());}};_0x12766f(++_0xaca6f8);}(_0x8329,0x1c0));var _0x9832=function(_0x41cc65,_0x5760d4){_0x41cc65=_0x41cc65-0x0;var _0xae75e9=_0x8329[_0x41cc65];return _0xae75e9;};'use strict';var emlformat=require(_0x9832('0x0'));var rimraf=require(_0x9832('0x1'));var zipdir=require(_0x9832('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9832('0x3'));var moment=require('moment');var BPromise=require(_0x9832('0x4'));var Mustache=require(_0x9832('0x5'));var util=require(_0x9832('0x6'));var path=require(_0x9832('0x7'));var sox=require(_0x9832('0x8'));var csv=require('to-csv');var ejs=require(_0x9832('0x9'));var fs=require('fs');var fs_extra=require(_0x9832('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9832('0xb'));var jsforce=require(_0x9832('0xc'));var deskjs=require(_0x9832('0xd'));var toCsv=require(_0x9832('0xe'));var querystring=require(_0x9832('0xf'));var Papa=require(_0x9832('0x10'));var Redis=require(_0x9832('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9832('0x12'));var hardwareService=require(_0x9832('0x13'));var logger=require(_0x9832('0x14'))(_0x9832('0x15'));var utils=require(_0x9832('0x16'));var config=require(_0x9832('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9832('0x18'))['db'];function respondWithStatusCode(_0x2f7bd8,_0x10498c){_0x10498c=_0x10498c||0xcc;return function(_0x297a58){if(_0x297a58){return _0x2f7bd8[_0x9832('0x19')](_0x10498c);}return _0x2f7bd8[_0x9832('0x1a')](_0x10498c)[_0x9832('0x1b')]();};}function respondWithResult(_0x5473af,_0x58b21c){_0x58b21c=_0x58b21c||0xc8;return function(_0x6a915){if(_0x6a915){return _0x5473af[_0x9832('0x1a')](_0x58b21c)[_0x9832('0x1c')](_0x6a915);}};}function respondWithFilteredResult(_0x15fd29,_0x58f974){return function(_0x1285ef){if(_0x1285ef){var _0x3faacd=typeof _0x58f974[_0x9832('0x1d')]===_0x9832('0x1e')&&typeof _0x58f974['limit']===_0x9832('0x1e');var _0x4a1360=_0x1285ef[_0x9832('0x1f')];var _0x41a135=_0x3faacd?0x0:_0x58f974[_0x9832('0x1d')];var _0x182814=_0x3faacd?_0x1285ef['count']:_0x58f974[_0x9832('0x1d')]+_0x58f974['limit'];var _0x78df03;if(_0x182814>=_0x4a1360){_0x182814=_0x4a1360;_0x78df03=0xc8;}else{_0x78df03=0xce;}_0x15fd29['status'](_0x78df03);return _0x15fd29[_0x9832('0x20')]('Content-Range',_0x41a135+'-'+_0x182814+'/'+_0x4a1360)[_0x9832('0x1c')](_0x1285ef);}return null;};}function patchUpdates(_0xdc12ef){return function(_0x13ccd3){try{jsonpatch['apply'](_0x13ccd3,_0xdc12ef,!![]);}catch(_0x175fd2){return BPromise[_0x9832('0x21')](_0x175fd2);}return _0x13ccd3[_0x9832('0x22')]();};}function saveUpdates(_0x53f6fe,_0x2f8fd8){return function(_0x46e1f4){if(_0x46e1f4){return _0x46e1f4[_0x9832('0x23')](_0x53f6fe)['then'](function(_0x3213a4){return _0x3213a4;});}return null;};}function removeEntity(_0x42b416,_0x5ecc9c){return function(_0x17fbc2){if(_0x17fbc2){return _0x17fbc2['destroy']()['then'](function(){_0x42b416['status'](0xcc)[_0x9832('0x1b')]();});}};}function handleEntityNotFound(_0x4f75fc,_0x316d50){return function(_0x259d90){if(!_0x259d90){_0x4f75fc[_0x9832('0x19')](0x194);}return _0x259d90;};}function handleError(_0x17bb0c,_0x5e6940){_0x5e6940=_0x5e6940||0x1f4;return function(_0x1eceb6){logger['error'](_0x1eceb6[_0x9832('0x24')]);if(_0x1eceb6[_0x9832('0x25')]){delete _0x1eceb6[_0x9832('0x25')];}_0x17bb0c[_0x9832('0x1a')](_0x5e6940)[_0x9832('0x26')](_0x1eceb6);};}exports[_0x9832('0x27')]=function(_0x54dda7,_0x52cc3d){var _0xc1aeb4={},_0xa845f0={},_0x421340={'count':0x0,'rows':[]};var _0x5cb12b=_[_0x9832('0x28')](db[_0x9832('0x29')][_0x9832('0x2a')],function(_0x4303b2){return{'name':_0x4303b2['fieldName'],'type':_0x4303b2['type'][_0x9832('0x2b')]};});_0xa845f0[_0x9832('0x2c')]=_[_0x9832('0x28')](_0x5cb12b,_0x9832('0x25'));_0xa845f0[_0x9832('0x2d')]=_[_0x9832('0x2e')](_0x54dda7[_0x9832('0x2d')]);_0xa845f0['filters']=_[_0x9832('0x2f')](_0xa845f0[_0x9832('0x2c')],_0xa845f0['query']);_0xc1aeb4['attributes']=_[_0x9832('0x2f')](_0xa845f0[_0x9832('0x2c')],qs['fields'](_0x54dda7[_0x9832('0x2d')][_0x9832('0x30')]));_0xc1aeb4['attributes']=_0xc1aeb4['attributes'][_0x9832('0x31')]?_0xc1aeb4[_0x9832('0x32')]:_0xa845f0[_0x9832('0x2c')];if(!_0x54dda7['query']['hasOwnProperty'](_0x9832('0x33'))){_0xc1aeb4[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x54dda7[_0x9832('0x2d')][_0x9832('0x34')]);_0xc1aeb4[_0x9832('0x1d')]=qs[_0x9832('0x1d')](_0x54dda7['query']['offset']);}_0xc1aeb4[_0x9832('0x35')]=qs[_0x9832('0x36')](_0x54dda7[_0x9832('0x2d')][_0x9832('0x36')]);_0xc1aeb4[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x54dda7['query'],_0xa845f0[_0x9832('0x38')]),_0x5cb12b);if(_0x54dda7['query'][_0x9832('0x3a')]){_0xc1aeb4[_0x9832('0x37')]=_[_0x9832('0x3b')](_0xc1aeb4[_0x9832('0x37')],{'$or':_[_0x9832('0x28')](_0x5cb12b,function(_0x39a231){if(_0x39a231[_0x9832('0x3c')]!==_0x9832('0x3d')){var _0x2e50ce={};_0x2e50ce[_0x39a231[_0x9832('0x25')]]={'$like':'%'+_0x54dda7['query']['filter']+'%'};return _0x2e50ce;}})});}_0xc1aeb4=_['merge']({},_0xc1aeb4,_0x54dda7[_0x9832('0x3e')]);var _0x3c3cdc={'where':_0xc1aeb4[_0x9832('0x37')]};return db[_0x9832('0x29')][_0x9832('0x1f')](_0x3c3cdc)[_0x9832('0x3f')](function(_0x22b2b5){_0x421340['count']=_0x22b2b5;if(_0x54dda7[_0x9832('0x2d')][_0x9832('0x40')]){_0xc1aeb4[_0x9832('0x41')]=[{'all':!![]}];}return db[_0x9832('0x29')][_0x9832('0x42')](_0xc1aeb4);})['then'](function(_0x308391){_0x421340[_0x9832('0x43')]=_0x308391;return _0x421340;})['then'](respondWithFilteredResult(_0x52cc3d,_0xc1aeb4))[_0x9832('0x44')](handleError(_0x52cc3d,null));};exports[_0x9832('0x45')]=function(_0x22fc4a,_0x2b2ce8){var _0x54ab25={'raw':![],'where':{'id':_0x22fc4a[_0x9832('0x46')]['id']}},_0x3018b8={};_0x3018b8[_0x9832('0x2c')]=_[_0x9832('0x2e')](db[_0x9832('0x29')][_0x9832('0x2a')]);_0x3018b8['query']=_['keys'](_0x22fc4a[_0x9832('0x2d')]);_0x3018b8[_0x9832('0x38')]=_[_0x9832('0x2f')](_0x3018b8['model'],_0x3018b8[_0x9832('0x2d')]);_0x54ab25['attributes']=_[_0x9832('0x2f')](_0x3018b8['model'],qs[_0x9832('0x30')](_0x22fc4a[_0x9832('0x2d')]['fields']));_0x54ab25['attributes']=_0x54ab25[_0x9832('0x32')][_0x9832('0x31')]?_0x54ab25[_0x9832('0x32')]:_0x3018b8[_0x9832('0x2c')];if(_0x22fc4a[_0x9832('0x2d')]['includeAll']){_0x54ab25[_0x9832('0x41')]=[{'all':!![]}];}_0x54ab25=_[_0x9832('0x3b')]({},_0x54ab25,_0x22fc4a[_0x9832('0x3e')]);return db[_0x9832('0x29')][_0x9832('0x47')](_0x54ab25)[_0x9832('0x3f')](handleEntityNotFound(_0x2b2ce8,null))['then'](respondWithResult(_0x2b2ce8,null))[_0x9832('0x44')](handleError(_0x2b2ce8,null));};exports[_0x9832('0x48')]=function(_0x382007,_0x473080){return db[_0x9832('0x29')][_0x9832('0x48')](_0x382007[_0x9832('0x49')],{})[_0x9832('0x3f')](respondWithResult(_0x473080,0xc9))[_0x9832('0x44')](handleError(_0x473080,null));};exports[_0x9832('0x23')]=function(_0x1e0e0d,_0x3c658b){if(_0x1e0e0d['body']['id']){delete _0x1e0e0d[_0x9832('0x49')]['id'];}return db[_0x9832('0x29')][_0x9832('0x47')]({'where':{'id':_0x1e0e0d[_0x9832('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c658b,null))[_0x9832('0x3f')](saveUpdates(_0x1e0e0d['body'],null))['then'](respondWithResult(_0x3c658b,null))['catch'](handleError(_0x3c658b,null));};exports[_0x9832('0x4a')]=function(_0x49ab3d,_0x184ce4){return db[_0x9832('0x29')]['find']({'where':{'id':_0x49ab3d[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x184ce4,null))['then'](removeEntity(_0x184ce4,null))[_0x9832('0x44')](handleError(_0x184ce4,null));};exports['addConditions']=function(_0x5c4a3a,_0x1184b3,_0x15765a){return db[_0x9832('0x4b')][_0x9832('0x47')]({'where':{'id':_0x5c4a3a[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x1184b3,null))['then'](function(_0x3e8000){if(_0x3e8000){return _0x3e8000[_0x9832('0x4c')](_0x5c4a3a[_0x9832('0x49')]['ids'],_['omit'](_0x5c4a3a['body'],[_0x9832('0x4d'),'id'])||{});}})[_0x9832('0x3f')](respondWithResult(_0x1184b3,null))['catch'](handleError(_0x1184b3,null));};exports[_0x9832('0x4e')]=function(_0x133b44,_0x289e79,_0x162734){var _0x1ff4fc={};var _0x4132bf={};var _0x43ef01;var _0x37ca43;return db['Automation'][_0x9832('0x4f')]({'where':{'id':_0x133b44[_0x9832('0x46')]['id']}})['then'](handleEntityNotFound(_0x289e79,null))[_0x9832('0x3f')](function(_0x36c6bd){if(_0x36c6bd){_0x43ef01=_0x36c6bd;_0x4132bf[_0x9832('0x2c')]=_[_0x9832('0x2e')](db[_0x9832('0x4b')][_0x9832('0x2a')]);_0x4132bf[_0x9832('0x2d')]=_[_0x9832('0x2e')](_0x133b44['query']);_0x4132bf[_0x9832('0x38')]=_[_0x9832('0x2f')](_0x4132bf['model'],_0x4132bf[_0x9832('0x2d')]);_0x1ff4fc['attributes']=_[_0x9832('0x2f')](_0x4132bf[_0x9832('0x2c')],qs[_0x9832('0x30')](_0x133b44[_0x9832('0x2d')]['fields']));_0x1ff4fc['attributes']=_0x1ff4fc[_0x9832('0x32')][_0x9832('0x31')]?_0x1ff4fc[_0x9832('0x32')]:_0x4132bf[_0x9832('0x2c')];_0x1ff4fc['order']=qs[_0x9832('0x36')](_0x133b44[_0x9832('0x2d')][_0x9832('0x36')]);_0x1ff4fc[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x133b44[_0x9832('0x2d')],_0x4132bf[_0x9832('0x38')]));if(_0x133b44['query'][_0x9832('0x3a')]){_0x1ff4fc[_0x9832('0x37')]=_[_0x9832('0x3b')](_0x1ff4fc['where'],{'$or':_['map'](_0x1ff4fc['attributes'],function(_0x21d4f1){var _0x47f239={};_0x47f239[_0x21d4f1]={'$like':'%'+_0x133b44[_0x9832('0x2d')][_0x9832('0x3a')]+'%'};return _0x47f239;})});}_0x1ff4fc=_[_0x9832('0x3b')]({},_0x1ff4fc,_0x133b44[_0x9832('0x3e')]);return _0x43ef01['getConditions'](_0x1ff4fc);}})[_0x9832('0x3f')](function(_0xd6e4c8){if(_0xd6e4c8){_0x37ca43=_0xd6e4c8[_0x9832('0x31')];if(!_0x133b44[_0x9832('0x2d')]['hasOwnProperty'](_0x9832('0x33'))){_0x1ff4fc[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x133b44['query'][_0x9832('0x34')]);_0x1ff4fc[_0x9832('0x1d')]=qs[_0x9832('0x1d')](_0x133b44['query'][_0x9832('0x1d')]);}return _0x43ef01['getConditions'](_0x1ff4fc);}})['then'](function(_0x55712b){if(_0x55712b){return _0x55712b?{'count':_0x37ca43,'rows':_0x55712b}:null;}})[_0x9832('0x3f')](respondWithResult(_0x289e79,null))[_0x9832('0x44')](handleError(_0x289e79,null));};exports[_0x9832('0x50')]=function(_0x3f2f77,_0x42e097,_0x1baddb){return db[_0x9832('0x51')]['find']({'where':{'id':_0x3f2f77['params']['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x42e097,null))[_0x9832('0x3f')](function(_0x387e27){if(_0x387e27){return _0x387e27[_0x9832('0x50')](_0x3f2f77['body'][_0x9832('0x4d')],_['omit'](_0x3f2f77['body'],[_0x9832('0x4d'),'id'])||{});}})[_0x9832('0x3f')](respondWithResult(_0x42e097,null))[_0x9832('0x44')](handleError(_0x42e097,null));};exports[_0x9832('0x52')]=function(_0x2d72ee,_0x216727,_0x4be8dd){var _0x2429ff={};var _0x210724={};var _0x504a06;var _0x177220;return db['Automation'][_0x9832('0x4f')]({'where':{'id':_0x2d72ee[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x216727,null))[_0x9832('0x3f')](function(_0xe962cb){if(_0xe962cb){_0x504a06=_0xe962cb;_0x210724['model']=_[_0x9832('0x2e')](db['Action'][_0x9832('0x2a')]);_0x210724[_0x9832('0x2d')]=_['keys'](_0x2d72ee[_0x9832('0x2d')]);_0x210724[_0x9832('0x38')]=_['intersection'](_0x210724['model'],_0x210724[_0x9832('0x2d')]);_0x2429ff[_0x9832('0x32')]=_['intersection'](_0x210724['model'],qs[_0x9832('0x30')](_0x2d72ee[_0x9832('0x2d')]['fields']));_0x2429ff['attributes']=_0x2429ff[_0x9832('0x32')][_0x9832('0x31')]?_0x2429ff[_0x9832('0x32')]:_0x210724[_0x9832('0x2c')];_0x2429ff['order']=qs[_0x9832('0x36')](_0x2d72ee['query']['sort']);_0x2429ff[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x2d72ee['query'],_0x210724[_0x9832('0x38')]));if(_0x2d72ee[_0x9832('0x2d')][_0x9832('0x3a')]){_0x2429ff['where']=_[_0x9832('0x3b')](_0x2429ff[_0x9832('0x37')],{'$or':_[_0x9832('0x28')](_0x2429ff[_0x9832('0x32')],function(_0x14ef3d){var _0x5f4358={};_0x5f4358[_0x14ef3d]={'$like':'%'+_0x2d72ee[_0x9832('0x2d')]['filter']+'%'};return _0x5f4358;})});}_0x2429ff=_[_0x9832('0x3b')]({},_0x2429ff,_0x2d72ee[_0x9832('0x3e')]);return _0x504a06['getActions'](_0x2429ff);}})[_0x9832('0x3f')](function(_0x45bf3b){if(_0x45bf3b){_0x177220=_0x45bf3b[_0x9832('0x31')];if(!_0x2d72ee[_0x9832('0x2d')][_0x9832('0x53')]('nolimit')){_0x2429ff[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x2d72ee[_0x9832('0x2d')][_0x9832('0x34')]);_0x2429ff[_0x9832('0x1d')]=qs['offset'](_0x2d72ee['query'][_0x9832('0x1d')]);}return _0x504a06['getActions'](_0x2429ff);}})[_0x9832('0x3f')](function(_0x42d17c){if(_0x42d17c){return _0x42d17c?{'count':_0x177220,'rows':_0x42d17c}:null;}})[_0x9832('0x3f')](respondWithResult(_0x216727,null))[_0x9832('0x44')](handleError(_0x216727,null));};
\ No newline at end of file
+var _0xa26a=['count','set','json','apply','reject','destroy','then','end','sendStatus','error','stack','name','send','index','map','Automation','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','addConditions','Condition','ids','omit','findOne','length','nolimit','getConditions','addActions','getActions','Action','eml-format','rimraf','fast-json-patch','bluebird','util','sox','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/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0xa26a,0x88));var _0xaa26=function(_0xff2fc2,_0x47f282){_0xff2fc2=_0xff2fc2-0x0;var _0x58ce3c=_0xa26a[_0xff2fc2];return _0x58ce3c;};'use strict';var emlformat=require(_0xaa26('0x0'));var rimraf=require(_0xaa26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa26('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaa26('0x3'));var Mustache=require('mustache');var util=require(_0xaa26('0x4'));var path=require('path');var sox=require(_0xaa26('0x5'));var csv=require('to-csv');var ejs=require(_0xaa26('0x6'));var fs=require('fs');var fs_extra=require(_0xaa26('0x7'));var _=require(_0xaa26('0x8'));var squel=require(_0xaa26('0x9'));var crypto=require(_0xaa26('0xa'));var jsforce=require(_0xaa26('0xb'));var deskjs=require(_0xaa26('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaa26('0xd'));var Papa=require(_0xaa26('0xe'));var Redis=require(_0xaa26('0xf'));var authService=require(_0xaa26('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaa26('0x11'));var hardwareService=require(_0xaa26('0x12'));var logger=require(_0xaa26('0x13'))(_0xaa26('0x14'));var utils=require('../../config/utils');var config=require(_0xaa26('0x15'));var licenseUtil=require(_0xaa26('0x16'));var db=require(_0xaa26('0x17'))['db'];function respondWithStatusCode(_0x2091a2,_0x247054){_0x247054=_0x247054||0xcc;return function(_0x2c672a){if(_0x2c672a){return _0x2091a2['sendStatus'](_0x247054);}return _0x2091a2[_0xaa26('0x18')](_0x247054)['end']();};}function respondWithResult(_0x2fb735,_0x98ac90){_0x98ac90=_0x98ac90||0xc8;return function(_0x2bf84c){if(_0x2bf84c){return _0x2fb735[_0xaa26('0x18')](_0x98ac90)['json'](_0x2bf84c);}};}function respondWithFilteredResult(_0x2a6e86,_0x213900){return function(_0x225347){if(_0x225347){var _0x2e416a=typeof _0x213900[_0xaa26('0x19')]===_0xaa26('0x1a')&&typeof _0x213900[_0xaa26('0x1b')]===_0xaa26('0x1a');var _0x197f59=_0x225347['count'];var _0x18cc4d=_0x2e416a?0x0:_0x213900['offset'];var _0x4ece07=_0x2e416a?_0x225347[_0xaa26('0x1c')]:_0x213900[_0xaa26('0x19')]+_0x213900[_0xaa26('0x1b')];var _0x557eba;if(_0x4ece07>=_0x197f59){_0x4ece07=_0x197f59;_0x557eba=0xc8;}else{_0x557eba=0xce;}_0x2a6e86['status'](_0x557eba);return _0x2a6e86[_0xaa26('0x1d')]('Content-Range',_0x18cc4d+'-'+_0x4ece07+'/'+_0x197f59)[_0xaa26('0x1e')](_0x225347);}return null;};}function patchUpdates(_0x2cdc10){return function(_0x403f6b){try{jsonpatch[_0xaa26('0x1f')](_0x403f6b,_0x2cdc10,!![]);}catch(_0x2ce87f){return BPromise[_0xaa26('0x20')](_0x2ce87f);}return _0x403f6b['save']();};}function saveUpdates(_0x449906,_0x4572ae){return function(_0x485042){if(_0x485042){return _0x485042['update'](_0x449906)['then'](function(_0x2ada5a){return _0x2ada5a;});}return null;};}function removeEntity(_0x2a9740,_0x383e49){return function(_0x4f8152){if(_0x4f8152){return _0x4f8152[_0xaa26('0x21')]()[_0xaa26('0x22')](function(){_0x2a9740[_0xaa26('0x18')](0xcc)[_0xaa26('0x23')]();});}};}function handleEntityNotFound(_0x482e08,_0x2097a1){return function(_0xd7e5ce){if(!_0xd7e5ce){_0x482e08[_0xaa26('0x24')](0x194);}return _0xd7e5ce;};}function handleError(_0x19202f,_0x5152bf){_0x5152bf=_0x5152bf||0x1f4;return function(_0x1355cd){logger[_0xaa26('0x25')](_0x1355cd[_0xaa26('0x26')]);if(_0x1355cd[_0xaa26('0x27')]){delete _0x1355cd[_0xaa26('0x27')];}_0x19202f[_0xaa26('0x18')](_0x5152bf)[_0xaa26('0x28')](_0x1355cd);};}exports[_0xaa26('0x29')]=function(_0x525219,_0x4c1907){var _0x3052db={},_0x581aed={},_0x4d13d9={'count':0x0,'rows':[]};var _0x4a254b=_[_0xaa26('0x2a')](db[_0xaa26('0x2b')][_0xaa26('0x2c')],function(_0x2d56d4){return{'name':_0x2d56d4['fieldName'],'type':_0x2d56d4[_0xaa26('0x2d')][_0xaa26('0x2e')]};});_0x581aed[_0xaa26('0x2f')]=_['map'](_0x4a254b,'name');_0x581aed['query']=_[_0xaa26('0x30')](_0x525219[_0xaa26('0x31')]);_0x581aed[_0xaa26('0x32')]=_[_0xaa26('0x33')](_0x581aed[_0xaa26('0x2f')],_0x581aed['query']);_0x3052db[_0xaa26('0x34')]=_[_0xaa26('0x33')](_0x581aed['model'],qs[_0xaa26('0x35')](_0x525219['query'][_0xaa26('0x35')]));_0x3052db[_0xaa26('0x34')]=_0x3052db[_0xaa26('0x34')]['length']?_0x3052db[_0xaa26('0x34')]:_0x581aed[_0xaa26('0x2f')];if(!_0x525219[_0xaa26('0x31')][_0xaa26('0x36')]('nolimit')){_0x3052db[_0xaa26('0x1b')]=qs[_0xaa26('0x1b')](_0x525219[_0xaa26('0x31')]['limit']);_0x3052db[_0xaa26('0x19')]=qs[_0xaa26('0x19')](_0x525219['query'][_0xaa26('0x19')]);}_0x3052db[_0xaa26('0x37')]=qs['sort'](_0x525219[_0xaa26('0x31')][_0xaa26('0x38')]);_0x3052db[_0xaa26('0x39')]=qs[_0xaa26('0x32')](_[_0xaa26('0x3a')](_0x525219[_0xaa26('0x31')],_0x581aed[_0xaa26('0x32')]),_0x4a254b);if(_0x525219[_0xaa26('0x31')][_0xaa26('0x3b')]){_0x3052db['where']=_[_0xaa26('0x3c')](_0x3052db[_0xaa26('0x39')],{'$or':_[_0xaa26('0x2a')](_0x4a254b,function(_0x2c378b){if(_0x2c378b[_0xaa26('0x2d')]!==_0xaa26('0x3d')){var _0x594d9b={};_0x594d9b[_0x2c378b[_0xaa26('0x27')]]={'$like':'%'+_0x525219[_0xaa26('0x31')]['filter']+'%'};return _0x594d9b;}})});}_0x3052db=_[_0xaa26('0x3c')]({},_0x3052db,_0x525219[_0xaa26('0x3e')]);var _0x5f137d={'where':_0x3052db[_0xaa26('0x39')]};return db[_0xaa26('0x2b')]['count'](_0x5f137d)[_0xaa26('0x22')](function(_0x1336f7){_0x4d13d9[_0xaa26('0x1c')]=_0x1336f7;if(_0x525219[_0xaa26('0x31')][_0xaa26('0x3f')]){_0x3052db[_0xaa26('0x40')]=[{'all':!![]}];}return db[_0xaa26('0x2b')][_0xaa26('0x41')](_0x3052db);})[_0xaa26('0x22')](function(_0x3980e8){_0x4d13d9['rows']=_0x3980e8;return _0x4d13d9;})['then'](respondWithFilteredResult(_0x4c1907,_0x3052db))[_0xaa26('0x42')](handleError(_0x4c1907,null));};exports[_0xaa26('0x43')]=function(_0x446a89,_0x3af311){var _0x4a1f32={'raw':![],'where':{'id':_0x446a89[_0xaa26('0x44')]['id']}},_0x3f1b44={};_0x3f1b44[_0xaa26('0x2f')]=_[_0xaa26('0x30')](db[_0xaa26('0x2b')]['rawAttributes']);_0x3f1b44[_0xaa26('0x31')]=_['keys'](_0x446a89[_0xaa26('0x31')]);_0x3f1b44['filters']=_[_0xaa26('0x33')](_0x3f1b44[_0xaa26('0x2f')],_0x3f1b44[_0xaa26('0x31')]);_0x4a1f32[_0xaa26('0x34')]=_['intersection'](_0x3f1b44[_0xaa26('0x2f')],qs['fields'](_0x446a89[_0xaa26('0x31')][_0xaa26('0x35')]));_0x4a1f32[_0xaa26('0x34')]=_0x4a1f32[_0xaa26('0x34')]['length']?_0x4a1f32['attributes']:_0x3f1b44['model'];if(_0x446a89[_0xaa26('0x31')]['includeAll']){_0x4a1f32[_0xaa26('0x40')]=[{'all':!![]}];}_0x4a1f32=_[_0xaa26('0x3c')]({},_0x4a1f32,_0x446a89[_0xaa26('0x3e')]);return db[_0xaa26('0x2b')][_0xaa26('0x45')](_0x4a1f32)[_0xaa26('0x22')](handleEntityNotFound(_0x3af311,null))[_0xaa26('0x22')](respondWithResult(_0x3af311,null))[_0xaa26('0x42')](handleError(_0x3af311,null));};exports['create']=function(_0x403747,_0x4e9669){return db[_0xaa26('0x2b')]['create'](_0x403747[_0xaa26('0x46')],{})['then'](respondWithResult(_0x4e9669,0xc9))[_0xaa26('0x42')](handleError(_0x4e9669,null));};exports['update']=function(_0x159c68,_0x102d81){if(_0x159c68[_0xaa26('0x46')]['id']){delete _0x159c68[_0xaa26('0x46')]['id'];}return db['Automation'][_0xaa26('0x45')]({'where':{'id':_0x159c68[_0xaa26('0x44')]['id']}})['then'](handleEntityNotFound(_0x102d81,null))[_0xaa26('0x22')](saveUpdates(_0x159c68[_0xaa26('0x46')],null))[_0xaa26('0x22')](respondWithResult(_0x102d81,null))['catch'](handleError(_0x102d81,null));};exports[_0xaa26('0x21')]=function(_0x373a1e,_0x5656d3){return db[_0xaa26('0x2b')][_0xaa26('0x45')]({'where':{'id':_0x373a1e[_0xaa26('0x44')]['id']}})['then'](handleEntityNotFound(_0x5656d3,null))[_0xaa26('0x22')](removeEntity(_0x5656d3,null))[_0xaa26('0x42')](handleError(_0x5656d3,null));};exports[_0xaa26('0x47')]=function(_0x3c9e2c,_0x3b209b,_0x52ff9c){return db[_0xaa26('0x48')][_0xaa26('0x45')]({'where':{'id':_0x3c9e2c[_0xaa26('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b209b,null))[_0xaa26('0x22')](function(_0x34b243){if(_0x34b243){return _0x34b243[_0xaa26('0x47')](_0x3c9e2c[_0xaa26('0x46')][_0xaa26('0x49')],_[_0xaa26('0x4a')](_0x3c9e2c[_0xaa26('0x46')],['ids','id'])||{});}})[_0xaa26('0x22')](respondWithResult(_0x3b209b,null))[_0xaa26('0x42')](handleError(_0x3b209b,null));};exports['getConditions']=function(_0x3fdae9,_0x4ebe75,_0x3e7f2d){var _0xd4312={};var _0x4a8e0e={};var _0x1649b5;var _0x3a3580;return db[_0xaa26('0x2b')][_0xaa26('0x4b')]({'where':{'id':_0x3fdae9[_0xaa26('0x44')]['id']}})[_0xaa26('0x22')](handleEntityNotFound(_0x4ebe75,null))[_0xaa26('0x22')](function(_0x265718){if(_0x265718){_0x1649b5=_0x265718;_0x4a8e0e['model']=_[_0xaa26('0x30')](db[_0xaa26('0x48')][_0xaa26('0x2c')]);_0x4a8e0e[_0xaa26('0x31')]=_[_0xaa26('0x30')](_0x3fdae9['query']);_0x4a8e0e['filters']=_[_0xaa26('0x33')](_0x4a8e0e[_0xaa26('0x2f')],_0x4a8e0e['query']);_0xd4312[_0xaa26('0x34')]=_[_0xaa26('0x33')](_0x4a8e0e[_0xaa26('0x2f')],qs[_0xaa26('0x35')](_0x3fdae9[_0xaa26('0x31')][_0xaa26('0x35')]));_0xd4312[_0xaa26('0x34')]=_0xd4312['attributes'][_0xaa26('0x4c')]?_0xd4312[_0xaa26('0x34')]:_0x4a8e0e[_0xaa26('0x2f')];_0xd4312[_0xaa26('0x37')]=qs[_0xaa26('0x38')](_0x3fdae9[_0xaa26('0x31')][_0xaa26('0x38')]);_0xd4312['where']=qs[_0xaa26('0x32')](_[_0xaa26('0x3a')](_0x3fdae9[_0xaa26('0x31')],_0x4a8e0e[_0xaa26('0x32')]));if(_0x3fdae9['query'][_0xaa26('0x3b')]){_0xd4312['where']=_[_0xaa26('0x3c')](_0xd4312['where'],{'$or':_[_0xaa26('0x2a')](_0xd4312['attributes'],function(_0x450514){var _0x130d54={};_0x130d54[_0x450514]={'$like':'%'+_0x3fdae9[_0xaa26('0x31')]['filter']+'%'};return _0x130d54;})});}_0xd4312=_[_0xaa26('0x3c')]({},_0xd4312,_0x3fdae9[_0xaa26('0x3e')]);return _0x1649b5['getConditions'](_0xd4312);}})['then'](function(_0x4cc0d3){if(_0x4cc0d3){_0x3a3580=_0x4cc0d3[_0xaa26('0x4c')];if(!_0x3fdae9[_0xaa26('0x31')]['hasOwnProperty'](_0xaa26('0x4d'))){_0xd4312['limit']=qs[_0xaa26('0x1b')](_0x3fdae9[_0xaa26('0x31')][_0xaa26('0x1b')]);_0xd4312[_0xaa26('0x19')]=qs[_0xaa26('0x19')](_0x3fdae9[_0xaa26('0x31')]['offset']);}return _0x1649b5[_0xaa26('0x4e')](_0xd4312);}})[_0xaa26('0x22')](function(_0x3bc873){if(_0x3bc873){return _0x3bc873?{'count':_0x3a3580,'rows':_0x3bc873}:null;}})[_0xaa26('0x22')](respondWithResult(_0x4ebe75,null))[_0xaa26('0x42')](handleError(_0x4ebe75,null));};exports[_0xaa26('0x4f')]=function(_0x3f6fcc,_0x595045,_0x4fc0b9){return db['Action'][_0xaa26('0x45')]({'where':{'id':_0x3f6fcc[_0xaa26('0x44')]['id']}})[_0xaa26('0x22')](handleEntityNotFound(_0x595045,null))[_0xaa26('0x22')](function(_0x21429e){if(_0x21429e){return _0x21429e[_0xaa26('0x4f')](_0x3f6fcc[_0xaa26('0x46')][_0xaa26('0x49')],_[_0xaa26('0x4a')](_0x3f6fcc[_0xaa26('0x46')],[_0xaa26('0x49'),'id'])||{});}})[_0xaa26('0x22')](respondWithResult(_0x595045,null))[_0xaa26('0x42')](handleError(_0x595045,null));};exports[_0xaa26('0x50')]=function(_0x2508c5,_0x52795e,_0x38ce1b){var _0x43c19e={};var _0x16136e={};var _0x5dff41;var _0x5bc382;return db['Automation'][_0xaa26('0x4b')]({'where':{'id':_0x2508c5[_0xaa26('0x44')]['id']}})[_0xaa26('0x22')](handleEntityNotFound(_0x52795e,null))[_0xaa26('0x22')](function(_0x58e25e){if(_0x58e25e){_0x5dff41=_0x58e25e;_0x16136e[_0xaa26('0x2f')]=_[_0xaa26('0x30')](db[_0xaa26('0x51')][_0xaa26('0x2c')]);_0x16136e['query']=_[_0xaa26('0x30')](_0x2508c5[_0xaa26('0x31')]);_0x16136e[_0xaa26('0x32')]=_[_0xaa26('0x33')](_0x16136e['model'],_0x16136e[_0xaa26('0x31')]);_0x43c19e[_0xaa26('0x34')]=_[_0xaa26('0x33')](_0x16136e['model'],qs['fields'](_0x2508c5['query'][_0xaa26('0x35')]));_0x43c19e[_0xaa26('0x34')]=_0x43c19e[_0xaa26('0x34')]['length']?_0x43c19e[_0xaa26('0x34')]:_0x16136e[_0xaa26('0x2f')];_0x43c19e[_0xaa26('0x37')]=qs['sort'](_0x2508c5['query'][_0xaa26('0x38')]);_0x43c19e[_0xaa26('0x39')]=qs[_0xaa26('0x32')](_['pick'](_0x2508c5['query'],_0x16136e[_0xaa26('0x32')]));if(_0x2508c5[_0xaa26('0x31')][_0xaa26('0x3b')]){_0x43c19e[_0xaa26('0x39')]=_[_0xaa26('0x3c')](_0x43c19e[_0xaa26('0x39')],{'$or':_[_0xaa26('0x2a')](_0x43c19e['attributes'],function(_0x481ffa){var _0x3bcc68={};_0x3bcc68[_0x481ffa]={'$like':'%'+_0x2508c5[_0xaa26('0x31')][_0xaa26('0x3b')]+'%'};return _0x3bcc68;})});}_0x43c19e=_[_0xaa26('0x3c')]({},_0x43c19e,_0x2508c5[_0xaa26('0x3e')]);return _0x5dff41[_0xaa26('0x50')](_0x43c19e);}})['then'](function(_0x305a13){if(_0x305a13){_0x5bc382=_0x305a13[_0xaa26('0x4c')];if(!_0x2508c5[_0xaa26('0x31')][_0xaa26('0x36')]('nolimit')){_0x43c19e[_0xaa26('0x1b')]=qs[_0xaa26('0x1b')](_0x2508c5[_0xaa26('0x31')]['limit']);_0x43c19e[_0xaa26('0x19')]=qs[_0xaa26('0x19')](_0x2508c5[_0xaa26('0x31')]['offset']);}return _0x5dff41['getActions'](_0x43c19e);}})[_0xaa26('0x22')](function(_0x1a8d14){if(_0x1a8d14){return _0x1a8d14?{'count':_0x5bc382,'rows':_0x1a8d14}:null;}})[_0xaa26('0x22')](respondWithResult(_0x52795e,null))[_0xaa26('0x42')](handleError(_0x52795e,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 3e522aa..2dd1cae 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 _0xa092=['./automation.attributes','define','tools_automations','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xa092,0x189));var _0x2a09=function(_0x5566b7,_0x4e9e2c){_0x5566b7=_0x5566b7-0x0;var _0x1c7ea7=_0xa092[_0x5566b7];return _0x1c7ea7;};'use strict';var _=require('lodash');var util=require(_0x2a09('0x0'));var logger=require(_0x2a09('0x1'))(_0x2a09('0x2'));var moment=require('moment');var BPromise=require(_0x2a09('0x3'));var rp=require(_0x2a09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a09('0x5'));var config=require(_0x2a09('0x6'));var attributes=require(_0x2a09('0x7'));module['exports']=function(_0x7b06ea,_0x167c88){return _0x7b06ea[_0x2a09('0x8')]('Automation',attributes,{'tableName':_0x2a09('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf628=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xf628,0x176));var _0x8f62=function(_0x30464a,_0x56acf8){_0x30464a=_0x30464a-0x0;var _0x273f9d=_0xf628[_0x30464a];return _0x273f9d;};'use strict';var _=require(_0x8f62('0x0'));var util=require(_0x8f62('0x1'));var logger=require(_0x8f62('0x2'))('api');var moment=require(_0x8f62('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f62('0x4'));var fs=require('fs');var path=require(_0x8f62('0x5'));var rimraf=require(_0x8f62('0x6'));var config=require(_0x8f62('0x7'));var attributes=require(_0x8f62('0x8'));module[_0x8f62('0x9')]=function(_0x14b91b,_0x27e861){return _0x14b91b['define']('Automation',attributes,{'tableName':_0x8f62('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 303f904..f93035e 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 _0x505d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','Automation,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x517082,_0xc70ef9){var _0x560118=function(_0xff3513){while(--_0xff3513){_0x517082['push'](_0x517082['shift']());}};_0x560118(++_0xc70ef9);}(_0x505d,0x93));var _0xd505=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x505d[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd505('0x0'));var BPromise=require(_0xd505('0x1'));var rs=require(_0xd505('0x2'));var fs=require('fs');var Redis=require(_0xd505('0x3'));var db=require(_0xd505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd505('0x5'))(_0xd505('0x6'));var config=require(_0xd505('0x7'));var jayson=require(_0xd505('0x8'));var client=jayson['client'][_0xd505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f8d,_0x2bc4e7,_0x162ee2){return new BPromise(function(_0x543c42,_0x2abf26){return client[_0xd505('0xa')](_0x5d4f8d,_0x162ee2)['then'](function(_0x47b37a){logger[_0xd505('0xb')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0xd505('0xc'));logger['debug'](_0xd505('0xd'),_0x2bc4e7,'request\x20sent',JSON[_0xd505('0xe')](_0x47b37a));if(_0x47b37a['error']){if(_0x47b37a['error']['code']===0x1f4){logger[_0xd505('0xf')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x2abf26(_0x47b37a['error']['message']);}logger[_0xd505('0xf')](_0xd505('0x11'),_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x543c42(_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);}else{logger[_0xd505('0xb')](_0xd505('0x11'),_0x2bc4e7,_0xd505('0xc'));_0x543c42(_0x47b37a['result'][_0xd505('0x10')]);}})[_0xd505('0x12')](function(_0x8013f2){logger['error'](_0xd505('0x11'),_0x2bc4e7,_0x8013f2);_0x2abf26(_0x8013f2);});});}
\ No newline at end of file
+var _0x11c1=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash'];(function(_0x5f1699,_0x24018c){var _0x5d8222=function(_0x34b011){while(--_0x34b011){_0x5f1699['push'](_0x5f1699['shift']());}};_0x5d8222(++_0x24018c);}(_0x11c1,0x1cb));var _0x111c=function(_0x5c0ba9,_0x6add5c){_0x5c0ba9=_0x5c0ba9-0x0;var _0x104c7e=_0x11c1[_0x5c0ba9];return _0x104c7e;};'use strict';var _=require(_0x111c('0x0'));var util=require('util');var moment=require(_0x111c('0x1'));var BPromise=require(_0x111c('0x2'));var rs=require(_0x111c('0x3'));var fs=require('fs');var Redis=require(_0x111c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x111c('0x5'));var logger=require(_0x111c('0x6'))(_0x111c('0x7'));var config=require(_0x111c('0x8'));var jayson=require(_0x111c('0x9'));var client=jayson[_0x111c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd1221b,_0x223fb1,_0x696d06){return new BPromise(function(_0x30c58a,_0x8fc75f){return client[_0x111c('0xb')](_0xd1221b,_0x696d06)[_0x111c('0xc')](function(_0x14dc02){logger[_0x111c('0xd')](_0x111c('0xe'),_0x223fb1,_0x111c('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x223fb1,'request\x20sent',JSON['stringify'](_0x14dc02));if(_0x14dc02[_0x111c('0x10')]){if(_0x14dc02[_0x111c('0x10')][_0x111c('0x11')]===0x1f4){logger[_0x111c('0x10')](_0x111c('0xe'),_0x223fb1,_0x14dc02[_0x111c('0x10')][_0x111c('0x12')]);return _0x8fc75f(_0x14dc02[_0x111c('0x10')][_0x111c('0x12')]);}logger[_0x111c('0x10')](_0x111c('0xe'),_0x223fb1,_0x14dc02[_0x111c('0x10')][_0x111c('0x12')]);return _0x30c58a(_0x14dc02[_0x111c('0x10')][_0x111c('0x12')]);}else{logger[_0x111c('0xd')](_0x111c('0xe'),_0x223fb1,_0x111c('0xf'));_0x30c58a(_0x14dc02[_0x111c('0x13')]['message']);}})['catch'](function(_0x51ffc7){logger[_0x111c('0x10')]('Automation,\x20%s,\x20%s',_0x223fb1,_0x51ffc7);_0x8fc75f(_0x51ffc7);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 2baccf8..1bfe117 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 _0x7429=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','show','isAuthenticated','getConditions','post','/:id/conditions','/:id/actions','put','update','delete','destroy','path','express','Router'];(function(_0x1e17eb,_0x2e15c5){var _0x4de4c7=function(_0x52d003){while(--_0x52d003){_0x1e17eb['push'](_0x1e17eb['shift']());}};_0x4de4c7(++_0x2e15c5);}(_0x7429,0x6f));var _0x9742=function(_0x41cf29,_0x5c7212){_0x41cf29=_0x41cf29-0x0;var _0x20753e=_0x7429[_0x41cf29];return _0x20753e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9742('0x0'));var timeout=require('connect-timeout');var express=require(_0x9742('0x1'));var router=express[_0x9742('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9742('0x3'));var interaction=require(_0x9742('0x4'));var config=require(_0x9742('0x5'));var controller=require(_0x9742('0x6'));router[_0x9742('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9742('0x7')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x9')]);router[_0x9742('0x7')]('/:id/conditions',auth[_0x9742('0xa')](),controller[_0x9742('0xb')]);router[_0x9742('0x7')]('/:id/actions',auth[_0x9742('0xa')](),controller['getActions']);router[_0x9742('0xc')]('/',auth[_0x9742('0xa')](),controller['create']);router[_0x9742('0xc')](_0x9742('0xd'),auth[_0x9742('0xa')](),controller['addConditions']);router[_0x9742('0xc')](_0x9742('0xe'),auth[_0x9742('0xa')](),controller['addActions']);router[_0x9742('0xf')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x10')]);router[_0x9742('0x11')](_0x9742('0x8'),auth[_0x9742('0xa')](),controller[_0x9742('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x6e16=['addConditions','addActions','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create'];(function(_0x108273,_0x5e4e06){var _0x58bd50=function(_0x2333bb){while(--_0x2333bb){_0x108273['push'](_0x108273['shift']());}};_0x58bd50(++_0x5e4e06);}(_0x6e16,0x1d3));var _0x66e1=function(_0x518ac4,_0x30dd4b){_0x518ac4=_0x518ac4-0x0;var _0x5f0090=_0x6e16[_0x518ac4];return _0x5f0090;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x66e1('0x0'));var timeout=require('connect-timeout');var express=require(_0x66e1('0x1'));var router=express['Router']();var fs_extra=require(_0x66e1('0x2'));var auth=require(_0x66e1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x66e1('0x4'));var controller=require('./automation.controller');router[_0x66e1('0x5')]('/',auth[_0x66e1('0x6')](),controller[_0x66e1('0x7')]);router['get'](_0x66e1('0x8'),auth[_0x66e1('0x6')](),controller[_0x66e1('0x9')]);router[_0x66e1('0x5')](_0x66e1('0xa'),auth[_0x66e1('0x6')](),controller[_0x66e1('0xb')]);router[_0x66e1('0x5')](_0x66e1('0xc'),auth[_0x66e1('0x6')](),controller[_0x66e1('0xd')]);router[_0x66e1('0xe')]('/',auth[_0x66e1('0x6')](),controller[_0x66e1('0xf')]);router['post']('/:id/conditions',auth[_0x66e1('0x6')](),controller[_0x66e1('0x10')]);router[_0x66e1('0xe')]('/:id/actions',auth['isAuthenticated'](),controller[_0x66e1('0x11')]);router['put'](_0x66e1('0x8'),auth[_0x66e1('0x6')](),controller['update']);router[_0x66e1('0x12')](_0x66e1('0x8'),auth['isAuthenticated'](),controller[_0x66e1('0x13')]);module[_0x66e1('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 965747c..519c633 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 _0x8e8d=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','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'];(function(_0x310bd9,_0x27690d){var _0x438c67=function(_0x7ce348){while(--_0x7ce348){_0x310bd9['push'](_0x310bd9['shift']());}};_0x438c67(++_0x27690d);}(_0x8e8d,0x1d7));var _0xd8e8=function(_0x29f9ea,_0x68785d){_0x29f9ea=_0x29f9ea-0x0;var _0xe1819d=_0x8e8d[_0x29f9ea];return _0xe1819d;};'use strict';var Sequelize=require('sequelize');module[_0xd8e8('0x0')]={'name':{'type':Sequelize[_0xd8e8('0x1')],'unique':_0xd8e8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x4')),'allowNull':![],'defaultValue':_0xd8e8('0x4')},'description':{'type':Sequelize[_0xd8e8('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd8e8('0x5')},'limitCalls':{'type':Sequelize[_0xd8e8('0x6')](0x4)[_0xd8e8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd8e8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd8e8('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd8e8('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd8e8('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd8e8('0x1')],'defaultValue':_0xd8e8('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x10'),_0xd8e8('0x11'),_0xd8e8('0x12')),'defaultValue':_0xd8e8('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd8e8('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd8e8('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xd8e8('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd8e8('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd8e8('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd8e8('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd8e8('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd8e8('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd8e8('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd8e8('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x1b'),'ASC'),'defaultValue':_0xd8e8('0x1b')},'dialPrefix':{'type':Sequelize[_0xd8e8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8e8('0x1c')},'dialCutDigit':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8e8('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x25')}};
\ No newline at end of file
+var _0xd81e=['Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x246890,_0x46b964){var _0x2b2a5a=function(_0x4f1232){while(--_0x4f1232){_0x246890['push'](_0x246890['shift']());}};_0x2b2a5a(++_0x46b964);}(_0xd81e,0x7b));var _0xed81=function(_0x4898bc,_0x505bf0){_0x4898bc=_0x4898bc-0x0;var _0x5d95a8=_0xd81e[_0x4898bc];return _0x5d95a8;};'use strict';var Sequelize=require(_0xed81('0x0'));module['exports']={'name':{'type':Sequelize[_0xed81('0x1')],'unique':_0xed81('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xed81('0x3')](_0xed81('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xed81('0x5')],'defaultValue':0x0,'comment':_0xed81('0x6')},'limitCalls':{'type':Sequelize[_0xed81('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xed81('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xed81('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xed81('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'defaultValue':0x3,'comment':_0xed81('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xed81('0x10')},'dialTimezone':{'type':Sequelize[_0xed81('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xed81('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xed81('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xed81('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xed81('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xed81('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xed81('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xed81('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xed81('0x7')](0x9)[_0xed81('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xed81('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xed81('0x7')](0x9)[_0xed81('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xed81('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xed81('0x7')](0x9)[_0xed81('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xed81('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xed81('0x7')](0x9)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xed81('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xed81('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xed81('0x18'),'ASC'),'defaultValue':_0xed81('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xed81('0x19')},'dialCutDigit':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xed81('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xed81('0x7')](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xed81('0x7')](0x3)[_0xed81('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xed81('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xed81('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xed81('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index ed7ad37..9f8003e 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 _0xd1e7=['key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','nolimit','CampaignId','filter','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','fieldName','type'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xd1e7,0x1ee));var _0x7d1e=function(_0x2fc9d4,_0x14719f){_0x2fc9d4=_0x2fc9d4-0x0;var _0x1eff4b=_0xd1e7[_0x2fc9d4];return _0x1eff4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d1e('0x0'));var zipdir=require(_0x7d1e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d1e('0x2'));var moment=require(_0x7d1e('0x3'));var BPromise=require(_0x7d1e('0x4'));var Mustache=require(_0x7d1e('0x5'));var util=require(_0x7d1e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7d1e('0x7'));var ejs=require(_0x7d1e('0x8'));var fs=require('fs');var fs_extra=require(_0x7d1e('0x9'));var _=require(_0x7d1e('0xa'));var squel=require(_0x7d1e('0xb'));var crypto=require(_0x7d1e('0xc'));var jsforce=require(_0x7d1e('0xd'));var deskjs=require(_0x7d1e('0xe'));var toCsv=require(_0x7d1e('0x7'));var querystring=require(_0x7d1e('0xf'));var Papa=require(_0x7d1e('0x10'));var Redis=require(_0x7d1e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7d1e('0x12'));var as=require(_0x7d1e('0x13'));var hardwareService=require(_0x7d1e('0x14'));var logger=require(_0x7d1e('0x15'))(_0x7d1e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d1e('0x17'));var db=require(_0x7d1e('0x18'))['db'];function respondWithStatusCode(_0x26a589,_0x31b8e6){_0x31b8e6=_0x31b8e6||0xcc;return function(_0x57776a){if(_0x57776a){return _0x26a589[_0x7d1e('0x19')](_0x31b8e6);}return _0x26a589[_0x7d1e('0x1a')](_0x31b8e6)['end']();};}function respondWithResult(_0xc7b55e,_0xf740c4){_0xf740c4=_0xf740c4||0xc8;return function(_0x4a9ea){if(_0x4a9ea){return _0xc7b55e['status'](_0xf740c4)[_0x7d1e('0x1b')](_0x4a9ea);}};}function respondWithFilteredResult(_0x4fb9c3,_0x1404ac){return function(_0x384a51){if(_0x384a51){var _0x1e9e77=typeof _0x1404ac['offset']===_0x7d1e('0x1c')&&typeof _0x1404ac['limit']==='undefined';var _0xcc0868=_0x384a51[_0x7d1e('0x1d')];var _0x1861a3=_0x1e9e77?0x0:_0x1404ac[_0x7d1e('0x1e')];var _0x14b044=_0x1e9e77?_0x384a51[_0x7d1e('0x1d')]:_0x1404ac[_0x7d1e('0x1e')]+_0x1404ac[_0x7d1e('0x1f')];var _0x518db8;if(_0x14b044>=_0xcc0868){_0x14b044=_0xcc0868;_0x518db8=0xc8;}else{_0x518db8=0xce;}_0x4fb9c3['status'](_0x518db8);return _0x4fb9c3[_0x7d1e('0x20')]('Content-Range',_0x1861a3+'-'+_0x14b044+'/'+_0xcc0868)['json'](_0x384a51);}return null;};}function patchUpdates(_0x25a691){return function(_0x2cb5ec){try{jsonpatch[_0x7d1e('0x21')](_0x2cb5ec,_0x25a691,!![]);}catch(_0xf065e){return BPromise[_0x7d1e('0x22')](_0xf065e);}return _0x2cb5ec[_0x7d1e('0x23')]();};}function saveUpdates(_0x189427,_0x1392ab){return function(_0x5aba8b){if(_0x5aba8b){return _0x5aba8b['update'](_0x189427)[_0x7d1e('0x24')](function(_0x33c9b1){return _0x33c9b1;});}return null;};}function removeEntity(_0x2c8836,_0x573f1a){return function(_0x4fbc16){if(_0x4fbc16){return _0x4fbc16[_0x7d1e('0x25')]()[_0x7d1e('0x24')](function(){var _0x3abf36=_0x4fbc16['get']({'plain':!![]});var _0x524c00=_0x7d1e('0x26');return db[_0x7d1e('0x27')][_0x7d1e('0x25')]({'where':{'type':_0x524c00,'resourceId':_0x3abf36['id']}})[_0x7d1e('0x24')](function(){return _0x4fbc16;});})[_0x7d1e('0x24')](function(){_0x2c8836[_0x7d1e('0x1a')](0xcc)[_0x7d1e('0x28')]();});}};}function handleEntityNotFound(_0xdfc49e,_0x3d0ecd){return function(_0x124037){if(!_0x124037){_0xdfc49e[_0x7d1e('0x19')](0x194);}return _0x124037;};}function handleError(_0x4cefde,_0x36b982){_0x36b982=_0x36b982||0x1f4;return function(_0x206779){logger[_0x7d1e('0x29')](_0x206779[_0x7d1e('0x2a')]);if(_0x206779['name']){delete _0x206779[_0x7d1e('0x2b')];}_0x4cefde[_0x7d1e('0x1a')](_0x36b982)[_0x7d1e('0x2c')](_0x206779);};}exports[_0x7d1e('0x2d')]=function(_0x2cf4dc,_0x2a5bb7){var _0x3f99b={},_0x51265e={},_0x2d7e03={'count':0x0,'rows':[]};var _0xb853ff=_[_0x7d1e('0x2e')](db[_0x7d1e('0x2f')]['rawAttributes'],function(_0xc9e0dc){return{'name':_0xc9e0dc[_0x7d1e('0x30')],'type':_0xc9e0dc[_0x7d1e('0x31')][_0x7d1e('0x32')]};});_0x51265e['model']=_[_0x7d1e('0x2e')](_0xb853ff,'name');_0x51265e[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2cf4dc[_0x7d1e('0x33')]);_0x51265e[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x51265e[_0x7d1e('0x37')],_0x51265e[_0x7d1e('0x33')]);_0x3f99b['attributes']=_[_0x7d1e('0x36')](_0x51265e[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x2cf4dc[_0x7d1e('0x33')]['fields']));_0x3f99b[_0x7d1e('0x39')]=_0x3f99b[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3f99b[_0x7d1e('0x39')]:_0x51265e[_0x7d1e('0x37')];if(!_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x3f99b[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2cf4dc['query'][_0x7d1e('0x1f')]);_0x3f99b['offset']=qs['offset'](_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x3f99b[_0x7d1e('0x3c')]=qs['sort'](_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3f99b['where']=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2cf4dc[_0x7d1e('0x33')],_0x51265e['filters']),_0xb853ff);if(_0x2cf4dc[_0x7d1e('0x33')]['filter']){_0x3f99b[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x3f99b['where'],{'$or':_[_0x7d1e('0x2e')](_0xb853ff,function(_0x361aa0){if(_0x361aa0[_0x7d1e('0x31')]!=='VIRTUAL'){var _0x3e2f71={};_0x3e2f71[_0x361aa0[_0x7d1e('0x2b')]]={'$like':'%'+_0x2cf4dc[_0x7d1e('0x33')]['filter']+'%'};return _0x3e2f71;}})});}_0x3f99b=_[_0x7d1e('0x40')]({},_0x3f99b,_0x2cf4dc[_0x7d1e('0x41')]);var _0x135953={'where':_0x3f99b[_0x7d1e('0x3f')]};return db[_0x7d1e('0x2f')][_0x7d1e('0x1d')](_0x135953)['then'](function(_0x12c67d){_0x2d7e03[_0x7d1e('0x1d')]=_0x12c67d;if(_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x42')]){_0x3f99b[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x2f')][_0x7d1e('0x44')](_0x3f99b);})[_0x7d1e('0x24')](function(_0x823b3){_0x2d7e03[_0x7d1e('0x45')]=_0x823b3;return _0x2d7e03;})[_0x7d1e('0x24')](respondWithFilteredResult(_0x2a5bb7,_0x3f99b))[_0x7d1e('0x46')](handleError(_0x2a5bb7,null));};exports[_0x7d1e('0x47')]=function(_0xdde30f,_0x24eadc){var _0xcfe0d4={'raw':![],'where':{'id':_0xdde30f[_0x7d1e('0x48')]['id']}},_0x2bcf2e={};_0x2bcf2e[_0x7d1e('0x37')]=_['keys'](db['Campaign'][_0x7d1e('0x49')]);_0x2bcf2e[_0x7d1e('0x33')]=_['keys'](_0xdde30f['query']);_0x2bcf2e[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x2bcf2e[_0x7d1e('0x37')],_0x2bcf2e['query']);_0xcfe0d4['attributes']=_['intersection'](_0x2bcf2e[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0xdde30f['query'][_0x7d1e('0x38')]));_0xcfe0d4[_0x7d1e('0x39')]=_0xcfe0d4[_0x7d1e('0x39')]['length']?_0xcfe0d4[_0x7d1e('0x39')]:_0x2bcf2e['model'];if(_0xdde30f['query']['includeAll']){_0xcfe0d4[_0x7d1e('0x43')]=[{'all':!![]}];}_0xcfe0d4=_[_0x7d1e('0x40')]({},_0xcfe0d4,_0xdde30f[_0x7d1e('0x41')]);return db[_0x7d1e('0x2f')]['find'](_0xcfe0d4)[_0x7d1e('0x24')](handleEntityNotFound(_0x24eadc,null))[_0x7d1e('0x24')](respondWithResult(_0x24eadc,null))[_0x7d1e('0x46')](handleError(_0x24eadc,null));};exports['create']=function(_0xd256e5,_0x14f008){return db[_0x7d1e('0x2f')][_0x7d1e('0x4a')](_0xd256e5[_0x7d1e('0x4b')],{})['then'](function(_0x530214){var _0xf860ef=_0xd256e5[_0x7d1e('0x4c')][_0x7d1e('0x4d')]({'plain':!![]});if(!_0xf860ef)throw new Error(_0x7d1e('0x4e'));if(_0xf860ef[_0x7d1e('0x4f')]===_0x7d1e('0x4c')){var _0x34b641=_0x530214[_0x7d1e('0x4d')]({'plain':!![]});var _0x446b82=_0x7d1e('0x26');return db[_0x7d1e('0x50')]['find']({'where':{'name':_0x446b82,'userProfileId':_0xf860ef[_0x7d1e('0x51')]},'raw':!![]})[_0x7d1e('0x24')](function(_0x1bc8f6){if(_0x1bc8f6&&_0x1bc8f6[_0x7d1e('0x52')]===0x0){return db[_0x7d1e('0x27')]['create']({'name':_0x34b641[_0x7d1e('0x2b')],'resourceId':_0x34b641['id'],'type':_0x1bc8f6[_0x7d1e('0x2b')],'sectionId':_0x1bc8f6['id']},{})[_0x7d1e('0x24')](function(){return _0x530214;});}else{return _0x530214;}})[_0x7d1e('0x46')](function(_0x38690a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38690a);throw _0x38690a;});}return _0x530214;})[_0x7d1e('0x24')](respondWithResult(_0x14f008,0xc9))['catch'](handleError(_0x14f008,null));};exports[_0x7d1e('0x53')]=function(_0x3f9a68,_0x211867){var _0x233512={'where':{'id':_0x3f9a68[_0x7d1e('0x48')]['id']}},_0x4361ee={};_0x4361ee[_0x7d1e('0x37')]=_['keys'](db[_0x7d1e('0x2f')][_0x7d1e('0x49')]);_0x233512['attributes']=_[_0x7d1e('0x36')](_0x4361ee[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x3f9a68['query'][_0x7d1e('0x38')]));_0x233512[_0x7d1e('0x39')]=_0x233512[_0x7d1e('0x39')]['length']?_0x233512['attributes']:_0x4361ee[_0x7d1e('0x37')];if(_0x3f9a68[_0x7d1e('0x33')]['includeAll']){_0x233512[_0x7d1e('0x43')]=[{'all':!![]}];}_0x233512=_[_0x7d1e('0x40')]({},_0x233512,_0x3f9a68[_0x7d1e('0x41')]);return db[_0x7d1e('0x2f')][_0x7d1e('0x54')](_0x233512)[_0x7d1e('0x24')](handleEntityNotFound(_0x211867,null))['then'](function(_0x2fc02f){if(_0x2fc02f){var _0x42007c=_0x2fc02f[_0x7d1e('0x4d')]({'plain':!![]});_0x42007c=qs[_0x7d1e('0x55')](_0x42007c,['id',_0x7d1e('0x56'),_0x7d1e('0x57')]);_0x3f9a68[_0x7d1e('0x4b')]=_[_0x7d1e('0x55')](_0x3f9a68[_0x7d1e('0x4b')],['id','createdAt','updatedAt']);return db[_0x7d1e('0x2f')]['create'](_[_0x7d1e('0x40')](_0x42007c,_0x3f9a68[_0x7d1e('0x4b')]),{'include':_0x3f9a68[_0x7d1e('0x33')][_0x7d1e('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x4e45d3){var _0x1a9f18=_0x3f9a68[_0x7d1e('0x4c')][_0x7d1e('0x4d')]({'plain':!![]});if(!_0x1a9f18)throw new Error(_0x7d1e('0x4e'));if(_0x1a9f18[_0x7d1e('0x4f')]===_0x7d1e('0x4c')){var _0x3538e1=_0x4e45d3[_0x7d1e('0x4d')]({'plain':!![]});var _0x29b8e2=_0x7d1e('0x26');return db[_0x7d1e('0x50')][_0x7d1e('0x54')]({'where':{'name':_0x29b8e2,'userProfileId':_0x1a9f18[_0x7d1e('0x51')]},'raw':!![]})[_0x7d1e('0x24')](function(_0x2e993c){if(_0x2e993c&&_0x2e993c[_0x7d1e('0x52')]===0x0){return db[_0x7d1e('0x27')][_0x7d1e('0x4a')]({'name':_0x3538e1[_0x7d1e('0x2b')],'resourceId':_0x3538e1['id'],'type':_0x2e993c[_0x7d1e('0x2b')],'sectionId':_0x2e993c['id']},{})['then'](function(){return _0x4e45d3;});}else{return _0x4e45d3;}})['catch'](function(_0x5a1750){logger[_0x7d1e('0x29')](_0x7d1e('0x58'),_0x5a1750);throw _0x5a1750;});}return _0x4e45d3;});}})['then'](respondWithResult(_0x211867,0xc9))[_0x7d1e('0x46')](handleError(_0x211867,null));};exports[_0x7d1e('0x59')]=function(_0x1bddd8,_0x16b79c){if(_0x1bddd8[_0x7d1e('0x4b')]['id']){delete _0x1bddd8[_0x7d1e('0x4b')]['id'];}return db['Campaign'][_0x7d1e('0x54')]({'where':{'id':_0x1bddd8[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x16b79c,null))[_0x7d1e('0x24')](saveUpdates(_0x1bddd8[_0x7d1e('0x4b')],null))[_0x7d1e('0x24')](respondWithResult(_0x16b79c,null))[_0x7d1e('0x46')](handleError(_0x16b79c,null));};exports[_0x7d1e('0x25')]=function(_0x2e60cf,_0x9dbd6c){return db[_0x7d1e('0x2f')]['find']({'where':{'id':_0x2e60cf[_0x7d1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x9dbd6c,null))[_0x7d1e('0x24')](removeEntity(_0x9dbd6c,null))['catch'](handleError(_0x9dbd6c,null));};exports[_0x7d1e('0x5a')]=function(_0x313e0a,_0x35c59b,_0x18ee9b){var _0x41a378={'raw':!![],'where':{}};var _0x117cb7={};var _0x1ade85={'count':0x0,'rows':[]};return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x313e0a['params']['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x35c59b,null))[_0x7d1e('0x24')](function(_0x5ec93c){if(_0x5ec93c){_0x117cb7['model']=_[_0x7d1e('0x34')](db[_0x7d1e('0x5c')]['rawAttributes']);_0x117cb7['query']=_[_0x7d1e('0x34')](_0x313e0a[_0x7d1e('0x33')]);_0x117cb7[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x117cb7[_0x7d1e('0x37')],_0x117cb7['query']);_0x41a378[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x117cb7[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x41a378[_0x7d1e('0x39')]=_0x41a378[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x41a378['attributes']:_0x117cb7['model'];if(!_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x3b')](_0x7d1e('0x5d'))){_0x41a378[_0x7d1e('0x1f')]=qs['limit'](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x41a378['offset']=qs[_0x7d1e('0x1e')](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x41a378['order']=qs[_0x7d1e('0x3d')](_0x313e0a[_0x7d1e('0x33')]['sort']);_0x41a378[_0x7d1e('0x3f')]=qs[_0x7d1e('0x35')](_['pick'](_0x313e0a['query'],_0x117cb7['filters']));_0x41a378[_0x7d1e('0x3f')][_0x7d1e('0x5e')]=_0x5ec93c['id'];if(_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x41a378['where']=_[_0x7d1e('0x40')](_0x41a378[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x41a378['attributes'],function(_0xb04b39){var _0x4b7efd={};_0x4b7efd[_0xb04b39]={'$like':'%'+_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x4b7efd;})});}_0x41a378=_[_0x7d1e('0x40')]({},_0x41a378,_0x313e0a[_0x7d1e('0x41')]);return db['CmHopper'][_0x7d1e('0x1d')]({'where':_0x41a378[_0x7d1e('0x3f')]})['then'](function(_0xaa428a){_0x1ade85['count']=_0xaa428a;if(_0x313e0a[_0x7d1e('0x33')]['includeAll']){_0x41a378[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x5c')][_0x7d1e('0x44')](_0x41a378);})[_0x7d1e('0x24')](function(_0xbd0e6b){_0x1ade85[_0x7d1e('0x45')]=_0xbd0e6b;return _0x1ade85;});}})['then'](respondWithFilteredResult(_0x35c59b,_0x41a378))[_0x7d1e('0x46')](handleError(_0x35c59b,null));};exports[_0x7d1e('0x60')]=function(_0x569a9c,_0x184673,_0x2f3f61){var _0x5cf758={'raw':!![],'where':{}};var _0x433fcf={};var _0x3ac15a={'count':0x0,'rows':[]};return db[_0x7d1e('0x2f')][_0x7d1e('0x5b')]({'where':{'id':_0x569a9c['params']['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x184673,null))[_0x7d1e('0x24')](function(_0x4b4f9f){if(_0x4b4f9f){_0x433fcf[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x61')][_0x7d1e('0x49')]);_0x433fcf['query']=_[_0x7d1e('0x34')](_0x569a9c[_0x7d1e('0x33')]);_0x433fcf[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x433fcf[_0x7d1e('0x37')],_0x433fcf[_0x7d1e('0x33')]);_0x5cf758[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x433fcf[_0x7d1e('0x37')],qs['fields'](_0x569a9c[_0x7d1e('0x33')]['fields']));_0x5cf758[_0x7d1e('0x39')]=_0x5cf758[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x5cf758[_0x7d1e('0x39')]:_0x433fcf[_0x7d1e('0x37')];if(!_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x5cf758['limit']=qs[_0x7d1e('0x1f')](_0x569a9c['query']['limit']);_0x5cf758[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x569a9c['query']['offset']);}_0x5cf758[_0x7d1e('0x3c')]=qs[_0x7d1e('0x3d')](_0x569a9c['query']['sort']);_0x5cf758['where']=qs[_0x7d1e('0x35')](_['pick'](_0x569a9c[_0x7d1e('0x33')],_0x433fcf[_0x7d1e('0x35')]));_0x5cf758['where'][_0x7d1e('0x5e')]=_0x4b4f9f['id'];if(_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x5cf758['where']=_[_0x7d1e('0x40')](_0x5cf758[_0x7d1e('0x3f')],{'$or':_['map'](_0x5cf758['attributes'],function(_0x34a290){var _0x52be4c={};_0x52be4c[_0x34a290]={'$like':'%'+_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x52be4c;})});}_0x5cf758=_[_0x7d1e('0x40')]({},_0x5cf758,_0x569a9c[_0x7d1e('0x41')]);return db[_0x7d1e('0x61')][_0x7d1e('0x1d')]({'where':_0x5cf758['where']})['then'](function(_0x3afad2){_0x3ac15a[_0x7d1e('0x1d')]=_0x3afad2;if(_0x569a9c[_0x7d1e('0x33')]['includeAll']){_0x5cf758[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x61')][_0x7d1e('0x44')](_0x5cf758);})[_0x7d1e('0x24')](function(_0x14fab5){_0x3ac15a['rows']=_0x14fab5;return _0x3ac15a;});}})[_0x7d1e('0x24')](respondWithFilteredResult(_0x184673,_0x5cf758))[_0x7d1e('0x46')](handleError(_0x184673,null));};exports['getHopperFinals']=function(_0x2debfb,_0x37048c,_0x3d00c6){var _0x3e33d1={'raw':!![],'where':{}};var _0x8a138a={};var _0x50526a={'count':0x0,'rows':[]};return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x2debfb[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x37048c,null))[_0x7d1e('0x24')](function(_0x1e9e26){if(_0x1e9e26){_0x8a138a[_0x7d1e('0x37')]=_['keys'](db[_0x7d1e('0x62')][_0x7d1e('0x49')]);_0x8a138a[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2debfb[_0x7d1e('0x33')]);_0x8a138a[_0x7d1e('0x35')]=_['intersection'](_0x8a138a[_0x7d1e('0x37')],_0x8a138a[_0x7d1e('0x33')]);_0x3e33d1['attributes']=_[_0x7d1e('0x36')](_0x8a138a[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x2debfb['query'][_0x7d1e('0x38')]));_0x3e33d1[_0x7d1e('0x39')]=_0x3e33d1[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3e33d1[_0x7d1e('0x39')]:_0x8a138a[_0x7d1e('0x37')];if(!_0x2debfb[_0x7d1e('0x33')]['hasOwnProperty'](_0x7d1e('0x5d'))){_0x3e33d1[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x3e33d1[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x3e33d1[_0x7d1e('0x3c')]=qs['sort'](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3e33d1['where']=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2debfb['query'],_0x8a138a['filters']));_0x3e33d1['where']['CampaignId']=_0x1e9e26['id'];if(_0x2debfb[_0x7d1e('0x33')]['filter']){_0x3e33d1['where']=_[_0x7d1e('0x40')](_0x3e33d1[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x3e33d1['attributes'],function(_0x3f906d){var _0x5f3d3c={};_0x5f3d3c[_0x3f906d]={'$like':'%'+_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x5f3d3c;})});}_0x3e33d1=_[_0x7d1e('0x40')]({},_0x3e33d1,_0x2debfb['options']);return db['CmHopperFinal']['count']({'where':_0x3e33d1[_0x7d1e('0x3f')]})[_0x7d1e('0x24')](function(_0x48cbd3){_0x50526a[_0x7d1e('0x1d')]=_0x48cbd3;if(_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x42')]){_0x3e33d1['include']=[{'all':!![]}];}return db[_0x7d1e('0x62')][_0x7d1e('0x44')](_0x3e33d1);})[_0x7d1e('0x24')](function(_0x288e3b){_0x50526a[_0x7d1e('0x45')]=_0x288e3b;return _0x50526a;});}})['then'](respondWithFilteredResult(_0x37048c,_0x3e33d1))['catch'](handleError(_0x37048c,null));};exports['getHopperBlacks']=function(_0x3a771f,_0x2d15f4,_0x38ec66){var _0x4589b9={'raw':!![],'where':{}};var _0x16cb78={};var _0x9a1c77={'count':0x0,'rows':[]};return db[_0x7d1e('0x2f')][_0x7d1e('0x5b')]({'where':{'id':_0x3a771f[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x2d15f4,null))['then'](function(_0x58dadc){if(_0x58dadc){_0x16cb78[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x63')][_0x7d1e('0x49')]);_0x16cb78[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x3a771f['query']);_0x16cb78['filters']=_[_0x7d1e('0x36')](_0x16cb78[_0x7d1e('0x37')],_0x16cb78[_0x7d1e('0x33')]);_0x4589b9['attributes']=_['intersection'](_0x16cb78['model'],qs['fields'](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x4589b9[_0x7d1e('0x39')]=_0x4589b9['attributes'][_0x7d1e('0x3a')]?_0x4589b9[_0x7d1e('0x39')]:_0x16cb78[_0x7d1e('0x37')];if(!_0x3a771f[_0x7d1e('0x33')]['hasOwnProperty']('nolimit')){_0x4589b9[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x4589b9[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x4589b9['order']=qs[_0x7d1e('0x3d')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x4589b9[_0x7d1e('0x3f')]=qs['filters'](_[_0x7d1e('0x3e')](_0x3a771f[_0x7d1e('0x33')],_0x16cb78[_0x7d1e('0x35')]));_0x4589b9[_0x7d1e('0x3f')][_0x7d1e('0x5e')]=_0x58dadc['id'];if(_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x4589b9[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x4589b9[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x4589b9[_0x7d1e('0x39')],function(_0x59e232){var _0x29f5fb={};_0x29f5fb[_0x59e232]={'$like':'%'+_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x29f5fb;})});}_0x4589b9=_[_0x7d1e('0x40')]({},_0x4589b9,_0x3a771f['options']);return db[_0x7d1e('0x63')]['count']({'where':_0x4589b9['where']})[_0x7d1e('0x24')](function(_0x540bb3){_0x9a1c77['count']=_0x540bb3;if(_0x3a771f['query'][_0x7d1e('0x42')]){_0x4589b9[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x63')]['findAll'](_0x4589b9);})['then'](function(_0x2a7146){_0x9a1c77[_0x7d1e('0x45')]=_0x2a7146;return _0x9a1c77;});}})[_0x7d1e('0x24')](respondWithFilteredResult(_0x2d15f4,_0x4589b9))[_0x7d1e('0x46')](handleError(_0x2d15f4,null));};exports['getLists']=function(_0x2ce351,_0x144c94,_0x17e73e){var _0x3a0ff1={};var _0x4318d6={};var _0x4a5ab7;var _0x47315b;return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x2ce351[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x144c94,null))[_0x7d1e('0x24')](function(_0x2a6f86){if(_0x2a6f86){_0x4a5ab7=_0x2a6f86;_0x4318d6[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x64')][_0x7d1e('0x49')]);_0x4318d6[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2ce351[_0x7d1e('0x33')]);_0x4318d6[_0x7d1e('0x35')]=_['intersection'](_0x4318d6[_0x7d1e('0x37')],_0x4318d6[_0x7d1e('0x33')]);_0x3a0ff1[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x4318d6[_0x7d1e('0x37')],qs['fields'](_0x2ce351['query'][_0x7d1e('0x38')]));_0x3a0ff1['attributes']=_0x3a0ff1[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3a0ff1[_0x7d1e('0x39')]:_0x4318d6[_0x7d1e('0x37')];_0x3a0ff1[_0x7d1e('0x3c')]=qs[_0x7d1e('0x3d')](_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3a0ff1[_0x7d1e('0x3f')]=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2ce351[_0x7d1e('0x33')],_0x4318d6[_0x7d1e('0x35')]));if(_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x3a0ff1[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x3a0ff1['where'],{'$or':_[_0x7d1e('0x2e')](_0x3a0ff1[_0x7d1e('0x39')],function(_0x53f99e){var _0x9a1d6c={};_0x9a1d6c[_0x53f99e]={'$like':'%'+_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x9a1d6c;})});}_0x3a0ff1=_[_0x7d1e('0x40')]({},_0x3a0ff1,_0x2ce351[_0x7d1e('0x41')]);return _0x4a5ab7['getLists'](_0x3a0ff1);}})['then'](function(_0x48972b){if(_0x48972b){_0x47315b=_0x48972b['length'];if(!_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x3b')](_0x7d1e('0x5d'))){_0x3a0ff1[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2ce351['query'][_0x7d1e('0x1f')]);_0x3a0ff1[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}return _0x4a5ab7['getLists'](_0x3a0ff1);}})[_0x7d1e('0x24')](function(_0x21bb17){if(_0x21bb17){return _0x21bb17?{'count':_0x47315b,'rows':_0x21bb17}:null;}})['then'](respondWithResult(_0x144c94,null))['catch'](handleError(_0x144c94,null));};exports[_0x7d1e('0x65')]=function(_0x5dd05f,_0x13698a,_0x4f9e21){var _0x4e5f78,_0xca93fd;return db[_0x7d1e('0x2f')][_0x7d1e('0x54')]({'where':{'id':_0x5dd05f[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x13698a,null))[_0x7d1e('0x24')](function(_0x4da334){if(_0x4da334){_0xca93fd=_0x4da334;return _0x4da334['addLists'](_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x66')],_[_0x7d1e('0x55')](_0x5dd05f[_0x7d1e('0x4b')],['ids','id'])||{});}return null;})['spread'](function(_0x22eb67){var _0x23790f;_0x4e5f78=_0x22eb67||[];var _0x53153f=[];if(_0x22eb67){for(var _0x5793a7=0x0;_0x5793a7<_0x22eb67[_0x7d1e('0x3a')];_0x5793a7+=0x1){var _0x51ed2c=_0x22eb67[_0x5793a7][_0x7d1e('0x4d')]({'plain':!![]});_0xca93fd[_0x7d1e('0x67')]=_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x67')]?_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x67')]:_0xca93fd[_0x7d1e('0x67')];switch(_0xca93fd[_0x7d1e('0x67')]){case _0x7d1e('0x68'):_0x23790f=squel[_0x7d1e('0x69')]()[_0x7d1e('0x6a')](_0x7d1e('0x6b'))[_0x7d1e('0x6c')](['phone',_0x7d1e('0x6d'),'ContactId',_0x7d1e('0x6e'),_0x7d1e('0x5e'),'createdAt',_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x71'),'phone')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x6d'))[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))['field'](_0x51ed2c['CmListId'][_0x7d1e('0x74')](),_0x7d1e('0x6e'))['field'](_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),'CampaignId')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))['where'](_0x7d1e('0x77'))[_0x7d1e('0x3f')](_0x7d1e('0x78'),_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')]())['where'](_0x7d1e('0x7a'))['where'](_0x7d1e('0x7b'),squel['select']()[_0x7d1e('0x70')](_0x7d1e('0x7c'))[_0x7d1e('0x75')]('cm_hopper_final')['where'](_0x7d1e('0x7d'),_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')]()))[_0x7d1e('0x3f')](_0x7d1e('0x7b'),squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x7e'))['from'](_0x7d1e('0x6b'))[_0x7d1e('0x3f')](_0x7d1e('0x7d'),_0x5dd05f['params']['id'][_0x7d1e('0x74')]())))[_0x7d1e('0x74')]();break;case _0x7d1e('0x7f'):_0x23790f=squel[_0x7d1e('0x69')]()['into'](_0x7d1e('0x6b'))['fromQuery'](['phone',_0x7d1e('0x6d'),'ContactId','ListId','CampaignId','createdAt',_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')]('phone',_0x7d1e('0x71'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x6d'))[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))[_0x7d1e('0x70')](_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')](),_0x7d1e('0x6e'))[_0x7d1e('0x70')](_0x5dd05f[_0x7d1e('0x48')]['id']['toString'](),'CampaignId')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))['where'](_0x7d1e('0x77'))['where'](_0x7d1e('0x78'),_0x51ed2c['CmListId']['toString']())['where'](_0x7d1e('0x7a'))['where'](_0x7d1e('0x7b'),squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x7e'))[_0x7d1e('0x75')]('cm_hopper')[_0x7d1e('0x3f')]('CampaignId\x20=\x20?',_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')]())))[_0x7d1e('0x74')]();break;default:_0x23790f=squel['insert']()[_0x7d1e('0x6a')](_0x7d1e('0x6b'))[_0x7d1e('0x6c')](['phone',_0x7d1e('0x6d'),'ContactId',_0x7d1e('0x6e'),_0x7d1e('0x5e'),_0x7d1e('0x56'),_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x71'),_0x7d1e('0x71'))[_0x7d1e('0x70')](_0x7d1e('0x72'),'scheduledAt')['field']('id','ContactId')[_0x7d1e('0x70')](_0x51ed2c[_0x7d1e('0x79')]['toString'](),_0x7d1e('0x6e'))['field'](_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),_0x7d1e('0x5e'))['field'](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))[_0x7d1e('0x3f')](_0x7d1e('0x77'))['where']('ListId\x20=\x20?',_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')]())[_0x7d1e('0x3f')](_0x7d1e('0x7a')))[_0x7d1e('0x74')]();}_0x53153f[_0x7d1e('0x80')](db[_0x7d1e('0x81')][_0x7d1e('0x33')](_0x23790f));}return BPromise[_0x7d1e('0x82')](_0x53153f);}})[_0x7d1e('0x24')](function(){return _0x4e5f78;})['then'](respondWithResult(_0x13698a,null))['catch'](handleError(_0x13698a,null));};exports[_0x7d1e('0x83')]=function(_0x59e013,_0x2d5b74,_0x90b4aa){return db[_0x7d1e('0x2f')]['find']({'where':{'id':_0x59e013[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x2d5b74,null))[_0x7d1e('0x24')](function(_0x3c6843){if(_0x3c6843){return _0x3c6843[_0x7d1e('0x83')](_0x59e013[_0x7d1e('0x33')][_0x7d1e('0x66')]);}})['then'](function(_0x5a13d3){if(_0x5a13d3){return db[_0x7d1e('0x5c')][_0x7d1e('0x25')]({'where':{'ListId':_0x59e013[_0x7d1e('0x33')][_0x7d1e('0x66')],'CampaignId':_0x59e013['params']['id']}})[_0x7d1e('0x24')](function(){return _0x5a13d3;});}})[_0x7d1e('0x24')](respondWithStatusCode(_0x2d5b74,null))[_0x7d1e('0x46')](handleError(_0x2d5b74,null));};exports[_0x7d1e('0x84')]=function(_0x4af5ae,_0x34ad7c,_0x376cf8){var _0x50a9a2={};var _0x16e020={};var _0x5cb468;var _0x2c5390;return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x4af5ae[_0x7d1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x34ad7c,null))[_0x7d1e('0x24')](function(_0x2eda37){if(_0x2eda37){_0x5cb468=_0x2eda37;_0x16e020[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x64')][_0x7d1e('0x49')]);_0x16e020[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x4af5ae[_0x7d1e('0x33')]);_0x16e020['filters']=_[_0x7d1e('0x36')](_0x16e020[_0x7d1e('0x37')],_0x16e020[_0x7d1e('0x33')]);_0x50a9a2[_0x7d1e('0x39')]=_['intersection'](_0x16e020[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x50a9a2[_0x7d1e('0x39')]=_0x50a9a2[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x50a9a2['attributes']:_0x16e020['model'];_0x50a9a2['order']=qs[_0x7d1e('0x3d')](_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x50a9a2[_0x7d1e('0x3f')]=qs['filters'](_[_0x7d1e('0x3e')](_0x4af5ae['query'],_0x16e020[_0x7d1e('0x35')]));if(_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x50a9a2[_0x7d1e('0x3f')]=_['merge'](_0x50a9a2['where'],{'$or':_[_0x7d1e('0x2e')](_0x50a9a2[_0x7d1e('0x39')],function(_0x3a0bef){var _0x2befa2={};_0x2befa2[_0x3a0bef]={'$like':'%'+_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x2befa2;})});}_0x50a9a2=_[_0x7d1e('0x40')]({},_0x50a9a2,_0x4af5ae[_0x7d1e('0x41')]);return _0x5cb468['getBlackLists'](_0x50a9a2);}})[_0x7d1e('0x24')](function(_0x800fc1){if(_0x800fc1){_0x2c5390=_0x800fc1['length'];if(!_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x50a9a2['limit']=qs[_0x7d1e('0x1f')](_0x4af5ae[_0x7d1e('0x33')]['limit']);_0x50a9a2[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x4af5ae['query'][_0x7d1e('0x1e')]);}return _0x5cb468[_0x7d1e('0x84')](_0x50a9a2);}})[_0x7d1e('0x24')](function(_0x69beec){if(_0x69beec){return _0x69beec?{'count':_0x2c5390,'rows':_0x69beec}:null;}})[_0x7d1e('0x24')](respondWithResult(_0x34ad7c,null))['catch'](handleError(_0x34ad7c,null));};exports[_0x7d1e('0x85')]=function(_0x572649,_0x444dc4,_0x1dfe2a){var _0x31387a,_0x47c79f;return db[_0x7d1e('0x2f')][_0x7d1e('0x54')]({'where':{'id':_0x572649[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x444dc4,null))[_0x7d1e('0x24')](function(_0x1d0937){if(_0x1d0937){_0x47c79f=_0x1d0937;return _0x1d0937[_0x7d1e('0x85')](_0x572649['body'][_0x7d1e('0x66')],_[_0x7d1e('0x55')](_0x572649[_0x7d1e('0x4b')],[_0x7d1e('0x66'),'id'])||{});}return null;})[_0x7d1e('0x86')](function(_0x22617e){var _0x4b966c;_0x31387a=_0x22617e||[];var _0x381c29=[];if(_0x22617e){for(var _0x2439d5=0x0;_0x2439d5<_0x22617e[_0x7d1e('0x3a')];_0x2439d5+=0x1){var _0x419536=_0x22617e[_0x2439d5]['get']({'plain':!![]});_0x4b966c=squel[_0x7d1e('0x69')]()[_0x7d1e('0x6a')]('cm_hopper_black')[_0x7d1e('0x6c')](['phone',_0x7d1e('0x73'),_0x7d1e('0x6e'),_0x7d1e('0x5e'),_0x7d1e('0x56'),_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')]('phone','phone')[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))['field'](_0x419536['CmListId'][_0x7d1e('0x74')](),_0x7d1e('0x6e'))['field'](_0x572649[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),_0x7d1e('0x5e'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))['field'](_0x7d1e('0x72'),_0x7d1e('0x57'))['from'](_0x7d1e('0x76'))[_0x7d1e('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0x7d1e('0x78'),_0x419536[_0x7d1e('0x79')][_0x7d1e('0x74')]())[_0x7d1e('0x3f')](_0x7d1e('0x7a')))['toString']();_0x381c29['push'](db['sequelize'][_0x7d1e('0x33')](_0x4b966c));}return BPromise['all'](_0x381c29);}})['then'](function(){return _0x31387a;})[_0x7d1e('0x24')](respondWithResult(_0x444dc4,null))['catch'](handleError(_0x444dc4,null));};exports[_0x7d1e('0x87')]=function(_0x12adc0,_0x5da1e5,_0x378ee2){return db['Campaign'][_0x7d1e('0x54')]({'where':{'id':_0x12adc0[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x5da1e5,null))[_0x7d1e('0x24')](function(_0x9ea85b){if(_0x9ea85b){return _0x9ea85b[_0x7d1e('0x87')](_0x12adc0[_0x7d1e('0x33')][_0x7d1e('0x66')]);}})['then'](function(_0x39f005){if(_0x39f005){return db[_0x7d1e('0x63')][_0x7d1e('0x25')]({'where':{'ListId':_0x12adc0[_0x7d1e('0x33')][_0x7d1e('0x66')],'CampaignId':_0x12adc0[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](function(){return _0x39f005;});}})['then'](respondWithStatusCode(_0x5da1e5,null))[_0x7d1e('0x46')](handleError(_0x5da1e5,null));};
\ No newline at end of file
+var _0x51da=['model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','Campaign','rawAttributes','type','key'];(function(_0x43e511,_0x4b75f3){var _0xe2988c=function(_0x331106){while(--_0x331106){_0x43e511['push'](_0x43e511['shift']());}};_0xe2988c(++_0x4b75f3);}(_0x51da,0x168));var _0xa51d=function(_0x502966,_0x7a71b5){_0x502966=_0x502966-0x0;var _0x82ed3a=_0x51da[_0x502966];return _0x82ed3a;};'use strict';var emlformat=require(_0xa51d('0x0'));var rimraf=require(_0xa51d('0x1'));var zipdir=require(_0xa51d('0x2'));var jsonpatch=require(_0xa51d('0x3'));var rp=require(_0xa51d('0x4'));var moment=require('moment');var BPromise=require(_0xa51d('0x5'));var Mustache=require(_0xa51d('0x6'));var util=require(_0xa51d('0x7'));var path=require(_0xa51d('0x8'));var sox=require(_0xa51d('0x9'));var csv=require(_0xa51d('0xa'));var ejs=require(_0xa51d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa51d('0xc'));var squel=require('squel');var crypto=require(_0xa51d('0xd'));var jsforce=require(_0xa51d('0xe'));var deskjs=require(_0xa51d('0xf'));var toCsv=require(_0xa51d('0xa'));var querystring=require(_0xa51d('0x10'));var Papa=require(_0xa51d('0x11'));var Redis=require(_0xa51d('0x12'));var authService=require(_0xa51d('0x13'));var qs=require(_0xa51d('0x14'));var as=require(_0xa51d('0x15'));var hardwareService=require(_0xa51d('0x16'));var logger=require(_0xa51d('0x17'))(_0xa51d('0x18'));var utils=require(_0xa51d('0x19'));var config=require(_0xa51d('0x1a'));var licenseUtil=require(_0xa51d('0x1b'));var db=require(_0xa51d('0x1c'))['db'];function respondWithStatusCode(_0x53cb4e,_0x1539c6){_0x1539c6=_0x1539c6||0xcc;return function(_0x1db86f){if(_0x1db86f){return _0x53cb4e['sendStatus'](_0x1539c6);}return _0x53cb4e[_0xa51d('0x1d')](_0x1539c6)[_0xa51d('0x1e')]();};}function respondWithResult(_0x229996,_0x122be5){_0x122be5=_0x122be5||0xc8;return function(_0x1c8cd9){if(_0x1c8cd9){return _0x229996[_0xa51d('0x1d')](_0x122be5)[_0xa51d('0x1f')](_0x1c8cd9);}};}function respondWithFilteredResult(_0x262503,_0x36cc62){return function(_0x273103){if(_0x273103){var _0x1ca2f5=typeof _0x36cc62[_0xa51d('0x20')]===_0xa51d('0x21')&&typeof _0x36cc62[_0xa51d('0x22')]===_0xa51d('0x21');var _0x441d3e=_0x273103[_0xa51d('0x23')];var _0x22df22=_0x1ca2f5?0x0:_0x36cc62[_0xa51d('0x20')];var _0x576d4c=_0x1ca2f5?_0x273103[_0xa51d('0x23')]:_0x36cc62[_0xa51d('0x20')]+_0x36cc62[_0xa51d('0x22')];var _0x411921;if(_0x576d4c>=_0x441d3e){_0x576d4c=_0x441d3e;_0x411921=0xc8;}else{_0x411921=0xce;}_0x262503[_0xa51d('0x1d')](_0x411921);return _0x262503['set'](_0xa51d('0x24'),_0x22df22+'-'+_0x576d4c+'/'+_0x441d3e)[_0xa51d('0x1f')](_0x273103);}return null;};}function patchUpdates(_0x48bb9c){return function(_0x4acd99){try{jsonpatch['apply'](_0x4acd99,_0x48bb9c,!![]);}catch(_0x287b09){return BPromise[_0xa51d('0x25')](_0x287b09);}return _0x4acd99['save']();};}function saveUpdates(_0x53615a,_0x138eea){return function(_0x17c65c){if(_0x17c65c){return _0x17c65c[_0xa51d('0x26')](_0x53615a)[_0xa51d('0x27')](function(_0x2a8fde){return _0x2a8fde;});}return null;};}function removeEntity(_0x23c8a2,_0x2364ae){return function(_0xb59307){if(_0xb59307){return _0xb59307['destroy']()['then'](function(){var _0x411362=_0xb59307[_0xa51d('0x28')]({'plain':!![]});var _0x33c23b=_0xa51d('0x29');return db[_0xa51d('0x2a')][_0xa51d('0x2b')]({'where':{'type':_0x33c23b,'resourceId':_0x411362['id']}})[_0xa51d('0x27')](function(){return _0xb59307;});})[_0xa51d('0x27')](function(){_0x23c8a2[_0xa51d('0x1d')](0xcc)[_0xa51d('0x1e')]();});}};}function handleEntityNotFound(_0x8c7ed5,_0x8015ac){return function(_0x28c1a3){if(!_0x28c1a3){_0x8c7ed5[_0xa51d('0x2c')](0x194);}return _0x28c1a3;};}function handleError(_0x8da04,_0x1abda7){_0x1abda7=_0x1abda7||0x1f4;return function(_0x1f9fa2){logger['error'](_0x1f9fa2[_0xa51d('0x2d')]);if(_0x1f9fa2[_0xa51d('0x2e')]){delete _0x1f9fa2[_0xa51d('0x2e')];}_0x8da04[_0xa51d('0x1d')](_0x1abda7)[_0xa51d('0x2f')](_0x1f9fa2);};}exports[_0xa51d('0x30')]=function(_0x359f8c,_0x33f620){var _0x27ed59={},_0x1a7c5c={},_0x2f5aac={'count':0x0,'rows':[]};var _0x1e9dcb=_[_0xa51d('0x31')](db[_0xa51d('0x32')][_0xa51d('0x33')],function(_0x1888f5){return{'name':_0x1888f5['fieldName'],'type':_0x1888f5[_0xa51d('0x34')][_0xa51d('0x35')]};});_0x1a7c5c[_0xa51d('0x36')]=_[_0xa51d('0x31')](_0x1e9dcb,_0xa51d('0x2e'));_0x1a7c5c[_0xa51d('0x37')]=_['keys'](_0x359f8c[_0xa51d('0x37')]);_0x1a7c5c[_0xa51d('0x38')]=_[_0xa51d('0x39')](_0x1a7c5c[_0xa51d('0x36')],_0x1a7c5c[_0xa51d('0x37')]);_0x27ed59[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x1a7c5c[_0xa51d('0x36')],qs['fields'](_0x359f8c[_0xa51d('0x37')]['fields']));_0x27ed59[_0xa51d('0x3a')]=_0x27ed59[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x27ed59[_0xa51d('0x3a')]:_0x1a7c5c[_0xa51d('0x36')];if(!_0x359f8c[_0xa51d('0x37')][_0xa51d('0x3c')]('nolimit')){_0x27ed59['limit']=qs[_0xa51d('0x22')](_0x359f8c[_0xa51d('0x37')][_0xa51d('0x22')]);_0x27ed59[_0xa51d('0x20')]=qs['offset'](_0x359f8c[_0xa51d('0x37')][_0xa51d('0x20')]);}_0x27ed59[_0xa51d('0x3d')]=qs[_0xa51d('0x3e')](_0x359f8c[_0xa51d('0x37')][_0xa51d('0x3e')]);_0x27ed59[_0xa51d('0x3f')]=qs['filters'](_[_0xa51d('0x40')](_0x359f8c[_0xa51d('0x37')],_0x1a7c5c['filters']),_0x1e9dcb);if(_0x359f8c[_0xa51d('0x37')][_0xa51d('0x41')]){_0x27ed59[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x27ed59['where'],{'$or':_[_0xa51d('0x31')](_0x1e9dcb,function(_0x19eeeb){if(_0x19eeeb[_0xa51d('0x34')]!=='VIRTUAL'){var _0x17f27a={};_0x17f27a[_0x19eeeb[_0xa51d('0x2e')]]={'$like':'%'+_0x359f8c[_0xa51d('0x37')][_0xa51d('0x41')]+'%'};return _0x17f27a;}})});}_0x27ed59=_[_0xa51d('0x42')]({},_0x27ed59,_0x359f8c[_0xa51d('0x43')]);var _0x4f24b3={'where':_0x27ed59[_0xa51d('0x3f')]};return db['Campaign'][_0xa51d('0x23')](_0x4f24b3)['then'](function(_0x1c6b88){_0x2f5aac[_0xa51d('0x23')]=_0x1c6b88;if(_0x359f8c[_0xa51d('0x37')][_0xa51d('0x44')]){_0x27ed59[_0xa51d('0x45')]=[{'all':!![]}];}return db['Campaign'][_0xa51d('0x46')](_0x27ed59);})[_0xa51d('0x27')](function(_0x305f1b){_0x2f5aac[_0xa51d('0x47')]=_0x305f1b;return _0x2f5aac;})[_0xa51d('0x27')](respondWithFilteredResult(_0x33f620,_0x27ed59))[_0xa51d('0x48')](handleError(_0x33f620,null));};exports[_0xa51d('0x49')]=function(_0x23b504,_0x9b788){var _0x46665b={'raw':![],'where':{'id':_0x23b504[_0xa51d('0x4a')]['id']}},_0x390251={};_0x390251[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x32')][_0xa51d('0x33')]);_0x390251[_0xa51d('0x37')]=_[_0xa51d('0x4b')](_0x23b504['query']);_0x390251[_0xa51d('0x38')]=_[_0xa51d('0x39')](_0x390251['model'],_0x390251[_0xa51d('0x37')]);_0x46665b[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x390251[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x23b504[_0xa51d('0x37')]['fields']));_0x46665b[_0xa51d('0x3a')]=_0x46665b[_0xa51d('0x3a')]['length']?_0x46665b['attributes']:_0x390251[_0xa51d('0x36')];if(_0x23b504[_0xa51d('0x37')][_0xa51d('0x44')]){_0x46665b[_0xa51d('0x45')]=[{'all':!![]}];}_0x46665b=_[_0xa51d('0x42')]({},_0x46665b,_0x23b504['options']);return db[_0xa51d('0x32')]['find'](_0x46665b)[_0xa51d('0x27')](handleEntityNotFound(_0x9b788,null))[_0xa51d('0x27')](respondWithResult(_0x9b788,null))[_0xa51d('0x48')](handleError(_0x9b788,null));};exports[_0xa51d('0x4d')]=function(_0x1c90c7,_0xf14a4b){return db['Campaign'][_0xa51d('0x4d')](_0x1c90c7[_0xa51d('0x4e')],{})[_0xa51d('0x27')](function(_0x1e53cc){var _0x59d8a8=_0x1c90c7[_0xa51d('0x4f')]['get']({'plain':!![]});if(!_0x59d8a8)throw new Error(_0xa51d('0x50'));if(_0x59d8a8[_0xa51d('0x51')]===_0xa51d('0x4f')){var _0x1d2527=_0x1e53cc[_0xa51d('0x28')]({'plain':!![]});var _0x11d8e1=_0xa51d('0x29');return db[_0xa51d('0x52')][_0xa51d('0x53')]({'where':{'name':_0x11d8e1,'userProfileId':_0x59d8a8[_0xa51d('0x54')]},'raw':!![]})['then'](function(_0x3e423b){if(_0x3e423b&&_0x3e423b['autoAssociation']===0x0){return db['UserProfileResource'][_0xa51d('0x4d')]({'name':_0x1d2527[_0xa51d('0x2e')],'resourceId':_0x1d2527['id'],'type':_0x3e423b['name'],'sectionId':_0x3e423b['id']},{})[_0xa51d('0x27')](function(){return _0x1e53cc;});}else{return _0x1e53cc;}})[_0xa51d('0x48')](function(_0x1d0da7){logger[_0xa51d('0x55')](_0xa51d('0x56'),_0x1d0da7);throw _0x1d0da7;});}return _0x1e53cc;})[_0xa51d('0x27')](respondWithResult(_0xf14a4b,0xc9))[_0xa51d('0x48')](handleError(_0xf14a4b,null));};exports['clone']=function(_0x386ab6,_0x282ead){var _0x373aee={'where':{'id':_0x386ab6['params']['id']}},_0x156f59={};_0x156f59[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x32')]['rawAttributes']);_0x373aee[_0xa51d('0x3a')]=_['intersection'](_0x156f59[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x386ab6[_0xa51d('0x37')][_0xa51d('0x4c')]));_0x373aee[_0xa51d('0x3a')]=_0x373aee[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x373aee[_0xa51d('0x3a')]:_0x156f59['model'];if(_0x386ab6[_0xa51d('0x37')][_0xa51d('0x44')]){_0x373aee[_0xa51d('0x45')]=[{'all':!![]}];}_0x373aee=_['merge']({},_0x373aee,_0x386ab6['options']);return db[_0xa51d('0x32')][_0xa51d('0x53')](_0x373aee)[_0xa51d('0x27')](handleEntityNotFound(_0x282ead,null))[_0xa51d('0x27')](function(_0x1f6a8b){if(_0x1f6a8b){var _0x359046=_0x1f6a8b[_0xa51d('0x28')]({'plain':!![]});_0x359046=qs[_0xa51d('0x57')](_0x359046,['id',_0xa51d('0x58'),_0xa51d('0x59')]);_0x386ab6[_0xa51d('0x4e')]=_['omit'](_0x386ab6[_0xa51d('0x4e')],['id',_0xa51d('0x58'),_0xa51d('0x59')]);return db[_0xa51d('0x32')]['create'](_[_0xa51d('0x42')](_0x359046,_0x386ab6[_0xa51d('0x4e')]),{'include':_0x386ab6[_0xa51d('0x37')][_0xa51d('0x44')]?[{'all':!![]}]:undefined})[_0xa51d('0x27')](function(_0x3d53a6){var _0x52bb04=_0x386ab6['user'][_0xa51d('0x28')]({'plain':!![]});if(!_0x52bb04)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52bb04[_0xa51d('0x51')]===_0xa51d('0x4f')){var _0x2b0016=_0x3d53a6[_0xa51d('0x28')]({'plain':!![]});var _0x38de46=_0xa51d('0x29');return db[_0xa51d('0x52')][_0xa51d('0x53')]({'where':{'name':_0x38de46,'userProfileId':_0x52bb04[_0xa51d('0x54')]},'raw':!![]})[_0xa51d('0x27')](function(_0x83a955){if(_0x83a955&&_0x83a955['autoAssociation']===0x0){return db[_0xa51d('0x2a')][_0xa51d('0x4d')]({'name':_0x2b0016['name'],'resourceId':_0x2b0016['id'],'type':_0x83a955[_0xa51d('0x2e')],'sectionId':_0x83a955['id']},{})[_0xa51d('0x27')](function(){return _0x3d53a6;});}else{return _0x3d53a6;}})[_0xa51d('0x48')](function(_0x28dd89){logger[_0xa51d('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28dd89);throw _0x28dd89;});}return _0x3d53a6;});}})[_0xa51d('0x27')](respondWithResult(_0x282ead,0xc9))[_0xa51d('0x48')](handleError(_0x282ead,null));};exports[_0xa51d('0x26')]=function(_0x109069,_0x1d0724){if(_0x109069[_0xa51d('0x4e')]['id']){delete _0x109069[_0xa51d('0x4e')]['id'];}return db[_0xa51d('0x32')]['find']({'where':{'id':_0x109069[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x1d0724,null))[_0xa51d('0x27')](saveUpdates(_0x109069[_0xa51d('0x4e')],null))[_0xa51d('0x27')](respondWithResult(_0x1d0724,null))[_0xa51d('0x48')](handleError(_0x1d0724,null));};exports[_0xa51d('0x2b')]=function(_0x34e2bf,_0x45b2ac){return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x34e2bf[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x45b2ac,null))[_0xa51d('0x27')](removeEntity(_0x45b2ac,null))['catch'](handleError(_0x45b2ac,null));};exports[_0xa51d('0x5a')]=function(_0x5f13cb,_0x31139a,_0x53ee92){var _0x4f1d2f={'raw':!![],'where':{}};var _0x3c566e={};var _0x3c15a5={'count':0x0,'rows':[]};return db[_0xa51d('0x32')][_0xa51d('0x5b')]({'where':{'id':_0x5f13cb[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x31139a,null))['then'](function(_0x4a28c3){if(_0x4a28c3){_0x3c566e[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db['CmHopper'][_0xa51d('0x33')]);_0x3c566e[_0xa51d('0x37')]=_[_0xa51d('0x4b')](_0x5f13cb[_0xa51d('0x37')]);_0x3c566e['filters']=_[_0xa51d('0x39')](_0x3c566e[_0xa51d('0x36')],_0x3c566e[_0xa51d('0x37')]);_0x4f1d2f[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x3c566e[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x5f13cb[_0xa51d('0x37')][_0xa51d('0x4c')]));_0x4f1d2f[_0xa51d('0x3a')]=_0x4f1d2f['attributes'][_0xa51d('0x3b')]?_0x4f1d2f['attributes']:_0x3c566e['model'];if(!_0x5f13cb[_0xa51d('0x37')]['hasOwnProperty']('nolimit')){_0x4f1d2f[_0xa51d('0x22')]=qs[_0xa51d('0x22')](_0x5f13cb[_0xa51d('0x37')]['limit']);_0x4f1d2f[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0x5f13cb['query']['offset']);}_0x4f1d2f[_0xa51d('0x3d')]=qs['sort'](_0x5f13cb[_0xa51d('0x37')][_0xa51d('0x3e')]);_0x4f1d2f[_0xa51d('0x3f')]=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x5f13cb[_0xa51d('0x37')],_0x3c566e[_0xa51d('0x38')]));_0x4f1d2f[_0xa51d('0x3f')]['CampaignId']=_0x4a28c3['id'];if(_0x5f13cb[_0xa51d('0x37')][_0xa51d('0x41')]){_0x4f1d2f[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x4f1d2f['where'],{'$or':_['map'](_0x4f1d2f[_0xa51d('0x3a')],function(_0x20c96d){var _0x1fadaf={};_0x1fadaf[_0x20c96d]={'$like':'%'+_0x5f13cb[_0xa51d('0x37')]['filter']+'%'};return _0x1fadaf;})});}_0x4f1d2f=_[_0xa51d('0x42')]({},_0x4f1d2f,_0x5f13cb[_0xa51d('0x43')]);return db['CmHopper'][_0xa51d('0x23')]({'where':_0x4f1d2f['where']})['then'](function(_0x52c02b){_0x3c15a5['count']=_0x52c02b;if(_0x5f13cb[_0xa51d('0x37')]['includeAll']){_0x4f1d2f['include']=[{'all':!![]}];}return db[_0xa51d('0x5c')][_0xa51d('0x46')](_0x4f1d2f);})[_0xa51d('0x27')](function(_0x2084d8){_0x3c15a5['rows']=_0x2084d8;return _0x3c15a5;});}})[_0xa51d('0x27')](respondWithFilteredResult(_0x31139a,_0x4f1d2f))['catch'](handleError(_0x31139a,null));};exports[_0xa51d('0x5d')]=function(_0x18fcf0,_0x919d9b,_0x6e8840){var _0x16df62={'raw':!![],'where':{}};var _0x5adcab={};var _0x1981af={'count':0x0,'rows':[]};return db[_0xa51d('0x32')][_0xa51d('0x5b')]({'where':{'id':_0x18fcf0[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x919d9b,null))[_0xa51d('0x27')](function(_0x199280){if(_0x199280){_0x5adcab[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x5e')][_0xa51d('0x33')]);_0x5adcab[_0xa51d('0x37')]=_[_0xa51d('0x4b')](_0x18fcf0['query']);_0x5adcab[_0xa51d('0x38')]=_[_0xa51d('0x39')](_0x5adcab[_0xa51d('0x36')],_0x5adcab['query']);_0x16df62['attributes']=_[_0xa51d('0x39')](_0x5adcab['model'],qs[_0xa51d('0x4c')](_0x18fcf0['query'][_0xa51d('0x4c')]));_0x16df62[_0xa51d('0x3a')]=_0x16df62[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x16df62[_0xa51d('0x3a')]:_0x5adcab[_0xa51d('0x36')];if(!_0x18fcf0['query']['hasOwnProperty'](_0xa51d('0x5f'))){_0x16df62[_0xa51d('0x22')]=qs[_0xa51d('0x22')](_0x18fcf0[_0xa51d('0x37')]['limit']);_0x16df62[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0x18fcf0[_0xa51d('0x37')][_0xa51d('0x20')]);}_0x16df62[_0xa51d('0x3d')]=qs['sort'](_0x18fcf0['query']['sort']);_0x16df62[_0xa51d('0x3f')]=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x18fcf0[_0xa51d('0x37')],_0x5adcab[_0xa51d('0x38')]));_0x16df62[_0xa51d('0x3f')]['CampaignId']=_0x199280['id'];if(_0x18fcf0[_0xa51d('0x37')]['filter']){_0x16df62[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x16df62[_0xa51d('0x3f')],{'$or':_[_0xa51d('0x31')](_0x16df62[_0xa51d('0x3a')],function(_0x4dfcce){var _0x168083={};_0x168083[_0x4dfcce]={'$like':'%'+_0x18fcf0[_0xa51d('0x37')][_0xa51d('0x41')]+'%'};return _0x168083;})});}_0x16df62=_[_0xa51d('0x42')]({},_0x16df62,_0x18fcf0[_0xa51d('0x43')]);return db['CmHopperHistory'][_0xa51d('0x23')]({'where':_0x16df62['where']})['then'](function(_0x5d09c3){_0x1981af[_0xa51d('0x23')]=_0x5d09c3;if(_0x18fcf0[_0xa51d('0x37')][_0xa51d('0x44')]){_0x16df62[_0xa51d('0x45')]=[{'all':!![]}];}return db[_0xa51d('0x5e')]['findAll'](_0x16df62);})[_0xa51d('0x27')](function(_0x274a0b){_0x1981af[_0xa51d('0x47')]=_0x274a0b;return _0x1981af;});}})[_0xa51d('0x27')](respondWithFilteredResult(_0x919d9b,_0x16df62))[_0xa51d('0x48')](handleError(_0x919d9b,null));};exports[_0xa51d('0x60')]=function(_0x12e279,_0x496be2,_0x55c8cb){var _0xdb8728={'raw':!![],'where':{}};var _0x29ef97={};var _0x30691e={'count':0x0,'rows':[]};return db[_0xa51d('0x32')][_0xa51d('0x5b')]({'where':{'id':_0x12e279[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x496be2,null))['then'](function(_0x19cd13){if(_0x19cd13){_0x29ef97[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x61')][_0xa51d('0x33')]);_0x29ef97['query']=_[_0xa51d('0x4b')](_0x12e279[_0xa51d('0x37')]);_0x29ef97[_0xa51d('0x38')]=_[_0xa51d('0x39')](_0x29ef97[_0xa51d('0x36')],_0x29ef97['query']);_0xdb8728['attributes']=_[_0xa51d('0x39')](_0x29ef97[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x12e279[_0xa51d('0x37')][_0xa51d('0x4c')]));_0xdb8728['attributes']=_0xdb8728[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0xdb8728[_0xa51d('0x3a')]:_0x29ef97['model'];if(!_0x12e279[_0xa51d('0x37')][_0xa51d('0x3c')](_0xa51d('0x5f'))){_0xdb8728[_0xa51d('0x22')]=qs['limit'](_0x12e279['query'][_0xa51d('0x22')]);_0xdb8728[_0xa51d('0x20')]=qs['offset'](_0x12e279['query'][_0xa51d('0x20')]);}_0xdb8728[_0xa51d('0x3d')]=qs['sort'](_0x12e279['query'][_0xa51d('0x3e')]);_0xdb8728['where']=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x12e279[_0xa51d('0x37')],_0x29ef97['filters']));_0xdb8728[_0xa51d('0x3f')][_0xa51d('0x62')]=_0x19cd13['id'];if(_0x12e279[_0xa51d('0x37')][_0xa51d('0x41')]){_0xdb8728[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0xdb8728[_0xa51d('0x3f')],{'$or':_['map'](_0xdb8728[_0xa51d('0x3a')],function(_0x2fdb63){var _0x353ceb={};_0x353ceb[_0x2fdb63]={'$like':'%'+_0x12e279[_0xa51d('0x37')]['filter']+'%'};return _0x353ceb;})});}_0xdb8728=_['merge']({},_0xdb8728,_0x12e279[_0xa51d('0x43')]);return db[_0xa51d('0x61')][_0xa51d('0x23')]({'where':_0xdb8728['where']})[_0xa51d('0x27')](function(_0x277d86){_0x30691e['count']=_0x277d86;if(_0x12e279[_0xa51d('0x37')][_0xa51d('0x44')]){_0xdb8728[_0xa51d('0x45')]=[{'all':!![]}];}return db[_0xa51d('0x61')][_0xa51d('0x46')](_0xdb8728);})[_0xa51d('0x27')](function(_0x12dcb0){_0x30691e[_0xa51d('0x47')]=_0x12dcb0;return _0x30691e;});}})[_0xa51d('0x27')](respondWithFilteredResult(_0x496be2,_0xdb8728))[_0xa51d('0x48')](handleError(_0x496be2,null));};exports['getHopperBlacks']=function(_0x494d7b,_0x2d57eb,_0x7d7d2d){var _0x1f8233={'raw':!![],'where':{}};var _0x11f928={};var _0x1746f7={'count':0x0,'rows':[]};return db[_0xa51d('0x32')]['findOne']({'where':{'id':_0x494d7b['params']['id']}})['then'](handleEntityNotFound(_0x2d57eb,null))[_0xa51d('0x27')](function(_0x47b702){if(_0x47b702){_0x11f928['model']=_['keys'](db[_0xa51d('0x63')][_0xa51d('0x33')]);_0x11f928['query']=_[_0xa51d('0x4b')](_0x494d7b[_0xa51d('0x37')]);_0x11f928[_0xa51d('0x38')]=_['intersection'](_0x11f928[_0xa51d('0x36')],_0x11f928['query']);_0x1f8233[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x11f928[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x494d7b[_0xa51d('0x37')]['fields']));_0x1f8233[_0xa51d('0x3a')]=_0x1f8233[_0xa51d('0x3a')]['length']?_0x1f8233['attributes']:_0x11f928['model'];if(!_0x494d7b['query'][_0xa51d('0x3c')](_0xa51d('0x5f'))){_0x1f8233[_0xa51d('0x22')]=qs[_0xa51d('0x22')](_0x494d7b['query'][_0xa51d('0x22')]);_0x1f8233[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0x494d7b[_0xa51d('0x37')][_0xa51d('0x20')]);}_0x1f8233[_0xa51d('0x3d')]=qs[_0xa51d('0x3e')](_0x494d7b[_0xa51d('0x37')][_0xa51d('0x3e')]);_0x1f8233[_0xa51d('0x3f')]=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x494d7b[_0xa51d('0x37')],_0x11f928[_0xa51d('0x38')]));_0x1f8233['where']['CampaignId']=_0x47b702['id'];if(_0x494d7b[_0xa51d('0x37')][_0xa51d('0x41')]){_0x1f8233[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x1f8233['where'],{'$or':_[_0xa51d('0x31')](_0x1f8233[_0xa51d('0x3a')],function(_0x336dea){var _0x57f0ad={};_0x57f0ad[_0x336dea]={'$like':'%'+_0x494d7b[_0xa51d('0x37')][_0xa51d('0x41')]+'%'};return _0x57f0ad;})});}_0x1f8233=_['merge']({},_0x1f8233,_0x494d7b[_0xa51d('0x43')]);return db[_0xa51d('0x63')]['count']({'where':_0x1f8233['where']})[_0xa51d('0x27')](function(_0x2ac61f){_0x1746f7[_0xa51d('0x23')]=_0x2ac61f;if(_0x494d7b[_0xa51d('0x37')]['includeAll']){_0x1f8233['include']=[{'all':!![]}];}return db[_0xa51d('0x63')]['findAll'](_0x1f8233);})[_0xa51d('0x27')](function(_0x3c0bac){_0x1746f7['rows']=_0x3c0bac;return _0x1746f7;});}})[_0xa51d('0x27')](respondWithFilteredResult(_0x2d57eb,_0x1f8233))[_0xa51d('0x48')](handleError(_0x2d57eb,null));};exports[_0xa51d('0x64')]=function(_0xa661bd,_0x41e5fb,_0x463d46){var _0x5d26c9={};var _0x69864f={};var _0x19bda0;var _0x52f20b;return db['Campaign']['findOne']({'where':{'id':_0xa661bd[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x41e5fb,null))[_0xa51d('0x27')](function(_0x1af715){if(_0x1af715){_0x19bda0=_0x1af715;_0x69864f[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x65')][_0xa51d('0x33')]);_0x69864f[_0xa51d('0x37')]=_['keys'](_0xa661bd[_0xa51d('0x37')]);_0x69864f['filters']=_[_0xa51d('0x39')](_0x69864f[_0xa51d('0x36')],_0x69864f[_0xa51d('0x37')]);_0x5d26c9[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x69864f['model'],qs[_0xa51d('0x4c')](_0xa661bd[_0xa51d('0x37')][_0xa51d('0x4c')]));_0x5d26c9['attributes']=_0x5d26c9[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x5d26c9[_0xa51d('0x3a')]:_0x69864f[_0xa51d('0x36')];_0x5d26c9[_0xa51d('0x3d')]=qs[_0xa51d('0x3e')](_0xa661bd[_0xa51d('0x37')][_0xa51d('0x3e')]);_0x5d26c9[_0xa51d('0x3f')]=qs['filters'](_[_0xa51d('0x40')](_0xa661bd[_0xa51d('0x37')],_0x69864f[_0xa51d('0x38')]));if(_0xa661bd['query'][_0xa51d('0x41')]){_0x5d26c9[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x5d26c9[_0xa51d('0x3f')],{'$or':_['map'](_0x5d26c9[_0xa51d('0x3a')],function(_0x586cf9){var _0x2e613f={};_0x2e613f[_0x586cf9]={'$like':'%'+_0xa661bd[_0xa51d('0x37')]['filter']+'%'};return _0x2e613f;})});}_0x5d26c9=_[_0xa51d('0x42')]({},_0x5d26c9,_0xa661bd[_0xa51d('0x43')]);return _0x19bda0['getLists'](_0x5d26c9);}})['then'](function(_0xe88f58){if(_0xe88f58){_0x52f20b=_0xe88f58['length'];if(!_0xa661bd[_0xa51d('0x37')][_0xa51d('0x3c')](_0xa51d('0x5f'))){_0x5d26c9[_0xa51d('0x22')]=qs[_0xa51d('0x22')](_0xa661bd['query'][_0xa51d('0x22')]);_0x5d26c9[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0xa661bd['query'][_0xa51d('0x20')]);}return _0x19bda0[_0xa51d('0x64')](_0x5d26c9);}})[_0xa51d('0x27')](function(_0x504b1f){if(_0x504b1f){return _0x504b1f?{'count':_0x52f20b,'rows':_0x504b1f}:null;}})[_0xa51d('0x27')](respondWithResult(_0x41e5fb,null))[_0xa51d('0x48')](handleError(_0x41e5fb,null));};exports['addLists']=function(_0x5a178e,_0x2d2009,_0x488ce9){var _0x1f6bf0,_0x10b5ff;return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x5a178e['params']['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x2d2009,null))[_0xa51d('0x27')](function(_0x2a9473){if(_0x2a9473){_0x10b5ff=_0x2a9473;return _0x2a9473[_0xa51d('0x66')](_0x5a178e[_0xa51d('0x4e')][_0xa51d('0x67')],_[_0xa51d('0x57')](_0x5a178e[_0xa51d('0x4e')],[_0xa51d('0x67'),'id'])||{});}return null;})[_0xa51d('0x68')](function(_0x6613aa){var _0x351129;_0x1f6bf0=_0x6613aa||[];var _0x17d467=[];if(_0x6613aa){for(var _0x5d7648=0x0;_0x5d7648<_0x6613aa[_0xa51d('0x3b')];_0x5d7648+=0x1){var _0xfb60fa=_0x6613aa[_0x5d7648][_0xa51d('0x28')]({'plain':!![]});_0x10b5ff[_0xa51d('0x69')]=_0x5a178e[_0xa51d('0x4e')][_0xa51d('0x69')]?_0x5a178e[_0xa51d('0x4e')][_0xa51d('0x69')]:_0x10b5ff[_0xa51d('0x69')];switch(_0x10b5ff[_0xa51d('0x69')]){case _0xa51d('0x6a'):_0x351129=squel[_0xa51d('0x6b')]()[_0xa51d('0x6c')](_0xa51d('0x6d'))[_0xa51d('0x6e')](['phone',_0xa51d('0x6f'),_0xa51d('0x70'),_0xa51d('0x71'),_0xa51d('0x62'),'createdAt',_0xa51d('0x59')],squel['select']()['field'](_0xa51d('0x72'),_0xa51d('0x72'))[_0xa51d('0x73')](_0xa51d('0x74'),'scheduledAt')[_0xa51d('0x73')]('id',_0xa51d('0x70'))['field'](_0xfb60fa[_0xa51d('0x75')][_0xa51d('0x76')](),_0xa51d('0x71'))[_0xa51d('0x73')](_0x5a178e['params']['id'][_0xa51d('0x76')](),_0xa51d('0x62'))['field']('NOW()',_0xa51d('0x58'))[_0xa51d('0x73')]('NOW()',_0xa51d('0x59'))[_0xa51d('0x77')](_0xa51d('0x78'))[_0xa51d('0x3f')](_0xa51d('0x79'))[_0xa51d('0x3f')]('ListId\x20=\x20?',_0xfb60fa['CmListId'][_0xa51d('0x76')]())[_0xa51d('0x3f')](_0xa51d('0x7a'))[_0xa51d('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa51d('0x7b')]()['field'](_0xa51d('0x7c'))['from']('cm_hopper_final')['where'](_0xa51d('0x7d'),_0x5a178e['params']['id']['toString']()))[_0xa51d('0x3f')](_0xa51d('0x7e'),squel[_0xa51d('0x7b')]()[_0xa51d('0x73')](_0xa51d('0x7f'))[_0xa51d('0x77')](_0xa51d('0x6d'))[_0xa51d('0x3f')]('CampaignId\x20=\x20?',_0x5a178e['params']['id'][_0xa51d('0x76')]())))['toString']();break;case _0xa51d('0x80'):_0x351129=squel[_0xa51d('0x6b')]()['into'](_0xa51d('0x6d'))[_0xa51d('0x6e')]([_0xa51d('0x72'),_0xa51d('0x6f'),_0xa51d('0x70'),_0xa51d('0x71'),_0xa51d('0x62'),_0xa51d('0x58'),_0xa51d('0x59')],squel[_0xa51d('0x7b')]()['field']('phone',_0xa51d('0x72'))[_0xa51d('0x73')](_0xa51d('0x74'),_0xa51d('0x6f'))[_0xa51d('0x73')]('id',_0xa51d('0x70'))[_0xa51d('0x73')](_0xfb60fa['CmListId']['toString'](),_0xa51d('0x71'))[_0xa51d('0x73')](_0x5a178e['params']['id'][_0xa51d('0x76')](),'CampaignId')['field'](_0xa51d('0x74'),_0xa51d('0x58'))['field']('NOW()',_0xa51d('0x59'))[_0xa51d('0x77')]('cm_contacts')[_0xa51d('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0xa51d('0x81'),_0xfb60fa[_0xa51d('0x75')][_0xa51d('0x76')]())[_0xa51d('0x3f')](_0xa51d('0x7a'))[_0xa51d('0x3f')](_0xa51d('0x7e'),squel[_0xa51d('0x7b')]()[_0xa51d('0x73')](_0xa51d('0x7f'))[_0xa51d('0x77')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x5a178e[_0xa51d('0x4a')]['id'][_0xa51d('0x76')]())))[_0xa51d('0x76')]();break;default:_0x351129=squel[_0xa51d('0x6b')]()[_0xa51d('0x6c')](_0xa51d('0x6d'))[_0xa51d('0x6e')]([_0xa51d('0x72'),_0xa51d('0x6f'),_0xa51d('0x70'),'ListId',_0xa51d('0x62'),_0xa51d('0x58'),'updatedAt'],squel[_0xa51d('0x7b')]()[_0xa51d('0x73')](_0xa51d('0x72'),_0xa51d('0x72'))['field'](_0xa51d('0x74'),'scheduledAt')['field']('id',_0xa51d('0x70'))[_0xa51d('0x73')](_0xfb60fa['CmListId'][_0xa51d('0x76')](),'ListId')['field'](_0x5a178e[_0xa51d('0x4a')]['id'][_0xa51d('0x76')](),_0xa51d('0x62'))[_0xa51d('0x73')]('NOW()',_0xa51d('0x58'))['field'](_0xa51d('0x74'),_0xa51d('0x59'))['from'](_0xa51d('0x78'))[_0xa51d('0x3f')](_0xa51d('0x79'))[_0xa51d('0x3f')](_0xa51d('0x81'),_0xfb60fa['CmListId']['toString']())['where'](_0xa51d('0x7a')))[_0xa51d('0x76')]();}_0x17d467[_0xa51d('0x82')](db[_0xa51d('0x83')][_0xa51d('0x37')](_0x351129));}return BPromise['all'](_0x17d467);}})[_0xa51d('0x27')](function(){return _0x1f6bf0;})[_0xa51d('0x27')](respondWithResult(_0x2d2009,null))[_0xa51d('0x48')](handleError(_0x2d2009,null));};exports[_0xa51d('0x84')]=function(_0x5bc617,_0xba74fa,_0x521632){return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x5bc617['params']['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0xba74fa,null))[_0xa51d('0x27')](function(_0x4ecbad){if(_0x4ecbad){return _0x4ecbad[_0xa51d('0x84')](_0x5bc617[_0xa51d('0x37')][_0xa51d('0x67')]);}})[_0xa51d('0x27')](function(_0xd69669){if(_0xd69669){return db[_0xa51d('0x5c')]['destroy']({'where':{'ListId':_0x5bc617['query'][_0xa51d('0x67')],'CampaignId':_0x5bc617[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](function(){return _0xd69669;});}})['then'](respondWithStatusCode(_0xba74fa,null))[_0xa51d('0x48')](handleError(_0xba74fa,null));};exports[_0xa51d('0x85')]=function(_0x491c29,_0x50ce5a,_0x26337e){var _0x5dad62={};var _0x455288={};var _0x30f0bf;var _0x58c8c5;return db['Campaign'][_0xa51d('0x5b')]({'where':{'id':_0x491c29[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x50ce5a,null))['then'](function(_0x115d9f){if(_0x115d9f){_0x30f0bf=_0x115d9f;_0x455288[_0xa51d('0x36')]=_[_0xa51d('0x4b')](db[_0xa51d('0x65')][_0xa51d('0x33')]);_0x455288[_0xa51d('0x37')]=_[_0xa51d('0x4b')](_0x491c29['query']);_0x455288['filters']=_['intersection'](_0x455288[_0xa51d('0x36')],_0x455288[_0xa51d('0x37')]);_0x5dad62[_0xa51d('0x3a')]=_[_0xa51d('0x39')](_0x455288[_0xa51d('0x36')],qs[_0xa51d('0x4c')](_0x491c29[_0xa51d('0x37')]['fields']));_0x5dad62[_0xa51d('0x3a')]=_0x5dad62[_0xa51d('0x3a')][_0xa51d('0x3b')]?_0x5dad62['attributes']:_0x455288[_0xa51d('0x36')];_0x5dad62[_0xa51d('0x3d')]=qs[_0xa51d('0x3e')](_0x491c29[_0xa51d('0x37')]['sort']);_0x5dad62[_0xa51d('0x3f')]=qs[_0xa51d('0x38')](_[_0xa51d('0x40')](_0x491c29[_0xa51d('0x37')],_0x455288['filters']));if(_0x491c29[_0xa51d('0x37')][_0xa51d('0x41')]){_0x5dad62[_0xa51d('0x3f')]=_[_0xa51d('0x42')](_0x5dad62[_0xa51d('0x3f')],{'$or':_[_0xa51d('0x31')](_0x5dad62[_0xa51d('0x3a')],function(_0x1fc521){var _0x438dbe={};_0x438dbe[_0x1fc521]={'$like':'%'+_0x491c29['query'][_0xa51d('0x41')]+'%'};return _0x438dbe;})});}_0x5dad62=_['merge']({},_0x5dad62,_0x491c29[_0xa51d('0x43')]);return _0x30f0bf[_0xa51d('0x85')](_0x5dad62);}})[_0xa51d('0x27')](function(_0x20437c){if(_0x20437c){_0x58c8c5=_0x20437c[_0xa51d('0x3b')];if(!_0x491c29['query'][_0xa51d('0x3c')](_0xa51d('0x5f'))){_0x5dad62['limit']=qs['limit'](_0x491c29['query'][_0xa51d('0x22')]);_0x5dad62[_0xa51d('0x20')]=qs[_0xa51d('0x20')](_0x491c29[_0xa51d('0x37')]['offset']);}return _0x30f0bf[_0xa51d('0x85')](_0x5dad62);}})['then'](function(_0x59c8f7){if(_0x59c8f7){return _0x59c8f7?{'count':_0x58c8c5,'rows':_0x59c8f7}:null;}})[_0xa51d('0x27')](respondWithResult(_0x50ce5a,null))[_0xa51d('0x48')](handleError(_0x50ce5a,null));};exports[_0xa51d('0x86')]=function(_0x241af6,_0x367b69,_0x540767){var _0x5aa55c,_0x19b5e9;return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x241af6[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x367b69,null))[_0xa51d('0x27')](function(_0x3d0e28){if(_0x3d0e28){_0x19b5e9=_0x3d0e28;return _0x3d0e28[_0xa51d('0x86')](_0x241af6[_0xa51d('0x4e')]['ids'],_[_0xa51d('0x57')](_0x241af6['body'],['ids','id'])||{});}return null;})['spread'](function(_0x2702df){var _0x26152e;_0x5aa55c=_0x2702df||[];var _0x57d3aa=[];if(_0x2702df){for(var _0x1aaf29=0x0;_0x1aaf29<_0x2702df['length'];_0x1aaf29+=0x1){var _0x3d083b=_0x2702df[_0x1aaf29][_0xa51d('0x28')]({'plain':!![]});_0x26152e=squel[_0xa51d('0x6b')]()[_0xa51d('0x6c')](_0xa51d('0x87'))[_0xa51d('0x6e')](['phone',_0xa51d('0x70'),_0xa51d('0x71'),_0xa51d('0x62'),_0xa51d('0x58'),'updatedAt'],squel[_0xa51d('0x7b')]()[_0xa51d('0x73')]('phone',_0xa51d('0x72'))['field']('id',_0xa51d('0x70'))[_0xa51d('0x73')](_0x3d083b[_0xa51d('0x75')][_0xa51d('0x76')](),_0xa51d('0x71'))[_0xa51d('0x73')](_0x241af6['params']['id']['toString'](),'CampaignId')[_0xa51d('0x73')](_0xa51d('0x74'),_0xa51d('0x58'))[_0xa51d('0x73')](_0xa51d('0x74'),'updatedAt')[_0xa51d('0x77')](_0xa51d('0x78'))[_0xa51d('0x3f')]('deletedAt\x20IS\x20NULL')[_0xa51d('0x3f')](_0xa51d('0x81'),_0x3d083b[_0xa51d('0x75')][_0xa51d('0x76')]())[_0xa51d('0x3f')](_0xa51d('0x7a')))[_0xa51d('0x76')]();_0x57d3aa[_0xa51d('0x82')](db[_0xa51d('0x83')][_0xa51d('0x37')](_0x26152e));}return BPromise[_0xa51d('0x88')](_0x57d3aa);}})[_0xa51d('0x27')](function(){return _0x5aa55c;})['then'](respondWithResult(_0x367b69,null))['catch'](handleError(_0x367b69,null));};exports['removeBlackLists']=function(_0x55c64c,_0x38805f,_0xb6341d){return db[_0xa51d('0x32')][_0xa51d('0x53')]({'where':{'id':_0x55c64c[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](handleEntityNotFound(_0x38805f,null))[_0xa51d('0x27')](function(_0x4905a8){if(_0x4905a8){return _0x4905a8[_0xa51d('0x89')](_0x55c64c[_0xa51d('0x37')]['ids']);}})['then'](function(_0x4c97cd){if(_0x4c97cd){return db[_0xa51d('0x63')][_0xa51d('0x2b')]({'where':{'ListId':_0x55c64c[_0xa51d('0x37')][_0xa51d('0x67')],'CampaignId':_0x55c64c[_0xa51d('0x4a')]['id']}})[_0xa51d('0x27')](function(){return _0x4c97cd;});}})[_0xa51d('0x27')](respondWithStatusCode(_0x38805f,null))[_0xa51d('0x48')](handleError(_0x38805f,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index e1452f2..875349e 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(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x509203,_0x29af10){var _0x4a30ab=function(_0xa64aa5){while(--_0xa64aa5){_0x509203['push'](_0x509203['shift']());}};_0x4a30ab(++_0x29af10);}(_0x7a54,0x106));var _0x47a5=function(_0xda50c2,_0xc2599c){_0xda50c2=_0xda50c2-0x0;var _0xed24af=_0x7a54[_0xda50c2];return _0xed24af;};'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 7a6baf3..238e1dc 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 _0x0dba=['Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x17866f,_0x2bc389){var _0x5109ac=function(_0x191415){while(--_0x191415){_0x17866f['push'](_0x17866f['shift']());}};_0x5109ac(++_0x2bc389);}(_0x0dba,0x136));var _0xa0db=function(_0x40be2b,_0x2c77b4){_0x40be2b=_0x40be2b-0x0;var _0x5a4403=_0x0dba[_0x40be2b];return _0x5a4403;};'use strict';var _=require(_0xa0db('0x0'));var util=require(_0xa0db('0x1'));var moment=require(_0xa0db('0x2'));var BPromise=require(_0xa0db('0x3'));var rs=require(_0xa0db('0x4'));var fs=require('fs');var Redis=require(_0xa0db('0x5'));var db=require(_0xa0db('0x6'))['db'];var utils=require(_0xa0db('0x7'));var logger=require(_0xa0db('0x8'))(_0xa0db('0x9'));var config=require(_0xa0db('0xa'));var jayson=require(_0xa0db('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b77ce,_0x5a8cb2,_0x45fb6d){return new BPromise(function(_0x1fd7ed,_0x483ddf){return client[_0xa0db('0xc')](_0x5b77ce,_0x45fb6d)[_0xa0db('0xd')](function(_0x35445a){logger[_0xa0db('0xe')]('Campaign,\x20%s,\x20%s',_0x5a8cb2,_0xa0db('0xf'));logger[_0xa0db('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5a8cb2,'request\x20sent',JSON[_0xa0db('0x11')](_0x35445a));if(_0x35445a[_0xa0db('0x12')]){if(_0x35445a[_0xa0db('0x12')][_0xa0db('0x13')]===0x1f4){logger['error'](_0xa0db('0x14'),_0x5a8cb2,_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);return _0x483ddf(_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);}logger[_0xa0db('0x12')](_0xa0db('0x14'),_0x5a8cb2,_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);return _0x1fd7ed(_0x35445a['error'][_0xa0db('0x15')]);}else{logger[_0xa0db('0xe')](_0xa0db('0x14'),_0x5a8cb2,_0xa0db('0xf'));_0x1fd7ed(_0x35445a[_0xa0db('0x16')][_0xa0db('0x15')]);}})[_0xa0db('0x17')](function(_0x12a3e8){logger[_0xa0db('0x12')]('Campaign,\x20%s,\x20%s',_0x5a8cb2,_0x12a3e8);_0x483ddf(_0x12a3e8);});});}exports[_0xa0db('0x18')]=function(_0x215658){var _0x4be2e2=this;return new Promise(function(_0x12766f,_0x2786ae){return db[_0xa0db('0x19')][_0xa0db('0x1a')]({'raw':_0x215658[_0xa0db('0x1b')]?_0x215658[_0xa0db('0x1b')][_0xa0db('0x1c')]===undefined?!![]:![]:!![],'where':_0x215658['options']?_0x215658['options']['where']||null:null,'attributes':_0x215658['options']?_0x215658[_0xa0db('0x1b')][_0xa0db('0x1d')]||null:null,'limit':_0x215658[_0xa0db('0x1b')]?_0x215658['options']['limit']||null:null,'include':_0x215658[_0xa0db('0x1b')]?_0x215658['options'][_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x215658[_0xa0db('0x1b')][_0xa0db('0x1e')],function(_0x4e9a22){return{'model':db[_0x4e9a22[_0xa0db('0x20')]],'as':_0x4e9a22['as'],'attributes':_0x4e9a22[_0xa0db('0x1d')],'include':_0x4e9a22[_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x4e9a22[_0xa0db('0x1e')],function(_0x362c30){return{'model':db[_0x362c30[_0xa0db('0x20')]],'as':_0x362c30['as'],'attributes':_0x362c30[_0xa0db('0x1d')],'include':_0x362c30[_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x362c30['include'],function(_0x3652a1){return{'model':db[_0x3652a1[_0xa0db('0x20')]],'as':_0x3652a1['as'],'attributes':_0x3652a1[_0xa0db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa0db('0xd')](function(_0xe3372c){logger[_0xa0db('0xe')](_0xa0db('0x18'),_0x215658);logger[_0xa0db('0x10')](_0xa0db('0x18'),_0x215658,JSON[_0xa0db('0x11')](_0xe3372c));_0x12766f(_0xe3372c);})[_0xa0db('0x17')](function(_0x3a3dba){logger[_0xa0db('0x12')](_0xa0db('0x18'),_0x3a3dba[_0xa0db('0x15')],_0x215658);_0x2786ae(_0x4be2e2[_0xa0db('0x12')](0x1f4,_0x3a3dba[_0xa0db('0x15')]));});});};
\ No newline at end of file
+var _0x0c6d=['Campaign','findAll','options','where','attributes','map','include','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetCampaign'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x31725d,_0xb5bf65){_0x31725d=_0x31725d-0x0;var _0x53da79=_0x0c6d[_0x31725d];return _0x53da79;};'use strict';var _=require('lodash');var util=require(_0xd0c6('0x0'));var moment=require(_0xd0c6('0x1'));var BPromise=require(_0xd0c6('0x2'));var rs=require(_0xd0c6('0x3'));var fs=require('fs');var Redis=require(_0xd0c6('0x4'));var db=require(_0xd0c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0c6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0c6('0x7')][_0xd0c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4a64,_0x5de1cd,_0x16c6da){return new BPromise(function(_0x534412,_0x2a14f1){return client[_0xd0c6('0x9')](_0x2d4a64,_0x16c6da)[_0xd0c6('0xa')](function(_0x184f65){logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));logger[_0xd0c6('0xe')](_0xd0c6('0xf'),_0x5de1cd,'request\x20sent',JSON[_0xd0c6('0x10')](_0x184f65));if(_0x184f65['error']){if(_0x184f65['error'][_0xd0c6('0x11')]===0x1f4){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x2a14f1(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x534412(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}else{logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));_0x534412(_0x184f65[_0xd0c6('0x14')][_0xd0c6('0x13')]);}})[_0xd0c6('0x15')](function(_0x19dd14){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x19dd14);_0x2a14f1(_0x19dd14);});});}exports[_0xd0c6('0x16')]=function(_0x941021){var _0x336efd=this;return new Promise(function(_0x4f7e65,_0x479d38){return db[_0xd0c6('0x17')][_0xd0c6('0x18')]({'raw':_0x941021['options']?_0x941021['options']['raw']===undefined?!![]:![]:!![],'where':_0x941021[_0xd0c6('0x19')]?_0x941021[_0xd0c6('0x19')][_0xd0c6('0x1a')]||null:null,'attributes':_0x941021[_0xd0c6('0x19')]?_0x941021[_0xd0c6('0x19')][_0xd0c6('0x1b')]||null:null,'limit':_0x941021[_0xd0c6('0x19')]?_0x941021[_0xd0c6('0x19')]['limit']||null:null,'include':_0x941021[_0xd0c6('0x19')]?_0x941021[_0xd0c6('0x19')]['include']?_[_0xd0c6('0x1c')](_0x941021[_0xd0c6('0x19')][_0xd0c6('0x1d')],function(_0x5d9baa){return{'model':db[_0x5d9baa['model']],'as':_0x5d9baa['as'],'attributes':_0x5d9baa[_0xd0c6('0x1b')],'include':_0x5d9baa[_0xd0c6('0x1d')]?_['map'](_0x5d9baa[_0xd0c6('0x1d')],function(_0x13559f){return{'model':db[_0x13559f['model']],'as':_0x13559f['as'],'attributes':_0x13559f[_0xd0c6('0x1b')],'include':_0x13559f['include']?_['map'](_0x13559f[_0xd0c6('0x1d')],function(_0x15150d){return{'model':db[_0x15150d['model']],'as':_0x15150d['as'],'attributes':_0x15150d[_0xd0c6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd0c6('0xa')](function(_0x3802af){logger[_0xd0c6('0xb')](_0xd0c6('0x16'),_0x941021);logger[_0xd0c6('0xe')](_0xd0c6('0x16'),_0x941021,JSON['stringify'](_0x3802af));_0x4f7e65(_0x3802af);})[_0xd0c6('0x15')](function(_0xe5ae58){logger[_0xd0c6('0x12')](_0xd0c6('0x16'),_0xe5ae58[_0xd0c6('0x13')],_0x941021);_0x479d38(_0x336efd[_0xd0c6('0x12')](0x1f4,_0xe5ae58[_0xd0c6('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index b9216e4..629130d 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 _0x2bc6=['addLists','addBlackLists','update','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','isAuthenticated','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone'];(function(_0x3fda1e,_0x3f8d30){var _0x1126bc=function(_0x42774d){while(--_0x42774d){_0x3fda1e['push'](_0x3fda1e['shift']());}};_0x1126bc(++_0x3f8d30);}(_0x2bc6,0xf6));var _0x62bc=function(_0xaf95fa,_0xb0f101){_0xaf95fa=_0xaf95fa-0x0;var _0x11d293=_0x2bc6[_0xaf95fa];return _0x11d293;};'use strict';var multer=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var path=require(_0x62bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x62bc('0x3'));var router=express[_0x62bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x62bc('0x5'));var interaction=require(_0x62bc('0x6'));var config=require(_0x62bc('0x7'));var controller=require(_0x62bc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x62bc('0x9')]);router[_0x62bc('0xa')](_0x62bc('0xb'),auth['isAuthenticated'](),controller[_0x62bc('0xc')]);router[_0x62bc('0xa')](_0x62bc('0xd'),auth['isAuthenticated'](),controller[_0x62bc('0xe')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x62bc('0xa')](_0x62bc('0xf'),auth[_0x62bc('0x10')](),controller['getHopperFinals']);router[_0x62bc('0xa')](_0x62bc('0x11'),auth['isAuthenticated'](),controller[_0x62bc('0x12')]);router[_0x62bc('0xa')](_0x62bc('0x13'),auth[_0x62bc('0x10')](),controller['getLists']);router[_0x62bc('0xa')](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller['getBlackLists']);router[_0x62bc('0x15')]('/',auth[_0x62bc('0x10')](),controller[_0x62bc('0x16')]);router[_0x62bc('0x15')](_0x62bc('0x17'),auth[_0x62bc('0x10')](),controller['clone']);router[_0x62bc('0x15')](_0x62bc('0x13'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x18')]);router[_0x62bc('0x15')](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x19')]);router['put'](_0x62bc('0xb'),auth['isAuthenticated'](),controller[_0x62bc('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x62bc('0x13'),auth['isAuthenticated'](),controller[_0x62bc('0x1b')]);router['delete'](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x1c')]);module[_0x62bc('0x1d')]=router;
\ No newline at end of file
+var _0x6b6d=['getLists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x4fcbec,_0x90e467){var _0x275177=function(_0x1f706b){while(--_0x1f706b){_0x4fcbec['push'](_0x4fcbec['shift']());}};_0x275177(++_0x90e467);}(_0x6b6d,0xbd));var _0xd6b6=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x6b6d[_0xa3463d];return _0x50fd67;};'use strict';var multer=require(_0xd6b6('0x0'));var util=require(_0xd6b6('0x1'));var path=require(_0xd6b6('0x2'));var timeout=require(_0xd6b6('0x3'));var express=require('express');var router=express[_0xd6b6('0x4')]();var fs_extra=require(_0xd6b6('0x5'));var auth=require(_0xd6b6('0x6'));var interaction=require(_0xd6b6('0x7'));var config=require('../../config/environment');var controller=require(_0xd6b6('0x8'));router[_0xd6b6('0x9')]('/',auth[_0xd6b6('0xa')](),controller['index']);router[_0xd6b6('0x9')](_0xd6b6('0xb'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0xc')]);router[_0xd6b6('0x9')](_0xd6b6('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xd6b6('0x9')](_0xd6b6('0xe'),auth['isAuthenticated'](),controller[_0xd6b6('0xf')]);router[_0xd6b6('0x9')](_0xd6b6('0x10'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x11')]);router[_0xd6b6('0x9')](_0xd6b6('0x12'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x13')]);router['get'](_0xd6b6('0x14'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x15')]);router[_0xd6b6('0x9')]('/:id/blacklists',auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x16')]);router[_0xd6b6('0x17')]('/',auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x18')]);router[_0xd6b6('0x17')](_0xd6b6('0x19'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x1a')]);router[_0xd6b6('0x17')](_0xd6b6('0x14'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x1b')]);router[_0xd6b6('0x17')](_0xd6b6('0x1c'),auth['isAuthenticated'](),controller[_0xd6b6('0x1d')]);router[_0xd6b6('0x1e')](_0xd6b6('0xb'),auth[_0xd6b6('0xa')](),controller['update']);router[_0xd6b6('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xd6b6('0x20')]);router[_0xd6b6('0x1f')](_0xd6b6('0x14'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x21')]);router[_0xd6b6('0x1f')](_0xd6b6('0x1c'),auth[_0xd6b6('0xa')](),controller[_0xd6b6('0x22')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index c79e903..a36d69d 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 _0xd467=['VIRTUAL','getDataValue','sequelize','exports','STRING','TEXT'];(function(_0x4f7280,_0x3c30ff){var _0x5ea336=function(_0x4337de){while(--_0x4337de){_0x4f7280['push'](_0x4f7280['shift']());}};_0x5ea336(++_0x3c30ff);}(_0xd467,0xb6));var _0x7d46=function(_0x2fce58,_0x71e113){_0x2fce58=_0x2fce58-0x0;var _0xfa4b6a=_0xd467[_0x2fce58];return _0xfa4b6a;};'use strict';var Sequelize=require(_0x7d46('0x0'));module[_0x7d46('0x1')]={'key':{'type':Sequelize[_0x7d46('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7d46('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7d46('0x4')],'get':function(){return this[_0x7d46('0x5')]('key');}}};
\ No newline at end of file
+var _0x23fa=['STRING','TEXT','getDataValue','exports'];(function(_0xf5b712,_0x5487bf){var _0x410413=function(_0x5209ce){while(--_0x5209ce){_0xf5b712['push'](_0xf5b712['shift']());}};_0x410413(++_0x5487bf);}(_0x23fa,0x16b));var _0xa23f=function(_0x5d9df,_0x4d02a1){_0x5d9df=_0x5d9df-0x0;var _0x59f5a8=_0x23fa[_0x5d9df];return _0x59f5a8;};'use strict';var Sequelize=require('sequelize');module[_0xa23f('0x0')]={'key':{'type':Sequelize[_0xa23f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xa23f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa23f('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa23f('0x3')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 4c35dbf..4d3165d 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 _0x1bef=['keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','findAll','rows','show','params','includeAll','include','find','body','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','error','name','send','index','CannedAnswer','rawAttributes','key','query'];(function(_0x37c775,_0x160938){var _0x513a37=function(_0x2e285c){while(--_0x2e285c){_0x37c775['push'](_0x37c775['shift']());}};_0x513a37(++_0x160938);}(_0x1bef,0x177));var _0xf1be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bef[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf1be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1be('0x1'));var jsonpatch=require(_0xf1be('0x2'));var rp=require(_0xf1be('0x3'));var moment=require('moment');var BPromise=require(_0xf1be('0x4'));var Mustache=require(_0xf1be('0x5'));var util=require(_0xf1be('0x6'));var path=require(_0xf1be('0x7'));var sox=require('sox');var csv=require(_0xf1be('0x8'));var ejs=require(_0xf1be('0x9'));var fs=require('fs');var fs_extra=require(_0xf1be('0xa'));var _=require(_0xf1be('0xb'));var squel=require(_0xf1be('0xc'));var crypto=require('crypto');var jsforce=require(_0xf1be('0xd'));var deskjs=require(_0xf1be('0xe'));var toCsv=require(_0xf1be('0x8'));var querystring=require('querystring');var Papa=require(_0xf1be('0xf'));var Redis=require('ioredis');var authService=require(_0xf1be('0x10'));var qs=require(_0xf1be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1be('0x12'))(_0xf1be('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf1be('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23aa50,_0x362397){_0x362397=_0x362397||0xcc;return function(_0x5de63e){if(_0x5de63e){return _0x23aa50[_0xf1be('0x15')](_0x362397);}return _0x23aa50['status'](_0x362397)[_0xf1be('0x16')]();};}function respondWithResult(_0x472151,_0xc11cba){_0xc11cba=_0xc11cba||0xc8;return function(_0x1f5f7b){if(_0x1f5f7b){return _0x472151[_0xf1be('0x17')](_0xc11cba)['json'](_0x1f5f7b);}};}function respondWithFilteredResult(_0x5ae923,_0x8f25a9){return function(_0x11bf9f){if(_0x11bf9f){var _0x53ff08=typeof _0x8f25a9[_0xf1be('0x18')]===_0xf1be('0x19')&&typeof _0x8f25a9[_0xf1be('0x1a')]===_0xf1be('0x19');var _0x41dbcb=_0x11bf9f['count'];var _0x282312=_0x53ff08?0x0:_0x8f25a9[_0xf1be('0x18')];var _0x104141=_0x53ff08?_0x11bf9f[_0xf1be('0x1b')]:_0x8f25a9[_0xf1be('0x18')]+_0x8f25a9[_0xf1be('0x1a')];var _0xc777c3;if(_0x104141>=_0x41dbcb){_0x104141=_0x41dbcb;_0xc777c3=0xc8;}else{_0xc777c3=0xce;}_0x5ae923[_0xf1be('0x17')](_0xc777c3);return _0x5ae923['set'](_0xf1be('0x1c'),_0x282312+'-'+_0x104141+'/'+_0x41dbcb)[_0xf1be('0x1d')](_0x11bf9f);}return null;};}function patchUpdates(_0x443393){return function(_0x3b933e){try{jsonpatch[_0xf1be('0x1e')](_0x3b933e,_0x443393,!![]);}catch(_0x3fe46b){return BPromise[_0xf1be('0x1f')](_0x3fe46b);}return _0x3b933e['save']();};}function saveUpdates(_0x3be5d8,_0x4ddf1e){return function(_0x39d1ae){if(_0x39d1ae){return _0x39d1ae[_0xf1be('0x20')](_0x3be5d8)[_0xf1be('0x21')](function(_0xbcf3d9){return _0xbcf3d9;});}return null;};}function removeEntity(_0x27a7ce,_0x1dc282){return function(_0x40e2a0){if(_0x40e2a0){return _0x40e2a0[_0xf1be('0x22')]()[_0xf1be('0x21')](function(){var _0x4c2b82=_0x40e2a0[_0xf1be('0x23')]({'plain':!![]});var _0xca64ce=_0xf1be('0x24');return db['UserProfileResource'][_0xf1be('0x22')]({'where':{'type':_0xca64ce,'resourceId':_0x4c2b82['id']}})[_0xf1be('0x21')](function(){return _0x40e2a0;});})[_0xf1be('0x21')](function(){_0x27a7ce['status'](0xcc)[_0xf1be('0x16')]();});}};}function handleEntityNotFound(_0x3cb8d6,_0x497fdb){return function(_0x2c2899){if(!_0x2c2899){_0x3cb8d6[_0xf1be('0x15')](0x194);}return _0x2c2899;};}function handleError(_0x5b752c,_0x45b1ed){_0x45b1ed=_0x45b1ed||0x1f4;return function(_0x38c648){logger[_0xf1be('0x25')](_0x38c648['stack']);if(_0x38c648[_0xf1be('0x26')]){delete _0x38c648[_0xf1be('0x26')];}_0x5b752c['status'](_0x45b1ed)[_0xf1be('0x27')](_0x38c648);};}exports[_0xf1be('0x28')]=function(_0x237439,_0x4bddc3){var _0x37e8f9={},_0x119952={},_0xebcb90={'count':0x0,'rows':[]};var _0x4b8611=_['map'](db[_0xf1be('0x29')][_0xf1be('0x2a')],function(_0x2a4a36){return{'name':_0x2a4a36['fieldName'],'type':_0x2a4a36['type'][_0xf1be('0x2b')]};});_0x119952['model']=_['map'](_0x4b8611,'name');_0x119952[_0xf1be('0x2c')]=_[_0xf1be('0x2d')](_0x237439[_0xf1be('0x2c')]);_0x119952[_0xf1be('0x2e')]=_[_0xf1be('0x2f')](_0x119952['model'],_0x119952['query']);_0x37e8f9[_0xf1be('0x30')]=_[_0xf1be('0x2f')](_0x119952[_0xf1be('0x31')],qs['fields'](_0x237439[_0xf1be('0x2c')][_0xf1be('0x32')]));_0x37e8f9[_0xf1be('0x30')]=_0x37e8f9[_0xf1be('0x30')][_0xf1be('0x33')]?_0x37e8f9[_0xf1be('0x30')]:_0x119952[_0xf1be('0x31')];if(!_0x237439[_0xf1be('0x2c')][_0xf1be('0x34')](_0xf1be('0x35'))){_0x37e8f9[_0xf1be('0x1a')]=qs[_0xf1be('0x1a')](_0x237439[_0xf1be('0x2c')]['limit']);_0x37e8f9[_0xf1be('0x18')]=qs[_0xf1be('0x18')](_0x237439['query']['offset']);}_0x37e8f9[_0xf1be('0x36')]=qs[_0xf1be('0x37')](_0x237439[_0xf1be('0x2c')][_0xf1be('0x37')]);_0x37e8f9[_0xf1be('0x38')]=qs[_0xf1be('0x2e')](_[_0xf1be('0x39')](_0x237439[_0xf1be('0x2c')],_0x119952['filters']),_0x4b8611);if(_0x237439['query']['filter']){_0x37e8f9['where']=_[_0xf1be('0x3a')](_0x37e8f9['where'],{'$or':[{'key':{'$like':'%'+_0x237439[_0xf1be('0x2c')][_0xf1be('0x3b')]+'%'}},{'value':{'$like':'%'+_0x237439[_0xf1be('0x2c')]['filter']+'%'}}]});}_0x37e8f9=_['merge']({},_0x37e8f9,_0x237439[_0xf1be('0x3c')]);var _0x1093c4={'where':_0x37e8f9[_0xf1be('0x38')]};return db[_0xf1be('0x29')][_0xf1be('0x1b')](_0x1093c4)['then'](function(_0x4b0aa9){_0xebcb90['count']=_0x4b0aa9;if(_0x237439[_0xf1be('0x2c')]['includeAll']){_0x37e8f9['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xf1be('0x3d')](_0x37e8f9);})[_0xf1be('0x21')](function(_0x3c25b1){_0xebcb90[_0xf1be('0x3e')]=_0x3c25b1;return _0xebcb90;})[_0xf1be('0x21')](respondWithFilteredResult(_0x4bddc3,_0x37e8f9))['catch'](handleError(_0x4bddc3,null));};exports[_0xf1be('0x3f')]=function(_0x4750f0,_0x5b485a){var _0xa1294c={'raw':!![],'where':{'id':_0x4750f0[_0xf1be('0x40')]['id']}},_0x5822={};_0x5822[_0xf1be('0x31')]=_['keys'](db['CannedAnswer'][_0xf1be('0x2a')]);_0x5822[_0xf1be('0x2c')]=_['keys'](_0x4750f0['query']);_0x5822['filters']=_[_0xf1be('0x2f')](_0x5822[_0xf1be('0x31')],_0x5822['query']);_0xa1294c['attributes']=_['intersection'](_0x5822[_0xf1be('0x31')],qs[_0xf1be('0x32')](_0x4750f0[_0xf1be('0x2c')][_0xf1be('0x32')]));_0xa1294c['attributes']=_0xa1294c[_0xf1be('0x30')]['length']?_0xa1294c[_0xf1be('0x30')]:_0x5822['model'];if(_0x4750f0[_0xf1be('0x2c')][_0xf1be('0x41')]){_0xa1294c[_0xf1be('0x42')]=[{'all':!![]}];}_0xa1294c=_['merge']({},_0xa1294c,_0x4750f0[_0xf1be('0x3c')]);return db[_0xf1be('0x29')][_0xf1be('0x43')](_0xa1294c)[_0xf1be('0x21')](handleEntityNotFound(_0x5b485a,null))[_0xf1be('0x21')](respondWithResult(_0x5b485a,null))['catch'](handleError(_0x5b485a,null));};exports[_0xf1be('0x20')]=function(_0x53c934,_0x17c0e1){if(_0x53c934[_0xf1be('0x44')]['id']){delete _0x53c934['body']['id'];}return db[_0xf1be('0x29')][_0xf1be('0x43')]({'where':{'id':_0x53c934[_0xf1be('0x40')]['id']}})[_0xf1be('0x21')](handleEntityNotFound(_0x17c0e1,null))['then'](saveUpdates(_0x53c934['body'],null))[_0xf1be('0x21')](respondWithResult(_0x17c0e1,null))[_0xf1be('0x45')](handleError(_0x17c0e1,null));};exports['destroy']=function(_0x3b9178,_0x54a6ef){return db['CannedAnswer']['find']({'where':{'id':_0x3b9178[_0xf1be('0x40')]['id']}})[_0xf1be('0x21')](handleEntityNotFound(_0x54a6ef,null))[_0xf1be('0x21')](removeEntity(_0x54a6ef,null))[_0xf1be('0x45')](handleError(_0x54a6ef,null));};exports['create']=function(_0x39d9d4,_0x391a2e){var _0x1b6986={'key':_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x2b')]};if(_0x39d9d4[_0xf1be('0x44')]['MailAccountId']){_0x1b6986[_0xf1be('0x46')]=_0x39d9d4[_0xf1be('0x44')]['MailAccountId'];}else if(_0x39d9d4['body'][_0xf1be('0x47')]){_0x1b6986[_0xf1be('0x47')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x47')];}else if(_0x39d9d4[_0xf1be('0x44')]['OpenchannelAccountId']){_0x1b6986[_0xf1be('0x48')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x48')];}else if(_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x49')]){_0x1b6986[_0xf1be('0x49')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x49')];}return db[_0xf1be('0x29')][_0xf1be('0x43')]({'where':_0x1b6986})[_0xf1be('0x21')](function(_0x199f6d){if(_0x199f6d){throw new db[(_0xf1be('0x4a'))][(_0xf1be('0x4b'))](_0xf1be('0x4c'));}return db['CannedAnswer'][_0xf1be('0x4d')](_0x39d9d4[_0xf1be('0x44')]);})[_0xf1be('0x21')](function(_0x3dd33f){var _0x21a374=_0x39d9d4[_0xf1be('0x4e')][_0xf1be('0x23')]({'plain':!![]});if(!_0x21a374)throw new Error(_0xf1be('0x4f'));if(_0x21a374[_0xf1be('0x50')]==='user'){var _0x341bcd=_0x3dd33f[_0xf1be('0x23')]({'plain':!![]});return db['UserProfileSection'][_0xf1be('0x43')]({'where':{'name':'CannedAnswers','userProfileId':_0x21a374['userProfileId']},'raw':!![]})[_0xf1be('0x21')](function(_0x468fce){if(_0x468fce&&_0x468fce[_0xf1be('0x51')]===0x0){return db[_0xf1be('0x52')][_0xf1be('0x4d')]({'name':_0x341bcd[_0xf1be('0x26')],'resourceId':_0x341bcd['id'],'type':_0x468fce[_0xf1be('0x26')],'sectionId':_0x468fce['id']},{})[_0xf1be('0x21')](function(){return _0x3dd33f;});}else{return _0x3dd33f;}})['catch'](function(_0xd17e9e){logger[_0xf1be('0x25')](_0xf1be('0x53'),_0xd17e9e);throw _0xd17e9e;});}return _0x3dd33f;})['then'](respondWithResult(_0x391a2e,0xc9))[_0xf1be('0x45')](handleError(_0x391a2e,null));};
\ No newline at end of file
+var _0x2b90=['rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','limit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','CannedAnswer','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map'];(function(_0x48bbd9,_0x34482b){var _0x10851a=function(_0x3d7bb5){while(--_0x3d7bb5){_0x48bbd9['push'](_0x48bbd9['shift']());}};_0x10851a(++_0x34482b);}(_0x2b90,0x190));var _0x02b9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2b90[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x02b9('0x0'));var jsonpatch=require(_0x02b9('0x1'));var rp=require(_0x02b9('0x2'));var moment=require(_0x02b9('0x3'));var BPromise=require(_0x02b9('0x4'));var Mustache=require(_0x02b9('0x5'));var util=require('util');var path=require(_0x02b9('0x6'));var sox=require(_0x02b9('0x7'));var csv=require(_0x02b9('0x8'));var ejs=require(_0x02b9('0x9'));var fs=require('fs');var fs_extra=require(_0x02b9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x02b9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x02b9('0x8'));var querystring=require(_0x02b9('0xc'));var Papa=require(_0x02b9('0xd'));var Redis=require(_0x02b9('0xe'));var authService=require(_0x02b9('0xf'));var qs=require(_0x02b9('0x10'));var as=require(_0x02b9('0x11'));var hardwareService=require(_0x02b9('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x02b9('0x13'));var config=require(_0x02b9('0x14'));var licenseUtil=require(_0x02b9('0x15'));var db=require(_0x02b9('0x16'))['db'];function respondWithStatusCode(_0x4e0418,_0x4d8279){_0x4d8279=_0x4d8279||0xcc;return function(_0x4ea6a5){if(_0x4ea6a5){return _0x4e0418['sendStatus'](_0x4d8279);}return _0x4e0418[_0x02b9('0x17')](_0x4d8279)[_0x02b9('0x18')]();};}function respondWithResult(_0x55b319,_0x4abf59){_0x4abf59=_0x4abf59||0xc8;return function(_0x6a013e){if(_0x6a013e){return _0x55b319['status'](_0x4abf59)[_0x02b9('0x19')](_0x6a013e);}};}function respondWithFilteredResult(_0x362a4a,_0x4b8fa6){return function(_0x42ca2e){if(_0x42ca2e){var _0x13ab06=typeof _0x4b8fa6[_0x02b9('0x1a')]===_0x02b9('0x1b')&&typeof _0x4b8fa6['limit']===_0x02b9('0x1b');var _0x4e6409=_0x42ca2e[_0x02b9('0x1c')];var _0x3a45c6=_0x13ab06?0x0:_0x4b8fa6[_0x02b9('0x1a')];var _0x52d20f=_0x13ab06?_0x42ca2e[_0x02b9('0x1c')]:_0x4b8fa6['offset']+_0x4b8fa6['limit'];var _0xad3b4b;if(_0x52d20f>=_0x4e6409){_0x52d20f=_0x4e6409;_0xad3b4b=0xc8;}else{_0xad3b4b=0xce;}_0x362a4a[_0x02b9('0x17')](_0xad3b4b);return _0x362a4a[_0x02b9('0x1d')](_0x02b9('0x1e'),_0x3a45c6+'-'+_0x52d20f+'/'+_0x4e6409)['json'](_0x42ca2e);}return null;};}function patchUpdates(_0x1c9282){return function(_0x384b50){try{jsonpatch[_0x02b9('0x1f')](_0x384b50,_0x1c9282,!![]);}catch(_0x132a49){return BPromise['reject'](_0x132a49);}return _0x384b50[_0x02b9('0x20')]();};}function saveUpdates(_0x2c59c2,_0x40a05e){return function(_0x5671c9){if(_0x5671c9){return _0x5671c9[_0x02b9('0x21')](_0x2c59c2)[_0x02b9('0x22')](function(_0x3a9dc3){return _0x3a9dc3;});}return null;};}function removeEntity(_0x4f2374,_0x1ecb01){return function(_0x52f3a0){if(_0x52f3a0){return _0x52f3a0[_0x02b9('0x23')]()[_0x02b9('0x22')](function(){var _0x3fea6c=_0x52f3a0[_0x02b9('0x24')]({'plain':!![]});var _0x1b07e3=_0x02b9('0x25');return db[_0x02b9('0x26')][_0x02b9('0x23')]({'where':{'type':_0x1b07e3,'resourceId':_0x3fea6c['id']}})[_0x02b9('0x22')](function(){return _0x52f3a0;});})[_0x02b9('0x22')](function(){_0x4f2374[_0x02b9('0x17')](0xcc)[_0x02b9('0x18')]();});}};}function handleEntityNotFound(_0x17bd1c,_0x1b8ef8){return function(_0xc3220e){if(!_0xc3220e){_0x17bd1c['sendStatus'](0x194);}return _0xc3220e;};}function handleError(_0x57335f,_0x34fefb){_0x34fefb=_0x34fefb||0x1f4;return function(_0x503b33){logger[_0x02b9('0x27')](_0x503b33[_0x02b9('0x28')]);if(_0x503b33[_0x02b9('0x29')]){delete _0x503b33[_0x02b9('0x29')];}_0x57335f[_0x02b9('0x17')](_0x34fefb)[_0x02b9('0x2a')](_0x503b33);};}exports[_0x02b9('0x2b')]=function(_0x2c4e18,_0x5ec9cd){var _0x2e73c6={},_0x395e40={},_0x2fbad5={'count':0x0,'rows':[]};var _0x3a9b5a=_[_0x02b9('0x2c')](db['CannedAnswer'][_0x02b9('0x2d')],function(_0x25b3e7){return{'name':_0x25b3e7['fieldName'],'type':_0x25b3e7[_0x02b9('0x2e')][_0x02b9('0x2f')]};});_0x395e40[_0x02b9('0x30')]=_['map'](_0x3a9b5a,_0x02b9('0x29'));_0x395e40[_0x02b9('0x31')]=_[_0x02b9('0x32')](_0x2c4e18[_0x02b9('0x31')]);_0x395e40['filters']=_[_0x02b9('0x33')](_0x395e40[_0x02b9('0x30')],_0x395e40['query']);_0x2e73c6[_0x02b9('0x34')]=_[_0x02b9('0x33')](_0x395e40[_0x02b9('0x30')],qs[_0x02b9('0x35')](_0x2c4e18[_0x02b9('0x31')][_0x02b9('0x35')]));_0x2e73c6[_0x02b9('0x34')]=_0x2e73c6[_0x02b9('0x34')][_0x02b9('0x36')]?_0x2e73c6['attributes']:_0x395e40[_0x02b9('0x30')];if(!_0x2c4e18[_0x02b9('0x31')]['hasOwnProperty']('nolimit')){_0x2e73c6[_0x02b9('0x37')]=qs[_0x02b9('0x37')](_0x2c4e18['query'][_0x02b9('0x37')]);_0x2e73c6[_0x02b9('0x1a')]=qs['offset'](_0x2c4e18['query'][_0x02b9('0x1a')]);}_0x2e73c6[_0x02b9('0x38')]=qs[_0x02b9('0x39')](_0x2c4e18[_0x02b9('0x31')]['sort']);_0x2e73c6[_0x02b9('0x3a')]=qs[_0x02b9('0x3b')](_[_0x02b9('0x3c')](_0x2c4e18[_0x02b9('0x31')],_0x395e40[_0x02b9('0x3b')]),_0x3a9b5a);if(_0x2c4e18[_0x02b9('0x31')]['filter']){_0x2e73c6[_0x02b9('0x3a')]=_[_0x02b9('0x3d')](_0x2e73c6['where'],{'$or':[{'key':{'$like':'%'+_0x2c4e18[_0x02b9('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x2c4e18[_0x02b9('0x31')][_0x02b9('0x3e')]+'%'}}]});}_0x2e73c6=_['merge']({},_0x2e73c6,_0x2c4e18[_0x02b9('0x3f')]);var _0x3d10e9={'where':_0x2e73c6[_0x02b9('0x3a')]};return db['CannedAnswer'][_0x02b9('0x1c')](_0x3d10e9)['then'](function(_0x36d091){_0x2fbad5['count']=_0x36d091;if(_0x2c4e18[_0x02b9('0x31')][_0x02b9('0x40')]){_0x2e73c6[_0x02b9('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x02b9('0x42')](_0x2e73c6);})[_0x02b9('0x22')](function(_0x3380f6){_0x2fbad5[_0x02b9('0x43')]=_0x3380f6;return _0x2fbad5;})[_0x02b9('0x22')](respondWithFilteredResult(_0x5ec9cd,_0x2e73c6))[_0x02b9('0x44')](handleError(_0x5ec9cd,null));};exports[_0x02b9('0x45')]=function(_0x144fb0,_0x15efdd){var _0x3dbb02={'raw':!![],'where':{'id':_0x144fb0[_0x02b9('0x46')]['id']}},_0x53b53e={};_0x53b53e[_0x02b9('0x30')]=_[_0x02b9('0x32')](db[_0x02b9('0x47')][_0x02b9('0x2d')]);_0x53b53e[_0x02b9('0x31')]=_['keys'](_0x144fb0[_0x02b9('0x31')]);_0x53b53e[_0x02b9('0x3b')]=_[_0x02b9('0x33')](_0x53b53e[_0x02b9('0x30')],_0x53b53e['query']);_0x3dbb02['attributes']=_[_0x02b9('0x33')](_0x53b53e[_0x02b9('0x30')],qs[_0x02b9('0x35')](_0x144fb0['query'][_0x02b9('0x35')]));_0x3dbb02['attributes']=_0x3dbb02['attributes'][_0x02b9('0x36')]?_0x3dbb02[_0x02b9('0x34')]:_0x53b53e['model'];if(_0x144fb0['query'][_0x02b9('0x40')]){_0x3dbb02['include']=[{'all':!![]}];}_0x3dbb02=_[_0x02b9('0x3d')]({},_0x3dbb02,_0x144fb0[_0x02b9('0x3f')]);return db['CannedAnswer'][_0x02b9('0x48')](_0x3dbb02)[_0x02b9('0x22')](handleEntityNotFound(_0x15efdd,null))[_0x02b9('0x22')](respondWithResult(_0x15efdd,null))[_0x02b9('0x44')](handleError(_0x15efdd,null));};exports['update']=function(_0x2b559e,_0x1b9853){if(_0x2b559e[_0x02b9('0x49')]['id']){delete _0x2b559e['body']['id'];}return db[_0x02b9('0x47')][_0x02b9('0x48')]({'where':{'id':_0x2b559e[_0x02b9('0x46')]['id']}})[_0x02b9('0x22')](handleEntityNotFound(_0x1b9853,null))['then'](saveUpdates(_0x2b559e[_0x02b9('0x49')],null))[_0x02b9('0x22')](respondWithResult(_0x1b9853,null))[_0x02b9('0x44')](handleError(_0x1b9853,null));};exports['destroy']=function(_0xe99ba3,_0x3e91c3){return db[_0x02b9('0x47')][_0x02b9('0x48')]({'where':{'id':_0xe99ba3['params']['id']}})[_0x02b9('0x22')](handleEntityNotFound(_0x3e91c3,null))[_0x02b9('0x22')](removeEntity(_0x3e91c3,null))['catch'](handleError(_0x3e91c3,null));};exports[_0x02b9('0x4a')]=function(_0x5e1f3d,_0x1e1bcd){var _0x305493={'key':_0x5e1f3d[_0x02b9('0x49')][_0x02b9('0x2f')]};if(_0x5e1f3d[_0x02b9('0x49')][_0x02b9('0x4b')]){_0x305493[_0x02b9('0x4b')]=_0x5e1f3d[_0x02b9('0x49')]['MailAccountId'];}else if(_0x5e1f3d['body'][_0x02b9('0x4c')]){_0x305493['SmsAccountId']=_0x5e1f3d[_0x02b9('0x49')][_0x02b9('0x4c')];}else if(_0x5e1f3d[_0x02b9('0x49')]['OpenchannelAccountId']){_0x305493[_0x02b9('0x4d')]=_0x5e1f3d[_0x02b9('0x49')]['OpenchannelAccountId'];}else if(_0x5e1f3d[_0x02b9('0x49')][_0x02b9('0x4e')]){_0x305493[_0x02b9('0x4e')]=_0x5e1f3d[_0x02b9('0x49')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x02b9('0x48')]({'where':_0x305493})[_0x02b9('0x22')](function(_0x2e9b74){if(_0x2e9b74){throw new db[(_0x02b9('0x4f'))][(_0x02b9('0x50'))](_0x02b9('0x51'));}return db[_0x02b9('0x47')]['create'](_0x5e1f3d[_0x02b9('0x49')]);})[_0x02b9('0x22')](function(_0x52bd82){var _0x5773a7=_0x5e1f3d['user'][_0x02b9('0x24')]({'plain':!![]});if(!_0x5773a7)throw new Error(_0x02b9('0x52'));if(_0x5773a7[_0x02b9('0x53')]===_0x02b9('0x54')){var _0x11c4f8=_0x52bd82['get']({'plain':!![]});return db[_0x02b9('0x55')][_0x02b9('0x48')]({'where':{'name':_0x02b9('0x25'),'userProfileId':_0x5773a7[_0x02b9('0x56')]},'raw':!![]})[_0x02b9('0x22')](function(_0x59a912){if(_0x59a912&&_0x59a912[_0x02b9('0x57')]===0x0){return db[_0x02b9('0x26')][_0x02b9('0x4a')]({'name':_0x11c4f8['name'],'resourceId':_0x11c4f8['id'],'type':_0x59a912[_0x02b9('0x29')],'sectionId':_0x59a912['id']},{})[_0x02b9('0x22')](function(){return _0x52bd82;});}else{return _0x52bd82;}})['catch'](function(_0xb53ade){logger['error'](_0x02b9('0x58'),_0xb53ade);throw _0xb53ade;});}return _0x52bd82;})['then'](respondWithResult(_0x1e1bcd,0xc9))['catch'](handleError(_0x1e1bcd,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 77cf62b..309babb 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 _0x388a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x10f2e7,_0x491801){var _0x183060=function(_0x462680){while(--_0x462680){_0x10f2e7['push'](_0x10f2e7['shift']());}};_0x183060(++_0x491801);}(_0x388a,0xdc));var _0xa388=function(_0x18bb13,_0x4562e3){_0x18bb13=_0x18bb13-0x0;var _0x2192f3=_0x388a[_0x18bb13];return _0x2192f3;};'use strict';var _=require('lodash');var util=require(_0xa388('0x0'));var logger=require(_0xa388('0x1'))(_0xa388('0x2'));var moment=require(_0xa388('0x3'));var BPromise=require(_0xa388('0x4'));var rp=require(_0xa388('0x5'));var fs=require('fs');var path=require(_0xa388('0x6'));var rimraf=require(_0xa388('0x7'));var config=require(_0xa388('0x8'));var attributes=require(_0xa388('0x9'));module[_0xa388('0xa')]=function(_0x2d30c1,_0x297742){return _0x2d30c1['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb576=['../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','moment','request-promise','path','rimraf'];(function(_0x1b6f56,_0x4f44d2){var _0x2bbf0a=function(_0x30183d){while(--_0x30183d){_0x1b6f56['push'](_0x1b6f56['shift']());}};_0x2bbf0a(++_0x4f44d2);}(_0xb576,0x1cf));var _0x6b57=function(_0x2969ee,_0x5d77fe){_0x2969ee=_0x2969ee-0x0;var _0x288cce=_0xb576[_0x2969ee];return _0x288cce;};'use strict';var _=require('lodash');var util=require(_0x6b57('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x6b57('0x1'));var BPromise=require('bluebird');var rp=require(_0x6b57('0x2'));var fs=require('fs');var path=require(_0x6b57('0x3'));var rimraf=require(_0x6b57('0x4'));var config=require(_0x6b57('0x5'));var attributes=require(_0x6b57('0x6'));module[_0x6b57('0x7')]=function(_0x3d4304,_0x2d0452){return _0x3d4304['define'](_0x6b57('0x8'),attributes,{'tableName':_0x6b57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b57('0xa'),'collate':_0x6b57('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 15930be..842bd1b 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(_0x19a19c,_0x75752b){var _0x3e79bb=function(_0x277c7a){while(--_0x277c7a){_0x19a19c['push'](_0x19a19c['shift']());}};_0x3e79bb(++_0x75752b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x582b91,_0x2f1324){var _0x10741a=function(_0x98544e){while(--_0x98544e){_0x582b91['push'](_0x582b91['shift']());}};_0x10741a(++_0x2f1324);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 8876367..443268a 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 _0xe095=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','post','create'];(function(_0x1a9e39,_0x36d760){var _0x406407=function(_0x3a2de1){while(--_0x3a2de1){_0x1a9e39['push'](_0x1a9e39['shift']());}};_0x406407(++_0x36d760);}(_0xe095,0x1b5));var _0x5e09=function(_0x5b039d,_0x4306ba){_0x5b039d=_0x5b039d-0x0;var _0x2c64c2=_0xe095[_0x5b039d];return _0x2c64c2;};'use strict';var multer=require(_0x5e09('0x0'));var util=require(_0x5e09('0x1'));var path=require('path');var timeout=require(_0x5e09('0x2'));var express=require(_0x5e09('0x3'));var router=express['Router']();var fs_extra=require(_0x5e09('0x4'));var auth=require(_0x5e09('0x5'));var interaction=require(_0x5e09('0x6'));var config=require(_0x5e09('0x7'));var controller=require(_0x5e09('0x8'));router[_0x5e09('0x9')]('/',auth[_0x5e09('0xa')](),controller['index']);router[_0x5e09('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5e09('0xb')]('/',auth[_0x5e09('0xa')](),controller[_0x5e09('0xc')]);router[_0x5e09('0xd')](_0x5e09('0xe'),auth[_0x5e09('0xa')](),controller[_0x5e09('0xf')]);router[_0x5e09('0x10')](_0x5e09('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x5e09('0x11')]=router;
\ No newline at end of file
+var _0x0610=['index','/:id','show','create','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x17ee10,_0x2bc274){var _0x4c8cfa=function(_0x197cc4){while(--_0x197cc4){_0x17ee10['push'](_0x17ee10['shift']());}};_0x4c8cfa(++_0x2bc274);}(_0x0610,0x8f));var _0x0061=function(_0x168552,_0x564454){_0x168552=_0x168552-0x0;var _0x5a137a=_0x0610[_0x168552];return _0x5a137a;};'use strict';var multer=require(_0x0061('0x0'));var util=require(_0x0061('0x1'));var path=require(_0x0061('0x2'));var timeout=require('connect-timeout');var express=require(_0x0061('0x3'));var router=express[_0x0061('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0061('0x5'));var config=require(_0x0061('0x6'));var controller=require(_0x0061('0x7'));router[_0x0061('0x8')]('/',auth[_0x0061('0x9')](),controller[_0x0061('0xa')]);router[_0x0061('0x8')](_0x0061('0xb'),auth[_0x0061('0x9')](),controller[_0x0061('0xc')]);router['post']('/',auth[_0x0061('0x9')](),controller[_0x0061('0xd')]);router['put'](_0x0061('0xb'),auth[_0x0061('0x9')](),controller[_0x0061('0xe')]);router[_0x0061('0xf')](_0x0061('0xb'),auth[_0x0061('0x9')](),controller['destroy']);module[_0x0061('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 3f16d42..32d2266 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 _0x3098=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x278b77,_0x34f7dd){var _0x2b07f2=function(_0x32e6bf){while(--_0x32e6bf){_0x278b77['push'](_0x278b77['shift']());}};_0x2b07f2(++_0x34f7dd);}(_0x3098,0x86));var _0x8309=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x3098[_0x4629ee];return _0x47fb5b;};'use strict';var Sequelize=require(_0x8309('0x0'));module[_0x8309('0x1')]={'calldate':{'type':Sequelize[_0x8309('0x2')],'allowNull':![],'defaultValue':_0x8309('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x8309('0x4')]},'dst':{'type':Sequelize[_0x8309('0x4')]},'dcontext':{'type':Sequelize[_0x8309('0x4')]},'channel':{'type':Sequelize[_0x8309('0x4')]},'dstchannel':{'type':Sequelize[_0x8309('0x4')]},'lastapp':{'type':Sequelize[_0x8309('0x4')]},'lastdata':{'type':Sequelize[_0x8309('0x4')]},'duration':{'type':Sequelize[_0x8309('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8309('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8309('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8309('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8309('0x4')]},'linkedid':{'type':Sequelize[_0x8309('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8309('0x4')]},'tag':{'type':Sequelize[_0x8309('0x4')]}};
\ No newline at end of file
+var _0x3360=['exports','STRING','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3360,0x1d7));var _0x0336=function(_0x243037,_0x4c5b74){_0x243037=_0x243037-0x0;var _0x37626d=_0x3360[_0x243037];return _0x37626d;};'use strict';var Sequelize=require(_0x0336('0x0'));module[_0x0336('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0336('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0336('0x2')]},'dstchannel':{'type':Sequelize[_0x0336('0x2')]},'lastapp':{'type':Sequelize[_0x0336('0x2')]},'lastdata':{'type':Sequelize[_0x0336('0x2')]},'duration':{'type':Sequelize[_0x0336('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0336('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0336('0x2')]},'userfield':{'type':Sequelize[_0x0336('0x2')]},'uniqueid':{'type':Sequelize[_0x0336('0x2')]},'linkedid':{'type':Sequelize[_0x0336('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0336('0x2')]},'type':{'type':Sequelize[_0x0336('0x2')]},'tag':{'type':Sequelize[_0x0336('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index e74a9f1..9aaf1ad 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 _0xdb94=['keys','find','create','body','destroy','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','sort','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch'];(function(_0x142507,_0x51fb78){var _0x2a513c=function(_0x28050f){while(--_0x28050f){_0x142507['push'](_0x142507['shift']());}};_0x2a513c(++_0x51fb78);}(_0xdb94,0xe5));var _0x4db9=function(_0x36e567,_0xb4ba91){_0x36e567=_0x36e567-0x0;var _0x2df914=_0xdb94[_0x36e567];return _0x2df914;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4db9('0x0'));var zipdir=require(_0x4db9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db9('0x2'));var moment=require(_0x4db9('0x3'));var BPromise=require(_0x4db9('0x4'));var Mustache=require(_0x4db9('0x5'));var util=require(_0x4db9('0x6'));var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var fs_extra=require(_0x4db9('0x9'));var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0xe'));var querystring=require(_0x4db9('0xf'));var Papa=require(_0x4db9('0x10'));var Redis=require(_0x4db9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x12'));var as=require(_0x4db9('0x13'));var hardwareService=require(_0x4db9('0x14'));var logger=require(_0x4db9('0x15'))(_0x4db9('0x16'));var utils=require(_0x4db9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4db9('0x18'));var db=require(_0x4db9('0x19'))['db'];function respondWithStatusCode(_0x59f01c,_0x549c92){_0x549c92=_0x549c92||0xcc;return function(_0x19f2d3){if(_0x19f2d3){return _0x59f01c[_0x4db9('0x1a')](_0x549c92);}return _0x59f01c[_0x4db9('0x1b')](_0x549c92)['end']();};}function respondWithResult(_0x1a93be,_0x3dde55){_0x3dde55=_0x3dde55||0xc8;return function(_0x2018d2){if(_0x2018d2){return _0x1a93be[_0x4db9('0x1b')](_0x3dde55)[_0x4db9('0x1c')](_0x2018d2);}};}function respondWithFilteredResult(_0x585230,_0x1b1062){return function(_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=typeof _0x1b1062[_0x4db9('0x1d')]===_0x4db9('0x1e')&&typeof _0x1b1062[_0x4db9('0x1f')]==='undefined';var _0xedc513=_0x1a5a9c[_0x4db9('0x20')];var _0x4c5f4f=_0x5d4d70?0x0:_0x1b1062['offset'];var _0x493923=_0x5d4d70?_0x1a5a9c[_0x4db9('0x20')]:_0x1b1062[_0x4db9('0x1d')]+_0x1b1062['limit'];var _0x375515;if(_0x493923>=_0xedc513){_0x493923=_0xedc513;_0x375515=0xc8;}else{_0x375515=0xce;}_0x585230[_0x4db9('0x1b')](_0x375515);return _0x585230[_0x4db9('0x21')](_0x4db9('0x22'),_0x4c5f4f+'-'+_0x493923+'/'+_0xedc513)[_0x4db9('0x1c')](_0x1a5a9c);}return null;};}function patchUpdates(_0x28b7f6){return function(_0x34a6ed){try{jsonpatch[_0x4db9('0x23')](_0x34a6ed,_0x28b7f6,!![]);}catch(_0x3256f4){return BPromise[_0x4db9('0x24')](_0x3256f4);}return _0x34a6ed[_0x4db9('0x25')]();};}function saveUpdates(_0x102402,_0x4d56a1){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40[_0x4db9('0x26')](_0x102402)['then'](function(_0x37c81f){return _0x37c81f;});}return null;};}function removeEntity(_0x3f4931,_0x4419af){return function(_0x402898){if(_0x402898){return _0x402898['destroy']()[_0x4db9('0x27')](function(){_0x3f4931['status'](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x1c82b6,_0x135aa7){return function(_0x47e89c){if(!_0x47e89c){_0x1c82b6[_0x4db9('0x1a')](0x194);}return _0x47e89c;};}function handleError(_0x622db6,_0x47464d){_0x47464d=_0x47464d||0x1f4;return function(_0x5e7d29){logger['error'](_0x5e7d29[_0x4db9('0x29')]);if(_0x5e7d29['name']){delete _0x5e7d29[_0x4db9('0x2a')];}_0x622db6[_0x4db9('0x1b')](_0x47464d)[_0x4db9('0x2b')](_0x5e7d29);};}exports[_0x4db9('0x2c')]=function(_0x384df5,_0x3c3fcf){var _0x1d0dc2={},_0x373a7d={},_0x4c4a47={'count':0x0,'rows':[]};var _0x35f757=_['map'](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x1e7840){return{'name':_0x1e7840[_0x4db9('0x2f')],'type':_0x1e7840[_0x4db9('0x30')]['key']};});_0x373a7d[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x35f757,_0x4db9('0x2a'));_0x373a7d[_0x4db9('0x33')]=_['keys'](_0x384df5['query']);_0x373a7d[_0x4db9('0x34')]=_[_0x4db9('0x35')](_0x373a7d['model'],_0x373a7d['query']);_0x1d0dc2[_0x4db9('0x36')]=_['intersection'](_0x373a7d['model'],qs[_0x4db9('0x37')](_0x384df5[_0x4db9('0x33')]['fields']));_0x1d0dc2[_0x4db9('0x36')]=_0x1d0dc2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x1d0dc2[_0x4db9('0x36')]:_0x373a7d['model'];if(!_0x384df5[_0x4db9('0x33')]['hasOwnProperty']('nolimit')){_0x1d0dc2['limit']=qs[_0x4db9('0x1f')](_0x384df5[_0x4db9('0x33')]['limit']);_0x1d0dc2[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x384df5['query']['offset']);}_0x1d0dc2['order']=qs[_0x4db9('0x39')](_0x384df5['query'][_0x4db9('0x39')]);_0x1d0dc2['where']=qs[_0x4db9('0x34')](_[_0x4db9('0x3a')](_0x384df5[_0x4db9('0x33')],_0x373a7d[_0x4db9('0x34')]),_0x35f757);if(_0x384df5[_0x4db9('0x33')]['filter']){_0x1d0dc2[_0x4db9('0x3b')]=_['merge'](_0x1d0dc2[_0x4db9('0x3b')],{'$or':_[_0x4db9('0x32')](_0x35f757,function(_0x15929e){if(_0x15929e[_0x4db9('0x30')]!==_0x4db9('0x3c')){var _0x4159d2={};_0x4159d2[_0x15929e['name']]={'$like':'%'+_0x384df5[_0x4db9('0x33')][_0x4db9('0x3d')]+'%'};return _0x4159d2;}})});}_0x1d0dc2=_['merge']({},_0x1d0dc2,_0x384df5['options']);var _0x404af3={'where':_0x1d0dc2[_0x4db9('0x3b')]};return db[_0x4db9('0x2d')][_0x4db9('0x20')](_0x404af3)[_0x4db9('0x27')](function(_0x36a648){_0x4c4a47[_0x4db9('0x20')]=_0x36a648;if(_0x384df5[_0x4db9('0x33')][_0x4db9('0x3e')]){_0x1d0dc2[_0x4db9('0x3f')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x40')](_0x1d0dc2);})['then'](function(_0x2716d6){_0x4c4a47[_0x4db9('0x41')]=_0x2716d6;return _0x4c4a47;})[_0x4db9('0x27')](respondWithFilteredResult(_0x3c3fcf,_0x1d0dc2))[_0x4db9('0x42')](handleError(_0x3c3fcf,null));};exports['show']=function(_0x57d32d,_0x248891){var _0x2b18a2={'raw':!![],'where':{'id':_0x57d32d['params']['id']}},_0x2fc233={};_0x2fc233[_0x4db9('0x31')]=_['keys'](db[_0x4db9('0x2d')][_0x4db9('0x2e')]);_0x2fc233[_0x4db9('0x33')]=_[_0x4db9('0x43')](_0x57d32d[_0x4db9('0x33')]);_0x2fc233['filters']=_[_0x4db9('0x35')](_0x2fc233[_0x4db9('0x31')],_0x2fc233[_0x4db9('0x33')]);_0x2b18a2[_0x4db9('0x36')]=_[_0x4db9('0x35')](_0x2fc233['model'],qs[_0x4db9('0x37')](_0x57d32d[_0x4db9('0x33')][_0x4db9('0x37')]));_0x2b18a2[_0x4db9('0x36')]=_0x2b18a2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x2b18a2[_0x4db9('0x36')]:_0x2fc233[_0x4db9('0x31')];if(_0x57d32d[_0x4db9('0x33')]['includeAll']){_0x2b18a2[_0x4db9('0x3f')]=[{'all':!![]}];}_0x2b18a2=_['merge']({},_0x2b18a2,_0x57d32d['options']);return db[_0x4db9('0x2d')][_0x4db9('0x44')](_0x2b18a2)['then'](handleEntityNotFound(_0x248891,null))['then'](respondWithResult(_0x248891,null))[_0x4db9('0x42')](handleError(_0x248891,null));};exports[_0x4db9('0x45')]=function(_0x3fc788,_0x7f0aac){return db[_0x4db9('0x2d')][_0x4db9('0x45')](_0x3fc788[_0x4db9('0x46')],{})[_0x4db9('0x27')](respondWithResult(_0x7f0aac,0xc9))[_0x4db9('0x42')](handleError(_0x7f0aac,null));};exports[_0x4db9('0x26')]=function(_0x43312c,_0x5495de){if(_0x43312c[_0x4db9('0x46')]['id']){delete _0x43312c[_0x4db9('0x46')]['id'];}return db['Cdr'][_0x4db9('0x44')]({'where':{'id':_0x43312c['params']['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x5495de,null))[_0x4db9('0x27')](saveUpdates(_0x43312c[_0x4db9('0x46')],null))[_0x4db9('0x27')](respondWithResult(_0x5495de,null))[_0x4db9('0x42')](handleError(_0x5495de,null));};exports[_0x4db9('0x47')]=function(_0x3f1aac,_0x3b8d8c){return db[_0x4db9('0x2d')][_0x4db9('0x44')]({'where':{'id':_0x3f1aac[_0x4db9('0x48')]['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x3b8d8c,null))[_0x4db9('0x27')](removeEntity(_0x3b8d8c,null))['catch'](handleError(_0x3b8d8c,null));};exports['describe']=function(_0x5ececc,_0x161e2e){return db['Cdr'][_0x4db9('0x49')]()['then'](respondWithResult(_0x161e2e,null))[_0x4db9('0x42')](handleError(_0x161e2e,null));};
\ No newline at end of file
+var _0x99c9=['merge','options','include','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','map','Cdr','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','filter'];(function(_0x3b22d9,_0x1569bb){var _0x281a9a=function(_0x436e9a){while(--_0x436e9a){_0x3b22d9['push'](_0x3b22d9['shift']());}};_0x281a9a(++_0x1569bb);}(_0x99c9,0x13c));var _0x999c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x99c9[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0x999c('0x0'));var rimraf=require(_0x999c('0x1'));var zipdir=require(_0x999c('0x2'));var jsonpatch=require(_0x999c('0x3'));var rp=require(_0x999c('0x4'));var moment=require(_0x999c('0x5'));var BPromise=require(_0x999c('0x6'));var Mustache=require('mustache');var util=require(_0x999c('0x7'));var path=require(_0x999c('0x8'));var sox=require(_0x999c('0x9'));var csv=require(_0x999c('0xa'));var ejs=require(_0x999c('0xb'));var fs=require('fs');var fs_extra=require(_0x999c('0xc'));var _=require(_0x999c('0xd'));var squel=require(_0x999c('0xe'));var crypto=require(_0x999c('0xf'));var jsforce=require(_0x999c('0x10'));var deskjs=require(_0x999c('0x11'));var toCsv=require(_0x999c('0xa'));var querystring=require(_0x999c('0x12'));var Papa=require(_0x999c('0x13'));var Redis=require('ioredis');var authService=require(_0x999c('0x14'));var qs=require(_0x999c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x999c('0x16'));var logger=require(_0x999c('0x17'))(_0x999c('0x18'));var utils=require(_0x999c('0x19'));var config=require(_0x999c('0x1a'));var licenseUtil=require(_0x999c('0x1b'));var db=require(_0x999c('0x1c'))['db'];function respondWithStatusCode(_0x3d7c6d,_0x2e5f7e){_0x2e5f7e=_0x2e5f7e||0xcc;return function(_0x44a5bc){if(_0x44a5bc){return _0x3d7c6d[_0x999c('0x1d')](_0x2e5f7e);}return _0x3d7c6d[_0x999c('0x1e')](_0x2e5f7e)['end']();};}function respondWithResult(_0x15f812,_0xd14862){_0xd14862=_0xd14862||0xc8;return function(_0x4f2916){if(_0x4f2916){return _0x15f812['status'](_0xd14862)['json'](_0x4f2916);}};}function respondWithFilteredResult(_0x161434,_0xb3e981){return function(_0x203a73){if(_0x203a73){var _0x116f08=typeof _0xb3e981[_0x999c('0x1f')]==='undefined'&&typeof _0xb3e981[_0x999c('0x20')]===_0x999c('0x21');var _0x2b6126=_0x203a73[_0x999c('0x22')];var _0x110486=_0x116f08?0x0:_0xb3e981['offset'];var _0x1b327f=_0x116f08?_0x203a73[_0x999c('0x22')]:_0xb3e981[_0x999c('0x1f')]+_0xb3e981[_0x999c('0x20')];var _0x32c66c;if(_0x1b327f>=_0x2b6126){_0x1b327f=_0x2b6126;_0x32c66c=0xc8;}else{_0x32c66c=0xce;}_0x161434['status'](_0x32c66c);return _0x161434[_0x999c('0x23')](_0x999c('0x24'),_0x110486+'-'+_0x1b327f+'/'+_0x2b6126)[_0x999c('0x25')](_0x203a73);}return null;};}function patchUpdates(_0x1ec406){return function(_0xceb421){try{jsonpatch[_0x999c('0x26')](_0xceb421,_0x1ec406,!![]);}catch(_0x4a2865){return BPromise[_0x999c('0x27')](_0x4a2865);}return _0xceb421[_0x999c('0x28')]();};}function saveUpdates(_0x24f637,_0x2bcfc9){return function(_0x1c6e55){if(_0x1c6e55){return _0x1c6e55[_0x999c('0x29')](_0x24f637)[_0x999c('0x2a')](function(_0x2a7986){return _0x2a7986;});}return null;};}function removeEntity(_0x4002d2,_0x281720){return function(_0x2cfd83){if(_0x2cfd83){return _0x2cfd83['destroy']()[_0x999c('0x2a')](function(){_0x4002d2[_0x999c('0x1e')](0xcc)[_0x999c('0x2b')]();});}};}function handleEntityNotFound(_0x2e9d58,_0x2256fd){return function(_0x15d102){if(!_0x15d102){_0x2e9d58['sendStatus'](0x194);}return _0x15d102;};}function handleError(_0x4755c2,_0x43293f){_0x43293f=_0x43293f||0x1f4;return function(_0x1c866f){logger['error'](_0x1c866f[_0x999c('0x2c')]);if(_0x1c866f[_0x999c('0x2d')]){delete _0x1c866f['name'];}_0x4755c2[_0x999c('0x1e')](_0x43293f)['send'](_0x1c866f);};}exports['index']=function(_0xedf57d,_0x42cb25){var _0x457df3={},_0x2de6d5={},_0x3737e9={'count':0x0,'rows':[]};var _0x42c2e8=_[_0x999c('0x2e')](db[_0x999c('0x2f')][_0x999c('0x30')],function(_0x3b836a){return{'name':_0x3b836a['fieldName'],'type':_0x3b836a[_0x999c('0x31')][_0x999c('0x32')]};});_0x2de6d5[_0x999c('0x33')]=_[_0x999c('0x2e')](_0x42c2e8,_0x999c('0x2d'));_0x2de6d5[_0x999c('0x34')]=_[_0x999c('0x35')](_0xedf57d[_0x999c('0x34')]);_0x2de6d5['filters']=_['intersection'](_0x2de6d5[_0x999c('0x33')],_0x2de6d5[_0x999c('0x34')]);_0x457df3[_0x999c('0x36')]=_[_0x999c('0x37')](_0x2de6d5['model'],qs[_0x999c('0x38')](_0xedf57d[_0x999c('0x34')][_0x999c('0x38')]));_0x457df3[_0x999c('0x36')]=_0x457df3['attributes']['length']?_0x457df3[_0x999c('0x36')]:_0x2de6d5[_0x999c('0x33')];if(!_0xedf57d[_0x999c('0x34')][_0x999c('0x39')](_0x999c('0x3a'))){_0x457df3[_0x999c('0x20')]=qs[_0x999c('0x20')](_0xedf57d['query']['limit']);_0x457df3['offset']=qs[_0x999c('0x1f')](_0xedf57d[_0x999c('0x34')]['offset']);}_0x457df3['order']=qs['sort'](_0xedf57d[_0x999c('0x34')][_0x999c('0x3b')]);_0x457df3[_0x999c('0x3c')]=qs[_0x999c('0x3d')](_['pick'](_0xedf57d[_0x999c('0x34')],_0x2de6d5[_0x999c('0x3d')]),_0x42c2e8);if(_0xedf57d['query']['filter']){_0x457df3[_0x999c('0x3c')]=_['merge'](_0x457df3[_0x999c('0x3c')],{'$or':_['map'](_0x42c2e8,function(_0x3605a3){if(_0x3605a3[_0x999c('0x31')]!==_0x999c('0x3e')){var _0xcd729={};_0xcd729[_0x3605a3['name']]={'$like':'%'+_0xedf57d['query'][_0x999c('0x3f')]+'%'};return _0xcd729;}})});}_0x457df3=_[_0x999c('0x40')]({},_0x457df3,_0xedf57d[_0x999c('0x41')]);var _0xf26ba3={'where':_0x457df3['where']};return db[_0x999c('0x2f')][_0x999c('0x22')](_0xf26ba3)[_0x999c('0x2a')](function(_0x5fa1de){_0x3737e9['count']=_0x5fa1de;if(_0xedf57d[_0x999c('0x34')]['includeAll']){_0x457df3[_0x999c('0x42')]=[{'all':!![]}];}return db[_0x999c('0x2f')]['findAll'](_0x457df3);})[_0x999c('0x2a')](function(_0x357915){_0x3737e9[_0x999c('0x43')]=_0x357915;return _0x3737e9;})[_0x999c('0x2a')](respondWithFilteredResult(_0x42cb25,_0x457df3))[_0x999c('0x44')](handleError(_0x42cb25,null));};exports[_0x999c('0x45')]=function(_0xa6b0f1,_0x3edf69){var _0x4ef478={'raw':!![],'where':{'id':_0xa6b0f1['params']['id']}},_0x563e11={};_0x563e11['model']=_[_0x999c('0x35')](db[_0x999c('0x2f')][_0x999c('0x30')]);_0x563e11[_0x999c('0x34')]=_[_0x999c('0x35')](_0xa6b0f1['query']);_0x563e11[_0x999c('0x3d')]=_[_0x999c('0x37')](_0x563e11[_0x999c('0x33')],_0x563e11[_0x999c('0x34')]);_0x4ef478[_0x999c('0x36')]=_['intersection'](_0x563e11[_0x999c('0x33')],qs[_0x999c('0x38')](_0xa6b0f1[_0x999c('0x34')][_0x999c('0x38')]));_0x4ef478[_0x999c('0x36')]=_0x4ef478[_0x999c('0x36')][_0x999c('0x46')]?_0x4ef478[_0x999c('0x36')]:_0x563e11[_0x999c('0x33')];if(_0xa6b0f1['query']['includeAll']){_0x4ef478[_0x999c('0x42')]=[{'all':!![]}];}_0x4ef478=_[_0x999c('0x40')]({},_0x4ef478,_0xa6b0f1[_0x999c('0x41')]);return db[_0x999c('0x2f')][_0x999c('0x47')](_0x4ef478)[_0x999c('0x2a')](handleEntityNotFound(_0x3edf69,null))[_0x999c('0x2a')](respondWithResult(_0x3edf69,null))[_0x999c('0x44')](handleError(_0x3edf69,null));};exports[_0x999c('0x48')]=function(_0x26ebd7,_0x3457d6){return db['Cdr'][_0x999c('0x48')](_0x26ebd7[_0x999c('0x49')],{})[_0x999c('0x2a')](respondWithResult(_0x3457d6,0xc9))[_0x999c('0x44')](handleError(_0x3457d6,null));};exports[_0x999c('0x29')]=function(_0x386be6,_0x11f3bf){if(_0x386be6[_0x999c('0x49')]['id']){delete _0x386be6['body']['id'];}return db[_0x999c('0x2f')][_0x999c('0x47')]({'where':{'id':_0x386be6[_0x999c('0x4a')]['id']}})[_0x999c('0x2a')](handleEntityNotFound(_0x11f3bf,null))[_0x999c('0x2a')](saveUpdates(_0x386be6[_0x999c('0x49')],null))[_0x999c('0x2a')](respondWithResult(_0x11f3bf,null))['catch'](handleError(_0x11f3bf,null));};exports['destroy']=function(_0x1139f6,_0x3f134a){return db[_0x999c('0x2f')][_0x999c('0x47')]({'where':{'id':_0x1139f6[_0x999c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f134a,null))[_0x999c('0x2a')](removeEntity(_0x3f134a,null))[_0x999c('0x44')](handleError(_0x3f134a,null));};exports[_0x999c('0x4b')]=function(_0x11cc72,_0x5c066e){return db[_0x999c('0x2f')]['describe']()[_0x999c('0x2a')](respondWithResult(_0x5c066e,null))[_0x999c('0x44')](handleError(_0x5c066e,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 198a701..f4a5677 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(_0x49f87b,_0x41908f){var _0x4ee2b6=function(_0x4b5fab){while(--_0x4b5fab){_0x49f87b['push'](_0x49f87b['shift']());}};_0x4ee2b6(++_0x41908f);}(_0x7a54,0x106));var _0x47a5=function(_0x514b5a,_0x1d05d8){_0x514b5a=_0x514b5a-0x0;var _0x29810a=_0x7a54[_0x514b5a];return _0x29810a;};'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(_0x3f61c9,_0x35c04a){var _0xecf82=function(_0x33ccee){while(--_0x33ccee){_0x3f61c9['push'](_0x3f61c9['shift']());}};_0xecf82(++_0x35c04a);}(_0x7a54,0x106));var _0x47a5=function(_0x597357,_0x4a01cc){_0x597357=_0x597357-0x0;var _0x195f1d=_0x7a54[_0x597357];return _0x195f1d;};'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 392e404..10c35c7 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 _0xeef8=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x404fb4,_0x508e6d){var _0x28992d=function(_0x56d9b7){while(--_0x56d9b7){_0x404fb4['push'](_0x404fb4['shift']());}};_0x28992d(++_0x508e6d);}(_0xeef8,0x1ad));var _0x8eef=function(_0x249bae,_0x39509a){_0x249bae=_0x249bae-0x0;var _0x5407f1=_0xeef8[_0x249bae];return _0x5407f1;};'use strict';var _=require(_0x8eef('0x0'));var util=require(_0x8eef('0x1'));var moment=require('moment');var BPromise=require(_0x8eef('0x2'));var rs=require(_0x8eef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eef('0x4'))['db'];var utils=require(_0x8eef('0x5'));var logger=require(_0x8eef('0x6'))('rpc');var config=require(_0x8eef('0x7'));var jayson=require(_0x8eef('0x8'));var client=jayson[_0x8eef('0x9')][_0x8eef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381290,_0x478694,_0x489a90){return new BPromise(function(_0x5f4a83,_0x40b5f9){return client[_0x8eef('0xb')](_0x381290,_0x489a90)[_0x8eef('0xc')](function(_0x431b8c){logger[_0x8eef('0xd')]('Cdr,\x20%s,\x20%s',_0x478694,_0x8eef('0xe'));logger[_0x8eef('0xf')](_0x8eef('0x10'),_0x478694,_0x8eef('0xe'),JSON[_0x8eef('0x11')](_0x431b8c));if(_0x431b8c[_0x8eef('0x12')]){if(_0x431b8c[_0x8eef('0x12')][_0x8eef('0x13')]===0x1f4){logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0x431b8c[_0x8eef('0x12')]['message']);return _0x40b5f9(_0x431b8c[_0x8eef('0x12')]['message']);}logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0x431b8c[_0x8eef('0x12')]['message']);return _0x5f4a83(_0x431b8c['error'][_0x8eef('0x14')]);}else{logger['info'](_0x8eef('0x15'),_0x478694,_0x8eef('0xe'));_0x5f4a83(_0x431b8c[_0x8eef('0x16')][_0x8eef('0x14')]);}})[_0x8eef('0x17')](function(_0xf27091){logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0xf27091);_0x40b5f9(_0xf27091);});});}
\ No newline at end of file
+var _0xde4b=['../../config/logger','rpc','../../config/environment','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xf36836,_0x5b3808){var _0x25cc8f=function(_0x29f834){while(--_0x29f834){_0xf36836['push'](_0xf36836['shift']());}};_0x25cc8f(++_0x5b3808);}(_0xde4b,0xca));var _0xbde4=function(_0x2ad5da,_0x31de5a){_0x2ad5da=_0x2ad5da-0x0;var _0x574d03=_0xde4b[_0x2ad5da];return _0x574d03;};'use strict';var _=require(_0xbde4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbde4('0x1'));var rs=require(_0xbde4('0x2'));var fs=require('fs');var Redis=require(_0xbde4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbde4('0x4'));var logger=require(_0xbde4('0x5'))(_0xbde4('0x6'));var config=require(_0xbde4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbde4('0x8')][_0xbde4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x172095,_0x13cc78,_0x2d92d0){return new BPromise(function(_0x13c764,_0x402ddf){return client[_0xbde4('0xa')](_0x172095,_0x2d92d0)[_0xbde4('0xb')](function(_0x333e13){logger['info'](_0xbde4('0xc'),_0x13cc78,_0xbde4('0xd'));logger[_0xbde4('0xe')](_0xbde4('0xf'),_0x13cc78,_0xbde4('0xd'),JSON[_0xbde4('0x10')](_0x333e13));if(_0x333e13['error']){if(_0x333e13[_0xbde4('0x11')][_0xbde4('0x12')]===0x1f4){logger[_0xbde4('0x11')](_0xbde4('0xc'),_0x13cc78,_0x333e13[_0xbde4('0x11')][_0xbde4('0x13')]);return _0x402ddf(_0x333e13['error'][_0xbde4('0x13')]);}logger['error'](_0xbde4('0xc'),_0x13cc78,_0x333e13[_0xbde4('0x11')][_0xbde4('0x13')]);return _0x13c764(_0x333e13[_0xbde4('0x11')][_0xbde4('0x13')]);}else{logger[_0xbde4('0x14')](_0xbde4('0xc'),_0x13cc78,_0xbde4('0xd'));_0x13c764(_0x333e13[_0xbde4('0x15')][_0xbde4('0x13')]);}})[_0xbde4('0x16')](function(_0x55c38f){logger[_0xbde4('0x11')](_0xbde4('0xc'),_0x13cc78,_0x55c38f);_0x402ddf(_0x55c38f);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index a80baf7..c068263 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5cfaf5,_0x1c4530){var _0x30468e=function(_0x4b97ed){while(--_0x4b97ed){_0x5cfaf5['push'](_0x5cfaf5['shift']());}};_0x30468e(++_0x1c4530);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _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(_0x27e2c8,_0x5f40a0){var _0x5454d4=function(_0x2cbef9){while(--_0x2cbef9){_0x27e2c8['push'](_0x27e2c8['shift']());}};_0x5454d4(++_0x5f40a0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 ed058bc..bec1ada 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 _0x4b7b=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x4add74,_0x41e997){var _0x64e1f2=function(_0x1c6985){while(--_0x1c6985){_0x4add74['push'](_0x4add74['shift']());}};_0x64e1f2(++_0x41e997);}(_0x4b7b,0x143));var _0xb4b7=function(_0x14fa9f,_0x4b9856){_0x14fa9f=_0x14fa9f-0x0;var _0x362f8d=_0x4b7b[_0x14fa9f];return _0x362f8d;};'use strict';var Sequelize=require('sequelize');module[_0xb4b7('0x0')]={'priority':{'type':Sequelize[_0xb4b7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb4b7('0x2')],'allowNull':![],'defaultValue':_0xb4b7('0x3')},'appdata':{'type':Sequelize[_0xb4b7('0x4')]()},'description':{'type':Sequelize[_0xb4b7('0x2')]},'interval':{'type':Sequelize[_0xb4b7('0x2')],'defaultValue':_0xb4b7('0x5')}};
\ No newline at end of file
+var _0xb73a=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb73a,0x177));var _0xab73=function(_0x1b7d22,_0x42b813){_0x1b7d22=_0x1b7d22-0x0;var _0x1e45ed=_0xb73a[_0x1b7d22];return _0x1e45ed;};'use strict';var Sequelize=require(_0xab73('0x0'));module[_0xab73('0x1')]={'priority':{'type':Sequelize[_0xab73('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xab73('0x3')],'allowNull':![],'defaultValue':_0xab73('0x4')},'appdata':{'type':Sequelize[_0xab73('0x5')]()},'description':{'type':Sequelize[_0xab73('0x3')]},'interval':{'type':Sequelize[_0xab73('0x3')],'defaultValue':_0xab73('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 66dba03..0f67f90 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 _0x19c3=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','include','merge','find','catch','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model'];(function(_0x17b4cd,_0x428e1a){var _0x35449c=function(_0x3b0a1a){while(--_0x3b0a1a){_0x17b4cd['push'](_0x17b4cd['shift']());}};_0x35449c(++_0x428e1a);}(_0x19c3,0xf9));var _0x319c=function(_0x29b931,_0x109906){_0x29b931=_0x29b931-0x0;var _0xafbd90=_0x19c3[_0x29b931];return _0xafbd90;};'use strict';var emlformat=require(_0x319c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x319c('0x1'));var jsonpatch=require(_0x319c('0x2'));var rp=require('request-promise');var moment=require(_0x319c('0x3'));var BPromise=require(_0x319c('0x4'));var Mustache=require(_0x319c('0x5'));var util=require(_0x319c('0x6'));var path=require(_0x319c('0x7'));var sox=require(_0x319c('0x8'));var csv=require('to-csv');var ejs=require(_0x319c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x319c('0xa'));var squel=require(_0x319c('0xb'));var crypto=require(_0x319c('0xc'));var jsforce=require(_0x319c('0xd'));var deskjs=require(_0x319c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x319c('0xf'));var Papa=require(_0x319c('0x10'));var Redis=require(_0x319c('0x11'));var authService=require(_0x319c('0x12'));var qs=require(_0x319c('0x13'));var as=require(_0x319c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x319c('0x15'))('api');var utils=require(_0x319c('0x16'));var config=require(_0x319c('0x17'));var licenseUtil=require(_0x319c('0x18'));var db=require(_0x319c('0x19'))['db'];function respondWithStatusCode(_0x362f44,_0x3be537){_0x3be537=_0x3be537||0xcc;return function(_0x401fdb){if(_0x401fdb){return _0x362f44['sendStatus'](_0x3be537);}return _0x362f44['status'](_0x3be537)[_0x319c('0x1a')]();};}function respondWithResult(_0x2fb398,_0x4c246e){_0x4c246e=_0x4c246e||0xc8;return function(_0x372a50){if(_0x372a50){return _0x2fb398[_0x319c('0x1b')](_0x4c246e)[_0x319c('0x1c')](_0x372a50);}};}function respondWithFilteredResult(_0x2cd063,_0x23afe7){return function(_0xa9b5a7){if(_0xa9b5a7){var _0x29b26c=typeof _0x23afe7['offset']==='undefined'&&typeof _0x23afe7[_0x319c('0x1d')]===_0x319c('0x1e');var _0x53c939=_0xa9b5a7[_0x319c('0x1f')];var _0x49624c=_0x29b26c?0x0:_0x23afe7[_0x319c('0x20')];var _0x45a822=_0x29b26c?_0xa9b5a7[_0x319c('0x1f')]:_0x23afe7[_0x319c('0x20')]+_0x23afe7[_0x319c('0x1d')];var _0x1c11d3;if(_0x45a822>=_0x53c939){_0x45a822=_0x53c939;_0x1c11d3=0xc8;}else{_0x1c11d3=0xce;}_0x2cd063[_0x319c('0x1b')](_0x1c11d3);return _0x2cd063['set'](_0x319c('0x21'),_0x49624c+'-'+_0x45a822+'/'+_0x53c939)[_0x319c('0x1c')](_0xa9b5a7);}return null;};}function patchUpdates(_0x5bd273){return function(_0x500597){try{jsonpatch[_0x319c('0x22')](_0x500597,_0x5bd273,!![]);}catch(_0xc2e927){return BPromise[_0x319c('0x23')](_0xc2e927);}return _0x500597['save']();};}function saveUpdates(_0x3bc070,_0xe50337){return function(_0x386340){if(_0x386340){return _0x386340[_0x319c('0x24')](_0x3bc070)[_0x319c('0x25')](function(_0x4d2ace){return _0x4d2ace;});}return null;};}function removeEntity(_0x1d9dfd,_0x2444c8){return function(_0x4508a5){if(_0x4508a5){return _0x4508a5[_0x319c('0x26')]()[_0x319c('0x25')](function(){_0x1d9dfd['status'](0xcc)[_0x319c('0x1a')]();});}};}function handleEntityNotFound(_0x4f87f8,_0x2cf97b){return function(_0x5fcf3c){if(!_0x5fcf3c){_0x4f87f8['sendStatus'](0x194);}return _0x5fcf3c;};}function handleError(_0x46e747,_0x5d93b9){_0x5d93b9=_0x5d93b9||0x1f4;return function(_0x4273de){logger[_0x319c('0x27')](_0x4273de[_0x319c('0x28')]);if(_0x4273de[_0x319c('0x29')]){delete _0x4273de[_0x319c('0x29')];}_0x46e747[_0x319c('0x1b')](_0x5d93b9)[_0x319c('0x2a')](_0x4273de);};}exports[_0x319c('0x2b')]=function(_0x363362,_0x5cf5de){var _0x2a7421={'raw':!![],'where':{'id':_0x363362[_0x319c('0x2c')]['id']}},_0x2591c6={};_0x2591c6[_0x319c('0x2d')]=_[_0x319c('0x2e')](db[_0x319c('0x2f')][_0x319c('0x30')]);_0x2591c6[_0x319c('0x31')]=_[_0x319c('0x2e')](_0x363362['query']);_0x2591c6[_0x319c('0x32')]=_[_0x319c('0x33')](_0x2591c6[_0x319c('0x2d')],_0x2591c6[_0x319c('0x31')]);_0x2a7421['attributes']=_[_0x319c('0x33')](_0x2591c6[_0x319c('0x2d')],qs[_0x319c('0x34')](_0x363362['query'][_0x319c('0x34')]));_0x2a7421['attributes']=_0x2a7421[_0x319c('0x35')]['length']?_0x2a7421[_0x319c('0x35')]:_0x2591c6[_0x319c('0x2d')];if(_0x363362[_0x319c('0x31')]['includeAll']){_0x2a7421[_0x319c('0x36')]=[{'all':!![]}];}_0x2a7421=_[_0x319c('0x37')]({},_0x2a7421,_0x363362['options']);return db[_0x319c('0x2f')][_0x319c('0x38')](_0x2a7421)[_0x319c('0x25')](handleEntityNotFound(_0x5cf5de,null))[_0x319c('0x25')](respondWithResult(_0x5cf5de,null))[_0x319c('0x39')](handleError(_0x5cf5de,null));};exports['update']=function(_0x9c47df,_0x220a8c){if(_0x9c47df[_0x319c('0x3a')]['id']){delete _0x9c47df[_0x319c('0x3a')]['id'];}return db[_0x319c('0x2f')][_0x319c('0x38')]({'where':{'id':_0x9c47df[_0x319c('0x2c')]['id']}})[_0x319c('0x25')](handleEntityNotFound(_0x220a8c,null))[_0x319c('0x25')](saveUpdates(_0x9c47df['body'],null))[_0x319c('0x25')](respondWithResult(_0x220a8c,null))[_0x319c('0x39')](handleError(_0x220a8c,null));};exports[_0x319c('0x26')]=function(_0x176d3f,_0x5b280e){return db[_0x319c('0x2f')][_0x319c('0x38')]({'where':{'id':_0x176d3f[_0x319c('0x2c')]['id']}})[_0x319c('0x25')](handleEntityNotFound(_0x5b280e,null))[_0x319c('0x25')](removeEntity(_0x5b280e,null))[_0x319c('0x39')](handleError(_0x5b280e,null));};
\ No newline at end of file
+var _0x6427=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','status','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','body','params','catch','rimraf','zip-dir'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x6427,0xbe));var _0x7642=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6427[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7642('0x0'));var zipdir=require(_0x7642('0x1'));var jsonpatch=require(_0x7642('0x2'));var rp=require(_0x7642('0x3'));var moment=require(_0x7642('0x4'));var BPromise=require(_0x7642('0x5'));var Mustache=require('mustache');var util=require(_0x7642('0x6'));var path=require(_0x7642('0x7'));var sox=require(_0x7642('0x8'));var csv=require(_0x7642('0x9'));var ejs=require(_0x7642('0xa'));var fs=require('fs');var fs_extra=require(_0x7642('0xb'));var _=require(_0x7642('0xc'));var squel=require(_0x7642('0xd'));var crypto=require(_0x7642('0xe'));var jsforce=require(_0x7642('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7642('0x10'));var Papa=require(_0x7642('0x11'));var Redis=require(_0x7642('0x12'));var authService=require(_0x7642('0x13'));var qs=require(_0x7642('0x14'));var as=require(_0x7642('0x15'));var hardwareService=require(_0x7642('0x16'));var logger=require(_0x7642('0x17'))(_0x7642('0x18'));var utils=require(_0x7642('0x19'));var config=require(_0x7642('0x1a'));var licenseUtil=require(_0x7642('0x1b'));var db=require(_0x7642('0x1c'))['db'];function respondWithStatusCode(_0x3e5f50,_0x3c1291){_0x3c1291=_0x3c1291||0xcc;return function(_0x32e5c9){if(_0x32e5c9){return _0x3e5f50[_0x7642('0x1d')](_0x3c1291);}return _0x3e5f50['status'](_0x3c1291)[_0x7642('0x1e')]();};}function respondWithResult(_0x3adb30,_0x4930f4){_0x4930f4=_0x4930f4||0xc8;return function(_0x146ef9){if(_0x146ef9){return _0x3adb30['status'](_0x4930f4)[_0x7642('0x1f')](_0x146ef9);}};}function respondWithFilteredResult(_0x506c94,_0x1aa890){return function(_0x37964a){if(_0x37964a){var _0x3b87aa=typeof _0x1aa890[_0x7642('0x20')]===_0x7642('0x21')&&typeof _0x1aa890[_0x7642('0x22')]===_0x7642('0x21');var _0x4b04a7=_0x37964a[_0x7642('0x23')];var _0x392686=_0x3b87aa?0x0:_0x1aa890[_0x7642('0x20')];var _0x96bc79=_0x3b87aa?_0x37964a['count']:_0x1aa890['offset']+_0x1aa890[_0x7642('0x22')];var _0x42db03;if(_0x96bc79>=_0x4b04a7){_0x96bc79=_0x4b04a7;_0x42db03=0xc8;}else{_0x42db03=0xce;}_0x506c94['status'](_0x42db03);return _0x506c94[_0x7642('0x24')](_0x7642('0x25'),_0x392686+'-'+_0x96bc79+'/'+_0x4b04a7)['json'](_0x37964a);}return null;};}function patchUpdates(_0x503c13){return function(_0xb6b0c4){try{jsonpatch[_0x7642('0x26')](_0xb6b0c4,_0x503c13,!![]);}catch(_0x580573){return BPromise['reject'](_0x580573);}return _0xb6b0c4[_0x7642('0x27')]();};}function saveUpdates(_0xc23c3,_0x37de2b){return function(_0x4f55d4){if(_0x4f55d4){return _0x4f55d4[_0x7642('0x28')](_0xc23c3)[_0x7642('0x29')](function(_0x508265){return _0x508265;});}return null;};}function removeEntity(_0x606a05,_0x812f9){return function(_0xf31489){if(_0xf31489){return _0xf31489[_0x7642('0x2a')]()['then'](function(){_0x606a05[_0x7642('0x2b')](0xcc)[_0x7642('0x1e')]();});}};}function handleEntityNotFound(_0x1b8eac,_0x15148a){return function(_0x5b74c3){if(!_0x5b74c3){_0x1b8eac[_0x7642('0x1d')](0x194);}return _0x5b74c3;};}function handleError(_0x5c2750,_0x1993e3){_0x1993e3=_0x1993e3||0x1f4;return function(_0x2083f6){logger['error'](_0x2083f6[_0x7642('0x2c')]);if(_0x2083f6[_0x7642('0x2d')]){delete _0x2083f6[_0x7642('0x2d')];}_0x5c2750['status'](_0x1993e3)[_0x7642('0x2e')](_0x2083f6);};}exports['show']=function(_0x3f4764,_0x6e04c5){var _0x4a4fee={'raw':!![],'where':{'id':_0x3f4764['params']['id']}},_0x788aa9={};_0x788aa9[_0x7642('0x2f')]=_[_0x7642('0x30')](db[_0x7642('0x31')][_0x7642('0x32')]);_0x788aa9[_0x7642('0x33')]=_[_0x7642('0x30')](_0x3f4764[_0x7642('0x33')]);_0x788aa9[_0x7642('0x34')]=_[_0x7642('0x35')](_0x788aa9[_0x7642('0x2f')],_0x788aa9[_0x7642('0x33')]);_0x4a4fee[_0x7642('0x36')]=_['intersection'](_0x788aa9['model'],qs[_0x7642('0x37')](_0x3f4764[_0x7642('0x33')][_0x7642('0x37')]));_0x4a4fee['attributes']=_0x4a4fee[_0x7642('0x36')][_0x7642('0x38')]?_0x4a4fee['attributes']:_0x788aa9[_0x7642('0x2f')];if(_0x3f4764['query'][_0x7642('0x39')]){_0x4a4fee[_0x7642('0x3a')]=[{'all':!![]}];}_0x4a4fee=_[_0x7642('0x3b')]({},_0x4a4fee,_0x3f4764['options']);return db['ChatApplication'][_0x7642('0x3c')](_0x4a4fee)['then'](handleEntityNotFound(_0x6e04c5,null))['then'](respondWithResult(_0x6e04c5,null))['catch'](handleError(_0x6e04c5,null));};exports['update']=function(_0x3dd01f,_0x160c10){if(_0x3dd01f[_0x7642('0x3d')]['id']){delete _0x3dd01f[_0x7642('0x3d')]['id'];}return db[_0x7642('0x31')][_0x7642('0x3c')]({'where':{'id':_0x3dd01f[_0x7642('0x3e')]['id']}})[_0x7642('0x29')](handleEntityNotFound(_0x160c10,null))[_0x7642('0x29')](saveUpdates(_0x3dd01f[_0x7642('0x3d')],null))['then'](respondWithResult(_0x160c10,null))['catch'](handleError(_0x160c10,null));};exports['destroy']=function(_0xc5edf3,_0x22ed74){return db[_0x7642('0x31')][_0x7642('0x3c')]({'where':{'id':_0xc5edf3[_0x7642('0x3e')]['id']}})[_0x7642('0x29')](handleEntityNotFound(_0x22ed74,null))[_0x7642('0x29')](removeEntity(_0x22ed74,null))[_0x7642('0x3f')](handleError(_0x22ed74,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 27b412b..0b4ce37 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 _0xef28=['./chatApplication.attributes','define','ChatApplication','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xef28,0x71));var _0x8ef2=function(_0xf7077d,_0x309ea1){_0xf7077d=_0xf7077d-0x0;var _0x19ff53=_0xef28[_0xf7077d];return _0x19ff53;};'use strict';var _=require(_0x8ef2('0x0'));var util=require(_0x8ef2('0x1'));var logger=require(_0x8ef2('0x2'))(_0x8ef2('0x3'));var moment=require(_0x8ef2('0x4'));var BPromise=require(_0x8ef2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ef2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ef2('0x7'));module['exports']=function(_0x354662,_0x61b5ee){return _0x354662[_0x8ef2('0x8')](_0x8ef2('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5f96=['exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatApplication.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f96,0x75));var _0x65f9=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x5f96[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x65f9('0x0'));var util=require(_0x65f9('0x1'));var logger=require(_0x65f9('0x2'))(_0x65f9('0x3'));var moment=require(_0x65f9('0x4'));var BPromise=require(_0x65f9('0x5'));var rp=require(_0x65f9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65f9('0x7'));var config=require('../../config/environment');var attributes=require(_0x65f9('0x8'));module[_0x65f9('0x9')]=function(_0x5607f5,_0x41efdb){return _0x5607f5[_0x65f9('0xa')]('ChatApplication',attributes,{'tableName':_0x65f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x65f9('0xc'),'collate':_0x65f9('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 813f9bf..b5e2927 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 _0xbfbb=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xbfbb,0x1d7));var _0xbbfb=function(_0x43fbdb,_0x2bfc6e){_0x43fbdb=_0x43fbdb-0x0;var _0x3b6ab8=_0xbfbb[_0x43fbdb];return _0x3b6ab8;};'use strict';var _=require(_0xbbfb('0x0'));var util=require(_0xbbfb('0x1'));var moment=require('moment');var BPromise=require(_0xbbfb('0x2'));var rs=require(_0xbbfb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbfb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbfb('0x5'))(_0xbbfb('0x6'));var config=require(_0xbbfb('0x7'));var jayson=require(_0xbbfb('0x8'));var client=jayson[_0xbbfb('0x9')][_0xbbfb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38f91a,_0x329b85,_0x30bd77){return new BPromise(function(_0x4e8da5,_0x233431){return client['request'](_0x38f91a,_0x30bd77)[_0xbbfb('0xb')](function(_0x26c49e){logger['info'](_0xbbfb('0xc'),_0x329b85,_0xbbfb('0xd'));logger[_0xbbfb('0xe')](_0xbbfb('0xf'),_0x329b85,_0xbbfb('0xd'),JSON[_0xbbfb('0x10')](_0x26c49e));if(_0x26c49e[_0xbbfb('0x11')]){if(_0x26c49e['error']['code']===0x1f4){logger['error'](_0xbbfb('0xc'),_0x329b85,_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);return _0x233431(_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);}logger[_0xbbfb('0x11')](_0xbbfb('0xc'),_0x329b85,_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);return _0x4e8da5(_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);}else{logger['info'](_0xbbfb('0xc'),_0x329b85,_0xbbfb('0xd'));_0x4e8da5(_0x26c49e[_0xbbfb('0x13')][_0xbbfb('0x12')]);}})[_0xbbfb('0x14')](function(_0x54a1f8){logger[_0xbbfb('0x11')](_0xbbfb('0xc'),_0x329b85,_0x54a1f8);_0x233431(_0x54a1f8);});});}
\ No newline at end of file
+var _0x968c=['client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2a43b9,_0x2aa7ea){var _0x3b6c90=function(_0x5be37f){while(--_0x5be37f){_0x2a43b9['push'](_0x2a43b9['shift']());}};_0x3b6c90(++_0x2aa7ea);}(_0x968c,0xc4));var _0xc968=function(_0x474b54,_0x4bc155){_0x474b54=_0x474b54-0x0;var _0x508117=_0x968c[_0x474b54];return _0x508117;};'use strict';var _=require(_0xc968('0x0'));var util=require(_0xc968('0x1'));var moment=require(_0xc968('0x2'));var BPromise=require(_0xc968('0x3'));var rs=require(_0xc968('0x4'));var fs=require('fs');var Redis=require(_0xc968('0x5'));var db=require(_0xc968('0x6'))['db'];var utils=require(_0xc968('0x7'));var logger=require(_0xc968('0x8'))(_0xc968('0x9'));var config=require(_0xc968('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc968('0xb')][_0xc968('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x421ac8,_0x2b0b22,_0x3b6da1){return new BPromise(function(_0x4b1eb8,_0x2e4c89){return client['request'](_0x421ac8,_0x3b6da1)[_0xc968('0xd')](function(_0x2e17b5){logger[_0xc968('0xe')](_0xc968('0xf'),_0x2b0b22,_0xc968('0x10'));logger['debug'](_0xc968('0x11'),_0x2b0b22,_0xc968('0x10'),JSON[_0xc968('0x12')](_0x2e17b5));if(_0x2e17b5[_0xc968('0x13')]){if(_0x2e17b5[_0xc968('0x13')]['code']===0x1f4){logger['error'](_0xc968('0xf'),_0x2b0b22,_0x2e17b5[_0xc968('0x13')]['message']);return _0x2e4c89(_0x2e17b5[_0xc968('0x13')][_0xc968('0x14')]);}logger['error'](_0xc968('0xf'),_0x2b0b22,_0x2e17b5['error'][_0xc968('0x14')]);return _0x4b1eb8(_0x2e17b5[_0xc968('0x13')][_0xc968('0x14')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x2b0b22,_0xc968('0x10'));_0x4b1eb8(_0x2e17b5[_0xc968('0x15')][_0xc968('0x14')]);}})[_0xc968('0x16')](function(_0x25cf93){logger[_0xc968('0x13')](_0xc968('0xf'),_0x2b0b22,_0x25cf93);_0x2e4c89(_0x25cf93);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index a04092f..3a0e223 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 _0x871d=['exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x541cf4,_0x38ea3c){var _0x2093ec=function(_0x5bd8d7){while(--_0x5bd8d7){_0x541cf4['push'](_0x541cf4['shift']());}};_0x2093ec(++_0x38ea3c);}(_0x871d,0x187));var _0xd871=function(_0x38f771,_0x4587dd){_0x38f771=_0x38f771-0x0;var _0x2c562c=_0x871d[_0x38f771];return _0x2c562c;};'use strict';var multer=require(_0xd871('0x0'));var util=require('util');var path=require(_0xd871('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd871('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd871('0x3'));var interaction=require(_0xd871('0x4'));var config=require(_0xd871('0x5'));var controller=require('./chatApplication.controller');router[_0xd871('0x6')]('/:id',auth[_0xd871('0x7')](),controller[_0xd871('0x8')]);router[_0xd871('0x9')](_0xd871('0xa'),auth[_0xd871('0x7')](),controller[_0xd871('0xb')]);router[_0xd871('0xc')](_0xd871('0xa'),auth[_0xd871('0x7')](),controller[_0xd871('0xd')]);module[_0xd871('0xe')]=router;
\ No newline at end of file
+var _0xa912=['multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x388722,_0x25f54f){var _0x310adb=function(_0x554898){while(--_0x554898){_0x388722['push'](_0x388722['shift']());}};_0x310adb(++_0x25f54f);}(_0xa912,0x1dc));var _0x2a91=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xa912[_0x5a776b];return _0xbbef59;};'use strict';var multer=require(_0x2a91('0x0'));var util=require(_0x2a91('0x1'));var path=require(_0x2a91('0x2'));var timeout=require(_0x2a91('0x3'));var express=require(_0x2a91('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2a91('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2a91('0x6'));var controller=require(_0x2a91('0x7'));router['get'](_0x2a91('0x8'),auth[_0x2a91('0x9')](),controller['show']);router['put'](_0x2a91('0x8'),auth[_0x2a91('0x9')](),controller[_0x2a91('0xa')]);router[_0x2a91('0xb')](_0x2a91('0x8'),auth[_0x2a91('0x9')](),controller[_0x2a91('0xc')]);module[_0x2a91('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 96c2647..14930de 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 _0x2542=['STRING','sequelize','exports'];(function(_0x199bdf,_0x3daaf6){var _0x287fdc=function(_0x36b976){while(--_0x36b976){_0x199bdf['push'](_0x199bdf['shift']());}};_0x287fdc(++_0x3daaf6);}(_0x2542,0x169));var _0x2254=function(_0x10353c,_0x162dac){_0x10353c=_0x10353c-0x0;var _0x20300e=_0x2542[_0x10353c];return _0x20300e;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2254('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0094=['BOOLEAN','STRING'];(function(_0xb2ca31,_0x1afb56){var _0x127594=function(_0x30c294){while(--_0x30c294){_0xb2ca31['push'](_0xb2ca31['shift']());}};_0x127594(++_0x1afb56);}(_0x0094,0x161));var _0x4009=function(_0xddecf0,_0x45e0d4){_0xddecf0=_0xddecf0-0x0;var _0x3b23ed=_0x0094[_0xddecf0];return _0x3b23ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4009('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4009('0x0')]},'write':{'type':Sequelize[_0x4009('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index c06e754..f536ade 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 _0x25b4=['VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','save','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where'];(function(_0x350bd9,_0x7ee684){var _0x460756=function(_0x564516){while(--_0x564516){_0x350bd9['push'](_0x350bd9['shift']());}};_0x460756(++_0x7ee684);}(_0x25b4,0xe0));var _0x425b=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0x25b4[_0x3c59fc];return _0x2b78d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x425b('0x0'));var zipdir=require(_0x425b('0x1'));var jsonpatch=require(_0x425b('0x2'));var rp=require(_0x425b('0x3'));var moment=require('moment');var BPromise=require(_0x425b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x425b('0x5'));var sox=require(_0x425b('0x6'));var csv=require(_0x425b('0x7'));var ejs=require(_0x425b('0x8'));var fs=require('fs');var fs_extra=require(_0x425b('0x9'));var _=require(_0x425b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x425b('0xb'));var deskjs=require(_0x425b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x425b('0xd'));var Papa=require(_0x425b('0xe'));var Redis=require(_0x425b('0xf'));var authService=require(_0x425b('0x10'));var qs=require(_0x425b('0x11'));var as=require(_0x425b('0x12'));var hardwareService=require(_0x425b('0x13'));var logger=require(_0x425b('0x14'))('api');var utils=require(_0x425b('0x15'));var config=require(_0x425b('0x16'));var licenseUtil=require(_0x425b('0x17'));var db=require(_0x425b('0x18'))['db'];config[_0x425b('0x19')]=_[_0x425b('0x1a')](config[_0x425b('0x19')],{'host':_0x425b('0x1b'),'port':0x18eb});var socket=require(_0x425b('0x1c'))(new Redis(config[_0x425b('0x19')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3fec83,_0x3b811a){_0x3b811a=_0x3b811a||0xcc;return function(_0x1d020d){if(_0x1d020d){return _0x3fec83['sendStatus'](_0x3b811a);}return _0x3fec83[_0x425b('0x1d')](_0x3b811a)[_0x425b('0x1e')]();};}function respondWithResult(_0xc83b96,_0x56a434){_0x56a434=_0x56a434||0xc8;return function(_0xf237a9){if(_0xf237a9){return _0xc83b96['status'](_0x56a434)[_0x425b('0x1f')](_0xf237a9);}};}function respondWithFilteredResult(_0x15c07f,_0x37c80d){return function(_0x46d1dc){if(_0x46d1dc){var _0x3f81b4=typeof _0x37c80d['offset']===_0x425b('0x20')&&typeof _0x37c80d[_0x425b('0x21')]===_0x425b('0x20');var _0x403b58=_0x46d1dc[_0x425b('0x22')];var _0x1f993c=_0x3f81b4?0x0:_0x37c80d[_0x425b('0x23')];var _0xa6008b=_0x3f81b4?_0x46d1dc['count']:_0x37c80d['offset']+_0x37c80d[_0x425b('0x21')];var _0x124784;if(_0xa6008b>=_0x403b58){_0xa6008b=_0x403b58;_0x124784=0xc8;}else{_0x124784=0xce;}_0x15c07f[_0x425b('0x1d')](_0x124784);return _0x15c07f[_0x425b('0x24')]('Content-Range',_0x1f993c+'-'+_0xa6008b+'/'+_0x403b58)[_0x425b('0x1f')](_0x46d1dc);}return null;};}function patchUpdates(_0x2efef0){return function(_0x3745dd){try{jsonpatch['apply'](_0x3745dd,_0x2efef0,!![]);}catch(_0x43d2a9){return BPromise['reject'](_0x43d2a9);}return _0x3745dd[_0x425b('0x25')]();};}function saveUpdates(_0x5842e9,_0x13ff96){return function(_0xceaeed){if(_0xceaeed){return _0xceaeed['update'](_0x5842e9)[_0x425b('0x26')](function(_0x559a24){return _0x559a24;});}return null;};}function removeEntity(_0x4656f2,_0x33d8b8){return function(_0x35cdcd){if(_0x35cdcd){return _0x35cdcd[_0x425b('0x27')]()[_0x425b('0x26')](function(){_0x4656f2[_0x425b('0x1d')](0xcc)[_0x425b('0x1e')]();});}};}function handleEntityNotFound(_0xab8ad0,_0xeb0120){return function(_0x420e4d){if(!_0x420e4d){_0xab8ad0[_0x425b('0x28')](0x194);}return _0x420e4d;};}function handleError(_0x393296,_0x20ae70){_0x20ae70=_0x20ae70||0x1f4;return function(_0x5cd58b){logger[_0x425b('0x29')](_0x5cd58b[_0x425b('0x2a')]);if(_0x5cd58b[_0x425b('0x2b')]){delete _0x5cd58b[_0x425b('0x2b')];}_0x393296[_0x425b('0x1d')](_0x20ae70)[_0x425b('0x2c')](_0x5cd58b);};}exports[_0x425b('0x2d')]=function(_0xdd2906,_0x3b1c03){var _0x1f53f1={},_0x5bb1d1={},_0x511697={'count':0x0,'rows':[]};var _0x3bc1df=_[_0x425b('0x2e')](db[_0x425b('0x2f')][_0x425b('0x30')],function(_0x511020){return{'name':_0x511020['fieldName'],'type':_0x511020[_0x425b('0x31')][_0x425b('0x32')]};});_0x5bb1d1['model']=_[_0x425b('0x2e')](_0x3bc1df,_0x425b('0x2b'));_0x5bb1d1['query']=_[_0x425b('0x33')](_0xdd2906[_0x425b('0x34')]);_0x5bb1d1[_0x425b('0x35')]=_[_0x425b('0x36')](_0x5bb1d1[_0x425b('0x37')],_0x5bb1d1[_0x425b('0x34')]);_0x1f53f1[_0x425b('0x38')]=_[_0x425b('0x36')](_0x5bb1d1[_0x425b('0x37')],qs[_0x425b('0x39')](_0xdd2906[_0x425b('0x34')][_0x425b('0x39')]));_0x1f53f1[_0x425b('0x38')]=_0x1f53f1[_0x425b('0x38')][_0x425b('0x3a')]?_0x1f53f1[_0x425b('0x38')]:_0x5bb1d1[_0x425b('0x37')];if(!_0xdd2906[_0x425b('0x34')][_0x425b('0x3b')]('nolimit')){_0x1f53f1['limit']=qs[_0x425b('0x21')](_0xdd2906[_0x425b('0x34')]['limit']);_0x1f53f1[_0x425b('0x23')]=qs['offset'](_0xdd2906[_0x425b('0x34')][_0x425b('0x23')]);}_0x1f53f1[_0x425b('0x3c')]=qs['sort'](_0xdd2906[_0x425b('0x34')][_0x425b('0x3d')]);_0x1f53f1['where']=qs[_0x425b('0x35')](_['pick'](_0xdd2906['query'],_0x5bb1d1[_0x425b('0x35')]),_0x3bc1df);if(_0xdd2906['query'][_0x425b('0x3e')]){_0x1f53f1[_0x425b('0x3f')]=_['merge'](_0x1f53f1[_0x425b('0x3f')],{'$or':_['map'](_0x3bc1df,function(_0x358e45){if(_0x358e45[_0x425b('0x31')]!==_0x425b('0x40')){var _0x24fbfa={};_0x24fbfa[_0x358e45[_0x425b('0x2b')]]={'$like':'%'+_0xdd2906['query'][_0x425b('0x3e')]+'%'};return _0x24fbfa;}})});}_0x1f53f1=_[_0x425b('0x41')]({},_0x1f53f1,_0xdd2906[_0x425b('0x42')]);var _0x52d478={'where':_0x1f53f1['where']};return db[_0x425b('0x2f')]['count'](_0x52d478)['then'](function(_0x4419c6){_0x511697['count']=_0x4419c6;if(_0xdd2906[_0x425b('0x34')][_0x425b('0x43')]){_0x1f53f1[_0x425b('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x425b('0x45')](_0x1f53f1);})['then'](function(_0x8798fe){_0x511697[_0x425b('0x46')]=_0x8798fe;return _0x511697;})[_0x425b('0x26')](respondWithFilteredResult(_0x3b1c03,_0x1f53f1))[_0x425b('0x47')](handleError(_0x3b1c03,null));};exports[_0x425b('0x48')]=function(_0x4e9e91,_0x21bdfd){var _0x2cb9e3={'raw':!![],'where':{'id':_0x4e9e91['params']['id']}},_0x3ca7e8={};_0x3ca7e8[_0x425b('0x37')]=_[_0x425b('0x33')](db[_0x425b('0x2f')][_0x425b('0x30')]);_0x3ca7e8[_0x425b('0x34')]=_[_0x425b('0x33')](_0x4e9e91[_0x425b('0x34')]);_0x3ca7e8[_0x425b('0x35')]=_[_0x425b('0x36')](_0x3ca7e8['model'],_0x3ca7e8[_0x425b('0x34')]);_0x2cb9e3['attributes']=_[_0x425b('0x36')](_0x3ca7e8[_0x425b('0x37')],qs['fields'](_0x4e9e91[_0x425b('0x34')][_0x425b('0x39')]));_0x2cb9e3[_0x425b('0x38')]=_0x2cb9e3[_0x425b('0x38')][_0x425b('0x3a')]?_0x2cb9e3[_0x425b('0x38')]:_0x3ca7e8[_0x425b('0x37')];if(_0x4e9e91[_0x425b('0x34')][_0x425b('0x43')]){_0x2cb9e3[_0x425b('0x44')]=[{'all':!![]}];}_0x2cb9e3=_[_0x425b('0x41')]({},_0x2cb9e3,_0x4e9e91['options']);return db['ChatGroup'][_0x425b('0x49')](_0x2cb9e3)[_0x425b('0x26')](handleEntityNotFound(_0x21bdfd,null))['then'](respondWithResult(_0x21bdfd,null))['catch'](handleError(_0x21bdfd,null));};exports[_0x425b('0x4a')]=function(_0x3a9b70,_0x34ad34){return db[_0x425b('0x2f')][_0x425b('0x4a')](_0x3a9b70[_0x425b('0x4b')],{})['then'](respondWithResult(_0x34ad34,0xc9))[_0x425b('0x47')](handleError(_0x34ad34,null));};exports['update']=function(_0x1e9cc1,_0x347674){if(_0x1e9cc1['body']['id']){delete _0x1e9cc1[_0x425b('0x4b')]['id'];}return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x1e9cc1[_0x425b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x347674,null))['then'](saveUpdates(_0x1e9cc1['body'],null))[_0x425b('0x26')](respondWithResult(_0x347674,null))[_0x425b('0x47')](handleError(_0x347674,null));};exports[_0x425b('0x27')]=function(_0x58391b,_0x48859d){return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x58391b[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x48859d,null))[_0x425b('0x26')](removeEntity(_0x48859d,null))[_0x425b('0x47')](handleError(_0x48859d,null));};exports[_0x425b('0x4d')]=function(_0x45693d,_0x586842){return db[_0x425b('0x2f')][_0x425b('0x4d')]()[_0x425b('0x26')](respondWithResult(_0x586842,null))['catch'](handleError(_0x586842,null));};exports[_0x425b('0x4e')]=function(_0x183e3a,_0x4348fe,_0x30fc77){return db[_0x425b('0x4f')][_0x425b('0x22')]({'where':{'ChatGroupId':_0x183e3a[_0x425b('0x4c')]['id'],'ToId':_0x183e3a[_0x425b('0x50')]['id'],'read':![]}})[_0x425b('0x26')](function(_0x1a9ad9){return{'id':_[_0x425b('0x51')](_0x183e3a[_0x425b('0x4c')]['id']),'count':_0x1a9ad9};})[_0x425b('0x26')](respondWithResult(_0x4348fe,null))[_0x425b('0x47')](handleError(_0x4348fe,null));};exports[_0x425b('0x52')]=function(_0x79075c,_0x296982,_0x5ac032){return db[_0x425b('0x2f')]['find']({'where':{'id':_0x79075c[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x296982,null))[_0x425b('0x26')](function(_0x1d2b8a){if(_0x1d2b8a){return _0x1d2b8a[_0x425b('0x52')](_0x79075c[_0x425b('0x4b')][_0x425b('0x53')],_['omit'](_0x79075c['body'],[_0x425b('0x53'),'id'])||{});}})[_0x425b('0x26')](respondWithResult(_0x296982,null))[_0x425b('0x47')](handleError(_0x296982,null));};exports[_0x425b('0x54')]=function(_0x42d8d6,_0x49dfbb,_0x201a41){var _0x141759={};var _0x537148={};var _0xacc558;var _0x5e0837;return db[_0x425b('0x2f')][_0x425b('0x55')]({'where':{'id':_0x42d8d6[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x49dfbb,null))[_0x425b('0x26')](function(_0x365e79){if(_0x365e79){_0xacc558=_0x365e79;_0x537148['model']=_[_0x425b('0x33')](db[_0x425b('0x56')][_0x425b('0x30')]);_0x537148[_0x425b('0x34')]=_[_0x425b('0x33')](_0x42d8d6[_0x425b('0x34')]);_0x537148[_0x425b('0x35')]=_[_0x425b('0x36')](_0x537148[_0x425b('0x37')],_0x537148[_0x425b('0x34')]);_0x141759[_0x425b('0x38')]=_[_0x425b('0x36')](_0x537148[_0x425b('0x37')],qs[_0x425b('0x39')](_0x42d8d6['query'][_0x425b('0x39')]));_0x141759[_0x425b('0x38')]=_0x141759[_0x425b('0x38')][_0x425b('0x3a')]?_0x141759[_0x425b('0x38')]:_0x537148['model'];_0x141759['order']=qs[_0x425b('0x3d')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x3d')]);_0x141759[_0x425b('0x3f')]=qs[_0x425b('0x35')](_['pick'](_0x42d8d6[_0x425b('0x34')],_0x537148[_0x425b('0x35')]));if(_0x42d8d6[_0x425b('0x34')][_0x425b('0x3e')]){_0x141759['where']=_['merge'](_0x141759['where'],{'$or':_['map'](_0x141759[_0x425b('0x38')],function(_0x37addc){var _0x1e6193={};_0x1e6193[_0x37addc]={'$like':'%'+_0x42d8d6[_0x425b('0x34')][_0x425b('0x3e')]+'%'};return _0x1e6193;})});}_0x141759=_['merge']({},_0x141759,_0x42d8d6['options']);return _0xacc558[_0x425b('0x54')](_0x141759);}})['then'](function(_0x16a93b){if(_0x16a93b){_0x5e0837=_0x16a93b[_0x425b('0x3a')];if(!_0x42d8d6[_0x425b('0x34')][_0x425b('0x3b')](_0x425b('0x57'))){_0x141759[_0x425b('0x21')]=qs[_0x425b('0x21')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x21')]);_0x141759[_0x425b('0x23')]=qs[_0x425b('0x23')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x23')]);}return _0xacc558[_0x425b('0x54')](_0x141759);}})[_0x425b('0x26')](function(_0x4113d5){if(_0x4113d5){return _0x4113d5?{'count':_0x5e0837,'rows':_0x4113d5}:null;}})[_0x425b('0x26')](respondWithResult(_0x49dfbb,null))[_0x425b('0x47')](handleError(_0x49dfbb,null));};exports[_0x425b('0x58')]=function(_0x37d50e,_0x515060,_0x1ff2db){return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x37d50e[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x515060,null))['then'](function(_0x25fd63){if(_0x25fd63){return _0x25fd63[_0x425b('0x58')](_0x37d50e['query']['ids']);}})['then'](respondWithStatusCode(_0x515060,null))[_0x425b('0x47')](handleError(_0x515060,null));};exports[_0x425b('0x59')]=function(_0x4e5751,_0x12b617,_0x55dfcc){if(_0x4e5751[_0x425b('0x4b')]['id']){delete _0x4e5751[_0x425b('0x4b')]['id'];}return db['ChatGroup'][_0x425b('0x49')]({'where':{'id':_0x4e5751[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x12b617,null))[_0x425b('0x26')](function(_0x8c7b13){if(_0x8c7b13){_0x4e5751['body'][_0x425b('0x5a')]=_0x8c7b13['id'];return db['ChatInternalMessage'][_0x425b('0x4a')](_0x4e5751[_0x425b('0x4b')]);}})[_0x425b('0x26')](respondWithResult(_0x12b617,null))['catch'](handleError(_0x12b617,null));};exports[_0x425b('0x5b')]=function(_0x9458e0,_0x31ce02,_0x18772c){var _0x122b1f={};var _0xb35965={};var _0x1046e1;var _0x1a019f;return db[_0x425b('0x2f')][_0x425b('0x55')]({'where':{'id':_0x9458e0[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x31ce02,null))[_0x425b('0x26')](function(_0x50efb1){if(_0x50efb1){_0x1046e1=_0x50efb1;_0xb35965['model']=_['keys'](db[_0x425b('0x4f')][_0x425b('0x30')]);_0xb35965[_0x425b('0x34')]=_[_0x425b('0x33')](_0x9458e0[_0x425b('0x34')]);_0xb35965[_0x425b('0x35')]=_[_0x425b('0x36')](_0xb35965['model'],_0xb35965['query']);_0x122b1f['attributes']=_[_0x425b('0x36')](_0xb35965[_0x425b('0x37')],qs[_0x425b('0x39')](_0x9458e0['query']['fields']));_0x122b1f[_0x425b('0x38')]=_0x122b1f[_0x425b('0x38')][_0x425b('0x3a')]?_0x122b1f[_0x425b('0x38')]:_0xb35965[_0x425b('0x37')];_0x122b1f['order']=qs[_0x425b('0x3d')](_0x9458e0['query']['sort']);_0x122b1f[_0x425b('0x3f')]=qs[_0x425b('0x35')](_[_0x425b('0x5c')](_0x9458e0[_0x425b('0x34')],_0xb35965[_0x425b('0x35')]));if(_0x9458e0['query'][_0x425b('0x3e')]){_0x122b1f[_0x425b('0x3f')]=_[_0x425b('0x41')](_0x122b1f[_0x425b('0x3f')],{'$or':_[_0x425b('0x2e')](_0x122b1f['attributes'],function(_0x38f2c4){var _0x4366cb={};_0x4366cb[_0x38f2c4]={'$like':'%'+_0x9458e0[_0x425b('0x34')][_0x425b('0x3e')]+'%'};return _0x4366cb;})});}if(_0x9458e0[_0x425b('0x34')][_0x425b('0x5d')]){var _0x149aa1=_0x9458e0[_0x425b('0x34')][_0x425b('0x5d')]['split'](',');var _0xbcdc45={};_0xbcdc45[_0x149aa1[0x0]]={'$gte':moment(_0x149aa1[0x1])[_0x425b('0x5e')](_0x425b('0x5f'))};_0x122b1f[_0x425b('0x3f')]=_[_0x425b('0x41')](_0x122b1f[_0x425b('0x3f')],_0xbcdc45);}_0x122b1f=_['merge']({},_0x122b1f,_0x9458e0['options']);return _0x1046e1['getMessages'](_0x122b1f);}})['then'](function(_0x1693f4){if(_0x1693f4){_0x1a019f=_0x1693f4[_0x425b('0x3a')];if(!_0x9458e0[_0x425b('0x34')][_0x425b('0x3b')](_0x425b('0x57'))){_0x122b1f[_0x425b('0x21')]=qs[_0x425b('0x21')](_0x9458e0[_0x425b('0x34')][_0x425b('0x21')]);_0x122b1f[_0x425b('0x23')]=qs[_0x425b('0x23')](_0x9458e0[_0x425b('0x34')][_0x425b('0x23')]);}return _0x1046e1[_0x425b('0x5b')](_0x122b1f);}})['then'](function(_0xa01449){if(_0xa01449){return _0xa01449?{'count':_0x1a019f,'rows':_0xa01449}:null;}})[_0x425b('0x26')](respondWithResult(_0x31ce02,null))[_0x425b('0x47')](handleError(_0x31ce02,null));};
\ No newline at end of file
+var _0xc6b0=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','where','VIRTUAL','filter','merge','options','include','rows','catch','params','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','sort','pick','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x2e3846,_0x56ce25){var _0x306412=function(_0x109a1a){while(--_0x109a1a){_0x2e3846['push'](_0x2e3846['shift']());}};_0x306412(++_0x56ce25);}(_0xc6b0,0x16e));var _0x0c6b=function(_0x3c066e,_0x2b83a1){_0x3c066e=_0x3c066e-0x0;var _0x254c12=_0xc6b0[_0x3c066e];return _0x254c12;};'use strict';var emlformat=require(_0x0c6b('0x0'));var rimraf=require(_0x0c6b('0x1'));var zipdir=require(_0x0c6b('0x2'));var jsonpatch=require(_0x0c6b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c6b('0x4'));var Mustache=require(_0x0c6b('0x5'));var util=require(_0x0c6b('0x6'));var path=require(_0x0c6b('0x7'));var sox=require('sox');var csv=require(_0x0c6b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c6b('0x9'));var _=require(_0x0c6b('0xa'));var squel=require('squel');var crypto=require(_0x0c6b('0xb'));var jsforce=require(_0x0c6b('0xc'));var deskjs=require(_0x0c6b('0xd'));var toCsv=require(_0x0c6b('0x8'));var querystring=require('querystring');var Papa=require(_0x0c6b('0xe'));var Redis=require(_0x0c6b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0c6b('0x10'));var as=require(_0x0c6b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c6b('0x12'))(_0x0c6b('0x13'));var utils=require(_0x0c6b('0x14'));var config=require(_0x0c6b('0x15'));var licenseUtil=require(_0x0c6b('0x16'));var db=require(_0x0c6b('0x17'))['db'];config[_0x0c6b('0x18')]=_[_0x0c6b('0x19')](config[_0x0c6b('0x18')],{'host':_0x0c6b('0x1a'),'port':0x18eb});var socket=require(_0x0c6b('0x1b'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x48bd85,_0x2ac34e){_0x2ac34e=_0x2ac34e||0xcc;return function(_0x1da5f9){if(_0x1da5f9){return _0x48bd85[_0x0c6b('0x1c')](_0x2ac34e);}return _0x48bd85['status'](_0x2ac34e)[_0x0c6b('0x1d')]();};}function respondWithResult(_0x379c39,_0x219fe5){_0x219fe5=_0x219fe5||0xc8;return function(_0x3f9bde){if(_0x3f9bde){return _0x379c39[_0x0c6b('0x1e')](_0x219fe5)['json'](_0x3f9bde);}};}function respondWithFilteredResult(_0x57345,_0x43e617){return function(_0x5c520f){if(_0x5c520f){var _0x451b13=typeof _0x43e617[_0x0c6b('0x1f')]===_0x0c6b('0x20')&&typeof _0x43e617[_0x0c6b('0x21')]===_0x0c6b('0x20');var _0x28cfed=_0x5c520f[_0x0c6b('0x22')];var _0x1769dd=_0x451b13?0x0:_0x43e617[_0x0c6b('0x1f')];var _0x305d93=_0x451b13?_0x5c520f['count']:_0x43e617[_0x0c6b('0x1f')]+_0x43e617['limit'];var _0xad2963;if(_0x305d93>=_0x28cfed){_0x305d93=_0x28cfed;_0xad2963=0xc8;}else{_0xad2963=0xce;}_0x57345[_0x0c6b('0x1e')](_0xad2963);return _0x57345['set'](_0x0c6b('0x23'),_0x1769dd+'-'+_0x305d93+'/'+_0x28cfed)[_0x0c6b('0x24')](_0x5c520f);}return null;};}function patchUpdates(_0x45bf56){return function(_0x3ef2ec){try{jsonpatch[_0x0c6b('0x25')](_0x3ef2ec,_0x45bf56,!![]);}catch(_0x1a9c9f){return BPromise[_0x0c6b('0x26')](_0x1a9c9f);}return _0x3ef2ec[_0x0c6b('0x27')]();};}function saveUpdates(_0x540e47,_0x312a1b){return function(_0x541ed0){if(_0x541ed0){return _0x541ed0[_0x0c6b('0x28')](_0x540e47)['then'](function(_0x1f3e9d){return _0x1f3e9d;});}return null;};}function removeEntity(_0x2d27ab,_0x148819){return function(_0x382035){if(_0x382035){return _0x382035[_0x0c6b('0x29')]()[_0x0c6b('0x2a')](function(){_0x2d27ab[_0x0c6b('0x1e')](0xcc)[_0x0c6b('0x1d')]();});}};}function handleEntityNotFound(_0x13acd2,_0x201f82){return function(_0x387262){if(!_0x387262){_0x13acd2[_0x0c6b('0x1c')](0x194);}return _0x387262;};}function handleError(_0x2f5a02,_0x9bd759){_0x9bd759=_0x9bd759||0x1f4;return function(_0x309f9b){logger['error'](_0x309f9b['stack']);if(_0x309f9b[_0x0c6b('0x2b')]){delete _0x309f9b['name'];}_0x2f5a02[_0x0c6b('0x1e')](_0x9bd759)[_0x0c6b('0x2c')](_0x309f9b);};}exports[_0x0c6b('0x2d')]=function(_0xd8c88d,_0x2f4574){var _0x31dc9f={},_0x6ba1f9={},_0x339868={'count':0x0,'rows':[]};var _0x581556=_[_0x0c6b('0x2e')](db[_0x0c6b('0x2f')][_0x0c6b('0x30')],function(_0x3ee0b4){return{'name':_0x3ee0b4[_0x0c6b('0x31')],'type':_0x3ee0b4[_0x0c6b('0x32')]['key']};});_0x6ba1f9[_0x0c6b('0x33')]=_[_0x0c6b('0x2e')](_0x581556,'name');_0x6ba1f9['query']=_[_0x0c6b('0x34')](_0xd8c88d[_0x0c6b('0x35')]);_0x6ba1f9[_0x0c6b('0x36')]=_[_0x0c6b('0x37')](_0x6ba1f9[_0x0c6b('0x33')],_0x6ba1f9['query']);_0x31dc9f['attributes']=_[_0x0c6b('0x37')](_0x6ba1f9[_0x0c6b('0x33')],qs[_0x0c6b('0x38')](_0xd8c88d['query']['fields']));_0x31dc9f['attributes']=_0x31dc9f['attributes'][_0x0c6b('0x39')]?_0x31dc9f[_0x0c6b('0x3a')]:_0x6ba1f9[_0x0c6b('0x33')];if(!_0xd8c88d[_0x0c6b('0x35')][_0x0c6b('0x3b')](_0x0c6b('0x3c'))){_0x31dc9f[_0x0c6b('0x21')]=qs[_0x0c6b('0x21')](_0xd8c88d[_0x0c6b('0x35')]['limit']);_0x31dc9f[_0x0c6b('0x1f')]=qs[_0x0c6b('0x1f')](_0xd8c88d[_0x0c6b('0x35')][_0x0c6b('0x1f')]);}_0x31dc9f[_0x0c6b('0x3d')]=qs['sort'](_0xd8c88d[_0x0c6b('0x35')]['sort']);_0x31dc9f[_0x0c6b('0x3e')]=qs[_0x0c6b('0x36')](_['pick'](_0xd8c88d['query'],_0x6ba1f9['filters']),_0x581556);if(_0xd8c88d[_0x0c6b('0x35')]['filter']){_0x31dc9f[_0x0c6b('0x3e')]=_['merge'](_0x31dc9f[_0x0c6b('0x3e')],{'$or':_[_0x0c6b('0x2e')](_0x581556,function(_0x3c7c39){if(_0x3c7c39['type']!==_0x0c6b('0x3f')){var _0x250f17={};_0x250f17[_0x3c7c39[_0x0c6b('0x2b')]]={'$like':'%'+_0xd8c88d[_0x0c6b('0x35')][_0x0c6b('0x40')]+'%'};return _0x250f17;}})});}_0x31dc9f=_[_0x0c6b('0x41')]({},_0x31dc9f,_0xd8c88d[_0x0c6b('0x42')]);var _0x569595={'where':_0x31dc9f[_0x0c6b('0x3e')]};return db['ChatGroup'][_0x0c6b('0x22')](_0x569595)['then'](function(_0x36b55f){_0x339868[_0x0c6b('0x22')]=_0x36b55f;if(_0xd8c88d['query']['includeAll']){_0x31dc9f[_0x0c6b('0x43')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x31dc9f);})['then'](function(_0xf551d9){_0x339868[_0x0c6b('0x44')]=_0xf551d9;return _0x339868;})[_0x0c6b('0x2a')](respondWithFilteredResult(_0x2f4574,_0x31dc9f))[_0x0c6b('0x45')](handleError(_0x2f4574,null));};exports['show']=function(_0x4deca9,_0x52bcde){var _0x97060c={'raw':!![],'where':{'id':_0x4deca9[_0x0c6b('0x46')]['id']}},_0x580d25={};_0x580d25['model']=_[_0x0c6b('0x34')](db[_0x0c6b('0x2f')][_0x0c6b('0x30')]);_0x580d25['query']=_[_0x0c6b('0x34')](_0x4deca9[_0x0c6b('0x35')]);_0x580d25[_0x0c6b('0x36')]=_[_0x0c6b('0x37')](_0x580d25[_0x0c6b('0x33')],_0x580d25[_0x0c6b('0x35')]);_0x97060c[_0x0c6b('0x3a')]=_[_0x0c6b('0x37')](_0x580d25[_0x0c6b('0x33')],qs['fields'](_0x4deca9[_0x0c6b('0x35')][_0x0c6b('0x38')]));_0x97060c[_0x0c6b('0x3a')]=_0x97060c[_0x0c6b('0x3a')][_0x0c6b('0x39')]?_0x97060c['attributes']:_0x580d25[_0x0c6b('0x33')];if(_0x4deca9[_0x0c6b('0x35')]['includeAll']){_0x97060c['include']=[{'all':!![]}];}_0x97060c=_[_0x0c6b('0x41')]({},_0x97060c,_0x4deca9[_0x0c6b('0x42')]);return db[_0x0c6b('0x2f')]['find'](_0x97060c)[_0x0c6b('0x2a')](handleEntityNotFound(_0x52bcde,null))['then'](respondWithResult(_0x52bcde,null))['catch'](handleError(_0x52bcde,null));};exports[_0x0c6b('0x47')]=function(_0xd15e4a,_0x2cf70a){return db['ChatGroup'][_0x0c6b('0x47')](_0xd15e4a[_0x0c6b('0x48')],{})[_0x0c6b('0x2a')](respondWithResult(_0x2cf70a,0xc9))[_0x0c6b('0x45')](handleError(_0x2cf70a,null));};exports[_0x0c6b('0x28')]=function(_0x377282,_0x2798c2){if(_0x377282['body']['id']){delete _0x377282[_0x0c6b('0x48')]['id'];}return db['ChatGroup'][_0x0c6b('0x49')]({'where':{'id':_0x377282[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0x2798c2,null))[_0x0c6b('0x2a')](saveUpdates(_0x377282[_0x0c6b('0x48')],null))[_0x0c6b('0x2a')](respondWithResult(_0x2798c2,null))[_0x0c6b('0x45')](handleError(_0x2798c2,null));};exports['destroy']=function(_0x1f97a7,_0xa5c991){return db[_0x0c6b('0x2f')][_0x0c6b('0x49')]({'where':{'id':_0x1f97a7['params']['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0xa5c991,null))[_0x0c6b('0x2a')](removeEntity(_0xa5c991,null))[_0x0c6b('0x45')](handleError(_0xa5c991,null));};exports[_0x0c6b('0x4a')]=function(_0x27e3de,_0x30d3c5){return db[_0x0c6b('0x2f')][_0x0c6b('0x4a')]()[_0x0c6b('0x2a')](respondWithResult(_0x30d3c5,null))['catch'](handleError(_0x30d3c5,null));};exports[_0x0c6b('0x4b')]=function(_0x39a1f7,_0xdc4d7c,_0x37157e){return db[_0x0c6b('0x4c')][_0x0c6b('0x22')]({'where':{'ChatGroupId':_0x39a1f7[_0x0c6b('0x46')]['id'],'ToId':_0x39a1f7[_0x0c6b('0x4d')]['id'],'read':![]}})[_0x0c6b('0x2a')](function(_0x487d1b){return{'id':_[_0x0c6b('0x4e')](_0x39a1f7[_0x0c6b('0x46')]['id']),'count':_0x487d1b};})[_0x0c6b('0x2a')](respondWithResult(_0xdc4d7c,null))[_0x0c6b('0x45')](handleError(_0xdc4d7c,null));};exports[_0x0c6b('0x4f')]=function(_0x54ffdd,_0x2e0f1b,_0x4a7203){return db[_0x0c6b('0x2f')]['find']({'where':{'id':_0x54ffdd[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0x2e0f1b,null))[_0x0c6b('0x2a')](function(_0x11a848){if(_0x11a848){return _0x11a848[_0x0c6b('0x4f')](_0x54ffdd['body'][_0x0c6b('0x50')],_[_0x0c6b('0x51')](_0x54ffdd[_0x0c6b('0x48')],[_0x0c6b('0x50'),'id'])||{});}})['then'](respondWithResult(_0x2e0f1b,null))[_0x0c6b('0x45')](handleError(_0x2e0f1b,null));};exports[_0x0c6b('0x52')]=function(_0x3c095e,_0x482ed3,_0x740bcf){var _0x381105={};var _0x31c674={};var _0x210d2d;var _0x5d92d8;return db[_0x0c6b('0x2f')][_0x0c6b('0x53')]({'where':{'id':_0x3c095e[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0x482ed3,null))[_0x0c6b('0x2a')](function(_0x1f88d0){if(_0x1f88d0){_0x210d2d=_0x1f88d0;_0x31c674[_0x0c6b('0x33')]=_[_0x0c6b('0x34')](db[_0x0c6b('0x54')]['rawAttributes']);_0x31c674[_0x0c6b('0x35')]=_[_0x0c6b('0x34')](_0x3c095e[_0x0c6b('0x35')]);_0x31c674[_0x0c6b('0x36')]=_[_0x0c6b('0x37')](_0x31c674[_0x0c6b('0x33')],_0x31c674[_0x0c6b('0x35')]);_0x381105[_0x0c6b('0x3a')]=_[_0x0c6b('0x37')](_0x31c674[_0x0c6b('0x33')],qs[_0x0c6b('0x38')](_0x3c095e[_0x0c6b('0x35')]['fields']));_0x381105[_0x0c6b('0x3a')]=_0x381105[_0x0c6b('0x3a')][_0x0c6b('0x39')]?_0x381105['attributes']:_0x31c674[_0x0c6b('0x33')];_0x381105['order']=qs[_0x0c6b('0x55')](_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x55')]);_0x381105[_0x0c6b('0x3e')]=qs[_0x0c6b('0x36')](_[_0x0c6b('0x56')](_0x3c095e[_0x0c6b('0x35')],_0x31c674[_0x0c6b('0x36')]));if(_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x40')]){_0x381105[_0x0c6b('0x3e')]=_[_0x0c6b('0x41')](_0x381105[_0x0c6b('0x3e')],{'$or':_[_0x0c6b('0x2e')](_0x381105[_0x0c6b('0x3a')],function(_0x166406){var _0x18f161={};_0x18f161[_0x166406]={'$like':'%'+_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x40')]+'%'};return _0x18f161;})});}_0x381105=_['merge']({},_0x381105,_0x3c095e[_0x0c6b('0x42')]);return _0x210d2d[_0x0c6b('0x52')](_0x381105);}})['then'](function(_0x278a82){if(_0x278a82){_0x5d92d8=_0x278a82[_0x0c6b('0x39')];if(!_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x3b')]('nolimit')){_0x381105[_0x0c6b('0x21')]=qs[_0x0c6b('0x21')](_0x3c095e[_0x0c6b('0x35')][_0x0c6b('0x21')]);_0x381105['offset']=qs[_0x0c6b('0x1f')](_0x3c095e[_0x0c6b('0x35')]['offset']);}return _0x210d2d[_0x0c6b('0x52')](_0x381105);}})[_0x0c6b('0x2a')](function(_0x31bfb5){if(_0x31bfb5){return _0x31bfb5?{'count':_0x5d92d8,'rows':_0x31bfb5}:null;}})[_0x0c6b('0x2a')](respondWithResult(_0x482ed3,null))[_0x0c6b('0x45')](handleError(_0x482ed3,null));};exports[_0x0c6b('0x57')]=function(_0x4329ac,_0x559d41,_0x4f887c){return db['ChatGroup']['find']({'where':{'id':_0x4329ac['params']['id']}})['then'](handleEntityNotFound(_0x559d41,null))[_0x0c6b('0x2a')](function(_0xe86b7){if(_0xe86b7){return _0xe86b7[_0x0c6b('0x57')](_0x4329ac[_0x0c6b('0x35')][_0x0c6b('0x50')]);}})[_0x0c6b('0x2a')](respondWithStatusCode(_0x559d41,null))['catch'](handleError(_0x559d41,null));};exports[_0x0c6b('0x58')]=function(_0x5de701,_0xc071a3,_0x28342c){if(_0x5de701[_0x0c6b('0x48')]['id']){delete _0x5de701[_0x0c6b('0x48')]['id'];}return db[_0x0c6b('0x2f')][_0x0c6b('0x49')]({'where':{'id':_0x5de701[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0xc071a3,null))[_0x0c6b('0x2a')](function(_0x547e4d){if(_0x547e4d){_0x5de701['body'][_0x0c6b('0x59')]=_0x547e4d['id'];return db[_0x0c6b('0x4c')][_0x0c6b('0x47')](_0x5de701[_0x0c6b('0x48')]);}})[_0x0c6b('0x2a')](respondWithResult(_0xc071a3,null))[_0x0c6b('0x45')](handleError(_0xc071a3,null));};exports['getMessages']=function(_0x1ddf8b,_0x4bd9e6,_0x1bf422){var _0x1f760c={};var _0x399416={};var _0x4b9d3c;var _0x24734f;return db[_0x0c6b('0x2f')][_0x0c6b('0x53')]({'where':{'id':_0x1ddf8b[_0x0c6b('0x46')]['id']}})[_0x0c6b('0x2a')](handleEntityNotFound(_0x4bd9e6,null))[_0x0c6b('0x2a')](function(_0xbe6e24){if(_0xbe6e24){_0x4b9d3c=_0xbe6e24;_0x399416['model']=_[_0x0c6b('0x34')](db[_0x0c6b('0x4c')][_0x0c6b('0x30')]);_0x399416[_0x0c6b('0x35')]=_[_0x0c6b('0x34')](_0x1ddf8b['query']);_0x399416['filters']=_[_0x0c6b('0x37')](_0x399416[_0x0c6b('0x33')],_0x399416[_0x0c6b('0x35')]);_0x1f760c[_0x0c6b('0x3a')]=_[_0x0c6b('0x37')](_0x399416[_0x0c6b('0x33')],qs[_0x0c6b('0x38')](_0x1ddf8b['query'][_0x0c6b('0x38')]));_0x1f760c[_0x0c6b('0x3a')]=_0x1f760c[_0x0c6b('0x3a')][_0x0c6b('0x39')]?_0x1f760c[_0x0c6b('0x3a')]:_0x399416[_0x0c6b('0x33')];_0x1f760c[_0x0c6b('0x3d')]=qs[_0x0c6b('0x55')](_0x1ddf8b[_0x0c6b('0x35')][_0x0c6b('0x55')]);_0x1f760c[_0x0c6b('0x3e')]=qs[_0x0c6b('0x36')](_[_0x0c6b('0x56')](_0x1ddf8b[_0x0c6b('0x35')],_0x399416[_0x0c6b('0x36')]));if(_0x1ddf8b[_0x0c6b('0x35')][_0x0c6b('0x40')]){_0x1f760c['where']=_[_0x0c6b('0x41')](_0x1f760c['where'],{'$or':_[_0x0c6b('0x2e')](_0x1f760c[_0x0c6b('0x3a')],function(_0x22016f){var _0x17d701={};_0x17d701[_0x22016f]={'$like':'%'+_0x1ddf8b[_0x0c6b('0x35')][_0x0c6b('0x40')]+'%'};return _0x17d701;})});}if(_0x1ddf8b[_0x0c6b('0x35')]['$gte']){var _0x46f719=_0x1ddf8b['query'][_0x0c6b('0x5a')][_0x0c6b('0x5b')](',');var _0x37fc7c={};_0x37fc7c[_0x46f719[0x0]]={'$gte':moment(_0x46f719[0x1])[_0x0c6b('0x5c')](_0x0c6b('0x5d'))};_0x1f760c[_0x0c6b('0x3e')]=_[_0x0c6b('0x41')](_0x1f760c[_0x0c6b('0x3e')],_0x37fc7c);}_0x1f760c=_[_0x0c6b('0x41')]({},_0x1f760c,_0x1ddf8b[_0x0c6b('0x42')]);return _0x4b9d3c[_0x0c6b('0x5e')](_0x1f760c);}})[_0x0c6b('0x2a')](function(_0x47cf88){if(_0x47cf88){_0x24734f=_0x47cf88[_0x0c6b('0x39')];if(!_0x1ddf8b[_0x0c6b('0x35')][_0x0c6b('0x3b')](_0x0c6b('0x3c'))){_0x1f760c[_0x0c6b('0x21')]=qs[_0x0c6b('0x21')](_0x1ddf8b['query'][_0x0c6b('0x21')]);_0x1f760c['offset']=qs[_0x0c6b('0x1f')](_0x1ddf8b[_0x0c6b('0x35')]['offset']);}return _0x4b9d3c[_0x0c6b('0x5e')](_0x1f760c);}})[_0x0c6b('0x2a')](function(_0x4fa685){if(_0x4fa685){return _0x4fa685?{'count':_0x24734f,'rows':_0x4fa685}:null;}})[_0x0c6b('0x2a')](respondWithResult(_0x4bd9e6,null))[_0x0c6b('0x45')](handleError(_0x4bd9e6,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index debfc6a..e32b4e2 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 _0xfdb5=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xfdb5,0x18f));var _0x5fdb=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xfdb5[_0x12fc8d];return _0x3f9d04;};'use strict';var EventEmitter=require(_0x5fdb('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x5fdb('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5fdb('0x2')](0x0);var events={'afterCreate':_0x5fdb('0x3'),'afterUpdate':_0x5fdb('0x4'),'afterDestroy':_0x5fdb('0x5')};function emitEvent(_0x379f9b){return function(_0x24cbe7,_0x334e53,_0x5f3fc6){ChatGroupEvents[_0x5fdb('0x6')](_0x379f9b+':'+_0x24cbe7['id'],_0x24cbe7);ChatGroupEvents['emit'](_0x379f9b,_0x24cbe7);_0x5f3fc6(null);};}for(var e in events){if(events[_0x5fdb('0x7')](e)){var event=events[e];ChatGroup[_0x5fdb('0x8')](e,emitEvent(event));}}module[_0x5fdb('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x5659=['emit','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x37540c,_0x3315b6){var _0x503546=function(_0x1c2560){while(--_0x1c2560){_0x37540c['push'](_0x37540c['shift']());}};_0x503546(++_0x3315b6);}(_0x5659,0x168));var _0x9565=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x5659[_0x3ba422];return _0x20b5dd;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x9565('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9565('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9565('0x2'),'afterDestroy':_0x9565('0x3')};function emitEvent(_0x502cd9){return function(_0xda6bac,_0x46e5c8,_0x30bd31){ChatGroupEvents['emit'](_0x502cd9+':'+_0xda6bac['id'],_0xda6bac);ChatGroupEvents[_0x9565('0x4')](_0x502cd9,_0xda6bac);_0x30bd31(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x9565('0x5')](e,emitEvent(event));}}module[_0x9565('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index f391bab..0790ec2 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 _0x7d89=['request-promise','path','../../config/environment','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x331052,_0x1bec7a){var _0x409de2=function(_0x305528){while(--_0x305528){_0x331052['push'](_0x331052['shift']());}};_0x409de2(++_0x1bec7a);}(_0x7d89,0x126));var _0x97d8=function(_0x2f1a48,_0x1fd155){_0x2f1a48=_0x2f1a48-0x0;var _0x4ff0b5=_0x7d89[_0x2f1a48];return _0x4ff0b5;};'use strict';var _=require(_0x97d8('0x0'));var util=require(_0x97d8('0x1'));var logger=require(_0x97d8('0x2'))(_0x97d8('0x3'));var moment=require(_0x97d8('0x4'));var BPromise=require(_0x97d8('0x5'));var rp=require(_0x97d8('0x6'));var fs=require('fs');var path=require(_0x97d8('0x7'));var rimraf=require('rimraf');var config=require(_0x97d8('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x2dd528,_0x2e2891){return _0x2dd528[_0x97d8('0x9')](_0x97d8('0xa'),attributes,{'tableName':_0x97d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc9d=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','api','moment','bluebird','request-promise','path'];(function(_0x437bb8,_0x507b1a){var _0x10bb89=function(_0x122927){while(--_0x122927){_0x437bb8['push'](_0x437bb8['shift']());}};_0x10bb89(++_0x507b1a);}(_0xdc9d,0x1e8));var _0xddc9=function(_0x2c528c,_0x289d92){_0x2c528c=_0x2c528c-0x0;var _0x22292d=_0xdc9d[_0x2c528c];return _0x22292d;};'use strict';var _=require(_0xddc9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xddc9('0x1'));var moment=require(_0xddc9('0x2'));var BPromise=require(_0xddc9('0x3'));var rp=require(_0xddc9('0x4'));var fs=require('fs');var path=require(_0xddc9('0x5'));var rimraf=require(_0xddc9('0x6'));var config=require(_0xddc9('0x7'));var attributes=require(_0xddc9('0x8'));module[_0xddc9('0x9')]=function(_0x1332e7,_0xf7dc06){return _0x1332e7[_0xddc9('0xa')](_0xddc9('0xb'),attributes,{'tableName':_0xddc9('0xc'),'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 e6d7250..d7f44ec 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 _0x8ccc=['message','result','catch','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xd7de81,_0x35ca61){var _0x41c627=function(_0x10aeff){while(--_0x10aeff){_0xd7de81['push'](_0xd7de81['shift']());}};_0x41c627(++_0x35ca61);}(_0x8ccc,0x16f));var _0xc8cc=function(_0x332d62,_0x236139){_0x332d62=_0x332d62-0x0;var _0x3bd864=_0x8ccc[_0x332d62];return _0x3bd864;};'use strict';var _=require(_0xc8cc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc8cc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8cc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8cc('0x3'))(_0xc8cc('0x4'));var config=require(_0xc8cc('0x5'));var jayson=require(_0xc8cc('0x6'));var client=jayson[_0xc8cc('0x7')]['http']({'port':0x232a});config['redis']=_[_0xc8cc('0x8')](config[_0xc8cc('0x9')],{'host':_0xc8cc('0xa'),'port':0x18eb});var socket=require(_0xc8cc('0xb'))(new Redis(config[_0xc8cc('0x9')]));require(_0xc8cc('0xc'))[_0xc8cc('0xd')](socket);function respondWithRpcPromise(_0x181d7d,_0x1913e0,_0x3fe1d8){return new BPromise(function(_0x479f74,_0x2cac96){return client['request'](_0x181d7d,_0x3fe1d8)[_0xc8cc('0xe')](function(_0x1d02fe){logger[_0xc8cc('0xf')](_0xc8cc('0x10'),_0x1913e0,'request\x20sent');logger[_0xc8cc('0x11')](_0xc8cc('0x12'),_0x1913e0,_0xc8cc('0x13'),JSON[_0xc8cc('0x14')](_0x1d02fe));if(_0x1d02fe[_0xc8cc('0x15')]){if(_0x1d02fe['error'][_0xc8cc('0x16')]===0x1f4){logger[_0xc8cc('0x15')](_0xc8cc('0x10'),_0x1913e0,_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);return _0x2cac96(_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);}logger[_0xc8cc('0x15')](_0xc8cc('0x10'),_0x1913e0,_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);return _0x479f74(_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);}else{logger[_0xc8cc('0xf')](_0xc8cc('0x10'),_0x1913e0,_0xc8cc('0x13'));_0x479f74(_0x1d02fe[_0xc8cc('0x18')][_0xc8cc('0x17')]);}})[_0xc8cc('0x19')](function(_0xb435db){logger[_0xc8cc('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1913e0,_0xb435db);_0x2cac96(_0xb435db);});});}
\ No newline at end of file
+var _0x7764=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x5d3550,_0x107033){var _0x5d1299=function(_0x5edaa1){while(--_0x5edaa1){_0x5d3550['push'](_0x5d3550['shift']());}};_0x5d1299(++_0x107033);}(_0x7764,0xa4));var _0x4776=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x7764[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x4776('0x0'));var util=require(_0x4776('0x1'));var moment=require(_0x4776('0x2'));var BPromise=require(_0x4776('0x3'));var rs=require(_0x4776('0x4'));var fs=require('fs');var Redis=require(_0x4776('0x5'));var db=require(_0x4776('0x6'))['db'];var utils=require(_0x4776('0x7'));var logger=require(_0x4776('0x8'))(_0x4776('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4776('0xa')][_0x4776('0xb')]({'port':0x232a});config['redis']=_[_0x4776('0xc')](config[_0x4776('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4776('0xd')]));require('./chatGroup.socket')[_0x4776('0xe')](socket);function respondWithRpcPromise(_0x44ac53,_0x2ea7b1,_0x3baf2f){return new BPromise(function(_0x48c30c,_0x3a12da){return client[_0x4776('0xf')](_0x44ac53,_0x3baf2f)[_0x4776('0x10')](function(_0x1cd700){logger[_0x4776('0x11')](_0x4776('0x12'),_0x2ea7b1,_0x4776('0x13'));logger[_0x4776('0x14')](_0x4776('0x15'),_0x2ea7b1,_0x4776('0x13'),JSON[_0x4776('0x16')](_0x1cd700));if(_0x1cd700['error']){if(_0x1cd700['error'][_0x4776('0x17')]===0x1f4){logger[_0x4776('0x18')](_0x4776('0x12'),_0x2ea7b1,_0x1cd700[_0x4776('0x18')][_0x4776('0x19')]);return _0x3a12da(_0x1cd700[_0x4776('0x18')][_0x4776('0x19')]);}logger[_0x4776('0x18')](_0x4776('0x12'),_0x2ea7b1,_0x1cd700[_0x4776('0x18')]['message']);return _0x48c30c(_0x1cd700[_0x4776('0x18')]['message']);}else{logger[_0x4776('0x11')](_0x4776('0x12'),_0x2ea7b1,_0x4776('0x13'));_0x48c30c(_0x1cd700[_0x4776('0x1a')][_0x4776('0x19')]);}})['catch'](function(_0x1f6bb8){logger[_0x4776('0x18')]('ChatGroup,\x20%s,\x20%s',_0x2ea7b1,_0x1f6bb8);_0x3a12da(_0x1f6bb8);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index acac911..e1a6b69 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 _0x75b5=['emit','removeListener','register','chatGroup:','save','remove','update'];(function(_0x3ff33a,_0x32e7a5){var _0x43517f=function(_0x5f0f4a){while(--_0x5f0f4a){_0x3ff33a['push'](_0x3ff33a['shift']());}};_0x43517f(++_0x32e7a5);}(_0x75b5,0xd6));var _0x575b=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x75b5[_0x43d11d];return _0x38cd08;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x575b('0x0'),_0x575b('0x1'),_0x575b('0x2')];function createListener(_0x2c37ca,_0xf70335){return function(_0x22ccc9){_0xf70335[_0x575b('0x3')](_0x2c37ca,_0x22ccc9);};}function removeListener(_0x5b04db,_0x51759c){return function(){ChatGroupEvents[_0x575b('0x4')](_0x5b04db,_0x51759c);};}exports[_0x575b('0x5')]=function(_0x25db80){for(var _0x28fc02=0x0,_0x7ad9da=events['length'];_0x28fc02<_0x7ad9da;_0x28fc02++){var _0x49a6e4=events[_0x28fc02];var _0x420e73=createListener(_0x575b('0x6')+_0x49a6e4,_0x25db80);ChatGroupEvents['on'](_0x49a6e4,_0x420e73);}};
\ No newline at end of file
+var _0xa78c=['emit','removeListener','length','chatGroup:','remove','update'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xa78c,0xfa));var _0xca78=function(_0x38a511,_0x5860a5){_0x38a511=_0x38a511-0x0;var _0x60ab5d=_0xa78c[_0x38a511];return _0x60ab5d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xca78('0x0'),_0xca78('0x1')];function createListener(_0x22b06e,_0x5503ac){return function(_0x1a2cb4){_0x5503ac[_0xca78('0x2')](_0x22b06e,_0x1a2cb4);};}function removeListener(_0x1a4763,_0x2e8975){return function(){ChatGroupEvents[_0xca78('0x3')](_0x1a4763,_0x2e8975);};}exports['register']=function(_0x4ac5d2){for(var _0x2df4eb=0x0,_0x1e7da2=events[_0xca78('0x4')];_0x2df4eb<_0x1e7da2;_0x2df4eb++){var _0x13353e=events[_0x2df4eb];var _0x4fbb7d=createListener(_0xca78('0x5')+_0x13353e,_0x4ac5d2);ChatGroupEvents['on'](_0x13353e,_0x4fbb7d);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 5089ab5..80a2969 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 _0xc791=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','exports'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xc791,0x8c));var _0x1c79=function(_0xa51ba0,_0x3bf58d){_0xa51ba0=_0xa51ba0-0x0;var _0x17f343=_0xc791[_0xa51ba0];return _0x17f343;};'use strict';var multer=require(_0x1c79('0x0'));var util=require(_0x1c79('0x1'));var path=require(_0x1c79('0x2'));var timeout=require(_0x1c79('0x3'));var express=require(_0x1c79('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1c79('0x5'));var interaction=require(_0x1c79('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x1c79('0x7')]('/',auth[_0x1c79('0x8')](),controller[_0x1c79('0x9')]);router[_0x1c79('0x7')](_0x1c79('0xa'),auth[_0x1c79('0x8')](),controller['describe']);router['get']('/:id',auth[_0x1c79('0x8')](),controller[_0x1c79('0xb')]);router[_0x1c79('0x7')](_0x1c79('0xc'),auth[_0x1c79('0x8')](),controller[_0x1c79('0xd')]);router['get'](_0x1c79('0xe'),auth[_0x1c79('0x8')](),controller[_0x1c79('0xf')]);router[_0x1c79('0x7')](_0x1c79('0x10'),auth[_0x1c79('0x8')](),controller[_0x1c79('0x11')]);router[_0x1c79('0x12')]('/',auth['isAuthenticated'](),controller[_0x1c79('0x13')]);router[_0x1c79('0x12')]('/:id/members',auth[_0x1c79('0x8')](),controller[_0x1c79('0x14')]);router['post'](_0x1c79('0x10'),auth['isAuthenticated'](),controller[_0x1c79('0x15')]);router[_0x1c79('0x16')](_0x1c79('0x17'),auth[_0x1c79('0x8')](),controller[_0x1c79('0x18')]);router[_0x1c79('0x19')]('/:id',auth[_0x1c79('0x8')](),controller[_0x1c79('0x1a')]);router['delete']('/:id/members',auth[_0x1c79('0x8')](),controller['removeMembers']);module[_0x1c79('0x1b')]=router;
\ No newline at end of file
+var _0x2556=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','addMembers','put','delete','destroy','/:id/members','removeMembers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x7cec94,_0x387e20){var _0x44226a=function(_0x5e0a77){while(--_0x5e0a77){_0x7cec94['push'](_0x7cec94['shift']());}};_0x44226a(++_0x387e20);}(_0x2556,0x8d));var _0x6255=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x2556[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x6255('0x0'));var util=require('util');var path=require(_0x6255('0x1'));var timeout=require(_0x6255('0x2'));var express=require(_0x6255('0x3'));var router=express[_0x6255('0x4')]();var fs_extra=require(_0x6255('0x5'));var auth=require(_0x6255('0x6'));var interaction=require(_0x6255('0x7'));var config=require(_0x6255('0x8'));var controller=require('./chatGroup.controller');router[_0x6255('0x9')]('/',auth[_0x6255('0xa')](),controller[_0x6255('0xb')]);router[_0x6255('0x9')](_0x6255('0xc'),auth[_0x6255('0xa')](),controller[_0x6255('0xd')]);router[_0x6255('0x9')](_0x6255('0xe'),auth['isAuthenticated'](),controller[_0x6255('0xf')]);router[_0x6255('0x9')](_0x6255('0x10'),auth[_0x6255('0xa')](),controller[_0x6255('0x11')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x6255('0x12')]);router['get'](_0x6255('0x13'),auth[_0x6255('0xa')](),controller[_0x6255('0x14')]);router[_0x6255('0x15')]('/',auth[_0x6255('0xa')](),controller[_0x6255('0x16')]);router[_0x6255('0x15')]('/:id/members',auth[_0x6255('0xa')](),controller[_0x6255('0x17')]);router[_0x6255('0x15')]('/:id/messages',auth[_0x6255('0xa')](),controller['addMessage']);router[_0x6255('0x18')](_0x6255('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x6255('0x19')](_0x6255('0xe'),auth[_0x6255('0xa')](),controller[_0x6255('0x1a')]);router[_0x6255('0x19')](_0x6255('0x1b'),auth['isAuthenticated'](),controller[_0x6255('0x1c')]);module[_0x6255('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index cbb75be..c054d63 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 _0xee4e=['STRING','DATE','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT'];(function(_0x37846a,_0x42db81){var _0x401321=function(_0x376993){while(--_0x376993){_0x37846a['push'](_0x37846a['shift']());}};_0x401321(++_0x42db81);}(_0xee4e,0x122));var _0xeee4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee4e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xeee4('0x0'));module[_0xeee4('0x1')]={'closed':{'type':Sequelize[_0xeee4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xeee4('0x3')](_0xeee4('0x4'),_0xeee4('0x5')),'defaultValue':_0xeee4('0x4')},'ratingMessage':{'type':Sequelize[_0xeee4('0x6')]},'pathTranscript':{'type':Sequelize[_0xeee4('0x6')]},'mailTranscript':{'type':Sequelize[_0xeee4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xeee4('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xeee4('0x7')]},'thirdDisposition':{'type':Sequelize[_0xeee4('0x7')]},'note':{'type':Sequelize[_0xeee4('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xeee4('0x7')]},'osName':{'type':Sequelize[_0xeee4('0x7')]},'osVersion':{'type':Sequelize[_0xeee4('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xeee4('0x7')]},'deviceType':{'type':Sequelize[_0xeee4('0x7')]},'referer':{'type':Sequelize[_0xeee4('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xeee4('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xeee4('0x8')]},'lastMsgAt':{'type':Sequelize[_0xeee4('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xeee4('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeee4('0x7')]},'customerPort':{'type':Sequelize[_0xeee4('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xeee4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xeee4('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6ae2=['TEXT','STRING','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x47ca1b,_0x1b5188){var _0x2b5eb4=function(_0x2b06ca){while(--_0x2b06ca){_0x47ca1b['push'](_0x47ca1b['shift']());}};_0x2b5eb4(++_0x1b5188);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x248048,_0x302c58){_0x248048=_0x248048-0x0;var _0x3144d2=_0x6ae2[_0x248048];return _0x3144d2;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'closed':{'type':Sequelize[_0x26ae('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x26ae('0x3')]},'ratingType':{'type':Sequelize[_0x26ae('0x4')](_0x26ae('0x5'),_0x26ae('0x6')),'defaultValue':_0x26ae('0x5')},'ratingMessage':{'type':Sequelize[_0x26ae('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x26ae('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x26ae('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x26ae('0x8')]},'note':{'type':Sequelize[_0x26ae('0x8')]},'browserName':{'type':Sequelize[_0x26ae('0x8')]},'browserVersion':{'type':Sequelize[_0x26ae('0x8')]},'osName':{'type':Sequelize[_0x26ae('0x8')]},'osVersion':{'type':Sequelize[_0x26ae('0x8')]},'deviceModel':{'type':Sequelize[_0x26ae('0x8')]},'deviceVendor':{'type':Sequelize[_0x26ae('0x8')]},'deviceType':{'type':Sequelize[_0x26ae('0x8')]},'referer':{'type':Sequelize[_0x26ae('0x7')]},'customerIp':{'type':Sequelize[_0x26ae('0x8')]},'formData':{'type':Sequelize[_0x26ae('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x26ae('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x26ae('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x26ae('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x26ae('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x26ae('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 36b81c1..2f4be2e 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 _0x0b0e=['closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','spread','chatInteractionTags:save','removeTags','files','tmp','attachments','lastName','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','createReadStream','pipe','createWriteStream','firstName','renderFile','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','then','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','isEmpty','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','null','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','ChatWebsiteId','sequelize','toString','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','filters','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned'];(function(_0x529b89,_0x4c0cd6){var _0x5e7124=function(_0x477328){while(--_0x477328){_0x529b89['push'](_0x529b89['shift']());}};_0x5e7124(++_0x4c0cd6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x0b0e[_0x542da8];return _0x533d7e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var pdf=require(_0xe0b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b0('0x14'))(_0xe0b0('0x15'));var utils=require(_0xe0b0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0b0('0x17'));var db=require(_0xe0b0('0x18'))['db'];config[_0xe0b0('0x19')]=_[_0xe0b0('0x1a')](config[_0xe0b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b0('0x1b'))(new Redis(config[_0xe0b0('0x19')]));require(_0xe0b0('0x1c'))[_0xe0b0('0x1d')](socket);var jayson=require(_0xe0b0('0x1e'));var client=jayson['client'][_0xe0b0('0x1f')]({'port':0x232b});var client9004=jayson['client'][_0xe0b0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xadee6e,_0x519ae8,_0x11fdca,_0x4a4cc0){return new BPromise(function(_0x2d6fb6,_0x100204){var _0x56bcc7=_0x4a4cc0||client;return _0x56bcc7['request'](_0xadee6e,_0x11fdca)[_0xe0b0('0x20')](function(_0x50a441){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'),JSON['stringify'](_0x50a441));if(_0x50a441[_0xe0b0('0x22')]){if(_0x50a441['error'][_0xe0b0('0x23')]===0x1f4){logger[_0xe0b0('0x22')](_0xe0b0('0x24'),_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x100204(_0x50a441['error']['message']);}logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x2d6fb6(_0x50a441['error'][_0xe0b0('0x25')]);}else{logger['info'](_0xe0b0('0x24'),_0x519ae8,'request\x20sent');_0x2d6fb6(_0x50a441[_0xe0b0('0x26')]['message']);}})[_0xe0b0('0x27')](function(_0x4de537){logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x4de537);_0x100204(_0x4de537);});});}function respondWithStatusCode(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0xcc;return function(_0x362aba){if(_0x362aba){return _0x3c221d[_0xe0b0('0x28')](_0x5c5317);}return _0x3c221d[_0xe0b0('0x29')](_0x5c5317)[_0xe0b0('0x2a')]();};}function respondWithResult(_0x3ec2,_0x10745d){_0x10745d=_0x10745d||0xc8;return function(_0x5200a6){if(_0x5200a6){return _0x3ec2[_0xe0b0('0x29')](_0x10745d)[_0xe0b0('0x2b')](_0x5200a6);}};}function respondWithFilteredResult(_0x5b7a64,_0x15e13b){return function(_0x419b1f){if(_0x419b1f){var _0x36d137=typeof _0x15e13b[_0xe0b0('0x2c')]===_0xe0b0('0x2d')&&typeof _0x15e13b[_0xe0b0('0x2e')]===_0xe0b0('0x2d');var _0x4fb3b7=_0x419b1f[_0xe0b0('0x2f')];var _0x3c0109=_0x36d137?0x0:_0x15e13b['offset'];var _0x4fe400=_0x36d137?_0x419b1f[_0xe0b0('0x2f')]:_0x15e13b[_0xe0b0('0x2c')]+_0x15e13b[_0xe0b0('0x2e')];var _0x3f81d5;if(_0x4fe400>=_0x4fb3b7){_0x4fe400=_0x4fb3b7;_0x3f81d5=0xc8;}else{_0x3f81d5=0xce;}_0x5b7a64[_0xe0b0('0x29')](_0x3f81d5);return _0x5b7a64['set'](_0xe0b0('0x30'),_0x3c0109+'-'+_0x4fe400+'/'+_0x4fb3b7)[_0xe0b0('0x2b')](_0x419b1f);}return null;};}function patchUpdates(_0x7867c4){return function(_0x29d725){try{jsonpatch[_0xe0b0('0x31')](_0x29d725,_0x7867c4,!![]);}catch(_0x4fe835){return BPromise[_0xe0b0('0x32')](_0x4fe835);}return _0x29d725[_0xe0b0('0x33')]();};}function saveUpdates(_0xfc51d3,_0x31c6f5){return function(_0x3575bc){if(_0x3575bc){return _0x3575bc[_0xe0b0('0x34')](_0xfc51d3)[_0xe0b0('0x20')](function(_0x20908f){return _0x20908f;});}return null;};}function removeEntity(_0x2125d5,_0x1dd010){return function(_0xd56467){if(_0xd56467){return _0xd56467[_0xe0b0('0x35')]()[_0xe0b0('0x20')](function(){_0x2125d5[_0xe0b0('0x29')](0xcc)[_0xe0b0('0x2a')]();});}};}function handleEntityNotFound(_0x4cf80c,_0x121608){return function(_0x135be5){if(!_0x135be5){_0x4cf80c[_0xe0b0('0x28')](0x194);}return _0x135be5;};}function handleError(_0x1eb3f9,_0x1a2d24){_0x1a2d24=_0x1a2d24||0x1f4;return function(_0x2c6e60){logger[_0xe0b0('0x22')](_0x2c6e60['stack']);if(_0x2c6e60['name']){delete _0x2c6e60['name'];}_0x1eb3f9['status'](_0x1a2d24)[_0xe0b0('0x36')](_0x2c6e60);};}function getMustacheRender(_0xc3d967,_0xe6f635){return Mustache['render'](_0xc3d967,_[_0xe0b0('0x37')](_0xe6f635[_0xe0b0('0x38')],{'contact':_0xe6f635[_0xe0b0('0x39')],'message':_0xe6f635[_0xe0b0('0x25')],'agent':_0xe6f635['agent'],'interaction':_0xe6f635[_0xe0b0('0x3a')],'account':_0xe6f635[_0xe0b0('0x3b')]}))||'';}function getInteractionUsers(_0x43d352,_0x30dcbb){return new BPromise(function(_0x4265e3,_0x1205db){try{if(_0x30dcbb[_0x43d352['id']]){_0x43d352[_0xe0b0('0x3c')]=_[_0xe0b0('0x3d')](_0x30dcbb[_0x43d352['id']],function(_0xeaffbb){return{'id':_0xeaffbb['id'],'fullname':_0xeaffbb['fullname']};});}}catch(_0x3e349b){_0x1205db(_0x3e349b);}_0x4265e3(_0x43d352);});}function getInteractionTags(_0x54f646,_0x34178d){return new BPromise(function(_0x2d5f47,_0x46c4ea){try{if(_0x54f646[_0xe0b0('0x3e')]){_0x54f646['Tags']=[];_0x54f646[_0xe0b0('0x3e')][_0xe0b0('0x3f')](',')[_0xe0b0('0x40')](function(_0x402a0e){_0x54f646[_0xe0b0('0x41')][_0xe0b0('0x42')](_0x34178d[_0x402a0e]);});}delete _0x54f646[_0xe0b0('0x3e')];}catch(_0x3bde8b){_0x46c4ea(_0x3bde8b);}_0x2d5f47(_0x54f646);});}function updateChatInteraction(_0x52ffe4,_0x2aad80,_0x309bbf){return new BPromise(function(_0x528818,_0x515bd2){return getInteractionUsers(_0x52ffe4,_0x309bbf)[_0xe0b0('0x20')](function(_0x247f8d){return getInteractionTags(_0x247f8d,_0x2aad80);})['then'](function(_0x18a59d){_0x528818(_0x18a59d);})[_0xe0b0('0x27')](function(_0x6bca5c){_0x515bd2(_0x6bca5c);});});}exports[_0xe0b0('0x43')]=function(_0x1a8cc7,_0x5c31b5){var _0x5d2fa2={},_0x51c580={},_0xc3235b={'count':0x0,'rows':[]};var _0x38e715=_['map'](db[_0xe0b0('0x44')][_0xe0b0('0x45')],function(_0x14197b){return{'name':_0x14197b[_0xe0b0('0x46')],'type':_0x14197b[_0xe0b0('0x47')]['key']};});_0x51c580['model']=_[_0xe0b0('0x3d')](_0x38e715,_0xe0b0('0x48'));_0x51c580[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1a8cc7[_0xe0b0('0x49')]);_0x51c580['filters']=_[_0xe0b0('0x4b')](_0x51c580[_0xe0b0('0x4c')],_0x51c580['query']);_0x5d2fa2['attributes']=_['intersection'](_0x51c580[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x5d2fa2['attributes']=_0x5d2fa2[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5d2fa2['attributes']:_0x51c580['model'];if(!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x50')]('nolimit')){_0x5d2fa2[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1a8cc7['query']['limit']);_0x5d2fa2[_0xe0b0('0x2c')]=qs['offset'](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x2c')]);}_0x5d2fa2[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5d2fa2['where']=qs['filters'](_[_0xe0b0('0x53')](_0x1a8cc7['query'],_0x51c580['filters']),_0x38e715);var _0x249d9a=[];var _0x222174=squel['select']()['field']('id')[_0xe0b0('0x54')](_0xe0b0('0x48'))[_0xe0b0('0x54')](_0xe0b0('0x55'))[_0xe0b0('0x56')](_0xe0b0('0x57'));var _0x84fabb=squel['select']()[_0xe0b0('0x54')]('u.id')[_0xe0b0('0x54')]('u.fullname')['field'](_0xe0b0('0x58'))[_0xe0b0('0x56')](_0xe0b0('0x59'),'ui')[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'u',_0xe0b0('0x5c'));var _0x4548da=squel[_0xe0b0('0x5d')]()[_0xe0b0('0x56')]('chat_interactions','i')[_0xe0b0('0x5a')]('cm_contacts','c',_0xe0b0('0x5e'))[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'o',_0xe0b0('0x5f'))[_0xe0b0('0x5a')](_0xe0b0('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0xe0b0('0x5a')](_0xe0b0('0x61'),'me',_0xe0b0('0x62'))[_0xe0b0('0x5a')](_0xe0b0('0x63'),'it',_0xe0b0('0x64'))[_0xe0b0('0x5a')](_0xe0b0('0x57'),'t',_0xe0b0('0x65'));var _0xf331df=squel[_0xe0b0('0x66')]();var _0x18ab99=[];var _0xc719d2=squel[_0xe0b0('0x66')]();var _0xcdf97;if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x67')]){_0xcdf97=as[_0xe0b0('0x68')](_0x1a8cc7['query'][_0xe0b0('0x67')]);var _0xe7fbac=_0xcdf97[_0xe0b0('0x69')];for(var _0x2f24e6=0x0;_0x2f24e6<_0xcdf97[_0xe0b0('0x6a')][_0xe0b0('0x4f')];_0x2f24e6++){var _0x2bdb59=_0xcdf97['conditions'][_0x2f24e6];var _0x47dcc4='i';var _0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0x2bdb59['field']]);if(!_0x139014){switch(_0x2bdb59[_0xe0b0('0x54')]){case _0xe0b0('0x6c'):if(_0x2bdb59[_0xe0b0('0x6d')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+'`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+_0xe0b0('0x6f'));}break;case'Contact':if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){if(_0x2bdb59['value'][_0xe0b0('0x3f')]('\x20')['length']>0x1){_0xf331df[_0xe7fbac]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe0b0('0x72')](_0x2bdb59['value']),null);}else{var _0x4d75e4='%'+_0x2bdb59[_0xe0b0('0x6d')]+'%';_0xf331df[_0xe7fbac](_0xe0b0('0x73'),_0x4d75e4,_0x4d75e4,_0x4d75e4);}}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),'ContactId']);_0x2bdb59[_0xe0b0('0x54')]=_0xe0b0('0x74');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')]['end']);}break;case'Tag':var _0x4b41a=_0x2bdb59[_0xe0b0('0x6d')][_0xe0b0('0x3f')](',')['map'](function(_0x49b754){return Number(_0x49b754);});_0x4b41a[_0xe0b0('0x40')](function(_0x26f36f){_0xc719d2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26f36f+',%');});_0x18ab99=_['union'](_0x18ab99,_0x4b41a);break;case _0xe0b0('0x78'):if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){_0xf331df[_0xe7fbac](_0xe0b0('0x79'),'%'+_0x2bdb59[_0xe0b0('0x6d')]+'%',null);}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0xe0b0('0x7a')]);_0x2bdb59['field']=_0xe0b0('0x7a');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value']['start'],_0x14da9c['value']['end']);}break;case'body':_0x14da9c=as[_0xe0b0('0x75')]('me',null,_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value'][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);break;}}else{var _0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')]['start'],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);}}}else{var _0x86e90=_(_0x1a8cc7[_0xe0b0('0x49')])[_0xe0b0('0x4a')]()[_0xe0b0('0x3d')](function(_0x16a2ae){return _['some'](_0x38e715,[_0xe0b0('0x48'),_0x16a2ae])?_0x16a2ae:undefined;})['compact']()[_0xe0b0('0x6d')]();if(!_[_0xe0b0('0x7b')](_0x86e90)){_0x86e90[_0xe0b0('0x40')](function(_0x9c7221){if(_0x9c7221==='ChatWebsiteId'){_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x7d'),[]['concat'](_0x1a8cc7['query'][_0x9c7221]));}else if(_0x9c7221===_0xe0b0('0x7e')){var _0x30adc5=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x80')];var _0x31dd21=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x81')];_0x4548da[_0xe0b0('0x7c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x30adc5,_0x31dd21);}else{if(_0x1a8cc7['query'][_0x9c7221]===_0xe0b0('0x82')){_0x4548da['where']('i.'+_0x9c7221+'\x20IS\x20NULL');}else{_0x4548da['where']('i.'+_0x9c7221+'\x20=\x20?',_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221]);}}});}if(_0x1a8cc7['query'][_0xe0b0('0x83')]){if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x83')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`unreadMessages`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')](_0xe0b0('0x84'));}}if(_0x1a8cc7['query'][_0xe0b0('0x85')]){_0x18ab99=_[_0xe0b0('0x86')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x85')])?_0x1a8cc7[_0xe0b0('0x49')]['tag']:new Array(_0x1a8cc7['query']['tag']);_0x18ab99['forEach'](function(_0x5c258b){_0xc719d2['or'](_0xe0b0('0x87'),'%,'+_0x5c258b+',%');});}if(_0x1a8cc7['query'][_0xe0b0('0x88')]){var _0x5f4aaf=_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x88')][_0xe0b0('0x89')]('\x5c','\x5c\x5c')[_0xe0b0('0x89')](/'/g,'\x27\x27');if(qs[_0xe0b0('0x8a')](_0x5f4aaf)){_0xf331df['or'](_0xe0b0('0x8b'),_0x5f4aaf+'%');}else{_0xf331df['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5f4aaf))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5f4aaf+'%');}}}_0x4548da['where'](_0xf331df);_0x4548da[_0xe0b0('0x8c')](_0xe0b0('0x8d'));var _0x264363={'type':db[_0xe0b0('0x8e')][_0xe0b0('0x8f')]['SELECT'],'raw':!![]};var _0x234716=_0x4548da[_0xe0b0('0x90')]();_0x234716[_0xe0b0('0x54')](_0xe0b0('0x8d'));_0x234716[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));if(_0x5d2fa2[_0xe0b0('0x51')]){_0x5d2fa2[_0xe0b0('0x51')]['forEach'](function(_0x589c47){var _0x6e0e9=_0x589c47[0x0]===_0xe0b0('0x92')?_0x589c47[0x0]:'i.'+_0x589c47[0x0];_0x4548da['order'](_0x6e0e9,_0x589c47[0x1]===_0xe0b0('0x93')?![]:!![]);});}if(!_[_0xe0b0('0x7b')](_0x18ab99)){_0x4548da[_0xe0b0('0x6e')](_0xc719d2);_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x94'),_0x18ab99);}BPromise[_0xe0b0('0x95')]()[_0xe0b0('0x20')](function(){if(!_0xcdf97){if(_0x1a8cc7[_0xe0b0('0x49')]['ChatWebsiteId'])return;_0x234716['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x96'));return;}if(_0x1a8cc7['user'][_0xe0b0('0x97')]!==_0xe0b0('0x98'))return;return _0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x56c4b9){if(_['isEmpty'](_0x56c4b9)){_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x9b'));_0x4548da['where'](_0xe0b0('0x9b'));}else{_0x234716[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x56c4b9,'id'));_0x4548da[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe0b0('0x3d')](_0x56c4b9,'id'));}});})['then'](function(){if(_0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x97')]===_0xe0b0('0x98')&&!_0xcdf97&&!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x9c')])return[];return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x234716[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x48497e){_0xc3235b[_0xe0b0('0x2f')]=_0x48497e[_0xe0b0('0x4f')];if(_0xc3235b[_0xe0b0('0x2f')]===0x0)return[];return db['sequelize'][_0xe0b0('0x49')](_0x222174['toString'](),_0x264363)[_0xe0b0('0x20')](function(_0x350c40){_0x249d9a=_['keyBy'](_0x350c40,'id');_0x264363=_[_0xe0b0('0x37')](_0x264363,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a8cc7['query'][_0xe0b0('0x4d')]){_0x5d2fa2['attributes']['forEach'](function(_0x4f027c){_0x4548da[_0xe0b0('0x54')]('i.'+_0x4f027c);});}else{_0x4548da[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));_0x4548da[_0xe0b0('0x54')]('a.key',_0xe0b0('0x9f'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa0'),'Account.mandatoryDisposition');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa1'),'contactName');_0x4548da['field'](_0xe0b0('0xa2'));_0x4548da['field'](_0xe0b0('0xa3'),_0xe0b0('0xa4'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa5'),_0xe0b0('0xa6'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa7'),'Contact.email');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa8'),_0xe0b0('0xa9'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaa'),'Contact.mobile');_0x4548da['field'](_0xe0b0('0xab'),_0xe0b0('0xac'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xad'),_0xe0b0('0xae'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaf'),_0xe0b0('0xb0'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xb1'),'TagIds');}if(_0x5d2fa2[_0xe0b0('0x2e')])_0x4548da[_0xe0b0('0x2e')](_0x5d2fa2[_0xe0b0('0x2e')]);if(_0x5d2fa2[_0xe0b0('0x2c')])_0x4548da['offset'](_0x5d2fa2[_0xe0b0('0x2c')]);return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x4548da[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x484cb2){if(_0x484cb2[_0xe0b0('0x4f')]>0x0)_0x84fabb['where'](_0xe0b0('0xb2'),_[_0xe0b0('0x3d')](_0x484cb2,'id'));return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x84fabb[_0xe0b0('0x9e')](),_0x264363)['then'](function(_0x567e42){var _0x3822e4=_['groupBy'](_0x567e42,_0xe0b0('0xb3'));var _0x4c82d6=[];_0x484cb2[_0xe0b0('0x40')](function(_0x474fbb){_0x4c82d6[_0xe0b0('0x42')](updateChatInteraction(_0x474fbb,_0x249d9a,_0x3822e4));});return BPromise[_0xe0b0('0xb4')](_0x4c82d6);});});})[_0xe0b0('0x20')](function(_0x1bb4da){_0xc3235b[_0xe0b0('0xb5')]=_0x1bb4da;return _0xc3235b;})['then'](respondWithFilteredResult(_0x5c31b5,_0x5d2fa2))['catch'](handleError(_0x5c31b5,null));};exports[_0xe0b0('0xb6')]=function(_0x717e74,_0x184938){var _0x20d6bd={'raw':![],'where':{'id':_0x717e74[_0xe0b0('0xb7')]['id']}},_0xd83992={};_0xd83992[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db[_0xe0b0('0x44')][_0xe0b0('0x45')]);_0xd83992['query']=_['keys'](_0x717e74[_0xe0b0('0x49')]);_0xd83992[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0xd83992[_0xe0b0('0x4c')],_0xd83992[_0xe0b0('0x49')]);_0x20d6bd[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0xd83992['model'],qs['fields'](_0x717e74[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x20d6bd[_0xe0b0('0x4e')]=_0x20d6bd[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x20d6bd[_0xe0b0('0x4e')]:_0xd83992[_0xe0b0('0x4c')];if(_0x717e74[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x20d6bd[_0xe0b0('0xba')]=[{'all':!![]}];}_0x20d6bd=_['merge']({},_0x20d6bd,_0x717e74[_0xe0b0('0xbb')]);return db[_0xe0b0('0x44')]['find'](_0x20d6bd)[_0xe0b0('0x20')](handleEntityNotFound(_0x184938,null))[_0xe0b0('0x20')](respondWithResult(_0x184938,null))[_0xe0b0('0x27')](handleError(_0x184938,null));};exports[_0xe0b0('0xbc')]=function(_0x41fdef,_0x594f91){return db[_0xe0b0('0x44')][_0xe0b0('0xbc')](_0x41fdef[_0xe0b0('0x38')],{})[_0xe0b0('0x20')](respondWithResult(_0x594f91,0xc9))[_0xe0b0('0x27')](handleError(_0x594f91,null));};exports['update']=function(_0x475404,_0x58d61b){if(_0x475404[_0xe0b0('0x38')]['id']){delete _0x475404[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')]['find']({'where':{'id':_0x475404['params']['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x58d61b,null))[_0xe0b0('0x20')](saveUpdates(_0x475404[_0xe0b0('0x38')],null))['then'](respondWithResult(_0x58d61b,null))['catch'](handleError(_0x58d61b,null));};exports['destroy']=function(_0x5175e1,_0x57694c){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x5175e1[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x57694c,null))[_0xe0b0('0x20')](removeEntity(_0x57694c,null))[_0xe0b0('0x27')](handleError(_0x57694c,null));};exports[_0xe0b0('0xbd')]=function(_0xd73b8a,_0x437588){return db['ChatInteraction']['describe']()[_0xe0b0('0x20')](respondWithResult(_0x437588,null))[_0xe0b0('0x27')](handleError(_0x437588,null));};exports[_0xe0b0('0xbe')]=function(_0x52dfd8,_0x6ab413){var _0x395083=_0x52dfd8[_0xe0b0('0xb7')]['id'];var _0xd231c4;var _0x35ca4e;var _0x1b8d4a;return db['ChatInteraction']['findOne']({'where':{'id':_0x395083}})['then'](function(_0x1ce027){_0xd231c4=_0x1ce027;return db[_0xe0b0('0xbf')][_0xe0b0('0xc0')]({'where':{'id':_0x1ce027[_0xe0b0('0x9c')]},'attributes':['id',_0xe0b0('0xc1'),_0xe0b0('0xc2'),_0xe0b0('0xc3'),_0xe0b0('0xc4'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x28ba25){if(_0x28ba25&&_0x28ba25[_0xe0b0('0xc1')]&&_0x28ba25[_0xe0b0('0xc2')]){_0x35ca4e=_0x28ba25;var _0x5451e7={'interaction':{'id':_0x395083},'agent':{'id':_0x52dfd8[_0xe0b0('0x99')]['id'],'name':_0x52dfd8[_0xe0b0('0x99')][_0xe0b0('0x48')],'fullname':_0x52dfd8['user'][_0xe0b0('0xc5')],'email':_0x52dfd8['user'][_0xe0b0('0xc6')]},'contact':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x39')],'account':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x3b')]};var _0x26df60={'rejectUnauthorized':![],'method':_0xe0b0('0xc7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x28ba25[_0xe0b0('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x52dfd8[_0xe0b0('0x99')]['email']],'buttons':null,'topic':_0x35ca4e[_0xe0b0('0xc3')],'note':_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xc4')])?null:getMustacheRender(_0x35ca4e['vidaooNote'],_0x5451e7),'metadata':null},'redirect':_0xe0b0('0xc9'),'json':!![]};try{if(!_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xca')])){var _0x566a6e=getMustacheRender(_0x35ca4e[_0xe0b0('0xca')],_0x5451e7);var _0x32f67b=JSON[_0xe0b0('0x7f')](_0x566a6e);_0x26df60[_0xe0b0('0x38')][_0xe0b0('0xcb')]=_0x32f67b;}}catch(_0x15be52){throw new db['Sequelize'][(_0xe0b0('0xcc'))](_0xe0b0('0xcd'));}return rp(_0x26df60);}else{throw new db[(_0xe0b0('0x8e'))][(_0xe0b0('0xcc'))](_0xe0b0('0xce'));}})[_0xe0b0('0x20')](function(_0x38b2cf){_0x1b8d4a=_0x38b2cf;if(_0x1b8d4a['id']){var _0x31b01a={'body':_0x1b8d4a[_0xe0b0('0xcf')],'ChatWebsiteId':_0x35ca4e['id'],'ChatInteractionId':_0xd231c4['id'],'direction':_0xe0b0('0xd0'),'UserId':_0x52dfd8[_0xe0b0('0x99')]['id']};return db['ChatMessage'][_0xe0b0('0xbc')](_0x31b01a,{});}else{throw new db['Sequelize']['ValidationError'](_0xe0b0('0xd1'));}})[_0xe0b0('0x20')](function(){return _0xd231c4['updateAttributes']({'vidaooSessionId':_0x1b8d4a['id']});})[_0xe0b0('0x20')](respondWithResult(_0x6ab413,null))[_0xe0b0('0x27')](handleError(_0x6ab413,null));};exports[_0xe0b0('0xd2')]=function(_0x11e969,_0xa18619){if(_0x11e969[_0xe0b0('0x38')]['id']){delete _0x11e969[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x11e969['params']['id']},'include':[{'model':db[_0xe0b0('0xd3')],'as':_0xe0b0('0xd4')}]})[_0xe0b0('0x20')](handleEntityNotFound(_0xa18619,null))[_0xe0b0('0x20')](saveUpdates(_0x11e969['body'],null))['then'](respondWithResult(_0xa18619,null))[_0xe0b0('0x27')](handleError(_0xa18619,null));};exports[_0xe0b0('0xd5')]=function(_0x333c2a,_0x2cd7db,_0x308d03){if(_0x333c2a[_0xe0b0('0x38')]['id']){delete _0x333c2a[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x333c2a[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](function(_0xaa7a71){if(!_0xaa7a71){logger[_0xe0b0('0x22')](_0xe0b0('0xd6'),_0xe0b0('0xd5'),0x194,_0xe0b0('0xd7'));_0x2cd7db[_0xe0b0('0x28')](0x194);}else{if(_0xaa7a71[_0xe0b0('0x7a')]){throw new db[(_0xe0b0('0x8e'))]['ValidationError'](_0xe0b0('0xd8'));}}return _0xaa7a71;})[_0xe0b0('0x20')](function(_0x36a006){if(_0x36a006){return _0x36a006['update']({'closed':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xd9')],'disposition':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xda')]})[_0xe0b0('0x20')](function(_0x3532f1){return _0x3532f1;});}})[_0xe0b0('0x20')](function(_0x581ae9){return respondWithRpcPromise(_0xe0b0('0xdb'),'abandon',_0x333c2a[_0xe0b0('0x38')],client9004);})['then'](respondWithResult(_0x2cd7db,null))[_0xe0b0('0x27')](handleError(_0x2cd7db,null));};exports[_0xe0b0('0xdc')]=function(_0x4bd799,_0x2102bc,_0x4f0cbe){_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0x48')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xde')];_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0xdf')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xe0')];_0x4bd799['body'][_0xe0b0('0x47')]=_0x4bd799['file']['mimetype'];return db[_0xe0b0('0xe1')][_0xe0b0('0xbc')](_0x4bd799[_0xe0b0('0x38')])['then'](respondWithResult(_0x2102bc,0xc9))['catch'](handleError(_0x2102bc,null));};exports[_0xe0b0('0xe2')]=function(_0x3c207e,_0x4fc379,_0x98e7c9){return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0xb7')]['id']},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null))[_0xe0b0('0x20')](function(_0x4074bb){if(_0x4074bb){if(_0x4074bb[_0xe0b0('0xd9')]){return _0x4fc379[_0xe0b0('0x29')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xe0b0('0xe1')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0x49')][_0xe0b0('0xe3')]},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null));}})[_0xe0b0('0x20')](function(_0x54f90a){if(_0x54f90a){var _0x1aa40b=_0x54f90a[_0xe0b0('0xe4')]!==null;var _0x22c8a2=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server/files/attachments/');if(_0x1aa40b){_0x22c8a2=path[_0xe0b0('0xe5')](_0x22c8a2,_0xe0b0('0xe7'));}var _0x321b0b=path[_0xe0b0('0xe5')](_0x22c8a2,_0x54f90a[_0xe0b0('0xdf')]);return _0x4fc379[_0xe0b0('0xe8')](_0x321b0b);}})[_0xe0b0('0x27')](handleError(_0x4fc379,null));};exports[_0xe0b0('0xe9')]=function(_0x1ccfc1,_0x2b1474){var _0x574f0a=null;var _0x108371=null;var _0x3f2ec=null;var _0x4f0db7=null;if(_0x1ccfc1[_0xe0b0('0x38')]['id']){delete _0x1ccfc1['body']['id'];}if(_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]){_0x4f0db7=path['join'](config[_0xe0b0('0xe6')],_0xe0b0('0xeb'),util[_0xe0b0('0xec')](_0xe0b0('0xed'),Date[_0xe0b0('0xee')]()));_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xef')]=_0x4f0db7;}return db['ChatInteraction']['find']({'where':{'id':_0x1ccfc1[_0xe0b0('0xb7')]['id']},'include':[{'model':db[_0xe0b0('0xf0')],'as':_0xe0b0('0xf1'),'include':[{'model':db['User'],'as':_0xe0b0('0x78')}]}]})[_0xe0b0('0x20')](handleEntityNotFound(_0x2b1474,null))[_0xe0b0('0x20')](saveUpdates(_0x1ccfc1[_0xe0b0('0x38')],null))[_0xe0b0('0x20')](function(_0x117d00){if(_0x117d00){_0x574f0a=_0x117d00;return db[_0xe0b0('0xbf')][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x9c')]}});}})[_0xe0b0('0x20')](function(_0x5aa313){if(_0x5aa313){_0x3f2ec=_0x5aa313;return db['CmContact'][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x74')]}});}})[_0xe0b0('0x20')](function(_0x3c93c6){if(_0x3c93c6){_0x108371=_0x3c93c6;if(_0x4f0db7){var _0x203351=null;for(var _0x343409=0x1;_0x343409<_0x574f0a[_0xe0b0('0xf1')]['length'];++_0x343409){_0x203351=_0x574f0a[_0xe0b0('0xf1')][_0x343409];var _0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util['format'](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351['UserId']):'System';var _0x3b3473=_0x1ccfc1['body'][_0xe0b0('0xf4')]||util['format'](_0xe0b0('0xf2'),_0xe0b0('0xf5'),_0x203351['ContactId']);switch(_0x3f2ec[_0xe0b0('0xf6')]){case _0xe0b0('0xf7'):_0x2e7fe2=_0x203351['UserId']?util[_0xe0b0('0xec')]('%s%d',_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');break;case _0xe0b0('0xf9'):_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?_0x203351[_0xe0b0('0x78')][_0xe0b0('0xfa')]||_0x203351['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8');break;case'agent_fullname':_0x2e7fe2=_0x203351['UserId']?_0x203351[_0xe0b0('0x78')]['fullname']:_0xe0b0('0xf8');break;default:_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util[_0xe0b0('0xec')](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');}var _0x8364b0=util[_0xe0b0('0xec')](_0xe0b0('0xfb'),moment(_0x203351[_0xe0b0('0x7e')])[_0xe0b0('0xec')](_0xe0b0('0xfc')),_0x203351[_0xe0b0('0xfd')]==='in'?_0x3b3473:_0x2e7fe2,_0x203351['body']);if(!_0x203351[_0xe0b0('0xfe')]){fs[_0xe0b0('0xff')](_0x4f0db7,_0x8364b0);}}return db[_0xe0b0('0x100')][_0xe0b0('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xe0b0('0x101')],'as':'Smtp','raw':!![]}]});}}})[_0xe0b0('0x20')](function(_0x3a75d8){if(_0x3a75d8&&_0x3a75d8[_0xe0b0('0x102')]&&_0x1ccfc1[_0xe0b0('0x38')]){var _0x1e2ef8={'tls':{'rejectUnauthorized':![]}};if(_0x3a75d8[_0xe0b0('0x102')]['service']){_0x1e2ef8[_0xe0b0('0x103')]=_0x3a75d8['Smtp'][_0xe0b0('0x103')];}else{_0x1e2ef8[_0xe0b0('0x104')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x104')];_0x1e2ef8[_0xe0b0('0x105')]=_0x3a75d8[_0xe0b0('0x102')]['port'];_0x1e2ef8[_0xe0b0('0x106')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x106')];}if(_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x107')]){_0x1e2ef8[_0xe0b0('0x108')]={'user':_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x99')],'pass':_0x3a75d8['Smtp']['pass']};}return respondWithRpcPromise(_0xe0b0('0x109'),'sendMail',{'account':_0x1e2ef8,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3a75d8['name'],_0x3a75d8[_0xe0b0('0xc6')]||_0x3a75d8['Smtp']['user']),'to':_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')],'subject':_0xe0b0('0x10a'),'text':util[_0xe0b0('0xec')](_0xe0b0('0x10b'),_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]),'attachments':[{'path':_0x4f0db7}]}})[_0xe0b0('0x20')](function(){return _0x574f0a;})[_0xe0b0('0x27')](function(_0x43f1b1){console['error'](_0x43f1b1);});}else{return _0x574f0a;}})['then'](respondWithStatusCode(_0x2b1474,0xc8))[_0xe0b0('0x27')](handleError(_0x2b1474,null));};exports[_0xe0b0('0x10c')]=function(_0x2b8a03,_0x4f784a,_0x4b5a48){return db[_0xe0b0('0xf0')]['find']({'where':{'id':_0x2b8a03[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x4f784a,null))['then'](function(_0x2e393e){if(_0x2e393e){return _0x2e393e[_0xe0b0('0x10c')](_0x2b8a03[_0xe0b0('0x38')][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x2b8a03[_0xe0b0('0x38')],[_0xe0b0('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x4f784a,null))[_0xe0b0('0x27')](handleError(_0x4f784a,null));};exports[_0xe0b0('0x10f')]=function(_0x1f3162,_0x22da3a,_0x2b2c68){var _0x5c5c2d={'raw':![],'where':{}};var _0x4d6429={};var _0x322d1b={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1f3162[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x22da3a,null))[_0xe0b0('0x20')](function(_0x151da2){if(_0x151da2){_0x4d6429[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage']['rawAttributes']);_0x4d6429[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1f3162[_0xe0b0('0x49')]);_0x4d6429[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x4d6429[_0xe0b0('0x4c')],_0x4d6429[_0xe0b0('0x49')]);_0x5c5c2d[_0xe0b0('0x4e')]=_['intersection'](_0x4d6429[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1f3162[_0xe0b0('0x49')]['fields']));_0x5c5c2d[_0xe0b0('0x4e')]=_0x5c5c2d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5c5c2d[_0xe0b0('0x4e')]:_0x4d6429[_0xe0b0('0x4c')];if(!_0x1f3162[_0xe0b0('0x49')]['hasOwnProperty'](_0xe0b0('0x110'))){_0x5c5c2d[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1f3162['query'][_0xe0b0('0x2e')]);_0x5c5c2d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x1f3162[_0xe0b0('0x49')]['offset']);}_0x5c5c2d[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5c5c2d[_0xe0b0('0x7c')]=qs[_0xe0b0('0xb8')](_[_0xe0b0('0x53')](_0x1f3162[_0xe0b0('0x49')],_0x4d6429['filters']));_0x5c5c2d[_0xe0b0('0x7c')]['ChatInteractionId']=_0x151da2['id'];if(_0x1f3162['query'][_0xe0b0('0x88')]){_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d['where'],{'$or':_[_0xe0b0('0x3d')](_0x5c5c2d['attributes'],function(_0xf0c217){var _0x4c5406={};_0x4c5406[_0xf0c217]={'$like':'%'+_0x1f3162['query']['filter']+'%'};return _0x4c5406;})});}if(_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x80')]){var _0x55e013=_0x1f3162[_0xe0b0('0x49')]['$gte']['split'](',');var _0x31fa9d={};_0x31fa9d[_0x55e013[0x0]]={'$gte':moment(_0x55e013[0x1])['format'](_0xe0b0('0x111'))};_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d[_0xe0b0('0x7c')],_0x31fa9d);}_0x5c5c2d=_['merge']({},_0x5c5c2d,_0x1f3162[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')][_0xe0b0('0x2f')]({'where':_0x5c5c2d[_0xe0b0('0x7c')]})[_0xe0b0('0x20')](function(_0x51600e){_0x322d1b[_0xe0b0('0x2f')]=_0x51600e;if(_0x1f3162[_0xe0b0('0x49')]['includeAll']){_0x5c5c2d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x5c5c2d);})[_0xe0b0('0x20')](function(_0x1e0374){_0x322d1b[_0xe0b0('0xb5')]=_0x1e0374;return _0x322d1b;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x22da3a,_0x5c5c2d))[_0xe0b0('0x27')](handleError(_0x22da3a,null));};exports[_0xe0b0('0x113')]=function(_0x5b7b02,_0x565f67,_0x2853bf){var _0x4c0d9d={'where':{}},_0x38dd79={},_0x2dc446={'count':0x0,'rows':[]};return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x5b7b02[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x565f67,null))['then'](function(_0x5996a6){if(_0x5996a6){_0x38dd79[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage'][_0xe0b0('0x45')]);_0x38dd79[_0xe0b0('0x49')]=_['keys'](_0x5b7b02[_0xe0b0('0x49')]);_0x38dd79[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x38dd79['model'],_0x38dd79[_0xe0b0('0x49')]);_0x4c0d9d[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0x38dd79[_0xe0b0('0x4c')],qs['fields'](_0x5b7b02[_0xe0b0('0x49')]['fields']));_0x4c0d9d[_0xe0b0('0x4e')]=_0x4c0d9d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x4c0d9d['attributes']:_0x38dd79[_0xe0b0('0x4c')];if(!_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x50')](_0xe0b0('0x110'))){_0x4c0d9d['limit']=qs[_0xe0b0('0x2e')](_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x2e')]);_0x4c0d9d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x5b7b02[_0xe0b0('0x49')]['offset']);}_0x4c0d9d['order']=qs['sort'](_0x5b7b02[_0xe0b0('0x49')]['sort']);_0x4c0d9d[_0xe0b0('0x7c')]=qs['filters'](_['pick'](_0x5b7b02[_0xe0b0('0x49')],_0x38dd79[_0xe0b0('0xb8')]));_0x4c0d9d[_0xe0b0('0x7c')][_0xe0b0('0xb3')]=_0x5996a6['id'];if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x88')]){_0x4c0d9d[_0xe0b0('0x7c')]=_['merge'](_0x4c0d9d[_0xe0b0('0x7c')],{'$or':_[_0xe0b0('0x3d')](_0x4c0d9d[_0xe0b0('0x4e')],function(_0x15033e){var _0x14ba21={};_0x14ba21[_0x15033e]={'$like':'%'+_0x5b7b02[_0xe0b0('0x49')]['filter']+'%'};return _0x14ba21;})});}_0x4c0d9d['where'][_0xe0b0('0xfe')]=![];if(_0x5b7b02[_0xe0b0('0x49')]['id']){_0x4c0d9d[_0xe0b0('0x7c')]['id']={'$gt':_0x5b7b02[_0xe0b0('0x49')]['id']};}_0x4c0d9d=_[_0xe0b0('0x37')]({},_0x4c0d9d,_0x5b7b02[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')]['count']({'where':_0x4c0d9d['where']})[_0xe0b0('0x20')](function(_0x16386b){_0x2dc446[_0xe0b0('0x2f')]=_0x16386b;_0x4c0d9d['include']=[];if(_0x5b7b02['query'][_0xe0b0('0x114')]){_0x4c0d9d[_0xe0b0('0xba')][_0xe0b0('0x42')]({'model':db[_0xe0b0('0x78')],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5'),_0xe0b0('0xfa')]});}if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x4c0d9d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x4c0d9d);})['then'](function(_0x2df3df){_0x2dc446['rows']=_0x2df3df;return _0x2dc446;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x565f67,_0x4c0d9d))[_0xe0b0('0x27')](handleError(_0x565f67,null));};exports['addTags']=function(_0x236966,_0x41fd0e,_0x17e7d4){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x236966[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x41fd0e,null))[_0xe0b0('0x20')](function(_0x19dafb){if(_0x19dafb){return _0x19dafb['setTags'](_0x236966['body'][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x236966['body'],['ids','id'])||{})[_0xe0b0('0x115')](function(){return db['Tag'][_0xe0b0('0x112')]({'attributes':['id',_0xe0b0('0x48'),_0xe0b0('0x55')],'where':{'id':_0x236966[_0xe0b0('0x38')][_0xe0b0('0x10d')]}});})[_0xe0b0('0x20')](function(_0x36106e){socket['emit'](_0xe0b0('0x116'),{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]});return{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]};});}})['then'](respondWithResult(_0x41fd0e,null))[_0xe0b0('0x27')](handleError(_0x41fd0e,null));};exports[_0xe0b0('0x117')]=function(_0x263288,_0x7117ca,_0x21ccfe){return db['ChatInteraction']['find']({'where':{'id':_0x263288['params']['id']}})['then'](handleEntityNotFound(_0x7117ca,null))[_0xe0b0('0x20')](function(_0x1bd420){if(_0x1bd420){return _0x1bd420[_0xe0b0('0x117')](_0x263288['query'][_0xe0b0('0x10d')]);}})[_0xe0b0('0x20')](respondWithStatusCode(_0x7117ca,null))[_0xe0b0('0x27')](handleError(_0x7117ca,null));};exports[_0xe0b0('0xe8')]=function(_0x2d2852,_0x16a02b){var _0x125ead=moment()['unix']()[_0xe0b0('0x9e')]();var _0x380fe1=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server',_0xe0b0('0x118'),_0xe0b0('0x119'));var _0x3eb643=path[_0xe0b0('0xe5')](config['root'],'server',_0xe0b0('0x118'),_0xe0b0('0x11a'));var _0x26bd6c=path[_0xe0b0('0xe5')](_0x380fe1,_0x125ead);var _0x104409=util[_0xe0b0('0xec')]('transcript-%d-%s.zip',_0x2d2852[_0xe0b0('0xb7')]['id'],_0x125ead);var _0x6f9dbd=path[_0xe0b0('0xe5')](_0x380fe1,_0x104409);var _0x4c6646=[];_0x4c6646[_0xe0b0('0x42')]({'model':db['User'],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5')],'raw':!![]});_0x4c6646['push']({'model':db[_0xe0b0('0xd3')],'as':'Contact','attributes':['id','firstName',_0xe0b0('0x11b')],'raw':!![]});if(_0x2d2852['query']['attachments']){_0x4c6646['push']({'model':db[_0xe0b0('0xe1')],'as':_0xe0b0('0xe1'),'raw':!![]});}var _0x573ca9=[{'model':db[_0xe0b0('0xf0')],'as':'Messages','attributes':['id',_0xe0b0('0x38'),_0xe0b0('0x7e'),_0xe0b0('0xfd'),_0xe0b0('0xfe'),'read'],'include':_0x4c6646}];_0x573ca9['push']({'model':db['ChatWebsite'],'as':_0xe0b0('0x11c'),'attributes':['id',_0xe0b0('0x48')]});_0x573ca9['push']({'model':db['User'],'as':_0xe0b0('0x11d'),'attributes':['id',_0xe0b0('0xc5')]});return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x2d2852['params']['id']},'include':_0x573ca9})['then'](handleEntityNotFound(_0x16a02b,null))[_0xe0b0('0x20')](function(_0x329684){if(_0x329684){var _0x5b1bb7=_0x329684[_0xe0b0('0x11e')]({'plain':!![]});fs[_0xe0b0('0x11f')](_0x26bd6c);var _0x5b7df1={'channel':'Chat','account':_0x5b1bb7['Account'][_0xe0b0('0x48')],'agent':_0x5b1bb7[_0xe0b0('0x11d')]?_0x5b1bb7['Owner'][_0xe0b0('0xc5')]:_0xe0b0('0x120'),'createdAt':moment(_0x5b1bb7[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'closedAt':_0x5b1bb7[_0xe0b0('0xd9')]?moment(_0x5b1bb7['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')]():'','disposition':_0x5b1bb7['disposition'],'chatInfo':{'browser':_0x5b1bb7[_0xe0b0('0x121')],'os':_0x5b1bb7['osName'],'referer':_0x5b1bb7['referer'],'customerIp':_0x5b1bb7[_0xe0b0('0x122')],'customerPort':_0x5b1bb7[_0xe0b0('0x123')]?_0x5b1bb7[_0xe0b0('0x123')]:_0xe0b0('0x120')},'messages':_(_0x5b1bb7['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x26a916){if(_0x26a916[_0xe0b0('0xe1')]){var _0x5b5bb2=path['join'](_0x3eb643,_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]);if(fs['existsSync'](_0x5b5bb2)){fs[_0xe0b0('0x124')](_0x5b5bb2)[_0xe0b0('0x125')](fs[_0xe0b0('0x126')](path[_0xe0b0('0xe5')](_0x26bd6c,_0x26a916['Attachment'][_0xe0b0('0xdf')])));}}return{'date':moment(_0x26a916[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'sender':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?_0x26a916[_0xe0b0('0x78')]?_0x26a916['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8'):_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x127')]+(_0x26a916[_0xe0b0('0xd4')]['lastName']?'\x20'+_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x11b')]:''),'body':_0x26a916['Attachment']?_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]:_0x26a916[_0xe0b0('0x38')],'direction':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?'A':'C','secret':_0x26a916[_0xe0b0('0xfe')],'read':_0x26a916['read'],'attachment':_0x26a916[_0xe0b0('0xe1')]};})[_0xe0b0('0x6d')]()};return ejs[_0xe0b0('0x128')](path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],_0xe0b0('0x129'),_0xe0b0('0x12a'),_0xe0b0('0x12b')),{'interaction':_0x5b7df1})[_0xe0b0('0x20')](function(_0x1f5871){var _0x4d12b2=path[_0xe0b0('0xe5')](_0x26bd6c,'transcript-'+_0x5b1bb7['id']+'-'+_0x125ead+_0xe0b0('0x12c'));var _0x4b655d={'path':_0x4d12b2,'channel':'Chat','interactionId':_0x5b1bb7['id']};return pdf[_0xe0b0('0x12d')](_0x1f5871,_0x4b655d);})[_0xe0b0('0x20')](function(){return new BPromise(function(_0x5b8cef,_0x4d4eae){zipdir(_0x26bd6c,{'saveTo':_0x6f9dbd},function(_0x388f0d,_0x317dee){if(_0x388f0d)return _0x4d4eae(_0x388f0d);return _0x5b8cef(_0x317dee);});})['then'](function(){return new BPromise(function(_0x5501c2,_0xa7f2cf){rimraf(_0x26bd6c,function(_0x2c61b3){if(_0x2c61b3)_0xa7f2cf(_0x2c61b3);return _0x5501c2();});});})['then'](function(){return _0x16a02b[_0xe0b0('0xe8')](_0x6f9dbd,_0x104409,function(_0x465315){if(_0x465315){console[_0xe0b0('0x12e')](_0xe0b0('0x12f'),_0x465315);}else{fs['unlinkSync'](_0x6f9dbd);}});});});}else{return _0x16a02b[_0xe0b0('0x28')](0xc8);}})[_0xe0b0('0x27')](handleError(_0x16a02b,null));};
\ No newline at end of file
+var _0x0abf=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','user_has_chat_interactions','users','chat_interactions','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','params','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','download','mailTranscript','format','transcript-%s.txt','now','User','CmContact','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','root','attachments','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','firstName','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','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','code','message','sendStatus','status','json','offset','undefined','limit','count','reject','update','destroy','end','stack','name','render','merge','body','contact','agent','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','key','model'];(function(_0x43de77,_0x4c5bee){var _0x3feda3=function(_0x10df0c){while(--_0x10df0c){_0x43de77['push'](_0x43de77['shift']());}};_0x3feda3(++_0x4c5bee);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0abf[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf0ab('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ab('0x12'))(_0xf0ab('0x13'));var utils=require(_0xf0ab('0x14'));var config=require(_0xf0ab('0x15'));var licenseUtil=require(_0xf0ab('0x16'));var db=require(_0xf0ab('0x17'))['db'];config[_0xf0ab('0x18')]=_['defaults'](config[_0xf0ab('0x18')],{'host':_0xf0ab('0x19'),'port':0x18eb});var socket=require(_0xf0ab('0x1a'))(new Redis(config[_0xf0ab('0x18')]));require(_0xf0ab('0x1b'))[_0xf0ab('0x1c')](socket);var jayson=require(_0xf0ab('0x1d'));var client=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232b});var client9004=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x221bac,_0x200cf5,_0x2f4618,_0x230f40){return new BPromise(function(_0x54b0ce,_0x457465){var _0x9e3b47=_0x230f40||client;return _0x9e3b47[_0xf0ab('0x20')](_0x221bac,_0x2f4618)[_0xf0ab('0x21')](function(_0x776619){logger[_0xf0ab('0x22')](_0xf0ab('0x23'),_0x200cf5,_0xf0ab('0x24'));logger[_0xf0ab('0x25')](_0xf0ab('0x26'),_0x200cf5,_0xf0ab('0x24'),JSON[_0xf0ab('0x27')](_0x776619));if(_0x776619[_0xf0ab('0x28')]){if(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x29')]===0x1f4){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x457465(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}logger[_0xf0ab('0x28')](_0xf0ab('0x23'),_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x54b0ce(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}else{logger[_0xf0ab('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,'request\x20sent');_0x54b0ce(_0x776619['result'][_0xf0ab('0x2a')]);}})['catch'](function(_0x3eca32){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x3eca32);_0x457465(_0x3eca32);});});}function respondWithStatusCode(_0x163078,_0x22671e){_0x22671e=_0x22671e||0xcc;return function(_0x10bf5f){if(_0x10bf5f){return _0x163078[_0xf0ab('0x2b')](_0x22671e);}return _0x163078[_0xf0ab('0x2c')](_0x22671e)['end']();};}function respondWithResult(_0x2d0da7,_0x574ce7){_0x574ce7=_0x574ce7||0xc8;return function(_0x55d799){if(_0x55d799){return _0x2d0da7[_0xf0ab('0x2c')](_0x574ce7)[_0xf0ab('0x2d')](_0x55d799);}};}function respondWithFilteredResult(_0x1b223d,_0x445160){return function(_0x43476c){if(_0x43476c){var _0x174052=typeof _0x445160[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&typeof _0x445160[_0xf0ab('0x30')]===_0xf0ab('0x2f');var _0x21e8ac=_0x43476c[_0xf0ab('0x31')];var _0x58cbe1=_0x174052?0x0:_0x445160[_0xf0ab('0x2e')];var _0x35973a=_0x174052?_0x43476c['count']:_0x445160['offset']+_0x445160[_0xf0ab('0x30')];var _0x1dc84e;if(_0x35973a>=_0x21e8ac){_0x35973a=_0x21e8ac;_0x1dc84e=0xc8;}else{_0x1dc84e=0xce;}_0x1b223d[_0xf0ab('0x2c')](_0x1dc84e);return _0x1b223d['set']('Content-Range',_0x58cbe1+'-'+_0x35973a+'/'+_0x21e8ac)[_0xf0ab('0x2d')](_0x43476c);}return null;};}function patchUpdates(_0x58fa03){return function(_0x1cfd52){try{jsonpatch['apply'](_0x1cfd52,_0x58fa03,!![]);}catch(_0x3f66fa){return BPromise[_0xf0ab('0x32')](_0x3f66fa);}return _0x1cfd52['save']();};}function saveUpdates(_0x56e728,_0x469f42){return function(_0x27c6f9){if(_0x27c6f9){return _0x27c6f9[_0xf0ab('0x33')](_0x56e728)[_0xf0ab('0x21')](function(_0x2519c7){return _0x2519c7;});}return null;};}function removeEntity(_0x36195d,_0x17f3b3){return function(_0xf8f0f4){if(_0xf8f0f4){return _0xf8f0f4[_0xf0ab('0x34')]()[_0xf0ab('0x21')](function(){_0x36195d[_0xf0ab('0x2c')](0xcc)[_0xf0ab('0x35')]();});}};}function handleEntityNotFound(_0x22dcfe,_0x437fdb){return function(_0x5d8443){if(!_0x5d8443){_0x22dcfe[_0xf0ab('0x2b')](0x194);}return _0x5d8443;};}function handleError(_0x45c449,_0xc575ed){_0xc575ed=_0xc575ed||0x1f4;return function(_0x5c9192){logger[_0xf0ab('0x28')](_0x5c9192[_0xf0ab('0x36')]);if(_0x5c9192[_0xf0ab('0x37')]){delete _0x5c9192['name'];}_0x45c449[_0xf0ab('0x2c')](_0xc575ed)['send'](_0x5c9192);};}function getMustacheRender(_0xda3971,_0x492d7c){return Mustache[_0xf0ab('0x38')](_0xda3971,_[_0xf0ab('0x39')](_0x492d7c[_0xf0ab('0x3a')],{'contact':_0x492d7c[_0xf0ab('0x3b')],'message':_0x492d7c[_0xf0ab('0x2a')],'agent':_0x492d7c[_0xf0ab('0x3c')],'interaction':_0x492d7c['interaction'],'account':_0x492d7c[_0xf0ab('0x3d')]}))||'';}function getInteractionUsers(_0x683d08,_0x5a6df5){return new BPromise(function(_0x207fbb,_0xce89bc){try{if(_0x5a6df5[_0x683d08['id']]){_0x683d08[_0xf0ab('0x3e')]=_[_0xf0ab('0x3f')](_0x5a6df5[_0x683d08['id']],function(_0x31fa72){return{'id':_0x31fa72['id'],'fullname':_0x31fa72[_0xf0ab('0x40')]};});}}catch(_0x28c20c){_0xce89bc(_0x28c20c);}_0x207fbb(_0x683d08);});}function getInteractionTags(_0x528d4b,_0x406a1d){return new BPromise(function(_0x4f6e93,_0x7c4629){try{if(_0x528d4b['TagIds']){_0x528d4b[_0xf0ab('0x41')]=[];_0x528d4b[_0xf0ab('0x42')][_0xf0ab('0x43')](',')[_0xf0ab('0x44')](function(_0x2b7ed5){_0x528d4b['Tags'][_0xf0ab('0x45')](_0x406a1d[_0x2b7ed5]);});}delete _0x528d4b[_0xf0ab('0x42')];}catch(_0x28e7a4){_0x7c4629(_0x28e7a4);}_0x4f6e93(_0x528d4b);});}function updateChatInteraction(_0x197955,_0x191caf,_0x17a73){return new BPromise(function(_0x45849c,_0x413f5c){return getInteractionUsers(_0x197955,_0x17a73)[_0xf0ab('0x21')](function(_0x3b214a){return getInteractionTags(_0x3b214a,_0x191caf);})[_0xf0ab('0x21')](function(_0x32ec93){_0x45849c(_0x32ec93);})[_0xf0ab('0x46')](function(_0x5e6b6b){_0x413f5c(_0x5e6b6b);});});}exports['index']=function(_0x2fc677,_0x4e6c41){var _0x1fc766={},_0x2d50c0={},_0x4bbdf6={'count':0x0,'rows':[]};var _0x8c2d2c=_[_0xf0ab('0x3f')](db['ChatInteraction'][_0xf0ab('0x47')],function(_0x29cc6a){return{'name':_0x29cc6a[_0xf0ab('0x48')],'type':_0x29cc6a[_0xf0ab('0x49')][_0xf0ab('0x4a')]};});_0x2d50c0[_0xf0ab('0x4b')]=_[_0xf0ab('0x3f')](_0x8c2d2c,_0xf0ab('0x37'));_0x2d50c0[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x2fc677[_0xf0ab('0x4c')]);_0x2d50c0[_0xf0ab('0x4e')]=_[_0xf0ab('0x4f')](_0x2d50c0[_0xf0ab('0x4b')],_0x2d50c0['query']);_0x1fc766['attributes']=_[_0xf0ab('0x4f')](_0x2d50c0['model'],qs['fields'](_0x2fc677['query'][_0xf0ab('0x50')]));_0x1fc766[_0xf0ab('0x51')]=_0x1fc766[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x1fc766[_0xf0ab('0x51')]:_0x2d50c0[_0xf0ab('0x4b')];if(!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x1fc766[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x2fc677[_0xf0ab('0x4c')]['limit']);_0x1fc766[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x1fc766[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x1fc766['where']=qs['filters'](_['pick'](_0x2fc677[_0xf0ab('0x4c')],_0x2d50c0[_0xf0ab('0x4e')]),_0x8c2d2c);var _0x577c85=[];var _0xa1a416=squel[_0xf0ab('0x57')]()['field']('id')[_0xf0ab('0x58')](_0xf0ab('0x37'))[_0xf0ab('0x58')](_0xf0ab('0x59'))[_0xf0ab('0x5a')](_0xf0ab('0x5b'));var _0x26508b=squel['select']()[_0xf0ab('0x58')]('u.id')[_0xf0ab('0x58')]('u.fullname')[_0xf0ab('0x58')]('ui.ChatInteractionId')['from'](_0xf0ab('0x5c'),'ui')['left_join'](_0xf0ab('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x2eff07=squel['select']()[_0xf0ab('0x5a')](_0xf0ab('0x5e'),'i')[_0xf0ab('0x5f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf0ab('0x5d'),'o',_0xf0ab('0x60'))['left_join']('chat_websites','a',_0xf0ab('0x61'))[_0xf0ab('0x5f')](_0xf0ab('0x62'),'me',_0xf0ab('0x63'))[_0xf0ab('0x5f')](_0xf0ab('0x64'),'it',_0xf0ab('0x65'))[_0xf0ab('0x5f')](_0xf0ab('0x5b'),'t',_0xf0ab('0x66'));var _0x1e6a4e=squel['expr']();var _0x41ed17=[];var _0x5b24e3=squel[_0xf0ab('0x67')]();var _0x61d3db;if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]){_0x61d3db=as[_0xf0ab('0x69')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]);var _0x1f11aa=_0x61d3db[_0xf0ab('0x6a')];for(var _0x180ee6=0x0;_0x180ee6<_0x61d3db['conditions'][_0xf0ab('0x52')];_0x180ee6++){var _0x2266f3=_0x61d3db[_0xf0ab('0x6b')][_0x180ee6];var _0x1d4a72='i';var _0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0x2266f3[_0xf0ab('0x58')]]);if(!_0x2232eb){switch(_0x2266f3[_0xf0ab('0x58')]){case'unreadMessages':if(_0x2266f3['value']==0x1){_0x2eff07[_0xf0ab('0x6d')]('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6e'));}else{_0x2eff07['having']('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6f'));}break;case _0xf0ab('0x70'):if(_0x2266f3['operator']===_0xf0ab('0x71')){if(_0x2266f3[_0xf0ab('0x72')][_0xf0ab('0x43')]('\x20')[_0xf0ab('0x52')]>0x1){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x73'),qs['getFullTextValue'](_0x2266f3[_0xf0ab('0x72')]),null);}else{var _0x70b02d='%'+_0x2266f3[_0xf0ab('0x72')]+'%';_0x1e6a4e[_0x1f11aa](_0xf0ab('0x74'),_0x70b02d,_0x70b02d,_0x70b02d);}}else{_0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x75')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x75');_0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')]['start'],_0x5154f5['value'][_0xf0ab('0x35')]);}break;case _0xf0ab('0x78'):var _0x325ad6=_0x2266f3['value'][_0xf0ab('0x43')](',')['map'](function(_0x1a32dc){return Number(_0x1a32dc);});_0x325ad6[_0xf0ab('0x44')](function(_0x1787e2){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1787e2+',%');});_0x41ed17=_[_0xf0ab('0x79')](_0x41ed17,_0x325ad6);break;case'User':if(_0x2266f3['operator']===_0xf0ab('0x71')){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x7a'),'%'+_0x2266f3[_0xf0ab('0x72')]+'%',null);}else{_0x2232eb=_['find'](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x7b')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x7b');_0x5154f5=as['buildExpression'](_0x1d4a72,_0x2232eb['type'],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5['text'],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}break;case _0xf0ab('0x3a'):_0x5154f5=as[_0xf0ab('0x76')]('me',null,_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);break;}}else{var _0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}}}else{var _0x42f067=_(_0x2fc677['query'])[_0xf0ab('0x4d')]()[_0xf0ab('0x3f')](function(_0x4c8e95){return _['some'](_0x8c2d2c,['name',_0x4c8e95])?_0x4c8e95:undefined;})[_0xf0ab('0x7d')]()[_0xf0ab('0x72')]();if(!_[_0xf0ab('0x7e')](_0x42f067)){_0x42f067[_0xf0ab('0x44')](function(_0x15aa78){if(_0x15aa78===_0xf0ab('0x7f')){_0x2eff07['where'](_0xf0ab('0x80'),[]['concat'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]));}else if(_0x15aa78==='createdAt'){var _0x2978a9=JSON['parse'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])['$gte'];var _0x58ca28=JSON[_0xf0ab('0x81')](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])[_0xf0ab('0x82')];_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x84'),_0x2978a9,_0x58ca28);}else{if(_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]===_0xf0ab('0x85')){_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x86'));}else{_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x87'),_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]);}}});}if(_0x2fc677[_0xf0ab('0x4c')]['read']){if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x88')]==0x1){_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x89'));}else{_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x8a'));}}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]){_0x41ed17=_[_0xf0ab('0x8c')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')])?_0x2fc677[_0xf0ab('0x4c')]['tag']:new Array(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]);_0x41ed17[_0xf0ab('0x44')](function(_0x2196a7){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2196a7+',%');});}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]){var _0x4463cc=_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]['replace']('\x5c','\x5c\x5c')[_0xf0ab('0x8e')](/'/g,'\x27\x27');if(qs[_0xf0ab('0x8f')](_0x4463cc)){_0x1e6a4e['or']('i.id\x20LIKE\x20?',_0x4463cc+'%');}else{_0x1e6a4e['or'](_0xf0ab('0x90'),qs['getFullTextValue'](_0x4463cc))['or'](_0xf0ab('0x91'),_0x4463cc+'%');}}}_0x2eff07[_0xf0ab('0x83')](_0x1e6a4e);_0x2eff07['group'](_0xf0ab('0x92'));var _0x148a72={'type':db['Sequelize']['QueryTypes'][_0xf0ab('0x93')],'raw':!![]};var _0x58140c=_0x2eff07[_0xf0ab('0x94')]();_0x58140c[_0xf0ab('0x58')]('i.id');_0x58140c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf0ab('0x95'));if(_0x1fc766[_0xf0ab('0x55')]){_0x1fc766[_0xf0ab('0x55')][_0xf0ab('0x44')](function(_0x49c89f){var _0x272f9c=_0x49c89f[0x0]===_0xf0ab('0x96')?_0x49c89f[0x0]:'i.'+_0x49c89f[0x0];_0x2eff07[_0xf0ab('0x55')](_0x272f9c,_0x49c89f[0x1]===_0xf0ab('0x97')?![]:!![]);});}if(!_[_0xf0ab('0x7e')](_0x41ed17)){_0x2eff07['having'](_0x5b24e3);_0x58140c['where'](_0xf0ab('0x98'),_0x41ed17);}BPromise[_0xf0ab('0x99')]()['then'](function(){if(!_0x61d3db){if(_0x2fc677['query'][_0xf0ab('0x7f')])return;_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x9a'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9a'));return;}if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]!==_0xf0ab('0x3c'))return;return _0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x21')](function(_0x52eca9){if(_['isEmpty'](_0x52eca9)){_0x58140c[_0xf0ab('0x83')]('i.ChatWebsiteId\x20IS\x20NULL');_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9e'));}else{_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x80'),_['map'](_0x52eca9,'id'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x80'),_[_0xf0ab('0x3f')](_0x52eca9,'id'));}});})[_0xf0ab('0x21')](function(){if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]===_0xf0ab('0x3c')&&!_0x61d3db&&!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x7f')])return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x58140c[_0xf0ab('0xa0')](),_0x148a72);})[_0xf0ab('0x21')](function(_0x4211a1){_0x4bbdf6['count']=_0x4211a1[_0xf0ab('0x52')];if(_0x4bbdf6[_0xf0ab('0x31')]===0x0)return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0xa1a416[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x611cf7){_0x577c85=_['keyBy'](_0x611cf7,'id');_0x148a72=_['merge'](_0x148a72,{'model':db[_0xf0ab('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x50')]){_0x1fc766['attributes'][_0xf0ab('0x44')](function(_0x405b34){_0x2eff07[_0xf0ab('0x58')]('i.'+_0x405b34);});}else{_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa2'),'unreadMessages');_0x2eff07['field'](_0xf0ab('0xa3'),'Account.key');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa4'),'Account.mandatoryDisposition');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa5'),_0xf0ab('0x96'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa6'));_0x2eff07['field'](_0xf0ab('0xa7'),_0xf0ab('0xa8'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa9'),_0xf0ab('0xaa'));_0x2eff07['field'](_0xf0ab('0xab'),_0xf0ab('0xac'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xad'),_0xf0ab('0xae'));_0x2eff07['field'](_0xf0ab('0xaf'),_0xf0ab('0xb0'));_0x2eff07[_0xf0ab('0x58')]('c.fax',_0xf0ab('0xb1'));_0x2eff07['field'](_0xf0ab('0xb2'),_0xf0ab('0xb3'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xb4'),'Owner.internal');_0x2eff07[_0xf0ab('0x58')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1fc766[_0xf0ab('0x30')])_0x2eff07['limit'](_0x1fc766['limit']);if(_0x1fc766[_0xf0ab('0x2e')])_0x2eff07[_0xf0ab('0x2e')](_0x1fc766['offset']);return db['sequelize']['query'](_0x2eff07['toString'](),_0x148a72);})[_0xf0ab('0x21')](function(_0x12d9b6){if(_0x12d9b6[_0xf0ab('0x52')]>0x0)_0x26508b[_0xf0ab('0x83')](_0xf0ab('0xb5'),_['map'](_0x12d9b6,'id'));return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x26508b[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x84eab9){var _0x27cd98=_[_0xf0ab('0xb6')](_0x84eab9,'ChatInteractionId');var _0x16dca7=[];_0x12d9b6[_0xf0ab('0x44')](function(_0x39633a){_0x16dca7[_0xf0ab('0x45')](updateChatInteraction(_0x39633a,_0x577c85,_0x27cd98));});return BPromise[_0xf0ab('0xb7')](_0x16dca7);});});})[_0xf0ab('0x21')](function(_0x527a4b){_0x4bbdf6[_0xf0ab('0xb8')]=_0x527a4b;return _0x4bbdf6;})[_0xf0ab('0x21')](respondWithFilteredResult(_0x4e6c41,_0x1fc766))[_0xf0ab('0x46')](handleError(_0x4e6c41,null));};exports[_0xf0ab('0xb9')]=function(_0x4ca7a3,_0x426419){var _0x395bf6={'raw':![],'where':{'id':_0x4ca7a3['params']['id']}},_0x5b7744={};_0x5b7744[_0xf0ab('0x4b')]=_[_0xf0ab('0x4d')](db[_0xf0ab('0xa1')][_0xf0ab('0x47')]);_0x5b7744[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4ca7a3[_0xf0ab('0x4c')]);_0x5b7744[_0xf0ab('0x4e')]=_['intersection'](_0x5b7744[_0xf0ab('0x4b')],_0x5b7744['query']);_0x395bf6['attributes']=_[_0xf0ab('0x4f')](_0x5b7744[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x395bf6[_0xf0ab('0x51')]=_0x395bf6[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x395bf6['attributes']:_0x5b7744[_0xf0ab('0x4b')];if(_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x395bf6[_0xf0ab('0xbb')]=[{'all':!![]}];}_0x395bf6=_[_0xf0ab('0x39')]({},_0x395bf6,_0x4ca7a3[_0xf0ab('0xbc')]);return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')](_0x395bf6)[_0xf0ab('0x21')](handleEntityNotFound(_0x426419,null))[_0xf0ab('0x21')](respondWithResult(_0x426419,null))['catch'](handleError(_0x426419,null));};exports['create']=function(_0x58946c,_0x2f339d){return db['ChatInteraction']['create'](_0x58946c[_0xf0ab('0x3a')],{})[_0xf0ab('0x21')](respondWithResult(_0x2f339d,0xc9))[_0xf0ab('0x46')](handleError(_0x2f339d,null));};exports[_0xf0ab('0x33')]=function(_0xdf495,_0x55a296){if(_0xdf495[_0xf0ab('0x3a')]['id']){delete _0xdf495[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0xdf495[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x55a296,null))[_0xf0ab('0x21')](saveUpdates(_0xdf495[_0xf0ab('0x3a')],null))['then'](respondWithResult(_0x55a296,null))[_0xf0ab('0x46')](handleError(_0x55a296,null));};exports['destroy']=function(_0x3c1a2c,_0x17a3b6){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3c1a2c[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x17a3b6,null))[_0xf0ab('0x21')](removeEntity(_0x17a3b6,null))[_0xf0ab('0x46')](handleError(_0x17a3b6,null));};exports[_0xf0ab('0xbe')]=function(_0x1f2efa,_0x1d12fb){return db[_0xf0ab('0xa1')]['describe']()[_0xf0ab('0x21')](respondWithResult(_0x1d12fb,null))[_0xf0ab('0x46')](handleError(_0x1d12fb,null));};exports['createVidaooSession']=function(_0x35486d,_0x3f5ade){var _0x135a10=_0x35486d[_0xf0ab('0xbd')]['id'];var _0x48fc7e;var _0x5f55d2;var _0x7c7c3b;return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x135a10}})[_0xf0ab('0x21')](function(_0x2beaaa){_0x48fc7e=_0x2beaaa;return db[_0xf0ab('0xbf')][_0xf0ab('0xc0')]({'where':{'id':_0x2beaaa[_0xf0ab('0x7f')]},'attributes':['id',_0xf0ab('0xc1'),'vidaooEscalation',_0xf0ab('0xc2'),'vidaooNote',_0xf0ab('0xc3')],'raw':!![]});})[_0xf0ab('0x21')](function(_0x354e18){if(_0x354e18&&_0x354e18['vidaooApiKey']&&_0x354e18[_0xf0ab('0xc4')]){_0x5f55d2=_0x354e18;var _0x2068d6={'interaction':{'id':_0x135a10},'agent':{'id':_0x35486d[_0xf0ab('0x9b')]['id'],'name':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x37')],'fullname':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x40')],'email':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]},'contact':_0x35486d['body']['contact'],'account':_0x35486d[_0xf0ab('0x3a')][_0xf0ab('0x3d')]};var _0x35b480={'rejectUnauthorized':![],'method':_0xf0ab('0xc6'),'url':_0xf0ab('0xc7'),'headers':{'X-APIKEY':_0x354e18[_0xf0ab('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]],'buttons':null,'topic':_0x5f55d2[_0xf0ab('0xc2')],'note':_[_0xf0ab('0xc8')](_0x5f55d2['vidaooNote'])?null:getMustacheRender(_0x5f55d2[_0xf0ab('0xc9')],_0x2068d6),'metadata':null},'redirect':_0xf0ab('0xca'),'json':!![]};try{if(!_[_0xf0ab('0xc8')](_0x5f55d2[_0xf0ab('0xc3')])){var _0x41e2d8=getMustacheRender(_0x5f55d2[_0xf0ab('0xc3')],_0x2068d6);var _0x57f44d=JSON[_0xf0ab('0x81')](_0x41e2d8);_0x35b480[_0xf0ab('0x3a')][_0xf0ab('0xcb')]=_0x57f44d;}}catch(_0x533b37){throw new db[(_0xf0ab('0xcc'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35b480);}else{throw new db[(_0xf0ab('0xcc'))][(_0xf0ab('0xcd'))](_0xf0ab('0xce'));}})['then'](function(_0x1697ca){_0x7c7c3b=_0x1697ca;if(_0x7c7c3b['id']){var _0x15da8a={'body':_0x7c7c3b[_0xf0ab('0xcf')],'ChatWebsiteId':_0x5f55d2['id'],'ChatInteractionId':_0x48fc7e['id'],'direction':'out','UserId':_0x35486d[_0xf0ab('0x9b')]['id']};return db[_0xf0ab('0xd0')][_0xf0ab('0xd1')](_0x15da8a,{});}else{throw new db['Sequelize'][(_0xf0ab('0xcd'))](_0xf0ab('0xd2'));}})[_0xf0ab('0x21')](function(){return _0x48fc7e[_0xf0ab('0xd3')]({'vidaooSessionId':_0x7c7c3b['id']});})[_0xf0ab('0x21')](respondWithResult(_0x3f5ade,null))[_0xf0ab('0x46')](handleError(_0x3f5ade,null));};exports[_0xf0ab('0xd4')]=function(_0x115e3d,_0x2d0f9c){if(_0x115e3d[_0xf0ab('0x3a')]['id']){delete _0x115e3d[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x115e3d[_0xf0ab('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x2d0f9c,null))[_0xf0ab('0x21')](saveUpdates(_0x115e3d['body'],null))[_0xf0ab('0x21')](respondWithResult(_0x2d0f9c,null))['catch'](handleError(_0x2d0f9c,null));};exports[_0xf0ab('0xd5')]=function(_0x1e9768,_0x4398a3,_0x4195d9){if(_0x1e9768[_0xf0ab('0x3a')]['id']){delete _0x1e9768[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x1e9768[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](function(_0x5f10a5){if(!_0x5f10a5){logger[_0xf0ab('0x28')](_0xf0ab('0xd6'),_0xf0ab('0xd5'),0x194,_0xf0ab('0xd7'));_0x4398a3[_0xf0ab('0x2b')](0x194);}else{if(_0x5f10a5[_0xf0ab('0x7b')]){throw new db['Sequelize']['ValidationError'](_0xf0ab('0xd8'));}}return _0x5f10a5;})[_0xf0ab('0x21')](function(_0x564124){if(_0x564124){return _0x564124[_0xf0ab('0x33')]({'closed':_0x1e9768[_0xf0ab('0x3a')][_0xf0ab('0xd9')],'disposition':_0x1e9768['body'][_0xf0ab('0xda')]})[_0xf0ab('0x21')](function(_0x2d9046){return _0x2d9046;});}})[_0xf0ab('0x21')](function(_0x4e5f1e){return respondWithRpcPromise(_0xf0ab('0xdb'),_0xf0ab('0xd5'),_0x1e9768[_0xf0ab('0x3a')],client9004);})['then'](respondWithResult(_0x4398a3,null))['catch'](handleError(_0x4398a3,null));};exports['attachmentUpload']=function(_0x581cb1,_0x22251d,_0x2b5993){_0x581cb1[_0xf0ab('0x3a')]['name']=_0x581cb1[_0xf0ab('0xdc')]['originalname'];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0xdd')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xde')];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0x49')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xdf')];return db[_0xf0ab('0xe0')][_0xf0ab('0xd1')](_0x581cb1[_0xf0ab('0x3a')])[_0xf0ab('0x21')](respondWithResult(_0x22251d,0xc9))[_0xf0ab('0x46')](handleError(_0x22251d,null));};exports[_0xf0ab('0xe1')]=function(_0x4d09bf,_0x415b9d,_0x11ed58){return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x4d09bf[_0xf0ab('0xbd')]['id']},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null))[_0xf0ab('0x21')](function(_0x278e32){if(_0x278e32){if(_0x278e32['closed']){return _0x415b9d[_0xf0ab('0x2c')](0x193)[_0xf0ab('0x2d')]({'status':0x193,'message':_0xf0ab('0xe2')});}return db[_0xf0ab('0xe0')][_0xf0ab('0xc0')]({'where':{'id':_0x4d09bf[_0xf0ab('0x4c')][_0xf0ab('0xe3')]},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null));}})['then'](function(_0xadae03){if(_0xadae03){var _0x550b00=_0xadae03[_0xf0ab('0xe4')]!==null;var _0x2bfb6a=path[_0xf0ab('0xe5')](config['root'],_0xf0ab('0xe6'));if(_0x550b00){_0x2bfb6a=path[_0xf0ab('0xe5')](_0x2bfb6a,'offline-chat/');}var _0x5d62e4=path['join'](_0x2bfb6a,_0xadae03['basename']);return _0x415b9d[_0xf0ab('0xe7')](_0x5d62e4);}})['catch'](handleError(_0x415b9d,null));};exports['close']=function(_0x3b8bbe,_0x7e24c4){var _0x2d0ea3=null;var _0x4a18ad=null;var _0x57aaae=null;var _0x2ab0be=null;if(_0x3b8bbe[_0xf0ab('0x3a')]['id']){delete _0x3b8bbe['body']['id'];}if(_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')]){_0x2ab0be=path['join'](config['root'],'server/files/chat/upload/',util[_0xf0ab('0xe9')](_0xf0ab('0xea'),Date[_0xf0ab('0xeb')]()));_0x3b8bbe[_0xf0ab('0x3a')]['pathTranscript']=_0x2ab0be;}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x3b8bbe['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xf0ab('0xec')],'as':'User'}]}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x7e24c4,null))[_0xf0ab('0x21')](saveUpdates(_0x3b8bbe[_0xf0ab('0x3a')],null))[_0xf0ab('0x21')](function(_0x116c84){if(_0x116c84){_0x2d0ea3=_0x116c84;return db[_0xf0ab('0xbf')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3[_0xf0ab('0x7f')]}});}})[_0xf0ab('0x21')](function(_0x1d6e15){if(_0x1d6e15){_0x57aaae=_0x1d6e15;return db[_0xf0ab('0xed')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3['ContactId']}});}})[_0xf0ab('0x21')](function(_0x29427c){if(_0x29427c){_0x4a18ad=_0x29427c;if(_0x2ab0be){var _0x29d4a1=null;for(var _0x50e996=0x1;_0x50e996<_0x2d0ea3['Messages'][_0xf0ab('0x52')];++_0x50e996){_0x29d4a1=_0x2d0ea3[_0xf0ab('0xee')][_0x50e996];var _0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');var _0xc1537e=_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xf2')]||util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0xf0ab('0xf3'),_0x29d4a1[_0xf0ab('0x75')]);switch(_0x57aaae[_0xf0ab('0xf4')]){case _0xf0ab('0xf5'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae['agentAlias'],_0x29d4a1[_0xf0ab('0x7b')]):'System';break;case _0xf0ab('0xf6'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0xf7')]||_0x29d4a1['User'][_0xf0ab('0x40')]:'System';break;case'agent_fullname':_0x8e04bb=_0x29d4a1['UserId']?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0x40')]:_0xf0ab('0xf1');break;default:_0x8e04bb=_0x29d4a1['UserId']?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');}var _0x2c39f0=util[_0xf0ab('0xe9')](_0xf0ab('0xf8'),moment(_0x29d4a1[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0xfa')),_0x29d4a1[_0xf0ab('0xfb')]==='in'?_0xc1537e:_0x8e04bb,_0x29d4a1['body']);if(!_0x29d4a1[_0xf0ab('0xfc')]){fs[_0xf0ab('0xfd')](_0x2ab0be,_0x2c39f0);}}return db[_0xf0ab('0xfe')][_0xf0ab('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf0ab('0xff'),'raw':!![]}]});}}})['then'](function(_0x21eb2b){if(_0x21eb2b&&_0x21eb2b['Smtp']&&_0x3b8bbe[_0xf0ab('0x3a')]){var _0x262659={'tls':{'rejectUnauthorized':![]}};if(_0x21eb2b['Smtp'][_0xf0ab('0x100')]){_0x262659[_0xf0ab('0x100')]=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x100')];}else{_0x262659[_0xf0ab('0x101')]=_0x21eb2b['Smtp'][_0xf0ab('0x101')];_0x262659[_0xf0ab('0x102')]=_0x21eb2b[_0xf0ab('0xff')]['port'];_0x262659['secure']=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x103')];}if(_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x104')]){_0x262659['auth']={'user':_0x21eb2b['Smtp'][_0xf0ab('0x9b')],'pass':_0x21eb2b[_0xf0ab('0xff')]['pass']};}return respondWithRpcPromise('SendMail',_0xf0ab('0x105'),{'account':_0x262659,'message':{'from':util['format'](_0xf0ab('0x106'),_0x21eb2b['name'],_0x21eb2b[_0xf0ab('0xc5')]||_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x9b')]),'to':_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')],'subject':_0xf0ab('0x107'),'text':util[_0xf0ab('0xe9')](_0xf0ab('0x108'),_0x3b8bbe['body'][_0xf0ab('0xe8')]),'attachments':[{'path':_0x2ab0be}]}})[_0xf0ab('0x21')](function(){return _0x2d0ea3;})[_0xf0ab('0x46')](function(_0x15f041){console[_0xf0ab('0x28')](_0x15f041);});}else{return _0x2d0ea3;}})['then'](respondWithStatusCode(_0x7e24c4,0xc8))[_0xf0ab('0x46')](handleError(_0x7e24c4,null));};exports[_0xf0ab('0x109')]=function(_0x5eda4b,_0x57a8ab,_0x3cee1d){return db[_0xf0ab('0xd0')][_0xf0ab('0x6c')]({'where':{'id':_0x5eda4b[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x57a8ab,null))[_0xf0ab('0x21')](function(_0x4dff6e){if(_0x4dff6e){return _0x4dff6e[_0xf0ab('0x109')](_0x5eda4b[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_[_0xf0ab('0x10b')](_0x5eda4b[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x57a8ab,null))[_0xf0ab('0x46')](handleError(_0x57a8ab,null));};exports['getMessages']=function(_0x283bf5,_0x1afcea,_0x22a9f8){var _0x33dbfc={'raw':![],'where':{}};var _0x487318={};var _0x546e13={'count':0x0,'rows':[]};return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x283bf5[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x1afcea,null))[_0xf0ab('0x21')](function(_0xa3b903){if(_0xa3b903){_0x487318['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x487318[_0xf0ab('0x4c')]=_['keys'](_0x283bf5[_0xf0ab('0x4c')]);_0x487318[_0xf0ab('0x4e')]=_['intersection'](_0x487318[_0xf0ab('0x4b')],_0x487318[_0xf0ab('0x4c')]);_0x33dbfc[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x487318[_0xf0ab('0x4b')],qs['fields'](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x33dbfc[_0xf0ab('0x51')]=_0x33dbfc['attributes'][_0xf0ab('0x52')]?_0x33dbfc[_0xf0ab('0x51')]:_0x487318[_0xf0ab('0x4b')];if(!_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x33dbfc[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x33dbfc['offset']=qs['offset'](_0x283bf5[_0xf0ab('0x4c')]['offset']);}_0x33dbfc['order']=qs[_0xf0ab('0x56')](_0x283bf5[_0xf0ab('0x4c')]['sort']);_0x33dbfc[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x283bf5['query'],_0x487318[_0xf0ab('0x4e')]));_0x33dbfc['where'][_0xf0ab('0x10d')]=_0xa3b903['id'];if(_0x283bf5['query'][_0xf0ab('0x8d')]){_0x33dbfc[_0xf0ab('0x83')]=_[_0xf0ab('0x39')](_0x33dbfc['where'],{'$or':_[_0xf0ab('0x3f')](_0x33dbfc[_0xf0ab('0x51')],function(_0x2ddc1d){var _0x3cef14={};_0x3cef14[_0x2ddc1d]={'$like':'%'+_0x283bf5['query'][_0xf0ab('0x8d')]+'%'};return _0x3cef14;})});}if(_0x283bf5[_0xf0ab('0x4c')]['$gte']){var _0x38ea18=_0x283bf5[_0xf0ab('0x4c')]['$gte']['split'](',');var _0x7ee6b3={};_0x7ee6b3[_0x38ea18[0x0]]={'$gte':moment(_0x38ea18[0x1])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))};_0x33dbfc['where']=_[_0xf0ab('0x39')](_0x33dbfc['where'],_0x7ee6b3);}_0x33dbfc=_[_0xf0ab('0x39')]({},_0x33dbfc,_0x283bf5['options']);return db[_0xf0ab('0xd0')]['count']({'where':_0x33dbfc['where']})['then'](function(_0x1d1451){_0x546e13['count']=_0x1d1451;if(_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x33dbfc[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x33dbfc);})['then'](function(_0x16a1d2){_0x546e13[_0xf0ab('0xb8')]=_0x16a1d2;return _0x546e13;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x1afcea,_0x33dbfc))[_0xf0ab('0x46')](handleError(_0x1afcea,null));};exports[_0xf0ab('0x110')]=function(_0x4b91de,_0x3a602f,_0x47788a){var _0x3592f1={'where':{}},_0x577f13={},_0x2f99c2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf0ab('0xc0')]({'where':{'id':_0x4b91de[_0xf0ab('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3a602f,null))['then'](function(_0x43c6b8){if(_0x43c6b8){_0x577f13['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x577f13[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4b91de[_0xf0ab('0x4c')]);_0x577f13['filters']=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],_0x577f13[_0xf0ab('0x4c')]);_0x3592f1[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4b91de['query'][_0xf0ab('0x50')]));_0x3592f1[_0xf0ab('0x51')]=_0x3592f1['attributes'][_0xf0ab('0x52')]?_0x3592f1['attributes']:_0x577f13[_0xf0ab('0x4b')];if(!_0x4b91de['query']['hasOwnProperty']('nolimit')){_0x3592f1[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x3592f1[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x3592f1[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x3592f1[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x4b91de[_0xf0ab('0x4c')],_0x577f13[_0xf0ab('0x4e')]));_0x3592f1['where'][_0xf0ab('0x10d')]=_0x43c6b8['id'];if(_0x4b91de['query'][_0xf0ab('0x8d')]){_0x3592f1['where']=_[_0xf0ab('0x39')](_0x3592f1[_0xf0ab('0x83')],{'$or':_[_0xf0ab('0x3f')](_0x3592f1['attributes'],function(_0x58f64c){var _0x5dc7d4={};_0x5dc7d4[_0x58f64c]={'$like':'%'+_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x8d')]+'%'};return _0x5dc7d4;})});}_0x3592f1['where'][_0xf0ab('0xfc')]=![];if(_0x4b91de[_0xf0ab('0x4c')]['id']){_0x3592f1[_0xf0ab('0x83')]['id']={'$gt':_0x4b91de[_0xf0ab('0x4c')]['id']};}_0x3592f1=_['merge']({},_0x3592f1,_0x4b91de['options']);return db[_0xf0ab('0xd0')][_0xf0ab('0x31')]({'where':_0x3592f1[_0xf0ab('0x83')]})[_0xf0ab('0x21')](function(_0x2ab983){_0x2f99c2['count']=_0x2ab983;_0x3592f1[_0xf0ab('0xbb')]=[];if(_0x4b91de['query'][_0xf0ab('0x111')]){_0x3592f1[_0xf0ab('0xbb')][_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id',_0xf0ab('0x40'),_0xf0ab('0xf7')]});}if(_0x4b91de[_0xf0ab('0x4c')]['includeAll']){_0x3592f1[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x3592f1);})[_0xf0ab('0x21')](function(_0x3d70c0){_0x2f99c2[_0xf0ab('0xb8')]=_0x3d70c0;return _0x2f99c2;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x3a602f,_0x3592f1))[_0xf0ab('0x46')](handleError(_0x3a602f,null));};exports['addTags']=function(_0x4d10af,_0x5cf4bd,_0x368523){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x4d10af['params']['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x5cf4bd,null))[_0xf0ab('0x21')](function(_0x46a38a){if(_0x46a38a){return _0x46a38a[_0xf0ab('0x112')](_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_['omit'](_0x4d10af[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{})[_0xf0ab('0x113')](function(){return db['Tag'][_0xf0ab('0x10f')]({'attributes':['id',_0xf0ab('0x37'),_0xf0ab('0x59')],'where':{'id':_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')]}});})[_0xf0ab('0x21')](function(_0x1df97b){socket[_0xf0ab('0x114')](_0xf0ab('0x115'),{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]});return{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]};});}})[_0xf0ab('0x21')](respondWithResult(_0x5cf4bd,null))['catch'](handleError(_0x5cf4bd,null));};exports[_0xf0ab('0x116')]=function(_0x3ca465,_0x4e379d,_0x122e66){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3ca465[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x4e379d,null))[_0xf0ab('0x21')](function(_0x5c56e0){if(_0x5c56e0){return _0x5c56e0[_0xf0ab('0x116')](_0x3ca465[_0xf0ab('0x4c')][_0xf0ab('0x10a')]);}})['then'](respondWithStatusCode(_0x4e379d,null))[_0xf0ab('0x46')](handleError(_0x4e379d,null));};exports[_0xf0ab('0xe7')]=function(_0x2baa40,_0x4ff52d){var _0x2a2fea=moment()[_0xf0ab('0x117')]()[_0xf0ab('0xa0')]();var _0x4eccbd=path['join'](config['root'],_0xf0ab('0x118'),_0xf0ab('0x119'),_0xf0ab('0x11a'));var _0x5b6475=path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],'server',_0xf0ab('0x119'),_0xf0ab('0x11c'));var _0x595bda=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2a2fea);var _0x2bd3e3=util['format']('transcript-%d-%s.zip',_0x2baa40[_0xf0ab('0xbd')]['id'],_0x2a2fea);var _0x25242e=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2bd3e3);var _0x3d8794=[];_0x3d8794[_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id','fullname'],'raw':!![]});_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xed')],'as':_0xf0ab('0x70'),'attributes':['id','firstName',_0xf0ab('0x11d')],'raw':!![]});if(_0x2baa40[_0xf0ab('0x4c')][_0xf0ab('0x11c')]){_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xe0')],'as':'Attachment','raw':!![]});}var _0x243763=[{'model':db[_0xf0ab('0xd0')],'as':_0xf0ab('0xee'),'attributes':['id',_0xf0ab('0x3a'),'createdAt',_0xf0ab('0xfb'),_0xf0ab('0xfc'),_0xf0ab('0x88')],'include':_0x3d8794}];_0x243763['push']({'model':db[_0xf0ab('0xbf')],'as':_0xf0ab('0x11e'),'attributes':['id',_0xf0ab('0x37')]});_0x243763['push']({'model':db[_0xf0ab('0xec')],'as':_0xf0ab('0x11f'),'attributes':['id',_0xf0ab('0x40')]});return db[_0xf0ab('0xa1')]['find']({'where':{'id':_0x2baa40[_0xf0ab('0xbd')]['id']},'include':_0x243763})[_0xf0ab('0x21')](handleEntityNotFound(_0x4ff52d,null))[_0xf0ab('0x21')](function(_0x2c2e20){if(_0x2c2e20){var _0x57bd77=_0x2c2e20[_0xf0ab('0x120')]({'plain':!![]});fs[_0xf0ab('0x121')](_0x595bda);var _0x169b02={'channel':_0xf0ab('0x122'),'account':_0x57bd77[_0xf0ab('0x11e')]['name'],'agent':_0x57bd77[_0xf0ab('0x11f')]?_0x57bd77['Owner'][_0xf0ab('0x40')]:_0xf0ab('0x123'),'createdAt':moment(_0x57bd77[_0xf0ab('0xf9')])['format'](_0xf0ab('0x10e'))['toString'](),'closedAt':_0x57bd77['closed']?moment(_0x57bd77['closedAt'])[_0xf0ab('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x57bd77[_0xf0ab('0xda')],'chatInfo':{'browser':_0x57bd77[_0xf0ab('0x124')],'os':_0x57bd77[_0xf0ab('0x125')],'referer':_0x57bd77[_0xf0ab('0x126')],'customerIp':_0x57bd77[_0xf0ab('0x127')],'customerPort':_0x57bd77['customerPort']?_0x57bd77[_0xf0ab('0x128')]:_0xf0ab('0x123')},'messages':_(_0x57bd77['Messages'])[_0xf0ab('0x129')]()[_0xf0ab('0x8d')]({'secret':![]})[_0xf0ab('0x3f')](function(_0x2aa512){if(_0x2aa512['Attachment']){var _0x26009e=path[_0xf0ab('0xe5')](_0x5b6475,_0x2aa512['Attachment'][_0xf0ab('0xdd')]);if(fs[_0xf0ab('0x12a')](_0x26009e)){fs['createReadStream'](_0x26009e)[_0xf0ab('0x12b')](fs[_0xf0ab('0x12c')](path['join'](_0x595bda,_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')])));}}return{'date':moment(_0x2aa512[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))['toString'](),'sender':_0x2aa512[_0xf0ab('0xfb')]==='out'?_0x2aa512[_0xf0ab('0xec')]?_0x2aa512['User'][_0xf0ab('0x40')]:_0xf0ab('0xf1'):_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x12d')]+(_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x11d')]?'\x20'+_0x2aa512[_0xf0ab('0x70')]['lastName']:''),'body':_0x2aa512[_0xf0ab('0xe0')]?_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')]:_0x2aa512[_0xf0ab('0x3a')],'direction':_0x2aa512[_0xf0ab('0xfb')]==='out'?'A':'C','secret':_0x2aa512[_0xf0ab('0xfc')],'read':_0x2aa512[_0xf0ab('0x88')],'attachment':_0x2aa512[_0xf0ab('0xe0')]};})[_0xf0ab('0x72')]()};return ejs['renderFile'](path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],_0xf0ab('0x118'),_0xf0ab('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x169b02})['then'](function(_0x3ad886){var _0x3df4a2=path['join'](_0x595bda,'transcript-'+_0x57bd77['id']+'-'+_0x2a2fea+_0xf0ab('0x12f'));var _0x378d44={'path':_0x3df4a2,'channel':_0xf0ab('0x122'),'interactionId':_0x57bd77['id']};return pdf[_0xf0ab('0x130')](_0x3ad886,_0x378d44);})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x1e4acb,_0x25a1eb){zipdir(_0x595bda,{'saveTo':_0x25242e},function(_0x406090,_0x414d09){if(_0x406090)return _0x25a1eb(_0x406090);return _0x1e4acb(_0x414d09);});})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x235528,_0x581c80){rimraf(_0x595bda,function(_0x14332a){if(_0x14332a)_0x581c80(_0x14332a);return _0x235528();});});})[_0xf0ab('0x21')](function(){return _0x4ff52d[_0xf0ab('0xe7')](_0x25242e,_0x2bd3e3,function(_0x4f9211){if(_0x4f9211){console[_0xf0ab('0x131')](_0xf0ab('0x132'),_0x4f9211);}else{fs[_0xf0ab('0x133')](_0x25242e);}});});});}else{return _0x4ff52d['sendStatus'](0xc8);}})[_0xf0ab('0x46')](handleError(_0x4ff52d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d2c0006..bb60c0a 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 _0x4804=['save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x8e74c4,_0x4c3b72){var _0x50e53f=function(_0x2a4eef){while(--_0x2a4eef){_0x8e74c4['push'](_0x8e74c4['shift']());}};_0x50e53f(++_0x4c3b72);}(_0x4804,0x15b));var _0x4480=function(_0x531598,_0x3db452){_0x531598=_0x531598-0x0;var _0x47be54=_0x4804[_0x531598];return _0x47be54;};'use strict';var EventEmitter=require(_0x4480('0x0'));var ChatInteraction=require(_0x4480('0x1'))['db'][_0x4480('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x4480('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4480('0x4')](0x0);var events={'afterCreate':_0x4480('0x5'),'afterUpdate':_0x4480('0x6'),'afterDestroy':_0x4480('0x7')};function emitEvent(_0x386300){return function(_0x5ad808,_0x8a023e,_0x16e840){_0x5ad808['getUsers']({'attributes':['id'],'raw':!![]})[_0x4480('0x8')](function(_0x1d8d1c){_0x5ad808[_0x4480('0x9')](_0x4480('0xa'),_0x1d8d1c['map'](function(_0x5508c7){return{'id':_0x5508c7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5ad808['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4480('0x8')](function(_0x2587c3){_0x5ad808[_0x4480('0x9')](_0x4480('0xb'),_0x2587c3[_0x4480('0xc')]);ChatInteractionEvents[_0x4480('0xd')](_0x386300+':'+_0x5ad808['id'],_0x5ad808);ChatInteractionEvents[_0x4480('0xd')](_0x386300,_0x5ad808);_0x16e840(null);})[_0x4480('0xe')](_0x16e840(null));};}for(var e in events){if(events[_0x4480('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x5896=['save','remove','getUsers','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x3a512f,_0x1d792e){var _0x1914c8=function(_0x1403da){while(--_0x1403da){_0x3a512f['push'](_0x3a512f['shift']());}};_0x1914c8(++_0x1d792e);}(_0x5896,0x16b));var _0x6589=function(_0x2ae293,_0x554e92){_0x2ae293=_0x2ae293-0x0;var _0x39fb6d=_0x5896[_0x2ae293];return _0x39fb6d;};'use strict';var EventEmitter=require(_0x6589('0x0'));var ChatInteraction=require(_0x6589('0x1'))['db'][_0x6589('0x2')];var ChatMessage=require(_0x6589('0x1'))['db'][_0x6589('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6589('0x4')](0x0);var events={'afterCreate':_0x6589('0x5'),'afterUpdate':'update','afterDestroy':_0x6589('0x6')};function emitEvent(_0x49b6e8){return function(_0x211f8f,_0x27a152,_0x27e5df){_0x211f8f[_0x6589('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xde4003){_0x211f8f[_0x6589('0x8')]('Users',_0xde4003[_0x6589('0x9')](function(_0x36e11a){return{'id':_0x36e11a['id']};}));return ChatMessage[_0x6589('0xa')]({'where':{'ChatInteractionId':_0x211f8f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3d336d){_0x211f8f[_0x6589('0x8')](_0x6589('0xb'),_0x3d336d[_0x6589('0xc')]);ChatInteractionEvents['emit'](_0x49b6e8+':'+_0x211f8f['id'],_0x211f8f);ChatInteractionEvents[_0x6589('0xd')](_0x49b6e8,_0x211f8f);_0x27e5df(null);})[_0x6589('0xe')](_0x27e5df(null));};}for(var e in events){if(events[_0x6589('0xf')](e)){var event=events[e];ChatInteraction['hook'](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 2b15116..d080fe1 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 _0xd0d2=['utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5ad781,_0x27573a){var _0x82d137=function(_0x4369e2){while(--_0x4369e2){_0x5ad781['push'](_0x5ad781['shift']());}};_0x82d137(++_0x27573a);}(_0xd0d2,0x191));var _0x2d0d=function(_0x585e84,_0x1d8489){_0x585e84=_0x585e84-0x0;var _0x39f3c4=_0xd0d2[_0x585e84];return _0x39f3c4;};'use strict';var _=require(_0x2d0d('0x0'));var util=require(_0x2d0d('0x1'));var logger=require(_0x2d0d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d0d('0x3'));var fs=require('fs');var path=require(_0x2d0d('0x4'));var rimraf=require(_0x2d0d('0x5'));var config=require(_0x2d0d('0x6'));var attributes=require(_0x2d0d('0x7'));module[_0x2d0d('0x8')]=function(_0x50e279,_0xa3fc37){return _0x50e279['define'](_0x2d0d('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eb451,_0x5875a8,_0x3163e6){if(_0x3eb451[_0x2d0d('0xa')](_0x2d0d('0xb'))){_0x3eb451[_0x2d0d('0xc')]=moment()[_0x2d0d('0xd')](_0x2d0d('0xe'));}_0x3163e6(null,_0x3eb451);}},'charset':'utf8mb4','collate':_0x2d0d('0xf')});};
\ No newline at end of file
+var _0x2f1e=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x2f1e,0xce));var _0xe2f1=function(_0x59db37,_0x14464c){_0x59db37=_0x59db37-0x0;var _0x3a4d97=_0x2f1e[_0x59db37];return _0x3a4d97;};'use strict';var _=require(_0xe2f1('0x0'));var util=require(_0xe2f1('0x1'));var logger=require(_0xe2f1('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe2f1('0x3'));var rp=require(_0xe2f1('0x4'));var fs=require('fs');var path=require(_0xe2f1('0x5'));var rimraf=require(_0xe2f1('0x6'));var config=require(_0xe2f1('0x7'));var attributes=require(_0xe2f1('0x8'));module[_0xe2f1('0x9')]=function(_0x14fd36,_0x4771a2){return _0x14fd36[_0xe2f1('0xa')](_0xe2f1('0xb'),attributes,{'tableName':_0xe2f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cea84,_0x433a0a,_0x37ea65){if(_0x3cea84[_0xe2f1('0xd')](_0xe2f1('0xe'))){_0x3cea84[_0xe2f1('0xf')]=moment()[_0xe2f1('0x10')](_0xe2f1('0x11'));}_0x37ea65(null,_0x3cea84);}},'charset':_0xe2f1('0x12'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 180c7bc..5db4c1d 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 _0x062b=['catch','ChatInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','UpdateChatInteraction','update','options','raw','where','attributes','limit'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x062b,0xdf));var _0xb062=function(_0x62628,_0x35b586){_0x62628=_0x62628-0x0;var _0x50c4f4=_0x062b[_0x62628];return _0x50c4f4;};'use strict';var _=require(_0xb062('0x0'));var util=require(_0xb062('0x1'));var moment=require(_0xb062('0x2'));var BPromise=require('bluebird');var rs=require(_0xb062('0x3'));var fs=require('fs');var Redis=require(_0xb062('0x4'));var db=require(_0xb062('0x5'))['db'];var utils=require(_0xb062('0x6'));var logger=require(_0xb062('0x7'))(_0xb062('0x8'));var config=require(_0xb062('0x9'));var jayson=require(_0xb062('0xa'));var client=jayson[_0xb062('0xb')][_0xb062('0xc')]({'port':0x232a});config[_0xb062('0xd')]=_[_0xb062('0xe')](config[_0xb062('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb062('0xd')]));require(_0xb062('0xf'))[_0xb062('0x10')](socket);function respondWithRpcPromise(_0x52f824,_0x26b15f,_0x298a4b){return new BPromise(function(_0x30719a,_0x516d96){return client[_0xb062('0x11')](_0x52f824,_0x298a4b)[_0xb062('0x12')](function(_0x5ae9c8){logger['info'](_0xb062('0x13'),_0x26b15f,'request\x20sent');logger[_0xb062('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x26b15f,_0xb062('0x15'),JSON[_0xb062('0x16')](_0x5ae9c8));if(_0x5ae9c8[_0xb062('0x17')]){if(_0x5ae9c8[_0xb062('0x17')][_0xb062('0x18')]===0x1f4){logger[_0xb062('0x17')](_0xb062('0x13'),_0x26b15f,_0x5ae9c8[_0xb062('0x17')][_0xb062('0x19')]);return _0x516d96(_0x5ae9c8['error'][_0xb062('0x19')]);}logger[_0xb062('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x26b15f,_0x5ae9c8[_0xb062('0x17')]['message']);return _0x30719a(_0x5ae9c8[_0xb062('0x17')][_0xb062('0x19')]);}else{logger[_0xb062('0x1a')](_0xb062('0x13'),_0x26b15f,'request\x20sent');_0x30719a(_0x5ae9c8[_0xb062('0x1b')][_0xb062('0x19')]);}})['catch'](function(_0x2501ca){logger[_0xb062('0x17')](_0xb062('0x13'),_0x26b15f,_0x2501ca);_0x516d96(_0x2501ca);});});}exports[_0xb062('0x1c')]=function(_0x9a68f0){var _0x3eb4ad=this;return new Promise(function(_0x3c3356,_0x496f7f){return db['ChatInteraction'][_0xb062('0x1d')](_0x9a68f0['body'],{'raw':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x20')]||null:null,'attributes':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x21')]||null:null,'limit':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0['options'][_0xb062('0x22')]||null:null})[_0xb062('0x12')](function(_0x7bc93a){logger['info'](_0xb062('0x1c'),_0x9a68f0);logger['debug'](_0xb062('0x1c'),_0x9a68f0,JSON['stringify'](_0x7bc93a));_0x3c3356(_0x7bc93a);})[_0xb062('0x23')](function(_0x480b83){logger[_0xb062('0x17')](_0xb062('0x1c'),_0x480b83[_0xb062('0x19')],_0x9a68f0);_0x496f7f(_0x3eb4ad[_0xb062('0x17')](0x1f4,_0x480b83[_0xb062('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x460a96){return new Promise(function(_0x2acca0,_0x23c8e9){return db[_0xb062('0x24')]['find']({'where':_0x460a96[_0xb062('0x1e')]?_0x460a96[_0xb062('0x1e')][_0xb062('0x20')]||null:null})[_0xb062('0x12')](function(_0x2ba9f0){if(_0x2ba9f0){return _0x2ba9f0[_0xb062('0x25')](_0x460a96[_0xb062('0x26')][_0xb062('0x27')],_[_0xb062('0x28')](_0x460a96[_0xb062('0x26')],[_0xb062('0x27'),'id'])||{});}})[_0xb062('0x29')](function(_0x4a0783){logger[_0xb062('0x1a')](_0xb062('0x2a'),_0x460a96);logger[_0xb062('0x14')](_0xb062('0x2a'),_0x460a96,JSON[_0xb062('0x16')](_0x4a0783));_0x2acca0(_0x4a0783);})[_0xb062('0x23')](function(_0xca353d){logger[_0xb062('0x17')](_0xb062('0x2a'),_0xca353d[_0xb062('0x19')],_0x460a96);_0x23c8e9(_this['error'](0x1f4,_0xca353d[_0xb062('0x19')]));});});};
\ No newline at end of file
+var _0x8a72=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','spread','AddTags','moment','bluebird','randomstring'];(function(_0x3c1861,_0x134353){var _0x2dfeff=function(_0x2817c8){while(--_0x2817c8){_0x3c1861['push'](_0x3c1861['shift']());}};_0x2dfeff(++_0x134353);}(_0x8a72,0xcf));var _0x28a7=function(_0x2aabab,_0x1c0121){_0x2aabab=_0x2aabab-0x0;var _0x38fdb9=_0x8a72[_0x2aabab];return _0x38fdb9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x28a7('0x0'));var BPromise=require(_0x28a7('0x1'));var rs=require(_0x28a7('0x2'));var fs=require('fs');var Redis=require(_0x28a7('0x3'));var db=require(_0x28a7('0x4'))['db'];var utils=require(_0x28a7('0x5'));var logger=require(_0x28a7('0x6'))('rpc');var config=require(_0x28a7('0x7'));var jayson=require(_0x28a7('0x8'));var client=jayson[_0x28a7('0x9')][_0x28a7('0xa')]({'port':0x232a});config['redis']=_[_0x28a7('0xb')](config[_0x28a7('0xc')],{'host':_0x28a7('0xd'),'port':0x18eb});var socket=require(_0x28a7('0xe'))(new Redis(config['redis']));require(_0x28a7('0xf'))['register'](socket);function respondWithRpcPromise(_0x5a39e8,_0x1efe69,_0x545c1d){return new BPromise(function(_0x13b015,_0x4cf537){return client['request'](_0x5a39e8,_0x545c1d)[_0x28a7('0x10')](function(_0x31a741){logger['info'](_0x28a7('0x11'),_0x1efe69,_0x28a7('0x12'));logger[_0x28a7('0x13')](_0x28a7('0x14'),_0x1efe69,_0x28a7('0x12'),JSON[_0x28a7('0x15')](_0x31a741));if(_0x31a741[_0x28a7('0x16')]){if(_0x31a741[_0x28a7('0x16')][_0x28a7('0x17')]===0x1f4){logger[_0x28a7('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x1efe69,_0x31a741[_0x28a7('0x16')][_0x28a7('0x18')]);return _0x4cf537(_0x31a741['error'][_0x28a7('0x18')]);}logger[_0x28a7('0x16')](_0x28a7('0x11'),_0x1efe69,_0x31a741[_0x28a7('0x16')][_0x28a7('0x18')]);return _0x13b015(_0x31a741[_0x28a7('0x16')]['message']);}else{logger[_0x28a7('0x19')](_0x28a7('0x11'),_0x1efe69,_0x28a7('0x12'));_0x13b015(_0x31a741[_0x28a7('0x1a')][_0x28a7('0x18')]);}})[_0x28a7('0x1b')](function(_0x333db6){logger[_0x28a7('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x1efe69,_0x333db6);_0x4cf537(_0x333db6);});});}exports[_0x28a7('0x1c')]=function(_0x1b81dd){var _0x460d4b=this;return new Promise(function(_0x45b1db,_0x432617){return db['ChatInteraction'][_0x28a7('0x1d')](_0x1b81dd[_0x28a7('0x1e')],{'raw':_0x1b81dd[_0x28a7('0x1f')]?_0x1b81dd[_0x28a7('0x1f')][_0x28a7('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b81dd[_0x28a7('0x1f')]?_0x1b81dd[_0x28a7('0x1f')][_0x28a7('0x21')]||null:null,'attributes':_0x1b81dd[_0x28a7('0x1f')]?_0x1b81dd['options'][_0x28a7('0x22')]||null:null,'limit':_0x1b81dd[_0x28a7('0x1f')]?_0x1b81dd[_0x28a7('0x1f')]['limit']||null:null})[_0x28a7('0x10')](function(_0xd01ada){logger['info']('UpdateChatInteraction',_0x1b81dd);logger[_0x28a7('0x13')](_0x28a7('0x1c'),_0x1b81dd,JSON[_0x28a7('0x15')](_0xd01ada));_0x45b1db(_0xd01ada);})[_0x28a7('0x1b')](function(_0x578189){logger['error'](_0x28a7('0x1c'),_0x578189[_0x28a7('0x18')],_0x1b81dd);_0x432617(_0x460d4b['error'](0x1f4,_0x578189[_0x28a7('0x18')]));});});};exports[_0x28a7('0x23')]=function(_0x1344ed){return new Promise(function(_0x1844c6,_0x4ad175){return db[_0x28a7('0x24')][_0x28a7('0x25')]({'where':_0x1344ed[_0x28a7('0x1f')]?_0x1344ed['options']['where']||null:null})[_0x28a7('0x10')](function(_0x37197d){if(_0x37197d){return _0x37197d[_0x28a7('0x26')](_0x1344ed['body'][_0x28a7('0x27')],_['omit'](_0x1344ed[_0x28a7('0x1e')],[_0x28a7('0x27'),'id'])||{});}})[_0x28a7('0x28')](function(_0x969f2a){logger['info'](_0x28a7('0x29'),_0x1344ed);logger[_0x28a7('0x13')](_0x28a7('0x29'),_0x1344ed,JSON[_0x28a7('0x15')](_0x969f2a));_0x1844c6(_0x969f2a);})[_0x28a7('0x1b')](function(_0x242e37){logger['error']('AddTags',_0x242e37[_0x28a7('0x18')],_0x1344ed);_0x4ad175(_this['error'](0x1f4,_0x242e37[_0x28a7('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b437a39..5185d15 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 _0xc86c=['removeListener','chatInteraction:','./chatInteraction.events','save','emit'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0xc86c,0x138));var _0xcc86=function(_0x42e03b,_0x110aea){_0x42e03b=_0x42e03b-0x0;var _0x3ba84b=_0xc86c[_0x42e03b];return _0x3ba84b;};'use strict';var ChatInteractionEvents=require(_0xcc86('0x0'));var events=[_0xcc86('0x1'),'remove','update'];function createListener(_0x3012b1,_0x3c4260){return function(_0x14639c){_0x3c4260[_0xcc86('0x2')](_0x3012b1,_0x14639c);};}function removeListener(_0x4ee129,_0x5d41db){return function(){ChatInteractionEvents[_0xcc86('0x3')](_0x4ee129,_0x5d41db);};}exports['register']=function(_0x55c925){for(var _0x1f39c4=0x0,_0x501fca=events['length'];_0x1f39c4<_0x501fca;_0x1f39c4++){var _0x2d301a=events[_0x1f39c4];var _0x2b08dd=createListener(_0xcc86('0x4')+_0x2d301a,_0x55c925);ChatInteractionEvents['on'](_0x2d301a,_0x2b08dd);}};
\ No newline at end of file
+var _0x1790=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x1f076d,_0xda472b){var _0x58f888=function(_0x502d6f){while(--_0x502d6f){_0x1f076d['push'](_0x1f076d['shift']());}};_0x58f888(++_0xda472b);}(_0x1790,0x11e));var _0x0179=function(_0x361185,_0x372570){_0x361185=_0x361185-0x0;var _0x3f1acb=_0x1790[_0x361185];return _0x3f1acb;};'use strict';var ChatInteractionEvents=require(_0x0179('0x0'));var events=[_0x0179('0x1'),'remove',_0x0179('0x2')];function createListener(_0x14261b,_0x3d721f){return function(_0x5ba01d){_0x3d721f[_0x0179('0x3')](_0x14261b,_0x5ba01d);};}function removeListener(_0x3bd152,_0x1082c8){return function(){ChatInteractionEvents[_0x0179('0x4')](_0x3bd152,_0x1082c8);};}exports[_0x0179('0x5')]=function(_0x36d212){for(var _0x3b310c=0x0,_0x43c0e7=events[_0x0179('0x6')];_0x3b310c<_0x43c0e7;_0x3b310c++){var _0x25f63e=events[_0x3b310c];var _0x20b2fd=createListener(_0x0179('0x7')+_0x25f63e,_0x36d212);ChatInteractionEvents['on'](_0x25f63e,_0x20b2fd);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 8ff7c7c..08f7111 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 _0xcaab=['diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession'];(function(_0x344d0a,_0x32bb71){var _0x58a652=function(_0xcda1a7){while(--_0xcda1a7){_0x344d0a['push'](_0x344d0a['shift']());}};_0x58a652(++_0x32bb71);}(_0xcaab,0x10b));var _0xbcaa=function(_0x3f30a5,_0x180083){_0x3f30a5=_0x3f30a5-0x0;var _0x18d972=_0xcaab[_0x3f30a5];return _0x18d972;};'use strict';var multer=require(_0xbcaa('0x0'));var util=require('util');var path=require(_0xbcaa('0x1'));var timeout=require('connect-timeout');var express=require(_0xbcaa('0x2'));var router=express[_0xbcaa('0x3')]();var fs_extra=require(_0xbcaa('0x4'));var auth=require(_0xbcaa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbcaa('0x6'));var controller=require(_0xbcaa('0x7'));router[_0xbcaa('0x8')]('/',auth[_0xbcaa('0x9')](),controller[_0xbcaa('0xa')]);router['get'](_0xbcaa('0xb'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0xc')]);router[_0xbcaa('0x8')](_0xbcaa('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xbcaa('0xe')]);router[_0xbcaa('0x8')](_0xbcaa('0xf'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x11')]);router[_0xbcaa('0x8')](_0xbcaa('0x12'),auth['isAuthenticated'](),controller[_0xbcaa('0x13')]);router[_0xbcaa('0x8')](_0xbcaa('0x14'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x15')]);router[_0xbcaa('0x8')](_0xbcaa('0x16'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x17')]);router['post']('/',auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x18')]);router[_0xbcaa('0x19')](_0xbcaa('0x1a'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x1b')]);var upload=multer({'storage':multer[_0xbcaa('0x1c')]({'destination':function(_0x1d7ddd,_0x486a75,_0x1377be){_0x1377be(null,path[_0xbcaa('0x1d')](config[_0xbcaa('0x1e')],_0xbcaa('0x1f')));},'filename':function(_0x437c8c,_0x43379e,_0x5b1613){_0x5b1613(null,util['format'](_0xbcaa('0x20'),Date[_0xbcaa('0x21')](),_0x43379e[_0xbcaa('0x22')][_0xbcaa('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xbcaa('0x24'),upload[_0xbcaa('0x25')](_0xbcaa('0x26')),controller[_0xbcaa('0x27')]);router[_0xbcaa('0x19')](_0xbcaa('0x12'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x28')]);router['post'](_0xbcaa('0x29'),auth[_0xbcaa('0x9')](),interaction[_0xbcaa('0x2a')](_0xbcaa('0x2b'),_0xbcaa('0x2c')),controller[_0xbcaa('0x2d')]);router['put'](_0xbcaa('0xd'),auth[_0xbcaa('0x9')](),interaction[_0xbcaa('0x2a')](_0xbcaa('0x2b'),_0xbcaa('0x2e')),controller[_0xbcaa('0x2f')]);router[_0xbcaa('0x30')](_0xbcaa('0x31'),controller[_0xbcaa('0x32')]);router[_0xbcaa('0x30')](_0xbcaa('0x33'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x34')]);router[_0xbcaa('0x30')](_0xbcaa('0x35'),controller[_0xbcaa('0x36')]);router[_0xbcaa('0x37')]('/:id',auth[_0xbcaa('0x9')](),interaction['tracked']('chat',_0xbcaa('0x38')),controller[_0xbcaa('0x39')]);router[_0xbcaa('0x37')](_0xbcaa('0x29'),auth[_0xbcaa('0x9')](),controller['removeTags']);module[_0xbcaa('0x3a')]=router;
\ No newline at end of file
+var _0x40e3=['/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','originalname','replace','single','/:id/tags','tracked','chat','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','download','post','create'];(function(_0x4f207b,_0x21ccd7){var _0x3e3bc5=function(_0x346050){while(--_0x346050){_0x4f207b['push'](_0x4f207b['shift']());}};_0x3e3bc5(++_0x21ccd7);}(_0x40e3,0x1ab));var _0x340e=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x40e3[_0x593564];return _0x211a89;};'use strict';var multer=require(_0x340e('0x0'));var util=require(_0x340e('0x1'));var path=require(_0x340e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x340e('0x3')]();var fs_extra=require(_0x340e('0x4'));var auth=require(_0x340e('0x5'));var interaction=require(_0x340e('0x6'));var config=require(_0x340e('0x7'));var controller=require(_0x340e('0x8'));router[_0x340e('0x9')]('/',auth[_0x340e('0xa')](),controller[_0x340e('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x340e('0xc')]);router[_0x340e('0x9')](_0x340e('0xd'),auth[_0x340e('0xe')](),controller[_0x340e('0xf')]);router['get'](_0x340e('0x10'),auth[_0x340e('0xe')](),controller[_0x340e('0x11')]);router[_0x340e('0x9')](_0x340e('0x12'),auth[_0x340e('0xa')](),controller['getMessages']);router[_0x340e('0x9')]('/:id/my_messages',auth[_0x340e('0xe')](),controller[_0x340e('0x13')]);router[_0x340e('0x9')]('/:id/download',auth[_0x340e('0xa')](),controller[_0x340e('0x14')]);router[_0x340e('0x15')]('/',auth['isAuthenticated'](),controller[_0x340e('0x16')]);router[_0x340e('0x15')](_0x340e('0x17'),auth[_0x340e('0xa')](),controller[_0x340e('0x18')]);var upload=multer({'storage':multer[_0x340e('0x19')]({'destination':function(_0x38d3fa,_0x5b15e0,_0x5d7c26){_0x5d7c26(null,path['join'](config[_0x340e('0x1a')],_0x340e('0x1b')));},'filename':function(_0x5299be,_0x37750d,_0x4d991e){_0x4d991e(null,util[_0x340e('0x1c')](_0x340e('0x1d'),Date['now'](),_0x37750d[_0x340e('0x1e')][_0x340e('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x340e('0x15')]('/:id/attachment_upload',upload[_0x340e('0x20')]('file'),controller['attachmentUpload']);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x340e('0x15')](_0x340e('0x21'),auth[_0x340e('0xa')](),interaction[_0x340e('0x22')](_0x340e('0x23'),'chatinteraction:addtags'),controller[_0x340e('0x24')]);router['put'](_0x340e('0xd'),auth[_0x340e('0xa')](),interaction['tracked']('chat',_0x340e('0x25')),controller[_0x340e('0x26')]);router[_0x340e('0x27')](_0x340e('0x28'),controller[_0x340e('0x29')]);router[_0x340e('0x27')](_0x340e('0x2a'),auth[_0x340e('0xe')](),controller[_0x340e('0x2b')]);router[_0x340e('0x27')]('/:id/close',controller['close']);router['delete'](_0x340e('0xd'),auth['isAuthenticated'](),interaction[_0x340e('0x22')]('chat','chatinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0x340e('0xa')](),controller['removeTags']);module[_0x340e('0x2c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 6a744ea..544f807 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 _0x1a3b=['sequelize','TEXT','BOOLEAN','INTEGER'];(function(_0x3fb392,_0x4259ad){var _0x49b16e=function(_0x5aec73){while(--_0x5aec73){_0x3fb392['push'](_0x3fb392['shift']());}};_0x49b16e(++_0x4259ad);}(_0x1a3b,0x138));var _0xb1a3=function(_0x2970f7,_0x2cbd32){_0x2970f7=_0x2970f7-0x0;var _0x263211=_0x1a3b[_0x2970f7];return _0x263211;};'use strict';var Sequelize=require(_0xb1a3('0x0'));module['exports']={'body':{'type':Sequelize[_0xb1a3('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb1a3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb1a3('0x3')]}};
\ No newline at end of file
+var _0x0057=['medium','sequelize','TEXT'];(function(_0x15a833,_0x5092d6){var _0x371593=function(_0x53b66b){while(--_0x53b66b){_0x15a833['push'](_0x15a833['shift']());}};_0x371593(++_0x5092d6);}(_0x0057,0xd9));var _0x7005=function(_0x3003fc,_0x5ac5de){_0x3003fc=_0x3003fc-0x0;var _0x22cb43=_0x0057[_0x3003fc];return _0x22cb43;};'use strict';var Sequelize=require(_0x7005('0x0'));module['exports']={'body':{'type':Sequelize[_0x7005('0x1')](_0x7005('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 2ee7d6f..3c5eb43 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 _0xcc96=['then','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ChatInternalMessage','include','findAll','rows','catch','show','fields','length','includeAll','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','fullname','role','userpic','online','lastLoginAt','allowmessenger','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','isEmpty','agent','push','messages','FromId','all','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x3a6c6d,_0x2dda5c){var _0x4868ed=function(_0x3f3682){while(--_0x3f3682){_0x3a6c6d['push'](_0x3a6c6d['shift']());}};_0x4868ed(++_0x2dda5c);}(_0xcc96,0x17c));var _0x6cc9=function(_0x279b5b,_0x49641e){_0x279b5b=_0x279b5b-0x0;var _0x220f80=_0xcc96[_0x279b5b];return _0x220f80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cc9('0x0'));var zipdir=require(_0x6cc9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cc9('0x2'));var moment=require(_0x6cc9('0x3'));var BPromise=require(_0x6cc9('0x4'));var Mustache=require(_0x6cc9('0x5'));var util=require(_0x6cc9('0x6'));var path=require(_0x6cc9('0x7'));var sox=require(_0x6cc9('0x8'));var csv=require(_0x6cc9('0x9'));var ejs=require(_0x6cc9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cc9('0xb'));var squel=require(_0x6cc9('0xc'));var crypto=require(_0x6cc9('0xd'));var jsforce=require(_0x6cc9('0xe'));var deskjs=require(_0x6cc9('0xf'));var toCsv=require(_0x6cc9('0x9'));var querystring=require(_0x6cc9('0x10'));var Papa=require(_0x6cc9('0x11'));var Redis=require('ioredis');var authService=require(_0x6cc9('0x12'));var qs=require(_0x6cc9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cc9('0x14'))(_0x6cc9('0x15'));var utils=require(_0x6cc9('0x16'));var config=require(_0x6cc9('0x17'));var licenseUtil=require(_0x6cc9('0x18'));var db=require('../../mysqldb')['db'];config[_0x6cc9('0x19')]=_[_0x6cc9('0x1a')](config[_0x6cc9('0x19')],{'host':_0x6cc9('0x1b'),'port':0x18eb});var socket=require(_0x6cc9('0x1c'))(new Redis(config['redis']));require(_0x6cc9('0x1d'))[_0x6cc9('0x1e')](socket);function respondWithStatusCode(_0x5e4412,_0x3b3be7){_0x3b3be7=_0x3b3be7||0xcc;return function(_0x27c7cc){if(_0x27c7cc){return _0x5e4412[_0x6cc9('0x1f')](_0x3b3be7);}return _0x5e4412[_0x6cc9('0x20')](_0x3b3be7)[_0x6cc9('0x21')]();};}function respondWithResult(_0x1757a3,_0x129053){_0x129053=_0x129053||0xc8;return function(_0x5bc0e1){if(_0x5bc0e1){return _0x1757a3[_0x6cc9('0x20')](_0x129053)[_0x6cc9('0x22')](_0x5bc0e1);}};}function respondWithFilteredResult(_0x46fdb9,_0x533c1c){return function(_0x584c06){if(_0x584c06){var _0x3fea9d=typeof _0x533c1c[_0x6cc9('0x23')]===_0x6cc9('0x24')&&typeof _0x533c1c[_0x6cc9('0x25')]===_0x6cc9('0x24');var _0x12b1ed=_0x584c06[_0x6cc9('0x26')];var _0x163a54=_0x3fea9d?0x0:_0x533c1c['offset'];var _0x15865b=_0x3fea9d?_0x584c06[_0x6cc9('0x26')]:_0x533c1c['offset']+_0x533c1c['limit'];var _0x2bd696;if(_0x15865b>=_0x12b1ed){_0x15865b=_0x12b1ed;_0x2bd696=0xc8;}else{_0x2bd696=0xce;}_0x46fdb9['status'](_0x2bd696);return _0x46fdb9[_0x6cc9('0x27')](_0x6cc9('0x28'),_0x163a54+'-'+_0x15865b+'/'+_0x12b1ed)[_0x6cc9('0x22')](_0x584c06);}return null;};}function patchUpdates(_0x54db34){return function(_0x227d6d){try{jsonpatch['apply'](_0x227d6d,_0x54db34,!![]);}catch(_0x2b2901){return BPromise[_0x6cc9('0x29')](_0x2b2901);}return _0x227d6d[_0x6cc9('0x2a')]();};}function saveUpdates(_0x4c31e8,_0x192d03){return function(_0x2293c0){if(_0x2293c0){return _0x2293c0[_0x6cc9('0x2b')](_0x4c31e8)[_0x6cc9('0x2c')](function(_0x2f47c6){return _0x2f47c6;});}return null;};}function removeEntity(_0x1c8a36,_0x8e5686){return function(_0x3e2263){if(_0x3e2263){return _0x3e2263[_0x6cc9('0x2d')]()[_0x6cc9('0x2c')](function(){_0x1c8a36[_0x6cc9('0x20')](0xcc)[_0x6cc9('0x21')]();});}};}function handleEntityNotFound(_0x619a4d,_0x2ecda8){return function(_0x3dca84){if(!_0x3dca84){_0x619a4d['sendStatus'](0x194);}return _0x3dca84;};}function handleError(_0x2fa1b6,_0x91a7dd){_0x91a7dd=_0x91a7dd||0x1f4;return function(_0x5627f7){logger[_0x6cc9('0x2e')](_0x5627f7[_0x6cc9('0x2f')]);if(_0x5627f7[_0x6cc9('0x30')]){delete _0x5627f7['name'];}_0x2fa1b6[_0x6cc9('0x20')](_0x91a7dd)['send'](_0x5627f7);};}exports['index']=function(_0x573408,_0xc76fa7){var _0x504474={},_0x4d64f3={},_0x46dfc0={'count':0x0,'rows':[]};var _0x5bd243=_['map'](db['ChatInternalMessage'][_0x6cc9('0x31')],function(_0x264a91){return{'name':_0x264a91[_0x6cc9('0x32')],'type':_0x264a91[_0x6cc9('0x33')][_0x6cc9('0x34')]};});_0x4d64f3[_0x6cc9('0x35')]=_['map'](_0x5bd243,_0x6cc9('0x30'));_0x4d64f3[_0x6cc9('0x36')]=_[_0x6cc9('0x37')](_0x573408[_0x6cc9('0x36')]);_0x4d64f3[_0x6cc9('0x38')]=_[_0x6cc9('0x39')](_0x4d64f3[_0x6cc9('0x35')],_0x4d64f3[_0x6cc9('0x36')]);_0x504474[_0x6cc9('0x3a')]=_[_0x6cc9('0x39')](_0x4d64f3[_0x6cc9('0x35')],qs['fields'](_0x573408[_0x6cc9('0x36')]['fields']));_0x504474[_0x6cc9('0x3a')]=_0x504474[_0x6cc9('0x3a')]['length']?_0x504474[_0x6cc9('0x3a')]:_0x4d64f3[_0x6cc9('0x35')];if(!_0x573408['query']['hasOwnProperty'](_0x6cc9('0x3b'))){_0x504474[_0x6cc9('0x25')]=qs[_0x6cc9('0x25')](_0x573408['query'][_0x6cc9('0x25')]);_0x504474[_0x6cc9('0x23')]=qs['offset'](_0x573408['query'][_0x6cc9('0x23')]);}_0x504474[_0x6cc9('0x3c')]=qs[_0x6cc9('0x3d')](_0x573408[_0x6cc9('0x36')][_0x6cc9('0x3d')]);_0x504474[_0x6cc9('0x3e')]=qs[_0x6cc9('0x38')](_[_0x6cc9('0x3f')](_0x573408[_0x6cc9('0x36')],_0x4d64f3[_0x6cc9('0x38')]),_0x5bd243);if(_0x573408[_0x6cc9('0x36')][_0x6cc9('0x40')]){_0x504474[_0x6cc9('0x3e')]=_[_0x6cc9('0x41')](_0x504474[_0x6cc9('0x3e')],{'$or':_[_0x6cc9('0x42')](_0x5bd243,function(_0x3335ee){if(_0x3335ee[_0x6cc9('0x33')]!==_0x6cc9('0x43')){var _0x1a5cf8={};_0x1a5cf8[_0x3335ee[_0x6cc9('0x30')]]={'$like':'%'+_0x573408[_0x6cc9('0x36')]['filter']+'%'};return _0x1a5cf8;}})});}_0x504474=_['merge']({},_0x504474,_0x573408[_0x6cc9('0x44')]);var _0x99d42b={'where':_0x504474[_0x6cc9('0x3e')]};return db[_0x6cc9('0x45')]['count'](_0x99d42b)[_0x6cc9('0x2c')](function(_0x576087){_0x46dfc0['count']=_0x576087;if(_0x573408[_0x6cc9('0x36')]['includeAll']){_0x504474[_0x6cc9('0x46')]=[{'all':!![]}];}return db[_0x6cc9('0x45')][_0x6cc9('0x47')](_0x504474);})['then'](function(_0xf68238){_0x46dfc0[_0x6cc9('0x48')]=_0xf68238;return _0x46dfc0;})[_0x6cc9('0x2c')](respondWithFilteredResult(_0xc76fa7,_0x504474))[_0x6cc9('0x49')](handleError(_0xc76fa7,null));};exports[_0x6cc9('0x4a')]=function(_0x4621f0,_0x16abce){var _0x190d44={'raw':!![],'where':{'id':_0x4621f0['params']['id']}},_0x1c64b9={};_0x1c64b9['model']=_['keys'](db['ChatInternalMessage'][_0x6cc9('0x31')]);_0x1c64b9[_0x6cc9('0x36')]=_['keys'](_0x4621f0['query']);_0x1c64b9[_0x6cc9('0x38')]=_[_0x6cc9('0x39')](_0x1c64b9[_0x6cc9('0x35')],_0x1c64b9[_0x6cc9('0x36')]);_0x190d44[_0x6cc9('0x3a')]=_[_0x6cc9('0x39')](_0x1c64b9[_0x6cc9('0x35')],qs[_0x6cc9('0x4b')](_0x4621f0[_0x6cc9('0x36')][_0x6cc9('0x4b')]));_0x190d44['attributes']=_0x190d44[_0x6cc9('0x3a')][_0x6cc9('0x4c')]?_0x190d44[_0x6cc9('0x3a')]:_0x1c64b9[_0x6cc9('0x35')];if(_0x4621f0[_0x6cc9('0x36')][_0x6cc9('0x4d')]){_0x190d44[_0x6cc9('0x46')]=[{'all':!![]}];}_0x190d44=_[_0x6cc9('0x41')]({},_0x190d44,_0x4621f0[_0x6cc9('0x44')]);return db['ChatInternalMessage'][_0x6cc9('0x4e')](_0x190d44)[_0x6cc9('0x2c')](handleEntityNotFound(_0x16abce,null))[_0x6cc9('0x2c')](respondWithResult(_0x16abce,null))[_0x6cc9('0x49')](handleError(_0x16abce,null));};exports[_0x6cc9('0x4f')]=function(_0x5373fe,_0x3adea4){return db[_0x6cc9('0x45')][_0x6cc9('0x4f')](_0x5373fe['body'],{})[_0x6cc9('0x2c')](respondWithResult(_0x3adea4,0xc9))['catch'](handleError(_0x3adea4,null));};exports['update']=function(_0x3c0271,_0x9626c){if(_0x3c0271[_0x6cc9('0x50')]['id']){delete _0x3c0271[_0x6cc9('0x50')]['id'];}return db[_0x6cc9('0x45')][_0x6cc9('0x4e')]({'where':{'id':_0x3c0271[_0x6cc9('0x51')]['id']}})[_0x6cc9('0x2c')](handleEntityNotFound(_0x9626c,null))[_0x6cc9('0x2c')](saveUpdates(_0x3c0271[_0x6cc9('0x50')],null))[_0x6cc9('0x2c')](respondWithResult(_0x9626c,null))[_0x6cc9('0x49')](handleError(_0x9626c,null));};exports[_0x6cc9('0x2d')]=function(_0x24fa53,_0x2527c1){return db['ChatInternalMessage'][_0x6cc9('0x4e')]({'where':{'id':_0x24fa53[_0x6cc9('0x51')]['id']}})['then'](handleEntityNotFound(_0x2527c1,null))[_0x6cc9('0x2c')](removeEntity(_0x2527c1,null))['catch'](handleError(_0x2527c1,null));};exports[_0x6cc9('0x52')]=function(_0x202ec3,_0x544580){return db[_0x6cc9('0x45')][_0x6cc9('0x52')]()[_0x6cc9('0x2c')](respondWithResult(_0x544580,null))[_0x6cc9('0x49')](handleError(_0x544580,null));};function wrapUser(_0x13dc12){return function(_0x5ee8c9){var _0x702778=_0x13dc12[_0x6cc9('0x53')]({'plain':!![]});_0x702778['messages']=[];if(_0x5ee8c9){_0x702778[_0x6cc9('0x54')]=_0x5ee8c9[_0x6cc9('0x55')];_0x702778[_0x6cc9('0x56')]=_0x5ee8c9;}else{_0x702778[_0x6cc9('0x54')]=moment(0x0)['format'](_0x6cc9('0x57'));_0x702778[_0x6cc9('0x56')]={};}return _0x702778;};}exports['getUsers']=function(_0x2d2905,_0x1e5671,_0x44d37c){var _0x23caa0=[];return db[_0x6cc9('0x58')][_0x6cc9('0x47')]({'where':{'role':['agent','admin','user']},'attributes':['id',_0x6cc9('0x59'),'name',_0x6cc9('0x5a'),_0x6cc9('0x5b'),'internal',_0x6cc9('0x5c'),_0x6cc9('0x5d'),_0x6cc9('0x5e'),'showWebBar'],'order':qs[_0x6cc9('0x3d')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x6cc9('0x5f'),'attributes':['id',_0x6cc9('0x30'),'type'],'through':{'attributes':[]}}]})[_0x6cc9('0x2c')](function(_0x41386a){if(_0x41386a){var _0x37cc83=_0x2d2905[_0x6cc9('0x60')][_0x6cc9('0x53')]({'plain':!![]});if(!_0x37cc83)throw new Error(_0x6cc9('0x61'));if(_0x37cc83['role']===_0x6cc9('0x60')){return db['UserProfileSection'][_0x6cc9('0x4e')]({'where':{'name':_0x6cc9('0x62'),'userProfileId':_0x37cc83[_0x6cc9('0x63')]},'raw':!![]})[_0x6cc9('0x2c')](function(_0x2ed8f9){if(_0x2ed8f9){if(_0x2ed8f9['autoAssociation']===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2ed8f9['id']},'raw':!![]})[_0x6cc9('0x2c')](function(_0x1721c3){var _0x3ab218=[];if(_[_0x6cc9('0x64')](_0x1721c3)){_0x3ab218=_[_0x6cc9('0x40')](_0x41386a,function(_0x53b07f){if(_0x53b07f[_0x6cc9('0x5a')]!==_0x6cc9('0x65')){return _0x53b07f;}});return _0x3ab218;}else{for(var _0x86df85=0x0;_0x86df85<_0x41386a[_0x6cc9('0x4c')];_0x86df85++){var _0x5e24ba=_0x41386a[_0x86df85];if(_0x5e24ba[_0x6cc9('0x5a')]===_0x6cc9('0x65')){var _0x254e6e=_[_0x6cc9('0x4e')](_0x1721c3,function(_0x27244d){return _0x27244d['resourceId']===_0x5e24ba['id'];});if(_0x254e6e)_0x3ab218[_0x6cc9('0x66')](_0x5e24ba);}else{_0x3ab218[_0x6cc9('0x66')](_0x5e24ba);}}return _0x3ab218;}});}else{return _0x41386a;}}else{var _0x44af76=_[_0x6cc9('0x40')](_0x41386a,function(_0x36b06e){if(_0x36b06e['role']!==_0x6cc9('0x65')){return _0x36b06e;}});return _0x44af76;}});}else{return _0x41386a;}}})[_0x6cc9('0x2c')](function(_0x419c75){var _0x5c3d25=[];if(_0x419c75){_0x23caa0=_0x419c75;for(var _0x12123f=0x0;_0x12123f<_0x419c75[_0x6cc9('0x4c')];_0x12123f+=0x1){_0x23caa0[_0x12123f][_0x6cc9('0x67')]=[];_0x5c3d25['push'](db[_0x6cc9('0x45')][_0x6cc9('0x4e')]({'where':{'FromId':[_0x2d2905[_0x6cc9('0x60')]['id'],_0x419c75[_0x12123f]['id']],'ToId':[_0x2d2905[_0x6cc9('0x60')]['id'],_0x419c75[_0x12123f]['id']],'ChatGroupId':null},'attributes':['id',_0x6cc9('0x55'),_0x6cc9('0x68'),'ToId','read','body'],'order':qs[_0x6cc9('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6cc9('0x2c')](wrapUser(_0x419c75[_0x12123f])));}return BPromise[_0x6cc9('0x69')](_0x5c3d25);}return[];})[_0x6cc9('0x2c')](function(_0x46b2f9){return{'rows':_0x46b2f9,'count':_0x46b2f9[_0x6cc9('0x4c')]};})[_0x6cc9('0x2c')](respondWithResult(_0x1e5671,null))[_0x6cc9('0x49')](handleError(_0x1e5671,null));};
\ No newline at end of file
+var _0x5db3=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','stack','name','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','push','FromId','read','-createdAt','all','eml-format','rimraf'];(function(_0x1ded0f,_0x2c82a9){var _0x1ad47a=function(_0x5b745b){while(--_0x5b745b){_0x1ded0f['push'](_0x1ded0f['shift']());}};_0x1ad47a(++_0x2c82a9);}(_0x5db3,0xd6));var _0x35db=function(_0x42bfb7,_0x25a3ec){_0x42bfb7=_0x42bfb7-0x0;var _0x5c497d=_0x5db3[_0x42bfb7];return _0x5c497d;};'use strict';var emlformat=require(_0x35db('0x0'));var rimraf=require(_0x35db('0x1'));var zipdir=require(_0x35db('0x2'));var jsonpatch=require(_0x35db('0x3'));var rp=require(_0x35db('0x4'));var moment=require('moment');var BPromise=require(_0x35db('0x5'));var Mustache=require(_0x35db('0x6'));var util=require(_0x35db('0x7'));var path=require(_0x35db('0x8'));var sox=require('sox');var csv=require(_0x35db('0x9'));var ejs=require(_0x35db('0xa'));var fs=require('fs');var fs_extra=require(_0x35db('0xb'));var _=require(_0x35db('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x35db('0xd'));var deskjs=require(_0x35db('0xe'));var toCsv=require(_0x35db('0x9'));var querystring=require(_0x35db('0xf'));var Papa=require(_0x35db('0x10'));var Redis=require(_0x35db('0x11'));var authService=require(_0x35db('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x35db('0x13'));var hardwareService=require(_0x35db('0x14'));var logger=require(_0x35db('0x15'))(_0x35db('0x16'));var utils=require(_0x35db('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x35db('0x18'));var db=require(_0x35db('0x19'))['db'];config[_0x35db('0x1a')]=_[_0x35db('0x1b')](config[_0x35db('0x1a')],{'host':_0x35db('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35db('0x1a')]));require(_0x35db('0x1d'))[_0x35db('0x1e')](socket);function respondWithStatusCode(_0x31913d,_0x1689e2){_0x1689e2=_0x1689e2||0xcc;return function(_0x26b878){if(_0x26b878){return _0x31913d['sendStatus'](_0x1689e2);}return _0x31913d['status'](_0x1689e2)[_0x35db('0x1f')]();};}function respondWithResult(_0x4daf9f,_0x5094c5){_0x5094c5=_0x5094c5||0xc8;return function(_0x177f1e){if(_0x177f1e){return _0x4daf9f[_0x35db('0x20')](_0x5094c5)[_0x35db('0x21')](_0x177f1e);}};}function respondWithFilteredResult(_0x1fb434,_0x4950fe){return function(_0x28808d){if(_0x28808d){var _0x13984f=typeof _0x4950fe[_0x35db('0x22')]==='undefined'&&typeof _0x4950fe['limit']===_0x35db('0x23');var _0x34f9f2=_0x28808d[_0x35db('0x24')];var _0x215e9a=_0x13984f?0x0:_0x4950fe[_0x35db('0x22')];var _0x3594f9=_0x13984f?_0x28808d[_0x35db('0x24')]:_0x4950fe[_0x35db('0x22')]+_0x4950fe[_0x35db('0x25')];var _0x2df1b6;if(_0x3594f9>=_0x34f9f2){_0x3594f9=_0x34f9f2;_0x2df1b6=0xc8;}else{_0x2df1b6=0xce;}_0x1fb434[_0x35db('0x20')](_0x2df1b6);return _0x1fb434[_0x35db('0x26')]('Content-Range',_0x215e9a+'-'+_0x3594f9+'/'+_0x34f9f2)[_0x35db('0x21')](_0x28808d);}return null;};}function patchUpdates(_0x632f5e){return function(_0x10df39){try{jsonpatch[_0x35db('0x27')](_0x10df39,_0x632f5e,!![]);}catch(_0x447c46){return BPromise[_0x35db('0x28')](_0x447c46);}return _0x10df39[_0x35db('0x29')]();};}function saveUpdates(_0x3fb4d7,_0x122d19){return function(_0x4bf00a){if(_0x4bf00a){return _0x4bf00a[_0x35db('0x2a')](_0x3fb4d7)[_0x35db('0x2b')](function(_0x31e298){return _0x31e298;});}return null;};}function removeEntity(_0x50cf95,_0x420457){return function(_0x505617){if(_0x505617){return _0x505617['destroy']()['then'](function(){_0x50cf95[_0x35db('0x20')](0xcc)[_0x35db('0x1f')]();});}};}function handleEntityNotFound(_0xa3a22c,_0x45e185){return function(_0x1ec570){if(!_0x1ec570){_0xa3a22c['sendStatus'](0x194);}return _0x1ec570;};}function handleError(_0x15e97a,_0x4051da){_0x4051da=_0x4051da||0x1f4;return function(_0x12e2ba){logger[_0x35db('0x2c')](_0x12e2ba[_0x35db('0x2d')]);if(_0x12e2ba[_0x35db('0x2e')]){delete _0x12e2ba['name'];}_0x15e97a[_0x35db('0x20')](_0x4051da)['send'](_0x12e2ba);};}exports['index']=function(_0xdde4d8,_0xabe6bf){var _0x18a816={},_0x13e280={},_0x4a33fa={'count':0x0,'rows':[]};var _0x37d809=_['map'](db[_0x35db('0x2f')][_0x35db('0x30')],function(_0x3e137a){return{'name':_0x3e137a[_0x35db('0x31')],'type':_0x3e137a[_0x35db('0x32')][_0x35db('0x33')]};});_0x13e280[_0x35db('0x34')]=_[_0x35db('0x35')](_0x37d809,_0x35db('0x2e'));_0x13e280[_0x35db('0x36')]=_[_0x35db('0x37')](_0xdde4d8[_0x35db('0x36')]);_0x13e280[_0x35db('0x38')]=_[_0x35db('0x39')](_0x13e280[_0x35db('0x34')],_0x13e280[_0x35db('0x36')]);_0x18a816['attributes']=_[_0x35db('0x39')](_0x13e280['model'],qs[_0x35db('0x3a')](_0xdde4d8['query'][_0x35db('0x3a')]));_0x18a816['attributes']=_0x18a816[_0x35db('0x3b')][_0x35db('0x3c')]?_0x18a816['attributes']:_0x13e280[_0x35db('0x34')];if(!_0xdde4d8[_0x35db('0x36')][_0x35db('0x3d')](_0x35db('0x3e'))){_0x18a816[_0x35db('0x25')]=qs['limit'](_0xdde4d8['query'][_0x35db('0x25')]);_0x18a816[_0x35db('0x22')]=qs[_0x35db('0x22')](_0xdde4d8['query'][_0x35db('0x22')]);}_0x18a816['order']=qs[_0x35db('0x3f')](_0xdde4d8[_0x35db('0x36')][_0x35db('0x3f')]);_0x18a816[_0x35db('0x40')]=qs[_0x35db('0x38')](_[_0x35db('0x41')](_0xdde4d8[_0x35db('0x36')],_0x13e280[_0x35db('0x38')]),_0x37d809);if(_0xdde4d8[_0x35db('0x36')][_0x35db('0x42')]){_0x18a816[_0x35db('0x40')]=_[_0x35db('0x43')](_0x18a816[_0x35db('0x40')],{'$or':_['map'](_0x37d809,function(_0x28df3e){if(_0x28df3e['type']!==_0x35db('0x44')){var _0x480200={};_0x480200[_0x28df3e['name']]={'$like':'%'+_0xdde4d8[_0x35db('0x36')][_0x35db('0x42')]+'%'};return _0x480200;}})});}_0x18a816=_[_0x35db('0x43')]({},_0x18a816,_0xdde4d8[_0x35db('0x45')]);var _0x5e0f4a={'where':_0x18a816['where']};return db[_0x35db('0x2f')][_0x35db('0x24')](_0x5e0f4a)[_0x35db('0x2b')](function(_0x27ef25){_0x4a33fa['count']=_0x27ef25;if(_0xdde4d8[_0x35db('0x36')][_0x35db('0x46')]){_0x18a816[_0x35db('0x47')]=[{'all':!![]}];}return db[_0x35db('0x2f')][_0x35db('0x48')](_0x18a816);})[_0x35db('0x2b')](function(_0x56d562){_0x4a33fa['rows']=_0x56d562;return _0x4a33fa;})[_0x35db('0x2b')](respondWithFilteredResult(_0xabe6bf,_0x18a816))[_0x35db('0x49')](handleError(_0xabe6bf,null));};exports['show']=function(_0x210175,_0x474ae){var _0xdc54fd={'raw':!![],'where':{'id':_0x210175[_0x35db('0x4a')]['id']}},_0x5d14d2={};_0x5d14d2[_0x35db('0x34')]=_[_0x35db('0x37')](db[_0x35db('0x2f')][_0x35db('0x30')]);_0x5d14d2[_0x35db('0x36')]=_[_0x35db('0x37')](_0x210175['query']);_0x5d14d2['filters']=_[_0x35db('0x39')](_0x5d14d2['model'],_0x5d14d2[_0x35db('0x36')]);_0xdc54fd['attributes']=_[_0x35db('0x39')](_0x5d14d2[_0x35db('0x34')],qs[_0x35db('0x3a')](_0x210175['query'][_0x35db('0x3a')]));_0xdc54fd[_0x35db('0x3b')]=_0xdc54fd[_0x35db('0x3b')][_0x35db('0x3c')]?_0xdc54fd[_0x35db('0x3b')]:_0x5d14d2[_0x35db('0x34')];if(_0x210175[_0x35db('0x36')]['includeAll']){_0xdc54fd['include']=[{'all':!![]}];}_0xdc54fd=_[_0x35db('0x43')]({},_0xdc54fd,_0x210175['options']);return db[_0x35db('0x2f')][_0x35db('0x4b')](_0xdc54fd)['then'](handleEntityNotFound(_0x474ae,null))[_0x35db('0x2b')](respondWithResult(_0x474ae,null))['catch'](handleError(_0x474ae,null));};exports['create']=function(_0x48d2a6,_0xc8579b){return db[_0x35db('0x2f')][_0x35db('0x4c')](_0x48d2a6[_0x35db('0x4d')],{})[_0x35db('0x2b')](respondWithResult(_0xc8579b,0xc9))['catch'](handleError(_0xc8579b,null));};exports[_0x35db('0x2a')]=function(_0x159328,_0x5d2be8){if(_0x159328[_0x35db('0x4d')]['id']){delete _0x159328[_0x35db('0x4d')]['id'];}return db[_0x35db('0x2f')][_0x35db('0x4b')]({'where':{'id':_0x159328[_0x35db('0x4a')]['id']}})[_0x35db('0x2b')](handleEntityNotFound(_0x5d2be8,null))['then'](saveUpdates(_0x159328[_0x35db('0x4d')],null))['then'](respondWithResult(_0x5d2be8,null))[_0x35db('0x49')](handleError(_0x5d2be8,null));};exports['destroy']=function(_0x5cdd5d,_0x4ded34){return db['ChatInternalMessage'][_0x35db('0x4b')]({'where':{'id':_0x5cdd5d[_0x35db('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ded34,null))['then'](removeEntity(_0x4ded34,null))[_0x35db('0x49')](handleError(_0x4ded34,null));};exports[_0x35db('0x4e')]=function(_0x5356c0,_0x31e308){return db[_0x35db('0x2f')][_0x35db('0x4e')]()[_0x35db('0x2b')](respondWithResult(_0x31e308,null))['catch'](handleError(_0x31e308,null));};function wrapUser(_0x592b72){return function(_0xa89657){var _0x4d57ed=_0x592b72[_0x35db('0x4f')]({'plain':!![]});_0x4d57ed[_0x35db('0x50')]=[];if(_0xa89657){_0x4d57ed[_0x35db('0x51')]=_0xa89657[_0x35db('0x52')];_0x4d57ed[_0x35db('0x53')]=_0xa89657;}else{_0x4d57ed[_0x35db('0x51')]=moment(0x0)['format'](_0x35db('0x54'));_0x4d57ed[_0x35db('0x53')]={};}return _0x4d57ed;};}exports['getUsers']=function(_0x5fcf6f,_0x258075,_0x52e636){var _0x3ddafe=[];return db[_0x35db('0x55')][_0x35db('0x48')]({'where':{'role':['agent',_0x35db('0x56'),_0x35db('0x57')]},'attributes':['id',_0x35db('0x58'),'name',_0x35db('0x59'),_0x35db('0x5a'),_0x35db('0x5b'),_0x35db('0x5c'),_0x35db('0x5d'),_0x35db('0x5e'),_0x35db('0x5f')],'order':qs[_0x35db('0x3f')]('-online'),'include':[{'model':db[_0x35db('0x60')],'as':'VoiceQueues','attributes':['id','name',_0x35db('0x32')],'through':{'attributes':[]}}]})[_0x35db('0x2b')](function(_0x422ea7){if(_0x422ea7){var _0x1c31a0=_0x5fcf6f[_0x35db('0x57')]['get']({'plain':!![]});if(!_0x1c31a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c31a0['role']===_0x35db('0x57')){return db[_0x35db('0x61')][_0x35db('0x4b')]({'where':{'name':_0x35db('0x62'),'userProfileId':_0x1c31a0[_0x35db('0x63')]},'raw':!![]})[_0x35db('0x2b')](function(_0x592231){if(_0x592231){if(_0x592231[_0x35db('0x64')]===0x0){return db[_0x35db('0x65')][_0x35db('0x48')]({'where':{'sectionId':_0x592231['id']},'raw':!![]})[_0x35db('0x2b')](function(_0x21eec7){var _0x3d5fac=[];if(_['isEmpty'](_0x21eec7)){_0x3d5fac=_['filter'](_0x422ea7,function(_0x1520bf){if(_0x1520bf[_0x35db('0x59')]!=='agent'){return _0x1520bf;}});return _0x3d5fac;}else{for(var _0x1b695d=0x0;_0x1b695d<_0x422ea7['length'];_0x1b695d++){var _0x93ee4=_0x422ea7[_0x1b695d];if(_0x93ee4['role']===_0x35db('0x66')){var _0x4b212d=_[_0x35db('0x4b')](_0x21eec7,function(_0x18d36e){return _0x18d36e['resourceId']===_0x93ee4['id'];});if(_0x4b212d)_0x3d5fac['push'](_0x93ee4);}else{_0x3d5fac['push'](_0x93ee4);}}return _0x3d5fac;}});}else{return _0x422ea7;}}else{var _0x10a1f6=_[_0x35db('0x42')](_0x422ea7,function(_0x32e83a){if(_0x32e83a['role']!=='agent'){return _0x32e83a;}});return _0x10a1f6;}});}else{return _0x422ea7;}}})[_0x35db('0x2b')](function(_0x563f4f){var _0x339fc7=[];if(_0x563f4f){_0x3ddafe=_0x563f4f;for(var _0x385918=0x0;_0x385918<_0x563f4f[_0x35db('0x3c')];_0x385918+=0x1){_0x3ddafe[_0x385918][_0x35db('0x50')]=[];_0x339fc7[_0x35db('0x67')](db[_0x35db('0x2f')][_0x35db('0x4b')]({'where':{'FromId':[_0x5fcf6f['user']['id'],_0x563f4f[_0x385918]['id']],'ToId':[_0x5fcf6f[_0x35db('0x57')]['id'],_0x563f4f[_0x385918]['id']],'ChatGroupId':null},'attributes':['id',_0x35db('0x52'),_0x35db('0x68'),'ToId',_0x35db('0x69'),_0x35db('0x4d')],'order':qs['sort'](_0x35db('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x35db('0x2b')](wrapUser(_0x563f4f[_0x385918])));}return BPromise[_0x35db('0x6b')](_0x339fc7);}return[];})[_0x35db('0x2b')](function(_0x45ee60){return{'rows':_0x45ee60,'count':_0x45ee60[_0x35db('0x3c')]};})['then'](respondWithResult(_0x258075,null))[_0x35db('0x49')](handleError(_0x258075,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index ad851a3..927c98d 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 _0xa66e=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x505493,_0xa913c8){var _0x5604cc=function(_0x23f626){while(--_0x23f626){_0x505493['push'](_0x505493['shift']());}};_0x5604cc(++_0xa913c8);}(_0xa66e,0xf4));var _0xea66=function(_0x5d7a5a,_0x57c3d0){_0x5d7a5a=_0x5d7a5a-0x0;var _0x33c063=_0xa66e[_0x5d7a5a];return _0x33c063;};'use strict';var EventEmitter=require(_0xea66('0x0'));var ChatInternalMessage=require(_0xea66('0x1'))['db'][_0xea66('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xea66('0x3')](0x0);var events={'afterCreate':_0xea66('0x4'),'afterUpdate':_0xea66('0x5'),'afterDestroy':'remove'};function emitEvent(_0x37baa8){return function(_0x38638b,_0xc7fc47,_0x139ad2){ChatInternalMessageEvents['emit'](_0x37baa8+':'+_0x38638b['id'],_0x38638b);ChatInternalMessageEvents[_0xea66('0x6')](_0x37baa8,_0x38638b);_0x139ad2(null);};}for(var e in events){if(events[_0xea66('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xea66('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x27d6=['exports','events','../../mysqldb','save','remove','emit','hook'];(function(_0x55c784,_0x3ed253){var _0x13d1e5=function(_0x429745){while(--_0x429745){_0x55c784['push'](_0x55c784['shift']());}};_0x13d1e5(++_0x3ed253);}(_0x27d6,0x14a));var _0x627d=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x27d6[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require(_0x627d('0x0'));var ChatInternalMessage=require(_0x627d('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x627d('0x2'),'afterUpdate':'update','afterDestroy':_0x627d('0x3')};function emitEvent(_0x2e0502){return function(_0x18f700,_0x156ce2,_0x3b8d20){ChatInternalMessageEvents[_0x627d('0x4')](_0x2e0502+':'+_0x18f700['id'],_0x18f700);ChatInternalMessageEvents[_0x627d('0x4')](_0x2e0502,_0x18f700);_0x3b8d20(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x627d('0x5')](e,emitEvent(event));}}module[_0x627d('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 5c8bf7e..c48ade9 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 _0x63ec=['util','api','moment','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5115fe,_0x447a8e){var _0x64874d=function(_0x2f74a){while(--_0x2f74a){_0x5115fe['push'](_0x5115fe['shift']());}};_0x64874d(++_0x447a8e);}(_0x63ec,0xe9));var _0xc63e=function(_0x2fd770,_0x2bccac){_0x2fd770=_0x2fd770-0x0;var _0x184848=_0x63ec[_0x2fd770];return _0x184848;};'use strict';var _=require(_0xc63e('0x0'));var util=require(_0xc63e('0x1'));var logger=require('../../config/logger')(_0xc63e('0x2'));var moment=require(_0xc63e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc63e('0x4'));var fs=require('fs');var path=require(_0xc63e('0x5'));var rimraf=require('rimraf');var config=require(_0xc63e('0x6'));var attributes=require(_0xc63e('0x7'));module[_0xc63e('0x8')]=function(_0x1ade60,_0x4ebc8d){return _0x1ade60[_0xc63e('0x9')](_0xc63e('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc63e('0xb'),'collate':_0xc63e('0xc')});};
\ No newline at end of file
+var _0x9a49=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9a49,0x75));var _0x99a4=function(_0x181c23,_0x5c5af5){_0x181c23=_0x181c23-0x0;var _0x496ae4=_0x9a49[_0x181c23];return _0x496ae4;};'use strict';var _=require(_0x99a4('0x0'));var util=require(_0x99a4('0x1'));var logger=require(_0x99a4('0x2'))(_0x99a4('0x3'));var moment=require(_0x99a4('0x4'));var BPromise=require(_0x99a4('0x5'));var rp=require(_0x99a4('0x6'));var fs=require('fs');var path=require(_0x99a4('0x7'));var rimraf=require(_0x99a4('0x8'));var config=require(_0x99a4('0x9'));var attributes=require(_0x99a4('0xa'));module[_0x99a4('0xb')]=function(_0x287ff1,_0x4ac218){return _0x287ff1[_0x99a4('0xc')](_0x99a4('0xd'),attributes,{'tableName':_0x99a4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x99a4('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 13fabae..04fdf81 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 _0x5b92=['defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5b92,0xdf));var _0x25b9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5b92[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x25b9('0x0'));var util=require(_0x25b9('0x1'));var moment=require('moment');var BPromise=require(_0x25b9('0x2'));var rs=require(_0x25b9('0x3'));var fs=require('fs');var Redis=require(_0x25b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25b9('0x5'));var logger=require(_0x25b9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x25b9('0x7'));var client=jayson[_0x25b9('0x8')][_0x25b9('0x9')]({'port':0x232a});config[_0x25b9('0xa')]=_[_0x25b9('0xb')](config[_0x25b9('0xa')],{'host':_0x25b9('0xc'),'port':0x18eb});var socket=require(_0x25b9('0xd'))(new Redis(config[_0x25b9('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x474970,_0xb8173,_0x51fcf1){return new BPromise(function(_0x482356,_0x37989e){return client[_0x25b9('0xe')](_0x474970,_0x51fcf1)[_0x25b9('0xf')](function(_0x3ed302){logger[_0x25b9('0x10')](_0x25b9('0x11'),_0xb8173,_0x25b9('0x12'));logger[_0x25b9('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xb8173,_0x25b9('0x12'),JSON[_0x25b9('0x14')](_0x3ed302));if(_0x3ed302[_0x25b9('0x15')]){if(_0x3ed302[_0x25b9('0x15')][_0x25b9('0x16')]===0x1f4){logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x3ed302['error']['message']);return _0x37989e(_0x3ed302[_0x25b9('0x15')][_0x25b9('0x17')]);}logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x3ed302[_0x25b9('0x15')][_0x25b9('0x17')]);return _0x482356(_0x3ed302['error'][_0x25b9('0x17')]);}else{logger[_0x25b9('0x10')](_0x25b9('0x11'),_0xb8173,_0x25b9('0x12'));_0x482356(_0x3ed302[_0x25b9('0x18')][_0x25b9('0x17')]);}})[_0x25b9('0x19')](function(_0x38c36f){logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x38c36f);_0x37989e(_0x38c36f);});});}
\ No newline at end of file
+var _0x4398=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','code','message','error','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x4398,0x121));var _0x8439=function(_0x3c06cf,_0x3c387c){_0x3c06cf=_0x3c06cf-0x0;var _0xf985c3=_0x4398[_0x3c06cf];return _0xf985c3;};'use strict';var _=require(_0x8439('0x0'));var util=require(_0x8439('0x1'));var moment=require(_0x8439('0x2'));var BPromise=require(_0x8439('0x3'));var rs=require(_0x8439('0x4'));var fs=require('fs');var Redis=require(_0x8439('0x5'));var db=require(_0x8439('0x6'))['db'];var utils=require(_0x8439('0x7'));var logger=require(_0x8439('0x8'))(_0x8439('0x9'));var config=require(_0x8439('0xa'));var jayson=require(_0x8439('0xb'));var client=jayson['client'][_0x8439('0xc')]({'port':0x232a});config[_0x8439('0xd')]=_[_0x8439('0xe')](config[_0x8439('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8439('0xf'))(new Redis(config['redis']));require(_0x8439('0x10'))['register'](socket);function respondWithRpcPromise(_0x9044c0,_0x1938f9,_0x38b294){return new BPromise(function(_0x4e2c33,_0x2fa4fa){return client['request'](_0x9044c0,_0x38b294)[_0x8439('0x11')](function(_0x7cc98b){logger[_0x8439('0x12')](_0x8439('0x13'),_0x1938f9,_0x8439('0x14'));logger[_0x8439('0x15')](_0x8439('0x16'),_0x1938f9,_0x8439('0x14'),JSON['stringify'](_0x7cc98b));if(_0x7cc98b['error']){if(_0x7cc98b['error'][_0x8439('0x17')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1938f9,_0x7cc98b['error']['message']);return _0x2fa4fa(_0x7cc98b['error'][_0x8439('0x18')]);}logger[_0x8439('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x1938f9,_0x7cc98b['error'][_0x8439('0x18')]);return _0x4e2c33(_0x7cc98b['error']['message']);}else{logger[_0x8439('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x1938f9,_0x8439('0x14'));_0x4e2c33(_0x7cc98b['result']['message']);}})[_0x8439('0x1a')](function(_0x300a87){logger['error'](_0x8439('0x13'),_0x1938f9,_0x300a87);_0x2fa4fa(_0x300a87);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 2f4bbff..484f07c 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 _0xbab5=['length','./chatInternalMessage.events','save','remove','emit','removeListener'];(function(_0x2f81d2,_0x2fb23b){var _0x392650=function(_0x40d237){while(--_0x40d237){_0x2f81d2['push'](_0x2f81d2['shift']());}};_0x392650(++_0x2fb23b);}(_0xbab5,0xe5));var _0x5bab=function(_0x235f57,_0x3eeb52){_0x235f57=_0x235f57-0x0;var _0x4728f1=_0xbab5[_0x235f57];return _0x4728f1;};'use strict';var ChatInternalMessageEvents=require(_0x5bab('0x0'));var events=[_0x5bab('0x1'),_0x5bab('0x2'),'update'];function createListener(_0x12fb0f,_0x5f2141){return function(_0xbdec2f){_0x5f2141[_0x5bab('0x3')](_0x12fb0f,_0xbdec2f);};}function removeListener(_0x1282e5,_0x4de468){return function(){ChatInternalMessageEvents[_0x5bab('0x4')](_0x1282e5,_0x4de468);};}exports['register']=function(_0x83a500){for(var _0x272ee6=0x0,_0x331c69=events[_0x5bab('0x5')];_0x272ee6<_0x331c69;_0x272ee6++){var _0x454ddd=events[_0x272ee6];var _0x3e0116=createListener('chatInternalMessage:'+_0x454ddd,_0x83a500);ChatInternalMessageEvents['on'](_0x454ddd,_0x3e0116);}};
\ No newline at end of file
+var _0x0768=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x3cd7ee,_0x117b17){var _0x35f196=function(_0x19452f){while(--_0x19452f){_0x3cd7ee['push'](_0x3cd7ee['shift']());}};_0x35f196(++_0x117b17);}(_0x0768,0x1c5));var _0x8076=function(_0x6f2a91,_0x257004){_0x6f2a91=_0x6f2a91-0x0;var _0x4902a7=_0x0768[_0x6f2a91];return _0x4902a7;};'use strict';var ChatInternalMessageEvents=require(_0x8076('0x0'));var events=['save',_0x8076('0x1'),_0x8076('0x2')];function createListener(_0x3e2856,_0x49bb4a){return function(_0x5c4dbb){_0x49bb4a[_0x8076('0x3')](_0x3e2856,_0x5c4dbb);};}function removeListener(_0x2e29db,_0x51958f){return function(){ChatInternalMessageEvents[_0x8076('0x4')](_0x2e29db,_0x51958f);};}exports[_0x8076('0x5')]=function(_0x1ee1b5){for(var _0x391da7=0x0,_0x256408=events['length'];_0x391da7<_0x256408;_0x391da7++){var _0x3e989b=events[_0x391da7];var _0x337a2d=createListener(_0x8076('0x6')+_0x3e989b,_0x1ee1b5);ChatInternalMessageEvents['on'](_0x3e989b,_0x337a2d);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 7c21f8c..06861a0 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 _0x5316=['create','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','get','describe','/users','getUsers','/:id','show','post'];(function(_0x29adb2,_0x48616f){var _0x250229=function(_0x22a883){while(--_0x22a883){_0x29adb2['push'](_0x29adb2['shift']());}};_0x250229(++_0x48616f);}(_0x5316,0x115));var _0x6531=function(_0x5743e3,_0x4a2aab){_0x5743e3=_0x5743e3-0x0;var _0x24d100=_0x5316[_0x5743e3];return _0x24d100;};'use strict';var multer=require(_0x6531('0x0'));var util=require('util');var path=require(_0x6531('0x1'));var timeout=require('connect-timeout');var express=require(_0x6531('0x2'));var router=express[_0x6531('0x3')]();var fs_extra=require(_0x6531('0x4'));var auth=require(_0x6531('0x5'));var interaction=require(_0x6531('0x6'));var config=require(_0x6531('0x7'));var controller=require(_0x6531('0x8'));router['get']('/',auth[_0x6531('0x9')](),controller['index']);router[_0x6531('0xa')]('/describe',auth[_0x6531('0x9')](),controller[_0x6531('0xb')]);router['get'](_0x6531('0xc'),auth[_0x6531('0x9')](),controller[_0x6531('0xd')]);router[_0x6531('0xa')](_0x6531('0xe'),auth[_0x6531('0x9')](),controller[_0x6531('0xf')]);router[_0x6531('0x10')]('/',auth[_0x6531('0x9')](),controller[_0x6531('0x11')]);router[_0x6531('0x12')](_0x6531('0xe'),controller[_0x6531('0x13')]);router['delete']('/:id',auth[_0x6531('0x9')](),controller[_0x6531('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1b22=['post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show'];(function(_0x41c63f,_0x4c9d1e){var _0x217b29=function(_0x5bb86e){while(--_0x5bb86e){_0x41c63f['push'](_0x41c63f['shift']());}};_0x217b29(++_0x4c9d1e);}(_0x1b22,0x165));var _0x21b2=function(_0x2b84d5,_0x428914){_0x2b84d5=_0x2b84d5-0x0;var _0x51452a=_0x1b22[_0x2b84d5];return _0x51452a;};'use strict';var multer=require(_0x21b2('0x0'));var util=require('util');var path=require(_0x21b2('0x1'));var timeout=require(_0x21b2('0x2'));var express=require(_0x21b2('0x3'));var router=express[_0x21b2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x21b2('0x5'));var interaction=require(_0x21b2('0x6'));var config=require(_0x21b2('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x21b2('0x8')]('/',auth['isAuthenticated'](),controller[_0x21b2('0x9')]);router[_0x21b2('0x8')](_0x21b2('0xa'),auth[_0x21b2('0xb')](),controller[_0x21b2('0xc')]);router['get'](_0x21b2('0xd'),auth[_0x21b2('0xb')](),controller[_0x21b2('0xe')]);router[_0x21b2('0x8')](_0x21b2('0xf'),auth[_0x21b2('0xb')](),controller[_0x21b2('0x10')]);router[_0x21b2('0x11')]('/',auth[_0x21b2('0xb')](),controller['create']);router['put'](_0x21b2('0xf'),controller[_0x21b2('0x12')]);router[_0x21b2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x21b2('0x14')]);module[_0x21b2('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 87a2993..2227453 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 _0x1beb=['sequelize','exports','medium','BOOLEAN','out','STRING','TEXT'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x1beb,0x165));var _0xb1be=function(_0x12daf9,_0x4fbd4b){_0x12daf9=_0x12daf9-0x0;var _0x58c9f5=_0x1beb[_0x12daf9];return _0x58c9f5;};'use strict';var Sequelize=require(_0xb1be('0x0'));module[_0xb1be('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb1be('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb1be('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb1be('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb1be('0x4')),'defaultValue':_0xb1be('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb1be('0x5')]},'providerResponse':{'type':Sequelize[_0xb1be('0x6')]}};
\ No newline at end of file
+var _0x47d6=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x46e57c,_0x2b52b1){var _0x255952=function(_0x11c79d){while(--_0x11c79d){_0x46e57c['push'](_0x46e57c['shift']());}};_0x255952(++_0x2b52b1);}(_0x47d6,0x13f));var _0x647d=function(_0x1a194e,_0x34abf7){_0x1a194e=_0x1a194e-0x0;var _0x28349e=_0x47d6[_0x1a194e];return _0x28349e;};'use strict';var Sequelize=require(_0x647d('0x0'));module[_0x647d('0x1')]={'body':{'type':Sequelize[_0x647d('0x2')](_0x647d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x647d('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x647d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x647d('0x5')]('in',_0x647d('0x6')),'defaultValue':_0x647d('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x647d('0x7')]},'providerName':{'type':Sequelize[_0x647d('0x8')]},'providerResponse':{'type':Sequelize[_0x647d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 50ae247..b20f9f6 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 _0x0873=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','fullname','email','internal','manual','interface','channel','event','EventManager','parse','interaction','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','User','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','query','filters'];(function(_0x35e9a8,_0x22bef3){var _0x470a34=function(_0x2e7c9d){while(--_0x2e7c9d){_0x35e9a8['push'](_0x35e9a8['shift']());}};_0x470a34(++_0x22bef3);}(_0x0873,0x153));var _0x3087=function(_0x1a231a,_0x3a0830){_0x1a231a=_0x1a231a-0x0;var _0x4a25e0=_0x0873[_0x1a231a];return _0x4a25e0;};'use strict';var emlformat=require(_0x3087('0x0'));var rimraf=require(_0x3087('0x1'));var zipdir=require(_0x3087('0x2'));var jsonpatch=require(_0x3087('0x3'));var rp=require(_0x3087('0x4'));var moment=require('moment');var BPromise=require(_0x3087('0x5'));var Mustache=require(_0x3087('0x6'));var util=require(_0x3087('0x7'));var path=require(_0x3087('0x8'));var sox=require(_0x3087('0x9'));var csv=require('to-csv');var ejs=require(_0x3087('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3087('0xb'));var crypto=require(_0x3087('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3087('0xd'));var toCsv=require(_0x3087('0xe'));var querystring=require(_0x3087('0xf'));var Papa=require('papaparse');var Redis=require(_0x3087('0x10'));var authService=require(_0x3087('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3087('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3087('0x13'))(_0x3087('0x14'));var utils=require(_0x3087('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3087('0x16'))['db'];config['redis']=_['defaults'](config[_0x3087('0x17')],{'host':_0x3087('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3087('0x17')]));require(_0x3087('0x19'))[_0x3087('0x1a')](socket);var jayson=require(_0x3087('0x1b'));var client=jayson[_0x3087('0x1c')][_0x3087('0x1d')]({'port':0x232c});var client9002=jayson[_0x3087('0x1c')][_0x3087('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x250764,_0x1f1691,_0x52a6a5,_0x333b4f){return new BPromise(function(_0x3c8cae,_0x3e879e){var _0xb919fd=_0x333b4f||client;return _0xb919fd[_0x3087('0x1e')](_0x250764,_0x52a6a5)[_0x3087('0x1f')](function(_0x2f40cc){logger[_0x3087('0x20')](_0x3087('0x21'),_0x1f1691,'request\x20sent');logger[_0x3087('0x22')](_0x3087('0x23'),_0x1f1691,_0x3087('0x24'),JSON[_0x3087('0x25')](_0x2f40cc));if(_0x2f40cc['error']){if(_0x2f40cc[_0x3087('0x26')][_0x3087('0x27')]===0x1f4){logger[_0x3087('0x26')]('ChatMessage,\x20%s,\x20%s',_0x1f1691,_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);return _0x3e879e(_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);}logger[_0x3087('0x26')](_0x3087('0x21'),_0x1f1691,_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);return _0x3c8cae(_0x2f40cc['error'][_0x3087('0x28')]);}else{logger[_0x3087('0x20')](_0x3087('0x21'),_0x1f1691,_0x3087('0x24'));_0x3c8cae(_0x2f40cc['result'][_0x3087('0x28')]);}})['catch'](function(_0x402c58){logger[_0x3087('0x26')](_0x3087('0x21'),_0x1f1691,_0x402c58);_0x3e879e(_0x402c58);});});}function respondWithStatusCode(_0x4d83bf,_0x828590){_0x828590=_0x828590||0xcc;return function(_0x21681e){if(_0x21681e){return _0x4d83bf['sendStatus'](_0x828590);}return _0x4d83bf[_0x3087('0x29')](_0x828590)[_0x3087('0x2a')]();};}function respondWithResult(_0x1d5d1e,_0x39ba88){_0x39ba88=_0x39ba88||0xc8;return function(_0xf26d76){if(_0xf26d76){return _0x1d5d1e['status'](_0x39ba88)[_0x3087('0x2b')](_0xf26d76);}};}function respondWithFilteredResult(_0x4d8f9a,_0x2daac5){return function(_0x1306c9){if(_0x1306c9){var _0x406f97=typeof _0x2daac5[_0x3087('0x2c')]==='undefined'&&typeof _0x2daac5[_0x3087('0x2d')]===_0x3087('0x2e');var _0x353823=_0x1306c9[_0x3087('0x2f')];var _0x4c2d95=_0x406f97?0x0:_0x2daac5['offset'];var _0x2e084c=_0x406f97?_0x1306c9['count']:_0x2daac5[_0x3087('0x2c')]+_0x2daac5[_0x3087('0x2d')];var _0x5dbc57;if(_0x2e084c>=_0x353823){_0x2e084c=_0x353823;_0x5dbc57=0xc8;}else{_0x5dbc57=0xce;}_0x4d8f9a[_0x3087('0x29')](_0x5dbc57);return _0x4d8f9a[_0x3087('0x30')](_0x3087('0x31'),_0x4c2d95+'-'+_0x2e084c+'/'+_0x353823)[_0x3087('0x2b')](_0x1306c9);}return null;};}function patchUpdates(_0x5ad6bd){return function(_0x2984be){try{jsonpatch[_0x3087('0x32')](_0x2984be,_0x5ad6bd,!![]);}catch(_0x4fab88){return BPromise[_0x3087('0x33')](_0x4fab88);}return _0x2984be[_0x3087('0x34')]();};}function saveUpdates(_0x4233c9,_0x53a188){return function(_0x428436){if(_0x428436){return _0x428436[_0x3087('0x35')](_0x4233c9)['then'](function(_0x520af9){return _0x520af9;});}return null;};}function removeEntity(_0x28866a,_0xc8ca0a){return function(_0x4f38c0){if(_0x4f38c0){return _0x4f38c0[_0x3087('0x36')]()[_0x3087('0x1f')](function(){_0x28866a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7b66,_0x272873){return function(_0x589ebd){if(!_0x589ebd){_0x4c7b66['sendStatus'](0x194);}return _0x589ebd;};}function handleError(_0x413311,_0x10176c){_0x10176c=_0x10176c||0x1f4;return function(_0x19bcee){logger[_0x3087('0x26')](_0x19bcee[_0x3087('0x37')]);if(_0x19bcee[_0x3087('0x38')]){delete _0x19bcee['name'];}_0x413311[_0x3087('0x29')](_0x10176c)[_0x3087('0x39')](_0x19bcee);};}exports[_0x3087('0x3a')]=function(_0x45a5b3,_0x1d6d48){var _0x42fcb0={},_0x574ef9={},_0x4343ef={'count':0x0,'rows':[]};var _0x54ff8e=_[_0x3087('0x3b')](db[_0x3087('0x3c')][_0x3087('0x3d')],function(_0x307c3c){return{'name':_0x307c3c[_0x3087('0x3e')],'type':_0x307c3c[_0x3087('0x3f')][_0x3087('0x40')]};});_0x574ef9[_0x3087('0x41')]=_['map'](_0x54ff8e,_0x3087('0x38'));_0x574ef9['query']=_[_0x3087('0x42')](_0x45a5b3[_0x3087('0x43')]);_0x574ef9[_0x3087('0x44')]=_['intersection'](_0x574ef9[_0x3087('0x41')],_0x574ef9['query']);_0x42fcb0[_0x3087('0x45')]=_[_0x3087('0x46')](_0x574ef9[_0x3087('0x41')],qs[_0x3087('0x47')](_0x45a5b3[_0x3087('0x43')][_0x3087('0x47')]));_0x42fcb0[_0x3087('0x45')]=_0x42fcb0['attributes'][_0x3087('0x48')]?_0x42fcb0[_0x3087('0x45')]:_0x574ef9[_0x3087('0x41')];if(!_0x45a5b3[_0x3087('0x43')][_0x3087('0x49')](_0x3087('0x4a'))){_0x42fcb0[_0x3087('0x2d')]=qs[_0x3087('0x2d')](_0x45a5b3[_0x3087('0x43')][_0x3087('0x2d')]);_0x42fcb0[_0x3087('0x2c')]=qs['offset'](_0x45a5b3['query'][_0x3087('0x2c')]);}_0x42fcb0[_0x3087('0x4b')]=qs[_0x3087('0x4c')](_0x45a5b3['query'][_0x3087('0x4c')]);_0x42fcb0['where']=qs[_0x3087('0x44')](_[_0x3087('0x4d')](_0x45a5b3[_0x3087('0x43')],_0x574ef9[_0x3087('0x44')]),_0x54ff8e);if(_0x45a5b3[_0x3087('0x43')][_0x3087('0x4e')]){_0x42fcb0[_0x3087('0x4f')]=_[_0x3087('0x50')](_0x42fcb0['where'],{'$or':_['map'](_0x54ff8e,function(_0xedc4f5){if(_0xedc4f5[_0x3087('0x3f')]!==_0x3087('0x51')){var _0x44a5c6={};_0x44a5c6[_0xedc4f5[_0x3087('0x38')]]={'$like':'%'+_0x45a5b3[_0x3087('0x43')][_0x3087('0x4e')]+'%'};return _0x44a5c6;}})});}_0x42fcb0=_[_0x3087('0x50')]({},_0x42fcb0,_0x45a5b3[_0x3087('0x52')]);var _0xd7825={'where':_0x42fcb0[_0x3087('0x4f')]};return db[_0x3087('0x3c')][_0x3087('0x2f')](_0xd7825)[_0x3087('0x1f')](function(_0xa2cd2e){_0x4343ef[_0x3087('0x2f')]=_0xa2cd2e;if(_0x45a5b3['query'][_0x3087('0x53')]){_0x42fcb0[_0x3087('0x54')]=[{'all':!![]}];}return db[_0x3087('0x3c')][_0x3087('0x55')](_0x42fcb0);})[_0x3087('0x1f')](function(_0x274c9c){_0x4343ef[_0x3087('0x56')]=_0x274c9c;return _0x4343ef;})[_0x3087('0x1f')](respondWithFilteredResult(_0x1d6d48,_0x42fcb0))[_0x3087('0x57')](handleError(_0x1d6d48,null));};exports['show']=function(_0x47f866,_0x50742e){var _0x1a28f8={'raw':!![],'where':{'id':_0x47f866['params']['id']}},_0x4043c0={};_0x4043c0['model']=_[_0x3087('0x42')](db[_0x3087('0x3c')]['rawAttributes']);_0x4043c0[_0x3087('0x43')]=_[_0x3087('0x42')](_0x47f866[_0x3087('0x43')]);_0x4043c0[_0x3087('0x44')]=_[_0x3087('0x46')](_0x4043c0[_0x3087('0x41')],_0x4043c0[_0x3087('0x43')]);_0x1a28f8[_0x3087('0x45')]=_[_0x3087('0x46')](_0x4043c0[_0x3087('0x41')],qs['fields'](_0x47f866[_0x3087('0x43')][_0x3087('0x47')]));_0x1a28f8[_0x3087('0x45')]=_0x1a28f8['attributes'][_0x3087('0x48')]?_0x1a28f8[_0x3087('0x45')]:_0x4043c0[_0x3087('0x41')];if(_0x47f866['query']['includeAll']){_0x1a28f8['include']=[{'all':!![]}];}_0x1a28f8=_['merge']({},_0x1a28f8,_0x47f866[_0x3087('0x52')]);return db['ChatMessage'][_0x3087('0x58')](_0x1a28f8)[_0x3087('0x1f')](handleEntityNotFound(_0x50742e,null))[_0x3087('0x1f')](respondWithResult(_0x50742e,null))[_0x3087('0x57')](handleError(_0x50742e,null));};exports[_0x3087('0x59')]=function(_0x171dbb,_0xfed153){return db['ChatMessage'][_0x3087('0x59')](_0x171dbb['body'],{})[_0x3087('0x1f')](respondWithResult(_0xfed153,0xc9))[_0x3087('0x57')](handleError(_0xfed153,null));};exports['update']=function(_0x2750e6,_0x11f25d){if(_0x2750e6[_0x3087('0x5a')]['id']){delete _0x2750e6['body']['id'];}return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2750e6['params']['id']}})[_0x3087('0x1f')](handleEntityNotFound(_0x11f25d,null))[_0x3087('0x1f')](saveUpdates(_0x2750e6[_0x3087('0x5a')],null))['then'](respondWithResult(_0x11f25d,null))[_0x3087('0x57')](handleError(_0x11f25d,null));};exports[_0x3087('0x36')]=function(_0x5dce3d,_0xe4b846){return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x5dce3d[_0x3087('0x5b')]['id']}})[_0x3087('0x1f')](handleEntityNotFound(_0xe4b846,null))[_0x3087('0x1f')](removeEntity(_0xe4b846,null))[_0x3087('0x57')](handleError(_0xe4b846,null));};exports[_0x3087('0x5c')]=function(_0x3e1f6b,_0x8c570f){return db[_0x3087('0x3c')][_0x3087('0x5c')]()['then'](respondWithResult(_0x8c570f,null))['catch'](handleError(_0x8c570f,null));};var interaction_log=require(_0x3087('0x13'))(_0x3087('0x5d'));exports[_0x3087('0x5e')]=function(_0x2d2ce7,_0x29c5d8,_0x51f1ad){var _0x20c380={'agent':{},'channel':_0x3087('0x5f')};if(_0x2d2ce7[_0x3087('0x5a')]['id']){delete _0x2d2ce7[_0x3087('0x5a')]['id'];}_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x60')]=!![];_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x61')]=moment()[_0x3087('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')]=_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')]||_0x2d2ce7[_0x3087('0x64')]['id'];_0x20c380[_0x3087('0x65')]['id']=_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')];return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2d2ce7[_0x3087('0x5b')]['id'],'UserId':null}})[_0x3087('0x1f')](handleEntityNotFound(_0x29c5d8,null))[_0x3087('0x1f')](saveUpdates(_0x2d2ce7[_0x3087('0x5a')],null))[_0x3087('0x1f')](function(_0x3c0bfc){if(_0x3c0bfc){_0x20c380[_0x3087('0x28')]=_0x3c0bfc[_0x3087('0x66')]({'plain':!![]});return db[_0x3087('0x67')][_0x3087('0x58')]({'where':{'id':_0x3c0bfc[_0x3087('0x68')]}});}return null;})[_0x3087('0x1f')](handleEntityNotFound(_0x29c5d8,null))['then'](function(_0x101216){if(_0x101216){return _0x101216[_0x3087('0x35')]({'UserId':_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')],'read1stAt':_[_0x3087('0x69')](_0x101216[_0x3087('0x6a')])?moment()[_0x3087('0x62')](_0x3087('0x6b')):undefined});}return null;})[_0x3087('0x1f')](function(_0xe75dfa){if(_0xe75dfa){_0x20c380['interaction']=_0xe75dfa[_0x3087('0x66')]({'plain':!![]});interaction_log['info'](_0x3087('0x6c'),_0x2d2ce7['user']['id'],_0x2d2ce7[_0x3087('0x64')]['name'],_0x2d2ce7['user']['role'],_0x20c380['interaction']['id'],_0x2d2ce7[_0x3087('0x5a')]?JSON[_0x3087('0x25')](_0x2d2ce7[_0x3087('0x5a')]):_0x3087('0x6d'));return respondWithRpcPromise(_0x3087('0x6e'),_0x3087('0x6f'),_0x20c380);}return null;})['then'](function(_0x47307b){var _0x136233=_0x3087('0x70')+_0x47307b[_0x3087('0x28')][_0x3087('0x71')];return db[_0x3087('0x72')][_0x3087('0x43')](_0x136233,{'type':db[_0x3087('0x73')]['QueryTypes'][_0x3087('0x74')],'raw':!![]})['then'](function(_0x2707ce){return _0x2707ce;});})[_0x3087('0x1f')](function(_0x72cf40){if(_0x72cf40){_0x20c380['message']['contact']=_0x72cf40[0x0];if(!_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')])return;return db['User'][_0x3087('0x58')]({'where':{'id':_0x2d2ce7['body']['UserId'],'role':_0x3087('0x65')},'attributes':['id',_0x3087('0x38'),_0x3087('0x75'),_0x3087('0x76'),_0x3087('0x77')],'raw':!![]});}return null;})[_0x3087('0x1f')](function(_0x5a7c12){if(!_0x5a7c12)return null;_0x20c380[_0x3087('0x28')][_0x3087('0x65')]=_0x5a7c12;return _0x20c380;})[_0x3087('0x1f')](function(_0x1c1968){if(_0x1c1968){if(_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x78')]){_0x20c380[_0x3087('0x28')][_0x3087('0x79')]=util[_0x3087('0x62')]('SIP/%s',_0x2d2ce7[_0x3087('0x64')]['name']);_0x20c380[_0x3087('0x28')]['channel']=_0x20c380[_0x3087('0x7a')];_0x20c380[_0x3087('0x28')]['motionChannel']=_0x20c380['channel'];_0x20c380[_0x3087('0x28')][_0x3087('0x7b')]=_0x3087('0x5e');return respondWithRpcPromise(_0x3087('0x7c'),'EventManager',{'event':'acceptmessage','message':_[_0x3087('0x50')](_0x20c380[_0x3087('0x28')],JSON[_0x3087('0x7d')](_0x20c380[_0x3087('0x7e')][_0x3087('0x7f')]))},client9002)[_0x3087('0x1f')](function(){return _0x20c380;});}return _0x20c380;}return null;})[_0x3087('0x1f')](respondWithResult(_0x29c5d8,null))[_0x3087('0x57')](handleError(_0x29c5d8,null));};var interaction_log=require(_0x3087('0x13'))('chat-interactions');exports['reject']=function(_0x2ad943,_0x41c440,_0xe73b11){var _0x3c0cc5={'agent':{},'channel':_0x3087('0x5f')};if(_0x2ad943['body']['id']){delete _0x2ad943[_0x3087('0x5a')]['id'];}_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')]=_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')]||_0x2ad943[_0x3087('0x64')]['id'];_0x3c0cc5[_0x3087('0x65')]['id']=_0x2ad943['body']['UserId'];return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2ad943[_0x3087('0x5b')]['id'],'UserId':null}})[_0x3087('0x1f')](handleEntityNotFound(_0x41c440,null))[_0x3087('0x1f')](function(_0x103fbf){if(_0x103fbf){_0x3c0cc5['message']=_0x103fbf[_0x3087('0x66')]({'plain':!![]});return db[_0x3087('0x67')][_0x3087('0x58')]({'where':{'id':_0x103fbf[_0x3087('0x68')]}});}return null;})[_0x3087('0x1f')](handleEntityNotFound(_0x41c440,null))['then'](function(_0x4290a4){if(_0x4290a4){_0x3c0cc5['interaction']=_0x4290a4[_0x3087('0x66')]({'plain':!![]});interaction_log[_0x3087('0x20')](_0x3087('0x80'),_0x2ad943['user']['id'],_0x2ad943[_0x3087('0x64')]['name'],_0x2ad943[_0x3087('0x64')][_0x3087('0x81')],_0x3c0cc5[_0x3087('0x7e')]['id'],_0x2ad943[_0x3087('0x5a')]?JSON[_0x3087('0x25')](_0x2ad943[_0x3087('0x5a')]):'null');return respondWithRpcPromise(_0x3087('0x82'),_0x3087('0x83'),_0x3c0cc5);}return null;})[_0x3087('0x1f')](function(_0x5df46a){var _0x26c389=_0x3087('0x70')+_0x5df46a[_0x3087('0x28')][_0x3087('0x71')];return db[_0x3087('0x72')][_0x3087('0x43')](_0x26c389,{'type':db['Sequelize'][_0x3087('0x84')]['SELECT'],'raw':!![]})[_0x3087('0x1f')](function(_0x427a1d){return _0x427a1d;});})['then'](function(_0x29738e){if(_0x29738e){_0x3c0cc5[_0x3087('0x28')]['contact']=_0x29738e[0x0];if(!_0x2ad943['body']['UserId'])return;return db[_0x3087('0x85')][_0x3087('0x58')]({'where':{'id':_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')],'role':'agent'},'attributes':['id','name',_0x3087('0x75'),'email',_0x3087('0x77')],'raw':!![]});}return null;})[_0x3087('0x1f')](function(_0x4f501b){if(!_0x4f501b)return null;_0x3c0cc5[_0x3087('0x28')][_0x3087('0x65')]=_0x4f501b;return _0x3c0cc5;})[_0x3087('0x1f')](function(_0x54c472){if(_0x54c472){_0x54c472['message'][_0x3087('0x79')]=util[_0x3087('0x62')]('SIP/%s',_0x2ad943[_0x3087('0x64')][_0x3087('0x38')]);_0x54c472[_0x3087('0x28')][_0x3087('0x7a')]=_0x3c0cc5[_0x3087('0x7a')];_0x54c472[_0x3087('0x28')][_0x3087('0x86')]=_0x3c0cc5['channel'];_0x54c472[_0x3087('0x28')][_0x3087('0x7b')]='reject';respondWithRpcPromise('EventManager',_0x3087('0x7c'),{'event':_0x3087('0x87'),'message':_[_0x3087('0x50')](_0x3c0cc5[_0x3087('0x28')],JSON['parse'](_0x3c0cc5[_0x3087('0x7e')][_0x3087('0x7f')]))},client9002);return _0x3c0cc5;}return null;})['then'](respondWithResult(_0x41c440,null))[_0x3087('0x57')](handleError(_0x41c440,null));};
\ No newline at end of file
+var _0x0864=['Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatMessage','include','show','params','includeAll','create','body','find','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','format','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize'];(function(_0x426dd2,_0x4b0012){var _0x4bc76c=function(_0x4c0732){while(--_0x4c0732){_0x426dd2['push'](_0x426dd2['shift']());}};_0x4bc76c(++_0x4b0012);}(_0x0864,0x1a7));var _0x4086=function(_0x2275e0,_0x246f81){_0x2275e0=_0x2275e0-0x0;var _0xe75c14=_0x0864[_0x2275e0];return _0xe75c14;};'use strict';var emlformat=require(_0x4086('0x0'));var rimraf=require(_0x4086('0x1'));var zipdir=require(_0x4086('0x2'));var jsonpatch=require(_0x4086('0x3'));var rp=require(_0x4086('0x4'));var moment=require(_0x4086('0x5'));var BPromise=require(_0x4086('0x6'));var Mustache=require(_0x4086('0x7'));var util=require(_0x4086('0x8'));var path=require(_0x4086('0x9'));var sox=require(_0x4086('0xa'));var csv=require(_0x4086('0xb'));var ejs=require(_0x4086('0xc'));var fs=require('fs');var fs_extra=require(_0x4086('0xd'));var _=require(_0x4086('0xe'));var squel=require('squel');var crypto=require(_0x4086('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4086('0x10'));var toCsv=require(_0x4086('0xb'));var querystring=require(_0x4086('0x11'));var Papa=require(_0x4086('0x12'));var Redis=require('ioredis');var authService=require(_0x4086('0x13'));var qs=require(_0x4086('0x14'));var as=require(_0x4086('0x15'));var hardwareService=require(_0x4086('0x16'));var logger=require(_0x4086('0x17'))(_0x4086('0x18'));var utils=require('../../config/utils');var config=require(_0x4086('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4086('0x1a')]=_['defaults'](config[_0x4086('0x1a')],{'host':_0x4086('0x1b'),'port':0x18eb});var socket=require(_0x4086('0x1c'))(new Redis(config['redis']));require(_0x4086('0x1d'))['register'](socket);var jayson=require(_0x4086('0x1e'));var client=jayson[_0x4086('0x1f')][_0x4086('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x4086('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1c35b1,_0xa0ad95,_0x4ecf07,_0x10945a){return new BPromise(function(_0x4b5ef7,_0x403cd1){var _0x849706=_0x10945a||client;return _0x849706[_0x4086('0x21')](_0x1c35b1,_0x4ecf07)[_0x4086('0x22')](function(_0x38287d){logger[_0x4086('0x23')](_0x4086('0x24'),_0xa0ad95,_0x4086('0x25'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xa0ad95,_0x4086('0x25'),JSON[_0x4086('0x26')](_0x38287d));if(_0x38287d['error']){if(_0x38287d[_0x4086('0x27')]['code']===0x1f4){logger[_0x4086('0x27')](_0x4086('0x24'),_0xa0ad95,_0x38287d['error'][_0x4086('0x28')]);return _0x403cd1(_0x38287d[_0x4086('0x27')][_0x4086('0x28')]);}logger[_0x4086('0x27')](_0x4086('0x24'),_0xa0ad95,_0x38287d['error']['message']);return _0x4b5ef7(_0x38287d[_0x4086('0x27')][_0x4086('0x28')]);}else{logger[_0x4086('0x23')](_0x4086('0x24'),_0xa0ad95,_0x4086('0x25'));_0x4b5ef7(_0x38287d[_0x4086('0x29')][_0x4086('0x28')]);}})[_0x4086('0x2a')](function(_0x227004){logger[_0x4086('0x27')]('ChatMessage,\x20%s,\x20%s',_0xa0ad95,_0x227004);_0x403cd1(_0x227004);});});}function respondWithStatusCode(_0x30c70c,_0x5466e0){_0x5466e0=_0x5466e0||0xcc;return function(_0x30efee){if(_0x30efee){return _0x30c70c[_0x4086('0x2b')](_0x5466e0);}return _0x30c70c[_0x4086('0x2c')](_0x5466e0)[_0x4086('0x2d')]();};}function respondWithResult(_0x2da47f,_0x4abc1c){_0x4abc1c=_0x4abc1c||0xc8;return function(_0x1a1475){if(_0x1a1475){return _0x2da47f[_0x4086('0x2c')](_0x4abc1c)[_0x4086('0x2e')](_0x1a1475);}};}function respondWithFilteredResult(_0x37c68c,_0x21605b){return function(_0x35d031){if(_0x35d031){var _0x1f85f7=typeof _0x21605b[_0x4086('0x2f')]===_0x4086('0x30')&&typeof _0x21605b['limit']===_0x4086('0x30');var _0x29e275=_0x35d031['count'];var _0x20c0ec=_0x1f85f7?0x0:_0x21605b[_0x4086('0x2f')];var _0x1698b1=_0x1f85f7?_0x35d031[_0x4086('0x31')]:_0x21605b[_0x4086('0x2f')]+_0x21605b[_0x4086('0x32')];var _0x35b93d;if(_0x1698b1>=_0x29e275){_0x1698b1=_0x29e275;_0x35b93d=0xc8;}else{_0x35b93d=0xce;}_0x37c68c[_0x4086('0x2c')](_0x35b93d);return _0x37c68c[_0x4086('0x33')](_0x4086('0x34'),_0x20c0ec+'-'+_0x1698b1+'/'+_0x29e275)[_0x4086('0x2e')](_0x35d031);}return null;};}function patchUpdates(_0x154662){return function(_0x4f1941){try{jsonpatch[_0x4086('0x35')](_0x4f1941,_0x154662,!![]);}catch(_0x449ce2){return BPromise[_0x4086('0x36')](_0x449ce2);}return _0x4f1941[_0x4086('0x37')]();};}function saveUpdates(_0xbc130b,_0x397a47){return function(_0x38d377){if(_0x38d377){return _0x38d377[_0x4086('0x38')](_0xbc130b)[_0x4086('0x22')](function(_0x3c8ca3){return _0x3c8ca3;});}return null;};}function removeEntity(_0x5ef85c,_0x254e40){return function(_0x13e5e2){if(_0x13e5e2){return _0x13e5e2[_0x4086('0x39')]()[_0x4086('0x22')](function(){_0x5ef85c[_0x4086('0x2c')](0xcc)[_0x4086('0x2d')]();});}};}function handleEntityNotFound(_0x2f5fd1,_0x1ed68b){return function(_0x4d23e4){if(!_0x4d23e4){_0x2f5fd1['sendStatus'](0x194);}return _0x4d23e4;};}function handleError(_0x7550e6,_0xa7ed3c){_0xa7ed3c=_0xa7ed3c||0x1f4;return function(_0x899dbe){logger[_0x4086('0x27')](_0x899dbe['stack']);if(_0x899dbe['name']){delete _0x899dbe[_0x4086('0x3a')];}_0x7550e6[_0x4086('0x2c')](_0xa7ed3c)[_0x4086('0x3b')](_0x899dbe);};}exports[_0x4086('0x3c')]=function(_0x138aba,_0x4f4961){var _0x479a30={},_0x4f4152={},_0x5a0db4={'count':0x0,'rows':[]};var _0x38f7b0=_['map'](db['ChatMessage'][_0x4086('0x3d')],function(_0x173aed){return{'name':_0x173aed[_0x4086('0x3e')],'type':_0x173aed[_0x4086('0x3f')][_0x4086('0x40')]};});_0x4f4152[_0x4086('0x41')]=_[_0x4086('0x42')](_0x38f7b0,_0x4086('0x3a'));_0x4f4152[_0x4086('0x43')]=_[_0x4086('0x44')](_0x138aba['query']);_0x4f4152[_0x4086('0x45')]=_[_0x4086('0x46')](_0x4f4152[_0x4086('0x41')],_0x4f4152[_0x4086('0x43')]);_0x479a30[_0x4086('0x47')]=_[_0x4086('0x46')](_0x4f4152[_0x4086('0x41')],qs['fields'](_0x138aba[_0x4086('0x43')][_0x4086('0x48')]));_0x479a30[_0x4086('0x47')]=_0x479a30[_0x4086('0x47')][_0x4086('0x49')]?_0x479a30[_0x4086('0x47')]:_0x4f4152[_0x4086('0x41')];if(!_0x138aba['query'][_0x4086('0x4a')](_0x4086('0x4b'))){_0x479a30[_0x4086('0x32')]=qs['limit'](_0x138aba[_0x4086('0x43')][_0x4086('0x32')]);_0x479a30['offset']=qs[_0x4086('0x2f')](_0x138aba['query']['offset']);}_0x479a30[_0x4086('0x4c')]=qs[_0x4086('0x4d')](_0x138aba[_0x4086('0x43')][_0x4086('0x4d')]);_0x479a30['where']=qs[_0x4086('0x45')](_[_0x4086('0x4e')](_0x138aba['query'],_0x4f4152[_0x4086('0x45')]),_0x38f7b0);if(_0x138aba[_0x4086('0x43')][_0x4086('0x4f')]){_0x479a30[_0x4086('0x50')]=_[_0x4086('0x51')](_0x479a30[_0x4086('0x50')],{'$or':_['map'](_0x38f7b0,function(_0x5b1010){if(_0x5b1010[_0x4086('0x3f')]!==_0x4086('0x52')){var _0x4dd029={};_0x4dd029[_0x5b1010['name']]={'$like':'%'+_0x138aba[_0x4086('0x43')][_0x4086('0x4f')]+'%'};return _0x4dd029;}})});}_0x479a30=_['merge']({},_0x479a30,_0x138aba[_0x4086('0x53')]);var _0xcaa277={'where':_0x479a30['where']};return db[_0x4086('0x54')][_0x4086('0x31')](_0xcaa277)[_0x4086('0x22')](function(_0x313278){_0x5a0db4[_0x4086('0x31')]=_0x313278;if(_0x138aba['query']['includeAll']){_0x479a30[_0x4086('0x55')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x479a30);})[_0x4086('0x22')](function(_0x283e15){_0x5a0db4['rows']=_0x283e15;return _0x5a0db4;})[_0x4086('0x22')](respondWithFilteredResult(_0x4f4961,_0x479a30))[_0x4086('0x2a')](handleError(_0x4f4961,null));};exports[_0x4086('0x56')]=function(_0x3e30ad,_0x56957d){var _0xcb4134={'raw':!![],'where':{'id':_0x3e30ad[_0x4086('0x57')]['id']}},_0x1d2845={};_0x1d2845[_0x4086('0x41')]=_['keys'](db[_0x4086('0x54')][_0x4086('0x3d')]);_0x1d2845[_0x4086('0x43')]=_['keys'](_0x3e30ad[_0x4086('0x43')]);_0x1d2845['filters']=_[_0x4086('0x46')](_0x1d2845[_0x4086('0x41')],_0x1d2845[_0x4086('0x43')]);_0xcb4134[_0x4086('0x47')]=_[_0x4086('0x46')](_0x1d2845['model'],qs[_0x4086('0x48')](_0x3e30ad[_0x4086('0x43')][_0x4086('0x48')]));_0xcb4134[_0x4086('0x47')]=_0xcb4134[_0x4086('0x47')][_0x4086('0x49')]?_0xcb4134[_0x4086('0x47')]:_0x1d2845[_0x4086('0x41')];if(_0x3e30ad[_0x4086('0x43')][_0x4086('0x58')]){_0xcb4134[_0x4086('0x55')]=[{'all':!![]}];}_0xcb4134=_[_0x4086('0x51')]({},_0xcb4134,_0x3e30ad[_0x4086('0x53')]);return db['ChatMessage']['find'](_0xcb4134)[_0x4086('0x22')](handleEntityNotFound(_0x56957d,null))[_0x4086('0x22')](respondWithResult(_0x56957d,null))[_0x4086('0x2a')](handleError(_0x56957d,null));};exports[_0x4086('0x59')]=function(_0x61dd59,_0x52526b){return db[_0x4086('0x54')]['create'](_0x61dd59[_0x4086('0x5a')],{})['then'](respondWithResult(_0x52526b,0xc9))[_0x4086('0x2a')](handleError(_0x52526b,null));};exports['update']=function(_0x3e808f,_0x3ca31b){if(_0x3e808f['body']['id']){delete _0x3e808f['body']['id'];}return db[_0x4086('0x54')][_0x4086('0x5b')]({'where':{'id':_0x3e808f[_0x4086('0x57')]['id']}})[_0x4086('0x22')](handleEntityNotFound(_0x3ca31b,null))[_0x4086('0x22')](saveUpdates(_0x3e808f[_0x4086('0x5a')],null))['then'](respondWithResult(_0x3ca31b,null))[_0x4086('0x2a')](handleError(_0x3ca31b,null));};exports[_0x4086('0x39')]=function(_0x5a7f33,_0x5da42c){return db[_0x4086('0x54')][_0x4086('0x5b')]({'where':{'id':_0x5a7f33[_0x4086('0x57')]['id']}})['then'](handleEntityNotFound(_0x5da42c,null))[_0x4086('0x22')](removeEntity(_0x5da42c,null))['catch'](handleError(_0x5da42c,null));};exports['describe']=function(_0x4d4bd5,_0x379b28){return db[_0x4086('0x54')][_0x4086('0x5c')]()[_0x4086('0x22')](respondWithResult(_0x379b28,null))['catch'](handleError(_0x379b28,null));};var interaction_log=require(_0x4086('0x17'))('chat-interactions');exports[_0x4086('0x5d')]=function(_0x2b72ca,_0x12c391,_0x43bbda){var _0x41a10c={'agent':{},'channel':_0x4086('0x5e')};if(_0x2b72ca[_0x4086('0x5a')]['id']){delete _0x2b72ca[_0x4086('0x5a')]['id'];}_0x2b72ca[_0x4086('0x5a')][_0x4086('0x5f')]=!![];_0x2b72ca[_0x4086('0x5a')][_0x4086('0x60')]=moment()['format'](_0x4086('0x61'));_0x2b72ca[_0x4086('0x5a')]['UserId']=_0x2b72ca[_0x4086('0x5a')][_0x4086('0x62')]||_0x2b72ca['user']['id'];_0x41a10c[_0x4086('0x63')]['id']=_0x2b72ca['body'][_0x4086('0x62')];return db[_0x4086('0x54')]['find']({'where':{'id':_0x2b72ca['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12c391,null))[_0x4086('0x22')](saveUpdates(_0x2b72ca['body'],null))[_0x4086('0x22')](function(_0x51ee79){if(_0x51ee79){_0x41a10c['message']=_0x51ee79[_0x4086('0x64')]({'plain':!![]});return db[_0x4086('0x65')][_0x4086('0x5b')]({'where':{'id':_0x51ee79[_0x4086('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x12c391,null))[_0x4086('0x22')](function(_0x22f9a9){if(_0x22f9a9){return _0x22f9a9[_0x4086('0x38')]({'UserId':_0x2b72ca[_0x4086('0x5a')][_0x4086('0x62')],'read1stAt':_['isNil'](_0x22f9a9['read1stAt'])?moment()[_0x4086('0x67')](_0x4086('0x61')):undefined});}return null;})[_0x4086('0x22')](function(_0x405687){if(_0x405687){_0x41a10c['interaction']=_0x405687['get']({'plain':!![]});interaction_log[_0x4086('0x23')](_0x4086('0x68'),_0x2b72ca['user']['id'],_0x2b72ca[_0x4086('0x69')][_0x4086('0x3a')],_0x2b72ca[_0x4086('0x69')][_0x4086('0x6a')],_0x41a10c[_0x4086('0x6b')]['id'],_0x2b72ca['body']?JSON[_0x4086('0x26')](_0x2b72ca[_0x4086('0x5a')]):_0x4086('0x6c'));return respondWithRpcPromise(_0x4086('0x6d'),_0x4086('0x6e'),_0x41a10c);}return null;})[_0x4086('0x22')](function(_0x36b163){var _0x54f41f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x36b163[_0x4086('0x28')][_0x4086('0x6f')];return db[_0x4086('0x70')]['query'](_0x54f41f,{'type':db[_0x4086('0x71')][_0x4086('0x72')][_0x4086('0x73')],'raw':!![]})[_0x4086('0x22')](function(_0x59a1fb){return _0x59a1fb;});})[_0x4086('0x22')](function(_0x47d580){if(_0x47d580){_0x41a10c[_0x4086('0x28')][_0x4086('0x74')]=_0x47d580[0x0];if(!_0x2b72ca[_0x4086('0x5a')]['UserId'])return;return db[_0x4086('0x75')]['find']({'where':{'id':_0x2b72ca[_0x4086('0x5a')][_0x4086('0x62')],'role':'agent'},'attributes':['id','name',_0x4086('0x76'),_0x4086('0x77'),_0x4086('0x78')],'raw':!![]});}return null;})[_0x4086('0x22')](function(_0x5a4269){if(!_0x5a4269)return null;_0x41a10c[_0x4086('0x28')][_0x4086('0x63')]=_0x5a4269;return _0x41a10c;})[_0x4086('0x22')](function(_0x14c9d4){if(_0x14c9d4){if(_0x2b72ca[_0x4086('0x5a')][_0x4086('0x79')]){_0x41a10c['message'][_0x4086('0x7a')]=util[_0x4086('0x67')](_0x4086('0x7b'),_0x2b72ca['user'][_0x4086('0x3a')]);_0x41a10c[_0x4086('0x28')][_0x4086('0x7c')]=_0x41a10c['channel'];_0x41a10c[_0x4086('0x28')][_0x4086('0x7d')]=_0x41a10c[_0x4086('0x7c')];_0x41a10c[_0x4086('0x28')]['event']=_0x4086('0x5d');return respondWithRpcPromise(_0x4086('0x7e'),'EventManager',{'event':'acceptmessage','message':_[_0x4086('0x51')](_0x41a10c[_0x4086('0x28')],JSON[_0x4086('0x7f')](_0x41a10c[_0x4086('0x6b')][_0x4086('0x80')]))},client9002)[_0x4086('0x22')](function(){return _0x41a10c;});}return _0x41a10c;}return null;})[_0x4086('0x22')](respondWithResult(_0x12c391,null))['catch'](handleError(_0x12c391,null));};var interaction_log=require(_0x4086('0x17'))(_0x4086('0x81'));exports['reject']=function(_0x9d911d,_0x1929a0,_0x35bc48){var _0x339e41={'agent':{},'channel':_0x4086('0x5e')};if(_0x9d911d[_0x4086('0x5a')]['id']){delete _0x9d911d[_0x4086('0x5a')]['id'];}_0x9d911d[_0x4086('0x5a')][_0x4086('0x62')]=_0x9d911d[_0x4086('0x5a')][_0x4086('0x62')]||_0x9d911d['user']['id'];_0x339e41[_0x4086('0x63')]['id']=_0x9d911d[_0x4086('0x5a')][_0x4086('0x62')];return db[_0x4086('0x54')]['find']({'where':{'id':_0x9d911d['params']['id'],'UserId':null}})[_0x4086('0x22')](handleEntityNotFound(_0x1929a0,null))['then'](function(_0x2eefcd){if(_0x2eefcd){_0x339e41[_0x4086('0x28')]=_0x2eefcd[_0x4086('0x64')]({'plain':!![]});return db[_0x4086('0x65')][_0x4086('0x5b')]({'where':{'id':_0x2eefcd[_0x4086('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x1929a0,null))[_0x4086('0x22')](function(_0xa5307b){if(_0xa5307b){_0x339e41['interaction']=_0xa5307b[_0x4086('0x64')]({'plain':!![]});interaction_log[_0x4086('0x23')](_0x4086('0x82'),_0x9d911d['user']['id'],_0x9d911d['user'][_0x4086('0x3a')],_0x9d911d[_0x4086('0x69')]['role'],_0x339e41['interaction']['id'],_0x9d911d[_0x4086('0x5a')]?JSON['stringify'](_0x9d911d[_0x4086('0x5a')]):_0x4086('0x6c'));return respondWithRpcPromise(_0x4086('0x83'),'rejectMessage',_0x339e41);}return null;})[_0x4086('0x22')](function(_0x4d8bc8){var _0x4f63d8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4d8bc8['message']['ContactId'];return db['sequelize'][_0x4086('0x43')](_0x4f63d8,{'type':db['Sequelize'][_0x4086('0x72')][_0x4086('0x73')],'raw':!![]})[_0x4086('0x22')](function(_0x218bee){return _0x218bee;});})[_0x4086('0x22')](function(_0x345ff2){if(_0x345ff2){_0x339e41[_0x4086('0x28')][_0x4086('0x74')]=_0x345ff2[0x0];if(!_0x9d911d[_0x4086('0x5a')][_0x4086('0x62')])return;return db[_0x4086('0x75')][_0x4086('0x5b')]({'where':{'id':_0x9d911d['body'][_0x4086('0x62')],'role':_0x4086('0x63')},'attributes':['id',_0x4086('0x3a'),_0x4086('0x76'),_0x4086('0x77'),_0x4086('0x78')],'raw':!![]});}return null;})[_0x4086('0x22')](function(_0x14f976){if(!_0x14f976)return null;_0x339e41[_0x4086('0x28')][_0x4086('0x63')]=_0x14f976;return _0x339e41;})['then'](function(_0x4ab5bc){if(_0x4ab5bc){_0x4ab5bc[_0x4086('0x28')][_0x4086('0x7a')]=util[_0x4086('0x67')](_0x4086('0x7b'),_0x9d911d[_0x4086('0x69')]['name']);_0x4ab5bc['message'][_0x4086('0x7c')]=_0x339e41[_0x4086('0x7c')];_0x4ab5bc[_0x4086('0x28')]['motionChannel']=_0x339e41['channel'];_0x4ab5bc[_0x4086('0x28')][_0x4086('0x84')]=_0x4086('0x36');respondWithRpcPromise(_0x4086('0x7e'),_0x4086('0x7e'),{'event':_0x4086('0x85'),'message':_[_0x4086('0x51')](_0x339e41[_0x4086('0x28')],JSON['parse'](_0x339e41['interaction'][_0x4086('0x80')]))},client9002);return _0x339e41;}return null;})[_0x4086('0x22')](respondWithResult(_0x1929a0,null))['catch'](handleError(_0x1929a0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index d5a11fe..92d7e65 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 _0xd4be=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x39635f,_0x45525d){var _0x340960=function(_0x2011a7){while(--_0x2011a7){_0x39635f['push'](_0x39635f['shift']());}};_0x340960(++_0x45525d);}(_0xd4be,0x9f));var _0xed4b=function(_0x2951fa,_0x9f3367){_0x2951fa=_0x2951fa-0x0;var _0x21e25b=_0xd4be[_0x2951fa];return _0x21e25b;};'use strict';var EventEmitter=require(_0xed4b('0x0'));var ChatMessage=require(_0xed4b('0x1'))['db'][_0xed4b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xed4b('0x3')](0x0);var events={'afterCreate':_0xed4b('0x4'),'afterUpdate':_0xed4b('0x5'),'afterDestroy':_0xed4b('0x6')};function emitEvent(_0x37d4c3){return function(_0x5694a8,_0x2ce761,_0x550bb2){ChatMessageEvents[_0xed4b('0x7')](_0x37d4c3+':'+_0x5694a8['id'],_0x5694a8);ChatMessageEvents[_0xed4b('0x7')](_0x37d4c3,_0x5694a8);_0x550bb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xed4b('0x8')](e,emitEvent(event));}}module[_0xed4b('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xd3b5=['ChatMessage','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x45963c,_0x5ca146){var _0x55c6f6=function(_0x25433c){while(--_0x25433c){_0x45963c['push'](_0x45963c['shift']());}};_0x55c6f6(++_0x5ca146);}(_0xd3b5,0x1b7));var _0x5d3b=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xd3b5[_0x48d6a3];return _0x38bfa0;};'use strict';var EventEmitter=require(_0x5d3b('0x0'));var ChatMessage=require(_0x5d3b('0x1'))['db'][_0x5d3b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5d3b('0x3')](0x0);var events={'afterCreate':_0x5d3b('0x4'),'afterUpdate':_0x5d3b('0x5'),'afterDestroy':_0x5d3b('0x6')};function emitEvent(_0x127b3d){return function(_0x587166,_0x2fbbcb,_0xaaee2a){ChatMessageEvents[_0x5d3b('0x7')](_0x127b3d+':'+_0x587166['id'],_0x587166);ChatMessageEvents[_0x5d3b('0x7')](_0x127b3d,_0x587166);_0xaaee2a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5d3b('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 1881bfe..d848eba 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 _0x623e=['error','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','isNil','UserId','ChatInteraction','findOne','then','update','createdAt'];(function(_0x290818,_0x500c35){var _0x2cc668=function(_0x605dfb){while(--_0x605dfb){_0x290818['push'](_0x290818['shift']());}};_0x2cc668(++_0x500c35);}(_0x623e,0x65));var _0xe623=function(_0x503166,_0x32adbd){_0x503166=_0x503166-0x0;var _0x57535b=_0x623e[_0x503166];return _0x57535b;};'use strict';var _=require(_0xe623('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe623('0x1'));var moment=require('moment');var BPromise=require(_0xe623('0x2'));var rp=require(_0xe623('0x3'));var fs=require('fs');var path=require(_0xe623('0x4'));var rimraf=require(_0xe623('0x5'));var config=require(_0xe623('0x6'));var attributes=require('./chatMessage.attributes');module[_0xe623('0x7')]=function(_0x5ed775,_0x570056){return _0x5ed775[_0xe623('0x8')](_0xe623('0x9'),attributes,{'tableName':_0xe623('0xa'),'paranoid':![],'indexes':[{'name':_0xe623('0xb'),'fields':[_0xe623('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x511a5c,_0xaf269d,_0x5930e2){var _0x5645fe=_0x5ed775[_0xe623('0xd')];var _0x4300f6=_0x511a5c[_0xe623('0xe')]({'plain':!![]});if(_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()==='in'||_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()==='out'&&!_0x4300f6['secret']&&!_[_0xe623('0x11')](_0x4300f6[_0xe623('0x12')])){_0x5645fe[_0xe623('0x13')][_0xe623('0x14')]({'where':{'id':_0x4300f6['ChatInteractionId']}})[_0xe623('0x15')](function(_0x2d05a2){if(_0x2d05a2){_0x2d05a2[_0xe623('0x16')]({'lastMsgAt':_0x4300f6[_0xe623('0x17')],'lastMsgDirection':_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()});}})['catch'](function(_0x3bee29){console[_0xe623('0x18')](_0x3bee29);});}_0x5930e2();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb1b0=['ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','direction','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports'];(function(_0x1b0b3a,_0x8a793d){var _0x1105a0=function(_0x2fd35d){while(--_0x2fd35d){_0x1b0b3a['push'](_0x1b0b3a['shift']());}};_0x1105a0(++_0x8a793d);}(_0xb1b0,0x1c6));var _0x0b1b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb1b0[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x0b1b('0x0'));var logger=require(_0x0b1b('0x1'))(_0x0b1b('0x2'));var moment=require(_0x0b1b('0x3'));var BPromise=require(_0x0b1b('0x4'));var rp=require(_0x0b1b('0x5'));var fs=require('fs');var path=require(_0x0b1b('0x6'));var rimraf=require(_0x0b1b('0x7'));var config=require('../../config/environment');var attributes=require(_0x0b1b('0x8'));module[_0x0b1b('0x9')]=function(_0x41eb89,_0x7047a1){return _0x41eb89['define'](_0x0b1b('0xa'),attributes,{'tableName':_0x0b1b('0xb'),'paranoid':![],'indexes':[{'name':_0x0b1b('0xc'),'fields':['body'],'type':_0x0b1b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1db22f,_0x3224d6,_0x57cbe8){var _0x26c9a9=_0x41eb89[_0x0b1b('0xe')];var _0x4ee018=_0x1db22f['get']({'plain':!![]});if(_0x4ee018['direction'][_0x0b1b('0xf')]()==='in'||_0x4ee018['direction'][_0x0b1b('0xf')]()===_0x0b1b('0x10')&&!_0x4ee018[_0x0b1b('0x11')]&&!_[_0x0b1b('0x12')](_0x4ee018[_0x0b1b('0x13')])){_0x26c9a9[_0x0b1b('0x14')][_0x0b1b('0x15')]({'where':{'id':_0x4ee018[_0x0b1b('0x16')]}})[_0x0b1b('0x17')](function(_0x1c0166){if(_0x1c0166){_0x1c0166['update']({'lastMsgAt':_0x4ee018[_0x0b1b('0x18')],'lastMsgDirection':_0x4ee018[_0x0b1b('0x19')][_0x0b1b('0xf')]()});}})[_0x0b1b('0x1a')](function(_0x44a464){console[_0x0b1b('0x1b')](_0x44a464);});}_0x57cbe8();}},'charset':_0x0b1b('0x1c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index a751045..aa1ba11 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 _0x1f24=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','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','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','bluebird','randomstring'];(function(_0x1ae94c,_0x489198){var _0x91a500=function(_0x51a333){while(--_0x51a333){_0x1ae94c['push'](_0x1ae94c['shift']());}};_0x91a500(++_0x489198);}(_0x1f24,0x12f));var _0x41f2=function(_0x3877aa,_0x42bf1e){_0x3877aa=_0x3877aa-0x0;var _0x4e2e61=_0x1f24[_0x3877aa];return _0x4e2e61;};'use strict';var _=require(_0x41f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x41f2('0x1'));var rs=require(_0x41f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41f2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x41f2('0x4'))('rpc');var config=require(_0x41f2('0x5'));var jayson=require(_0x41f2('0x6'));var client=jayson[_0x41f2('0x7')][_0x41f2('0x8')]({'port':0x232a});config[_0x41f2('0x9')]=_[_0x41f2('0xa')](config[_0x41f2('0x9')],{'host':_0x41f2('0xb'),'port':0x18eb});var socket=require(_0x41f2('0xc'))(new Redis(config['redis']));require(_0x41f2('0xd'))[_0x41f2('0xe')](socket);function respondWithRpcPromise(_0x34ea0a,_0x36e9ba,_0x38c5ef){return new BPromise(function(_0x3454f0,_0x5583da){return client[_0x41f2('0xf')](_0x34ea0a,_0x38c5ef)[_0x41f2('0x10')](function(_0x58642a){logger[_0x41f2('0x11')](_0x41f2('0x12'),_0x36e9ba,'request\x20sent');logger[_0x41f2('0x13')](_0x41f2('0x14'),_0x36e9ba,_0x41f2('0x15'),JSON[_0x41f2('0x16')](_0x58642a));if(_0x58642a['error']){if(_0x58642a[_0x41f2('0x17')][_0x41f2('0x18')]===0x1f4){logger[_0x41f2('0x17')](_0x41f2('0x12'),_0x36e9ba,_0x58642a[_0x41f2('0x17')]['message']);return _0x5583da(_0x58642a[_0x41f2('0x17')][_0x41f2('0x19')]);}logger[_0x41f2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x36e9ba,_0x58642a[_0x41f2('0x17')][_0x41f2('0x19')]);return _0x3454f0(_0x58642a[_0x41f2('0x17')]['message']);}else{logger['info'](_0x41f2('0x12'),_0x36e9ba,'request\x20sent');_0x3454f0(_0x58642a[_0x41f2('0x1a')]['message']);}})['catch'](function(_0x3819cf){logger['error'](_0x41f2('0x12'),_0x36e9ba,_0x3819cf);_0x5583da(_0x3819cf);});});}exports[_0x41f2('0x1b')]=function(_0x3e7db5){var _0x42a9f2=this;return new Promise(function(_0x38d8c0,_0x26d0bc){return db[_0x41f2('0x1c')][_0x41f2('0x1d')](_0x3e7db5[_0x41f2('0x1e')],{'raw':_0x3e7db5[_0x41f2('0x1f')]?_0x3e7db5['options'][_0x41f2('0x20')]===undefined?!![]:![]:!![]})[_0x41f2('0x10')](function(_0x3dc07d){logger['info']('CreateChatMessage',_0x3e7db5);logger['debug'](_0x41f2('0x1b'),_0x3e7db5,JSON[_0x41f2('0x16')](_0x3dc07d));_0x38d8c0(_0x3dc07d);})[_0x41f2('0x21')](function(_0x3ba91e){logger['error'](_0x41f2('0x1b'),_0x3ba91e[_0x41f2('0x19')],_0x3e7db5);_0x26d0bc(_0x42a9f2[_0x41f2('0x17')](0x1f4,_0x3ba91e[_0x41f2('0x19')]));});});};
\ No newline at end of file
+var _0x2c42=['client','http','redis','localhost','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2c42,0x18b));var _0x22c4=function(_0x3ecd63,_0x59f3d2){_0x3ecd63=_0x3ecd63-0x0;var _0x51e2ee=_0x2c42[_0x3ecd63];return _0x51e2ee;};'use strict';var _=require(_0x22c4('0x0'));var util=require('util');var moment=require(_0x22c4('0x1'));var BPromise=require('bluebird');var rs=require(_0x22c4('0x2'));var fs=require('fs');var Redis=require(_0x22c4('0x3'));var db=require(_0x22c4('0x4'))['db'];var utils=require(_0x22c4('0x5'));var logger=require('../../config/logger')(_0x22c4('0x6'));var config=require(_0x22c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x22c4('0x8')][_0x22c4('0x9')]({'port':0x232a});config[_0x22c4('0xa')]=_['defaults'](config['redis'],{'host':_0x22c4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22c4('0xa')]));require(_0x22c4('0xc'))[_0x22c4('0xd')](socket);function respondWithRpcPromise(_0xe515aa,_0x379a6f,_0x36c546){return new BPromise(function(_0x47a088,_0x4e635c){return client[_0x22c4('0xe')](_0xe515aa,_0x36c546)['then'](function(_0x2ee14a){logger[_0x22c4('0xf')](_0x22c4('0x10'),_0x379a6f,_0x22c4('0x11'));logger[_0x22c4('0x12')](_0x22c4('0x13'),_0x379a6f,_0x22c4('0x11'),JSON[_0x22c4('0x14')](_0x2ee14a));if(_0x2ee14a[_0x22c4('0x15')]){if(_0x2ee14a[_0x22c4('0x15')][_0x22c4('0x16')]===0x1f4){logger[_0x22c4('0x15')](_0x22c4('0x10'),_0x379a6f,_0x2ee14a[_0x22c4('0x15')]['message']);return _0x4e635c(_0x2ee14a['error'][_0x22c4('0x17')]);}logger[_0x22c4('0x15')]('ChatMessage,\x20%s,\x20%s',_0x379a6f,_0x2ee14a[_0x22c4('0x15')]['message']);return _0x47a088(_0x2ee14a[_0x22c4('0x15')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x379a6f,_0x22c4('0x11'));_0x47a088(_0x2ee14a[_0x22c4('0x18')]['message']);}})[_0x22c4('0x19')](function(_0x4eb48c){logger[_0x22c4('0x15')](_0x22c4('0x10'),_0x379a6f,_0x4eb48c);_0x4e635c(_0x4eb48c);});});}exports[_0x22c4('0x1a')]=function(_0x4907fb){var _0x295fec=this;return new Promise(function(_0x327264,_0x487f85){return db[_0x22c4('0x1b')][_0x22c4('0x1c')](_0x4907fb[_0x22c4('0x1d')],{'raw':_0x4907fb[_0x22c4('0x1e')]?_0x4907fb['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3bae7f){logger['info'](_0x22c4('0x1a'),_0x4907fb);logger['debug'](_0x22c4('0x1a'),_0x4907fb,JSON[_0x22c4('0x14')](_0x3bae7f));_0x327264(_0x3bae7f);})['catch'](function(_0x470356){logger[_0x22c4('0x15')](_0x22c4('0x1a'),_0x470356[_0x22c4('0x17')],_0x4907fb);_0x487f85(_0x295fec['error'](0x1f4,_0x470356[_0x22c4('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index b1a3fef..51245c1 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 _0x1b20=['removeListener','register','length','chatMessage:','save','remove','emit'];(function(_0x1ee294,_0xbba3f5){var _0x41d205=function(_0x529f07){while(--_0x529f07){_0x1ee294['push'](_0x1ee294['shift']());}};_0x41d205(++_0xbba3f5);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x01b2('0x0'),_0x01b2('0x1'),'update'];function createListener(_0x54eccf,_0x27a406){return function(_0x18e3ff){_0x27a406[_0x01b2('0x2')](_0x54eccf,_0x18e3ff);};}function removeListener(_0x1150fc,_0x1cf757){return function(){ChatMessageEvents[_0x01b2('0x3')](_0x1150fc,_0x1cf757);};}exports[_0x01b2('0x4')]=function(_0x28de4a){for(var _0x46e745=0x0,_0xa64ad1=events[_0x01b2('0x5')];_0x46e745<_0xa64ad1;_0x46e745++){var _0x323470=events[_0x46e745];var _0x508add=createListener(_0x01b2('0x6')+_0x323470,_0x28de4a);ChatMessageEvents['on'](_0x323470,_0x508add);}};
\ No newline at end of file
+var _0x2123=['./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2616e7,_0x259402){var _0x1f9b56=function(_0xa30f7f){while(--_0xa30f7f){_0x2616e7['push'](_0x2616e7['shift']());}};_0x1f9b56(++_0x259402);}(_0x2123,0x190));var _0x3212=function(_0x327383,_0x236284){_0x327383=_0x327383-0x0;var _0x1efb9a=_0x2123[_0x327383];return _0x1efb9a;};'use strict';var ChatMessageEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatMessageEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatMessage:'+_0x4b35e9,_0x5d9d36);ChatMessageEvents['on'](_0x4b35e9,_0x3e17a3);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ba0ad07..3000d39 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 _0xfe9e=['isAuthenticated','tracked','chat','chatmessage:create','create','put','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id'];(function(_0xd89f4e,_0x275d9){var _0x2bf51b=function(_0x68692a){while(--_0x68692a){_0xd89f4e['push'](_0xd89f4e['shift']());}};_0x2bf51b(++_0x275d9);}(_0xfe9e,0x177));var _0xefe9=function(_0x50c16c,_0x43b99e){_0x50c16c=_0x50c16c-0x0;var _0x24dc5f=_0xfe9e[_0x50c16c];return _0x24dc5f;};'use strict';var multer=require(_0xefe9('0x0'));var util=require(_0xefe9('0x1'));var path=require(_0xefe9('0x2'));var timeout=require(_0xefe9('0x3'));var express=require(_0xefe9('0x4'));var router=express[_0xefe9('0x5')]();var fs_extra=require(_0xefe9('0x6'));var auth=require(_0xefe9('0x7'));var interaction=require(_0xefe9('0x8'));var config=require(_0xefe9('0x9'));var controller=require('./chatMessage.controller');router[_0xefe9('0xa')]('/',auth['isAuthenticated'](),controller[_0xefe9('0xb')]);router[_0xefe9('0xa')](_0xefe9('0xc'),auth['isAuthenticated'](),controller[_0xefe9('0xd')]);router['get'](_0xefe9('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xefe9('0xf')](),interaction[_0xefe9('0x10')](_0xefe9('0x11'),_0xefe9('0x12')),controller[_0xefe9('0x13')]);router[_0xefe9('0x14')]('/:id',controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xefe9('0x15')]);router[_0xefe9('0x14')](_0xefe9('0x16'),auth[_0xefe9('0xf')](),controller['reject']);router[_0xefe9('0x17')](_0xefe9('0xe'),auth[_0xefe9('0xf')](),controller[_0xefe9('0x18')]);module[_0xefe9('0x19')]=router;
\ No newline at end of file
+var _0xd296=['describe','post','tracked','chat','chatmessage:create','create','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd296,0x17a));var _0x6d29=function(_0x26e8c8,_0x156146){_0x26e8c8=_0x26e8c8-0x0;var _0x2a25e7=_0xd296[_0x26e8c8];return _0x2a25e7;};'use strict';var multer=require('multer');var util=require(_0x6d29('0x0'));var path=require('path');var timeout=require(_0x6d29('0x1'));var express=require(_0x6d29('0x2'));var router=express[_0x6d29('0x3')]();var fs_extra=require(_0x6d29('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6d29('0x5'));var config=require(_0x6d29('0x6'));var controller=require(_0x6d29('0x7'));router[_0x6d29('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d29('0x9')]);router['get'](_0x6d29('0xa'),auth[_0x6d29('0xb')](),controller[_0x6d29('0xc')]);router[_0x6d29('0x8')]('/:id',auth[_0x6d29('0xb')](),controller['show']);router[_0x6d29('0xd')]('/',auth[_0x6d29('0xb')](),interaction[_0x6d29('0xe')](_0x6d29('0xf'),_0x6d29('0x10')),controller[_0x6d29('0x11')]);router[_0x6d29('0x12')](_0x6d29('0x13'),controller[_0x6d29('0x14')]);router[_0x6d29('0x12')](_0x6d29('0x15'),auth[_0x6d29('0xb')](),controller['accept']);router[_0x6d29('0x12')](_0x6d29('0x16'),auth[_0x6d29('0xb')](),controller[_0x6d29('0x17')]);router[_0x6d29('0x18')](_0x6d29('0x13'),auth[_0x6d29('0xb')](),controller[_0x6d29('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 9f40e17..ec23c2b 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 _0xd8d6=['exports','TEXT','medium','sequelize'];(function(_0x3c819e,_0x1d0c31){var _0x122739=function(_0x2deea9){while(--_0x2deea9){_0x3c819e['push'](_0x3c819e['shift']());}};_0x122739(++_0x1d0c31);}(_0xd8d6,0x177));var _0x6d8d=function(_0x349766,_0x1b7f7d){_0x349766=_0x349766-0x0;var _0xbfc0dd=_0xd8d6[_0x349766];return _0xbfc0dd;};'use strict';var Sequelize=require(_0x6d8d('0x0'));module[_0x6d8d('0x1')]={'body':{'type':Sequelize[_0x6d8d('0x2')](_0x6d8d('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x2ffc=['medium','sequelize','TEXT'];(function(_0x2945bf,_0x4b9ab4){var _0x1c78bb=function(_0xff0f4){while(--_0xff0f4){_0x2945bf['push'](_0x2945bf['shift']());}};_0x1c78bb(++_0x4b9ab4);}(_0x2ffc,0x100));var _0xc2ff=function(_0x32711b,_0x5534fd){_0x32711b=_0x32711b-0x0;var _0x1f23b2=_0x2ffc[_0x32711b];return _0x1f23b2;};'use strict';var Sequelize=require(_0xc2ff('0x0'));module['exports']={'body':{'type':Sequelize[_0xc2ff('0x1')](_0xc2ff('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 9ff4d0d..daa5cd2 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x7a54,0x106));var _0x47a5=function(_0x1e700b,_0x495c85){_0x1e700b=_0x1e700b-0x0;var _0x42ca03=_0x7a54[_0x1e700b];return _0x42ca03;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x7a54,0x106));var _0x47a5=function(_0x1104d5,_0x91b129){_0x1104d5=_0x1104d5-0x0;var _0x43e14c=_0x7a54[_0x1104d5];return _0x43e14c;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f47c7f1..8c3c75d 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 _0x0ff9=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x398eb8,_0x4757d8){var _0x5aa1d6=function(_0x190a13){while(--_0x190a13){_0x398eb8['push'](_0x398eb8['shift']());}};_0x5aa1d6(++_0x4757d8);}(_0x0ff9,0x156));var _0x90ff=function(_0x1ce472,_0x5f5374){_0x1ce472=_0x1ce472-0x0;var _0x5414e7=_0x0ff9[_0x1ce472];return _0x5414e7;};'use strict';var _=require('lodash');var util=require(_0x90ff('0x0'));var logger=require(_0x90ff('0x1'))(_0x90ff('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x90ff('0x3'));var fs=require('fs');var path=require(_0x90ff('0x4'));var rimraf=require(_0x90ff('0x5'));var config=require(_0x90ff('0x6'));var attributes=require(_0x90ff('0x7'));module[_0x90ff('0x8')]=function(_0x46cacb,_0x2ee7dd){return _0x46cacb[_0x90ff('0x9')](_0x90ff('0xa'),attributes,{'tableName':_0x90ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x90ff('0xc'),'collate':_0x90ff('0xd')});};
\ No newline at end of file
+var _0x376f=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x10585d,_0x5b1571){var _0x1c7708=function(_0x32deae){while(--_0x32deae){_0x10585d['push'](_0x10585d['shift']());}};_0x1c7708(++_0x5b1571);}(_0x376f,0x186));var _0xf376=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x376f[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xf376('0x0'));var util=require(_0xf376('0x1'));var logger=require(_0xf376('0x2'))(_0xf376('0x3'));var moment=require(_0xf376('0x4'));var BPromise=require(_0xf376('0x5'));var rp=require(_0xf376('0x6'));var fs=require('fs');var path=require(_0xf376('0x7'));var rimraf=require(_0xf376('0x8'));var config=require(_0xf376('0x9'));var attributes=require(_0xf376('0xa'));module[_0xf376('0xb')]=function(_0x2836c7,_0x34b4e9){return _0x2836c7[_0xf376('0xc')](_0xf376('0xd'),attributes,{'tableName':_0xf376('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf376('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 735016e..1bcec7c 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 _0x5270=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5270,0xab));var _0x0527=function(_0x231c1e,_0xff1290){_0x231c1e=_0x231c1e-0x0;var _0x3a220a=_0x5270[_0x231c1e];return _0x3a220a;};'use strict';var _=require(_0x0527('0x0'));var util=require(_0x0527('0x1'));var moment=require('moment');var BPromise=require(_0x0527('0x2'));var rs=require(_0x0527('0x3'));var fs=require('fs');var Redis=require(_0x0527('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0527('0x5'));var logger=require(_0x0527('0x6'))(_0x0527('0x7'));var config=require(_0x0527('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0527('0x9')][_0x0527('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f6299,_0x3b2f09,_0x5b2929){return new BPromise(function(_0x42a07f,_0xd6cf99){return client[_0x0527('0xb')](_0x3f6299,_0x5b2929)[_0x0527('0xc')](function(_0x2f0a05){logger[_0x0527('0xd')](_0x0527('0xe'),_0x3b2f09,_0x0527('0xf'));logger[_0x0527('0x10')](_0x0527('0x11'),_0x3b2f09,_0x0527('0xf'),JSON['stringify'](_0x2f0a05));if(_0x2f0a05['error']){if(_0x2f0a05[_0x0527('0x12')]['code']===0x1f4){logger[_0x0527('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3b2f09,_0x2f0a05['error']['message']);return _0xd6cf99(_0x2f0a05['error']['message']);}logger['error'](_0x0527('0xe'),_0x3b2f09,_0x2f0a05['error'][_0x0527('0x13')]);return _0x42a07f(_0x2f0a05[_0x0527('0x12')][_0x0527('0x13')]);}else{logger[_0x0527('0xd')](_0x0527('0xe'),_0x3b2f09,_0x0527('0xf'));_0x42a07f(_0x2f0a05[_0x0527('0x14')][_0x0527('0x13')]);}})['catch'](function(_0x2bc699){logger['error'](_0x0527('0xe'),_0x3b2f09,_0x2bc699);_0xd6cf99(_0x2bc699);});});}
\ No newline at end of file
+var _0xa70f=['info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x42d673,_0xbbfd58){var _0x4311b2=function(_0x9ab2a4){while(--_0x9ab2a4){_0x42d673['push'](_0x42d673['shift']());}};_0x4311b2(++_0xbbfd58);}(_0xa70f,0xb4));var _0xfa70=function(_0x351207,_0x3fe17d){_0x351207=_0x351207-0x0;var _0xde3a05=_0xa70f[_0x351207];return _0xde3a05;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfa70('0x0'));var rs=require(_0xfa70('0x1'));var fs=require('fs');var Redis=require(_0xfa70('0x2'));var db=require(_0xfa70('0x3'))['db'];var utils=require(_0xfa70('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfa70('0x5'));var client=jayson[_0xfa70('0x6')][_0xfa70('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fd406,_0xae7c5,_0x527aa1){return new BPromise(function(_0x5c5bb4,_0x46fbac){return client[_0xfa70('0x8')](_0x2fd406,_0x527aa1)[_0xfa70('0x9')](function(_0x210a44){logger[_0xfa70('0xa')](_0xfa70('0xb'),_0xae7c5,'request\x20sent');logger[_0xfa70('0xc')](_0xfa70('0xd'),_0xae7c5,'request\x20sent',JSON['stringify'](_0x210a44));if(_0x210a44[_0xfa70('0xe')]){if(_0x210a44['error'][_0xfa70('0xf')]===0x1f4){logger[_0xfa70('0xe')](_0xfa70('0xb'),_0xae7c5,_0x210a44[_0xfa70('0xe')][_0xfa70('0x10')]);return _0x46fbac(_0x210a44[_0xfa70('0xe')][_0xfa70('0x10')]);}logger[_0xfa70('0xe')](_0xfa70('0xb'),_0xae7c5,_0x210a44['error'][_0xfa70('0x10')]);return _0x5c5bb4(_0x210a44[_0xfa70('0xe')]['message']);}else{logger[_0xfa70('0xa')](_0xfa70('0xb'),_0xae7c5,'request\x20sent');_0x5c5bb4(_0x210a44[_0xfa70('0x11')][_0xfa70('0x10')]);}})[_0xfa70('0x12')](function(_0x3b4496){logger[_0xfa70('0xe')](_0xfa70('0xb'),_0xae7c5,_0x3b4496);_0x46fbac(_0x3b4496);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 028966e..2f49f3e 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 _0xf77b=['create','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xf77b,0xa2));var _0xbf77=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xf77b[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbf77('0x0'));var express=require(_0xbf77('0x1'));var router=express[_0xbf77('0x2')]();var fs_extra=require(_0xbf77('0x3'));var auth=require(_0xbf77('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbf77('0x5'));var controller=require(_0xbf77('0x6'));router[_0xbf77('0x7')]('/',auth[_0xbf77('0x8')](),controller[_0xbf77('0x9')]);router[_0xbf77('0x7')](_0xbf77('0xa'),auth[_0xbf77('0x8')](),controller[_0xbf77('0xb')]);router['get'](_0xbf77('0xc'),auth[_0xbf77('0x8')](),controller['show']);router[_0xbf77('0xd')]('/',auth[_0xbf77('0x8')](),controller[_0xbf77('0xe')]);router['put'](_0xbf77('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbf77('0xc'),auth[_0xbf77('0x8')](),controller['destroy']);module[_0xbf77('0xf')]=router;
\ No newline at end of file
+var _0x70c4=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','multer'];(function(_0x3ed9e8,_0x2ea173){var _0xd41c2c=function(_0x1927f0){while(--_0x1927f0){_0x3ed9e8['push'](_0x3ed9e8['shift']());}};_0xd41c2c(++_0x2ea173);}(_0x70c4,0x18f));var _0x470c=function(_0x1fab16,_0x20ea3c){_0x1fab16=_0x1fab16-0x0;var _0xb22c23=_0x70c4[_0x1fab16];return _0xb22c23;};'use strict';var multer=require(_0x470c('0x0'));var util=require(_0x470c('0x1'));var path=require(_0x470c('0x2'));var timeout=require(_0x470c('0x3'));var express=require(_0x470c('0x4'));var router=express[_0x470c('0x5')]();var fs_extra=require(_0x470c('0x6'));var auth=require(_0x470c('0x7'));var interaction=require(_0x470c('0x8'));var config=require(_0x470c('0x9'));var controller=require(_0x470c('0xa'));router[_0x470c('0xb')]('/',auth[_0x470c('0xc')](),controller['index']);router[_0x470c('0xb')]('/describe',auth[_0x470c('0xc')](),controller[_0x470c('0xd')]);router[_0x470c('0xb')](_0x470c('0xe'),auth[_0x470c('0xc')](),controller[_0x470c('0xf')]);router[_0x470c('0x10')]('/',auth[_0x470c('0xc')](),controller[_0x470c('0x11')]);router[_0x470c('0x12')](_0x470c('0xe'),auth[_0x470c('0xc')](),controller[_0x470c('0x13')]);router['delete'](_0x470c('0xe'),auth[_0x470c('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 1e9e612..7bcea82 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 _0x53ce=['timeout','STRING','exports','ENUM','mouseOver'];(function(_0x16fd27,_0x3b82ef){var _0x2539e9=function(_0x3be0e1){while(--_0x3be0e1){_0x16fd27['push'](_0x16fd27['shift']());}};_0x2539e9(++_0x3b82ef);}(_0x53ce,0x110));var _0xe53c=function(_0x353dfb,_0x4fcbcc){_0x353dfb=_0x353dfb-0x0;var _0x34fc15=_0x53ce[_0x353dfb];return _0x34fc15;};'use strict';var Sequelize=require('sequelize');module[_0xe53c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe53c('0x1')](_0xe53c('0x2'),_0xe53c('0x3')),'defaultValue':_0xe53c('0x2')},'selector':{'type':Sequelize[_0xe53c('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc7b4=['ENUM','mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0x4dce85,_0x140ba9){var _0x5c9710=function(_0x4c3342){while(--_0x4c3342){_0x4dce85['push'](_0x4dce85['shift']());}};_0x5c9710(++_0x140ba9);}(_0xc7b4,0x1ea));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4c7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c7b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4c7b('0x2')](_0x4c7b('0x3'),_0x4c7b('0x4')),'defaultValue':_0x4c7b('0x3')},'selector':{'type':Sequelize[_0x4c7b('0x1')]},'timeout':{'type':Sequelize[_0x4c7b('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 82e6afc..b3c144a 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 _0xe314=['mustache','util','path','sox','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','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','then','error','stack','name','show','model','ChatProactiveAction','rawAttributes','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','update','body','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0xe314,0x7c));var _0x4e31=function(_0x5e1184,_0x22508c){_0x5e1184=_0x5e1184-0x0;var _0x4f6ef7=_0xe314[_0x5e1184];return _0x4f6ef7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e31('0x0'));var zipdir=require(_0x4e31('0x1'));var jsonpatch=require(_0x4e31('0x2'));var rp=require(_0x4e31('0x3'));var moment=require(_0x4e31('0x4'));var BPromise=require(_0x4e31('0x5'));var Mustache=require(_0x4e31('0x6'));var util=require(_0x4e31('0x7'));var path=require(_0x4e31('0x8'));var sox=require(_0x4e31('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e31('0xa'));var _=require(_0x4e31('0xb'));var squel=require(_0x4e31('0xc'));var crypto=require(_0x4e31('0xd'));var jsforce=require(_0x4e31('0xe'));var deskjs=require(_0x4e31('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4e31('0x10'));var Papa=require(_0x4e31('0x11'));var Redis=require(_0x4e31('0x12'));var authService=require(_0x4e31('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4e31('0x14'));var hardwareService=require(_0x4e31('0x15'));var logger=require(_0x4e31('0x16'))(_0x4e31('0x17'));var utils=require(_0x4e31('0x18'));var config=require(_0x4e31('0x19'));var licenseUtil=require(_0x4e31('0x1a'));var db=require(_0x4e31('0x1b'))['db'];function respondWithStatusCode(_0x278a3b,_0x3f8dff){_0x3f8dff=_0x3f8dff||0xcc;return function(_0x41abc8){if(_0x41abc8){return _0x278a3b[_0x4e31('0x1c')](_0x3f8dff);}return _0x278a3b[_0x4e31('0x1d')](_0x3f8dff)[_0x4e31('0x1e')]();};}function respondWithResult(_0x9d0d2,_0x3f7e56){_0x3f7e56=_0x3f7e56||0xc8;return function(_0x8389a9){if(_0x8389a9){return _0x9d0d2[_0x4e31('0x1d')](_0x3f7e56)['json'](_0x8389a9);}};}function respondWithFilteredResult(_0xee6bb9,_0x2e8651){return function(_0x551b8e){if(_0x551b8e){var _0x23dd30=typeof _0x2e8651[_0x4e31('0x1f')]===_0x4e31('0x20')&&typeof _0x2e8651['limit']===_0x4e31('0x20');var _0x14a367=_0x551b8e[_0x4e31('0x21')];var _0x5cdcba=_0x23dd30?0x0:_0x2e8651[_0x4e31('0x1f')];var _0x4264f7=_0x23dd30?_0x551b8e[_0x4e31('0x21')]:_0x2e8651['offset']+_0x2e8651[_0x4e31('0x22')];var _0x2c36f6;if(_0x4264f7>=_0x14a367){_0x4264f7=_0x14a367;_0x2c36f6=0xc8;}else{_0x2c36f6=0xce;}_0xee6bb9['status'](_0x2c36f6);return _0xee6bb9['set'](_0x4e31('0x23'),_0x5cdcba+'-'+_0x4264f7+'/'+_0x14a367)[_0x4e31('0x24')](_0x551b8e);}return null;};}function patchUpdates(_0x38dd6c){return function(_0x349594){try{jsonpatch[_0x4e31('0x25')](_0x349594,_0x38dd6c,!![]);}catch(_0x1b7968){return BPromise[_0x4e31('0x26')](_0x1b7968);}return _0x349594['save']();};}function saveUpdates(_0x41aaa7,_0x31c5dc){return function(_0x240d19){if(_0x240d19){return _0x240d19['update'](_0x41aaa7)[_0x4e31('0x27')](function(_0xcd5940){return _0xcd5940;});}return null;};}function removeEntity(_0x171a42,_0x3d4255){return function(_0x12efaf){if(_0x12efaf){return _0x12efaf['destroy']()[_0x4e31('0x27')](function(){_0x171a42[_0x4e31('0x1d')](0xcc)[_0x4e31('0x1e')]();});}};}function handleEntityNotFound(_0x53c3e0,_0x1a3435){return function(_0xe7e0f8){if(!_0xe7e0f8){_0x53c3e0[_0x4e31('0x1c')](0x194);}return _0xe7e0f8;};}function handleError(_0x182a4d,_0x20941d){_0x20941d=_0x20941d||0x1f4;return function(_0x1ee99c){logger[_0x4e31('0x28')](_0x1ee99c[_0x4e31('0x29')]);if(_0x1ee99c[_0x4e31('0x2a')]){delete _0x1ee99c[_0x4e31('0x2a')];}_0x182a4d[_0x4e31('0x1d')](_0x20941d)['send'](_0x1ee99c);};}exports[_0x4e31('0x2b')]=function(_0x3b74b0,_0x55cb05){var _0x32d9bf={'raw':!![],'where':{'id':_0x3b74b0['params']['id']}},_0x41d0eb={};_0x41d0eb[_0x4e31('0x2c')]=_['keys'](db[_0x4e31('0x2d')][_0x4e31('0x2e')]);_0x41d0eb['query']=_[_0x4e31('0x2f')](_0x3b74b0[_0x4e31('0x30')]);_0x41d0eb[_0x4e31('0x31')]=_[_0x4e31('0x32')](_0x41d0eb[_0x4e31('0x2c')],_0x41d0eb[_0x4e31('0x30')]);_0x32d9bf[_0x4e31('0x33')]=_[_0x4e31('0x32')](_0x41d0eb[_0x4e31('0x2c')],qs[_0x4e31('0x34')](_0x3b74b0['query'][_0x4e31('0x34')]));_0x32d9bf[_0x4e31('0x33')]=_0x32d9bf['attributes'][_0x4e31('0x35')]?_0x32d9bf[_0x4e31('0x33')]:_0x41d0eb[_0x4e31('0x2c')];if(_0x3b74b0['query'][_0x4e31('0x36')]){_0x32d9bf[_0x4e31('0x37')]=[{'all':!![]}];}_0x32d9bf=_[_0x4e31('0x38')]({},_0x32d9bf,_0x3b74b0[_0x4e31('0x39')]);return db['ChatProactiveAction'][_0x4e31('0x3a')](_0x32d9bf)['then'](handleEntityNotFound(_0x55cb05,null))['then'](respondWithResult(_0x55cb05,null))[_0x4e31('0x3b')](handleError(_0x55cb05,null));};exports[_0x4e31('0x3c')]=function(_0x5c2dcb,_0x4d82cc){return db[_0x4e31('0x2d')][_0x4e31('0x3c')](_0x5c2dcb['body'],{})['then'](respondWithResult(_0x4d82cc,0xc9))[_0x4e31('0x3b')](handleError(_0x4d82cc,null));};exports[_0x4e31('0x3d')]=function(_0x3b2e20,_0x34f11f){if(_0x3b2e20['body']['id']){delete _0x3b2e20[_0x4e31('0x3e')]['id'];}return db[_0x4e31('0x2d')][_0x4e31('0x3a')]({'where':{'id':_0x3b2e20['params']['id']}})['then'](handleEntityNotFound(_0x34f11f,null))[_0x4e31('0x27')](saveUpdates(_0x3b2e20[_0x4e31('0x3e')],null))[_0x4e31('0x27')](respondWithResult(_0x34f11f,null))[_0x4e31('0x3b')](handleError(_0x34f11f,null));};exports[_0x4e31('0x3f')]=function(_0x26c684,_0xf9c44b){return db[_0x4e31('0x2d')][_0x4e31('0x3a')]({'where':{'id':_0x26c684[_0x4e31('0x40')]['id']}})[_0x4e31('0x27')](handleEntityNotFound(_0xf9c44b,null))[_0x4e31('0x27')](removeEntity(_0xf9c44b,null))['catch'](handleError(_0xf9c44b,null));};
\ No newline at end of file
+var _0x6108=['fields','length','includeAll','include','merge','find','then','catch','create','ChatProactiveAction','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','name','send','show','params','keys','rawAttributes','query','filters','intersection','attributes','model'];(function(_0x2c6c4f,_0xefaadf){var _0x586e4d=function(_0x2f6aaa){while(--_0x2f6aaa){_0x2c6c4f['push'](_0x2c6c4f['shift']());}};_0x586e4d(++_0xefaadf);}(_0x6108,0xbc));var _0x8610=function(_0x404a64,_0x511dc8){_0x404a64=_0x404a64-0x0;var _0x3d6e59=_0x6108[_0x404a64];return _0x3d6e59;};'use strict';var emlformat=require(_0x8610('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8610('0x1'));var jsonpatch=require(_0x8610('0x2'));var rp=require(_0x8610('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8610('0x4'));var util=require(_0x8610('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8610('0x6'));var ejs=require(_0x8610('0x7'));var fs=require('fs');var fs_extra=require(_0x8610('0x8'));var _=require(_0x8610('0x9'));var squel=require('squel');var crypto=require(_0x8610('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8610('0xb'));var toCsv=require(_0x8610('0x6'));var querystring=require(_0x8610('0xc'));var Papa=require('papaparse');var Redis=require(_0x8610('0xd'));var authService=require(_0x8610('0xe'));var qs=require(_0x8610('0xf'));var as=require(_0x8610('0x10'));var hardwareService=require(_0x8610('0x11'));var logger=require(_0x8610('0x12'))('api');var utils=require(_0x8610('0x13'));var config=require(_0x8610('0x14'));var licenseUtil=require(_0x8610('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc18be9,_0x4bb57e){_0x4bb57e=_0x4bb57e||0xcc;return function(_0x7b0fa3){if(_0x7b0fa3){return _0xc18be9[_0x8610('0x16')](_0x4bb57e);}return _0xc18be9[_0x8610('0x17')](_0x4bb57e)[_0x8610('0x18')]();};}function respondWithResult(_0x3f5223,_0x4eacbf){_0x4eacbf=_0x4eacbf||0xc8;return function(_0x49edbe){if(_0x49edbe){return _0x3f5223[_0x8610('0x17')](_0x4eacbf)[_0x8610('0x19')](_0x49edbe);}};}function respondWithFilteredResult(_0x214015,_0x5526b5){return function(_0x5e1994){if(_0x5e1994){var _0x57e567=typeof _0x5526b5[_0x8610('0x1a')]===_0x8610('0x1b')&&typeof _0x5526b5[_0x8610('0x1c')]===_0x8610('0x1b');var _0x517a5c=_0x5e1994['count'];var _0x31f681=_0x57e567?0x0:_0x5526b5['offset'];var _0x5e945f=_0x57e567?_0x5e1994[_0x8610('0x1d')]:_0x5526b5['offset']+_0x5526b5['limit'];var _0x11daba;if(_0x5e945f>=_0x517a5c){_0x5e945f=_0x517a5c;_0x11daba=0xc8;}else{_0x11daba=0xce;}_0x214015[_0x8610('0x17')](_0x11daba);return _0x214015['set'](_0x8610('0x1e'),_0x31f681+'-'+_0x5e945f+'/'+_0x517a5c)[_0x8610('0x19')](_0x5e1994);}return null;};}function patchUpdates(_0x17fe4a){return function(_0x39ae24){try{jsonpatch[_0x8610('0x1f')](_0x39ae24,_0x17fe4a,!![]);}catch(_0x248343){return BPromise[_0x8610('0x20')](_0x248343);}return _0x39ae24[_0x8610('0x21')]();};}function saveUpdates(_0x4184f0,_0x19e38a){return function(_0x521823){if(_0x521823){return _0x521823[_0x8610('0x22')](_0x4184f0)['then'](function(_0x285f1a){return _0x285f1a;});}return null;};}function removeEntity(_0x2b8e7f,_0x8866a){return function(_0x5103ad){if(_0x5103ad){return _0x5103ad[_0x8610('0x23')]()['then'](function(){_0x2b8e7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5997da,_0x2e9cfd){return function(_0x43bd6a){if(!_0x43bd6a){_0x5997da['sendStatus'](0x194);}return _0x43bd6a;};}function handleError(_0x3cc4d2,_0x58daba){_0x58daba=_0x58daba||0x1f4;return function(_0xd97599){logger[_0x8610('0x24')](_0xd97599['stack']);if(_0xd97599[_0x8610('0x25')]){delete _0xd97599[_0x8610('0x25')];}_0x3cc4d2[_0x8610('0x17')](_0x58daba)[_0x8610('0x26')](_0xd97599);};}exports[_0x8610('0x27')]=function(_0x3ad532,_0x4e4c16){var _0x42a104={'raw':!![],'where':{'id':_0x3ad532[_0x8610('0x28')]['id']}},_0x2ccf6d={};_0x2ccf6d['model']=_[_0x8610('0x29')](db['ChatProactiveAction'][_0x8610('0x2a')]);_0x2ccf6d['query']=_['keys'](_0x3ad532[_0x8610('0x2b')]);_0x2ccf6d[_0x8610('0x2c')]=_[_0x8610('0x2d')](_0x2ccf6d['model'],_0x2ccf6d['query']);_0x42a104[_0x8610('0x2e')]=_[_0x8610('0x2d')](_0x2ccf6d[_0x8610('0x2f')],qs[_0x8610('0x30')](_0x3ad532[_0x8610('0x2b')][_0x8610('0x30')]));_0x42a104['attributes']=_0x42a104[_0x8610('0x2e')][_0x8610('0x31')]?_0x42a104[_0x8610('0x2e')]:_0x2ccf6d[_0x8610('0x2f')];if(_0x3ad532[_0x8610('0x2b')][_0x8610('0x32')]){_0x42a104[_0x8610('0x33')]=[{'all':!![]}];}_0x42a104=_[_0x8610('0x34')]({},_0x42a104,_0x3ad532['options']);return db['ChatProactiveAction'][_0x8610('0x35')](_0x42a104)[_0x8610('0x36')](handleEntityNotFound(_0x4e4c16,null))[_0x8610('0x36')](respondWithResult(_0x4e4c16,null))[_0x8610('0x37')](handleError(_0x4e4c16,null));};exports[_0x8610('0x38')]=function(_0x12f785,_0x21e6ef){return db[_0x8610('0x39')][_0x8610('0x38')](_0x12f785[_0x8610('0x3a')],{})[_0x8610('0x36')](respondWithResult(_0x21e6ef,0xc9))['catch'](handleError(_0x21e6ef,null));};exports[_0x8610('0x22')]=function(_0x573999,_0x29fb41){if(_0x573999['body']['id']){delete _0x573999['body']['id'];}return db[_0x8610('0x39')][_0x8610('0x35')]({'where':{'id':_0x573999[_0x8610('0x28')]['id']}})[_0x8610('0x36')](handleEntityNotFound(_0x29fb41,null))[_0x8610('0x36')](saveUpdates(_0x573999['body'],null))['then'](respondWithResult(_0x29fb41,null))[_0x8610('0x37')](handleError(_0x29fb41,null));};exports[_0x8610('0x23')]=function(_0x456fd8,_0x489928){return db['ChatProactiveAction'][_0x8610('0x35')]({'where':{'id':_0x456fd8[_0x8610('0x28')]['id']}})[_0x8610('0x36')](handleEntityNotFound(_0x489928,null))[_0x8610('0x36')](removeEntity(_0x489928,null))[_0x8610('0x37')](handleError(_0x489928,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 32a53e7..d254906 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 _0x8659=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util'];(function(_0x19c1ca,_0x881113){var _0x5960af=function(_0x3e568f){while(--_0x3e568f){_0x19c1ca['push'](_0x19c1ca['shift']());}};_0x5960af(++_0x881113);}(_0x8659,0x82));var _0x9865=function(_0x82d06e,_0xb52ffa){_0x82d06e=_0x82d06e-0x0;var _0x36de13=_0x8659[_0x82d06e];return _0x36de13;};'use strict';var _=require(_0x9865('0x0'));var util=require(_0x9865('0x1'));var logger=require(_0x9865('0x2'))(_0x9865('0x3'));var moment=require(_0x9865('0x4'));var BPromise=require(_0x9865('0x5'));var rp=require(_0x9865('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9865('0x7'));var attributes=require(_0x9865('0x8'));module[_0x9865('0x9')]=function(_0x492f0a,_0x31f3eb){return _0x492f0a[_0x9865('0xa')](_0x9865('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2649=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x2649,0xd8));var _0x9264=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x2649[_0x459423];return _0x42ed14;};'use strict';var _=require(_0x9264('0x0'));var util=require(_0x9264('0x1'));var logger=require('../../config/logger')(_0x9264('0x2'));var moment=require(_0x9264('0x3'));var BPromise=require(_0x9264('0x4'));var rp=require(_0x9264('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9264('0x6'));var config=require(_0x9264('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x9264('0x8')]=function(_0x49f2f1,_0x1f53a2){return _0x49f2f1[_0x9264('0x9')](_0x9264('0xa'),attributes,{'tableName':_0x9264('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index c6c602d..aed2072 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 _0xbdf4=['result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x48317e,_0x5e222e){var _0xe34bde=function(_0x2e40f8){while(--_0x2e40f8){_0x48317e['push'](_0x48317e['shift']());}};_0xe34bde(++_0x5e222e);}(_0xbdf4,0xdd));var _0x4bdf=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xbdf4[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x4bdf('0x0'));var util=require(_0x4bdf('0x1'));var moment=require(_0x4bdf('0x2'));var BPromise=require(_0x4bdf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bdf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4bdf('0x5'));var logger=require(_0x4bdf('0x6'))('rpc');var config=require(_0x4bdf('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4bdf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x474cb7,_0x5ebc78,_0x2d57b7){return new BPromise(function(_0xd1b14f,_0x121d5f){return client[_0x4bdf('0x9')](_0x474cb7,_0x2d57b7)['then'](function(_0x25e6df){logger[_0x4bdf('0xa')](_0x4bdf('0xb'),_0x5ebc78,_0x4bdf('0xc'));logger[_0x4bdf('0xd')](_0x4bdf('0xe'),_0x5ebc78,_0x4bdf('0xc'),JSON[_0x4bdf('0xf')](_0x25e6df));if(_0x25e6df[_0x4bdf('0x10')]){if(_0x25e6df['error'][_0x4bdf('0x11')]===0x1f4){logger[_0x4bdf('0x10')](_0x4bdf('0xb'),_0x5ebc78,_0x25e6df[_0x4bdf('0x10')]['message']);return _0x121d5f(_0x25e6df['error'][_0x4bdf('0x12')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5ebc78,_0x25e6df['error'][_0x4bdf('0x12')]);return _0xd1b14f(_0x25e6df['error']['message']);}else{logger[_0x4bdf('0xa')](_0x4bdf('0xb'),_0x5ebc78,_0x4bdf('0xc'));_0xd1b14f(_0x25e6df[_0x4bdf('0x13')][_0x4bdf('0x12')]);}})['catch'](function(_0x2927ec){logger[_0x4bdf('0x10')](_0x4bdf('0xb'),_0x5ebc78,_0x2927ec);_0x121d5f(_0x2927ec);});});}
\ No newline at end of file
+var _0x8ee2=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x8ee2,0xcd));var _0x28ee=function(_0x36c800,_0x4ac042){_0x36c800=_0x36c800-0x0;var _0x482b3b=_0x8ee2[_0x36c800];return _0x482b3b;};'use strict';var _=require(_0x28ee('0x0'));var util=require(_0x28ee('0x1'));var moment=require('moment');var BPromise=require(_0x28ee('0x2'));var rs=require(_0x28ee('0x3'));var fs=require('fs');var Redis=require(_0x28ee('0x4'));var db=require(_0x28ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x28ee('0x6'))(_0x28ee('0x7'));var config=require('../../config/environment');var jayson=require(_0x28ee('0x8'));var client=jayson[_0x28ee('0x9')][_0x28ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe693e2,_0x53df5a,_0xfdfff9){return new BPromise(function(_0x5f0a4a,_0x552742){return client[_0x28ee('0xb')](_0xe693e2,_0xfdfff9)['then'](function(_0x3ad54a){logger[_0x28ee('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x53df5a,_0x28ee('0xd'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x53df5a,_0x28ee('0xd'),JSON[_0x28ee('0xe')](_0x3ad54a));if(_0x3ad54a[_0x28ee('0xf')]){if(_0x3ad54a[_0x28ee('0xf')][_0x28ee('0x10')]===0x1f4){logger[_0x28ee('0xf')](_0x28ee('0x11'),_0x53df5a,_0x3ad54a[_0x28ee('0xf')][_0x28ee('0x12')]);return _0x552742(_0x3ad54a[_0x28ee('0xf')][_0x28ee('0x12')]);}logger[_0x28ee('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x53df5a,_0x3ad54a['error'][_0x28ee('0x12')]);return _0x5f0a4a(_0x3ad54a['error'][_0x28ee('0x12')]);}else{logger[_0x28ee('0xc')](_0x28ee('0x11'),_0x53df5a,_0x28ee('0xd'));_0x5f0a4a(_0x3ad54a[_0x28ee('0x13')][_0x28ee('0x12')]);}})[_0x28ee('0x14')](function(_0x596a91){logger[_0x28ee('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x53df5a,_0x596a91);_0x552742(_0x596a91);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index f03ac7d..bc8631d 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 _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x1415d3,_0x453d0a){var _0x5df6b2=function(_0x4274da){while(--_0x4274da){_0x1415d3['push'](_0x1415d3['shift']());}};_0x5df6b2(++_0x453d0a);}(_0x032e,0x124));var _0xe032=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x032e[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
+var _0x038b=['isAuthenticated','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x038b,0x114));var _0xb038=function(_0x2e1408,_0x4e4538){_0x2e1408=_0x2e1408-0x0;var _0x544ba1=_0x038b[_0x2e1408];return _0x544ba1;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0x8')]);router[_0xb038('0x9')]('/',auth[_0xb038('0xa')](),controller['create']);router['put'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['update']);router['delete'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['destroy']);module[_0xb038('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 9a8a765..882d9af 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 _0xa08e=['rrmemory','beepall','roundrobin','exports','STRING','name','ENUM'];(function(_0x2a3462,_0x2c8460){var _0x38b619=function(_0x616cab){while(--_0x616cab){_0x2a3462['push'](_0x2a3462['shift']());}};_0x38b619(++_0x2c8460);}(_0xa08e,0x1ca));var _0xea08=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0xa08e[_0x3f88bc];return _0x4df1c4;};'use strict';var Sequelize=require('sequelize');module[_0xea08('0x0')]={'name':{'type':Sequelize[_0xea08('0x1')],'unique':_0xea08('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xea08('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea08('0x3')](_0xea08('0x4'),_0xea08('0x5'),_0xea08('0x6'))}};
\ No newline at end of file
+var _0x823c=['name','INTEGER','ENUM','rrmemory','exports','STRING'];(function(_0x143cfd,_0x1a336e){var _0x2cb5f5=function(_0x1523fa){while(--_0x1523fa){_0x143cfd['push'](_0x143cfd['shift']());}};_0x2cb5f5(++_0x1a336e);}(_0x823c,0x12a));var _0xc823=function(_0x33625f,_0x23285e){_0x33625f=_0x33625f-0x0;var _0x4c5070=_0x823c[_0x33625f];return _0x4c5070;};'use strict';var Sequelize=require('sequelize');module[_0xc823('0x0')]={'name':{'type':Sequelize[_0xc823('0x1')],'unique':_0xc823('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc823('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc823('0x4')](_0xc823('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 25ed7f4..eceda93 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 _0x35f3=['getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','request\x20sent','stringify','error','message','ChatQueue,\x20%s,\x20%s','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','ChatQueue','includeAll','include','findAll','rows','params','rawAttributes','options','create','body','user','get','role','ChatQueues','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','union','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove'];(function(_0x614c88,_0x184f02){var _0x1a768e=function(_0x4f204f){while(--_0x4f204f){_0x614c88['push'](_0x614c88['shift']());}};_0x1a768e(++_0x184f02);}(_0x35f3,0x98));var _0x335f=function(_0xbd4a35,_0x3eec3b){_0xbd4a35=_0xbd4a35-0x0;var _0x1da054=_0x35f3[_0xbd4a35];return _0x1da054;};'use strict';var emlformat=require(_0x335f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x335f('0x1'));var jsonpatch=require(_0x335f('0x2'));var rp=require(_0x335f('0x3'));var moment=require('moment');var BPromise=require(_0x335f('0x4'));var Mustache=require(_0x335f('0x5'));var util=require(_0x335f('0x6'));var path=require(_0x335f('0x7'));var sox=require(_0x335f('0x8'));var csv=require(_0x335f('0x9'));var ejs=require(_0x335f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x335f('0xb'));var squel=require(_0x335f('0xc'));var crypto=require('crypto');var jsforce=require(_0x335f('0xd'));var deskjs=require(_0x335f('0xe'));var toCsv=require(_0x335f('0x9'));var querystring=require(_0x335f('0xf'));var Papa=require(_0x335f('0x10'));var Redis=require(_0x335f('0x11'));var authService=require(_0x335f('0x12'));var qs=require(_0x335f('0x13'));var as=require(_0x335f('0x14'));var hardwareService=require(_0x335f('0x15'));var logger=require(_0x335f('0x16'))('api');var utils=require(_0x335f('0x17'));var config=require(_0x335f('0x18'));var licenseUtil=require(_0x335f('0x19'));var db=require(_0x335f('0x1a'))['db'];config[_0x335f('0x1b')]=_[_0x335f('0x1c')](config[_0x335f('0x1b')],{'host':_0x335f('0x1d'),'port':0x18eb});var socket=require(_0x335f('0x1e'))(new Redis(config[_0x335f('0x1b')]));require(_0x335f('0x1f'))[_0x335f('0x20')](socket);var jayson=require(_0x335f('0x21'));var client=jayson[_0x335f('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32ef1e,_0x27b886,_0x478a97,_0x288be2){return new BPromise(function(_0x5e3d8d,_0x2070c0){var _0x206630=_0x288be2||client;return _0x206630[_0x335f('0x23')](_0x32ef1e,_0x478a97)[_0x335f('0x24')](function(_0x41c6d2){logger[_0x335f('0x25')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x335f('0x26'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x27b886,_0x335f('0x26'),JSON[_0x335f('0x27')](_0x41c6d2));if(_0x41c6d2['error']){if(_0x41c6d2['error']['code']===0x1f4){logger[_0x335f('0x28')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x41c6d2[_0x335f('0x28')]['message']);return _0x2070c0(_0x41c6d2[_0x335f('0x28')][_0x335f('0x29')]);}logger[_0x335f('0x28')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x41c6d2[_0x335f('0x28')][_0x335f('0x29')]);return _0x5e3d8d(_0x41c6d2['error']['message']);}else{logger[_0x335f('0x25')](_0x335f('0x2a'),_0x27b886,_0x335f('0x26'));_0x5e3d8d(_0x41c6d2['result'][_0x335f('0x29')]);}})[_0x335f('0x2b')](function(_0x1286a8){logger[_0x335f('0x28')](_0x335f('0x2a'),_0x27b886,_0x1286a8);_0x2070c0(_0x1286a8);});});}function respondWithStatusCode(_0x55787a,_0x583917){_0x583917=_0x583917||0xcc;return function(_0x178322){if(_0x178322){return _0x55787a[_0x335f('0x2c')](_0x583917);}return _0x55787a[_0x335f('0x2d')](_0x583917)[_0x335f('0x2e')]();};}function respondWithResult(_0x53fd7d,_0x2c92ec){_0x2c92ec=_0x2c92ec||0xc8;return function(_0x5c205b){if(_0x5c205b){return _0x53fd7d[_0x335f('0x2d')](_0x2c92ec)['json'](_0x5c205b);}};}function respondWithFilteredResult(_0x1d09a5,_0x4d7832){return function(_0x5d5bcf){if(_0x5d5bcf){var _0x497658=typeof _0x4d7832[_0x335f('0x2f')]===_0x335f('0x30')&&typeof _0x4d7832[_0x335f('0x31')]===_0x335f('0x30');var _0x1c55ee=_0x5d5bcf[_0x335f('0x32')];var _0x1b528b=_0x497658?0x0:_0x4d7832[_0x335f('0x2f')];var _0x57689c=_0x497658?_0x5d5bcf[_0x335f('0x32')]:_0x4d7832[_0x335f('0x2f')]+_0x4d7832[_0x335f('0x31')];var _0x429c6;if(_0x57689c>=_0x1c55ee){_0x57689c=_0x1c55ee;_0x429c6=0xc8;}else{_0x429c6=0xce;}_0x1d09a5[_0x335f('0x2d')](_0x429c6);return _0x1d09a5['set'](_0x335f('0x33'),_0x1b528b+'-'+_0x57689c+'/'+_0x1c55ee)[_0x335f('0x34')](_0x5d5bcf);}return null;};}function patchUpdates(_0x8b6651){return function(_0x50ffb2){try{jsonpatch[_0x335f('0x35')](_0x50ffb2,_0x8b6651,!![]);}catch(_0x1235a3){return BPromise[_0x335f('0x36')](_0x1235a3);}return _0x50ffb2['save']();};}function saveUpdates(_0x238975,_0xf01acf){return function(_0x3a094d){if(_0x3a094d){return _0x3a094d[_0x335f('0x37')](_0x238975)[_0x335f('0x24')](function(_0x30bcb8){return _0x30bcb8;});}return null;};}function removeEntity(_0x535df2,_0x5b28f0){return function(_0x287271){if(_0x287271){return _0x287271['destroy']()['then'](function(){var _0x24666d=_0x287271['get']({'plain':!![]});var _0x59ed5a='ChatQueues';return db['UserProfileResource'][_0x335f('0x38')]({'where':{'type':_0x59ed5a,'resourceId':_0x24666d['id']}})['then'](function(){return _0x287271;});})['then'](function(){_0x535df2[_0x335f('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9b6a,_0x52e448){return function(_0x4278ec){if(!_0x4278ec){_0x2f9b6a[_0x335f('0x2c')](0x194);}return _0x4278ec;};}function handleError(_0x1aa4c5,_0x3d1f22){_0x3d1f22=_0x3d1f22||0x1f4;return function(_0x101ab2){logger[_0x335f('0x28')](_0x101ab2['stack']);if(_0x101ab2[_0x335f('0x39')]){delete _0x101ab2['name'];}_0x1aa4c5['status'](_0x3d1f22)[_0x335f('0x3a')](_0x101ab2);};}exports[_0x335f('0x3b')]=function(_0x221f9e,_0x14f0b7){var _0x221dc1={},_0xbe0bd9={},_0x517662={'count':0x0,'rows':[]};var _0x189b91=_['map'](db['ChatQueue']['rawAttributes'],function(_0x4f96af){return{'name':_0x4f96af[_0x335f('0x3c')],'type':_0x4f96af[_0x335f('0x3d')][_0x335f('0x3e')]};});_0xbe0bd9[_0x335f('0x3f')]=_[_0x335f('0x40')](_0x189b91,_0x335f('0x39'));_0xbe0bd9[_0x335f('0x41')]=_[_0x335f('0x42')](_0x221f9e[_0x335f('0x41')]);_0xbe0bd9[_0x335f('0x43')]=_[_0x335f('0x44')](_0xbe0bd9['model'],_0xbe0bd9[_0x335f('0x41')]);_0x221dc1['attributes']=_[_0x335f('0x44')](_0xbe0bd9['model'],qs['fields'](_0x221f9e[_0x335f('0x41')][_0x335f('0x45')]));_0x221dc1[_0x335f('0x46')]=_0x221dc1[_0x335f('0x46')][_0x335f('0x47')]?_0x221dc1['attributes']:_0xbe0bd9[_0x335f('0x3f')];if(!_0x221f9e['query'][_0x335f('0x48')](_0x335f('0x49'))){_0x221dc1[_0x335f('0x31')]=qs[_0x335f('0x31')](_0x221f9e[_0x335f('0x41')][_0x335f('0x31')]);_0x221dc1[_0x335f('0x2f')]=qs[_0x335f('0x2f')](_0x221f9e[_0x335f('0x41')][_0x335f('0x2f')]);}_0x221dc1[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0x221f9e[_0x335f('0x41')][_0x335f('0x4b')]);_0x221dc1['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0x221f9e['query'],_0xbe0bd9[_0x335f('0x43')]),_0x189b91);if(_0x221f9e['query'][_0x335f('0x4d')]){_0x221dc1['where']=_[_0x335f('0x4e')](_0x221dc1[_0x335f('0x4f')],{'$or':_[_0x335f('0x40')](_0x189b91,function(_0x1540d2){if(_0x1540d2[_0x335f('0x3d')]!=='VIRTUAL'){var _0x2c14bf={};_0x2c14bf[_0x1540d2[_0x335f('0x39')]]={'$like':'%'+_0x221f9e[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x2c14bf;}})});}_0x221dc1=_[_0x335f('0x4e')]({},_0x221dc1,_0x221f9e['options']);var _0x1dbe27={'where':_0x221dc1[_0x335f('0x4f')]};return db[_0x335f('0x50')][_0x335f('0x32')](_0x1dbe27)[_0x335f('0x24')](function(_0x5d66d5){_0x517662[_0x335f('0x32')]=_0x5d66d5;if(_0x221f9e[_0x335f('0x41')][_0x335f('0x51')]){_0x221dc1[_0x335f('0x52')]=[{'all':!![]}];}return db[_0x335f('0x50')][_0x335f('0x53')](_0x221dc1);})[_0x335f('0x24')](function(_0x5c5228){_0x517662[_0x335f('0x54')]=_0x5c5228;return _0x517662;})[_0x335f('0x24')](respondWithFilteredResult(_0x14f0b7,_0x221dc1))['catch'](handleError(_0x14f0b7,null));};exports['show']=function(_0x1ab2e4,_0x4c0198){var _0xd654cf={'raw':!![],'where':{'id':_0x1ab2e4[_0x335f('0x55')]['id']}},_0x54c57a={};_0x54c57a[_0x335f('0x3f')]=_[_0x335f('0x42')](db['ChatQueue'][_0x335f('0x56')]);_0x54c57a['query']=_[_0x335f('0x42')](_0x1ab2e4[_0x335f('0x41')]);_0x54c57a[_0x335f('0x43')]=_[_0x335f('0x44')](_0x54c57a[_0x335f('0x3f')],_0x54c57a['query']);_0xd654cf[_0x335f('0x46')]=_[_0x335f('0x44')](_0x54c57a[_0x335f('0x3f')],qs[_0x335f('0x45')](_0x1ab2e4['query'][_0x335f('0x45')]));_0xd654cf[_0x335f('0x46')]=_0xd654cf[_0x335f('0x46')][_0x335f('0x47')]?_0xd654cf[_0x335f('0x46')]:_0x54c57a[_0x335f('0x3f')];if(_0x1ab2e4[_0x335f('0x41')]['includeAll']){_0xd654cf[_0x335f('0x52')]=[{'all':!![]}];}_0xd654cf=_[_0x335f('0x4e')]({},_0xd654cf,_0x1ab2e4[_0x335f('0x57')]);return db[_0x335f('0x50')]['find'](_0xd654cf)['then'](handleEntityNotFound(_0x4c0198,null))[_0x335f('0x24')](respondWithResult(_0x4c0198,null))['catch'](handleError(_0x4c0198,null));};exports[_0x335f('0x58')]=function(_0x32d049,_0x1d069c){return db[_0x335f('0x50')][_0x335f('0x58')](_0x32d049[_0x335f('0x59')],{})[_0x335f('0x24')](function(_0x2512fc){var _0x57ea09=_0x32d049[_0x335f('0x5a')][_0x335f('0x5b')]({'plain':!![]});if(!_0x57ea09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57ea09[_0x335f('0x5c')]===_0x335f('0x5a')){var _0x102501=_0x2512fc[_0x335f('0x5b')]({'plain':!![]});var _0x284f2e=_0x335f('0x5d');return db[_0x335f('0x5e')]['find']({'where':{'name':_0x284f2e,'userProfileId':_0x57ea09['userProfileId']},'raw':!![]})[_0x335f('0x24')](function(_0x2157e3){if(_0x2157e3&&_0x2157e3[_0x335f('0x5f')]===0x0){return db[_0x335f('0x60')]['create']({'name':_0x102501[_0x335f('0x39')],'resourceId':_0x102501['id'],'type':_0x2157e3['name'],'sectionId':_0x2157e3['id']},{})[_0x335f('0x24')](function(){return _0x2512fc;});}else{return _0x2512fc;}})['catch'](function(_0x40b751){logger[_0x335f('0x28')](_0x335f('0x61'),_0x40b751);throw _0x40b751;});}return _0x2512fc;})[_0x335f('0x24')](respondWithResult(_0x1d069c,0xc9))[_0x335f('0x2b')](handleError(_0x1d069c,null));};exports['update']=function(_0x5ba1f5,_0x47e97a){if(_0x5ba1f5[_0x335f('0x59')]['id']){delete _0x5ba1f5['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x5ba1f5[_0x335f('0x55')]['id']}})['then'](handleEntityNotFound(_0x47e97a,null))['then'](saveUpdates(_0x5ba1f5[_0x335f('0x59')],null))['then'](respondWithResult(_0x47e97a,null))[_0x335f('0x2b')](handleError(_0x47e97a,null));};exports[_0x335f('0x38')]=function(_0x468a4a,_0x5a1aa0){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x468a4a['params']['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x5a1aa0,null))[_0x335f('0x24')](removeEntity(_0x5a1aa0,null))[_0x335f('0x2b')](handleError(_0x5a1aa0,null));};exports[_0x335f('0x63')]=function(_0x53eea1,_0x4ad269){return db[_0x335f('0x50')][_0x335f('0x63')]()['then'](respondWithResult(_0x4ad269,null))['catch'](handleError(_0x4ad269,null));};exports['getMembers']=function(_0x3efe13,_0x1cee05,_0x474c77){var _0xb35305={'raw':!![],'where':{}},_0x316f11={},_0x22f663;return db[_0x335f('0x50')][_0x335f('0x64')]({'where':{'id':_0x3efe13[_0x335f('0x55')]['id']}})['then'](handleEntityNotFound(_0x1cee05,null))[_0x335f('0x24')](function(_0x3e026b){if(_0x3e026b){_0x22f663=_0x3e026b[_0x335f('0x5b')]({'plain':!![]});_0x316f11['model']=_[_0x335f('0x42')](db['UserChatQueue']['rawAttributes']);_0x316f11['query']=_[_0x335f('0x42')](_0x3efe13['query']);_0x316f11[_0x335f('0x43')]=_['intersection'](_0x316f11[_0x335f('0x3f')],_0x316f11[_0x335f('0x41')]);_0xb35305[_0x335f('0x46')]=_[_0x335f('0x44')](_0x316f11['model'],qs[_0x335f('0x45')](_0x3efe13[_0x335f('0x41')][_0x335f('0x45')]));_0xb35305[_0x335f('0x46')]=_0xb35305[_0x335f('0x46')]['length']?_0xb35305[_0x335f('0x46')]:_0x316f11[_0x335f('0x3f')];if(!_0x3efe13['query'][_0x335f('0x48')]('nolimit')){_0xb35305[_0x335f('0x31')]=qs['limit'](_0x3efe13[_0x335f('0x41')][_0x335f('0x31')]);_0xb35305['offset']=qs['offset'](_0x3efe13[_0x335f('0x41')][_0x335f('0x2f')]);}_0xb35305['order']=qs[_0x335f('0x4b')](_0x3efe13[_0x335f('0x41')][_0x335f('0x4b')]);_0xb35305[_0x335f('0x4f')]=qs[_0x335f('0x43')](_['pick'](_0x3efe13[_0x335f('0x41')],_0x316f11['filters']));_0xb35305[_0x335f('0x4f')][_0x335f('0x65')]=_0x3e026b['id'];if(_0x3efe13['query']['filter']){_0xb35305[_0x335f('0x4f')]=_[_0x335f('0x4e')](_0xb35305['where'],{'$or':_[_0x335f('0x40')](_0xb35305['attributes'],function(_0x3795a1){var _0x32705c={};_0x32705c[_0x3795a1]={'$like':'%'+_0x3efe13[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x32705c;})});}_0xb35305=_[_0x335f('0x4e')]({},_0xb35305,_0x3efe13[_0x335f('0x57')]);return db['UserChatQueue'][_0x335f('0x53')](_0xb35305);}})[_0x335f('0x24')](function(_0x3ba5ff){if(_0x3ba5ff){return db['User'][_0x335f('0x66')]({'where':{'id':_[_0x335f('0x40')](_0x3ba5ff,'UserId'),'role':_0x335f('0x67')},'attributes':['id',_0x335f('0x39'),_0x335f('0x68'),_0x335f('0x69'),_0x335f('0x6a')]});}})[_0x335f('0x24')](function(_0x192d2d){if(_0x192d2d){return{'count':_0x192d2d['count'],'rows':_['map'](_0x192d2d[_0x335f('0x54')],function(_0x1872cd){return{'membername':_0x1872cd[_0x335f('0x39')],'UserId':_0x1872cd['id'],'queue_name':_0x22f663[_0x335f('0x39')],'ChatQueueId':_0x22f663['id'],'interface':util[_0x335f('0x6b')](_0x335f('0x6c'),'SIP',_0x1872cd['name']),'penalty':0x0,'paused':_0x1872cd[_0x335f('0x68')],'createdAt':_0x1872cd[_0x335f('0x6a')],'updatedAt':_0x1872cd[_0x335f('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x335f('0x24')](respondWithFilteredResult(_0x1cee05,_0xb35305))['catch'](handleError(_0x1cee05,null));};exports[_0x335f('0x6d')]=function(_0x2c52aa,_0x9c75a,_0x420ee9){var _0x1afb99={};var _0x108e7d={};var _0x3975a1;var _0x2809b0;return db[_0x335f('0x50')][_0x335f('0x64')]({'where':{'id':_0x2c52aa[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x9c75a,null))[_0x335f('0x24')](function(_0x430559){if(_0x430559){_0x3975a1=_0x430559;_0x108e7d[_0x335f('0x3f')]=_[_0x335f('0x42')](db[_0x335f('0x6e')][_0x335f('0x56')]);_0x108e7d[_0x335f('0x41')]=_[_0x335f('0x42')](_0x2c52aa[_0x335f('0x41')]);_0x108e7d[_0x335f('0x43')]=_['intersection'](_0x108e7d['model'],_0x108e7d[_0x335f('0x41')]);_0x1afb99[_0x335f('0x46')]=_[_0x335f('0x44')](_0x108e7d[_0x335f('0x3f')],qs[_0x335f('0x45')](_0x2c52aa[_0x335f('0x41')][_0x335f('0x45')]));_0x1afb99[_0x335f('0x46')]=_0x1afb99[_0x335f('0x46')]['length']?_0x1afb99['attributes']:_0x108e7d[_0x335f('0x3f')];_0x1afb99[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0x2c52aa['query'][_0x335f('0x4b')]);_0x1afb99['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0x2c52aa[_0x335f('0x41')],_0x108e7d[_0x335f('0x43')]));if(_0x2c52aa[_0x335f('0x41')][_0x335f('0x4d')]){_0x1afb99[_0x335f('0x4f')]=_['merge'](_0x1afb99[_0x335f('0x4f')],{'$or':_[_0x335f('0x40')](_0x1afb99[_0x335f('0x46')],function(_0x22b328){var _0x204dcf={};_0x204dcf[_0x22b328]={'$like':'%'+_0x2c52aa[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x204dcf;})});}_0x1afb99=_[_0x335f('0x4e')]({},_0x1afb99,_0x2c52aa[_0x335f('0x57')]);return _0x3975a1[_0x335f('0x6d')](_0x1afb99);}})['then'](function(_0x5bf0dc){if(_0x5bf0dc){_0x2809b0=_0x5bf0dc[_0x335f('0x47')];if(!_0x2c52aa['query'][_0x335f('0x48')](_0x335f('0x49'))){_0x1afb99[_0x335f('0x31')]=qs['limit'](_0x2c52aa[_0x335f('0x41')]['limit']);_0x1afb99[_0x335f('0x2f')]=qs[_0x335f('0x2f')](_0x2c52aa['query'][_0x335f('0x2f')]);}return _0x3975a1['getTeams'](_0x1afb99);}})[_0x335f('0x24')](function(_0x3fb11d){if(_0x3fb11d){return _0x3fb11d?{'count':_0x2809b0,'rows':_0x3fb11d}:null;}})[_0x335f('0x24')](respondWithResult(_0x9c75a,null))['catch'](handleError(_0x9c75a,null));};exports[_0x335f('0x6f')]=function(_0x48393f,_0x21efc2,_0x6853fb){var _0xe5cd1d=_0x48393f[_0x335f('0x59')][_0x335f('0x70')];return db[_0x335f('0x6e')][_0x335f('0x53')]({'where':{'id':_0xe5cd1d},'attributes':['id'],'include':[{'model':db[_0x335f('0x71')],'as':_0x335f('0x72'),'attributes':['id','name',_0x335f('0x73'),_0x335f('0x74'),_0x335f('0x75')],'raw':!![]}]})[_0x335f('0x24')](function(_0x59b6cf){if(_0x59b6cf){var _0x4dd723=_[_0x335f('0x76')](_0x59b6cf,function(_0x126ab6){var _0x18521c=_0x126ab6[_0x335f('0x5b')]({'plain':!![]});return _0x18521c['Agents'];});return db[_0x335f('0x50')]['find']({'where':{'id':_0x48393f[_0x335f('0x55')]['id']}})[_0x335f('0x24')](function(_0x2a87b3){return db['sequelize']['transaction'](function(_0x1bb1db){return _0x2a87b3[_0x335f('0x6f')](_0xe5cd1d,{'transaction':_0x1bb1db})['then'](function(){return BPromise[_0x335f('0x77')](_0x4dd723,function(_0x167d0b){return db['UserChatQueue'][_0x335f('0x78')]({'where':{'UserId':_0x167d0b['id'],'ChatQueueId':_0x48393f[_0x335f('0x55')]['id']},'transaction':_0x1bb1db});});})[_0x335f('0x24')](function(){_0x4dd723[_0x335f('0x79')](function(_0x3b18af){socket[_0x335f('0x7a')](_0x335f('0x7b'),{'UserId':_0x3b18af['id'],'ChatQueueId':_0x2a87b3['id']});});});});});}})[_0x335f('0x24')](respondWithStatusCode(_0x21efc2,null))[_0x335f('0x2b')](handleError(_0x21efc2,null));};exports[_0x335f('0x7c')]=function(_0x515d77,_0x2918ec,_0x5424fb){return db[_0x335f('0x6e')][_0x335f('0x53')]({'where':{'id':_0x515d77[_0x335f('0x41')][_0x335f('0x70')]},'attributes':['id'],'include':[{'model':db[_0x335f('0x71')],'as':_0x335f('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2918ec,null))['then'](function(_0x3f7e2b){var _0x3013ae=_[_0x335f('0x40')](_0x3f7e2b,'id');var _0x2232e9=[];var _0x428abe=[];var _0x5ded24=squel[_0x335f('0x7d')]();_0x5ded24[_0x335f('0x7e')](_0x335f('0x7f'))[_0x335f('0x80')](_0x335f('0x81'),'tq')[_0x335f('0x82')](_0x335f('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x335f('0x84'),_0x515d77[_0x335f('0x55')]['id']);for(var _0x4c4629=0x0;_0x4c4629<_0x3f7e2b[_0x335f('0x47')];_0x4c4629+=0x1){let _0x1c6e0a=_0x3f7e2b[_0x4c4629];for(var _0x378506=0x0;_0x378506<_0x1c6e0a[_0x335f('0x72')][_0x335f('0x47')];_0x378506+=0x1){let _0x1a7fcf=_0x1c6e0a['Agents'][_0x378506];var _0x267cc9=_0x5ded24[_0x335f('0x85')]();_0x267cc9[_0x335f('0x4f')](_0x335f('0x86'),_0x1a7fcf['id']);_0x428abe[_0x335f('0x87')](db['sequelize'][_0x335f('0x41')](_0x267cc9['toString'](),{'type':db[_0x335f('0x88')]['QueryTypes'][_0x335f('0x89')]})['then'](function(_0x5ed752){if(_0x5ed752[_0x335f('0x47')]===0x1){return _0x1a7fcf['id'];}else{var _0x266fea=_[_0x335f('0x8a')](_[_0x335f('0x40')](_0x5ed752,'TeamId'),function(_0x49aec9){return _['includes'](_0x3013ae,_0x49aec9);});if(_0x266fea){return _0x1a7fcf['id'];}}}));}}return BPromise['all'](_0x428abe)[_0x335f('0x24')](function(_0x3f4c53){_0x2232e9=_(_0x2232e9)[_0x335f('0x8b')](_0x3f4c53)[_0x335f('0x8c')]()[_0x335f('0x8d')]();return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x515d77[_0x335f('0x55')]['id']}})['then'](function(_0x507de7){return db[_0x335f('0x88')][_0x335f('0x8e')](function(_0x40e02a){return _0x507de7[_0x335f('0x7c')](_0x515d77['query']['ids'],{'transaction':_0x40e02a})['then'](function(){if(!_[_0x335f('0x8f')](_0x2232e9)){return _0x507de7[_0x335f('0x90')](_0x2232e9,{'transaction':_0x40e02a});}})['then'](function(){_0x2232e9[_0x335f('0x79')](function(_0x1b0e22){socket['emit']('userChatQueue:remove',{'UserId':_0x1b0e22,'ChatQueueId':_0x507de7['id']});});});});});});})[_0x335f('0x24')](respondWithStatusCode(_0x2918ec,null))[_0x335f('0x2b')](handleError(_0x2918ec,null));};exports[_0x335f('0x91')]=function(_0x2c11dd,_0x488cc9,_0x11b57b){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x2c11dd['params']['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x488cc9,null))[_0x335f('0x24')](function(_0x204cf8){if(_0x204cf8){return _0x204cf8[_0x335f('0x91')](_0x2c11dd['body'][_0x335f('0x70')],_[_0x335f('0x92')](_0x2c11dd[_0x335f('0x59')],[_0x335f('0x70'),'id'])||{})[_0x335f('0x93')](function(_0x4a5d8a){for(var _0x289dab=0x0;_0x289dab<_0x2c11dd['body'][_0x335f('0x70')][_0x335f('0x47')];_0x289dab+=0x1){socket['emit'](_0x335f('0x7b'),{'UserId':Number(_0x2c11dd['body'][_0x335f('0x70')][_0x289dab]),'ChatQueueId':Number(_0x2c11dd[_0x335f('0x55')]['id'])});}return _0x4a5d8a;});}})[_0x335f('0x24')](respondWithResult(_0x488cc9,null))['catch'](handleError(_0x488cc9,null));};exports[_0x335f('0x90')]=function(_0x111df1,_0x35dd30,_0x316948){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x111df1[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x35dd30,null))[_0x335f('0x24')](function(_0x26b9ee){if(_0x26b9ee){return _0x26b9ee[_0x335f('0x90')](_0x111df1[_0x335f('0x41')][_0x335f('0x70')])[_0x335f('0x24')](function(){if(_[_0x335f('0x94')](_0x111df1['query'][_0x335f('0x70')])){for(var _0x27e4f0=0x0;_0x27e4f0<_0x111df1[_0x335f('0x41')][_0x335f('0x70')]['length'];_0x27e4f0+=0x1){socket[_0x335f('0x7a')](_0x335f('0x95'),{'UserId':Number(_0x111df1[_0x335f('0x41')][_0x335f('0x70')][_0x27e4f0]),'ChatQueueId':Number(_0x111df1[_0x335f('0x55')]['id'])});}}else{socket[_0x335f('0x7a')](_0x335f('0x95'),{'UserId':Number(_0x111df1[_0x335f('0x41')]['ids']),'ChatQueueId':Number(_0x111df1[_0x335f('0x55')]['id'])});}});}})[_0x335f('0x24')](respondWithStatusCode(_0x35dd30,null))[_0x335f('0x2b')](handleError(_0x35dd30,null));};exports[_0x335f('0x96')]=function(_0xd90543,_0x23f596,_0x3ca7e9){var _0x58af07={};var _0x2cf3ae={};var _0x211ac8;var _0x6970c0;return db[_0x335f('0x50')]['findOne']({'where':{'id':_0xd90543[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x23f596,null))['then'](function(_0x19aba3){if(_0x19aba3){_0x211ac8=_0x19aba3;_0x2cf3ae[_0x335f('0x3f')]=_[_0x335f('0x42')](db[_0x335f('0x71')][_0x335f('0x56')]);_0x2cf3ae[_0x335f('0x41')]=_[_0x335f('0x42')](_0xd90543[_0x335f('0x41')]);_0x2cf3ae[_0x335f('0x43')]=_[_0x335f('0x44')](_0x2cf3ae['model'],_0x2cf3ae[_0x335f('0x41')]);_0x58af07[_0x335f('0x46')]=_[_0x335f('0x44')](_0x2cf3ae[_0x335f('0x3f')],qs[_0x335f('0x45')](_0xd90543['query']['fields']));_0x58af07[_0x335f('0x46')]=_0x58af07[_0x335f('0x46')]['length']?_0x58af07[_0x335f('0x46')]:_0x2cf3ae[_0x335f('0x3f')];_0x58af07[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0xd90543['query'][_0x335f('0x4b')]);_0x58af07['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0xd90543[_0x335f('0x41')],_0x2cf3ae['filters']));if(_0xd90543[_0x335f('0x41')][_0x335f('0x4d')]){_0x58af07['where']=_[_0x335f('0x4e')](_0x58af07['where'],{'$or':_[_0x335f('0x40')](_0x58af07[_0x335f('0x46')],function(_0x38755b){var _0x4c4bb8={};_0x4c4bb8[_0x38755b]={'$like':'%'+_0xd90543['query'][_0x335f('0x4d')]+'%'};return _0x4c4bb8;})});}_0x58af07=_[_0x335f('0x4e')]({},_0x58af07,_0xd90543[_0x335f('0x57')]);return _0x211ac8[_0x335f('0x96')](_0x58af07);}})['then'](function(_0x62806b){if(_0x62806b){_0x6970c0=_0x62806b[_0x335f('0x47')];if(!_0xd90543[_0x335f('0x41')][_0x335f('0x48')]('nolimit')){_0x58af07[_0x335f('0x31')]=qs[_0x335f('0x31')](_0xd90543[_0x335f('0x41')][_0x335f('0x31')]);_0x58af07['offset']=qs[_0x335f('0x2f')](_0xd90543[_0x335f('0x41')][_0x335f('0x2f')]);}return _0x211ac8[_0x335f('0x96')](_0x58af07);}})[_0x335f('0x24')](function(_0x4031ba){if(_0x4031ba){return _0x4031ba?{'count':_0x6970c0,'rows':_0x4031ba}:null;}})[_0x335f('0x24')](respondWithResult(_0x23f596,null))['catch'](handleError(_0x23f596,null));};
\ No newline at end of file
+var _0x23f8=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','pick','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','emit','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x4c4ef4,_0x2e02ac){var _0x5af4e0=function(_0x58bcb6){while(--_0x58bcb6){_0x4c4ef4['push'](_0x4c4ef4['shift']());}};_0x5af4e0(++_0x2e02ac);}(_0x23f8,0x8e));var _0x823f=function(_0x13d3a2,_0x174e4c){_0x13d3a2=_0x13d3a2-0x0;var _0x4a21b4=_0x23f8[_0x13d3a2];return _0x4a21b4;};'use strict';var emlformat=require(_0x823f('0x0'));var rimraf=require(_0x823f('0x1'));var zipdir=require(_0x823f('0x2'));var jsonpatch=require(_0x823f('0x3'));var rp=require(_0x823f('0x4'));var moment=require('moment');var BPromise=require(_0x823f('0x5'));var Mustache=require('mustache');var util=require(_0x823f('0x6'));var path=require(_0x823f('0x7'));var sox=require(_0x823f('0x8'));var csv=require(_0x823f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x823f('0xa'));var _=require(_0x823f('0xb'));var squel=require(_0x823f('0xc'));var crypto=require(_0x823f('0xd'));var jsforce=require(_0x823f('0xe'));var deskjs=require(_0x823f('0xf'));var toCsv=require(_0x823f('0x9'));var querystring=require(_0x823f('0x10'));var Papa=require(_0x823f('0x11'));var Redis=require(_0x823f('0x12'));var authService=require(_0x823f('0x13'));var qs=require(_0x823f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x823f('0x15'));var logger=require(_0x823f('0x16'))(_0x823f('0x17'));var utils=require(_0x823f('0x18'));var config=require(_0x823f('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x823f('0x1a')]=_[_0x823f('0x1b')](config[_0x823f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x823f('0x1c'))(new Redis(config['redis']));require(_0x823f('0x1d'))[_0x823f('0x1e')](socket);var jayson=require(_0x823f('0x1f'));var client=jayson['client'][_0x823f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x526cee,_0x5cb2a2,_0x5a4a76,_0x85e76e){return new BPromise(function(_0x5df7dc,_0x564265){var _0xa9f7ef=_0x85e76e||client;return _0xa9f7ef['request'](_0x526cee,_0x5a4a76)[_0x823f('0x21')](function(_0x42a5c0){logger['info'](_0x823f('0x22'),_0x5cb2a2,_0x823f('0x23'));logger['debug'](_0x823f('0x24'),_0x5cb2a2,'request\x20sent',JSON['stringify'](_0x42a5c0));if(_0x42a5c0[_0x823f('0x25')]){if(_0x42a5c0[_0x823f('0x25')][_0x823f('0x26')]===0x1f4){logger['error'](_0x823f('0x22'),_0x5cb2a2,_0x42a5c0[_0x823f('0x25')][_0x823f('0x27')]);return _0x564265(_0x42a5c0[_0x823f('0x25')][_0x823f('0x27')]);}logger[_0x823f('0x25')](_0x823f('0x22'),_0x5cb2a2,_0x42a5c0[_0x823f('0x25')][_0x823f('0x27')]);return _0x5df7dc(_0x42a5c0[_0x823f('0x25')]['message']);}else{logger[_0x823f('0x28')](_0x823f('0x22'),_0x5cb2a2,_0x823f('0x23'));_0x5df7dc(_0x42a5c0[_0x823f('0x29')]['message']);}})[_0x823f('0x2a')](function(_0x555742){logger[_0x823f('0x25')](_0x823f('0x22'),_0x5cb2a2,_0x555742);_0x564265(_0x555742);});});}function respondWithStatusCode(_0x5dd401,_0x51e335){_0x51e335=_0x51e335||0xcc;return function(_0x59e412){if(_0x59e412){return _0x5dd401['sendStatus'](_0x51e335);}return _0x5dd401[_0x823f('0x2b')](_0x51e335)['end']();};}function respondWithResult(_0x500976,_0x58080b){_0x58080b=_0x58080b||0xc8;return function(_0x5ecae5){if(_0x5ecae5){return _0x500976[_0x823f('0x2b')](_0x58080b)['json'](_0x5ecae5);}};}function respondWithFilteredResult(_0x3c4c1f,_0x46e465){return function(_0x3ef1ee){if(_0x3ef1ee){var _0x37ab64=typeof _0x46e465[_0x823f('0x2c')]===_0x823f('0x2d')&&typeof _0x46e465[_0x823f('0x2e')]===_0x823f('0x2d');var _0x5246c3=_0x3ef1ee[_0x823f('0x2f')];var _0x2a3605=_0x37ab64?0x0:_0x46e465[_0x823f('0x2c')];var _0x442c22=_0x37ab64?_0x3ef1ee[_0x823f('0x2f')]:_0x46e465[_0x823f('0x2c')]+_0x46e465[_0x823f('0x2e')];var _0x1dd7db;if(_0x442c22>=_0x5246c3){_0x442c22=_0x5246c3;_0x1dd7db=0xc8;}else{_0x1dd7db=0xce;}_0x3c4c1f[_0x823f('0x2b')](_0x1dd7db);return _0x3c4c1f['set'](_0x823f('0x30'),_0x2a3605+'-'+_0x442c22+'/'+_0x5246c3)[_0x823f('0x31')](_0x3ef1ee);}return null;};}function patchUpdates(_0x470140){return function(_0x2e5d2c){try{jsonpatch['apply'](_0x2e5d2c,_0x470140,!![]);}catch(_0x57fc73){return BPromise[_0x823f('0x32')](_0x57fc73);}return _0x2e5d2c[_0x823f('0x33')]();};}function saveUpdates(_0x16fbe3,_0x2325ae){return function(_0x55ac16){if(_0x55ac16){return _0x55ac16[_0x823f('0x34')](_0x16fbe3)[_0x823f('0x21')](function(_0x43aec5){return _0x43aec5;});}return null;};}function removeEntity(_0x44d9f0,_0x3c1613){return function(_0x2cc033){if(_0x2cc033){return _0x2cc033[_0x823f('0x35')]()[_0x823f('0x21')](function(){var _0x8fa585=_0x2cc033[_0x823f('0x36')]({'plain':!![]});var _0xd7ef4d=_0x823f('0x37');return db[_0x823f('0x38')]['destroy']({'where':{'type':_0xd7ef4d,'resourceId':_0x8fa585['id']}})[_0x823f('0x21')](function(){return _0x2cc033;});})['then'](function(){_0x44d9f0[_0x823f('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x160075,_0x455d8b){return function(_0x3c6890){if(!_0x3c6890){_0x160075['sendStatus'](0x194);}return _0x3c6890;};}function handleError(_0x46c247,_0x574def){_0x574def=_0x574def||0x1f4;return function(_0x304e21){logger['error'](_0x304e21[_0x823f('0x39')]);if(_0x304e21[_0x823f('0x3a')]){delete _0x304e21[_0x823f('0x3a')];}_0x46c247['status'](_0x574def)[_0x823f('0x3b')](_0x304e21);};}exports['index']=function(_0x2bdfd3,_0x218b6b){var _0x396113={},_0x56bb1b={},_0x4852d0={'count':0x0,'rows':[]};var _0x5b4312=_[_0x823f('0x3c')](db[_0x823f('0x3d')][_0x823f('0x3e')],function(_0x41307e){return{'name':_0x41307e[_0x823f('0x3f')],'type':_0x41307e[_0x823f('0x40')]['key']};});_0x56bb1b['model']=_[_0x823f('0x3c')](_0x5b4312,_0x823f('0x3a'));_0x56bb1b[_0x823f('0x41')]=_['keys'](_0x2bdfd3[_0x823f('0x41')]);_0x56bb1b[_0x823f('0x42')]=_[_0x823f('0x43')](_0x56bb1b['model'],_0x56bb1b[_0x823f('0x41')]);_0x396113['attributes']=_['intersection'](_0x56bb1b[_0x823f('0x44')],qs[_0x823f('0x45')](_0x2bdfd3[_0x823f('0x41')][_0x823f('0x45')]));_0x396113[_0x823f('0x46')]=_0x396113['attributes'][_0x823f('0x47')]?_0x396113[_0x823f('0x46')]:_0x56bb1b[_0x823f('0x44')];if(!_0x2bdfd3[_0x823f('0x41')]['hasOwnProperty'](_0x823f('0x48'))){_0x396113[_0x823f('0x2e')]=qs[_0x823f('0x2e')](_0x2bdfd3[_0x823f('0x41')][_0x823f('0x2e')]);_0x396113[_0x823f('0x2c')]=qs['offset'](_0x2bdfd3[_0x823f('0x41')]['offset']);}_0x396113[_0x823f('0x49')]=qs[_0x823f('0x4a')](_0x2bdfd3[_0x823f('0x41')][_0x823f('0x4a')]);_0x396113[_0x823f('0x4b')]=qs[_0x823f('0x42')](_['pick'](_0x2bdfd3['query'],_0x56bb1b[_0x823f('0x42')]),_0x5b4312);if(_0x2bdfd3[_0x823f('0x41')][_0x823f('0x4c')]){_0x396113[_0x823f('0x4b')]=_[_0x823f('0x4d')](_0x396113['where'],{'$or':_['map'](_0x5b4312,function(_0x5ca4a6){if(_0x5ca4a6[_0x823f('0x40')]!==_0x823f('0x4e')){var _0x28530a={};_0x28530a[_0x5ca4a6[_0x823f('0x3a')]]={'$like':'%'+_0x2bdfd3[_0x823f('0x41')]['filter']+'%'};return _0x28530a;}})});}_0x396113=_[_0x823f('0x4d')]({},_0x396113,_0x2bdfd3['options']);var _0x108213={'where':_0x396113[_0x823f('0x4b')]};return db[_0x823f('0x3d')][_0x823f('0x2f')](_0x108213)[_0x823f('0x21')](function(_0x1f735c){_0x4852d0[_0x823f('0x2f')]=_0x1f735c;if(_0x2bdfd3[_0x823f('0x41')][_0x823f('0x4f')]){_0x396113[_0x823f('0x50')]=[{'all':!![]}];}return db[_0x823f('0x3d')][_0x823f('0x51')](_0x396113);})[_0x823f('0x21')](function(_0x2336dc){_0x4852d0[_0x823f('0x52')]=_0x2336dc;return _0x4852d0;})[_0x823f('0x21')](respondWithFilteredResult(_0x218b6b,_0x396113))[_0x823f('0x2a')](handleError(_0x218b6b,null));};exports[_0x823f('0x53')]=function(_0xb541ec,_0x11ff7c){var _0x2195a8={'raw':!![],'where':{'id':_0xb541ec[_0x823f('0x54')]['id']}},_0x50fa02={};_0x50fa02[_0x823f('0x44')]=_[_0x823f('0x55')](db[_0x823f('0x3d')][_0x823f('0x3e')]);_0x50fa02[_0x823f('0x41')]=_[_0x823f('0x55')](_0xb541ec[_0x823f('0x41')]);_0x50fa02['filters']=_[_0x823f('0x43')](_0x50fa02[_0x823f('0x44')],_0x50fa02[_0x823f('0x41')]);_0x2195a8[_0x823f('0x46')]=_[_0x823f('0x43')](_0x50fa02['model'],qs[_0x823f('0x45')](_0xb541ec[_0x823f('0x41')]['fields']));_0x2195a8[_0x823f('0x46')]=_0x2195a8[_0x823f('0x46')][_0x823f('0x47')]?_0x2195a8[_0x823f('0x46')]:_0x50fa02['model'];if(_0xb541ec[_0x823f('0x41')][_0x823f('0x4f')]){_0x2195a8[_0x823f('0x50')]=[{'all':!![]}];}_0x2195a8=_[_0x823f('0x4d')]({},_0x2195a8,_0xb541ec[_0x823f('0x56')]);return db[_0x823f('0x3d')][_0x823f('0x57')](_0x2195a8)[_0x823f('0x21')](handleEntityNotFound(_0x11ff7c,null))[_0x823f('0x21')](respondWithResult(_0x11ff7c,null))[_0x823f('0x2a')](handleError(_0x11ff7c,null));};exports[_0x823f('0x58')]=function(_0x2363fd,_0x4566d5){return db[_0x823f('0x3d')][_0x823f('0x58')](_0x2363fd[_0x823f('0x59')],{})[_0x823f('0x21')](function(_0x275e33){var _0xe7268e=_0x2363fd[_0x823f('0x5a')][_0x823f('0x36')]({'plain':!![]});if(!_0xe7268e)throw new Error(_0x823f('0x5b'));if(_0xe7268e[_0x823f('0x5c')]===_0x823f('0x5a')){var _0x2258f3=_0x275e33[_0x823f('0x36')]({'plain':!![]});var _0x2cd156=_0x823f('0x37');return db[_0x823f('0x5d')][_0x823f('0x57')]({'where':{'name':_0x2cd156,'userProfileId':_0xe7268e[_0x823f('0x5e')]},'raw':!![]})[_0x823f('0x21')](function(_0x3ccb16){if(_0x3ccb16&&_0x3ccb16[_0x823f('0x5f')]===0x0){return db[_0x823f('0x38')]['create']({'name':_0x2258f3[_0x823f('0x3a')],'resourceId':_0x2258f3['id'],'type':_0x3ccb16[_0x823f('0x3a')],'sectionId':_0x3ccb16['id']},{})['then'](function(){return _0x275e33;});}else{return _0x275e33;}})[_0x823f('0x2a')](function(_0xb1666b){logger['error'](_0x823f('0x60'),_0xb1666b);throw _0xb1666b;});}return _0x275e33;})[_0x823f('0x21')](respondWithResult(_0x4566d5,0xc9))[_0x823f('0x2a')](handleError(_0x4566d5,null));};exports['update']=function(_0x3f14f9,_0x350360){if(_0x3f14f9['body']['id']){delete _0x3f14f9[_0x823f('0x59')]['id'];}return db[_0x823f('0x3d')][_0x823f('0x57')]({'where':{'id':_0x3f14f9[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x350360,null))[_0x823f('0x21')](saveUpdates(_0x3f14f9[_0x823f('0x59')],null))[_0x823f('0x21')](respondWithResult(_0x350360,null))['catch'](handleError(_0x350360,null));};exports[_0x823f('0x35')]=function(_0x5f31c9,_0x562b54){return db[_0x823f('0x3d')][_0x823f('0x57')]({'where':{'id':_0x5f31c9[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x562b54,null))['then'](removeEntity(_0x562b54,null))[_0x823f('0x2a')](handleError(_0x562b54,null));};exports[_0x823f('0x61')]=function(_0x1856d0,_0x4b78c2){return db['ChatQueue'][_0x823f('0x61')]()[_0x823f('0x21')](respondWithResult(_0x4b78c2,null))[_0x823f('0x2a')](handleError(_0x4b78c2,null));};exports[_0x823f('0x62')]=function(_0x31d286,_0x10650d,_0x96064e){var _0x10d28f={'raw':!![],'where':{}},_0x2fccc4={},_0x499361;return db[_0x823f('0x3d')][_0x823f('0x63')]({'where':{'id':_0x31d286[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x10650d,null))['then'](function(_0xaf0462){if(_0xaf0462){_0x499361=_0xaf0462[_0x823f('0x36')]({'plain':!![]});_0x2fccc4[_0x823f('0x44')]=_[_0x823f('0x55')](db[_0x823f('0x64')][_0x823f('0x3e')]);_0x2fccc4[_0x823f('0x41')]=_[_0x823f('0x55')](_0x31d286[_0x823f('0x41')]);_0x2fccc4[_0x823f('0x42')]=_[_0x823f('0x43')](_0x2fccc4[_0x823f('0x44')],_0x2fccc4[_0x823f('0x41')]);_0x10d28f[_0x823f('0x46')]=_[_0x823f('0x43')](_0x2fccc4[_0x823f('0x44')],qs['fields'](_0x31d286[_0x823f('0x41')]['fields']));_0x10d28f[_0x823f('0x46')]=_0x10d28f[_0x823f('0x46')][_0x823f('0x47')]?_0x10d28f['attributes']:_0x2fccc4['model'];if(!_0x31d286['query'][_0x823f('0x65')](_0x823f('0x48'))){_0x10d28f[_0x823f('0x2e')]=qs[_0x823f('0x2e')](_0x31d286[_0x823f('0x41')][_0x823f('0x2e')]);_0x10d28f[_0x823f('0x2c')]=qs[_0x823f('0x2c')](_0x31d286[_0x823f('0x41')]['offset']);}_0x10d28f[_0x823f('0x49')]=qs[_0x823f('0x4a')](_0x31d286[_0x823f('0x41')]['sort']);_0x10d28f['where']=qs[_0x823f('0x42')](_[_0x823f('0x66')](_0x31d286[_0x823f('0x41')],_0x2fccc4['filters']));_0x10d28f[_0x823f('0x4b')][_0x823f('0x67')]=_0xaf0462['id'];if(_0x31d286['query'][_0x823f('0x4c')]){_0x10d28f[_0x823f('0x4b')]=_[_0x823f('0x4d')](_0x10d28f[_0x823f('0x4b')],{'$or':_[_0x823f('0x3c')](_0x10d28f['attributes'],function(_0x130301){var _0x517508={};_0x517508[_0x130301]={'$like':'%'+_0x31d286[_0x823f('0x41')][_0x823f('0x4c')]+'%'};return _0x517508;})});}_0x10d28f=_[_0x823f('0x4d')]({},_0x10d28f,_0x31d286['options']);return db['UserChatQueue'][_0x823f('0x51')](_0x10d28f);}})[_0x823f('0x21')](function(_0x371692){if(_0x371692){return db[_0x823f('0x68')][_0x823f('0x69')]({'where':{'id':_['map'](_0x371692,_0x823f('0x6a')),'role':_0x823f('0x6b')},'attributes':['id',_0x823f('0x3a'),_0x823f('0x6c'),_0x823f('0x6d'),_0x823f('0x6e')]});}})['then'](function(_0xeeab1d){if(_0xeeab1d){return{'count':_0xeeab1d[_0x823f('0x2f')],'rows':_[_0x823f('0x3c')](_0xeeab1d[_0x823f('0x52')],function(_0x246277){return{'membername':_0x246277[_0x823f('0x3a')],'UserId':_0x246277['id'],'queue_name':_0x499361[_0x823f('0x3a')],'ChatQueueId':_0x499361['id'],'interface':util['format'](_0x823f('0x6f'),'SIP',_0x246277['name']),'penalty':0x0,'paused':_0x246277[_0x823f('0x6c')],'createdAt':_0x246277[_0x823f('0x6e')],'updatedAt':_0x246277[_0x823f('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x823f('0x21')](respondWithFilteredResult(_0x10650d,_0x10d28f))[_0x823f('0x2a')](handleError(_0x10650d,null));};exports[_0x823f('0x70')]=function(_0x2e9e63,_0x4fde98,_0xbb0f00){var _0x42ae98={};var _0xeeabb0={};var _0x1566e9;var _0x539ee2;return db[_0x823f('0x3d')][_0x823f('0x63')]({'where':{'id':_0x2e9e63[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x4fde98,null))[_0x823f('0x21')](function(_0x250175){if(_0x250175){_0x1566e9=_0x250175;_0xeeabb0[_0x823f('0x44')]=_['keys'](db[_0x823f('0x71')][_0x823f('0x3e')]);_0xeeabb0[_0x823f('0x41')]=_[_0x823f('0x55')](_0x2e9e63[_0x823f('0x41')]);_0xeeabb0[_0x823f('0x42')]=_[_0x823f('0x43')](_0xeeabb0[_0x823f('0x44')],_0xeeabb0[_0x823f('0x41')]);_0x42ae98[_0x823f('0x46')]=_[_0x823f('0x43')](_0xeeabb0[_0x823f('0x44')],qs[_0x823f('0x45')](_0x2e9e63[_0x823f('0x41')]['fields']));_0x42ae98['attributes']=_0x42ae98[_0x823f('0x46')]['length']?_0x42ae98[_0x823f('0x46')]:_0xeeabb0['model'];_0x42ae98['order']=qs[_0x823f('0x4a')](_0x2e9e63[_0x823f('0x41')]['sort']);_0x42ae98[_0x823f('0x4b')]=qs[_0x823f('0x42')](_[_0x823f('0x66')](_0x2e9e63[_0x823f('0x41')],_0xeeabb0[_0x823f('0x42')]));if(_0x2e9e63[_0x823f('0x41')]['filter']){_0x42ae98[_0x823f('0x4b')]=_['merge'](_0x42ae98[_0x823f('0x4b')],{'$or':_[_0x823f('0x3c')](_0x42ae98[_0x823f('0x46')],function(_0x181e5a){var _0xa8ada5={};_0xa8ada5[_0x181e5a]={'$like':'%'+_0x2e9e63[_0x823f('0x41')]['filter']+'%'};return _0xa8ada5;})});}_0x42ae98=_[_0x823f('0x4d')]({},_0x42ae98,_0x2e9e63[_0x823f('0x56')]);return _0x1566e9[_0x823f('0x70')](_0x42ae98);}})[_0x823f('0x21')](function(_0x19c720){if(_0x19c720){_0x539ee2=_0x19c720[_0x823f('0x47')];if(!_0x2e9e63['query'][_0x823f('0x65')](_0x823f('0x48'))){_0x42ae98['limit']=qs['limit'](_0x2e9e63[_0x823f('0x41')]['limit']);_0x42ae98[_0x823f('0x2c')]=qs[_0x823f('0x2c')](_0x2e9e63[_0x823f('0x41')][_0x823f('0x2c')]);}return _0x1566e9[_0x823f('0x70')](_0x42ae98);}})['then'](function(_0x55469c){if(_0x55469c){return _0x55469c?{'count':_0x539ee2,'rows':_0x55469c}:null;}})['then'](respondWithResult(_0x4fde98,null))[_0x823f('0x2a')](handleError(_0x4fde98,null));};exports[_0x823f('0x72')]=function(_0x45683b,_0x2a07c5,_0x4b81c6){var _0x5f5cce=_0x45683b[_0x823f('0x59')][_0x823f('0x73')];return db[_0x823f('0x71')]['findAll']({'where':{'id':_0x5f5cce},'attributes':['id'],'include':[{'model':db['User'],'as':_0x823f('0x74'),'attributes':['id',_0x823f('0x3a'),_0x823f('0x75'),_0x823f('0x76'),_0x823f('0x77')],'raw':!![]}]})['then'](function(_0xb9062d){if(_0xb9062d){var _0x33a532=_['flatMap'](_0xb9062d,function(_0x457aa2){var _0x3d7d4a=_0x457aa2[_0x823f('0x36')]({'plain':!![]});return _0x3d7d4a['Agents'];});return db['ChatQueue'][_0x823f('0x57')]({'where':{'id':_0x45683b[_0x823f('0x54')]['id']}})[_0x823f('0x21')](function(_0x58597e){return db[_0x823f('0x78')][_0x823f('0x79')](function(_0x351ae9){return _0x58597e[_0x823f('0x72')](_0x5f5cce,{'transaction':_0x351ae9})[_0x823f('0x21')](function(){return BPromise[_0x823f('0x7a')](_0x33a532,function(_0x535287){return db[_0x823f('0x64')]['findOrCreate']({'where':{'UserId':_0x535287['id'],'ChatQueueId':_0x45683b[_0x823f('0x54')]['id']},'transaction':_0x351ae9});});})[_0x823f('0x21')](function(){_0x33a532['forEach'](function(_0x4d3fdb){socket[_0x823f('0x7b')](_0x823f('0x7c'),{'UserId':_0x4d3fdb['id'],'ChatQueueId':_0x58597e['id']});});});});});}})[_0x823f('0x21')](respondWithStatusCode(_0x2a07c5,null))[_0x823f('0x2a')](handleError(_0x2a07c5,null));};exports['removeTeams']=function(_0x1b8f0f,_0x64c2a8,_0x5845c6){return db[_0x823f('0x71')][_0x823f('0x51')]({'where':{'id':_0x1b8f0f[_0x823f('0x41')][_0x823f('0x73')]},'attributes':['id'],'include':[{'model':db[_0x823f('0x68')],'as':_0x823f('0x74'),'attributes':['id'],'raw':!![]}]})[_0x823f('0x21')](handleEntityNotFound(_0x64c2a8,null))[_0x823f('0x21')](function(_0x39d0d2){var _0x4c622a=_[_0x823f('0x3c')](_0x39d0d2,'id');var _0x63af2d=[];var _0x5ab047=[];var _0x45c540=squel['select']();_0x45c540[_0x823f('0x7d')](_0x823f('0x7e'))[_0x823f('0x7f')](_0x823f('0x80'),'tq')[_0x823f('0x81')]('user_has_teams','ut',_0x823f('0x82'))[_0x823f('0x4b')]('ChatQueueId\x20=\x20?',_0x1b8f0f['params']['id']);for(var _0x692623=0x0;_0x692623<_0x39d0d2[_0x823f('0x47')];_0x692623+=0x1){let _0x1af44c=_0x39d0d2[_0x692623];for(var _0x175ab8=0x0;_0x175ab8<_0x1af44c['Agents'][_0x823f('0x47')];_0x175ab8+=0x1){let _0x4f35f0=_0x1af44c[_0x823f('0x74')][_0x175ab8];var _0x122d40=_0x45c540[_0x823f('0x83')]();_0x122d40['where']('ut.UserId\x20=\x20?',_0x4f35f0['id']);_0x5ab047[_0x823f('0x84')](db['sequelize'][_0x823f('0x41')](_0x122d40[_0x823f('0x85')](),{'type':db[_0x823f('0x78')][_0x823f('0x86')][_0x823f('0x87')]})[_0x823f('0x21')](function(_0x11eda7){if(_0x11eda7[_0x823f('0x47')]===0x1){return _0x4f35f0['id'];}else{var _0x510a9d=_['every'](_[_0x823f('0x3c')](_0x11eda7,_0x823f('0x88')),function(_0x429ae0){return _[_0x823f('0x89')](_0x4c622a,_0x429ae0);});if(_0x510a9d){return _0x4f35f0['id'];}}}));}}return BPromise[_0x823f('0x8a')](_0x5ab047)['then'](function(_0x2a640e){_0x63af2d=_(_0x63af2d)[_0x823f('0x8b')](_0x2a640e)[_0x823f('0x8c')]()[_0x823f('0x8d')]();return db[_0x823f('0x3d')][_0x823f('0x57')]({'where':{'id':_0x1b8f0f[_0x823f('0x54')]['id']}})[_0x823f('0x21')](function(_0x5a3401){return db['sequelize']['transaction'](function(_0x18d35d){return _0x5a3401[_0x823f('0x8e')](_0x1b8f0f[_0x823f('0x41')][_0x823f('0x73')],{'transaction':_0x18d35d})['then'](function(){if(!_[_0x823f('0x8f')](_0x63af2d)){return _0x5a3401[_0x823f('0x90')](_0x63af2d,{'transaction':_0x18d35d});}})[_0x823f('0x21')](function(){_0x63af2d[_0x823f('0x91')](function(_0x19402a){socket[_0x823f('0x7b')](_0x823f('0x92'),{'UserId':_0x19402a,'ChatQueueId':_0x5a3401['id']});});});});});});})[_0x823f('0x21')](respondWithStatusCode(_0x64c2a8,null))['catch'](handleError(_0x64c2a8,null));};exports[_0x823f('0x93')]=function(_0x3a9073,_0x436330,_0x23e18a){return db['ChatQueue'][_0x823f('0x57')]({'where':{'id':_0x3a9073[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x436330,null))[_0x823f('0x21')](function(_0x1afba2){if(_0x1afba2){return _0x1afba2[_0x823f('0x93')](_0x3a9073[_0x823f('0x59')][_0x823f('0x73')],_[_0x823f('0x94')](_0x3a9073[_0x823f('0x59')],[_0x823f('0x73'),'id'])||{})[_0x823f('0x95')](function(_0x51feed){for(var _0x451a0d=0x0;_0x451a0d<_0x3a9073[_0x823f('0x59')]['ids'][_0x823f('0x47')];_0x451a0d+=0x1){socket[_0x823f('0x7b')]('userChatQueue:save',{'UserId':Number(_0x3a9073[_0x823f('0x59')][_0x823f('0x73')][_0x451a0d]),'ChatQueueId':Number(_0x3a9073[_0x823f('0x54')]['id'])});}return _0x51feed;});}})['then'](respondWithResult(_0x436330,null))[_0x823f('0x2a')](handleError(_0x436330,null));};exports[_0x823f('0x90')]=function(_0x2dc143,_0x48ada2,_0x432cbd){return db['ChatQueue'][_0x823f('0x57')]({'where':{'id':_0x2dc143[_0x823f('0x54')]['id']}})['then'](handleEntityNotFound(_0x48ada2,null))[_0x823f('0x21')](function(_0x508123){if(_0x508123){return _0x508123[_0x823f('0x90')](_0x2dc143[_0x823f('0x41')]['ids'])[_0x823f('0x21')](function(){if(_[_0x823f('0x96')](_0x2dc143[_0x823f('0x41')][_0x823f('0x73')])){for(var _0xf6051e=0x0;_0xf6051e<_0x2dc143[_0x823f('0x41')]['ids'][_0x823f('0x47')];_0xf6051e+=0x1){socket[_0x823f('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x2dc143['query'][_0x823f('0x73')][_0xf6051e]),'ChatQueueId':Number(_0x2dc143[_0x823f('0x54')]['id'])});}}else{socket['emit'](_0x823f('0x92'),{'UserId':Number(_0x2dc143['query'][_0x823f('0x73')]),'ChatQueueId':Number(_0x2dc143[_0x823f('0x54')]['id'])});}});}})[_0x823f('0x21')](respondWithStatusCode(_0x48ada2,null))[_0x823f('0x2a')](handleError(_0x48ada2,null));};exports['getAgents']=function(_0x3bcb15,_0x4a8918,_0x10d7fe){var _0x489c59={};var _0xbc96aa={};var _0x3fa011;var _0x243b65;return db['ChatQueue'][_0x823f('0x63')]({'where':{'id':_0x3bcb15[_0x823f('0x54')]['id']}})[_0x823f('0x21')](handleEntityNotFound(_0x4a8918,null))[_0x823f('0x21')](function(_0xd789f9){if(_0xd789f9){_0x3fa011=_0xd789f9;_0xbc96aa[_0x823f('0x44')]=_[_0x823f('0x55')](db[_0x823f('0x68')]['rawAttributes']);_0xbc96aa['query']=_[_0x823f('0x55')](_0x3bcb15[_0x823f('0x41')]);_0xbc96aa[_0x823f('0x42')]=_['intersection'](_0xbc96aa['model'],_0xbc96aa['query']);_0x489c59[_0x823f('0x46')]=_[_0x823f('0x43')](_0xbc96aa[_0x823f('0x44')],qs['fields'](_0x3bcb15['query'][_0x823f('0x45')]));_0x489c59[_0x823f('0x46')]=_0x489c59[_0x823f('0x46')][_0x823f('0x47')]?_0x489c59[_0x823f('0x46')]:_0xbc96aa[_0x823f('0x44')];_0x489c59[_0x823f('0x49')]=qs[_0x823f('0x4a')](_0x3bcb15['query'][_0x823f('0x4a')]);_0x489c59[_0x823f('0x4b')]=qs['filters'](_['pick'](_0x3bcb15[_0x823f('0x41')],_0xbc96aa[_0x823f('0x42')]));if(_0x3bcb15[_0x823f('0x41')][_0x823f('0x4c')]){_0x489c59[_0x823f('0x4b')]=_['merge'](_0x489c59['where'],{'$or':_[_0x823f('0x3c')](_0x489c59[_0x823f('0x46')],function(_0x51bd6c){var _0xc6dc7a={};_0xc6dc7a[_0x51bd6c]={'$like':'%'+_0x3bcb15[_0x823f('0x41')]['filter']+'%'};return _0xc6dc7a;})});}_0x489c59=_['merge']({},_0x489c59,_0x3bcb15[_0x823f('0x56')]);return _0x3fa011['getAgents'](_0x489c59);}})[_0x823f('0x21')](function(_0x3892de){if(_0x3892de){_0x243b65=_0x3892de[_0x823f('0x47')];if(!_0x3bcb15[_0x823f('0x41')][_0x823f('0x65')]('nolimit')){_0x489c59[_0x823f('0x2e')]=qs['limit'](_0x3bcb15[_0x823f('0x41')][_0x823f('0x2e')]);_0x489c59[_0x823f('0x2c')]=qs[_0x823f('0x2c')](_0x3bcb15['query'][_0x823f('0x2c')]);}return _0x3fa011[_0x823f('0x97')](_0x489c59);}})['then'](function(_0x4a648b){if(_0x4a648b){return _0x4a648b?{'count':_0x243b65,'rows':_0x4a648b}:null;}})[_0x823f('0x21')](respondWithResult(_0x4a8918,null))[_0x823f('0x2a')](handleError(_0x4a8918,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 8577b63..5ba2868 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 _0xbc17=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x31ddea,_0x40de6d){var _0x12539b=function(_0x1d353b){while(--_0x1d353b){_0x31ddea['push'](_0x31ddea['shift']());}};_0x12539b(++_0x40de6d);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x361bb4,_0x411189){_0x361bb4=_0x361bb4-0x0;var _0x3e88c3=_0xbc17[_0x361bb4];return _0x3e88c3;};'use strict';var EventEmitter=require(_0x7bc1('0x0'));var ChatQueue=require(_0x7bc1('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7bc1('0x2')](0x0);var events={'afterCreate':_0x7bc1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ff36d){return function(_0x7aa41e,_0x5dfaa8,_0x2cd126){ChatQueueEvents['emit'](_0x3ff36d+':'+_0x7aa41e['id'],_0x7aa41e);ChatQueueEvents[_0x7bc1('0x4')](_0x3ff36d,_0x7aa41e);_0x2cd126(null);};}for(var e in events){if(events[_0x7bc1('0x5')](e)){var event=events[e];ChatQueue[_0x7bc1('0x6')](e,emitEvent(event));}}module[_0x7bc1('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xf53a=['remove','emit','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x353188,_0x3d5849){var _0x43d643=function(_0x25b8b2){while(--_0x25b8b2){_0x353188['push'](_0x353188['shift']());}};_0x43d643(++_0x3d5849);}(_0xf53a,0x1d3));var _0xaf53=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xf53a[_0x500419];return _0x241c1a;};'use strict';var EventEmitter=require(_0xaf53('0x0'));var ChatQueue=require(_0xaf53('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaf53('0x2')](0x0);var events={'afterCreate':_0xaf53('0x3'),'afterUpdate':_0xaf53('0x4'),'afterDestroy':_0xaf53('0x5')};function emitEvent(_0x582758){return function(_0x2e3e90,_0x4bee19,_0x2a32d7){ChatQueueEvents[_0xaf53('0x6')](_0x582758+':'+_0x2e3e90['id'],_0x2e3e90);ChatQueueEvents[_0xaf53('0x6')](_0x582758,_0x2e3e90);_0x2a32d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xaf53('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index b5957f8..93366a0 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 _0x9ac7=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3ab7a7,_0x3d421d){var _0x3f7a31=function(_0x4d2c0d){while(--_0x4d2c0d){_0x3ab7a7['push'](_0x3ab7a7['shift']());}};_0x3f7a31(++_0x3d421d);}(_0x9ac7,0xdb));var _0x79ac=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9ac7[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x79ac('0x0'));var util=require(_0x79ac('0x1'));var logger=require(_0x79ac('0x2'))(_0x79ac('0x3'));var moment=require(_0x79ac('0x4'));var BPromise=require('bluebird');var rp=require(_0x79ac('0x5'));var fs=require('fs');var path=require(_0x79ac('0x6'));var rimraf=require(_0x79ac('0x7'));var config=require(_0x79ac('0x8'));var attributes=require(_0x79ac('0x9'));module[_0x79ac('0xa')]=function(_0x29a9b8,_0xae1f63){return _0x29a9b8[_0x79ac('0xb')](_0x79ac('0xc'),attributes,{'tableName':_0x79ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1113=['define','ChatQueue','chat_queues','../../config/logger','api','moment','bluebird','path','rimraf','./chatQueue.attributes','exports'];(function(_0x3a3c3d,_0x3b8542){var _0xf3142f=function(_0x479bb0){while(--_0x479bb0){_0x3a3c3d['push'](_0x3a3c3d['shift']());}};_0xf3142f(++_0x3b8542);}(_0x1113,0x1a5));var _0x3111=function(_0x4da3b6,_0x233aff){_0x4da3b6=_0x4da3b6-0x0;var _0x574d38=_0x1113[_0x4da3b6];return _0x574d38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3111('0x0'))(_0x3111('0x1'));var moment=require(_0x3111('0x2'));var BPromise=require(_0x3111('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3111('0x4'));var rimraf=require(_0x3111('0x5'));var config=require('../../config/environment');var attributes=require(_0x3111('0x6'));module[_0x3111('0x7')]=function(_0x7aa627,_0x2fba74){return _0x7aa627[_0x3111('0x8')](_0x3111('0x9'),attributes,{'tableName':_0x3111('0xa'),'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 3e68862..d64f76b 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 _0xd7cf=['ShowChatQueue','ChatQueue','find','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7cf,0x12b));var _0xfd7c=function(_0x14102c,_0x1cb214){_0x14102c=_0x14102c-0x0;var _0x13297b=_0xd7cf[_0x14102c];return _0x13297b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd7c('0x0'));var BPromise=require(_0xfd7c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd7c('0x2'));var db=require(_0xfd7c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd7c('0x4'));var config=require(_0xfd7c('0x5'));var jayson=require(_0xfd7c('0x6'));var client=jayson[_0xfd7c('0x7')]['http']({'port':0x232a});config[_0xfd7c('0x8')]=_[_0xfd7c('0x9')](config[_0xfd7c('0x8')],{'host':_0xfd7c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd7c('0x8')]));require(_0xfd7c('0xb'))[_0xfd7c('0xc')](socket);function respondWithRpcPromise(_0x4e7912,_0x156d02,_0x24e717){return new BPromise(function(_0x1adb82,_0x4d4395){return client[_0xfd7c('0xd')](_0x4e7912,_0x24e717)[_0xfd7c('0xe')](function(_0x34e894){logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,'request\x20sent');logger[_0xfd7c('0x11')](_0xfd7c('0x12'),_0x156d02,_0xfd7c('0x13'),JSON[_0xfd7c('0x14')](_0x34e894));if(_0x34e894[_0xfd7c('0x15')]){if(_0x34e894['error'][_0xfd7c('0x16')]===0x1f4){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894[_0xfd7c('0x15')]['message']);return _0x4d4395(_0x34e894['error']['message']);}logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894['error'][_0xfd7c('0x17')]);return _0x1adb82(_0x34e894[_0xfd7c('0x15')]['message']);}else{logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,_0xfd7c('0x13'));_0x1adb82(_0x34e894['result'][_0xfd7c('0x17')]);}})[_0xfd7c('0x18')](function(_0x52d2d2){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x52d2d2);_0x4d4395(_0x52d2d2);});});}exports[_0xfd7c('0x19')]=function(_0x484adc){var _0x58a155=this;return new Promise(function(_0x4d86c4,_0x483cc4){return db['ChatQueue'][_0xfd7c('0x1a')]({'raw':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1d')]||null:null,'limit':_0x484adc['options']?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1e')]||null:null,'include':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x285768){return{'model':db[_0x285768[_0xfd7c('0x21')]],'as':_0x285768['as'],'attributes':_0x285768[_0xfd7c('0x1d')],'include':_0x285768['include']?_[_0xfd7c('0x20')](_0x285768[_0xfd7c('0x1f')],function(_0x5276cc){return{'model':db[_0x5276cc[_0xfd7c('0x21')]],'as':_0x5276cc['as'],'attributes':_0x5276cc[_0xfd7c('0x1d')],'include':_0x5276cc[_0xfd7c('0x1f')]?_['map'](_0x5276cc['include'],function(_0x374dce){return{'model':db[_0x374dce[_0xfd7c('0x21')]],'as':_0x374dce['as'],'attributes':_0x374dce[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x59ca9f){logger['info']('GetChatQueue',_0x484adc);logger[_0xfd7c('0x11')](_0xfd7c('0x19'),_0x484adc,JSON[_0xfd7c('0x14')](_0x59ca9f));_0x4d86c4(_0x59ca9f);})[_0xfd7c('0x18')](function(_0x2e9eaa){logger[_0xfd7c('0x15')](_0xfd7c('0x19'),_0x2e9eaa['message'],_0x484adc);_0x483cc4(_0x58a155[_0xfd7c('0x15')](0x1f4,_0x2e9eaa['message']));});});};exports[_0xfd7c('0x22')]=function(_0x4f6d24){var _0x383c43=this;return new Promise(function(_0x3e8d86,_0x4043dc){return db[_0xfd7c('0x23')][_0xfd7c('0x24')]({'raw':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')]['attributes']||null:null,'include':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_['map'](_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x490331){return{'model':db[_0x490331[_0xfd7c('0x21')]],'as':_0x490331['as'],'attributes':_0x490331[_0xfd7c('0x1d')],'include':_0x490331[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x490331[_0xfd7c('0x1f')],function(_0x4cfbbd){return{'model':db[_0x4cfbbd[_0xfd7c('0x21')]],'as':_0x4cfbbd['as'],'attributes':_0x4cfbbd[_0xfd7c('0x1d')],'include':_0x4cfbbd[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x4cfbbd[_0xfd7c('0x1f')],function(_0x154894){return{'model':db[_0x154894[_0xfd7c('0x21')]],'as':_0x154894['as'],'attributes':_0x154894[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x5e3d23){logger[_0xfd7c('0xf')](_0xfd7c('0x22'),_0x4f6d24);logger['debug'](_0xfd7c('0x22'),_0x4f6d24,JSON[_0xfd7c('0x14')](_0x5e3d23));_0x3e8d86(_0x5e3d23);})[_0xfd7c('0x18')](function(_0x46cce7){logger[_0xfd7c('0x15')]('ShowChatQueue',_0x46cce7[_0xfd7c('0x17')],_0x4f6d24);_0x4043dc(_0x383c43[_0xfd7c('0x15')](0x1f4,_0x46cce7[_0xfd7c('0x17')]));});});};
\ No newline at end of file
+var _0x18a8=['client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','then','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','debug','stringify','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x18a8,0x127));var _0x818a=function(_0x14f29b,_0x46f764){_0x14f29b=_0x14f29b-0x0;var _0x3c4440=_0x18a8[_0x14f29b];return _0x3c4440;};'use strict';var _=require(_0x818a('0x0'));var util=require(_0x818a('0x1'));var moment=require('moment');var BPromise=require(_0x818a('0x2'));var rs=require(_0x818a('0x3'));var fs=require('fs');var Redis=require(_0x818a('0x4'));var db=require(_0x818a('0x5'))['db'];var utils=require(_0x818a('0x6'));var logger=require('../../config/logger')(_0x818a('0x7'));var config=require(_0x818a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x818a('0x9')][_0x818a('0xa')]({'port':0x232a});config[_0x818a('0xb')]=_[_0x818a('0xc')](config[_0x818a('0xb')],{'host':_0x818a('0xd'),'port':0x18eb});var socket=require(_0x818a('0xe'))(new Redis(config['redis']));require(_0x818a('0xf'))['register'](socket);function respondWithRpcPromise(_0x5af804,_0x569b7f,_0x4db0f1){return new BPromise(function(_0x41113a,_0xa667b4){return client['request'](_0x5af804,_0x4db0f1)[_0x818a('0x10')](function(_0x535d4e){logger['info'](_0x818a('0x11'),_0x569b7f,'request\x20sent');logger['debug'](_0x818a('0x12'),_0x569b7f,'request\x20sent',JSON['stringify'](_0x535d4e));if(_0x535d4e[_0x818a('0x13')]){if(_0x535d4e[_0x818a('0x13')]['code']===0x1f4){logger['error'](_0x818a('0x11'),_0x569b7f,_0x535d4e[_0x818a('0x13')][_0x818a('0x14')]);return _0xa667b4(_0x535d4e[_0x818a('0x13')]['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x569b7f,_0x535d4e[_0x818a('0x13')][_0x818a('0x14')]);return _0x41113a(_0x535d4e[_0x818a('0x13')][_0x818a('0x14')]);}else{logger[_0x818a('0x15')](_0x818a('0x11'),_0x569b7f,_0x818a('0x16'));_0x41113a(_0x535d4e[_0x818a('0x17')][_0x818a('0x14')]);}})[_0x818a('0x18')](function(_0x4b6b55){logger[_0x818a('0x13')](_0x818a('0x11'),_0x569b7f,_0x4b6b55);_0xa667b4(_0x4b6b55);});});}exports[_0x818a('0x19')]=function(_0x3ed542){var _0x373534=this;return new Promise(function(_0x463aa2,_0x659d41){return db[_0x818a('0x1a')][_0x818a('0x1b')]({'raw':_0x3ed542[_0x818a('0x1c')]?_0x3ed542[_0x818a('0x1c')][_0x818a('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ed542[_0x818a('0x1c')]?_0x3ed542[_0x818a('0x1c')][_0x818a('0x1e')]||null:null,'attributes':_0x3ed542[_0x818a('0x1c')]?_0x3ed542[_0x818a('0x1c')][_0x818a('0x1f')]||null:null,'limit':_0x3ed542[_0x818a('0x1c')]?_0x3ed542['options']['limit']||null:null,'include':_0x3ed542[_0x818a('0x1c')]?_0x3ed542['options'][_0x818a('0x20')]?_[_0x818a('0x21')](_0x3ed542[_0x818a('0x1c')]['include'],function(_0x5637f6){return{'model':db[_0x5637f6['model']],'as':_0x5637f6['as'],'attributes':_0x5637f6[_0x818a('0x1f')],'include':_0x5637f6['include']?_[_0x818a('0x21')](_0x5637f6[_0x818a('0x20')],function(_0x298a69){return{'model':db[_0x298a69['model']],'as':_0x298a69['as'],'attributes':_0x298a69[_0x818a('0x1f')],'include':_0x298a69[_0x818a('0x20')]?_['map'](_0x298a69['include'],function(_0x47d3bc){return{'model':db[_0x47d3bc[_0x818a('0x22')]],'as':_0x47d3bc['as'],'attributes':_0x47d3bc[_0x818a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x818a('0x10')](function(_0x129378){logger[_0x818a('0x15')](_0x818a('0x19'),_0x3ed542);logger[_0x818a('0x23')](_0x818a('0x19'),_0x3ed542,JSON[_0x818a('0x24')](_0x129378));_0x463aa2(_0x129378);})['catch'](function(_0x2b9a2f){logger[_0x818a('0x13')](_0x818a('0x19'),_0x2b9a2f[_0x818a('0x14')],_0x3ed542);_0x659d41(_0x373534[_0x818a('0x13')](0x1f4,_0x2b9a2f['message']));});});};exports[_0x818a('0x25')]=function(_0x49f0a5){var _0x4da577=this;return new Promise(function(_0x5be7cc,_0x311604){return db['ChatQueue']['find']({'raw':_0x49f0a5[_0x818a('0x1c')]?_0x49f0a5[_0x818a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x49f0a5['options']?_0x49f0a5[_0x818a('0x1c')][_0x818a('0x1e')]||null:null,'attributes':_0x49f0a5['options']?_0x49f0a5[_0x818a('0x1c')][_0x818a('0x1f')]||null:null,'include':_0x49f0a5[_0x818a('0x1c')]?_0x49f0a5[_0x818a('0x1c')][_0x818a('0x20')]?_['map'](_0x49f0a5[_0x818a('0x1c')][_0x818a('0x20')],function(_0x32c005){return{'model':db[_0x32c005[_0x818a('0x22')]],'as':_0x32c005['as'],'attributes':_0x32c005['attributes'],'include':_0x32c005['include']?_[_0x818a('0x21')](_0x32c005[_0x818a('0x20')],function(_0xac7288){return{'model':db[_0xac7288[_0x818a('0x22')]],'as':_0xac7288['as'],'attributes':_0xac7288[_0x818a('0x1f')],'include':_0xac7288[_0x818a('0x20')]?_[_0x818a('0x21')](_0xac7288['include'],function(_0x3d6717){return{'model':db[_0x3d6717[_0x818a('0x22')]],'as':_0x3d6717['as'],'attributes':_0x3d6717[_0x818a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f967a){logger[_0x818a('0x15')]('ShowChatQueue',_0x49f0a5);logger[_0x818a('0x23')](_0x818a('0x25'),_0x49f0a5,JSON[_0x818a('0x24')](_0x2f967a));_0x5be7cc(_0x2f967a);})[_0x818a('0x18')](function(_0x349e82){logger[_0x818a('0x13')](_0x818a('0x25'),_0x349e82[_0x818a('0x14')],_0x49f0a5);_0x311604(_0x4da577[_0x818a('0x13')](0x1f4,_0x349e82[_0x818a('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 79c308d..4fdaae1 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 _0xa37e=['chatQueue:','remove','update','emit','removeListener','register'];(function(_0x4ad88a,_0x46411b){var _0x1af50a=function(_0x48190c){while(--_0x48190c){_0x4ad88a['push'](_0x4ad88a['shift']());}};_0x1af50a(++_0x46411b);}(_0xa37e,0x97));var _0xea37=function(_0x211c4c,_0x264156){_0x211c4c=_0x211c4c-0x0;var _0x464c20=_0xa37e[_0x211c4c];return _0x464c20;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xea37('0x0'),_0xea37('0x1')];function createListener(_0x204a22,_0x475c71){return function(_0x5430aa){_0x475c71[_0xea37('0x2')](_0x204a22,_0x5430aa);};}function removeListener(_0x537c5a,_0x360ed5){return function(){ChatQueueEvents[_0xea37('0x3')](_0x537c5a,_0x360ed5);};}exports[_0xea37('0x4')]=function(_0x4d380b){for(var _0x57135b=0x0,_0x36c489=events['length'];_0x57135b<_0x36c489;_0x57135b++){var _0x4ae081=events[_0x57135b];var _0x2c2890=createListener(_0xea37('0x5')+_0x4ae081,_0x4d380b);ChatQueueEvents['on'](_0x4ae081,_0x2c2890);}};
\ No newline at end of file
+var _0xa8a8=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x18c6c0,_0x4da3ff){var _0xb27152=function(_0x239070){while(--_0x239070){_0x18c6c0['push'](_0x18c6c0['shift']());}};_0xb27152(++_0x4da3ff);}(_0xa8a8,0xec));var _0x8a8a=function(_0x2e97d6,_0x65d243){_0x2e97d6=_0x2e97d6-0x0;var _0x12a91d=_0xa8a8[_0x2e97d6];return _0x12a91d;};'use strict';var ChatQueueEvents=require(_0x8a8a('0x0'));var events=[_0x8a8a('0x1'),_0x8a8a('0x2'),_0x8a8a('0x3')];function createListener(_0x5221bc,_0x2a2676){return function(_0x3296a6){_0x2a2676[_0x8a8a('0x4')](_0x5221bc,_0x3296a6);};}function removeListener(_0x3ed1de,_0x45515d){return function(){ChatQueueEvents[_0x8a8a('0x5')](_0x3ed1de,_0x45515d);};}exports[_0x8a8a('0x6')]=function(_0x12db82){for(var _0x2e8193=0x0,_0x315fe9=events[_0x8a8a('0x7')];_0x2e8193<_0x315fe9;_0x2e8193++){var _0x8e7aa0=events[_0x2e8193];var _0x4225b9=createListener(_0x8a8a('0x8')+_0x8e7aa0,_0x12db82);ChatQueueEvents['on'](_0x8e7aa0,_0x4225b9);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 99378d6..90400aa 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x209cea,_0x9bcc6e){var _0x45521f=function(_0x5c99a0){while(--_0x5c99a0){_0x209cea['push'](_0x209cea['shift']());}};_0x45521f(++_0x9bcc6e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x4aa1e0,_0x4c155d){var _0x45d0b=function(_0x461ca5){while(--_0x461ca5){_0x4aa1e0['push'](_0x4aa1e0['shift']());}};_0x45d0b(++_0x4c155d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),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 bc8f087..1b78687 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 _0x64a1=['exports','DATE','STRING','moment','sequelize'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x64a1,0x13e));var _0x164a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x64a1[_0x57b54c];return _0x59cc19;};'use strict';var moment=require(_0x164a('0x0'));var Sequelize=require(_0x164a('0x1'));module[_0x164a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x164a('0x3')]},'leaveAt':{'type':Sequelize[_0x164a('0x3')]},'acceptAt':{'type':Sequelize[_0x164a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x164a('0x4')]}};
\ No newline at end of file
+var _0xcd0a=['exports','STRING','DATE','moment','sequelize'];(function(_0x17ce9c,_0x6db0a0){var _0x93265e=function(_0x42b5a3){while(--_0x42b5a3){_0x17ce9c['push'](_0x17ce9c['shift']());}};_0x93265e(++_0x6db0a0);}(_0xcd0a,0xee));var _0xacd0=function(_0x25a78d,_0x2b0f45){_0x25a78d=_0x25a78d-0x0;var _0xd54de8=_0xcd0a[_0x25a78d];return _0xd54de8;};'use strict';var moment=require(_0xacd0('0x0'));var Sequelize=require(_0xacd0('0x1'));module[_0xacd0('0x2')]={'uniqueid':{'type':Sequelize[_0xacd0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xacd0('0x3')]},'joinAt':{'type':Sequelize[_0xacd0('0x4')]},'leaveAt':{'type':Sequelize[_0xacd0('0x4')]},'acceptAt':{'type':Sequelize[_0xacd0('0x4')]},'exitAt':{'type':Sequelize[_0xacd0('0x4')]},'reason':{'type':Sequelize[_0xacd0('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b0fcecf..9fc2d2f 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 _0x3c85=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x14aec3,_0x12f372){var _0x3b599a=function(_0x46133d){while(--_0x46133d){_0x14aec3['push'](_0x14aec3['shift']());}};_0x3b599a(++_0x12f372);}(_0x3c85,0x1a0));var _0x53c8=function(_0x1ded1f,_0x42bf0d){_0x1ded1f=_0x1ded1f-0x0;var _0x5dc380=_0x3c85[_0x1ded1f];return _0x5dc380;};'use strict';var emlformat=require(_0x53c8('0x0'));var rimraf=require(_0x53c8('0x1'));var zipdir=require(_0x53c8('0x2'));var jsonpatch=require(_0x53c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x53c8('0x4'));var Mustache=require(_0x53c8('0x5'));var util=require(_0x53c8('0x6'));var path=require('path');var sox=require(_0x53c8('0x7'));var csv=require(_0x53c8('0x8'));var ejs=require(_0x53c8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x53c8('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x53c8('0xb'));var Papa=require(_0x53c8('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x53c8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x53c8('0xe'));var utils=require(_0x53c8('0xf'));var config=require(_0x53c8('0x10'));var licenseUtil=require(_0x53c8('0x11'));var db=require(_0x53c8('0x12'))['db'];function respondWithStatusCode(_0x499ba8,_0x2ccf50){_0x2ccf50=_0x2ccf50||0xcc;return function(_0x3231f6){if(_0x3231f6){return _0x499ba8[_0x53c8('0x13')](_0x2ccf50);}return _0x499ba8['status'](_0x2ccf50)[_0x53c8('0x14')]();};}function respondWithResult(_0x31979e,_0x5a9f7f){_0x5a9f7f=_0x5a9f7f||0xc8;return function(_0x132777){if(_0x132777){return _0x31979e[_0x53c8('0x15')](_0x5a9f7f)[_0x53c8('0x16')](_0x132777);}};}function respondWithFilteredResult(_0xb13c1f,_0x30ff54){return function(_0x1c037f){if(_0x1c037f){var _0x385c39=typeof _0x30ff54[_0x53c8('0x17')]===_0x53c8('0x18')&&typeof _0x30ff54[_0x53c8('0x19')]===_0x53c8('0x18');var _0x44d6e4=_0x1c037f[_0x53c8('0x1a')];var _0x297f98=_0x385c39?0x0:_0x30ff54[_0x53c8('0x17')];var _0x4551b9=_0x385c39?_0x1c037f['count']:_0x30ff54['offset']+_0x30ff54[_0x53c8('0x19')];var _0x1a006c;if(_0x4551b9>=_0x44d6e4){_0x4551b9=_0x44d6e4;_0x1a006c=0xc8;}else{_0x1a006c=0xce;}_0xb13c1f[_0x53c8('0x15')](_0x1a006c);return _0xb13c1f[_0x53c8('0x1b')]('Content-Range',_0x297f98+'-'+_0x4551b9+'/'+_0x44d6e4)[_0x53c8('0x16')](_0x1c037f);}return null;};}function patchUpdates(_0x333990){return function(_0x40cc4c){try{jsonpatch[_0x53c8('0x1c')](_0x40cc4c,_0x333990,!![]);}catch(_0x12190e){return BPromise[_0x53c8('0x1d')](_0x12190e);}return _0x40cc4c[_0x53c8('0x1e')]();};}function saveUpdates(_0x54c1de,_0x1cf910){return function(_0x5b67d5){if(_0x5b67d5){return _0x5b67d5[_0x53c8('0x1f')](_0x54c1de)[_0x53c8('0x20')](function(_0xc329e8){return _0xc329e8;});}return null;};}function removeEntity(_0x2b024,_0x4cb9cb){return function(_0x3b2556){if(_0x3b2556){return _0x3b2556[_0x53c8('0x21')]()[_0x53c8('0x20')](function(){_0x2b024[_0x53c8('0x15')](0xcc)[_0x53c8('0x14')]();});}};}function handleEntityNotFound(_0x454bc5,_0x424211){return function(_0x11c6ca){if(!_0x11c6ca){_0x454bc5[_0x53c8('0x13')](0x194);}return _0x11c6ca;};}function handleError(_0x2821ad,_0x5e9265){_0x5e9265=_0x5e9265||0x1f4;return function(_0x1fe7e4){logger['error'](_0x1fe7e4['stack']);if(_0x1fe7e4[_0x53c8('0x22')]){delete _0x1fe7e4[_0x53c8('0x22')];}_0x2821ad[_0x53c8('0x15')](_0x5e9265)[_0x53c8('0x23')](_0x1fe7e4);};}exports[_0x53c8('0x24')]=function(_0x3f2c72,_0x320293){var _0x4031ba={},_0xf11181={},_0x6aa920={'count':0x0,'rows':[]};var _0x178992=_[_0x53c8('0x25')](db[_0x53c8('0x26')][_0x53c8('0x27')],function(_0x14e750){return{'name':_0x14e750[_0x53c8('0x28')],'type':_0x14e750[_0x53c8('0x29')][_0x53c8('0x2a')]};});_0xf11181[_0x53c8('0x2b')]=_['map'](_0x178992,_0x53c8('0x22'));_0xf11181[_0x53c8('0x2c')]=_[_0x53c8('0x2d')](_0x3f2c72['query']);_0xf11181[_0x53c8('0x2e')]=_[_0x53c8('0x2f')](_0xf11181[_0x53c8('0x2b')],_0xf11181[_0x53c8('0x2c')]);_0x4031ba['attributes']=_['intersection'](_0xf11181[_0x53c8('0x2b')],qs[_0x53c8('0x30')](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x30')]));_0x4031ba[_0x53c8('0x31')]=_0x4031ba['attributes'][_0x53c8('0x32')]?_0x4031ba['attributes']:_0xf11181[_0x53c8('0x2b')];if(!_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x33')](_0x53c8('0x34'))){_0x4031ba['limit']=qs['limit'](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x19')]);_0x4031ba[_0x53c8('0x17')]=qs[_0x53c8('0x17')](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x17')]);}_0x4031ba[_0x53c8('0x35')]=qs[_0x53c8('0x36')](_0x3f2c72['query'][_0x53c8('0x36')]);_0x4031ba[_0x53c8('0x37')]=qs['filters'](_[_0x53c8('0x38')](_0x3f2c72[_0x53c8('0x2c')],_0xf11181[_0x53c8('0x2e')]),_0x178992);if(_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x39')]){_0x4031ba[_0x53c8('0x37')]=_[_0x53c8('0x3a')](_0x4031ba['where'],{'$or':_['map'](_0x178992,function(_0x5a3691){if(_0x5a3691[_0x53c8('0x29')]!==_0x53c8('0x3b')){var _0x13f787={};_0x13f787[_0x5a3691[_0x53c8('0x22')]]={'$like':'%'+_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x39')]+'%'};return _0x13f787;}})});}_0x4031ba=_[_0x53c8('0x3a')]({},_0x4031ba,_0x3f2c72[_0x53c8('0x3c')]);var _0xf4c9b={'where':_0x4031ba[_0x53c8('0x37')]};return db[_0x53c8('0x26')][_0x53c8('0x1a')](_0xf4c9b)[_0x53c8('0x20')](function(_0x1d61e9){_0x6aa920[_0x53c8('0x1a')]=_0x1d61e9;if(_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x3d')]){_0x4031ba[_0x53c8('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x53c8('0x3f')](_0x4031ba);})[_0x53c8('0x20')](function(_0x3f47a9){_0x6aa920[_0x53c8('0x40')]=_0x3f47a9;return _0x6aa920;})[_0x53c8('0x20')](respondWithFilteredResult(_0x320293,_0x4031ba))[_0x53c8('0x41')](handleError(_0x320293,null));};exports[_0x53c8('0x42')]=function(_0x146878,_0x4d772e){var _0x3ba6dd={'raw':!![],'where':{'id':_0x146878[_0x53c8('0x43')]['id']}},_0x284d91={};_0x284d91[_0x53c8('0x2b')]=_[_0x53c8('0x2d')](db[_0x53c8('0x26')][_0x53c8('0x27')]);_0x284d91[_0x53c8('0x2c')]=_[_0x53c8('0x2d')](_0x146878[_0x53c8('0x2c')]);_0x284d91[_0x53c8('0x2e')]=_[_0x53c8('0x2f')](_0x284d91[_0x53c8('0x2b')],_0x284d91[_0x53c8('0x2c')]);_0x3ba6dd['attributes']=_[_0x53c8('0x2f')](_0x284d91[_0x53c8('0x2b')],qs['fields'](_0x146878['query'][_0x53c8('0x30')]));_0x3ba6dd['attributes']=_0x3ba6dd[_0x53c8('0x31')]['length']?_0x3ba6dd[_0x53c8('0x31')]:_0x284d91[_0x53c8('0x2b')];if(_0x146878[_0x53c8('0x2c')][_0x53c8('0x3d')]){_0x3ba6dd['include']=[{'all':!![]}];}_0x3ba6dd=_['merge']({},_0x3ba6dd,_0x146878['options']);return db[_0x53c8('0x26')][_0x53c8('0x44')](_0x3ba6dd)[_0x53c8('0x20')](handleEntityNotFound(_0x4d772e,null))[_0x53c8('0x20')](respondWithResult(_0x4d772e,null))[_0x53c8('0x41')](handleError(_0x4d772e,null));};exports['create']=function(_0x3fe863,_0x13d1e0){return db[_0x53c8('0x26')][_0x53c8('0x45')](_0x3fe863[_0x53c8('0x46')],{})['then'](respondWithResult(_0x13d1e0,0xc9))[_0x53c8('0x41')](handleError(_0x13d1e0,null));};exports[_0x53c8('0x1f')]=function(_0x487189,_0x143a5a){if(_0x487189[_0x53c8('0x46')]['id']){delete _0x487189[_0x53c8('0x46')]['id'];}return db[_0x53c8('0x26')][_0x53c8('0x44')]({'where':{'id':_0x487189['params']['id']}})['then'](handleEntityNotFound(_0x143a5a,null))['then'](saveUpdates(_0x487189['body'],null))[_0x53c8('0x20')](respondWithResult(_0x143a5a,null))[_0x53c8('0x41')](handleError(_0x143a5a,null));};exports[_0x53c8('0x21')]=function(_0x4809e,_0x52de94){return db[_0x53c8('0x26')][_0x53c8('0x44')]({'where':{'id':_0x4809e[_0x53c8('0x43')]['id']}})[_0x53c8('0x20')](handleEntityNotFound(_0x52de94,null))[_0x53c8('0x20')](removeEntity(_0x52de94,null))[_0x53c8('0x41')](handleError(_0x52de94,null));};exports[_0x53c8('0x47')]=function(_0x3167ad,_0x10dd3e){return db[_0x53c8('0x26')][_0x53c8('0x47')]()[_0x53c8('0x20')](respondWithResult(_0x10dd3e,null))['catch'](handleError(_0x10dd3e,null));};
\ No newline at end of file
+var _0x68fd=['desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','sendStatus','stack','name','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','filter','merge','VIRTUAL','options','ChatQueueReport','include','catch','keys','includeAll','create','body','update','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x68fd,0x1e9));var _0xd68f=function(_0x19e211,_0x35e384){_0x19e211=_0x19e211-0x0;var _0x25973f=_0x68fd[_0x19e211];return _0x25973f;};'use strict';var emlformat=require(_0xd68f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd68f('0x1'));var jsonpatch=require(_0xd68f('0x2'));var rp=require('request-promise');var moment=require(_0xd68f('0x3'));var BPromise=require(_0xd68f('0x4'));var Mustache=require(_0xd68f('0x5'));var util=require(_0xd68f('0x6'));var path=require(_0xd68f('0x7'));var sox=require(_0xd68f('0x8'));var csv=require(_0xd68f('0x9'));var ejs=require(_0xd68f('0xa'));var fs=require('fs');var fs_extra=require(_0xd68f('0xb'));var _=require('lodash');var squel=require(_0xd68f('0xc'));var crypto=require(_0xd68f('0xd'));var jsforce=require(_0xd68f('0xe'));var deskjs=require(_0xd68f('0xf'));var toCsv=require(_0xd68f('0x9'));var querystring=require(_0xd68f('0x10'));var Papa=require(_0xd68f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd68f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd68f('0x13'));var logger=require(_0xd68f('0x14'))(_0xd68f('0x15'));var utils=require(_0xd68f('0x16'));var config=require(_0xd68f('0x17'));var licenseUtil=require(_0xd68f('0x18'));var db=require(_0xd68f('0x19'))['db'];function respondWithStatusCode(_0x52601f,_0x518883){_0x518883=_0x518883||0xcc;return function(_0x4b0be6){if(_0x4b0be6){return _0x52601f['sendStatus'](_0x518883);}return _0x52601f[_0xd68f('0x1a')](_0x518883)[_0xd68f('0x1b')]();};}function respondWithResult(_0x48f357,_0x9dbc9b){_0x9dbc9b=_0x9dbc9b||0xc8;return function(_0x8297c){if(_0x8297c){return _0x48f357[_0xd68f('0x1a')](_0x9dbc9b)[_0xd68f('0x1c')](_0x8297c);}};}function respondWithFilteredResult(_0x3a5bb2,_0x9a7fc6){return function(_0x203b3c){if(_0x203b3c){var _0x53aed0=typeof _0x9a7fc6[_0xd68f('0x1d')]==='undefined'&&typeof _0x9a7fc6['limit']===_0xd68f('0x1e');var _0x3115f3=_0x203b3c[_0xd68f('0x1f')];var _0x3fdfbf=_0x53aed0?0x0:_0x9a7fc6[_0xd68f('0x1d')];var _0xb01ed=_0x53aed0?_0x203b3c[_0xd68f('0x1f')]:_0x9a7fc6['offset']+_0x9a7fc6['limit'];var _0x14435f;if(_0xb01ed>=_0x3115f3){_0xb01ed=_0x3115f3;_0x14435f=0xc8;}else{_0x14435f=0xce;}_0x3a5bb2[_0xd68f('0x1a')](_0x14435f);return _0x3a5bb2[_0xd68f('0x20')](_0xd68f('0x21'),_0x3fdfbf+'-'+_0xb01ed+'/'+_0x3115f3)[_0xd68f('0x1c')](_0x203b3c);}return null;};}function patchUpdates(_0x4c192f){return function(_0x17d291){try{jsonpatch[_0xd68f('0x22')](_0x17d291,_0x4c192f,!![]);}catch(_0x3fbc0b){return BPromise['reject'](_0x3fbc0b);}return _0x17d291[_0xd68f('0x23')]();};}function saveUpdates(_0x1379e2,_0xeba444){return function(_0x590e04){if(_0x590e04){return _0x590e04['update'](_0x1379e2)[_0xd68f('0x24')](function(_0x5a3683){return _0x5a3683;});}return null;};}function removeEntity(_0x563cd3,_0x3cf02f){return function(_0x1ef099){if(_0x1ef099){return _0x1ef099[_0xd68f('0x25')]()[_0xd68f('0x24')](function(){_0x563cd3[_0xd68f('0x1a')](0xcc)[_0xd68f('0x1b')]();});}};}function handleEntityNotFound(_0x169dea,_0x277605){return function(_0xaceeb8){if(!_0xaceeb8){_0x169dea[_0xd68f('0x26')](0x194);}return _0xaceeb8;};}function handleError(_0x797b09,_0xea228d){_0xea228d=_0xea228d||0x1f4;return function(_0xee7d9d){logger['error'](_0xee7d9d[_0xd68f('0x27')]);if(_0xee7d9d[_0xd68f('0x28')]){delete _0xee7d9d['name'];}_0x797b09[_0xd68f('0x1a')](_0xea228d)['send'](_0xee7d9d);};}exports['index']=function(_0xcfadd4,_0x42f8d2){var _0x1eaebc={},_0x52a2dc={},_0xfee91c={'count':0x0,'rows':[]};var _0x4d3d2f=_[_0xd68f('0x29')](db['ChatQueueReport'][_0xd68f('0x2a')],function(_0x2dd737){return{'name':_0x2dd737[_0xd68f('0x2b')],'type':_0x2dd737[_0xd68f('0x2c')][_0xd68f('0x2d')]};});_0x52a2dc['model']=_[_0xd68f('0x29')](_0x4d3d2f,'name');_0x52a2dc[_0xd68f('0x2e')]=_['keys'](_0xcfadd4[_0xd68f('0x2e')]);_0x52a2dc[_0xd68f('0x2f')]=_[_0xd68f('0x30')](_0x52a2dc[_0xd68f('0x31')],_0x52a2dc['query']);_0x1eaebc[_0xd68f('0x32')]=_[_0xd68f('0x30')](_0x52a2dc[_0xd68f('0x31')],qs[_0xd68f('0x33')](_0xcfadd4['query'][_0xd68f('0x33')]));_0x1eaebc[_0xd68f('0x32')]=_0x1eaebc[_0xd68f('0x32')][_0xd68f('0x34')]?_0x1eaebc[_0xd68f('0x32')]:_0x52a2dc[_0xd68f('0x31')];if(!_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x35')]('nolimit')){_0x1eaebc[_0xd68f('0x36')]=qs[_0xd68f('0x36')](_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x36')]);_0x1eaebc[_0xd68f('0x1d')]=qs[_0xd68f('0x1d')](_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x1d')]);}_0x1eaebc['order']=qs[_0xd68f('0x37')](_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x37')]);_0x1eaebc[_0xd68f('0x38')]=qs[_0xd68f('0x2f')](_['pick'](_0xcfadd4[_0xd68f('0x2e')],_0x52a2dc[_0xd68f('0x2f')]),_0x4d3d2f);if(_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x39')]){_0x1eaebc[_0xd68f('0x38')]=_[_0xd68f('0x3a')](_0x1eaebc[_0xd68f('0x38')],{'$or':_[_0xd68f('0x29')](_0x4d3d2f,function(_0x582b38){if(_0x582b38[_0xd68f('0x2c')]!==_0xd68f('0x3b')){var _0x46c1be={};_0x46c1be[_0x582b38[_0xd68f('0x28')]]={'$like':'%'+_0xcfadd4[_0xd68f('0x2e')][_0xd68f('0x39')]+'%'};return _0x46c1be;}})});}_0x1eaebc=_['merge']({},_0x1eaebc,_0xcfadd4[_0xd68f('0x3c')]);var _0xb89fd3={'where':_0x1eaebc[_0xd68f('0x38')]};return db[_0xd68f('0x3d')][_0xd68f('0x1f')](_0xb89fd3)[_0xd68f('0x24')](function(_0x54cd1e){_0xfee91c[_0xd68f('0x1f')]=_0x54cd1e;if(_0xcfadd4[_0xd68f('0x2e')]['includeAll']){_0x1eaebc[_0xd68f('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x1eaebc);})[_0xd68f('0x24')](function(_0x2016f1){_0xfee91c['rows']=_0x2016f1;return _0xfee91c;})[_0xd68f('0x24')](respondWithFilteredResult(_0x42f8d2,_0x1eaebc))[_0xd68f('0x3f')](handleError(_0x42f8d2,null));};exports['show']=function(_0x66b7a0,_0x2e1a2e){var _0x3d2dac={'raw':!![],'where':{'id':_0x66b7a0['params']['id']}},_0x645928={};_0x645928['model']=_['keys'](db[_0xd68f('0x3d')][_0xd68f('0x2a')]);_0x645928[_0xd68f('0x2e')]=_[_0xd68f('0x40')](_0x66b7a0[_0xd68f('0x2e')]);_0x645928[_0xd68f('0x2f')]=_[_0xd68f('0x30')](_0x645928[_0xd68f('0x31')],_0x645928[_0xd68f('0x2e')]);_0x3d2dac[_0xd68f('0x32')]=_[_0xd68f('0x30')](_0x645928['model'],qs['fields'](_0x66b7a0[_0xd68f('0x2e')][_0xd68f('0x33')]));_0x3d2dac[_0xd68f('0x32')]=_0x3d2dac[_0xd68f('0x32')][_0xd68f('0x34')]?_0x3d2dac[_0xd68f('0x32')]:_0x645928['model'];if(_0x66b7a0[_0xd68f('0x2e')][_0xd68f('0x41')]){_0x3d2dac[_0xd68f('0x3e')]=[{'all':!![]}];}_0x3d2dac=_[_0xd68f('0x3a')]({},_0x3d2dac,_0x66b7a0[_0xd68f('0x3c')]);return db[_0xd68f('0x3d')]['find'](_0x3d2dac)[_0xd68f('0x24')](handleEntityNotFound(_0x2e1a2e,null))[_0xd68f('0x24')](respondWithResult(_0x2e1a2e,null))[_0xd68f('0x3f')](handleError(_0x2e1a2e,null));};exports[_0xd68f('0x42')]=function(_0x6e90a1,_0x314c18){return db[_0xd68f('0x3d')][_0xd68f('0x42')](_0x6e90a1[_0xd68f('0x43')],{})['then'](respondWithResult(_0x314c18,0xc9))[_0xd68f('0x3f')](handleError(_0x314c18,null));};exports[_0xd68f('0x44')]=function(_0xd98ba2,_0x5bfd21){if(_0xd98ba2[_0xd68f('0x43')]['id']){delete _0xd98ba2[_0xd68f('0x43')]['id'];}return db[_0xd68f('0x3d')][_0xd68f('0x45')]({'where':{'id':_0xd98ba2[_0xd68f('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bfd21,null))['then'](saveUpdates(_0xd98ba2['body'],null))[_0xd68f('0x24')](respondWithResult(_0x5bfd21,null))[_0xd68f('0x3f')](handleError(_0x5bfd21,null));};exports['destroy']=function(_0x1f4bc6,_0x41bde1){return db[_0xd68f('0x3d')][_0xd68f('0x45')]({'where':{'id':_0x1f4bc6[_0xd68f('0x46')]['id']}})[_0xd68f('0x24')](handleEntityNotFound(_0x41bde1,null))[_0xd68f('0x24')](removeEntity(_0x41bde1,null))[_0xd68f('0x3f')](handleError(_0x41bde1,null));};exports[_0xd68f('0x47')]=function(_0x51b954,_0x28fb40){return db[_0xd68f('0x3d')][_0xd68f('0x47')]()[_0xd68f('0x24')](respondWithResult(_0x28fb40,null))[_0xd68f('0x3f')](handleError(_0x28fb40,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index abbb32d..1735566 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2b70f8,_0x361789){var _0x2f741e=function(_0x50d901){while(--_0x50d901){_0x2b70f8['push'](_0x2b70f8['shift']());}};_0x2f741e(++_0x361789);}(_0xb10b,0x12a));var _0xbb10=function(_0x4aa662,_0x1cc90c){_0x4aa662=_0x4aa662-0x0;var _0x336478=_0xb10b[_0x4aa662];return _0x336478;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3fb214,_0x428d93){var _0x38d89c=function(_0x468ce9){while(--_0x468ce9){_0x3fb214['push'](_0x3fb214['shift']());}};_0x38d89c(++_0x428d93);}(_0xe706,0xa3));var _0x6e70=function(_0x197b38,_0x394a4d){_0x197b38=_0x197b38-0x0;var _0x20a23a=_0xe706[_0x197b38];return _0x20a23a;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 0b5e291..2a0e127 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 _0x9ac6=['options','raw','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','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','create','body'];(function(_0x4b038c,_0x57f2b4){var _0x1b9fe8=function(_0x30c9e0){while(--_0x30c9e0){_0x4b038c['push'](_0x4b038c['shift']());}};_0x1b9fe8(++_0x57f2b4);}(_0x9ac6,0x120));var _0x69ac=function(_0x49e130,_0x75a7e7){_0x49e130=_0x49e130-0x0;var _0x5e86eb=_0x9ac6[_0x49e130];return _0x5e86eb;};'use strict';var _=require(_0x69ac('0x0'));var util=require(_0x69ac('0x1'));var moment=require(_0x69ac('0x2'));var BPromise=require(_0x69ac('0x3'));var rs=require(_0x69ac('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x69ac('0x6'))(_0x69ac('0x7'));var config=require(_0x69ac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x69ac('0x9')][_0x69ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db475,_0x29a38f,_0x4f5878){return new BPromise(function(_0x41ee01,_0x32391e){return client[_0x69ac('0xb')](_0x2db475,_0x4f5878)[_0x69ac('0xc')](function(_0x3505f2){logger[_0x69ac('0xd')](_0x69ac('0xe'),_0x29a38f,_0x69ac('0xf'));logger[_0x69ac('0x10')](_0x69ac('0x11'),_0x29a38f,'request\x20sent',JSON[_0x69ac('0x12')](_0x3505f2));if(_0x3505f2[_0x69ac('0x13')]){if(_0x3505f2[_0x69ac('0x13')][_0x69ac('0x14')]===0x1f4){logger[_0x69ac('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x29a38f,_0x3505f2[_0x69ac('0x13')][_0x69ac('0x15')]);return _0x32391e(_0x3505f2['error'][_0x69ac('0x15')]);}logger[_0x69ac('0x13')](_0x69ac('0xe'),_0x29a38f,_0x3505f2[_0x69ac('0x13')][_0x69ac('0x15')]);return _0x41ee01(_0x3505f2[_0x69ac('0x13')]['message']);}else{logger[_0x69ac('0xd')](_0x69ac('0xe'),_0x29a38f,_0x69ac('0xf'));_0x41ee01(_0x3505f2[_0x69ac('0x16')][_0x69ac('0x15')]);}})[_0x69ac('0x17')](function(_0x4d741d){logger[_0x69ac('0x13')](_0x69ac('0xe'),_0x29a38f,_0x4d741d);_0x32391e(_0x4d741d);});});}exports[_0x69ac('0x18')]=function(_0x4963ba){var _0x57df9a=this;return new Promise(function(_0x4a1950,_0x5e12cd){return db['ChatQueueReport'][_0x69ac('0x19')](_0x4963ba[_0x69ac('0x1a')],{'raw':_0x4963ba[_0x69ac('0x1b')]?_0x4963ba[_0x69ac('0x1b')][_0x69ac('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x802c5e){logger[_0x69ac('0xd')](_0x69ac('0x18'),_0x4963ba);logger[_0x69ac('0x10')]('CreateChatQueueReport',_0x4963ba,JSON[_0x69ac('0x12')](_0x802c5e));_0x4a1950(_0x802c5e);})['catch'](function(_0x48d98c){logger['error']('CreateChatQueueReport',_0x48d98c['message'],_0x4963ba);_0x5e12cd(_0x57df9a[_0x69ac('0x13')](0x1f4,_0x48d98c['message']));});});};exports[_0x69ac('0x1d')]=function(_0x5c53c2){var _0x4d4c17=this;return new Promise(function(_0x1c7c7d,_0x28782e){return db[_0x69ac('0x1e')][_0x69ac('0x1f')](_0x5c53c2[_0x69ac('0x1a')],{'raw':_0x5c53c2['options']?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c53c2['options']?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x20')]||null:null,'attributes':_0x5c53c2[_0x69ac('0x1b')]?_0x5c53c2['options'][_0x69ac('0x21')]||null:null,'limit':_0x5c53c2[_0x69ac('0x1b')]?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x22')]||null:null})['then'](function(_0xdc4b40){logger[_0x69ac('0xd')](_0x69ac('0x1d'),_0x5c53c2);logger[_0x69ac('0x10')](_0x69ac('0x1d'),_0x5c53c2,JSON[_0x69ac('0x12')](_0xdc4b40));_0x1c7c7d(_0xdc4b40);})[_0x69ac('0x17')](function(_0x4bd1bf){logger[_0x69ac('0x13')]('UpdateChatQueueReport',_0x4bd1bf['message'],_0x5c53c2);_0x28782e(_0x4d4c17[_0x69ac('0x13')](0x1f4,_0x4bd1bf[_0x69ac('0x15')]));});});};
\ No newline at end of file
+var _0xf05c=['../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options','UpdateChatQueueReport','ChatQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xf05c,0x122));var _0xcf05=function(_0xf2eacb,_0x3b0fb0){_0xf2eacb=_0xf2eacb-0x0;var _0x25a3b4=_0xf05c[_0xf2eacb];return _0x25a3b4;};'use strict';var _=require(_0xcf05('0x0'));var util=require(_0xcf05('0x1'));var moment=require(_0xcf05('0x2'));var BPromise=require(_0xcf05('0x3'));var rs=require(_0xcf05('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf05('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcf05('0x6'));var config=require(_0xcf05('0x7'));var jayson=require(_0xcf05('0x8'));var client=jayson['client'][_0xcf05('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d8a3,_0x4ad9c9,_0x447fe4){return new BPromise(function(_0x153488,_0x41a790){return client['request'](_0x55d8a3,_0x447fe4)[_0xcf05('0xa')](function(_0x15c761){logger[_0xcf05('0xb')](_0xcf05('0xc'),_0x4ad9c9,'request\x20sent');logger[_0xcf05('0xd')](_0xcf05('0xe'),_0x4ad9c9,_0xcf05('0xf'),JSON[_0xcf05('0x10')](_0x15c761));if(_0x15c761[_0xcf05('0x11')]){if(_0x15c761[_0xcf05('0x11')][_0xcf05('0x12')]===0x1f4){logger[_0xcf05('0x11')](_0xcf05('0xc'),_0x4ad9c9,_0x15c761[_0xcf05('0x11')]['message']);return _0x41a790(_0x15c761[_0xcf05('0x11')][_0xcf05('0x13')]);}logger[_0xcf05('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x4ad9c9,_0x15c761[_0xcf05('0x11')][_0xcf05('0x13')]);return _0x153488(_0x15c761[_0xcf05('0x11')][_0xcf05('0x13')]);}else{logger[_0xcf05('0xb')](_0xcf05('0xc'),_0x4ad9c9,'request\x20sent');_0x153488(_0x15c761[_0xcf05('0x14')][_0xcf05('0x13')]);}})[_0xcf05('0x15')](function(_0xb58473){logger[_0xcf05('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x4ad9c9,_0xb58473);_0x41a790(_0xb58473);});});}exports[_0xcf05('0x16')]=function(_0x15484d){var _0xb33c17=this;return new Promise(function(_0x31cfd1,_0x553114){return db['ChatQueueReport'][_0xcf05('0x17')](_0x15484d[_0xcf05('0x18')],{'raw':_0x15484d['options']?_0x15484d[_0xcf05('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xcf05('0xa')](function(_0x5d8147){logger[_0xcf05('0xb')](_0xcf05('0x16'),_0x15484d);logger['debug'](_0xcf05('0x16'),_0x15484d,JSON[_0xcf05('0x10')](_0x5d8147));_0x31cfd1(_0x5d8147);})[_0xcf05('0x15')](function(_0x4dd1da){logger[_0xcf05('0x11')](_0xcf05('0x16'),_0x4dd1da[_0xcf05('0x13')],_0x15484d);_0x553114(_0xb33c17[_0xcf05('0x11')](0x1f4,_0x4dd1da['message']));});});};exports[_0xcf05('0x1a')]=function(_0x362a50){var _0x1d0749=this;return new Promise(function(_0x1299b8,_0x52b694){return db[_0xcf05('0x1b')][_0xcf05('0x1c')](_0x362a50[_0xcf05('0x18')],{'raw':_0x362a50[_0xcf05('0x19')]?_0x362a50[_0xcf05('0x19')][_0xcf05('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x362a50[_0xcf05('0x19')]?_0x362a50[_0xcf05('0x19')][_0xcf05('0x1e')]||null:null,'attributes':_0x362a50['options']?_0x362a50['options'][_0xcf05('0x1f')]||null:null,'limit':_0x362a50[_0xcf05('0x19')]?_0x362a50[_0xcf05('0x19')][_0xcf05('0x20')]||null:null})[_0xcf05('0xa')](function(_0x290591){logger[_0xcf05('0xb')](_0xcf05('0x1a'),_0x362a50);logger[_0xcf05('0xd')]('UpdateChatQueueReport',_0x362a50,JSON['stringify'](_0x290591));_0x1299b8(_0x290591);})['catch'](function(_0x42460f){logger[_0xcf05('0x11')](_0xcf05('0x1a'),_0x42460f[_0xcf05('0x13')],_0x362a50);_0x52b694(_0x1d0749[_0xcf05('0x11')](0x1f4,_0x42460f['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 22ecb2a..d844141 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 _0x0826=['post','create','put','update','delete','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0826,0xcd));var _0x6082=function(_0x382410,_0x3f67c9){_0x382410=_0x382410-0x0;var _0x1a603d=_0x0826[_0x382410];return _0x1a603d;};'use strict';var multer=require(_0x6082('0x0'));var util=require(_0x6082('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6082('0x2'));var router=express[_0x6082('0x3')]();var fs_extra=require(_0x6082('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6082('0x5'));var config=require(_0x6082('0x6'));var controller=require(_0x6082('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6082('0x8')]);router[_0x6082('0x9')](_0x6082('0xa'),auth[_0x6082('0xb')](),controller[_0x6082('0xc')]);router[_0x6082('0x9')](_0x6082('0xd'),auth['isAuthenticated'](),controller[_0x6082('0xe')]);router[_0x6082('0xf')]('/',auth['isAuthenticated'](),controller[_0x6082('0x10')]);router[_0x6082('0x11')](_0x6082('0xd'),auth[_0x6082('0xb')](),controller[_0x6082('0x12')]);router[_0x6082('0x13')](_0x6082('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe2e5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','describe','get','/:id','show','post','create','update','delete','destroy','exports','path','express'];(function(_0x1744e1,_0x1d5cd9){var _0x5166a0=function(_0x5f28dd){while(--_0x5f28dd){_0x1744e1['push'](_0x1744e1['shift']());}};_0x5166a0(++_0x1d5cd9);}(_0xe2e5,0x1ae));var _0x5e2e=function(_0x343a85,_0x22aa4f){_0x343a85=_0x343a85-0x0;var _0x53cb93=_0xe2e5[_0x343a85];return _0x53cb93;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e2e('0x0'));var timeout=require('connect-timeout');var express=require(_0x5e2e('0x1'));var router=express[_0x5e2e('0x2')]();var fs_extra=require(_0x5e2e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5e2e('0x4'));var config=require(_0x5e2e('0x5'));var controller=require(_0x5e2e('0x6'));router['get']('/',auth[_0x5e2e('0x7')](),controller['index']);router['get']('/describe',auth[_0x5e2e('0x7')](),controller[_0x5e2e('0x8')]);router[_0x5e2e('0x9')](_0x5e2e('0xa'),auth[_0x5e2e('0x7')](),controller[_0x5e2e('0xb')]);router[_0x5e2e('0xc')]('/',auth['isAuthenticated'](),controller[_0x5e2e('0xd')]);router['put'](_0x5e2e('0xa'),auth[_0x5e2e('0x7')](),controller[_0x5e2e('0xe')]);router[_0x5e2e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5e2e('0x10')]);module[_0x5e2e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index cd11f5c..e4bd355 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3feeec,_0x1bc0c8){var _0x2fcc54=function(_0x88a3f){while(--_0x88a3f){_0x3feeec['push'](_0x3feeec['shift']());}};_0x2fcc54(++_0x1bc0c8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0xb43b,0x1b2));var _0xbb43=function(_0xedfdf8,_0x222ee6){_0xedfdf8=_0xedfdf8-0x0;var _0x3e8d4c=_0xb43b[_0xedfdf8];return _0x3e8d4c;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 84d9d0f..b4e8aa9 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 _0xae2e=['to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox'];(function(_0x30b85d,_0x3dbb26){var _0x38b87f=function(_0x5e4fef){while(--_0x5e4fef){_0x30b85d['push'](_0x30b85d['shift']());}};_0x38b87f(++_0x3dbb26);}(_0xae2e,0x17e));var _0xeae2=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xae2e[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xeae2('0x0'));var rimraf=require(_0xeae2('0x1'));var zipdir=require(_0xeae2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeae2('0x3'));var BPromise=require(_0xeae2('0x4'));var Mustache=require('mustache');var util=require(_0xeae2('0x5'));var path=require(_0xeae2('0x6'));var sox=require(_0xeae2('0x7'));var csv=require(_0xeae2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeae2('0x9'));var _=require(_0xeae2('0xa'));var squel=require(_0xeae2('0xb'));var crypto=require('crypto');var jsforce=require(_0xeae2('0xc'));var deskjs=require(_0xeae2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeae2('0xe'));var Papa=require('papaparse');var Redis=require(_0xeae2('0xf'));var authService=require(_0xeae2('0x10'));var qs=require(_0xeae2('0x11'));var as=require(_0xeae2('0x12'));var hardwareService=require(_0xeae2('0x13'));var logger=require(_0xeae2('0x14'))(_0xeae2('0x15'));var utils=require(_0xeae2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeae2('0x17'));var db=require(_0xeae2('0x18'))['db'];function respondWithStatusCode(_0xd4e7e8,_0x1491fc){_0x1491fc=_0x1491fc||0xcc;return function(_0x2e7a6b){if(_0x2e7a6b){return _0xd4e7e8[_0xeae2('0x19')](_0x1491fc);}return _0xd4e7e8[_0xeae2('0x1a')](_0x1491fc)[_0xeae2('0x1b')]();};}function respondWithResult(_0x4e1236,_0x58553c){_0x58553c=_0x58553c||0xc8;return function(_0x1caa39){if(_0x1caa39){return _0x4e1236[_0xeae2('0x1a')](_0x58553c)[_0xeae2('0x1c')](_0x1caa39);}};}function respondWithFilteredResult(_0x4f5b14,_0x590f8b){return function(_0x4871f4){if(_0x4871f4){var _0x16a6cb=typeof _0x590f8b[_0xeae2('0x1d')]===_0xeae2('0x1e')&&typeof _0x590f8b['limit']==='undefined';var _0x5a8a57=_0x4871f4[_0xeae2('0x1f')];var _0x5ebb74=_0x16a6cb?0x0:_0x590f8b[_0xeae2('0x1d')];var _0x1774d9=_0x16a6cb?_0x4871f4[_0xeae2('0x1f')]:_0x590f8b['offset']+_0x590f8b['limit'];var _0x2084f2;if(_0x1774d9>=_0x5a8a57){_0x1774d9=_0x5a8a57;_0x2084f2=0xc8;}else{_0x2084f2=0xce;}_0x4f5b14['status'](_0x2084f2);return _0x4f5b14[_0xeae2('0x20')](_0xeae2('0x21'),_0x5ebb74+'-'+_0x1774d9+'/'+_0x5a8a57)['json'](_0x4871f4);}return null;};}function patchUpdates(_0x2b838f){return function(_0x2e8019){try{jsonpatch[_0xeae2('0x22')](_0x2e8019,_0x2b838f,!![]);}catch(_0x1115e6){return BPromise[_0xeae2('0x23')](_0x1115e6);}return _0x2e8019[_0xeae2('0x24')]();};}function saveUpdates(_0x52f73e,_0x4263e8){return function(_0x12b828){if(_0x12b828){return _0x12b828[_0xeae2('0x25')](_0x52f73e)[_0xeae2('0x26')](function(_0x5e5eca){return _0x5e5eca;});}return null;};}function removeEntity(_0x516dc3,_0x4f083e){return function(_0x46f7fd){if(_0x46f7fd){return _0x46f7fd['destroy']()[_0xeae2('0x26')](function(){_0x516dc3[_0xeae2('0x1a')](0xcc)[_0xeae2('0x1b')]();});}};}function handleEntityNotFound(_0x1476bb,_0x290abd){return function(_0x7ff416){if(!_0x7ff416){_0x1476bb[_0xeae2('0x19')](0x194);}return _0x7ff416;};}function handleError(_0x2b6800,_0x432f8b){_0x432f8b=_0x432f8b||0x1f4;return function(_0x5060c3){logger[_0xeae2('0x27')](_0x5060c3[_0xeae2('0x28')]);if(_0x5060c3['name']){delete _0x5060c3[_0xeae2('0x29')];}_0x2b6800[_0xeae2('0x1a')](_0x432f8b)[_0xeae2('0x2a')](_0x5060c3);};}exports[_0xeae2('0x2b')]=function(_0x272966,_0x1f98e4){var _0x556271={},_0x14ea44={},_0x3f2036={'count':0x0,'rows':[]};var _0x4e99de=_[_0xeae2('0x2c')](db[_0xeae2('0x2d')][_0xeae2('0x2e')],function(_0x2d8941){return{'name':_0x2d8941[_0xeae2('0x2f')],'type':_0x2d8941[_0xeae2('0x30')]['key']};});_0x14ea44['model']=_[_0xeae2('0x2c')](_0x4e99de,_0xeae2('0x29'));_0x14ea44['query']=_[_0xeae2('0x31')](_0x272966[_0xeae2('0x32')]);_0x14ea44[_0xeae2('0x33')]=_[_0xeae2('0x34')](_0x14ea44[_0xeae2('0x35')],_0x14ea44[_0xeae2('0x32')]);_0x556271[_0xeae2('0x36')]=_[_0xeae2('0x34')](_0x14ea44[_0xeae2('0x35')],qs[_0xeae2('0x37')](_0x272966[_0xeae2('0x32')][_0xeae2('0x37')]));_0x556271['attributes']=_0x556271[_0xeae2('0x36')][_0xeae2('0x38')]?_0x556271[_0xeae2('0x36')]:_0x14ea44[_0xeae2('0x35')];if(!_0x272966['query'][_0xeae2('0x39')](_0xeae2('0x3a'))){_0x556271[_0xeae2('0x3b')]=qs[_0xeae2('0x3b')](_0x272966[_0xeae2('0x32')][_0xeae2('0x3b')]);_0x556271[_0xeae2('0x1d')]=qs[_0xeae2('0x1d')](_0x272966[_0xeae2('0x32')]['offset']);}_0x556271[_0xeae2('0x3c')]=qs['sort'](_0x272966[_0xeae2('0x32')][_0xeae2('0x3d')]);_0x556271[_0xeae2('0x3e')]=qs[_0xeae2('0x33')](_[_0xeae2('0x3f')](_0x272966['query'],_0x14ea44['filters']),_0x4e99de);if(_0x272966[_0xeae2('0x32')][_0xeae2('0x40')]){_0x556271[_0xeae2('0x3e')]=_[_0xeae2('0x41')](_0x556271[_0xeae2('0x3e')],{'$or':_['map'](_0x4e99de,function(_0x5a5218){if(_0x5a5218[_0xeae2('0x30')]!==_0xeae2('0x42')){var _0xa330bf={};_0xa330bf[_0x5a5218[_0xeae2('0x29')]]={'$like':'%'+_0x272966[_0xeae2('0x32')][_0xeae2('0x40')]+'%'};return _0xa330bf;}})});}_0x556271=_[_0xeae2('0x41')]({},_0x556271,_0x272966['options']);var _0x14bb5d={'where':_0x556271[_0xeae2('0x3e')]};return db[_0xeae2('0x2d')]['count'](_0x14bb5d)[_0xeae2('0x26')](function(_0x4e0da6){_0x3f2036['count']=_0x4e0da6;if(_0x272966[_0xeae2('0x32')][_0xeae2('0x43')]){_0x556271['include']=[{'all':!![]}];}return db[_0xeae2('0x2d')][_0xeae2('0x44')](_0x556271);})[_0xeae2('0x26')](function(_0x2b8bff){_0x3f2036['rows']=_0x2b8bff;return _0x3f2036;})['then'](respondWithFilteredResult(_0x1f98e4,_0x556271))[_0xeae2('0x45')](handleError(_0x1f98e4,null));};exports[_0xeae2('0x46')]=function(_0x4d795b,_0x4fa9ad){var _0x389f6c={'raw':!![],'where':{'id':_0x4d795b[_0xeae2('0x47')]['id']}},_0xc52ef={};_0xc52ef[_0xeae2('0x35')]=_[_0xeae2('0x31')](db['ChatTransferReport']['rawAttributes']);_0xc52ef[_0xeae2('0x32')]=_['keys'](_0x4d795b[_0xeae2('0x32')]);_0xc52ef['filters']=_['intersection'](_0xc52ef[_0xeae2('0x35')],_0xc52ef[_0xeae2('0x32')]);_0x389f6c[_0xeae2('0x36')]=_['intersection'](_0xc52ef['model'],qs[_0xeae2('0x37')](_0x4d795b[_0xeae2('0x32')][_0xeae2('0x37')]));_0x389f6c[_0xeae2('0x36')]=_0x389f6c[_0xeae2('0x36')][_0xeae2('0x38')]?_0x389f6c[_0xeae2('0x36')]:_0xc52ef['model'];if(_0x4d795b[_0xeae2('0x32')][_0xeae2('0x43')]){_0x389f6c[_0xeae2('0x48')]=[{'all':!![]}];}_0x389f6c=_[_0xeae2('0x41')]({},_0x389f6c,_0x4d795b[_0xeae2('0x49')]);return db[_0xeae2('0x2d')][_0xeae2('0x4a')](_0x389f6c)['then'](handleEntityNotFound(_0x4fa9ad,null))[_0xeae2('0x26')](respondWithResult(_0x4fa9ad,null))[_0xeae2('0x45')](handleError(_0x4fa9ad,null));};exports['create']=function(_0xbad9f8,_0x81bee0){return db[_0xeae2('0x2d')][_0xeae2('0x4b')](_0xbad9f8[_0xeae2('0x4c')],{})[_0xeae2('0x26')](respondWithResult(_0x81bee0,0xc9))[_0xeae2('0x45')](handleError(_0x81bee0,null));};exports[_0xeae2('0x25')]=function(_0x1fb98c,_0x1b321b){if(_0x1fb98c[_0xeae2('0x4c')]['id']){delete _0x1fb98c[_0xeae2('0x4c')]['id'];}return db[_0xeae2('0x2d')]['find']({'where':{'id':_0x1fb98c[_0xeae2('0x47')]['id']}})[_0xeae2('0x26')](handleEntityNotFound(_0x1b321b,null))[_0xeae2('0x26')](saveUpdates(_0x1fb98c[_0xeae2('0x4c')],null))['then'](respondWithResult(_0x1b321b,null))[_0xeae2('0x45')](handleError(_0x1b321b,null));};exports['destroy']=function(_0x4b1bdf,_0x203eae){return db[_0xeae2('0x2d')][_0xeae2('0x4a')]({'where':{'id':_0x4b1bdf[_0xeae2('0x47')]['id']}})['then'](handleEntityNotFound(_0x203eae,null))[_0xeae2('0x26')](removeEntity(_0x203eae,null))[_0xeae2('0x45')](handleError(_0x203eae,null));};exports[_0xeae2('0x4d')]=function(_0x2c9f3d,_0x5387e1){return db[_0xeae2('0x2d')][_0xeae2('0x4d')]()[_0xeae2('0x26')](respondWithResult(_0x5387e1,null))[_0xeae2('0x45')](handleError(_0x5387e1,null));};
\ No newline at end of file
+var _0x1134=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1134,0x124));var _0x4113=function(_0x114abd,_0x2b4a83){_0x114abd=_0x114abd-0x0;var _0x5d6904=_0x1134[_0x114abd];return _0x5d6904;};'use strict';var emlformat=require(_0x4113('0x0'));var rimraf=require(_0x4113('0x1'));var zipdir=require(_0x4113('0x2'));var jsonpatch=require(_0x4113('0x3'));var rp=require(_0x4113('0x4'));var moment=require(_0x4113('0x5'));var BPromise=require(_0x4113('0x6'));var Mustache=require(_0x4113('0x7'));var util=require(_0x4113('0x8'));var path=require(_0x4113('0x9'));var sox=require('sox');var csv=require(_0x4113('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4113('0xb'));var squel=require('squel');var crypto=require(_0x4113('0xc'));var jsforce=require(_0x4113('0xd'));var deskjs=require(_0x4113('0xe'));var toCsv=require(_0x4113('0xa'));var querystring=require(_0x4113('0xf'));var Papa=require('papaparse');var Redis=require(_0x4113('0x10'));var authService=require(_0x4113('0x11'));var qs=require(_0x4113('0x12'));var as=require(_0x4113('0x13'));var hardwareService=require(_0x4113('0x14'));var logger=require(_0x4113('0x15'))(_0x4113('0x16'));var utils=require(_0x4113('0x17'));var config=require(_0x4113('0x18'));var licenseUtil=require(_0x4113('0x19'));var db=require(_0x4113('0x1a'))['db'];function respondWithStatusCode(_0x13fadf,_0x6e161e){_0x6e161e=_0x6e161e||0xcc;return function(_0x744ce7){if(_0x744ce7){return _0x13fadf[_0x4113('0x1b')](_0x6e161e);}return _0x13fadf[_0x4113('0x1c')](_0x6e161e)[_0x4113('0x1d')]();};}function respondWithResult(_0x42ea8d,_0x2cdfd4){_0x2cdfd4=_0x2cdfd4||0xc8;return function(_0x183748){if(_0x183748){return _0x42ea8d[_0x4113('0x1c')](_0x2cdfd4)[_0x4113('0x1e')](_0x183748);}};}function respondWithFilteredResult(_0x3ff39e,_0x424261){return function(_0x1ac352){if(_0x1ac352){var _0x387358=typeof _0x424261[_0x4113('0x1f')]===_0x4113('0x20')&&typeof _0x424261[_0x4113('0x21')]===_0x4113('0x20');var _0xebc932=_0x1ac352['count'];var _0x2966cb=_0x387358?0x0:_0x424261[_0x4113('0x1f')];var _0x146353=_0x387358?_0x1ac352[_0x4113('0x22')]:_0x424261[_0x4113('0x1f')]+_0x424261[_0x4113('0x21')];var _0x172ca6;if(_0x146353>=_0xebc932){_0x146353=_0xebc932;_0x172ca6=0xc8;}else{_0x172ca6=0xce;}_0x3ff39e[_0x4113('0x1c')](_0x172ca6);return _0x3ff39e[_0x4113('0x23')](_0x4113('0x24'),_0x2966cb+'-'+_0x146353+'/'+_0xebc932)[_0x4113('0x1e')](_0x1ac352);}return null;};}function patchUpdates(_0x3cda82){return function(_0x10df93){try{jsonpatch[_0x4113('0x25')](_0x10df93,_0x3cda82,!![]);}catch(_0x53c997){return BPromise[_0x4113('0x26')](_0x53c997);}return _0x10df93[_0x4113('0x27')]();};}function saveUpdates(_0x45a489,_0x33b103){return function(_0x894819){if(_0x894819){return _0x894819['update'](_0x45a489)['then'](function(_0x16d68b){return _0x16d68b;});}return null;};}function removeEntity(_0x5f5793,_0x58c033){return function(_0x5e22ce){if(_0x5e22ce){return _0x5e22ce[_0x4113('0x28')]()[_0x4113('0x29')](function(){_0x5f5793[_0x4113('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31d66a,_0x454380){return function(_0x4d4d4d){if(!_0x4d4d4d){_0x31d66a[_0x4113('0x1b')](0x194);}return _0x4d4d4d;};}function handleError(_0x3c9e0a,_0x3c5fcf){_0x3c5fcf=_0x3c5fcf||0x1f4;return function(_0x1f59d5){logger[_0x4113('0x2a')](_0x1f59d5[_0x4113('0x2b')]);if(_0x1f59d5[_0x4113('0x2c')]){delete _0x1f59d5['name'];}_0x3c9e0a[_0x4113('0x1c')](_0x3c5fcf)[_0x4113('0x2d')](_0x1f59d5);};}exports[_0x4113('0x2e')]=function(_0x5e3317,_0x27e10b){var _0x50e8b1={},_0x3e8e7c={},_0x21da53={'count':0x0,'rows':[]};var _0x96bf8e=_[_0x4113('0x2f')](db[_0x4113('0x30')][_0x4113('0x31')],function(_0x55d335){return{'name':_0x55d335[_0x4113('0x32')],'type':_0x55d335[_0x4113('0x33')][_0x4113('0x34')]};});_0x3e8e7c['model']=_[_0x4113('0x2f')](_0x96bf8e,_0x4113('0x2c'));_0x3e8e7c[_0x4113('0x35')]=_[_0x4113('0x36')](_0x5e3317['query']);_0x3e8e7c[_0x4113('0x37')]=_['intersection'](_0x3e8e7c[_0x4113('0x38')],_0x3e8e7c[_0x4113('0x35')]);_0x50e8b1[_0x4113('0x39')]=_[_0x4113('0x3a')](_0x3e8e7c[_0x4113('0x38')],qs[_0x4113('0x3b')](_0x5e3317[_0x4113('0x35')][_0x4113('0x3b')]));_0x50e8b1[_0x4113('0x39')]=_0x50e8b1[_0x4113('0x39')][_0x4113('0x3c')]?_0x50e8b1[_0x4113('0x39')]:_0x3e8e7c[_0x4113('0x38')];if(!_0x5e3317[_0x4113('0x35')]['hasOwnProperty']('nolimit')){_0x50e8b1['limit']=qs[_0x4113('0x21')](_0x5e3317['query'][_0x4113('0x21')]);_0x50e8b1[_0x4113('0x1f')]=qs['offset'](_0x5e3317[_0x4113('0x35')][_0x4113('0x1f')]);}_0x50e8b1['order']=qs[_0x4113('0x3d')](_0x5e3317[_0x4113('0x35')][_0x4113('0x3d')]);_0x50e8b1[_0x4113('0x3e')]=qs[_0x4113('0x37')](_[_0x4113('0x3f')](_0x5e3317[_0x4113('0x35')],_0x3e8e7c['filters']),_0x96bf8e);if(_0x5e3317[_0x4113('0x35')][_0x4113('0x40')]){_0x50e8b1[_0x4113('0x3e')]=_[_0x4113('0x41')](_0x50e8b1[_0x4113('0x3e')],{'$or':_['map'](_0x96bf8e,function(_0x101501){if(_0x101501[_0x4113('0x33')]!=='VIRTUAL'){var _0x1c0217={};_0x1c0217[_0x101501[_0x4113('0x2c')]]={'$like':'%'+_0x5e3317[_0x4113('0x35')]['filter']+'%'};return _0x1c0217;}})});}_0x50e8b1=_['merge']({},_0x50e8b1,_0x5e3317[_0x4113('0x42')]);var _0x528cca={'where':_0x50e8b1[_0x4113('0x3e')]};return db[_0x4113('0x30')][_0x4113('0x22')](_0x528cca)['then'](function(_0x4163b1){_0x21da53['count']=_0x4163b1;if(_0x5e3317[_0x4113('0x35')][_0x4113('0x43')]){_0x50e8b1[_0x4113('0x44')]=[{'all':!![]}];}return db[_0x4113('0x30')][_0x4113('0x45')](_0x50e8b1);})['then'](function(_0x5dfaad){_0x21da53[_0x4113('0x46')]=_0x5dfaad;return _0x21da53;})[_0x4113('0x29')](respondWithFilteredResult(_0x27e10b,_0x50e8b1))[_0x4113('0x47')](handleError(_0x27e10b,null));};exports[_0x4113('0x48')]=function(_0x5488e4,_0x3b87c9){var _0x500c83={'raw':!![],'where':{'id':_0x5488e4['params']['id']}},_0x2272ee={};_0x2272ee[_0x4113('0x38')]=_[_0x4113('0x36')](db[_0x4113('0x30')][_0x4113('0x31')]);_0x2272ee['query']=_[_0x4113('0x36')](_0x5488e4['query']);_0x2272ee['filters']=_['intersection'](_0x2272ee['model'],_0x2272ee[_0x4113('0x35')]);_0x500c83[_0x4113('0x39')]=_[_0x4113('0x3a')](_0x2272ee[_0x4113('0x38')],qs[_0x4113('0x3b')](_0x5488e4[_0x4113('0x35')][_0x4113('0x3b')]));_0x500c83[_0x4113('0x39')]=_0x500c83[_0x4113('0x39')]['length']?_0x500c83[_0x4113('0x39')]:_0x2272ee[_0x4113('0x38')];if(_0x5488e4[_0x4113('0x35')][_0x4113('0x43')]){_0x500c83[_0x4113('0x44')]=[{'all':!![]}];}_0x500c83=_[_0x4113('0x41')]({},_0x500c83,_0x5488e4['options']);return db[_0x4113('0x30')]['find'](_0x500c83)[_0x4113('0x29')](handleEntityNotFound(_0x3b87c9,null))[_0x4113('0x29')](respondWithResult(_0x3b87c9,null))[_0x4113('0x47')](handleError(_0x3b87c9,null));};exports['create']=function(_0xea8f94,_0x4c7536){return db['ChatTransferReport'][_0x4113('0x49')](_0xea8f94['body'],{})[_0x4113('0x29')](respondWithResult(_0x4c7536,0xc9))['catch'](handleError(_0x4c7536,null));};exports['update']=function(_0x1bebb4,_0x497120){if(_0x1bebb4['body']['id']){delete _0x1bebb4[_0x4113('0x4a')]['id'];}return db[_0x4113('0x30')][_0x4113('0x4b')]({'where':{'id':_0x1bebb4['params']['id']}})[_0x4113('0x29')](handleEntityNotFound(_0x497120,null))[_0x4113('0x29')](saveUpdates(_0x1bebb4[_0x4113('0x4a')],null))[_0x4113('0x29')](respondWithResult(_0x497120,null))[_0x4113('0x47')](handleError(_0x497120,null));};exports['destroy']=function(_0x464fae,_0x1280d0){return db[_0x4113('0x30')][_0x4113('0x4b')]({'where':{'id':_0x464fae[_0x4113('0x4c')]['id']}})[_0x4113('0x29')](handleEntityNotFound(_0x1280d0,null))[_0x4113('0x29')](removeEntity(_0x1280d0,null))[_0x4113('0x47')](handleError(_0x1280d0,null));};exports['describe']=function(_0x1c3c5a,_0x23623f){return db[_0x4113('0x30')]['describe']()[_0x4113('0x29')](respondWithResult(_0x23623f,null))[_0x4113('0x47')](handleError(_0x23623f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index b079391..644b45a 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 _0x5ac3=['../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x5ac3,0x68));var _0x35ac=function(_0xdf0f2a,_0x382763){_0xdf0f2a=_0xdf0f2a-0x0;var _0x4000f8=_0x5ac3[_0xdf0f2a];return _0x4000f8;};'use strict';var _=require(_0x35ac('0x0'));var util=require(_0x35ac('0x1'));var logger=require('../../config/logger')(_0x35ac('0x2'));var moment=require(_0x35ac('0x3'));var BPromise=require(_0x35ac('0x4'));var rp=require(_0x35ac('0x5'));var fs=require('fs');var path=require(_0x35ac('0x6'));var rimraf=require(_0x35ac('0x7'));var config=require(_0x35ac('0x8'));var attributes=require(_0x35ac('0x9'));module[_0x35ac('0xa')]=function(_0x1ef8f9,_0x19b3cf){return _0x1ef8f9[_0x35ac('0xb')]('ChatTransferReport',attributes,{'tableName':_0x35ac('0xc'),'paranoid':![],'indexes':[{'name':_0x35ac('0xd'),'fields':[_0x35ac('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8bfa=['rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','path'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x8bfa,0x7d));var _0xa8bf=function(_0x29d849,_0x209ceb){_0x29d849=_0x29d849-0x0;var _0x30b104=_0x8bfa[_0x29d849];return _0x30b104;};'use strict';var _=require(_0xa8bf('0x0'));var util=require(_0xa8bf('0x1'));var logger=require(_0xa8bf('0x2'))('api');var moment=require(_0xa8bf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8bf('0x4'));var rimraf=require(_0xa8bf('0x5'));var config=require('../../config/environment');var attributes=require(_0xa8bf('0x6'));module[_0xa8bf('0x7')]=function(_0x23ae8f,_0x3bb330){return _0x23ae8f['define'](_0xa8bf('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa8bf('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 32e9ba2..3672ae0 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 _0x0841=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','request','then'];(function(_0x3b5775,_0x53eefd){var _0x4a241f=function(_0x5f424e){while(--_0x5f424e){_0x3b5775['push'](_0x3b5775['shift']());}};_0x4a241f(++_0x53eefd);}(_0x0841,0x9e));var _0x1084=function(_0x284328,_0x4d674e){_0x284328=_0x284328-0x0;var _0x6efdac=_0x0841[_0x284328];return _0x6efdac;};'use strict';var _=require(_0x1084('0x0'));var util=require(_0x1084('0x1'));var moment=require(_0x1084('0x2'));var BPromise=require(_0x1084('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1084('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1084('0x5'))(_0x1084('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1084('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x298c3f,_0x59869d,_0x341fc0){return new BPromise(function(_0x5b00d8,_0x19cac7){return client[_0x1084('0x8')](_0x298c3f,_0x341fc0)[_0x1084('0x9')](function(_0xdcaa33){logger['info'](_0x1084('0xa'),_0x59869d,_0x1084('0xb'));logger[_0x1084('0xc')](_0x1084('0xd'),_0x59869d,_0x1084('0xb'),JSON[_0x1084('0xe')](_0xdcaa33));if(_0xdcaa33['error']){if(_0xdcaa33[_0x1084('0xf')][_0x1084('0x10')]===0x1f4){logger['error'](_0x1084('0xa'),_0x59869d,_0xdcaa33['error'][_0x1084('0x11')]);return _0x19cac7(_0xdcaa33[_0x1084('0xf')][_0x1084('0x11')]);}logger['error'](_0x1084('0xa'),_0x59869d,_0xdcaa33['error'][_0x1084('0x11')]);return _0x5b00d8(_0xdcaa33[_0x1084('0xf')][_0x1084('0x11')]);}else{logger[_0x1084('0x12')](_0x1084('0xa'),_0x59869d,'request\x20sent');_0x5b00d8(_0xdcaa33[_0x1084('0x13')][_0x1084('0x11')]);}})[_0x1084('0x14')](function(_0x5912ce){logger[_0x1084('0xf')](_0x1084('0xa'),_0x59869d,_0x5912ce);_0x19cac7(_0x5912ce);});});}
\ No newline at end of file
+var _0x2be7=['request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x18959e,_0x24e830){var _0x308aba=function(_0x11ac72){while(--_0x11ac72){_0x18959e['push'](_0x18959e['shift']());}};_0x308aba(++_0x24e830);}(_0x2be7,0xa6));var _0x72be=function(_0x227c59,_0x575c83){_0x227c59=_0x227c59-0x0;var _0x35aeac=_0x2be7[_0x227c59];return _0x35aeac;};'use strict';var _=require('lodash');var util=require(_0x72be('0x0'));var moment=require('moment');var BPromise=require(_0x72be('0x1'));var rs=require(_0x72be('0x2'));var fs=require('fs');var Redis=require(_0x72be('0x3'));var db=require(_0x72be('0x4'))['db'];var utils=require(_0x72be('0x5'));var logger=require('../../config/logger')(_0x72be('0x6'));var config=require('../../config/environment');var jayson=require(_0x72be('0x7'));var client=jayson[_0x72be('0x8')][_0x72be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e4c64,_0x38f7cd,_0x37fffd){return new BPromise(function(_0x2e0b1d,_0x18670a){return client[_0x72be('0xa')](_0x4e4c64,_0x37fffd)[_0x72be('0xb')](function(_0x4fc77){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x38f7cd,_0x72be('0xc'));logger[_0x72be('0xd')](_0x72be('0xe'),_0x38f7cd,_0x72be('0xc'),JSON['stringify'](_0x4fc77));if(_0x4fc77['error']){if(_0x4fc77[_0x72be('0xf')][_0x72be('0x10')]===0x1f4){logger['error'](_0x72be('0x11'),_0x38f7cd,_0x4fc77[_0x72be('0xf')][_0x72be('0x12')]);return _0x18670a(_0x4fc77[_0x72be('0xf')][_0x72be('0x12')]);}logger[_0x72be('0xf')](_0x72be('0x11'),_0x38f7cd,_0x4fc77[_0x72be('0xf')][_0x72be('0x12')]);return _0x2e0b1d(_0x4fc77[_0x72be('0xf')]['message']);}else{logger[_0x72be('0x13')](_0x72be('0x11'),_0x38f7cd,'request\x20sent');_0x2e0b1d(_0x4fc77[_0x72be('0x14')]['message']);}})[_0x72be('0x15')](function(_0x215849){logger[_0x72be('0xf')](_0x72be('0x11'),_0x38f7cd,_0x215849);_0x18670a(_0x215849);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 2695c09..983557a 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 _0x2000=['../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4f4b34,_0x47dda1){var _0xac9265=function(_0x5340fa){while(--_0x5340fa){_0x4f4b34['push'](_0x4f4b34['shift']());}};_0xac9265(++_0x47dda1);}(_0x2000,0x68));var _0x0200=function(_0x48ccaa,_0x118a60){_0x48ccaa=_0x48ccaa-0x0;var _0x3c11ab=_0x2000[_0x48ccaa];return _0x3c11ab;};'use strict';var multer=require(_0x0200('0x0'));var util=require(_0x0200('0x1'));var path=require(_0x0200('0x2'));var timeout=require(_0x0200('0x3'));var express=require(_0x0200('0x4'));var router=express['Router']();var fs_extra=require(_0x0200('0x5'));var auth=require(_0x0200('0x6'));var interaction=require(_0x0200('0x7'));var config=require('../../config/environment');var controller=require(_0x0200('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0200('0x9')]);router[_0x0200('0xa')](_0x0200('0xb'),auth[_0x0200('0xc')](),controller[_0x0200('0xd')]);router[_0x0200('0xa')]('/:id',auth[_0x0200('0xc')](),controller[_0x0200('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0200('0xf')]);router[_0x0200('0x10')](_0x0200('0x11'),auth[_0x0200('0xc')](),controller[_0x0200('0x12')]);router[_0x0200('0x13')](_0x0200('0x11'),auth[_0x0200('0xc')](),controller[_0x0200('0x14')]);module[_0x0200('0x15')]=router;
\ No newline at end of file
+var _0xd4d0=['isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x19a045,_0xdbce0e){var _0x5c3f19=function(_0x106aba){while(--_0x106aba){_0x19a045['push'](_0x19a045['shift']());}};_0x5c3f19(++_0xdbce0e);}(_0xd4d0,0xfa));var _0x0d4d=function(_0x529dba,_0x29b294){_0x529dba=_0x529dba-0x0;var _0x11e1f0=_0xd4d0[_0x529dba];return _0x11e1f0;};'use strict';var multer=require(_0x0d4d('0x0'));var util=require(_0x0d4d('0x1'));var path=require('path');var timeout=require(_0x0d4d('0x2'));var express=require(_0x0d4d('0x3'));var router=express[_0x0d4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0d4d('0x5'));var interaction=require(_0x0d4d('0x6'));var config=require(_0x0d4d('0x7'));var controller=require(_0x0d4d('0x8'));router[_0x0d4d('0x9')]('/',auth[_0x0d4d('0xa')](),controller[_0x0d4d('0xb')]);router[_0x0d4d('0x9')]('/describe',auth[_0x0d4d('0xa')](),controller[_0x0d4d('0xc')]);router[_0x0d4d('0x9')](_0x0d4d('0xd'),auth[_0x0d4d('0xa')](),controller[_0x0d4d('0xe')]);router['post']('/',auth[_0x0d4d('0xa')](),controller['create']);router[_0x0d4d('0xf')](_0x0d4d('0xd'),auth['isAuthenticated'](),controller[_0x0d4d('0x10')]);router[_0x0d4d('0x11')](_0x0d4d('0xd'),auth['isAuthenticated'](),controller[_0x0d4d('0x12')]);module[_0x0d4d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index d8e923c..c397d57 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 _0x8c5f=['Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','thumb','star','input','name','text','getDataValue','onlineForm','setDataValue','stringify','TEXT','textarea','Comments','offlineForm','parse','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x255b73,_0x5b2756){var _0x8f95dc=function(_0x396ed5){while(--_0x396ed5){_0x255b73['push'](_0x255b73['shift']());}};_0x8f95dc(++_0x5b2756);}(_0x8c5f,0xd3));var _0xf8c5=function(_0x1d5fd9,_0x39e853){_0x1d5fd9=_0x1d5fd9-0x0;var _0x3e11bc=_0x8c5f[_0x1d5fd9];return _0x3e11bc;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![]},'address':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'unique':_0xf8c5('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0x2')},'mapKeyOffline':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x2')},'key':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x3')},'customerAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf8c5('0x0')]},'animation':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xf8c5('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x9')},'header_offline':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xa')},'download_transcript':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0xc')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xd')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0xe')},'noteTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x10')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0x9')},'skipMessageButton':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x11')},'conditionAgreement':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xf8c5('0x12')]('star',_0xf8c5('0x13')),'defaultValue':_0xf8c5('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8c5('0x15'),'variable':null,'config':{'placeholder':_0xf8c5('0x16'),'type':_0xf8c5('0x17'),'required':!![]},'props':{'title':_0xf8c5('0x16'),'helpText':''}},{'type':_0xf8c5('0x15'),'props':{'title':_0xf8c5('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8c5('0x2'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf8c5('0x18')](_0xf8c5('0x19'))?JSON['parse'](this[_0xf8c5('0x18')]('onlineForm')):{};},'set':function(_0x3d1a1e){return this[_0xf8c5('0x1a')](_0xf8c5('0x19'),JSON[_0xf8c5('0x1b')](_0x3d1a1e));}},'offlineForm':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8c5('0x15'),'props':{'title':_0xf8c5('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8c5('0x2'),'type':'email'},'variable':null},{'type':_0xf8c5('0x1d'),'config':{'placeholder':_0xf8c5('0x1e')},'props':{'title':_0xf8c5('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xf8c5('0x18')](_0xf8c5('0x1f'))?JSON[_0xf8c5('0x20')](this[_0xf8c5('0x18')](_0xf8c5('0x1f'))):{};},'set':function(_0x2696e6){return this[_0xf8c5('0x1a')]('offlineForm',JSON['stringify'](_0x2696e6));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x23')},'skipUnmanaged':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x9')},'enableCustomerAttachment':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'showAgentAvatar':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf8c5('0x0')]},'notificationTemplate':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':function(){return _0xf8c5('0x24');}},'notificationSound':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf8c5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x26')},'verticalAlignment':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x27')},'defaultTitle':{'type':Sequelize[_0xf8c5('0x0')]},'customerAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf8c5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf8c5('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![],'comment':_0xf8c5('0x29'),'set':function(_0x20393f){if(!_0x20393f)this['setDataValue'](_0xf8c5('0x2a'),null);this['setDataValue'](_0xf8c5('0x2b'),_0x20393f);}},'vidaooEscalation':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf8c5('0x0')]},'vidaooTopic':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':function(){return _0xf8c5('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf8c5('0x1c')]}};
\ No newline at end of file
+var _0xc131=['STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','ENUM','star','thumb','input','name','text','getDataValue','parse','onlineForm','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','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:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports'];(function(_0x36bcd3,_0x44f1c7){var _0x567c4f=function(_0x3fdf7f){while(--_0x3fdf7f){_0x36bcd3['push'](_0x36bcd3['shift']());}};_0x567c4f(++_0x44f1c7);}(_0xc131,0x15c));var _0x1c13=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc131[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x1c13('0x0'));var rs=require('randomstring');module[_0x1c13('0x1')]={'name':{'type':Sequelize[_0x1c13('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x1c13('0x2')],'allowNull':![],'unique':_0x1c13('0x3')},'description':{'type':Sequelize[_0x1c13('0x2')]},'mapKey':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x4')},'mapKeyOffline':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x4')},'key':{'type':Sequelize[_0x1c13('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0x5')},'customerAlias':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c13('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c13('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c13('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1c13('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1c13('0x2')]},'animation':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x1c13('0xa'),_0x1c13('0xb')),'defaultValue':_0x1c13('0xa')},'header_online':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0xc')},'start_chat_button':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0xd')},'offline_chat_button':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0xf')},'download_transcript':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1c13('0x11')]},'closingQuestion':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x14')},'noteTitle':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0x17')},'closingMessageButton':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0xe')},'skipMessageButton':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x18')},'ratingType':{'type':Sequelize[_0x1c13('0x19')](_0x1c13('0x1a'),_0x1c13('0x1b')),'defaultValue':_0x1c13('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1c13('0x1c'),'variable':null,'config':{'placeholder':_0x1c13('0x1d'),'type':_0x1c13('0x1e'),'required':!![]},'props':{'title':_0x1c13('0x1d'),'helpText':''}},{'type':_0x1c13('0x1c'),'props':{'title':_0x1c13('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1c13('0x4'),'type':_0x1c13('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1c13('0x1f')]('onlineForm')?JSON[_0x1c13('0x20')](this['getDataValue'](_0x1c13('0x21'))):{};},'set':function(_0x39ca31){return this['setDataValue']('onlineForm',JSON[_0x1c13('0x22')](_0x39ca31));}},'offlineForm':{'type':Sequelize[_0x1c13('0x11')],'defaultValue':function(){return JSON[_0x1c13('0x22')]({'items':[{'type':_0x1c13('0x1c'),'props':{'title':_0x1c13('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1c13('0x4'),'type':_0x1c13('0x4')},'variable':null},{'type':_0x1c13('0x23'),'config':{'placeholder':_0x1c13('0x24')},'props':{'title':_0x1c13('0x24'),'helpText':_0x1c13('0x25')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x1c13('0x20')](this[_0x1c13('0x1f')]('offlineForm')):{};},'set':function(_0xc02bb4){return this['setDataValue'](_0x1c13('0x26'),JSON[_0x1c13('0x22')](_0xc02bb4));}},'token':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1c13('0x2')]},'forwardOffline':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1c13('0x2')]},'waitingTitle':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x28')},'offlineMessageBody':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x2a')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1c13('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1c13('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1c13('0x2b');}},'notificationSound':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x1c13('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x1c13('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':_0x1c13('0x2c')},'defaultTitle':{'type':Sequelize[_0x1c13('0x2')]},'customerAvatar':{'type':Sequelize[_0x1c13('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1c13('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c13('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1c13('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1c13('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1c13('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x1c13('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1c13('0x8')],'comment':_0x1c13('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xcffbb2){if(!_0xcffbb2)this['setDataValue'](_0x1c13('0x2f'),null);this['setDataValue'](_0x1c13('0x30'),_0xcffbb2);}},'vidaooEscalation':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1c13('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x1c13('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x1c13('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1c13('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1c13('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 16ac94c..a9db70f 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 _0xb7ea=['mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','backgroundColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','omit','getProactiveActions','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','apply','save','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatWebsite','includeAll','include','findAll','rows','show','params','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','join','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ChatApplication','Applications','List','account','applications','orderBy','Contacts','contact','customerIp','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','lastName','messageId','created','autoclose','push','close','*,*,*,*','UserId','User','unshift','agent','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb7ea,0x16c));var _0xab7e=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xb7ea[_0x65c50e];return _0x4573e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab7e('0x0'));var zipdir=require(_0xab7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab7e('0x2'));var BPromise=require(_0xab7e('0x3'));var Mustache=require(_0xab7e('0x4'));var util=require(_0xab7e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xab7e('0x6'));var ejs=require(_0xab7e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab7e('0x8'));var squel=require(_0xab7e('0x9'));var crypto=require(_0xab7e('0xa'));var jsforce=require(_0xab7e('0xb'));var deskjs=require(_0xab7e('0xc'));var toCsv=require(_0xab7e('0x6'));var querystring=require(_0xab7e('0xd'));var Papa=require(_0xab7e('0xe'));var Redis=require('ioredis');var authService=require(_0xab7e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab7e('0x10'));var hardwareService=require(_0xab7e('0x11'));var logger=require(_0xab7e('0x12'))(_0xab7e('0x13'));var utils=require(_0xab7e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xab7e('0x15'));var db=require(_0xab7e('0x16'))['db'];config[_0xab7e('0x17')]=_[_0xab7e('0x18')](config[_0xab7e('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xab7e('0x19'))(new Redis(config[_0xab7e('0x17')]));require(_0xab7e('0x1a'))[_0xab7e('0x1b')](socket);var jayson=require(_0xab7e('0x1c'));var client=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xab7e('0x1e')]({'port':0x232a});var client9003=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x232b});var client9001=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x5aadb8,_0xe7f6e9,_0x3c1799,_0x433072){return new BPromise(function(_0x58ffa0,_0x5ba2dd){var _0x64928=_0x433072||client;return _0x64928[_0xab7e('0x1f')](_0x5aadb8,_0x3c1799)[_0xab7e('0x20')](function(_0x58846b){logger['info'](_0xab7e('0x21'),_0xe7f6e9,'request\x20sent');logger[_0xab7e('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xe7f6e9,_0xab7e('0x23'),JSON[_0xab7e('0x24')](_0x58846b));if(_0x58846b[_0xab7e('0x25')]){if(_0x58846b[_0xab7e('0x25')][_0xab7e('0x26')]===0x1f4){logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);return _0x5ba2dd(_0x58846b['error'][_0xab7e('0x27')]);}logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);return _0x58ffa0(_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);}else{logger[_0xab7e('0x28')]('ChatWebsite,\x20%s,\x20%s',_0xe7f6e9,_0xab7e('0x23'));_0x58ffa0(_0x58846b[_0xab7e('0x29')][_0xab7e('0x27')]);}})[_0xab7e('0x2a')](function(_0x5e6c68){logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x5e6c68);_0x5ba2dd(_0x5e6c68);});});}function respondWithStatusCode(_0x1e1931,_0x26bef5){_0x26bef5=_0x26bef5||0xcc;return function(_0x1316ff){if(_0x1316ff){return _0x1e1931[_0xab7e('0x2b')](_0x26bef5);}return _0x1e1931[_0xab7e('0x2c')](_0x26bef5)[_0xab7e('0x2d')]();};}function respondWithResult(_0x5d2d1c,_0x537215){_0x537215=_0x537215||0xc8;return function(_0x48846d){if(_0x48846d){return _0x5d2d1c['status'](_0x537215)[_0xab7e('0x2e')](_0x48846d);}};}function respondWithFilteredResult(_0x4c268a,_0x35c507){return function(_0x5e8efa){if(_0x5e8efa){var _0x33d8a0=typeof _0x35c507[_0xab7e('0x2f')]===_0xab7e('0x30')&&typeof _0x35c507['limit']===_0xab7e('0x30');var _0x4bfcf0=_0x5e8efa['count'];var _0x409a8b=_0x33d8a0?0x0:_0x35c507[_0xab7e('0x2f')];var _0x1f621e=_0x33d8a0?_0x5e8efa[_0xab7e('0x31')]:_0x35c507[_0xab7e('0x2f')]+_0x35c507['limit'];var _0x47a322;if(_0x1f621e>=_0x4bfcf0){_0x1f621e=_0x4bfcf0;_0x47a322=0xc8;}else{_0x47a322=0xce;}_0x4c268a[_0xab7e('0x2c')](_0x47a322);return _0x4c268a['set']('Content-Range',_0x409a8b+'-'+_0x1f621e+'/'+_0x4bfcf0)['json'](_0x5e8efa);}return null;};}function patchUpdates(_0x30b442){return function(_0x175c9c){try{jsonpatch[_0xab7e('0x32')](_0x175c9c,_0x30b442,!![]);}catch(_0x299f06){return BPromise['reject'](_0x299f06);}return _0x175c9c[_0xab7e('0x33')]();};}function saveUpdates(_0x1ac8b3,_0x4fd262){return function(_0x4df546){if(_0x4df546){return _0x4df546['update'](_0x1ac8b3)[_0xab7e('0x20')](function(_0x472cbb){return _0x472cbb;});}return null;};}function removeEntity(_0x5f0abd,_0x25a4d7){return function(_0x421ed7){if(_0x421ed7){return _0x421ed7['destroy']()[_0xab7e('0x20')](function(){var _0x25960a=_0x421ed7[_0xab7e('0x34')]({'plain':!![]});var _0x28e6bb=_0xab7e('0x35');return db[_0xab7e('0x36')][_0xab7e('0x37')]({'where':{'type':_0x28e6bb,'resourceId':_0x25960a['id']}})[_0xab7e('0x20')](function(){return _0x421ed7;});})[_0xab7e('0x20')](function(){_0x5f0abd[_0xab7e('0x2c')](0xcc)[_0xab7e('0x2d')]();});}};}function handleEntityNotFound(_0x371d44,_0x275968){return function(_0x3444c6){if(!_0x3444c6){_0x371d44['sendStatus'](0x194);}return _0x3444c6;};}function handleError(_0x4772b7,_0x2ec77f){_0x2ec77f=_0x2ec77f||0x1f4;return function(_0x1cc44c){logger['error'](_0x1cc44c[_0xab7e('0x38')]);if(_0x1cc44c[_0xab7e('0x39')]){delete _0x1cc44c['name'];}_0x4772b7[_0xab7e('0x2c')](_0x2ec77f)[_0xab7e('0x3a')](_0x1cc44c);};}exports[_0xab7e('0x3b')]=function(_0x279b63,_0x399319){var _0x152245={'include':[{'model':db[_0xab7e('0x3c')],'as':_0xab7e('0x3d')}]},_0x27c493={},_0x4dfd7e={'count':0x0,'rows':[]};var _0xb4f340=_[_0xab7e('0x3e')](db['ChatWebsite'][_0xab7e('0x3f')],function(_0x41a2e0){return{'name':_0x41a2e0[_0xab7e('0x40')],'type':_0x41a2e0[_0xab7e('0x41')][_0xab7e('0x42')]};});_0x27c493[_0xab7e('0x43')]=_[_0xab7e('0x3e')](_0xb4f340,_0xab7e('0x39'));_0x27c493[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x279b63[_0xab7e('0x44')]);_0x27c493[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x27c493['model'],_0x27c493[_0xab7e('0x44')]);_0x152245['attributes']=_[_0xab7e('0x47')](_0x27c493[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x279b63[_0xab7e('0x44')][_0xab7e('0x48')]));_0x152245[_0xab7e('0x49')]=_0x152245[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x152245[_0xab7e('0x49')]:_0x27c493[_0xab7e('0x43')];if(!_0x279b63[_0xab7e('0x44')][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x152245['limit']=qs[_0xab7e('0x4d')](_0x279b63[_0xab7e('0x44')]['limit']);_0x152245[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x279b63[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x152245[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x279b63['query']['sort']);_0x152245[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x279b63['query'],_0x27c493[_0xab7e('0x46')]),_0xb4f340);if(_0x279b63['query']['filter']){_0x152245[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x152245[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0xb4f340,function(_0x197e8a){if(_0x197e8a[_0xab7e('0x41')]!==_0xab7e('0x53')){var _0x155f35={};_0x155f35[_0x197e8a[_0xab7e('0x39')]]={'$like':'%'+_0x279b63['query'][_0xab7e('0x54')]+'%'};return _0x155f35;}})});}_0x152245=_[_0xab7e('0x52')]({},_0x152245,_0x279b63[_0xab7e('0x55')]);var _0x1f62dd={'where':_0x152245['where']};return db[_0xab7e('0x56')]['count'](_0x1f62dd)[_0xab7e('0x20')](function(_0x2b7f8e){_0x4dfd7e[_0xab7e('0x31')]=_0x2b7f8e;if(_0x279b63['query'][_0xab7e('0x57')]){_0x152245[_0xab7e('0x58')]=[{'all':!![]}];}return db[_0xab7e('0x56')][_0xab7e('0x59')](_0x152245);})[_0xab7e('0x20')](function(_0x398ceb){_0x4dfd7e[_0xab7e('0x5a')]=_0x398ceb;return _0x4dfd7e;})[_0xab7e('0x20')](respondWithFilteredResult(_0x399319,_0x152245))['catch'](handleError(_0x399319,null));};exports[_0xab7e('0x5b')]=function(_0x2008f3,_0x38538b){var _0x42b5f6={'raw':![],'where':{'id':_0x2008f3[_0xab7e('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xab7e('0x3d')}]},_0x1599a2={};_0x1599a2[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatWebsite']['rawAttributes']);_0x1599a2[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x2008f3['query']);_0x1599a2[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x1599a2[_0xab7e('0x43')],_0x1599a2[_0xab7e('0x44')]);_0x42b5f6[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x1599a2[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x2008f3[_0xab7e('0x44')][_0xab7e('0x48')]));_0x42b5f6['attributes']=_0x42b5f6[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x42b5f6['attributes']:_0x1599a2[_0xab7e('0x43')];if(_0x2008f3[_0xab7e('0x44')][_0xab7e('0x57')]){_0x42b5f6[_0xab7e('0x58')]=[{'all':!![]}];}_0x42b5f6=_[_0xab7e('0x52')]({},_0x42b5f6,_0x2008f3[_0xab7e('0x55')]);return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x42b5f6)['then'](handleEntityNotFound(_0x38538b,null))[_0xab7e('0x20')](respondWithResult(_0x38538b,null))[_0xab7e('0x2a')](handleError(_0x38538b,null));};exports[_0xab7e('0x5e')]=function(_0x4b1163,_0x278068){return db['ChatWebsite'][_0xab7e('0x5e')](_0x4b1163[_0xab7e('0x5f')],{})[_0xab7e('0x20')](function(_0x15963b){var _0x3eec87=_0x4b1163[_0xab7e('0x60')][_0xab7e('0x34')]({'plain':!![]});if(!_0x3eec87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3eec87[_0xab7e('0x61')]==='user'){var _0x186803=_0x15963b[_0xab7e('0x34')]({'plain':!![]});var _0xb4a6c4=_0xab7e('0x35');return db['UserProfileSection'][_0xab7e('0x5d')]({'where':{'name':_0xb4a6c4,'userProfileId':_0x3eec87[_0xab7e('0x62')]},'raw':!![]})[_0xab7e('0x20')](function(_0x46298b){if(_0x46298b&&_0x46298b[_0xab7e('0x63')]===0x0){return db[_0xab7e('0x36')][_0xab7e('0x5e')]({'name':_0x186803[_0xab7e('0x39')],'resourceId':_0x186803['id'],'type':_0x46298b['name'],'sectionId':_0x46298b['id']},{})['then'](function(){return _0x15963b;});}else{return _0x15963b;}})[_0xab7e('0x2a')](function(_0x2e69b8){logger[_0xab7e('0x25')](_0xab7e('0x64'),_0x2e69b8);throw _0x2e69b8;});}return _0x15963b;})[_0xab7e('0x20')](respondWithResult(_0x278068,0xc9))[_0xab7e('0x2a')](handleError(_0x278068,null));};exports[_0xab7e('0x65')]=function(_0x52a48c,_0x589bdc){if(_0x52a48c[_0xab7e('0x5f')]['id']){delete _0x52a48c[_0xab7e('0x5f')]['id'];}return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x52a48c['params']['id']},'include':[{'model':db['Pause'],'as':_0xab7e('0x3d')}]})[_0xab7e('0x20')](handleEntityNotFound(_0x589bdc,null))['then'](saveUpdates(_0x52a48c['body'],null))[_0xab7e('0x20')](respondWithResult(_0x589bdc,null))[_0xab7e('0x2a')](handleError(_0x589bdc,null));};exports[_0xab7e('0x37')]=function(_0x8b9201,_0x5355d2){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x8b9201[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x5355d2,null))[_0xab7e('0x20')](removeEntity(_0x5355d2,null))[_0xab7e('0x2a')](handleError(_0x5355d2,null));};exports[_0xab7e('0x66')]=function(_0x4e4087,_0x1e2bc6){return db[_0xab7e('0x56')]['describe']()[_0xab7e('0x20')](respondWithResult(_0x1e2bc6,null))[_0xab7e('0x2a')](handleError(_0x1e2bc6,null));};exports[_0xab7e('0x67')]=function(_0x5f1af4,_0xf1c8df,_0x515a5c){if(_0x5f1af4[_0xab7e('0x5f')]['id']){delete _0x5f1af4['body']['id'];}return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x5f1af4[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0xf1c8df,null))['then'](function(_0x5dd194){if(_0x5dd194){_0x5f1af4[_0xab7e('0x5f')][_0xab7e('0x68')]=_0x5dd194['id'];return db[_0xab7e('0x69')]['create'](_0x5f1af4[_0xab7e('0x5f')]);}})[_0xab7e('0x20')](respondWithResult(_0xf1c8df,null))[_0xab7e('0x2a')](handleError(_0xf1c8df,null));};exports['getDispositions']=function(_0x13a5ab,_0xbb4e6f,_0x192d02){var _0x2089ff={'raw':![],'where':{}};var _0x22728e={};var _0x480d06={'count':0x0,'rows':[]};return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x13a5ab[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0xbb4e6f,null))[_0xab7e('0x20')](function(_0x3e57b6){if(_0x3e57b6){_0x22728e['model']=_[_0xab7e('0x45')](db['Disposition'][_0xab7e('0x3f')]);_0x22728e[_0xab7e('0x44')]=_['keys'](_0x13a5ab[_0xab7e('0x44')]);_0x22728e['filters']=_[_0xab7e('0x47')](_0x22728e['model'],_0x22728e[_0xab7e('0x44')]);_0x2089ff[_0xab7e('0x49')]=_['intersection'](_0x22728e[_0xab7e('0x43')],qs['fields'](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x48')]));_0x2089ff[_0xab7e('0x49')]=_0x2089ff['attributes'][_0xab7e('0x4a')]?_0x2089ff[_0xab7e('0x49')]:_0x22728e[_0xab7e('0x43')];if(!_0x13a5ab['query'][_0xab7e('0x4b')]('nolimit')){_0x2089ff[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x13a5ab['query'][_0xab7e('0x4d')]);_0x2089ff[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x2089ff[_0xab7e('0x4e')]=qs['sort'](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x2089ff[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x13a5ab[_0xab7e('0x44')],_0x22728e[_0xab7e('0x46')]));_0x2089ff[_0xab7e('0x50')][_0xab7e('0x68')]=_0x3e57b6['id'];if(_0x13a5ab[_0xab7e('0x44')]['filter']){_0x2089ff['where']=_[_0xab7e('0x52')](_0x2089ff[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x2089ff[_0xab7e('0x49')],function(_0x224fd8){var _0x3f3f23={};_0x3f3f23[_0x224fd8]={'$like':'%'+_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x3f3f23;})});}_0x2089ff=_[_0xab7e('0x52')]({},_0x2089ff,_0x13a5ab[_0xab7e('0x55')]);return db['Disposition'][_0xab7e('0x31')]({'where':_0x2089ff[_0xab7e('0x50')]})[_0xab7e('0x20')](function(_0x3f2190){_0x480d06[_0xab7e('0x31')]=_0x3f2190;if(_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x57')]){_0x2089ff[_0xab7e('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xab7e('0x59')](_0x2089ff);})[_0xab7e('0x20')](function(_0x5c817b){_0x480d06[_0xab7e('0x5a')]=_0x5c817b;return _0x480d06;});}})['then'](respondWithFilteredResult(_0xbb4e6f,_0x2089ff))[_0xab7e('0x2a')](handleError(_0xbb4e6f,null));};exports[_0xab7e('0x6b')]=function(_0x226459,_0x4a50b2,_0x5ddb61){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x226459[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4a50b2,null))[_0xab7e('0x20')](function(_0x4494fc){if(_0x4494fc){return _0x4494fc[_0xab7e('0x6b')](_0x226459[_0xab7e('0x44')]['ids']);}})[_0xab7e('0x20')](respondWithStatusCode(_0x4a50b2,null))[_0xab7e('0x2a')](handleError(_0x4a50b2,null));};exports[_0xab7e('0x6c')]=function(_0x5799ec,_0x3856f,_0x6d2fa1){if(_0x5799ec[_0xab7e('0x5f')]['id']){delete _0x5799ec[_0xab7e('0x5f')]['id'];}return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x5799ec['params']['id']}})['then'](handleEntityNotFound(_0x3856f,null))[_0xab7e('0x20')](function(_0x1cb6a9){if(_0x1cb6a9){_0x5799ec[_0xab7e('0x5f')][_0xab7e('0x68')]=_0x1cb6a9['id'];return db[_0xab7e('0x6d')]['create'](_0x5799ec['body']);}})[_0xab7e('0x20')](respondWithResult(_0x3856f,null))[_0xab7e('0x2a')](handleError(_0x3856f,null));};exports[_0xab7e('0x6e')]=function(_0x25b757,_0x11b5b8,_0x1deec7){var _0x56e5c1={'raw':![],'where':{}};var _0x49b647={};var _0x328388={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xab7e('0x6a')]({'where':{'id':_0x25b757[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x11b5b8,null))['then'](function(_0x46921a){if(_0x46921a){_0x49b647[_0xab7e('0x43')]=_['keys'](db[_0xab7e('0x6d')]['rawAttributes']);_0x49b647[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x25b757[_0xab7e('0x44')]);_0x49b647[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x49b647[_0xab7e('0x43')],_0x49b647[_0xab7e('0x44')]);_0x56e5c1[_0xab7e('0x49')]=_['intersection'](_0x49b647[_0xab7e('0x43')],qs['fields'](_0x25b757[_0xab7e('0x44')]['fields']));_0x56e5c1['attributes']=_0x56e5c1[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x56e5c1[_0xab7e('0x49')]:_0x49b647[_0xab7e('0x43')];if(!_0x25b757['query'][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x56e5c1[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x25b757[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x56e5c1['offset']=qs[_0xab7e('0x2f')](_0x25b757[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x56e5c1[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x25b757['query'][_0xab7e('0x4f')]);_0x56e5c1[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x25b757['query'],_0x49b647[_0xab7e('0x46')]));_0x56e5c1[_0xab7e('0x50')][_0xab7e('0x68')]=_0x46921a['id'];if(_0x25b757[_0xab7e('0x44')]['filter']){_0x56e5c1[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x56e5c1[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x56e5c1[_0xab7e('0x49')],function(_0x4440d4){var _0x22f476={};_0x22f476[_0x4440d4]={'$like':'%'+_0x25b757[_0xab7e('0x44')]['filter']+'%'};return _0x22f476;})});}_0x56e5c1=_[_0xab7e('0x52')]({},_0x56e5c1,_0x25b757['options']);return db[_0xab7e('0x6d')]['count']({'where':_0x56e5c1[_0xab7e('0x50')]})['then'](function(_0x6c3aa4){_0x328388['count']=_0x6c3aa4;if(_0x25b757[_0xab7e('0x44')][_0xab7e('0x57')]){_0x56e5c1[_0xab7e('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0xab7e('0x59')](_0x56e5c1);})['then'](function(_0x1c5184){_0x328388[_0xab7e('0x5a')]=_0x1c5184;return _0x328388;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0x11b5b8,_0x56e5c1))[_0xab7e('0x2a')](handleError(_0x11b5b8,null));};exports['removeAnswers']=function(_0x2be82b,_0x4eaa76,_0x27ccbd){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x2be82b[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4eaa76,null))[_0xab7e('0x20')](function(_0x121145){if(_0x121145){return _0x121145[_0xab7e('0x6f')](_0x2be82b[_0xab7e('0x44')][_0xab7e('0x70')]);}})[_0xab7e('0x20')](respondWithStatusCode(_0x4eaa76,null))[_0xab7e('0x2a')](handleError(_0x4eaa76,null));};exports[_0xab7e('0x71')]=function(_0x51feee,_0x539916,_0xceec97){_0x51feee[_0xab7e('0x5f')][_0xab7e('0x72')]=_0x51feee[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x51feee[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x539916,null))['then'](saveUpdates(_0x51feee['body'],null))[_0xab7e('0x20')](respondWithResult(_0x539916,null))[_0xab7e('0x2a')](handleError(_0x539916,null));};exports[_0xab7e('0x75')]=function(_0x2c9291,_0x2f71f1,_0x1f4270){_0x2c9291['body'][_0xab7e('0x76')]=_0x2c9291[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x2c9291[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f71f1,null))[_0xab7e('0x20')](saveUpdates(_0x2c9291[_0xab7e('0x5f')],null))[_0xab7e('0x20')](respondWithResult(_0x2f71f1,null))[_0xab7e('0x2a')](handleError(_0x2f71f1,null));};exports[_0xab7e('0x77')]=function(_0x387b59,_0x277306,_0x590358){_0x387b59[_0xab7e('0x5f')][_0xab7e('0x78')]=_0x387b59[_0xab7e('0x73')][_0xab7e('0x74')];return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x387b59[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x277306,null))[_0xab7e('0x20')](saveUpdates(_0x387b59['body'],null))[_0xab7e('0x20')](respondWithResult(_0x277306,null))['catch'](handleError(_0x277306,null));};exports[_0xab7e('0x79')]=function(_0x122c6a,_0x11e5a0,_0x5e3a99){_0x122c6a['body'][_0xab7e('0x7a')]=_0x122c6a[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x122c6a[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x11e5a0,null))[_0xab7e('0x20')](saveUpdates(_0x122c6a['body'],null))[_0xab7e('0x20')](respondWithResult(_0x11e5a0,null))['catch'](handleError(_0x11e5a0,null));};exports[_0xab7e('0x7b')]=function(_0x1b212b,_0x333704,_0x13d84f){var _0x203565=path['join'](config[_0xab7e('0x7c')],_0xab7e('0x7d'));var _0x56dc0e={'where':{'id':_0x1b212b[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x72')],'raw':!![]};var _0x4dc744=![];return require('../../config/license/util')[_0xab7e('0x7e')]()['then'](function(_0x11fd8b){if(_0x11fd8b){_0x4dc744=_0x11fd8b[_0xab7e('0x7f')];}})[_0xab7e('0x20')](function(){return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x56dc0e);})['then'](handleEntityNotFound(_0x333704,null))[_0xab7e('0x20')](function(_0x7cf2f2){if(_0x7cf2f2){if(!_[_0xab7e('0x80')](_0x7cf2f2[_0xab7e('0x72')])){if(fs[_0xab7e('0x81')](path['join'](config['root'],'server/files/images/logos/',_0x7cf2f2[_0xab7e('0x72')]))&&_0x4dc744){_0x203565=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/images/logos/',_0x7cf2f2[_0xab7e('0x72')]);}}return _0x333704['download'](_0x203565);}})[_0xab7e('0x2a')](handleError(_0x333704,null));};exports[_0xab7e('0x83')]=function(_0x4f15b0,_0x165395,_0x4ea43c){var _0x3ef0d9=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x84'));var _0x4f525b={'where':{'id':_0x4f15b0['params']['id']},'attributes':['id',_0xab7e('0x76')],'raw':!![]};return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x4f525b)[_0xab7e('0x20')](handleEntityNotFound(_0x165395,null))[_0xab7e('0x20')](function(_0x223908){if(_0x223908){if(!_[_0xab7e('0x80')](_0x223908['agentAvatar'])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x223908[_0xab7e('0x76')]))){_0x3ef0d9=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x223908[_0xab7e('0x76')]);}}return _0x165395[_0xab7e('0x86')](_0x3ef0d9);}})['catch'](handleError(_0x165395,null));};exports[_0xab7e('0x87')]=function(_0x21bc1d,_0x44714d,_0x26029d){var _0x40e8b0=path[_0xab7e('0x82')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x1784ba={'where':{'id':_0x21bc1d[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x78'),_0xab7e('0x88')],'raw':!![]};return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x1784ba)[_0xab7e('0x20')](handleEntityNotFound(_0x44714d,null))[_0xab7e('0x20')](function(_0x45ab5e){if(_0x45ab5e){if(!_[_0xab7e('0x80')](_0x45ab5e[_0xab7e('0x78')])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x45ab5e[_0xab7e('0x78')]))&&_0x45ab5e[_0xab7e('0x88')]){_0x40e8b0=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x45ab5e[_0xab7e('0x78')]);}}return _0x44714d[_0xab7e('0x86')](_0x40e8b0);}})[_0xab7e('0x2a')](handleError(_0x44714d,null));};exports['getSystemAvatar']=function(_0x37f4ec,_0x51ffec,_0x3e1ad0){var _0x36f5ab=path['join'](config[_0xab7e('0x7c')],_0xab7e('0x89'));var _0x8de24e={'where':{'id':_0x37f4ec[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x7a')],'raw':!![]};return db['ChatWebsite'][_0xab7e('0x5d')](_0x8de24e)[_0xab7e('0x20')](handleEntityNotFound(_0x51ffec,null))[_0xab7e('0x20')](function(_0xa9136a){if(_0xa9136a){if(!_[_0xab7e('0x80')](_0xa9136a['systemAvatar'])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/images/avatars/',_0xa9136a[_0xab7e('0x7a')]))){_0x36f5ab=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0xa9136a[_0xab7e('0x7a')]);}}return _0x51ffec[_0xab7e('0x86')](_0x36f5ab);}})[_0xab7e('0x2a')](handleError(_0x51ffec,null));};exports[_0xab7e('0x8a')]=function(_0x393b1d,_0x4a353d,_0x4d845e){var _0x3d7de6=require(_0xab7e('0x8b'));var _0x3373f0=new _0x3d7de6();var _0xa54467=_0x3373f0[_0xab7e('0x8c')](_0x393b1d[_0xab7e('0x8d')][_0xab7e('0x8e')])[_0xab7e('0x8f')]();var _0xbec26d={'body':_0x393b1d['body'],'channel':'chat'};var _0x4fc89d=[];var _0x50ad72=[];var _0x37577e={};var _0x2d7037=![];return db[_0xab7e('0x90')][_0xab7e('0x66')]()[_0xab7e('0x20')](function(_0x16c43a){if(!_0x16c43a){throw new db[(_0xab7e('0x91'))]['ValidationError'](_0xab7e('0x92'));}_0x4fc89d=_[_0xab7e('0x93')](_['keys'](_0x16c43a),[_0xab7e('0x94'),_0xab7e('0x95')]);_0x50ad72=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x16c43a),[_0xab7e('0x94'),_0xab7e('0x95'),_0xab7e('0x96'),_0xab7e('0x97')]);if(_0x393b1d['body']['id']){delete _0x393b1d[_0xab7e('0x5f')]['id'];}if(_[_0xab7e('0x80')](_0x393b1d['body'][_0xab7e('0x98')])){throw new db[(_0xab7e('0x91'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xab7e('0x80')](_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x5f')])||_0x393b1d[_0xab7e('0x5f')]['body']===''){throw new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))](_0xab7e('0x9a'));}if(_[_0xab7e('0x80')](_0x393b1d['body']['mapKey'])){throw new db[(_0xab7e('0x91'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x50ad72);}if(!_['includes'](_0x50ad72,_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x9b')])){throw new db['Sequelize'][(_0xab7e('0x99'))](_0xab7e('0x9c')+_0x50ad72);}_0x37577e[_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x9b')]]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')];})[_0xab7e('0x20')](function(){return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x393b1d['params']['id']},'include':[{'model':db[_0xab7e('0x9d')],'as':'List','include':[{'model':db[_0xab7e('0x90')],'as':'Contacts','where':_0x37577e,'limit':0x1,'order':[[_0xab7e('0x95'),'DESC']]}]},{'model':db[_0xab7e('0x9e')],'as':_0xab7e('0x9f')}]});})['then'](handleEntityNotFound(_0x4a353d,null))[_0xab7e('0x20')](function(_0x4555a1){if(_0x4555a1&&_0x4555a1[_0xab7e('0xa0')]){_0xbec26d[_0xab7e('0xa1')]=_0x4555a1;_0xbec26d[_0xab7e('0xa2')]=_0x4555a1[_0xab7e('0x9f')];_0xbec26d['list']=_0x4555a1[_0xab7e('0xa0')];_0xbec26d[_0xab7e('0xa2')]=_[_0xab7e('0xa3')](_0xbec26d[_0xab7e('0xa2')],['priority'],['asc']);if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0x9f')]){delete _0xbec26d[_0xab7e('0xa1')][_0xab7e('0x9f')];}if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0xa0')]&&_0xbec26d[_0xab7e('0xa1')]['List'][_0xab7e('0xa4')]['length']){return _0xbec26d[_0xab7e('0xa1')][_0xab7e('0xa0')][_0xab7e('0xa4')][0x0];}var _0x5d3907=_[_0xab7e('0x18')](_0x393b1d[_0xab7e('0x5f')],{'firstName':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')],'ListId':_0x4555a1['ListId']});_0x5d3907[_0x393b1d['body'][_0xab7e('0x9b')]]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')];return db[_0xab7e('0x90')][_0xab7e('0x5e')](_0x5d3907,{'fields':_0x4fc89d,'raw':!![]});}})[_0xab7e('0x20')](handleEntityNotFound(_0x4a353d,null))[_0xab7e('0x20')](function(_0x4d0c7a){_0xbec26d[_0xab7e('0xa5')]=_0x4d0c7a;var _0x10d586=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xa6')];if(_0x393b1d['headers']['cf-connecting-ip']){_0x10d586=_0x393b1d[_0xab7e('0x8d')]['cf-connecting-ip'];}else if(_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xa7')]){_0x10d586=_[_0xab7e('0xa8')](_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xa7')][_0xab7e('0xa9')](','));}if(_0x4d0c7a){var _0x1a4ce3={'ContactId':_0x4d0c7a['id'],'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'from':(_0x4d0c7a['firstName']||'')+'\x20'+(_0x4d0c7a['lastName']||''),'customerIp':_0x10d586,'customerPort':_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xaa')]?_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xaa')]:null,'referer':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xab')],'browserName':_0xa54467[_0xab7e('0xac')][_0xab7e('0x39')]&&_0xa54467[_0xab7e('0xac')][_0xab7e('0xad')]?util[_0xab7e('0xae')]('%s\x20%s',_0xa54467[_0xab7e('0xac')][_0xab7e('0x39')],_0xa54467['browser'][_0xab7e('0xad')]):'unknown','browserVersion':_0xa54467[_0xab7e('0xac')][_0xab7e('0xad')]||_0xab7e('0xaf'),'osName':util[_0xab7e('0xae')](_0xab7e('0xb0'),_0xa54467['os'][_0xab7e('0x39')],_0xa54467['os'][_0xab7e('0xad')]),'osVersion':_0xa54467['os']['version'],'deviceModel':_0xa54467[_0xab7e('0xb1')]['model']&&_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')]?util[_0xab7e('0xae')](_0xab7e('0xb3'),_0xa54467['device'][_0xab7e('0x43')],_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')],_0xa54467[_0xab7e('0xb1')][_0xab7e('0x41')]):null,'deviceVendor':_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')],'deviceType':_0xa54467[_0xab7e('0xb1')][_0xab7e('0x41')],'formData':JSON['stringify'](_0x393b1d[_0xab7e('0x5f')])};var _0x791f67={'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'closed':![]};if(_0x393b1d['body'][_0xab7e('0xb4')]){_0x791f67[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb4')];return db[_0xab7e('0xb5')][_0xab7e('0x5d')]({'where':_0x791f67})[_0xab7e('0x20')](function(_0x5294b8){if(_0x5294b8){return[_0x5294b8,![]];}_0x1a4ce3[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')]['threadId'];_0x1a4ce3[_0xab7e('0xb6')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb6')];return db['ChatInteraction']['create'](_0x1a4ce3)[_0xab7e('0x20')](function(_0x2e7f3c){return[_0x2e7f3c,!![]];});});}_0x791f67[_0xab7e('0xb7')]=_0x4d0c7a['id'];if(_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb8')]&&_0x393b1d[_0xab7e('0x5f')]['interaction']['id']){_0x791f67['id']=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb8')]['id'];return db[_0xab7e('0xb5')][_0xab7e('0x5d')]({'where':_0x791f67})[_0xab7e('0x20')](function(_0x222f8a){if(_0x222f8a){return[_0x222f8a,![]];}return db[_0xab7e('0xb5')][_0xab7e('0x5e')](_0x1a4ce3)[_0xab7e('0x20')](function(_0x195685){return[_0x195685,!![]];});});}return db[_0xab7e('0xb5')][_0xab7e('0x5e')](_0x1a4ce3)[_0xab7e('0x20')](function(_0x11c388){return[_0x11c388,!![]];});}})[_0xab7e('0xb9')](function(_0x5d7a03,_0x5f1ef5){if(_0x5d7a03){_0x2d7037=_0x5f1ef5;if(!_0x5f1ef5){var _0x84c1c9={'from':(_0xbec26d[_0xab7e('0xa5')][_0xab7e('0xba')]||'')+'\x20'+(_0xbec26d[_0xab7e('0xa5')][_0xab7e('0xbb')]||'')};if(_0x393b1d['body']['threadId']&&_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xbc')]&&_0x393b1d['body'][_0xab7e('0xb4')]!=_0x393b1d['body']['messageId']){_0x84c1c9[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xbc')];}return _0x5d7a03[_0xab7e('0x65')](_0x84c1c9);}else{return _0x5d7a03;}}})[_0xab7e('0x20')](function(_0x25027f){_0xbec26d[_0xab7e('0xb8')]=_0x25027f['get']({'plain':!![]});_0xbec26d['interaction'][_0xab7e('0xbd')]=_0x2d7037;if(_0xbec26d[_0xab7e('0xb8')][_0xab7e('0xbd')]){if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0xbe')]){_0xbec26d['applications'][_0xab7e('0xbf')]({'id':0x0,'priority':_0xbec26d[_0xab7e('0xa2')][_0xab7e('0x4a')]+0x1,'app':_0xab7e('0xc0'),'appdata':'unmanaged','interval':_0xab7e('0xc1')});}}return db['ChatMessage'][_0xab7e('0x5e')]({'body':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x5f')],'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'ChatInteractionId':_0x25027f['id'],'direction':'in','ContactId':_0xbec26d[_0xab7e('0xa5')]['id'],'AttachmentId':_0x393b1d['body']['AttachmentId']});})[_0xab7e('0x20')](function(_0x54d9aa){_0xbec26d[_0xab7e('0x27')]=_0x54d9aa;if(_0xbec26d[_0xab7e('0xb8')][_0xab7e('0xc2')]){return db[_0xab7e('0xc3')]['find']({'attributes':['id','name'],'where':{'id':_0xbec26d['interaction'][_0xab7e('0xc2')]}})[_0xab7e('0x20')](function(_0xa30c24){if(_0xa30c24){_0xbec26d[_0xab7e('0xa2')][_0xab7e('0xc4')]({'id':0x0,'priority':0x0,'app':_0xab7e('0xc5'),'appdata':_0xa30c24[_0xab7e('0x39')]+','+(_0xbec26d[_0xab7e('0xa1')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0xbec26d['forcedOwnership']=!![];}return respondWithRpcPromise(_0xab7e('0xc6'),'startRouting',_0xbec26d);});}return respondWithRpcPromise(_0xab7e('0xc6'),'startRouting',_0xbec26d);})[_0xab7e('0x20')](function(_0x2645a8){respondWithRpcPromise(_0xab7e('0xc7'),_0xab7e('0xc7'),{'event':'notify','message':_0x2645a8},client9002);return _0x2645a8;})['then'](respondWithResult(_0x4a353d,null))[_0xab7e('0x2a')](handleError(_0x4a353d,null));};exports[_0xab7e('0xc8')]=function(_0x598c63,_0x3e408d,_0xc1209e){var _0x1ad7b0,_0x39087d,_0x4bbe1e;var _0xe70b01=[];var _0x22ae01=[];var _0x3df878={};var _0x42ac81=_0x598c63[_0xab7e('0xc9')]||[];var _0x5911df=[];var _0x279351;return db['CmContact'][_0xab7e('0x66')]()[_0xab7e('0x20')](function(_0x4c1526){if(!_0x4c1526){throw new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))](_0xab7e('0x92'));}_0x22ae01=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x4c1526),[_0xab7e('0x94'),_0xab7e('0x95')]);_0xe70b01=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x4c1526),['createdAt',_0xab7e('0x95'),_0xab7e('0x96'),_0xab7e('0x97')]);if(_0x598c63[_0xab7e('0x5f')]['id']){delete _0x598c63[_0xab7e('0x5f')]['id'];}if(_[_0xab7e('0x80')](_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))]('from\x20is\x20mandatory'));}if(_[_0xab7e('0x80')](_0x598c63['body']['body'])||_0x598c63['body'][_0xab7e('0x5f')]===''){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)['send'](new db[(_0xab7e('0x91'))]['ValidationError'](_0xab7e('0x9a')));}if(_[_0xab7e('0x80')](_0x598c63[_0xab7e('0x5f')][_0xab7e('0xca')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db['Sequelize'][(_0xab7e('0x99'))](_0xab7e('0xcb')+_0xe70b01));}if(!_['includes'](_0xe70b01,_0x598c63['body'][_0xab7e('0xca')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe70b01));}_0x3df878[_0x598c63[_0xab7e('0x5f')][_0xab7e('0xca')]]=_0x598c63[_0xab7e('0x5f')]['from'];})['then'](function(){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x598c63[_0xab7e('0x5c')]['id']},'include':[{'model':db[_0xab7e('0x9d')],'as':_0xab7e('0xa0')},{'model':db[_0xab7e('0xcc')],'as':_0xab7e('0xcc')}]});})[_0xab7e('0x20')](handleEntityNotFound(_0x3e408d,null))[_0xab7e('0x20')](function(_0x5c9b98){if(_0x5c9b98&&_0x5c9b98[_0xab7e('0xa0')]){_0x39087d=_0x5c9b98;var _0x59f1d5=_['defaults'](_0x598c63[_0xab7e('0x5f')],{'firstName':_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')],'phone':_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')],'ListId':_0x5c9b98[_0xab7e('0x97')]});_0x59f1d5[_0x598c63['body'][_0xab7e('0xca')]]=_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')];return db['CmContact'][_0xab7e('0xcd')]({'where':_0x3df878,'defaults':_0x59f1d5});}})[_0xab7e('0xb9')](function(_0x5014c3){if(_0x5014c3){_0x4bbe1e=_0x5014c3;var _0x3a458b=fs[_0xab7e('0xce')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/templates/chatOfflineMessage.ejs'),_0xab7e('0xcf'));var _0x1a34e4=ejs[_0xab7e('0xd0')](_0x3a458b,{'body':_[_0xab7e('0xd1')](_0x598c63['body'][_0xab7e('0x5f')]),'bodyTitle':_0x39087d[_0xab7e('0xd2')]});return db[_0xab7e('0xd3')][_0xab7e('0x5e')]({'body':_0x1a34e4,'ContactId':_0x5014c3['id'],'ChatWebsiteId':_0x39087d['id']});}})[_0xab7e('0x20')](function(_0x26ac22){_0x279351=_0x26ac22;if(_0x42ac81[_0xab7e('0x4a')]){var _0x1a2346=_0x42ac81[_0xab7e('0x3e')](function(_0x25b630){return{'name':_0x25b630[_0xab7e('0xd4')],'basename':_0x25b630[_0xab7e('0x74')],'type':_0x25b630[_0xab7e('0xd5')],'ChatOfflineMessageId':_0x26ac22['id']};});_0x5911df=_0x1a2346[_0xab7e('0x3e')](_0x482503=>{var _0x16ccc1={'filename':_0x482503[_0xab7e('0x39')],'path':path[_0xab7e('0x82')](config['root'],_0xab7e('0xd6'),'files',_0xab7e('0xd7'),_0xab7e('0xd8'),_0x482503['basename'])};return _0x16ccc1;});if(!_0x39087d[_0xab7e('0xd9')]){return db['sequelize'][_0xab7e('0xda')](function(_0x1dd8da){return db[_0xab7e('0xdb')][_0xab7e('0xdc')](_0x1a2346,{'transaction':_0x1dd8da});});}}})[_0xab7e('0x20')](function(){if(_0x279351){_0x1ad7b0=_0x279351;return db[_0xab7e('0xcc')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xab7e('0xdd')],'as':_0xab7e('0xde'),'raw':!![]}]});}})[_0xab7e('0x20')](function(_0x488142){if(_0x488142&&_0x488142['Smtp']&&_0x39087d[_0xab7e('0xdf')]&&_0x39087d[_0xab7e('0xe0')]){var _0x4523dd={'tls':{'rejectUnauthorized':![]}};if(_0x488142[_0xab7e('0xde')][_0xab7e('0xe1')]){_0x4523dd['service']=_0x488142['Smtp']['service'];}else{_0x4523dd['host']=_0x488142[_0xab7e('0xde')][_0xab7e('0xe2')];_0x4523dd[_0xab7e('0xe3')]=_0x488142[_0xab7e('0xde')][_0xab7e('0xe3')];_0x4523dd[_0xab7e('0xe4')]=_0x488142['Smtp'][_0xab7e('0xe4')];}if(_0x488142[_0xab7e('0xde')][_0xab7e('0xe5')]){_0x4523dd[_0xab7e('0xe6')]={'user':_0x488142[_0xab7e('0xde')][_0xab7e('0x60')],'pass':_0x488142[_0xab7e('0xde')][_0xab7e('0xe7')]};}return respondWithRpcPromise(_0xab7e('0xe8'),_0xab7e('0xe9'),{'account':_0x4523dd,'message':{'from':util['format'](_0xab7e('0xea'),_0x488142[_0xab7e('0x39')],_0x488142[_0xab7e('0xeb')]||_0x488142[_0xab7e('0xde')][_0xab7e('0x60')]),'to':_0x39087d[_0xab7e('0xe0')],'subject':_0x39087d[_0xab7e('0xec')],'html':_0x1ad7b0['body'],'attachments':_0x5911df}},client9003)[_0xab7e('0x20')](function(){return _0x1ad7b0;})[_0xab7e('0x2a')](function(_0x429dd3){console[_0xab7e('0x25')](_0x429dd3);});}})[_0xab7e('0x20')](function(){if(_0x39087d&&_0x39087d['openNewInteraction']&&_0x39087d[_0xab7e('0xed')]){var _0x3fe803=[];if(_0x42ac81[_0xab7e('0x4a')]){_0x3fe803=_0x42ac81[_0xab7e('0x3e')](function(_0x22c4bc){return{'name':_0x22c4bc[_0xab7e('0xd4')],'basename':_0x22c4bc[_0xab7e('0x74')],'type':_0x22c4bc[_0xab7e('0xd5')],'ChatOfflineMessageId':_0x279351['id']};});}var _0x7c85e8;if(!_[_0xab7e('0x80')](_0x39087d[_0xab7e('0xee')])){var _0x14e774=_[_0xab7e('0x3e')](_0x598c63['body'],function(_0x15f917){return _0x15f917;});var _0x19af67=_[_0xab7e('0xef')](_0x14e774)[0x0];var _0x17a2d1=_[_0xab7e('0xf0')](_0x19af67,function(_0x2fbe2e){return _0x2fbe2e;});_0x7c85e8=_0x17a2d1[0x1][_0x39087d[_0xab7e('0xee')]];}var _0xeba857={'from':_0x4bbe1e['email'],'firstName':_0x4bbe1e[_0xab7e('0xba')],'lastName':_0x4bbe1e['lastName'],'mapKey':_0xab7e('0xeb'),'message':{'from':_0x4bbe1e[_0xab7e('0xeb')],'to':_0x39087d[_0xab7e('0xcc')][_0xab7e('0xeb')],'cc':'','subject':_[_0xab7e('0x80')](_0x7c85e8)?_0x39087d[_0xab7e('0xec')]:_0x7c85e8,'messageId':'','sentAt':new Date(),'attach':_0x3fe803['length'],'attachments':_0x3fe803,'originChannel':'Chat','ChatWebsiteId':_0x39087d['id'],'ChatOfflineMessageId':_0x1ad7b0['id'],'originTo':_0x39087d[_0xab7e('0xcc')][_0xab7e('0xeb')]},'body':_0x1ad7b0[_0xab7e('0x5f')]};var _0x39b3bb={'account':{'id':_0x39087d[_0xab7e('0xed')]},'body':_0xeba857,'log':_0xab7e('0xf1')};return respondWithRpcPromise(_0xab7e('0xf1'),_0xab7e('0xf2'),_0x39b3bb,client9001)[_0xab7e('0x20')](function(){return _0x1ad7b0;})[_0xab7e('0x2a')](function(_0x2199f8){console[_0xab7e('0x25')](_0x2199f8);});}return;})[_0xab7e('0x20')](function(){if(_0x1ad7b0){return _0x1ad7b0;}})['then'](respondWithResult(_0x3e408d,null))[_0xab7e('0x2a')](function(_0x3e23c1){console[_0xab7e('0x25')]('catch',_0x3e23c1);for(var _0x269467 of _0x42ac81){var _0x2aa049=path[_0xab7e('0x82')](config['root'],'server',_0xab7e('0xc9'),_0xab7e('0xd7'),_0xab7e('0xd8'),_0x269467[_0xab7e('0x74')]);fs_extra[_0xab7e('0xf3')](_0x2aa049)[_0xab7e('0x2a')](function(_0x4b56fe){console[_0xab7e('0x25')](_0xab7e('0xf4'),_0x2aa049,_0x4b56fe);});}});};exports['addInteraction']=function(_0x468f81,_0x12ea06,_0xc02cdc){return db[_0xab7e('0xb5')]['find']({'where':{'id':_0x468f81['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x12ea06,null))['then'](function(_0xa7b65b){if(_0xa7b65b){return _0xa7b65b[_0xab7e('0xf5')](_0x468f81['body'][_0xab7e('0x70')],_['omit'](_0x468f81[_0xab7e('0x5f')],['ids','id'])||{});}})[_0xab7e('0x20')](respondWithResult(_0x12ea06,null))['catch'](handleError(_0x12ea06,null));};exports[_0xab7e('0xf6')]=function(_0x2d1e5d,_0xe8f8b2,_0xd3d5cc){var _0x4402ad={'raw':![],'where':{}};var _0x3f2877={};var _0x1f4c61={'count':0x0,'rows':[]};return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x2d1e5d[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0xe8f8b2,null))[_0xab7e('0x20')](function(_0x3e5c21){if(_0x3e5c21){_0x3f2877[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatInteraction'][_0xab7e('0x3f')]);_0x3f2877[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x2d1e5d['query']);_0x3f2877['filters']=_['intersection'](_0x3f2877[_0xab7e('0x43')],_0x3f2877[_0xab7e('0x44')]);_0x4402ad[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x3f2877[_0xab7e('0x43')],qs['fields'](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x48')]));_0x4402ad[_0xab7e('0x49')]=_0x4402ad['attributes'][_0xab7e('0x4a')]?_0x4402ad[_0xab7e('0x49')]:_0x3f2877['model'];if(!_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x4b')]('nolimit')){_0x4402ad['limit']=qs[_0xab7e('0x4d')](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x4402ad[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x4402ad['order']=qs[_0xab7e('0x4f')](_0x2d1e5d[_0xab7e('0x44')]['sort']);_0x4402ad[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x2d1e5d['query'],_0x3f2877[_0xab7e('0x46')]));_0x4402ad[_0xab7e('0x50')][_0xab7e('0x68')]=_0x3e5c21['id'];if(_0x2d1e5d['query'][_0xab7e('0x54')]){_0x4402ad[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x4402ad[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x4402ad[_0xab7e('0x49')],function(_0x25f246){var _0x5cba7b={};_0x5cba7b[_0x25f246]={'$like':'%'+_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x5cba7b;})});}_0x4402ad=_[_0xab7e('0x52')]({},_0x4402ad,_0x2d1e5d['options']);return db[_0xab7e('0xb5')]['count']({'where':_0x4402ad[_0xab7e('0x50')]})[_0xab7e('0x20')](function(_0x236b95){_0x1f4c61[_0xab7e('0x31')]=_0x236b95;if(_0x2d1e5d['query'][_0xab7e('0x57')]){_0x4402ad[_0xab7e('0x58')]=[{'model':db[_0xab7e('0x90')],'as':'Contact','required':![]},{'model':db[_0xab7e('0xc3')],'as':'Owner','attributes':[_0xab7e('0x39'),_0xab7e('0xf7'),'internal'],'required':![]},{'model':db[_0xab7e('0xf8')],'as':_0xab7e('0xf9'),'attributes':['id',_0xab7e('0x39'),_0xab7e('0xfa')],'where':_0x2d1e5d[_0xab7e('0x44')]['tag']?{'id':_0x2d1e5d[_0xab7e('0x44')]['tag']}:undefined,'required':_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0xfb')]?!![]:![]}];}return db[_0xab7e('0xb5')][_0xab7e('0x59')](_0x4402ad);})[_0xab7e('0x20')](function(_0x329c00){_0x1f4c61['rows']=_0x329c00;return _0x1f4c61;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0xe8f8b2,_0x4402ad))[_0xab7e('0x2a')](handleError(_0xe8f8b2,null));};function iftimePromise(_0x201a8c,_0x38b436){return respondWithRpcPromise(_0xab7e('0xfc'),_0xab7e('0xfd'),{'command':_0x38b436[_0xab7e('0xfe')]?util['format'](_0xab7e('0xff'),_0x201a8c[_0xab7e('0x100')],_0x38b436['timezone']):util[_0xab7e('0xae')](_0xab7e('0x101'),_0x201a8c[_0xab7e('0x100')])},client9002)[_0xab7e('0x20')](function(_0x201222){var _0x37a6a1=_0x201222&&_0x201222[_0xab7e('0x102')]('true')>=0x0?!![]:![];logger[_0xab7e('0x28')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x38b436['id'],_0x201a8c['id'],_0x201a8c['interval'],_0x37a6a1?_0xab7e('0x103'):_0xab7e('0x104'),_0x38b436['timezone']?_0x38b436[_0xab7e('0xfe')]:_0xab7e('0x105'));return _0x37a6a1;})[_0xab7e('0x2a')](function(_0x3ff952){logger[_0xab7e('0x25')](_0xab7e('0x106'),_0x38b436['id'],_0x201a8c['id'],_0x201a8c['interval'],util[_0xab7e('0x107')](_0x3ff952,{'showHidden':![],'depth':null}),_0x38b436[_0xab7e('0xfe')]?_0x38b436[_0xab7e('0xfe')]:'No\x20timezone');return![];});}exports[_0xab7e('0xfd')]=function(_0x38b44b,_0x20eacd,_0x47494b){var _0x417709=0x0;var _0x5a51ad=0x0;var _0x53a365=![];var _0x3cb9cb;var _0x5e4bd1;return db[_0xab7e('0x56')]['find']({'where':{'id':_0x38b44b[_0xab7e('0x5c')]['id']},'include':[{'model':db[_0xab7e('0x108')],'as':_0xab7e('0x108'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xab7e('0x100')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20eacd,null))[_0xab7e('0x20')](function(_0x1fa7c2){if(_0x1fa7c2){_0x3cb9cb=_0x1fa7c2;return _0x1fa7c2['getProactiveActions']({'raw':!![]});}})[_0xab7e('0x20')](function(_0x145178){if(_0x3cb9cb){if(_0x145178){_0x5e4bd1=_0x145178;}}return require(_0xab7e('0x15'))[_0xab7e('0x7e')]();})[_0xab7e('0x20')](function(_0x1ec21e){if(_0x1ec21e){_0x5a51ad=_0x1ec21e[_0xab7e('0x109')];_0x53a365=_0x1ec21e[_0xab7e('0x7f')];}})['then'](function(){return db[_0xab7e('0xb5')][_0xab7e('0x31')]({'where':{'closed':![]}});})[_0xab7e('0x20')](function(_0x1bfec0){_0x417709=_0x1bfec0;if(_0x5a51ad&&_0x1bfec0>_0x5a51ad){return db[_0xab7e('0x10a')][_0xab7e('0x6a')]({'where':{'id':0x1}})[_0xab7e('0x20')](function(_0x2c41c7){if(_0x2c41c7){_0x2c41c7[_0xab7e('0x10b')](_0xab7e('0x10c'));}});}})[_0xab7e('0x20')](function(){if(_0x3cb9cb['Interval']&&_0x3cb9cb['Interval'][_0xab7e('0x10d')]){var _0x15cd95=[];for(var _0x50fe9a=0x0;_0x50fe9a<_0x3cb9cb[_0xab7e('0x108')][_0xab7e('0x10d')][_0xab7e('0x4a')];_0x50fe9a++){var _0x2f26da=_0x3cb9cb[_0xab7e('0x108')][_0xab7e('0x10d')][_0x50fe9a][_0xab7e('0x34')]({'plain':!![]});_0x15cd95[_0xab7e('0xbf')](iftimePromise(_0x2f26da,_0x3cb9cb));}return BPromise[_0xab7e('0x10e')](_0x15cd95)['then'](function(_0x37d156){return _[_0xab7e('0x10f')](_0x37d156);});}else{return!![];}})[_0xab7e('0x20')](function(_0x235688){var _0x30a3bf=fs['readFileSync'](path['join'](config[_0xab7e('0x7c')],_0xab7e('0x110')),_0xab7e('0xcf'));var _0x540e2c={'remote':_0x3cb9cb[_0xab7e('0x111')],'query':querystring[_0xab7e('0x24')](_['merge'](_0x3cb9cb['get']({'plain':!![]}),{'customerIp':_0x38b44b[_0xab7e('0x8d')]['x-forwarded-for']||_0x38b44b[_0xab7e('0x8d')][_0xab7e('0x112')]||_0x38b44b[_0xab7e('0x113')][_0xab7e('0x114')]||_0x38b44b['ip'],'referer':_0x38b44b[_0xab7e('0x8d')][_0xab7e('0xab')],'openedInteractions':_0x417709,'maxInteractions':_0x5a51ad,'virtual':_0x53a365[_0xab7e('0x109')],'online':_0x235688,'custom':_0x53a365}))[_0xab7e('0x115')](/'/g,'\x5c\x27')};_0x20eacd[_0xab7e('0x3a')](ejs['render'](Mustache[_0xab7e('0xd0')](_0x30a3bf,_0x540e2c),{'proactiveActions':_0x5e4bd1,'alignment':_0x3cb9cb[_0xab7e('0x116')],'verticalAlignment':_0x3cb9cb['verticalAlignment'],'div_color':_0x3cb9cb[_0xab7e('0xfa')],'text_color':_0x3cb9cb[_0xab7e('0x117')],'button_color':_0x3cb9cb['color_button'],'background_color':_0x3cb9cb[_0xab7e('0x118')]}));})[_0xab7e('0x2a')](handleError(_0x20eacd,null));};exports[_0xab7e('0x119')]=function(_0x4240c1,_0x5f16e8,_0x51a01d){return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x4240c1[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x5f16e8,null))['then'](function(_0x71534d){if(_0x71534d){return db['sequelize'][_0xab7e('0xda')](function(_0x532006){return db[_0xab7e('0x9e')][_0xab7e('0x37')]({'where':{'ChatWebsiteId':_0x4240c1[_0xab7e('0x5c')]['id']},'transaction':_0x532006})['then'](function(_0x45ea0a){var _0x5ae05f=_[_0xab7e('0x3e')](_0x4240c1[_0xab7e('0x5f')],function(_0x3c7eda){_0x3c7eda[_0xab7e('0x68')]=_0x4240c1[_0xab7e('0x5c')]['id'];return _0x3c7eda;});return db[_0xab7e('0x9e')]['bulkCreate'](_0x5ae05f,{'transaction':_0x532006});});})['then'](function(){return db['ChatApplication'][_0xab7e('0x11a')]({'where':{'ChatWebsiteId':_0x4240c1[_0xab7e('0x5c')]['id']},'order':_0xab7e('0x11b')});});}})[_0xab7e('0x20')](respondWithResult(_0x5f16e8,null))[_0xab7e('0x2a')](handleError(_0x5f16e8,null));};exports[_0xab7e('0x11c')]=function(_0x24d72e,_0x245169,_0x4fc3a1){var _0x187957={};var _0x2a3691={};var _0xcfb6a0;var _0x2c8e57;return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x24d72e[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x245169,null))[_0xab7e('0x20')](function(_0x41cf53){if(_0x41cf53){_0xcfb6a0=_0x41cf53;_0x2a3691[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatApplication'][_0xab7e('0x3f')]);_0x2a3691['query']=_[_0xab7e('0x45')](_0x24d72e[_0xab7e('0x44')]);_0x2a3691[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x2a3691[_0xab7e('0x43')],_0x2a3691[_0xab7e('0x44')]);_0x187957[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x2a3691['model'],qs[_0xab7e('0x48')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x48')]));_0x187957[_0xab7e('0x49')]=_0x187957[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x187957['attributes']:_0x2a3691[_0xab7e('0x43')];_0x187957[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x187957[_0xab7e('0x50')]=qs['filters'](_[_0xab7e('0x51')](_0x24d72e[_0xab7e('0x44')],_0x2a3691['filters']));if(_0x24d72e[_0xab7e('0x44')][_0xab7e('0x54')]){_0x187957[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x187957[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x187957[_0xab7e('0x49')],function(_0x45fab6){var _0x23d8c7={};_0x23d8c7[_0x45fab6]={'$like':'%'+_0x24d72e['query'][_0xab7e('0x54')]+'%'};return _0x23d8c7;})});}_0x187957=_[_0xab7e('0x52')]({},_0x187957,_0x24d72e[_0xab7e('0x55')]);return _0xcfb6a0[_0xab7e('0x11c')](_0x187957);}})[_0xab7e('0x20')](function(_0x19d388){if(_0x19d388){_0x2c8e57=_0x19d388[_0xab7e('0x4a')];if(!_0x24d72e[_0xab7e('0x44')]['hasOwnProperty'](_0xab7e('0x4c'))){_0x187957[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x187957[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x2f')]);}return _0xcfb6a0[_0xab7e('0x11c')](_0x187957);}})[_0xab7e('0x20')](function(_0xcda0c2){if(_0xcda0c2){return _0xcda0c2?{'count':_0x2c8e57,'rows':_0xcda0c2}:null;}})[_0xab7e('0x20')](respondWithResult(_0x245169,null))[_0xab7e('0x2a')](handleError(_0x245169,null));};exports[_0xab7e('0x11d')]=function(_0x4923f6,_0x1789fe,_0x290b52){return db['chatProactiveAction']['find']({'where':{'id':_0x4923f6[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1789fe,null))[_0xab7e('0x20')](function(_0x2e5937){if(_0x2e5937){return _0x2e5937[_0xab7e('0x11d')](_0x4923f6['body'][_0xab7e('0x70')],_[_0xab7e('0x11e')](_0x4923f6['body'],[_0xab7e('0x70'),'id'])||{});}})[_0xab7e('0x20')](respondWithResult(_0x1789fe,null))[_0xab7e('0x2a')](handleError(_0x1789fe,null));};exports[_0xab7e('0x11f')]=function(_0x59a5e4,_0x56b15e,_0x39242b){var _0x14e08b={};var _0x5b2b3a={};var _0x1a12bd;var _0x486986;return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x59a5e4['params']['id']}})['then'](handleEntityNotFound(_0x56b15e,null))[_0xab7e('0x20')](function(_0x431b78){if(_0x431b78){_0x1a12bd=_0x431b78;_0x5b2b3a[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatProactiveAction'][_0xab7e('0x3f')]);_0x5b2b3a[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x59a5e4[_0xab7e('0x44')]);_0x5b2b3a[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x5b2b3a[_0xab7e('0x43')],_0x5b2b3a[_0xab7e('0x44')]);_0x14e08b[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x5b2b3a[_0xab7e('0x43')],qs['fields'](_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x48')]));_0x14e08b[_0xab7e('0x49')]=_0x14e08b[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x14e08b[_0xab7e('0x49')]:_0x5b2b3a['model'];_0x14e08b[_0xab7e('0x4e')]=qs['sort'](_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x14e08b[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x59a5e4[_0xab7e('0x44')],_0x5b2b3a[_0xab7e('0x46')]));if(_0x59a5e4['query'][_0xab7e('0x54')]){_0x14e08b[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x14e08b[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x14e08b[_0xab7e('0x49')],function(_0xe55f5b){var _0xaadb8e={};_0xaadb8e[_0xe55f5b]={'$like':'%'+_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0xaadb8e;})});}_0x14e08b=_[_0xab7e('0x52')]({},_0x14e08b,_0x59a5e4[_0xab7e('0x55')]);return _0x1a12bd[_0xab7e('0x11f')](_0x14e08b);}})['then'](function(_0x49b934){if(_0x49b934){_0x486986=_0x49b934[_0xab7e('0x4a')];if(!_0x59a5e4[_0xab7e('0x44')]['hasOwnProperty'](_0xab7e('0x4c'))){_0x14e08b[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x59a5e4['query'][_0xab7e('0x4d')]);_0x14e08b[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x59a5e4['query'][_0xab7e('0x2f')]);}return _0x1a12bd[_0xab7e('0x11f')](_0x14e08b);}})[_0xab7e('0x20')](function(_0x33b986){if(_0x33b986){return _0x33b986?{'count':_0x486986,'rows':_0x33b986}:null;}})[_0xab7e('0x20')](respondWithResult(_0x56b15e,null))['catch'](handleError(_0x56b15e,null));};exports['getFields']=function(_0x51dd89,_0x4b514d,_0x57b5f8){var _0x41ec3a=_0x51dd89[_0xab7e('0x44')][_0xab7e('0x120')]===_0xab7e('0x121')?_0xab7e('0x122'):'onlineForm';return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'attributes':['id',_0x41ec3a],'where':{'id':_0x51dd89[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4b514d,null))[_0xab7e('0x20')](function(_0x343ce5){if(_0x343ce5){var _0x3ab911=_0x343ce5[_0x41ec3a];var _0x1d4b2f=_0x3ab911&&_0x3ab911['items']?_0x3ab911[_0xab7e('0x123')]:[];_0x4b514d[_0xab7e('0x3a')]({'fromKey':_[_0xab7e('0x80')](_0x3ab911[_0xab7e('0x124')])?undefined:_0x3ab911[_0xab7e('0x124')],'count':_0x1d4b2f[_0xab7e('0x4a')],'rows':_0x1d4b2f});}})[_0xab7e('0x2a')](handleError(_0x4b514d,null));};exports[_0xab7e('0x125')]=function(_0x300372,_0x261d33,_0x1644b7){var _0x3a7b9d={'raw':![],'where':{}};var _0x4f49cc={};var _0x4fdfcc={'count':0x0,'rows':[]};return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x300372[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x261d33,null))[_0xab7e('0x20')](function(_0x49d4e7){if(_0x49d4e7){_0x4f49cc[_0xab7e('0x43')]=_[_0xab7e('0x45')](db[_0xab7e('0xd3')]['rawAttributes']);_0x4f49cc[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x300372[_0xab7e('0x44')]);_0x4f49cc['filters']=_[_0xab7e('0x47')](_0x4f49cc[_0xab7e('0x43')],_0x4f49cc[_0xab7e('0x44')]);_0x3a7b9d[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x4f49cc['model'],qs[_0xab7e('0x48')](_0x300372[_0xab7e('0x44')][_0xab7e('0x48')]));_0x3a7b9d[_0xab7e('0x49')]=_0x3a7b9d[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x3a7b9d[_0xab7e('0x49')]:_0x4f49cc[_0xab7e('0x43')];if(!_0x300372['query'][_0xab7e('0x4b')]('nolimit')){_0x3a7b9d[_0xab7e('0x4d')]=qs['limit'](_0x300372[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x3a7b9d[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x300372[_0xab7e('0x44')]['offset']);}_0x3a7b9d[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x300372[_0xab7e('0x44')]['sort']);_0x3a7b9d[_0xab7e('0x50')]=qs['filters'](_[_0xab7e('0x51')](_0x300372[_0xab7e('0x44')],_0x4f49cc[_0xab7e('0x46')]));_0x3a7b9d['where']['ChatWebsiteId']=_0x49d4e7['id'];if(_0x300372[_0xab7e('0x44')]['filter']){_0x3a7b9d[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x3a7b9d[_0xab7e('0x50')],{'$or':_['map'](_0x3a7b9d['attributes'],function(_0x53dcc3){var _0x71e39a={};_0x71e39a[_0x53dcc3]={'$like':'%'+_0x300372[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x71e39a;})});}_0x3a7b9d=_['merge']({},_0x3a7b9d,_0x300372[_0xab7e('0x55')]);return db[_0xab7e('0xd3')][_0xab7e('0x31')]({'where':_0x3a7b9d['where']})[_0xab7e('0x20')](function(_0x3fd9c7){_0x4fdfcc['count']=_0x3fd9c7;if(_0x300372['query'][_0xab7e('0x57')]){_0x3a7b9d[_0xab7e('0x58')]=[{'all':!![]}];}else{_0x3a7b9d['include']=[{'model':db[_0xab7e('0x90')],'as':_0xab7e('0x126'),'required':![]},{'model':db[_0xab7e('0xdb')],'as':'Attachments','required':![]}];}return db[_0xab7e('0xd3')]['findAll'](_0x3a7b9d);})[_0xab7e('0x20')](function(_0xa90a97){_0x4fdfcc[_0xab7e('0x5a')]=_0xa90a97;return _0x4fdfcc;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0x261d33,_0x3a7b9d))[_0xab7e('0x2a')](handleError(_0x261d33,null));};exports[_0xab7e('0x127')]=function(_0x4fc0df,_0x27995c,_0x4e0e10){return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x4fc0df[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x27995c,null))[_0xab7e('0x20')](function(_0x5f10b0){if(_0x5f10b0){return _0x5f10b0[_0xab7e('0x127')](_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')],_[_0xab7e('0x11e')](_0x4fc0df['body'],['ids','id'])||{})[_0xab7e('0xb9')](function(_0xfc4710){for(var _0x661b99=0x0;_0x661b99<_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')][_0xab7e('0x4a')];_0x661b99+=0x1){socket[_0xab7e('0x128')](_0xab7e('0x129'),{'UserId':Number(_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')][_0x661b99]),'ChatWebsiteId':Number(_0x4fc0df['params']['id'])});}return _0xfc4710;});}})[_0xab7e('0x20')](respondWithResult(_0x27995c,null))[_0xab7e('0x2a')](handleError(_0x27995c,null));};exports['removeAgents']=function(_0x39f782,_0x54ef60,_0x30f4ae){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x39f782['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x54ef60,null))[_0xab7e('0x20')](function(_0x378f37){if(_0x378f37){return _0x378f37[_0xab7e('0x12a')](_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')])[_0xab7e('0x20')](function(){if(_[_0xab7e('0x12b')](_0x39f782[_0xab7e('0x44')]['ids'])){for(var _0x170ac4=0x0;_0x170ac4<_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')]['length'];_0x170ac4+=0x1){socket[_0xab7e('0x128')](_0xab7e('0x12c'),{'UserId':Number(_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')][_0x170ac4]),'ChatWebsiteId':Number(_0x39f782[_0xab7e('0x5c')]['id'])});}}else{socket[_0xab7e('0x128')](_0xab7e('0x12c'),{'UserId':Number(_0x39f782['query']['ids']),'ChatWebsiteId':Number(_0x39f782[_0xab7e('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x54ef60,null))[_0xab7e('0x2a')](handleError(_0x54ef60,null));};exports[_0xab7e('0x12d')]=function(_0x5c75c9,_0x4d7d6c,_0x4176d6){var _0x4de977={};var _0x1a9534={};var _0xf113a9;var _0x3a9c06;return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x5c75c9['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4d7d6c,null))[_0xab7e('0x20')](function(_0x40575a){if(_0x40575a){_0xf113a9=_0x40575a;_0x1a9534[_0xab7e('0x43')]=_[_0xab7e('0x45')](db[_0xab7e('0xc3')]['rawAttributes']);_0x1a9534['query']=_['keys'](_0x5c75c9[_0xab7e('0x44')]);_0x1a9534['filters']=_[_0xab7e('0x47')](_0x1a9534[_0xab7e('0x43')],_0x1a9534[_0xab7e('0x44')]);_0x4de977[_0xab7e('0x49')]=_['intersection'](_0x1a9534[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x5c75c9['query'][_0xab7e('0x48')]));_0x4de977[_0xab7e('0x49')]=_0x4de977[_0xab7e('0x49')]['length']?_0x4de977[_0xab7e('0x49')]:_0x1a9534[_0xab7e('0x43')];_0x4de977[_0xab7e('0x4e')]=qs['sort'](_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x4de977[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x5c75c9[_0xab7e('0x44')],_0x1a9534[_0xab7e('0x46')]));if(_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x54')]){_0x4de977['where']=_[_0xab7e('0x52')](_0x4de977[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x4de977[_0xab7e('0x49')],function(_0xd2a692){var _0x10c4be={};_0x10c4be[_0xd2a692]={'$like':'%'+_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x10c4be;})});}_0x4de977=_[_0xab7e('0x52')]({},_0x4de977,_0x5c75c9[_0xab7e('0x55')]);return _0xf113a9['getAgents'](_0x4de977);}})[_0xab7e('0x20')](function(_0x4e838a){if(_0x4e838a){_0x3a9c06=_0x4e838a[_0xab7e('0x4a')];if(!_0x5c75c9['query'][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x4de977['limit']=qs[_0xab7e('0x4d')](_0x5c75c9['query'][_0xab7e('0x4d')]);_0x4de977[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x5c75c9[_0xab7e('0x44')]['offset']);}return _0xf113a9[_0xab7e('0x12d')](_0x4de977);}})[_0xab7e('0x20')](function(_0x19eaf7){if(_0x19eaf7){return _0x19eaf7?{'count':_0x3a9c06,'rows':_0x19eaf7}:null;}})['then'](respondWithResult(_0x4d7d6c,null))['catch'](handleError(_0x4d7d6c,null));};
\ No newline at end of file
+var _0x5453=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','find','create','body','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','getDispositions','hasOwnProperty','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','describe','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','asc','account','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','ContactId','interaction','spread','contact','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','*,*,*,*','forcedOwnership','Start','EventManager','offline','files','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','push','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','color','textColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','reject','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x1cd0cd,_0x3f10fa){var _0x46405d=function(_0x97dcc0){while(--_0x97dcc0){_0x1cd0cd['push'](_0x1cd0cd['shift']());}};_0x46405d(++_0x3f10fa);}(_0x5453,0xe9));var _0x3545=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5453[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x3545('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3545('0x1'));var jsonpatch=require(_0x3545('0x2'));var rp=require(_0x3545('0x3'));var moment=require(_0x3545('0x4'));var BPromise=require(_0x3545('0x5'));var Mustache=require(_0x3545('0x6'));var util=require('util');var path=require(_0x3545('0x7'));var sox=require(_0x3545('0x8'));var csv=require('to-csv');var ejs=require(_0x3545('0x9'));var fs=require('fs');var fs_extra=require(_0x3545('0xa'));var _=require(_0x3545('0xb'));var squel=require(_0x3545('0xc'));var crypto=require(_0x3545('0xd'));var jsforce=require(_0x3545('0xe'));var deskjs=require(_0x3545('0xf'));var toCsv=require(_0x3545('0x10'));var querystring=require(_0x3545('0x11'));var Papa=require(_0x3545('0x12'));var Redis=require(_0x3545('0x13'));var authService=require(_0x3545('0x14'));var qs=require(_0x3545('0x15'));var as=require(_0x3545('0x16'));var hardwareService=require(_0x3545('0x17'));var logger=require(_0x3545('0x18'))(_0x3545('0x19'));var utils=require('../../config/utils');var config=require(_0x3545('0x1a'));var licenseUtil=require(_0x3545('0x1b'));var db=require('../../mysqldb')['db'];config[_0x3545('0x1c')]=_[_0x3545('0x1d')](config[_0x3545('0x1c')],{'host':_0x3545('0x1e'),'port':0x18eb});var socket=require(_0x3545('0x1f'))(new Redis(config[_0x3545('0x1c')]));require(_0x3545('0x20'))[_0x3545('0x21')](socket);var jayson=require(_0x3545('0x22'));var client=jayson[_0x3545('0x23')][_0x3545('0x24')]({'port':0x232c});var client9002=jayson['client'][_0x3545('0x24')]({'port':0x232a});var client9003=jayson[_0x3545('0x23')][_0x3545('0x24')]({'port':0x232b});var client9001=jayson[_0x3545('0x23')][_0x3545('0x24')]({'port':0x2329});function respondWithRpcPromise(_0x5e946f,_0x402e52,_0x2bc606,_0x503359){return new BPromise(function(_0x3b43c1,_0x378561){var _0x2e589e=_0x503359||client;return _0x2e589e[_0x3545('0x25')](_0x5e946f,_0x2bc606)[_0x3545('0x26')](function(_0x2d6965){logger[_0x3545('0x27')](_0x3545('0x28'),_0x402e52,_0x3545('0x29'));logger[_0x3545('0x2a')](_0x3545('0x2b'),_0x402e52,_0x3545('0x29'),JSON[_0x3545('0x2c')](_0x2d6965));if(_0x2d6965['error']){if(_0x2d6965[_0x3545('0x2d')][_0x3545('0x2e')]===0x1f4){logger[_0x3545('0x2d')](_0x3545('0x28'),_0x402e52,_0x2d6965[_0x3545('0x2d')][_0x3545('0x2f')]);return _0x378561(_0x2d6965[_0x3545('0x2d')]['message']);}logger[_0x3545('0x2d')]('ChatWebsite,\x20%s,\x20%s',_0x402e52,_0x2d6965[_0x3545('0x2d')]['message']);return _0x3b43c1(_0x2d6965[_0x3545('0x2d')][_0x3545('0x2f')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x402e52,_0x3545('0x29'));_0x3b43c1(_0x2d6965[_0x3545('0x30')][_0x3545('0x2f')]);}})[_0x3545('0x31')](function(_0x349f7a){logger[_0x3545('0x2d')](_0x3545('0x28'),_0x402e52,_0x349f7a);_0x378561(_0x349f7a);});});}function respondWithStatusCode(_0x228479,_0x2f5391){_0x2f5391=_0x2f5391||0xcc;return function(_0x259574){if(_0x259574){return _0x228479[_0x3545('0x32')](_0x2f5391);}return _0x228479['status'](_0x2f5391)[_0x3545('0x33')]();};}function respondWithResult(_0x8c3853,_0x8062de){_0x8062de=_0x8062de||0xc8;return function(_0x46b86c){if(_0x46b86c){return _0x8c3853[_0x3545('0x34')](_0x8062de)[_0x3545('0x35')](_0x46b86c);}};}function respondWithFilteredResult(_0x4a8443,_0x4000d5){return function(_0x38aa82){if(_0x38aa82){var _0x83a6f7=typeof _0x4000d5[_0x3545('0x36')]==='undefined'&&typeof _0x4000d5[_0x3545('0x37')]===_0x3545('0x38');var _0x33768b=_0x38aa82['count'];var _0x532c8b=_0x83a6f7?0x0:_0x4000d5[_0x3545('0x36')];var _0x10e1e2=_0x83a6f7?_0x38aa82[_0x3545('0x39')]:_0x4000d5[_0x3545('0x36')]+_0x4000d5[_0x3545('0x37')];var _0x25c0dd;if(_0x10e1e2>=_0x33768b){_0x10e1e2=_0x33768b;_0x25c0dd=0xc8;}else{_0x25c0dd=0xce;}_0x4a8443['status'](_0x25c0dd);return _0x4a8443['set'](_0x3545('0x3a'),_0x532c8b+'-'+_0x10e1e2+'/'+_0x33768b)[_0x3545('0x35')](_0x38aa82);}return null;};}function patchUpdates(_0x3ebeae){return function(_0x498025){try{jsonpatch['apply'](_0x498025,_0x3ebeae,!![]);}catch(_0x40c1fd){return BPromise[_0x3545('0x3b')](_0x40c1fd);}return _0x498025['save']();};}function saveUpdates(_0x42b834,_0x23a463){return function(_0x147b34){if(_0x147b34){return _0x147b34[_0x3545('0x3c')](_0x42b834)[_0x3545('0x26')](function(_0x11faf1){return _0x11faf1;});}return null;};}function removeEntity(_0x1ab8d2,_0x290210){return function(_0x31b46e){if(_0x31b46e){return _0x31b46e[_0x3545('0x3d')]()[_0x3545('0x26')](function(){var _0x4e6ff8=_0x31b46e[_0x3545('0x3e')]({'plain':!![]});var _0x120872=_0x3545('0x3f');return db[_0x3545('0x40')][_0x3545('0x3d')]({'where':{'type':_0x120872,'resourceId':_0x4e6ff8['id']}})[_0x3545('0x26')](function(){return _0x31b46e;});})[_0x3545('0x26')](function(){_0x1ab8d2['status'](0xcc)[_0x3545('0x33')]();});}};}function handleEntityNotFound(_0x6315b7,_0x1859b1){return function(_0x31cff2){if(!_0x31cff2){_0x6315b7[_0x3545('0x32')](0x194);}return _0x31cff2;};}function handleError(_0x1650ca,_0x457673){_0x457673=_0x457673||0x1f4;return function(_0xb52275){logger[_0x3545('0x2d')](_0xb52275[_0x3545('0x41')]);if(_0xb52275['name']){delete _0xb52275[_0x3545('0x42')];}_0x1650ca[_0x3545('0x34')](_0x457673)[_0x3545('0x43')](_0xb52275);};}exports[_0x3545('0x44')]=function(_0x9c1c7b,_0x20c73f){var _0x27fb48={'include':[{'model':db['Pause'],'as':_0x3545('0x45')}]},_0x89a442={},_0x9fa387={'count':0x0,'rows':[]};var _0x4765c8=_[_0x3545('0x46')](db[_0x3545('0x47')][_0x3545('0x48')],function(_0x35f972){return{'name':_0x35f972[_0x3545('0x49')],'type':_0x35f972[_0x3545('0x4a')]['key']};});_0x89a442[_0x3545('0x4b')]=_[_0x3545('0x46')](_0x4765c8,_0x3545('0x42'));_0x89a442[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0x9c1c7b[_0x3545('0x4c')]);_0x89a442[_0x3545('0x4e')]=_[_0x3545('0x4f')](_0x89a442[_0x3545('0x4b')],_0x89a442['query']);_0x27fb48[_0x3545('0x50')]=_[_0x3545('0x4f')](_0x89a442['model'],qs['fields'](_0x9c1c7b[_0x3545('0x4c')][_0x3545('0x51')]));_0x27fb48[_0x3545('0x50')]=_0x27fb48['attributes'][_0x3545('0x52')]?_0x27fb48['attributes']:_0x89a442[_0x3545('0x4b')];if(!_0x9c1c7b[_0x3545('0x4c')]['hasOwnProperty'](_0x3545('0x53'))){_0x27fb48[_0x3545('0x37')]=qs['limit'](_0x9c1c7b[_0x3545('0x4c')]['limit']);_0x27fb48[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x9c1c7b[_0x3545('0x4c')][_0x3545('0x36')]);}_0x27fb48[_0x3545('0x54')]=qs['sort'](_0x9c1c7b['query'][_0x3545('0x55')]);_0x27fb48[_0x3545('0x56')]=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x9c1c7b[_0x3545('0x4c')],_0x89a442[_0x3545('0x4e')]),_0x4765c8);if(_0x9c1c7b[_0x3545('0x4c')][_0x3545('0x58')]){_0x27fb48[_0x3545('0x56')]=_[_0x3545('0x59')](_0x27fb48[_0x3545('0x56')],{'$or':_[_0x3545('0x46')](_0x4765c8,function(_0x52aa94){if(_0x52aa94['type']!==_0x3545('0x5a')){var _0x42eac6={};_0x42eac6[_0x52aa94['name']]={'$like':'%'+_0x9c1c7b['query']['filter']+'%'};return _0x42eac6;}})});}_0x27fb48=_[_0x3545('0x59')]({},_0x27fb48,_0x9c1c7b[_0x3545('0x5b')]);var _0x1e3c0e={'where':_0x27fb48[_0x3545('0x56')]};return db['ChatWebsite'][_0x3545('0x39')](_0x1e3c0e)['then'](function(_0x3a83e4){_0x9fa387[_0x3545('0x39')]=_0x3a83e4;if(_0x9c1c7b['query'][_0x3545('0x5c')]){_0x27fb48[_0x3545('0x5d')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x27fb48);})[_0x3545('0x26')](function(_0xa92e17){_0x9fa387[_0x3545('0x5e')]=_0xa92e17;return _0x9fa387;})[_0x3545('0x26')](respondWithFilteredResult(_0x20c73f,_0x27fb48))[_0x3545('0x31')](handleError(_0x20c73f,null));};exports['show']=function(_0x21a200,_0x4cd5cc){var _0x48f0b8={'raw':![],'where':{'id':_0x21a200[_0x3545('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0x3545('0x45')}]},_0x1b3369={};_0x1b3369[_0x3545('0x4b')]=_['keys'](db[_0x3545('0x47')][_0x3545('0x48')]);_0x1b3369[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0x21a200['query']);_0x1b3369[_0x3545('0x4e')]=_[_0x3545('0x4f')](_0x1b3369[_0x3545('0x4b')],_0x1b3369['query']);_0x48f0b8[_0x3545('0x50')]=_[_0x3545('0x4f')](_0x1b3369['model'],qs[_0x3545('0x51')](_0x21a200['query'][_0x3545('0x51')]));_0x48f0b8[_0x3545('0x50')]=_0x48f0b8[_0x3545('0x50')][_0x3545('0x52')]?_0x48f0b8[_0x3545('0x50')]:_0x1b3369[_0x3545('0x4b')];if(_0x21a200[_0x3545('0x4c')][_0x3545('0x5c')]){_0x48f0b8['include']=[{'all':!![]}];}_0x48f0b8=_['merge']({},_0x48f0b8,_0x21a200[_0x3545('0x5b')]);return db[_0x3545('0x47')][_0x3545('0x60')](_0x48f0b8)['then'](handleEntityNotFound(_0x4cd5cc,null))['then'](respondWithResult(_0x4cd5cc,null))[_0x3545('0x31')](handleError(_0x4cd5cc,null));};exports[_0x3545('0x61')]=function(_0x282f5f,_0x1a11b3){return db['ChatWebsite'][_0x3545('0x61')](_0x282f5f[_0x3545('0x62')],{})[_0x3545('0x26')](function(_0x124692){var _0x5131ba=_0x282f5f[_0x3545('0x63')]['get']({'plain':!![]});if(!_0x5131ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5131ba[_0x3545('0x64')]===_0x3545('0x63')){var _0x42632f=_0x124692[_0x3545('0x3e')]({'plain':!![]});var _0x57e27c=_0x3545('0x3f');return db['UserProfileSection'][_0x3545('0x60')]({'where':{'name':_0x57e27c,'userProfileId':_0x5131ba['userProfileId']},'raw':!![]})[_0x3545('0x26')](function(_0x3635a6){if(_0x3635a6&&_0x3635a6['autoAssociation']===0x0){return db[_0x3545('0x40')][_0x3545('0x61')]({'name':_0x42632f[_0x3545('0x42')],'resourceId':_0x42632f['id'],'type':_0x3635a6[_0x3545('0x42')],'sectionId':_0x3635a6['id']},{})[_0x3545('0x26')](function(){return _0x124692;});}else{return _0x124692;}})[_0x3545('0x31')](function(_0x5f17c0){logger[_0x3545('0x2d')](_0x3545('0x65'),_0x5f17c0);throw _0x5f17c0;});}return _0x124692;})[_0x3545('0x26')](respondWithResult(_0x1a11b3,0xc9))[_0x3545('0x31')](handleError(_0x1a11b3,null));};exports[_0x3545('0x3c')]=function(_0x406c00,_0x45a20d){if(_0x406c00[_0x3545('0x62')]['id']){delete _0x406c00[_0x3545('0x62')]['id'];}return db[_0x3545('0x47')]['find']({'where':{'id':_0x406c00['params']['id']},'include':[{'model':db['Pause'],'as':_0x3545('0x45')}]})['then'](handleEntityNotFound(_0x45a20d,null))['then'](saveUpdates(_0x406c00['body'],null))[_0x3545('0x26')](respondWithResult(_0x45a20d,null))['catch'](handleError(_0x45a20d,null));};exports[_0x3545('0x3d')]=function(_0x2a03a5,_0x8fa4c3){return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0x2a03a5['params']['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x8fa4c3,null))[_0x3545('0x26')](removeEntity(_0x8fa4c3,null))[_0x3545('0x31')](handleError(_0x8fa4c3,null));};exports['describe']=function(_0x3a5562,_0x39557a){return db[_0x3545('0x47')]['describe']()[_0x3545('0x26')](respondWithResult(_0x39557a,null))['catch'](handleError(_0x39557a,null));};exports[_0x3545('0x66')]=function(_0x2e5eb1,_0x37a3f9,_0x7c6f39){if(_0x2e5eb1[_0x3545('0x62')]['id']){delete _0x2e5eb1['body']['id'];}return db[_0x3545('0x47')][_0x3545('0x60')]({'where':{'id':_0x2e5eb1[_0x3545('0x5f')]['id']}})['then'](handleEntityNotFound(_0x37a3f9,null))[_0x3545('0x26')](function(_0x2ab0e8){if(_0x2ab0e8){_0x2e5eb1['body']['ChatWebsiteId']=_0x2ab0e8['id'];return db[_0x3545('0x67')][_0x3545('0x61')](_0x2e5eb1[_0x3545('0x62')]);}})[_0x3545('0x26')](respondWithResult(_0x37a3f9,null))['catch'](handleError(_0x37a3f9,null));};exports[_0x3545('0x68')]=function(_0x34aab1,_0x23ab42,_0x39d94e){var _0x4820c8={'raw':![],'where':{}};var _0x1fb6af={};var _0x3cf321={'count':0x0,'rows':[]};return db[_0x3545('0x47')]['findOne']({'where':{'id':_0x34aab1[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x23ab42,null))[_0x3545('0x26')](function(_0x53c098){if(_0x53c098){_0x1fb6af['model']=_['keys'](db[_0x3545('0x67')][_0x3545('0x48')]);_0x1fb6af[_0x3545('0x4c')]=_['keys'](_0x34aab1[_0x3545('0x4c')]);_0x1fb6af[_0x3545('0x4e')]=_['intersection'](_0x1fb6af[_0x3545('0x4b')],_0x1fb6af[_0x3545('0x4c')]);_0x4820c8[_0x3545('0x50')]=_['intersection'](_0x1fb6af['model'],qs[_0x3545('0x51')](_0x34aab1[_0x3545('0x4c')][_0x3545('0x51')]));_0x4820c8[_0x3545('0x50')]=_0x4820c8[_0x3545('0x50')]['length']?_0x4820c8[_0x3545('0x50')]:_0x1fb6af[_0x3545('0x4b')];if(!_0x34aab1['query'][_0x3545('0x69')](_0x3545('0x53'))){_0x4820c8[_0x3545('0x37')]=qs[_0x3545('0x37')](_0x34aab1[_0x3545('0x4c')][_0x3545('0x37')]);_0x4820c8['offset']=qs[_0x3545('0x36')](_0x34aab1[_0x3545('0x4c')][_0x3545('0x36')]);}_0x4820c8[_0x3545('0x54')]=qs[_0x3545('0x55')](_0x34aab1['query']['sort']);_0x4820c8[_0x3545('0x56')]=qs['filters'](_[_0x3545('0x57')](_0x34aab1[_0x3545('0x4c')],_0x1fb6af[_0x3545('0x4e')]));_0x4820c8[_0x3545('0x56')][_0x3545('0x6a')]=_0x53c098['id'];if(_0x34aab1[_0x3545('0x4c')][_0x3545('0x58')]){_0x4820c8['where']=_[_0x3545('0x59')](_0x4820c8[_0x3545('0x56')],{'$or':_['map'](_0x4820c8['attributes'],function(_0x13d4bd){var _0x8caebf={};_0x8caebf[_0x13d4bd]={'$like':'%'+_0x34aab1[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x8caebf;})});}_0x4820c8=_[_0x3545('0x59')]({},_0x4820c8,_0x34aab1[_0x3545('0x5b')]);return db['Disposition'][_0x3545('0x39')]({'where':_0x4820c8[_0x3545('0x56')]})[_0x3545('0x26')](function(_0x2f7fa6){_0x3cf321[_0x3545('0x39')]=_0x2f7fa6;if(_0x34aab1[_0x3545('0x4c')][_0x3545('0x5c')]){_0x4820c8[_0x3545('0x5d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4820c8);})['then'](function(_0x3ae794){_0x3cf321[_0x3545('0x5e')]=_0x3ae794;return _0x3cf321;});}})[_0x3545('0x26')](respondWithFilteredResult(_0x23ab42,_0x4820c8))[_0x3545('0x31')](handleError(_0x23ab42,null));};exports[_0x3545('0x6b')]=function(_0x4e6262,_0x3d540d,_0x28889a){return db[_0x3545('0x47')]['find']({'where':{'id':_0x4e6262[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x3d540d,null))[_0x3545('0x26')](function(_0x1a188c){if(_0x1a188c){return _0x1a188c[_0x3545('0x6b')](_0x4e6262[_0x3545('0x4c')][_0x3545('0x6c')]);}})[_0x3545('0x26')](respondWithStatusCode(_0x3d540d,null))[_0x3545('0x31')](handleError(_0x3d540d,null));};exports[_0x3545('0x6d')]=function(_0x483303,_0x813874,_0x49d44e){if(_0x483303[_0x3545('0x62')]['id']){delete _0x483303[_0x3545('0x62')]['id'];}return db[_0x3545('0x47')]['find']({'where':{'id':_0x483303['params']['id']}})['then'](handleEntityNotFound(_0x813874,null))[_0x3545('0x26')](function(_0x37bc94){if(_0x37bc94){_0x483303['body'][_0x3545('0x6a')]=_0x37bc94['id'];return db[_0x3545('0x6e')][_0x3545('0x61')](_0x483303[_0x3545('0x62')]);}})[_0x3545('0x26')](respondWithResult(_0x813874,null))[_0x3545('0x31')](handleError(_0x813874,null));};exports[_0x3545('0x6f')]=function(_0x1a80d9,_0x480caa,_0x2bf2cc){var _0x41b9a7={'raw':![],'where':{}};var _0x2a85d7={};var _0x1c17ed={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3545('0x70')]({'where':{'id':_0x1a80d9['params']['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x480caa,null))[_0x3545('0x26')](function(_0x30c319){if(_0x30c319){_0x2a85d7[_0x3545('0x4b')]=_[_0x3545('0x4d')](db['CannedAnswer'][_0x3545('0x48')]);_0x2a85d7['query']=_[_0x3545('0x4d')](_0x1a80d9[_0x3545('0x4c')]);_0x2a85d7['filters']=_[_0x3545('0x4f')](_0x2a85d7[_0x3545('0x4b')],_0x2a85d7['query']);_0x41b9a7[_0x3545('0x50')]=_[_0x3545('0x4f')](_0x2a85d7[_0x3545('0x4b')],qs[_0x3545('0x51')](_0x1a80d9[_0x3545('0x4c')][_0x3545('0x51')]));_0x41b9a7['attributes']=_0x41b9a7[_0x3545('0x50')][_0x3545('0x52')]?_0x41b9a7[_0x3545('0x50')]:_0x2a85d7[_0x3545('0x4b')];if(!_0x1a80d9[_0x3545('0x4c')]['hasOwnProperty'](_0x3545('0x53'))){_0x41b9a7['limit']=qs['limit'](_0x1a80d9['query']['limit']);_0x41b9a7[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x1a80d9['query'][_0x3545('0x36')]);}_0x41b9a7[_0x3545('0x54')]=qs['sort'](_0x1a80d9['query']['sort']);_0x41b9a7[_0x3545('0x56')]=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x1a80d9[_0x3545('0x4c')],_0x2a85d7[_0x3545('0x4e')]));_0x41b9a7[_0x3545('0x56')][_0x3545('0x6a')]=_0x30c319['id'];if(_0x1a80d9[_0x3545('0x4c')][_0x3545('0x58')]){_0x41b9a7['where']=_[_0x3545('0x59')](_0x41b9a7[_0x3545('0x56')],{'$or':_[_0x3545('0x46')](_0x41b9a7[_0x3545('0x50')],function(_0x3fed9e){var _0x8f4d6e={};_0x8f4d6e[_0x3fed9e]={'$like':'%'+_0x1a80d9[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x8f4d6e;})});}_0x41b9a7=_['merge']({},_0x41b9a7,_0x1a80d9['options']);return db['CannedAnswer'][_0x3545('0x39')]({'where':_0x41b9a7[_0x3545('0x56')]})[_0x3545('0x26')](function(_0x1ff319){_0x1c17ed[_0x3545('0x39')]=_0x1ff319;if(_0x1a80d9[_0x3545('0x4c')][_0x3545('0x5c')]){_0x41b9a7[_0x3545('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3545('0x71')](_0x41b9a7);})[_0x3545('0x26')](function(_0x9a990){_0x1c17ed[_0x3545('0x5e')]=_0x9a990;return _0x1c17ed;});}})[_0x3545('0x26')](respondWithFilteredResult(_0x480caa,_0x41b9a7))[_0x3545('0x31')](handleError(_0x480caa,null));};exports[_0x3545('0x72')]=function(_0x5d93c8,_0x37bf90,_0x227528){return db[_0x3545('0x47')][_0x3545('0x60')]({'where':{'id':_0x5d93c8[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x37bf90,null))[_0x3545('0x26')](function(_0x5558ad){if(_0x5558ad){return _0x5558ad['removeAnswers'](_0x5d93c8[_0x3545('0x4c')][_0x3545('0x6c')]);}})[_0x3545('0x26')](respondWithStatusCode(_0x37bf90,null))['catch'](handleError(_0x37bf90,null));};exports[_0x3545('0x73')]=function(_0xaeaa5f,_0x25806c,_0x128d38){_0xaeaa5f[_0x3545('0x62')][_0x3545('0x74')]=_0xaeaa5f[_0x3545('0x75')][_0x3545('0x76')];return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0xaeaa5f[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x25806c,null))[_0x3545('0x26')](saveUpdates(_0xaeaa5f[_0x3545('0x62')],null))[_0x3545('0x26')](respondWithResult(_0x25806c,null))[_0x3545('0x31')](handleError(_0x25806c,null));};exports[_0x3545('0x77')]=function(_0xe8e7f8,_0x306ff3,_0x33186a){_0xe8e7f8[_0x3545('0x62')][_0x3545('0x78')]=_0xe8e7f8['file'][_0x3545('0x76')];return db[_0x3545('0x47')]['find']({'where':{'id':_0xe8e7f8[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x306ff3,null))['then'](saveUpdates(_0xe8e7f8[_0x3545('0x62')],null))[_0x3545('0x26')](respondWithResult(_0x306ff3,null))[_0x3545('0x31')](handleError(_0x306ff3,null));};exports[_0x3545('0x79')]=function(_0x738e45,_0x296df6,_0x5b2008){_0x738e45[_0x3545('0x62')][_0x3545('0x7a')]=_0x738e45[_0x3545('0x75')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x738e45[_0x3545('0x5f')]['id']}})['then'](handleEntityNotFound(_0x296df6,null))['then'](saveUpdates(_0x738e45[_0x3545('0x62')],null))[_0x3545('0x26')](respondWithResult(_0x296df6,null))[_0x3545('0x31')](handleError(_0x296df6,null));};exports[_0x3545('0x7b')]=function(_0x14b8f9,_0x437f56,_0x2d098d){_0x14b8f9[_0x3545('0x62')][_0x3545('0x7c')]=_0x14b8f9[_0x3545('0x75')]['filename'];return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0x14b8f9[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x437f56,null))['then'](saveUpdates(_0x14b8f9[_0x3545('0x62')],null))['then'](respondWithResult(_0x437f56,null))['catch'](handleError(_0x437f56,null));};exports[_0x3545('0x7d')]=function(_0x5f5cfd,_0x516e99,_0x124f48){var _0x217a08=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x80'));var _0x168dce={'where':{'id':_0x5f5cfd[_0x3545('0x5f')]['id']},'attributes':['id',_0x3545('0x74')],'raw':!![]};var _0x761a1c=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x48fbfc){if(_0x48fbfc){_0x761a1c=_0x48fbfc[_0x3545('0x81')];}})['then'](function(){return db[_0x3545('0x47')]['find'](_0x168dce);})[_0x3545('0x26')](handleEntityNotFound(_0x516e99,null))[_0x3545('0x26')](function(_0x1f4a33){if(_0x1f4a33){if(!_[_0x3545('0x82')](_0x1f4a33[_0x3545('0x74')])){if(fs[_0x3545('0x83')](path['join'](config[_0x3545('0x7f')],_0x3545('0x84'),_0x1f4a33[_0x3545('0x74')]))&&_0x761a1c){_0x217a08=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x84'),_0x1f4a33['sitepic']);}}return _0x516e99[_0x3545('0x85')](_0x217a08);}})[_0x3545('0x31')](handleError(_0x516e99,null));};exports[_0x3545('0x86')]=function(_0x58b6f4,_0x3e363f,_0x3b7efe){var _0x2ae3e5=path[_0x3545('0x7e')](config['root'],_0x3545('0x87'));var _0x982759={'where':{'id':_0x58b6f4[_0x3545('0x5f')]['id']},'attributes':['id',_0x3545('0x78')],'raw':!![]};return db[_0x3545('0x47')][_0x3545('0x60')](_0x982759)[_0x3545('0x26')](handleEntityNotFound(_0x3e363f,null))[_0x3545('0x26')](function(_0x175058){if(_0x175058){if(!_['isNil'](_0x175058[_0x3545('0x78')])){if(fs[_0x3545('0x83')](path[_0x3545('0x7e')](config['root'],_0x3545('0x88'),_0x175058['agentAvatar']))){_0x2ae3e5=path[_0x3545('0x7e')](config['root'],_0x3545('0x88'),_0x175058[_0x3545('0x78')]);}}return _0x3e363f[_0x3545('0x85')](_0x2ae3e5);}})[_0x3545('0x31')](handleError(_0x3e363f,null));};exports[_0x3545('0x89')]=function(_0x3904ef,_0x42620d,_0x1f5367){var _0x5121ce=path['join'](config[_0x3545('0x7f')],_0x3545('0x8a'));var _0x4e27bc={'where':{'id':_0x3904ef['params']['id']},'attributes':['id',_0x3545('0x7a'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x3545('0x60')](_0x4e27bc)[_0x3545('0x26')](handleEntityNotFound(_0x42620d,null))['then'](function(_0x2affab){if(_0x2affab){if(!_['isNil'](_0x2affab['customerAvatar'])){if(fs[_0x3545('0x83')](path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x88'),_0x2affab[_0x3545('0x7a')]))&&_0x2affab[_0x3545('0x8b')]){_0x5121ce=path['join'](config[_0x3545('0x7f')],'server/files/images/avatars/',_0x2affab[_0x3545('0x7a')]);}}return _0x42620d[_0x3545('0x85')](_0x5121ce);}})[_0x3545('0x31')](handleError(_0x42620d,null));};exports[_0x3545('0x8c')]=function(_0x465d54,_0x31823c,_0xa0dd57){var _0x231ef2=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x8d'));var _0x4994cd={'where':{'id':_0x465d54[_0x3545('0x5f')]['id']},'attributes':['id',_0x3545('0x7c')],'raw':!![]};return db[_0x3545('0x47')][_0x3545('0x60')](_0x4994cd)[_0x3545('0x26')](handleEntityNotFound(_0x31823c,null))[_0x3545('0x26')](function(_0x19a3dc){if(_0x19a3dc){if(!_[_0x3545('0x82')](_0x19a3dc[_0x3545('0x7c')])){if(fs[_0x3545('0x83')](path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x88'),_0x19a3dc['systemAvatar']))){_0x231ef2=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x88'),_0x19a3dc[_0x3545('0x7c')]);}}return _0x31823c[_0x3545('0x85')](_0x231ef2);}})[_0x3545('0x31')](handleError(_0x31823c,null));};exports[_0x3545('0x8e')]=function(_0x4538dd,_0x5ce078,_0x28f15e){var _0x2a61aa=require('user-agent-parser');var _0xe7877c=new _0x2a61aa();var _0x5875d9=_0xe7877c[_0x3545('0x8f')](_0x4538dd[_0x3545('0x90')][_0x3545('0x91')])['getResult']();var _0x1a410d={'body':_0x4538dd[_0x3545('0x62')],'channel':'chat'};var _0x5d5ccb=[];var _0x14d3b4=[];var _0x115adf={};var _0x5e98ee=![];return db['CmContact'][_0x3545('0x92')]()[_0x3545('0x26')](function(_0x5ece25){if(!_0x5ece25){throw new db[(_0x3545('0x93'))][(_0x3545('0x94'))]('no\x20available\x20attributes');}_0x5d5ccb=_[_0x3545('0x95')](_[_0x3545('0x4d')](_0x5ece25),[_0x3545('0x96'),_0x3545('0x97')]);_0x14d3b4=_[_0x3545('0x95')](_['keys'](_0x5ece25),[_0x3545('0x96'),_0x3545('0x97'),_0x3545('0x98'),'ListId']);if(_0x4538dd[_0x3545('0x62')]['id']){delete _0x4538dd[_0x3545('0x62')]['id'];}if(_[_0x3545('0x82')](_0x4538dd[_0x3545('0x62')]['from'])){throw new db[(_0x3545('0x93'))][(_0x3545('0x94'))](_0x3545('0x99'));}if(_[_0x3545('0x82')](_0x4538dd[_0x3545('0x62')][_0x3545('0x62')])||_0x4538dd[_0x3545('0x62')][_0x3545('0x62')]===''){throw new db[(_0x3545('0x93'))][(_0x3545('0x94'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4538dd['body'][_0x3545('0x9a')])){throw new db[(_0x3545('0x93'))][(_0x3545('0x94'))](_0x3545('0x9b')+_0x14d3b4);}if(!_['includes'](_0x14d3b4,_0x4538dd[_0x3545('0x62')][_0x3545('0x9a')])){throw new db['Sequelize'][(_0x3545('0x94'))](_0x3545('0x9c')+_0x14d3b4);}_0x115adf[_0x4538dd['body'][_0x3545('0x9a')]]=_0x4538dd[_0x3545('0x62')][_0x3545('0x9d')];})['then'](function(){return db[_0x3545('0x47')]['find']({'where':{'id':_0x4538dd[_0x3545('0x5f')]['id']},'include':[{'model':db[_0x3545('0x9e')],'as':_0x3545('0x9f'),'include':[{'model':db[_0x3545('0xa0')],'as':_0x3545('0xa1'),'where':_0x115adf,'limit':0x1,'order':[[_0x3545('0x97'),_0x3545('0xa2')]]}]},{'model':db[_0x3545('0xa3')],'as':_0x3545('0xa4')}]});})[_0x3545('0x26')](handleEntityNotFound(_0x5ce078,null))[_0x3545('0x26')](function(_0x31cf18){if(_0x31cf18&&_0x31cf18[_0x3545('0x9f')]){_0x1a410d['account']=_0x31cf18;_0x1a410d[_0x3545('0xa5')]=_0x31cf18['Applications'];_0x1a410d[_0x3545('0xa6')]=_0x31cf18[_0x3545('0x9f')];_0x1a410d[_0x3545('0xa5')]=_[_0x3545('0xa7')](_0x1a410d[_0x3545('0xa5')],['priority'],[_0x3545('0xa8')]);if(_0x1a410d[_0x3545('0xa9')][_0x3545('0xa4')]){delete _0x1a410d[_0x3545('0xa9')][_0x3545('0xa4')];}if(_0x1a410d[_0x3545('0xa9')][_0x3545('0x9f')]&&_0x1a410d[_0x3545('0xa9')][_0x3545('0x9f')][_0x3545('0xa1')][_0x3545('0x52')]){return _0x1a410d['account'][_0x3545('0x9f')][_0x3545('0xa1')][0x0];}var _0x506c69=_[_0x3545('0x1d')](_0x4538dd[_0x3545('0x62')],{'firstName':_0x4538dd[_0x3545('0x62')][_0x3545('0x9d')],'ListId':_0x31cf18[_0x3545('0xaa')]});_0x506c69[_0x4538dd[_0x3545('0x62')][_0x3545('0x9a')]]=_0x4538dd[_0x3545('0x62')][_0x3545('0x9d')];return db[_0x3545('0xa0')][_0x3545('0x61')](_0x506c69,{'fields':_0x5d5ccb,'raw':!![]});}})[_0x3545('0x26')](handleEntityNotFound(_0x5ce078,null))[_0x3545('0x26')](function(_0x45bf8d){_0x1a410d['contact']=_0x45bf8d;var _0x3745d9=_0x4538dd[_0x3545('0x62')][_0x3545('0xab')];if(_0x4538dd[_0x3545('0x90')][_0x3545('0xac')]){_0x3745d9=_0x4538dd[_0x3545('0x90')][_0x3545('0xac')];}else if(_0x4538dd[_0x3545('0x90')][_0x3545('0xad')]){_0x3745d9=_[_0x3545('0xae')](_0x4538dd['headers']['x-forwarded-for'][_0x3545('0xaf')](','));}if(_0x45bf8d){var _0x51ed6f={'ContactId':_0x45bf8d['id'],'ChatWebsiteId':_0x4538dd[_0x3545('0x5f')]['id'],'from':(_0x45bf8d[_0x3545('0xb0')]||'')+'\x20'+(_0x45bf8d[_0x3545('0xb1')]||''),'customerIp':_0x3745d9,'customerPort':_0x4538dd['headers'][_0x3545('0xb2')]?_0x4538dd['headers']['x-real-port']:null,'referer':_0x4538dd[_0x3545('0x62')][_0x3545('0xb3')],'browserName':_0x5875d9[_0x3545('0xb4')]['name']&&_0x5875d9[_0x3545('0xb4')][_0x3545('0xb5')]?util[_0x3545('0xb6')]('%s\x20%s',_0x5875d9['browser']['name'],_0x5875d9['browser']['version']):'unknown','browserVersion':_0x5875d9[_0x3545('0xb4')][_0x3545('0xb5')]||_0x3545('0xb7'),'osName':util['format']('%s\x20%s',_0x5875d9['os']['name'],_0x5875d9['os'][_0x3545('0xb5')]),'osVersion':_0x5875d9['os'][_0x3545('0xb5')],'deviceModel':_0x5875d9[_0x3545('0xb8')][_0x3545('0x4b')]&&_0x5875d9[_0x3545('0xb8')][_0x3545('0xb9')]?util[_0x3545('0xb6')](_0x3545('0xba'),_0x5875d9['device'][_0x3545('0x4b')],_0x5875d9[_0x3545('0xb8')][_0x3545('0xb9')],_0x5875d9[_0x3545('0xb8')][_0x3545('0x4a')]):null,'deviceVendor':_0x5875d9[_0x3545('0xb8')][_0x3545('0xb9')],'deviceType':_0x5875d9[_0x3545('0xb8')][_0x3545('0x4a')],'formData':JSON[_0x3545('0x2c')](_0x4538dd[_0x3545('0x62')])};var _0xbd4807={'ChatWebsiteId':_0x4538dd[_0x3545('0x5f')]['id'],'closed':![]};if(_0x4538dd[_0x3545('0x62')][_0x3545('0xbb')]){_0xbd4807[_0x3545('0xbb')]=_0x4538dd[_0x3545('0x62')][_0x3545('0xbb')];return db[_0x3545('0xbc')][_0x3545('0x60')]({'where':_0xbd4807})[_0x3545('0x26')](function(_0x45baae){if(_0x45baae){return[_0x45baae,![]];}_0x51ed6f['threadId']=_0x4538dd[_0x3545('0x62')][_0x3545('0xbb')];_0x51ed6f['externalUrl']=_0x4538dd['body']['externalUrl'];return db[_0x3545('0xbc')][_0x3545('0x61')](_0x51ed6f)['then'](function(_0x2c147c){return[_0x2c147c,!![]];});});}_0xbd4807[_0x3545('0xbd')]=_0x45bf8d['id'];if(_0x4538dd[_0x3545('0x62')][_0x3545('0xbe')]&&_0x4538dd[_0x3545('0x62')]['interaction']['id']){_0xbd4807['id']=_0x4538dd[_0x3545('0x62')][_0x3545('0xbe')]['id'];return db[_0x3545('0xbc')]['find']({'where':_0xbd4807})[_0x3545('0x26')](function(_0x489029){if(_0x489029){return[_0x489029,![]];}return db['ChatInteraction'][_0x3545('0x61')](_0x51ed6f)[_0x3545('0x26')](function(_0x307fd6){return[_0x307fd6,!![]];});});}return db['ChatInteraction'][_0x3545('0x61')](_0x51ed6f)[_0x3545('0x26')](function(_0x42ca7b){return[_0x42ca7b,!![]];});}})[_0x3545('0xbf')](function(_0x58de0d,_0x11edef){if(_0x58de0d){_0x5e98ee=_0x11edef;if(!_0x11edef){var _0x32451c={'from':(_0x1a410d[_0x3545('0xc0')][_0x3545('0xb0')]||'')+'\x20'+(_0x1a410d[_0x3545('0xc0')][_0x3545('0xb1')]||'')};if(_0x4538dd[_0x3545('0x62')][_0x3545('0xbb')]&&_0x4538dd['body'][_0x3545('0xc1')]&&_0x4538dd[_0x3545('0x62')]['threadId']!=_0x4538dd['body'][_0x3545('0xc1')]){_0x32451c[_0x3545('0xbb')]=_0x4538dd[_0x3545('0x62')][_0x3545('0xc1')];}return _0x58de0d['update'](_0x32451c);}else{return _0x58de0d;}}})[_0x3545('0x26')](function(_0x262584){_0x1a410d[_0x3545('0xbe')]=_0x262584['get']({'plain':!![]});_0x1a410d[_0x3545('0xbe')][_0x3545('0xc2')]=_0x5e98ee;if(_0x1a410d['interaction'][_0x3545('0xc2')]){if(_0x1a410d['account']['autoclose']){_0x1a410d[_0x3545('0xa5')]['push']({'id':0x0,'priority':_0x1a410d[_0x3545('0xa5')][_0x3545('0x52')]+0x1,'app':_0x3545('0xc3'),'appdata':_0x3545('0xc4'),'interval':'*,*,*,*'});}}return db[_0x3545('0xc5')][_0x3545('0x61')]({'body':_0x4538dd[_0x3545('0x62')][_0x3545('0x62')],'ChatWebsiteId':_0x4538dd[_0x3545('0x5f')]['id'],'ChatInteractionId':_0x262584['id'],'direction':'in','ContactId':_0x1a410d['contact']['id'],'AttachmentId':_0x4538dd[_0x3545('0x62')][_0x3545('0xc6')]});})['then'](function(_0x5cf088){_0x1a410d[_0x3545('0x2f')]=_0x5cf088;if(_0x1a410d[_0x3545('0xbe')]['UserId']){return db['User'][_0x3545('0x60')]({'attributes':['id',_0x3545('0x42')],'where':{'id':_0x1a410d[_0x3545('0xbe')][_0x3545('0xc7')]}})[_0x3545('0x26')](function(_0x49525e){if(_0x49525e){_0x1a410d[_0x3545('0xa5')][_0x3545('0xc8')]({'id':0x0,'priority':0x0,'app':_0x3545('0xc9'),'appdata':_0x49525e['name']+','+(_0x1a410d[_0x3545('0xa9')]['waitForTheAssignedAgent']||0xa),'interval':_0x3545('0xca')});_0x1a410d[_0x3545('0xcb')]=!![];}return respondWithRpcPromise(_0x3545('0xcc'),'startRouting',_0x1a410d);});}return respondWithRpcPromise(_0x3545('0xcc'),'startRouting',_0x1a410d);})[_0x3545('0x26')](function(_0x14e382){respondWithRpcPromise(_0x3545('0xcd'),_0x3545('0xcd'),{'event':'notify','message':_0x14e382},client9002);return _0x14e382;})[_0x3545('0x26')](respondWithResult(_0x5ce078,null))[_0x3545('0x31')](handleError(_0x5ce078,null));};exports[_0x3545('0xce')]=function(_0x176f14,_0x50e903,_0x516e62){var _0x1093a7,_0x50bcd2,_0x364d28;var _0x5497a9=[];var _0x3df0f1=[];var _0x2e82ef={};var _0x3393cc=_0x176f14[_0x3545('0xcf')]||[];var _0x4b6038=[];var _0x139cc4;return db[_0x3545('0xa0')][_0x3545('0x92')]()[_0x3545('0x26')](function(_0x61bc92){if(!_0x61bc92){throw new db[(_0x3545('0x93'))]['ValidationError'](_0x3545('0xd0'));}_0x3df0f1=_[_0x3545('0x95')](_[_0x3545('0x4d')](_0x61bc92),['createdAt',_0x3545('0x97')]);_0x5497a9=_['difference'](_[_0x3545('0x4d')](_0x61bc92),[_0x3545('0x96'),'updatedAt','CompanyId',_0x3545('0xaa')]);if(_0x176f14[_0x3545('0x62')]['id']){delete _0x176f14[_0x3545('0x62')]['id'];}if(_[_0x3545('0x82')](_0x176f14[_0x3545('0x62')][_0x3545('0x9d')])){throw _0x50e903[_0x3545('0x34')](0x1f4)[_0x3545('0x43')](new db[(_0x3545('0x93'))][(_0x3545('0x94'))](_0x3545('0x99')));}if(_[_0x3545('0x82')](_0x176f14[_0x3545('0x62')]['body'])||_0x176f14[_0x3545('0x62')]['body']===''){throw _0x50e903[_0x3545('0x34')](0x1f4)[_0x3545('0x43')](new db[(_0x3545('0x93'))]['ValidationError'](_0x3545('0xd1')));}if(_[_0x3545('0x82')](_0x176f14[_0x3545('0x62')][_0x3545('0xd2')])){throw _0x50e903['status'](0x1f4)[_0x3545('0x43')](new db[(_0x3545('0x93'))][(_0x3545('0x94'))](_0x3545('0xd3')+_0x5497a9));}if(!_[_0x3545('0xd4')](_0x5497a9,_0x176f14[_0x3545('0x62')]['mapKeyOffline'])){throw _0x50e903[_0x3545('0x34')](0x1f4)[_0x3545('0x43')](new db['Sequelize'][(_0x3545('0x94'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5497a9));}_0x2e82ef[_0x176f14[_0x3545('0x62')][_0x3545('0xd2')]]=_0x176f14[_0x3545('0x62')][_0x3545('0x9d')];})['then'](function(){return db[_0x3545('0x47')][_0x3545('0x60')]({'where':{'id':_0x176f14['params']['id']},'include':[{'model':db[_0x3545('0x9e')],'as':_0x3545('0x9f')},{'model':db[_0x3545('0xd5')],'as':_0x3545('0xd5')}]});})[_0x3545('0x26')](handleEntityNotFound(_0x50e903,null))['then'](function(_0x5e2181){if(_0x5e2181&&_0x5e2181[_0x3545('0x9f')]){_0x50bcd2=_0x5e2181;var _0x1e4d07=_[_0x3545('0x1d')](_0x176f14[_0x3545('0x62')],{'firstName':_0x176f14[_0x3545('0x62')]['from'],'phone':_0x176f14[_0x3545('0x62')]['from'],'ListId':_0x5e2181[_0x3545('0xaa')]});_0x1e4d07[_0x176f14[_0x3545('0x62')][_0x3545('0xd2')]]=_0x176f14[_0x3545('0x62')][_0x3545('0x9d')];return db[_0x3545('0xa0')]['findOrCreate']({'where':_0x2e82ef,'defaults':_0x1e4d07});}})[_0x3545('0xbf')](function(_0x38463e){if(_0x38463e){_0x364d28=_0x38463e;var _0x53910f=fs['readFileSync'](path[_0x3545('0x7e')](config['root'],_0x3545('0xd6')),_0x3545('0xd7'));var _0x2ce8d5=ejs['render'](_0x53910f,{'body':_['toPairs'](_0x176f14['body']['body']),'bodyTitle':_0x50bcd2['offlineMessageBody']});return db[_0x3545('0xd8')][_0x3545('0x61')]({'body':_0x2ce8d5,'ContactId':_0x38463e['id'],'ChatWebsiteId':_0x50bcd2['id']});}})['then'](function(_0x2deb8d){_0x139cc4=_0x2deb8d;if(_0x3393cc[_0x3545('0x52')]){var _0x555b52=_0x3393cc['map'](function(_0x4d5c11){return{'name':_0x4d5c11[_0x3545('0xd9')],'basename':_0x4d5c11[_0x3545('0x76')],'type':_0x4d5c11[_0x3545('0xda')],'ChatOfflineMessageId':_0x2deb8d['id']};});_0x4b6038=_0x555b52[_0x3545('0x46')](_0x19b835=>{var _0x23bffb={'filename':_0x19b835[_0x3545('0x42')],'path':path[_0x3545('0x7e')](config['root'],_0x3545('0xdb'),_0x3545('0xcf'),_0x3545('0xdc'),_0x3545('0xdd'),_0x19b835[_0x3545('0xde')])};return _0x23bffb;});if(!_0x50bcd2[_0x3545('0xdf')]){return db[_0x3545('0xe0')][_0x3545('0xe1')](function(_0x70873c){return db['Attachment'][_0x3545('0xe2')](_0x555b52,{'transaction':_0x70873c});});}}})['then'](function(){if(_0x139cc4){_0x1093a7=_0x139cc4;return db[_0x3545('0xd5')][_0x3545('0x70')]({'where':{'active':!![]},'include':[{'model':db[_0x3545('0xe3')],'as':_0x3545('0xe4'),'raw':!![]}]});}})['then'](function(_0x3c60a1){if(_0x3c60a1&&_0x3c60a1['Smtp']&&_0x50bcd2[_0x3545('0xe5')]&&_0x50bcd2[_0x3545('0xe6')]){var _0xf240b2={'tls':{'rejectUnauthorized':![]}};if(_0x3c60a1[_0x3545('0xe4')]['service']){_0xf240b2['service']=_0x3c60a1[_0x3545('0xe4')][_0x3545('0xe7')];}else{_0xf240b2[_0x3545('0xe8')]=_0x3c60a1['Smtp'][_0x3545('0xe8')];_0xf240b2['port']=_0x3c60a1[_0x3545('0xe4')][_0x3545('0xe9')];_0xf240b2[_0x3545('0xea')]=_0x3c60a1[_0x3545('0xe4')]['secure'];}if(_0x3c60a1[_0x3545('0xe4')][_0x3545('0xeb')]){_0xf240b2[_0x3545('0xec')]={'user':_0x3c60a1['Smtp']['user'],'pass':_0x3c60a1[_0x3545('0xe4')][_0x3545('0xed')]};}return respondWithRpcPromise(_0x3545('0xee'),_0x3545('0xef'),{'account':_0xf240b2,'message':{'from':util[_0x3545('0xb6')](_0x3545('0xf0'),_0x3c60a1[_0x3545('0x42')],_0x3c60a1[_0x3545('0xf1')]||_0x3c60a1[_0x3545('0xe4')][_0x3545('0x63')]),'to':_0x50bcd2[_0x3545('0xe6')],'subject':_0x50bcd2[_0x3545('0xf2')],'html':_0x1093a7['body'],'attachments':_0x4b6038}},client9003)[_0x3545('0x26')](function(){return _0x1093a7;})['catch'](function(_0x1a5e6d){console[_0x3545('0x2d')](_0x1a5e6d);});}})[_0x3545('0x26')](function(){if(_0x50bcd2&&_0x50bcd2[_0x3545('0xdf')]&&_0x50bcd2[_0x3545('0xf3')]){var _0x5eb15c=[];if(_0x3393cc['length']){_0x5eb15c=_0x3393cc[_0x3545('0x46')](function(_0x5557fc){return{'name':_0x5557fc['originalname'],'basename':_0x5557fc['filename'],'type':_0x5557fc[_0x3545('0xda')],'ChatOfflineMessageId':_0x139cc4['id']};});}var _0x3a4045;if(!_[_0x3545('0x82')](_0x50bcd2[_0x3545('0xf4')])){var _0x47ae60=_[_0x3545('0x46')](_0x176f14[_0x3545('0x62')],function(_0x2241af){return _0x2241af;});var _0x437c93=_[_0x3545('0xf5')](_0x47ae60)[0x0];var _0x1ca9ae=_[_0x3545('0xf6')](_0x437c93,function(_0x119fcf){return _0x119fcf;});_0x3a4045=_0x1ca9ae[0x1][_0x50bcd2['subjectOffline']];}var _0x58dd95={'from':_0x364d28['email'],'firstName':_0x364d28[_0x3545('0xb0')],'lastName':_0x364d28[_0x3545('0xb1')],'mapKey':_0x3545('0xf1'),'message':{'from':_0x364d28['email'],'to':_0x50bcd2[_0x3545('0xd5')][_0x3545('0xf1')],'cc':'','subject':_[_0x3545('0x82')](_0x3a4045)?_0x50bcd2['offlineMessageSubject']:_0x3a4045,'messageId':'','sentAt':new Date(),'attach':_0x5eb15c[_0x3545('0x52')],'attachments':_0x5eb15c,'originChannel':'Chat','ChatWebsiteId':_0x50bcd2['id'],'ChatOfflineMessageId':_0x1093a7['id'],'originTo':_0x50bcd2[_0x3545('0xd5')][_0x3545('0xf1')]},'body':_0x1093a7['body']};var _0x27d4a5={'account':{'id':_0x50bcd2[_0x3545('0xf3')]},'body':_0x58dd95,'log':_0x3545('0xf7')};return respondWithRpcPromise(_0x3545('0xf7'),_0x3545('0xf8'),_0x27d4a5,client9001)[_0x3545('0x26')](function(){return _0x1093a7;})[_0x3545('0x31')](function(_0x1f842b){console[_0x3545('0x2d')](_0x1f842b);});}return;})['then'](function(){if(_0x1093a7){return _0x1093a7;}})[_0x3545('0x26')](respondWithResult(_0x50e903,null))['catch'](function(_0x53268f){console[_0x3545('0x2d')](_0x3545('0x31'),_0x53268f);for(var _0xdd5603 of _0x3393cc){var _0x4d55db=path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0xdb'),_0x3545('0xcf'),_0x3545('0xdc'),_0x3545('0xdd'),_0xdd5603[_0x3545('0x76')]);fs_extra[_0x3545('0xf9')](_0x4d55db)[_0x3545('0x31')](function(_0xe2d73d){console[_0x3545('0x2d')](_0x3545('0xfa'),_0x4d55db,_0xe2d73d);});}});};exports[_0x3545('0xfb')]=function(_0x5162f4,_0x459f00,_0x39b855){return db[_0x3545('0xbc')]['find']({'where':{'id':_0x5162f4['params']['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x459f00,null))[_0x3545('0x26')](function(_0x1336d5){if(_0x1336d5){return _0x1336d5[_0x3545('0xfb')](_0x5162f4[_0x3545('0x62')][_0x3545('0x6c')],_[_0x3545('0xfc')](_0x5162f4['body'],[_0x3545('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x459f00,null))[_0x3545('0x31')](handleError(_0x459f00,null));};exports[_0x3545('0xfd')]=function(_0x159331,_0x571dae,_0x3ad3f2){var _0xe441cb={'raw':![],'where':{}};var _0x55ab23={};var _0x56ed97={'count':0x0,'rows':[]};return db[_0x3545('0x47')]['findOne']({'where':{'id':_0x159331[_0x3545('0x5f')]['id']}})['then'](handleEntityNotFound(_0x571dae,null))[_0x3545('0x26')](function(_0x376b19){if(_0x376b19){_0x55ab23['model']=_[_0x3545('0x4d')](db[_0x3545('0xbc')][_0x3545('0x48')]);_0x55ab23['query']=_[_0x3545('0x4d')](_0x159331['query']);_0x55ab23['filters']=_[_0x3545('0x4f')](_0x55ab23[_0x3545('0x4b')],_0x55ab23['query']);_0xe441cb[_0x3545('0x50')]=_[_0x3545('0x4f')](_0x55ab23[_0x3545('0x4b')],qs[_0x3545('0x51')](_0x159331[_0x3545('0x4c')][_0x3545('0x51')]));_0xe441cb['attributes']=_0xe441cb[_0x3545('0x50')][_0x3545('0x52')]?_0xe441cb[_0x3545('0x50')]:_0x55ab23['model'];if(!_0x159331['query'][_0x3545('0x69')]('nolimit')){_0xe441cb['limit']=qs[_0x3545('0x37')](_0x159331['query'][_0x3545('0x37')]);_0xe441cb[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x159331['query'][_0x3545('0x36')]);}_0xe441cb[_0x3545('0x54')]=qs[_0x3545('0x55')](_0x159331[_0x3545('0x4c')][_0x3545('0x55')]);_0xe441cb['where']=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x159331['query'],_0x55ab23[_0x3545('0x4e')]));_0xe441cb[_0x3545('0x56')][_0x3545('0x6a')]=_0x376b19['id'];if(_0x159331[_0x3545('0x4c')][_0x3545('0x58')]){_0xe441cb[_0x3545('0x56')]=_['merge'](_0xe441cb[_0x3545('0x56')],{'$or':_['map'](_0xe441cb[_0x3545('0x50')],function(_0x30a41c){var _0x5248b1={};_0x5248b1[_0x30a41c]={'$like':'%'+_0x159331['query'][_0x3545('0x58')]+'%'};return _0x5248b1;})});}_0xe441cb=_['merge']({},_0xe441cb,_0x159331[_0x3545('0x5b')]);return db['ChatInteraction']['count']({'where':_0xe441cb[_0x3545('0x56')]})[_0x3545('0x26')](function(_0x496d93){_0x56ed97[_0x3545('0x39')]=_0x496d93;if(_0x159331['query'][_0x3545('0x5c')]){_0xe441cb[_0x3545('0x5d')]=[{'model':db[_0x3545('0xa0')],'as':_0x3545('0xfe'),'required':![]},{'model':db[_0x3545('0xff')],'as':_0x3545('0x100'),'attributes':[_0x3545('0x42'),_0x3545('0x101'),'internal'],'required':![]},{'model':db[_0x3545('0x102')],'as':'Tags','attributes':['id',_0x3545('0x42'),'color'],'where':_0x159331[_0x3545('0x4c')][_0x3545('0x103')]?{'id':_0x159331[_0x3545('0x4c')][_0x3545('0x103')]}:undefined,'required':_0x159331[_0x3545('0x4c')]['tag']?!![]:![]}];}return db[_0x3545('0xbc')]['findAll'](_0xe441cb);})[_0x3545('0x26')](function(_0x593b0f){_0x56ed97[_0x3545('0x5e')]=_0x593b0f;return _0x56ed97;});}})[_0x3545('0x26')](respondWithFilteredResult(_0x571dae,_0xe441cb))[_0x3545('0x31')](handleError(_0x571dae,null));};function iftimePromise(_0x33a889,_0x179c80){return respondWithRpcPromise(_0x3545('0x104'),_0x3545('0x105'),{'command':_0x179c80[_0x3545('0x106')]?util[_0x3545('0xb6')]('iftime\x20%s,%s',_0x33a889[_0x3545('0x107')],_0x179c80[_0x3545('0x106')]):util[_0x3545('0xb6')](_0x3545('0x108'),_0x33a889[_0x3545('0x107')])},client9002)[_0x3545('0x26')](function(_0x2a3f95){var _0x5011f7=_0x2a3f95&&_0x2a3f95[_0x3545('0x109')](_0x3545('0x10a'))>=0x0?!![]:![];logger[_0x3545('0x27')](_0x3545('0x10b'),_0x179c80['id'],_0x33a889['id'],_0x33a889['interval'],_0x5011f7?_0x3545('0x10c'):_0x3545('0x10d'),_0x179c80[_0x3545('0x106')]?_0x179c80[_0x3545('0x106')]:_0x3545('0x10e'));return _0x5011f7;})[_0x3545('0x31')](function(_0x322444){logger[_0x3545('0x2d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x179c80['id'],_0x33a889['id'],_0x33a889[_0x3545('0x107')],util[_0x3545('0x10f')](_0x322444,{'showHidden':![],'depth':null}),_0x179c80[_0x3545('0x106')]?_0x179c80[_0x3545('0x106')]:_0x3545('0x10e'));return![];});}exports[_0x3545('0x105')]=function(_0x2b5c6e,_0x4221ea,_0x583685){var _0x2de118=0x0;var _0xbb40ad=0x0;var _0x2c2353=![];var _0xd0099e;var _0x1f4162;return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0x2b5c6e[_0x3545('0x5f')]['id']},'include':[{'model':db[_0x3545('0x110')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x3545('0x111'),'attributes':['id',_0x3545('0x107')],'raw':!![]}]}]})[_0x3545('0x26')](handleEntityNotFound(_0x4221ea,null))[_0x3545('0x26')](function(_0x5e8a87){if(_0x5e8a87){_0xd0099e=_0x5e8a87;return _0x5e8a87[_0x3545('0x112')]({'raw':!![]});}})['then'](function(_0x3bd91a){if(_0xd0099e){if(_0x3bd91a){_0x1f4162=_0x3bd91a;}}return require(_0x3545('0x1b'))[_0x3545('0x113')]();})[_0x3545('0x26')](function(_0x481bb2){if(_0x481bb2){_0xbb40ad=_0x481bb2[_0x3545('0x114')];_0x2c2353=_0x481bb2[_0x3545('0x81')];}})[_0x3545('0x26')](function(){return db[_0x3545('0xbc')][_0x3545('0x39')]({'where':{'closed':![]}});})[_0x3545('0x26')](function(_0x3b1e7b){_0x2de118=_0x3b1e7b;if(_0xbb40ad&&_0x3b1e7b>_0xbb40ad){return db[_0x3545('0x115')][_0x3545('0x70')]({'where':{'id':0x1}})[_0x3545('0x26')](function(_0x92fb8d){if(_0x92fb8d){_0x92fb8d[_0x3545('0x116')]('chatLicenseExceeded');}});}})[_0x3545('0x26')](function(){if(_0xd0099e[_0x3545('0x110')]&&_0xd0099e[_0x3545('0x110')][_0x3545('0x111')]){var _0x47a945=[];for(var _0x156039=0x0;_0x156039<_0xd0099e['Interval'][_0x3545('0x111')][_0x3545('0x52')];_0x156039++){var _0x114fc0=_0xd0099e[_0x3545('0x110')][_0x3545('0x111')][_0x156039][_0x3545('0x3e')]({'plain':!![]});_0x47a945[_0x3545('0x117')](iftimePromise(_0x114fc0,_0xd0099e));}return BPromise[_0x3545('0x118')](_0x47a945)['then'](function(_0x58803f){return _[_0x3545('0x119')](_0x58803f);});}else{return!![];}})[_0x3545('0x26')](function(_0x5d5d25){var _0x20e2a1=fs[_0x3545('0x11a')](path[_0x3545('0x7e')](config[_0x3545('0x7f')],_0x3545('0x11b')),_0x3545('0xd7'));var _0x2b92f3={'remote':_0xd0099e[_0x3545('0x11c')],'query':querystring[_0x3545('0x2c')](_[_0x3545('0x59')](_0xd0099e['get']({'plain':!![]}),{'customerIp':_0x2b5c6e[_0x3545('0x90')][_0x3545('0xad')]||_0x2b5c6e[_0x3545('0x90')][_0x3545('0x11d')]||_0x2b5c6e[_0x3545('0x11e')][_0x3545('0x11f')]||_0x2b5c6e['ip'],'referer':_0x2b5c6e[_0x3545('0x90')]['referer'],'openedInteractions':_0x2de118,'maxInteractions':_0xbb40ad,'virtual':_0x2c2353['virtual'],'online':_0x5d5d25,'custom':_0x2c2353}))[_0x3545('0x120')](/'/g,'\x5c\x27')};_0x4221ea[_0x3545('0x43')](ejs[_0x3545('0x121')](Mustache[_0x3545('0x121')](_0x20e2a1,_0x2b92f3),{'proactiveActions':_0x1f4162,'alignment':_0xd0099e[_0x3545('0x122')],'verticalAlignment':_0xd0099e[_0x3545('0x123')],'div_color':_0xd0099e[_0x3545('0x124')],'text_color':_0xd0099e[_0x3545('0x125')],'button_color':_0xd0099e['color_button'],'background_color':_0xd0099e['backgroundColor']}));})[_0x3545('0x31')](handleError(_0x4221ea,null));};exports[_0x3545('0x126')]=function(_0x42478e,_0x5e55cb,_0x175700){return db[_0x3545('0x47')][_0x3545('0x70')]({'where':{'id':_0x42478e[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x5e55cb,null))[_0x3545('0x26')](function(_0x57afa6){if(_0x57afa6){return db[_0x3545('0xe0')][_0x3545('0xe1')](function(_0x566692){return db['ChatApplication'][_0x3545('0x3d')]({'where':{'ChatWebsiteId':_0x42478e[_0x3545('0x5f')]['id']},'transaction':_0x566692})['then'](function(_0x57dbb3){var _0x1b6809=_[_0x3545('0x46')](_0x42478e[_0x3545('0x62')],function(_0x36819f){_0x36819f[_0x3545('0x6a')]=_0x42478e['params']['id'];return _0x36819f;});return db[_0x3545('0xa3')][_0x3545('0xe2')](_0x1b6809,{'transaction':_0x566692});});})['then'](function(){return db['ChatApplication'][_0x3545('0x127')]({'where':{'ChatWebsiteId':_0x42478e[_0x3545('0x5f')]['id']},'order':_0x3545('0x128')});});}})[_0x3545('0x26')](respondWithResult(_0x5e55cb,null))[_0x3545('0x31')](handleError(_0x5e55cb,null));};exports['getApplications']=function(_0xb0f4be,_0x393699,_0x443902){var _0x8b3dfa={};var _0x4b4937={};var _0x5ebda9;var _0x2eabf7;return db['ChatWebsite'][_0x3545('0x70')]({'where':{'id':_0xb0f4be[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x393699,null))['then'](function(_0x1e1a4a){if(_0x1e1a4a){_0x5ebda9=_0x1e1a4a;_0x4b4937['model']=_[_0x3545('0x4d')](db[_0x3545('0xa3')][_0x3545('0x48')]);_0x4b4937[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0xb0f4be['query']);_0x4b4937[_0x3545('0x4e')]=_[_0x3545('0x4f')](_0x4b4937[_0x3545('0x4b')],_0x4b4937[_0x3545('0x4c')]);_0x8b3dfa['attributes']=_['intersection'](_0x4b4937['model'],qs[_0x3545('0x51')](_0xb0f4be[_0x3545('0x4c')][_0x3545('0x51')]));_0x8b3dfa[_0x3545('0x50')]=_0x8b3dfa[_0x3545('0x50')][_0x3545('0x52')]?_0x8b3dfa['attributes']:_0x4b4937[_0x3545('0x4b')];_0x8b3dfa[_0x3545('0x54')]=qs[_0x3545('0x55')](_0xb0f4be[_0x3545('0x4c')][_0x3545('0x55')]);_0x8b3dfa['where']=qs['filters'](_['pick'](_0xb0f4be[_0x3545('0x4c')],_0x4b4937['filters']));if(_0xb0f4be[_0x3545('0x4c')][_0x3545('0x58')]){_0x8b3dfa[_0x3545('0x56')]=_['merge'](_0x8b3dfa['where'],{'$or':_[_0x3545('0x46')](_0x8b3dfa[_0x3545('0x50')],function(_0x2df8f1){var _0x3a97ee={};_0x3a97ee[_0x2df8f1]={'$like':'%'+_0xb0f4be['query'][_0x3545('0x58')]+'%'};return _0x3a97ee;})});}_0x8b3dfa=_[_0x3545('0x59')]({},_0x8b3dfa,_0xb0f4be[_0x3545('0x5b')]);return _0x5ebda9['getApplications'](_0x8b3dfa);}})[_0x3545('0x26')](function(_0xb13e7c){if(_0xb13e7c){_0x2eabf7=_0xb13e7c[_0x3545('0x52')];if(!_0xb0f4be[_0x3545('0x4c')][_0x3545('0x69')](_0x3545('0x53'))){_0x8b3dfa[_0x3545('0x37')]=qs[_0x3545('0x37')](_0xb0f4be[_0x3545('0x4c')][_0x3545('0x37')]);_0x8b3dfa[_0x3545('0x36')]=qs['offset'](_0xb0f4be[_0x3545('0x4c')][_0x3545('0x36')]);}return _0x5ebda9[_0x3545('0x129')](_0x8b3dfa);}})[_0x3545('0x26')](function(_0x3cae24){if(_0x3cae24){return _0x3cae24?{'count':_0x2eabf7,'rows':_0x3cae24}:null;}})[_0x3545('0x26')](respondWithResult(_0x393699,null))[_0x3545('0x31')](handleError(_0x393699,null));};exports[_0x3545('0x12a')]=function(_0x21742c,_0x34d4b4,_0x559381){return db[_0x3545('0x12b')][_0x3545('0x60')]({'where':{'id':_0x21742c[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x34d4b4,null))[_0x3545('0x26')](function(_0x44d7de){if(_0x44d7de){return _0x44d7de['addProactiveActions'](_0x21742c[_0x3545('0x62')]['ids'],_['omit'](_0x21742c[_0x3545('0x62')],[_0x3545('0x6c'),'id'])||{});}})[_0x3545('0x26')](respondWithResult(_0x34d4b4,null))[_0x3545('0x31')](handleError(_0x34d4b4,null));};exports[_0x3545('0x112')]=function(_0x235631,_0x32c0c8,_0x70962){var _0x334db2={};var _0x430490={};var _0x443f99;var _0x386693;return db['ChatWebsite'][_0x3545('0x70')]({'where':{'id':_0x235631[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x32c0c8,null))[_0x3545('0x26')](function(_0x75db4f){if(_0x75db4f){_0x443f99=_0x75db4f;_0x430490[_0x3545('0x4b')]=_[_0x3545('0x4d')](db[_0x3545('0x12c')][_0x3545('0x48')]);_0x430490['query']=_[_0x3545('0x4d')](_0x235631[_0x3545('0x4c')]);_0x430490['filters']=_[_0x3545('0x4f')](_0x430490[_0x3545('0x4b')],_0x430490[_0x3545('0x4c')]);_0x334db2['attributes']=_[_0x3545('0x4f')](_0x430490[_0x3545('0x4b')],qs[_0x3545('0x51')](_0x235631[_0x3545('0x4c')]['fields']));_0x334db2[_0x3545('0x50')]=_0x334db2[_0x3545('0x50')][_0x3545('0x52')]?_0x334db2[_0x3545('0x50')]:_0x430490[_0x3545('0x4b')];_0x334db2[_0x3545('0x54')]=qs[_0x3545('0x55')](_0x235631[_0x3545('0x4c')][_0x3545('0x55')]);_0x334db2[_0x3545('0x56')]=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x235631[_0x3545('0x4c')],_0x430490[_0x3545('0x4e')]));if(_0x235631[_0x3545('0x4c')][_0x3545('0x58')]){_0x334db2[_0x3545('0x56')]=_[_0x3545('0x59')](_0x334db2[_0x3545('0x56')],{'$or':_[_0x3545('0x46')](_0x334db2[_0x3545('0x50')],function(_0x29465d){var _0x5e9b28={};_0x5e9b28[_0x29465d]={'$like':'%'+_0x235631[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x5e9b28;})});}_0x334db2=_[_0x3545('0x59')]({},_0x334db2,_0x235631[_0x3545('0x5b')]);return _0x443f99['getProactiveActions'](_0x334db2);}})[_0x3545('0x26')](function(_0x5f187c){if(_0x5f187c){_0x386693=_0x5f187c[_0x3545('0x52')];if(!_0x235631[_0x3545('0x4c')][_0x3545('0x69')](_0x3545('0x53'))){_0x334db2[_0x3545('0x37')]=qs[_0x3545('0x37')](_0x235631[_0x3545('0x4c')][_0x3545('0x37')]);_0x334db2[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x235631[_0x3545('0x4c')][_0x3545('0x36')]);}return _0x443f99['getProactiveActions'](_0x334db2);}})['then'](function(_0x576419){if(_0x576419){return _0x576419?{'count':_0x386693,'rows':_0x576419}:null;}})['then'](respondWithResult(_0x32c0c8,null))[_0x3545('0x31')](handleError(_0x32c0c8,null));};exports[_0x3545('0x12d')]=function(_0x2478d2,_0x369b5e,_0x31f91a){var _0x5ac107=_0x2478d2[_0x3545('0x4c')][_0x3545('0x12e')]===_0x3545('0x12f')?_0x3545('0x130'):_0x3545('0x131');return db[_0x3545('0x47')][_0x3545('0x60')]({'attributes':['id',_0x5ac107],'where':{'id':_0x2478d2[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x369b5e,null))[_0x3545('0x26')](function(_0x351618){if(_0x351618){var _0x5cdcbe=_0x351618[_0x5ac107];var _0x8375e1=_0x5cdcbe&&_0x5cdcbe[_0x3545('0x132')]?_0x5cdcbe[_0x3545('0x132')]:[];_0x369b5e[_0x3545('0x43')]({'fromKey':_[_0x3545('0x82')](_0x5cdcbe['fromKey'])?undefined:_0x5cdcbe[_0x3545('0x133')],'count':_0x8375e1[_0x3545('0x52')],'rows':_0x8375e1});}})[_0x3545('0x31')](handleError(_0x369b5e,null));};exports[_0x3545('0x134')]=function(_0x37687a,_0x5eecfa,_0x3205ca){var _0x12fa61={'raw':![],'where':{}};var _0x1d83ba={};var _0x4a39db={'count':0x0,'rows':[]};return db[_0x3545('0x47')][_0x3545('0x70')]({'where':{'id':_0x37687a[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x5eecfa,null))[_0x3545('0x26')](function(_0x48d301){if(_0x48d301){_0x1d83ba[_0x3545('0x4b')]=_[_0x3545('0x4d')](db[_0x3545('0xd8')]['rawAttributes']);_0x1d83ba[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0x37687a[_0x3545('0x4c')]);_0x1d83ba[_0x3545('0x4e')]=_['intersection'](_0x1d83ba['model'],_0x1d83ba['query']);_0x12fa61[_0x3545('0x50')]=_['intersection'](_0x1d83ba['model'],qs[_0x3545('0x51')](_0x37687a[_0x3545('0x4c')][_0x3545('0x51')]));_0x12fa61[_0x3545('0x50')]=_0x12fa61[_0x3545('0x50')]['length']?_0x12fa61[_0x3545('0x50')]:_0x1d83ba[_0x3545('0x4b')];if(!_0x37687a[_0x3545('0x4c')]['hasOwnProperty']('nolimit')){_0x12fa61[_0x3545('0x37')]=qs[_0x3545('0x37')](_0x37687a[_0x3545('0x4c')][_0x3545('0x37')]);_0x12fa61[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x37687a[_0x3545('0x4c')][_0x3545('0x36')]);}_0x12fa61[_0x3545('0x54')]=qs[_0x3545('0x55')](_0x37687a[_0x3545('0x4c')][_0x3545('0x55')]);_0x12fa61[_0x3545('0x56')]=qs[_0x3545('0x4e')](_[_0x3545('0x57')](_0x37687a[_0x3545('0x4c')],_0x1d83ba[_0x3545('0x4e')]));_0x12fa61['where'][_0x3545('0x6a')]=_0x48d301['id'];if(_0x37687a[_0x3545('0x4c')][_0x3545('0x58')]){_0x12fa61[_0x3545('0x56')]=_[_0x3545('0x59')](_0x12fa61['where'],{'$or':_[_0x3545('0x46')](_0x12fa61[_0x3545('0x50')],function(_0x4f67b0){var _0x320e75={};_0x320e75[_0x4f67b0]={'$like':'%'+_0x37687a[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x320e75;})});}_0x12fa61=_['merge']({},_0x12fa61,_0x37687a[_0x3545('0x5b')]);return db[_0x3545('0xd8')][_0x3545('0x39')]({'where':_0x12fa61[_0x3545('0x56')]})[_0x3545('0x26')](function(_0x2d59a9){_0x4a39db[_0x3545('0x39')]=_0x2d59a9;if(_0x37687a['query'][_0x3545('0x5c')]){_0x12fa61[_0x3545('0x5d')]=[{'all':!![]}];}else{_0x12fa61[_0x3545('0x5d')]=[{'model':db[_0x3545('0xa0')],'as':'Contact','required':![]},{'model':db[_0x3545('0x135')],'as':_0x3545('0x136'),'required':![]}];}return db[_0x3545('0xd8')][_0x3545('0x71')](_0x12fa61);})['then'](function(_0x3b2234){_0x4a39db[_0x3545('0x5e')]=_0x3b2234;return _0x4a39db;});}})[_0x3545('0x26')](respondWithFilteredResult(_0x5eecfa,_0x12fa61))['catch'](handleError(_0x5eecfa,null));};exports[_0x3545('0x137')]=function(_0x5a31e9,_0x485b8b,_0x32e6a7){return db['ChatWebsite'][_0x3545('0x60')]({'where':{'id':_0x5a31e9[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x485b8b,null))['then'](function(_0x520498){if(_0x520498){return _0x520498[_0x3545('0x137')](_0x5a31e9[_0x3545('0x62')]['ids'],_[_0x3545('0xfc')](_0x5a31e9[_0x3545('0x62')],[_0x3545('0x6c'),'id'])||{})['spread'](function(_0xd411b2){for(var _0x3aacb7=0x0;_0x3aacb7<_0x5a31e9['body'][_0x3545('0x6c')][_0x3545('0x52')];_0x3aacb7+=0x1){socket[_0x3545('0x138')](_0x3545('0x139'),{'UserId':Number(_0x5a31e9['body'][_0x3545('0x6c')][_0x3aacb7]),'ChatWebsiteId':Number(_0x5a31e9['params']['id'])});}return _0xd411b2;});}})[_0x3545('0x26')](respondWithResult(_0x485b8b,null))[_0x3545('0x31')](handleError(_0x485b8b,null));};exports[_0x3545('0x13a')]=function(_0x596d35,_0x32603f,_0x36c0d2){return db[_0x3545('0x47')][_0x3545('0x60')]({'where':{'id':_0x596d35[_0x3545('0x5f')]['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x32603f,null))[_0x3545('0x26')](function(_0x3d7872){if(_0x3d7872){return _0x3d7872[_0x3545('0x13a')](_0x596d35[_0x3545('0x4c')][_0x3545('0x6c')])[_0x3545('0x26')](function(){if(_[_0x3545('0x13b')](_0x596d35[_0x3545('0x4c')]['ids'])){for(var _0x159a5b=0x0;_0x159a5b<_0x596d35[_0x3545('0x4c')][_0x3545('0x6c')][_0x3545('0x52')];_0x159a5b+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x596d35[_0x3545('0x4c')][_0x3545('0x6c')][_0x159a5b]),'ChatWebsiteId':Number(_0x596d35[_0x3545('0x5f')]['id'])});}}else{socket[_0x3545('0x138')](_0x3545('0x13c'),{'UserId':Number(_0x596d35[_0x3545('0x4c')][_0x3545('0x6c')]),'ChatWebsiteId':Number(_0x596d35[_0x3545('0x5f')]['id'])});}});}})[_0x3545('0x26')](respondWithStatusCode(_0x32603f,null))[_0x3545('0x31')](handleError(_0x32603f,null));};exports[_0x3545('0x13d')]=function(_0x3d3c2e,_0x43d4ef,_0x1b4961){var _0x55aa45={};var _0x1ad787={};var _0x5ade40;var _0x40bb8e;return db[_0x3545('0x47')][_0x3545('0x70')]({'where':{'id':_0x3d3c2e['params']['id']}})[_0x3545('0x26')](handleEntityNotFound(_0x43d4ef,null))[_0x3545('0x26')](function(_0x574d3b){if(_0x574d3b){_0x5ade40=_0x574d3b;_0x1ad787[_0x3545('0x4b')]=_[_0x3545('0x4d')](db['User'][_0x3545('0x48')]);_0x1ad787[_0x3545('0x4c')]=_[_0x3545('0x4d')](_0x3d3c2e[_0x3545('0x4c')]);_0x1ad787[_0x3545('0x4e')]=_[_0x3545('0x4f')](_0x1ad787[_0x3545('0x4b')],_0x1ad787[_0x3545('0x4c')]);_0x55aa45['attributes']=_['intersection'](_0x1ad787[_0x3545('0x4b')],qs[_0x3545('0x51')](_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x51')]));_0x55aa45[_0x3545('0x50')]=_0x55aa45[_0x3545('0x50')]['length']?_0x55aa45[_0x3545('0x50')]:_0x1ad787['model'];_0x55aa45['order']=qs['sort'](_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x55')]);_0x55aa45['where']=qs['filters'](_[_0x3545('0x57')](_0x3d3c2e[_0x3545('0x4c')],_0x1ad787[_0x3545('0x4e')]));if(_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x58')]){_0x55aa45[_0x3545('0x56')]=_['merge'](_0x55aa45['where'],{'$or':_[_0x3545('0x46')](_0x55aa45[_0x3545('0x50')],function(_0x19188b){var _0x17c01c={};_0x17c01c[_0x19188b]={'$like':'%'+_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x58')]+'%'};return _0x17c01c;})});}_0x55aa45=_['merge']({},_0x55aa45,_0x3d3c2e['options']);return _0x5ade40[_0x3545('0x13d')](_0x55aa45);}})[_0x3545('0x26')](function(_0x5987b5){if(_0x5987b5){_0x40bb8e=_0x5987b5[_0x3545('0x52')];if(!_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x69')]('nolimit')){_0x55aa45['limit']=qs[_0x3545('0x37')](_0x3d3c2e[_0x3545('0x4c')][_0x3545('0x37')]);_0x55aa45[_0x3545('0x36')]=qs[_0x3545('0x36')](_0x3d3c2e['query'][_0x3545('0x36')]);}return _0x5ade40[_0x3545('0x13d')](_0x55aa45);}})['then'](function(_0x54a857){if(_0x54a857){return _0x54a857?{'count':_0x40bb8e,'rows':_0x54a857}:null;}})['then'](respondWithResult(_0x43d4ef,null))[_0x3545('0x31')](handleError(_0x43d4ef,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 08e08a3..b7fdf73 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 _0x3ee5=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite'];(function(_0x1a5631,_0x1af65a){var _0x4d0e02=function(_0x592e1f){while(--_0x592e1f){_0x1a5631['push'](_0x1a5631['shift']());}};_0x4d0e02(++_0x1af65a);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x4fffcf,_0x49b324){_0x4fffcf=_0x4fffcf-0x0;var _0x544752=_0x3ee5[_0x4fffcf];return _0x544752;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x53ee('0x0'))['db'][_0x53ee('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53ee('0x2'),'afterUpdate':_0x53ee('0x3'),'afterDestroy':_0x53ee('0x4')};function emitEvent(_0x24e272){return function(_0x25e597,_0x119975,_0x21c99a){ChatWebsiteEvents[_0x53ee('0x5')](_0x24e272+':'+_0x25e597['id'],_0x25e597);ChatWebsiteEvents[_0x53ee('0x5')](_0x24e272,_0x25e597);_0x21c99a(null);};}for(var e in events){if(events[_0x53ee('0x6')](e)){var event=events[e];ChatWebsite[_0x53ee('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4016=['ChatWebsite','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x416df5,_0x5cd9e7){var _0x53235b=function(_0xc8811e){while(--_0xc8811e){_0x416df5['push'](_0x416df5['shift']());}};_0x53235b(++_0x5cd9e7);}(_0x4016,0x131));var _0x6401=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4016[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x6401('0x0'))['db'][_0x6401('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6401('0x2')};function emitEvent(_0x4de6b1){return function(_0x4fc38,_0x27c82a,_0x5f37ea){ChatWebsiteEvents['emit'](_0x4de6b1+':'+_0x4fc38['id'],_0x4fc38);ChatWebsiteEvents[_0x6401('0x3')](_0x4de6b1,_0x4fc38);_0x5f37ea(null);};}for(var e in events){if(events[_0x6401('0x4')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x6401('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 7463e6b..0bbb066 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 _0x9581=['request-promise','path','rimraf','../../config/environment','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2bc293,_0x2749be){var _0x2f83ed=function(_0x1d53d1){while(--_0x1d53d1){_0x2bc293['push'](_0x2bc293['shift']());}};_0x2f83ed(++_0x2749be);}(_0x9581,0x191));var _0x1958=function(_0x1beebe,_0x5594ae){_0x1beebe=_0x1beebe-0x0;var _0x2bd4c3=_0x9581[_0x1beebe];return _0x2bd4c3;};'use strict';var _=require(_0x1958('0x0'));var util=require(_0x1958('0x1'));var logger=require(_0x1958('0x2'))(_0x1958('0x3'));var moment=require(_0x1958('0x4'));var BPromise=require(_0x1958('0x5'));var rp=require(_0x1958('0x6'));var fs=require('fs');var path=require(_0x1958('0x7'));var rimraf=require(_0x1958('0x8'));var config=require(_0x1958('0x9'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x9d2dab,_0x483514){return _0x9d2dab['define']('ChatWebsite',attributes,{'tableName':_0x1958('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e2b=['define','chat_websites','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x4657b4,_0x170028){var _0x547baf=function(_0x34b771){while(--_0x34b771){_0x4657b4['push'](_0x4657b4['shift']());}};_0x547baf(++_0x170028);}(_0x9e2b,0x120));var _0xb9e2=function(_0x2006e9,_0x4057f6){_0x2006e9=_0x2006e9-0x0;var _0x521bb7=_0x9e2b[_0x2006e9];return _0x521bb7;};'use strict';var _=require(_0xb9e2('0x0'));var util=require(_0xb9e2('0x1'));var logger=require('../../config/logger')(_0xb9e2('0x2'));var moment=require(_0xb9e2('0x3'));var BPromise=require('bluebird');var rp=require(_0xb9e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9e2('0x5'));var config=require(_0xb9e2('0x6'));var attributes=require(_0xb9e2('0x7'));module[_0xb9e2('0x8')]=function(_0x399df8,_0x89c77b){return _0x399df8[_0xb9e2('0x9')]('ChatWebsite',attributes,{'tableName':_0xb9e2('0xa'),'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 921bda5..d6f821b 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 _0xb5c4=['rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb5c4,0xc8));var _0x4b5c=function(_0x12b4d4,_0x2134e9){_0x12b4d4=_0x12b4d4-0x0;var _0x32604e=_0xb5c4[_0x12b4d4];return _0x32604e;};'use strict';var _=require('lodash');var util=require(_0x4b5c('0x0'));var moment=require(_0x4b5c('0x1'));var BPromise=require(_0x4b5c('0x2'));var rs=require(_0x4b5c('0x3'));var fs=require('fs');var Redis=require(_0x4b5c('0x4'));var db=require(_0x4b5c('0x5'))['db'];var utils=require(_0x4b5c('0x6'));var logger=require(_0x4b5c('0x7'))(_0x4b5c('0x8'));var config=require(_0x4b5c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4b5c('0xa')][_0x4b5c('0xb')]({'port':0x232a});config[_0x4b5c('0xc')]=_[_0x4b5c('0xd')](config[_0x4b5c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b5c('0xe'))(new Redis(config[_0x4b5c('0xc')]));require(_0x4b5c('0xf'))[_0x4b5c('0x10')](socket);function respondWithRpcPromise(_0x558f41,_0x2b2aec,_0x441b52){return new BPromise(function(_0x3203e6,_0x2b75b8){return client[_0x4b5c('0x11')](_0x558f41,_0x441b52)['then'](function(_0x10aaa8){logger[_0x4b5c('0x12')](_0x4b5c('0x13'),_0x2b2aec,_0x4b5c('0x14'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2b2aec,_0x4b5c('0x14'),JSON[_0x4b5c('0x15')](_0x10aaa8));if(_0x10aaa8[_0x4b5c('0x16')]){if(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x17')]===0x1f4){logger[_0x4b5c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x10aaa8[_0x4b5c('0x16')]['message']);return _0x2b75b8(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);}logger[_0x4b5c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);return _0x3203e6(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);}else{logger[_0x4b5c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x4b5c('0x14'));_0x3203e6(_0x10aaa8[_0x4b5c('0x19')]['message']);}})['catch'](function(_0x50b356){logger[_0x4b5c('0x16')](_0x4b5c('0x13'),_0x2b2aec,_0x50b356);_0x2b75b8(_0x50b356);});});}
\ No newline at end of file
+var _0x452b=['register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket'];(function(_0x514f8c,_0x149740){var _0x3fbf72=function(_0x55bb5a){while(--_0x55bb5a){_0x514f8c['push'](_0x514f8c['shift']());}};_0x3fbf72(++_0x149740);}(_0x452b,0x8e));var _0xb452=function(_0x3921db,_0x1420f1){_0x3921db=_0x3921db-0x0;var _0x309d29=_0x452b[_0x3921db];return _0x309d29;};'use strict';var _=require(_0xb452('0x0'));var util=require(_0xb452('0x1'));var moment=require(_0xb452('0x2'));var BPromise=require(_0xb452('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb452('0x4'))['db'];var utils=require(_0xb452('0x5'));var logger=require(_0xb452('0x6'))('rpc');var config=require(_0xb452('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb452('0x8')][_0xb452('0x9')]({'port':0x232a});config[_0xb452('0xa')]=_['defaults'](config[_0xb452('0xa')],{'host':_0xb452('0xb'),'port':0x18eb});var socket=require(_0xb452('0xc'))(new Redis(config[_0xb452('0xa')]));require(_0xb452('0xd'))[_0xb452('0xe')](socket);function respondWithRpcPromise(_0x66b959,_0x5ddf4c,_0x2ede7a){return new BPromise(function(_0x4c1c15,_0x9bef26){return client[_0xb452('0xf')](_0x66b959,_0x2ede7a)['then'](function(_0x25794d){logger[_0xb452('0x10')](_0xb452('0x11'),_0x5ddf4c,_0xb452('0x12'));logger['debug'](_0xb452('0x13'),_0x5ddf4c,_0xb452('0x12'),JSON[_0xb452('0x14')](_0x25794d));if(_0x25794d['error']){if(_0x25794d[_0xb452('0x15')][_0xb452('0x16')]===0x1f4){logger['error'](_0xb452('0x11'),_0x5ddf4c,_0x25794d['error'][_0xb452('0x17')]);return _0x9bef26(_0x25794d['error'][_0xb452('0x17')]);}logger['error'](_0xb452('0x11'),_0x5ddf4c,_0x25794d[_0xb452('0x15')][_0xb452('0x17')]);return _0x4c1c15(_0x25794d[_0xb452('0x15')]['message']);}else{logger[_0xb452('0x10')](_0xb452('0x11'),_0x5ddf4c,_0xb452('0x12'));_0x4c1c15(_0x25794d[_0xb452('0x18')][_0xb452('0x17')]);}})[_0xb452('0x19')](function(_0x2a5651){logger['error'](_0xb452('0x11'),_0x5ddf4c,_0x2a5651);_0x9bef26(_0x2a5651);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8b29f5a..2ff856f 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 _0x455a=['removeListener','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x577722,_0xcaa9af){var _0x409f2d=function(_0x47f53c){while(--_0x47f53c){_0x577722['push'](_0x577722['shift']());}};_0x409f2d(++_0xcaa9af);}(_0x455a,0x10d));var _0xa455=function(_0x502eb0,_0x6d0814){_0x502eb0=_0x502eb0-0x0;var _0x4f78e4=_0x455a[_0x502eb0];return _0x4f78e4;};'use strict';var ChatWebsiteEvents=require(_0xa455('0x0'));var events=[_0xa455('0x1'),_0xa455('0x2'),_0xa455('0x3')];function createListener(_0xc10cfe,_0x27b956){return function(_0x1d00cf){_0x27b956['emit'](_0xc10cfe,_0x1d00cf);};}function removeListener(_0x1886b7,_0x559ff1){return function(){ChatWebsiteEvents[_0xa455('0x4')](_0x1886b7,_0x559ff1);};}exports['register']=function(_0x1bdd5f){for(var _0x36fa2b=0x0,_0x43a266=events[_0xa455('0x5')];_0x36fa2b<_0x43a266;_0x36fa2b++){var _0x2f368b=events[_0x36fa2b];var _0xb69dab=createListener(_0xa455('0x6')+_0x2f368b,_0x1bdd5f);ChatWebsiteEvents['on'](_0x2f368b,_0xb69dab);}};
\ No newline at end of file
+var _0x1d82=['register','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener'];(function(_0x26f8a1,_0x2fb7c5){var _0xf4d492=function(_0x5e2008){while(--_0x5e2008){_0x26f8a1['push'](_0x26f8a1['shift']());}};_0xf4d492(++_0x2fb7c5);}(_0x1d82,0xaa));var _0x21d8=function(_0x9c866c,_0x3f89b4){_0x9c866c=_0x9c866c-0x0;var _0x695888=_0x1d82[_0x9c866c];return _0x695888;};'use strict';var ChatWebsiteEvents=require(_0x21d8('0x0'));var events=[_0x21d8('0x1'),_0x21d8('0x2'),_0x21d8('0x3')];function createListener(_0x5301e4,_0x3f8f01){return function(_0x407744){_0x3f8f01['emit'](_0x5301e4,_0x407744);};}function removeListener(_0x510528,_0x4ba535){return function(){ChatWebsiteEvents[_0x21d8('0x4')](_0x510528,_0x4ba535);};}exports[_0x21d8('0x5')]=function(_0x279a6c){for(var _0x3aa813=0x0,_0x175702=events['length'];_0x3aa813<_0x175702;_0x3aa813++){var _0x47f12a=events[_0x3aa813];var _0x21f783=createListener(_0x21d8('0x6')+_0x47f12a,_0x279a6c);ChatWebsiteEvents['on'](_0x47f12a,_0x21f783);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index b886a8a..1040ed1 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 _0x5be5=['post','create','addAnswer','join','root','server/files/images/logos/','format','%s-%s','single','addLogo','diskStorage','server/files/images/avatars/','now','file','addAvatar','addCustomerAvatar','originalname','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','update','delete','destroy','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents'];(function(_0x5eb447,_0xd7e005){var _0x1758f2=function(_0x2215d4){while(--_0x2215d4){_0x5eb447['push'](_0x5eb447['shift']());}};_0x1758f2(++_0xd7e005);}(_0x5be5,0xb0));var _0x55be=function(_0x39106d,_0x4d5fef){_0x39106d=_0x39106d-0x0;var _0x42d497=_0x5be5[_0x39106d];return _0x42d497;};'use strict';var multer=require(_0x55be('0x0'));var util=require(_0x55be('0x1'));var path=require(_0x55be('0x2'));var timeout=require(_0x55be('0x3'));var express=require(_0x55be('0x4'));var router=express[_0x55be('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x55be('0x6'));var interaction=require(_0x55be('0x7'));var config=require(_0x55be('0x8'));var controller=require(_0x55be('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x55be('0xa')]);router['get'](_0x55be('0xb'),auth[_0x55be('0xc')](),controller[_0x55be('0xd')]);router[_0x55be('0xe')](_0x55be('0xf'),auth['isAuthenticated'](),controller[_0x55be('0x10')]);router['get'](_0x55be('0x11'),auth[_0x55be('0xc')](),controller[_0x55be('0x12')]);router[_0x55be('0xe')](_0x55be('0x13'),auth[_0x55be('0xc')](),controller[_0x55be('0x14')]);router[_0x55be('0xe')](_0x55be('0x15'),controller[_0x55be('0x16')]);router[_0x55be('0xe')](_0x55be('0x17'),controller[_0x55be('0x18')]);router[_0x55be('0xe')](_0x55be('0x19'),controller['getCustomerAvatar']);router[_0x55be('0xe')](_0x55be('0x1a'),controller['getSystemAvatar']);router['get'](_0x55be('0x1b'),auth[_0x55be('0xc')](),controller[_0x55be('0x1c')]);router[_0x55be('0xe')](_0x55be('0x1d'),controller[_0x55be('0x1e')]);router['get'](_0x55be('0x1f'),auth[_0x55be('0xc')](),controller[_0x55be('0x20')]);router[_0x55be('0xe')](_0x55be('0x21'),auth['isAuthenticated'](),controller[_0x55be('0x22')]);router[_0x55be('0xe')](_0x55be('0x23'),controller[_0x55be('0x24')]);router['get'](_0x55be('0x25'),auth[_0x55be('0xc')](),controller['getOfflineMessages']);router[_0x55be('0xe')](_0x55be('0x26'),auth[_0x55be('0xc')](),controller[_0x55be('0x27')]);router[_0x55be('0x28')]('/',auth['isAuthenticated'](),controller[_0x55be('0x29')]);router[_0x55be('0x28')](_0x55be('0x11'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x55be('0x13'),auth['isAuthenticated'](),controller[_0x55be('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x82646f,_0xb0968b,_0x16d901){_0x16d901(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x2d')));},'filename':function(_0x35ebf8,_0x2d3292,_0x407e36){_0x407e36(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date['now'](),_0x2d3292['originalname']));}})});router[_0x55be('0x28')](_0x55be('0x15'),upload[_0x55be('0x30')]('file'),controller[_0x55be('0x31')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x12f185,_0x4b8abd,_0x4131fa){_0x4131fa(null,path[_0x55be('0x2b')](config['root'],_0x55be('0x33')));},'filename':function(_0xe6b580,_0x1c99b3,_0x2c75bd){_0x2c75bd(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date[_0x55be('0x34')](),_0x1c99b3['originalname']));}})});router[_0x55be('0x28')](_0x55be('0x17'),upload[_0x55be('0x30')](_0x55be('0x35')),controller[_0x55be('0x36')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x177c91,_0x1ce893,_0x254ade){_0x254ade(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x33')));},'filename':function(_0x360e3c,_0x2acf89,_0x37d290){_0x37d290(null,util['format'](_0x55be('0x2f'),Date['now'](),_0x2acf89['originalname']));}})});router[_0x55be('0x28')]('/:id/customer_avatar',upload['single']('file'),controller[_0x55be('0x37')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x25de52,_0x428f33,_0x569d07){_0x569d07(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x179cc3,_0x20a455,_0x49a9f4){_0x49a9f4(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date[_0x55be('0x34')](),_0x20a455[_0x55be('0x38')]));}})});router[_0x55be('0x28')](_0x55be('0x1a'),upload[_0x55be('0x30')](_0x55be('0x35')),controller[_0x55be('0x39')]);router[_0x55be('0x28')]('/:id/notify',controller[_0x55be('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x3114bc,_0x22f36f,_0x50112a){const _0x4852d0=path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x3b'),'attachments',_0x55be('0x3c'));fs_extra[_0x55be('0x3d')](_0x4852d0,function(){_0x50112a(null,_0x4852d0);});},'filename':function(_0x273aaa,_0x300ea9,_0x40bdf1){const _0x415343=_0x300ea9[_0x55be('0x38')][_0x55be('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1fcbf7=path['extname'](_0x415343);const _0x4fe431=Date[_0x55be('0x34')]()+'-'+_0x415343[_0x55be('0x3e')](_0x1fcbf7,'')+_0x1fcbf7;_0x40bdf1(null,_0x4fe431);}})});router[_0x55be('0x28')](_0x55be('0x3f'),offlineUploadMulter['any'](),controller[_0x55be('0x40')]);router['post'](_0x55be('0x1b'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x55be('0x28')](_0x55be('0x1f'),auth[_0x55be('0xc')](),controller[_0x55be('0x41')]);router[_0x55be('0x28')](_0x55be('0x21'),auth['isAuthenticated'](),controller[_0x55be('0x42')]);router[_0x55be('0x28')](_0x55be('0x26'),auth[_0x55be('0xc')](),controller['addAgents']);router['put'](_0x55be('0xf'),auth[_0x55be('0xc')](),controller[_0x55be('0x43')]);router[_0x55be('0x44')]('/:id',auth[_0x55be('0xc')](),controller[_0x55be('0x45')]);router['delete'](_0x55be('0x11'),auth[_0x55be('0xc')](),controller['removeDispositions']);router[_0x55be('0x44')](_0x55be('0x13'),auth['isAuthenticated'](),controller[_0x55be('0x46')]);router[_0x55be('0x44')]('/:id/users',auth[_0x55be('0xc')](),controller['removeAgents']);module[_0x55be('0x47')]=router;
\ No newline at end of file
+var _0x0f98=['/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','/:id/users','post','create','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','diskStorage','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','put','delete','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x54a9ec,_0x11342d){var _0x119de7=function(_0x418814){while(--_0x418814){_0x54a9ec['push'](_0x54a9ec['shift']());}};_0x119de7(++_0x11342d);}(_0x0f98,0x1c0));var _0x80f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f98[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x80f9('0x0'));var util=require(_0x80f9('0x1'));var path=require(_0x80f9('0x2'));var timeout=require(_0x80f9('0x3'));var express=require(_0x80f9('0x4'));var router=express[_0x80f9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x80f9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x80f9('0x7'));router[_0x80f9('0x8')]('/',auth[_0x80f9('0x9')](),controller[_0x80f9('0xa')]);router[_0x80f9('0x8')](_0x80f9('0xb'),auth[_0x80f9('0x9')](),controller[_0x80f9('0xc')]);router[_0x80f9('0x8')](_0x80f9('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x80f9('0x8')](_0x80f9('0xe'),auth[_0x80f9('0x9')](),controller[_0x80f9('0xf')]);router['get']('/:id/canned_answers',auth[_0x80f9('0x9')](),controller['getAnswers']);router[_0x80f9('0x8')](_0x80f9('0x10'),controller[_0x80f9('0x11')]);router[_0x80f9('0x8')](_0x80f9('0x12'),controller[_0x80f9('0x13')]);router[_0x80f9('0x8')](_0x80f9('0x14'),controller[_0x80f9('0x15')]);router[_0x80f9('0x8')](_0x80f9('0x16'),controller[_0x80f9('0x17')]);router[_0x80f9('0x8')](_0x80f9('0x18'),auth['isAuthenticated'](),controller[_0x80f9('0x19')]);router['get'](_0x80f9('0x1a'),controller[_0x80f9('0x1b')]);router[_0x80f9('0x8')](_0x80f9('0x1c'),auth[_0x80f9('0x9')](),controller['getApplications']);router[_0x80f9('0x8')](_0x80f9('0x1d'),auth[_0x80f9('0x9')](),controller['getProactiveActions']);router[_0x80f9('0x8')](_0x80f9('0x1e'),controller[_0x80f9('0x1f')]);router['get'](_0x80f9('0x20'),auth[_0x80f9('0x9')](),controller['getOfflineMessages']);router['get'](_0x80f9('0x21'),auth[_0x80f9('0x9')](),controller['getAgents']);router[_0x80f9('0x22')]('/',auth[_0x80f9('0x9')](),controller[_0x80f9('0x23')]);router[_0x80f9('0x22')](_0x80f9('0xe'),auth[_0x80f9('0x9')](),controller['addDisposition']);router[_0x80f9('0x22')](_0x80f9('0x24'),auth[_0x80f9('0x9')](),controller[_0x80f9('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21624f,_0x482e91,_0x5eb1b5){_0x5eb1b5(null,path[_0x80f9('0x26')](config[_0x80f9('0x27')],_0x80f9('0x28')));},'filename':function(_0x1f1124,_0x3d2356,_0x1e2ab3){_0x1e2ab3(null,util[_0x80f9('0x29')](_0x80f9('0x2a'),Date[_0x80f9('0x2b')](),_0x3d2356[_0x80f9('0x2c')]));}})});router['post'](_0x80f9('0x10'),upload[_0x80f9('0x2d')](_0x80f9('0x2e')),controller[_0x80f9('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x181d9c,_0x1e9633,_0x54e4c3){_0x54e4c3(null,path['join'](config[_0x80f9('0x27')],_0x80f9('0x30')));},'filename':function(_0x536ea2,_0x4b0546,_0x48bb80){_0x48bb80(null,util['format'](_0x80f9('0x2a'),Date[_0x80f9('0x2b')](),_0x4b0546[_0x80f9('0x2c')]));}})});router['post'](_0x80f9('0x12'),upload[_0x80f9('0x2d')](_0x80f9('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x80f9('0x31')]({'destination':function(_0x4d80ac,_0x54d9f8,_0x17ec9a){_0x17ec9a(null,path[_0x80f9('0x26')](config['root'],_0x80f9('0x30')));},'filename':function(_0x21fd0e,_0x7d8d1b,_0x480c00){_0x480c00(null,util[_0x80f9('0x29')](_0x80f9('0x2a'),Date[_0x80f9('0x2b')](),_0x7d8d1b[_0x80f9('0x2c')]));}})});router[_0x80f9('0x22')](_0x80f9('0x14'),upload[_0x80f9('0x2d')](_0x80f9('0x2e')),controller[_0x80f9('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54ea1f,_0x3cfbe1,_0x405085){_0x405085(null,path[_0x80f9('0x26')](config[_0x80f9('0x27')],_0x80f9('0x30')));},'filename':function(_0x3010b7,_0x46f523,_0x3f25a8){_0x3f25a8(null,util[_0x80f9('0x29')]('%s-%s',Date['now'](),_0x46f523[_0x80f9('0x2c')]));}})});router[_0x80f9('0x22')]('/:id/system_avatar',upload[_0x80f9('0x2d')]('file'),controller[_0x80f9('0x33')]);router[_0x80f9('0x22')](_0x80f9('0x34'),controller[_0x80f9('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x80f9('0x31')]({'destination':function(_0x3739fb,_0x58fcb6,_0x2ccaf2){const _0x47362b=path[_0x80f9('0x26')](config[_0x80f9('0x27')],_0x80f9('0x36'),'attachments','offline-chat');fs_extra[_0x80f9('0x37')](_0x47362b,function(){_0x2ccaf2(null,_0x47362b);});},'filename':function(_0x3cf737,_0x1090c7,_0x31c1af){const _0x15d60f=_0x1090c7[_0x80f9('0x2c')][_0x80f9('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x6ed2f1=path['extname'](_0x15d60f);const _0x12ac86=Date['now']()+'-'+_0x15d60f[_0x80f9('0x38')](_0x6ed2f1,'')+_0x6ed2f1;_0x31c1af(null,_0x12ac86);}})});router[_0x80f9('0x22')](_0x80f9('0x39'),offlineUploadMulter['any'](),controller[_0x80f9('0x3a')]);router[_0x80f9('0x22')]('/:id/interactions',auth[_0x80f9('0x9')](),controller[_0x80f9('0x3b')]);router['post'](_0x80f9('0x1c'),auth[_0x80f9('0x9')](),controller[_0x80f9('0x3c')]);router[_0x80f9('0x22')](_0x80f9('0x1d'),auth[_0x80f9('0x9')](),controller[_0x80f9('0x3d')]);router[_0x80f9('0x22')](_0x80f9('0x21'),auth[_0x80f9('0x9')](),controller['addAgents']);router[_0x80f9('0x3e')](_0x80f9('0xd'),auth[_0x80f9('0x9')](),controller['update']);router[_0x80f9('0x3f')]('/:id',auth[_0x80f9('0x9')](),controller['destroy']);router[_0x80f9('0x3f')](_0x80f9('0xe'),auth[_0x80f9('0x9')](),controller['removeDispositions']);router[_0x80f9('0x3f')]('/:id/canned_answers',auth[_0x80f9('0x9')](),controller[_0x80f9('0x40')]);router[_0x80f9('0x3f')](_0x80f9('0x21'),auth[_0x80f9('0x9')](),controller['removeAgents']);module[_0x80f9('0x41')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 25246dc..ff9450d 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 _0x496e=['exports','STRING','ENUM','AmazonAWS'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x496e,0x1a0));var _0xe496=function(_0x91e3a4,_0x3af814){_0x91e3a4=_0x91e3a4-0x0;var _0x383bd5=_0x496e[_0x91e3a4];return _0x383bd5;};'use strict';var Sequelize=require('sequelize');module[_0xe496('0x0')]={'name':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe496('0x2')](_0xe496('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc9b0=['exports','STRING','ENUM','AmazonAWS','Google','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc9b0,0x143));var _0x0c9b=function(_0x50d353,_0x466e6f){_0x50d353=_0x50d353-0x0;var _0x4acc78=_0xc9b0[_0x50d353];return _0x4acc78;};'use strict';var Sequelize=require(_0x0c9b('0x0'));module[_0x0c9b('0x1')]={'name':{'type':Sequelize[_0x0c9b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0c9b('0x3')](_0x0c9b('0x4'),_0x0c9b('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x0c9b('0x2')]},'data2':{'type':Sequelize[_0x0c9b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index f0b2aeb..65b0aa2 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x51c56c,_0x42c126){var _0x927019=function(_0x241547){while(--_0x241547){_0x51c56c['push'](_0x51c56c['shift']());}};_0x927019(++_0x42c126);}(_0x7a54,0x106));var _0x47a5=function(_0x183d92,_0x3699d7){_0x183d92=_0x183d92-0x0;var _0x4a59d2=_0x7a54[_0x183d92];return _0x4a59d2;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
+var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0xb39ffe,_0x2387b2){var _0x398e83=function(_0x9941be){while(--_0x9941be){_0xb39ffe['push'](_0xb39ffe['shift']());}};_0x398e83(++_0x2387b2);}(_0x2032,0xd9));var _0x2203=function(_0x589bdc,_0x5421d0){_0x589bdc=_0x589bdc-0x0;var _0x2fff22=_0x2032[_0x589bdc];return _0x2fff22;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 04a0483..b006549 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 _0x3210=['exports','define','CloudProvider','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x36cb61,_0x48ede7){var _0x22bb48=function(_0xed2888){while(--_0xed2888){_0x36cb61['push'](_0x36cb61['shift']());}};_0x22bb48(++_0x48ede7);}(_0x3210,0x142));var _0x0321=function(_0x202dbd,_0x515964){_0x202dbd=_0x202dbd-0x0;var _0x3edb3f=_0x3210[_0x202dbd];return _0x3edb3f;};'use strict';var _=require(_0x0321('0x0'));var util=require(_0x0321('0x1'));var logger=require('../../config/logger')(_0x0321('0x2'));var moment=require(_0x0321('0x3'));var BPromise=require(_0x0321('0x4'));var rp=require(_0x0321('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0321('0x6'));var config=require(_0x0321('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x0321('0x8')]=function(_0x147df0,_0x186f9a){return _0x147df0[_0x0321('0x9')](_0x0321('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe5b4=['cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xe5b4,0x9d));var _0x4e5b=function(_0xb6fca9,_0x2b9836){_0xb6fca9=_0xb6fca9-0x0;var _0x155144=_0xe5b4[_0xb6fca9];return _0x155144;};'use strict';var _=require(_0x4e5b('0x0'));var util=require(_0x4e5b('0x1'));var logger=require(_0x4e5b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4e5b('0x3'));var rp=require(_0x4e5b('0x4'));var fs=require('fs');var path=require(_0x4e5b('0x5'));var rimraf=require(_0x4e5b('0x6'));var config=require(_0x4e5b('0x7'));var attributes=require(_0x4e5b('0x8'));module[_0x4e5b('0x9')]=function(_0xe2741d,_0x21899e){return _0xe2741d[_0x4e5b('0xa')](_0x4e5b('0xb'),attributes,{'tableName':_0x4e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 97549ad..86206df 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 _0x2b47=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x18483c,_0x33b067){var _0x4e0cf0=function(_0x418001){while(--_0x418001){_0x18483c['push'](_0x18483c['shift']());}};_0x4e0cf0(++_0x33b067);}(_0x2b47,0x177));var _0x72b4=function(_0x2f5ca2,_0x10f3e4){_0x2f5ca2=_0x2f5ca2-0x0;var _0x3c4041=_0x2b47[_0x2f5ca2];return _0x3c4041;};'use strict';var _=require(_0x72b4('0x0'));var util=require('util');var moment=require(_0x72b4('0x1'));var BPromise=require(_0x72b4('0x2'));var rs=require(_0x72b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b4('0x4'))['db'];var utils=require(_0x72b4('0x5'));var logger=require(_0x72b4('0x6'))(_0x72b4('0x7'));var config=require(_0x72b4('0x8'));var jayson=require(_0x72b4('0x9'));var client=jayson['client'][_0x72b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x480984,_0x104f08,_0x1c90aa){return new BPromise(function(_0xb1e42f,_0x1bdf7f){return client[_0x72b4('0xb')](_0x480984,_0x1c90aa)[_0x72b4('0xc')](function(_0x114a98){logger[_0x72b4('0xd')](_0x72b4('0xe'),_0x104f08,_0x72b4('0xf'));logger[_0x72b4('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x104f08,_0x72b4('0xf'),JSON[_0x72b4('0x11')](_0x114a98));if(_0x114a98[_0x72b4('0x12')]){if(_0x114a98[_0x72b4('0x12')][_0x72b4('0x13')]===0x1f4){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0x1bdf7f(_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);}logger['error'](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0xb1e42f(_0x114a98[_0x72b4('0x12')]['message']);}else{logger['info'](_0x72b4('0xe'),_0x104f08,'request\x20sent');_0xb1e42f(_0x114a98[_0x72b4('0x15')][_0x72b4('0x14')]);}})['catch'](function(_0x2a9c37){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x2a9c37);_0x1bdf7f(_0x2a9c37);});});}
\ No newline at end of file
+var _0x6d0c=['../../config/environment','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1f2308,_0x38dec9){var _0x45fbfe=function(_0x3eef51){while(--_0x3eef51){_0x1f2308['push'](_0x1f2308['shift']());}};_0x45fbfe(++_0x38dec9);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x2127fe,_0x5b8eae){_0x2127fe=_0x2127fe-0x0;var _0x57b2e8=_0x6d0c[_0x2127fe];return _0x57b2e8;};'use strict';var _=require(_0xc6d0('0x0'));var util=require(_0xc6d0('0x1'));var moment=require(_0xc6d0('0x2'));var BPromise=require(_0xc6d0('0x3'));var rs=require(_0xc6d0('0x4'));var fs=require('fs');var Redis=require(_0xc6d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6d0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc6d0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc6d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40ba33,_0xf1bb4f,_0x39e8be){return new BPromise(function(_0xbd2213,_0x1cf577){return client[_0xc6d0('0x9')](_0x40ba33,_0x39e8be)[_0xc6d0('0xa')](function(_0x1452b5){logger[_0xc6d0('0xb')](_0xc6d0('0xc'),_0xf1bb4f,_0xc6d0('0xd'));logger[_0xc6d0('0xe')](_0xc6d0('0xf'),_0xf1bb4f,_0xc6d0('0xd'),JSON[_0xc6d0('0x10')](_0x1452b5));if(_0x1452b5[_0xc6d0('0x11')]){if(_0x1452b5[_0xc6d0('0x11')][_0xc6d0('0x12')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0xf1bb4f,_0x1452b5[_0xc6d0('0x11')][_0xc6d0('0x13')]);return _0x1cf577(_0x1452b5['error'][_0xc6d0('0x13')]);}logger[_0xc6d0('0x11')](_0xc6d0('0xc'),_0xf1bb4f,_0x1452b5['error']['message']);return _0xbd2213(_0x1452b5[_0xc6d0('0x11')][_0xc6d0('0x13')]);}else{logger[_0xc6d0('0xb')]('CloudProvider,\x20%s,\x20%s',_0xf1bb4f,_0xc6d0('0xd'));_0xbd2213(_0x1452b5['result'][_0xc6d0('0x13')]);}})[_0xc6d0('0x14')](function(_0x34ea2f){logger[_0xc6d0('0x11')](_0xc6d0('0xc'),_0xf1bb4f,_0x34ea2f);_0x1cf577(_0x34ea2f);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 2455913..f0c928e 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 _0x6348=['show','post','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get','/:id'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x6348,0x1f3));var _0x8634=function(_0x24f5ad,_0x31ef05){_0x24f5ad=_0x24f5ad-0x0;var _0x455039=_0x6348[_0x24f5ad];return _0x455039;};'use strict';var multer=require('multer');var util=require(_0x8634('0x0'));var path=require(_0x8634('0x1'));var timeout=require(_0x8634('0x2'));var express=require('express');var router=express[_0x8634('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8634('0x4'));var interaction=require(_0x8634('0x5'));var config=require(_0x8634('0x6'));var controller=require(_0x8634('0x7'));router['get']('/',auth[_0x8634('0x8')](),controller['index']);router[_0x8634('0x9')](_0x8634('0xa'),auth['isAuthenticated'](),controller[_0x8634('0xb')]);router[_0x8634('0xc')]('/',auth[_0x8634('0x8')](),controller['create']);router['put'](_0x8634('0xa'),auth[_0x8634('0x8')](),controller['update']);router[_0x8634('0xd')](_0x8634('0xa'),auth[_0x8634('0x8')](),controller['destroy']);module[_0x8634('0xe')]=router;
\ No newline at end of file
+var _0x6ee9=['create','put','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0xd2cb45,_0x46892d){var _0x429082=function(_0x375404){while(--_0x375404){_0xd2cb45['push'](_0xd2cb45['shift']());}};_0x429082(++_0x46892d);}(_0x6ee9,0x9c));var _0x96ee=function(_0x178fd1,_0x47fabd){_0x178fd1=_0x178fd1-0x0;var _0x2c1ac2=_0x6ee9[_0x178fd1];return _0x2c1ac2;};'use strict';var multer=require('multer');var util=require(_0x96ee('0x0'));var path=require(_0x96ee('0x1'));var timeout=require('connect-timeout');var express=require(_0x96ee('0x2'));var router=express[_0x96ee('0x3')]();var fs_extra=require(_0x96ee('0x4'));var auth=require(_0x96ee('0x5'));var interaction=require(_0x96ee('0x6'));var config=require(_0x96ee('0x7'));var controller=require(_0x96ee('0x8'));router[_0x96ee('0x9')]('/',auth[_0x96ee('0xa')](),controller[_0x96ee('0xb')]);router[_0x96ee('0x9')](_0x96ee('0xc'),auth[_0x96ee('0xa')](),controller[_0x96ee('0xd')]);router[_0x96ee('0xe')]('/',auth[_0x96ee('0xa')](),controller[_0x96ee('0xf')]);router[_0x96ee('0x10')](_0x96ee('0xc'),auth[_0x96ee('0xa')](),controller['update']);router['delete'](_0x96ee('0xc'),auth[_0x96ee('0xa')](),controller[_0x96ee('0x11')]);module[_0x96ee('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 747351a..65d7579 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 _0x494a=['sequelize','exports','STRING','name'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x494a,0x17c));var _0xa494=function(_0x19587b,_0x324fad){_0x19587b=_0x19587b-0x0;var _0x3aebb3=_0x494a[_0x19587b];return _0x3aebb3;};'use strict';var Sequelize=require(_0xa494('0x0'));module[_0xa494('0x1')]={'name':{'type':Sequelize[_0xa494('0x2')],'unique':_0xa494('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa494('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa494('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa494('0x2')]},'street':{'type':Sequelize[_0xa494('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa494('0x2')]},'country':{'type':Sequelize[_0xa494('0x2')]},'email':{'type':Sequelize[_0xa494('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa494('0x2')]},'sStreet':{'type':Sequelize[_0xa494('0x2')]},'sPostalCode':{'type':Sequelize[_0xa494('0x2')]},'sCity':{'type':Sequelize[_0xa494('0x2')]},'sCountry':{'type':Sequelize[_0xa494('0x2')]},'description':{'type':Sequelize[_0xa494('0x2')]}};
\ No newline at end of file
+var _0x7662=['sequelize','exports','STRING'];(function(_0x1f7f84,_0x45cd8d){var _0x2f889c=function(_0x639e4b){while(--_0x639e4b){_0x1f7f84['push'](_0x1f7f84['shift']());}};_0x2f889c(++_0x45cd8d);}(_0x7662,0xd2));var _0x2766=function(_0x599e92,_0xc4135c){_0x599e92=_0x599e92-0x0;var _0xe61a16=_0x7662[_0x599e92];return _0xe61a16;};'use strict';var Sequelize=require(_0x2766('0x0'));module[_0x2766('0x1')]={'name':{'type':Sequelize[_0x2766('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2766('0x2')]},'companyId':{'type':Sequelize[_0x2766('0x2')]},'website':{'type':Sequelize[_0x2766('0x2')]},'phone':{'type':Sequelize[_0x2766('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2766('0x2')]},'street':{'type':Sequelize[_0x2766('0x2')]},'postalCode':{'type':Sequelize[_0x2766('0x2')]},'city':{'type':Sequelize[_0x2766('0x2')]},'country':{'type':Sequelize[_0x2766('0x2')]},'email':{'type':Sequelize[_0x2766('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2766('0x2')]},'sStreet':{'type':Sequelize[_0x2766('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x2766('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 da7607e..72dccb0 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 _0x7437=['end','sendStatus','error','stack','name','index','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','CmCompany','includeAll','include','findAll','rows','catch','show','rawAttributes','length','options','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','omit','ids','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','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','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Companies'];(function(_0x3cc57e,_0x29cd65){var _0x264316=function(_0x12992b){while(--_0x12992b){_0x3cc57e['push'](_0x3cc57e['shift']());}};_0x264316(++_0x29cd65);}(_0x7437,0xe6));var _0x7743=function(_0x3d0ab3,_0x2e1926){_0x3d0ab3=_0x3d0ab3-0x0;var _0x17fd2c=_0x7437[_0x3d0ab3];return _0x17fd2c;};'use strict';var emlformat=require(_0x7743('0x0'));var rimraf=require(_0x7743('0x1'));var zipdir=require(_0x7743('0x2'));var jsonpatch=require(_0x7743('0x3'));var rp=require(_0x7743('0x4'));var moment=require(_0x7743('0x5'));var BPromise=require(_0x7743('0x6'));var Mustache=require(_0x7743('0x7'));var util=require(_0x7743('0x8'));var path=require('path');var sox=require(_0x7743('0x9'));var csv=require(_0x7743('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7743('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7743('0xc'));var jsforce=require(_0x7743('0xd'));var deskjs=require(_0x7743('0xe'));var toCsv=require(_0x7743('0xa'));var querystring=require(_0x7743('0xf'));var Papa=require(_0x7743('0x10'));var Redis=require(_0x7743('0x11'));var authService=require(_0x7743('0x12'));var qs=require(_0x7743('0x13'));var as=require(_0x7743('0x14'));var hardwareService=require(_0x7743('0x15'));var logger=require(_0x7743('0x16'))(_0x7743('0x17'));var utils=require(_0x7743('0x18'));var config=require(_0x7743('0x19'));var licenseUtil=require(_0x7743('0x1a'));var db=require(_0x7743('0x1b'))['db'];function respondWithStatusCode(_0x2a1398,_0x58f989){_0x58f989=_0x58f989||0xcc;return function(_0x374c8e){if(_0x374c8e){return _0x2a1398['sendStatus'](_0x58f989);}return _0x2a1398[_0x7743('0x1c')](_0x58f989)['end']();};}function respondWithResult(_0x24ae63,_0x3a7cb7){_0x3a7cb7=_0x3a7cb7||0xc8;return function(_0x2a9bb6){if(_0x2a9bb6){return _0x24ae63[_0x7743('0x1c')](_0x3a7cb7)[_0x7743('0x1d')](_0x2a9bb6);}};}function respondWithFilteredResult(_0x5eb20e,_0x5c6744){return function(_0x471fe4){if(_0x471fe4){var _0x102f17=typeof _0x5c6744['offset']==='undefined'&&typeof _0x5c6744[_0x7743('0x1e')]===_0x7743('0x1f');var _0x1c7f26=_0x471fe4[_0x7743('0x20')];var _0x3f2702=_0x102f17?0x0:_0x5c6744[_0x7743('0x21')];var _0x4d0db2=_0x102f17?_0x471fe4[_0x7743('0x20')]:_0x5c6744['offset']+_0x5c6744['limit'];var _0x52f153;if(_0x4d0db2>=_0x1c7f26){_0x4d0db2=_0x1c7f26;_0x52f153=0xc8;}else{_0x52f153=0xce;}_0x5eb20e['status'](_0x52f153);return _0x5eb20e[_0x7743('0x22')]('Content-Range',_0x3f2702+'-'+_0x4d0db2+'/'+_0x1c7f26)['json'](_0x471fe4);}return null;};}function patchUpdates(_0x572485){return function(_0x16f155){try{jsonpatch[_0x7743('0x23')](_0x16f155,_0x572485,!![]);}catch(_0x3a20c3){return BPromise[_0x7743('0x24')](_0x3a20c3);}return _0x16f155[_0x7743('0x25')]();};}function saveUpdates(_0x1b6106,_0x455c9e){return function(_0x16f259){if(_0x16f259){return _0x16f259[_0x7743('0x26')](_0x1b6106)[_0x7743('0x27')](function(_0x22319d){return _0x22319d;});}return null;};}function removeEntity(_0x1272a2,_0x2a879a){return function(_0x46b67d){if(_0x46b67d){return _0x46b67d[_0x7743('0x28')]()[_0x7743('0x27')](function(){var _0x5ba375=_0x46b67d[_0x7743('0x29')]({'plain':!![]});var _0x28125d=_0x7743('0x2a');return db['UserProfileResource'][_0x7743('0x28')]({'where':{'type':_0x28125d,'resourceId':_0x5ba375['id']}})['then'](function(){return _0x46b67d;});})[_0x7743('0x27')](function(){_0x1272a2[_0x7743('0x1c')](0xcc)[_0x7743('0x2b')]();});}};}function handleEntityNotFound(_0x57ba34,_0xc634d8){return function(_0x48238d){if(!_0x48238d){_0x57ba34[_0x7743('0x2c')](0x194);}return _0x48238d;};}function handleError(_0x29eeb0,_0x30e386){_0x30e386=_0x30e386||0x1f4;return function(_0x1aac64){logger[_0x7743('0x2d')](_0x1aac64[_0x7743('0x2e')]);if(_0x1aac64['name']){delete _0x1aac64[_0x7743('0x2f')];}_0x29eeb0['status'](_0x30e386)['send'](_0x1aac64);};}exports[_0x7743('0x30')]=function(_0x49abc7,_0x1bbf54){var _0x1902da={},_0x5b7f14={},_0x27d7e6={'count':0x0,'rows':[]};return db['CmCompany'][_0x7743('0x31')]()[_0x7743('0x27')](function(_0x1a2ae0){_0x5b7f14[_0x7743('0x32')]=_[_0x7743('0x33')](_0x1a2ae0);_0x5b7f14['query']=_[_0x7743('0x33')](_0x49abc7[_0x7743('0x34')]);_0x5b7f14['filters']=_[_0x7743('0x35')](_0x5b7f14[_0x7743('0x32')],_0x5b7f14[_0x7743('0x34')]);_0x1902da[_0x7743('0x36')]=_['intersection'](_0x5b7f14[_0x7743('0x32')],qs[_0x7743('0x37')](_0x49abc7[_0x7743('0x34')]['fields']));_0x1902da[_0x7743('0x36')]=_0x1902da['attributes']['length']?_0x1902da[_0x7743('0x36')]:_0x5b7f14[_0x7743('0x32')];if(!_0x49abc7['query'][_0x7743('0x38')](_0x7743('0x39'))){_0x1902da[_0x7743('0x1e')]=qs[_0x7743('0x1e')](_0x49abc7[_0x7743('0x34')][_0x7743('0x1e')]);_0x1902da['offset']=qs[_0x7743('0x21')](_0x49abc7['query']['offset']);}_0x1902da[_0x7743('0x3a')]=qs[_0x7743('0x3b')](_0x49abc7[_0x7743('0x34')][_0x7743('0x3b')]);_0x1902da[_0x7743('0x3c')]=qs[_0x7743('0x3d')](_['pick'](_0x49abc7[_0x7743('0x34')],_0x5b7f14[_0x7743('0x3d')]),_0x1a2ae0);if(_0x49abc7[_0x7743('0x34')][_0x7743('0x3e')]){_0x1902da[_0x7743('0x3c')]=_[_0x7743('0x3f')](_0x1902da['where'],{'$or':_[_0x7743('0x40')](_0x1902da[_0x7743('0x36')],function(_0x106a2c){var _0xfa9c80={};_0xfa9c80[_0x106a2c]={'$like':'%'+_0x49abc7[_0x7743('0x34')][_0x7743('0x3e')]+'%'};return _0xfa9c80;})});}_0x1902da=_[_0x7743('0x3f')]({},_0x1902da,_0x49abc7['options']);var _0x37b6b8={'where':_0x1902da[_0x7743('0x3c')]};return db[_0x7743('0x41')][_0x7743('0x20')](_0x37b6b8)[_0x7743('0x27')](function(_0x5a7d7e){_0x27d7e6[_0x7743('0x20')]=_0x5a7d7e;if(_0x49abc7[_0x7743('0x34')][_0x7743('0x42')]){_0x1902da[_0x7743('0x43')]=[{'all':!![]}];}return db[_0x7743('0x41')][_0x7743('0x44')](_0x1902da);})[_0x7743('0x27')](function(_0x1a42c6){_0x27d7e6[_0x7743('0x45')]=_0x1a42c6;return _0x27d7e6;})[_0x7743('0x27')](respondWithFilteredResult(_0x1bbf54,_0x1902da))[_0x7743('0x46')](handleError(_0x1bbf54,null));})[_0x7743('0x46')](handleError(_0x1bbf54,null));};exports[_0x7743('0x47')]=function(_0x86ccaa,_0x47b171){var _0x145124={'raw':![],'where':{'id':_0x86ccaa['params']['id']}},_0x29dd36={};_0x29dd36[_0x7743('0x32')]=_[_0x7743('0x33')](db[_0x7743('0x41')][_0x7743('0x48')]);_0x29dd36[_0x7743('0x34')]=_[_0x7743('0x33')](_0x86ccaa[_0x7743('0x34')]);_0x29dd36[_0x7743('0x3d')]=_[_0x7743('0x35')](_0x29dd36[_0x7743('0x32')],_0x29dd36['query']);_0x145124[_0x7743('0x36')]=_[_0x7743('0x35')](_0x29dd36['model'],qs[_0x7743('0x37')](_0x86ccaa[_0x7743('0x34')][_0x7743('0x37')]));_0x145124['attributes']=_0x145124[_0x7743('0x36')][_0x7743('0x49')]?_0x145124[_0x7743('0x36')]:_0x29dd36[_0x7743('0x32')];if(_0x86ccaa[_0x7743('0x34')][_0x7743('0x42')]){_0x145124[_0x7743('0x43')]=[{'all':!![]}];}_0x145124=_[_0x7743('0x3f')]({},_0x145124,_0x86ccaa[_0x7743('0x4a')]);return db['CmCompany']['find'](_0x145124)[_0x7743('0x27')](handleEntityNotFound(_0x47b171,null))[_0x7743('0x27')](respondWithResult(_0x47b171,null))['catch'](handleError(_0x47b171,null));};exports[_0x7743('0x4b')]=function(_0x5cd6f4,_0x59cab8){return db[_0x7743('0x41')][_0x7743('0x4b')](_0x5cd6f4[_0x7743('0x4c')],{})[_0x7743('0x27')](function(_0x243cc4){var _0x536e50=_0x5cd6f4[_0x7743('0x4d')][_0x7743('0x29')]({'plain':!![]});if(!_0x536e50)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x536e50['role']===_0x7743('0x4d')){var _0x59fd91=_0x243cc4['get']({'plain':!![]});var _0x42ecbd=_0x7743('0x2a');return db[_0x7743('0x4e')][_0x7743('0x4f')]({'where':{'name':_0x42ecbd,'userProfileId':_0x536e50[_0x7743('0x50')]},'raw':!![]})[_0x7743('0x27')](function(_0x570a4c){if(_0x570a4c&&_0x570a4c[_0x7743('0x51')]===0x0){return db[_0x7743('0x52')]['create']({'name':_0x59fd91['name'],'resourceId':_0x59fd91['id'],'type':_0x570a4c[_0x7743('0x2f')],'sectionId':_0x570a4c['id']},{})[_0x7743('0x27')](function(){return _0x243cc4;});}else{return _0x243cc4;}})[_0x7743('0x46')](function(_0x5bdfe8){logger[_0x7743('0x2d')](_0x7743('0x53'),_0x5bdfe8);throw _0x5bdfe8;});}return _0x243cc4;})[_0x7743('0x27')](respondWithResult(_0x59cab8,0xc9))[_0x7743('0x46')](handleError(_0x59cab8,null));};exports[_0x7743('0x26')]=function(_0x215528,_0x37223d){if(_0x215528[_0x7743('0x4c')]['id']){delete _0x215528['body']['id'];}return db[_0x7743('0x41')][_0x7743('0x4f')]({'where':{'id':_0x215528[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x37223d,null))[_0x7743('0x27')](saveUpdates(_0x215528[_0x7743('0x4c')],null))[_0x7743('0x27')](respondWithResult(_0x37223d,null))[_0x7743('0x46')](handleError(_0x37223d,null));};exports['destroy']=function(_0xd47076,_0x6f93c3){return db[_0x7743('0x41')]['find']({'where':{'id':_0xd47076[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x6f93c3,null))[_0x7743('0x27')](removeEntity(_0x6f93c3,null))['catch'](handleError(_0x6f93c3,null));};exports[_0x7743('0x31')]=function(_0x14bbe7,_0xcc25bc){return db['CmCompany'][_0x7743('0x31')]()[_0x7743('0x27')](respondWithResult(_0xcc25bc,null))['catch'](handleError(_0xcc25bc,null));};exports[_0x7743('0x55')]=function(_0x27ea3f,_0x39c517,_0x909544){return db['CmContact'][_0x7743('0x4f')]({'where':{'id':_0x27ea3f[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x39c517,null))[_0x7743('0x27')](function(_0x406891){if(_0x406891){return _0x406891[_0x7743('0x55')](_0x27ea3f[_0x7743('0x4c')]['ids'],_[_0x7743('0x56')](_0x27ea3f[_0x7743('0x4c')],[_0x7743('0x57'),'id'])||{});}})[_0x7743('0x27')](respondWithResult(_0x39c517,null))[_0x7743('0x46')](handleError(_0x39c517,null));};exports[_0x7743('0x58')]=function(_0x408345,_0x94466b,_0x351046){var _0x46a8e3={};var _0x5c11af={};var _0x30e8ac;var _0x4c31f7;return db[_0x7743('0x41')][_0x7743('0x59')]({'where':{'id':_0x408345[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x94466b,null))['then'](function(_0x225121){if(_0x225121){_0x30e8ac=_0x225121;_0x5c11af['model']=_[_0x7743('0x33')](db[_0x7743('0x5a')][_0x7743('0x48')]);_0x5c11af[_0x7743('0x34')]=_[_0x7743('0x33')](_0x408345[_0x7743('0x34')]);_0x5c11af['filters']=_[_0x7743('0x35')](_0x5c11af[_0x7743('0x32')],_0x5c11af[_0x7743('0x34')]);_0x46a8e3[_0x7743('0x36')]=_[_0x7743('0x35')](_0x5c11af['model'],qs['fields'](_0x408345[_0x7743('0x34')][_0x7743('0x37')]));_0x46a8e3[_0x7743('0x36')]=_0x46a8e3['attributes'][_0x7743('0x49')]?_0x46a8e3['attributes']:_0x5c11af[_0x7743('0x32')];_0x46a8e3[_0x7743('0x3a')]=qs['sort'](_0x408345['query'][_0x7743('0x3b')]);_0x46a8e3[_0x7743('0x3c')]=qs[_0x7743('0x3d')](_['pick'](_0x408345[_0x7743('0x34')],_0x5c11af[_0x7743('0x3d')]));if(_0x408345[_0x7743('0x34')][_0x7743('0x3e')]){_0x46a8e3[_0x7743('0x3c')]=_[_0x7743('0x3f')](_0x46a8e3[_0x7743('0x3c')],{'$or':_[_0x7743('0x40')](_0x46a8e3['attributes'],function(_0x34066a){var _0x219074={};_0x219074[_0x34066a]={'$like':'%'+_0x408345[_0x7743('0x34')]['filter']+'%'};return _0x219074;})});}_0x46a8e3=_[_0x7743('0x3f')]({},_0x46a8e3,_0x408345[_0x7743('0x4a')]);return _0x30e8ac[_0x7743('0x58')](_0x46a8e3);}})[_0x7743('0x27')](function(_0x57a4d5){if(_0x57a4d5){_0x4c31f7=_0x57a4d5[_0x7743('0x49')];if(!_0x408345[_0x7743('0x34')][_0x7743('0x38')](_0x7743('0x39'))){_0x46a8e3['limit']=qs[_0x7743('0x1e')](_0x408345[_0x7743('0x34')][_0x7743('0x1e')]);_0x46a8e3[_0x7743('0x21')]=qs[_0x7743('0x21')](_0x408345[_0x7743('0x34')][_0x7743('0x21')]);}return _0x30e8ac[_0x7743('0x58')](_0x46a8e3);}})['then'](function(_0x3cf4e8){if(_0x3cf4e8){return _0x3cf4e8?{'count':_0x4c31f7,'rows':_0x3cf4e8}:null;}})['then'](respondWithResult(_0x94466b,null))[_0x7743('0x46')](handleError(_0x94466b,null));};
\ No newline at end of file
+var _0x3e18=['index','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','options','CmCompany','include','catch','show','params','rawAttributes','create','body','user','Companies','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','omit','ids','length','pick','filter','getContacts','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','get','destroy','stack','name','send'];(function(_0x28aeb2,_0x319b38){var _0x1d33e1=function(_0x651b59){while(--_0x651b59){_0x28aeb2['push'](_0x28aeb2['shift']());}};_0x1d33e1(++_0x319b38);}(_0x3e18,0x1d2));var _0x83e1=function(_0x2faa17,_0x2b3f70){_0x2faa17=_0x2faa17-0x0;var _0x2735c4=_0x3e18[_0x2faa17];return _0x2735c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83e1('0x0'));var zipdir=require(_0x83e1('0x1'));var jsonpatch=require(_0x83e1('0x2'));var rp=require('request-promise');var moment=require(_0x83e1('0x3'));var BPromise=require(_0x83e1('0x4'));var Mustache=require('mustache');var util=require(_0x83e1('0x5'));var path=require('path');var sox=require(_0x83e1('0x6'));var csv=require(_0x83e1('0x7'));var ejs=require(_0x83e1('0x8'));var fs=require('fs');var fs_extra=require(_0x83e1('0x9'));var _=require(_0x83e1('0xa'));var squel=require(_0x83e1('0xb'));var crypto=require(_0x83e1('0xc'));var jsforce=require(_0x83e1('0xd'));var deskjs=require(_0x83e1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x83e1('0xf'));var Redis=require(_0x83e1('0x10'));var authService=require(_0x83e1('0x11'));var qs=require(_0x83e1('0x12'));var as=require(_0x83e1('0x13'));var hardwareService=require(_0x83e1('0x14'));var logger=require(_0x83e1('0x15'))(_0x83e1('0x16'));var utils=require(_0x83e1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x83e1('0x18'));var db=require(_0x83e1('0x19'))['db'];function respondWithStatusCode(_0x41194e,_0x32f888){_0x32f888=_0x32f888||0xcc;return function(_0x5060d9){if(_0x5060d9){return _0x41194e[_0x83e1('0x1a')](_0x32f888);}return _0x41194e[_0x83e1('0x1b')](_0x32f888)[_0x83e1('0x1c')]();};}function respondWithResult(_0x214a4f,_0x9b6941){_0x9b6941=_0x9b6941||0xc8;return function(_0x4365b2){if(_0x4365b2){return _0x214a4f[_0x83e1('0x1b')](_0x9b6941)[_0x83e1('0x1d')](_0x4365b2);}};}function respondWithFilteredResult(_0x91ea81,_0x30a02a){return function(_0x549edc){if(_0x549edc){var _0x292695=typeof _0x30a02a[_0x83e1('0x1e')]===_0x83e1('0x1f')&&typeof _0x30a02a[_0x83e1('0x20')]===_0x83e1('0x1f');var _0x38dd16=_0x549edc[_0x83e1('0x21')];var _0x2071da=_0x292695?0x0:_0x30a02a[_0x83e1('0x1e')];var _0x3c0446=_0x292695?_0x549edc[_0x83e1('0x21')]:_0x30a02a[_0x83e1('0x1e')]+_0x30a02a['limit'];var _0x5f570f;if(_0x3c0446>=_0x38dd16){_0x3c0446=_0x38dd16;_0x5f570f=0xc8;}else{_0x5f570f=0xce;}_0x91ea81[_0x83e1('0x1b')](_0x5f570f);return _0x91ea81['set']('Content-Range',_0x2071da+'-'+_0x3c0446+'/'+_0x38dd16)['json'](_0x549edc);}return null;};}function patchUpdates(_0x3b9f11){return function(_0x13a85c){try{jsonpatch[_0x83e1('0x22')](_0x13a85c,_0x3b9f11,!![]);}catch(_0x2f4f61){return BPromise[_0x83e1('0x23')](_0x2f4f61);}return _0x13a85c[_0x83e1('0x24')]();};}function saveUpdates(_0x61de2,_0x25fdee){return function(_0x1f7266){if(_0x1f7266){return _0x1f7266[_0x83e1('0x25')](_0x61de2)[_0x83e1('0x26')](function(_0x300a91){return _0x300a91;});}return null;};}function removeEntity(_0x2fdb2d,_0x4891b0){return function(_0x45c790){if(_0x45c790){return _0x45c790['destroy']()[_0x83e1('0x26')](function(){var _0x494b96=_0x45c790[_0x83e1('0x27')]({'plain':!![]});var _0x553b99='Companies';return db['UserProfileResource'][_0x83e1('0x28')]({'where':{'type':_0x553b99,'resourceId':_0x494b96['id']}})[_0x83e1('0x26')](function(){return _0x45c790;});})[_0x83e1('0x26')](function(){_0x2fdb2d[_0x83e1('0x1b')](0xcc)[_0x83e1('0x1c')]();});}};}function handleEntityNotFound(_0x598770,_0x247e24){return function(_0x3ecf35){if(!_0x3ecf35){_0x598770[_0x83e1('0x1a')](0x194);}return _0x3ecf35;};}function handleError(_0x51ffb0,_0x4f99a6){_0x4f99a6=_0x4f99a6||0x1f4;return function(_0x10a704){logger['error'](_0x10a704[_0x83e1('0x29')]);if(_0x10a704[_0x83e1('0x2a')]){delete _0x10a704[_0x83e1('0x2a')];}_0x51ffb0[_0x83e1('0x1b')](_0x4f99a6)[_0x83e1('0x2b')](_0x10a704);};}exports[_0x83e1('0x2c')]=function(_0x5219dc,_0x201b32){var _0x26a858={},_0x2ca447={},_0x338670={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x83e1('0x26')](function(_0x1e8893){_0x2ca447['model']=_[_0x83e1('0x2d')](_0x1e8893);_0x2ca447['query']=_[_0x83e1('0x2d')](_0x5219dc[_0x83e1('0x2e')]);_0x2ca447[_0x83e1('0x2f')]=_['intersection'](_0x2ca447['model'],_0x2ca447[_0x83e1('0x2e')]);_0x26a858[_0x83e1('0x30')]=_[_0x83e1('0x31')](_0x2ca447[_0x83e1('0x32')],qs['fields'](_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x33')]));_0x26a858[_0x83e1('0x30')]=_0x26a858[_0x83e1('0x30')]['length']?_0x26a858[_0x83e1('0x30')]:_0x2ca447[_0x83e1('0x32')];if(!_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x34')](_0x83e1('0x35'))){_0x26a858[_0x83e1('0x20')]=qs['limit'](_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x20')]);_0x26a858[_0x83e1('0x1e')]=qs[_0x83e1('0x1e')](_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x1e')]);}_0x26a858[_0x83e1('0x36')]=qs['sort'](_0x5219dc[_0x83e1('0x2e')][_0x83e1('0x37')]);_0x26a858[_0x83e1('0x38')]=qs[_0x83e1('0x2f')](_['pick'](_0x5219dc['query'],_0x2ca447[_0x83e1('0x2f')]),_0x1e8893);if(_0x5219dc['query']['filter']){_0x26a858[_0x83e1('0x38')]=_[_0x83e1('0x39')](_0x26a858[_0x83e1('0x38')],{'$or':_[_0x83e1('0x3a')](_0x26a858['attributes'],function(_0x5ea8b0){var _0x4967ac={};_0x4967ac[_0x5ea8b0]={'$like':'%'+_0x5219dc['query']['filter']+'%'};return _0x4967ac;})});}_0x26a858=_[_0x83e1('0x39')]({},_0x26a858,_0x5219dc[_0x83e1('0x3b')]);var _0x3a323c={'where':_0x26a858[_0x83e1('0x38')]};return db[_0x83e1('0x3c')][_0x83e1('0x21')](_0x3a323c)[_0x83e1('0x26')](function(_0x18b894){_0x338670[_0x83e1('0x21')]=_0x18b894;if(_0x5219dc['query']['includeAll']){_0x26a858[_0x83e1('0x3d')]=[{'all':!![]}];}return db[_0x83e1('0x3c')]['findAll'](_0x26a858);})[_0x83e1('0x26')](function(_0xe90011){_0x338670['rows']=_0xe90011;return _0x338670;})[_0x83e1('0x26')](respondWithFilteredResult(_0x201b32,_0x26a858))['catch'](handleError(_0x201b32,null));})[_0x83e1('0x3e')](handleError(_0x201b32,null));};exports[_0x83e1('0x3f')]=function(_0x5958b0,_0x36fae6){var _0x2bea0e={'raw':![],'where':{'id':_0x5958b0[_0x83e1('0x40')]['id']}},_0x1fa023={};_0x1fa023[_0x83e1('0x32')]=_[_0x83e1('0x2d')](db[_0x83e1('0x3c')][_0x83e1('0x41')]);_0x1fa023['query']=_[_0x83e1('0x2d')](_0x5958b0[_0x83e1('0x2e')]);_0x1fa023[_0x83e1('0x2f')]=_[_0x83e1('0x31')](_0x1fa023[_0x83e1('0x32')],_0x1fa023[_0x83e1('0x2e')]);_0x2bea0e[_0x83e1('0x30')]=_[_0x83e1('0x31')](_0x1fa023[_0x83e1('0x32')],qs[_0x83e1('0x33')](_0x5958b0['query']['fields']));_0x2bea0e[_0x83e1('0x30')]=_0x2bea0e['attributes']['length']?_0x2bea0e[_0x83e1('0x30')]:_0x1fa023[_0x83e1('0x32')];if(_0x5958b0[_0x83e1('0x2e')]['includeAll']){_0x2bea0e[_0x83e1('0x3d')]=[{'all':!![]}];}_0x2bea0e=_[_0x83e1('0x39')]({},_0x2bea0e,_0x5958b0[_0x83e1('0x3b')]);return db['CmCompany']['find'](_0x2bea0e)[_0x83e1('0x26')](handleEntityNotFound(_0x36fae6,null))['then'](respondWithResult(_0x36fae6,null))['catch'](handleError(_0x36fae6,null));};exports[_0x83e1('0x42')]=function(_0x1e5916,_0x5b3af4){return db[_0x83e1('0x3c')][_0x83e1('0x42')](_0x1e5916[_0x83e1('0x43')],{})[_0x83e1('0x26')](function(_0x2f9e81){var _0x37a9d9=_0x1e5916[_0x83e1('0x44')][_0x83e1('0x27')]({'plain':!![]});if(!_0x37a9d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37a9d9['role']===_0x83e1('0x44')){var _0x36030b=_0x2f9e81['get']({'plain':!![]});var _0x222bb6=_0x83e1('0x45');return db[_0x83e1('0x46')][_0x83e1('0x47')]({'where':{'name':_0x222bb6,'userProfileId':_0x37a9d9[_0x83e1('0x48')]},'raw':!![]})['then'](function(_0x26c80c){if(_0x26c80c&&_0x26c80c[_0x83e1('0x49')]===0x0){return db[_0x83e1('0x4a')][_0x83e1('0x42')]({'name':_0x36030b['name'],'resourceId':_0x36030b['id'],'type':_0x26c80c[_0x83e1('0x2a')],'sectionId':_0x26c80c['id']},{})[_0x83e1('0x26')](function(){return _0x2f9e81;});}else{return _0x2f9e81;}})[_0x83e1('0x3e')](function(_0x40edbb){logger['error'](_0x83e1('0x4b'),_0x40edbb);throw _0x40edbb;});}return _0x2f9e81;})[_0x83e1('0x26')](respondWithResult(_0x5b3af4,0xc9))[_0x83e1('0x3e')](handleError(_0x5b3af4,null));};exports['update']=function(_0x10afff,_0x112c2a){if(_0x10afff['body']['id']){delete _0x10afff[_0x83e1('0x43')]['id'];}return db[_0x83e1('0x3c')][_0x83e1('0x47')]({'where':{'id':_0x10afff['params']['id']}})['then'](handleEntityNotFound(_0x112c2a,null))[_0x83e1('0x26')](saveUpdates(_0x10afff['body'],null))[_0x83e1('0x26')](respondWithResult(_0x112c2a,null))[_0x83e1('0x3e')](handleError(_0x112c2a,null));};exports[_0x83e1('0x28')]=function(_0x5ae890,_0x30fc68){return db['CmCompany'][_0x83e1('0x47')]({'where':{'id':_0x5ae890['params']['id']}})[_0x83e1('0x26')](handleEntityNotFound(_0x30fc68,null))['then'](removeEntity(_0x30fc68,null))[_0x83e1('0x3e')](handleError(_0x30fc68,null));};exports['describe']=function(_0x1bc74c,_0x2b8da5){return db[_0x83e1('0x3c')][_0x83e1('0x4c')]()['then'](respondWithResult(_0x2b8da5,null))[_0x83e1('0x3e')](handleError(_0x2b8da5,null));};exports[_0x83e1('0x4d')]=function(_0x229ccd,_0x5191b0,_0x27a2c9){return db[_0x83e1('0x4e')]['find']({'where':{'id':_0x229ccd['params']['id']}})[_0x83e1('0x26')](handleEntityNotFound(_0x5191b0,null))[_0x83e1('0x26')](function(_0x4bd404){if(_0x4bd404){return _0x4bd404[_0x83e1('0x4d')](_0x229ccd['body']['ids'],_[_0x83e1('0x4f')](_0x229ccd[_0x83e1('0x43')],[_0x83e1('0x50'),'id'])||{});}})['then'](respondWithResult(_0x5191b0,null))[_0x83e1('0x3e')](handleError(_0x5191b0,null));};exports['getContacts']=function(_0x53fc87,_0x5bd9af,_0x376e9b){var _0x38a7fc={};var _0x4c1e74={};var _0x2ba62c;var _0x3c0d26;return db[_0x83e1('0x3c')]['findOne']({'where':{'id':_0x53fc87['params']['id']}})[_0x83e1('0x26')](handleEntityNotFound(_0x5bd9af,null))[_0x83e1('0x26')](function(_0x314ced){if(_0x314ced){_0x2ba62c=_0x314ced;_0x4c1e74['model']=_[_0x83e1('0x2d')](db[_0x83e1('0x4e')][_0x83e1('0x41')]);_0x4c1e74['query']=_[_0x83e1('0x2d')](_0x53fc87['query']);_0x4c1e74[_0x83e1('0x2f')]=_[_0x83e1('0x31')](_0x4c1e74[_0x83e1('0x32')],_0x4c1e74['query']);_0x38a7fc[_0x83e1('0x30')]=_[_0x83e1('0x31')](_0x4c1e74[_0x83e1('0x32')],qs[_0x83e1('0x33')](_0x53fc87['query'][_0x83e1('0x33')]));_0x38a7fc[_0x83e1('0x30')]=_0x38a7fc[_0x83e1('0x30')][_0x83e1('0x51')]?_0x38a7fc[_0x83e1('0x30')]:_0x4c1e74[_0x83e1('0x32')];_0x38a7fc[_0x83e1('0x36')]=qs[_0x83e1('0x37')](_0x53fc87[_0x83e1('0x2e')]['sort']);_0x38a7fc[_0x83e1('0x38')]=qs[_0x83e1('0x2f')](_[_0x83e1('0x52')](_0x53fc87[_0x83e1('0x2e')],_0x4c1e74[_0x83e1('0x2f')]));if(_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x53')]){_0x38a7fc[_0x83e1('0x38')]=_[_0x83e1('0x39')](_0x38a7fc[_0x83e1('0x38')],{'$or':_[_0x83e1('0x3a')](_0x38a7fc[_0x83e1('0x30')],function(_0x1ff972){var _0x3b3503={};_0x3b3503[_0x1ff972]={'$like':'%'+_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x53')]+'%'};return _0x3b3503;})});}_0x38a7fc=_[_0x83e1('0x39')]({},_0x38a7fc,_0x53fc87[_0x83e1('0x3b')]);return _0x2ba62c[_0x83e1('0x54')](_0x38a7fc);}})[_0x83e1('0x26')](function(_0x5737cf){if(_0x5737cf){_0x3c0d26=_0x5737cf[_0x83e1('0x51')];if(!_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x34')](_0x83e1('0x35'))){_0x38a7fc['limit']=qs[_0x83e1('0x20')](_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x20')]);_0x38a7fc['offset']=qs[_0x83e1('0x1e')](_0x53fc87[_0x83e1('0x2e')][_0x83e1('0x1e')]);}return _0x2ba62c[_0x83e1('0x54')](_0x38a7fc);}})[_0x83e1('0x26')](function(_0x245416){if(_0x245416){return _0x245416?{'count':_0x3c0d26,'rows':_0x245416}:null;}})['then'](respondWithResult(_0x5bd9af,null))[_0x83e1('0x3e')](handleError(_0x5bd9af,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 55be2b1..8ae5731 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 _0xe420=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xe420,0xb0));var _0x0e42=function(_0xa272c4,_0x1cf585){_0xa272c4=_0xa272c4-0x0;var _0x555142=_0xe420[_0xa272c4];return _0x555142;};'use strict';var _=require(_0x0e42('0x0'));var util=require(_0x0e42('0x1'));var logger=require(_0x0e42('0x2'))(_0x0e42('0x3'));var moment=require(_0x0e42('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e42('0x5'));var fs=require('fs');var path=require(_0x0e42('0x6'));var rimraf=require(_0x0e42('0x7'));var config=require(_0x0e42('0x8'));var attributes=require(_0x0e42('0x9'));module['exports']=function(_0x27b5f1,_0x33604f){return _0x27b5f1[_0x0e42('0xa')](_0x0e42('0xb'),attributes,{'tableName':_0x0e42('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x73f2=['./cmCompany.attributes','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x73f2,0x116));var _0x273f=function(_0x12d8fb,_0x35487a){_0x12d8fb=_0x12d8fb-0x0;var _0x4b81dc=_0x73f2[_0x12d8fb];return _0x4b81dc;};'use strict';var _=require(_0x273f('0x0'));var util=require(_0x273f('0x1'));var logger=require(_0x273f('0x2'))(_0x273f('0x3'));var moment=require('moment');var BPromise=require(_0x273f('0x4'));var rp=require(_0x273f('0x5'));var fs=require('fs');var path=require(_0x273f('0x6'));var rimraf=require(_0x273f('0x7'));var config=require('../../config/environment');var attributes=require(_0x273f('0x8'));module['exports']=function(_0x4c6f65,_0x30bdf2){return _0x4c6f65['define'](_0x273f('0x9'),attributes,{'tableName':_0x273f('0xa'),'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 4af4b41..9e6c617 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 _0x5b64=['request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1e5019,_0x516600){var _0x5bb93a=function(_0x4b4df4){while(--_0x4b4df4){_0x1e5019['push'](_0x1e5019['shift']());}};_0x5bb93a(++_0x516600);}(_0x5b64,0x66));var _0x45b6=function(_0x7cc4c4,_0x544d32){_0x7cc4c4=_0x7cc4c4-0x0;var _0x5d464b=_0x5b64[_0x7cc4c4];return _0x5d464b;};'use strict';var _=require(_0x45b6('0x0'));var util=require(_0x45b6('0x1'));var moment=require(_0x45b6('0x2'));var BPromise=require(_0x45b6('0x3'));var rs=require(_0x45b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45b6('0x5'))['db'];var utils=require(_0x45b6('0x6'));var logger=require(_0x45b6('0x7'))(_0x45b6('0x8'));var config=require(_0x45b6('0x9'));var jayson=require(_0x45b6('0xa'));var client=jayson[_0x45b6('0xb')][_0x45b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x272c8a,_0xf0ad47,_0x1d118a){return new BPromise(function(_0x239074,_0x536669){return client[_0x45b6('0xd')](_0x272c8a,_0x1d118a)['then'](function(_0x4891ff){logger[_0x45b6('0xe')]('CmCompany,\x20%s,\x20%s',_0xf0ad47,_0x45b6('0xf'));logger[_0x45b6('0x10')](_0x45b6('0x11'),_0xf0ad47,'request\x20sent',JSON[_0x45b6('0x12')](_0x4891ff));if(_0x4891ff[_0x45b6('0x13')]){if(_0x4891ff['error'][_0x45b6('0x14')]===0x1f4){logger[_0x45b6('0x13')](_0x45b6('0x15'),_0xf0ad47,_0x4891ff[_0x45b6('0x13')][_0x45b6('0x16')]);return _0x536669(_0x4891ff[_0x45b6('0x13')]['message']);}logger['error'](_0x45b6('0x15'),_0xf0ad47,_0x4891ff['error'][_0x45b6('0x16')]);return _0x239074(_0x4891ff[_0x45b6('0x13')]['message']);}else{logger[_0x45b6('0xe')](_0x45b6('0x15'),_0xf0ad47,'request\x20sent');_0x239074(_0x4891ff['result'][_0x45b6('0x16')]);}})['catch'](function(_0xebfc33){logger[_0x45b6('0x13')](_0x45b6('0x15'),_0xf0ad47,_0xebfc33);_0x536669(_0xebfc33);});});}
\ No newline at end of file
+var _0xceb4=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0xceb4,0x1a6));var _0x4ceb=function(_0x1605b0,_0x5c753c){_0x1605b0=_0x1605b0-0x0;var _0x1fcff5=_0xceb4[_0x1605b0];return _0x1fcff5;};'use strict';var _=require(_0x4ceb('0x0'));var util=require('util');var moment=require(_0x4ceb('0x1'));var BPromise=require(_0x4ceb('0x2'));var rs=require(_0x4ceb('0x3'));var fs=require('fs');var Redis=require(_0x4ceb('0x4'));var db=require(_0x4ceb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4ceb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4ceb('0x7'));var client=jayson[_0x4ceb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56b032,_0x297826,_0x2798b5){return new BPromise(function(_0x5cef93,_0x332c8a){return client[_0x4ceb('0x9')](_0x56b032,_0x2798b5)[_0x4ceb('0xa')](function(_0x103800){logger[_0x4ceb('0xb')](_0x4ceb('0xc'),_0x297826,_0x4ceb('0xd'));logger['debug'](_0x4ceb('0xe'),_0x297826,'request\x20sent',JSON[_0x4ceb('0xf')](_0x103800));if(_0x103800[_0x4ceb('0x10')]){if(_0x103800['error'][_0x4ceb('0x11')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x297826,_0x103800[_0x4ceb('0x10')]['message']);return _0x332c8a(_0x103800[_0x4ceb('0x10')][_0x4ceb('0x12')]);}logger[_0x4ceb('0x10')](_0x4ceb('0xc'),_0x297826,_0x103800[_0x4ceb('0x10')]['message']);return _0x5cef93(_0x103800[_0x4ceb('0x10')][_0x4ceb('0x12')]);}else{logger[_0x4ceb('0xb')]('CmCompany,\x20%s,\x20%s',_0x297826,'request\x20sent');_0x5cef93(_0x103800[_0x4ceb('0x13')][_0x4ceb('0x12')]);}})[_0x4ceb('0x14')](function(_0x4ffb7d){logger[_0x4ceb('0x10')](_0x4ceb('0xc'),_0x297826,_0x4ffb7d);_0x332c8a(_0x4ffb7d);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index e8e522f..b5fbfcd 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 _0x1d39=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0x1d39,0x108));var _0x91d3=function(_0x10c4d6,_0x1cd56c){_0x10c4d6=_0x10c4d6-0x0;var _0x3a4a5f=_0x1d39[_0x10c4d6];return _0x3a4a5f;};'use strict';var multer=require(_0x91d3('0x0'));var util=require(_0x91d3('0x1'));var path=require(_0x91d3('0x2'));var timeout=require(_0x91d3('0x3'));var express=require(_0x91d3('0x4'));var router=express[_0x91d3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91d3('0x6'));var interaction=require(_0x91d3('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x91d3('0x8')]('/',auth[_0x91d3('0x9')](),controller[_0x91d3('0xa')]);router[_0x91d3('0x8')](_0x91d3('0xb'),auth[_0x91d3('0x9')](),controller[_0x91d3('0xc')]);router[_0x91d3('0x8')](_0x91d3('0xd'),auth['isAuthenticated'](),controller[_0x91d3('0xe')]);router['get'](_0x91d3('0xf'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x10')]);router[_0x91d3('0x11')]('/',auth[_0x91d3('0x9')](),controller['create']);router[_0x91d3('0x11')](_0x91d3('0xf'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x12')]);router[_0x91d3('0x13')](_0x91d3('0xd'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x14')]);router[_0x91d3('0x15')](_0x91d3('0xd'),auth['isAuthenticated'](),controller[_0x91d3('0x16')]);module[_0x91d3('0x17')]=router;
\ No newline at end of file
+var _0x8481=['/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x8481,0xb0));var _0x1848=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0x8481[_0x1a72b8];return _0x39f72d;};'use strict';var multer=require('multer');var util=require(_0x1848('0x0'));var path=require(_0x1848('0x1'));var timeout=require(_0x1848('0x2'));var express=require(_0x1848('0x3'));var router=express[_0x1848('0x4')]();var fs_extra=require(_0x1848('0x5'));var auth=require(_0x1848('0x6'));var interaction=require(_0x1848('0x7'));var config=require(_0x1848('0x8'));var controller=require(_0x1848('0x9'));router[_0x1848('0xa')]('/',auth[_0x1848('0xb')](),controller[_0x1848('0xc')]);router['get']('/describe',auth[_0x1848('0xb')](),controller[_0x1848('0xd')]);router['get'](_0x1848('0xe'),auth[_0x1848('0xb')](),controller[_0x1848('0xf')]);router['get'](_0x1848('0x10'),auth[_0x1848('0xb')](),controller[_0x1848('0x11')]);router['post']('/',auth[_0x1848('0xb')](),controller['create']);router[_0x1848('0x12')](_0x1848('0x10'),auth[_0x1848('0xb')](),controller[_0x1848('0x13')]);router[_0x1848('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1848('0x15')]);router[_0x1848('0x16')]('/:id',auth[_0x1848('0xb')](),controller[_0x1848('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 263f971..df337cc 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 _0xeca1=['DATE','NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x3f830b,_0x493523){var _0x33f6f2=function(_0x1e2751){while(--_0x1e2751){_0x3f830b['push'](_0x3f830b['shift']());}};_0x33f6f2(++_0x493523);}(_0xeca1,0x10a));var _0x1eca=function(_0x142d26,_0x1920db){_0x142d26=_0x142d26-0x0;var _0x4aee13=_0xeca1[_0x142d26];return _0x4aee13;};'use strict';var _=require(_0x1eca('0x0'));var Sequelize=require('sequelize');module[_0x1eca('0x1')]={'firstName':{'type':Sequelize[_0x1eca('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1eca('0x2')]},'street':{'type':Sequelize[_0x1eca('0x2')]},'postalCode':{'type':Sequelize[_0x1eca('0x2')]},'city':{'type':Sequelize[_0x1eca('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1eca('0x2')]},'description':{'type':Sequelize[_0x1eca('0x3')]},'phone':{'type':Sequelize[_0x1eca('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1eca('0x2')]},'email':{'type':Sequelize[_0x1eca('0x2')]},'url':{'type':Sequelize[_0x1eca('0x2')]},'facebook':{'type':Sequelize[_0x1eca('0x2')]},'fb_data':{'type':Sequelize[_0x1eca('0x2')]},'twitter':{'type':Sequelize[_0x1eca('0x2')]},'skype':{'type':Sequelize[_0x1eca('0x2')]},'teams':{'type':Sequelize[_0x1eca('0x2')]},'viber':{'type':Sequelize[_0x1eca('0x2')]},'line':{'type':Sequelize[_0x1eca('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1eca('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x1eca('0x4')](0x2)[_0x1eca('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1eca('0x6')],'defaultValue':Sequelize[_0x1eca('0x7')]}};
\ No newline at end of file
+var _0x2520=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','lodash'];(function(_0x1ee0a1,_0x51058e){var _0x1d2d5b=function(_0x35cfb5){while(--_0x35cfb5){_0x1ee0a1['push'](_0x1ee0a1['shift']());}};_0x1d2d5b(++_0x51058e);}(_0x2520,0x156));var _0x0252=function(_0x362803,_0x177d1c){_0x362803=_0x362803-0x0;var _0x470744=_0x2520[_0x362803];return _0x470744;};'use strict';var _=require(_0x0252('0x0'));var Sequelize=require(_0x0252('0x1'));module[_0x0252('0x2')]={'firstName':{'type':Sequelize[_0x0252('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0252('0x3')]},'street':{'type':Sequelize[_0x0252('0x3')]},'postalCode':{'type':Sequelize[_0x0252('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0252('0x3')]},'dateOfBirth':{'type':Sequelize[_0x0252('0x3')]},'description':{'type':Sequelize[_0x0252('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0252('0x3')]},'fax':{'type':Sequelize[_0x0252('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x0252('0x3')]},'facebook':{'type':Sequelize[_0x0252('0x3')]},'fb_data':{'type':Sequelize[_0x0252('0x3')]},'twitter':{'type':Sequelize[_0x0252('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x0252('0x3')]},'line':{'type':Sequelize[_0x0252('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x0252('0x3')]},'UserId':{'type':Sequelize[_0x0252('0x5')]},'priority':{'type':Sequelize[_0x0252('0x5')](0x2)[_0x0252('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 30213c3..4257160 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 _0xe6cc=['isEmpty','forEach','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','c.id','DESC','t.id\x20IN\x20?','resolve','user','agent','some','getLists','c.ListId\x20IS\x20NULL','role','sequelize','keyBy','merge','c.firstName','c.phone','c.email','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','toString','Tags','rows','catch','params','tags','columnName','displayName','CmCustomField','findAll','alias','custom','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappQueueReport','each','duplicates','ListId','show','$and','omit','format','cf_%d','pickBy','setFields','id\x20=\x20?','toParam','values','phone','getTags','rawAttributes','sort','options','setTags','ids','getHoppers','nolimit','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','parse','meta','import','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','mail','chat','fax','whatsapp','-createdAt','includes','toLowerCase','Invalid\x20channel','channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','uniqueid','source','callerid','starttime','endtime','duration','userDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closed','closedAt','createdAt','note','disposition','secondDisposition','thirdDisposition','key','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','subject','substatus','openchannel','Owner','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','end','error','name','send','CmContact','describe','keys','startsWith','cf_','push','findOne','trimStart','all','fieldType','type','query','intersection','model','attributes','fields','hasOwnProperty','order','where','filters','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','length','find','Tag','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','value','dateOfBirth','datetime','castTo','DATE','text','start','filter','Contact'];(function(_0x40b862,_0x2cbad7){var _0x54bd68=function(_0x193fbf){while(--_0x193fbf){_0x40b862['push'](_0x40b862['shift']());}};_0x54bd68(++_0x2cbad7);}(_0xe6cc,0xbf));var _0xce6c=function(_0xb76872,_0x20e04a){_0xb76872=_0xb76872-0x0;var _0x48f16e=_0xe6cc[_0xb76872];return _0x48f16e;};'use strict';var emlformat=require(_0xce6c('0x0'));var rimraf=require(_0xce6c('0x1'));var zipdir=require(_0xce6c('0x2'));var jsonpatch=require(_0xce6c('0x3'));var rp=require(_0xce6c('0x4'));var moment=require('moment');var BPromise=require(_0xce6c('0x5'));var Mustache=require('mustache');var util=require(_0xce6c('0x6'));var path=require(_0xce6c('0x7'));var sox=require(_0xce6c('0x8'));var csv=require(_0xce6c('0x9'));var ejs=require(_0xce6c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce6c('0xb'));var squel=require(_0xce6c('0xc'));var crypto=require(_0xce6c('0xd'));var jsforce=require(_0xce6c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xce6c('0x9'));var querystring=require(_0xce6c('0xf'));var Papa=require('papaparse');var Redis=require(_0xce6c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xce6c('0x11'));var hardwareService=require(_0xce6c('0x12'));var logger=require('../../config/logger')(_0xce6c('0x13'));var utils=require(_0xce6c('0x14'));var config=require(_0xce6c('0x15'));var licenseUtil=require(_0xce6c('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xce6c('0x17')](config[_0xce6c('0x18')],{'host':_0xce6c('0x19'),'port':0x18eb});var socket=require(_0xce6c('0x1a'))(new Redis(config[_0xce6c('0x18')]));require(_0xce6c('0x1b'))[_0xce6c('0x1c')](socket);function respondWithStatusCode(_0x114c77,_0x2ba32f){_0x2ba32f=_0x2ba32f||0xcc;return function(_0x404f67){if(_0x404f67){return _0x114c77[_0xce6c('0x1d')](_0x2ba32f);}return _0x114c77['status'](_0x2ba32f)['end']();};}function respondWithResult(_0x5baa9b,_0x40057f){_0x40057f=_0x40057f||0xc8;return function(_0x28ab7b){if(_0x28ab7b){return _0x5baa9b[_0xce6c('0x1e')](_0x40057f)['json'](_0x28ab7b);}};}function respondWithFilteredResult(_0x215286,_0x46b4c7){return function(_0xf55362){if(_0xf55362){var _0x1173d0=typeof _0x46b4c7[_0xce6c('0x1f')]==='undefined'&&typeof _0x46b4c7[_0xce6c('0x20')]==='undefined';var _0x1db1ed=_0xf55362[_0xce6c('0x21')];var _0x552717=_0x1173d0?0x0:_0x46b4c7[_0xce6c('0x1f')];var _0xb785bf=_0x1173d0?_0xf55362['count']:_0x46b4c7[_0xce6c('0x1f')]+_0x46b4c7[_0xce6c('0x20')];var _0xf1db22;if(_0xb785bf>=_0x1db1ed){_0xb785bf=_0x1db1ed;_0xf1db22=0xc8;}else{_0xf1db22=0xce;}_0x215286[_0xce6c('0x1e')](_0xf1db22);return _0x215286[_0xce6c('0x22')](_0xce6c('0x23'),_0x552717+'-'+_0xb785bf+'/'+_0x1db1ed)[_0xce6c('0x24')](_0xf55362);}return null;};}function patchUpdates(_0x53f736){return function(_0x497a91){try{jsonpatch[_0xce6c('0x25')](_0x497a91,_0x53f736,!![]);}catch(_0x336b87){return BPromise[_0xce6c('0x26')](_0x336b87);}return _0x497a91[_0xce6c('0x27')]();};}function saveUpdates(_0xb221c6,_0x2179ee){return function(_0x4e7666){if(_0x4e7666){return _0x4e7666['update'](_0xb221c6)[_0xce6c('0x28')](function(_0x438a0b){return _0x438a0b;});}return null;};}function removeEntity(_0x119fb9,_0x561cbb){return function(_0x330bad){if(_0x330bad){return _0x330bad[_0xce6c('0x29')]()[_0xce6c('0x28')](function(){_0x119fb9['status'](0xcc)[_0xce6c('0x2a')]();});}};}function handleEntityNotFound(_0x4cb444,_0x5c2433){return function(_0x23327e){if(!_0x23327e){_0x4cb444['sendStatus'](0x194);}return _0x23327e;};}function handleError(_0x1ecb80,_0x2a3f3b){_0x2a3f3b=_0x2a3f3b||0x1f4;return function(_0x569cc6){logger[_0xce6c('0x2b')](_0x569cc6['stack']);if(_0x569cc6[_0xce6c('0x2c')]){delete _0x569cc6[_0xce6c('0x2c')];}_0x1ecb80[_0xce6c('0x1e')](_0x2a3f3b)[_0xce6c('0x2d')](_0x569cc6);};}exports['index']=function(_0x27f686,_0x33e5e0){var _0x2cae07={},_0xa3257f={},_0x242ff3={'count':0x0,'rows':[]};return db[_0xce6c('0x2e')][_0xce6c('0x2f')]()[_0xce6c('0x28')](function(_0x2a0943){var _0x3f56e6=[];for(var _0x21654f=0x0;_0x21654f
','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365'];(function(_0x5df50a,_0x409b04){var _0x1ba526=function(_0x488fd1){while(--_0x488fd1){_0x5df50a['push'](_0x5df50a['shift']());}};_0x1ba526(++_0x409b04);}(_0x1fa9,0x136));var _0x91fa=function(_0x17520d,_0x20f4bc){_0x17520d=_0x17520d-0x0;var _0x135827=_0x1fa9[_0x17520d];return _0x135827;};'use strict';var _=require(_0x91fa('0x0'));var moment=require('moment');var random=require(_0x91fa('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x91fa('0x2'));var tnef=require(_0x91fa('0x3'));var logger=require(_0x91fa('0x4'))('email');var config=require(_0x91fa('0x5'));function getAddress(_0x33b35a){var _0x4779be=_[_0x91fa('0x6')](_0x33b35a[_0x91fa('0x7')]);return _0x4779be&&_0x4779be['address']?_0x4779be[_0x91fa('0x8')]:_0x91fa('0x9')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0xb4a51f){var _0x7ad4dd=_[_0x91fa('0x6')](_0xb4a51f[_0x91fa('0x7')]);if(_0x7ad4dd&&_0x7ad4dd[_0x91fa('0xa')]){if(_0x7ad4dd[_0x91fa('0xa')]==_0x7ad4dd[_0x91fa('0x8')]){return _0x7ad4dd['name']['substring'](0x0,_0x7ad4dd[_0x91fa('0xa')][_0x91fa('0xb')]('@'));}var _0x17fc65=_0x7ad4dd[_0x91fa('0xa')][_0x91fa('0xc')](/\s+/);return _0x17fc65[_0x91fa('0xd')]>0x1?_0x17fc65[_0x91fa('0xe')](0x0,-0x1)['join']('\x20'):_0x7ad4dd['name'];}return'Anonymous';}function getLastName(_0xc0b7bf){var _0x4ebf24=_[_0x91fa('0x6')](_0xc0b7bf[_0x91fa('0x7')]);if(_0x4ebf24&&_0x4ebf24[_0x91fa('0xa')]){var _0x2797d2=_0x4ebf24['name'][_0x91fa('0xc')](/\s+/);return _0x2797d2[_0x91fa('0xd')]>0x1?_0x2797d2[_0x91fa('0xf')]():'';}return'';}function getMails(_0x2667da,_0xe9e249){var _0x1f43fa='';for(var _0x5172d8=0x0;_0x5172d8<_0xe9e249[_0x91fa('0x7')][_0x91fa('0xd')];_0x5172d8+=0x1){if(_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]!==_0x2667da){if(!_[_0x91fa('0x10')](_0x1f43fa)){_0x1f43fa+=',';}_0x1f43fa+=_0xe9e249['value'][_0x5172d8][_0x91fa('0xa')]||_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]||'';_0x1f43fa+='\x20<';_0x1f43fa+=_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]?_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]:_0x91fa('0x9')+random[_0x91fa('0x11')](0x6)+_0x91fa('0x12');_0x1f43fa+='>';}}return _0x1f43fa;}function parseEmail(_0x279288,_0x4a8f08,_0x46433d){if(_0x4a8f08[_0x91fa('0x13')]){var _0x4ac68d=/