From: support
Date: Thu, 23 Jun 2022 07:21:04 +0000 (+0000)
Subject: Built motion from commit 8e18119e.|2.6.11
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=a6246328115db511d7a2d8ba3e940f5ebbe2aaf0;p=motion2.git
Built motion from commit 8e18119e.|2.6.11
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9d8f856..fc919dc 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-06-21T08:30:10.520Z",
+ "time": "2022-06-23T07:12:49.513Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index f60df4d..737ee97 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-06-21T08:30:10.520Z",
+ "time": "2022-06-23T07:12:49.513Z",
"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 d1aad3f..8578e3f 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 _0x7588=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]'];(function(_0x43946b,_0x22fa8d){var _0x683065=function(_0x131c44){while(--_0x131c44){_0x43946b['push'](_0x43946b['shift']());}};_0x683065(++_0x22fa8d);}(_0x7588,0x97));var _0x8758=function(_0x49319d,_0x463ab9){_0x49319d=_0x49319d-0x0;var _0x510c9d=_0x7588[_0x49319d];return _0x510c9d;};'use strict';var Sequelize=require(_0x8758('0x0'));module[_0x8758('0x1')]={'name':{'type':Sequelize[_0x8758('0x2')],'get':function(_0x53a575){return this[_0x8758('0x3')](_0x8758('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8758('0x5'),_0x8758('0x6'),'motionbar',_0x8758('0x7'),_0x8758('0x8'),_0x8758('0x9'),_0x8758('0xa'),_0x8758('0xb')]],'msg':_0x8758('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x8758('0xd')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x8758('0xe')},'data3':{'type':Sequelize[_0x8758('0xd')](0x1000),'comment':_0x8758('0xf')},'data4':{'type':Sequelize[_0x8758('0xd')](0x1000),'comments':_0x8758('0x10')},'data5':{'type':Sequelize[_0x8758('0xd')](0x1000),'comments':_0x8758('0x11')},'data6':{'type':Sequelize[_0x8758('0xd')],'comments':_0x8758('0x12')},'data7':{'type':Sequelize[_0x8758('0x13')],'comments':_0x8758('0x14')}};
\ No newline at end of file
+var _0xef6a=['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[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','action','integration','jscripty'];(function(_0x4295d3,_0x5593b4){var _0x216d5c=function(_0x56f9a9){while(--_0x56f9a9){_0x4295d3['push'](_0x4295d3['shift']());}};_0x216d5c(++_0x5593b4);}(_0xef6a,0x64));var _0xaef6=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xef6a[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require('sequelize');module[_0xaef6('0x0')]={'name':{'type':Sequelize[_0xaef6('0x1')],'get':function(_0x21e05a){return this['getDataValue'](_0xaef6('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xaef6('0x3'),'motionbar',_0xaef6('0x4'),'urlForward','browser',_0xaef6('0x5'),_0xaef6('0x6')]],'msg':_0xaef6('0x7')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xaef6('0x8')](0x1000),'comment':_0xaef6('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xaef6('0xa')},'data3':{'type':Sequelize[_0xaef6('0x8')](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[_0xaef6('0x8')](0x1000),'comments':_0xaef6('0xb')},'data5':{'type':Sequelize[_0xaef6('0x8')](0x1000),'comments':_0xaef6('0xc')},'data6':{'type':Sequelize[_0xaef6('0x8')],'comments':_0xaef6('0xd')},'data7':{'type':Sequelize['TEXT'],'comments':_0xaef6('0xe')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 66e75ae..542e9b6 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 _0x37d9=['path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','body','find','params','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x4889b1,_0x119316){var _0x226cd4=function(_0x163577){while(--_0x163577){_0x4889b1['push'](_0x4889b1['shift']());}};_0x226cd4(++_0x119316);}(_0x37d9,0xdf));var _0x937d=function(_0x567058,_0x58309e){_0x567058=_0x567058-0x0;var _0x3f8fda=_0x37d9[_0x567058];return _0x3f8fda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x937d('0x0'));var zipdir=require(_0x937d('0x1'));var jsonpatch=require(_0x937d('0x2'));var rp=require('request-promise');var moment=require(_0x937d('0x3'));var BPromise=require(_0x937d('0x4'));var Mustache=require(_0x937d('0x5'));var util=require(_0x937d('0x6'));var path=require(_0x937d('0x7'));var sox=require(_0x937d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x937d('0x9'));var _=require('lodash');var squel=require(_0x937d('0xa'));var crypto=require(_0x937d('0xb'));var jsforce=require(_0x937d('0xc'));var deskjs=require(_0x937d('0xd'));var toCsv=require(_0x937d('0xe'));var querystring=require(_0x937d('0xf'));var Papa=require('papaparse');var Redis=require(_0x937d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x937d('0x11'));var as=require(_0x937d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x937d('0x13'))(_0x937d('0x14'));var utils=require(_0x937d('0x15'));var config=require(_0x937d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x937d('0x17'))['db'];function respondWithStatusCode(_0x2fc73e,_0x1626a8){_0x1626a8=_0x1626a8||0xcc;return function(_0x1323b7){if(_0x1323b7){return _0x2fc73e[_0x937d('0x18')](_0x1626a8);}return _0x2fc73e[_0x937d('0x19')](_0x1626a8)[_0x937d('0x1a')]();};}function respondWithResult(_0x20f0e2,_0x3e09b7){_0x3e09b7=_0x3e09b7||0xc8;return function(_0xb7061){if(_0xb7061){return _0x20f0e2['status'](_0x3e09b7)[_0x937d('0x1b')](_0xb7061);}};}function respondWithFilteredResult(_0x564196,_0x5a6956){return function(_0x999048){if(_0x999048){var _0x5b91b1=typeof _0x5a6956['offset']==='undefined'&&typeof _0x5a6956[_0x937d('0x1c')]==='undefined';var _0x3102dc=_0x999048[_0x937d('0x1d')];var _0x35ce50=_0x5b91b1?0x0:_0x5a6956['offset'];var _0x45c5d7=_0x5b91b1?_0x999048['count']:_0x5a6956[_0x937d('0x1e')]+_0x5a6956[_0x937d('0x1c')];var _0x239140;if(_0x45c5d7>=_0x3102dc){_0x45c5d7=_0x3102dc;_0x239140=0xc8;}else{_0x239140=0xce;}_0x564196['status'](_0x239140);return _0x564196[_0x937d('0x1f')](_0x937d('0x20'),_0x35ce50+'-'+_0x45c5d7+'/'+_0x3102dc)[_0x937d('0x1b')](_0x999048);}return null;};}function patchUpdates(_0x23398e){return function(_0x24e10f){try{jsonpatch[_0x937d('0x21')](_0x24e10f,_0x23398e,!![]);}catch(_0x13baad){return BPromise[_0x937d('0x22')](_0x13baad);}return _0x24e10f[_0x937d('0x23')]();};}function saveUpdates(_0x2e6df1,_0x2c8608){return function(_0x2ee9a5){if(_0x2ee9a5){return _0x2ee9a5[_0x937d('0x24')](_0x2e6df1)[_0x937d('0x25')](function(_0x1bfd2f){return _0x1bfd2f;});}return null;};}function removeEntity(_0x3f195d,_0x56e606){return function(_0x1f5fb7){if(_0x1f5fb7){return _0x1f5fb7[_0x937d('0x26')]()[_0x937d('0x25')](function(){_0x3f195d['status'](0xcc)[_0x937d('0x1a')]();});}};}function handleEntityNotFound(_0x5dc039,_0x591fab){return function(_0x33ed8a){if(!_0x33ed8a){_0x5dc039[_0x937d('0x18')](0x194);}return _0x33ed8a;};}function handleError(_0x580503,_0x369061){_0x369061=_0x369061||0x1f4;return function(_0xeda6ec){logger[_0x937d('0x27')](_0xeda6ec[_0x937d('0x28')]);if(_0xeda6ec[_0x937d('0x29')]){delete _0xeda6ec[_0x937d('0x29')];}_0x580503[_0x937d('0x19')](_0x369061)['send'](_0xeda6ec);};}exports['update']=function(_0x431e45,_0x11b530){if(_0x431e45['body']['id']){delete _0x431e45[_0x937d('0x2a')]['id'];}return db['Action'][_0x937d('0x2b')]({'where':{'id':_0x431e45[_0x937d('0x2c')]['id']}})[_0x937d('0x25')](handleEntityNotFound(_0x11b530,null))[_0x937d('0x25')](saveUpdates(_0x431e45[_0x937d('0x2a')],null))[_0x937d('0x25')](respondWithResult(_0x11b530,null))[_0x937d('0x2d')](handleError(_0x11b530,null));};exports[_0x937d('0x26')]=function(_0x53524b,_0x546ae4){return db['Action'][_0x937d('0x2b')]({'where':{'id':_0x53524b[_0x937d('0x2c')]['id']}})[_0x937d('0x25')](handleEntityNotFound(_0x546ae4,null))['then'](removeEntity(_0x546ae4,null))[_0x937d('0x2d')](handleError(_0x546ae4,null));};
\ No newline at end of file
+var _0xfc3f=['status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x2a9bf4,_0x5e0ffb){var _0x5f5ff1=function(_0x34dfce){while(--_0x34dfce){_0x2a9bf4['push'](_0x2a9bf4['shift']());}};_0x5f5ff1(++_0x5e0ffb);}(_0xfc3f,0xaa));var _0xffc3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xfc3f[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffc3('0x0'));var zipdir=require(_0xffc3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xffc3('0x2'));var BPromise=require(_0xffc3('0x3'));var Mustache=require('mustache');var util=require(_0xffc3('0x4'));var path=require(_0xffc3('0x5'));var sox=require(_0xffc3('0x6'));var csv=require(_0xffc3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffc3('0x8'));var _=require(_0xffc3('0x9'));var squel=require('squel');var crypto=require(_0xffc3('0xa'));var jsforce=require(_0xffc3('0xb'));var deskjs=require(_0xffc3('0xc'));var toCsv=require(_0xffc3('0x7'));var querystring=require(_0xffc3('0xd'));var Papa=require('papaparse');var Redis=require(_0xffc3('0xe'));var authService=require(_0xffc3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xffc3('0x10'));var hardwareService=require(_0xffc3('0x11'));var logger=require(_0xffc3('0x12'))(_0xffc3('0x13'));var utils=require(_0xffc3('0x14'));var config=require(_0xffc3('0x15'));var licenseUtil=require(_0xffc3('0x16'));var db=require(_0xffc3('0x17'))['db'];function respondWithStatusCode(_0x211948,_0x10cf5b){_0x10cf5b=_0x10cf5b||0xcc;return function(_0x5175bf){if(_0x5175bf){return _0x211948[_0xffc3('0x18')](_0x10cf5b);}return _0x211948['status'](_0x10cf5b)[_0xffc3('0x19')]();};}function respondWithResult(_0x1b37b8,_0x99aceb){_0x99aceb=_0x99aceb||0xc8;return function(_0x5d7759){if(_0x5d7759){return _0x1b37b8[_0xffc3('0x1a')](_0x99aceb)[_0xffc3('0x1b')](_0x5d7759);}};}function respondWithFilteredResult(_0x2aaa30,_0x5817fc){return function(_0x266699){if(_0x266699){var _0x8542e0=typeof _0x5817fc[_0xffc3('0x1c')]==='undefined'&&typeof _0x5817fc[_0xffc3('0x1d')]===_0xffc3('0x1e');var _0x5b8f6d=_0x266699[_0xffc3('0x1f')];var _0x4c0e79=_0x8542e0?0x0:_0x5817fc[_0xffc3('0x1c')];var _0xa971b9=_0x8542e0?_0x266699['count']:_0x5817fc['offset']+_0x5817fc[_0xffc3('0x1d')];var _0x297151;if(_0xa971b9>=_0x5b8f6d){_0xa971b9=_0x5b8f6d;_0x297151=0xc8;}else{_0x297151=0xce;}_0x2aaa30[_0xffc3('0x1a')](_0x297151);return _0x2aaa30[_0xffc3('0x20')](_0xffc3('0x21'),_0x4c0e79+'-'+_0xa971b9+'/'+_0x5b8f6d)[_0xffc3('0x1b')](_0x266699);}return null;};}function patchUpdates(_0x1f1118){return function(_0x50bdd1){try{jsonpatch[_0xffc3('0x22')](_0x50bdd1,_0x1f1118,!![]);}catch(_0x1bd164){return BPromise[_0xffc3('0x23')](_0x1bd164);}return _0x50bdd1[_0xffc3('0x24')]();};}function saveUpdates(_0x2f6700,_0x3faf64){return function(_0x1ac310){if(_0x1ac310){return _0x1ac310[_0xffc3('0x25')](_0x2f6700)[_0xffc3('0x26')](function(_0x32085a){return _0x32085a;});}return null;};}function removeEntity(_0x2bcfec,_0x40dc18){return function(_0x3d63bf){if(_0x3d63bf){return _0x3d63bf[_0xffc3('0x27')]()[_0xffc3('0x26')](function(){_0x2bcfec[_0xffc3('0x1a')](0xcc)[_0xffc3('0x19')]();});}};}function handleEntityNotFound(_0x1b4aa7,_0xc9d7d5){return function(_0x57cdbb){if(!_0x57cdbb){_0x1b4aa7['sendStatus'](0x194);}return _0x57cdbb;};}function handleError(_0x475fc0,_0x1c3e93){_0x1c3e93=_0x1c3e93||0x1f4;return function(_0x4dd22e){logger[_0xffc3('0x28')](_0x4dd22e[_0xffc3('0x29')]);if(_0x4dd22e[_0xffc3('0x2a')]){delete _0x4dd22e[_0xffc3('0x2a')];}_0x475fc0['status'](_0x1c3e93)[_0xffc3('0x2b')](_0x4dd22e);};}exports[_0xffc3('0x25')]=function(_0x526530,_0xc8216d){if(_0x526530[_0xffc3('0x2c')]['id']){delete _0x526530[_0xffc3('0x2c')]['id'];}return db[_0xffc3('0x2d')][_0xffc3('0x2e')]({'where':{'id':_0x526530[_0xffc3('0x2f')]['id']}})[_0xffc3('0x26')](handleEntityNotFound(_0xc8216d,null))['then'](saveUpdates(_0x526530[_0xffc3('0x2c')],null))['then'](respondWithResult(_0xc8216d,null))[_0xffc3('0x30')](handleError(_0xc8216d,null));};exports[_0xffc3('0x27')]=function(_0x64daad,_0xdc7631){return db[_0xffc3('0x2d')][_0xffc3('0x2e')]({'where':{'id':_0x64daad[_0xffc3('0x2f')]['id']}})[_0xffc3('0x26')](handleEntityNotFound(_0xdc7631,null))['then'](removeEntity(_0xdc7631,null))['catch'](handleError(_0xdc7631,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index e02d8fc..26f065b 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 _0x2fe5=['path','rimraf','./action.attributes','exports','define','Action','tools_actions','lodash','util','moment','bluebird','request-promise'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x2fe5,0x14b));var _0x52fe=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2fe5[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x52fe('0x2'));var BPromise=require(_0x52fe('0x3'));var rp=require(_0x52fe('0x4'));var fs=require('fs');var path=require(_0x52fe('0x5'));var rimraf=require(_0x52fe('0x6'));var config=require('../../config/environment');var attributes=require(_0x52fe('0x7'));module[_0x52fe('0x8')]=function(_0x584af7,_0x2efcaa){return _0x584af7[_0x52fe('0x9')](_0x52fe('0xa'),attributes,{'tableName':_0x52fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x602a=['rimraf','./action.attributes','exports','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x39da38,_0x102e56){var _0x56e396=function(_0x5bd3be){while(--_0x5bd3be){_0x39da38['push'](_0x39da38['shift']());}};_0x56e396(++_0x102e56);}(_0x602a,0x1de));var _0xa602=function(_0x31f31e,_0x3dd397){_0x31f31e=_0x31f31e-0x0;var _0x464402=_0x602a[_0x31f31e];return _0x464402;};'use strict';var _=require(_0xa602('0x0'));var util=require('util');var logger=require(_0xa602('0x1'))(_0xa602('0x2'));var moment=require(_0xa602('0x3'));var BPromise=require(_0xa602('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa602('0x5'));var rimraf=require(_0xa602('0x6'));var config=require('../../config/environment');var attributes=require(_0xa602('0x7'));module[_0xa602('0x8')]=function(_0x5c79a1,_0x2a9d2f){return _0x5c79a1['define'](_0xa602('0x9'),attributes,{'tableName':_0xa602('0xa'),'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 7bb8e55..4865b4f 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x226f31,_0x3d1cfa){var _0x14a410=function(_0x40c762){while(--_0x40c762){_0x226f31['push'](_0x226f31['shift']());}};_0x14a410(++_0x3d1cfa);}(_0xe14b,0x93));var _0xbe14=function(_0xe9e47b,_0x570674){_0xe9e47b=_0xe9e47b-0x0;var _0x171e2d=_0xe14b[_0xe9e47b];return _0x171e2d;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x814b,0x1a2));var _0xb814=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0x814b[_0x4b9dc9];return _0x57b302;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 3500ce0..59f88c7 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 _0x33c9=['../../components/auth/service','../../components/interaction/service','put','/:id','update','delete','isAuthenticated','destroy','exports','express','Router','fs-extra'];(function(_0x4d4f4f,_0x32b2e2){var _0x5d48bc=function(_0x5a15de){while(--_0x5a15de){_0x4d4f4f['push'](_0x4d4f4f['shift']());}};_0x5d48bc(++_0x32b2e2);}(_0x33c9,0x14d));var _0x933c=function(_0x40373a,_0x51c2c9){_0x40373a=_0x40373a-0x0;var _0x20240e=_0x33c9[_0x40373a];return _0x20240e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x933c('0x0'));var router=express[_0x933c('0x1')]();var fs_extra=require(_0x933c('0x2'));var auth=require(_0x933c('0x3'));var interaction=require(_0x933c('0x4'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x933c('0x5')](_0x933c('0x6'),auth['isAuthenticated'](),controller[_0x933c('0x7')]);router[_0x933c('0x8')]('/:id',auth[_0x933c('0x9')](),controller[_0x933c('0xa')]);module[_0x933c('0xb')]=router;
\ No newline at end of file
+var _0x32a2=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','update','delete','isAuthenticated','exports'];(function(_0x15a346,_0x46d825){var _0x275a0f=function(_0x3df115){while(--_0x3df115){_0x15a346['push'](_0x15a346['shift']());}};_0x275a0f(++_0x46d825);}(_0x32a2,0x1c7));var _0x232a=function(_0x42addc,_0x1cd559){_0x42addc=_0x42addc-0x0;var _0x3ef1d1=_0x32a2[_0x42addc];return _0x3ef1d1;};'use strict';var multer=require(_0x232a('0x0'));var util=require(_0x232a('0x1'));var path=require(_0x232a('0x2'));var timeout=require(_0x232a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x232a('0x4'));var auth=require(_0x232a('0x5'));var interaction=require(_0x232a('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x232a('0x7')](_0x232a('0x8'),auth['isAuthenticated'](),controller[_0x232a('0x9')]);router[_0x232a('0xa')](_0x232a('0x8'),auth[_0x232a('0xb')](),controller['destroy']);module[_0x232a('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index b938d36..66be60a 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 _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x5e56f2,_0x283e7b){var _0x4f71e5=function(_0x7a11e3){while(--_0x7a11e3){_0x5e56f2['push'](_0x5e56f2['shift']());}};_0x4f71e5(++_0x283e7b);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4fa932,_0x2fa9ee){_0x4fa932=_0x4fa932-0x0;var _0x5386f3=_0x3f8a[_0x4fa932];return _0x5386f3;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
+var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x9bc97d,_0x47eb1c){var _0x69d9=function(_0x52174c){while(--_0x52174c){_0x9bc97d['push'](_0x9bc97d['shift']());}};_0x69d9(++_0x47eb1c);}(_0xeff8,0x186));var _0x8eff=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xeff8[_0x2faddb];return _0x273c05;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 1252413..17539ca 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 _0x5e9a=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','keys','rawAttributes','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','parse','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20EMPTY','keyBy','from','alias','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','COUNT(%s)','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','CustomReports','UserProfileResource','name','index','map','fieldName','type','key','model','query','filters','attributes','fields','length'];(function(_0x430e18,_0x6f36a0){var _0x54eff2=function(_0x1f2e48){while(--_0x1f2e48){_0x430e18['push'](_0x430e18['shift']());}};_0x54eff2(++_0x6f36a0);}(_0x5e9a,0x72));var _0xa5e9=function(_0x22e175,_0x2dadbc){_0x22e175=_0x22e175-0x0;var _0x5b84dd=_0x5e9a[_0x22e175];return _0x5b84dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5e9('0x0'));var zipdir=require(_0xa5e9('0x1'));var jsonpatch=require(_0xa5e9('0x2'));var rp=require(_0xa5e9('0x3'));var moment=require(_0xa5e9('0x4'));var BPromise=require(_0xa5e9('0x5'));var Mustache=require(_0xa5e9('0x6'));var util=require(_0xa5e9('0x7'));var path=require(_0xa5e9('0x8'));var sox=require(_0xa5e9('0x9'));var csv=require(_0xa5e9('0xa'));var ejs=require(_0xa5e9('0xb'));var fs=require('fs');var fs_extra=require(_0xa5e9('0xc'));var _=require(_0xa5e9('0xd'));var squel=require(_0xa5e9('0xe'));var crypto=require(_0xa5e9('0xf'));var jsforce=require(_0xa5e9('0x10'));var deskjs=require(_0xa5e9('0x11'));var toCsv=require(_0xa5e9('0xa'));var querystring=require(_0xa5e9('0x12'));var Papa=require(_0xa5e9('0x13'));var Redis=require(_0xa5e9('0x14'));var authService=require(_0xa5e9('0x15'));var qs=require(_0xa5e9('0x16'));var as=require(_0xa5e9('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5e9('0x18'))(_0xa5e9('0x19'));var utils=require(_0xa5e9('0x1a'));var config=require(_0xa5e9('0x1b'));var licenseUtil=require(_0xa5e9('0x1c'));var db=require(_0xa5e9('0x1d'))['db'];var dbH=require(_0xa5e9('0x1d'))['dbH'];function respondWithStatusCode(_0x4fb181,_0x4e3e3d){_0x4e3e3d=_0x4e3e3d||0xcc;return function(_0x484a16){if(_0x484a16){return _0x4fb181['sendStatus'](_0x4e3e3d);}return _0x4fb181[_0xa5e9('0x1e')](_0x4e3e3d)[_0xa5e9('0x1f')]();};}function respondWithResult(_0x4dff28,_0x491080){_0x491080=_0x491080||0xc8;return function(_0x5713b9){if(_0x5713b9){return _0x4dff28['status'](_0x491080)[_0xa5e9('0x20')](_0x5713b9);}};}function respondWithFilteredResult(_0x142d43,_0x369cac){return function(_0x218458){if(_0x218458){var _0x3c1553=typeof _0x369cac[_0xa5e9('0x21')]===_0xa5e9('0x22')&&typeof _0x369cac['limit']===_0xa5e9('0x22');var _0x2c004e=_0x218458[_0xa5e9('0x23')];var _0x4360a2=_0x3c1553?0x0:_0x369cac[_0xa5e9('0x21')];var _0xaf4d8e=_0x3c1553?_0x218458[_0xa5e9('0x23')]:_0x369cac['offset']+_0x369cac[_0xa5e9('0x24')];var _0x2c2f7e;if(_0xaf4d8e>=_0x2c004e){_0xaf4d8e=_0x2c004e;_0x2c2f7e=0xc8;}else{_0x2c2f7e=0xce;}_0x142d43[_0xa5e9('0x1e')](_0x2c2f7e);return _0x142d43[_0xa5e9('0x25')](_0xa5e9('0x26'),_0x4360a2+'-'+_0xaf4d8e+'/'+_0x2c004e)['json'](_0x218458);}return null;};}function patchUpdates(_0x595ca5){return function(_0x1fd63a){try{jsonpatch[_0xa5e9('0x27')](_0x1fd63a,_0x595ca5,!![]);}catch(_0x110d31){return BPromise[_0xa5e9('0x28')](_0x110d31);}return _0x1fd63a['save']();};}function saveUpdates(_0x2a9d3c,_0x152caf){return function(_0x518776){if(_0x518776){return _0x518776['update'](_0x2a9d3c)[_0xa5e9('0x29')](function(_0x4aa3bd){return _0x4aa3bd;});}return null;};}function removeEntity(_0x2313dd,_0x5d4177){return function(_0x3761c0){if(_0x3761c0){return _0x3761c0[_0xa5e9('0x2a')]()[_0xa5e9('0x29')](function(){var _0x2de03a=_0x3761c0[_0xa5e9('0x2b')]({'plain':!![]});var _0x295ef5=_0xa5e9('0x2c');return db[_0xa5e9('0x2d')][_0xa5e9('0x2a')]({'where':{'type':_0x295ef5,'resourceId':_0x2de03a['id']}})['then'](function(){return _0x3761c0;});})[_0xa5e9('0x29')](function(){_0x2313dd['status'](0xcc)[_0xa5e9('0x1f')]();});}};}function handleEntityNotFound(_0xe2593,_0x3843a5){return function(_0x93c4a4){if(!_0x93c4a4){_0xe2593['sendStatus'](0x194);}return _0x93c4a4;};}function handleError(_0x515198,_0x50224f){_0x50224f=_0x50224f||0x1f4;return function(_0x12df76){logger['error'](_0x12df76['stack']);if(_0x12df76[_0xa5e9('0x2e')]){delete _0x12df76[_0xa5e9('0x2e')];}_0x515198['status'](_0x50224f)['send'](_0x12df76);};}exports[_0xa5e9('0x2f')]=function(_0x1da525,_0x130ca8){var _0x554c50={},_0x2700f4={},_0x2a3fa4={'count':0x0,'rows':[]};var _0x217d41=_[_0xa5e9('0x30')](db['AnalyticCustomReport']['rawAttributes'],function(_0x317a47){return{'name':_0x317a47[_0xa5e9('0x31')],'type':_0x317a47[_0xa5e9('0x32')][_0xa5e9('0x33')]};});_0x2700f4[_0xa5e9('0x34')]=_['map'](_0x217d41,_0xa5e9('0x2e'));_0x2700f4['query']=_['keys'](_0x1da525[_0xa5e9('0x35')]);_0x2700f4[_0xa5e9('0x36')]=_['intersection'](_0x2700f4[_0xa5e9('0x34')],_0x2700f4['query']);_0x554c50[_0xa5e9('0x37')]=_['intersection'](_0x2700f4[_0xa5e9('0x34')],qs[_0xa5e9('0x38')](_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x38')]));_0x554c50[_0xa5e9('0x37')]=_0x554c50[_0xa5e9('0x37')][_0xa5e9('0x39')]?_0x554c50[_0xa5e9('0x37')]:_0x2700f4['model'];if(!_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x3a')]('nolimit')){_0x554c50[_0xa5e9('0x24')]=qs[_0xa5e9('0x24')](_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x24')]);_0x554c50['offset']=qs['offset'](_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x21')]);}_0x554c50[_0xa5e9('0x3b')]=qs['sort'](_0x1da525['query'][_0xa5e9('0x3c')]);_0x554c50[_0xa5e9('0x3d')]=qs[_0xa5e9('0x36')](_[_0xa5e9('0x3e')](_0x1da525[_0xa5e9('0x35')],_0x2700f4[_0xa5e9('0x36')]),_0x217d41);if(_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x3f')]){_0x554c50[_0xa5e9('0x3d')]=_[_0xa5e9('0x40')](_0x554c50[_0xa5e9('0x3d')],{'$or':_[_0xa5e9('0x30')](_0x217d41,function(_0x36dcb8){if(_0x36dcb8[_0xa5e9('0x32')]!==_0xa5e9('0x41')){var _0x39af09={};_0x39af09[_0x36dcb8[_0xa5e9('0x2e')]]={'$like':'%'+_0x1da525['query'][_0xa5e9('0x3f')]+'%'};return _0x39af09;}})});}_0x554c50=_[_0xa5e9('0x40')]({},_0x554c50,_0x1da525[_0xa5e9('0x42')]);var _0x19f783={'where':_0x554c50[_0xa5e9('0x3d')]};return db[_0xa5e9('0x43')][_0xa5e9('0x23')](_0x19f783)[_0xa5e9('0x29')](function(_0x46189b){_0x2a3fa4[_0xa5e9('0x23')]=_0x46189b;if(_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x44')]){_0x554c50[_0xa5e9('0x45')]=[{'all':!![]}];}return db[_0xa5e9('0x43')][_0xa5e9('0x46')](_0x554c50);})[_0xa5e9('0x29')](function(_0x4baecb){_0x2a3fa4['rows']=_0x4baecb;return _0x2a3fa4;})['then'](respondWithFilteredResult(_0x130ca8,_0x554c50))[_0xa5e9('0x47')](handleError(_0x130ca8,null));};exports[_0xa5e9('0x48')]=function(_0x1e9d9a,_0x245586){var _0x49d4b6={'raw':![],'where':{'id':_0x1e9d9a[_0xa5e9('0x49')]['id']}},_0x364718={};_0x364718[_0xa5e9('0x34')]=_[_0xa5e9('0x4a')](db['AnalyticCustomReport'][_0xa5e9('0x4b')]);_0x364718[_0xa5e9('0x35')]=_[_0xa5e9('0x4a')](_0x1e9d9a[_0xa5e9('0x35')]);_0x364718[_0xa5e9('0x36')]=_[_0xa5e9('0x4c')](_0x364718[_0xa5e9('0x34')],_0x364718[_0xa5e9('0x35')]);_0x49d4b6[_0xa5e9('0x37')]=_[_0xa5e9('0x4c')](_0x364718[_0xa5e9('0x34')],qs[_0xa5e9('0x38')](_0x1e9d9a[_0xa5e9('0x35')][_0xa5e9('0x38')]));_0x49d4b6[_0xa5e9('0x37')]=_0x49d4b6[_0xa5e9('0x37')][_0xa5e9('0x39')]?_0x49d4b6[_0xa5e9('0x37')]:_0x364718[_0xa5e9('0x34')];if(_0x1e9d9a['query']['includeAll']){_0x49d4b6['include']=[{'all':!![]}];}_0x49d4b6=_[_0xa5e9('0x40')]({},_0x49d4b6,_0x1e9d9a[_0xa5e9('0x42')]);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x49d4b6)[_0xa5e9('0x29')](handleEntityNotFound(_0x245586,null))[_0xa5e9('0x29')](respondWithResult(_0x245586,null))[_0xa5e9('0x47')](handleError(_0x245586,null));};exports['create']=function(_0xb4ef4e,_0x256ad1){return db['AnalyticCustomReport'][_0xa5e9('0x4e')](_0xb4ef4e[_0xa5e9('0x4f')],{})[_0xa5e9('0x29')](function(_0x4e640c){var _0x323b5f=_0xb4ef4e[_0xa5e9('0x50')]['get']({'plain':!![]});if(!_0x323b5f)throw new Error(_0xa5e9('0x51'));if(_0x323b5f[_0xa5e9('0x52')]==='user'){var _0x1e5a75=_0x4e640c[_0xa5e9('0x2b')]({'plain':!![]});var _0x3cc26f=_0xa5e9('0x53');return db[_0xa5e9('0x54')][_0xa5e9('0x4d')]({'where':{'name':_0x3cc26f,'userProfileId':_0x323b5f['userProfileId']},'raw':!![]})['then'](function(_0x2965a3){if(_0x2965a3&&_0x2965a3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1e5a75[_0xa5e9('0x2e')],'resourceId':_0x1e5a75['id'],'type':_0xa5e9('0x2c'),'sectionId':_0x2965a3['id']},{})['then'](function(){return _0x4e640c;});}else{return _0x4e640c;}})['catch'](function(_0x4ba4de){logger[_0xa5e9('0x55')](_0xa5e9('0x56'),_0x4ba4de);throw _0x4ba4de;});}return _0x4e640c;})[_0xa5e9('0x29')](respondWithResult(_0x256ad1,0xc9))['catch'](handleError(_0x256ad1,null));};exports['update']=function(_0x77c59c,_0x17630f){if(_0x77c59c[_0xa5e9('0x4f')]['id']){delete _0x77c59c['body']['id'];}return db[_0xa5e9('0x43')][_0xa5e9('0x4d')]({'where':{'id':_0x77c59c[_0xa5e9('0x49')]['id']}})[_0xa5e9('0x29')](handleEntityNotFound(_0x17630f,null))[_0xa5e9('0x29')](saveUpdates(_0x77c59c[_0xa5e9('0x4f')],null))[_0xa5e9('0x29')](respondWithResult(_0x17630f,null))[_0xa5e9('0x47')](handleError(_0x17630f,null));};exports[_0xa5e9('0x2a')]=function(_0x4b4334,_0xf1a301){return db[_0xa5e9('0x43')][_0xa5e9('0x4d')]({'where':{'id':_0x4b4334[_0xa5e9('0x49')]['id']}})[_0xa5e9('0x29')](handleEntityNotFound(_0xf1a301,null))['then'](removeEntity(_0xf1a301,null))[_0xa5e9('0x47')](handleError(_0xf1a301,null));};exports[_0xa5e9('0x57')]=function(_0x5badd6,_0x20453e){var _0x27ea6f=0xa;var _0x3dc5ad=[_0xa5e9('0x58'),'left_join',_0xa5e9('0x59'),_0xa5e9('0x5a')];var _0x449ad1={'SUM':_0xa5e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xa5e9('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa5e9('0x5d'),'GROUP_CONCAT DESC':_0xa5e9('0x5e')};var _0xd89b3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa5e9('0x5f'),'HOUR':_0xa5e9('0x60'),'ROUND':_0xa5e9('0x61'),'UNIX_TIMESTAMP':_0xa5e9('0x62')};var _0x5288df=function(_0xea78a4){return!_[_0xa5e9('0x63')]([_0xa5e9('0x64'),_0xa5e9('0x65'),'IS\x20EMPTY',_0xa5e9('0x66')],_0xea78a4);};var _0x5a4046=function(_0x44a044){if(!_0x44a044||!_0x44a044['rules'][_0xa5e9('0x39')]){return'';}for(var _0x24f779='(',_0x26b116=0x0;_0x26b116<_0x44a044[_0xa5e9('0x67')][_0xa5e9('0x39')];_0x26b116+=0x1){_0x26b116>0x0&&(_0x24f779+='\x20'+_0x44a044[_0xa5e9('0x68')]+'\x20');_0x24f779+=_0x44a044[_0xa5e9('0x67')][_0x26b116][_0xa5e9('0x69')]?_0x5a4046(_0x44a044[_0xa5e9('0x67')][_0x26b116][_0xa5e9('0x69')]):_0x44a044['rules'][_0x26b116][_0xa5e9('0x6a')]+'\x20'+_0x44a044['rules'][_0x26b116][_0xa5e9('0x6b')]+(_0x5288df(_0x44a044[_0xa5e9('0x67')][_0x26b116]['condition'])?'\x20'+_0x44a044[_0xa5e9('0x67')][_0x26b116][_0xa5e9('0x6c')]:'');}return _0x24f779+')';};var _0x303db2={'where':{'id':_0x5badd6[_0xa5e9('0x49')]['id']}},_0x4cb61b,_0x1c60d4,_0x5d33c0,_0x1a5689,_0x10686c;_0x303db2=_[_0xa5e9('0x40')]({},_0x303db2,_0x5badd6[_0xa5e9('0x42')]);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x303db2)['then'](function(_0x3c84dd){if(_0x3c84dd){_0x4cb61b=_0x3c84dd;return _0x3c84dd[_0xa5e9('0x6d')]();}return null;})[_0xa5e9('0x29')](function(_0x2cb066){if(_0x2cb066){if(!_0x2cb066[_0xa5e9('0x39')]){throw new db[(_0xa5e9('0x6e'))][(_0xa5e9('0x6f'))](_0xa5e9('0x70'),0x193);}_0x1c60d4=_0x2cb066;return db[_0xa5e9('0x71')][_0xa5e9('0x46')]({'raw':!![]});}return null;})[_0xa5e9('0x29')](function(_0x244a48){if(_0x244a48){_0x5d33c0=_['keyBy'](_0x244a48,'id');var _0x29f672;var _0x202269=squel[_0xa5e9('0x72')]();_0x202269['from'](_0x4cb61b[_0xa5e9('0x73')]);for(var _0x3121fe=0x0;_0x3121fe<_0x1c60d4[_0xa5e9('0x39')];_0x3121fe+=0x1){_0x29f672=_0x1c60d4[_0x3121fe][_0xa5e9('0x74')]?_0x5d33c0[_0x1c60d4[_0x3121fe][_0xa5e9('0x74')]][_0xa5e9('0x75')]:_0x1c60d4[_0x3121fe][_0xa5e9('0x6a')];_0x29f672=_0x1c60d4[_0x3121fe][_0xa5e9('0x76')]?_[_0xa5e9('0x77')](_0x449ad1[_0x1c60d4[_0x3121fe]['function']],'%s',_0x29f672):_0x29f672;_0x29f672=_0x1c60d4[_0x3121fe][_0xa5e9('0x78')]?_[_0xa5e9('0x77')](_0xd89b3[_0x1c60d4[_0x3121fe][_0xa5e9('0x78')]],'%s',_0x29f672):_0x29f672;if(_0x1c60d4[_0x3121fe][_0xa5e9('0x79')]){_0x202269[_0xa5e9('0x69')](_0x29f672);}_0x1c60d4[_0x3121fe][_0xa5e9('0x7a')]&&_0x202269[_0xa5e9('0x3b')](_0x29f672,_0x1c60d4[_0x3121fe]['orderBy']===_0xa5e9('0x7b')?![]:!![]);_0x202269[_0xa5e9('0x6a')](_0x29f672,_0x1c60d4[_0x3121fe]['alias']||_0x29f672);}if(_0x4cb61b['joins']){_0x4cb61b['joins']=JSON[_0xa5e9('0x7c')](_0x4cb61b[_0xa5e9('0x7d')]);for(var _0x6bac60=0x0;_0x6bac60<_0x4cb61b[_0xa5e9('0x7d')]['length'];_0x6bac60+=0x1){if(_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x32')]&&_[_0xa5e9('0x63')](_0x3dc5ad,_0x4cb61b['joins'][_0x6bac60]['type'])&&_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x7e')]&&_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60]['foreignTable']&&_0x4cb61b['joins'][_0x6bac60][_0xa5e9('0x7f')]){_0x202269[_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x32')]](_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x80')],null,util[_0xa5e9('0x78')](_0xa5e9('0x81'),_0x4cb61b['table'],_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60]['parentKey'],_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x80')],_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x7f')]));}}}if(_0x4cb61b[_0xa5e9('0x82')]){_0x4cb61b['conditions']=JSON['parse'](_0x4cb61b[_0xa5e9('0x82')]);_0x202269[_0xa5e9('0x3d')](_0x5a4046(_0x4cb61b[_0xa5e9('0x82')][_0xa5e9('0x69')]));}_0x10686c=_0x202269[_0xa5e9('0x83')]();_0x202269['limit'](_0x27ea6f);_0x202269[_0xa5e9('0x21')](0x0);logger[_0xa5e9('0x84')](_0xa5e9('0x85'),_0x202269[_0xa5e9('0x86')]());return dbH[_0xa5e9('0x87')]['query'](_0x202269[_0xa5e9('0x86')](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]});}})[_0xa5e9('0x29')](respondWithResult(_0x20453e,null))['catch'](handleError(_0x20453e,null));};function runReport(_0x3f888d,_0x1f6032,_0x17b00e){var _0xa48ea9=_0x1f6032[_0xa5e9('0x2e')];var _0x13d97c=0xa;var _0x437bd1=[_0xa5e9('0x58'),_0xa5e9('0x8a'),_0xa5e9('0x59'),'cross_join'];var _0xaba560={'SUM':_0xa5e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa5e9('0x8b'),'MAX':_0xa5e9('0x8c'),'MIN':_0xa5e9('0x5c'),'AVG':_0xa5e9('0x8d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa5e9('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x400dc8={'SEC_TO_TIME':_0xa5e9('0x8e'),'DATE':_0xa5e9('0x5f'),'HOUR':_0xa5e9('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa5e9('0x62')};var _0x5ee766=function(_0x20d35a){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xa5e9('0x8f'),_0xa5e9('0x66')],_0x20d35a);};var _0x2537f4=function(_0x1d75a0){if(!_0x1d75a0||!_0x1d75a0['rules']['length']){return'';}for(var _0x148a71='(',_0x1a162c=0x0;_0x1a162c<_0x1d75a0[_0xa5e9('0x67')][_0xa5e9('0x39')];_0x1a162c+=0x1){_0x1a162c>0x0&&(_0x148a71+='\x20'+_0x1d75a0[_0xa5e9('0x68')]+'\x20');_0x148a71+=_0x1d75a0['rules'][_0x1a162c][_0xa5e9('0x69')]?_0x2537f4(_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x69')]):_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x6a')]+'\x20'+_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x6b')]+(_0x5ee766(_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x6b')])?'\x20'+_0x1d75a0['rules'][_0x1a162c][_0xa5e9('0x6c')]:'');}return _0x148a71+')';};var _0x4a6086={'where':{'id':_0x3f888d['id']}},_0x5327d2,_0x585f46,_0x45443c,_0x2a4a8a,_0x362272;_0x4a6086=_['merge']({},_0x4a6086,_0x17b00e);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x4a6086)[_0xa5e9('0x29')](function(_0xf31b28){if(_0xf31b28){_0x5327d2=_0xf31b28;return _0xf31b28[_0xa5e9('0x6d')]();}return null;})[_0xa5e9('0x29')](function(_0x147b74){if(_0x147b74){if(!_0x147b74[_0xa5e9('0x39')]){throw new db[(_0xa5e9('0x6e'))][(_0xa5e9('0x6f'))](_0xa5e9('0x70'),0x193);}_0x585f46=_0x147b74;return db[_0xa5e9('0x71')]['findAll']({'raw':!![]});}return null;})[_0xa5e9('0x29')](function(_0x57e62b){if(_0x57e62b){_0x45443c=_[_0xa5e9('0x90')](_0x57e62b,'id');var _0x2b5f72;var _0x58890e=squel[_0xa5e9('0x72')]();_0x58890e[_0xa5e9('0x91')](_0x5327d2[_0xa5e9('0x73')]);for(var _0x46e22c=0x0;_0x46e22c<_0x585f46[_0xa5e9('0x39')];_0x46e22c+=0x1){_0x2b5f72=_0x585f46[_0x46e22c][_0xa5e9('0x74')]?_0x45443c[_0x585f46[_0x46e22c][_0xa5e9('0x74')]][_0xa5e9('0x75')]:_0x585f46[_0x46e22c][_0xa5e9('0x6a')];_0x2b5f72=_0x585f46[_0x46e22c]['function']?_[_0xa5e9('0x77')](_0xaba560[_0x585f46[_0x46e22c]['function']],'%s',_0x2b5f72):_0x2b5f72;_0x2b5f72=_0x585f46[_0x46e22c]['format']?_[_0xa5e9('0x77')](_0x400dc8[_0x585f46[_0x46e22c]['format']],'%s',_0x2b5f72):_0x2b5f72;if(_0x585f46[_0x46e22c][_0xa5e9('0x79')]){_0x58890e[_0xa5e9('0x69')](_0x2b5f72);}_0x585f46[_0x46e22c][_0xa5e9('0x7a')]&&_0x58890e[_0xa5e9('0x3b')](_0x2b5f72,_0x585f46[_0x46e22c][_0xa5e9('0x7a')]===_0xa5e9('0x7b')?![]:!![]);_0x58890e[_0xa5e9('0x6a')](_0x2b5f72,_0x585f46[_0x46e22c][_0xa5e9('0x92')]||_0x2b5f72);}if(_0x5327d2[_0xa5e9('0x7d')]){_0x5327d2[_0xa5e9('0x7d')]=JSON['parse'](_0x5327d2[_0xa5e9('0x7d')]);for(var _0x5d70c8=0x0;_0x5d70c8<_0x5327d2[_0xa5e9('0x7d')]['length'];_0x5d70c8+=0x1){if(_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x32')]&&_[_0xa5e9('0x63')](_0x437bd1,_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8]['type'])&&_0x5327d2['joins'][_0x5d70c8][_0xa5e9('0x7e')]&&_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x80')]&&_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x7f')]){_0x58890e[_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x32')]](_0x5327d2['joins'][_0x5d70c8][_0xa5e9('0x80')],null,util[_0xa5e9('0x78')](_0xa5e9('0x81'),_0x5327d2[_0xa5e9('0x73')],_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x7e')],_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x80')],_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x7f')]));}}}if(_0x5327d2['conditions']){_0x5327d2[_0xa5e9('0x82')]=JSON[_0xa5e9('0x7c')](_0x5327d2[_0xa5e9('0x82')]);_0x58890e[_0xa5e9('0x3d')](_0x2537f4(_0x5327d2[_0xa5e9('0x82')][_0xa5e9('0x69')]));}_0x362272=_0x58890e[_0xa5e9('0x83')]();_0x58890e[_0xa5e9('0x24')](_0x13d97c);_0x58890e[_0xa5e9('0x21')](0x0);return;}})[_0xa5e9('0x29')](function(){if(_0x1f6032['output']===_0xa5e9('0x93')){return null;}var _0x4a68a3=_['merge'](_0x1f6032,{'name':_0x1f6032[_0xa5e9('0x94')]||_0x1f6032[_0xa5e9('0x2e')]||_0x5327d2[_0xa5e9('0x2e')],'basename':_0xa48ea9,'savename':util[_0xa5e9('0x78')](_0xa5e9('0x95'),_0x1f6032[_0xa5e9('0x2e')]||_0x5327d2[_0xa5e9('0x2e')],require(_0xa5e9('0x96'))[_0xa5e9('0x97')](0x4),_0x1f6032[_0xa5e9('0x98')]||_0xa5e9('0x99')),'reportId':_0x5327d2['id'],'reportType':_0xa5e9('0x9a')});return db['AnalyticExtractedReport']['create'](_0x4a68a3,{'raw':!![]});})[_0xa5e9('0x29')](function(_0x5c4db6){if(_0x5327d2[_0xa5e9('0x73')]===_0xa5e9('0x9b')){_0x362272[_0xa5e9('0x3d')](_0x5327d2[_0xa5e9('0x73')]+_0xa5e9('0x9c'),_0x1f6032[_0xa5e9('0x9d')],_0x1f6032[_0xa5e9('0x9e')]);}else{_0x362272[_0xa5e9('0x3d')](_0x5327d2[_0xa5e9('0x73')]+_0xa5e9('0x9f'),_0x1f6032[_0xa5e9('0x9d')],_0x1f6032[_0xa5e9('0x9e')]);}if(_0x5c4db6){logger[_0xa5e9('0xa0')](_0xa5e9('0xa1'),_0x362272[_0xa5e9('0x86')]());require(_0xa5e9('0xa2'))[_0xa5e9('0xa3')](path[_0xa5e9('0x58')](__dirname,_0xa5e9('0xa4'),_0x5c4db6[_0xa5e9('0x98')]),[_0x5c4db6['id'],_0x362272[_0xa5e9('0x86')](),path[_0xa5e9('0x58')](__dirname,_0xa5e9('0xa5'),_0x5c4db6[_0xa5e9('0xa6')]),_0xa48ea9]);return _0x5c4db6;}else{var _0x48e099=squel[_0xa5e9('0x72')]();_0x48e099[_0xa5e9('0x91')]('('+_0x362272[_0xa5e9('0x86')]()+')',_0xa5e9('0xa7'));_0x48e099[_0xa5e9('0x6a')](_0xa5e9('0xa8'),_0xa5e9('0x23'));_0x362272['limit'](_0x1f6032[_0xa5e9('0x24')]||_0x13d97c);_0x362272[_0xa5e9('0x21')](_0x1f6032[_0xa5e9('0x21')]||0x0);return dbH[_0xa5e9('0x87')]['query'](_0x48e099[_0xa5e9('0x86')](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]})[_0xa5e9('0x29')](function(_0x19b160){if(!_0x19b160[_0xa5e9('0x39')]){_0x2a4a8a=0x0;}else{_0x2a4a8a=_0x19b160[0x0][_0xa5e9('0x23')]||0x0;}return dbH[_0xa5e9('0x87')]['query'](_0x362272['toString'](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]});})['then'](function(_0x22d71c){return{'rows':_0x22d71c||[],'count':_0x2a4a8a};});}});}exports[_0xa5e9('0xa9')]=function(_0x4ac5d0,_0xe83279){return runReport(_0x4ac5d0[_0xa5e9('0x49')],_0x4ac5d0[_0xa5e9('0x35')],_0x4ac5d0[_0xa5e9('0x42')])['then'](respondWithResult(_0xe83279,null))['catch'](handleError(_0xe83279,null));};exports[_0xa5e9('0xaa')]=runReport;exports[_0xa5e9('0x35')]=function(_0x4050c2,_0x23ce0b){var _0x36c001=0xa;var _0x4f7c1e=['join',_0xa5e9('0x8a'),_0xa5e9('0x59'),_0xa5e9('0x5a')];var _0x541131={'SUM':_0xa5e9('0x5b'),'COUNT':_0xa5e9('0xab'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa5e9('0x8c'),'MIN':_0xa5e9('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa5e9('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xe43a55={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa5e9('0x5f'),'HOUR':_0xa5e9('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa5e9('0x62')};var _0x556b3a=function(_0x5bf54b){return!_[_0xa5e9('0x63')]([_0xa5e9('0x64'),_0xa5e9('0x65'),'IS\x20EMPTY',_0xa5e9('0x66')],_0x5bf54b);};var _0x60a994=function(_0x3b118b){if(!_0x3b118b||!_0x3b118b['rules'][_0xa5e9('0x39')]){return'';}for(var _0x165009='(',_0x50435b=0x0;_0x50435b<_0x3b118b['rules'][_0xa5e9('0x39')];_0x50435b+=0x1){_0x50435b>0x0&&(_0x165009+='\x20'+_0x3b118b[_0xa5e9('0x68')]+'\x20');_0x165009+=_0x3b118b['rules'][_0x50435b][_0xa5e9('0x69')]?_0x60a994(_0x3b118b[_0xa5e9('0x67')][_0x50435b][_0xa5e9('0x69')]):_0x3b118b[_0xa5e9('0x67')][_0x50435b][_0xa5e9('0x6a')]+'\x20'+_0x3b118b['rules'][_0x50435b][_0xa5e9('0x6b')]+(_0x556b3a(_0x3b118b[_0xa5e9('0x67')][_0x50435b][_0xa5e9('0x6b')])?'\x20'+_0x3b118b['rules'][_0x50435b][_0xa5e9('0x6c')]:'');}return _0x165009+')';};var _0x8af981={'where':{'id':_0x4050c2['params']['id']}},_0x22118d,_0x12dcc0,_0x15c06b,_0x160562,_0x496aec;_0x8af981=_[_0xa5e9('0x40')]({},_0x8af981,_0x4050c2[_0xa5e9('0x42')]);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x8af981)[_0xa5e9('0x29')](function(_0x486fa3){if(_0x486fa3){_0x22118d=_0x486fa3;return _0x486fa3[_0xa5e9('0x6d')]();}return null;})['then'](function(_0x43a6cb){if(_0x43a6cb){if(!_0x43a6cb['length']){throw new db[(_0xa5e9('0x6e'))][(_0xa5e9('0x6f'))](_0xa5e9('0x70'),0x193);}_0x12dcc0=_0x43a6cb;return db['AnalyticMetric'][_0xa5e9('0x46')]({'raw':!![]});}return null;})[_0xa5e9('0x29')](function(_0x37a4db){if(_0x37a4db){_0x15c06b=_['keyBy'](_0x37a4db,'id');var _0x175bdf;var _0x16d798=squel['select']();_0x16d798[_0xa5e9('0x91')](_0x22118d['table']);for(var _0x27aacb=0x0;_0x27aacb<_0x12dcc0[_0xa5e9('0x39')];_0x27aacb+=0x1){_0x175bdf=_0x12dcc0[_0x27aacb][_0xa5e9('0x74')]?_0x15c06b[_0x12dcc0[_0x27aacb][_0xa5e9('0x74')]][_0xa5e9('0x75')]:_0x12dcc0[_0x27aacb][_0xa5e9('0x6a')];_0x175bdf=_0x12dcc0[_0x27aacb][_0xa5e9('0x76')]?_[_0xa5e9('0x77')](_0x541131[_0x12dcc0[_0x27aacb][_0xa5e9('0x76')]],'%s',_0x175bdf):_0x175bdf;_0x175bdf=_0x12dcc0[_0x27aacb]['format']?_[_0xa5e9('0x77')](_0xe43a55[_0x12dcc0[_0x27aacb]['format']],'%s',_0x175bdf):_0x175bdf;if(_0x12dcc0[_0x27aacb][_0xa5e9('0x79')]){_0x16d798[_0xa5e9('0x69')](_0x175bdf);}_0x12dcc0[_0x27aacb]['orderBy']&&_0x16d798[_0xa5e9('0x3b')](_0x175bdf,_0x12dcc0[_0x27aacb][_0xa5e9('0x7a')]===_0xa5e9('0x7b')?![]:!![]);_0x16d798['field'](_0x175bdf,_0x12dcc0[_0x27aacb][_0xa5e9('0x92')]||_0x175bdf);}if(_0x22118d[_0xa5e9('0x7d')]){_0x22118d[_0xa5e9('0x7d')]=JSON[_0xa5e9('0x7c')](_0x22118d[_0xa5e9('0x7d')]);for(var _0x4f12e5=0x0;_0x4f12e5<_0x22118d['joins']['length'];_0x4f12e5+=0x1){if(_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['type']&&_[_0xa5e9('0x63')](_0x4f7c1e,_0x22118d['joins'][_0x4f12e5][_0xa5e9('0x32')])&&_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['parentKey']&&_0x22118d['joins'][_0x4f12e5][_0xa5e9('0x80')]&&_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['foreignKey']){_0x16d798[_0x22118d[_0xa5e9('0x7d')][_0x4f12e5][_0xa5e9('0x32')]](_0x22118d['joins'][_0x4f12e5][_0xa5e9('0x80')],null,util[_0xa5e9('0x78')](_0xa5e9('0x81'),_0x22118d[_0xa5e9('0x73')],_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['parentKey'],_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['foreignTable'],_0x22118d[_0xa5e9('0x7d')][_0x4f12e5][_0xa5e9('0x7f')]));}}}if(_0x22118d[_0xa5e9('0x82')]){_0x22118d[_0xa5e9('0x82')]=JSON[_0xa5e9('0x7c')](_0x22118d[_0xa5e9('0x82')]);_0x16d798['where'](_0x60a994(_0x22118d['conditions'][_0xa5e9('0x69')]));}_0x496aec=_0x16d798[_0xa5e9('0x83')]();_0x16d798['limit'](_0x36c001);_0x16d798[_0xa5e9('0x21')](0x0);logger['debug'](_0xa5e9('0x85'),_0x16d798[_0xa5e9('0x86')]());return dbH[_0xa5e9('0x87')][_0xa5e9('0x35')](_0x16d798[_0xa5e9('0x86')](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]});}})[_0xa5e9('0x29')](function(){return{'sql':_0x496aec[_0xa5e9('0x86')]()};})[_0xa5e9('0x29')](respondWithResult(_0x23ce0b,null))[_0xa5e9('0x47')](handleError(_0x23ce0b,null));};
\ No newline at end of file
+var _0x63cf=['Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','field','AnalyticMetric','findAll','metric','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','run','runReport','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','include','rows','catch','params','includeAll','create','body','user','Reports','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','length','operator','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','replace','function','format','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63cf,0xc9));var _0xf63c=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0x63cf[_0x17bb31];return _0x505c71;};'use strict';var emlformat=require(_0xf63c('0x0'));var rimraf=require(_0xf63c('0x1'));var zipdir=require(_0xf63c('0x2'));var jsonpatch=require(_0xf63c('0x3'));var rp=require(_0xf63c('0x4'));var moment=require(_0xf63c('0x5'));var BPromise=require(_0xf63c('0x6'));var Mustache=require('mustache');var util=require(_0xf63c('0x7'));var path=require('path');var sox=require(_0xf63c('0x8'));var csv=require(_0xf63c('0x9'));var ejs=require(_0xf63c('0xa'));var fs=require('fs');var fs_extra=require(_0xf63c('0xb'));var _=require(_0xf63c('0xc'));var squel=require('squel');var crypto=require(_0xf63c('0xd'));var jsforce=require(_0xf63c('0xe'));var deskjs=require(_0xf63c('0xf'));var toCsv=require(_0xf63c('0x9'));var querystring=require(_0xf63c('0x10'));var Papa=require(_0xf63c('0x11'));var Redis=require(_0xf63c('0x12'));var authService=require(_0xf63c('0x13'));var qs=require(_0xf63c('0x14'));var as=require(_0xf63c('0x15'));var hardwareService=require(_0xf63c('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf63c('0x17'));var config=require(_0xf63c('0x18'));var licenseUtil=require(_0xf63c('0x19'));var db=require(_0xf63c('0x1a'))['db'];var dbH=require(_0xf63c('0x1a'))[_0xf63c('0x1b')];function respondWithStatusCode(_0x1dddf3,_0x41ac1e){_0x41ac1e=_0x41ac1e||0xcc;return function(_0x2bff98){if(_0x2bff98){return _0x1dddf3[_0xf63c('0x1c')](_0x41ac1e);}return _0x1dddf3[_0xf63c('0x1d')](_0x41ac1e)[_0xf63c('0x1e')]();};}function respondWithResult(_0x43219a,_0x5378c2){_0x5378c2=_0x5378c2||0xc8;return function(_0xb98e6d){if(_0xb98e6d){return _0x43219a[_0xf63c('0x1d')](_0x5378c2)[_0xf63c('0x1f')](_0xb98e6d);}};}function respondWithFilteredResult(_0x5cd8c1,_0x4e408a){return function(_0x449881){if(_0x449881){var _0xdfa8e3=typeof _0x4e408a[_0xf63c('0x20')]==='undefined'&&typeof _0x4e408a[_0xf63c('0x21')]==='undefined';var _0x86ef2c=_0x449881[_0xf63c('0x22')];var _0x80febe=_0xdfa8e3?0x0:_0x4e408a['offset'];var _0x4567cb=_0xdfa8e3?_0x449881[_0xf63c('0x22')]:_0x4e408a[_0xf63c('0x20')]+_0x4e408a['limit'];var _0x56665e;if(_0x4567cb>=_0x86ef2c){_0x4567cb=_0x86ef2c;_0x56665e=0xc8;}else{_0x56665e=0xce;}_0x5cd8c1[_0xf63c('0x1d')](_0x56665e);return _0x5cd8c1[_0xf63c('0x23')](_0xf63c('0x24'),_0x80febe+'-'+_0x4567cb+'/'+_0x86ef2c)[_0xf63c('0x1f')](_0x449881);}return null;};}function patchUpdates(_0x5e7e0e){return function(_0x5359d1){try{jsonpatch[_0xf63c('0x25')](_0x5359d1,_0x5e7e0e,!![]);}catch(_0x287842){return BPromise[_0xf63c('0x26')](_0x287842);}return _0x5359d1[_0xf63c('0x27')]();};}function saveUpdates(_0x41297f,_0x2945ad){return function(_0x68692d){if(_0x68692d){return _0x68692d[_0xf63c('0x28')](_0x41297f)[_0xf63c('0x29')](function(_0x4221ff){return _0x4221ff;});}return null;};}function removeEntity(_0x3a5bc7,_0x27b8ce){return function(_0x58bbfc){if(_0x58bbfc){return _0x58bbfc[_0xf63c('0x2a')]()[_0xf63c('0x29')](function(){var _0x53e03c=_0x58bbfc['get']({'plain':!![]});var _0x47cb49=_0xf63c('0x2b');return db[_0xf63c('0x2c')][_0xf63c('0x2a')]({'where':{'type':_0x47cb49,'resourceId':_0x53e03c['id']}})[_0xf63c('0x29')](function(){return _0x58bbfc;});})[_0xf63c('0x29')](function(){_0x3a5bc7['status'](0xcc)[_0xf63c('0x1e')]();});}};}function handleEntityNotFound(_0x8468d3,_0x4d2521){return function(_0x1e84b6){if(!_0x1e84b6){_0x8468d3[_0xf63c('0x1c')](0x194);}return _0x1e84b6;};}function handleError(_0x43cbd7,_0xbba601){_0xbba601=_0xbba601||0x1f4;return function(_0x4447cc){logger[_0xf63c('0x2d')](_0x4447cc[_0xf63c('0x2e')]);if(_0x4447cc[_0xf63c('0x2f')]){delete _0x4447cc[_0xf63c('0x2f')];}_0x43cbd7[_0xf63c('0x1d')](_0xbba601)['send'](_0x4447cc);};}exports[_0xf63c('0x30')]=function(_0x5623af,_0x56a667){var _0xffc4a4={},_0x335168={},_0xc592b9={'count':0x0,'rows':[]};var _0x3d6536=_[_0xf63c('0x31')](db[_0xf63c('0x32')][_0xf63c('0x33')],function(_0x1aaaf4){return{'name':_0x1aaaf4['fieldName'],'type':_0x1aaaf4['type']['key']};});_0x335168[_0xf63c('0x34')]=_['map'](_0x3d6536,_0xf63c('0x2f'));_0x335168[_0xf63c('0x35')]=_[_0xf63c('0x36')](_0x5623af['query']);_0x335168[_0xf63c('0x37')]=_[_0xf63c('0x38')](_0x335168[_0xf63c('0x34')],_0x335168[_0xf63c('0x35')]);_0xffc4a4[_0xf63c('0x39')]=_[_0xf63c('0x38')](_0x335168[_0xf63c('0x34')],qs[_0xf63c('0x3a')](_0x5623af[_0xf63c('0x35')][_0xf63c('0x3a')]));_0xffc4a4[_0xf63c('0x39')]=_0xffc4a4[_0xf63c('0x39')]['length']?_0xffc4a4[_0xf63c('0x39')]:_0x335168[_0xf63c('0x34')];if(!_0x5623af[_0xf63c('0x35')][_0xf63c('0x3b')](_0xf63c('0x3c'))){_0xffc4a4[_0xf63c('0x21')]=qs[_0xf63c('0x21')](_0x5623af[_0xf63c('0x35')]['limit']);_0xffc4a4['offset']=qs['offset'](_0x5623af[_0xf63c('0x35')][_0xf63c('0x20')]);}_0xffc4a4[_0xf63c('0x3d')]=qs[_0xf63c('0x3e')](_0x5623af['query'][_0xf63c('0x3e')]);_0xffc4a4[_0xf63c('0x3f')]=qs[_0xf63c('0x37')](_['pick'](_0x5623af['query'],_0x335168[_0xf63c('0x37')]),_0x3d6536);if(_0x5623af[_0xf63c('0x35')]['filter']){_0xffc4a4[_0xf63c('0x3f')]=_[_0xf63c('0x40')](_0xffc4a4[_0xf63c('0x3f')],{'$or':_[_0xf63c('0x31')](_0x3d6536,function(_0xcd5a3d){if(_0xcd5a3d[_0xf63c('0x41')]!==_0xf63c('0x42')){var _0x33b14b={};_0x33b14b[_0xcd5a3d['name']]={'$like':'%'+_0x5623af[_0xf63c('0x35')][_0xf63c('0x43')]+'%'};return _0x33b14b;}})});}_0xffc4a4=_['merge']({},_0xffc4a4,_0x5623af[_0xf63c('0x44')]);var _0x5c69b2={'where':_0xffc4a4[_0xf63c('0x3f')]};return db[_0xf63c('0x32')][_0xf63c('0x22')](_0x5c69b2)[_0xf63c('0x29')](function(_0x6d949c){_0xc592b9[_0xf63c('0x22')]=_0x6d949c;if(_0x5623af[_0xf63c('0x35')]['includeAll']){_0xffc4a4[_0xf63c('0x45')]=[{'all':!![]}];}return db[_0xf63c('0x32')]['findAll'](_0xffc4a4);})['then'](function(_0x149501){_0xc592b9[_0xf63c('0x46')]=_0x149501;return _0xc592b9;})[_0xf63c('0x29')](respondWithFilteredResult(_0x56a667,_0xffc4a4))[_0xf63c('0x47')](handleError(_0x56a667,null));};exports['show']=function(_0xbf6703,_0x4653c5){var _0x2d4936={'raw':![],'where':{'id':_0xbf6703[_0xf63c('0x48')]['id']}},_0x111a30={};_0x111a30[_0xf63c('0x34')]=_[_0xf63c('0x36')](db[_0xf63c('0x32')][_0xf63c('0x33')]);_0x111a30['query']=_[_0xf63c('0x36')](_0xbf6703[_0xf63c('0x35')]);_0x111a30[_0xf63c('0x37')]=_['intersection'](_0x111a30['model'],_0x111a30[_0xf63c('0x35')]);_0x2d4936['attributes']=_[_0xf63c('0x38')](_0x111a30[_0xf63c('0x34')],qs['fields'](_0xbf6703[_0xf63c('0x35')][_0xf63c('0x3a')]));_0x2d4936[_0xf63c('0x39')]=_0x2d4936['attributes']['length']?_0x2d4936[_0xf63c('0x39')]:_0x111a30[_0xf63c('0x34')];if(_0xbf6703[_0xf63c('0x35')][_0xf63c('0x49')]){_0x2d4936[_0xf63c('0x45')]=[{'all':!![]}];}_0x2d4936=_[_0xf63c('0x40')]({},_0x2d4936,_0xbf6703[_0xf63c('0x44')]);return db[_0xf63c('0x32')]['find'](_0x2d4936)[_0xf63c('0x29')](handleEntityNotFound(_0x4653c5,null))['then'](respondWithResult(_0x4653c5,null))[_0xf63c('0x47')](handleError(_0x4653c5,null));};exports[_0xf63c('0x4a')]=function(_0x5ed078,_0x52e1b4){return db[_0xf63c('0x32')]['create'](_0x5ed078[_0xf63c('0x4b')],{})[_0xf63c('0x29')](function(_0x2c4802){var _0x104187=_0x5ed078[_0xf63c('0x4c')]['get']({'plain':!![]});if(!_0x104187)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x104187['role']===_0xf63c('0x4c')){var _0x1481bb=_0x2c4802['get']({'plain':!![]});var _0x1359be=_0xf63c('0x4d');return db[_0xf63c('0x4e')][_0xf63c('0x4f')]({'where':{'name':_0x1359be,'userProfileId':_0x104187['userProfileId']},'raw':!![]})['then'](function(_0x4e5da7){if(_0x4e5da7&&_0x4e5da7[_0xf63c('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1481bb['name'],'resourceId':_0x1481bb['id'],'type':'CustomReports','sectionId':_0x4e5da7['id']},{})['then'](function(){return _0x2c4802;});}else{return _0x2c4802;}})[_0xf63c('0x47')](function(_0x393c6b){logger[_0xf63c('0x2d')](_0xf63c('0x51'),_0x393c6b);throw _0x393c6b;});}return _0x2c4802;})[_0xf63c('0x29')](respondWithResult(_0x52e1b4,0xc9))[_0xf63c('0x47')](handleError(_0x52e1b4,null));};exports['update']=function(_0x509dde,_0x9fe23a){if(_0x509dde[_0xf63c('0x4b')]['id']){delete _0x509dde[_0xf63c('0x4b')]['id'];}return db[_0xf63c('0x32')][_0xf63c('0x4f')]({'where':{'id':_0x509dde['params']['id']}})[_0xf63c('0x29')](handleEntityNotFound(_0x9fe23a,null))['then'](saveUpdates(_0x509dde[_0xf63c('0x4b')],null))['then'](respondWithResult(_0x9fe23a,null))[_0xf63c('0x47')](handleError(_0x9fe23a,null));};exports['destroy']=function(_0x7891fd,_0x3aac58){return db[_0xf63c('0x32')][_0xf63c('0x4f')]({'where':{'id':_0x7891fd[_0xf63c('0x48')]['id']}})[_0xf63c('0x29')](handleEntityNotFound(_0x3aac58,null))['then'](removeEntity(_0x3aac58,null))[_0xf63c('0x47')](handleError(_0x3aac58,null));};exports['preview']=function(_0xe773f5,_0x55613a){var _0x40bc99=0xa;var _0x1952f6=[_0xf63c('0x52'),_0xf63c('0x53'),_0xf63c('0x54'),_0xf63c('0x55')];var _0x180e25={'SUM':_0xf63c('0x56'),'COUNT':_0xf63c('0x57'),'COUNT DISTINCT':_0xf63c('0x58'),'MAX':_0xf63c('0x59'),'MIN':_0xf63c('0x5a'),'AVG':_0xf63c('0x5b'),'GROUP_CONCAT':_0xf63c('0x5c'),'GROUP_CONCAT ASC':_0xf63c('0x5d'),'GROUP_CONCAT DESC':_0xf63c('0x5e')};var _0x4ea56d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf63c('0x5f'),'HOUR':_0xf63c('0x60'),'ROUND':_0xf63c('0x61'),'UNIX_TIMESTAMP':_0xf63c('0x62')};var _0x414285=function(_0x1e78d4){return!_[_0xf63c('0x63')](['IS\x20NULL',_0xf63c('0x64'),_0xf63c('0x65'),'IS\x20NOT\x20EMPTY'],_0x1e78d4);};var _0x18a2e0=function(_0x437065){if(!_0x437065||!_0x437065['rules'][_0xf63c('0x66')]){return'';}for(var _0x4f06b3='(',_0x2184c2=0x0;_0x2184c2<_0x437065['rules'][_0xf63c('0x66')];_0x2184c2+=0x1){_0x2184c2>0x0&&(_0x4f06b3+='\x20'+_0x437065[_0xf63c('0x67')]+'\x20');_0x4f06b3+=_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x69')]?_0x18a2e0(_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x69')]):_0x437065['rules'][_0x2184c2]['field']+'\x20'+_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x6a')]+(_0x414285(_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x6a')])?'\x20'+_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x6b')]:'');}return _0x4f06b3+')';};var _0x8a0be3={'where':{'id':_0xe773f5[_0xf63c('0x48')]['id']}},_0x571f05,_0xabc96f,_0x3fad82,_0x52b847,_0x4b4cd4;_0x8a0be3=_[_0xf63c('0x40')]({},_0x8a0be3,_0xe773f5[_0xf63c('0x44')]);return db[_0xf63c('0x32')][_0xf63c('0x4f')](_0x8a0be3)[_0xf63c('0x29')](function(_0x35f4f0){if(_0x35f4f0){_0x571f05=_0x35f4f0;return _0x35f4f0[_0xf63c('0x6c')]();}return null;})[_0xf63c('0x29')](function(_0x1e42bf){if(_0x1e42bf){if(!_0x1e42bf['length']){throw new db[(_0xf63c('0x6d'))][(_0xf63c('0x6e'))](_0xf63c('0x6f'),0x193);}_0xabc96f=_0x1e42bf;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xf63c('0x29')](function(_0x29011c){if(_0x29011c){_0x3fad82=_[_0xf63c('0x70')](_0x29011c,'id');var _0x43cb1e;var _0x282d2d=squel[_0xf63c('0x71')]();_0x282d2d[_0xf63c('0x72')](_0x571f05[_0xf63c('0x73')]);for(var _0x5cd4f2=0x0;_0x5cd4f2<_0xabc96f['length'];_0x5cd4f2+=0x1){_0x43cb1e=_0xabc96f[_0x5cd4f2][_0xf63c('0x74')]?_0x3fad82[_0xabc96f[_0x5cd4f2]['MetricId']]['metric']:_0xabc96f[_0x5cd4f2]['field'];_0x43cb1e=_0xabc96f[_0x5cd4f2]['function']?_[_0xf63c('0x75')](_0x180e25[_0xabc96f[_0x5cd4f2][_0xf63c('0x76')]],'%s',_0x43cb1e):_0x43cb1e;_0x43cb1e=_0xabc96f[_0x5cd4f2][_0xf63c('0x77')]?_[_0xf63c('0x75')](_0x4ea56d[_0xabc96f[_0x5cd4f2][_0xf63c('0x77')]],'%s',_0x43cb1e):_0x43cb1e;if(_0xabc96f[_0x5cd4f2]['groupBy']){_0x282d2d[_0xf63c('0x69')](_0x43cb1e);}_0xabc96f[_0x5cd4f2][_0xf63c('0x78')]&&_0x282d2d['order'](_0x43cb1e,_0xabc96f[_0x5cd4f2][_0xf63c('0x78')]==='DESC'?![]:!![]);_0x282d2d['field'](_0x43cb1e,_0xabc96f[_0x5cd4f2][_0xf63c('0x79')]||_0x43cb1e);}if(_0x571f05[_0xf63c('0x7a')]){_0x571f05[_0xf63c('0x7a')]=JSON[_0xf63c('0x7b')](_0x571f05[_0xf63c('0x7a')]);for(var _0x349e91=0x0;_0x349e91<_0x571f05[_0xf63c('0x7a')]['length'];_0x349e91+=0x1){if(_0x571f05[_0xf63c('0x7a')][_0x349e91]['type']&&_[_0xf63c('0x63')](_0x1952f6,_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x41')])&&_0x571f05['joins'][_0x349e91][_0xf63c('0x7c')]&&_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7d')]&&_0x571f05['joins'][_0x349e91][_0xf63c('0x7e')]){_0x282d2d[_0x571f05[_0xf63c('0x7a')][_0x349e91]['type']](_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7d')],null,util[_0xf63c('0x77')](_0xf63c('0x7f'),_0x571f05[_0xf63c('0x73')],_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7c')],_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7d')],_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7e')]));}}}if(_0x571f05[_0xf63c('0x80')]){_0x571f05[_0xf63c('0x80')]=JSON[_0xf63c('0x7b')](_0x571f05[_0xf63c('0x80')]);_0x282d2d[_0xf63c('0x3f')](_0x18a2e0(_0x571f05[_0xf63c('0x80')][_0xf63c('0x69')]));}_0x4b4cd4=_0x282d2d[_0xf63c('0x81')]();_0x282d2d['limit'](_0x40bc99);_0x282d2d[_0xf63c('0x20')](0x0);logger[_0xf63c('0x82')](_0xf63c('0x83'),_0x282d2d[_0xf63c('0x84')]());return dbH[_0xf63c('0x85')][_0xf63c('0x35')](_0x282d2d[_0xf63c('0x84')](),{'type':dbH['sequelize'][_0xf63c('0x86')][_0xf63c('0x87')]});}})[_0xf63c('0x29')](respondWithResult(_0x55613a,null))[_0xf63c('0x47')](handleError(_0x55613a,null));};function runReport(_0x290ae,_0x269ca1,_0x10a7ab){var _0x249350=_0x269ca1[_0xf63c('0x2f')];var _0x676e7=0xa;var _0x5145b7=['join','left_join',_0xf63c('0x54'),'cross_join'];var _0x4e670e={'SUM':'SUM(%s)','COUNT':_0xf63c('0x57'),'COUNT DISTINCT':_0xf63c('0x58'),'MAX':_0xf63c('0x59'),'MIN':_0xf63c('0x5a'),'AVG':_0xf63c('0x5b'),'GROUP_CONCAT':_0xf63c('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf63c('0x5e')};var _0x180791={'SEC_TO_TIME':_0xf63c('0x88'),'DATE':'DATE(%s)','HOUR':_0xf63c('0x60'),'ROUND':_0xf63c('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2b669f=function(_0x4dde3e){return!_[_0xf63c('0x63')]([_0xf63c('0x89'),'IS\x20NOT\x20NULL',_0xf63c('0x65'),_0xf63c('0x8a')],_0x4dde3e);};var _0x44aa57=function(_0x417567){if(!_0x417567||!_0x417567[_0xf63c('0x68')][_0xf63c('0x66')]){return'';}for(var _0x4161ea='(',_0x1485ac=0x0;_0x1485ac<_0x417567[_0xf63c('0x68')][_0xf63c('0x66')];_0x1485ac+=0x1){_0x1485ac>0x0&&(_0x4161ea+='\x20'+_0x417567[_0xf63c('0x67')]+'\x20');_0x4161ea+=_0x417567[_0xf63c('0x68')][_0x1485ac][_0xf63c('0x69')]?_0x44aa57(_0x417567[_0xf63c('0x68')][_0x1485ac]['group']):_0x417567[_0xf63c('0x68')][_0x1485ac][_0xf63c('0x8b')]+'\x20'+_0x417567['rules'][_0x1485ac]['condition']+(_0x2b669f(_0x417567[_0xf63c('0x68')][_0x1485ac]['condition'])?'\x20'+_0x417567[_0xf63c('0x68')][_0x1485ac][_0xf63c('0x6b')]:'');}return _0x4161ea+')';};var _0x5f3cc9={'where':{'id':_0x290ae['id']}},_0x23f342,_0xd610bd,_0x3b6a07,_0x216233,_0x433b50;_0x5f3cc9=_[_0xf63c('0x40')]({},_0x5f3cc9,_0x10a7ab);return db[_0xf63c('0x32')]['find'](_0x5f3cc9)['then'](function(_0xa00856){if(_0xa00856){_0x23f342=_0xa00856;return _0xa00856['getFields']();}return null;})[_0xf63c('0x29')](function(_0x117527){if(_0x117527){if(!_0x117527[_0xf63c('0x66')]){throw new db['Sequelize'][(_0xf63c('0x6e'))](_0xf63c('0x6f'),0x193);}_0xd610bd=_0x117527;return db[_0xf63c('0x8c')][_0xf63c('0x8d')]({'raw':!![]});}return null;})[_0xf63c('0x29')](function(_0x67185b){if(_0x67185b){_0x3b6a07=_[_0xf63c('0x70')](_0x67185b,'id');var _0x183f57;var _0x37bab4=squel[_0xf63c('0x71')]();_0x37bab4['from'](_0x23f342[_0xf63c('0x73')]);for(var _0x3e8d30=0x0;_0x3e8d30<_0xd610bd[_0xf63c('0x66')];_0x3e8d30+=0x1){_0x183f57=_0xd610bd[_0x3e8d30][_0xf63c('0x74')]?_0x3b6a07[_0xd610bd[_0x3e8d30][_0xf63c('0x74')]][_0xf63c('0x8e')]:_0xd610bd[_0x3e8d30][_0xf63c('0x8b')];_0x183f57=_0xd610bd[_0x3e8d30][_0xf63c('0x76')]?_[_0xf63c('0x75')](_0x4e670e[_0xd610bd[_0x3e8d30][_0xf63c('0x76')]],'%s',_0x183f57):_0x183f57;_0x183f57=_0xd610bd[_0x3e8d30][_0xf63c('0x77')]?_[_0xf63c('0x75')](_0x180791[_0xd610bd[_0x3e8d30][_0xf63c('0x77')]],'%s',_0x183f57):_0x183f57;if(_0xd610bd[_0x3e8d30][_0xf63c('0x8f')]){_0x37bab4[_0xf63c('0x69')](_0x183f57);}_0xd610bd[_0x3e8d30][_0xf63c('0x78')]&&_0x37bab4[_0xf63c('0x3d')](_0x183f57,_0xd610bd[_0x3e8d30]['orderBy']==='DESC'?![]:!![]);_0x37bab4[_0xf63c('0x8b')](_0x183f57,_0xd610bd[_0x3e8d30]['alias']||_0x183f57);}if(_0x23f342[_0xf63c('0x7a')]){_0x23f342['joins']=JSON['parse'](_0x23f342['joins']);for(var _0xc99432=0x0;_0xc99432<_0x23f342['joins'][_0xf63c('0x66')];_0xc99432+=0x1){if(_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x41')]&&_[_0xf63c('0x63')](_0x5145b7,_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x41')])&&_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x7c')]&&_0x23f342['joins'][_0xc99432]['foreignTable']&&_0x23f342['joins'][_0xc99432]['foreignKey']){_0x37bab4[_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x41')]](_0x23f342['joins'][_0xc99432][_0xf63c('0x7d')],null,util[_0xf63c('0x77')](_0xf63c('0x7f'),_0x23f342[_0xf63c('0x73')],_0x23f342['joins'][_0xc99432][_0xf63c('0x7c')],_0x23f342[_0xf63c('0x7a')][_0xc99432]['foreignTable'],_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x7e')]));}}}if(_0x23f342[_0xf63c('0x80')]){_0x23f342['conditions']=JSON[_0xf63c('0x7b')](_0x23f342['conditions']);_0x37bab4[_0xf63c('0x3f')](_0x44aa57(_0x23f342[_0xf63c('0x80')][_0xf63c('0x69')]));}_0x433b50=_0x37bab4[_0xf63c('0x81')]();_0x37bab4[_0xf63c('0x21')](_0x676e7);_0x37bab4['offset'](0x0);return;}})[_0xf63c('0x29')](function(){if(_0x269ca1[_0xf63c('0x90')]===_0xf63c('0x91')){return null;}var _0x4ed29a=_['merge'](_0x269ca1,{'name':_0x269ca1[_0xf63c('0x92')]||_0x269ca1['name']||_0x23f342[_0xf63c('0x2f')],'basename':_0x249350,'savename':util['format'](_0xf63c('0x93'),_0x269ca1[_0xf63c('0x2f')]||_0x23f342[_0xf63c('0x2f')],require(_0xf63c('0x94'))[_0xf63c('0x95')](0x4),_0x269ca1[_0xf63c('0x90')]||_0xf63c('0x96')),'reportId':_0x23f342['id'],'reportType':_0xf63c('0x97')});return db[_0xf63c('0x98')][_0xf63c('0x4a')](_0x4ed29a,{'raw':!![]});})[_0xf63c('0x29')](function(_0x2e760d){if(_0x23f342[_0xf63c('0x73')]===_0xf63c('0x99')){_0x433b50[_0xf63c('0x3f')](_0x23f342[_0xf63c('0x73')]+_0xf63c('0x9a'),_0x269ca1['startDate'],_0x269ca1[_0xf63c('0x9b')]);}else{_0x433b50[_0xf63c('0x3f')](_0x23f342[_0xf63c('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x269ca1[_0xf63c('0x9c')],_0x269ca1['endDate']);}if(_0x2e760d){logger[_0xf63c('0x9d')]('Run\x20Query:',_0x433b50[_0xf63c('0x84')]());require(_0xf63c('0x9e'))[_0xf63c('0x9f')](path[_0xf63c('0x52')](__dirname,_0xf63c('0xa0'),_0x2e760d['output']),[_0x2e760d['id'],_0x433b50[_0xf63c('0x84')](),path['join'](__dirname,_0xf63c('0xa1'),_0x2e760d['savename']),_0x249350]);return _0x2e760d;}else{var _0x1edbdf=squel[_0xf63c('0x71')]();_0x1edbdf[_0xf63c('0x72')]('('+_0x433b50[_0xf63c('0x84')]()+')','countTable');_0x1edbdf[_0xf63c('0x8b')](_0xf63c('0xa2'),_0xf63c('0x22'));_0x433b50['limit'](_0x269ca1[_0xf63c('0x21')]||_0x676e7);_0x433b50[_0xf63c('0x20')](_0x269ca1['offset']||0x0);return dbH['sequelize']['query'](_0x1edbdf[_0xf63c('0x84')](),{'type':dbH[_0xf63c('0x85')][_0xf63c('0x86')][_0xf63c('0x87')]})['then'](function(_0xb086fc){if(!_0xb086fc[_0xf63c('0x66')]){_0x216233=0x0;}else{_0x216233=_0xb086fc[0x0][_0xf63c('0x22')]||0x0;}return dbH[_0xf63c('0x85')][_0xf63c('0x35')](_0x433b50[_0xf63c('0x84')](),{'type':dbH[_0xf63c('0x85')][_0xf63c('0x86')]['SELECT']});})[_0xf63c('0x29')](function(_0x13ead8){return{'rows':_0x13ead8||[],'count':_0x216233};});}});}exports[_0xf63c('0xa3')]=function(_0x57c446,_0x310076){return runReport(_0x57c446[_0xf63c('0x48')],_0x57c446[_0xf63c('0x35')],_0x57c446[_0xf63c('0x44')])[_0xf63c('0x29')](respondWithResult(_0x310076,null))[_0xf63c('0x47')](handleError(_0x310076,null));};exports[_0xf63c('0xa4')]=runReport;exports[_0xf63c('0x35')]=function(_0x164512,_0x4592be){var _0x2683dc=0xa;var _0x351536=[_0xf63c('0x52'),_0xf63c('0x53'),_0xf63c('0x54'),_0xf63c('0x55')];var _0x288c37={'SUM':'SUM(%s)','COUNT':_0xf63c('0x57'),'COUNT DISTINCT':_0xf63c('0x58'),'MAX':_0xf63c('0x59'),'MIN':_0xf63c('0x5a'),'AVG':_0xf63c('0x5b'),'GROUP_CONCAT':_0xf63c('0x5c'),'GROUP_CONCAT ASC':_0xf63c('0x5d'),'GROUP_CONCAT DESC':_0xf63c('0x5e')};var _0x32a8a9={'SEC_TO_TIME':_0xf63c('0x88'),'DATE':_0xf63c('0x5f'),'HOUR':_0xf63c('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf63c('0x62')};var _0x5d9c69=function(_0x1bb4d7){return!_[_0xf63c('0x63')]([_0xf63c('0x89'),_0xf63c('0x64'),_0xf63c('0x65'),_0xf63c('0x8a')],_0x1bb4d7);};var _0x4ae6d5=function(_0x40b952){if(!_0x40b952||!_0x40b952['rules'][_0xf63c('0x66')]){return'';}for(var _0x48b3bb='(',_0x5613d6=0x0;_0x5613d6<_0x40b952[_0xf63c('0x68')][_0xf63c('0x66')];_0x5613d6+=0x1){_0x5613d6>0x0&&(_0x48b3bb+='\x20'+_0x40b952[_0xf63c('0x67')]+'\x20');_0x48b3bb+=_0x40b952[_0xf63c('0x68')][_0x5613d6][_0xf63c('0x69')]?_0x4ae6d5(_0x40b952[_0xf63c('0x68')][_0x5613d6]['group']):_0x40b952['rules'][_0x5613d6][_0xf63c('0x8b')]+'\x20'+_0x40b952[_0xf63c('0x68')][_0x5613d6][_0xf63c('0x6a')]+(_0x5d9c69(_0x40b952['rules'][_0x5613d6][_0xf63c('0x6a')])?'\x20'+_0x40b952[_0xf63c('0x68')][_0x5613d6][_0xf63c('0x6b')]:'');}return _0x48b3bb+')';};var _0x55d46d={'where':{'id':_0x164512['params']['id']}},_0x4bc093,_0x18e87c,_0xb7efc2,_0x3698bc,_0x4bf262;_0x55d46d=_[_0xf63c('0x40')]({},_0x55d46d,_0x164512[_0xf63c('0x44')]);return db[_0xf63c('0x32')][_0xf63c('0x4f')](_0x55d46d)[_0xf63c('0x29')](function(_0x4fd18a){if(_0x4fd18a){_0x4bc093=_0x4fd18a;return _0x4fd18a[_0xf63c('0x6c')]();}return null;})[_0xf63c('0x29')](function(_0x131d8a){if(_0x131d8a){if(!_0x131d8a[_0xf63c('0x66')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x18e87c=_0x131d8a;return db['AnalyticMetric'][_0xf63c('0x8d')]({'raw':!![]});}return null;})[_0xf63c('0x29')](function(_0x47ea38){if(_0x47ea38){_0xb7efc2=_['keyBy'](_0x47ea38,'id');var _0x5c9654;var _0x139e92=squel['select']();_0x139e92[_0xf63c('0x72')](_0x4bc093[_0xf63c('0x73')]);for(var _0x54db63=0x0;_0x54db63<_0x18e87c['length'];_0x54db63+=0x1){_0x5c9654=_0x18e87c[_0x54db63][_0xf63c('0x74')]?_0xb7efc2[_0x18e87c[_0x54db63][_0xf63c('0x74')]][_0xf63c('0x8e')]:_0x18e87c[_0x54db63][_0xf63c('0x8b')];_0x5c9654=_0x18e87c[_0x54db63][_0xf63c('0x76')]?_[_0xf63c('0x75')](_0x288c37[_0x18e87c[_0x54db63][_0xf63c('0x76')]],'%s',_0x5c9654):_0x5c9654;_0x5c9654=_0x18e87c[_0x54db63][_0xf63c('0x77')]?_[_0xf63c('0x75')](_0x32a8a9[_0x18e87c[_0x54db63][_0xf63c('0x77')]],'%s',_0x5c9654):_0x5c9654;if(_0x18e87c[_0x54db63][_0xf63c('0x8f')]){_0x139e92[_0xf63c('0x69')](_0x5c9654);}_0x18e87c[_0x54db63]['orderBy']&&_0x139e92[_0xf63c('0x3d')](_0x5c9654,_0x18e87c[_0x54db63]['orderBy']===_0xf63c('0xa5')?![]:!![]);_0x139e92['field'](_0x5c9654,_0x18e87c[_0x54db63][_0xf63c('0x79')]||_0x5c9654);}if(_0x4bc093[_0xf63c('0x7a')]){_0x4bc093[_0xf63c('0x7a')]=JSON[_0xf63c('0x7b')](_0x4bc093[_0xf63c('0x7a')]);for(var _0x5f3ea2=0x0;_0x5f3ea2<_0x4bc093['joins'][_0xf63c('0x66')];_0x5f3ea2+=0x1){if(_0x4bc093['joins'][_0x5f3ea2][_0xf63c('0x41')]&&_[_0xf63c('0x63')](_0x351536,_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x41')])&&_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7c')]&&_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7d')]&&_0x4bc093['joins'][_0x5f3ea2][_0xf63c('0x7e')]){_0x139e92[_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2]['type']](_0x4bc093['joins'][_0x5f3ea2][_0xf63c('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4bc093[_0xf63c('0x73')],_0x4bc093['joins'][_0x5f3ea2]['parentKey'],_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7d')],_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7e')]));}}}if(_0x4bc093[_0xf63c('0x80')]){_0x4bc093['conditions']=JSON[_0xf63c('0x7b')](_0x4bc093['conditions']);_0x139e92[_0xf63c('0x3f')](_0x4ae6d5(_0x4bc093['conditions'][_0xf63c('0x69')]));}_0x4bf262=_0x139e92[_0xf63c('0x81')]();_0x139e92[_0xf63c('0x21')](_0x2683dc);_0x139e92[_0xf63c('0x20')](0x0);logger[_0xf63c('0x82')](_0xf63c('0x83'),_0x139e92[_0xf63c('0x84')]());return dbH[_0xf63c('0x85')][_0xf63c('0x35')](_0x139e92[_0xf63c('0x84')](),{'type':dbH['sequelize'][_0xf63c('0x86')][_0xf63c('0x87')]});}})[_0xf63c('0x29')](function(){return{'sql':_0x4bf262[_0xf63c('0x84')]()};})[_0xf63c('0x29')](respondWithResult(_0x4592be,null))[_0xf63c('0x47')](handleError(_0x4592be,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 9c63bb0..b423774 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 _0x7803=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x179351,_0x59cee4){var _0x11d0ec=function(_0x204a10){while(--_0x204a10){_0x179351['push'](_0x179351['shift']());}};_0x11d0ec(++_0x59cee4);}(_0x7803,0x1b1));var _0x3780=function(_0x3b2d4f,_0x1ebc96){_0x3b2d4f=_0x3b2d4f-0x0;var _0x4babfb=_0x7803[_0x3b2d4f];return _0x4babfb;};'use strict';var _=require(_0x3780('0x0'));var util=require(_0x3780('0x1'));var logger=require(_0x3780('0x2'))(_0x3780('0x3'));var moment=require(_0x3780('0x4'));var BPromise=require('bluebird');var rp=require(_0x3780('0x5'));var fs=require('fs');var path=require(_0x3780('0x6'));var rimraf=require('rimraf');var config=require(_0x3780('0x7'));var attributes=require(_0x3780('0x8'));module[_0x3780('0x9')]=function(_0x4197da,_0x5759f3){return _0x4197da[_0x3780('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x3780('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0226=['moment','bluebird','request-promise','path','rimraf','define','AnalyticCustomReport','analytics_custom_reports','lodash','api'];(function(_0x96a34a,_0x48b3c6){var _0x4e325e=function(_0x20e343){while(--_0x20e343){_0x96a34a['push'](_0x96a34a['shift']());}};_0x4e325e(++_0x48b3c6);}(_0x0226,0x1ca));var _0x6022=function(_0x3aaf97,_0x4fa2e8){_0x3aaf97=_0x3aaf97-0x0;var _0xeba75e=_0x0226[_0x3aaf97];return _0xeba75e;};'use strict';var _=require(_0x6022('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6022('0x1'));var moment=require(_0x6022('0x2'));var BPromise=require(_0x6022('0x3'));var rp=require(_0x6022('0x4'));var fs=require('fs');var path=require(_0x6022('0x5'));var rimraf=require(_0x6022('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x1d8d1d,_0x95bcaf){return _0x1d8d1d[_0x6022('0x7')](_0x6022('0x8'),attributes,{'tableName':_0x6022('0x9'),'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 f88a177..0c2e2d9 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 _0x3be1=['AnalyticCustomReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3be1,0x1bd));var _0x13be=function(_0x2b3f39,_0x137ea5){_0x2b3f39=_0x2b3f39-0x0;var _0x16b06f=_0x3be1[_0x2b3f39];return _0x16b06f;};'use strict';var _=require('lodash');var util=require(_0x13be('0x0'));var moment=require(_0x13be('0x1'));var BPromise=require(_0x13be('0x2'));var rs=require(_0x13be('0x3'));var fs=require('fs');var Redis=require(_0x13be('0x4'));var db=require(_0x13be('0x5'))['db'];var utils=require(_0x13be('0x6'));var logger=require(_0x13be('0x7'))(_0x13be('0x8'));var config=require('../../config/environment');var jayson=require(_0x13be('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6fa2,_0x2105c8,_0x44ef7b){return new BPromise(function(_0x53d160,_0x141d88){return client['request'](_0x5b6fa2,_0x44ef7b)['then'](function(_0x4e015c){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2105c8,_0x13be('0xa'));logger['debug'](_0x13be('0xb'),_0x2105c8,_0x13be('0xa'),JSON[_0x13be('0xc')](_0x4e015c));if(_0x4e015c[_0x13be('0xd')]){if(_0x4e015c['error'][_0x13be('0xe')]===0x1f4){logger[_0x13be('0xd')](_0x13be('0xf'),_0x2105c8,_0x4e015c[_0x13be('0xd')][_0x13be('0x10')]);return _0x141d88(_0x4e015c[_0x13be('0xd')][_0x13be('0x10')]);}logger[_0x13be('0xd')](_0x13be('0xf'),_0x2105c8,_0x4e015c[_0x13be('0xd')]['message']);return _0x53d160(_0x4e015c[_0x13be('0xd')][_0x13be('0x10')]);}else{logger[_0x13be('0x11')](_0x13be('0xf'),_0x2105c8,_0x13be('0xa'));_0x53d160(_0x4e015c[_0x13be('0x12')][_0x13be('0x10')]);}})[_0x13be('0x13')](function(_0x40771e){logger[_0x13be('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2105c8,_0x40771e);_0x141d88(_0x40771e);});});}
\ No newline at end of file
+var _0x43e2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x247f3f,_0x5f298e){var _0x1381e6=function(_0x1e8355){while(--_0x1e8355){_0x247f3f['push'](_0x247f3f['shift']());}};_0x1381e6(++_0x5f298e);}(_0x43e2,0x14c));var _0x243e=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x43e2[_0x588011];return _0x3b3773;};'use strict';var _=require(_0x243e('0x0'));var util=require(_0x243e('0x1'));var moment=require(_0x243e('0x2'));var BPromise=require('bluebird');var rs=require(_0x243e('0x3'));var fs=require('fs');var Redis=require(_0x243e('0x4'));var db=require(_0x243e('0x5'))['db'];var utils=require(_0x243e('0x6'));var logger=require(_0x243e('0x7'))(_0x243e('0x8'));var config=require('../../config/environment');var jayson=require(_0x243e('0x9'));var client=jayson[_0x243e('0xa')][_0x243e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x228eed,_0x56fbe7,_0x4a38ed){return new BPromise(function(_0xc34a53,_0xd6f0a7){return client[_0x243e('0xc')](_0x228eed,_0x4a38ed)[_0x243e('0xd')](function(_0x417003){logger[_0x243e('0xe')](_0x243e('0xf'),_0x56fbe7,'request\x20sent');logger['debug'](_0x243e('0x10'),_0x56fbe7,_0x243e('0x11'),JSON[_0x243e('0x12')](_0x417003));if(_0x417003['error']){if(_0x417003[_0x243e('0x13')][_0x243e('0x14')]===0x1f4){logger[_0x243e('0x13')](_0x243e('0xf'),_0x56fbe7,_0x417003[_0x243e('0x13')]['message']);return _0xd6f0a7(_0x417003[_0x243e('0x13')][_0x243e('0x15')]);}logger[_0x243e('0x13')](_0x243e('0xf'),_0x56fbe7,_0x417003[_0x243e('0x13')]['message']);return _0xc34a53(_0x417003[_0x243e('0x13')][_0x243e('0x15')]);}else{logger[_0x243e('0xe')](_0x243e('0xf'),_0x56fbe7,_0x243e('0x11'));_0xc34a53(_0x417003[_0x243e('0x16')]['message']);}})[_0x243e('0x17')](function(_0x5179d8){logger[_0x243e('0x13')](_0x243e('0xf'),_0x56fbe7,_0x5179d8);_0xd6f0a7(_0x5179d8);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 2b089eb..51e373e 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 _0x0b45=['create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post'];(function(_0x3db456,_0x3b93b5){var _0x2402a1=function(_0x3ae218){while(--_0x3ae218){_0x3db456['push'](_0x3db456['shift']());}};_0x2402a1(++_0x3b93b5);}(_0x0b45,0xb3));var _0x50b4=function(_0x4b5a95,_0x4b046c){_0x4b5a95=_0x4b5a95-0x0;var _0x28d360=_0x0b45[_0x4b5a95];return _0x28d360;};'use strict';var multer=require(_0x50b4('0x0'));var util=require(_0x50b4('0x1'));var path=require(_0x50b4('0x2'));var timeout=require(_0x50b4('0x3'));var express=require(_0x50b4('0x4'));var router=express[_0x50b4('0x5')]();var fs_extra=require(_0x50b4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x50b4('0x7'));var config=require(_0x50b4('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x50b4('0x9')]('/',auth['isAuthenticated'](),controller[_0x50b4('0xa')]);router[_0x50b4('0x9')](_0x50b4('0xb'),auth['isAuthenticated'](),controller[_0x50b4('0xc')]);router[_0x50b4('0x9')](_0x50b4('0xd'),auth[_0x50b4('0xe')](),controller[_0x50b4('0xf')]);router[_0x50b4('0x9')](_0x50b4('0x10'),auth['isAuthenticated'](),controller[_0x50b4('0x11')]);router[_0x50b4('0x9')](_0x50b4('0x12'),auth[_0x50b4('0xe')](),controller[_0x50b4('0x13')]);router[_0x50b4('0x14')]('/',auth[_0x50b4('0xe')](),controller[_0x50b4('0x15')]);router['put'](_0x50b4('0xb'),auth[_0x50b4('0xe')](),controller[_0x50b4('0x16')]);router[_0x50b4('0x17')]('/:id',auth[_0x50b4('0xe')](),controller[_0x50b4('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x6d63=['./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x59e903,_0x303626){var _0x21e3f6=function(_0x4c304d){while(--_0x4c304d){_0x59e903['push'](_0x59e903['shift']());}};_0x21e3f6(++_0x303626);}(_0x6d63,0x89));var _0x36d6=function(_0x4759c3,_0x24f58a){_0x4759c3=_0x4759c3-0x0;var _0xac8def=_0x6d63[_0x4759c3];return _0xac8def;};'use strict';var multer=require(_0x36d6('0x0'));var util=require(_0x36d6('0x1'));var path=require(_0x36d6('0x2'));var timeout=require(_0x36d6('0x3'));var express=require('express');var router=express[_0x36d6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x36d6('0x5'));var config=require(_0x36d6('0x6'));var controller=require(_0x36d6('0x7'));router[_0x36d6('0x8')]('/',auth[_0x36d6('0x9')](),controller['index']);router['get']('/:id',auth[_0x36d6('0x9')](),controller[_0x36d6('0xa')]);router['get'](_0x36d6('0xb'),auth[_0x36d6('0x9')](),controller[_0x36d6('0xc')]);router['get'](_0x36d6('0xd'),auth[_0x36d6('0x9')](),controller[_0x36d6('0xe')]);router[_0x36d6('0x8')](_0x36d6('0xf'),auth[_0x36d6('0x9')](),controller[_0x36d6('0x10')]);router[_0x36d6('0x11')]('/',auth[_0x36d6('0x9')](),controller['create']);router[_0x36d6('0x12')](_0x36d6('0x13'),auth[_0x36d6('0x9')](),controller[_0x36d6('0x14')]);router[_0x36d6('0x15')](_0x36d6('0x13'),auth['isAuthenticated'](),controller[_0x36d6('0x16')]);module[_0x36d6('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 7b44de4..9f42aa7 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 _0x5d58=['TEXT','STRING'];(function(_0x3e1740,_0x46f1b6){var _0x507cb0=function(_0x5afe84){while(--_0x5afe84){_0x3e1740['push'](_0x3e1740['shift']());}};_0x507cb0(++_0x46f1b6);}(_0x5d58,0x187));var _0x85d5=function(_0x121325,_0x47ec9a){_0x121325=_0x121325-0x0;var _0x1c5f43=_0x5d58[_0x121325];return _0x1c5f43;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4ea754,_0x1659ec){_0x4ea754=_0x4ea754-0x0;var _0x26a3cd=_0xb4c7[_0x4ea754];return _0x26a3cd;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 5df5bf3..6e8bf0c 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 _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x3088cb,_0x3de8ad){var _0x1fb9f3=function(_0x44e19a){while(--_0x44e19a){_0x3088cb['push'](_0x3088cb['shift']());}};_0x1fb9f3(++_0x3de8ad);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5b4f01,_0x2d4c06){_0x5b4f01=_0x5b4f01-0x0;var _0xf8df07=_0x1cb9[_0x5b4f01];return _0xf8df07;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
+var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x9ac89b,_0x25b61d){var _0x40da74=function(_0x2643a2){while(--_0x2643a2){_0x9ac89b['push'](_0x9ac89b['shift']());}};_0x40da74(++_0x25b61d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5230690..323c327 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 _0x3272=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes'];(function(_0x4f6c8d,_0x5dab1f){var _0x322d13=function(_0x1805b9){while(--_0x1805b9){_0x4f6c8d['push'](_0x4f6c8d['shift']());}};_0x322d13(++_0x5dab1f);}(_0x3272,0x70));var _0x2327=function(_0x3671e7,_0x212b07){_0x3671e7=_0x3671e7-0x0;var _0x10bfc0=_0x3272[_0x3671e7];return _0x10bfc0;};'use strict';var _=require(_0x2327('0x0'));var util=require('util');var logger=require(_0x2327('0x1'))(_0x2327('0x2'));var moment=require('moment');var BPromise=require(_0x2327('0x3'));var rp=require(_0x2327('0x4'));var fs=require('fs');var path=require(_0x2327('0x5'));var rimraf=require(_0x2327('0x6'));var config=require('../../config/environment');var attributes=require(_0x2327('0x7'));module[_0x2327('0x8')]=function(_0x4d946e,_0x470137){return _0x4d946e[_0x2327('0x9')](_0x2327('0xa'),attributes,{'tableName':_0x2327('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae18=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x3c44fd,_0x4eb40d){var _0x1d49bb=function(_0x44adc5){while(--_0x44adc5){_0x3c44fd['push'](_0x3c44fd['shift']());}};_0x1d49bb(++_0x4eb40d);}(_0xae18,0x165));var _0x8ae1=function(_0x4fda72,_0x3aa0d3){_0x4fda72=_0x4fda72-0x0;var _0x1cc54a=_0xae18[_0x4fda72];return _0x1cc54a;};'use strict';var _=require('lodash');var util=require(_0x8ae1('0x0'));var logger=require(_0x8ae1('0x1'))(_0x8ae1('0x2'));var moment=require(_0x8ae1('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ae1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ae1('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ae1('0x6'));module[_0x8ae1('0x7')]=function(_0x1976f1,_0x1ea765){return _0x1976f1[_0x8ae1('0x8')](_0x8ae1('0x9'),attributes,{'tableName':_0x8ae1('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 14372c8..18175ba 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 _0xb55b=['info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xb55b,0x1d7));var _0xbb55=function(_0xa8b074,_0xeabb35){_0xa8b074=_0xa8b074-0x0;var _0x41f89e=_0xb55b[_0xa8b074];return _0x41f89e;};'use strict';var _=require(_0xbb55('0x0'));var util=require(_0xbb55('0x1'));var moment=require(_0xbb55('0x2'));var BPromise=require(_0xbb55('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb55('0x4'))['db'];var utils=require(_0xbb55('0x5'));var logger=require(_0xbb55('0x6'))(_0xbb55('0x7'));var config=require(_0xbb55('0x8'));var jayson=require(_0xbb55('0x9'));var client=jayson[_0xbb55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x233c90,_0x341aa6,_0x19dc98){return new BPromise(function(_0x4395a5,_0x253361){return client['request'](_0x233c90,_0x19dc98)[_0xbb55('0xb')](function(_0x41919e){logger[_0xbb55('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x341aa6,_0xbb55('0xd'));logger[_0xbb55('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x341aa6,_0xbb55('0xd'),JSON[_0xbb55('0xf')](_0x41919e));if(_0x41919e[_0xbb55('0x10')]){if(_0x41919e[_0xbb55('0x10')][_0xbb55('0x11')]===0x1f4){logger[_0xbb55('0x10')](_0xbb55('0x12'),_0x341aa6,_0x41919e[_0xbb55('0x10')][_0xbb55('0x13')]);return _0x253361(_0x41919e[_0xbb55('0x10')][_0xbb55('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x341aa6,_0x41919e['error'][_0xbb55('0x13')]);return _0x4395a5(_0x41919e[_0xbb55('0x10')][_0xbb55('0x13')]);}else{logger[_0xbb55('0xc')](_0xbb55('0x12'),_0x341aa6,_0xbb55('0xd'));_0x4395a5(_0x41919e['result']['message']);}})[_0xbb55('0x14')](function(_0x252856){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x341aa6,_0x252856);_0x253361(_0x252856);});});}
\ No newline at end of file
+var _0xdb04=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ad901,_0x852d9e){var _0x3c0249=function(_0x319eda){while(--_0x319eda){_0x1ad901['push'](_0x1ad901['shift']());}};_0x3c0249(++_0x852d9e);}(_0xdb04,0x1cf));var _0x4db0=function(_0x5238b4,_0x3df4d6){_0x5238b4=_0x5238b4-0x0;var _0x317074=_0xdb04[_0x5238b4];return _0x317074;};'use strict';var _=require(_0x4db0('0x0'));var util=require(_0x4db0('0x1'));var moment=require(_0x4db0('0x2'));var BPromise=require(_0x4db0('0x3'));var rs=require(_0x4db0('0x4'));var fs=require('fs');var Redis=require(_0x4db0('0x5'));var db=require(_0x4db0('0x6'))['db'];var utils=require(_0x4db0('0x7'));var logger=require(_0x4db0('0x8'))(_0x4db0('0x9'));var config=require(_0x4db0('0xa'));var jayson=require(_0x4db0('0xb'));var client=jayson[_0x4db0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36fe26,_0x5b593a,_0x3302f9){return new BPromise(function(_0x595542,_0x380e9b){return client[_0x4db0('0xd')](_0x36fe26,_0x3302f9)['then'](function(_0x175135){logger[_0x4db0('0xe')](_0x4db0('0xf'),_0x5b593a,_0x4db0('0x10'));logger[_0x4db0('0x11')](_0x4db0('0x12'),_0x5b593a,_0x4db0('0x10'),JSON[_0x4db0('0x13')](_0x175135));if(_0x175135[_0x4db0('0x14')]){if(_0x175135[_0x4db0('0x14')][_0x4db0('0x15')]===0x1f4){logger[_0x4db0('0x14')](_0x4db0('0xf'),_0x5b593a,_0x175135[_0x4db0('0x14')]['message']);return _0x380e9b(_0x175135[_0x4db0('0x14')][_0x4db0('0x16')]);}logger[_0x4db0('0x14')](_0x4db0('0xf'),_0x5b593a,_0x175135[_0x4db0('0x14')][_0x4db0('0x16')]);return _0x595542(_0x175135[_0x4db0('0x14')][_0x4db0('0x16')]);}else{logger[_0x4db0('0xe')](_0x4db0('0xf'),_0x5b593a,_0x4db0('0x10'));_0x595542(_0x175135['result'][_0x4db0('0x16')]);}})['catch'](function(_0xaec10a){logger[_0x4db0('0x14')](_0x4db0('0xf'),_0x5b593a,_0xaec10a);_0x380e9b(_0xaec10a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 14c75d0..67cbefb 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 _0xdf7c=['/:id','isAuthenticated','/:id/preview','run','/:id/query','query','post','create','update','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x484c5c,_0x5d67b2){var _0x1b8928=function(_0xdfcff4){while(--_0xdfcff4){_0x484c5c['push'](_0x484c5c['shift']());}};_0x1b8928(++_0x5d67b2);}(_0xdf7c,0x149));var _0xcdf7=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0xdf7c[_0x310a1b];return _0xdea206;};'use strict';var multer=require('multer');var util=require(_0xcdf7('0x0'));var path=require(_0xcdf7('0x1'));var timeout=require(_0xcdf7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcdf7('0x3'));var interaction=require(_0xcdf7('0x4'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xcdf7('0x5')]('/',auth['isAuthenticated'](),controller[_0xcdf7('0x6')]);router['get'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller['show']);router[_0xcdf7('0x5')](_0xcdf7('0x9'),auth[_0xcdf7('0x8')](),controller['preview']);router[_0xcdf7('0x5')]('/:id/run',auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xa')]);router[_0xcdf7('0x5')](_0xcdf7('0xb'),auth['isAuthenticated'](),controller[_0xcdf7('0xc')]);router[_0xcdf7('0xd')]('/',auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xe')]);router['put'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xf')]);router['delete'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x18ec=['post','create','put','update','delete','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/run','run','/:id/query','query'];(function(_0x2df2b5,_0x50fe36){var _0x4755a0=function(_0x164939){while(--_0x164939){_0x2df2b5['push'](_0x2df2b5['shift']());}};_0x4755a0(++_0x50fe36);}(_0x18ec,0xf7));var _0xc18e=function(_0x512600,_0x44c3b4){_0x512600=_0x512600-0x0;var _0x317eb5=_0x18ec[_0x512600];return _0x317eb5;};'use strict';var multer=require('multer');var util=require(_0xc18e('0x0'));var path=require('path');var timeout=require(_0xc18e('0x1'));var express=require(_0xc18e('0x2'));var router=express[_0xc18e('0x3')]();var fs_extra=require(_0xc18e('0x4'));var auth=require(_0xc18e('0x5'));var interaction=require(_0xc18e('0x6'));var config=require(_0xc18e('0x7'));var controller=require(_0xc18e('0x8'));router[_0xc18e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc18e('0xa')]);router[_0xc18e('0x9')](_0xc18e('0xb'),auth[_0xc18e('0xc')](),controller['show']);router[_0xc18e('0x9')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xc18e('0x9')](_0xc18e('0xd'),auth[_0xc18e('0xc')](),controller[_0xc18e('0xe')]);router['get'](_0xc18e('0xf'),auth[_0xc18e('0xc')](),controller[_0xc18e('0x10')]);router[_0xc18e('0x11')]('/',auth[_0xc18e('0xc')](),controller[_0xc18e('0x12')]);router[_0xc18e('0x13')](_0xc18e('0xb'),auth[_0xc18e('0xc')](),controller[_0xc18e('0x14')]);router[_0xc18e('0x15')]('/:id',auth[_0xc18e('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index e0051d5..224b834 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 _0x5162=['pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5162,0x7d));var _0x2516=function(_0x2d6df9,_0x45da50){_0x2d6df9=_0x2d6df9-0x0;var _0x429b18=_0x5162[_0x2d6df9];return _0x429b18;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2516('0x0'));module[_0x2516('0x1')]={'name':{'type':Sequelize[_0x2516('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2516('0x3')](_0x2516('0x4'),_0x2516('0x5'),_0x2516('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x2516('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2516('0x7')]},'endDate':{'type':Sequelize[_0x2516('0x7')]},'status':{'type':Sequelize[_0x2516('0x2')],'defaultValue':_0x2516('0x8')},'type':{'type':Sequelize[_0x2516('0x3')](_0x2516('0x9'),_0x2516('0xa')),'allowNull':![],'defaultValue':_0x2516('0x9')},'reportId':{'type':Sequelize[_0x2516('0xb')](0xb)[_0x2516('0xc')]},'reportType':{'type':Sequelize[_0x2516('0x2')]}};
\ No newline at end of file
+var _0x77fe=['manual','INTEGER','sequelize','moment','exports','csv','pdf','STRING','DATE','scheduled'];(function(_0x5392af,_0x45123c){var _0xc025c5=function(_0x4d0dab){while(--_0x4d0dab){_0x5392af['push'](_0x5392af['shift']());}};_0xc025c5(++_0x45123c);}(_0x77fe,0x110));var _0xe77f=function(_0x1c3e2f,_0x14f882){_0x1c3e2f=_0x1c3e2f-0x0;var _0x36e8a7=_0x77fe[_0x1c3e2f];return _0x36e8a7;};'use strict';var Sequelize=require(_0xe77f('0x0'));var moment=require(_0xe77f('0x1'));module[_0xe77f('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe77f('0x3'),_0xe77f('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0xe77f('0x3')},'savename':{'type':Sequelize[_0xe77f('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe77f('0x6')]},'endDate':{'type':Sequelize[_0xe77f('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0xe77f('0x7')),'allowNull':![],'defaultValue':_0xe77f('0x8')},'reportId':{'type':Sequelize[_0xe77f('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe77f('0x5')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 8297d33..85b3972 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 _0xc56a=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','then','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','%s.%s','basename','toLowerCase','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status'];(function(_0x3e14bf,_0x19c6ee){var _0x2efa39=function(_0x5f4231){while(--_0x5f4231){_0x3e14bf['push'](_0x3e14bf['shift']());}};_0x2efa39(++_0x19c6ee);}(_0xc56a,0xff));var _0xac56=function(_0x499e75,_0x2f89e3){_0x499e75=_0x499e75-0x0;var _0x24834d=_0xc56a[_0x499e75];return _0x24834d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac56('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac56('0x1'));var moment=require(_0xac56('0x2'));var BPromise=require(_0xac56('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac56('0x4'));var sox=require(_0xac56('0x5'));var csv=require(_0xac56('0x6'));var ejs=require(_0xac56('0x7'));var fs=require('fs');var fs_extra=require(_0xac56('0x8'));var _=require(_0xac56('0x9'));var squel=require(_0xac56('0xa'));var crypto=require(_0xac56('0xb'));var jsforce=require(_0xac56('0xc'));var deskjs=require(_0xac56('0xd'));var toCsv=require(_0xac56('0x6'));var querystring=require(_0xac56('0xe'));var Papa=require(_0xac56('0xf'));var Redis=require(_0xac56('0x10'));var authService=require(_0xac56('0x11'));var qs=require(_0xac56('0x12'));var as=require(_0xac56('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac56('0x14'))(_0xac56('0x15'));var utils=require('../../config/utils');var config=require(_0xac56('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xac56('0x17'))['db'];function respondWithStatusCode(_0x5b7e93,_0xc9058){_0xc9058=_0xc9058||0xcc;return function(_0xf18ef0){if(_0xf18ef0){return _0x5b7e93[_0xac56('0x18')](_0xc9058);}return _0x5b7e93['status'](_0xc9058)[_0xac56('0x19')]();};}function respondWithResult(_0x5ee8aa,_0x1145d8){_0x1145d8=_0x1145d8||0xc8;return function(_0x431800){if(_0x431800){return _0x5ee8aa[_0xac56('0x1a')](_0x1145d8)[_0xac56('0x1b')](_0x431800);}};}function respondWithFilteredResult(_0x277263,_0x447274){return function(_0x2b2395){if(_0x2b2395){var _0x68a377=typeof _0x447274['offset']===_0xac56('0x1c')&&typeof _0x447274[_0xac56('0x1d')]===_0xac56('0x1c');var _0x506c87=_0x2b2395[_0xac56('0x1e')];var _0x470bae=_0x68a377?0x0:_0x447274[_0xac56('0x1f')];var _0x1b1e6a=_0x68a377?_0x2b2395[_0xac56('0x1e')]:_0x447274[_0xac56('0x1f')]+_0x447274[_0xac56('0x1d')];var _0xd72f01;if(_0x1b1e6a>=_0x506c87){_0x1b1e6a=_0x506c87;_0xd72f01=0xc8;}else{_0xd72f01=0xce;}_0x277263[_0xac56('0x1a')](_0xd72f01);return _0x277263[_0xac56('0x20')](_0xac56('0x21'),_0x470bae+'-'+_0x1b1e6a+'/'+_0x506c87)[_0xac56('0x1b')](_0x2b2395);}return null;};}function patchUpdates(_0x525b93){return function(_0x17bc60){try{jsonpatch[_0xac56('0x22')](_0x17bc60,_0x525b93,!![]);}catch(_0x15f278){return BPromise[_0xac56('0x23')](_0x15f278);}return _0x17bc60[_0xac56('0x24')]();};}function saveUpdates(_0x52af78,_0x3f725b){return function(_0x507445){if(_0x507445){return _0x507445[_0xac56('0x25')](_0x52af78)['then'](function(_0x30cc2e){return _0x30cc2e;});}return null;};}function removeEntity(_0x4b7ee2,_0x3b51f0){return function(_0x25dfca){if(_0x25dfca){return _0x25dfca[_0xac56('0x26')]()['then'](function(){var _0x4b1514=_0x25dfca[_0xac56('0x27')]({'plain':!![]});var _0x348d89='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x348d89,'resourceId':_0x4b1514['id']}})[_0xac56('0x28')](function(){return _0x25dfca;});})[_0xac56('0x28')](function(){_0x4b7ee2[_0xac56('0x1a')](0xcc)[_0xac56('0x19')]();});}};}function handleEntityNotFound(_0x177879,_0x351c07){return function(_0xdd34a1){if(!_0xdd34a1){_0x177879['sendStatus'](0x194);}return _0xdd34a1;};}function handleError(_0x93e866,_0x2bfb8f){_0x2bfb8f=_0x2bfb8f||0x1f4;return function(_0x3d77d0){logger[_0xac56('0x29')](_0x3d77d0[_0xac56('0x2a')]);if(_0x3d77d0[_0xac56('0x2b')]){delete _0x3d77d0[_0xac56('0x2b')];}_0x93e866['status'](_0x2bfb8f)['send'](_0x3d77d0);};}exports['index']=function(_0x4b4781,_0x45494f){var _0x5e4ad2={},_0x5c5ab3={},_0x294bd2={'count':0x0,'rows':[]};var _0x44c0d6=_[_0xac56('0x2c')](db[_0xac56('0x2d')][_0xac56('0x2e')],function(_0x4b37c4){return{'name':_0x4b37c4[_0xac56('0x2f')],'type':_0x4b37c4['type'][_0xac56('0x30')]};});_0x5c5ab3['model']=_['map'](_0x44c0d6,'name');_0x5c5ab3[_0xac56('0x31')]=_[_0xac56('0x32')](_0x4b4781['query']);_0x5c5ab3[_0xac56('0x33')]=_[_0xac56('0x34')](_0x5c5ab3['model'],_0x5c5ab3[_0xac56('0x31')]);_0x5e4ad2[_0xac56('0x35')]=_[_0xac56('0x34')](_0x5c5ab3[_0xac56('0x36')],qs[_0xac56('0x37')](_0x4b4781[_0xac56('0x31')][_0xac56('0x37')]));_0x5e4ad2['attributes']=_0x5e4ad2['attributes'][_0xac56('0x38')]?_0x5e4ad2['attributes']:_0x5c5ab3[_0xac56('0x36')];if(!_0x4b4781[_0xac56('0x31')]['hasOwnProperty'](_0xac56('0x39'))){_0x5e4ad2[_0xac56('0x1d')]=qs[_0xac56('0x1d')](_0x4b4781['query'][_0xac56('0x1d')]);_0x5e4ad2[_0xac56('0x1f')]=qs[_0xac56('0x1f')](_0x4b4781['query'][_0xac56('0x1f')]);}_0x5e4ad2[_0xac56('0x3a')]=qs['sort'](_0x4b4781[_0xac56('0x31')][_0xac56('0x3b')]);_0x5e4ad2[_0xac56('0x3c')]=qs[_0xac56('0x33')](_[_0xac56('0x3d')](_0x4b4781[_0xac56('0x31')],_0x5c5ab3[_0xac56('0x33')]),_0x44c0d6);if(_0x4b4781[_0xac56('0x31')][_0xac56('0x3e')]){_0x5e4ad2[_0xac56('0x3c')]=_[_0xac56('0x3f')](_0x5e4ad2[_0xac56('0x3c')],{'$or':_[_0xac56('0x2c')](_0x44c0d6,function(_0x51e132){if(_0x51e132['type']!=='VIRTUAL'){var _0x13d50e={};_0x13d50e[_0x51e132[_0xac56('0x2b')]]={'$like':'%'+_0x4b4781[_0xac56('0x31')]['filter']+'%'};return _0x13d50e;}})});}_0x5e4ad2=_[_0xac56('0x3f')]({},_0x5e4ad2,_0x4b4781[_0xac56('0x40')]);var _0xd8a37f={'where':_0x5e4ad2['where']};return db[_0xac56('0x2d')][_0xac56('0x1e')](_0xd8a37f)[_0xac56('0x28')](function(_0x17d803){_0x294bd2[_0xac56('0x1e')]=_0x17d803;if(_0x4b4781['query'][_0xac56('0x41')]){_0x5e4ad2[_0xac56('0x42')]=[{'all':!![]}];}return db[_0xac56('0x2d')]['findAll'](_0x5e4ad2);})[_0xac56('0x28')](function(_0x2a4c9a){_0x294bd2['rows']=_0x2a4c9a;return _0x294bd2;})[_0xac56('0x28')](respondWithFilteredResult(_0x45494f,_0x5e4ad2))[_0xac56('0x43')](handleError(_0x45494f,null));};exports['show']=function(_0x44f31b,_0x401567){var _0x1399b1={'raw':!![],'where':{'id':_0x44f31b[_0xac56('0x44')]['id']}},_0xdc62cd={};_0xdc62cd[_0xac56('0x36')]=_[_0xac56('0x32')](db[_0xac56('0x2d')]['rawAttributes']);_0xdc62cd[_0xac56('0x31')]=_[_0xac56('0x32')](_0x44f31b[_0xac56('0x31')]);_0xdc62cd['filters']=_['intersection'](_0xdc62cd['model'],_0xdc62cd[_0xac56('0x31')]);_0x1399b1[_0xac56('0x35')]=_[_0xac56('0x34')](_0xdc62cd[_0xac56('0x36')],qs[_0xac56('0x37')](_0x44f31b[_0xac56('0x31')][_0xac56('0x37')]));_0x1399b1[_0xac56('0x35')]=_0x1399b1['attributes']['length']?_0x1399b1[_0xac56('0x35')]:_0xdc62cd[_0xac56('0x36')];if(_0x44f31b[_0xac56('0x31')][_0xac56('0x41')]){_0x1399b1[_0xac56('0x42')]=[{'all':!![]}];}_0x1399b1=_[_0xac56('0x3f')]({},_0x1399b1,_0x44f31b['options']);return db[_0xac56('0x2d')][_0xac56('0x45')](_0x1399b1)['then'](handleEntityNotFound(_0x401567,null))[_0xac56('0x28')](respondWithResult(_0x401567,null))[_0xac56('0x43')](handleError(_0x401567,null));};exports[_0xac56('0x46')]=function(_0x40c512,_0x5a132e){return db[_0xac56('0x2d')][_0xac56('0x46')](_0x40c512[_0xac56('0x47')],{})[_0xac56('0x28')](function(_0x2023e7){var _0x3878bf=_0x40c512[_0xac56('0x48')][_0xac56('0x27')]({'plain':!![]});if(!_0x3878bf)throw new Error(_0xac56('0x49'));if(_0x3878bf[_0xac56('0x4a')]===_0xac56('0x48')){var _0x3ebfa5=_0x2023e7[_0xac56('0x27')]({'plain':!![]});var _0x50069a=_0xac56('0x4b');return db[_0xac56('0x4c')][_0xac56('0x45')]({'where':{'name':_0x50069a,'userProfileId':_0x3878bf['userProfileId']},'raw':!![]})['then'](function(_0xa4c4a8){if(_0xa4c4a8&&_0xa4c4a8[_0xac56('0x4d')]===0x0){return db[_0xac56('0x4e')][_0xac56('0x46')]({'name':_0x3ebfa5[_0xac56('0x2b')],'resourceId':_0x3ebfa5['id'],'type':_0xa4c4a8[_0xac56('0x2b')],'sectionId':_0xa4c4a8['id']},{})[_0xac56('0x28')](function(){return _0x2023e7;});}else{return _0x2023e7;}})[_0xac56('0x43')](function(_0x3d68f1){logger['error'](_0xac56('0x4f'),_0x3d68f1);throw _0x3d68f1;});}return _0x2023e7;})[_0xac56('0x28')](respondWithResult(_0x5a132e,0xc9))[_0xac56('0x43')](handleError(_0x5a132e,null));};exports[_0xac56('0x25')]=function(_0x2dfbb4,_0x543eca){if(_0x2dfbb4[_0xac56('0x47')]['id']){delete _0x2dfbb4[_0xac56('0x47')]['id'];}return db['AnalyticExtractedReport'][_0xac56('0x45')]({'where':{'id':_0x2dfbb4[_0xac56('0x44')]['id']}})[_0xac56('0x28')](handleEntityNotFound(_0x543eca,null))[_0xac56('0x28')](saveUpdates(_0x2dfbb4['body'],null))[_0xac56('0x28')](respondWithResult(_0x543eca,null))[_0xac56('0x43')](handleError(_0x543eca,null));};exports[_0xac56('0x26')]=function(_0x85c1bc,_0x3f4915){return db['AnalyticExtractedReport'][_0xac56('0x45')]({'where':{'id':_0x85c1bc['params']['id']}})['then'](handleEntityNotFound(_0x3f4915,null))[_0xac56('0x28')](removeEntity(_0x3f4915,null))[_0xac56('0x43')](handleError(_0x3f4915,null));};exports['download']=function(_0x4767bc,_0x2a19fd,_0x2fb057){return db[_0xac56('0x2d')]['find']({'where':{'id':_0x4767bc['params']['id']},'attributes':[_0xac56('0x2b'),'basename',_0xac56('0x50'),_0xac56('0x51')],'raw':!![]})[_0xac56('0x28')](handleEntityNotFound(_0x2a19fd,null))[_0xac56('0x28')](function(_0x519ca1){if(_0x519ca1){if(!fs[_0xac56('0x52')](path[_0xac56('0x53')](config[_0xac56('0x54')],_0xac56('0x55'),_0x519ca1[_0xac56('0x50')]))){throw new db[(_0xac56('0x56'))][(_0xac56('0x57'))](_0xac56('0x58'));}if(_0x4767bc['query'][_0xac56('0x59')]){return _0x2a19fd[_0xac56('0x18')](0xc8);}return _0x2a19fd[_0xac56('0x5a')](path[_0xac56('0x53')](config[_0xac56('0x54')],'server/files/reports',_0x519ca1[_0xac56('0x50')]),util['format'](_0xac56('0x5b'),_0x519ca1[_0xac56('0x5c')]||_0x519ca1[_0xac56('0x2b')],_0x519ca1[_0xac56('0x51')][_0xac56('0x5d')]()));}})['catch'](handleError(_0x2a19fd,null));};
\ No newline at end of file
+var _0xdaec=['request-promise','bluebird','path','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','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','basename','existsSync','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x50381c,_0x39beef){var _0x1bc982=function(_0x51be44){while(--_0x51be44){_0x50381c['push'](_0x50381c['shift']());}};_0x1bc982(++_0x39beef);}(_0xdaec,0xc3));var _0xcdae=function(_0x85e755,_0x4e8e31){_0x85e755=_0x85e755-0x0;var _0x473efc=_0xdaec[_0x85e755];return _0x473efc;};'use strict';var emlformat=require(_0xcdae('0x0'));var rimraf=require(_0xcdae('0x1'));var zipdir=require(_0xcdae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcdae('0x3'));var moment=require('moment');var BPromise=require(_0xcdae('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcdae('0x5'));var sox=require('sox');var csv=require(_0xcdae('0x6'));var ejs=require(_0xcdae('0x7'));var fs=require('fs');var fs_extra=require(_0xcdae('0x8'));var _=require(_0xcdae('0x9'));var squel=require(_0xcdae('0xa'));var crypto=require(_0xcdae('0xb'));var jsforce=require(_0xcdae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcdae('0x6'));var querystring=require(_0xcdae('0xd'));var Papa=require(_0xcdae('0xe'));var Redis=require(_0xcdae('0xf'));var authService=require(_0xcdae('0x10'));var qs=require(_0xcdae('0x11'));var as=require(_0xcdae('0x12'));var hardwareService=require(_0xcdae('0x13'));var logger=require(_0xcdae('0x14'))(_0xcdae('0x15'));var utils=require(_0xcdae('0x16'));var config=require(_0xcdae('0x17'));var licenseUtil=require(_0xcdae('0x18'));var db=require(_0xcdae('0x19'))['db'];function respondWithStatusCode(_0x326f11,_0xe36c0){_0xe36c0=_0xe36c0||0xcc;return function(_0x48c899){if(_0x48c899){return _0x326f11[_0xcdae('0x1a')](_0xe36c0);}return _0x326f11[_0xcdae('0x1b')](_0xe36c0)[_0xcdae('0x1c')]();};}function respondWithResult(_0x27191d,_0x388115){_0x388115=_0x388115||0xc8;return function(_0x4063ff){if(_0x4063ff){return _0x27191d[_0xcdae('0x1b')](_0x388115)[_0xcdae('0x1d')](_0x4063ff);}};}function respondWithFilteredResult(_0x40dc86,_0x9bf796){return function(_0x56712c){if(_0x56712c){var _0x153df9=typeof _0x9bf796[_0xcdae('0x1e')]===_0xcdae('0x1f')&&typeof _0x9bf796[_0xcdae('0x20')]===_0xcdae('0x1f');var _0x351ed4=_0x56712c['count'];var _0x333120=_0x153df9?0x0:_0x9bf796[_0xcdae('0x1e')];var _0x118558=_0x153df9?_0x56712c[_0xcdae('0x21')]:_0x9bf796[_0xcdae('0x1e')]+_0x9bf796[_0xcdae('0x20')];var _0x4c759f;if(_0x118558>=_0x351ed4){_0x118558=_0x351ed4;_0x4c759f=0xc8;}else{_0x4c759f=0xce;}_0x40dc86[_0xcdae('0x1b')](_0x4c759f);return _0x40dc86[_0xcdae('0x22')](_0xcdae('0x23'),_0x333120+'-'+_0x118558+'/'+_0x351ed4)[_0xcdae('0x1d')](_0x56712c);}return null;};}function patchUpdates(_0x2c2399){return function(_0x38c587){try{jsonpatch['apply'](_0x38c587,_0x2c2399,!![]);}catch(_0x3743df){return BPromise['reject'](_0x3743df);}return _0x38c587[_0xcdae('0x24')]();};}function saveUpdates(_0x590f18,_0x8c35b2){return function(_0x5726da){if(_0x5726da){return _0x5726da[_0xcdae('0x25')](_0x590f18)[_0xcdae('0x26')](function(_0x5c7e19){return _0x5c7e19;});}return null;};}function removeEntity(_0x2860e8,_0x36591d){return function(_0x2aeffc){if(_0x2aeffc){return _0x2aeffc[_0xcdae('0x27')]()[_0xcdae('0x26')](function(){var _0x249302=_0x2aeffc[_0xcdae('0x28')]({'plain':!![]});var _0x287a1c=_0xcdae('0x29');return db['UserProfileResource'][_0xcdae('0x27')]({'where':{'type':_0x287a1c,'resourceId':_0x249302['id']}})[_0xcdae('0x26')](function(){return _0x2aeffc;});})[_0xcdae('0x26')](function(){_0x2860e8[_0xcdae('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20103c,_0x39eda3){return function(_0x489df9){if(!_0x489df9){_0x20103c[_0xcdae('0x1a')](0x194);}return _0x489df9;};}function handleError(_0x837466,_0x46514b){_0x46514b=_0x46514b||0x1f4;return function(_0x1d7a94){logger['error'](_0x1d7a94[_0xcdae('0x2a')]);if(_0x1d7a94['name']){delete _0x1d7a94[_0xcdae('0x2b')];}_0x837466[_0xcdae('0x1b')](_0x46514b)[_0xcdae('0x2c')](_0x1d7a94);};}exports[_0xcdae('0x2d')]=function(_0x455923,_0x1e325a){var _0x1e6026={},_0x29701f={},_0x250236={'count':0x0,'rows':[]};var _0x4e0057=_[_0xcdae('0x2e')](db[_0xcdae('0x2f')]['rawAttributes'],function(_0x9b8833){return{'name':_0x9b8833[_0xcdae('0x30')],'type':_0x9b8833[_0xcdae('0x31')][_0xcdae('0x32')]};});_0x29701f[_0xcdae('0x33')]=_['map'](_0x4e0057,_0xcdae('0x2b'));_0x29701f[_0xcdae('0x34')]=_[_0xcdae('0x35')](_0x455923[_0xcdae('0x34')]);_0x29701f[_0xcdae('0x36')]=_['intersection'](_0x29701f[_0xcdae('0x33')],_0x29701f['query']);_0x1e6026[_0xcdae('0x37')]=_[_0xcdae('0x38')](_0x29701f['model'],qs[_0xcdae('0x39')](_0x455923['query'][_0xcdae('0x39')]));_0x1e6026[_0xcdae('0x37')]=_0x1e6026[_0xcdae('0x37')]['length']?_0x1e6026[_0xcdae('0x37')]:_0x29701f[_0xcdae('0x33')];if(!_0x455923[_0xcdae('0x34')]['hasOwnProperty'](_0xcdae('0x3a'))){_0x1e6026[_0xcdae('0x20')]=qs['limit'](_0x455923[_0xcdae('0x34')][_0xcdae('0x20')]);_0x1e6026[_0xcdae('0x1e')]=qs[_0xcdae('0x1e')](_0x455923[_0xcdae('0x34')][_0xcdae('0x1e')]);}_0x1e6026[_0xcdae('0x3b')]=qs[_0xcdae('0x3c')](_0x455923[_0xcdae('0x34')][_0xcdae('0x3c')]);_0x1e6026[_0xcdae('0x3d')]=qs['filters'](_[_0xcdae('0x3e')](_0x455923['query'],_0x29701f[_0xcdae('0x36')]),_0x4e0057);if(_0x455923['query']['filter']){_0x1e6026[_0xcdae('0x3d')]=_['merge'](_0x1e6026[_0xcdae('0x3d')],{'$or':_['map'](_0x4e0057,function(_0x4982c8){if(_0x4982c8[_0xcdae('0x31')]!=='VIRTUAL'){var _0x5292f8={};_0x5292f8[_0x4982c8[_0xcdae('0x2b')]]={'$like':'%'+_0x455923[_0xcdae('0x34')]['filter']+'%'};return _0x5292f8;}})});}_0x1e6026=_[_0xcdae('0x3f')]({},_0x1e6026,_0x455923[_0xcdae('0x40')]);var _0x3a327c={'where':_0x1e6026[_0xcdae('0x3d')]};return db[_0xcdae('0x2f')]['count'](_0x3a327c)[_0xcdae('0x26')](function(_0x298753){_0x250236['count']=_0x298753;if(_0x455923[_0xcdae('0x34')][_0xcdae('0x41')]){_0x1e6026[_0xcdae('0x42')]=[{'all':!![]}];}return db[_0xcdae('0x2f')][_0xcdae('0x43')](_0x1e6026);})[_0xcdae('0x26')](function(_0x36b2ac){_0x250236[_0xcdae('0x44')]=_0x36b2ac;return _0x250236;})[_0xcdae('0x26')](respondWithFilteredResult(_0x1e325a,_0x1e6026))[_0xcdae('0x45')](handleError(_0x1e325a,null));};exports['show']=function(_0x5f0e43,_0x5f2642){var _0x22665c={'raw':!![],'where':{'id':_0x5f0e43[_0xcdae('0x46')]['id']}},_0x2b0a91={};_0x2b0a91[_0xcdae('0x33')]=_[_0xcdae('0x35')](db['AnalyticExtractedReport'][_0xcdae('0x47')]);_0x2b0a91[_0xcdae('0x34')]=_[_0xcdae('0x35')](_0x5f0e43[_0xcdae('0x34')]);_0x2b0a91[_0xcdae('0x36')]=_['intersection'](_0x2b0a91[_0xcdae('0x33')],_0x2b0a91['query']);_0x22665c[_0xcdae('0x37')]=_[_0xcdae('0x38')](_0x2b0a91[_0xcdae('0x33')],qs[_0xcdae('0x39')](_0x5f0e43[_0xcdae('0x34')]['fields']));_0x22665c['attributes']=_0x22665c[_0xcdae('0x37')][_0xcdae('0x48')]?_0x22665c[_0xcdae('0x37')]:_0x2b0a91[_0xcdae('0x33')];if(_0x5f0e43[_0xcdae('0x34')][_0xcdae('0x41')]){_0x22665c['include']=[{'all':!![]}];}_0x22665c=_[_0xcdae('0x3f')]({},_0x22665c,_0x5f0e43[_0xcdae('0x40')]);return db[_0xcdae('0x2f')]['find'](_0x22665c)[_0xcdae('0x26')](handleEntityNotFound(_0x5f2642,null))[_0xcdae('0x26')](respondWithResult(_0x5f2642,null))[_0xcdae('0x45')](handleError(_0x5f2642,null));};exports['create']=function(_0x4ec14a,_0x122048){return db[_0xcdae('0x2f')]['create'](_0x4ec14a[_0xcdae('0x49')],{})[_0xcdae('0x26')](function(_0x41e60e){var _0x2196f2=_0x4ec14a['user'][_0xcdae('0x28')]({'plain':!![]});if(!_0x2196f2)throw new Error(_0xcdae('0x4a'));if(_0x2196f2[_0xcdae('0x4b')]===_0xcdae('0x4c')){var _0x901576=_0x41e60e[_0xcdae('0x28')]({'plain':!![]});var _0x2fd00a='ExtractedReports';return db[_0xcdae('0x4d')]['find']({'where':{'name':_0x2fd00a,'userProfileId':_0x2196f2[_0xcdae('0x4e')]},'raw':!![]})[_0xcdae('0x26')](function(_0x5360a4){if(_0x5360a4&&_0x5360a4[_0xcdae('0x4f')]===0x0){return db[_0xcdae('0x50')][_0xcdae('0x51')]({'name':_0x901576['name'],'resourceId':_0x901576['id'],'type':_0x5360a4[_0xcdae('0x2b')],'sectionId':_0x5360a4['id']},{})[_0xcdae('0x26')](function(){return _0x41e60e;});}else{return _0x41e60e;}})[_0xcdae('0x45')](function(_0x441366){logger[_0xcdae('0x52')](_0xcdae('0x53'),_0x441366);throw _0x441366;});}return _0x41e60e;})[_0xcdae('0x26')](respondWithResult(_0x122048,0xc9))['catch'](handleError(_0x122048,null));};exports[_0xcdae('0x25')]=function(_0x142d02,_0x50532c){if(_0x142d02[_0xcdae('0x49')]['id']){delete _0x142d02['body']['id'];}return db[_0xcdae('0x2f')][_0xcdae('0x54')]({'where':{'id':_0x142d02[_0xcdae('0x46')]['id']}})[_0xcdae('0x26')](handleEntityNotFound(_0x50532c,null))['then'](saveUpdates(_0x142d02[_0xcdae('0x49')],null))[_0xcdae('0x26')](respondWithResult(_0x50532c,null))[_0xcdae('0x45')](handleError(_0x50532c,null));};exports['destroy']=function(_0x56f390,_0x595067){return db[_0xcdae('0x2f')][_0xcdae('0x54')]({'where':{'id':_0x56f390[_0xcdae('0x46')]['id']}})[_0xcdae('0x26')](handleEntityNotFound(_0x595067,null))[_0xcdae('0x26')](removeEntity(_0x595067,null))[_0xcdae('0x45')](handleError(_0x595067,null));};exports['download']=function(_0x17b875,_0x1817f2,_0x350cb7){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x17b875[_0xcdae('0x46')]['id']},'attributes':[_0xcdae('0x2b'),_0xcdae('0x55'),'savename','output'],'raw':!![]})[_0xcdae('0x26')](handleEntityNotFound(_0x1817f2,null))[_0xcdae('0x26')](function(_0x4fd10a){if(_0x4fd10a){if(!fs[_0xcdae('0x56')](path['join'](config[_0xcdae('0x57')],_0xcdae('0x58'),_0x4fd10a[_0xcdae('0x59')]))){throw new db[(_0xcdae('0x5a'))][(_0xcdae('0x5b'))](_0xcdae('0x5c'));}if(_0x17b875[_0xcdae('0x34')][_0xcdae('0x5d')]){return _0x1817f2[_0xcdae('0x1a')](0xc8);}return _0x1817f2[_0xcdae('0x5e')](path[_0xcdae('0x5f')](config[_0xcdae('0x57')],_0xcdae('0x58'),_0x4fd10a['savename']),util[_0xcdae('0x60')](_0xcdae('0x61'),_0x4fd10a[_0xcdae('0x55')]||_0x4fd10a[_0xcdae('0x2b')],_0x4fd10a['output'][_0xcdae('0x62')]()));}})[_0xcdae('0x45')](handleError(_0x1817f2,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 23d53d8..6d8f93c 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 _0x2885=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x103072,_0x1251a4){var _0x329c7e=function(_0x17e85c){while(--_0x17e85c){_0x103072['push'](_0x103072['shift']());}};_0x329c7e(++_0x1251a4);}(_0x2885,0x182));var _0x5288=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x2885[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x5288('0x0'));var util=require(_0x5288('0x1'));var logger=require('../../config/logger')(_0x5288('0x2'));var moment=require(_0x5288('0x3'));var BPromise=require(_0x5288('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5288('0x5'));var rimraf=require('rimraf');var config=require(_0x5288('0x6'));var attributes=require(_0x5288('0x7'));module[_0x5288('0x8')]=function(_0x953bc3,_0xf8094d){return _0x953bc3[_0x5288('0x9')](_0x5288('0xa'),attributes,{'tableName':_0x5288('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf314=['./analyticExtractedReport.attributes','define','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x86932b,_0xa8fa5c){var _0x12dcaf=function(_0xd378d3){while(--_0xd378d3){_0x86932b['push'](_0x86932b['shift']());}};_0x12dcaf(++_0xa8fa5c);}(_0xf314,0x92));var _0x4f31=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xf314[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x4f31('0x0'));var util=require(_0x4f31('0x1'));var logger=require(_0x4f31('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4f31('0x3'));var rp=require(_0x4f31('0x4'));var fs=require('fs');var path=require(_0x4f31('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f31('0x6'));module['exports']=function(_0x3ae6f2,_0x532879){return _0x3ae6f2[_0x4f31('0x7')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index bf88cdf..15b0280 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 _0xe764=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe764,0x90));var _0x4e76=function(_0x4801a0,_0x252c24){_0x4801a0=_0x4801a0-0x0;var _0x338e26=_0xe764[_0x4801a0];return _0x338e26;};'use strict';var _=require(_0x4e76('0x0'));var util=require(_0x4e76('0x1'));var moment=require(_0x4e76('0x2'));var BPromise=require(_0x4e76('0x3'));var rs=require(_0x4e76('0x4'));var fs=require('fs');var Redis=require(_0x4e76('0x5'));var db=require(_0x4e76('0x6'))['db'];var utils=require(_0x4e76('0x7'));var logger=require(_0x4e76('0x8'))(_0x4e76('0x9'));var config=require(_0x4e76('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4e76('0xb')][_0x4e76('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ed0e3,_0x2656b7,_0x5d0837){return new BPromise(function(_0x3d7eb2,_0x26a3da){return client[_0x4e76('0xd')](_0x2ed0e3,_0x5d0837)[_0x4e76('0xe')](function(_0x1a1c93){logger[_0x4e76('0xf')](_0x4e76('0x10'),_0x2656b7,'request\x20sent');logger[_0x4e76('0x11')](_0x4e76('0x12'),_0x2656b7,_0x4e76('0x13'),JSON[_0x4e76('0x14')](_0x1a1c93));if(_0x1a1c93[_0x4e76('0x15')]){if(_0x1a1c93['error'][_0x4e76('0x16')]===0x1f4){logger[_0x4e76('0x15')](_0x4e76('0x10'),_0x2656b7,_0x1a1c93[_0x4e76('0x15')][_0x4e76('0x17')]);return _0x26a3da(_0x1a1c93['error'][_0x4e76('0x17')]);}logger[_0x4e76('0x15')](_0x4e76('0x10'),_0x2656b7,_0x1a1c93[_0x4e76('0x15')]['message']);return _0x3d7eb2(_0x1a1c93[_0x4e76('0x15')][_0x4e76('0x17')]);}else{logger[_0x4e76('0xf')](_0x4e76('0x10'),_0x2656b7,_0x4e76('0x13'));_0x3d7eb2(_0x1a1c93['result'][_0x4e76('0x17')]);}})[_0x4e76('0x18')](function(_0x5ab9c4){logger[_0x4e76('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2656b7,_0x5ab9c4);_0x26a3da(_0x5ab9c4);});});}
\ No newline at end of file
+var _0x0444=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1142fb,_0x59acf3){var _0x590d0f=function(_0x56b8e8){while(--_0x56b8e8){_0x1142fb['push'](_0x1142fb['shift']());}};_0x590d0f(++_0x59acf3);}(_0x0444,0xbd));var _0x4044=function(_0x3cc2ee,_0x3ab210){_0x3cc2ee=_0x3cc2ee-0x0;var _0x3262c6=_0x0444[_0x3cc2ee];return _0x3262c6;};'use strict';var _=require(_0x4044('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4044('0x1'));var rs=require(_0x4044('0x2'));var fs=require('fs');var Redis=require(_0x4044('0x3'));var db=require(_0x4044('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4044('0x5'))(_0x4044('0x6'));var config=require(_0x4044('0x7'));var jayson=require(_0x4044('0x8'));var client=jayson[_0x4044('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31c11f,_0x590b6f,_0x3e9f69){return new BPromise(function(_0x15704a,_0x363a5d){return client[_0x4044('0xa')](_0x31c11f,_0x3e9f69)[_0x4044('0xb')](function(_0x2880e2){logger[_0x4044('0xc')](_0x4044('0xd'),_0x590b6f,_0x4044('0xe'));logger[_0x4044('0xf')](_0x4044('0x10'),_0x590b6f,_0x4044('0xe'),JSON[_0x4044('0x11')](_0x2880e2));if(_0x2880e2[_0x4044('0x12')]){if(_0x2880e2[_0x4044('0x12')][_0x4044('0x13')]===0x1f4){logger['error'](_0x4044('0xd'),_0x590b6f,_0x2880e2['error']['message']);return _0x363a5d(_0x2880e2['error'][_0x4044('0x14')]);}logger['error'](_0x4044('0xd'),_0x590b6f,_0x2880e2[_0x4044('0x12')][_0x4044('0x14')]);return _0x15704a(_0x2880e2['error'][_0x4044('0x14')]);}else{logger['info'](_0x4044('0xd'),_0x590b6f,'request\x20sent');_0x15704a(_0x2880e2[_0x4044('0x15')][_0x4044('0x14')]);}})[_0x4044('0x16')](function(_0x2b7824){logger[_0x4044('0x12')](_0x4044('0xd'),_0x590b6f,_0x2b7824);_0x363a5d(_0x2b7824);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index cf9f8ca..54d3237 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 _0xe929=['update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xe929,0x93));var _0x9e92=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0xe929[_0x4ba380];return _0x4b111b;};'use strict';var multer=require(_0x9e92('0x0'));var util=require(_0x9e92('0x1'));var path=require('path');var timeout=require(_0x9e92('0x2'));var express=require(_0x9e92('0x3'));var router=express['Router']();var fs_extra=require(_0x9e92('0x4'));var auth=require(_0x9e92('0x5'));var interaction=require(_0x9e92('0x6'));var config=require('../../config/environment');var controller=require(_0x9e92('0x7'));router[_0x9e92('0x8')]('/',auth[_0x9e92('0x9')](),controller[_0x9e92('0xa')]);router[_0x9e92('0x8')](_0x9e92('0xb'),auth[_0x9e92('0x9')](),controller[_0x9e92('0xc')]);router[_0x9e92('0x8')]('/:id/download',auth[_0x9e92('0x9')](),controller['download']);router[_0x9e92('0xd')]('/',auth['isAuthenticated'](),controller[_0x9e92('0xe')]);router['put'](_0x9e92('0xb'),auth[_0x9e92('0x9')](),controller[_0x9e92('0xf')]);router[_0x9e92('0x10')](_0x9e92('0xb'),auth[_0x9e92('0x9')](),controller[_0x9e92('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xd267=['/:id','show','/:id/download','download','create','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xd267,0x1b8));var _0x7d26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd267[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x7d26('0x0'));var path=require('path');var timeout=require(_0x7d26('0x1'));var express=require('express');var router=express[_0x7d26('0x2')]();var fs_extra=require(_0x7d26('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7d26('0x4'));var config=require(_0x7d26('0x5'));var controller=require(_0x7d26('0x6'));router[_0x7d26('0x7')]('/',auth[_0x7d26('0x8')](),controller[_0x7d26('0x9')]);router[_0x7d26('0x7')](_0x7d26('0xa'),auth[_0x7d26('0x8')](),controller[_0x7d26('0xb')]);router['get'](_0x7d26('0xc'),auth[_0x7d26('0x8')](),controller[_0x7d26('0xd')]);router['post']('/',auth[_0x7d26('0x8')](),controller[_0x7d26('0xe')]);router['put']('/:id',auth[_0x7d26('0x8')](),controller[_0x7d26('0xf')]);router[_0x7d26('0x10')]('/:id',auth[_0x7d26('0x8')](),controller['destroy']);module[_0x7d26('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index a4b2376..a395375 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 _0x2059=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x2059,0x7c));var _0x9205=function(_0x44454f,_0x4bfbe8){_0x44454f=_0x44454f-0x0;var _0x475150=_0x2059[_0x44454f];return _0x475150;};'use strict';var Sequelize=require(_0x9205('0x0'));module['exports']={'field':{'type':Sequelize[_0x9205('0x1')]},'alias':{'type':Sequelize[_0x9205('0x2')]},'function':{'type':Sequelize[_0x9205('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x9205('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x9205('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3292=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x45f859,_0x3cbda5){var _0x2410e7=function(_0x3fc569){while(--_0x3fc569){_0x45f859['push'](_0x45f859['shift']());}};_0x2410e7(++_0x3cbda5);}(_0x3292,0xcf));var _0x2329=function(_0x2c1684,_0x3d7540){_0x2c1684=_0x2c1684-0x0;var _0x5cd07a=_0x3292[_0x2c1684];return _0x5cd07a;};'use strict';var Sequelize=require(_0x2329('0x0'));module[_0x2329('0x1')]={'field':{'type':Sequelize[_0x2329('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x2329('0x3')]},'groupBy':{'type':Sequelize[_0x2329('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2329('0x3')]},'custom':{'type':Sequelize[_0x2329('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 8bf89fd..f430cb5 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 _0x7079=['includeAll','findAll','rows','catch','params','include','merge','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','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','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','then'];(function(_0x465c8d,_0x308d2e){var _0x3e64a8=function(_0x4ded4e){while(--_0x4ded4e){_0x465c8d['push'](_0x465c8d['shift']());}};_0x3e64a8(++_0x308d2e);}(_0x7079,0x68));var _0x9707=function(_0x3b145d,_0x3a2aba){_0x3b145d=_0x3b145d-0x0;var _0x320f0a=_0x7079[_0x3b145d];return _0x320f0a;};'use strict';var emlformat=require(_0x9707('0x0'));var rimraf=require(_0x9707('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9707('0x2'));var rp=require(_0x9707('0x3'));var moment=require('moment');var BPromise=require(_0x9707('0x4'));var Mustache=require(_0x9707('0x5'));var util=require(_0x9707('0x6'));var path=require('path');var sox=require(_0x9707('0x7'));var csv=require(_0x9707('0x8'));var ejs=require(_0x9707('0x9'));var fs=require('fs');var fs_extra=require(_0x9707('0xa'));var _=require(_0x9707('0xb'));var squel=require(_0x9707('0xc'));var crypto=require(_0x9707('0xd'));var jsforce=require(_0x9707('0xe'));var deskjs=require(_0x9707('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9707('0x10'));var Redis=require(_0x9707('0x11'));var authService=require(_0x9707('0x12'));var qs=require(_0x9707('0x13'));var as=require(_0x9707('0x14'));var hardwareService=require(_0x9707('0x15'));var logger=require(_0x9707('0x16'))('api');var utils=require(_0x9707('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9707('0x18'));var db=require(_0x9707('0x19'))['db'];function respondWithStatusCode(_0x3364b8,_0x29fde8){_0x29fde8=_0x29fde8||0xcc;return function(_0x3a845a){if(_0x3a845a){return _0x3364b8['sendStatus'](_0x29fde8);}return _0x3364b8[_0x9707('0x1a')](_0x29fde8)['end']();};}function respondWithResult(_0x3b2de1,_0x191cbe){_0x191cbe=_0x191cbe||0xc8;return function(_0x3557bd){if(_0x3557bd){return _0x3b2de1['status'](_0x191cbe)[_0x9707('0x1b')](_0x3557bd);}};}function respondWithFilteredResult(_0x48652a,_0x2f94f8){return function(_0x44c3e7){if(_0x44c3e7){var _0x279662=typeof _0x2f94f8['offset']===_0x9707('0x1c')&&typeof _0x2f94f8[_0x9707('0x1d')]==='undefined';var _0x4e6e85=_0x44c3e7[_0x9707('0x1e')];var _0x4084eb=_0x279662?0x0:_0x2f94f8[_0x9707('0x1f')];var _0x3be78c=_0x279662?_0x44c3e7['count']:_0x2f94f8['offset']+_0x2f94f8[_0x9707('0x1d')];var _0xfe46a7;if(_0x3be78c>=_0x4e6e85){_0x3be78c=_0x4e6e85;_0xfe46a7=0xc8;}else{_0xfe46a7=0xce;}_0x48652a[_0x9707('0x1a')](_0xfe46a7);return _0x48652a[_0x9707('0x20')](_0x9707('0x21'),_0x4084eb+'-'+_0x3be78c+'/'+_0x4e6e85)[_0x9707('0x1b')](_0x44c3e7);}return null;};}function patchUpdates(_0x13b413){return function(_0x14d2b6){try{jsonpatch[_0x9707('0x22')](_0x14d2b6,_0x13b413,!![]);}catch(_0x4c2ec4){return BPromise[_0x9707('0x23')](_0x4c2ec4);}return _0x14d2b6[_0x9707('0x24')]();};}function saveUpdates(_0x4fcf1b,_0x5a3081){return function(_0x1c5ee8){if(_0x1c5ee8){return _0x1c5ee8[_0x9707('0x25')](_0x4fcf1b)['then'](function(_0x52c4b1){return _0x52c4b1;});}return null;};}function removeEntity(_0x57ac1c,_0x1f1e00){return function(_0x434b48){if(_0x434b48){return _0x434b48[_0x9707('0x26')]()['then'](function(){_0x57ac1c['status'](0xcc)[_0x9707('0x27')]();});}};}function handleEntityNotFound(_0x2f4671,_0x3bf90c){return function(_0x3f7428){if(!_0x3f7428){_0x2f4671[_0x9707('0x28')](0x194);}return _0x3f7428;};}function handleError(_0x27ea0e,_0x182540){_0x182540=_0x182540||0x1f4;return function(_0x382ad5){logger[_0x9707('0x29')](_0x382ad5[_0x9707('0x2a')]);if(_0x382ad5[_0x9707('0x2b')]){delete _0x382ad5[_0x9707('0x2b')];}_0x27ea0e[_0x9707('0x1a')](_0x182540)[_0x9707('0x2c')](_0x382ad5);};}exports[_0x9707('0x2d')]=function(_0xff5a53,_0xa12368){var _0x2487e4={},_0x19accd={},_0x15dc75={'count':0x0,'rows':[]};var _0x58fdb1=_[_0x9707('0x2e')](db[_0x9707('0x2f')][_0x9707('0x30')],function(_0x20d27a){return{'name':_0x20d27a[_0x9707('0x31')],'type':_0x20d27a[_0x9707('0x32')][_0x9707('0x33')]};});_0x19accd[_0x9707('0x34')]=_[_0x9707('0x2e')](_0x58fdb1,_0x9707('0x2b'));_0x19accd[_0x9707('0x35')]=_[_0x9707('0x36')](_0xff5a53['query']);_0x19accd['filters']=_[_0x9707('0x37')](_0x19accd['model'],_0x19accd[_0x9707('0x35')]);_0x2487e4[_0x9707('0x38')]=_[_0x9707('0x37')](_0x19accd[_0x9707('0x34')],qs['fields'](_0xff5a53[_0x9707('0x35')][_0x9707('0x39')]));_0x2487e4[_0x9707('0x38')]=_0x2487e4['attributes'][_0x9707('0x3a')]?_0x2487e4[_0x9707('0x38')]:_0x19accd[_0x9707('0x34')];if(!_0xff5a53[_0x9707('0x35')][_0x9707('0x3b')](_0x9707('0x3c'))){_0x2487e4['limit']=qs[_0x9707('0x1d')](_0xff5a53[_0x9707('0x35')][_0x9707('0x1d')]);_0x2487e4['offset']=qs[_0x9707('0x1f')](_0xff5a53[_0x9707('0x35')][_0x9707('0x1f')]);}_0x2487e4[_0x9707('0x3d')]=qs[_0x9707('0x3e')](_0xff5a53[_0x9707('0x35')][_0x9707('0x3e')]);_0x2487e4[_0x9707('0x3f')]=qs[_0x9707('0x40')](_[_0x9707('0x41')](_0xff5a53[_0x9707('0x35')],_0x19accd['filters']),_0x58fdb1);if(_0xff5a53[_0x9707('0x35')][_0x9707('0x42')]){_0x2487e4[_0x9707('0x3f')]=_['merge'](_0x2487e4[_0x9707('0x3f')],{'$or':_[_0x9707('0x2e')](_0x58fdb1,function(_0x557b51){if(_0x557b51['type']!==_0x9707('0x43')){var _0x2e052e={};_0x2e052e[_0x557b51['name']]={'$like':'%'+_0xff5a53[_0x9707('0x35')][_0x9707('0x42')]+'%'};return _0x2e052e;}})});}_0x2487e4=_['merge']({},_0x2487e4,_0xff5a53[_0x9707('0x44')]);var _0x3416f0={'where':_0x2487e4[_0x9707('0x3f')]};return db[_0x9707('0x2f')][_0x9707('0x1e')](_0x3416f0)[_0x9707('0x45')](function(_0x44f8e6){_0x15dc75[_0x9707('0x1e')]=_0x44f8e6;if(_0xff5a53[_0x9707('0x35')][_0x9707('0x46')]){_0x2487e4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9707('0x47')](_0x2487e4);})[_0x9707('0x45')](function(_0x106149){_0x15dc75[_0x9707('0x48')]=_0x106149;return _0x15dc75;})[_0x9707('0x45')](respondWithFilteredResult(_0xa12368,_0x2487e4))[_0x9707('0x49')](handleError(_0xa12368,null));};exports['show']=function(_0x14c59a,_0x488bcb){var _0x315762={'raw':![],'where':{'id':_0x14c59a[_0x9707('0x4a')]['id']}},_0x515801={};_0x515801[_0x9707('0x34')]=_[_0x9707('0x36')](db[_0x9707('0x2f')]['rawAttributes']);_0x515801[_0x9707('0x35')]=_[_0x9707('0x36')](_0x14c59a['query']);_0x515801[_0x9707('0x40')]=_[_0x9707('0x37')](_0x515801[_0x9707('0x34')],_0x515801['query']);_0x315762[_0x9707('0x38')]=_[_0x9707('0x37')](_0x515801[_0x9707('0x34')],qs[_0x9707('0x39')](_0x14c59a[_0x9707('0x35')][_0x9707('0x39')]));_0x315762[_0x9707('0x38')]=_0x315762['attributes'][_0x9707('0x3a')]?_0x315762[_0x9707('0x38')]:_0x515801[_0x9707('0x34')];if(_0x14c59a[_0x9707('0x35')]['includeAll']){_0x315762[_0x9707('0x4b')]=[{'all':!![]}];}_0x315762=_[_0x9707('0x4c')]({},_0x315762,_0x14c59a[_0x9707('0x44')]);return db[_0x9707('0x2f')][_0x9707('0x4d')](_0x315762)[_0x9707('0x45')](handleEntityNotFound(_0x488bcb,null))['then'](respondWithResult(_0x488bcb,null))[_0x9707('0x49')](handleError(_0x488bcb,null));};exports['create']=function(_0x18dfda,_0x12e475){return db['AnalyticFieldReport'][_0x9707('0x4e')](_0x18dfda[_0x9707('0x4f')],{})[_0x9707('0x45')](respondWithResult(_0x12e475,0xc9))[_0x9707('0x49')](handleError(_0x12e475,null));};exports[_0x9707('0x50')]=function(_0x1d3ff9,_0x1e6f7a){return db[_0x9707('0x2f')]['bulkCreate'](_0x1d3ff9['body'],{'raw':![],'individualHooks':!![]})[_0x9707('0x45')](respondWithResult(_0x1e6f7a,0xc9))['catch'](handleError(_0x1e6f7a,null));};exports['update']=function(_0x2e2806,_0x1dddf2){if(_0x2e2806[_0x9707('0x4f')]['id']){delete _0x2e2806[_0x9707('0x4f')]['id'];}return db[_0x9707('0x2f')][_0x9707('0x4d')]({'where':{'id':_0x2e2806[_0x9707('0x4a')]['id']}})[_0x9707('0x45')](handleEntityNotFound(_0x1dddf2,null))[_0x9707('0x45')](saveUpdates(_0x2e2806[_0x9707('0x4f')],null))[_0x9707('0x45')](respondWithResult(_0x1dddf2,null))[_0x9707('0x49')](handleError(_0x1dddf2,null));};exports[_0x9707('0x26')]=function(_0x5a7c4d,_0x2ac133){return db['AnalyticFieldReport'][_0x9707('0x4d')]({'where':{'id':_0x5a7c4d[_0x9707('0x4a')]['id']}})[_0x9707('0x45')](handleEntityNotFound(_0x2ac133,null))[_0x9707('0x45')](removeEntity(_0x2ac133,null))[_0x9707('0x49')](handleError(_0x2ac133,null));};exports['bulkDestroy']=function(_0x42872c,_0xcc1894){return db[_0x9707('0x2f')][_0x9707('0x26')]({'where':{'id':_0x42872c[_0x9707('0x35')][_0x9707('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0x9707('0x45')](respondWithResult(_0xcc1894,0xcc))[_0x9707('0x49')](handleError(_0xcc1894,null));};exports[_0x9707('0x52')]=function(_0x5b3be7,_0x1102c5,_0x357901){return db[_0x9707('0x53')][_0x9707('0x54')]({'where':{'id':_0x5b3be7[_0x9707('0x4a')]['id']}})[_0x9707('0x45')](handleEntityNotFound(_0x1102c5,null))[_0x9707('0x45')](function(_0x5770b9){if(_0x5770b9){return db['sequelize'][_0x9707('0x55')](function(_0x45b0a4){return db['AnalyticFieldReport'][_0x9707('0x26')]({'where':{'CustomReportId':_0x5b3be7['params']['id']},'transaction':_0x45b0a4})['then'](function(_0x2086a3){var _0x5645ce=_[_0x9707('0x2e')](_0x5b3be7[_0x9707('0x4f')],function(_0x2ff46b){delete _0x2ff46b['id'];_0x2ff46b[_0x9707('0x56')]=_0x5b3be7['params']['id'];return _0x2ff46b;});return db['AnalyticFieldReport'][_0x9707('0x50')](_0x5645ce,{'transaction':_0x45b0a4});});})['then'](function(){return db[_0x9707('0x2f')][_0x9707('0x47')]({'where':{'CustomReportId':_0x5b3be7[_0x9707('0x4a')]['id']}});});}})['then'](respondWithResult(_0x1102c5,null))['catch'](handleError(_0x1102c5,null));};
\ No newline at end of file
+var _0x9ac0=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','bulkCreate','find','bulkDestroy','ids','addFields','sequelize','transaction','CustomReportId','findAll','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1c5285,_0x4c7a94){var _0x5a93ab=function(_0x35f6cf){while(--_0x35f6cf){_0x1c5285['push'](_0x1c5285['shift']());}};_0x5a93ab(++_0x4c7a94);}(_0x9ac0,0x179));var _0x09ac=function(_0x561a58,_0x22f033){_0x561a58=_0x561a58-0x0;var _0x583036=_0x9ac0[_0x561a58];return _0x583036;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09ac('0x0'));var zipdir=require(_0x09ac('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09ac('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x09ac('0x3'));var util=require(_0x09ac('0x4'));var path=require(_0x09ac('0x5'));var sox=require(_0x09ac('0x6'));var csv=require('to-csv');var ejs=require(_0x09ac('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09ac('0x8'));var squel=require(_0x09ac('0x9'));var crypto=require(_0x09ac('0xa'));var jsforce=require(_0x09ac('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x09ac('0xc'));var querystring=require(_0x09ac('0xd'));var Papa=require(_0x09ac('0xe'));var Redis=require(_0x09ac('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x09ac('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x09ac('0x11'))(_0x09ac('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x09ac('0x13'));var db=require(_0x09ac('0x14'))['db'];function respondWithStatusCode(_0x224e6f,_0x2b08e7){_0x2b08e7=_0x2b08e7||0xcc;return function(_0x3f82d5){if(_0x3f82d5){return _0x224e6f[_0x09ac('0x15')](_0x2b08e7);}return _0x224e6f[_0x09ac('0x16')](_0x2b08e7)[_0x09ac('0x17')]();};}function respondWithResult(_0x442880,_0x32fcbb){_0x32fcbb=_0x32fcbb||0xc8;return function(_0x54acad){if(_0x54acad){return _0x442880['status'](_0x32fcbb)[_0x09ac('0x18')](_0x54acad);}};}function respondWithFilteredResult(_0x19d7be,_0x3b376b){return function(_0x1634c8){if(_0x1634c8){var _0x175adf=typeof _0x3b376b[_0x09ac('0x19')]===_0x09ac('0x1a')&&typeof _0x3b376b['limit']==='undefined';var _0x2daa95=_0x1634c8[_0x09ac('0x1b')];var _0x1eb278=_0x175adf?0x0:_0x3b376b[_0x09ac('0x19')];var _0xb41e74=_0x175adf?_0x1634c8[_0x09ac('0x1b')]:_0x3b376b[_0x09ac('0x19')]+_0x3b376b[_0x09ac('0x1c')];var _0x13a6ee;if(_0xb41e74>=_0x2daa95){_0xb41e74=_0x2daa95;_0x13a6ee=0xc8;}else{_0x13a6ee=0xce;}_0x19d7be[_0x09ac('0x16')](_0x13a6ee);return _0x19d7be[_0x09ac('0x1d')](_0x09ac('0x1e'),_0x1eb278+'-'+_0xb41e74+'/'+_0x2daa95)['json'](_0x1634c8);}return null;};}function patchUpdates(_0xcdde03){return function(_0xfa17cf){try{jsonpatch[_0x09ac('0x1f')](_0xfa17cf,_0xcdde03,!![]);}catch(_0x2fa440){return BPromise[_0x09ac('0x20')](_0x2fa440);}return _0xfa17cf[_0x09ac('0x21')]();};}function saveUpdates(_0x191246,_0x22dd26){return function(_0x1848d3){if(_0x1848d3){return _0x1848d3[_0x09ac('0x22')](_0x191246)[_0x09ac('0x23')](function(_0x19bdc8){return _0x19bdc8;});}return null;};}function removeEntity(_0x1e10f9,_0x11711d){return function(_0x39dc22){if(_0x39dc22){return _0x39dc22[_0x09ac('0x24')]()['then'](function(){_0x1e10f9[_0x09ac('0x16')](0xcc)[_0x09ac('0x17')]();});}};}function handleEntityNotFound(_0x2912ae,_0xb1529e){return function(_0x1cfe43){if(!_0x1cfe43){_0x2912ae[_0x09ac('0x15')](0x194);}return _0x1cfe43;};}function handleError(_0x1a815b,_0x4008c7){_0x4008c7=_0x4008c7||0x1f4;return function(_0x414dc0){logger[_0x09ac('0x25')](_0x414dc0[_0x09ac('0x26')]);if(_0x414dc0['name']){delete _0x414dc0[_0x09ac('0x27')];}_0x1a815b['status'](_0x4008c7)[_0x09ac('0x28')](_0x414dc0);};}exports[_0x09ac('0x29')]=function(_0x571b00,_0x429dcd){var _0x325e2d={},_0x36efe0={},_0x41ca09={'count':0x0,'rows':[]};var _0x525015=_['map'](db[_0x09ac('0x2a')][_0x09ac('0x2b')],function(_0xb475cb){return{'name':_0xb475cb['fieldName'],'type':_0xb475cb[_0x09ac('0x2c')][_0x09ac('0x2d')]};});_0x36efe0[_0x09ac('0x2e')]=_[_0x09ac('0x2f')](_0x525015,_0x09ac('0x27'));_0x36efe0[_0x09ac('0x30')]=_[_0x09ac('0x31')](_0x571b00[_0x09ac('0x30')]);_0x36efe0[_0x09ac('0x32')]=_[_0x09ac('0x33')](_0x36efe0[_0x09ac('0x2e')],_0x36efe0[_0x09ac('0x30')]);_0x325e2d[_0x09ac('0x34')]=_[_0x09ac('0x33')](_0x36efe0[_0x09ac('0x2e')],qs[_0x09ac('0x35')](_0x571b00[_0x09ac('0x30')][_0x09ac('0x35')]));_0x325e2d[_0x09ac('0x34')]=_0x325e2d[_0x09ac('0x34')][_0x09ac('0x36')]?_0x325e2d[_0x09ac('0x34')]:_0x36efe0[_0x09ac('0x2e')];if(!_0x571b00[_0x09ac('0x30')]['hasOwnProperty'](_0x09ac('0x37'))){_0x325e2d[_0x09ac('0x1c')]=qs[_0x09ac('0x1c')](_0x571b00[_0x09ac('0x30')]['limit']);_0x325e2d[_0x09ac('0x19')]=qs[_0x09ac('0x19')](_0x571b00[_0x09ac('0x30')][_0x09ac('0x19')]);}_0x325e2d[_0x09ac('0x38')]=qs[_0x09ac('0x39')](_0x571b00[_0x09ac('0x30')][_0x09ac('0x39')]);_0x325e2d[_0x09ac('0x3a')]=qs['filters'](_[_0x09ac('0x3b')](_0x571b00['query'],_0x36efe0[_0x09ac('0x32')]),_0x525015);if(_0x571b00[_0x09ac('0x30')][_0x09ac('0x3c')]){_0x325e2d[_0x09ac('0x3a')]=_[_0x09ac('0x3d')](_0x325e2d[_0x09ac('0x3a')],{'$or':_[_0x09ac('0x2f')](_0x525015,function(_0x53097c){if(_0x53097c['type']!==_0x09ac('0x3e')){var _0x3f28c3={};_0x3f28c3[_0x53097c[_0x09ac('0x27')]]={'$like':'%'+_0x571b00[_0x09ac('0x30')][_0x09ac('0x3c')]+'%'};return _0x3f28c3;}})});}_0x325e2d=_[_0x09ac('0x3d')]({},_0x325e2d,_0x571b00[_0x09ac('0x3f')]);var _0x14f58d={'where':_0x325e2d[_0x09ac('0x3a')]};return db[_0x09ac('0x2a')][_0x09ac('0x1b')](_0x14f58d)[_0x09ac('0x23')](function(_0x224c6e){_0x41ca09['count']=_0x224c6e;if(_0x571b00[_0x09ac('0x30')][_0x09ac('0x40')]){_0x325e2d[_0x09ac('0x41')]=[{'all':!![]}];}return db[_0x09ac('0x2a')]['findAll'](_0x325e2d);})['then'](function(_0x54dcb7){_0x41ca09[_0x09ac('0x42')]=_0x54dcb7;return _0x41ca09;})[_0x09ac('0x23')](respondWithFilteredResult(_0x429dcd,_0x325e2d))[_0x09ac('0x43')](handleError(_0x429dcd,null));};exports['show']=function(_0x76ff6f,_0x474413){var _0x59653f={'raw':![],'where':{'id':_0x76ff6f[_0x09ac('0x44')]['id']}},_0x1f6a9e={};_0x1f6a9e[_0x09ac('0x2e')]=_[_0x09ac('0x31')](db[_0x09ac('0x2a')][_0x09ac('0x2b')]);_0x1f6a9e[_0x09ac('0x30')]=_[_0x09ac('0x31')](_0x76ff6f[_0x09ac('0x30')]);_0x1f6a9e[_0x09ac('0x32')]=_[_0x09ac('0x33')](_0x1f6a9e[_0x09ac('0x2e')],_0x1f6a9e[_0x09ac('0x30')]);_0x59653f[_0x09ac('0x34')]=_[_0x09ac('0x33')](_0x1f6a9e[_0x09ac('0x2e')],qs[_0x09ac('0x35')](_0x76ff6f[_0x09ac('0x30')][_0x09ac('0x35')]));_0x59653f[_0x09ac('0x34')]=_0x59653f[_0x09ac('0x34')]['length']?_0x59653f['attributes']:_0x1f6a9e[_0x09ac('0x2e')];if(_0x76ff6f['query'][_0x09ac('0x40')]){_0x59653f[_0x09ac('0x41')]=[{'all':!![]}];}_0x59653f=_[_0x09ac('0x3d')]({},_0x59653f,_0x76ff6f[_0x09ac('0x3f')]);return db[_0x09ac('0x2a')]['find'](_0x59653f)[_0x09ac('0x23')](handleEntityNotFound(_0x474413,null))[_0x09ac('0x23')](respondWithResult(_0x474413,null))['catch'](handleError(_0x474413,null));};exports[_0x09ac('0x45')]=function(_0x4e285f,_0x5d0dbd){return db[_0x09ac('0x2a')]['create'](_0x4e285f[_0x09ac('0x46')],{})[_0x09ac('0x23')](respondWithResult(_0x5d0dbd,0xc9))[_0x09ac('0x43')](handleError(_0x5d0dbd,null));};exports['bulkCreate']=function(_0x53e83f,_0x381231){return db['AnalyticFieldReport'][_0x09ac('0x47')](_0x53e83f[_0x09ac('0x46')],{'raw':![],'individualHooks':!![]})[_0x09ac('0x23')](respondWithResult(_0x381231,0xc9))[_0x09ac('0x43')](handleError(_0x381231,null));};exports[_0x09ac('0x22')]=function(_0x1da763,_0x47c596){if(_0x1da763['body']['id']){delete _0x1da763[_0x09ac('0x46')]['id'];}return db[_0x09ac('0x2a')][_0x09ac('0x48')]({'where':{'id':_0x1da763[_0x09ac('0x44')]['id']}})[_0x09ac('0x23')](handleEntityNotFound(_0x47c596,null))['then'](saveUpdates(_0x1da763[_0x09ac('0x46')],null))[_0x09ac('0x23')](respondWithResult(_0x47c596,null))[_0x09ac('0x43')](handleError(_0x47c596,null));};exports[_0x09ac('0x24')]=function(_0x2377a6,_0x4a65b0){return db[_0x09ac('0x2a')][_0x09ac('0x48')]({'where':{'id':_0x2377a6[_0x09ac('0x44')]['id']}})[_0x09ac('0x23')](handleEntityNotFound(_0x4a65b0,null))[_0x09ac('0x23')](removeEntity(_0x4a65b0,null))[_0x09ac('0x43')](handleError(_0x4a65b0,null));};exports[_0x09ac('0x49')]=function(_0x458069,_0xbf308a){return db['AnalyticFieldReport'][_0x09ac('0x24')]({'where':{'id':_0x458069[_0x09ac('0x30')][_0x09ac('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x09ac('0x23')](respondWithResult(_0xbf308a,0xcc))[_0x09ac('0x43')](handleError(_0xbf308a,null));};exports[_0x09ac('0x4b')]=function(_0x4a02c1,_0x2e6991,_0x118bc4){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4a02c1[_0x09ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e6991,null))['then'](function(_0x1b4973){if(_0x1b4973){return db[_0x09ac('0x4c')][_0x09ac('0x4d')](function(_0x4b2194){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4a02c1[_0x09ac('0x44')]['id']},'transaction':_0x4b2194})[_0x09ac('0x23')](function(_0x17b62d){var _0x36c97f=_[_0x09ac('0x2f')](_0x4a02c1['body'],function(_0x1f0e52){delete _0x1f0e52['id'];_0x1f0e52[_0x09ac('0x4e')]=_0x4a02c1[_0x09ac('0x44')]['id'];return _0x1f0e52;});return db['AnalyticFieldReport'][_0x09ac('0x47')](_0x36c97f,{'transaction':_0x4b2194});});})[_0x09ac('0x23')](function(){return db['AnalyticFieldReport'][_0x09ac('0x4f')]({'where':{'CustomReportId':_0x4a02c1[_0x09ac('0x44')]['id']}});});}})['then'](respondWithResult(_0x2e6991,null))[_0x09ac('0x43')](handleError(_0x2e6991,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index b80fd92..fd92556 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 _0xe8dd=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe8dd,0x65));var _0xde8d=function(_0x45af6b,_0x1a4ea8){_0x45af6b=_0x45af6b-0x0;var _0x3bf8a7=_0xe8dd[_0x45af6b];return _0x3bf8a7;};'use strict';var _=require(_0xde8d('0x0'));var util=require(_0xde8d('0x1'));var logger=require(_0xde8d('0x2'))(_0xde8d('0x3'));var moment=require(_0xde8d('0x4'));var BPromise=require(_0xde8d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xde8d('0x6'));var config=require(_0xde8d('0x7'));var attributes=require(_0xde8d('0x8'));module[_0xde8d('0x9')]=function(_0x89d73b,_0x5a66c8){return _0x89d73b[_0xde8d('0xa')](_0xde8d('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d8d=['api','moment','bluebird','path','../../config/environment','AnalyticFieldReport','lodash','util','../../config/logger'];(function(_0x1efc3a,_0x1ca4ce){var _0x176fb1=function(_0x467fe6){while(--_0x467fe6){_0x1efc3a['push'](_0x1efc3a['shift']());}};_0x176fb1(++_0x1ca4ce);}(_0x6d8d,0x9f));var _0xd6d8=function(_0x18b5e2,_0x230b5f){_0x18b5e2=_0x18b5e2-0x0;var _0x257006=_0x6d8d[_0x18b5e2];return _0x257006;};'use strict';var _=require(_0xd6d8('0x0'));var util=require(_0xd6d8('0x1'));var logger=require(_0xd6d8('0x2'))(_0xd6d8('0x3'));var moment=require(_0xd6d8('0x4'));var BPromise=require(_0xd6d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6d8('0x6'));var rimraf=require('rimraf');var config=require(_0xd6d8('0x7'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x11a0e4,_0x5a1752){return _0x11a0e4['define'](_0xd6d8('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 2ad8936..985ff88 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 _0x8faa=['request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x8faa,0x9a));var _0xa8fa=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x8faa[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0xa8fa('0x0'));var util=require(_0xa8fa('0x1'));var moment=require(_0xa8fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8fa('0x3'));var fs=require('fs');var Redis=require(_0xa8fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa8fa('0x5'))(_0xa8fa('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa8fa('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x511c6f,_0x5412db,_0x1d65fd){return new BPromise(function(_0xf073f,_0x4419c5){return client[_0xa8fa('0x8')](_0x511c6f,_0x1d65fd)[_0xa8fa('0x9')](function(_0x1fa7d4){logger[_0xa8fa('0xa')](_0xa8fa('0xb'),_0x5412db,'request\x20sent');logger['debug'](_0xa8fa('0xc'),_0x5412db,'request\x20sent',JSON[_0xa8fa('0xd')](_0x1fa7d4));if(_0x1fa7d4[_0xa8fa('0xe')]){if(_0x1fa7d4[_0xa8fa('0xe')][_0xa8fa('0xf')]===0x1f4){logger[_0xa8fa('0xe')](_0xa8fa('0xb'),_0x5412db,_0x1fa7d4['error'][_0xa8fa('0x10')]);return _0x4419c5(_0x1fa7d4[_0xa8fa('0xe')][_0xa8fa('0x10')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5412db,_0x1fa7d4['error'][_0xa8fa('0x10')]);return _0xf073f(_0x1fa7d4[_0xa8fa('0xe')][_0xa8fa('0x10')]);}else{logger[_0xa8fa('0xa')](_0xa8fa('0xb'),_0x5412db,_0xa8fa('0x11'));_0xf073f(_0x1fa7d4[_0xa8fa('0x12')][_0xa8fa('0x10')]);}})['catch'](function(_0x1188a2){logger[_0xa8fa('0xe')](_0xa8fa('0xb'),_0x5412db,_0x1188a2);_0x4419c5(_0x1188a2);});});}
\ No newline at end of file
+var _0x2250=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2250,0x164));var _0x0225=function(_0x46dab8,_0x4ef8ed){_0x46dab8=_0x46dab8-0x0;var _0x3d1e3a=_0x2250[_0x46dab8];return _0x3d1e3a;};'use strict';var _=require(_0x0225('0x0'));var util=require('util');var moment=require(_0x0225('0x1'));var BPromise=require(_0x0225('0x2'));var rs=require(_0x0225('0x3'));var fs=require('fs');var Redis=require(_0x0225('0x4'));var db=require(_0x0225('0x5'))['db'];var utils=require(_0x0225('0x6'));var logger=require(_0x0225('0x7'))(_0x0225('0x8'));var config=require(_0x0225('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0225('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7b2636,_0x66dc2c,_0x5b8b46){return new BPromise(function(_0x3b4d8d,_0x32f80d){return client[_0x0225('0xb')](_0x7b2636,_0x5b8b46)[_0x0225('0xc')](function(_0x90bda2){logger[_0x0225('0xd')](_0x0225('0xe'),_0x66dc2c,'request\x20sent');logger[_0x0225('0xf')](_0x0225('0x10'),_0x66dc2c,_0x0225('0x11'),JSON[_0x0225('0x12')](_0x90bda2));if(_0x90bda2[_0x0225('0x13')]){if(_0x90bda2[_0x0225('0x13')][_0x0225('0x14')]===0x1f4){logger[_0x0225('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x66dc2c,_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);return _0x32f80d(_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);}logger['error'](_0x0225('0xe'),_0x66dc2c,_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);return _0x3b4d8d(_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);}else{logger[_0x0225('0xd')](_0x0225('0xe'),_0x66dc2c,_0x0225('0x11'));_0x3b4d8d(_0x90bda2[_0x0225('0x16')][_0x0225('0x15')]);}})[_0x0225('0x17')](function(_0x3b1a54){logger[_0x0225('0x13')](_0x0225('0xe'),_0x66dc2c,_0x3b1a54);_0x32f80d(_0x3b1a54);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index d85c5a7..1519dd6 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(_0x55bf5e,_0x36933f){var _0x459419=function(_0x45ddc3){while(--_0x45ddc3){_0x55bf5e['push'](_0x55bf5e['shift']());}};_0x459419(++_0x36933f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x3283db,_0x41b09d){var _0x10c62f=function(_0x574c9f){while(--_0x574c9f){_0x3283db['push'](_0x3283db['shift']());}};_0x10c62f(++_0x41b09d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 b86b92a..31a3659 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 _0x282b=['sequelize','exports','STRING','name'];(function(_0x206969,_0x2106e4){var _0x20a94d=function(_0x4dd625){while(--_0x4dd625){_0x206969['push'](_0x206969['shift']());}};_0x20a94d(++_0x2106e4);}(_0x282b,0xec));var _0xb282=function(_0x111780,_0xe5970b){_0x111780=_0x111780-0x0;var _0x5edc21=_0x282b[_0x111780];return _0x5edc21;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'name':{'type':Sequelize[_0xb282('0x2')],'allowNull':![],'unique':_0xb282('0x3')},'table':{'type':Sequelize[_0xb282('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8ba2=['exports','STRING','TEXT','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ba2,0x13f));var _0x28ba=function(_0x34288e,_0x23b339){_0x34288e=_0x34288e-0x0;var _0x21f500=_0x8ba2[_0x34288e];return _0x21f500;};'use strict';var Sequelize=require(_0x28ba('0x0'));module[_0x28ba('0x1')]={'name':{'type':Sequelize[_0x28ba('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x28ba('0x2')]},'metric':{'type':Sequelize[_0x28ba('0x3')]},'description':{'type':Sequelize[_0x28ba('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 9aadbf9..a25bbf4 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x2d136c,_0x2bd813){var _0x483850=function(_0xec695e){while(--_0xec695e){_0x2d136c['push'](_0x2d136c['shift']());}};_0x483850(++_0x2bd813);}(_0x008c,0x188));var _0xc008=function(_0x48e6f1,_0x1bd3e8){_0x48e6f1=_0x48e6f1-0x0;var _0x154ae1=_0x008c[_0x48e6f1];return _0x154ae1;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','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','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x55b14c,_0x56803e){var _0x48e104=function(_0xe98e28){while(--_0xe98e28){_0x55b14c['push'](_0x55b14c['shift']());}};_0x48e104(++_0x56803e);}(_0x425d,0x1e0));var _0xd425=function(_0x491001,_0x2e13ee){_0x491001=_0x491001-0x0;var _0x2971ef=_0x425d[_0x491001];return _0x2971ef;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 52bf436..0c1c4a6 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 _0x5785=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api','moment'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5785,0x119));var _0x5578=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x5785[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var logger=require(_0x5578('0x2'))(_0x5578('0x3'));var moment=require(_0x5578('0x4'));var BPromise=require('bluebird');var rp=require(_0x5578('0x5'));var fs=require('fs');var path=require(_0x5578('0x6'));var rimraf=require(_0x5578('0x7'));var config=require(_0x5578('0x8'));var attributes=require(_0x5578('0x9'));module[_0x5578('0xa')]=function(_0x35a1f4,_0x1a9d73){return _0x35a1f4[_0x5578('0xb')](_0x5578('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4819=['analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric'];(function(_0x886924,_0x1f6adf){var _0x1ba368=function(_0x45eff4){while(--_0x45eff4){_0x886924['push'](_0x886924['shift']());}};_0x1ba368(++_0x1f6adf);}(_0x4819,0xcd));var _0x9481=function(_0x4ad6e4,_0x103161){_0x4ad6e4=_0x4ad6e4-0x0;var _0x11e62a=_0x4819[_0x4ad6e4];return _0x11e62a;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 27fb5bf..5b62bc3 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 _0xd289=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','lodash','util','moment'];(function(_0x11c361,_0x4f5b42){var _0x1f5355=function(_0x259200){while(--_0x259200){_0x11c361['push'](_0x11c361['shift']());}};_0x1f5355(++_0x4f5b42);}(_0xd289,0x123));var _0x9d28=function(_0x2e78db,_0x5ab8a1){_0x2e78db=_0x2e78db-0x0;var _0x195fb4=_0xd289[_0x2e78db];return _0x195fb4;};'use strict';var _=require(_0x9d28('0x0'));var util=require(_0x9d28('0x1'));var moment=require(_0x9d28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d28('0x3'));var db=require(_0x9d28('0x4'))['db'];var utils=require(_0x9d28('0x5'));var logger=require('../../config/logger')(_0x9d28('0x6'));var config=require(_0x9d28('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d28('0x8')][_0x9d28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43e67c,_0x57c717,_0x504f45){return new BPromise(function(_0x125afb,_0x372542){return client[_0x9d28('0xa')](_0x43e67c,_0x504f45)[_0x9d28('0xb')](function(_0x1cbe67){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x57c717,_0x9d28('0xc'));logger[_0x9d28('0xd')](_0x9d28('0xe'),_0x57c717,_0x9d28('0xc'),JSON[_0x9d28('0xf')](_0x1cbe67));if(_0x1cbe67[_0x9d28('0x10')]){if(_0x1cbe67[_0x9d28('0x10')]['code']===0x1f4){logger[_0x9d28('0x10')](_0x9d28('0x11'),_0x57c717,_0x1cbe67['error'][_0x9d28('0x12')]);return _0x372542(_0x1cbe67['error']['message']);}logger[_0x9d28('0x10')](_0x9d28('0x11'),_0x57c717,_0x1cbe67[_0x9d28('0x10')][_0x9d28('0x12')]);return _0x125afb(_0x1cbe67[_0x9d28('0x10')][_0x9d28('0x12')]);}else{logger[_0x9d28('0x13')](_0x9d28('0x11'),_0x57c717,'request\x20sent');_0x125afb(_0x1cbe67[_0x9d28('0x14')]['message']);}})['catch'](function(_0x545b3b){logger['error'](_0x9d28('0x11'),_0x57c717,_0x545b3b);_0x372542(_0x545b3b);});});}
\ No newline at end of file
+var _0xcfd9=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s'];(function(_0x3e9c2c,_0x2d5157){var _0x1ad468=function(_0x344b06){while(--_0x344b06){_0x3e9c2c['push'](_0x3e9c2c['shift']());}};_0x1ad468(++_0x2d5157);}(_0xcfd9,0xea));var _0x9cfd=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0xcfd9[_0x4ec520];return _0xed49d7;};'use strict';var _=require(_0x9cfd('0x0'));var util=require(_0x9cfd('0x1'));var moment=require('moment');var BPromise=require(_0x9cfd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cfd('0x3'));var db=require(_0x9cfd('0x4'))['db'];var utils=require(_0x9cfd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9cfd('0x6'));var jayson=require(_0x9cfd('0x7'));var client=jayson['client'][_0x9cfd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x146937,_0x569f90,_0x2f9386){return new BPromise(function(_0x287d8b,_0x440fc8){return client[_0x9cfd('0x9')](_0x146937,_0x2f9386)[_0x9cfd('0xa')](function(_0x5dcb66){logger[_0x9cfd('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x569f90,_0x9cfd('0xc'));logger[_0x9cfd('0xd')](_0x9cfd('0xe'),_0x569f90,_0x9cfd('0xc'),JSON['stringify'](_0x5dcb66));if(_0x5dcb66[_0x9cfd('0xf')]){if(_0x5dcb66['error'][_0x9cfd('0x10')]===0x1f4){logger[_0x9cfd('0xf')](_0x9cfd('0x11'),_0x569f90,_0x5dcb66['error']['message']);return _0x440fc8(_0x5dcb66[_0x9cfd('0xf')][_0x9cfd('0x12')]);}logger[_0x9cfd('0xf')](_0x9cfd('0x11'),_0x569f90,_0x5dcb66[_0x9cfd('0xf')][_0x9cfd('0x12')]);return _0x287d8b(_0x5dcb66['error']['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x569f90,_0x9cfd('0xc'));_0x287d8b(_0x5dcb66[_0x9cfd('0x13')]['message']);}})[_0x9cfd('0x14')](function(_0x28b8dd){logger[_0x9cfd('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x569f90,_0x28b8dd);_0x440fc8(_0x28b8dd);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index f3d81df..0b8e958 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 _0x07d7=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x349942,_0xaf2dc4){var _0x40a55b=function(_0x460e5c){while(--_0x460e5c){_0x349942['push'](_0x349942['shift']());}};_0x40a55b(++_0xaf2dc4);}(_0x07d7,0x85));var _0x707d=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x07d7[_0x1fcaf1];return _0x55f464;};'use strict';var multer=require(_0x707d('0x0'));var util=require(_0x707d('0x1'));var path=require(_0x707d('0x2'));var timeout=require(_0x707d('0x3'));var express=require(_0x707d('0x4'));var router=express[_0x707d('0x5')]();var fs_extra=require(_0x707d('0x6'));var auth=require(_0x707d('0x7'));var interaction=require(_0x707d('0x8'));var config=require(_0x707d('0x9'));var controller=require(_0x707d('0xa'));router[_0x707d('0xb')]('/',auth[_0x707d('0xc')](),controller[_0x707d('0xd')]);router[_0x707d('0xb')](_0x707d('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x707d('0xf')]('/',auth[_0x707d('0xc')](),controller[_0x707d('0x10')]);router[_0x707d('0x11')](_0x707d('0xe'),auth['isAuthenticated'](),controller[_0x707d('0x12')]);router[_0x707d('0x13')](_0x707d('0xe'),auth['isAuthenticated'](),controller[_0x707d('0x14')]);module[_0x707d('0x15')]=router;
\ No newline at end of file
+var _0x5b7f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x12c90c,_0x29c6d7){_0x12c90c=_0x12c90c-0x0;var _0x14f0f5=_0x5b7f[_0x12c90c];return _0x14f0f5;};'use strict';var multer=require(_0xf5b7('0x0'));var util=require(_0xf5b7('0x1'));var path=require(_0xf5b7('0x2'));var timeout=require(_0xf5b7('0x3'));var express=require(_0xf5b7('0x4'));var router=express[_0xf5b7('0x5')]();var fs_extra=require(_0xf5b7('0x6'));var auth=require(_0xf5b7('0x7'));var interaction=require(_0xf5b7('0x8'));var config=require(_0xf5b7('0x9'));var controller=require(_0xf5b7('0xa'));router[_0xf5b7('0xb')]('/',auth[_0xf5b7('0xc')](),controller[_0xf5b7('0xd')]);router[_0xf5b7('0xb')](_0xf5b7('0xe'),auth[_0xf5b7('0xc')](),controller[_0xf5b7('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf5b7('0x10')](_0xf5b7('0xe'),auth[_0xf5b7('0xc')](),controller[_0xf5b7('0x11')]);router[_0xf5b7('0x12')](_0xf5b7('0xe'),auth[_0xf5b7('0xc')](),controller[_0xf5b7('0x13')]);module[_0xf5b7('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index c52194e..ab72a91 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 _0xb50a=['sequelize'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0xb50a,0x105));var _0xab50=function(_0x3eddab,_0x2179e6){_0x3eddab=_0x3eddab-0x0;var _0x2c6877=_0xb50a[_0x3eddab];return _0x2c6877;};'use strict';var Sequelize=require(_0xab50('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x42e5=['TEXT'];(function(_0x5a750a,_0x30d794){var _0x21335d=function(_0x4241c1){while(--_0x4241c1){_0x5a750a['push'](_0x5a750a['shift']());}};_0x21335d(++_0x30d794);}(_0x42e5,0x113));var _0x542e=function(_0x206487,_0x28eec1){_0x206487=_0x206487-0x0;var _0x2714c7=_0x42e5[_0x206487];return _0x2714c7;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x542e('0x0')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 17933e2..37edadd 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 _0x73fc=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','sendStatus','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticTreeReport','includeAll','include','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73fc,0x115));var _0xc73f=function(_0x4d30ce,_0x2b0b62){_0x4d30ce=_0x4d30ce-0x0;var _0xe8d9cc=_0x73fc[_0x4d30ce];return _0xe8d9cc;};'use strict';var emlformat=require(_0xc73f('0x0'));var rimraf=require(_0xc73f('0x1'));var zipdir=require(_0xc73f('0x2'));var jsonpatch=require(_0xc73f('0x3'));var rp=require(_0xc73f('0x4'));var moment=require(_0xc73f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc73f('0x6'));var path=require(_0xc73f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc73f('0x8'));var fs=require('fs');var fs_extra=require(_0xc73f('0x9'));var _=require(_0xc73f('0xa'));var squel=require(_0xc73f('0xb'));var crypto=require('crypto');var jsforce=require(_0xc73f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc73f('0xd'));var querystring=require(_0xc73f('0xe'));var Papa=require(_0xc73f('0xf'));var Redis=require(_0xc73f('0x10'));var authService=require(_0xc73f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc73f('0x12'));var hardwareService=require(_0xc73f('0x13'));var logger=require(_0xc73f('0x14'))(_0xc73f('0x15'));var utils=require(_0xc73f('0x16'));var config=require(_0xc73f('0x17'));var licenseUtil=require(_0xc73f('0x18'));var db=require(_0xc73f('0x19'))['db'];function respondWithStatusCode(_0x3c1b7a,_0x55fbf7){_0x55fbf7=_0x55fbf7||0xcc;return function(_0x4be378){if(_0x4be378){return _0x3c1b7a['sendStatus'](_0x55fbf7);}return _0x3c1b7a[_0xc73f('0x1a')](_0x55fbf7)[_0xc73f('0x1b')]();};}function respondWithResult(_0x291334,_0x52bb88){_0x52bb88=_0x52bb88||0xc8;return function(_0x36d3ba){if(_0x36d3ba){return _0x291334[_0xc73f('0x1a')](_0x52bb88)[_0xc73f('0x1c')](_0x36d3ba);}};}function respondWithFilteredResult(_0x2bdf0b,_0x1640d4){return function(_0x5f52de){if(_0x5f52de){var _0x2e55db=typeof _0x1640d4[_0xc73f('0x1d')]==='undefined'&&typeof _0x1640d4[_0xc73f('0x1e')]===_0xc73f('0x1f');var _0x4955ca=_0x5f52de[_0xc73f('0x20')];var _0x6b7fb8=_0x2e55db?0x0:_0x1640d4[_0xc73f('0x1d')];var _0x21345b=_0x2e55db?_0x5f52de['count']:_0x1640d4[_0xc73f('0x1d')]+_0x1640d4[_0xc73f('0x1e')];var _0x3133a8;if(_0x21345b>=_0x4955ca){_0x21345b=_0x4955ca;_0x3133a8=0xc8;}else{_0x3133a8=0xce;}_0x2bdf0b[_0xc73f('0x1a')](_0x3133a8);return _0x2bdf0b[_0xc73f('0x21')]('Content-Range',_0x6b7fb8+'-'+_0x21345b+'/'+_0x4955ca)[_0xc73f('0x1c')](_0x5f52de);}return null;};}function patchUpdates(_0x385c0b){return function(_0x4b5f70){try{jsonpatch[_0xc73f('0x22')](_0x4b5f70,_0x385c0b,!![]);}catch(_0xeddbf5){return BPromise['reject'](_0xeddbf5);}return _0x4b5f70[_0xc73f('0x23')]();};}function saveUpdates(_0x37c418,_0x3f25d2){return function(_0x4c4818){if(_0x4c4818){return _0x4c4818[_0xc73f('0x24')](_0x37c418)[_0xc73f('0x25')](function(_0x50a1b5){return _0x50a1b5;});}return null;};}function removeEntity(_0x2abecf,_0x3242fe){return function(_0x48b2a2){if(_0x48b2a2){return _0x48b2a2[_0xc73f('0x26')]()[_0xc73f('0x25')](function(){_0x2abecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x154be0,_0x399193){return function(_0x3fc8d1){if(!_0x3fc8d1){_0x154be0[_0xc73f('0x27')](0x194);}return _0x3fc8d1;};}function handleError(_0x43e0bb,_0x13bfbb){_0x13bfbb=_0x13bfbb||0x1f4;return function(_0x293bfd){logger['error'](_0x293bfd['stack']);if(_0x293bfd[_0xc73f('0x28')]){delete _0x293bfd[_0xc73f('0x28')];}_0x43e0bb[_0xc73f('0x1a')](_0x13bfbb)['send'](_0x293bfd);};}exports[_0xc73f('0x29')]=function(_0x228fb5,_0x529fd1){var _0x8c873d={},_0x404620={},_0x4f247e={'count':0x0,'rows':[]};var _0x2bcfa6=_[_0xc73f('0x2a')](db['AnalyticTreeReport'][_0xc73f('0x2b')],function(_0x15d8b9){return{'name':_0x15d8b9[_0xc73f('0x2c')],'type':_0x15d8b9['type']['key']};});_0x404620[_0xc73f('0x2d')]=_[_0xc73f('0x2a')](_0x2bcfa6,_0xc73f('0x28'));_0x404620[_0xc73f('0x2e')]=_[_0xc73f('0x2f')](_0x228fb5['query']);_0x404620[_0xc73f('0x30')]=_[_0xc73f('0x31')](_0x404620[_0xc73f('0x2d')],_0x404620[_0xc73f('0x2e')]);_0x8c873d[_0xc73f('0x32')]=_[_0xc73f('0x31')](_0x404620[_0xc73f('0x2d')],qs[_0xc73f('0x33')](_0x228fb5['query'][_0xc73f('0x33')]));_0x8c873d[_0xc73f('0x32')]=_0x8c873d['attributes']['length']?_0x8c873d[_0xc73f('0x32')]:_0x404620[_0xc73f('0x2d')];if(!_0x228fb5['query'][_0xc73f('0x34')](_0xc73f('0x35'))){_0x8c873d[_0xc73f('0x1e')]=qs[_0xc73f('0x1e')](_0x228fb5[_0xc73f('0x2e')]['limit']);_0x8c873d[_0xc73f('0x1d')]=qs['offset'](_0x228fb5[_0xc73f('0x2e')][_0xc73f('0x1d')]);}_0x8c873d['order']=qs['sort'](_0x228fb5['query'][_0xc73f('0x36')]);_0x8c873d[_0xc73f('0x37')]=qs[_0xc73f('0x30')](_[_0xc73f('0x38')](_0x228fb5[_0xc73f('0x2e')],_0x404620[_0xc73f('0x30')]),_0x2bcfa6);if(_0x228fb5[_0xc73f('0x2e')][_0xc73f('0x39')]){_0x8c873d[_0xc73f('0x37')]=_[_0xc73f('0x3a')](_0x8c873d[_0xc73f('0x37')],{'$or':_['map'](_0x2bcfa6,function(_0x16cfbe){if(_0x16cfbe[_0xc73f('0x3b')]!==_0xc73f('0x3c')){var _0x4bdd75={};_0x4bdd75[_0x16cfbe[_0xc73f('0x28')]]={'$like':'%'+_0x228fb5['query'][_0xc73f('0x39')]+'%'};return _0x4bdd75;}})});}_0x8c873d=_['merge']({},_0x8c873d,_0x228fb5[_0xc73f('0x3d')]);var _0x314f95={'where':_0x8c873d[_0xc73f('0x37')]};return db[_0xc73f('0x3e')][_0xc73f('0x20')](_0x314f95)[_0xc73f('0x25')](function(_0x781c62){_0x4f247e['count']=_0x781c62;if(_0x228fb5[_0xc73f('0x2e')][_0xc73f('0x3f')]){_0x8c873d[_0xc73f('0x40')]=[{'all':!![]}];}return db[_0xc73f('0x3e')]['findAll'](_0x8c873d);})[_0xc73f('0x25')](function(_0x50baf4){_0x4f247e[_0xc73f('0x41')]=_0x50baf4;return _0x4f247e;})['then'](respondWithFilteredResult(_0x529fd1,_0x8c873d))[_0xc73f('0x42')](handleError(_0x529fd1,null));};exports[_0xc73f('0x43')]=function(_0x397f3d,_0x45613f){var _0x2aa746={'raw':!![],'where':{'id':_0x397f3d[_0xc73f('0x44')]['id']}},_0x42a770={};_0x42a770['model']=_[_0xc73f('0x2f')](db[_0xc73f('0x3e')][_0xc73f('0x2b')]);_0x42a770[_0xc73f('0x2e')]=_[_0xc73f('0x2f')](_0x397f3d[_0xc73f('0x2e')]);_0x42a770[_0xc73f('0x30')]=_['intersection'](_0x42a770[_0xc73f('0x2d')],_0x42a770[_0xc73f('0x2e')]);_0x2aa746[_0xc73f('0x32')]=_[_0xc73f('0x31')](_0x42a770['model'],qs[_0xc73f('0x33')](_0x397f3d[_0xc73f('0x2e')][_0xc73f('0x33')]));_0x2aa746[_0xc73f('0x32')]=_0x2aa746[_0xc73f('0x32')][_0xc73f('0x45')]?_0x2aa746[_0xc73f('0x32')]:_0x42a770[_0xc73f('0x2d')];if(_0x397f3d[_0xc73f('0x2e')][_0xc73f('0x3f')]){_0x2aa746[_0xc73f('0x40')]=[{'all':!![]}];}_0x2aa746=_[_0xc73f('0x3a')]({},_0x2aa746,_0x397f3d[_0xc73f('0x3d')]);return db[_0xc73f('0x3e')][_0xc73f('0x46')](_0x2aa746)['then'](handleEntityNotFound(_0x45613f,null))[_0xc73f('0x25')](respondWithResult(_0x45613f,null))[_0xc73f('0x42')](handleError(_0x45613f,null));};exports['create']=function(_0x5e43f2,_0x509bcd){return db['AnalyticTreeReport'][_0xc73f('0x47')](_0x5e43f2['body'],{})[_0xc73f('0x25')](respondWithResult(_0x509bcd,0xc9))['catch'](handleError(_0x509bcd,null));};exports[_0xc73f('0x24')]=function(_0x3db903,_0xf8a2aa){if(_0x3db903[_0xc73f('0x48')]['id']){delete _0x3db903[_0xc73f('0x48')]['id'];}return db[_0xc73f('0x3e')][_0xc73f('0x46')]({'where':{'id':_0x3db903['params']['id']}})['then'](handleEntityNotFound(_0xf8a2aa,null))['then'](saveUpdates(_0x3db903[_0xc73f('0x48')],null))[_0xc73f('0x25')](respondWithResult(_0xf8a2aa,null))['catch'](handleError(_0xf8a2aa,null));};exports['destroy']=function(_0x15d8b4,_0x16f742){return db[_0xc73f('0x3e')][_0xc73f('0x46')]({'where':{'id':_0x15d8b4[_0xc73f('0x44')]['id']}})[_0xc73f('0x25')](handleEntityNotFound(_0x16f742,null))[_0xc73f('0x25')](removeEntity(_0x16f742,null))[_0xc73f('0x42')](handleError(_0x16f742,null));};
\ No newline at end of file
+var _0xeaac=['update','then','destroy','end','error','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0xeaac,0x1ed));var _0xceaa=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xeaac[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require(_0xceaa('0x0'));var rimraf=require(_0xceaa('0x1'));var zipdir=require(_0xceaa('0x2'));var jsonpatch=require(_0xceaa('0x3'));var rp=require(_0xceaa('0x4'));var moment=require(_0xceaa('0x5'));var BPromise=require(_0xceaa('0x6'));var Mustache=require(_0xceaa('0x7'));var util=require(_0xceaa('0x8'));var path=require(_0xceaa('0x9'));var sox=require(_0xceaa('0xa'));var csv=require(_0xceaa('0xb'));var ejs=require(_0xceaa('0xc'));var fs=require('fs');var fs_extra=require(_0xceaa('0xd'));var _=require(_0xceaa('0xe'));var squel=require(_0xceaa('0xf'));var crypto=require(_0xceaa('0x10'));var jsforce=require(_0xceaa('0x11'));var deskjs=require(_0xceaa('0x12'));var toCsv=require(_0xceaa('0xb'));var querystring=require(_0xceaa('0x13'));var Papa=require('papaparse');var Redis=require(_0xceaa('0x14'));var authService=require(_0xceaa('0x15'));var qs=require(_0xceaa('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xceaa('0x17'));var logger=require(_0xceaa('0x18'))(_0xceaa('0x19'));var utils=require(_0xceaa('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xceaa('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe6d904,_0x58077a){_0x58077a=_0x58077a||0xcc;return function(_0x4be3b9){if(_0x4be3b9){return _0xe6d904[_0xceaa('0x1c')](_0x58077a);}return _0xe6d904[_0xceaa('0x1d')](_0x58077a)['end']();};}function respondWithResult(_0x284377,_0x5ecd7b){_0x5ecd7b=_0x5ecd7b||0xc8;return function(_0x3d524e){if(_0x3d524e){return _0x284377[_0xceaa('0x1d')](_0x5ecd7b)['json'](_0x3d524e);}};}function respondWithFilteredResult(_0x4131ce,_0x1204d6){return function(_0x303cf5){if(_0x303cf5){var _0xa2d1de=typeof _0x1204d6[_0xceaa('0x1e')]==='undefined'&&typeof _0x1204d6[_0xceaa('0x1f')]===_0xceaa('0x20');var _0x5868fe=_0x303cf5[_0xceaa('0x21')];var _0x5af760=_0xa2d1de?0x0:_0x1204d6[_0xceaa('0x1e')];var _0x243e84=_0xa2d1de?_0x303cf5['count']:_0x1204d6['offset']+_0x1204d6[_0xceaa('0x1f')];var _0x3ec336;if(_0x243e84>=_0x5868fe){_0x243e84=_0x5868fe;_0x3ec336=0xc8;}else{_0x3ec336=0xce;}_0x4131ce[_0xceaa('0x1d')](_0x3ec336);return _0x4131ce[_0xceaa('0x22')](_0xceaa('0x23'),_0x5af760+'-'+_0x243e84+'/'+_0x5868fe)['json'](_0x303cf5);}return null;};}function patchUpdates(_0x25a5ad){return function(_0x48247d){try{jsonpatch[_0xceaa('0x24')](_0x48247d,_0x25a5ad,!![]);}catch(_0x6705bf){return BPromise[_0xceaa('0x25')](_0x6705bf);}return _0x48247d[_0xceaa('0x26')]();};}function saveUpdates(_0x8c407,_0xc53c3d){return function(_0x17d429){if(_0x17d429){return _0x17d429[_0xceaa('0x27')](_0x8c407)[_0xceaa('0x28')](function(_0x1c7524){return _0x1c7524;});}return null;};}function removeEntity(_0x2ab129,_0x24342e){return function(_0x59429a){if(_0x59429a){return _0x59429a[_0xceaa('0x29')]()[_0xceaa('0x28')](function(){_0x2ab129['status'](0xcc)[_0xceaa('0x2a')]();});}};}function handleEntityNotFound(_0x1fe4c3,_0x4f6428){return function(_0x3640ee){if(!_0x3640ee){_0x1fe4c3['sendStatus'](0x194);}return _0x3640ee;};}function handleError(_0x2e3f5d,_0x3f081f){_0x3f081f=_0x3f081f||0x1f4;return function(_0x8653c1){logger[_0xceaa('0x2b')](_0x8653c1['stack']);if(_0x8653c1[_0xceaa('0x2c')]){delete _0x8653c1[_0xceaa('0x2c')];}_0x2e3f5d[_0xceaa('0x1d')](_0x3f081f)['send'](_0x8653c1);};}exports[_0xceaa('0x2d')]=function(_0x19a3a3,_0x461ac9){var _0x5081cf={},_0x517fb5={},_0x5d34c4={'count':0x0,'rows':[]};var _0x10f133=_[_0xceaa('0x2e')](db[_0xceaa('0x2f')][_0xceaa('0x30')],function(_0x1cddee){return{'name':_0x1cddee[_0xceaa('0x31')],'type':_0x1cddee[_0xceaa('0x32')][_0xceaa('0x33')]};});_0x517fb5[_0xceaa('0x34')]=_['map'](_0x10f133,'name');_0x517fb5['query']=_[_0xceaa('0x35')](_0x19a3a3[_0xceaa('0x36')]);_0x517fb5[_0xceaa('0x37')]=_[_0xceaa('0x38')](_0x517fb5[_0xceaa('0x34')],_0x517fb5[_0xceaa('0x36')]);_0x5081cf[_0xceaa('0x39')]=_[_0xceaa('0x38')](_0x517fb5['model'],qs[_0xceaa('0x3a')](_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x3a')]));_0x5081cf[_0xceaa('0x39')]=_0x5081cf[_0xceaa('0x39')][_0xceaa('0x3b')]?_0x5081cf[_0xceaa('0x39')]:_0x517fb5['model'];if(!_0x19a3a3[_0xceaa('0x36')]['hasOwnProperty'](_0xceaa('0x3c'))){_0x5081cf[_0xceaa('0x1f')]=qs[_0xceaa('0x1f')](_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x1f')]);_0x5081cf[_0xceaa('0x1e')]=qs[_0xceaa('0x1e')](_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x1e')]);}_0x5081cf[_0xceaa('0x3d')]=qs['sort'](_0x19a3a3['query'][_0xceaa('0x3e')]);_0x5081cf[_0xceaa('0x3f')]=qs[_0xceaa('0x37')](_[_0xceaa('0x40')](_0x19a3a3[_0xceaa('0x36')],_0x517fb5[_0xceaa('0x37')]),_0x10f133);if(_0x19a3a3['query'][_0xceaa('0x41')]){_0x5081cf[_0xceaa('0x3f')]=_['merge'](_0x5081cf[_0xceaa('0x3f')],{'$or':_[_0xceaa('0x2e')](_0x10f133,function(_0x34764f){if(_0x34764f[_0xceaa('0x32')]!=='VIRTUAL'){var _0x18c4e8={};_0x18c4e8[_0x34764f[_0xceaa('0x2c')]]={'$like':'%'+_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x41')]+'%'};return _0x18c4e8;}})});}_0x5081cf=_[_0xceaa('0x42')]({},_0x5081cf,_0x19a3a3[_0xceaa('0x43')]);var _0x4b1ea6={'where':_0x5081cf[_0xceaa('0x3f')]};return db[_0xceaa('0x2f')][_0xceaa('0x21')](_0x4b1ea6)[_0xceaa('0x28')](function(_0x4ebc3e){_0x5d34c4['count']=_0x4ebc3e;if(_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x44')]){_0x5081cf[_0xceaa('0x45')]=[{'all':!![]}];}return db[_0xceaa('0x2f')]['findAll'](_0x5081cf);})[_0xceaa('0x28')](function(_0xaf4604){_0x5d34c4['rows']=_0xaf4604;return _0x5d34c4;})['then'](respondWithFilteredResult(_0x461ac9,_0x5081cf))[_0xceaa('0x46')](handleError(_0x461ac9,null));};exports[_0xceaa('0x47')]=function(_0x329d6f,_0x34837f){var _0x42c2bb={'raw':!![],'where':{'id':_0x329d6f['params']['id']}},_0x3ca437={};_0x3ca437[_0xceaa('0x34')]=_[_0xceaa('0x35')](db[_0xceaa('0x2f')][_0xceaa('0x30')]);_0x3ca437[_0xceaa('0x36')]=_['keys'](_0x329d6f[_0xceaa('0x36')]);_0x3ca437['filters']=_[_0xceaa('0x38')](_0x3ca437[_0xceaa('0x34')],_0x3ca437[_0xceaa('0x36')]);_0x42c2bb[_0xceaa('0x39')]=_[_0xceaa('0x38')](_0x3ca437[_0xceaa('0x34')],qs['fields'](_0x329d6f[_0xceaa('0x36')][_0xceaa('0x3a')]));_0x42c2bb[_0xceaa('0x39')]=_0x42c2bb[_0xceaa('0x39')][_0xceaa('0x3b')]?_0x42c2bb[_0xceaa('0x39')]:_0x3ca437[_0xceaa('0x34')];if(_0x329d6f[_0xceaa('0x36')][_0xceaa('0x44')]){_0x42c2bb[_0xceaa('0x45')]=[{'all':!![]}];}_0x42c2bb=_[_0xceaa('0x42')]({},_0x42c2bb,_0x329d6f[_0xceaa('0x43')]);return db[_0xceaa('0x2f')][_0xceaa('0x48')](_0x42c2bb)[_0xceaa('0x28')](handleEntityNotFound(_0x34837f,null))['then'](respondWithResult(_0x34837f,null))[_0xceaa('0x46')](handleError(_0x34837f,null));};exports[_0xceaa('0x49')]=function(_0x3beb82,_0x45a588){return db[_0xceaa('0x2f')][_0xceaa('0x49')](_0x3beb82[_0xceaa('0x4a')],{})['then'](respondWithResult(_0x45a588,0xc9))[_0xceaa('0x46')](handleError(_0x45a588,null));};exports[_0xceaa('0x27')]=function(_0xc84f9f,_0x222e91){if(_0xc84f9f[_0xceaa('0x4a')]['id']){delete _0xc84f9f[_0xceaa('0x4a')]['id'];}return db[_0xceaa('0x2f')][_0xceaa('0x48')]({'where':{'id':_0xc84f9f[_0xceaa('0x4b')]['id']}})[_0xceaa('0x28')](handleEntityNotFound(_0x222e91,null))['then'](saveUpdates(_0xc84f9f[_0xceaa('0x4a')],null))[_0xceaa('0x28')](respondWithResult(_0x222e91,null))['catch'](handleError(_0x222e91,null));};exports[_0xceaa('0x29')]=function(_0x2466b6,_0x144374){return db[_0xceaa('0x2f')][_0xceaa('0x48')]({'where':{'id':_0x2466b6['params']['id']}})[_0xceaa('0x28')](handleEntityNotFound(_0x144374,null))[_0xceaa('0x28')](removeEntity(_0x144374,null))[_0xceaa('0x46')](handleError(_0x144374,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index fb2ae5d..fc362c2 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 _0x4975=['path','rimraf','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3690df,_0x4c761c){var _0x17b3ca=function(_0x274924){while(--_0x274924){_0x3690df['push'](_0x3690df['shift']());}};_0x17b3ca(++_0x4c761c);}(_0x4975,0x1f2));var _0x5497=function(_0x3d51bf,_0x28ee2a){_0x3d51bf=_0x3d51bf-0x0;var _0x42c7f8=_0x4975[_0x3d51bf];return _0x42c7f8;};'use strict';var _=require(_0x5497('0x0'));var util=require(_0x5497('0x1'));var logger=require('../../config/logger')(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x5497('0x8')]=function(_0x37677a,_0x4a640c){return _0x37677a[_0x5497('0x9')](_0x5497('0xa'),attributes,{'tableName':_0x5497('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbdba=['analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','AnalyticTreeReport'];(function(_0x442250,_0x7e4a9c){var _0x1ffde5=function(_0x1575aa){while(--_0x1575aa){_0x442250['push'](_0x442250['shift']());}};_0x1ffde5(++_0x7e4a9c);}(_0xbdba,0x161));var _0xabdb=function(_0x29daac,_0x3067e2){_0x29daac=_0x29daac-0x0;var _0x1f337f=_0xbdba[_0x29daac];return _0x1f337f;};'use strict';var _=require(_0xabdb('0x0'));var util=require('util');var logger=require(_0xabdb('0x1'))(_0xabdb('0x2'));var moment=require(_0xabdb('0x3'));var BPromise=require(_0xabdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabdb('0x5'));var rimraf=require(_0xabdb('0x6'));var config=require(_0xabdb('0x7'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x5e933b,_0x167854){return _0x5e933b[_0xabdb('0x8')](_0xabdb('0x9'),attributes,{'tableName':_0xabdb('0xa'),'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 1c250b5..dec5804 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x28015a,_0x37d2d7){var _0x43bbd5=function(_0x146b86){while(--_0x146b86){_0x28015a['push'](_0x28015a['shift']());}};_0x43bbd5(++_0x37d2d7);}(_0x2ef3,0xba));var _0x32ef=function(_0x23da12,_0x11c25a){_0x23da12=_0x23da12-0x0;var _0x1d524b=_0x2ef3[_0x23da12];return _0x1d524b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x35ffef,_0x416f48){_0x35ffef=_0x35ffef-0x0;var _0x38540f=_0x7a54[_0x35ffef];return _0x38540f;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index f8dd109..04b496e 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 _0x5e74=['update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post'];(function(_0x222954,_0x16f849){var _0x28a79d=function(_0x21bc82){while(--_0x21bc82){_0x222954['push'](_0x222954['shift']());}};_0x28a79d(++_0x16f849);}(_0x5e74,0xbe));var _0x45e7=function(_0x3b889b,_0x276cd3){_0x3b889b=_0x3b889b-0x0;var _0xf1b31a=_0x5e74[_0x3b889b];return _0xf1b31a;};'use strict';var multer=require(_0x45e7('0x0'));var util=require(_0x45e7('0x1'));var path=require(_0x45e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x45e7('0x3'));var router=express[_0x45e7('0x4')]();var fs_extra=require(_0x45e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x45e7('0x6'));var config=require(_0x45e7('0x7'));var controller=require(_0x45e7('0x8'));router[_0x45e7('0x9')]('/',auth['isAuthenticated'](),controller[_0x45e7('0xa')]);router[_0x45e7('0x9')](_0x45e7('0xb'),auth[_0x45e7('0xc')](),controller['show']);router[_0x45e7('0xd')]('/',auth[_0x45e7('0xc')](),controller['create']);router['put'](_0x45e7('0xb'),auth[_0x45e7('0xc')](),controller[_0x45e7('0xe')]);router[_0x45e7('0xf')](_0x45e7('0xb'),auth[_0x45e7('0xc')](),controller['destroy']);module[_0x45e7('0x10')]=router;
\ No newline at end of file
+var _0xf6ee=['update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./analyticTreeReport.controller','isAuthenticated','get','/:id','show','post','create','put'];(function(_0x3c53d6,_0x3c5886){var _0x1e6fe1=function(_0x51076d){while(--_0x51076d){_0x3c53d6['push'](_0x3c53d6['shift']());}};_0x1e6fe1(++_0x3c5886);}(_0xf6ee,0x190));var _0xef6e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6ee[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xef6e('0x0'));var util=require('util');var path=require(_0xef6e('0x1'));var timeout=require('connect-timeout');var express=require(_0xef6e('0x2'));var router=express[_0xef6e('0x3')]();var fs_extra=require(_0xef6e('0x4'));var auth=require(_0xef6e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef6e('0x6'));router['get']('/',auth[_0xef6e('0x7')](),controller['index']);router[_0xef6e('0x8')](_0xef6e('0x9'),auth[_0xef6e('0x7')](),controller[_0xef6e('0xa')]);router[_0xef6e('0xb')]('/',auth[_0xef6e('0x7')](),controller[_0xef6e('0xc')]);router[_0xef6e('0xd')](_0xef6e('0x9'),auth['isAuthenticated'](),controller[_0xef6e('0xe')]);router[_0xef6e('0xf')](_0xef6e('0x9'),auth[_0xef6e('0x7')](),controller[_0xef6e('0x10')]);module[_0xef6e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 8d37f1e..d8e9a63 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 _0x4156=['STRING','sequelize','exports'];(function(_0x46be5f,_0x170cab){var _0x192673=function(_0x304b3b){while(--_0x304b3b){_0x46be5f['push'](_0x46be5f['shift']());}};_0x192673(++_0x170cab);}(_0x4156,0xf1));var _0x6415=function(_0xc0ca5e,_0x531c0c){_0xc0ca5e=_0xc0ca5e-0x0;var _0x1d6bde=_0x4156[_0xc0ca5e];return _0x1d6bde;};'use strict';var Sequelize=require(_0x6415('0x0'));module[_0x6415('0x1')]={'name':{'type':Sequelize[_0x6415('0x2')]},'basename':{'type':Sequelize[_0x6415('0x2')]},'type':{'type':Sequelize[_0x6415('0x2')]}};
\ No newline at end of file
+var _0xa588=['STRING','exports'];(function(_0x52787d,_0x578574){var _0x1062ac=function(_0xb6f9b6){while(--_0xb6f9b6){_0x52787d['push'](_0x52787d['shift']());}};_0x1062ac(++_0x578574);}(_0xa588,0xe1));var _0x8a58=function(_0x22dfe0,_0x43613b){_0x22dfe0=_0x22dfe0-0x0;var _0x91bbfb=_0xa588[_0x22dfe0];return _0x91bbfb;};'use strict';var Sequelize=require('sequelize');module[_0x8a58('0x0')]={'name':{'type':Sequelize[_0x8a58('0x1')]},'basename':{'type':Sequelize[_0x8a58('0x1')]},'type':{'type':Sequelize[_0x8a58('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 617518f..c426051 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 _0x13a9=['offline-chat/','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','find','clone','params','omit','updatedAt','body','create','originalname','basename','file','filename','type','mimetype','findOne','root','server/files/attachments/','join'];(function(_0x1e60e5,_0xd7ac86){var _0x446b8f=function(_0x1961e8){while(--_0x1961e8){_0x1e60e5['push'](_0x1e60e5['shift']());}};_0x446b8f(++_0xd7ac86);}(_0x13a9,0xb2));var _0x913a=function(_0x491ace,_0x13ed1d){_0x491ace=_0x491ace-0x0;var _0x4d6014=_0x13a9[_0x491ace];return _0x4d6014;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x913a('0x0'));var zipdir=require(_0x913a('0x1'));var jsonpatch=require(_0x913a('0x2'));var rp=require(_0x913a('0x3'));var moment=require(_0x913a('0x4'));var BPromise=require(_0x913a('0x5'));var Mustache=require(_0x913a('0x6'));var util=require(_0x913a('0x7'));var path=require(_0x913a('0x8'));var sox=require(_0x913a('0x9'));var csv=require(_0x913a('0xa'));var ejs=require(_0x913a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x913a('0xc'));var squel=require(_0x913a('0xd'));var crypto=require(_0x913a('0xe'));var jsforce=require(_0x913a('0xf'));var deskjs=require(_0x913a('0x10'));var toCsv=require(_0x913a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x913a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x913a('0x12'));var hardwareService=require(_0x913a('0x13'));var logger=require(_0x913a('0x14'))(_0x913a('0x15'));var utils=require(_0x913a('0x16'));var config=require(_0x913a('0x17'));var licenseUtil=require(_0x913a('0x18'));var db=require(_0x913a('0x19'))['db'];function respondWithStatusCode(_0x2eb4b5,_0x2c9cbd){_0x2c9cbd=_0x2c9cbd||0xcc;return function(_0xb1e9f3){if(_0xb1e9f3){return _0x2eb4b5[_0x913a('0x1a')](_0x2c9cbd);}return _0x2eb4b5['status'](_0x2c9cbd)[_0x913a('0x1b')]();};}function respondWithResult(_0x6dcaa0,_0x3d64da){_0x3d64da=_0x3d64da||0xc8;return function(_0x3e4c1e){if(_0x3e4c1e){return _0x6dcaa0[_0x913a('0x1c')](_0x3d64da)[_0x913a('0x1d')](_0x3e4c1e);}};}function respondWithFilteredResult(_0x2829fc,_0x46e746){return function(_0x4698b6){if(_0x4698b6){var _0x8e1026=typeof _0x46e746[_0x913a('0x1e')]===_0x913a('0x1f')&&typeof _0x46e746['limit']==='undefined';var _0x1f40ca=_0x4698b6[_0x913a('0x20')];var _0x289891=_0x8e1026?0x0:_0x46e746[_0x913a('0x1e')];var _0x2c27b7=_0x8e1026?_0x4698b6[_0x913a('0x20')]:_0x46e746[_0x913a('0x1e')]+_0x46e746['limit'];var _0x3572b9;if(_0x2c27b7>=_0x1f40ca){_0x2c27b7=_0x1f40ca;_0x3572b9=0xc8;}else{_0x3572b9=0xce;}_0x2829fc['status'](_0x3572b9);return _0x2829fc[_0x913a('0x21')](_0x913a('0x22'),_0x289891+'-'+_0x2c27b7+'/'+_0x1f40ca)[_0x913a('0x1d')](_0x4698b6);}return null;};}function patchUpdates(_0x1f9427){return function(_0x28714c){try{jsonpatch[_0x913a('0x23')](_0x28714c,_0x1f9427,!![]);}catch(_0xb766a1){return BPromise['reject'](_0xb766a1);}return _0x28714c[_0x913a('0x24')]();};}function saveUpdates(_0x4259f6,_0x589cdd){return function(_0x3a48e7){if(_0x3a48e7){return _0x3a48e7[_0x913a('0x25')](_0x4259f6)[_0x913a('0x26')](function(_0x30318b){return _0x30318b;});}return null;};}function removeEntity(_0xaa27be,_0x2d4afd){return function(_0x754342){if(_0x754342){return _0x754342[_0x913a('0x27')]()['then'](function(){_0xaa27be[_0x913a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe272ae,_0xb07dfd){return function(_0x4d632f){if(!_0x4d632f){_0xe272ae['sendStatus'](0x194);}return _0x4d632f;};}function handleError(_0x5593aa,_0x2281f2){_0x2281f2=_0x2281f2||0x1f4;return function(_0x329f90){logger[_0x913a('0x28')](_0x329f90[_0x913a('0x29')]);if(_0x329f90[_0x913a('0x2a')]){delete _0x329f90[_0x913a('0x2a')];}_0x5593aa[_0x913a('0x1c')](_0x2281f2)[_0x913a('0x2b')](_0x329f90);};}exports[_0x913a('0x2c')]=function(_0x19a3c7,_0x2152fd){var _0xe42360={},_0x25fac0={},_0x42a136={'count':0x0,'rows':[]};var _0x4e936f=_[_0x913a('0x2d')](db[_0x913a('0x2e')][_0x913a('0x2f')],function(_0x10514a){return{'name':_0x10514a['fieldName'],'type':_0x10514a['type'][_0x913a('0x30')]};});_0x25fac0[_0x913a('0x31')]=_[_0x913a('0x2d')](_0x4e936f,_0x913a('0x2a'));_0x25fac0[_0x913a('0x32')]=_[_0x913a('0x33')](_0x19a3c7[_0x913a('0x32')]);_0x25fac0[_0x913a('0x34')]=_['intersection'](_0x25fac0[_0x913a('0x31')],_0x25fac0[_0x913a('0x32')]);_0xe42360[_0x913a('0x35')]=_[_0x913a('0x36')](_0x25fac0[_0x913a('0x31')],qs['fields'](_0x19a3c7[_0x913a('0x32')][_0x913a('0x37')]));_0xe42360['attributes']=_0xe42360[_0x913a('0x35')][_0x913a('0x38')]?_0xe42360[_0x913a('0x35')]:_0x25fac0[_0x913a('0x31')];if(!_0x19a3c7[_0x913a('0x32')][_0x913a('0x39')](_0x913a('0x3a'))){_0xe42360[_0x913a('0x3b')]=qs[_0x913a('0x3b')](_0x19a3c7[_0x913a('0x32')]['limit']);_0xe42360['offset']=qs['offset'](_0x19a3c7['query']['offset']);}_0xe42360[_0x913a('0x3c')]=qs['sort'](_0x19a3c7[_0x913a('0x32')]['sort']);_0xe42360['where']=qs[_0x913a('0x34')](_['pick'](_0x19a3c7['query'],_0x25fac0[_0x913a('0x34')]),_0x4e936f);if(_0x19a3c7[_0x913a('0x32')]['filter']){_0xe42360[_0x913a('0x3d')]=_[_0x913a('0x3e')](_0xe42360[_0x913a('0x3d')],{'$or':_[_0x913a('0x2d')](_0x4e936f,function(_0xae058a){if(_0xae058a['type']!==_0x913a('0x3f')){var _0x20a358={};_0x20a358[_0xae058a[_0x913a('0x2a')]]={'$like':'%'+_0x19a3c7[_0x913a('0x32')]['filter']+'%'};return _0x20a358;}})});}_0xe42360=_['merge']({},_0xe42360,_0x19a3c7['options']);var _0x582cf1={'where':_0xe42360[_0x913a('0x3d')]};return db['Attachment']['count'](_0x582cf1)[_0x913a('0x26')](function(_0x44e565){_0x42a136['count']=_0x44e565;if(_0x19a3c7['query'][_0x913a('0x40')]){_0xe42360[_0x913a('0x41')]=[{'all':!![]}];}return db['Attachment'][_0x913a('0x42')](_0xe42360);})[_0x913a('0x26')](function(_0x5e2996){_0x42a136[_0x913a('0x43')]=_0x5e2996;return _0x42a136;})[_0x913a('0x26')](respondWithFilteredResult(_0x2152fd,_0xe42360))[_0x913a('0x44')](handleError(_0x2152fd,null));};exports['show']=function(_0x20a74e,_0x29d3cf){var _0x48de71={'raw':!![],'where':{'id':_0x20a74e['params']['id']}},_0x415d38={};_0x415d38['model']=_[_0x913a('0x33')](db['Attachment']['rawAttributes']);_0x415d38[_0x913a('0x32')]=_['keys'](_0x20a74e[_0x913a('0x32')]);_0x415d38[_0x913a('0x34')]=_[_0x913a('0x36')](_0x415d38[_0x913a('0x31')],_0x415d38[_0x913a('0x32')]);_0x48de71[_0x913a('0x35')]=_['intersection'](_0x415d38['model'],qs[_0x913a('0x37')](_0x20a74e[_0x913a('0x32')][_0x913a('0x37')]));_0x48de71[_0x913a('0x35')]=_0x48de71[_0x913a('0x35')][_0x913a('0x38')]?_0x48de71[_0x913a('0x35')]:_0x415d38[_0x913a('0x31')];if(_0x20a74e['query'][_0x913a('0x40')]){_0x48de71[_0x913a('0x41')]=[{'all':!![]}];}_0x48de71=_[_0x913a('0x3e')]({},_0x48de71,_0x20a74e['options']);return db[_0x913a('0x2e')][_0x913a('0x45')](_0x48de71)[_0x913a('0x26')](handleEntityNotFound(_0x29d3cf,null))[_0x913a('0x26')](respondWithResult(_0x29d3cf,null))[_0x913a('0x44')](handleError(_0x29d3cf,null));};exports[_0x913a('0x46')]=function(_0x594dd2,_0x248550){var _0x26c7e4={'where':{'id':_0x594dd2[_0x913a('0x47')]['id']}},_0x44d18b={};_0x44d18b[_0x913a('0x31')]=_[_0x913a('0x33')](db[_0x913a('0x2e')]['rawAttributes']);_0x26c7e4[_0x913a('0x35')]=_[_0x913a('0x36')](_0x44d18b[_0x913a('0x31')],qs[_0x913a('0x37')](_0x594dd2[_0x913a('0x32')][_0x913a('0x37')]));_0x26c7e4['attributes']=_0x26c7e4[_0x913a('0x35')][_0x913a('0x38')]?_0x26c7e4[_0x913a('0x35')]:_0x44d18b[_0x913a('0x31')];if(_0x594dd2['query'][_0x913a('0x40')]){_0x26c7e4[_0x913a('0x41')]=[{'all':!![]}];}_0x26c7e4=_[_0x913a('0x3e')]({},_0x26c7e4,_0x594dd2['options']);return db[_0x913a('0x2e')][_0x913a('0x45')](_0x26c7e4)[_0x913a('0x26')](handleEntityNotFound(_0x248550,null))['then'](function(_0x5eaf65){if(_0x5eaf65){var _0x2e10aa=_0x5eaf65['get']({'plain':!![]});_0x2e10aa=qs[_0x913a('0x48')](_0x2e10aa,['id','createdAt',_0x913a('0x49')]);_0x594dd2[_0x913a('0x4a')]=_['omit'](_0x594dd2[_0x913a('0x4a')],['id','createdAt',_0x913a('0x49')]);return db[_0x913a('0x2e')][_0x913a('0x4b')](_['merge'](_0x2e10aa,_0x594dd2[_0x913a('0x4a')]),{'include':_0x594dd2[_0x913a('0x32')][_0x913a('0x40')]?[{'all':!![]}]:undefined});}})[_0x913a('0x26')](respondWithResult(_0x248550,0xc9))['catch'](handleError(_0x248550,null));};exports[_0x913a('0x25')]=function(_0x4a9759,_0xf3f4fe){if(_0x4a9759[_0x913a('0x4a')]['id']){delete _0x4a9759['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x4a9759['params']['id']}})[_0x913a('0x26')](handleEntityNotFound(_0xf3f4fe,null))['then'](saveUpdates(_0x4a9759[_0x913a('0x4a')],null))['then'](respondWithResult(_0xf3f4fe,null))[_0x913a('0x44')](handleError(_0xf3f4fe,null));};exports[_0x913a('0x27')]=function(_0x5f2641,_0x5ebc93){return db[_0x913a('0x2e')][_0x913a('0x45')]({'where':{'id':_0x5f2641[_0x913a('0x47')]['id']}})[_0x913a('0x26')](handleEntityNotFound(_0x5ebc93,null))[_0x913a('0x26')](removeEntity(_0x5ebc93,null))[_0x913a('0x44')](handleError(_0x5ebc93,null));};exports[_0x913a('0x4b')]=function(_0x331569,_0x26aea8,_0x5d9cc6){_0x331569[_0x913a('0x4a')]['name']=_0x331569['file'][_0x913a('0x4c')];_0x331569['body'][_0x913a('0x4d')]=_0x331569[_0x913a('0x4e')][_0x913a('0x4f')];_0x331569[_0x913a('0x4a')][_0x913a('0x50')]=_0x331569[_0x913a('0x4e')][_0x913a('0x51')];return db['Attachment'][_0x913a('0x4b')](_0x331569[_0x913a('0x4a')])[_0x913a('0x26')](respondWithResult(_0x26aea8,0xc9))[_0x913a('0x44')](handleError(_0x26aea8,null));};exports['download']=function(_0x32eb91,_0x41ab76,_0x26a7c8){return db[_0x913a('0x2e')][_0x913a('0x52')]({'where':{'id':_0x32eb91[_0x913a('0x47')]['id']},'raw':!![]})[_0x913a('0x26')](handleEntityNotFound(_0x41ab76,null))[_0x913a('0x26')](function(_0x2e5a6d){if(_0x2e5a6d){var _0x50fcba=_0x2e5a6d['ChatOfflineMessageId']!==null;var _0x315454=path['join'](config[_0x913a('0x53')],_0x913a('0x54'));if(_0x50fcba){_0x315454=path[_0x913a('0x55')](_0x315454,_0x913a('0x56'));}var _0x5180a1=path[_0x913a('0x55')](_0x315454,_0x2e5a6d[_0x913a('0x4d')]);return _0x41ab76[_0x913a('0x57')](_0x5180a1);}})[_0x913a('0x44')](handleError(_0x41ab76,null));};
\ No newline at end of file
+var _0x621c=['rows','catch','params','find','options','get','omit','createdAt','updatedAt','body','create','update','originalname','basename','file','filename','mimetype','download','join','server/files/attachments/','offline-chat/','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','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/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','stack','name','map','Attachment','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x621c,0x111));var _0xc621=function(_0x5e944a,_0x2847b4){_0x5e944a=_0x5e944a-0x0;var _0x38f07b=_0x621c[_0x5e944a];return _0x38f07b;};'use strict';var emlformat=require(_0xc621('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc621('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc621('0x2'));var moment=require('moment');var BPromise=require(_0xc621('0x3'));var Mustache=require(_0xc621('0x4'));var util=require(_0xc621('0x5'));var path=require(_0xc621('0x6'));var sox=require(_0xc621('0x7'));var csv=require('to-csv');var ejs=require(_0xc621('0x8'));var fs=require('fs');var fs_extra=require(_0xc621('0x9'));var _=require(_0xc621('0xa'));var squel=require(_0xc621('0xb'));var crypto=require(_0xc621('0xc'));var jsforce=require(_0xc621('0xd'));var deskjs=require(_0xc621('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc621('0xf'));var Redis=require(_0xc621('0x10'));var authService=require(_0xc621('0x11'));var qs=require(_0xc621('0x12'));var as=require(_0xc621('0x13'));var hardwareService=require(_0xc621('0x14'));var logger=require(_0xc621('0x15'))(_0xc621('0x16'));var utils=require(_0xc621('0x17'));var config=require(_0xc621('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x88fbda,_0x3a1016){_0x3a1016=_0x3a1016||0xcc;return function(_0x2c6510){if(_0x2c6510){return _0x88fbda[_0xc621('0x19')](_0x3a1016);}return _0x88fbda[_0xc621('0x1a')](_0x3a1016)[_0xc621('0x1b')]();};}function respondWithResult(_0x203895,_0x101c2c){_0x101c2c=_0x101c2c||0xc8;return function(_0x50ad44){if(_0x50ad44){return _0x203895[_0xc621('0x1a')](_0x101c2c)['json'](_0x50ad44);}};}function respondWithFilteredResult(_0x25d3e5,_0xcb915e){return function(_0x18c1ce){if(_0x18c1ce){var _0x45130e=typeof _0xcb915e[_0xc621('0x1c')]===_0xc621('0x1d')&&typeof _0xcb915e[_0xc621('0x1e')]===_0xc621('0x1d');var _0x4bd512=_0x18c1ce[_0xc621('0x1f')];var _0x87f93f=_0x45130e?0x0:_0xcb915e[_0xc621('0x1c')];var _0x4a59fe=_0x45130e?_0x18c1ce[_0xc621('0x1f')]:_0xcb915e[_0xc621('0x1c')]+_0xcb915e[_0xc621('0x1e')];var _0x488c6d;if(_0x4a59fe>=_0x4bd512){_0x4a59fe=_0x4bd512;_0x488c6d=0xc8;}else{_0x488c6d=0xce;}_0x25d3e5[_0xc621('0x1a')](_0x488c6d);return _0x25d3e5['set'](_0xc621('0x20'),_0x87f93f+'-'+_0x4a59fe+'/'+_0x4bd512)[_0xc621('0x21')](_0x18c1ce);}return null;};}function patchUpdates(_0x3c284d){return function(_0xac9774){try{jsonpatch['apply'](_0xac9774,_0x3c284d,!![]);}catch(_0x362d0){return BPromise[_0xc621('0x22')](_0x362d0);}return _0xac9774[_0xc621('0x23')]();};}function saveUpdates(_0x2ede67,_0x511e69){return function(_0x1e3d09){if(_0x1e3d09){return _0x1e3d09['update'](_0x2ede67)[_0xc621('0x24')](function(_0x235dfc){return _0x235dfc;});}return null;};}function removeEntity(_0x37b4cb,_0x4193d1){return function(_0x1bbf83){if(_0x1bbf83){return _0x1bbf83[_0xc621('0x25')]()[_0xc621('0x24')](function(){_0x37b4cb[_0xc621('0x1a')](0xcc)[_0xc621('0x1b')]();});}};}function handleEntityNotFound(_0x2b31b6,_0x1ab809){return function(_0x2ab72d){if(!_0x2ab72d){_0x2b31b6[_0xc621('0x19')](0x194);}return _0x2ab72d;};}function handleError(_0x511c96,_0x1bb9e1){_0x1bb9e1=_0x1bb9e1||0x1f4;return function(_0x7aa798){logger['error'](_0x7aa798[_0xc621('0x26')]);if(_0x7aa798[_0xc621('0x27')]){delete _0x7aa798[_0xc621('0x27')];}_0x511c96[_0xc621('0x1a')](_0x1bb9e1)['send'](_0x7aa798);};}exports['index']=function(_0x3a2ca4,_0x3d9613){var _0x1cc931={},_0x1518ed={},_0x281ded={'count':0x0,'rows':[]};var _0x2c42af=_[_0xc621('0x28')](db[_0xc621('0x29')][_0xc621('0x2a')],function(_0x1a813a){return{'name':_0x1a813a[_0xc621('0x2b')],'type':_0x1a813a['type'][_0xc621('0x2c')]};});_0x1518ed[_0xc621('0x2d')]=_['map'](_0x2c42af,'name');_0x1518ed[_0xc621('0x2e')]=_[_0xc621('0x2f')](_0x3a2ca4['query']);_0x1518ed['filters']=_[_0xc621('0x30')](_0x1518ed[_0xc621('0x2d')],_0x1518ed[_0xc621('0x2e')]);_0x1cc931[_0xc621('0x31')]=_[_0xc621('0x30')](_0x1518ed[_0xc621('0x2d')],qs['fields'](_0x3a2ca4['query'][_0xc621('0x32')]));_0x1cc931[_0xc621('0x31')]=_0x1cc931['attributes'][_0xc621('0x33')]?_0x1cc931['attributes']:_0x1518ed[_0xc621('0x2d')];if(!_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x34')](_0xc621('0x35'))){_0x1cc931['limit']=qs[_0xc621('0x1e')](_0x3a2ca4['query'][_0xc621('0x1e')]);_0x1cc931['offset']=qs[_0xc621('0x1c')](_0x3a2ca4['query'][_0xc621('0x1c')]);}_0x1cc931['order']=qs[_0xc621('0x36')](_0x3a2ca4[_0xc621('0x2e')]['sort']);_0x1cc931[_0xc621('0x37')]=qs['filters'](_['pick'](_0x3a2ca4[_0xc621('0x2e')],_0x1518ed[_0xc621('0x38')]),_0x2c42af);if(_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x39')]){_0x1cc931[_0xc621('0x37')]=_[_0xc621('0x3a')](_0x1cc931[_0xc621('0x37')],{'$or':_[_0xc621('0x28')](_0x2c42af,function(_0x2e182d){if(_0x2e182d['type']!==_0xc621('0x3b')){var _0x277d5b={};_0x277d5b[_0x2e182d['name']]={'$like':'%'+_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x39')]+'%'};return _0x277d5b;}})});}_0x1cc931=_['merge']({},_0x1cc931,_0x3a2ca4['options']);var _0x49d637={'where':_0x1cc931[_0xc621('0x37')]};return db['Attachment'][_0xc621('0x1f')](_0x49d637)['then'](function(_0xaed85f){_0x281ded[_0xc621('0x1f')]=_0xaed85f;if(_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x3c')]){_0x1cc931[_0xc621('0x3d')]=[{'all':!![]}];}return db[_0xc621('0x29')][_0xc621('0x3e')](_0x1cc931);})[_0xc621('0x24')](function(_0x17077b){_0x281ded[_0xc621('0x3f')]=_0x17077b;return _0x281ded;})['then'](respondWithFilteredResult(_0x3d9613,_0x1cc931))[_0xc621('0x40')](handleError(_0x3d9613,null));};exports['show']=function(_0x4dc9b7,_0x57212c){var _0xc35328={'raw':!![],'where':{'id':_0x4dc9b7[_0xc621('0x41')]['id']}},_0x3aa78d={};_0x3aa78d[_0xc621('0x2d')]=_['keys'](db[_0xc621('0x29')][_0xc621('0x2a')]);_0x3aa78d['query']=_[_0xc621('0x2f')](_0x4dc9b7[_0xc621('0x2e')]);_0x3aa78d['filters']=_[_0xc621('0x30')](_0x3aa78d['model'],_0x3aa78d['query']);_0xc35328['attributes']=_[_0xc621('0x30')](_0x3aa78d[_0xc621('0x2d')],qs['fields'](_0x4dc9b7[_0xc621('0x2e')][_0xc621('0x32')]));_0xc35328[_0xc621('0x31')]=_0xc35328[_0xc621('0x31')][_0xc621('0x33')]?_0xc35328[_0xc621('0x31')]:_0x3aa78d[_0xc621('0x2d')];if(_0x4dc9b7[_0xc621('0x2e')][_0xc621('0x3c')]){_0xc35328['include']=[{'all':!![]}];}_0xc35328=_[_0xc621('0x3a')]({},_0xc35328,_0x4dc9b7['options']);return db[_0xc621('0x29')][_0xc621('0x42')](_0xc35328)[_0xc621('0x24')](handleEntityNotFound(_0x57212c,null))[_0xc621('0x24')](respondWithResult(_0x57212c,null))[_0xc621('0x40')](handleError(_0x57212c,null));};exports['clone']=function(_0x1075ac,_0x5c715c){var _0x176f19={'where':{'id':_0x1075ac[_0xc621('0x41')]['id']}},_0x18624b={};_0x18624b[_0xc621('0x2d')]=_[_0xc621('0x2f')](db['Attachment'][_0xc621('0x2a')]);_0x176f19[_0xc621('0x31')]=_['intersection'](_0x18624b[_0xc621('0x2d')],qs[_0xc621('0x32')](_0x1075ac[_0xc621('0x2e')][_0xc621('0x32')]));_0x176f19[_0xc621('0x31')]=_0x176f19['attributes'][_0xc621('0x33')]?_0x176f19[_0xc621('0x31')]:_0x18624b[_0xc621('0x2d')];if(_0x1075ac[_0xc621('0x2e')][_0xc621('0x3c')]){_0x176f19[_0xc621('0x3d')]=[{'all':!![]}];}_0x176f19=_['merge']({},_0x176f19,_0x1075ac[_0xc621('0x43')]);return db['Attachment'][_0xc621('0x42')](_0x176f19)['then'](handleEntityNotFound(_0x5c715c,null))[_0xc621('0x24')](function(_0x1a8370){if(_0x1a8370){var _0x41dec6=_0x1a8370[_0xc621('0x44')]({'plain':!![]});_0x41dec6=qs[_0xc621('0x45')](_0x41dec6,['id',_0xc621('0x46'),_0xc621('0x47')]);_0x1075ac['body']=_[_0xc621('0x45')](_0x1075ac[_0xc621('0x48')],['id',_0xc621('0x46'),_0xc621('0x47')]);return db[_0xc621('0x29')][_0xc621('0x49')](_[_0xc621('0x3a')](_0x41dec6,_0x1075ac[_0xc621('0x48')]),{'include':_0x1075ac['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xc621('0x24')](respondWithResult(_0x5c715c,0xc9))['catch'](handleError(_0x5c715c,null));};exports[_0xc621('0x4a')]=function(_0x897e05,_0x5b8ef0){if(_0x897e05[_0xc621('0x48')]['id']){delete _0x897e05[_0xc621('0x48')]['id'];}return db['Attachment'][_0xc621('0x42')]({'where':{'id':_0x897e05[_0xc621('0x41')]['id']}})[_0xc621('0x24')](handleEntityNotFound(_0x5b8ef0,null))[_0xc621('0x24')](saveUpdates(_0x897e05[_0xc621('0x48')],null))['then'](respondWithResult(_0x5b8ef0,null))[_0xc621('0x40')](handleError(_0x5b8ef0,null));};exports[_0xc621('0x25')]=function(_0x40a91a,_0x4a1c65){return db[_0xc621('0x29')][_0xc621('0x42')]({'where':{'id':_0x40a91a[_0xc621('0x41')]['id']}})[_0xc621('0x24')](handleEntityNotFound(_0x4a1c65,null))['then'](removeEntity(_0x4a1c65,null))[_0xc621('0x40')](handleError(_0x4a1c65,null));};exports[_0xc621('0x49')]=function(_0x7a16ff,_0xfd70d2,_0x5419fb){_0x7a16ff[_0xc621('0x48')][_0xc621('0x27')]=_0x7a16ff['file'][_0xc621('0x4b')];_0x7a16ff[_0xc621('0x48')][_0xc621('0x4c')]=_0x7a16ff[_0xc621('0x4d')][_0xc621('0x4e')];_0x7a16ff[_0xc621('0x48')]['type']=_0x7a16ff[_0xc621('0x4d')][_0xc621('0x4f')];return db[_0xc621('0x29')][_0xc621('0x49')](_0x7a16ff[_0xc621('0x48')])[_0xc621('0x24')](respondWithResult(_0xfd70d2,0xc9))[_0xc621('0x40')](handleError(_0xfd70d2,null));};exports[_0xc621('0x50')]=function(_0x178092,_0x587bf3,_0x1f8918){return db['Attachment']['findOne']({'where':{'id':_0x178092[_0xc621('0x41')]['id']},'raw':!![]})[_0xc621('0x24')](handleEntityNotFound(_0x587bf3,null))[_0xc621('0x24')](function(_0x3c7375){if(_0x3c7375){var _0x4209e4=_0x3c7375['ChatOfflineMessageId']!==null;var _0x2ded26=path[_0xc621('0x51')](config['root'],_0xc621('0x52'));if(_0x4209e4){_0x2ded26=path[_0xc621('0x51')](_0x2ded26,_0xc621('0x53'));}var _0x59634b=path[_0xc621('0x51')](_0x2ded26,_0x3c7375[_0xc621('0x4c')]);return _0x587bf3[_0xc621('0x50')](_0x59634b);}})[_0xc621('0x40')](handleError(_0x587bf3,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 1f673ae..28a6ff2 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 _0x8006=['../../config/logger','api','path','rimraf','./attachment.attributes','Attachment'];(function(_0x22c5fd,_0x110390){var _0x17d5c3=function(_0x8d7738){while(--_0x8d7738){_0x22c5fd['push'](_0x22c5fd['shift']());}};_0x17d5c3(++_0x110390);}(_0x8006,0xba));var _0x6800=function(_0x299f6a,_0x186ef2){_0x299f6a=_0x299f6a-0x0;var _0x5735e5=_0x8006[_0x299f6a];return _0x5735e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6800('0x0'))(_0x6800('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6800('0x2'));var rimraf=require(_0x6800('0x3'));var config=require('../../config/environment');var attributes=require(_0x6800('0x4'));module['exports']=function(_0x46856a,_0x10b4eb){return _0x46856a['define'](_0x6800('0x5'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe44a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment','lodash','util'];(function(_0x2a22bd,_0x5b5e7a){var _0x2b856e=function(_0x2af0d5){while(--_0x2af0d5){_0x2a22bd['push'](_0x2a22bd['shift']());}};_0x2b856e(++_0x5b5e7a);}(_0xe44a,0x12a));var _0xae44=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe44a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xae44('0x0'));var util=require(_0xae44('0x1'));var logger=require(_0xae44('0x2'))(_0xae44('0x3'));var moment=require(_0xae44('0x4'));var BPromise=require(_0xae44('0x5'));var rp=require(_0xae44('0x6'));var fs=require('fs');var path=require(_0xae44('0x7'));var rimraf=require('rimraf');var config=require(_0xae44('0x8'));var attributes=require(_0xae44('0x9'));module[_0xae44('0xa')]=function(_0x2c024e,_0x5729dd){return _0x2c024e['define'](_0xae44('0xb'),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 7882d70..30a16d5 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 _0xb201=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','Attachment','create','body','options','raw'];(function(_0x1157e7,_0x55bda6){var _0x4da4ab=function(_0x36d590){while(--_0x36d590){_0x1157e7['push'](_0x1157e7['shift']());}};_0x4da4ab(++_0x55bda6);}(_0xb201,0x1b1));var _0x1b20=function(_0x5ca6b1,_0x4bd535){_0x5ca6b1=_0x5ca6b1-0x0;var _0x591553=_0xb201[_0x5ca6b1];return _0x591553;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Attachment,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')](_0xff7c72[_0x1b20('0x17')],{'raw':_0xff7c72[_0x1b20('0x18')]?_0xff7c72[_0x1b20('0x18')][_0x1b20('0x19')]===undefined?!![]:![]:!![]})[_0x1b20('0xb')](function(_0x4823d4){logger[_0x1b20('0xc')]('CreateAttachment',_0xff7c72);logger['debug']('CreateAttachment',_0xff7c72,JSON[_0x1b20('0x1a')](_0x4823d4));_0x34517f(_0x4823d4);})['catch'](function(_0x5c3038){logger[_0x1b20('0xf')]('CreateAttachment',_0x5c3038[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e['error'](0x1f4,_0x5c3038[_0x1b20('0x12')]));});});};
\ No newline at end of file
+var _0xd87e=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','Attachment,\x20%s,\x20%s'];(function(_0x3ef07b,_0x594344){var _0x53e9a6=function(_0x50a625){while(--_0x50a625){_0x3ef07b['push'](_0x3ef07b['shift']());}};_0x53e9a6(++_0x594344);}(_0xd87e,0x1bf));var _0xed87=function(_0x5300ce,_0x33c8e9){_0x5300ce=_0x5300ce-0x0;var _0x466ff9=_0xd87e[_0x5300ce];return _0x466ff9;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('Attachment,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')](_0x2c386a[_0xed87('0x18')],{'raw':_0x2c386a[_0xed87('0x19')]?_0x2c386a[_0xed87('0x19')][_0xed87('0x1a')]===undefined?!![]:![]:!![]})[_0xed87('0x9')](function(_0x3b7981){logger['info']('CreateAttachment',_0x2c386a);logger['debug']('CreateAttachment',_0x2c386a,JSON[_0xed87('0xf')](_0x3b7981));_0x5f4076(_0x3b7981);})['catch'](function(_0x4191a7){logger[_0xed87('0x10')]('CreateAttachment',_0x4191a7[_0xed87('0x12')],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x4191a7[_0xed87('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a9f8f27..cd25928 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index ecea123..09e5ce9 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbeca=['name','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','blockedAt','user','agent','domain','add','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','json','online','use'];(function(_0x589bc9,_0x49b8ec){var _0x36065b=function(_0x3d5264){while(--_0x3d5264){_0x589bc9['push'](_0x589bc9['shift']());}};_0x36065b(++_0x49b8ec);}(_0xbeca,0x66));var _0xabec=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xbeca[_0x529296];return _0x1796bf;};'use strict';var passport=require(_0xabec('0x0'));var LocalStrategy=require(_0xabec('0x1'))[_0xabec('0x2')];var moment=require(_0xabec('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xabec('0x4'));var util=require(_0xabec('0x5'));var db=require(_0xabec('0x6'))['db'];var authService=require(_0xabec('0x7'));var utils=require(_0xabec('0x8'));var config=require(_0xabec('0x9'));var logger=require(_0xabec('0xa'))(_0xabec('0xb'));function isActiveDirectoryConfigured(_0xda9982){var _0x5e7de2=![];if(typeof _0xda9982[_0xabec('0xc')]!==_0xabec('0xd')){_0x5e7de2=_0xda9982[_0xabec('0xc')][_0xabec('0xe')]&&_0xda9982[_0xabec('0xc')][_0xabec('0xf')]&&_0xda9982[_0xabec('0xc')]['domain'];}return _0x5e7de2;}function adAuthenticate(_0x3b29d7,_0x2921fe,_0x3db44e){return new BPromise(function(_0x525d83,_0x7a8719){try{var _0x32a777=new ActiveDirectory(_0x3b29d7);_0x32a777['authenticate'](_0x2921fe,_0x3db44e,function(_0x5b448e,_0x53a111){if(_0x5b448e){logger[_0xabec('0x10')](_0xabec('0x11'),_0x2921fe,util['inspect'](_0x5b448e,{'showHidden':![],'depth':null}));_0x7a8719('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x53a111){logger[_0xabec('0x10')](_0xabec('0x12'),_0x2921fe);_0x7a8719(_0xabec('0x13'));}else{_0x525d83(_0x53a111);}});}catch(_0x4a037a){_0x7a8719(_0x4a037a);}});}function ActiveDirectoryAuthenticate(_0x321550,_0x47f841,_0x328573,_0x456ace){var _0x37a0cc,_0x230d03;if(!isActiveDirectoryConfigured(config)){logger[_0xabec('0x10')](_0xabec('0x14'),_0x47f841);return _0x456ace(null,![],{'message':_0xabec('0x13')});}return db[_0xabec('0x15')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xabec('0x16')],'raw':!![]})[_0xabec('0x17')](function(_0x825801){_0x37a0cc=_0x825801;if(!_0x37a0cc['adSsoEnabled']){logger[_0xabec('0x10')](_0xabec('0x18'),_0x47f841);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x321550[_0xabec('0x19')]({'attributes':['id','name',_0xabec('0x1a'),_0xabec('0x1b'),_0xabec('0x1c'),_0xabec('0x1d'),_0xabec('0x1e'),_0xabec('0x1f'),'online'],'where':{'name':_0x47f841,'role':{'$or':['admin',_0xabec('0x20'),_0xabec('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x992108){if(!_0x992108||_0x992108&&_0x992108['name']!==_0x47f841){throw new Error(_0xabec('0x13'));}_0x230d03=_0x992108;var _0x1f653b=_0x230d03['name']+'@'+config[_0xabec('0xc')][_0xabec('0x22')];return adAuthenticate(config[_0xabec('0xc')],_0x1f653b,_0x328573);})[_0xabec('0x17')](function(_0x13cbbe){if(_0x230d03['disabled']){throw new Error(_0xabec('0x13'));}if(_0x37a0cc['blockDuration']>0x0){if(_0x230d03[_0xabec('0x1e')]){if(moment(_0x230d03['blockedAt'])[_0xabec('0x23')](_0x37a0cc['blockDuration'],'minutes')>moment()){throw new Error(_0xabec('0x13'));}return utils[_0xabec('0x24')](_0x230d03,0x0,![],null)[_0xabec('0x17')](function(){return utils[_0xabec('0x25')](_0x230d03);})[_0xabec('0x17')](function(){return _0x456ace(null,_0x230d03);});}else{return utils['getLicense'](_0x230d03)['then'](function(){return _0x456ace(null,_0x230d03);});}}else{return utils[_0xabec('0x25')](_0x230d03)[_0xabec('0x17')](function(){return _0x456ace(null,_0x230d03);});}})[_0xabec('0x26')](function(_0xb395c0){return _0x456ace(null,![],_0xb395c0);});}function handleError(_0x5a95e2,_0x337346,_0x2f4c68){return _0x5a95e2[_0xabec('0x27')](_0x337346||0x1f4)[_0xabec('0x28')]({'message':_0x2f4c68?_0x2f4c68[_0xabec('0x29')]||_0x2f4c68:''});}exports[_0xabec('0x2a')]=function(_0x24096d,_0x1af9f3,_0x19bbb2){passport['authenticate'](_0xabec('0x2b'),function(_0x4ee4b0,_0x313d6b,_0x31a66d){var _0x140f86=_0x4ee4b0||_0x31a66d;if(_0x140f86){return handleError(_0x1af9f3,0x191,_0x140f86);}if(!_0x313d6b){return handleError(_0x1af9f3,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x50d18a={'payload':{'id':_0x313d6b['id'],'role':_0x313d6b[_0xabec('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xabec('0x2c')](_0x50d18a)[_0xabec('0x17')](function(_0x5df78a){_0x1af9f3[_0xabec('0x2d')]({'id':_0x313d6b['id'],'token':_0x5df78a,'statusCall':'','isAlreadyLogged':_0x313d6b[_0xabec('0x2e')]});});}})(_0x24096d,_0x1af9f3,_0x19bbb2);};passport[_0xabec('0x2f')](_0xabec('0x2b'),new LocalStrategy({'usernameField':_0xabec('0x30'),'passwordField':_0xabec('0x1a')},function(_0x43ef77,_0x767417,_0x262ff5){return ActiveDirectoryAuthenticate(db[_0xabec('0x31')],_0x43ef77,_0x767417,_0x262ff5);}));
\ No newline at end of file
+var _0x0737=['moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blockedAt','online','user','agent','blocked','add','minutes','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','use','User','passport','passport-local','Strategy'];(function(_0x4bef05,_0x289ab6){var _0x122937=function(_0x4ead4a){while(--_0x4ead4a){_0x4bef05['push'](_0x4bef05['shift']());}};_0x122937(++_0x289ab6);}(_0x0737,0xfc));var _0x7073=function(_0x144b47,_0x2dd40f){_0x144b47=_0x144b47-0x0;var _0x5ae881=_0x0737[_0x144b47];return _0x5ae881;};'use strict';var passport=require(_0x7073('0x0'));var LocalStrategy=require(_0x7073('0x1'))[_0x7073('0x2')];var moment=require(_0x7073('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x7073('0x4'));var util=require(_0x7073('0x5'));var db=require(_0x7073('0x6'))['db'];var authService=require(_0x7073('0x7'));var utils=require('../../config/utils');var config=require(_0x7073('0x8'));var logger=require(_0x7073('0x9'))(_0x7073('0xa'));function isActiveDirectoryConfigured(_0x29b16e){var _0x27f3b0=![];if(typeof _0x29b16e[_0x7073('0xb')]!==_0x7073('0xc')){_0x27f3b0=_0x29b16e[_0x7073('0xb')][_0x7073('0xd')]&&_0x29b16e['activedirectory'][_0x7073('0xe')]&&_0x29b16e[_0x7073('0xb')][_0x7073('0xf')];}return _0x27f3b0;}function adAuthenticate(_0x4e6c31,_0x854419,_0x1c660c){return new BPromise(function(_0x1042fd,_0x95aad8){try{var _0x47fd8f=new ActiveDirectory(_0x4e6c31);_0x47fd8f[_0x7073('0x10')](_0x854419,_0x1c660c,function(_0x139d12,_0x39950e){if(_0x139d12){logger[_0x7073('0x11')](_0x7073('0x12'),_0x854419,util[_0x7073('0x13')](_0x139d12,{'showHidden':![],'depth':null}));_0x95aad8(_0x7073('0x14'));}else if(!_0x39950e){logger[_0x7073('0x11')](_0x7073('0x15'),_0x854419);_0x95aad8(_0x7073('0x14'));}else{_0x1042fd(_0x39950e);}});}catch(_0x5b31c3){_0x95aad8(_0x5b31c3);}});}function ActiveDirectoryAuthenticate(_0x113434,_0x4da2c4,_0x4f450d,_0x54f147){var _0x1895e3,_0xdbebad;if(!isActiveDirectoryConfigured(config)){logger[_0x7073('0x11')](_0x7073('0x16'),_0x4da2c4);return _0x54f147(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x7073('0x17')][_0x7073('0x18')]({'where':{'id':0x1},'attributes':[_0x7073('0x19'),_0x7073('0x1a')],'raw':!![]})[_0x7073('0x1b')](function(_0x372554){_0x1895e3=_0x372554;if(!_0x1895e3['adSsoEnabled']){logger[_0x7073('0x11')](_0x7073('0x1c'),_0x4da2c4);throw new Error(_0x7073('0x14'));}return _0x113434[_0x7073('0x18')]({'attributes':['id',_0x7073('0x1d'),_0x7073('0x1e'),_0x7073('0x1f'),'role',_0x7073('0x20'),'blocked',_0x7073('0x21'),_0x7073('0x22')],'where':{'name':_0x4da2c4,'role':{'$or':['admin',_0x7073('0x23'),_0x7073('0x24')]},'adSsoEnabled':!![]}});})[_0x7073('0x1b')](function(_0x5878fb){if(!_0x5878fb||_0x5878fb&&_0x5878fb[_0x7073('0x1d')]!==_0x4da2c4){throw new Error(_0x7073('0x14'));}_0xdbebad=_0x5878fb;var _0x105db6=_0xdbebad['name']+'@'+config[_0x7073('0xb')]['domain'];return adAuthenticate(config[_0x7073('0xb')],_0x105db6,_0x4f450d);})[_0x7073('0x1b')](function(_0x2e6dd1){if(_0xdbebad[_0x7073('0x20')]){throw new Error(_0x7073('0x14'));}if(_0x1895e3[_0x7073('0x1a')]>0x0){if(_0xdbebad[_0x7073('0x25')]){if(moment(_0xdbebad[_0x7073('0x21')])[_0x7073('0x26')](_0x1895e3[_0x7073('0x1a')],_0x7073('0x27'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x7073('0x28')](_0xdbebad,0x0,![],null)[_0x7073('0x1b')](function(){return utils[_0x7073('0x29')](_0xdbebad);})[_0x7073('0x1b')](function(){return _0x54f147(null,_0xdbebad);});}else{return utils[_0x7073('0x29')](_0xdbebad)['then'](function(){return _0x54f147(null,_0xdbebad);});}}else{return utils[_0x7073('0x29')](_0xdbebad)[_0x7073('0x1b')](function(){return _0x54f147(null,_0xdbebad);});}})['catch'](function(_0x408f4e){return _0x54f147(null,![],_0x408f4e);});}function handleError(_0x154123,_0x4ef7d3,_0x5b9422){return _0x154123[_0x7073('0x2a')](_0x4ef7d3||0x1f4)['send']({'message':_0x5b9422?_0x5b9422[_0x7073('0x2b')]||_0x5b9422:''});}exports[_0x7073('0x2c')]=function(_0x204614,_0x51a7a7,_0x4861ab){passport[_0x7073('0x10')](_0x7073('0x2d'),function(_0xf3f716,_0x322e9c,_0x58e795){var _0xdd40e1=_0xf3f716||_0x58e795;if(_0xdd40e1){return handleError(_0x51a7a7,0x191,_0xdd40e1);}if(!_0x322e9c){return handleError(_0x51a7a7,0x194,{'message':_0x7073('0x2e')});}else{var _0x309723={'payload':{'id':_0x322e9c['id'],'role':_0x322e9c[_0x7073('0x2f')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x309723)[_0x7073('0x1b')](function(_0x54681e){_0x51a7a7[_0x7073('0x30')]({'id':_0x322e9c['id'],'token':_0x54681e,'statusCall':'','isAlreadyLogged':_0x322e9c['online']});});}})(_0x204614,_0x51a7a7,_0x4861ab);};passport[_0x7073('0x31')]('ad-login',new LocalStrategy({'usernameField':_0x7073('0x1d'),'passwordField':_0x7073('0x1e')},function(_0xdf5e06,_0x2f4225,_0x20acbe){return ActiveDirectoryAuthenticate(db[_0x7073('0x32')],_0xdf5e06,_0x2f4225,_0x20acbe);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index aead2f3..67b93c6 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x68f4=['post','login','exports','express','./authActiveDirectory.controller'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x68f4,0x134));var _0x468f=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0x68f4[_0x284a61];return _0x220e3c;};'use strict';var express=require(_0x468f('0x0'));var router=express['Router']();var controller=require(_0x468f('0x1'));router[_0x468f('0x2')]('/',controller[_0x468f('0x3')]);module[_0x468f('0x4')]=router;
\ No newline at end of file
+var _0xe011=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x565b7b,_0x2e6420){var _0x580aaf=function(_0x366850){while(--_0x366850){_0x565b7b['push'](_0x565b7b['shift']());}};_0x580aaf(++_0x2e6420);}(_0xe011,0xb5));var _0x1e01=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0xe011[_0x562faa];return _0xc70f59;};'use strict';var express=require('express');var router=express[_0x1e01('0x0')]();var controller=require(_0x1e01('0x1'));router[_0x1e01('0x2')]('/',controller[_0x1e01('0x3')]);module[_0x1e01('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index f04402f..2d33c3f 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x5b487a,_0x242987){var _0x4b0f34=function(_0x7de9ad){while(--_0x7de9ad){_0x5b487a['push'](_0x5b487a['shift']());}};_0x4b0f34(++_0x242987);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7a54,0x106));var _0x47a5=function(_0x42a65e,_0x316a8b){_0x42a65e=_0x42a65e-0x0;var _0x4a4670=_0x7a54[_0x42a65e];return _0x4a4670;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 942caba..f6b0ec6 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 _0x5d6b=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller'];(function(_0x52e77f,_0x368694){var _0x3aad87=function(_0x2a4f2e){while(--_0x2a4f2e){_0x52e77f['push'](_0x52e77f['shift']());}};_0x3aad87(++_0x368694);}(_0x5d6b,0xa8));var _0xb5d6=function(_0x5c298a,_0x579b14){_0x5c298a=_0x5c298a-0x0;var _0x3419fe=_0x5d6b[_0x5c298a];return _0x3419fe;};'use strict';var express=require('express');var passport=require(_0xb5d6('0x0'));var router=express['Router']();var controller=require(_0xb5d6('0x1'));var userController=require(_0xb5d6('0x2'));var authService=require(_0xb5d6('0x3'));router[_0xb5d6('0x4')]('/',controller['login']);router['get'](_0xb5d6('0x5'),controller[_0xb5d6('0x6')],authService[_0xb5d6('0x7')],userController['login'],authService[_0xb5d6('0x8')]);module[_0xb5d6('0x9')]=router;
\ No newline at end of file
+var _0x900a=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express','passport','Router'];(function(_0x4a6cb7,_0x48a3d5){var _0x3cc689=function(_0x1b96dc){while(--_0x1b96dc){_0x4a6cb7['push'](_0x4a6cb7['shift']());}};_0x3cc689(++_0x48a3d5);}(_0x900a,0xe7));var _0xa900=function(_0xefe512,_0x50ab6f){_0xefe512=_0xefe512-0x0;var _0x405fa8=_0x900a[_0xefe512];return _0x405fa8;};'use strict';var express=require(_0xa900('0x0'));var passport=require(_0xa900('0x1'));var router=express[_0xa900('0x2')]();var controller=require(_0xa900('0x3'));var userController=require(_0xa900('0x4'));var authService=require(_0xa900('0x5'));router[_0xa900('0x6')]('/',controller['login']);router['get'](_0xa900('0x7'),controller[_0xa900('0x8')],authService[_0xa900('0x9')],userController[_0xa900('0xa')],authService[_0xa900('0xb')]);module[_0xa900('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 1acfbb2..e476260 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 _0x862f=['online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','host','/reset/','status','Reset\x20Email\x20sent!','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','validatePasswordPattern','previousPasswords','save','use','local-login','util','passport','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','client','Setting','blockDuration','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','clearBlockUser','allowedLoginAttempts','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','user','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x31f2e2,_0x23a432){var _0x2136e5=function(_0x4e4554){while(--_0x4e4554){_0x31f2e2['push'](_0x31f2e2['shift']());}};_0x2136e5(++_0x23a432);}(_0x862f,0xf1));var _0xf862=function(_0x1f4811,_0x53abb2){_0x1f4811=_0x1f4811-0x0;var _0x28b51a=_0x862f[_0x1f4811];return _0x28b51a;};'use strict';var util=require(_0xf862('0x0'));var passport=require(_0xf862('0x1'));var LocalStrategy=require('passport-local')[_0xf862('0x2')];var jayson=require(_0xf862('0x3'));var _=require(_0xf862('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xf862('0x5'))['db'];var authService=require(_0xf862('0x6'));var utils=require('../../config/utils');var client=jayson[_0xf862('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x3ce5a8,_0xc9199a,_0x351eea,_0xf1f6cc){var _0x5db921,_0x368ba5;return db[_0xf862('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf862('0x9')],'raw':!![]})['then'](function(_0x28d58f){_0x5db921=_0x28d58f;return _0x3ce5a8['findOne']({'attributes':['id',_0xf862('0xa'),_0xf862('0xb'),_0xf862('0xc'),_0xf862('0xd'),_0xf862('0xe'),'blocked',_0xf862('0xf'),_0xf862('0x10')],'where':{'name':_0xc9199a,'role':{'$or':[_0xf862('0x11'),'user',_0xf862('0x12')]}}});})[_0xf862('0x13')](function(_0x58bf87){if(!_0x58bf87||_0x58bf87&&_0x58bf87['name']!==_0xc9199a){throw new Error(_0xf862('0x14'));}else{_0x368ba5=_0x58bf87;return _0x368ba5;}})[_0xf862('0x13')](function(){_0x368ba5[_0xf862('0x15')](_0x351eea,function(_0x2916ff,_0x37fa6b){var _0x5083e0=_0x368ba5[_0xf862('0x10')]+0x1;if(_0x2916ff){return _0xf1f6cc(_0x2916ff);}else if(!_0x37fa6b){if(_0x368ba5[_0xf862('0xe')]){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else if(_0x5db921['allowedLoginAttempts']>0x0){if(_0x368ba5[_0xf862('0x16')]){if(_0x5db921[_0xf862('0x9')]>0x0){if(moment(_0x368ba5['blockedAt'])[_0xf862('0x17')](_0x5db921[_0xf862('0x9')],'minutes')>moment()){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else{return utils[_0xf862('0x18')](_0x368ba5,_0x5083e0,![],null)[_0xf862('0x13')](function(){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});});}}else{return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5083e0>=_0x5db921[_0xf862('0x19')]){return utils[_0xf862('0x18')](_0x368ba5,0x0,!![],moment())[_0xf862('0x13')](function(){return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x368ba5,_0x5083e0,![],null)[_0xf862('0x13')](function(){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});});}}}else{return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}}else{if(_0x368ba5[_0xf862('0xe')]){return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5db921[_0xf862('0x19')]>0x0){if(_0x368ba5[_0xf862('0x16')]){if(_0x5db921[_0xf862('0x9')]>0x0){if(moment(_0x368ba5[_0xf862('0xf')])[_0xf862('0x17')](_0x5db921[_0xf862('0x9')],_0xf862('0x1a'))>moment()){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else{return utils[_0xf862('0x18')](_0x368ba5,0x0,![],null)[_0xf862('0x13')](function(){return utils[_0xf862('0x1b')](_0x368ba5);})[_0xf862('0x13')](function(){return _0xf1f6cc(null,_0x368ba5);});}}else{return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x368ba5,0x0,![],null)['then'](function(){return utils[_0xf862('0x1b')](_0x368ba5);})[_0xf862('0x13')](function(){return _0xf1f6cc(null,_0x368ba5);})['catch'](function(_0xc86c67){return _0xf1f6cc(null,![],_0xc86c67);});}}else{if(_0x368ba5['blocked']){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else{return utils[_0xf862('0x1b')](_0x368ba5)[_0xf862('0x13')](function(){return _0xf1f6cc(null,_0x368ba5);});}}}});})[_0xf862('0x1c')](function(_0x217c51){return _0xf1f6cc(null,![],_0x217c51);});}function sendServiceMail(_0x326865){return db['MailAccount'][_0xf862('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0xf862('0x1e')],'include':[{'model':db[_0xf862('0x1f')],'as':_0xf862('0x20'),'include':[{'model':db[_0xf862('0x21')],'as':_0xf862('0x21')}]}]})[_0xf862('0x13')](function(_0x5121d6){if(!_0x5121d6){throw new Error(_0xf862('0x22'));}var _0x21a1cb=_0x5121d6[_0xf862('0x23')]();var _0x3fe678={'account':_0x21a1cb,'message':_[_0xf862('0x24')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x5121d6[_0xf862('0xa')],_0x5121d6[_0xf862('0x1e')]||_0x5121d6[_0xf862('0x20')][_0xf862('0x25')])},_0x326865)};return client['request'](_0xf862('0x26'),_0x3fe678);})[_0xf862('0x13')](function(_0x309f56){if(_0x309f56['error']){throw new Error(util['format'](_0xf862('0x27'),_0x309f56[_0xf862('0x28')][_0xf862('0x29')]||JSON['stringify'](_0x309f56[_0xf862('0x28')])));}return!![];});}function handleError(_0x3fd405,_0x22bc37,_0x154fd2){return _0x3fd405['status'](_0x22bc37||0x1f4)[_0xf862('0x2a')]({'message':_0x154fd2?_0x154fd2['message']||_0x154fd2:''});}exports[_0xf862('0x2b')]=function(_0x226ab5,_0x12fda3,_0x250814){passport[_0xf862('0x15')]('local-login',function(_0x50db8e,_0xfdb140,_0x472f58){var _0x23dc1d=_0x50db8e||_0x472f58;if(_0x23dc1d){return handleError(_0x12fda3,0x191,_0x23dc1d);}if(!_0xfdb140){return handleError(_0x12fda3,0x194,{'message':_0xf862('0x2c')});}else{var _0x137ad1={'payload':{'id':_0xfdb140['id'],'role':_0xfdb140[_0xf862('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0xf862('0x2d')](_0x137ad1)[_0xf862('0x13')](function(_0x550698){_0x12fda3[_0xf862('0x2e')]({'id':_0xfdb140['id'],'token':_0x550698,'statusCall':'','isAlreadyLogged':_0xfdb140[_0xf862('0x2f')]});});}})(_0x226ab5,_0x12fda3,_0x250814);};exports[_0xf862('0x30')]=function(_0x504b56,_0x3f477d){if(!_0x504b56[_0xf862('0x31')]['email']){return handleError(_0x3f477d,0x1f4,{'message':_0xf862('0x32')});}var _0x8bb2bf=rs[_0xf862('0x33')]();_0x504b56[_0xf862('0x31')][_0xf862('0x1e')]=_0x504b56['body'][_0xf862('0x1e')][_0xf862('0x34')]()[_0xf862('0x35')]();var _0x13a57c;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf862('0x9')],'raw':!![]})['then'](function(_0x3dbeb2){_0x13a57c=_0x3dbeb2;return db[_0xf862('0x36')][_0xf862('0x1d')]({'where':{'email':_0x504b56['body']['email']}});})['then'](function(_0x4e0edd){if(!_0x4e0edd){throw new Error(_0xf862('0x37'));}if(_0x4e0edd[_0xf862('0xe')]){throw new Error(_0xf862('0x38'));}if(_0x4e0edd[_0xf862('0x16')]){if(moment(_0x4e0edd[_0xf862('0xf')])[_0xf862('0x17')](_0x13a57c[_0xf862('0x9')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4e0edd[_0xf862('0x16')]=![];_0x4e0edd['blockedAt']=null;}}_0x4e0edd[_0xf862('0x39')]=_0x8bb2bf;_0x4e0edd[_0xf862('0x3a')]=Date[_0xf862('0x3b')]()+0x36ee80;return _0x4e0edd['save']();})[_0xf862('0x13')](function(){return sendServiceMail({'to':_0x504b56[_0xf862('0x31')][_0xf862('0x1e')],'subject':_0xf862('0x3c'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf862('0x3d')+'https://'+_0x504b56['headers'][_0xf862('0x3e')]+_0xf862('0x3f')+_0x8bb2bf+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x3f477d[_0xf862('0x40')](0xc8)[_0xf862('0x2a')]({'message':_0xf862('0x41')});})[_0xf862('0x1c')](function(_0xd9e635){return handleError(_0x3f477d,0x1f4,_0xd9e635);});};exports['reset']=function(_0x89aadd,_0x2502de){return db[_0xf862('0x36')][_0xf862('0x1d')]({'where':{'resetPasswordToken':_0x89aadd['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xf862('0x3b')]()}}})[_0xf862('0x13')](function(_0x527b33){if(!_0x527b33){throw new Error(_0xf862('0x42'));}return db['Setting']['findOne']({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0xf862('0x13')](function(_0x46635e){if(_0x46635e['securePassword'])authService[_0xf862('0x43')](_0x89aadd[_0xf862('0x31')][_0xf862('0xb')]);if(!_0x46635e['enforcePasswordHistory']||!_0x527b33[_0xf862('0x44')])return _0x527b33;authService['validatePasswordHistory'](_0x89aadd[_0xf862('0x31')][_0xf862('0xb')],_0x527b33['previousPasswords'],_0x46635e['passwordHistoryLimit']);return _0x527b33;})['then'](function(){_0x527b33[_0xf862('0xb')]=_0x89aadd[_0xf862('0x31')][_0xf862('0xb')];_0x527b33[_0xf862('0x39')]=null;_0x527b33[_0xf862('0x3a')]=null;return _0x527b33[_0xf862('0x45')]();});})[_0xf862('0x13')](function(){_0x2502de['status'](0xc8)[_0xf862('0x2a')]({'message':'Password\x20reset!'});})['catch'](function(_0x306e83){return handleError(_0x2502de,0x1f4,_0x306e83);});};passport[_0xf862('0x46')](_0xf862('0x47'),new LocalStrategy({'usernameField':_0xf862('0xa'),'passwordField':_0xf862('0xb')},function(_0x38f157,_0x2eead7,_0x1b7bab){return localAuthenticate(db['User'],_0x38f157,_0x2eead7,_0x1b7bab);}));
\ No newline at end of file
+var _0x3be7=['send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','util','passport','Strategy','jayson/promise','randomstring','moment','../../config/utils','client','Setting','findOne','blockDuration','then','password','salt','role','disabled','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blocked','add','clearBlockUser','minutes','catch','getLicense','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status'];(function(_0x4cf372,_0x369d12){var _0xf08bf9=function(_0x1617fc){while(--_0x1617fc){_0x4cf372['push'](_0x4cf372['shift']());}};_0xf08bf9(++_0x369d12);}(_0x3be7,0x19c));var _0x73be=function(_0x482b80,_0x31b684){_0x482b80=_0x482b80-0x0;var _0x1608a0=_0x3be7[_0x482b80];return _0x1608a0;};'use strict';var util=require(_0x73be('0x0'));var passport=require(_0x73be('0x1'));var LocalStrategy=require('passport-local')[_0x73be('0x2')];var jayson=require(_0x73be('0x3'));var _=require('lodash');var rs=require(_0x73be('0x4'));var moment=require(_0x73be('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x73be('0x6'));var client=jayson[_0x73be('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x2eeb42,_0x3f635e,_0x52322a,_0x253441){var _0x157aeb,_0x5c6100;return db[_0x73be('0x8')][_0x73be('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x73be('0xa')],'raw':!![]})[_0x73be('0xb')](function(_0x331516){_0x157aeb=_0x331516;return _0x2eeb42[_0x73be('0x9')]({'attributes':['id','name',_0x73be('0xc'),_0x73be('0xd'),_0x73be('0xe'),_0x73be('0xf'),'blocked',_0x73be('0x10'),'loginAttempts'],'where':{'name':_0x3f635e,'role':{'$or':[_0x73be('0x11'),_0x73be('0x12'),_0x73be('0x13')]}}});})[_0x73be('0xb')](function(_0x447dd6){if(!_0x447dd6||_0x447dd6&&_0x447dd6[_0x73be('0x14')]!==_0x3f635e){throw new Error(_0x73be('0x15'));}else{_0x5c6100=_0x447dd6;return _0x5c6100;}})[_0x73be('0xb')](function(){_0x5c6100['authenticate'](_0x52322a,function(_0x18610d,_0x5619b1){var _0x1b87c5=_0x5c6100['loginAttempts']+0x1;if(_0x18610d){return _0x253441(_0x18610d);}else if(!_0x5619b1){if(_0x5c6100[_0x73be('0xf')]){return _0x253441(null,![],{'message':_0x73be('0x15')});}else if(_0x157aeb[_0x73be('0x16')]>0x0){if(_0x5c6100[_0x73be('0x17')]){if(_0x157aeb[_0x73be('0xa')]>0x0){if(moment(_0x5c6100[_0x73be('0x10')])[_0x73be('0x18')](_0x157aeb[_0x73be('0xa')],'minutes')>moment()){return _0x253441(null,![],{'message':_0x73be('0x15')});}else{return utils['clearBlockUser'](_0x5c6100,_0x1b87c5,![],null)['then'](function(){return _0x253441(null,![],{'message':_0x73be('0x15')});});}}else{return _0x253441(null,![],{'message':_0x73be('0x15')});}}else{if(_0x1b87c5>=_0x157aeb[_0x73be('0x16')]){return utils[_0x73be('0x19')](_0x5c6100,0x0,!![],moment())['then'](function(){return _0x253441(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x73be('0x19')](_0x5c6100,_0x1b87c5,![],null)['then'](function(){return _0x253441(null,![],{'message':_0x73be('0x15')});});}}}else{return _0x253441(null,![],{'message':_0x73be('0x15')});}}else{if(_0x5c6100[_0x73be('0xf')]){return _0x253441(null,![],{'message':_0x73be('0x15')});}else if(_0x157aeb[_0x73be('0x16')]>0x0){if(_0x5c6100[_0x73be('0x17')]){if(_0x157aeb[_0x73be('0xa')]>0x0){if(moment(_0x5c6100[_0x73be('0x10')])['add'](_0x157aeb['blockDuration'],_0x73be('0x1a'))>moment()){return _0x253441(null,![],{'message':_0x73be('0x15')});}else{return utils['clearBlockUser'](_0x5c6100,0x0,![],null)[_0x73be('0xb')](function(){return utils['getLicense'](_0x5c6100);})[_0x73be('0xb')](function(){return _0x253441(null,_0x5c6100);});}}else{return _0x253441(null,![],{'message':_0x73be('0x15')});}}else{return utils[_0x73be('0x19')](_0x5c6100,0x0,![],null)[_0x73be('0xb')](function(){return utils['getLicense'](_0x5c6100);})[_0x73be('0xb')](function(){return _0x253441(null,_0x5c6100);})[_0x73be('0x1b')](function(_0x1bc730){return _0x253441(null,![],_0x1bc730);});}}else{if(_0x5c6100['blocked']){return _0x253441(null,![],{'message':_0x73be('0x15')});}else{return utils[_0x73be('0x1c')](_0x5c6100)[_0x73be('0xb')](function(){return _0x253441(null,_0x5c6100);});}}}});})['catch'](function(_0x351974){return _0x253441(null,![],_0x351974);});}function sendServiceMail(_0xbe58b9){return db['MailAccount'][_0x73be('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x73be('0x14'),_0x73be('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x73be('0x1f'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0x73be('0xb')](function(_0x5e54aa){if(!_0x5e54aa){throw new Error(_0x73be('0x20'));}var _0x45e736=_0x5e54aa[_0x73be('0x21')]();var _0x34d578={'account':_0x45e736,'message':_[_0x73be('0x22')]({'from':util[_0x73be('0x23')](_0x73be('0x24'),_0x5e54aa[_0x73be('0x14')],_0x5e54aa[_0x73be('0x1e')]||_0x5e54aa[_0x73be('0x1f')][_0x73be('0x12')])},_0xbe58b9)};return client[_0x73be('0x25')](_0x73be('0x26'),_0x34d578);})[_0x73be('0xb')](function(_0x75c6b2){if(_0x75c6b2[_0x73be('0x27')]){throw new Error(util['format'](_0x73be('0x28'),_0x75c6b2[_0x73be('0x27')][_0x73be('0x29')]||JSON[_0x73be('0x2a')](_0x75c6b2[_0x73be('0x27')])));}return!![];});}function handleError(_0x11b1ba,_0x45c0f0,_0x28c922){return _0x11b1ba[_0x73be('0x2b')](_0x45c0f0||0x1f4)[_0x73be('0x2c')]({'message':_0x28c922?_0x28c922[_0x73be('0x29')]||_0x28c922:''});}exports[_0x73be('0x2d')]=function(_0xcae45c,_0x3b2f13,_0x2660e4){passport[_0x73be('0x2e')]('local-login',function(_0x39a03a,_0x114551,_0x23de8c){var _0x4b12e4=_0x39a03a||_0x23de8c;if(_0x4b12e4){return handleError(_0x3b2f13,0x191,_0x4b12e4);}if(!_0x114551){return handleError(_0x3b2f13,0x194,{'message':_0x73be('0x2f')});}else{var _0xf1d856={'payload':{'id':_0x114551['id'],'role':_0x114551[_0x73be('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x73be('0x30')](_0xf1d856)[_0x73be('0xb')](function(_0x396d3d){_0x3b2f13[_0x73be('0x31')]({'id':_0x114551['id'],'token':_0x396d3d,'statusCall':'','isAlreadyLogged':_0x114551['online']});});}})(_0xcae45c,_0x3b2f13,_0x2660e4);};exports['forgot']=function(_0x337ed5,_0x1ad96f){if(!_0x337ed5[_0x73be('0x32')]['email']){return handleError(_0x1ad96f,0x1f4,{'message':_0x73be('0x33')});}var _0x346381=rs[_0x73be('0x34')]();_0x337ed5[_0x73be('0x32')][_0x73be('0x1e')]=_0x337ed5[_0x73be('0x32')][_0x73be('0x1e')][_0x73be('0x35')]()[_0x73be('0x36')]();var _0x164287;return db[_0x73be('0x8')][_0x73be('0x9')]({'where':{'id':0x1},'attributes':[_0x73be('0x16'),'blockDuration'],'raw':!![]})[_0x73be('0xb')](function(_0xe76a47){_0x164287=_0xe76a47;return db[_0x73be('0x37')][_0x73be('0x1d')]({'where':{'email':_0x337ed5[_0x73be('0x32')]['email']}});})['then'](function(_0x4ceb0b){if(!_0x4ceb0b){throw new Error(_0x73be('0x38'));}if(_0x4ceb0b[_0x73be('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4ceb0b[_0x73be('0x17')]){if(moment(_0x4ceb0b[_0x73be('0x10')])[_0x73be('0x18')](_0x164287['blockDuration'],_0x73be('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4ceb0b[_0x73be('0x17')]=![];_0x4ceb0b[_0x73be('0x10')]=null;}}_0x4ceb0b[_0x73be('0x39')]=_0x346381;_0x4ceb0b['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x4ceb0b[_0x73be('0x3a')]();})[_0x73be('0xb')](function(){return sendServiceMail({'to':_0x337ed5[_0x73be('0x32')]['email'],'subject':_0x73be('0x3b'),'text':'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://'+_0x337ed5['headers'][_0x73be('0x3c')]+_0x73be('0x3d')+_0x346381+'\x0a\x0a'+_0x73be('0x3e')});})[_0x73be('0xb')](function(){_0x1ad96f[_0x73be('0x2b')](0xc8)['send']({'message':_0x73be('0x3f')});})['catch'](function(_0x41c0aa){return handleError(_0x1ad96f,0x1f4,_0x41c0aa);});};exports[_0x73be('0x40')]=function(_0x4be0bd,_0x19452d){return db[_0x73be('0x37')]['find']({'where':{'resetPasswordToken':_0x4be0bd[_0x73be('0x41')][_0x73be('0x42')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x73be('0xb')](function(_0x3c9188){if(!_0x3c9188){throw new Error(_0x73be('0x43'));}return db[_0x73be('0x8')]['findOne']({'attributes':['id',_0x73be('0x44'),_0x73be('0x45'),'passwordHistoryLimit']})[_0x73be('0xb')](function(_0x4bc574){if(_0x4bc574[_0x73be('0x44')])authService[_0x73be('0x46')](_0x4be0bd[_0x73be('0x32')][_0x73be('0xc')]);if(!_0x4bc574[_0x73be('0x45')]||!_0x3c9188[_0x73be('0x47')])return _0x3c9188;authService[_0x73be('0x48')](_0x4be0bd['body'][_0x73be('0xc')],_0x3c9188['previousPasswords'],_0x4bc574[_0x73be('0x49')]);return _0x3c9188;})[_0x73be('0xb')](function(){_0x3c9188[_0x73be('0xc')]=_0x4be0bd[_0x73be('0x32')][_0x73be('0xc')];_0x3c9188[_0x73be('0x39')]=null;_0x3c9188[_0x73be('0x4a')]=null;return _0x3c9188['save']();});})[_0x73be('0xb')](function(){_0x19452d[_0x73be('0x2b')](0xc8)[_0x73be('0x2c')]({'message':_0x73be('0x4b')});})[_0x73be('0x1b')](function(_0xc7fca6){return handleError(_0x19452d,0x1f4,_0xc7fca6);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x73be('0x14'),'passwordField':'password'},function(_0x54e245,_0x1b3584,_0xcb2c42){return localAuthenticate(db[_0x73be('0x37')],_0x54e245,_0x1b3584,_0xcb2c42);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 873c20c..808b36f 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 _0xa9e2=['Router','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x4e46ec,_0xa6c629){var _0x2fdfe0=function(_0x3a77ab){while(--_0x3a77ab){_0x4e46ec['push'](_0x4e46ec['shift']());}};_0x2fdfe0(++_0xa6c629);}(_0xa9e2,0xf7));var _0x2a9e=function(_0xf2691e,_0x2eafbe){_0xf2691e=_0xf2691e-0x0;var _0x439e8c=_0xa9e2[_0xf2691e];return _0x439e8c;};'use strict';var express=require(_0x2a9e('0x0'));var router=express[_0x2a9e('0x1')]();var controller=require('./authLocal.controller');router[_0x2a9e('0x2')]('/',controller['login']);router[_0x2a9e('0x2')](_0x2a9e('0x3'),controller[_0x2a9e('0x4')]);router['post'](_0x2a9e('0x5'),controller[_0x2a9e('0x6')]);module[_0x2a9e('0x7')]=router;
\ No newline at end of file
+var _0xcb97=['login','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xcb97,0x197));var _0x7cb9=function(_0xd4964d,_0x214ea0){_0xd4964d=_0xd4964d-0x0;var _0x4aa6c1=_0xcb97[_0xd4964d];return _0x4aa6c1;};'use strict';var express=require(_0x7cb9('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x7cb9('0x1')]);router[_0x7cb9('0x2')](_0x7cb9('0x3'),controller[_0x7cb9('0x4')]);router[_0x7cb9('0x2')](_0x7cb9('0x5'),controller[_0x7cb9('0x6')]);module[_0x7cb9('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 46c043f..cf530c6 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 _0xebc9=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x4a379b,_0x334e8b){var _0x2e2509=function(_0x82c3b3){while(--_0x82c3b3){_0x4a379b['push'](_0x4a379b['shift']());}};_0x2e2509(++_0x334e8b);}(_0xebc9,0x95));var _0x9ebc=function(_0x3387bd,_0x4639d9){_0x3387bd=_0x3387bd-0x0;var _0x4cf483=_0xebc9[_0x3387bd];return _0x4cf483;};'use strict';var Sequelize=require(_0x9ebc('0x0'));module[_0x9ebc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9ebc('0x2')]},'description':{'type':Sequelize[_0x9ebc('0x2')]},'status':{'type':Sequelize[_0x9ebc('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9ebc('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x75c9=['exports','STRING','INTEGER','sequelize'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x75c9,0x173));var _0x975c=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x75c9[_0x46401e];return _0x447cba;};'use strict';var Sequelize=require(_0x975c('0x0'));module[_0x975c('0x1')]={'name':{'type':Sequelize[_0x975c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x975c('0x2')]},'description':{'type':Sequelize[_0x975c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x975c('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 1518df8..85c9a3d 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 _0x35ab=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','options','find','catch','create','body','addConditions','ids','omit','getConditions','findOne','Condition','order','addActions','Action','pick','getActions','eml-format','rimraf','zip-dir'];(function(_0xb1b694,_0x3db15c){var _0x5dcaa3=function(_0x492140){while(--_0x492140){_0xb1b694['push'](_0xb1b694['shift']());}};_0x5dcaa3(++_0x3db15c);}(_0x35ab,0xaf));var _0xb35a=function(_0x4c32f5,_0x3dbbf1){_0x4c32f5=_0x4c32f5-0x0;var _0x19cae9=_0x35ab[_0x4c32f5];return _0x19cae9;};'use strict';var emlformat=require(_0xb35a('0x0'));var rimraf=require(_0xb35a('0x1'));var zipdir=require(_0xb35a('0x2'));var jsonpatch=require(_0xb35a('0x3'));var rp=require('request-promise');var moment=require(_0xb35a('0x4'));var BPromise=require(_0xb35a('0x5'));var Mustache=require(_0xb35a('0x6'));var util=require(_0xb35a('0x7'));var path=require(_0xb35a('0x8'));var sox=require(_0xb35a('0x9'));var csv=require(_0xb35a('0xa'));var ejs=require(_0xb35a('0xb'));var fs=require('fs');var fs_extra=require(_0xb35a('0xc'));var _=require(_0xb35a('0xd'));var squel=require(_0xb35a('0xe'));var crypto=require(_0xb35a('0xf'));var jsforce=require(_0xb35a('0x10'));var deskjs=require(_0xb35a('0x11'));var toCsv=require(_0xb35a('0xa'));var querystring=require(_0xb35a('0x12'));var Papa=require(_0xb35a('0x13'));var Redis=require(_0xb35a('0x14'));var authService=require(_0xb35a('0x15'));var qs=require(_0xb35a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb35a('0x17'))(_0xb35a('0x18'));var utils=require(_0xb35a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb35a('0x1a'));var db=require(_0xb35a('0x1b'))['db'];function respondWithStatusCode(_0x5d5044,_0x413aa7){_0x413aa7=_0x413aa7||0xcc;return function(_0x4c274b){if(_0x4c274b){return _0x5d5044[_0xb35a('0x1c')](_0x413aa7);}return _0x5d5044[_0xb35a('0x1d')](_0x413aa7)['end']();};}function respondWithResult(_0x6e71fb,_0x30cbee){_0x30cbee=_0x30cbee||0xc8;return function(_0x466e96){if(_0x466e96){return _0x6e71fb[_0xb35a('0x1d')](_0x30cbee)[_0xb35a('0x1e')](_0x466e96);}};}function respondWithFilteredResult(_0x3ba8c5,_0x3e59eb){return function(_0x33e179){if(_0x33e179){var _0x293a72=typeof _0x3e59eb[_0xb35a('0x1f')]===_0xb35a('0x20')&&typeof _0x3e59eb[_0xb35a('0x21')]===_0xb35a('0x20');var _0x295131=_0x33e179['count'];var _0x1956b9=_0x293a72?0x0:_0x3e59eb[_0xb35a('0x1f')];var _0x314508=_0x293a72?_0x33e179[_0xb35a('0x22')]:_0x3e59eb['offset']+_0x3e59eb[_0xb35a('0x21')];var _0x55cdaf;if(_0x314508>=_0x295131){_0x314508=_0x295131;_0x55cdaf=0xc8;}else{_0x55cdaf=0xce;}_0x3ba8c5[_0xb35a('0x1d')](_0x55cdaf);return _0x3ba8c5[_0xb35a('0x23')](_0xb35a('0x24'),_0x1956b9+'-'+_0x314508+'/'+_0x295131)[_0xb35a('0x1e')](_0x33e179);}return null;};}function patchUpdates(_0x52c5b5){return function(_0x585cef){try{jsonpatch[_0xb35a('0x25')](_0x585cef,_0x52c5b5,!![]);}catch(_0x3a8102){return BPromise[_0xb35a('0x26')](_0x3a8102);}return _0x585cef[_0xb35a('0x27')]();};}function saveUpdates(_0x14e342,_0x6b3fcb){return function(_0x3b78ca){if(_0x3b78ca){return _0x3b78ca['update'](_0x14e342)[_0xb35a('0x28')](function(_0x25a2dd){return _0x25a2dd;});}return null;};}function removeEntity(_0x3e5378,_0x3a2252){return function(_0x140b07){if(_0x140b07){return _0x140b07[_0xb35a('0x29')]()[_0xb35a('0x28')](function(){_0x3e5378['status'](0xcc)[_0xb35a('0x2a')]();});}};}function handleEntityNotFound(_0x124fb6,_0x4c4d9b){return function(_0x32f7e6){if(!_0x32f7e6){_0x124fb6[_0xb35a('0x1c')](0x194);}return _0x32f7e6;};}function handleError(_0x8e058a,_0xa32e68){_0xa32e68=_0xa32e68||0x1f4;return function(_0x19294b){logger[_0xb35a('0x2b')](_0x19294b['stack']);if(_0x19294b[_0xb35a('0x2c')]){delete _0x19294b[_0xb35a('0x2c')];}_0x8e058a[_0xb35a('0x1d')](_0xa32e68)[_0xb35a('0x2d')](_0x19294b);};}exports[_0xb35a('0x2e')]=function(_0xcfb857,_0x51ff3c){var _0x243d96={},_0x3ad2d3={},_0x2d08cd={'count':0x0,'rows':[]};var _0x38792d=_[_0xb35a('0x2f')](db[_0xb35a('0x30')][_0xb35a('0x31')],function(_0x5b7deb){return{'name':_0x5b7deb[_0xb35a('0x32')],'type':_0x5b7deb[_0xb35a('0x33')][_0xb35a('0x34')]};});_0x3ad2d3[_0xb35a('0x35')]=_['map'](_0x38792d,_0xb35a('0x2c'));_0x3ad2d3[_0xb35a('0x36')]=_[_0xb35a('0x37')](_0xcfb857['query']);_0x3ad2d3[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x3ad2d3['model'],_0x3ad2d3[_0xb35a('0x36')]);_0x243d96[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x3ad2d3[_0xb35a('0x35')],qs['fields'](_0xcfb857[_0xb35a('0x36')][_0xb35a('0x3b')]));_0x243d96[_0xb35a('0x3a')]=_0x243d96['attributes'][_0xb35a('0x3c')]?_0x243d96['attributes']:_0x3ad2d3['model'];if(!_0xcfb857[_0xb35a('0x36')][_0xb35a('0x3d')](_0xb35a('0x3e'))){_0x243d96[_0xb35a('0x21')]=qs[_0xb35a('0x21')](_0xcfb857['query']['limit']);_0x243d96[_0xb35a('0x1f')]=qs[_0xb35a('0x1f')](_0xcfb857[_0xb35a('0x36')]['offset']);}_0x243d96['order']=qs['sort'](_0xcfb857[_0xb35a('0x36')][_0xb35a('0x3f')]);_0x243d96[_0xb35a('0x40')]=qs[_0xb35a('0x38')](_['pick'](_0xcfb857[_0xb35a('0x36')],_0x3ad2d3[_0xb35a('0x38')]),_0x38792d);if(_0xcfb857[_0xb35a('0x36')][_0xb35a('0x41')]){_0x243d96[_0xb35a('0x40')]=_[_0xb35a('0x42')](_0x243d96['where'],{'$or':_[_0xb35a('0x2f')](_0x38792d,function(_0x139ae8){if(_0x139ae8[_0xb35a('0x33')]!==_0xb35a('0x43')){var _0x565e14={};_0x565e14[_0x139ae8[_0xb35a('0x2c')]]={'$like':'%'+_0xcfb857[_0xb35a('0x36')][_0xb35a('0x41')]+'%'};return _0x565e14;}})});}_0x243d96=_[_0xb35a('0x42')]({},_0x243d96,_0xcfb857['options']);var _0x26dbba={'where':_0x243d96[_0xb35a('0x40')]};return db['Automation'][_0xb35a('0x22')](_0x26dbba)[_0xb35a('0x28')](function(_0x28d19e){_0x2d08cd[_0xb35a('0x22')]=_0x28d19e;if(_0xcfb857[_0xb35a('0x36')][_0xb35a('0x44')]){_0x243d96['include']=[{'all':!![]}];}return db[_0xb35a('0x30')][_0xb35a('0x45')](_0x243d96);})[_0xb35a('0x28')](function(_0x5988a1){_0x2d08cd[_0xb35a('0x46')]=_0x5988a1;return _0x2d08cd;})[_0xb35a('0x28')](respondWithFilteredResult(_0x51ff3c,_0x243d96))['catch'](handleError(_0x51ff3c,null));};exports['show']=function(_0x1db02c,_0x1c777e){var _0x9908e7={'raw':![],'where':{'id':_0x1db02c[_0xb35a('0x47')]['id']}},_0x525553={};_0x525553['model']=_['keys'](db[_0xb35a('0x30')][_0xb35a('0x31')]);_0x525553[_0xb35a('0x36')]=_[_0xb35a('0x37')](_0x1db02c[_0xb35a('0x36')]);_0x525553[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x525553['model'],_0x525553[_0xb35a('0x36')]);_0x9908e7[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x525553[_0xb35a('0x35')],qs['fields'](_0x1db02c[_0xb35a('0x36')][_0xb35a('0x3b')]));_0x9908e7[_0xb35a('0x3a')]=_0x9908e7[_0xb35a('0x3a')][_0xb35a('0x3c')]?_0x9908e7[_0xb35a('0x3a')]:_0x525553['model'];if(_0x1db02c[_0xb35a('0x36')][_0xb35a('0x44')]){_0x9908e7[_0xb35a('0x48')]=[{'all':!![]}];}_0x9908e7=_[_0xb35a('0x42')]({},_0x9908e7,_0x1db02c[_0xb35a('0x49')]);return db[_0xb35a('0x30')][_0xb35a('0x4a')](_0x9908e7)['then'](handleEntityNotFound(_0x1c777e,null))[_0xb35a('0x28')](respondWithResult(_0x1c777e,null))[_0xb35a('0x4b')](handleError(_0x1c777e,null));};exports[_0xb35a('0x4c')]=function(_0x508baf,_0x54baf3){return db[_0xb35a('0x30')][_0xb35a('0x4c')](_0x508baf[_0xb35a('0x4d')],{})[_0xb35a('0x28')](respondWithResult(_0x54baf3,0xc9))[_0xb35a('0x4b')](handleError(_0x54baf3,null));};exports['update']=function(_0x1caa03,_0x58ffb5){if(_0x1caa03[_0xb35a('0x4d')]['id']){delete _0x1caa03[_0xb35a('0x4d')]['id'];}return db[_0xb35a('0x30')][_0xb35a('0x4a')]({'where':{'id':_0x1caa03['params']['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x58ffb5,null))[_0xb35a('0x28')](saveUpdates(_0x1caa03[_0xb35a('0x4d')],null))['then'](respondWithResult(_0x58ffb5,null))['catch'](handleError(_0x58ffb5,null));};exports[_0xb35a('0x29')]=function(_0x48f450,_0x4c870f){return db['Automation'][_0xb35a('0x4a')]({'where':{'id':_0x48f450['params']['id']}})['then'](handleEntityNotFound(_0x4c870f,null))[_0xb35a('0x28')](removeEntity(_0x4c870f,null))['catch'](handleError(_0x4c870f,null));};exports[_0xb35a('0x4e')]=function(_0x20e1eb,_0x1b77af,_0x3bbb02){return db['Condition'][_0xb35a('0x4a')]({'where':{'id':_0x20e1eb[_0xb35a('0x47')]['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x1b77af,null))['then'](function(_0x5dbe86){if(_0x5dbe86){return _0x5dbe86['addConditions'](_0x20e1eb[_0xb35a('0x4d')][_0xb35a('0x4f')],_[_0xb35a('0x50')](_0x20e1eb[_0xb35a('0x4d')],[_0xb35a('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x1b77af,null))['catch'](handleError(_0x1b77af,null));};exports[_0xb35a('0x51')]=function(_0x2f3935,_0x2f8bb7,_0x2d4bf7){var _0x4178d3={};var _0x2cc593={};var _0x41e002;var _0x2500c5;return db[_0xb35a('0x30')][_0xb35a('0x52')]({'where':{'id':_0x2f3935[_0xb35a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f8bb7,null))[_0xb35a('0x28')](function(_0x1e8a34){if(_0x1e8a34){_0x41e002=_0x1e8a34;_0x2cc593['model']=_[_0xb35a('0x37')](db[_0xb35a('0x53')][_0xb35a('0x31')]);_0x2cc593[_0xb35a('0x36')]=_[_0xb35a('0x37')](_0x2f3935['query']);_0x2cc593[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x2cc593[_0xb35a('0x35')],_0x2cc593[_0xb35a('0x36')]);_0x4178d3[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x2cc593[_0xb35a('0x35')],qs[_0xb35a('0x3b')](_0x2f3935['query'][_0xb35a('0x3b')]));_0x4178d3[_0xb35a('0x3a')]=_0x4178d3[_0xb35a('0x3a')][_0xb35a('0x3c')]?_0x4178d3[_0xb35a('0x3a')]:_0x2cc593[_0xb35a('0x35')];_0x4178d3[_0xb35a('0x54')]=qs[_0xb35a('0x3f')](_0x2f3935[_0xb35a('0x36')][_0xb35a('0x3f')]);_0x4178d3['where']=qs[_0xb35a('0x38')](_['pick'](_0x2f3935['query'],_0x2cc593[_0xb35a('0x38')]));if(_0x2f3935[_0xb35a('0x36')][_0xb35a('0x41')]){_0x4178d3[_0xb35a('0x40')]=_[_0xb35a('0x42')](_0x4178d3[_0xb35a('0x40')],{'$or':_[_0xb35a('0x2f')](_0x4178d3[_0xb35a('0x3a')],function(_0x24bee7){var _0x44b4de={};_0x44b4de[_0x24bee7]={'$like':'%'+_0x2f3935['query'][_0xb35a('0x41')]+'%'};return _0x44b4de;})});}_0x4178d3=_[_0xb35a('0x42')]({},_0x4178d3,_0x2f3935[_0xb35a('0x49')]);return _0x41e002[_0xb35a('0x51')](_0x4178d3);}})[_0xb35a('0x28')](function(_0xc1571f){if(_0xc1571f){_0x2500c5=_0xc1571f[_0xb35a('0x3c')];if(!_0x2f3935['query'][_0xb35a('0x3d')](_0xb35a('0x3e'))){_0x4178d3[_0xb35a('0x21')]=qs['limit'](_0x2f3935['query'][_0xb35a('0x21')]);_0x4178d3[_0xb35a('0x1f')]=qs['offset'](_0x2f3935[_0xb35a('0x36')]['offset']);}return _0x41e002[_0xb35a('0x51')](_0x4178d3);}})[_0xb35a('0x28')](function(_0xc4af3d){if(_0xc4af3d){return _0xc4af3d?{'count':_0x2500c5,'rows':_0xc4af3d}:null;}})['then'](respondWithResult(_0x2f8bb7,null))['catch'](handleError(_0x2f8bb7,null));};exports[_0xb35a('0x55')]=function(_0x243ee9,_0x5412a6,_0x1b471a){return db[_0xb35a('0x56')][_0xb35a('0x4a')]({'where':{'id':_0x243ee9['params']['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x5412a6,null))[_0xb35a('0x28')](function(_0x51289f){if(_0x51289f){return _0x51289f['addActions'](_0x243ee9[_0xb35a('0x4d')][_0xb35a('0x4f')],_[_0xb35a('0x50')](_0x243ee9[_0xb35a('0x4d')],[_0xb35a('0x4f'),'id'])||{});}})[_0xb35a('0x28')](respondWithResult(_0x5412a6,null))[_0xb35a('0x4b')](handleError(_0x5412a6,null));};exports['getActions']=function(_0x3881c3,_0x2bff72,_0x4c7cb7){var _0x30bebc={};var _0x20d30a={};var _0x5e01b5;var _0x54777d;return db[_0xb35a('0x30')][_0xb35a('0x52')]({'where':{'id':_0x3881c3[_0xb35a('0x47')]['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x2bff72,null))[_0xb35a('0x28')](function(_0x5c84b2){if(_0x5c84b2){_0x5e01b5=_0x5c84b2;_0x20d30a['model']=_[_0xb35a('0x37')](db['Action'][_0xb35a('0x31')]);_0x20d30a[_0xb35a('0x36')]=_['keys'](_0x3881c3[_0xb35a('0x36')]);_0x20d30a[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x20d30a[_0xb35a('0x35')],_0x20d30a[_0xb35a('0x36')]);_0x30bebc[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x20d30a[_0xb35a('0x35')],qs[_0xb35a('0x3b')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x3b')]));_0x30bebc[_0xb35a('0x3a')]=_0x30bebc[_0xb35a('0x3a')][_0xb35a('0x3c')]?_0x30bebc[_0xb35a('0x3a')]:_0x20d30a[_0xb35a('0x35')];_0x30bebc[_0xb35a('0x54')]=qs[_0xb35a('0x3f')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x3f')]);_0x30bebc[_0xb35a('0x40')]=qs['filters'](_[_0xb35a('0x57')](_0x3881c3[_0xb35a('0x36')],_0x20d30a[_0xb35a('0x38')]));if(_0x3881c3[_0xb35a('0x36')][_0xb35a('0x41')]){_0x30bebc[_0xb35a('0x40')]=_[_0xb35a('0x42')](_0x30bebc[_0xb35a('0x40')],{'$or':_[_0xb35a('0x2f')](_0x30bebc[_0xb35a('0x3a')],function(_0x3abc21){var _0x188527={};_0x188527[_0x3abc21]={'$like':'%'+_0x3881c3[_0xb35a('0x36')][_0xb35a('0x41')]+'%'};return _0x188527;})});}_0x30bebc=_[_0xb35a('0x42')]({},_0x30bebc,_0x3881c3[_0xb35a('0x49')]);return _0x5e01b5[_0xb35a('0x58')](_0x30bebc);}})[_0xb35a('0x28')](function(_0x65ca47){if(_0x65ca47){_0x54777d=_0x65ca47[_0xb35a('0x3c')];if(!_0x3881c3['query']['hasOwnProperty'](_0xb35a('0x3e'))){_0x30bebc[_0xb35a('0x21')]=qs[_0xb35a('0x21')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x21')]);_0x30bebc[_0xb35a('0x1f')]=qs[_0xb35a('0x1f')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x1f')]);}return _0x5e01b5['getActions'](_0x30bebc);}})[_0xb35a('0x28')](function(_0x142137){if(_0x142137){return _0x142137?{'count':_0x54777d,'rows':_0x142137}:null;}})['then'](respondWithResult(_0x2bff72,null))['catch'](handleError(_0x2bff72,null));};
\ No newline at end of file
+var _0x53af=['body','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Automation','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','create'];(function(_0x5b7221,_0xcd1f7d){var _0x5b479=function(_0x2c1431){while(--_0x2c1431){_0x5b7221['push'](_0x5b7221['shift']());}};_0x5b479(++_0xcd1f7d);}(_0x53af,0x1f0));var _0xf53a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x53af[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xf53a('0x0'));var rimraf=require(_0xf53a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf53a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf53a('0x3'));var Mustache=require(_0xf53a('0x4'));var util=require(_0xf53a('0x5'));var path=require('path');var sox=require(_0xf53a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf53a('0x7'));var squel=require(_0xf53a('0x8'));var crypto=require(_0xf53a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf53a('0xa'));var toCsv=require(_0xf53a('0xb'));var querystring=require(_0xf53a('0xc'));var Papa=require('papaparse');var Redis=require(_0xf53a('0xd'));var authService=require(_0xf53a('0xe'));var qs=require(_0xf53a('0xf'));var as=require(_0xf53a('0x10'));var hardwareService=require(_0xf53a('0x11'));var logger=require(_0xf53a('0x12'))(_0xf53a('0x13'));var utils=require('../../config/utils');var config=require(_0xf53a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf53a('0x15'))['db'];function respondWithStatusCode(_0x4ff6f5,_0x30ceee){_0x30ceee=_0x30ceee||0xcc;return function(_0x2a5cad){if(_0x2a5cad){return _0x4ff6f5[_0xf53a('0x16')](_0x30ceee);}return _0x4ff6f5[_0xf53a('0x17')](_0x30ceee)[_0xf53a('0x18')]();};}function respondWithResult(_0x196d99,_0x16509d){_0x16509d=_0x16509d||0xc8;return function(_0x5c1d39){if(_0x5c1d39){return _0x196d99[_0xf53a('0x17')](_0x16509d)['json'](_0x5c1d39);}};}function respondWithFilteredResult(_0x32b96f,_0x2bc686){return function(_0x3e8891){if(_0x3e8891){var _0x34eb60=typeof _0x2bc686[_0xf53a('0x19')]==='undefined'&&typeof _0x2bc686[_0xf53a('0x1a')]===_0xf53a('0x1b');var _0x53e4a0=_0x3e8891[_0xf53a('0x1c')];var _0x411e27=_0x34eb60?0x0:_0x2bc686[_0xf53a('0x19')];var _0x97fc81=_0x34eb60?_0x3e8891['count']:_0x2bc686[_0xf53a('0x19')]+_0x2bc686['limit'];var _0x4ea05e;if(_0x97fc81>=_0x53e4a0){_0x97fc81=_0x53e4a0;_0x4ea05e=0xc8;}else{_0x4ea05e=0xce;}_0x32b96f[_0xf53a('0x17')](_0x4ea05e);return _0x32b96f[_0xf53a('0x1d')]('Content-Range',_0x411e27+'-'+_0x97fc81+'/'+_0x53e4a0)[_0xf53a('0x1e')](_0x3e8891);}return null;};}function patchUpdates(_0x31855a){return function(_0x687cb0){try{jsonpatch[_0xf53a('0x1f')](_0x687cb0,_0x31855a,!![]);}catch(_0x3e1967){return BPromise[_0xf53a('0x20')](_0x3e1967);}return _0x687cb0[_0xf53a('0x21')]();};}function saveUpdates(_0x3efd26,_0x4e2857){return function(_0x67252d){if(_0x67252d){return _0x67252d[_0xf53a('0x22')](_0x3efd26)[_0xf53a('0x23')](function(_0x81d012){return _0x81d012;});}return null;};}function removeEntity(_0x36c502,_0x2c4150){return function(_0xffad46){if(_0xffad46){return _0xffad46[_0xf53a('0x24')]()[_0xf53a('0x23')](function(){_0x36c502[_0xf53a('0x17')](0xcc)[_0xf53a('0x18')]();});}};}function handleEntityNotFound(_0x288611,_0x4226f7){return function(_0x33d4b9){if(!_0x33d4b9){_0x288611[_0xf53a('0x16')](0x194);}return _0x33d4b9;};}function handleError(_0x29157f,_0xdd70f7){_0xdd70f7=_0xdd70f7||0x1f4;return function(_0x12b96b){logger[_0xf53a('0x25')](_0x12b96b['stack']);if(_0x12b96b[_0xf53a('0x26')]){delete _0x12b96b[_0xf53a('0x26')];}_0x29157f[_0xf53a('0x17')](_0xdd70f7)[_0xf53a('0x27')](_0x12b96b);};}exports[_0xf53a('0x28')]=function(_0x33b4fe,_0x2da669){var _0x4f248c={},_0x4a7d72={},_0x13ff86={'count':0x0,'rows':[]};var _0x29b2ec=_[_0xf53a('0x29')](db[_0xf53a('0x2a')][_0xf53a('0x2b')],function(_0x3d2ea6){return{'name':_0x3d2ea6['fieldName'],'type':_0x3d2ea6[_0xf53a('0x2c')][_0xf53a('0x2d')]};});_0x4a7d72[_0xf53a('0x2e')]=_[_0xf53a('0x29')](_0x29b2ec,_0xf53a('0x26'));_0x4a7d72[_0xf53a('0x2f')]=_['keys'](_0x33b4fe[_0xf53a('0x2f')]);_0x4a7d72[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0x4a7d72[_0xf53a('0x2e')],_0x4a7d72[_0xf53a('0x2f')]);_0x4f248c[_0xf53a('0x32')]=_['intersection'](_0x4a7d72[_0xf53a('0x2e')],qs[_0xf53a('0x33')](_0x33b4fe['query'][_0xf53a('0x33')]));_0x4f248c[_0xf53a('0x32')]=_0x4f248c[_0xf53a('0x32')][_0xf53a('0x34')]?_0x4f248c['attributes']:_0x4a7d72['model'];if(!_0x33b4fe['query'][_0xf53a('0x35')](_0xf53a('0x36'))){_0x4f248c[_0xf53a('0x1a')]=qs[_0xf53a('0x1a')](_0x33b4fe[_0xf53a('0x2f')][_0xf53a('0x1a')]);_0x4f248c['offset']=qs[_0xf53a('0x19')](_0x33b4fe['query']['offset']);}_0x4f248c[_0xf53a('0x37')]=qs[_0xf53a('0x38')](_0x33b4fe[_0xf53a('0x2f')]['sort']);_0x4f248c[_0xf53a('0x39')]=qs[_0xf53a('0x30')](_['pick'](_0x33b4fe[_0xf53a('0x2f')],_0x4a7d72['filters']),_0x29b2ec);if(_0x33b4fe[_0xf53a('0x2f')][_0xf53a('0x3a')]){_0x4f248c['where']=_[_0xf53a('0x3b')](_0x4f248c[_0xf53a('0x39')],{'$or':_[_0xf53a('0x29')](_0x29b2ec,function(_0x48701a){if(_0x48701a[_0xf53a('0x2c')]!==_0xf53a('0x3c')){var _0x3cd474={};_0x3cd474[_0x48701a[_0xf53a('0x26')]]={'$like':'%'+_0x33b4fe[_0xf53a('0x2f')][_0xf53a('0x3a')]+'%'};return _0x3cd474;}})});}_0x4f248c=_[_0xf53a('0x3b')]({},_0x4f248c,_0x33b4fe[_0xf53a('0x3d')]);var _0x5e82f5={'where':_0x4f248c['where']};return db[_0xf53a('0x2a')][_0xf53a('0x1c')](_0x5e82f5)[_0xf53a('0x23')](function(_0x6583ee){_0x13ff86[_0xf53a('0x1c')]=_0x6583ee;if(_0x33b4fe['query'][_0xf53a('0x3e')]){_0x4f248c[_0xf53a('0x3f')]=[{'all':!![]}];}return db[_0xf53a('0x2a')][_0xf53a('0x40')](_0x4f248c);})[_0xf53a('0x23')](function(_0x1b0f7c){_0x13ff86[_0xf53a('0x41')]=_0x1b0f7c;return _0x13ff86;})['then'](respondWithFilteredResult(_0x2da669,_0x4f248c))['catch'](handleError(_0x2da669,null));};exports['show']=function(_0x421f43,_0x2095d1){var _0x3f04be={'raw':![],'where':{'id':_0x421f43[_0xf53a('0x42')]['id']}},_0x49a3c3={};_0x49a3c3[_0xf53a('0x2e')]=_[_0xf53a('0x43')](db[_0xf53a('0x2a')][_0xf53a('0x2b')]);_0x49a3c3[_0xf53a('0x2f')]=_['keys'](_0x421f43[_0xf53a('0x2f')]);_0x49a3c3[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0x49a3c3[_0xf53a('0x2e')],_0x49a3c3[_0xf53a('0x2f')]);_0x3f04be[_0xf53a('0x32')]=_[_0xf53a('0x31')](_0x49a3c3[_0xf53a('0x2e')],qs[_0xf53a('0x33')](_0x421f43[_0xf53a('0x2f')]['fields']));_0x3f04be[_0xf53a('0x32')]=_0x3f04be['attributes'][_0xf53a('0x34')]?_0x3f04be[_0xf53a('0x32')]:_0x49a3c3[_0xf53a('0x2e')];if(_0x421f43[_0xf53a('0x2f')][_0xf53a('0x3e')]){_0x3f04be[_0xf53a('0x3f')]=[{'all':!![]}];}_0x3f04be=_[_0xf53a('0x3b')]({},_0x3f04be,_0x421f43['options']);return db['Automation'][_0xf53a('0x44')](_0x3f04be)['then'](handleEntityNotFound(_0x2095d1,null))[_0xf53a('0x23')](respondWithResult(_0x2095d1,null))[_0xf53a('0x45')](handleError(_0x2095d1,null));};exports[_0xf53a('0x46')]=function(_0x18f720,_0x35d716){return db[_0xf53a('0x2a')][_0xf53a('0x46')](_0x18f720[_0xf53a('0x47')],{})['then'](respondWithResult(_0x35d716,0xc9))[_0xf53a('0x45')](handleError(_0x35d716,null));};exports[_0xf53a('0x22')]=function(_0x55a214,_0xcfc2cb){if(_0x55a214[_0xf53a('0x47')]['id']){delete _0x55a214['body']['id'];}return db[_0xf53a('0x2a')][_0xf53a('0x44')]({'where':{'id':_0x55a214[_0xf53a('0x42')]['id']}})['then'](handleEntityNotFound(_0xcfc2cb,null))[_0xf53a('0x23')](saveUpdates(_0x55a214[_0xf53a('0x47')],null))[_0xf53a('0x23')](respondWithResult(_0xcfc2cb,null))[_0xf53a('0x45')](handleError(_0xcfc2cb,null));};exports[_0xf53a('0x24')]=function(_0x5bf337,_0x3ea286){return db['Automation'][_0xf53a('0x44')]({'where':{'id':_0x5bf337[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x3ea286,null))[_0xf53a('0x23')](removeEntity(_0x3ea286,null))[_0xf53a('0x45')](handleError(_0x3ea286,null));};exports[_0xf53a('0x48')]=function(_0x1774d5,_0x2d1298,_0x70bb63){return db[_0xf53a('0x49')][_0xf53a('0x44')]({'where':{'id':_0x1774d5[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x2d1298,null))[_0xf53a('0x23')](function(_0x524291){if(_0x524291){return _0x524291[_0xf53a('0x48')](_0x1774d5[_0xf53a('0x47')][_0xf53a('0x4a')],_[_0xf53a('0x4b')](_0x1774d5[_0xf53a('0x47')],[_0xf53a('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x2d1298,null))[_0xf53a('0x45')](handleError(_0x2d1298,null));};exports[_0xf53a('0x4c')]=function(_0x47ee04,_0x200ab5,_0x3bbcee){var _0x138034={};var _0x38aee8={};var _0x3b1436;var _0xdb87a0;return db[_0xf53a('0x2a')]['findOne']({'where':{'id':_0x47ee04[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x200ab5,null))[_0xf53a('0x23')](function(_0x122d82){if(_0x122d82){_0x3b1436=_0x122d82;_0x38aee8['model']=_[_0xf53a('0x43')](db[_0xf53a('0x49')]['rawAttributes']);_0x38aee8[_0xf53a('0x2f')]=_[_0xf53a('0x43')](_0x47ee04[_0xf53a('0x2f')]);_0x38aee8[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0x38aee8[_0xf53a('0x2e')],_0x38aee8[_0xf53a('0x2f')]);_0x138034[_0xf53a('0x32')]=_[_0xf53a('0x31')](_0x38aee8[_0xf53a('0x2e')],qs[_0xf53a('0x33')](_0x47ee04[_0xf53a('0x2f')][_0xf53a('0x33')]));_0x138034['attributes']=_0x138034[_0xf53a('0x32')][_0xf53a('0x34')]?_0x138034[_0xf53a('0x32')]:_0x38aee8[_0xf53a('0x2e')];_0x138034[_0xf53a('0x37')]=qs['sort'](_0x47ee04[_0xf53a('0x2f')]['sort']);_0x138034[_0xf53a('0x39')]=qs[_0xf53a('0x30')](_['pick'](_0x47ee04[_0xf53a('0x2f')],_0x38aee8[_0xf53a('0x30')]));if(_0x47ee04[_0xf53a('0x2f')]['filter']){_0x138034[_0xf53a('0x39')]=_[_0xf53a('0x3b')](_0x138034[_0xf53a('0x39')],{'$or':_[_0xf53a('0x29')](_0x138034[_0xf53a('0x32')],function(_0x1aa3f8){var _0x1fba7c={};_0x1fba7c[_0x1aa3f8]={'$like':'%'+_0x47ee04[_0xf53a('0x2f')]['filter']+'%'};return _0x1fba7c;})});}_0x138034=_[_0xf53a('0x3b')]({},_0x138034,_0x47ee04[_0xf53a('0x3d')]);return _0x3b1436[_0xf53a('0x4c')](_0x138034);}})['then'](function(_0x3ff77d){if(_0x3ff77d){_0xdb87a0=_0x3ff77d[_0xf53a('0x34')];if(!_0x47ee04[_0xf53a('0x2f')]['hasOwnProperty'](_0xf53a('0x36'))){_0x138034[_0xf53a('0x1a')]=qs[_0xf53a('0x1a')](_0x47ee04['query'][_0xf53a('0x1a')]);_0x138034['offset']=qs['offset'](_0x47ee04[_0xf53a('0x2f')][_0xf53a('0x19')]);}return _0x3b1436[_0xf53a('0x4c')](_0x138034);}})[_0xf53a('0x23')](function(_0x137f32){if(_0x137f32){return _0x137f32?{'count':_0xdb87a0,'rows':_0x137f32}:null;}})[_0xf53a('0x23')](respondWithResult(_0x200ab5,null))[_0xf53a('0x45')](handleError(_0x200ab5,null));};exports[_0xf53a('0x4d')]=function(_0x11630c,_0x388f05,_0x3f0d31){return db[_0xf53a('0x4e')][_0xf53a('0x44')]({'where':{'id':_0x11630c[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x388f05,null))['then'](function(_0x4777b4){if(_0x4777b4){return _0x4777b4[_0xf53a('0x4d')](_0x11630c[_0xf53a('0x47')][_0xf53a('0x4a')],_[_0xf53a('0x4b')](_0x11630c['body'],[_0xf53a('0x4a'),'id'])||{});}})[_0xf53a('0x23')](respondWithResult(_0x388f05,null))['catch'](handleError(_0x388f05,null));};exports[_0xf53a('0x4f')]=function(_0x220828,_0x533a69,_0x2cd02d){var _0x4e3e73={};var _0xb0e7a9={};var _0x2e9284;var _0x3d9971;return db[_0xf53a('0x2a')][_0xf53a('0x50')]({'where':{'id':_0x220828[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x533a69,null))[_0xf53a('0x23')](function(_0x5238f6){if(_0x5238f6){_0x2e9284=_0x5238f6;_0xb0e7a9[_0xf53a('0x2e')]=_['keys'](db[_0xf53a('0x4e')]['rawAttributes']);_0xb0e7a9[_0xf53a('0x2f')]=_[_0xf53a('0x43')](_0x220828[_0xf53a('0x2f')]);_0xb0e7a9[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0xb0e7a9[_0xf53a('0x2e')],_0xb0e7a9[_0xf53a('0x2f')]);_0x4e3e73[_0xf53a('0x32')]=_[_0xf53a('0x31')](_0xb0e7a9['model'],qs[_0xf53a('0x33')](_0x220828[_0xf53a('0x2f')][_0xf53a('0x33')]));_0x4e3e73[_0xf53a('0x32')]=_0x4e3e73[_0xf53a('0x32')][_0xf53a('0x34')]?_0x4e3e73[_0xf53a('0x32')]:_0xb0e7a9[_0xf53a('0x2e')];_0x4e3e73['order']=qs[_0xf53a('0x38')](_0x220828[_0xf53a('0x2f')][_0xf53a('0x38')]);_0x4e3e73[_0xf53a('0x39')]=qs[_0xf53a('0x30')](_['pick'](_0x220828[_0xf53a('0x2f')],_0xb0e7a9[_0xf53a('0x30')]));if(_0x220828[_0xf53a('0x2f')][_0xf53a('0x3a')]){_0x4e3e73[_0xf53a('0x39')]=_[_0xf53a('0x3b')](_0x4e3e73['where'],{'$or':_[_0xf53a('0x29')](_0x4e3e73[_0xf53a('0x32')],function(_0x4d5a8c){var _0x698dd1={};_0x698dd1[_0x4d5a8c]={'$like':'%'+_0x220828[_0xf53a('0x2f')][_0xf53a('0x3a')]+'%'};return _0x698dd1;})});}_0x4e3e73=_[_0xf53a('0x3b')]({},_0x4e3e73,_0x220828[_0xf53a('0x3d')]);return _0x2e9284['getActions'](_0x4e3e73);}})[_0xf53a('0x23')](function(_0x2c8e7b){if(_0x2c8e7b){_0x3d9971=_0x2c8e7b[_0xf53a('0x34')];if(!_0x220828[_0xf53a('0x2f')][_0xf53a('0x35')]('nolimit')){_0x4e3e73[_0xf53a('0x1a')]=qs[_0xf53a('0x1a')](_0x220828[_0xf53a('0x2f')][_0xf53a('0x1a')]);_0x4e3e73['offset']=qs['offset'](_0x220828[_0xf53a('0x2f')][_0xf53a('0x19')]);}return _0x2e9284[_0xf53a('0x4f')](_0x4e3e73);}})[_0xf53a('0x23')](function(_0x9e0940){if(_0x9e0940){return _0x9e0940?{'count':_0x3d9971,'rows':_0x9e0940}:null;}})[_0xf53a('0x23')](respondWithResult(_0x533a69,null))[_0xf53a('0x45')](handleError(_0x533a69,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index dde8ebf..a06d5d0 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 _0xc796=['../../config/logger','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xc796,0x17e));var _0x6c79=function(_0x219935,_0x5b7d02){_0x219935=_0x219935-0x0;var _0x130409=_0xc796[_0x219935];return _0x130409;};'use strict';var _=require(_0x6c79('0x0'));var util=require(_0x6c79('0x1'));var logger=require(_0x6c79('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c79('0x3'));var rp=require(_0x6c79('0x4'));var fs=require('fs');var path=require(_0x6c79('0x5'));var rimraf=require(_0x6c79('0x6'));var config=require('../../config/environment');var attributes=require(_0x6c79('0x7'));module[_0x6c79('0x8')]=function(_0x18e549,_0x138192){return _0x18e549[_0x6c79('0x9')](_0x6c79('0xa'),attributes,{'tableName':_0x6c79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd85c=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','util'];(function(_0x387335,_0x1dbb1a){var _0x18bb1c=function(_0x2fdc5a){while(--_0x2fdc5a){_0x387335['push'](_0x387335['shift']());}};_0x18bb1c(++_0x1dbb1a);}(_0xd85c,0xfa));var _0xcd85=function(_0x2969f0,_0x11b411){_0x2969f0=_0x2969f0-0x0;var _0x2ca8c0=_0xd85c[_0x2969f0];return _0x2ca8c0;};'use strict';var _=require(_0xcd85('0x0'));var util=require(_0xcd85('0x1'));var logger=require(_0xcd85('0x2'))('api');var moment=require(_0xcd85('0x3'));var BPromise=require(_0xcd85('0x4'));var rp=require(_0xcd85('0x5'));var fs=require('fs');var path=require(_0xcd85('0x6'));var rimraf=require(_0xcd85('0x7'));var config=require(_0xcd85('0x8'));var attributes=require(_0xcd85('0x9'));module['exports']=function(_0x5057b5,_0x180a61){return _0x5057b5['define'](_0xcd85('0xa'),attributes,{'tableName':_0xcd85('0xb'),'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 f397b5b..b46ca96 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 _0x3f72=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x33d38c,_0x2ff27b){var _0x537b31=function(_0x152458){while(--_0x152458){_0x33d38c['push'](_0x33d38c['shift']());}};_0x537b31(++_0x2ff27b);}(_0x3f72,0xaf));var _0x23f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var moment=require(_0x23f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23f7('0x3'));var db=require(_0x23f7('0x4'))['db'];var utils=require(_0x23f7('0x5'));var logger=require(_0x23f7('0x6'))(_0x23f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x23f7('0x8'));var client=jayson['client'][_0x23f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cc54a,_0x23e468,_0x2db48b){return new BPromise(function(_0x412d29,_0x258026){return client[_0x23f7('0xa')](_0x5cc54a,_0x2db48b)[_0x23f7('0xb')](function(_0x3a048c){logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));logger['debug'](_0x23f7('0xf'),_0x23e468,_0x23f7('0xe'),JSON[_0x23f7('0x10')](_0x3a048c));if(_0x3a048c['error']){if(_0x3a048c['error'][_0x23f7('0x11')]===0x1f4){logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);return _0x258026(_0x3a048c['error'][_0x23f7('0x13')]);}logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')]['message']);return _0x412d29(_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);}else{logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));_0x412d29(_0x3a048c[_0x23f7('0x14')][_0x23f7('0x13')]);}})['catch'](function(_0x2669ab){logger[_0x23f7('0x12')]('Automation,\x20%s,\x20%s',_0x23e468,_0x2669ab);_0x258026(_0x2669ab);});});}
\ No newline at end of file
+var _0x9512=['rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x35e6f5,_0x3c1270){var _0x5a60b0=function(_0x3a52c3){while(--_0x3a52c3){_0x35e6f5['push'](_0x35e6f5['shift']());}};_0x5a60b0(++_0x3c1270);}(_0x9512,0x75));var _0x2951=function(_0x5998c7,_0x514254){_0x5998c7=_0x5998c7-0x0;var _0x321421=_0x9512[_0x5998c7];return _0x321421;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var moment=require(_0x2951('0x2'));var BPromise=require(_0x2951('0x3'));var rs=require(_0x2951('0x4'));var fs=require('fs');var Redis=require(_0x2951('0x5'));var db=require(_0x2951('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2951('0x7'))(_0x2951('0x8'));var config=require(_0x2951('0x9'));var jayson=require(_0x2951('0xa'));var client=jayson[_0x2951('0xb')][_0x2951('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b50d9,_0x59d947,_0x2c2c11){return new BPromise(function(_0x2c5ad6,_0x3e1a01){return client[_0x2951('0xd')](_0x1b50d9,_0x2c2c11)[_0x2951('0xe')](function(_0x113b97){logger['info'](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));logger[_0x2951('0x11')](_0x2951('0x12'),_0x59d947,'request\x20sent',JSON[_0x2951('0x13')](_0x113b97));if(_0x113b97[_0x2951('0x14')]){if(_0x113b97[_0x2951('0x14')][_0x2951('0x15')]===0x1f4){logger[_0x2951('0x14')]('Automation,\x20%s,\x20%s',_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x3e1a01(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x2c5ad6(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}else{logger[_0x2951('0x17')](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));_0x2c5ad6(_0x113b97['result'][_0x2951('0x16')]);}})[_0x2951('0x18')](function(_0x18e89d){logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x18e89d);_0x3e1a01(_0x18e89d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 66b9b6b..d994f05 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 _0xac52=['/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated'];(function(_0x2aa529,_0x1f3c07){var _0x789e1e=function(_0x1c82ab){while(--_0x1c82ab){_0x2aa529['push'](_0x2aa529['shift']());}};_0x789e1e(++_0x1f3c07);}(_0xac52,0x122));var _0x2ac5=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xac52[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0x2ac5('0x0'));var path=require(_0x2ac5('0x1'));var timeout=require(_0x2ac5('0x2'));var express=require(_0x2ac5('0x3'));var router=express[_0x2ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ac5('0x5'));var interaction=require(_0x2ac5('0x6'));var config=require('../../config/environment');var controller=require(_0x2ac5('0x7'));router[_0x2ac5('0x8')]('/',auth[_0x2ac5('0x9')](),controller['index']);router['get'](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xb')]);router[_0x2ac5('0x8')](_0x2ac5('0xc'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xd')]);router[_0x2ac5('0x8')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller['getActions']);router[_0x2ac5('0xf')]('/',auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x10')]);router[_0x2ac5('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x2ac5('0xf')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x11')]);router[_0x2ac5('0x12')]('/:id',auth[_0x2ac5('0x9')](),controller['update']);router[_0x2ac5('0x13')](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x25b4=['index','get','/:id','getConditions','/:id/actions','create','post','addConditions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x25b4,0x1ab));var _0x425b=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x25b4[_0x20c9b2];return _0x2c6030;};'use strict';var multer=require(_0x425b('0x0'));var util=require('util');var path=require(_0x425b('0x1'));var timeout=require(_0x425b('0x2'));var express=require(_0x425b('0x3'));var router=express[_0x425b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x425b('0x5'));var interaction=require(_0x425b('0x6'));var config=require(_0x425b('0x7'));var controller=require(_0x425b('0x8'));router['get']('/',auth[_0x425b('0x9')](),controller[_0x425b('0xa')]);router[_0x425b('0xb')](_0x425b('0xc'),auth[_0x425b('0x9')](),controller['show']);router[_0x425b('0xb')]('/:id/conditions',auth[_0x425b('0x9')](),controller[_0x425b('0xd')]);router[_0x425b('0xb')](_0x425b('0xe'),auth[_0x425b('0x9')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x425b('0xf')]);router[_0x425b('0x10')]('/:id/conditions',auth[_0x425b('0x9')](),controller[_0x425b('0x11')]);router['post'](_0x425b('0xe'),auth[_0x425b('0x9')](),controller['addActions']);router[_0x425b('0x12')]('/:id',auth[_0x425b('0x9')](),controller[_0x425b('0x13')]);router[_0x425b('0x14')](_0x425b('0xc'),auth[_0x425b('0x9')](),controller[_0x425b('0x15')]);module[_0x425b('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 0ee7899..5f8b65b 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 _0x5b25=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#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','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x1eafb2,_0x3f3b67){var _0x4280e2=function(_0xb4d2db){while(--_0xb4d2db){_0x1eafb2['push'](_0x1eafb2['shift']());}};_0x4280e2(++_0x3f3b67);}(_0x5b25,0xc9));var _0x55b2=function(_0x35d2ec,_0x30848c){_0x35d2ec=_0x35d2ec-0x0;var _0x1ca87d=_0x5b25[_0x35d2ec];return _0x1ca87d;};'use strict';var Sequelize=require(_0x55b2('0x0'));module['exports']={'name':{'type':Sequelize[_0x55b2('0x1')],'unique':_0x55b2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x55b2('0x3')](_0x55b2('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x55b2('0x1')]},'active':{'type':Sequelize[_0x55b2('0x5')],'defaultValue':0x0,'comment':_0x55b2('0x6')},'limitCalls':{'type':Sequelize[_0x55b2('0x7')](0x4)[_0x55b2('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x55b2('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x55b2('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x3,'comment':_0x55b2('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x55b2('0xf')},'dialTimezone':{'type':Sequelize[_0x55b2('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x55b2('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x55b2('0x10'),_0x55b2('0x11')),'defaultValue':_0x55b2('0x12')},'dialAMDActive':{'type':Sequelize[_0x55b2('0x5')],'defaultValue':0x0,'comment':_0x55b2('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x55b2('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x55b2('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x55b2('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x55b2('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x55b2('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x55b2('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x55b2('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x55b2('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x55b2('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x55b2('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x55b2('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x55b2('0x1b'),_0x55b2('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x55b2('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x55b2('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x55b2('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0x26')}};
\ No newline at end of file
+var _0xbaf4=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ivr','STRING','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x447125,_0x140166){var _0x5e21ff=function(_0x3ecfaa){while(--_0x3ecfaa){_0x447125['push'](_0x447125['shift']());}};_0x5e21ff(++_0x140166);}(_0xbaf4,0x13f));var _0x4baf=function(_0x363a62,_0x423698){_0x363a62=_0x363a62-0x0;var _0xadc72=_0xbaf4[_0x363a62];return _0xadc72;};'use strict';var Sequelize=require(_0x4baf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x4baf('0x1')},'description':{'type':Sequelize[_0x4baf('0x2')]},'active':{'type':Sequelize[_0x4baf('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x4baf('0x4')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4baf('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4baf('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4baf('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4baf('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x8')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0xa')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4baf('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0x4baf('0xc')](_0x4baf('0xd'),_0x4baf('0xe'),_0x4baf('0xf')),'defaultValue':_0x4baf('0xd')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x4baf('0x4')](0x9)[_0x4baf('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4baf('0x10')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4baf('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4baf('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4baf('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4baf('0x4')](0x9)[_0x4baf('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4baf('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4baf('0x4')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4baf('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4baf('0x4')](0x9)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4baf('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4baf('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4baf('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4baf('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x4baf('0x17')),'defaultValue':_0x4baf('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4baf('0x19')},'dialCutDigit':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4baf('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x21')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 84f9c95..b184cfd 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 _0x3306=['send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','Campaign','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','omit','updatedAt','body','getHoppers','findOne','CmHopper','CampaignId','filter','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','createdAt','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','select','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_contacts','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name'];(function(_0x44c983,_0x3ae50b){var _0x151cfe=function(_0x12c635){while(--_0x12c635){_0x44c983['push'](_0x44c983['shift']());}};_0x151cfe(++_0x3ae50b);}(_0x3306,0x107));var _0x6330=function(_0x510700,_0x173958){_0x510700=_0x510700-0x0;var _0x1e0ccb=_0x3306[_0x510700];return _0x1e0ccb;};'use strict';var emlformat=require(_0x6330('0x0'));var rimraf=require(_0x6330('0x1'));var zipdir=require(_0x6330('0x2'));var jsonpatch=require(_0x6330('0x3'));var rp=require('request-promise');var moment=require(_0x6330('0x4'));var BPromise=require(_0x6330('0x5'));var Mustache=require(_0x6330('0x6'));var util=require(_0x6330('0x7'));var path=require(_0x6330('0x8'));var sox=require('sox');var csv=require(_0x6330('0x9'));var ejs=require(_0x6330('0xa'));var fs=require('fs');var fs_extra=require(_0x6330('0xb'));var _=require(_0x6330('0xc'));var squel=require(_0x6330('0xd'));var crypto=require(_0x6330('0xe'));var jsforce=require(_0x6330('0xf'));var deskjs=require(_0x6330('0x10'));var toCsv=require(_0x6330('0x9'));var querystring=require(_0x6330('0x11'));var Papa=require('papaparse');var Redis=require(_0x6330('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6330('0x13'));var as=require(_0x6330('0x14'));var hardwareService=require(_0x6330('0x15'));var logger=require(_0x6330('0x16'))(_0x6330('0x17'));var utils=require(_0x6330('0x18'));var config=require(_0x6330('0x19'));var licenseUtil=require(_0x6330('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a7e6c,_0x1d4767){_0x1d4767=_0x1d4767||0xcc;return function(_0x27ff9a){if(_0x27ff9a){return _0x5a7e6c[_0x6330('0x1b')](_0x1d4767);}return _0x5a7e6c[_0x6330('0x1c')](_0x1d4767)[_0x6330('0x1d')]();};}function respondWithResult(_0x4b4cce,_0x15fa68){_0x15fa68=_0x15fa68||0xc8;return function(_0x38367a){if(_0x38367a){return _0x4b4cce[_0x6330('0x1c')](_0x15fa68)[_0x6330('0x1e')](_0x38367a);}};}function respondWithFilteredResult(_0x5140e3,_0x4c6860){return function(_0x32b59f){if(_0x32b59f){var _0x476774=typeof _0x4c6860[_0x6330('0x1f')]==='undefined'&&typeof _0x4c6860[_0x6330('0x20')]===_0x6330('0x21');var _0x5a643e=_0x32b59f['count'];var _0x348b34=_0x476774?0x0:_0x4c6860[_0x6330('0x1f')];var _0x3ba601=_0x476774?_0x32b59f[_0x6330('0x22')]:_0x4c6860[_0x6330('0x1f')]+_0x4c6860[_0x6330('0x20')];var _0xfbafd6;if(_0x3ba601>=_0x5a643e){_0x3ba601=_0x5a643e;_0xfbafd6=0xc8;}else{_0xfbafd6=0xce;}_0x5140e3[_0x6330('0x1c')](_0xfbafd6);return _0x5140e3[_0x6330('0x23')](_0x6330('0x24'),_0x348b34+'-'+_0x3ba601+'/'+_0x5a643e)['json'](_0x32b59f);}return null;};}function patchUpdates(_0x1fdc20){return function(_0x206757){try{jsonpatch[_0x6330('0x25')](_0x206757,_0x1fdc20,!![]);}catch(_0x3c8ce5){return BPromise[_0x6330('0x26')](_0x3c8ce5);}return _0x206757['save']();};}function saveUpdates(_0x414fd6,_0x415840){return function(_0x282809){if(_0x282809){return _0x282809[_0x6330('0x27')](_0x414fd6)[_0x6330('0x28')](function(_0x186b91){return _0x186b91;});}return null;};}function removeEntity(_0x50af90,_0x54cbeb){return function(_0x59144c){if(_0x59144c){return _0x59144c[_0x6330('0x29')]()[_0x6330('0x28')](function(){var _0x24702b=_0x59144c[_0x6330('0x2a')]({'plain':!![]});var _0x5899f8=_0x6330('0x2b');return db[_0x6330('0x2c')][_0x6330('0x29')]({'where':{'type':_0x5899f8,'resourceId':_0x24702b['id']}})[_0x6330('0x28')](function(){return _0x59144c;});})[_0x6330('0x28')](function(){_0x50af90['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x255861,_0xfe629c){return function(_0x1aba87){if(!_0x1aba87){_0x255861['sendStatus'](0x194);}return _0x1aba87;};}function handleError(_0x206262,_0x1cb436){_0x1cb436=_0x1cb436||0x1f4;return function(_0x325037){logger[_0x6330('0x2d')](_0x325037['stack']);if(_0x325037[_0x6330('0x2e')]){delete _0x325037['name'];}_0x206262[_0x6330('0x1c')](_0x1cb436)[_0x6330('0x2f')](_0x325037);};}exports[_0x6330('0x30')]=function(_0x3e8efc,_0x4d41c5){var _0x102315={},_0x26a76e={},_0x547f35={'count':0x0,'rows':[]};var _0x3dca32=_[_0x6330('0x31')](db['Campaign'][_0x6330('0x32')],function(_0x47ce15){return{'name':_0x47ce15[_0x6330('0x33')],'type':_0x47ce15['type'][_0x6330('0x34')]};});_0x26a76e['model']=_['map'](_0x3dca32,_0x6330('0x2e'));_0x26a76e[_0x6330('0x35')]=_[_0x6330('0x36')](_0x3e8efc[_0x6330('0x35')]);_0x26a76e[_0x6330('0x37')]=_[_0x6330('0x38')](_0x26a76e[_0x6330('0x39')],_0x26a76e[_0x6330('0x35')]);_0x102315[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x26a76e[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x3e8efc['query'][_0x6330('0x3b')]));_0x102315['attributes']=_0x102315[_0x6330('0x3a')][_0x6330('0x3c')]?_0x102315[_0x6330('0x3a')]:_0x26a76e[_0x6330('0x39')];if(!_0x3e8efc[_0x6330('0x35')][_0x6330('0x3d')](_0x6330('0x3e'))){_0x102315[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x3e8efc[_0x6330('0x35')]['limit']);_0x102315[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x3e8efc['query']['offset']);}_0x102315[_0x6330('0x3f')]=qs['sort'](_0x3e8efc[_0x6330('0x35')][_0x6330('0x40')]);_0x102315[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x3e8efc[_0x6330('0x35')],_0x26a76e[_0x6330('0x37')]),_0x3dca32);if(_0x3e8efc[_0x6330('0x35')]['filter']){_0x102315[_0x6330('0x41')]=_[_0x6330('0x43')](_0x102315[_0x6330('0x41')],{'$or':_['map'](_0x3dca32,function(_0x4ea175){if(_0x4ea175[_0x6330('0x44')]!==_0x6330('0x45')){var _0x3d5440={};_0x3d5440[_0x4ea175['name']]={'$like':'%'+_0x3e8efc['query']['filter']+'%'};return _0x3d5440;}})});}_0x102315=_['merge']({},_0x102315,_0x3e8efc['options']);var _0x1e7964={'where':_0x102315['where']};return db['Campaign'][_0x6330('0x22')](_0x1e7964)[_0x6330('0x28')](function(_0x46f26c){_0x547f35[_0x6330('0x22')]=_0x46f26c;if(_0x3e8efc[_0x6330('0x35')][_0x6330('0x46')]){_0x102315[_0x6330('0x47')]=[{'all':!![]}];}return db[_0x6330('0x48')][_0x6330('0x49')](_0x102315);})[_0x6330('0x28')](function(_0x531c8a){_0x547f35[_0x6330('0x4a')]=_0x531c8a;return _0x547f35;})[_0x6330('0x28')](respondWithFilteredResult(_0x4d41c5,_0x102315))[_0x6330('0x4b')](handleError(_0x4d41c5,null));};exports[_0x6330('0x4c')]=function(_0x3b1fd3,_0x5d9cc9){var _0x2dd36a={'raw':![],'where':{'id':_0x3b1fd3['params']['id']}},_0x10811e={};_0x10811e[_0x6330('0x39')]=_[_0x6330('0x36')](db[_0x6330('0x48')]['rawAttributes']);_0x10811e[_0x6330('0x35')]=_[_0x6330('0x36')](_0x3b1fd3[_0x6330('0x35')]);_0x10811e[_0x6330('0x37')]=_[_0x6330('0x38')](_0x10811e['model'],_0x10811e[_0x6330('0x35')]);_0x2dd36a[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x10811e[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x3b1fd3[_0x6330('0x35')][_0x6330('0x3b')]));_0x2dd36a['attributes']=_0x2dd36a[_0x6330('0x3a')][_0x6330('0x3c')]?_0x2dd36a['attributes']:_0x10811e['model'];if(_0x3b1fd3['query'][_0x6330('0x46')]){_0x2dd36a['include']=[{'all':!![]}];}_0x2dd36a=_[_0x6330('0x43')]({},_0x2dd36a,_0x3b1fd3['options']);return db['Campaign'][_0x6330('0x4d')](_0x2dd36a)[_0x6330('0x28')](handleEntityNotFound(_0x5d9cc9,null))[_0x6330('0x28')](respondWithResult(_0x5d9cc9,null))[_0x6330('0x4b')](handleError(_0x5d9cc9,null));};exports['create']=function(_0x1f77e3,_0x66f6a2){return db['Campaign'][_0x6330('0x4e')](_0x1f77e3['body'],{})[_0x6330('0x28')](function(_0x2ffb53){var _0x42fbed=_0x1f77e3[_0x6330('0x4f')][_0x6330('0x2a')]({'plain':!![]});if(!_0x42fbed)throw new Error(_0x6330('0x50'));if(_0x42fbed[_0x6330('0x51')]==='user'){var _0x156b49=_0x2ffb53[_0x6330('0x2a')]({'plain':!![]});var _0x4101ea='IvrCampaigns';return db[_0x6330('0x52')]['find']({'where':{'name':_0x4101ea,'userProfileId':_0x42fbed[_0x6330('0x53')]},'raw':!![]})['then'](function(_0x2328f8){if(_0x2328f8&&_0x2328f8[_0x6330('0x54')]===0x0){return db[_0x6330('0x2c')][_0x6330('0x4e')]({'name':_0x156b49[_0x6330('0x2e')],'resourceId':_0x156b49['id'],'type':_0x2328f8['name'],'sectionId':_0x2328f8['id']},{})[_0x6330('0x28')](function(){return _0x2ffb53;});}else{return _0x2ffb53;}})[_0x6330('0x4b')](function(_0x1c6fda){logger[_0x6330('0x2d')](_0x6330('0x55'),_0x1c6fda);throw _0x1c6fda;});}return _0x2ffb53;})[_0x6330('0x28')](respondWithResult(_0x66f6a2,0xc9))['catch'](handleError(_0x66f6a2,null));};exports[_0x6330('0x56')]=function(_0x25a720,_0x14524a){var _0x1957ce={'where':{'id':_0x25a720[_0x6330('0x57')]['id']}},_0x445c4f={};_0x445c4f['model']=_[_0x6330('0x36')](db[_0x6330('0x48')][_0x6330('0x32')]);_0x1957ce[_0x6330('0x3a')]=_['intersection'](_0x445c4f[_0x6330('0x39')],qs['fields'](_0x25a720[_0x6330('0x35')][_0x6330('0x3b')]));_0x1957ce[_0x6330('0x3a')]=_0x1957ce['attributes'][_0x6330('0x3c')]?_0x1957ce[_0x6330('0x3a')]:_0x445c4f[_0x6330('0x39')];if(_0x25a720[_0x6330('0x35')][_0x6330('0x46')]){_0x1957ce[_0x6330('0x47')]=[{'all':!![]}];}_0x1957ce=_['merge']({},_0x1957ce,_0x25a720[_0x6330('0x58')]);return db['Campaign']['find'](_0x1957ce)[_0x6330('0x28')](handleEntityNotFound(_0x14524a,null))[_0x6330('0x28')](function(_0x1ae62f){if(_0x1ae62f){var _0x10c4ab=_0x1ae62f['get']({'plain':!![]});_0x10c4ab=qs[_0x6330('0x59')](_0x10c4ab,['id','createdAt',_0x6330('0x5a')]);_0x25a720[_0x6330('0x5b')]=_[_0x6330('0x59')](_0x25a720[_0x6330('0x5b')],['id','createdAt',_0x6330('0x5a')]);return db['Campaign'][_0x6330('0x4e')](_[_0x6330('0x43')](_0x10c4ab,_0x25a720[_0x6330('0x5b')]),{'include':_0x25a720[_0x6330('0x35')][_0x6330('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x527fdd){var _0x84fa67=_0x25a720['user'][_0x6330('0x2a')]({'plain':!![]});if(!_0x84fa67)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x84fa67[_0x6330('0x51')]===_0x6330('0x4f')){var _0x260006=_0x527fdd[_0x6330('0x2a')]({'plain':!![]});var _0x47a841=_0x6330('0x2b');return db[_0x6330('0x52')][_0x6330('0x4d')]({'where':{'name':_0x47a841,'userProfileId':_0x84fa67[_0x6330('0x53')]},'raw':!![]})[_0x6330('0x28')](function(_0x5c57e7){if(_0x5c57e7&&_0x5c57e7[_0x6330('0x54')]===0x0){return db[_0x6330('0x2c')][_0x6330('0x4e')]({'name':_0x260006[_0x6330('0x2e')],'resourceId':_0x260006['id'],'type':_0x5c57e7[_0x6330('0x2e')],'sectionId':_0x5c57e7['id']},{})[_0x6330('0x28')](function(){return _0x527fdd;});}else{return _0x527fdd;}})[_0x6330('0x4b')](function(_0x44a035){logger['error'](_0x6330('0x55'),_0x44a035);throw _0x44a035;});}return _0x527fdd;});}})[_0x6330('0x28')](respondWithResult(_0x14524a,0xc9))['catch'](handleError(_0x14524a,null));};exports[_0x6330('0x27')]=function(_0x476790,_0x20758e){if(_0x476790['body']['id']){delete _0x476790[_0x6330('0x5b')]['id'];}return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x476790['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x20758e,null))['then'](saveUpdates(_0x476790[_0x6330('0x5b')],null))[_0x6330('0x28')](respondWithResult(_0x20758e,null))[_0x6330('0x4b')](handleError(_0x20758e,null));};exports[_0x6330('0x29')]=function(_0x3aee33,_0x4f1144){return db['Campaign'][_0x6330('0x4d')]({'where':{'id':_0x3aee33[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x4f1144,null))[_0x6330('0x28')](removeEntity(_0x4f1144,null))[_0x6330('0x4b')](handleError(_0x4f1144,null));};exports[_0x6330('0x5c')]=function(_0xd154cb,_0x5a5c7f,_0x4f1c4d){var _0x3d8b99={'raw':!![],'where':{}};var _0x12c59a={};var _0x261f62={'count':0x0,'rows':[]};return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0xd154cb[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x5a5c7f,null))[_0x6330('0x28')](function(_0x2283c5){if(_0x2283c5){_0x12c59a['model']=_[_0x6330('0x36')](db[_0x6330('0x5e')]['rawAttributes']);_0x12c59a[_0x6330('0x35')]=_[_0x6330('0x36')](_0xd154cb[_0x6330('0x35')]);_0x12c59a[_0x6330('0x37')]=_[_0x6330('0x38')](_0x12c59a['model'],_0x12c59a['query']);_0x3d8b99['attributes']=_[_0x6330('0x38')](_0x12c59a[_0x6330('0x39')],qs[_0x6330('0x3b')](_0xd154cb[_0x6330('0x35')]['fields']));_0x3d8b99[_0x6330('0x3a')]=_0x3d8b99[_0x6330('0x3a')]['length']?_0x3d8b99[_0x6330('0x3a')]:_0x12c59a[_0x6330('0x39')];if(!_0xd154cb[_0x6330('0x35')][_0x6330('0x3d')]('nolimit')){_0x3d8b99[_0x6330('0x20')]=qs[_0x6330('0x20')](_0xd154cb['query'][_0x6330('0x20')]);_0x3d8b99[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0xd154cb[_0x6330('0x35')][_0x6330('0x1f')]);}_0x3d8b99['order']=qs[_0x6330('0x40')](_0xd154cb[_0x6330('0x35')][_0x6330('0x40')]);_0x3d8b99[_0x6330('0x41')]=qs[_0x6330('0x37')](_['pick'](_0xd154cb[_0x6330('0x35')],_0x12c59a[_0x6330('0x37')]));_0x3d8b99[_0x6330('0x41')][_0x6330('0x5f')]=_0x2283c5['id'];if(_0xd154cb['query'][_0x6330('0x60')]){_0x3d8b99[_0x6330('0x41')]=_[_0x6330('0x43')](_0x3d8b99[_0x6330('0x41')],{'$or':_[_0x6330('0x31')](_0x3d8b99[_0x6330('0x3a')],function(_0x53b1f2){var _0x53f521={};_0x53f521[_0x53b1f2]={'$like':'%'+_0xd154cb[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x53f521;})});}_0x3d8b99=_[_0x6330('0x43')]({},_0x3d8b99,_0xd154cb[_0x6330('0x58')]);return db[_0x6330('0x5e')][_0x6330('0x22')]({'where':_0x3d8b99['where']})['then'](function(_0x152dcd){_0x261f62[_0x6330('0x22')]=_0x152dcd;if(_0xd154cb[_0x6330('0x35')][_0x6330('0x46')]){_0x3d8b99['include']=[{'all':!![]}];}return db[_0x6330('0x5e')][_0x6330('0x49')](_0x3d8b99);})[_0x6330('0x28')](function(_0x5efaa6){_0x261f62[_0x6330('0x4a')]=_0x5efaa6;return _0x261f62;});}})[_0x6330('0x28')](respondWithFilteredResult(_0x5a5c7f,_0x3d8b99))[_0x6330('0x4b')](handleError(_0x5a5c7f,null));};exports[_0x6330('0x61')]=function(_0x495868,_0x3c764b,_0x8ea670){var _0x1a61b4={'raw':!![],'where':{}};var _0x1f5020={};var _0x10c0da={'count':0x0,'rows':[]};return db['Campaign'][_0x6330('0x5d')]({'where':{'id':_0x495868['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x3c764b,null))['then'](function(_0x22cc13){if(_0x22cc13){_0x1f5020[_0x6330('0x39')]=_[_0x6330('0x36')](db['CmHopperHistory'][_0x6330('0x32')]);_0x1f5020[_0x6330('0x35')]=_[_0x6330('0x36')](_0x495868[_0x6330('0x35')]);_0x1f5020['filters']=_[_0x6330('0x38')](_0x1f5020[_0x6330('0x39')],_0x1f5020['query']);_0x1a61b4[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x1f5020['model'],qs[_0x6330('0x3b')](_0x495868[_0x6330('0x35')][_0x6330('0x3b')]));_0x1a61b4[_0x6330('0x3a')]=_0x1a61b4[_0x6330('0x3a')][_0x6330('0x3c')]?_0x1a61b4[_0x6330('0x3a')]:_0x1f5020[_0x6330('0x39')];if(!_0x495868['query'][_0x6330('0x3d')](_0x6330('0x3e'))){_0x1a61b4[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x495868[_0x6330('0x35')][_0x6330('0x20')]);_0x1a61b4[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x495868[_0x6330('0x35')]['offset']);}_0x1a61b4[_0x6330('0x3f')]=qs['sort'](_0x495868[_0x6330('0x35')][_0x6330('0x40')]);_0x1a61b4[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x495868['query'],_0x1f5020['filters']));_0x1a61b4[_0x6330('0x41')][_0x6330('0x5f')]=_0x22cc13['id'];if(_0x495868[_0x6330('0x35')]['filter']){_0x1a61b4[_0x6330('0x41')]=_['merge'](_0x1a61b4[_0x6330('0x41')],{'$or':_['map'](_0x1a61b4[_0x6330('0x3a')],function(_0x16332f){var _0x1583c0={};_0x1583c0[_0x16332f]={'$like':'%'+_0x495868[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x1583c0;})});}_0x1a61b4=_[_0x6330('0x43')]({},_0x1a61b4,_0x495868['options']);return db[_0x6330('0x62')][_0x6330('0x22')]({'where':_0x1a61b4[_0x6330('0x41')]})[_0x6330('0x28')](function(_0x5d57fd){_0x10c0da['count']=_0x5d57fd;if(_0x495868[_0x6330('0x35')][_0x6330('0x46')]){_0x1a61b4[_0x6330('0x47')]=[{'all':!![]}];}return db[_0x6330('0x62')][_0x6330('0x49')](_0x1a61b4);})['then'](function(_0x527d33){_0x10c0da[_0x6330('0x4a')]=_0x527d33;return _0x10c0da;});}})[_0x6330('0x28')](respondWithFilteredResult(_0x3c764b,_0x1a61b4))['catch'](handleError(_0x3c764b,null));};exports[_0x6330('0x63')]=function(_0x31ffc4,_0x370d75,_0x55e47e){var _0x48913d={'raw':!![],'where':{}};var _0x43e3c1={};var _0x2c464b={'count':0x0,'rows':[]};return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0x31ffc4[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x370d75,null))[_0x6330('0x28')](function(_0xfc5f06){if(_0xfc5f06){_0x43e3c1['model']=_[_0x6330('0x36')](db[_0x6330('0x64')][_0x6330('0x32')]);_0x43e3c1[_0x6330('0x35')]=_[_0x6330('0x36')](_0x31ffc4[_0x6330('0x35')]);_0x43e3c1[_0x6330('0x37')]=_['intersection'](_0x43e3c1[_0x6330('0x39')],_0x43e3c1[_0x6330('0x35')]);_0x48913d[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x43e3c1[_0x6330('0x39')],qs['fields'](_0x31ffc4[_0x6330('0x35')][_0x6330('0x3b')]));_0x48913d['attributes']=_0x48913d[_0x6330('0x3a')][_0x6330('0x3c')]?_0x48913d[_0x6330('0x3a')]:_0x43e3c1[_0x6330('0x39')];if(!_0x31ffc4[_0x6330('0x35')][_0x6330('0x3d')](_0x6330('0x3e'))){_0x48913d[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x31ffc4[_0x6330('0x35')][_0x6330('0x20')]);_0x48913d['offset']=qs['offset'](_0x31ffc4[_0x6330('0x35')]['offset']);}_0x48913d['order']=qs[_0x6330('0x40')](_0x31ffc4[_0x6330('0x35')]['sort']);_0x48913d[_0x6330('0x41')]=qs[_0x6330('0x37')](_['pick'](_0x31ffc4[_0x6330('0x35')],_0x43e3c1[_0x6330('0x37')]));_0x48913d[_0x6330('0x41')][_0x6330('0x5f')]=_0xfc5f06['id'];if(_0x31ffc4[_0x6330('0x35')][_0x6330('0x60')]){_0x48913d[_0x6330('0x41')]=_[_0x6330('0x43')](_0x48913d[_0x6330('0x41')],{'$or':_[_0x6330('0x31')](_0x48913d[_0x6330('0x3a')],function(_0x375c00){var _0x12eabf={};_0x12eabf[_0x375c00]={'$like':'%'+_0x31ffc4[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x12eabf;})});}_0x48913d=_[_0x6330('0x43')]({},_0x48913d,_0x31ffc4['options']);return db[_0x6330('0x64')][_0x6330('0x22')]({'where':_0x48913d[_0x6330('0x41')]})[_0x6330('0x28')](function(_0x46e243){_0x2c464b[_0x6330('0x22')]=_0x46e243;if(_0x31ffc4[_0x6330('0x35')][_0x6330('0x46')]){_0x48913d[_0x6330('0x47')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x48913d);})[_0x6330('0x28')](function(_0x30ff61){_0x2c464b[_0x6330('0x4a')]=_0x30ff61;return _0x2c464b;});}})[_0x6330('0x28')](respondWithFilteredResult(_0x370d75,_0x48913d))[_0x6330('0x4b')](handleError(_0x370d75,null));};exports['getHopperBlacks']=function(_0x521794,_0xe7c69,_0x13e411){var _0x1f889e={'raw':!![],'where':{}};var _0x33e514={};var _0x52ffde={'count':0x0,'rows':[]};return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0x521794[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0xe7c69,null))[_0x6330('0x28')](function(_0x19a100){if(_0x19a100){_0x33e514[_0x6330('0x39')]=_['keys'](db[_0x6330('0x65')][_0x6330('0x32')]);_0x33e514[_0x6330('0x35')]=_['keys'](_0x521794['query']);_0x33e514[_0x6330('0x37')]=_[_0x6330('0x38')](_0x33e514[_0x6330('0x39')],_0x33e514[_0x6330('0x35')]);_0x1f889e[_0x6330('0x3a')]=_['intersection'](_0x33e514[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x521794[_0x6330('0x35')][_0x6330('0x3b')]));_0x1f889e[_0x6330('0x3a')]=_0x1f889e['attributes'][_0x6330('0x3c')]?_0x1f889e[_0x6330('0x3a')]:_0x33e514[_0x6330('0x39')];if(!_0x521794['query'][_0x6330('0x3d')]('nolimit')){_0x1f889e['limit']=qs[_0x6330('0x20')](_0x521794[_0x6330('0x35')][_0x6330('0x20')]);_0x1f889e[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x521794[_0x6330('0x35')][_0x6330('0x1f')]);}_0x1f889e[_0x6330('0x3f')]=qs['sort'](_0x521794[_0x6330('0x35')][_0x6330('0x40')]);_0x1f889e[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x521794[_0x6330('0x35')],_0x33e514[_0x6330('0x37')]));_0x1f889e[_0x6330('0x41')][_0x6330('0x5f')]=_0x19a100['id'];if(_0x521794[_0x6330('0x35')][_0x6330('0x60')]){_0x1f889e[_0x6330('0x41')]=_[_0x6330('0x43')](_0x1f889e[_0x6330('0x41')],{'$or':_[_0x6330('0x31')](_0x1f889e[_0x6330('0x3a')],function(_0x557516){var _0x14d5c1={};_0x14d5c1[_0x557516]={'$like':'%'+_0x521794[_0x6330('0x35')]['filter']+'%'};return _0x14d5c1;})});}_0x1f889e=_[_0x6330('0x43')]({},_0x1f889e,_0x521794[_0x6330('0x58')]);return db[_0x6330('0x65')]['count']({'where':_0x1f889e[_0x6330('0x41')]})[_0x6330('0x28')](function(_0x7b523a){_0x52ffde['count']=_0x7b523a;if(_0x521794['query'][_0x6330('0x46')]){_0x1f889e[_0x6330('0x47')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x1f889e);})[_0x6330('0x28')](function(_0x1bdd60){_0x52ffde['rows']=_0x1bdd60;return _0x52ffde;});}})[_0x6330('0x28')](respondWithFilteredResult(_0xe7c69,_0x1f889e))[_0x6330('0x4b')](handleError(_0xe7c69,null));};exports[_0x6330('0x66')]=function(_0x3ec0e9,_0x28a54e,_0x2cf290){var _0x48fc16={};var _0x206a0b={};var _0x21069f;var _0x29bc4d;return db['Campaign'][_0x6330('0x5d')]({'where':{'id':_0x3ec0e9['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x28a54e,null))['then'](function(_0x1925cd){if(_0x1925cd){_0x21069f=_0x1925cd;_0x206a0b[_0x6330('0x39')]=_[_0x6330('0x36')](db[_0x6330('0x67')][_0x6330('0x32')]);_0x206a0b[_0x6330('0x35')]=_['keys'](_0x3ec0e9['query']);_0x206a0b['filters']=_[_0x6330('0x38')](_0x206a0b[_0x6330('0x39')],_0x206a0b[_0x6330('0x35')]);_0x48fc16[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x206a0b[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x3ec0e9[_0x6330('0x35')][_0x6330('0x3b')]));_0x48fc16['attributes']=_0x48fc16[_0x6330('0x3a')]['length']?_0x48fc16[_0x6330('0x3a')]:_0x206a0b[_0x6330('0x39')];_0x48fc16[_0x6330('0x3f')]=qs[_0x6330('0x40')](_0x3ec0e9[_0x6330('0x35')][_0x6330('0x40')]);_0x48fc16[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x3ec0e9[_0x6330('0x35')],_0x206a0b['filters']));if(_0x3ec0e9[_0x6330('0x35')][_0x6330('0x60')]){_0x48fc16[_0x6330('0x41')]=_[_0x6330('0x43')](_0x48fc16[_0x6330('0x41')],{'$or':_['map'](_0x48fc16[_0x6330('0x3a')],function(_0x28b8f3){var _0x4c91d0={};_0x4c91d0[_0x28b8f3]={'$like':'%'+_0x3ec0e9[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x4c91d0;})});}_0x48fc16=_[_0x6330('0x43')]({},_0x48fc16,_0x3ec0e9[_0x6330('0x58')]);return _0x21069f[_0x6330('0x66')](_0x48fc16);}})['then'](function(_0x4f9692){if(_0x4f9692){_0x29bc4d=_0x4f9692[_0x6330('0x3c')];if(!_0x3ec0e9['query']['hasOwnProperty']('nolimit')){_0x48fc16[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x3ec0e9[_0x6330('0x35')][_0x6330('0x20')]);_0x48fc16[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x3ec0e9[_0x6330('0x35')]['offset']);}return _0x21069f[_0x6330('0x66')](_0x48fc16);}})['then'](function(_0x536f17){if(_0x536f17){return _0x536f17?{'count':_0x29bc4d,'rows':_0x536f17}:null;}})[_0x6330('0x28')](respondWithResult(_0x28a54e,null))[_0x6330('0x4b')](handleError(_0x28a54e,null));};exports[_0x6330('0x68')]=function(_0x26c3db,_0x1a5947,_0x448b45){var _0x4d0ae5,_0x23ddd3;var _0x4c06f7=[];var _0x173987=moment()[_0x6330('0x69')](_0x6330('0x6a'));return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x26c3db['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x1a5947,null))[_0x6330('0x28')](function(_0x1d450f){if(_0x1d450f){_0x23ddd3=_0x1d450f;return _0x1d450f[_0x6330('0x68')](_0x26c3db[_0x6330('0x5b')][_0x6330('0x6b')],_[_0x6330('0x59')](_0x26c3db[_0x6330('0x5b')],['ids','id'])||{});}return null;})[_0x6330('0x6c')](function(_0x29c256){var _0x222c2e;var _0x51368b;_0x4d0ae5=_0x29c256||[];var _0x48fed2=[];if(_0x29c256){for(var _0x436f17=0x0;_0x436f17<_0x29c256['length'];_0x436f17+=0x1){var _0x335121=_0x29c256[_0x436f17][_0x6330('0x2a')]({'plain':!![]});_0x23ddd3[_0x6330('0x6d')]=_0x26c3db[_0x6330('0x5b')][_0x6330('0x6d')]?_0x26c3db[_0x6330('0x5b')]['dialCheckDuplicateType']:_0x23ddd3[_0x6330('0x6d')];switch(_0x23ddd3[_0x6330('0x6d')]){case _0x6330('0x6e'):_0x222c2e=squel['insert']()[_0x6330('0x6f')](_0x6330('0x70'))[_0x6330('0x71')]([_0x6330('0x72'),_0x6330('0x73'),_0x6330('0x74'),_0x6330('0x75'),_0x6330('0x5f'),'createdAt','updatedAt'],squel['select']()[_0x6330('0x76')](_0x6330('0x72'),'phone')[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x73'))['field']('id',_0x6330('0x74'))['field'](_0x335121[_0x6330('0x78')][_0x6330('0x79')](),_0x6330('0x75'))[_0x6330('0x76')](_0x26c3db['params']['id']['toString'](),'CampaignId')['field']('\x27'+_0x173987+'\x27',_0x6330('0x7a'))['field']('\x27'+_0x173987+'\x27','updatedAt')['from']('cm_contacts')[_0x6330('0x41')](_0x6330('0x7b'))[_0x6330('0x41')](_0x6330('0x7c'),_0x335121[_0x6330('0x78')][_0x6330('0x79')]())[_0x6330('0x41')](_0x6330('0x7d'))[_0x6330('0x41')](_0x6330('0x7e'),squel['select']()[_0x6330('0x76')](_0x6330('0x7f'))[_0x6330('0x80')](_0x6330('0x81'))['where']('CampaignId\x20=\x20?',_0x26c3db['params']['id'][_0x6330('0x79')]()))[_0x6330('0x41')](_0x6330('0x7e'),squel[_0x6330('0x82')]()['field'](_0x6330('0x83'))[_0x6330('0x80')]('cm_hopper')[_0x6330('0x41')](_0x6330('0x84'),_0x26c3db['params']['id'][_0x6330('0x79')]())))[_0x6330('0x79')]();break;case _0x6330('0x85'):_0x222c2e=squel[_0x6330('0x86')]()['into'](_0x6330('0x70'))[_0x6330('0x71')]([_0x6330('0x72'),_0x6330('0x73'),_0x6330('0x74'),_0x6330('0x75'),_0x6330('0x5f'),_0x6330('0x7a'),_0x6330('0x5a')],squel['select']()['field'](_0x6330('0x72'),'phone')[_0x6330('0x76')]('NOW()',_0x6330('0x73'))[_0x6330('0x76')]('id',_0x6330('0x74'))[_0x6330('0x76')](_0x335121[_0x6330('0x78')][_0x6330('0x79')](),_0x6330('0x75'))[_0x6330('0x76')](_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')](),_0x6330('0x5f'))['field']('\x27'+_0x173987+'\x27',_0x6330('0x7a'))[_0x6330('0x76')]('\x27'+_0x173987+'\x27',_0x6330('0x5a'))[_0x6330('0x80')](_0x6330('0x87'))[_0x6330('0x41')](_0x6330('0x7b'))['where'](_0x6330('0x7c'),_0x335121['CmListId']['toString']())[_0x6330('0x41')](_0x6330('0x7d'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x6330('0x82')]()['field'](_0x6330('0x83'))[_0x6330('0x80')](_0x6330('0x70'))[_0x6330('0x41')]('CampaignId\x20=\x20?',_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')]())))[_0x6330('0x79')]();break;default:_0x222c2e=squel[_0x6330('0x86')]()[_0x6330('0x6f')](_0x6330('0x70'))[_0x6330('0x71')]([_0x6330('0x72'),'scheduledAt',_0x6330('0x74'),'ListId',_0x6330('0x5f'),_0x6330('0x7a'),_0x6330('0x5a')],squel[_0x6330('0x82')]()['field'](_0x6330('0x72'),_0x6330('0x72'))[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x73'))[_0x6330('0x76')]('id',_0x6330('0x74'))[_0x6330('0x76')](_0x335121['CmListId'][_0x6330('0x79')](),'ListId')['field'](_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')](),'CampaignId')[_0x6330('0x76')]('\x27'+_0x173987+'\x27','createdAt')[_0x6330('0x76')]('\x27'+_0x173987+'\x27','updatedAt')[_0x6330('0x80')](_0x6330('0x87'))[_0x6330('0x41')](_0x6330('0x7b'))[_0x6330('0x41')](_0x6330('0x7c'),_0x335121['CmListId']['toString']())['where'](_0x6330('0x7d')))[_0x6330('0x79')]();}_0x51368b=squel[_0x6330('0x86')]()[_0x6330('0x6f')](_0x6330('0x88'))[_0x6330('0x71')]([_0x6330('0x89'),_0x6330('0x73'),_0x6330('0x72'),'OrderBy',_0x6330('0x7a'),_0x6330('0x5a')],squel['select']()[_0x6330('0x76')](_0x6330('0x8a'),'id')[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x73'))[_0x6330('0x76')](_0x6330('0x8b'),_0x6330('0x72'))[_0x6330('0x76')](_0x6330('0x8c'),_0x6330('0x8d'))[_0x6330('0x76')]('\x27'+_0x173987+'\x27',_0x6330('0x7a'))[_0x6330('0x76')]('\x27'+_0x173987+'\x27',_0x6330('0x5a'))[_0x6330('0x80')](_0x6330('0x8e'),'ci')[_0x6330('0x8f')](_0x6330('0x70'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x6330('0x90'),_0x335121[_0x6330('0x78')][_0x6330('0x79')]())['where'](_0x6330('0x91'),_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')]())[_0x6330('0x41')](_0x6330('0x92'),_0x173987))['toString']();_0x48fed2[_0x6330('0x93')](db[_0x6330('0x94')][_0x6330('0x35')](_0x222c2e));_0x4c06f7['push'](db[_0x6330('0x94')]['query'](_0x51368b));}return BPromise['all'](_0x48fed2);}})[_0x6330('0x28')](function(){return BPromise[_0x6330('0x95')](_0x4c06f7);})['then'](function(){return _0x4d0ae5;})[_0x6330('0x28')](respondWithResult(_0x1a5947,null))[_0x6330('0x4b')](handleError(_0x1a5947,null));};exports[_0x6330('0x96')]=function(_0x59a2df,_0x45c24b,_0x11f802){return db[_0x6330('0x48')]['find']({'where':{'id':_0x59a2df[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x45c24b,null))[_0x6330('0x28')](function(_0x4f7c22){if(_0x4f7c22){return _0x4f7c22['removeLists'](_0x59a2df[_0x6330('0x35')][_0x6330('0x6b')]);}})[_0x6330('0x28')](function(_0xdf58db){if(_0xdf58db){return db[_0x6330('0x5e')][_0x6330('0x29')]({'where':{'ListId':_0x59a2df[_0x6330('0x35')]['ids'],'CampaignId':_0x59a2df[_0x6330('0x57')]['id']}})[_0x6330('0x28')](function(){return _0xdf58db;});}})[_0x6330('0x28')](respondWithStatusCode(_0x45c24b,null))['catch'](handleError(_0x45c24b,null));};exports['getBlackLists']=function(_0xc001e8,_0x331311,_0x498a2a){var _0x49605d={};var _0x45d314={};var _0x16ace2;var _0xe3dd85;return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0xc001e8[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x331311,null))[_0x6330('0x28')](function(_0x375f18){if(_0x375f18){_0x16ace2=_0x375f18;_0x45d314[_0x6330('0x39')]=_[_0x6330('0x36')](db[_0x6330('0x67')][_0x6330('0x32')]);_0x45d314['query']=_['keys'](_0xc001e8[_0x6330('0x35')]);_0x45d314[_0x6330('0x37')]=_[_0x6330('0x38')](_0x45d314[_0x6330('0x39')],_0x45d314[_0x6330('0x35')]);_0x49605d[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x45d314['model'],qs[_0x6330('0x3b')](_0xc001e8[_0x6330('0x35')]['fields']));_0x49605d['attributes']=_0x49605d[_0x6330('0x3a')]['length']?_0x49605d[_0x6330('0x3a')]:_0x45d314[_0x6330('0x39')];_0x49605d['order']=qs[_0x6330('0x40')](_0xc001e8[_0x6330('0x35')][_0x6330('0x40')]);_0x49605d[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0xc001e8[_0x6330('0x35')],_0x45d314[_0x6330('0x37')]));if(_0xc001e8[_0x6330('0x35')][_0x6330('0x60')]){_0x49605d[_0x6330('0x41')]=_['merge'](_0x49605d['where'],{'$or':_[_0x6330('0x31')](_0x49605d['attributes'],function(_0x2a11a2){var _0x4c7fd8={};_0x4c7fd8[_0x2a11a2]={'$like':'%'+_0xc001e8['query'][_0x6330('0x60')]+'%'};return _0x4c7fd8;})});}_0x49605d=_['merge']({},_0x49605d,_0xc001e8[_0x6330('0x58')]);return _0x16ace2['getBlackLists'](_0x49605d);}})[_0x6330('0x28')](function(_0x2debb2){if(_0x2debb2){_0xe3dd85=_0x2debb2[_0x6330('0x3c')];if(!_0xc001e8[_0x6330('0x35')][_0x6330('0x3d')](_0x6330('0x3e'))){_0x49605d[_0x6330('0x20')]=qs[_0x6330('0x20')](_0xc001e8[_0x6330('0x35')][_0x6330('0x20')]);_0x49605d['offset']=qs[_0x6330('0x1f')](_0xc001e8['query'][_0x6330('0x1f')]);}return _0x16ace2[_0x6330('0x97')](_0x49605d);}})[_0x6330('0x28')](function(_0x21cec6){if(_0x21cec6){return _0x21cec6?{'count':_0xe3dd85,'rows':_0x21cec6}:null;}})[_0x6330('0x28')](respondWithResult(_0x331311,null))[_0x6330('0x4b')](handleError(_0x331311,null));};exports['addBlackLists']=function(_0x416f08,_0x3f26d7,_0xb22365){var _0x3bd46c,_0x43a1b8;var _0xa6884c=[];var _0x329e60=moment()[_0x6330('0x69')](_0x6330('0x6a'));return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x416f08[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x3f26d7,null))[_0x6330('0x28')](function(_0x3669b1){if(_0x3669b1){_0x43a1b8=_0x3669b1;return _0x3669b1[_0x6330('0x98')](_0x416f08[_0x6330('0x5b')]['ids'],_[_0x6330('0x59')](_0x416f08[_0x6330('0x5b')],[_0x6330('0x6b'),'id'])||{});}return null;})[_0x6330('0x6c')](function(_0x360582){var _0x5b0ca0;var _0x16d482;_0x3bd46c=_0x360582||[];var _0x468483=[];if(_0x360582){for(var _0x7bfad9=0x0;_0x7bfad9<_0x360582[_0x6330('0x3c')];_0x7bfad9+=0x1){var _0x22af72=_0x360582[_0x7bfad9][_0x6330('0x2a')]({'plain':!![]});_0x5b0ca0=squel[_0x6330('0x86')]()['into'](_0x6330('0x99'))[_0x6330('0x71')](['phone','ContactId',_0x6330('0x75'),_0x6330('0x5f'),_0x6330('0x7a'),'updatedAt'],squel[_0x6330('0x82')]()[_0x6330('0x76')](_0x6330('0x72'),'phone')[_0x6330('0x76')]('id',_0x6330('0x74'))[_0x6330('0x76')](_0x22af72['CmListId'][_0x6330('0x79')](),_0x6330('0x75'))[_0x6330('0x76')](_0x416f08[_0x6330('0x57')]['id'][_0x6330('0x79')](),_0x6330('0x5f'))[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x7a'))[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x5a'))[_0x6330('0x80')](_0x6330('0x87'))[_0x6330('0x41')](_0x6330('0x7b'))[_0x6330('0x41')](_0x6330('0x7c'),_0x22af72[_0x6330('0x78')][_0x6330('0x79')]())[_0x6330('0x41')](_0x6330('0x7d')))['toString']();_0x468483[_0x6330('0x93')](db[_0x6330('0x94')][_0x6330('0x35')](_0x5b0ca0));}return BPromise[_0x6330('0x95')](_0x468483);}})[_0x6330('0x28')](function(){return _0x3bd46c;})[_0x6330('0x28')](respondWithResult(_0x3f26d7,null))[_0x6330('0x4b')](handleError(_0x3f26d7,null));};exports[_0x6330('0x9a')]=function(_0x3fc251,_0x6433c4,_0x1d2176){return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x3fc251[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x6433c4,null))['then'](function(_0x1c7542){if(_0x1c7542){return _0x1c7542['removeBlackLists'](_0x3fc251['query'][_0x6330('0x6b')]);}})['then'](function(_0x11beb0){if(_0x11beb0){return db[_0x6330('0x65')][_0x6330('0x29')]({'where':{'ListId':_0x3fc251['query'][_0x6330('0x6b')],'CampaignId':_0x3fc251['params']['id']}})[_0x6330('0x28')](function(){return _0x11beb0;});}})['then'](respondWithStatusCode(_0x6433c4,null))[_0x6330('0x4b')](handleError(_0x6433c4,null));};
\ No newline at end of file
+var _0xefd7=['h.id','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','sequelize','push','all','removeLists','getBlackLists','CmList','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','end','error','name','send','index','Campaign','rawAttributes','model','query','keys','filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','map','merge','includeAll','include','findAll','rows','fields','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','options','omit','createdAt','updatedAt','params','getHoppers','findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','order','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','deletedAt\x20IS\x20NULL'];(function(_0x40e60f,_0x5365e1){var _0x35511f=function(_0x41df2d){while(--_0x41df2d){_0x40e60f['push'](_0x40e60f['shift']());}};_0x35511f(++_0x5365e1);}(_0xefd7,0x99));var _0x7efd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefd7[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7efd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7efd('0x1'));var jsonpatch=require(_0x7efd('0x2'));var rp=require(_0x7efd('0x3'));var moment=require('moment');var BPromise=require(_0x7efd('0x4'));var Mustache=require(_0x7efd('0x5'));var util=require(_0x7efd('0x6'));var path=require(_0x7efd('0x7'));var sox=require('sox');var csv=require(_0x7efd('0x8'));var ejs=require(_0x7efd('0x9'));var fs=require('fs');var fs_extra=require(_0x7efd('0xa'));var _=require(_0x7efd('0xb'));var squel=require(_0x7efd('0xc'));var crypto=require(_0x7efd('0xd'));var jsforce=require(_0x7efd('0xe'));var deskjs=require(_0x7efd('0xf'));var toCsv=require(_0x7efd('0x8'));var querystring=require('querystring');var Papa=require(_0x7efd('0x10'));var Redis=require(_0x7efd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7efd('0x12'));var as=require(_0x7efd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7efd('0x14'))(_0x7efd('0x15'));var utils=require('../../config/utils');var config=require(_0x7efd('0x16'));var licenseUtil=require(_0x7efd('0x17'));var db=require(_0x7efd('0x18'))['db'];function respondWithStatusCode(_0x57269e,_0x5e017c){_0x5e017c=_0x5e017c||0xcc;return function(_0x424da9){if(_0x424da9){return _0x57269e[_0x7efd('0x19')](_0x5e017c);}return _0x57269e[_0x7efd('0x1a')](_0x5e017c)['end']();};}function respondWithResult(_0x17c1f4,_0x37e9f2){_0x37e9f2=_0x37e9f2||0xc8;return function(_0x237323){if(_0x237323){return _0x17c1f4['status'](_0x37e9f2)[_0x7efd('0x1b')](_0x237323);}};}function respondWithFilteredResult(_0x143cb2,_0x5280a2){return function(_0x196674){if(_0x196674){var _0x5affe3=typeof _0x5280a2[_0x7efd('0x1c')]===_0x7efd('0x1d')&&typeof _0x5280a2[_0x7efd('0x1e')]==='undefined';var _0x2a91e1=_0x196674[_0x7efd('0x1f')];var _0x3c0dc2=_0x5affe3?0x0:_0x5280a2[_0x7efd('0x1c')];var _0x47f98a=_0x5affe3?_0x196674['count']:_0x5280a2[_0x7efd('0x1c')]+_0x5280a2['limit'];var _0x58c994;if(_0x47f98a>=_0x2a91e1){_0x47f98a=_0x2a91e1;_0x58c994=0xc8;}else{_0x58c994=0xce;}_0x143cb2[_0x7efd('0x1a')](_0x58c994);return _0x143cb2[_0x7efd('0x20')](_0x7efd('0x21'),_0x3c0dc2+'-'+_0x47f98a+'/'+_0x2a91e1)[_0x7efd('0x1b')](_0x196674);}return null;};}function patchUpdates(_0x5db31e){return function(_0x4330dc){try{jsonpatch[_0x7efd('0x22')](_0x4330dc,_0x5db31e,!![]);}catch(_0x307568){return BPromise['reject'](_0x307568);}return _0x4330dc[_0x7efd('0x23')]();};}function saveUpdates(_0x45cc61,_0xbdd9f8){return function(_0x230714){if(_0x230714){return _0x230714[_0x7efd('0x24')](_0x45cc61)['then'](function(_0xd04f56){return _0xd04f56;});}return null;};}function removeEntity(_0x1dc48c,_0x127c86){return function(_0x35bdb6){if(_0x35bdb6){return _0x35bdb6[_0x7efd('0x25')]()[_0x7efd('0x26')](function(){var _0x3e3b74=_0x35bdb6[_0x7efd('0x27')]({'plain':!![]});var _0x4e604a=_0x7efd('0x28');return db[_0x7efd('0x29')][_0x7efd('0x25')]({'where':{'type':_0x4e604a,'resourceId':_0x3e3b74['id']}})['then'](function(){return _0x35bdb6;});})[_0x7efd('0x26')](function(){_0x1dc48c[_0x7efd('0x1a')](0xcc)[_0x7efd('0x2a')]();});}};}function handleEntityNotFound(_0x500b6e,_0x433588){return function(_0x563b1f){if(!_0x563b1f){_0x500b6e[_0x7efd('0x19')](0x194);}return _0x563b1f;};}function handleError(_0x81309e,_0x319feb){_0x319feb=_0x319feb||0x1f4;return function(_0x4d3c68){logger[_0x7efd('0x2b')](_0x4d3c68['stack']);if(_0x4d3c68['name']){delete _0x4d3c68[_0x7efd('0x2c')];}_0x81309e[_0x7efd('0x1a')](_0x319feb)[_0x7efd('0x2d')](_0x4d3c68);};}exports[_0x7efd('0x2e')]=function(_0x332967,_0x26cbee){var _0x38fa07={},_0x2fa66e={},_0x123c11={'count':0x0,'rows':[]};var _0x43aa5b=_['map'](db[_0x7efd('0x2f')][_0x7efd('0x30')],function(_0x13b057){return{'name':_0x13b057['fieldName'],'type':_0x13b057['type']['key']};});_0x2fa66e[_0x7efd('0x31')]=_['map'](_0x43aa5b,_0x7efd('0x2c'));_0x2fa66e[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x332967[_0x7efd('0x32')]);_0x2fa66e[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x2fa66e['model'],_0x2fa66e[_0x7efd('0x32')]);_0x38fa07['attributes']=_[_0x7efd('0x35')](_0x2fa66e[_0x7efd('0x31')],qs['fields'](_0x332967['query']['fields']));_0x38fa07['attributes']=_0x38fa07[_0x7efd('0x36')]['length']?_0x38fa07['attributes']:_0x2fa66e[_0x7efd('0x31')];if(!_0x332967[_0x7efd('0x32')][_0x7efd('0x37')]('nolimit')){_0x38fa07[_0x7efd('0x1e')]=qs[_0x7efd('0x1e')](_0x332967[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x38fa07[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x332967[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x38fa07['order']=qs[_0x7efd('0x38')](_0x332967[_0x7efd('0x32')]['sort']);_0x38fa07[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0x332967[_0x7efd('0x32')],_0x2fa66e['filters']),_0x43aa5b);if(_0x332967['query'][_0x7efd('0x3b')]){_0x38fa07[_0x7efd('0x39')]=_['merge'](_0x38fa07[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x43aa5b,function(_0x13481c){if(_0x13481c['type']!=='VIRTUAL'){var _0x57aa0b={};_0x57aa0b[_0x13481c[_0x7efd('0x2c')]]={'$like':'%'+_0x332967[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x57aa0b;}})});}_0x38fa07=_[_0x7efd('0x3d')]({},_0x38fa07,_0x332967['options']);var _0x53a63b={'where':_0x38fa07['where']};return db[_0x7efd('0x2f')][_0x7efd('0x1f')](_0x53a63b)['then'](function(_0x2ba456){_0x123c11['count']=_0x2ba456;if(_0x332967[_0x7efd('0x32')][_0x7efd('0x3e')]){_0x38fa07[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x2f')][_0x7efd('0x40')](_0x38fa07);})[_0x7efd('0x26')](function(_0x34597a){_0x123c11[_0x7efd('0x41')]=_0x34597a;return _0x123c11;})[_0x7efd('0x26')](respondWithFilteredResult(_0x26cbee,_0x38fa07))['catch'](handleError(_0x26cbee,null));};exports['show']=function(_0x1fdd69,_0x13a533){var _0x5a47ac={'raw':![],'where':{'id':_0x1fdd69['params']['id']}},_0x47e86e={};_0x47e86e['model']=_[_0x7efd('0x33')](db['Campaign']['rawAttributes']);_0x47e86e['query']=_[_0x7efd('0x33')](_0x1fdd69['query']);_0x47e86e['filters']=_[_0x7efd('0x35')](_0x47e86e[_0x7efd('0x31')],_0x47e86e['query']);_0x5a47ac[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x47e86e[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x1fdd69[_0x7efd('0x32')][_0x7efd('0x42')]));_0x5a47ac['attributes']=_0x5a47ac['attributes'][_0x7efd('0x43')]?_0x5a47ac[_0x7efd('0x36')]:_0x47e86e[_0x7efd('0x31')];if(_0x1fdd69['query'][_0x7efd('0x3e')]){_0x5a47ac[_0x7efd('0x3f')]=[{'all':!![]}];}_0x5a47ac=_[_0x7efd('0x3d')]({},_0x5a47ac,_0x1fdd69['options']);return db[_0x7efd('0x2f')][_0x7efd('0x44')](_0x5a47ac)[_0x7efd('0x26')](handleEntityNotFound(_0x13a533,null))[_0x7efd('0x26')](respondWithResult(_0x13a533,null))[_0x7efd('0x45')](handleError(_0x13a533,null));};exports[_0x7efd('0x46')]=function(_0x5b41dc,_0x320b6d){return db[_0x7efd('0x2f')][_0x7efd('0x46')](_0x5b41dc[_0x7efd('0x47')],{})[_0x7efd('0x26')](function(_0x306a44){var _0x2c1d24=_0x5b41dc[_0x7efd('0x48')]['get']({'plain':!![]});if(!_0x2c1d24)throw new Error(_0x7efd('0x49'));if(_0x2c1d24[_0x7efd('0x4a')]==='user'){var _0x42d37a=_0x306a44[_0x7efd('0x27')]({'plain':!![]});var _0x30706b=_0x7efd('0x28');return db[_0x7efd('0x4b')][_0x7efd('0x44')]({'where':{'name':_0x30706b,'userProfileId':_0x2c1d24['userProfileId']},'raw':!![]})[_0x7efd('0x26')](function(_0x25099e){if(_0x25099e&&_0x25099e[_0x7efd('0x4c')]===0x0){return db[_0x7efd('0x29')][_0x7efd('0x46')]({'name':_0x42d37a[_0x7efd('0x2c')],'resourceId':_0x42d37a['id'],'type':_0x25099e[_0x7efd('0x2c')],'sectionId':_0x25099e['id']},{})[_0x7efd('0x26')](function(){return _0x306a44;});}else{return _0x306a44;}})[_0x7efd('0x45')](function(_0x40773a){logger[_0x7efd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40773a);throw _0x40773a;});}return _0x306a44;})[_0x7efd('0x26')](respondWithResult(_0x320b6d,0xc9))['catch'](handleError(_0x320b6d,null));};exports[_0x7efd('0x4d')]=function(_0x53e3f9,_0x4b8e29){var _0x48e111={'where':{'id':_0x53e3f9['params']['id']}},_0x4d01b9={};_0x4d01b9['model']=_['keys'](db['Campaign'][_0x7efd('0x30')]);_0x48e111[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x4d01b9[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x53e3f9[_0x7efd('0x32')][_0x7efd('0x42')]));_0x48e111[_0x7efd('0x36')]=_0x48e111[_0x7efd('0x36')][_0x7efd('0x43')]?_0x48e111['attributes']:_0x4d01b9[_0x7efd('0x31')];if(_0x53e3f9[_0x7efd('0x32')]['includeAll']){_0x48e111['include']=[{'all':!![]}];}_0x48e111=_[_0x7efd('0x3d')]({},_0x48e111,_0x53e3f9[_0x7efd('0x4e')]);return db['Campaign']['find'](_0x48e111)['then'](handleEntityNotFound(_0x4b8e29,null))[_0x7efd('0x26')](function(_0x548aa1){if(_0x548aa1){var _0x4a31c7=_0x548aa1['get']({'plain':!![]});_0x4a31c7=qs[_0x7efd('0x4f')](_0x4a31c7,['id',_0x7efd('0x50'),_0x7efd('0x51')]);_0x53e3f9[_0x7efd('0x47')]=_[_0x7efd('0x4f')](_0x53e3f9[_0x7efd('0x47')],['id',_0x7efd('0x50'),_0x7efd('0x51')]);return db[_0x7efd('0x2f')]['create'](_['merge'](_0x4a31c7,_0x53e3f9['body']),{'include':_0x53e3f9['query'][_0x7efd('0x3e')]?[{'all':!![]}]:undefined})[_0x7efd('0x26')](function(_0x39961c){var _0x54ba4d=_0x53e3f9[_0x7efd('0x48')]['get']({'plain':!![]});if(!_0x54ba4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54ba4d[_0x7efd('0x4a')]==='user'){var _0x222b9e=_0x39961c[_0x7efd('0x27')]({'plain':!![]});var _0x5c126f=_0x7efd('0x28');return db['UserProfileSection'][_0x7efd('0x44')]({'where':{'name':_0x5c126f,'userProfileId':_0x54ba4d['userProfileId']},'raw':!![]})[_0x7efd('0x26')](function(_0x241709){if(_0x241709&&_0x241709[_0x7efd('0x4c')]===0x0){return db[_0x7efd('0x29')][_0x7efd('0x46')]({'name':_0x222b9e[_0x7efd('0x2c')],'resourceId':_0x222b9e['id'],'type':_0x241709['name'],'sectionId':_0x241709['id']},{})[_0x7efd('0x26')](function(){return _0x39961c;});}else{return _0x39961c;}})['catch'](function(_0x32e001){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32e001);throw _0x32e001;});}return _0x39961c;});}})[_0x7efd('0x26')](respondWithResult(_0x4b8e29,0xc9))[_0x7efd('0x45')](handleError(_0x4b8e29,null));};exports[_0x7efd('0x24')]=function(_0x162721,_0xc0fb5c){if(_0x162721['body']['id']){delete _0x162721[_0x7efd('0x47')]['id'];}return db['Campaign']['find']({'where':{'id':_0x162721[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xc0fb5c,null))[_0x7efd('0x26')](saveUpdates(_0x162721[_0x7efd('0x47')],null))['then'](respondWithResult(_0xc0fb5c,null))[_0x7efd('0x45')](handleError(_0xc0fb5c,null));};exports[_0x7efd('0x25')]=function(_0x260888,_0x16737c){return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x260888[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x16737c,null))[_0x7efd('0x26')](removeEntity(_0x16737c,null))[_0x7efd('0x45')](handleError(_0x16737c,null));};exports[_0x7efd('0x53')]=function(_0x802460,_0x1a9232,_0x3fdbbc){var _0x5636dd={'raw':!![],'where':{}};var _0x58a6c2={};var _0x1175b2={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x802460[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x1a9232,null))[_0x7efd('0x26')](function(_0x513de5){if(_0x513de5){_0x58a6c2[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x55')]['rawAttributes']);_0x58a6c2[_0x7efd('0x32')]=_['keys'](_0x802460[_0x7efd('0x32')]);_0x58a6c2['filters']=_[_0x7efd('0x35')](_0x58a6c2[_0x7efd('0x31')],_0x58a6c2['query']);_0x5636dd[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x58a6c2['model'],qs['fields'](_0x802460['query'][_0x7efd('0x42')]));_0x5636dd['attributes']=_0x5636dd[_0x7efd('0x36')][_0x7efd('0x43')]?_0x5636dd['attributes']:_0x58a6c2[_0x7efd('0x31')];if(!_0x802460[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x5636dd[_0x7efd('0x1e')]=qs['limit'](_0x802460[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x5636dd[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x802460['query']['offset']);}_0x5636dd['order']=qs[_0x7efd('0x38')](_0x802460[_0x7efd('0x32')][_0x7efd('0x38')]);_0x5636dd['where']=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x802460['query'],_0x58a6c2[_0x7efd('0x34')]));_0x5636dd['where']['CampaignId']=_0x513de5['id'];if(_0x802460[_0x7efd('0x32')]['filter']){_0x5636dd['where']=_[_0x7efd('0x3d')](_0x5636dd['where'],{'$or':_[_0x7efd('0x3c')](_0x5636dd[_0x7efd('0x36')],function(_0x1831d6){var _0x32d013={};_0x32d013[_0x1831d6]={'$like':'%'+_0x802460[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x32d013;})});}_0x5636dd=_[_0x7efd('0x3d')]({},_0x5636dd,_0x802460[_0x7efd('0x4e')]);return db[_0x7efd('0x55')][_0x7efd('0x1f')]({'where':_0x5636dd[_0x7efd('0x39')]})[_0x7efd('0x26')](function(_0x1281f7){_0x1175b2[_0x7efd('0x1f')]=_0x1281f7;if(_0x802460[_0x7efd('0x32')]['includeAll']){_0x5636dd[_0x7efd('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0x7efd('0x40')](_0x5636dd);})[_0x7efd('0x26')](function(_0x338df0){_0x1175b2[_0x7efd('0x41')]=_0x338df0;return _0x1175b2;});}})['then'](respondWithFilteredResult(_0x1a9232,_0x5636dd))[_0x7efd('0x45')](handleError(_0x1a9232,null));};exports[_0x7efd('0x57')]=function(_0x332383,_0xd864b,_0x3e7efb){var _0x1a541f={'raw':!![],'where':{}};var _0x5833a2={};var _0x46bf7f={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x332383[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xd864b,null))['then'](function(_0x453fef){if(_0x453fef){_0x5833a2[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x58')][_0x7efd('0x30')]);_0x5833a2[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x332383[_0x7efd('0x32')]);_0x5833a2[_0x7efd('0x34')]=_['intersection'](_0x5833a2[_0x7efd('0x31')],_0x5833a2['query']);_0x1a541f[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x5833a2['model'],qs[_0x7efd('0x42')](_0x332383['query'][_0x7efd('0x42')]));_0x1a541f['attributes']=_0x1a541f[_0x7efd('0x36')][_0x7efd('0x43')]?_0x1a541f[_0x7efd('0x36')]:_0x5833a2[_0x7efd('0x31')];if(!_0x332383[_0x7efd('0x32')]['hasOwnProperty'](_0x7efd('0x56'))){_0x1a541f[_0x7efd('0x1e')]=qs[_0x7efd('0x1e')](_0x332383[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x1a541f[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x332383[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x1a541f[_0x7efd('0x59')]=qs[_0x7efd('0x38')](_0x332383[_0x7efd('0x32')]['sort']);_0x1a541f[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_['pick'](_0x332383['query'],_0x5833a2[_0x7efd('0x34')]));_0x1a541f[_0x7efd('0x39')][_0x7efd('0x5a')]=_0x453fef['id'];if(_0x332383['query'][_0x7efd('0x3b')]){_0x1a541f[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x1a541f[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x1a541f[_0x7efd('0x36')],function(_0x424d8d){var _0x5d5028={};_0x5d5028[_0x424d8d]={'$like':'%'+_0x332383[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x5d5028;})});}_0x1a541f=_[_0x7efd('0x3d')]({},_0x1a541f,_0x332383[_0x7efd('0x4e')]);return db['CmHopperHistory'][_0x7efd('0x1f')]({'where':_0x1a541f['where']})[_0x7efd('0x26')](function(_0xbecabd){_0x46bf7f[_0x7efd('0x1f')]=_0xbecabd;if(_0x332383['query'][_0x7efd('0x3e')]){_0x1a541f[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x58')][_0x7efd('0x40')](_0x1a541f);})[_0x7efd('0x26')](function(_0x4c31aa){_0x46bf7f['rows']=_0x4c31aa;return _0x46bf7f;});}})[_0x7efd('0x26')](respondWithFilteredResult(_0xd864b,_0x1a541f))[_0x7efd('0x45')](handleError(_0xd864b,null));};exports['getHopperFinals']=function(_0x13e891,_0x5a24e9,_0x221ba2){var _0x1601a6={'raw':!![],'where':{}};var _0x1a4444={};var _0x38c128={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x13e891['params']['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x5a24e9,null))[_0x7efd('0x26')](function(_0x4dd443){if(_0x4dd443){_0x1a4444['model']=_[_0x7efd('0x33')](db['CmHopperFinal'][_0x7efd('0x30')]);_0x1a4444[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x13e891[_0x7efd('0x32')]);_0x1a4444[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x1a4444['model'],_0x1a4444['query']);_0x1601a6[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x1a4444[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x13e891['query'][_0x7efd('0x42')]));_0x1601a6[_0x7efd('0x36')]=_0x1601a6[_0x7efd('0x36')][_0x7efd('0x43')]?_0x1601a6['attributes']:_0x1a4444[_0x7efd('0x31')];if(!_0x13e891[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x1601a6[_0x7efd('0x1e')]=qs['limit'](_0x13e891['query'][_0x7efd('0x1e')]);_0x1601a6[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x13e891[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x1601a6[_0x7efd('0x59')]=qs[_0x7efd('0x38')](_0x13e891[_0x7efd('0x32')]['sort']);_0x1601a6[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x13e891[_0x7efd('0x32')],_0x1a4444[_0x7efd('0x34')]));_0x1601a6[_0x7efd('0x39')]['CampaignId']=_0x4dd443['id'];if(_0x13e891['query'][_0x7efd('0x3b')]){_0x1601a6[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x1601a6[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x1601a6[_0x7efd('0x36')],function(_0x576fcc){var _0x38e9a9={};_0x38e9a9[_0x576fcc]={'$like':'%'+_0x13e891[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x38e9a9;})});}_0x1601a6=_['merge']({},_0x1601a6,_0x13e891[_0x7efd('0x4e')]);return db[_0x7efd('0x5b')][_0x7efd('0x1f')]({'where':_0x1601a6[_0x7efd('0x39')]})['then'](function(_0x5ed761){_0x38c128[_0x7efd('0x1f')]=_0x5ed761;if(_0x13e891[_0x7efd('0x32')][_0x7efd('0x3e')]){_0x1601a6[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x5b')]['findAll'](_0x1601a6);})[_0x7efd('0x26')](function(_0x4be134){_0x38c128['rows']=_0x4be134;return _0x38c128;});}})[_0x7efd('0x26')](respondWithFilteredResult(_0x5a24e9,_0x1601a6))[_0x7efd('0x45')](handleError(_0x5a24e9,null));};exports[_0x7efd('0x5c')]=function(_0x467cb0,_0xe2d0b8,_0x27e0cc){var _0x2177e3={'raw':!![],'where':{}};var _0x4b08f3={};var _0xb9c016={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')]['findOne']({'where':{'id':_0x467cb0['params']['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xe2d0b8,null))['then'](function(_0x5e2dae){if(_0x5e2dae){_0x4b08f3[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x5d')][_0x7efd('0x30')]);_0x4b08f3[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x467cb0['query']);_0x4b08f3[_0x7efd('0x34')]=_['intersection'](_0x4b08f3[_0x7efd('0x31')],_0x4b08f3[_0x7efd('0x32')]);_0x2177e3['attributes']=_['intersection'](_0x4b08f3['model'],qs['fields'](_0x467cb0[_0x7efd('0x32')][_0x7efd('0x42')]));_0x2177e3['attributes']=_0x2177e3[_0x7efd('0x36')][_0x7efd('0x43')]?_0x2177e3[_0x7efd('0x36')]:_0x4b08f3['model'];if(!_0x467cb0[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x2177e3['limit']=qs[_0x7efd('0x1e')](_0x467cb0[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x2177e3[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x467cb0['query'][_0x7efd('0x1c')]);}_0x2177e3[_0x7efd('0x59')]=qs['sort'](_0x467cb0[_0x7efd('0x32')][_0x7efd('0x38')]);_0x2177e3[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0x467cb0['query'],_0x4b08f3[_0x7efd('0x34')]));_0x2177e3[_0x7efd('0x39')]['CampaignId']=_0x5e2dae['id'];if(_0x467cb0[_0x7efd('0x32')][_0x7efd('0x3b')]){_0x2177e3[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x2177e3[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x2177e3['attributes'],function(_0x291a87){var _0x107e20={};_0x107e20[_0x291a87]={'$like':'%'+_0x467cb0[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x107e20;})});}_0x2177e3=_[_0x7efd('0x3d')]({},_0x2177e3,_0x467cb0[_0x7efd('0x4e')]);return db[_0x7efd('0x5d')][_0x7efd('0x1f')]({'where':_0x2177e3[_0x7efd('0x39')]})[_0x7efd('0x26')](function(_0x9c4e51){_0xb9c016['count']=_0x9c4e51;if(_0x467cb0[_0x7efd('0x32')]['includeAll']){_0x2177e3[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x5d')][_0x7efd('0x40')](_0x2177e3);})['then'](function(_0xa1bcdd){_0xb9c016[_0x7efd('0x41')]=_0xa1bcdd;return _0xb9c016;});}})['then'](respondWithFilteredResult(_0xe2d0b8,_0x2177e3))['catch'](handleError(_0xe2d0b8,null));};exports[_0x7efd('0x5e')]=function(_0x331fa8,_0x1060fa,_0x162380){var _0x26b442={};var _0x201066={};var _0xe4db11;var _0x18f5bb;return db['Campaign']['findOne']({'where':{'id':_0x331fa8['params']['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x1060fa,null))['then'](function(_0x21575c){if(_0x21575c){_0xe4db11=_0x21575c;_0x201066[_0x7efd('0x31')]=_[_0x7efd('0x33')](db['CmList']['rawAttributes']);_0x201066[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x331fa8['query']);_0x201066[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x201066[_0x7efd('0x31')],_0x201066[_0x7efd('0x32')]);_0x26b442[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x201066[_0x7efd('0x31')],qs['fields'](_0x331fa8[_0x7efd('0x32')][_0x7efd('0x42')]));_0x26b442['attributes']=_0x26b442[_0x7efd('0x36')][_0x7efd('0x43')]?_0x26b442['attributes']:_0x201066['model'];_0x26b442['order']=qs[_0x7efd('0x38')](_0x331fa8[_0x7efd('0x32')][_0x7efd('0x38')]);_0x26b442[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x331fa8[_0x7efd('0x32')],_0x201066[_0x7efd('0x34')]));if(_0x331fa8[_0x7efd('0x32')]['filter']){_0x26b442['where']=_[_0x7efd('0x3d')](_0x26b442['where'],{'$or':_['map'](_0x26b442[_0x7efd('0x36')],function(_0x4d241c){var _0x262fcf={};_0x262fcf[_0x4d241c]={'$like':'%'+_0x331fa8['query'][_0x7efd('0x3b')]+'%'};return _0x262fcf;})});}_0x26b442=_[_0x7efd('0x3d')]({},_0x26b442,_0x331fa8['options']);return _0xe4db11['getLists'](_0x26b442);}})[_0x7efd('0x26')](function(_0x20d025){if(_0x20d025){_0x18f5bb=_0x20d025[_0x7efd('0x43')];if(!_0x331fa8[_0x7efd('0x32')]['hasOwnProperty'](_0x7efd('0x56'))){_0x26b442['limit']=qs[_0x7efd('0x1e')](_0x331fa8['query'][_0x7efd('0x1e')]);_0x26b442['offset']=qs['offset'](_0x331fa8['query'][_0x7efd('0x1c')]);}return _0xe4db11[_0x7efd('0x5e')](_0x26b442);}})[_0x7efd('0x26')](function(_0x14b042){if(_0x14b042){return _0x14b042?{'count':_0x18f5bb,'rows':_0x14b042}:null;}})[_0x7efd('0x26')](respondWithResult(_0x1060fa,null))[_0x7efd('0x45')](handleError(_0x1060fa,null));};exports[_0x7efd('0x5f')]=function(_0x528253,_0x5bc084,_0x5d4d96){var _0x358a22,_0x5be137;var _0x1bd50b=[];var _0x2bd409=moment()[_0x7efd('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x528253['params']['id']}})['then'](handleEntityNotFound(_0x5bc084,null))[_0x7efd('0x26')](function(_0x4ac3e6){if(_0x4ac3e6){_0x5be137=_0x4ac3e6;return _0x4ac3e6[_0x7efd('0x5f')](_0x528253[_0x7efd('0x47')][_0x7efd('0x61')],_['omit'](_0x528253[_0x7efd('0x47')],[_0x7efd('0x61'),'id'])||{});}return null;})[_0x7efd('0x62')](function(_0x1dc4a){var _0x44dfa9;var _0x47da43;_0x358a22=_0x1dc4a||[];var _0x3bfd24=[];if(_0x1dc4a){for(var _0x13e605=0x0;_0x13e605<_0x1dc4a['length'];_0x13e605+=0x1){var _0x4799fb=_0x1dc4a[_0x13e605][_0x7efd('0x27')]({'plain':!![]});_0x5be137[_0x7efd('0x63')]=_0x528253[_0x7efd('0x47')][_0x7efd('0x63')]?_0x528253['body'][_0x7efd('0x63')]:_0x5be137[_0x7efd('0x63')];switch(_0x5be137[_0x7efd('0x63')]){case'always':_0x44dfa9=squel[_0x7efd('0x64')]()[_0x7efd('0x65')]('cm_hopper')[_0x7efd('0x66')]([_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),_0x7efd('0x6a'),_0x7efd('0x5a'),'createdAt',_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')](_0x7efd('0x67'),'phone')[_0x7efd('0x6c')](_0x7efd('0x6d'),'scheduledAt')[_0x7efd('0x6c')]('id',_0x7efd('0x69'))['field'](_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')](),_0x7efd('0x6a'))[_0x7efd('0x6c')](_0x528253[_0x7efd('0x52')]['id'][_0x7efd('0x6f')](),_0x7efd('0x5a'))['field']('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27','updatedAt')[_0x7efd('0x70')](_0x7efd('0x71'))[_0x7efd('0x39')]('deletedAt\x20IS\x20NULL')['where'](_0x7efd('0x72'),_0x4799fb['CmListId'][_0x7efd('0x6f')]())[_0x7efd('0x39')](_0x7efd('0x73'))[_0x7efd('0x39')](_0x7efd('0x74'),squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x7efd('0x70')]('cm_hopper_final')[_0x7efd('0x39')]('CampaignId\x20=\x20?',_0x528253['params']['id'][_0x7efd('0x6f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x7efd('0x6b')]()['field'](_0x7efd('0x75'))[_0x7efd('0x70')](_0x7efd('0x76'))[_0x7efd('0x39')](_0x7efd('0x77'),_0x528253[_0x7efd('0x52')]['id'][_0x7efd('0x6f')]())))['toString']();break;case'onlyIfOpen':_0x44dfa9=squel[_0x7efd('0x64')]()[_0x7efd('0x65')]('cm_hopper')[_0x7efd('0x66')]([_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),'ListId',_0x7efd('0x5a'),_0x7efd('0x50'),_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')]('phone','phone')['field'](_0x7efd('0x6d'),'scheduledAt')[_0x7efd('0x6c')]('id',_0x7efd('0x69'))[_0x7efd('0x6c')](_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')](),'ListId')[_0x7efd('0x6c')](_0x528253[_0x7efd('0x52')]['id'][_0x7efd('0x6f')](),_0x7efd('0x5a'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27','updatedAt')[_0x7efd('0x70')](_0x7efd('0x71'))[_0x7efd('0x39')](_0x7efd('0x78'))['where'](_0x7efd('0x72'),_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')]())[_0x7efd('0x39')](_0x7efd('0x73'))[_0x7efd('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')]('COALESCE(phone,\x27\x27)')[_0x7efd('0x70')](_0x7efd('0x76'))[_0x7efd('0x39')](_0x7efd('0x77'),_0x528253[_0x7efd('0x52')]['id']['toString']())))['toString']();break;default:_0x44dfa9=squel[_0x7efd('0x64')]()['into'](_0x7efd('0x76'))[_0x7efd('0x66')]([_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),'ListId',_0x7efd('0x5a'),'createdAt','updatedAt'],squel['select']()[_0x7efd('0x6c')](_0x7efd('0x67'),_0x7efd('0x67'))[_0x7efd('0x6c')](_0x7efd('0x6d'),_0x7efd('0x68'))[_0x7efd('0x6c')]('id',_0x7efd('0x69'))[_0x7efd('0x6c')](_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')](),_0x7efd('0x6a'))[_0x7efd('0x6c')](_0x528253['params']['id'][_0x7efd('0x6f')](),_0x7efd('0x5a'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x51'))['from'](_0x7efd('0x71'))[_0x7efd('0x39')]('deletedAt\x20IS\x20NULL')[_0x7efd('0x39')]('ListId\x20=\x20?',_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')]())['where'](_0x7efd('0x73')))[_0x7efd('0x6f')]();}_0x47da43=squel[_0x7efd('0x64')]()[_0x7efd('0x65')]('cm_hopper_additional_phones')[_0x7efd('0x66')](['cmHopperId','scheduledAt','phone','OrderBy',_0x7efd('0x50'),_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')](_0x7efd('0x79'),'id')[_0x7efd('0x6c')]('NOW()','scheduledAt')[_0x7efd('0x6c')]('ci.item',_0x7efd('0x67'))[_0x7efd('0x6c')]('ci.OrderBY',_0x7efd('0x7a'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x51'))['from'](_0x7efd('0x7b'),'ci')[_0x7efd('0x7c')](_0x7efd('0x76'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x7efd('0x39')](_0x7efd('0x7d'),_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')]())[_0x7efd('0x39')](_0x7efd('0x7e'),_0x528253[_0x7efd('0x52')]['id']['toString']())[_0x7efd('0x39')]('h.createdAt\x20=\x20?',_0x2bd409))['toString']();_0x3bfd24['push'](db[_0x7efd('0x7f')][_0x7efd('0x32')](_0x44dfa9));_0x1bd50b[_0x7efd('0x80')](db[_0x7efd('0x7f')][_0x7efd('0x32')](_0x47da43));}return BPromise[_0x7efd('0x81')](_0x3bfd24);}})[_0x7efd('0x26')](function(){return BPromise[_0x7efd('0x81')](_0x1bd50b);})['then'](function(){return _0x358a22;})[_0x7efd('0x26')](respondWithResult(_0x5bc084,null))[_0x7efd('0x45')](handleError(_0x5bc084,null));};exports[_0x7efd('0x82')]=function(_0x183027,_0x15eb12,_0x21a185){return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x183027[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x15eb12,null))[_0x7efd('0x26')](function(_0x5e9881){if(_0x5e9881){return _0x5e9881[_0x7efd('0x82')](_0x183027['query'][_0x7efd('0x61')]);}})['then'](function(_0x24c5a2){if(_0x24c5a2){return db[_0x7efd('0x55')][_0x7efd('0x25')]({'where':{'ListId':_0x183027['query'][_0x7efd('0x61')],'CampaignId':_0x183027['params']['id']}})[_0x7efd('0x26')](function(){return _0x24c5a2;});}})[_0x7efd('0x26')](respondWithStatusCode(_0x15eb12,null))[_0x7efd('0x45')](handleError(_0x15eb12,null));};exports[_0x7efd('0x83')]=function(_0xd20f4f,_0x116536,_0xf7fd10){var _0x21ae04={};var _0x3ef568={};var _0x5c766d;var _0x1048d9;return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0xd20f4f[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x116536,null))[_0x7efd('0x26')](function(_0xb469b0){if(_0xb469b0){_0x5c766d=_0xb469b0;_0x3ef568[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x84')]['rawAttributes']);_0x3ef568[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0xd20f4f[_0x7efd('0x32')]);_0x3ef568[_0x7efd('0x34')]=_['intersection'](_0x3ef568['model'],_0x3ef568['query']);_0x21ae04[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x3ef568['model'],qs[_0x7efd('0x42')](_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x42')]));_0x21ae04[_0x7efd('0x36')]=_0x21ae04[_0x7efd('0x36')]['length']?_0x21ae04['attributes']:_0x3ef568[_0x7efd('0x31')];_0x21ae04['order']=qs[_0x7efd('0x38')](_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x38')]);_0x21ae04[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0xd20f4f['query'],_0x3ef568[_0x7efd('0x34')]));if(_0xd20f4f['query']['filter']){_0x21ae04['where']=_[_0x7efd('0x3d')](_0x21ae04[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x21ae04[_0x7efd('0x36')],function(_0x2ba999){var _0x382d49={};_0x382d49[_0x2ba999]={'$like':'%'+_0xd20f4f['query'][_0x7efd('0x3b')]+'%'};return _0x382d49;})});}_0x21ae04=_['merge']({},_0x21ae04,_0xd20f4f['options']);return _0x5c766d[_0x7efd('0x83')](_0x21ae04);}})[_0x7efd('0x26')](function(_0x1f8ee9){if(_0x1f8ee9){_0x1048d9=_0x1f8ee9[_0x7efd('0x43')];if(!_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x21ae04[_0x7efd('0x1e')]=qs['limit'](_0xd20f4f['query']['limit']);_0x21ae04[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x1c')]);}return _0x5c766d['getBlackLists'](_0x21ae04);}})[_0x7efd('0x26')](function(_0x12f58c){if(_0x12f58c){return _0x12f58c?{'count':_0x1048d9,'rows':_0x12f58c}:null;}})[_0x7efd('0x26')](respondWithResult(_0x116536,null))[_0x7efd('0x45')](handleError(_0x116536,null));};exports[_0x7efd('0x85')]=function(_0x46f959,_0x2c3ddd,_0x557e9f){var _0x34857f,_0x5f1309;var _0x106203=[];var _0x17a6db=moment()[_0x7efd('0x60')](_0x7efd('0x86'));return db['Campaign'][_0x7efd('0x44')]({'where':{'id':_0x46f959[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x2c3ddd,null))[_0x7efd('0x26')](function(_0x44ce02){if(_0x44ce02){_0x5f1309=_0x44ce02;return _0x44ce02[_0x7efd('0x85')](_0x46f959[_0x7efd('0x47')][_0x7efd('0x61')],_[_0x7efd('0x4f')](_0x46f959[_0x7efd('0x47')],['ids','id'])||{});}return null;})[_0x7efd('0x62')](function(_0x47b494){var _0x4887db;var _0x4282d7;_0x34857f=_0x47b494||[];var _0x52d5f9=[];if(_0x47b494){for(var _0x2621d7=0x0;_0x2621d7<_0x47b494[_0x7efd('0x43')];_0x2621d7+=0x1){var _0x5b464f=_0x47b494[_0x2621d7][_0x7efd('0x27')]({'plain':!![]});_0x4887db=squel[_0x7efd('0x64')]()[_0x7efd('0x65')](_0x7efd('0x87'))[_0x7efd('0x66')](['phone',_0x7efd('0x69'),_0x7efd('0x6a'),'CampaignId',_0x7efd('0x50'),_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')](_0x7efd('0x67'),_0x7efd('0x67'))['field']('id',_0x7efd('0x69'))[_0x7efd('0x6c')](_0x5b464f[_0x7efd('0x6e')][_0x7efd('0x6f')](),_0x7efd('0x6a'))[_0x7efd('0x6c')](_0x46f959[_0x7efd('0x52')]['id']['toString'](),'CampaignId')[_0x7efd('0x6c')](_0x7efd('0x6d'),'createdAt')[_0x7efd('0x6c')]('NOW()',_0x7efd('0x51'))['from'](_0x7efd('0x71'))[_0x7efd('0x39')](_0x7efd('0x78'))[_0x7efd('0x39')](_0x7efd('0x72'),_0x5b464f[_0x7efd('0x6e')]['toString']())[_0x7efd('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x7efd('0x6f')]();_0x52d5f9['push'](db[_0x7efd('0x7f')][_0x7efd('0x32')](_0x4887db));}return BPromise[_0x7efd('0x81')](_0x52d5f9);}})[_0x7efd('0x26')](function(){return _0x34857f;})[_0x7efd('0x26')](respondWithResult(_0x2c3ddd,null))[_0x7efd('0x45')](handleError(_0x2c3ddd,null));};exports['removeBlackLists']=function(_0x120408,_0x4bbdb5,_0x2b8b52){return db['Campaign'][_0x7efd('0x44')]({'where':{'id':_0x120408[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x4bbdb5,null))[_0x7efd('0x26')](function(_0x4188ed){if(_0x4188ed){return _0x4188ed[_0x7efd('0x88')](_0x120408[_0x7efd('0x32')][_0x7efd('0x61')]);}})[_0x7efd('0x26')](function(_0x427263){if(_0x427263){return db['CmHopperBlack'][_0x7efd('0x25')]({'where':{'ListId':_0x120408[_0x7efd('0x32')][_0x7efd('0x61')],'CampaignId':_0x120408[_0x7efd('0x52')]['id']}})['then'](function(){return _0x427263;});}})[_0x7efd('0x26')](respondWithStatusCode(_0x4bbdb5,null))['catch'](handleError(_0x4bbdb5,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 62ce57e..92c85f6 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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0x7a54,0x106));var _0x47a5=function(_0x46a0ef,_0x30e507){_0x46a0ef=_0x46a0ef-0x0;var _0xb91d5a=_0x7a54[_0x46a0ef];return _0xb91d5a;};'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 4fc9068..08ffe06 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 _0x4c4e=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird'];(function(_0x385c20,_0xa43d3c){var _0x3787e4=function(_0x5f09bd){while(--_0x5f09bd){_0x385c20['push'](_0x385c20['shift']());}};_0x3787e4(++_0xa43d3c);}(_0x4c4e,0x152));var _0xe4c4=function(_0x41890e,_0x4f16fe){_0x41890e=_0x41890e-0x0;var _0xbfafe4=_0x4c4e[_0x41890e];return _0xbfafe4;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('Campaign,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('Campaign,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});}exports[_0xe4c4('0x15')]=function(_0x42242c){var _0x3820c7=this;return new Promise(function(_0x43a9ce,_0x376585){return db['Campaign'][_0xe4c4('0x16')]({'raw':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x18')]===undefined?!![]:![]:!![],'where':_0x42242c['options']?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x19')]||null:null,'attributes':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1a')]||null:null,'limit':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1b')]||null:null,'include':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1c')]?_[_0xe4c4('0x1d')](_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1c')],function(_0x15873e){return{'model':db[_0x15873e['model']],'as':_0x15873e['as'],'attributes':_0x15873e['attributes'],'include':_0x15873e[_0xe4c4('0x1c')]?_['map'](_0x15873e[_0xe4c4('0x1c')],function(_0x5374fd){return{'model':db[_0x5374fd[_0xe4c4('0x1e')]],'as':_0x5374fd['as'],'attributes':_0x5374fd['attributes'],'include':_0x5374fd[_0xe4c4('0x1c')]?_['map'](_0x5374fd[_0xe4c4('0x1c')],function(_0x4a0199){return{'model':db[_0x4a0199['model']],'as':_0x4a0199['as'],'attributes':_0x4a0199['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3221cd){logger['info']('GetCampaign',_0x42242c);logger[_0xe4c4('0xe')](_0xe4c4('0x15'),_0x42242c,JSON['stringify'](_0x3221cd));_0x43a9ce(_0x3221cd);})['catch'](function(_0x7428ad){logger[_0xe4c4('0x10')]('GetCampaign',_0x7428ad[_0xe4c4('0x12')],_0x42242c);_0x376585(_0x3820c7[_0xe4c4('0x10')](0x1f4,_0x7428ad[_0xe4c4('0x12')]));});});};
\ No newline at end of file
+var _0x6737=['stringify','error','code','message','info','result','GetCampaign','Campaign','options','raw','where','attributes','include','map','model','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x6737,0xe2));var _0x7673=function(_0x275aab,_0x50582a){_0x275aab=_0x275aab-0x0;var _0x1e9eed=_0x6737[_0x275aab];return _0x1e9eed;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var moment=require(_0x7673('0x1'));var BPromise=require('bluebird');var rs=require(_0x7673('0x2'));var fs=require('fs');var Redis=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var utils=require(_0x7673('0x5'));var logger=require('../../config/logger')(_0x7673('0x6'));var config=require(_0x7673('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7673('0x8')][_0x7673('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af802,_0x4e4b24,_0x53d67d){return new BPromise(function(_0x5292f7,_0x285c6d){return client['request'](_0x5af802,_0x53d67d)[_0x7673('0xa')](function(_0x1fb769){logger['info'](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));logger[_0x7673('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4e4b24,'request\x20sent',JSON[_0x7673('0xe')](_0x1fb769));if(_0x1fb769['error']){if(_0x1fb769[_0x7673('0xf')][_0x7673('0x10')]===0x1f4){logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);return _0x285c6d(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769['error'][_0x7673('0x11')]);return _0x5292f7(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}else{logger[_0x7673('0x12')](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));_0x5292f7(_0x1fb769[_0x7673('0x13')]['message']);}})['catch'](function(_0x164d05){logger[_0x7673('0xf')]('Campaign,\x20%s,\x20%s',_0x4e4b24,_0x164d05);_0x285c6d(_0x164d05);});});}exports[_0x7673('0x14')]=function(_0x17699a){var _0x58a821=this;return new Promise(function(_0x33ff7d,_0x44704d){return db[_0x7673('0x15')]['findAll']({'raw':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x17')]===undefined?!![]:![]:!![],'where':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x18')]||null:null,'attributes':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x19')]||null:null,'limit':_0x17699a[_0x7673('0x16')]?_0x17699a['options']['limit']||null:null,'include':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x17699a[_0x7673('0x16')]['include'],function(_0x2009e1){return{'model':db[_0x2009e1[_0x7673('0x1c')]],'as':_0x2009e1['as'],'attributes':_0x2009e1[_0x7673('0x19')],'include':_0x2009e1[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x2009e1[_0x7673('0x1a')],function(_0x538280){return{'model':db[_0x538280[_0x7673('0x1c')]],'as':_0x538280['as'],'attributes':_0x538280[_0x7673('0x19')],'include':_0x538280[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x538280['include'],function(_0x5e2cd7){return{'model':db[_0x5e2cd7[_0x7673('0x1c')]],'as':_0x5e2cd7['as'],'attributes':_0x5e2cd7[_0x7673('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7673('0xa')](function(_0x9d9eab){logger[_0x7673('0x12')](_0x7673('0x14'),_0x17699a);logger[_0x7673('0xd')]('GetCampaign',_0x17699a,JSON['stringify'](_0x9d9eab));_0x33ff7d(_0x9d9eab);})[_0x7673('0x1d')](function(_0x2d4c0a){logger[_0x7673('0xf')](_0x7673('0x14'),_0x2d4c0a[_0x7673('0x11')],_0x17699a);_0x44704d(_0x58a821[_0x7673('0xf')](0x1f4,_0x2d4c0a[_0x7673('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 708a7a5..084fa12 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 _0xbf0b=['/:id/clone','addLists','addBlackLists','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0xe58ae2,_0x30a065){var _0x369b69=function(_0xa6a029){while(--_0xa6a029){_0xe58ae2['push'](_0xe58ae2['shift']());}};_0x369b69(++_0x30a065);}(_0xbf0b,0x16a));var _0xbbf0=function(_0x1ee4e9,_0x3f6b36){_0x1ee4e9=_0x1ee4e9-0x0;var _0x587b6a=_0xbf0b[_0x1ee4e9];return _0x587b6a;};'use strict';var multer=require(_0xbbf0('0x0'));var util=require(_0xbbf0('0x1'));var path=require(_0xbbf0('0x2'));var timeout=require(_0xbbf0('0x3'));var express=require('express');var router=express[_0xbbf0('0x4')]();var fs_extra=require(_0xbbf0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbbf0('0x6'));var config=require(_0xbbf0('0x7'));var controller=require('./campaign.controller');router[_0xbbf0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbbf0('0x8')]('/:id',auth[_0xbbf0('0x9')](),controller['show']);router[_0xbbf0('0x8')](_0xbbf0('0xa'),auth['isAuthenticated'](),controller[_0xbbf0('0xb')]);router[_0xbbf0('0x8')](_0xbbf0('0xc'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0xd')]);router[_0xbbf0('0x8')](_0xbbf0('0xe'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0xf')]);router['get'](_0xbbf0('0x10'),auth[_0xbbf0('0x9')](),controller['getHopperBlacks']);router[_0xbbf0('0x8')](_0xbbf0('0x11'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x12')]);router[_0xbbf0('0x8')](_0xbbf0('0x13'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x14')]);router[_0xbbf0('0x15')]('/',auth[_0xbbf0('0x9')](),controller['create']);router[_0xbbf0('0x15')](_0xbbf0('0x16'),auth[_0xbbf0('0x9')](),controller['clone']);router[_0xbbf0('0x15')](_0xbbf0('0x11'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x17')]);router[_0xbbf0('0x15')](_0xbbf0('0x13'),auth['isAuthenticated'](),controller[_0xbbf0('0x18')]);router['put'](_0xbbf0('0x19'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x1a')]);router[_0xbbf0('0x1b')](_0xbbf0('0x19'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x1c')]);router[_0xbbf0('0x1b')](_0xbbf0('0x11'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x1d')]);router[_0xbbf0('0x1b')](_0xbbf0('0x13'),auth['isAuthenticated'](),controller[_0xbbf0('0x1e')]);module[_0xbbf0('0x1f')]=router;
\ No newline at end of file
+var _0x3870=['update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','/:id'];(function(_0x31344b,_0x12d6d0){var _0x15012d=function(_0x5e82b5){while(--_0x5e82b5){_0x31344b['push'](_0x31344b['shift']());}};_0x15012d(++_0x12d6d0);}(_0x3870,0x15b));var _0x0387=function(_0x4ce6fa,_0x26a348){_0x4ce6fa=_0x4ce6fa-0x0;var _0xcd00be=_0x3870[_0x4ce6fa];return _0xcd00be;};'use strict';var multer=require(_0x0387('0x0'));var util=require(_0x0387('0x1'));var path=require(_0x0387('0x2'));var timeout=require(_0x0387('0x3'));var express=require(_0x0387('0x4'));var router=express[_0x0387('0x5')]();var fs_extra=require(_0x0387('0x6'));var auth=require(_0x0387('0x7'));var interaction=require(_0x0387('0x8'));var config=require(_0x0387('0x9'));var controller=require(_0x0387('0xa'));router[_0x0387('0xb')]('/',auth[_0x0387('0xc')](),controller[_0x0387('0xd')]);router['get']('/:id',auth[_0x0387('0xc')](),controller[_0x0387('0xe')]);router['get'](_0x0387('0xf'),auth[_0x0387('0xc')](),controller[_0x0387('0x10')]);router[_0x0387('0xb')](_0x0387('0x11'),auth['isAuthenticated'](),controller[_0x0387('0x12')]);router[_0x0387('0xb')]('/:id/hopper_finals',auth[_0x0387('0xc')](),controller[_0x0387('0x13')]);router['get'](_0x0387('0x14'),auth['isAuthenticated'](),controller[_0x0387('0x15')]);router[_0x0387('0xb')]('/:id/lists',auth[_0x0387('0xc')](),controller[_0x0387('0x16')]);router[_0x0387('0xb')](_0x0387('0x17'),auth[_0x0387('0xc')](),controller[_0x0387('0x18')]);router[_0x0387('0x19')]('/',auth[_0x0387('0xc')](),controller['create']);router['post'](_0x0387('0x1a'),auth['isAuthenticated'](),controller[_0x0387('0x1b')]);router[_0x0387('0x19')](_0x0387('0x1c'),auth[_0x0387('0xc')](),controller[_0x0387('0x1d')]);router[_0x0387('0x19')](_0x0387('0x17'),auth[_0x0387('0xc')](),controller[_0x0387('0x1e')]);router[_0x0387('0x1f')](_0x0387('0x20'),auth[_0x0387('0xc')](),controller[_0x0387('0x21')]);router[_0x0387('0x22')](_0x0387('0x20'),auth[_0x0387('0xc')](),controller['destroy']);router[_0x0387('0x22')](_0x0387('0x1c'),auth[_0x0387('0xc')](),controller[_0x0387('0x23')]);router[_0x0387('0x22')]('/:id/blacklists',auth[_0x0387('0xc')](),controller[_0x0387('0x24')]);module[_0x0387('0x25')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 90ae4ed..47b8607 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 _0x23d8=['key','sequelize','exports','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x1fc183,_0x9e2637){var _0x1301d5=function(_0x3fd342){while(--_0x3fd342){_0x1fc183['push'](_0x1fc183['shift']());}};_0x1301d5(++_0x9e2637);}(_0x23d8,0x127));var _0x823d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x23d8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x823d('0x0'));module[_0x823d('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x823d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x823d('0x3')]},'name':{'type':Sequelize[_0x823d('0x4')],'get':function(){return this[_0x823d('0x5')](_0x823d('0x6'));}}};
\ No newline at end of file
+var _0x22a9=['TEXT','STRING','VIRTUAL','key','sequelize','exports'];(function(_0x54283c,_0xcfb7a7){var _0x3d32fb=function(_0x1fb34f){while(--_0x1fb34f){_0x54283c['push'](_0x54283c['shift']());}};_0x3d32fb(++_0xcfb7a7);}(_0x22a9,0x1a2));var _0x922a=function(_0x3c6d53,_0x9e0f36){_0x3c6d53=_0x3c6d53-0x0;var _0x36fc1a=_0x22a9[_0x3c6d53];return _0x36fc1a;};'use strict';var Sequelize=require(_0x922a('0x0'));module[_0x922a('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x922a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x922a('0x3')]},'name':{'type':Sequelize[_0x922a('0x4')],'get':function(){return this['getDataValue'](_0x922a('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index f6b55be..cc0bde2 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 _0xcff4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','length','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x44f45c,_0x47c0d9){var _0x48de2c=function(_0x3a6045){while(--_0x3a6045){_0x44f45c['push'](_0x44f45c['shift']());}};_0x48de2c(++_0x47c0d9);}(_0xcff4,0x9c));var _0x4cff=function(_0xabbb9b,_0x1417cc){_0xabbb9b=_0xabbb9b-0x0;var _0x306a4e=_0xcff4[_0xabbb9b];return _0x306a4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4cff('0x1'));var rp=require('request-promise');var moment=require(_0x4cff('0x2'));var BPromise=require(_0x4cff('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4cff('0x4'));var sox=require(_0x4cff('0x5'));var csv=require(_0x4cff('0x6'));var ejs=require(_0x4cff('0x7'));var fs=require('fs');var fs_extra=require(_0x4cff('0x8'));var _=require('lodash');var squel=require(_0x4cff('0x9'));var crypto=require(_0x4cff('0xa'));var jsforce=require(_0x4cff('0xb'));var deskjs=require(_0x4cff('0xc'));var toCsv=require(_0x4cff('0x6'));var querystring=require(_0x4cff('0xd'));var Papa=require(_0x4cff('0xe'));var Redis=require('ioredis');var authService=require(_0x4cff('0xf'));var qs=require(_0x4cff('0x10'));var as=require(_0x4cff('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4cff('0x12'))('api');var utils=require(_0x4cff('0x13'));var config=require(_0x4cff('0x14'));var licenseUtil=require(_0x4cff('0x15'));var db=require(_0x4cff('0x16'))['db'];function respondWithStatusCode(_0xbea3c1,_0x56c70c){_0x56c70c=_0x56c70c||0xcc;return function(_0x13304a){if(_0x13304a){return _0xbea3c1['sendStatus'](_0x56c70c);}return _0xbea3c1[_0x4cff('0x17')](_0x56c70c)[_0x4cff('0x18')]();};}function respondWithResult(_0x47dd6a,_0x4fa008){_0x4fa008=_0x4fa008||0xc8;return function(_0xf25e8a){if(_0xf25e8a){return _0x47dd6a[_0x4cff('0x17')](_0x4fa008)[_0x4cff('0x19')](_0xf25e8a);}};}function respondWithFilteredResult(_0x5bab79,_0x2aaab4){return function(_0x1f861c){if(_0x1f861c){var _0x583fd6=typeof _0x2aaab4[_0x4cff('0x1a')]===_0x4cff('0x1b')&&typeof _0x2aaab4[_0x4cff('0x1c')]===_0x4cff('0x1b');var _0x5632df=_0x1f861c['count'];var _0x4bdeaf=_0x583fd6?0x0:_0x2aaab4[_0x4cff('0x1a')];var _0x23c8b1=_0x583fd6?_0x1f861c['count']:_0x2aaab4['offset']+_0x2aaab4[_0x4cff('0x1c')];var _0x345fd5;if(_0x23c8b1>=_0x5632df){_0x23c8b1=_0x5632df;_0x345fd5=0xc8;}else{_0x345fd5=0xce;}_0x5bab79[_0x4cff('0x17')](_0x345fd5);return _0x5bab79['set']('Content-Range',_0x4bdeaf+'-'+_0x23c8b1+'/'+_0x5632df)[_0x4cff('0x19')](_0x1f861c);}return null;};}function patchUpdates(_0x5b1cca){return function(_0x51a2da){try{jsonpatch[_0x4cff('0x1d')](_0x51a2da,_0x5b1cca,!![]);}catch(_0x14c941){return BPromise[_0x4cff('0x1e')](_0x14c941);}return _0x51a2da['save']();};}function saveUpdates(_0x5dad64,_0x4a6a72){return function(_0xf9098e){if(_0xf9098e){return _0xf9098e[_0x4cff('0x1f')](_0x5dad64)[_0x4cff('0x20')](function(_0x2a587a){return _0x2a587a;});}return null;};}function removeEntity(_0x47bdb8,_0x41a439){return function(_0x241761){if(_0x241761){return _0x241761[_0x4cff('0x21')]()['then'](function(){var _0x1a0080=_0x241761['get']({'plain':!![]});var _0x214d71='CannedAnswers';return db['UserProfileResource'][_0x4cff('0x21')]({'where':{'type':_0x214d71,'resourceId':_0x1a0080['id']}})[_0x4cff('0x20')](function(){return _0x241761;});})[_0x4cff('0x20')](function(){_0x47bdb8[_0x4cff('0x17')](0xcc)[_0x4cff('0x18')]();});}};}function handleEntityNotFound(_0x110d81,_0x1f1248){return function(_0x2f0eef){if(!_0x2f0eef){_0x110d81[_0x4cff('0x22')](0x194);}return _0x2f0eef;};}function handleError(_0x1e941f,_0x1f1e10){_0x1f1e10=_0x1f1e10||0x1f4;return function(_0x19a34e){logger[_0x4cff('0x23')](_0x19a34e[_0x4cff('0x24')]);if(_0x19a34e[_0x4cff('0x25')]){delete _0x19a34e[_0x4cff('0x25')];}_0x1e941f['status'](_0x1f1e10)[_0x4cff('0x26')](_0x19a34e);};}exports[_0x4cff('0x27')]=function(_0x46cbcb,_0x5c5a02){var _0x303790={},_0x24206c={},_0x1ef498={'count':0x0,'rows':[]};var _0x10cc98=_[_0x4cff('0x28')](db[_0x4cff('0x29')][_0x4cff('0x2a')],function(_0x475b78){return{'name':_0x475b78[_0x4cff('0x2b')],'type':_0x475b78['type'][_0x4cff('0x2c')]};});_0x24206c['model']=_[_0x4cff('0x28')](_0x10cc98,_0x4cff('0x25'));_0x24206c['query']=_[_0x4cff('0x2d')](_0x46cbcb[_0x4cff('0x2e')]);_0x24206c[_0x4cff('0x2f')]=_[_0x4cff('0x30')](_0x24206c[_0x4cff('0x31')],_0x24206c[_0x4cff('0x2e')]);_0x303790[_0x4cff('0x32')]=_['intersection'](_0x24206c[_0x4cff('0x31')],qs[_0x4cff('0x33')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x33')]));_0x303790[_0x4cff('0x32')]=_0x303790[_0x4cff('0x32')]['length']?_0x303790[_0x4cff('0x32')]:_0x24206c[_0x4cff('0x31')];if(!_0x46cbcb['query'][_0x4cff('0x34')]('nolimit')){_0x303790['limit']=qs[_0x4cff('0x1c')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x1c')]);_0x303790[_0x4cff('0x1a')]=qs[_0x4cff('0x1a')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x1a')]);}_0x303790[_0x4cff('0x35')]=qs[_0x4cff('0x36')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x36')]);_0x303790[_0x4cff('0x37')]=qs[_0x4cff('0x2f')](_[_0x4cff('0x38')](_0x46cbcb[_0x4cff('0x2e')],_0x24206c['filters']),_0x10cc98);if(_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x39')]){_0x303790[_0x4cff('0x37')]=_[_0x4cff('0x3a')](_0x303790[_0x4cff('0x37')],{'$or':[{'key':{'$like':'%'+_0x46cbcb['query'][_0x4cff('0x39')]+'%'}},{'value':{'$like':'%'+_0x46cbcb[_0x4cff('0x2e')]['filter']+'%'}}]});}_0x303790=_[_0x4cff('0x3a')]({},_0x303790,_0x46cbcb[_0x4cff('0x3b')]);var _0x202035={'where':_0x303790[_0x4cff('0x37')]};return db[_0x4cff('0x29')][_0x4cff('0x3c')](_0x202035)[_0x4cff('0x20')](function(_0x909bb8){_0x1ef498[_0x4cff('0x3c')]=_0x909bb8;if(_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x3d')]){_0x303790[_0x4cff('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4cff('0x3f')](_0x303790);})[_0x4cff('0x20')](function(_0x4990ea){_0x1ef498['rows']=_0x4990ea;return _0x1ef498;})[_0x4cff('0x20')](respondWithFilteredResult(_0x5c5a02,_0x303790))[_0x4cff('0x40')](handleError(_0x5c5a02,null));};exports[_0x4cff('0x41')]=function(_0x300d2f,_0x47cc22){var _0x21548e={'raw':!![],'where':{'id':_0x300d2f[_0x4cff('0x42')]['id']}},_0x494b9f={};_0x494b9f[_0x4cff('0x31')]=_[_0x4cff('0x2d')](db[_0x4cff('0x29')][_0x4cff('0x2a')]);_0x494b9f['query']=_[_0x4cff('0x2d')](_0x300d2f[_0x4cff('0x2e')]);_0x494b9f[_0x4cff('0x2f')]=_[_0x4cff('0x30')](_0x494b9f[_0x4cff('0x31')],_0x494b9f[_0x4cff('0x2e')]);_0x21548e[_0x4cff('0x32')]=_[_0x4cff('0x30')](_0x494b9f['model'],qs[_0x4cff('0x33')](_0x300d2f[_0x4cff('0x2e')][_0x4cff('0x33')]));_0x21548e[_0x4cff('0x32')]=_0x21548e[_0x4cff('0x32')][_0x4cff('0x43')]?_0x21548e[_0x4cff('0x32')]:_0x494b9f[_0x4cff('0x31')];if(_0x300d2f[_0x4cff('0x2e')][_0x4cff('0x3d')]){_0x21548e[_0x4cff('0x3e')]=[{'all':!![]}];}_0x21548e=_[_0x4cff('0x3a')]({},_0x21548e,_0x300d2f[_0x4cff('0x3b')]);return db[_0x4cff('0x29')][_0x4cff('0x44')](_0x21548e)[_0x4cff('0x20')](handleEntityNotFound(_0x47cc22,null))[_0x4cff('0x20')](respondWithResult(_0x47cc22,null))[_0x4cff('0x40')](handleError(_0x47cc22,null));};exports[_0x4cff('0x1f')]=function(_0x51b6f9,_0x46e6a4){if(_0x51b6f9[_0x4cff('0x45')]['id']){delete _0x51b6f9['body']['id'];}return db[_0x4cff('0x29')][_0x4cff('0x44')]({'where':{'id':_0x51b6f9[_0x4cff('0x42')]['id']}})[_0x4cff('0x20')](handleEntityNotFound(_0x46e6a4,null))[_0x4cff('0x20')](saveUpdates(_0x51b6f9[_0x4cff('0x45')],null))[_0x4cff('0x20')](respondWithResult(_0x46e6a4,null))[_0x4cff('0x40')](handleError(_0x46e6a4,null));};exports[_0x4cff('0x21')]=function(_0x2693e8,_0x2c8506){return db['CannedAnswer'][_0x4cff('0x44')]({'where':{'id':_0x2693e8[_0x4cff('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c8506,null))[_0x4cff('0x20')](removeEntity(_0x2c8506,null))['catch'](handleError(_0x2c8506,null));};exports['create']=function(_0x10209f,_0x465bb2){var _0x17731b={'key':_0x10209f[_0x4cff('0x45')][_0x4cff('0x2c')]};if(_0x10209f[_0x4cff('0x45')]['MailAccountId']){_0x17731b[_0x4cff('0x46')]=_0x10209f[_0x4cff('0x45')][_0x4cff('0x46')];}else if(_0x10209f[_0x4cff('0x45')][_0x4cff('0x47')]){_0x17731b[_0x4cff('0x47')]=_0x10209f['body'][_0x4cff('0x47')];}else if(_0x10209f[_0x4cff('0x45')][_0x4cff('0x48')]){_0x17731b[_0x4cff('0x48')]=_0x10209f['body']['OpenchannelAccountId'];}else if(_0x10209f['body'][_0x4cff('0x49')]){_0x17731b['ChatWebsiteId']=_0x10209f[_0x4cff('0x45')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x17731b})[_0x4cff('0x20')](function(_0x29ffbc){if(_0x29ffbc){throw new db[(_0x4cff('0x4a'))][(_0x4cff('0x4b'))](_0x4cff('0x4c'));}return db['CannedAnswer'][_0x4cff('0x4d')](_0x10209f[_0x4cff('0x45')]);})[_0x4cff('0x20')](function(_0x14cd6a){var _0x55e946=_0x10209f[_0x4cff('0x4e')][_0x4cff('0x4f')]({'plain':!![]});if(!_0x55e946)throw new Error(_0x4cff('0x50'));if(_0x55e946[_0x4cff('0x51')]===_0x4cff('0x4e')){var _0x5ad994=_0x14cd6a[_0x4cff('0x4f')]({'plain':!![]});return db[_0x4cff('0x52')]['find']({'where':{'name':_0x4cff('0x53'),'userProfileId':_0x55e946[_0x4cff('0x54')]},'raw':!![]})[_0x4cff('0x20')](function(_0x5a06da){if(_0x5a06da&&_0x5a06da['autoAssociation']===0x0){return db['UserProfileResource'][_0x4cff('0x4d')]({'name':_0x5ad994[_0x4cff('0x25')],'resourceId':_0x5ad994['id'],'type':_0x5a06da['name'],'sectionId':_0x5a06da['id']},{})['then'](function(){return _0x14cd6a;});}else{return _0x14cd6a;}})['catch'](function(_0x3ab95c){logger[_0x4cff('0x23')](_0x4cff('0x55'),_0x3ab95c);throw _0x3ab95c;});}return _0x14cd6a;})[_0x4cff('0x20')](respondWithResult(_0x465bb2,0xc9))[_0x4cff('0x40')](handleError(_0x465bb2,null));};
\ No newline at end of file
+var _0xa42b=['MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','name','send','index','map','CannedAnswer','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','includeAll','include','rows','show','options','find','catch','body','params','create'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xa42b,0xbd));var _0xba42=function(_0x407fb6,_0x4676d5){_0x407fb6=_0x407fb6-0x0;var _0x2a1454=_0xa42b[_0x407fb6];return _0x2a1454;};'use strict';var emlformat=require(_0xba42('0x0'));var rimraf=require(_0xba42('0x1'));var zipdir=require(_0xba42('0x2'));var jsonpatch=require(_0xba42('0x3'));var rp=require(_0xba42('0x4'));var moment=require('moment');var BPromise=require(_0xba42('0x5'));var Mustache=require(_0xba42('0x6'));var util=require(_0xba42('0x7'));var path=require(_0xba42('0x8'));var sox=require(_0xba42('0x9'));var csv=require('to-csv');var ejs=require(_0xba42('0xa'));var fs=require('fs');var fs_extra=require(_0xba42('0xb'));var _=require(_0xba42('0xc'));var squel=require('squel');var crypto=require(_0xba42('0xd'));var jsforce=require(_0xba42('0xe'));var deskjs=require(_0xba42('0xf'));var toCsv=require('to-csv');var querystring=require(_0xba42('0x10'));var Papa=require(_0xba42('0x11'));var Redis=require(_0xba42('0x12'));var authService=require(_0xba42('0x13'));var qs=require(_0xba42('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xba42('0x15'))(_0xba42('0x16'));var utils=require(_0xba42('0x17'));var config=require(_0xba42('0x18'));var licenseUtil=require(_0xba42('0x19'));var db=require(_0xba42('0x1a'))['db'];function respondWithStatusCode(_0x42efba,_0x6b24e8){_0x6b24e8=_0x6b24e8||0xcc;return function(_0x2afdd1){if(_0x2afdd1){return _0x42efba['sendStatus'](_0x6b24e8);}return _0x42efba[_0xba42('0x1b')](_0x6b24e8)[_0xba42('0x1c')]();};}function respondWithResult(_0x108455,_0x26be70){_0x26be70=_0x26be70||0xc8;return function(_0x3a2b3e){if(_0x3a2b3e){return _0x108455[_0xba42('0x1b')](_0x26be70)[_0xba42('0x1d')](_0x3a2b3e);}};}function respondWithFilteredResult(_0x2e2199,_0x16b747){return function(_0x951a9c){if(_0x951a9c){var _0x4d5ba8=typeof _0x16b747[_0xba42('0x1e')]===_0xba42('0x1f')&&typeof _0x16b747['limit']==='undefined';var _0x5ebb4d=_0x951a9c[_0xba42('0x20')];var _0x319934=_0x4d5ba8?0x0:_0x16b747[_0xba42('0x1e')];var _0x1c6218=_0x4d5ba8?_0x951a9c[_0xba42('0x20')]:_0x16b747[_0xba42('0x1e')]+_0x16b747[_0xba42('0x21')];var _0x304808;if(_0x1c6218>=_0x5ebb4d){_0x1c6218=_0x5ebb4d;_0x304808=0xc8;}else{_0x304808=0xce;}_0x2e2199[_0xba42('0x1b')](_0x304808);return _0x2e2199[_0xba42('0x22')](_0xba42('0x23'),_0x319934+'-'+_0x1c6218+'/'+_0x5ebb4d)['json'](_0x951a9c);}return null;};}function patchUpdates(_0xe8cca1){return function(_0x30e056){try{jsonpatch[_0xba42('0x24')](_0x30e056,_0xe8cca1,!![]);}catch(_0x3d76f5){return BPromise[_0xba42('0x25')](_0x3d76f5);}return _0x30e056[_0xba42('0x26')]();};}function saveUpdates(_0x95d37e,_0xed900f){return function(_0x213f95){if(_0x213f95){return _0x213f95[_0xba42('0x27')](_0x95d37e)[_0xba42('0x28')](function(_0x2f4961){return _0x2f4961;});}return null;};}function removeEntity(_0x55804b,_0x30d785){return function(_0x2e700e){if(_0x2e700e){return _0x2e700e[_0xba42('0x29')]()['then'](function(){var _0x3f6a62=_0x2e700e[_0xba42('0x2a')]({'plain':!![]});var _0x2f4271=_0xba42('0x2b');return db[_0xba42('0x2c')]['destroy']({'where':{'type':_0x2f4271,'resourceId':_0x3f6a62['id']}})[_0xba42('0x28')](function(){return _0x2e700e;});})['then'](function(){_0x55804b[_0xba42('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7a63,_0x3a4edc){return function(_0x55f980){if(!_0x55f980){_0x4c7a63[_0xba42('0x2d')](0x194);}return _0x55f980;};}function handleError(_0x472d01,_0x1eddfa){_0x1eddfa=_0x1eddfa||0x1f4;return function(_0x1284df){logger[_0xba42('0x2e')](_0x1284df['stack']);if(_0x1284df[_0xba42('0x2f')]){delete _0x1284df[_0xba42('0x2f')];}_0x472d01['status'](_0x1eddfa)[_0xba42('0x30')](_0x1284df);};}exports[_0xba42('0x31')]=function(_0x2d39d7,_0x5d9356){var _0xe90a1b={},_0x548b3b={},_0x2ae5cd={'count':0x0,'rows':[]};var _0x86b858=_[_0xba42('0x32')](db[_0xba42('0x33')]['rawAttributes'],function(_0x10ea13){return{'name':_0x10ea13[_0xba42('0x34')],'type':_0x10ea13['type'][_0xba42('0x35')]};});_0x548b3b['model']=_[_0xba42('0x32')](_0x86b858,'name');_0x548b3b[_0xba42('0x36')]=_[_0xba42('0x37')](_0x2d39d7['query']);_0x548b3b[_0xba42('0x38')]=_[_0xba42('0x39')](_0x548b3b[_0xba42('0x3a')],_0x548b3b[_0xba42('0x36')]);_0xe90a1b[_0xba42('0x3b')]=_[_0xba42('0x39')](_0x548b3b[_0xba42('0x3a')],qs[_0xba42('0x3c')](_0x2d39d7[_0xba42('0x36')][_0xba42('0x3c')]));_0xe90a1b[_0xba42('0x3b')]=_0xe90a1b[_0xba42('0x3b')][_0xba42('0x3d')]?_0xe90a1b[_0xba42('0x3b')]:_0x548b3b['model'];if(!_0x2d39d7[_0xba42('0x36')][_0xba42('0x3e')]('nolimit')){_0xe90a1b[_0xba42('0x21')]=qs[_0xba42('0x21')](_0x2d39d7['query'][_0xba42('0x21')]);_0xe90a1b['offset']=qs['offset'](_0x2d39d7[_0xba42('0x36')][_0xba42('0x1e')]);}_0xe90a1b['order']=qs[_0xba42('0x3f')](_0x2d39d7['query'][_0xba42('0x3f')]);_0xe90a1b['where']=qs[_0xba42('0x38')](_[_0xba42('0x40')](_0x2d39d7[_0xba42('0x36')],_0x548b3b[_0xba42('0x38')]),_0x86b858);if(_0x2d39d7[_0xba42('0x36')][_0xba42('0x41')]){_0xe90a1b[_0xba42('0x42')]=_[_0xba42('0x43')](_0xe90a1b[_0xba42('0x42')],{'$or':[{'key':{'$like':'%'+_0x2d39d7['query']['filter']+'%'}},{'value':{'$like':'%'+_0x2d39d7[_0xba42('0x36')][_0xba42('0x41')]+'%'}}]});}_0xe90a1b=_['merge']({},_0xe90a1b,_0x2d39d7['options']);var _0x5da0b1={'where':_0xe90a1b[_0xba42('0x42')]};return db[_0xba42('0x33')]['count'](_0x5da0b1)['then'](function(_0x38d1a5){_0x2ae5cd[_0xba42('0x20')]=_0x38d1a5;if(_0x2d39d7['query'][_0xba42('0x44')]){_0xe90a1b[_0xba42('0x45')]=[{'all':!![]}];}return db[_0xba42('0x33')]['findAll'](_0xe90a1b);})['then'](function(_0x190d0f){_0x2ae5cd[_0xba42('0x46')]=_0x190d0f;return _0x2ae5cd;})['then'](respondWithFilteredResult(_0x5d9356,_0xe90a1b))['catch'](handleError(_0x5d9356,null));};exports[_0xba42('0x47')]=function(_0x11972c,_0x1bc1d2){var _0x5ed842={'raw':!![],'where':{'id':_0x11972c['params']['id']}},_0x2569c3={};_0x2569c3[_0xba42('0x3a')]=_[_0xba42('0x37')](db['CannedAnswer']['rawAttributes']);_0x2569c3['query']=_['keys'](_0x11972c[_0xba42('0x36')]);_0x2569c3[_0xba42('0x38')]=_[_0xba42('0x39')](_0x2569c3[_0xba42('0x3a')],_0x2569c3[_0xba42('0x36')]);_0x5ed842['attributes']=_['intersection'](_0x2569c3[_0xba42('0x3a')],qs[_0xba42('0x3c')](_0x11972c[_0xba42('0x36')][_0xba42('0x3c')]));_0x5ed842[_0xba42('0x3b')]=_0x5ed842[_0xba42('0x3b')][_0xba42('0x3d')]?_0x5ed842[_0xba42('0x3b')]:_0x2569c3[_0xba42('0x3a')];if(_0x11972c[_0xba42('0x36')]['includeAll']){_0x5ed842['include']=[{'all':!![]}];}_0x5ed842=_['merge']({},_0x5ed842,_0x11972c[_0xba42('0x48')]);return db['CannedAnswer'][_0xba42('0x49')](_0x5ed842)[_0xba42('0x28')](handleEntityNotFound(_0x1bc1d2,null))[_0xba42('0x28')](respondWithResult(_0x1bc1d2,null))[_0xba42('0x4a')](handleError(_0x1bc1d2,null));};exports[_0xba42('0x27')]=function(_0x2127ef,_0x5bd334){if(_0x2127ef['body']['id']){delete _0x2127ef[_0xba42('0x4b')]['id'];}return db[_0xba42('0x33')][_0xba42('0x49')]({'where':{'id':_0x2127ef[_0xba42('0x4c')]['id']}})[_0xba42('0x28')](handleEntityNotFound(_0x5bd334,null))[_0xba42('0x28')](saveUpdates(_0x2127ef[_0xba42('0x4b')],null))[_0xba42('0x28')](respondWithResult(_0x5bd334,null))[_0xba42('0x4a')](handleError(_0x5bd334,null));};exports[_0xba42('0x29')]=function(_0x4ad92f,_0x3df239){return db[_0xba42('0x33')][_0xba42('0x49')]({'where':{'id':_0x4ad92f[_0xba42('0x4c')]['id']}})[_0xba42('0x28')](handleEntityNotFound(_0x3df239,null))[_0xba42('0x28')](removeEntity(_0x3df239,null))[_0xba42('0x4a')](handleError(_0x3df239,null));};exports[_0xba42('0x4d')]=function(_0xc4ab0f,_0x12d743){var _0x3d2360={'key':_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x35')]};if(_0xc4ab0f[_0xba42('0x4b')]['MailAccountId']){_0x3d2360[_0xba42('0x4e')]=_0xc4ab0f[_0xba42('0x4b')]['MailAccountId'];}else if(_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x4f')]){_0x3d2360[_0xba42('0x4f')]=_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x4f')];}else if(_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x50')]){_0x3d2360[_0xba42('0x50')]=_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x50')];}else if(_0xc4ab0f['body']['ChatWebsiteId']){_0x3d2360['ChatWebsiteId']=_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x51')];}return db['CannedAnswer'][_0xba42('0x49')]({'where':_0x3d2360})[_0xba42('0x28')](function(_0xc4add9){if(_0xc4add9){throw new db[(_0xba42('0x52'))][(_0xba42('0x53'))](_0xba42('0x54'));}return db[_0xba42('0x33')][_0xba42('0x4d')](_0xc4ab0f[_0xba42('0x4b')]);})[_0xba42('0x28')](function(_0x17f622){var _0x43d7c5=_0xc4ab0f[_0xba42('0x55')][_0xba42('0x2a')]({'plain':!![]});if(!_0x43d7c5)throw new Error(_0xba42('0x56'));if(_0x43d7c5[_0xba42('0x57')]===_0xba42('0x55')){var _0x4196be=_0x17f622[_0xba42('0x2a')]({'plain':!![]});return db[_0xba42('0x58')][_0xba42('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x43d7c5['userProfileId']},'raw':!![]})['then'](function(_0x57887b){if(_0x57887b&&_0x57887b['autoAssociation']===0x0){return db[_0xba42('0x2c')][_0xba42('0x4d')]({'name':_0x4196be[_0xba42('0x2f')],'resourceId':_0x4196be['id'],'type':_0x57887b['name'],'sectionId':_0x57887b['id']},{})[_0xba42('0x28')](function(){return _0x17f622;});}else{return _0x17f622;}})[_0xba42('0x4a')](function(_0x1b814e){logger[_0xba42('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b814e);throw _0x1b814e;});}return _0x17f622;})[_0xba42('0x28')](respondWithResult(_0x12d743,0xc9))[_0xba42('0x4a')](handleError(_0x12d743,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 8d6b1d3..aa2e18d 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 _0x10be=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers'];(function(_0x5b7b22,_0x5bc479){var _0x53dc9d=function(_0x5108c0){while(--_0x5108c0){_0x5b7b22['push'](_0x5b7b22['shift']());}};_0x53dc9d(++_0x5bc479);}(_0x10be,0x161));var _0xe10b=function(_0x5103a4,_0x4b7f5c){_0x5103a4=_0x5103a4-0x0;var _0x4f99e0=_0x10be[_0x5103a4];return _0x4f99e0;};'use strict';var _=require(_0xe10b('0x0'));var util=require('util');var logger=require(_0xe10b('0x1'))(_0xe10b('0x2'));var moment=require('moment');var BPromise=require(_0xe10b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe10b('0x4'));var rimraf=require(_0xe10b('0x5'));var config=require(_0xe10b('0x6'));var attributes=require(_0xe10b('0x7'));module['exports']=function(_0x241fd7,_0x25bda5){return _0x241fd7[_0xe10b('0x8')](_0xe10b('0x9'),attributes,{'tableName':_0xe10b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe10b('0xb'),'collate':_0xe10b('0xc')});};
\ No newline at end of file
+var _0x348e=['exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','../../config/environment','./cannedAnswer.attributes'];(function(_0x42acce,_0x30b09f){var _0x2e843b=function(_0x2697ff){while(--_0x2697ff){_0x42acce['push'](_0x42acce['shift']());}};_0x2e843b(++_0x30b09f);}(_0x348e,0x9f));var _0xe348=function(_0x27891e,_0x1d4f82){_0x27891e=_0x27891e-0x0;var _0x13dbd1=_0x348e[_0x27891e];return _0x13dbd1;};'use strict';var _=require(_0xe348('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe348('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe348('0x2'));var fs=require('fs');var path=require(_0xe348('0x3'));var rimraf=require('rimraf');var config=require(_0xe348('0x4'));var attributes=require(_0xe348('0x5'));module[_0xe348('0x6')]=function(_0x2a70c1,_0xa16292){return _0x2a70c1[_0xe348('0x7')](_0xe348('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe348('0x9'),'collate':_0xe348('0xa')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 40bb775..82787a2 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(_0x465122,_0x107808){var _0x1fd7ee=function(_0xc762a3){while(--_0xc762a3){_0x465122['push'](_0x465122['shift']());}};_0x1fd7ee(++_0x107808);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x301b74,_0x223dfb){var _0x19e590=function(_0x2b2f66){while(--_0x2b2f66){_0x301b74['push'](_0x301b74['shift']());}};_0x19e590(++_0x223dfb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 9426695..579a027 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 _0x0f08=['../../components/interaction/service','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x0f08,0x1ea));var _0x80f0=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x0f08[_0x308213];return _0x2e1619;};'use strict';var multer=require(_0x80f0('0x0'));var util=require(_0x80f0('0x1'));var path=require('path');var timeout=require(_0x80f0('0x2'));var express=require(_0x80f0('0x3'));var router=express[_0x80f0('0x4')]();var fs_extra=require(_0x80f0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80f0('0x6'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x80f0('0x7')](),controller[_0x80f0('0x8')]);router['get'](_0x80f0('0x9'),auth['isAuthenticated'](),controller[_0x80f0('0xa')]);router[_0x80f0('0xb')]('/',auth[_0x80f0('0x7')](),controller[_0x80f0('0xc')]);router[_0x80f0('0xd')](_0x80f0('0x9'),auth[_0x80f0('0x7')](),controller['update']);router['delete'](_0x80f0('0x9'),auth['isAuthenticated'](),controller[_0x80f0('0xe')]);module[_0x80f0('0xf')]=router;
\ No newline at end of file
+var _0x8abc=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','get','show','post','create','/:id'];(function(_0x8962b1,_0x4bb6b5){var _0x41e583=function(_0x1ea4d4){while(--_0x1ea4d4){_0x8962b1['push'](_0x8962b1['shift']());}};_0x41e583(++_0x4bb6b5);}(_0x8abc,0x1d2));var _0xc8ab=function(_0x155200,_0x228087){_0x155200=_0x155200-0x0;var _0x354c3a=_0x8abc[_0x155200];return _0x354c3a;};'use strict';var multer=require(_0xc8ab('0x0'));var util=require(_0xc8ab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc8ab('0x2')]();var fs_extra=require(_0xc8ab('0x3'));var auth=require(_0xc8ab('0x4'));var interaction=require(_0xc8ab('0x5'));var config=require('../../config/environment');var controller=require(_0xc8ab('0x6'));router['get']('/',auth[_0xc8ab('0x7')](),controller[_0xc8ab('0x8')]);router[_0xc8ab('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc8ab('0xa')]);router[_0xc8ab('0xb')]('/',auth['isAuthenticated'](),controller[_0xc8ab('0xc')]);router['put'](_0xc8ab('0xd'),auth[_0xc8ab('0x7')](),controller['update']);router['delete'](_0xc8ab('0xd'),auth[_0xc8ab('0x7')](),controller[_0xc8ab('0xe')]);module[_0xc8ab('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 74c934d..8de04dc 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 _0xb700=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb700,0x1d3));var _0x0b70=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0xb700[_0x3be2e2];return _0x53b9c5;};'use strict';var Sequelize=require(_0x0b70('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x0b70('0x1')],'allowNull':![],'defaultValue':_0x0b70('0x2')},'clid':{'type':Sequelize[_0x0b70('0x3')]},'src':{'type':Sequelize[_0x0b70('0x3')]},'dst':{'type':Sequelize[_0x0b70('0x3')]},'dcontext':{'type':Sequelize[_0x0b70('0x3')]},'channel':{'type':Sequelize[_0x0b70('0x3')]},'dstchannel':{'type':Sequelize[_0x0b70('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0b70('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0b70('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0b70('0x3')]},'amaflags':{'type':Sequelize[_0x0b70('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0b70('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0b70('0x3')]},'linkedid':{'type':Sequelize[_0x0b70('0x3')]},'sequence':{'type':Sequelize[_0x0b70('0x3')]},'peeraccount':{'type':Sequelize[_0x0b70('0x3')]},'type':{'type':Sequelize[_0x0b70('0x3')]},'tag':{'type':Sequelize[_0x0b70('0x3')]}};
\ No newline at end of file
+var _0xb48d=['sequelize','DATE','STRING','INTEGER'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xb48d,0x194));var _0xdb48=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb48d[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xdb48('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xdb48('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xdb48('0x2')]},'src':{'type':Sequelize[_0xdb48('0x2')]},'dst':{'type':Sequelize[_0xdb48('0x2')]},'dcontext':{'type':Sequelize[_0xdb48('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xdb48('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xdb48('0x2')]},'duration':{'type':Sequelize[_0xdb48('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdb48('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xdb48('0x2')]},'userfield':{'type':Sequelize[_0xdb48('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xdb48('0x2')]},'sequence':{'type':Sequelize[_0xdb48('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdb48('0x2')]},'tag':{'type':Sequelize[_0xdb48('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 163d4cf..33e92c3 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 _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x473367,_0x8e5486){_0x473367=_0x473367-0x0;var _0x105e69=_0x6b8f[_0x473367];return _0x105e69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));};
\ No newline at end of file
+var _0x723e=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Cdr','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x7129ea,_0x57833e){var _0x30a7ea=function(_0x5d89a5){while(--_0x5d89a5){_0x7129ea['push'](_0x7129ea['shift']());}};_0x30a7ea(++_0x57833e);}(_0x723e,0x179));var _0xe723=function(_0x10a96a,_0x2e8bda){_0x10a96a=_0x10a96a-0x0;var _0xf50a21=_0x723e[_0x10a96a];return _0xf50a21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe723('0x0'));var zipdir=require(_0xe723('0x1'));var jsonpatch=require(_0xe723('0x2'));var rp=require(_0xe723('0x3'));var moment=require(_0xe723('0x4'));var BPromise=require(_0xe723('0x5'));var Mustache=require(_0xe723('0x6'));var util=require(_0xe723('0x7'));var path=require(_0xe723('0x8'));var sox=require(_0xe723('0x9'));var csv=require('to-csv');var ejs=require(_0xe723('0xa'));var fs=require('fs');var fs_extra=require(_0xe723('0xb'));var _=require(_0xe723('0xc'));var squel=require(_0xe723('0xd'));var crypto=require(_0xe723('0xe'));var jsforce=require(_0xe723('0xf'));var deskjs=require(_0xe723('0x10'));var toCsv=require(_0xe723('0x11'));var querystring=require('querystring');var Papa=require(_0xe723('0x12'));var Redis=require(_0xe723('0x13'));var authService=require(_0xe723('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe723('0x15'));var hardwareService=require(_0xe723('0x16'));var logger=require(_0xe723('0x17'))('api');var utils=require(_0xe723('0x18'));var config=require(_0xe723('0x19'));var licenseUtil=require(_0xe723('0x1a'));var db=require(_0xe723('0x1b'))['db'];function respondWithStatusCode(_0x236b69,_0x5c066c){_0x5c066c=_0x5c066c||0xcc;return function(_0x29a1e){if(_0x29a1e){return _0x236b69['sendStatus'](_0x5c066c);}return _0x236b69['status'](_0x5c066c)['end']();};}function respondWithResult(_0x57bc0e,_0x75c12c){_0x75c12c=_0x75c12c||0xc8;return function(_0x30b2ba){if(_0x30b2ba){return _0x57bc0e[_0xe723('0x1c')](_0x75c12c)[_0xe723('0x1d')](_0x30b2ba);}};}function respondWithFilteredResult(_0xf29a39,_0x5aec97){return function(_0x23d0b2){if(_0x23d0b2){var _0xbf5ca3=typeof _0x5aec97[_0xe723('0x1e')]===_0xe723('0x1f')&&typeof _0x5aec97[_0xe723('0x20')]===_0xe723('0x1f');var _0x2cd7ca=_0x23d0b2[_0xe723('0x21')];var _0x17e2c1=_0xbf5ca3?0x0:_0x5aec97[_0xe723('0x1e')];var _0x2057d7=_0xbf5ca3?_0x23d0b2[_0xe723('0x21')]:_0x5aec97[_0xe723('0x1e')]+_0x5aec97[_0xe723('0x20')];var _0x5e8a90;if(_0x2057d7>=_0x2cd7ca){_0x2057d7=_0x2cd7ca;_0x5e8a90=0xc8;}else{_0x5e8a90=0xce;}_0xf29a39['status'](_0x5e8a90);return _0xf29a39[_0xe723('0x22')](_0xe723('0x23'),_0x17e2c1+'-'+_0x2057d7+'/'+_0x2cd7ca)['json'](_0x23d0b2);}return null;};}function patchUpdates(_0x28caca){return function(_0x2762e2){try{jsonpatch['apply'](_0x2762e2,_0x28caca,!![]);}catch(_0x472502){return BPromise['reject'](_0x472502);}return _0x2762e2[_0xe723('0x24')]();};}function saveUpdates(_0x43ccfc,_0x3b82b2){return function(_0x1fe43d){if(_0x1fe43d){return _0x1fe43d[_0xe723('0x25')](_0x43ccfc)[_0xe723('0x26')](function(_0x25f7d2){return _0x25f7d2;});}return null;};}function removeEntity(_0x15196c,_0x1228f2){return function(_0x19bd0c){if(_0x19bd0c){return _0x19bd0c[_0xe723('0x27')]()[_0xe723('0x26')](function(){_0x15196c['status'](0xcc)[_0xe723('0x28')]();});}};}function handleEntityNotFound(_0x59f095,_0xa258f3){return function(_0x3ffa15){if(!_0x3ffa15){_0x59f095[_0xe723('0x29')](0x194);}return _0x3ffa15;};}function handleError(_0xe7e271,_0x1f81ec){_0x1f81ec=_0x1f81ec||0x1f4;return function(_0x598f15){logger[_0xe723('0x2a')](_0x598f15['stack']);if(_0x598f15['name']){delete _0x598f15[_0xe723('0x2b')];}_0xe7e271['status'](_0x1f81ec)[_0xe723('0x2c')](_0x598f15);};}exports[_0xe723('0x2d')]=function(_0x335c66,_0x4d55cc){var _0x1edbb2={},_0x45e162={},_0x48a97a={'count':0x0,'rows':[]};var _0x3c8c56=_['map'](db['Cdr'][_0xe723('0x2e')],function(_0x2c2240){return{'name':_0x2c2240[_0xe723('0x2f')],'type':_0x2c2240[_0xe723('0x30')]['key']};});_0x45e162['model']=_[_0xe723('0x31')](_0x3c8c56,'name');_0x45e162[_0xe723('0x32')]=_[_0xe723('0x33')](_0x335c66[_0xe723('0x32')]);_0x45e162[_0xe723('0x34')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],_0x45e162[_0xe723('0x32')]);_0x1edbb2[_0xe723('0x37')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],qs[_0xe723('0x38')](_0x335c66[_0xe723('0x32')][_0xe723('0x38')]));_0x1edbb2[_0xe723('0x37')]=_0x1edbb2['attributes'][_0xe723('0x39')]?_0x1edbb2['attributes']:_0x45e162[_0xe723('0x36')];if(!_0x335c66[_0xe723('0x32')]['hasOwnProperty']('nolimit')){_0x1edbb2[_0xe723('0x20')]=qs[_0xe723('0x20')](_0x335c66[_0xe723('0x32')][_0xe723('0x20')]);_0x1edbb2[_0xe723('0x1e')]=qs[_0xe723('0x1e')](_0x335c66['query'][_0xe723('0x1e')]);}_0x1edbb2[_0xe723('0x3a')]=qs[_0xe723('0x3b')](_0x335c66[_0xe723('0x32')][_0xe723('0x3b')]);_0x1edbb2[_0xe723('0x3c')]=qs[_0xe723('0x34')](_[_0xe723('0x3d')](_0x335c66[_0xe723('0x32')],_0x45e162[_0xe723('0x34')]),_0x3c8c56);if(_0x335c66[_0xe723('0x32')][_0xe723('0x3e')]){_0x1edbb2[_0xe723('0x3c')]=_[_0xe723('0x3f')](_0x1edbb2[_0xe723('0x3c')],{'$or':_[_0xe723('0x31')](_0x3c8c56,function(_0x5c5027){if(_0x5c5027[_0xe723('0x30')]!==_0xe723('0x40')){var _0x68eda5={};_0x68eda5[_0x5c5027[_0xe723('0x2b')]]={'$like':'%'+_0x335c66['query']['filter']+'%'};return _0x68eda5;}})});}_0x1edbb2=_[_0xe723('0x3f')]({},_0x1edbb2,_0x335c66[_0xe723('0x41')]);var _0xc0c2c7={'where':_0x1edbb2[_0xe723('0x3c')]};return db['Cdr']['count'](_0xc0c2c7)[_0xe723('0x26')](function(_0x2f1618){_0x48a97a[_0xe723('0x21')]=_0x2f1618;if(_0x335c66[_0xe723('0x32')][_0xe723('0x42')]){_0x1edbb2[_0xe723('0x43')]=[{'all':!![]}];}return db[_0xe723('0x44')][_0xe723('0x45')](_0x1edbb2);})[_0xe723('0x26')](function(_0x5b0c89){_0x48a97a['rows']=_0x5b0c89;return _0x48a97a;})[_0xe723('0x26')](respondWithFilteredResult(_0x4d55cc,_0x1edbb2))['catch'](handleError(_0x4d55cc,null));};exports['show']=function(_0x18f4a1,_0x55530b){var _0x36272={'raw':!![],'where':{'id':_0x18f4a1[_0xe723('0x46')]['id']}},_0x42bd2f={};_0x42bd2f[_0xe723('0x36')]=_[_0xe723('0x33')](db[_0xe723('0x44')][_0xe723('0x2e')]);_0x42bd2f['query']=_['keys'](_0x18f4a1[_0xe723('0x32')]);_0x42bd2f['filters']=_[_0xe723('0x35')](_0x42bd2f['model'],_0x42bd2f[_0xe723('0x32')]);_0x36272[_0xe723('0x37')]=_[_0xe723('0x35')](_0x42bd2f[_0xe723('0x36')],qs[_0xe723('0x38')](_0x18f4a1[_0xe723('0x32')][_0xe723('0x38')]));_0x36272[_0xe723('0x37')]=_0x36272[_0xe723('0x37')]['length']?_0x36272['attributes']:_0x42bd2f[_0xe723('0x36')];if(_0x18f4a1[_0xe723('0x32')][_0xe723('0x42')]){_0x36272['include']=[{'all':!![]}];}_0x36272=_['merge']({},_0x36272,_0x18f4a1['options']);return db[_0xe723('0x44')][_0xe723('0x47')](_0x36272)[_0xe723('0x26')](handleEntityNotFound(_0x55530b,null))['then'](respondWithResult(_0x55530b,null))[_0xe723('0x48')](handleError(_0x55530b,null));};exports[_0xe723('0x49')]=function(_0x1cb2b2,_0x38bd1a){return db[_0xe723('0x44')]['create'](_0x1cb2b2[_0xe723('0x4a')],{})['then'](respondWithResult(_0x38bd1a,0xc9))[_0xe723('0x48')](handleError(_0x38bd1a,null));};exports['update']=function(_0x52f42e,_0x1590fe){if(_0x52f42e[_0xe723('0x4a')]['id']){delete _0x52f42e[_0xe723('0x4a')]['id'];}return db['Cdr'][_0xe723('0x47')]({'where':{'id':_0x52f42e['params']['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x1590fe,null))[_0xe723('0x26')](saveUpdates(_0x52f42e[_0xe723('0x4a')],null))[_0xe723('0x26')](respondWithResult(_0x1590fe,null))[_0xe723('0x48')](handleError(_0x1590fe,null));};exports[_0xe723('0x27')]=function(_0x41e1c4,_0x16cb50){return db[_0xe723('0x44')]['find']({'where':{'id':_0x41e1c4[_0xe723('0x46')]['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x16cb50,null))['then'](removeEntity(_0x16cb50,null))[_0xe723('0x48')](handleError(_0x16cb50,null));};exports[_0xe723('0x4b')]=function(_0x56e92a,_0x126ca5){return db['Cdr']['describe']()[_0xe723('0x26')](respondWithResult(_0x126ca5,null))[_0xe723('0x48')](handleError(_0x126ca5,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 89f8057..190b2aa 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(_0x129924,_0x4ebbe7){var _0x3cf3b3=function(_0xa5362f){while(--_0xa5362f){_0x129924['push'](_0x129924['shift']());}};_0x3cf3b3(++_0x4ebbe7);}(_0x7a54,0x106));var _0x47a5=function(_0x346173,_0x113cb9){_0x346173=_0x346173-0x0;var _0x1a1e40=_0x7a54[_0x346173];return _0x1a1e40;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x317d61,_0x5e6335){var _0x3abc20=function(_0x556876){while(--_0x556876){_0x317d61['push'](_0x317d61['shift']());}};_0x3abc20(++_0x5e6335);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index e51b685..c306691 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 _0x130c=['stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x4b9d96,_0x515ffd){var _0x165387=function(_0x244f86){while(--_0x244f86){_0x4b9d96['push'](_0x4b9d96['shift']());}};_0x165387(++_0x515ffd);}(_0x130c,0x180));var _0xc130=function(_0xeb5495,_0x3373c8){_0xeb5495=_0xeb5495-0x0;var _0x5e17e0=_0x130c[_0xeb5495];return _0x5e17e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc130('0x0'));var BPromise=require(_0xc130('0x1'));var rs=require(_0xc130('0x2'));var fs=require('fs');var Redis=require(_0xc130('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc130('0x4'))(_0xc130('0x5'));var config=require(_0xc130('0x6'));var jayson=require(_0xc130('0x7'));var client=jayson[_0xc130('0x8')][_0xc130('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c3d20,_0x343345,_0x40c638){return new BPromise(function(_0x1c619d,_0xbd90bc){return client[_0xc130('0xa')](_0x1c3d20,_0x40c638)['then'](function(_0x4c1b50){logger['info'](_0xc130('0xb'),_0x343345,_0xc130('0xc'));logger[_0xc130('0xd')](_0xc130('0xe'),_0x343345,_0xc130('0xc'),JSON[_0xc130('0xf')](_0x4c1b50));if(_0x4c1b50[_0xc130('0x10')]){if(_0x4c1b50[_0xc130('0x10')]['code']===0x1f4){logger[_0xc130('0x10')]('Cdr,\x20%s,\x20%s',_0x343345,_0x4c1b50['error']['message']);return _0xbd90bc(_0x4c1b50[_0xc130('0x10')][_0xc130('0x11')]);}logger[_0xc130('0x10')]('Cdr,\x20%s,\x20%s',_0x343345,_0x4c1b50[_0xc130('0x10')][_0xc130('0x11')]);return _0x1c619d(_0x4c1b50['error'][_0xc130('0x11')]);}else{logger[_0xc130('0x12')](_0xc130('0xb'),_0x343345,_0xc130('0xc'));_0x1c619d(_0x4c1b50[_0xc130('0x13')]['message']);}})[_0xc130('0x14')](function(_0x20acc7){logger[_0xc130('0x10')](_0xc130('0xb'),_0x343345,_0x20acc7);_0xbd90bc(_0x20acc7);});});}
\ No newline at end of file
+var _0x16d3=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','Cdr,\x20%s,\x20%s','catch','lodash','util','moment','bluebird'];(function(_0x33c7e6,_0x4f70aa){var _0x25dfa2=function(_0x33c2f7){while(--_0x33c2f7){_0x33c7e6['push'](_0x33c7e6['shift']());}};_0x25dfa2(++_0x4f70aa);}(_0x16d3,0x1ca));var _0x316d=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x16d3[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0x316d('0x0'));var util=require(_0x316d('0x1'));var moment=require(_0x316d('0x2'));var BPromise=require(_0x316d('0x3'));var rs=require(_0x316d('0x4'));var fs=require('fs');var Redis=require(_0x316d('0x5'));var db=require(_0x316d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x316d('0x7'))(_0x316d('0x8'));var config=require(_0x316d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x316d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a4d8b,_0x2a46f0,_0x51db46){return new BPromise(function(_0x8b8df7,_0x2a5381){return client[_0x316d('0xb')](_0x5a4d8b,_0x51db46)[_0x316d('0xc')](function(_0x1c9419){logger[_0x316d('0xd')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x316d('0xe'));logger[_0x316d('0xf')](_0x316d('0x10'),_0x2a46f0,'request\x20sent',JSON['stringify'](_0x1c9419));if(_0x1c9419['error']){if(_0x1c9419[_0x316d('0x11')][_0x316d('0x12')]===0x1f4){logger[_0x316d('0x11')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x1c9419['error'][_0x316d('0x13')]);return _0x2a5381(_0x1c9419['error'][_0x316d('0x13')]);}logger['error'](_0x316d('0x14'),_0x2a46f0,_0x1c9419[_0x316d('0x11')][_0x316d('0x13')]);return _0x8b8df7(_0x1c9419[_0x316d('0x11')][_0x316d('0x13')]);}else{logger[_0x316d('0xd')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x316d('0xe'));_0x8b8df7(_0x1c9419['result'][_0x316d('0x13')]);}})[_0x316d('0x15')](function(_0x935110){logger[_0x316d('0x11')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x935110);_0x2a5381(_0x935110);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index a7118be..4bf2c02 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(_0x4c974e,_0x513d9e){var _0x31327b=function(_0x5db97c){while(--_0x5db97c){_0x4c974e['push'](_0x4c974e['shift']());}};_0x31327b(++_0x513d9e);}(_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(_0x3592ab,_0x4f669a){var _0x13298a=function(_0x25f018){while(--_0x25f018){_0x3592ab['push'](_0x3592ab['shift']());}};_0x13298a(++_0x4f669a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 705a3c0..b658592 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 _0xf74d=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xa73aa,_0x4e1e22){var _0x2e8881=function(_0x443ee4){while(--_0x443ee4){_0xa73aa['push'](_0xa73aa['shift']());}};_0x2e8881(++_0x4e1e22);}(_0xf74d,0xe6));var _0xdf74=function(_0x1c4125,_0x169a60){_0x1c4125=_0x1c4125-0x0;var _0x2568a7=_0xf74d[_0x1c4125];return _0x2568a7;};'use strict';var Sequelize=require(_0xdf74('0x0'));module[_0xdf74('0x1')]={'priority':{'type':Sequelize[_0xdf74('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdf74('0x3')],'allowNull':![],'defaultValue':_0xdf74('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xdf74('0x3')]},'interval':{'type':Sequelize[_0xdf74('0x3')],'defaultValue':_0xdf74('0x5')}};
\ No newline at end of file
+var _0x4e88=['noop','TEXT','STRING','*,*,*,*','exports','INTEGER'];(function(_0x56241f,_0xc69854){var _0x2f68ef=function(_0x3fe05e){while(--_0x3fe05e){_0x56241f['push'](_0x56241f['shift']());}};_0x2f68ef(++_0xc69854);}(_0x4e88,0x1d2));var _0x84e8=function(_0x269967,_0x49abd6){_0x269967=_0x269967-0x0;var _0xddff5a=_0x4e88[_0x269967];return _0xddff5a;};'use strict';var Sequelize=require('sequelize');module[_0x84e8('0x0')]={'priority':{'type':Sequelize[_0x84e8('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x84e8('0x2')},'appdata':{'type':Sequelize[_0x84e8('0x3')]()},'description':{'type':Sequelize[_0x84e8('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x84e8('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 4bd6420..293f6fd 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 _0x50a8=['undefined','limit','count','set','Content-Range','json','apply','update','destroy','then','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','length','includeAll','options','find','catch','body','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset'];(function(_0x27670b,_0x55ae98){var _0x5a27a9=function(_0x52117f){while(--_0x52117f){_0x27670b['push'](_0x27670b['shift']());}};_0x5a27a9(++_0x55ae98);}(_0x50a8,0x198));var _0x850a=function(_0x3d95e9,_0x45bb17){_0x3d95e9=_0x3d95e9-0x0;var _0x472c9a=_0x50a8[_0x3d95e9];return _0x472c9a;};'use strict';var emlformat=require(_0x850a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x850a('0x1'));var moment=require('moment');var BPromise=require(_0x850a('0x2'));var Mustache=require(_0x850a('0x3'));var util=require(_0x850a('0x4'));var path=require(_0x850a('0x5'));var sox=require(_0x850a('0x6'));var csv=require(_0x850a('0x7'));var ejs=require(_0x850a('0x8'));var fs=require('fs');var fs_extra=require(_0x850a('0x9'));var _=require(_0x850a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x850a('0xb'));var deskjs=require(_0x850a('0xc'));var toCsv=require(_0x850a('0x7'));var querystring=require(_0x850a('0xd'));var Papa=require('papaparse');var Redis=require(_0x850a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x850a('0xf'));var hardwareService=require(_0x850a('0x10'));var logger=require(_0x850a('0x11'))(_0x850a('0x12'));var utils=require(_0x850a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b12a1,_0x4d591d){_0x4d591d=_0x4d591d||0xcc;return function(_0x45cd78){if(_0x45cd78){return _0x3b12a1[_0x850a('0x14')](_0x4d591d);}return _0x3b12a1[_0x850a('0x15')](_0x4d591d)[_0x850a('0x16')]();};}function respondWithResult(_0x3328e6,_0x50c199){_0x50c199=_0x50c199||0xc8;return function(_0x355a31){if(_0x355a31){return _0x3328e6['status'](_0x50c199)['json'](_0x355a31);}};}function respondWithFilteredResult(_0x537679,_0x4c0156){return function(_0x3e6e81){if(_0x3e6e81){var _0x5e0fbe=typeof _0x4c0156[_0x850a('0x17')]===_0x850a('0x18')&&typeof _0x4c0156[_0x850a('0x19')]===_0x850a('0x18');var _0x22d759=_0x3e6e81[_0x850a('0x1a')];var _0x3e2715=_0x5e0fbe?0x0:_0x4c0156[_0x850a('0x17')];var _0x57e789=_0x5e0fbe?_0x3e6e81[_0x850a('0x1a')]:_0x4c0156['offset']+_0x4c0156['limit'];var _0x49690e;if(_0x57e789>=_0x22d759){_0x57e789=_0x22d759;_0x49690e=0xc8;}else{_0x49690e=0xce;}_0x537679['status'](_0x49690e);return _0x537679[_0x850a('0x1b')](_0x850a('0x1c'),_0x3e2715+'-'+_0x57e789+'/'+_0x22d759)[_0x850a('0x1d')](_0x3e6e81);}return null;};}function patchUpdates(_0x5b2917){return function(_0x17eadb){try{jsonpatch[_0x850a('0x1e')](_0x17eadb,_0x5b2917,!![]);}catch(_0x15c39b){return BPromise['reject'](_0x15c39b);}return _0x17eadb['save']();};}function saveUpdates(_0x342b50,_0x285ef4){return function(_0x5758af){if(_0x5758af){return _0x5758af[_0x850a('0x1f')](_0x342b50)['then'](function(_0x5eb2a4){return _0x5eb2a4;});}return null;};}function removeEntity(_0x561fde,_0x4363d4){return function(_0x47d527){if(_0x47d527){return _0x47d527[_0x850a('0x20')]()[_0x850a('0x21')](function(){_0x561fde[_0x850a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4606ef,_0xc52e71){return function(_0x33327e){if(!_0x33327e){_0x4606ef['sendStatus'](0x194);}return _0x33327e;};}function handleError(_0x1da9ad,_0xe46a27){_0xe46a27=_0xe46a27||0x1f4;return function(_0x4d715c){logger[_0x850a('0x22')](_0x4d715c[_0x850a('0x23')]);if(_0x4d715c[_0x850a('0x24')]){delete _0x4d715c[_0x850a('0x24')];}_0x1da9ad[_0x850a('0x15')](_0xe46a27)[_0x850a('0x25')](_0x4d715c);};}exports[_0x850a('0x26')]=function(_0x314d36,_0x3a228f){var _0x177dd6={'raw':!![],'where':{'id':_0x314d36[_0x850a('0x27')]['id']}},_0x44fb58={};_0x44fb58[_0x850a('0x28')]=_[_0x850a('0x29')](db[_0x850a('0x2a')]['rawAttributes']);_0x44fb58[_0x850a('0x2b')]=_['keys'](_0x314d36[_0x850a('0x2b')]);_0x44fb58[_0x850a('0x2c')]=_[_0x850a('0x2d')](_0x44fb58['model'],_0x44fb58['query']);_0x177dd6['attributes']=_[_0x850a('0x2d')](_0x44fb58['model'],qs[_0x850a('0x2e')](_0x314d36[_0x850a('0x2b')][_0x850a('0x2e')]));_0x177dd6[_0x850a('0x2f')]=_0x177dd6['attributes'][_0x850a('0x30')]?_0x177dd6[_0x850a('0x2f')]:_0x44fb58[_0x850a('0x28')];if(_0x314d36[_0x850a('0x2b')][_0x850a('0x31')]){_0x177dd6['include']=[{'all':!![]}];}_0x177dd6=_['merge']({},_0x177dd6,_0x314d36[_0x850a('0x32')]);return db['ChatApplication'][_0x850a('0x33')](_0x177dd6)[_0x850a('0x21')](handleEntityNotFound(_0x3a228f,null))[_0x850a('0x21')](respondWithResult(_0x3a228f,null))[_0x850a('0x34')](handleError(_0x3a228f,null));};exports[_0x850a('0x1f')]=function(_0x172050,_0x3d88bb){if(_0x172050[_0x850a('0x35')]['id']){delete _0x172050[_0x850a('0x35')]['id'];}return db[_0x850a('0x2a')]['find']({'where':{'id':_0x172050[_0x850a('0x27')]['id']}})[_0x850a('0x21')](handleEntityNotFound(_0x3d88bb,null))[_0x850a('0x21')](saveUpdates(_0x172050[_0x850a('0x35')],null))[_0x850a('0x21')](respondWithResult(_0x3d88bb,null))['catch'](handleError(_0x3d88bb,null));};exports[_0x850a('0x20')]=function(_0x376a12,_0x58d34d){return db[_0x850a('0x2a')][_0x850a('0x33')]({'where':{'id':_0x376a12[_0x850a('0x27')]['id']}})['then'](handleEntityNotFound(_0x58d34d,null))['then'](removeEntity(_0x58d34d,null))[_0x850a('0x34')](handleError(_0x58d34d,null));};
\ No newline at end of file
+var _0x4ad3=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x14c696,_0x43e421){var _0x39d58e=function(_0x109913){while(--_0x109913){_0x14c696['push'](_0x14c696['shift']());}};_0x39d58e(++_0x43e421);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x4ad3[_0x334fea];return _0x3c5829;};'use strict';var emlformat=require(_0x34ad('0x0'));var rimraf=require(_0x34ad('0x1'));var zipdir=require(_0x34ad('0x2'));var jsonpatch=require(_0x34ad('0x3'));var rp=require(_0x34ad('0x4'));var moment=require(_0x34ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x34ad('0x6'));var util=require(_0x34ad('0x7'));var path=require(_0x34ad('0x8'));var sox=require(_0x34ad('0x9'));var csv=require(_0x34ad('0xa'));var ejs=require(_0x34ad('0xb'));var fs=require('fs');var fs_extra=require(_0x34ad('0xc'));var _=require(_0x34ad('0xd'));var squel=require(_0x34ad('0xe'));var crypto=require(_0x34ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x34ad('0xa'));var querystring=require(_0x34ad('0x10'));var Papa=require(_0x34ad('0x11'));var Redis=require(_0x34ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x34ad('0x13'));var as=require(_0x34ad('0x14'));var hardwareService=require(_0x34ad('0x15'));var logger=require(_0x34ad('0x16'))(_0x34ad('0x17'));var utils=require(_0x34ad('0x18'));var config=require(_0x34ad('0x19'));var licenseUtil=require(_0x34ad('0x1a'));var db=require(_0x34ad('0x1b'))['db'];function respondWithStatusCode(_0x377c90,_0x14c9fd){_0x14c9fd=_0x14c9fd||0xcc;return function(_0x1be906){if(_0x1be906){return _0x377c90[_0x34ad('0x1c')](_0x14c9fd);}return _0x377c90[_0x34ad('0x1d')](_0x14c9fd)[_0x34ad('0x1e')]();};}function respondWithResult(_0xc64e62,_0x558097){_0x558097=_0x558097||0xc8;return function(_0x4764e9){if(_0x4764e9){return _0xc64e62[_0x34ad('0x1d')](_0x558097)[_0x34ad('0x1f')](_0x4764e9);}};}function respondWithFilteredResult(_0x5e2a1d,_0x21a78c){return function(_0x262123){if(_0x262123){var _0x38a15e=typeof _0x21a78c[_0x34ad('0x20')]===_0x34ad('0x21')&&typeof _0x21a78c['limit']===_0x34ad('0x21');var _0x4daa5c=_0x262123[_0x34ad('0x22')];var _0x294326=_0x38a15e?0x0:_0x21a78c[_0x34ad('0x20')];var _0x7036e0=_0x38a15e?_0x262123[_0x34ad('0x22')]:_0x21a78c['offset']+_0x21a78c[_0x34ad('0x23')];var _0x3a2cd5;if(_0x7036e0>=_0x4daa5c){_0x7036e0=_0x4daa5c;_0x3a2cd5=0xc8;}else{_0x3a2cd5=0xce;}_0x5e2a1d[_0x34ad('0x1d')](_0x3a2cd5);return _0x5e2a1d[_0x34ad('0x24')](_0x34ad('0x25'),_0x294326+'-'+_0x7036e0+'/'+_0x4daa5c)[_0x34ad('0x1f')](_0x262123);}return null;};}function patchUpdates(_0x3c178a){return function(_0x45557e){try{jsonpatch[_0x34ad('0x26')](_0x45557e,_0x3c178a,!![]);}catch(_0x55140c){return BPromise[_0x34ad('0x27')](_0x55140c);}return _0x45557e['save']();};}function saveUpdates(_0x1c2d49,_0x493f73){return function(_0x154ee8){if(_0x154ee8){return _0x154ee8[_0x34ad('0x28')](_0x1c2d49)[_0x34ad('0x29')](function(_0x1c2fa5){return _0x1c2fa5;});}return null;};}function removeEntity(_0x737c2d,_0x4a06a7){return function(_0x5a8379){if(_0x5a8379){return _0x5a8379[_0x34ad('0x2a')]()['then'](function(){_0x737c2d[_0x34ad('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d5495,_0x34d2ae){return function(_0x3df4ca){if(!_0x3df4ca){_0x5d5495[_0x34ad('0x1c')](0x194);}return _0x3df4ca;};}function handleError(_0x3cb657,_0x17fc51){_0x17fc51=_0x17fc51||0x1f4;return function(_0x320b6a){logger[_0x34ad('0x2b')](_0x320b6a[_0x34ad('0x2c')]);if(_0x320b6a[_0x34ad('0x2d')]){delete _0x320b6a[_0x34ad('0x2d')];}_0x3cb657['status'](_0x17fc51)[_0x34ad('0x2e')](_0x320b6a);};}exports[_0x34ad('0x2f')]=function(_0x23bb04,_0x31b880){var _0x2bcdc3={'raw':!![],'where':{'id':_0x23bb04[_0x34ad('0x30')]['id']}},_0x1b2387={};_0x1b2387[_0x34ad('0x31')]=_[_0x34ad('0x32')](db[_0x34ad('0x33')][_0x34ad('0x34')]);_0x1b2387[_0x34ad('0x35')]=_[_0x34ad('0x32')](_0x23bb04[_0x34ad('0x35')]);_0x1b2387[_0x34ad('0x36')]=_[_0x34ad('0x37')](_0x1b2387['model'],_0x1b2387[_0x34ad('0x35')]);_0x2bcdc3['attributes']=_[_0x34ad('0x37')](_0x1b2387[_0x34ad('0x31')],qs[_0x34ad('0x38')](_0x23bb04[_0x34ad('0x35')]['fields']));_0x2bcdc3[_0x34ad('0x39')]=_0x2bcdc3[_0x34ad('0x39')][_0x34ad('0x3a')]?_0x2bcdc3[_0x34ad('0x39')]:_0x1b2387['model'];if(_0x23bb04['query']['includeAll']){_0x2bcdc3[_0x34ad('0x3b')]=[{'all':!![]}];}_0x2bcdc3=_[_0x34ad('0x3c')]({},_0x2bcdc3,_0x23bb04[_0x34ad('0x3d')]);return db[_0x34ad('0x33')][_0x34ad('0x3e')](_0x2bcdc3)['then'](handleEntityNotFound(_0x31b880,null))[_0x34ad('0x29')](respondWithResult(_0x31b880,null))[_0x34ad('0x3f')](handleError(_0x31b880,null));};exports[_0x34ad('0x28')]=function(_0x2a3330,_0x1b79b3){if(_0x2a3330[_0x34ad('0x40')]['id']){delete _0x2a3330[_0x34ad('0x40')]['id'];}return db[_0x34ad('0x33')][_0x34ad('0x3e')]({'where':{'id':_0x2a3330[_0x34ad('0x30')]['id']}})[_0x34ad('0x29')](handleEntityNotFound(_0x1b79b3,null))[_0x34ad('0x29')](saveUpdates(_0x2a3330[_0x34ad('0x40')],null))[_0x34ad('0x29')](respondWithResult(_0x1b79b3,null))[_0x34ad('0x3f')](handleError(_0x1b79b3,null));};exports[_0x34ad('0x2a')]=function(_0x41a5a2,_0x23e15b){return db[_0x34ad('0x33')][_0x34ad('0x3e')]({'where':{'id':_0x41a5a2['params']['id']}})['then'](handleEntityNotFound(_0x23e15b,null))[_0x34ad('0x29')](removeEntity(_0x23e15b,null))[_0x34ad('0x3f')](handleError(_0x23e15b,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index c7ac45b..4896302 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 _0xe920=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xe920,0xbe));var _0x0e92=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0xe920[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0x0e92('0x0'));var util=require(_0x0e92('0x1'));var logger=require(_0x0e92('0x2'))(_0x0e92('0x3'));var moment=require(_0x0e92('0x4'));var BPromise=require(_0x0e92('0x5'));var rp=require(_0x0e92('0x6'));var fs=require('fs');var path=require(_0x0e92('0x7'));var rimraf=require(_0x0e92('0x8'));var config=require(_0x0e92('0x9'));var attributes=require('./chatApplication.attributes');module[_0x0e92('0xa')]=function(_0x5291e2,_0x40d9f2){return _0x5291e2[_0x0e92('0xb')](_0x0e92('0xc'),attributes,{'tableName':_0x0e92('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0e92('0xe')});};
\ No newline at end of file
+var _0x4385=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x4385,0x168));var _0x5438=function(_0x1336ff,_0x4426b6){_0x1336ff=_0x1336ff-0x0;var _0x1485d5=_0x4385[_0x1336ff];return _0x1485d5;};'use strict';var _=require(_0x5438('0x0'));var util=require(_0x5438('0x1'));var logger=require(_0x5438('0x2'))(_0x5438('0x3'));var moment=require('moment');var BPromise=require(_0x5438('0x4'));var rp=require(_0x5438('0x5'));var fs=require('fs');var path=require(_0x5438('0x6'));var rimraf=require(_0x5438('0x7'));var config=require(_0x5438('0x8'));var attributes=require(_0x5438('0x9'));module[_0x5438('0xa')]=function(_0x4ce1df,_0x46c7fa){return _0x4ce1df[_0x5438('0xb')](_0x5438('0xc'),attributes,{'tableName':_0x5438('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5438('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0541f9a..1104a57 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 _0x69a6=['info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x58c241,_0x13be02){var _0x358876=function(_0xf76fc6){while(--_0xf76fc6){_0x58c241['push'](_0x58c241['shift']());}};_0x358876(++_0x13be02);}(_0x69a6,0x10d));var _0x669a=function(_0x39e23a,_0x17845e){_0x39e23a=_0x39e23a-0x0;var _0x40eda6=_0x69a6[_0x39e23a];return _0x40eda6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x669a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x669a('0x1'))['db'];var utils=require(_0x669a('0x2'));var logger=require(_0x669a('0x3'))(_0x669a('0x4'));var config=require(_0x669a('0x5'));var jayson=require(_0x669a('0x6'));var client=jayson[_0x669a('0x7')][_0x669a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f33ae,_0x45c78e,_0x16068d){return new BPromise(function(_0x255ed2,_0x452893){return client[_0x669a('0x9')](_0x2f33ae,_0x16068d)[_0x669a('0xa')](function(_0x26845a){logger[_0x669a('0xb')]('ChatApplication,\x20%s,\x20%s',_0x45c78e,_0x669a('0xc'));logger['debug'](_0x669a('0xd'),_0x45c78e,_0x669a('0xc'),JSON[_0x669a('0xe')](_0x26845a));if(_0x26845a[_0x669a('0xf')]){if(_0x26845a[_0x669a('0xf')]['code']===0x1f4){logger[_0x669a('0xf')](_0x669a('0x10'),_0x45c78e,_0x26845a[_0x669a('0xf')]['message']);return _0x452893(_0x26845a[_0x669a('0xf')][_0x669a('0x11')]);}logger[_0x669a('0xf')](_0x669a('0x10'),_0x45c78e,_0x26845a[_0x669a('0xf')][_0x669a('0x11')]);return _0x255ed2(_0x26845a[_0x669a('0xf')]['message']);}else{logger['info'](_0x669a('0x10'),_0x45c78e,_0x669a('0xc'));_0x255ed2(_0x26845a[_0x669a('0x12')][_0x669a('0x11')]);}})[_0x669a('0x13')](function(_0x2830e4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x45c78e,_0x2830e4);_0x452893(_0x2830e4);});});}
\ No newline at end of file
+var _0xcf6e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util','moment','bluebird'];(function(_0x4314c4,_0x4a21db){var _0x315931=function(_0x38e0c7){while(--_0x38e0c7){_0x4314c4['push'](_0x4314c4['shift']());}};_0x315931(++_0x4a21db);}(_0xcf6e,0xf3));var _0xecf6=function(_0x17211b,_0x52ceee){_0x17211b=_0x17211b-0x0;var _0x27e7a2=_0xcf6e[_0x17211b];return _0x27e7a2;};'use strict';var _=require(_0xecf6('0x0'));var util=require(_0xecf6('0x1'));var moment=require(_0xecf6('0x2'));var BPromise=require(_0xecf6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecf6('0x4'));var db=require(_0xecf6('0x5'))['db'];var utils=require(_0xecf6('0x6'));var logger=require(_0xecf6('0x7'))(_0xecf6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xecf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d84f7,_0x10e3cf,_0x498ddb){return new BPromise(function(_0x5dfb00,_0x3c1554){return client[_0xecf6('0xa')](_0x4d84f7,_0x498ddb)['then'](function(_0x517a45){logger[_0xecf6('0xb')](_0xecf6('0xc'),_0x10e3cf,_0xecf6('0xd'));logger['debug'](_0xecf6('0xe'),_0x10e3cf,'request\x20sent',JSON[_0xecf6('0xf')](_0x517a45));if(_0x517a45['error']){if(_0x517a45['error'][_0xecf6('0x10')]===0x1f4){logger[_0xecf6('0x11')](_0xecf6('0xc'),_0x10e3cf,_0x517a45[_0xecf6('0x11')]['message']);return _0x3c1554(_0x517a45['error']['message']);}logger[_0xecf6('0x11')](_0xecf6('0xc'),_0x10e3cf,_0x517a45[_0xecf6('0x11')][_0xecf6('0x12')]);return _0x5dfb00(_0x517a45[_0xecf6('0x11')][_0xecf6('0x12')]);}else{logger[_0xecf6('0xb')](_0xecf6('0xc'),_0x10e3cf,_0xecf6('0xd'));_0x5dfb00(_0x517a45['result']['message']);}})['catch'](function(_0x1b45ef){logger[_0xecf6('0x11')]('ChatApplication,\x20%s,\x20%s',_0x10e3cf,_0x1b45ef);_0x3c1554(_0x1b45ef);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 3deedcc..387f371 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 _0x91c6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','/:id','delete','exports','multer','util','path','express','fs-extra'];(function(_0x47875a,_0x514333){var _0x50e74d=function(_0x108d24){while(--_0x108d24){_0x47875a['push'](_0x47875a['shift']());}};_0x50e74d(++_0x514333);}(_0x91c6,0x1db));var _0x691c=function(_0x122884,_0x9867c5){_0x122884=_0x122884-0x0;var _0x3b386f=_0x91c6[_0x122884];return _0x3b386f;};'use strict';var multer=require(_0x691c('0x0'));var util=require(_0x691c('0x1'));var path=require(_0x691c('0x2'));var timeout=require('connect-timeout');var express=require(_0x691c('0x3'));var router=express['Router']();var fs_extra=require(_0x691c('0x4'));var auth=require(_0x691c('0x5'));var interaction=require(_0x691c('0x6'));var config=require(_0x691c('0x7'));var controller=require(_0x691c('0x8'));router[_0x691c('0x9')]('/:id',auth[_0x691c('0xa')](),controller[_0x691c('0xb')]);router['put'](_0x691c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x691c('0xd')](_0x691c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x691c('0xe')]=router;
\ No newline at end of file
+var _0xf56e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','update'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xf56e,0x135));var _0xef56=function(_0x2068ae,_0x455540){_0x2068ae=_0x2068ae-0x0;var _0x37d844=_0xf56e[_0x2068ae];return _0x37d844;};'use strict';var multer=require(_0xef56('0x0'));var util=require(_0xef56('0x1'));var path=require(_0xef56('0x2'));var timeout=require(_0xef56('0x3'));var express=require(_0xef56('0x4'));var router=express[_0xef56('0x5')]();var fs_extra=require(_0xef56('0x6'));var auth=require(_0xef56('0x7'));var interaction=require(_0xef56('0x8'));var config=require(_0xef56('0x9'));var controller=require(_0xef56('0xa'));router['get'](_0xef56('0xb'),auth[_0xef56('0xc')](),controller[_0xef56('0xd')]);router['put']('/:id',auth[_0xef56('0xc')](),controller[_0xef56('0xe')]);router[_0xef56('0xf')](_0xef56('0xb'),auth[_0xef56('0xc')](),controller[_0xef56('0x10')]);module[_0xef56('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index bb9f5a5..92ee992 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 _0xc9d9=['sequelize','STRING','BOOLEAN'];(function(_0x4ce3b8,_0x4e86ea){var _0x39056c=function(_0x548e93){while(--_0x548e93){_0x4ce3b8['push'](_0x4ce3b8['shift']());}};_0x39056c(++_0x4e86ea);}(_0xc9d9,0x195));var _0x9c9d=function(_0x2c4ead,_0x6d53e2){_0x2c4ead=_0x2c4ead-0x0;var _0x8100f=_0xc9d9[_0x2c4ead];return _0x8100f;};'use strict';var Sequelize=require(_0x9c9d('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c9d('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9c9d('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0170=['STRING','BOOLEAN','sequelize','exports'];(function(_0x41430d,_0x45f545){var _0x3167da=function(_0x12640f){while(--_0x12640f){_0x41430d['push'](_0x41430d['shift']());}};_0x3167da(++_0x45f545);}(_0x0170,0x1d6));var _0x0017=function(_0x5e09f1,_0x4903d1){_0x5e09f1=_0x5e09f1-0x0;var _0x6e80c1=_0x0170[_0x5e09f1];return _0x6e80c1;};'use strict';var Sequelize=require(_0x0017('0x0'));module[_0x0017('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0017('0x2')]},'write':{'type':Sequelize[_0x0017('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index d902502..a44549e 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 _0x0d59=['reject','save','then','destroy','error','stack','name','index','ChatGroup','rawAttributes','fieldName','type','query','filters','model','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','catch','params','keys','attributes','length','include','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','User','map','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x252cab,_0x228f2d){var _0x5c5f1e=function(_0xaf4d22){while(--_0xaf4d22){_0x252cab['push'](_0x252cab['shift']());}};_0x5c5f1e(++_0x228f2d);}(_0x0d59,0x1ac));var _0x90d5=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0x0d59[_0xdaab62];return _0x13d767;};'use strict';var emlformat=require(_0x90d5('0x0'));var rimraf=require(_0x90d5('0x1'));var zipdir=require(_0x90d5('0x2'));var jsonpatch=require(_0x90d5('0x3'));var rp=require('request-promise');var moment=require(_0x90d5('0x4'));var BPromise=require(_0x90d5('0x5'));var Mustache=require(_0x90d5('0x6'));var util=require(_0x90d5('0x7'));var path=require(_0x90d5('0x8'));var sox=require(_0x90d5('0x9'));var csv=require(_0x90d5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90d5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x90d5('0xc'));var jsforce=require(_0x90d5('0xd'));var deskjs=require(_0x90d5('0xe'));var toCsv=require(_0x90d5('0xa'));var querystring=require(_0x90d5('0xf'));var Papa=require(_0x90d5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x90d5('0x11'));var hardwareService=require(_0x90d5('0x12'));var logger=require(_0x90d5('0x13'))(_0x90d5('0x14'));var utils=require(_0x90d5('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x90d5('0x16'))['db'];config['redis']=_['defaults'](config[_0x90d5('0x17')],{'host':_0x90d5('0x18'),'port':0x18eb});var socket=require(_0x90d5('0x19'))(new Redis(config[_0x90d5('0x17')]));require('./chatGroup.socket')[_0x90d5('0x1a')](socket);function respondWithStatusCode(_0xb52769,_0x4941cc){_0x4941cc=_0x4941cc||0xcc;return function(_0x2b66a8){if(_0x2b66a8){return _0xb52769[_0x90d5('0x1b')](_0x4941cc);}return _0xb52769[_0x90d5('0x1c')](_0x4941cc)[_0x90d5('0x1d')]();};}function respondWithResult(_0x8cdf1f,_0x58bf80){_0x58bf80=_0x58bf80||0xc8;return function(_0x5ec7c5){if(_0x5ec7c5){return _0x8cdf1f['status'](_0x58bf80)[_0x90d5('0x1e')](_0x5ec7c5);}};}function respondWithFilteredResult(_0x39dae0,_0x4c4e90){return function(_0xbf63da){if(_0xbf63da){var _0x549de9=typeof _0x4c4e90[_0x90d5('0x1f')]===_0x90d5('0x20')&&typeof _0x4c4e90[_0x90d5('0x21')]===_0x90d5('0x20');var _0x3f754c=_0xbf63da[_0x90d5('0x22')];var _0x1ee93f=_0x549de9?0x0:_0x4c4e90['offset'];var _0x1a8fac=_0x549de9?_0xbf63da['count']:_0x4c4e90[_0x90d5('0x1f')]+_0x4c4e90['limit'];var _0x58608a;if(_0x1a8fac>=_0x3f754c){_0x1a8fac=_0x3f754c;_0x58608a=0xc8;}else{_0x58608a=0xce;}_0x39dae0['status'](_0x58608a);return _0x39dae0['set'](_0x90d5('0x23'),_0x1ee93f+'-'+_0x1a8fac+'/'+_0x3f754c)[_0x90d5('0x1e')](_0xbf63da);}return null;};}function patchUpdates(_0x5a6c06){return function(_0x47c566){try{jsonpatch[_0x90d5('0x24')](_0x47c566,_0x5a6c06,!![]);}catch(_0x1d3913){return BPromise[_0x90d5('0x25')](_0x1d3913);}return _0x47c566[_0x90d5('0x26')]();};}function saveUpdates(_0x46ccdb,_0x239f31){return function(_0x30bc9a){if(_0x30bc9a){return _0x30bc9a['update'](_0x46ccdb)[_0x90d5('0x27')](function(_0xe59bef){return _0xe59bef;});}return null;};}function removeEntity(_0x54ef5c,_0xc2df75){return function(_0x30d214){if(_0x30d214){return _0x30d214[_0x90d5('0x28')]()[_0x90d5('0x27')](function(){_0x54ef5c['status'](0xcc)[_0x90d5('0x1d')]();});}};}function handleEntityNotFound(_0x57d69e,_0x56a7b5){return function(_0x417d0f){if(!_0x417d0f){_0x57d69e[_0x90d5('0x1b')](0x194);}return _0x417d0f;};}function handleError(_0x36c585,_0x31d8af){_0x31d8af=_0x31d8af||0x1f4;return function(_0x1d1503){logger[_0x90d5('0x29')](_0x1d1503[_0x90d5('0x2a')]);if(_0x1d1503[_0x90d5('0x2b')]){delete _0x1d1503[_0x90d5('0x2b')];}_0x36c585[_0x90d5('0x1c')](_0x31d8af)['send'](_0x1d1503);};}exports[_0x90d5('0x2c')]=function(_0x43061e,_0x4c3749){var _0x528fc2={},_0x314815={},_0x112f0b={'count':0x0,'rows':[]};var _0x14aa0d=_['map'](db[_0x90d5('0x2d')][_0x90d5('0x2e')],function(_0x508bb3){return{'name':_0x508bb3[_0x90d5('0x2f')],'type':_0x508bb3[_0x90d5('0x30')]['key']};});_0x314815['model']=_['map'](_0x14aa0d,_0x90d5('0x2b'));_0x314815[_0x90d5('0x31')]=_['keys'](_0x43061e[_0x90d5('0x31')]);_0x314815[_0x90d5('0x32')]=_['intersection'](_0x314815[_0x90d5('0x33')],_0x314815[_0x90d5('0x31')]);_0x528fc2['attributes']=_[_0x90d5('0x34')](_0x314815['model'],qs[_0x90d5('0x35')](_0x43061e[_0x90d5('0x31')][_0x90d5('0x35')]));_0x528fc2['attributes']=_0x528fc2['attributes']['length']?_0x528fc2['attributes']:_0x314815[_0x90d5('0x33')];if(!_0x43061e[_0x90d5('0x31')][_0x90d5('0x36')](_0x90d5('0x37'))){_0x528fc2[_0x90d5('0x21')]=qs[_0x90d5('0x21')](_0x43061e[_0x90d5('0x31')][_0x90d5('0x21')]);_0x528fc2[_0x90d5('0x1f')]=qs['offset'](_0x43061e['query'][_0x90d5('0x1f')]);}_0x528fc2[_0x90d5('0x38')]=qs[_0x90d5('0x39')](_0x43061e[_0x90d5('0x31')][_0x90d5('0x39')]);_0x528fc2[_0x90d5('0x3a')]=qs[_0x90d5('0x32')](_[_0x90d5('0x3b')](_0x43061e[_0x90d5('0x31')],_0x314815[_0x90d5('0x32')]),_0x14aa0d);if(_0x43061e['query'][_0x90d5('0x3c')]){_0x528fc2[_0x90d5('0x3a')]=_[_0x90d5('0x3d')](_0x528fc2['where'],{'$or':_['map'](_0x14aa0d,function(_0xa78192){if(_0xa78192['type']!=='VIRTUAL'){var _0x203d59={};_0x203d59[_0xa78192[_0x90d5('0x2b')]]={'$like':'%'+_0x43061e['query'][_0x90d5('0x3c')]+'%'};return _0x203d59;}})});}_0x528fc2=_[_0x90d5('0x3d')]({},_0x528fc2,_0x43061e[_0x90d5('0x3e')]);var _0xb2a05e={'where':_0x528fc2['where']};return db[_0x90d5('0x2d')][_0x90d5('0x22')](_0xb2a05e)[_0x90d5('0x27')](function(_0x81ac87){_0x112f0b[_0x90d5('0x22')]=_0x81ac87;if(_0x43061e[_0x90d5('0x31')][_0x90d5('0x3f')]){_0x528fc2['include']=[{'all':!![]}];}return db[_0x90d5('0x2d')]['findAll'](_0x528fc2);})[_0x90d5('0x27')](function(_0xe44cb2){_0x112f0b['rows']=_0xe44cb2;return _0x112f0b;})[_0x90d5('0x27')](respondWithFilteredResult(_0x4c3749,_0x528fc2))[_0x90d5('0x40')](handleError(_0x4c3749,null));};exports['show']=function(_0x865f19,_0x2ffd01){var _0x1b41d2={'raw':!![],'where':{'id':_0x865f19[_0x90d5('0x41')]['id']}},_0x226f12={};_0x226f12[_0x90d5('0x33')]=_[_0x90d5('0x42')](db[_0x90d5('0x2d')][_0x90d5('0x2e')]);_0x226f12[_0x90d5('0x31')]=_[_0x90d5('0x42')](_0x865f19['query']);_0x226f12[_0x90d5('0x32')]=_['intersection'](_0x226f12['model'],_0x226f12[_0x90d5('0x31')]);_0x1b41d2['attributes']=_[_0x90d5('0x34')](_0x226f12['model'],qs['fields'](_0x865f19[_0x90d5('0x31')][_0x90d5('0x35')]));_0x1b41d2[_0x90d5('0x43')]=_0x1b41d2[_0x90d5('0x43')][_0x90d5('0x44')]?_0x1b41d2[_0x90d5('0x43')]:_0x226f12[_0x90d5('0x33')];if(_0x865f19['query']['includeAll']){_0x1b41d2[_0x90d5('0x45')]=[{'all':!![]}];}_0x1b41d2=_[_0x90d5('0x3d')]({},_0x1b41d2,_0x865f19[_0x90d5('0x3e')]);return db[_0x90d5('0x2d')][_0x90d5('0x46')](_0x1b41d2)[_0x90d5('0x27')](handleEntityNotFound(_0x2ffd01,null))['then'](respondWithResult(_0x2ffd01,null))[_0x90d5('0x40')](handleError(_0x2ffd01,null));};exports[_0x90d5('0x47')]=function(_0x343748,_0x4e5d16){return db[_0x90d5('0x2d')][_0x90d5('0x47')](_0x343748[_0x90d5('0x48')],{})[_0x90d5('0x27')](respondWithResult(_0x4e5d16,0xc9))[_0x90d5('0x40')](handleError(_0x4e5d16,null));};exports[_0x90d5('0x49')]=function(_0x38ed41,_0x2a2d84){if(_0x38ed41[_0x90d5('0x48')]['id']){delete _0x38ed41[_0x90d5('0x48')]['id'];}return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x38ed41['params']['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x2a2d84,null))['then'](saveUpdates(_0x38ed41[_0x90d5('0x48')],null))[_0x90d5('0x27')](respondWithResult(_0x2a2d84,null))[_0x90d5('0x40')](handleError(_0x2a2d84,null));};exports[_0x90d5('0x28')]=function(_0x2ce545,_0x1fa33f){return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x2ce545[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x1fa33f,null))['then'](removeEntity(_0x1fa33f,null))['catch'](handleError(_0x1fa33f,null));};exports[_0x90d5('0x4a')]=function(_0x43c8ec,_0x40f035){return db['ChatGroup'][_0x90d5('0x4a')]()[_0x90d5('0x27')](respondWithResult(_0x40f035,null))[_0x90d5('0x40')](handleError(_0x40f035,null));};exports[_0x90d5('0x4b')]=function(_0x3d3726,_0x2e73e3,_0x50d0b2){return db[_0x90d5('0x4c')][_0x90d5('0x22')]({'where':{'ChatGroupId':_0x3d3726[_0x90d5('0x41')]['id'],'ToId':_0x3d3726[_0x90d5('0x4d')]['id'],'read':![]}})['then'](function(_0x38bae3){return{'id':_[_0x90d5('0x4e')](_0x3d3726[_0x90d5('0x41')]['id']),'count':_0x38bae3};})[_0x90d5('0x27')](respondWithResult(_0x2e73e3,null))['catch'](handleError(_0x2e73e3,null));};exports[_0x90d5('0x4f')]=function(_0x1220a7,_0x1e56ac,_0x202b4c){return db['ChatGroup'][_0x90d5('0x46')]({'where':{'id':_0x1220a7[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x1e56ac,null))['then'](function(_0x288d8f){if(_0x288d8f){return _0x288d8f[_0x90d5('0x4f')](_0x1220a7[_0x90d5('0x48')][_0x90d5('0x50')],_['omit'](_0x1220a7['body'],[_0x90d5('0x50'),'id'])||{});}})[_0x90d5('0x27')](respondWithResult(_0x1e56ac,null))[_0x90d5('0x40')](handleError(_0x1e56ac,null));};exports['getMembers']=function(_0x53a8c9,_0x3f95e3,_0x4ca241){var _0x495daa={};var _0x4fd60b={};var _0x5b5f1c;var _0x1bb019;return db['ChatGroup']['findOne']({'where':{'id':_0x53a8c9['params']['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x3f95e3,null))['then'](function(_0xfb6524){if(_0xfb6524){_0x5b5f1c=_0xfb6524;_0x4fd60b[_0x90d5('0x33')]=_['keys'](db[_0x90d5('0x51')]['rawAttributes']);_0x4fd60b[_0x90d5('0x31')]=_[_0x90d5('0x42')](_0x53a8c9[_0x90d5('0x31')]);_0x4fd60b['filters']=_[_0x90d5('0x34')](_0x4fd60b[_0x90d5('0x33')],_0x4fd60b[_0x90d5('0x31')]);_0x495daa[_0x90d5('0x43')]=_[_0x90d5('0x34')](_0x4fd60b[_0x90d5('0x33')],qs[_0x90d5('0x35')](_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x35')]));_0x495daa[_0x90d5('0x43')]=_0x495daa[_0x90d5('0x43')][_0x90d5('0x44')]?_0x495daa[_0x90d5('0x43')]:_0x4fd60b[_0x90d5('0x33')];_0x495daa[_0x90d5('0x38')]=qs[_0x90d5('0x39')](_0x53a8c9['query'][_0x90d5('0x39')]);_0x495daa[_0x90d5('0x3a')]=qs[_0x90d5('0x32')](_[_0x90d5('0x3b')](_0x53a8c9[_0x90d5('0x31')],_0x4fd60b[_0x90d5('0x32')]));if(_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x3c')]){_0x495daa[_0x90d5('0x3a')]=_[_0x90d5('0x3d')](_0x495daa[_0x90d5('0x3a')],{'$or':_[_0x90d5('0x52')](_0x495daa[_0x90d5('0x43')],function(_0x4d3d40){var _0x3b2109={};_0x3b2109[_0x4d3d40]={'$like':'%'+_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x3c')]+'%'};return _0x3b2109;})});}_0x495daa=_[_0x90d5('0x3d')]({},_0x495daa,_0x53a8c9['options']);return _0x5b5f1c['getMembers'](_0x495daa);}})[_0x90d5('0x27')](function(_0x456137){if(_0x456137){_0x1bb019=_0x456137['length'];if(!_0x53a8c9['query'][_0x90d5('0x36')](_0x90d5('0x37'))){_0x495daa['limit']=qs[_0x90d5('0x21')](_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x21')]);_0x495daa[_0x90d5('0x1f')]=qs['offset'](_0x53a8c9['query'][_0x90d5('0x1f')]);}return _0x5b5f1c[_0x90d5('0x53')](_0x495daa);}})['then'](function(_0x2eab72){if(_0x2eab72){return _0x2eab72?{'count':_0x1bb019,'rows':_0x2eab72}:null;}})[_0x90d5('0x27')](respondWithResult(_0x3f95e3,null))[_0x90d5('0x40')](handleError(_0x3f95e3,null));};exports[_0x90d5('0x54')]=function(_0x1bc26d,_0x28b925,_0x2d35b7){return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x1bc26d[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x28b925,null))[_0x90d5('0x27')](function(_0x345469){if(_0x345469){return _0x345469[_0x90d5('0x54')](_0x1bc26d[_0x90d5('0x31')]['ids']);}})[_0x90d5('0x27')](respondWithStatusCode(_0x28b925,null))[_0x90d5('0x40')](handleError(_0x28b925,null));};exports[_0x90d5('0x55')]=function(_0x3999da,_0x196ed5,_0x3e82ed){if(_0x3999da[_0x90d5('0x48')]['id']){delete _0x3999da[_0x90d5('0x48')]['id'];}return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x3999da[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x196ed5,null))[_0x90d5('0x27')](function(_0x258c3c){if(_0x258c3c){_0x3999da[_0x90d5('0x48')][_0x90d5('0x56')]=_0x258c3c['id'];return db[_0x90d5('0x4c')][_0x90d5('0x47')](_0x3999da[_0x90d5('0x48')]);}})['then'](respondWithResult(_0x196ed5,null))[_0x90d5('0x40')](handleError(_0x196ed5,null));};exports[_0x90d5('0x57')]=function(_0x4ab99c,_0x3249dd,_0xebfbf9){var _0x409917={};var _0x59faf8={};var _0x3f930e;var _0x1f7efe;return db['ChatGroup'][_0x90d5('0x58')]({'where':{'id':_0x4ab99c[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x3249dd,null))[_0x90d5('0x27')](function(_0x48e524){if(_0x48e524){_0x3f930e=_0x48e524;_0x59faf8[_0x90d5('0x33')]=_[_0x90d5('0x42')](db['ChatInternalMessage'][_0x90d5('0x2e')]);_0x59faf8[_0x90d5('0x31')]=_[_0x90d5('0x42')](_0x4ab99c[_0x90d5('0x31')]);_0x59faf8[_0x90d5('0x32')]=_[_0x90d5('0x34')](_0x59faf8[_0x90d5('0x33')],_0x59faf8[_0x90d5('0x31')]);_0x409917['attributes']=_[_0x90d5('0x34')](_0x59faf8['model'],qs[_0x90d5('0x35')](_0x4ab99c[_0x90d5('0x31')]['fields']));_0x409917[_0x90d5('0x43')]=_0x409917[_0x90d5('0x43')][_0x90d5('0x44')]?_0x409917[_0x90d5('0x43')]:_0x59faf8['model'];_0x409917['order']=qs[_0x90d5('0x39')](_0x4ab99c[_0x90d5('0x31')]['sort']);_0x409917[_0x90d5('0x3a')]=qs[_0x90d5('0x32')](_['pick'](_0x4ab99c['query'],_0x59faf8[_0x90d5('0x32')]));if(_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x3c')]){_0x409917[_0x90d5('0x3a')]=_[_0x90d5('0x3d')](_0x409917[_0x90d5('0x3a')],{'$or':_['map'](_0x409917['attributes'],function(_0x4ad79b){var _0x5432d6={};_0x5432d6[_0x4ad79b]={'$like':'%'+_0x4ab99c[_0x90d5('0x31')]['filter']+'%'};return _0x5432d6;})});}if(_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x59')]){var _0x54aa84=_0x4ab99c['query'][_0x90d5('0x59')][_0x90d5('0x5a')](',');var _0x32ea3e={};_0x32ea3e[_0x54aa84[0x0]]={'$gte':moment(_0x54aa84[0x1])[_0x90d5('0x5b')](_0x90d5('0x5c'))};_0x409917['where']=_[_0x90d5('0x3d')](_0x409917[_0x90d5('0x3a')],_0x32ea3e);}_0x409917=_[_0x90d5('0x3d')]({},_0x409917,_0x4ab99c[_0x90d5('0x3e')]);return _0x3f930e['getMessages'](_0x409917);}})['then'](function(_0x5ab560){if(_0x5ab560){_0x1f7efe=_0x5ab560['length'];if(!_0x4ab99c['query'][_0x90d5('0x36')](_0x90d5('0x37'))){_0x409917[_0x90d5('0x21')]=qs[_0x90d5('0x21')](_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x21')]);_0x409917['offset']=qs[_0x90d5('0x1f')](_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x1f')]);}return _0x3f930e[_0x90d5('0x57')](_0x409917);}})[_0x90d5('0x27')](function(_0x104688){if(_0x104688){return _0x104688?{'count':_0x1f7efe,'rows':_0x104688}:null;}})[_0x90d5('0x27')](respondWithResult(_0x3249dd,null))['catch'](handleError(_0x3249dd,null));};
\ No newline at end of file
+var _0xe8fc=['filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xe8fc,0x149));var _0xce8f=function(_0x35d5ef,_0xf5d87d){_0x35d5ef=_0x35d5ef-0x0;var _0x40356f=_0xe8fc[_0x35d5ef];return _0x40356f;};'use strict';var emlformat=require(_0xce8f('0x0'));var rimraf=require(_0xce8f('0x1'));var zipdir=require(_0xce8f('0x2'));var jsonpatch=require(_0xce8f('0x3'));var rp=require('request-promise');var moment=require(_0xce8f('0x4'));var BPromise=require(_0xce8f('0x5'));var Mustache=require(_0xce8f('0x6'));var util=require(_0xce8f('0x7'));var path=require(_0xce8f('0x8'));var sox=require(_0xce8f('0x9'));var csv=require(_0xce8f('0xa'));var ejs=require(_0xce8f('0xb'));var fs=require('fs');var fs_extra=require(_0xce8f('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xce8f('0xd'));var jsforce=require(_0xce8f('0xe'));var deskjs=require(_0xce8f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xce8f('0x10'));var Papa=require(_0xce8f('0x11'));var Redis=require(_0xce8f('0x12'));var authService=require(_0xce8f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xce8f('0x14'));var hardwareService=require(_0xce8f('0x15'));var logger=require(_0xce8f('0x16'))(_0xce8f('0x17'));var utils=require('../../config/utils');var config=require(_0xce8f('0x18'));var licenseUtil=require(_0xce8f('0x19'));var db=require(_0xce8f('0x1a'))['db'];config[_0xce8f('0x1b')]=_['defaults'](config[_0xce8f('0x1b')],{'host':_0xce8f('0x1c'),'port':0x18eb});var socket=require(_0xce8f('0x1d'))(new Redis(config[_0xce8f('0x1b')]));require(_0xce8f('0x1e'))[_0xce8f('0x1f')](socket);function respondWithStatusCode(_0x1e536e,_0x453e76){_0x453e76=_0x453e76||0xcc;return function(_0x34b16d){if(_0x34b16d){return _0x1e536e[_0xce8f('0x20')](_0x453e76);}return _0x1e536e[_0xce8f('0x21')](_0x453e76)['end']();};}function respondWithResult(_0x2055d8,_0x20c6c7){_0x20c6c7=_0x20c6c7||0xc8;return function(_0x21d085){if(_0x21d085){return _0x2055d8['status'](_0x20c6c7)[_0xce8f('0x22')](_0x21d085);}};}function respondWithFilteredResult(_0x482f41,_0x80e18a){return function(_0x58a219){if(_0x58a219){var _0x27fbb7=typeof _0x80e18a[_0xce8f('0x23')]===_0xce8f('0x24')&&typeof _0x80e18a[_0xce8f('0x25')]===_0xce8f('0x24');var _0x1631bb=_0x58a219[_0xce8f('0x26')];var _0x125c21=_0x27fbb7?0x0:_0x80e18a['offset'];var _0x38e38f=_0x27fbb7?_0x58a219[_0xce8f('0x26')]:_0x80e18a['offset']+_0x80e18a[_0xce8f('0x25')];var _0x19ca18;if(_0x38e38f>=_0x1631bb){_0x38e38f=_0x1631bb;_0x19ca18=0xc8;}else{_0x19ca18=0xce;}_0x482f41[_0xce8f('0x21')](_0x19ca18);return _0x482f41[_0xce8f('0x27')]('Content-Range',_0x125c21+'-'+_0x38e38f+'/'+_0x1631bb)[_0xce8f('0x22')](_0x58a219);}return null;};}function patchUpdates(_0x4cf30b){return function(_0x22113c){try{jsonpatch[_0xce8f('0x28')](_0x22113c,_0x4cf30b,!![]);}catch(_0x41a7df){return BPromise[_0xce8f('0x29')](_0x41a7df);}return _0x22113c[_0xce8f('0x2a')]();};}function saveUpdates(_0x503742,_0x539da4){return function(_0x59474a){if(_0x59474a){return _0x59474a[_0xce8f('0x2b')](_0x503742)['then'](function(_0x384a6f){return _0x384a6f;});}return null;};}function removeEntity(_0x2dd00a,_0x5a24e5){return function(_0x48207d){if(_0x48207d){return _0x48207d[_0xce8f('0x2c')]()[_0xce8f('0x2d')](function(){_0x2dd00a[_0xce8f('0x21')](0xcc)[_0xce8f('0x2e')]();});}};}function handleEntityNotFound(_0x70b22c,_0x1c34ba){return function(_0x2e2940){if(!_0x2e2940){_0x70b22c[_0xce8f('0x20')](0x194);}return _0x2e2940;};}function handleError(_0x4cfb2d,_0x5be323){_0x5be323=_0x5be323||0x1f4;return function(_0x1df531){logger['error'](_0x1df531[_0xce8f('0x2f')]);if(_0x1df531[_0xce8f('0x30')]){delete _0x1df531[_0xce8f('0x30')];}_0x4cfb2d[_0xce8f('0x21')](_0x5be323)[_0xce8f('0x31')](_0x1df531);};}exports[_0xce8f('0x32')]=function(_0x4ae044,_0xf228e8){var _0x39c8ae={},_0x44779d={},_0x272916={'count':0x0,'rows':[]};var _0x128e23=_[_0xce8f('0x33')](db['ChatGroup'][_0xce8f('0x34')],function(_0x354b14){return{'name':_0x354b14['fieldName'],'type':_0x354b14[_0xce8f('0x35')]['key']};});_0x44779d[_0xce8f('0x36')]=_[_0xce8f('0x33')](_0x128e23,'name');_0x44779d[_0xce8f('0x37')]=_[_0xce8f('0x38')](_0x4ae044[_0xce8f('0x37')]);_0x44779d[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0x44779d[_0xce8f('0x36')],_0x44779d['query']);_0x39c8ae[_0xce8f('0x3b')]=_[_0xce8f('0x3a')](_0x44779d['model'],qs[_0xce8f('0x3c')](_0x4ae044[_0xce8f('0x37')][_0xce8f('0x3c')]));_0x39c8ae['attributes']=_0x39c8ae[_0xce8f('0x3b')][_0xce8f('0x3d')]?_0x39c8ae[_0xce8f('0x3b')]:_0x44779d[_0xce8f('0x36')];if(!_0x4ae044[_0xce8f('0x37')]['hasOwnProperty'](_0xce8f('0x3e'))){_0x39c8ae[_0xce8f('0x25')]=qs[_0xce8f('0x25')](_0x4ae044[_0xce8f('0x37')][_0xce8f('0x25')]);_0x39c8ae[_0xce8f('0x23')]=qs[_0xce8f('0x23')](_0x4ae044[_0xce8f('0x37')]['offset']);}_0x39c8ae[_0xce8f('0x3f')]=qs[_0xce8f('0x40')](_0x4ae044[_0xce8f('0x37')][_0xce8f('0x40')]);_0x39c8ae[_0xce8f('0x41')]=qs[_0xce8f('0x39')](_[_0xce8f('0x42')](_0x4ae044[_0xce8f('0x37')],_0x44779d[_0xce8f('0x39')]),_0x128e23);if(_0x4ae044['query'][_0xce8f('0x43')]){_0x39c8ae[_0xce8f('0x41')]=_[_0xce8f('0x44')](_0x39c8ae[_0xce8f('0x41')],{'$or':_['map'](_0x128e23,function(_0x46f987){if(_0x46f987['type']!==_0xce8f('0x45')){var _0x541e51={};_0x541e51[_0x46f987[_0xce8f('0x30')]]={'$like':'%'+_0x4ae044[_0xce8f('0x37')][_0xce8f('0x43')]+'%'};return _0x541e51;}})});}_0x39c8ae=_['merge']({},_0x39c8ae,_0x4ae044[_0xce8f('0x46')]);var _0x50af6b={'where':_0x39c8ae['where']};return db[_0xce8f('0x47')][_0xce8f('0x26')](_0x50af6b)[_0xce8f('0x2d')](function(_0x51510a){_0x272916[_0xce8f('0x26')]=_0x51510a;if(_0x4ae044[_0xce8f('0x37')][_0xce8f('0x48')]){_0x39c8ae[_0xce8f('0x49')]=[{'all':!![]}];}return db[_0xce8f('0x47')][_0xce8f('0x4a')](_0x39c8ae);})[_0xce8f('0x2d')](function(_0x24d37a){_0x272916[_0xce8f('0x4b')]=_0x24d37a;return _0x272916;})[_0xce8f('0x2d')](respondWithFilteredResult(_0xf228e8,_0x39c8ae))['catch'](handleError(_0xf228e8,null));};exports[_0xce8f('0x4c')]=function(_0x39a1a3,_0x2522f8){var _0x55e594={'raw':!![],'where':{'id':_0x39a1a3[_0xce8f('0x4d')]['id']}},_0xc2707d={};_0xc2707d['model']=_[_0xce8f('0x38')](db['ChatGroup'][_0xce8f('0x34')]);_0xc2707d[_0xce8f('0x37')]=_['keys'](_0x39a1a3[_0xce8f('0x37')]);_0xc2707d[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0xc2707d[_0xce8f('0x36')],_0xc2707d[_0xce8f('0x37')]);_0x55e594[_0xce8f('0x3b')]=_['intersection'](_0xc2707d[_0xce8f('0x36')],qs[_0xce8f('0x3c')](_0x39a1a3['query']['fields']));_0x55e594[_0xce8f('0x3b')]=_0x55e594[_0xce8f('0x3b')][_0xce8f('0x3d')]?_0x55e594[_0xce8f('0x3b')]:_0xc2707d[_0xce8f('0x36')];if(_0x39a1a3[_0xce8f('0x37')]['includeAll']){_0x55e594['include']=[{'all':!![]}];}_0x55e594=_[_0xce8f('0x44')]({},_0x55e594,_0x39a1a3[_0xce8f('0x46')]);return db['ChatGroup'][_0xce8f('0x4e')](_0x55e594)[_0xce8f('0x2d')](handleEntityNotFound(_0x2522f8,null))[_0xce8f('0x2d')](respondWithResult(_0x2522f8,null))['catch'](handleError(_0x2522f8,null));};exports[_0xce8f('0x4f')]=function(_0x8bb87,_0x3f8691){return db[_0xce8f('0x47')][_0xce8f('0x4f')](_0x8bb87[_0xce8f('0x50')],{})['then'](respondWithResult(_0x3f8691,0xc9))[_0xce8f('0x51')](handleError(_0x3f8691,null));};exports['update']=function(_0x56e9db,_0xcb9d89){if(_0x56e9db['body']['id']){delete _0x56e9db['body']['id'];}return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0x56e9db[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0xcb9d89,null))[_0xce8f('0x2d')](saveUpdates(_0x56e9db[_0xce8f('0x50')],null))[_0xce8f('0x2d')](respondWithResult(_0xcb9d89,null))[_0xce8f('0x51')](handleError(_0xcb9d89,null));};exports[_0xce8f('0x2c')]=function(_0x5085c5,_0x32fc10){return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0x5085c5[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x32fc10,null))['then'](removeEntity(_0x32fc10,null))['catch'](handleError(_0x32fc10,null));};exports[_0xce8f('0x52')]=function(_0xb12016,_0x187453){return db[_0xce8f('0x47')][_0xce8f('0x52')]()[_0xce8f('0x2d')](respondWithResult(_0x187453,null))[_0xce8f('0x51')](handleError(_0x187453,null));};exports[_0xce8f('0x53')]=function(_0xa67632,_0x23b7a3,_0x3d87ac){return db[_0xce8f('0x54')]['count']({'where':{'ChatGroupId':_0xa67632['params']['id'],'ToId':_0xa67632[_0xce8f('0x55')]['id'],'read':![]}})[_0xce8f('0x2d')](function(_0x3926f9){return{'id':_[_0xce8f('0x56')](_0xa67632['params']['id']),'count':_0x3926f9};})[_0xce8f('0x2d')](respondWithResult(_0x23b7a3,null))[_0xce8f('0x51')](handleError(_0x23b7a3,null));};exports[_0xce8f('0x57')]=function(_0xdf1b63,_0x5d4254,_0x20e3f9){return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0xdf1b63[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x5d4254,null))[_0xce8f('0x2d')](function(_0x29c876){if(_0x29c876){return _0x29c876[_0xce8f('0x57')](_0xdf1b63['body'][_0xce8f('0x58')],_['omit'](_0xdf1b63[_0xce8f('0x50')],[_0xce8f('0x58'),'id'])||{});}})['then'](respondWithResult(_0x5d4254,null))[_0xce8f('0x51')](handleError(_0x5d4254,null));};exports[_0xce8f('0x59')]=function(_0x2a55da,_0x1acab4,_0x52a4c4){var _0x48deea={};var _0x4353e2={};var _0x10d14a;var _0x2e3a86;return db[_0xce8f('0x47')][_0xce8f('0x5a')]({'where':{'id':_0x2a55da[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x1acab4,null))['then'](function(_0x50a268){if(_0x50a268){_0x10d14a=_0x50a268;_0x4353e2[_0xce8f('0x36')]=_[_0xce8f('0x38')](db[_0xce8f('0x5b')][_0xce8f('0x34')]);_0x4353e2[_0xce8f('0x37')]=_[_0xce8f('0x38')](_0x2a55da[_0xce8f('0x37')]);_0x4353e2[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0x4353e2[_0xce8f('0x36')],_0x4353e2['query']);_0x48deea[_0xce8f('0x3b')]=_[_0xce8f('0x3a')](_0x4353e2[_0xce8f('0x36')],qs[_0xce8f('0x3c')](_0x2a55da['query'][_0xce8f('0x3c')]));_0x48deea[_0xce8f('0x3b')]=_0x48deea[_0xce8f('0x3b')][_0xce8f('0x3d')]?_0x48deea[_0xce8f('0x3b')]:_0x4353e2[_0xce8f('0x36')];_0x48deea[_0xce8f('0x3f')]=qs[_0xce8f('0x40')](_0x2a55da['query']['sort']);_0x48deea[_0xce8f('0x41')]=qs[_0xce8f('0x39')](_[_0xce8f('0x42')](_0x2a55da['query'],_0x4353e2[_0xce8f('0x39')]));if(_0x2a55da['query']['filter']){_0x48deea[_0xce8f('0x41')]=_[_0xce8f('0x44')](_0x48deea['where'],{'$or':_[_0xce8f('0x33')](_0x48deea['attributes'],function(_0x2078d9){var _0x4ddd52={};_0x4ddd52[_0x2078d9]={'$like':'%'+_0x2a55da[_0xce8f('0x37')][_0xce8f('0x43')]+'%'};return _0x4ddd52;})});}_0x48deea=_[_0xce8f('0x44')]({},_0x48deea,_0x2a55da[_0xce8f('0x46')]);return _0x10d14a[_0xce8f('0x59')](_0x48deea);}})['then'](function(_0x424136){if(_0x424136){_0x2e3a86=_0x424136[_0xce8f('0x3d')];if(!_0x2a55da['query']['hasOwnProperty']('nolimit')){_0x48deea['limit']=qs[_0xce8f('0x25')](_0x2a55da[_0xce8f('0x37')][_0xce8f('0x25')]);_0x48deea[_0xce8f('0x23')]=qs[_0xce8f('0x23')](_0x2a55da['query'][_0xce8f('0x23')]);}return _0x10d14a[_0xce8f('0x59')](_0x48deea);}})[_0xce8f('0x2d')](function(_0x8f90a7){if(_0x8f90a7){return _0x8f90a7?{'count':_0x2e3a86,'rows':_0x8f90a7}:null;}})['then'](respondWithResult(_0x1acab4,null))[_0xce8f('0x51')](handleError(_0x1acab4,null));};exports[_0xce8f('0x5c')]=function(_0x102448,_0x58cb40,_0x4c3d92){return db[_0xce8f('0x47')]['find']({'where':{'id':_0x102448[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x58cb40,null))['then'](function(_0x1c59bd){if(_0x1c59bd){return _0x1c59bd[_0xce8f('0x5c')](_0x102448[_0xce8f('0x37')][_0xce8f('0x58')]);}})[_0xce8f('0x2d')](respondWithStatusCode(_0x58cb40,null))[_0xce8f('0x51')](handleError(_0x58cb40,null));};exports['addMessage']=function(_0x1846d3,_0x176259,_0x4939e3){if(_0x1846d3[_0xce8f('0x50')]['id']){delete _0x1846d3[_0xce8f('0x50')]['id'];}return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0x1846d3[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x176259,null))[_0xce8f('0x2d')](function(_0x176512){if(_0x176512){_0x1846d3[_0xce8f('0x50')]['ChatGroupId']=_0x176512['id'];return db[_0xce8f('0x54')][_0xce8f('0x4f')](_0x1846d3[_0xce8f('0x50')]);}})[_0xce8f('0x2d')](respondWithResult(_0x176259,null))['catch'](handleError(_0x176259,null));};exports[_0xce8f('0x5d')]=function(_0x13d463,_0x9faf13,_0x4fb3af){var _0x100b2f={};var _0xc1bd60={};var _0x5777ba;var _0x17c9ca;return db[_0xce8f('0x47')][_0xce8f('0x5a')]({'where':{'id':_0x13d463[_0xce8f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x9faf13,null))[_0xce8f('0x2d')](function(_0x1f2039){if(_0x1f2039){_0x5777ba=_0x1f2039;_0xc1bd60[_0xce8f('0x36')]=_[_0xce8f('0x38')](db[_0xce8f('0x54')][_0xce8f('0x34')]);_0xc1bd60[_0xce8f('0x37')]=_['keys'](_0x13d463[_0xce8f('0x37')]);_0xc1bd60[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0xc1bd60['model'],_0xc1bd60[_0xce8f('0x37')]);_0x100b2f[_0xce8f('0x3b')]=_[_0xce8f('0x3a')](_0xc1bd60[_0xce8f('0x36')],qs[_0xce8f('0x3c')](_0x13d463[_0xce8f('0x37')][_0xce8f('0x3c')]));_0x100b2f[_0xce8f('0x3b')]=_0x100b2f[_0xce8f('0x3b')]['length']?_0x100b2f['attributes']:_0xc1bd60[_0xce8f('0x36')];_0x100b2f['order']=qs[_0xce8f('0x40')](_0x13d463[_0xce8f('0x37')][_0xce8f('0x40')]);_0x100b2f[_0xce8f('0x41')]=qs[_0xce8f('0x39')](_[_0xce8f('0x42')](_0x13d463[_0xce8f('0x37')],_0xc1bd60[_0xce8f('0x39')]));if(_0x13d463[_0xce8f('0x37')][_0xce8f('0x43')]){_0x100b2f[_0xce8f('0x41')]=_[_0xce8f('0x44')](_0x100b2f[_0xce8f('0x41')],{'$or':_['map'](_0x100b2f[_0xce8f('0x3b')],function(_0x5e97eb){var _0x4c817c={};_0x4c817c[_0x5e97eb]={'$like':'%'+_0x13d463[_0xce8f('0x37')][_0xce8f('0x43')]+'%'};return _0x4c817c;})});}if(_0x13d463[_0xce8f('0x37')][_0xce8f('0x5e')]){var _0x5717f6=_0x13d463[_0xce8f('0x37')][_0xce8f('0x5e')][_0xce8f('0x5f')](',');var _0x57459a={};_0x57459a[_0x5717f6[0x0]]={'$gte':moment(_0x5717f6[0x1])[_0xce8f('0x60')](_0xce8f('0x61'))};_0x100b2f['where']=_[_0xce8f('0x44')](_0x100b2f[_0xce8f('0x41')],_0x57459a);}_0x100b2f=_[_0xce8f('0x44')]({},_0x100b2f,_0x13d463[_0xce8f('0x46')]);return _0x5777ba[_0xce8f('0x5d')](_0x100b2f);}})[_0xce8f('0x2d')](function(_0x3c3188){if(_0x3c3188){_0x17c9ca=_0x3c3188['length'];if(!_0x13d463[_0xce8f('0x37')][_0xce8f('0x62')](_0xce8f('0x3e'))){_0x100b2f[_0xce8f('0x25')]=qs[_0xce8f('0x25')](_0x13d463['query']['limit']);_0x100b2f[_0xce8f('0x23')]=qs['offset'](_0x13d463[_0xce8f('0x37')][_0xce8f('0x23')]);}return _0x5777ba[_0xce8f('0x5d')](_0x100b2f);}})[_0xce8f('0x2d')](function(_0x26a434){if(_0x26a434){return _0x26a434?{'count':_0x17c9ca,'rows':_0x26a434}:null;}})[_0xce8f('0x2d')](respondWithResult(_0x9faf13,null))[_0xce8f('0x51')](handleError(_0x9faf13,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 2af53c5..c2391f9 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 _0x340b=['setMaxListeners','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x8727fd,_0xdd4faa){var _0x1a3588=function(_0x5a514c){while(--_0x5a514c){_0x8727fd['push'](_0x8727fd['shift']());}};_0x1a3588(++_0xdd4faa);}(_0x340b,0x1b6));var _0xb340=function(_0x3c6f22,_0x4618d4){_0x3c6f22=_0x3c6f22-0x0;var _0x5dc5be=_0x340b[_0x3c6f22];return _0x5dc5be;};'use strict';var EventEmitter=require(_0xb340('0x0'));var ChatGroup=require(_0xb340('0x1'))['db'][_0xb340('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xb340('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5d2004){return function(_0x4a0526,_0x25a9b4,_0x1a7822){ChatGroupEvents[_0xb340('0x4')](_0x5d2004+':'+_0x4a0526['id'],_0x4a0526);ChatGroupEvents['emit'](_0x5d2004,_0x4a0526);_0x1a7822(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xb340('0x5')](e,emitEvent(event));}}module[_0xb340('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0xaecc=['events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0xaecc,0x172));var _0xcaec=function(_0x3e1415,_0x2ad5ee){_0x3e1415=_0x3e1415-0x0;var _0x2e1ec7=_0xaecc[_0x3e1415];return _0x2e1ec7;};'use strict';var EventEmitter=require(_0xcaec('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcaec('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcaec('0x2')](0x0);var events={'afterCreate':_0xcaec('0x3'),'afterUpdate':_0xcaec('0x4'),'afterDestroy':_0xcaec('0x5')};function emitEvent(_0x1b7339){return function(_0x1de6a3,_0x5ab26c,_0x366499){ChatGroupEvents[_0xcaec('0x6')](_0x1b7339+':'+_0x1de6a3['id'],_0x1de6a3);ChatGroupEvents[_0xcaec('0x6')](_0x1b7339,_0x1de6a3);_0x366499(null);};}for(var e in events){if(events[_0xcaec('0x7')](e)){var event=events[e];ChatGroup[_0xcaec('0x8')](e,emitEvent(event));}}module[_0xcaec('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 6a5651f..45e9076 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 _0xe18b=['ChatGroup','chat_groups','lodash','util','api','moment','request-promise','path','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe18b,0x1a6));var _0xbe18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbe18('0x0'));var util=require(_0xbe18('0x1'));var logger=require('../../config/logger')(_0xbe18('0x2'));var moment=require(_0xbe18('0x3'));var BPromise=require('bluebird');var rp=require(_0xbe18('0x4'));var fs=require('fs');var path=require(_0xbe18('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xbe18('0x6')]=function(_0x684159,_0x165d09){return _0x684159[_0xbe18('0x7')](_0xbe18('0x8'),attributes,{'tableName':_0xbe18('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9281=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup'];(function(_0x5820df,_0x24240a){var _0x7a47f1=function(_0x37410b){while(--_0x37410b){_0x5820df['push'](_0x5820df['shift']());}};_0x7a47f1(++_0x24240a);}(_0x9281,0x16b));var _0x1928=function(_0x11666c,_0x2544ad){_0x11666c=_0x11666c-0x0;var _0x4554a5=_0x9281[_0x11666c];return _0x4554a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1928('0x0'))(_0x1928('0x1'));var moment=require(_0x1928('0x2'));var BPromise=require(_0x1928('0x3'));var rp=require(_0x1928('0x4'));var fs=require('fs');var path=require(_0x1928('0x5'));var rimraf=require(_0x1928('0x6'));var config=require(_0x1928('0x7'));var attributes=require(_0x1928('0x8'));module[_0x1928('0x9')]=function(_0x3cd495,_0x58972c){return _0x3cd495['define'](_0x1928('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 4dd749e..46f871e 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 _0xbdba=['redis','defaults','socket.io-emitter','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x47604d,_0x15a014){var _0x388e4c=function(_0x42a446){while(--_0x42a446){_0x47604d['push'](_0x47604d['shift']());}};_0x388e4c(++_0x15a014);}(_0xbdba,0x107));var _0xabdb=function(_0x732d54,_0x5708f4){_0x732d54=_0x732d54-0x0;var _0x55e766=_0xbdba[_0x732d54];return _0x55e766;};'use strict';var _=require(_0xabdb('0x0'));var util=require('util');var moment=require(_0xabdb('0x1'));var BPromise=require(_0xabdb('0x2'));var rs=require(_0xabdb('0x3'));var fs=require('fs');var Redis=require(_0xabdb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xabdb('0x5'));var logger=require(_0xabdb('0x6'))('rpc');var config=require(_0xabdb('0x7'));var jayson=require(_0xabdb('0x8'));var client=jayson[_0xabdb('0x9')]['http']({'port':0x232a});config[_0xabdb('0xa')]=_[_0xabdb('0xb')](config[_0xabdb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xabdb('0xc'))(new Redis(config[_0xabdb('0xa')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x31227e,_0x4c0c1d,_0x418d19){return new BPromise(function(_0x365c4d,_0x5a258e){return client['request'](_0x31227e,_0x418d19)['then'](function(_0x163861){logger[_0xabdb('0xd')](_0xabdb('0xe'),_0x4c0c1d,_0xabdb('0xf'));logger[_0xabdb('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4c0c1d,_0xabdb('0xf'),JSON[_0xabdb('0x11')](_0x163861));if(_0x163861[_0xabdb('0x12')]){if(_0x163861[_0xabdb('0x12')]['code']===0x1f4){logger[_0xabdb('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4c0c1d,_0x163861[_0xabdb('0x12')]['message']);return _0x5a258e(_0x163861[_0xabdb('0x12')][_0xabdb('0x13')]);}logger[_0xabdb('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4c0c1d,_0x163861['error'][_0xabdb('0x13')]);return _0x365c4d(_0x163861[_0xabdb('0x12')][_0xabdb('0x13')]);}else{logger[_0xabdb('0xd')]('ChatGroup,\x20%s,\x20%s',_0x4c0c1d,'request\x20sent');_0x365c4d(_0x163861['result']['message']);}})[_0xabdb('0x14')](function(_0x3ec1a){logger[_0xabdb('0x12')](_0xabdb('0xe'),_0x4c0c1d,_0x3ec1a);_0x5a258e(_0x3ec1a);});});}
\ No newline at end of file
+var _0x39b3=['register','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x39b3,0xc9));var _0x339b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x39b3[_0x432682];return _0x463d05;};'use strict';var _=require(_0x339b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x339b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x339b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x339b('0x3'));var logger=require(_0x339b('0x4'))(_0x339b('0x5'));var config=require(_0x339b('0x6'));var jayson=require(_0x339b('0x7'));var client=jayson[_0x339b('0x8')][_0x339b('0x9')]({'port':0x232a});config[_0x339b('0xa')]=_[_0x339b('0xb')](config[_0x339b('0xa')],{'host':_0x339b('0xc'),'port':0x18eb});var socket=require(_0x339b('0xd'))(new Redis(config[_0x339b('0xa')]));require(_0x339b('0xe'))[_0x339b('0xf')](socket);function respondWithRpcPromise(_0x3ce735,_0x2d37e6,_0x4a06ed){return new BPromise(function(_0x640d55,_0xd34d62){return client['request'](_0x3ce735,_0x4a06ed)['then'](function(_0x58cade){logger['info'](_0x339b('0x10'),_0x2d37e6,_0x339b('0x11'));logger[_0x339b('0x12')](_0x339b('0x13'),_0x2d37e6,'request\x20sent',JSON[_0x339b('0x14')](_0x58cade));if(_0x58cade[_0x339b('0x15')]){if(_0x58cade[_0x339b('0x15')][_0x339b('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x2d37e6,_0x58cade['error'][_0x339b('0x17')]);return _0xd34d62(_0x58cade[_0x339b('0x15')]['message']);}logger[_0x339b('0x15')]('ChatGroup,\x20%s,\x20%s',_0x2d37e6,_0x58cade['error'][_0x339b('0x17')]);return _0x640d55(_0x58cade[_0x339b('0x15')][_0x339b('0x17')]);}else{logger[_0x339b('0x18')](_0x339b('0x10'),_0x2d37e6,'request\x20sent');_0x640d55(_0x58cade[_0x339b('0x19')][_0x339b('0x17')]);}})[_0x339b('0x1a')](function(_0x7872a3){logger[_0x339b('0x15')]('ChatGroup,\x20%s,\x20%s',_0x2d37e6,_0x7872a3);_0xd34d62(_0x7872a3);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 73dd5d4..ee6ce2d 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 _0xcc51=['length','chatGroup:','save','remove','update','emit','removeListener','register'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xcc51,0xea));var _0x1cc5=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xcc51[_0xd1d19a];return _0x52a79d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x1cc5('0x0'),_0x1cc5('0x1'),_0x1cc5('0x2')];function createListener(_0x242c0d,_0x104e14){return function(_0x275837){_0x104e14[_0x1cc5('0x3')](_0x242c0d,_0x275837);};}function removeListener(_0x52153e,_0x18ab2a){return function(){ChatGroupEvents[_0x1cc5('0x4')](_0x52153e,_0x18ab2a);};}exports[_0x1cc5('0x5')]=function(_0x25d870){for(var _0x5d32ad=0x0,_0x551dab=events[_0x1cc5('0x6')];_0x5d32ad<_0x551dab;_0x5d32ad++){var _0x5efc9b=events[_0x5d32ad];var _0x351bfd=createListener(_0x1cc5('0x7')+_0x5efc9b,_0x25d870);ChatGroupEvents['on'](_0x5efc9b,_0x351bfd);}};
\ No newline at end of file
+var _0x9bfa=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x30fae7,_0x562858){var _0x1dbd52=function(_0x4d8c5e){while(--_0x4d8c5e){_0x30fae7['push'](_0x30fae7['shift']());}};_0x1dbd52(++_0x562858);}(_0x9bfa,0xee));var _0xa9bf=function(_0x38825f,_0x5155b4){_0x38825f=_0x38825f-0x0;var _0x364716=_0x9bfa[_0x38825f];return _0x364716;};'use strict';var ChatGroupEvents=require(_0xa9bf('0x0'));var events=[_0xa9bf('0x1'),_0xa9bf('0x2'),_0xa9bf('0x3')];function createListener(_0x47804e,_0x5865f4){return function(_0x2c5730){_0x5865f4[_0xa9bf('0x4')](_0x47804e,_0x2c5730);};}function removeListener(_0x29c7c8,_0x5a82cc){return function(){ChatGroupEvents[_0xa9bf('0x5')](_0x29c7c8,_0x5a82cc);};}exports[_0xa9bf('0x6')]=function(_0x2e9875){for(var _0x11e713=0x0,_0x25a80d=events[_0xa9bf('0x7')];_0x11e713<_0x25a80d;_0x11e713++){var _0x288721=events[_0x11e713];var _0x38307b=createListener(_0xa9bf('0x8')+_0x288721,_0x2e9875);ChatGroupEvents['on'](_0x288721,_0x38307b);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 1a87b22..8e75fb0 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 _0x14ae=['show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','index','get','isAuthenticated','describe','/:id'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x14ae,0x152));var _0xe14a=function(_0x531da8,_0x1e61b1){_0x531da8=_0x531da8-0x0;var _0x3901a0=_0x14ae[_0x531da8];return _0x3901a0;};'use strict';var multer=require(_0xe14a('0x0'));var util=require(_0xe14a('0x1'));var path=require(_0xe14a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe14a('0x3'));var router=express[_0xe14a('0x4')]();var fs_extra=require(_0xe14a('0x5'));var auth=require(_0xe14a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe14a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe14a('0x8')]);router[_0xe14a('0x9')]('/describe',auth[_0xe14a('0xa')](),controller[_0xe14a('0xb')]);router[_0xe14a('0x9')](_0xe14a('0xc'),auth[_0xe14a('0xa')](),controller[_0xe14a('0xd')]);router[_0xe14a('0x9')](_0xe14a('0xe'),auth[_0xe14a('0xa')](),controller[_0xe14a('0xf')]);router['get'](_0xe14a('0x10'),auth[_0xe14a('0xa')](),controller['getMembers']);router[_0xe14a('0x9')](_0xe14a('0x11'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x12')]);router['post']('/',auth[_0xe14a('0xa')](),controller[_0xe14a('0x13')]);router[_0xe14a('0x14')](_0xe14a('0x10'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x15')]);router[_0xe14a('0x14')](_0xe14a('0x11'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x16')]);router[_0xe14a('0x17')](_0xe14a('0xc'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x18')]);router[_0xe14a('0x19')]('/:id',auth[_0xe14a('0xa')](),controller[_0xe14a('0x1a')]);router[_0xe14a('0x19')](_0xe14a('0x10'),auth[_0xe14a('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x652a=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','delete','destroy','removeMembers'];(function(_0x194d03,_0x34be64){var _0x14c9d5=function(_0x53a69b){while(--_0x53a69b){_0x194d03['push'](_0x194d03['shift']());}};_0x14c9d5(++_0x34be64);}(_0x652a,0x175));var _0xa652=function(_0x560788,_0x13d82a){_0x560788=_0x560788-0x0;var _0x4aa652=_0x652a[_0x560788];return _0x4aa652;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa652('0x0'));var timeout=require(_0xa652('0x1'));var express=require(_0xa652('0x2'));var router=express[_0xa652('0x3')]();var fs_extra=require(_0xa652('0x4'));var auth=require(_0xa652('0x5'));var interaction=require(_0xa652('0x6'));var config=require(_0xa652('0x7'));var controller=require(_0xa652('0x8'));router[_0xa652('0x9')]('/',auth['isAuthenticated'](),controller[_0xa652('0xa')]);router[_0xa652('0x9')](_0xa652('0xb'),auth[_0xa652('0xc')](),controller[_0xa652('0xd')]);router[_0xa652('0x9')]('/:id',auth[_0xa652('0xc')](),controller[_0xa652('0xe')]);router[_0xa652('0x9')](_0xa652('0xf'),auth[_0xa652('0xc')](),controller[_0xa652('0x10')]);router[_0xa652('0x9')](_0xa652('0x11'),auth[_0xa652('0xc')](),controller[_0xa652('0x12')]);router[_0xa652('0x9')](_0xa652('0x13'),auth[_0xa652('0xc')](),controller[_0xa652('0x14')]);router[_0xa652('0x15')]('/',auth[_0xa652('0xc')](),controller[_0xa652('0x16')]);router[_0xa652('0x15')](_0xa652('0x11'),auth[_0xa652('0xc')](),controller[_0xa652('0x17')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xa652('0x18')]);router[_0xa652('0x19')](_0xa652('0x1a'),auth[_0xa652('0xc')](),controller['update']);router[_0xa652('0x1b')]('/:id',auth[_0xa652('0xc')](),controller[_0xa652('0x1c')]);router[_0xa652('0x1b')](_0xa652('0x11'),auth[_0xa652('0xc')](),controller[_0xa652('0x1d')]);module[_0xa652('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index d75b215..8b82c36 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 _0x0c71=['BOOLEAN','exports','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out'];(function(_0x16938f,_0x35e57f){var _0x5c66e9=function(_0x5167d7){while(--_0x5167d7){_0x16938f['push'](_0x16938f['shift']());}};_0x5c66e9(++_0x35e57f);}(_0x0c71,0xfb));var _0x10c7=function(_0x2474b0,_0x464f13){_0x2474b0=_0x2474b0-0x0;var _0x3c1022=_0x0c71[_0x2474b0];return _0x3c1022;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x10c7('0x1')]},'ratingType':{'type':Sequelize[_0x10c7('0x2')](_0x10c7('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x10c7('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x10c7('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x10c7('0x6')]},'disposition':{'type':Sequelize[_0x10c7('0x5')]},'secondDisposition':{'type':Sequelize[_0x10c7('0x5')]},'thirdDisposition':{'type':Sequelize[_0x10c7('0x5')]},'note':{'type':Sequelize[_0x10c7('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x10c7('0x5')]},'osName':{'type':Sequelize[_0x10c7('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x10c7('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x10c7('0x4')]},'customerIp':{'type':Sequelize[_0x10c7('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x10c7('0x7'))},'read1stAt':{'type':Sequelize[_0x10c7('0x6')]},'lastMsgAt':{'type':Sequelize[_0x10c7('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x10c7('0x2')]('in',_0x10c7('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x10c7('0x5')]},'customerPort':{'type':Sequelize[_0x10c7('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x10c7('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x10c7('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe511=['DATE','long','ENUM','out','sequelize','exports','INTEGER','star','thumb','TEXT','STRING'];(function(_0xd3d9fa,_0x455487){var _0x441540=function(_0xc89223){while(--_0xc89223){_0xd3d9fa['push'](_0xd3d9fa['shift']());}};_0x441540(++_0x455487);}(_0xe511,0x16f));var _0x1e51=function(_0x69f883,_0x5c785d){_0x69f883=_0x69f883-0x0;var _0x5472ee=_0xe511[_0x69f883];return _0x5472ee;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1e51('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x1e51('0x3'),_0x1e51('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x1e51('0x5')]},'pathTranscript':{'type':Sequelize[_0x1e51('0x5')]},'mailTranscript':{'type':Sequelize[_0x1e51('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1e51('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1e51('0x6')]},'thirdDisposition':{'type':Sequelize[_0x1e51('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x1e51('0x6')]},'osName':{'type':Sequelize[_0x1e51('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x1e51('0x6')]},'deviceType':{'type':Sequelize[_0x1e51('0x6')]},'referer':{'type':Sequelize[_0x1e51('0x5')]},'customerIp':{'type':Sequelize[_0x1e51('0x6')]},'formData':{'type':Sequelize[_0x1e51('0x5')](_0x1e51('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x1e51('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x1e51('0x9')]('in',_0x1e51('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1e51('0x6')]},'customerPort':{'type':Sequelize[_0x1e51('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x1e51('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 62651f3..0a460c3 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 _0x9e92=['customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','zip-dir','moment','bluebird','mustache','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','end','sendStatus','name','send','render','merge','body','contact','agent','interaction','index','map','rawAttributes','type','key','getOptions','findAll','query','show','params','model','keys','filters','attributes','intersection','length','options','ChatInteraction','find','catch','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','file','originalname','filename','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','basename','download','close','server/files/chat/upload/','format','now','ChatMessage','Messages','User','ContactId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','fields','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','includeAll','rows','getMyMessages','include','includeAgent','addTags','setTags','spread','Tag','emit','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','CmContact','firstName','lastName','read','Account','get','mkdirSync','Chat','Owner','createdAt','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer'];(function(_0x47734e,_0x20b0a1){var _0xbd3d4=function(_0x38c9ac){while(--_0x38c9ac){_0x47734e['push'](_0x47734e['shift']());}};_0xbd3d4(++_0x20b0a1);}(_0x9e92,0x1b4));var _0x29e9=function(_0x54fa55,_0x3455a7){_0x54fa55=_0x54fa55-0x0;var _0xb79d2c=_0x9e92[_0x54fa55];return _0xb79d2c;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x29e9('0x0'));var rp=require('request-promise');var moment=require(_0x29e9('0x1'));var BPromise=require(_0x29e9('0x2'));var Mustache=require(_0x29e9('0x3'));var util=require(_0x29e9('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x29e9('0x5'));var Redis=require(_0x29e9('0x6'));var interaction=require(_0x29e9('0x7'));var qs=require(_0x29e9('0x8'));var pdf=require(_0x29e9('0x9'));var logger=require('../../config/logger')('api');var config=require(_0x29e9('0xa'));var db=require(_0x29e9('0xb'))['db'];config['redis']=_[_0x29e9('0xc')](config[_0x29e9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x29e9('0xe'))(new Redis(config['redis']));require(_0x29e9('0xf'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x29e9('0x10')][_0x29e9('0x11')]({'port':0x232b});var client9004=jayson['client'][_0x29e9('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x25136a,_0x37cd2f,_0x239897,_0x781bf2){return new BPromise(function(_0x463843,_0xccf684){var _0x422a8e=_0x781bf2||client;return _0x422a8e[_0x29e9('0x12')](_0x25136a,_0x239897)[_0x29e9('0x13')](function(_0x119536){logger[_0x29e9('0x14')](_0x29e9('0x15'),_0x37cd2f,_0x29e9('0x16'));logger[_0x29e9('0x17')](_0x29e9('0x18'),_0x37cd2f,_0x29e9('0x16'),JSON['stringify'](_0x119536));if(_0x119536['error']){if(_0x119536[_0x29e9('0x19')][_0x29e9('0x1a')]===0x1f4){logger[_0x29e9('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x37cd2f,_0x119536[_0x29e9('0x19')]['message']);return _0xccf684(_0x119536[_0x29e9('0x19')]['message']);}logger['error'](_0x29e9('0x15'),_0x37cd2f,_0x119536[_0x29e9('0x19')][_0x29e9('0x1b')]);return _0x463843(_0x119536[_0x29e9('0x19')][_0x29e9('0x1b')]);}else{logger['info'](_0x29e9('0x15'),_0x37cd2f,'request\x20sent');_0x463843(_0x119536[_0x29e9('0x1c')]['message']);}})['catch'](function(_0xbd96bb){logger[_0x29e9('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x37cd2f,_0xbd96bb);_0xccf684(_0xbd96bb);});});}function respondWithStatusCode(_0x27d907,_0x2cf27e){_0x2cf27e=_0x2cf27e||0xcc;return function(_0x15d4a4){if(_0x15d4a4){return _0x27d907['sendStatus'](_0x2cf27e);}return _0x27d907[_0x29e9('0x1d')](_0x2cf27e)['end']();};}function respondWithResult(_0x57794a,_0x3ec9b2){_0x3ec9b2=_0x3ec9b2||0xc8;return function(_0x104b8d){if(_0x104b8d){return _0x57794a[_0x29e9('0x1d')](_0x3ec9b2)['json'](_0x104b8d);}};}function respondWithFilteredResult(_0x216b04,_0x48cfdc){return function(_0x38758c){if(_0x38758c){var _0x1d6bbb=typeof _0x48cfdc[_0x29e9('0x1e')]===_0x29e9('0x1f')&&typeof _0x48cfdc[_0x29e9('0x20')]===_0x29e9('0x1f');var _0x3a53d2=_0x38758c[_0x29e9('0x21')];var _0x5d2445=_0x1d6bbb?0x0:_0x48cfdc[_0x29e9('0x1e')];var _0x2b4a8f=_0x1d6bbb?_0x38758c[_0x29e9('0x21')]:_0x48cfdc['offset']+_0x48cfdc[_0x29e9('0x20')];var _0xf9dcfc;if(_0x2b4a8f>=_0x3a53d2){_0x2b4a8f=_0x3a53d2;_0xf9dcfc=0xc8;}else{_0xf9dcfc=0xce;}_0x216b04['status'](_0xf9dcfc);return _0x216b04[_0x29e9('0x22')](_0x29e9('0x23'),_0x5d2445+'-'+_0x2b4a8f+'/'+_0x3a53d2)[_0x29e9('0x24')](_0x38758c);}return null;};}function saveUpdates(_0xf35b46){return function(_0x54ac02){if(_0x54ac02){return _0x54ac02[_0x29e9('0x25')](_0xf35b46)[_0x29e9('0x13')](function(_0xe8d624){return _0xe8d624;});}return null;};}function removeEntity(_0x324f34){return function(_0x2bdb91){if(_0x2bdb91){return _0x2bdb91[_0x29e9('0x26')]()[_0x29e9('0x13')](function(){_0x324f34[_0x29e9('0x1d')](0xcc)[_0x29e9('0x27')]();});}};}function handleEntityNotFound(_0x45693f){return function(_0x1c4640){if(!_0x1c4640){_0x45693f[_0x29e9('0x28')](0x194);}return _0x1c4640;};}function handleError(_0x471e01,_0x3c7839){_0x3c7839=_0x3c7839||0x1f4;return function(_0x244b14){logger[_0x29e9('0x19')](_0x244b14['stack']);if(_0x244b14['name']){delete _0x244b14[_0x29e9('0x29')];}_0x471e01[_0x29e9('0x1d')](_0x3c7839)[_0x29e9('0x2a')](_0x244b14);};}function getMustacheRender(_0x14a8d6,_0xbd163f){return Mustache[_0x29e9('0x2b')](_0x14a8d6,_[_0x29e9('0x2c')](_0xbd163f[_0x29e9('0x2d')],{'contact':_0xbd163f[_0x29e9('0x2e')],'message':_0xbd163f[_0x29e9('0x1b')],'agent':_0xbd163f[_0x29e9('0x2f')],'interaction':_0xbd163f[_0x29e9('0x30')],'account':_0xbd163f['account']}))||'';}exports[_0x29e9('0x31')]=function(_0x3f1766,_0x38adc6){var _0x4796d8={};var _0x4a36ba=_[_0x29e9('0x32')](db['ChatInteraction'][_0x29e9('0x33')],function(_0x248dc2){return{'name':_0x248dc2['fieldName'],'type':_0x248dc2[_0x29e9('0x34')][_0x29e9('0x35')]};});_0x4796d8=qs[_0x29e9('0x36')](_0x4a36ba,_0x3f1766);return interaction[_0x29e9('0x37')]('chat',_0x3f1766[_0x29e9('0x38')],_0x3f1766['user'],_0x4796d8,_0x4a36ba)[_0x29e9('0x13')](respondWithFilteredResult(_0x38adc6,_0x4796d8))['catch'](handleError(_0x38adc6,null));};exports[_0x29e9('0x39')]=function(_0xfe1ea4,_0x3b0b1b){var _0xfcb682={'raw':![],'where':{'id':_0xfe1ea4[_0x29e9('0x3a')]['id']}},_0x3fa1ee={};_0x3fa1ee[_0x29e9('0x3b')]=_[_0x29e9('0x3c')](db['ChatInteraction'][_0x29e9('0x33')]);_0x3fa1ee['query']=_[_0x29e9('0x3c')](_0xfe1ea4[_0x29e9('0x38')]);_0x3fa1ee[_0x29e9('0x3d')]=_['intersection'](_0x3fa1ee['model'],_0x3fa1ee[_0x29e9('0x38')]);_0xfcb682[_0x29e9('0x3e')]=_[_0x29e9('0x3f')](_0x3fa1ee[_0x29e9('0x3b')],qs['fields'](_0xfe1ea4[_0x29e9('0x38')]['fields']));_0xfcb682[_0x29e9('0x3e')]=_0xfcb682['attributes'][_0x29e9('0x40')]?_0xfcb682[_0x29e9('0x3e')]:_0x3fa1ee[_0x29e9('0x3b')];if(_0xfe1ea4[_0x29e9('0x38')]['includeAll']){_0xfcb682['include']=[{'all':!![]}];}_0xfcb682=_['merge']({},_0xfcb682,_0xfe1ea4[_0x29e9('0x41')]);return db[_0x29e9('0x42')][_0x29e9('0x43')](_0xfcb682)[_0x29e9('0x13')](handleEntityNotFound(_0x3b0b1b,null))['then'](respondWithResult(_0x3b0b1b,null))[_0x29e9('0x44')](handleError(_0x3b0b1b,null));};exports[_0x29e9('0x45')]=function(_0x47241b,_0x6f79e5){return db[_0x29e9('0x42')][_0x29e9('0x45')](_0x47241b[_0x29e9('0x2d')],{})[_0x29e9('0x13')](respondWithResult(_0x6f79e5,0xc9))['catch'](handleError(_0x6f79e5,null));};exports['update']=function(_0x38c8e3,_0x148f11){if(_0x38c8e3[_0x29e9('0x2d')]['id']){delete _0x38c8e3[_0x29e9('0x2d')]['id'];}return db[_0x29e9('0x42')][_0x29e9('0x43')]({'where':{'id':_0x38c8e3[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x148f11,null))[_0x29e9('0x13')](saveUpdates(_0x38c8e3[_0x29e9('0x2d')],null))[_0x29e9('0x13')](respondWithResult(_0x148f11,null))['catch'](handleError(_0x148f11,null));};exports[_0x29e9('0x26')]=function(_0x167ec3,_0x3d527b){return db[_0x29e9('0x42')]['find']({'where':{'id':_0x167ec3[_0x29e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3d527b,null))['then'](removeEntity(_0x3d527b,null))[_0x29e9('0x44')](handleError(_0x3d527b,null));};exports[_0x29e9('0x46')]=function(_0x4dab95,_0x2de73f){return db[_0x29e9('0x42')]['describe']()['then'](respondWithResult(_0x2de73f,null))[_0x29e9('0x44')](handleError(_0x2de73f,null));};exports[_0x29e9('0x47')]=function(_0x204e15,_0x9c8e2b){var _0x552c38=_0x204e15[_0x29e9('0x3a')]['id'];var _0x328f7f;var _0x32dd65;var _0x1d93a1;return db['ChatInteraction'][_0x29e9('0x48')]({'where':{'id':_0x552c38}})[_0x29e9('0x13')](function(_0x2a32e9){_0x328f7f=_0x2a32e9;return db[_0x29e9('0x49')][_0x29e9('0x48')]({'where':{'id':_0x2a32e9[_0x29e9('0x4a')]},'attributes':['id',_0x29e9('0x4b'),_0x29e9('0x4c'),_0x29e9('0x4d'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x29e9('0x13')](function(_0x45938f){if(_0x45938f&&_0x45938f[_0x29e9('0x4b')]&&_0x45938f[_0x29e9('0x4c')]){_0x32dd65=_0x45938f;var _0x5f2532={'interaction':{'id':_0x552c38},'agent':{'id':_0x204e15[_0x29e9('0x4e')]['id'],'name':_0x204e15['user'][_0x29e9('0x29')],'fullname':_0x204e15[_0x29e9('0x4e')][_0x29e9('0x4f')],'email':_0x204e15[_0x29e9('0x4e')][_0x29e9('0x50')]},'contact':_0x204e15['body'][_0x29e9('0x2e')],'account':_0x204e15['body'][_0x29e9('0x51')]};var _0x34bb51={'rejectUnauthorized':![],'method':_0x29e9('0x52'),'url':_0x29e9('0x53'),'headers':{'X-APIKEY':_0x45938f['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x204e15[_0x29e9('0x4e')][_0x29e9('0x50')]],'buttons':null,'topic':_0x32dd65['vidaooTopic'],'note':_[_0x29e9('0x54')](_0x32dd65['vidaooNote'])?null:getMustacheRender(_0x32dd65[_0x29e9('0x55')],_0x5f2532),'metadata':null},'redirect':_0x29e9('0x56'),'json':!![]};try{if(!_[_0x29e9('0x54')](_0x32dd65[_0x29e9('0x57')])){var _0x50be9d=getMustacheRender(_0x32dd65[_0x29e9('0x57')],_0x5f2532);var _0x389a77=JSON[_0x29e9('0x58')](_0x50be9d);_0x34bb51[_0x29e9('0x2d')][_0x29e9('0x59')]=_0x389a77;}}catch(_0x1db766){throw new db[(_0x29e9('0x5a'))][(_0x29e9('0x5b'))](_0x29e9('0x5c'));}return rp(_0x34bb51);}else{throw new db[(_0x29e9('0x5a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x29e9('0x13')](function(_0x519cee){_0x1d93a1=_0x519cee;if(_0x1d93a1['id']){var _0x374b5c={'body':_0x1d93a1[_0x29e9('0x5d')],'ChatWebsiteId':_0x32dd65['id'],'ChatInteractionId':_0x328f7f['id'],'direction':_0x29e9('0x5e'),'UserId':_0x204e15[_0x29e9('0x4e')]['id']};return db['ChatMessage'][_0x29e9('0x45')](_0x374b5c,{});}else{throw new db[(_0x29e9('0x5a'))][(_0x29e9('0x5b'))](_0x29e9('0x5f'));}})[_0x29e9('0x13')](function(){return _0x328f7f[_0x29e9('0x60')]({'vidaooSessionId':_0x1d93a1['id']});})[_0x29e9('0x13')](respondWithResult(_0x9c8e2b,null))[_0x29e9('0x44')](handleError(_0x9c8e2b,null));};exports[_0x29e9('0x61')]=function(_0x2d0a62,_0x40b4a3){if(_0x2d0a62[_0x29e9('0x2d')]['id']){delete _0x2d0a62[_0x29e9('0x2d')]['id'];}return db[_0x29e9('0x42')][_0x29e9('0x43')]({'where':{'id':_0x2d0a62[_0x29e9('0x3a')]['id']},'include':[{'model':db['CmContact'],'as':_0x29e9('0x62')}]})[_0x29e9('0x13')](handleEntityNotFound(_0x40b4a3,null))[_0x29e9('0x13')](saveUpdates(_0x2d0a62[_0x29e9('0x2d')],null))['then'](respondWithResult(_0x40b4a3,null))['catch'](handleError(_0x40b4a3,null));};exports[_0x29e9('0x63')]=function(_0x726fb9,_0x4463b3){if(_0x726fb9[_0x29e9('0x2d')]['id']){delete _0x726fb9[_0x29e9('0x2d')]['id'];}return db[_0x29e9('0x42')][_0x29e9('0x43')]({'where':{'id':_0x726fb9[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](function(_0x777cb1){if(!_0x777cb1){logger[_0x29e9('0x19')](_0x29e9('0x64'),_0x29e9('0x63'),0x194,_0x29e9('0x65'));_0x4463b3[_0x29e9('0x28')](0x194);}else{if(_0x777cb1[_0x29e9('0x66')]){throw new db[(_0x29e9('0x5a'))][(_0x29e9('0x5b'))](_0x29e9('0x67'));}}return _0x777cb1;})[_0x29e9('0x13')](function(_0x5b1dc6){if(_0x5b1dc6){return _0x5b1dc6[_0x29e9('0x25')]({'closed':_0x726fb9[_0x29e9('0x2d')][_0x29e9('0x68')],'disposition':_0x726fb9[_0x29e9('0x2d')][_0x29e9('0x69')]})[_0x29e9('0x13')](function(_0x5bdb8a){return _0x5bdb8a;});}})[_0x29e9('0x13')](function(){return respondWithRpcPromise('AbandonInteraction',_0x29e9('0x63'),_0x726fb9['body'],client9004);})[_0x29e9('0x13')](respondWithResult(_0x4463b3,null))[_0x29e9('0x44')](handleError(_0x4463b3,null));};exports['attachmentUpload']=function(_0x12d948,_0x375a9e){_0x12d948[_0x29e9('0x2d')][_0x29e9('0x29')]=_0x12d948[_0x29e9('0x6a')][_0x29e9('0x6b')];_0x12d948[_0x29e9('0x2d')]['basename']=_0x12d948[_0x29e9('0x6a')][_0x29e9('0x6c')];_0x12d948['body']['type']=_0x12d948[_0x29e9('0x6a')]['mimetype'];return db[_0x29e9('0x6d')][_0x29e9('0x45')](_0x12d948[_0x29e9('0x2d')])[_0x29e9('0x13')](respondWithResult(_0x375a9e,0xc9))[_0x29e9('0x44')](handleError(_0x375a9e,null));};exports[_0x29e9('0x6e')]=function(_0x325fdf,_0x50dc3b){return db[_0x29e9('0x42')]['findOne']({'where':{'id':_0x325fdf[_0x29e9('0x3a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x50dc3b,null))[_0x29e9('0x13')](function(_0x3a611b){if(_0x3a611b){if(_0x3a611b['closed']){return _0x50dc3b[_0x29e9('0x1d')](0x193)[_0x29e9('0x24')]({'status':0x193,'message':_0x29e9('0x6f')});}return db[_0x29e9('0x6d')][_0x29e9('0x48')]({'where':{'id':_0x325fdf['query'][_0x29e9('0x70')]},'raw':!![]})[_0x29e9('0x13')](handleEntityNotFound(_0x50dc3b,null));}})['then'](function(_0x7ee748){if(_0x7ee748){var _0x2c786a=_0x7ee748['ChatOfflineMessageId']!==null;var _0xb08b0a=path[_0x29e9('0x71')](config[_0x29e9('0x72')],_0x29e9('0x73'));if(_0x2c786a){_0xb08b0a=path[_0x29e9('0x71')](_0xb08b0a,'offline-chat/');}var _0x1dc781=path[_0x29e9('0x71')](_0xb08b0a,_0x7ee748[_0x29e9('0x74')]);return _0x50dc3b[_0x29e9('0x75')](_0x1dc781);}})[_0x29e9('0x44')](handleError(_0x50dc3b,null));};exports[_0x29e9('0x76')]=function(_0x4d778c,_0x1be1fa){var _0x978f3=null;var _0x58996f=null;var _0x2f39b2=null;if(_0x4d778c['body']['id']){delete _0x4d778c[_0x29e9('0x2d')]['id'];}if(_0x4d778c[_0x29e9('0x2d')]['mailTranscript']){_0x2f39b2=path['join'](config['root'],_0x29e9('0x77'),util[_0x29e9('0x78')]('transcript-%s.txt',Date[_0x29e9('0x79')]()));_0x4d778c[_0x29e9('0x2d')]['pathTranscript']=_0x2f39b2;}return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x4d778c[_0x29e9('0x3a')]['id']},'include':[{'model':db[_0x29e9('0x7a')],'as':_0x29e9('0x7b'),'include':[{'model':db[_0x29e9('0x7c')],'as':_0x29e9('0x7c')}]}]})['then'](handleEntityNotFound(_0x1be1fa,null))[_0x29e9('0x13')](saveUpdates(_0x4d778c[_0x29e9('0x2d')],null))[_0x29e9('0x13')](function(_0x417c0f){if(_0x417c0f){_0x978f3=_0x417c0f;return db[_0x29e9('0x49')][_0x29e9('0x43')]({'where':{'id':_0x978f3[_0x29e9('0x4a')]}});}})['then'](function(_0x4991e2){if(_0x4991e2){_0x58996f=_0x4991e2;return db['CmContact'][_0x29e9('0x43')]({'where':{'id':_0x978f3[_0x29e9('0x7d')]}});}})['then'](function(_0x408f9f){if(_0x408f9f){if(_0x2f39b2){var _0x2e43d5=null;for(var _0x50db62=0x1;_0x50db62<_0x978f3[_0x29e9('0x7b')][_0x29e9('0x40')];++_0x50db62){_0x2e43d5=_0x978f3[_0x29e9('0x7b')][_0x50db62];var _0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?util['format'](_0x29e9('0x7e'),_0x58996f[_0x29e9('0x7f')],_0x2e43d5[_0x29e9('0x66')]):'System';var _0x1cca10=_0x4d778c[_0x29e9('0x2d')][_0x29e9('0x80')]||util[_0x29e9('0x78')]('%s%d',_0x29e9('0x81'),_0x2e43d5[_0x29e9('0x7d')]);switch(_0x58996f[_0x29e9('0x82')]){case _0x29e9('0x83'):_0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?util['format']('%s%d',_0x58996f[_0x29e9('0x7f')],_0x2e43d5[_0x29e9('0x66')]):_0x29e9('0x84');break;case _0x29e9('0x85'):_0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?_0x2e43d5[_0x29e9('0x7c')][_0x29e9('0x86')]||_0x2e43d5[_0x29e9('0x7c')][_0x29e9('0x4f')]:_0x29e9('0x84');break;case'agent_fullname':_0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?_0x2e43d5[_0x29e9('0x7c')][_0x29e9('0x4f')]:_0x29e9('0x84');break;default:_0x2b91c4=_0x2e43d5['UserId']?util[_0x29e9('0x78')](_0x29e9('0x7e'),_0x58996f[_0x29e9('0x7f')],_0x2e43d5['UserId']):_0x29e9('0x84');}var _0x5edd32=util[_0x29e9('0x78')](_0x29e9('0x87'),moment(_0x2e43d5['createdAt'])[_0x29e9('0x78')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2e43d5[_0x29e9('0x88')]==='in'?_0x1cca10:_0x2b91c4,_0x2e43d5['body']);if(!_0x2e43d5[_0x29e9('0x89')]){fs[_0x29e9('0x8a')](_0x2f39b2,_0x5edd32);}}return db[_0x29e9('0x8b')][_0x29e9('0x48')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x29e9('0x8c'),'raw':!![],'include':[{'model':db[_0x29e9('0x8d')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x29e9('0x13')](function(_0x5c89ac){if(!_0x5c89ac||!_0x5c89ac[_0x29e9('0x8c')]||!_0x4d778c[_0x29e9('0x2d')])return _0x978f3;var _0x1a3072=_0x5c89ac[_0x29e9('0x8e')]();return respondWithRpcPromise('SendMail',_0x29e9('0x8f'),{'account':_0x1a3072,'message':{'from':util[_0x29e9('0x78')](_0x29e9('0x90'),_0x5c89ac[_0x29e9('0x29')],_0x5c89ac['email']||_0x5c89ac[_0x29e9('0x8c')]['user']),'to':_0x4d778c[_0x29e9('0x2d')][_0x29e9('0x91')],'subject':_0x29e9('0x92'),'text':util[_0x29e9('0x78')](_0x29e9('0x93'),_0x4d778c[_0x29e9('0x2d')][_0x29e9('0x91')]),'attachments':[{'path':_0x2f39b2}]}})[_0x29e9('0x13')](function(){return _0x978f3;})[_0x29e9('0x44')](function(_0x129650){logger[_0x29e9('0x19')](_0x129650);});})[_0x29e9('0x13')](respondWithStatusCode(_0x1be1fa,0xc8))[_0x29e9('0x44')](handleError(_0x1be1fa,null));};exports[_0x29e9('0x94')]=function(_0x17f21d,_0x33c63d){return db[_0x29e9('0x7a')][_0x29e9('0x43')]({'where':{'id':_0x17f21d[_0x29e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x33c63d,null))['then'](function(_0x318003){if(_0x318003){return _0x318003[_0x29e9('0x94')](_0x17f21d['body'][_0x29e9('0x95')],_[_0x29e9('0x96')](_0x17f21d[_0x29e9('0x2d')],[_0x29e9('0x95'),'id'])||{});}})[_0x29e9('0x13')](respondWithResult(_0x33c63d,null))['catch'](handleError(_0x33c63d,null));};exports[_0x29e9('0x97')]=function(_0x1e65c7,_0x307cc3){var _0x404426={'raw':![],'where':{}};var _0x49ac6e={};var _0x2e439c={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x29e9('0x48')]({'where':{'id':_0x1e65c7[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x307cc3,null))[_0x29e9('0x13')](function(_0x2bb038){if(_0x2bb038){_0x49ac6e['model']=_[_0x29e9('0x3c')](db[_0x29e9('0x7a')][_0x29e9('0x33')]);_0x49ac6e[_0x29e9('0x38')]=_[_0x29e9('0x3c')](_0x1e65c7['query']);_0x49ac6e[_0x29e9('0x3d')]=_[_0x29e9('0x3f')](_0x49ac6e[_0x29e9('0x3b')],_0x49ac6e[_0x29e9('0x38')]);_0x404426[_0x29e9('0x3e')]=_['intersection'](_0x49ac6e[_0x29e9('0x3b')],qs[_0x29e9('0x98')](_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x98')]));_0x404426[_0x29e9('0x3e')]=_0x404426[_0x29e9('0x3e')]['length']?_0x404426[_0x29e9('0x3e')]:_0x49ac6e[_0x29e9('0x3b')];if(!_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x99')](_0x29e9('0x9a'))){_0x404426[_0x29e9('0x20')]=qs[_0x29e9('0x20')](_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x20')]);_0x404426['offset']=qs[_0x29e9('0x1e')](_0x1e65c7[_0x29e9('0x38')]['offset']);}_0x404426[_0x29e9('0x9b')]=qs[_0x29e9('0x9c')](_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x9c')]);_0x404426[_0x29e9('0x9d')]=qs[_0x29e9('0x3d')](_[_0x29e9('0x9e')](_0x1e65c7[_0x29e9('0x38')],_0x49ac6e[_0x29e9('0x3d')]));_0x404426['where'][_0x29e9('0x9f')]=_0x2bb038['id'];if(_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa0')]){_0x404426['where']=_[_0x29e9('0x2c')](_0x404426['where'],{'$or':_['map'](_0x404426[_0x29e9('0x3e')],function(_0x473c96){var _0x265a56={};_0x265a56[_0x473c96]={'$like':'%'+_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa0')]+'%'};return _0x265a56;})});}if(_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa1')]){var _0xa4943a=_0x1e65c7['query'][_0x29e9('0xa1')][_0x29e9('0xa2')](',');var _0x52c783={};_0x52c783[_0xa4943a[0x0]]={'$gte':moment(_0xa4943a[0x1])[_0x29e9('0x78')]('YYYY-MM-DD\x20HH:mm:ss')};_0x404426[_0x29e9('0x9d')]=_['merge'](_0x404426[_0x29e9('0x9d')],_0x52c783);}_0x404426=_[_0x29e9('0x2c')]({},_0x404426,_0x1e65c7['options']);return db[_0x29e9('0x7a')]['count']({'where':_0x404426[_0x29e9('0x9d')]})[_0x29e9('0x13')](function(_0x4a5d83){_0x2e439c[_0x29e9('0x21')]=_0x4a5d83;if(_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa3')]){_0x404426['include']=[{'all':!![]}];}return db[_0x29e9('0x7a')][_0x29e9('0x37')](_0x404426);})[_0x29e9('0x13')](function(_0x57bf02){_0x2e439c[_0x29e9('0xa4')]=_0x57bf02;return _0x2e439c;});}})[_0x29e9('0x13')](respondWithFilteredResult(_0x307cc3,_0x404426))[_0x29e9('0x44')](handleError(_0x307cc3,null));};exports[_0x29e9('0xa5')]=function(_0x1e8a8d,_0x1cad1c){var _0x58cf23={'where':{}},_0x3fc806={},_0x13344e={'count':0x0,'rows':[]};return db[_0x29e9('0x42')][_0x29e9('0x48')]({'where':{'id':_0x1e8a8d[_0x29e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1cad1c,null))[_0x29e9('0x13')](function(_0x451d8b){if(_0x451d8b){_0x3fc806[_0x29e9('0x3b')]=_['keys'](db['ChatMessage'][_0x29e9('0x33')]);_0x3fc806[_0x29e9('0x38')]=_['keys'](_0x1e8a8d[_0x29e9('0x38')]);_0x3fc806[_0x29e9('0x3d')]=_[_0x29e9('0x3f')](_0x3fc806['model'],_0x3fc806[_0x29e9('0x38')]);_0x58cf23['attributes']=_['intersection'](_0x3fc806[_0x29e9('0x3b')],qs[_0x29e9('0x98')](_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0x98')]));_0x58cf23['attributes']=_0x58cf23[_0x29e9('0x3e')]['length']?_0x58cf23['attributes']:_0x3fc806['model'];if(!_0x1e8a8d[_0x29e9('0x38')]['hasOwnProperty']('nolimit')){_0x58cf23[_0x29e9('0x20')]=qs['limit'](_0x1e8a8d['query']['limit']);_0x58cf23[_0x29e9('0x1e')]=qs[_0x29e9('0x1e')](_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0x1e')]);}_0x58cf23[_0x29e9('0x9b')]=qs[_0x29e9('0x9c')](_0x1e8a8d[_0x29e9('0x38')]['sort']);_0x58cf23['where']=qs[_0x29e9('0x3d')](_['pick'](_0x1e8a8d['query'],_0x3fc806[_0x29e9('0x3d')]));_0x58cf23[_0x29e9('0x9d')][_0x29e9('0x9f')]=_0x451d8b['id'];if(_0x1e8a8d['query'][_0x29e9('0xa0')]){_0x58cf23[_0x29e9('0x9d')]=_[_0x29e9('0x2c')](_0x58cf23[_0x29e9('0x9d')],{'$or':_['map'](_0x58cf23['attributes'],function(_0x24c79f){var _0x329dd7={};_0x329dd7[_0x24c79f]={'$like':'%'+_0x1e8a8d['query'][_0x29e9('0xa0')]+'%'};return _0x329dd7;})});}_0x58cf23[_0x29e9('0x9d')][_0x29e9('0x89')]=![];if(_0x1e8a8d[_0x29e9('0x38')]['id']){_0x58cf23[_0x29e9('0x9d')]['id']={'$gt':_0x1e8a8d[_0x29e9('0x38')]['id']};}_0x58cf23=_['merge']({},_0x58cf23,_0x1e8a8d['options']);return db[_0x29e9('0x7a')][_0x29e9('0x21')]({'where':_0x58cf23[_0x29e9('0x9d')]})[_0x29e9('0x13')](function(_0x2d8b40){_0x13344e[_0x29e9('0x21')]=_0x2d8b40;_0x58cf23[_0x29e9('0xa6')]=[];if(_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0xa7')]){_0x58cf23['include']['push']({'model':db[_0x29e9('0x7c')],'as':_0x29e9('0x7c'),'attributes':['id',_0x29e9('0x4f'),_0x29e9('0x86')]});}if(_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0xa3')]){_0x58cf23['include']=[{'all':!![]}];}return db[_0x29e9('0x7a')][_0x29e9('0x37')](_0x58cf23);})[_0x29e9('0x13')](function(_0x23414a){_0x13344e[_0x29e9('0xa4')]=_0x23414a;return _0x13344e;});}})[_0x29e9('0x13')](respondWithFilteredResult(_0x1cad1c,_0x58cf23))['catch'](handleError(_0x1cad1c,null));};exports[_0x29e9('0xa8')]=function(_0x4bed96,_0x3a346d){return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x4bed96['params']['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x3a346d,null))[_0x29e9('0x13')](function(_0x23f09b){if(_0x23f09b){return _0x23f09b[_0x29e9('0xa9')](_0x4bed96[_0x29e9('0x2d')]['ids'],_['omit'](_0x4bed96[_0x29e9('0x2d')],[_0x29e9('0x95'),'id'])||{})[_0x29e9('0xaa')](function(){return db[_0x29e9('0xab')][_0x29e9('0x37')]({'attributes':['id',_0x29e9('0x29'),'color'],'where':{'id':_0x4bed96[_0x29e9('0x2d')][_0x29e9('0x95')]}});})['then'](function(_0x35a444){socket[_0x29e9('0xac')]('chatInteractionTags:save',{'id':Number(_0x4bed96[_0x29e9('0x3a')]['id']),'tags':_0x35a444||[]});return{'id':Number(_0x4bed96[_0x29e9('0x3a')]['id']),'tags':_0x35a444||[]};});}})[_0x29e9('0x13')](respondWithResult(_0x3a346d,null))[_0x29e9('0x44')](handleError(_0x3a346d,null));};exports[_0x29e9('0xad')]=function(_0x2998b7,_0x38dff7){return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x2998b7[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x38dff7,null))[_0x29e9('0x13')](function(_0x23c56f){if(_0x23c56f){return _0x23c56f[_0x29e9('0xad')](_0x2998b7[_0x29e9('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x38dff7,null))['catch'](handleError(_0x38dff7,null));};exports[_0x29e9('0x75')]=function(_0x162e1f,_0x19aea5){var _0x4486b7=moment()[_0x29e9('0xae')]()[_0x29e9('0xaf')]();var _0x458d4b=path[_0x29e9('0x71')](config[_0x29e9('0x72')],_0x29e9('0xb0'),_0x29e9('0xb1'),_0x29e9('0xb2'));var _0x1377c9=path['join'](config[_0x29e9('0x72')],'server',_0x29e9('0xb1'),_0x29e9('0xb3'));var _0x3fd3be=path[_0x29e9('0x71')](_0x458d4b,_0x4486b7);var _0x1c81c1=util[_0x29e9('0x78')](_0x29e9('0xb4'),_0x162e1f['params']['id'],_0x4486b7);var _0x172204=path[_0x29e9('0x71')](_0x458d4b,_0x1c81c1);var _0x513362=[];_0x513362[_0x29e9('0xb5')]({'model':db['User'],'as':'User','attributes':['id',_0x29e9('0x4f')],'raw':!![]});_0x513362[_0x29e9('0xb5')]({'model':db[_0x29e9('0xb6')],'as':_0x29e9('0x62'),'attributes':['id',_0x29e9('0xb7'),_0x29e9('0xb8')],'raw':!![]});if(_0x162e1f[_0x29e9('0x38')][_0x29e9('0xb3')]){_0x513362[_0x29e9('0xb5')]({'model':db[_0x29e9('0x6d')],'as':_0x29e9('0x6d'),'raw':!![]});}var _0xaa3f79=[{'model':db[_0x29e9('0x7a')],'as':'Messages','attributes':['id',_0x29e9('0x2d'),'createdAt',_0x29e9('0x88'),_0x29e9('0x89'),_0x29e9('0xb9')],'include':_0x513362}];_0xaa3f79[_0x29e9('0xb5')]({'model':db[_0x29e9('0x49')],'as':_0x29e9('0xba'),'attributes':['id',_0x29e9('0x29')]});_0xaa3f79[_0x29e9('0xb5')]({'model':db[_0x29e9('0x7c')],'as':'Owner','attributes':['id',_0x29e9('0x4f')]});return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x162e1f[_0x29e9('0x3a')]['id']},'include':_0xaa3f79})['then'](handleEntityNotFound(_0x19aea5,null))['then'](function(_0x36e1d6){if(_0x36e1d6){var _0xa1ce62=_0x36e1d6[_0x29e9('0xbb')]({'plain':!![]});fs[_0x29e9('0xbc')](_0x3fd3be);var _0x3b32e0={'channel':_0x29e9('0xbd'),'account':_0xa1ce62[_0x29e9('0xba')][_0x29e9('0x29')],'agent':_0xa1ce62[_0x29e9('0xbe')]?_0xa1ce62[_0x29e9('0xbe')][_0x29e9('0x4f')]:'N.A.','createdAt':moment(_0xa1ce62[_0x29e9('0xbf')])[_0x29e9('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0x29e9('0xaf')](),'closedAt':_0xa1ce62[_0x29e9('0x68')]?moment(_0xa1ce62[_0x29e9('0xc0')])[_0x29e9('0x78')](_0x29e9('0xc1'))[_0x29e9('0xaf')]():'','disposition':_0xa1ce62['disposition'],'chatInfo':{'browser':_0xa1ce62[_0x29e9('0xc2')],'os':_0xa1ce62[_0x29e9('0xc3')],'referer':_0xa1ce62[_0x29e9('0xc4')],'customerIp':_0xa1ce62[_0x29e9('0xc5')],'customerPort':_0xa1ce62['customerPort']?_0xa1ce62[_0x29e9('0xc6')]:_0x29e9('0xc7')},'messages':_(_0xa1ce62[_0x29e9('0x7b')])[_0x29e9('0xc8')]()[_0x29e9('0xa0')]({'secret':![]})[_0x29e9('0x32')](function(_0x960fee){if(_0x960fee[_0x29e9('0x6d')]){var _0x1e8ffd=path[_0x29e9('0x71')](_0x1377c9,_0x960fee[_0x29e9('0x6d')][_0x29e9('0x74')]);if(fs[_0x29e9('0xc9')](_0x1e8ffd)){fs[_0x29e9('0xca')](_0x1e8ffd)[_0x29e9('0xcb')](fs['createWriteStream'](path[_0x29e9('0x71')](_0x3fd3be,_0x960fee[_0x29e9('0x6d')]['basename'])));}}return{'date':moment(_0x960fee[_0x29e9('0xbf')])['format'](_0x29e9('0xc1'))[_0x29e9('0xaf')](),'sender':_0x960fee['direction']==='out'?_0x960fee[_0x29e9('0x7c')]?_0x960fee[_0x29e9('0x7c')][_0x29e9('0x4f')]:'System':_0x960fee['Contact']['firstName']+(_0x960fee[_0x29e9('0x62')][_0x29e9('0xb8')]?'\x20'+_0x960fee[_0x29e9('0x62')][_0x29e9('0xb8')]:''),'body':_0x960fee[_0x29e9('0x6d')]?_0x960fee[_0x29e9('0x6d')][_0x29e9('0x74')]:_0x960fee[_0x29e9('0x2d')],'direction':_0x960fee[_0x29e9('0x88')]==='out'?'A':'C','secret':_0x960fee['secret'],'read':_0x960fee[_0x29e9('0xb9')],'attachment':_0x960fee[_0x29e9('0x6d')]};})[_0x29e9('0xcc')]()};return ejs[_0x29e9('0xcd')](path[_0x29e9('0x71')](config[_0x29e9('0x72')],_0x29e9('0xb0'),_0x29e9('0xce'),'downloadInteraction.ejs'),{'interaction':_0x3b32e0})[_0x29e9('0x13')](function(_0x45b8a6){var _0x4649b=path[_0x29e9('0x71')](_0x3fd3be,_0x29e9('0xcf')+_0xa1ce62['id']+'-'+_0x4486b7+_0x29e9('0xd0'));var _0x3ab764={'path':_0x4649b,'channel':_0x29e9('0xbd'),'interactionId':_0xa1ce62['id']};return pdf[_0x29e9('0xd1')](_0x45b8a6,_0x3ab764);})[_0x29e9('0x13')](function(){return new Promise(function(_0x40bcb1,_0x488ebb){zipdir(_0x3fd3be,{'saveTo':_0x172204},function(_0x78b3b0,_0x771bcc){if(_0x78b3b0)return _0x488ebb(_0x78b3b0);return _0x40bcb1(_0x771bcc);});})[_0x29e9('0x13')](function(){return new BPromise(function(_0xe9305,_0x4a5831){rimraf(_0x3fd3be,function(_0xf26cd0){if(_0xf26cd0)_0x4a5831(_0xf26cd0);return _0xe9305();});});})[_0x29e9('0x13')](function(){return _0x19aea5[_0x29e9('0x75')](_0x172204,_0x1c81c1,function(_0x16871b){if(_0x16871b){logger[_0x29e9('0x19')](_0x29e9('0xd2'),_0x16871b);}else{fs['unlinkSync'](_0x172204);}});});});}else{return _0x19aea5['sendStatus'](0xc8);}})[_0x29e9('0x44')](handleError(_0x19aea5,null));};
\ No newline at end of file
+var _0xa884=['getMessages','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','push','addTags','spread','Tag','color','emit','removeTags','unix','toString','server','tmp','files','transcript-%d-%s.zip','firstName','lastName','attachments','Owner','get','mkdirSync','Account','N.A.','createdAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','destroy','stack','name','send','render','merge','body','contact','agent','account','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','query','user','show','params','model','keys','filters','intersection','fields','length','attributes','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','update','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','User','ContactId','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','%s%d','alias','fullname','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids'];(function(_0x37c570,_0x537f0c){var _0x5e4c88=function(_0x3f3a0e){while(--_0x3f3a0e){_0x37c570['push'](_0x37c570['shift']());}};_0x5e4c88(++_0x537f0c);}(_0xa884,0x103));var _0x4a88=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0xa884[_0x2136d5];return _0x3bee2e;};'use strict';var rimraf=require(_0x4a88('0x0'));var zipdir=require(_0x4a88('0x1'));var rp=require(_0x4a88('0x2'));var moment=require(_0x4a88('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4a88('0x4'));var util=require(_0x4a88('0x5'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4a88('0x6'));var Redis=require(_0x4a88('0x7'));var interaction=require(_0x4a88('0x8'));var qs=require(_0x4a88('0x9'));var pdf=require(_0x4a88('0xa'));var logger=require(_0x4a88('0xb'))(_0x4a88('0xc'));var config=require(_0x4a88('0xd'));var db=require(_0x4a88('0xe'))['db'];config['redis']=_[_0x4a88('0xf')](config[_0x4a88('0x10')],{'host':_0x4a88('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a88('0x10')]));require(_0x4a88('0x12'))['register'](socket);var jayson=require(_0x4a88('0x13'));var client=jayson[_0x4a88('0x14')]['http']({'port':0x232b});var client9004=jayson[_0x4a88('0x14')][_0x4a88('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x386e6b,_0x4cdeff,_0x4c7ef6,_0x4c066d){return new BPromise(function(_0x4d13eb,_0x82b791){var _0x1b4a67=_0x4c066d||client;return _0x1b4a67[_0x4a88('0x16')](_0x386e6b,_0x4c7ef6)[_0x4a88('0x17')](function(_0x599852){logger[_0x4a88('0x18')](_0x4a88('0x19'),_0x4cdeff,'request\x20sent');logger['debug'](_0x4a88('0x1a'),_0x4cdeff,_0x4a88('0x1b'),JSON['stringify'](_0x599852));if(_0x599852[_0x4a88('0x1c')]){if(_0x599852[_0x4a88('0x1c')][_0x4a88('0x1d')]===0x1f4){logger['error'](_0x4a88('0x19'),_0x4cdeff,_0x599852['error'][_0x4a88('0x1e')]);return _0x82b791(_0x599852[_0x4a88('0x1c')][_0x4a88('0x1e')]);}logger['error'](_0x4a88('0x19'),_0x4cdeff,_0x599852[_0x4a88('0x1c')][_0x4a88('0x1e')]);return _0x4d13eb(_0x599852[_0x4a88('0x1c')][_0x4a88('0x1e')]);}else{logger[_0x4a88('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4cdeff,_0x4a88('0x1b'));_0x4d13eb(_0x599852[_0x4a88('0x1f')][_0x4a88('0x1e')]);}})[_0x4a88('0x20')](function(_0xd5c38a){logger[_0x4a88('0x1c')](_0x4a88('0x19'),_0x4cdeff,_0xd5c38a);_0x82b791(_0xd5c38a);});});}function respondWithStatusCode(_0x195525,_0x146523){_0x146523=_0x146523||0xcc;return function(_0x251c26){if(_0x251c26){return _0x195525[_0x4a88('0x21')](_0x146523);}return _0x195525[_0x4a88('0x22')](_0x146523)[_0x4a88('0x23')]();};}function respondWithResult(_0x2ad4b9,_0x38cef0){_0x38cef0=_0x38cef0||0xc8;return function(_0x13f020){if(_0x13f020){return _0x2ad4b9[_0x4a88('0x22')](_0x38cef0)[_0x4a88('0x24')](_0x13f020);}};}function respondWithFilteredResult(_0x4507f6,_0x378c65){return function(_0x47cd1d){if(_0x47cd1d){var _0x495ae2=typeof _0x378c65['offset']==='undefined'&&typeof _0x378c65[_0x4a88('0x25')]===_0x4a88('0x26');var _0x56afa9=_0x47cd1d[_0x4a88('0x27')];var _0x15a872=_0x495ae2?0x0:_0x378c65['offset'];var _0x47849b=_0x495ae2?_0x47cd1d[_0x4a88('0x27')]:_0x378c65[_0x4a88('0x28')]+_0x378c65[_0x4a88('0x25')];var _0x5aa141;if(_0x47849b>=_0x56afa9){_0x47849b=_0x56afa9;_0x5aa141=0xc8;}else{_0x5aa141=0xce;}_0x4507f6[_0x4a88('0x22')](_0x5aa141);return _0x4507f6['set'](_0x4a88('0x29'),_0x15a872+'-'+_0x47849b+'/'+_0x56afa9)[_0x4a88('0x24')](_0x47cd1d);}return null;};}function saveUpdates(_0x5b803b){return function(_0x457847){if(_0x457847){return _0x457847['update'](_0x5b803b)['then'](function(_0x5518e9){return _0x5518e9;});}return null;};}function removeEntity(_0x3fa33f){return function(_0x2c9f4f){if(_0x2c9f4f){return _0x2c9f4f[_0x4a88('0x2a')]()[_0x4a88('0x17')](function(){_0x3fa33f[_0x4a88('0x22')](0xcc)[_0x4a88('0x23')]();});}};}function handleEntityNotFound(_0x232977){return function(_0xef24a1){if(!_0xef24a1){_0x232977[_0x4a88('0x21')](0x194);}return _0xef24a1;};}function handleError(_0x1f7f26,_0x16881f){_0x16881f=_0x16881f||0x1f4;return function(_0x230650){logger[_0x4a88('0x1c')](_0x230650[_0x4a88('0x2b')]);if(_0x230650[_0x4a88('0x2c')]){delete _0x230650[_0x4a88('0x2c')];}_0x1f7f26[_0x4a88('0x22')](_0x16881f)[_0x4a88('0x2d')](_0x230650);};}function getMustacheRender(_0x4057d4,_0x5c4f99){return Mustache[_0x4a88('0x2e')](_0x4057d4,_[_0x4a88('0x2f')](_0x5c4f99[_0x4a88('0x30')],{'contact':_0x5c4f99[_0x4a88('0x31')],'message':_0x5c4f99[_0x4a88('0x1e')],'agent':_0x5c4f99[_0x4a88('0x32')],'interaction':_0x5c4f99['interaction'],'account':_0x5c4f99[_0x4a88('0x33')]}))||'';}exports[_0x4a88('0x34')]=function(_0x20a740,_0x817b69){var _0x4fc45e={};var _0x8e290e=_[_0x4a88('0x35')](db[_0x4a88('0x36')][_0x4a88('0x37')],function(_0x2f010e){return{'name':_0x2f010e['fieldName'],'type':_0x2f010e[_0x4a88('0x38')]['key']};});_0x4fc45e=qs[_0x4a88('0x39')](_0x8e290e,_0x20a740);return interaction[_0x4a88('0x3a')]('chat',_0x20a740[_0x4a88('0x3b')],_0x20a740[_0x4a88('0x3c')],_0x4fc45e,_0x8e290e)['then'](respondWithFilteredResult(_0x817b69,_0x4fc45e))[_0x4a88('0x20')](handleError(_0x817b69,null));};exports[_0x4a88('0x3d')]=function(_0x225f38,_0x439037){var _0x114660={'raw':![],'where':{'id':_0x225f38[_0x4a88('0x3e')]['id']}},_0x163e83={};_0x163e83[_0x4a88('0x3f')]=_[_0x4a88('0x40')](db['ChatInteraction'][_0x4a88('0x37')]);_0x163e83['query']=_[_0x4a88('0x40')](_0x225f38[_0x4a88('0x3b')]);_0x163e83[_0x4a88('0x41')]=_['intersection'](_0x163e83[_0x4a88('0x3f')],_0x163e83[_0x4a88('0x3b')]);_0x114660['attributes']=_[_0x4a88('0x42')](_0x163e83[_0x4a88('0x3f')],qs[_0x4a88('0x43')](_0x225f38['query'][_0x4a88('0x43')]));_0x114660['attributes']=_0x114660['attributes'][_0x4a88('0x44')]?_0x114660[_0x4a88('0x45')]:_0x163e83['model'];if(_0x225f38[_0x4a88('0x3b')][_0x4a88('0x46')]){_0x114660[_0x4a88('0x47')]=[{'all':!![]}];}_0x114660=_[_0x4a88('0x2f')]({},_0x114660,_0x225f38[_0x4a88('0x48')]);return db[_0x4a88('0x36')][_0x4a88('0x49')](_0x114660)[_0x4a88('0x17')](handleEntityNotFound(_0x439037,null))['then'](respondWithResult(_0x439037,null))[_0x4a88('0x20')](handleError(_0x439037,null));};exports[_0x4a88('0x4a')]=function(_0x5786e1,_0x62f319){return db[_0x4a88('0x36')]['create'](_0x5786e1[_0x4a88('0x30')],{})[_0x4a88('0x17')](respondWithResult(_0x62f319,0xc9))[_0x4a88('0x20')](handleError(_0x62f319,null));};exports['update']=function(_0x2e374a,_0x4c4da5){if(_0x2e374a[_0x4a88('0x30')]['id']){delete _0x2e374a[_0x4a88('0x30')]['id'];}return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x2e374a['params']['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0x4c4da5,null))[_0x4a88('0x17')](saveUpdates(_0x2e374a[_0x4a88('0x30')],null))['then'](respondWithResult(_0x4c4da5,null))['catch'](handleError(_0x4c4da5,null));};exports['destroy']=function(_0x28ee5e,_0x22b486){return db['ChatInteraction'][_0x4a88('0x49')]({'where':{'id':_0x28ee5e[_0x4a88('0x3e')]['id']}})['then'](handleEntityNotFound(_0x22b486,null))[_0x4a88('0x17')](removeEntity(_0x22b486,null))[_0x4a88('0x20')](handleError(_0x22b486,null));};exports[_0x4a88('0x4b')]=function(_0x5e8d78,_0x3f72db){return db['ChatInteraction'][_0x4a88('0x4b')]()[_0x4a88('0x17')](respondWithResult(_0x3f72db,null))[_0x4a88('0x20')](handleError(_0x3f72db,null));};exports[_0x4a88('0x4c')]=function(_0x142d43,_0x122f5c){var _0x69a45c=_0x142d43[_0x4a88('0x3e')]['id'];var _0x6158f0;var _0x313831;var _0x39c6db;return db['ChatInteraction'][_0x4a88('0x4d')]({'where':{'id':_0x69a45c}})[_0x4a88('0x17')](function(_0x11d16c){_0x6158f0=_0x11d16c;return db[_0x4a88('0x4e')][_0x4a88('0x4d')]({'where':{'id':_0x11d16c[_0x4a88('0x4f')]},'attributes':['id',_0x4a88('0x50'),_0x4a88('0x51'),_0x4a88('0x52'),_0x4a88('0x53'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x2c8cce){if(_0x2c8cce&&_0x2c8cce[_0x4a88('0x50')]&&_0x2c8cce[_0x4a88('0x51')]){_0x313831=_0x2c8cce;var _0x19afe5={'interaction':{'id':_0x69a45c},'agent':{'id':_0x142d43['user']['id'],'name':_0x142d43[_0x4a88('0x3c')]['name'],'fullname':_0x142d43[_0x4a88('0x3c')]['fullname'],'email':_0x142d43[_0x4a88('0x3c')][_0x4a88('0x54')]},'contact':_0x142d43['body'][_0x4a88('0x31')],'account':_0x142d43[_0x4a88('0x30')][_0x4a88('0x33')]};var _0x29fbc6={'rejectUnauthorized':![],'method':_0x4a88('0x55'),'url':_0x4a88('0x56'),'headers':{'X-APIKEY':_0x2c8cce[_0x4a88('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x142d43[_0x4a88('0x3c')][_0x4a88('0x54')]],'buttons':null,'topic':_0x313831[_0x4a88('0x52')],'note':_[_0x4a88('0x57')](_0x313831[_0x4a88('0x53')])?null:getMustacheRender(_0x313831[_0x4a88('0x53')],_0x19afe5),'metadata':null},'redirect':_0x4a88('0x58'),'json':!![]};try{if(!_[_0x4a88('0x57')](_0x313831[_0x4a88('0x59')])){var _0x4fe8db=getMustacheRender(_0x313831[_0x4a88('0x59')],_0x19afe5);var _0x535ec0=JSON[_0x4a88('0x5a')](_0x4fe8db);_0x29fbc6[_0x4a88('0x30')][_0x4a88('0x5b')]=_0x535ec0;}}catch(_0x458c05){throw new db[(_0x4a88('0x5c'))]['ValidationError'](_0x4a88('0x5d'));}return rp(_0x29fbc6);}else{throw new db['Sequelize']['ValidationError'](_0x4a88('0x5e'));}})['then'](function(_0x2473fe){_0x39c6db=_0x2473fe;if(_0x39c6db['id']){var _0x52646d={'body':_0x39c6db[_0x4a88('0x5f')],'ChatWebsiteId':_0x313831['id'],'ChatInteractionId':_0x6158f0['id'],'direction':'out','UserId':_0x142d43[_0x4a88('0x3c')]['id']};return db['ChatMessage'][_0x4a88('0x4a')](_0x52646d,{});}else{throw new db['Sequelize'][(_0x4a88('0x60'))](_0x4a88('0x61'));}})[_0x4a88('0x17')](function(){return _0x6158f0[_0x4a88('0x62')]({'vidaooSessionId':_0x39c6db['id']});})[_0x4a88('0x17')](respondWithResult(_0x122f5c,null))['catch'](handleError(_0x122f5c,null));};exports['customUpdate']=function(_0x506b08,_0x366804){if(_0x506b08['body']['id']){delete _0x506b08[_0x4a88('0x30')]['id'];}return db['ChatInteraction'][_0x4a88('0x49')]({'where':{'id':_0x506b08['params']['id']},'include':[{'model':db[_0x4a88('0x63')],'as':_0x4a88('0x64')}]})[_0x4a88('0x17')](handleEntityNotFound(_0x366804,null))[_0x4a88('0x17')](saveUpdates(_0x506b08['body'],null))[_0x4a88('0x17')](respondWithResult(_0x366804,null))[_0x4a88('0x20')](handleError(_0x366804,null));};exports[_0x4a88('0x65')]=function(_0x408990,_0xc4586d){if(_0x408990[_0x4a88('0x30')]['id']){delete _0x408990[_0x4a88('0x30')]['id'];}return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x408990[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](function(_0x5a28f0){if(!_0x5a28f0){logger[_0x4a88('0x1c')](_0x4a88('0x66'),_0x4a88('0x65'),0x194,_0x4a88('0x67'));_0xc4586d['sendStatus'](0x194);}else{if(_0x5a28f0[_0x4a88('0x68')]){throw new db['Sequelize']['ValidationError'](_0x4a88('0x69'));}}return _0x5a28f0;})['then'](function(_0x27b242){if(_0x27b242){return _0x27b242[_0x4a88('0x6a')]({'closed':_0x408990[_0x4a88('0x30')][_0x4a88('0x6b')],'disposition':_0x408990[_0x4a88('0x30')][_0x4a88('0x6c')]})['then'](function(_0x3db325){return _0x3db325;});}})[_0x4a88('0x17')](function(){return respondWithRpcPromise('AbandonInteraction',_0x4a88('0x65'),_0x408990['body'],client9004);})['then'](respondWithResult(_0xc4586d,null))[_0x4a88('0x20')](handleError(_0xc4586d,null));};exports[_0x4a88('0x6d')]=function(_0x475795,_0x1eb510){_0x475795[_0x4a88('0x30')][_0x4a88('0x2c')]=_0x475795[_0x4a88('0x6e')][_0x4a88('0x6f')];_0x475795[_0x4a88('0x30')][_0x4a88('0x70')]=_0x475795[_0x4a88('0x6e')][_0x4a88('0x71')];_0x475795[_0x4a88('0x30')][_0x4a88('0x38')]=_0x475795[_0x4a88('0x6e')][_0x4a88('0x72')];return db[_0x4a88('0x73')][_0x4a88('0x4a')](_0x475795[_0x4a88('0x30')])[_0x4a88('0x17')](respondWithResult(_0x1eb510,0xc9))[_0x4a88('0x20')](handleError(_0x1eb510,null));};exports[_0x4a88('0x74')]=function(_0x3a819f,_0x2b2a83){return db[_0x4a88('0x36')][_0x4a88('0x4d')]({'where':{'id':_0x3a819f[_0x4a88('0x3e')]['id']},'raw':!![]})[_0x4a88('0x17')](handleEntityNotFound(_0x2b2a83,null))[_0x4a88('0x17')](function(_0x24b7f4){if(_0x24b7f4){if(_0x24b7f4[_0x4a88('0x6b')]){return _0x2b2a83[_0x4a88('0x22')](0x193)[_0x4a88('0x24')]({'status':0x193,'message':_0x4a88('0x75')});}return db[_0x4a88('0x73')][_0x4a88('0x4d')]({'where':{'id':_0x3a819f[_0x4a88('0x3b')][_0x4a88('0x76')]},'raw':!![]})['then'](handleEntityNotFound(_0x2b2a83,null));}})[_0x4a88('0x17')](function(_0xd4cc3b){if(_0xd4cc3b){var _0x4778eb=_0xd4cc3b[_0x4a88('0x77')]!==null;var _0x251c7a=path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0x7a'));if(_0x4778eb){_0x251c7a=path[_0x4a88('0x78')](_0x251c7a,'offline-chat/');}var _0x1315b6=path[_0x4a88('0x78')](_0x251c7a,_0xd4cc3b[_0x4a88('0x70')]);return _0x2b2a83[_0x4a88('0x7b')](_0x1315b6);}})['catch'](handleError(_0x2b2a83,null));};exports[_0x4a88('0x7c')]=function(_0x58099b,_0x43b23c){var _0x3bc7e3=null;var _0x585ed3=null;var _0x352e4e=null;if(_0x58099b[_0x4a88('0x30')]['id']){delete _0x58099b[_0x4a88('0x30')]['id'];}if(_0x58099b[_0x4a88('0x30')][_0x4a88('0x7d')]){_0x352e4e=path['join'](config[_0x4a88('0x79')],_0x4a88('0x7e'),util[_0x4a88('0x7f')]('transcript-%s.txt',Date[_0x4a88('0x80')]()));_0x58099b[_0x4a88('0x30')][_0x4a88('0x81')]=_0x352e4e;}return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x58099b['params']['id']},'include':[{'model':db[_0x4a88('0x82')],'as':_0x4a88('0x83'),'include':[{'model':db[_0x4a88('0x84')],'as':_0x4a88('0x84')}]}]})[_0x4a88('0x17')](handleEntityNotFound(_0x43b23c,null))[_0x4a88('0x17')](saveUpdates(_0x58099b[_0x4a88('0x30')],null))[_0x4a88('0x17')](function(_0x3e53bb){if(_0x3e53bb){_0x3bc7e3=_0x3e53bb;return db[_0x4a88('0x4e')]['find']({'where':{'id':_0x3bc7e3['ChatWebsiteId']}});}})[_0x4a88('0x17')](function(_0x4f1c48){if(_0x4f1c48){_0x585ed3=_0x4f1c48;return db[_0x4a88('0x63')]['find']({'where':{'id':_0x3bc7e3[_0x4a88('0x85')]}});}})['then'](function(_0x184b2c){if(_0x184b2c){if(_0x352e4e){var _0x4c9c5a=null;for(var _0x4fed14=0x1;_0x4fed14<_0x3bc7e3[_0x4a88('0x83')]['length'];++_0x4fed14){_0x4c9c5a=_0x3bc7e3[_0x4a88('0x83')][_0x4fed14];var _0x3684e6=_0x4c9c5a['UserId']?util[_0x4a88('0x7f')]('%s%d',_0x585ed3[_0x4a88('0x86')],_0x4c9c5a['UserId']):_0x4a88('0x87');var _0x591192=_0x58099b[_0x4a88('0x30')][_0x4a88('0x88')]||util[_0x4a88('0x7f')]('%s%d',_0x4a88('0x89'),_0x4c9c5a['ContactId']);switch(_0x585ed3[_0x4a88('0x8a')]){case _0x4a88('0x8b'):_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?util[_0x4a88('0x7f')](_0x4a88('0x8c'),_0x585ed3[_0x4a88('0x86')],_0x4c9c5a[_0x4a88('0x68')]):_0x4a88('0x87');break;case'agent_alias':_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?_0x4c9c5a['User'][_0x4a88('0x8d')]||_0x4c9c5a[_0x4a88('0x84')][_0x4a88('0x8e')]:_0x4a88('0x87');break;case _0x4a88('0x8f'):_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?_0x4c9c5a[_0x4a88('0x84')][_0x4a88('0x8e')]:_0x4a88('0x87');break;default:_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?util[_0x4a88('0x7f')](_0x4a88('0x8c'),_0x585ed3[_0x4a88('0x86')],_0x4c9c5a[_0x4a88('0x68')]):_0x4a88('0x87');}var _0x569f83=util[_0x4a88('0x7f')]('[%s]\x20%s:\x20%s\x0a',moment(_0x4c9c5a['createdAt'])['format'](_0x4a88('0x90')),_0x4c9c5a[_0x4a88('0x91')]==='in'?_0x591192:_0x3684e6,_0x4c9c5a[_0x4a88('0x30')]);if(!_0x4c9c5a[_0x4a88('0x92')]){fs['appendFileSync'](_0x352e4e,_0x569f83);}}return db[_0x4a88('0x93')][_0x4a88('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4a88('0x94')],'as':_0x4a88('0x94'),'raw':!![]}]}]});}}})[_0x4a88('0x17')](function(_0x1b9c12){if(!_0x1b9c12||!_0x1b9c12[_0x4a88('0x95')]||!_0x58099b['body'])return _0x3bc7e3;var _0x498f0b=_0x1b9c12[_0x4a88('0x96')]();return respondWithRpcPromise(_0x4a88('0x97'),'sendMail',{'account':_0x498f0b,'message':{'from':util[_0x4a88('0x7f')](_0x4a88('0x98'),_0x1b9c12[_0x4a88('0x2c')],_0x1b9c12[_0x4a88('0x54')]||_0x1b9c12['Smtp'][_0x4a88('0x3c')]),'to':_0x58099b[_0x4a88('0x30')]['mailTranscript'],'subject':_0x4a88('0x99'),'text':util['format'](_0x4a88('0x9a'),_0x58099b[_0x4a88('0x30')]['mailTranscript']),'attachments':[{'path':_0x352e4e}]}})[_0x4a88('0x17')](function(){return _0x3bc7e3;})['catch'](function(_0x4962d1){logger[_0x4a88('0x1c')](_0x4962d1);});})['then'](respondWithStatusCode(_0x43b23c,0xc8))[_0x4a88('0x20')](handleError(_0x43b23c,null));};exports[_0x4a88('0x9b')]=function(_0x2da868,_0x273575){return db[_0x4a88('0x82')][_0x4a88('0x49')]({'where':{'id':_0x2da868[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0x273575,null))[_0x4a88('0x17')](function(_0x1ed2bd){if(_0x1ed2bd){return _0x1ed2bd['addMessage'](_0x2da868[_0x4a88('0x30')][_0x4a88('0x9c')],_['omit'](_0x2da868[_0x4a88('0x30')],['ids','id'])||{});}})[_0x4a88('0x17')](respondWithResult(_0x273575,null))[_0x4a88('0x20')](handleError(_0x273575,null));};exports[_0x4a88('0x9d')]=function(_0x26d862,_0x5c7c1f){var _0x356c62={'raw':![],'where':{}};var _0x4e8548={};var _0x456429={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4a88('0x4d')]({'where':{'id':_0x26d862[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0x5c7c1f,null))[_0x4a88('0x17')](function(_0x5f04ce){if(_0x5f04ce){_0x4e8548[_0x4a88('0x3f')]=_['keys'](db[_0x4a88('0x82')][_0x4a88('0x37')]);_0x4e8548[_0x4a88('0x3b')]=_[_0x4a88('0x40')](_0x26d862[_0x4a88('0x3b')]);_0x4e8548[_0x4a88('0x41')]=_[_0x4a88('0x42')](_0x4e8548[_0x4a88('0x3f')],_0x4e8548[_0x4a88('0x3b')]);_0x356c62[_0x4a88('0x45')]=_[_0x4a88('0x42')](_0x4e8548[_0x4a88('0x3f')],qs[_0x4a88('0x43')](_0x26d862[_0x4a88('0x3b')]['fields']));_0x356c62['attributes']=_0x356c62[_0x4a88('0x45')]['length']?_0x356c62[_0x4a88('0x45')]:_0x4e8548[_0x4a88('0x3f')];if(!_0x26d862[_0x4a88('0x3b')][_0x4a88('0x9e')](_0x4a88('0x9f'))){_0x356c62[_0x4a88('0x25')]=qs[_0x4a88('0x25')](_0x26d862[_0x4a88('0x3b')][_0x4a88('0x25')]);_0x356c62[_0x4a88('0x28')]=qs[_0x4a88('0x28')](_0x26d862[_0x4a88('0x3b')][_0x4a88('0x28')]);}_0x356c62[_0x4a88('0xa0')]=qs[_0x4a88('0xa1')](_0x26d862[_0x4a88('0x3b')][_0x4a88('0xa1')]);_0x356c62[_0x4a88('0xa2')]=qs['filters'](_['pick'](_0x26d862[_0x4a88('0x3b')],_0x4e8548[_0x4a88('0x41')]));_0x356c62['where'][_0x4a88('0xa3')]=_0x5f04ce['id'];if(_0x26d862['query'][_0x4a88('0xa4')]){_0x356c62[_0x4a88('0xa2')]=_[_0x4a88('0x2f')](_0x356c62['where'],{'$or':_['map'](_0x356c62[_0x4a88('0x45')],function(_0x15f605){var _0x305aeb={};_0x305aeb[_0x15f605]={'$like':'%'+_0x26d862[_0x4a88('0x3b')][_0x4a88('0xa4')]+'%'};return _0x305aeb;})});}if(_0x26d862[_0x4a88('0x3b')]['$gte']){var _0x5984b5=_0x26d862['query']['$gte']['split'](',');var _0x4b972a={};_0x4b972a[_0x5984b5[0x0]]={'$gte':moment(_0x5984b5[0x1])[_0x4a88('0x7f')](_0x4a88('0xa5'))};_0x356c62[_0x4a88('0xa2')]=_[_0x4a88('0x2f')](_0x356c62[_0x4a88('0xa2')],_0x4b972a);}_0x356c62=_[_0x4a88('0x2f')]({},_0x356c62,_0x26d862[_0x4a88('0x48')]);return db[_0x4a88('0x82')][_0x4a88('0x27')]({'where':_0x356c62[_0x4a88('0xa2')]})[_0x4a88('0x17')](function(_0x1e35ff){_0x456429[_0x4a88('0x27')]=_0x1e35ff;if(_0x26d862[_0x4a88('0x3b')][_0x4a88('0x46')]){_0x356c62[_0x4a88('0x47')]=[{'all':!![]}];}return db[_0x4a88('0x82')][_0x4a88('0x3a')](_0x356c62);})[_0x4a88('0x17')](function(_0xf03daf){_0x456429[_0x4a88('0xa6')]=_0xf03daf;return _0x456429;});}})[_0x4a88('0x17')](respondWithFilteredResult(_0x5c7c1f,_0x356c62))[_0x4a88('0x20')](handleError(_0x5c7c1f,null));};exports[_0x4a88('0xa7')]=function(_0x16ea34,_0x518d21){var _0x53ac01={'where':{}},_0x393d69={},_0x147902={'count':0x0,'rows':[]};return db[_0x4a88('0x36')]['findOne']({'where':{'id':_0x16ea34[_0x4a88('0x3e')]['id']}})['then'](handleEntityNotFound(_0x518d21,null))[_0x4a88('0x17')](function(_0x20b19b){if(_0x20b19b){_0x393d69[_0x4a88('0x3f')]=_['keys'](db[_0x4a88('0x82')][_0x4a88('0x37')]);_0x393d69['query']=_['keys'](_0x16ea34[_0x4a88('0x3b')]);_0x393d69['filters']=_[_0x4a88('0x42')](_0x393d69[_0x4a88('0x3f')],_0x393d69[_0x4a88('0x3b')]);_0x53ac01[_0x4a88('0x45')]=_[_0x4a88('0x42')](_0x393d69[_0x4a88('0x3f')],qs[_0x4a88('0x43')](_0x16ea34['query'][_0x4a88('0x43')]));_0x53ac01[_0x4a88('0x45')]=_0x53ac01[_0x4a88('0x45')][_0x4a88('0x44')]?_0x53ac01[_0x4a88('0x45')]:_0x393d69[_0x4a88('0x3f')];if(!_0x16ea34[_0x4a88('0x3b')][_0x4a88('0x9e')](_0x4a88('0x9f'))){_0x53ac01['limit']=qs['limit'](_0x16ea34[_0x4a88('0x3b')][_0x4a88('0x25')]);_0x53ac01[_0x4a88('0x28')]=qs[_0x4a88('0x28')](_0x16ea34['query'][_0x4a88('0x28')]);}_0x53ac01['order']=qs[_0x4a88('0xa1')](_0x16ea34[_0x4a88('0x3b')][_0x4a88('0xa1')]);_0x53ac01['where']=qs[_0x4a88('0x41')](_['pick'](_0x16ea34[_0x4a88('0x3b')],_0x393d69[_0x4a88('0x41')]));_0x53ac01[_0x4a88('0xa2')][_0x4a88('0xa3')]=_0x20b19b['id'];if(_0x16ea34[_0x4a88('0x3b')][_0x4a88('0xa4')]){_0x53ac01[_0x4a88('0xa2')]=_[_0x4a88('0x2f')](_0x53ac01[_0x4a88('0xa2')],{'$or':_['map'](_0x53ac01[_0x4a88('0x45')],function(_0x35f0ff){var _0x4c190c={};_0x4c190c[_0x35f0ff]={'$like':'%'+_0x16ea34['query'][_0x4a88('0xa4')]+'%'};return _0x4c190c;})});}_0x53ac01[_0x4a88('0xa2')]['secret']=![];if(_0x16ea34['query']['id']){_0x53ac01[_0x4a88('0xa2')]['id']={'$gt':_0x16ea34[_0x4a88('0x3b')]['id']};}_0x53ac01=_[_0x4a88('0x2f')]({},_0x53ac01,_0x16ea34[_0x4a88('0x48')]);return db[_0x4a88('0x82')][_0x4a88('0x27')]({'where':_0x53ac01[_0x4a88('0xa2')]})[_0x4a88('0x17')](function(_0x2701ec){_0x147902['count']=_0x2701ec;_0x53ac01['include']=[];if(_0x16ea34['query'][_0x4a88('0xa8')]){_0x53ac01[_0x4a88('0x47')][_0x4a88('0xa9')]({'model':db[_0x4a88('0x84')],'as':_0x4a88('0x84'),'attributes':['id',_0x4a88('0x8e'),'alias']});}if(_0x16ea34[_0x4a88('0x3b')][_0x4a88('0x46')]){_0x53ac01[_0x4a88('0x47')]=[{'all':!![]}];}return db[_0x4a88('0x82')][_0x4a88('0x3a')](_0x53ac01);})['then'](function(_0x493766){_0x147902[_0x4a88('0xa6')]=_0x493766;return _0x147902;});}})['then'](respondWithFilteredResult(_0x518d21,_0x53ac01))[_0x4a88('0x20')](handleError(_0x518d21,null));};exports[_0x4a88('0xaa')]=function(_0x1bdd83,_0x302e36){return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x1bdd83['params']['id']}})['then'](handleEntityNotFound(_0x302e36,null))['then'](function(_0x2fb9e1){if(_0x2fb9e1){return _0x2fb9e1['setTags'](_0x1bdd83[_0x4a88('0x30')]['ids'],_['omit'](_0x1bdd83[_0x4a88('0x30')],['ids','id'])||{})[_0x4a88('0xab')](function(){return db[_0x4a88('0xac')][_0x4a88('0x3a')]({'attributes':['id',_0x4a88('0x2c'),_0x4a88('0xad')],'where':{'id':_0x1bdd83[_0x4a88('0x30')][_0x4a88('0x9c')]}});})['then'](function(_0x120834){socket[_0x4a88('0xae')]('chatInteractionTags:save',{'id':Number(_0x1bdd83[_0x4a88('0x3e')]['id']),'tags':_0x120834||[]});return{'id':Number(_0x1bdd83['params']['id']),'tags':_0x120834||[]};});}})[_0x4a88('0x17')](respondWithResult(_0x302e36,null))['catch'](handleError(_0x302e36,null));};exports[_0x4a88('0xaf')]=function(_0x3e6a52,_0xd0e507){return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x3e6a52[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0xd0e507,null))[_0x4a88('0x17')](function(_0x3affa0){if(_0x3affa0){return _0x3affa0[_0x4a88('0xaf')](_0x3e6a52[_0x4a88('0x3b')][_0x4a88('0x9c')]);}})[_0x4a88('0x17')](respondWithStatusCode(_0xd0e507,null))[_0x4a88('0x20')](handleError(_0xd0e507,null));};exports['download']=function(_0x141936,_0x1b66c7){var _0x26dd8a=moment()[_0x4a88('0xb0')]()[_0x4a88('0xb1')]();var _0x307e98=path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0xb2'),'files',_0x4a88('0xb3'));var _0x426f91=path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0xb2'),_0x4a88('0xb4'),'attachments');var _0x2795ff=path[_0x4a88('0x78')](_0x307e98,_0x26dd8a);var _0xaa40b8=util['format'](_0x4a88('0xb5'),_0x141936['params']['id'],_0x26dd8a);var _0x49dd2e=path[_0x4a88('0x78')](_0x307e98,_0xaa40b8);var _0x3eb485=[];_0x3eb485['push']({'model':db[_0x4a88('0x84')],'as':_0x4a88('0x84'),'attributes':['id','fullname'],'raw':!![]});_0x3eb485[_0x4a88('0xa9')]({'model':db[_0x4a88('0x63')],'as':_0x4a88('0x64'),'attributes':['id',_0x4a88('0xb6'),_0x4a88('0xb7')],'raw':!![]});if(_0x141936[_0x4a88('0x3b')][_0x4a88('0xb8')]){_0x3eb485[_0x4a88('0xa9')]({'model':db[_0x4a88('0x73')],'as':_0x4a88('0x73'),'raw':!![]});}var _0x4b77fc=[{'model':db[_0x4a88('0x82')],'as':_0x4a88('0x83'),'attributes':['id',_0x4a88('0x30'),'createdAt',_0x4a88('0x91'),_0x4a88('0x92'),'read'],'include':_0x3eb485}];_0x4b77fc[_0x4a88('0xa9')]({'model':db[_0x4a88('0x4e')],'as':'Account','attributes':['id',_0x4a88('0x2c')]});_0x4b77fc[_0x4a88('0xa9')]({'model':db[_0x4a88('0x84')],'as':_0x4a88('0xb9'),'attributes':['id',_0x4a88('0x8e')]});return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x141936[_0x4a88('0x3e')]['id']},'include':_0x4b77fc})['then'](handleEntityNotFound(_0x1b66c7,null))['then'](function(_0x23fe2a){if(_0x23fe2a){var _0x62f877=_0x23fe2a[_0x4a88('0xba')]({'plain':!![]});fs[_0x4a88('0xbb')](_0x2795ff);var _0x4ace18={'channel':'Chat','account':_0x62f877[_0x4a88('0xbc')]['name'],'agent':_0x62f877[_0x4a88('0xb9')]?_0x62f877[_0x4a88('0xb9')][_0x4a88('0x8e')]:_0x4a88('0xbd'),'createdAt':moment(_0x62f877[_0x4a88('0xbe')])[_0x4a88('0x7f')](_0x4a88('0xa5'))[_0x4a88('0xb1')](),'closedAt':_0x62f877[_0x4a88('0x6b')]?moment(_0x62f877['closedAt'])[_0x4a88('0x7f')](_0x4a88('0xa5'))['toString']():'','disposition':_0x62f877[_0x4a88('0x6c')],'chatInfo':{'browser':_0x62f877[_0x4a88('0xbf')],'os':_0x62f877[_0x4a88('0xc0')],'referer':_0x62f877[_0x4a88('0xc1')],'customerIp':_0x62f877[_0x4a88('0xc2')],'customerPort':_0x62f877[_0x4a88('0xc3')]?_0x62f877[_0x4a88('0xc3')]:_0x4a88('0xbd')},'messages':_(_0x62f877[_0x4a88('0x83')])[_0x4a88('0xc4')]()[_0x4a88('0xa4')]({'secret':![]})[_0x4a88('0x35')](function(_0xe99d88){if(_0xe99d88[_0x4a88('0x73')]){var _0x56b269=path['join'](_0x426f91,_0xe99d88[_0x4a88('0x73')]['basename']);if(fs[_0x4a88('0xc5')](_0x56b269)){fs[_0x4a88('0xc6')](_0x56b269)[_0x4a88('0xc7')](fs['createWriteStream'](path[_0x4a88('0x78')](_0x2795ff,_0xe99d88[_0x4a88('0x73')][_0x4a88('0x70')])));}}return{'date':moment(_0xe99d88['createdAt'])[_0x4a88('0x7f')](_0x4a88('0xa5'))[_0x4a88('0xb1')](),'sender':_0xe99d88[_0x4a88('0x91')]===_0x4a88('0xc8')?_0xe99d88[_0x4a88('0x84')]?_0xe99d88['User'][_0x4a88('0x8e')]:_0x4a88('0x87'):_0xe99d88[_0x4a88('0x64')][_0x4a88('0xb6')]+(_0xe99d88[_0x4a88('0x64')][_0x4a88('0xb7')]?'\x20'+_0xe99d88[_0x4a88('0x64')]['lastName']:''),'body':_0xe99d88[_0x4a88('0x73')]?_0xe99d88[_0x4a88('0x73')][_0x4a88('0x70')]:_0xe99d88[_0x4a88('0x30')],'direction':_0xe99d88[_0x4a88('0x91')]==='out'?'A':'C','secret':_0xe99d88[_0x4a88('0x92')],'read':_0xe99d88['read'],'attachment':_0xe99d88['Attachment']};})['value']()};return ejs[_0x4a88('0xc9')](path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0xb2'),_0x4a88('0xca'),_0x4a88('0xcb')),{'interaction':_0x4ace18})[_0x4a88('0x17')](function(_0x19b8eb){var _0x2b6866=path['join'](_0x2795ff,_0x4a88('0xcc')+_0x62f877['id']+'-'+_0x26dd8a+_0x4a88('0xcd'));var _0x2e5c0d={'path':_0x2b6866,'channel':_0x4a88('0xce'),'interactionId':_0x62f877['id']};return pdf['createPdfFromHTML'](_0x19b8eb,_0x2e5c0d);})['then'](function(){return new Promise(function(_0x21e369,_0x43ad70){zipdir(_0x2795ff,{'saveTo':_0x49dd2e},function(_0x54b383,_0x264fc4){if(_0x54b383)return _0x43ad70(_0x54b383);return _0x21e369(_0x264fc4);});})[_0x4a88('0x17')](function(){return new BPromise(function(_0x5dc1e8,_0x12b992){rimraf(_0x2795ff,function(_0x54e77b){if(_0x54e77b)_0x12b992(_0x54e77b);return _0x5dc1e8();});});})['then'](function(){return _0x1b66c7[_0x4a88('0x7b')](_0x49dd2e,_0xaa40b8,function(_0x41d8ec){if(_0x41d8ec){logger[_0x4a88('0x1c')]('err',_0x41d8ec);}else{fs[_0x4a88('0xcf')](_0x49dd2e);}});});});}else{return _0x1b66c7['sendStatus'](0xc8);}})[_0x4a88('0x20')](handleError(_0x1b66c7,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 6eaaf11..7362f28 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 _0x28f0=['../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','exports'];(function(_0x50b1c5,_0x1cf2a9){var _0x344f99=function(_0x5d6ef0){while(--_0x5d6ef0){_0x50b1c5['push'](_0x50b1c5['shift']());}};_0x344f99(++_0x1cf2a9);}(_0x28f0,0x168));var _0x028f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x28f0[_0xdea41a];return _0x15d0d8;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x028f('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x028f('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x028f('0x2')](0x0);var events={'afterCreate':_0x028f('0x3'),'afterUpdate':'update','afterDestroy':_0x028f('0x4')};function emitEvent(_0x5a01a2){return function(_0x4e7b46,_0x2f9c78,_0x1805eb){_0x4e7b46[_0x028f('0x5')]({'attributes':['id'],'raw':!![]})[_0x028f('0x6')](function(_0x26c57c){_0x4e7b46[_0x028f('0x7')](_0x028f('0x8'),_0x26c57c[_0x028f('0x9')](function(_0x1ec8a1){return{'id':_0x1ec8a1['id']};}));return ChatMessage[_0x028f('0xa')]({'where':{'ChatInteractionId':_0x4e7b46['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e5fae){_0x4e7b46[_0x028f('0x7')](_0x028f('0xb'),_0x2e5fae[_0x028f('0xc')]);ChatInteractionEvents['emit'](_0x5a01a2+':'+_0x4e7b46['id'],_0x4e7b46);ChatInteractionEvents[_0x028f('0xd')](_0x5a01a2,_0x4e7b46);_0x1805eb(null);})['catch'](_0x1805eb(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x028f('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xbf0d=['catch','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit'];(function(_0x242d4b,_0x351a8b){var _0x45b4a8=function(_0x5b041e){while(--_0x5b041e){_0x242d4b['push'](_0x242d4b['shift']());}};_0x45b4a8(++_0x351a8b);}(_0xbf0d,0x1bc));var _0xdbf0=function(_0x2247d7,_0x402cf3){_0x2247d7=_0x2247d7-0x0;var _0x2e3191=_0xbf0d[_0x2247d7];return _0x2e3191;};'use strict';var EventEmitter=require(_0xdbf0('0x0'));var ChatInteraction=require(_0xdbf0('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xdbf0('0x1'))['db'][_0xdbf0('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdbf0('0x3')](0x0);var events={'afterCreate':_0xdbf0('0x4'),'afterUpdate':_0xdbf0('0x5'),'afterDestroy':_0xdbf0('0x6')};function emitEvent(_0x42fd62){return function(_0x44422e,_0x293c64,_0x4cee31){_0x44422e[_0xdbf0('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1b6ea6){_0x44422e['setDataValue'](_0xdbf0('0x8'),_0x1b6ea6[_0xdbf0('0x9')](function(_0x82992b){return{'id':_0x82992b['id']};}));return ChatMessage[_0xdbf0('0xa')]({'where':{'ChatInteractionId':_0x44422e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdbf0('0xb')](function(_0x1c614b){_0x44422e[_0xdbf0('0xc')](_0xdbf0('0xd'),_0x1c614b['length']);ChatInteractionEvents[_0xdbf0('0xe')](_0x42fd62+':'+_0x44422e['id'],_0x44422e);ChatInteractionEvents[_0xdbf0('0xe')](_0x42fd62,_0x44422e);_0x4cee31(null);})[_0xdbf0('0xf')](_0x4cee31(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdbf0('0x10')](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 9d098ce..ca1246c 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 _0x5772=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x46450a,_0x15684e){var _0x1a02ad=function(_0x1eaeaf){while(--_0x1eaeaf){_0x46450a['push'](_0x46450a['shift']());}};_0x1a02ad(++_0x15684e);}(_0x5772,0x7c));var _0x2577=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5772[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2577('0x0'));var util=require(_0x2577('0x1'));var logger=require(_0x2577('0x2'))(_0x2577('0x3'));var moment=require(_0x2577('0x4'));var BPromise=require('bluebird');var rp=require(_0x2577('0x5'));var fs=require('fs');var path=require(_0x2577('0x6'));var rimraf=require(_0x2577('0x7'));var config=require(_0x2577('0x8'));var attributes=require(_0x2577('0x9'));module['exports']=function(_0x358608,_0x130a9e){return _0x358608[_0x2577('0xa')](_0x2577('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22756e,_0x9d2342,_0x14c96a){if(_0x22756e[_0x2577('0xc')](_0x2577('0xd'))){_0x22756e[_0x2577('0xe')]=moment()['format'](_0x2577('0xf'));}_0x14c96a(null,_0x22756e);}},'charset':_0x2577('0x10'),'collate':_0x2577('0x11')});};
\ No newline at end of file
+var _0x5565=['../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x47a05e,_0x20ab31){var _0x436415=function(_0x13b68e){while(--_0x13b68e){_0x47a05e['push'](_0x47a05e['shift']());}};_0x436415(++_0x20ab31);}(_0x5565,0x199));var _0x5556=function(_0x49919f,_0x9eb84){_0x49919f=_0x49919f-0x0;var _0x17e37a=_0x5565[_0x49919f];return _0x17e37a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5556('0x0'))(_0x5556('0x1'));var moment=require(_0x5556('0x2'));var BPromise=require(_0x5556('0x3'));var rp=require(_0x5556('0x4'));var fs=require('fs');var path=require(_0x5556('0x5'));var rimraf=require(_0x5556('0x6'));var config=require(_0x5556('0x7'));var attributes=require(_0x5556('0x8'));module[_0x5556('0x9')]=function(_0x16c837,_0x3d4a83){return _0x16c837[_0x5556('0xa')]('ChatInteraction',attributes,{'tableName':_0x5556('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5750a0,_0x3081f6,_0x252102){if(_0x5750a0[_0x5556('0xc')]('closed')){_0x5750a0[_0x5556('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x252102(null,_0x5750a0);}},'charset':_0x5556('0xe'),'collate':_0x5556('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 5d8c894..907fe34 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 _0x59a5=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatInteraction','update','body','options','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x59a5,0x183));var _0x559a=function(_0x553f0b,_0x177fc1){_0x553f0b=_0x553f0b-0x0;var _0x143135=_0x59a5[_0x553f0b];return _0x143135;};'use strict';var _=require(_0x559a('0x0'));var util=require(_0x559a('0x1'));var moment=require(_0x559a('0x2'));var BPromise=require('bluebird');var rs=require(_0x559a('0x3'));var fs=require('fs');var Redis=require(_0x559a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x559a('0x5'))(_0x559a('0x6'));var config=require('../../config/environment');var jayson=require(_0x559a('0x7'));var client=jayson[_0x559a('0x8')][_0x559a('0x9')]({'port':0x232a});config[_0x559a('0xa')]=_['defaults'](config[_0x559a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x559a('0xa')]));require(_0x559a('0xb'))[_0x559a('0xc')](socket);function respondWithRpcPromise(_0x328ef3,_0x2732d0,_0x2e9537){return new BPromise(function(_0x13f2d0,_0x1682de){return client[_0x559a('0xd')](_0x328ef3,_0x2e9537)[_0x559a('0xe')](function(_0x26bff6){logger[_0x559a('0xf')](_0x559a('0x10'),_0x2732d0,_0x559a('0x11'));logger[_0x559a('0x12')](_0x559a('0x13'),_0x2732d0,_0x559a('0x11'),JSON[_0x559a('0x14')](_0x26bff6));if(_0x26bff6[_0x559a('0x15')]){if(_0x26bff6[_0x559a('0x15')][_0x559a('0x16')]===0x1f4){logger[_0x559a('0x15')](_0x559a('0x10'),_0x2732d0,_0x26bff6['error'][_0x559a('0x17')]);return _0x1682de(_0x26bff6[_0x559a('0x15')][_0x559a('0x17')]);}logger['error'](_0x559a('0x10'),_0x2732d0,_0x26bff6[_0x559a('0x15')][_0x559a('0x17')]);return _0x13f2d0(_0x26bff6[_0x559a('0x15')][_0x559a('0x17')]);}else{logger[_0x559a('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x2732d0,_0x559a('0x11'));_0x13f2d0(_0x26bff6['result'][_0x559a('0x17')]);}})[_0x559a('0x18')](function(_0x224016){logger['error'](_0x559a('0x10'),_0x2732d0,_0x224016);_0x1682de(_0x224016);});});}exports['UpdateChatInteraction']=function(_0x3dbbc0){var _0x53fa52=this;return new Promise(function(_0x372561,_0x37a5ea){return db[_0x559a('0x19')][_0x559a('0x1a')](_0x3dbbc0[_0x559a('0x1b')],{'raw':_0x3dbbc0[_0x559a('0x1c')]?_0x3dbbc0[_0x559a('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dbbc0[_0x559a('0x1c')]?_0x3dbbc0['options'][_0x559a('0x1d')]||null:null,'attributes':_0x3dbbc0['options']?_0x3dbbc0[_0x559a('0x1c')][_0x559a('0x1e')]||null:null,'limit':_0x3dbbc0['options']?_0x3dbbc0['options'][_0x559a('0x1f')]||null:null})[_0x559a('0xe')](function(_0x19974b){logger['info'](_0x559a('0x20'),_0x3dbbc0);logger[_0x559a('0x12')]('UpdateChatInteraction',_0x3dbbc0,JSON['stringify'](_0x19974b));_0x372561(_0x19974b);})[_0x559a('0x18')](function(_0x105d3a){logger[_0x559a('0x15')](_0x559a('0x20'),_0x105d3a[_0x559a('0x17')],_0x3dbbc0);_0x37a5ea(_0x53fa52[_0x559a('0x15')](0x1f4,_0x105d3a['message']));});});};exports[_0x559a('0x21')]=function(_0x595a8d){return new Promise(function(_0x147677,_0x18f12f){return db[_0x559a('0x19')][_0x559a('0x22')]({'where':_0x595a8d[_0x559a('0x1c')]?_0x595a8d[_0x559a('0x1c')]['where']||null:null})['then'](function(_0x30aef8){if(_0x30aef8){return _0x30aef8[_0x559a('0x23')](_0x595a8d[_0x559a('0x1b')][_0x559a('0x24')],_['omit'](_0x595a8d[_0x559a('0x1b')],['ids','id'])||{});}})[_0x559a('0x25')](function(_0x2ef3db){logger['info'](_0x559a('0x26'),_0x595a8d);logger['debug']('AddTags',_0x595a8d,JSON[_0x559a('0x14')](_0x2ef3db));_0x147677(_0x2ef3db);})[_0x559a('0x18')](function(_0x31de66){logger[_0x559a('0x15')](_0x559a('0x26'),_0x31de66[_0x559a('0x17')],_0x595a8d);_0x18f12f(_this['error'](0x1f4,_0x31de66['message']));});});};
\ No newline at end of file
+var _0xee85=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','update','options','where','attributes','UpdateChatInteraction','stringify','ChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x5aa042,_0x4b5430){var _0x2477a1=function(_0x1d1177){while(--_0x1d1177){_0x5aa042['push'](_0x5aa042['shift']());}};_0x2477a1(++_0x4b5430);}(_0xee85,0x13a));var _0x5ee8=function(_0x5ce268,_0x1835b6){_0x5ce268=_0x5ce268-0x0;var _0x28c96a=_0xee85[_0x5ce268];return _0x28c96a;};'use strict';var _=require(_0x5ee8('0x0'));var util=require('util');var moment=require(_0x5ee8('0x1'));var BPromise=require(_0x5ee8('0x2'));var rs=require(_0x5ee8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5ee8('0x4'));var logger=require('../../config/logger')(_0x5ee8('0x5'));var config=require(_0x5ee8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5ee8('0x7')][_0x5ee8('0x8')]({'port':0x232a});config[_0x5ee8('0x9')]=_[_0x5ee8('0xa')](config[_0x5ee8('0x9')],{'host':_0x5ee8('0xb'),'port':0x18eb});var socket=require(_0x5ee8('0xc'))(new Redis(config[_0x5ee8('0x9')]));require(_0x5ee8('0xd'))[_0x5ee8('0xe')](socket);function respondWithRpcPromise(_0x4464af,_0x2cc8c0,_0x13c18d){return new BPromise(function(_0x1a62ad,_0x49fb43){return client['request'](_0x4464af,_0x13c18d)[_0x5ee8('0xf')](function(_0x424787){logger[_0x5ee8('0x10')](_0x5ee8('0x11'),_0x2cc8c0,_0x5ee8('0x12'));logger[_0x5ee8('0x13')](_0x5ee8('0x14'),_0x2cc8c0,_0x5ee8('0x12'),JSON['stringify'](_0x424787));if(_0x424787['error']){if(_0x424787[_0x5ee8('0x15')][_0x5ee8('0x16')]===0x1f4){logger[_0x5ee8('0x15')](_0x5ee8('0x11'),_0x2cc8c0,_0x424787['error'][_0x5ee8('0x17')]);return _0x49fb43(_0x424787['error']['message']);}logger[_0x5ee8('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2cc8c0,_0x424787[_0x5ee8('0x15')][_0x5ee8('0x17')]);return _0x1a62ad(_0x424787['error']['message']);}else{logger[_0x5ee8('0x10')](_0x5ee8('0x11'),_0x2cc8c0,_0x5ee8('0x12'));_0x1a62ad(_0x424787[_0x5ee8('0x18')][_0x5ee8('0x17')]);}})[_0x5ee8('0x19')](function(_0x439e76){logger[_0x5ee8('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2cc8c0,_0x439e76);_0x49fb43(_0x439e76);});});}exports['UpdateChatInteraction']=function(_0x1e4fa7){var _0x4d98ec=this;return new Promise(function(_0xd5523e,_0x5c21a6){return db['ChatInteraction'][_0x5ee8('0x1a')](_0x1e4fa7['body'],{'raw':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')][_0x5ee8('0x1c')]||null:null,'attributes':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')][_0x5ee8('0x1d')]||null:null,'limit':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')]['limit']||null:null})[_0x5ee8('0xf')](function(_0x1fceb0){logger[_0x5ee8('0x10')]('UpdateChatInteraction',_0x1e4fa7);logger['debug'](_0x5ee8('0x1e'),_0x1e4fa7,JSON[_0x5ee8('0x1f')](_0x1fceb0));_0xd5523e(_0x1fceb0);})[_0x5ee8('0x19')](function(_0x5b55bd){logger[_0x5ee8('0x15')](_0x5ee8('0x1e'),_0x5b55bd[_0x5ee8('0x17')],_0x1e4fa7);_0x5c21a6(_0x4d98ec[_0x5ee8('0x15')](0x1f4,_0x5b55bd[_0x5ee8('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x25b3c0){return new Promise(function(_0x409476,_0x1c643c){return db[_0x5ee8('0x20')][_0x5ee8('0x21')]({'where':_0x25b3c0[_0x5ee8('0x1b')]?_0x25b3c0[_0x5ee8('0x1b')][_0x5ee8('0x1c')]||null:null})['then'](function(_0x5e6912){if(_0x5e6912){return _0x5e6912[_0x5ee8('0x22')](_0x25b3c0[_0x5ee8('0x23')][_0x5ee8('0x24')],_[_0x5ee8('0x25')](_0x25b3c0[_0x5ee8('0x23')],[_0x5ee8('0x24'),'id'])||{});}})[_0x5ee8('0x26')](function(_0xd282a8){logger['info']('AddTags',_0x25b3c0);logger[_0x5ee8('0x13')](_0x5ee8('0x27'),_0x25b3c0,JSON['stringify'](_0xd282a8));_0x409476(_0xd282a8);})[_0x5ee8('0x19')](function(_0x59a6bd){logger[_0x5ee8('0x15')](_0x5ee8('0x27'),_0x59a6bd[_0x5ee8('0x17')],_0x25b3c0);_0x1c643c(_this[_0x5ee8('0x15')](0x1f4,_0x59a6bd[_0x5ee8('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 7d76fc2..2bd5168 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 _0x1f36=['remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x460ece,_0x3312d3){var _0x29013c=function(_0xf1ae9e){while(--_0xf1ae9e){_0x460ece['push'](_0x460ece['shift']());}};_0x29013c(++_0x3312d3);}(_0x1f36,0x1ed));var _0x61f3=function(_0x4024a8,_0x24792b){_0x4024a8=_0x4024a8-0x0;var _0x4d7178=_0x1f36[_0x4024a8];return _0x4d7178;};'use strict';var ChatInteractionEvents=require(_0x61f3('0x0'));var events=[_0x61f3('0x1'),_0x61f3('0x2'),_0x61f3('0x3')];function createListener(_0x530c15,_0x43cb61){return function(_0x5f4742){_0x43cb61[_0x61f3('0x4')](_0x530c15,_0x5f4742);};}function removeListener(_0x596aab,_0x17d9bf){return function(){ChatInteractionEvents[_0x61f3('0x5')](_0x596aab,_0x17d9bf);};}exports[_0x61f3('0x6')]=function(_0x12c372){for(var _0x72af3d=0x0,_0x52a5eb=events[_0x61f3('0x7')];_0x72af3d<_0x52a5eb;_0x72af3d++){var _0x2f1f60=events[_0x72af3d];var _0x2bfda3=createListener(_0x61f3('0x8')+_0x2f1f60,_0x12c372);ChatInteractionEvents['on'](_0x2f1f60,_0x2bfda3);}};
\ No newline at end of file
+var _0xae5e=['emit','register','length','chatInteraction:','./chatInteraction.events','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xae5e,0x1d2));var _0xeae5=function(_0x5cf032,_0x55f08d){_0x5cf032=_0x5cf032-0x0;var _0x5d21d8=_0xae5e[_0x5cf032];return _0x5d21d8;};'use strict';var ChatInteractionEvents=require(_0xeae5('0x0'));var events=['save','remove',_0xeae5('0x1')];function createListener(_0x2ff580,_0x244d0a){return function(_0x5e4920){_0x244d0a[_0xeae5('0x2')](_0x2ff580,_0x5e4920);};}function removeListener(_0x51f89d,_0xefba31){return function(){ChatInteractionEvents['removeListener'](_0x51f89d,_0xefba31);};}exports[_0xeae5('0x3')]=function(_0x2b2391){for(var _0x4728dd=0x0,_0x471e8d=events[_0xeae5('0x4')];_0x4728dd<_0x471e8d;_0x4728dd++){var _0x4ba737=events[_0x4728dd];var _0x38b135=createListener(_0xeae5('0x5')+_0x4ba737,_0x2b2391);ChatInteractionEvents['on'](_0x4ba737,_0x38b135);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 38c96ac..671e3ff 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 _0x3a89=['attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','post','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','chatinteraction:addtags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized'];(function(_0x29eb3b,_0x32f55e){var _0x5da960=function(_0x68eca2){while(--_0x68eca2){_0x29eb3b['push'](_0x29eb3b['shift']());}};_0x5da960(++_0x32f55e);}(_0x3a89,0x192));var _0x93a8=function(_0x2e49ae,_0x2ce021){_0x2e49ae=_0x2e49ae-0x0;var _0x217ac0=_0x3a89[_0x2e49ae];return _0x217ac0;};'use strict';var multer=require(_0x93a8('0x0'));var util=require('util');var path=require(_0x93a8('0x1'));var timeout=require(_0x93a8('0x2'));var express=require(_0x93a8('0x3'));var router=express[_0x93a8('0x4')]();var fs_extra=require(_0x93a8('0x5'));var auth=require(_0x93a8('0x6'));var interaction=require(_0x93a8('0x7'));var config=require(_0x93a8('0x8'));var controller=require('./chatInteraction.controller');router[_0x93a8('0x9')]('/',auth[_0x93a8('0xa')](),controller['index']);router[_0x93a8('0x9')](_0x93a8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x93a8('0x9')](_0x93a8('0xc'),auth[_0x93a8('0xd')](),controller['show']);router[_0x93a8('0x9')]('/:id/attachment_download',auth[_0x93a8('0xd')](),controller[_0x93a8('0xe')]);router['get'](_0x93a8('0xf'),auth['isAuthenticated'](),controller[_0x93a8('0x10')]);router[_0x93a8('0x9')](_0x93a8('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x93a8('0x12')]);router[_0x93a8('0x9')](_0x93a8('0x13'),auth['isAuthenticated'](),controller[_0x93a8('0x14')]);router['post']('/',auth[_0x93a8('0xa')](),controller['create']);router['post'](_0x93a8('0x15'),auth['isAuthenticated'](),controller[_0x93a8('0x16')]);var upload=multer({'storage':multer[_0x93a8('0x17')]({'destination':function(_0x274301,_0x332bf4,_0x36eabf){_0x36eabf(null,path[_0x93a8('0x18')](config[_0x93a8('0x19')],_0x93a8('0x1a')));},'filename':function(_0x3c3878,_0x48dd63,_0x39789e){_0x39789e(null,util[_0x93a8('0x1b')](_0x93a8('0x1c'),Date['now'](),_0x48dd63[_0x93a8('0x1d')][_0x93a8('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x93a8('0x1f')](_0x93a8('0x20'),upload['single'](_0x93a8('0x21')),controller[_0x93a8('0x22')]);router[_0x93a8('0x1f')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x93a8('0x23')]);router['post']('/:id/tags',auth[_0x93a8('0xa')](),interaction[_0x93a8('0x24')]('chat',_0x93a8('0x25')),controller['addTags']);router[_0x93a8('0x26')](_0x93a8('0xc'),auth[_0x93a8('0xa')](),interaction[_0x93a8('0x24')](_0x93a8('0x27'),_0x93a8('0x28')),controller[_0x93a8('0x29')]);router[_0x93a8('0x26')](_0x93a8('0x2a'),controller[_0x93a8('0x2b')]);router[_0x93a8('0x26')]('/:id/abandon',auth[_0x93a8('0xd')](),controller['abandon']);router['put'](_0x93a8('0x2c'),controller[_0x93a8('0x2d')]);router[_0x93a8('0x2e')]('/:id',auth[_0x93a8('0xa')](),interaction[_0x93a8('0x24')](_0x93a8('0x27'),_0x93a8('0x2f')),controller[_0x93a8('0x30')]);router[_0x93a8('0x2e')](_0x93a8('0x31'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x32')]);module[_0x93a8('0x33')]=router;
\ No newline at end of file
+var _0x4050=['tracked','chatinteraction:destroy','destroy','removeTags','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete'];(function(_0x315585,_0x1acf90){var _0x2d9542=function(_0x531ce8){while(--_0x531ce8){_0x315585['push'](_0x315585['shift']());}};_0x2d9542(++_0x1acf90);}(_0x4050,0x193));var _0x0405=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x4050[_0x3f5dca];return _0x5b833a;};'use strict';var multer=require(_0x0405('0x0'));var util=require(_0x0405('0x1'));var path=require(_0x0405('0x2'));var timeout=require('connect-timeout');var express=require(_0x0405('0x3'));var router=express['Router']();var fs_extra=require(_0x0405('0x4'));var auth=require(_0x0405('0x5'));var interaction=require(_0x0405('0x6'));var config=require(_0x0405('0x7'));var controller=require(_0x0405('0x8'));router[_0x0405('0x9')]('/',auth[_0x0405('0xa')](),controller[_0x0405('0xb')]);router[_0x0405('0x9')](_0x0405('0xc'),auth[_0x0405('0xa')](),controller[_0x0405('0xd')]);router[_0x0405('0x9')](_0x0405('0xe'),auth[_0x0405('0xf')](),controller[_0x0405('0x10')]);router[_0x0405('0x9')](_0x0405('0x11'),auth[_0x0405('0xf')](),controller[_0x0405('0x12')]);router[_0x0405('0x9')](_0x0405('0x13'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0405('0x9')](_0x0405('0x14'),auth[_0x0405('0xf')](),controller['getMyMessages']);router[_0x0405('0x9')]('/:id/download',auth[_0x0405('0xa')](),controller[_0x0405('0x15')]);router['post']('/',auth[_0x0405('0xa')](),controller[_0x0405('0x16')]);router[_0x0405('0x17')](_0x0405('0x18'),auth[_0x0405('0xa')](),controller[_0x0405('0x19')]);var upload=multer({'storage':multer[_0x0405('0x1a')]({'destination':function(_0x607fe5,_0x8bee71,_0x4cd34c){_0x4cd34c(null,path[_0x0405('0x1b')](config[_0x0405('0x1c')],_0x0405('0x1d')));},'filename':function(_0x35e1c8,_0x3dfc44,_0x4271e0){_0x4271e0(null,util[_0x0405('0x1e')](_0x0405('0x1f'),Date[_0x0405('0x20')](),_0x3dfc44[_0x0405('0x21')][_0x0405('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0405('0x17')](_0x0405('0x23'),upload[_0x0405('0x24')](_0x0405('0x25')),controller[_0x0405('0x26')]);router['post']('/:id/messages',auth[_0x0405('0xf')](),controller[_0x0405('0x27')]);router['post'](_0x0405('0x28'),auth['isAuthenticated'](),interaction['tracked'](_0x0405('0x29'),_0x0405('0x2a')),controller[_0x0405('0x2b')]);router[_0x0405('0x2c')](_0x0405('0xe'),auth[_0x0405('0xa')](),interaction['tracked'](_0x0405('0x29'),_0x0405('0x2d')),controller[_0x0405('0x2e')]);router[_0x0405('0x2c')](_0x0405('0x2f'),controller[_0x0405('0x30')]);router[_0x0405('0x2c')]('/:id/abandon',auth[_0x0405('0xf')](),controller[_0x0405('0x31')]);router[_0x0405('0x2c')](_0x0405('0x32'),controller[_0x0405('0x33')]);router[_0x0405('0x34')](_0x0405('0xe'),auth[_0x0405('0xa')](),interaction[_0x0405('0x35')](_0x0405('0x29'),_0x0405('0x36')),controller[_0x0405('0x37')]);router['delete'](_0x0405('0x28'),auth[_0x0405('0xa')](),controller[_0x0405('0x38')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 4a7e9cd..96d902d 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 _0xc0a5=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x39db05,_0x3868d0){var _0x3f0e22=function(_0x532c4f){while(--_0x532c4f){_0x39db05['push'](_0x39db05['shift']());}};_0x3f0e22(++_0x3868d0);}(_0xc0a5,0x1e0));var _0x5c0a=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xc0a5[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x5c0a('0x0'));module[_0x5c0a('0x1')]={'body':{'type':Sequelize[_0x5c0a('0x2')](_0x5c0a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5c0a('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5c0a('0x5')]}};
\ No newline at end of file
+var _0x8df1=['medium','BOOLEAN','sequelize','TEXT'];(function(_0x158bbc,_0x56cba7){var _0x4b7f70=function(_0x1204f0){while(--_0x1204f0){_0x158bbc['push'](_0x158bbc['shift']());}};_0x4b7f70(++_0x56cba7);}(_0x8df1,0xe6));var _0x18df=function(_0x29bafa,_0x1f0f42){_0x29bafa=_0x29bafa-0x0;var _0x3c76d4=_0x8df1[_0x29bafa];return _0x3c76d4;};'use strict';var Sequelize=require(_0x18df('0x0'));module['exports']={'body':{'type':Sequelize[_0x18df('0x1')](_0x18df('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x18df('0x3')],'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 e1dd9da..31e3d2e 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 _0x5b81=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','localhost','redis','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','end','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x48d2f6,_0x27d596){var _0x219dba=function(_0x6d0dff){while(--_0x6d0dff){_0x48d2f6['push'](_0x48d2f6['shift']());}};_0x219dba(++_0x27d596);}(_0x5b81,0x65));var _0x15b8=function(_0x168600,_0x592ff9){_0x168600=_0x168600-0x0;var _0x36d379=_0x5b81[_0x168600];return _0x36d379;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15b8('0x0'));var zipdir=require(_0x15b8('0x1'));var jsonpatch=require(_0x15b8('0x2'));var rp=require(_0x15b8('0x3'));var moment=require(_0x15b8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15b8('0x5'));var path=require(_0x15b8('0x6'));var sox=require(_0x15b8('0x7'));var csv=require(_0x15b8('0x8'));var ejs=require(_0x15b8('0x9'));var fs=require('fs');var fs_extra=require(_0x15b8('0xa'));var _=require(_0x15b8('0xb'));var squel=require(_0x15b8('0xc'));var crypto=require(_0x15b8('0xd'));var jsforce=require(_0x15b8('0xe'));var deskjs=require(_0x15b8('0xf'));var toCsv=require(_0x15b8('0x8'));var querystring=require(_0x15b8('0x10'));var Papa=require(_0x15b8('0x11'));var Redis=require(_0x15b8('0x12'));var authService=require(_0x15b8('0x13'));var qs=require(_0x15b8('0x14'));var as=require(_0x15b8('0x15'));var hardwareService=require(_0x15b8('0x16'));var logger=require(_0x15b8('0x17'))(_0x15b8('0x18'));var utils=require(_0x15b8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x15b8('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x15b8('0x1b')](config['redis'],{'host':_0x15b8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x15b8('0x1d')]));require(_0x15b8('0x1e'))[_0x15b8('0x1f')](socket);function respondWithStatusCode(_0x561ab6,_0x261018){_0x261018=_0x261018||0xcc;return function(_0x335752){if(_0x335752){return _0x561ab6[_0x15b8('0x20')](_0x261018);}return _0x561ab6['status'](_0x261018)['end']();};}function respondWithResult(_0xccc4af,_0x5679fa){_0x5679fa=_0x5679fa||0xc8;return function(_0x3fa648){if(_0x3fa648){return _0xccc4af[_0x15b8('0x21')](_0x5679fa)[_0x15b8('0x22')](_0x3fa648);}};}function respondWithFilteredResult(_0x4e1f7,_0x34c3c8){return function(_0x4d4c56){if(_0x4d4c56){var _0x2285f4=typeof _0x34c3c8['offset']===_0x15b8('0x23')&&typeof _0x34c3c8[_0x15b8('0x24')]==='undefined';var _0x2e55d8=_0x4d4c56[_0x15b8('0x25')];var _0x23aa13=_0x2285f4?0x0:_0x34c3c8[_0x15b8('0x26')];var _0x566d82=_0x2285f4?_0x4d4c56[_0x15b8('0x25')]:_0x34c3c8[_0x15b8('0x26')]+_0x34c3c8[_0x15b8('0x24')];var _0x390d84;if(_0x566d82>=_0x2e55d8){_0x566d82=_0x2e55d8;_0x390d84=0xc8;}else{_0x390d84=0xce;}_0x4e1f7['status'](_0x390d84);return _0x4e1f7['set'](_0x15b8('0x27'),_0x23aa13+'-'+_0x566d82+'/'+_0x2e55d8)[_0x15b8('0x22')](_0x4d4c56);}return null;};}function patchUpdates(_0x1c50fd){return function(_0x25a69e){try{jsonpatch[_0x15b8('0x28')](_0x25a69e,_0x1c50fd,!![]);}catch(_0x33b81f){return BPromise['reject'](_0x33b81f);}return _0x25a69e[_0x15b8('0x29')]();};}function saveUpdates(_0xf274c0,_0x4585c5){return function(_0x2aff5a){if(_0x2aff5a){return _0x2aff5a['update'](_0xf274c0)[_0x15b8('0x2a')](function(_0x2f09df){return _0x2f09df;});}return null;};}function removeEntity(_0x253ee6,_0x11c081){return function(_0x11c8b9){if(_0x11c8b9){return _0x11c8b9['destroy']()[_0x15b8('0x2a')](function(){_0x253ee6[_0x15b8('0x21')](0xcc)[_0x15b8('0x2b')]();});}};}function handleEntityNotFound(_0x2f61d3,_0x141729){return function(_0x141a20){if(!_0x141a20){_0x2f61d3[_0x15b8('0x20')](0x194);}return _0x141a20;};}function handleError(_0x2c7e7a,_0x236a42){_0x236a42=_0x236a42||0x1f4;return function(_0x4a8a23){logger[_0x15b8('0x2c')](_0x4a8a23[_0x15b8('0x2d')]);if(_0x4a8a23[_0x15b8('0x2e')]){delete _0x4a8a23['name'];}_0x2c7e7a[_0x15b8('0x21')](_0x236a42)[_0x15b8('0x2f')](_0x4a8a23);};}exports[_0x15b8('0x30')]=function(_0xab3c99,_0x6a074b){var _0x3a77fc={},_0x1f091f={},_0x220f96={'count':0x0,'rows':[]};var _0x2c1356=_[_0x15b8('0x31')](db[_0x15b8('0x32')][_0x15b8('0x33')],function(_0x5ec7c8){return{'name':_0x5ec7c8[_0x15b8('0x34')],'type':_0x5ec7c8[_0x15b8('0x35')][_0x15b8('0x36')]};});_0x1f091f['model']=_[_0x15b8('0x31')](_0x2c1356,_0x15b8('0x2e'));_0x1f091f[_0x15b8('0x37')]=_['keys'](_0xab3c99[_0x15b8('0x37')]);_0x1f091f[_0x15b8('0x38')]=_[_0x15b8('0x39')](_0x1f091f[_0x15b8('0x3a')],_0x1f091f[_0x15b8('0x37')]);_0x3a77fc['attributes']=_[_0x15b8('0x39')](_0x1f091f['model'],qs[_0x15b8('0x3b')](_0xab3c99[_0x15b8('0x37')]['fields']));_0x3a77fc[_0x15b8('0x3c')]=_0x3a77fc[_0x15b8('0x3c')][_0x15b8('0x3d')]?_0x3a77fc[_0x15b8('0x3c')]:_0x1f091f[_0x15b8('0x3a')];if(!_0xab3c99[_0x15b8('0x37')][_0x15b8('0x3e')]('nolimit')){_0x3a77fc[_0x15b8('0x24')]=qs[_0x15b8('0x24')](_0xab3c99[_0x15b8('0x37')]['limit']);_0x3a77fc[_0x15b8('0x26')]=qs[_0x15b8('0x26')](_0xab3c99['query'][_0x15b8('0x26')]);}_0x3a77fc[_0x15b8('0x3f')]=qs['sort'](_0xab3c99[_0x15b8('0x37')][_0x15b8('0x40')]);_0x3a77fc[_0x15b8('0x41')]=qs[_0x15b8('0x38')](_['pick'](_0xab3c99[_0x15b8('0x37')],_0x1f091f[_0x15b8('0x38')]),_0x2c1356);if(_0xab3c99['query'][_0x15b8('0x42')]){_0x3a77fc['where']=_['merge'](_0x3a77fc[_0x15b8('0x41')],{'$or':_[_0x15b8('0x31')](_0x2c1356,function(_0x42a177){if(_0x42a177[_0x15b8('0x35')]!=='VIRTUAL'){var _0x21cd70={};_0x21cd70[_0x42a177[_0x15b8('0x2e')]]={'$like':'%'+_0xab3c99[_0x15b8('0x37')]['filter']+'%'};return _0x21cd70;}})});}_0x3a77fc=_[_0x15b8('0x43')]({},_0x3a77fc,_0xab3c99['options']);var _0xe8b617={'where':_0x3a77fc['where']};return db['ChatInternalMessage'][_0x15b8('0x25')](_0xe8b617)[_0x15b8('0x2a')](function(_0x440192){_0x220f96[_0x15b8('0x25')]=_0x440192;if(_0xab3c99[_0x15b8('0x37')]['includeAll']){_0x3a77fc[_0x15b8('0x44')]=[{'all':!![]}];}return db[_0x15b8('0x32')][_0x15b8('0x45')](_0x3a77fc);})[_0x15b8('0x2a')](function(_0x43f006){_0x220f96[_0x15b8('0x46')]=_0x43f006;return _0x220f96;})[_0x15b8('0x2a')](respondWithFilteredResult(_0x6a074b,_0x3a77fc))[_0x15b8('0x47')](handleError(_0x6a074b,null));};exports[_0x15b8('0x48')]=function(_0x19399d,_0x3b4d20){var _0x55a787={'raw':!![],'where':{'id':_0x19399d[_0x15b8('0x49')]['id']}},_0xc691f8={};_0xc691f8[_0x15b8('0x3a')]=_['keys'](db[_0x15b8('0x32')]['rawAttributes']);_0xc691f8[_0x15b8('0x37')]=_[_0x15b8('0x4a')](_0x19399d['query']);_0xc691f8[_0x15b8('0x38')]=_['intersection'](_0xc691f8[_0x15b8('0x3a')],_0xc691f8['query']);_0x55a787[_0x15b8('0x3c')]=_['intersection'](_0xc691f8[_0x15b8('0x3a')],qs[_0x15b8('0x3b')](_0x19399d[_0x15b8('0x37')]['fields']));_0x55a787[_0x15b8('0x3c')]=_0x55a787[_0x15b8('0x3c')][_0x15b8('0x3d')]?_0x55a787[_0x15b8('0x3c')]:_0xc691f8[_0x15b8('0x3a')];if(_0x19399d[_0x15b8('0x37')][_0x15b8('0x4b')]){_0x55a787[_0x15b8('0x44')]=[{'all':!![]}];}_0x55a787=_[_0x15b8('0x43')]({},_0x55a787,_0x19399d['options']);return db[_0x15b8('0x32')][_0x15b8('0x4c')](_0x55a787)[_0x15b8('0x2a')](handleEntityNotFound(_0x3b4d20,null))[_0x15b8('0x2a')](respondWithResult(_0x3b4d20,null))[_0x15b8('0x47')](handleError(_0x3b4d20,null));};exports[_0x15b8('0x4d')]=function(_0x4ff971,_0x184ddd){return db['ChatInternalMessage'][_0x15b8('0x4d')](_0x4ff971[_0x15b8('0x4e')],{})['then'](respondWithResult(_0x184ddd,0xc9))[_0x15b8('0x47')](handleError(_0x184ddd,null));};exports['update']=function(_0x914da9,_0x4c933b){if(_0x914da9[_0x15b8('0x4e')]['id']){delete _0x914da9['body']['id'];}return db['ChatInternalMessage'][_0x15b8('0x4c')]({'where':{'id':_0x914da9['params']['id']}})['then'](handleEntityNotFound(_0x4c933b,null))[_0x15b8('0x2a')](saveUpdates(_0x914da9['body'],null))[_0x15b8('0x2a')](respondWithResult(_0x4c933b,null))[_0x15b8('0x47')](handleError(_0x4c933b,null));};exports[_0x15b8('0x4f')]=function(_0x992156,_0x208933){return db[_0x15b8('0x32')][_0x15b8('0x4c')]({'where':{'id':_0x992156['params']['id']}})['then'](handleEntityNotFound(_0x208933,null))[_0x15b8('0x2a')](removeEntity(_0x208933,null))[_0x15b8('0x47')](handleError(_0x208933,null));};exports[_0x15b8('0x50')]=function(_0x2a06e1,_0x4e53f6){return db[_0x15b8('0x32')][_0x15b8('0x50')]()['then'](respondWithResult(_0x4e53f6,null))[_0x15b8('0x47')](handleError(_0x4e53f6,null));};function wrapUser(_0x111df3){return function(_0x29ff0f){var _0x17d00c=_0x111df3[_0x15b8('0x51')]({'plain':!![]});_0x17d00c[_0x15b8('0x52')]=[];if(_0x29ff0f){_0x17d00c['lastMessageAt']=_0x29ff0f[_0x15b8('0x53')];_0x17d00c[_0x15b8('0x54')]=_0x29ff0f;}else{_0x17d00c[_0x15b8('0x55')]=moment(0x0)[_0x15b8('0x56')](_0x15b8('0x57'));_0x17d00c[_0x15b8('0x54')]={};}return _0x17d00c;};}exports[_0x15b8('0x58')]=function(_0x22cfdc,_0x226cf8,_0x5bfdea){var _0x2a416d=[];return db[_0x15b8('0x59')][_0x15b8('0x45')]({'where':{'role':[_0x15b8('0x5a'),_0x15b8('0x5b'),_0x15b8('0x5c')]},'attributes':['id',_0x15b8('0x5d'),_0x15b8('0x2e'),_0x15b8('0x5e'),_0x15b8('0x5f'),'internal',_0x15b8('0x60'),_0x15b8('0x61'),_0x15b8('0x62'),_0x15b8('0x63')],'order':qs[_0x15b8('0x40')](_0x15b8('0x64')),'include':[{'model':db[_0x15b8('0x65')],'as':_0x15b8('0x66'),'attributes':['id',_0x15b8('0x2e'),_0x15b8('0x35')],'through':{'attributes':[]}}]})[_0x15b8('0x2a')](function(_0x54b438){if(_0x54b438){var _0x12ea7d=_0x22cfdc[_0x15b8('0x5c')][_0x15b8('0x51')]({'plain':!![]});if(!_0x12ea7d)throw new Error(_0x15b8('0x67'));if(_0x12ea7d[_0x15b8('0x5e')]===_0x15b8('0x5c')){return db['UserProfileSection'][_0x15b8('0x4c')]({'where':{'name':_0x15b8('0x68'),'userProfileId':_0x12ea7d[_0x15b8('0x69')]},'raw':!![]})[_0x15b8('0x2a')](function(_0xc543dd){if(_0xc543dd){if(_0xc543dd['autoAssociation']===0x0){return db[_0x15b8('0x6a')]['findAll']({'where':{'sectionId':_0xc543dd['id']},'raw':!![]})['then'](function(_0x51412b){var _0x2da23f=[];if(_[_0x15b8('0x6b')](_0x51412b)){_0x2da23f=_[_0x15b8('0x42')](_0x54b438,function(_0x131eaa){if(_0x131eaa[_0x15b8('0x5e')]!==_0x15b8('0x5a')){return _0x131eaa;}});return _0x2da23f;}else{for(var _0x22c9a9=0x0;_0x22c9a9<_0x54b438[_0x15b8('0x3d')];_0x22c9a9++){var _0x532ec4=_0x54b438[_0x22c9a9];if(_0x532ec4['role']===_0x15b8('0x5a')){var _0x17d6ee=_[_0x15b8('0x4c')](_0x51412b,function(_0x4a23a3){return _0x4a23a3[_0x15b8('0x6c')]===_0x532ec4['id'];});if(_0x17d6ee)_0x2da23f[_0x15b8('0x6d')](_0x532ec4);}else{_0x2da23f[_0x15b8('0x6d')](_0x532ec4);}}return _0x2da23f;}});}else{return _0x54b438;}}else{var _0x477ae8=_[_0x15b8('0x42')](_0x54b438,function(_0x3ae1c2){if(_0x3ae1c2['role']!==_0x15b8('0x5a')){return _0x3ae1c2;}});return _0x477ae8;}});}else{return _0x54b438;}}})[_0x15b8('0x2a')](function(_0x1c2a4e){var _0x2442c8=[];if(_0x1c2a4e){_0x2a416d=_0x1c2a4e;for(var _0x5b7fef=0x0;_0x5b7fef<_0x1c2a4e[_0x15b8('0x3d')];_0x5b7fef+=0x1){_0x2a416d[_0x5b7fef]['messages']=[];_0x2442c8[_0x15b8('0x6d')](db[_0x15b8('0x32')][_0x15b8('0x4c')]({'where':{'FromId':[_0x22cfdc[_0x15b8('0x5c')]['id'],_0x1c2a4e[_0x5b7fef]['id']],'ToId':[_0x22cfdc[_0x15b8('0x5c')]['id'],_0x1c2a4e[_0x5b7fef]['id']],'ChatGroupId':null},'attributes':['id',_0x15b8('0x53'),_0x15b8('0x6e'),_0x15b8('0x6f'),_0x15b8('0x70'),'body'],'order':qs[_0x15b8('0x40')](_0x15b8('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x15b8('0x2a')](wrapUser(_0x1c2a4e[_0x5b7fef])));}return BPromise['all'](_0x2442c8);}return[];})[_0x15b8('0x2a')](function(_0x3cacc1){return{'rows':_0x3cacc1,'count':_0x3cacc1['length']};})[_0x15b8('0x2a')](respondWithResult(_0x226cf8,null))[_0x15b8('0x47')](handleError(_0x226cf8,null));};
\ No newline at end of file
+var _0xdce3=['map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','include','findAll','catch','params','keys','ChatInternalMessage','includeAll','create','body','update','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','isEmpty','agent','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','set','apply','reject','save','then','error','stack','name','send','index','rawAttributes','type','key','model'];(function(_0x113a7b,_0x3d8bae){var _0xa6fedf=function(_0x57f7a2){while(--_0x57f7a2){_0x113a7b['push'](_0x113a7b['shift']());}};_0xa6fedf(++_0x3d8bae);}(_0xdce3,0x1f0));var _0x3dce=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdce3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3dce('0x0'));var rimraf=require(_0x3dce('0x1'));var zipdir=require(_0x3dce('0x2'));var jsonpatch=require(_0x3dce('0x3'));var rp=require(_0x3dce('0x4'));var moment=require(_0x3dce('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3dce('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3dce('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3dce('0x8'));var _=require(_0x3dce('0x9'));var squel=require('squel');var crypto=require(_0x3dce('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3dce('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3dce('0xc'));var Papa=require(_0x3dce('0xd'));var Redis=require(_0x3dce('0xe'));var authService=require(_0x3dce('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3dce('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3dce('0x11'))('api');var utils=require(_0x3dce('0x12'));var config=require(_0x3dce('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3dce('0x14'))['db'];config['redis']=_[_0x3dce('0x15')](config['redis'],{'host':_0x3dce('0x16'),'port':0x18eb});var socket=require(_0x3dce('0x17'))(new Redis(config[_0x3dce('0x18')]));require(_0x3dce('0x19'))[_0x3dce('0x1a')](socket);function respondWithStatusCode(_0x42c56d,_0x545f79){_0x545f79=_0x545f79||0xcc;return function(_0x50ca7f){if(_0x50ca7f){return _0x42c56d[_0x3dce('0x1b')](_0x545f79);}return _0x42c56d['status'](_0x545f79)[_0x3dce('0x1c')]();};}function respondWithResult(_0x45efab,_0x4d29de){_0x4d29de=_0x4d29de||0xc8;return function(_0x57b445){if(_0x57b445){return _0x45efab['status'](_0x4d29de)[_0x3dce('0x1d')](_0x57b445);}};}function respondWithFilteredResult(_0x37e8c4,_0x26ce8b){return function(_0x553fd2){if(_0x553fd2){var _0x3758d0=typeof _0x26ce8b['offset']==='undefined'&&typeof _0x26ce8b[_0x3dce('0x1e')]===_0x3dce('0x1f');var _0x382bcd=_0x553fd2[_0x3dce('0x20')];var _0x16f7a1=_0x3758d0?0x0:_0x26ce8b[_0x3dce('0x21')];var _0x3bc9dd=_0x3758d0?_0x553fd2[_0x3dce('0x20')]:_0x26ce8b['offset']+_0x26ce8b[_0x3dce('0x1e')];var _0x55b532;if(_0x3bc9dd>=_0x382bcd){_0x3bc9dd=_0x382bcd;_0x55b532=0xc8;}else{_0x55b532=0xce;}_0x37e8c4[_0x3dce('0x22')](_0x55b532);return _0x37e8c4[_0x3dce('0x23')]('Content-Range',_0x16f7a1+'-'+_0x3bc9dd+'/'+_0x382bcd)[_0x3dce('0x1d')](_0x553fd2);}return null;};}function patchUpdates(_0x118da3){return function(_0x43ec82){try{jsonpatch[_0x3dce('0x24')](_0x43ec82,_0x118da3,!![]);}catch(_0x519a1b){return BPromise[_0x3dce('0x25')](_0x519a1b);}return _0x43ec82[_0x3dce('0x26')]();};}function saveUpdates(_0x190450,_0x5d2039){return function(_0x4d59e8){if(_0x4d59e8){return _0x4d59e8['update'](_0x190450)[_0x3dce('0x27')](function(_0x3be493){return _0x3be493;});}return null;};}function removeEntity(_0x32d306,_0x1a9c4a){return function(_0x33fd99){if(_0x33fd99){return _0x33fd99['destroy']()['then'](function(){_0x32d306[_0x3dce('0x22')](0xcc)[_0x3dce('0x1c')]();});}};}function handleEntityNotFound(_0x36842a,_0x539cba){return function(_0x3ec2e3){if(!_0x3ec2e3){_0x36842a[_0x3dce('0x1b')](0x194);}return _0x3ec2e3;};}function handleError(_0x537fe2,_0x3991df){_0x3991df=_0x3991df||0x1f4;return function(_0x2e93dd){logger[_0x3dce('0x28')](_0x2e93dd[_0x3dce('0x29')]);if(_0x2e93dd[_0x3dce('0x2a')]){delete _0x2e93dd[_0x3dce('0x2a')];}_0x537fe2['status'](_0x3991df)[_0x3dce('0x2b')](_0x2e93dd);};}exports[_0x3dce('0x2c')]=function(_0x50ad15,_0x35cb15){var _0x38ccf9={},_0x15d2ac={},_0x29bfad={'count':0x0,'rows':[]};var _0x1490b3=_['map'](db['ChatInternalMessage'][_0x3dce('0x2d')],function(_0x394c6f){return{'name':_0x394c6f['fieldName'],'type':_0x394c6f[_0x3dce('0x2e')][_0x3dce('0x2f')]};});_0x15d2ac[_0x3dce('0x30')]=_[_0x3dce('0x31')](_0x1490b3,_0x3dce('0x2a'));_0x15d2ac['query']=_['keys'](_0x50ad15[_0x3dce('0x32')]);_0x15d2ac['filters']=_['intersection'](_0x15d2ac[_0x3dce('0x30')],_0x15d2ac[_0x3dce('0x32')]);_0x38ccf9[_0x3dce('0x33')]=_[_0x3dce('0x34')](_0x15d2ac[_0x3dce('0x30')],qs[_0x3dce('0x35')](_0x50ad15['query'][_0x3dce('0x35')]));_0x38ccf9['attributes']=_0x38ccf9[_0x3dce('0x33')][_0x3dce('0x36')]?_0x38ccf9[_0x3dce('0x33')]:_0x15d2ac[_0x3dce('0x30')];if(!_0x50ad15[_0x3dce('0x32')][_0x3dce('0x37')](_0x3dce('0x38'))){_0x38ccf9[_0x3dce('0x1e')]=qs['limit'](_0x50ad15[_0x3dce('0x32')]['limit']);_0x38ccf9['offset']=qs[_0x3dce('0x21')](_0x50ad15[_0x3dce('0x32')][_0x3dce('0x21')]);}_0x38ccf9[_0x3dce('0x39')]=qs[_0x3dce('0x3a')](_0x50ad15['query'][_0x3dce('0x3a')]);_0x38ccf9['where']=qs[_0x3dce('0x3b')](_[_0x3dce('0x3c')](_0x50ad15[_0x3dce('0x32')],_0x15d2ac[_0x3dce('0x3b')]),_0x1490b3);if(_0x50ad15[_0x3dce('0x32')][_0x3dce('0x3d')]){_0x38ccf9[_0x3dce('0x3e')]=_['merge'](_0x38ccf9[_0x3dce('0x3e')],{'$or':_[_0x3dce('0x31')](_0x1490b3,function(_0x2c5254){if(_0x2c5254[_0x3dce('0x2e')]!==_0x3dce('0x3f')){var _0x12102d={};_0x12102d[_0x2c5254[_0x3dce('0x2a')]]={'$like':'%'+_0x50ad15[_0x3dce('0x32')][_0x3dce('0x3d')]+'%'};return _0x12102d;}})});}_0x38ccf9=_[_0x3dce('0x40')]({},_0x38ccf9,_0x50ad15['options']);var _0x10f05b={'where':_0x38ccf9[_0x3dce('0x3e')]};return db['ChatInternalMessage'][_0x3dce('0x20')](_0x10f05b)['then'](function(_0x570fae){_0x29bfad[_0x3dce('0x20')]=_0x570fae;if(_0x50ad15['query']['includeAll']){_0x38ccf9[_0x3dce('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x3dce('0x42')](_0x38ccf9);})[_0x3dce('0x27')](function(_0x159019){_0x29bfad['rows']=_0x159019;return _0x29bfad;})[_0x3dce('0x27')](respondWithFilteredResult(_0x35cb15,_0x38ccf9))[_0x3dce('0x43')](handleError(_0x35cb15,null));};exports['show']=function(_0x52ad27,_0x35a6d4){var _0x1db8a0={'raw':!![],'where':{'id':_0x52ad27[_0x3dce('0x44')]['id']}},_0x304335={};_0x304335[_0x3dce('0x30')]=_[_0x3dce('0x45')](db[_0x3dce('0x46')][_0x3dce('0x2d')]);_0x304335[_0x3dce('0x32')]=_['keys'](_0x52ad27[_0x3dce('0x32')]);_0x304335['filters']=_[_0x3dce('0x34')](_0x304335[_0x3dce('0x30')],_0x304335[_0x3dce('0x32')]);_0x1db8a0[_0x3dce('0x33')]=_[_0x3dce('0x34')](_0x304335[_0x3dce('0x30')],qs[_0x3dce('0x35')](_0x52ad27[_0x3dce('0x32')]['fields']));_0x1db8a0[_0x3dce('0x33')]=_0x1db8a0[_0x3dce('0x33')]['length']?_0x1db8a0[_0x3dce('0x33')]:_0x304335[_0x3dce('0x30')];if(_0x52ad27[_0x3dce('0x32')][_0x3dce('0x47')]){_0x1db8a0[_0x3dce('0x41')]=[{'all':!![]}];}_0x1db8a0=_[_0x3dce('0x40')]({},_0x1db8a0,_0x52ad27['options']);return db[_0x3dce('0x46')]['find'](_0x1db8a0)['then'](handleEntityNotFound(_0x35a6d4,null))[_0x3dce('0x27')](respondWithResult(_0x35a6d4,null))['catch'](handleError(_0x35a6d4,null));};exports['create']=function(_0x468c6d,_0x5ee469){return db['ChatInternalMessage'][_0x3dce('0x48')](_0x468c6d[_0x3dce('0x49')],{})[_0x3dce('0x27')](respondWithResult(_0x5ee469,0xc9))[_0x3dce('0x43')](handleError(_0x5ee469,null));};exports[_0x3dce('0x4a')]=function(_0x5abab2,_0x12e223){if(_0x5abab2['body']['id']){delete _0x5abab2[_0x3dce('0x49')]['id'];}return db['ChatInternalMessage'][_0x3dce('0x4b')]({'where':{'id':_0x5abab2[_0x3dce('0x44')]['id']}})['then'](handleEntityNotFound(_0x12e223,null))[_0x3dce('0x27')](saveUpdates(_0x5abab2[_0x3dce('0x49')],null))[_0x3dce('0x27')](respondWithResult(_0x12e223,null))[_0x3dce('0x43')](handleError(_0x12e223,null));};exports['destroy']=function(_0xb3a8d4,_0x91d567){return db[_0x3dce('0x46')][_0x3dce('0x4b')]({'where':{'id':_0xb3a8d4[_0x3dce('0x44')]['id']}})[_0x3dce('0x27')](handleEntityNotFound(_0x91d567,null))['then'](removeEntity(_0x91d567,null))['catch'](handleError(_0x91d567,null));};exports[_0x3dce('0x4c')]=function(_0x38f442,_0x5424f8){return db[_0x3dce('0x46')][_0x3dce('0x4c')]()['then'](respondWithResult(_0x5424f8,null))[_0x3dce('0x43')](handleError(_0x5424f8,null));};function wrapUser(_0x115969){return function(_0x225e34){var _0x49b1e6=_0x115969[_0x3dce('0x4d')]({'plain':!![]});_0x49b1e6[_0x3dce('0x4e')]=[];if(_0x225e34){_0x49b1e6[_0x3dce('0x4f')]=_0x225e34[_0x3dce('0x50')];_0x49b1e6[_0x3dce('0x51')]=_0x225e34;}else{_0x49b1e6[_0x3dce('0x4f')]=moment(0x0)[_0x3dce('0x52')](_0x3dce('0x53'));_0x49b1e6[_0x3dce('0x51')]={};}return _0x49b1e6;};}exports[_0x3dce('0x54')]=function(_0x48ab06,_0x5e1c69,_0xaf9aca){var _0x1dfba5=[];return db[_0x3dce('0x55')][_0x3dce('0x42')]({'where':{'role':['agent',_0x3dce('0x56'),'user']},'attributes':['id',_0x3dce('0x57'),_0x3dce('0x2a'),_0x3dce('0x58'),_0x3dce('0x59'),_0x3dce('0x5a'),_0x3dce('0x5b'),_0x3dce('0x5c'),_0x3dce('0x5d'),'showWebBar'],'order':qs['sort'](_0x3dce('0x5e')),'include':[{'model':db[_0x3dce('0x5f')],'as':_0x3dce('0x60'),'attributes':['id',_0x3dce('0x2a'),_0x3dce('0x2e')],'through':{'attributes':[]}}]})[_0x3dce('0x27')](function(_0x19dae0){if(_0x19dae0){var _0x532b54=_0x48ab06[_0x3dce('0x61')][_0x3dce('0x4d')]({'plain':!![]});if(!_0x532b54)throw new Error(_0x3dce('0x62'));if(_0x532b54[_0x3dce('0x58')]===_0x3dce('0x61')){return db['UserProfileSection'][_0x3dce('0x4b')]({'where':{'name':_0x3dce('0x63'),'userProfileId':_0x532b54[_0x3dce('0x64')]},'raw':!![]})['then'](function(_0x3804dc){if(_0x3804dc){if(_0x3804dc[_0x3dce('0x65')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3804dc['id']},'raw':!![]})[_0x3dce('0x27')](function(_0x262d83){var _0x1a6baa=[];if(_[_0x3dce('0x66')](_0x262d83)){_0x1a6baa=_[_0x3dce('0x3d')](_0x19dae0,function(_0x16bec9){if(_0x16bec9['role']!==_0x3dce('0x67')){return _0x16bec9;}});return _0x1a6baa;}else{for(var _0x139617=0x0;_0x139617<_0x19dae0[_0x3dce('0x36')];_0x139617++){var _0x53c9ab=_0x19dae0[_0x139617];if(_0x53c9ab[_0x3dce('0x58')]===_0x3dce('0x67')){var _0x4fabd5=_['find'](_0x262d83,function(_0x31680a){return _0x31680a['resourceId']===_0x53c9ab['id'];});if(_0x4fabd5)_0x1a6baa[_0x3dce('0x68')](_0x53c9ab);}else{_0x1a6baa[_0x3dce('0x68')](_0x53c9ab);}}return _0x1a6baa;}});}else{return _0x19dae0;}}else{var _0x3a9a91=_[_0x3dce('0x3d')](_0x19dae0,function(_0x592fda){if(_0x592fda[_0x3dce('0x58')]!==_0x3dce('0x67')){return _0x592fda;}});return _0x3a9a91;}});}else{return _0x19dae0;}}})[_0x3dce('0x27')](function(_0x3b5050){var _0x523e0a=[];if(_0x3b5050){_0x1dfba5=_0x3b5050;for(var _0x254851=0x0;_0x254851<_0x3b5050['length'];_0x254851+=0x1){_0x1dfba5[_0x254851][_0x3dce('0x4e')]=[];_0x523e0a['push'](db[_0x3dce('0x46')][_0x3dce('0x4b')]({'where':{'FromId':[_0x48ab06[_0x3dce('0x61')]['id'],_0x3b5050[_0x254851]['id']],'ToId':[_0x48ab06[_0x3dce('0x61')]['id'],_0x3b5050[_0x254851]['id']],'ChatGroupId':null},'attributes':['id',_0x3dce('0x50'),_0x3dce('0x69'),_0x3dce('0x6a'),'read',_0x3dce('0x49')],'order':qs[_0x3dce('0x3a')](_0x3dce('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3dce('0x27')](wrapUser(_0x3b5050[_0x254851])));}return BPromise[_0x3dce('0x6c')](_0x523e0a);}return[];})[_0x3dce('0x27')](function(_0x568b3a){return{'rows':_0x568b3a,'count':_0x568b3a[_0x3dce('0x36')]};})[_0x3dce('0x27')](respondWithResult(_0x5e1c69,null))[_0x3dce('0x43')](handleError(_0x5e1c69,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 89c608d..9a26020 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 _0x90ad=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x2a9ec5,_0xed23b){var _0x52c7c0=function(_0x54b22d){while(--_0x54b22d){_0x2a9ec5['push'](_0x2a9ec5['shift']());}};_0x52c7c0(++_0xed23b);}(_0x90ad,0x195));var _0xd90a=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x90ad[_0x550d12];return _0x12103d;};'use strict';var EventEmitter=require(_0xd90a('0x0'));var ChatInternalMessage=require(_0xd90a('0x1'))['db'][_0xd90a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd90a('0x3')](0x0);var events={'afterCreate':_0xd90a('0x4'),'afterUpdate':'update','afterDestroy':_0xd90a('0x5')};function emitEvent(_0x844190){return function(_0x45e9f3,_0x5e9622,_0x2691eb){ChatInternalMessageEvents['emit'](_0x844190+':'+_0x45e9f3['id'],_0x45e9f3);ChatInternalMessageEvents[_0xd90a('0x6')](_0x844190,_0x45e9f3);_0x2691eb(null);};}for(var e in events){if(events[_0xd90a('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xd90a('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xed61=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed61,0x7e));var _0x1ed6=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0xed61[_0xd73d53];return _0x560148;};'use strict';var EventEmitter=require(_0x1ed6('0x0'));var ChatInternalMessage=require(_0x1ed6('0x1'))['db'][_0x1ed6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1ed6('0x3')](0x0);var events={'afterCreate':_0x1ed6('0x4'),'afterUpdate':_0x1ed6('0x5'),'afterDestroy':_0x1ed6('0x6')};function emitEvent(_0x9f07a6){return function(_0x2bf8fb,_0x4f4687,_0x5e4458){ChatInternalMessageEvents[_0x1ed6('0x7')](_0x9f07a6+':'+_0x2bf8fb['id'],_0x2bf8fb);ChatInternalMessageEvents[_0x1ed6('0x7')](_0x9f07a6,_0x2bf8fb);_0x5e4458(null);};}for(var e in events){if(events[_0x1ed6('0x8')](e)){var event=events[e];ChatInternalMessage[_0x1ed6('0x9')](e,emitEvent(event));}}module[_0x1ed6('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 986fd47..44d7e40 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 _0x19ca=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','exports','define'];(function(_0x17bb6a,_0x20cbca){var _0x5346ec=function(_0x1fda6a){while(--_0x1fda6a){_0x17bb6a['push'](_0x17bb6a['shift']());}};_0x5346ec(++_0x20cbca);}(_0x19ca,0xda));var _0xa19c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x19ca[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa19c('0x0'));var logger=require(_0xa19c('0x1'))(_0xa19c('0x2'));var moment=require(_0xa19c('0x3'));var BPromise=require(_0xa19c('0x4'));var rp=require(_0xa19c('0x5'));var fs=require('fs');var path=require(_0xa19c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa19c('0x7'));module[_0xa19c('0x8')]=function(_0x56b94b,_0x4058bc){return _0x56b94b[_0xa19c('0x9')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa19c('0xa'),'collate':_0xa19c('0xb')});};
\ No newline at end of file
+var _0xe136=['../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0xe136,0xd6));var _0x6e13=function(_0x459fee,_0x568ca0){_0x459fee=_0x459fee-0x0;var _0x7ba8e3=_0xe136[_0x459fee];return _0x7ba8e3;};'use strict';var _=require(_0x6e13('0x0'));var util=require(_0x6e13('0x1'));var logger=require('../../config/logger')(_0x6e13('0x2'));var moment=require(_0x6e13('0x3'));var BPromise=require(_0x6e13('0x4'));var rp=require(_0x6e13('0x5'));var fs=require('fs');var path=require(_0x6e13('0x6'));var rimraf=require('rimraf');var config=require(_0x6e13('0x7'));var attributes=require(_0x6e13('0x8'));module[_0x6e13('0x9')]=function(_0x31abfa,_0x6db7fd){return _0x31abfa['define'](_0x6e13('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e13('0xb'),'collate':_0x6e13('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index fb8a455..eec43e7 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 _0x3aca=['stringify','error','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x3aca,0x83));var _0xa3ac=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x3aca[_0x55d8c5];return _0x225ae5;};'use strict';var _=require(_0xa3ac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa3ac('0x1'));var rs=require(_0xa3ac('0x2'));var fs=require('fs');var Redis=require(_0xa3ac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3ac('0x4'));var logger=require(_0xa3ac('0x5'))(_0xa3ac('0x6'));var config=require(_0xa3ac('0x7'));var jayson=require(_0xa3ac('0x8'));var client=jayson['client'][_0xa3ac('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa3ac('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa3ac('0xb'))(new Redis(config[_0xa3ac('0xa')]));require(_0xa3ac('0xc'))[_0xa3ac('0xd')](socket);function respondWithRpcPromise(_0x29f541,_0x5e8f4f,_0x1d3727){return new BPromise(function(_0x3817e3,_0x234168){return client['request'](_0x29f541,_0x1d3727)[_0xa3ac('0xe')](function(_0x9d8ba){logger[_0xa3ac('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0xa3ac('0x10'));logger[_0xa3ac('0x11')](_0xa3ac('0x12'),_0x5e8f4f,_0xa3ac('0x10'),JSON[_0xa3ac('0x13')](_0x9d8ba));if(_0x9d8ba[_0xa3ac('0x14')]){if(_0x9d8ba[_0xa3ac('0x14')]['code']===0x1f4){logger[_0xa3ac('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0x9d8ba['error']['message']);return _0x234168(_0x9d8ba[_0xa3ac('0x14')][_0xa3ac('0x15')]);}logger[_0xa3ac('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0x9d8ba[_0xa3ac('0x14')][_0xa3ac('0x15')]);return _0x3817e3(_0x9d8ba['error'][_0xa3ac('0x15')]);}else{logger[_0xa3ac('0xf')](_0xa3ac('0x16'),_0x5e8f4f,_0xa3ac('0x10'));_0x3817e3(_0x9d8ba[_0xa3ac('0x17')]['message']);}})[_0xa3ac('0x18')](function(_0x1307be){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0x1307be);_0x234168(_0x1307be);});});}
\ No newline at end of file
+var _0xfe6a=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xfe6a,0x16c));var _0xafe6=function(_0x5d2c6c,_0x33e6f5){_0x5d2c6c=_0x5d2c6c-0x0;var _0x4bb774=_0xfe6a[_0x5d2c6c];return _0x4bb774;};'use strict';var _=require(_0xafe6('0x0'));var util=require(_0xafe6('0x1'));var moment=require(_0xafe6('0x2'));var BPromise=require('bluebird');var rs=require(_0xafe6('0x3'));var fs=require('fs');var Redis=require(_0xafe6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xafe6('0x5'));var logger=require(_0xafe6('0x6'))(_0xafe6('0x7'));var config=require(_0xafe6('0x8'));var jayson=require(_0xafe6('0x9'));var client=jayson[_0xafe6('0xa')][_0xafe6('0xb')]({'port':0x232a});config[_0xafe6('0xc')]=_[_0xafe6('0xd')](config['redis'],{'host':_0xafe6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafe6('0xc')]));require(_0xafe6('0xf'))['register'](socket);function respondWithRpcPromise(_0x52ea92,_0xfe2a6e,_0x272cc3){return new BPromise(function(_0x5e3db2,_0x2e2f6a){return client[_0xafe6('0x10')](_0x52ea92,_0x272cc3)[_0xafe6('0x11')](function(_0x7aaac4){logger['info'](_0xafe6('0x12'),_0xfe2a6e,_0xafe6('0x13'));logger['debug'](_0xafe6('0x14'),_0xfe2a6e,_0xafe6('0x13'),JSON['stringify'](_0x7aaac4));if(_0x7aaac4[_0xafe6('0x15')]){if(_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x16')]===0x1f4){logger['error'](_0xafe6('0x12'),_0xfe2a6e,_0x7aaac4[_0xafe6('0x15')]['message']);return _0x2e2f6a(_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x17')]);}logger[_0xafe6('0x15')](_0xafe6('0x12'),_0xfe2a6e,_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x17')]);return _0x5e3db2(_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x17')]);}else{logger[_0xafe6('0x18')](_0xafe6('0x12'),_0xfe2a6e,'request\x20sent');_0x5e3db2(_0x7aaac4[_0xafe6('0x19')]['message']);}})['catch'](function(_0x3bca7a){logger[_0xafe6('0x15')](_0xafe6('0x12'),_0xfe2a6e,_0x3bca7a);_0x2e2f6a(_0x3bca7a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 88802dc..70f24ee 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 _0x252a=['update','emit','chatInternalMessage:','save','remove'];(function(_0x3a07d4,_0xa80b88){var _0x2c352=function(_0x27926b){while(--_0x27926b){_0x3a07d4['push'](_0x3a07d4['shift']());}};_0x2c352(++_0xa80b88);}(_0x252a,0x8f));var _0xa252=function(_0xd361b3,_0x3c7724){_0xd361b3=_0xd361b3-0x0;var _0x59a458=_0x252a[_0xd361b3];return _0x59a458;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xa252('0x0'),_0xa252('0x1'),_0xa252('0x2')];function createListener(_0x7f85fd,_0x43f243){return function(_0x938ae1){_0x43f243[_0xa252('0x3')](_0x7f85fd,_0x938ae1);};}function removeListener(_0x1b4a83,_0x24c27a){return function(){ChatInternalMessageEvents['removeListener'](_0x1b4a83,_0x24c27a);};}exports['register']=function(_0x1d16d7){for(var _0x28de3d=0x0,_0x43df42=events['length'];_0x28de3d<_0x43df42;_0x28de3d++){var _0x5648da=events[_0x28de3d];var _0x54c7a1=createListener(_0xa252('0x4')+_0x5648da,_0x1d16d7);ChatInternalMessageEvents['on'](_0x5648da,_0x54c7a1);}};
\ No newline at end of file
+var _0x56e8=['remove','emit','register','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x5a8cb8,_0x4fb918){var _0xa5d455=function(_0x1ab326){while(--_0x1ab326){_0x5a8cb8['push'](_0x5a8cb8['shift']());}};_0xa5d455(++_0x4fb918);}(_0x56e8,0x184));var _0x856e=function(_0x5e6966,_0x985401){_0x5e6966=_0x5e6966-0x0;var _0x5409f2=_0x56e8[_0x5e6966];return _0x5409f2;};'use strict';var ChatInternalMessageEvents=require(_0x856e('0x0'));var events=[_0x856e('0x1'),_0x856e('0x2'),'update'];function createListener(_0x9d8f4e,_0x5899a9){return function(_0x29a139){_0x5899a9[_0x856e('0x3')](_0x9d8f4e,_0x29a139);};}function removeListener(_0x3a2890,_0x16b044){return function(){ChatInternalMessageEvents['removeListener'](_0x3a2890,_0x16b044);};}exports[_0x856e('0x4')]=function(_0x771474){for(var _0x5143f3=0x0,_0x436cff=events['length'];_0x5143f3<_0x436cff;_0x5143f3++){var _0x56f66f=events[_0x5143f3];var _0x5ec70c=createListener(_0x856e('0x5')+_0x56f66f,_0x771474);ChatInternalMessageEvents['on'](_0x56f66f,_0x5ec70c);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index e427d20..383bbfe 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 _0x0c99=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','post'];(function(_0x429b8c,_0xa0de50){var _0x5033dc=function(_0x1c612f){while(--_0x1c612f){_0x429b8c['push'](_0x429b8c['shift']());}};_0x5033dc(++_0xa0de50);}(_0x0c99,0x186));var _0x90c9=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x0c99[_0x26b5ff];return _0x58603e;};'use strict';var multer=require(_0x90c9('0x0'));var util=require('util');var path=require(_0x90c9('0x1'));var timeout=require(_0x90c9('0x2'));var express=require(_0x90c9('0x3'));var router=express[_0x90c9('0x4')]();var fs_extra=require(_0x90c9('0x5'));var auth=require(_0x90c9('0x6'));var interaction=require(_0x90c9('0x7'));var config=require(_0x90c9('0x8'));var controller=require(_0x90c9('0x9'));router[_0x90c9('0xa')]('/',auth[_0x90c9('0xb')](),controller[_0x90c9('0xc')]);router['get'](_0x90c9('0xd'),auth['isAuthenticated'](),controller[_0x90c9('0xe')]);router[_0x90c9('0xa')](_0x90c9('0xf'),auth['isAuthenticated'](),controller['getUsers']);router[_0x90c9('0xa')](_0x90c9('0x10'),auth[_0x90c9('0xb')](),controller['show']);router[_0x90c9('0x11')]('/',auth[_0x90c9('0xb')](),controller[_0x90c9('0x12')]);router[_0x90c9('0x13')](_0x90c9('0x10'),controller[_0x90c9('0x14')]);router[_0x90c9('0x15')](_0x90c9('0x10'),auth[_0x90c9('0xb')](),controller[_0x90c9('0x16')]);module[_0x90c9('0x17')]=router;
\ No newline at end of file
+var _0x74be=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x58ef68,_0x275204){var _0x169a7f=function(_0x479c79){while(--_0x479c79){_0x58ef68['push'](_0x58ef68['shift']());}};_0x169a7f(++_0x275204);}(_0x74be,0xd7));var _0xe74b=function(_0x596496,_0x57a567){_0x596496=_0x596496-0x0;var _0x5f0acd=_0x74be[_0x596496];return _0x5f0acd;};'use strict';var multer=require('multer');var util=require(_0xe74b('0x0'));var path=require('path');var timeout=require(_0xe74b('0x1'));var express=require(_0xe74b('0x2'));var router=express[_0xe74b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe74b('0x4'));var interaction=require(_0xe74b('0x5'));var config=require(_0xe74b('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xe74b('0x7')]('/',auth[_0xe74b('0x8')](),controller[_0xe74b('0x9')]);router[_0xe74b('0x7')](_0xe74b('0xa'),auth[_0xe74b('0x8')](),controller[_0xe74b('0xb')]);router['get']('/users',auth[_0xe74b('0x8')](),controller[_0xe74b('0xc')]);router[_0xe74b('0x7')](_0xe74b('0xd'),auth[_0xe74b('0x8')](),controller[_0xe74b('0xe')]);router[_0xe74b('0xf')]('/',auth[_0xe74b('0x8')](),controller[_0xe74b('0x10')]);router[_0xe74b('0x11')](_0xe74b('0xd'),controller['update']);router[_0xe74b('0x12')](_0xe74b('0xd'),auth[_0xe74b('0x8')](),controller['destroy']);module[_0xe74b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 1f46d32..572ace6 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 _0x6901=['medium','ENUM','out','STRING','sequelize','TEXT'];(function(_0x296955,_0x19b6cc){var _0x4a9f7d=function(_0x38c303){while(--_0x38c303){_0x296955['push'](_0x296955['shift']());}};_0x4a9f7d(++_0x19b6cc);}(_0x6901,0x100));var _0x1690=function(_0x22d52a,_0x20f13a){_0x22d52a=_0x22d52a-0x0;var _0x553752=_0x6901[_0x22d52a];return _0x553752;};'use strict';var Sequelize=require(_0x1690('0x0'));module['exports']={'body':{'type':Sequelize[_0x1690('0x1')](_0x1690('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1690('0x3')]('in',_0x1690('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x1690('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7462=['out','STRING','TEXT','sequelize','exports','BOOLEAN'];(function(_0x488db3,_0x4a5cae){var _0x358b3c=function(_0x4b3fcf){while(--_0x4b3fcf){_0x488db3['push'](_0x488db3['shift']());}};_0x358b3c(++_0x4a5cae);}(_0x7462,0x165));var _0x2746=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0x7462[_0x349a9e];return _0x24c207;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2746('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2746('0x3')),'defaultValue':_0x2746('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x2746('0x4')]},'providerResponse':{'type':Sequelize[_0x2746('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 708d4af..16a10f6 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 _0x1e9b=['catch','sendStatus','end','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','rawAttributes','ChatMessage','create','body','find','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x1e9b,0xe2));var _0xb1e9=function(_0x31ebac,_0x58de2c){_0x31ebac=_0x31ebac-0x0;var _0x188a43=_0x1e9b[_0x31ebac];return _0x188a43;};'use strict';var emlformat=require(_0xb1e9('0x0'));var rimraf=require(_0xb1e9('0x1'));var zipdir=require(_0xb1e9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1e9('0x3'));var moment=require(_0xb1e9('0x4'));var BPromise=require(_0xb1e9('0x5'));var Mustache=require(_0xb1e9('0x6'));var util=require(_0xb1e9('0x7'));var path=require(_0xb1e9('0x8'));var sox=require(_0xb1e9('0x9'));var csv=require(_0xb1e9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1e9('0xb'));var _=require(_0xb1e9('0xc'));var squel=require(_0xb1e9('0xd'));var crypto=require(_0xb1e9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1e9('0xa'));var querystring=require('querystring');var Papa=require(_0xb1e9('0xf'));var Redis=require('ioredis');var authService=require(_0xb1e9('0x10'));var qs=require(_0xb1e9('0x11'));var as=require(_0xb1e9('0x12'));var hardwareService=require(_0xb1e9('0x13'));var logger=require(_0xb1e9('0x14'))('api');var utils=require(_0xb1e9('0x15'));var config=require(_0xb1e9('0x16'));var licenseUtil=require(_0xb1e9('0x17'));var db=require('../../mysqldb')['db'];config[_0xb1e9('0x18')]=_['defaults'](config[_0xb1e9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb1e9('0x19'))(new Redis(config[_0xb1e9('0x18')]));require(_0xb1e9('0x1a'))[_0xb1e9('0x1b')](socket);var jayson=require(_0xb1e9('0x1c'));var client=jayson[_0xb1e9('0x1d')][_0xb1e9('0x1e')]({'port':0x232c});var client9002=jayson[_0xb1e9('0x1d')][_0xb1e9('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x210f98,_0x4fabb3,_0x43934c,_0x4b82a7){return new BPromise(function(_0x371150,_0x3668a4){var _0x906c7c=_0x4b82a7||client;return _0x906c7c[_0xb1e9('0x1f')](_0x210f98,_0x43934c)['then'](function(_0x1774ac){logger[_0xb1e9('0x20')]('ChatMessage,\x20%s,\x20%s',_0x4fabb3,_0xb1e9('0x21'));logger[_0xb1e9('0x22')](_0xb1e9('0x23'),_0x4fabb3,_0xb1e9('0x21'),JSON[_0xb1e9('0x24')](_0x1774ac));if(_0x1774ac[_0xb1e9('0x25')]){if(_0x1774ac['error'][_0xb1e9('0x26')]===0x1f4){logger[_0xb1e9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4fabb3,_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);return _0x3668a4(_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);}logger[_0xb1e9('0x25')](_0xb1e9('0x28'),_0x4fabb3,_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);return _0x371150(_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);}else{logger[_0xb1e9('0x20')](_0xb1e9('0x28'),_0x4fabb3,_0xb1e9('0x21'));_0x371150(_0x1774ac[_0xb1e9('0x29')]['message']);}})[_0xb1e9('0x2a')](function(_0x1afb1a){logger[_0xb1e9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4fabb3,_0x1afb1a);_0x3668a4(_0x1afb1a);});});}function respondWithStatusCode(_0x5655b2,_0x2eb237){_0x2eb237=_0x2eb237||0xcc;return function(_0x42ea93){if(_0x42ea93){return _0x5655b2[_0xb1e9('0x2b')](_0x2eb237);}return _0x5655b2['status'](_0x2eb237)[_0xb1e9('0x2c')]();};}function respondWithResult(_0x254c7c,_0x25c898){_0x25c898=_0x25c898||0xc8;return function(_0x1094e1){if(_0x1094e1){return _0x254c7c[_0xb1e9('0x2d')](_0x25c898)['json'](_0x1094e1);}};}function respondWithFilteredResult(_0x34ff3a,_0x227595){return function(_0x1d553b){if(_0x1d553b){var _0x45cb07=typeof _0x227595['offset']==='undefined'&&typeof _0x227595[_0xb1e9('0x2e')]===_0xb1e9('0x2f');var _0xc85b16=_0x1d553b[_0xb1e9('0x30')];var _0x52a058=_0x45cb07?0x0:_0x227595['offset'];var _0x1e1322=_0x45cb07?_0x1d553b['count']:_0x227595[_0xb1e9('0x31')]+_0x227595[_0xb1e9('0x2e')];var _0x49cfce;if(_0x1e1322>=_0xc85b16){_0x1e1322=_0xc85b16;_0x49cfce=0xc8;}else{_0x49cfce=0xce;}_0x34ff3a[_0xb1e9('0x2d')](_0x49cfce);return _0x34ff3a['set'](_0xb1e9('0x32'),_0x52a058+'-'+_0x1e1322+'/'+_0xc85b16)['json'](_0x1d553b);}return null;};}function patchUpdates(_0x44c36a){return function(_0x3d61f3){try{jsonpatch[_0xb1e9('0x33')](_0x3d61f3,_0x44c36a,!![]);}catch(_0x59eab4){return BPromise[_0xb1e9('0x34')](_0x59eab4);}return _0x3d61f3[_0xb1e9('0x35')]();};}function saveUpdates(_0x50c896,_0x9ab3ef){return function(_0x202f49){if(_0x202f49){return _0x202f49[_0xb1e9('0x36')](_0x50c896)['then'](function(_0x2068ff){return _0x2068ff;});}return null;};}function removeEntity(_0x254256,_0x18678d){return function(_0x4aa218){if(_0x4aa218){return _0x4aa218[_0xb1e9('0x37')]()['then'](function(){_0x254256[_0xb1e9('0x2d')](0xcc)[_0xb1e9('0x2c')]();});}};}function handleEntityNotFound(_0x361afd,_0x522784){return function(_0x57b188){if(!_0x57b188){_0x361afd[_0xb1e9('0x2b')](0x194);}return _0x57b188;};}function handleError(_0x55ba59,_0x21c564){_0x21c564=_0x21c564||0x1f4;return function(_0x114162){logger[_0xb1e9('0x25')](_0x114162[_0xb1e9('0x38')]);if(_0x114162['name']){delete _0x114162[_0xb1e9('0x39')];}_0x55ba59[_0xb1e9('0x2d')](_0x21c564)[_0xb1e9('0x3a')](_0x114162);};}exports[_0xb1e9('0x3b')]=function(_0x278751,_0x1dc108){var _0x43dc5f={},_0x450a16={},_0x488b20={'count':0x0,'rows':[]};var _0x526d2c=_[_0xb1e9('0x3c')](db['ChatMessage']['rawAttributes'],function(_0x306526){return{'name':_0x306526['fieldName'],'type':_0x306526[_0xb1e9('0x3d')][_0xb1e9('0x3e')]};});_0x450a16['model']=_[_0xb1e9('0x3c')](_0x526d2c,'name');_0x450a16[_0xb1e9('0x3f')]=_[_0xb1e9('0x40')](_0x278751[_0xb1e9('0x3f')]);_0x450a16[_0xb1e9('0x41')]=_[_0xb1e9('0x42')](_0x450a16[_0xb1e9('0x43')],_0x450a16[_0xb1e9('0x3f')]);_0x43dc5f[_0xb1e9('0x44')]=_[_0xb1e9('0x42')](_0x450a16[_0xb1e9('0x43')],qs[_0xb1e9('0x45')](_0x278751['query'][_0xb1e9('0x45')]));_0x43dc5f[_0xb1e9('0x44')]=_0x43dc5f[_0xb1e9('0x44')][_0xb1e9('0x46')]?_0x43dc5f[_0xb1e9('0x44')]:_0x450a16['model'];if(!_0x278751['query'][_0xb1e9('0x47')](_0xb1e9('0x48'))){_0x43dc5f[_0xb1e9('0x2e')]=qs[_0xb1e9('0x2e')](_0x278751[_0xb1e9('0x3f')]['limit']);_0x43dc5f[_0xb1e9('0x31')]=qs[_0xb1e9('0x31')](_0x278751[_0xb1e9('0x3f')][_0xb1e9('0x31')]);}_0x43dc5f[_0xb1e9('0x49')]=qs[_0xb1e9('0x4a')](_0x278751['query'][_0xb1e9('0x4a')]);_0x43dc5f['where']=qs[_0xb1e9('0x41')](_[_0xb1e9('0x4b')](_0x278751[_0xb1e9('0x3f')],_0x450a16[_0xb1e9('0x41')]),_0x526d2c);if(_0x278751[_0xb1e9('0x3f')][_0xb1e9('0x4c')]){_0x43dc5f[_0xb1e9('0x4d')]=_[_0xb1e9('0x4e')](_0x43dc5f[_0xb1e9('0x4d')],{'$or':_['map'](_0x526d2c,function(_0x3e226f){if(_0x3e226f[_0xb1e9('0x3d')]!==_0xb1e9('0x4f')){var _0x2fb1bb={};_0x2fb1bb[_0x3e226f[_0xb1e9('0x39')]]={'$like':'%'+_0x278751[_0xb1e9('0x3f')][_0xb1e9('0x4c')]+'%'};return _0x2fb1bb;}})});}_0x43dc5f=_['merge']({},_0x43dc5f,_0x278751[_0xb1e9('0x50')]);var _0x38b47e={'where':_0x43dc5f[_0xb1e9('0x4d')]};return db['ChatMessage'][_0xb1e9('0x30')](_0x38b47e)[_0xb1e9('0x51')](function(_0x42e5b0){_0x488b20[_0xb1e9('0x30')]=_0x42e5b0;if(_0x278751['query'][_0xb1e9('0x52')]){_0x43dc5f[_0xb1e9('0x53')]=[{'all':!![]}];}return db['ChatMessage'][_0xb1e9('0x54')](_0x43dc5f);})[_0xb1e9('0x51')](function(_0x2114f9){_0x488b20[_0xb1e9('0x55')]=_0x2114f9;return _0x488b20;})[_0xb1e9('0x51')](respondWithFilteredResult(_0x1dc108,_0x43dc5f))[_0xb1e9('0x2a')](handleError(_0x1dc108,null));};exports[_0xb1e9('0x56')]=function(_0xd4c442,_0x188402){var _0x459b0c={'raw':!![],'where':{'id':_0xd4c442[_0xb1e9('0x57')]['id']}},_0x1ad874={};_0x1ad874[_0xb1e9('0x43')]=_['keys'](db['ChatMessage'][_0xb1e9('0x58')]);_0x1ad874[_0xb1e9('0x3f')]=_['keys'](_0xd4c442['query']);_0x1ad874[_0xb1e9('0x41')]=_[_0xb1e9('0x42')](_0x1ad874['model'],_0x1ad874['query']);_0x459b0c[_0xb1e9('0x44')]=_[_0xb1e9('0x42')](_0x1ad874[_0xb1e9('0x43')],qs[_0xb1e9('0x45')](_0xd4c442[_0xb1e9('0x3f')][_0xb1e9('0x45')]));_0x459b0c[_0xb1e9('0x44')]=_0x459b0c[_0xb1e9('0x44')][_0xb1e9('0x46')]?_0x459b0c[_0xb1e9('0x44')]:_0x1ad874['model'];if(_0xd4c442[_0xb1e9('0x3f')][_0xb1e9('0x52')]){_0x459b0c[_0xb1e9('0x53')]=[{'all':!![]}];}_0x459b0c=_['merge']({},_0x459b0c,_0xd4c442[_0xb1e9('0x50')]);return db['ChatMessage']['find'](_0x459b0c)[_0xb1e9('0x51')](handleEntityNotFound(_0x188402,null))['then'](respondWithResult(_0x188402,null))[_0xb1e9('0x2a')](handleError(_0x188402,null));};exports['create']=function(_0x8d2727,_0x2cd099){return db[_0xb1e9('0x59')][_0xb1e9('0x5a')](_0x8d2727[_0xb1e9('0x5b')],{})['then'](respondWithResult(_0x2cd099,0xc9))[_0xb1e9('0x2a')](handleError(_0x2cd099,null));};exports['update']=function(_0x237e3f,_0x56dd6e){if(_0x237e3f[_0xb1e9('0x5b')]['id']){delete _0x237e3f[_0xb1e9('0x5b')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x237e3f[_0xb1e9('0x57')]['id']}})[_0xb1e9('0x51')](handleEntityNotFound(_0x56dd6e,null))[_0xb1e9('0x51')](saveUpdates(_0x237e3f[_0xb1e9('0x5b')],null))[_0xb1e9('0x51')](respondWithResult(_0x56dd6e,null))[_0xb1e9('0x2a')](handleError(_0x56dd6e,null));};exports[_0xb1e9('0x37')]=function(_0x428414,_0x12c09d){return db['ChatMessage'][_0xb1e9('0x5c')]({'where':{'id':_0x428414[_0xb1e9('0x57')]['id']}})[_0xb1e9('0x51')](handleEntityNotFound(_0x12c09d,null))[_0xb1e9('0x51')](removeEntity(_0x12c09d,null))['catch'](handleError(_0x12c09d,null));};exports['describe']=function(_0x3b6e7b,_0x2b345d){return db[_0xb1e9('0x59')][_0xb1e9('0x5d')]()['then'](respondWithResult(_0x2b345d,null))[_0xb1e9('0x2a')](handleError(_0x2b345d,null));};var interaction_log=require(_0xb1e9('0x14'))('chat-interactions');exports[_0xb1e9('0x5e')]=function(_0xc52b2d,_0x572a98,_0x1a9f9d){var _0x2e6cf3={'agent':{},'channel':_0xb1e9('0x5f')};if(_0xc52b2d[_0xb1e9('0x5b')]['id']){delete _0xc52b2d[_0xb1e9('0x5b')]['id'];}_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x60')]=!![];_0xc52b2d[_0xb1e9('0x5b')]['readAt']=moment()[_0xb1e9('0x61')](_0xb1e9('0x62'));_0xc52b2d['body'][_0xb1e9('0x63')]=_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x63')]||_0xc52b2d[_0xb1e9('0x64')]['id'];_0x2e6cf3[_0xb1e9('0x65')]['id']=_0xc52b2d['body'][_0xb1e9('0x63')];return db[_0xb1e9('0x59')][_0xb1e9('0x5c')]({'where':{'id':_0xc52b2d[_0xb1e9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x572a98,null))['then'](saveUpdates(_0xc52b2d['body'],null))[_0xb1e9('0x51')](function(_0x461a2b){if(_0x461a2b){_0x2e6cf3[_0xb1e9('0x27')]=_0x461a2b['get']({'plain':!![]});return db['ChatInteraction'][_0xb1e9('0x5c')]({'where':{'id':_0x461a2b[_0xb1e9('0x66')]}});}return null;})[_0xb1e9('0x51')](handleEntityNotFound(_0x572a98,null))[_0xb1e9('0x51')](function(_0x4abef4){if(_0x4abef4){return _0x4abef4['update']({'UserId':_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x63')],'read1stAt':_['isNil'](_0x4abef4['read1stAt'])?moment()[_0xb1e9('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb1e9('0x51')](function(_0x8c9c03){if(_0x8c9c03){_0x2e6cf3[_0xb1e9('0x67')]=_0x8c9c03[_0xb1e9('0x68')]({'plain':!![]});interaction_log['info'](_0xb1e9('0x69'),_0xc52b2d[_0xb1e9('0x64')]['id'],_0xc52b2d[_0xb1e9('0x64')]['name'],_0xc52b2d[_0xb1e9('0x64')][_0xb1e9('0x6a')],_0x2e6cf3[_0xb1e9('0x67')]['id'],_0xc52b2d[_0xb1e9('0x5b')]?JSON[_0xb1e9('0x24')](_0xc52b2d[_0xb1e9('0x5b')]):_0xb1e9('0x6b'));return respondWithRpcPromise(_0xb1e9('0x6c'),'acceptMessage',_0x2e6cf3);}return null;})[_0xb1e9('0x51')](function(_0x36c621){var _0x511968=_0xb1e9('0x6d')+_0x36c621[_0xb1e9('0x27')][_0xb1e9('0x6e')];return db[_0xb1e9('0x6f')][_0xb1e9('0x3f')](_0x511968,{'type':db[_0xb1e9('0x70')][_0xb1e9('0x71')][_0xb1e9('0x72')],'raw':!![]})[_0xb1e9('0x51')](function(_0x27703b){return _0x27703b;});})[_0xb1e9('0x51')](function(_0x9c585d){if(_0x9c585d){_0x2e6cf3[_0xb1e9('0x27')]['contact']=_0x9c585d[0x0];if(!_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x63')])return;return db[_0xb1e9('0x73')][_0xb1e9('0x5c')]({'where':{'id':_0xc52b2d['body'][_0xb1e9('0x63')],'role':'agent'},'attributes':['id',_0xb1e9('0x39'),_0xb1e9('0x74'),_0xb1e9('0x75'),_0xb1e9('0x76')],'raw':!![]});}return null;})[_0xb1e9('0x51')](function(_0x22713c){if(!_0x22713c)return null;_0x2e6cf3[_0xb1e9('0x27')][_0xb1e9('0x65')]=_0x22713c;return _0x2e6cf3;})['then'](function(_0x5a6a96){if(_0x5a6a96){if(_0xc52b2d['body']['manual']){_0x2e6cf3[_0xb1e9('0x27')][_0xb1e9('0x77')]=util[_0xb1e9('0x61')](_0xb1e9('0x78'),_0xc52b2d['user'][_0xb1e9('0x39')]);_0x2e6cf3[_0xb1e9('0x27')]['channel']=_0x2e6cf3[_0xb1e9('0x79')];_0x2e6cf3[_0xb1e9('0x27')]['motionChannel']=_0x2e6cf3[_0xb1e9('0x79')];_0x2e6cf3[_0xb1e9('0x27')][_0xb1e9('0x7a')]=_0xb1e9('0x5e');return respondWithRpcPromise(_0xb1e9('0x7b'),'EventManager',{'event':_0xb1e9('0x7c'),'message':_[_0xb1e9('0x4e')](_0x2e6cf3['message'],JSON[_0xb1e9('0x7d')](_0x2e6cf3[_0xb1e9('0x67')][_0xb1e9('0x7e')]))},client9002)[_0xb1e9('0x51')](function(){return _0x2e6cf3;});}return _0x2e6cf3;}return null;})['then'](respondWithResult(_0x572a98,null))[_0xb1e9('0x2a')](handleError(_0x572a98,null));};var interaction_log=require(_0xb1e9('0x14'))(_0xb1e9('0x7f'));exports['reject']=function(_0x16817e,_0x18b042,_0x36f8fb){var _0x2384d0={'agent':{},'channel':_0xb1e9('0x5f')};if(_0x16817e['body']['id']){delete _0x16817e['body']['id'];}_0x16817e[_0xb1e9('0x5b')][_0xb1e9('0x63')]=_0x16817e['body'][_0xb1e9('0x63')]||_0x16817e[_0xb1e9('0x64')]['id'];_0x2384d0['agent']['id']=_0x16817e[_0xb1e9('0x5b')][_0xb1e9('0x63')];return db[_0xb1e9('0x59')][_0xb1e9('0x5c')]({'where':{'id':_0x16817e[_0xb1e9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x18b042,null))[_0xb1e9('0x51')](function(_0x5e8401){if(_0x5e8401){_0x2384d0[_0xb1e9('0x27')]=_0x5e8401[_0xb1e9('0x68')]({'plain':!![]});return db[_0xb1e9('0x80')][_0xb1e9('0x5c')]({'where':{'id':_0x5e8401['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x18b042,null))[_0xb1e9('0x51')](function(_0x3a1f8b){if(_0x3a1f8b){_0x2384d0['interaction']=_0x3a1f8b[_0xb1e9('0x68')]({'plain':!![]});interaction_log[_0xb1e9('0x20')](_0xb1e9('0x81'),_0x16817e[_0xb1e9('0x64')]['id'],_0x16817e['user'][_0xb1e9('0x39')],_0x16817e[_0xb1e9('0x64')]['role'],_0x2384d0[_0xb1e9('0x67')]['id'],_0x16817e['body']?JSON[_0xb1e9('0x24')](_0x16817e[_0xb1e9('0x5b')]):_0xb1e9('0x6b'));return respondWithRpcPromise(_0xb1e9('0x82'),_0xb1e9('0x83'),_0x2384d0);}return null;})[_0xb1e9('0x51')](function(_0x2b9dac){var _0x34bbd3=_0xb1e9('0x6d')+_0x2b9dac[_0xb1e9('0x27')]['ContactId'];return db['sequelize'][_0xb1e9('0x3f')](_0x34bbd3,{'type':db[_0xb1e9('0x70')][_0xb1e9('0x71')][_0xb1e9('0x72')],'raw':!![]})['then'](function(_0x143d8d){return _0x143d8d;});})[_0xb1e9('0x51')](function(_0x5a7e1b){if(_0x5a7e1b){_0x2384d0['message']['contact']=_0x5a7e1b[0x0];if(!_0x16817e['body'][_0xb1e9('0x63')])return;return db['User']['find']({'where':{'id':_0x16817e['body'][_0xb1e9('0x63')],'role':_0xb1e9('0x65')},'attributes':['id',_0xb1e9('0x39'),_0xb1e9('0x74'),'email',_0xb1e9('0x76')],'raw':!![]});}return null;})['then'](function(_0x44858a){if(!_0x44858a)return null;_0x2384d0[_0xb1e9('0x27')]['agent']=_0x44858a;return _0x2384d0;})[_0xb1e9('0x51')](function(_0x46c511){if(_0x46c511){_0x46c511[_0xb1e9('0x27')][_0xb1e9('0x77')]=util[_0xb1e9('0x61')](_0xb1e9('0x78'),_0x16817e[_0xb1e9('0x64')][_0xb1e9('0x39')]);_0x46c511[_0xb1e9('0x27')][_0xb1e9('0x79')]=_0x2384d0['channel'];_0x46c511[_0xb1e9('0x27')][_0xb1e9('0x84')]=_0x2384d0[_0xb1e9('0x79')];_0x46c511[_0xb1e9('0x27')]['event']=_0xb1e9('0x34');respondWithRpcPromise(_0xb1e9('0x7b'),_0xb1e9('0x7b'),{'event':_0xb1e9('0x85'),'message':_[_0xb1e9('0x4e')](_0x2384d0['message'],JSON[_0xb1e9('0x7d')](_0x2384d0['interaction'][_0xb1e9('0x7e')]))},client9002);return _0x2384d0;}return null;})['then'](respondWithResult(_0x18b042,null))[_0xb1e9('0x2a')](handleError(_0x18b042,null));};
\ No newline at end of file
+var _0xd5a4=['get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','undefined','limit','count','offset','set','apply','destroy','name','send','map','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','where','pick','filter','VIRTUAL','merge','ChatMessage','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent'];(function(_0x255737,_0x23d57a){var _0x3e3310=function(_0x24da7a){while(--_0x24da7a){_0x255737['push'](_0x255737['shift']());}};_0x3e3310(++_0x23d57a);}(_0xd5a4,0x125));var _0x4d5a=function(_0x329dfd,_0x8b20c7){_0x329dfd=_0x329dfd-0x0;var _0x4ded23=_0xd5a4[_0x329dfd];return _0x4ded23;};'use strict';var emlformat=require(_0x4d5a('0x0'));var rimraf=require(_0x4d5a('0x1'));var zipdir=require(_0x4d5a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d5a('0x3'));var moment=require(_0x4d5a('0x4'));var BPromise=require(_0x4d5a('0x5'));var Mustache=require(_0x4d5a('0x6'));var util=require('util');var path=require(_0x4d5a('0x7'));var sox=require(_0x4d5a('0x8'));var csv=require(_0x4d5a('0x9'));var ejs=require(_0x4d5a('0xa'));var fs=require('fs');var fs_extra=require(_0x4d5a('0xb'));var _=require(_0x4d5a('0xc'));var squel=require(_0x4d5a('0xd'));var crypto=require(_0x4d5a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d5a('0x9'));var querystring=require(_0x4d5a('0xf'));var Papa=require(_0x4d5a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4d5a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d5a('0x12'))(_0x4d5a('0x13'));var utils=require('../../config/utils');var config=require(_0x4d5a('0x14'));var licenseUtil=require(_0x4d5a('0x15'));var db=require(_0x4d5a('0x16'))['db'];config['redis']=_['defaults'](config[_0x4d5a('0x17')],{'host':_0x4d5a('0x18'),'port':0x18eb});var socket=require(_0x4d5a('0x19'))(new Redis(config[_0x4d5a('0x17')]));require(_0x4d5a('0x1a'))[_0x4d5a('0x1b')](socket);var jayson=require(_0x4d5a('0x1c'));var client=jayson[_0x4d5a('0x1d')][_0x4d5a('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x4d5a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2e2c59,_0x57d142,_0x2cb642,_0x332dae){return new BPromise(function(_0x395e2b,_0x266280){var _0x526a75=_0x332dae||client;return _0x526a75[_0x4d5a('0x1f')](_0x2e2c59,_0x2cb642)[_0x4d5a('0x20')](function(_0x572349){logger[_0x4d5a('0x21')](_0x4d5a('0x22'),_0x57d142,_0x4d5a('0x23'));logger[_0x4d5a('0x24')](_0x4d5a('0x25'),_0x57d142,_0x4d5a('0x23'),JSON[_0x4d5a('0x26')](_0x572349));if(_0x572349['error']){if(_0x572349[_0x4d5a('0x27')][_0x4d5a('0x28')]===0x1f4){logger[_0x4d5a('0x27')](_0x4d5a('0x22'),_0x57d142,_0x572349[_0x4d5a('0x27')][_0x4d5a('0x29')]);return _0x266280(_0x572349[_0x4d5a('0x27')][_0x4d5a('0x29')]);}logger[_0x4d5a('0x27')](_0x4d5a('0x22'),_0x57d142,_0x572349[_0x4d5a('0x27')]['message']);return _0x395e2b(_0x572349['error']['message']);}else{logger[_0x4d5a('0x21')](_0x4d5a('0x22'),_0x57d142,_0x4d5a('0x23'));_0x395e2b(_0x572349['result']['message']);}})['catch'](function(_0x5876bd){logger[_0x4d5a('0x27')](_0x4d5a('0x22'),_0x57d142,_0x5876bd);_0x266280(_0x5876bd);});});}function respondWithStatusCode(_0x11f362,_0x5c9e37){_0x5c9e37=_0x5c9e37||0xcc;return function(_0x4ce22f){if(_0x4ce22f){return _0x11f362['sendStatus'](_0x5c9e37);}return _0x11f362[_0x4d5a('0x2a')](_0x5c9e37)[_0x4d5a('0x2b')]();};}function respondWithResult(_0x19f6ae,_0x5393e0){_0x5393e0=_0x5393e0||0xc8;return function(_0x1764ae){if(_0x1764ae){return _0x19f6ae[_0x4d5a('0x2a')](_0x5393e0)[_0x4d5a('0x2c')](_0x1764ae);}};}function respondWithFilteredResult(_0x402f96,_0x175517){return function(_0x597bfa){if(_0x597bfa){var _0x288976=typeof _0x175517['offset']===_0x4d5a('0x2d')&&typeof _0x175517[_0x4d5a('0x2e')]===_0x4d5a('0x2d');var _0x517f5b=_0x597bfa[_0x4d5a('0x2f')];var _0x1eef60=_0x288976?0x0:_0x175517[_0x4d5a('0x30')];var _0xdb1c99=_0x288976?_0x597bfa[_0x4d5a('0x2f')]:_0x175517[_0x4d5a('0x30')]+_0x175517[_0x4d5a('0x2e')];var _0x4e0198;if(_0xdb1c99>=_0x517f5b){_0xdb1c99=_0x517f5b;_0x4e0198=0xc8;}else{_0x4e0198=0xce;}_0x402f96['status'](_0x4e0198);return _0x402f96[_0x4d5a('0x31')]('Content-Range',_0x1eef60+'-'+_0xdb1c99+'/'+_0x517f5b)[_0x4d5a('0x2c')](_0x597bfa);}return null;};}function patchUpdates(_0x766744){return function(_0xd6ebc1){try{jsonpatch[_0x4d5a('0x32')](_0xd6ebc1,_0x766744,!![]);}catch(_0x3097e4){return BPromise['reject'](_0x3097e4);}return _0xd6ebc1['save']();};}function saveUpdates(_0x34fffd,_0x25555f){return function(_0x267482){if(_0x267482){return _0x267482['update'](_0x34fffd)[_0x4d5a('0x20')](function(_0xe55abb){return _0xe55abb;});}return null;};}function removeEntity(_0x316db4,_0x2660dc){return function(_0x136e5a){if(_0x136e5a){return _0x136e5a[_0x4d5a('0x33')]()[_0x4d5a('0x20')](function(){_0x316db4[_0x4d5a('0x2a')](0xcc)[_0x4d5a('0x2b')]();});}};}function handleEntityNotFound(_0x1a710a,_0x334083){return function(_0x2b2a38){if(!_0x2b2a38){_0x1a710a['sendStatus'](0x194);}return _0x2b2a38;};}function handleError(_0x3288a9,_0x1ba720){_0x1ba720=_0x1ba720||0x1f4;return function(_0xb2665c){logger[_0x4d5a('0x27')](_0xb2665c['stack']);if(_0xb2665c[_0x4d5a('0x34')]){delete _0xb2665c[_0x4d5a('0x34')];}_0x3288a9[_0x4d5a('0x2a')](_0x1ba720)[_0x4d5a('0x35')](_0xb2665c);};}exports['index']=function(_0x359caa,_0xf3d2dd){var _0x2a929d={},_0x1bb590={},_0x241423={'count':0x0,'rows':[]};var _0x5cb392=_[_0x4d5a('0x36')](db['ChatMessage'][_0x4d5a('0x37')],function(_0x44eb72){return{'name':_0x44eb72['fieldName'],'type':_0x44eb72[_0x4d5a('0x38')][_0x4d5a('0x39')]};});_0x1bb590['model']=_[_0x4d5a('0x36')](_0x5cb392,'name');_0x1bb590['query']=_[_0x4d5a('0x3a')](_0x359caa[_0x4d5a('0x3b')]);_0x1bb590[_0x4d5a('0x3c')]=_['intersection'](_0x1bb590['model'],_0x1bb590[_0x4d5a('0x3b')]);_0x2a929d['attributes']=_[_0x4d5a('0x3d')](_0x1bb590[_0x4d5a('0x3e')],qs[_0x4d5a('0x3f')](_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x3f')]));_0x2a929d['attributes']=_0x2a929d['attributes']['length']?_0x2a929d[_0x4d5a('0x40')]:_0x1bb590[_0x4d5a('0x3e')];if(!_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x41')]('nolimit')){_0x2a929d[_0x4d5a('0x2e')]=qs[_0x4d5a('0x2e')](_0x359caa['query'][_0x4d5a('0x2e')]);_0x2a929d[_0x4d5a('0x30')]=qs[_0x4d5a('0x30')](_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x30')]);}_0x2a929d['order']=qs['sort'](_0x359caa[_0x4d5a('0x3b')]['sort']);_0x2a929d[_0x4d5a('0x42')]=qs[_0x4d5a('0x3c')](_[_0x4d5a('0x43')](_0x359caa['query'],_0x1bb590[_0x4d5a('0x3c')]),_0x5cb392);if(_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x44')]){_0x2a929d[_0x4d5a('0x42')]=_['merge'](_0x2a929d[_0x4d5a('0x42')],{'$or':_['map'](_0x5cb392,function(_0x292b48){if(_0x292b48[_0x4d5a('0x38')]!==_0x4d5a('0x45')){var _0x4b3ec8={};_0x4b3ec8[_0x292b48[_0x4d5a('0x34')]]={'$like':'%'+_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x44')]+'%'};return _0x4b3ec8;}})});}_0x2a929d=_[_0x4d5a('0x46')]({},_0x2a929d,_0x359caa['options']);var _0x245e74={'where':_0x2a929d[_0x4d5a('0x42')]};return db[_0x4d5a('0x47')][_0x4d5a('0x2f')](_0x245e74)[_0x4d5a('0x20')](function(_0x1ec71f){_0x241423[_0x4d5a('0x2f')]=_0x1ec71f;if(_0x359caa['query'][_0x4d5a('0x48')]){_0x2a929d[_0x4d5a('0x49')]=[{'all':!![]}];}return db[_0x4d5a('0x47')][_0x4d5a('0x4a')](_0x2a929d);})[_0x4d5a('0x20')](function(_0x1cff4a){_0x241423[_0x4d5a('0x4b')]=_0x1cff4a;return _0x241423;})['then'](respondWithFilteredResult(_0xf3d2dd,_0x2a929d))[_0x4d5a('0x4c')](handleError(_0xf3d2dd,null));};exports[_0x4d5a('0x4d')]=function(_0x426227,_0x43ec6a){var _0x12d867={'raw':!![],'where':{'id':_0x426227[_0x4d5a('0x4e')]['id']}},_0x30c04b={};_0x30c04b[_0x4d5a('0x3e')]=_['keys'](db[_0x4d5a('0x47')][_0x4d5a('0x37')]);_0x30c04b[_0x4d5a('0x3b')]=_['keys'](_0x426227[_0x4d5a('0x3b')]);_0x30c04b[_0x4d5a('0x3c')]=_['intersection'](_0x30c04b[_0x4d5a('0x3e')],_0x30c04b[_0x4d5a('0x3b')]);_0x12d867[_0x4d5a('0x40')]=_[_0x4d5a('0x3d')](_0x30c04b['model'],qs[_0x4d5a('0x3f')](_0x426227[_0x4d5a('0x3b')]['fields']));_0x12d867[_0x4d5a('0x40')]=_0x12d867[_0x4d5a('0x40')][_0x4d5a('0x4f')]?_0x12d867[_0x4d5a('0x40')]:_0x30c04b[_0x4d5a('0x3e')];if(_0x426227['query'][_0x4d5a('0x48')]){_0x12d867[_0x4d5a('0x49')]=[{'all':!![]}];}_0x12d867=_['merge']({},_0x12d867,_0x426227[_0x4d5a('0x50')]);return db[_0x4d5a('0x47')][_0x4d5a('0x51')](_0x12d867)[_0x4d5a('0x20')](handleEntityNotFound(_0x43ec6a,null))[_0x4d5a('0x20')](respondWithResult(_0x43ec6a,null))[_0x4d5a('0x4c')](handleError(_0x43ec6a,null));};exports[_0x4d5a('0x52')]=function(_0x1fd6c1,_0x29d027){return db[_0x4d5a('0x47')]['create'](_0x1fd6c1[_0x4d5a('0x53')],{})[_0x4d5a('0x20')](respondWithResult(_0x29d027,0xc9))[_0x4d5a('0x4c')](handleError(_0x29d027,null));};exports['update']=function(_0xeaf250,_0xb0e5a8){if(_0xeaf250['body']['id']){delete _0xeaf250[_0x4d5a('0x53')]['id'];}return db[_0x4d5a('0x47')]['find']({'where':{'id':_0xeaf250[_0x4d5a('0x4e')]['id']}})['then'](handleEntityNotFound(_0xb0e5a8,null))[_0x4d5a('0x20')](saveUpdates(_0xeaf250[_0x4d5a('0x53')],null))[_0x4d5a('0x20')](respondWithResult(_0xb0e5a8,null))[_0x4d5a('0x4c')](handleError(_0xb0e5a8,null));};exports[_0x4d5a('0x33')]=function(_0x1e2dcf,_0x468def){return db[_0x4d5a('0x47')][_0x4d5a('0x51')]({'where':{'id':_0x1e2dcf[_0x4d5a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x468def,null))[_0x4d5a('0x20')](removeEntity(_0x468def,null))[_0x4d5a('0x4c')](handleError(_0x468def,null));};exports[_0x4d5a('0x54')]=function(_0x591a1f,_0x5ab8e7){return db[_0x4d5a('0x47')][_0x4d5a('0x54')]()[_0x4d5a('0x20')](respondWithResult(_0x5ab8e7,null))['catch'](handleError(_0x5ab8e7,null));};var interaction_log=require(_0x4d5a('0x12'))(_0x4d5a('0x55'));exports[_0x4d5a('0x56')]=function(_0x2a58c2,_0x3a02e5,_0x208825){var _0x57ce94={'agent':{},'channel':_0x4d5a('0x57')};if(_0x2a58c2[_0x4d5a('0x53')]['id']){delete _0x2a58c2[_0x4d5a('0x53')]['id'];}_0x2a58c2['body'][_0x4d5a('0x58')]=!![];_0x2a58c2['body']['readAt']=moment()[_0x4d5a('0x59')](_0x4d5a('0x5a'));_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x5b')]=_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x5b')]||_0x2a58c2[_0x4d5a('0x5c')]['id'];_0x57ce94[_0x4d5a('0x5d')]['id']=_0x2a58c2[_0x4d5a('0x53')]['UserId'];return db[_0x4d5a('0x47')]['find']({'where':{'id':_0x2a58c2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a02e5,null))[_0x4d5a('0x20')](saveUpdates(_0x2a58c2[_0x4d5a('0x53')],null))[_0x4d5a('0x20')](function(_0x1d69b2){if(_0x1d69b2){_0x57ce94[_0x4d5a('0x29')]=_0x1d69b2[_0x4d5a('0x5e')]({'plain':!![]});return db[_0x4d5a('0x5f')][_0x4d5a('0x51')]({'where':{'id':_0x1d69b2[_0x4d5a('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x3a02e5,null))[_0x4d5a('0x20')](function(_0x91706f){if(_0x91706f){return _0x91706f[_0x4d5a('0x61')]({'UserId':_0x2a58c2[_0x4d5a('0x53')]['UserId'],'read1stAt':_[_0x4d5a('0x62')](_0x91706f[_0x4d5a('0x63')])?moment()['format'](_0x4d5a('0x5a')):undefined});}return null;})[_0x4d5a('0x20')](function(_0x4cade1){if(_0x4cade1){_0x57ce94[_0x4d5a('0x64')]=_0x4cade1[_0x4d5a('0x5e')]({'plain':!![]});interaction_log[_0x4d5a('0x21')](_0x4d5a('0x65'),_0x2a58c2[_0x4d5a('0x5c')]['id'],_0x2a58c2['user'][_0x4d5a('0x34')],_0x2a58c2[_0x4d5a('0x5c')][_0x4d5a('0x66')],_0x57ce94['interaction']['id'],_0x2a58c2[_0x4d5a('0x53')]?JSON['stringify'](_0x2a58c2[_0x4d5a('0x53')]):_0x4d5a('0x67'));return respondWithRpcPromise('AcceptMessage',_0x4d5a('0x68'),_0x57ce94);}return null;})[_0x4d5a('0x20')](function(_0x5321f8){var _0x2b598c=_0x4d5a('0x69')+_0x5321f8[_0x4d5a('0x29')][_0x4d5a('0x6a')];return db[_0x4d5a('0x6b')][_0x4d5a('0x3b')](_0x2b598c,{'type':db[_0x4d5a('0x6c')][_0x4d5a('0x6d')][_0x4d5a('0x6e')],'raw':!![]})[_0x4d5a('0x20')](function(_0x5154d8){return _0x5154d8;});})[_0x4d5a('0x20')](function(_0x2bc246){if(_0x2bc246){_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x6f')]=_0x2bc246[0x0];if(!_0x2a58c2['body'][_0x4d5a('0x5b')])return;return db[_0x4d5a('0x70')][_0x4d5a('0x51')]({'where':{'id':_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x5b')],'role':'agent'},'attributes':['id',_0x4d5a('0x34'),_0x4d5a('0x71'),_0x4d5a('0x72'),_0x4d5a('0x73')],'raw':!![]});}return null;})[_0x4d5a('0x20')](function(_0x35fa95){if(!_0x35fa95)return null;_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x5d')]=_0x35fa95;return _0x57ce94;})[_0x4d5a('0x20')](function(_0x20b574){if(_0x20b574){if(_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x74')]){_0x57ce94['message'][_0x4d5a('0x75')]=util[_0x4d5a('0x59')]('SIP/%s',_0x2a58c2['user'][_0x4d5a('0x34')]);_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x76')]=_0x57ce94[_0x4d5a('0x76')];_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x77')]=_0x57ce94[_0x4d5a('0x76')];_0x57ce94['message'][_0x4d5a('0x78')]=_0x4d5a('0x56');return respondWithRpcPromise(_0x4d5a('0x79'),_0x4d5a('0x79'),{'event':_0x4d5a('0x7a'),'message':_['merge'](_0x57ce94['message'],JSON[_0x4d5a('0x7b')](_0x57ce94[_0x4d5a('0x64')][_0x4d5a('0x7c')]))},client9002)[_0x4d5a('0x20')](function(){return _0x57ce94;});}return _0x57ce94;}return null;})[_0x4d5a('0x20')](respondWithResult(_0x3a02e5,null))[_0x4d5a('0x4c')](handleError(_0x3a02e5,null));};var interaction_log=require(_0x4d5a('0x12'))(_0x4d5a('0x55'));exports[_0x4d5a('0x7d')]=function(_0x11ed07,_0x5abec1,_0x3e8add){var _0x1a2c3b={'agent':{},'channel':_0x4d5a('0x57')};if(_0x11ed07[_0x4d5a('0x53')]['id']){delete _0x11ed07[_0x4d5a('0x53')]['id'];}_0x11ed07['body']['UserId']=_0x11ed07[_0x4d5a('0x53')][_0x4d5a('0x5b')]||_0x11ed07[_0x4d5a('0x5c')]['id'];_0x1a2c3b[_0x4d5a('0x5d')]['id']=_0x11ed07[_0x4d5a('0x53')][_0x4d5a('0x5b')];return db[_0x4d5a('0x47')][_0x4d5a('0x51')]({'where':{'id':_0x11ed07[_0x4d5a('0x4e')]['id'],'UserId':null}})[_0x4d5a('0x20')](handleEntityNotFound(_0x5abec1,null))[_0x4d5a('0x20')](function(_0xd0183b){if(_0xd0183b){_0x1a2c3b[_0x4d5a('0x29')]=_0xd0183b[_0x4d5a('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x4d5a('0x51')]({'where':{'id':_0xd0183b[_0x4d5a('0x60')]}});}return null;})[_0x4d5a('0x20')](handleEntityNotFound(_0x5abec1,null))['then'](function(_0x13fbc5){if(_0x13fbc5){_0x1a2c3b['interaction']=_0x13fbc5['get']({'plain':!![]});interaction_log[_0x4d5a('0x21')](_0x4d5a('0x7e'),_0x11ed07[_0x4d5a('0x5c')]['id'],_0x11ed07[_0x4d5a('0x5c')]['name'],_0x11ed07['user']['role'],_0x1a2c3b[_0x4d5a('0x64')]['id'],_0x11ed07[_0x4d5a('0x53')]?JSON[_0x4d5a('0x26')](_0x11ed07[_0x4d5a('0x53')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1a2c3b);}return null;})['then'](function(_0x2a9d6a){var _0x222820='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a9d6a[_0x4d5a('0x29')][_0x4d5a('0x6a')];return db[_0x4d5a('0x6b')][_0x4d5a('0x3b')](_0x222820,{'type':db[_0x4d5a('0x6c')][_0x4d5a('0x6d')][_0x4d5a('0x6e')],'raw':!![]})[_0x4d5a('0x20')](function(_0x42040e){return _0x42040e;});})[_0x4d5a('0x20')](function(_0xf50bac){if(_0xf50bac){_0x1a2c3b[_0x4d5a('0x29')]['contact']=_0xf50bac[0x0];if(!_0x11ed07[_0x4d5a('0x53')][_0x4d5a('0x5b')])return;return db['User'][_0x4d5a('0x51')]({'where':{'id':_0x11ed07['body'][_0x4d5a('0x5b')],'role':_0x4d5a('0x5d')},'attributes':['id',_0x4d5a('0x34'),'fullname',_0x4d5a('0x72'),_0x4d5a('0x73')],'raw':!![]});}return null;})[_0x4d5a('0x20')](function(_0x3fbfc5){if(!_0x3fbfc5)return null;_0x1a2c3b['message'][_0x4d5a('0x5d')]=_0x3fbfc5;return _0x1a2c3b;})[_0x4d5a('0x20')](function(_0x1c2bab){if(_0x1c2bab){_0x1c2bab[_0x4d5a('0x29')]['interface']=util[_0x4d5a('0x59')](_0x4d5a('0x7f'),_0x11ed07[_0x4d5a('0x5c')]['name']);_0x1c2bab['message']['channel']=_0x1a2c3b[_0x4d5a('0x76')];_0x1c2bab['message'][_0x4d5a('0x77')]=_0x1a2c3b[_0x4d5a('0x76')];_0x1c2bab[_0x4d5a('0x29')][_0x4d5a('0x78')]=_0x4d5a('0x7d');respondWithRpcPromise('EventManager',_0x4d5a('0x79'),{'event':_0x4d5a('0x80'),'message':_[_0x4d5a('0x46')](_0x1a2c3b[_0x4d5a('0x29')],JSON['parse'](_0x1a2c3b[_0x4d5a('0x64')][_0x4d5a('0x7c')]))},client9002);return _0x1a2c3b;}return null;})[_0x4d5a('0x20')](respondWithResult(_0x5abec1,null))[_0x4d5a('0x4c')](handleError(_0x5abec1,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index ad075b5..464ebb8 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 _0x1386=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','hook'];(function(_0x4233f5,_0x23e9dd){var _0x45966c=function(_0x5024c4){while(--_0x5024c4){_0x4233f5['push'](_0x4233f5['shift']());}};_0x45966c(++_0x23e9dd);}(_0x1386,0x170));var _0x6138=function(_0x18145c,_0x23c102){_0x18145c=_0x18145c-0x0;var _0x52dd35=_0x1386[_0x18145c];return _0x52dd35;};'use strict';var EventEmitter=require(_0x6138('0x0'));var ChatMessage=require(_0x6138('0x1'))['db'][_0x6138('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6138('0x3')](0x0);var events={'afterCreate':_0x6138('0x4'),'afterUpdate':_0x6138('0x5'),'afterDestroy':_0x6138('0x6')};function emitEvent(_0x395a9f){return function(_0x5d7d96,_0x522b8d,_0x17a78b){ChatMessageEvents['emit'](_0x395a9f+':'+_0x5d7d96['id'],_0x5d7d96);ChatMessageEvents['emit'](_0x395a9f,_0x5d7d96);_0x17a78b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x6138('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xadd3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove'];(function(_0x4b9fcd,_0x10fc42){var _0x3f83cd=function(_0x539400){while(--_0x539400){_0x4b9fcd['push'](_0x4b9fcd['shift']());}};_0x3f83cd(++_0x10fc42);}(_0xadd3,0xc2));var _0x3add=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xadd3[_0x5f3f88];return _0xd08119;};'use strict';var EventEmitter=require(_0x3add('0x0'));var ChatMessage=require(_0x3add('0x1'))['db'][_0x3add('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3add('0x3')](0x0);var events={'afterCreate':_0x3add('0x4'),'afterUpdate':'update','afterDestroy':_0x3add('0x5')};function emitEvent(_0x59666e){return function(_0x24cd62,_0x3ab179,_0x386081){ChatMessageEvents[_0x3add('0x6')](_0x59666e+':'+_0x24cd62['id'],_0x24cd62);ChatMessageEvents[_0x3add('0x6')](_0x59666e,_0x24cd62);_0x386081(null);};}for(var e in events){if(events[_0x3add('0x7')](e)){var event=events[e];ChatMessage[_0x3add('0x8')](e,emitEvent(event));}}module[_0x3add('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 025d77b..a69880b 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 _0xfe11=['direction','toLowerCase','out','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','define','ChatMessage','chat_messages','body','FULLTEXT','models','get'];(function(_0x45c398,_0x3bed1d){var _0x54ab01=function(_0x3eb807){while(--_0x3eb807){_0x45c398['push'](_0x45c398['shift']());}};_0x54ab01(++_0x3bed1d);}(_0xfe11,0x94));var _0x1fe1=function(_0x531613,_0x24832c){_0x531613=_0x531613-0x0;var _0x3aadd2=_0xfe11[_0x531613];return _0x3aadd2;};'use strict';var _=require(_0x1fe1('0x0'));var util=require(_0x1fe1('0x1'));var logger=require(_0x1fe1('0x2'))(_0x1fe1('0x3'));var moment=require(_0x1fe1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fe1('0x5'));var rimraf=require(_0x1fe1('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x53145e,_0x16e421){return _0x53145e[_0x1fe1('0x7')](_0x1fe1('0x8'),attributes,{'tableName':_0x1fe1('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1fe1('0xa')],'type':_0x1fe1('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfdb9e0,_0x3a1784,_0x14b4a4){var _0x260e96=_0x53145e[_0x1fe1('0xc')];var _0x5e2a94=_0xfdb9e0[_0x1fe1('0xd')]({'plain':!![]});if(_0x5e2a94[_0x1fe1('0xe')]['toLowerCase']()==='in'||_0x5e2a94[_0x1fe1('0xe')][_0x1fe1('0xf')]()===_0x1fe1('0x10')&&!_0x5e2a94['secret']&&!_['isNil'](_0x5e2a94[_0x1fe1('0x11')])){_0x260e96[_0x1fe1('0x12')][_0x1fe1('0x13')]({'where':{'id':_0x5e2a94[_0x1fe1('0x14')]}})[_0x1fe1('0x15')](function(_0x4320e0){if(_0x4320e0){_0x4320e0[_0x1fe1('0x16')]({'lastMsgAt':_0x5e2a94[_0x1fe1('0x17')],'lastMsgDirection':_0x5e2a94[_0x1fe1('0xe')][_0x1fe1('0xf')]()});}})[_0x1fe1('0x18')](function(_0x405e77){console['error'](_0x405e77);});}_0x14b4a4();}},'charset':_0x1fe1('0x19'),'collate':_0x1fe1('0x1a')});};
\ No newline at end of file
+var _0xca0f=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x11d61c,_0xc601d4){var _0x5ccbfa=function(_0x49ec4a){while(--_0x49ec4a){_0x11d61c['push'](_0x11d61c['shift']());}};_0x5ccbfa(++_0xc601d4);}(_0xca0f,0x90));var _0xfca0=function(_0x57bd7c,_0x40aa96){_0x57bd7c=_0x57bd7c-0x0;var _0xe558a=_0xca0f[_0x57bd7c];return _0xe558a;};'use strict';var _=require(_0xfca0('0x0'));var util=require(_0xfca0('0x1'));var logger=require(_0xfca0('0x2'))(_0xfca0('0x3'));var moment=require(_0xfca0('0x4'));var BPromise=require('bluebird');var rp=require(_0xfca0('0x5'));var fs=require('fs');var path=require(_0xfca0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfca0('0x7'));module[_0xfca0('0x8')]=function(_0x289dc2,_0x151284){return _0x289dc2[_0xfca0('0x9')](_0xfca0('0xa'),attributes,{'tableName':_0xfca0('0xb'),'paranoid':![],'indexes':[{'name':_0xfca0('0xc'),'fields':[_0xfca0('0xd')],'type':_0xfca0('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c5430,_0x55c3fe,_0x269991){var _0x487e7f=_0x289dc2['models'];var _0x58aa2f=_0x5c5430[_0xfca0('0xf')]({'plain':!![]});if(_0x58aa2f[_0xfca0('0x10')][_0xfca0('0x11')]()==='in'||_0x58aa2f[_0xfca0('0x10')][_0xfca0('0x11')]()===_0xfca0('0x12')&&!_0x58aa2f[_0xfca0('0x13')]&&!_[_0xfca0('0x14')](_0x58aa2f[_0xfca0('0x15')])){_0x487e7f[_0xfca0('0x16')][_0xfca0('0x17')]({'where':{'id':_0x58aa2f[_0xfca0('0x18')]}})[_0xfca0('0x19')](function(_0x478e56){if(_0x478e56){_0x478e56[_0xfca0('0x1a')]({'lastMsgAt':_0x58aa2f[_0xfca0('0x1b')],'lastMsgDirection':_0x58aa2f['direction'][_0xfca0('0x11')]()});}})[_0xfca0('0x1c')](function(_0x3c9924){console['error'](_0x3c9924);});}_0x269991();}},'charset':_0xfca0('0x1d'),'collate':_0xfca0('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index b3c4ce9..c91b568 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 _0xe4b0=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatMessage','create','body','options','raw','debug','catch','lodash','util'];(function(_0x137173,_0x38df2a){var _0x242689=function(_0x119101){while(--_0x119101){_0x137173['push'](_0x137173['shift']());}};_0x242689(++_0x38df2a);}(_0xe4b0,0x9e));var _0x0e4b=function(_0x202753,_0x209b89){_0x202753=_0x202753-0x0;var _0x2c4038=_0xe4b0[_0x202753];return _0x2c4038;};'use strict';var _=require(_0x0e4b('0x0'));var util=require(_0x0e4b('0x1'));var moment=require(_0x0e4b('0x2'));var BPromise=require(_0x0e4b('0x3'));var rs=require(_0x0e4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e4b('0x5'));var logger=require(_0x0e4b('0x6'))(_0x0e4b('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e4b('0x8'));var client=jayson[_0x0e4b('0x9')][_0x0e4b('0xa')]({'port':0x232a});config[_0x0e4b('0xb')]=_['defaults'](config[_0x0e4b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e4b('0xc'))(new Redis(config['redis']));require(_0x0e4b('0xd'))[_0x0e4b('0xe')](socket);function respondWithRpcPromise(_0x5c0846,_0x5a67d9,_0x2619ed){return new BPromise(function(_0x2bd148,_0x535fc3){return client['request'](_0x5c0846,_0x2619ed)[_0x0e4b('0xf')](function(_0x39bb2b){logger[_0x0e4b('0x10')](_0x0e4b('0x11'),_0x5a67d9,'request\x20sent');logger['debug'](_0x0e4b('0x12'),_0x5a67d9,_0x0e4b('0x13'),JSON[_0x0e4b('0x14')](_0x39bb2b));if(_0x39bb2b['error']){if(_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x16')]===0x1f4){logger[_0x0e4b('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5a67d9,_0x39bb2b['error'][_0x0e4b('0x17')]);return _0x535fc3(_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x17')]);}logger[_0x0e4b('0x15')](_0x0e4b('0x11'),_0x5a67d9,_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x17')]);return _0x2bd148(_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x17')]);}else{logger[_0x0e4b('0x10')](_0x0e4b('0x11'),_0x5a67d9,'request\x20sent');_0x2bd148(_0x39bb2b[_0x0e4b('0x18')][_0x0e4b('0x17')]);}})['catch'](function(_0x3817bc){logger[_0x0e4b('0x15')](_0x0e4b('0x11'),_0x5a67d9,_0x3817bc);_0x535fc3(_0x3817bc);});});}exports[_0x0e4b('0x19')]=function(_0x2ed880){var _0x1a94eb=this;return new Promise(function(_0x3cbdae,_0x2837ee){return db['ChatMessage'][_0x0e4b('0x1a')](_0x2ed880[_0x0e4b('0x1b')],{'raw':_0x2ed880[_0x0e4b('0x1c')]?_0x2ed880[_0x0e4b('0x1c')][_0x0e4b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x551044){logger[_0x0e4b('0x10')]('CreateChatMessage',_0x2ed880);logger[_0x0e4b('0x1e')](_0x0e4b('0x19'),_0x2ed880,JSON['stringify'](_0x551044));_0x3cbdae(_0x551044);})[_0x0e4b('0x1f')](function(_0x4212b5){logger[_0x0e4b('0x15')](_0x0e4b('0x19'),_0x4212b5[_0x0e4b('0x17')],_0x2ed880);_0x2837ee(_0x1a94eb[_0x0e4b('0x15')](0x1f4,_0x4212b5['message']));});});};
\ No newline at end of file
+var _0x2c27=['register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket'];(function(_0x58bb16,_0x5d2f3f){var _0x3e83ef=function(_0x275787){while(--_0x275787){_0x58bb16['push'](_0x58bb16['shift']());}};_0x3e83ef(++_0x5d2f3f);}(_0x2c27,0x9f));var _0x72c2=function(_0x134717,_0x5b6841){_0x134717=_0x134717-0x0;var _0x321b06=_0x2c27[_0x134717];return _0x321b06;};'use strict';var _=require(_0x72c2('0x0'));var util=require(_0x72c2('0x1'));var moment=require(_0x72c2('0x2'));var BPromise=require('bluebird');var rs=require(_0x72c2('0x3'));var fs=require('fs');var Redis=require(_0x72c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x72c2('0x5'));var logger=require(_0x72c2('0x6'))(_0x72c2('0x7'));var config=require(_0x72c2('0x8'));var jayson=require(_0x72c2('0x9'));var client=jayson[_0x72c2('0xa')][_0x72c2('0xb')]({'port':0x232a});config['redis']=_[_0x72c2('0xc')](config[_0x72c2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x72c2('0xe'))(new Redis(config[_0x72c2('0xd')]));require(_0x72c2('0xf'))[_0x72c2('0x10')](socket);function respondWithRpcPromise(_0x623278,_0xc263bb,_0x599db9){return new BPromise(function(_0xcf25c5,_0x1296f5){return client[_0x72c2('0x11')](_0x623278,_0x599db9)[_0x72c2('0x12')](function(_0xb36679){logger[_0x72c2('0x13')](_0x72c2('0x14'),_0xc263bb,'request\x20sent');logger[_0x72c2('0x15')](_0x72c2('0x16'),_0xc263bb,_0x72c2('0x17'),JSON[_0x72c2('0x18')](_0xb36679));if(_0xb36679[_0x72c2('0x19')]){if(_0xb36679[_0x72c2('0x19')]['code']===0x1f4){logger[_0x72c2('0x19')]('ChatMessage,\x20%s,\x20%s',_0xc263bb,_0xb36679[_0x72c2('0x19')][_0x72c2('0x1a')]);return _0x1296f5(_0xb36679[_0x72c2('0x19')]['message']);}logger[_0x72c2('0x19')](_0x72c2('0x14'),_0xc263bb,_0xb36679[_0x72c2('0x19')]['message']);return _0xcf25c5(_0xb36679[_0x72c2('0x19')][_0x72c2('0x1a')]);}else{logger[_0x72c2('0x13')]('ChatMessage,\x20%s,\x20%s',_0xc263bb,_0x72c2('0x17'));_0xcf25c5(_0xb36679[_0x72c2('0x1b')][_0x72c2('0x1a')]);}})[_0x72c2('0x1c')](function(_0x283956){logger[_0x72c2('0x19')]('ChatMessage,\x20%s,\x20%s',_0xc263bb,_0x283956);_0x1296f5(_0x283956);});});}exports['CreateChatMessage']=function(_0x56bfbf){var _0x5148f9=this;return new Promise(function(_0x5ffd18,_0x5509d9){return db[_0x72c2('0x1d')][_0x72c2('0x1e')](_0x56bfbf[_0x72c2('0x1f')],{'raw':_0x56bfbf[_0x72c2('0x20')]?_0x56bfbf[_0x72c2('0x20')][_0x72c2('0x21')]===undefined?!![]:![]:!![]})[_0x72c2('0x12')](function(_0x5254f7){logger[_0x72c2('0x13')](_0x72c2('0x22'),_0x56bfbf);logger[_0x72c2('0x15')]('CreateChatMessage',_0x56bfbf,JSON[_0x72c2('0x18')](_0x5254f7));_0x5ffd18(_0x5254f7);})['catch'](function(_0x1ce66c){logger[_0x72c2('0x19')](_0x72c2('0x22'),_0x1ce66c['message'],_0x56bfbf);_0x5509d9(_0x5148f9[_0x72c2('0x19')](0x1f4,_0x1ce66c['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index b6e3441..8668f65 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 _0x9879=['remove','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x5e8282,_0x1f2962){var _0x5cd37d=function(_0x208ec7){while(--_0x208ec7){_0x5e8282['push'](_0x5e8282['shift']());}};_0x5cd37d(++_0x1f2962);}(_0x9879,0x98));var _0x9987=function(_0x3290a8,_0x37178b){_0x3290a8=_0x3290a8-0x0;var _0x6d3825=_0x9879[_0x3290a8];return _0x6d3825;};'use strict';var ChatMessageEvents=require(_0x9987('0x0'));var events=[_0x9987('0x1'),_0x9987('0x2'),'update'];function createListener(_0xadce9d,_0x525218){return function(_0x3a2473){_0x525218[_0x9987('0x3')](_0xadce9d,_0x3a2473);};}function removeListener(_0x1fd45d,_0xcc5722){return function(){ChatMessageEvents[_0x9987('0x4')](_0x1fd45d,_0xcc5722);};}exports[_0x9987('0x5')]=function(_0x4258df){for(var _0x4d479d=0x0,_0x34d2fd=events['length'];_0x4d479d<_0x34d2fd;_0x4d479d++){var _0x6cb988=events[_0x4d479d];var _0x3e5538=createListener(_0x9987('0x6')+_0x6cb988,_0x4258df);ChatMessageEvents['on'](_0x6cb988,_0x3e5538);}};
\ No newline at end of file
+var _0x8ad5=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x8ad5,0xf1));var _0x58ad=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8ad5[_0x3b380d];return _0x54502b;};'use strict';var ChatMessageEvents=require(_0x58ad('0x0'));var events=[_0x58ad('0x1'),_0x58ad('0x2'),_0x58ad('0x3')];function createListener(_0x4cfe26,_0x5dca8a){return function(_0x1e5eb9){_0x5dca8a[_0x58ad('0x4')](_0x4cfe26,_0x1e5eb9);};}function removeListener(_0x223e54,_0x22aba9){return function(){ChatMessageEvents[_0x58ad('0x5')](_0x223e54,_0x22aba9);};}exports[_0x58ad('0x6')]=function(_0x51d560){for(var _0x5888f7=0x0,_0x394972=events[_0x58ad('0x7')];_0x5888f7<_0x394972;_0x5888f7++){var _0x220c5f=events[_0x5888f7];var _0x2033a3=createListener(_0x58ad('0x8')+_0x220c5f,_0x51d560);ChatMessageEvents['on'](_0x220c5f,_0x2033a3);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 52beee6..22994f6 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 _0x6a1e=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','destroy'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x6a1e,0x6d));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe6a1('0x0'));var util=require(_0xe6a1('0x1'));var path=require(_0xe6a1('0x2'));var timeout=require(_0xe6a1('0x3'));var express=require(_0xe6a1('0x4'));var router=express[_0xe6a1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe6a1('0x6'));var interaction=require(_0xe6a1('0x7'));var config=require('../../config/environment');var controller=require(_0xe6a1('0x8'));router[_0xe6a1('0x9')]('/',auth[_0xe6a1('0xa')](),controller[_0xe6a1('0xb')]);router[_0xe6a1('0x9')](_0xe6a1('0xc'),auth[_0xe6a1('0xa')](),controller['describe']);router[_0xe6a1('0x9')](_0xe6a1('0xd'),auth[_0xe6a1('0xa')](),controller[_0xe6a1('0xe')]);router[_0xe6a1('0xf')]('/',auth[_0xe6a1('0xa')](),interaction[_0xe6a1('0x10')](_0xe6a1('0x11'),_0xe6a1('0x12')),controller[_0xe6a1('0x13')]);router[_0xe6a1('0x14')](_0xe6a1('0xd'),controller[_0xe6a1('0x15')]);router[_0xe6a1('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0xe6a1('0x16')]);router[_0xe6a1('0x14')](_0xe6a1('0x17'),auth['isAuthenticated'](),controller[_0xe6a1('0x18')]);router['delete'](_0xe6a1('0xd'),auth[_0xe6a1('0xa')](),controller[_0xe6a1('0x19')]);module[_0xe6a1('0x1a')]=router;
\ No newline at end of file
+var _0x39e1=['../../components/auth/service','../../config/environment','get','isAuthenticated','describe','chat','chatmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','connect-timeout','express','Router','fs-extra'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x39e1,0x14b));var _0x139e=function(_0x421273,_0x190dc3){_0x421273=_0x421273-0x0;var _0x564b90=_0x39e1[_0x421273];return _0x564b90;};'use strict';var multer=require('multer');var util=require(_0x139e('0x0'));var path=require('path');var timeout=require(_0x139e('0x1'));var express=require(_0x139e('0x2'));var router=express[_0x139e('0x3')]();var fs_extra=require(_0x139e('0x4'));var auth=require(_0x139e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x139e('0x6'));var controller=require('./chatMessage.controller');router[_0x139e('0x7')]('/',auth[_0x139e('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x139e('0x9')]);router['get']('/:id',auth[_0x139e('0x8')](),controller['show']);router['post']('/',auth[_0x139e('0x8')](),interaction['tracked'](_0x139e('0xa'),_0x139e('0xb')),controller[_0x139e('0xc')]);router[_0x139e('0xd')](_0x139e('0xe'),controller['update']);router['put'](_0x139e('0xf'),auth[_0x139e('0x8')](),controller[_0x139e('0x10')]);router[_0x139e('0xd')](_0x139e('0x11'),auth[_0x139e('0x8')](),controller[_0x139e('0x12')]);router[_0x139e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x139e('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 4e609bb..3039d67 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x458cea,_0x5ec209){var _0x2d11ae=function(_0x1f20a1){while(--_0x1f20a1){_0x458cea['push'](_0x458cea['shift']());}};_0x2d11ae(++_0x5ec209);}(_0xb10b,0x12a));var _0xbb10=function(_0x33199e,_0x428ded){_0x33199e=_0x33199e-0x0;var _0x2eef3c=_0xb10b[_0x33199e];return _0x2eef3c;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x36fd49,_0xea7b34){var _0x446d04=function(_0x576c89){while(--_0x576c89){_0x36fd49['push'](_0x36fd49['shift']());}};_0x446d04(++_0xea7b34);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index a567d4e..f98bf65 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2210af,_0x47d68a){var _0x190bb4=function(_0x1d8bc9){while(--_0x1d8bc9){_0x2210af['push'](_0x2210af['shift']());}};_0x190bb4(++_0x47d68a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7a54,0x106));var _0x47a5=function(_0x4f08dd,_0x33b6ec){_0x4f08dd=_0x4f08dd-0x0;var _0x6dd3d7=_0x7a54[_0x4f08dd];return _0x6dd3d7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index a3efda4..7f497bf 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd1f3=['emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','save','update','remove'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd1f3,0x16c));var _0x3d1f=function(_0x2af90c,_0x14fdac){_0x2af90c=_0x2af90c-0x0;var _0x1b493c=_0xd1f3[_0x2af90c];return _0x1b493c;};'use strict';var EventEmitter=require(_0x3d1f('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3d1f('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3d1f('0x2'),'afterUpdate':_0x3d1f('0x3'),'afterDestroy':_0x3d1f('0x4')};function emitEvent(_0x54ef8e){return function(_0x5cbc7f,_0x24345f,_0x16cb2d){ChatOfflineMessageEvents[_0x3d1f('0x5')](_0x54ef8e+':'+_0x5cbc7f['id'],_0x5cbc7f);ChatOfflineMessageEvents[_0x3d1f('0x5')](_0x54ef8e,_0x5cbc7f);_0x16cb2d(null);};}for(var e in events){if(events[_0x3d1f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3d1f('0x7')](e,emitEvent(event));}}module[_0x3d1f('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x8efc=['hasOwnProperty','hook','exports','ChatOfflineMessage','save','remove','emit'];(function(_0x4f0ed9,_0x319274){var _0x58143d=function(_0x4cb6be){while(--_0x4cb6be){_0x4f0ed9['push'](_0x4f0ed9['shift']());}};_0x58143d(++_0x319274);}(_0x8efc,0x8f));var _0xc8ef=function(_0xd27ded,_0x1164e2){_0xd27ded=_0xd27ded-0x0;var _0x5ef850=_0x8efc[_0xd27ded];return _0x5ef850;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0xc8ef('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc8ef('0x1'),'afterUpdate':'update','afterDestroy':_0xc8ef('0x2')};function emitEvent(_0xb39bee){return function(_0x4dbf24,_0x4ee0cc,_0x13b577){ChatOfflineMessageEvents['emit'](_0xb39bee+':'+_0x4dbf24['id'],_0x4dbf24);ChatOfflineMessageEvents[_0xc8ef('0x3')](_0xb39bee,_0x4dbf24);_0x13b577(null);};}for(var e in events){if(events[_0xc8ef('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xc8ef('0x5')](e,emitEvent(event));}}module[_0xc8ef('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 53bc106..ade3620 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 _0x699d=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x215b17,_0x4de070){var _0x1dbe04=function(_0x47311e){while(--_0x47311e){_0x215b17['push'](_0x215b17['shift']());}};_0x1dbe04(++_0x4de070);}(_0x699d,0x1cd));var _0xd699=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x699d[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0xd699('0x0'));module[_0xd699('0x1')]=function(_0x1521f6){return _0x1521f6['define'](_0xd699('0x2'),attributes,{'tableName':_0xd699('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd699('0x4'),'collate':_0xd699('0x5')});};
\ No newline at end of file
+var _0xdd87=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xdd87,0xfc));var _0x7dd8=function(_0x3e9de5,_0x103a03){_0x3e9de5=_0x3e9de5-0x0;var _0x30f865=_0xdd87[_0x3e9de5];return _0x30f865;};'use strict';var attributes=require(_0x7dd8('0x0'));module[_0x7dd8('0x1')]=function(_0x5c9950){return _0x5c9950[_0x7dd8('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x7dd8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7dd8('0x4'),'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 7c1ec02..0832fde 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 _0x221f=['request','then','debug','request\x20sent','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client'];(function(_0x513938,_0x3db266){var _0x20e2d3=function(_0x19189e){while(--_0x19189e){_0x513938['push'](_0x513938['shift']());}};_0x20e2d3(++_0x3db266);}(_0x221f,0x14e));var _0xf221=function(_0x4474c2,_0x59cf02){_0x4474c2=_0x4474c2-0x0;var _0x435fbb=_0x221f[_0x4474c2];return _0x435fbb;};'use strict';var _=require(_0xf221('0x0'));var util=require(_0xf221('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf221('0x2'));var fs=require('fs');var Redis=require(_0xf221('0x3'));var db=require(_0xf221('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf221('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf221('0x6'));var client=jayson[_0xf221('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2402aa,_0xd54b8e,_0x1c6591){return new BPromise(function(_0x55dcf5,_0x50fe01){return client[_0xf221('0x8')](_0x2402aa,_0x1c6591)[_0xf221('0x9')](function(_0x1b6213){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xd54b8e,'request\x20sent');logger[_0xf221('0xa')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xd54b8e,_0xf221('0xb'),JSON[_0xf221('0xc')](_0x1b6213));if(_0x1b6213[_0xf221('0xd')]){if(_0x1b6213['error'][_0xf221('0xe')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xd54b8e,_0x1b6213['error'][_0xf221('0xf')]);return _0x50fe01(_0x1b6213['error'][_0xf221('0xf')]);}logger[_0xf221('0xd')](_0xf221('0x10'),_0xd54b8e,_0x1b6213[_0xf221('0xd')]['message']);return _0x55dcf5(_0x1b6213[_0xf221('0xd')]['message']);}else{logger[_0xf221('0x11')](_0xf221('0x10'),_0xd54b8e,_0xf221('0xb'));_0x55dcf5(_0x1b6213['result']['message']);}})['catch'](function(_0xda249e){logger[_0xf221('0xd')](_0xf221('0x10'),_0xd54b8e,_0xda249e);_0x50fe01(_0xda249e);});});}
\ No newline at end of file
+var _0xec96=['message','ChatOfflineMessage,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xec96,0x119));var _0x6ec9=function(_0x370847,_0x2123f9){_0x370847=_0x370847-0x0;var _0x60fc1b=_0xec96[_0x370847];return _0x60fc1b;};'use strict';var _=require(_0x6ec9('0x0'));var util=require(_0x6ec9('0x1'));var moment=require(_0x6ec9('0x2'));var BPromise=require(_0x6ec9('0x3'));var rs=require(_0x6ec9('0x4'));var fs=require('fs');var Redis=require(_0x6ec9('0x5'));var db=require(_0x6ec9('0x6'))['db'];var utils=require(_0x6ec9('0x7'));var logger=require('../../config/logger')(_0x6ec9('0x8'));var config=require(_0x6ec9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6ec9('0xa')][_0x6ec9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34e1d0,_0x32dd03,_0x53744b){return new BPromise(function(_0x38869b,_0x404ac0){return client[_0x6ec9('0xc')](_0x34e1d0,_0x53744b)[_0x6ec9('0xd')](function(_0x17e5c8){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x32dd03,_0x6ec9('0xe'));logger['debug'](_0x6ec9('0xf'),_0x32dd03,_0x6ec9('0xe'),JSON['stringify'](_0x17e5c8));if(_0x17e5c8[_0x6ec9('0x10')]){if(_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x11')]===0x1f4){logger[_0x6ec9('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32dd03,_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);return _0x404ac0(_0x17e5c8['error'][_0x6ec9('0x12')]);}logger[_0x6ec9('0x10')](_0x6ec9('0x13'),_0x32dd03,_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);return _0x38869b(_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);}else{logger[_0x6ec9('0x14')](_0x6ec9('0x13'),_0x32dd03,_0x6ec9('0xe'));_0x38869b(_0x17e5c8[_0x6ec9('0x15')]['message']);}})[_0x6ec9('0x16')](function(_0x124178){logger['error'](_0x6ec9('0x13'),_0x32dd03,_0x124178);_0x404ac0(_0x124178);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index eff80c4..82b6ef2 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 _0x520f=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe'];(function(_0x8c1ea9,_0x460765){var _0x92f2ac=function(_0x564ebc){while(--_0x564ebc){_0x8c1ea9['push'](_0x8c1ea9['shift']());}};_0x92f2ac(++_0x460765);}(_0x520f,0x1e8));var _0xf520=function(_0x5a2c7b,_0x441265){_0x5a2c7b=_0x5a2c7b-0x0;var _0x3ad931=_0x520f[_0x5a2c7b];return _0x3ad931;};'use strict';var multer=require(_0xf520('0x0'));var util=require('util');var path=require(_0xf520('0x1'));var timeout=require(_0xf520('0x2'));var express=require('express');var router=express[_0xf520('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf520('0x4'));var interaction=require(_0xf520('0x5'));var config=require(_0xf520('0x6'));var controller=require(_0xf520('0x7'));router[_0xf520('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf520('0x8')](_0xf520('0x9'),auth[_0xf520('0xa')](),controller[_0xf520('0xb')]);router['get'](_0xf520('0xc'),auth[_0xf520('0xa')](),controller[_0xf520('0xd')]);router['post']('/',auth[_0xf520('0xa')](),controller[_0xf520('0xe')]);router[_0xf520('0xf')]('/:id',auth[_0xf520('0xa')](),controller[_0xf520('0x10')]);router[_0xf520('0x11')](_0xf520('0xc'),auth[_0xf520('0xa')](),controller[_0xf520('0x12')]);module[_0xf520('0x13')]=router;
\ No newline at end of file
+var _0x48eb=['show','post','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','/:id','isAuthenticated'];(function(_0xdfd39e,_0x400310){var _0x2cf782=function(_0x1cc8c3){while(--_0x1cc8c3){_0xdfd39e['push'](_0xdfd39e['shift']());}};_0x2cf782(++_0x400310);}(_0x48eb,0x147));var _0xb48e=function(_0x2cb4cb,_0x273e65){_0x2cb4cb=_0x2cb4cb-0x0;var _0x5566fd=_0x48eb[_0x2cb4cb];return _0x5566fd;};'use strict';var multer=require(_0xb48e('0x0'));var util=require(_0xb48e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb48e('0x2')]();var fs_extra=require(_0xb48e('0x3'));var auth=require(_0xb48e('0x4'));var interaction=require(_0xb48e('0x5'));var config=require(_0xb48e('0x6'));var controller=require(_0xb48e('0x7'));router[_0xb48e('0x8')]('/',auth['isAuthenticated'](),controller[_0xb48e('0x9')]);router['get'](_0xb48e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xb48e('0x8')](_0xb48e('0xb'),auth[_0xb48e('0xc')](),controller[_0xb48e('0xd')]);router[_0xb48e('0xe')]('/',auth[_0xb48e('0xc')](),controller[_0xb48e('0xf')]);router[_0xb48e('0x10')]('/:id',auth[_0xb48e('0xc')](),controller['update']);router[_0xb48e('0x11')](_0xb48e('0xb'),auth[_0xb48e('0xc')](),controller[_0xb48e('0x12')]);module[_0xb48e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 9961d15..7bcfedd 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 _0x76ef=['timeout','STRING','INTEGER','sequelize','exports','ENUM'];(function(_0x3f5238,_0x39e5b6){var _0x115624=function(_0x57db3a){while(--_0x57db3a){_0x3f5238['push'](_0x3f5238['shift']());}};_0x115624(++_0x39e5b6);}(_0x76ef,0x14d));var _0xf76e=function(_0x2574e7,_0x2165de){_0x2574e7=_0x2574e7-0x0;var _0x39b967=_0x76ef[_0x2574e7];return _0x39b967;};'use strict';var Sequelize=require(_0xf76e('0x0'));module[_0xf76e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf76e('0x2')]('mouseOver',_0xf76e('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xf76e('0x4')]},'timeout':{'type':Sequelize[_0xf76e('0x5')]}};
\ No newline at end of file
+var _0x0bce=['mouseOver','INTEGER','STRING','ENUM'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x0bce,0x18e));var _0xe0bc=function(_0x594745,_0x28d995){_0x594745=_0x594745-0x0;var _0x543ec7=_0x0bce[_0x594745];return _0x543ec7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe0bc('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xe0bc('0x1')](_0xe0bc('0x2'),'timeout'),'defaultValue':_0xe0bc('0x2')},'selector':{'type':Sequelize[_0xe0bc('0x0')]},'timeout':{'type':Sequelize[_0xe0bc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index c3a8754..6201320 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 _0x5243=['mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','catch','destroy','eml-format','fast-json-patch','request-promise'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x5243,0x71));var _0x3524=function(_0x55eb4b,_0x2c3c51){_0x55eb4b=_0x55eb4b-0x0;var _0x525ca2=_0x5243[_0x55eb4b];return _0x525ca2;};'use strict';var emlformat=require(_0x3524('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3524('0x1'));var rp=require(_0x3524('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3524('0x3'));var util=require(_0x3524('0x4'));var path=require('path');var sox=require(_0x3524('0x5'));var csv=require('to-csv');var ejs=require(_0x3524('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3524('0x7'));var squel=require(_0x3524('0x8'));var crypto=require(_0x3524('0x9'));var jsforce=require(_0x3524('0xa'));var deskjs=require(_0x3524('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3524('0xc'));var Redis=require(_0x3524('0xd'));var authService=require(_0x3524('0xe'));var qs=require(_0x3524('0xf'));var as=require(_0x3524('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3524('0x11'))(_0x3524('0x12'));var utils=require('../../config/utils');var config=require(_0x3524('0x13'));var licenseUtil=require(_0x3524('0x14'));var db=require(_0x3524('0x15'))['db'];function respondWithStatusCode(_0x5d5a60,_0x4f49da){_0x4f49da=_0x4f49da||0xcc;return function(_0x50c11f){if(_0x50c11f){return _0x5d5a60['sendStatus'](_0x4f49da);}return _0x5d5a60[_0x3524('0x16')](_0x4f49da)[_0x3524('0x17')]();};}function respondWithResult(_0x58cd29,_0x3aa2da){_0x3aa2da=_0x3aa2da||0xc8;return function(_0x253d92){if(_0x253d92){return _0x58cd29[_0x3524('0x16')](_0x3aa2da)[_0x3524('0x18')](_0x253d92);}};}function respondWithFilteredResult(_0xe5df67,_0x235cfd){return function(_0x34d9a0){if(_0x34d9a0){var _0x8440a4=typeof _0x235cfd[_0x3524('0x19')]==='undefined'&&typeof _0x235cfd[_0x3524('0x1a')]==='undefined';var _0x2eb681=_0x34d9a0[_0x3524('0x1b')];var _0x44ee2e=_0x8440a4?0x0:_0x235cfd[_0x3524('0x19')];var _0x1ca615=_0x8440a4?_0x34d9a0[_0x3524('0x1b')]:_0x235cfd['offset']+_0x235cfd['limit'];var _0x1acbd1;if(_0x1ca615>=_0x2eb681){_0x1ca615=_0x2eb681;_0x1acbd1=0xc8;}else{_0x1acbd1=0xce;}_0xe5df67['status'](_0x1acbd1);return _0xe5df67[_0x3524('0x1c')](_0x3524('0x1d'),_0x44ee2e+'-'+_0x1ca615+'/'+_0x2eb681)[_0x3524('0x18')](_0x34d9a0);}return null;};}function patchUpdates(_0xd285a3){return function(_0x1d25f8){try{jsonpatch[_0x3524('0x1e')](_0x1d25f8,_0xd285a3,!![]);}catch(_0x4f584a){return BPromise[_0x3524('0x1f')](_0x4f584a);}return _0x1d25f8[_0x3524('0x20')]();};}function saveUpdates(_0x1ab2c5,_0xf1b3b1){return function(_0x2d20c8){if(_0x2d20c8){return _0x2d20c8['update'](_0x1ab2c5)[_0x3524('0x21')](function(_0x52600c){return _0x52600c;});}return null;};}function removeEntity(_0x2eb72f,_0x26c20e){return function(_0x101e9a){if(_0x101e9a){return _0x101e9a['destroy']()[_0x3524('0x21')](function(){_0x2eb72f[_0x3524('0x16')](0xcc)[_0x3524('0x17')]();});}};}function handleEntityNotFound(_0x27bd6a,_0x4dfd49){return function(_0x4256ca){if(!_0x4256ca){_0x27bd6a[_0x3524('0x22')](0x194);}return _0x4256ca;};}function handleError(_0x1765a4,_0x5dc071){_0x5dc071=_0x5dc071||0x1f4;return function(_0x1d351e){logger[_0x3524('0x23')](_0x1d351e['stack']);if(_0x1d351e[_0x3524('0x24')]){delete _0x1d351e[_0x3524('0x24')];}_0x1765a4['status'](_0x5dc071)['send'](_0x1d351e);};}exports[_0x3524('0x25')]=function(_0x3fddc1,_0x225b26){var _0x651f11={'raw':!![],'where':{'id':_0x3fddc1[_0x3524('0x26')]['id']}},_0x5bf38e={};_0x5bf38e['model']=_[_0x3524('0x27')](db[_0x3524('0x28')][_0x3524('0x29')]);_0x5bf38e['query']=_['keys'](_0x3fddc1[_0x3524('0x2a')]);_0x5bf38e[_0x3524('0x2b')]=_['intersection'](_0x5bf38e[_0x3524('0x2c')],_0x5bf38e[_0x3524('0x2a')]);_0x651f11[_0x3524('0x2d')]=_[_0x3524('0x2e')](_0x5bf38e[_0x3524('0x2c')],qs['fields'](_0x3fddc1[_0x3524('0x2a')][_0x3524('0x2f')]));_0x651f11[_0x3524('0x2d')]=_0x651f11['attributes'][_0x3524('0x30')]?_0x651f11[_0x3524('0x2d')]:_0x5bf38e[_0x3524('0x2c')];if(_0x3fddc1[_0x3524('0x2a')][_0x3524('0x31')]){_0x651f11[_0x3524('0x32')]=[{'all':!![]}];}_0x651f11=_[_0x3524('0x33')]({},_0x651f11,_0x3fddc1[_0x3524('0x34')]);return db[_0x3524('0x28')][_0x3524('0x35')](_0x651f11)[_0x3524('0x21')](handleEntityNotFound(_0x225b26,null))['then'](respondWithResult(_0x225b26,null))['catch'](handleError(_0x225b26,null));};exports['create']=function(_0x197f78,_0x48b54b){return db[_0x3524('0x28')][_0x3524('0x36')](_0x197f78[_0x3524('0x37')],{})['then'](respondWithResult(_0x48b54b,0xc9))[_0x3524('0x38')](handleError(_0x48b54b,null));};exports['update']=function(_0x18ee71,_0xcc63d5){if(_0x18ee71[_0x3524('0x37')]['id']){delete _0x18ee71[_0x3524('0x37')]['id'];}return db[_0x3524('0x28')]['find']({'where':{'id':_0x18ee71[_0x3524('0x26')]['id']}})[_0x3524('0x21')](handleEntityNotFound(_0xcc63d5,null))[_0x3524('0x21')](saveUpdates(_0x18ee71[_0x3524('0x37')],null))['then'](respondWithResult(_0xcc63d5,null))[_0x3524('0x38')](handleError(_0xcc63d5,null));};exports[_0x3524('0x39')]=function(_0x449c51,_0x97b711){return db[_0x3524('0x28')]['find']({'where':{'id':_0x449c51['params']['id']}})[_0x3524('0x21')](handleEntityNotFound(_0x97b711,null))[_0x3524('0x21')](removeEntity(_0x97b711,null))[_0x3524('0x38')](handleError(_0x97b711,null));};
\ No newline at end of file
+var _0xa566=['params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','update','then','destroy','error','name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','body'];(function(_0x50ca48,_0x493806){var _0x127340=function(_0x340ec7){while(--_0x340ec7){_0x50ca48['push'](_0x50ca48['shift']());}};_0x127340(++_0x493806);}(_0xa566,0x1c1));var _0x6a56=function(_0x192de1,_0x5485f0){_0x192de1=_0x192de1-0x0;var _0x20dc0e=_0xa566[_0x192de1];return _0x20dc0e;};'use strict';var emlformat=require(_0x6a56('0x0'));var rimraf=require(_0x6a56('0x1'));var zipdir=require(_0x6a56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a56('0x3'));var moment=require(_0x6a56('0x4'));var BPromise=require(_0x6a56('0x5'));var Mustache=require(_0x6a56('0x6'));var util=require('util');var path=require(_0x6a56('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a56('0x8'));var squel=require('squel');var crypto=require(_0x6a56('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6a56('0xa'));var toCsv=require(_0x6a56('0xb'));var querystring=require('querystring');var Papa=require(_0x6a56('0xc'));var Redis=require(_0x6a56('0xd'));var authService=require(_0x6a56('0xe'));var qs=require(_0x6a56('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a56('0x10'));var logger=require(_0x6a56('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6a56('0x12'));var licenseUtil=require(_0x6a56('0x13'));var db=require(_0x6a56('0x14'))['db'];function respondWithStatusCode(_0x26f443,_0x3e9389){_0x3e9389=_0x3e9389||0xcc;return function(_0x10f894){if(_0x10f894){return _0x26f443[_0x6a56('0x15')](_0x3e9389);}return _0x26f443['status'](_0x3e9389)[_0x6a56('0x16')]();};}function respondWithResult(_0x14237e,_0x46fbaa){_0x46fbaa=_0x46fbaa||0xc8;return function(_0x10fd64){if(_0x10fd64){return _0x14237e[_0x6a56('0x17')](_0x46fbaa)['json'](_0x10fd64);}};}function respondWithFilteredResult(_0x232176,_0xc0e603){return function(_0x28bb4e){if(_0x28bb4e){var _0xc5f78d=typeof _0xc0e603[_0x6a56('0x18')]==='undefined'&&typeof _0xc0e603['limit']===_0x6a56('0x19');var _0x2288b1=_0x28bb4e['count'];var _0x162c52=_0xc5f78d?0x0:_0xc0e603[_0x6a56('0x18')];var _0x4c2f9c=_0xc5f78d?_0x28bb4e[_0x6a56('0x1a')]:_0xc0e603[_0x6a56('0x18')]+_0xc0e603['limit'];var _0x26b33e;if(_0x4c2f9c>=_0x2288b1){_0x4c2f9c=_0x2288b1;_0x26b33e=0xc8;}else{_0x26b33e=0xce;}_0x232176['status'](_0x26b33e);return _0x232176[_0x6a56('0x1b')]('Content-Range',_0x162c52+'-'+_0x4c2f9c+'/'+_0x2288b1)[_0x6a56('0x1c')](_0x28bb4e);}return null;};}function patchUpdates(_0x2239ff){return function(_0x11e479){try{jsonpatch[_0x6a56('0x1d')](_0x11e479,_0x2239ff,!![]);}catch(_0x32118b){return BPromise[_0x6a56('0x1e')](_0x32118b);}return _0x11e479['save']();};}function saveUpdates(_0x2e217a,_0x148548){return function(_0x4845aa){if(_0x4845aa){return _0x4845aa[_0x6a56('0x1f')](_0x2e217a)[_0x6a56('0x20')](function(_0x3cf1b3){return _0x3cf1b3;});}return null;};}function removeEntity(_0x5a0986,_0x2a6ece){return function(_0x3e0aab){if(_0x3e0aab){return _0x3e0aab[_0x6a56('0x21')]()[_0x6a56('0x20')](function(){_0x5a0986[_0x6a56('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d23a,_0x5ce125){return function(_0x302316){if(!_0x302316){_0x51d23a[_0x6a56('0x15')](0x194);}return _0x302316;};}function handleError(_0x2bd80f,_0x55e714){_0x55e714=_0x55e714||0x1f4;return function(_0x1df843){logger[_0x6a56('0x22')](_0x1df843['stack']);if(_0x1df843[_0x6a56('0x23')]){delete _0x1df843[_0x6a56('0x23')];}_0x2bd80f[_0x6a56('0x17')](_0x55e714)['send'](_0x1df843);};}exports[_0x6a56('0x24')]=function(_0x27bcd0,_0x151537){var _0xe26d09={'raw':!![],'where':{'id':_0x27bcd0['params']['id']}},_0x10b1cb={};_0x10b1cb[_0x6a56('0x25')]=_[_0x6a56('0x26')](db[_0x6a56('0x27')][_0x6a56('0x28')]);_0x10b1cb['query']=_[_0x6a56('0x26')](_0x27bcd0[_0x6a56('0x29')]);_0x10b1cb[_0x6a56('0x2a')]=_['intersection'](_0x10b1cb[_0x6a56('0x25')],_0x10b1cb['query']);_0xe26d09[_0x6a56('0x2b')]=_[_0x6a56('0x2c')](_0x10b1cb[_0x6a56('0x25')],qs[_0x6a56('0x2d')](_0x27bcd0[_0x6a56('0x29')][_0x6a56('0x2d')]));_0xe26d09[_0x6a56('0x2b')]=_0xe26d09[_0x6a56('0x2b')][_0x6a56('0x2e')]?_0xe26d09[_0x6a56('0x2b')]:_0x10b1cb[_0x6a56('0x25')];if(_0x27bcd0['query'][_0x6a56('0x2f')]){_0xe26d09[_0x6a56('0x30')]=[{'all':!![]}];}_0xe26d09=_[_0x6a56('0x31')]({},_0xe26d09,_0x27bcd0[_0x6a56('0x32')]);return db['ChatProactiveAction'][_0x6a56('0x33')](_0xe26d09)[_0x6a56('0x20')](handleEntityNotFound(_0x151537,null))[_0x6a56('0x20')](respondWithResult(_0x151537,null))[_0x6a56('0x34')](handleError(_0x151537,null));};exports['create']=function(_0xf4ff24,_0xadea5b){return db['ChatProactiveAction'][_0x6a56('0x35')](_0xf4ff24['body'],{})[_0x6a56('0x20')](respondWithResult(_0xadea5b,0xc9))[_0x6a56('0x34')](handleError(_0xadea5b,null));};exports[_0x6a56('0x1f')]=function(_0x390444,_0x22ad72){if(_0x390444[_0x6a56('0x36')]['id']){delete _0x390444[_0x6a56('0x36')]['id'];}return db['ChatProactiveAction'][_0x6a56('0x33')]({'where':{'id':_0x390444[_0x6a56('0x37')]['id']}})[_0x6a56('0x20')](handleEntityNotFound(_0x22ad72,null))[_0x6a56('0x20')](saveUpdates(_0x390444[_0x6a56('0x36')],null))[_0x6a56('0x20')](respondWithResult(_0x22ad72,null))[_0x6a56('0x34')](handleError(_0x22ad72,null));};exports[_0x6a56('0x21')]=function(_0x130426,_0x4b1f65){return db[_0x6a56('0x27')][_0x6a56('0x33')]({'where':{'id':_0x130426[_0x6a56('0x37')]['id']}})[_0x6a56('0x20')](handleEntityNotFound(_0x4b1f65,null))[_0x6a56('0x20')](removeEntity(_0x4b1f65,null))[_0x6a56('0x34')](handleError(_0x4b1f65,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index a81e884..7721261 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 _0x6524=['moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api'];(function(_0x3050c5,_0x51747a){var _0x1dd23c=function(_0x36f880){while(--_0x36f880){_0x3050c5['push'](_0x3050c5['shift']());}};_0x1dd23c(++_0x51747a);}(_0x6524,0x1e9));var _0x4652=function(_0x54781c,_0x5b5683){_0x54781c=_0x54781c-0x0;var _0x4804bc=_0x6524[_0x54781c];return _0x4804bc;};'use strict';var _=require(_0x4652('0x0'));var util=require(_0x4652('0x1'));var logger=require('../../config/logger')(_0x4652('0x2'));var moment=require(_0x4652('0x3'));var BPromise=require(_0x4652('0x4'));var rp=require(_0x4652('0x5'));var fs=require('fs');var path=require(_0x4652('0x6'));var rimraf=require(_0x4652('0x7'));var config=require('../../config/environment');var attributes=require(_0x4652('0x8'));module['exports']=function(_0x4e602e,_0x14864f){return _0x4e602e[_0x4652('0x9')](_0x4652('0xa'),attributes,{'tableName':_0x4652('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x26dd=['path','../../config/environment','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4580eb,_0x5d0afa){var _0x3f7f92=function(_0x34a6d0){while(--_0x34a6d0){_0x4580eb['push'](_0x4580eb['shift']());}};_0x3f7f92(++_0x5d0afa);}(_0x26dd,0xf5));var _0xd26d=function(_0xdf61c7,_0x4dbc6e){_0xdf61c7=_0xdf61c7-0x0;var _0x3bb686=_0x26dd[_0xdf61c7];return _0x3bb686;};'use strict';var _=require(_0xd26d('0x0'));var util=require(_0xd26d('0x1'));var logger=require(_0xd26d('0x2'))('api');var moment=require(_0xd26d('0x3'));var BPromise=require(_0xd26d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd26d('0x5'));var rimraf=require('rimraf');var config=require(_0xd26d('0x6'));var attributes=require(_0xd26d('0x7'));module['exports']=function(_0x1a5196,_0x4b653b){return _0x1a5196['define'](_0xd26d('0x8'),attributes,{'tableName':_0xd26d('0x9'),'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 0543df6..694c2b5 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 _0xa167=['../../config/environment','jayson/promise','client','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4b6778,_0x505a76){var _0x22dbb9=function(_0x4881eb){while(--_0x4881eb){_0x4b6778['push'](_0x4b6778['shift']());}};_0x22dbb9(++_0x505a76);}(_0xa167,0xce));var _0x7a16=function(_0x52b902,_0x43c4aa){_0x52b902=_0x52b902-0x0;var _0x397611=_0xa167[_0x52b902];return _0x397611;};'use strict';var _=require(_0x7a16('0x0'));var util=require(_0x7a16('0x1'));var moment=require(_0x7a16('0x2'));var BPromise=require(_0x7a16('0x3'));var rs=require(_0x7a16('0x4'));var fs=require('fs');var Redis=require(_0x7a16('0x5'));var db=require(_0x7a16('0x6'))['db'];var utils=require(_0x7a16('0x7'));var logger=require(_0x7a16('0x8'))(_0x7a16('0x9'));var config=require(_0x7a16('0xa'));var jayson=require(_0x7a16('0xb'));var client=jayson[_0x7a16('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x173fd5,_0x15c517,_0x2c9012){return new BPromise(function(_0x5b23cf,_0x116fe3){return client['request'](_0x173fd5,_0x2c9012)[_0x7a16('0xd')](function(_0x1570b0){logger['info'](_0x7a16('0xe'),_0x15c517,_0x7a16('0xf'));logger[_0x7a16('0x10')](_0x7a16('0x11'),_0x15c517,'request\x20sent',JSON['stringify'](_0x1570b0));if(_0x1570b0[_0x7a16('0x12')]){if(_0x1570b0[_0x7a16('0x12')][_0x7a16('0x13')]===0x1f4){logger['error'](_0x7a16('0xe'),_0x15c517,_0x1570b0[_0x7a16('0x12')][_0x7a16('0x14')]);return _0x116fe3(_0x1570b0[_0x7a16('0x12')]['message']);}logger[_0x7a16('0x12')](_0x7a16('0xe'),_0x15c517,_0x1570b0['error'][_0x7a16('0x14')]);return _0x5b23cf(_0x1570b0['error']['message']);}else{logger[_0x7a16('0x15')](_0x7a16('0xe'),_0x15c517,_0x7a16('0xf'));_0x5b23cf(_0x1570b0[_0x7a16('0x16')][_0x7a16('0x14')]);}})[_0x7a16('0x17')](function(_0x40a4da){logger[_0x7a16('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x15c517,_0x40a4da);_0x116fe3(_0x40a4da);});});}
\ No newline at end of file
+var _0xfca1=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird'];(function(_0x118814,_0x1d5d0e){var _0x4dd647=function(_0x4f89f9){while(--_0x4f89f9){_0x118814['push'](_0x118814['shift']());}};_0x4dd647(++_0x1d5d0e);}(_0xfca1,0x168));var _0x1fca=function(_0x2e9497,_0x46a98d){_0x2e9497=_0x2e9497-0x0;var _0x59e0ab=_0xfca1[_0x2e9497];return _0x59e0ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1fca('0x0'));var rs=require(_0x1fca('0x1'));var fs=require('fs');var Redis=require(_0x1fca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fca('0x3'));var logger=require('../../config/logger')(_0x1fca('0x4'));var config=require('../../config/environment');var jayson=require(_0x1fca('0x5'));var client=jayson[_0x1fca('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365e3e,_0x3c4c3d,_0xf917af){return new BPromise(function(_0x573217,_0x1d5771){return client[_0x1fca('0x7')](_0x365e3e,_0xf917af)[_0x1fca('0x8')](function(_0x404500){logger[_0x1fca('0x9')](_0x1fca('0xa'),_0x3c4c3d,_0x1fca('0xb'));logger[_0x1fca('0xc')](_0x1fca('0xd'),_0x3c4c3d,'request\x20sent',JSON[_0x1fca('0xe')](_0x404500));if(_0x404500[_0x1fca('0xf')]){if(_0x404500['error'][_0x1fca('0x10')]===0x1f4){logger[_0x1fca('0xf')](_0x1fca('0xa'),_0x3c4c3d,_0x404500[_0x1fca('0xf')][_0x1fca('0x11')]);return _0x1d5771(_0x404500[_0x1fca('0xf')][_0x1fca('0x11')]);}logger[_0x1fca('0xf')](_0x1fca('0xa'),_0x3c4c3d,_0x404500[_0x1fca('0xf')]['message']);return _0x573217(_0x404500[_0x1fca('0xf')][_0x1fca('0x11')]);}else{logger[_0x1fca('0x9')](_0x1fca('0xa'),_0x3c4c3d,'request\x20sent');_0x573217(_0x404500['result'][_0x1fca('0x11')]);}})[_0x1fca('0x12')](function(_0x1280b0){logger[_0x1fca('0xf')](_0x1fca('0xa'),_0x3c4c3d,_0x1280b0);_0x1d5771(_0x1280b0);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 38f1fd9..1bfc642 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac9d=['get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3093ea,_0x3a94bc){var _0x19d889=function(_0x858d3e){while(--_0x858d3e){_0x3093ea['push'](_0x3093ea['shift']());}};_0x19d889(++_0x3a94bc);}(_0xac9d,0x14d));var _0xdac9=function(_0x4a8227,_0x27ab19){_0x4a8227=_0x4a8227-0x0;var _0x403b2c=_0xac9d[_0x4a8227];return _0x403b2c;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xdac9('0x9')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0xc')]);router[_0xdac9('0xd')]('/',auth[_0xdac9('0xb')](),controller['create']);router[_0xdac9('0xe')]('/:id',auth[_0xdac9('0xb')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router;
\ No newline at end of file
+var _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x11f50c,_0x28e6e8){var _0x230df2=function(_0x319145){while(--_0x319145){_0x11f50c['push'](_0x11f50c['shift']());}};_0x230df2(++_0x28e6e8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5b9d0a,_0x105c2a){_0x5b9d0a=_0x5b9d0a-0x0;var _0x1eb7cb=_0xdbf5[_0x5b9d0a];return _0x1eb7cb;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 565eb8e..7262b40 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 _0x14dd=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x14dd,0x196));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd14d('0x0'));module[_0xd14d('0x1')]={'name':{'type':Sequelize[_0xd14d('0x2')],'unique':_0xd14d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd14d('0x2')]},'timeout':{'type':Sequelize[_0xd14d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd14d('0x5')]('rrmemory',_0xd14d('0x6'),_0xd14d('0x7'))}};
\ No newline at end of file
+var _0x6d5d=['sequelize','exports','INTEGER','beepall'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x6d5d,0x1d4));var _0xd6d5=function(_0x5a5c58,_0x26ced8){_0x5a5c58=_0x5a5c58-0x0;var _0x2e76b9=_0x6d5d[_0x5a5c58];return _0x2e76b9;};'use strict';var Sequelize=require(_0xd6d5('0x0'));module[_0xd6d5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd6d5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xd6d5('0x3'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index ec16ed2..df73d2a 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 _0xfc18=['value','transaction','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','get','UserProfileResource','destroy','stack','name','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatQueue','includeAll','include','findAll','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','getMembers','findOne','ChatQueueId','UserId','agent','chatPause','createdAt','format','getTeams','addTeams','User','Agents','online','interface','sequelize','each','UserChatQueue','findOrCreate','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact'];(function(_0x193249,_0x2104b6){var _0x224eb3=function(_0x2bccd2){while(--_0x2bccd2){_0x193249['push'](_0x193249['shift']());}};_0x224eb3(++_0x2104b6);}(_0xfc18,0x1da));var _0x8fc1=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xfc18[_0x4eafed];return _0x159c85;};'use strict';var emlformat=require(_0x8fc1('0x0'));var rimraf=require(_0x8fc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8fc1('0x2'));var BPromise=require(_0x8fc1('0x3'));var Mustache=require(_0x8fc1('0x4'));var util=require('util');var path=require(_0x8fc1('0x5'));var sox=require(_0x8fc1('0x6'));var csv=require('to-csv');var ejs=require(_0x8fc1('0x7'));var fs=require('fs');var fs_extra=require(_0x8fc1('0x8'));var _=require(_0x8fc1('0x9'));var squel=require(_0x8fc1('0xa'));var crypto=require(_0x8fc1('0xb'));var jsforce=require(_0x8fc1('0xc'));var deskjs=require(_0x8fc1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8fc1('0xe'));var Papa=require(_0x8fc1('0xf'));var Redis=require(_0x8fc1('0x10'));var authService=require(_0x8fc1('0x11'));var qs=require(_0x8fc1('0x12'));var as=require(_0x8fc1('0x13'));var hardwareService=require(_0x8fc1('0x14'));var logger=require(_0x8fc1('0x15'))(_0x8fc1('0x16'));var utils=require(_0x8fc1('0x17'));var config=require(_0x8fc1('0x18'));var licenseUtil=require(_0x8fc1('0x19'));var db=require(_0x8fc1('0x1a'))['db'];config[_0x8fc1('0x1b')]=_[_0x8fc1('0x1c')](config[_0x8fc1('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fc1('0x1d'))(new Redis(config[_0x8fc1('0x1b')]));require(_0x8fc1('0x1e'))[_0x8fc1('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8fc1('0x20')][_0x8fc1('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x894d0b,_0x4daac1,_0x395cf1,_0x1efc11){return new BPromise(function(_0x5ddf2d,_0x282589){var _0x52527f=_0x1efc11||client;return _0x52527f[_0x8fc1('0x22')](_0x894d0b,_0x395cf1)[_0x8fc1('0x23')](function(_0x177331){logger[_0x8fc1('0x24')](_0x8fc1('0x25'),_0x4daac1,'request\x20sent');logger[_0x8fc1('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4daac1,_0x8fc1('0x27'),JSON[_0x8fc1('0x28')](_0x177331));if(_0x177331['error']){if(_0x177331['error'][_0x8fc1('0x29')]===0x1f4){logger[_0x8fc1('0x2a')](_0x8fc1('0x25'),_0x4daac1,_0x177331[_0x8fc1('0x2a')][_0x8fc1('0x2b')]);return _0x282589(_0x177331[_0x8fc1('0x2a')][_0x8fc1('0x2b')]);}logger[_0x8fc1('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x4daac1,_0x177331['error'][_0x8fc1('0x2b')]);return _0x5ddf2d(_0x177331[_0x8fc1('0x2a')][_0x8fc1('0x2b')]);}else{logger[_0x8fc1('0x24')](_0x8fc1('0x25'),_0x4daac1,_0x8fc1('0x27'));_0x5ddf2d(_0x177331[_0x8fc1('0x2c')][_0x8fc1('0x2b')]);}})[_0x8fc1('0x2d')](function(_0x1dd479){logger[_0x8fc1('0x2a')](_0x8fc1('0x25'),_0x4daac1,_0x1dd479);_0x282589(_0x1dd479);});});}function respondWithStatusCode(_0x4d6caa,_0x194e44){_0x194e44=_0x194e44||0xcc;return function(_0x44a1ae){if(_0x44a1ae){return _0x4d6caa[_0x8fc1('0x2e')](_0x194e44);}return _0x4d6caa[_0x8fc1('0x2f')](_0x194e44)[_0x8fc1('0x30')]();};}function respondWithResult(_0x56af10,_0x5d2dd1){_0x5d2dd1=_0x5d2dd1||0xc8;return function(_0x4ab9cb){if(_0x4ab9cb){return _0x56af10['status'](_0x5d2dd1)[_0x8fc1('0x31')](_0x4ab9cb);}};}function respondWithFilteredResult(_0x2f34f9,_0x557a22){return function(_0x516b77){if(_0x516b77){var _0x224f9b=typeof _0x557a22[_0x8fc1('0x32')]===_0x8fc1('0x33')&&typeof _0x557a22[_0x8fc1('0x34')]==='undefined';var _0x4d7420=_0x516b77[_0x8fc1('0x35')];var _0x2cf6db=_0x224f9b?0x0:_0x557a22[_0x8fc1('0x32')];var _0x2c95fe=_0x224f9b?_0x516b77[_0x8fc1('0x35')]:_0x557a22[_0x8fc1('0x32')]+_0x557a22[_0x8fc1('0x34')];var _0x1d59eb;if(_0x2c95fe>=_0x4d7420){_0x2c95fe=_0x4d7420;_0x1d59eb=0xc8;}else{_0x1d59eb=0xce;}_0x2f34f9['status'](_0x1d59eb);return _0x2f34f9[_0x8fc1('0x36')](_0x8fc1('0x37'),_0x2cf6db+'-'+_0x2c95fe+'/'+_0x4d7420)[_0x8fc1('0x31')](_0x516b77);}return null;};}function patchUpdates(_0x380892){return function(_0x529592){try{jsonpatch[_0x8fc1('0x38')](_0x529592,_0x380892,!![]);}catch(_0x16d50f){return BPromise[_0x8fc1('0x39')](_0x16d50f);}return _0x529592[_0x8fc1('0x3a')]();};}function saveUpdates(_0x5cf19b,_0x19dbe9){return function(_0x47ab20){if(_0x47ab20){return _0x47ab20['update'](_0x5cf19b)[_0x8fc1('0x23')](function(_0x17689c){return _0x17689c;});}return null;};}function removeEntity(_0x505c92,_0x5a0982){return function(_0x31216f){if(_0x31216f){return _0x31216f['destroy']()[_0x8fc1('0x23')](function(){var _0x5d794b=_0x31216f[_0x8fc1('0x3b')]({'plain':!![]});var _0x4b8487='ChatQueues';return db[_0x8fc1('0x3c')][_0x8fc1('0x3d')]({'where':{'type':_0x4b8487,'resourceId':_0x5d794b['id']}})[_0x8fc1('0x23')](function(){return _0x31216f;});})['then'](function(){_0x505c92[_0x8fc1('0x2f')](0xcc)[_0x8fc1('0x30')]();});}};}function handleEntityNotFound(_0x1d8e78,_0x4845e6){return function(_0xe8e791){if(!_0xe8e791){_0x1d8e78[_0x8fc1('0x2e')](0x194);}return _0xe8e791;};}function handleError(_0x353104,_0x3e4631){_0x3e4631=_0x3e4631||0x1f4;return function(_0x320f01){logger[_0x8fc1('0x2a')](_0x320f01[_0x8fc1('0x3e')]);if(_0x320f01[_0x8fc1('0x3f')]){delete _0x320f01[_0x8fc1('0x3f')];}_0x353104['status'](_0x3e4631)['send'](_0x320f01);};}exports['index']=function(_0x3d9898,_0x11771b){var _0x39fd1b={},_0xdc39e3={},_0x1f477f={'count':0x0,'rows':[]};var _0x54eeb3=_['map'](db['ChatQueue'][_0x8fc1('0x40')],function(_0xc79d98){return{'name':_0xc79d98[_0x8fc1('0x41')],'type':_0xc79d98[_0x8fc1('0x42')][_0x8fc1('0x43')]};});_0xdc39e3['model']=_[_0x8fc1('0x44')](_0x54eeb3,_0x8fc1('0x3f'));_0xdc39e3[_0x8fc1('0x45')]=_[_0x8fc1('0x46')](_0x3d9898[_0x8fc1('0x45')]);_0xdc39e3['filters']=_[_0x8fc1('0x47')](_0xdc39e3[_0x8fc1('0x48')],_0xdc39e3[_0x8fc1('0x45')]);_0x39fd1b[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0xdc39e3['model'],qs[_0x8fc1('0x4a')](_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x39fd1b[_0x8fc1('0x49')]=_0x39fd1b[_0x8fc1('0x49')][_0x8fc1('0x4b')]?_0x39fd1b[_0x8fc1('0x49')]:_0xdc39e3['model'];if(!_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x4c')](_0x8fc1('0x4d'))){_0x39fd1b[_0x8fc1('0x34')]=qs[_0x8fc1('0x34')](_0x3d9898['query'][_0x8fc1('0x34')]);_0x39fd1b['offset']=qs['offset'](_0x3d9898['query']['offset']);}_0x39fd1b[_0x8fc1('0x4e')]=qs[_0x8fc1('0x4f')](_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x4f')]);_0x39fd1b[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_[_0x8fc1('0x52')](_0x3d9898['query'],_0xdc39e3[_0x8fc1('0x51')]),_0x54eeb3);if(_0x3d9898['query'][_0x8fc1('0x53')]){_0x39fd1b['where']=_['merge'](_0x39fd1b[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x54eeb3,function(_0x542634){if(_0x542634['type']!==_0x8fc1('0x54')){var _0x52efde={};_0x52efde[_0x542634[_0x8fc1('0x3f')]]={'$like':'%'+_0x3d9898['query'][_0x8fc1('0x53')]+'%'};return _0x52efde;}})});}_0x39fd1b=_[_0x8fc1('0x55')]({},_0x39fd1b,_0x3d9898[_0x8fc1('0x56')]);var _0x29ad45={'where':_0x39fd1b[_0x8fc1('0x50')]};return db[_0x8fc1('0x57')][_0x8fc1('0x35')](_0x29ad45)[_0x8fc1('0x23')](function(_0x5a1e2b){_0x1f477f[_0x8fc1('0x35')]=_0x5a1e2b;if(_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x58')]){_0x39fd1b[_0x8fc1('0x59')]=[{'all':!![]}];}return db[_0x8fc1('0x57')][_0x8fc1('0x5a')](_0x39fd1b);})['then'](function(_0x1b3f8a){_0x1f477f['rows']=_0x1b3f8a;return _0x1f477f;})[_0x8fc1('0x23')](respondWithFilteredResult(_0x11771b,_0x39fd1b))['catch'](handleError(_0x11771b,null));};exports[_0x8fc1('0x5b')]=function(_0x411551,_0x519962){var _0x34fd11={'raw':!![],'where':{'id':_0x411551['params']['id']}},_0xc0540c={};_0xc0540c[_0x8fc1('0x48')]=_[_0x8fc1('0x46')](db[_0x8fc1('0x57')]['rawAttributes']);_0xc0540c[_0x8fc1('0x45')]=_[_0x8fc1('0x46')](_0x411551['query']);_0xc0540c[_0x8fc1('0x51')]=_['intersection'](_0xc0540c[_0x8fc1('0x48')],_0xc0540c[_0x8fc1('0x45')]);_0x34fd11[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0xc0540c[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x411551[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x34fd11[_0x8fc1('0x49')]=_0x34fd11[_0x8fc1('0x49')]['length']?_0x34fd11[_0x8fc1('0x49')]:_0xc0540c[_0x8fc1('0x48')];if(_0x411551[_0x8fc1('0x45')]['includeAll']){_0x34fd11[_0x8fc1('0x59')]=[{'all':!![]}];}_0x34fd11=_[_0x8fc1('0x55')]({},_0x34fd11,_0x411551['options']);return db[_0x8fc1('0x57')]['find'](_0x34fd11)[_0x8fc1('0x23')](handleEntityNotFound(_0x519962,null))[_0x8fc1('0x23')](respondWithResult(_0x519962,null))[_0x8fc1('0x2d')](handleError(_0x519962,null));};exports['create']=function(_0x15dd10,_0x2ab9df){return db[_0x8fc1('0x57')][_0x8fc1('0x5c')](_0x15dd10['body'],{})[_0x8fc1('0x23')](function(_0x41bcee){var _0x2c4351=_0x15dd10[_0x8fc1('0x5d')]['get']({'plain':!![]});if(!_0x2c4351)throw new Error(_0x8fc1('0x5e'));if(_0x2c4351[_0x8fc1('0x5f')]===_0x8fc1('0x5d')){var _0x7e6e94=_0x41bcee['get']({'plain':!![]});var _0x4833ab=_0x8fc1('0x60');return db['UserProfileSection'][_0x8fc1('0x61')]({'where':{'name':_0x4833ab,'userProfileId':_0x2c4351[_0x8fc1('0x62')]},'raw':!![]})[_0x8fc1('0x23')](function(_0x1aa39e){if(_0x1aa39e&&_0x1aa39e[_0x8fc1('0x63')]===0x0){return db['UserProfileResource'][_0x8fc1('0x5c')]({'name':_0x7e6e94[_0x8fc1('0x3f')],'resourceId':_0x7e6e94['id'],'type':_0x1aa39e[_0x8fc1('0x3f')],'sectionId':_0x1aa39e['id']},{})[_0x8fc1('0x23')](function(){return _0x41bcee;});}else{return _0x41bcee;}})[_0x8fc1('0x2d')](function(_0x10c7f7){logger[_0x8fc1('0x2a')](_0x8fc1('0x64'),_0x10c7f7);throw _0x10c7f7;});}return _0x41bcee;})[_0x8fc1('0x23')](respondWithResult(_0x2ab9df,0xc9))[_0x8fc1('0x2d')](handleError(_0x2ab9df,null));};exports[_0x8fc1('0x65')]=function(_0x4a2309,_0x3a4094){if(_0x4a2309[_0x8fc1('0x66')]['id']){delete _0x4a2309['body']['id'];}return db[_0x8fc1('0x57')]['find']({'where':{'id':_0x4a2309[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x3a4094,null))[_0x8fc1('0x23')](saveUpdates(_0x4a2309['body'],null))[_0x8fc1('0x23')](respondWithResult(_0x3a4094,null))[_0x8fc1('0x2d')](handleError(_0x3a4094,null));};exports[_0x8fc1('0x3d')]=function(_0x48eb9a,_0x310ca2){return db['ChatQueue']['find']({'where':{'id':_0x48eb9a[_0x8fc1('0x67')]['id']}})['then'](handleEntityNotFound(_0x310ca2,null))[_0x8fc1('0x23')](removeEntity(_0x310ca2,null))[_0x8fc1('0x2d')](handleError(_0x310ca2,null));};exports[_0x8fc1('0x68')]=function(_0x372b44,_0xb84d9d){return db['ChatQueue'][_0x8fc1('0x68')]()[_0x8fc1('0x23')](respondWithResult(_0xb84d9d,null))[_0x8fc1('0x2d')](handleError(_0xb84d9d,null));};exports[_0x8fc1('0x69')]=function(_0x1c9f80,_0x42cbe5,_0x208948){var _0x589de0={'raw':!![],'where':{}},_0x21ac3f={},_0xe0ffff;return db[_0x8fc1('0x57')][_0x8fc1('0x6a')]({'where':{'id':_0x1c9f80[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x42cbe5,null))[_0x8fc1('0x23')](function(_0x28e9a7){if(_0x28e9a7){_0xe0ffff=_0x28e9a7[_0x8fc1('0x3b')]({'plain':!![]});_0x21ac3f['model']=_[_0x8fc1('0x46')](db['UserChatQueue'][_0x8fc1('0x40')]);_0x21ac3f[_0x8fc1('0x45')]=_[_0x8fc1('0x46')](_0x1c9f80['query']);_0x21ac3f[_0x8fc1('0x51')]=_[_0x8fc1('0x47')](_0x21ac3f['model'],_0x21ac3f['query']);_0x589de0[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0x21ac3f[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x1c9f80[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x589de0[_0x8fc1('0x49')]=_0x589de0[_0x8fc1('0x49')][_0x8fc1('0x4b')]?_0x589de0[_0x8fc1('0x49')]:_0x21ac3f[_0x8fc1('0x48')];if(!_0x1c9f80[_0x8fc1('0x45')]['hasOwnProperty']('nolimit')){_0x589de0[_0x8fc1('0x34')]=qs[_0x8fc1('0x34')](_0x1c9f80[_0x8fc1('0x45')][_0x8fc1('0x34')]);_0x589de0[_0x8fc1('0x32')]=qs[_0x8fc1('0x32')](_0x1c9f80[_0x8fc1('0x45')][_0x8fc1('0x32')]);}_0x589de0[_0x8fc1('0x4e')]=qs[_0x8fc1('0x4f')](_0x1c9f80[_0x8fc1('0x45')]['sort']);_0x589de0[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_[_0x8fc1('0x52')](_0x1c9f80['query'],_0x21ac3f[_0x8fc1('0x51')]));_0x589de0['where'][_0x8fc1('0x6b')]=_0x28e9a7['id'];if(_0x1c9f80[_0x8fc1('0x45')]['filter']){_0x589de0[_0x8fc1('0x50')]=_[_0x8fc1('0x55')](_0x589de0[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x589de0[_0x8fc1('0x49')],function(_0x1dfcd0){var _0x4dd067={};_0x4dd067[_0x1dfcd0]={'$like':'%'+_0x1c9f80[_0x8fc1('0x45')]['filter']+'%'};return _0x4dd067;})});}_0x589de0=_[_0x8fc1('0x55')]({},_0x589de0,_0x1c9f80[_0x8fc1('0x56')]);return db['UserChatQueue'][_0x8fc1('0x5a')](_0x589de0);}})[_0x8fc1('0x23')](function(_0x3f7eb4){if(_0x3f7eb4){return db['User']['findAndCountAll']({'where':{'id':_[_0x8fc1('0x44')](_0x3f7eb4,_0x8fc1('0x6c')),'role':_0x8fc1('0x6d')},'attributes':['id','name',_0x8fc1('0x6e'),'updatedAt',_0x8fc1('0x6f')]});}})[_0x8fc1('0x23')](function(_0x5575dc){if(_0x5575dc){return{'count':_0x5575dc['count'],'rows':_[_0x8fc1('0x44')](_0x5575dc['rows'],function(_0x127210){return{'membername':_0x127210[_0x8fc1('0x3f')],'UserId':_0x127210['id'],'queue_name':_0xe0ffff['name'],'ChatQueueId':_0xe0ffff['id'],'interface':util[_0x8fc1('0x70')]('%s/%s','SIP',_0x127210[_0x8fc1('0x3f')]),'penalty':0x0,'paused':_0x127210['chatPause'],'createdAt':_0x127210[_0x8fc1('0x6f')],'updatedAt':_0x127210['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8fc1('0x23')](respondWithFilteredResult(_0x42cbe5,_0x589de0))[_0x8fc1('0x2d')](handleError(_0x42cbe5,null));};exports[_0x8fc1('0x71')]=function(_0x553c66,_0x200b65,_0x372f94){var _0x5bf3d0={};var _0x1b013f={};var _0x4ba9f4;var _0x3a79e4;return db[_0x8fc1('0x57')][_0x8fc1('0x6a')]({'where':{'id':_0x553c66[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x200b65,null))['then'](function(_0x470fa4){if(_0x470fa4){_0x4ba9f4=_0x470fa4;_0x1b013f[_0x8fc1('0x48')]=_['keys'](db['Team']['rawAttributes']);_0x1b013f['query']=_[_0x8fc1('0x46')](_0x553c66['query']);_0x1b013f['filters']=_[_0x8fc1('0x47')](_0x1b013f[_0x8fc1('0x48')],_0x1b013f[_0x8fc1('0x45')]);_0x5bf3d0[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0x1b013f[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x5bf3d0[_0x8fc1('0x49')]=_0x5bf3d0[_0x8fc1('0x49')][_0x8fc1('0x4b')]?_0x5bf3d0[_0x8fc1('0x49')]:_0x1b013f['model'];_0x5bf3d0['order']=qs[_0x8fc1('0x4f')](_0x553c66[_0x8fc1('0x45')]['sort']);_0x5bf3d0[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_['pick'](_0x553c66[_0x8fc1('0x45')],_0x1b013f[_0x8fc1('0x51')]));if(_0x553c66['query']['filter']){_0x5bf3d0['where']=_[_0x8fc1('0x55')](_0x5bf3d0[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x5bf3d0['attributes'],function(_0x1cd499){var _0xcd80ef={};_0xcd80ef[_0x1cd499]={'$like':'%'+_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x53')]+'%'};return _0xcd80ef;})});}_0x5bf3d0=_[_0x8fc1('0x55')]({},_0x5bf3d0,_0x553c66[_0x8fc1('0x56')]);return _0x4ba9f4[_0x8fc1('0x71')](_0x5bf3d0);}})[_0x8fc1('0x23')](function(_0x2deda9){if(_0x2deda9){_0x3a79e4=_0x2deda9[_0x8fc1('0x4b')];if(!_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x4c')](_0x8fc1('0x4d'))){_0x5bf3d0['limit']=qs[_0x8fc1('0x34')](_0x553c66['query'][_0x8fc1('0x34')]);_0x5bf3d0[_0x8fc1('0x32')]=qs['offset'](_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x32')]);}return _0x4ba9f4[_0x8fc1('0x71')](_0x5bf3d0);}})[_0x8fc1('0x23')](function(_0x2ea34e){if(_0x2ea34e){return _0x2ea34e?{'count':_0x3a79e4,'rows':_0x2ea34e}:null;}})['then'](respondWithResult(_0x200b65,null))[_0x8fc1('0x2d')](handleError(_0x200b65,null));};exports[_0x8fc1('0x72')]=function(_0x58c089,_0x520a3d,_0x2c4644){var _0x1ef84c=_0x58c089['body']['ids'];return db['Team'][_0x8fc1('0x5a')]({'where':{'id':_0x1ef84c},'attributes':['id'],'include':[{'model':db[_0x8fc1('0x73')],'as':_0x8fc1('0x74'),'attributes':['id',_0x8fc1('0x3f'),_0x8fc1('0x75'),'voicePause',_0x8fc1('0x76')],'raw':!![]}]})['then'](function(_0x3b2c10){if(_0x3b2c10){var _0x16fc71=_['flatMap'](_0x3b2c10,function(_0x3e56f2){var _0x278202=_0x3e56f2['get']({'plain':!![]});return _0x278202[_0x8fc1('0x74')];});return db[_0x8fc1('0x57')][_0x8fc1('0x61')]({'where':{'id':_0x58c089[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](function(_0x283407){return db[_0x8fc1('0x77')]['transaction'](function(_0x4179eb){return _0x283407['addTeams'](_0x1ef84c,{'transaction':_0x4179eb})[_0x8fc1('0x23')](function(){return BPromise[_0x8fc1('0x78')](_0x16fc71,function(_0x17f0f8){return db[_0x8fc1('0x79')][_0x8fc1('0x7a')]({'where':{'UserId':_0x17f0f8['id'],'ChatQueueId':_0x58c089['params']['id']},'transaction':_0x4179eb});});})[_0x8fc1('0x23')](function(){_0x16fc71['forEach'](function(_0x27e085){socket['emit']('userChatQueue:save',{'UserId':_0x27e085['id'],'ChatQueueId':_0x283407['id']});});});});});}})['then'](respondWithStatusCode(_0x520a3d,null))[_0x8fc1('0x2d')](handleError(_0x520a3d,null));};exports[_0x8fc1('0x7b')]=function(_0x17f0d6,_0x2394c4,_0x5da567){return db['Team'][_0x8fc1('0x5a')]({'where':{'id':_0x17f0d6['query'][_0x8fc1('0x7c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8fc1('0x23')](handleEntityNotFound(_0x2394c4,null))[_0x8fc1('0x23')](function(_0x58e754){var _0xdda60e=_[_0x8fc1('0x44')](_0x58e754,'id');var _0x50bc47=[];var _0x249b7a=[];var _0xa8b307=squel[_0x8fc1('0x7d')]();_0xa8b307['field'](_0x8fc1('0x7e'))[_0x8fc1('0x7f')]('team_has_chat_queues','tq')[_0x8fc1('0x80')](_0x8fc1('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8fc1('0x82'),_0x17f0d6[_0x8fc1('0x67')]['id']);for(var _0x161740=0x0;_0x161740<_0x58e754[_0x8fc1('0x4b')];_0x161740+=0x1){let _0x450019=_0x58e754[_0x161740];for(var _0x362a10=0x0;_0x362a10<_0x450019['Agents'][_0x8fc1('0x4b')];_0x362a10+=0x1){let _0x46aa9b=_0x450019[_0x8fc1('0x74')][_0x362a10];var _0x3b4c3e=_0xa8b307[_0x8fc1('0x83')]();_0x3b4c3e[_0x8fc1('0x50')](_0x8fc1('0x84'),_0x46aa9b['id']);_0x249b7a[_0x8fc1('0x85')](db[_0x8fc1('0x77')][_0x8fc1('0x45')](_0x3b4c3e[_0x8fc1('0x86')](),{'type':db[_0x8fc1('0x77')]['QueryTypes'][_0x8fc1('0x87')]})[_0x8fc1('0x23')](function(_0x2010f6){if(_0x2010f6[_0x8fc1('0x4b')]===0x1){return _0x46aa9b['id'];}else{var _0x2e6b8c=_[_0x8fc1('0x88')](_['map'](_0x2010f6,_0x8fc1('0x89')),function(_0x50b273){return _[_0x8fc1('0x8a')](_0xdda60e,_0x50b273);});if(_0x2e6b8c){return _0x46aa9b['id'];}}}));}}return BPromise[_0x8fc1('0x8b')](_0x249b7a)['then'](function(_0x3a0775){_0x50bc47=_(_0x50bc47)[_0x8fc1('0x8c')](_0x3a0775)[_0x8fc1('0x8d')]()[_0x8fc1('0x8e')]();return db['ChatQueue'][_0x8fc1('0x61')]({'where':{'id':_0x17f0d6[_0x8fc1('0x67')]['id']}})['then'](function(_0x41b2a6){return db['sequelize'][_0x8fc1('0x8f')](function(_0x539e3d){return _0x41b2a6[_0x8fc1('0x7b')](_0x17f0d6[_0x8fc1('0x45')][_0x8fc1('0x7c')],{'transaction':_0x539e3d})[_0x8fc1('0x23')](function(){if(!_[_0x8fc1('0x90')](_0x50bc47)){return _0x41b2a6[_0x8fc1('0x91')](_0x50bc47,{'transaction':_0x539e3d});}})[_0x8fc1('0x23')](function(){_0x50bc47[_0x8fc1('0x92')](function(_0x20c4df){socket[_0x8fc1('0x93')](_0x8fc1('0x94'),{'UserId':_0x20c4df,'ChatQueueId':_0x41b2a6['id']});});});});});});})['then'](respondWithStatusCode(_0x2394c4,null))[_0x8fc1('0x2d')](handleError(_0x2394c4,null));};exports['addAgents']=function(_0x3de89,_0x43e89a,_0x1ff9ad){return db[_0x8fc1('0x57')][_0x8fc1('0x61')]({'where':{'id':_0x3de89[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x43e89a,null))[_0x8fc1('0x23')](function(_0x250c50){if(_0x250c50){return _0x250c50[_0x8fc1('0x95')](_0x3de89[_0x8fc1('0x66')][_0x8fc1('0x7c')],_[_0x8fc1('0x96')](_0x3de89[_0x8fc1('0x66')],[_0x8fc1('0x7c'),'id'])||{})[_0x8fc1('0x97')](function(_0x4b0d1d){for(var _0x2a193b=0x0;_0x2a193b<_0x3de89['body']['ids'][_0x8fc1('0x4b')];_0x2a193b+=0x1){socket[_0x8fc1('0x93')](_0x8fc1('0x98'),{'UserId':Number(_0x3de89[_0x8fc1('0x66')][_0x8fc1('0x7c')][_0x2a193b]),'ChatQueueId':Number(_0x3de89['params']['id'])});}return _0x4b0d1d;});}})[_0x8fc1('0x23')](respondWithResult(_0x43e89a,null))[_0x8fc1('0x2d')](handleError(_0x43e89a,null));};exports['removeAgents']=function(_0x28b78d,_0x1be480,_0x42c96e){return db[_0x8fc1('0x57')][_0x8fc1('0x61')]({'where':{'id':_0x28b78d[_0x8fc1('0x67')]['id']}})['then'](handleEntityNotFound(_0x1be480,null))[_0x8fc1('0x23')](function(_0x1e92de){if(_0x1e92de){return _0x1e92de[_0x8fc1('0x91')](_0x28b78d[_0x8fc1('0x45')][_0x8fc1('0x7c')])[_0x8fc1('0x23')](function(){if(_['isArray'](_0x28b78d[_0x8fc1('0x45')]['ids'])){for(var _0x1e859e=0x0;_0x1e859e<_0x28b78d[_0x8fc1('0x45')][_0x8fc1('0x7c')][_0x8fc1('0x4b')];_0x1e859e+=0x1){socket[_0x8fc1('0x93')]('userChatQueue:remove',{'UserId':Number(_0x28b78d['query']['ids'][_0x1e859e]),'ChatQueueId':Number(_0x28b78d[_0x8fc1('0x67')]['id'])});}}else{socket[_0x8fc1('0x93')]('userChatQueue:remove',{'UserId':Number(_0x28b78d[_0x8fc1('0x45')]['ids']),'ChatQueueId':Number(_0x28b78d[_0x8fc1('0x67')]['id'])});}});}})[_0x8fc1('0x23')](respondWithStatusCode(_0x1be480,null))[_0x8fc1('0x2d')](handleError(_0x1be480,null));};exports[_0x8fc1('0x99')]=function(_0x255809,_0x486794,_0x43a06f){var _0x197621={};var _0x4ad299={};var _0x35dc03;var _0x5e2c42;return db[_0x8fc1('0x57')][_0x8fc1('0x6a')]({'where':{'id':_0x255809[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x486794,null))['then'](function(_0x3f2e7b){if(_0x3f2e7b){_0x35dc03=_0x3f2e7b;_0x4ad299[_0x8fc1('0x48')]=_['keys'](db[_0x8fc1('0x73')][_0x8fc1('0x40')]);_0x4ad299['query']=_['keys'](_0x255809[_0x8fc1('0x45')]);_0x4ad299[_0x8fc1('0x51')]=_[_0x8fc1('0x47')](_0x4ad299[_0x8fc1('0x48')],_0x4ad299[_0x8fc1('0x45')]);_0x197621[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0x4ad299[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x255809[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x197621['attributes']=_0x197621['attributes']['length']?_0x197621[_0x8fc1('0x49')]:_0x4ad299[_0x8fc1('0x48')];_0x197621[_0x8fc1('0x4e')]=qs['sort'](_0x255809['query'][_0x8fc1('0x4f')]);_0x197621[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_[_0x8fc1('0x52')](_0x255809[_0x8fc1('0x45')],_0x4ad299[_0x8fc1('0x51')]));if(_0x255809[_0x8fc1('0x45')][_0x8fc1('0x53')]){_0x197621[_0x8fc1('0x50')]=_[_0x8fc1('0x55')](_0x197621[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x197621['attributes'],function(_0x168b25){var _0x304098={};_0x304098[_0x168b25]={'$like':'%'+_0x255809['query'][_0x8fc1('0x53')]+'%'};return _0x304098;})});}_0x197621=_[_0x8fc1('0x55')]({},_0x197621,_0x255809[_0x8fc1('0x56')]);return _0x35dc03[_0x8fc1('0x99')](_0x197621);}})['then'](function(_0x2b5e27){if(_0x2b5e27){_0x5e2c42=_0x2b5e27[_0x8fc1('0x4b')];if(!_0x255809[_0x8fc1('0x45')][_0x8fc1('0x4c')](_0x8fc1('0x4d'))){_0x197621[_0x8fc1('0x34')]=qs['limit'](_0x255809[_0x8fc1('0x45')][_0x8fc1('0x34')]);_0x197621[_0x8fc1('0x32')]=qs[_0x8fc1('0x32')](_0x255809[_0x8fc1('0x45')][_0x8fc1('0x32')]);}return _0x35dc03[_0x8fc1('0x99')](_0x197621);}})[_0x8fc1('0x23')](function(_0x44c924){if(_0x44c924){return _0x44c924?{'count':_0x5e2c42,'rows':_0x44c924}:null;}})['then'](respondWithResult(_0x486794,null))[_0x8fc1('0x2d')](handleError(_0x486794,null));};
\ No newline at end of file
+var _0x3465=['result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','ChatQueue','include','findAll','rows','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','order','pick','ChatQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','online','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x3465,0x6e));var _0x5346=function(_0x583ba8,_0x40bb0d){_0x583ba8=_0x583ba8-0x0;var _0x515683=_0x3465[_0x583ba8];return _0x515683;};'use strict';var emlformat=require(_0x5346('0x0'));var rimraf=require(_0x5346('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5346('0x2'));var rp=require(_0x5346('0x3'));var moment=require('moment');var BPromise=require(_0x5346('0x4'));var Mustache=require(_0x5346('0x5'));var util=require(_0x5346('0x6'));var path=require(_0x5346('0x7'));var sox=require(_0x5346('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5346('0x9'));var _=require(_0x5346('0xa'));var squel=require(_0x5346('0xb'));var crypto=require(_0x5346('0xc'));var jsforce=require(_0x5346('0xd'));var deskjs=require(_0x5346('0xe'));var toCsv=require(_0x5346('0xf'));var querystring=require(_0x5346('0x10'));var Papa=require(_0x5346('0x11'));var Redis=require(_0x5346('0x12'));var authService=require(_0x5346('0x13'));var qs=require(_0x5346('0x14'));var as=require(_0x5346('0x15'));var hardwareService=require(_0x5346('0x16'));var logger=require('../../config/logger')(_0x5346('0x17'));var utils=require('../../config/utils');var config=require(_0x5346('0x18'));var licenseUtil=require(_0x5346('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5346('0x1a')](config[_0x5346('0x1b')],{'host':_0x5346('0x1c'),'port':0x18eb});var socket=require(_0x5346('0x1d'))(new Redis(config[_0x5346('0x1b')]));require(_0x5346('0x1e'))[_0x5346('0x1f')](socket);var jayson=require(_0x5346('0x20'));var client=jayson[_0x5346('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57bf39,_0x18304b,_0x239fdf,_0x474407){return new BPromise(function(_0x5e250f,_0x597410){var _0x4eafc5=_0x474407||client;return _0x4eafc5['request'](_0x57bf39,_0x239fdf)[_0x5346('0x22')](function(_0x21dbe2){logger[_0x5346('0x23')]('ChatQueue,\x20%s,\x20%s',_0x18304b,_0x5346('0x24'));logger['debug'](_0x5346('0x25'),_0x18304b,_0x5346('0x24'),JSON[_0x5346('0x26')](_0x21dbe2));if(_0x21dbe2[_0x5346('0x27')]){if(_0x21dbe2[_0x5346('0x27')][_0x5346('0x28')]===0x1f4){logger[_0x5346('0x27')](_0x5346('0x29'),_0x18304b,_0x21dbe2[_0x5346('0x27')][_0x5346('0x2a')]);return _0x597410(_0x21dbe2['error'][_0x5346('0x2a')]);}logger[_0x5346('0x27')](_0x5346('0x29'),_0x18304b,_0x21dbe2['error'][_0x5346('0x2a')]);return _0x5e250f(_0x21dbe2['error'][_0x5346('0x2a')]);}else{logger[_0x5346('0x23')]('ChatQueue,\x20%s,\x20%s',_0x18304b,_0x5346('0x24'));_0x5e250f(_0x21dbe2[_0x5346('0x2b')][_0x5346('0x2a')]);}})[_0x5346('0x2c')](function(_0x1c3e36){logger[_0x5346('0x27')](_0x5346('0x29'),_0x18304b,_0x1c3e36);_0x597410(_0x1c3e36);});});}function respondWithStatusCode(_0x4619ae,_0x42086c){_0x42086c=_0x42086c||0xcc;return function(_0x2f5169){if(_0x2f5169){return _0x4619ae['sendStatus'](_0x42086c);}return _0x4619ae[_0x5346('0x2d')](_0x42086c)[_0x5346('0x2e')]();};}function respondWithResult(_0x40aafa,_0x7d8747){_0x7d8747=_0x7d8747||0xc8;return function(_0x569a48){if(_0x569a48){return _0x40aafa[_0x5346('0x2d')](_0x7d8747)[_0x5346('0x2f')](_0x569a48);}};}function respondWithFilteredResult(_0x141e24,_0x2a918b){return function(_0x5ed7f1){if(_0x5ed7f1){var _0x459ee7=typeof _0x2a918b[_0x5346('0x30')]===_0x5346('0x31')&&typeof _0x2a918b['limit']===_0x5346('0x31');var _0x302828=_0x5ed7f1['count'];var _0x4fbc8d=_0x459ee7?0x0:_0x2a918b['offset'];var _0x18c747=_0x459ee7?_0x5ed7f1[_0x5346('0x32')]:_0x2a918b['offset']+_0x2a918b[_0x5346('0x33')];var _0x9877f;if(_0x18c747>=_0x302828){_0x18c747=_0x302828;_0x9877f=0xc8;}else{_0x9877f=0xce;}_0x141e24[_0x5346('0x2d')](_0x9877f);return _0x141e24[_0x5346('0x34')](_0x5346('0x35'),_0x4fbc8d+'-'+_0x18c747+'/'+_0x302828)[_0x5346('0x2f')](_0x5ed7f1);}return null;};}function patchUpdates(_0x1f0f9d){return function(_0x4c4ed6){try{jsonpatch[_0x5346('0x36')](_0x4c4ed6,_0x1f0f9d,!![]);}catch(_0x43625e){return BPromise[_0x5346('0x37')](_0x43625e);}return _0x4c4ed6[_0x5346('0x38')]();};}function saveUpdates(_0x2e294c,_0x1f2d3e){return function(_0x5d1c40){if(_0x5d1c40){return _0x5d1c40[_0x5346('0x39')](_0x2e294c)['then'](function(_0x4335d6){return _0x4335d6;});}return null;};}function removeEntity(_0x5a0fff,_0x3c4331){return function(_0x38f80c){if(_0x38f80c){return _0x38f80c[_0x5346('0x3a')]()[_0x5346('0x22')](function(){var _0x17987c=_0x38f80c[_0x5346('0x3b')]({'plain':!![]});var _0x3fe2cb=_0x5346('0x3c');return db[_0x5346('0x3d')][_0x5346('0x3a')]({'where':{'type':_0x3fe2cb,'resourceId':_0x17987c['id']}})[_0x5346('0x22')](function(){return _0x38f80c;});})[_0x5346('0x22')](function(){_0x5a0fff[_0x5346('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a13c,_0x32a8ea){return function(_0x5b8380){if(!_0x5b8380){_0x19a13c[_0x5346('0x3e')](0x194);}return _0x5b8380;};}function handleError(_0x52ff9d,_0xe44220){_0xe44220=_0xe44220||0x1f4;return function(_0x2008db){logger[_0x5346('0x27')](_0x2008db[_0x5346('0x3f')]);if(_0x2008db[_0x5346('0x40')]){delete _0x2008db['name'];}_0x52ff9d[_0x5346('0x2d')](_0xe44220)[_0x5346('0x41')](_0x2008db);};}exports[_0x5346('0x42')]=function(_0x85cc2b,_0x5cb986){var _0x5daa82={},_0x532eaf={},_0x1b4d2c={'count':0x0,'rows':[]};var _0x51fac8=_[_0x5346('0x43')](db['ChatQueue'][_0x5346('0x44')],function(_0x415d72){return{'name':_0x415d72[_0x5346('0x45')],'type':_0x415d72[_0x5346('0x46')][_0x5346('0x47')]};});_0x532eaf[_0x5346('0x48')]=_[_0x5346('0x43')](_0x51fac8,_0x5346('0x40'));_0x532eaf[_0x5346('0x49')]=_['keys'](_0x85cc2b[_0x5346('0x49')]);_0x532eaf['filters']=_[_0x5346('0x4a')](_0x532eaf[_0x5346('0x48')],_0x532eaf[_0x5346('0x49')]);_0x5daa82[_0x5346('0x4b')]=_['intersection'](_0x532eaf[_0x5346('0x48')],qs['fields'](_0x85cc2b[_0x5346('0x49')][_0x5346('0x4c')]));_0x5daa82[_0x5346('0x4b')]=_0x5daa82['attributes']['length']?_0x5daa82[_0x5346('0x4b')]:_0x532eaf[_0x5346('0x48')];if(!_0x85cc2b[_0x5346('0x49')][_0x5346('0x4d')](_0x5346('0x4e'))){_0x5daa82[_0x5346('0x33')]=qs[_0x5346('0x33')](_0x85cc2b[_0x5346('0x49')]['limit']);_0x5daa82[_0x5346('0x30')]=qs[_0x5346('0x30')](_0x85cc2b[_0x5346('0x49')]['offset']);}_0x5daa82['order']=qs[_0x5346('0x4f')](_0x85cc2b[_0x5346('0x49')]['sort']);_0x5daa82[_0x5346('0x50')]=qs[_0x5346('0x51')](_['pick'](_0x85cc2b['query'],_0x532eaf[_0x5346('0x51')]),_0x51fac8);if(_0x85cc2b[_0x5346('0x49')][_0x5346('0x52')]){_0x5daa82[_0x5346('0x50')]=_[_0x5346('0x53')](_0x5daa82[_0x5346('0x50')],{'$or':_[_0x5346('0x43')](_0x51fac8,function(_0x27180f){if(_0x27180f[_0x5346('0x46')]!==_0x5346('0x54')){var _0x11613a={};_0x11613a[_0x27180f[_0x5346('0x40')]]={'$like':'%'+_0x85cc2b[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x11613a;}})});}_0x5daa82=_['merge']({},_0x5daa82,_0x85cc2b[_0x5346('0x55')]);var _0x285588={'where':_0x5daa82['where']};return db[_0x5346('0x56')][_0x5346('0x32')](_0x285588)[_0x5346('0x22')](function(_0x229789){_0x1b4d2c[_0x5346('0x32')]=_0x229789;if(_0x85cc2b[_0x5346('0x49')]['includeAll']){_0x5daa82[_0x5346('0x57')]=[{'all':!![]}];}return db[_0x5346('0x56')][_0x5346('0x58')](_0x5daa82);})[_0x5346('0x22')](function(_0x403751){_0x1b4d2c[_0x5346('0x59')]=_0x403751;return _0x1b4d2c;})['then'](respondWithFilteredResult(_0x5cb986,_0x5daa82))[_0x5346('0x2c')](handleError(_0x5cb986,null));};exports[_0x5346('0x5a')]=function(_0x36699c,_0x592fda){var _0x3406cd={'raw':!![],'where':{'id':_0x36699c[_0x5346('0x5b')]['id']}},_0x231bb7={};_0x231bb7[_0x5346('0x48')]=_[_0x5346('0x5c')](db[_0x5346('0x56')][_0x5346('0x44')]);_0x231bb7[_0x5346('0x49')]=_['keys'](_0x36699c['query']);_0x231bb7[_0x5346('0x51')]=_[_0x5346('0x4a')](_0x231bb7['model'],_0x231bb7[_0x5346('0x49')]);_0x3406cd[_0x5346('0x4b')]=_[_0x5346('0x4a')](_0x231bb7['model'],qs[_0x5346('0x4c')](_0x36699c[_0x5346('0x49')][_0x5346('0x4c')]));_0x3406cd[_0x5346('0x4b')]=_0x3406cd['attributes'][_0x5346('0x5d')]?_0x3406cd[_0x5346('0x4b')]:_0x231bb7[_0x5346('0x48')];if(_0x36699c['query']['includeAll']){_0x3406cd[_0x5346('0x57')]=[{'all':!![]}];}_0x3406cd=_['merge']({},_0x3406cd,_0x36699c[_0x5346('0x55')]);return db[_0x5346('0x56')][_0x5346('0x5e')](_0x3406cd)[_0x5346('0x22')](handleEntityNotFound(_0x592fda,null))['then'](respondWithResult(_0x592fda,null))[_0x5346('0x2c')](handleError(_0x592fda,null));};exports[_0x5346('0x5f')]=function(_0x4ccaa3,_0x4a2a13){return db[_0x5346('0x56')][_0x5346('0x5f')](_0x4ccaa3[_0x5346('0x60')],{})[_0x5346('0x22')](function(_0x59cb30){var _0x39fe6e=_0x4ccaa3[_0x5346('0x61')][_0x5346('0x3b')]({'plain':!![]});if(!_0x39fe6e)throw new Error(_0x5346('0x62'));if(_0x39fe6e[_0x5346('0x63')]===_0x5346('0x61')){var _0x2d38b9=_0x59cb30[_0x5346('0x3b')]({'plain':!![]});var _0x35a0e4=_0x5346('0x3c');return db['UserProfileSection'][_0x5346('0x5e')]({'where':{'name':_0x35a0e4,'userProfileId':_0x39fe6e[_0x5346('0x64')]},'raw':!![]})[_0x5346('0x22')](function(_0x3dc34d){if(_0x3dc34d&&_0x3dc34d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2d38b9[_0x5346('0x40')],'resourceId':_0x2d38b9['id'],'type':_0x3dc34d['name'],'sectionId':_0x3dc34d['id']},{})[_0x5346('0x22')](function(){return _0x59cb30;});}else{return _0x59cb30;}})[_0x5346('0x2c')](function(_0x4641d2){logger[_0x5346('0x27')](_0x5346('0x65'),_0x4641d2);throw _0x4641d2;});}return _0x59cb30;})[_0x5346('0x22')](respondWithResult(_0x4a2a13,0xc9))['catch'](handleError(_0x4a2a13,null));};exports[_0x5346('0x39')]=function(_0x17bfba,_0x262020){if(_0x17bfba[_0x5346('0x60')]['id']){delete _0x17bfba[_0x5346('0x60')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x17bfba['params']['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x262020,null))[_0x5346('0x22')](saveUpdates(_0x17bfba[_0x5346('0x60')],null))[_0x5346('0x22')](respondWithResult(_0x262020,null))[_0x5346('0x2c')](handleError(_0x262020,null));};exports['destroy']=function(_0x43d8ec,_0x59f746){return db[_0x5346('0x56')][_0x5346('0x5e')]({'where':{'id':_0x43d8ec[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x59f746,null))[_0x5346('0x22')](removeEntity(_0x59f746,null))[_0x5346('0x2c')](handleError(_0x59f746,null));};exports[_0x5346('0x66')]=function(_0x2279d3,_0x18d527){return db[_0x5346('0x56')][_0x5346('0x66')]()[_0x5346('0x22')](respondWithResult(_0x18d527,null))[_0x5346('0x2c')](handleError(_0x18d527,null));};exports[_0x5346('0x67')]=function(_0x31a9f8,_0xd7f89d,_0x45e3c0){var _0x354f7a={'raw':!![],'where':{}},_0x20857d={},_0x3cbc04;return db['ChatQueue']['findOne']({'where':{'id':_0x31a9f8['params']['id']}})[_0x5346('0x22')](handleEntityNotFound(_0xd7f89d,null))[_0x5346('0x22')](function(_0x21ccc7){if(_0x21ccc7){_0x3cbc04=_0x21ccc7[_0x5346('0x3b')]({'plain':!![]});_0x20857d[_0x5346('0x48')]=_[_0x5346('0x5c')](db[_0x5346('0x68')][_0x5346('0x44')]);_0x20857d['query']=_[_0x5346('0x5c')](_0x31a9f8[_0x5346('0x49')]);_0x20857d[_0x5346('0x51')]=_[_0x5346('0x4a')](_0x20857d[_0x5346('0x48')],_0x20857d[_0x5346('0x49')]);_0x354f7a['attributes']=_[_0x5346('0x4a')](_0x20857d[_0x5346('0x48')],qs['fields'](_0x31a9f8[_0x5346('0x49')]['fields']));_0x354f7a[_0x5346('0x4b')]=_0x354f7a[_0x5346('0x4b')][_0x5346('0x5d')]?_0x354f7a[_0x5346('0x4b')]:_0x20857d[_0x5346('0x48')];if(!_0x31a9f8[_0x5346('0x49')][_0x5346('0x4d')](_0x5346('0x4e'))){_0x354f7a[_0x5346('0x33')]=qs[_0x5346('0x33')](_0x31a9f8[_0x5346('0x49')][_0x5346('0x33')]);_0x354f7a[_0x5346('0x30')]=qs[_0x5346('0x30')](_0x31a9f8[_0x5346('0x49')]['offset']);}_0x354f7a[_0x5346('0x69')]=qs[_0x5346('0x4f')](_0x31a9f8['query'][_0x5346('0x4f')]);_0x354f7a[_0x5346('0x50')]=qs[_0x5346('0x51')](_[_0x5346('0x6a')](_0x31a9f8[_0x5346('0x49')],_0x20857d['filters']));_0x354f7a[_0x5346('0x50')][_0x5346('0x6b')]=_0x21ccc7['id'];if(_0x31a9f8[_0x5346('0x49')][_0x5346('0x52')]){_0x354f7a[_0x5346('0x50')]=_[_0x5346('0x53')](_0x354f7a[_0x5346('0x50')],{'$or':_[_0x5346('0x43')](_0x354f7a[_0x5346('0x4b')],function(_0x366331){var _0x5af2e0={};_0x5af2e0[_0x366331]={'$like':'%'+_0x31a9f8[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x5af2e0;})});}_0x354f7a=_[_0x5346('0x53')]({},_0x354f7a,_0x31a9f8[_0x5346('0x55')]);return db[_0x5346('0x68')]['findAll'](_0x354f7a);}})[_0x5346('0x22')](function(_0x22b865){if(_0x22b865){return db[_0x5346('0x6c')][_0x5346('0x6d')]({'where':{'id':_[_0x5346('0x43')](_0x22b865,'UserId'),'role':_0x5346('0x6e')},'attributes':['id',_0x5346('0x40'),'chatPause',_0x5346('0x6f'),_0x5346('0x70')]});}})[_0x5346('0x22')](function(_0x397cc6){if(_0x397cc6){return{'count':_0x397cc6[_0x5346('0x32')],'rows':_[_0x5346('0x43')](_0x397cc6['rows'],function(_0x2c2ed4){return{'membername':_0x2c2ed4[_0x5346('0x40')],'UserId':_0x2c2ed4['id'],'queue_name':_0x3cbc04['name'],'ChatQueueId':_0x3cbc04['id'],'interface':util[_0x5346('0x71')](_0x5346('0x72'),'SIP',_0x2c2ed4['name']),'penalty':0x0,'paused':_0x2c2ed4['chatPause'],'createdAt':_0x2c2ed4[_0x5346('0x70')],'updatedAt':_0x2c2ed4[_0x5346('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5346('0x22')](respondWithFilteredResult(_0xd7f89d,_0x354f7a))[_0x5346('0x2c')](handleError(_0xd7f89d,null));};exports[_0x5346('0x73')]=function(_0x1efc79,_0x1fcb37,_0x38a941){var _0x2e7149={};var _0x5833b4={};var _0x4011d4;var _0x1e79b4;return db[_0x5346('0x56')][_0x5346('0x74')]({'where':{'id':_0x1efc79[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x1fcb37,null))['then'](function(_0x1ddec6){if(_0x1ddec6){_0x4011d4=_0x1ddec6;_0x5833b4[_0x5346('0x48')]=_[_0x5346('0x5c')](db[_0x5346('0x75')][_0x5346('0x44')]);_0x5833b4['query']=_[_0x5346('0x5c')](_0x1efc79[_0x5346('0x49')]);_0x5833b4[_0x5346('0x51')]=_[_0x5346('0x4a')](_0x5833b4[_0x5346('0x48')],_0x5833b4[_0x5346('0x49')]);_0x2e7149[_0x5346('0x4b')]=_['intersection'](_0x5833b4[_0x5346('0x48')],qs['fields'](_0x1efc79['query'][_0x5346('0x4c')]));_0x2e7149[_0x5346('0x4b')]=_0x2e7149[_0x5346('0x4b')][_0x5346('0x5d')]?_0x2e7149[_0x5346('0x4b')]:_0x5833b4[_0x5346('0x48')];_0x2e7149['order']=qs[_0x5346('0x4f')](_0x1efc79[_0x5346('0x49')][_0x5346('0x4f')]);_0x2e7149['where']=qs[_0x5346('0x51')](_[_0x5346('0x6a')](_0x1efc79[_0x5346('0x49')],_0x5833b4['filters']));if(_0x1efc79[_0x5346('0x49')][_0x5346('0x52')]){_0x2e7149['where']=_['merge'](_0x2e7149['where'],{'$or':_[_0x5346('0x43')](_0x2e7149[_0x5346('0x4b')],function(_0x7a7488){var _0x4073ea={};_0x4073ea[_0x7a7488]={'$like':'%'+_0x1efc79[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x4073ea;})});}_0x2e7149=_[_0x5346('0x53')]({},_0x2e7149,_0x1efc79['options']);return _0x4011d4[_0x5346('0x73')](_0x2e7149);}})[_0x5346('0x22')](function(_0x3889ac){if(_0x3889ac){_0x1e79b4=_0x3889ac['length'];if(!_0x1efc79[_0x5346('0x49')][_0x5346('0x4d')]('nolimit')){_0x2e7149[_0x5346('0x33')]=qs[_0x5346('0x33')](_0x1efc79['query']['limit']);_0x2e7149['offset']=qs[_0x5346('0x30')](_0x1efc79[_0x5346('0x49')][_0x5346('0x30')]);}return _0x4011d4[_0x5346('0x73')](_0x2e7149);}})['then'](function(_0x4c8952){if(_0x4c8952){return _0x4c8952?{'count':_0x1e79b4,'rows':_0x4c8952}:null;}})['then'](respondWithResult(_0x1fcb37,null))[_0x5346('0x2c')](handleError(_0x1fcb37,null));};exports[_0x5346('0x76')]=function(_0x4905fd,_0x372416,_0x1333a9){var _0x3db77c=_0x4905fd[_0x5346('0x60')][_0x5346('0x77')];return db[_0x5346('0x75')][_0x5346('0x58')]({'where':{'id':_0x3db77c},'attributes':['id'],'include':[{'model':db[_0x5346('0x6c')],'as':'Agents','attributes':['id',_0x5346('0x40'),_0x5346('0x78'),'voicePause','interface'],'raw':!![]}]})[_0x5346('0x22')](function(_0x4e19dd){if(_0x4e19dd){var _0xb2c46=_[_0x5346('0x79')](_0x4e19dd,function(_0x4bd2f2){var _0x5dd48b=_0x4bd2f2[_0x5346('0x3b')]({'plain':!![]});return _0x5dd48b[_0x5346('0x7a')];});return db[_0x5346('0x56')][_0x5346('0x5e')]({'where':{'id':_0x4905fd[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](function(_0x20c6f9){return db[_0x5346('0x7b')][_0x5346('0x7c')](function(_0x2a43c4){return _0x20c6f9[_0x5346('0x76')](_0x3db77c,{'transaction':_0x2a43c4})[_0x5346('0x22')](function(){return BPromise['each'](_0xb2c46,function(_0x7d7a90){return db[_0x5346('0x68')][_0x5346('0x7d')]({'where':{'UserId':_0x7d7a90['id'],'ChatQueueId':_0x4905fd[_0x5346('0x5b')]['id']},'transaction':_0x2a43c4});});})[_0x5346('0x22')](function(){_0xb2c46[_0x5346('0x7e')](function(_0x264123){socket[_0x5346('0x7f')](_0x5346('0x80'),{'UserId':_0x264123['id'],'ChatQueueId':_0x20c6f9['id']});});});});});}})[_0x5346('0x22')](respondWithStatusCode(_0x372416,null))[_0x5346('0x2c')](handleError(_0x372416,null));};exports[_0x5346('0x81')]=function(_0x376a07,_0x26dba4,_0x24ffce){return db[_0x5346('0x75')][_0x5346('0x58')]({'where':{'id':_0x376a07[_0x5346('0x49')][_0x5346('0x77')]},'attributes':['id'],'include':[{'model':db[_0x5346('0x6c')],'as':_0x5346('0x7a'),'attributes':['id'],'raw':!![]}]})[_0x5346('0x22')](handleEntityNotFound(_0x26dba4,null))[_0x5346('0x22')](function(_0x244042){var _0x1d03c0=_[_0x5346('0x43')](_0x244042,'id');var _0x5efaff=[];var _0x87164=[];var _0x435a31=squel[_0x5346('0x82')]();_0x435a31[_0x5346('0x83')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0x5346('0x84')](_0x5346('0x85'),'ut',_0x5346('0x86'))[_0x5346('0x50')](_0x5346('0x87'),_0x376a07[_0x5346('0x5b')]['id']);for(var _0x430700=0x0;_0x430700<_0x244042[_0x5346('0x5d')];_0x430700+=0x1){let _0x84c226=_0x244042[_0x430700];for(var _0x5622d4=0x0;_0x5622d4<_0x84c226['Agents']['length'];_0x5622d4+=0x1){let _0x1094a3=_0x84c226[_0x5346('0x7a')][_0x5622d4];var _0x958494=_0x435a31[_0x5346('0x88')]();_0x958494[_0x5346('0x50')](_0x5346('0x89'),_0x1094a3['id']);_0x87164['push'](db[_0x5346('0x7b')][_0x5346('0x49')](_0x958494[_0x5346('0x8a')](),{'type':db[_0x5346('0x7b')]['QueryTypes'][_0x5346('0x8b')]})[_0x5346('0x22')](function(_0x6e6885){if(_0x6e6885[_0x5346('0x5d')]===0x1){return _0x1094a3['id'];}else{var _0x13e940=_[_0x5346('0x8c')](_['map'](_0x6e6885,_0x5346('0x8d')),function(_0x25bb24){return _[_0x5346('0x8e')](_0x1d03c0,_0x25bb24);});if(_0x13e940){return _0x1094a3['id'];}}}));}}return BPromise[_0x5346('0x8f')](_0x87164)[_0x5346('0x22')](function(_0x4c3bd6){_0x5efaff=_(_0x5efaff)[_0x5346('0x90')](_0x4c3bd6)[_0x5346('0x91')]()[_0x5346('0x92')]();return db[_0x5346('0x56')][_0x5346('0x5e')]({'where':{'id':_0x376a07[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](function(_0xdc21aa){return db[_0x5346('0x7b')][_0x5346('0x7c')](function(_0x54ab71){return _0xdc21aa[_0x5346('0x81')](_0x376a07[_0x5346('0x49')][_0x5346('0x77')],{'transaction':_0x54ab71})[_0x5346('0x22')](function(){if(!_[_0x5346('0x93')](_0x5efaff)){return _0xdc21aa['removeAgents'](_0x5efaff,{'transaction':_0x54ab71});}})['then'](function(){_0x5efaff[_0x5346('0x7e')](function(_0x33304b){socket[_0x5346('0x7f')](_0x5346('0x94'),{'UserId':_0x33304b,'ChatQueueId':_0xdc21aa['id']});});});});});});})[_0x5346('0x22')](respondWithStatusCode(_0x26dba4,null))[_0x5346('0x2c')](handleError(_0x26dba4,null));};exports['addAgents']=function(_0x51097c,_0x44dd3f,_0x183b47){return db['ChatQueue'][_0x5346('0x5e')]({'where':{'id':_0x51097c[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x44dd3f,null))[_0x5346('0x22')](function(_0x2514d9){if(_0x2514d9){return _0x2514d9[_0x5346('0x95')](_0x51097c[_0x5346('0x60')][_0x5346('0x77')],_['omit'](_0x51097c[_0x5346('0x60')],['ids','id'])||{})[_0x5346('0x96')](function(_0x11ff87){for(var _0x1f9630=0x0;_0x1f9630<_0x51097c['body']['ids'][_0x5346('0x5d')];_0x1f9630+=0x1){socket[_0x5346('0x7f')](_0x5346('0x80'),{'UserId':Number(_0x51097c[_0x5346('0x60')][_0x5346('0x77')][_0x1f9630]),'ChatQueueId':Number(_0x51097c[_0x5346('0x5b')]['id'])});}return _0x11ff87;});}})[_0x5346('0x22')](respondWithResult(_0x44dd3f,null))[_0x5346('0x2c')](handleError(_0x44dd3f,null));};exports[_0x5346('0x97')]=function(_0x488585,_0x537d5e,_0x476116){return db['ChatQueue']['find']({'where':{'id':_0x488585[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x537d5e,null))[_0x5346('0x22')](function(_0x25b4b9){if(_0x25b4b9){return _0x25b4b9['removeAgents'](_0x488585[_0x5346('0x49')][_0x5346('0x77')])['then'](function(){if(_['isArray'](_0x488585['query'][_0x5346('0x77')])){for(var _0xe990b3=0x0;_0xe990b3<_0x488585[_0x5346('0x49')][_0x5346('0x77')][_0x5346('0x5d')];_0xe990b3+=0x1){socket[_0x5346('0x7f')](_0x5346('0x94'),{'UserId':Number(_0x488585['query'][_0x5346('0x77')][_0xe990b3]),'ChatQueueId':Number(_0x488585[_0x5346('0x5b')]['id'])});}}else{socket[_0x5346('0x7f')](_0x5346('0x94'),{'UserId':Number(_0x488585[_0x5346('0x49')][_0x5346('0x77')]),'ChatQueueId':Number(_0x488585[_0x5346('0x5b')]['id'])});}});}})[_0x5346('0x22')](respondWithStatusCode(_0x537d5e,null))[_0x5346('0x2c')](handleError(_0x537d5e,null));};exports[_0x5346('0x98')]=function(_0x1cf58b,_0x241004,_0x3f6eed){var _0x106c60={};var _0x25e271={};var _0x3587ce;var _0x2ba96e;return db['ChatQueue'][_0x5346('0x74')]({'where':{'id':_0x1cf58b[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x241004,null))['then'](function(_0x2d1e65){if(_0x2d1e65){_0x3587ce=_0x2d1e65;_0x25e271['model']=_['keys'](db[_0x5346('0x6c')][_0x5346('0x44')]);_0x25e271[_0x5346('0x49')]=_[_0x5346('0x5c')](_0x1cf58b[_0x5346('0x49')]);_0x25e271['filters']=_[_0x5346('0x4a')](_0x25e271[_0x5346('0x48')],_0x25e271[_0x5346('0x49')]);_0x106c60[_0x5346('0x4b')]=_[_0x5346('0x4a')](_0x25e271['model'],qs['fields'](_0x1cf58b[_0x5346('0x49')][_0x5346('0x4c')]));_0x106c60[_0x5346('0x4b')]=_0x106c60[_0x5346('0x4b')][_0x5346('0x5d')]?_0x106c60[_0x5346('0x4b')]:_0x25e271[_0x5346('0x48')];_0x106c60['order']=qs['sort'](_0x1cf58b[_0x5346('0x49')]['sort']);_0x106c60[_0x5346('0x50')]=qs[_0x5346('0x51')](_[_0x5346('0x6a')](_0x1cf58b[_0x5346('0x49')],_0x25e271[_0x5346('0x51')]));if(_0x1cf58b[_0x5346('0x49')]['filter']){_0x106c60[_0x5346('0x50')]=_['merge'](_0x106c60[_0x5346('0x50')],{'$or':_[_0x5346('0x43')](_0x106c60[_0x5346('0x4b')],function(_0xe1dc18){var _0x4a0b18={};_0x4a0b18[_0xe1dc18]={'$like':'%'+_0x1cf58b[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x4a0b18;})});}_0x106c60=_['merge']({},_0x106c60,_0x1cf58b[_0x5346('0x55')]);return _0x3587ce[_0x5346('0x98')](_0x106c60);}})['then'](function(_0x487c8){if(_0x487c8){_0x2ba96e=_0x487c8[_0x5346('0x5d')];if(!_0x1cf58b[_0x5346('0x49')][_0x5346('0x4d')]('nolimit')){_0x106c60['limit']=qs[_0x5346('0x33')](_0x1cf58b['query'][_0x5346('0x33')]);_0x106c60[_0x5346('0x30')]=qs[_0x5346('0x30')](_0x1cf58b['query'][_0x5346('0x30')]);}return _0x3587ce[_0x5346('0x98')](_0x106c60);}})[_0x5346('0x22')](function(_0xc1ef7b){if(_0xc1ef7b){return _0xc1ef7b?{'count':_0x2ba96e,'rows':_0xc1ef7b}:null;}})['then'](respondWithResult(_0x241004,null))['catch'](handleError(_0x241004,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 4011e2e..ca55fd1 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 _0xe5e7=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x1d0764,_0x2beb7c){var _0x423f49=function(_0x5334ee){while(--_0x5334ee){_0x1d0764['push'](_0x1d0764['shift']());}};_0x423f49(++_0x2beb7c);}(_0xe5e7,0x1ee));var _0x7e5e=function(_0xb72675,_0xae6a45){_0xb72675=_0xb72675-0x0;var _0x1a1d2e=_0xe5e7[_0xb72675];return _0x1a1d2e;};'use strict';var EventEmitter=require(_0x7e5e('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7e5e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7e5e('0x2'),'afterDestroy':_0x7e5e('0x3')};function emitEvent(_0x14d122){return function(_0x336f3f,_0x1de085,_0xb36e08){ChatQueueEvents['emit'](_0x14d122+':'+_0x336f3f['id'],_0x336f3f);ChatQueueEvents[_0x7e5e('0x4')](_0x14d122,_0x336f3f);_0xb36e08(null);};}for(var e in events){if(events[_0x7e5e('0x5')](e)){var event=events[e];ChatQueue[_0x7e5e('0x6')](e,emitEvent(event));}}module[_0x7e5e('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x1195=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x1dc0d6,_0xa034fc){var _0x2d848c=function(_0x2494e5){while(--_0x2494e5){_0x1dc0d6['push'](_0x1dc0d6['shift']());}};_0x2d848c(++_0xa034fc);}(_0x1195,0xc4));var _0x5119=function(_0x29e4c0,_0xf8b14d){_0x29e4c0=_0x29e4c0-0x0;var _0x15b64b=_0x1195[_0x29e4c0];return _0x15b64b;};'use strict';var EventEmitter=require(_0x5119('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5119('0x1')](0x0);var events={'afterCreate':_0x5119('0x2'),'afterUpdate':'update','afterDestroy':_0x5119('0x3')};function emitEvent(_0x53400c){return function(_0x233402,_0x1e1546,_0x567cf9){ChatQueueEvents[_0x5119('0x4')](_0x53400c+':'+_0x233402['id'],_0x233402);ChatQueueEvents['emit'](_0x53400c,_0x233402);_0x567cf9(null);};}for(var e in events){if(events[_0x5119('0x5')](e)){var event=events[e];ChatQueue[_0x5119('0x6')](e,emitEvent(event));}}module[_0x5119('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index ee1c6bf..afc63cb 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 _0x33c6=['ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x33c6,0xd2));var _0x633c=function(_0x4da9d8,_0x42fb50){_0x4da9d8=_0x4da9d8-0x0;var _0x468872=_0x33c6[_0x4da9d8];return _0x468872;};'use strict';var _=require('lodash');var util=require(_0x633c('0x0'));var logger=require(_0x633c('0x1'))(_0x633c('0x2'));var moment=require(_0x633c('0x3'));var BPromise=require(_0x633c('0x4'));var rp=require(_0x633c('0x5'));var fs=require('fs');var path=require(_0x633c('0x6'));var rimraf=require('rimraf');var config=require(_0x633c('0x7'));var attributes=require(_0x633c('0x8'));module[_0x633c('0x9')]=function(_0x41e5f4,_0x4872e0){return _0x41e5f4[_0x633c('0xa')](_0x633c('0xb'),attributes,{'tableName':_0x633c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8837=['moment','bluebird','path','rimraf','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api'];(function(_0x432e72,_0x247efd){var _0x432ccd=function(_0x280670){while(--_0x280670){_0x432e72['push'](_0x432e72['shift']());}};_0x432ccd(++_0x247efd);}(_0x8837,0xd9));var _0x7883=function(_0x38e8ef,_0x59ae9a){_0x38e8ef=_0x38e8ef-0x0;var _0x310744=_0x8837[_0x38e8ef];return _0x310744;};'use strict';var _=require(_0x7883('0x0'));var util=require('util');var logger=require(_0x7883('0x1'))(_0x7883('0x2'));var moment=require(_0x7883('0x3'));var BPromise=require(_0x7883('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7883('0x5'));var rimraf=require(_0x7883('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x7883('0x7')]=function(_0x25e248,_0x557e03){return _0x25e248[_0x7883('0x8')](_0x7883('0x9'),attributes,{'tableName':_0x7883('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 edffbd0..702ed13 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 _0xc15c=['http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options','where','attributes','limit','include','model','map','info','debug','ChatQueue','find','raw','ShowChatQueue','moment','bluebird','randomstring','../../mysqldb','rpc','client'];(function(_0x47c199,_0x4ba09f){var _0x60c20b=function(_0x134218){while(--_0x134218){_0x47c199['push'](_0x47c199['shift']());}};_0x60c20b(++_0x4ba09f);}(_0xc15c,0xae));var _0xcc15=function(_0xee78c0,_0x23a380){_0xee78c0=_0xee78c0-0x0;var _0x294bec=_0xc15c[_0xee78c0];return _0x294bec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcc15('0x0'));var BPromise=require(_0xcc15('0x1'));var rs=require(_0xcc15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc15('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc15('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcc15('0x5')][_0xcc15('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcc15('0x7')],{'host':_0xcc15('0x8'),'port':0x18eb});var socket=require(_0xcc15('0x9'))(new Redis(config[_0xcc15('0x7')]));require(_0xcc15('0xa'))['register'](socket);function respondWithRpcPromise(_0x355a96,_0x363e58,_0x24316b){return new BPromise(function(_0x391197,_0x55a853){return client[_0xcc15('0xb')](_0x355a96,_0x24316b)[_0xcc15('0xc')](function(_0x40dded){logger['info']('ChatQueue,\x20%s,\x20%s',_0x363e58,_0xcc15('0xd'));logger['debug'](_0xcc15('0xe'),_0x363e58,'request\x20sent',JSON[_0xcc15('0xf')](_0x40dded));if(_0x40dded['error']){if(_0x40dded[_0xcc15('0x10')]['code']===0x1f4){logger[_0xcc15('0x10')](_0xcc15('0x11'),_0x363e58,_0x40dded[_0xcc15('0x10')][_0xcc15('0x12')]);return _0x55a853(_0x40dded['error']['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x363e58,_0x40dded[_0xcc15('0x10')][_0xcc15('0x12')]);return _0x391197(_0x40dded[_0xcc15('0x10')]['message']);}else{logger['info'](_0xcc15('0x11'),_0x363e58,'request\x20sent');_0x391197(_0x40dded[_0xcc15('0x13')][_0xcc15('0x12')]);}})[_0xcc15('0x14')](function(_0x47a574){logger['error'](_0xcc15('0x11'),_0x363e58,_0x47a574);_0x55a853(_0x47a574);});});}exports[_0xcc15('0x15')]=function(_0x590809){var _0x25de95=this;return new Promise(function(_0x3254a9,_0x3f574c){return db['ChatQueue'][_0xcc15('0x16')]({'raw':_0x590809['options']?_0x590809[_0xcc15('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x590809[_0xcc15('0x17')]?_0x590809[_0xcc15('0x17')][_0xcc15('0x18')]||null:null,'attributes':_0x590809[_0xcc15('0x17')]?_0x590809['options'][_0xcc15('0x19')]||null:null,'limit':_0x590809[_0xcc15('0x17')]?_0x590809[_0xcc15('0x17')][_0xcc15('0x1a')]||null:null,'include':_0x590809['options']?_0x590809[_0xcc15('0x17')][_0xcc15('0x1b')]?_['map'](_0x590809['options'][_0xcc15('0x1b')],function(_0x3ebade){return{'model':db[_0x3ebade[_0xcc15('0x1c')]],'as':_0x3ebade['as'],'attributes':_0x3ebade[_0xcc15('0x19')],'include':_0x3ebade['include']?_[_0xcc15('0x1d')](_0x3ebade[_0xcc15('0x1b')],function(_0x4f4af8){return{'model':db[_0x4f4af8[_0xcc15('0x1c')]],'as':_0x4f4af8['as'],'attributes':_0x4f4af8['attributes'],'include':_0x4f4af8['include']?_[_0xcc15('0x1d')](_0x4f4af8['include'],function(_0x481c4e){return{'model':db[_0x481c4e[_0xcc15('0x1c')]],'as':_0x481c4e['as'],'attributes':_0x481c4e[_0xcc15('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcc15('0xc')](function(_0x171a09){logger[_0xcc15('0x1e')]('GetChatQueue',_0x590809);logger[_0xcc15('0x1f')](_0xcc15('0x15'),_0x590809,JSON[_0xcc15('0xf')](_0x171a09));_0x3254a9(_0x171a09);})[_0xcc15('0x14')](function(_0x3c6102){logger[_0xcc15('0x10')](_0xcc15('0x15'),_0x3c6102[_0xcc15('0x12')],_0x590809);_0x3f574c(_0x25de95[_0xcc15('0x10')](0x1f4,_0x3c6102[_0xcc15('0x12')]));});});};exports['ShowChatQueue']=function(_0x57db3e){var _0x21b2fd=this;return new Promise(function(_0x4698e1,_0xf2b71c){return db[_0xcc15('0x20')][_0xcc15('0x21')]({'raw':_0x57db3e[_0xcc15('0x17')]?_0x57db3e['options'][_0xcc15('0x22')]===undefined?!![]:![]:!![],'where':_0x57db3e['options']?_0x57db3e[_0xcc15('0x17')][_0xcc15('0x18')]||null:null,'attributes':_0x57db3e[_0xcc15('0x17')]?_0x57db3e[_0xcc15('0x17')][_0xcc15('0x19')]||null:null,'include':_0x57db3e[_0xcc15('0x17')]?_0x57db3e[_0xcc15('0x17')][_0xcc15('0x1b')]?_[_0xcc15('0x1d')](_0x57db3e[_0xcc15('0x17')]['include'],function(_0xb0116){return{'model':db[_0xb0116[_0xcc15('0x1c')]],'as':_0xb0116['as'],'attributes':_0xb0116[_0xcc15('0x19')],'include':_0xb0116[_0xcc15('0x1b')]?_[_0xcc15('0x1d')](_0xb0116['include'],function(_0x3f8cd1){return{'model':db[_0x3f8cd1[_0xcc15('0x1c')]],'as':_0x3f8cd1['as'],'attributes':_0x3f8cd1[_0xcc15('0x19')],'include':_0x3f8cd1['include']?_['map'](_0x3f8cd1[_0xcc15('0x1b')],function(_0x979923){return{'model':db[_0x979923['model']],'as':_0x979923['as'],'attributes':_0x979923[_0xcc15('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x69ba47){logger[_0xcc15('0x1e')](_0xcc15('0x23'),_0x57db3e);logger[_0xcc15('0x1f')]('ShowChatQueue',_0x57db3e,JSON[_0xcc15('0xf')](_0x69ba47));_0x4698e1(_0x69ba47);})[_0xcc15('0x14')](function(_0x2d769a){logger[_0xcc15('0x10')](_0xcc15('0x23'),_0x2d769a[_0xcc15('0x12')],_0x57db3e);_0xf2b71c(_0x21b2fd[_0xcc15('0x10')](0x1f4,_0x2d769a[_0xcc15('0x12')]));});});};
\ No newline at end of file
+var _0x1f75=['catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0x1f75,0x13c));var _0x51f7=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1f75[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0x51f7('0x0'));var moment=require(_0x51f7('0x1'));var BPromise=require(_0x51f7('0x2'));var rs=require(_0x51f7('0x3'));var fs=require('fs');var Redis=require(_0x51f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x51f7('0x5'));var logger=require(_0x51f7('0x6'))(_0x51f7('0x7'));var config=require(_0x51f7('0x8'));var jayson=require(_0x51f7('0x9'));var client=jayson[_0x51f7('0xa')][_0x51f7('0xb')]({'port':0x232a});config[_0x51f7('0xc')]=_[_0x51f7('0xd')](config[_0x51f7('0xc')],{'host':_0x51f7('0xe'),'port':0x18eb});var socket=require(_0x51f7('0xf'))(new Redis(config['redis']));require(_0x51f7('0x10'))[_0x51f7('0x11')](socket);function respondWithRpcPromise(_0x4d7014,_0x11e24c,_0x3ad08e){return new BPromise(function(_0x4c5629,_0x4ddeb4){return client[_0x51f7('0x12')](_0x4d7014,_0x3ad08e)[_0x51f7('0x13')](function(_0x55e3cd){logger[_0x51f7('0x14')](_0x51f7('0x15'),_0x11e24c,'request\x20sent');logger[_0x51f7('0x16')](_0x51f7('0x17'),_0x11e24c,_0x51f7('0x18'),JSON['stringify'](_0x55e3cd));if(_0x55e3cd['error']){if(_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1a')]===0x1f4){logger[_0x51f7('0x19')](_0x51f7('0x15'),_0x11e24c,_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1b')]);return _0x4ddeb4(_0x55e3cd['error'][_0x51f7('0x1b')]);}logger[_0x51f7('0x19')](_0x51f7('0x15'),_0x11e24c,_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1b')]);return _0x4c5629(_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1b')]);}else{logger['info'](_0x51f7('0x15'),_0x11e24c,_0x51f7('0x18'));_0x4c5629(_0x55e3cd['result'][_0x51f7('0x1b')]);}})[_0x51f7('0x1c')](function(_0x4dfdef){logger['error']('ChatQueue,\x20%s,\x20%s',_0x11e24c,_0x4dfdef);_0x4ddeb4(_0x4dfdef);});});}exports[_0x51f7('0x1d')]=function(_0x5a4e63){var _0x5c869a=this;return new Promise(function(_0x293eee,_0x1decc1){return db[_0x51f7('0x1e')][_0x51f7('0x1f')]({'raw':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x21')]===undefined?!![]:![]:!![],'where':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63['options'][_0x51f7('0x22')]||null:null,'attributes':_0x5a4e63['options']?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x23')]||null:null,'limit':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x24')]||null:null,'include':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x25')]?_[_0x51f7('0x26')](_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x25')],function(_0x47ed7c){return{'model':db[_0x47ed7c[_0x51f7('0x27')]],'as':_0x47ed7c['as'],'attributes':_0x47ed7c[_0x51f7('0x23')],'include':_0x47ed7c[_0x51f7('0x25')]?_['map'](_0x47ed7c[_0x51f7('0x25')],function(_0x11e723){return{'model':db[_0x11e723[_0x51f7('0x27')]],'as':_0x11e723['as'],'attributes':_0x11e723[_0x51f7('0x23')],'include':_0x11e723['include']?_[_0x51f7('0x26')](_0x11e723[_0x51f7('0x25')],function(_0x1d8bf6){return{'model':db[_0x1d8bf6[_0x51f7('0x27')]],'as':_0x1d8bf6['as'],'attributes':_0x1d8bf6[_0x51f7('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31cf1f){logger[_0x51f7('0x14')](_0x51f7('0x1d'),_0x5a4e63);logger['debug'](_0x51f7('0x1d'),_0x5a4e63,JSON['stringify'](_0x31cf1f));_0x293eee(_0x31cf1f);})['catch'](function(_0x12a9ce){logger[_0x51f7('0x19')](_0x51f7('0x1d'),_0x12a9ce[_0x51f7('0x1b')],_0x5a4e63);_0x1decc1(_0x5c869a[_0x51f7('0x19')](0x1f4,_0x12a9ce[_0x51f7('0x1b')]));});});};exports[_0x51f7('0x28')]=function(_0x5d7dec){var _0x4a8ee1=this;return new Promise(function(_0x411f39,_0x3e3078){return db[_0x51f7('0x1e')][_0x51f7('0x29')]({'raw':_0x5d7dec[_0x51f7('0x20')]?_0x5d7dec[_0x51f7('0x20')][_0x51f7('0x21')]===undefined?!![]:![]:!![],'where':_0x5d7dec[_0x51f7('0x20')]?_0x5d7dec[_0x51f7('0x20')]['where']||null:null,'attributes':_0x5d7dec[_0x51f7('0x20')]?_0x5d7dec['options'][_0x51f7('0x23')]||null:null,'include':_0x5d7dec['options']?_0x5d7dec[_0x51f7('0x20')]['include']?_[_0x51f7('0x26')](_0x5d7dec['options'][_0x51f7('0x25')],function(_0x2506da){return{'model':db[_0x2506da[_0x51f7('0x27')]],'as':_0x2506da['as'],'attributes':_0x2506da['attributes'],'include':_0x2506da[_0x51f7('0x25')]?_[_0x51f7('0x26')](_0x2506da['include'],function(_0x537d7d){return{'model':db[_0x537d7d['model']],'as':_0x537d7d['as'],'attributes':_0x537d7d[_0x51f7('0x23')],'include':_0x537d7d[_0x51f7('0x25')]?_[_0x51f7('0x26')](_0x537d7d['include'],function(_0x8f385e){return{'model':db[_0x8f385e[_0x51f7('0x27')]],'as':_0x8f385e['as'],'attributes':_0x8f385e[_0x51f7('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12aaa5){logger[_0x51f7('0x14')](_0x51f7('0x28'),_0x5d7dec);logger['debug'](_0x51f7('0x28'),_0x5d7dec,JSON[_0x51f7('0x2a')](_0x12aaa5));_0x411f39(_0x12aaa5);})[_0x51f7('0x1c')](function(_0x48ba5b){logger[_0x51f7('0x19')](_0x51f7('0x28'),_0x48ba5b[_0x51f7('0x1b')],_0x5d7dec);_0x3e3078(_0x4a8ee1[_0x51f7('0x19')](0x1f4,_0x48ba5b[_0x51f7('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index e1ad1dc..ebe9ae2 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 _0x3667=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x87c64,_0x54f61a){var _0x30ad6e=function(_0x5871d9){while(--_0x5871d9){_0x87c64['push'](_0x87c64['shift']());}};_0x30ad6e(++_0x54f61a);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var ChatQueueEvents=require(_0x7366('0x0'));var events=[_0x7366('0x1'),_0x7366('0x2'),_0x7366('0x3')];function createListener(_0x3c601d,_0x5d1072){return function(_0x27a90d){_0x5d1072[_0x7366('0x4')](_0x3c601d,_0x27a90d);};}function removeListener(_0x4b32a7,_0x27726b){return function(){ChatQueueEvents[_0x7366('0x5')](_0x4b32a7,_0x27726b);};}exports[_0x7366('0x6')]=function(_0x1c0cf4){for(var _0x101e3d=0x0,_0x589397=events[_0x7366('0x7')];_0x101e3d<_0x589397;_0x101e3d++){var _0xa1a3c5=events[_0x101e3d];var _0x2dd32b=createListener(_0x7366('0x8')+_0xa1a3c5,_0x1c0cf4);ChatQueueEvents['on'](_0xa1a3c5,_0x2dd32b);}};
\ No newline at end of file
+var _0xf3cd=['remove','update','emit','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xf3cd[_0x2459fd];return _0x364cd2;};'use strict';var ChatQueueEvents=require(_0xdf3c('0x0'));var events=[_0xdf3c('0x1'),_0xdf3c('0x2'),_0xdf3c('0x3')];function createListener(_0x1839ec,_0x433a7f){return function(_0x54db05){_0x433a7f[_0xdf3c('0x4')](_0x1839ec,_0x54db05);};}function removeListener(_0x71b446,_0x9f71cb){return function(){ChatQueueEvents['removeListener'](_0x71b446,_0x9f71cb);};}exports[_0xdf3c('0x5')]=function(_0x17d42a){for(var _0x1313d5=0x0,_0x1f0601=events[_0xdf3c('0x6')];_0x1313d5<_0x1f0601;_0x1313d5++){var _0x28edae=events[_0x1313d5];var _0x52c073=createListener(_0xdf3c('0x7')+_0x28edae,_0x17d42a);ChatQueueEvents['on'](_0x28edae,_0x52c073);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 7172ddb..46a6ec4 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x521010,_0x2b9c5a){var _0x2f5e4f=function(_0x542e49){while(--_0x542e49){_0x521010['push'](_0x521010['shift']());}};_0x2f5e4f(++_0x2b9c5a);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x5fc3,0xa8));var _0x35fc=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x5fc3[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 2723934..04df73a 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 _0xfbd8=['STRING','DATE','moment','sequelize','exports'];(function(_0x3be036,_0x1a88a4){var _0x3751c7=function(_0x1daa6b){while(--_0x1daa6b){_0x3be036['push'](_0x3be036['shift']());}};_0x3751c7(++_0x1a88a4);}(_0xfbd8,0x1ba));var _0x8fbd=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0xfbd8[_0x557f5f];return _0x196eba;};'use strict';var moment=require(_0x8fbd('0x0'));var Sequelize=require(_0x8fbd('0x1'));module[_0x8fbd('0x2')]={'uniqueid':{'type':Sequelize[_0x8fbd('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8fbd('0x3')]},'joinAt':{'type':Sequelize[_0x8fbd('0x4')]},'leaveAt':{'type':Sequelize[_0x8fbd('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8fbd('0x4')]},'reason':{'type':Sequelize[_0x8fbd('0x3')]}};
\ No newline at end of file
+var _0xa786=['DATE','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa786,0x1d2));var _0x6a78=function(_0x230ba8,_0x2fa3ba){_0x230ba8=_0x230ba8-0x0;var _0x4a3d66=_0xa786[_0x230ba8];return _0x4a3d66;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x6a78('0x0')]={'uniqueid':{'type':Sequelize[_0x6a78('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x6a78('0x1')]},'joinAt':{'type':Sequelize[_0x6a78('0x2')]},'leaveAt':{'type':Sequelize[_0x6a78('0x2')]},'acceptAt':{'type':Sequelize[_0x6a78('0x2')]},'exitAt':{'type':Sequelize[_0x6a78('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 222fb3d..071d91f 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 _0x19fb=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','ChatQueueReport','findAll','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x369b7b,_0x3135a9){var _0x45f573=function(_0x175203){while(--_0x175203){_0x369b7b['push'](_0x369b7b['shift']());}};_0x45f573(++_0x3135a9);}(_0x19fb,0xdd));var _0xb19f=function(_0x12e6b5,_0x2ea21a){_0x12e6b5=_0x12e6b5-0x0;var _0x2a0a23=_0x19fb[_0x12e6b5];return _0x2a0a23;};'use strict';var emlformat=require(_0xb19f('0x0'));var rimraf=require(_0xb19f('0x1'));var zipdir=require(_0xb19f('0x2'));var jsonpatch=require(_0xb19f('0x3'));var rp=require(_0xb19f('0x4'));var moment=require(_0xb19f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb19f('0x6'));var path=require(_0xb19f('0x7'));var sox=require(_0xb19f('0x8'));var csv=require(_0xb19f('0x9'));var ejs=require(_0xb19f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb19f('0xb'));var squel=require(_0xb19f('0xc'));var crypto=require(_0xb19f('0xd'));var jsforce=require(_0xb19f('0xe'));var deskjs=require(_0xb19f('0xf'));var toCsv=require(_0xb19f('0x9'));var querystring=require(_0xb19f('0x10'));var Papa=require(_0xb19f('0x11'));var Redis=require('ioredis');var authService=require(_0xb19f('0x12'));var qs=require(_0xb19f('0x13'));var as=require(_0xb19f('0x14'));var hardwareService=require(_0xb19f('0x15'));var logger=require(_0xb19f('0x16'))(_0xb19f('0x17'));var utils=require(_0xb19f('0x18'));var config=require(_0xb19f('0x19'));var licenseUtil=require(_0xb19f('0x1a'));var db=require(_0xb19f('0x1b'))['db'];function respondWithStatusCode(_0x22272f,_0x26a1d1){_0x26a1d1=_0x26a1d1||0xcc;return function(_0xc4a0b5){if(_0xc4a0b5){return _0x22272f[_0xb19f('0x1c')](_0x26a1d1);}return _0x22272f[_0xb19f('0x1d')](_0x26a1d1)['end']();};}function respondWithResult(_0x214290,_0x3482f9){_0x3482f9=_0x3482f9||0xc8;return function(_0x34518a){if(_0x34518a){return _0x214290['status'](_0x3482f9)[_0xb19f('0x1e')](_0x34518a);}};}function respondWithFilteredResult(_0x13ebd4,_0x46b688){return function(_0x5640ea){if(_0x5640ea){var _0x11318c=typeof _0x46b688[_0xb19f('0x1f')]===_0xb19f('0x20')&&typeof _0x46b688['limit']===_0xb19f('0x20');var _0x49d304=_0x5640ea['count'];var _0x5b52d9=_0x11318c?0x0:_0x46b688[_0xb19f('0x1f')];var _0x3b4367=_0x11318c?_0x5640ea[_0xb19f('0x21')]:_0x46b688[_0xb19f('0x1f')]+_0x46b688['limit'];var _0x2aedec;if(_0x3b4367>=_0x49d304){_0x3b4367=_0x49d304;_0x2aedec=0xc8;}else{_0x2aedec=0xce;}_0x13ebd4[_0xb19f('0x1d')](_0x2aedec);return _0x13ebd4['set'](_0xb19f('0x22'),_0x5b52d9+'-'+_0x3b4367+'/'+_0x49d304)['json'](_0x5640ea);}return null;};}function patchUpdates(_0x3950c9){return function(_0x2acb39){try{jsonpatch[_0xb19f('0x23')](_0x2acb39,_0x3950c9,!![]);}catch(_0xb449b4){return BPromise[_0xb19f('0x24')](_0xb449b4);}return _0x2acb39[_0xb19f('0x25')]();};}function saveUpdates(_0x333198,_0x4eb288){return function(_0x9ab8fc){if(_0x9ab8fc){return _0x9ab8fc[_0xb19f('0x26')](_0x333198)[_0xb19f('0x27')](function(_0x34c638){return _0x34c638;});}return null;};}function removeEntity(_0x47e313,_0x25fbdc){return function(_0x33b4ad){if(_0x33b4ad){return _0x33b4ad[_0xb19f('0x28')]()[_0xb19f('0x27')](function(){_0x47e313[_0xb19f('0x1d')](0xcc)[_0xb19f('0x29')]();});}};}function handleEntityNotFound(_0x28e0ad,_0x388b28){return function(_0xf528d){if(!_0xf528d){_0x28e0ad[_0xb19f('0x1c')](0x194);}return _0xf528d;};}function handleError(_0x2e0544,_0x59ccde){_0x59ccde=_0x59ccde||0x1f4;return function(_0x3e1365){logger[_0xb19f('0x2a')](_0x3e1365['stack']);if(_0x3e1365[_0xb19f('0x2b')]){delete _0x3e1365[_0xb19f('0x2b')];}_0x2e0544['status'](_0x59ccde)['send'](_0x3e1365);};}exports[_0xb19f('0x2c')]=function(_0x17c22d,_0x3d2f84){var _0x46abbe={},_0x5e479a={},_0x5043b2={'count':0x0,'rows':[]};var _0x5e4a74=_[_0xb19f('0x2d')](db['ChatQueueReport']['rawAttributes'],function(_0x4b06eb){return{'name':_0x4b06eb[_0xb19f('0x2e')],'type':_0x4b06eb[_0xb19f('0x2f')][_0xb19f('0x30')]};});_0x5e479a[_0xb19f('0x31')]=_[_0xb19f('0x2d')](_0x5e4a74,_0xb19f('0x2b'));_0x5e479a['query']=_[_0xb19f('0x32')](_0x17c22d[_0xb19f('0x33')]);_0x5e479a['filters']=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],_0x5e479a[_0xb19f('0x33')]);_0x46abbe[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],qs['fields'](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x36')]));_0x46abbe[_0xb19f('0x35')]=_0x46abbe[_0xb19f('0x35')][_0xb19f('0x37')]?_0x46abbe[_0xb19f('0x35')]:_0x5e479a['model'];if(!_0x17c22d[_0xb19f('0x33')][_0xb19f('0x38')](_0xb19f('0x39'))){_0x46abbe[_0xb19f('0x3a')]=qs[_0xb19f('0x3a')](_0x17c22d[_0xb19f('0x33')]['limit']);_0x46abbe[_0xb19f('0x1f')]=qs[_0xb19f('0x1f')](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x1f')]);}_0x46abbe[_0xb19f('0x3b')]=qs[_0xb19f('0x3c')](_0x17c22d[_0xb19f('0x33')]['sort']);_0x46abbe[_0xb19f('0x3d')]=qs['filters'](_[_0xb19f('0x3e')](_0x17c22d[_0xb19f('0x33')],_0x5e479a[_0xb19f('0x3f')]),_0x5e4a74);if(_0x17c22d['query'][_0xb19f('0x40')]){_0x46abbe['where']=_[_0xb19f('0x41')](_0x46abbe[_0xb19f('0x3d')],{'$or':_['map'](_0x5e4a74,function(_0x1e0a79){if(_0x1e0a79[_0xb19f('0x2f')]!==_0xb19f('0x42')){var _0x13afe8={};_0x13afe8[_0x1e0a79['name']]={'$like':'%'+_0x17c22d[_0xb19f('0x33')][_0xb19f('0x40')]+'%'};return _0x13afe8;}})});}_0x46abbe=_[_0xb19f('0x41')]({},_0x46abbe,_0x17c22d[_0xb19f('0x43')]);var _0x2b4b5d={'where':_0x46abbe[_0xb19f('0x3d')]};return db['ChatQueueReport'][_0xb19f('0x21')](_0x2b4b5d)['then'](function(_0x1b85f6){_0x5043b2['count']=_0x1b85f6;if(_0x17c22d[_0xb19f('0x33')][_0xb19f('0x44')]){_0x46abbe['include']=[{'all':!![]}];}return db[_0xb19f('0x45')][_0xb19f('0x46')](_0x46abbe);})[_0xb19f('0x27')](function(_0x13cae8){_0x5043b2['rows']=_0x13cae8;return _0x5043b2;})[_0xb19f('0x27')](respondWithFilteredResult(_0x3d2f84,_0x46abbe))[_0xb19f('0x47')](handleError(_0x3d2f84,null));};exports[_0xb19f('0x48')]=function(_0x52c368,_0x2c68de){var _0x5772ac={'raw':!![],'where':{'id':_0x52c368[_0xb19f('0x49')]['id']}},_0x16bf0d={};_0x16bf0d[_0xb19f('0x31')]=_[_0xb19f('0x32')](db[_0xb19f('0x45')][_0xb19f('0x4a')]);_0x16bf0d[_0xb19f('0x33')]=_[_0xb19f('0x32')](_0x52c368['query']);_0x16bf0d[_0xb19f('0x3f')]=_[_0xb19f('0x34')](_0x16bf0d['model'],_0x16bf0d[_0xb19f('0x33')]);_0x5772ac[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x16bf0d['model'],qs[_0xb19f('0x36')](_0x52c368['query'][_0xb19f('0x36')]));_0x5772ac['attributes']=_0x5772ac[_0xb19f('0x35')]['length']?_0x5772ac[_0xb19f('0x35')]:_0x16bf0d[_0xb19f('0x31')];if(_0x52c368[_0xb19f('0x33')]['includeAll']){_0x5772ac['include']=[{'all':!![]}];}_0x5772ac=_[_0xb19f('0x41')]({},_0x5772ac,_0x52c368[_0xb19f('0x43')]);return db[_0xb19f('0x45')]['find'](_0x5772ac)['then'](handleEntityNotFound(_0x2c68de,null))['then'](respondWithResult(_0x2c68de,null))[_0xb19f('0x47')](handleError(_0x2c68de,null));};exports[_0xb19f('0x4b')]=function(_0x5dbfdc,_0x194910){return db['ChatQueueReport'][_0xb19f('0x4b')](_0x5dbfdc[_0xb19f('0x4c')],{})[_0xb19f('0x27')](respondWithResult(_0x194910,0xc9))[_0xb19f('0x47')](handleError(_0x194910,null));};exports[_0xb19f('0x26')]=function(_0x401787,_0x20da72){if(_0x401787[_0xb19f('0x4c')]['id']){delete _0x401787[_0xb19f('0x4c')]['id'];}return db[_0xb19f('0x45')][_0xb19f('0x4d')]({'where':{'id':_0x401787['params']['id']}})['then'](handleEntityNotFound(_0x20da72,null))[_0xb19f('0x27')](saveUpdates(_0x401787[_0xb19f('0x4c')],null))[_0xb19f('0x27')](respondWithResult(_0x20da72,null))[_0xb19f('0x47')](handleError(_0x20da72,null));};exports[_0xb19f('0x28')]=function(_0x57812a,_0x58b3c5){return db[_0xb19f('0x45')]['find']({'where':{'id':_0x57812a[_0xb19f('0x49')]['id']}})[_0xb19f('0x27')](handleEntityNotFound(_0x58b3c5,null))[_0xb19f('0x27')](removeEntity(_0x58b3c5,null))['catch'](handleError(_0x58b3c5,null));};exports[_0xb19f('0x4e')]=function(_0x12b227,_0x1b7e57){return db[_0xb19f('0x45')][_0xb19f('0x4e')]()[_0xb19f('0x27')](respondWithResult(_0x1b7e57,null))[_0xb19f('0x47')](handleError(_0x1b7e57,null));};
\ No newline at end of file
+var _0x9fd4=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9fd4,0x16c));var _0x49fd=function(_0x461eaa,_0x5b9604){_0x461eaa=_0x461eaa-0x0;var _0x3f2756=_0x9fd4[_0x461eaa];return _0x3f2756;};'use strict';var emlformat=require(_0x49fd('0x0'));var rimraf=require(_0x49fd('0x1'));var zipdir=require(_0x49fd('0x2'));var jsonpatch=require(_0x49fd('0x3'));var rp=require(_0x49fd('0x4'));var moment=require(_0x49fd('0x5'));var BPromise=require(_0x49fd('0x6'));var Mustache=require(_0x49fd('0x7'));var util=require(_0x49fd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x49fd('0x9'));var ejs=require(_0x49fd('0xa'));var fs=require('fs');var fs_extra=require(_0x49fd('0xb'));var _=require(_0x49fd('0xc'));var squel=require('squel');var crypto=require(_0x49fd('0xd'));var jsforce=require(_0x49fd('0xe'));var deskjs=require(_0x49fd('0xf'));var toCsv=require(_0x49fd('0x9'));var querystring=require(_0x49fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x49fd('0x11'));var authService=require(_0x49fd('0x12'));var qs=require(_0x49fd('0x13'));var as=require(_0x49fd('0x14'));var hardwareService=require(_0x49fd('0x15'));var logger=require(_0x49fd('0x16'))(_0x49fd('0x17'));var utils=require('../../config/utils');var config=require(_0x49fd('0x18'));var licenseUtil=require(_0x49fd('0x19'));var db=require(_0x49fd('0x1a'))['db'];function respondWithStatusCode(_0x40d1b0,_0x15dabd){_0x15dabd=_0x15dabd||0xcc;return function(_0x206bd8){if(_0x206bd8){return _0x40d1b0[_0x49fd('0x1b')](_0x15dabd);}return _0x40d1b0[_0x49fd('0x1c')](_0x15dabd)[_0x49fd('0x1d')]();};}function respondWithResult(_0x652890,_0x157b09){_0x157b09=_0x157b09||0xc8;return function(_0x44c18c){if(_0x44c18c){return _0x652890[_0x49fd('0x1c')](_0x157b09)[_0x49fd('0x1e')](_0x44c18c);}};}function respondWithFilteredResult(_0x264ab1,_0x201109){return function(_0x2859f2){if(_0x2859f2){var _0x3ca675=typeof _0x201109[_0x49fd('0x1f')]===_0x49fd('0x20')&&typeof _0x201109[_0x49fd('0x21')]===_0x49fd('0x20');var _0x320fe5=_0x2859f2[_0x49fd('0x22')];var _0xb55d24=_0x3ca675?0x0:_0x201109[_0x49fd('0x1f')];var _0x598793=_0x3ca675?_0x2859f2[_0x49fd('0x22')]:_0x201109[_0x49fd('0x1f')]+_0x201109['limit'];var _0x5c323a;if(_0x598793>=_0x320fe5){_0x598793=_0x320fe5;_0x5c323a=0xc8;}else{_0x5c323a=0xce;}_0x264ab1[_0x49fd('0x1c')](_0x5c323a);return _0x264ab1['set'](_0x49fd('0x23'),_0xb55d24+'-'+_0x598793+'/'+_0x320fe5)[_0x49fd('0x1e')](_0x2859f2);}return null;};}function patchUpdates(_0x599315){return function(_0xf7efcf){try{jsonpatch[_0x49fd('0x24')](_0xf7efcf,_0x599315,!![]);}catch(_0x5ae3bc){return BPromise[_0x49fd('0x25')](_0x5ae3bc);}return _0xf7efcf[_0x49fd('0x26')]();};}function saveUpdates(_0x2e1c40,_0x290f59){return function(_0x20fa0d){if(_0x20fa0d){return _0x20fa0d[_0x49fd('0x27')](_0x2e1c40)['then'](function(_0x46019d){return _0x46019d;});}return null;};}function removeEntity(_0xd43815,_0x8f202b){return function(_0x4bf811){if(_0x4bf811){return _0x4bf811[_0x49fd('0x28')]()[_0x49fd('0x29')](function(){_0xd43815[_0x49fd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597161,_0x497469){return function(_0x13c5a8){if(!_0x13c5a8){_0x597161[_0x49fd('0x1b')](0x194);}return _0x13c5a8;};}function handleError(_0x4ec190,_0x302ab2){_0x302ab2=_0x302ab2||0x1f4;return function(_0x9587b9){logger[_0x49fd('0x2a')](_0x9587b9[_0x49fd('0x2b')]);if(_0x9587b9[_0x49fd('0x2c')]){delete _0x9587b9['name'];}_0x4ec190[_0x49fd('0x1c')](_0x302ab2)['send'](_0x9587b9);};}exports[_0x49fd('0x2d')]=function(_0x89badc,_0x54acb5){var _0x203038={},_0x2c8568={},_0x23374c={'count':0x0,'rows':[]};var _0x43826f=_[_0x49fd('0x2e')](db[_0x49fd('0x2f')][_0x49fd('0x30')],function(_0x242203){return{'name':_0x242203['fieldName'],'type':_0x242203[_0x49fd('0x31')]['key']};});_0x2c8568[_0x49fd('0x32')]=_['map'](_0x43826f,_0x49fd('0x2c'));_0x2c8568[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x89badc['query']);_0x2c8568['filters']=_['intersection'](_0x2c8568[_0x49fd('0x32')],_0x2c8568[_0x49fd('0x33')]);_0x203038['attributes']=_[_0x49fd('0x35')](_0x2c8568['model'],qs['fields'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x36')]));_0x203038[_0x49fd('0x37')]=_0x203038[_0x49fd('0x37')][_0x49fd('0x38')]?_0x203038['attributes']:_0x2c8568['model'];if(!_0x89badc[_0x49fd('0x33')][_0x49fd('0x39')](_0x49fd('0x3a'))){_0x203038[_0x49fd('0x21')]=qs['limit'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x21')]);_0x203038[_0x49fd('0x1f')]=qs[_0x49fd('0x1f')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x1f')]);}_0x203038[_0x49fd('0x3b')]=qs[_0x49fd('0x3c')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x3c')]);_0x203038[_0x49fd('0x3d')]=qs['filters'](_[_0x49fd('0x3e')](_0x89badc[_0x49fd('0x33')],_0x2c8568[_0x49fd('0x3f')]),_0x43826f);if(_0x89badc[_0x49fd('0x33')][_0x49fd('0x40')]){_0x203038[_0x49fd('0x3d')]=_[_0x49fd('0x41')](_0x203038[_0x49fd('0x3d')],{'$or':_[_0x49fd('0x2e')](_0x43826f,function(_0x4a1856){if(_0x4a1856[_0x49fd('0x31')]!=='VIRTUAL'){var _0x46e84c={};_0x46e84c[_0x4a1856[_0x49fd('0x2c')]]={'$like':'%'+_0x89badc['query'][_0x49fd('0x40')]+'%'};return _0x46e84c;}})});}_0x203038=_[_0x49fd('0x41')]({},_0x203038,_0x89badc['options']);var _0x1f9a65={'where':_0x203038['where']};return db['ChatQueueReport']['count'](_0x1f9a65)[_0x49fd('0x29')](function(_0x32982e){_0x23374c[_0x49fd('0x22')]=_0x32982e;if(_0x89badc[_0x49fd('0x33')]['includeAll']){_0x203038[_0x49fd('0x42')]=[{'all':!![]}];}return db[_0x49fd('0x2f')][_0x49fd('0x43')](_0x203038);})[_0x49fd('0x29')](function(_0x115c5a){_0x23374c[_0x49fd('0x44')]=_0x115c5a;return _0x23374c;})[_0x49fd('0x29')](respondWithFilteredResult(_0x54acb5,_0x203038))[_0x49fd('0x45')](handleError(_0x54acb5,null));};exports['show']=function(_0x255a73,_0x2c8ab1){var _0x4dce94={'raw':!![],'where':{'id':_0x255a73[_0x49fd('0x46')]['id']}},_0x3be41b={};_0x3be41b['model']=_[_0x49fd('0x34')](db['ChatQueueReport'][_0x49fd('0x30')]);_0x3be41b[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x255a73[_0x49fd('0x33')]);_0x3be41b['filters']=_['intersection'](_0x3be41b[_0x49fd('0x32')],_0x3be41b['query']);_0x4dce94[_0x49fd('0x37')]=_[_0x49fd('0x35')](_0x3be41b[_0x49fd('0x32')],qs[_0x49fd('0x36')](_0x255a73['query'][_0x49fd('0x36')]));_0x4dce94[_0x49fd('0x37')]=_0x4dce94[_0x49fd('0x37')][_0x49fd('0x38')]?_0x4dce94[_0x49fd('0x37')]:_0x3be41b[_0x49fd('0x32')];if(_0x255a73[_0x49fd('0x33')][_0x49fd('0x47')]){_0x4dce94[_0x49fd('0x42')]=[{'all':!![]}];}_0x4dce94=_[_0x49fd('0x41')]({},_0x4dce94,_0x255a73[_0x49fd('0x48')]);return db[_0x49fd('0x2f')][_0x49fd('0x49')](_0x4dce94)[_0x49fd('0x29')](handleEntityNotFound(_0x2c8ab1,null))['then'](respondWithResult(_0x2c8ab1,null))['catch'](handleError(_0x2c8ab1,null));};exports[_0x49fd('0x4a')]=function(_0xa3518f,_0x42287e){return db[_0x49fd('0x2f')]['create'](_0xa3518f[_0x49fd('0x4b')],{})[_0x49fd('0x29')](respondWithResult(_0x42287e,0xc9))['catch'](handleError(_0x42287e,null));};exports[_0x49fd('0x27')]=function(_0x270360,_0xaac56f){if(_0x270360[_0x49fd('0x4b')]['id']){delete _0x270360[_0x49fd('0x4b')]['id'];}return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x270360[_0x49fd('0x46')]['id']}})[_0x49fd('0x29')](handleEntityNotFound(_0xaac56f,null))[_0x49fd('0x29')](saveUpdates(_0x270360[_0x49fd('0x4b')],null))['then'](respondWithResult(_0xaac56f,null))[_0x49fd('0x45')](handleError(_0xaac56f,null));};exports[_0x49fd('0x28')]=function(_0x32694b,_0x263cf3){return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x32694b['params']['id']}})['then'](handleEntityNotFound(_0x263cf3,null))[_0x49fd('0x29')](removeEntity(_0x263cf3,null))[_0x49fd('0x45')](handleError(_0x263cf3,null));};exports[_0x49fd('0x4c')]=function(_0x5c34c0,_0x31783f){return db[_0x49fd('0x2f')]['describe']()['then'](respondWithResult(_0x31783f,null))['catch'](handleError(_0x31783f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 7e05813..ec25308 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x32d442,_0x318f79){var _0x544226=function(_0x241d65){while(--_0x241d65){_0x32d442['push'](_0x32d442['shift']());}};_0x544226(++_0x318f79);}(_0x757a,0xde));var _0xa757=function(_0x1f11cf,_0x450690){_0x1f11cf=_0x1f11cf-0x0;var _0x43cd9c=_0x757a[_0x1f11cf];return _0x43cd9c;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e6b2e,_0x43cd8c){var _0x453c51=function(_0x153230){while(--_0x153230){_0x5e6b2e['push'](_0x5e6b2e['shift']());}};_0x453c51(++_0x43cd8c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c1e7d84..585ffc1 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 _0xd237=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','stringify','update','options','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd237,0x14f));var _0x7d23=function(_0x2c30ea,_0x3deb34){_0x2c30ea=_0x2c30ea-0x0;var _0x3e0406=_0xd237[_0x2c30ea];return _0x3e0406;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca126,_0x48358f,_0xc43371){return new BPromise(function(_0x42c334,_0x6ce28d){return client[_0x7d23('0xb')](_0x5ca126,_0xc43371)[_0x7d23('0xc')](function(_0x23f1d6){logger[_0x7d23('0xd')](_0x7d23('0xe'),_0x48358f,'request\x20sent');logger[_0x7d23('0xf')](_0x7d23('0x10'),_0x48358f,_0x7d23('0x11'),JSON['stringify'](_0x23f1d6));if(_0x23f1d6[_0x7d23('0x12')]){if(_0x23f1d6['error'][_0x7d23('0x13')]===0x1f4){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x6ce28d(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x42c334(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}else{logger['info'](_0x7d23('0xe'),_0x48358f,'request\x20sent');_0x42c334(_0x23f1d6[_0x7d23('0x15')]['message']);}})[_0x7d23('0x16')](function(_0x46a35b){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x46a35b);_0x6ce28d(_0x46a35b);});});}exports[_0x7d23('0x17')]=function(_0x506a3b){var _0x313471=this;return new Promise(function(_0x3d6a7b,_0x49ce32){return db[_0x7d23('0x18')][_0x7d23('0x19')](_0x506a3b[_0x7d23('0x1a')],{'raw':_0x506a3b['options']?_0x506a3b['options'][_0x7d23('0x1b')]===undefined?!![]:![]:!![]})[_0x7d23('0xc')](function(_0x56b0ba){logger[_0x7d23('0xd')]('CreateChatQueueReport',_0x506a3b);logger[_0x7d23('0xf')]('CreateChatQueueReport',_0x506a3b,JSON[_0x7d23('0x1c')](_0x56b0ba));_0x3d6a7b(_0x56b0ba);})[_0x7d23('0x16')](function(_0x59522b){logger[_0x7d23('0x12')](_0x7d23('0x17'),_0x59522b[_0x7d23('0x14')],_0x506a3b);_0x49ce32(_0x313471['error'](0x1f4,_0x59522b[_0x7d23('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2e6d9f){var _0x354b2a=this;return new Promise(function(_0x1c007a,_0x3a5d87){return db[_0x7d23('0x18')][_0x7d23('0x1d')](_0x2e6d9f[_0x7d23('0x1a')],{'raw':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f['options'][_0x7d23('0x1f')]||null:null,'attributes':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x20')]||null:null,'limit':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x21')]||null:null})[_0x7d23('0xc')](function(_0x4808f2){logger[_0x7d23('0xd')](_0x7d23('0x22'),_0x2e6d9f);logger['debug'](_0x7d23('0x22'),_0x2e6d9f,JSON[_0x7d23('0x1c')](_0x4808f2));_0x1c007a(_0x4808f2);})[_0x7d23('0x16')](function(_0x4b1c92){logger[_0x7d23('0x12')](_0x7d23('0x22'),_0x4b1c92[_0x7d23('0x14')],_0x2e6d9f);_0x3a5d87(_0x354b2a[_0x7d23('0x12')](0x1f4,_0x4b1c92[_0x7d23('0x14')]));});});};
\ No newline at end of file
+var _0x63c6=['body','options','raw','then','info','where','UpdateChatQueueReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x132edb,_0x54e052){var _0x294aab=function(_0x3630cf){while(--_0x3630cf){_0x132edb['push'](_0x132edb['shift']());}};_0x294aab(++_0x54e052);}(_0x63c6,0xbb));var _0x663c=function(_0x10f318,_0x3b4ab5){_0x10f318=_0x10f318-0x0;var _0x1d471b=_0x63c6[_0x10f318];return _0x1d471b;};'use strict';var _=require(_0x663c('0x0'));var util=require(_0x663c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x663c('0x2'));var fs=require('fs');var Redis=require(_0x663c('0x3'));var db=require(_0x663c('0x4'))['db'];var utils=require(_0x663c('0x5'));var logger=require(_0x663c('0x6'))(_0x663c('0x7'));var config=require(_0x663c('0x8'));var jayson=require(_0x663c('0x9'));var client=jayson[_0x663c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dbe47,_0xe6ac97,_0x3eb551){return new BPromise(function(_0xb32d9e,_0x5b9376){return client[_0x663c('0xb')](_0x1dbe47,_0x3eb551)['then'](function(_0x38dc88){logger['info'](_0x663c('0xc'),_0xe6ac97,_0x663c('0xd'));logger[_0x663c('0xe')](_0x663c('0xf'),_0xe6ac97,_0x663c('0xd'),JSON[_0x663c('0x10')](_0x38dc88));if(_0x38dc88[_0x663c('0x11')]){if(_0x38dc88['error']['code']===0x1f4){logger[_0x663c('0x11')](_0x663c('0xc'),_0xe6ac97,_0x38dc88['error'][_0x663c('0x12')]);return _0x5b9376(_0x38dc88[_0x663c('0x11')][_0x663c('0x12')]);}logger[_0x663c('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0xe6ac97,_0x38dc88[_0x663c('0x11')][_0x663c('0x12')]);return _0xb32d9e(_0x38dc88['error'][_0x663c('0x12')]);}else{logger['info'](_0x663c('0xc'),_0xe6ac97,_0x663c('0xd'));_0xb32d9e(_0x38dc88[_0x663c('0x13')][_0x663c('0x12')]);}})[_0x663c('0x14')](function(_0x2d2a8f){logger[_0x663c('0x11')](_0x663c('0xc'),_0xe6ac97,_0x2d2a8f);_0x5b9376(_0x2d2a8f);});});}exports[_0x663c('0x15')]=function(_0x3c87fe){var _0x517f70=this;return new Promise(function(_0x2fd707,_0x33f149){return db[_0x663c('0x16')]['create'](_0x3c87fe[_0x663c('0x17')],{'raw':_0x3c87fe[_0x663c('0x18')]?_0x3c87fe[_0x663c('0x18')][_0x663c('0x19')]===undefined?!![]:![]:!![]})[_0x663c('0x1a')](function(_0x54fa2f){logger[_0x663c('0x1b')](_0x663c('0x15'),_0x3c87fe);logger[_0x663c('0xe')](_0x663c('0x15'),_0x3c87fe,JSON['stringify'](_0x54fa2f));_0x2fd707(_0x54fa2f);})['catch'](function(_0x2ac148){logger[_0x663c('0x11')](_0x663c('0x15'),_0x2ac148[_0x663c('0x12')],_0x3c87fe);_0x33f149(_0x517f70[_0x663c('0x11')](0x1f4,_0x2ac148['message']));});});};exports['UpdateChatQueueReport']=function(_0x4b7213){var _0x2587a5=this;return new Promise(function(_0x357986,_0x35842e){return db[_0x663c('0x16')]['update'](_0x4b7213[_0x663c('0x17')],{'raw':_0x4b7213[_0x663c('0x18')]?_0x4b7213[_0x663c('0x18')][_0x663c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b7213[_0x663c('0x18')]?_0x4b7213['options'][_0x663c('0x1c')]||null:null,'attributes':_0x4b7213['options']?_0x4b7213[_0x663c('0x18')]['attributes']||null:null,'limit':_0x4b7213['options']?_0x4b7213[_0x663c('0x18')]['limit']||null:null})[_0x663c('0x1a')](function(_0x274a2a){logger[_0x663c('0x1b')](_0x663c('0x1d'),_0x4b7213);logger[_0x663c('0xe')](_0x663c('0x1d'),_0x4b7213,JSON[_0x663c('0x10')](_0x274a2a));_0x357986(_0x274a2a);})['catch'](function(_0x61ebd3){logger[_0x663c('0x11')](_0x663c('0x1d'),_0x61ebd3[_0x663c('0x12')],_0x4b7213);_0x35842e(_0x2587a5[_0x663c('0x11')](0x1f4,_0x61ebd3[_0x663c('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 0fe77ed..0eed898 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 _0x61e9=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','/:id','isAuthenticated','post','put','update','delete','exports'];(function(_0x3911e0,_0x1e4327){var _0x5096fb=function(_0x4325f7){while(--_0x4325f7){_0x3911e0['push'](_0x3911e0['shift']());}};_0x5096fb(++_0x1e4327);}(_0x61e9,0x160));var _0x961e=function(_0x52f19f,_0x52164b){_0x52f19f=_0x52f19f-0x0;var _0x528dd8=_0x61e9[_0x52f19f];return _0x528dd8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x961e('0x0'));var timeout=require(_0x961e('0x1'));var express=require(_0x961e('0x2'));var router=express['Router']();var fs_extra=require(_0x961e('0x3'));var auth=require(_0x961e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x961e('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x961e('0x6')]);router[_0x961e('0x7')](_0x961e('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x961e('0x7')](_0x961e('0x9'),auth[_0x961e('0xa')](),controller['show']);router[_0x961e('0xb')]('/',auth[_0x961e('0xa')](),controller['create']);router[_0x961e('0xc')](_0x961e('0x9'),auth[_0x961e('0xa')](),controller[_0x961e('0xd')]);router[_0x961e('0xe')](_0x961e('0x9'),auth[_0x961e('0xa')](),controller['destroy']);module[_0x961e('0xf')]=router;
\ No newline at end of file
+var _0x0b9b=['index','isAuthenticated','describe','show','create','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x0b9b,0xf1));var _0xb0b9=function(_0x1e8821,_0x44257b){_0x1e8821=_0x1e8821-0x0;var _0x126b21=_0x0b9b[_0x1e8821];return _0x126b21;};'use strict';var multer=require(_0xb0b9('0x0'));var util=require(_0xb0b9('0x1'));var path=require(_0xb0b9('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0b9('0x3'));var router=express[_0xb0b9('0x4')]();var fs_extra=require(_0xb0b9('0x5'));var auth=require(_0xb0b9('0x6'));var interaction=require(_0xb0b9('0x7'));var config=require(_0xb0b9('0x8'));var controller=require(_0xb0b9('0x9'));router[_0xb0b9('0xa')]('/',auth['isAuthenticated'](),controller[_0xb0b9('0xb')]);router['get']('/describe',auth[_0xb0b9('0xc')](),controller[_0xb0b9('0xd')]);router[_0xb0b9('0xa')]('/:id',auth[_0xb0b9('0xc')](),controller[_0xb0b9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb0b9('0xf')]);router['put']('/:id',auth[_0xb0b9('0xc')](),controller[_0xb0b9('0x10')]);router[_0xb0b9('0x11')](_0xb0b9('0x12'),auth[_0xb0b9('0xc')](),controller[_0xb0b9('0x13')]);module[_0xb0b9('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 14e8c11..688ab0a 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1d4c60,_0xc3ffad){var _0x2252b4=function(_0x1121b7){while(--_0x1121b7){_0x1d4c60['push'](_0x1d4c60['shift']());}};_0x2252b4(++_0xc3ffad);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xcb91[_0x2dc96f];return _0xd012da;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xb43b,0x1b2));var _0xbb43=function(_0x55acc5,_0x9a1492){_0x55acc5=_0x55acc5-0x0;var _0x5521b5=_0xb43b[_0x55acc5];return _0x5521b5;};'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 39677ab..14ec664 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 _0x42fa=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','save','update','destroy','error','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x45c957,_0x276317){var _0x1bf7f4=function(_0x51688b){while(--_0x51688b){_0x45c957['push'](_0x45c957['shift']());}};_0x1bf7f4(++_0x276317);}(_0x42fa,0xd8));var _0xa42f=function(_0xdbc0da,_0x376234){_0xdbc0da=_0xdbc0da-0x0;var _0x54157f=_0x42fa[_0xdbc0da];return _0x54157f;};'use strict';var emlformat=require(_0xa42f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa42f('0x1'));var rp=require('request-promise');var moment=require(_0xa42f('0x2'));var BPromise=require(_0xa42f('0x3'));var Mustache=require(_0xa42f('0x4'));var util=require(_0xa42f('0x5'));var path=require(_0xa42f('0x6'));var sox=require(_0xa42f('0x7'));var csv=require('to-csv');var ejs=require(_0xa42f('0x8'));var fs=require('fs');var fs_extra=require(_0xa42f('0x9'));var _=require(_0xa42f('0xa'));var squel=require(_0xa42f('0xb'));var crypto=require(_0xa42f('0xc'));var jsforce=require(_0xa42f('0xd'));var deskjs=require(_0xa42f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa42f('0xf'));var Papa=require(_0xa42f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa42f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa42f('0x12'));var logger=require('../../config/logger')(_0xa42f('0x13'));var utils=require(_0xa42f('0x14'));var config=require(_0xa42f('0x15'));var licenseUtil=require(_0xa42f('0x16'));var db=require(_0xa42f('0x17'))['db'];function respondWithStatusCode(_0x5f4f15,_0x2eb730){_0x2eb730=_0x2eb730||0xcc;return function(_0x1cfeaa){if(_0x1cfeaa){return _0x5f4f15[_0xa42f('0x18')](_0x2eb730);}return _0x5f4f15['status'](_0x2eb730)[_0xa42f('0x19')]();};}function respondWithResult(_0x56bc41,_0x1faa39){_0x1faa39=_0x1faa39||0xc8;return function(_0x444210){if(_0x444210){return _0x56bc41[_0xa42f('0x1a')](_0x1faa39)[_0xa42f('0x1b')](_0x444210);}};}function respondWithFilteredResult(_0x4522da,_0x547338){return function(_0x23a1b1){if(_0x23a1b1){var _0x20f2e4=typeof _0x547338[_0xa42f('0x1c')]==='undefined'&&typeof _0x547338[_0xa42f('0x1d')]===_0xa42f('0x1e');var _0x216d41=_0x23a1b1[_0xa42f('0x1f')];var _0x582eb1=_0x20f2e4?0x0:_0x547338[_0xa42f('0x1c')];var _0x3cf16f=_0x20f2e4?_0x23a1b1[_0xa42f('0x1f')]:_0x547338[_0xa42f('0x1c')]+_0x547338[_0xa42f('0x1d')];var _0x440d9b;if(_0x3cf16f>=_0x216d41){_0x3cf16f=_0x216d41;_0x440d9b=0xc8;}else{_0x440d9b=0xce;}_0x4522da[_0xa42f('0x1a')](_0x440d9b);return _0x4522da[_0xa42f('0x20')]('Content-Range',_0x582eb1+'-'+_0x3cf16f+'/'+_0x216d41)[_0xa42f('0x1b')](_0x23a1b1);}return null;};}function patchUpdates(_0x40ef63){return function(_0x1c5b14){try{jsonpatch['apply'](_0x1c5b14,_0x40ef63,!![]);}catch(_0x361824){return BPromise[_0xa42f('0x21')](_0x361824);}return _0x1c5b14[_0xa42f('0x22')]();};}function saveUpdates(_0x1bf246,_0x26a066){return function(_0x11cbfa){if(_0x11cbfa){return _0x11cbfa[_0xa42f('0x23')](_0x1bf246)['then'](function(_0x315bdf){return _0x315bdf;});}return null;};}function removeEntity(_0x1fb90b,_0x3e8de8){return function(_0x362d52){if(_0x362d52){return _0x362d52[_0xa42f('0x24')]()['then'](function(){_0x1fb90b[_0xa42f('0x1a')](0xcc)[_0xa42f('0x19')]();});}};}function handleEntityNotFound(_0x45fd28,_0x54e225){return function(_0x5a9dfc){if(!_0x5a9dfc){_0x45fd28[_0xa42f('0x18')](0x194);}return _0x5a9dfc;};}function handleError(_0x41fd77,_0x370bd4){_0x370bd4=_0x370bd4||0x1f4;return function(_0x4e14df){logger[_0xa42f('0x25')](_0x4e14df['stack']);if(_0x4e14df[_0xa42f('0x26')]){delete _0x4e14df[_0xa42f('0x26')];}_0x41fd77[_0xa42f('0x1a')](_0x370bd4)[_0xa42f('0x27')](_0x4e14df);};}exports[_0xa42f('0x28')]=function(_0x5987d7,_0x56218){var _0x597d0e={},_0x159c80={},_0x424f57={'count':0x0,'rows':[]};var _0x1576fd=_[_0xa42f('0x29')](db[_0xa42f('0x2a')]['rawAttributes'],function(_0x10816c){return{'name':_0x10816c[_0xa42f('0x2b')],'type':_0x10816c[_0xa42f('0x2c')][_0xa42f('0x2d')]};});_0x159c80[_0xa42f('0x2e')]=_[_0xa42f('0x29')](_0x1576fd,_0xa42f('0x26'));_0x159c80[_0xa42f('0x2f')]=_[_0xa42f('0x30')](_0x5987d7['query']);_0x159c80[_0xa42f('0x31')]=_[_0xa42f('0x32')](_0x159c80[_0xa42f('0x2e')],_0x159c80[_0xa42f('0x2f')]);_0x597d0e['attributes']=_[_0xa42f('0x32')](_0x159c80['model'],qs['fields'](_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x33')]));_0x597d0e[_0xa42f('0x34')]=_0x597d0e[_0xa42f('0x34')][_0xa42f('0x35')]?_0x597d0e['attributes']:_0x159c80[_0xa42f('0x2e')];if(!_0x5987d7['query'][_0xa42f('0x36')](_0xa42f('0x37'))){_0x597d0e[_0xa42f('0x1d')]=qs['limit'](_0x5987d7['query'][_0xa42f('0x1d')]);_0x597d0e[_0xa42f('0x1c')]=qs['offset'](_0x5987d7[_0xa42f('0x2f')]['offset']);}_0x597d0e[_0xa42f('0x38')]=qs[_0xa42f('0x39')](_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x39')]);_0x597d0e[_0xa42f('0x3a')]=qs[_0xa42f('0x31')](_[_0xa42f('0x3b')](_0x5987d7['query'],_0x159c80['filters']),_0x1576fd);if(_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x3c')]){_0x597d0e[_0xa42f('0x3a')]=_[_0xa42f('0x3d')](_0x597d0e[_0xa42f('0x3a')],{'$or':_[_0xa42f('0x29')](_0x1576fd,function(_0x44fe4a){if(_0x44fe4a['type']!==_0xa42f('0x3e')){var _0x4c8938={};_0x4c8938[_0x44fe4a[_0xa42f('0x26')]]={'$like':'%'+_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x3c')]+'%'};return _0x4c8938;}})});}_0x597d0e=_[_0xa42f('0x3d')]({},_0x597d0e,_0x5987d7['options']);var _0xbb5a68={'where':_0x597d0e['where']};return db[_0xa42f('0x2a')][_0xa42f('0x1f')](_0xbb5a68)[_0xa42f('0x3f')](function(_0x3faba3){_0x424f57[_0xa42f('0x1f')]=_0x3faba3;if(_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x40')]){_0x597d0e[_0xa42f('0x41')]=[{'all':!![]}];}return db[_0xa42f('0x2a')][_0xa42f('0x42')](_0x597d0e);})[_0xa42f('0x3f')](function(_0x110c5e){_0x424f57['rows']=_0x110c5e;return _0x424f57;})[_0xa42f('0x3f')](respondWithFilteredResult(_0x56218,_0x597d0e))[_0xa42f('0x43')](handleError(_0x56218,null));};exports[_0xa42f('0x44')]=function(_0x2bac0d,_0x48c7fc){var _0x4f986d={'raw':!![],'where':{'id':_0x2bac0d['params']['id']}},_0x54ed5f={};_0x54ed5f['model']=_['keys'](db[_0xa42f('0x2a')]['rawAttributes']);_0x54ed5f[_0xa42f('0x2f')]=_[_0xa42f('0x30')](_0x2bac0d[_0xa42f('0x2f')]);_0x54ed5f[_0xa42f('0x31')]=_[_0xa42f('0x32')](_0x54ed5f[_0xa42f('0x2e')],_0x54ed5f[_0xa42f('0x2f')]);_0x4f986d['attributes']=_[_0xa42f('0x32')](_0x54ed5f[_0xa42f('0x2e')],qs[_0xa42f('0x33')](_0x2bac0d[_0xa42f('0x2f')][_0xa42f('0x33')]));_0x4f986d[_0xa42f('0x34')]=_0x4f986d[_0xa42f('0x34')][_0xa42f('0x35')]?_0x4f986d[_0xa42f('0x34')]:_0x54ed5f['model'];if(_0x2bac0d['query'][_0xa42f('0x40')]){_0x4f986d[_0xa42f('0x41')]=[{'all':!![]}];}_0x4f986d=_[_0xa42f('0x3d')]({},_0x4f986d,_0x2bac0d[_0xa42f('0x45')]);return db['ChatTransferReport'][_0xa42f('0x46')](_0x4f986d)[_0xa42f('0x3f')](handleEntityNotFound(_0x48c7fc,null))[_0xa42f('0x3f')](respondWithResult(_0x48c7fc,null))['catch'](handleError(_0x48c7fc,null));};exports[_0xa42f('0x47')]=function(_0x402622,_0x2eaa54){return db[_0xa42f('0x2a')]['create'](_0x402622['body'],{})[_0xa42f('0x3f')](respondWithResult(_0x2eaa54,0xc9))[_0xa42f('0x43')](handleError(_0x2eaa54,null));};exports[_0xa42f('0x23')]=function(_0x374c7c,_0x33b575){if(_0x374c7c['body']['id']){delete _0x374c7c[_0xa42f('0x48')]['id'];}return db[_0xa42f('0x2a')]['find']({'where':{'id':_0x374c7c['params']['id']}})[_0xa42f('0x3f')](handleEntityNotFound(_0x33b575,null))['then'](saveUpdates(_0x374c7c['body'],null))[_0xa42f('0x3f')](respondWithResult(_0x33b575,null))[_0xa42f('0x43')](handleError(_0x33b575,null));};exports[_0xa42f('0x24')]=function(_0x48db39,_0x41eac2){return db['ChatTransferReport'][_0xa42f('0x46')]({'where':{'id':_0x48db39[_0xa42f('0x49')]['id']}})[_0xa42f('0x3f')](handleEntityNotFound(_0x41eac2,null))[_0xa42f('0x3f')](removeEntity(_0x41eac2,null))[_0xa42f('0x43')](handleError(_0x41eac2,null));};exports[_0xa42f('0x4a')]=function(_0x465a88,_0x12a929){return db['ChatTransferReport'][_0xa42f('0x4a')]()[_0xa42f('0x3f')](respondWithResult(_0x12a929,null))['catch'](handleError(_0x12a929,null));};
\ No newline at end of file
+var _0xdf35=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','where','VIRTUAL','filter','merge','ChatTransferReport','rows','catch','show','length','includeAll','include','options','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x1ed46f,_0x7691d7){var _0x43b931=function(_0x5f2454){while(--_0x5f2454){_0x1ed46f['push'](_0x1ed46f['shift']());}};_0x43b931(++_0x7691d7);}(_0xdf35,0xd7));var _0x5df3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdf35[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x5df3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5df3('0x1'));var jsonpatch=require(_0x5df3('0x2'));var rp=require(_0x5df3('0x3'));var moment=require(_0x5df3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5df3('0x5'));var sox=require(_0x5df3('0x6'));var csv=require(_0x5df3('0x7'));var ejs=require(_0x5df3('0x8'));var fs=require('fs');var fs_extra=require(_0x5df3('0x9'));var _=require(_0x5df3('0xa'));var squel=require(_0x5df3('0xb'));var crypto=require('crypto');var jsforce=require(_0x5df3('0xc'));var deskjs=require(_0x5df3('0xd'));var toCsv=require(_0x5df3('0x7'));var querystring=require(_0x5df3('0xe'));var Papa=require('papaparse');var Redis=require(_0x5df3('0xf'));var authService=require(_0x5df3('0x10'));var qs=require(_0x5df3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df3('0x12'));var logger=require(_0x5df3('0x13'))('api');var utils=require(_0x5df3('0x14'));var config=require(_0x5df3('0x15'));var licenseUtil=require(_0x5df3('0x16'));var db=require(_0x5df3('0x17'))['db'];function respondWithStatusCode(_0x2aa332,_0x36243c){_0x36243c=_0x36243c||0xcc;return function(_0x155fad){if(_0x155fad){return _0x2aa332[_0x5df3('0x18')](_0x36243c);}return _0x2aa332['status'](_0x36243c)[_0x5df3('0x19')]();};}function respondWithResult(_0x42bca6,_0x57af28){_0x57af28=_0x57af28||0xc8;return function(_0x4af505){if(_0x4af505){return _0x42bca6[_0x5df3('0x1a')](_0x57af28)[_0x5df3('0x1b')](_0x4af505);}};}function respondWithFilteredResult(_0x223439,_0x2066d7){return function(_0x983ddf){if(_0x983ddf){var _0x64cd75=typeof _0x2066d7[_0x5df3('0x1c')]===_0x5df3('0x1d')&&typeof _0x2066d7['limit']===_0x5df3('0x1d');var _0x49f1d9=_0x983ddf[_0x5df3('0x1e')];var _0x54166d=_0x64cd75?0x0:_0x2066d7[_0x5df3('0x1c')];var _0x3f9dc1=_0x64cd75?_0x983ddf['count']:_0x2066d7[_0x5df3('0x1c')]+_0x2066d7['limit'];var _0xf76c8b;if(_0x3f9dc1>=_0x49f1d9){_0x3f9dc1=_0x49f1d9;_0xf76c8b=0xc8;}else{_0xf76c8b=0xce;}_0x223439[_0x5df3('0x1a')](_0xf76c8b);return _0x223439[_0x5df3('0x1f')](_0x5df3('0x20'),_0x54166d+'-'+_0x3f9dc1+'/'+_0x49f1d9)[_0x5df3('0x1b')](_0x983ddf);}return null;};}function patchUpdates(_0x47f820){return function(_0x401a72){try{jsonpatch[_0x5df3('0x21')](_0x401a72,_0x47f820,!![]);}catch(_0x42ef33){return BPromise[_0x5df3('0x22')](_0x42ef33);}return _0x401a72[_0x5df3('0x23')]();};}function saveUpdates(_0x4c9404,_0x1beb40){return function(_0x1feda9){if(_0x1feda9){return _0x1feda9[_0x5df3('0x24')](_0x4c9404)['then'](function(_0x592d43){return _0x592d43;});}return null;};}function removeEntity(_0x8dba27,_0x4d191a){return function(_0x4d769c){if(_0x4d769c){return _0x4d769c[_0x5df3('0x25')]()[_0x5df3('0x26')](function(){_0x8dba27[_0x5df3('0x1a')](0xcc)[_0x5df3('0x19')]();});}};}function handleEntityNotFound(_0x133cbb,_0x30e116){return function(_0x5c28ac){if(!_0x5c28ac){_0x133cbb[_0x5df3('0x18')](0x194);}return _0x5c28ac;};}function handleError(_0x1441ca,_0x247876){_0x247876=_0x247876||0x1f4;return function(_0x5c1141){logger['error'](_0x5c1141[_0x5df3('0x27')]);if(_0x5c1141['name']){delete _0x5c1141[_0x5df3('0x28')];}_0x1441ca['status'](_0x247876)[_0x5df3('0x29')](_0x5c1141);};}exports[_0x5df3('0x2a')]=function(_0x30413a,_0x2070b6){var _0x39c946={},_0x5828d1={},_0xbf5357={'count':0x0,'rows':[]};var _0x1ba198=_['map'](db['ChatTransferReport'][_0x5df3('0x2b')],function(_0x9bd995){return{'name':_0x9bd995[_0x5df3('0x2c')],'type':_0x9bd995[_0x5df3('0x2d')][_0x5df3('0x2e')]};});_0x5828d1[_0x5df3('0x2f')]=_[_0x5df3('0x30')](_0x1ba198,_0x5df3('0x28'));_0x5828d1[_0x5df3('0x31')]=_[_0x5df3('0x32')](_0x30413a[_0x5df3('0x31')]);_0x5828d1['filters']=_[_0x5df3('0x33')](_0x5828d1[_0x5df3('0x2f')],_0x5828d1[_0x5df3('0x31')]);_0x39c946[_0x5df3('0x34')]=_[_0x5df3('0x33')](_0x5828d1[_0x5df3('0x2f')],qs[_0x5df3('0x35')](_0x30413a[_0x5df3('0x31')]['fields']));_0x39c946['attributes']=_0x39c946[_0x5df3('0x34')]['length']?_0x39c946[_0x5df3('0x34')]:_0x5828d1['model'];if(!_0x30413a[_0x5df3('0x31')][_0x5df3('0x36')](_0x5df3('0x37'))){_0x39c946[_0x5df3('0x38')]=qs[_0x5df3('0x38')](_0x30413a['query'][_0x5df3('0x38')]);_0x39c946['offset']=qs[_0x5df3('0x1c')](_0x30413a[_0x5df3('0x31')]['offset']);}_0x39c946[_0x5df3('0x39')]=qs[_0x5df3('0x3a')](_0x30413a['query'][_0x5df3('0x3a')]);_0x39c946['where']=qs[_0x5df3('0x3b')](_[_0x5df3('0x3c')](_0x30413a[_0x5df3('0x31')],_0x5828d1['filters']),_0x1ba198);if(_0x30413a['query']['filter']){_0x39c946[_0x5df3('0x3d')]=_['merge'](_0x39c946[_0x5df3('0x3d')],{'$or':_[_0x5df3('0x30')](_0x1ba198,function(_0x18b964){if(_0x18b964[_0x5df3('0x2d')]!==_0x5df3('0x3e')){var _0x1d3662={};_0x1d3662[_0x18b964[_0x5df3('0x28')]]={'$like':'%'+_0x30413a[_0x5df3('0x31')][_0x5df3('0x3f')]+'%'};return _0x1d3662;}})});}_0x39c946=_[_0x5df3('0x40')]({},_0x39c946,_0x30413a['options']);var _0xbc2c0e={'where':_0x39c946[_0x5df3('0x3d')]};return db[_0x5df3('0x41')]['count'](_0xbc2c0e)[_0x5df3('0x26')](function(_0x52699e){_0xbf5357[_0x5df3('0x1e')]=_0x52699e;if(_0x30413a['query']['includeAll']){_0x39c946['include']=[{'all':!![]}];}return db[_0x5df3('0x41')]['findAll'](_0x39c946);})['then'](function(_0x334223){_0xbf5357[_0x5df3('0x42')]=_0x334223;return _0xbf5357;})['then'](respondWithFilteredResult(_0x2070b6,_0x39c946))[_0x5df3('0x43')](handleError(_0x2070b6,null));};exports[_0x5df3('0x44')]=function(_0x36c709,_0x3425b6){var _0x1a4af5={'raw':!![],'where':{'id':_0x36c709['params']['id']}},_0xc3dddf={};_0xc3dddf['model']=_[_0x5df3('0x32')](db['ChatTransferReport'][_0x5df3('0x2b')]);_0xc3dddf['query']=_[_0x5df3('0x32')](_0x36c709[_0x5df3('0x31')]);_0xc3dddf[_0x5df3('0x3b')]=_[_0x5df3('0x33')](_0xc3dddf[_0x5df3('0x2f')],_0xc3dddf['query']);_0x1a4af5[_0x5df3('0x34')]=_[_0x5df3('0x33')](_0xc3dddf[_0x5df3('0x2f')],qs[_0x5df3('0x35')](_0x36c709[_0x5df3('0x31')]['fields']));_0x1a4af5['attributes']=_0x1a4af5[_0x5df3('0x34')][_0x5df3('0x45')]?_0x1a4af5['attributes']:_0xc3dddf[_0x5df3('0x2f')];if(_0x36c709[_0x5df3('0x31')][_0x5df3('0x46')]){_0x1a4af5[_0x5df3('0x47')]=[{'all':!![]}];}_0x1a4af5=_['merge']({},_0x1a4af5,_0x36c709[_0x5df3('0x48')]);return db[_0x5df3('0x41')][_0x5df3('0x49')](_0x1a4af5)[_0x5df3('0x26')](handleEntityNotFound(_0x3425b6,null))[_0x5df3('0x26')](respondWithResult(_0x3425b6,null))[_0x5df3('0x43')](handleError(_0x3425b6,null));};exports['create']=function(_0x56177f,_0x337e9c){return db[_0x5df3('0x41')][_0x5df3('0x4a')](_0x56177f[_0x5df3('0x4b')],{})['then'](respondWithResult(_0x337e9c,0xc9))[_0x5df3('0x43')](handleError(_0x337e9c,null));};exports[_0x5df3('0x24')]=function(_0x134be4,_0x4acd76){if(_0x134be4[_0x5df3('0x4b')]['id']){delete _0x134be4['body']['id'];}return db[_0x5df3('0x41')][_0x5df3('0x49')]({'where':{'id':_0x134be4['params']['id']}})['then'](handleEntityNotFound(_0x4acd76,null))['then'](saveUpdates(_0x134be4['body'],null))[_0x5df3('0x26')](respondWithResult(_0x4acd76,null))[_0x5df3('0x43')](handleError(_0x4acd76,null));};exports['destroy']=function(_0x280d39,_0x514d6d){return db[_0x5df3('0x41')][_0x5df3('0x49')]({'where':{'id':_0x280d39[_0x5df3('0x4c')]['id']}})[_0x5df3('0x26')](handleEntityNotFound(_0x514d6d,null))[_0x5df3('0x26')](removeEntity(_0x514d6d,null))['catch'](handleError(_0x514d6d,null));};exports['describe']=function(_0x5951ed,_0x53532c){return db[_0x5df3('0x41')][_0x5df3('0x4d')]()['then'](respondWithResult(_0x53532c,null))['catch'](handleError(_0x53532c,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 036835f..5d891e8 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 _0x3d07=['../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3d07,0xbb));var _0x73d0=function(_0x562ec5,_0x36b5a4){_0x562ec5=_0x562ec5-0x0;var _0x279c8c=_0x3d07[_0x562ec5];return _0x279c8c;};'use strict';var _=require(_0x73d0('0x0'));var util=require(_0x73d0('0x1'));var logger=require(_0x73d0('0x2'))(_0x73d0('0x3'));var moment=require(_0x73d0('0x4'));var BPromise=require(_0x73d0('0x5'));var rp=require(_0x73d0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73d0('0x7'));var config=require(_0x73d0('0x8'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3203b3,_0x4b16fa){return _0x3203b3[_0x73d0('0x9')](_0x73d0('0xa'),attributes,{'tableName':_0x73d0('0xb'),'paranoid':![],'indexes':[{'name':_0x73d0('0xc'),'fields':[_0x73d0('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x593d=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x593d,0x159));var _0xd593=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x593d[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xd593('0x0'));var util=require('util');var logger=require(_0xd593('0x1'))(_0xd593('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd593('0x3'));var fs=require('fs');var path=require(_0xd593('0x4'));var rimraf=require(_0xd593('0x5'));var config=require(_0xd593('0x6'));var attributes=require(_0xd593('0x7'));module[_0xd593('0x8')]=function(_0x301d5d,_0x2861e1){return _0x301d5d[_0xd593('0x9')](_0xd593('0xa'),attributes,{'tableName':_0xd593('0xb'),'paranoid':![],'indexes':[{'name':_0xd593('0xc'),'fields':[_0xd593('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 61d9363..37f73d8 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 _0x00c1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','util','moment'];(function(_0xdde82,_0x11bb2c){var _0x5164eb=function(_0x113405){while(--_0x113405){_0xdde82['push'](_0xdde82['shift']());}};_0x5164eb(++_0x11bb2c);}(_0x00c1,0x11c));var _0x100c=function(_0x47c09b,_0x47d19b){_0x47c09b=_0x47c09b-0x0;var _0x532567=_0x00c1[_0x47c09b];return _0x532567;};'use strict';var _=require('lodash');var util=require(_0x100c('0x0'));var moment=require(_0x100c('0x1'));var BPromise=require(_0x100c('0x2'));var rs=require(_0x100c('0x3'));var fs=require('fs');var Redis=require(_0x100c('0x4'));var db=require(_0x100c('0x5'))['db'];var utils=require(_0x100c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x100c('0x7'));var jayson=require(_0x100c('0x8'));var client=jayson[_0x100c('0x9')][_0x100c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9c9ec7,_0x10a4a9,_0x39049e){return new BPromise(function(_0x2be317,_0x26d5be){return client[_0x100c('0xb')](_0x9c9ec7,_0x39049e)[_0x100c('0xc')](function(_0x3d98ce){logger[_0x100c('0xd')](_0x100c('0xe'),_0x10a4a9,'request\x20sent');logger[_0x100c('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x10a4a9,'request\x20sent',JSON[_0x100c('0x10')](_0x3d98ce));if(_0x3d98ce[_0x100c('0x11')]){if(_0x3d98ce[_0x100c('0x11')][_0x100c('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x10a4a9,_0x3d98ce[_0x100c('0x11')]['message']);return _0x26d5be(_0x3d98ce['error']['message']);}logger[_0x100c('0x11')](_0x100c('0xe'),_0x10a4a9,_0x3d98ce[_0x100c('0x11')][_0x100c('0x13')]);return _0x2be317(_0x3d98ce['error'][_0x100c('0x13')]);}else{logger['info'](_0x100c('0xe'),_0x10a4a9,_0x100c('0x14'));_0x2be317(_0x3d98ce[_0x100c('0x15')][_0x100c('0x13')]);}})['catch'](function(_0x5e32da){logger[_0x100c('0x11')](_0x100c('0xe'),_0x10a4a9,_0x5e32da);_0x26d5be(_0x5e32da);});});}
\ No newline at end of file
+var _0x48eb=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4135d8,_0x19e538){var _0x10d479=function(_0x19a721){while(--_0x19a721){_0x4135d8['push'](_0x4135d8['shift']());}};_0x10d479(++_0x19e538);}(_0x48eb,0x170));var _0xb48e=function(_0x39065e,_0x17a1d2){_0x39065e=_0x39065e-0x0;var _0x456b5a=_0x48eb[_0x39065e];return _0x456b5a;};'use strict';var _=require(_0xb48e('0x0'));var util=require('util');var moment=require(_0xb48e('0x1'));var BPromise=require(_0xb48e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb48e('0x3'));var db=require(_0xb48e('0x4'))['db'];var utils=require(_0xb48e('0x5'));var logger=require('../../config/logger')(_0xb48e('0x6'));var config=require('../../config/environment');var jayson=require(_0xb48e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52a325,_0xc03c49,_0x2174f6){return new BPromise(function(_0x368b23,_0x48b813){return client[_0xb48e('0x8')](_0x52a325,_0x2174f6)[_0xb48e('0x9')](function(_0x15ce5f){logger['info'](_0xb48e('0xa'),_0xc03c49,_0xb48e('0xb'));logger[_0xb48e('0xc')](_0xb48e('0xd'),_0xc03c49,'request\x20sent',JSON[_0xb48e('0xe')](_0x15ce5f));if(_0x15ce5f[_0xb48e('0xf')]){if(_0x15ce5f['error']['code']===0x1f4){logger[_0xb48e('0xf')](_0xb48e('0xa'),_0xc03c49,_0x15ce5f[_0xb48e('0xf')][_0xb48e('0x10')]);return _0x48b813(_0x15ce5f['error'][_0xb48e('0x10')]);}logger['error'](_0xb48e('0xa'),_0xc03c49,_0x15ce5f['error']['message']);return _0x368b23(_0x15ce5f['error'][_0xb48e('0x10')]);}else{logger[_0xb48e('0x11')](_0xb48e('0xa'),_0xc03c49,_0xb48e('0xb'));_0x368b23(_0x15ce5f[_0xb48e('0x12')][_0xb48e('0x10')]);}})[_0xb48e('0x13')](function(_0xe2c1a6){logger[_0xb48e('0xf')](_0xb48e('0xa'),_0xc03c49,_0xe2c1a6);_0x48b813(_0xe2c1a6);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index f1a00ef..1151d5a 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 _0x603a=['update','delete','destroy','multer','express','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x8012b2,_0x370e3b){var _0x99bfa9=function(_0x4d1e29){while(--_0x4d1e29){_0x8012b2['push'](_0x8012b2['shift']());}};_0x99bfa9(++_0x370e3b);}(_0x603a,0x153));var _0xa603=function(_0x23cbb1,_0x178ee1){_0x23cbb1=_0x23cbb1-0x0;var _0x34273b=_0x603a[_0x23cbb1];return _0x34273b;};'use strict';var multer=require(_0xa603('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa603('0x1'));var router=express['Router']();var fs_extra=require(_0xa603('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xa603('0x3'));var config=require('../../config/environment');var controller=require(_0xa603('0x4'));router[_0xa603('0x5')]('/',auth[_0xa603('0x6')](),controller[_0xa603('0x7')]);router[_0xa603('0x5')](_0xa603('0x8'),auth['isAuthenticated'](),controller[_0xa603('0x9')]);router[_0xa603('0x5')](_0xa603('0xa'),auth[_0xa603('0x6')](),controller[_0xa603('0xb')]);router[_0xa603('0xc')]('/',auth[_0xa603('0x6')](),controller['create']);router['put'](_0xa603('0xa'),auth[_0xa603('0x6')](),controller[_0xa603('0xd')]);router[_0xa603('0xe')](_0xa603('0xa'),auth[_0xa603('0x6')](),controller[_0xa603('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xf43d=['../../config/environment','./chatTransferReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x25cf7c,_0x11966c){var _0x51d963=function(_0xf9dd94){while(--_0xf9dd94){_0x25cf7c['push'](_0x25cf7c['shift']());}};_0x51d963(++_0x11966c);}(_0xf43d,0x1f2));var _0xdf43=function(_0x100e02,_0x499d66){_0x100e02=_0x100e02-0x0;var _0x1f3fce=_0xf43d[_0x100e02];return _0x1f3fce;};'use strict';var multer=require('multer');var util=require(_0xdf43('0x0'));var path=require(_0xdf43('0x1'));var timeout=require(_0xdf43('0x2'));var express=require(_0xdf43('0x3'));var router=express[_0xdf43('0x4')]();var fs_extra=require(_0xdf43('0x5'));var auth=require(_0xdf43('0x6'));var interaction=require(_0xdf43('0x7'));var config=require(_0xdf43('0x8'));var controller=require(_0xdf43('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xdf43('0xa')]);router[_0xdf43('0xb')](_0xdf43('0xc'),auth['isAuthenticated'](),controller[_0xdf43('0xd')]);router[_0xdf43('0xb')](_0xdf43('0xe'),auth[_0xdf43('0xf')](),controller[_0xdf43('0x10')]);router['post']('/',auth[_0xdf43('0xf')](),controller['create']);router[_0xdf43('0x11')](_0xdf43('0xe'),auth[_0xdf43('0xf')](),controller[_0xdf43('0x12')]);router[_0xdf43('0x13')](_0xdf43('0xe'),auth[_0xdf43('0xf')](),controller[_0xdf43('0x14')]);module[_0xdf43('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 3ce0a70..8f12943 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 _0x34e8=['Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','TEXT','name','text','input','getDataValue','onlineForm','stringify','offlineForm','parse','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email'];(function(_0x1c5231,_0x352b7c){var _0x2db207=function(_0x2ccf2d){while(--_0x2ccf2d){_0x1c5231['push'](_0x1c5231['shift']());}};_0x2db207(++_0x352b7c);}(_0x34e8,0x12c));var _0x834e=function(_0x29d380,_0x27d909){_0x29d380=_0x29d380-0x0;var _0x4aa321=_0x34e8[_0x29d380];return _0x4aa321;};'use strict';var Sequelize=require(_0x834e('0x0'));var rs=require(_0x834e('0x1'));module[_0x834e('0x2')]={'name':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x834e('0x4')},'description':{'type':Sequelize[_0x834e('0x3')]},'mapKey':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'mapKeyOffline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'key':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x834e('0x3')]},'animation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x834e('0xb')](_0x834e('0xc'),_0x834e('0xd')),'defaultValue':_0x834e('0xc')},'header_online':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0xf')},'offline_chat_button':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x10')},'download_transcript':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x13')},'noteTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x15')},'closingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x16')},'closingMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x17')},'skipMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x834e('0xb')](_0x834e('0x19'),'thumb'),'defaultValue':_0x834e('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x834e('0x1b'),'type':_0x834e('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x834e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x1f'))?JSON['parse'](this[_0x834e('0x1e')](_0x834e('0x1f'))):{};},'set':function(_0x5e1cc5){return this['setDataValue'](_0x834e('0x1f'),JSON['stringify'](_0x5e1cc5));}},'offlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON[_0x834e('0x20')]({'items':[{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x834e('0x5'),'type':_0x834e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x21'))?JSON[_0x834e('0x22')](this['getDataValue'](_0x834e('0x21'))):{};},'set':function(_0x11f1ce){return this[_0x834e('0x23')](_0x834e('0x21'),JSON[_0x834e('0x20')](_0x11f1ce));}},'token':{'type':Sequelize[_0x834e('0x3')],'defaultValue':function(){return rs[_0x834e('0x24')]();}},'autoclose':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x834e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x834e('0x3')]},'waitingTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x25')},'waitingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x27')},'offlineMessageBody':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x29')},'skipUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'sendUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return _0x834e('0x2a');}},'notificationSound':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x834e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2b')},'verticalAlignment':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2c')},'messagesAlignment':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x834e('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x834e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x834e('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x834e('0x9')],'comment':_0x834e('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![],'comment':_0x834e('0x2f'),'set':function(_0x574ea8){if(!_0x574ea8)this[_0x834e('0x23')](_0x834e('0x30'),null);this[_0x834e('0x23')]('mandatoryDisposition',_0x574ea8);}},'vidaooEscalation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x834e('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x834e('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9f62=['Skip','Feedback','thumb','stringify','input','name','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x5afbac,_0xb65c4d){var _0x325fba=function(_0x789e25){while(--_0x789e25){_0x5afbac['push'](_0x5afbac['shift']());}};_0x325fba(++_0xb65c4d);}(_0x9f62,0x154));var _0x29f6=function(_0x592308,_0xe42315){_0x592308=_0x592308-0x0;var _0x1dd0b9=_0x9f62[_0x592308];return _0x1dd0b9;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x29f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'unique':_0x29f6('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x3')},'key':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x4')},'customerAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':_0x29f6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29f6('0x8')](_0x29f6('0x9'),'squared'),'defaultValue':_0x29f6('0x9')},'header_online':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0xa')},'header_offline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xb')},'download_transcript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29f6('0xe')]},'closingQuestion':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x11')},'noteTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x13')},'closingMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x15')},'ratingType':{'type':Sequelize[_0x29f6('0x8')]('star',_0x29f6('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'variable':null,'config':{'placeholder':_0x29f6('0x19'),'type':'text','required':!![]},'props':{'title':_0x29f6('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x29f6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29f6('0x1a')]('onlineForm')?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')]('onlineForm')):{};},'set':function(_0x1401fb){return this[_0x29f6('0x1c')](_0x29f6('0x1d'),JSON[_0x29f6('0x17')](_0x1401fb));}},'offlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null},{'type':_0x29f6('0x1e'),'config':{'placeholder':_0x29f6('0x1f')},'props':{'title':_0x29f6('0x1f'),'helpText':_0x29f6('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29f6('0x1a')](_0x29f6('0x21'))?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')](_0x29f6('0x21'))):{};},'set':function(_0x1c3f0b){return this[_0x29f6('0x1c')](_0x29f6('0x21'),JSON[_0x29f6('0x17')](_0x1c3f0b));}},'token':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return rs[_0x29f6('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29f6('0x1')]},'waitingTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x24')},'offlineMessageBody':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x26')},'skipUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'sendUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return _0x29f6('0x27');}},'notificationSound':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29f6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x29')},'messagesAlignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29f6('0x1')]},'customerAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x29f6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29f6('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f3475){if(!_0x3f3475)this[_0x29f6('0x1c')]('mandatoryDispositionPauseId',null);this[_0x29f6('0x1c')](_0x29f6('0x2a'),_0x3f3475);}},'vidaooEscalation':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29f6('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x2b')},'vidaooNote':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return _0x29f6('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 758f0d2..8d0eaa4 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 _0x176c=['destroy','findAndCountAll','priority','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','update','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','show','params','keys','intersection','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','file','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','sitepic','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','ChatApplication','Applications','List','list','orderBy','asc','account','defaults','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','applications','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','render','toPairs','offlineMessageBody','originalname','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','increment','chatLicenseExceeded','all','some','utf8','URL','origin','3.1.0','remote','x-real-ip','connection','virtual','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED'];(function(_0x269cd7,_0x35b9d9){var _0x2e103d=function(_0x2e1e72){while(--_0x2e1e72){_0x269cd7['push'](_0x269cd7['shift']());}};_0x2e103d(++_0x35b9d9);}(_0x176c,0x141));var _0xc176=function(_0x5d506f,_0x8da43f){_0x5d506f=_0x5d506f-0x0;var _0x7a9c9b=_0x176c[_0x5d506f];return _0x7a9c9b;};'use strict';var BPromise=require(_0xc176('0x0'));var Mustache=require(_0xc176('0x1'));var util=require(_0xc176('0x2'));var path=require(_0xc176('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc176('0x4'));var _=require(_0xc176('0x5'));var querystring=require(_0xc176('0x6'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc176('0x7'))(_0xc176('0x8'));var config=require('../../config/environment');var url=require('url');var db=require(_0xc176('0x9'))['db'];config['redis']=_['defaults'](config[_0xc176('0xa')],{'host':_0xc176('0xb'),'port':0x18eb});var socket=require(_0xc176('0xc'))(new Redis(config[_0xc176('0xa')]));require(_0xc176('0xd'))[_0xc176('0xe')](socket);var htmlToText=require(_0xc176('0xf'));var jayson=require(_0xc176('0x10'));var client=jayson[_0xc176('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xc176('0x11')]['http']({'port':0x232a});var client9003=jayson['client'][_0xc176('0x12')]({'port':0x232b});var client9001=jayson[_0xc176('0x11')][_0xc176('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x4266ac,_0x32ac74,_0x9044f9,_0xc6ab06){return new BPromise(function(_0x405363,_0x56392a){var _0x15193d=_0xc6ab06||client;return _0x15193d[_0xc176('0x13')](_0x4266ac,_0x9044f9)[_0xc176('0x14')](function(_0x11164e){logger[_0xc176('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x32ac74,'request\x20sent');logger[_0xc176('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x32ac74,_0xc176('0x17'),JSON['stringify'](_0x11164e));if(_0x11164e[_0xc176('0x18')]){if(_0x11164e['error'][_0xc176('0x19')]===0x1f4){logger[_0xc176('0x18')](_0xc176('0x1a'),_0x32ac74,_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);return _0x56392a(_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);}logger[_0xc176('0x18')](_0xc176('0x1a'),_0x32ac74,_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);return _0x405363(_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);}else{logger[_0xc176('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x32ac74,_0xc176('0x17'));_0x405363(_0x11164e[_0xc176('0x1c')][_0xc176('0x1b')]);}})[_0xc176('0x1d')](function(_0x286c4c){logger[_0xc176('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x32ac74,_0x286c4c);_0x56392a(_0x286c4c);});});}function respondWithStatusCode(_0x52ea38,_0x491a58){_0x491a58=_0x491a58||0xcc;return function(_0x3f6bf4){if(_0x3f6bf4){return _0x52ea38[_0xc176('0x1e')](_0x491a58);}return _0x52ea38[_0xc176('0x1f')](_0x491a58)[_0xc176('0x20')]();};}function respondWithResult(_0x52f409,_0x18523d){_0x18523d=_0x18523d||0xc8;return function(_0x51c014){if(_0x51c014){return _0x52f409[_0xc176('0x1f')](_0x18523d)[_0xc176('0x21')](_0x51c014);}};}function respondWithFilteredResult(_0x547f83,_0x427311){return function(_0x3dfe05){if(_0x3dfe05){var _0xae0e39=typeof _0x427311[_0xc176('0x22')]===_0xc176('0x23')&&typeof _0x427311[_0xc176('0x24')]==='undefined';var _0x4d1349=_0x3dfe05[_0xc176('0x25')];var _0x529c40=_0xae0e39?0x0:_0x427311[_0xc176('0x22')];var _0x1a7b9d=_0xae0e39?_0x3dfe05[_0xc176('0x25')]:_0x427311[_0xc176('0x22')]+_0x427311['limit'];var _0x4a0f92;if(_0x1a7b9d>=_0x4d1349){_0x1a7b9d=_0x4d1349;_0x4a0f92=0xc8;}else{_0x4a0f92=0xce;}_0x547f83['status'](_0x4a0f92);return _0x547f83['set']('Content-Range',_0x529c40+'-'+_0x1a7b9d+'/'+_0x4d1349)[_0xc176('0x21')](_0x3dfe05);}return null;};}function saveUpdates(_0x37e565){return function(_0x4a4df1){if(_0x4a4df1){return _0x4a4df1[_0xc176('0x26')](_0x37e565)[_0xc176('0x14')](function(_0x4443ae){return _0x4443ae;});}return null;};}function removeEntity(_0x3a739c){return function(_0x5ccdb3){if(_0x5ccdb3){return _0x5ccdb3['destroy']()['then'](function(){var _0x4d9dae=_0x5ccdb3[_0xc176('0x27')]({'plain':!![]});var _0x39228a=_0xc176('0x28');return db[_0xc176('0x29')]['destroy']({'where':{'type':_0x39228a,'resourceId':_0x4d9dae['id']}})[_0xc176('0x14')](function(){return _0x5ccdb3;});})[_0xc176('0x14')](function(){_0x3a739c['status'](0xcc)[_0xc176('0x20')]();});}};}function handleEntityNotFound(_0xaecbb0){return function(_0x1272c7){if(!_0x1272c7){_0xaecbb0['sendStatus'](0x194);}return _0x1272c7;};}function handleError(_0x3c9b20,_0xb48e4){_0xb48e4=_0xb48e4||0x1f4;return function(_0x53c223){logger[_0xc176('0x18')](_0x53c223[_0xc176('0x2a')]);if(_0x53c223[_0xc176('0x2b')]){delete _0x53c223[_0xc176('0x2b')];}_0x3c9b20['status'](_0xb48e4)[_0xc176('0x2c')](_0x53c223);};}exports[_0xc176('0x2d')]=function(_0x14473d,_0x103dc4){var _0x1ed99c={'include':[{'model':db[_0xc176('0x2e')],'as':_0xc176('0x2f')}]},_0x39732a={},_0x55bdf2={'count':0x0,'rows':[]};var _0xa30f9e=_[_0xc176('0x30')](db[_0xc176('0x31')][_0xc176('0x32')],function(_0x5b0b51){return{'name':_0x5b0b51[_0xc176('0x33')],'type':_0x5b0b51[_0xc176('0x34')][_0xc176('0x35')]};});_0x39732a[_0xc176('0x36')]=_[_0xc176('0x30')](_0xa30f9e,'name');_0x39732a[_0xc176('0x37')]=_['keys'](_0x14473d['query']);_0x39732a[_0xc176('0x38')]=_['intersection'](_0x39732a['model'],_0x39732a[_0xc176('0x37')]);_0x1ed99c[_0xc176('0x39')]=_['intersection'](_0x39732a[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x14473d[_0xc176('0x37')][_0xc176('0x3a')]));_0x1ed99c[_0xc176('0x39')]=_0x1ed99c[_0xc176('0x39')][_0xc176('0x3b')]?_0x1ed99c[_0xc176('0x39')]:_0x39732a[_0xc176('0x36')];if(!_0x14473d[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x1ed99c[_0xc176('0x24')]=qs['limit'](_0x14473d[_0xc176('0x37')][_0xc176('0x24')]);_0x1ed99c[_0xc176('0x22')]=qs['offset'](_0x14473d['query'][_0xc176('0x22')]);}_0x1ed99c[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x14473d['query'][_0xc176('0x3e')]);_0x1ed99c[_0xc176('0x3f')]=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x14473d[_0xc176('0x37')],_0x39732a['filters']),_0xa30f9e);if(_0x14473d[_0xc176('0x37')][_0xc176('0x41')]){_0x1ed99c[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x1ed99c['where'],{'$or':_[_0xc176('0x30')](_0xa30f9e,function(_0x3e348e){if(_0x3e348e[_0xc176('0x34')]!=='VIRTUAL'){var _0x3e0849={};_0x3e0849[_0x3e348e[_0xc176('0x2b')]]={'$like':'%'+_0x14473d[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x3e0849;}})});}_0x1ed99c=_['merge']({},_0x1ed99c,_0x14473d[_0xc176('0x43')]);var _0x330681={'where':_0x1ed99c[_0xc176('0x3f')]};return db[_0xc176('0x31')][_0xc176('0x25')](_0x330681)['then'](function(_0x53be6b){_0x55bdf2[_0xc176('0x25')]=_0x53be6b;if(_0x14473d[_0xc176('0x37')]['includeAll']){_0x1ed99c[_0xc176('0x44')]=[{'all':!![]}];}return db['ChatWebsite'][_0xc176('0x45')](_0x1ed99c);})[_0xc176('0x14')](function(_0x4a02a6){_0x55bdf2['rows']=_0x4a02a6;return _0x55bdf2;})[_0xc176('0x14')](respondWithFilteredResult(_0x103dc4,_0x1ed99c))[_0xc176('0x1d')](handleError(_0x103dc4,null));};exports[_0xc176('0x46')]=function(_0x5292f7,_0xcfb1ea){var _0x513e2e={'raw':![],'where':{'id':_0x5292f7[_0xc176('0x47')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1f646e={};_0x1f646e['model']=_['keys'](db[_0xc176('0x31')]['rawAttributes']);_0x1f646e[_0xc176('0x37')]=_[_0xc176('0x48')](_0x5292f7[_0xc176('0x37')]);_0x1f646e[_0xc176('0x38')]=_[_0xc176('0x49')](_0x1f646e[_0xc176('0x36')],_0x1f646e['query']);_0x513e2e[_0xc176('0x39')]=_[_0xc176('0x49')](_0x1f646e[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x5292f7[_0xc176('0x37')][_0xc176('0x3a')]));_0x513e2e[_0xc176('0x39')]=_0x513e2e[_0xc176('0x39')][_0xc176('0x3b')]?_0x513e2e['attributes']:_0x1f646e[_0xc176('0x36')];if(_0x5292f7['query'][_0xc176('0x4a')]){_0x513e2e[_0xc176('0x44')]=[{'all':!![]}];}_0x513e2e=_[_0xc176('0x42')]({},_0x513e2e,_0x5292f7[_0xc176('0x43')]);return db[_0xc176('0x31')][_0xc176('0x4b')](_0x513e2e)[_0xc176('0x14')](handleEntityNotFound(_0xcfb1ea,null))[_0xc176('0x14')](respondWithResult(_0xcfb1ea,null))['catch'](handleError(_0xcfb1ea,null));};exports['create']=function(_0x528b07,_0x27ac17){return db[_0xc176('0x31')]['create'](_0x528b07[_0xc176('0x4c')],{})['then'](function(_0x170442){var _0x3b6ea4=_0x528b07[_0xc176('0x4d')][_0xc176('0x27')]({'plain':!![]});if(!_0x3b6ea4)throw new Error(_0xc176('0x4e'));if(_0x3b6ea4[_0xc176('0x4f')]===_0xc176('0x4d')){var _0x4b7092=_0x170442['get']({'plain':!![]});var _0x6cd3ba=_0xc176('0x28');return db['UserProfileSection'][_0xc176('0x4b')]({'where':{'name':_0x6cd3ba,'userProfileId':_0x3b6ea4['userProfileId']},'raw':!![]})['then'](function(_0x24b605){if(_0x24b605&&_0x24b605[_0xc176('0x50')]===0x0){return db[_0xc176('0x29')][_0xc176('0x51')]({'name':_0x4b7092[_0xc176('0x2b')],'resourceId':_0x4b7092['id'],'type':_0x24b605[_0xc176('0x2b')],'sectionId':_0x24b605['id']},{})['then'](function(){return _0x170442;});}else{return _0x170442;}})[_0xc176('0x1d')](function(_0x563541){logger[_0xc176('0x18')](_0xc176('0x52'),_0x563541);throw _0x563541;});}return _0x170442;})[_0xc176('0x14')](respondWithResult(_0x27ac17,0xc9))[_0xc176('0x1d')](handleError(_0x27ac17,null));};exports[_0xc176('0x26')]=function(_0x160bb8,_0x33dd02){if(_0x160bb8[_0xc176('0x4c')]['id']){delete _0x160bb8[_0xc176('0x4c')]['id'];}return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x160bb8['params']['id']},'include':[{'model':db[_0xc176('0x2e')],'as':_0xc176('0x2f')}]})[_0xc176('0x14')](handleEntityNotFound(_0x33dd02,null))['then'](saveUpdates(_0x160bb8[_0xc176('0x4c')],null))['then'](respondWithResult(_0x33dd02,null))[_0xc176('0x1d')](handleError(_0x33dd02,null));};exports['destroy']=function(_0x4f40b9,_0x5d721b){return db['ChatWebsite']['find']({'where':{'id':_0x4f40b9[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d721b,null))['then'](removeEntity(_0x5d721b,null))[_0xc176('0x1d')](handleError(_0x5d721b,null));};exports[_0xc176('0x53')]=function(_0x152139,_0x59f38c){return db[_0xc176('0x31')][_0xc176('0x53')]()[_0xc176('0x14')](respondWithResult(_0x59f38c,null))['catch'](handleError(_0x59f38c,null));};exports[_0xc176('0x54')]=function(_0x397358,_0x23b0df){if(_0x397358['body']['id']){delete _0x397358[_0xc176('0x4c')]['id'];}return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x397358[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x23b0df,null))[_0xc176('0x14')](function(_0x231e1f){if(_0x231e1f){_0x397358['body'][_0xc176('0x55')]=_0x231e1f['id'];return db[_0xc176('0x56')]['create'](_0x397358['body']);}})[_0xc176('0x14')](respondWithResult(_0x23b0df,null))[_0xc176('0x1d')](handleError(_0x23b0df,null));};exports[_0xc176('0x57')]=function(_0x5554b3,_0x5b7f31){var _0x59a405={'raw':![],'where':{}};var _0x35cc6d={};var _0x146aaf={'count':0x0,'rows':[]};return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x5554b3[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x5b7f31,null))[_0xc176('0x14')](function(_0x1f5cf5){if(_0x1f5cf5){_0x35cc6d[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0x56')][_0xc176('0x32')]);_0x35cc6d[_0xc176('0x37')]=_['keys'](_0x5554b3[_0xc176('0x37')]);_0x35cc6d['filters']=_['intersection'](_0x35cc6d[_0xc176('0x36')],_0x35cc6d[_0xc176('0x37')]);_0x59a405[_0xc176('0x39')]=_[_0xc176('0x49')](_0x35cc6d[_0xc176('0x36')],qs['fields'](_0x5554b3[_0xc176('0x37')][_0xc176('0x3a')]));_0x59a405['attributes']=_0x59a405[_0xc176('0x39')]['length']?_0x59a405[_0xc176('0x39')]:_0x35cc6d['model'];if(!_0x5554b3[_0xc176('0x37')][_0xc176('0x3c')](_0xc176('0x59'))){_0x59a405[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x5554b3[_0xc176('0x37')][_0xc176('0x24')]);_0x59a405[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x5554b3[_0xc176('0x37')][_0xc176('0x22')]);}_0x59a405[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x5554b3[_0xc176('0x37')][_0xc176('0x3e')]);_0x59a405[_0xc176('0x3f')]=qs['filters'](_[_0xc176('0x40')](_0x5554b3['query'],_0x35cc6d[_0xc176('0x38')]));_0x59a405[_0xc176('0x3f')][_0xc176('0x55')]=_0x1f5cf5['id'];if(_0x5554b3[_0xc176('0x37')][_0xc176('0x41')]){_0x59a405[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x59a405[_0xc176('0x3f')],{'$or':_[_0xc176('0x30')](_0x59a405['attributes'],function(_0x3c92fd){var _0x24747d={};_0x24747d[_0x3c92fd]={'$like':'%'+_0x5554b3[_0xc176('0x37')]['filter']+'%'};return _0x24747d;})});}_0x59a405=_[_0xc176('0x42')]({},_0x59a405,_0x5554b3[_0xc176('0x43')]);return db['Disposition']['count']({'where':_0x59a405['where']})['then'](function(_0xe59f26){_0x146aaf['count']=_0xe59f26;if(_0x5554b3['query']['includeAll']){_0x59a405[_0xc176('0x44')]=[{'all':!![]}];}return db[_0xc176('0x56')][_0xc176('0x45')](_0x59a405);})[_0xc176('0x14')](function(_0x45682f){_0x146aaf[_0xc176('0x5a')]=_0x45682f;return _0x146aaf;});}})[_0xc176('0x14')](respondWithFilteredResult(_0x5b7f31,_0x59a405))[_0xc176('0x1d')](handleError(_0x5b7f31,null));};exports[_0xc176('0x5b')]=function(_0x5c1f7e,_0xc550c8){return db['ChatWebsite'][_0xc176('0x4b')]({'where':{'id':_0x5c1f7e[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0xc550c8,null))[_0xc176('0x14')](function(_0x4819cc){if(_0x4819cc){return _0x4819cc[_0xc176('0x5b')](_0x5c1f7e['query'][_0xc176('0x5c')]);}})[_0xc176('0x14')](respondWithStatusCode(_0xc550c8,null))['catch'](handleError(_0xc550c8,null));};exports[_0xc176('0x5d')]=function(_0x3bce66,_0x51e7a1){if(_0x3bce66[_0xc176('0x4c')]['id']){delete _0x3bce66['body']['id'];}return db['ChatWebsite'][_0xc176('0x4b')]({'where':{'id':_0x3bce66[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x51e7a1,null))[_0xc176('0x14')](function(_0xf3ac47){if(_0xf3ac47){_0x3bce66[_0xc176('0x4c')]['ChatWebsiteId']=_0xf3ac47['id'];return db[_0xc176('0x5e')][_0xc176('0x51')](_0x3bce66[_0xc176('0x4c')]);}})['then'](respondWithResult(_0x51e7a1,null))[_0xc176('0x1d')](handleError(_0x51e7a1,null));};exports['getAnswers']=function(_0x73877e,_0xec286f){var _0x3993c9={'raw':![],'where':{}};var _0x206cf8={};var _0x4485bf={'count':0x0,'rows':[]};return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x73877e[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0xec286f,null))[_0xc176('0x14')](function(_0x56f492){if(_0x56f492){_0x206cf8['model']=_[_0xc176('0x48')](db['CannedAnswer']['rawAttributes']);_0x206cf8[_0xc176('0x37')]=_[_0xc176('0x48')](_0x73877e[_0xc176('0x37')]);_0x206cf8[_0xc176('0x38')]=_[_0xc176('0x49')](_0x206cf8[_0xc176('0x36')],_0x206cf8['query']);_0x3993c9[_0xc176('0x39')]=_['intersection'](_0x206cf8[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x73877e[_0xc176('0x37')]['fields']));_0x3993c9['attributes']=_0x3993c9[_0xc176('0x39')]['length']?_0x3993c9[_0xc176('0x39')]:_0x206cf8[_0xc176('0x36')];if(!_0x73877e[_0xc176('0x37')][_0xc176('0x3c')](_0xc176('0x59'))){_0x3993c9[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x73877e[_0xc176('0x37')][_0xc176('0x24')]);_0x3993c9['offset']=qs[_0xc176('0x22')](_0x73877e[_0xc176('0x37')]['offset']);}_0x3993c9[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x73877e['query'][_0xc176('0x3e')]);_0x3993c9[_0xc176('0x3f')]=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x73877e[_0xc176('0x37')],_0x206cf8[_0xc176('0x38')]));_0x3993c9[_0xc176('0x3f')][_0xc176('0x55')]=_0x56f492['id'];if(_0x73877e[_0xc176('0x37')][_0xc176('0x41')]){_0x3993c9['where']=_['merge'](_0x3993c9['where'],{'$or':_[_0xc176('0x30')](_0x3993c9[_0xc176('0x39')],function(_0x3cc768){var _0x4368ec={};_0x4368ec[_0x3cc768]={'$like':'%'+_0x73877e[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x4368ec;})});}_0x3993c9=_[_0xc176('0x42')]({},_0x3993c9,_0x73877e[_0xc176('0x43')]);return db[_0xc176('0x5e')]['count']({'where':_0x3993c9[_0xc176('0x3f')]})[_0xc176('0x14')](function(_0x25e314){_0x4485bf[_0xc176('0x25')]=_0x25e314;if(_0x73877e['query'][_0xc176('0x4a')]){_0x3993c9[_0xc176('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc176('0x45')](_0x3993c9);})[_0xc176('0x14')](function(_0xf7b6d){_0x4485bf[_0xc176('0x5a')]=_0xf7b6d;return _0x4485bf;});}})[_0xc176('0x14')](respondWithFilteredResult(_0xec286f,_0x3993c9))['catch'](handleError(_0xec286f,null));};exports['removeAnswers']=function(_0x1fcc4,_0xed64ed){return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x1fcc4[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0xed64ed,null))[_0xc176('0x14')](function(_0x3e0c7f){if(_0x3e0c7f){return _0x3e0c7f[_0xc176('0x5f')](_0x1fcc4[_0xc176('0x37')][_0xc176('0x5c')]);}})[_0xc176('0x14')](respondWithStatusCode(_0xed64ed,null))['catch'](handleError(_0xed64ed,null));};exports['addLogo']=function(_0x38e701,_0x581610){_0x38e701[_0xc176('0x4c')]['sitepic']=_0x38e701['file'][_0xc176('0x60')];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x38e701['params']['id']}})['then'](handleEntityNotFound(_0x581610,null))[_0xc176('0x14')](saveUpdates(_0x38e701[_0xc176('0x4c')],null))[_0xc176('0x14')](respondWithResult(_0x581610,null))[_0xc176('0x1d')](handleError(_0x581610,null));};exports[_0xc176('0x61')]=function(_0x2c82ec,_0x703d61){_0x2c82ec[_0xc176('0x4c')][_0xc176('0x62')]=_0x2c82ec['file']['filename'];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x2c82ec[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x703d61,null))['then'](saveUpdates(_0x2c82ec[_0xc176('0x4c')],null))[_0xc176('0x14')](respondWithResult(_0x703d61,null))['catch'](handleError(_0x703d61,null));};exports[_0xc176('0x63')]=function(_0x40661a,_0x24dc42){_0x40661a['body'][_0xc176('0x64')]=_0x40661a[_0xc176('0x65')][_0xc176('0x60')];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x40661a[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x24dc42,null))[_0xc176('0x14')](saveUpdates(_0x40661a[_0xc176('0x4c')],null))[_0xc176('0x14')](respondWithResult(_0x24dc42,null))[_0xc176('0x1d')](handleError(_0x24dc42,null));};exports[_0xc176('0x66')]=function(_0x35fbc7,_0x19a216){_0x35fbc7[_0xc176('0x4c')][_0xc176('0x67')]=_0x35fbc7[_0xc176('0x65')][_0xc176('0x60')];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x35fbc7[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x19a216,null))[_0xc176('0x14')](saveUpdates(_0x35fbc7['body'],null))[_0xc176('0x14')](respondWithResult(_0x19a216,null))[_0xc176('0x1d')](handleError(_0x19a216,null));};exports[_0xc176('0x68')]=function(_0x2eda37,_0x5ccaee){var _0x5b6f90=path['join'](config[_0xc176('0x69')],_0xc176('0x6a'));var _0x36b134={'where':{'id':_0x2eda37['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x15914e=![];return require(_0xc176('0x6b'))[_0xc176('0x6c')]()[_0xc176('0x14')](function(_0x7f5600){if(_0x7f5600){_0x15914e=_0x7f5600[_0xc176('0x6d')];}})[_0xc176('0x14')](function(){return db[_0xc176('0x31')][_0xc176('0x4b')](_0x36b134);})['then'](handleEntityNotFound(_0x5ccaee,null))[_0xc176('0x14')](function(_0x5e318f){if(_0x5e318f){if(!_[_0xc176('0x6e')](_0x5e318f[_0xc176('0x6f')])){if(fs[_0xc176('0x70')](path[_0xc176('0x71')](config['root'],_0xc176('0x72'),_0x5e318f['sitepic']))&&_0x15914e){_0x5b6f90=path[_0xc176('0x71')](config[_0xc176('0x69')],'server/files/images/logos/',_0x5e318f[_0xc176('0x6f')]);}}return _0x5ccaee[_0xc176('0x73')](_0x5b6f90);}})[_0xc176('0x1d')](handleError(_0x5ccaee,null));};exports['getAvatar']=function(_0x35e4f2,_0x298d2a){var _0x42f1d1=path['join'](config[_0xc176('0x69')],_0xc176('0x74'));var _0x1c371b={'where':{'id':_0x35e4f2[_0xc176('0x47')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xc176('0x31')][_0xc176('0x4b')](_0x1c371b)['then'](handleEntityNotFound(_0x298d2a,null))[_0xc176('0x14')](function(_0x207a31){if(_0x207a31){if(!_[_0xc176('0x6e')](_0x207a31[_0xc176('0x62')])){if(fs[_0xc176('0x70')](path['join'](config[_0xc176('0x69')],_0xc176('0x75'),_0x207a31[_0xc176('0x62')]))){_0x42f1d1=path[_0xc176('0x71')](config[_0xc176('0x69')],_0xc176('0x75'),_0x207a31[_0xc176('0x62')]);}}return _0x298d2a[_0xc176('0x73')](_0x42f1d1);}})[_0xc176('0x1d')](handleError(_0x298d2a,null));};exports[_0xc176('0x76')]=function(_0x13ea68,_0x36d2e3){var _0x527535=path[_0xc176('0x71')](config[_0xc176('0x69')],_0xc176('0x77'));var _0x2e823b={'where':{'id':_0x13ea68['params']['id']},'attributes':['id',_0xc176('0x64'),_0xc176('0x78')],'raw':!![]};return db[_0xc176('0x31')][_0xc176('0x4b')](_0x2e823b)[_0xc176('0x14')](handleEntityNotFound(_0x36d2e3,null))[_0xc176('0x14')](function(_0x324315){if(_0x324315){if(!_['isNil'](_0x324315[_0xc176('0x64')])){if(fs['existsSync'](path['join'](config[_0xc176('0x69')],'server/files/images/avatars/',_0x324315[_0xc176('0x64')]))&&_0x324315['showCustomerAvatar']){_0x527535=path[_0xc176('0x71')](config['root'],_0xc176('0x75'),_0x324315[_0xc176('0x64')]);}}return _0x36d2e3[_0xc176('0x73')](_0x527535);}})[_0xc176('0x1d')](handleError(_0x36d2e3,null));};exports[_0xc176('0x79')]=function(_0x7be092,_0x20455c){var _0x135501=path['join'](config['root'],'server/files/images/avatars/system_avatar.png');var _0x196d86={'where':{'id':_0x7be092[_0xc176('0x47')]['id']},'attributes':['id',_0xc176('0x67')],'raw':!![]};return db[_0xc176('0x31')][_0xc176('0x4b')](_0x196d86)[_0xc176('0x14')](handleEntityNotFound(_0x20455c,null))[_0xc176('0x14')](function(_0x520aaf){if(_0x520aaf){if(!_[_0xc176('0x6e')](_0x520aaf[_0xc176('0x67')])){if(fs['existsSync'](path['join'](config['root'],_0xc176('0x75'),_0x520aaf['systemAvatar']))){_0x135501=path['join'](config[_0xc176('0x69')],'server/files/images/avatars/',_0x520aaf['systemAvatar']);}}return _0x20455c['download'](_0x135501);}})[_0xc176('0x1d')](handleError(_0x20455c,null));};exports[_0xc176('0x7a')]=function(_0x5b8eba,_0x1023af){var _0x45d0a0=require(_0xc176('0x7b'));var _0x8b34e8=new _0x45d0a0();var _0x3cf3f4=_0x8b34e8['setUA'](_0x5b8eba[_0xc176('0x7c')][_0xc176('0x7d')])['getResult']();var _0x5bac57={'body':_0x5b8eba['body'],'channel':_0xc176('0x7e')};var _0x488f1e=[];var _0x409a3e=[];var _0x2b5a01={};var _0x58664d=![];return db[_0xc176('0x7f')][_0xc176('0x53')]()['then'](function(_0xce7f8){if(!_0xce7f8){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x82'));}_0x488f1e=_[_0xc176('0x83')](_[_0xc176('0x48')](_0xce7f8),[_0xc176('0x84'),'updatedAt']);_0x409a3e=_[_0xc176('0x83')](_[_0xc176('0x48')](_0xce7f8),[_0xc176('0x84'),_0xc176('0x85'),'CompanyId',_0xc176('0x86')]);if(_0x5b8eba['body']['id']){delete _0x5b8eba[_0xc176('0x4c')]['id'];}if(_[_0xc176('0x6e')](_0x5b8eba[_0xc176('0x4c')]['from'])){throw new db['Sequelize'][(_0xc176('0x81'))](_0xc176('0x87'));}if(_[_0xc176('0x6e')](_0x5b8eba[_0xc176('0x4c')][_0xc176('0x4c')])||_0x5b8eba[_0xc176('0x4c')][_0xc176('0x4c')]===''){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x88'));}if(_[_0xc176('0x6e')](_0x5b8eba['body'][_0xc176('0x89')])){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x8a')+_0x409a3e);}if(!_[_0xc176('0x8b')](_0x409a3e,_0x5b8eba[_0xc176('0x4c')][_0xc176('0x89')])){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x409a3e);}_0x2b5a01[_0x5b8eba['body'][_0xc176('0x89')]]=_0x5b8eba['body']['from'];})[_0xc176('0x14')](function(){return db['ChatWebsite'][_0xc176('0x4b')]({'where':{'id':_0x5b8eba[_0xc176('0x47')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xc176('0x7f')],'as':_0xc176('0x8c'),'where':_0x2b5a01,'limit':0x1,'order':[[_0xc176('0x85'),_0xc176('0x8d')]]}]},{'model':db[_0xc176('0x8e')],'as':_0xc176('0x8f')}]});})[_0xc176('0x14')](handleEntityNotFound(_0x1023af,null))[_0xc176('0x14')](function(_0x3cf3d2){if(_0x3cf3d2&&_0x3cf3d2[_0xc176('0x90')]){_0x5bac57['account']=_0x3cf3d2;_0x5bac57['applications']=_0x3cf3d2[_0xc176('0x8f')];_0x5bac57[_0xc176('0x91')]=_0x3cf3d2[_0xc176('0x90')];_0x5bac57['applications']=_[_0xc176('0x92')](_0x5bac57['applications'],['priority'],[_0xc176('0x93')]);if(_0x5bac57['account']['Applications']){delete _0x5bac57[_0xc176('0x94')][_0xc176('0x8f')];}if(_0x5bac57[_0xc176('0x94')]['List']&&_0x5bac57[_0xc176('0x94')][_0xc176('0x90')]['Contacts'][_0xc176('0x3b')]){return _0x5bac57[_0xc176('0x94')][_0xc176('0x90')][_0xc176('0x8c')][0x0];}var _0x159718=_[_0xc176('0x95')](_0x5b8eba['body'],{'firstName':_0x5b8eba[_0xc176('0x4c')]['from'],'ListId':_0x3cf3d2[_0xc176('0x86')]});_0x159718[_0x5b8eba[_0xc176('0x4c')]['mapKey']]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0x96')];return db[_0xc176('0x7f')][_0xc176('0x51')](_0x159718,{'fields':_0x488f1e,'raw':!![]});}})[_0xc176('0x14')](handleEntityNotFound(_0x1023af,null))[_0xc176('0x14')](function(_0x4d8caa){_0x5bac57[_0xc176('0x97')]=_0x4d8caa;var _0x11132c=_0x5b8eba[_0xc176('0x4c')][_0xc176('0x98')];if(_0x5b8eba[_0xc176('0x7c')][_0xc176('0x99')]){_0x11132c=_0x5b8eba[_0xc176('0x7c')]['cf-connecting-ip'];}else if(_0x5b8eba['headers'][_0xc176('0x9a')]){_0x11132c=_['first'](_0x5b8eba[_0xc176('0x7c')][_0xc176('0x9a')][_0xc176('0x9b')](','));}if(_0x4d8caa){var _0x2fb464={'ContactId':_0x4d8caa['id'],'ChatWebsiteId':_0x5b8eba['params']['id'],'from':(_0x4d8caa[_0xc176('0x9c')]||'')+'\x20'+(_0x4d8caa[_0xc176('0x9d')]||''),'customerIp':_0x11132c,'customerPort':_0x5b8eba[_0xc176('0x7c')][_0xc176('0x9e')]?_0x5b8eba[_0xc176('0x7c')][_0xc176('0x9e')]:null,'referer':_0x5b8eba[_0xc176('0x4c')][_0xc176('0x9f')],'browserName':_0x3cf3f4[_0xc176('0xa0')][_0xc176('0x2b')]&&_0x3cf3f4[_0xc176('0xa0')]['version']?util['format'](_0xc176('0xa1'),_0x3cf3f4['browser']['name'],_0x3cf3f4[_0xc176('0xa0')][_0xc176('0xa2')]):'unknown','browserVersion':_0x3cf3f4[_0xc176('0xa0')][_0xc176('0xa2')]||_0xc176('0xa3'),'osName':util[_0xc176('0xa4')](_0xc176('0xa1'),_0x3cf3f4['os'][_0xc176('0x2b')],_0x3cf3f4['os'][_0xc176('0xa2')]),'osVersion':_0x3cf3f4['os'][_0xc176('0xa2')],'deviceModel':_0x3cf3f4[_0xc176('0xa5')]['model']&&_0x3cf3f4[_0xc176('0xa5')][_0xc176('0xa6')]?util[_0xc176('0xa4')](_0xc176('0xa7'),_0x3cf3f4[_0xc176('0xa5')][_0xc176('0x36')],_0x3cf3f4['device'][_0xc176('0xa6')],_0x3cf3f4[_0xc176('0xa5')]['type']):null,'deviceVendor':_0x3cf3f4[_0xc176('0xa5')]['vendor'],'deviceType':_0x3cf3f4[_0xc176('0xa5')][_0xc176('0x34')],'formData':JSON['stringify'](_0x5b8eba[_0xc176('0x4c')])};var _0x5354f8={'ChatWebsiteId':_0x5b8eba[_0xc176('0x47')]['id'],'closed':![]};if(_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')]){_0x5354f8[_0xc176('0xa8')]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')];return db[_0xc176('0xa9')][_0xc176('0x4b')]({'where':_0x5354f8})[_0xc176('0x14')](function(_0x301950){if(_0x301950){return[_0x301950,![]];}_0x2fb464[_0xc176('0xa8')]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')];_0x2fb464[_0xc176('0xaa')]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xaa')];return db[_0xc176('0xa9')][_0xc176('0x51')](_0x2fb464)[_0xc176('0x14')](function(_0x3dd10a){return[_0x3dd10a,!![]];});});}_0x5354f8[_0xc176('0xab')]=_0x4d8caa['id'];if(_0x5b8eba[_0xc176('0x4c')][_0xc176('0xac')]&&_0x5b8eba['body'][_0xc176('0xac')]['id']){_0x5354f8['id']=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xac')]['id'];return db[_0xc176('0xa9')][_0xc176('0x4b')]({'where':_0x5354f8})[_0xc176('0x14')](function(_0x114f60){if(_0x114f60){return[_0x114f60,![]];}return db[_0xc176('0xa9')][_0xc176('0x51')](_0x2fb464)['then'](function(_0x5078db){return[_0x5078db,!![]];});});}return db[_0xc176('0xa9')][_0xc176('0x51')](_0x2fb464)[_0xc176('0x14')](function(_0x1feb6b){return[_0x1feb6b,!![]];});}})['spread'](function(_0x77312b,_0xe8a1e6){if(_0x77312b){_0x58664d=_0xe8a1e6;if(!_0xe8a1e6){var _0xe433d4={'from':(_0x5bac57[_0xc176('0x97')][_0xc176('0x9c')]||'')+'\x20'+(_0x5bac57[_0xc176('0x97')][_0xc176('0x9d')]||'')};if(_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')]&&_0x5b8eba['body'][_0xc176('0xad')]&&_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')]!=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xad')]){_0xe433d4[_0xc176('0xa8')]=_0x5b8eba[_0xc176('0x4c')]['messageId'];}return _0x77312b[_0xc176('0x26')](_0xe433d4);}else{return _0x77312b;}}})[_0xc176('0x14')](function(_0x307ea6){_0x5bac57[_0xc176('0xac')]=_0x307ea6[_0xc176('0x27')]({'plain':!![]});_0x5bac57[_0xc176('0xac')][_0xc176('0xae')]=_0x58664d;if(_0x5bac57[_0xc176('0xac')][_0xc176('0xae')]){if(_0x5bac57[_0xc176('0x94')]['autoclose']){_0x5bac57[_0xc176('0xaf')][_0xc176('0xb0')]({'id':0x0,'priority':_0x5bac57[_0xc176('0xaf')]['length']+0x1,'app':_0xc176('0xb1'),'appdata':_0xc176('0xb2'),'interval':_0xc176('0xb3')});}}return db[_0xc176('0xb4')][_0xc176('0x51')]({'body':_0x5b8eba[_0xc176('0x4c')][_0xc176('0x4c')],'ChatWebsiteId':_0x5b8eba[_0xc176('0x47')]['id'],'ChatInteractionId':_0x307ea6['id'],'direction':'in','ContactId':_0x5bac57['contact']['id'],'AttachmentId':_0x5b8eba[_0xc176('0x4c')][_0xc176('0xb5')]});})[_0xc176('0x14')](function(_0x53e07b){_0x5bac57[_0xc176('0x1b')]=_0x53e07b;if(_0x5bac57[_0xc176('0xac')][_0xc176('0xb6')]){return db[_0xc176('0xb7')][_0xc176('0x4b')]({'attributes':['id',_0xc176('0x2b')],'where':{'id':_0x5bac57[_0xc176('0xac')]['UserId']}})[_0xc176('0x14')](function(_0x196abb){if(_0x196abb){_0x5bac57[_0xc176('0xaf')][_0xc176('0xb8')]({'id':0x0,'priority':0x0,'app':_0xc176('0xb9'),'appdata':_0x196abb['name']+','+(_0x5bac57[_0xc176('0x94')][_0xc176('0xba')]||0xa),'interval':_0xc176('0xb3')});_0x5bac57[_0xc176('0xbb')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x5bac57);});}return respondWithRpcPromise('Start',_0xc176('0xbc'),_0x5bac57);})['then'](function(_0x304735){respondWithRpcPromise(_0xc176('0xbd'),_0xc176('0xbd'),{'event':_0xc176('0x7a'),'message':_0x304735},client9002);return _0x304735;})['then'](respondWithResult(_0x1023af,null))[_0xc176('0x1d')](handleError(_0x1023af,null));};exports[_0xc176('0xbe')]=function(_0x12a308,_0x3208d9){var _0x4405d8,_0x29f4ac,_0x2c81ac;var _0x363673=[];var _0xd84481={};var _0x312107=_0x12a308['files']||[];var _0x9a527f=[];var _0x46a574;return db[_0xc176('0x7f')][_0xc176('0x53')]()[_0xc176('0x14')](function(_0x5e8863){if(!_0x5e8863){throw new db['Sequelize'][(_0xc176('0x81'))](_0xc176('0x82'));}_0x363673=_[_0xc176('0x83')](_[_0xc176('0x48')](_0x5e8863),[_0xc176('0x84'),_0xc176('0x85'),_0xc176('0xbf'),'ListId']);if(_0x12a308[_0xc176('0x4c')]['id']){delete _0x12a308['body']['id'];}if(_[_0xc176('0x6e')](_0x12a308[_0xc176('0x4c')][_0xc176('0x96')])){throw _0x3208d9[_0xc176('0x1f')](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x87')));}if(_['isNil'](_0x12a308[_0xc176('0x4c')][_0xc176('0x4c')])||_0x12a308[_0xc176('0x4c')][_0xc176('0x4c')]===''){throw _0x3208d9[_0xc176('0x1f')](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x88')));}if(_['isNil'](_0x12a308['body']['mapKeyOffline'])){throw _0x3208d9['status'](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0xc0')+_0x363673));}if(!_[_0xc176('0x8b')](_0x363673,_0x12a308[_0xc176('0x4c')]['mapKeyOffline'])){throw _0x3208d9['status'](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x363673));}_0xd84481[_0x12a308[_0xc176('0x4c')]['mapKeyOffline']]=_0x12a308['body'][_0xc176('0x96')];})[_0xc176('0x14')](function(){return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x12a308['params']['id']},'include':[{'model':db[_0xc176('0xc1')],'as':_0xc176('0x90')},{'model':db[_0xc176('0xc2')],'as':_0xc176('0xc2')}]});})[_0xc176('0x14')](handleEntityNotFound(_0x3208d9,null))['then'](function(_0xdac1a1){if(_0xdac1a1&&_0xdac1a1['List']){_0x29f4ac=_0xdac1a1;var _0x2be313=_[_0xc176('0x95')](_0x12a308[_0xc176('0x4c')],{'firstName':_0x12a308[_0xc176('0x4c')][_0xc176('0x96')],'phone':_0x12a308[_0xc176('0x4c')][_0xc176('0x96')],'ListId':_0xdac1a1['ListId']});_0x2be313[_0x12a308[_0xc176('0x4c')]['mapKeyOffline']]=_0x12a308[_0xc176('0x4c')]['from'];return db[_0xc176('0x7f')][_0xc176('0xc3')]({'where':_0xd84481,'defaults':_0x2be313});}})[_0xc176('0xc4')](function(_0x311e9f){if(_0x311e9f){_0x2c81ac=_0x311e9f;var _0x5b7b97=fs[_0xc176('0xc5')](path['join'](config[_0xc176('0x69')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x51718e=ejs[_0xc176('0xc6')](_0x5b7b97,{'body':_[_0xc176('0xc7')](_0x12a308[_0xc176('0x4c')]['body']),'bodyTitle':_0x29f4ac[_0xc176('0xc8')]});return db['ChatOfflineMessage']['create']({'body':_0x51718e,'plainBody':htmlToText['fromString'](_0x51718e),'ContactId':_0x311e9f['id'],'ChatWebsiteId':_0x29f4ac['id']});}})[_0xc176('0x14')](function(_0x28b229){_0x46a574=_0x28b229;if(_0x312107[_0xc176('0x3b')]){var _0x259c98=_0x312107[_0xc176('0x30')](function(_0x4ddad9){return{'name':_0x4ddad9[_0xc176('0xc9')],'basename':_0x4ddad9['filename'],'type':_0x4ddad9['mimetype'],'ChatOfflineMessageId':_0x28b229['id']};});_0x9a527f=_0x259c98[_0xc176('0x30')](_0x11276d=>{var _0x5aa8e3={'filename':_0x11276d['name'],'path':path[_0xc176('0x71')](config[_0xc176('0x69')],'server',_0xc176('0xca'),_0xc176('0xcb'),_0xc176('0xcc'),_0x11276d[_0xc176('0xcd')])};return _0x5aa8e3;});if(!_0x29f4ac[_0xc176('0xce')]){return db[_0xc176('0xcf')][_0xc176('0xd0')](function(_0x56a409){return db['Attachment'][_0xc176('0xd1')](_0x259c98,{'transaction':_0x56a409});});}}})['then'](function(){if(_0x46a574){_0x4405d8=_0x46a574;return db[_0xc176('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc176('0xd2')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc176('0xd3')],'as':_0xc176('0xd3'),'raw':!![]}]}]});}})[_0xc176('0x14')](function(_0x1b2857){if(_0x1b2857&&_0x1b2857[_0xc176('0xd4')]&&_0x29f4ac['forwardOffline']&&_0x29f4ac[_0xc176('0xd5')]){var _0x3debd1=_0x1b2857['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xc176('0xd6'),{'account':_0x3debd1,'message':{'from':util['format'](_0xc176('0xd7'),_0x1b2857[_0xc176('0x2b')],_0x1b2857[_0xc176('0xd8')]||_0x1b2857[_0xc176('0xd4')][_0xc176('0x4d')]),'to':_0x29f4ac[_0xc176('0xd5')],'subject':_0x29f4ac[_0xc176('0xd9')],'html':_0x4405d8[_0xc176('0x4c')],'attachments':_0x9a527f}},client9003)['then'](function(){return _0x4405d8;})['catch'](function(_0x34685a){logger[_0xc176('0x18')](_0x34685a);});}})[_0xc176('0x14')](function(){if(_0x29f4ac&&_0x29f4ac[_0xc176('0xce')]&&_0x29f4ac[_0xc176('0xda')]){var _0x2e45a9=[];if(_0x312107['length']){_0x2e45a9=_0x312107[_0xc176('0x30')](function(_0x50a753){return{'name':_0x50a753[_0xc176('0xc9')],'basename':_0x50a753[_0xc176('0x60')],'type':_0x50a753[_0xc176('0xdb')],'ChatOfflineMessageId':_0x46a574['id']};});}var _0x5285c;if(!_[_0xc176('0x6e')](_0x29f4ac[_0xc176('0xdc')])){var _0x1f7ff6=_[_0xc176('0x30')](_0x12a308[_0xc176('0x4c')],function(_0x63eb3d){return _0x63eb3d;});var _0x1afa4a=_['toPairsIn'](_0x1f7ff6)[0x0];var _0x3b5542=_['mapValues'](_0x1afa4a,function(_0x455afb){return _0x455afb;});_0x5285c=_0x3b5542[0x1][_0x29f4ac[_0xc176('0xdc')]];}var _0x3474ec={'from':_0x2c81ac['email'],'firstName':_0x2c81ac[_0xc176('0x9c')],'lastName':_0x2c81ac[_0xc176('0x9d')],'mapKey':_0xc176('0xd8'),'message':{'from':_0x2c81ac[_0xc176('0xd8')],'to':_0x29f4ac['MailAccount'][_0xc176('0xd8')],'cc':'','subject':_['isNil'](_0x5285c)?_0x29f4ac[_0xc176('0xd9')]:_0x5285c,'messageId':'','sentAt':new Date(),'attach':_0x2e45a9[_0xc176('0x3b')],'attachments':_0x2e45a9,'originChannel':_0xc176('0xdd'),'ChatWebsiteId':_0x29f4ac['id'],'ChatOfflineMessageId':_0x4405d8['id'],'originTo':_0x29f4ac[_0xc176('0xc2')][_0xc176('0xd8')]},'body':_0x4405d8['body']};var _0x7b1f60={'account':{'id':_0x29f4ac[_0xc176('0xda')]},'body':_0x3474ec,'log':_0xc176('0xde')};return respondWithRpcPromise(_0xc176('0xde'),_0xc176('0xdf'),_0x7b1f60,client9001)['then'](function(){return _0x4405d8;})[_0xc176('0x1d')](function(_0x747e38){logger['error'](_0x747e38);});}return;})['then'](function(){if(_0x4405d8){return _0x4405d8;}})['then'](respondWithResult(_0x3208d9,null))[_0xc176('0x1d')](function(_0x1ace02){logger[_0xc176('0x18')](_0xc176('0x1d'),_0x1ace02);for(var _0xab20ea of _0x312107){var _0x1f2295=path[_0xc176('0x71')](config[_0xc176('0x69')],_0xc176('0xe0'),'files',_0xc176('0xcb'),_0xc176('0xcc'),_0xab20ea[_0xc176('0x60')]);fs_extra[_0xc176('0xe1')](_0x1f2295)[_0xc176('0x1d')](function(_0x24d3e9){logger[_0xc176('0x18')](_0xc176('0xe2'),_0x1f2295,_0x24d3e9);});}});};exports[_0xc176('0xe3')]=function(_0x136924,_0x42ad0d){return db[_0xc176('0xa9')][_0xc176('0x4b')]({'where':{'id':_0x136924['params']['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x42ad0d,null))[_0xc176('0x14')](function(_0x4acc7f){if(_0x4acc7f){return _0x4acc7f[_0xc176('0xe3')](_0x136924[_0xc176('0x4c')][_0xc176('0x5c')],_['omit'](_0x136924[_0xc176('0x4c')],[_0xc176('0x5c'),'id'])||{});}})[_0xc176('0x14')](respondWithResult(_0x42ad0d,null))[_0xc176('0x1d')](handleError(_0x42ad0d,null));};exports[_0xc176('0xe4')]=function(_0x23d78b,_0x3dbd17){var _0x4f60ea={'raw':![],'where':{}};var _0xe0ac73={};var _0x397f51={'count':0x0,'rows':[]};return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x23d78b['params']['id']}})['then'](handleEntityNotFound(_0x3dbd17,null))[_0xc176('0x14')](function(_0x112e98){if(_0x112e98){_0xe0ac73[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0xa9')][_0xc176('0x32')]);_0xe0ac73[_0xc176('0x37')]=_[_0xc176('0x48')](_0x23d78b[_0xc176('0x37')]);_0xe0ac73[_0xc176('0x38')]=_[_0xc176('0x49')](_0xe0ac73[_0xc176('0x36')],_0xe0ac73['query']);_0x4f60ea[_0xc176('0x39')]=_[_0xc176('0x49')](_0xe0ac73['model'],qs[_0xc176('0x3a')](_0x23d78b[_0xc176('0x37')][_0xc176('0x3a')]));_0x4f60ea[_0xc176('0x39')]=_0x4f60ea[_0xc176('0x39')][_0xc176('0x3b')]?_0x4f60ea[_0xc176('0x39')]:_0xe0ac73[_0xc176('0x36')];if(!_0x23d78b[_0xc176('0x37')][_0xc176('0x3c')](_0xc176('0x59'))){_0x4f60ea[_0xc176('0x24')]=qs['limit'](_0x23d78b[_0xc176('0x37')][_0xc176('0x24')]);_0x4f60ea['offset']=qs[_0xc176('0x22')](_0x23d78b['query'][_0xc176('0x22')]);}_0x4f60ea[_0xc176('0x3d')]=qs['sort'](_0x23d78b['query']['sort']);_0x4f60ea[_0xc176('0x3f')]=qs['filters'](_[_0xc176('0x40')](_0x23d78b['query'],_0xe0ac73[_0xc176('0x38')]));_0x4f60ea[_0xc176('0x3f')][_0xc176('0x55')]=_0x112e98['id'];if(_0x23d78b[_0xc176('0x37')][_0xc176('0x41')]){_0x4f60ea[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x4f60ea[_0xc176('0x3f')],{'$or':_['map'](_0x4f60ea[_0xc176('0x39')],function(_0x5b0f3b){var _0x4fd3c4={};_0x4fd3c4[_0x5b0f3b]={'$like':'%'+_0x23d78b['query'][_0xc176('0x41')]+'%'};return _0x4fd3c4;})});}_0x4f60ea=_[_0xc176('0x42')]({},_0x4f60ea,_0x23d78b['options']);return db[_0xc176('0xa9')][_0xc176('0x25')]({'where':_0x4f60ea[_0xc176('0x3f')]})['then'](function(_0x140c16){_0x397f51[_0xc176('0x25')]=_0x140c16;if(_0x23d78b['query'][_0xc176('0x4a')]){_0x4f60ea[_0xc176('0x44')]=[{'model':db[_0xc176('0x7f')],'as':_0xc176('0xe5'),'required':![]},{'model':db[_0xc176('0xb7')],'as':_0xc176('0xe6'),'attributes':['name',_0xc176('0xe7'),_0xc176('0xe8')],'required':![]},{'model':db[_0xc176('0xe9')],'as':_0xc176('0xea'),'attributes':['id',_0xc176('0x2b'),_0xc176('0xeb')],'where':_0x23d78b[_0xc176('0x37')][_0xc176('0xec')]?{'id':_0x23d78b['query'][_0xc176('0xec')]}:undefined,'required':_0x23d78b['query'][_0xc176('0xec')]?!![]:![]}];}return db[_0xc176('0xa9')][_0xc176('0x45')](_0x4f60ea);})['then'](function(_0x5001bc){_0x397f51['rows']=_0x5001bc;return _0x397f51;});}})[_0xc176('0x14')](respondWithFilteredResult(_0x3dbd17,_0x4f60ea))['catch'](handleError(_0x3dbd17,null));};function iftimePromise(_0xa63d8c,_0xa688ab){return respondWithRpcPromise('Command',_0xc176('0xed'),{'command':_0xa688ab[_0xc176('0xee')]?util[_0xc176('0xa4')](_0xc176('0xef'),_0xa63d8c[_0xc176('0xf0')],_0xa688ab['timezone']):util[_0xc176('0xa4')](_0xc176('0xf1'),_0xa63d8c[_0xc176('0xf0')])},client9002)['then'](function(_0x5b597b){var _0x41a2c1=_0x5b597b&&_0x5b597b['indexOf'](_0xc176('0xf2'))>=0x0?!![]:![];logger[_0xc176('0x15')](_0xc176('0xf3'),_0xa688ab['id'],_0xa63d8c['id'],_0xa63d8c['interval'],_0x41a2c1?_0xc176('0xf4'):_0xc176('0xf5'),_0xa688ab[_0xc176('0xee')]?_0xa688ab[_0xc176('0xee')]:_0xc176('0xf6'));return _0x41a2c1;})[_0xc176('0x1d')](function(_0x5c6920){logger[_0xc176('0x18')](_0xc176('0xf3'),_0xa688ab['id'],_0xa63d8c['id'],_0xa63d8c['interval'],util[_0xc176('0xf7')](_0x5c6920,{'showHidden':![],'depth':null}),_0xa688ab[_0xc176('0xee')]?_0xa688ab['timezone']:_0xc176('0xf6'));return![];});}exports[_0xc176('0xed')]=function(_0x3cb3d5,_0x30534c){var _0x5d85a6=0x0;var _0x55c610=0x0;var _0xc0463b=![];var _0x18da2b;var _0x3a622a;return db['ChatWebsite']['find']({'where':{'id':_0x3cb3d5[_0xc176('0x47')]['id']},'include':[{'model':db[_0xc176('0xf8')],'as':_0xc176('0xf8'),'include':[{'model':db[_0xc176('0xf8')],'as':_0xc176('0xf9'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x30534c,null))[_0xc176('0x14')](function(_0x1b5ab9){if(_0x1b5ab9){_0x18da2b=_0x1b5ab9;return _0x1b5ab9[_0xc176('0xfa')]({'raw':!![]});}})[_0xc176('0x14')](function(_0x4fa164){if(_0x18da2b){if(_0x4fa164){_0x3a622a=_0x4fa164;}}return require(_0xc176('0x6b'))[_0xc176('0x6c')]();})[_0xc176('0x14')](function(_0x48c800){if(_0x48c800){_0x55c610=_0x48c800['virtual'];_0xc0463b=_0x48c800['custom'];}})[_0xc176('0x14')](function(){return db['ChatInteraction'][_0xc176('0x25')]({'where':{'closed':![]}});})['then'](function(_0x4ee060){_0x5d85a6=_0x4ee060;if(_0x55c610&&_0x4ee060>_0x55c610){return db['License'][_0xc176('0x58')]({'where':{'id':0x1}})[_0xc176('0x14')](function(_0x4435e7){if(_0x4435e7){_0x4435e7[_0xc176('0xfb')](_0xc176('0xfc'));}});}})[_0xc176('0x14')](function(){if(_0x18da2b['Interval']&&_0x18da2b[_0xc176('0xf8')]['Intervals']){var _0x687223=[];for(var _0x33bd67=0x0;_0x33bd67<_0x18da2b[_0xc176('0xf8')][_0xc176('0xf9')][_0xc176('0x3b')];_0x33bd67++){var _0x2cc243=_0x18da2b[_0xc176('0xf8')][_0xc176('0xf9')][_0x33bd67][_0xc176('0x27')]({'plain':!![]});_0x687223['push'](iftimePromise(_0x2cc243,_0x18da2b));}return BPromise[_0xc176('0xfd')](_0x687223)[_0xc176('0x14')](function(_0x104b8a){return _[_0xc176('0xfe')](_0x104b8a);});}else{return!![];}})[_0xc176('0x14')](function(_0x15f9d9){var _0x261f89=fs['readFileSync'](path[_0xc176('0x71')](config[_0xc176('0x69')],'server/files/chat/iframe.ejs'),_0xc176('0xff'));var _0x4d7dcd=new url[(_0xc176('0x100'))](_0x18da2b['address'])[_0xc176('0x101')];var _0x87d09d=_0xc176('0x102');var _0x3abb15=![];var _0x136a38={'chatVersion':_0x87d09d,'chatWebsiteAddressOrigin':_0x4d7dcd,'remote':_0x18da2b[_0xc176('0x103')],'query':querystring['stringify'](_[_0xc176('0x42')](_0x18da2b[_0xc176('0x27')]({'plain':!![]}),{'customerIp':_0x3cb3d5[_0xc176('0x7c')]['x-forwarded-for']||_0x3cb3d5[_0xc176('0x7c')][_0xc176('0x104')]||_0x3cb3d5[_0xc176('0x105')]['remoteAddress']||_0x3cb3d5['ip'],'referer':_0x3cb3d5[_0xc176('0x7c')][_0xc176('0x9f')],'openedInteractions':_0x5d85a6,'maxInteractions':_0x55c610,'virtual':_0xc0463b[_0xc176('0x106')],'online':_0x15f9d9,'custom':_0xc0463b}))[_0xc176('0x107')](/'/g,'\x5c\x27')};_0x30534c[_0xc176('0x2c')](ejs['render'](Mustache['render'](_0x261f89,_0x136a38),{'proactiveActions':_0x3a622a,'alignment':_0x18da2b[_0xc176('0x108')],'verticalAlignment':_0x18da2b[_0xc176('0x109')],'div_color':_0x18da2b[_0xc176('0xeb')],'labelText':_0x18da2b[_0xc176('0x10a')],'text_color':_0x18da2b[_0xc176('0x10b')],'text_button_color':_0x18da2b[_0xc176('0x10c')],'button_color':_0x18da2b[_0xc176('0x10d')],'background_color':_0x18da2b[_0xc176('0x10e')],'hideWhenOffline':_0x18da2b[_0xc176('0x10f')],'intervalId':_0x18da2b[_0xc176('0x110')],'isDevelopment':_0x3abb15,'chatVersion':_0x87d09d}));})[_0xc176('0x1d')](handleError(_0x30534c,null));};exports[_0xc176('0x111')]=function(_0x33b9c0,_0x5be755){var _0x2f2044=_0x33b9c0['params']['id'];var _0x3c50b5=_0x33b9c0['body'];var _0x1ce584=0xc8;var _0x24dd17=null;return db[_0xc176('0xcf')]['transaction']({'isolationLevel':db[_0xc176('0xcf')][_0xc176('0x112')][_0xc176('0x113')][_0xc176('0x114')]},function(_0x505d45){return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x2f2044},'transaction':_0x505d45})[_0xc176('0x14')](function(_0xb2157b){if(_0xb2157b){return db[_0xc176('0x8e')][_0xc176('0x115')]({'where':{'ChatWebsiteId':_0x2f2044},'transaction':_0x505d45})[_0xc176('0x14')](function(){var _0x17e089=_['map'](_0x3c50b5,function(_0x11c0b4){_0x11c0b4[_0xc176('0x55')]=_0x2f2044;return _0x11c0b4;});return db[_0xc176('0x8e')]['bulkCreate'](_0x17e089,{'transaction':_0x505d45});});}else{_0x1ce584=0x194;_0x24dd17=[];}});})[_0xc176('0x14')](function(){if(_0x1ce584!==0x194){return db[_0xc176('0x8e')][_0xc176('0x116')]({'where':{'ChatWebsiteId':_0x2f2044},'order':_0xc176('0x117')})[_0xc176('0x14')](function(_0x47990f){_0x24dd17=_0x47990f;});}})[_0xc176('0x1d')](function(_0x5624d2){_0x1ce584=0x1f4;logger[_0xc176('0x18')](_0x5624d2[_0xc176('0x2a')]);if(_0x5624d2[_0xc176('0x2b')]){delete _0x5624d2[_0xc176('0x2b')];}_0x24dd17=_0x5624d2;})[_0xc176('0x118')](function(){if(_0x24dd17===null){_0x5be755[_0xc176('0x1e')](_0x1ce584);}else{if(_0x1ce584===0x1f4){_0x5be755[_0xc176('0x1f')](_0x1ce584)[_0xc176('0x2c')](_0x24dd17);}else{_0x5be755[_0xc176('0x1f')](_0x1ce584)[_0xc176('0x21')](_0x24dd17);}}});};exports['getApplications']=function(_0x35ca0c,_0x3fe310){var _0x53d3da={};var _0x11ac6f={};var _0x52c9bd;var _0x6e00f1;return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x35ca0c['params']['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x3fe310,null))[_0xc176('0x14')](function(_0x5776fd){if(_0x5776fd){_0x52c9bd=_0x5776fd;_0x11ac6f[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0x8e')][_0xc176('0x32')]);_0x11ac6f['query']=_[_0xc176('0x48')](_0x35ca0c[_0xc176('0x37')]);_0x11ac6f[_0xc176('0x38')]=_[_0xc176('0x49')](_0x11ac6f['model'],_0x11ac6f[_0xc176('0x37')]);_0x53d3da[_0xc176('0x39')]=_[_0xc176('0x49')](_0x11ac6f[_0xc176('0x36')],qs['fields'](_0x35ca0c['query'][_0xc176('0x3a')]));_0x53d3da['attributes']=_0x53d3da[_0xc176('0x39')][_0xc176('0x3b')]?_0x53d3da['attributes']:_0x11ac6f[_0xc176('0x36')];_0x53d3da[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x35ca0c['query'][_0xc176('0x3e')]);_0x53d3da['where']=qs[_0xc176('0x38')](_['pick'](_0x35ca0c[_0xc176('0x37')],_0x11ac6f[_0xc176('0x38')]));if(_0x35ca0c[_0xc176('0x37')][_0xc176('0x41')]){_0x53d3da[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x53d3da[_0xc176('0x3f')],{'$or':_[_0xc176('0x30')](_0x53d3da['attributes'],function(_0x1596f8){var _0x519a04={};_0x519a04[_0x1596f8]={'$like':'%'+_0x35ca0c[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x519a04;})});}_0x53d3da=_['merge']({},_0x53d3da,_0x35ca0c[_0xc176('0x43')]);return _0x52c9bd[_0xc176('0x119')](_0x53d3da);}})[_0xc176('0x14')](function(_0x5214ca){if(_0x5214ca){_0x6e00f1=_0x5214ca[_0xc176('0x3b')];if(!_0x35ca0c[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x53d3da[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x35ca0c[_0xc176('0x37')][_0xc176('0x24')]);_0x53d3da[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x35ca0c[_0xc176('0x37')][_0xc176('0x22')]);}return _0x52c9bd[_0xc176('0x119')](_0x53d3da);}})[_0xc176('0x14')](function(_0x4b5c1d){if(_0x4b5c1d){return _0x4b5c1d?{'count':_0x6e00f1,'rows':_0x4b5c1d}:null;}})[_0xc176('0x14')](respondWithResult(_0x3fe310,null))['catch'](handleError(_0x3fe310,null));};exports[_0xc176('0x11a')]=function(_0x5f17b9,_0x402fac){return db['chatProactiveAction'][_0xc176('0x4b')]({'where':{'id':_0x5f17b9[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x402fac,null))[_0xc176('0x14')](function(_0x1244a4){if(_0x1244a4){return _0x1244a4[_0xc176('0x11a')](_0x5f17b9[_0xc176('0x4c')][_0xc176('0x5c')],_[_0xc176('0x11b')](_0x5f17b9[_0xc176('0x4c')],[_0xc176('0x5c'),'id'])||{});}})[_0xc176('0x14')](respondWithResult(_0x402fac,null))['catch'](handleError(_0x402fac,null));};exports['getProactiveActions']=function(_0x38885c,_0x3f5535){var _0x69614a={};var _0x3aa269={};var _0x168cb4;var _0x277cd2;return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x38885c[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f5535,null))['then'](function(_0x26a0c6){if(_0x26a0c6){_0x168cb4=_0x26a0c6;_0x3aa269[_0xc176('0x36')]=_['keys'](db[_0xc176('0x11c')][_0xc176('0x32')]);_0x3aa269[_0xc176('0x37')]=_['keys'](_0x38885c[_0xc176('0x37')]);_0x3aa269[_0xc176('0x38')]=_['intersection'](_0x3aa269[_0xc176('0x36')],_0x3aa269[_0xc176('0x37')]);_0x69614a[_0xc176('0x39')]=_[_0xc176('0x49')](_0x3aa269['model'],qs['fields'](_0x38885c['query'][_0xc176('0x3a')]));_0x69614a['attributes']=_0x69614a[_0xc176('0x39')][_0xc176('0x3b')]?_0x69614a[_0xc176('0x39')]:_0x3aa269[_0xc176('0x36')];_0x69614a['order']=qs[_0xc176('0x3e')](_0x38885c[_0xc176('0x37')][_0xc176('0x3e')]);_0x69614a[_0xc176('0x3f')]=qs['filters'](_[_0xc176('0x40')](_0x38885c[_0xc176('0x37')],_0x3aa269[_0xc176('0x38')]));if(_0x38885c[_0xc176('0x37')][_0xc176('0x41')]){_0x69614a['where']=_[_0xc176('0x42')](_0x69614a[_0xc176('0x3f')],{'$or':_[_0xc176('0x30')](_0x69614a[_0xc176('0x39')],function(_0xea3c6){var _0x2f95b4={};_0x2f95b4[_0xea3c6]={'$like':'%'+_0x38885c[_0xc176('0x37')]['filter']+'%'};return _0x2f95b4;})});}_0x69614a=_[_0xc176('0x42')]({},_0x69614a,_0x38885c[_0xc176('0x43')]);return _0x168cb4[_0xc176('0xfa')](_0x69614a);}})[_0xc176('0x14')](function(_0xa31cb2){if(_0xa31cb2){_0x277cd2=_0xa31cb2['length'];if(!_0x38885c[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x69614a['limit']=qs[_0xc176('0x24')](_0x38885c[_0xc176('0x37')][_0xc176('0x24')]);_0x69614a[_0xc176('0x22')]=qs['offset'](_0x38885c[_0xc176('0x37')]['offset']);}return _0x168cb4[_0xc176('0xfa')](_0x69614a);}})[_0xc176('0x14')](function(_0x3638c8){if(_0x3638c8){return _0x3638c8?{'count':_0x277cd2,'rows':_0x3638c8}:null;}})['then'](respondWithResult(_0x3f5535,null))[_0xc176('0x1d')](handleError(_0x3f5535,null));};exports[_0xc176('0x11d')]=function(_0x42a3af,_0x18831f){var _0x309007=_0x42a3af[_0xc176('0x37')][_0xc176('0x11e')]===_0xc176('0x11f')?_0xc176('0x120'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x309007],'where':{'id':_0x42a3af[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x18831f,null))[_0xc176('0x14')](function(_0x43ce5b){if(_0x43ce5b){var _0x37f4b3=_0x43ce5b[_0x309007];var _0x6e7346=_0x37f4b3&&_0x37f4b3['items']?_0x37f4b3[_0xc176('0x121')]:[];_0x18831f[_0xc176('0x2c')]({'fromKey':_[_0xc176('0x6e')](_0x37f4b3[_0xc176('0x122')])?undefined:_0x37f4b3[_0xc176('0x122')],'count':_0x6e7346[_0xc176('0x3b')],'rows':_0x6e7346});}})[_0xc176('0x1d')](handleError(_0x18831f,null));};exports[_0xc176('0x123')]=function(_0x1d1d3b,_0x1f464b){var _0x52d435={'raw':![],'where':{}};var _0x160279={};var _0x51c7c4={'count':0x0,'rows':[]};return db[_0xc176('0x31')]['findOne']({'where':{'id':_0x1d1d3b[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f464b,null))[_0xc176('0x14')](function(_0x1dae1d){if(_0x1dae1d){_0x160279['model']=_['keys'](db[_0xc176('0x124')]['rawAttributes']);_0x160279['query']=_['keys'](_0x1d1d3b['query']);_0x160279[_0xc176('0x38')]=_[_0xc176('0x49')](_0x160279['model'],_0x160279[_0xc176('0x37')]);_0x52d435[_0xc176('0x39')]=_['intersection'](_0x160279[_0xc176('0x36')],qs['fields'](_0x1d1d3b[_0xc176('0x37')][_0xc176('0x3a')]));_0x52d435[_0xc176('0x39')]=_0x52d435[_0xc176('0x39')][_0xc176('0x3b')]?_0x52d435[_0xc176('0x39')]:_0x160279['model'];if(!_0x1d1d3b[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x52d435[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x1d1d3b['query'][_0xc176('0x24')]);_0x52d435[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x1d1d3b['query'][_0xc176('0x22')]);}_0x52d435[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x1d1d3b[_0xc176('0x37')]['sort']);_0x52d435[_0xc176('0x3f')]=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x1d1d3b['query'],_0x160279[_0xc176('0x38')]));_0x52d435['where']['ChatWebsiteId']=_0x1dae1d['id'];if(_0x1d1d3b['query'][_0xc176('0x41')]){_0x52d435[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x52d435[_0xc176('0x3f')],{'$or':_['map'](_0x52d435[_0xc176('0x39')],function(_0x4fabbc){var _0x8f8164={};_0x8f8164[_0x4fabbc]={'$like':'%'+_0x1d1d3b[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x8f8164;})});}_0x52d435=_[_0xc176('0x42')]({},_0x52d435,_0x1d1d3b[_0xc176('0x43')]);return db[_0xc176('0x124')][_0xc176('0x25')]({'where':_0x52d435[_0xc176('0x3f')]})[_0xc176('0x14')](function(_0x17d03e){_0x51c7c4['count']=_0x17d03e;if(_0x1d1d3b['query'][_0xc176('0x4a')]){_0x52d435[_0xc176('0x44')]=[{'all':!![]}];}else{_0x52d435['include']=[{'model':db[_0xc176('0x7f')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xc176('0x124')]['findAll'](_0x52d435);})[_0xc176('0x14')](function(_0x8d5a1f){_0x51c7c4[_0xc176('0x5a')]=_0x8d5a1f;return _0x51c7c4;});}})[_0xc176('0x14')](respondWithFilteredResult(_0x1f464b,_0x52d435))['catch'](handleError(_0x1f464b,null));};exports[_0xc176('0x125')]=function(_0x52a6fe,_0x478ac1){return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x52a6fe[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x478ac1,null))[_0xc176('0x14')](function(_0x204ddc){if(_0x204ddc){return _0x204ddc[_0xc176('0x125')](_0x52a6fe['body'][_0xc176('0x5c')],_['omit'](_0x52a6fe[_0xc176('0x4c')],[_0xc176('0x5c'),'id'])||{})[_0xc176('0xc4')](function(_0x5106fb){for(var _0x5d4dfa=0x0;_0x5d4dfa<_0x52a6fe['body']['ids'][_0xc176('0x3b')];_0x5d4dfa+=0x1){socket[_0xc176('0x126')](_0xc176('0x127'),{'UserId':Number(_0x52a6fe[_0xc176('0x4c')][_0xc176('0x5c')][_0x5d4dfa]),'ChatWebsiteId':Number(_0x52a6fe[_0xc176('0x47')]['id'])});}return _0x5106fb;});}})[_0xc176('0x14')](respondWithResult(_0x478ac1,null))['catch'](handleError(_0x478ac1,null));};exports[_0xc176('0x128')]=function(_0x31a4ce,_0xc3fbca){return db[_0xc176('0x31')]['find']({'where':{'id':_0x31a4ce[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0xc3fbca,null))['then'](function(_0x2b0f02){if(_0x2b0f02){return _0x2b0f02['removeAgents'](_0x31a4ce['query']['ids'])[_0xc176('0x14')](function(){if(_['isArray'](_0x31a4ce[_0xc176('0x37')][_0xc176('0x5c')])){for(var _0x586e6f=0x0;_0x586e6f<_0x31a4ce[_0xc176('0x37')][_0xc176('0x5c')][_0xc176('0x3b')];_0x586e6f+=0x1){socket[_0xc176('0x126')](_0xc176('0x129'),{'UserId':Number(_0x31a4ce['query'][_0xc176('0x5c')][_0x586e6f]),'ChatWebsiteId':Number(_0x31a4ce[_0xc176('0x47')]['id'])});}}else{socket[_0xc176('0x126')](_0xc176('0x129'),{'UserId':Number(_0x31a4ce['query'][_0xc176('0x5c')]),'ChatWebsiteId':Number(_0x31a4ce[_0xc176('0x47')]['id'])});}});}})[_0xc176('0x14')](respondWithStatusCode(_0xc3fbca,null))[_0xc176('0x1d')](handleError(_0xc3fbca,null));};exports[_0xc176('0x12a')]=function(_0x598ad9,_0x51e939){var _0xcb47f9={};var _0x1048eb={};var _0x46238d;var _0x96b9e4;return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x598ad9['params']['id']}})['then'](handleEntityNotFound(_0x51e939,null))[_0xc176('0x14')](function(_0xed25c7){if(_0xed25c7){_0x46238d=_0xed25c7;_0x1048eb[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0xb7')][_0xc176('0x32')]);_0x1048eb[_0xc176('0x37')]=_[_0xc176('0x48')](_0x598ad9[_0xc176('0x37')]);_0x1048eb[_0xc176('0x38')]=_[_0xc176('0x49')](_0x1048eb[_0xc176('0x36')],_0x1048eb[_0xc176('0x37')]);_0xcb47f9['attributes']=_['intersection'](_0x1048eb[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x598ad9['query'][_0xc176('0x3a')]));_0xcb47f9['attributes']=_0xcb47f9[_0xc176('0x39')][_0xc176('0x3b')]?_0xcb47f9[_0xc176('0x39')]:_0x1048eb[_0xc176('0x36')];_0xcb47f9[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x598ad9[_0xc176('0x37')]['sort']);_0xcb47f9['where']=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x598ad9[_0xc176('0x37')],_0x1048eb[_0xc176('0x38')]));if(_0x598ad9[_0xc176('0x37')]['filter']){_0xcb47f9[_0xc176('0x3f')]=_[_0xc176('0x42')](_0xcb47f9['where'],{'$or':_[_0xc176('0x30')](_0xcb47f9[_0xc176('0x39')],function(_0x23f329){var _0x2ab59b={};_0x2ab59b[_0x23f329]={'$like':'%'+_0x598ad9['query'][_0xc176('0x41')]+'%'};return _0x2ab59b;})});}_0xcb47f9=_['merge']({},_0xcb47f9,_0x598ad9[_0xc176('0x43')]);return _0x46238d[_0xc176('0x12a')](_0xcb47f9);}})['then'](function(_0x8a617d){if(_0x8a617d){_0x96b9e4=_0x8a617d[_0xc176('0x3b')];if(!_0x598ad9['query'][_0xc176('0x3c')](_0xc176('0x59'))){_0xcb47f9[_0xc176('0x24')]=qs['limit'](_0x598ad9[_0xc176('0x37')][_0xc176('0x24')]);_0xcb47f9[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x598ad9[_0xc176('0x37')]['offset']);}return _0x46238d[_0xc176('0x12a')](_0xcb47f9);}})[_0xc176('0x14')](function(_0x2553fc){if(_0x2553fc){return _0x2553fc?{'count':_0x96b9e4,'rows':_0x2553fc}:null;}})[_0xc176('0x14')](respondWithResult(_0x51e939,null))[_0xc176('0x1d')](handleError(_0x51e939,null));};
\ No newline at end of file
+var _0x2552=['../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','status','end','json','undefined','count','limit','Content-Range','update','ChatWebsites','UserProfileResource','destroy','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','findAll','catch','params','keys','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','includeAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','isNil','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','applications','Applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','firstName','Chat','NotifyMailAccount','notifyMail','server','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','ONLINE','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','custom','License','push','all','some','server/files/chat/iframe.ejs','utf8','3.1.0','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','color','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','bulkCreate','stack','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','mustache','util','path','ejs','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url'];(function(_0xd6ea2c,_0x3a4393){var _0x3eac91=function(_0x5d4fb9){while(--_0x5d4fb9){_0xd6ea2c['push'](_0xd6ea2c['shift']());}};_0x3eac91(++_0x3a4393);}(_0x2552,0x121));var _0x2255=function(_0xe290f9,_0x2ded4f){_0xe290f9=_0xe290f9-0x0;var _0x5d1402=_0x2552[_0xe290f9];return _0x5d1402;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x2255('0x0'));var util=require(_0x2255('0x1'));var path=require(_0x2255('0x2'));var ejs=require(_0x2255('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require('querystring');var Redis=require(_0x2255('0x4'));var qs=require(_0x2255('0x5'));var logger=require(_0x2255('0x6'))('api');var config=require(_0x2255('0x7'));var url=require(_0x2255('0x8'));var db=require(_0x2255('0x9'))['db'];config[_0x2255('0xa')]=_[_0x2255('0xb')](config[_0x2255('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2255('0xc'))(new Redis(config[_0x2255('0xa')]));require(_0x2255('0xd'))[_0x2255('0xe')](socket);var htmlToText=require(_0x2255('0xf'));var jayson=require('jayson/promise');var client=jayson[_0x2255('0x10')]['http']({'port':0x232c});var client9002=jayson['client'][_0x2255('0x11')]({'port':0x232a});var client9003=jayson[_0x2255('0x10')][_0x2255('0x11')]({'port':0x232b});var client9001=jayson[_0x2255('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4cfe10,_0x147879,_0x1304e6,_0x5f2bb9){return new BPromise(function(_0x35af56,_0x53ee77){var _0x2755b2=_0x5f2bb9||client;return _0x2755b2[_0x2255('0x12')](_0x4cfe10,_0x1304e6)[_0x2255('0x13')](function(_0x40a477){logger[_0x2255('0x14')](_0x2255('0x15'),_0x147879,_0x2255('0x16'));logger['debug'](_0x2255('0x17'),_0x147879,_0x2255('0x16'),JSON['stringify'](_0x40a477));if(_0x40a477['error']){if(_0x40a477['error']['code']===0x1f4){logger[_0x2255('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x147879,_0x40a477['error']['message']);return _0x53ee77(_0x40a477[_0x2255('0x18')][_0x2255('0x19')]);}logger['error'](_0x2255('0x15'),_0x147879,_0x40a477[_0x2255('0x18')][_0x2255('0x19')]);return _0x35af56(_0x40a477[_0x2255('0x18')][_0x2255('0x19')]);}else{logger[_0x2255('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x147879,_0x2255('0x16'));_0x35af56(_0x40a477[_0x2255('0x1a')][_0x2255('0x19')]);}})['catch'](function(_0x309c9f){logger[_0x2255('0x18')](_0x2255('0x15'),_0x147879,_0x309c9f);_0x53ee77(_0x309c9f);});});}function respondWithStatusCode(_0xfc8c0,_0x135772){_0x135772=_0x135772||0xcc;return function(_0x5ca2d4){if(_0x5ca2d4){return _0xfc8c0['sendStatus'](_0x135772);}return _0xfc8c0[_0x2255('0x1b')](_0x135772)[_0x2255('0x1c')]();};}function respondWithResult(_0x58aa88,_0x44f226){_0x44f226=_0x44f226||0xc8;return function(_0x4a7168){if(_0x4a7168){return _0x58aa88[_0x2255('0x1b')](_0x44f226)[_0x2255('0x1d')](_0x4a7168);}};}function respondWithFilteredResult(_0x372f85,_0x112c2d){return function(_0x52647e){if(_0x52647e){var _0x556a67=typeof _0x112c2d['offset']===_0x2255('0x1e')&&typeof _0x112c2d['limit']===_0x2255('0x1e');var _0x22db29=_0x52647e[_0x2255('0x1f')];var _0x15f48d=_0x556a67?0x0:_0x112c2d['offset'];var _0xd3229d=_0x556a67?_0x52647e[_0x2255('0x1f')]:_0x112c2d['offset']+_0x112c2d[_0x2255('0x20')];var _0xf4529d;if(_0xd3229d>=_0x22db29){_0xd3229d=_0x22db29;_0xf4529d=0xc8;}else{_0xf4529d=0xce;}_0x372f85[_0x2255('0x1b')](_0xf4529d);return _0x372f85['set'](_0x2255('0x21'),_0x15f48d+'-'+_0xd3229d+'/'+_0x22db29)['json'](_0x52647e);}return null;};}function saveUpdates(_0x23bc13){return function(_0x1817a9){if(_0x1817a9){return _0x1817a9[_0x2255('0x22')](_0x23bc13)[_0x2255('0x13')](function(_0x54768c){return _0x54768c;});}return null;};}function removeEntity(_0x308b64){return function(_0x4e3d1f){if(_0x4e3d1f){return _0x4e3d1f['destroy']()['then'](function(){var _0x5dc4e4=_0x4e3d1f['get']({'plain':!![]});var _0x496d99=_0x2255('0x23');return db[_0x2255('0x24')][_0x2255('0x25')]({'where':{'type':_0x496d99,'resourceId':_0x5dc4e4['id']}})['then'](function(){return _0x4e3d1f;});})[_0x2255('0x13')](function(){_0x308b64['status'](0xcc)[_0x2255('0x1c')]();});}};}function handleEntityNotFound(_0x43ae7e){return function(_0x151e50){if(!_0x151e50){_0x43ae7e[_0x2255('0x26')](0x194);}return _0x151e50;};}function handleError(_0x4e7b18,_0x4dce94){_0x4dce94=_0x4dce94||0x1f4;return function(_0x47f8cb){logger[_0x2255('0x18')](_0x47f8cb['stack']);if(_0x47f8cb[_0x2255('0x27')]){delete _0x47f8cb['name'];}_0x4e7b18[_0x2255('0x1b')](_0x4dce94)[_0x2255('0x28')](_0x47f8cb);};}exports[_0x2255('0x29')]=function(_0x1a4a83,_0x28e279){var _0x33e21c={'include':[{'model':db[_0x2255('0x2a')],'as':_0x2255('0x2b')}]},_0x488425={},_0x373f1c={'count':0x0,'rows':[]};var _0x3c7905=_[_0x2255('0x2c')](db[_0x2255('0x2d')]['rawAttributes'],function(_0x155756){return{'name':_0x155756[_0x2255('0x2e')],'type':_0x155756['type']['key']};});_0x488425['model']=_[_0x2255('0x2c')](_0x3c7905,_0x2255('0x27'));_0x488425[_0x2255('0x2f')]=_['keys'](_0x1a4a83[_0x2255('0x2f')]);_0x488425['filters']=_[_0x2255('0x30')](_0x488425[_0x2255('0x31')],_0x488425[_0x2255('0x2f')]);_0x33e21c['attributes']=_[_0x2255('0x30')](_0x488425[_0x2255('0x31')],qs[_0x2255('0x32')](_0x1a4a83[_0x2255('0x2f')][_0x2255('0x32')]));_0x33e21c['attributes']=_0x33e21c[_0x2255('0x33')][_0x2255('0x34')]?_0x33e21c[_0x2255('0x33')]:_0x488425[_0x2255('0x31')];if(!_0x1a4a83[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x33e21c[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x1a4a83['query'][_0x2255('0x20')]);_0x33e21c['offset']=qs[_0x2255('0x37')](_0x1a4a83['query'][_0x2255('0x37')]);}_0x33e21c[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x1a4a83[_0x2255('0x2f')]['sort']);_0x33e21c[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x1a4a83[_0x2255('0x2f')],_0x488425[_0x2255('0x3b')]),_0x3c7905);if(_0x1a4a83[_0x2255('0x2f')][_0x2255('0x3d')]){_0x33e21c['where']=_['merge'](_0x33e21c['where'],{'$or':_['map'](_0x3c7905,function(_0x107aa0){if(_0x107aa0[_0x2255('0x3e')]!==_0x2255('0x3f')){var _0x10f6e6={};_0x10f6e6[_0x107aa0[_0x2255('0x27')]]={'$like':'%'+_0x1a4a83[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x10f6e6;}})});}_0x33e21c=_[_0x2255('0x40')]({},_0x33e21c,_0x1a4a83[_0x2255('0x41')]);var _0x5d2aaa={'where':_0x33e21c[_0x2255('0x3a')]};return db[_0x2255('0x2d')][_0x2255('0x1f')](_0x5d2aaa)[_0x2255('0x13')](function(_0x41cb8b){_0x373f1c[_0x2255('0x1f')]=_0x41cb8b;if(_0x1a4a83[_0x2255('0x2f')]['includeAll']){_0x33e21c[_0x2255('0x42')]=[{'all':!![]}];}return db[_0x2255('0x2d')][_0x2255('0x43')](_0x33e21c);})[_0x2255('0x13')](function(_0x3d2eb3){_0x373f1c['rows']=_0x3d2eb3;return _0x373f1c;})[_0x2255('0x13')](respondWithFilteredResult(_0x28e279,_0x33e21c))[_0x2255('0x44')](handleError(_0x28e279,null));};exports['show']=function(_0x407568,_0x295f66){var _0x237be6={'raw':![],'where':{'id':_0x407568[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0x2a')],'as':_0x2255('0x2b')}]},_0x52196c={};_0x52196c[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0x2d')][_0x2255('0x47')]);_0x52196c['query']=_['keys'](_0x407568['query']);_0x52196c['filters']=_[_0x2255('0x30')](_0x52196c[_0x2255('0x31')],_0x52196c[_0x2255('0x2f')]);_0x237be6[_0x2255('0x33')]=_[_0x2255('0x30')](_0x52196c[_0x2255('0x31')],qs[_0x2255('0x32')](_0x407568['query'][_0x2255('0x32')]));_0x237be6[_0x2255('0x33')]=_0x237be6['attributes'][_0x2255('0x34')]?_0x237be6[_0x2255('0x33')]:_0x52196c[_0x2255('0x31')];if(_0x407568['query']['includeAll']){_0x237be6['include']=[{'all':!![]}];}_0x237be6=_[_0x2255('0x40')]({},_0x237be6,_0x407568[_0x2255('0x41')]);return db['ChatWebsite'][_0x2255('0x48')](_0x237be6)['then'](handleEntityNotFound(_0x295f66,null))['then'](respondWithResult(_0x295f66,null))['catch'](handleError(_0x295f66,null));};exports[_0x2255('0x49')]=function(_0x4304fa,_0x1fca6e){return db[_0x2255('0x2d')][_0x2255('0x49')](_0x4304fa[_0x2255('0x4a')],{})[_0x2255('0x13')](function(_0x5ebcb0){var _0x35ecf1=_0x4304fa[_0x2255('0x4b')][_0x2255('0x4c')]({'plain':!![]});if(!_0x35ecf1)throw new Error(_0x2255('0x4d'));if(_0x35ecf1['role']===_0x2255('0x4b')){var _0x3c9fa5=_0x5ebcb0[_0x2255('0x4c')]({'plain':!![]});var _0x5ca827=_0x2255('0x23');return db[_0x2255('0x4e')]['find']({'where':{'name':_0x5ca827,'userProfileId':_0x35ecf1[_0x2255('0x4f')]},'raw':!![]})[_0x2255('0x13')](function(_0x3ae936){if(_0x3ae936&&_0x3ae936[_0x2255('0x50')]===0x0){return db['UserProfileResource'][_0x2255('0x49')]({'name':_0x3c9fa5[_0x2255('0x27')],'resourceId':_0x3c9fa5['id'],'type':_0x3ae936[_0x2255('0x27')],'sectionId':_0x3ae936['id']},{})[_0x2255('0x13')](function(){return _0x5ebcb0;});}else{return _0x5ebcb0;}})['catch'](function(_0xea52c8){logger[_0x2255('0x18')](_0x2255('0x51'),_0xea52c8);throw _0xea52c8;});}return _0x5ebcb0;})[_0x2255('0x13')](respondWithResult(_0x1fca6e,0xc9))['catch'](handleError(_0x1fca6e,null));};exports[_0x2255('0x22')]=function(_0x4c2f8d,_0x30a785){if(_0x4c2f8d[_0x2255('0x4a')]['id']){delete _0x4c2f8d[_0x2255('0x4a')]['id'];}return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x4c2f8d['params']['id']},'include':[{'model':db[_0x2255('0x2a')],'as':_0x2255('0x2b')}]})[_0x2255('0x13')](handleEntityNotFound(_0x30a785,null))[_0x2255('0x13')](saveUpdates(_0x4c2f8d[_0x2255('0x4a')],null))[_0x2255('0x13')](respondWithResult(_0x30a785,null))[_0x2255('0x44')](handleError(_0x30a785,null));};exports[_0x2255('0x25')]=function(_0x2cb9b2,_0x43ff87){return db[_0x2255('0x2d')]['find']({'where':{'id':_0x2cb9b2['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x43ff87,null))['then'](removeEntity(_0x43ff87,null))['catch'](handleError(_0x43ff87,null));};exports[_0x2255('0x52')]=function(_0x2648d7,_0x5cfe38){return db[_0x2255('0x2d')]['describe']()[_0x2255('0x13')](respondWithResult(_0x5cfe38,null))['catch'](handleError(_0x5cfe38,null));};exports[_0x2255('0x53')]=function(_0x2aceba,_0x392cb1){if(_0x2aceba['body']['id']){delete _0x2aceba['body']['id'];}return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2aceba[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x392cb1,null))[_0x2255('0x13')](function(_0x3ce7ae){if(_0x3ce7ae){_0x2aceba[_0x2255('0x4a')][_0x2255('0x54')]=_0x3ce7ae['id'];return db['Disposition'][_0x2255('0x49')](_0x2aceba[_0x2255('0x4a')]);}})[_0x2255('0x13')](respondWithResult(_0x392cb1,null))['catch'](handleError(_0x392cb1,null));};exports[_0x2255('0x55')]=function(_0x15b5f8,_0x32e35a){var _0x1ff769={'raw':![],'where':{}};var _0xbdaab9={};var _0x3ad724={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2255('0x56')]({'where':{'id':_0x15b5f8['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x32e35a,null))[_0x2255('0x13')](function(_0x5e88fc){if(_0x5e88fc){_0xbdaab9[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0x57')]['rawAttributes']);_0xbdaab9[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x15b5f8[_0x2255('0x2f')]);_0xbdaab9['filters']=_[_0x2255('0x30')](_0xbdaab9[_0x2255('0x31')],_0xbdaab9[_0x2255('0x2f')]);_0x1ff769[_0x2255('0x33')]=_[_0x2255('0x30')](_0xbdaab9['model'],qs[_0x2255('0x32')](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x32')]));_0x1ff769[_0x2255('0x33')]=_0x1ff769[_0x2255('0x33')]['length']?_0x1ff769[_0x2255('0x33')]:_0xbdaab9[_0x2255('0x31')];if(!_0x15b5f8['query'][_0x2255('0x35')](_0x2255('0x36'))){_0x1ff769[_0x2255('0x20')]=qs['limit'](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x20')]);_0x1ff769[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x37')]);}_0x1ff769[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x39')]);_0x1ff769[_0x2255('0x3a')]=qs['filters'](_['pick'](_0x15b5f8[_0x2255('0x2f')],_0xbdaab9['filters']));_0x1ff769[_0x2255('0x3a')]['ChatWebsiteId']=_0x5e88fc['id'];if(_0x15b5f8['query'][_0x2255('0x3d')]){_0x1ff769[_0x2255('0x3a')]=_[_0x2255('0x40')](_0x1ff769['where'],{'$or':_[_0x2255('0x2c')](_0x1ff769[_0x2255('0x33')],function(_0x2ec1c4){var _0x9c9203={};_0x9c9203[_0x2ec1c4]={'$like':'%'+_0x15b5f8['query'][_0x2255('0x3d')]+'%'};return _0x9c9203;})});}_0x1ff769=_[_0x2255('0x40')]({},_0x1ff769,_0x15b5f8[_0x2255('0x41')]);return db[_0x2255('0x57')][_0x2255('0x1f')]({'where':_0x1ff769[_0x2255('0x3a')]})[_0x2255('0x13')](function(_0x5d1b5c){_0x3ad724[_0x2255('0x1f')]=_0x5d1b5c;if(_0x15b5f8['query'][_0x2255('0x58')]){_0x1ff769['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1ff769);})['then'](function(_0x25fb59){_0x3ad724[_0x2255('0x59')]=_0x25fb59;return _0x3ad724;});}})[_0x2255('0x13')](respondWithFilteredResult(_0x32e35a,_0x1ff769))[_0x2255('0x44')](handleError(_0x32e35a,null));};exports[_0x2255('0x5a')]=function(_0x1a127e,_0x5bfaab){return db[_0x2255('0x2d')]['find']({'where':{'id':_0x1a127e['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x5bfaab,null))[_0x2255('0x13')](function(_0x578a68){if(_0x578a68){return _0x578a68[_0x2255('0x5a')](_0x1a127e[_0x2255('0x2f')][_0x2255('0x5b')]);}})['then'](respondWithStatusCode(_0x5bfaab,null))[_0x2255('0x44')](handleError(_0x5bfaab,null));};exports[_0x2255('0x5c')]=function(_0x2f74ea,_0x7018c2){if(_0x2f74ea[_0x2255('0x4a')]['id']){delete _0x2f74ea[_0x2255('0x4a')]['id'];}return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2f74ea['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x7018c2,null))[_0x2255('0x13')](function(_0x57c7e6){if(_0x57c7e6){_0x2f74ea[_0x2255('0x4a')][_0x2255('0x54')]=_0x57c7e6['id'];return db[_0x2255('0x5d')][_0x2255('0x49')](_0x2f74ea[_0x2255('0x4a')]);}})[_0x2255('0x13')](respondWithResult(_0x7018c2,null))[_0x2255('0x44')](handleError(_0x7018c2,null));};exports[_0x2255('0x5e')]=function(_0x43a1ac,_0x459a89){var _0x1cb659={'raw':![],'where':{}};var _0x4573d5={};var _0x2e6de7={'count':0x0,'rows':[]};return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x43a1ac[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x459a89,null))['then'](function(_0x546bea){if(_0x546bea){_0x4573d5[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0x5d')][_0x2255('0x47')]);_0x4573d5[_0x2255('0x2f')]=_['keys'](_0x43a1ac[_0x2255('0x2f')]);_0x4573d5[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x4573d5['model'],_0x4573d5[_0x2255('0x2f')]);_0x1cb659[_0x2255('0x33')]=_[_0x2255('0x30')](_0x4573d5['model'],qs[_0x2255('0x32')](_0x43a1ac['query'][_0x2255('0x32')]));_0x1cb659[_0x2255('0x33')]=_0x1cb659['attributes']['length']?_0x1cb659[_0x2255('0x33')]:_0x4573d5[_0x2255('0x31')];if(!_0x43a1ac['query'][_0x2255('0x35')](_0x2255('0x36'))){_0x1cb659[_0x2255('0x20')]=qs['limit'](_0x43a1ac[_0x2255('0x2f')][_0x2255('0x20')]);_0x1cb659[_0x2255('0x37')]=qs['offset'](_0x43a1ac[_0x2255('0x2f')]['offset']);}_0x1cb659[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x43a1ac[_0x2255('0x2f')][_0x2255('0x39')]);_0x1cb659[_0x2255('0x3a')]=qs['filters'](_[_0x2255('0x3c')](_0x43a1ac[_0x2255('0x2f')],_0x4573d5[_0x2255('0x3b')]));_0x1cb659[_0x2255('0x3a')][_0x2255('0x54')]=_0x546bea['id'];if(_0x43a1ac[_0x2255('0x2f')]['filter']){_0x1cb659[_0x2255('0x3a')]=_['merge'](_0x1cb659[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x1cb659[_0x2255('0x33')],function(_0x5d9cf8){var _0x4c503b={};_0x4c503b[_0x5d9cf8]={'$like':'%'+_0x43a1ac[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x4c503b;})});}_0x1cb659=_[_0x2255('0x40')]({},_0x1cb659,_0x43a1ac[_0x2255('0x41')]);return db[_0x2255('0x5d')][_0x2255('0x1f')]({'where':_0x1cb659[_0x2255('0x3a')]})[_0x2255('0x13')](function(_0x15cd68){_0x2e6de7[_0x2255('0x1f')]=_0x15cd68;if(_0x43a1ac[_0x2255('0x2f')]['includeAll']){_0x1cb659[_0x2255('0x42')]=[{'all':!![]}];}return db[_0x2255('0x5d')][_0x2255('0x43')](_0x1cb659);})[_0x2255('0x13')](function(_0x3a4fc6){_0x2e6de7[_0x2255('0x59')]=_0x3a4fc6;return _0x2e6de7;});}})[_0x2255('0x13')](respondWithFilteredResult(_0x459a89,_0x1cb659))[_0x2255('0x44')](handleError(_0x459a89,null));};exports[_0x2255('0x5f')]=function(_0x2f84ce,_0x18b269){return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2f84ce[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x18b269,null))[_0x2255('0x13')](function(_0x22e570){if(_0x22e570){return _0x22e570[_0x2255('0x5f')](_0x2f84ce['query'][_0x2255('0x5b')]);}})['then'](respondWithStatusCode(_0x18b269,null))[_0x2255('0x44')](handleError(_0x18b269,null));};exports[_0x2255('0x60')]=function(_0x1ef5cd,_0x299f40){_0x1ef5cd['body']['sitepic']=_0x1ef5cd[_0x2255('0x61')][_0x2255('0x62')];return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x1ef5cd['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x299f40,null))[_0x2255('0x13')](saveUpdates(_0x1ef5cd[_0x2255('0x4a')],null))[_0x2255('0x13')](respondWithResult(_0x299f40,null))['catch'](handleError(_0x299f40,null));};exports[_0x2255('0x63')]=function(_0x2a897f,_0x17ece0){_0x2a897f[_0x2255('0x4a')]['agentAvatar']=_0x2a897f['file'][_0x2255('0x62')];return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2a897f[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x17ece0,null))[_0x2255('0x13')](saveUpdates(_0x2a897f['body'],null))[_0x2255('0x13')](respondWithResult(_0x17ece0,null))[_0x2255('0x44')](handleError(_0x17ece0,null));};exports[_0x2255('0x64')]=function(_0x46da65,_0x542ed1){_0x46da65[_0x2255('0x4a')]['customerAvatar']=_0x46da65['file'][_0x2255('0x62')];return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x46da65[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x542ed1,null))[_0x2255('0x13')](saveUpdates(_0x46da65[_0x2255('0x4a')],null))[_0x2255('0x13')](respondWithResult(_0x542ed1,null))['catch'](handleError(_0x542ed1,null));};exports['addSystemAvatar']=function(_0x2ddce5,_0x1e0471){_0x2ddce5['body'][_0x2255('0x65')]=_0x2ddce5['file']['filename'];return db[_0x2255('0x2d')]['find']({'where':{'id':_0x2ddce5['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x1e0471,null))['then'](saveUpdates(_0x2ddce5[_0x2255('0x4a')],null))['then'](respondWithResult(_0x1e0471,null))[_0x2255('0x44')](handleError(_0x1e0471,null));};exports[_0x2255('0x66')]=function(_0x348bf0,_0x3ecf30){var _0x23ced0=path[_0x2255('0x67')](config['root'],_0x2255('0x68'));var _0x5b2425={'where':{'id':_0x348bf0[_0x2255('0x45')]['id']},'attributes':['id',_0x2255('0x69')],'raw':!![]};var _0x4cef55=![];return require(_0x2255('0x6a'))['getLicense']()['then'](function(_0x132f78){if(_0x132f78){_0x4cef55=_0x132f78['custom'];}})[_0x2255('0x13')](function(){return db['ChatWebsite'][_0x2255('0x48')](_0x5b2425);})[_0x2255('0x13')](handleEntityNotFound(_0x3ecf30,null))['then'](function(_0x3839ab){if(_0x3839ab){if(!_[_0x2255('0x6b')](_0x3839ab['sitepic'])){if(fs['existsSync'](path['join'](config[_0x2255('0x6c')],_0x2255('0x6d'),_0x3839ab[_0x2255('0x69')]))&&_0x4cef55){_0x23ced0=path['join'](config[_0x2255('0x6c')],_0x2255('0x6d'),_0x3839ab[_0x2255('0x69')]);}}return _0x3ecf30[_0x2255('0x6e')](_0x23ced0);}})[_0x2255('0x44')](handleError(_0x3ecf30,null));};exports[_0x2255('0x6f')]=function(_0x13bd2d,_0x10d88f){var _0x451494=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x70'));var _0x508ef7={'where':{'id':_0x13bd2d[_0x2255('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2255('0x2d')][_0x2255('0x48')](_0x508ef7)[_0x2255('0x13')](handleEntityNotFound(_0x10d88f,null))['then'](function(_0xdd5e72){if(_0xdd5e72){if(!_[_0x2255('0x6b')](_0xdd5e72[_0x2255('0x71')])){if(fs[_0x2255('0x72')](path['join'](config['root'],_0x2255('0x73'),_0xdd5e72['agentAvatar']))){_0x451494=path[_0x2255('0x67')](config['root'],_0x2255('0x73'),_0xdd5e72[_0x2255('0x71')]);}}return _0x10d88f[_0x2255('0x6e')](_0x451494);}})[_0x2255('0x44')](handleError(_0x10d88f,null));};exports[_0x2255('0x74')]=function(_0x2ba9f,_0x3ba0d8){var _0x65ecd1=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x75'));var _0x2a0db0={'where':{'id':_0x2ba9f['params']['id']},'attributes':['id',_0x2255('0x76'),_0x2255('0x77')],'raw':!![]};return db[_0x2255('0x2d')][_0x2255('0x48')](_0x2a0db0)[_0x2255('0x13')](handleEntityNotFound(_0x3ba0d8,null))['then'](function(_0xfd858c){if(_0xfd858c){if(!_[_0x2255('0x6b')](_0xfd858c['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0x2255('0x6c')],_0x2255('0x73'),_0xfd858c['customerAvatar']))&&_0xfd858c[_0x2255('0x77')]){_0x65ecd1=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x73'),_0xfd858c[_0x2255('0x76')]);}}return _0x3ba0d8[_0x2255('0x6e')](_0x65ecd1);}})['catch'](handleError(_0x3ba0d8,null));};exports[_0x2255('0x78')]=function(_0x42a762,_0x208637){var _0xc34330=path[_0x2255('0x67')](config[_0x2255('0x6c')],'server/files/images/avatars/system_avatar.png');var _0x2af09e={'where':{'id':_0x42a762[_0x2255('0x45')]['id']},'attributes':['id',_0x2255('0x65')],'raw':!![]};return db[_0x2255('0x2d')][_0x2255('0x48')](_0x2af09e)[_0x2255('0x13')](handleEntityNotFound(_0x208637,null))['then'](function(_0x435639){if(_0x435639){if(!_[_0x2255('0x6b')](_0x435639['systemAvatar'])){if(fs[_0x2255('0x72')](path['join'](config['root'],_0x2255('0x73'),_0x435639['systemAvatar']))){_0xc34330=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x73'),_0x435639[_0x2255('0x65')]);}}return _0x208637[_0x2255('0x6e')](_0xc34330);}})[_0x2255('0x44')](handleError(_0x208637,null));};exports[_0x2255('0x79')]=function(_0x4dfb3b,_0x1e8515){var _0x1daaee=require(_0x2255('0x7a'));var _0x50ec82=new _0x1daaee();var _0x12b9cd=_0x50ec82[_0x2255('0x7b')](_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x7d')])['getResult']();var _0x31c0a4={'body':_0x4dfb3b[_0x2255('0x4a')],'channel':'chat'};var _0x488550=[];var _0x4eb4d7=[];var _0x2ffe0e={};var _0x450d66=![];return db[_0x2255('0x7e')]['describe']()[_0x2255('0x13')](function(_0xf640b8){if(!_0xf640b8){throw new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0x81'));}_0x488550=_[_0x2255('0x82')](_[_0x2255('0x46')](_0xf640b8),['createdAt',_0x2255('0x83')]);_0x4eb4d7=_[_0x2255('0x82')](_[_0x2255('0x46')](_0xf640b8),[_0x2255('0x84'),_0x2255('0x83'),_0x2255('0x85'),_0x2255('0x86')]);if(_0x4dfb3b[_0x2255('0x4a')]['id']){delete _0x4dfb3b[_0x2255('0x4a')]['id'];}if(_[_0x2255('0x6b')](_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x87')])){throw new db[(_0x2255('0x7f'))]['ValidationError'](_0x2255('0x88'));}if(_[_0x2255('0x6b')](_0x4dfb3b[_0x2255('0x4a')]['body'])||_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x4a')]===''){throw new db['Sequelize'][(_0x2255('0x80'))](_0x2255('0x89'));}if(_[_0x2255('0x6b')](_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x8a')])){throw new db['Sequelize'][(_0x2255('0x80'))](_0x2255('0x8b')+_0x4eb4d7);}if(!_[_0x2255('0x8c')](_0x4eb4d7,_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x8a')])){throw new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0x8d')+_0x4eb4d7);}_0x2ffe0e[_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x8a')]]=_0x4dfb3b[_0x2255('0x4a')]['from'];})[_0x2255('0x13')](function(){return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x4dfb3b[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0x8e')],'as':_0x2255('0x8f'),'include':[{'model':db[_0x2255('0x7e')],'as':_0x2255('0x90'),'where':_0x2ffe0e,'limit':0x1,'order':[['updatedAt',_0x2255('0x91')]]}]},{'model':db[_0x2255('0x92')],'as':'Applications'}]});})[_0x2255('0x13')](handleEntityNotFound(_0x1e8515,null))['then'](function(_0x2756cf){if(_0x2756cf&&_0x2756cf[_0x2255('0x8f')]){_0x31c0a4['account']=_0x2756cf;_0x31c0a4[_0x2255('0x93')]=_0x2756cf[_0x2255('0x94')];_0x31c0a4['list']=_0x2756cf['List'];_0x31c0a4[_0x2255('0x93')]=_[_0x2255('0x95')](_0x31c0a4['applications'],[_0x2255('0x96')],[_0x2255('0x97')]);if(_0x31c0a4[_0x2255('0x98')][_0x2255('0x94')]){delete _0x31c0a4[_0x2255('0x98')][_0x2255('0x94')];}if(_0x31c0a4[_0x2255('0x98')][_0x2255('0x8f')]&&_0x31c0a4['account'][_0x2255('0x8f')]['Contacts']['length']){return _0x31c0a4[_0x2255('0x98')][_0x2255('0x8f')][_0x2255('0x90')][0x0];}var _0x7ab084=_[_0x2255('0xb')](_0x4dfb3b['body'],{'firstName':_0x4dfb3b[_0x2255('0x4a')]['from'],'ListId':_0x2756cf['ListId']});_0x7ab084[_0x4dfb3b[_0x2255('0x4a')]['mapKey']]=_0x4dfb3b[_0x2255('0x4a')]['from'];return db[_0x2255('0x7e')]['create'](_0x7ab084,{'fields':_0x488550,'raw':!![]});}})[_0x2255('0x13')](handleEntityNotFound(_0x1e8515,null))[_0x2255('0x13')](function(_0x11879d){_0x31c0a4[_0x2255('0x99')]=_0x11879d;var _0x1a00e4=_0x4dfb3b['body'][_0x2255('0x9a')];if(_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x9b')]){_0x1a00e4=_0x4dfb3b['headers']['cf-connecting-ip'];}else if(_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x9c')]){_0x1a00e4=_[_0x2255('0x9d')](_0x4dfb3b['headers'][_0x2255('0x9c')]['split'](','));}if(_0x11879d){var _0x2a5cab={'ContactId':_0x11879d['id'],'ChatWebsiteId':_0x4dfb3b['params']['id'],'from':(_0x11879d['firstName']||'')+'\x20'+(_0x11879d['lastName']||''),'customerIp':_0x1a00e4,'customerPort':_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x9e')]?_0x4dfb3b['headers']['x-real-port']:null,'referer':_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x9f')],'browserName':_0x12b9cd[_0x2255('0xa0')][_0x2255('0x27')]&&_0x12b9cd['browser'][_0x2255('0xa1')]?util['format'](_0x2255('0xa2'),_0x12b9cd[_0x2255('0xa0')][_0x2255('0x27')],_0x12b9cd[_0x2255('0xa0')][_0x2255('0xa1')]):_0x2255('0xa3'),'browserVersion':_0x12b9cd[_0x2255('0xa0')][_0x2255('0xa1')]||'unknown','osName':util[_0x2255('0xa4')](_0x2255('0xa2'),_0x12b9cd['os'][_0x2255('0x27')],_0x12b9cd['os'][_0x2255('0xa1')]),'osVersion':_0x12b9cd['os'][_0x2255('0xa1')],'deviceModel':_0x12b9cd[_0x2255('0xa5')][_0x2255('0x31')]&&_0x12b9cd['device']['vendor']?util['format']('%s\x20%s\x20%s',_0x12b9cd[_0x2255('0xa5')]['model'],_0x12b9cd['device']['vendor'],_0x12b9cd['device'][_0x2255('0x3e')]):null,'deviceVendor':_0x12b9cd[_0x2255('0xa5')]['vendor'],'deviceType':_0x12b9cd[_0x2255('0xa5')][_0x2255('0x3e')],'formData':JSON[_0x2255('0xa6')](_0x4dfb3b['body'])};var _0x93374f={'ChatWebsiteId':_0x4dfb3b[_0x2255('0x45')]['id'],'closed':![]};if(_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xa7')]){_0x93374f[_0x2255('0xa7')]=_0x4dfb3b['body'][_0x2255('0xa7')];return db[_0x2255('0xa8')]['find']({'where':_0x93374f})[_0x2255('0x13')](function(_0x4e7188){if(_0x4e7188){return[_0x4e7188,![]];}_0x2a5cab[_0x2255('0xa7')]=_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xa7')];_0x2a5cab[_0x2255('0xa9')]=_0x4dfb3b['body'][_0x2255('0xa9')];return db[_0x2255('0xa8')]['create'](_0x2a5cab)[_0x2255('0x13')](function(_0x5a6ccd){return[_0x5a6ccd,!![]];});});}_0x93374f[_0x2255('0xaa')]=_0x11879d['id'];if(_0x4dfb3b['body']['interaction']&&_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xab')]['id']){_0x93374f['id']=_0x4dfb3b[_0x2255('0x4a')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x93374f})[_0x2255('0x13')](function(_0x57e726){if(_0x57e726){return[_0x57e726,![]];}return db[_0x2255('0xa8')][_0x2255('0x49')](_0x2a5cab)[_0x2255('0x13')](function(_0x2536ba){return[_0x2536ba,!![]];});});}return db[_0x2255('0xa8')][_0x2255('0x49')](_0x2a5cab)['then'](function(_0x527634){return[_0x527634,!![]];});}})['spread'](function(_0x75fad,_0xe0da67){if(_0x75fad){_0x450d66=_0xe0da67;if(!_0xe0da67){var _0x31cf4e={'from':(_0x31c0a4[_0x2255('0x99')]['firstName']||'')+'\x20'+(_0x31c0a4['contact'][_0x2255('0xac')]||'')};if(_0x4dfb3b['body'][_0x2255('0xa7')]&&_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xad')]&&_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xa7')]!=_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xad')]){_0x31cf4e['threadId']=_0x4dfb3b['body']['messageId'];}return _0x75fad[_0x2255('0x22')](_0x31cf4e);}else{return _0x75fad;}}})['then'](function(_0x1ca603){_0x31c0a4[_0x2255('0xab')]=_0x1ca603[_0x2255('0x4c')]({'plain':!![]});_0x31c0a4['interaction'][_0x2255('0xae')]=_0x450d66;if(_0x31c0a4['interaction'][_0x2255('0xae')]){if(_0x31c0a4[_0x2255('0x98')][_0x2255('0xaf')]){_0x31c0a4['applications']['push']({'id':0x0,'priority':_0x31c0a4[_0x2255('0x93')][_0x2255('0x34')]+0x1,'app':_0x2255('0xb0'),'appdata':_0x2255('0xb1'),'interval':_0x2255('0xb2')});}}return db['ChatMessage'][_0x2255('0x49')]({'body':_0x4dfb3b[_0x2255('0x4a')]['body'],'ChatWebsiteId':_0x4dfb3b[_0x2255('0x45')]['id'],'ChatInteractionId':_0x1ca603['id'],'direction':'in','ContactId':_0x31c0a4[_0x2255('0x99')]['id'],'AttachmentId':_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xb3')]});})[_0x2255('0x13')](function(_0x2b376c){_0x31c0a4['message']=_0x2b376c;if(_0x31c0a4['interaction'][_0x2255('0xb4')]){return db['User'][_0x2255('0x48')]({'attributes':['id',_0x2255('0x27')],'where':{'id':_0x31c0a4[_0x2255('0xab')][_0x2255('0xb4')]}})['then'](function(_0x4b2da5){if(_0x4b2da5){_0x31c0a4[_0x2255('0x93')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2255('0xb5'),'appdata':_0x4b2da5[_0x2255('0x27')]+','+(_0x31c0a4[_0x2255('0x98')][_0x2255('0xb6')]||0xa),'interval':_0x2255('0xb2')});_0x31c0a4[_0x2255('0xb7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x31c0a4);});}return respondWithRpcPromise('Start',_0x2255('0xb8'),_0x31c0a4);})[_0x2255('0x13')](function(_0xade164){respondWithRpcPromise(_0x2255('0xb9'),_0x2255('0xb9'),{'event':_0x2255('0x79'),'message':_0xade164},client9002);return _0xade164;})[_0x2255('0x13')](respondWithResult(_0x1e8515,null))[_0x2255('0x44')](handleError(_0x1e8515,null));};exports[_0x2255('0xba')]=function(_0xd0b191,_0x5b50c9){var _0x489100,_0x4e1abc,_0x20f6c0;var _0x4e99f0=[];var _0x3ac5cb={};var _0x3dd387=_0xd0b191[_0x2255('0xbb')]||[];var _0x2e29de=[];var _0x20b839;return db[_0x2255('0x7e')][_0x2255('0x52')]()[_0x2255('0x13')](function(_0x18eeee){if(!_0x18eeee){throw new db['Sequelize']['ValidationError'](_0x2255('0x81'));}_0x4e99f0=_[_0x2255('0x82')](_[_0x2255('0x46')](_0x18eeee),['createdAt',_0x2255('0x83'),_0x2255('0x85'),'ListId']);if(_0xd0b191['body']['id']){delete _0xd0b191[_0x2255('0x4a')]['id'];}if(_[_0x2255('0x6b')](_0xd0b191[_0x2255('0x4a')][_0x2255('0x87')])){throw _0x5b50c9[_0x2255('0x1b')](0x1f4)['send'](new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0x88')));}if(_[_0x2255('0x6b')](_0xd0b191['body'][_0x2255('0x4a')])||_0xd0b191['body'][_0x2255('0x4a')]===''){throw _0x5b50c9[_0x2255('0x1b')](0x1f4)[_0x2255('0x28')](new db[(_0x2255('0x7f'))]['ValidationError'](_0x2255('0x89')));}if(_[_0x2255('0x6b')](_0xd0b191[_0x2255('0x4a')][_0x2255('0xbc')])){throw _0x5b50c9['status'](0x1f4)[_0x2255('0x28')](new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0xbd')+_0x4e99f0));}if(!_['includes'](_0x4e99f0,_0xd0b191[_0x2255('0x4a')][_0x2255('0xbc')])){throw _0x5b50c9['status'](0x1f4)[_0x2255('0x28')](new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0xbe')+_0x4e99f0));}_0x3ac5cb[_0xd0b191[_0x2255('0x4a')][_0x2255('0xbc')]]=_0xd0b191['body'][_0x2255('0x87')];})[_0x2255('0x13')](function(){return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0xd0b191[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0x8e')],'as':_0x2255('0x8f')},{'model':db[_0x2255('0xbf')],'as':_0x2255('0xbf')}]});})[_0x2255('0x13')](handleEntityNotFound(_0x5b50c9,null))[_0x2255('0x13')](function(_0x272d2e){if(_0x272d2e&&_0x272d2e[_0x2255('0x8f')]){_0x4e1abc=_0x272d2e;var _0x5b3dab=_[_0x2255('0xb')](_0xd0b191[_0x2255('0x4a')],{'firstName':_0xd0b191[_0x2255('0x4a')]['from'],'phone':_0xd0b191[_0x2255('0x4a')][_0x2255('0x87')],'ListId':_0x272d2e[_0x2255('0x86')]});_0x5b3dab[_0xd0b191['body']['mapKeyOffline']]=_0xd0b191['body']['from'];return db['CmContact'][_0x2255('0xc0')]({'where':_0x3ac5cb,'defaults':_0x5b3dab});}})[_0x2255('0xc1')](function(_0x3e758b){if(_0x3e758b){_0x20f6c0=_0x3e758b;var _0x10b6b0=fs[_0x2255('0xc2')](path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0xc3')),'utf8');var _0x4e2201=ejs['render'](_0x10b6b0,{'body':_[_0x2255('0xc4')](_0xd0b191[_0x2255('0x4a')][_0x2255('0x4a')]),'bodyTitle':_0x4e1abc[_0x2255('0xc5')]});return db[_0x2255('0xc6')][_0x2255('0x49')]({'body':_0x4e2201,'plainBody':htmlToText[_0x2255('0xc7')](_0x4e2201),'ContactId':_0x3e758b['id'],'ChatWebsiteId':_0x4e1abc['id']});}})[_0x2255('0x13')](function(_0x29d98a){_0x20b839=_0x29d98a;if(_0x3dd387['length']){var _0x29c7d6=_0x3dd387[_0x2255('0x2c')](function(_0x14692b){return{'name':_0x14692b[_0x2255('0xc8')],'basename':_0x14692b['filename'],'type':_0x14692b[_0x2255('0xc9')],'ChatOfflineMessageId':_0x29d98a['id']};});_0x2e29de=_0x29c7d6['map'](_0xc2f789=>{var _0x89281={'filename':_0xc2f789['name'],'path':path['join'](config[_0x2255('0x6c')],'server',_0x2255('0xbb'),_0x2255('0xca'),'offline-chat',_0xc2f789[_0x2255('0xcb')])};return _0x89281;});if(!_0x4e1abc[_0x2255('0xcc')]){return db[_0x2255('0xcd')][_0x2255('0xce')](function(_0x92e3a){return db[_0x2255('0xcf')]['bulkCreate'](_0x29c7d6,{'transaction':_0x92e3a});});}}})['then'](function(){if(_0x20b839){_0x489100=_0x20b839;return db[_0x2255('0xbf')][_0x2255('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0x2255('0xd0')],'as':_0x2255('0xd1'),'raw':!![],'include':[{'model':db[_0x2255('0xd2')],'as':_0x2255('0xd2'),'raw':!![]}]}]});}})[_0x2255('0x13')](function(_0x52f99b){if(_0x52f99b&&_0x52f99b[_0x2255('0xd1')]&&_0x4e1abc[_0x2255('0xd3')]&&_0x4e1abc[_0x2255('0xd4')]){var _0x5a9057=_0x52f99b['getSmtpOptions']();return respondWithRpcPromise(_0x2255('0xd5'),_0x2255('0xd6'),{'account':_0x5a9057,'message':{'from':util[_0x2255('0xa4')](_0x2255('0xd7'),_0x52f99b[_0x2255('0x27')],_0x52f99b[_0x2255('0xd8')]||_0x52f99b[_0x2255('0xd1')][_0x2255('0x4b')]),'to':_0x4e1abc[_0x2255('0xd4')],'subject':_0x4e1abc[_0x2255('0xd9')],'html':_0x489100['body'],'attachments':_0x2e29de}},client9003)[_0x2255('0x13')](function(){return _0x489100;})[_0x2255('0x44')](function(_0x16d042){logger[_0x2255('0x18')](_0x16d042);});}})[_0x2255('0x13')](function(){if(_0x4e1abc&&_0x4e1abc[_0x2255('0xcc')]&&_0x4e1abc[_0x2255('0xda')]){var _0x3aa029=[];if(_0x3dd387['length']){_0x3aa029=_0x3dd387[_0x2255('0x2c')](function(_0x2f2226){return{'name':_0x2f2226[_0x2255('0xc8')],'basename':_0x2f2226[_0x2255('0x62')],'type':_0x2f2226[_0x2255('0xc9')],'ChatOfflineMessageId':_0x20b839['id']};});}var _0xd05cf4;if(!_[_0x2255('0x6b')](_0x4e1abc['subjectOffline'])){var _0x28db2b=_[_0x2255('0x2c')](_0xd0b191['body'],function(_0x512d94){return _0x512d94;});var _0xf73e24=_['toPairsIn'](_0x28db2b)[0x0];var _0x154b6f=_[_0x2255('0xdb')](_0xf73e24,function(_0x3df43a){return _0x3df43a;});_0xd05cf4=_0x154b6f[0x1][_0x4e1abc[_0x2255('0xdc')]];}var _0x45df49={'from':_0x20f6c0[_0x2255('0xd8')],'firstName':_0x20f6c0[_0x2255('0xdd')],'lastName':_0x20f6c0[_0x2255('0xac')],'mapKey':_0x2255('0xd8'),'message':{'from':_0x20f6c0[_0x2255('0xd8')],'to':_0x4e1abc[_0x2255('0xbf')][_0x2255('0xd8')],'cc':'','subject':_[_0x2255('0x6b')](_0xd05cf4)?_0x4e1abc[_0x2255('0xd9')]:_0xd05cf4,'messageId':'','sentAt':new Date(),'attach':_0x3aa029['length'],'attachments':_0x3aa029,'originChannel':_0x2255('0xde'),'ChatWebsiteId':_0x4e1abc['id'],'ChatOfflineMessageId':_0x489100['id'],'originTo':_0x4e1abc[_0x2255('0xbf')][_0x2255('0xd8')]},'body':_0x489100['body']};var _0x1bc506={'account':{'id':_0x4e1abc[_0x2255('0xda')]},'body':_0x45df49,'log':_0x2255('0xdf')};return respondWithRpcPromise(_0x2255('0xdf'),_0x2255('0xe0'),_0x1bc506,client9001)[_0x2255('0x13')](function(){return _0x489100;})['catch'](function(_0x1d3d7c){logger[_0x2255('0x18')](_0x1d3d7c);});}return;})['then'](function(){if(_0x489100){return _0x489100;}})['then'](respondWithResult(_0x5b50c9,null))[_0x2255('0x44')](function(_0xfa6f06){logger[_0x2255('0x18')](_0x2255('0x44'),_0xfa6f06);for(var _0x59e784 of _0x3dd387){var _0x2a3b6d=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0xe1'),_0x2255('0xbb'),_0x2255('0xca'),_0x2255('0xe2'),_0x59e784[_0x2255('0x62')]);fs_extra['remove'](_0x2a3b6d)[_0x2255('0x44')](function(_0x373729){logger[_0x2255('0x18')](_0x2255('0xe3'),_0x2a3b6d,_0x373729);});}});};exports[_0x2255('0xe4')]=function(_0x1c1891,_0x3d8d26){return db['ChatInteraction']['find']({'where':{'id':_0x1c1891[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x3d8d26,null))[_0x2255('0x13')](function(_0x142bef){if(_0x142bef){return _0x142bef['addInteraction'](_0x1c1891[_0x2255('0x4a')][_0x2255('0x5b')],_['omit'](_0x1c1891['body'],[_0x2255('0x5b'),'id'])||{});}})[_0x2255('0x13')](respondWithResult(_0x3d8d26,null))['catch'](handleError(_0x3d8d26,null));};exports[_0x2255('0xe5')]=function(_0x27bf61,_0x4bd979){var _0x1adfaf={'raw':![],'where':{}};var _0x10d746={};var _0x300814={'count':0x0,'rows':[]};return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x27bf61[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x4bd979,null))[_0x2255('0x13')](function(_0x393187){if(_0x393187){_0x10d746[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0xa8')][_0x2255('0x47')]);_0x10d746[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x27bf61['query']);_0x10d746[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x10d746[_0x2255('0x31')],_0x10d746['query']);_0x1adfaf[_0x2255('0x33')]=_[_0x2255('0x30')](_0x10d746[_0x2255('0x31')],qs[_0x2255('0x32')](_0x27bf61[_0x2255('0x2f')][_0x2255('0x32')]));_0x1adfaf['attributes']=_0x1adfaf[_0x2255('0x33')][_0x2255('0x34')]?_0x1adfaf[_0x2255('0x33')]:_0x10d746[_0x2255('0x31')];if(!_0x27bf61[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x1adfaf[_0x2255('0x20')]=qs['limit'](_0x27bf61['query'][_0x2255('0x20')]);_0x1adfaf[_0x2255('0x37')]=qs['offset'](_0x27bf61[_0x2255('0x2f')][_0x2255('0x37')]);}_0x1adfaf[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x27bf61[_0x2255('0x2f')][_0x2255('0x39')]);_0x1adfaf[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_['pick'](_0x27bf61[_0x2255('0x2f')],_0x10d746[_0x2255('0x3b')]));_0x1adfaf[_0x2255('0x3a')][_0x2255('0x54')]=_0x393187['id'];if(_0x27bf61['query'][_0x2255('0x3d')]){_0x1adfaf['where']=_[_0x2255('0x40')](_0x1adfaf[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x1adfaf['attributes'],function(_0x5d7a39){var _0x5a7264={};_0x5a7264[_0x5d7a39]={'$like':'%'+_0x27bf61[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x5a7264;})});}_0x1adfaf=_[_0x2255('0x40')]({},_0x1adfaf,_0x27bf61[_0x2255('0x41')]);return db['ChatInteraction'][_0x2255('0x1f')]({'where':_0x1adfaf[_0x2255('0x3a')]})[_0x2255('0x13')](function(_0x8cd8ee){_0x300814[_0x2255('0x1f')]=_0x8cd8ee;if(_0x27bf61[_0x2255('0x2f')]['includeAll']){_0x1adfaf[_0x2255('0x42')]=[{'model':db[_0x2255('0x7e')],'as':_0x2255('0xe6'),'required':![]},{'model':db[_0x2255('0xe7')],'as':_0x2255('0xe8'),'attributes':[_0x2255('0x27'),'fullname',_0x2255('0xe9')],'required':![]},{'model':db[_0x2255('0xea')],'as':_0x2255('0xeb'),'attributes':['id',_0x2255('0x27'),'color'],'where':_0x27bf61[_0x2255('0x2f')][_0x2255('0xec')]?{'id':_0x27bf61[_0x2255('0x2f')][_0x2255('0xec')]}:undefined,'required':_0x27bf61[_0x2255('0x2f')][_0x2255('0xec')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x1adfaf);})[_0x2255('0x13')](function(_0x2f2fe1){_0x300814['rows']=_0x2f2fe1;return _0x300814;});}})[_0x2255('0x13')](respondWithFilteredResult(_0x4bd979,_0x1adfaf))['catch'](handleError(_0x4bd979,null));};function iftimePromise(_0x1ee3b5,_0x541df3){return respondWithRpcPromise(_0x2255('0xed'),_0x2255('0xee'),{'command':_0x541df3[_0x2255('0xef')]?util['format'](_0x2255('0xf0'),_0x1ee3b5['interval'],_0x541df3[_0x2255('0xef')]):util[_0x2255('0xa4')](_0x2255('0xf1'),_0x1ee3b5['interval'])},client9002)['then'](function(_0x26dd3e){var _0x6428f5=_0x26dd3e&&_0x26dd3e[_0x2255('0xf2')]('true')>=0x0?!![]:![];logger[_0x2255('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x541df3['id'],_0x1ee3b5['id'],_0x1ee3b5['interval'],_0x6428f5?_0x2255('0xf3'):_0x2255('0xf4'),_0x541df3[_0x2255('0xef')]?_0x541df3[_0x2255('0xef')]:'No\x20timezone');return _0x6428f5;})[_0x2255('0x44')](function(_0x24f20e){logger['error'](_0x2255('0xf5'),_0x541df3['id'],_0x1ee3b5['id'],_0x1ee3b5[_0x2255('0xf6')],util[_0x2255('0xf7')](_0x24f20e,{'showHidden':![],'depth':null}),_0x541df3[_0x2255('0xef')]?_0x541df3[_0x2255('0xef')]:'No\x20timezone');return![];});}exports[_0x2255('0xee')]=function(_0x520256,_0x362354){var _0x2b7424=0x0;var _0x1bd242=0x0;var _0x56936c=![];var _0x23bcce;var _0x807904;return db[_0x2255('0x2d')]['find']({'where':{'id':_0x520256[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0xf8')],'as':_0x2255('0xf8'),'include':[{'model':db[_0x2255('0xf8')],'as':_0x2255('0xf9'),'attributes':['id',_0x2255('0xf6')],'raw':!![]}]}]})[_0x2255('0x13')](handleEntityNotFound(_0x362354,null))[_0x2255('0x13')](function(_0x522c){if(_0x522c){_0x23bcce=_0x522c;return _0x522c[_0x2255('0xfa')]({'raw':!![]});}})[_0x2255('0x13')](function(_0x5a5a77){if(_0x23bcce){if(_0x5a5a77){_0x807904=_0x5a5a77;}}return require(_0x2255('0x6a'))[_0x2255('0xfb')]();})[_0x2255('0x13')](function(_0x2c7416){if(_0x2c7416){_0x1bd242=_0x2c7416[_0x2255('0xfc')];_0x56936c=_0x2c7416[_0x2255('0xfd')];}})['then'](function(){return db[_0x2255('0xa8')][_0x2255('0x1f')]({'where':{'closed':![]}});})[_0x2255('0x13')](function(_0x3ca15e){_0x2b7424=_0x3ca15e;if(_0x1bd242&&_0x3ca15e>_0x1bd242){return db[_0x2255('0xfe')][_0x2255('0x56')]({'where':{'id':0x1}})['then'](function(_0x4c789f){if(_0x4c789f){_0x4c789f['increment']('chatLicenseExceeded');}});}})[_0x2255('0x13')](function(){if(_0x23bcce[_0x2255('0xf8')]&&_0x23bcce[_0x2255('0xf8')][_0x2255('0xf9')]){var _0x1fdade=[];for(var _0x461010=0x0;_0x461010<_0x23bcce['Interval'][_0x2255('0xf9')][_0x2255('0x34')];_0x461010++){var _0x1c82e7=_0x23bcce[_0x2255('0xf8')][_0x2255('0xf9')][_0x461010][_0x2255('0x4c')]({'plain':!![]});_0x1fdade[_0x2255('0xff')](iftimePromise(_0x1c82e7,_0x23bcce));}return BPromise[_0x2255('0x100')](_0x1fdade)[_0x2255('0x13')](function(_0x206cfd){return _[_0x2255('0x101')](_0x206cfd);});}else{return!![];}})[_0x2255('0x13')](function(_0x5cebed){var _0x137c45=fs['readFileSync'](path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x102')),_0x2255('0x103'));var _0x148c19=new url['URL'](_0x23bcce['address'])['origin'];var _0x595ebb=_0x2255('0x104');var _0x2ee95b=![];var _0x5368bb={'chatVersion':_0x595ebb,'chatWebsiteAddressOrigin':_0x148c19,'remote':_0x23bcce[_0x2255('0x105')],'query':querystring['stringify'](_['merge'](_0x23bcce[_0x2255('0x4c')]({'plain':!![]}),{'customerIp':_0x520256['headers'][_0x2255('0x9c')]||_0x520256[_0x2255('0x7c')][_0x2255('0x106')]||_0x520256[_0x2255('0x107')][_0x2255('0x108')]||_0x520256['ip'],'referer':_0x520256[_0x2255('0x7c')][_0x2255('0x9f')],'openedInteractions':_0x2b7424,'maxInteractions':_0x1bd242,'virtual':_0x56936c[_0x2255('0xfc')],'online':_0x5cebed,'custom':_0x56936c}))['replace'](/'/g,'\x5c\x27')};_0x362354[_0x2255('0x28')](ejs['render'](Mustache[_0x2255('0x109')](_0x137c45,_0x5368bb),{'proactiveActions':_0x807904,'alignment':_0x23bcce[_0x2255('0x10a')],'verticalAlignment':_0x23bcce[_0x2255('0x10b')],'div_color':_0x23bcce[_0x2255('0x10c')],'labelText':_0x23bcce['labelText'],'text_color':_0x23bcce[_0x2255('0x10d')],'text_button_color':_0x23bcce[_0x2255('0x10e')],'button_color':_0x23bcce[_0x2255('0x10f')],'background_color':_0x23bcce['backgroundColor'],'hideWhenOffline':_0x23bcce[_0x2255('0x110')],'intervalId':_0x23bcce[_0x2255('0x111')],'isDevelopment':_0x2ee95b,'chatVersion':_0x595ebb}));})[_0x2255('0x44')](handleError(_0x362354,null));};exports[_0x2255('0x112')]=function(_0x2abd15,_0x91fb01){var _0x9f1941=_0x2abd15[_0x2255('0x45')]['id'];var _0x533840=_0x2abd15[_0x2255('0x4a')];var _0x166f9d=0xc8;var _0x13f4f8=null;return db[_0x2255('0xcd')][_0x2255('0xce')]({'isolationLevel':db[_0x2255('0xcd')][_0x2255('0x113')][_0x2255('0x114')]['READ_COMMITTED']},function(_0x22bf0e){return db[_0x2255('0x2d')]['findOne']({'where':{'id':_0x9f1941},'transaction':_0x22bf0e})[_0x2255('0x13')](function(_0x104273){if(_0x104273){return db[_0x2255('0x92')][_0x2255('0x25')]({'where':{'ChatWebsiteId':_0x9f1941},'transaction':_0x22bf0e})[_0x2255('0x13')](function(){var _0x5399ab=_[_0x2255('0x2c')](_0x533840,function(_0x2832b9){_0x2832b9[_0x2255('0x54')]=_0x9f1941;return _0x2832b9;});return db[_0x2255('0x92')][_0x2255('0x115')](_0x5399ab,{'transaction':_0x22bf0e});});}else{_0x166f9d=0x194;_0x13f4f8=[];}});})[_0x2255('0x13')](function(){if(_0x166f9d!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x9f1941},'order':'priority'})[_0x2255('0x13')](function(_0x3c2a51){_0x13f4f8=_0x3c2a51;});}})['catch'](function(_0x2cee93){_0x166f9d=0x1f4;logger[_0x2255('0x18')](_0x2cee93[_0x2255('0x116')]);if(_0x2cee93[_0x2255('0x27')]){delete _0x2cee93['name'];}_0x13f4f8=_0x2cee93;})['finally'](function(){if(_0x13f4f8===null){_0x91fb01[_0x2255('0x26')](_0x166f9d);}else{if(_0x166f9d===0x1f4){_0x91fb01[_0x2255('0x1b')](_0x166f9d)[_0x2255('0x28')](_0x13f4f8);}else{_0x91fb01['status'](_0x166f9d)[_0x2255('0x1d')](_0x13f4f8);}}});};exports['getApplications']=function(_0x341018,_0x3445b9){var _0x554170={};var _0x4c8a7a={};var _0x58d146;var _0x44308a;return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x341018[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x3445b9,null))[_0x2255('0x13')](function(_0x4012e0){if(_0x4012e0){_0x58d146=_0x4012e0;_0x4c8a7a['model']=_[_0x2255('0x46')](db[_0x2255('0x92')][_0x2255('0x47')]);_0x4c8a7a[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x341018[_0x2255('0x2f')]);_0x4c8a7a[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x4c8a7a[_0x2255('0x31')],_0x4c8a7a[_0x2255('0x2f')]);_0x554170[_0x2255('0x33')]=_['intersection'](_0x4c8a7a[_0x2255('0x31')],qs[_0x2255('0x32')](_0x341018['query'][_0x2255('0x32')]));_0x554170[_0x2255('0x33')]=_0x554170['attributes'][_0x2255('0x34')]?_0x554170['attributes']:_0x4c8a7a[_0x2255('0x31')];_0x554170[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x341018['query'][_0x2255('0x39')]);_0x554170['where']=qs[_0x2255('0x3b')](_['pick'](_0x341018[_0x2255('0x2f')],_0x4c8a7a[_0x2255('0x3b')]));if(_0x341018['query']['filter']){_0x554170[_0x2255('0x3a')]=_[_0x2255('0x40')](_0x554170[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x554170['attributes'],function(_0x340ba3){var _0x19592e={};_0x19592e[_0x340ba3]={'$like':'%'+_0x341018[_0x2255('0x2f')]['filter']+'%'};return _0x19592e;})});}_0x554170=_[_0x2255('0x40')]({},_0x554170,_0x341018[_0x2255('0x41')]);return _0x58d146[_0x2255('0x117')](_0x554170);}})[_0x2255('0x13')](function(_0x26de4a){if(_0x26de4a){_0x44308a=_0x26de4a['length'];if(!_0x341018[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x554170[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x341018[_0x2255('0x2f')][_0x2255('0x20')]);_0x554170[_0x2255('0x37')]=qs['offset'](_0x341018[_0x2255('0x2f')][_0x2255('0x37')]);}return _0x58d146[_0x2255('0x117')](_0x554170);}})[_0x2255('0x13')](function(_0x2017b4){if(_0x2017b4){return _0x2017b4?{'count':_0x44308a,'rows':_0x2017b4}:null;}})['then'](respondWithResult(_0x3445b9,null))[_0x2255('0x44')](handleError(_0x3445b9,null));};exports[_0x2255('0x118')]=function(_0x4b1661,_0x49fc39){return db[_0x2255('0x119')][_0x2255('0x48')]({'where':{'id':_0x4b1661[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x49fc39,null))[_0x2255('0x13')](function(_0x146b33){if(_0x146b33){return _0x146b33[_0x2255('0x118')](_0x4b1661[_0x2255('0x4a')][_0x2255('0x5b')],_[_0x2255('0x11a')](_0x4b1661[_0x2255('0x4a')],[_0x2255('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x49fc39,null))[_0x2255('0x44')](handleError(_0x49fc39,null));};exports['getProactiveActions']=function(_0x3e78e0,_0x322c49){var _0x39718c={};var _0xa35369={};var _0x4ad6ce;var _0x23cad3;return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x3e78e0[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x322c49,null))[_0x2255('0x13')](function(_0x34e27a){if(_0x34e27a){_0x4ad6ce=_0x34e27a;_0xa35369[_0x2255('0x31')]=_['keys'](db['ChatProactiveAction'][_0x2255('0x47')]);_0xa35369[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x3e78e0['query']);_0xa35369[_0x2255('0x3b')]=_['intersection'](_0xa35369[_0x2255('0x31')],_0xa35369[_0x2255('0x2f')]);_0x39718c[_0x2255('0x33')]=_[_0x2255('0x30')](_0xa35369[_0x2255('0x31')],qs[_0x2255('0x32')](_0x3e78e0[_0x2255('0x2f')][_0x2255('0x32')]));_0x39718c['attributes']=_0x39718c[_0x2255('0x33')][_0x2255('0x34')]?_0x39718c[_0x2255('0x33')]:_0xa35369[_0x2255('0x31')];_0x39718c['order']=qs['sort'](_0x3e78e0[_0x2255('0x2f')]['sort']);_0x39718c[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x3e78e0[_0x2255('0x2f')],_0xa35369[_0x2255('0x3b')]));if(_0x3e78e0[_0x2255('0x2f')][_0x2255('0x3d')]){_0x39718c[_0x2255('0x3a')]=_['merge'](_0x39718c[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x39718c['attributes'],function(_0x585c7e){var _0x4b9063={};_0x4b9063[_0x585c7e]={'$like':'%'+_0x3e78e0['query'][_0x2255('0x3d')]+'%'};return _0x4b9063;})});}_0x39718c=_[_0x2255('0x40')]({},_0x39718c,_0x3e78e0['options']);return _0x4ad6ce[_0x2255('0xfa')](_0x39718c);}})[_0x2255('0x13')](function(_0x465dfe){if(_0x465dfe){_0x23cad3=_0x465dfe['length'];if(!_0x3e78e0[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x39718c[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x3e78e0[_0x2255('0x2f')]['limit']);_0x39718c[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x3e78e0[_0x2255('0x2f')][_0x2255('0x37')]);}return _0x4ad6ce[_0x2255('0xfa')](_0x39718c);}})['then'](function(_0x21170b){if(_0x21170b){return _0x21170b?{'count':_0x23cad3,'rows':_0x21170b}:null;}})[_0x2255('0x13')](respondWithResult(_0x322c49,null))[_0x2255('0x44')](handleError(_0x322c49,null));};exports[_0x2255('0x11b')]=function(_0x336144,_0x5cfd75){var _0x822924=_0x336144[_0x2255('0x2f')][_0x2255('0x11c')]===_0x2255('0x11d')?_0x2255('0x11e'):_0x2255('0x11f');return db[_0x2255('0x2d')][_0x2255('0x48')]({'attributes':['id',_0x822924],'where':{'id':_0x336144['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x5cfd75,null))[_0x2255('0x13')](function(_0x27aabe){if(_0x27aabe){var _0x11ed02=_0x27aabe[_0x822924];var _0x42270f=_0x11ed02&&_0x11ed02[_0x2255('0x120')]?_0x11ed02['items']:[];_0x5cfd75['send']({'fromKey':_[_0x2255('0x6b')](_0x11ed02[_0x2255('0x121')])?undefined:_0x11ed02[_0x2255('0x121')],'count':_0x42270f[_0x2255('0x34')],'rows':_0x42270f});}})[_0x2255('0x44')](handleError(_0x5cfd75,null));};exports[_0x2255('0x122')]=function(_0x1ee3d2,_0x261f50){var _0x456c41={'raw':![],'where':{}};var _0x2750d8={};var _0x5b7a60={'count':0x0,'rows':[]};return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x1ee3d2[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x261f50,null))['then'](function(_0x3ca90b){if(_0x3ca90b){_0x2750d8[_0x2255('0x31')]=_['keys'](db[_0x2255('0xc6')][_0x2255('0x47')]);_0x2750d8[_0x2255('0x2f')]=_['keys'](_0x1ee3d2[_0x2255('0x2f')]);_0x2750d8[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x2750d8['model'],_0x2750d8['query']);_0x456c41[_0x2255('0x33')]=_[_0x2255('0x30')](_0x2750d8[_0x2255('0x31')],qs[_0x2255('0x32')](_0x1ee3d2[_0x2255('0x2f')]['fields']));_0x456c41[_0x2255('0x33')]=_0x456c41[_0x2255('0x33')]['length']?_0x456c41[_0x2255('0x33')]:_0x2750d8[_0x2255('0x31')];if(!_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x456c41['limit']=qs[_0x2255('0x20')](_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x20')]);_0x456c41[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x1ee3d2[_0x2255('0x2f')]['offset']);}_0x456c41[_0x2255('0x38')]=qs['sort'](_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x39')]);_0x456c41[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x1ee3d2[_0x2255('0x2f')],_0x2750d8[_0x2255('0x3b')]));_0x456c41[_0x2255('0x3a')][_0x2255('0x54')]=_0x3ca90b['id'];if(_0x1ee3d2[_0x2255('0x2f')]['filter']){_0x456c41['where']=_[_0x2255('0x40')](_0x456c41[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x456c41['attributes'],function(_0x3e372b){var _0x5bac5d={};_0x5bac5d[_0x3e372b]={'$like':'%'+_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x5bac5d;})});}_0x456c41=_['merge']({},_0x456c41,_0x1ee3d2['options']);return db[_0x2255('0xc6')][_0x2255('0x1f')]({'where':_0x456c41[_0x2255('0x3a')]})['then'](function(_0x1d296c){_0x5b7a60[_0x2255('0x1f')]=_0x1d296c;if(_0x1ee3d2[_0x2255('0x2f')]['includeAll']){_0x456c41[_0x2255('0x42')]=[{'all':!![]}];}else{_0x456c41[_0x2255('0x42')]=[{'model':db[_0x2255('0x7e')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0x2255('0x123'),'required':![]}];}return db[_0x2255('0xc6')][_0x2255('0x43')](_0x456c41);})[_0x2255('0x13')](function(_0x34d838){_0x5b7a60[_0x2255('0x59')]=_0x34d838;return _0x5b7a60;});}})['then'](respondWithFilteredResult(_0x261f50,_0x456c41))[_0x2255('0x44')](handleError(_0x261f50,null));};exports[_0x2255('0x124')]=function(_0x21918b,_0x4809fa){return db['ChatWebsite'][_0x2255('0x48')]({'where':{'id':_0x21918b[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x4809fa,null))['then'](function(_0x10d997){if(_0x10d997){return _0x10d997['addAgents'](_0x21918b[_0x2255('0x4a')][_0x2255('0x5b')],_[_0x2255('0x11a')](_0x21918b[_0x2255('0x4a')],[_0x2255('0x5b'),'id'])||{})[_0x2255('0xc1')](function(_0x4b6549){for(var _0x2e7149=0x0;_0x2e7149<_0x21918b[_0x2255('0x4a')][_0x2255('0x5b')]['length'];_0x2e7149+=0x1){socket[_0x2255('0x125')](_0x2255('0x126'),{'UserId':Number(_0x21918b['body'][_0x2255('0x5b')][_0x2e7149]),'ChatWebsiteId':Number(_0x21918b['params']['id'])});}return _0x4b6549;});}})[_0x2255('0x13')](respondWithResult(_0x4809fa,null))['catch'](handleError(_0x4809fa,null));};exports[_0x2255('0x127')]=function(_0x22898b,_0x1bb465){return db['ChatWebsite'][_0x2255('0x48')]({'where':{'id':_0x22898b[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x1bb465,null))[_0x2255('0x13')](function(_0x3d7038){if(_0x3d7038){return _0x3d7038[_0x2255('0x127')](_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')])[_0x2255('0x13')](function(){if(_[_0x2255('0x128')](_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')])){for(var _0x8cc1e1=0x0;_0x8cc1e1<_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')][_0x2255('0x34')];_0x8cc1e1+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')][_0x8cc1e1]),'ChatWebsiteId':Number(_0x22898b[_0x2255('0x45')]['id'])});}}else{socket[_0x2255('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')]),'ChatWebsiteId':Number(_0x22898b[_0x2255('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x1bb465,null))[_0x2255('0x44')](handleError(_0x1bb465,null));};exports[_0x2255('0x129')]=function(_0x3c0c1a,_0x26d12a){var _0x5a0e3d={};var _0x5e3ed5={};var _0x59b888;var _0x12d18b;return db[_0x2255('0x2d')]['findOne']({'where':{'id':_0x3c0c1a['params']['id']}})['then'](handleEntityNotFound(_0x26d12a,null))[_0x2255('0x13')](function(_0x253145){if(_0x253145){_0x59b888=_0x253145;_0x5e3ed5[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0xe7')][_0x2255('0x47')]);_0x5e3ed5[_0x2255('0x2f')]=_['keys'](_0x3c0c1a[_0x2255('0x2f')]);_0x5e3ed5[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x5e3ed5[_0x2255('0x31')],_0x5e3ed5[_0x2255('0x2f')]);_0x5a0e3d[_0x2255('0x33')]=_[_0x2255('0x30')](_0x5e3ed5[_0x2255('0x31')],qs[_0x2255('0x32')](_0x3c0c1a[_0x2255('0x2f')]['fields']));_0x5a0e3d[_0x2255('0x33')]=_0x5a0e3d[_0x2255('0x33')][_0x2255('0x34')]?_0x5a0e3d['attributes']:_0x5e3ed5[_0x2255('0x31')];_0x5a0e3d[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x3c0c1a[_0x2255('0x2f')]['sort']);_0x5a0e3d[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x3c0c1a[_0x2255('0x2f')],_0x5e3ed5[_0x2255('0x3b')]));if(_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x3d')]){_0x5a0e3d[_0x2255('0x3a')]=_[_0x2255('0x40')](_0x5a0e3d[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x5a0e3d[_0x2255('0x33')],function(_0x5ec577){var _0xcd2444={};_0xcd2444[_0x5ec577]={'$like':'%'+_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0xcd2444;})});}_0x5a0e3d=_[_0x2255('0x40')]({},_0x5a0e3d,_0x3c0c1a['options']);return _0x59b888['getAgents'](_0x5a0e3d);}})[_0x2255('0x13')](function(_0x2a37f6){if(_0x2a37f6){_0x12d18b=_0x2a37f6[_0x2255('0x34')];if(!_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x5a0e3d[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x3c0c1a['query'][_0x2255('0x20')]);_0x5a0e3d[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x37')]);}return _0x59b888[_0x2255('0x129')](_0x5a0e3d);}})[_0x2255('0x13')](function(_0x31bd32){if(_0x31bd32){return _0x31bd32?{'count':_0x12d18b,'rows':_0x31bd32}:null;}})['then'](respondWithResult(_0x26d12a,null))[_0x2255('0x44')](handleError(_0x26d12a,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 7fcc331..8eb2065 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 _0x06f4=['setMaxListeners','save','emit','hook','events','../../mysqldb'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x06f4,0x136));var _0x406f=function(_0x5a41bd,_0x488422){_0x5a41bd=_0x5a41bd-0x0;var _0x1c4b84=_0x06f4[_0x5a41bd];return _0x1c4b84;};'use strict';var EventEmitter=require(_0x406f('0x0'));var ChatWebsite=require(_0x406f('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x406f('0x2')](0x0);var events={'afterCreate':_0x406f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a4ff0){return function(_0x5ed32f,_0x32abfd,_0x275c63){ChatWebsiteEvents[_0x406f('0x4')](_0x3a4ff0+':'+_0x5ed32f['id'],_0x5ed32f);ChatWebsiteEvents[_0x406f('0x4')](_0x3a4ff0,_0x5ed32f);_0x275c63(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x406f('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xbe48=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x2385fc,_0x4c17b4){var _0x5e7e2e=function(_0x2063e8){while(--_0x2063e8){_0x2385fc['push'](_0x2385fc['shift']());}};_0x5e7e2e(++_0x4c17b4);}(_0xbe48,0x121));var _0x8be4=function(_0xd80c55,_0x5866a0){_0xd80c55=_0xd80c55-0x0;var _0x5af3ff=_0xbe48[_0xd80c55];return _0x5af3ff;};'use strict';var EventEmitter=require(_0x8be4('0x0'));var ChatWebsite=require(_0x8be4('0x1'))['db'][_0x8be4('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8be4('0x3')](0x0);var events={'afterCreate':_0x8be4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3404c7){return function(_0x95e50e,_0x53fdb0,_0x191a88){ChatWebsiteEvents[_0x8be4('0x5')](_0x3404c7+':'+_0x95e50e['id'],_0x95e50e);ChatWebsiteEvents[_0x8be4('0x5')](_0x3404c7,_0x95e50e);_0x191a88(null);};}for(var e in events){if(events[_0x8be4('0x6')](e)){var event=events[e];ChatWebsite[_0x8be4('0x7')](e,emitEvent(event));}}module[_0x8be4('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index c1b01cd..26c8ce4 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 _0xc70e=['lodash','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x14dc28,_0x9e76c0){var _0x24f9b0=function(_0x2d68e3){while(--_0x2d68e3){_0x14dc28['push'](_0x14dc28['shift']());}};_0x24f9b0(++_0x9e76c0);}(_0xc70e,0xfa));var _0xec70=function(_0x3ad62c,_0x465700){_0x3ad62c=_0x3ad62c-0x0;var _0x18e4f3=_0xc70e[_0x3ad62c];return _0x18e4f3;};'use strict';var _=require(_0xec70('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xec70('0x1'));var BPromise=require(_0xec70('0x2'));var rp=require(_0xec70('0x3'));var fs=require('fs');var path=require(_0xec70('0x4'));var rimraf=require('rimraf');var config=require(_0xec70('0x5'));var attributes=require(_0xec70('0x6'));module[_0xec70('0x7')]=function(_0x5c931a,_0x409405){return _0x5c931a[_0xec70('0x8')](_0xec70('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf45b=['lodash','util','request-promise','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites'];(function(_0x1e84f2,_0x235272){var _0x59973e=function(_0x51c2ac){while(--_0x51c2ac){_0x1e84f2['push'](_0x1e84f2['shift']());}};_0x59973e(++_0x235272);}(_0xf45b,0x6c));var _0xbf45=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0xf45b[_0x4e697a];return _0x88850c;};'use strict';var _=require(_0xbf45('0x0'));var util=require(_0xbf45('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf45('0x2'));var fs=require('fs');var path=require(_0xbf45('0x3'));var rimraf=require(_0xbf45('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf45('0x5'));module['exports']=function(_0x1557aa,_0xe227c8){return _0x1557aa[_0xbf45('0x6')](_0xbf45('0x7'),attributes,{'tableName':_0xbf45('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 56f6544..c771e0c 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 _0xcfc6=['rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','lodash','util','bluebird','ioredis','../../config/logger'];(function(_0x398c23,_0x294a30){var _0x5392c0=function(_0x4dc9b3){while(--_0x4dc9b3){_0x398c23['push'](_0x398c23['shift']());}};_0x5392c0(++_0x294a30);}(_0xcfc6,0x11b));var _0x6cfc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfc6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6cfc('0x0'));var util=require(_0x6cfc('0x1'));var moment=require('moment');var BPromise=require(_0x6cfc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cfc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cfc('0x4'))(_0x6cfc('0x5'));var config=require(_0x6cfc('0x6'));var jayson=require(_0x6cfc('0x7'));var client=jayson[_0x6cfc('0x8')][_0x6cfc('0x9')]({'port':0x232a});config['redis']=_[_0x6cfc('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6cfc('0xb'))(new Redis(config[_0x6cfc('0xc')]));require(_0x6cfc('0xd'))[_0x6cfc('0xe')](socket);function respondWithRpcPromise(_0x4aee93,_0x29102b,_0x1f1320){return new BPromise(function(_0x570e53,_0x24a7fe){return client[_0x6cfc('0xf')](_0x4aee93,_0x1f1320)[_0x6cfc('0x10')](function(_0x17366d){logger['info'](_0x6cfc('0x11'),_0x29102b,'request\x20sent');logger['debug'](_0x6cfc('0x12'),_0x29102b,'request\x20sent',JSON['stringify'](_0x17366d));if(_0x17366d['error']){if(_0x17366d[_0x6cfc('0x13')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x29102b,_0x17366d['error'][_0x6cfc('0x14')]);return _0x24a7fe(_0x17366d['error'][_0x6cfc('0x14')]);}logger['error'](_0x6cfc('0x11'),_0x29102b,_0x17366d['error'][_0x6cfc('0x14')]);return _0x570e53(_0x17366d[_0x6cfc('0x13')][_0x6cfc('0x14')]);}else{logger[_0x6cfc('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x29102b,_0x6cfc('0x16'));_0x570e53(_0x17366d[_0x6cfc('0x17')][_0x6cfc('0x14')]);}})['catch'](function(_0x46a7b0){logger['error'](_0x6cfc('0x11'),_0x29102b,_0x46a7b0);_0x24a7fe(_0x46a7b0);});});}
\ No newline at end of file
+var _0x163f=['then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x30fc83,_0x5a895a){var _0xd7247b=function(_0x41ea93){while(--_0x41ea93){_0x30fc83['push'](_0x30fc83['shift']());}};_0xd7247b(++_0x5a895a);}(_0x163f,0x112));var _0xf163=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x163f[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xf163('0x0'));var util=require(_0xf163('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf163('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf163('0x3'));var logger=require(_0xf163('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf163('0x5'));var client=jayson[_0xf163('0x6')][_0xf163('0x7')]({'port':0x232a});config['redis']=_[_0xf163('0x8')](config[_0xf163('0x9')],{'host':_0xf163('0xa'),'port':0x18eb});var socket=require(_0xf163('0xb'))(new Redis(config[_0xf163('0x9')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x1e2f7c,_0x15b53e,_0x313d24){return new BPromise(function(_0x2811bc,_0x54578d){return client['request'](_0x1e2f7c,_0x313d24)[_0xf163('0xc')](function(_0x1200df){logger[_0xf163('0xd')](_0xf163('0xe'),_0x15b53e,_0xf163('0xf'));logger[_0xf163('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x15b53e,'request\x20sent',JSON['stringify'](_0x1200df));if(_0x1200df[_0xf163('0x11')]){if(_0x1200df['error'][_0xf163('0x12')]===0x1f4){logger[_0xf163('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x15b53e,_0x1200df[_0xf163('0x11')][_0xf163('0x13')]);return _0x54578d(_0x1200df[_0xf163('0x11')]['message']);}logger[_0xf163('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x15b53e,_0x1200df[_0xf163('0x11')]['message']);return _0x2811bc(_0x1200df['error'][_0xf163('0x13')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x15b53e,_0xf163('0xf'));_0x2811bc(_0x1200df[_0xf163('0x14')][_0xf163('0x13')]);}})[_0xf163('0x15')](function(_0x5a67be){logger[_0xf163('0x11')](_0xf163('0xe'),_0x15b53e,_0x5a67be);_0x54578d(_0x5a67be);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 85c6fd2..fd36c21 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 _0x7c29=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7c29,0xb6));var _0x97c2=function(_0x5eb839,_0x553a7f){_0x5eb839=_0x5eb839-0x0;var _0x3f3c71=_0x7c29[_0x5eb839];return _0x3f3c71;};'use strict';var ChatWebsiteEvents=require(_0x97c2('0x0'));var events=[_0x97c2('0x1'),_0x97c2('0x2'),'update'];function createListener(_0x4da097,_0x4899e9){return function(_0xfa655b){_0x4899e9[_0x97c2('0x3')](_0x4da097,_0xfa655b);};}function removeListener(_0x542649,_0x5a04e3){return function(){ChatWebsiteEvents[_0x97c2('0x4')](_0x542649,_0x5a04e3);};}exports[_0x97c2('0x5')]=function(_0x169ff0){for(var _0x2dfa75=0x0,_0xd2ff51=events[_0x97c2('0x6')];_0x2dfa75<_0xd2ff51;_0x2dfa75++){var _0x1f7be1=events[_0x2dfa75];var _0x3d9cec=createListener(_0x97c2('0x7')+_0x1f7be1,_0x169ff0);ChatWebsiteEvents['on'](_0x1f7be1,_0x3d9cec);}};
\ No newline at end of file
+var _0x1895=['update','emit','register','length','save'];(function(_0x4686be,_0x39f490){var _0x44ead1=function(_0x4b6bff){while(--_0x4b6bff){_0x4686be['push'](_0x4686be['shift']());}};_0x44ead1(++_0x39f490);}(_0x1895,0x108));var _0x5189=function(_0x3d790e,_0x1ecaa3){_0x3d790e=_0x3d790e-0x0;var _0xb9b79a=_0x1895[_0x3d790e];return _0xb9b79a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x5189('0x0'),'remove',_0x5189('0x1')];function createListener(_0x23b607,_0x1b16c6){return function(_0x4d267f){_0x1b16c6[_0x5189('0x2')](_0x23b607,_0x4d267f);};}function removeListener(_0x2f7750,_0x2b0395){return function(){ChatWebsiteEvents['removeListener'](_0x2f7750,_0x2b0395);};}exports[_0x5189('0x3')]=function(_0x5522e4){for(var _0x127a96=0x0,_0x71b7c6=events[_0x5189('0x4')];_0x127a96<_0x71b7c6;_0x127a96++){var _0x454abe=events[_0x127a96];var _0x8970b0=createListener('chatWebsite:'+_0x454abe,_0x5522e4);ChatWebsiteEvents['on'](_0x454abe,_0x8970b0);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 0ac670f..d3b4d49 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 _0xb37b=['offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','/:id','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getAgents','post','create','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','single','file','addLogo','join','addAvatar','server/files/images/avatars/','now','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments'];(function(_0x1dc00d,_0x456c64){var _0x1de5ce=function(_0x189848){while(--_0x189848){_0x1dc00d['push'](_0x1dc00d['shift']());}};_0x1de5ce(++_0x456c64);}(_0xb37b,0x184));var _0xbb37=function(_0x546bf7,_0x4f807f){_0x546bf7=_0x546bf7-0x0;var _0x918211=_0xb37b[_0x546bf7];return _0x918211;};'use strict';var multer=require(_0xbb37('0x0'));var util=require(_0xbb37('0x1'));var path=require(_0xbb37('0x2'));var timeout=require(_0xbb37('0x3'));var express=require('express');var router=express[_0xbb37('0x4')]();var fs_extra=require(_0xbb37('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbb37('0x6'));var controller=require('./chatWebsite.controller');router[_0xbb37('0x7')]('/',auth[_0xbb37('0x8')](),controller[_0xbb37('0x9')]);router[_0xbb37('0x7')](_0xbb37('0xa'),auth[_0xbb37('0x8')](),controller[_0xbb37('0xb')]);router[_0xbb37('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbb37('0xc')]);router[_0xbb37('0x7')](_0xbb37('0xd'),auth[_0xbb37('0x8')](),controller[_0xbb37('0xe')]);router[_0xbb37('0x7')](_0xbb37('0xf'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x10')]);router[_0xbb37('0x7')](_0xbb37('0x11'),controller[_0xbb37('0x12')]);router['get'](_0xbb37('0x13'),controller[_0xbb37('0x14')]);router[_0xbb37('0x7')](_0xbb37('0x15'),controller['getCustomerAvatar']);router['get'](_0xbb37('0x16'),controller[_0xbb37('0x17')]);router[_0xbb37('0x7')](_0xbb37('0x18'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x19')]);router[_0xbb37('0x7')](_0xbb37('0x1a'),controller[_0xbb37('0x1b')]);router['get'](_0xbb37('0x1c'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x1d')]);router[_0xbb37('0x7')](_0xbb37('0x1e'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x1f')]);router[_0xbb37('0x7')]('/:id/fields',controller[_0xbb37('0x20')]);router[_0xbb37('0x7')](_0xbb37('0x21'),auth[_0xbb37('0x8')](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0xbb37('0x8')](),controller[_0xbb37('0x22')]);router[_0xbb37('0x23')]('/',auth[_0xbb37('0x8')](),controller[_0xbb37('0x24')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xbb37('0x23')](_0xbb37('0xf'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x25')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x9fcb3a,_0x3730e1,_0x313245){_0x313245(null,path['join'](config[_0xbb37('0x27')],_0xbb37('0x28')));},'filename':function(_0x3ee6bf,_0x5d87f3,_0x31b963){_0x31b963(null,util[_0xbb37('0x29')](_0xbb37('0x2a'),Date['now'](),_0x5d87f3['originalname']));}})});router[_0xbb37('0x23')](_0xbb37('0x11'),upload[_0xbb37('0x2b')](_0xbb37('0x2c')),controller[_0xbb37('0x2d')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x42e32b,_0xf60386,_0x19139f){_0x19139f(null,path[_0xbb37('0x2e')](config[_0xbb37('0x27')],'server/files/images/avatars/'));},'filename':function(_0x436f49,_0x3fbae1,_0x2cc3c9){_0x2cc3c9(null,util[_0xbb37('0x29')](_0xbb37('0x2a'),Date['now'](),_0x3fbae1['originalname']));}})});router[_0xbb37('0x23')](_0xbb37('0x13'),upload[_0xbb37('0x2b')](_0xbb37('0x2c')),controller[_0xbb37('0x2f')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x4d6e81,_0x1f0b69,_0x3dc565){_0x3dc565(null,path[_0xbb37('0x2e')](config[_0xbb37('0x27')],_0xbb37('0x30')));},'filename':function(_0x34247a,_0x3c6251,_0x42e8a2){_0x42e8a2(null,util[_0xbb37('0x29')](_0xbb37('0x2a'),Date[_0xbb37('0x31')](),_0x3c6251[_0xbb37('0x32')]));}})});router[_0xbb37('0x23')](_0xbb37('0x15'),upload['single'](_0xbb37('0x2c')),controller[_0xbb37('0x33')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x5826f0,_0x41a587,_0x15ba78){_0x15ba78(null,path[_0xbb37('0x2e')](config[_0xbb37('0x27')],_0xbb37('0x30')));},'filename':function(_0x5b76ec,_0x4447ad,_0x4e39d4){_0x4e39d4(null,util['format']('%s-%s',Date[_0xbb37('0x31')](),_0x4447ad[_0xbb37('0x32')]));}})});router[_0xbb37('0x23')]('/:id/system_avatar',upload[_0xbb37('0x2b')](_0xbb37('0x2c')),controller[_0xbb37('0x34')]);router[_0xbb37('0x23')](_0xbb37('0x35'),controller[_0xbb37('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x1ea5f2,_0x2d9eaa,_0x52a945){const _0x933b01=path[_0xbb37('0x2e')](config[_0xbb37('0x27')],'server/files',_0xbb37('0x37'),_0xbb37('0x38'));fs_extra[_0xbb37('0x39')](_0x933b01,function(){_0x52a945(null,_0x933b01);});},'filename':function(_0x119c70,_0x57ee97,_0x84e8dd){const _0x553d9a=_0x57ee97[_0xbb37('0x32')][_0xbb37('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5133c8=path[_0xbb37('0x3b')](_0x553d9a);const _0x384408=Date['now']()+'-'+_0x553d9a['replace'](_0x5133c8,'')+_0x5133c8;_0x84e8dd(null,_0x384408);}})});router[_0xbb37('0x23')](_0xbb37('0x3c'),offlineUploadMulter[_0xbb37('0x3d')](),controller[_0xbb37('0x3e')]);router['post'](_0xbb37('0x18'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x3f')]);router[_0xbb37('0x23')](_0xbb37('0x1c'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x40')]);router[_0xbb37('0x23')](_0xbb37('0x1e'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x41')]);router[_0xbb37('0x23')](_0xbb37('0x42'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x43')]);router['put'](_0xbb37('0x44'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x45')]);router[_0xbb37('0x46')](_0xbb37('0x44'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x47')]);router[_0xbb37('0x46')](_0xbb37('0xd'),auth[_0xbb37('0x8')](),controller['removeDispositions']);router[_0xbb37('0x46')](_0xbb37('0xf'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x48')]);router[_0xbb37('0x46')](_0xbb37('0x42'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x49')]);module['exports']=router;
\ No newline at end of file
+var _0x6ad1=['getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','addAgents','/:id','update','delete','removeDispositions','removeAnswers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','describe','show','/:id/dispositions','isAuthenticated','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages'];(function(_0x17723c,_0x1ea81d){var _0x1ffbf3=function(_0x5276cd){while(--_0x5276cd){_0x17723c['push'](_0x17723c['shift']());}};_0x1ffbf3(++_0x1ea81d);}(_0x6ad1,0x14b));var _0x16ad=function(_0x47088b,_0x576c1a){_0x47088b=_0x47088b-0x0;var _0x2cf2b8=_0x6ad1[_0x47088b];return _0x2cf2b8;};'use strict';var multer=require(_0x16ad('0x0'));var util=require(_0x16ad('0x1'));var path=require(_0x16ad('0x2'));var timeout=require('connect-timeout');var express=require(_0x16ad('0x3'));var router=express[_0x16ad('0x4')]();var fs_extra=require(_0x16ad('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x16ad('0x6'));var config=require(_0x16ad('0x7'));var controller=require('./chatWebsite.controller');router[_0x16ad('0x8')]('/',auth['isAuthenticated'](),controller[_0x16ad('0x9')]);router['get'](_0x16ad('0xa'),auth['isAuthenticated'](),controller[_0x16ad('0xb')]);router[_0x16ad('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x16ad('0xc')]);router[_0x16ad('0x8')](_0x16ad('0xd'),auth[_0x16ad('0xe')](),controller['getDispositions']);router[_0x16ad('0x8')](_0x16ad('0xf'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x10')]);router[_0x16ad('0x8')](_0x16ad('0x11'),controller[_0x16ad('0x12')]);router[_0x16ad('0x8')](_0x16ad('0x13'),controller[_0x16ad('0x14')]);router[_0x16ad('0x8')](_0x16ad('0x15'),controller[_0x16ad('0x16')]);router[_0x16ad('0x8')](_0x16ad('0x17'),controller['getSystemAvatar']);router[_0x16ad('0x8')](_0x16ad('0x18'),auth['isAuthenticated'](),controller[_0x16ad('0x19')]);router[_0x16ad('0x8')](_0x16ad('0x1a'),controller[_0x16ad('0x1b')]);router[_0x16ad('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x16ad('0x1c')]);router[_0x16ad('0x8')](_0x16ad('0x1d'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x1e')]);router[_0x16ad('0x8')](_0x16ad('0x1f'),controller[_0x16ad('0x20')]);router[_0x16ad('0x8')](_0x16ad('0x21'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x22')]);router[_0x16ad('0x8')](_0x16ad('0x23'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x24')]);router[_0x16ad('0x25')]('/',auth[_0x16ad('0xe')](),controller[_0x16ad('0x26')]);router['post'](_0x16ad('0xd'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x27')]);router[_0x16ad('0x25')]('/:id/canned_answers',auth[_0x16ad('0xe')](),controller[_0x16ad('0x28')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x38ceb1,_0x334ca2,_0x5d1c5a){_0x5d1c5a(null,path[_0x16ad('0x2a')](config[_0x16ad('0x2b')],_0x16ad('0x2c')));},'filename':function(_0x2f08a4,_0x5855d4,_0x2c3ba4){_0x2c3ba4(null,util[_0x16ad('0x2d')](_0x16ad('0x2e'),Date[_0x16ad('0x2f')](),_0x5855d4[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x11'),upload[_0x16ad('0x31')]('file'),controller[_0x16ad('0x32')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x4ee843,_0x365e3c,_0x30d426){_0x30d426(null,path[_0x16ad('0x2a')](config['root'],_0x16ad('0x33')));},'filename':function(_0x4903ff,_0xe17893,_0x23024d){_0x23024d(null,util[_0x16ad('0x2d')](_0x16ad('0x2e'),Date['now'](),_0xe17893[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x13'),upload[_0x16ad('0x31')](_0x16ad('0x34')),controller[_0x16ad('0x35')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x1f054a,_0x58cb35,_0x106576){_0x106576(null,path[_0x16ad('0x2a')](config['root'],_0x16ad('0x33')));},'filename':function(_0x32574f,_0x49381b,_0x32ead5){_0x32ead5(null,util[_0x16ad('0x2d')]('%s-%s',Date['now'](),_0x49381b[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x15'),upload['single'](_0x16ad('0x34')),controller[_0x16ad('0x36')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x10d0d1,_0x3937b5,_0xb70e18){_0xb70e18(null,path[_0x16ad('0x2a')](config[_0x16ad('0x2b')],_0x16ad('0x33')));},'filename':function(_0x587a48,_0x13fac5,_0x4edfd8){_0x4edfd8(null,util[_0x16ad('0x2d')](_0x16ad('0x2e'),Date['now'](),_0x13fac5[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x17'),upload[_0x16ad('0x31')]('file'),controller[_0x16ad('0x37')]);router[_0x16ad('0x25')]('/:id/notify',controller[_0x16ad('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x53e19e,_0x23db80,_0xc7a05){const _0x1eea5e=path[_0x16ad('0x2a')](config[_0x16ad('0x2b')],_0x16ad('0x39'),_0x16ad('0x3a'),_0x16ad('0x3b'));fs_extra[_0x16ad('0x3c')](_0x1eea5e,function(){_0xc7a05(null,_0x1eea5e);});},'filename':function(_0x11b655,_0x3e9325,_0x16336b){const _0x379e1d=_0x3e9325['originalname'][_0x16ad('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5043ca=path['extname'](_0x379e1d);const _0xec53aa=Date[_0x16ad('0x2f')]()+'-'+_0x379e1d['replace'](_0x5043ca,'')+_0x5043ca;_0x16336b(null,_0xec53aa);}})});router[_0x16ad('0x25')](_0x16ad('0x3e'),offlineUploadMulter['any'](),controller[_0x16ad('0x3f')]);router['post'](_0x16ad('0x18'),auth[_0x16ad('0xe')](),controller['addInteraction']);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x16ad('0x40')]);router['post']('/:id/proactive_actions',auth[_0x16ad('0xe')](),controller[_0x16ad('0x41')]);router[_0x16ad('0x25')](_0x16ad('0x23'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x42')]);router['put'](_0x16ad('0x43'),auth['isAuthenticated'](),controller[_0x16ad('0x44')]);router[_0x16ad('0x45')](_0x16ad('0x43'),auth[_0x16ad('0xe')](),controller['destroy']);router[_0x16ad('0x45')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x16ad('0x46')]);router[_0x16ad('0x45')](_0x16ad('0xf'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x47')]);router[_0x16ad('0x45')](_0x16ad('0x23'),auth[_0x16ad('0xe')](),controller['removeAgents']);module[_0x16ad('0x48')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index b25fcda..c77850f 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2270=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','../components/auth/service'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x2270,0x180));var _0x0227=function(_0x59f62a,_0x28dfa2){_0x59f62a=_0x59f62a-0x0;var _0x402f07=_0x2270[_0x59f62a];return _0x402f07;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x0227('0x0'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x0227('0x1')]===_0x0227('0x2')||![];function clientSideLogs(_0x56e9c2,_0x13d928,_0x42bcf7){var _0x2fe042=_0x56e9c2[_0x0227('0x3')][_0x0227('0x4')](_0x0227('0x5'));if(!_0x2fe042){throw new Error(_0x0227('0x6'));}return beaverLogger[_0x0227('0x7')]({'uri':_0x0227('0x8'),'logger':_0x2fe042,'enableCors':!isProduction})(_0x56e9c2,_0x13d928,_0x42bcf7);}router[_0x0227('0x9')](auth[_0x0227('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0xafda=['get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','Router','app'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xafda,0xb0));var _0xaafd=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xafda[_0xcf4569];return _0x7fef;};var beaverLogger=require(_0xaafd('0x0'));var express=require('express');var auth=require(_0xaafd('0x1'));var config=require('../config/environment');var router=express[_0xaafd('0x2')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x1baef7,_0x276110,_0x14a3eb){var _0x2873ef=_0x1baef7[_0xaafd('0x3')][_0xaafd('0x4')](_0xaafd('0x5'));if(!_0x2873ef){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xaafd('0x6')]({'uri':'/client-logs','logger':_0x2873ef,'enableCors':!isProduction})(_0x1baef7,_0x276110,_0x14a3eb);}router[_0xaafd('0x7')](auth[_0xaafd('0x8')](),clientSideLogs);module[_0xaafd('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index bb02343..9bbf749 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 _0x242d=['exports','STRING','ENUM','AmazonAWS','Google','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x8cd627,_0x1bf5ca){var _0x7e454=function(_0x562038){while(--_0x562038){_0x8cd627['push'](_0x8cd627['shift']());}};_0x7e454(++_0x1bf5ca);}(_0x242d,0x18c));var _0xd242=function(_0x1587cd,_0x3e66c2){_0x1587cd=_0x1587cd-0x0;var _0x4ed6e5=_0x242d[_0x1587cd];return _0x4ed6e5;};'use strict';var Sequelize=require('sequelize');module[_0xd242('0x0')]={'name':{'type':Sequelize[_0xd242('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd242('0x2')](_0xd242('0x3'),_0xd242('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0xd242('0x5'))},'data1':{'type':Sequelize[_0xd242('0x1')],'comment':_0xd242('0x6')},'data2':{'type':Sequelize[_0xd242('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xd242('0x1')],'comment':_0xd242('0x7')},'data5':{'type':Sequelize[_0xd242('0x8')],'comment':_0xd242('0x9')},'data6':{'type':Sequelize['TEXT'],'comment':_0xd242('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0xbecd=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0xbecd,0x189));var _0xdbec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbecd[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xdbec('0x0'));module[_0xdbec('0x1')]={'name':{'type':Sequelize[_0xdbec('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdbec('0x3')](_0xdbec('0x4'),_0xdbec('0x5'),_0xdbec('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdbec('0x3')]('Outlook365',_0xdbec('0x7'))},'data1':{'type':Sequelize[_0xdbec('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdbec('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xdbec('0x8')},'data4':{'type':Sequelize[_0xdbec('0x2')],'comment':_0xdbec('0x9')},'data5':{'type':Sequelize[_0xdbec('0xa')],'comment':_0xdbec('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0xdbec('0xc')},'data7':{'type':Sequelize[_0xdbec('0xa')],'comment':_0xdbec('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 1f90f5e..0339688 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 _0x4e6a=['get','state','parse','from','base64','toString','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','name','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','rows','service','decryptString','data3','catch','show','params','includeAll','options','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x4e6a,0xd4));var _0xa4e6=function(_0x1b2f05,_0x497bc8){_0x1b2f05=_0x1b2f05-0x0;var _0x2ef85b=_0x4e6a[_0x1b2f05];return _0x2ef85b;};'use strict';var _=require(_0xa4e6('0x0'));var Redis=require('ioredis');var qs=require(_0xa4e6('0x1'));var encryptor=require(_0xa4e6('0x2'));var config=require(_0xa4e6('0x3'));var logger=require(_0xa4e6('0x4'))(_0xa4e6('0x5'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0xa4e6('0x6')](config[_0xa4e6('0x7')],{'host':_0xa4e6('0x8'),'port':0x18eb});var socket=require(_0xa4e6('0x9'))(new Redis(config[_0xa4e6('0x7')]));var redis=new Redis(config[_0xa4e6('0x7')]);function respondWithStatusCode(_0x5560de,_0x2e81b3){_0x2e81b3=_0x2e81b3||0xcc;return function(_0x105f63){if(_0x105f63){return _0x5560de['sendStatus'](_0x2e81b3);}return _0x5560de[_0xa4e6('0xa')](_0x2e81b3)[_0xa4e6('0xb')]();};}function respondWithResult(_0x418b1b,_0xf8cf01){_0xf8cf01=_0xf8cf01||0xc8;return function(_0x43571d){if(_0x43571d){return _0x418b1b[_0xa4e6('0xa')](_0xf8cf01)[_0xa4e6('0xc')](_0x43571d);}};}function respondWithFilteredResult(_0x535184,_0xca4977){return function(_0x452eb6){if(_0x452eb6){var _0x2cd819=typeof _0xca4977['offset']==='undefined'&&typeof _0xca4977['limit']==='undefined';var _0x4f73b7=_0x452eb6[_0xa4e6('0xd')];var _0xb9b83d=_0x2cd819?0x0:_0xca4977[_0xa4e6('0xe')];var _0x12ed5a=_0x2cd819?_0x452eb6['count']:_0xca4977[_0xa4e6('0xe')]+_0xca4977[_0xa4e6('0xf')];var _0x2517ea;if(_0x12ed5a>=_0x4f73b7){_0x12ed5a=_0x4f73b7;_0x2517ea=0xc8;}else{_0x2517ea=0xce;}_0x535184[_0xa4e6('0xa')](_0x2517ea);return _0x535184[_0xa4e6('0x10')](_0xa4e6('0x11'),_0xb9b83d+'-'+_0x12ed5a+'/'+_0x4f73b7)[_0xa4e6('0xc')](_0x452eb6);}return null;};}function saveUpdates(_0x3961ba){return function(_0x4c8690){if(_0x4c8690){return _0x4c8690[_0xa4e6('0x12')](_0x3961ba)[_0xa4e6('0x13')](function(_0x394794){return _0x394794;});}return null;};}function removeEntity(_0x5e1448){return function(_0x3405f7){if(_0x3405f7){return _0x3405f7[_0xa4e6('0x14')]()[_0xa4e6('0x13')](function(){_0x5e1448[_0xa4e6('0xa')](0xcc)[_0xa4e6('0xb')]();});}};}function handleEntityNotFound(_0x2fc4fd){return function(_0x13be0a){if(!_0x13be0a){_0x2fc4fd['sendStatus'](0x194);}return _0x13be0a;};}function handleError(_0x339f92,_0x38db86){_0x38db86=_0x38db86||0x1f4;return function(_0x5f4cf4){logger['error'](_0x5f4cf4['stack']);if(_0x5f4cf4[_0xa4e6('0x15')]){delete _0x5f4cf4['name'];}_0x339f92[_0xa4e6('0xa')](_0x38db86)['send'](_0x5f4cf4);};}function maskClientSecret(_0x40901d){return _[_0xa4e6('0x16')](_0x40901d[_0xa4e6('0x17')](0x0,0x3),0x14,'*');}exports[_0xa4e6('0x18')]=function(_0x5cbad3,_0x3c5c89){var _0x293e42={},_0x3e08a2={},_0x11fa9c={'count':0x0,'rows':[]};var _0x167435=_[_0xa4e6('0x19')](db[_0xa4e6('0x1a')][_0xa4e6('0x1b')],function(_0xba4e98){return{'name':_0xba4e98[_0xa4e6('0x1c')],'type':_0xba4e98[_0xa4e6('0x1d')][_0xa4e6('0x1e')]};});_0x3e08a2[_0xa4e6('0x1f')]=_[_0xa4e6('0x19')](_0x167435,'name');_0x3e08a2['query']=_[_0xa4e6('0x20')](_0x5cbad3['query']);_0x3e08a2[_0xa4e6('0x21')]=_[_0xa4e6('0x22')](_0x3e08a2['model'],_0x3e08a2[_0xa4e6('0x23')]);_0x293e42['attributes']=_[_0xa4e6('0x22')](_0x3e08a2[_0xa4e6('0x1f')],qs[_0xa4e6('0x24')](_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0x24')]));_0x293e42[_0xa4e6('0x25')]=_0x293e42[_0xa4e6('0x25')][_0xa4e6('0x26')]?_0x293e42[_0xa4e6('0x25')]:_0x3e08a2[_0xa4e6('0x1f')];if(!_0x5cbad3['query'][_0xa4e6('0x27')](_0xa4e6('0x28'))){_0x293e42[_0xa4e6('0xf')]=qs[_0xa4e6('0xf')](_0x5cbad3[_0xa4e6('0x23')]['limit']);_0x293e42[_0xa4e6('0xe')]=qs[_0xa4e6('0xe')](_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0xe')]);}_0x293e42[_0xa4e6('0x29')]=qs['sort'](_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0x2a')]);_0x293e42[_0xa4e6('0x2b')]=qs['filters'](_[_0xa4e6('0x2c')](_0x5cbad3[_0xa4e6('0x23')],_0x3e08a2[_0xa4e6('0x21')]),_0x167435);if(_0x5cbad3['query']['filter']){_0x293e42[_0xa4e6('0x2b')]=_[_0xa4e6('0x2d')](_0x293e42['where'],{'$or':_[_0xa4e6('0x19')](_0x167435,function(_0x3a95ef){if(_0x3a95ef['type']!==_0xa4e6('0x2e')){var _0x584e82={};_0x584e82[_0x3a95ef[_0xa4e6('0x15')]]={'$like':'%'+_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0x2f')]+'%'};return _0x584e82;}})});}_0x293e42=_[_0xa4e6('0x2d')]({},_0x293e42,_0x5cbad3['options']);var _0x3aa101={'where':_0x293e42[_0xa4e6('0x2b')]};return db['CloudProvider'][_0xa4e6('0xd')](_0x3aa101)[_0xa4e6('0x13')](function(_0x14796e){_0x11fa9c['count']=_0x14796e;if(_0x5cbad3[_0xa4e6('0x23')]['includeAll']){_0x293e42[_0xa4e6('0x30')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x293e42);})[_0xa4e6('0x13')](function(_0x38f7c9){_0x11fa9c[_0xa4e6('0x31')]=_[_0xa4e6('0x19')](_0x38f7c9,function(_0x9e4f63){if(_0x9e4f63[_0xa4e6('0x32')]==='MicrosoftAzure'){var _0x3ce548=encryptor[_0xa4e6('0x33')](_0x9e4f63[_0xa4e6('0x34')]);_0x9e4f63[_0xa4e6('0x34')]=maskClientSecret(_0x3ce548);}return _0x9e4f63;});return _0x11fa9c;})[_0xa4e6('0x13')](respondWithFilteredResult(_0x3c5c89,_0x293e42))[_0xa4e6('0x35')](handleError(_0x3c5c89,null));};exports[_0xa4e6('0x36')]=function(_0x194b77,_0x58b9d3){var _0x1cb42f={'raw':!![],'where':{'id':_0x194b77[_0xa4e6('0x37')]['id']}},_0x3ace79={};_0x3ace79[_0xa4e6('0x1f')]=_[_0xa4e6('0x20')](db[_0xa4e6('0x1a')][_0xa4e6('0x1b')]);_0x3ace79['query']=_['keys'](_0x194b77[_0xa4e6('0x23')]);_0x3ace79[_0xa4e6('0x21')]=_[_0xa4e6('0x22')](_0x3ace79[_0xa4e6('0x1f')],_0x3ace79['query']);_0x1cb42f[_0xa4e6('0x25')]=_[_0xa4e6('0x22')](_0x3ace79['model'],qs[_0xa4e6('0x24')](_0x194b77[_0xa4e6('0x23')]['fields']));_0x1cb42f[_0xa4e6('0x25')]=_0x1cb42f[_0xa4e6('0x25')][_0xa4e6('0x26')]?_0x1cb42f[_0xa4e6('0x25')]:_0x3ace79[_0xa4e6('0x1f')];if(_0x194b77[_0xa4e6('0x23')][_0xa4e6('0x38')]){_0x1cb42f[_0xa4e6('0x30')]=[{'all':!![]}];}_0x1cb42f=_[_0xa4e6('0x2d')]({},_0x1cb42f,_0x194b77[_0xa4e6('0x39')]);return db[_0xa4e6('0x1a')][_0xa4e6('0x3a')](_0x1cb42f)['then'](handleEntityNotFound(_0x58b9d3,null))[_0xa4e6('0x13')](function(_0x230d79){if(_0x230d79[_0xa4e6('0x32')]===_0xa4e6('0x3b')){var _0x32f282=encryptor[_0xa4e6('0x33')](_0x230d79[_0xa4e6('0x34')]);_0x230d79['data3']=maskClientSecret(_0x32f282);}return _0x230d79;})['then'](respondWithResult(_0x58b9d3,null))[_0xa4e6('0x35')](handleError(_0x58b9d3,null));};exports[_0xa4e6('0x3c')]=function(_0x42ebed,_0x51aa9d){if(!_0x42ebed[_0xa4e6('0x3d')][_0xa4e6('0x15')])throw new Error(_0xa4e6('0x3e'));if(!_0x42ebed['body'][_0xa4e6('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x12dea5=db[_0xa4e6('0x1a')][_0xa4e6('0x1b')][_0xa4e6('0x32')]['values'];if(!_0x12dea5[_0xa4e6('0x3f')](_0x42ebed[_0xa4e6('0x3d')][_0xa4e6('0x32')]))throw new Error(_0xa4e6('0x40')+_0x12dea5[_0xa4e6('0x41')](',\x20'));if(_0x42ebed['body']['service']===_0xa4e6('0x3b')&&_0x42ebed[_0xa4e6('0x3d')][_0xa4e6('0x34')]){_0x42ebed['body']['data3']=encryptor['encryptString'](_0x42ebed['body'][_0xa4e6('0x34')]);}return db[_0xa4e6('0x1a')][_0xa4e6('0x3c')](_0x42ebed[_0xa4e6('0x3d')],{})[_0xa4e6('0x13')](respondWithResult(_0x51aa9d,0xc9))[_0xa4e6('0x35')](handleError(_0x51aa9d,null));};exports[_0xa4e6('0x12')]=function(_0x4076f4,_0x50b423){if(_0x4076f4[_0xa4e6('0x3d')]['id']){delete _0x4076f4['body']['id'];}return db[_0xa4e6('0x1a')][_0xa4e6('0x3a')]({'where':{'id':_0x4076f4[_0xa4e6('0x37')]['id']}})[_0xa4e6('0x13')](handleEntityNotFound(_0x50b423,null))[_0xa4e6('0x13')](function(_0x56c0f3){if(_0x56c0f3[_0xa4e6('0x32')]==='MicrosoftAzure'&&_0x4076f4[_0xa4e6('0x3d')][_0xa4e6('0x34')]){_0x4076f4[_0xa4e6('0x3d')]['data3']=encryptor[_0xa4e6('0x42')](_0x4076f4['body'][_0xa4e6('0x34')]);}return _0x56c0f3;})[_0xa4e6('0x13')](saveUpdates(_0x4076f4[_0xa4e6('0x3d')],null))['then'](respondWithResult(_0x50b423,null))[_0xa4e6('0x35')](handleError(_0x50b423,null));};exports[_0xa4e6('0x14')]=function(_0x503577,_0x32eb78){return db[_0xa4e6('0x1a')][_0xa4e6('0x3a')]({'where':{'id':_0x503577[_0xa4e6('0x37')]['id']}})[_0xa4e6('0x13')](handleEntityNotFound(_0x32eb78,null))[_0xa4e6('0x13')](removeEntity(_0x32eb78,null))[_0xa4e6('0x35')](handleError(_0x32eb78,null));};exports[_0xa4e6('0x43')]=function(_0x3e2603,_0x41994d){return db[_0xa4e6('0x1a')][_0xa4e6('0x44')]({'where':{'id':_0x3e2603[_0xa4e6('0x37')]['id']},'raw':!![]})[_0xa4e6('0x13')](function(_0x3aa3f7){if(!_0x3aa3f7)return _0x41994d[_0xa4e6('0x45')](0x194);return{'url':oauth[_0xa4e6('0x46')](_0x3aa3f7,_0x3e2603['user']['id'])};})[_0xa4e6('0x13')](respondWithResult(_0x41994d,null))[_0xa4e6('0x35')](handleError(_0x41994d,null));};exports[_0xa4e6('0x47')]=function(_0x5c414a,_0x23b43e){var _0x52a2ae=_0x5c414a[_0xa4e6('0x3d')];var _0x533ca9;var _0x16f4f7;if(_0x52a2ae[_0xa4e6('0x48')])throw _0x52a2ae;redis[_0xa4e6('0x49')](_0x52a2ae[_0xa4e6('0x4a')])[_0xa4e6('0x13')](function(_0x16a59a){if(!_0x16a59a)throw new Error('Invalid\x20state\x20parameter');_0x533ca9=JSON[_0xa4e6('0x4b')](_0x16a59a);var _0x5960b4=Buffer[_0xa4e6('0x4c')](_0x52a2ae['state'],_0xa4e6('0x4d'))[_0xa4e6('0x4e')]('ascii');_0x16f4f7=JSON['parse'](_0x5960b4);if(!oauth[_0xa4e6('0x4f')](_0x52a2ae[_0xa4e6('0x50')],_0x533ca9['oauth2Claims']))throw new Error(_0xa4e6('0x51'));redis[_0xa4e6('0x52')](_0x52a2ae[_0xa4e6('0x4a')]);return oauth['getOauth2MicrosoftAccessToken'](_0x52a2ae['code'],_0x533ca9);})[_0xa4e6('0x13')](function(_0xd8a061){_0x533ca9[_0xa4e6('0x53')]=_0xd8a061[_0xa4e6('0x54')];_0x533ca9[_0xa4e6('0x55')]=_0xd8a061[_0xa4e6('0x56')];return db[_0xa4e6('0x1a')][_0xa4e6('0x12')]({'data5':_0x533ca9['data5'],'data6':_0x533ca9[_0xa4e6('0x55')]},{'where':{'id':_0x533ca9['id']}});})[_0xa4e6('0x13')](function(){oauth['startRefreshInterval'](_0x533ca9);socket['emit'](_0xa4e6('0x57'),{'id':_0x16f4f7['id']});return;})[_0xa4e6('0x13')](respondWithStatusCode(_0x23b43e,null))[_0xa4e6('0x35')](function(_0x14a453){if(_0x16f4f7){socket[_0xa4e6('0x58')](_0xa4e6('0x59'),{'id':_0x16f4f7['id']});}if(!_0x533ca9){logger['error'](_0xa4e6('0x5a'),_0x14a453);return _0x23b43e[_0xa4e6('0xa')](0x1f4)[_0xa4e6('0x5b')](_0x14a453[_0xa4e6('0x5c')]);}logger['error'](_0xa4e6('0x5d'),_0x533ca9['id'],JSON[_0xa4e6('0x5e')](_0x14a453));});};
\ No newline at end of file
+var _0x01c6=['user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','json','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','CloudProvider','include','find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','encryptString','create','params','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0x01c6,0x1f1));var _0x601c=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x01c6[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x601c('0x0'));var Redis=require(_0x601c('0x1'));var qs=require(_0x601c('0x2'));var encryptor=require(_0x601c('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require(_0x601c('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x601c('0x5')]=_[_0x601c('0x6')](config[_0x601c('0x5')],{'host':_0x601c('0x7'),'port':0x18eb});var socket=require(_0x601c('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x601c('0x5')]);function respondWithStatusCode(_0x2fdafc,_0x25ce77){_0x25ce77=_0x25ce77||0xcc;return function(_0x4ca925){if(_0x4ca925){return _0x2fdafc[_0x601c('0x9')](_0x25ce77);}return _0x2fdafc[_0x601c('0xa')](_0x25ce77)[_0x601c('0xb')]();};}function respondWithResult(_0x21d59b,_0xdcc448){_0xdcc448=_0xdcc448||0xc8;return function(_0x2a2eca){if(_0x2a2eca){return _0x21d59b['status'](_0xdcc448)['json'](_0x2a2eca);}};}function respondWithFilteredResult(_0x146961,_0x3f6ca8){return function(_0x3f2335){if(_0x3f2335){var _0x65b796=typeof _0x3f6ca8[_0x601c('0xc')]===_0x601c('0xd')&&typeof _0x3f6ca8[_0x601c('0xe')]===_0x601c('0xd');var _0xf3e47d=_0x3f2335[_0x601c('0xf')];var _0xfb350c=_0x65b796?0x0:_0x3f6ca8[_0x601c('0xc')];var _0x139c81=_0x65b796?_0x3f2335['count']:_0x3f6ca8[_0x601c('0xc')]+_0x3f6ca8[_0x601c('0xe')];var _0x4e4e46;if(_0x139c81>=_0xf3e47d){_0x139c81=_0xf3e47d;_0x4e4e46=0xc8;}else{_0x4e4e46=0xce;}_0x146961[_0x601c('0xa')](_0x4e4e46);return _0x146961[_0x601c('0x10')]('Content-Range',_0xfb350c+'-'+_0x139c81+'/'+_0xf3e47d)[_0x601c('0x11')](_0x3f2335);}return null;};}function saveUpdates(_0x42cc21){return function(_0x507b47){if(_0x507b47){return _0x507b47[_0x601c('0x12')](_0x42cc21)[_0x601c('0x13')](function(_0x3a32c8){return _0x3a32c8;});}return null;};}function removeEntity(_0x326dfb){return function(_0x49a356){if(_0x49a356){return _0x49a356['destroy']()[_0x601c('0x13')](function(){_0x326dfb['status'](0xcc)[_0x601c('0xb')]();});}};}function handleEntityNotFound(_0x424eff){return function(_0x151eca){if(!_0x151eca){_0x424eff[_0x601c('0x9')](0x194);}return _0x151eca;};}function handleError(_0xd22a37,_0x2edb6d){_0x2edb6d=_0x2edb6d||0x1f4;return function(_0x4721f3){logger[_0x601c('0x14')](_0x4721f3[_0x601c('0x15')]);if(_0x4721f3[_0x601c('0x16')]){delete _0x4721f3[_0x601c('0x16')];}_0xd22a37[_0x601c('0xa')](_0x2edb6d)[_0x601c('0x17')](_0x4721f3);};}function maskClientSecret(_0x20c8c0){return _['padEnd'](_0x20c8c0['slice'](0x0,0x3),0x14,'*');}exports[_0x601c('0x18')]=function(_0x55a0c2,_0x5b9451){var _0x3bc9df={},_0xc456ee={},_0x34b54b={'count':0x0,'rows':[]};var _0x13f136=_[_0x601c('0x19')](db['CloudProvider'][_0x601c('0x1a')],function(_0x3c471c){return{'name':_0x3c471c[_0x601c('0x1b')],'type':_0x3c471c['type']['key']};});_0xc456ee[_0x601c('0x1c')]=_[_0x601c('0x19')](_0x13f136,_0x601c('0x16'));_0xc456ee[_0x601c('0x1d')]=_[_0x601c('0x1e')](_0x55a0c2[_0x601c('0x1d')]);_0xc456ee[_0x601c('0x1f')]=_[_0x601c('0x20')](_0xc456ee[_0x601c('0x1c')],_0xc456ee[_0x601c('0x1d')]);_0x3bc9df[_0x601c('0x21')]=_[_0x601c('0x20')](_0xc456ee[_0x601c('0x1c')],qs[_0x601c('0x22')](_0x55a0c2[_0x601c('0x1d')]['fields']));_0x3bc9df[_0x601c('0x21')]=_0x3bc9df[_0x601c('0x21')]['length']?_0x3bc9df['attributes']:_0xc456ee[_0x601c('0x1c')];if(!_0x55a0c2['query'][_0x601c('0x23')](_0x601c('0x24'))){_0x3bc9df['limit']=qs['limit'](_0x55a0c2[_0x601c('0x1d')][_0x601c('0xe')]);_0x3bc9df[_0x601c('0xc')]=qs['offset'](_0x55a0c2[_0x601c('0x1d')][_0x601c('0xc')]);}_0x3bc9df[_0x601c('0x25')]=qs['sort'](_0x55a0c2['query'][_0x601c('0x26')]);_0x3bc9df[_0x601c('0x27')]=qs[_0x601c('0x1f')](_[_0x601c('0x28')](_0x55a0c2[_0x601c('0x1d')],_0xc456ee[_0x601c('0x1f')]),_0x13f136);if(_0x55a0c2[_0x601c('0x1d')][_0x601c('0x29')]){_0x3bc9df['where']=_[_0x601c('0x2a')](_0x3bc9df['where'],{'$or':_[_0x601c('0x19')](_0x13f136,function(_0x3fb16a){if(_0x3fb16a[_0x601c('0x2b')]!=='VIRTUAL'){var _0x1740c7={};_0x1740c7[_0x3fb16a[_0x601c('0x16')]]={'$like':'%'+_0x55a0c2[_0x601c('0x1d')][_0x601c('0x29')]+'%'};return _0x1740c7;}})});}_0x3bc9df=_[_0x601c('0x2a')]({},_0x3bc9df,_0x55a0c2[_0x601c('0x2c')]);var _0x2fd9d7={'where':_0x3bc9df[_0x601c('0x27')]};return db['CloudProvider']['count'](_0x2fd9d7)[_0x601c('0x13')](function(_0x209013){_0x34b54b['count']=_0x209013;if(_0x55a0c2[_0x601c('0x1d')][_0x601c('0x2d')]){_0x3bc9df['include']=[{'all':!![]}];}return db['CloudProvider'][_0x601c('0x2e')](_0x3bc9df);})[_0x601c('0x13')](function(_0xd08749){_0x34b54b[_0x601c('0x2f')]=_['map'](_0xd08749,function(_0x17f8d0){if(_0x17f8d0[_0x601c('0x30')]===_0x601c('0x31')){var _0x2f84f3=encryptor[_0x601c('0x32')](_0x17f8d0[_0x601c('0x33')]);_0x17f8d0[_0x601c('0x33')]=maskClientSecret(_0x2f84f3);}return _0x17f8d0;});return _0x34b54b;})[_0x601c('0x13')](respondWithFilteredResult(_0x5b9451,_0x3bc9df))[_0x601c('0x34')](handleError(_0x5b9451,null));};exports[_0x601c('0x35')]=function(_0x3d6506,_0x39815b){var _0x4d8af6={'raw':!![],'where':{'id':_0x3d6506['params']['id']}},_0x4e4311={};_0x4e4311[_0x601c('0x1c')]=_[_0x601c('0x1e')](db[_0x601c('0x36')][_0x601c('0x1a')]);_0x4e4311[_0x601c('0x1d')]=_[_0x601c('0x1e')](_0x3d6506['query']);_0x4e4311[_0x601c('0x1f')]=_[_0x601c('0x20')](_0x4e4311[_0x601c('0x1c')],_0x4e4311[_0x601c('0x1d')]);_0x4d8af6[_0x601c('0x21')]=_[_0x601c('0x20')](_0x4e4311['model'],qs[_0x601c('0x22')](_0x3d6506[_0x601c('0x1d')][_0x601c('0x22')]));_0x4d8af6[_0x601c('0x21')]=_0x4d8af6[_0x601c('0x21')]['length']?_0x4d8af6[_0x601c('0x21')]:_0x4e4311[_0x601c('0x1c')];if(_0x3d6506[_0x601c('0x1d')][_0x601c('0x2d')]){_0x4d8af6[_0x601c('0x37')]=[{'all':!![]}];}_0x4d8af6=_[_0x601c('0x2a')]({},_0x4d8af6,_0x3d6506['options']);return db[_0x601c('0x36')][_0x601c('0x38')](_0x4d8af6)[_0x601c('0x13')](handleEntityNotFound(_0x39815b,null))[_0x601c('0x13')](function(_0x438f55){if(_0x438f55[_0x601c('0x30')]===_0x601c('0x31')){var _0x2a17e2=encryptor['decryptString'](_0x438f55[_0x601c('0x33')]);_0x438f55[_0x601c('0x33')]=maskClientSecret(_0x2a17e2);}return _0x438f55;})[_0x601c('0x13')](respondWithResult(_0x39815b,null))[_0x601c('0x34')](handleError(_0x39815b,null));};exports['create']=function(_0x16915e,_0x1337a4){if(!_0x16915e[_0x601c('0x39')][_0x601c('0x16')])throw new Error(_0x601c('0x3a'));if(!_0x16915e[_0x601c('0x39')][_0x601c('0x30')])throw new Error(_0x601c('0x3b'));var _0x56fcc7=db[_0x601c('0x36')][_0x601c('0x1a')]['service']['values'];if(!_0x56fcc7['includes'](_0x16915e[_0x601c('0x39')][_0x601c('0x30')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x56fcc7['join'](',\x20'));if(_0x16915e[_0x601c('0x39')][_0x601c('0x30')]==='MicrosoftAzure'&&_0x16915e[_0x601c('0x39')]['data3']){_0x16915e[_0x601c('0x39')][_0x601c('0x33')]=encryptor[_0x601c('0x3c')](_0x16915e[_0x601c('0x39')]['data3']);}return db[_0x601c('0x36')][_0x601c('0x3d')](_0x16915e[_0x601c('0x39')],{})['then'](respondWithResult(_0x1337a4,0xc9))[_0x601c('0x34')](handleError(_0x1337a4,null));};exports[_0x601c('0x12')]=function(_0x3d0c66,_0x2db8b6){if(_0x3d0c66['body']['id']){delete _0x3d0c66[_0x601c('0x39')]['id'];}return db[_0x601c('0x36')][_0x601c('0x38')]({'where':{'id':_0x3d0c66[_0x601c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2db8b6,null))[_0x601c('0x13')](function(_0x47476b){if(_0x47476b[_0x601c('0x30')]===_0x601c('0x31')&&_0x3d0c66[_0x601c('0x39')][_0x601c('0x33')]){_0x3d0c66[_0x601c('0x39')][_0x601c('0x33')]=encryptor[_0x601c('0x3c')](_0x3d0c66[_0x601c('0x39')][_0x601c('0x33')]);}return _0x47476b;})[_0x601c('0x13')](saveUpdates(_0x3d0c66[_0x601c('0x39')],null))[_0x601c('0x13')](respondWithResult(_0x2db8b6,null))[_0x601c('0x34')](handleError(_0x2db8b6,null));};exports[_0x601c('0x3f')]=function(_0x2670a3,_0x33eb98){return db[_0x601c('0x36')][_0x601c('0x38')]({'where':{'id':_0x2670a3[_0x601c('0x3e')]['id']}})[_0x601c('0x13')](handleEntityNotFound(_0x33eb98,null))['then'](removeEntity(_0x33eb98,null))[_0x601c('0x34')](handleError(_0x33eb98,null));};exports[_0x601c('0x40')]=function(_0x3152d3,_0x5acaf9){return db['CloudProvider'][_0x601c('0x41')]({'where':{'id':_0x3152d3['params']['id']},'raw':!![]})[_0x601c('0x13')](function(_0x5cef5c){if(!_0x5cef5c)return _0x5acaf9[_0x601c('0x9')](0x194);return{'url':oauth[_0x601c('0x42')](_0x5cef5c,_0x3152d3[_0x601c('0x43')]['id'])};})[_0x601c('0x13')](respondWithResult(_0x5acaf9,null))[_0x601c('0x34')](handleError(_0x5acaf9,null));};exports[_0x601c('0x44')]=function(_0x3341dd,_0x59fe04){var _0x57f27a=_0x3341dd['body'];var _0x5d0433;var _0x718ada;if(_0x57f27a[_0x601c('0x14')])throw _0x57f27a;redis[_0x601c('0x45')](_0x57f27a[_0x601c('0x46')])['then'](function(_0x30b578){if(!_0x30b578)throw new Error(_0x601c('0x47'));_0x5d0433=JSON[_0x601c('0x48')](_0x30b578);var _0x449171=Buffer[_0x601c('0x49')](_0x57f27a[_0x601c('0x46')],_0x601c('0x4a'))[_0x601c('0x4b')](_0x601c('0x4c'));_0x718ada=JSON[_0x601c('0x48')](_0x449171);if(!oauth['isValidIdToken'](_0x57f27a[_0x601c('0x4d')],_0x5d0433[_0x601c('0x4e')]))throw new Error(_0x601c('0x4f'));redis[_0x601c('0x50')](_0x57f27a[_0x601c('0x46')]);return oauth[_0x601c('0x51')](_0x57f27a['code'],_0x5d0433);})[_0x601c('0x13')](function(_0x286aa2){_0x5d0433[_0x601c('0x52')]=_0x286aa2[_0x601c('0x53')];_0x5d0433['data6']=_0x286aa2[_0x601c('0x54')];return db[_0x601c('0x36')][_0x601c('0x12')]({'data5':_0x5d0433[_0x601c('0x52')],'data6':_0x5d0433[_0x601c('0x55')]},{'where':{'id':_0x5d0433['id']}});})[_0x601c('0x13')](function(){oauth[_0x601c('0x56')](_0x5d0433);socket[_0x601c('0x57')](_0x601c('0x58'),{'id':_0x718ada['id']});return;})[_0x601c('0x13')](respondWithStatusCode(_0x59fe04,null))[_0x601c('0x34')](function(_0x576b29){if(_0x718ada){socket['emit'](_0x601c('0x59'),{'id':_0x718ada['id']});}if(!_0x5d0433){logger[_0x601c('0x14')](_0x601c('0x5a'),_0x576b29);return _0x59fe04[_0x601c('0xa')](0x1f4)[_0x601c('0x17')](_0x576b29[_0x601c('0x5b')]);}logger[_0x601c('0x14')](_0x601c('0x5c'),_0x5d0433['id'],JSON[_0x601c('0x5d')](_0x576b29));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 0c73291..a3ada3c 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 _0x84a9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','CloudProvider','cloud_providers'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x84a9,0x180));var _0x984a=function(_0x4905a0,_0x22dbe6){_0x4905a0=_0x4905a0-0x0;var _0x3e6f4d=_0x84a9[_0x4905a0];return _0x3e6f4d;};'use strict';var _=require(_0x984a('0x0'));var util=require(_0x984a('0x1'));var logger=require(_0x984a('0x2'))(_0x984a('0x3'));var moment=require(_0x984a('0x4'));var BPromise=require(_0x984a('0x5'));var rp=require(_0x984a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x984a('0x7'));var config=require(_0x984a('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x984a('0x9')]=function(_0x592fff,_0x4e18a6){return _0x592fff['define'](_0x984a('0xa'),attributes,{'tableName':_0x984a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb9af=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cloud_providers','lodash'];(function(_0x2ba022,_0x59cad3){var _0x2bc6ca=function(_0x4cc435){while(--_0x4cc435){_0x2ba022['push'](_0x2ba022['shift']());}};_0x2bc6ca(++_0x59cad3);}(_0xb9af,0xb5));var _0xfb9a=function(_0x5f41de,_0x1d3e30){_0x5f41de=_0x5f41de-0x0;var _0x12cbf7=_0xb9af[_0x5f41de];return _0x12cbf7;};'use strict';var _=require(_0xfb9a('0x0'));var util=require(_0xfb9a('0x1'));var logger=require(_0xfb9a('0x2'))(_0xfb9a('0x3'));var moment=require(_0xfb9a('0x4'));var BPromise=require(_0xfb9a('0x5'));var rp=require(_0xfb9a('0x6'));var fs=require('fs');var path=require(_0xfb9a('0x7'));var rimraf=require(_0xfb9a('0x8'));var config=require(_0xfb9a('0x9'));var attributes=require('./cloudProvider.attributes');module[_0xfb9a('0xa')]=function(_0x4c9e73,_0x38f2b2){return _0x4c9e73[_0xfb9a('0xb')]('CloudProvider',attributes,{'tableName':_0xfb9a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 7d4578b..f745d1d 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15ba=['data2','then','data5','access_token','refresh_token','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','all','inspect','error','exports','lodash','crypto','jsonwebtoken','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','localhost','redis','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','push','data7','/.default','Outlook365','Dynamics365','{TENANT_ID}','code','stringify','toString','base64','randomBytes','hex','data4','response_mode','form_post','scope','state','nonce','login','key','join','oauth2Claims','replace','oauth2/','set','payload','issuer','aud','audience','isAfter','unix','resolve','CloudProvider','findOne','data6','data1','decryptString'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x15ba,0x120));var _0xa15b=function(_0x1b26ac,_0x5ea577){_0x1b26ac=_0x1b26ac-0x0;var _0x2d88ec=_0x15ba[_0x1b26ac];return _0x2d88ec;};'use strict';var _=require(_0xa15b('0x0'));var crypto=require(_0xa15b('0x1'));var jwt=require(_0xa15b('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xa15b('0x3'));var util=require(_0xa15b('0x4'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xa15b('0x5'))(_0xa15b('0x6'));var schedule=require(_0xa15b('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa15b('0x8'),'port':0x18eb});var redis=new Redis(config[_0xa15b('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xa15b('0xa'),_0xa15b('0xb'),_0xa15b('0xc'),_0xa15b('0xd'),_0xa15b('0xe'),_0xa15b('0xf'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xa15b('0xa'),_0xa15b('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0xa15b('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0xa15b('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x57fc68){var _0x4bf462=_[_0xa15b('0x12')](AZURE_AUTH_SCOPES[_0x57fc68[_0xa15b('0x13')]]);if(_0x57fc68['type']==='Dynamics365')_0x4bf462[_0xa15b('0x14')](_0x57fc68[_0xa15b('0x15')]+_0xa15b('0x16'));return _0x4bf462['join']('\x20');}function getAccessTokenScope(_0x454148){if(_0x454148['type']===_0xa15b('0x17'))return _0xa15b('0xe');if(_0x454148[_0xa15b('0x13')]===_0xa15b('0x18'))return _0x454148[_0xa15b('0x15')]+_0xa15b('0x16');}function generateMicrosoftAuthorizationUrl(_0x4a2fa3,_0x1fd991){var _0x5903c2=MICROSOFT_AUTH_URL['replace'](_0xa15b('0x19'),_0x4a2fa3['data2']);var _0x1f491b=[_0xa15b('0x1a'),'id_token'];var _0x382127=Buffer['from'](JSON[_0xa15b('0x1b')]({'id':_0x1fd991}))[_0xa15b('0x1c')](_0xa15b('0x1d'));var _0x559aca=crypto[_0xa15b('0x1e')](0x10)[_0xa15b('0x1c')](_0xa15b('0x1f'));var _0x53b09f=getAuthorizationScopes(_0x4a2fa3);var _0x568926=[{'key':'client_id','value':_0x4a2fa3['data1']},{'key':'response_type','value':encodeURIComponent(_0x1f491b['join']('\x20'))},{'key':'redirect_uri','value':_0x4a2fa3[_0xa15b('0x20')]},{'key':_0xa15b('0x21'),'value':_0xa15b('0x22')},{'key':_0xa15b('0x23'),'value':encodeURIComponent(_0x53b09f)},{'key':_0xa15b('0x24'),'value':_0x382127},{'key':_0xa15b('0x25'),'value':_0x559aca},{'key':'prompt','value':_0xa15b('0x26')}];var _0x3ad18a=_0x5903c2+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa15b('0x12')](_0x568926,function(_0x7a9f62){return _0x7a9f62[_0xa15b('0x27')]+'='+_0x7a9f62['value'];})[_0xa15b('0x28')]('&');_0x4a2fa3[_0xa15b('0x29')]={'issuer':_0x5903c2[_0xa15b('0x2a')](_0xa15b('0x2b'),''),'audience':_0x4a2fa3['data1'],'state':_0x382127,'nonce':_0x559aca};redis[_0xa15b('0x2c')](_0x382127,JSON[_0xa15b('0x1b')](_0x4a2fa3));return _0x3ad18a;}function isValidIdToken(_0x2f993b,_0x4bb2c9){try{var _0x53f86f=jwt['decode'](_0x2f993b,{'complete':!![]});var _0x182a31=_0x53f86f[_0xa15b('0x2d')];if(_0x182a31['iss']!==_0x4bb2c9[_0xa15b('0x2e')])return![];if(_0x182a31[_0xa15b('0x2f')]!==_0x4bb2c9[_0xa15b('0x30')])return![];if(_0x182a31[_0xa15b('0x25')]!==_0x4bb2c9[_0xa15b('0x25')])return![];if(moment()[_0xa15b('0x31')](moment[_0xa15b('0x32')](_0x182a31['exp'])))return![];return!![];}catch(_0x17283c){throw _0x17283c;}}function refreshOauth2MicrosoftAccessToken(_0x179007){return Promise[_0xa15b('0x33')]()['then'](function(){if(_0x179007['data3'])return _0x179007;return db[_0xa15b('0x34')][_0xa15b('0x35')]({'where':{'id':_0x179007['id']},'raw':!![]});})['then'](function(_0x4d5082){var _0x531102={'grant_type':'refresh_token','refresh_token':_0x4d5082[_0xa15b('0x36')],'scope':getAccessTokenScope(_0x4d5082),'redirect_uri':_0x4d5082[_0xa15b('0x20')],'client_id':_0x4d5082[_0xa15b('0x37')],'client_secret':encryptor[_0xa15b('0x38')](_0x4d5082['data3'])};var _0x3234a5={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa15b('0x2a')](_0xa15b('0x19'),_0x4d5082[_0xa15b('0x39')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x531102,'json':!![]};return rp(_0x3234a5);})[_0xa15b('0x3a')](function(_0x5c4fcf){_0x179007[_0xa15b('0x3b')]=_0x5c4fcf[_0xa15b('0x3c')];_0x179007[_0xa15b('0x36')]=_0x5c4fcf[_0xa15b('0x3d')];return db[_0xa15b('0x34')][_0xa15b('0x3e')]({'data5':_0x179007[_0xa15b('0x3b')],'data6':_0x179007[_0xa15b('0x36')]},{'where':{'id':_0x179007['id']}});})[_0xa15b('0x3a')](function(){return _0x179007;})['catch'](function(_0x48c1db){logger['error'](_0xa15b('0x3f'),_0x179007['id'],_0x48c1db);});}function getOauth2MicrosoftAccessToken(_0x495ae2,_0x352328){var _0x3f47de={'grant_type':'authorization_code','code':_0x495ae2,'scope':getAccessTokenScope(_0x352328),'redirect_uri':_0x352328['data4'],'client_id':_0x352328[_0xa15b('0x37')],'client_secret':encryptor[_0xa15b('0x38')](_0x352328['data3'])};var _0x1b7b4a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa15b('0x2a')](_0xa15b('0x19'),_0x352328[_0xa15b('0x39')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f47de,'json':!![]};return rp(_0x1b7b4a);}function startRefreshInterval(_0x4a36b7){var _0x153ac6=schedule['intervals'];if(_0x153ac6[_0x4a36b7['id']])clearInterval(_0x153ac6[_0x4a36b7['id']]);_0x153ac6[_0x4a36b7['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa15b('0x40')](this,{'id':_0x4a36b7['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x153ac6;}function startAllRefreshIntervals(){return db[_0xa15b('0x34')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa15b('0x3a')](function(_0x1681fe){var _0x11ad39=_0x1681fe[_0xa15b('0x12')](function(_0xf30aeb){return refreshOauth2MicrosoftAccessToken(_0xf30aeb)[_0xa15b('0x3a')](function(_0x99649c){startRefreshInterval(_0x99649c);});});return Promise[_0xa15b('0x41')](_0x11ad39);})['catch'](function(_0x7690f1){var _0x142e70=_0x7690f1?util[_0xa15b('0x42')](_0x7690f1,{'showHidden':![],'depth':null}):'';logger[_0xa15b('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x142e70);});}module[_0xa15b('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xc32d=['Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','client_id','data1','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','map','value','oauth2/','set','decode','payload','iss','audience','unix','exp','data3','CloudProvider','findOne','then','refresh_token','data6','decryptString','POST','data5','access_token','error','authorization_code','intervals','bind','findAll','all','catch','inspect','exports','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','join'];(function(_0x5b8255,_0x2b696f){var _0x4559c3=function(_0x384edb){while(--_0x384edb){_0x5b8255['push'](_0x5b8255['shift']());}};_0x4559c3(++_0x2b696f);}(_0xc32d,0x10d));var _0xdc32=function(_0x279d07,_0x13f4bd){_0x279d07=_0x279d07-0x0;var _0x13b943=_0xc32d[_0x279d07];return _0x13b943;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xdc32('0x0'));var moment=require('moment');var Redis=require(_0xdc32('0x1'));var rp=require(_0xdc32('0x2'));var util=require(_0xdc32('0x3'));var encryptor=require(_0xdc32('0x4'));var config=require(_0xdc32('0x5'));var logger=require(_0xdc32('0x6'))(_0xdc32('0x7'));var schedule=require(_0xdc32('0x8'));var db=require(_0xdc32('0x9'))['db'];config['redis']=_['defaults'](config[_0xdc32('0xa')],{'host':_0xdc32('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xdc32('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xdc32('0xd'),_0xdc32('0xe'),_0xdc32('0xf'),_0xdc32('0x10'),_0xdc32('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xdc32('0x12')],'Dynamics365':[_0xdc32('0xd'),_0xdc32('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xdc32('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xdc32('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x360df4){var _0x56095c=_['map'](AZURE_AUTH_SCOPES[_0x360df4[_0xdc32('0x15')]]);if(_0x360df4[_0xdc32('0x15')]===_0xdc32('0x16'))_0x56095c[_0xdc32('0x17')](_0x360df4[_0xdc32('0x18')]+_0xdc32('0x19'));return _0x56095c[_0xdc32('0x1a')]('\x20');}function getAccessTokenScope(_0x194ccd){if(_0x194ccd[_0xdc32('0x15')]===_0xdc32('0x1b'))return _0xdc32('0x11');if(_0x194ccd[_0xdc32('0x15')]==='Dynamics365')return _0x194ccd['data7']+_0xdc32('0x19');}function generateMicrosoftAuthorizationUrl(_0x5d08bf,_0x48047d){var _0x7df838=MICROSOFT_AUTH_URL[_0xdc32('0x1c')](_0xdc32('0x1d'),_0x5d08bf[_0xdc32('0x1e')]);var _0x15f889=['code',_0xdc32('0x1f')];var _0x21bf17=Buffer[_0xdc32('0x20')](JSON[_0xdc32('0x21')]({'id':_0x48047d}))[_0xdc32('0x22')]('base64');var _0x11b5f7=crypto['randomBytes'](0x10)[_0xdc32('0x22')]('hex');var _0x1b4e23=getAuthorizationScopes(_0x5d08bf);var _0x28f060=[{'key':_0xdc32('0x23'),'value':_0x5d08bf[_0xdc32('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x15f889[_0xdc32('0x1a')]('\x20'))},{'key':_0xdc32('0x25'),'value':_0x5d08bf[_0xdc32('0x26')]},{'key':'response_mode','value':_0xdc32('0x27')},{'key':_0xdc32('0x28'),'value':encodeURIComponent(_0x1b4e23)},{'key':_0xdc32('0x29'),'value':_0x21bf17},{'key':_0xdc32('0x2a'),'value':_0x11b5f7},{'key':_0xdc32('0x2b'),'value':_0xdc32('0x2c')}];var _0x3bb5e1=_0x7df838+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xdc32('0x2d')](_0x28f060,function(_0x52f207){return _0x52f207['key']+'='+_0x52f207[_0xdc32('0x2e')];})[_0xdc32('0x1a')]('&');_0x5d08bf['oauth2Claims']={'issuer':_0x7df838[_0xdc32('0x1c')](_0xdc32('0x2f'),''),'audience':_0x5d08bf[_0xdc32('0x24')],'state':_0x21bf17,'nonce':_0x11b5f7};redis[_0xdc32('0x30')](_0x21bf17,JSON['stringify'](_0x5d08bf));return _0x3bb5e1;}function isValidIdToken(_0x4d642e,_0x43b7cd){try{var _0x1eef2b=jwt[_0xdc32('0x31')](_0x4d642e,{'complete':!![]});var _0xa4135b=_0x1eef2b[_0xdc32('0x32')];if(_0xa4135b[_0xdc32('0x33')]!==_0x43b7cd['issuer'])return![];if(_0xa4135b['aud']!==_0x43b7cd[_0xdc32('0x34')])return![];if(_0xa4135b[_0xdc32('0x2a')]!==_0x43b7cd['nonce'])return![];if(moment()['isAfter'](moment[_0xdc32('0x35')](_0xa4135b[_0xdc32('0x36')])))return![];return!![];}catch(_0xeb0c53){throw _0xeb0c53;}}function refreshOauth2MicrosoftAccessToken(_0x203bca){return Promise['resolve']()['then'](function(){if(_0x203bca[_0xdc32('0x37')])return _0x203bca;return db[_0xdc32('0x38')][_0xdc32('0x39')]({'where':{'id':_0x203bca['id']},'raw':!![]});})[_0xdc32('0x3a')](function(_0x49f6e7){var _0xe58865={'grant_type':_0xdc32('0x3b'),'refresh_token':_0x49f6e7[_0xdc32('0x3c')],'scope':getAccessTokenScope(_0x49f6e7),'redirect_uri':_0x49f6e7[_0xdc32('0x26')],'client_id':_0x49f6e7['data1'],'client_secret':encryptor[_0xdc32('0x3d')](_0x49f6e7[_0xdc32('0x37')])};var _0x370f77={'method':_0xdc32('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0xdc32('0x1d'),_0x49f6e7[_0xdc32('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xe58865,'json':!![]};return rp(_0x370f77);})[_0xdc32('0x3a')](function(_0xd75af){_0x203bca[_0xdc32('0x3f')]=_0xd75af[_0xdc32('0x40')];_0x203bca[_0xdc32('0x3c')]=_0xd75af[_0xdc32('0x3b')];return db[_0xdc32('0x38')]['update']({'data5':_0x203bca[_0xdc32('0x3f')],'data6':_0x203bca[_0xdc32('0x3c')]},{'where':{'id':_0x203bca['id']}});})['then'](function(){return _0x203bca;})['catch'](function(_0x4e52d4){logger[_0xdc32('0x41')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x203bca['id'],_0x4e52d4);});}function getOauth2MicrosoftAccessToken(_0x381c22,_0x95617a){var _0x944d3b={'grant_type':_0xdc32('0x42'),'code':_0x381c22,'scope':getAccessTokenScope(_0x95617a),'redirect_uri':_0x95617a['data4'],'client_id':_0x95617a[_0xdc32('0x24')],'client_secret':encryptor[_0xdc32('0x3d')](_0x95617a[_0xdc32('0x37')])};var _0x2c1032={'method':_0xdc32('0x3e'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x95617a[_0xdc32('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x944d3b,'json':!![]};return rp(_0x2c1032);}function startRefreshInterval(_0x1e0276){var _0x4df50a=schedule[_0xdc32('0x43')];if(_0x4df50a[_0x1e0276['id']])clearInterval(_0x4df50a[_0x1e0276['id']]);_0x4df50a[_0x1e0276['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xdc32('0x44')](this,{'id':_0x1e0276['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xdc32('0x43')]=_0x4df50a;}function startAllRefreshIntervals(){return db[_0xdc32('0x38')][_0xdc32('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xdc32('0x3a')](function(_0x205734){var _0x281de0=_0x205734['map'](function(_0x42936c){return refreshOauth2MicrosoftAccessToken(_0x42936c)[_0xdc32('0x3a')](function(_0x3a3b5e){startRefreshInterval(_0x3a3b5e);});});return Promise[_0xdc32('0x46')](_0x281de0);})[_0xdc32('0x47')](function(_0x6af338){var _0x39ac8f=_0x6af338?util[_0xdc32('0x48')](_0x6af338,{'showHidden':![],'depth':null}):'';logger[_0xdc32('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x39ac8f);});}module[_0xdc32('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index f2ee3f4..8a18cc7 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 _0x0570=['request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0x0570,0x172));var _0x0057=function(_0x31011c,_0x3f6aa6){_0x31011c=_0x31011c-0x0;var _0x5078c4=_0x0570[_0x31011c];return _0x5078c4;};'use strict';var _=require('lodash');var util=require(_0x0057('0x0'));var moment=require(_0x0057('0x1'));var BPromise=require(_0x0057('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0057('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0057('0x4'));var logger=require('../../config/logger')(_0x0057('0x5'));var config=require(_0x0057('0x6'));var jayson=require(_0x0057('0x7'));var client=jayson[_0x0057('0x8')][_0x0057('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5096e2,_0xc86734,_0x529f55){return new BPromise(function(_0x15d424,_0x2f9d7f){return client[_0x0057('0xa')](_0x5096e2,_0x529f55)[_0x0057('0xb')](function(_0x29b7c6){logger['info'](_0x0057('0xc'),_0xc86734,_0x0057('0xd'));logger[_0x0057('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'),JSON[_0x0057('0xf')](_0x29b7c6));if(_0x29b7c6['error']){if(_0x29b7c6['error'][_0x0057('0x10')]===0x1f4){logger[_0x0057('0x11')](_0x0057('0xc'),_0xc86734,_0x29b7c6['error'][_0x0057('0x12')]);return _0x2f9d7f(_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);}logger[_0x0057('0x11')]('CloudProvider,\x20%s,\x20%s',_0xc86734,_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);return _0x15d424(_0x29b7c6['error'][_0x0057('0x12')]);}else{logger[_0x0057('0x13')]('CloudProvider,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'));_0x15d424(_0x29b7c6['result'][_0x0057('0x12')]);}})['catch'](function(_0x4be851){logger[_0x0057('0x11')]('CloudProvider,\x20%s,\x20%s',_0xc86734,_0x4be851);_0x2f9d7f(_0x4be851);});});}
\ No newline at end of file
+var _0xda81=['then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x2c24b8,_0x168e0b){var _0x563ed6=function(_0x7c1aa9){while(--_0x7c1aa9){_0x2c24b8['push'](_0x2c24b8['shift']());}};_0x563ed6(++_0x168e0b);}(_0xda81,0x1c3));var _0x1da8=function(_0x19c8e1,_0x33f9da){_0x19c8e1=_0x19c8e1-0x0;var _0x73cbf3=_0xda81[_0x19c8e1];return _0x73cbf3;};'use strict';var _=require(_0x1da8('0x0'));var util=require(_0x1da8('0x1'));var moment=require(_0x1da8('0x2'));var BPromise=require('bluebird');var rs=require(_0x1da8('0x3'));var fs=require('fs');var Redis=require(_0x1da8('0x4'));var db=require(_0x1da8('0x5'))['db'];var utils=require(_0x1da8('0x6'));var logger=require('../../config/logger')(_0x1da8('0x7'));var config=require(_0x1da8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1da8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x891482,_0x2c2bb4,_0xea1eb1){return new BPromise(function(_0x1a3278,_0x11dc1e){return client[_0x1da8('0xa')](_0x891482,_0xea1eb1)[_0x1da8('0xb')](function(_0x17a7fc){logger[_0x1da8('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x1da8('0xd'));logger[_0x1da8('0xe')](_0x1da8('0xf'),_0x2c2bb4,_0x1da8('0xd'),JSON[_0x1da8('0x10')](_0x17a7fc));if(_0x17a7fc['error']){if(_0x17a7fc[_0x1da8('0x11')]['code']===0x1f4){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x11dc1e(_0x17a7fc[_0x1da8('0x11')]['message']);}logger[_0x1da8('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x1a3278(_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);}else{logger[_0x1da8('0xc')](_0x1da8('0x12'),_0x2c2bb4,'request\x20sent');_0x1a3278(_0x17a7fc[_0x1da8('0x14')][_0x1da8('0x13')]);}})[_0x1da8('0x15')](function(_0x197b09){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x197b09);_0x11dc1e(_0x197b09);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index b1f7097..8342beb 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0x10df32,_0x16e49e){_0x10df32=_0x10df32-0x0;var _0x4023a6=_0x7a54[_0x10df32];return _0x4023a6;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x118555,_0xe6dd6c){var _0x24ec92=function(_0x85f999){while(--_0x85f999){_0x118555['push'](_0x118555['shift']());}};_0x24ec92(++_0xe6dd6c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index dfb0344..7da178f 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 _0xda9c=['exports','STRING','name','sequelize'];(function(_0x2e5afc,_0x352c85){var _0x32c519=function(_0x5f0313){while(--_0x5f0313){_0x2e5afc['push'](_0x2e5afc['shift']());}};_0x32c519(++_0x352c85);}(_0xda9c,0x7b));var _0xcda9=function(_0x523eaf,_0x487fc6){_0x523eaf=_0x523eaf-0x0;var _0x319ba0=_0xda9c[_0x523eaf];return _0x319ba0;};'use strict';var Sequelize=require(_0xcda9('0x0'));module[_0xcda9('0x1')]={'name':{'type':Sequelize[_0xcda9('0x2')],'unique':_0xcda9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcda9('0x2')]},'companyId':{'type':Sequelize[_0xcda9('0x2')]},'website':{'type':Sequelize[_0xcda9('0x2')]},'phone':{'type':Sequelize[_0xcda9('0x2')]},'fax':{'type':Sequelize[_0xcda9('0x2')]},'type':{'type':Sequelize[_0xcda9('0x2')]},'street':{'type':Sequelize[_0xcda9('0x2')]},'postalCode':{'type':Sequelize[_0xcda9('0x2')]},'city':{'type':Sequelize[_0xcda9('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xcda9('0x2')]},'sCity':{'type':Sequelize[_0xcda9('0x2')]},'sCountry':{'type':Sequelize[_0xcda9('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x023f=['name','sequelize','exports','STRING'];(function(_0x34b951,_0x554a89){var _0x2b259f=function(_0x39bf00){while(--_0x39bf00){_0x34b951['push'](_0x34b951['shift']());}};_0x2b259f(++_0x554a89);}(_0x023f,0x69));var _0xf023=function(_0x44164b,_0x4b4ea1){_0x44164b=_0x44164b-0x0;var _0x869b3d=_0x023f[_0x44164b];return _0x869b3d;};'use strict';var Sequelize=require(_0xf023('0x0'));module[_0xf023('0x1')]={'name':{'type':Sequelize[_0xf023('0x2')],'unique':_0xf023('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf023('0x2')]},'companyId':{'type':Sequelize[_0xf023('0x2')]},'website':{'type':Sequelize[_0xf023('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xf023('0x2')]},'type':{'type':Sequelize[_0xf023('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf023('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf023('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf023('0x2')]},'sStreet':{'type':Sequelize[_0xf023('0x2')]},'sPostalCode':{'type':Sequelize[_0xf023('0x2')]},'sCity':{'type':Sequelize[_0xf023('0x2')]},'sCountry':{'type':Sequelize[_0xf023('0x2')]},'description':{'type':Sequelize[_0xf023('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 1ca3f84..31f0dee 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 _0xb0a5=['path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','order','sort','where','merge','map','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','omit','getContacts','pick','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x29c08e,_0x36cac6){var _0x24ee90=function(_0x5c966e){while(--_0x5c966e){_0x29c08e['push'](_0x29c08e['shift']());}};_0x24ee90(++_0x36cac6);}(_0xb0a5,0x13c));var _0x5b0a=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xb0a5[_0x1e6db3];return _0x1de886;};'use strict';var emlformat=require(_0x5b0a('0x0'));var rimraf=require(_0x5b0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b0a('0x2'));var rp=require(_0x5b0a('0x3'));var moment=require(_0x5b0a('0x4'));var BPromise=require(_0x5b0a('0x5'));var Mustache=require(_0x5b0a('0x6'));var util=require(_0x5b0a('0x7'));var path=require(_0x5b0a('0x8'));var sox=require('sox');var csv=require(_0x5b0a('0x9'));var ejs=require(_0x5b0a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b0a('0xb'));var crypto=require(_0x5b0a('0xc'));var jsforce=require(_0x5b0a('0xd'));var deskjs=require(_0x5b0a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b0a('0xf'));var Papa=require(_0x5b0a('0x10'));var Redis=require('ioredis');var authService=require(_0x5b0a('0x11'));var qs=require(_0x5b0a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b0a('0x13'));var logger=require(_0x5b0a('0x14'))(_0x5b0a('0x15'));var utils=require('../../config/utils');var config=require(_0x5b0a('0x16'));var licenseUtil=require(_0x5b0a('0x17'));var db=require(_0x5b0a('0x18'))['db'];function respondWithStatusCode(_0x882c5,_0x2dc12c){_0x2dc12c=_0x2dc12c||0xcc;return function(_0x5c98dd){if(_0x5c98dd){return _0x882c5['sendStatus'](_0x2dc12c);}return _0x882c5[_0x5b0a('0x19')](_0x2dc12c)[_0x5b0a('0x1a')]();};}function respondWithResult(_0x46f2eb,_0x45a076){_0x45a076=_0x45a076||0xc8;return function(_0x32117c){if(_0x32117c){return _0x46f2eb[_0x5b0a('0x19')](_0x45a076)[_0x5b0a('0x1b')](_0x32117c);}};}function respondWithFilteredResult(_0x248143,_0x3e9ac1){return function(_0x2fda60){if(_0x2fda60){var _0x1daead=typeof _0x3e9ac1['offset']===_0x5b0a('0x1c')&&typeof _0x3e9ac1[_0x5b0a('0x1d')]===_0x5b0a('0x1c');var _0x29a8ef=_0x2fda60[_0x5b0a('0x1e')];var _0x3b95c3=_0x1daead?0x0:_0x3e9ac1[_0x5b0a('0x1f')];var _0x48654b=_0x1daead?_0x2fda60[_0x5b0a('0x1e')]:_0x3e9ac1[_0x5b0a('0x1f')]+_0x3e9ac1[_0x5b0a('0x1d')];var _0x47b153;if(_0x48654b>=_0x29a8ef){_0x48654b=_0x29a8ef;_0x47b153=0xc8;}else{_0x47b153=0xce;}_0x248143['status'](_0x47b153);return _0x248143['set']('Content-Range',_0x3b95c3+'-'+_0x48654b+'/'+_0x29a8ef)[_0x5b0a('0x1b')](_0x2fda60);}return null;};}function patchUpdates(_0x497c4b){return function(_0x3ab22e){try{jsonpatch[_0x5b0a('0x20')](_0x3ab22e,_0x497c4b,!![]);}catch(_0x499576){return BPromise['reject'](_0x499576);}return _0x3ab22e[_0x5b0a('0x21')]();};}function saveUpdates(_0x8386c4,_0x2b9b6a){return function(_0x3a93f7){if(_0x3a93f7){return _0x3a93f7['update'](_0x8386c4)[_0x5b0a('0x22')](function(_0x2863e7){return _0x2863e7;});}return null;};}function removeEntity(_0x16c564,_0xf5efa3){return function(_0x380b3f){if(_0x380b3f){return _0x380b3f[_0x5b0a('0x23')]()[_0x5b0a('0x22')](function(){var _0x53a196=_0x380b3f[_0x5b0a('0x24')]({'plain':!![]});var _0x385355=_0x5b0a('0x25');return db[_0x5b0a('0x26')][_0x5b0a('0x23')]({'where':{'type':_0x385355,'resourceId':_0x53a196['id']}})[_0x5b0a('0x22')](function(){return _0x380b3f;});})[_0x5b0a('0x22')](function(){_0x16c564[_0x5b0a('0x19')](0xcc)[_0x5b0a('0x1a')]();});}};}function handleEntityNotFound(_0x161316,_0x295c0d){return function(_0x26eb0e){if(!_0x26eb0e){_0x161316['sendStatus'](0x194);}return _0x26eb0e;};}function handleError(_0x2da3de,_0x212436){_0x212436=_0x212436||0x1f4;return function(_0x1aa9d4){logger[_0x5b0a('0x27')](_0x1aa9d4[_0x5b0a('0x28')]);if(_0x1aa9d4[_0x5b0a('0x29')]){delete _0x1aa9d4[_0x5b0a('0x29')];}_0x2da3de[_0x5b0a('0x19')](_0x212436)['send'](_0x1aa9d4);};}exports[_0x5b0a('0x2a')]=function(_0x123f11,_0x35a999){var _0x3caa32={},_0x2a8545={},_0x12c17={'count':0x0,'rows':[]};return db[_0x5b0a('0x2b')][_0x5b0a('0x2c')]()[_0x5b0a('0x22')](function(_0x26cf75){_0x2a8545['model']=_[_0x5b0a('0x2d')](_0x26cf75);_0x2a8545[_0x5b0a('0x2e')]=_['keys'](_0x123f11[_0x5b0a('0x2e')]);_0x2a8545[_0x5b0a('0x2f')]=_[_0x5b0a('0x30')](_0x2a8545[_0x5b0a('0x31')],_0x2a8545['query']);_0x3caa32['attributes']=_[_0x5b0a('0x30')](_0x2a8545['model'],qs[_0x5b0a('0x32')](_0x123f11[_0x5b0a('0x2e')][_0x5b0a('0x32')]));_0x3caa32[_0x5b0a('0x33')]=_0x3caa32[_0x5b0a('0x33')]['length']?_0x3caa32[_0x5b0a('0x33')]:_0x2a8545['model'];if(!_0x123f11['query']['hasOwnProperty']('nolimit')){_0x3caa32['limit']=qs[_0x5b0a('0x1d')](_0x123f11[_0x5b0a('0x2e')][_0x5b0a('0x1d')]);_0x3caa32[_0x5b0a('0x1f')]=qs['offset'](_0x123f11[_0x5b0a('0x2e')]['offset']);}_0x3caa32[_0x5b0a('0x34')]=qs[_0x5b0a('0x35')](_0x123f11['query'][_0x5b0a('0x35')]);_0x3caa32[_0x5b0a('0x36')]=qs[_0x5b0a('0x2f')](_['pick'](_0x123f11[_0x5b0a('0x2e')],_0x2a8545[_0x5b0a('0x2f')]),_0x26cf75);if(_0x123f11[_0x5b0a('0x2e')]['filter']){_0x3caa32[_0x5b0a('0x36')]=_[_0x5b0a('0x37')](_0x3caa32[_0x5b0a('0x36')],{'$or':_[_0x5b0a('0x38')](_0x3caa32[_0x5b0a('0x33')],function(_0x15783f){var _0x499689={};_0x499689[_0x15783f]={'$like':'%'+_0x123f11['query'][_0x5b0a('0x39')]+'%'};return _0x499689;})});}_0x3caa32=_[_0x5b0a('0x37')]({},_0x3caa32,_0x123f11['options']);var _0x6b08aa={'where':_0x3caa32['where']};return db['CmCompany'][_0x5b0a('0x1e')](_0x6b08aa)[_0x5b0a('0x22')](function(_0x5de7c5){_0x12c17[_0x5b0a('0x1e')]=_0x5de7c5;if(_0x123f11[_0x5b0a('0x2e')][_0x5b0a('0x3a')]){_0x3caa32[_0x5b0a('0x3b')]=[{'all':!![]}];}return db[_0x5b0a('0x2b')][_0x5b0a('0x3c')](_0x3caa32);})[_0x5b0a('0x22')](function(_0x264893){_0x12c17[_0x5b0a('0x3d')]=_0x264893;return _0x12c17;})[_0x5b0a('0x22')](respondWithFilteredResult(_0x35a999,_0x3caa32))[_0x5b0a('0x3e')](handleError(_0x35a999,null));})[_0x5b0a('0x3e')](handleError(_0x35a999,null));};exports[_0x5b0a('0x3f')]=function(_0x3caf9a,_0x3669af){var _0xfa809e={'raw':![],'where':{'id':_0x3caf9a[_0x5b0a('0x40')]['id']}},_0x2c5991={};_0x2c5991['model']=_[_0x5b0a('0x2d')](db['CmCompany'][_0x5b0a('0x41')]);_0x2c5991[_0x5b0a('0x2e')]=_[_0x5b0a('0x2d')](_0x3caf9a[_0x5b0a('0x2e')]);_0x2c5991[_0x5b0a('0x2f')]=_[_0x5b0a('0x30')](_0x2c5991[_0x5b0a('0x31')],_0x2c5991[_0x5b0a('0x2e')]);_0xfa809e[_0x5b0a('0x33')]=_[_0x5b0a('0x30')](_0x2c5991['model'],qs[_0x5b0a('0x32')](_0x3caf9a[_0x5b0a('0x2e')]['fields']));_0xfa809e[_0x5b0a('0x33')]=_0xfa809e[_0x5b0a('0x33')][_0x5b0a('0x42')]?_0xfa809e['attributes']:_0x2c5991[_0x5b0a('0x31')];if(_0x3caf9a[_0x5b0a('0x2e')][_0x5b0a('0x3a')]){_0xfa809e[_0x5b0a('0x3b')]=[{'all':!![]}];}_0xfa809e=_['merge']({},_0xfa809e,_0x3caf9a[_0x5b0a('0x43')]);return db[_0x5b0a('0x2b')]['find'](_0xfa809e)[_0x5b0a('0x22')](handleEntityNotFound(_0x3669af,null))[_0x5b0a('0x22')](respondWithResult(_0x3669af,null))[_0x5b0a('0x3e')](handleError(_0x3669af,null));};exports['create']=function(_0x58d027,_0x3d7bbc){return db[_0x5b0a('0x2b')][_0x5b0a('0x44')](_0x58d027[_0x5b0a('0x45')],{})[_0x5b0a('0x22')](function(_0x1aec14){var _0x2f5095=_0x58d027[_0x5b0a('0x46')][_0x5b0a('0x24')]({'plain':!![]});if(!_0x2f5095)throw new Error(_0x5b0a('0x47'));if(_0x2f5095['role']==='user'){var _0x430ecb=_0x1aec14[_0x5b0a('0x24')]({'plain':!![]});var _0x35bf50=_0x5b0a('0x25');return db['UserProfileSection'][_0x5b0a('0x48')]({'where':{'name':_0x35bf50,'userProfileId':_0x2f5095[_0x5b0a('0x49')]},'raw':!![]})[_0x5b0a('0x22')](function(_0x4d7beb){if(_0x4d7beb&&_0x4d7beb['autoAssociation']===0x0){return db[_0x5b0a('0x26')][_0x5b0a('0x44')]({'name':_0x430ecb[_0x5b0a('0x29')],'resourceId':_0x430ecb['id'],'type':_0x4d7beb['name'],'sectionId':_0x4d7beb['id']},{})[_0x5b0a('0x22')](function(){return _0x1aec14;});}else{return _0x1aec14;}})[_0x5b0a('0x3e')](function(_0x4d4b3f){logger['error'](_0x5b0a('0x4a'),_0x4d4b3f);throw _0x4d4b3f;});}return _0x1aec14;})['then'](respondWithResult(_0x3d7bbc,0xc9))[_0x5b0a('0x3e')](handleError(_0x3d7bbc,null));};exports[_0x5b0a('0x4b')]=function(_0x17b864,_0x36ebf4){if(_0x17b864[_0x5b0a('0x45')]['id']){delete _0x17b864[_0x5b0a('0x45')]['id'];}return db[_0x5b0a('0x2b')][_0x5b0a('0x48')]({'where':{'id':_0x17b864[_0x5b0a('0x40')]['id']}})[_0x5b0a('0x22')](handleEntityNotFound(_0x36ebf4,null))[_0x5b0a('0x22')](saveUpdates(_0x17b864[_0x5b0a('0x45')],null))[_0x5b0a('0x22')](respondWithResult(_0x36ebf4,null))[_0x5b0a('0x3e')](handleError(_0x36ebf4,null));};exports[_0x5b0a('0x23')]=function(_0x6c6bc7,_0x387efe){return db['CmCompany'][_0x5b0a('0x48')]({'where':{'id':_0x6c6bc7['params']['id']}})['then'](handleEntityNotFound(_0x387efe,null))[_0x5b0a('0x22')](removeEntity(_0x387efe,null))[_0x5b0a('0x3e')](handleError(_0x387efe,null));};exports[_0x5b0a('0x2c')]=function(_0x2db606,_0xdb3d1e){return db[_0x5b0a('0x2b')]['describe']()['then'](respondWithResult(_0xdb3d1e,null))[_0x5b0a('0x3e')](handleError(_0xdb3d1e,null));};exports['addContacts']=function(_0x151d58,_0x3f3592,_0x22cd35){return db[_0x5b0a('0x4c')][_0x5b0a('0x48')]({'where':{'id':_0x151d58[_0x5b0a('0x40')]['id']}})[_0x5b0a('0x22')](handleEntityNotFound(_0x3f3592,null))['then'](function(_0x540fe5){if(_0x540fe5){return _0x540fe5[_0x5b0a('0x4d')](_0x151d58[_0x5b0a('0x45')]['ids'],_[_0x5b0a('0x4e')](_0x151d58[_0x5b0a('0x45')],['ids','id'])||{});}})[_0x5b0a('0x22')](respondWithResult(_0x3f3592,null))[_0x5b0a('0x3e')](handleError(_0x3f3592,null));};exports[_0x5b0a('0x4f')]=function(_0xa71a88,_0x23edaa,_0x110ee0){var _0x5dbb90={};var _0x4c41d5={};var _0xe72d0;var _0x5918fb;return db['CmCompany']['findOne']({'where':{'id':_0xa71a88[_0x5b0a('0x40')]['id']}})[_0x5b0a('0x22')](handleEntityNotFound(_0x23edaa,null))[_0x5b0a('0x22')](function(_0xc0b9b1){if(_0xc0b9b1){_0xe72d0=_0xc0b9b1;_0x4c41d5[_0x5b0a('0x31')]=_[_0x5b0a('0x2d')](db[_0x5b0a('0x4c')][_0x5b0a('0x41')]);_0x4c41d5[_0x5b0a('0x2e')]=_['keys'](_0xa71a88['query']);_0x4c41d5['filters']=_['intersection'](_0x4c41d5[_0x5b0a('0x31')],_0x4c41d5[_0x5b0a('0x2e')]);_0x5dbb90[_0x5b0a('0x33')]=_[_0x5b0a('0x30')](_0x4c41d5['model'],qs['fields'](_0xa71a88[_0x5b0a('0x2e')][_0x5b0a('0x32')]));_0x5dbb90['attributes']=_0x5dbb90['attributes'][_0x5b0a('0x42')]?_0x5dbb90[_0x5b0a('0x33')]:_0x4c41d5[_0x5b0a('0x31')];_0x5dbb90['order']=qs[_0x5b0a('0x35')](_0xa71a88['query'][_0x5b0a('0x35')]);_0x5dbb90[_0x5b0a('0x36')]=qs[_0x5b0a('0x2f')](_[_0x5b0a('0x50')](_0xa71a88[_0x5b0a('0x2e')],_0x4c41d5[_0x5b0a('0x2f')]));if(_0xa71a88[_0x5b0a('0x2e')][_0x5b0a('0x39')]){_0x5dbb90[_0x5b0a('0x36')]=_['merge'](_0x5dbb90['where'],{'$or':_[_0x5b0a('0x38')](_0x5dbb90[_0x5b0a('0x33')],function(_0x29d1e3){var _0x70dd9b={};_0x70dd9b[_0x29d1e3]={'$like':'%'+_0xa71a88['query'][_0x5b0a('0x39')]+'%'};return _0x70dd9b;})});}_0x5dbb90=_[_0x5b0a('0x37')]({},_0x5dbb90,_0xa71a88['options']);return _0xe72d0[_0x5b0a('0x4f')](_0x5dbb90);}})[_0x5b0a('0x22')](function(_0x341ca8){if(_0x341ca8){_0x5918fb=_0x341ca8[_0x5b0a('0x42')];if(!_0xa71a88[_0x5b0a('0x2e')]['hasOwnProperty']('nolimit')){_0x5dbb90['limit']=qs['limit'](_0xa71a88[_0x5b0a('0x2e')]['limit']);_0x5dbb90[_0x5b0a('0x1f')]=qs['offset'](_0xa71a88['query'][_0x5b0a('0x1f')]);}return _0xe72d0[_0x5b0a('0x4f')](_0x5dbb90);}})[_0x5b0a('0x22')](function(_0x1133b0){if(_0x1133b0){return _0x1133b0?{'count':_0x5918fb,'rows':_0x1133b0}:null;}})['then'](respondWithResult(_0x23edaa,null))[_0x5b0a('0x3e')](handleError(_0x23edaa,null));};
\ No newline at end of file
+var _0x82cb=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x2f10b6,_0x565c9b){var _0x2f4066=function(_0x2b31b2){while(--_0x2b31b2){_0x2f10b6['push'](_0x2f10b6['shift']());}};_0x2f4066(++_0x565c9b);}(_0x82cb,0x17c));var _0xb82c=function(_0x13cd39,_0x5c317b){_0x13cd39=_0x13cd39-0x0;var _0x405d90=_0x82cb[_0x13cd39];return _0x405d90;};'use strict';var emlformat=require(_0xb82c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb82c('0x1'));var jsonpatch=require(_0xb82c('0x2'));var rp=require('request-promise');var moment=require(_0xb82c('0x3'));var BPromise=require(_0xb82c('0x4'));var Mustache=require(_0xb82c('0x5'));var util=require(_0xb82c('0x6'));var path=require(_0xb82c('0x7'));var sox=require(_0xb82c('0x8'));var csv=require(_0xb82c('0x9'));var ejs=require(_0xb82c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb82c('0xb'));var squel=require(_0xb82c('0xc'));var crypto=require(_0xb82c('0xd'));var jsforce=require(_0xb82c('0xe'));var deskjs=require(_0xb82c('0xf'));var toCsv=require(_0xb82c('0x9'));var querystring=require(_0xb82c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb82c('0x11'));var qs=require(_0xb82c('0x12'));var as=require(_0xb82c('0x13'));var hardwareService=require(_0xb82c('0x14'));var logger=require(_0xb82c('0x15'))(_0xb82c('0x16'));var utils=require(_0xb82c('0x17'));var config=require(_0xb82c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb82c('0x19'))['db'];function respondWithStatusCode(_0x193dcc,_0x1dfb16){_0x1dfb16=_0x1dfb16||0xcc;return function(_0x1eeac8){if(_0x1eeac8){return _0x193dcc[_0xb82c('0x1a')](_0x1dfb16);}return _0x193dcc['status'](_0x1dfb16)[_0xb82c('0x1b')]();};}function respondWithResult(_0x4eab47,_0x35fdf8){_0x35fdf8=_0x35fdf8||0xc8;return function(_0x63c6f1){if(_0x63c6f1){return _0x4eab47[_0xb82c('0x1c')](_0x35fdf8)[_0xb82c('0x1d')](_0x63c6f1);}};}function respondWithFilteredResult(_0x268bb6,_0x57b49a){return function(_0x459023){if(_0x459023){var _0x2deb89=typeof _0x57b49a[_0xb82c('0x1e')]==='undefined'&&typeof _0x57b49a[_0xb82c('0x1f')]===_0xb82c('0x20');var _0x4b1b23=_0x459023[_0xb82c('0x21')];var _0x13199c=_0x2deb89?0x0:_0x57b49a['offset'];var _0x2e1efa=_0x2deb89?_0x459023[_0xb82c('0x21')]:_0x57b49a['offset']+_0x57b49a[_0xb82c('0x1f')];var _0x58efaf;if(_0x2e1efa>=_0x4b1b23){_0x2e1efa=_0x4b1b23;_0x58efaf=0xc8;}else{_0x58efaf=0xce;}_0x268bb6['status'](_0x58efaf);return _0x268bb6[_0xb82c('0x22')](_0xb82c('0x23'),_0x13199c+'-'+_0x2e1efa+'/'+_0x4b1b23)[_0xb82c('0x1d')](_0x459023);}return null;};}function patchUpdates(_0x469508){return function(_0x3db8d7){try{jsonpatch['apply'](_0x3db8d7,_0x469508,!![]);}catch(_0x3a6588){return BPromise[_0xb82c('0x24')](_0x3a6588);}return _0x3db8d7[_0xb82c('0x25')]();};}function saveUpdates(_0x5c7aba,_0xa94978){return function(_0x236590){if(_0x236590){return _0x236590[_0xb82c('0x26')](_0x5c7aba)[_0xb82c('0x27')](function(_0x202761){return _0x202761;});}return null;};}function removeEntity(_0x9434c7,_0x2d7879){return function(_0x6762cd){if(_0x6762cd){return _0x6762cd[_0xb82c('0x28')]()[_0xb82c('0x27')](function(){var _0x227c09=_0x6762cd[_0xb82c('0x29')]({'plain':!![]});var _0x57ee5f=_0xb82c('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x57ee5f,'resourceId':_0x227c09['id']}})[_0xb82c('0x27')](function(){return _0x6762cd;});})[_0xb82c('0x27')](function(){_0x9434c7[_0xb82c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415edf,_0x3df6aa){return function(_0x310777){if(!_0x310777){_0x415edf['sendStatus'](0x194);}return _0x310777;};}function handleError(_0x7ddd98,_0x4e0985){_0x4e0985=_0x4e0985||0x1f4;return function(_0x337f05){logger[_0xb82c('0x2b')](_0x337f05[_0xb82c('0x2c')]);if(_0x337f05[_0xb82c('0x2d')]){delete _0x337f05[_0xb82c('0x2d')];}_0x7ddd98[_0xb82c('0x1c')](_0x4e0985)[_0xb82c('0x2e')](_0x337f05);};}exports[_0xb82c('0x2f')]=function(_0x4bfd63,_0xd90571){var _0x49aab7={},_0xa60d95={},_0x52834c={'count':0x0,'rows':[]};return db[_0xb82c('0x30')][_0xb82c('0x31')]()[_0xb82c('0x27')](function(_0x460bd4){_0xa60d95['model']=_[_0xb82c('0x32')](_0x460bd4);_0xa60d95[_0xb82c('0x33')]=_[_0xb82c('0x32')](_0x4bfd63[_0xb82c('0x33')]);_0xa60d95[_0xb82c('0x34')]=_[_0xb82c('0x35')](_0xa60d95['model'],_0xa60d95[_0xb82c('0x33')]);_0x49aab7['attributes']=_[_0xb82c('0x35')](_0xa60d95[_0xb82c('0x36')],qs[_0xb82c('0x37')](_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x37')]));_0x49aab7[_0xb82c('0x38')]=_0x49aab7[_0xb82c('0x38')][_0xb82c('0x39')]?_0x49aab7['attributes']:_0xa60d95['model'];if(!_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x3a')]('nolimit')){_0x49aab7[_0xb82c('0x1f')]=qs[_0xb82c('0x1f')](_0x4bfd63['query'][_0xb82c('0x1f')]);_0x49aab7['offset']=qs[_0xb82c('0x1e')](_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x1e')]);}_0x49aab7[_0xb82c('0x3b')]=qs[_0xb82c('0x3c')](_0x4bfd63[_0xb82c('0x33')]['sort']);_0x49aab7['where']=qs['filters'](_[_0xb82c('0x3d')](_0x4bfd63['query'],_0xa60d95[_0xb82c('0x34')]),_0x460bd4);if(_0x4bfd63['query'][_0xb82c('0x3e')]){_0x49aab7[_0xb82c('0x3f')]=_[_0xb82c('0x40')](_0x49aab7[_0xb82c('0x3f')],{'$or':_[_0xb82c('0x41')](_0x49aab7[_0xb82c('0x38')],function(_0x1d381c){var _0x232469={};_0x232469[_0x1d381c]={'$like':'%'+_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x3e')]+'%'};return _0x232469;})});}_0x49aab7=_['merge']({},_0x49aab7,_0x4bfd63[_0xb82c('0x42')]);var _0x3eecf0={'where':_0x49aab7[_0xb82c('0x3f')]};return db['CmCompany'][_0xb82c('0x21')](_0x3eecf0)[_0xb82c('0x27')](function(_0x5a343e){_0x52834c[_0xb82c('0x21')]=_0x5a343e;if(_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x43')]){_0x49aab7[_0xb82c('0x44')]=[{'all':!![]}];}return db['CmCompany'][_0xb82c('0x45')](_0x49aab7);})[_0xb82c('0x27')](function(_0x5f17a2){_0x52834c[_0xb82c('0x46')]=_0x5f17a2;return _0x52834c;})[_0xb82c('0x27')](respondWithFilteredResult(_0xd90571,_0x49aab7))[_0xb82c('0x47')](handleError(_0xd90571,null));})[_0xb82c('0x47')](handleError(_0xd90571,null));};exports[_0xb82c('0x48')]=function(_0x4d14b7,_0x310162){var _0x5c3be1={'raw':![],'where':{'id':_0x4d14b7[_0xb82c('0x49')]['id']}},_0xc810d9={};_0xc810d9[_0xb82c('0x36')]=_[_0xb82c('0x32')](db[_0xb82c('0x30')][_0xb82c('0x4a')]);_0xc810d9[_0xb82c('0x33')]=_[_0xb82c('0x32')](_0x4d14b7[_0xb82c('0x33')]);_0xc810d9[_0xb82c('0x34')]=_[_0xb82c('0x35')](_0xc810d9['model'],_0xc810d9[_0xb82c('0x33')]);_0x5c3be1[_0xb82c('0x38')]=_[_0xb82c('0x35')](_0xc810d9[_0xb82c('0x36')],qs[_0xb82c('0x37')](_0x4d14b7[_0xb82c('0x33')][_0xb82c('0x37')]));_0x5c3be1[_0xb82c('0x38')]=_0x5c3be1['attributes'][_0xb82c('0x39')]?_0x5c3be1[_0xb82c('0x38')]:_0xc810d9[_0xb82c('0x36')];if(_0x4d14b7[_0xb82c('0x33')][_0xb82c('0x43')]){_0x5c3be1[_0xb82c('0x44')]=[{'all':!![]}];}_0x5c3be1=_[_0xb82c('0x40')]({},_0x5c3be1,_0x4d14b7[_0xb82c('0x42')]);return db[_0xb82c('0x30')]['find'](_0x5c3be1)[_0xb82c('0x27')](handleEntityNotFound(_0x310162,null))['then'](respondWithResult(_0x310162,null))[_0xb82c('0x47')](handleError(_0x310162,null));};exports[_0xb82c('0x4b')]=function(_0x26bb54,_0x35fb4e){return db[_0xb82c('0x30')][_0xb82c('0x4b')](_0x26bb54[_0xb82c('0x4c')],{})['then'](function(_0x2bc92f){var _0x55c9b6=_0x26bb54[_0xb82c('0x4d')][_0xb82c('0x29')]({'plain':!![]});if(!_0x55c9b6)throw new Error(_0xb82c('0x4e'));if(_0x55c9b6[_0xb82c('0x4f')]===_0xb82c('0x4d')){var _0x5492d3=_0x2bc92f[_0xb82c('0x29')]({'plain':!![]});var _0x456d5a=_0xb82c('0x2a');return db[_0xb82c('0x50')]['find']({'where':{'name':_0x456d5a,'userProfileId':_0x55c9b6['userProfileId']},'raw':!![]})[_0xb82c('0x27')](function(_0x984d29){if(_0x984d29&&_0x984d29[_0xb82c('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5492d3[_0xb82c('0x2d')],'resourceId':_0x5492d3['id'],'type':_0x984d29[_0xb82c('0x2d')],'sectionId':_0x984d29['id']},{})[_0xb82c('0x27')](function(){return _0x2bc92f;});}else{return _0x2bc92f;}})[_0xb82c('0x47')](function(_0xaea839){logger[_0xb82c('0x2b')](_0xb82c('0x52'),_0xaea839);throw _0xaea839;});}return _0x2bc92f;})[_0xb82c('0x27')](respondWithResult(_0x35fb4e,0xc9))[_0xb82c('0x47')](handleError(_0x35fb4e,null));};exports[_0xb82c('0x26')]=function(_0x15859b,_0xf53f48){if(_0x15859b[_0xb82c('0x4c')]['id']){delete _0x15859b[_0xb82c('0x4c')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x15859b['params']['id']}})[_0xb82c('0x27')](handleEntityNotFound(_0xf53f48,null))[_0xb82c('0x27')](saveUpdates(_0x15859b['body'],null))[_0xb82c('0x27')](respondWithResult(_0xf53f48,null))['catch'](handleError(_0xf53f48,null));};exports['destroy']=function(_0x571767,_0x316ecd){return db[_0xb82c('0x30')][_0xb82c('0x53')]({'where':{'id':_0x571767[_0xb82c('0x49')]['id']}})['then'](handleEntityNotFound(_0x316ecd,null))['then'](removeEntity(_0x316ecd,null))[_0xb82c('0x47')](handleError(_0x316ecd,null));};exports[_0xb82c('0x31')]=function(_0x9ec2b8,_0x16f579){return db[_0xb82c('0x30')][_0xb82c('0x31')]()[_0xb82c('0x27')](respondWithResult(_0x16f579,null))[_0xb82c('0x47')](handleError(_0x16f579,null));};exports[_0xb82c('0x54')]=function(_0xca9a7c,_0x5c0c39,_0x35b55d){return db[_0xb82c('0x55')][_0xb82c('0x53')]({'where':{'id':_0xca9a7c['params']['id']}})[_0xb82c('0x27')](handleEntityNotFound(_0x5c0c39,null))[_0xb82c('0x27')](function(_0x309465){if(_0x309465){return _0x309465[_0xb82c('0x54')](_0xca9a7c[_0xb82c('0x4c')][_0xb82c('0x56')],_[_0xb82c('0x57')](_0xca9a7c[_0xb82c('0x4c')],[_0xb82c('0x56'),'id'])||{});}})['then'](respondWithResult(_0x5c0c39,null))[_0xb82c('0x47')](handleError(_0x5c0c39,null));};exports[_0xb82c('0x58')]=function(_0x4f7f0c,_0x4ea230,_0x328773){var _0x331f2f={};var _0x5bb9e1={};var _0x5a9886;var _0x1477ac;return db[_0xb82c('0x30')][_0xb82c('0x59')]({'where':{'id':_0x4f7f0c[_0xb82c('0x49')]['id']}})[_0xb82c('0x27')](handleEntityNotFound(_0x4ea230,null))[_0xb82c('0x27')](function(_0x16d232){if(_0x16d232){_0x5a9886=_0x16d232;_0x5bb9e1[_0xb82c('0x36')]=_[_0xb82c('0x32')](db['CmContact'][_0xb82c('0x4a')]);_0x5bb9e1[_0xb82c('0x33')]=_[_0xb82c('0x32')](_0x4f7f0c['query']);_0x5bb9e1[_0xb82c('0x34')]=_[_0xb82c('0x35')](_0x5bb9e1[_0xb82c('0x36')],_0x5bb9e1[_0xb82c('0x33')]);_0x331f2f[_0xb82c('0x38')]=_[_0xb82c('0x35')](_0x5bb9e1[_0xb82c('0x36')],qs['fields'](_0x4f7f0c['query'][_0xb82c('0x37')]));_0x331f2f[_0xb82c('0x38')]=_0x331f2f[_0xb82c('0x38')]['length']?_0x331f2f[_0xb82c('0x38')]:_0x5bb9e1['model'];_0x331f2f['order']=qs[_0xb82c('0x3c')](_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3c')]);_0x331f2f[_0xb82c('0x3f')]=qs['filters'](_[_0xb82c('0x3d')](_0x4f7f0c['query'],_0x5bb9e1[_0xb82c('0x34')]));if(_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3e')]){_0x331f2f['where']=_[_0xb82c('0x40')](_0x331f2f[_0xb82c('0x3f')],{'$or':_[_0xb82c('0x41')](_0x331f2f['attributes'],function(_0x583aaa){var _0x8ea71d={};_0x8ea71d[_0x583aaa]={'$like':'%'+_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3e')]+'%'};return _0x8ea71d;})});}_0x331f2f=_[_0xb82c('0x40')]({},_0x331f2f,_0x4f7f0c[_0xb82c('0x42')]);return _0x5a9886[_0xb82c('0x58')](_0x331f2f);}})[_0xb82c('0x27')](function(_0x1de299){if(_0x1de299){_0x1477ac=_0x1de299[_0xb82c('0x39')];if(!_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3a')](_0xb82c('0x5a'))){_0x331f2f[_0xb82c('0x1f')]=qs['limit'](_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x1f')]);_0x331f2f[_0xb82c('0x1e')]=qs[_0xb82c('0x1e')](_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x1e')]);}return _0x5a9886[_0xb82c('0x58')](_0x331f2f);}})[_0xb82c('0x27')](function(_0x26fa17){if(_0x26fa17){return _0x26fa17?{'count':_0x1477ac,'rows':_0x26fa17}:null;}})['then'](respondWithResult(_0x4ea230,null))[_0xb82c('0x47')](handleError(_0x4ea230,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index ede9555..f562cea 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 _0x7b6a=['cm_companies','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany'];(function(_0x3e4a76,_0x27f26d){var _0x3ccebe=function(_0x435044){while(--_0x435044){_0x3e4a76['push'](_0x3e4a76['shift']());}};_0x3ccebe(++_0x27f26d);}(_0x7b6a,0x14b));var _0xa7b6=function(_0xe2c51a,_0x292d36){_0xe2c51a=_0xe2c51a-0x0;var _0x101e57=_0x7b6a[_0xe2c51a];return _0x101e57;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa7b6('0x0'))(_0xa7b6('0x1'));var moment=require('moment');var BPromise=require(_0xa7b6('0x2'));var rp=require(_0xa7b6('0x3'));var fs=require('fs');var path=require(_0xa7b6('0x4'));var rimraf=require(_0xa7b6('0x5'));var config=require(_0xa7b6('0x6'));var attributes=require(_0xa7b6('0x7'));module[_0xa7b6('0x8')]=function(_0xd659b0,_0x2d668e){return _0xd659b0['define'](_0xa7b6('0x9'),attributes,{'tableName':_0xa7b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x514e=['moment','bluebird','path','../../config/environment','./cmCompany.attributes','exports','CmCompany','lodash','../../config/logger','api'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x514e,0x197));var _0xe514=function(_0x59fcd3,_0x232666){_0x59fcd3=_0x59fcd3-0x0;var _0x1d0db7=_0x514e[_0x59fcd3];return _0x1d0db7;};'use strict';var _=require(_0xe514('0x0'));var util=require('util');var logger=require(_0xe514('0x1'))(_0xe514('0x2'));var moment=require(_0xe514('0x3'));var BPromise=require(_0xe514('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe514('0x5'));var rimraf=require('rimraf');var config=require(_0xe514('0x6'));var attributes=require(_0xe514('0x7'));module[_0xe514('0x8')]=function(_0x4fe7cf,_0x1da638){return _0x4fe7cf['define'](_0xe514('0x9'),attributes,{'tableName':'cm_companies','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 1242317..0490afd 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 _0xb0fa=['message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x103f46,_0x1cbbbb){var _0x58d92e=function(_0x3e2d14){while(--_0x3e2d14){_0x103f46['push'](_0x103f46['shift']());}};_0x58d92e(++_0x1cbbbb);}(_0xb0fa,0x14e));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab0f('0x0'));var util=require(_0xab0f('0x1'));var moment=require('moment');var BPromise=require(_0xab0f('0x2'));var rs=require(_0xab0f('0x3'));var fs=require('fs');var Redis=require(_0xab0f('0x4'));var db=require(_0xab0f('0x5'))['db'];var utils=require(_0xab0f('0x6'));var logger=require(_0xab0f('0x7'))(_0xab0f('0x8'));var config=require(_0xab0f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bf769,_0x367849,_0x41cd9e){return new BPromise(function(_0x3a45bf,_0x1f95ed){return client[_0xab0f('0xb')](_0x5bf769,_0x41cd9e)['then'](function(_0x2f36df){logger[_0xab0f('0xc')]('CmCompany,\x20%s,\x20%s',_0x367849,_0xab0f('0xd'));logger[_0xab0f('0xe')](_0xab0f('0xf'),_0x367849,_0xab0f('0xd'),JSON[_0xab0f('0x10')](_0x2f36df));if(_0x2f36df[_0xab0f('0x11')]){if(_0x2f36df['error']['code']===0x1f4){logger[_0xab0f('0x11')]('CmCompany,\x20%s,\x20%s',_0x367849,_0x2f36df[_0xab0f('0x11')][_0xab0f('0x12')]);return _0x1f95ed(_0x2f36df['error'][_0xab0f('0x12')]);}logger['error'](_0xab0f('0x13'),_0x367849,_0x2f36df[_0xab0f('0x11')][_0xab0f('0x12')]);return _0x3a45bf(_0x2f36df[_0xab0f('0x11')][_0xab0f('0x12')]);}else{logger[_0xab0f('0xc')](_0xab0f('0x13'),_0x367849,_0xab0f('0xd'));_0x3a45bf(_0x2f36df[_0xab0f('0x14')][_0xab0f('0x12')]);}})[_0xab0f('0x15')](function(_0x276587){logger['error']('CmCompany,\x20%s,\x20%s',_0x367849,_0x276587);_0x1f95ed(_0x276587);});});}
\ No newline at end of file
+var _0xb172=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util'];(function(_0x3e0ba8,_0x562bf7){var _0xcecac3=function(_0x3ad54a){while(--_0x3ad54a){_0x3e0ba8['push'](_0x3e0ba8['shift']());}};_0xcecac3(++_0x562bf7);}(_0xb172,0x70));var _0x2b17=function(_0x3652a6,_0x1c76ad){_0x3652a6=_0x3652a6-0x0;var _0x28da2e=_0xb172[_0x3652a6];return _0x28da2e;};'use strict';var _=require(_0x2b17('0x0'));var util=require(_0x2b17('0x1'));var moment=require('moment');var BPromise=require(_0x2b17('0x2'));var rs=require(_0x2b17('0x3'));var fs=require('fs');var Redis=require(_0x2b17('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b17('0x5'));var logger=require('../../config/logger')(_0x2b17('0x6'));var config=require(_0x2b17('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b17('0x8')][_0x2b17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5719eb,_0x4b25ae,_0x14b904){return new BPromise(function(_0x91d10b,_0x45ff35){return client['request'](_0x5719eb,_0x14b904)[_0x2b17('0xa')](function(_0x479460){logger[_0x2b17('0xb')](_0x2b17('0xc'),_0x4b25ae,_0x2b17('0xd'));logger['debug'](_0x2b17('0xe'),_0x4b25ae,_0x2b17('0xd'),JSON['stringify'](_0x479460));if(_0x479460['error']){if(_0x479460[_0x2b17('0xf')][_0x2b17('0x10')]===0x1f4){logger[_0x2b17('0xf')](_0x2b17('0xc'),_0x4b25ae,_0x479460[_0x2b17('0xf')][_0x2b17('0x11')]);return _0x45ff35(_0x479460['error'][_0x2b17('0x11')]);}logger[_0x2b17('0xf')]('CmCompany,\x20%s,\x20%s',_0x4b25ae,_0x479460['error'][_0x2b17('0x11')]);return _0x91d10b(_0x479460[_0x2b17('0xf')][_0x2b17('0x11')]);}else{logger[_0x2b17('0xb')]('CmCompany,\x20%s,\x20%s',_0x4b25ae,_0x2b17('0xd'));_0x91d10b(_0x479460[_0x2b17('0x12')][_0x2b17('0x11')]);}})['catch'](function(_0x4fd7c1){logger[_0x2b17('0xf')](_0x2b17('0xc'),_0x4b25ae,_0x4fd7c1);_0x45ff35(_0x4fd7c1);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index ef0c370..8a5130a 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 _0x914a=['post','addContacts','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x914a,0x6b));var _0xa914=function(_0x5ecb26,_0xdd72bd){_0x5ecb26=_0x5ecb26-0x0;var _0x5c374a=_0x914a[_0x5ecb26];return _0x5c374a;};'use strict';var multer=require(_0xa914('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa914('0x1'));var express=require(_0xa914('0x2'));var router=express[_0xa914('0x3')]();var fs_extra=require(_0xa914('0x4'));var auth=require(_0xa914('0x5'));var interaction=require(_0xa914('0x6'));var config=require(_0xa914('0x7'));var controller=require(_0xa914('0x8'));router[_0xa914('0x9')]('/',auth[_0xa914('0xa')](),controller['index']);router[_0xa914('0x9')](_0xa914('0xb'),auth[_0xa914('0xa')](),controller[_0xa914('0xc')]);router[_0xa914('0x9')](_0xa914('0xd'),auth[_0xa914('0xa')](),controller[_0xa914('0xe')]);router[_0xa914('0x9')](_0xa914('0xf'),auth[_0xa914('0xa')](),controller[_0xa914('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa914('0x11')]);router[_0xa914('0x12')](_0xa914('0xf'),auth[_0xa914('0xa')](),controller[_0xa914('0x13')]);router[_0xa914('0x14')](_0xa914('0xd'),auth[_0xa914('0xa')](),controller[_0xa914('0x15')]);router[_0xa914('0x16')]('/:id',auth[_0xa914('0xa')](),controller[_0xa914('0x17')]);module[_0xa914('0x18')]=router;
\ No newline at end of file
+var _0x30a0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x6ddbbc,_0x5061a9){var _0xcb1ef0=function(_0x23f7ad){while(--_0x23f7ad){_0x6ddbbc['push'](_0x6ddbbc['shift']());}};_0xcb1ef0(++_0x5061a9);}(_0x30a0,0x19b));var _0x030a=function(_0xb55873,_0x5b0e91){_0xb55873=_0xb55873-0x0;var _0xc7408d=_0x30a0[_0xb55873];return _0xc7408d;};'use strict';var multer=require(_0x030a('0x0'));var util=require(_0x030a('0x1'));var path=require('path');var timeout=require(_0x030a('0x2'));var express=require(_0x030a('0x3'));var router=express[_0x030a('0x4')]();var fs_extra=require(_0x030a('0x5'));var auth=require(_0x030a('0x6'));var interaction=require(_0x030a('0x7'));var config=require('../../config/environment');var controller=require(_0x030a('0x8'));router[_0x030a('0x9')]('/',auth[_0x030a('0xa')](),controller[_0x030a('0xb')]);router[_0x030a('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x030a('0xc')]);router[_0x030a('0x9')](_0x030a('0xd'),auth[_0x030a('0xa')](),controller['show']);router[_0x030a('0x9')](_0x030a('0xe'),auth[_0x030a('0xa')](),controller['getContacts']);router[_0x030a('0xf')]('/',auth['isAuthenticated'](),controller[_0x030a('0x10')]);router['post'](_0x030a('0xe'),auth[_0x030a('0xa')](),controller[_0x030a('0x11')]);router[_0x030a('0x12')](_0x030a('0xd'),auth[_0x030a('0xa')](),controller[_0x030a('0x13')]);router[_0x030a('0x14')](_0x030a('0xd'),auth[_0x030a('0xa')](),controller[_0x030a('0x15')]);module[_0x030a('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index b501987..9f554ed 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 _0x2c2b=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x5539ea,_0x4f0539){var _0x21fc7c=function(_0xcebc50){while(--_0xcebc50){_0x5539ea['push'](_0x5539ea['shift']());}};_0x21fc7c(++_0x4f0539);}(_0x2c2b,0x68));var _0xb2c2=function(_0x399fb4,_0x3b9673){_0x399fb4=_0x399fb4-0x0;var _0x599673=_0x2c2b[_0x399fb4];return _0x599673;};'use strict';var _=require(_0xb2c2('0x0'));var Sequelize=require(_0xb2c2('0x1'));module[_0xb2c2('0x2')]={'firstName':{'type':Sequelize[_0xb2c2('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb2c2('0x3')]},'street':{'type':Sequelize[_0xb2c2('0x3')]},'postalCode':{'type':Sequelize[_0xb2c2('0x3')]},'city':{'type':Sequelize[_0xb2c2('0x3')]},'country':{'type':Sequelize[_0xb2c2('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb2c2('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xb2c2('0x3')]},'fax':{'type':Sequelize[_0xb2c2('0x3')]},'email':{'type':Sequelize[_0xb2c2('0x3')]},'url':{'type':Sequelize[_0xb2c2('0x3')]},'facebook':{'type':Sequelize[_0xb2c2('0x3')]},'fb_data':{'type':Sequelize[_0xb2c2('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xb2c2('0x3')]},'line':{'type':Sequelize[_0xb2c2('0x3')]},'wechat':{'type':Sequelize[_0xb2c2('0x3')]},'telegram':{'type':Sequelize[_0xb2c2('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xb2c2('0x3')]},'priority':{'type':Sequelize[_0xb2c2('0x5')](0x2)[_0xb2c2('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xb2c2('0x7')]},'dialTimezone':{'type':Sequelize[_0xb2c2('0x3')]},'utcOffset':{'type':Sequelize[_0xb2c2('0x5')]}};
\ No newline at end of file
+var _0x5dca=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','exports'];(function(_0x391606,_0x1407f2){var _0xad5ff7=function(_0x187d18){while(--_0x187d18){_0x391606['push'](_0x391606['shift']());}};_0xad5ff7(++_0x1407f2);}(_0x5dca,0xfe));var _0xa5dc=function(_0x270dc6,_0xf1afd0){_0x270dc6=_0x270dc6-0x0;var _0x9fce80=_0x5dca[_0x270dc6];return _0x9fce80;};'use strict';var _=require(_0xa5dc('0x0'));var Sequelize=require('sequelize');module[_0xa5dc('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa5dc('0x2')]},'street':{'type':Sequelize[_0xa5dc('0x2')]},'postalCode':{'type':Sequelize[_0xa5dc('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa5dc('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa5dc('0x2')]},'description':{'type':Sequelize[_0xa5dc('0x3')]},'phone':{'type':Sequelize[_0xa5dc('0x2')]},'mobile':{'type':Sequelize[_0xa5dc('0x2')]},'fax':{'type':Sequelize[_0xa5dc('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xa5dc('0x2')]},'facebook':{'type':Sequelize[_0xa5dc('0x2')]},'fb_data':{'type':Sequelize[_0xa5dc('0x2')]},'twitter':{'type':Sequelize[_0xa5dc('0x2')]},'skype':{'type':Sequelize[_0xa5dc('0x2')]},'teams':{'type':Sequelize[_0xa5dc('0x2')]},'viber':{'type':Sequelize[_0xa5dc('0x2')]},'line':{'type':Sequelize[_0xa5dc('0x2')]},'wechat':{'type':Sequelize[_0xa5dc('0x2')]},'telegram':{'type':Sequelize[_0xa5dc('0x2')]},'UserId':{'type':Sequelize[_0xa5dc('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa5dc('0x4')](0x2)[_0xa5dc('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa5dc('0x6')],'defaultValue':Sequelize[_0xa5dc('0x7')]},'dialTimezone':{'type':Sequelize[_0xa5dc('0x2')]},'utcOffset':{'type':Sequelize[_0xa5dc('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 5f32afe..4eba933 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','base64','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment'];(function(_0x3ebf89,_0x380730){var _0xf8e782=function(_0x193c9b){while(--_0x193c9b){_0x3ebf89['push'](_0x3ebf89['shift']());}};_0xf8e782(++_0x380730);}(_0xa50b,0x1a3));var _0xba50=function(_0x3cf18c,_0x520870){_0x3cf18c=_0x3cf18c-0x0;var _0xc8e728=_0xa50b[_0x3cf18c];return _0xc8e728;};'use strict';var _=require('lodash');var moment=require(_0xba50('0x0'));var random=require(_0xba50('0x1'));var fs=require('fs');var path=require(_0xba50('0x2'));var util=require(_0xba50('0x3'));var tnef=require('node-tnef');var logger=require(_0xba50('0x4'))(_0xba50('0x5'));var config=require(_0xba50('0x6'));function getAddress(_0x101789){var _0x258796=_[_0xba50('0x7')](_0x101789['value']);return _0x258796&&_0x258796[_0xba50('0x8')]?_0x258796[_0xba50('0x8')]:'anonymous'+random[_0xba50('0x9')](0x6)+_0xba50('0xa');}function getFirstName(_0x2979bc){var _0x4c91ba=_[_0xba50('0x7')](_0x2979bc[_0xba50('0xb')]);if(_0x4c91ba&&_0x4c91ba[_0xba50('0xc')]){if(_0x4c91ba[_0xba50('0xc')]==_0x4c91ba['address']){return _0x4c91ba[_0xba50('0xc')][_0xba50('0xd')](0x0,_0x4c91ba[_0xba50('0xc')]['indexOf']('@'));}var _0x429237=_0x4c91ba[_0xba50('0xc')][_0xba50('0xe')](/\s+/);return _0x429237[_0xba50('0xf')]>0x1?_0x429237['slice'](0x0,-0x1)[_0xba50('0x10')]('\x20'):_0x4c91ba[_0xba50('0xc')];}return _0xba50('0x11');}function getLastName(_0x1c0f02){var _0x308335=_['head'](_0x1c0f02['value']);if(_0x308335&&_0x308335[_0xba50('0xc')]){var _0x1b03f7=_0x308335[_0xba50('0xc')]['split'](/\s+/);return _0x1b03f7[_0xba50('0xf')]>0x1?_0x1b03f7['pop']():'';}return'';}function getMails(_0x3121d7,_0x158e5d){var _0xb51721='';for(var _0x4de9b9=0x0;_0x4de9b9<_0x158e5d[_0xba50('0xb')][_0xba50('0xf')];_0x4de9b9+=0x1){if(_0x158e5d[_0xba50('0xb')][_0x4de9b9][_0xba50('0x8')]!==_0x3121d7){if(!_['isEmpty'](_0xb51721)){_0xb51721+=',';}_0xb51721+=_0x158e5d[_0xba50('0xb')][_0x4de9b9][_0xba50('0xc')]||_0x158e5d['value'][_0x4de9b9][_0xba50('0x8')]||'';_0xb51721+='\x20<';_0xb51721+=_0x158e5d['value'][_0x4de9b9][_0xba50('0x8')]?_0x158e5d[_0xba50('0xb')][_0x4de9b9][_0xba50('0x8')]:'anonymous'+random['generate'](0x6)+_0xba50('0xa');_0xb51721+='>';}}return _0xb51721;}function parseEmail(_0x38b564,_0x599281,_0x3b7146){if(_0x599281[_0xba50('0x12')]){var _0xe115c9=/