From: support
Date: Thu, 5 Jan 2023 16:34:13 +0000 (+0000)
Subject: Built motion from commit 449495f6.|2.6.27
X-Git-Tag: 2.6.27
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=d2fd33d6b242a53e18c7b82fe692ff8c6c0965a8;p=motion2.git
Built motion from commit 449495f6.|2.6.27
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index fafc24a..d5eea94 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.26",
+ "version": "2.6.27",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-12-29T08:11:16.086Z",
+ "time": "2023-01-05T16:26:57.371Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 4fb8ff5..4734fb1 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.26",
+ "version": "2.6.27",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-12-29T08:11:16.086Z",
+ "time": "2023-01-05T16:26:57.371Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 56d8b49..c8e0ad6 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.26",
+ "version": "2.6.27",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index c4abd4f..808f6a3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.26",
+ "version": "2.6.27",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 27cc0a0..9b55e19 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 _0x5926=['urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT'];(function(_0x52fd4d,_0x8aa448){var _0x24e5ab=function(_0x2040a1){while(--_0x2040a1){_0x52fd4d['push'](_0x52fd4d['shift']());}};_0x24e5ab(++_0x8aa448);}(_0x5926,0x10f));var _0x6592=function(_0x176018,_0x4879f3){_0x176018=_0x176018-0x0;var _0x11fe38=_0x5926[_0x176018];return _0x11fe38;};'use strict';var Sequelize=require('sequelize');module[_0x6592('0x0')]={'name':{'type':Sequelize[_0x6592('0x1')],'get':function(_0x4f35db){return this[_0x6592('0x2')](_0x6592('0x3'));}},'action':{'type':Sequelize[_0x6592('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6592('0x5'),'integration','motionbar',_0x6592('0x6'),_0x6592('0x7'),_0x6592('0x8'),_0x6592('0x9'),_0x6592('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x6592('0xb')},'data1':{'type':Sequelize['STRING'](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[_0x6592('0x4')](0x1000),'comment':_0x6592('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x6592('0xd')},'data4':{'type':Sequelize[_0x6592('0x4')](0x1000),'comments':_0x6592('0xe')},'data5':{'type':Sequelize[_0x6592('0x4')](0x1000),'comments':_0x6592('0xf')},'data6':{'type':Sequelize[_0x6592('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x6592('0x10')],'comments':_0x6592('0x11')}};
\ No newline at end of file
+var _0x5797=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','getDataValue','STRING','integration','motionbar','jscripty','browser','bot'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5797,0xc4));var _0x7579=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x5797[_0x4b73a2];return _0x383c66;};'use strict';var Sequelize=require('sequelize');module[_0x7579('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3d4c7f){return this[_0x7579('0x1')]('action');}},'action':{'type':Sequelize[_0x7579('0x2')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x7579('0x3'),_0x7579('0x4'),_0x7579('0x5'),'urlForward',_0x7579('0x6'),_0x7579('0x7'),_0x7579('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x7579('0x9')},'data1':{'type':Sequelize[_0x7579('0x2')](0x1000),'comment':_0x7579('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x7579('0x2')](0x1000),'comment':_0x7579('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x7579('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x7579('0xd')},'data6':{'type':Sequelize[_0x7579('0x2')],'comments':_0x7579('0xe')},'data7':{'type':Sequelize[_0x7579('0xf')],'comments':_0x7579('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 09aca17..15abf51 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 _0x3f97=['send','body','params','destroy','Action','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','save','update','then','error','stack','name'];(function(_0x503e78,_0x411076){var _0x591b4a=function(_0x1dc3dc){while(--_0x1dc3dc){_0x503e78['push'](_0x503e78['shift']());}};_0x591b4a(++_0x411076);}(_0x3f97,0x1f1));var _0x73f9=function(_0x1b0875,_0x2c460f){_0x1b0875=_0x1b0875-0x0;var _0x5e6a1e=_0x3f97[_0x1b0875];return _0x5e6a1e;};'use strict';var emlformat=require(_0x73f9('0x0'));var rimraf=require(_0x73f9('0x1'));var zipdir=require(_0x73f9('0x2'));var jsonpatch=require(_0x73f9('0x3'));var rp=require(_0x73f9('0x4'));var moment=require(_0x73f9('0x5'));var BPromise=require(_0x73f9('0x6'));var Mustache=require(_0x73f9('0x7'));var util=require('util');var path=require(_0x73f9('0x8'));var sox=require(_0x73f9('0x9'));var csv=require(_0x73f9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73f9('0xb'));var _=require(_0x73f9('0xc'));var squel=require(_0x73f9('0xd'));var crypto=require(_0x73f9('0xe'));var jsforce=require(_0x73f9('0xf'));var deskjs=require(_0x73f9('0x10'));var toCsv=require(_0x73f9('0xa'));var querystring=require('querystring');var Papa=require(_0x73f9('0x11'));var Redis=require(_0x73f9('0x12'));var authService=require(_0x73f9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x73f9('0x14'));var hardwareService=require(_0x73f9('0x15'));var logger=require(_0x73f9('0x16'))(_0x73f9('0x17'));var utils=require(_0x73f9('0x18'));var config=require(_0x73f9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x73f9('0x1a'))['db'];function respondWithStatusCode(_0x2e153e,_0x4c983e){_0x4c983e=_0x4c983e||0xcc;return function(_0xc09ca8){if(_0xc09ca8){return _0x2e153e[_0x73f9('0x1b')](_0x4c983e);}return _0x2e153e[_0x73f9('0x1c')](_0x4c983e)[_0x73f9('0x1d')]();};}function respondWithResult(_0x5b975e,_0x30ec24){_0x30ec24=_0x30ec24||0xc8;return function(_0x13dc6c){if(_0x13dc6c){return _0x5b975e[_0x73f9('0x1c')](_0x30ec24)[_0x73f9('0x1e')](_0x13dc6c);}};}function respondWithFilteredResult(_0x436236,_0x56b498){return function(_0x868cd1){if(_0x868cd1){var _0x345214=typeof _0x56b498[_0x73f9('0x1f')]===_0x73f9('0x20')&&typeof _0x56b498[_0x73f9('0x21')]===_0x73f9('0x20');var _0x34fb96=_0x868cd1['count'];var _0x3497cc=_0x345214?0x0:_0x56b498[_0x73f9('0x1f')];var _0x3872cf=_0x345214?_0x868cd1['count']:_0x56b498['offset']+_0x56b498[_0x73f9('0x21')];var _0x2e8943;if(_0x3872cf>=_0x34fb96){_0x3872cf=_0x34fb96;_0x2e8943=0xc8;}else{_0x2e8943=0xce;}_0x436236[_0x73f9('0x1c')](_0x2e8943);return _0x436236['set'](_0x73f9('0x22'),_0x3497cc+'-'+_0x3872cf+'/'+_0x34fb96)['json'](_0x868cd1);}return null;};}function patchUpdates(_0x29442f){return function(_0x597c18){try{jsonpatch['apply'](_0x597c18,_0x29442f,!![]);}catch(_0x18a762){return BPromise[_0x73f9('0x23')](_0x18a762);}return _0x597c18[_0x73f9('0x24')]();};}function saveUpdates(_0x500a22,_0x31e03e){return function(_0x1c6d30){if(_0x1c6d30){return _0x1c6d30[_0x73f9('0x25')](_0x500a22)[_0x73f9('0x26')](function(_0x13bdc9){return _0x13bdc9;});}return null;};}function removeEntity(_0x39cc88,_0x1999ed){return function(_0x281c54){if(_0x281c54){return _0x281c54['destroy']()['then'](function(){_0x39cc88[_0x73f9('0x1c')](0xcc)[_0x73f9('0x1d')]();});}};}function handleEntityNotFound(_0x2ceddc,_0x1cb64f){return function(_0xce79b1){if(!_0xce79b1){_0x2ceddc[_0x73f9('0x1b')](0x194);}return _0xce79b1;};}function handleError(_0x13f1fe,_0x4f9d73){_0x4f9d73=_0x4f9d73||0x1f4;return function(_0x555d98){logger[_0x73f9('0x27')](_0x555d98[_0x73f9('0x28')]);if(_0x555d98[_0x73f9('0x29')]){delete _0x555d98['name'];}_0x13f1fe[_0x73f9('0x1c')](_0x4f9d73)[_0x73f9('0x2a')](_0x555d98);};}exports['update']=function(_0x3be7fb,_0x2d8cda){if(_0x3be7fb[_0x73f9('0x2b')]['id']){delete _0x3be7fb[_0x73f9('0x2b')]['id'];}return db['Action']['find']({'where':{'id':_0x3be7fb[_0x73f9('0x2c')]['id']}})[_0x73f9('0x26')](handleEntityNotFound(_0x2d8cda,null))[_0x73f9('0x26')](saveUpdates(_0x3be7fb[_0x73f9('0x2b')],null))[_0x73f9('0x26')](respondWithResult(_0x2d8cda,null))['catch'](handleError(_0x2d8cda,null));};exports[_0x73f9('0x2d')]=function(_0x267842,_0x574337){return db[_0x73f9('0x2e')][_0x73f9('0x2f')]({'where':{'id':_0x267842[_0x73f9('0x2c')]['id']}})[_0x73f9('0x26')](handleEntityNotFound(_0x574337,null))['then'](removeEntity(_0x574337,null))[_0x73f9('0x30')](handleError(_0x574337,null));};
\ No newline at end of file
+var _0xd7ff=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x303616,_0xa105d9){var _0xe86373=function(_0x38cc79){while(--_0x38cc79){_0x303616['push'](_0x303616['shift']());}};_0xe86373(++_0xa105d9);}(_0xd7ff,0x17d));var _0xfd7f=function(_0x5d7ef8,_0x190075){_0x5d7ef8=_0x5d7ef8-0x0;var _0x306a8d=_0xd7ff[_0x5d7ef8];return _0x306a8d;};'use strict';var emlformat=require(_0xfd7f('0x0'));var rimraf=require(_0xfd7f('0x1'));var zipdir=require(_0xfd7f('0x2'));var jsonpatch=require(_0xfd7f('0x3'));var rp=require('request-promise');var moment=require(_0xfd7f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfd7f('0x5'));var util=require(_0xfd7f('0x6'));var path=require(_0xfd7f('0x7'));var sox=require(_0xfd7f('0x8'));var csv=require('to-csv');var ejs=require(_0xfd7f('0x9'));var fs=require('fs');var fs_extra=require(_0xfd7f('0xa'));var _=require(_0xfd7f('0xb'));var squel=require(_0xfd7f('0xc'));var crypto=require(_0xfd7f('0xd'));var jsforce=require(_0xfd7f('0xe'));var deskjs=require(_0xfd7f('0xf'));var toCsv=require(_0xfd7f('0x10'));var querystring=require(_0xfd7f('0x11'));var Papa=require(_0xfd7f('0x12'));var Redis=require(_0xfd7f('0x13'));var authService=require(_0xfd7f('0x14'));var qs=require(_0xfd7f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd7f('0x16'));var logger=require(_0xfd7f('0x17'))(_0xfd7f('0x18'));var utils=require('../../config/utils');var config=require(_0xfd7f('0x19'));var licenseUtil=require(_0xfd7f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11af8b,_0x1401b5){_0x1401b5=_0x1401b5||0xcc;return function(_0x102746){if(_0x102746){return _0x11af8b[_0xfd7f('0x1b')](_0x1401b5);}return _0x11af8b[_0xfd7f('0x1c')](_0x1401b5)[_0xfd7f('0x1d')]();};}function respondWithResult(_0x2f6e28,_0x586e12){_0x586e12=_0x586e12||0xc8;return function(_0x396e25){if(_0x396e25){return _0x2f6e28[_0xfd7f('0x1c')](_0x586e12)[_0xfd7f('0x1e')](_0x396e25);}};}function respondWithFilteredResult(_0xa96aca,_0x4f9e33){return function(_0x1b0659){if(_0x1b0659){var _0x27b91a=typeof _0x4f9e33['offset']===_0xfd7f('0x1f')&&typeof _0x4f9e33[_0xfd7f('0x20')]===_0xfd7f('0x1f');var _0x4d90e9=_0x1b0659[_0xfd7f('0x21')];var _0x5df5a3=_0x27b91a?0x0:_0x4f9e33[_0xfd7f('0x22')];var _0x3d61a6=_0x27b91a?_0x1b0659[_0xfd7f('0x21')]:_0x4f9e33['offset']+_0x4f9e33[_0xfd7f('0x20')];var _0x21cf28;if(_0x3d61a6>=_0x4d90e9){_0x3d61a6=_0x4d90e9;_0x21cf28=0xc8;}else{_0x21cf28=0xce;}_0xa96aca[_0xfd7f('0x1c')](_0x21cf28);return _0xa96aca[_0xfd7f('0x23')](_0xfd7f('0x24'),_0x5df5a3+'-'+_0x3d61a6+'/'+_0x4d90e9)['json'](_0x1b0659);}return null;};}function patchUpdates(_0x3b975a){return function(_0xeeb9e9){try{jsonpatch[_0xfd7f('0x25')](_0xeeb9e9,_0x3b975a,!![]);}catch(_0x2326a5){return BPromise[_0xfd7f('0x26')](_0x2326a5);}return _0xeeb9e9[_0xfd7f('0x27')]();};}function saveUpdates(_0x49a0b6,_0xe5d228){return function(_0x260f7f){if(_0x260f7f){return _0x260f7f[_0xfd7f('0x28')](_0x49a0b6)[_0xfd7f('0x29')](function(_0x39ca52){return _0x39ca52;});}return null;};}function removeEntity(_0x697382,_0x353e5e){return function(_0x1b5eca){if(_0x1b5eca){return _0x1b5eca['destroy']()[_0xfd7f('0x29')](function(){_0x697382[_0xfd7f('0x1c')](0xcc)[_0xfd7f('0x1d')]();});}};}function handleEntityNotFound(_0x4c735b,_0x3aa4b1){return function(_0x81ca6){if(!_0x81ca6){_0x4c735b[_0xfd7f('0x1b')](0x194);}return _0x81ca6;};}function handleError(_0x1f2c02,_0x37efd3){_0x37efd3=_0x37efd3||0x1f4;return function(_0x490592){logger['error'](_0x490592[_0xfd7f('0x2a')]);if(_0x490592[_0xfd7f('0x2b')]){delete _0x490592[_0xfd7f('0x2b')];}_0x1f2c02[_0xfd7f('0x1c')](_0x37efd3)[_0xfd7f('0x2c')](_0x490592);};}exports[_0xfd7f('0x28')]=function(_0x54047f,_0x10d62f){if(_0x54047f[_0xfd7f('0x2d')]['id']){delete _0x54047f[_0xfd7f('0x2d')]['id'];}return db[_0xfd7f('0x2e')][_0xfd7f('0x2f')]({'where':{'id':_0x54047f[_0xfd7f('0x30')]['id']}})[_0xfd7f('0x29')](handleEntityNotFound(_0x10d62f,null))[_0xfd7f('0x29')](saveUpdates(_0x54047f[_0xfd7f('0x2d')],null))[_0xfd7f('0x29')](respondWithResult(_0x10d62f,null))['catch'](handleError(_0x10d62f,null));};exports['destroy']=function(_0x4d4eb2,_0x575f35){return db[_0xfd7f('0x2e')][_0xfd7f('0x2f')]({'where':{'id':_0x4d4eb2[_0xfd7f('0x30')]['id']}})[_0xfd7f('0x29')](handleEntityNotFound(_0x575f35,null))['then'](removeEntity(_0x575f35,null))[_0xfd7f('0x31')](handleError(_0x575f35,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 00d2f57..cca4305 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 _0x56fc=['path','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x56fc,0x13e));var _0xc56f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x56fc[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xc56f('0x0'));var util=require('util');var logger=require(_0xc56f('0x1'))(_0xc56f('0x2'));var moment=require(_0xc56f('0x3'));var BPromise=require(_0xc56f('0x4'));var rp=require(_0xc56f('0x5'));var fs=require('fs');var path=require(_0xc56f('0x6'));var rimraf=require('rimraf');var config=require(_0xc56f('0x7'));var attributes=require(_0xc56f('0x8'));module[_0xc56f('0x9')]=function(_0x2d65c6,_0x2bccdd){return _0x2d65c6['define'](_0xc56f('0xa'),attributes,{'tableName':_0xc56f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cc1=['api','moment','bluebird','request-promise','./action.attributes','exports','define','tools_actions','util','../../config/logger'];(function(_0x39c326,_0x3273f5){var _0x2c8578=function(_0x3e6c2c){while(--_0x3e6c2c){_0x39c326['push'](_0x39c326['shift']());}};_0x2c8578(++_0x3273f5);}(_0x5cc1,0xe4));var _0x15cc=function(_0x5a3e4c,_0x5f39e7){_0x5a3e4c=_0x5a3e4c-0x0;var _0x190289=_0x5cc1[_0x5a3e4c];return _0x190289;};'use strict';var _=require('lodash');var util=require(_0x15cc('0x0'));var logger=require(_0x15cc('0x1'))(_0x15cc('0x2'));var moment=require(_0x15cc('0x3'));var BPromise=require(_0x15cc('0x4'));var rp=require(_0x15cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x15cc('0x6'));module[_0x15cc('0x7')]=function(_0x576be6,_0x5bfa13){return _0x576be6[_0x15cc('0x8')]('Action',attributes,{'tableName':_0x15cc('0x9'),'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 7820782..30f1091 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x58b5d3,_0x4fba15){var _0x2130a1=function(_0x4c913f){while(--_0x4c913f){_0x58b5d3['push'](_0x58b5d3['shift']());}};_0x2130a1(++_0x4fba15);}(_0x1261,0x144));var _0x1126=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x1261[_0x3aeb36];return _0xa2ef21;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _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(_0x840e9f,_0x4bb2df){var _0xf748ce=function(_0x255dc0){while(--_0x255dc0){_0x840e9f['push'](_0x840e9f['shift']());}};_0xf748ce(++_0x4bb2df);}(_0xe14b,0x93));var _0xbe14=function(_0x539bc1,_0x1eb37f){_0x539bc1=_0x539bc1-0x0;var _0x57528e=_0xe14b[_0x539bc1];return _0x57528e;};'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
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 97b8a1b..35a8677 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 _0xbd84=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','delete','destroy','util','path'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xbd84,0x108));var _0x4bd8=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xbd84[_0x40220a];return _0x3903cc;};'use strict';var multer=require('multer');var util=require(_0x4bd8('0x0'));var path=require(_0x4bd8('0x1'));var timeout=require(_0x4bd8('0x2'));var express=require(_0x4bd8('0x3'));var router=express[_0x4bd8('0x4')]();var fs_extra=require(_0x4bd8('0x5'));var auth=require(_0x4bd8('0x6'));var interaction=require(_0x4bd8('0x7'));var config=require(_0x4bd8('0x8'));var controller=require(_0x4bd8('0x9'));router[_0x4bd8('0xa')]('/:id',auth[_0x4bd8('0xb')](),controller['update']);router[_0x4bd8('0xc')]('/:id',auth[_0x4bd8('0xb')](),controller[_0x4bd8('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xb58f=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','update','delete','isAuthenticated','destroy','exports','multer','util'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0xb58f,0xfa));var _0xfb58=function(_0x276cdc,_0x130336){_0x276cdc=_0x276cdc-0x0;var _0x1bd585=_0xb58f[_0x276cdc];return _0x1bd585;};'use strict';var multer=require(_0xfb58('0x0'));var util=require(_0xfb58('0x1'));var path=require('path');var timeout=require(_0xfb58('0x2'));var express=require(_0xfb58('0x3'));var router=express['Router']();var fs_extra=require(_0xfb58('0x4'));var auth=require(_0xfb58('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfb58('0x6'));var controller=require(_0xfb58('0x7'));router[_0xfb58('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xfb58('0x9')]);router[_0xfb58('0xa')]('/:id',auth[_0xfb58('0xb')](),controller[_0xfb58('0xc')]);module[_0xfb58('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 4094cb1..ac6ffcc 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 _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x17aa79,_0x5c02db){var _0x16ed3c=function(_0x38e37d){while(--_0x38e37d){_0x17aa79['push'](_0x17aa79['shift']());}};_0x16ed3c(++_0x5c02db);}(_0xabce,0x103));var _0xeabc=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xabce[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
+var _0xda19=['exports','STRING','TEXT'];(function(_0x394d49,_0x51dfa0){var _0x27dd6c=function(_0x356667){while(--_0x356667){_0x394d49['push'](_0x394d49['shift']());}};_0x27dd6c(++_0x51dfa0);}(_0xda19,0xd5));var _0x9da1=function(_0x597eac,_0x22bcb0){_0x597eac=_0x597eac-0x0;var _0x5f3db1=_0xda19[_0x597eac];return _0x5f3db1;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index e2ecdd0..645135f 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 _0x6d2a=['merge','VIRTUAL','options','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','Limited\x20Query:','sequelize','toString','join','right_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','MetricId','foreignKey','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','QueryTypes','run','runReport','MAX(%s)','GROUP_CONCAT(%s)','debug','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','undefined','offset','count','limit','set','apply','save','update','then','destroy','get','CustomReports','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter'];(function(_0x3bdb09,_0x2f1fb7){var _0x5f3ec7=function(_0x2fe58f){while(--_0x2fe58f){_0x3bdb09['push'](_0x3bdb09['shift']());}};_0x5f3ec7(++_0x2f1fb7);}(_0x6d2a,0x10e));var _0xa6d2=function(_0x5adb18,_0x222326){_0x5adb18=_0x5adb18-0x0;var _0x420c98=_0x6d2a[_0x5adb18];return _0x420c98;};'use strict';var emlformat=require(_0xa6d2('0x0'));var rimraf=require(_0xa6d2('0x1'));var zipdir=require(_0xa6d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa6d2('0x3'));var BPromise=require(_0xa6d2('0x4'));var Mustache=require('mustache');var util=require(_0xa6d2('0x5'));var path=require(_0xa6d2('0x6'));var sox=require(_0xa6d2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6d2('0x8'));var _=require(_0xa6d2('0x9'));var squel=require(_0xa6d2('0xa'));var crypto=require(_0xa6d2('0xb'));var jsforce=require(_0xa6d2('0xc'));var deskjs=require(_0xa6d2('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa6d2('0xe'));var Redis=require(_0xa6d2('0xf'));var authService=require(_0xa6d2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6d2('0x11'))('api');var utils=require(_0xa6d2('0x12'));var config=require(_0xa6d2('0x13'));var licenseUtil=require(_0xa6d2('0x14'));var db=require(_0xa6d2('0x15'))['db'];var dbH=require('../../mysqldb')[_0xa6d2('0x16')];function respondWithStatusCode(_0x26c233,_0x4dd74f){_0x4dd74f=_0x4dd74f||0xcc;return function(_0x4de15d){if(_0x4de15d){return _0x26c233[_0xa6d2('0x17')](_0x4dd74f);}return _0x26c233[_0xa6d2('0x18')](_0x4dd74f)['end']();};}function respondWithResult(_0x47933e,_0x460820){_0x460820=_0x460820||0xc8;return function(_0x47e4b9){if(_0x47e4b9){return _0x47933e[_0xa6d2('0x18')](_0x460820)[_0xa6d2('0x19')](_0x47e4b9);}};}function respondWithFilteredResult(_0x581e83,_0x6de58c){return function(_0x1e4b65){if(_0x1e4b65){var _0x17c423=typeof _0x6de58c['offset']==='undefined'&&typeof _0x6de58c['limit']===_0xa6d2('0x1a');var _0x5e9ec5=_0x1e4b65['count'];var _0x4f3843=_0x17c423?0x0:_0x6de58c[_0xa6d2('0x1b')];var _0x525aec=_0x17c423?_0x1e4b65[_0xa6d2('0x1c')]:_0x6de58c[_0xa6d2('0x1b')]+_0x6de58c[_0xa6d2('0x1d')];var _0x5615b1;if(_0x525aec>=_0x5e9ec5){_0x525aec=_0x5e9ec5;_0x5615b1=0xc8;}else{_0x5615b1=0xce;}_0x581e83[_0xa6d2('0x18')](_0x5615b1);return _0x581e83[_0xa6d2('0x1e')]('Content-Range',_0x4f3843+'-'+_0x525aec+'/'+_0x5e9ec5)[_0xa6d2('0x19')](_0x1e4b65);}return null;};}function patchUpdates(_0x396dbe){return function(_0xe41488){try{jsonpatch[_0xa6d2('0x1f')](_0xe41488,_0x396dbe,!![]);}catch(_0x33601d){return BPromise['reject'](_0x33601d);}return _0xe41488[_0xa6d2('0x20')]();};}function saveUpdates(_0x3b2d7d,_0x2910e0){return function(_0x5653ba){if(_0x5653ba){return _0x5653ba[_0xa6d2('0x21')](_0x3b2d7d)[_0xa6d2('0x22')](function(_0xbbdb09){return _0xbbdb09;});}return null;};}function removeEntity(_0x2b9a25,_0x29710f){return function(_0x580fd4){if(_0x580fd4){return _0x580fd4[_0xa6d2('0x23')]()[_0xa6d2('0x22')](function(){var _0x3ac971=_0x580fd4[_0xa6d2('0x24')]({'plain':!![]});var _0x10d228=_0xa6d2('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x10d228,'resourceId':_0x3ac971['id']}})[_0xa6d2('0x22')](function(){return _0x580fd4;});})[_0xa6d2('0x22')](function(){_0x2b9a25[_0xa6d2('0x18')](0xcc)[_0xa6d2('0x26')]();});}};}function handleEntityNotFound(_0x1b2c75,_0x1078b9){return function(_0x585b8e){if(!_0x585b8e){_0x1b2c75[_0xa6d2('0x17')](0x194);}return _0x585b8e;};}function handleError(_0x470a0a,_0x5b1027){_0x5b1027=_0x5b1027||0x1f4;return function(_0x560e7e){logger[_0xa6d2('0x27')](_0x560e7e[_0xa6d2('0x28')]);if(_0x560e7e[_0xa6d2('0x29')]){delete _0x560e7e[_0xa6d2('0x29')];}_0x470a0a[_0xa6d2('0x18')](_0x5b1027)[_0xa6d2('0x2a')](_0x560e7e);};}exports[_0xa6d2('0x2b')]=function(_0xee1dc5,_0x465030){var _0x1c6e7d={},_0x3d260b={},_0x4366cd={'count':0x0,'rows':[]};var _0x14fa04=_[_0xa6d2('0x2c')](db[_0xa6d2('0x2d')][_0xa6d2('0x2e')],function(_0x265c73){return{'name':_0x265c73[_0xa6d2('0x2f')],'type':_0x265c73[_0xa6d2('0x30')]['key']};});_0x3d260b['model']=_[_0xa6d2('0x2c')](_0x14fa04,_0xa6d2('0x29'));_0x3d260b[_0xa6d2('0x31')]=_[_0xa6d2('0x32')](_0xee1dc5[_0xa6d2('0x31')]);_0x3d260b['filters']=_['intersection'](_0x3d260b[_0xa6d2('0x33')],_0x3d260b[_0xa6d2('0x31')]);_0x1c6e7d['attributes']=_[_0xa6d2('0x34')](_0x3d260b[_0xa6d2('0x33')],qs[_0xa6d2('0x35')](_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x35')]));_0x1c6e7d['attributes']=_0x1c6e7d[_0xa6d2('0x36')][_0xa6d2('0x37')]?_0x1c6e7d['attributes']:_0x3d260b['model'];if(!_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x38')]('nolimit')){_0x1c6e7d[_0xa6d2('0x1d')]=qs[_0xa6d2('0x1d')](_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x1d')]);_0x1c6e7d[_0xa6d2('0x1b')]=qs[_0xa6d2('0x1b')](_0xee1dc5[_0xa6d2('0x31')]['offset']);}_0x1c6e7d[_0xa6d2('0x39')]=qs[_0xa6d2('0x3a')](_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x3a')]);_0x1c6e7d[_0xa6d2('0x3b')]=qs[_0xa6d2('0x3c')](_['pick'](_0xee1dc5[_0xa6d2('0x31')],_0x3d260b[_0xa6d2('0x3c')]),_0x14fa04);if(_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x3d')]){_0x1c6e7d['where']=_[_0xa6d2('0x3e')](_0x1c6e7d[_0xa6d2('0x3b')],{'$or':_[_0xa6d2('0x2c')](_0x14fa04,function(_0x18b49a){if(_0x18b49a[_0xa6d2('0x30')]!==_0xa6d2('0x3f')){var _0x3f5421={};_0x3f5421[_0x18b49a[_0xa6d2('0x29')]]={'$like':'%'+_0xee1dc5[_0xa6d2('0x31')][_0xa6d2('0x3d')]+'%'};return _0x3f5421;}})});}_0x1c6e7d=_['merge']({},_0x1c6e7d,_0xee1dc5[_0xa6d2('0x40')]);var _0x1dc07c={'where':_0x1c6e7d[_0xa6d2('0x3b')]};return db[_0xa6d2('0x2d')]['count'](_0x1dc07c)[_0xa6d2('0x22')](function(_0x56f547){_0x4366cd[_0xa6d2('0x1c')]=_0x56f547;if(_0xee1dc5[_0xa6d2('0x31')]['includeAll']){_0x1c6e7d[_0xa6d2('0x41')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x1c6e7d);})['then'](function(_0x4ee192){_0x4366cd[_0xa6d2('0x42')]=_0x4ee192;return _0x4366cd;})[_0xa6d2('0x22')](respondWithFilteredResult(_0x465030,_0x1c6e7d))[_0xa6d2('0x43')](handleError(_0x465030,null));};exports[_0xa6d2('0x44')]=function(_0x1b5cee,_0x7d867d){var _0x41369d={'raw':![],'where':{'id':_0x1b5cee[_0xa6d2('0x45')]['id']}},_0x20f664={};_0x20f664[_0xa6d2('0x33')]=_['keys'](db[_0xa6d2('0x2d')][_0xa6d2('0x2e')]);_0x20f664[_0xa6d2('0x31')]=_[_0xa6d2('0x32')](_0x1b5cee['query']);_0x20f664[_0xa6d2('0x3c')]=_[_0xa6d2('0x34')](_0x20f664[_0xa6d2('0x33')],_0x20f664[_0xa6d2('0x31')]);_0x41369d['attributes']=_[_0xa6d2('0x34')](_0x20f664[_0xa6d2('0x33')],qs['fields'](_0x1b5cee[_0xa6d2('0x31')][_0xa6d2('0x35')]));_0x41369d[_0xa6d2('0x36')]=_0x41369d['attributes']['length']?_0x41369d[_0xa6d2('0x36')]:_0x20f664[_0xa6d2('0x33')];if(_0x1b5cee['query']['includeAll']){_0x41369d['include']=[{'all':!![]}];}_0x41369d=_[_0xa6d2('0x3e')]({},_0x41369d,_0x1b5cee[_0xa6d2('0x40')]);return db['AnalyticCustomReport'][_0xa6d2('0x46')](_0x41369d)[_0xa6d2('0x22')](handleEntityNotFound(_0x7d867d,null))[_0xa6d2('0x22')](respondWithResult(_0x7d867d,null))[_0xa6d2('0x43')](handleError(_0x7d867d,null));};exports['create']=function(_0x4dc280,_0x3ac4e9){return db[_0xa6d2('0x2d')][_0xa6d2('0x47')](_0x4dc280['body'],{})[_0xa6d2('0x22')](function(_0x58a351){var _0x1738d8=_0x4dc280[_0xa6d2('0x48')]['get']({'plain':!![]});if(!_0x1738d8)throw new Error(_0xa6d2('0x49'));if(_0x1738d8[_0xa6d2('0x4a')]===_0xa6d2('0x48')){var _0x18df8b=_0x58a351[_0xa6d2('0x24')]({'plain':!![]});var _0x3e58d2='Reports';return db[_0xa6d2('0x4b')][_0xa6d2('0x46')]({'where':{'name':_0x3e58d2,'userProfileId':_0x1738d8[_0xa6d2('0x4c')]},'raw':!![]})[_0xa6d2('0x22')](function(_0x51fcbb){if(_0x51fcbb&&_0x51fcbb[_0xa6d2('0x4d')]===0x0){return db[_0xa6d2('0x4e')][_0xa6d2('0x47')]({'name':_0x18df8b[_0xa6d2('0x29')],'resourceId':_0x18df8b['id'],'type':'CustomReports','sectionId':_0x51fcbb['id']},{})[_0xa6d2('0x22')](function(){return _0x58a351;});}else{return _0x58a351;}})[_0xa6d2('0x43')](function(_0x1dc83c){logger[_0xa6d2('0x27')](_0xa6d2('0x4f'),_0x1dc83c);throw _0x1dc83c;});}return _0x58a351;})[_0xa6d2('0x22')](respondWithResult(_0x3ac4e9,0xc9))['catch'](handleError(_0x3ac4e9,null));};exports[_0xa6d2('0x21')]=function(_0x3c3fe7,_0x50fbca){if(_0x3c3fe7['body']['id']){delete _0x3c3fe7[_0xa6d2('0x50')]['id'];}return db[_0xa6d2('0x2d')][_0xa6d2('0x46')]({'where':{'id':_0x3c3fe7[_0xa6d2('0x45')]['id']}})[_0xa6d2('0x22')](handleEntityNotFound(_0x50fbca,null))[_0xa6d2('0x22')](saveUpdates(_0x3c3fe7[_0xa6d2('0x50')],null))[_0xa6d2('0x22')](respondWithResult(_0x50fbca,null))[_0xa6d2('0x43')](handleError(_0x50fbca,null));};exports[_0xa6d2('0x23')]=function(_0x37b656,_0x2e1d6b){return db['AnalyticCustomReport'][_0xa6d2('0x46')]({'where':{'id':_0x37b656[_0xa6d2('0x45')]['id']}})[_0xa6d2('0x22')](handleEntityNotFound(_0x2e1d6b,null))[_0xa6d2('0x22')](removeEntity(_0x2e1d6b,null))[_0xa6d2('0x43')](handleError(_0x2e1d6b,null));};exports[_0xa6d2('0x51')]=function(_0x5317bc,_0xb0f01a){var _0xc3c533=0xa;var _0x4bb9b3=['join','left_join','right_join',_0xa6d2('0x52')];var _0x557f28={'SUM':_0xa6d2('0x53'),'COUNT':_0xa6d2('0x54'),'COUNT DISTINCT':_0xa6d2('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xa6d2('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa6d2('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2c8a1b={'SEC_TO_TIME':_0xa6d2('0x58'),'DATE':_0xa6d2('0x59'),'HOUR':_0xa6d2('0x5a'),'ROUND':_0xa6d2('0x5b'),'UNIX_TIMESTAMP':_0xa6d2('0x5c')};var _0x2b64b4=function(_0x41a193){return!_[_0xa6d2('0x5d')]([_0xa6d2('0x5e'),_0xa6d2('0x5f'),_0xa6d2('0x60'),'IS\x20NOT\x20EMPTY'],_0x41a193);};var _0x282915=function(_0x41806c){if(!_0x41806c||!_0x41806c[_0xa6d2('0x61')][_0xa6d2('0x37')]){return'';}for(var _0x5259f1='(',_0x296884=0x0;_0x296884<_0x41806c[_0xa6d2('0x61')][_0xa6d2('0x37')];_0x296884+=0x1){_0x296884>0x0&&(_0x5259f1+='\x20'+_0x41806c[_0xa6d2('0x62')]+'\x20');_0x5259f1+=_0x41806c[_0xa6d2('0x61')][_0x296884][_0xa6d2('0x63')]?_0x282915(_0x41806c[_0xa6d2('0x61')][_0x296884][_0xa6d2('0x63')]):_0x41806c['rules'][_0x296884][_0xa6d2('0x64')]+'\x20'+_0x41806c[_0xa6d2('0x61')][_0x296884]['condition']+(_0x2b64b4(_0x41806c[_0xa6d2('0x61')][_0x296884][_0xa6d2('0x65')])?'\x20'+_0x41806c[_0xa6d2('0x61')][_0x296884][_0xa6d2('0x66')]:'');}return _0x5259f1+')';};var _0xe10d3f={'where':{'id':_0x5317bc['params']['id']}},_0x3fa261,_0x3dcbfe,_0x599a2c,_0x3e63f9,_0x4fbd82;_0xe10d3f=_[_0xa6d2('0x3e')]({},_0xe10d3f,_0x5317bc[_0xa6d2('0x40')]);return db[_0xa6d2('0x2d')][_0xa6d2('0x46')](_0xe10d3f)['then'](function(_0x5d4b1a){if(_0x5d4b1a){_0x3fa261=_0x5d4b1a;return _0x5d4b1a[_0xa6d2('0x67')]();}return null;})['then'](function(_0x28d1aa){if(_0x28d1aa){if(!_0x28d1aa[_0xa6d2('0x37')]){throw new db['Sequelize'][(_0xa6d2('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3dcbfe=_0x28d1aa;return db[_0xa6d2('0x69')][_0xa6d2('0x6a')]({'raw':!![]});}return null;})[_0xa6d2('0x22')](function(_0x45ba91){if(_0x45ba91){_0x599a2c=_[_0xa6d2('0x6b')](_0x45ba91,'id');var _0x351f00;var _0x2764e6=squel[_0xa6d2('0x6c')]();_0x2764e6[_0xa6d2('0x6d')](_0x3fa261['table']);for(var _0x33f8e=0x0;_0x33f8e<_0x3dcbfe['length'];_0x33f8e+=0x1){_0x351f00=_0x3dcbfe[_0x33f8e]['MetricId']?_0x599a2c[_0x3dcbfe[_0x33f8e]['MetricId']][_0xa6d2('0x6e')]:_0x3dcbfe[_0x33f8e][_0xa6d2('0x64')];_0x351f00=_0x3dcbfe[_0x33f8e][_0xa6d2('0x6f')]?_[_0xa6d2('0x70')](_0x557f28[_0x3dcbfe[_0x33f8e][_0xa6d2('0x6f')]],'%s',_0x351f00):_0x351f00;_0x351f00=_0x3dcbfe[_0x33f8e][_0xa6d2('0x71')]?_['replace'](_0x2c8a1b[_0x3dcbfe[_0x33f8e]['format']],'%s',_0x351f00):_0x351f00;if(_0x3dcbfe[_0x33f8e][_0xa6d2('0x72')]){_0x2764e6['group'](_0x351f00);}_0x3dcbfe[_0x33f8e][_0xa6d2('0x73')]&&_0x2764e6[_0xa6d2('0x39')](_0x351f00,_0x3dcbfe[_0x33f8e][_0xa6d2('0x73')]===_0xa6d2('0x74')?![]:!![]);_0x2764e6[_0xa6d2('0x64')](_0x351f00,_0x3dcbfe[_0x33f8e][_0xa6d2('0x75')]||_0x351f00);}if(_0x3fa261[_0xa6d2('0x76')]){_0x3fa261[_0xa6d2('0x76')]=JSON[_0xa6d2('0x77')](_0x3fa261[_0xa6d2('0x76')]);for(var _0x1c51e2=0x0;_0x1c51e2<_0x3fa261[_0xa6d2('0x76')][_0xa6d2('0x37')];_0x1c51e2+=0x1){if(_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x30')]&&_['includes'](_0x4bb9b3,_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x30')])&&_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x78')]&&_0x3fa261[_0xa6d2('0x76')][_0x1c51e2]['foreignTable']&&_0x3fa261['joins'][_0x1c51e2]['foreignKey']){_0x2764e6[_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x30')]](_0x3fa261[_0xa6d2('0x76')][_0x1c51e2][_0xa6d2('0x79')],null,util[_0xa6d2('0x71')](_0xa6d2('0x7a'),_0x3fa261[_0xa6d2('0x7b')],_0x3fa261['joins'][_0x1c51e2][_0xa6d2('0x78')],_0x3fa261[_0xa6d2('0x76')][_0x1c51e2]['foreignTable'],_0x3fa261['joins'][_0x1c51e2]['foreignKey']));}}}if(_0x3fa261['conditions']){_0x3fa261[_0xa6d2('0x7c')]=JSON['parse'](_0x3fa261[_0xa6d2('0x7c')]);_0x2764e6[_0xa6d2('0x3b')](_0x282915(_0x3fa261[_0xa6d2('0x7c')][_0xa6d2('0x63')]));}_0x4fbd82=_0x2764e6['clone']();_0x2764e6[_0xa6d2('0x1d')](_0xc3c533);_0x2764e6[_0xa6d2('0x1b')](0x0);logger['debug'](_0xa6d2('0x7d'),_0x2764e6['toString']());return dbH[_0xa6d2('0x7e')][_0xa6d2('0x31')](_0x2764e6[_0xa6d2('0x7f')](),{'type':dbH[_0xa6d2('0x7e')]['QueryTypes']['SELECT']});}})[_0xa6d2('0x22')](respondWithResult(_0xb0f01a,null))[_0xa6d2('0x43')](handleError(_0xb0f01a,null));};function runReport(_0x4fe291,_0x2da5bd,_0x3d9787){var _0x3d409c=_0x2da5bd[_0xa6d2('0x29')];var _0x47f970=0xa;var _0x354eca=[_0xa6d2('0x80'),'left_join',_0xa6d2('0x81'),_0xa6d2('0x52')];var _0x288612={'SUM':_0xa6d2('0x53'),'COUNT':_0xa6d2('0x54'),'COUNT DISTINCT':_0xa6d2('0x55'),'MAX':'MAX(%s)','MIN':_0xa6d2('0x82'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa6d2('0x83')};var _0x4995f7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xa6d2('0x5b'),'UNIX_TIMESTAMP':_0xa6d2('0x5c')};var _0x32eb40=function(_0x24d532){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xa6d2('0x60'),_0xa6d2('0x84')],_0x24d532);};var _0xc1ebbb=function(_0x51b214){if(!_0x51b214||!_0x51b214[_0xa6d2('0x61')]['length']){return'';}for(var _0x30f8a1='(',_0x1dd4e3=0x0;_0x1dd4e3<_0x51b214[_0xa6d2('0x61')][_0xa6d2('0x37')];_0x1dd4e3+=0x1){_0x1dd4e3>0x0&&(_0x30f8a1+='\x20'+_0x51b214['operator']+'\x20');_0x30f8a1+=_0x51b214[_0xa6d2('0x61')][_0x1dd4e3][_0xa6d2('0x63')]?_0xc1ebbb(_0x51b214[_0xa6d2('0x61')][_0x1dd4e3][_0xa6d2('0x63')]):_0x51b214['rules'][_0x1dd4e3]['field']+'\x20'+_0x51b214['rules'][_0x1dd4e3][_0xa6d2('0x65')]+(_0x32eb40(_0x51b214[_0xa6d2('0x61')][_0x1dd4e3]['condition'])?'\x20'+_0x51b214[_0xa6d2('0x61')][_0x1dd4e3][_0xa6d2('0x66')]:'');}return _0x30f8a1+')';};var _0x3ace46={'where':{'id':_0x4fe291['id']}},_0xd45258,_0x5647ac,_0x394709,_0x53e303,_0x2ea398;_0x3ace46=_[_0xa6d2('0x3e')]({},_0x3ace46,_0x3d9787);return db['AnalyticCustomReport'][_0xa6d2('0x46')](_0x3ace46)[_0xa6d2('0x22')](function(_0x33c47d){if(_0x33c47d){_0xd45258=_0x33c47d;return _0x33c47d[_0xa6d2('0x67')]();}return null;})['then'](function(_0x33ed3f){if(_0x33ed3f){if(!_0x33ed3f['length']){throw new db[(_0xa6d2('0x85'))][(_0xa6d2('0x68'))](_0xa6d2('0x86'),0x193);}_0x5647ac=_0x33ed3f;return db[_0xa6d2('0x69')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x254a2b){if(_0x254a2b){_0x394709=_['keyBy'](_0x254a2b,'id');var _0x858ed6;var _0x59cf68=squel[_0xa6d2('0x6c')]();_0x59cf68[_0xa6d2('0x6d')](_0xd45258['table']);for(var _0x2f6a9d=0x0;_0x2f6a9d<_0x5647ac['length'];_0x2f6a9d+=0x1){_0x858ed6=_0x5647ac[_0x2f6a9d]['MetricId']?_0x394709[_0x5647ac[_0x2f6a9d][_0xa6d2('0x87')]][_0xa6d2('0x6e')]:_0x5647ac[_0x2f6a9d][_0xa6d2('0x64')];_0x858ed6=_0x5647ac[_0x2f6a9d][_0xa6d2('0x6f')]?_[_0xa6d2('0x70')](_0x288612[_0x5647ac[_0x2f6a9d][_0xa6d2('0x6f')]],'%s',_0x858ed6):_0x858ed6;_0x858ed6=_0x5647ac[_0x2f6a9d][_0xa6d2('0x71')]?_[_0xa6d2('0x70')](_0x4995f7[_0x5647ac[_0x2f6a9d][_0xa6d2('0x71')]],'%s',_0x858ed6):_0x858ed6;if(_0x5647ac[_0x2f6a9d]['groupBy']){_0x59cf68[_0xa6d2('0x63')](_0x858ed6);}_0x5647ac[_0x2f6a9d][_0xa6d2('0x73')]&&_0x59cf68[_0xa6d2('0x39')](_0x858ed6,_0x5647ac[_0x2f6a9d]['orderBy']==='DESC'?![]:!![]);_0x59cf68[_0xa6d2('0x64')](_0x858ed6,_0x5647ac[_0x2f6a9d][_0xa6d2('0x75')]||_0x858ed6);}if(_0xd45258[_0xa6d2('0x76')]){_0xd45258[_0xa6d2('0x76')]=JSON[_0xa6d2('0x77')](_0xd45258[_0xa6d2('0x76')]);for(var _0x41cb03=0x0;_0x41cb03<_0xd45258['joins']['length'];_0x41cb03+=0x1){if(_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x30')]&&_[_0xa6d2('0x5d')](_0x354eca,_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x30')])&&_0xd45258[_0xa6d2('0x76')][_0x41cb03]['parentKey']&&_0xd45258['joins'][_0x41cb03]['foreignTable']&&_0xd45258[_0xa6d2('0x76')][_0x41cb03]['foreignKey']){_0x59cf68[_0xd45258[_0xa6d2('0x76')][_0x41cb03]['type']](_0xd45258['joins'][_0x41cb03][_0xa6d2('0x79')],null,util[_0xa6d2('0x71')](_0xa6d2('0x7a'),_0xd45258['table'],_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x78')],_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x79')],_0xd45258[_0xa6d2('0x76')][_0x41cb03][_0xa6d2('0x88')]));}}}if(_0xd45258['conditions']){_0xd45258[_0xa6d2('0x7c')]=JSON[_0xa6d2('0x77')](_0xd45258[_0xa6d2('0x7c')]);_0x59cf68[_0xa6d2('0x3b')](_0xc1ebbb(_0xd45258['conditions'][_0xa6d2('0x63')]));}_0x2ea398=_0x59cf68[_0xa6d2('0x89')]();_0x59cf68[_0xa6d2('0x1d')](_0x47f970);_0x59cf68[_0xa6d2('0x1b')](0x0);return;}})[_0xa6d2('0x22')](function(){if(_0x2da5bd[_0xa6d2('0x8a')]==='web'){return null;}var _0x1a8672=_[_0xa6d2('0x3e')](_0x2da5bd,{'name':_0x2da5bd[_0xa6d2('0x8b')]||_0x2da5bd[_0xa6d2('0x29')]||_0xd45258[_0xa6d2('0x29')],'basename':_0x3d409c,'savename':util[_0xa6d2('0x71')](_0xa6d2('0x8c'),_0x2da5bd['name']||_0xd45258[_0xa6d2('0x29')],require(_0xa6d2('0x8d'))[_0xa6d2('0x8e')](0x4),_0x2da5bd[_0xa6d2('0x8a')]||_0xa6d2('0x8f')),'reportId':_0xd45258['id'],'reportType':_0xa6d2('0x90')});return db['AnalyticExtractedReport']['create'](_0x1a8672,{'raw':!![]});})[_0xa6d2('0x22')](function(_0x3d687e){if(_0xd45258[_0xa6d2('0x7b')]===_0xa6d2('0x91')){_0x2ea398[_0xa6d2('0x3b')](_0xd45258[_0xa6d2('0x7b')]+_0xa6d2('0x92'),_0x2da5bd[_0xa6d2('0x93')],_0x2da5bd['endDate']);}else{_0x2ea398[_0xa6d2('0x3b')](_0xd45258['table']+_0xa6d2('0x94'),_0x2da5bd['startDate'],_0x2da5bd[_0xa6d2('0x95')]);}if(_0x3d687e){logger[_0xa6d2('0x96')](_0xa6d2('0x97'),_0x2ea398[_0xa6d2('0x7f')]());require(_0xa6d2('0x98'))[_0xa6d2('0x99')](path['join'](__dirname,_0xa6d2('0x9a'),_0x3d687e['output']),[_0x3d687e['id'],_0x2ea398[_0xa6d2('0x7f')](),path[_0xa6d2('0x80')](__dirname,_0xa6d2('0x9b'),_0x3d687e[_0xa6d2('0x9c')]),_0x3d409c]);return _0x3d687e;}else{var _0xced477=squel[_0xa6d2('0x6c')]();_0xced477[_0xa6d2('0x6d')]('('+_0x2ea398['toString']()+')',_0xa6d2('0x9d'));_0xced477['field'](_0xa6d2('0x9e'),_0xa6d2('0x1c'));_0x2ea398['limit'](_0x2da5bd[_0xa6d2('0x1d')]||_0x47f970);_0x2ea398[_0xa6d2('0x1b')](_0x2da5bd[_0xa6d2('0x1b')]||0x0);return dbH['sequelize'][_0xa6d2('0x31')](_0xced477[_0xa6d2('0x7f')](),{'type':dbH[_0xa6d2('0x7e')]['QueryTypes'][_0xa6d2('0x9f')]})['then'](function(_0xc2f24f){if(!_0xc2f24f[_0xa6d2('0x37')]){_0x53e303=0x0;}else{_0x53e303=_0xc2f24f[0x0][_0xa6d2('0x1c')]||0x0;}return dbH[_0xa6d2('0x7e')][_0xa6d2('0x31')](_0x2ea398[_0xa6d2('0x7f')](),{'type':dbH[_0xa6d2('0x7e')][_0xa6d2('0xa0')]['SELECT']});})[_0xa6d2('0x22')](function(_0x2e96ab){return{'rows':_0x2e96ab||[],'count':_0x53e303};});}});}exports[_0xa6d2('0xa1')]=function(_0x4b9eae,_0xb6f46c){return runReport(_0x4b9eae['params'],_0x4b9eae['query'],_0x4b9eae['options'])[_0xa6d2('0x22')](respondWithResult(_0xb6f46c,null))[_0xa6d2('0x43')](handleError(_0xb6f46c,null));};exports[_0xa6d2('0xa2')]=runReport;exports['query']=function(_0x2b7bb6,_0xdcfee4){var _0x1e9ca5=0xa;var _0x2f43c1=[_0xa6d2('0x80'),'left_join',_0xa6d2('0x81'),_0xa6d2('0x52')];var _0x29f2d9={'SUM':_0xa6d2('0x53'),'COUNT':_0xa6d2('0x54'),'COUNT DISTINCT':_0xa6d2('0x55'),'MAX':_0xa6d2('0xa3'),'MIN':_0xa6d2('0x82'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa6d2('0xa4'),'GROUP_CONCAT ASC':_0xa6d2('0x57'),'GROUP_CONCAT DESC':_0xa6d2('0x83')};var _0x64fb94={'SEC_TO_TIME':_0xa6d2('0x58'),'DATE':_0xa6d2('0x59'),'HOUR':_0xa6d2('0x5a'),'ROUND':_0xa6d2('0x5b'),'UNIX_TIMESTAMP':_0xa6d2('0x5c')};var _0x19329b=function(_0x27f176){return!_['includes']([_0xa6d2('0x5e'),'IS\x20NOT\x20NULL',_0xa6d2('0x60'),_0xa6d2('0x84')],_0x27f176);};var _0x3f5e1c=function(_0x5c52ad){if(!_0x5c52ad||!_0x5c52ad[_0xa6d2('0x61')]['length']){return'';}for(var _0x4191a0='(',_0x2416c1=0x0;_0x2416c1<_0x5c52ad[_0xa6d2('0x61')][_0xa6d2('0x37')];_0x2416c1+=0x1){_0x2416c1>0x0&&(_0x4191a0+='\x20'+_0x5c52ad[_0xa6d2('0x62')]+'\x20');_0x4191a0+=_0x5c52ad['rules'][_0x2416c1][_0xa6d2('0x63')]?_0x3f5e1c(_0x5c52ad[_0xa6d2('0x61')][_0x2416c1][_0xa6d2('0x63')]):_0x5c52ad[_0xa6d2('0x61')][_0x2416c1][_0xa6d2('0x64')]+'\x20'+_0x5c52ad[_0xa6d2('0x61')][_0x2416c1][_0xa6d2('0x65')]+(_0x19329b(_0x5c52ad[_0xa6d2('0x61')][_0x2416c1][_0xa6d2('0x65')])?'\x20'+_0x5c52ad['rules'][_0x2416c1][_0xa6d2('0x66')]:'');}return _0x4191a0+')';};var _0x56d45d={'where':{'id':_0x2b7bb6[_0xa6d2('0x45')]['id']}},_0x28e9b9,_0x457555,_0x3e8299,_0x48928f,_0x26a192;_0x56d45d=_[_0xa6d2('0x3e')]({},_0x56d45d,_0x2b7bb6['options']);return db['AnalyticCustomReport'][_0xa6d2('0x46')](_0x56d45d)[_0xa6d2('0x22')](function(_0x311ec3){if(_0x311ec3){_0x28e9b9=_0x311ec3;return _0x311ec3[_0xa6d2('0x67')]();}return null;})['then'](function(_0x1956d1){if(_0x1956d1){if(!_0x1956d1[_0xa6d2('0x37')]){throw new db[(_0xa6d2('0x85'))][(_0xa6d2('0x68'))](_0xa6d2('0x86'),0x193);}_0x457555=_0x1956d1;return db[_0xa6d2('0x69')][_0xa6d2('0x6a')]({'raw':!![]});}return null;})[_0xa6d2('0x22')](function(_0x5e7de4){if(_0x5e7de4){_0x3e8299=_[_0xa6d2('0x6b')](_0x5e7de4,'id');var _0x4c73be;var _0x524c9e=squel[_0xa6d2('0x6c')]();_0x524c9e[_0xa6d2('0x6d')](_0x28e9b9[_0xa6d2('0x7b')]);for(var _0x731c47=0x0;_0x731c47<_0x457555[_0xa6d2('0x37')];_0x731c47+=0x1){_0x4c73be=_0x457555[_0x731c47][_0xa6d2('0x87')]?_0x3e8299[_0x457555[_0x731c47][_0xa6d2('0x87')]][_0xa6d2('0x6e')]:_0x457555[_0x731c47]['field'];_0x4c73be=_0x457555[_0x731c47][_0xa6d2('0x6f')]?_['replace'](_0x29f2d9[_0x457555[_0x731c47][_0xa6d2('0x6f')]],'%s',_0x4c73be):_0x4c73be;_0x4c73be=_0x457555[_0x731c47]['format']?_['replace'](_0x64fb94[_0x457555[_0x731c47]['format']],'%s',_0x4c73be):_0x4c73be;if(_0x457555[_0x731c47][_0xa6d2('0x72')]){_0x524c9e['group'](_0x4c73be);}_0x457555[_0x731c47][_0xa6d2('0x73')]&&_0x524c9e[_0xa6d2('0x39')](_0x4c73be,_0x457555[_0x731c47][_0xa6d2('0x73')]===_0xa6d2('0x74')?![]:!![]);_0x524c9e['field'](_0x4c73be,_0x457555[_0x731c47][_0xa6d2('0x75')]||_0x4c73be);}if(_0x28e9b9[_0xa6d2('0x76')]){_0x28e9b9[_0xa6d2('0x76')]=JSON['parse'](_0x28e9b9[_0xa6d2('0x76')]);for(var _0x2ac20c=0x0;_0x2ac20c<_0x28e9b9[_0xa6d2('0x76')][_0xa6d2('0x37')];_0x2ac20c+=0x1){if(_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x30')]&&_[_0xa6d2('0x5d')](_0x2f43c1,_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x30')])&&_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x78')]&&_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x79')]&&_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c]['foreignKey']){_0x524c9e[_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x30')]](_0x28e9b9['joins'][_0x2ac20c][_0xa6d2('0x79')],null,util[_0xa6d2('0x71')](_0xa6d2('0x7a'),_0x28e9b9[_0xa6d2('0x7b')],_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x78')],_0x28e9b9[_0xa6d2('0x76')][_0x2ac20c][_0xa6d2('0x79')],_0x28e9b9['joins'][_0x2ac20c][_0xa6d2('0x88')]));}}}if(_0x28e9b9[_0xa6d2('0x7c')]){_0x28e9b9['conditions']=JSON[_0xa6d2('0x77')](_0x28e9b9[_0xa6d2('0x7c')]);_0x524c9e[_0xa6d2('0x3b')](_0x3f5e1c(_0x28e9b9[_0xa6d2('0x7c')][_0xa6d2('0x63')]));}_0x26a192=_0x524c9e[_0xa6d2('0x89')]();_0x524c9e[_0xa6d2('0x1d')](_0x1e9ca5);_0x524c9e[_0xa6d2('0x1b')](0x0);logger[_0xa6d2('0xa5')]('Limited\x20Query:',_0x524c9e[_0xa6d2('0x7f')]());return dbH[_0xa6d2('0x7e')][_0xa6d2('0x31')](_0x524c9e['toString'](),{'type':dbH[_0xa6d2('0x7e')][_0xa6d2('0xa0')][_0xa6d2('0x9f')]});}})[_0xa6d2('0x22')](function(){return{'sql':_0x26a192[_0xa6d2('0x7f')]()};})[_0xa6d2('0x22')](respondWithResult(_0xdcfee4,null))['catch'](handleError(_0xdcfee4,null));};
\ No newline at end of file
+var _0x0b0e=['IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','field','condition','value','options','getFields','length','Sequelize','AnalyticMetric','findAll','keyBy','select','table','function','format','groupBy','group','orderBy','DESC','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','MetricId','metric','alias','foreignKey','output','web','fullPath','%s-%s.%s','custom','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','replace','Limited\x20Query:','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','undefined','limit','count','set','json','apply','update','destroy','UserProfileResource','then','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','include','rows','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','CustomReports','body','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes'];(function(_0x278bd7,_0x2b4b52){var _0x56f13b=function(_0x44f3d3){while(--_0x44f3d3){_0x278bd7['push'](_0x278bd7['shift']());}};_0x56f13b(++_0x2b4b52);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3da72b,_0x4fd809){_0x3da72b=_0x3da72b-0x0;var _0xc64ac4=_0x0b0e[_0x3da72b];return _0xc64ac4;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];var dbH=require(_0xe0b0('0x17'))[_0xe0b0('0x18')];function respondWithStatusCode(_0x45f914,_0x34fed4){_0x34fed4=_0x34fed4||0xcc;return function(_0x4d2bf7){if(_0x4d2bf7){return _0x45f914[_0xe0b0('0x19')](_0x34fed4);}return _0x45f914[_0xe0b0('0x1a')](_0x34fed4)[_0xe0b0('0x1b')]();};}function respondWithResult(_0x24babd,_0x177c24){_0x177c24=_0x177c24||0xc8;return function(_0x55d884){if(_0x55d884){return _0x24babd[_0xe0b0('0x1a')](_0x177c24)['json'](_0x55d884);}};}function respondWithFilteredResult(_0x35cb40,_0xadee6e){return function(_0x519ae8){if(_0x519ae8){var _0x11fdca=typeof _0xadee6e['offset']===_0xe0b0('0x1c')&&typeof _0xadee6e[_0xe0b0('0x1d')]==='undefined';var _0x54a3eb=_0x519ae8[_0xe0b0('0x1e')];var _0x50a441=_0x11fdca?0x0:_0xadee6e['offset'];var _0x4bce65=_0x11fdca?_0x519ae8[_0xe0b0('0x1e')]:_0xadee6e['offset']+_0xadee6e['limit'];var _0x10cde1;if(_0x4bce65>=_0x54a3eb){_0x4bce65=_0x54a3eb;_0x10cde1=0xc8;}else{_0x10cde1=0xce;}_0x35cb40['status'](_0x10cde1);return _0x35cb40[_0xe0b0('0x1f')]('Content-Range',_0x50a441+'-'+_0x4bce65+'/'+_0x54a3eb)[_0xe0b0('0x20')](_0x519ae8);}return null;};}function patchUpdates(_0x1cd7c4){return function(_0x3e10b3){try{jsonpatch[_0xe0b0('0x21')](_0x3e10b3,_0x1cd7c4,!![]);}catch(_0x2cf6a1){return BPromise['reject'](_0x2cf6a1);}return _0x3e10b3['save']();};}function saveUpdates(_0x2fa820,_0x5512bb){return function(_0x12b260){if(_0x12b260){return _0x12b260[_0xe0b0('0x22')](_0x2fa820)['then'](function(_0x170ad8){return _0x170ad8;});}return null;};}function removeEntity(_0x503883,_0x2208d0){return function(_0x49a727){if(_0x49a727){return _0x49a727[_0xe0b0('0x23')]()['then'](function(){var _0x3e5c88=_0x49a727['get']({'plain':!![]});var _0x4700cc='CustomReports';return db[_0xe0b0('0x24')]['destroy']({'where':{'type':_0x4700cc,'resourceId':_0x3e5c88['id']}})[_0xe0b0('0x25')](function(){return _0x49a727;});})[_0xe0b0('0x25')](function(){_0x503883[_0xe0b0('0x1a')](0xcc)[_0xe0b0('0x1b')]();});}};}function handleEntityNotFound(_0x3ec2,_0x10745d){return function(_0x5200a6){if(!_0x5200a6){_0x3ec2[_0xe0b0('0x19')](0x194);}return _0x5200a6;};}function handleError(_0x1b8aa8,_0x5b7a64){_0x5b7a64=_0x5b7a64||0x1f4;return function(_0x15e13b){logger[_0xe0b0('0x26')](_0x15e13b[_0xe0b0('0x27')]);if(_0x15e13b[_0xe0b0('0x28')]){delete _0x15e13b[_0xe0b0('0x28')];}_0x1b8aa8[_0xe0b0('0x1a')](_0x5b7a64)[_0xe0b0('0x29')](_0x15e13b);};}exports['index']=function(_0x1854b8,_0x3c0109){var _0x48a9b5={},_0x4fe400={},_0x158b7f={'count':0x0,'rows':[]};var _0x33e672=_[_0xe0b0('0x2a')](db[_0xe0b0('0x2b')][_0xe0b0('0x2c')],function(_0x5866e5){return{'name':_0x5866e5[_0xe0b0('0x2d')],'type':_0x5866e5[_0xe0b0('0x2e')][_0xe0b0('0x2f')]};});_0x4fe400[_0xe0b0('0x30')]=_[_0xe0b0('0x2a')](_0x33e672,'name');_0x4fe400[_0xe0b0('0x31')]=_[_0xe0b0('0x32')](_0x1854b8[_0xe0b0('0x31')]);_0x4fe400[_0xe0b0('0x33')]=_[_0xe0b0('0x34')](_0x4fe400[_0xe0b0('0x30')],_0x4fe400[_0xe0b0('0x31')]);_0x48a9b5[_0xe0b0('0x35')]=_[_0xe0b0('0x34')](_0x4fe400[_0xe0b0('0x30')],qs[_0xe0b0('0x36')](_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x36')]));_0x48a9b5[_0xe0b0('0x35')]=_0x48a9b5[_0xe0b0('0x35')]['length']?_0x48a9b5[_0xe0b0('0x35')]:_0x4fe400[_0xe0b0('0x30')];if(!_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x37')](_0xe0b0('0x38'))){_0x48a9b5[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1854b8['query']['limit']);_0x48a9b5['offset']=qs['offset'](_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x39')]);}_0x48a9b5[_0xe0b0('0x3a')]=qs['sort'](_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x3b')]);_0x48a9b5[_0xe0b0('0x3c')]=qs[_0xe0b0('0x33')](_['pick'](_0x1854b8[_0xe0b0('0x31')],_0x4fe400[_0xe0b0('0x33')]),_0x33e672);if(_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x3d')]){_0x48a9b5[_0xe0b0('0x3c')]=_[_0xe0b0('0x3e')](_0x48a9b5[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x2a')](_0x33e672,function(_0xeaffbb){if(_0xeaffbb['type']!==_0xe0b0('0x3f')){var _0x54f646={};_0x54f646[_0xeaffbb[_0xe0b0('0x28')]]={'$like':'%'+_0x1854b8[_0xe0b0('0x31')][_0xe0b0('0x3d')]+'%'};return _0x54f646;}})});}_0x48a9b5=_[_0xe0b0('0x3e')]({},_0x48a9b5,_0x1854b8['options']);var _0x3e1b6b={'where':_0x48a9b5[_0xe0b0('0x3c')]};return db[_0xe0b0('0x2b')][_0xe0b0('0x1e')](_0x3e1b6b)[_0xe0b0('0x25')](function(_0x1c12bd){_0x158b7f[_0xe0b0('0x1e')]=_0x1c12bd;if(_0x1854b8[_0xe0b0('0x31')]['includeAll']){_0x48a9b5[_0xe0b0('0x40')]=[{'all':!![]}];}return db[_0xe0b0('0x2b')]['findAll'](_0x48a9b5);})['then'](function(_0x327fb4){_0x158b7f[_0xe0b0('0x41')]=_0x327fb4;return _0x158b7f;})['then'](respondWithFilteredResult(_0x3c0109,_0x48a9b5))[_0xe0b0('0x42')](handleError(_0x3c0109,null));};exports[_0xe0b0('0x43')]=function(_0x6bca5c,_0x1c869d){var _0x1a8cc7={'raw':![],'where':{'id':_0x6bca5c['params']['id']}},_0x5c31b5={};_0x5c31b5['model']=_[_0xe0b0('0x32')](db[_0xe0b0('0x2b')]['rawAttributes']);_0x5c31b5[_0xe0b0('0x31')]=_[_0xe0b0('0x32')](_0x6bca5c[_0xe0b0('0x31')]);_0x5c31b5[_0xe0b0('0x33')]=_[_0xe0b0('0x34')](_0x5c31b5['model'],_0x5c31b5['query']);_0x1a8cc7[_0xe0b0('0x35')]=_[_0xe0b0('0x34')](_0x5c31b5[_0xe0b0('0x30')],qs[_0xe0b0('0x36')](_0x6bca5c[_0xe0b0('0x31')]['fields']));_0x1a8cc7[_0xe0b0('0x35')]=_0x1a8cc7[_0xe0b0('0x35')]['length']?_0x1a8cc7['attributes']:_0x5c31b5['model'];if(_0x6bca5c[_0xe0b0('0x31')][_0xe0b0('0x44')]){_0x1a8cc7[_0xe0b0('0x40')]=[{'all':!![]}];}_0x1a8cc7=_[_0xe0b0('0x3e')]({},_0x1a8cc7,_0x6bca5c['options']);return db[_0xe0b0('0x2b')][_0xe0b0('0x45')](_0x1a8cc7)['then'](handleEntityNotFound(_0x1c869d,null))['then'](respondWithResult(_0x1c869d,null))[_0xe0b0('0x42')](handleError(_0x1c869d,null));};exports[_0xe0b0('0x46')]=function(_0x497f4f,_0x2b1917){return db[_0xe0b0('0x2b')]['create'](_0x497f4f['body'],{})[_0xe0b0('0x25')](function(_0x511679){var _0x165dc8=_0x497f4f[_0xe0b0('0x47')][_0xe0b0('0x48')]({'plain':!![]});if(!_0x165dc8)throw new Error(_0xe0b0('0x49'));if(_0x165dc8[_0xe0b0('0x4a')]===_0xe0b0('0x47')){var _0x5f5486=_0x511679['get']({'plain':!![]});var _0x2ef908='Reports';return db['UserProfileSection'][_0xe0b0('0x45')]({'where':{'name':_0x2ef908,'userProfileId':_0x165dc8[_0xe0b0('0x4b')]},'raw':!![]})['then'](function(_0x4b65d1){if(_0x4b65d1&&_0x4b65d1[_0xe0b0('0x4c')]===0x0){return db[_0xe0b0('0x24')][_0xe0b0('0x46')]({'name':_0x5f5486[_0xe0b0('0x28')],'resourceId':_0x5f5486['id'],'type':_0xe0b0('0x4d'),'sectionId':_0x4b65d1['id']},{})[_0xe0b0('0x25')](function(){return _0x511679;});}else{return _0x511679;}})[_0xe0b0('0x42')](function(_0x4ebb0f){logger[_0xe0b0('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ebb0f);throw _0x4ebb0f;});}return _0x511679;})[_0xe0b0('0x25')](respondWithResult(_0x2b1917,0xc9))['catch'](handleError(_0x2b1917,null));};exports['update']=function(_0x33822e,_0x237e8c){if(_0x33822e[_0xe0b0('0x4e')]['id']){delete _0x33822e[_0xe0b0('0x4e')]['id'];}return db[_0xe0b0('0x2b')][_0xe0b0('0x45')]({'where':{'id':_0x33822e[_0xe0b0('0x4f')]['id']}})[_0xe0b0('0x25')](handleEntityNotFound(_0x237e8c,null))[_0xe0b0('0x25')](saveUpdates(_0x33822e['body'],null))[_0xe0b0('0x25')](respondWithResult(_0x237e8c,null))['catch'](handleError(_0x237e8c,null));};exports[_0xe0b0('0x23')]=function(_0x3ae36e,_0x30c4a9){return db[_0xe0b0('0x2b')][_0xe0b0('0x45')]({'where':{'id':_0x3ae36e[_0xe0b0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x30c4a9,null))[_0xe0b0('0x25')](removeEntity(_0x30c4a9,null))[_0xe0b0('0x42')](handleError(_0x30c4a9,null));};exports[_0xe0b0('0x50')]=function(_0x271445,_0x3bb6d6){var _0x3b015e=0xa;var _0x234cb7=[_0xe0b0('0x51'),_0xe0b0('0x52'),_0xe0b0('0x53'),_0xe0b0('0x54')];var _0x18ab99={'SUM':_0xe0b0('0x55'),'COUNT':_0xe0b0('0x56'),'COUNT DISTINCT':_0xe0b0('0x57'),'MAX':_0xe0b0('0x58'),'MIN':_0xe0b0('0x59'),'AVG':_0xe0b0('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe0b0('0x5b'),'GROUP_CONCAT DESC':_0xe0b0('0x5c')};var _0x1182dc={'SEC_TO_TIME':_0xe0b0('0x5d'),'DATE':_0xe0b0('0x5e'),'HOUR':_0xe0b0('0x5f'),'ROUND':_0xe0b0('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x47dcc4=function(_0x139014){return!_[_0xe0b0('0x61')]([_0xe0b0('0x62'),'IS\x20NOT\x20NULL',_0xe0b0('0x63'),_0xe0b0('0x64')],_0x139014);};var _0x309efb=function(_0x3d820c){if(!_0x3d820c||!_0x3d820c[_0xe0b0('0x65')]['length']){return'';}for(var _0x370f8c='(',_0x242120=0x0;_0x242120<_0x3d820c[_0xe0b0('0x65')]['length'];_0x242120+=0x1){_0x242120>0x0&&(_0x370f8c+='\x20'+_0x3d820c[_0xe0b0('0x66')]+'\x20');_0x370f8c+=_0x3d820c[_0xe0b0('0x65')][_0x242120]['group']?_0x309efb(_0x3d820c[_0xe0b0('0x65')][_0x242120]['group']):_0x3d820c['rules'][_0x242120][_0xe0b0('0x67')]+'\x20'+_0x3d820c['rules'][_0x242120]['condition']+(_0x47dcc4(_0x3d820c[_0xe0b0('0x65')][_0x242120][_0xe0b0('0x68')])?'\x20'+_0x3d820c[_0xe0b0('0x65')][_0x242120][_0xe0b0('0x69')]:'');}return _0x370f8c+')';};var _0x5a7913={'where':{'id':_0x271445[_0xe0b0('0x4f')]['id']}},_0x3679e0,_0x2287a5,_0x3e7fb4,_0x41ec8e,_0x1b29c;_0x5a7913=_[_0xe0b0('0x3e')]({},_0x5a7913,_0x271445[_0xe0b0('0x6a')]);return db['AnalyticCustomReport']['find'](_0x5a7913)[_0xe0b0('0x25')](function(_0x35144f){if(_0x35144f){_0x3679e0=_0x35144f;return _0x35144f[_0xe0b0('0x6b')]();}return null;})['then'](function(_0x49b754){if(_0x49b754){if(!_0x49b754[_0xe0b0('0x6c')]){throw new db[(_0xe0b0('0x6d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2287a5=_0x49b754;return db[_0xe0b0('0x6e')][_0xe0b0('0x6f')]({'raw':!![]});}return null;})[_0xe0b0('0x25')](function(_0x29175a){if(_0x29175a){_0x3e7fb4=_[_0xe0b0('0x70')](_0x29175a,'id');var _0x15f0f8;var _0x1bc7a6=squel[_0xe0b0('0x71')]();_0x1bc7a6['from'](_0x3679e0[_0xe0b0('0x72')]);for(var _0x12e245=0x0;_0x12e245<_0x2287a5[_0xe0b0('0x6c')];_0x12e245+=0x1){_0x15f0f8=_0x2287a5[_0x12e245]['MetricId']?_0x3e7fb4[_0x2287a5[_0x12e245]['MetricId']]['metric']:_0x2287a5[_0x12e245]['field'];_0x15f0f8=_0x2287a5[_0x12e245]['function']?_['replace'](_0x18ab99[_0x2287a5[_0x12e245][_0xe0b0('0x73')]],'%s',_0x15f0f8):_0x15f0f8;_0x15f0f8=_0x2287a5[_0x12e245]['format']?_['replace'](_0x1182dc[_0x2287a5[_0x12e245][_0xe0b0('0x74')]],'%s',_0x15f0f8):_0x15f0f8;if(_0x2287a5[_0x12e245][_0xe0b0('0x75')]){_0x1bc7a6[_0xe0b0('0x76')](_0x15f0f8);}_0x2287a5[_0x12e245][_0xe0b0('0x77')]&&_0x1bc7a6[_0xe0b0('0x3a')](_0x15f0f8,_0x2287a5[_0x12e245][_0xe0b0('0x77')]===_0xe0b0('0x78')?![]:!![]);_0x1bc7a6[_0xe0b0('0x67')](_0x15f0f8,_0x2287a5[_0x12e245]['alias']||_0x15f0f8);}if(_0x3679e0[_0xe0b0('0x79')]){_0x3679e0[_0xe0b0('0x79')]=JSON[_0xe0b0('0x7a')](_0x3679e0[_0xe0b0('0x79')]);for(var _0x173ed8=0x0;_0x173ed8<_0x3679e0[_0xe0b0('0x79')][_0xe0b0('0x6c')];_0x173ed8+=0x1){if(_0x3679e0['joins'][_0x173ed8][_0xe0b0('0x2e')]&&_['includes'](_0x234cb7,_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x2e')])&&_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x7b')]&&_0x3679e0['joins'][_0x173ed8][_0xe0b0('0x7c')]&&_0x3679e0[_0xe0b0('0x79')][_0x173ed8]['foreignKey']){_0x1bc7a6[_0x3679e0['joins'][_0x173ed8][_0xe0b0('0x2e')]](_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x7c')],null,util[_0xe0b0('0x74')](_0xe0b0('0x7d'),_0x3679e0[_0xe0b0('0x72')],_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x7b')],_0x3679e0[_0xe0b0('0x79')][_0x173ed8][_0xe0b0('0x7c')],_0x3679e0['joins'][_0x173ed8]['foreignKey']));}}}if(_0x3679e0[_0xe0b0('0x7e')]){_0x3679e0['conditions']=JSON['parse'](_0x3679e0['conditions']);_0x1bc7a6['where'](_0x309efb(_0x3679e0[_0xe0b0('0x7e')]['group']));}_0x1b29c=_0x1bc7a6[_0xe0b0('0x7f')]();_0x1bc7a6[_0xe0b0('0x1d')](_0x3b015e);_0x1bc7a6[_0xe0b0('0x39')](0x0);logger[_0xe0b0('0x80')]('Limited\x20Query:',_0x1bc7a6[_0xe0b0('0x81')]());return dbH[_0xe0b0('0x82')]['query'](_0x1bc7a6[_0xe0b0('0x81')](),{'type':dbH[_0xe0b0('0x82')][_0xe0b0('0x83')][_0xe0b0('0x84')]});}})[_0xe0b0('0x25')](respondWithResult(_0x3bb6d6,null))['catch'](handleError(_0x3bb6d6,null));};function runReport(_0x55d3f8,_0x55aef7,_0x545694){var _0x5c258b=_0x55aef7[_0xe0b0('0x28')];var _0x567e1a=0xa;var _0x3c09af=['join',_0xe0b0('0x52'),_0xe0b0('0x53'),_0xe0b0('0x54')];var _0x380b4c={'SUM':_0xe0b0('0x55'),'COUNT':_0xe0b0('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xe0b0('0x85'),'GROUP_CONCAT ASC':_0xe0b0('0x5b'),'GROUP_CONCAT DESC':_0xe0b0('0x5c')};var _0x4377f7={'SEC_TO_TIME':_0xe0b0('0x5d'),'DATE':'DATE(%s)','HOUR':_0xe0b0('0x5f'),'ROUND':_0xe0b0('0x60'),'UNIX_TIMESTAMP':_0xe0b0('0x86')};var _0xc6090e=function(_0x154e6d){return!_[_0xe0b0('0x61')]([_0xe0b0('0x62'),_0xe0b0('0x87'),_0xe0b0('0x63'),'IS\x20NOT\x20EMPTY'],_0x154e6d);};var _0x589c47=function(_0x6e0e9){if(!_0x6e0e9||!_0x6e0e9[_0xe0b0('0x65')]['length']){return'';}for(var _0x7feff4='(',_0x4593f1=0x0;_0x4593f1<_0x6e0e9[_0xe0b0('0x65')][_0xe0b0('0x6c')];_0x4593f1+=0x1){_0x4593f1>0x0&&(_0x7feff4+='\x20'+_0x6e0e9[_0xe0b0('0x66')]+'\x20');_0x7feff4+=_0x6e0e9[_0xe0b0('0x65')][_0x4593f1][_0xe0b0('0x76')]?_0x589c47(_0x6e0e9[_0xe0b0('0x65')][_0x4593f1]['group']):_0x6e0e9['rules'][_0x4593f1]['field']+'\x20'+_0x6e0e9[_0xe0b0('0x65')][_0x4593f1][_0xe0b0('0x68')]+(_0xc6090e(_0x6e0e9['rules'][_0x4593f1][_0xe0b0('0x68')])?'\x20'+_0x6e0e9[_0xe0b0('0x65')][_0x4593f1][_0xe0b0('0x69')]:'');}return _0x7feff4+')';};var _0x328832={'where':{'id':_0x55d3f8['id']}},_0x5c45ae,_0x56c4b9,_0x4e1fb1,_0x22029a,_0x266835;_0x328832=_['merge']({},_0x328832,_0x545694);return db[_0xe0b0('0x2b')][_0xe0b0('0x45')](_0x328832)['then'](function(_0x576482){if(_0x576482){_0x5c45ae=_0x576482;return _0x576482[_0xe0b0('0x6b')]();}return null;})['then'](function(_0x251195){if(_0x251195){if(!_0x251195['length']){throw new db[(_0xe0b0('0x6d'))][(_0xe0b0('0x88'))](_0xe0b0('0x89'),0x193);}_0x56c4b9=_0x251195;return db[_0xe0b0('0x6e')][_0xe0b0('0x6f')]({'raw':!![]});}return null;})[_0xe0b0('0x25')](function(_0x434dfa){if(_0x434dfa){_0x4e1fb1=_[_0xe0b0('0x70')](_0x434dfa,'id');var _0xf76449;var _0x48497e=squel[_0xe0b0('0x71')]();_0x48497e[_0xe0b0('0x8a')](_0x5c45ae[_0xe0b0('0x72')]);for(var _0x4e19f4=0x0;_0x4e19f4<_0x56c4b9[_0xe0b0('0x6c')];_0x4e19f4+=0x1){_0xf76449=_0x56c4b9[_0x4e19f4]['MetricId']?_0x4e1fb1[_0x56c4b9[_0x4e19f4][_0xe0b0('0x8b')]][_0xe0b0('0x8c')]:_0x56c4b9[_0x4e19f4]['field'];_0xf76449=_0x56c4b9[_0x4e19f4][_0xe0b0('0x73')]?_['replace'](_0x380b4c[_0x56c4b9[_0x4e19f4]['function']],'%s',_0xf76449):_0xf76449;_0xf76449=_0x56c4b9[_0x4e19f4][_0xe0b0('0x74')]?_['replace'](_0x4377f7[_0x56c4b9[_0x4e19f4]['format']],'%s',_0xf76449):_0xf76449;if(_0x56c4b9[_0x4e19f4][_0xe0b0('0x75')]){_0x48497e[_0xe0b0('0x76')](_0xf76449);}_0x56c4b9[_0x4e19f4][_0xe0b0('0x77')]&&_0x48497e[_0xe0b0('0x3a')](_0xf76449,_0x56c4b9[_0x4e19f4][_0xe0b0('0x77')]===_0xe0b0('0x78')?![]:!![]);_0x48497e['field'](_0xf76449,_0x56c4b9[_0x4e19f4][_0xe0b0('0x8d')]||_0xf76449);}if(_0x5c45ae[_0xe0b0('0x79')]){_0x5c45ae[_0xe0b0('0x79')]=JSON['parse'](_0x5c45ae[_0xe0b0('0x79')]);for(var _0x447641=0x0;_0x447641<_0x5c45ae['joins']['length'];_0x447641+=0x1){if(_0x5c45ae[_0xe0b0('0x79')][_0x447641]['type']&&_[_0xe0b0('0x61')](_0x3c09af,_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x2e')])&&_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7b')]&&_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7c')]&&_0x5c45ae['joins'][_0x447641][_0xe0b0('0x8e')]){_0x48497e[_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x2e')]](_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7c')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5c45ae[_0xe0b0('0x72')],_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7b')],_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x7c')],_0x5c45ae[_0xe0b0('0x79')][_0x447641][_0xe0b0('0x8e')]));}}}if(_0x5c45ae[_0xe0b0('0x7e')]){_0x5c45ae[_0xe0b0('0x7e')]=JSON[_0xe0b0('0x7a')](_0x5c45ae['conditions']);_0x48497e[_0xe0b0('0x3c')](_0x589c47(_0x5c45ae[_0xe0b0('0x7e')][_0xe0b0('0x76')]));}_0x266835=_0x48497e[_0xe0b0('0x7f')]();_0x48497e['limit'](_0x567e1a);_0x48497e[_0xe0b0('0x39')](0x0);return;}})[_0xe0b0('0x25')](function(){if(_0x55aef7[_0xe0b0('0x8f')]===_0xe0b0('0x90')){return null;}var _0x476763=_['merge'](_0x55aef7,{'name':_0x55aef7[_0xe0b0('0x91')]||_0x55aef7['name']||_0x5c45ae[_0xe0b0('0x28')],'basename':_0x5c258b,'savename':util[_0xe0b0('0x74')](_0xe0b0('0x92'),_0x55aef7[_0xe0b0('0x28')]||_0x5c45ae[_0xe0b0('0x28')],require('randomstring')['generate'](0x4),_0x55aef7[_0xe0b0('0x8f')]||'csv'),'reportId':_0x5c45ae['id'],'reportType':_0xe0b0('0x93')});return db['AnalyticExtractedReport'][_0xe0b0('0x46')](_0x476763,{'raw':!![]});})[_0xe0b0('0x25')](function(_0x205c53){if(_0x5c45ae[_0xe0b0('0x72')]===_0xe0b0('0x94')){_0x266835[_0xe0b0('0x3c')](_0x5c45ae[_0xe0b0('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x55aef7['startDate'],_0x55aef7[_0xe0b0('0x95')]);}else{_0x266835[_0xe0b0('0x3c')](_0x5c45ae[_0xe0b0('0x72')]+_0xe0b0('0x96'),_0x55aef7[_0xe0b0('0x97')],_0x55aef7[_0xe0b0('0x95')]);}if(_0x205c53){logger[_0xe0b0('0x98')](_0xe0b0('0x99'),_0x266835[_0xe0b0('0x81')]());require(_0xe0b0('0x9a'))['fork'](path['join'](__dirname,_0xe0b0('0x9b'),_0x205c53[_0xe0b0('0x8f')]),[_0x205c53['id'],_0x266835[_0xe0b0('0x81')](),path[_0xe0b0('0x51')](__dirname,_0xe0b0('0x9c'),_0x205c53[_0xe0b0('0x9d')]),_0x5c258b]);return _0x205c53;}else{var _0x33b67a=squel['select']();_0x33b67a['from']('('+_0x266835[_0xe0b0('0x81')]()+')',_0xe0b0('0x9e'));_0x33b67a[_0xe0b0('0x67')](_0xe0b0('0x9f'),_0xe0b0('0x1e'));_0x266835[_0xe0b0('0x1d')](_0x55aef7[_0xe0b0('0x1d')]||_0x567e1a);_0x266835[_0xe0b0('0x39')](_0x55aef7[_0xe0b0('0x39')]||0x0);return dbH[_0xe0b0('0x82')]['query'](_0x33b67a[_0xe0b0('0x81')](),{'type':dbH[_0xe0b0('0x82')]['QueryTypes'][_0xe0b0('0x84')]})[_0xe0b0('0x25')](function(_0x3615f9){if(!_0x3615f9[_0xe0b0('0x6c')]){_0x22029a=0x0;}else{_0x22029a=_0x3615f9[0x0][_0xe0b0('0x1e')]||0x0;}return dbH['sequelize'][_0xe0b0('0x31')](_0x266835[_0xe0b0('0x81')](),{'type':dbH[_0xe0b0('0x82')][_0xe0b0('0x83')][_0xe0b0('0x84')]});})['then'](function(_0x475404){return{'rows':_0x475404||[],'count':_0x22029a};});}});}exports['run']=function(_0x44e05a,_0x42dfa9){return runReport(_0x44e05a[_0xe0b0('0x4f')],_0x44e05a['query'],_0x44e05a['options'])[_0xe0b0('0x25')](respondWithResult(_0x42dfa9,null))[_0xe0b0('0x42')](handleError(_0x42dfa9,null));};exports[_0xe0b0('0xa0')]=runReport;exports['query']=function(_0x4d372a,_0x5da5eb){var _0x5175e1=0xa;var _0x57694c=['join',_0xe0b0('0x52'),_0xe0b0('0x53'),'cross_join'];var _0x121257={'SUM':_0xe0b0('0x55'),'COUNT':_0xe0b0('0x56'),'COUNT DISTINCT':_0xe0b0('0x57'),'MAX':_0xe0b0('0x58'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xe0b0('0x85'),'GROUP_CONCAT ASC':_0xe0b0('0x5b'),'GROUP_CONCAT DESC':_0xe0b0('0x5c')};var _0x52dfd8={'SEC_TO_TIME':_0xe0b0('0x5d'),'DATE':_0xe0b0('0x5e'),'HOUR':_0xe0b0('0x5f'),'ROUND':_0xe0b0('0x60'),'UNIX_TIMESTAMP':_0xe0b0('0x86')};var _0x1b8d4a=function(_0x51b616){return!_['includes'](['IS\x20NULL',_0xe0b0('0x87'),_0xe0b0('0x63'),_0xe0b0('0x64')],_0x51b616);};var _0x40809f=function(_0x266cb5){if(!_0x266cb5||!_0x266cb5[_0xe0b0('0x65')][_0xe0b0('0x6c')]){return'';}for(var _0x35f081='(',_0x5e4339=0x0;_0x5e4339<_0x266cb5['rules'][_0xe0b0('0x6c')];_0x5e4339+=0x1){_0x5e4339>0x0&&(_0x35f081+='\x20'+_0x266cb5[_0xe0b0('0x66')]+'\x20');_0x35f081+=_0x266cb5[_0xe0b0('0x65')][_0x5e4339]['group']?_0x40809f(_0x266cb5[_0xe0b0('0x65')][_0x5e4339][_0xe0b0('0x76')]):_0x266cb5[_0xe0b0('0x65')][_0x5e4339]['field']+'\x20'+_0x266cb5[_0xe0b0('0x65')][_0x5e4339]['condition']+(_0x1b8d4a(_0x266cb5[_0xe0b0('0x65')][_0x5e4339][_0xe0b0('0x68')])?'\x20'+_0x266cb5[_0xe0b0('0x65')][_0x5e4339][_0xe0b0('0x69')]:'');}return _0x35f081+')';};var _0x3b133a={'where':{'id':_0x4d372a['params']['id']}},_0x26df60,_0x12e46f,_0x55beb2,_0x287af5,_0xb71713;_0x3b133a=_[_0xe0b0('0x3e')]({},_0x3b133a,_0x4d372a[_0xe0b0('0x6a')]);return db[_0xe0b0('0x2b')]['find'](_0x3b133a)[_0xe0b0('0x25')](function(_0x692a95){if(_0x692a95){_0x26df60=_0x692a95;return _0x692a95[_0xe0b0('0x6b')]();}return null;})['then'](function(_0xed8461){if(_0xed8461){if(!_0xed8461[_0xe0b0('0x6c')]){throw new db[(_0xe0b0('0x6d'))][(_0xe0b0('0x88'))](_0xe0b0('0x89'),0x193);}_0x12e46f=_0xed8461;return db[_0xe0b0('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xe0b0('0x25')](function(_0x701ba){if(_0x701ba){_0x55beb2=_[_0xe0b0('0x70')](_0x701ba,'id');var _0x26315d;var _0x11452e=squel[_0xe0b0('0x71')]();_0x11452e[_0xe0b0('0x8a')](_0x26df60[_0xe0b0('0x72')]);for(var _0xf87779=0x0;_0xf87779<_0x12e46f[_0xe0b0('0x6c')];_0xf87779+=0x1){_0x26315d=_0x12e46f[_0xf87779][_0xe0b0('0x8b')]?_0x55beb2[_0x12e46f[_0xf87779]['MetricId']][_0xe0b0('0x8c')]:_0x12e46f[_0xf87779]['field'];_0x26315d=_0x12e46f[_0xf87779]['function']?_[_0xe0b0('0xa1')](_0x121257[_0x12e46f[_0xf87779][_0xe0b0('0x73')]],'%s',_0x26315d):_0x26315d;_0x26315d=_0x12e46f[_0xf87779]['format']?_[_0xe0b0('0xa1')](_0x52dfd8[_0x12e46f[_0xf87779][_0xe0b0('0x74')]],'%s',_0x26315d):_0x26315d;if(_0x12e46f[_0xf87779][_0xe0b0('0x75')]){_0x11452e[_0xe0b0('0x76')](_0x26315d);}_0x12e46f[_0xf87779][_0xe0b0('0x77')]&&_0x11452e[_0xe0b0('0x3a')](_0x26315d,_0x12e46f[_0xf87779][_0xe0b0('0x77')]===_0xe0b0('0x78')?![]:!![]);_0x11452e[_0xe0b0('0x67')](_0x26315d,_0x12e46f[_0xf87779]['alias']||_0x26315d);}if(_0x26df60[_0xe0b0('0x79')]){_0x26df60[_0xe0b0('0x79')]=JSON[_0xe0b0('0x7a')](_0x26df60[_0xe0b0('0x79')]);for(var _0x48c009=0x0;_0x48c009<_0x26df60['joins'][_0xe0b0('0x6c')];_0x48c009+=0x1){if(_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x2e')]&&_[_0xe0b0('0x61')](_0x57694c,_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x2e')])&&_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x7b')]&&_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x7c')]&&_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x8e')]){_0x11452e[_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x2e')]](_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x7c')],null,util[_0xe0b0('0x74')](_0xe0b0('0x7d'),_0x26df60[_0xe0b0('0x72')],_0x26df60['joins'][_0x48c009][_0xe0b0('0x7b')],_0x26df60[_0xe0b0('0x79')][_0x48c009][_0xe0b0('0x7c')],_0x26df60['joins'][_0x48c009][_0xe0b0('0x8e')]));}}}if(_0x26df60[_0xe0b0('0x7e')]){_0x26df60[_0xe0b0('0x7e')]=JSON[_0xe0b0('0x7a')](_0x26df60[_0xe0b0('0x7e')]);_0x11452e[_0xe0b0('0x3c')](_0x40809f(_0x26df60[_0xe0b0('0x7e')]['group']));}_0xb71713=_0x11452e[_0xe0b0('0x7f')]();_0x11452e['limit'](_0x5175e1);_0x11452e[_0xe0b0('0x39')](0x0);logger['debug'](_0xe0b0('0xa2'),_0x11452e[_0xe0b0('0x81')]());return dbH['sequelize'][_0xe0b0('0x31')](_0x11452e['toString'](),{'type':dbH[_0xe0b0('0x82')][_0xe0b0('0x83')][_0xe0b0('0x84')]});}})[_0xe0b0('0x25')](function(){return{'sql':_0xb71713[_0xe0b0('0x81')]()};})[_0xe0b0('0x25')](respondWithResult(_0x5da5eb,null))[_0xe0b0('0x42')](handleError(_0x5da5eb,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index ecdb175..9948f19 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 _0x0e88=['moment','bluebird','request-promise','path','../../config/environment','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x5c0fd4,_0x20b566){var _0x4a5472=function(_0x55bdd0){while(--_0x55bdd0){_0x5c0fd4['push'](_0x5c0fd4['shift']());}};_0x4a5472(++_0x20b566);}(_0x0e88,0x68));var _0x80e8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0e88[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x80e8('0x0'));var BPromise=require(_0x80e8('0x1'));var rp=require(_0x80e8('0x2'));var fs=require('fs');var path=require(_0x80e8('0x3'));var rimraf=require('rimraf');var config=require(_0x80e8('0x4'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x396e5d,_0x36aa04){return _0x396e5d[_0x80e8('0x5')](_0x80e8('0x6'),attributes,{'tableName':_0x80e8('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3398=['bluebird','path','./analyticCustomReport.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3398,0xcd));var _0x8339=function(_0xb49d07,_0x3a7261){_0xb49d07=_0xb49d07-0x0;var _0x1da626=_0x3398[_0xb49d07];return _0x1da626;};'use strict';var _=require(_0x8339('0x0'));var util=require(_0x8339('0x1'));var logger=require(_0x8339('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8339('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8339('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8339('0x5'));module[_0x8339('0x6')]=function(_0x11439e,_0x2390a9){return _0x11439e[_0x8339('0x7')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 4034651..1ddec65 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 _0xfa52=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x1893ad,_0x25c0ec){var _0x2b0d88=function(_0x169439){while(--_0x169439){_0x1893ad['push'](_0x1893ad['shift']());}};_0x2b0d88(++_0x25c0ec);}(_0xfa52,0x8b));var _0x2fa5=function(_0x47e91f,_0x33abea){_0x47e91f=_0x47e91f-0x0;var _0x4629c4=_0xfa52[_0x47e91f];return _0x4629c4;};'use strict';var _=require(_0x2fa5('0x0'));var util=require('util');var moment=require(_0x2fa5('0x1'));var BPromise=require(_0x2fa5('0x2'));var rs=require(_0x2fa5('0x3'));var fs=require('fs');var Redis=require(_0x2fa5('0x4'));var db=require(_0x2fa5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2fa5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2fa5('0x7'));var client=jayson[_0x2fa5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ce759,_0x4109f8,_0x5a959a){return new BPromise(function(_0x47d468,_0x3951db){return client[_0x2fa5('0x9')](_0x5ce759,_0x5a959a)[_0x2fa5('0xa')](function(_0x15ea69){logger[_0x2fa5('0xb')](_0x2fa5('0xc'),_0x4109f8,_0x2fa5('0xd'));logger[_0x2fa5('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4109f8,_0x2fa5('0xd'),JSON[_0x2fa5('0xf')](_0x15ea69));if(_0x15ea69[_0x2fa5('0x10')]){if(_0x15ea69[_0x2fa5('0x10')]['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4109f8,_0x15ea69[_0x2fa5('0x10')][_0x2fa5('0x11')]);return _0x3951db(_0x15ea69[_0x2fa5('0x10')][_0x2fa5('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4109f8,_0x15ea69['error']['message']);return _0x47d468(_0x15ea69['error'][_0x2fa5('0x11')]);}else{logger[_0x2fa5('0xb')](_0x2fa5('0xc'),_0x4109f8,'request\x20sent');_0x47d468(_0x15ea69[_0x2fa5('0x12')][_0x2fa5('0x11')]);}})[_0x2fa5('0x13')](function(_0x41de26){logger[_0x2fa5('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4109f8,_0x41de26);_0x3951db(_0x41de26);});});}
\ No newline at end of file
+var _0x1e67=['info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x2fa282,_0x41e98b){var _0x464dbf=function(_0x550205){while(--_0x550205){_0x2fa282['push'](_0x2fa282['shift']());}};_0x464dbf(++_0x41e98b);}(_0x1e67,0x1b4));var _0x71e6=function(_0x25c27c,_0xd78847){_0x25c27c=_0x25c27c-0x0;var _0x5a4bab=_0x1e67[_0x25c27c];return _0x5a4bab;};'use strict';var _=require(_0x71e6('0x0'));var util=require(_0x71e6('0x1'));var moment=require(_0x71e6('0x2'));var BPromise=require(_0x71e6('0x3'));var rs=require(_0x71e6('0x4'));var fs=require('fs');var Redis=require(_0x71e6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x71e6('0x6'));var logger=require(_0x71e6('0x7'))(_0x71e6('0x8'));var config=require('../../config/environment');var jayson=require(_0x71e6('0x9'));var client=jayson[_0x71e6('0xa')][_0x71e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43d7b2,_0x13ad8e,_0x4c8348){return new BPromise(function(_0x31cce7,_0x4c453b){return client[_0x71e6('0xc')](_0x43d7b2,_0x4c8348)[_0x71e6('0xd')](function(_0x4e3488){logger[_0x71e6('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x13ad8e,_0x71e6('0xf'));logger[_0x71e6('0x10')](_0x71e6('0x11'),_0x13ad8e,_0x71e6('0xf'),JSON[_0x71e6('0x12')](_0x4e3488));if(_0x4e3488[_0x71e6('0x13')]){if(_0x4e3488[_0x71e6('0x13')][_0x71e6('0x14')]===0x1f4){logger[_0x71e6('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x13ad8e,_0x4e3488[_0x71e6('0x13')]['message']);return _0x4c453b(_0x4e3488['error'][_0x71e6('0x15')]);}logger[_0x71e6('0x13')](_0x71e6('0x16'),_0x13ad8e,_0x4e3488[_0x71e6('0x13')][_0x71e6('0x15')]);return _0x31cce7(_0x4e3488[_0x71e6('0x13')][_0x71e6('0x15')]);}else{logger['info'](_0x71e6('0x16'),_0x13ad8e,_0x71e6('0xf'));_0x31cce7(_0x4e3488[_0x71e6('0x17')]['message']);}})[_0x71e6('0x18')](function(_0x36569e){logger[_0x71e6('0x13')](_0x71e6('0x16'),_0x13ad8e,_0x36569e);_0x4c453b(_0x36569e);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a574ca4..7c5849b 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 _0x57f6=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/query','query','create','put','update','destroy'];(function(_0x1b91bf,_0x42f146){var _0x2aa4d=function(_0x377459){while(--_0x377459){_0x1b91bf['push'](_0x1b91bf['shift']());}};_0x2aa4d(++_0x42f146);}(_0x57f6,0xd2));var _0x657f=function(_0x403c57,_0x280a51){_0x403c57=_0x403c57-0x0;var _0x35fa69=_0x57f6[_0x403c57];return _0x35fa69;};'use strict';var multer=require(_0x657f('0x0'));var util=require('util');var path=require(_0x657f('0x1'));var timeout=require(_0x657f('0x2'));var express=require('express');var router=express[_0x657f('0x3')]();var fs_extra=require(_0x657f('0x4'));var auth=require(_0x657f('0x5'));var interaction=require(_0x657f('0x6'));var config=require('../../config/environment');var controller=require(_0x657f('0x7'));router[_0x657f('0x8')]('/',auth[_0x657f('0x9')](),controller[_0x657f('0xa')]);router[_0x657f('0x8')](_0x657f('0xb'),auth['isAuthenticated'](),controller[_0x657f('0xc')]);router[_0x657f('0x8')](_0x657f('0xd'),auth[_0x657f('0x9')](),controller[_0x657f('0xe')]);router['get']('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x657f('0x8')](_0x657f('0xf'),auth['isAuthenticated'](),controller[_0x657f('0x10')]);router['post']('/',auth[_0x657f('0x9')](),controller[_0x657f('0x11')]);router[_0x657f('0x12')](_0x657f('0xb'),auth[_0x657f('0x9')](),controller[_0x657f('0x13')]);router['delete'](_0x657f('0xb'),auth[_0x657f('0x9')](),controller[_0x657f('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x33d4=['./analyticCustomReport.controller','get','isAuthenticated','preview','/:id/run','run','query','post','create','put','/:id','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3b7f3c,_0x14bbc0){var _0x198ca7=function(_0x37973c){while(--_0x37973c){_0x3b7f3c['push'](_0x3b7f3c['shift']());}};_0x198ca7(++_0x14bbc0);}(_0x33d4,0x8a));var _0x433d=function(_0xe22099,_0x891a1a){_0xe22099=_0xe22099-0x0;var _0x5cc174=_0x33d4[_0xe22099];return _0x5cc174;};'use strict';var multer=require(_0x433d('0x0'));var util=require('util');var path=require(_0x433d('0x1'));var timeout=require(_0x433d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x433d('0x3'));var auth=require(_0x433d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x433d('0x5'));var controller=require(_0x433d('0x6'));router[_0x433d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x433d('0x7')]('/:id',auth[_0x433d('0x8')](),controller['show']);router[_0x433d('0x7')]('/:id/preview',auth[_0x433d('0x8')](),controller[_0x433d('0x9')]);router[_0x433d('0x7')](_0x433d('0xa'),auth[_0x433d('0x8')](),controller[_0x433d('0xb')]);router[_0x433d('0x7')]('/:id/query',auth['isAuthenticated'](),controller[_0x433d('0xc')]);router[_0x433d('0xd')]('/',auth['isAuthenticated'](),controller[_0x433d('0xe')]);router[_0x433d('0xf')]('/:id',auth[_0x433d('0x8')](),controller['update']);router['delete'](_0x433d('0x10'),auth[_0x433d('0x8')](),controller['destroy']);module[_0x433d('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 5c3b4ac..511ff34 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 _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x43ad57,_0x463504){var _0x38c75f=function(_0x4c0185){while(--_0x4c0185){_0x43ad57['push'](_0x43ad57['shift']());}};_0x38c75f(++_0x463504);}(_0xf494,0x1c6));var _0x4f49=function(_0x596f57,_0x50c74e){_0x596f57=_0x596f57-0x0;var _0x5c8281=_0xf494[_0x596f57];return _0x5c8281;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}};
\ No newline at end of file
+var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x477949,_0x375636){var _0x3a61ac=function(_0x3d6a07){while(--_0x3d6a07){_0x477949['push'](_0x477949['shift']());}};_0x3a61ac(++_0x375636);}(_0x5496,0x175));var _0x6549=function(_0x55390b,_0x2fa8db){_0x55390b=_0x55390b-0x0;var _0x51c8a3=_0x5496[_0x55390b];return _0x51c8a3;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index a257516..f9584c4 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 _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x2c4440,_0x4fe366){var _0x20f1dd=function(_0x7495a5){while(--_0x7495a5){_0x2c4440['push'](_0x2c4440['shift']());}};_0x20f1dd(++_0x4fe366);}(_0x7a54,0x106));var _0x47a5=function(_0xfd9b03,_0x65a386){_0xfd9b03=_0xfd9b03-0x0;var _0x3dc2c1=_0x7a54[_0xfd9b03];return _0x3dc2c1;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));};
\ No newline at end of file
+var _0x687b=['util','path','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x149b25,_0x2bb415){_0x149b25=_0x149b25-0x0;var _0x40b742=_0x687b[_0x149b25];return _0x40b742;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 095160d..77cc9fb 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 _0x0810=['./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x331a73,_0x5a5941){var _0x267f02=function(_0x2c74f6){while(--_0x2c74f6){_0x331a73['push'](_0x331a73['shift']());}};_0x267f02(++_0x5a5941);}(_0x0810,0x66));var _0x0081=function(_0x4f30c0,_0x56511a){_0x4f30c0=_0x4f30c0-0x0;var _0x43a9bd=_0x0810[_0x4f30c0];return _0x43a9bd;};'use strict';var _=require(_0x0081('0x0'));var util=require(_0x0081('0x1'));var logger=require(_0x0081('0x2'))(_0x0081('0x3'));var moment=require(_0x0081('0x4'));var BPromise=require('bluebird');var rp=require(_0x0081('0x5'));var fs=require('fs');var path=require(_0x0081('0x6'));var rimraf=require('rimraf');var config=require(_0x0081('0x7'));var attributes=require(_0x0081('0x8'));module['exports']=function(_0x1d8f57,_0x10c050){return _0x1d8f57['define'](_0x0081('0x9'),attributes,{'tableName':_0x0081('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb980=['AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define'];(function(_0x1607ee,_0x50aa37){var _0x3fad5b=function(_0x16c8ca){while(--_0x16c8ca){_0x1607ee['push'](_0x1607ee['shift']());}};_0x3fad5b(++_0x50aa37);}(_0xb980,0xbd));var _0x0b98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb980[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0b98('0x0'));var logger=require(_0x0b98('0x1'))(_0x0b98('0x2'));var moment=require(_0x0b98('0x3'));var BPromise=require(_0x0b98('0x4'));var rp=require(_0x0b98('0x5'));var fs=require('fs');var path=require(_0x0b98('0x6'));var rimraf=require(_0x0b98('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x3267d9,_0x445a1c){return _0x3267d9[_0x0b98('0x8')](_0x0b98('0x9'),attributes,{'tableName':_0x0b98('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 eb6f43b..f9cd126 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 _0x54ca=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x32b292,_0x100e5e){var _0x490f77=function(_0x41da58){while(--_0x41da58){_0x32b292['push'](_0x32b292['shift']());}};_0x490f77(++_0x100e5e);}(_0x54ca,0x85));var _0xa54c=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x54ca[_0x81e39d];return _0x548fbb;};'use strict';var _=require('lodash');var util=require(_0xa54c('0x0'));var moment=require(_0xa54c('0x1'));var BPromise=require(_0xa54c('0x2'));var rs=require(_0xa54c('0x3'));var fs=require('fs');var Redis=require(_0xa54c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa54c('0x5'));var logger=require(_0xa54c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa54c('0x7'));var client=jayson[_0xa54c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9a37b1,_0x26afb7,_0x432c23){return new BPromise(function(_0x8a2a4b,_0x1a9f30){return client[_0xa54c('0x9')](_0x9a37b1,_0x432c23)[_0xa54c('0xa')](function(_0x3f645b){logger[_0xa54c('0xb')](_0xa54c('0xc'),_0x26afb7,_0xa54c('0xd'));logger[_0xa54c('0xe')](_0xa54c('0xf'),_0x26afb7,_0xa54c('0xd'),JSON[_0xa54c('0x10')](_0x3f645b));if(_0x3f645b[_0xa54c('0x11')]){if(_0x3f645b['error'][_0xa54c('0x12')]===0x1f4){logger[_0xa54c('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26afb7,_0x3f645b[_0xa54c('0x11')][_0xa54c('0x13')]);return _0x1a9f30(_0x3f645b[_0xa54c('0x11')]['message']);}logger[_0xa54c('0x11')](_0xa54c('0xc'),_0x26afb7,_0x3f645b[_0xa54c('0x11')][_0xa54c('0x13')]);return _0x8a2a4b(_0x3f645b[_0xa54c('0x11')][_0xa54c('0x13')]);}else{logger[_0xa54c('0xb')](_0xa54c('0xc'),_0x26afb7,_0xa54c('0xd'));_0x8a2a4b(_0x3f645b[_0xa54c('0x14')][_0xa54c('0x13')]);}})[_0xa54c('0x15')](function(_0x58b864){logger[_0xa54c('0x11')](_0xa54c('0xc'),_0x26afb7,_0x58b864);_0x1a9f30(_0x58b864);});});}
\ No newline at end of file
+var _0xeead=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0xeead,0x1ad));var _0xdeea=function(_0x18dbf5,_0x505113){_0x18dbf5=_0x18dbf5-0x0;var _0x10ba5c=_0xeead[_0x18dbf5];return _0x10ba5c;};'use strict';var _=require(_0xdeea('0x0'));var util=require(_0xdeea('0x1'));var moment=require(_0xdeea('0x2'));var BPromise=require('bluebird');var rs=require(_0xdeea('0x3'));var fs=require('fs');var Redis=require(_0xdeea('0x4'));var db=require(_0xdeea('0x5'))['db'];var utils=require(_0xdeea('0x6'));var logger=require(_0xdeea('0x7'))(_0xdeea('0x8'));var config=require(_0xdeea('0x9'));var jayson=require(_0xdeea('0xa'));var client=jayson['client'][_0xdeea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x180b29,_0x160988,_0x52d39d){return new BPromise(function(_0x25e06f,_0x2f0ed7){return client['request'](_0x180b29,_0x52d39d)[_0xdeea('0xc')](function(_0x4449df){logger[_0xdeea('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x160988,_0xdeea('0xe'));logger[_0xdeea('0xf')](_0xdeea('0x10'),_0x160988,'request\x20sent',JSON[_0xdeea('0x11')](_0x4449df));if(_0x4449df[_0xdeea('0x12')]){if(_0x4449df[_0xdeea('0x12')][_0xdeea('0x13')]===0x1f4){logger[_0xdeea('0x12')](_0xdeea('0x14'),_0x160988,_0x4449df[_0xdeea('0x12')]['message']);return _0x2f0ed7(_0x4449df[_0xdeea('0x12')][_0xdeea('0x15')]);}logger[_0xdeea('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x160988,_0x4449df[_0xdeea('0x12')]['message']);return _0x25e06f(_0x4449df[_0xdeea('0x12')][_0xdeea('0x15')]);}else{logger[_0xdeea('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x160988,_0xdeea('0xe'));_0x25e06f(_0x4449df[_0xdeea('0x16')][_0xdeea('0x15')]);}})[_0xdeea('0x17')](function(_0x1b3a14){logger[_0xdeea('0x12')](_0xdeea('0x14'),_0x160988,_0x1b3a14);_0x2f0ed7(_0x1b3a14);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index f87ad52..a702d7a 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 _0x0165=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0165,0x1e4));var _0x5016=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0165[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x5016('0x0'));var util=require(_0x5016('0x1'));var path=require(_0x5016('0x2'));var timeout=require(_0x5016('0x3'));var express=require(_0x5016('0x4'));var router=express[_0x5016('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5016('0x6'));var interaction=require(_0x5016('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x5016('0x8')]('/',auth['isAuthenticated'](),controller[_0x5016('0x9')]);router[_0x5016('0x8')](_0x5016('0xa'),auth[_0x5016('0xb')](),controller[_0x5016('0xc')]);router[_0x5016('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0x5016('0xd')]);router[_0x5016('0x8')](_0x5016('0xe'),auth[_0x5016('0xb')](),controller[_0x5016('0xf')]);router[_0x5016('0x8')](_0x5016('0x10'),auth[_0x5016('0xb')](),controller[_0x5016('0x11')]);router[_0x5016('0x12')]('/',auth[_0x5016('0xb')](),controller[_0x5016('0x13')]);router['put'](_0x5016('0xa'),auth[_0x5016('0xb')](),controller[_0x5016('0x14')]);router[_0x5016('0x15')](_0x5016('0xa'),auth[_0x5016('0xb')](),controller[_0x5016('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x6ec2=['post','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','isAuthenticated','show','/:id/run','run','/:id/query','query'];(function(_0x5e4317,_0x4b3aee){var _0x347842=function(_0x210d52){while(--_0x210d52){_0x5e4317['push'](_0x5e4317['shift']());}};_0x347842(++_0x4b3aee);}(_0x6ec2,0x78));var _0x26ec=function(_0x46ece1,_0x1965a8){_0x46ece1=_0x46ece1-0x0;var _0xcf0d7=_0x6ec2[_0x46ece1];return _0xcf0d7;};'use strict';var multer=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var path=require(_0x26ec('0x2'));var timeout=require(_0x26ec('0x3'));var express=require(_0x26ec('0x4'));var router=express[_0x26ec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26ec('0x6'));var interaction=require(_0x26ec('0x7'));var config=require(_0x26ec('0x8'));var controller=require(_0x26ec('0x9'));router[_0x26ec('0xa')]('/',auth['isAuthenticated'](),controller[_0x26ec('0xb')]);router['get']('/:id',auth[_0x26ec('0xc')](),controller[_0x26ec('0xd')]);router[_0x26ec('0xa')]('/:id/preview',auth[_0x26ec('0xc')](),controller['preview']);router[_0x26ec('0xa')](_0x26ec('0xe'),auth[_0x26ec('0xc')](),controller[_0x26ec('0xf')]);router[_0x26ec('0xa')](_0x26ec('0x10'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x11')]);router[_0x26ec('0x12')]('/',auth[_0x26ec('0xc')](),controller['create']);router['put'](_0x26ec('0x13'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x14')]);router[_0x26ec('0x15')](_0x26ec('0x13'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x16')]);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 5147963..398e9d2 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 _0xa13a=['exports','STRING','ENUM','csv','pdf','DATE','Loading','scheduled','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x3dec4c,_0x5ec722){var _0xbf2fd=function(_0x7052ff){while(--_0x7052ff){_0x3dec4c['push'](_0x3dec4c['shift']());}};_0xbf2fd(++_0x5ec722);}(_0xa13a,0x1ba));var _0xaa13=function(_0x2bcb1b,_0x73b2d6){_0x2bcb1b=_0x2bcb1b-0x0;var _0x2a7bb4=_0xa13a[_0x2bcb1b];return _0x2a7bb4;};'use strict';var Sequelize=require(_0xaa13('0x0'));var moment=require(_0xaa13('0x1'));module[_0xaa13('0x2')]={'name':{'type':Sequelize[_0xaa13('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xaa13('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xaa13('0x4')](_0xaa13('0x5'),_0xaa13('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0xaa13('0x5')},'savename':{'type':Sequelize[_0xaa13('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xaa13('0x7')]},'endDate':{'type':Sequelize[_0xaa13('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xaa13('0x8')},'type':{'type':Sequelize[_0xaa13('0x4')]('manual',_0xaa13('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xaa13('0xa')](0xb)[_0xaa13('0xb')]},'reportType':{'type':Sequelize[_0xaa13('0x3')]}};
\ No newline at end of file
+var _0x47c9=['scheduled','INTEGER','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x453bc4,_0x1a31a0){var _0x55476c=function(_0x52e2b3){while(--_0x52e2b3){_0x453bc4['push'](_0x453bc4['shift']());}};_0x55476c(++_0x1a31a0);}(_0x47c9,0xb6));var _0x947c=function(_0x392e0a,_0x55432d){_0x392e0a=_0x392e0a-0x0;var _0x5eb15a=_0x47c9[_0x392e0a];return _0x5eb15a;};'use strict';var Sequelize=require(_0x947c('0x0'));var moment=require(_0x947c('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x947c('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x947c('0x3')](_0x947c('0x4'),_0x947c('0x5'),_0x947c('0x6')),'allowNull':![],'defaultValue':_0x947c('0x4')},'savename':{'type':Sequelize[_0x947c('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x947c('0x7')]},'endDate':{'type':Sequelize[_0x947c('0x7')]},'status':{'type':Sequelize[_0x947c('0x2')],'defaultValue':_0x947c('0x8')},'type':{'type':Sequelize[_0x947c('0x3')](_0x947c('0x9'),_0x947c('0xa')),'allowNull':![],'defaultValue':_0x947c('0x9')},'reportId':{'type':Sequelize[_0x947c('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x947c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 37824b1..ce77fdb 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 _0x0cd2=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','body','download','basename','savename','output','existsSync','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','keys','catch','create','user'];(function(_0xdbd0c8,_0x35da4c){var _0x2f23cf=function(_0x352ecb){while(--_0x352ecb){_0xdbd0c8['push'](_0xdbd0c8['shift']());}};_0x2f23cf(++_0x35da4c);}(_0x0cd2,0x78));var _0x20cd=function(_0x3959fc,_0x32b4f8){_0x3959fc=_0x3959fc-0x0;var _0x4e438e=_0x0cd2[_0x3959fc];return _0x4e438e;};'use strict';var emlformat=require(_0x20cd('0x0'));var rimraf=require(_0x20cd('0x1'));var zipdir=require(_0x20cd('0x2'));var jsonpatch=require(_0x20cd('0x3'));var rp=require(_0x20cd('0x4'));var moment=require(_0x20cd('0x5'));var BPromise=require(_0x20cd('0x6'));var Mustache=require(_0x20cd('0x7'));var util=require('util');var path=require(_0x20cd('0x8'));var sox=require(_0x20cd('0x9'));var csv=require('to-csv');var ejs=require(_0x20cd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x20cd('0xb'));var crypto=require(_0x20cd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x20cd('0xd'));var toCsv=require(_0x20cd('0xe'));var querystring=require(_0x20cd('0xf'));var Papa=require(_0x20cd('0x10'));var Redis=require(_0x20cd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x20cd('0x12'));var as=require(_0x20cd('0x13'));var hardwareService=require(_0x20cd('0x14'));var logger=require(_0x20cd('0x15'))('api');var utils=require(_0x20cd('0x16'));var config=require(_0x20cd('0x17'));var licenseUtil=require(_0x20cd('0x18'));var db=require(_0x20cd('0x19'))['db'];function respondWithStatusCode(_0x236aaa,_0x4e05c1){_0x4e05c1=_0x4e05c1||0xcc;return function(_0x54793d){if(_0x54793d){return _0x236aaa[_0x20cd('0x1a')](_0x4e05c1);}return _0x236aaa[_0x20cd('0x1b')](_0x4e05c1)[_0x20cd('0x1c')]();};}function respondWithResult(_0x4a9c61,_0x648885){_0x648885=_0x648885||0xc8;return function(_0x4017c3){if(_0x4017c3){return _0x4a9c61[_0x20cd('0x1b')](_0x648885)[_0x20cd('0x1d')](_0x4017c3);}};}function respondWithFilteredResult(_0x5eecb8,_0x2eac98){return function(_0x35016d){if(_0x35016d){var _0x3269af=typeof _0x2eac98[_0x20cd('0x1e')]===_0x20cd('0x1f')&&typeof _0x2eac98[_0x20cd('0x20')]===_0x20cd('0x1f');var _0x2bdabf=_0x35016d[_0x20cd('0x21')];var _0x87aafa=_0x3269af?0x0:_0x2eac98[_0x20cd('0x1e')];var _0x50666e=_0x3269af?_0x35016d[_0x20cd('0x21')]:_0x2eac98[_0x20cd('0x1e')]+_0x2eac98[_0x20cd('0x20')];var _0x14d4f1;if(_0x50666e>=_0x2bdabf){_0x50666e=_0x2bdabf;_0x14d4f1=0xc8;}else{_0x14d4f1=0xce;}_0x5eecb8[_0x20cd('0x1b')](_0x14d4f1);return _0x5eecb8[_0x20cd('0x22')](_0x20cd('0x23'),_0x87aafa+'-'+_0x50666e+'/'+_0x2bdabf)[_0x20cd('0x1d')](_0x35016d);}return null;};}function patchUpdates(_0xafa0b7){return function(_0x4db5f4){try{jsonpatch[_0x20cd('0x24')](_0x4db5f4,_0xafa0b7,!![]);}catch(_0x521218){return BPromise['reject'](_0x521218);}return _0x4db5f4[_0x20cd('0x25')]();};}function saveUpdates(_0x27238d,_0x5511a4){return function(_0x3328f5){if(_0x3328f5){return _0x3328f5[_0x20cd('0x26')](_0x27238d)[_0x20cd('0x27')](function(_0x587e53){return _0x587e53;});}return null;};}function removeEntity(_0x2f5a89,_0x5e0a22){return function(_0x1d6e1){if(_0x1d6e1){return _0x1d6e1['destroy']()[_0x20cd('0x27')](function(){var _0x4cdeed=_0x1d6e1['get']({'plain':!![]});var _0x3672c6=_0x20cd('0x28');return db[_0x20cd('0x29')][_0x20cd('0x2a')]({'where':{'type':_0x3672c6,'resourceId':_0x4cdeed['id']}})['then'](function(){return _0x1d6e1;});})[_0x20cd('0x27')](function(){_0x2f5a89[_0x20cd('0x1b')](0xcc)[_0x20cd('0x1c')]();});}};}function handleEntityNotFound(_0x5397fa,_0x48b83f){return function(_0x4d097f){if(!_0x4d097f){_0x5397fa[_0x20cd('0x1a')](0x194);}return _0x4d097f;};}function handleError(_0x50a5d3,_0x17220d){_0x17220d=_0x17220d||0x1f4;return function(_0x40b41f){logger[_0x20cd('0x2b')](_0x40b41f[_0x20cd('0x2c')]);if(_0x40b41f[_0x20cd('0x2d')]){delete _0x40b41f['name'];}_0x50a5d3[_0x20cd('0x1b')](_0x17220d)[_0x20cd('0x2e')](_0x40b41f);};}exports[_0x20cd('0x2f')]=function(_0x559521,_0xf66613){var _0x2fa96d={},_0x112bec={},_0x20fa63={'count':0x0,'rows':[]};var _0x3f552c=_[_0x20cd('0x30')](db[_0x20cd('0x31')][_0x20cd('0x32')],function(_0x4498d9){return{'name':_0x4498d9[_0x20cd('0x33')],'type':_0x4498d9[_0x20cd('0x34')][_0x20cd('0x35')]};});_0x112bec[_0x20cd('0x36')]=_[_0x20cd('0x30')](_0x3f552c,_0x20cd('0x2d'));_0x112bec['query']=_['keys'](_0x559521[_0x20cd('0x37')]);_0x112bec[_0x20cd('0x38')]=_[_0x20cd('0x39')](_0x112bec[_0x20cd('0x36')],_0x112bec['query']);_0x2fa96d[_0x20cd('0x3a')]=_[_0x20cd('0x39')](_0x112bec[_0x20cd('0x36')],qs[_0x20cd('0x3b')](_0x559521[_0x20cd('0x37')][_0x20cd('0x3b')]));_0x2fa96d['attributes']=_0x2fa96d[_0x20cd('0x3a')][_0x20cd('0x3c')]?_0x2fa96d[_0x20cd('0x3a')]:_0x112bec[_0x20cd('0x36')];if(!_0x559521[_0x20cd('0x37')][_0x20cd('0x3d')](_0x20cd('0x3e'))){_0x2fa96d[_0x20cd('0x20')]=qs[_0x20cd('0x20')](_0x559521[_0x20cd('0x37')]['limit']);_0x2fa96d[_0x20cd('0x1e')]=qs[_0x20cd('0x1e')](_0x559521[_0x20cd('0x37')][_0x20cd('0x1e')]);}_0x2fa96d[_0x20cd('0x3f')]=qs[_0x20cd('0x40')](_0x559521['query'][_0x20cd('0x40')]);_0x2fa96d[_0x20cd('0x41')]=qs[_0x20cd('0x38')](_[_0x20cd('0x42')](_0x559521[_0x20cd('0x37')],_0x112bec[_0x20cd('0x38')]),_0x3f552c);if(_0x559521[_0x20cd('0x37')][_0x20cd('0x43')]){_0x2fa96d[_0x20cd('0x41')]=_[_0x20cd('0x44')](_0x2fa96d[_0x20cd('0x41')],{'$or':_[_0x20cd('0x30')](_0x3f552c,function(_0x1de35e){if(_0x1de35e[_0x20cd('0x34')]!==_0x20cd('0x45')){var _0x4019b2={};_0x4019b2[_0x1de35e[_0x20cd('0x2d')]]={'$like':'%'+_0x559521[_0x20cd('0x37')][_0x20cd('0x43')]+'%'};return _0x4019b2;}})});}_0x2fa96d=_[_0x20cd('0x44')]({},_0x2fa96d,_0x559521['options']);var _0x144260={'where':_0x2fa96d[_0x20cd('0x41')]};return db[_0x20cd('0x31')][_0x20cd('0x21')](_0x144260)[_0x20cd('0x27')](function(_0x13ac3b){_0x20fa63[_0x20cd('0x21')]=_0x13ac3b;if(_0x559521[_0x20cd('0x37')][_0x20cd('0x46')]){_0x2fa96d[_0x20cd('0x47')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x2fa96d);})[_0x20cd('0x27')](function(_0x2a8a90){_0x20fa63['rows']=_0x2a8a90;return _0x20fa63;})[_0x20cd('0x27')](respondWithFilteredResult(_0xf66613,_0x2fa96d))['catch'](handleError(_0xf66613,null));};exports[_0x20cd('0x48')]=function(_0x14a9d5,_0x2b91d8){var _0x4371a9={'raw':!![],'where':{'id':_0x14a9d5[_0x20cd('0x49')]['id']}},_0x44bf52={};_0x44bf52[_0x20cd('0x36')]=_[_0x20cd('0x4a')](db[_0x20cd('0x31')]['rawAttributes']);_0x44bf52['query']=_[_0x20cd('0x4a')](_0x14a9d5['query']);_0x44bf52[_0x20cd('0x38')]=_[_0x20cd('0x39')](_0x44bf52[_0x20cd('0x36')],_0x44bf52[_0x20cd('0x37')]);_0x4371a9['attributes']=_[_0x20cd('0x39')](_0x44bf52[_0x20cd('0x36')],qs['fields'](_0x14a9d5[_0x20cd('0x37')][_0x20cd('0x3b')]));_0x4371a9[_0x20cd('0x3a')]=_0x4371a9['attributes'][_0x20cd('0x3c')]?_0x4371a9[_0x20cd('0x3a')]:_0x44bf52[_0x20cd('0x36')];if(_0x14a9d5[_0x20cd('0x37')][_0x20cd('0x46')]){_0x4371a9['include']=[{'all':!![]}];}_0x4371a9=_[_0x20cd('0x44')]({},_0x4371a9,_0x14a9d5['options']);return db[_0x20cd('0x31')]['find'](_0x4371a9)['then'](handleEntityNotFound(_0x2b91d8,null))[_0x20cd('0x27')](respondWithResult(_0x2b91d8,null))[_0x20cd('0x4b')](handleError(_0x2b91d8,null));};exports['create']=function(_0x28eaeb,_0x4ffb22){return db[_0x20cd('0x31')][_0x20cd('0x4c')](_0x28eaeb['body'],{})[_0x20cd('0x27')](function(_0x4e934c){var _0x63830a=_0x28eaeb[_0x20cd('0x4d')][_0x20cd('0x4e')]({'plain':!![]});if(!_0x63830a)throw new Error(_0x20cd('0x4f'));if(_0x63830a[_0x20cd('0x50')]===_0x20cd('0x4d')){var _0xe35381=_0x4e934c['get']({'plain':!![]});var _0x7ad8cb=_0x20cd('0x28');return db[_0x20cd('0x51')][_0x20cd('0x52')]({'where':{'name':_0x7ad8cb,'userProfileId':_0x63830a[_0x20cd('0x53')]},'raw':!![]})[_0x20cd('0x27')](function(_0x46e44c){if(_0x46e44c&&_0x46e44c[_0x20cd('0x54')]===0x0){return db[_0x20cd('0x29')][_0x20cd('0x4c')]({'name':_0xe35381['name'],'resourceId':_0xe35381['id'],'type':_0x46e44c[_0x20cd('0x2d')],'sectionId':_0x46e44c['id']},{})[_0x20cd('0x27')](function(){return _0x4e934c;});}else{return _0x4e934c;}})[_0x20cd('0x4b')](function(_0x34df8d){logger[_0x20cd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34df8d);throw _0x34df8d;});}return _0x4e934c;})['then'](respondWithResult(_0x4ffb22,0xc9))[_0x20cd('0x4b')](handleError(_0x4ffb22,null));};exports['update']=function(_0x57fa01,_0x46964f){if(_0x57fa01[_0x20cd('0x55')]['id']){delete _0x57fa01['body']['id'];}return db[_0x20cd('0x31')][_0x20cd('0x52')]({'where':{'id':_0x57fa01[_0x20cd('0x49')]['id']}})[_0x20cd('0x27')](handleEntityNotFound(_0x46964f,null))[_0x20cd('0x27')](saveUpdates(_0x57fa01[_0x20cd('0x55')],null))[_0x20cd('0x27')](respondWithResult(_0x46964f,null))['catch'](handleError(_0x46964f,null));};exports[_0x20cd('0x2a')]=function(_0x1eacf9,_0x245073){return db[_0x20cd('0x31')]['find']({'where':{'id':_0x1eacf9['params']['id']}})['then'](handleEntityNotFound(_0x245073,null))['then'](removeEntity(_0x245073,null))[_0x20cd('0x4b')](handleError(_0x245073,null));};exports[_0x20cd('0x56')]=function(_0x424bd9,_0x2b1288,_0x1c3dbb){return db[_0x20cd('0x31')][_0x20cd('0x52')]({'where':{'id':_0x424bd9['params']['id']},'attributes':['name',_0x20cd('0x57'),_0x20cd('0x58'),_0x20cd('0x59')],'raw':!![]})[_0x20cd('0x27')](handleEntityNotFound(_0x2b1288,null))['then'](function(_0x3b8f62){if(_0x3b8f62){if(!fs[_0x20cd('0x5a')](path['join'](config['root'],_0x20cd('0x5b'),_0x3b8f62[_0x20cd('0x58')]))){throw new db[(_0x20cd('0x5c'))]['ValidationError'](_0x20cd('0x5d'));}if(_0x424bd9[_0x20cd('0x37')][_0x20cd('0x5e')]){return _0x2b1288['sendStatus'](0xc8);}return _0x2b1288['download'](path['join'](config[_0x20cd('0x5f')],_0x20cd('0x5b'),_0x3b8f62[_0x20cd('0x58')]),util[_0x20cd('0x60')](_0x20cd('0x61'),_0x3b8f62[_0x20cd('0x57')]||_0x3b8f62[_0x20cd('0x2d')],_0x3b8f62[_0x20cd('0x59')][_0x20cd('0x62')]()));}})[_0x20cd('0x4b')](handleError(_0x2b1288,null));};
\ No newline at end of file
+var _0x3275=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','get','ExtractedReports','UserProfileResource','end','stack','name','send','index','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format'];(function(_0x182fa4,_0x936799){var _0x6366ad=function(_0x336daf){while(--_0x336daf){_0x182fa4['push'](_0x182fa4['shift']());}};_0x6366ad(++_0x936799);}(_0x3275,0x173));var _0x5327=function(_0x5513b7,_0x4e3656){_0x5513b7=_0x5513b7-0x0;var _0x565a85=_0x3275[_0x5513b7];return _0x565a85;};'use strict';var emlformat=require(_0x5327('0x0'));var rimraf=require(_0x5327('0x1'));var zipdir=require(_0x5327('0x2'));var jsonpatch=require(_0x5327('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5327('0x4'));var Mustache=require(_0x5327('0x5'));var util=require(_0x5327('0x6'));var path=require('path');var sox=require(_0x5327('0x7'));var csv=require(_0x5327('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5327('0x9'));var _=require(_0x5327('0xa'));var squel=require(_0x5327('0xb'));var crypto=require(_0x5327('0xc'));var jsforce=require(_0x5327('0xd'));var deskjs=require(_0x5327('0xe'));var toCsv=require(_0x5327('0x8'));var querystring=require(_0x5327('0xf'));var Papa=require(_0x5327('0x10'));var Redis=require(_0x5327('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5327('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5327('0x13'));var logger=require(_0x5327('0x14'))(_0x5327('0x15'));var utils=require(_0x5327('0x16'));var config=require(_0x5327('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551812,_0x54e36f){_0x54e36f=_0x54e36f||0xcc;return function(_0x57b778){if(_0x57b778){return _0x551812[_0x5327('0x18')](_0x54e36f);}return _0x551812['status'](_0x54e36f)['end']();};}function respondWithResult(_0x48274d,_0x6d11e5){_0x6d11e5=_0x6d11e5||0xc8;return function(_0x325ac1){if(_0x325ac1){return _0x48274d[_0x5327('0x19')](_0x6d11e5)[_0x5327('0x1a')](_0x325ac1);}};}function respondWithFilteredResult(_0x2d1709,_0x22ea54){return function(_0x51d634){if(_0x51d634){var _0x37823b=typeof _0x22ea54[_0x5327('0x1b')]===_0x5327('0x1c')&&typeof _0x22ea54['limit']===_0x5327('0x1c');var _0x5343ea=_0x51d634['count'];var _0x87929=_0x37823b?0x0:_0x22ea54[_0x5327('0x1b')];var _0x5223c7=_0x37823b?_0x51d634[_0x5327('0x1d')]:_0x22ea54[_0x5327('0x1b')]+_0x22ea54[_0x5327('0x1e')];var _0x5df6ff;if(_0x5223c7>=_0x5343ea){_0x5223c7=_0x5343ea;_0x5df6ff=0xc8;}else{_0x5df6ff=0xce;}_0x2d1709['status'](_0x5df6ff);return _0x2d1709[_0x5327('0x1f')](_0x5327('0x20'),_0x87929+'-'+_0x5223c7+'/'+_0x5343ea)['json'](_0x51d634);}return null;};}function patchUpdates(_0x4fc380){return function(_0x417226){try{jsonpatch['apply'](_0x417226,_0x4fc380,!![]);}catch(_0x157d76){return BPromise[_0x5327('0x21')](_0x157d76);}return _0x417226['save']();};}function saveUpdates(_0x5ad4d3,_0x522fb7){return function(_0x511824){if(_0x511824){return _0x511824['update'](_0x5ad4d3)[_0x5327('0x22')](function(_0x1e5d9c){return _0x1e5d9c;});}return null;};}function removeEntity(_0x18ecf2,_0xd01e4e){return function(_0x2b5edc){if(_0x2b5edc){return _0x2b5edc[_0x5327('0x23')]()[_0x5327('0x22')](function(){var _0x50d2e2=_0x2b5edc[_0x5327('0x24')]({'plain':!![]});var _0x42fe78=_0x5327('0x25');return db[_0x5327('0x26')][_0x5327('0x23')]({'where':{'type':_0x42fe78,'resourceId':_0x50d2e2['id']}})['then'](function(){return _0x2b5edc;});})['then'](function(){_0x18ecf2[_0x5327('0x19')](0xcc)[_0x5327('0x27')]();});}};}function handleEntityNotFound(_0x3928e0,_0x4b5fef){return function(_0x3b0783){if(!_0x3b0783){_0x3928e0[_0x5327('0x18')](0x194);}return _0x3b0783;};}function handleError(_0xef749c,_0x19193f){_0x19193f=_0x19193f||0x1f4;return function(_0x39e4c1){logger['error'](_0x39e4c1[_0x5327('0x28')]);if(_0x39e4c1[_0x5327('0x29')]){delete _0x39e4c1[_0x5327('0x29')];}_0xef749c[_0x5327('0x19')](_0x19193f)[_0x5327('0x2a')](_0x39e4c1);};}exports[_0x5327('0x2b')]=function(_0x587f24,_0xb2b50f){var _0x2c5cb6={},_0x4faaf7={},_0x5e916b={'count':0x0,'rows':[]};var _0x23d60b=_['map'](db[_0x5327('0x2c')]['rawAttributes'],function(_0x5cc805){return{'name':_0x5cc805[_0x5327('0x2d')],'type':_0x5cc805[_0x5327('0x2e')][_0x5327('0x2f')]};});_0x4faaf7[_0x5327('0x30')]=_['map'](_0x23d60b,'name');_0x4faaf7[_0x5327('0x31')]=_[_0x5327('0x32')](_0x587f24[_0x5327('0x31')]);_0x4faaf7[_0x5327('0x33')]=_['intersection'](_0x4faaf7['model'],_0x4faaf7[_0x5327('0x31')]);_0x2c5cb6['attributes']=_[_0x5327('0x34')](_0x4faaf7[_0x5327('0x30')],qs[_0x5327('0x35')](_0x587f24[_0x5327('0x31')][_0x5327('0x35')]));_0x2c5cb6[_0x5327('0x36')]=_0x2c5cb6[_0x5327('0x36')][_0x5327('0x37')]?_0x2c5cb6[_0x5327('0x36')]:_0x4faaf7['model'];if(!_0x587f24[_0x5327('0x31')]['hasOwnProperty'](_0x5327('0x38'))){_0x2c5cb6[_0x5327('0x1e')]=qs[_0x5327('0x1e')](_0x587f24['query'][_0x5327('0x1e')]);_0x2c5cb6['offset']=qs[_0x5327('0x1b')](_0x587f24[_0x5327('0x31')][_0x5327('0x1b')]);}_0x2c5cb6[_0x5327('0x39')]=qs[_0x5327('0x3a')](_0x587f24['query'][_0x5327('0x3a')]);_0x2c5cb6[_0x5327('0x3b')]=qs[_0x5327('0x33')](_[_0x5327('0x3c')](_0x587f24[_0x5327('0x31')],_0x4faaf7[_0x5327('0x33')]),_0x23d60b);if(_0x587f24[_0x5327('0x31')][_0x5327('0x3d')]){_0x2c5cb6[_0x5327('0x3b')]=_['merge'](_0x2c5cb6[_0x5327('0x3b')],{'$or':_[_0x5327('0x3e')](_0x23d60b,function(_0x3fbc6b){if(_0x3fbc6b['type']!==_0x5327('0x3f')){var _0xf683c1={};_0xf683c1[_0x3fbc6b[_0x5327('0x29')]]={'$like':'%'+_0x587f24['query'][_0x5327('0x3d')]+'%'};return _0xf683c1;}})});}_0x2c5cb6=_['merge']({},_0x2c5cb6,_0x587f24[_0x5327('0x40')]);var _0x4a9c02={'where':_0x2c5cb6[_0x5327('0x3b')]};return db[_0x5327('0x2c')][_0x5327('0x1d')](_0x4a9c02)[_0x5327('0x22')](function(_0x331de1){_0x5e916b['count']=_0x331de1;if(_0x587f24[_0x5327('0x31')][_0x5327('0x41')]){_0x2c5cb6[_0x5327('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x2c5cb6);})[_0x5327('0x22')](function(_0x3364c8){_0x5e916b['rows']=_0x3364c8;return _0x5e916b;})[_0x5327('0x22')](respondWithFilteredResult(_0xb2b50f,_0x2c5cb6))[_0x5327('0x43')](handleError(_0xb2b50f,null));};exports[_0x5327('0x44')]=function(_0x13a0d3,_0x1b0a6e){var _0x3ea097={'raw':!![],'where':{'id':_0x13a0d3[_0x5327('0x45')]['id']}},_0x5a5420={};_0x5a5420[_0x5327('0x30')]=_[_0x5327('0x32')](db[_0x5327('0x2c')][_0x5327('0x46')]);_0x5a5420[_0x5327('0x31')]=_[_0x5327('0x32')](_0x13a0d3[_0x5327('0x31')]);_0x5a5420[_0x5327('0x33')]=_['intersection'](_0x5a5420[_0x5327('0x30')],_0x5a5420['query']);_0x3ea097[_0x5327('0x36')]=_[_0x5327('0x34')](_0x5a5420[_0x5327('0x30')],qs[_0x5327('0x35')](_0x13a0d3[_0x5327('0x31')][_0x5327('0x35')]));_0x3ea097[_0x5327('0x36')]=_0x3ea097['attributes']['length']?_0x3ea097[_0x5327('0x36')]:_0x5a5420[_0x5327('0x30')];if(_0x13a0d3[_0x5327('0x31')][_0x5327('0x41')]){_0x3ea097[_0x5327('0x42')]=[{'all':!![]}];}_0x3ea097=_[_0x5327('0x47')]({},_0x3ea097,_0x13a0d3[_0x5327('0x40')]);return db[_0x5327('0x2c')][_0x5327('0x48')](_0x3ea097)[_0x5327('0x22')](handleEntityNotFound(_0x1b0a6e,null))['then'](respondWithResult(_0x1b0a6e,null))[_0x5327('0x43')](handleError(_0x1b0a6e,null));};exports[_0x5327('0x49')]=function(_0x3b0148,_0x4ab7c6){return db[_0x5327('0x2c')][_0x5327('0x49')](_0x3b0148[_0x5327('0x4a')],{})[_0x5327('0x22')](function(_0x203eee){var _0x54ebf4=_0x3b0148[_0x5327('0x4b')][_0x5327('0x24')]({'plain':!![]});if(!_0x54ebf4)throw new Error(_0x5327('0x4c'));if(_0x54ebf4['role']==='user'){var _0x3e2635=_0x203eee[_0x5327('0x24')]({'plain':!![]});var _0xedc3b9=_0x5327('0x25');return db[_0x5327('0x4d')][_0x5327('0x48')]({'where':{'name':_0xedc3b9,'userProfileId':_0x54ebf4['userProfileId']},'raw':!![]})['then'](function(_0x5eb8a1){if(_0x5eb8a1&&_0x5eb8a1['autoAssociation']===0x0){return db[_0x5327('0x26')][_0x5327('0x49')]({'name':_0x3e2635[_0x5327('0x29')],'resourceId':_0x3e2635['id'],'type':_0x5eb8a1['name'],'sectionId':_0x5eb8a1['id']},{})['then'](function(){return _0x203eee;});}else{return _0x203eee;}})['catch'](function(_0x730754){logger[_0x5327('0x4e')](_0x5327('0x4f'),_0x730754);throw _0x730754;});}return _0x203eee;})[_0x5327('0x22')](respondWithResult(_0x4ab7c6,0xc9))[_0x5327('0x43')](handleError(_0x4ab7c6,null));};exports[_0x5327('0x50')]=function(_0x2026a2,_0x4942dc){if(_0x2026a2[_0x5327('0x4a')]['id']){delete _0x2026a2['body']['id'];}return db[_0x5327('0x2c')][_0x5327('0x48')]({'where':{'id':_0x2026a2[_0x5327('0x45')]['id']}})[_0x5327('0x22')](handleEntityNotFound(_0x4942dc,null))[_0x5327('0x22')](saveUpdates(_0x2026a2[_0x5327('0x4a')],null))[_0x5327('0x22')](respondWithResult(_0x4942dc,null))[_0x5327('0x43')](handleError(_0x4942dc,null));};exports[_0x5327('0x23')]=function(_0x4b4c59,_0x69b4bd){return db[_0x5327('0x2c')]['find']({'where':{'id':_0x4b4c59[_0x5327('0x45')]['id']}})[_0x5327('0x22')](handleEntityNotFound(_0x69b4bd,null))[_0x5327('0x22')](removeEntity(_0x69b4bd,null))[_0x5327('0x43')](handleError(_0x69b4bd,null));};exports[_0x5327('0x51')]=function(_0x2744ed,_0x4e9f0c,_0x6a9b65){return db[_0x5327('0x2c')][_0x5327('0x48')]({'where':{'id':_0x2744ed['params']['id']},'attributes':['name',_0x5327('0x52'),_0x5327('0x53'),_0x5327('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x4e9f0c,null))[_0x5327('0x22')](function(_0x18991a){if(_0x18991a){if(!fs['existsSync'](path['join'](config[_0x5327('0x55')],_0x5327('0x56'),_0x18991a[_0x5327('0x53')]))){throw new db[(_0x5327('0x57'))]['ValidationError'](_0x5327('0x58'));}if(_0x2744ed[_0x5327('0x31')][_0x5327('0x59')]){return _0x4e9f0c[_0x5327('0x18')](0xc8);}return _0x4e9f0c[_0x5327('0x51')](path['join'](config[_0x5327('0x55')],_0x5327('0x56'),_0x18991a[_0x5327('0x53')]),util[_0x5327('0x5a')](_0x5327('0x5b'),_0x18991a[_0x5327('0x52')]||_0x18991a[_0x5327('0x29')],_0x18991a[_0x5327('0x54')][_0x5327('0x5c')]()));}})[_0x5327('0x43')](handleError(_0x4e9f0c,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index d95a476..3d7b6d7 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 _0x7bbc=['bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment'];(function(_0x36ed63,_0x1decdf){var _0x1fc9f6=function(_0x19b252){while(--_0x19b252){_0x36ed63['push'](_0x36ed63['shift']());}};_0x1fc9f6(++_0x1decdf);}(_0x7bbc,0x69));var _0xc7bb=function(_0x495552,_0x4da737){_0x495552=_0x495552-0x0;var _0x511110=_0x7bbc[_0x495552];return _0x511110;};'use strict';var _=require(_0xc7bb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc7bb('0x1'));var moment=require(_0xc7bb('0x2'));var BPromise=require(_0xc7bb('0x3'));var rp=require(_0xc7bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc7bb('0x5'));var config=require(_0xc7bb('0x6'));var attributes=require(_0xc7bb('0x7'));module[_0xc7bb('0x8')]=function(_0x3c66a9,_0x2c22b2){return _0x3c66a9[_0xc7bb('0x9')](_0xc7bb('0xa'),attributes,{'tableName':_0xc7bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x49b9=['define','AnalyticExtractedReport','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x49b9,0x119));var _0x949b=function(_0x503647,_0x83b0de){_0x503647=_0x503647-0x0;var _0x4a1e48=_0x49b9[_0x503647];return _0x4a1e48;};'use strict';var _=require('lodash');var util=require(_0x949b('0x0'));var logger=require(_0x949b('0x1'))(_0x949b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x949b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x949b('0x4'));var config=require(_0x949b('0x5'));var attributes=require(_0x949b('0x6'));module['exports']=function(_0x1da7f2,_0x5ebffd){return _0x1da7f2[_0x949b('0x7')](_0x949b('0x8'),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 c619d68..94bee6f 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 _0x78b0=['http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4ed05b,_0x36148d){var _0x2cd2a3=function(_0x1939d0){while(--_0x1939d0){_0x4ed05b['push'](_0x4ed05b['shift']());}};_0x2cd2a3(++_0x36148d);}(_0x78b0,0x173));var _0x078b=function(_0x236cc0,_0xc76be8){_0x236cc0=_0x236cc0-0x0;var _0x509cc7=_0x78b0[_0x236cc0];return _0x509cc7;};'use strict';var _=require(_0x078b('0x0'));var util=require(_0x078b('0x1'));var moment=require('moment');var BPromise=require(_0x078b('0x2'));var rs=require(_0x078b('0x3'));var fs=require('fs');var Redis=require(_0x078b('0x4'));var db=require(_0x078b('0x5'))['db'];var utils=require(_0x078b('0x6'));var logger=require(_0x078b('0x7'))(_0x078b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x078b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fa46e,_0x160f91,_0x3c3f1c){return new BPromise(function(_0xbed569,_0x3a9648){return client[_0x078b('0xa')](_0x3fa46e,_0x3c3f1c)[_0x078b('0xb')](function(_0x47948b){logger[_0x078b('0xc')](_0x078b('0xd'),_0x160f91,_0x078b('0xe'));logger['debug'](_0x078b('0xf'),_0x160f91,_0x078b('0xe'),JSON[_0x078b('0x10')](_0x47948b));if(_0x47948b[_0x078b('0x11')]){if(_0x47948b[_0x078b('0x11')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x160f91,_0x47948b['error']['message']);return _0x3a9648(_0x47948b[_0x078b('0x11')][_0x078b('0x12')]);}logger[_0x078b('0x11')](_0x078b('0xd'),_0x160f91,_0x47948b[_0x078b('0x11')]['message']);return _0xbed569(_0x47948b[_0x078b('0x11')][_0x078b('0x12')]);}else{logger[_0x078b('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x160f91,_0x078b('0xe'));_0xbed569(_0x47948b['result'][_0x078b('0x12')]);}})[_0x078b('0x13')](function(_0x3f4c68){logger[_0x078b('0x11')](_0x078b('0xd'),_0x160f91,_0x3f4c68);_0x3a9648(_0x3f4c68);});});}
\ No newline at end of file
+var _0xef74=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x4cec21,_0x3d6fb4){var _0x30f1ef=function(_0x544e28){while(--_0x544e28){_0x4cec21['push'](_0x4cec21['shift']());}};_0x30f1ef(++_0x3d6fb4);}(_0xef74,0x8d));var _0x4ef7=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xef74[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x4ef7('0x0'));var util=require(_0x4ef7('0x1'));var moment=require(_0x4ef7('0x2'));var BPromise=require(_0x4ef7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ef7('0x4'));var db=require(_0x4ef7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4ef7('0x6'));var config=require(_0x4ef7('0x7'));var jayson=require(_0x4ef7('0x8'));var client=jayson[_0x4ef7('0x9')][_0x4ef7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbebde,_0x15626f,_0x39cdff){return new BPromise(function(_0x30a89a,_0x26dd95){return client['request'](_0xbebde,_0x39cdff)[_0x4ef7('0xb')](function(_0x3e1941){logger[_0x4ef7('0xc')](_0x4ef7('0xd'),_0x15626f,_0x4ef7('0xe'));logger[_0x4ef7('0xf')](_0x4ef7('0x10'),_0x15626f,'request\x20sent',JSON[_0x4ef7('0x11')](_0x3e1941));if(_0x3e1941[_0x4ef7('0x12')]){if(_0x3e1941[_0x4ef7('0x12')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x15626f,_0x3e1941[_0x4ef7('0x12')][_0x4ef7('0x13')]);return _0x26dd95(_0x3e1941['error'][_0x4ef7('0x13')]);}logger[_0x4ef7('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x15626f,_0x3e1941[_0x4ef7('0x12')][_0x4ef7('0x13')]);return _0x30a89a(_0x3e1941['error']['message']);}else{logger[_0x4ef7('0xc')](_0x4ef7('0xd'),_0x15626f,_0x4ef7('0xe'));_0x30a89a(_0x3e1941[_0x4ef7('0x14')][_0x4ef7('0x13')]);}})[_0x4ef7('0x15')](function(_0x1f87f3){logger[_0x4ef7('0x12')](_0x4ef7('0xd'),_0x15626f,_0x1f87f3);_0x26dd95(_0x1f87f3);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 0c18e10..fb976fa 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 _0x4f41=['show','/:id/download','download','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','/:id','isAuthenticated'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x4f41,0x184));var _0x14f4=function(_0x52cde3,_0x28d007){_0x52cde3=_0x52cde3-0x0;var _0x106ff1=_0x4f41[_0x52cde3];return _0x106ff1;};'use strict';var multer=require('multer');var util=require(_0x14f4('0x0'));var path=require(_0x14f4('0x1'));var timeout=require(_0x14f4('0x2'));var express=require(_0x14f4('0x3'));var router=express[_0x14f4('0x4')]();var fs_extra=require(_0x14f4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x14f4('0x6'));var config=require('../../config/environment');var controller=require(_0x14f4('0x7'));router[_0x14f4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x14f4('0x8')](_0x14f4('0x9'),auth[_0x14f4('0xa')](),controller[_0x14f4('0xb')]);router[_0x14f4('0x8')](_0x14f4('0xc'),auth['isAuthenticated'](),controller[_0x14f4('0xd')]);router[_0x14f4('0xe')]('/',auth[_0x14f4('0xa')](),controller[_0x14f4('0xf')]);router[_0x14f4('0x10')](_0x14f4('0x9'),auth[_0x14f4('0xa')](),controller[_0x14f4('0x11')]);router[_0x14f4('0x12')]('/:id',auth[_0x14f4('0xa')](),controller[_0x14f4('0x13')]);module[_0x14f4('0x14')]=router;
\ No newline at end of file
+var _0xef8d=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','/:id','get','/:id/download','download','post'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xef8d,0xcc));var _0xdef8=function(_0x11b3f4,_0x371c17){_0x11b3f4=_0x11b3f4-0x0;var _0x47af1d=_0xef8d[_0x11b3f4];return _0x47af1d;};'use strict';var multer=require('multer');var util=require(_0xdef8('0x0'));var path=require(_0xdef8('0x1'));var timeout=require(_0xdef8('0x2'));var express=require(_0xdef8('0x3'));var router=express[_0xdef8('0x4')]();var fs_extra=require(_0xdef8('0x5'));var auth=require(_0xdef8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdef8('0x7'));var controller=require(_0xdef8('0x8'));router['get']('/',auth[_0xdef8('0x9')](),controller[_0xdef8('0xa')]);router['get'](_0xdef8('0xb'),auth[_0xdef8('0x9')](),controller['show']);router[_0xdef8('0xc')](_0xdef8('0xd'),auth['isAuthenticated'](),controller[_0xdef8('0xe')]);router[_0xdef8('0xf')]('/',auth[_0xdef8('0x9')](),controller[_0xdef8('0x10')]);router[_0xdef8('0x11')](_0xdef8('0xb'),auth[_0xdef8('0x9')](),controller[_0xdef8('0x12')]);router[_0xdef8('0x13')](_0xdef8('0xb'),auth[_0xdef8('0x9')](),controller[_0xdef8('0x14')]);module[_0xdef8('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 9f862fb..6d8a3b6 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 _0x8188=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4986a3,_0x42fe88){var _0x4c8723=function(_0x31abb6){while(--_0x31abb6){_0x4986a3['push'](_0x4986a3['shift']());}};_0x4c8723(++_0x42fe88);}(_0x8188,0x16c));var _0x8818=function(_0x1a9e3d,_0x39c8e2){_0x1a9e3d=_0x1a9e3d-0x0;var _0x2b1cea=_0x8188[_0x1a9e3d];return _0x2b1cea;};'use strict';var Sequelize=require(_0x8818('0x0'));module[_0x8818('0x1')]={'field':{'type':Sequelize[_0x8818('0x2')]},'alias':{'type':Sequelize[_0x8818('0x3')]},'function':{'type':Sequelize[_0x8818('0x3')]},'format':{'type':Sequelize[_0x8818('0x3')]},'groupBy':{'type':Sequelize[_0x8818('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8818('0x3')]},'custom':{'type':Sequelize[_0x8818('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe2f5=['BOOLEAN','exports','TEXT','STRING'];(function(_0x5292de,_0x5c03ef){var _0x52574f=function(_0x57d962){while(--_0x57d962){_0x5292de['push'](_0x5292de['shift']());}};_0x52574f(++_0x5c03ef);}(_0xe2f5,0x16d));var _0x5e2f=function(_0x14eb4e,_0x294202){_0x14eb4e=_0x14eb4e-0x0;var _0x142ad8=_0xe2f5[_0x14eb4e];return _0x142ad8;};'use strict';var Sequelize=require('sequelize');module[_0x5e2f('0x0')]={'field':{'type':Sequelize[_0x5e2f('0x1')]},'alias':{'type':Sequelize[_0x5e2f('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x5e2f('0x2')]},'groupBy':{'type':Sequelize[_0x5e2f('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x5e2f('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 24b3b5a..4462cdc 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 _0xf350=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','bulkCreate','body','find','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x29de5a,_0x34201f){var _0x11339a=function(_0x4e6ce9){while(--_0x4e6ce9){_0x29de5a['push'](_0x29de5a['shift']());}};_0x11339a(++_0x34201f);}(_0xf350,0x105));var _0x0f35=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf350[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x0f35('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f35('0x1'));var rp=require(_0x0f35('0x2'));var moment=require(_0x0f35('0x3'));var BPromise=require(_0x0f35('0x4'));var Mustache=require(_0x0f35('0x5'));var util=require(_0x0f35('0x6'));var path=require(_0x0f35('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f35('0x8'));var _=require(_0x0f35('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f35('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0f35('0xb'));var querystring=require('querystring');var Papa=require(_0x0f35('0xc'));var Redis=require(_0x0f35('0xd'));var authService=require(_0x0f35('0xe'));var qs=require(_0x0f35('0xf'));var as=require(_0x0f35('0x10'));var hardwareService=require(_0x0f35('0x11'));var logger=require(_0x0f35('0x12'))(_0x0f35('0x13'));var utils=require(_0x0f35('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0f35('0x15'));var db=require(_0x0f35('0x16'))['db'];function respondWithStatusCode(_0x515954,_0x21698e){_0x21698e=_0x21698e||0xcc;return function(_0x579b38){if(_0x579b38){return _0x515954[_0x0f35('0x17')](_0x21698e);}return _0x515954['status'](_0x21698e)['end']();};}function respondWithResult(_0x1a2f7c,_0x20cfb8){_0x20cfb8=_0x20cfb8||0xc8;return function(_0x322ed3){if(_0x322ed3){return _0x1a2f7c['status'](_0x20cfb8)[_0x0f35('0x18')](_0x322ed3);}};}function respondWithFilteredResult(_0x4011ab,_0x25e86d){return function(_0x38d9de){if(_0x38d9de){var _0xa07e54=typeof _0x25e86d[_0x0f35('0x19')]===_0x0f35('0x1a')&&typeof _0x25e86d[_0x0f35('0x1b')]===_0x0f35('0x1a');var _0x34b759=_0x38d9de[_0x0f35('0x1c')];var _0x1bcf51=_0xa07e54?0x0:_0x25e86d[_0x0f35('0x19')];var _0x496ff9=_0xa07e54?_0x38d9de[_0x0f35('0x1c')]:_0x25e86d[_0x0f35('0x19')]+_0x25e86d[_0x0f35('0x1b')];var _0x190ee7;if(_0x496ff9>=_0x34b759){_0x496ff9=_0x34b759;_0x190ee7=0xc8;}else{_0x190ee7=0xce;}_0x4011ab[_0x0f35('0x1d')](_0x190ee7);return _0x4011ab[_0x0f35('0x1e')](_0x0f35('0x1f'),_0x1bcf51+'-'+_0x496ff9+'/'+_0x34b759)[_0x0f35('0x18')](_0x38d9de);}return null;};}function patchUpdates(_0x2edf27){return function(_0x19dacb){try{jsonpatch[_0x0f35('0x20')](_0x19dacb,_0x2edf27,!![]);}catch(_0x1ecc64){return BPromise[_0x0f35('0x21')](_0x1ecc64);}return _0x19dacb[_0x0f35('0x22')]();};}function saveUpdates(_0x152e01,_0x42aaa0){return function(_0x4c7b08){if(_0x4c7b08){return _0x4c7b08[_0x0f35('0x23')](_0x152e01)[_0x0f35('0x24')](function(_0x43cf26){return _0x43cf26;});}return null;};}function removeEntity(_0x47d9ee,_0x4a71ed){return function(_0x252515){if(_0x252515){return _0x252515['destroy']()[_0x0f35('0x24')](function(){_0x47d9ee[_0x0f35('0x1d')](0xcc)[_0x0f35('0x25')]();});}};}function handleEntityNotFound(_0x494140,_0x1aed0a){return function(_0x3ce83d){if(!_0x3ce83d){_0x494140[_0x0f35('0x17')](0x194);}return _0x3ce83d;};}function handleError(_0x4a43c7,_0x4863f9){_0x4863f9=_0x4863f9||0x1f4;return function(_0x9091f0){logger[_0x0f35('0x26')](_0x9091f0['stack']);if(_0x9091f0[_0x0f35('0x27')]){delete _0x9091f0[_0x0f35('0x27')];}_0x4a43c7[_0x0f35('0x1d')](_0x4863f9)[_0x0f35('0x28')](_0x9091f0);};}exports[_0x0f35('0x29')]=function(_0x100301,_0x81ec3f){var _0x5d93f2={},_0x4021aa={},_0x3081f8={'count':0x0,'rows':[]};var _0x5cdf8=_['map'](db[_0x0f35('0x2a')][_0x0f35('0x2b')],function(_0x3d4a2d){return{'name':_0x3d4a2d[_0x0f35('0x2c')],'type':_0x3d4a2d[_0x0f35('0x2d')][_0x0f35('0x2e')]};});_0x4021aa['model']=_[_0x0f35('0x2f')](_0x5cdf8,_0x0f35('0x27'));_0x4021aa[_0x0f35('0x30')]=_['keys'](_0x100301[_0x0f35('0x30')]);_0x4021aa[_0x0f35('0x31')]=_[_0x0f35('0x32')](_0x4021aa['model'],_0x4021aa[_0x0f35('0x30')]);_0x5d93f2[_0x0f35('0x33')]=_[_0x0f35('0x32')](_0x4021aa[_0x0f35('0x34')],qs['fields'](_0x100301[_0x0f35('0x30')][_0x0f35('0x35')]));_0x5d93f2[_0x0f35('0x33')]=_0x5d93f2[_0x0f35('0x33')][_0x0f35('0x36')]?_0x5d93f2[_0x0f35('0x33')]:_0x4021aa[_0x0f35('0x34')];if(!_0x100301[_0x0f35('0x30')][_0x0f35('0x37')](_0x0f35('0x38'))){_0x5d93f2[_0x0f35('0x1b')]=qs[_0x0f35('0x1b')](_0x100301[_0x0f35('0x30')]['limit']);_0x5d93f2['offset']=qs[_0x0f35('0x19')](_0x100301[_0x0f35('0x30')]['offset']);}_0x5d93f2['order']=qs[_0x0f35('0x39')](_0x100301[_0x0f35('0x30')]['sort']);_0x5d93f2[_0x0f35('0x3a')]=qs['filters'](_[_0x0f35('0x3b')](_0x100301[_0x0f35('0x30')],_0x4021aa[_0x0f35('0x31')]),_0x5cdf8);if(_0x100301['query'][_0x0f35('0x3c')]){_0x5d93f2['where']=_[_0x0f35('0x3d')](_0x5d93f2[_0x0f35('0x3a')],{'$or':_[_0x0f35('0x2f')](_0x5cdf8,function(_0x1d58df){if(_0x1d58df[_0x0f35('0x2d')]!==_0x0f35('0x3e')){var _0x42e795={};_0x42e795[_0x1d58df[_0x0f35('0x27')]]={'$like':'%'+_0x100301[_0x0f35('0x30')][_0x0f35('0x3c')]+'%'};return _0x42e795;}})});}_0x5d93f2=_[_0x0f35('0x3d')]({},_0x5d93f2,_0x100301[_0x0f35('0x3f')]);var _0x640ce8={'where':_0x5d93f2['where']};return db['AnalyticFieldReport']['count'](_0x640ce8)[_0x0f35('0x24')](function(_0x5059af){_0x3081f8[_0x0f35('0x1c')]=_0x5059af;if(_0x100301[_0x0f35('0x30')][_0x0f35('0x40')]){_0x5d93f2[_0x0f35('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0f35('0x42')](_0x5d93f2);})[_0x0f35('0x24')](function(_0x49c115){_0x3081f8[_0x0f35('0x43')]=_0x49c115;return _0x3081f8;})[_0x0f35('0x24')](respondWithFilteredResult(_0x81ec3f,_0x5d93f2))[_0x0f35('0x44')](handleError(_0x81ec3f,null));};exports['show']=function(_0x35bf7f,_0x531dac){var _0x1eb325={'raw':![],'where':{'id':_0x35bf7f[_0x0f35('0x45')]['id']}},_0x3e880a={};_0x3e880a[_0x0f35('0x34')]=_[_0x0f35('0x46')](db[_0x0f35('0x2a')]['rawAttributes']);_0x3e880a['query']=_[_0x0f35('0x46')](_0x35bf7f[_0x0f35('0x30')]);_0x3e880a[_0x0f35('0x31')]=_['intersection'](_0x3e880a[_0x0f35('0x34')],_0x3e880a[_0x0f35('0x30')]);_0x1eb325['attributes']=_[_0x0f35('0x32')](_0x3e880a[_0x0f35('0x34')],qs[_0x0f35('0x35')](_0x35bf7f['query']['fields']));_0x1eb325[_0x0f35('0x33')]=_0x1eb325[_0x0f35('0x33')][_0x0f35('0x36')]?_0x1eb325[_0x0f35('0x33')]:_0x3e880a['model'];if(_0x35bf7f['query']['includeAll']){_0x1eb325[_0x0f35('0x41')]=[{'all':!![]}];}_0x1eb325=_[_0x0f35('0x3d')]({},_0x1eb325,_0x35bf7f[_0x0f35('0x3f')]);return db[_0x0f35('0x2a')]['find'](_0x1eb325)[_0x0f35('0x24')](handleEntityNotFound(_0x531dac,null))[_0x0f35('0x24')](respondWithResult(_0x531dac,null))[_0x0f35('0x44')](handleError(_0x531dac,null));};exports['create']=function(_0x2c18ae,_0x6eafce){return db[_0x0f35('0x2a')]['create'](_0x2c18ae['body'],{})[_0x0f35('0x24')](respondWithResult(_0x6eafce,0xc9))['catch'](handleError(_0x6eafce,null));};exports[_0x0f35('0x47')]=function(_0x1af57d,_0x28bc42){return db[_0x0f35('0x2a')]['bulkCreate'](_0x1af57d[_0x0f35('0x48')],{'raw':![],'individualHooks':!![]})[_0x0f35('0x24')](respondWithResult(_0x28bc42,0xc9))[_0x0f35('0x44')](handleError(_0x28bc42,null));};exports[_0x0f35('0x23')]=function(_0x219469,_0x4cac98){if(_0x219469[_0x0f35('0x48')]['id']){delete _0x219469[_0x0f35('0x48')]['id'];}return db[_0x0f35('0x2a')][_0x0f35('0x49')]({'where':{'id':_0x219469[_0x0f35('0x45')]['id']}})[_0x0f35('0x24')](handleEntityNotFound(_0x4cac98,null))[_0x0f35('0x24')](saveUpdates(_0x219469[_0x0f35('0x48')],null))['then'](respondWithResult(_0x4cac98,null))['catch'](handleError(_0x4cac98,null));};exports[_0x0f35('0x4a')]=function(_0xf9ad33,_0x235ce6){return db['AnalyticFieldReport']['find']({'where':{'id':_0xf9ad33[_0x0f35('0x45')]['id']}})['then'](handleEntityNotFound(_0x235ce6,null))[_0x0f35('0x24')](removeEntity(_0x235ce6,null))[_0x0f35('0x44')](handleError(_0x235ce6,null));};exports['bulkDestroy']=function(_0x5311ba,_0x28d29b){return db[_0x0f35('0x2a')]['destroy']({'where':{'id':_0x5311ba[_0x0f35('0x30')][_0x0f35('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x0f35('0x24')](respondWithResult(_0x28d29b,0xcc))[_0x0f35('0x44')](handleError(_0x28d29b,null));};exports[_0x0f35('0x4c')]=function(_0x29669a,_0x409a08,_0x281abd){return db[_0x0f35('0x4d')][_0x0f35('0x4e')]({'where':{'id':_0x29669a[_0x0f35('0x45')]['id']}})['then'](handleEntityNotFound(_0x409a08,null))[_0x0f35('0x24')](function(_0x1246cf){if(_0x1246cf){return db[_0x0f35('0x4f')]['transaction'](function(_0x1d803e){return db[_0x0f35('0x2a')][_0x0f35('0x4a')]({'where':{'CustomReportId':_0x29669a['params']['id']},'transaction':_0x1d803e})[_0x0f35('0x24')](function(_0x43e3ec){var _0x249072=_['map'](_0x29669a[_0x0f35('0x48')],function(_0x3ae1b2){delete _0x3ae1b2['id'];_0x3ae1b2['CustomReportId']=_0x29669a[_0x0f35('0x45')]['id'];return _0x3ae1b2;});return db['AnalyticFieldReport'][_0x0f35('0x47')](_0x249072,{'transaction':_0x1d803e});});})[_0x0f35('0x24')](function(){return db[_0x0f35('0x2a')][_0x0f35('0x42')]({'where':{'CustomReportId':_0x29669a[_0x0f35('0x45')]['id']}});});}})[_0x0f35('0x24')](respondWithResult(_0x409a08,null))[_0x0f35('0x44')](handleError(_0x409a08,null));};
\ No newline at end of file
+var _0xa6c5=['keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','AnalyticFieldReport','includeAll','include','rows','catch','show','merge','options','find','create','body','bulkCreate','update','params','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x37bf7b,_0x857bca){var _0x4db72f=function(_0x7e56b){while(--_0x7e56b){_0x37bf7b['push'](_0x37bf7b['shift']());}};_0x4db72f(++_0x857bca);}(_0xa6c5,0x7a));var _0x5a6c=function(_0x5bdc0f,_0xd2ca59){_0x5bdc0f=_0x5bdc0f-0x0;var _0x318e07=_0xa6c5[_0x5bdc0f];return _0x318e07;};'use strict';var emlformat=require(_0x5a6c('0x0'));var rimraf=require(_0x5a6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a6c('0x2'));var rp=require(_0x5a6c('0x3'));var moment=require(_0x5a6c('0x4'));var BPromise=require(_0x5a6c('0x5'));var Mustache=require(_0x5a6c('0x6'));var util=require(_0x5a6c('0x7'));var path=require(_0x5a6c('0x8'));var sox=require(_0x5a6c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a6c('0xa'));var _=require('lodash');var squel=require(_0x5a6c('0xb'));var crypto=require(_0x5a6c('0xc'));var jsforce=require(_0x5a6c('0xd'));var deskjs=require(_0x5a6c('0xe'));var toCsv=require(_0x5a6c('0xf'));var querystring=require(_0x5a6c('0x10'));var Papa=require(_0x5a6c('0x11'));var Redis=require('ioredis');var authService=require(_0x5a6c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5a6c('0x13'));var hardwareService=require(_0x5a6c('0x14'));var logger=require(_0x5a6c('0x15'))('api');var utils=require(_0x5a6c('0x16'));var config=require(_0x5a6c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a6c('0x18'))['db'];function respondWithStatusCode(_0x38b4bd,_0x3315c6){_0x3315c6=_0x3315c6||0xcc;return function(_0x420fe4){if(_0x420fe4){return _0x38b4bd[_0x5a6c('0x19')](_0x3315c6);}return _0x38b4bd[_0x5a6c('0x1a')](_0x3315c6)[_0x5a6c('0x1b')]();};}function respondWithResult(_0x1c7346,_0x9baab){_0x9baab=_0x9baab||0xc8;return function(_0x227a11){if(_0x227a11){return _0x1c7346[_0x5a6c('0x1a')](_0x9baab)[_0x5a6c('0x1c')](_0x227a11);}};}function respondWithFilteredResult(_0x1bc710,_0x244c30){return function(_0x1305d4){if(_0x1305d4){var _0xfbb06c=typeof _0x244c30[_0x5a6c('0x1d')]==='undefined'&&typeof _0x244c30[_0x5a6c('0x1e')]==='undefined';var _0x8231fd=_0x1305d4[_0x5a6c('0x1f')];var _0xf82d73=_0xfbb06c?0x0:_0x244c30[_0x5a6c('0x1d')];var _0xa874f1=_0xfbb06c?_0x1305d4[_0x5a6c('0x1f')]:_0x244c30['offset']+_0x244c30['limit'];var _0x29840f;if(_0xa874f1>=_0x8231fd){_0xa874f1=_0x8231fd;_0x29840f=0xc8;}else{_0x29840f=0xce;}_0x1bc710[_0x5a6c('0x1a')](_0x29840f);return _0x1bc710[_0x5a6c('0x20')]('Content-Range',_0xf82d73+'-'+_0xa874f1+'/'+_0x8231fd)[_0x5a6c('0x1c')](_0x1305d4);}return null;};}function patchUpdates(_0x2a507a){return function(_0x40cdaa){try{jsonpatch[_0x5a6c('0x21')](_0x40cdaa,_0x2a507a,!![]);}catch(_0x46d974){return BPromise[_0x5a6c('0x22')](_0x46d974);}return _0x40cdaa['save']();};}function saveUpdates(_0x2f1dba,_0x59a70b){return function(_0x2040ea){if(_0x2040ea){return _0x2040ea['update'](_0x2f1dba)[_0x5a6c('0x23')](function(_0x4c84c5){return _0x4c84c5;});}return null;};}function removeEntity(_0x387b09,_0x595d63){return function(_0x564a2f){if(_0x564a2f){return _0x564a2f[_0x5a6c('0x24')]()['then'](function(){_0x387b09[_0x5a6c('0x1a')](0xcc)[_0x5a6c('0x1b')]();});}};}function handleEntityNotFound(_0x47fa2f,_0x35613a){return function(_0x379509){if(!_0x379509){_0x47fa2f[_0x5a6c('0x19')](0x194);}return _0x379509;};}function handleError(_0x390272,_0x33229c){_0x33229c=_0x33229c||0x1f4;return function(_0xbf1520){logger[_0x5a6c('0x25')](_0xbf1520['stack']);if(_0xbf1520['name']){delete _0xbf1520[_0x5a6c('0x26')];}_0x390272[_0x5a6c('0x1a')](_0x33229c)[_0x5a6c('0x27')](_0xbf1520);};}exports[_0x5a6c('0x28')]=function(_0x1347d4,_0x142c8e){var _0x4098b8={},_0x660e34={},_0x2fdf14={'count':0x0,'rows':[]};var _0x195dae=_[_0x5a6c('0x29')](db['AnalyticFieldReport'][_0x5a6c('0x2a')],function(_0x5c931e){return{'name':_0x5c931e[_0x5a6c('0x2b')],'type':_0x5c931e[_0x5a6c('0x2c')][_0x5a6c('0x2d')]};});_0x660e34['model']=_[_0x5a6c('0x29')](_0x195dae,_0x5a6c('0x26'));_0x660e34['query']=_[_0x5a6c('0x2e')](_0x1347d4[_0x5a6c('0x2f')]);_0x660e34['filters']=_[_0x5a6c('0x30')](_0x660e34[_0x5a6c('0x31')],_0x660e34[_0x5a6c('0x2f')]);_0x4098b8[_0x5a6c('0x32')]=_[_0x5a6c('0x30')](_0x660e34[_0x5a6c('0x31')],qs[_0x5a6c('0x33')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x33')]));_0x4098b8['attributes']=_0x4098b8[_0x5a6c('0x32')][_0x5a6c('0x34')]?_0x4098b8[_0x5a6c('0x32')]:_0x660e34[_0x5a6c('0x31')];if(!_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x35')](_0x5a6c('0x36'))){_0x4098b8[_0x5a6c('0x1e')]=qs[_0x5a6c('0x1e')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x1e')]);_0x4098b8[_0x5a6c('0x1d')]=qs[_0x5a6c('0x1d')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x1d')]);}_0x4098b8[_0x5a6c('0x37')]=qs[_0x5a6c('0x38')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x38')]);_0x4098b8[_0x5a6c('0x39')]=qs['filters'](_[_0x5a6c('0x3a')](_0x1347d4['query'],_0x660e34[_0x5a6c('0x3b')]),_0x195dae);if(_0x1347d4[_0x5a6c('0x2f')]['filter']){_0x4098b8[_0x5a6c('0x39')]=_['merge'](_0x4098b8[_0x5a6c('0x39')],{'$or':_[_0x5a6c('0x29')](_0x195dae,function(_0xbebc5c){if(_0xbebc5c['type']!==_0x5a6c('0x3c')){var _0x20017b={};_0x20017b[_0xbebc5c['name']]={'$like':'%'+_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x3d')]+'%'};return _0x20017b;}})});}_0x4098b8=_['merge']({},_0x4098b8,_0x1347d4['options']);var _0x596c5a={'where':_0x4098b8[_0x5a6c('0x39')]};return db[_0x5a6c('0x3e')]['count'](_0x596c5a)[_0x5a6c('0x23')](function(_0x3e7467){_0x2fdf14[_0x5a6c('0x1f')]=_0x3e7467;if(_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x3f')]){_0x4098b8[_0x5a6c('0x40')]=[{'all':!![]}];}return db[_0x5a6c('0x3e')]['findAll'](_0x4098b8);})['then'](function(_0x1bbf3a){_0x2fdf14[_0x5a6c('0x41')]=_0x1bbf3a;return _0x2fdf14;})['then'](respondWithFilteredResult(_0x142c8e,_0x4098b8))[_0x5a6c('0x42')](handleError(_0x142c8e,null));};exports[_0x5a6c('0x43')]=function(_0xb8a6a7,_0x4334eb){var _0x4cd59a={'raw':![],'where':{'id':_0xb8a6a7['params']['id']}},_0x414bde={};_0x414bde[_0x5a6c('0x31')]=_['keys'](db[_0x5a6c('0x3e')]['rawAttributes']);_0x414bde['query']=_['keys'](_0xb8a6a7['query']);_0x414bde[_0x5a6c('0x3b')]=_[_0x5a6c('0x30')](_0x414bde['model'],_0x414bde['query']);_0x4cd59a[_0x5a6c('0x32')]=_[_0x5a6c('0x30')](_0x414bde[_0x5a6c('0x31')],qs[_0x5a6c('0x33')](_0xb8a6a7[_0x5a6c('0x2f')][_0x5a6c('0x33')]));_0x4cd59a[_0x5a6c('0x32')]=_0x4cd59a[_0x5a6c('0x32')][_0x5a6c('0x34')]?_0x4cd59a[_0x5a6c('0x32')]:_0x414bde[_0x5a6c('0x31')];if(_0xb8a6a7[_0x5a6c('0x2f')][_0x5a6c('0x3f')]){_0x4cd59a[_0x5a6c('0x40')]=[{'all':!![]}];}_0x4cd59a=_[_0x5a6c('0x44')]({},_0x4cd59a,_0xb8a6a7[_0x5a6c('0x45')]);return db[_0x5a6c('0x3e')][_0x5a6c('0x46')](_0x4cd59a)[_0x5a6c('0x23')](handleEntityNotFound(_0x4334eb,null))[_0x5a6c('0x23')](respondWithResult(_0x4334eb,null))[_0x5a6c('0x42')](handleError(_0x4334eb,null));};exports[_0x5a6c('0x47')]=function(_0x781aa2,_0x496911){return db[_0x5a6c('0x3e')][_0x5a6c('0x47')](_0x781aa2[_0x5a6c('0x48')],{})['then'](respondWithResult(_0x496911,0xc9))['catch'](handleError(_0x496911,null));};exports[_0x5a6c('0x49')]=function(_0x44d64a,_0x3d0ccc){return db[_0x5a6c('0x3e')]['bulkCreate'](_0x44d64a[_0x5a6c('0x48')],{'raw':![],'individualHooks':!![]})[_0x5a6c('0x23')](respondWithResult(_0x3d0ccc,0xc9))[_0x5a6c('0x42')](handleError(_0x3d0ccc,null));};exports[_0x5a6c('0x4a')]=function(_0x18fe25,_0x320eb4){if(_0x18fe25[_0x5a6c('0x48')]['id']){delete _0x18fe25['body']['id'];}return db[_0x5a6c('0x3e')][_0x5a6c('0x46')]({'where':{'id':_0x18fe25[_0x5a6c('0x4b')]['id']}})[_0x5a6c('0x23')](handleEntityNotFound(_0x320eb4,null))[_0x5a6c('0x23')](saveUpdates(_0x18fe25[_0x5a6c('0x48')],null))[_0x5a6c('0x23')](respondWithResult(_0x320eb4,null))['catch'](handleError(_0x320eb4,null));};exports[_0x5a6c('0x24')]=function(_0x48054e,_0x50e6ad){return db[_0x5a6c('0x3e')]['find']({'where':{'id':_0x48054e['params']['id']}})[_0x5a6c('0x23')](handleEntityNotFound(_0x50e6ad,null))[_0x5a6c('0x23')](removeEntity(_0x50e6ad,null))[_0x5a6c('0x42')](handleError(_0x50e6ad,null));};exports[_0x5a6c('0x4c')]=function(_0x1ef635,_0xc652d8){return db['AnalyticFieldReport'][_0x5a6c('0x24')]({'where':{'id':_0x1ef635[_0x5a6c('0x2f')][_0x5a6c('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x5a6c('0x23')](respondWithResult(_0xc652d8,0xcc))['catch'](handleError(_0xc652d8,null));};exports[_0x5a6c('0x4e')]=function(_0x5eb248,_0x9fffce,_0xbb9f41){return db['AnalyticCustomReport'][_0x5a6c('0x4f')]({'where':{'id':_0x5eb248[_0x5a6c('0x4b')]['id']}})[_0x5a6c('0x23')](handleEntityNotFound(_0x9fffce,null))[_0x5a6c('0x23')](function(_0x1e5965){if(_0x1e5965){return db[_0x5a6c('0x50')][_0x5a6c('0x51')](function(_0x1c1cf4){return db[_0x5a6c('0x3e')][_0x5a6c('0x24')]({'where':{'CustomReportId':_0x5eb248[_0x5a6c('0x4b')]['id']},'transaction':_0x1c1cf4})[_0x5a6c('0x23')](function(_0x1355b4){var _0x3234bb=_[_0x5a6c('0x29')](_0x5eb248[_0x5a6c('0x48')],function(_0x2af1a1){delete _0x2af1a1['id'];_0x2af1a1[_0x5a6c('0x52')]=_0x5eb248[_0x5a6c('0x4b')]['id'];return _0x2af1a1;});return db[_0x5a6c('0x3e')][_0x5a6c('0x49')](_0x3234bb,{'transaction':_0x1c1cf4});});})[_0x5a6c('0x23')](function(){return db['AnalyticFieldReport'][_0x5a6c('0x53')]({'where':{'CustomReportId':_0x5eb248[_0x5a6c('0x4b')]['id']}});});}})[_0x5a6c('0x23')](respondWithResult(_0x9fffce,null))[_0x5a6c('0x42')](handleError(_0x9fffce,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 2265a9f..167ec6f 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 _0xbdc1=['path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment'];(function(_0x258b00,_0x28e9b0){var _0x3ca676=function(_0xff2a4e){while(--_0xff2a4e){_0x258b00['push'](_0x258b00['shift']());}};_0x3ca676(++_0x28e9b0);}(_0xbdc1,0x13d));var _0x1bdc=function(_0x37745c,_0x4d4e32){_0x37745c=_0x37745c-0x0;var _0x508313=_0xbdc1[_0x37745c];return _0x508313;};'use strict';var _=require('lodash');var util=require(_0x1bdc('0x0'));var logger=require(_0x1bdc('0x1'))('api');var moment=require(_0x1bdc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bdc('0x3'));var rimraf=require(_0x1bdc('0x4'));var config=require('../../config/environment');var attributes=require(_0x1bdc('0x5'));module[_0x1bdc('0x6')]=function(_0x1f4aaf,_0x17160a){return _0x1f4aaf[_0x1bdc('0x7')](_0x1bdc('0x8'),attributes,{'tableName':_0x1bdc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe935=['./analyticFieldReport.attributes','exports','define','analytics_report_fields','util','moment','bluebird','path'];(function(_0x12e52b,_0x9fc7e7){var _0x414019=function(_0x388ecd){while(--_0x388ecd){_0x12e52b['push'](_0x12e52b['shift']());}};_0x414019(++_0x9fc7e7);}(_0xe935,0x1ec));var _0x5e93=function(_0x32b817,_0x31ebbe){_0x32b817=_0x32b817-0x0;var _0x3b624a=_0xe935[_0x32b817];return _0x3b624a;};'use strict';var _=require('lodash');var util=require(_0x5e93('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5e93('0x1'));var BPromise=require(_0x5e93('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e93('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5e93('0x4'));module[_0x5e93('0x5')]=function(_0x17ac6a,_0x37f60c){return _0x17ac6a[_0x5e93('0x6')]('AnalyticFieldReport',attributes,{'tableName':_0x5e93('0x7'),'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 b4bd38e..0d6bb45 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 _0x791a=['then','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x1b5f76,_0x3943e2){var _0x167979=function(_0xa7c0d3){while(--_0xa7c0d3){_0x1b5f76['push'](_0x1b5f76['shift']());}};_0x167979(++_0x3943e2);}(_0x791a,0xc8));var _0xa791=function(_0x4ddc7a,_0x2ba072){_0x4ddc7a=_0x4ddc7a-0x0;var _0x4ba854=_0x791a[_0x4ddc7a];return _0x4ba854;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa791('0x0'));var BPromise=require(_0xa791('0x1'));var rs=require(_0xa791('0x2'));var fs=require('fs');var Redis=require(_0xa791('0x3'));var db=require(_0xa791('0x4'))['db'];var utils=require(_0xa791('0x5'));var logger=require(_0xa791('0x6'))(_0xa791('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa791('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x501933,_0x2b0882,_0x5182ec){return new BPromise(function(_0x5ab75d,_0x14a216){return client[_0xa791('0x9')](_0x501933,_0x5182ec)[_0xa791('0xa')](function(_0x332aae){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b0882,_0xa791('0xb'));logger[_0xa791('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2b0882,_0xa791('0xb'),JSON[_0xa791('0xd')](_0x332aae));if(_0x332aae[_0xa791('0xe')]){if(_0x332aae[_0xa791('0xe')][_0xa791('0xf')]===0x1f4){logger[_0xa791('0xe')](_0xa791('0x10'),_0x2b0882,_0x332aae['error'][_0xa791('0x11')]);return _0x14a216(_0x332aae[_0xa791('0xe')]['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b0882,_0x332aae[_0xa791('0xe')][_0xa791('0x11')]);return _0x5ab75d(_0x332aae['error'][_0xa791('0x11')]);}else{logger[_0xa791('0x12')](_0xa791('0x10'),_0x2b0882,'request\x20sent');_0x5ab75d(_0x332aae[_0xa791('0x13')][_0xa791('0x11')]);}})[_0xa791('0x14')](function(_0x5ba565){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b0882,_0x5ba565);_0x14a216(_0x5ba565);});});}
\ No newline at end of file
+var _0x8db1=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x63fe28,_0x15c142){var _0x555070=function(_0x415f8e){while(--_0x415f8e){_0x63fe28['push'](_0x63fe28['shift']());}};_0x555070(++_0x15c142);}(_0x8db1,0x122));var _0x18db=function(_0x1f3681,_0x43cf48){_0x1f3681=_0x1f3681-0x0;var _0x4911fd=_0x8db1[_0x1f3681];return _0x4911fd;};'use strict';var _=require(_0x18db('0x0'));var util=require(_0x18db('0x1'));var moment=require(_0x18db('0x2'));var BPromise=require(_0x18db('0x3'));var rs=require(_0x18db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18db('0x5'))['db'];var utils=require(_0x18db('0x6'));var logger=require(_0x18db('0x7'))('rpc');var config=require(_0x18db('0x8'));var jayson=require(_0x18db('0x9'));var client=jayson['client'][_0x18db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f433e,_0x279074,_0xd25524){return new BPromise(function(_0x2aca61,_0x2f9821){return client[_0x18db('0xb')](_0x5f433e,_0xd25524)[_0x18db('0xc')](function(_0x1d9117){logger[_0x18db('0xd')](_0x18db('0xe'),_0x279074,_0x18db('0xf'));logger['debug'](_0x18db('0x10'),_0x279074,'request\x20sent',JSON[_0x18db('0x11')](_0x1d9117));if(_0x1d9117[_0x18db('0x12')]){if(_0x1d9117['error'][_0x18db('0x13')]===0x1f4){logger[_0x18db('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x279074,_0x1d9117[_0x18db('0x12')][_0x18db('0x14')]);return _0x2f9821(_0x1d9117[_0x18db('0x12')][_0x18db('0x14')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x279074,_0x1d9117[_0x18db('0x12')][_0x18db('0x14')]);return _0x2aca61(_0x1d9117[_0x18db('0x12')][_0x18db('0x14')]);}else{logger[_0x18db('0xd')](_0x18db('0xe'),_0x279074,_0x18db('0xf'));_0x2aca61(_0x1d9117['result'][_0x18db('0x14')]);}})[_0x18db('0x15')](function(_0x2bfabe){logger[_0x18db('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x279074,_0x2bfabe);_0x2f9821(_0x2bfabe);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index aa54cbf..7e3df2f 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(_0x114bb6,_0x196e2f){var _0x2696f7=function(_0x755373){while(--_0x755373){_0x114bb6['push'](_0x114bb6['shift']());}};_0x2696f7(++_0x196e2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0xfdc000,_0x678841){var _0x15a615=function(_0x4a49c7){while(--_0x4a49c7){_0xfdc000['push'](_0xfdc000['shift']());}};_0x15a615(++_0x678841);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 998f167..82a9375 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 _0x85cf=['name','TEXT','exports','STRING'];(function(_0x4e7a7b,_0x2b2e3d){var _0x3488d3=function(_0x584c30){while(--_0x584c30){_0x4e7a7b['push'](_0x4e7a7b['shift']());}};_0x3488d3(++_0x2b2e3d);}(_0x85cf,0x76));var _0xf85c=function(_0x193685,_0x5f134a){_0x193685=_0x193685-0x0;var _0x4ae8f8=_0x85cf[_0x193685];return _0x4ae8f8;};'use strict';var Sequelize=require('sequelize');module[_0xf85c('0x0')]={'name':{'type':Sequelize[_0xf85c('0x1')],'allowNull':![],'unique':_0xf85c('0x2')},'table':{'type':Sequelize[_0xf85c('0x1')]},'metric':{'type':Sequelize[_0xf85c('0x3')]},'description':{'type':Sequelize[_0xf85c('0x1')]}};
\ No newline at end of file
+var _0x9086=['STRING','TEXT','sequelize','exports','name'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9086,0x10b));var _0x6908=function(_0x5b51d2,_0xd3846c){_0x5b51d2=_0x5b51d2-0x0;var _0x1ecc32=_0x9086[_0x5b51d2];return _0x1ecc32;};'use strict';var Sequelize=require(_0x6908('0x0'));module[_0x6908('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6908('0x2')},'table':{'type':Sequelize[_0x6908('0x3')]},'metric':{'type':Sequelize[_0x6908('0x4')]},'description':{'type':Sequelize[_0x6908('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 8a48c4d..898b1ce 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 _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x16effd,_0x4e6f8c){var _0x36b4c3=function(_0xef9c56){while(--_0xef9c56){_0x16effd['push'](_0x16effd['shift']());}};_0x36b4c3(++_0x4e6f8c);}(_0x98a8,0x12c));var _0x898a=function(_0xfb77d,_0x4d0694){_0xfb77d=_0xfb77d-0x0;var _0x1d1296=_0x98a8[_0xfb77d];return _0x1d1296;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
+var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1e1f74,_0x190226){var _0x54139e=function(_0x19bea8){while(--_0x19bea8){_0x1e1f74['push'](_0x1e1f74['shift']());}};_0x54139e(++_0x190226);}(_0x55ca,0x126));var _0xa55c=function(_0x17cb63,_0x4c0e90){_0x17cb63=_0x17cb63-0x0;var _0x4340bc=_0x55ca[_0x17cb63];return _0x4340bc;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 533345e..37f88d9 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 _0x8ad5=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8ad5,0xf1));var _0x58ad=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8ad5[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var logger=require(_0x58ad('0x2'))(_0x58ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58ad('0x4'));var fs=require('fs');var path=require(_0x58ad('0x5'));var rimraf=require(_0x58ad('0x6'));var config=require(_0x58ad('0x7'));var attributes=require(_0x58ad('0x8'));module[_0x58ad('0x9')]=function(_0x51d560,_0x5888f7){return _0x51d560[_0x58ad('0xa')](_0x58ad('0xb'),attributes,{'tableName':_0x58ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2f5=['../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x54da67,_0x283c96){var _0x3aed24=function(_0x52a97f){while(--_0x52a97f){_0x54da67['push'](_0x54da67['shift']());}};_0x3aed24(++_0x283c96);}(_0xd2f5,0x144));var _0x5d2f=function(_0x236aff,_0x3ba6cb){_0x236aff=_0x236aff-0x0;var _0xb7459a=_0xd2f5[_0x236aff];return _0xb7459a;};'use strict';var _=require(_0x5d2f('0x0'));var util=require('util');var logger=require(_0x5d2f('0x1'))('api');var moment=require(_0x5d2f('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d2f('0x3'));var fs=require('fs');var path=require(_0x5d2f('0x4'));var rimraf=require(_0x5d2f('0x5'));var config=require(_0x5d2f('0x6'));var attributes=require(_0x5d2f('0x7'));module[_0x5d2f('0x8')]=function(_0x2392df,_0x16e9fa){return _0x2392df['define'](_0x5d2f('0x9'),attributes,{'tableName':_0x5d2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 2d04b61..3c14241 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 _0xdd7e=['error','AnalyticMetric,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x381375,_0x1557df){var _0x2cfe1c=function(_0x2a2281){while(--_0x2a2281){_0x381375['push'](_0x381375['shift']());}};_0x2cfe1c(++_0x1557df);}(_0xdd7e,0x17d));var _0xedd7=function(_0x6fea4a,_0x20fa86){_0x6fea4a=_0x6fea4a-0x0;var _0x138fe3=_0xdd7e[_0x6fea4a];return _0x138fe3;};'use strict';var _=require(_0xedd7('0x0'));var util=require(_0xedd7('0x1'));var moment=require(_0xedd7('0x2'));var BPromise=require('bluebird');var rs=require(_0xedd7('0x3'));var fs=require('fs');var Redis=require(_0xedd7('0x4'));var db=require(_0xedd7('0x5'))['db'];var utils=require(_0xedd7('0x6'));var logger=require(_0xedd7('0x7'))(_0xedd7('0x8'));var config=require(_0xedd7('0x9'));var jayson=require(_0xedd7('0xa'));var client=jayson[_0xedd7('0xb')][_0xedd7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x178df4,_0x59d1cc,_0x1441be){return new BPromise(function(_0x2c0fb1,_0x4fa5b3){return client[_0xedd7('0xd')](_0x178df4,_0x1441be)[_0xedd7('0xe')](function(_0x54ed2b){logger[_0xedd7('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x59d1cc,'request\x20sent');logger[_0xedd7('0x10')](_0xedd7('0x11'),_0x59d1cc,'request\x20sent',JSON[_0xedd7('0x12')](_0x54ed2b));if(_0x54ed2b[_0xedd7('0x13')]){if(_0x54ed2b[_0xedd7('0x13')]['code']===0x1f4){logger[_0xedd7('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x59d1cc,_0x54ed2b[_0xedd7('0x13')]['message']);return _0x4fa5b3(_0x54ed2b[_0xedd7('0x13')]['message']);}logger['error'](_0xedd7('0x14'),_0x59d1cc,_0x54ed2b[_0xedd7('0x13')][_0xedd7('0x15')]);return _0x2c0fb1(_0x54ed2b[_0xedd7('0x13')]['message']);}else{logger[_0xedd7('0xf')](_0xedd7('0x14'),_0x59d1cc,_0xedd7('0x16'));_0x2c0fb1(_0x54ed2b[_0xedd7('0x17')][_0xedd7('0x15')]);}})[_0xedd7('0x18')](function(_0xdc598d){logger['error'](_0xedd7('0x14'),_0x59d1cc,_0xdc598d);_0x4fa5b3(_0xdc598d);});});}
\ No newline at end of file
+var _0xd8ec=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x552cf8,_0x493a58){var _0x5b0eca=function(_0xbc6b6d){while(--_0xbc6b6d){_0x552cf8['push'](_0x552cf8['shift']());}};_0x5b0eca(++_0x493a58);}(_0xd8ec,0xe9));var _0xcd8e=function(_0x1aa59b,_0x26612c){_0x1aa59b=_0x1aa59b-0x0;var _0x33011c=_0xd8ec[_0x1aa59b];return _0x33011c;};'use strict';var _=require(_0xcd8e('0x0'));var util=require('util');var moment=require(_0xcd8e('0x1'));var BPromise=require(_0xcd8e('0x2'));var rs=require(_0xcd8e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd8e('0x4'))['db'];var utils=require(_0xcd8e('0x5'));var logger=require(_0xcd8e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcd8e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x58f571,_0x3202bc,_0x355a9e){return new BPromise(function(_0x2d0c66,_0x237bbf){return client[_0xcd8e('0x8')](_0x58f571,_0x355a9e)[_0xcd8e('0x9')](function(_0x57632e){logger[_0xcd8e('0xa')](_0xcd8e('0xb'),_0x3202bc,_0xcd8e('0xc'));logger[_0xcd8e('0xd')](_0xcd8e('0xe'),_0x3202bc,_0xcd8e('0xc'),JSON[_0xcd8e('0xf')](_0x57632e));if(_0x57632e[_0xcd8e('0x10')]){if(_0x57632e[_0xcd8e('0x10')][_0xcd8e('0x11')]===0x1f4){logger[_0xcd8e('0x10')](_0xcd8e('0xb'),_0x3202bc,_0x57632e[_0xcd8e('0x10')]['message']);return _0x237bbf(_0x57632e[_0xcd8e('0x10')][_0xcd8e('0x12')]);}logger[_0xcd8e('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x3202bc,_0x57632e[_0xcd8e('0x10')][_0xcd8e('0x12')]);return _0x2d0c66(_0x57632e['error']['message']);}else{logger['info'](_0xcd8e('0xb'),_0x3202bc,'request\x20sent');_0x2d0c66(_0x57632e[_0xcd8e('0x13')][_0xcd8e('0x12')]);}})[_0xcd8e('0x14')](function(_0xacf780){logger[_0xcd8e('0x10')](_0xcd8e('0xb'),_0x3202bc,_0xacf780);_0x237bbf(_0xacf780);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 07510a4..ac38e59 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 _0x5447=['/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x54917,_0x50f577){var _0x52f18a=function(_0x382f0c){while(--_0x382f0c){_0x54917['push'](_0x54917['shift']());}};_0x52f18a(++_0x50f577);}(_0x5447,0xf1));var _0x7544=function(_0x4ddacb,_0x780c1c){_0x4ddacb=_0x4ddacb-0x0;var _0xaa8333=_0x5447[_0x4ddacb];return _0xaa8333;};'use strict';var multer=require(_0x7544('0x0'));var util=require('util');var path=require(_0x7544('0x1'));var timeout=require(_0x7544('0x2'));var express=require('express');var router=express[_0x7544('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7544('0x4'));var interaction=require(_0x7544('0x5'));var config=require(_0x7544('0x6'));var controller=require(_0x7544('0x7'));router[_0x7544('0x8')]('/',auth[_0x7544('0x9')](),controller[_0x7544('0xa')]);router[_0x7544('0x8')](_0x7544('0xb'),auth[_0x7544('0x9')](),controller[_0x7544('0xc')]);router['post']('/',auth[_0x7544('0x9')](),controller[_0x7544('0xd')]);router[_0x7544('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7544('0xf')](_0x7544('0xb'),auth[_0x7544('0x9')](),controller[_0x7544('0x10')]);module[_0x7544('0x11')]=router;
\ No newline at end of file
+var _0x0f4d=['./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2233eb,_0x25615a){var _0x4d3d6a=function(_0x5bb90e){while(--_0x5bb90e){_0x2233eb['push'](_0x2233eb['shift']());}};_0x4d3d6a(++_0x25615a);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x20fdad,_0x1c32de){_0x20fdad=_0x20fdad-0x0;var _0x3233ff=_0x0f4d[_0x20fdad];return _0x3233ff;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0f4('0x0'));var express=require('express');var router=express[_0xd0f4('0x1')]();var fs_extra=require(_0xd0f4('0x2'));var auth=require(_0xd0f4('0x3'));var interaction=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var controller=require(_0xd0f4('0x6'));router[_0xd0f4('0x7')]('/',auth[_0xd0f4('0x8')](),controller['index']);router[_0xd0f4('0x7')](_0xd0f4('0x9'),auth['isAuthenticated'](),controller[_0xd0f4('0xa')]);router[_0xd0f4('0xb')]('/',auth['isAuthenticated'](),controller[_0xd0f4('0xc')]);router[_0xd0f4('0xd')]('/:id',auth[_0xd0f4('0x8')](),controller[_0xd0f4('0xe')]);router[_0xd0f4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd0f4('0x10')]);module[_0xd0f4('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 80b40c6..ead6a20 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 _0xa65e=['TEXT','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa65e,0xd1));var _0xea65=function(_0x46d14b,_0x147907){_0x46d14b=_0x46d14b-0x0;var _0x367dfd=_0xa65e[_0x46d14b];return _0x367dfd;};'use strict';var Sequelize=require('sequelize');module[_0xea65('0x0')]={'tree':{'type':Sequelize[_0xea65('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x64de=['sequelize'];(function(_0x2c32de,_0x316008){var _0x1b7a6d=function(_0x5d63f9){while(--_0x5d63f9){_0x2c32de['push'](_0x2c32de['shift']());}};_0x1b7a6d(++_0x316008);}(_0x64de,0x10f));var _0xe64d=function(_0x11b6b8,_0x276037){_0x11b6b8=_0x11b6b8-0x0;var _0x27a952=_0x64de[_0x11b6b8];return _0x27a952;};'use strict';var Sequelize=require(_0xe64d('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 053b30c..cb5abee 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 _0xa818=['error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','end'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0xa818,0x1d1));var _0x8a81=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xa818[_0x3e2fcf];return _0x497db7;};'use strict';var emlformat=require(_0x8a81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a81('0x1'));var jsonpatch=require(_0x8a81('0x2'));var rp=require(_0x8a81('0x3'));var moment=require(_0x8a81('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8a81('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8a81('0x6'));var ejs=require(_0x8a81('0x7'));var fs=require('fs');var fs_extra=require(_0x8a81('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a81('0x9'));var deskjs=require(_0x8a81('0xa'));var toCsv=require(_0x8a81('0x6'));var querystring=require(_0x8a81('0xb'));var Papa=require(_0x8a81('0xc'));var Redis=require('ioredis');var authService=require(_0x8a81('0xd'));var qs=require(_0x8a81('0xe'));var as=require(_0x8a81('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a81('0x10'))(_0x8a81('0x11'));var utils=require('../../config/utils');var config=require(_0x8a81('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x153d0c,_0x1598a8){_0x1598a8=_0x1598a8||0xcc;return function(_0x4fd8e7){if(_0x4fd8e7){return _0x153d0c[_0x8a81('0x13')](_0x1598a8);}return _0x153d0c[_0x8a81('0x14')](_0x1598a8)['end']();};}function respondWithResult(_0xfaa27e,_0x5087e8){_0x5087e8=_0x5087e8||0xc8;return function(_0x490a6e){if(_0x490a6e){return _0xfaa27e[_0x8a81('0x14')](_0x5087e8)[_0x8a81('0x15')](_0x490a6e);}};}function respondWithFilteredResult(_0x10591e,_0x56697d){return function(_0x1b3e11){if(_0x1b3e11){var _0x47eebe=typeof _0x56697d[_0x8a81('0x16')]==='undefined'&&typeof _0x56697d[_0x8a81('0x17')]==='undefined';var _0x35ad54=_0x1b3e11[_0x8a81('0x18')];var _0x3420e9=_0x47eebe?0x0:_0x56697d['offset'];var _0x417aa4=_0x47eebe?_0x1b3e11[_0x8a81('0x18')]:_0x56697d[_0x8a81('0x16')]+_0x56697d['limit'];var _0x5eda26;if(_0x417aa4>=_0x35ad54){_0x417aa4=_0x35ad54;_0x5eda26=0xc8;}else{_0x5eda26=0xce;}_0x10591e['status'](_0x5eda26);return _0x10591e[_0x8a81('0x19')](_0x8a81('0x1a'),_0x3420e9+'-'+_0x417aa4+'/'+_0x35ad54)[_0x8a81('0x15')](_0x1b3e11);}return null;};}function patchUpdates(_0x345148){return function(_0x3be610){try{jsonpatch['apply'](_0x3be610,_0x345148,!![]);}catch(_0x2aff7b){return BPromise[_0x8a81('0x1b')](_0x2aff7b);}return _0x3be610[_0x8a81('0x1c')]();};}function saveUpdates(_0x1def2a,_0x38e2b5){return function(_0x1569b2){if(_0x1569b2){return _0x1569b2[_0x8a81('0x1d')](_0x1def2a)[_0x8a81('0x1e')](function(_0x46cb3a){return _0x46cb3a;});}return null;};}function removeEntity(_0x5a1e61,_0x2515f4){return function(_0xf7bc7c){if(_0xf7bc7c){return _0xf7bc7c['destroy']()[_0x8a81('0x1e')](function(){_0x5a1e61[_0x8a81('0x14')](0xcc)[_0x8a81('0x1f')]();});}};}function handleEntityNotFound(_0x1568dc,_0x2cd7f7){return function(_0x38e801){if(!_0x38e801){_0x1568dc[_0x8a81('0x13')](0x194);}return _0x38e801;};}function handleError(_0xbc6979,_0x3255cc){_0x3255cc=_0x3255cc||0x1f4;return function(_0x17b2d0){logger[_0x8a81('0x20')](_0x17b2d0[_0x8a81('0x21')]);if(_0x17b2d0[_0x8a81('0x22')]){delete _0x17b2d0[_0x8a81('0x22')];}_0xbc6979[_0x8a81('0x14')](_0x3255cc)[_0x8a81('0x23')](_0x17b2d0);};}exports[_0x8a81('0x24')]=function(_0x18ee84,_0x1112a5){var _0x56c0bb={},_0x59aee5={},_0x134f45={'count':0x0,'rows':[]};var _0x2199da=_[_0x8a81('0x25')](db[_0x8a81('0x26')]['rawAttributes'],function(_0x4d72aa){return{'name':_0x4d72aa[_0x8a81('0x27')],'type':_0x4d72aa[_0x8a81('0x28')][_0x8a81('0x29')]};});_0x59aee5[_0x8a81('0x2a')]=_[_0x8a81('0x25')](_0x2199da,'name');_0x59aee5[_0x8a81('0x2b')]=_['keys'](_0x18ee84[_0x8a81('0x2b')]);_0x59aee5[_0x8a81('0x2c')]=_[_0x8a81('0x2d')](_0x59aee5['model'],_0x59aee5[_0x8a81('0x2b')]);_0x56c0bb['attributes']=_[_0x8a81('0x2d')](_0x59aee5[_0x8a81('0x2a')],qs['fields'](_0x18ee84[_0x8a81('0x2b')][_0x8a81('0x2e')]));_0x56c0bb[_0x8a81('0x2f')]=_0x56c0bb['attributes'][_0x8a81('0x30')]?_0x56c0bb['attributes']:_0x59aee5[_0x8a81('0x2a')];if(!_0x18ee84['query']['hasOwnProperty'](_0x8a81('0x31'))){_0x56c0bb['limit']=qs[_0x8a81('0x17')](_0x18ee84[_0x8a81('0x2b')][_0x8a81('0x17')]);_0x56c0bb['offset']=qs['offset'](_0x18ee84['query'][_0x8a81('0x16')]);}_0x56c0bb[_0x8a81('0x32')]=qs[_0x8a81('0x33')](_0x18ee84['query']['sort']);_0x56c0bb['where']=qs[_0x8a81('0x2c')](_[_0x8a81('0x34')](_0x18ee84[_0x8a81('0x2b')],_0x59aee5[_0x8a81('0x2c')]),_0x2199da);if(_0x18ee84['query'][_0x8a81('0x35')]){_0x56c0bb['where']=_[_0x8a81('0x36')](_0x56c0bb[_0x8a81('0x37')],{'$or':_['map'](_0x2199da,function(_0xbedea1){if(_0xbedea1[_0x8a81('0x28')]!==_0x8a81('0x38')){var _0x5644fa={};_0x5644fa[_0xbedea1[_0x8a81('0x22')]]={'$like':'%'+_0x18ee84['query']['filter']+'%'};return _0x5644fa;}})});}_0x56c0bb=_['merge']({},_0x56c0bb,_0x18ee84[_0x8a81('0x39')]);var _0x1b468e={'where':_0x56c0bb['where']};return db[_0x8a81('0x26')]['count'](_0x1b468e)[_0x8a81('0x1e')](function(_0x1bef5d){_0x134f45[_0x8a81('0x18')]=_0x1bef5d;if(_0x18ee84[_0x8a81('0x2b')][_0x8a81('0x3a')]){_0x56c0bb[_0x8a81('0x3b')]=[{'all':!![]}];}return db[_0x8a81('0x26')][_0x8a81('0x3c')](_0x56c0bb);})['then'](function(_0x2b0cb0){_0x134f45[_0x8a81('0x3d')]=_0x2b0cb0;return _0x134f45;})[_0x8a81('0x1e')](respondWithFilteredResult(_0x1112a5,_0x56c0bb))[_0x8a81('0x3e')](handleError(_0x1112a5,null));};exports[_0x8a81('0x3f')]=function(_0x3a7889,_0x5beb19){var _0x3648a8={'raw':!![],'where':{'id':_0x3a7889[_0x8a81('0x40')]['id']}},_0xda607={};_0xda607['model']=_[_0x8a81('0x41')](db[_0x8a81('0x26')][_0x8a81('0x42')]);_0xda607[_0x8a81('0x2b')]=_[_0x8a81('0x41')](_0x3a7889[_0x8a81('0x2b')]);_0xda607[_0x8a81('0x2c')]=_[_0x8a81('0x2d')](_0xda607[_0x8a81('0x2a')],_0xda607[_0x8a81('0x2b')]);_0x3648a8[_0x8a81('0x2f')]=_[_0x8a81('0x2d')](_0xda607['model'],qs[_0x8a81('0x2e')](_0x3a7889['query'][_0x8a81('0x2e')]));_0x3648a8[_0x8a81('0x2f')]=_0x3648a8[_0x8a81('0x2f')][_0x8a81('0x30')]?_0x3648a8[_0x8a81('0x2f')]:_0xda607[_0x8a81('0x2a')];if(_0x3a7889[_0x8a81('0x2b')]['includeAll']){_0x3648a8[_0x8a81('0x3b')]=[{'all':!![]}];}_0x3648a8=_['merge']({},_0x3648a8,_0x3a7889[_0x8a81('0x39')]);return db[_0x8a81('0x26')][_0x8a81('0x43')](_0x3648a8)[_0x8a81('0x1e')](handleEntityNotFound(_0x5beb19,null))['then'](respondWithResult(_0x5beb19,null))[_0x8a81('0x3e')](handleError(_0x5beb19,null));};exports[_0x8a81('0x44')]=function(_0x438e96,_0x20004e){return db[_0x8a81('0x26')][_0x8a81('0x44')](_0x438e96['body'],{})[_0x8a81('0x1e')](respondWithResult(_0x20004e,0xc9))[_0x8a81('0x3e')](handleError(_0x20004e,null));};exports[_0x8a81('0x1d')]=function(_0x2eefd0,_0x597256){if(_0x2eefd0['body']['id']){delete _0x2eefd0[_0x8a81('0x45')]['id'];}return db[_0x8a81('0x26')][_0x8a81('0x43')]({'where':{'id':_0x2eefd0['params']['id']}})[_0x8a81('0x1e')](handleEntityNotFound(_0x597256,null))[_0x8a81('0x1e')](saveUpdates(_0x2eefd0[_0x8a81('0x45')],null))[_0x8a81('0x1e')](respondWithResult(_0x597256,null))[_0x8a81('0x3e')](handleError(_0x597256,null));};exports[_0x8a81('0x46')]=function(_0x256f69,_0xdbd13c){return db['AnalyticTreeReport'][_0x8a81('0x43')]({'where':{'id':_0x256f69[_0x8a81('0x40')]['id']}})[_0x8a81('0x1e')](handleEntityNotFound(_0xdbd13c,null))['then'](removeEntity(_0xdbd13c,null))[_0x8a81('0x3e')](handleError(_0xdbd13c,null));};
\ No newline at end of file
+var _0x3797=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','update','then','error','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0x3797,0x7c));var _0x7379=function(_0x4a7a41,_0x48821c){_0x4a7a41=_0x4a7a41-0x0;var _0x356dfa=_0x3797[_0x4a7a41];return _0x356dfa;};'use strict';var emlformat=require(_0x7379('0x0'));var rimraf=require(_0x7379('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7379('0x2'));var rp=require(_0x7379('0x3'));var moment=require(_0x7379('0x4'));var BPromise=require(_0x7379('0x5'));var Mustache=require(_0x7379('0x6'));var util=require(_0x7379('0x7'));var path=require(_0x7379('0x8'));var sox=require(_0x7379('0x9'));var csv=require(_0x7379('0xa'));var ejs=require(_0x7379('0xb'));var fs=require('fs');var fs_extra=require(_0x7379('0xc'));var _=require('lodash');var squel=require(_0x7379('0xd'));var crypto=require(_0x7379('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7379('0xf'));var toCsv=require(_0x7379('0xa'));var querystring=require(_0x7379('0x10'));var Papa=require(_0x7379('0x11'));var Redis=require(_0x7379('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7379('0x13'));var hardwareService=require(_0x7379('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7379('0x15'));var config=require(_0x7379('0x16'));var licenseUtil=require(_0x7379('0x17'));var db=require(_0x7379('0x18'))['db'];function respondWithStatusCode(_0x2cf0a4,_0xe92620){_0xe92620=_0xe92620||0xcc;return function(_0x1c4223){if(_0x1c4223){return _0x2cf0a4[_0x7379('0x19')](_0xe92620);}return _0x2cf0a4[_0x7379('0x1a')](_0xe92620)[_0x7379('0x1b')]();};}function respondWithResult(_0x47b43f,_0xb378c4){_0xb378c4=_0xb378c4||0xc8;return function(_0x223c06){if(_0x223c06){return _0x47b43f[_0x7379('0x1a')](_0xb378c4)[_0x7379('0x1c')](_0x223c06);}};}function respondWithFilteredResult(_0x1c4676,_0x339533){return function(_0x24eff1){if(_0x24eff1){var _0x5299bf=typeof _0x339533['offset']==='undefined'&&typeof _0x339533[_0x7379('0x1d')]===_0x7379('0x1e');var _0x9f1756=_0x24eff1[_0x7379('0x1f')];var _0x532a47=_0x5299bf?0x0:_0x339533['offset'];var _0x2d372c=_0x5299bf?_0x24eff1[_0x7379('0x1f')]:_0x339533['offset']+_0x339533[_0x7379('0x1d')];var _0x71e53f;if(_0x2d372c>=_0x9f1756){_0x2d372c=_0x9f1756;_0x71e53f=0xc8;}else{_0x71e53f=0xce;}_0x1c4676[_0x7379('0x1a')](_0x71e53f);return _0x1c4676['set'](_0x7379('0x20'),_0x532a47+'-'+_0x2d372c+'/'+_0x9f1756)['json'](_0x24eff1);}return null;};}function patchUpdates(_0xb5a555){return function(_0x3303a3){try{jsonpatch[_0x7379('0x21')](_0x3303a3,_0xb5a555,!![]);}catch(_0x339790){return BPromise[_0x7379('0x22')](_0x339790);}return _0x3303a3['save']();};}function saveUpdates(_0x46d429,_0x12f9c4){return function(_0x1a59e8){if(_0x1a59e8){return _0x1a59e8[_0x7379('0x23')](_0x46d429)[_0x7379('0x24')](function(_0x508517){return _0x508517;});}return null;};}function removeEntity(_0x3db25e,_0x46b607){return function(_0x240569){if(_0x240569){return _0x240569['destroy']()['then'](function(){_0x3db25e[_0x7379('0x1a')](0xcc)[_0x7379('0x1b')]();});}};}function handleEntityNotFound(_0x14811b,_0x33a2f3){return function(_0x1cde16){if(!_0x1cde16){_0x14811b[_0x7379('0x19')](0x194);}return _0x1cde16;};}function handleError(_0x24e428,_0xdcf699){_0xdcf699=_0xdcf699||0x1f4;return function(_0xe50644){logger[_0x7379('0x25')](_0xe50644['stack']);if(_0xe50644[_0x7379('0x26')]){delete _0xe50644[_0x7379('0x26')];}_0x24e428[_0x7379('0x1a')](_0xdcf699)['send'](_0xe50644);};}exports[_0x7379('0x27')]=function(_0x102d46,_0x2f0677){var _0x104827={},_0x37bd63={},_0x2cb9c5={'count':0x0,'rows':[]};var _0x813106=_[_0x7379('0x28')](db[_0x7379('0x29')][_0x7379('0x2a')],function(_0xd11f67){return{'name':_0xd11f67[_0x7379('0x2b')],'type':_0xd11f67[_0x7379('0x2c')][_0x7379('0x2d')]};});_0x37bd63[_0x7379('0x2e')]=_[_0x7379('0x28')](_0x813106,_0x7379('0x26'));_0x37bd63[_0x7379('0x2f')]=_[_0x7379('0x30')](_0x102d46['query']);_0x37bd63['filters']=_[_0x7379('0x31')](_0x37bd63[_0x7379('0x2e')],_0x37bd63[_0x7379('0x2f')]);_0x104827[_0x7379('0x32')]=_[_0x7379('0x31')](_0x37bd63[_0x7379('0x2e')],qs[_0x7379('0x33')](_0x102d46[_0x7379('0x2f')][_0x7379('0x33')]));_0x104827['attributes']=_0x104827[_0x7379('0x32')]['length']?_0x104827[_0x7379('0x32')]:_0x37bd63[_0x7379('0x2e')];if(!_0x102d46[_0x7379('0x2f')][_0x7379('0x34')](_0x7379('0x35'))){_0x104827[_0x7379('0x1d')]=qs[_0x7379('0x1d')](_0x102d46[_0x7379('0x2f')]['limit']);_0x104827[_0x7379('0x36')]=qs['offset'](_0x102d46[_0x7379('0x2f')][_0x7379('0x36')]);}_0x104827['order']=qs[_0x7379('0x37')](_0x102d46[_0x7379('0x2f')][_0x7379('0x37')]);_0x104827[_0x7379('0x38')]=qs[_0x7379('0x39')](_[_0x7379('0x3a')](_0x102d46[_0x7379('0x2f')],_0x37bd63['filters']),_0x813106);if(_0x102d46[_0x7379('0x2f')][_0x7379('0x3b')]){_0x104827[_0x7379('0x38')]=_[_0x7379('0x3c')](_0x104827[_0x7379('0x38')],{'$or':_[_0x7379('0x28')](_0x813106,function(_0x5e8622){if(_0x5e8622[_0x7379('0x2c')]!=='VIRTUAL'){var _0x427708={};_0x427708[_0x5e8622[_0x7379('0x26')]]={'$like':'%'+_0x102d46[_0x7379('0x2f')][_0x7379('0x3b')]+'%'};return _0x427708;}})});}_0x104827=_[_0x7379('0x3c')]({},_0x104827,_0x102d46[_0x7379('0x3d')]);var _0x27d8c3={'where':_0x104827[_0x7379('0x38')]};return db[_0x7379('0x29')][_0x7379('0x1f')](_0x27d8c3)[_0x7379('0x24')](function(_0x66b925){_0x2cb9c5['count']=_0x66b925;if(_0x102d46[_0x7379('0x2f')][_0x7379('0x3e')]){_0x104827[_0x7379('0x3f')]=[{'all':!![]}];}return db[_0x7379('0x29')]['findAll'](_0x104827);})['then'](function(_0x13d0fb){_0x2cb9c5[_0x7379('0x40')]=_0x13d0fb;return _0x2cb9c5;})[_0x7379('0x24')](respondWithFilteredResult(_0x2f0677,_0x104827))[_0x7379('0x41')](handleError(_0x2f0677,null));};exports[_0x7379('0x42')]=function(_0x1ca664,_0x5e4f5d){var _0x2eac16={'raw':!![],'where':{'id':_0x1ca664[_0x7379('0x43')]['id']}},_0x2868ba={};_0x2868ba[_0x7379('0x2e')]=_[_0x7379('0x30')](db[_0x7379('0x29')]['rawAttributes']);_0x2868ba[_0x7379('0x2f')]=_[_0x7379('0x30')](_0x1ca664[_0x7379('0x2f')]);_0x2868ba['filters']=_['intersection'](_0x2868ba[_0x7379('0x2e')],_0x2868ba[_0x7379('0x2f')]);_0x2eac16['attributes']=_['intersection'](_0x2868ba[_0x7379('0x2e')],qs[_0x7379('0x33')](_0x1ca664[_0x7379('0x2f')][_0x7379('0x33')]));_0x2eac16['attributes']=_0x2eac16[_0x7379('0x32')]['length']?_0x2eac16['attributes']:_0x2868ba[_0x7379('0x2e')];if(_0x1ca664[_0x7379('0x2f')][_0x7379('0x3e')]){_0x2eac16[_0x7379('0x3f')]=[{'all':!![]}];}_0x2eac16=_[_0x7379('0x3c')]({},_0x2eac16,_0x1ca664[_0x7379('0x3d')]);return db[_0x7379('0x29')][_0x7379('0x44')](_0x2eac16)[_0x7379('0x24')](handleEntityNotFound(_0x5e4f5d,null))[_0x7379('0x24')](respondWithResult(_0x5e4f5d,null))['catch'](handleError(_0x5e4f5d,null));};exports['create']=function(_0x4b39a9,_0x421815){return db[_0x7379('0x29')][_0x7379('0x45')](_0x4b39a9[_0x7379('0x46')],{})['then'](respondWithResult(_0x421815,0xc9))[_0x7379('0x41')](handleError(_0x421815,null));};exports[_0x7379('0x23')]=function(_0x57db9d,_0x3501de){if(_0x57db9d[_0x7379('0x46')]['id']){delete _0x57db9d[_0x7379('0x46')]['id'];}return db[_0x7379('0x29')]['find']({'where':{'id':_0x57db9d[_0x7379('0x43')]['id']}})['then'](handleEntityNotFound(_0x3501de,null))[_0x7379('0x24')](saveUpdates(_0x57db9d[_0x7379('0x46')],null))[_0x7379('0x24')](respondWithResult(_0x3501de,null))['catch'](handleError(_0x3501de,null));};exports[_0x7379('0x47')]=function(_0x2f86b6,_0x81b0d7){return db[_0x7379('0x29')]['find']({'where':{'id':_0x2f86b6[_0x7379('0x43')]['id']}})[_0x7379('0x24')](handleEntityNotFound(_0x81b0d7,null))[_0x7379('0x24')](removeEntity(_0x81b0d7,null))[_0x7379('0x41')](handleError(_0x81b0d7,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index f186fff..45ae9b7 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 _0x5414=['request-promise','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger'];(function(_0x40e54c,_0x50e09f){var _0x4700c7=function(_0x40d83f){while(--_0x40d83f){_0x40e54c['push'](_0x40e54c['shift']());}};_0x4700c7(++_0x50e09f);}(_0x5414,0xdf));var _0x4541=function(_0x2cf8a0,_0x5c2f9b){_0x2cf8a0=_0x2cf8a0-0x0;var _0x16d353=_0x5414[_0x2cf8a0];return _0x16d353;};'use strict';var _=require(_0x4541('0x0'));var util=require('util');var logger=require(_0x4541('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4541('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4541('0x3'));var attributes=require(_0x4541('0x4'));module[_0x4541('0x5')]=function(_0x5ef65b,_0x921780){return _0x5ef65b[_0x4541('0x6')](_0x4541('0x7'),attributes,{'tableName':_0x4541('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f0c=['analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x32fa25,_0xce5f04){var _0x4d1f05=function(_0x9d9179){while(--_0x9d9179){_0x32fa25['push'](_0x32fa25['shift']());}};_0x4d1f05(++_0xce5f04);}(_0x1f0c,0x175));var _0xc1f0=function(_0x4107b5,_0x5ee5ce){_0x4107b5=_0x4107b5-0x0;var _0x1af40b=_0x1f0c[_0x4107b5];return _0x1af40b;};'use strict';var _=require(_0xc1f0('0x0'));var util=require(_0xc1f0('0x1'));var logger=require('../../config/logger')(_0xc1f0('0x2'));var moment=require(_0xc1f0('0x3'));var BPromise=require(_0xc1f0('0x4'));var rp=require(_0xc1f0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1f0('0x6'));var config=require('../../config/environment');var attributes=require(_0xc1f0('0x7'));module[_0xc1f0('0x8')]=function(_0x4aaf35,_0x1521b3){return _0x4aaf35[_0xc1f0('0x9')](_0xc1f0('0xa'),attributes,{'tableName':_0xc1f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 66ed3f1..557c1eb 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2733e5,_0x1613af){var _0x556620=function(_0x2f99de){while(--_0x2f99de){_0x2733e5['push'](_0x2733e5['shift']());}};_0x556620(++_0x1613af);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ 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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x100c05,_0x12458c){_0x100c05=_0x100c05-0x0;var _0x29543a=_0x7a54[_0x100c05];return _0x29543a;};'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 cc715d7..8bc3e9f 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 _0x5b51=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','put','destroy','exports','multer'];(function(_0x2ff30a,_0x35ac08){var _0x590831=function(_0x2117d1){while(--_0x2117d1){_0x2ff30a['push'](_0x2ff30a['shift']());}};_0x590831(++_0x35ac08);}(_0x5b51,0x1ca));var _0x15b5=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0x5b51[_0x582d0b];return _0x2e93e1;};'use strict';var multer=require(_0x15b5('0x0'));var util=require(_0x15b5('0x1'));var path=require(_0x15b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x15b5('0x3'));var router=express['Router']();var fs_extra=require(_0x15b5('0x4'));var auth=require(_0x15b5('0x5'));var interaction=require(_0x15b5('0x6'));var config=require(_0x15b5('0x7'));var controller=require(_0x15b5('0x8'));router[_0x15b5('0x9')]('/',auth['isAuthenticated'](),controller[_0x15b5('0xa')]);router['get'](_0x15b5('0xb'),auth[_0x15b5('0xc')](),controller[_0x15b5('0xd')]);router['post']('/',auth[_0x15b5('0xc')](),controller['create']);router[_0x15b5('0xe')]('/:id',auth[_0x15b5('0xc')](),controller['update']);router['delete'](_0x15b5('0xb'),auth[_0x15b5('0xc')](),controller[_0x15b5('0xf')]);module[_0x15b5('0x10')]=router;
\ No newline at end of file
+var _0x7e8a=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x43736d,_0x13e29d){var _0x9cee86=function(_0x1e1096){while(--_0x1e1096){_0x43736d['push'](_0x43736d['shift']());}};_0x9cee86(++_0x13e29d);}(_0x7e8a,0xbf));var _0xa7e8=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x7e8a[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0xa7e8('0x0'));var path=require(_0xa7e8('0x1'));var timeout=require(_0xa7e8('0x2'));var express=require(_0xa7e8('0x3'));var router=express[_0xa7e8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa7e8('0x5'));var interaction=require(_0xa7e8('0x6'));var config=require(_0xa7e8('0x7'));var controller=require(_0xa7e8('0x8'));router[_0xa7e8('0x9')]('/',auth[_0xa7e8('0xa')](),controller[_0xa7e8('0xb')]);router['get'](_0xa7e8('0xc'),auth[_0xa7e8('0xa')](),controller[_0xa7e8('0xd')]);router['post']('/',auth[_0xa7e8('0xa')](),controller[_0xa7e8('0xe')]);router[_0xa7e8('0xf')](_0xa7e8('0xc'),auth['isAuthenticated'](),controller[_0xa7e8('0x10')]);router[_0xa7e8('0x11')](_0xa7e8('0xc'),auth[_0xa7e8('0xa')](),controller[_0xa7e8('0x12')]);module[_0xa7e8('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 85a3479..d56c9db 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 _0x5c4a=['STRING','exports'];(function(_0x328c42,_0x3c17e4){var _0x345c20=function(_0x4eb03f){while(--_0x4eb03f){_0x328c42['push'](_0x328c42['shift']());}};_0x345c20(++_0x3c17e4);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x414678,_0x928bf6){_0x414678=_0x414678-0x0;var _0x1c1ee2=_0x5c4a[_0x414678];return _0x1c1ee2;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'name':{'type':Sequelize[_0xa5c4('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa5c4('0x1')]}};
\ No newline at end of file
+var _0xbe22=['exports','STRING','sequelize'];(function(_0x3f740c,_0x33bcdc){var _0x2e7944=function(_0x2fcf38){while(--_0x2fcf38){_0x3f740c['push'](_0x3f740c['shift']());}};_0x2e7944(++_0x33bcdc);}(_0xbe22,0x1c1));var _0x2be2=function(_0x565391,_0x18aa06){_0x565391=_0x565391-0x0;var _0x45584f=_0xbe22[_0x565391];return _0x45584f;};'use strict';var Sequelize=require(_0x2be2('0x0'));module[_0x2be2('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2be2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index b5240ee..cd601c6 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 _0xa2b2=['filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','updatedAt','body','create','file','filename','mimetype','download','findOne','ChatOfflineMessageId','root','join','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','Attachment','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL'];(function(_0x14a1b0,_0x93f367){var _0x5252d4=function(_0x463800){while(--_0x463800){_0x14a1b0['push'](_0x14a1b0['shift']());}};_0x5252d4(++_0x93f367);}(_0xa2b2,0x1f2));var _0x2a2b=function(_0x94156,_0x2d1dab){_0x94156=_0x94156-0x0;var _0x68b485=_0xa2b2[_0x94156];return _0x68b485;};'use strict';var emlformat=require(_0x2a2b('0x0'));var rimraf=require(_0x2a2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a2b('0x2'));var rp=require(_0x2a2b('0x3'));var moment=require(_0x2a2b('0x4'));var BPromise=require(_0x2a2b('0x5'));var Mustache=require(_0x2a2b('0x6'));var util=require(_0x2a2b('0x7'));var path=require(_0x2a2b('0x8'));var sox=require(_0x2a2b('0x9'));var csv=require('to-csv');var ejs=require(_0x2a2b('0xa'));var fs=require('fs');var fs_extra=require(_0x2a2b('0xb'));var _=require(_0x2a2b('0xc'));var squel=require(_0x2a2b('0xd'));var crypto=require(_0x2a2b('0xe'));var jsforce=require(_0x2a2b('0xf'));var deskjs=require(_0x2a2b('0x10'));var toCsv=require(_0x2a2b('0x11'));var querystring=require(_0x2a2b('0x12'));var Papa=require('papaparse');var Redis=require(_0x2a2b('0x13'));var authService=require(_0x2a2b('0x14'));var qs=require(_0x2a2b('0x15'));var as=require(_0x2a2b('0x16'));var hardwareService=require(_0x2a2b('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x2a2b('0x18'));var config=require(_0x2a2b('0x19'));var licenseUtil=require(_0x2a2b('0x1a'));var db=require(_0x2a2b('0x1b'))['db'];function respondWithStatusCode(_0x622668,_0x4d75dd){_0x4d75dd=_0x4d75dd||0xcc;return function(_0x4b7e0d){if(_0x4b7e0d){return _0x622668[_0x2a2b('0x1c')](_0x4d75dd);}return _0x622668[_0x2a2b('0x1d')](_0x4d75dd)[_0x2a2b('0x1e')]();};}function respondWithResult(_0x3dbf1c,_0x108505){_0x108505=_0x108505||0xc8;return function(_0x342c25){if(_0x342c25){return _0x3dbf1c[_0x2a2b('0x1d')](_0x108505)[_0x2a2b('0x1f')](_0x342c25);}};}function respondWithFilteredResult(_0x8cc51e,_0x257631){return function(_0x5d770f){if(_0x5d770f){var _0x2e0757=typeof _0x257631[_0x2a2b('0x20')]===_0x2a2b('0x21')&&typeof _0x257631['limit']===_0x2a2b('0x21');var _0x4d79f6=_0x5d770f['count'];var _0x1c2d2a=_0x2e0757?0x0:_0x257631[_0x2a2b('0x20')];var _0x313cb1=_0x2e0757?_0x5d770f['count']:_0x257631[_0x2a2b('0x20')]+_0x257631[_0x2a2b('0x22')];var _0x327f19;if(_0x313cb1>=_0x4d79f6){_0x313cb1=_0x4d79f6;_0x327f19=0xc8;}else{_0x327f19=0xce;}_0x8cc51e[_0x2a2b('0x1d')](_0x327f19);return _0x8cc51e[_0x2a2b('0x23')]('Content-Range',_0x1c2d2a+'-'+_0x313cb1+'/'+_0x4d79f6)['json'](_0x5d770f);}return null;};}function patchUpdates(_0x49d162){return function(_0x444960){try{jsonpatch[_0x2a2b('0x24')](_0x444960,_0x49d162,!![]);}catch(_0x523a47){return BPromise[_0x2a2b('0x25')](_0x523a47);}return _0x444960['save']();};}function saveUpdates(_0x4e0370,_0x2b3f0a){return function(_0x177e27){if(_0x177e27){return _0x177e27[_0x2a2b('0x26')](_0x4e0370)[_0x2a2b('0x27')](function(_0x2b7f83){return _0x2b7f83;});}return null;};}function removeEntity(_0x4ac6f9,_0x55044c){return function(_0x5998eb){if(_0x5998eb){return _0x5998eb[_0x2a2b('0x28')]()[_0x2a2b('0x27')](function(){_0x4ac6f9['status'](0xcc)[_0x2a2b('0x1e')]();});}};}function handleEntityNotFound(_0x1b79e7,_0x3e493e){return function(_0x2ea85){if(!_0x2ea85){_0x1b79e7[_0x2a2b('0x1c')](0x194);}return _0x2ea85;};}function handleError(_0x5d7d5e,_0x375065){_0x375065=_0x375065||0x1f4;return function(_0x502fc1){logger[_0x2a2b('0x29')](_0x502fc1[_0x2a2b('0x2a')]);if(_0x502fc1[_0x2a2b('0x2b')]){delete _0x502fc1['name'];}_0x5d7d5e[_0x2a2b('0x1d')](_0x375065)[_0x2a2b('0x2c')](_0x502fc1);};}exports[_0x2a2b('0x2d')]=function(_0x475ec1,_0x5e681d){var _0x47ea3c={},_0xc4c450={},_0x523f6e={'count':0x0,'rows':[]};var _0x3a1443=_['map'](db[_0x2a2b('0x2e')][_0x2a2b('0x2f')],function(_0x141bad){return{'name':_0x141bad[_0x2a2b('0x30')],'type':_0x141bad['type'][_0x2a2b('0x31')]};});_0xc4c450[_0x2a2b('0x32')]=_[_0x2a2b('0x33')](_0x3a1443,_0x2a2b('0x2b'));_0xc4c450[_0x2a2b('0x34')]=_[_0x2a2b('0x35')](_0x475ec1['query']);_0xc4c450[_0x2a2b('0x36')]=_[_0x2a2b('0x37')](_0xc4c450['model'],_0xc4c450[_0x2a2b('0x34')]);_0x47ea3c['attributes']=_[_0x2a2b('0x37')](_0xc4c450[_0x2a2b('0x32')],qs['fields'](_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x38')]));_0x47ea3c[_0x2a2b('0x39')]=_0x47ea3c['attributes'][_0x2a2b('0x3a')]?_0x47ea3c[_0x2a2b('0x39')]:_0xc4c450[_0x2a2b('0x32')];if(!_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x3b')](_0x2a2b('0x3c'))){_0x47ea3c[_0x2a2b('0x22')]=qs[_0x2a2b('0x22')](_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x22')]);_0x47ea3c[_0x2a2b('0x20')]=qs[_0x2a2b('0x20')](_0x475ec1[_0x2a2b('0x34')]['offset']);}_0x47ea3c['order']=qs['sort'](_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x3d')]);_0x47ea3c[_0x2a2b('0x3e')]=qs[_0x2a2b('0x36')](_[_0x2a2b('0x3f')](_0x475ec1[_0x2a2b('0x34')],_0xc4c450[_0x2a2b('0x36')]),_0x3a1443);if(_0x475ec1['query']['filter']){_0x47ea3c['where']=_['merge'](_0x47ea3c[_0x2a2b('0x3e')],{'$or':_[_0x2a2b('0x33')](_0x3a1443,function(_0x3fa88a){if(_0x3fa88a[_0x2a2b('0x40')]!==_0x2a2b('0x41')){var _0x186b6e={};_0x186b6e[_0x3fa88a['name']]={'$like':'%'+_0x475ec1[_0x2a2b('0x34')][_0x2a2b('0x42')]+'%'};return _0x186b6e;}})});}_0x47ea3c=_[_0x2a2b('0x43')]({},_0x47ea3c,_0x475ec1[_0x2a2b('0x44')]);var _0x22d095={'where':_0x47ea3c[_0x2a2b('0x3e')]};return db[_0x2a2b('0x2e')][_0x2a2b('0x45')](_0x22d095)['then'](function(_0x56d24){_0x523f6e[_0x2a2b('0x45')]=_0x56d24;if(_0x475ec1['query'][_0x2a2b('0x46')]){_0x47ea3c[_0x2a2b('0x47')]=[{'all':!![]}];}return db[_0x2a2b('0x2e')][_0x2a2b('0x48')](_0x47ea3c);})['then'](function(_0x264b9b){_0x523f6e[_0x2a2b('0x49')]=_0x264b9b;return _0x523f6e;})[_0x2a2b('0x27')](respondWithFilteredResult(_0x5e681d,_0x47ea3c))[_0x2a2b('0x4a')](handleError(_0x5e681d,null));};exports[_0x2a2b('0x4b')]=function(_0x21e842,_0x2baa88){var _0x14d667={'raw':!![],'where':{'id':_0x21e842[_0x2a2b('0x4c')]['id']}},_0x1bf4c4={};_0x1bf4c4[_0x2a2b('0x32')]=_[_0x2a2b('0x35')](db[_0x2a2b('0x2e')][_0x2a2b('0x2f')]);_0x1bf4c4['query']=_['keys'](_0x21e842[_0x2a2b('0x34')]);_0x1bf4c4['filters']=_[_0x2a2b('0x37')](_0x1bf4c4['model'],_0x1bf4c4['query']);_0x14d667[_0x2a2b('0x39')]=_[_0x2a2b('0x37')](_0x1bf4c4['model'],qs[_0x2a2b('0x38')](_0x21e842['query'][_0x2a2b('0x38')]));_0x14d667[_0x2a2b('0x39')]=_0x14d667['attributes'][_0x2a2b('0x3a')]?_0x14d667[_0x2a2b('0x39')]:_0x1bf4c4[_0x2a2b('0x32')];if(_0x21e842[_0x2a2b('0x34')][_0x2a2b('0x46')]){_0x14d667[_0x2a2b('0x47')]=[{'all':!![]}];}_0x14d667=_[_0x2a2b('0x43')]({},_0x14d667,_0x21e842[_0x2a2b('0x44')]);return db[_0x2a2b('0x2e')][_0x2a2b('0x4d')](_0x14d667)[_0x2a2b('0x27')](handleEntityNotFound(_0x2baa88,null))[_0x2a2b('0x27')](respondWithResult(_0x2baa88,null))[_0x2a2b('0x4a')](handleError(_0x2baa88,null));};exports[_0x2a2b('0x4e')]=function(_0x311b32,_0x170d14){var _0x3cca7e={'where':{'id':_0x311b32[_0x2a2b('0x4c')]['id']}},_0x4d994e={};_0x4d994e[_0x2a2b('0x32')]=_['keys'](db['Attachment'][_0x2a2b('0x2f')]);_0x3cca7e[_0x2a2b('0x39')]=_[_0x2a2b('0x37')](_0x4d994e[_0x2a2b('0x32')],qs['fields'](_0x311b32[_0x2a2b('0x34')][_0x2a2b('0x38')]));_0x3cca7e['attributes']=_0x3cca7e[_0x2a2b('0x39')][_0x2a2b('0x3a')]?_0x3cca7e[_0x2a2b('0x39')]:_0x4d994e[_0x2a2b('0x32')];if(_0x311b32[_0x2a2b('0x34')][_0x2a2b('0x46')]){_0x3cca7e[_0x2a2b('0x47')]=[{'all':!![]}];}_0x3cca7e=_[_0x2a2b('0x43')]({},_0x3cca7e,_0x311b32[_0x2a2b('0x44')]);return db['Attachment'][_0x2a2b('0x4d')](_0x3cca7e)[_0x2a2b('0x27')](handleEntityNotFound(_0x170d14,null))[_0x2a2b('0x27')](function(_0x301afd){if(_0x301afd){var _0x351234=_0x301afd[_0x2a2b('0x4f')]({'plain':!![]});_0x351234=qs[_0x2a2b('0x50')](_0x351234,['id',_0x2a2b('0x51'),_0x2a2b('0x52')]);_0x311b32[_0x2a2b('0x53')]=_['omit'](_0x311b32['body'],['id','createdAt',_0x2a2b('0x52')]);return db[_0x2a2b('0x2e')][_0x2a2b('0x54')](_['merge'](_0x351234,_0x311b32['body']),{'include':_0x311b32[_0x2a2b('0x34')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x2a2b('0x27')](respondWithResult(_0x170d14,0xc9))[_0x2a2b('0x4a')](handleError(_0x170d14,null));};exports[_0x2a2b('0x26')]=function(_0x46d0f1,_0x29076d){if(_0x46d0f1[_0x2a2b('0x53')]['id']){delete _0x46d0f1['body']['id'];}return db[_0x2a2b('0x2e')][_0x2a2b('0x4d')]({'where':{'id':_0x46d0f1[_0x2a2b('0x4c')]['id']}})[_0x2a2b('0x27')](handleEntityNotFound(_0x29076d,null))[_0x2a2b('0x27')](saveUpdates(_0x46d0f1['body'],null))[_0x2a2b('0x27')](respondWithResult(_0x29076d,null))['catch'](handleError(_0x29076d,null));};exports[_0x2a2b('0x28')]=function(_0x2550b6,_0x327449){return db[_0x2a2b('0x2e')][_0x2a2b('0x4d')]({'where':{'id':_0x2550b6[_0x2a2b('0x4c')]['id']}})[_0x2a2b('0x27')](handleEntityNotFound(_0x327449,null))['then'](removeEntity(_0x327449,null))[_0x2a2b('0x4a')](handleError(_0x327449,null));};exports[_0x2a2b('0x54')]=function(_0x24167a,_0x4434ee,_0x357edb){_0x24167a[_0x2a2b('0x53')][_0x2a2b('0x2b')]=_0x24167a['file']['originalname'];_0x24167a[_0x2a2b('0x53')]['basename']=_0x24167a[_0x2a2b('0x55')][_0x2a2b('0x56')];_0x24167a['body']['type']=_0x24167a[_0x2a2b('0x55')][_0x2a2b('0x57')];return db['Attachment']['create'](_0x24167a['body'])[_0x2a2b('0x27')](respondWithResult(_0x4434ee,0xc9))['catch'](handleError(_0x4434ee,null));};exports[_0x2a2b('0x58')]=function(_0x5254cf,_0x402eb1,_0x29d0c1){return db['Attachment'][_0x2a2b('0x59')]({'where':{'id':_0x5254cf[_0x2a2b('0x4c')]['id']},'raw':!![]})[_0x2a2b('0x27')](handleEntityNotFound(_0x402eb1,null))[_0x2a2b('0x27')](function(_0x19b83d){if(_0x19b83d){var _0x35391a=_0x19b83d[_0x2a2b('0x5a')]!==null;var _0x508d31=path['join'](config[_0x2a2b('0x5b')],'server/files/attachments/');if(_0x35391a){_0x508d31=path[_0x2a2b('0x5c')](_0x508d31,'offline-chat/');}var _0x155f70=path[_0x2a2b('0x5c')](_0x508d31,_0x19b83d[_0x2a2b('0x5d')]);return _0x402eb1[_0x2a2b('0x58')](_0x155f70);}})[_0x2a2b('0x4a')](handleError(_0x402eb1,null));};
\ No newline at end of file
+var _0x3508=['params','fields','includeAll','options','find','clone','get','omit','updatedAt','body','create','update','destroy','file','originalname','basename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','then','stack','name','index','Attachment','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x3508,0x173));var _0x8350=function(_0x55599e,_0x196bab){_0x55599e=_0x55599e-0x0;var _0x3c8e06=_0x3508[_0x55599e];return _0x3c8e06;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8350('0x0'));var rp=require(_0x8350('0x1'));var moment=require('moment');var BPromise=require(_0x8350('0x2'));var Mustache=require(_0x8350('0x3'));var util=require(_0x8350('0x4'));var path=require(_0x8350('0x5'));var sox=require(_0x8350('0x6'));var csv=require(_0x8350('0x7'));var ejs=require(_0x8350('0x8'));var fs=require('fs');var fs_extra=require(_0x8350('0x9'));var _=require(_0x8350('0xa'));var squel=require(_0x8350('0xb'));var crypto=require(_0x8350('0xc'));var jsforce=require(_0x8350('0xd'));var deskjs=require(_0x8350('0xe'));var toCsv=require(_0x8350('0x7'));var querystring=require(_0x8350('0xf'));var Papa=require(_0x8350('0x10'));var Redis=require('ioredis');var authService=require(_0x8350('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8350('0x12'));var hardwareService=require(_0x8350('0x13'));var logger=require(_0x8350('0x14'))(_0x8350('0x15'));var utils=require(_0x8350('0x16'));var config=require(_0x8350('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x188240,_0x2f6acc){_0x2f6acc=_0x2f6acc||0xcc;return function(_0x42f22a){if(_0x42f22a){return _0x188240[_0x8350('0x18')](_0x2f6acc);}return _0x188240['status'](_0x2f6acc)[_0x8350('0x19')]();};}function respondWithResult(_0x4b1216,_0x3ed2cf){_0x3ed2cf=_0x3ed2cf||0xc8;return function(_0x27293c){if(_0x27293c){return _0x4b1216[_0x8350('0x1a')](_0x3ed2cf)[_0x8350('0x1b')](_0x27293c);}};}function respondWithFilteredResult(_0x10e78c,_0xf89c11){return function(_0xaed5d4){if(_0xaed5d4){var _0x2070af=typeof _0xf89c11[_0x8350('0x1c')]===_0x8350('0x1d')&&typeof _0xf89c11['limit']==='undefined';var _0x3b276e=_0xaed5d4['count'];var _0x1fe6ee=_0x2070af?0x0:_0xf89c11[_0x8350('0x1c')];var _0x133a62=_0x2070af?_0xaed5d4[_0x8350('0x1e')]:_0xf89c11[_0x8350('0x1c')]+_0xf89c11[_0x8350('0x1f')];var _0x5354af;if(_0x133a62>=_0x3b276e){_0x133a62=_0x3b276e;_0x5354af=0xc8;}else{_0x5354af=0xce;}_0x10e78c['status'](_0x5354af);return _0x10e78c['set'](_0x8350('0x20'),_0x1fe6ee+'-'+_0x133a62+'/'+_0x3b276e)[_0x8350('0x1b')](_0xaed5d4);}return null;};}function patchUpdates(_0x2b4f98){return function(_0x26482a){try{jsonpatch[_0x8350('0x21')](_0x26482a,_0x2b4f98,!![]);}catch(_0x3b38df){return BPromise[_0x8350('0x22')](_0x3b38df);}return _0x26482a['save']();};}function saveUpdates(_0x144dd2,_0x428f38){return function(_0x4d1ef3){if(_0x4d1ef3){return _0x4d1ef3['update'](_0x144dd2)[_0x8350('0x23')](function(_0x2b7429){return _0x2b7429;});}return null;};}function removeEntity(_0x446fae,_0x48adb1){return function(_0x24ee5f){if(_0x24ee5f){return _0x24ee5f['destroy']()[_0x8350('0x23')](function(){_0x446fae[_0x8350('0x1a')](0xcc)[_0x8350('0x19')]();});}};}function handleEntityNotFound(_0x26726e,_0x14224c){return function(_0x433aec){if(!_0x433aec){_0x26726e['sendStatus'](0x194);}return _0x433aec;};}function handleError(_0xeca555,_0x1e7391){_0x1e7391=_0x1e7391||0x1f4;return function(_0x3631f3){logger['error'](_0x3631f3[_0x8350('0x24')]);if(_0x3631f3[_0x8350('0x25')]){delete _0x3631f3[_0x8350('0x25')];}_0xeca555[_0x8350('0x1a')](_0x1e7391)['send'](_0x3631f3);};}exports[_0x8350('0x26')]=function(_0x25f5fc,_0x2c6468){var _0x3ab6a8={},_0x2f6317={},_0x165d2c={'count':0x0,'rows':[]};var _0x1c3f96=_['map'](db[_0x8350('0x27')]['rawAttributes'],function(_0xb42dc9){return{'name':_0xb42dc9[_0x8350('0x28')],'type':_0xb42dc9[_0x8350('0x29')][_0x8350('0x2a')]};});_0x2f6317[_0x8350('0x2b')]=_[_0x8350('0x2c')](_0x1c3f96,_0x8350('0x25'));_0x2f6317['query']=_[_0x8350('0x2d')](_0x25f5fc[_0x8350('0x2e')]);_0x2f6317[_0x8350('0x2f')]=_[_0x8350('0x30')](_0x2f6317[_0x8350('0x2b')],_0x2f6317[_0x8350('0x2e')]);_0x3ab6a8[_0x8350('0x31')]=_[_0x8350('0x30')](_0x2f6317[_0x8350('0x2b')],qs['fields'](_0x25f5fc[_0x8350('0x2e')]['fields']));_0x3ab6a8[_0x8350('0x31')]=_0x3ab6a8[_0x8350('0x31')][_0x8350('0x32')]?_0x3ab6a8[_0x8350('0x31')]:_0x2f6317[_0x8350('0x2b')];if(!_0x25f5fc[_0x8350('0x2e')][_0x8350('0x33')](_0x8350('0x34'))){_0x3ab6a8[_0x8350('0x1f')]=qs[_0x8350('0x1f')](_0x25f5fc[_0x8350('0x2e')]['limit']);_0x3ab6a8['offset']=qs[_0x8350('0x1c')](_0x25f5fc[_0x8350('0x2e')][_0x8350('0x1c')]);}_0x3ab6a8[_0x8350('0x35')]=qs[_0x8350('0x36')](_0x25f5fc[_0x8350('0x2e')]['sort']);_0x3ab6a8[_0x8350('0x37')]=qs[_0x8350('0x2f')](_['pick'](_0x25f5fc['query'],_0x2f6317[_0x8350('0x2f')]),_0x1c3f96);if(_0x25f5fc[_0x8350('0x2e')][_0x8350('0x38')]){_0x3ab6a8[_0x8350('0x37')]=_[_0x8350('0x39')](_0x3ab6a8['where'],{'$or':_[_0x8350('0x2c')](_0x1c3f96,function(_0x3ac616){if(_0x3ac616['type']!==_0x8350('0x3a')){var _0x57430e={};_0x57430e[_0x3ac616['name']]={'$like':'%'+_0x25f5fc['query'][_0x8350('0x38')]+'%'};return _0x57430e;}})});}_0x3ab6a8=_[_0x8350('0x39')]({},_0x3ab6a8,_0x25f5fc['options']);var _0x4e2a34={'where':_0x3ab6a8['where']};return db[_0x8350('0x27')][_0x8350('0x1e')](_0x4e2a34)[_0x8350('0x23')](function(_0xc085e3){_0x165d2c['count']=_0xc085e3;if(_0x25f5fc[_0x8350('0x2e')]['includeAll']){_0x3ab6a8[_0x8350('0x3b')]=[{'all':!![]}];}return db[_0x8350('0x27')][_0x8350('0x3c')](_0x3ab6a8);})[_0x8350('0x23')](function(_0x5e44fa){_0x165d2c[_0x8350('0x3d')]=_0x5e44fa;return _0x165d2c;})[_0x8350('0x23')](respondWithFilteredResult(_0x2c6468,_0x3ab6a8))[_0x8350('0x3e')](handleError(_0x2c6468,null));};exports[_0x8350('0x3f')]=function(_0x1b3397,_0x5acd3f){var _0xd67eb8={'raw':!![],'where':{'id':_0x1b3397[_0x8350('0x40')]['id']}},_0x46da1b={};_0x46da1b[_0x8350('0x2b')]=_[_0x8350('0x2d')](db[_0x8350('0x27')]['rawAttributes']);_0x46da1b[_0x8350('0x2e')]=_[_0x8350('0x2d')](_0x1b3397[_0x8350('0x2e')]);_0x46da1b[_0x8350('0x2f')]=_[_0x8350('0x30')](_0x46da1b[_0x8350('0x2b')],_0x46da1b[_0x8350('0x2e')]);_0xd67eb8[_0x8350('0x31')]=_[_0x8350('0x30')](_0x46da1b[_0x8350('0x2b')],qs['fields'](_0x1b3397[_0x8350('0x2e')][_0x8350('0x41')]));_0xd67eb8[_0x8350('0x31')]=_0xd67eb8[_0x8350('0x31')][_0x8350('0x32')]?_0xd67eb8[_0x8350('0x31')]:_0x46da1b[_0x8350('0x2b')];if(_0x1b3397[_0x8350('0x2e')][_0x8350('0x42')]){_0xd67eb8[_0x8350('0x3b')]=[{'all':!![]}];}_0xd67eb8=_['merge']({},_0xd67eb8,_0x1b3397[_0x8350('0x43')]);return db[_0x8350('0x27')][_0x8350('0x44')](_0xd67eb8)[_0x8350('0x23')](handleEntityNotFound(_0x5acd3f,null))[_0x8350('0x23')](respondWithResult(_0x5acd3f,null))[_0x8350('0x3e')](handleError(_0x5acd3f,null));};exports[_0x8350('0x45')]=function(_0x5c8b90,_0x4d9593){var _0x31ceb5={'where':{'id':_0x5c8b90[_0x8350('0x40')]['id']}},_0x1657a0={};_0x1657a0[_0x8350('0x2b')]=_['keys'](db[_0x8350('0x27')]['rawAttributes']);_0x31ceb5[_0x8350('0x31')]=_[_0x8350('0x30')](_0x1657a0['model'],qs[_0x8350('0x41')](_0x5c8b90[_0x8350('0x2e')][_0x8350('0x41')]));_0x31ceb5['attributes']=_0x31ceb5[_0x8350('0x31')][_0x8350('0x32')]?_0x31ceb5['attributes']:_0x1657a0[_0x8350('0x2b')];if(_0x5c8b90[_0x8350('0x2e')][_0x8350('0x42')]){_0x31ceb5[_0x8350('0x3b')]=[{'all':!![]}];}_0x31ceb5=_['merge']({},_0x31ceb5,_0x5c8b90[_0x8350('0x43')]);return db['Attachment'][_0x8350('0x44')](_0x31ceb5)['then'](handleEntityNotFound(_0x4d9593,null))[_0x8350('0x23')](function(_0x4bf461){if(_0x4bf461){var _0x18fc8b=_0x4bf461[_0x8350('0x46')]({'plain':!![]});_0x18fc8b=qs[_0x8350('0x47')](_0x18fc8b,['id','createdAt',_0x8350('0x48')]);_0x5c8b90[_0x8350('0x49')]=_['omit'](_0x5c8b90['body'],['id','createdAt','updatedAt']);return db[_0x8350('0x27')][_0x8350('0x4a')](_[_0x8350('0x39')](_0x18fc8b,_0x5c8b90[_0x8350('0x49')]),{'include':_0x5c8b90['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x8350('0x23')](respondWithResult(_0x4d9593,0xc9))['catch'](handleError(_0x4d9593,null));};exports[_0x8350('0x4b')]=function(_0x39c534,_0x1bf07d){if(_0x39c534[_0x8350('0x49')]['id']){delete _0x39c534['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x39c534['params']['id']}})[_0x8350('0x23')](handleEntityNotFound(_0x1bf07d,null))[_0x8350('0x23')](saveUpdates(_0x39c534[_0x8350('0x49')],null))[_0x8350('0x23')](respondWithResult(_0x1bf07d,null))[_0x8350('0x3e')](handleError(_0x1bf07d,null));};exports[_0x8350('0x4c')]=function(_0x3c4816,_0x3c8670){return db[_0x8350('0x27')]['find']({'where':{'id':_0x3c4816['params']['id']}})['then'](handleEntityNotFound(_0x3c8670,null))[_0x8350('0x23')](removeEntity(_0x3c8670,null))['catch'](handleError(_0x3c8670,null));};exports['create']=function(_0x37ec06,_0x4ee9d5,_0x16bf4c){_0x37ec06[_0x8350('0x49')]['name']=_0x37ec06[_0x8350('0x4d')][_0x8350('0x4e')];_0x37ec06[_0x8350('0x49')][_0x8350('0x4f')]=_0x37ec06[_0x8350('0x4d')]['filename'];_0x37ec06[_0x8350('0x49')][_0x8350('0x29')]=_0x37ec06[_0x8350('0x4d')]['mimetype'];return db[_0x8350('0x27')][_0x8350('0x4a')](_0x37ec06[_0x8350('0x49')])[_0x8350('0x23')](respondWithResult(_0x4ee9d5,0xc9))[_0x8350('0x3e')](handleError(_0x4ee9d5,null));};exports[_0x8350('0x50')]=function(_0x13b69c,_0x2c79ea,_0x2a5472){return db[_0x8350('0x27')][_0x8350('0x51')]({'where':{'id':_0x13b69c[_0x8350('0x40')]['id']},'raw':!![]})[_0x8350('0x23')](handleEntityNotFound(_0x2c79ea,null))['then'](function(_0x686099){if(_0x686099){var _0x3c0683=_0x686099[_0x8350('0x52')]!==null;var _0x567fa9=path[_0x8350('0x53')](config[_0x8350('0x54')],_0x8350('0x55'));if(_0x3c0683){_0x567fa9=path['join'](_0x567fa9,_0x8350('0x56'));}var _0x4a124d=path[_0x8350('0x53')](_0x567fa9,_0x686099[_0x8350('0x4f')]);return _0x2c79ea[_0x8350('0x50')](_0x4a124d);}})[_0x8350('0x3e')](handleError(_0x2c79ea,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 8512de8..1b1f831 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 _0x43cc=['exports','define','Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x54e735,_0x38d658){var _0xffef0f=function(_0x40f175){while(--_0x40f175){_0x54e735['push'](_0x54e735['shift']());}};_0xffef0f(++_0x38d658);}(_0x43cc,0xac));var _0xc43c=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0x43cc[_0x7abd7];return _0x3a2577;};'use strict';var _=require('lodash');var util=require(_0xc43c('0x0'));var logger=require(_0xc43c('0x1'))(_0xc43c('0x2'));var moment=require(_0xc43c('0x3'));var BPromise=require(_0xc43c('0x4'));var rp=require(_0xc43c('0x5'));var fs=require('fs');var path=require(_0xc43c('0x6'));var rimraf=require(_0xc43c('0x7'));var config=require(_0xc43c('0x8'));var attributes=require(_0xc43c('0x9'));module[_0xc43c('0xa')]=function(_0x5a50a7,_0x5d6e06){return _0x5a50a7[_0xc43c('0xb')](_0xc43c('0xc'),attributes,{'tableName':_0xc43c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b44=['api','moment','request-promise','path','../../config/environment','./attachment.attributes','define','Attachment','lodash','util'];(function(_0x1ba2cf,_0x57b0f2){var _0x4ef5b5=function(_0x4c5dcc){while(--_0x4c5dcc){_0x1ba2cf['push'](_0x1ba2cf['shift']());}};_0x4ef5b5(++_0x57b0f2);}(_0x6b44,0xf8));var _0x46b4=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0x6b44[_0x2181fc];return _0x315da1;};'use strict';var _=require(_0x46b4('0x0'));var util=require(_0x46b4('0x1'));var logger=require('../../config/logger')(_0x46b4('0x2'));var moment=require(_0x46b4('0x3'));var BPromise=require('bluebird');var rp=require(_0x46b4('0x4'));var fs=require('fs');var path=require(_0x46b4('0x5'));var rimraf=require('rimraf');var config=require(_0x46b4('0x6'));var attributes=require(_0x46b4('0x7'));module['exports']=function(_0x48bc16,_0x2cdbac){return _0x48bc16[_0x46b4('0x8')](_0x46b4('0x9'),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 4cbc34e..e5c5947 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 _0x9f94=['rpc','jayson/promise','client','http','Attachment,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18890a,_0x8efbc){var _0xc6044d=function(_0xb848bc){while(--_0xb848bc){_0x18890a['push'](_0x18890a['shift']());}};_0xc6044d(++_0x8efbc);}(_0x9f94,0x1e7));var _0x49f9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9f94[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdbf1,_0x10ada8,_0x2e0928){return new BPromise(function(_0x355683,_0x2eddd1){return client['request'](_0x2fdbf1,_0x2e0928)['then'](function(_0x1628bb){logger['info'](_0x49f9('0xb'),_0x10ada8,_0x49f9('0xc'));logger[_0x49f9('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'),JSON['stringify'](_0x1628bb));if(_0x1628bb[_0x49f9('0xe')]){if(_0x1628bb[_0x49f9('0xe')][_0x49f9('0xf')]===0x1f4){logger[_0x49f9('0xe')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error'][_0x49f9('0x10')]);return _0x2eddd1(_0x1628bb[_0x49f9('0xe')][_0x49f9('0x10')]);}logger[_0x49f9('0xe')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error']['message']);return _0x355683(_0x1628bb[_0x49f9('0xe')]['message']);}else{logger[_0x49f9('0x11')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'));_0x355683(_0x1628bb[_0x49f9('0x12')]['message']);}})[_0x49f9('0x13')](function(_0x1a2026){logger[_0x49f9('0xe')](_0x49f9('0xb'),_0x10ada8,_0x1a2026);_0x2eddd1(_0x1a2026);});});}exports[_0x49f9('0x14')]=function(_0x509610){var _0x3cc45e=this;return new Promise(function(_0x359d48,_0x32568b){return db[_0x49f9('0x15')][_0x49f9('0x16')](_0x509610[_0x49f9('0x17')],{'raw':_0x509610[_0x49f9('0x18')]?_0x509610[_0x49f9('0x18')][_0x49f9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4f0bc9){logger[_0x49f9('0x11')]('CreateAttachment',_0x509610);logger[_0x49f9('0xd')]('CreateAttachment',_0x509610,JSON['stringify'](_0x4f0bc9));_0x359d48(_0x4f0bc9);})[_0x49f9('0x13')](function(_0xde1383){logger['error'](_0x49f9('0x14'),_0xde1383['message'],_0x509610);_0x32568b(_0x3cc45e['error'](0x1f4,_0xde1383[_0x49f9('0x10')]));});});};
\ No newline at end of file
+var _0xe739=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error'];(function(_0x180b9c,_0x663206){var _0x51baad=function(_0x3fe54a){while(--_0x3fe54a){_0x180b9c['push'](_0x180b9c['shift']());}};_0x51baad(++_0x663206);}(_0xe739,0x105));var _0x9e73=function(_0x3a8f21,_0x45d901){_0x3a8f21=_0x3a8f21-0x0;var _0x383baf=_0xe739[_0x3a8f21];return _0x383baf;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var moment=require(_0x9e73('0x1'));var BPromise=require(_0x9e73('0x2'));var rs=require(_0x9e73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e73('0x4'))(_0x9e73('0x5'));var config=require(_0x9e73('0x6'));var jayson=require(_0x9e73('0x7'));var client=jayson['client'][_0x9e73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cb5b,_0xb37872,_0x5e46e7){return new BPromise(function(_0xa49f86,_0x1ee042){return client[_0x9e73('0x9')](_0x26cb5b,_0x5e46e7)[_0x9e73('0xa')](function(_0x14de8a){logger[_0x9e73('0xb')]('Attachment,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'),JSON['stringify'](_0x14de8a));if(_0x14de8a[_0x9e73('0xd')]){if(_0x14de8a[_0x9e73('0xd')][_0x9e73('0xe')]===0x1f4){logger['error'](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);return _0x1ee042(_0x14de8a[_0x9e73('0xd')]['message']);}logger[_0x9e73('0xd')](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')]['message']);return _0xa49f86(_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);}else{logger['info'](_0x9e73('0xf'),_0xb37872,_0x9e73('0xc'));_0xa49f86(_0x14de8a[_0x9e73('0x11')]['message']);}})[_0x9e73('0x12')](function(_0x51968a){logger[_0x9e73('0xd')]('Attachment,\x20%s,\x20%s',_0xb37872,_0x51968a);_0x1ee042(_0x51968a);});});}exports[_0x9e73('0x13')]=function(_0x48b1db){var _0x4dabb2=this;return new Promise(function(_0x419c5b,_0x3944fc){return db[_0x9e73('0x14')][_0x9e73('0x15')](_0x48b1db[_0x9e73('0x16')],{'raw':_0x48b1db[_0x9e73('0x17')]?_0x48b1db[_0x9e73('0x17')][_0x9e73('0x18')]===undefined?!![]:![]:!![]})[_0x9e73('0xa')](function(_0x3f56bf){logger['info'](_0x9e73('0x13'),_0x48b1db);logger['debug'](_0x9e73('0x13'),_0x48b1db,JSON['stringify'](_0x3f56bf));_0x419c5b(_0x3f56bf);})[_0x9e73('0x12')](function(_0x589a5d){logger[_0x9e73('0xd')](_0x9e73('0x13'),_0x589a5d['message'],_0x48b1db);_0x3944fc(_0x4dabb2['error'](0x1f4,_0x589a5d[_0x9e73('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 6d6c2d5..9d5084b 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x3fdc3e,_0x4b9c08){_0x3fdc3e=_0x3fdc3e-0x0;var _0x377696=_0xdb28[_0x3fdc3e];return _0x377696;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x28bdf0,_0x17b8c3){var _0x5d9fbf=function(_0x57cedb){while(--_0x57cedb){_0x28bdf0['push'](_0x28bdf0['shift']());}};_0x5d9fbf(++_0x17b8c3);}(_0x2032,0xd9));var _0x2203=function(_0x51f3c3,_0x3249e1){_0x51f3c3=_0x51f3c3-0x0;var _0x1b8e56=_0x2032[_0x51f3c3];return _0x1b8e56;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('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 1441b7c..c6c427f 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 _0xa9f6=['disabled','blocked','blockedAt','online','admin','user','agent','then','blockDuration','minutes','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','passport','Strategy','moment','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role'];(function(_0x27c4fe,_0x526312){var _0x3ba97d=function(_0x536243){while(--_0x536243){_0x27c4fe['push'](_0x27c4fe['shift']());}};_0x3ba97d(++_0x526312);}(_0xa9f6,0x14e));var _0x6a9f=function(_0x55a422,_0x1b09fc){_0x55a422=_0x55a422-0x0;var _0xce15c8=_0xa9f6[_0x55a422];return _0xce15c8;};'use strict';var passport=require(_0x6a9f('0x0'));var LocalStrategy=require('passport-local')[_0x6a9f('0x1')];var moment=require(_0x6a9f('0x2'));var ActiveDirectory=require(_0x6a9f('0x3'));var BPromise=require('bluebird');var util=require(_0x6a9f('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x6a9f('0x5'));var utils=require(_0x6a9f('0x6'));var config=require(_0x6a9f('0x7'));var logger=require(_0x6a9f('0x8'))('api');function isActiveDirectoryConfigured(_0x26a6ab){var _0x3e52d7=![];if(typeof _0x26a6ab[_0x6a9f('0x9')]!==_0x6a9f('0xa')){_0x3e52d7=_0x26a6ab[_0x6a9f('0x9')][_0x6a9f('0xb')]&&_0x26a6ab['activedirectory'][_0x6a9f('0xc')]&&_0x26a6ab['activedirectory'][_0x6a9f('0xd')];}return _0x3e52d7;}function adAuthenticate(_0x518002,_0x2d48f6,_0x2a9658){return new BPromise(function(_0x20cbf0,_0x3c10c4){try{var _0x556e79=new ActiveDirectory(_0x518002);_0x556e79[_0x6a9f('0xe')](_0x2d48f6,_0x2a9658,function(_0x5fbcf2,_0x2ac853){if(_0x5fbcf2){logger[_0x6a9f('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x2d48f6,util['inspect'](_0x5fbcf2,{'showHidden':![],'depth':null}));_0x3c10c4(_0x6a9f('0x10'));}else if(!_0x2ac853){logger[_0x6a9f('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x2d48f6);_0x3c10c4(_0x6a9f('0x10'));}else{_0x20cbf0(_0x2ac853);}});}catch(_0x5c0ca1){_0x3c10c4(_0x5c0ca1);}});}function ActiveDirectoryAuthenticate(_0x2c3ebe,_0x1bf75e,_0x4f3eae,_0x4701c7){var _0x5cad6b,_0x3599c9;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x6a9f('0x11'),_0x1bf75e);return _0x4701c7(null,![],{'message':_0x6a9f('0x10')});}return db[_0x6a9f('0x12')][_0x6a9f('0x13')]({'where':{'id':0x1},'attributes':[_0x6a9f('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x5e4d29){_0x5cad6b=_0x5e4d29;if(!_0x5cad6b['adSsoEnabled']){logger[_0x6a9f('0xf')](_0x6a9f('0x15'),_0x1bf75e);throw new Error(_0x6a9f('0x10'));}return _0x2c3ebe[_0x6a9f('0x13')]({'attributes':['id',_0x6a9f('0x16'),_0x6a9f('0x17'),_0x6a9f('0x18'),_0x6a9f('0x19'),_0x6a9f('0x1a'),_0x6a9f('0x1b'),_0x6a9f('0x1c'),_0x6a9f('0x1d')],'where':{'name':_0x1bf75e,'role':{'$or':[_0x6a9f('0x1e'),_0x6a9f('0x1f'),_0x6a9f('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x5b6d34){if(!_0x5b6d34||_0x5b6d34&&_0x5b6d34[_0x6a9f('0x16')]!==_0x1bf75e){throw new Error(_0x6a9f('0x10'));}_0x3599c9=_0x5b6d34;var _0x1812b0=_0x3599c9[_0x6a9f('0x16')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config['activedirectory'],_0x1812b0,_0x4f3eae);})[_0x6a9f('0x21')](function(_0x151322){if(_0x3599c9[_0x6a9f('0x1a')]){throw new Error(_0x6a9f('0x10'));}if(_0x5cad6b['blockDuration']>0x0){if(_0x3599c9[_0x6a9f('0x1b')]){if(moment(_0x3599c9[_0x6a9f('0x1c')])['add'](_0x5cad6b[_0x6a9f('0x22')],_0x6a9f('0x23'))>moment()){throw new Error(_0x6a9f('0x10'));}return utils['clearBlockUser'](_0x3599c9,0x0,![],null)[_0x6a9f('0x21')](function(){return utils[_0x6a9f('0x24')](_0x3599c9);})['then'](function(){return _0x4701c7(null,_0x3599c9);});}else{return utils[_0x6a9f('0x24')](_0x3599c9)[_0x6a9f('0x21')](function(){return _0x4701c7(null,_0x3599c9);});}}else{return utils[_0x6a9f('0x24')](_0x3599c9)['then'](function(){return _0x4701c7(null,_0x3599c9);});}})[_0x6a9f('0x25')](function(_0x2cf7e0){return _0x4701c7(null,![],_0x2cf7e0);});}function handleError(_0x23e6d7,_0x2ec519,_0x54e2be){return _0x23e6d7[_0x6a9f('0x26')](_0x2ec519||0x1f4)[_0x6a9f('0x27')]({'message':_0x54e2be?_0x54e2be[_0x6a9f('0x28')]||_0x54e2be:''});}exports['login']=function(_0x445749,_0x14bf92,_0x669a34){passport['authenticate'](_0x6a9f('0x29'),function(_0x20a7e3,_0x21c558,_0x17d799){var _0x876269=_0x20a7e3||_0x17d799;if(_0x876269){return handleError(_0x14bf92,0x191,_0x876269);}if(!_0x21c558){return handleError(_0x14bf92,0x194,{'message':_0x6a9f('0x2a')});}else{var _0x4b7e11={'payload':{'id':_0x21c558['id'],'role':_0x21c558[_0x6a9f('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x6a9f('0x2b')](_0x4b7e11)['then'](function(_0x257266){_0x14bf92[_0x6a9f('0x2c')]({'id':_0x21c558['id'],'token':_0x257266,'statusCall':'','isAlreadyLogged':_0x21c558[_0x6a9f('0x1d')]});});}})(_0x445749,_0x14bf92,_0x669a34);};passport['use'](_0x6a9f('0x29'),new LocalStrategy({'usernameField':_0x6a9f('0x16'),'passwordField':_0x6a9f('0x17')},function(_0x23e62b,_0x3b0f5d,_0x204cc9){return ActiveDirectoryAuthenticate(db['User'],_0x23e62b,_0x3b0f5d,_0x204cc9);}));
\ No newline at end of file
+var _0x0379=['online','admin','user','agent','blockDuration','add','minutes','clearBlockUser','then','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','baseDN','url','activedirectory','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','blockedAt'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x0379,0xe8));var _0x9037=function(_0x34b3b7,_0x50676a){_0x34b3b7=_0x34b3b7-0x0;var _0x3a3bc0=_0x0379[_0x34b3b7];return _0x3a3bc0;};'use strict';var passport=require(_0x9037('0x0'));var LocalStrategy=require(_0x9037('0x1'))['Strategy'];var moment=require(_0x9037('0x2'));var ActiveDirectory=require(_0x9037('0x3'));var BPromise=require('bluebird');var util=require(_0x9037('0x4'));var db=require(_0x9037('0x5'))['db'];var authService=require(_0x9037('0x6'));var utils=require(_0x9037('0x7'));var config=require(_0x9037('0x8'));var logger=require(_0x9037('0x9'))(_0x9037('0xa'));function isActiveDirectoryConfigured(_0x242bf7){var _0x584432=![];if(typeof _0x242bf7['activedirectory']!==_0x9037('0xb')){_0x584432=_0x242bf7['activedirectory'][_0x9037('0xc')]&&_0x242bf7['activedirectory'][_0x9037('0xd')]&&_0x242bf7[_0x9037('0xe')][_0x9037('0xf')];}return _0x584432;}function adAuthenticate(_0x287c43,_0x3d9379,_0x37c8ae){return new BPromise(function(_0x1956c3,_0x14182f){try{var _0x5e37f7=new ActiveDirectory(_0x287c43);_0x5e37f7[_0x9037('0x10')](_0x3d9379,_0x37c8ae,function(_0x3a01f1,_0x1e5b4e){if(_0x3a01f1){logger[_0x9037('0x11')](_0x9037('0x12'),_0x3d9379,util[_0x9037('0x13')](_0x3a01f1,{'showHidden':![],'depth':null}));_0x14182f(_0x9037('0x14'));}else if(!_0x1e5b4e){logger[_0x9037('0x11')](_0x9037('0x15'),_0x3d9379);_0x14182f(_0x9037('0x14'));}else{_0x1956c3(_0x1e5b4e);}});}catch(_0x33592e){_0x14182f(_0x33592e);}});}function ActiveDirectoryAuthenticate(_0x5ab5fc,_0x3994c0,_0x2be652,_0x47ac90){var _0x4684dc,_0x3f778e;if(!isActiveDirectoryConfigured(config)){logger[_0x9037('0x11')](_0x9037('0x16'),_0x3994c0);return _0x47ac90(null,![],{'message':_0x9037('0x14')});}return db[_0x9037('0x17')][_0x9037('0x18')]({'where':{'id':0x1},'attributes':[_0x9037('0x19'),'blockDuration'],'raw':!![]})['then'](function(_0x269d0c){_0x4684dc=_0x269d0c;if(!_0x4684dc[_0x9037('0x19')]){logger['error'](_0x9037('0x1a'),_0x3994c0);throw new Error(_0x9037('0x14'));}return _0x5ab5fc[_0x9037('0x18')]({'attributes':['id',_0x9037('0x1b'),_0x9037('0x1c'),'salt',_0x9037('0x1d'),_0x9037('0x1e'),_0x9037('0x1f'),_0x9037('0x20'),_0x9037('0x21')],'where':{'name':_0x3994c0,'role':{'$or':[_0x9037('0x22'),_0x9037('0x23'),_0x9037('0x24')]},'adSsoEnabled':!![]}});})['then'](function(_0x13a871){if(!_0x13a871||_0x13a871&&_0x13a871[_0x9037('0x1b')]!==_0x3994c0){throw new Error(_0x9037('0x14'));}_0x3f778e=_0x13a871;var _0x3931a3=_0x3f778e[_0x9037('0x1b')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config['activedirectory'],_0x3931a3,_0x2be652);})['then'](function(_0x3bc1e2){if(_0x3f778e['disabled']){throw new Error(_0x9037('0x14'));}if(_0x4684dc[_0x9037('0x25')]>0x0){if(_0x3f778e[_0x9037('0x1f')]){if(moment(_0x3f778e[_0x9037('0x20')])[_0x9037('0x26')](_0x4684dc[_0x9037('0x25')],_0x9037('0x27'))>moment()){throw new Error(_0x9037('0x14'));}return utils[_0x9037('0x28')](_0x3f778e,0x0,![],null)[_0x9037('0x29')](function(){return utils[_0x9037('0x2a')](_0x3f778e);})[_0x9037('0x29')](function(){return _0x47ac90(null,_0x3f778e);});}else{return utils[_0x9037('0x2a')](_0x3f778e)['then'](function(){return _0x47ac90(null,_0x3f778e);});}}else{return utils['getLicense'](_0x3f778e)['then'](function(){return _0x47ac90(null,_0x3f778e);});}})[_0x9037('0x2b')](function(_0x3209fe){return _0x47ac90(null,![],_0x3209fe);});}function handleError(_0x4c9f40,_0x3933bc,_0x481d52){return _0x4c9f40[_0x9037('0x2c')](_0x3933bc||0x1f4)[_0x9037('0x2d')]({'message':_0x481d52?_0x481d52[_0x9037('0x2e')]||_0x481d52:''});}exports['login']=function(_0x186ac4,_0x23bb11,_0x5db9d2){passport[_0x9037('0x10')](_0x9037('0x2f'),function(_0x3e308a,_0x172e26,_0x4c1632){var _0x312e5d=_0x3e308a||_0x4c1632;if(_0x312e5d){return handleError(_0x23bb11,0x191,_0x312e5d);}if(!_0x172e26){return handleError(_0x23bb11,0x194,{'message':_0x9037('0x30')});}else{var _0x5e42d0={'payload':{'id':_0x172e26['id'],'role':_0x172e26[_0x9037('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x9037('0x31')](_0x5e42d0)[_0x9037('0x29')](function(_0x27072c){_0x23bb11[_0x9037('0x32')]({'id':_0x172e26['id'],'token':_0x27072c,'statusCall':'','isAlreadyLogged':_0x172e26[_0x9037('0x21')]});});}})(_0x186ac4,_0x23bb11,_0x5db9d2);};passport[_0x9037('0x33')](_0x9037('0x2f'),new LocalStrategy({'usernameField':_0x9037('0x1b'),'passwordField':_0x9037('0x1c')},function(_0x120fc3,_0x1bed20,_0x17a299){return ActiveDirectoryAuthenticate(db[_0x9037('0x34')],_0x120fc3,_0x1bed20,_0x17a299);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index bb0817d..5d30086 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 _0xcb89=['exports','Router','login'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0xcb89,0x7f));var _0x9cb8=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xcb89[_0x4a747d];return _0x3a5b5c;};'use strict';var express=require('express');var router=express[_0x9cb8('0x0')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x9cb8('0x1')]);module[_0x9cb8('0x2')]=router;
\ No newline at end of file
+var _0xe3bf=['post','exports','Router'];(function(_0xd84e6b,_0x5cc379){var _0x361b16=function(_0x582b6a){while(--_0x582b6a){_0xd84e6b['push'](_0xd84e6b['shift']());}};_0x361b16(++_0x5cc379);}(_0xe3bf,0x1c4));var _0xfe3b=function(_0x15142f,_0x4f5528){_0x15142f=_0x15142f-0x0;var _0x5b83de=_0xe3bf[_0x15142f];return _0x5b83de;};'use strict';var express=require('express');var router=express[_0xfe3b('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xfe3b('0x1')]('/',controller['login']);module[_0xfe3b('0x2')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 4556987..0f24108 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7a54,0x106));var _0x47a5=function(_0x27a521,_0x345ca4){_0x27a521=_0x27a521-0x0;var _0x15097a=_0x7a54[_0x27a521];return _0x15097a;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x7a54,0x106));var _0x47a5=function(_0x3f0a1b,_0x1b3cb4){_0x3f0a1b=_0x3f0a1b-0x0;var _0x1d2feb=_0x7a54[_0x3f0a1b];return _0x1d2feb;};'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 35b8d11..14f0b09 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 _0x58d9=['callback','login','setTokenCookie','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback'];(function(_0x1895a9,_0x596414){var _0x1c1a43=function(_0x3eaef4){while(--_0x3eaef4){_0x1895a9['push'](_0x1895a9['shift']());}};_0x1c1a43(++_0x596414);}(_0x58d9,0xcb));var _0x958d=function(_0x224630,_0x3794f0){_0x224630=_0x224630-0x0;var _0x542038=_0x58d9[_0x224630];return _0x542038;};'use strict';var express=require(_0x958d('0x0'));var passport=require(_0x958d('0x1'));var router=express['Router']();var controller=require(_0x958d('0x2'));var userController=require(_0x958d('0x3'));var authService=require(_0x958d('0x4'));router[_0x958d('0x5')]('/',controller['login']);router[_0x958d('0x5')](_0x958d('0x6'),controller[_0x958d('0x7')],authService['isMiddleware'],userController[_0x958d('0x8')],authService[_0x958d('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0x1eb0=['./authGoogle.controller','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express','passport','Router'];(function(_0x17de24,_0x3c6c3c){var _0x4a7763=function(_0x56abe0){while(--_0x56abe0){_0x17de24['push'](_0x17de24['shift']());}};_0x4a7763(++_0x3c6c3c);}(_0x1eb0,0x13c));var _0x01eb=function(_0x5b3aef,_0x942b2c){_0x5b3aef=_0x5b3aef-0x0;var _0x2667b2=_0x1eb0[_0x5b3aef];return _0x2667b2;};'use strict';var express=require(_0x01eb('0x0'));var passport=require(_0x01eb('0x1'));var router=express[_0x01eb('0x2')]();var controller=require(_0x01eb('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x01eb('0x4')]('/',controller['login']);router[_0x01eb('0x4')](_0x01eb('0x5'),controller[_0x01eb('0x6')],authService[_0x01eb('0x7')],userController[_0x01eb('0x8')],authService[_0x01eb('0x9')]);module[_0x01eb('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 3811640..049cff7 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 _0x2093=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','forgot','body','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','previousPasswords','resetPasswordToken','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','blocked','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request'];(function(_0xa6f511,_0x3076df){var _0x30b918=function(_0x41f02c){while(--_0x41f02c){_0xa6f511['push'](_0xa6f511['shift']());}};_0x30b918(++_0x3076df);}(_0x2093,0x15a));var _0x3209=function(_0x5e9396,_0x161fdd){_0x5e9396=_0x5e9396-0x0;var _0x4172e3=_0x2093[_0x5e9396];return _0x4172e3;};'use strict';var util=require(_0x3209('0x0'));var passport=require(_0x3209('0x1'));var LocalStrategy=require(_0x3209('0x2'))['Strategy'];var jayson=require(_0x3209('0x3'));var _=require(_0x3209('0x4'));var rs=require(_0x3209('0x5'));var moment=require(_0x3209('0x6'));var db=require(_0x3209('0x7'))['db'];var authService=require(_0x3209('0x8'));var utils=require(_0x3209('0x9'));var client=jayson[_0x3209('0xa')][_0x3209('0xb')]({'port':0x232b});function localAuthenticate(_0x3041f7,_0x1ae0c4,_0x3e6ad6,_0x3b4f7a){var _0x52b234,_0x30b6dd;return db[_0x3209('0xc')][_0x3209('0xd')]({'where':{'id':0x1},'attributes':[_0x3209('0xe'),_0x3209('0xf')],'raw':!![]})[_0x3209('0x10')](function(_0x5a5068){_0x52b234=_0x5a5068;return _0x3041f7['findOne']({'attributes':['id',_0x3209('0x11'),_0x3209('0x12'),'salt','role','disabled',_0x3209('0x13'),_0x3209('0x14'),_0x3209('0x15')],'where':{'name':_0x1ae0c4,'role':{'$or':['admin',_0x3209('0x16'),_0x3209('0x17')]}}});})[_0x3209('0x10')](function(_0x165c25){if(!_0x165c25||_0x165c25&&_0x165c25['name']!==_0x1ae0c4){throw new Error(_0x3209('0x18'));}else{_0x30b6dd=_0x165c25;return _0x30b6dd;}})['then'](function(){_0x30b6dd[_0x3209('0x19')](_0x3e6ad6,function(_0x2d62b7,_0x11a3b1){var _0x5a5b96=_0x30b6dd[_0x3209('0x15')]+0x1;if(_0x2d62b7){return _0x3b4f7a(_0x2d62b7);}else if(!_0x11a3b1){if(_0x30b6dd['disabled']){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else if(_0x52b234[_0x3209('0xe')]>0x0){if(_0x30b6dd[_0x3209('0x13')]){if(_0x52b234[_0x3209('0xf')]>0x0){if(moment(_0x30b6dd[_0x3209('0x14')])[_0x3209('0x1a')](_0x52b234['blockDuration'],_0x3209('0x1b'))>moment()){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else{return utils[_0x3209('0x1c')](_0x30b6dd,_0x5a5b96,![],null)[_0x3209('0x10')](function(){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});});}}else{return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}}else{if(_0x5a5b96>=_0x52b234[_0x3209('0xe')]){return utils['clearBlockUser'](_0x30b6dd,0x0,!![],moment())[_0x3209('0x10')](function(){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});});}else{return utils[_0x3209('0x1c')](_0x30b6dd,_0x5a5b96,![],null)[_0x3209('0x10')](function(){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});});}}}else{return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}}else{if(_0x30b6dd[_0x3209('0x1d')]){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else if(_0x52b234['allowedLoginAttempts']>0x0){if(_0x30b6dd[_0x3209('0x13')]){if(_0x52b234[_0x3209('0xf')]>0x0){if(moment(_0x30b6dd[_0x3209('0x14')])[_0x3209('0x1a')](_0x52b234['blockDuration'],_0x3209('0x1b'))>moment()){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else{return utils['clearBlockUser'](_0x30b6dd,0x0,![],null)[_0x3209('0x10')](function(){return utils['getLicense'](_0x30b6dd);})[_0x3209('0x10')](function(){return _0x3b4f7a(null,_0x30b6dd);});}}else{return _0x3b4f7a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x30b6dd,0x0,![],null)[_0x3209('0x10')](function(){return utils[_0x3209('0x1e')](_0x30b6dd);})[_0x3209('0x10')](function(){return _0x3b4f7a(null,_0x30b6dd);})['catch'](function(_0x6fa4e6){return _0x3b4f7a(null,![],_0x6fa4e6);});}}else{if(_0x30b6dd['blocked']){return _0x3b4f7a(null,![],{'message':_0x3209('0x18')});}else{return utils[_0x3209('0x1e')](_0x30b6dd)['then'](function(){return _0x3b4f7a(null,_0x30b6dd);});}}}});})[_0x3209('0x1f')](function(_0xdb5ac3){return _0x3b4f7a(null,![],_0xdb5ac3);});}function sendServiceMail(_0x16644){return db[_0x3209('0x20')][_0x3209('0x21')]({'where':{'service':!![]},'attributes':['id',_0x3209('0x11'),_0x3209('0x22')],'include':[{'model':db[_0x3209('0x23')],'as':_0x3209('0x24'),'include':[{'model':db[_0x3209('0x25')],'as':'CloudProvider'}]}]})[_0x3209('0x10')](function(_0x358e17){if(!_0x358e17){throw new Error(_0x3209('0x26'));}var _0x3e33dd=_0x358e17[_0x3209('0x27')]();var _0x27f3f3={'account':_0x3e33dd,'message':_[_0x3209('0x28')]({'from':util[_0x3209('0x29')](_0x3209('0x2a'),_0x358e17[_0x3209('0x11')],_0x358e17[_0x3209('0x22')]||_0x358e17['Smtp'][_0x3209('0x16')])},_0x16644)};return client[_0x3209('0x2b')]('SendMail',_0x27f3f3);})[_0x3209('0x10')](function(_0x342b29){if(_0x342b29['error']){throw new Error(util['format'](_0x3209('0x2c'),_0x342b29[_0x3209('0x2d')][_0x3209('0x2e')]||JSON[_0x3209('0x2f')](_0x342b29[_0x3209('0x2d')])));}return!![];});}function handleError(_0x3e7eea,_0x4f4839,_0x5890c0){return _0x3e7eea[_0x3209('0x30')](_0x4f4839||0x1f4)[_0x3209('0x31')]({'message':_0x5890c0?_0x5890c0['message']||_0x5890c0:''});}exports[_0x3209('0x32')]=function(_0x44ee09,_0x1973c2,_0x176436){passport[_0x3209('0x19')](_0x3209('0x33'),function(_0x3ef77f,_0x1249db,_0x38fb0e){var _0x2f9fa4=_0x3ef77f||_0x38fb0e;if(_0x2f9fa4){return handleError(_0x1973c2,0x191,_0x2f9fa4);}if(!_0x1249db){return handleError(_0x1973c2,0x194,{'message':_0x3209('0x34')});}else{var _0x471b38={'payload':{'id':_0x1249db['id'],'role':_0x1249db[_0x3209('0x35')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x471b38)[_0x3209('0x10')](function(_0x284f8a){_0x1973c2[_0x3209('0x36')]({'id':_0x1249db['id'],'token':_0x284f8a,'statusCall':'','isAlreadyLogged':_0x1249db['online']});});}})(_0x44ee09,_0x1973c2,_0x176436);};exports[_0x3209('0x37')]=function(_0x41ee42,_0x347e8c){if(!_0x41ee42['body'][_0x3209('0x22')]){return handleError(_0x347e8c,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x218314=rs['generate']();_0x41ee42[_0x3209('0x38')][_0x3209('0x22')]=_0x41ee42[_0x3209('0x38')][_0x3209('0x22')]['trim']()['toLowerCase']();var _0xa092e9;return db[_0x3209('0xc')][_0x3209('0xd')]({'where':{'id':0x1},'attributes':[_0x3209('0xe'),_0x3209('0xf')],'raw':!![]})[_0x3209('0x10')](function(_0x35f4ed){_0xa092e9=_0x35f4ed;return db['User'][_0x3209('0x21')]({'where':{'email':_0x41ee42['body'][_0x3209('0x22')]}});})[_0x3209('0x10')](function(_0x1b6c9a){if(!_0x1b6c9a){throw new Error(_0x3209('0x39'));}if(_0x1b6c9a['disabled']){throw new Error(_0x3209('0x3a'));}if(_0x1b6c9a[_0x3209('0x13')]){if(moment(_0x1b6c9a[_0x3209('0x14')])[_0x3209('0x1a')](_0xa092e9['blockDuration'],_0x3209('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x1b6c9a['blocked']=![];_0x1b6c9a[_0x3209('0x14')]=null;}}_0x1b6c9a['resetPasswordToken']=_0x218314;_0x1b6c9a[_0x3209('0x3b')]=Date[_0x3209('0x3c')]()+0x36ee80;return _0x1b6c9a[_0x3209('0x3d')]();})['then'](function(){return sendServiceMail({'to':_0x41ee42['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x3209('0x3e')+_0x3209('0x3f')+_0x3209('0x40')+_0x41ee42[_0x3209('0x41')][_0x3209('0x42')]+'/reset/'+_0x218314+'\x0a\x0a'+_0x3209('0x43')});})[_0x3209('0x10')](function(){_0x347e8c[_0x3209('0x30')](0xc8)[_0x3209('0x31')]({'message':'Reset\x20Email\x20sent!'});})[_0x3209('0x1f')](function(_0x169535){return handleError(_0x347e8c,0x1f4,_0x169535);});};exports[_0x3209('0x44')]=function(_0x261df6,_0x133c4a){return db[_0x3209('0x45')][_0x3209('0x21')]({'where':{'resetPasswordToken':_0x261df6[_0x3209('0x46')][_0x3209('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3209('0x10')](function(_0x4e0337){if(!_0x4e0337){throw new Error(_0x3209('0x48'));}return db[_0x3209('0xc')][_0x3209('0xd')]({'attributes':['id',_0x3209('0x49'),'enforcePasswordHistory',_0x3209('0x4a')]})[_0x3209('0x10')](function(_0x2c95a1){if(_0x2c95a1[_0x3209('0x49')])authService['validatePasswordPattern'](_0x261df6[_0x3209('0x38')][_0x3209('0x12')]);if(!_0x2c95a1['enforcePasswordHistory']||!_0x4e0337[_0x3209('0x4b')])return _0x4e0337;authService['validatePasswordHistory'](_0x261df6[_0x3209('0x38')][_0x3209('0x12')],_0x4e0337[_0x3209('0x4b')],_0x2c95a1['passwordHistoryLimit']);return _0x4e0337;})[_0x3209('0x10')](function(){_0x4e0337['password']=_0x261df6['body']['password'];_0x4e0337[_0x3209('0x4c')]=null;_0x4e0337['resetPasswordExpires']=null;return _0x4e0337[_0x3209('0x3d')]();});})[_0x3209('0x10')](function(){_0x133c4a[_0x3209('0x30')](0xc8)[_0x3209('0x31')]({'message':'Password\x20reset!'});})[_0x3209('0x1f')](function(_0x1f3d7d){return handleError(_0x133c4a,0x1f4,_0x1f3d7d);});};passport[_0x3209('0x4d')](_0x3209('0x33'),new LocalStrategy({'usernameField':_0x3209('0x11'),'passwordField':_0x3209('0x12')},function(_0x8ee9ba,_0x5b42a5,_0x469335){return localAuthenticate(db[_0x3209('0x45')],_0x8ee9ba,_0x5b42a5,_0x469335);}));
\ No newline at end of file
+var _0x831b=['headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','client','http','Setting','allowedLoginAttempts','blockDuration','findOne','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','signToken','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x831b,0x160));var _0xb831=function(_0x16a5a4,_0x11b08e){_0x16a5a4=_0x16a5a4-0x0;var _0x37c973=_0x831b[_0x16a5a4];return _0x37c973;};'use strict';var util=require(_0xb831('0x0'));var passport=require(_0xb831('0x1'));var LocalStrategy=require(_0xb831('0x2'))[_0xb831('0x3')];var jayson=require(_0xb831('0x4'));var _=require(_0xb831('0x5'));var rs=require(_0xb831('0x6'));var moment=require(_0xb831('0x7'));var db=require(_0xb831('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xb831('0x9')][_0xb831('0xa')]({'port':0x232b});function localAuthenticate(_0x225b47,_0x4a2878,_0x1994ce,_0x1cb198){var _0x2934d4,_0x237d7a;return db[_0xb831('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xb831('0xc'),_0xb831('0xd')],'raw':!![]})['then'](function(_0x2b19c6){_0x2934d4=_0x2b19c6;return _0x225b47[_0xb831('0xe')]({'attributes':['id','name','password',_0xb831('0xf'),_0xb831('0x10'),_0xb831('0x11'),_0xb831('0x12'),_0xb831('0x13'),_0xb831('0x14')],'where':{'name':_0x4a2878,'role':{'$or':['admin',_0xb831('0x15'),_0xb831('0x16')]}}});})[_0xb831('0x17')](function(_0x4f96ae){if(!_0x4f96ae||_0x4f96ae&&_0x4f96ae['name']!==_0x4a2878){throw new Error(_0xb831('0x18'));}else{_0x237d7a=_0x4f96ae;return _0x237d7a;}})[_0xb831('0x17')](function(){_0x237d7a['authenticate'](_0x1994ce,function(_0xeb784e,_0x56d666){var _0x546074=_0x237d7a[_0xb831('0x14')]+0x1;if(_0xeb784e){return _0x1cb198(_0xeb784e);}else if(!_0x56d666){if(_0x237d7a[_0xb831('0x11')]){return _0x1cb198(null,![],{'message':_0xb831('0x18')});}else if(_0x2934d4['allowedLoginAttempts']>0x0){if(_0x237d7a[_0xb831('0x12')]){if(_0x2934d4['blockDuration']>0x0){if(moment(_0x237d7a['blockedAt'])[_0xb831('0x19')](_0x2934d4[_0xb831('0xd')],_0xb831('0x1a'))>moment()){return _0x1cb198(null,![],{'message':_0xb831('0x18')});}else{return utils['clearBlockUser'](_0x237d7a,_0x546074,![],null)['then'](function(){return _0x1cb198(null,![],{'message':_0xb831('0x18')});});}}else{return _0x1cb198(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x546074>=_0x2934d4[_0xb831('0xc')]){return utils[_0xb831('0x1b')](_0x237d7a,0x0,!![],moment())[_0xb831('0x17')](function(){return _0x1cb198(null,![],{'message':_0xb831('0x18')});});}else{return utils[_0xb831('0x1b')](_0x237d7a,_0x546074,![],null)['then'](function(){return _0x1cb198(null,![],{'message':_0xb831('0x18')});});}}}else{return _0x1cb198(null,![],{'message':_0xb831('0x18')});}}else{if(_0x237d7a[_0xb831('0x11')]){return _0x1cb198(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2934d4[_0xb831('0xc')]>0x0){if(_0x237d7a[_0xb831('0x12')]){if(_0x2934d4['blockDuration']>0x0){if(moment(_0x237d7a[_0xb831('0x13')])[_0xb831('0x19')](_0x2934d4[_0xb831('0xd')],_0xb831('0x1a'))>moment()){return _0x1cb198(null,![],{'message':_0xb831('0x18')});}else{return utils[_0xb831('0x1b')](_0x237d7a,0x0,![],null)['then'](function(){return utils['getLicense'](_0x237d7a);})[_0xb831('0x17')](function(){return _0x1cb198(null,_0x237d7a);});}}else{return _0x1cb198(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x237d7a,0x0,![],null)[_0xb831('0x17')](function(){return utils[_0xb831('0x1c')](_0x237d7a);})['then'](function(){return _0x1cb198(null,_0x237d7a);})[_0xb831('0x1d')](function(_0x4e9dca){return _0x1cb198(null,![],_0x4e9dca);});}}else{if(_0x237d7a['blocked']){return _0x1cb198(null,![],{'message':_0xb831('0x18')});}else{return utils[_0xb831('0x1c')](_0x237d7a)[_0xb831('0x17')](function(){return _0x1cb198(null,_0x237d7a);});}}}});})[_0xb831('0x1d')](function(_0x2e26d4){return _0x1cb198(null,![],_0x2e26d4);});}function sendServiceMail(_0x230e5d){return db[_0xb831('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xb831('0x1f'),_0xb831('0x20')],'include':[{'model':db[_0xb831('0x21')],'as':_0xb831('0x22'),'include':[{'model':db['CloudProvider'],'as':_0xb831('0x23')}]}]})[_0xb831('0x17')](function(_0x349088){if(!_0x349088){throw new Error(_0xb831('0x24'));}var _0x1b9c76=_0x349088['getSmtpOptions']();var _0x52332b={'account':_0x1b9c76,'message':_[_0xb831('0x25')]({'from':util[_0xb831('0x26')]('\x22%s\x22\x20<%s>',_0x349088[_0xb831('0x1f')],_0x349088[_0xb831('0x20')]||_0x349088[_0xb831('0x22')]['user'])},_0x230e5d)};return client[_0xb831('0x27')](_0xb831('0x28'),_0x52332b);})[_0xb831('0x17')](function(_0x3c6dfd){if(_0x3c6dfd[_0xb831('0x29')]){throw new Error(util[_0xb831('0x26')](_0xb831('0x2a'),_0x3c6dfd[_0xb831('0x29')][_0xb831('0x2b')]||JSON[_0xb831('0x2c')](_0x3c6dfd['error'])));}return!![];});}function handleError(_0x4a9c2c,_0x42edd1,_0x1476f8){return _0x4a9c2c[_0xb831('0x2d')](_0x42edd1||0x1f4)[_0xb831('0x2e')]({'message':_0x1476f8?_0x1476f8['message']||_0x1476f8:''});}exports[_0xb831('0x2f')]=function(_0x407557,_0x10f495,_0xe46518){passport[_0xb831('0x30')](_0xb831('0x31'),function(_0x4d98c0,_0x245753,_0x52e700){var _0x373b7b=_0x4d98c0||_0x52e700;if(_0x373b7b){return handleError(_0x10f495,0x191,_0x373b7b);}if(!_0x245753){return handleError(_0x10f495,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2bd936={'payload':{'id':_0x245753['id'],'role':_0x245753['role']},'options':{'expiresIn':0x15180}};return authService[_0xb831('0x32')](_0x2bd936)[_0xb831('0x17')](function(_0x659f8f){_0x10f495['json']({'id':_0x245753['id'],'token':_0x659f8f,'statusCall':'','isAlreadyLogged':_0x245753[_0xb831('0x33')]});});}})(_0x407557,_0x10f495,_0xe46518);};exports['forgot']=function(_0x1d1dc5,_0x4533b3){if(!_0x1d1dc5[_0xb831('0x34')][_0xb831('0x20')]){return handleError(_0x4533b3,0x1f4,{'message':_0xb831('0x35')});}var _0x2c6d10=rs['generate']();_0x1d1dc5[_0xb831('0x34')][_0xb831('0x20')]=_0x1d1dc5['body'][_0xb831('0x20')][_0xb831('0x36')]()[_0xb831('0x37')]();var _0x347d82;return db[_0xb831('0xb')][_0xb831('0xe')]({'where':{'id':0x1},'attributes':[_0xb831('0xc'),_0xb831('0xd')],'raw':!![]})[_0xb831('0x17')](function(_0x525a96){_0x347d82=_0x525a96;return db[_0xb831('0x38')][_0xb831('0x39')]({'where':{'email':_0x1d1dc5[_0xb831('0x34')][_0xb831('0x20')]}});})[_0xb831('0x17')](function(_0x25b6f6){if(!_0x25b6f6){throw new Error(_0xb831('0x3a'));}if(_0x25b6f6[_0xb831('0x11')]){throw new Error(_0xb831('0x3b'));}if(_0x25b6f6[_0xb831('0x12')]){if(moment(_0x25b6f6['blockedAt'])[_0xb831('0x19')](_0x347d82[_0xb831('0xd')],_0xb831('0x1a'))>moment()){throw new Error(_0xb831('0x3c'));}else{_0x25b6f6[_0xb831('0x12')]=![];_0x25b6f6['blockedAt']=null;}}_0x25b6f6[_0xb831('0x3d')]=_0x2c6d10;_0x25b6f6[_0xb831('0x3e')]=Date[_0xb831('0x3f')]()+0x36ee80;return _0x25b6f6[_0xb831('0x40')]();})[_0xb831('0x17')](function(){return sendServiceMail({'to':_0x1d1dc5['body']['email'],'subject':_0xb831('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xb831('0x42')+_0xb831('0x43')+_0x1d1dc5[_0xb831('0x44')][_0xb831('0x45')]+_0xb831('0x46')+_0x2c6d10+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xb831('0x17')](function(){_0x4533b3[_0xb831('0x2d')](0xc8)[_0xb831('0x2e')]({'message':_0xb831('0x47')});})[_0xb831('0x1d')](function(_0x210596){return handleError(_0x4533b3,0x1f4,_0x210596);});};exports[_0xb831('0x48')]=function(_0x3dcf8e,_0x5537d7){return db[_0xb831('0x38')][_0xb831('0x39')]({'where':{'resetPasswordToken':_0x3dcf8e[_0xb831('0x49')][_0xb831('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xb831('0x3f')]()}}})['then'](function(_0x46996d){if(!_0x46996d){throw new Error(_0xb831('0x4b'));}return db['Setting']['findOne']({'attributes':['id',_0xb831('0x4c'),_0xb831('0x4d'),'passwordHistoryLimit']})[_0xb831('0x17')](function(_0x31a108){if(_0x31a108[_0xb831('0x4c')])authService[_0xb831('0x4e')](_0x3dcf8e[_0xb831('0x34')][_0xb831('0x4f')]);if(!_0x31a108[_0xb831('0x4d')]||!_0x46996d[_0xb831('0x50')])return _0x46996d;authService['validatePasswordHistory'](_0x3dcf8e['body'][_0xb831('0x4f')],_0x46996d['previousPasswords'],_0x31a108[_0xb831('0x51')]);return _0x46996d;})[_0xb831('0x17')](function(){_0x46996d[_0xb831('0x4f')]=_0x3dcf8e['body'][_0xb831('0x4f')];_0x46996d['resetPasswordToken']=null;_0x46996d[_0xb831('0x3e')]=null;return _0x46996d[_0xb831('0x40')]();});})[_0xb831('0x17')](function(){_0x5537d7['status'](0xc8)[_0xb831('0x2e')]({'message':_0xb831('0x52')});})[_0xb831('0x1d')](function(_0x4e3c80){return handleError(_0x5537d7,0x1f4,_0x4e3c80);});};passport[_0xb831('0x53')](_0xb831('0x31'),new LocalStrategy({'usernameField':'name','passwordField':_0xb831('0x4f')},function(_0xd89517,_0x174860,_0x43dc4e){return localAuthenticate(db[_0xb831('0x38')],_0xd89517,_0x174860,_0x43dc4e);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 4cda27c..5ddc9da 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 _0x0b98=['express','login','post','/reset/:token','reset','exports'];(function(_0xcb4c7a,_0x2bf5ae){var _0x2f7d2b=function(_0x56a2e7){while(--_0x56a2e7){_0xcb4c7a['push'](_0xcb4c7a['shift']());}};_0x2f7d2b(++_0x2bf5ae);}(_0x0b98,0x1ec));var _0x80b9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b98[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x80b9('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x80b9('0x1')]);router[_0x80b9('0x2')]('/forgot',controller['forgot']);router['post'](_0x80b9('0x3'),controller[_0x80b9('0x4')]);module[_0x80b9('0x5')]=router;
\ No newline at end of file
+var _0x340e=['Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x1b3aa,_0x2021e6){var _0x54cc7e=function(_0x337ca0){while(--_0x337ca0){_0x1b3aa['push'](_0x1b3aa['shift']());}};_0x54cc7e(++_0x2021e6);}(_0x340e,0x143));var _0xe340=function(_0x3e78f9,_0x3b02d0){_0x3e78f9=_0x3e78f9-0x0;var _0x5ce93a=_0x340e[_0x3e78f9];return _0x5ce93a;};'use strict';var express=require(_0xe340('0x0'));var router=express[_0xe340('0x1')]();var controller=require(_0xe340('0x2'));router[_0xe340('0x3')]('/',controller['login']);router[_0xe340('0x3')](_0xe340('0x4'),controller[_0xe340('0x5')]);router[_0xe340('0x3')](_0xe340('0x6'),controller[_0xe340('0x7')]);module[_0xe340('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index dce1bfb..325f39e 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 _0x122c=['BOOLEAN','sequelize','STRING'];(function(_0xcedbfd,_0x172f2e){var _0x21f6d0=function(_0x706d0){while(--_0x706d0){_0xcedbfd['push'](_0xcedbfd['shift']());}};_0x21f6d0(++_0x172f2e);}(_0x122c,0xbe));var _0xc122=function(_0x3e53ef,_0xefde57){_0x3e53ef=_0x3e53ef-0x0;var _0x503717=_0x122c[_0x3e53ef];return _0x503717;};'use strict';var Sequelize=require(_0xc122('0x0'));module['exports']={'name':{'type':Sequelize[_0xc122('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc122('0x1')]},'status':{'type':Sequelize[_0xc122('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0xfa62=['BOOLEAN','exports','STRING'];(function(_0x20905d,_0x386604){var _0x1f13f5=function(_0x2e48a7){while(--_0x2e48a7){_0x20905d['push'](_0x20905d['shift']());}};_0x1f13f5(++_0x386604);}(_0xfa62,0x70));var _0x2fa6=function(_0x4726ba,_0x1fb419){_0x4726ba=_0x4726ba-0x0;var _0x487f5b=_0xfa62[_0x4726ba];return _0x487f5b;};'use strict';var Sequelize=require('sequelize');module[_0x2fa6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fa6('0x1')]},'status':{'type':Sequelize[_0x2fa6('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 8615b77..9950627 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 _0xff41=['apply','reject','save','destroy','then','error','name','send','map','Automation','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','addConditions','getConditions','findOne','Condition','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xff41,0x12d));var _0x1ff4=function(_0x5dffaa,_0x2e2073){_0x5dffaa=_0x5dffaa-0x0;var _0x6b79f8=_0xff41[_0x5dffaa];return _0x6b79f8;};'use strict';var emlformat=require(_0x1ff4('0x0'));var rimraf=require(_0x1ff4('0x1'));var zipdir=require(_0x1ff4('0x2'));var jsonpatch=require(_0x1ff4('0x3'));var rp=require(_0x1ff4('0x4'));var moment=require(_0x1ff4('0x5'));var BPromise=require(_0x1ff4('0x6'));var Mustache=require('mustache');var util=require(_0x1ff4('0x7'));var path=require('path');var sox=require(_0x1ff4('0x8'));var csv=require(_0x1ff4('0x9'));var ejs=require(_0x1ff4('0xa'));var fs=require('fs');var fs_extra=require(_0x1ff4('0xb'));var _=require(_0x1ff4('0xc'));var squel=require(_0x1ff4('0xd'));var crypto=require(_0x1ff4('0xe'));var jsforce=require(_0x1ff4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1ff4('0x9'));var querystring=require(_0x1ff4('0x10'));var Papa=require(_0x1ff4('0x11'));var Redis=require('ioredis');var authService=require(_0x1ff4('0x12'));var qs=require(_0x1ff4('0x13'));var as=require(_0x1ff4('0x14'));var hardwareService=require(_0x1ff4('0x15'));var logger=require('../../config/logger')(_0x1ff4('0x16'));var utils=require(_0x1ff4('0x17'));var config=require(_0x1ff4('0x18'));var licenseUtil=require(_0x1ff4('0x19'));var db=require(_0x1ff4('0x1a'))['db'];function respondWithStatusCode(_0xd7152f,_0x21ebe1){_0x21ebe1=_0x21ebe1||0xcc;return function(_0x49ebc2){if(_0x49ebc2){return _0xd7152f[_0x1ff4('0x1b')](_0x21ebe1);}return _0xd7152f['status'](_0x21ebe1)[_0x1ff4('0x1c')]();};}function respondWithResult(_0x3834b6,_0x40aebe){_0x40aebe=_0x40aebe||0xc8;return function(_0x303710){if(_0x303710){return _0x3834b6[_0x1ff4('0x1d')](_0x40aebe)[_0x1ff4('0x1e')](_0x303710);}};}function respondWithFilteredResult(_0x39fc4a,_0x1a157c){return function(_0x1d6c22){if(_0x1d6c22){var _0x1361e1=typeof _0x1a157c['offset']===_0x1ff4('0x1f')&&typeof _0x1a157c['limit']===_0x1ff4('0x1f');var _0x24ec8f=_0x1d6c22[_0x1ff4('0x20')];var _0x36a6e3=_0x1361e1?0x0:_0x1a157c[_0x1ff4('0x21')];var _0x5eb2da=_0x1361e1?_0x1d6c22[_0x1ff4('0x20')]:_0x1a157c[_0x1ff4('0x21')]+_0x1a157c[_0x1ff4('0x22')];var _0x19bbd4;if(_0x5eb2da>=_0x24ec8f){_0x5eb2da=_0x24ec8f;_0x19bbd4=0xc8;}else{_0x19bbd4=0xce;}_0x39fc4a['status'](_0x19bbd4);return _0x39fc4a['set']('Content-Range',_0x36a6e3+'-'+_0x5eb2da+'/'+_0x24ec8f)['json'](_0x1d6c22);}return null;};}function patchUpdates(_0x19c838){return function(_0x39795e){try{jsonpatch[_0x1ff4('0x23')](_0x39795e,_0x19c838,!![]);}catch(_0x469b30){return BPromise[_0x1ff4('0x24')](_0x469b30);}return _0x39795e[_0x1ff4('0x25')]();};}function saveUpdates(_0x146e80,_0x2df35a){return function(_0x1b56c9){if(_0x1b56c9){return _0x1b56c9['update'](_0x146e80)['then'](function(_0x4caf57){return _0x4caf57;});}return null;};}function removeEntity(_0x4a55b5,_0x501fdc){return function(_0x27e053){if(_0x27e053){return _0x27e053[_0x1ff4('0x26')]()[_0x1ff4('0x27')](function(){_0x4a55b5[_0x1ff4('0x1d')](0xcc)[_0x1ff4('0x1c')]();});}};}function handleEntityNotFound(_0x45e2de,_0x3de1c9){return function(_0x2d5605){if(!_0x2d5605){_0x45e2de['sendStatus'](0x194);}return _0x2d5605;};}function handleError(_0x396690,_0x141cc1){_0x141cc1=_0x141cc1||0x1f4;return function(_0x7fd279){logger[_0x1ff4('0x28')](_0x7fd279['stack']);if(_0x7fd279[_0x1ff4('0x29')]){delete _0x7fd279[_0x1ff4('0x29')];}_0x396690['status'](_0x141cc1)[_0x1ff4('0x2a')](_0x7fd279);};}exports['index']=function(_0x2495f6,_0x16a4e8){var _0x4c7305={},_0xb5331f={},_0x50faff={'count':0x0,'rows':[]};var _0x19113=_[_0x1ff4('0x2b')](db[_0x1ff4('0x2c')][_0x1ff4('0x2d')],function(_0x6bafce){return{'name':_0x6bafce[_0x1ff4('0x2e')],'type':_0x6bafce[_0x1ff4('0x2f')]['key']};});_0xb5331f[_0x1ff4('0x30')]=_[_0x1ff4('0x2b')](_0x19113,_0x1ff4('0x29'));_0xb5331f['query']=_[_0x1ff4('0x31')](_0x2495f6[_0x1ff4('0x32')]);_0xb5331f[_0x1ff4('0x33')]=_['intersection'](_0xb5331f[_0x1ff4('0x30')],_0xb5331f['query']);_0x4c7305['attributes']=_[_0x1ff4('0x34')](_0xb5331f[_0x1ff4('0x30')],qs[_0x1ff4('0x35')](_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x35')]));_0x4c7305['attributes']=_0x4c7305[_0x1ff4('0x36')]['length']?_0x4c7305['attributes']:_0xb5331f[_0x1ff4('0x30')];if(!_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x37')](_0x1ff4('0x38'))){_0x4c7305[_0x1ff4('0x22')]=qs[_0x1ff4('0x22')](_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x22')]);_0x4c7305[_0x1ff4('0x21')]=qs[_0x1ff4('0x21')](_0x2495f6['query']['offset']);}_0x4c7305[_0x1ff4('0x39')]=qs[_0x1ff4('0x3a')](_0x2495f6[_0x1ff4('0x32')]['sort']);_0x4c7305['where']=qs[_0x1ff4('0x33')](_[_0x1ff4('0x3b')](_0x2495f6['query'],_0xb5331f[_0x1ff4('0x33')]),_0x19113);if(_0x2495f6['query'][_0x1ff4('0x3c')]){_0x4c7305[_0x1ff4('0x3d')]=_[_0x1ff4('0x3e')](_0x4c7305['where'],{'$or':_[_0x1ff4('0x2b')](_0x19113,function(_0x435822){if(_0x435822['type']!==_0x1ff4('0x3f')){var _0x46ed66={};_0x46ed66[_0x435822[_0x1ff4('0x29')]]={'$like':'%'+_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x3c')]+'%'};return _0x46ed66;}})});}_0x4c7305=_['merge']({},_0x4c7305,_0x2495f6[_0x1ff4('0x40')]);var _0x23f970={'where':_0x4c7305[_0x1ff4('0x3d')]};return db[_0x1ff4('0x2c')]['count'](_0x23f970)['then'](function(_0x3d6283){_0x50faff['count']=_0x3d6283;if(_0x2495f6[_0x1ff4('0x32')][_0x1ff4('0x41')]){_0x4c7305[_0x1ff4('0x42')]=[{'all':!![]}];}return db[_0x1ff4('0x2c')][_0x1ff4('0x43')](_0x4c7305);})[_0x1ff4('0x27')](function(_0x3fe528){_0x50faff[_0x1ff4('0x44')]=_0x3fe528;return _0x50faff;})[_0x1ff4('0x27')](respondWithFilteredResult(_0x16a4e8,_0x4c7305))[_0x1ff4('0x45')](handleError(_0x16a4e8,null));};exports[_0x1ff4('0x46')]=function(_0x10ecc4,_0x32658d){var _0x29ca1a={'raw':![],'where':{'id':_0x10ecc4[_0x1ff4('0x47')]['id']}},_0x3abaf5={};_0x3abaf5[_0x1ff4('0x30')]=_['keys'](db[_0x1ff4('0x2c')][_0x1ff4('0x2d')]);_0x3abaf5[_0x1ff4('0x32')]=_['keys'](_0x10ecc4[_0x1ff4('0x32')]);_0x3abaf5['filters']=_['intersection'](_0x3abaf5[_0x1ff4('0x30')],_0x3abaf5['query']);_0x29ca1a['attributes']=_['intersection'](_0x3abaf5['model'],qs[_0x1ff4('0x35')](_0x10ecc4[_0x1ff4('0x32')]['fields']));_0x29ca1a[_0x1ff4('0x36')]=_0x29ca1a['attributes'][_0x1ff4('0x48')]?_0x29ca1a['attributes']:_0x3abaf5['model'];if(_0x10ecc4['query'][_0x1ff4('0x41')]){_0x29ca1a[_0x1ff4('0x42')]=[{'all':!![]}];}_0x29ca1a=_['merge']({},_0x29ca1a,_0x10ecc4[_0x1ff4('0x40')]);return db[_0x1ff4('0x2c')][_0x1ff4('0x49')](_0x29ca1a)[_0x1ff4('0x27')](handleEntityNotFound(_0x32658d,null))[_0x1ff4('0x27')](respondWithResult(_0x32658d,null))[_0x1ff4('0x45')](handleError(_0x32658d,null));};exports[_0x1ff4('0x4a')]=function(_0x59672c,_0x50f21e){return db[_0x1ff4('0x2c')][_0x1ff4('0x4a')](_0x59672c[_0x1ff4('0x4b')],{})[_0x1ff4('0x27')](respondWithResult(_0x50f21e,0xc9))[_0x1ff4('0x45')](handleError(_0x50f21e,null));};exports['update']=function(_0x312bf3,_0x162635){if(_0x312bf3[_0x1ff4('0x4b')]['id']){delete _0x312bf3[_0x1ff4('0x4b')]['id'];}return db[_0x1ff4('0x2c')][_0x1ff4('0x49')]({'where':{'id':_0x312bf3[_0x1ff4('0x47')]['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0x162635,null))[_0x1ff4('0x27')](saveUpdates(_0x312bf3[_0x1ff4('0x4b')],null))[_0x1ff4('0x27')](respondWithResult(_0x162635,null))[_0x1ff4('0x45')](handleError(_0x162635,null));};exports[_0x1ff4('0x26')]=function(_0x20dbde,_0x24fcf8){return db[_0x1ff4('0x2c')][_0x1ff4('0x49')]({'where':{'id':_0x20dbde[_0x1ff4('0x47')]['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0x24fcf8,null))[_0x1ff4('0x27')](removeEntity(_0x24fcf8,null))[_0x1ff4('0x45')](handleError(_0x24fcf8,null));};exports[_0x1ff4('0x4c')]=function(_0x2352b6,_0x2f2170,_0x5dfdd2){return db['Condition'][_0x1ff4('0x49')]({'where':{'id':_0x2352b6['params']['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0x2f2170,null))[_0x1ff4('0x27')](function(_0x51f5df){if(_0x51f5df){return _0x51f5df[_0x1ff4('0x4c')](_0x2352b6[_0x1ff4('0x4b')]['ids'],_['omit'](_0x2352b6[_0x1ff4('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x2f2170,null))[_0x1ff4('0x45')](handleError(_0x2f2170,null));};exports[_0x1ff4('0x4d')]=function(_0x33b43a,_0x707726,_0x1ba19b){var _0x2d244b={};var _0x373eb3={};var _0x380f26;var _0x50163c;return db[_0x1ff4('0x2c')][_0x1ff4('0x4e')]({'where':{'id':_0x33b43a[_0x1ff4('0x47')]['id']}})['then'](handleEntityNotFound(_0x707726,null))[_0x1ff4('0x27')](function(_0x4db03){if(_0x4db03){_0x380f26=_0x4db03;_0x373eb3[_0x1ff4('0x30')]=_[_0x1ff4('0x31')](db[_0x1ff4('0x4f')]['rawAttributes']);_0x373eb3[_0x1ff4('0x32')]=_[_0x1ff4('0x31')](_0x33b43a[_0x1ff4('0x32')]);_0x373eb3[_0x1ff4('0x33')]=_[_0x1ff4('0x34')](_0x373eb3[_0x1ff4('0x30')],_0x373eb3['query']);_0x2d244b['attributes']=_['intersection'](_0x373eb3[_0x1ff4('0x30')],qs[_0x1ff4('0x35')](_0x33b43a['query']['fields']));_0x2d244b['attributes']=_0x2d244b[_0x1ff4('0x36')]['length']?_0x2d244b[_0x1ff4('0x36')]:_0x373eb3[_0x1ff4('0x30')];_0x2d244b[_0x1ff4('0x39')]=qs['sort'](_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x3a')]);_0x2d244b[_0x1ff4('0x3d')]=qs['filters'](_['pick'](_0x33b43a[_0x1ff4('0x32')],_0x373eb3[_0x1ff4('0x33')]));if(_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x3c')]){_0x2d244b['where']=_[_0x1ff4('0x3e')](_0x2d244b['where'],{'$or':_[_0x1ff4('0x2b')](_0x2d244b['attributes'],function(_0x4a2625){var _0x460d4d={};_0x460d4d[_0x4a2625]={'$like':'%'+_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x3c')]+'%'};return _0x460d4d;})});}_0x2d244b=_[_0x1ff4('0x3e')]({},_0x2d244b,_0x33b43a[_0x1ff4('0x40')]);return _0x380f26[_0x1ff4('0x4d')](_0x2d244b);}})[_0x1ff4('0x27')](function(_0x5a39e4){if(_0x5a39e4){_0x50163c=_0x5a39e4[_0x1ff4('0x48')];if(!_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x37')](_0x1ff4('0x38'))){_0x2d244b[_0x1ff4('0x22')]=qs[_0x1ff4('0x22')](_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x22')]);_0x2d244b[_0x1ff4('0x21')]=qs['offset'](_0x33b43a[_0x1ff4('0x32')][_0x1ff4('0x21')]);}return _0x380f26[_0x1ff4('0x4d')](_0x2d244b);}})[_0x1ff4('0x27')](function(_0x1dce9){if(_0x1dce9){return _0x1dce9?{'count':_0x50163c,'rows':_0x1dce9}:null;}})[_0x1ff4('0x27')](respondWithResult(_0x707726,null))['catch'](handleError(_0x707726,null));};exports[_0x1ff4('0x50')]=function(_0x59b074,_0xb3d3f5,_0x473ee1){return db[_0x1ff4('0x51')][_0x1ff4('0x49')]({'where':{'id':_0x59b074['params']['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0xb3d3f5,null))[_0x1ff4('0x27')](function(_0x8fcc21){if(_0x8fcc21){return _0x8fcc21[_0x1ff4('0x50')](_0x59b074[_0x1ff4('0x4b')]['ids'],_[_0x1ff4('0x52')](_0x59b074[_0x1ff4('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0xb3d3f5,null))[_0x1ff4('0x45')](handleError(_0xb3d3f5,null));};exports[_0x1ff4('0x53')]=function(_0x44ce4b,_0x54e2f5,_0x282582){var _0xdc6611={};var _0x2faa1e={};var _0x3357b1;var _0x38ff69;return db[_0x1ff4('0x2c')][_0x1ff4('0x4e')]({'where':{'id':_0x44ce4b[_0x1ff4('0x47')]['id']}})[_0x1ff4('0x27')](handleEntityNotFound(_0x54e2f5,null))[_0x1ff4('0x27')](function(_0x4eb744){if(_0x4eb744){_0x3357b1=_0x4eb744;_0x2faa1e['model']=_['keys'](db[_0x1ff4('0x51')][_0x1ff4('0x2d')]);_0x2faa1e[_0x1ff4('0x32')]=_['keys'](_0x44ce4b[_0x1ff4('0x32')]);_0x2faa1e[_0x1ff4('0x33')]=_[_0x1ff4('0x34')](_0x2faa1e[_0x1ff4('0x30')],_0x2faa1e[_0x1ff4('0x32')]);_0xdc6611[_0x1ff4('0x36')]=_[_0x1ff4('0x34')](_0x2faa1e[_0x1ff4('0x30')],qs[_0x1ff4('0x35')](_0x44ce4b['query'][_0x1ff4('0x35')]));_0xdc6611[_0x1ff4('0x36')]=_0xdc6611['attributes'][_0x1ff4('0x48')]?_0xdc6611[_0x1ff4('0x36')]:_0x2faa1e[_0x1ff4('0x30')];_0xdc6611['order']=qs[_0x1ff4('0x3a')](_0x44ce4b['query'][_0x1ff4('0x3a')]);_0xdc6611[_0x1ff4('0x3d')]=qs['filters'](_[_0x1ff4('0x3b')](_0x44ce4b[_0x1ff4('0x32')],_0x2faa1e[_0x1ff4('0x33')]));if(_0x44ce4b[_0x1ff4('0x32')][_0x1ff4('0x3c')]){_0xdc6611['where']=_['merge'](_0xdc6611['where'],{'$or':_[_0x1ff4('0x2b')](_0xdc6611[_0x1ff4('0x36')],function(_0x5f1935){var _0x5ffcbd={};_0x5ffcbd[_0x5f1935]={'$like':'%'+_0x44ce4b[_0x1ff4('0x32')]['filter']+'%'};return _0x5ffcbd;})});}_0xdc6611=_[_0x1ff4('0x3e')]({},_0xdc6611,_0x44ce4b[_0x1ff4('0x40')]);return _0x3357b1[_0x1ff4('0x53')](_0xdc6611);}})[_0x1ff4('0x27')](function(_0x1206a1){if(_0x1206a1){_0x38ff69=_0x1206a1[_0x1ff4('0x48')];if(!_0x44ce4b[_0x1ff4('0x32')][_0x1ff4('0x37')](_0x1ff4('0x38'))){_0xdc6611[_0x1ff4('0x22')]=qs[_0x1ff4('0x22')](_0x44ce4b[_0x1ff4('0x32')][_0x1ff4('0x22')]);_0xdc6611[_0x1ff4('0x21')]=qs[_0x1ff4('0x21')](_0x44ce4b[_0x1ff4('0x32')]['offset']);}return _0x3357b1['getActions'](_0xdc6611);}})[_0x1ff4('0x27')](function(_0x217910){if(_0x217910){return _0x217910?{'count':_0x38ff69,'rows':_0x217910}:null;}})[_0x1ff4('0x27')](respondWithResult(_0x54e2f5,null))[_0x1ff4('0x45')](handleError(_0x54e2f5,null));};
\ No newline at end of file
+var _0xe6e9=['fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Automation','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','params','find','Condition','ids','omit','getConditions','findOne','rawAttributes','length','nolimit','addActions','getActions','Action','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x4299d2,_0x596d09){var _0x1eb86b=function(_0xbc174){while(--_0xbc174){_0x4299d2['push'](_0x4299d2['shift']());}};_0x1eb86b(++_0x596d09);}(_0xe6e9,0xfa));var _0x9e6e=function(_0x520bb6,_0x187d86){_0x520bb6=_0x520bb6-0x0;var _0x2a560d=_0xe6e9[_0x520bb6];return _0x2a560d;};'use strict';var emlformat=require(_0x9e6e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9e6e('0x1'));var rp=require(_0x9e6e('0x2'));var moment=require(_0x9e6e('0x3'));var BPromise=require(_0x9e6e('0x4'));var Mustache=require(_0x9e6e('0x5'));var util=require(_0x9e6e('0x6'));var path=require(_0x9e6e('0x7'));var sox=require(_0x9e6e('0x8'));var csv=require(_0x9e6e('0x9'));var ejs=require(_0x9e6e('0xa'));var fs=require('fs');var fs_extra=require(_0x9e6e('0xb'));var _=require('lodash');var squel=require(_0x9e6e('0xc'));var crypto=require(_0x9e6e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9e6e('0xe'));var toCsv=require(_0x9e6e('0x9'));var querystring=require(_0x9e6e('0xf'));var Papa=require('papaparse');var Redis=require(_0x9e6e('0x10'));var authService=require(_0x9e6e('0x11'));var qs=require(_0x9e6e('0x12'));var as=require(_0x9e6e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e6e('0x14'))(_0x9e6e('0x15'));var utils=require('../../config/utils');var config=require(_0x9e6e('0x16'));var licenseUtil=require(_0x9e6e('0x17'));var db=require(_0x9e6e('0x18'))['db'];function respondWithStatusCode(_0x3fe7fc,_0x63e176){_0x63e176=_0x63e176||0xcc;return function(_0x1ae0fc){if(_0x1ae0fc){return _0x3fe7fc[_0x9e6e('0x19')](_0x63e176);}return _0x3fe7fc[_0x9e6e('0x1a')](_0x63e176)[_0x9e6e('0x1b')]();};}function respondWithResult(_0x4ac6ce,_0x1d77bf){_0x1d77bf=_0x1d77bf||0xc8;return function(_0x1baafa){if(_0x1baafa){return _0x4ac6ce['status'](_0x1d77bf)[_0x9e6e('0x1c')](_0x1baafa);}};}function respondWithFilteredResult(_0xde7329,_0x3de2b3){return function(_0x4c21d8){if(_0x4c21d8){var _0x1d56b4=typeof _0x3de2b3[_0x9e6e('0x1d')]==='undefined'&&typeof _0x3de2b3[_0x9e6e('0x1e')]===_0x9e6e('0x1f');var _0x31954a=_0x4c21d8[_0x9e6e('0x20')];var _0x631381=_0x1d56b4?0x0:_0x3de2b3['offset'];var _0x19db85=_0x1d56b4?_0x4c21d8[_0x9e6e('0x20')]:_0x3de2b3[_0x9e6e('0x1d')]+_0x3de2b3['limit'];var _0x3b32ea;if(_0x19db85>=_0x31954a){_0x19db85=_0x31954a;_0x3b32ea=0xc8;}else{_0x3b32ea=0xce;}_0xde7329['status'](_0x3b32ea);return _0xde7329[_0x9e6e('0x21')](_0x9e6e('0x22'),_0x631381+'-'+_0x19db85+'/'+_0x31954a)[_0x9e6e('0x1c')](_0x4c21d8);}return null;};}function patchUpdates(_0x3ae1e4){return function(_0x5933bf){try{jsonpatch[_0x9e6e('0x23')](_0x5933bf,_0x3ae1e4,!![]);}catch(_0x30c0f4){return BPromise[_0x9e6e('0x24')](_0x30c0f4);}return _0x5933bf[_0x9e6e('0x25')]();};}function saveUpdates(_0x4414b6,_0x192669){return function(_0x1e6840){if(_0x1e6840){return _0x1e6840[_0x9e6e('0x26')](_0x4414b6)[_0x9e6e('0x27')](function(_0x270e84){return _0x270e84;});}return null;};}function removeEntity(_0x182bd7,_0x1c3f9f){return function(_0x13de79){if(_0x13de79){return _0x13de79[_0x9e6e('0x28')]()[_0x9e6e('0x27')](function(){_0x182bd7[_0x9e6e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121010,_0x1adeb5){return function(_0x36cd72){if(!_0x36cd72){_0x121010[_0x9e6e('0x19')](0x194);}return _0x36cd72;};}function handleError(_0x305b19,_0x7cde67){_0x7cde67=_0x7cde67||0x1f4;return function(_0x254b70){logger[_0x9e6e('0x29')](_0x254b70[_0x9e6e('0x2a')]);if(_0x254b70[_0x9e6e('0x2b')]){delete _0x254b70[_0x9e6e('0x2b')];}_0x305b19[_0x9e6e('0x1a')](_0x7cde67)['send'](_0x254b70);};}exports[_0x9e6e('0x2c')]=function(_0x257820,_0x34ee80){var _0x446bb8={},_0x5ef89d={},_0x262e08={'count':0x0,'rows':[]};var _0x343237=_[_0x9e6e('0x2d')](db[_0x9e6e('0x2e')]['rawAttributes'],function(_0x3dbfe6){return{'name':_0x3dbfe6[_0x9e6e('0x2f')],'type':_0x3dbfe6[_0x9e6e('0x30')][_0x9e6e('0x31')]};});_0x5ef89d['model']=_['map'](_0x343237,_0x9e6e('0x2b'));_0x5ef89d[_0x9e6e('0x32')]=_[_0x9e6e('0x33')](_0x257820[_0x9e6e('0x32')]);_0x5ef89d[_0x9e6e('0x34')]=_['intersection'](_0x5ef89d[_0x9e6e('0x35')],_0x5ef89d[_0x9e6e('0x32')]);_0x446bb8['attributes']=_[_0x9e6e('0x36')](_0x5ef89d[_0x9e6e('0x35')],qs[_0x9e6e('0x37')](_0x257820[_0x9e6e('0x32')]['fields']));_0x446bb8[_0x9e6e('0x38')]=_0x446bb8[_0x9e6e('0x38')]['length']?_0x446bb8[_0x9e6e('0x38')]:_0x5ef89d[_0x9e6e('0x35')];if(!_0x257820['query'][_0x9e6e('0x39')]('nolimit')){_0x446bb8[_0x9e6e('0x1e')]=qs[_0x9e6e('0x1e')](_0x257820[_0x9e6e('0x32')][_0x9e6e('0x1e')]);_0x446bb8[_0x9e6e('0x1d')]=qs[_0x9e6e('0x1d')](_0x257820[_0x9e6e('0x32')][_0x9e6e('0x1d')]);}_0x446bb8[_0x9e6e('0x3a')]=qs['sort'](_0x257820['query'][_0x9e6e('0x3b')]);_0x446bb8[_0x9e6e('0x3c')]=qs[_0x9e6e('0x34')](_[_0x9e6e('0x3d')](_0x257820['query'],_0x5ef89d[_0x9e6e('0x34')]),_0x343237);if(_0x257820[_0x9e6e('0x32')]['filter']){_0x446bb8['where']=_[_0x9e6e('0x3e')](_0x446bb8['where'],{'$or':_[_0x9e6e('0x2d')](_0x343237,function(_0x244a35){if(_0x244a35[_0x9e6e('0x30')]!==_0x9e6e('0x3f')){var _0x2f8e52={};_0x2f8e52[_0x244a35[_0x9e6e('0x2b')]]={'$like':'%'+_0x257820[_0x9e6e('0x32')][_0x9e6e('0x40')]+'%'};return _0x2f8e52;}})});}_0x446bb8=_[_0x9e6e('0x3e')]({},_0x446bb8,_0x257820[_0x9e6e('0x41')]);var _0x55a408={'where':_0x446bb8[_0x9e6e('0x3c')]};return db[_0x9e6e('0x2e')]['count'](_0x55a408)['then'](function(_0x33c6d5){_0x262e08[_0x9e6e('0x20')]=_0x33c6d5;if(_0x257820[_0x9e6e('0x32')][_0x9e6e('0x42')]){_0x446bb8[_0x9e6e('0x43')]=[{'all':!![]}];}return db[_0x9e6e('0x2e')][_0x9e6e('0x44')](_0x446bb8);})[_0x9e6e('0x27')](function(_0x5b6650){_0x262e08[_0x9e6e('0x45')]=_0x5b6650;return _0x262e08;})[_0x9e6e('0x27')](respondWithFilteredResult(_0x34ee80,_0x446bb8))[_0x9e6e('0x46')](handleError(_0x34ee80,null));};exports[_0x9e6e('0x47')]=function(_0x5ea8af,_0x3bb92f){var _0x5936b4={'raw':![],'where':{'id':_0x5ea8af['params']['id']}},_0x51161d={};_0x51161d[_0x9e6e('0x35')]=_[_0x9e6e('0x33')](db['Automation']['rawAttributes']);_0x51161d[_0x9e6e('0x32')]=_['keys'](_0x5ea8af[_0x9e6e('0x32')]);_0x51161d[_0x9e6e('0x34')]=_[_0x9e6e('0x36')](_0x51161d[_0x9e6e('0x35')],_0x51161d[_0x9e6e('0x32')]);_0x5936b4[_0x9e6e('0x38')]=_[_0x9e6e('0x36')](_0x51161d['model'],qs[_0x9e6e('0x37')](_0x5ea8af['query'][_0x9e6e('0x37')]));_0x5936b4[_0x9e6e('0x38')]=_0x5936b4[_0x9e6e('0x38')]['length']?_0x5936b4[_0x9e6e('0x38')]:_0x51161d[_0x9e6e('0x35')];if(_0x5ea8af[_0x9e6e('0x32')]['includeAll']){_0x5936b4[_0x9e6e('0x43')]=[{'all':!![]}];}_0x5936b4=_['merge']({},_0x5936b4,_0x5ea8af[_0x9e6e('0x41')]);return db[_0x9e6e('0x2e')]['find'](_0x5936b4)[_0x9e6e('0x27')](handleEntityNotFound(_0x3bb92f,null))[_0x9e6e('0x27')](respondWithResult(_0x3bb92f,null))[_0x9e6e('0x46')](handleError(_0x3bb92f,null));};exports[_0x9e6e('0x48')]=function(_0x2ff44e,_0x6ea536){return db['Automation'][_0x9e6e('0x48')](_0x2ff44e[_0x9e6e('0x49')],{})[_0x9e6e('0x27')](respondWithResult(_0x6ea536,0xc9))[_0x9e6e('0x46')](handleError(_0x6ea536,null));};exports[_0x9e6e('0x26')]=function(_0x18c3dc,_0x55ca5b){if(_0x18c3dc[_0x9e6e('0x49')]['id']){delete _0x18c3dc[_0x9e6e('0x49')]['id'];}return db[_0x9e6e('0x2e')]['find']({'where':{'id':_0x18c3dc[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x55ca5b,null))[_0x9e6e('0x27')](saveUpdates(_0x18c3dc['body'],null))[_0x9e6e('0x27')](respondWithResult(_0x55ca5b,null))['catch'](handleError(_0x55ca5b,null));};exports[_0x9e6e('0x28')]=function(_0x9ef18e,_0x92d34a){return db[_0x9e6e('0x2e')][_0x9e6e('0x4b')]({'where':{'id':_0x9ef18e[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x92d34a,null))['then'](removeEntity(_0x92d34a,null))[_0x9e6e('0x46')](handleError(_0x92d34a,null));};exports['addConditions']=function(_0x13c513,_0x5e7bb9,_0xa52645){return db[_0x9e6e('0x4c')][_0x9e6e('0x4b')]({'where':{'id':_0x13c513[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x5e7bb9,null))[_0x9e6e('0x27')](function(_0x3823d4){if(_0x3823d4){return _0x3823d4['addConditions'](_0x13c513[_0x9e6e('0x49')][_0x9e6e('0x4d')],_[_0x9e6e('0x4e')](_0x13c513[_0x9e6e('0x49')],[_0x9e6e('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x5e7bb9,null))[_0x9e6e('0x46')](handleError(_0x5e7bb9,null));};exports[_0x9e6e('0x4f')]=function(_0x2d57ff,_0x1be04a,_0x25fe37){var _0x343ce0={};var _0x267be6={};var _0x4992b6;var _0x521936;return db['Automation'][_0x9e6e('0x50')]({'where':{'id':_0x2d57ff[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x1be04a,null))[_0x9e6e('0x27')](function(_0x135b93){if(_0x135b93){_0x4992b6=_0x135b93;_0x267be6[_0x9e6e('0x35')]=_[_0x9e6e('0x33')](db['Condition'][_0x9e6e('0x51')]);_0x267be6[_0x9e6e('0x32')]=_[_0x9e6e('0x33')](_0x2d57ff['query']);_0x267be6[_0x9e6e('0x34')]=_[_0x9e6e('0x36')](_0x267be6['model'],_0x267be6[_0x9e6e('0x32')]);_0x343ce0[_0x9e6e('0x38')]=_[_0x9e6e('0x36')](_0x267be6['model'],qs['fields'](_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x37')]));_0x343ce0[_0x9e6e('0x38')]=_0x343ce0[_0x9e6e('0x38')][_0x9e6e('0x52')]?_0x343ce0[_0x9e6e('0x38')]:_0x267be6['model'];_0x343ce0[_0x9e6e('0x3a')]=qs['sort'](_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x3b')]);_0x343ce0[_0x9e6e('0x3c')]=qs[_0x9e6e('0x34')](_[_0x9e6e('0x3d')](_0x2d57ff[_0x9e6e('0x32')],_0x267be6[_0x9e6e('0x34')]));if(_0x2d57ff[_0x9e6e('0x32')]['filter']){_0x343ce0[_0x9e6e('0x3c')]=_['merge'](_0x343ce0[_0x9e6e('0x3c')],{'$or':_[_0x9e6e('0x2d')](_0x343ce0[_0x9e6e('0x38')],function(_0x181a07){var _0x3a6374={};_0x3a6374[_0x181a07]={'$like':'%'+_0x2d57ff[_0x9e6e('0x32')]['filter']+'%'};return _0x3a6374;})});}_0x343ce0=_[_0x9e6e('0x3e')]({},_0x343ce0,_0x2d57ff[_0x9e6e('0x41')]);return _0x4992b6[_0x9e6e('0x4f')](_0x343ce0);}})['then'](function(_0x2ba472){if(_0x2ba472){_0x521936=_0x2ba472[_0x9e6e('0x52')];if(!_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x39')](_0x9e6e('0x53'))){_0x343ce0['limit']=qs[_0x9e6e('0x1e')](_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x1e')]);_0x343ce0[_0x9e6e('0x1d')]=qs[_0x9e6e('0x1d')](_0x2d57ff[_0x9e6e('0x32')][_0x9e6e('0x1d')]);}return _0x4992b6['getConditions'](_0x343ce0);}})[_0x9e6e('0x27')](function(_0x2afa12){if(_0x2afa12){return _0x2afa12?{'count':_0x521936,'rows':_0x2afa12}:null;}})['then'](respondWithResult(_0x1be04a,null))['catch'](handleError(_0x1be04a,null));};exports[_0x9e6e('0x54')]=function(_0x11bad4,_0x14d94f,_0x44969b){return db['Action'][_0x9e6e('0x4b')]({'where':{'id':_0x11bad4[_0x9e6e('0x4a')]['id']}})[_0x9e6e('0x27')](handleEntityNotFound(_0x14d94f,null))['then'](function(_0x2cef70){if(_0x2cef70){return _0x2cef70['addActions'](_0x11bad4[_0x9e6e('0x49')][_0x9e6e('0x4d')],_['omit'](_0x11bad4[_0x9e6e('0x49')],['ids','id'])||{});}})[_0x9e6e('0x27')](respondWithResult(_0x14d94f,null))[_0x9e6e('0x46')](handleError(_0x14d94f,null));};exports[_0x9e6e('0x55')]=function(_0x234641,_0x1e9253,_0x3644e0){var _0x488540={};var _0x3f6eda={};var _0x168e10;var _0x3f157e;return db['Automation']['findOne']({'where':{'id':_0x234641['params']['id']}})['then'](handleEntityNotFound(_0x1e9253,null))[_0x9e6e('0x27')](function(_0x5cc148){if(_0x5cc148){_0x168e10=_0x5cc148;_0x3f6eda['model']=_[_0x9e6e('0x33')](db[_0x9e6e('0x56')][_0x9e6e('0x51')]);_0x3f6eda[_0x9e6e('0x32')]=_[_0x9e6e('0x33')](_0x234641[_0x9e6e('0x32')]);_0x3f6eda[_0x9e6e('0x34')]=_[_0x9e6e('0x36')](_0x3f6eda[_0x9e6e('0x35')],_0x3f6eda['query']);_0x488540['attributes']=_[_0x9e6e('0x36')](_0x3f6eda[_0x9e6e('0x35')],qs[_0x9e6e('0x37')](_0x234641[_0x9e6e('0x32')][_0x9e6e('0x37')]));_0x488540[_0x9e6e('0x38')]=_0x488540['attributes'][_0x9e6e('0x52')]?_0x488540[_0x9e6e('0x38')]:_0x3f6eda['model'];_0x488540[_0x9e6e('0x3a')]=qs[_0x9e6e('0x3b')](_0x234641[_0x9e6e('0x32')]['sort']);_0x488540[_0x9e6e('0x3c')]=qs[_0x9e6e('0x34')](_[_0x9e6e('0x3d')](_0x234641['query'],_0x3f6eda[_0x9e6e('0x34')]));if(_0x234641[_0x9e6e('0x32')]['filter']){_0x488540[_0x9e6e('0x3c')]=_['merge'](_0x488540[_0x9e6e('0x3c')],{'$or':_['map'](_0x488540[_0x9e6e('0x38')],function(_0x559654){var _0x1c6091={};_0x1c6091[_0x559654]={'$like':'%'+_0x234641[_0x9e6e('0x32')][_0x9e6e('0x40')]+'%'};return _0x1c6091;})});}_0x488540=_[_0x9e6e('0x3e')]({},_0x488540,_0x234641[_0x9e6e('0x41')]);return _0x168e10['getActions'](_0x488540);}})['then'](function(_0x2b7a17){if(_0x2b7a17){_0x3f157e=_0x2b7a17[_0x9e6e('0x52')];if(!_0x234641[_0x9e6e('0x32')][_0x9e6e('0x39')](_0x9e6e('0x53'))){_0x488540[_0x9e6e('0x1e')]=qs['limit'](_0x234641['query'][_0x9e6e('0x1e')]);_0x488540['offset']=qs[_0x9e6e('0x1d')](_0x234641[_0x9e6e('0x32')][_0x9e6e('0x1d')]);}return _0x168e10['getActions'](_0x488540);}})[_0x9e6e('0x27')](function(_0x5a7b0b){if(_0x5a7b0b){return _0x5a7b0b?{'count':_0x3f157e,'rows':_0x5a7b0b}:null;}})['then'](respondWithResult(_0x1e9253,null))[_0x9e6e('0x46')](handleError(_0x1e9253,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index e70f1f0..66a912d 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 _0x6575=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x3829fa,_0x47644a){var _0x3510c8=function(_0x4be513){while(--_0x4be513){_0x3829fa['push'](_0x3829fa['shift']());}};_0x3510c8(++_0x47644a);}(_0x6575,0xa9));var _0x5657=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x6575[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x5657('0x0'));var util=require(_0x5657('0x1'));var logger=require(_0x5657('0x2'))(_0x5657('0x3'));var moment=require(_0x5657('0x4'));var BPromise=require(_0x5657('0x5'));var rp=require(_0x5657('0x6'));var fs=require('fs');var path=require(_0x5657('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5657('0x8'));module[_0x5657('0x9')]=function(_0x3eedc7,_0x516bc1){return _0x3eedc7[_0x5657('0xa')](_0x5657('0xb'),attributes,{'tableName':_0x5657('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2f15=['bluebird','path','rimraf','./automation.attributes','exports','define','Automation','lodash'];(function(_0x1664f9,_0xc1d5f3){var _0x50aee1=function(_0x118215){while(--_0x118215){_0x1664f9['push'](_0x1664f9['shift']());}};_0x50aee1(++_0xc1d5f3);}(_0x2f15,0x1af));var _0x52f1=function(_0x5ddec9,_0x209a36){_0x5ddec9=_0x5ddec9-0x0;var _0x5abb94=_0x2f15[_0x5ddec9];return _0x5abb94;};'use strict';var _=require(_0x52f1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x52f1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52f1('0x2'));var rimraf=require(_0x52f1('0x3'));var config=require('../../config/environment');var attributes=require(_0x52f1('0x4'));module[_0x52f1('0x5')]=function(_0x28043b,_0x421e6c){return _0x28043b[_0x52f1('0x6')](_0x52f1('0x7'),attributes,{'tableName':'tools_automations','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 dec6f54..391e7e2 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 _0xcf2f=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x2017e7,_0x162b36){var _0xf24239=function(_0x275c3b){while(--_0x275c3b){_0x2017e7['push'](_0x2017e7['shift']());}};_0xf24239(++_0x162b36);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x256fe9,_0x4ed7c3){_0x256fe9=_0x256fe9-0x0;var _0x1769ed=_0xcf2f[_0x256fe9];return _0x1769ed;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});}
\ No newline at end of file
+var _0xb5fb=['request','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0xb5fb,0x172));var _0xbb5f=function(_0x4a467d,_0x4712c2){_0x4a467d=_0x4a467d-0x0;var _0x1ef269=_0xb5fb[_0x4a467d];return _0x1ef269;};'use strict';var _=require(_0xbb5f('0x0'));var util=require(_0xbb5f('0x1'));var moment=require(_0xbb5f('0x2'));var BPromise=require(_0xbb5f('0x3'));var rs=require(_0xbb5f('0x4'));var fs=require('fs');var Redis=require(_0xbb5f('0x5'));var db=require(_0xbb5f('0x6'))['db'];var utils=require(_0xbb5f('0x7'));var logger=require(_0xbb5f('0x8'))(_0xbb5f('0x9'));var config=require(_0xbb5f('0xa'));var jayson=require(_0xbb5f('0xb'));var client=jayson[_0xbb5f('0xc')][_0xbb5f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487a1a,_0x597050,_0x317cd9){return new BPromise(function(_0x5e7943,_0x5b91){return client[_0xbb5f('0xe')](_0x487a1a,_0x317cd9)['then'](function(_0x4f13a9){logger[_0xbb5f('0xf')]('Automation,\x20%s,\x20%s',_0x597050,_0xbb5f('0x10'));logger[_0xbb5f('0x11')](_0xbb5f('0x12'),_0x597050,_0xbb5f('0x10'),JSON[_0xbb5f('0x13')](_0x4f13a9));if(_0x4f13a9[_0xbb5f('0x14')]){if(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x15')]===0x1f4){logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9['error'][_0xbb5f('0x17')]);return _0x5b91(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9[_0xbb5f('0x14')]['message']);return _0x5e7943(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}else{logger[_0xbb5f('0xf')](_0xbb5f('0x16'),_0x597050,'request\x20sent');_0x5e7943(_0x4f13a9['result'][_0xbb5f('0x17')]);}})['catch'](function(_0xdf4ec8){logger[_0xbb5f('0x14')]('Automation,\x20%s,\x20%s',_0x597050,_0xdf4ec8);_0x5b91(_0xdf4ec8);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 456b570..6177345 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 _0x567b=['addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','create','addConditions','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x567b,0x6e));var _0xb567=function(_0x2641d5,_0x6b70e1){_0x2641d5=_0x2641d5-0x0;var _0x7f5087=_0x567b[_0x2641d5];return _0x7f5087;};'use strict';var multer=require(_0xb567('0x0'));var util=require('util');var path=require(_0xb567('0x1'));var timeout=require(_0xb567('0x2'));var express=require(_0xb567('0x3'));var router=express[_0xb567('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb567('0x5'));var interaction=require(_0xb567('0x6'));var config=require(_0xb567('0x7'));var controller=require(_0xb567('0x8'));router[_0xb567('0x9')]('/',auth[_0xb567('0xa')](),controller[_0xb567('0xb')]);router['get'](_0xb567('0xc'),auth[_0xb567('0xa')](),controller[_0xb567('0xd')]);router[_0xb567('0x9')](_0xb567('0xe'),auth[_0xb567('0xa')](),controller[_0xb567('0xf')]);router['get'](_0xb567('0x10'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0xb567('0xa')](),controller[_0xb567('0x11')]);router['post'](_0xb567('0xe'),auth[_0xb567('0xa')](),controller[_0xb567('0x12')]);router[_0xb567('0x13')](_0xb567('0x10'),auth[_0xb567('0xa')](),controller[_0xb567('0x14')]);router[_0xb567('0x15')](_0xb567('0xc'),auth[_0xb567('0xa')](),controller[_0xb567('0x16')]);router[_0xb567('0x17')](_0xb567('0xc'),auth[_0xb567('0xa')](),controller[_0xb567('0x18')]);module[_0xb567('0x19')]=router;
\ No newline at end of file
+var _0x14ac=['/:id/actions','getActions','post','addActions','put','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions'];(function(_0x254ede,_0x3b3d0f){var _0x2e3704=function(_0x1f96a6){while(--_0x1f96a6){_0x254ede['push'](_0x254ede['shift']());}};_0x2e3704(++_0x3b3d0f);}(_0x14ac,0x13b));var _0xc14a=function(_0x48d933,_0x4eaabe){_0x48d933=_0x48d933-0x0;var _0x4caf07=_0x14ac[_0x48d933];return _0x4caf07;};'use strict';var multer=require('multer');var util=require(_0xc14a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc14a('0x1'));var router=express[_0xc14a('0x2')]();var fs_extra=require(_0xc14a('0x3'));var auth=require(_0xc14a('0x4'));var interaction=require(_0xc14a('0x5'));var config=require(_0xc14a('0x6'));var controller=require(_0xc14a('0x7'));router['get']('/',auth[_0xc14a('0x8')](),controller[_0xc14a('0x9')]);router[_0xc14a('0xa')](_0xc14a('0xb'),auth[_0xc14a('0x8')](),controller[_0xc14a('0xc')]);router['get'](_0xc14a('0xd'),auth['isAuthenticated'](),controller[_0xc14a('0xe')]);router['get'](_0xc14a('0xf'),auth['isAuthenticated'](),controller[_0xc14a('0x10')]);router[_0xc14a('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc14a('0x11')](_0xc14a('0xd'),auth[_0xc14a('0x8')](),controller['addConditions']);router[_0xc14a('0x11')](_0xc14a('0xf'),auth[_0xc14a('0x8')](),controller[_0xc14a('0x12')]);router[_0xc14a('0x13')]('/:id',auth[_0xc14a('0x8')](),controller['update']);router[_0xc14a('0x14')](_0xc14a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xc14a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 715893a..28c9331 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 _0x83e7=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','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\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4f66c2,_0x3c2c60){var _0x1724c7=function(_0x58b02e){while(--_0x58b02e){_0x4f66c2['push'](_0x4f66c2['shift']());}};_0x1724c7(++_0x3c2c60);}(_0x83e7,0x187));var _0x783e=function(_0x37752c,_0x20d239){_0x37752c=_0x37752c-0x0;var _0x41b47f=_0x83e7[_0x37752c];return _0x41b47f;};'use strict';var Sequelize=require('sequelize');module[_0x783e('0x0')]={'name':{'type':Sequelize[_0x783e('0x1')],'unique':_0x783e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x783e('0x3')](_0x783e('0x4')),'allowNull':![],'defaultValue':_0x783e('0x4')},'description':{'type':Sequelize[_0x783e('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x783e('0x5')](0x4)[_0x783e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x783e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x783e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'defaultValue':0x3,'comment':_0x783e('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x783e('0xe')},'dialTimezone':{'type':Sequelize[_0x783e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x783e('0x1')],'defaultValue':_0x783e('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x783e('0x3')](_0x783e('0x10'),_0x783e('0x11'),_0x783e('0x12')),'defaultValue':_0x783e('0x10')},'dialAMDActive':{'type':Sequelize[_0x783e('0x13')],'defaultValue':0x0,'comment':_0x783e('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x783e('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x783e('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x783e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x783e('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x783e('0x5')](0x9)[_0x783e('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x783e('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x783e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x783e('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x783e('0x5')](0x9)[_0x783e('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x783e('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x783e('0x5')](0x9)[_0x783e('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x783e('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x783e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x783e('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x783e('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x783e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x783e('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x783e('0x3')](_0x783e('0x1e'),_0x783e('0x1f')),'defaultValue':_0x783e('0x1e')},'dialPrefix':{'type':Sequelize[_0x783e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x783e('0x20')},'dialCutDigit':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x783e('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x24')},'dialDropRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)[_0x783e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x26')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x27')},'dialMachineMaxRetry':{'type':Sequelize[_0x783e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x783e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x783e('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x783e('0x5')](0x5)[_0x783e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x783e('0x2a')}};
\ No newline at end of file
+var _0xb3f0=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr'];(function(_0x24353c,_0x146774){var _0x31422b=function(_0x3341ce){while(--_0x3341ce){_0x24353c['push'](_0x24353c['shift']());}};_0x31422b(++_0x146774);}(_0xb3f0,0x103));var _0x0b3f=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xb3f0[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require('sequelize');module[_0x0b3f('0x0')]={'name':{'type':Sequelize[_0x0b3f('0x1')],'unique':_0x0b3f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0b3f('0x3')](_0x0b3f('0x4')),'allowNull':![],'defaultValue':_0x0b3f('0x4')},'description':{'type':Sequelize[_0x0b3f('0x1')]},'active':{'type':Sequelize[_0x0b3f('0x5')],'defaultValue':0x0,'comment':_0x0b3f('0x6')},'limitCalls':{'type':Sequelize[_0x0b3f('0x7')](0x4)[_0x0b3f('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0b3f('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0b3f('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0b3f('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0b3f('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0b3f('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0b3f('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0b3f('0xe'),_0x0b3f('0xf'),_0x0b3f('0x10')),'defaultValue':_0x0b3f('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0b3f('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0b3f('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0b3f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0b3f('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0b3f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0b3f('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b3f('0x7')](0x9)[_0x0b3f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b3f('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x0b3f('0x7')](0x9)[_0x0b3f('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b3f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0b3f('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0b3f('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0b3f('0x7')](0x9)[_0x0b3f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b3f('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0b3f('0x3')](_0x0b3f('0x17'),_0x0b3f('0x18')),'defaultValue':_0x0b3f('0x17')},'dialPrefix':{'type':Sequelize[_0x0b3f('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0b3f('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b3f('0x19')},'dialCutDigit':{'type':Sequelize[_0x0b3f('0x7')](0x3)[_0x0b3f('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b3f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b3f('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0b3f('0x7')](0x5)[_0x0b3f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b3f('0x20')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 346c5e3..70bfbb6 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 _0x380a=['sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','user','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','ids','dialCheckDuplicateType','insert','scheduledAt','ContactId','ListId','select','field','phone','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','onlyIfOpen','into','fromQuery','NOW()','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','spread','push','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x1f080f,_0x2da97){var _0x16d826=function(_0x20b1ec){while(--_0x20b1ec){_0x1f080f['push'](_0x1f080f['shift']());}};_0x16d826(++_0x2da97);}(_0x380a,0x16c));var _0xa380=function(_0x47c958,_0x3cfe09){_0x47c958=_0x47c958-0x0;var _0x573eab=_0x380a[_0x47c958];return _0x573eab;};'use strict';var emlformat=require(_0xa380('0x0'));var rimraf=require(_0xa380('0x1'));var zipdir=require(_0xa380('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa380('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa380('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa380('0x5'));var csv=require(_0xa380('0x6'));var ejs=require(_0xa380('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa380('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa380('0x6'));var querystring=require(_0xa380('0x9'));var Papa=require(_0xa380('0xa'));var Redis=require(_0xa380('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa380('0xc'));var logger=require(_0xa380('0xd'))('api');var utils=require(_0xa380('0xe'));var config=require(_0xa380('0xf'));var licenseUtil=require(_0xa380('0x10'));var db=require(_0xa380('0x11'))['db'];function respondWithStatusCode(_0x36c941,_0x35256a){_0x35256a=_0x35256a||0xcc;return function(_0x1a0bd2){if(_0x1a0bd2){return _0x36c941['sendStatus'](_0x35256a);}return _0x36c941[_0xa380('0x12')](_0x35256a)[_0xa380('0x13')]();};}function respondWithResult(_0x25c2d9,_0x48df05){_0x48df05=_0x48df05||0xc8;return function(_0x480fe3){if(_0x480fe3){return _0x25c2d9[_0xa380('0x12')](_0x48df05)[_0xa380('0x14')](_0x480fe3);}};}function respondWithFilteredResult(_0x2ad901,_0x4734de){return function(_0x2c085a){if(_0x2c085a){var _0x3a713e=typeof _0x4734de['offset']===_0xa380('0x15')&&typeof _0x4734de['limit']===_0xa380('0x15');var _0x2ab7af=_0x2c085a['count'];var _0x8eaa53=_0x3a713e?0x0:_0x4734de[_0xa380('0x16')];var _0x226613=_0x3a713e?_0x2c085a[_0xa380('0x17')]:_0x4734de['offset']+_0x4734de[_0xa380('0x18')];var _0x3779bc;if(_0x226613>=_0x2ab7af){_0x226613=_0x2ab7af;_0x3779bc=0xc8;}else{_0x3779bc=0xce;}_0x2ad901[_0xa380('0x12')](_0x3779bc);return _0x2ad901[_0xa380('0x19')]('Content-Range',_0x8eaa53+'-'+_0x226613+'/'+_0x2ab7af)['json'](_0x2c085a);}return null;};}function patchUpdates(_0x528650){return function(_0x2c4895){try{jsonpatch[_0xa380('0x1a')](_0x2c4895,_0x528650,!![]);}catch(_0x4a5766){return BPromise[_0xa380('0x1b')](_0x4a5766);}return _0x2c4895[_0xa380('0x1c')]();};}function saveUpdates(_0x9d2294,_0x315e39){return function(_0x250acf){if(_0x250acf){return _0x250acf[_0xa380('0x1d')](_0x9d2294)[_0xa380('0x1e')](function(_0x3c950e){return _0x3c950e;});}return null;};}function removeEntity(_0x3df22b,_0x291695){return function(_0x425ddd){if(_0x425ddd){return _0x425ddd[_0xa380('0x1f')]()[_0xa380('0x1e')](function(){var _0x5cc7f6=_0x425ddd[_0xa380('0x20')]({'plain':!![]});var _0x1d603c=_0xa380('0x21');return db[_0xa380('0x22')][_0xa380('0x1f')]({'where':{'type':_0x1d603c,'resourceId':_0x5cc7f6['id']}})['then'](function(){return _0x425ddd;});})['then'](function(){_0x3df22b[_0xa380('0x12')](0xcc)[_0xa380('0x13')]();});}};}function handleEntityNotFound(_0xa0c142,_0xc80edd){return function(_0x39f423){if(!_0x39f423){_0xa0c142[_0xa380('0x23')](0x194);}return _0x39f423;};}function handleError(_0x4a60d4,_0x3e5879){_0x3e5879=_0x3e5879||0x1f4;return function(_0x1dd99b){logger['error'](_0x1dd99b[_0xa380('0x24')]);if(_0x1dd99b[_0xa380('0x25')]){delete _0x1dd99b[_0xa380('0x25')];}_0x4a60d4[_0xa380('0x12')](_0x3e5879)[_0xa380('0x26')](_0x1dd99b);};}exports[_0xa380('0x27')]=function(_0x1fce2b,_0x3618f7){var _0x35a330={},_0xba971c={},_0x14fa7f={'count':0x0,'rows':[]};var _0x318eb3=_['map'](db[_0xa380('0x28')][_0xa380('0x29')],function(_0x416c21){return{'name':_0x416c21[_0xa380('0x2a')],'type':_0x416c21[_0xa380('0x2b')][_0xa380('0x2c')]};});_0xba971c[_0xa380('0x2d')]=_[_0xa380('0x2e')](_0x318eb3,_0xa380('0x25'));_0xba971c[_0xa380('0x2f')]=_[_0xa380('0x30')](_0x1fce2b[_0xa380('0x2f')]);_0xba971c['filters']=_[_0xa380('0x31')](_0xba971c[_0xa380('0x2d')],_0xba971c[_0xa380('0x2f')]);_0x35a330[_0xa380('0x32')]=_[_0xa380('0x31')](_0xba971c[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x1fce2b[_0xa380('0x2f')]['fields']));_0x35a330[_0xa380('0x32')]=_0x35a330[_0xa380('0x32')][_0xa380('0x34')]?_0x35a330[_0xa380('0x32')]:_0xba971c[_0xa380('0x2d')];if(!_0x1fce2b[_0xa380('0x2f')][_0xa380('0x35')](_0xa380('0x36'))){_0x35a330['limit']=qs[_0xa380('0x18')](_0x1fce2b[_0xa380('0x2f')][_0xa380('0x18')]);_0x35a330[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x1fce2b[_0xa380('0x2f')][_0xa380('0x16')]);}_0x35a330[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x1fce2b[_0xa380('0x2f')][_0xa380('0x38')]);_0x35a330['where']=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x1fce2b[_0xa380('0x2f')],_0xba971c[_0xa380('0x39')]),_0x318eb3);if(_0x1fce2b['query'][_0xa380('0x3b')]){_0x35a330[_0xa380('0x3c')]=_['merge'](_0x35a330['where'],{'$or':_['map'](_0x318eb3,function(_0x437538){if(_0x437538[_0xa380('0x2b')]!==_0xa380('0x3d')){var _0x370e46={};_0x370e46[_0x437538[_0xa380('0x25')]]={'$like':'%'+_0x1fce2b['query']['filter']+'%'};return _0x370e46;}})});}_0x35a330=_[_0xa380('0x3e')]({},_0x35a330,_0x1fce2b[_0xa380('0x3f')]);var _0x251b50={'where':_0x35a330[_0xa380('0x3c')]};return db[_0xa380('0x28')][_0xa380('0x17')](_0x251b50)[_0xa380('0x1e')](function(_0x212a20){_0x14fa7f[_0xa380('0x17')]=_0x212a20;if(_0x1fce2b[_0xa380('0x2f')][_0xa380('0x40')]){_0x35a330[_0xa380('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x35a330);})[_0xa380('0x1e')](function(_0x261563){_0x14fa7f[_0xa380('0x42')]=_0x261563;return _0x14fa7f;})[_0xa380('0x1e')](respondWithFilteredResult(_0x3618f7,_0x35a330))[_0xa380('0x43')](handleError(_0x3618f7,null));};exports[_0xa380('0x44')]=function(_0x36646e,_0x100181){var _0x271e1e={'raw':![],'where':{'id':_0x36646e['params']['id']}},_0xe2f9f1={};_0xe2f9f1[_0xa380('0x2d')]=_[_0xa380('0x30')](db['Campaign'][_0xa380('0x29')]);_0xe2f9f1['query']=_[_0xa380('0x30')](_0x36646e[_0xa380('0x2f')]);_0xe2f9f1[_0xa380('0x39')]=_[_0xa380('0x31')](_0xe2f9f1['model'],_0xe2f9f1[_0xa380('0x2f')]);_0x271e1e['attributes']=_[_0xa380('0x31')](_0xe2f9f1[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x36646e[_0xa380('0x2f')][_0xa380('0x33')]));_0x271e1e[_0xa380('0x32')]=_0x271e1e[_0xa380('0x32')][_0xa380('0x34')]?_0x271e1e[_0xa380('0x32')]:_0xe2f9f1[_0xa380('0x2d')];if(_0x36646e[_0xa380('0x2f')]['includeAll']){_0x271e1e['include']=[{'all':!![]}];}_0x271e1e=_[_0xa380('0x3e')]({},_0x271e1e,_0x36646e[_0xa380('0x3f')]);return db[_0xa380('0x28')]['find'](_0x271e1e)['then'](handleEntityNotFound(_0x100181,null))[_0xa380('0x1e')](respondWithResult(_0x100181,null))[_0xa380('0x43')](handleError(_0x100181,null));};exports[_0xa380('0x45')]=function(_0x1f8fca,_0x1f5820){return db[_0xa380('0x28')][_0xa380('0x45')](_0x1f8fca[_0xa380('0x46')],{})['then'](function(_0xc271c1){var _0x19af6a=_0x1f8fca['user'][_0xa380('0x20')]({'plain':!![]});if(!_0x19af6a)throw new Error(_0xa380('0x47'));if(_0x19af6a[_0xa380('0x48')]==='user'){var _0x29b140=_0xc271c1['get']({'plain':!![]});var _0x4794e=_0xa380('0x21');return db[_0xa380('0x49')][_0xa380('0x4a')]({'where':{'name':_0x4794e,'userProfileId':_0x19af6a[_0xa380('0x4b')]},'raw':!![]})[_0xa380('0x1e')](function(_0x33e25e){if(_0x33e25e&&_0x33e25e['autoAssociation']===0x0){return db[_0xa380('0x22')][_0xa380('0x45')]({'name':_0x29b140['name'],'resourceId':_0x29b140['id'],'type':_0x33e25e['name'],'sectionId':_0x33e25e['id']},{})[_0xa380('0x1e')](function(){return _0xc271c1;});}else{return _0xc271c1;}})['catch'](function(_0x16c479){logger[_0xa380('0x4c')](_0xa380('0x4d'),_0x16c479);throw _0x16c479;});}return _0xc271c1;})['then'](respondWithResult(_0x1f5820,0xc9))['catch'](handleError(_0x1f5820,null));};exports['clone']=function(_0x5bf9f1,_0x43ad25){var _0x281abe={'where':{'id':_0x5bf9f1[_0xa380('0x4e')]['id']}},_0x82fc25={};_0x82fc25[_0xa380('0x2d')]=_['keys'](db[_0xa380('0x28')]['rawAttributes']);_0x281abe[_0xa380('0x32')]=_['intersection'](_0x82fc25[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x5bf9f1[_0xa380('0x2f')][_0xa380('0x33')]));_0x281abe['attributes']=_0x281abe[_0xa380('0x32')][_0xa380('0x34')]?_0x281abe[_0xa380('0x32')]:_0x82fc25[_0xa380('0x2d')];if(_0x5bf9f1['query'][_0xa380('0x40')]){_0x281abe['include']=[{'all':!![]}];}_0x281abe=_[_0xa380('0x3e')]({},_0x281abe,_0x5bf9f1[_0xa380('0x3f')]);return db[_0xa380('0x28')][_0xa380('0x4a')](_0x281abe)[_0xa380('0x1e')](handleEntityNotFound(_0x43ad25,null))[_0xa380('0x1e')](function(_0x519534){if(_0x519534){var _0x3cb89e=_0x519534['get']({'plain':!![]});_0x3cb89e=qs[_0xa380('0x4f')](_0x3cb89e,['id',_0xa380('0x50'),_0xa380('0x51')]);_0x5bf9f1[_0xa380('0x46')]=_[_0xa380('0x4f')](_0x5bf9f1[_0xa380('0x46')],['id',_0xa380('0x50'),_0xa380('0x51')]);return db[_0xa380('0x28')][_0xa380('0x45')](_['merge'](_0x3cb89e,_0x5bf9f1[_0xa380('0x46')]),{'include':_0x5bf9f1[_0xa380('0x2f')][_0xa380('0x40')]?[{'all':!![]}]:undefined})[_0xa380('0x1e')](function(_0x502d68){var _0x4f415f=_0x5bf9f1[_0xa380('0x52')][_0xa380('0x20')]({'plain':!![]});if(!_0x4f415f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f415f['role']==='user'){var _0x2dd487=_0x502d68[_0xa380('0x20')]({'plain':!![]});var _0x2cf982='IvrCampaigns';return db[_0xa380('0x49')]['find']({'where':{'name':_0x2cf982,'userProfileId':_0x4f415f['userProfileId']},'raw':!![]})[_0xa380('0x1e')](function(_0x533937){if(_0x533937&&_0x533937[_0xa380('0x53')]===0x0){return db[_0xa380('0x22')][_0xa380('0x45')]({'name':_0x2dd487[_0xa380('0x25')],'resourceId':_0x2dd487['id'],'type':_0x533937[_0xa380('0x25')],'sectionId':_0x533937['id']},{})[_0xa380('0x1e')](function(){return _0x502d68;});}else{return _0x502d68;}})[_0xa380('0x43')](function(_0x367c4b){logger[_0xa380('0x4c')](_0xa380('0x4d'),_0x367c4b);throw _0x367c4b;});}return _0x502d68;});}})[_0xa380('0x1e')](respondWithResult(_0x43ad25,0xc9))[_0xa380('0x43')](handleError(_0x43ad25,null));};exports['update']=function(_0x5f4df6,_0x18335b){if(_0x5f4df6[_0xa380('0x46')]['id']){delete _0x5f4df6[_0xa380('0x46')]['id'];}return db[_0xa380('0x28')][_0xa380('0x4a')]({'where':{'id':_0x5f4df6[_0xa380('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18335b,null))[_0xa380('0x1e')](saveUpdates(_0x5f4df6[_0xa380('0x46')],null))[_0xa380('0x1e')](respondWithResult(_0x18335b,null))[_0xa380('0x43')](handleError(_0x18335b,null));};exports[_0xa380('0x1f')]=function(_0x250bb7,_0x537953){return db[_0xa380('0x28')]['find']({'where':{'id':_0x250bb7[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x537953,null))['then'](removeEntity(_0x537953,null))[_0xa380('0x43')](handleError(_0x537953,null));};exports[_0xa380('0x54')]=function(_0x5325b4,_0x2366cf,_0x5173a1){var _0x5eb552={'raw':!![],'where':{}};var _0x411582={};var _0x32e553={'count':0x0,'rows':[]};return db[_0xa380('0x28')][_0xa380('0x55')]({'where':{'id':_0x5325b4[_0xa380('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2366cf,null))[_0xa380('0x1e')](function(_0x2a2f62){if(_0x2a2f62){_0x411582['model']=_[_0xa380('0x30')](db[_0xa380('0x56')][_0xa380('0x29')]);_0x411582['query']=_[_0xa380('0x30')](_0x5325b4['query']);_0x411582[_0xa380('0x39')]=_[_0xa380('0x31')](_0x411582[_0xa380('0x2d')],_0x411582['query']);_0x5eb552[_0xa380('0x32')]=_[_0xa380('0x31')](_0x411582[_0xa380('0x2d')],qs['fields'](_0x5325b4[_0xa380('0x2f')][_0xa380('0x33')]));_0x5eb552[_0xa380('0x32')]=_0x5eb552[_0xa380('0x32')][_0xa380('0x34')]?_0x5eb552['attributes']:_0x411582['model'];if(!_0x5325b4[_0xa380('0x2f')][_0xa380('0x35')]('nolimit')){_0x5eb552[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x5325b4['query'][_0xa380('0x18')]);_0x5eb552[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x5325b4[_0xa380('0x2f')][_0xa380('0x16')]);}_0x5eb552[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x5325b4[_0xa380('0x2f')]['sort']);_0x5eb552[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x5325b4['query'],_0x411582['filters']));_0x5eb552[_0xa380('0x3c')][_0xa380('0x57')]=_0x2a2f62['id'];if(_0x5325b4[_0xa380('0x2f')][_0xa380('0x3b')]){_0x5eb552[_0xa380('0x3c')]=_['merge'](_0x5eb552['where'],{'$or':_[_0xa380('0x2e')](_0x5eb552['attributes'],function(_0x59f6a8){var _0x1d95c8={};_0x1d95c8[_0x59f6a8]={'$like':'%'+_0x5325b4[_0xa380('0x2f')][_0xa380('0x3b')]+'%'};return _0x1d95c8;})});}_0x5eb552=_[_0xa380('0x3e')]({},_0x5eb552,_0x5325b4[_0xa380('0x3f')]);return db[_0xa380('0x56')][_0xa380('0x17')]({'where':_0x5eb552[_0xa380('0x3c')]})['then'](function(_0x3b178a){_0x32e553[_0xa380('0x17')]=_0x3b178a;if(_0x5325b4[_0xa380('0x2f')][_0xa380('0x40')]){_0x5eb552['include']=[{'all':!![]}];}return db[_0xa380('0x56')][_0xa380('0x58')](_0x5eb552);})[_0xa380('0x1e')](function(_0x3d5a62){_0x32e553[_0xa380('0x42')]=_0x3d5a62;return _0x32e553;});}})[_0xa380('0x1e')](respondWithFilteredResult(_0x2366cf,_0x5eb552))[_0xa380('0x43')](handleError(_0x2366cf,null));};exports['getHopperHistories']=function(_0x3ef209,_0x5638cc,_0x11e968){var _0x1e5486={'raw':!![],'where':{}};var _0x57ca79={};var _0x43872e={'count':0x0,'rows':[]};return db[_0xa380('0x28')][_0xa380('0x55')]({'where':{'id':_0x3ef209[_0xa380('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5638cc,null))[_0xa380('0x1e')](function(_0x3b0b1b){if(_0x3b0b1b){_0x57ca79[_0xa380('0x2d')]=_[_0xa380('0x30')](db[_0xa380('0x59')][_0xa380('0x29')]);_0x57ca79['query']=_[_0xa380('0x30')](_0x3ef209[_0xa380('0x2f')]);_0x57ca79[_0xa380('0x39')]=_[_0xa380('0x31')](_0x57ca79[_0xa380('0x2d')],_0x57ca79['query']);_0x1e5486['attributes']=_[_0xa380('0x31')](_0x57ca79[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x3ef209[_0xa380('0x2f')][_0xa380('0x33')]));_0x1e5486[_0xa380('0x32')]=_0x1e5486[_0xa380('0x32')][_0xa380('0x34')]?_0x1e5486[_0xa380('0x32')]:_0x57ca79[_0xa380('0x2d')];if(!_0x3ef209[_0xa380('0x2f')]['hasOwnProperty'](_0xa380('0x36'))){_0x1e5486[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x3ef209[_0xa380('0x2f')][_0xa380('0x18')]);_0x1e5486['offset']=qs[_0xa380('0x16')](_0x3ef209['query'][_0xa380('0x16')]);}_0x1e5486[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x3ef209[_0xa380('0x2f')]['sort']);_0x1e5486[_0xa380('0x3c')]=qs['filters'](_[_0xa380('0x3a')](_0x3ef209[_0xa380('0x2f')],_0x57ca79[_0xa380('0x39')]));_0x1e5486[_0xa380('0x3c')]['CampaignId']=_0x3b0b1b['id'];if(_0x3ef209[_0xa380('0x2f')][_0xa380('0x3b')]){_0x1e5486['where']=_['merge'](_0x1e5486['where'],{'$or':_[_0xa380('0x2e')](_0x1e5486['attributes'],function(_0x11f39c){var _0x11c2ad={};_0x11c2ad[_0x11f39c]={'$like':'%'+_0x3ef209[_0xa380('0x2f')]['filter']+'%'};return _0x11c2ad;})});}_0x1e5486=_[_0xa380('0x3e')]({},_0x1e5486,_0x3ef209[_0xa380('0x3f')]);return db[_0xa380('0x59')][_0xa380('0x17')]({'where':_0x1e5486[_0xa380('0x3c')]})[_0xa380('0x1e')](function(_0x2a5dd7){_0x43872e[_0xa380('0x17')]=_0x2a5dd7;if(_0x3ef209['query'][_0xa380('0x40')]){_0x1e5486[_0xa380('0x41')]=[{'all':!![]}];}return db[_0xa380('0x59')][_0xa380('0x58')](_0x1e5486);})[_0xa380('0x1e')](function(_0x204e75){_0x43872e['rows']=_0x204e75;return _0x43872e;});}})['then'](respondWithFilteredResult(_0x5638cc,_0x1e5486))[_0xa380('0x43')](handleError(_0x5638cc,null));};exports[_0xa380('0x5a')]=function(_0x4cb583,_0x6b4641,_0x159abd){var _0x1727fc={'raw':!![],'where':{}};var _0x154d8b={};var _0x23fdb7={'count':0x0,'rows':[]};return db[_0xa380('0x28')][_0xa380('0x55')]({'where':{'id':_0x4cb583['params']['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x6b4641,null))[_0xa380('0x1e')](function(_0x4d14ec){if(_0x4d14ec){_0x154d8b[_0xa380('0x2d')]=_[_0xa380('0x30')](db[_0xa380('0x5b')][_0xa380('0x29')]);_0x154d8b[_0xa380('0x2f')]=_[_0xa380('0x30')](_0x4cb583['query']);_0x154d8b['filters']=_['intersection'](_0x154d8b[_0xa380('0x2d')],_0x154d8b[_0xa380('0x2f')]);_0x1727fc[_0xa380('0x32')]=_[_0xa380('0x31')](_0x154d8b[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x4cb583[_0xa380('0x2f')][_0xa380('0x33')]));_0x1727fc[_0xa380('0x32')]=_0x1727fc[_0xa380('0x32')]['length']?_0x1727fc[_0xa380('0x32')]:_0x154d8b['model'];if(!_0x4cb583[_0xa380('0x2f')][_0xa380('0x35')](_0xa380('0x36'))){_0x1727fc[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x4cb583['query']['limit']);_0x1727fc[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x4cb583['query'][_0xa380('0x16')]);}_0x1727fc[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x4cb583[_0xa380('0x2f')][_0xa380('0x38')]);_0x1727fc[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x4cb583['query'],_0x154d8b[_0xa380('0x39')]));_0x1727fc[_0xa380('0x3c')][_0xa380('0x57')]=_0x4d14ec['id'];if(_0x4cb583[_0xa380('0x2f')][_0xa380('0x3b')]){_0x1727fc['where']=_[_0xa380('0x3e')](_0x1727fc[_0xa380('0x3c')],{'$or':_[_0xa380('0x2e')](_0x1727fc[_0xa380('0x32')],function(_0x45a8df){var _0x5cb2d6={};_0x5cb2d6[_0x45a8df]={'$like':'%'+_0x4cb583[_0xa380('0x2f')][_0xa380('0x3b')]+'%'};return _0x5cb2d6;})});}_0x1727fc=_[_0xa380('0x3e')]({},_0x1727fc,_0x4cb583[_0xa380('0x3f')]);return db[_0xa380('0x5b')][_0xa380('0x17')]({'where':_0x1727fc[_0xa380('0x3c')]})[_0xa380('0x1e')](function(_0x3608e0){_0x23fdb7[_0xa380('0x17')]=_0x3608e0;if(_0x4cb583['query']['includeAll']){_0x1727fc[_0xa380('0x41')]=[{'all':!![]}];}return db[_0xa380('0x5b')][_0xa380('0x58')](_0x1727fc);})[_0xa380('0x1e')](function(_0x9e0edc){_0x23fdb7[_0xa380('0x42')]=_0x9e0edc;return _0x23fdb7;});}})[_0xa380('0x1e')](respondWithFilteredResult(_0x6b4641,_0x1727fc))[_0xa380('0x43')](handleError(_0x6b4641,null));};exports[_0xa380('0x5c')]=function(_0x307a9e,_0x3b6c02,_0x1c2331){var _0x2fba8b={'raw':!![],'where':{}};var _0x7c522c={};var _0x5c0439={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x307a9e[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x3b6c02,null))[_0xa380('0x1e')](function(_0xddcc4e){if(_0xddcc4e){_0x7c522c[_0xa380('0x2d')]=_['keys'](db[_0xa380('0x5d')][_0xa380('0x29')]);_0x7c522c[_0xa380('0x2f')]=_['keys'](_0x307a9e[_0xa380('0x2f')]);_0x7c522c['filters']=_['intersection'](_0x7c522c[_0xa380('0x2d')],_0x7c522c['query']);_0x2fba8b[_0xa380('0x32')]=_[_0xa380('0x31')](_0x7c522c[_0xa380('0x2d')],qs['fields'](_0x307a9e[_0xa380('0x2f')][_0xa380('0x33')]));_0x2fba8b[_0xa380('0x32')]=_0x2fba8b['attributes']['length']?_0x2fba8b[_0xa380('0x32')]:_0x7c522c[_0xa380('0x2d')];if(!_0x307a9e[_0xa380('0x2f')][_0xa380('0x35')]('nolimit')){_0x2fba8b[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x307a9e[_0xa380('0x2f')]['limit']);_0x2fba8b[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x307a9e[_0xa380('0x2f')][_0xa380('0x16')]);}_0x2fba8b[_0xa380('0x37')]=qs['sort'](_0x307a9e[_0xa380('0x2f')][_0xa380('0x38')]);_0x2fba8b[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x307a9e[_0xa380('0x2f')],_0x7c522c[_0xa380('0x39')]));_0x2fba8b[_0xa380('0x3c')]['CampaignId']=_0xddcc4e['id'];if(_0x307a9e[_0xa380('0x2f')][_0xa380('0x3b')]){_0x2fba8b['where']=_[_0xa380('0x3e')](_0x2fba8b['where'],{'$or':_[_0xa380('0x2e')](_0x2fba8b[_0xa380('0x32')],function(_0x4feaf7){var _0x45cacc={};_0x45cacc[_0x4feaf7]={'$like':'%'+_0x307a9e[_0xa380('0x2f')][_0xa380('0x3b')]+'%'};return _0x45cacc;})});}_0x2fba8b=_['merge']({},_0x2fba8b,_0x307a9e['options']);return db['CmHopperBlack']['count']({'where':_0x2fba8b[_0xa380('0x3c')]})[_0xa380('0x1e')](function(_0x45d232){_0x5c0439['count']=_0x45d232;if(_0x307a9e['query'][_0xa380('0x40')]){_0x2fba8b[_0xa380('0x41')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x2fba8b);})['then'](function(_0x33b2cb){_0x5c0439['rows']=_0x33b2cb;return _0x5c0439;});}})[_0xa380('0x1e')](respondWithFilteredResult(_0x3b6c02,_0x2fba8b))[_0xa380('0x43')](handleError(_0x3b6c02,null));};exports[_0xa380('0x5e')]=function(_0x19c446,_0xf59c2d,_0x279bd7){var _0x32127e={};var _0x29ee91={};var _0x16d0d2;var _0x22903f;return db[_0xa380('0x28')]['findOne']({'where':{'id':_0x19c446[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0xf59c2d,null))[_0xa380('0x1e')](function(_0x43d6b0){if(_0x43d6b0){_0x16d0d2=_0x43d6b0;_0x29ee91['model']=_[_0xa380('0x30')](db[_0xa380('0x5f')]['rawAttributes']);_0x29ee91[_0xa380('0x2f')]=_[_0xa380('0x30')](_0x19c446[_0xa380('0x2f')]);_0x29ee91[_0xa380('0x39')]=_[_0xa380('0x31')](_0x29ee91[_0xa380('0x2d')],_0x29ee91[_0xa380('0x2f')]);_0x32127e[_0xa380('0x32')]=_['intersection'](_0x29ee91['model'],qs[_0xa380('0x33')](_0x19c446[_0xa380('0x2f')]['fields']));_0x32127e['attributes']=_0x32127e['attributes'][_0xa380('0x34')]?_0x32127e['attributes']:_0x29ee91[_0xa380('0x2d')];_0x32127e[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x19c446['query'][_0xa380('0x38')]);_0x32127e[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x19c446[_0xa380('0x2f')],_0x29ee91['filters']));if(_0x19c446['query'][_0xa380('0x3b')]){_0x32127e[_0xa380('0x3c')]=_[_0xa380('0x3e')](_0x32127e['where'],{'$or':_[_0xa380('0x2e')](_0x32127e[_0xa380('0x32')],function(_0x3a3710){var _0xe85d05={};_0xe85d05[_0x3a3710]={'$like':'%'+_0x19c446[_0xa380('0x2f')][_0xa380('0x3b')]+'%'};return _0xe85d05;})});}_0x32127e=_[_0xa380('0x3e')]({},_0x32127e,_0x19c446[_0xa380('0x3f')]);return _0x16d0d2[_0xa380('0x5e')](_0x32127e);}})[_0xa380('0x1e')](function(_0x180d2f){if(_0x180d2f){_0x22903f=_0x180d2f['length'];if(!_0x19c446[_0xa380('0x2f')][_0xa380('0x35')](_0xa380('0x36'))){_0x32127e[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x19c446[_0xa380('0x2f')]['limit']);_0x32127e[_0xa380('0x16')]=qs['offset'](_0x19c446[_0xa380('0x2f')][_0xa380('0x16')]);}return _0x16d0d2[_0xa380('0x5e')](_0x32127e);}})['then'](function(_0x22b41f){if(_0x22b41f){return _0x22b41f?{'count':_0x22903f,'rows':_0x22b41f}:null;}})[_0xa380('0x1e')](respondWithResult(_0xf59c2d,null))['catch'](handleError(_0xf59c2d,null));};exports['addLists']=function(_0x7baf7e,_0xab8f31,_0x27ec2e){var _0x3fb79e,_0x1ef73f;var _0x4b7ac2=[];var _0xc69a8e=moment()[_0xa380('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa380('0x28')][_0xa380('0x4a')]({'where':{'id':_0x7baf7e[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0xab8f31,null))[_0xa380('0x1e')](function(_0x25bcde){if(_0x25bcde){_0x1ef73f=_0x25bcde;return _0x25bcde['addLists'](_0x7baf7e[_0xa380('0x46')][_0xa380('0x61')],_[_0xa380('0x4f')](_0x7baf7e[_0xa380('0x46')],[_0xa380('0x61'),'id'])||{});}return null;})['spread'](function(_0xb2a855){var _0x1f8d56;var _0x3a85d4;_0x3fb79e=_0xb2a855||[];var _0x1aaca6=[];if(_0xb2a855){for(var _0x2cfdb8=0x0;_0x2cfdb8<_0xb2a855[_0xa380('0x34')];_0x2cfdb8+=0x1){var _0x126e13=_0xb2a855[_0x2cfdb8][_0xa380('0x20')]({'plain':!![]});_0x1ef73f[_0xa380('0x62')]=_0x7baf7e[_0xa380('0x46')][_0xa380('0x62')]?_0x7baf7e[_0xa380('0x46')][_0xa380('0x62')]:_0x1ef73f[_0xa380('0x62')];switch(_0x1ef73f[_0xa380('0x62')]){case'always':_0x1f8d56=squel[_0xa380('0x63')]()['into']('cm_hopper')['fromQuery'](['phone',_0xa380('0x64'),_0xa380('0x65'),_0xa380('0x66'),_0xa380('0x57'),_0xa380('0x50'),'updatedAt'],squel[_0xa380('0x67')]()[_0xa380('0x68')](_0xa380('0x69'),'phone')[_0xa380('0x68')]('NOW()',_0xa380('0x64'))['field']('id',_0xa380('0x65'))[_0xa380('0x68')](_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')](),_0xa380('0x66'))[_0xa380('0x68')](_0x7baf7e['params']['id'][_0xa380('0x6b')](),_0xa380('0x57'))['field']('\x27'+_0xc69a8e+'\x27',_0xa380('0x50'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x51'))['from'](_0xa380('0x6c'))[_0xa380('0x3c')]('deletedAt\x20IS\x20NULL')[_0xa380('0x3c')](_0xa380('0x6d'),_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')]())[_0xa380('0x3c')](_0xa380('0x6e'))[_0xa380('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa380('0x67')]()['field'](_0xa380('0x6f'))['from'](_0xa380('0x70'))['where'](_0xa380('0x71'),_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')]()))[_0xa380('0x3c')](_0xa380('0x72'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xa380('0x73')](_0xa380('0x74'))[_0xa380('0x3c')](_0xa380('0x71'),_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')]())))[_0xa380('0x6b')]();break;case _0xa380('0x75'):_0x1f8d56=squel[_0xa380('0x63')]()[_0xa380('0x76')](_0xa380('0x74'))[_0xa380('0x77')](['phone','scheduledAt','ContactId',_0xa380('0x66'),_0xa380('0x57'),_0xa380('0x50'),_0xa380('0x51')],squel[_0xa380('0x67')]()[_0xa380('0x68')](_0xa380('0x69'),_0xa380('0x69'))[_0xa380('0x68')](_0xa380('0x78'),_0xa380('0x64'))[_0xa380('0x68')]('id',_0xa380('0x65'))[_0xa380('0x68')](_0x126e13[_0xa380('0x6a')]['toString'](),_0xa380('0x66'))['field'](_0x7baf7e[_0xa380('0x4e')]['id']['toString'](),'CampaignId')[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27','createdAt')[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x51'))[_0xa380('0x73')](_0xa380('0x6c'))[_0xa380('0x3c')](_0xa380('0x79'))[_0xa380('0x3c')](_0xa380('0x6d'),_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')]())['where'](_0xa380('0x6e'))[_0xa380('0x3c')](_0xa380('0x72'),squel[_0xa380('0x67')]()[_0xa380('0x68')]('COALESCE(phone,\x27\x27)')[_0xa380('0x73')](_0xa380('0x74'))['where'](_0xa380('0x71'),_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')]())))[_0xa380('0x6b')]();break;default:_0x1f8d56=squel[_0xa380('0x63')]()[_0xa380('0x76')](_0xa380('0x74'))['fromQuery']([_0xa380('0x69'),_0xa380('0x64'),_0xa380('0x65'),_0xa380('0x66'),_0xa380('0x57'),_0xa380('0x50'),'updatedAt'],squel['select']()[_0xa380('0x68')](_0xa380('0x69'),_0xa380('0x69'))[_0xa380('0x68')](_0xa380('0x78'),'scheduledAt')[_0xa380('0x68')]('id',_0xa380('0x65'))['field'](_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')](),_0xa380('0x66'))[_0xa380('0x68')](_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')](),_0xa380('0x57'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x50'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x51'))[_0xa380('0x73')](_0xa380('0x6c'))[_0xa380('0x3c')](_0xa380('0x79'))[_0xa380('0x3c')](_0xa380('0x6d'),_0x126e13[_0xa380('0x6a')][_0xa380('0x6b')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xa380('0x6b')]();}_0x3a85d4=squel[_0xa380('0x63')]()[_0xa380('0x76')](_0xa380('0x7a'))[_0xa380('0x77')]([_0xa380('0x7b'),_0xa380('0x64'),'phone',_0xa380('0x7c'),_0xa380('0x50'),_0xa380('0x51')],squel[_0xa380('0x67')]()['field']('h.id','id')[_0xa380('0x68')]('NOW()',_0xa380('0x64'))[_0xa380('0x68')](_0xa380('0x7d'),_0xa380('0x69'))[_0xa380('0x68')]('ci.OrderBY',_0xa380('0x7c'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x50'))[_0xa380('0x68')]('\x27'+_0xc69a8e+'\x27',_0xa380('0x51'))[_0xa380('0x73')](_0xa380('0x7e'),'ci')[_0xa380('0x7f')](_0xa380('0x74'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0xa380('0x80'),_0x126e13[_0xa380('0x6a')]['toString']())[_0xa380('0x3c')](_0xa380('0x81'),_0x7baf7e[_0xa380('0x4e')]['id'][_0xa380('0x6b')]())[_0xa380('0x3c')](_0xa380('0x82'),_0xc69a8e))[_0xa380('0x6b')]();_0x1aaca6['push'](db[_0xa380('0x83')][_0xa380('0x2f')](_0x1f8d56));_0x4b7ac2['push'](db[_0xa380('0x83')][_0xa380('0x2f')](_0x3a85d4));}return BPromise[_0xa380('0x84')](_0x1aaca6);}})[_0xa380('0x1e')](function(){return BPromise[_0xa380('0x84')](_0x4b7ac2);})[_0xa380('0x1e')](function(){return _0x3fb79e;})['then'](respondWithResult(_0xab8f31,null))[_0xa380('0x43')](handleError(_0xab8f31,null));};exports[_0xa380('0x85')]=function(_0x7a1c27,_0xc336da,_0x26eeaa){return db[_0xa380('0x28')]['find']({'where':{'id':_0x7a1c27[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0xc336da,null))[_0xa380('0x1e')](function(_0x271a69){if(_0x271a69){return _0x271a69['removeLists'](_0x7a1c27[_0xa380('0x2f')][_0xa380('0x61')]);}})[_0xa380('0x1e')](function(_0x452b45){if(_0x452b45){return db[_0xa380('0x56')]['destroy']({'where':{'ListId':_0x7a1c27[_0xa380('0x2f')][_0xa380('0x61')],'CampaignId':_0x7a1c27[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](function(){return _0x452b45;});}})['then'](respondWithStatusCode(_0xc336da,null))['catch'](handleError(_0xc336da,null));};exports[_0xa380('0x86')]=function(_0x568d4f,_0x3ab73f,_0x151742){var _0x18ba86={};var _0x34856d={};var _0x2dfd5b;var _0x3d7f4d;return db[_0xa380('0x28')][_0xa380('0x55')]({'where':{'id':_0x568d4f[_0xa380('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3ab73f,null))[_0xa380('0x1e')](function(_0x257e31){if(_0x257e31){_0x2dfd5b=_0x257e31;_0x34856d[_0xa380('0x2d')]=_[_0xa380('0x30')](db[_0xa380('0x5f')]['rawAttributes']);_0x34856d[_0xa380('0x2f')]=_[_0xa380('0x30')](_0x568d4f[_0xa380('0x2f')]);_0x34856d[_0xa380('0x39')]=_['intersection'](_0x34856d[_0xa380('0x2d')],_0x34856d[_0xa380('0x2f')]);_0x18ba86[_0xa380('0x32')]=_[_0xa380('0x31')](_0x34856d[_0xa380('0x2d')],qs[_0xa380('0x33')](_0x568d4f[_0xa380('0x2f')][_0xa380('0x33')]));_0x18ba86[_0xa380('0x32')]=_0x18ba86[_0xa380('0x32')][_0xa380('0x34')]?_0x18ba86[_0xa380('0x32')]:_0x34856d[_0xa380('0x2d')];_0x18ba86[_0xa380('0x37')]=qs[_0xa380('0x38')](_0x568d4f[_0xa380('0x2f')][_0xa380('0x38')]);_0x18ba86[_0xa380('0x3c')]=qs[_0xa380('0x39')](_[_0xa380('0x3a')](_0x568d4f[_0xa380('0x2f')],_0x34856d['filters']));if(_0x568d4f['query'][_0xa380('0x3b')]){_0x18ba86[_0xa380('0x3c')]=_[_0xa380('0x3e')](_0x18ba86[_0xa380('0x3c')],{'$or':_['map'](_0x18ba86[_0xa380('0x32')],function(_0x47662d){var _0x4b5e6e={};_0x4b5e6e[_0x47662d]={'$like':'%'+_0x568d4f['query']['filter']+'%'};return _0x4b5e6e;})});}_0x18ba86=_[_0xa380('0x3e')]({},_0x18ba86,_0x568d4f[_0xa380('0x3f')]);return _0x2dfd5b[_0xa380('0x86')](_0x18ba86);}})[_0xa380('0x1e')](function(_0x4cd7e9){if(_0x4cd7e9){_0x3d7f4d=_0x4cd7e9[_0xa380('0x34')];if(!_0x568d4f[_0xa380('0x2f')][_0xa380('0x35')](_0xa380('0x36'))){_0x18ba86[_0xa380('0x18')]=qs[_0xa380('0x18')](_0x568d4f[_0xa380('0x2f')]['limit']);_0x18ba86[_0xa380('0x16')]=qs[_0xa380('0x16')](_0x568d4f[_0xa380('0x2f')][_0xa380('0x16')]);}return _0x2dfd5b[_0xa380('0x86')](_0x18ba86);}})['then'](function(_0x13ed9a){if(_0x13ed9a){return _0x13ed9a?{'count':_0x3d7f4d,'rows':_0x13ed9a}:null;}})[_0xa380('0x1e')](respondWithResult(_0x3ab73f,null))[_0xa380('0x43')](handleError(_0x3ab73f,null));};exports[_0xa380('0x87')]=function(_0x17b81d,_0x4d9a3f,_0x542de1){var _0xe45fbd,_0x51bd76;var _0x375e4b=[];var _0x35ec01=moment()['format'](_0xa380('0x88'));return db[_0xa380('0x28')]['find']({'where':{'id':_0x17b81d['params']['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x4d9a3f,null))[_0xa380('0x1e')](function(_0x43b116){if(_0x43b116){_0x51bd76=_0x43b116;return _0x43b116[_0xa380('0x87')](_0x17b81d[_0xa380('0x46')]['ids'],_['omit'](_0x17b81d['body'],[_0xa380('0x61'),'id'])||{});}return null;})[_0xa380('0x89')](function(_0x5e6237){var _0x38690e;var _0x1a97b0;_0xe45fbd=_0x5e6237||[];var _0x47d253=[];if(_0x5e6237){for(var _0x1fe4ad=0x0;_0x1fe4ad<_0x5e6237[_0xa380('0x34')];_0x1fe4ad+=0x1){var _0x19e04a=_0x5e6237[_0x1fe4ad][_0xa380('0x20')]({'plain':!![]});_0x38690e=squel[_0xa380('0x63')]()[_0xa380('0x76')]('cm_hopper_black')['fromQuery']([_0xa380('0x69'),_0xa380('0x65'),_0xa380('0x66'),_0xa380('0x57'),_0xa380('0x50'),'updatedAt'],squel[_0xa380('0x67')]()[_0xa380('0x68')](_0xa380('0x69'),_0xa380('0x69'))[_0xa380('0x68')]('id','ContactId')['field'](_0x19e04a[_0xa380('0x6a')][_0xa380('0x6b')](),'ListId')[_0xa380('0x68')](_0x17b81d[_0xa380('0x4e')]['id'][_0xa380('0x6b')](),_0xa380('0x57'))[_0xa380('0x68')]('NOW()',_0xa380('0x50'))[_0xa380('0x68')](_0xa380('0x78'),_0xa380('0x51'))[_0xa380('0x73')](_0xa380('0x6c'))[_0xa380('0x3c')](_0xa380('0x79'))[_0xa380('0x3c')](_0xa380('0x6d'),_0x19e04a[_0xa380('0x6a')][_0xa380('0x6b')]())[_0xa380('0x3c')](_0xa380('0x6e')))['toString']();_0x47d253[_0xa380('0x8a')](db[_0xa380('0x83')][_0xa380('0x2f')](_0x38690e));}return BPromise[_0xa380('0x84')](_0x47d253);}})['then'](function(){return _0xe45fbd;})[_0xa380('0x1e')](respondWithResult(_0x4d9a3f,null))[_0xa380('0x43')](handleError(_0x4d9a3f,null));};exports[_0xa380('0x8b')]=function(_0x5a157b,_0x1673c2,_0x43a7da){return db[_0xa380('0x28')][_0xa380('0x4a')]({'where':{'id':_0x5a157b[_0xa380('0x4e')]['id']}})[_0xa380('0x1e')](handleEntityNotFound(_0x1673c2,null))['then'](function(_0x1d6bbb){if(_0x1d6bbb){return _0x1d6bbb[_0xa380('0x8b')](_0x5a157b[_0xa380('0x2f')][_0xa380('0x61')]);}})['then'](function(_0x59f023){if(_0x59f023){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x5a157b[_0xa380('0x2f')]['ids'],'CampaignId':_0x5a157b['params']['id']}})['then'](function(){return _0x59f023;});}})[_0xa380('0x1e')](respondWithStatusCode(_0x1673c2,null))[_0xa380('0x43')](handleError(_0x1673c2,null));};
\ No newline at end of file
+var _0x3526=['COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','IvrCampaigns','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','select','field','phone','NOW()','ContactId','CmListId','toString','ListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?'];(function(_0x50b9b0,_0x427e8b){var _0x37316f=function(_0x290bd1){while(--_0x290bd1){_0x50b9b0['push'](_0x50b9b0['shift']());}};_0x37316f(++_0x427e8b);}(_0x3526,0x1db));var _0x6352=function(_0x614875,_0x289fdf){_0x614875=_0x614875-0x0;var _0x546b39=_0x3526[_0x614875];return _0x546b39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6352('0x0'));var zipdir=require(_0x6352('0x1'));var jsonpatch=require(_0x6352('0x2'));var rp=require(_0x6352('0x3'));var moment=require(_0x6352('0x4'));var BPromise=require(_0x6352('0x5'));var Mustache=require(_0x6352('0x6'));var util=require(_0x6352('0x7'));var path=require(_0x6352('0x8'));var sox=require(_0x6352('0x9'));var csv=require(_0x6352('0xa'));var ejs=require(_0x6352('0xb'));var fs=require('fs');var fs_extra=require(_0x6352('0xc'));var _=require(_0x6352('0xd'));var squel=require(_0x6352('0xe'));var crypto=require(_0x6352('0xf'));var jsforce=require(_0x6352('0x10'));var deskjs=require(_0x6352('0x11'));var toCsv=require(_0x6352('0xa'));var querystring=require(_0x6352('0x12'));var Papa=require('papaparse');var Redis=require(_0x6352('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6352('0x14'))(_0x6352('0x15'));var utils=require(_0x6352('0x16'));var config=require(_0x6352('0x17'));var licenseUtil=require(_0x6352('0x18'));var db=require(_0x6352('0x19'))['db'];function respondWithStatusCode(_0x4abb00,_0x362122){_0x362122=_0x362122||0xcc;return function(_0x2f43aa){if(_0x2f43aa){return _0x4abb00[_0x6352('0x1a')](_0x362122);}return _0x4abb00[_0x6352('0x1b')](_0x362122)[_0x6352('0x1c')]();};}function respondWithResult(_0x38245f,_0x47aa91){_0x47aa91=_0x47aa91||0xc8;return function(_0x505e23){if(_0x505e23){return _0x38245f[_0x6352('0x1b')](_0x47aa91)[_0x6352('0x1d')](_0x505e23);}};}function respondWithFilteredResult(_0xeb0285,_0x56ad95){return function(_0x44b0dc){if(_0x44b0dc){var _0x3b494e=typeof _0x56ad95[_0x6352('0x1e')]===_0x6352('0x1f')&&typeof _0x56ad95[_0x6352('0x20')]===_0x6352('0x1f');var _0x315a7e=_0x44b0dc[_0x6352('0x21')];var _0x2fcc57=_0x3b494e?0x0:_0x56ad95[_0x6352('0x1e')];var _0x486d35=_0x3b494e?_0x44b0dc[_0x6352('0x21')]:_0x56ad95['offset']+_0x56ad95[_0x6352('0x20')];var _0x5dd1c7;if(_0x486d35>=_0x315a7e){_0x486d35=_0x315a7e;_0x5dd1c7=0xc8;}else{_0x5dd1c7=0xce;}_0xeb0285[_0x6352('0x1b')](_0x5dd1c7);return _0xeb0285[_0x6352('0x22')](_0x6352('0x23'),_0x2fcc57+'-'+_0x486d35+'/'+_0x315a7e)[_0x6352('0x1d')](_0x44b0dc);}return null;};}function patchUpdates(_0xaf2621){return function(_0x3d66d8){try{jsonpatch['apply'](_0x3d66d8,_0xaf2621,!![]);}catch(_0x3b72f7){return BPromise[_0x6352('0x24')](_0x3b72f7);}return _0x3d66d8[_0x6352('0x25')]();};}function saveUpdates(_0x9560eb,_0x105755){return function(_0x4b8ded){if(_0x4b8ded){return _0x4b8ded['update'](_0x9560eb)[_0x6352('0x26')](function(_0x37f842){return _0x37f842;});}return null;};}function removeEntity(_0xfef8fd,_0x3988b4){return function(_0x335cfd){if(_0x335cfd){return _0x335cfd[_0x6352('0x27')]()['then'](function(){var _0x57e927=_0x335cfd[_0x6352('0x28')]({'plain':!![]});var _0x5b5621='IvrCampaigns';return db['UserProfileResource'][_0x6352('0x27')]({'where':{'type':_0x5b5621,'resourceId':_0x57e927['id']}})[_0x6352('0x26')](function(){return _0x335cfd;});})[_0x6352('0x26')](function(){_0xfef8fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cfd8,_0x549bb9){return function(_0x17d977){if(!_0x17d977){_0x45cfd8['sendStatus'](0x194);}return _0x17d977;};}function handleError(_0x2dab10,_0x42ec09){_0x42ec09=_0x42ec09||0x1f4;return function(_0x24b356){logger[_0x6352('0x29')](_0x24b356[_0x6352('0x2a')]);if(_0x24b356[_0x6352('0x2b')]){delete _0x24b356[_0x6352('0x2b')];}_0x2dab10[_0x6352('0x1b')](_0x42ec09)[_0x6352('0x2c')](_0x24b356);};}exports[_0x6352('0x2d')]=function(_0x2ed032,_0x1b6b7a){var _0x23971f={},_0x31a95d={},_0x2ff5bd={'count':0x0,'rows':[]};var _0x2c7365=_['map'](db[_0x6352('0x2e')][_0x6352('0x2f')],function(_0x562e46){return{'name':_0x562e46[_0x6352('0x30')],'type':_0x562e46[_0x6352('0x31')][_0x6352('0x32')]};});_0x31a95d[_0x6352('0x33')]=_[_0x6352('0x34')](_0x2c7365,_0x6352('0x2b'));_0x31a95d[_0x6352('0x35')]=_[_0x6352('0x36')](_0x2ed032[_0x6352('0x35')]);_0x31a95d[_0x6352('0x37')]=_[_0x6352('0x38')](_0x31a95d[_0x6352('0x33')],_0x31a95d['query']);_0x23971f[_0x6352('0x39')]=_[_0x6352('0x38')](_0x31a95d[_0x6352('0x33')],qs[_0x6352('0x3a')](_0x2ed032['query'][_0x6352('0x3a')]));_0x23971f[_0x6352('0x39')]=_0x23971f[_0x6352('0x39')][_0x6352('0x3b')]?_0x23971f[_0x6352('0x39')]:_0x31a95d['model'];if(!_0x2ed032['query']['hasOwnProperty'](_0x6352('0x3c'))){_0x23971f[_0x6352('0x20')]=qs['limit'](_0x2ed032[_0x6352('0x35')][_0x6352('0x20')]);_0x23971f[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0x2ed032[_0x6352('0x35')][_0x6352('0x1e')]);}_0x23971f[_0x6352('0x3d')]=qs[_0x6352('0x3e')](_0x2ed032['query'][_0x6352('0x3e')]);_0x23971f['where']=qs['filters'](_[_0x6352('0x3f')](_0x2ed032['query'],_0x31a95d[_0x6352('0x37')]),_0x2c7365);if(_0x2ed032[_0x6352('0x35')]['filter']){_0x23971f[_0x6352('0x40')]=_['merge'](_0x23971f['where'],{'$or':_[_0x6352('0x34')](_0x2c7365,function(_0x41245c){if(_0x41245c[_0x6352('0x31')]!==_0x6352('0x41')){var _0x240ebc={};_0x240ebc[_0x41245c[_0x6352('0x2b')]]={'$like':'%'+_0x2ed032['query'][_0x6352('0x42')]+'%'};return _0x240ebc;}})});}_0x23971f=_['merge']({},_0x23971f,_0x2ed032[_0x6352('0x43')]);var _0x461f48={'where':_0x23971f[_0x6352('0x40')]};return db['Campaign'][_0x6352('0x21')](_0x461f48)['then'](function(_0x1c6e69){_0x2ff5bd[_0x6352('0x21')]=_0x1c6e69;if(_0x2ed032[_0x6352('0x35')][_0x6352('0x44')]){_0x23971f[_0x6352('0x45')]=[{'all':!![]}];}return db[_0x6352('0x2e')][_0x6352('0x46')](_0x23971f);})[_0x6352('0x26')](function(_0x1e1952){_0x2ff5bd[_0x6352('0x47')]=_0x1e1952;return _0x2ff5bd;})[_0x6352('0x26')](respondWithFilteredResult(_0x1b6b7a,_0x23971f))[_0x6352('0x48')](handleError(_0x1b6b7a,null));};exports[_0x6352('0x49')]=function(_0x4b3233,_0x27fd8a){var _0x4ddbdb={'raw':![],'where':{'id':_0x4b3233[_0x6352('0x4a')]['id']}},_0x177012={};_0x177012['model']=_[_0x6352('0x36')](db[_0x6352('0x2e')]['rawAttributes']);_0x177012['query']=_[_0x6352('0x36')](_0x4b3233[_0x6352('0x35')]);_0x177012[_0x6352('0x37')]=_[_0x6352('0x38')](_0x177012['model'],_0x177012[_0x6352('0x35')]);_0x4ddbdb[_0x6352('0x39')]=_[_0x6352('0x38')](_0x177012['model'],qs['fields'](_0x4b3233['query'][_0x6352('0x3a')]));_0x4ddbdb[_0x6352('0x39')]=_0x4ddbdb[_0x6352('0x39')][_0x6352('0x3b')]?_0x4ddbdb[_0x6352('0x39')]:_0x177012[_0x6352('0x33')];if(_0x4b3233['query'][_0x6352('0x44')]){_0x4ddbdb['include']=[{'all':!![]}];}_0x4ddbdb=_[_0x6352('0x4b')]({},_0x4ddbdb,_0x4b3233[_0x6352('0x43')]);return db['Campaign'][_0x6352('0x4c')](_0x4ddbdb)[_0x6352('0x26')](handleEntityNotFound(_0x27fd8a,null))[_0x6352('0x26')](respondWithResult(_0x27fd8a,null))[_0x6352('0x48')](handleError(_0x27fd8a,null));};exports['create']=function(_0x43f8af,_0x501994){return db[_0x6352('0x2e')][_0x6352('0x4d')](_0x43f8af[_0x6352('0x4e')],{})[_0x6352('0x26')](function(_0x5949bc){var _0x25a772=_0x43f8af[_0x6352('0x4f')][_0x6352('0x28')]({'plain':!![]});if(!_0x25a772)throw new Error(_0x6352('0x50'));if(_0x25a772[_0x6352('0x51')]===_0x6352('0x4f')){var _0x4a0253=_0x5949bc[_0x6352('0x28')]({'plain':!![]});var _0x142c87='IvrCampaigns';return db[_0x6352('0x52')][_0x6352('0x4c')]({'where':{'name':_0x142c87,'userProfileId':_0x25a772[_0x6352('0x53')]},'raw':!![]})[_0x6352('0x26')](function(_0x2ccf73){if(_0x2ccf73&&_0x2ccf73[_0x6352('0x54')]===0x0){return db[_0x6352('0x55')][_0x6352('0x4d')]({'name':_0x4a0253['name'],'resourceId':_0x4a0253['id'],'type':_0x2ccf73[_0x6352('0x2b')],'sectionId':_0x2ccf73['id']},{})[_0x6352('0x26')](function(){return _0x5949bc;});}else{return _0x5949bc;}})[_0x6352('0x48')](function(_0xa0c13d){logger[_0x6352('0x29')](_0x6352('0x56'),_0xa0c13d);throw _0xa0c13d;});}return _0x5949bc;})['then'](respondWithResult(_0x501994,0xc9))['catch'](handleError(_0x501994,null));};exports['clone']=function(_0x315c26,_0x15416a){var _0xd04b9a={'where':{'id':_0x315c26[_0x6352('0x4a')]['id']}},_0x4f3b23={};_0x4f3b23['model']=_[_0x6352('0x36')](db[_0x6352('0x2e')][_0x6352('0x2f')]);_0xd04b9a[_0x6352('0x39')]=_[_0x6352('0x38')](_0x4f3b23[_0x6352('0x33')],qs[_0x6352('0x3a')](_0x315c26['query'][_0x6352('0x3a')]));_0xd04b9a['attributes']=_0xd04b9a[_0x6352('0x39')]['length']?_0xd04b9a[_0x6352('0x39')]:_0x4f3b23[_0x6352('0x33')];if(_0x315c26[_0x6352('0x35')][_0x6352('0x44')]){_0xd04b9a[_0x6352('0x45')]=[{'all':!![]}];}_0xd04b9a=_[_0x6352('0x4b')]({},_0xd04b9a,_0x315c26[_0x6352('0x43')]);return db[_0x6352('0x2e')][_0x6352('0x4c')](_0xd04b9a)['then'](handleEntityNotFound(_0x15416a,null))['then'](function(_0x279a04){if(_0x279a04){var _0x245a76=_0x279a04[_0x6352('0x28')]({'plain':!![]});_0x245a76=qs[_0x6352('0x57')](_0x245a76,['id',_0x6352('0x58'),_0x6352('0x59')]);_0x315c26[_0x6352('0x4e')]=_[_0x6352('0x57')](_0x315c26[_0x6352('0x4e')],['id',_0x6352('0x58'),_0x6352('0x59')]);return db['Campaign'][_0x6352('0x4d')](_[_0x6352('0x4b')](_0x245a76,_0x315c26['body']),{'include':_0x315c26[_0x6352('0x35')][_0x6352('0x44')]?[{'all':!![]}]:undefined})[_0x6352('0x26')](function(_0x3cbd21){var _0x206c19=_0x315c26[_0x6352('0x4f')]['get']({'plain':!![]});if(!_0x206c19)throw new Error(_0x6352('0x50'));if(_0x206c19[_0x6352('0x51')]==='user'){var _0x272fd4=_0x3cbd21[_0x6352('0x28')]({'plain':!![]});var _0x1ea6ae=_0x6352('0x5a');return db['UserProfileSection'][_0x6352('0x4c')]({'where':{'name':_0x1ea6ae,'userProfileId':_0x206c19[_0x6352('0x53')]},'raw':!![]})[_0x6352('0x26')](function(_0x3b06e6){if(_0x3b06e6&&_0x3b06e6[_0x6352('0x54')]===0x0){return db['UserProfileResource'][_0x6352('0x4d')]({'name':_0x272fd4['name'],'resourceId':_0x272fd4['id'],'type':_0x3b06e6[_0x6352('0x2b')],'sectionId':_0x3b06e6['id']},{})[_0x6352('0x26')](function(){return _0x3cbd21;});}else{return _0x3cbd21;}})[_0x6352('0x48')](function(_0x5a0500){logger['error'](_0x6352('0x56'),_0x5a0500);throw _0x5a0500;});}return _0x3cbd21;});}})[_0x6352('0x26')](respondWithResult(_0x15416a,0xc9))[_0x6352('0x48')](handleError(_0x15416a,null));};exports['update']=function(_0x4a190f,_0x5df225){if(_0x4a190f[_0x6352('0x4e')]['id']){delete _0x4a190f[_0x6352('0x4e')]['id'];}return db['Campaign'][_0x6352('0x4c')]({'where':{'id':_0x4a190f[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x5df225,null))[_0x6352('0x26')](saveUpdates(_0x4a190f[_0x6352('0x4e')],null))[_0x6352('0x26')](respondWithResult(_0x5df225,null))['catch'](handleError(_0x5df225,null));};exports['destroy']=function(_0x4e76df,_0x594b1c){return db[_0x6352('0x2e')]['find']({'where':{'id':_0x4e76df[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x594b1c,null))[_0x6352('0x26')](removeEntity(_0x594b1c,null))[_0x6352('0x48')](handleError(_0x594b1c,null));};exports[_0x6352('0x5b')]=function(_0xdbd694,_0x8bfce8,_0x129ed1){var _0x2916aa={'raw':!![],'where':{}};var _0x178d56={};var _0x59e049={'count':0x0,'rows':[]};return db[_0x6352('0x2e')][_0x6352('0x5c')]({'where':{'id':_0xdbd694['params']['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x8bfce8,null))[_0x6352('0x26')](function(_0xcf8a5){if(_0xcf8a5){_0x178d56[_0x6352('0x33')]=_[_0x6352('0x36')](db[_0x6352('0x5d')][_0x6352('0x2f')]);_0x178d56[_0x6352('0x35')]=_['keys'](_0xdbd694[_0x6352('0x35')]);_0x178d56['filters']=_[_0x6352('0x38')](_0x178d56[_0x6352('0x33')],_0x178d56[_0x6352('0x35')]);_0x2916aa[_0x6352('0x39')]=_[_0x6352('0x38')](_0x178d56[_0x6352('0x33')],qs[_0x6352('0x3a')](_0xdbd694['query'][_0x6352('0x3a')]));_0x2916aa[_0x6352('0x39')]=_0x2916aa[_0x6352('0x39')][_0x6352('0x3b')]?_0x2916aa[_0x6352('0x39')]:_0x178d56[_0x6352('0x33')];if(!_0xdbd694[_0x6352('0x35')][_0x6352('0x5e')](_0x6352('0x3c'))){_0x2916aa[_0x6352('0x20')]=qs['limit'](_0xdbd694[_0x6352('0x35')][_0x6352('0x20')]);_0x2916aa['offset']=qs['offset'](_0xdbd694[_0x6352('0x35')][_0x6352('0x1e')]);}_0x2916aa['order']=qs[_0x6352('0x3e')](_0xdbd694[_0x6352('0x35')]['sort']);_0x2916aa[_0x6352('0x40')]=qs['filters'](_[_0x6352('0x3f')](_0xdbd694[_0x6352('0x35')],_0x178d56[_0x6352('0x37')]));_0x2916aa['where'][_0x6352('0x5f')]=_0xcf8a5['id'];if(_0xdbd694[_0x6352('0x35')]['filter']){_0x2916aa['where']=_['merge'](_0x2916aa[_0x6352('0x40')],{'$or':_[_0x6352('0x34')](_0x2916aa[_0x6352('0x39')],function(_0x2e189d){var _0xee5e05={};_0xee5e05[_0x2e189d]={'$like':'%'+_0xdbd694['query'][_0x6352('0x42')]+'%'};return _0xee5e05;})});}_0x2916aa=_['merge']({},_0x2916aa,_0xdbd694[_0x6352('0x43')]);return db[_0x6352('0x5d')][_0x6352('0x21')]({'where':_0x2916aa['where']})[_0x6352('0x26')](function(_0x40ea58){_0x59e049[_0x6352('0x21')]=_0x40ea58;if(_0xdbd694[_0x6352('0x35')][_0x6352('0x44')]){_0x2916aa[_0x6352('0x45')]=[{'all':!![]}];}return db[_0x6352('0x5d')][_0x6352('0x46')](_0x2916aa);})[_0x6352('0x26')](function(_0x3ddac3){_0x59e049['rows']=_0x3ddac3;return _0x59e049;});}})[_0x6352('0x26')](respondWithFilteredResult(_0x8bfce8,_0x2916aa))[_0x6352('0x48')](handleError(_0x8bfce8,null));};exports['getHopperHistories']=function(_0xb6353e,_0x5a359c,_0x5e7860){var _0xfdc628={'raw':!![],'where':{}};var _0xdea9b8={};var _0x2c00ae={'count':0x0,'rows':[]};return db['Campaign'][_0x6352('0x5c')]({'where':{'id':_0xb6353e[_0x6352('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a359c,null))['then'](function(_0x5c159d){if(_0x5c159d){_0xdea9b8[_0x6352('0x33')]=_[_0x6352('0x36')](db['CmHopperHistory'][_0x6352('0x2f')]);_0xdea9b8[_0x6352('0x35')]=_[_0x6352('0x36')](_0xb6353e['query']);_0xdea9b8[_0x6352('0x37')]=_[_0x6352('0x38')](_0xdea9b8[_0x6352('0x33')],_0xdea9b8[_0x6352('0x35')]);_0xfdc628[_0x6352('0x39')]=_[_0x6352('0x38')](_0xdea9b8[_0x6352('0x33')],qs[_0x6352('0x3a')](_0xb6353e['query']['fields']));_0xfdc628[_0x6352('0x39')]=_0xfdc628[_0x6352('0x39')][_0x6352('0x3b')]?_0xfdc628[_0x6352('0x39')]:_0xdea9b8[_0x6352('0x33')];if(!_0xb6353e[_0x6352('0x35')][_0x6352('0x5e')](_0x6352('0x3c'))){_0xfdc628['limit']=qs['limit'](_0xb6353e['query'][_0x6352('0x20')]);_0xfdc628[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0xb6353e['query'][_0x6352('0x1e')]);}_0xfdc628[_0x6352('0x3d')]=qs[_0x6352('0x3e')](_0xb6353e[_0x6352('0x35')]['sort']);_0xfdc628[_0x6352('0x40')]=qs[_0x6352('0x37')](_[_0x6352('0x3f')](_0xb6353e[_0x6352('0x35')],_0xdea9b8[_0x6352('0x37')]));_0xfdc628[_0x6352('0x40')][_0x6352('0x5f')]=_0x5c159d['id'];if(_0xb6353e[_0x6352('0x35')]['filter']){_0xfdc628[_0x6352('0x40')]=_[_0x6352('0x4b')](_0xfdc628[_0x6352('0x40')],{'$or':_[_0x6352('0x34')](_0xfdc628['attributes'],function(_0x258a7c){var _0x4e4185={};_0x4e4185[_0x258a7c]={'$like':'%'+_0xb6353e[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0x4e4185;})});}_0xfdc628=_[_0x6352('0x4b')]({},_0xfdc628,_0xb6353e[_0x6352('0x43')]);return db[_0x6352('0x60')][_0x6352('0x21')]({'where':_0xfdc628[_0x6352('0x40')]})[_0x6352('0x26')](function(_0x17a7b6){_0x2c00ae[_0x6352('0x21')]=_0x17a7b6;if(_0xb6353e[_0x6352('0x35')][_0x6352('0x44')]){_0xfdc628[_0x6352('0x45')]=[{'all':!![]}];}return db[_0x6352('0x60')][_0x6352('0x46')](_0xfdc628);})[_0x6352('0x26')](function(_0x246341){_0x2c00ae[_0x6352('0x47')]=_0x246341;return _0x2c00ae;});}})['then'](respondWithFilteredResult(_0x5a359c,_0xfdc628))['catch'](handleError(_0x5a359c,null));};exports[_0x6352('0x61')]=function(_0x2be178,_0x14155a,_0x3075fb){var _0x3f632b={'raw':!![],'where':{}};var _0x1e4d53={};var _0x5c56ec={'count':0x0,'rows':[]};return db['Campaign'][_0x6352('0x5c')]({'where':{'id':_0x2be178[_0x6352('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14155a,null))[_0x6352('0x26')](function(_0x4f4cbf){if(_0x4f4cbf){_0x1e4d53['model']=_[_0x6352('0x36')](db[_0x6352('0x62')][_0x6352('0x2f')]);_0x1e4d53[_0x6352('0x35')]=_['keys'](_0x2be178['query']);_0x1e4d53[_0x6352('0x37')]=_[_0x6352('0x38')](_0x1e4d53[_0x6352('0x33')],_0x1e4d53['query']);_0x3f632b[_0x6352('0x39')]=_['intersection'](_0x1e4d53[_0x6352('0x33')],qs[_0x6352('0x3a')](_0x2be178[_0x6352('0x35')][_0x6352('0x3a')]));_0x3f632b[_0x6352('0x39')]=_0x3f632b[_0x6352('0x39')][_0x6352('0x3b')]?_0x3f632b[_0x6352('0x39')]:_0x1e4d53['model'];if(!_0x2be178['query'][_0x6352('0x5e')]('nolimit')){_0x3f632b[_0x6352('0x20')]=qs[_0x6352('0x20')](_0x2be178[_0x6352('0x35')][_0x6352('0x20')]);_0x3f632b[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0x2be178[_0x6352('0x35')][_0x6352('0x1e')]);}_0x3f632b['order']=qs[_0x6352('0x3e')](_0x2be178[_0x6352('0x35')][_0x6352('0x3e')]);_0x3f632b[_0x6352('0x40')]=qs[_0x6352('0x37')](_[_0x6352('0x3f')](_0x2be178[_0x6352('0x35')],_0x1e4d53[_0x6352('0x37')]));_0x3f632b['where'][_0x6352('0x5f')]=_0x4f4cbf['id'];if(_0x2be178[_0x6352('0x35')][_0x6352('0x42')]){_0x3f632b[_0x6352('0x40')]=_['merge'](_0x3f632b[_0x6352('0x40')],{'$or':_[_0x6352('0x34')](_0x3f632b[_0x6352('0x39')],function(_0x59475c){var _0xdaa939={};_0xdaa939[_0x59475c]={'$like':'%'+_0x2be178[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0xdaa939;})});}_0x3f632b=_['merge']({},_0x3f632b,_0x2be178['options']);return db[_0x6352('0x62')][_0x6352('0x21')]({'where':_0x3f632b[_0x6352('0x40')]})[_0x6352('0x26')](function(_0x104b96){_0x5c56ec['count']=_0x104b96;if(_0x2be178[_0x6352('0x35')][_0x6352('0x44')]){_0x3f632b[_0x6352('0x45')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3f632b);})['then'](function(_0x2089ab){_0x5c56ec[_0x6352('0x47')]=_0x2089ab;return _0x5c56ec;});}})[_0x6352('0x26')](respondWithFilteredResult(_0x14155a,_0x3f632b))[_0x6352('0x48')](handleError(_0x14155a,null));};exports[_0x6352('0x63')]=function(_0x5f210a,_0x290fbd,_0x2af060){var _0x407e16={'raw':!![],'where':{}};var _0x3d91f3={};var _0x224529={'count':0x0,'rows':[]};return db[_0x6352('0x2e')][_0x6352('0x5c')]({'where':{'id':_0x5f210a[_0x6352('0x4a')]['id']}})['then'](handleEntityNotFound(_0x290fbd,null))['then'](function(_0x15c3bf){if(_0x15c3bf){_0x3d91f3[_0x6352('0x33')]=_[_0x6352('0x36')](db['CmHopperBlack']['rawAttributes']);_0x3d91f3['query']=_['keys'](_0x5f210a['query']);_0x3d91f3[_0x6352('0x37')]=_['intersection'](_0x3d91f3[_0x6352('0x33')],_0x3d91f3[_0x6352('0x35')]);_0x407e16[_0x6352('0x39')]=_[_0x6352('0x38')](_0x3d91f3[_0x6352('0x33')],qs['fields'](_0x5f210a[_0x6352('0x35')][_0x6352('0x3a')]));_0x407e16[_0x6352('0x39')]=_0x407e16[_0x6352('0x39')][_0x6352('0x3b')]?_0x407e16[_0x6352('0x39')]:_0x3d91f3['model'];if(!_0x5f210a[_0x6352('0x35')]['hasOwnProperty'](_0x6352('0x3c'))){_0x407e16[_0x6352('0x20')]=qs[_0x6352('0x20')](_0x5f210a['query'][_0x6352('0x20')]);_0x407e16[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0x5f210a[_0x6352('0x35')]['offset']);}_0x407e16[_0x6352('0x3d')]=qs[_0x6352('0x3e')](_0x5f210a[_0x6352('0x35')][_0x6352('0x3e')]);_0x407e16[_0x6352('0x40')]=qs['filters'](_[_0x6352('0x3f')](_0x5f210a[_0x6352('0x35')],_0x3d91f3[_0x6352('0x37')]));_0x407e16['where'][_0x6352('0x5f')]=_0x15c3bf['id'];if(_0x5f210a[_0x6352('0x35')]['filter']){_0x407e16[_0x6352('0x40')]=_[_0x6352('0x4b')](_0x407e16[_0x6352('0x40')],{'$or':_['map'](_0x407e16['attributes'],function(_0x1f2104){var _0x38360f={};_0x38360f[_0x1f2104]={'$like':'%'+_0x5f210a[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0x38360f;})});}_0x407e16=_['merge']({},_0x407e16,_0x5f210a[_0x6352('0x43')]);return db[_0x6352('0x64')][_0x6352('0x21')]({'where':_0x407e16[_0x6352('0x40')]})[_0x6352('0x26')](function(_0x161a67){_0x224529[_0x6352('0x21')]=_0x161a67;if(_0x5f210a[_0x6352('0x35')][_0x6352('0x44')]){_0x407e16[_0x6352('0x45')]=[{'all':!![]}];}return db[_0x6352('0x64')]['findAll'](_0x407e16);})[_0x6352('0x26')](function(_0x1a73a8){_0x224529[_0x6352('0x47')]=_0x1a73a8;return _0x224529;});}})['then'](respondWithFilteredResult(_0x290fbd,_0x407e16))[_0x6352('0x48')](handleError(_0x290fbd,null));};exports[_0x6352('0x65')]=function(_0x43e9e1,_0x40cd18,_0x505fff){var _0x4518d3={};var _0x39ccc9={};var _0x29ea85;var _0x546850;return db[_0x6352('0x2e')][_0x6352('0x5c')]({'where':{'id':_0x43e9e1[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x40cd18,null))[_0x6352('0x26')](function(_0x57550a){if(_0x57550a){_0x29ea85=_0x57550a;_0x39ccc9[_0x6352('0x33')]=_[_0x6352('0x36')](db['CmList'][_0x6352('0x2f')]);_0x39ccc9[_0x6352('0x35')]=_[_0x6352('0x36')](_0x43e9e1[_0x6352('0x35')]);_0x39ccc9[_0x6352('0x37')]=_[_0x6352('0x38')](_0x39ccc9[_0x6352('0x33')],_0x39ccc9[_0x6352('0x35')]);_0x4518d3[_0x6352('0x39')]=_[_0x6352('0x38')](_0x39ccc9[_0x6352('0x33')],qs[_0x6352('0x3a')](_0x43e9e1[_0x6352('0x35')]['fields']));_0x4518d3['attributes']=_0x4518d3[_0x6352('0x39')][_0x6352('0x3b')]?_0x4518d3[_0x6352('0x39')]:_0x39ccc9[_0x6352('0x33')];_0x4518d3['order']=qs[_0x6352('0x3e')](_0x43e9e1[_0x6352('0x35')][_0x6352('0x3e')]);_0x4518d3[_0x6352('0x40')]=qs[_0x6352('0x37')](_[_0x6352('0x3f')](_0x43e9e1[_0x6352('0x35')],_0x39ccc9[_0x6352('0x37')]));if(_0x43e9e1[_0x6352('0x35')][_0x6352('0x42')]){_0x4518d3[_0x6352('0x40')]=_[_0x6352('0x4b')](_0x4518d3['where'],{'$or':_[_0x6352('0x34')](_0x4518d3['attributes'],function(_0x8a4931){var _0x54164c={};_0x54164c[_0x8a4931]={'$like':'%'+_0x43e9e1[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0x54164c;})});}_0x4518d3=_[_0x6352('0x4b')]({},_0x4518d3,_0x43e9e1[_0x6352('0x43')]);return _0x29ea85[_0x6352('0x65')](_0x4518d3);}})[_0x6352('0x26')](function(_0x920a7f){if(_0x920a7f){_0x546850=_0x920a7f[_0x6352('0x3b')];if(!_0x43e9e1['query'][_0x6352('0x5e')](_0x6352('0x3c'))){_0x4518d3[_0x6352('0x20')]=qs[_0x6352('0x20')](_0x43e9e1[_0x6352('0x35')]['limit']);_0x4518d3['offset']=qs[_0x6352('0x1e')](_0x43e9e1[_0x6352('0x35')][_0x6352('0x1e')]);}return _0x29ea85[_0x6352('0x65')](_0x4518d3);}})['then'](function(_0x2a3eba){if(_0x2a3eba){return _0x2a3eba?{'count':_0x546850,'rows':_0x2a3eba}:null;}})['then'](respondWithResult(_0x40cd18,null))['catch'](handleError(_0x40cd18,null));};exports[_0x6352('0x66')]=function(_0x3e2767,_0x571f2a,_0x5e1b7c){var _0x55ef8b,_0x24304d;var _0x5ca0d3=[];var _0x2352f2=moment()[_0x6352('0x67')](_0x6352('0x68'));return db[_0x6352('0x2e')][_0x6352('0x4c')]({'where':{'id':_0x3e2767[_0x6352('0x4a')]['id']}})['then'](handleEntityNotFound(_0x571f2a,null))['then'](function(_0x267828){if(_0x267828){_0x24304d=_0x267828;return _0x267828['addLists'](_0x3e2767[_0x6352('0x4e')]['ids'],_[_0x6352('0x57')](_0x3e2767[_0x6352('0x4e')],[_0x6352('0x69'),'id'])||{});}return null;})[_0x6352('0x6a')](function(_0x559f09){var _0x2306ad;var _0x3c49eb;_0x55ef8b=_0x559f09||[];var _0x1b61ff=[];if(_0x559f09){for(var _0x1b4351=0x0;_0x1b4351<_0x559f09[_0x6352('0x3b')];_0x1b4351+=0x1){var _0x436b7b=_0x559f09[_0x1b4351][_0x6352('0x28')]({'plain':!![]});_0x24304d[_0x6352('0x6b')]=_0x3e2767['body']['dialCheckDuplicateType']?_0x3e2767[_0x6352('0x4e')][_0x6352('0x6b')]:_0x24304d[_0x6352('0x6b')];switch(_0x24304d[_0x6352('0x6b')]){case'always':_0x2306ad=squel[_0x6352('0x6c')]()[_0x6352('0x6d')](_0x6352('0x6e'))[_0x6352('0x6f')](['phone',_0x6352('0x70'),'ContactId','ListId',_0x6352('0x5f'),'createdAt','updatedAt'],squel[_0x6352('0x71')]()[_0x6352('0x72')](_0x6352('0x73'),_0x6352('0x73'))['field'](_0x6352('0x74'),_0x6352('0x70'))[_0x6352('0x72')]('id',_0x6352('0x75'))[_0x6352('0x72')](_0x436b7b[_0x6352('0x76')][_0x6352('0x77')](),_0x6352('0x78'))[_0x6352('0x72')](_0x3e2767[_0x6352('0x4a')]['id'][_0x6352('0x77')](),'CampaignId')[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27','createdAt')[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27',_0x6352('0x59'))[_0x6352('0x79')](_0x6352('0x7a'))[_0x6352('0x40')]('deletedAt\x20IS\x20NULL')[_0x6352('0x40')](_0x6352('0x7b'),_0x436b7b[_0x6352('0x76')]['toString']())[_0x6352('0x40')](_0x6352('0x7c'))[_0x6352('0x40')](_0x6352('0x7d'),squel[_0x6352('0x71')]()['field'](_0x6352('0x7e'))[_0x6352('0x79')](_0x6352('0x7f'))[_0x6352('0x40')](_0x6352('0x80'),_0x3e2767[_0x6352('0x4a')]['id'][_0x6352('0x77')]()))[_0x6352('0x40')](_0x6352('0x7d'),squel[_0x6352('0x71')]()[_0x6352('0x72')](_0x6352('0x81'))[_0x6352('0x79')]('cm_hopper')[_0x6352('0x40')](_0x6352('0x80'),_0x3e2767[_0x6352('0x4a')]['id'][_0x6352('0x77')]())))['toString']();break;case _0x6352('0x82'):_0x2306ad=squel[_0x6352('0x6c')]()['into'](_0x6352('0x6e'))[_0x6352('0x6f')]([_0x6352('0x73'),_0x6352('0x70'),_0x6352('0x75'),'ListId',_0x6352('0x5f'),_0x6352('0x58'),_0x6352('0x59')],squel['select']()['field'](_0x6352('0x73'),_0x6352('0x73'))[_0x6352('0x72')](_0x6352('0x74'),'scheduledAt')[_0x6352('0x72')]('id',_0x6352('0x75'))[_0x6352('0x72')](_0x436b7b[_0x6352('0x76')][_0x6352('0x77')](),_0x6352('0x78'))[_0x6352('0x72')](_0x3e2767[_0x6352('0x4a')]['id']['toString'](),_0x6352('0x5f'))[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27',_0x6352('0x58'))[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27',_0x6352('0x59'))[_0x6352('0x79')]('cm_contacts')[_0x6352('0x40')](_0x6352('0x83'))['where'](_0x6352('0x7b'),_0x436b7b['CmListId'][_0x6352('0x77')]())[_0x6352('0x40')](_0x6352('0x7c'))[_0x6352('0x40')](_0x6352('0x7d'),squel[_0x6352('0x71')]()['field'](_0x6352('0x81'))[_0x6352('0x79')](_0x6352('0x6e'))['where']('CampaignId\x20=\x20?',_0x3e2767[_0x6352('0x4a')]['id']['toString']())))['toString']();break;default:_0x2306ad=squel[_0x6352('0x6c')]()['into']('cm_hopper')[_0x6352('0x6f')]([_0x6352('0x73'),_0x6352('0x70'),_0x6352('0x75'),_0x6352('0x78'),_0x6352('0x5f'),_0x6352('0x58'),_0x6352('0x59')],squel[_0x6352('0x71')]()['field'](_0x6352('0x73'),'phone')[_0x6352('0x72')]('NOW()',_0x6352('0x70'))['field']('id',_0x6352('0x75'))[_0x6352('0x72')](_0x436b7b[_0x6352('0x76')]['toString'](),_0x6352('0x78'))[_0x6352('0x72')](_0x3e2767[_0x6352('0x4a')]['id'][_0x6352('0x77')](),_0x6352('0x5f'))['field']('\x27'+_0x2352f2+'\x27',_0x6352('0x58'))[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27',_0x6352('0x59'))[_0x6352('0x79')](_0x6352('0x7a'))[_0x6352('0x40')](_0x6352('0x83'))[_0x6352('0x40')](_0x6352('0x7b'),_0x436b7b[_0x6352('0x76')][_0x6352('0x77')]())[_0x6352('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x6352('0x77')]();}_0x3c49eb=squel[_0x6352('0x6c')]()[_0x6352('0x6d')](_0x6352('0x84'))[_0x6352('0x6f')]([_0x6352('0x85'),_0x6352('0x70'),_0x6352('0x73'),_0x6352('0x86'),_0x6352('0x58'),_0x6352('0x59')],squel[_0x6352('0x71')]()[_0x6352('0x72')](_0x6352('0x87'),'id')[_0x6352('0x72')](_0x6352('0x74'),_0x6352('0x70'))[_0x6352('0x72')](_0x6352('0x88'),_0x6352('0x73'))[_0x6352('0x72')](_0x6352('0x89'),_0x6352('0x86'))[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27','createdAt')[_0x6352('0x72')]('\x27'+_0x2352f2+'\x27','updatedAt')[_0x6352('0x79')](_0x6352('0x8a'),'ci')[_0x6352('0x8b')](_0x6352('0x6e'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x6352('0x40')](_0x6352('0x8c'),_0x436b7b[_0x6352('0x76')][_0x6352('0x77')]())[_0x6352('0x40')](_0x6352('0x8d'),_0x3e2767['params']['id'][_0x6352('0x77')]())[_0x6352('0x40')]('h.createdAt\x20=\x20?',_0x2352f2))[_0x6352('0x77')]();_0x1b61ff[_0x6352('0x8e')](db[_0x6352('0x8f')]['query'](_0x2306ad));_0x5ca0d3[_0x6352('0x8e')](db[_0x6352('0x8f')][_0x6352('0x35')](_0x3c49eb));}return BPromise['all'](_0x1b61ff);}})[_0x6352('0x26')](function(){return BPromise[_0x6352('0x90')](_0x5ca0d3);})['then'](function(){return _0x55ef8b;})[_0x6352('0x26')](respondWithResult(_0x571f2a,null))[_0x6352('0x48')](handleError(_0x571f2a,null));};exports[_0x6352('0x91')]=function(_0x443768,_0x5ed7a8,_0xe7b224){return db[_0x6352('0x2e')][_0x6352('0x4c')]({'where':{'id':_0x443768[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x5ed7a8,null))[_0x6352('0x26')](function(_0x6f6ec2){if(_0x6f6ec2){return _0x6f6ec2[_0x6352('0x91')](_0x443768[_0x6352('0x35')]['ids']);}})[_0x6352('0x26')](function(_0x51b837){if(_0x51b837){return db[_0x6352('0x5d')][_0x6352('0x27')]({'where':{'ListId':_0x443768[_0x6352('0x35')][_0x6352('0x69')],'CampaignId':_0x443768[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](function(){return _0x51b837;});}})['then'](respondWithStatusCode(_0x5ed7a8,null))['catch'](handleError(_0x5ed7a8,null));};exports[_0x6352('0x92')]=function(_0x31ae8e,_0x3ee3c4,_0x57daa1){var _0x2d8d90={};var _0x221333={};var _0x104ff9;var _0x31ed1d;return db[_0x6352('0x2e')]['findOne']({'where':{'id':_0x31ae8e[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x3ee3c4,null))[_0x6352('0x26')](function(_0x37d872){if(_0x37d872){_0x104ff9=_0x37d872;_0x221333['model']=_[_0x6352('0x36')](db[_0x6352('0x93')][_0x6352('0x2f')]);_0x221333['query']=_[_0x6352('0x36')](_0x31ae8e[_0x6352('0x35')]);_0x221333[_0x6352('0x37')]=_[_0x6352('0x38')](_0x221333['model'],_0x221333[_0x6352('0x35')]);_0x2d8d90[_0x6352('0x39')]=_[_0x6352('0x38')](_0x221333['model'],qs['fields'](_0x31ae8e['query'][_0x6352('0x3a')]));_0x2d8d90[_0x6352('0x39')]=_0x2d8d90['attributes']['length']?_0x2d8d90[_0x6352('0x39')]:_0x221333[_0x6352('0x33')];_0x2d8d90[_0x6352('0x3d')]=qs[_0x6352('0x3e')](_0x31ae8e['query'][_0x6352('0x3e')]);_0x2d8d90['where']=qs[_0x6352('0x37')](_[_0x6352('0x3f')](_0x31ae8e['query'],_0x221333[_0x6352('0x37')]));if(_0x31ae8e[_0x6352('0x35')][_0x6352('0x42')]){_0x2d8d90[_0x6352('0x40')]=_['merge'](_0x2d8d90[_0x6352('0x40')],{'$or':_[_0x6352('0x34')](_0x2d8d90[_0x6352('0x39')],function(_0x297703){var _0x37f64f={};_0x37f64f[_0x297703]={'$like':'%'+_0x31ae8e[_0x6352('0x35')][_0x6352('0x42')]+'%'};return _0x37f64f;})});}_0x2d8d90=_[_0x6352('0x4b')]({},_0x2d8d90,_0x31ae8e[_0x6352('0x43')]);return _0x104ff9[_0x6352('0x92')](_0x2d8d90);}})[_0x6352('0x26')](function(_0x1ec058){if(_0x1ec058){_0x31ed1d=_0x1ec058[_0x6352('0x3b')];if(!_0x31ae8e[_0x6352('0x35')][_0x6352('0x5e')](_0x6352('0x3c'))){_0x2d8d90[_0x6352('0x20')]=qs[_0x6352('0x20')](_0x31ae8e[_0x6352('0x35')][_0x6352('0x20')]);_0x2d8d90[_0x6352('0x1e')]=qs[_0x6352('0x1e')](_0x31ae8e[_0x6352('0x35')][_0x6352('0x1e')]);}return _0x104ff9[_0x6352('0x92')](_0x2d8d90);}})[_0x6352('0x26')](function(_0xeb8f46){if(_0xeb8f46){return _0xeb8f46?{'count':_0x31ed1d,'rows':_0xeb8f46}:null;}})[_0x6352('0x26')](respondWithResult(_0x3ee3c4,null))[_0x6352('0x48')](handleError(_0x3ee3c4,null));};exports[_0x6352('0x94')]=function(_0x233cc6,_0x572ba5,_0x2e8739){var _0x36f9a7,_0x332b52;var _0x60ccf4=[];var _0x4e5646=moment()[_0x6352('0x67')](_0x6352('0x68'));return db[_0x6352('0x2e')][_0x6352('0x4c')]({'where':{'id':_0x233cc6[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x572ba5,null))[_0x6352('0x26')](function(_0x67a0f2){if(_0x67a0f2){_0x332b52=_0x67a0f2;return _0x67a0f2[_0x6352('0x94')](_0x233cc6[_0x6352('0x4e')][_0x6352('0x69')],_[_0x6352('0x57')](_0x233cc6[_0x6352('0x4e')],['ids','id'])||{});}return null;})[_0x6352('0x6a')](function(_0x4fb9e5){var _0x1b3390;var _0x2ccfa8;_0x36f9a7=_0x4fb9e5||[];var _0x3d3026=[];if(_0x4fb9e5){for(var _0x4afd17=0x0;_0x4afd17<_0x4fb9e5[_0x6352('0x3b')];_0x4afd17+=0x1){var _0x49c7cf=_0x4fb9e5[_0x4afd17][_0x6352('0x28')]({'plain':!![]});_0x1b3390=squel[_0x6352('0x6c')]()['into'](_0x6352('0x95'))[_0x6352('0x6f')]([_0x6352('0x73'),_0x6352('0x75'),_0x6352('0x78'),_0x6352('0x5f'),_0x6352('0x58'),_0x6352('0x59')],squel[_0x6352('0x71')]()[_0x6352('0x72')](_0x6352('0x73'),_0x6352('0x73'))[_0x6352('0x72')]('id',_0x6352('0x75'))[_0x6352('0x72')](_0x49c7cf[_0x6352('0x76')][_0x6352('0x77')](),_0x6352('0x78'))['field'](_0x233cc6[_0x6352('0x4a')]['id'][_0x6352('0x77')](),_0x6352('0x5f'))[_0x6352('0x72')](_0x6352('0x74'),'createdAt')['field'](_0x6352('0x74'),_0x6352('0x59'))[_0x6352('0x79')](_0x6352('0x7a'))[_0x6352('0x40')](_0x6352('0x83'))['where'](_0x6352('0x7b'),_0x49c7cf['CmListId'][_0x6352('0x77')]())[_0x6352('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x6352('0x77')]();_0x3d3026[_0x6352('0x8e')](db[_0x6352('0x8f')]['query'](_0x1b3390));}return BPromise[_0x6352('0x90')](_0x3d3026);}})[_0x6352('0x26')](function(){return _0x36f9a7;})[_0x6352('0x26')](respondWithResult(_0x572ba5,null))[_0x6352('0x48')](handleError(_0x572ba5,null));};exports[_0x6352('0x96')]=function(_0x1c3630,_0x3711c8,_0x13cbe8){return db['Campaign'][_0x6352('0x4c')]({'where':{'id':_0x1c3630[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](handleEntityNotFound(_0x3711c8,null))['then'](function(_0x549070){if(_0x549070){return _0x549070[_0x6352('0x96')](_0x1c3630['query'][_0x6352('0x69')]);}})[_0x6352('0x26')](function(_0x504d26){if(_0x504d26){return db[_0x6352('0x64')][_0x6352('0x27')]({'where':{'ListId':_0x1c3630[_0x6352('0x35')][_0x6352('0x69')],'CampaignId':_0x1c3630[_0x6352('0x4a')]['id']}})[_0x6352('0x26')](function(){return _0x504d26;});}})[_0x6352('0x26')](respondWithStatusCode(_0x3711c8,null))[_0x6352('0x48')](handleError(_0x3711c8,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 836448f..d62f56d 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xdbf14f,_0x4bfcc4){var _0x3e58a2=function(_0x389184){while(--_0x389184){_0xdbf14f['push'](_0xdbf14f['shift']());}};_0x3e58a2(++_0x4bfcc4);}(_0x7a54,0x106));var _0x47a5=function(_0xe7a190,_0x3baa7b){_0xe7a190=_0xe7a190-0x0;var _0x793669=_0x7a54[_0xe7a190];return _0x793669;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 652c7b0..0dc7179 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 _0x6597=['jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/environment'];(function(_0xfc478e,_0x22c938){var _0x2e521f=function(_0x26c801){while(--_0x26c801){_0xfc478e['push'](_0xfc478e['shift']());}};_0x2e521f(++_0x22c938);}(_0x6597,0x16e));var _0x7659=function(_0x389c70,_0x973171){_0x389c70=_0x389c70-0x0;var _0x256e52=_0x6597[_0x389c70];return _0x256e52;};'use strict';var _=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var moment=require(_0x7659('0x2'));var BPromise=require('bluebird');var rs=require(_0x7659('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7659('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7659('0x5'));var jayson=require(_0x7659('0x6'));var client=jayson[_0x7659('0x7')][_0x7659('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11cb28,_0x5c4e7f,_0x5ae101){return new BPromise(function(_0x3cfb33,_0x361918){return client[_0x7659('0x9')](_0x11cb28,_0x5ae101)[_0x7659('0xa')](function(_0x597553){logger[_0x7659('0xb')](_0x7659('0xc'),_0x5c4e7f,'request\x20sent');logger[_0x7659('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5c4e7f,_0x7659('0xe'),JSON['stringify'](_0x597553));if(_0x597553[_0x7659('0xf')]){if(_0x597553[_0x7659('0xf')]['code']===0x1f4){logger[_0x7659('0xf')](_0x7659('0xc'),_0x5c4e7f,_0x597553['error'][_0x7659('0x10')]);return _0x361918(_0x597553['error']['message']);}logger[_0x7659('0xf')](_0x7659('0xc'),_0x5c4e7f,_0x597553[_0x7659('0xf')][_0x7659('0x10')]);return _0x3cfb33(_0x597553[_0x7659('0xf')]['message']);}else{logger['info'](_0x7659('0xc'),_0x5c4e7f,_0x7659('0xe'));_0x3cfb33(_0x597553[_0x7659('0x11')][_0x7659('0x10')]);}})[_0x7659('0x12')](function(_0x26a0f0){logger['error'](_0x7659('0xc'),_0x5c4e7f,_0x26a0f0);_0x361918(_0x26a0f0);});});}exports[_0x7659('0x13')]=function(_0x471b17){var _0x2f1e6c=this;return new Promise(function(_0x100953,_0x201fee){return db[_0x7659('0x14')][_0x7659('0x15')]({'raw':_0x471b17[_0x7659('0x16')]?_0x471b17[_0x7659('0x16')][_0x7659('0x17')]===undefined?!![]:![]:!![],'where':_0x471b17[_0x7659('0x16')]?_0x471b17[_0x7659('0x16')][_0x7659('0x18')]||null:null,'attributes':_0x471b17[_0x7659('0x16')]?_0x471b17['options'][_0x7659('0x19')]||null:null,'limit':_0x471b17[_0x7659('0x16')]?_0x471b17[_0x7659('0x16')][_0x7659('0x1a')]||null:null,'include':_0x471b17['options']?_0x471b17['options'][_0x7659('0x1b')]?_[_0x7659('0x1c')](_0x471b17[_0x7659('0x16')]['include'],function(_0x45058f){return{'model':db[_0x45058f[_0x7659('0x1d')]],'as':_0x45058f['as'],'attributes':_0x45058f[_0x7659('0x19')],'include':_0x45058f['include']?_[_0x7659('0x1c')](_0x45058f[_0x7659('0x1b')],function(_0x185fb1){return{'model':db[_0x185fb1[_0x7659('0x1d')]],'as':_0x185fb1['as'],'attributes':_0x185fb1[_0x7659('0x19')],'include':_0x185fb1[_0x7659('0x1b')]?_[_0x7659('0x1c')](_0x185fb1[_0x7659('0x1b')],function(_0x24967b){return{'model':db[_0x24967b['model']],'as':_0x24967b['as'],'attributes':_0x24967b[_0x7659('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7659('0xa')](function(_0x4e450f){logger[_0x7659('0xb')]('GetCampaign',_0x471b17);logger[_0x7659('0xd')](_0x7659('0x13'),_0x471b17,JSON[_0x7659('0x1e')](_0x4e450f));_0x100953(_0x4e450f);})['catch'](function(_0x99da88){logger[_0x7659('0xf')](_0x7659('0x13'),_0x99da88[_0x7659('0x10')],_0x471b17);_0x201fee(_0x2f1e6c[_0x7659('0xf')](0x1f4,_0x99da88[_0x7659('0x10')]));});});};
\ No newline at end of file
+var _0x4c6d=['info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x437273,_0x47def1){var _0x5ac54f=function(_0x5df0c4){while(--_0x5df0c4){_0x437273['push'](_0x437273['shift']());}};_0x5ac54f(++_0x47def1);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x217d09,_0x49df9d){_0x217d09=_0x217d09-0x0;var _0x1330f6=_0x4c6d[_0x217d09];return _0x1330f6;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')]({'raw':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f['options'][_0xd4c6('0x1a')]===undefined?!![]:![]:!![],'where':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1b')]||null:null,'attributes':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x19')]['attributes']||null:null,'limit':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1c')]||null:null,'include':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')],function(_0x466330){return{'model':db[_0x466330[_0xd4c6('0x1f')]],'as':_0x466330['as'],'attributes':_0x466330[_0xd4c6('0x20')],'include':_0x466330['include']?_['map'](_0x466330[_0xd4c6('0x1d')],function(_0x2febbf){return{'model':db[_0x2febbf['model']],'as':_0x2febbf['as'],'attributes':_0x2febbf[_0xd4c6('0x20')],'include':_0x2febbf[_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x2febbf['include'],function(_0x35b50c){return{'model':db[_0x35b50c[_0xd4c6('0x1f')]],'as':_0x35b50c['as'],'attributes':_0x35b50c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4c6('0x21')](function(_0x8ce066){logger[_0xd4c6('0xc')]('GetCampaign',_0x23a16f);logger[_0xd4c6('0xe')](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x8ce066));_0x31f328(_0x8ce066);})[_0xd4c6('0x15')](function(_0x2e8c34){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x2e8c34[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x2e8c34[_0xd4c6('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 0fdf686..726b589 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 _0xbaef=['post','create','addLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists'];(function(_0x3890fe,_0x15c983){var _0x180fe4=function(_0xc1597a){while(--_0xc1597a){_0x3890fe['push'](_0x3890fe['shift']());}};_0x180fe4(++_0x15c983);}(_0xbaef,0x1db));var _0xfbae=function(_0x379d7e,_0x31e49b){_0x379d7e=_0x379d7e-0x0;var _0x4c90b1=_0xbaef[_0x379d7e];return _0x4c90b1;};'use strict';var multer=require(_0xfbae('0x0'));var util=require(_0xfbae('0x1'));var path=require(_0xfbae('0x2'));var timeout=require(_0xfbae('0x3'));var express=require('express');var router=express[_0xfbae('0x4')]();var fs_extra=require(_0xfbae('0x5'));var auth=require(_0xfbae('0x6'));var interaction=require(_0xfbae('0x7'));var config=require('../../config/environment');var controller=require(_0xfbae('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfbae('0x9')](_0xfbae('0xa'),auth[_0xfbae('0xb')](),controller[_0xfbae('0xc')]);router[_0xfbae('0x9')](_0xfbae('0xd'),auth[_0xfbae('0xb')](),controller['getHoppers']);router[_0xfbae('0x9')]('/:id/hopper_histories',auth[_0xfbae('0xb')](),controller[_0xfbae('0xe')]);router[_0xfbae('0x9')](_0xfbae('0xf'),auth['isAuthenticated'](),controller[_0xfbae('0x10')]);router[_0xfbae('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xfbae('0x11')]);router['get'](_0xfbae('0x12'),auth[_0xfbae('0xb')](),controller['getLists']);router[_0xfbae('0x9')](_0xfbae('0x13'),auth[_0xfbae('0xb')](),controller[_0xfbae('0x14')]);router[_0xfbae('0x15')]('/',auth[_0xfbae('0xb')](),controller[_0xfbae('0x16')]);router[_0xfbae('0x15')]('/:id/clone',auth[_0xfbae('0xb')](),controller['clone']);router[_0xfbae('0x15')](_0xfbae('0x12'),auth['isAuthenticated'](),controller[_0xfbae('0x17')]);router[_0xfbae('0x15')](_0xfbae('0x13'),auth[_0xfbae('0xb')](),controller['addBlackLists']);router[_0xfbae('0x18')](_0xfbae('0xa'),auth['isAuthenticated'](),controller[_0xfbae('0x19')]);router['delete'](_0xfbae('0xa'),auth[_0xfbae('0xb')](),controller[_0xfbae('0x1a')]);router[_0xfbae('0x1b')](_0xfbae('0x12'),auth[_0xfbae('0xb')](),controller[_0xfbae('0x1c')]);router[_0xfbae('0x1b')](_0xfbae('0x13'),auth[_0xfbae('0xb')](),controller[_0xfbae('0x1d')]);module[_0xfbae('0x1e')]=router;
\ No newline at end of file
+var _0x5ffd=['/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','post','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','update','delete','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers'];(function(_0x26e954,_0x2fd1f8){var _0x528642=function(_0x7ecf6d){while(--_0x7ecf6d){_0x26e954['push'](_0x26e954['shift']());}};_0x528642(++_0x2fd1f8);}(_0x5ffd,0xdd));var _0xd5ff=function(_0x557cba,_0x1095fb){_0x557cba=_0x557cba-0x0;var _0x1f5fd0=_0x5ffd[_0x557cba];return _0x1f5fd0;};'use strict';var multer=require(_0xd5ff('0x0'));var util=require(_0xd5ff('0x1'));var path=require(_0xd5ff('0x2'));var timeout=require(_0xd5ff('0x3'));var express=require(_0xd5ff('0x4'));var router=express[_0xd5ff('0x5')]();var fs_extra=require(_0xd5ff('0x6'));var auth=require(_0xd5ff('0x7'));var interaction=require(_0xd5ff('0x8'));var config=require(_0xd5ff('0x9'));var controller=require(_0xd5ff('0xa'));router[_0xd5ff('0xb')]('/',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0xd')]);router['get'](_0xd5ff('0xe'),auth[_0xd5ff('0xc')](),controller['show']);router[_0xd5ff('0xb')](_0xd5ff('0xf'),auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x10')]);router[_0xd5ff('0xb')](_0xd5ff('0x11'),auth[_0xd5ff('0xc')](),controller['getHopperHistories']);router[_0xd5ff('0xb')](_0xd5ff('0x12'),auth['isAuthenticated'](),controller[_0xd5ff('0x13')]);router[_0xd5ff('0xb')](_0xd5ff('0x14'),auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x15')]);router['get']('/:id/lists',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x16')]);router[_0xd5ff('0xb')]('/:id/blacklists',auth[_0xd5ff('0xc')](),controller['getBlackLists']);router[_0xd5ff('0x17')]('/',auth[_0xd5ff('0xc')](),controller['create']);router['post'](_0xd5ff('0x18'),auth['isAuthenticated'](),controller[_0xd5ff('0x19')]);router[_0xd5ff('0x17')](_0xd5ff('0x1a'),auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x1b')]);router[_0xd5ff('0x17')](_0xd5ff('0x1c'),auth['isAuthenticated'](),controller[_0xd5ff('0x1d')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd5ff('0x1e')]);router['delete'](_0xd5ff('0xe'),auth[_0xd5ff('0xc')](),controller['destroy']);router[_0xd5ff('0x1f')]('/:id/lists',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x20')]);router['delete']('/:id/blacklists',auth[_0xd5ff('0xc')](),controller[_0xd5ff('0x21')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 336e467..39687da 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 _0xa91e=['exports','STRING','TEXT','medium','getDataValue','key','sequelize'];(function(_0x3ad038,_0x3a0a01){var _0x3fa6fc=function(_0x299cd4){while(--_0x299cd4){_0x3ad038['push'](_0x3ad038['shift']());}};_0x3fa6fc(++_0x3a0a01);}(_0xa91e,0x84));var _0xea91=function(_0x6c11ae,_0x366911){_0x6c11ae=_0x6c11ae-0x0;var _0x15273e=_0xa91e[_0x6c11ae];return _0x15273e;};'use strict';var Sequelize=require(_0xea91('0x0'));module[_0xea91('0x1')]={'key':{'type':Sequelize[_0xea91('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xea91('0x3')],'length':_0xea91('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xea91('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xea91('0x5')](_0xea91('0x6'));}}};
\ No newline at end of file
+var _0x9b39=['exports','STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x224782,_0x5e71da){var _0x162508=function(_0x2b84fb){while(--_0x2b84fb){_0x224782['push'](_0x224782['shift']());}};_0x162508(++_0x5e71da);}(_0x9b39,0xaf));var _0x99b3=function(_0x5ec211,_0x2bcfdc){_0x5ec211=_0x5ec211-0x0;var _0x21773f=_0x9b39[_0x5ec211];return _0x21773f;};'use strict';var Sequelize=require(_0x99b3('0x0'));module[_0x99b3('0x1')]={'key':{'type':Sequelize[_0x99b3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x99b3('0x3')],'length':_0x99b3('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x99b3('0x5')],'get':function(){return this[_0x99b3('0x6')](_0x99b3('0x7'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index fae1608..6bbf01a 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 _0x0bbf=['keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','CannedAnswers','end','error','stack','name','send','index','CannedAnswer','type','key','model','map'];(function(_0x5c2c72,_0x22cf09){var _0x11c44c=function(_0x37bcca){while(--_0x37bcca){_0x5c2c72['push'](_0x5c2c72['shift']());}};_0x11c44c(++_0x22cf09);}(_0x0bbf,0xed));var _0xf0bb=function(_0x5e92fe,_0x3d21df){_0x5e92fe=_0x5e92fe-0x0;var _0x3e7bbc=_0x0bbf[_0x5e92fe];return _0x3e7bbc;};'use strict';var emlformat=require(_0xf0bb('0x0'));var rimraf=require(_0xf0bb('0x1'));var zipdir=require(_0xf0bb('0x2'));var jsonpatch=require(_0xf0bb('0x3'));var rp=require(_0xf0bb('0x4'));var moment=require(_0xf0bb('0x5'));var BPromise=require(_0xf0bb('0x6'));var Mustache=require(_0xf0bb('0x7'));var util=require(_0xf0bb('0x8'));var path=require(_0xf0bb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf0bb('0xa'));var fs=require('fs');var fs_extra=require(_0xf0bb('0xb'));var _=require(_0xf0bb('0xc'));var squel=require(_0xf0bb('0xd'));var crypto=require(_0xf0bb('0xe'));var jsforce=require(_0xf0bb('0xf'));var deskjs=require(_0xf0bb('0x10'));var toCsv=require(_0xf0bb('0x11'));var querystring=require('querystring');var Papa=require(_0xf0bb('0x12'));var Redis=require('ioredis');var authService=require(_0xf0bb('0x13'));var qs=require(_0xf0bb('0x14'));var as=require(_0xf0bb('0x15'));var hardwareService=require(_0xf0bb('0x16'));var logger=require('../../config/logger')(_0xf0bb('0x17'));var utils=require(_0xf0bb('0x18'));var config=require(_0xf0bb('0x19'));var licenseUtil=require(_0xf0bb('0x1a'));var db=require(_0xf0bb('0x1b'))['db'];function respondWithStatusCode(_0x2ea5ac,_0x383345){_0x383345=_0x383345||0xcc;return function(_0x2e5222){if(_0x2e5222){return _0x2ea5ac[_0xf0bb('0x1c')](_0x383345);}return _0x2ea5ac[_0xf0bb('0x1d')](_0x383345)['end']();};}function respondWithResult(_0x300c71,_0x2d934a){_0x2d934a=_0x2d934a||0xc8;return function(_0x1404c0){if(_0x1404c0){return _0x300c71['status'](_0x2d934a)['json'](_0x1404c0);}};}function respondWithFilteredResult(_0x429a5c,_0x31be8d){return function(_0x3e771a){if(_0x3e771a){var _0x51f425=typeof _0x31be8d['offset']==='undefined'&&typeof _0x31be8d['limit']===_0xf0bb('0x1e');var _0x19ae11=_0x3e771a[_0xf0bb('0x1f')];var _0x32f58b=_0x51f425?0x0:_0x31be8d[_0xf0bb('0x20')];var _0x1eb2fc=_0x51f425?_0x3e771a[_0xf0bb('0x1f')]:_0x31be8d['offset']+_0x31be8d[_0xf0bb('0x21')];var _0x34ae6e;if(_0x1eb2fc>=_0x19ae11){_0x1eb2fc=_0x19ae11;_0x34ae6e=0xc8;}else{_0x34ae6e=0xce;}_0x429a5c[_0xf0bb('0x1d')](_0x34ae6e);return _0x429a5c[_0xf0bb('0x22')](_0xf0bb('0x23'),_0x32f58b+'-'+_0x1eb2fc+'/'+_0x19ae11)[_0xf0bb('0x24')](_0x3e771a);}return null;};}function patchUpdates(_0x4b34db){return function(_0x59f38d){try{jsonpatch[_0xf0bb('0x25')](_0x59f38d,_0x4b34db,!![]);}catch(_0x3f02f3){return BPromise['reject'](_0x3f02f3);}return _0x59f38d[_0xf0bb('0x26')]();};}function saveUpdates(_0x478eab,_0x3d3199){return function(_0x35939f){if(_0x35939f){return _0x35939f[_0xf0bb('0x27')](_0x478eab)[_0xf0bb('0x28')](function(_0x50efd2){return _0x50efd2;});}return null;};}function removeEntity(_0x42f80f,_0x37b0d5){return function(_0x19d3ce){if(_0x19d3ce){return _0x19d3ce[_0xf0bb('0x29')]()['then'](function(){var _0x419030=_0x19d3ce['get']({'plain':!![]});var _0x2495f2=_0xf0bb('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x2495f2,'resourceId':_0x419030['id']}})['then'](function(){return _0x19d3ce;});})[_0xf0bb('0x28')](function(){_0x42f80f['status'](0xcc)[_0xf0bb('0x2b')]();});}};}function handleEntityNotFound(_0x2279ab,_0x517b44){return function(_0x1f34cc){if(!_0x1f34cc){_0x2279ab['sendStatus'](0x194);}return _0x1f34cc;};}function handleError(_0x8842a8,_0x3483fd){_0x3483fd=_0x3483fd||0x1f4;return function(_0x5ed2bd){logger[_0xf0bb('0x2c')](_0x5ed2bd[_0xf0bb('0x2d')]);if(_0x5ed2bd[_0xf0bb('0x2e')]){delete _0x5ed2bd['name'];}_0x8842a8[_0xf0bb('0x1d')](_0x3483fd)[_0xf0bb('0x2f')](_0x5ed2bd);};}exports[_0xf0bb('0x30')]=function(_0x4fdba3,_0x197d2a){var _0x36dc4f={},_0x15a674={},_0x487db3={'count':0x0,'rows':[]};var _0x5b9cca=_['map'](db[_0xf0bb('0x31')]['rawAttributes'],function(_0x3c11df){return{'name':_0x3c11df['fieldName'],'type':_0x3c11df[_0xf0bb('0x32')][_0xf0bb('0x33')]};});_0x15a674[_0xf0bb('0x34')]=_[_0xf0bb('0x35')](_0x5b9cca,_0xf0bb('0x2e'));_0x15a674['query']=_[_0xf0bb('0x36')](_0x4fdba3['query']);_0x15a674[_0xf0bb('0x37')]=_[_0xf0bb('0x38')](_0x15a674[_0xf0bb('0x34')],_0x15a674[_0xf0bb('0x39')]);_0x36dc4f[_0xf0bb('0x3a')]=_[_0xf0bb('0x38')](_0x15a674['model'],qs[_0xf0bb('0x3b')](_0x4fdba3['query']['fields']));_0x36dc4f['attributes']=_0x36dc4f[_0xf0bb('0x3a')][_0xf0bb('0x3c')]?_0x36dc4f[_0xf0bb('0x3a')]:_0x15a674[_0xf0bb('0x34')];if(!_0x4fdba3['query'][_0xf0bb('0x3d')](_0xf0bb('0x3e'))){_0x36dc4f[_0xf0bb('0x21')]=qs[_0xf0bb('0x21')](_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x21')]);_0x36dc4f[_0xf0bb('0x20')]=qs[_0xf0bb('0x20')](_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x20')]);}_0x36dc4f[_0xf0bb('0x3f')]=qs['sort'](_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x40')]);_0x36dc4f['where']=qs['filters'](_[_0xf0bb('0x41')](_0x4fdba3[_0xf0bb('0x39')],_0x15a674[_0xf0bb('0x37')]),_0x5b9cca);if(_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x42')]){_0x36dc4f[_0xf0bb('0x43')]=_['merge'](_0x36dc4f[_0xf0bb('0x43')],{'$or':[{'key':{'$like':'%'+_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x42')]+'%'}},{'value':{'$like':'%'+_0x4fdba3['query'][_0xf0bb('0x42')]+'%'}}]});}_0x36dc4f=_[_0xf0bb('0x44')]({},_0x36dc4f,_0x4fdba3[_0xf0bb('0x45')]);var _0x52e6f={'where':_0x36dc4f[_0xf0bb('0x43')]};return db[_0xf0bb('0x31')]['count'](_0x52e6f)[_0xf0bb('0x28')](function(_0xc95523){_0x487db3['count']=_0xc95523;if(_0x4fdba3[_0xf0bb('0x39')][_0xf0bb('0x46')]){_0x36dc4f[_0xf0bb('0x47')]=[{'all':!![]}];}return db[_0xf0bb('0x31')][_0xf0bb('0x48')](_0x36dc4f);})[_0xf0bb('0x28')](function(_0x7993fa){_0x487db3[_0xf0bb('0x49')]=_0x7993fa;return _0x487db3;})[_0xf0bb('0x28')](respondWithFilteredResult(_0x197d2a,_0x36dc4f))[_0xf0bb('0x4a')](handleError(_0x197d2a,null));};exports[_0xf0bb('0x4b')]=function(_0x233f46,_0x340146){var _0x307b8d={'raw':!![],'where':{'id':_0x233f46[_0xf0bb('0x4c')]['id']}},_0x282ced={};_0x282ced['model']=_[_0xf0bb('0x36')](db[_0xf0bb('0x31')][_0xf0bb('0x4d')]);_0x282ced['query']=_['keys'](_0x233f46[_0xf0bb('0x39')]);_0x282ced[_0xf0bb('0x37')]=_[_0xf0bb('0x38')](_0x282ced[_0xf0bb('0x34')],_0x282ced['query']);_0x307b8d[_0xf0bb('0x3a')]=_['intersection'](_0x282ced[_0xf0bb('0x34')],qs[_0xf0bb('0x3b')](_0x233f46[_0xf0bb('0x39')]['fields']));_0x307b8d[_0xf0bb('0x3a')]=_0x307b8d['attributes'][_0xf0bb('0x3c')]?_0x307b8d[_0xf0bb('0x3a')]:_0x282ced[_0xf0bb('0x34')];if(_0x233f46[_0xf0bb('0x39')][_0xf0bb('0x46')]){_0x307b8d[_0xf0bb('0x47')]=[{'all':!![]}];}_0x307b8d=_[_0xf0bb('0x44')]({},_0x307b8d,_0x233f46[_0xf0bb('0x45')]);return db[_0xf0bb('0x31')][_0xf0bb('0x4e')](_0x307b8d)[_0xf0bb('0x28')](handleEntityNotFound(_0x340146,null))[_0xf0bb('0x28')](respondWithResult(_0x340146,null))[_0xf0bb('0x4a')](handleError(_0x340146,null));};exports[_0xf0bb('0x27')]=function(_0x221ba7,_0x542d5c){if(_0x221ba7[_0xf0bb('0x4f')]['id']){delete _0x221ba7['body']['id'];}return db[_0xf0bb('0x31')][_0xf0bb('0x4e')]({'where':{'id':_0x221ba7[_0xf0bb('0x4c')]['id']}})[_0xf0bb('0x28')](handleEntityNotFound(_0x542d5c,null))['then'](saveUpdates(_0x221ba7[_0xf0bb('0x4f')],null))[_0xf0bb('0x28')](respondWithResult(_0x542d5c,null))[_0xf0bb('0x4a')](handleError(_0x542d5c,null));};exports[_0xf0bb('0x29')]=function(_0x1b5675,_0x5922ec){return db[_0xf0bb('0x31')][_0xf0bb('0x4e')]({'where':{'id':_0x1b5675['params']['id']}})[_0xf0bb('0x28')](handleEntityNotFound(_0x5922ec,null))[_0xf0bb('0x28')](removeEntity(_0x5922ec,null))['catch'](handleError(_0x5922ec,null));};exports[_0xf0bb('0x50')]=function(_0x484fdf,_0x5a1c83){var _0x233f93={'key':_0x484fdf[_0xf0bb('0x4f')]['key']};if(_0x484fdf['body'][_0xf0bb('0x51')]){_0x233f93[_0xf0bb('0x51')]=_0x484fdf[_0xf0bb('0x4f')][_0xf0bb('0x51')];}else if(_0x484fdf[_0xf0bb('0x4f')]['SmsAccountId']){_0x233f93[_0xf0bb('0x52')]=_0x484fdf[_0xf0bb('0x4f')][_0xf0bb('0x52')];}else if(_0x484fdf[_0xf0bb('0x4f')][_0xf0bb('0x53')]){_0x233f93['OpenchannelAccountId']=_0x484fdf[_0xf0bb('0x4f')]['OpenchannelAccountId'];}else if(_0x484fdf['body']['ChatWebsiteId']){_0x233f93[_0xf0bb('0x54')]=_0x484fdf['body'][_0xf0bb('0x54')];}return db[_0xf0bb('0x31')][_0xf0bb('0x4e')]({'where':_0x233f93})['then'](function(_0x75d98b){if(_0x75d98b){throw new db[(_0xf0bb('0x55'))][(_0xf0bb('0x56'))](_0xf0bb('0x57'));}return db['CannedAnswer'][_0xf0bb('0x50')](_0x484fdf[_0xf0bb('0x4f')]);})[_0xf0bb('0x28')](function(_0x26e1b8){var _0x4e85cd=_0x484fdf[_0xf0bb('0x58')][_0xf0bb('0x59')]({'plain':!![]});if(!_0x4e85cd)throw new Error(_0xf0bb('0x5a'));if(_0x4e85cd[_0xf0bb('0x5b')]===_0xf0bb('0x58')){var _0x33cff8=_0x26e1b8[_0xf0bb('0x59')]({'plain':!![]});return db[_0xf0bb('0x5c')][_0xf0bb('0x4e')]({'where':{'name':_0xf0bb('0x2a'),'userProfileId':_0x4e85cd[_0xf0bb('0x5d')]},'raw':!![]})[_0xf0bb('0x28')](function(_0x2e7cb6){if(_0x2e7cb6&&_0x2e7cb6[_0xf0bb('0x5e')]===0x0){return db[_0xf0bb('0x5f')]['create']({'name':_0x33cff8[_0xf0bb('0x2e')],'resourceId':_0x33cff8['id'],'type':_0x2e7cb6[_0xf0bb('0x2e')],'sectionId':_0x2e7cb6['id']},{})[_0xf0bb('0x28')](function(){return _0x26e1b8;});}else{return _0x26e1b8;}})[_0xf0bb('0x4a')](function(_0x384a7a){logger[_0xf0bb('0x2c')](_0xf0bb('0x60'),_0x384a7a);throw _0x384a7a;});}return _0x26e1b8;})[_0xf0bb('0x28')](respondWithResult(_0x5a1c83,0xc9))[_0xf0bb('0x4a')](handleError(_0x5a1c83,null));};
\ No newline at end of file
+var _0x9b99=['findAll','rows','catch','show','keys','length','merge','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','options','CannedAnswer','includeAll','include'];(function(_0x5e9dec,_0x3f4684){var _0x338054=function(_0x317dac){while(--_0x317dac){_0x5e9dec['push'](_0x5e9dec['shift']());}};_0x338054(++_0x3f4684);}(_0x9b99,0x17b));var _0x99b9=function(_0x495686,_0x3ce623){_0x495686=_0x495686-0x0;var _0x428c4f=_0x9b99[_0x495686];return _0x428c4f;};'use strict';var emlformat=require(_0x99b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x99b9('0x2'));var Mustache=require(_0x99b9('0x3'));var util=require(_0x99b9('0x4'));var path=require(_0x99b9('0x5'));var sox=require(_0x99b9('0x6'));var csv=require(_0x99b9('0x7'));var ejs=require(_0x99b9('0x8'));var fs=require('fs');var fs_extra=require(_0x99b9('0x9'));var _=require(_0x99b9('0xa'));var squel=require(_0x99b9('0xb'));var crypto=require(_0x99b9('0xc'));var jsforce=require(_0x99b9('0xd'));var deskjs=require(_0x99b9('0xe'));var toCsv=require(_0x99b9('0x7'));var querystring=require(_0x99b9('0xf'));var Papa=require(_0x99b9('0x10'));var Redis=require(_0x99b9('0x11'));var authService=require(_0x99b9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x99b9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99b9('0x14'))(_0x99b9('0x15'));var utils=require(_0x99b9('0x16'));var config=require(_0x99b9('0x17'));var licenseUtil=require(_0x99b9('0x18'));var db=require(_0x99b9('0x19'))['db'];function respondWithStatusCode(_0x56b3a6,_0x598860){_0x598860=_0x598860||0xcc;return function(_0x40803a){if(_0x40803a){return _0x56b3a6['sendStatus'](_0x598860);}return _0x56b3a6[_0x99b9('0x1a')](_0x598860)[_0x99b9('0x1b')]();};}function respondWithResult(_0x117fa8,_0x4b7388){_0x4b7388=_0x4b7388||0xc8;return function(_0x3763c5){if(_0x3763c5){return _0x117fa8['status'](_0x4b7388)[_0x99b9('0x1c')](_0x3763c5);}};}function respondWithFilteredResult(_0x4c03d3,_0xcfa141){return function(_0x186f79){if(_0x186f79){var _0x292715=typeof _0xcfa141[_0x99b9('0x1d')]===_0x99b9('0x1e')&&typeof _0xcfa141[_0x99b9('0x1f')]===_0x99b9('0x1e');var _0x2fe9c0=_0x186f79[_0x99b9('0x20')];var _0xe1fd86=_0x292715?0x0:_0xcfa141[_0x99b9('0x1d')];var _0x8b4614=_0x292715?_0x186f79['count']:_0xcfa141['offset']+_0xcfa141[_0x99b9('0x1f')];var _0x4a6033;if(_0x8b4614>=_0x2fe9c0){_0x8b4614=_0x2fe9c0;_0x4a6033=0xc8;}else{_0x4a6033=0xce;}_0x4c03d3[_0x99b9('0x1a')](_0x4a6033);return _0x4c03d3[_0x99b9('0x21')](_0x99b9('0x22'),_0xe1fd86+'-'+_0x8b4614+'/'+_0x2fe9c0)[_0x99b9('0x1c')](_0x186f79);}return null;};}function patchUpdates(_0x4a2edf){return function(_0x1e4a10){try{jsonpatch[_0x99b9('0x23')](_0x1e4a10,_0x4a2edf,!![]);}catch(_0x2ffa53){return BPromise['reject'](_0x2ffa53);}return _0x1e4a10[_0x99b9('0x24')]();};}function saveUpdates(_0x4d88f3,_0x280993){return function(_0x166425){if(_0x166425){return _0x166425[_0x99b9('0x25')](_0x4d88f3)[_0x99b9('0x26')](function(_0x158939){return _0x158939;});}return null;};}function removeEntity(_0x4bbf2e,_0x4cbfc6){return function(_0x4fe351){if(_0x4fe351){return _0x4fe351[_0x99b9('0x27')]()[_0x99b9('0x26')](function(){var _0x4bb343=_0x4fe351[_0x99b9('0x28')]({'plain':!![]});var _0x341ddf=_0x99b9('0x29');return db[_0x99b9('0x2a')][_0x99b9('0x27')]({'where':{'type':_0x341ddf,'resourceId':_0x4bb343['id']}})[_0x99b9('0x26')](function(){return _0x4fe351;});})[_0x99b9('0x26')](function(){_0x4bbf2e[_0x99b9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8737,_0x25aa0a){return function(_0x36c61e){if(!_0x36c61e){_0x3c8737['sendStatus'](0x194);}return _0x36c61e;};}function handleError(_0x224d54,_0x5d9b8e){_0x5d9b8e=_0x5d9b8e||0x1f4;return function(_0x242de3){logger['error'](_0x242de3[_0x99b9('0x2b')]);if(_0x242de3[_0x99b9('0x2c')]){delete _0x242de3[_0x99b9('0x2c')];}_0x224d54[_0x99b9('0x1a')](_0x5d9b8e)[_0x99b9('0x2d')](_0x242de3);};}exports[_0x99b9('0x2e')]=function(_0x36de04,_0x390280){var _0x194e8f={},_0x1169a4={},_0x31f86c={'count':0x0,'rows':[]};var _0x985738=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x310b11){return{'name':_0x310b11[_0x99b9('0x2f')],'type':_0x310b11[_0x99b9('0x30')][_0x99b9('0x31')]};});_0x1169a4[_0x99b9('0x32')]=_['map'](_0x985738,_0x99b9('0x2c'));_0x1169a4[_0x99b9('0x33')]=_['keys'](_0x36de04['query']);_0x1169a4[_0x99b9('0x34')]=_[_0x99b9('0x35')](_0x1169a4[_0x99b9('0x32')],_0x1169a4[_0x99b9('0x33')]);_0x194e8f[_0x99b9('0x36')]=_[_0x99b9('0x35')](_0x1169a4[_0x99b9('0x32')],qs[_0x99b9('0x37')](_0x36de04[_0x99b9('0x33')][_0x99b9('0x37')]));_0x194e8f['attributes']=_0x194e8f['attributes']['length']?_0x194e8f['attributes']:_0x1169a4[_0x99b9('0x32')];if(!_0x36de04[_0x99b9('0x33')][_0x99b9('0x38')](_0x99b9('0x39'))){_0x194e8f['limit']=qs['limit'](_0x36de04[_0x99b9('0x33')][_0x99b9('0x1f')]);_0x194e8f['offset']=qs['offset'](_0x36de04['query'][_0x99b9('0x1d')]);}_0x194e8f[_0x99b9('0x3a')]=qs[_0x99b9('0x3b')](_0x36de04[_0x99b9('0x33')][_0x99b9('0x3b')]);_0x194e8f[_0x99b9('0x3c')]=qs[_0x99b9('0x34')](_['pick'](_0x36de04[_0x99b9('0x33')],_0x1169a4['filters']),_0x985738);if(_0x36de04[_0x99b9('0x33')][_0x99b9('0x3d')]){_0x194e8f[_0x99b9('0x3c')]=_['merge'](_0x194e8f[_0x99b9('0x3c')],{'$or':[{'key':{'$like':'%'+_0x36de04[_0x99b9('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x36de04[_0x99b9('0x33')][_0x99b9('0x3d')]+'%'}}]});}_0x194e8f=_['merge']({},_0x194e8f,_0x36de04[_0x99b9('0x3e')]);var _0x4b0c88={'where':_0x194e8f[_0x99b9('0x3c')]};return db[_0x99b9('0x3f')][_0x99b9('0x20')](_0x4b0c88)[_0x99b9('0x26')](function(_0x21c8a7){_0x31f86c['count']=_0x21c8a7;if(_0x36de04['query'][_0x99b9('0x40')]){_0x194e8f[_0x99b9('0x41')]=[{'all':!![]}];}return db[_0x99b9('0x3f')][_0x99b9('0x42')](_0x194e8f);})[_0x99b9('0x26')](function(_0x43d734){_0x31f86c[_0x99b9('0x43')]=_0x43d734;return _0x31f86c;})[_0x99b9('0x26')](respondWithFilteredResult(_0x390280,_0x194e8f))[_0x99b9('0x44')](handleError(_0x390280,null));};exports[_0x99b9('0x45')]=function(_0x1ac729,_0x228546){var _0xe685bd={'raw':!![],'where':{'id':_0x1ac729['params']['id']}},_0x408a75={};_0x408a75[_0x99b9('0x32')]=_[_0x99b9('0x46')](db[_0x99b9('0x3f')]['rawAttributes']);_0x408a75[_0x99b9('0x33')]=_[_0x99b9('0x46')](_0x1ac729[_0x99b9('0x33')]);_0x408a75[_0x99b9('0x34')]=_['intersection'](_0x408a75[_0x99b9('0x32')],_0x408a75[_0x99b9('0x33')]);_0xe685bd[_0x99b9('0x36')]=_[_0x99b9('0x35')](_0x408a75[_0x99b9('0x32')],qs[_0x99b9('0x37')](_0x1ac729['query'][_0x99b9('0x37')]));_0xe685bd[_0x99b9('0x36')]=_0xe685bd[_0x99b9('0x36')][_0x99b9('0x47')]?_0xe685bd['attributes']:_0x408a75[_0x99b9('0x32')];if(_0x1ac729[_0x99b9('0x33')][_0x99b9('0x40')]){_0xe685bd['include']=[{'all':!![]}];}_0xe685bd=_[_0x99b9('0x48')]({},_0xe685bd,_0x1ac729[_0x99b9('0x3e')]);return db[_0x99b9('0x3f')]['find'](_0xe685bd)[_0x99b9('0x26')](handleEntityNotFound(_0x228546,null))['then'](respondWithResult(_0x228546,null))[_0x99b9('0x44')](handleError(_0x228546,null));};exports[_0x99b9('0x25')]=function(_0x3a29ea,_0x61fb97){if(_0x3a29ea[_0x99b9('0x49')]['id']){delete _0x3a29ea['body']['id'];}return db[_0x99b9('0x3f')][_0x99b9('0x4a')]({'where':{'id':_0x3a29ea[_0x99b9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x61fb97,null))[_0x99b9('0x26')](saveUpdates(_0x3a29ea[_0x99b9('0x49')],null))['then'](respondWithResult(_0x61fb97,null))[_0x99b9('0x44')](handleError(_0x61fb97,null));};exports['destroy']=function(_0x5c3b88,_0x49ed0a){return db[_0x99b9('0x3f')][_0x99b9('0x4a')]({'where':{'id':_0x5c3b88['params']['id']}})[_0x99b9('0x26')](handleEntityNotFound(_0x49ed0a,null))[_0x99b9('0x26')](removeEntity(_0x49ed0a,null))['catch'](handleError(_0x49ed0a,null));};exports[_0x99b9('0x4c')]=function(_0x2dc040,_0x48fe4f){var _0xfc2c6f={'key':_0x2dc040[_0x99b9('0x49')]['key']};if(_0x2dc040['body'][_0x99b9('0x4d')]){_0xfc2c6f[_0x99b9('0x4d')]=_0x2dc040[_0x99b9('0x49')][_0x99b9('0x4d')];}else if(_0x2dc040['body']['SmsAccountId']){_0xfc2c6f[_0x99b9('0x4e')]=_0x2dc040['body'][_0x99b9('0x4e')];}else if(_0x2dc040['body'][_0x99b9('0x4f')]){_0xfc2c6f[_0x99b9('0x4f')]=_0x2dc040[_0x99b9('0x49')][_0x99b9('0x4f')];}else if(_0x2dc040['body']['ChatWebsiteId']){_0xfc2c6f[_0x99b9('0x50')]=_0x2dc040['body'][_0x99b9('0x50')];}return db[_0x99b9('0x3f')]['find']({'where':_0xfc2c6f})[_0x99b9('0x26')](function(_0x1223f6){if(_0x1223f6){throw new db[(_0x99b9('0x51'))][(_0x99b9('0x52'))](_0x99b9('0x53'));}return db[_0x99b9('0x3f')][_0x99b9('0x4c')](_0x2dc040[_0x99b9('0x49')]);})[_0x99b9('0x26')](function(_0x2cbb3c){var _0x422dfe=_0x2dc040['user'][_0x99b9('0x28')]({'plain':!![]});if(!_0x422dfe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x422dfe['role']===_0x99b9('0x54')){var _0x481754=_0x2cbb3c[_0x99b9('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x99b9('0x4a')]({'where':{'name':_0x99b9('0x29'),'userProfileId':_0x422dfe[_0x99b9('0x55')]},'raw':!![]})['then'](function(_0x17b780){if(_0x17b780&&_0x17b780[_0x99b9('0x56')]===0x0){return db[_0x99b9('0x2a')][_0x99b9('0x4c')]({'name':_0x481754[_0x99b9('0x2c')],'resourceId':_0x481754['id'],'type':_0x17b780['name'],'sectionId':_0x17b780['id']},{})[_0x99b9('0x26')](function(){return _0x2cbb3c;});}else{return _0x2cbb3c;}})[_0x99b9('0x44')](function(_0x46e9cc){logger[_0x99b9('0x57')](_0x99b9('0x58'),_0x46e9cc);throw _0x46e9cc;});}return _0x2cbb3c;})['then'](respondWithResult(_0x48fe4f,0xc9))[_0x99b9('0x44')](handleError(_0x48fe4f,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 8f30f16..32118b7 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 _0xe442=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x332687,_0x42f6e7){var _0x5e8eda=function(_0x229c92){while(--_0x229c92){_0x332687['push'](_0x332687['shift']());}};_0x5e8eda(++_0x42f6e7);}(_0xe442,0x11f));var _0x2e44=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xe442[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x2e44('0x0'));var util=require(_0x2e44('0x1'));var logger=require(_0x2e44('0x2'))(_0x2e44('0x3'));var moment=require(_0x2e44('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e44('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e44('0x6'));var config=require(_0x2e44('0x7'));var attributes=require(_0x2e44('0x8'));module[_0x2e44('0x9')]=function(_0x231c0e,_0x1f4da7){return _0x231c0e[_0x2e44('0xa')](_0x2e44('0xb'),attributes,{'tableName':_0x2e44('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e44('0xd'),'collate':_0x2e44('0xe')});};
\ No newline at end of file
+var _0xa9d0=['api','moment','bluebird','request-promise','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x5619c2,_0x4f90f9){var _0x1ff4f5=function(_0xbf9cc7){while(--_0xbf9cc7){_0x5619c2['push'](_0x5619c2['shift']());}};_0x1ff4f5(++_0x4f90f9);}(_0xa9d0,0x1eb));var _0x0a9d=function(_0x49d97d,_0x114b91){_0x49d97d=_0x49d97d-0x0;var _0x5bbfc3=_0xa9d0[_0x49d97d];return _0x5bbfc3;};'use strict';var _=require(_0x0a9d('0x0'));var util=require(_0x0a9d('0x1'));var logger=require(_0x0a9d('0x2'))(_0x0a9d('0x3'));var moment=require(_0x0a9d('0x4'));var BPromise=require(_0x0a9d('0x5'));var rp=require(_0x0a9d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a9d('0x7'));module[_0x0a9d('0x8')]=function(_0x32aa13,_0x249828){return _0x32aa13[_0x0a9d('0x9')](_0x0a9d('0xa'),attributes,{'tableName':_0x0a9d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9d('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 7e6f7ce..40038bd 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(_0x3107a6,_0x323b45){var _0x3c55f0=function(_0x2d0a3c){while(--_0x2d0a3c){_0x3107a6['push'](_0x3107a6['shift']());}};_0x3c55f0(++_0x323b45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x2ee2b3,_0x4fd141){var _0x27add5=function(_0x28c75d){while(--_0x28c75d){_0x2ee2b3['push'](_0x2ee2b3['shift']());}};_0x27add5(++_0x4fd141);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 c5e9dc6..a78d926 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 _0x8421=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x292c2b,_0x29e359){var _0x459dc0=function(_0xb38d3b){while(--_0xb38d3b){_0x292c2b['push'](_0x292c2b['shift']());}};_0x459dc0(++_0x29e359);}(_0x8421,0x131));var _0x1842=function(_0x4adfcc,_0x4ef91a){_0x4adfcc=_0x4adfcc-0x0;var _0x566c4e=_0x8421[_0x4adfcc];return _0x566c4e;};'use strict';var multer=require(_0x1842('0x0'));var util=require(_0x1842('0x1'));var path=require(_0x1842('0x2'));var timeout=require(_0x1842('0x3'));var express=require(_0x1842('0x4'));var router=express[_0x1842('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1842('0x6'));var interaction=require(_0x1842('0x7'));var config=require('../../config/environment');var controller=require(_0x1842('0x8'));router[_0x1842('0x9')]('/',auth['isAuthenticated'](),controller[_0x1842('0xa')]);router[_0x1842('0x9')](_0x1842('0xb'),auth[_0x1842('0xc')](),controller[_0x1842('0xd')]);router[_0x1842('0xe')]('/',auth[_0x1842('0xc')](),controller[_0x1842('0xf')]);router[_0x1842('0x10')](_0x1842('0xb'),auth[_0x1842('0xc')](),controller[_0x1842('0x11')]);router['delete'](_0x1842('0xb'),auth[_0x1842('0xc')](),controller[_0x1842('0x12')]);module[_0x1842('0x13')]=router;
\ No newline at end of file
+var _0x1b77=['delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0xbeab9,_0x37ec4a){var _0x27650c=function(_0x4042db){while(--_0x4042db){_0xbeab9['push'](_0xbeab9['shift']());}};_0x27650c(++_0x37ec4a);}(_0x1b77,0x75));var _0x71b7=function(_0x33af9f,_0x38734f){_0x33af9f=_0x33af9f-0x0;var _0x1483a1=_0x1b77[_0x33af9f];return _0x1483a1;};'use strict';var multer=require('multer');var util=require(_0x71b7('0x0'));var path=require('path');var timeout=require(_0x71b7('0x1'));var express=require(_0x71b7('0x2'));var router=express['Router']();var fs_extra=require(_0x71b7('0x3'));var auth=require(_0x71b7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x71b7('0x5'));var controller=require(_0x71b7('0x6'));router[_0x71b7('0x7')]('/',auth['isAuthenticated'](),controller[_0x71b7('0x8')]);router[_0x71b7('0x7')](_0x71b7('0x9'),auth[_0x71b7('0xa')](),controller[_0x71b7('0xb')]);router[_0x71b7('0xc')]('/',auth[_0x71b7('0xa')](),controller[_0x71b7('0xd')]);router[_0x71b7('0xe')](_0x71b7('0x9'),auth[_0x71b7('0xa')](),controller[_0x71b7('0xf')]);router[_0x71b7('0x10')](_0x71b7('0x9'),auth['isAuthenticated'](),controller[_0x71b7('0x11')]);module[_0x71b7('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 4a15bf8..49a249c 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 _0xceab=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0xcae673,_0x3b0ae5){var _0x14db49=function(_0x94f64e){while(--_0x94f64e){_0xcae673['push'](_0xcae673['shift']());}};_0x14db49(++_0x3b0ae5);}(_0xceab,0x106));var _0xbcea=function(_0x56f57a,_0x5ea452){_0x56f57a=_0x56f57a-0x0;var _0x33c8d6=_0xceab[_0x56f57a];return _0x33c8d6;};'use strict';var Sequelize=require(_0xbcea('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xbcea('0x1')],'allowNull':![],'defaultValue':_0xbcea('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xbcea('0x3')]},'dst':{'type':Sequelize[_0xbcea('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbcea('0x3')]},'dstchannel':{'type':Sequelize[_0xbcea('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbcea('0x3')]},'duration':{'type':Sequelize[_0xbcea('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbcea('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbcea('0x3')]},'amaflags':{'type':Sequelize[_0xbcea('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xbcea('0x3')]},'uniqueid':{'type':Sequelize[_0xbcea('0x3')]},'linkedid':{'type':Sequelize[_0xbcea('0x3')]},'sequence':{'type':Sequelize[_0xbcea('0x3')]},'peeraccount':{'type':Sequelize[_0xbcea('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xbcea('0x3')]}};
\ No newline at end of file
+var _0x984b=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0x537c03,_0x2b484b){var _0x142faf=function(_0x108718){while(--_0x108718){_0x537c03['push'](_0x537c03['shift']());}};_0x142faf(++_0x2b484b);}(_0x984b,0xee));var _0xb984=function(_0x3b3147,_0x30e0b1){_0x3b3147=_0x3b3147-0x0;var _0x419021=_0x984b[_0x3b3147];return _0x419021;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb984('0x0')},'clid':{'type':Sequelize[_0xb984('0x1')]},'src':{'type':Sequelize[_0xb984('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb984('0x1')]},'dstchannel':{'type':Sequelize[_0xb984('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb984('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb984('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xb984('0x1')]},'peeraccount':{'type':Sequelize[_0xb984('0x1')]},'type':{'type':Sequelize[_0xb984('0x1')]},'tag':{'type':Sequelize[_0xb984('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 822560e..a200eb7 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 _0xfd20=['map','Cdr','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','create','body','find','destroy','describe','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','then','end','error','stack','name','send'];(function(_0x425812,_0x919dec){var _0x5e1138=function(_0x405932){while(--_0x405932){_0x425812['push'](_0x425812['shift']());}};_0x5e1138(++_0x919dec);}(_0xfd20,0x66));var _0x0fd2=function(_0x34f930,_0x597cb0){_0x34f930=_0x34f930-0x0;var _0x55b287=_0xfd20[_0x34f930];return _0x55b287;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fd2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fd2('0x3'));var util=require('util');var path=require(_0x0fd2('0x4'));var sox=require(_0x0fd2('0x5'));var csv=require(_0x0fd2('0x6'));var ejs=require(_0x0fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x0fd2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd2('0x9'));var jsforce=require(_0x0fd2('0xa'));var deskjs=require(_0x0fd2('0xb'));var toCsv=require(_0x0fd2('0x6'));var querystring=require(_0x0fd2('0xc'));var Papa=require(_0x0fd2('0xd'));var Redis=require(_0x0fd2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fd2('0xf'));var as=require(_0x0fd2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd2('0x11'))('api');var utils=require(_0x0fd2('0x12'));var config=require(_0x0fd2('0x13'));var licenseUtil=require(_0x0fd2('0x14'));var db=require(_0x0fd2('0x15'))['db'];function respondWithStatusCode(_0xdf592d,_0x3504cf){_0x3504cf=_0x3504cf||0xcc;return function(_0x1f7a6e){if(_0x1f7a6e){return _0xdf592d[_0x0fd2('0x16')](_0x3504cf);}return _0xdf592d['status'](_0x3504cf)['end']();};}function respondWithResult(_0x1a9acb,_0x99de24){_0x99de24=_0x99de24||0xc8;return function(_0x21dcc5){if(_0x21dcc5){return _0x1a9acb[_0x0fd2('0x17')](_0x99de24)['json'](_0x21dcc5);}};}function respondWithFilteredResult(_0x280253,_0x4f074a){return function(_0x50b723){if(_0x50b723){var _0x2b6254=typeof _0x4f074a['offset']===_0x0fd2('0x18')&&typeof _0x4f074a['limit']===_0x0fd2('0x18');var _0x4cd2bf=_0x50b723[_0x0fd2('0x19')];var _0x15c9de=_0x2b6254?0x0:_0x4f074a['offset'];var _0x2b25d2=_0x2b6254?_0x50b723['count']:_0x4f074a[_0x0fd2('0x1a')]+_0x4f074a[_0x0fd2('0x1b')];var _0x3fb07e;if(_0x2b25d2>=_0x4cd2bf){_0x2b25d2=_0x4cd2bf;_0x3fb07e=0xc8;}else{_0x3fb07e=0xce;}_0x280253[_0x0fd2('0x17')](_0x3fb07e);return _0x280253[_0x0fd2('0x1c')](_0x0fd2('0x1d'),_0x15c9de+'-'+_0x2b25d2+'/'+_0x4cd2bf)[_0x0fd2('0x1e')](_0x50b723);}return null;};}function patchUpdates(_0x1a72ca){return function(_0x1b848d){try{jsonpatch[_0x0fd2('0x1f')](_0x1b848d,_0x1a72ca,!![]);}catch(_0x5c50ad){return BPromise['reject'](_0x5c50ad);}return _0x1b848d['save']();};}function saveUpdates(_0x4156d2,_0x36072a){return function(_0x53ab17){if(_0x53ab17){return _0x53ab17['update'](_0x4156d2)[_0x0fd2('0x20')](function(_0x25563c){return _0x25563c;});}return null;};}function removeEntity(_0x6be8d8,_0x29398f){return function(_0x25cdd2){if(_0x25cdd2){return _0x25cdd2['destroy']()[_0x0fd2('0x20')](function(){_0x6be8d8[_0x0fd2('0x17')](0xcc)[_0x0fd2('0x21')]();});}};}function handleEntityNotFound(_0x54cce1,_0x4c77a8){return function(_0x11bb10){if(!_0x11bb10){_0x54cce1[_0x0fd2('0x16')](0x194);}return _0x11bb10;};}function handleError(_0x4d0924,_0x400133){_0x400133=_0x400133||0x1f4;return function(_0x429fef){logger[_0x0fd2('0x22')](_0x429fef[_0x0fd2('0x23')]);if(_0x429fef[_0x0fd2('0x24')]){delete _0x429fef[_0x0fd2('0x24')];}_0x4d0924[_0x0fd2('0x17')](_0x400133)[_0x0fd2('0x25')](_0x429fef);};}exports['index']=function(_0x37d519,_0x434018){var _0x235c90={},_0x1ca259={},_0x33cf1a={'count':0x0,'rows':[]};var _0x564419=_[_0x0fd2('0x26')](db[_0x0fd2('0x27')][_0x0fd2('0x28')],function(_0x1a7a98){return{'name':_0x1a7a98[_0x0fd2('0x29')],'type':_0x1a7a98[_0x0fd2('0x2a')][_0x0fd2('0x2b')]};});_0x1ca259[_0x0fd2('0x2c')]=_['map'](_0x564419,_0x0fd2('0x24'));_0x1ca259['query']=_['keys'](_0x37d519[_0x0fd2('0x2d')]);_0x1ca259['filters']=_[_0x0fd2('0x2e')](_0x1ca259['model'],_0x1ca259[_0x0fd2('0x2d')]);_0x235c90['attributes']=_['intersection'](_0x1ca259[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x37d519[_0x0fd2('0x2d')]['fields']));_0x235c90['attributes']=_0x235c90[_0x0fd2('0x30')]['length']?_0x235c90[_0x0fd2('0x30')]:_0x1ca259[_0x0fd2('0x2c')];if(!_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x31')](_0x0fd2('0x32'))){_0x235c90[_0x0fd2('0x1b')]=qs[_0x0fd2('0x1b')](_0x37d519['query'][_0x0fd2('0x1b')]);_0x235c90[_0x0fd2('0x1a')]=qs['offset'](_0x37d519['query'][_0x0fd2('0x1a')]);}_0x235c90['order']=qs['sort'](_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x33')]);_0x235c90[_0x0fd2('0x34')]=qs[_0x0fd2('0x35')](_[_0x0fd2('0x36')](_0x37d519[_0x0fd2('0x2d')],_0x1ca259[_0x0fd2('0x35')]),_0x564419);if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]){_0x235c90[_0x0fd2('0x34')]=_[_0x0fd2('0x38')](_0x235c90[_0x0fd2('0x34')],{'$or':_[_0x0fd2('0x26')](_0x564419,function(_0x3a3986){if(_0x3a3986[_0x0fd2('0x2a')]!==_0x0fd2('0x39')){var _0x50643e={};_0x50643e[_0x3a3986[_0x0fd2('0x24')]]={'$like':'%'+_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]+'%'};return _0x50643e;}})});}_0x235c90=_[_0x0fd2('0x38')]({},_0x235c90,_0x37d519['options']);var _0x286543={'where':_0x235c90['where']};return db[_0x0fd2('0x27')][_0x0fd2('0x19')](_0x286543)['then'](function(_0x43e585){_0x33cf1a[_0x0fd2('0x19')]=_0x43e585;if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x3a')]){_0x235c90[_0x0fd2('0x3b')]=[{'all':!![]}];}return db[_0x0fd2('0x27')]['findAll'](_0x235c90);})[_0x0fd2('0x20')](function(_0x409321){_0x33cf1a[_0x0fd2('0x3c')]=_0x409321;return _0x33cf1a;})[_0x0fd2('0x20')](respondWithFilteredResult(_0x434018,_0x235c90))[_0x0fd2('0x3d')](handleError(_0x434018,null));};exports['show']=function(_0x258569,_0x2e804d){var _0x554476={'raw':!![],'where':{'id':_0x258569[_0x0fd2('0x3e')]['id']}},_0x252fb1={};_0x252fb1[_0x0fd2('0x2c')]=_[_0x0fd2('0x3f')](db[_0x0fd2('0x27')][_0x0fd2('0x28')]);_0x252fb1[_0x0fd2('0x2d')]=_[_0x0fd2('0x3f')](_0x258569['query']);_0x252fb1['filters']=_[_0x0fd2('0x2e')](_0x252fb1[_0x0fd2('0x2c')],_0x252fb1['query']);_0x554476[_0x0fd2('0x30')]=_['intersection'](_0x252fb1[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x258569[_0x0fd2('0x2d')][_0x0fd2('0x2f')]));_0x554476[_0x0fd2('0x30')]=_0x554476[_0x0fd2('0x30')]['length']?_0x554476['attributes']:_0x252fb1[_0x0fd2('0x2c')];if(_0x258569['query'][_0x0fd2('0x3a')]){_0x554476[_0x0fd2('0x3b')]=[{'all':!![]}];}_0x554476=_[_0x0fd2('0x38')]({},_0x554476,_0x258569[_0x0fd2('0x40')]);return db[_0x0fd2('0x27')]['find'](_0x554476)[_0x0fd2('0x20')](handleEntityNotFound(_0x2e804d,null))['then'](respondWithResult(_0x2e804d,null))[_0x0fd2('0x3d')](handleError(_0x2e804d,null));};exports[_0x0fd2('0x41')]=function(_0x5352cc,_0x337daa){return db['Cdr']['create'](_0x5352cc[_0x0fd2('0x42')],{})[_0x0fd2('0x20')](respondWithResult(_0x337daa,0xc9))[_0x0fd2('0x3d')](handleError(_0x337daa,null));};exports['update']=function(_0x30ac02,_0x119e21){if(_0x30ac02[_0x0fd2('0x42')]['id']){delete _0x30ac02[_0x0fd2('0x42')]['id'];}return db['Cdr'][_0x0fd2('0x43')]({'where':{'id':_0x30ac02[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x119e21,null))[_0x0fd2('0x20')](saveUpdates(_0x30ac02[_0x0fd2('0x42')],null))[_0x0fd2('0x20')](respondWithResult(_0x119e21,null))[_0x0fd2('0x3d')](handleError(_0x119e21,null));};exports[_0x0fd2('0x44')]=function(_0x2377bd,_0x4322b4){return db[_0x0fd2('0x27')]['find']({'where':{'id':_0x2377bd[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x4322b4,null))['then'](removeEntity(_0x4322b4,null))[_0x0fd2('0x3d')](handleError(_0x4322b4,null));};exports['describe']=function(_0x19650c,_0x5193b7){return db[_0x0fd2('0x27')][_0x0fd2('0x45')]()[_0x0fd2('0x20')](respondWithResult(_0x5193b7,null))['catch'](handleError(_0x5193b7,null));};
\ No newline at end of file
+var _0xf767=['apply','save','then','error','stack','name','map','Cdr','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','limit','status','set','json'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xf767,0x76));var _0x7f76=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0xf767[_0x5d4f12];return _0x4eb577;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f76('0x0'));var zipdir=require(_0x7f76('0x1'));var jsonpatch=require(_0x7f76('0x2'));var rp=require(_0x7f76('0x3'));var moment=require(_0x7f76('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7f76('0x5'));var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require('to-csv');var ejs=require(_0x7f76('0x9'));var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require(_0x7f76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f76('0xe'));var toCsv=require(_0x7f76('0xf'));var querystring=require(_0x7f76('0x10'));var Papa=require(_0x7f76('0x11'));var Redis=require('ioredis');var authService=require(_0x7f76('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require(_0x7f76('0x15'))(_0x7f76('0x16'));var utils=require(_0x7f76('0x17'));var config=require(_0x7f76('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f76('0x19'))['db'];function respondWithStatusCode(_0x2cd1b3,_0x47403b){_0x47403b=_0x47403b||0xcc;return function(_0x32392b){if(_0x32392b){return _0x2cd1b3[_0x7f76('0x1a')](_0x47403b);}return _0x2cd1b3['status'](_0x47403b)[_0x7f76('0x1b')]();};}function respondWithResult(_0x4d8de0,_0x42a9d3){_0x42a9d3=_0x42a9d3||0xc8;return function(_0x256f79){if(_0x256f79){return _0x4d8de0['status'](_0x42a9d3)['json'](_0x256f79);}};}function respondWithFilteredResult(_0x58d2f3,_0xe81aa9){return function(_0x2df2db){if(_0x2df2db){var _0x286e96=typeof _0xe81aa9['offset']===_0x7f76('0x1c')&&typeof _0xe81aa9['limit']===_0x7f76('0x1c');var _0x3ceb6a=_0x2df2db[_0x7f76('0x1d')];var _0x4802ff=_0x286e96?0x0:_0xe81aa9['offset'];var _0x494537=_0x286e96?_0x2df2db['count']:_0xe81aa9['offset']+_0xe81aa9[_0x7f76('0x1e')];var _0xdb1407;if(_0x494537>=_0x3ceb6a){_0x494537=_0x3ceb6a;_0xdb1407=0xc8;}else{_0xdb1407=0xce;}_0x58d2f3[_0x7f76('0x1f')](_0xdb1407);return _0x58d2f3[_0x7f76('0x20')]('Content-Range',_0x4802ff+'-'+_0x494537+'/'+_0x3ceb6a)[_0x7f76('0x21')](_0x2df2db);}return null;};}function patchUpdates(_0x557c0f){return function(_0x38c4d6){try{jsonpatch[_0x7f76('0x22')](_0x38c4d6,_0x557c0f,!![]);}catch(_0x5a28b0){return BPromise['reject'](_0x5a28b0);}return _0x38c4d6[_0x7f76('0x23')]();};}function saveUpdates(_0xb647d8,_0x5efed5){return function(_0x3f2536){if(_0x3f2536){return _0x3f2536['update'](_0xb647d8)[_0x7f76('0x24')](function(_0x333056){return _0x333056;});}return null;};}function removeEntity(_0x31993d,_0x3deb00){return function(_0x3eea75){if(_0x3eea75){return _0x3eea75['destroy']()[_0x7f76('0x24')](function(){_0x31993d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x197519,_0x45f1c9){return function(_0x3492f4){if(!_0x3492f4){_0x197519['sendStatus'](0x194);}return _0x3492f4;};}function handleError(_0xbe6ac1,_0x1347bf){_0x1347bf=_0x1347bf||0x1f4;return function(_0x3e624d){logger[_0x7f76('0x25')](_0x3e624d[_0x7f76('0x26')]);if(_0x3e624d['name']){delete _0x3e624d[_0x7f76('0x27')];}_0xbe6ac1[_0x7f76('0x1f')](_0x1347bf)['send'](_0x3e624d);};}exports['index']=function(_0xe459de,_0x58829a){var _0x1dd664={},_0x3542e3={},_0xd5ba7={'count':0x0,'rows':[]};var _0x393bdd=_[_0x7f76('0x28')](db[_0x7f76('0x29')]['rawAttributes'],function(_0x3570ec){return{'name':_0x3570ec[_0x7f76('0x2a')],'type':_0x3570ec[_0x7f76('0x2b')][_0x7f76('0x2c')]};});_0x3542e3['model']=_[_0x7f76('0x28')](_0x393bdd,_0x7f76('0x27'));_0x3542e3[_0x7f76('0x2d')]=_['keys'](_0xe459de[_0x7f76('0x2d')]);_0x3542e3[_0x7f76('0x2e')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],_0x3542e3[_0x7f76('0x2d')]);_0x1dd664[_0x7f76('0x31')]=_[_0x7f76('0x2f')](_0x3542e3[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0xe459de[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x1dd664[_0x7f76('0x31')]=_0x1dd664[_0x7f76('0x31')]['length']?_0x1dd664[_0x7f76('0x31')]:_0x3542e3[_0x7f76('0x30')];if(!_0xe459de[_0x7f76('0x2d')][_0x7f76('0x33')](_0x7f76('0x34'))){_0x1dd664[_0x7f76('0x1e')]=qs[_0x7f76('0x1e')](_0xe459de[_0x7f76('0x2d')]['limit']);_0x1dd664[_0x7f76('0x35')]=qs['offset'](_0xe459de['query'][_0x7f76('0x35')]);}_0x1dd664['order']=qs[_0x7f76('0x36')](_0xe459de[_0x7f76('0x2d')]['sort']);_0x1dd664[_0x7f76('0x37')]=qs['filters'](_['pick'](_0xe459de[_0x7f76('0x2d')],_0x3542e3[_0x7f76('0x2e')]),_0x393bdd);if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]){_0x1dd664[_0x7f76('0x37')]=_['merge'](_0x1dd664[_0x7f76('0x37')],{'$or':_[_0x7f76('0x28')](_0x393bdd,function(_0x4edf74){if(_0x4edf74['type']!==_0x7f76('0x39')){var _0x4ea167={};_0x4ea167[_0x4edf74[_0x7f76('0x27')]]={'$like':'%'+_0xe459de[_0x7f76('0x2d')][_0x7f76('0x38')]+'%'};return _0x4ea167;}})});}_0x1dd664=_['merge']({},_0x1dd664,_0xe459de[_0x7f76('0x3a')]);var _0x26b537={'where':_0x1dd664[_0x7f76('0x37')]};return db[_0x7f76('0x29')][_0x7f76('0x1d')](_0x26b537)[_0x7f76('0x24')](function(_0x58649f){_0xd5ba7['count']=_0x58649f;if(_0xe459de[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x1dd664[_0x7f76('0x3c')]=[{'all':!![]}];}return db[_0x7f76('0x29')][_0x7f76('0x3d')](_0x1dd664);})[_0x7f76('0x24')](function(_0x401284){_0xd5ba7[_0x7f76('0x3e')]=_0x401284;return _0xd5ba7;})[_0x7f76('0x24')](respondWithFilteredResult(_0x58829a,_0x1dd664))[_0x7f76('0x3f')](handleError(_0x58829a,null));};exports[_0x7f76('0x40')]=function(_0x313d37,_0x3229b9){var _0x391d04={'raw':!![],'where':{'id':_0x313d37[_0x7f76('0x41')]['id']}},_0x2a43f1={};_0x2a43f1[_0x7f76('0x30')]=_[_0x7f76('0x42')](db['Cdr'][_0x7f76('0x43')]);_0x2a43f1[_0x7f76('0x2d')]=_[_0x7f76('0x42')](_0x313d37['query']);_0x2a43f1['filters']=_[_0x7f76('0x2f')](_0x2a43f1['model'],_0x2a43f1[_0x7f76('0x2d')]);_0x391d04['attributes']=_['intersection'](_0x2a43f1[_0x7f76('0x30')],qs[_0x7f76('0x32')](_0x313d37[_0x7f76('0x2d')][_0x7f76('0x32')]));_0x391d04[_0x7f76('0x31')]=_0x391d04[_0x7f76('0x31')][_0x7f76('0x44')]?_0x391d04[_0x7f76('0x31')]:_0x2a43f1[_0x7f76('0x30')];if(_0x313d37[_0x7f76('0x2d')][_0x7f76('0x3b')]){_0x391d04[_0x7f76('0x3c')]=[{'all':!![]}];}_0x391d04=_[_0x7f76('0x45')]({},_0x391d04,_0x313d37[_0x7f76('0x3a')]);return db['Cdr'][_0x7f76('0x46')](_0x391d04)['then'](handleEntityNotFound(_0x3229b9,null))[_0x7f76('0x24')](respondWithResult(_0x3229b9,null))[_0x7f76('0x3f')](handleError(_0x3229b9,null));};exports[_0x7f76('0x47')]=function(_0x39bbef,_0x487b1f){return db[_0x7f76('0x29')][_0x7f76('0x47')](_0x39bbef[_0x7f76('0x48')],{})[_0x7f76('0x24')](respondWithResult(_0x487b1f,0xc9))['catch'](handleError(_0x487b1f,null));};exports[_0x7f76('0x49')]=function(_0xd87fe7,_0x53f77a){if(_0xd87fe7[_0x7f76('0x48')]['id']){delete _0xd87fe7[_0x7f76('0x48')]['id'];}return db[_0x7f76('0x29')]['find']({'where':{'id':_0xd87fe7[_0x7f76('0x41')]['id']}})[_0x7f76('0x24')](handleEntityNotFound(_0x53f77a,null))[_0x7f76('0x24')](saveUpdates(_0xd87fe7[_0x7f76('0x48')],null))[_0x7f76('0x24')](respondWithResult(_0x53f77a,null))[_0x7f76('0x3f')](handleError(_0x53f77a,null));};exports[_0x7f76('0x4a')]=function(_0x42abd9,_0x1a4d3c){return db[_0x7f76('0x29')][_0x7f76('0x46')]({'where':{'id':_0x42abd9[_0x7f76('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a4d3c,null))[_0x7f76('0x24')](removeEntity(_0x1a4d3c,null))['catch'](handleError(_0x1a4d3c,null));};exports[_0x7f76('0x4b')]=function(_0x3bcd59,_0x171c71){return db['Cdr'][_0x7f76('0x4b')]()[_0x7f76('0x24')](respondWithResult(_0x171c71,null))['catch'](handleError(_0x171c71,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index c4c2fda..a6e3adc 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(_0x153b39,_0x1b6dca){var _0x4fa074=function(_0x3ef8ca){while(--_0x3ef8ca){_0x153b39['push'](_0x153b39['shift']());}};_0x4fa074(++_0x1b6dca);}(_0x7a54,0x106));var _0x47a5=function(_0x2cb4fb,_0xedcc51){_0x2cb4fb=_0x2cb4fb-0x0;var _0x28e3c9=_0x7a54[_0x2cb4fb];return _0x28e3c9;};'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(_0xa39739,_0x4c1f40){var _0x536c81=function(_0x5a70e4){while(--_0x5a70e4){_0xa39739['push'](_0xa39739['shift']());}};_0x536c81(++_0x4c1f40);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 5cb6bc9..aec5702 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 _0xcb22=['error','code','Cdr,\x20%s,\x20%s','message','catch','lodash','util','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x42bc57,_0x1fb466){var _0x14bce7=function(_0x1a5039){while(--_0x1a5039){_0x42bc57['push'](_0x42bc57['shift']());}};_0x14bce7(++_0x1fb466);}(_0xcb22,0xb9));var _0x2cb2=function(_0x30f802,_0x4a6499){_0x30f802=_0x30f802-0x0;var _0x20f213=_0xcb22[_0x30f802];return _0x20f213;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var moment=require(_0x2cb2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cb2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cb2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2cb2('0x5'));var client=jayson[_0x2cb2('0x6')][_0x2cb2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44ad98,_0x323660,_0x43bb69){return new BPromise(function(_0x6df832,_0x967daa){return client['request'](_0x44ad98,_0x43bb69)[_0x2cb2('0x8')](function(_0x5a4e68){logger[_0x2cb2('0x9')]('Cdr,\x20%s,\x20%s',_0x323660,_0x2cb2('0xa'));logger['debug'](_0x2cb2('0xb'),_0x323660,_0x2cb2('0xa'),JSON[_0x2cb2('0xc')](_0x5a4e68));if(_0x5a4e68[_0x2cb2('0xd')]){if(_0x5a4e68['error'][_0x2cb2('0xe')]===0x1f4){logger[_0x2cb2('0xd')](_0x2cb2('0xf'),_0x323660,_0x5a4e68[_0x2cb2('0xd')]['message']);return _0x967daa(_0x5a4e68['error'][_0x2cb2('0x10')]);}logger['error'](_0x2cb2('0xf'),_0x323660,_0x5a4e68[_0x2cb2('0xd')][_0x2cb2('0x10')]);return _0x6df832(_0x5a4e68[_0x2cb2('0xd')][_0x2cb2('0x10')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x323660,_0x2cb2('0xa'));_0x6df832(_0x5a4e68['result'][_0x2cb2('0x10')]);}})[_0x2cb2('0x11')](function(_0x5cf4a8){logger['error']('Cdr,\x20%s,\x20%s',_0x323660,_0x5cf4a8);_0x967daa(_0x5cf4a8);});});}
\ No newline at end of file
+var _0xdb21=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x206592,_0x581d8b){var _0x419419=function(_0x159084){while(--_0x159084){_0x206592['push'](_0x206592['shift']());}};_0x419419(++_0x581d8b);}(_0xdb21,0x1e5));var _0x1db2=function(_0x4d18c2,_0x9b85d0){_0x4d18c2=_0x4d18c2-0x0;var _0x1cadf9=_0xdb21[_0x4d18c2];return _0x1cadf9;};'use strict';var _=require(_0x1db2('0x0'));var util=require(_0x1db2('0x1'));var moment=require(_0x1db2('0x2'));var BPromise=require(_0x1db2('0x3'));var rs=require(_0x1db2('0x4'));var fs=require('fs');var Redis=require(_0x1db2('0x5'));var db=require(_0x1db2('0x6'))['db'];var utils=require(_0x1db2('0x7'));var logger=require(_0x1db2('0x8'))(_0x1db2('0x9'));var config=require(_0x1db2('0xa'));var jayson=require(_0x1db2('0xb'));var client=jayson['client'][_0x1db2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c5da7,_0x4ccb28,_0x49d790){return new BPromise(function(_0x2d568c,_0x25a4a0){return client[_0x1db2('0xd')](_0x5c5da7,_0x49d790)['then'](function(_0xdeb4eb){logger[_0x1db2('0xe')](_0x1db2('0xf'),_0x4ccb28,_0x1db2('0x10'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x4ccb28,_0x1db2('0x10'),JSON[_0x1db2('0x11')](_0xdeb4eb));if(_0xdeb4eb['error']){if(_0xdeb4eb['error'][_0x1db2('0x12')]===0x1f4){logger[_0x1db2('0x13')](_0x1db2('0xf'),_0x4ccb28,_0xdeb4eb[_0x1db2('0x13')][_0x1db2('0x14')]);return _0x25a4a0(_0xdeb4eb[_0x1db2('0x13')][_0x1db2('0x14')]);}logger['error'](_0x1db2('0xf'),_0x4ccb28,_0xdeb4eb[_0x1db2('0x13')]['message']);return _0x2d568c(_0xdeb4eb[_0x1db2('0x13')]['message']);}else{logger[_0x1db2('0xe')](_0x1db2('0xf'),_0x4ccb28,_0x1db2('0x10'));_0x2d568c(_0xdeb4eb[_0x1db2('0x15')][_0x1db2('0x14')]);}})['catch'](function(_0x37b523){logger[_0x1db2('0x13')](_0x1db2('0xf'),_0x4ccb28,_0x37b523);_0x25a4a0(_0x37b523);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index e395ba8..c38a688 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(_0x27a9cc,_0x1b1b55){var _0x412f06=function(_0x6edd42){while(--_0x6edd42){_0x27a9cc['push'](_0x27a9cc['shift']());}};_0x412f06(++_0x1b1b55);}(_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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 7470c72..7f8a761 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 _0x5366=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x3ec74e,_0x2f6536){var _0x5a53f9=function(_0x461459){while(--_0x461459){_0x3ec74e['push'](_0x3ec74e['shift']());}};_0x5a53f9(++_0x2f6536);}(_0x5366,0x101));var _0x6536=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x5366[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0x6536('0x0'));module[_0x6536('0x1')]={'priority':{'type':Sequelize[_0x6536('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6536('0x3')],'allowNull':![],'defaultValue':_0x6536('0x4')},'appdata':{'type':Sequelize[_0x6536('0x5')]()},'description':{'type':Sequelize[_0x6536('0x3')]},'interval':{'type':Sequelize[_0x6536('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x9492=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x9492,0x153));var _0x2949=function(_0x83eb3b,_0x3c7335){_0x83eb3b=_0x83eb3b-0x0;var _0x45b45a=_0x9492[_0x83eb3b];return _0x45b45a;};'use strict';var Sequelize=require(_0x2949('0x0'));module[_0x2949('0x1')]={'priority':{'type':Sequelize[_0x2949('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2949('0x3')],'allowNull':![],'defaultValue':_0x2949('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2949('0x3')],'defaultValue':_0x2949('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index afb72c7..76d7125 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 _0x87ae=['undefined','count','set','Content-Range','json','apply','reject','update','then','status','error','name','send','params','ChatApplication','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','find','catch','body','destroy','zip-dir','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit'];(function(_0x63f02b,_0x1288d5){var _0x4eb570=function(_0x13ee75){while(--_0x13ee75){_0x63f02b['push'](_0x63f02b['shift']());}};_0x4eb570(++_0x1288d5);}(_0x87ae,0xf5));var _0xe87a=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x87ae[_0x3a7634];return _0x23bbe9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe87a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe87a('0x1'));var BPromise=require(_0xe87a('0x2'));var Mustache=require(_0xe87a('0x3'));var util=require('util');var path=require(_0xe87a('0x4'));var sox=require(_0xe87a('0x5'));var csv=require(_0xe87a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe87a('0x7'));var squel=require(_0xe87a('0x8'));var crypto=require('crypto');var jsforce=require(_0xe87a('0x9'));var deskjs=require(_0xe87a('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe87a('0xb'));var Papa=require(_0xe87a('0xc'));var Redis=require('ioredis');var authService=require(_0xe87a('0xd'));var qs=require(_0xe87a('0xe'));var as=require(_0xe87a('0xf'));var hardwareService=require(_0xe87a('0x10'));var logger=require(_0xe87a('0x11'))(_0xe87a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe87a('0x13'));var db=require(_0xe87a('0x14'))['db'];function respondWithStatusCode(_0x3e990c,_0x4db185){_0x4db185=_0x4db185||0xcc;return function(_0x1a725a){if(_0x1a725a){return _0x3e990c[_0xe87a('0x15')](_0x4db185);}return _0x3e990c['status'](_0x4db185)[_0xe87a('0x16')]();};}function respondWithResult(_0x353c52,_0x136340){_0x136340=_0x136340||0xc8;return function(_0x5032c5){if(_0x5032c5){return _0x353c52['status'](_0x136340)['json'](_0x5032c5);}};}function respondWithFilteredResult(_0x53a4f7,_0x44474f){return function(_0x1fa2cd){if(_0x1fa2cd){var _0xd2ca53=typeof _0x44474f[_0xe87a('0x17')]==='undefined'&&typeof _0x44474f[_0xe87a('0x18')]===_0xe87a('0x19');var _0x527c58=_0x1fa2cd['count'];var _0x4160e2=_0xd2ca53?0x0:_0x44474f['offset'];var _0x182e6f=_0xd2ca53?_0x1fa2cd[_0xe87a('0x1a')]:_0x44474f[_0xe87a('0x17')]+_0x44474f['limit'];var _0x444eeb;if(_0x182e6f>=_0x527c58){_0x182e6f=_0x527c58;_0x444eeb=0xc8;}else{_0x444eeb=0xce;}_0x53a4f7['status'](_0x444eeb);return _0x53a4f7[_0xe87a('0x1b')](_0xe87a('0x1c'),_0x4160e2+'-'+_0x182e6f+'/'+_0x527c58)[_0xe87a('0x1d')](_0x1fa2cd);}return null;};}function patchUpdates(_0x4059e1){return function(_0x104f67){try{jsonpatch[_0xe87a('0x1e')](_0x104f67,_0x4059e1,!![]);}catch(_0x1e37aa){return BPromise[_0xe87a('0x1f')](_0x1e37aa);}return _0x104f67['save']();};}function saveUpdates(_0x59c17c,_0x42ba03){return function(_0x363c6a){if(_0x363c6a){return _0x363c6a[_0xe87a('0x20')](_0x59c17c)[_0xe87a('0x21')](function(_0x15ced2){return _0x15ced2;});}return null;};}function removeEntity(_0x46731f,_0x56eba0){return function(_0x59d9f7){if(_0x59d9f7){return _0x59d9f7['destroy']()['then'](function(){_0x46731f[_0xe87a('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1108d0,_0x59dc1a){return function(_0x19f21e){if(!_0x19f21e){_0x1108d0[_0xe87a('0x15')](0x194);}return _0x19f21e;};}function handleError(_0x13e0a8,_0x16ee69){_0x16ee69=_0x16ee69||0x1f4;return function(_0x294d8b){logger[_0xe87a('0x23')](_0x294d8b['stack']);if(_0x294d8b[_0xe87a('0x24')]){delete _0x294d8b['name'];}_0x13e0a8['status'](_0x16ee69)[_0xe87a('0x25')](_0x294d8b);};}exports['show']=function(_0x537b52,_0x58a2b8){var _0x17c895={'raw':!![],'where':{'id':_0x537b52[_0xe87a('0x26')]['id']}},_0x6feaf6={};_0x6feaf6['model']=_['keys'](db[_0xe87a('0x27')]['rawAttributes']);_0x6feaf6['query']=_[_0xe87a('0x28')](_0x537b52[_0xe87a('0x29')]);_0x6feaf6[_0xe87a('0x2a')]=_[_0xe87a('0x2b')](_0x6feaf6[_0xe87a('0x2c')],_0x6feaf6['query']);_0x17c895[_0xe87a('0x2d')]=_['intersection'](_0x6feaf6[_0xe87a('0x2c')],qs['fields'](_0x537b52[_0xe87a('0x29')][_0xe87a('0x2e')]));_0x17c895[_0xe87a('0x2d')]=_0x17c895[_0xe87a('0x2d')][_0xe87a('0x2f')]?_0x17c895[_0xe87a('0x2d')]:_0x6feaf6[_0xe87a('0x2c')];if(_0x537b52[_0xe87a('0x29')][_0xe87a('0x30')]){_0x17c895[_0xe87a('0x31')]=[{'all':!![]}];}_0x17c895=_['merge']({},_0x17c895,_0x537b52['options']);return db['ChatApplication'][_0xe87a('0x32')](_0x17c895)['then'](handleEntityNotFound(_0x58a2b8,null))[_0xe87a('0x21')](respondWithResult(_0x58a2b8,null))[_0xe87a('0x33')](handleError(_0x58a2b8,null));};exports['update']=function(_0x15cb90,_0x5687bf){if(_0x15cb90['body']['id']){delete _0x15cb90[_0xe87a('0x34')]['id'];}return db[_0xe87a('0x27')][_0xe87a('0x32')]({'where':{'id':_0x15cb90[_0xe87a('0x26')]['id']}})['then'](handleEntityNotFound(_0x5687bf,null))[_0xe87a('0x21')](saveUpdates(_0x15cb90[_0xe87a('0x34')],null))['then'](respondWithResult(_0x5687bf,null))[_0xe87a('0x33')](handleError(_0x5687bf,null));};exports[_0xe87a('0x35')]=function(_0x596b28,_0x3a7575){return db[_0xe87a('0x27')][_0xe87a('0x32')]({'where':{'id':_0x596b28[_0xe87a('0x26')]['id']}})[_0xe87a('0x21')](handleEntityNotFound(_0x3a7575,null))['then'](removeEntity(_0x3a7575,null))[_0xe87a('0x33')](handleError(_0x3a7575,null));};
\ No newline at end of file
+var _0x1d5b=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','options','find','catch','update','body','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','show','params','model'];(function(_0x2f4e7a,_0x4c3f4e){var _0x3299a0=function(_0x422bd1){while(--_0x422bd1){_0x2f4e7a['push'](_0x2f4e7a['shift']());}};_0x3299a0(++_0x4c3f4e);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x3f05fe,_0x3341d8){_0x3f05fe=_0x3f05fe-0x0;var _0x1c06be=_0x1d5b[_0x3f05fe];return _0x1c06be;};'use strict';var emlformat=require(_0xb1d5('0x0'));var rimraf=require(_0xb1d5('0x1'));var zipdir=require(_0xb1d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1d5('0x3'));var moment=require('moment');var BPromise=require(_0xb1d5('0x4'));var Mustache=require(_0xb1d5('0x5'));var util=require(_0xb1d5('0x6'));var path=require(_0xb1d5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb1d5('0x8'));var fs=require('fs');var fs_extra=require(_0xb1d5('0x9'));var _=require(_0xb1d5('0xa'));var squel=require(_0xb1d5('0xb'));var crypto=require(_0xb1d5('0xc'));var jsforce=require(_0xb1d5('0xd'));var deskjs=require(_0xb1d5('0xe'));var toCsv=require(_0xb1d5('0xf'));var querystring=require('querystring');var Papa=require(_0xb1d5('0x10'));var Redis=require(_0xb1d5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb1d5('0x12'));var hardwareService=require(_0xb1d5('0x13'));var logger=require(_0xb1d5('0x14'))('api');var utils=require(_0xb1d5('0x15'));var config=require(_0xb1d5('0x16'));var licenseUtil=require(_0xb1d5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x90e8f9,_0x9d4e4){_0x9d4e4=_0x9d4e4||0xcc;return function(_0x2fd99c){if(_0x2fd99c){return _0x90e8f9[_0xb1d5('0x18')](_0x9d4e4);}return _0x90e8f9['status'](_0x9d4e4)[_0xb1d5('0x19')]();};}function respondWithResult(_0x31a2b6,_0x2c16e2){_0x2c16e2=_0x2c16e2||0xc8;return function(_0x53e1b3){if(_0x53e1b3){return _0x31a2b6[_0xb1d5('0x1a')](_0x2c16e2)[_0xb1d5('0x1b')](_0x53e1b3);}};}function respondWithFilteredResult(_0x18f0b8,_0x3fc6a0){return function(_0x5f6066){if(_0x5f6066){var _0x16a6d0=typeof _0x3fc6a0['offset']===_0xb1d5('0x1c')&&typeof _0x3fc6a0['limit']===_0xb1d5('0x1c');var _0x43aae9=_0x5f6066['count'];var _0x1870c2=_0x16a6d0?0x0:_0x3fc6a0[_0xb1d5('0x1d')];var _0xe3d99=_0x16a6d0?_0x5f6066['count']:_0x3fc6a0[_0xb1d5('0x1d')]+_0x3fc6a0[_0xb1d5('0x1e')];var _0x5a9c6f;if(_0xe3d99>=_0x43aae9){_0xe3d99=_0x43aae9;_0x5a9c6f=0xc8;}else{_0x5a9c6f=0xce;}_0x18f0b8[_0xb1d5('0x1a')](_0x5a9c6f);return _0x18f0b8[_0xb1d5('0x1f')](_0xb1d5('0x20'),_0x1870c2+'-'+_0xe3d99+'/'+_0x43aae9)[_0xb1d5('0x1b')](_0x5f6066);}return null;};}function patchUpdates(_0x2fa863){return function(_0x4dde74){try{jsonpatch[_0xb1d5('0x21')](_0x4dde74,_0x2fa863,!![]);}catch(_0x46fd1e){return BPromise[_0xb1d5('0x22')](_0x46fd1e);}return _0x4dde74[_0xb1d5('0x23')]();};}function saveUpdates(_0x34df7d,_0x50e15f){return function(_0xd979d){if(_0xd979d){return _0xd979d['update'](_0x34df7d)[_0xb1d5('0x24')](function(_0x4ca9b0){return _0x4ca9b0;});}return null;};}function removeEntity(_0x18e259,_0x3dde08){return function(_0x4178f0){if(_0x4178f0){return _0x4178f0['destroy']()['then'](function(){_0x18e259[_0xb1d5('0x1a')](0xcc)[_0xb1d5('0x19')]();});}};}function handleEntityNotFound(_0x30c4d0,_0xef6d33){return function(_0x58a814){if(!_0x58a814){_0x30c4d0[_0xb1d5('0x18')](0x194);}return _0x58a814;};}function handleError(_0x232b67,_0x238798){_0x238798=_0x238798||0x1f4;return function(_0x3e6a66){logger[_0xb1d5('0x25')](_0x3e6a66[_0xb1d5('0x26')]);if(_0x3e6a66[_0xb1d5('0x27')]){delete _0x3e6a66[_0xb1d5('0x27')];}_0x232b67['status'](_0x238798)[_0xb1d5('0x28')](_0x3e6a66);};}exports[_0xb1d5('0x29')]=function(_0x1f7b72,_0x3ab5d6){var _0x4e36bf={'raw':!![],'where':{'id':_0x1f7b72[_0xb1d5('0x2a')]['id']}},_0x38d16b={};_0x38d16b[_0xb1d5('0x2b')]=_[_0xb1d5('0x2c')](db[_0xb1d5('0x2d')][_0xb1d5('0x2e')]);_0x38d16b['query']=_[_0xb1d5('0x2c')](_0x1f7b72[_0xb1d5('0x2f')]);_0x38d16b[_0xb1d5('0x30')]=_[_0xb1d5('0x31')](_0x38d16b[_0xb1d5('0x2b')],_0x38d16b['query']);_0x4e36bf['attributes']=_[_0xb1d5('0x31')](_0x38d16b[_0xb1d5('0x2b')],qs[_0xb1d5('0x32')](_0x1f7b72[_0xb1d5('0x2f')][_0xb1d5('0x32')]));_0x4e36bf[_0xb1d5('0x33')]=_0x4e36bf[_0xb1d5('0x33')][_0xb1d5('0x34')]?_0x4e36bf['attributes']:_0x38d16b[_0xb1d5('0x2b')];if(_0x1f7b72[_0xb1d5('0x2f')][_0xb1d5('0x35')]){_0x4e36bf['include']=[{'all':!![]}];}_0x4e36bf=_['merge']({},_0x4e36bf,_0x1f7b72[_0xb1d5('0x36')]);return db[_0xb1d5('0x2d')][_0xb1d5('0x37')](_0x4e36bf)[_0xb1d5('0x24')](handleEntityNotFound(_0x3ab5d6,null))[_0xb1d5('0x24')](respondWithResult(_0x3ab5d6,null))[_0xb1d5('0x38')](handleError(_0x3ab5d6,null));};exports[_0xb1d5('0x39')]=function(_0x2dd299,_0x43dfeb){if(_0x2dd299[_0xb1d5('0x3a')]['id']){delete _0x2dd299[_0xb1d5('0x3a')]['id'];}return db[_0xb1d5('0x2d')]['find']({'where':{'id':_0x2dd299['params']['id']}})[_0xb1d5('0x24')](handleEntityNotFound(_0x43dfeb,null))[_0xb1d5('0x24')](saveUpdates(_0x2dd299[_0xb1d5('0x3a')],null))[_0xb1d5('0x24')](respondWithResult(_0x43dfeb,null))[_0xb1d5('0x38')](handleError(_0x43dfeb,null));};exports[_0xb1d5('0x3b')]=function(_0x208449,_0x534bae){return db[_0xb1d5('0x2d')][_0xb1d5('0x37')]({'where':{'id':_0x208449['params']['id']}})[_0xb1d5('0x24')](handleEntityNotFound(_0x534bae,null))[_0xb1d5('0x24')](removeEntity(_0x534bae,null))[_0xb1d5('0x38')](handleError(_0x534bae,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7cbb4ed..1c017cc 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 _0x14de=['moment','request-promise','path','rimraf','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x14de,0x1ea));var _0xe14d=function(_0x554c4c,_0x1ceb88){_0x554c4c=_0x554c4c-0x0;var _0x25fe6c=_0x14de[_0x554c4c];return _0x25fe6c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe14d('0x0'))(_0xe14d('0x1'));var moment=require(_0xe14d('0x2'));var BPromise=require('bluebird');var rp=require(_0xe14d('0x3'));var fs=require('fs');var path=require(_0xe14d('0x4'));var rimraf=require(_0xe14d('0x5'));var config=require('../../config/environment');var attributes=require(_0xe14d('0x6'));module[_0xe14d('0x7')]=function(_0x1e04de,_0x561c4a){return _0x1e04de[_0xe14d('0x8')](_0xe14d('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe14d('0xa'),'collate':_0xe14d('0xb')});};
\ No newline at end of file
+var _0x130d=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash'];(function(_0x517b59,_0x2a4790){var _0x3cfb43=function(_0x53f82c){while(--_0x53f82c){_0x517b59['push'](_0x517b59['shift']());}};_0x3cfb43(++_0x2a4790);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd130('0x0'));var util=require('util');var logger=require(_0xd130('0x1'))('api');var moment=require(_0xd130('0x2'));var BPromise=require(_0xd130('0x3'));var rp=require(_0xd130('0x4'));var fs=require('fs');var path=require(_0xd130('0x5'));var rimraf=require(_0xd130('0x6'));var config=require(_0xd130('0x7'));var attributes=require(_0xd130('0x8'));module[_0xd130('0x9')]=function(_0x287e61,_0x4689a8){return _0x287e61[_0xd130('0xa')](_0xd130('0xb'),attributes,{'tableName':_0xd130('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd130('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 2e86cb5..c4b6ef8 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 _0xdd85=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd85,0x19d));var _0x5dd8=function(_0x16fc02,_0x454d54){_0x16fc02=_0x16fc02-0x0;var _0x11f48d=_0xdd85[_0x16fc02];return _0x11f48d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5dd8('0x0'));var rs=require(_0x5dd8('0x1'));var fs=require('fs');var Redis=require(_0x5dd8('0x2'));var db=require(_0x5dd8('0x3'))['db'];var utils=require(_0x5dd8('0x4'));var logger=require(_0x5dd8('0x5'))(_0x5dd8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5dd8('0x7')][_0x5dd8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5892fd,_0x23b24c,_0x130754){return new BPromise(function(_0x5a6874,_0x33bd4a){return client['request'](_0x5892fd,_0x130754)[_0x5dd8('0x9')](function(_0x1967ca){logger[_0x5dd8('0xa')](_0x5dd8('0xb'),_0x23b24c,'request\x20sent');logger[_0x5dd8('0xc')](_0x5dd8('0xd'),_0x23b24c,_0x5dd8('0xe'),JSON[_0x5dd8('0xf')](_0x1967ca));if(_0x1967ca[_0x5dd8('0x10')]){if(_0x1967ca[_0x5dd8('0x10')]['code']===0x1f4){logger[_0x5dd8('0x10')](_0x5dd8('0xb'),_0x23b24c,_0x1967ca[_0x5dd8('0x10')][_0x5dd8('0x11')]);return _0x33bd4a(_0x1967ca[_0x5dd8('0x10')]['message']);}logger[_0x5dd8('0x10')](_0x5dd8('0xb'),_0x23b24c,_0x1967ca['error'][_0x5dd8('0x11')]);return _0x5a6874(_0x1967ca[_0x5dd8('0x10')][_0x5dd8('0x11')]);}else{logger[_0x5dd8('0xa')]('ChatApplication,\x20%s,\x20%s',_0x23b24c,_0x5dd8('0xe'));_0x5a6874(_0x1967ca['result']['message']);}})['catch'](function(_0x54466d){logger[_0x5dd8('0x10')](_0x5dd8('0xb'),_0x23b24c,_0x54466d);_0x33bd4a(_0x54466d);});});}
\ No newline at end of file
+var _0x4694=['../../config/logger','rpc','jayson/promise','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1eaa4c,_0x367d3f){var _0x2b4e60=function(_0x13fb6b){while(--_0x13fb6b){_0x1eaa4c['push'](_0x1eaa4c['shift']());}};_0x2b4e60(++_0x367d3f);}(_0x4694,0x80));var _0x4469=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0x4694[_0x9c8b4a];return _0x198bef;};'use strict';var _=require('lodash');var util=require(_0x4469('0x0'));var moment=require('moment');var BPromise=require(_0x4469('0x1'));var rs=require(_0x4469('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4469('0x3'))['db'];var utils=require(_0x4469('0x4'));var logger=require(_0x4469('0x5'))(_0x4469('0x6'));var config=require('../../config/environment');var jayson=require(_0x4469('0x7'));var client=jayson['client'][_0x4469('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x388729,_0x4ddf46,_0x449bd4){return new BPromise(function(_0x59ddcb,_0x216949){return client['request'](_0x388729,_0x449bd4)['then'](function(_0x4226d4){logger[_0x4469('0x9')](_0x4469('0xa'),_0x4ddf46,_0x4469('0xb'));logger[_0x4469('0xc')](_0x4469('0xd'),_0x4ddf46,_0x4469('0xb'),JSON['stringify'](_0x4226d4));if(_0x4226d4[_0x4469('0xe')]){if(_0x4226d4['error'][_0x4469('0xf')]===0x1f4){logger[_0x4469('0xe')](_0x4469('0xa'),_0x4ddf46,_0x4226d4[_0x4469('0xe')]['message']);return _0x216949(_0x4226d4['error']['message']);}logger[_0x4469('0xe')](_0x4469('0xa'),_0x4ddf46,_0x4226d4[_0x4469('0xe')]['message']);return _0x59ddcb(_0x4226d4[_0x4469('0xe')][_0x4469('0x10')]);}else{logger[_0x4469('0x9')](_0x4469('0xa'),_0x4ddf46,_0x4469('0xb'));_0x59ddcb(_0x4226d4[_0x4469('0x11')][_0x4469('0x10')]);}})[_0x4469('0x12')](function(_0x539450){logger[_0x4469('0xe')](_0x4469('0xa'),_0x4ddf46,_0x539450);_0x216949(_0x539450);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 4499f7b..e340002 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 _0x6c72=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','/:id','show','delete','destroy','exports'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0x6c72,0x144));var _0x26c7=function(_0x3a698f,_0x4a82fc){_0x3a698f=_0x3a698f-0x0;var _0x1b7cf3=_0x6c72[_0x3a698f];return _0x1b7cf3;};'use strict';var multer=require(_0x26c7('0x0'));var util=require(_0x26c7('0x1'));var path=require(_0x26c7('0x2'));var timeout=require(_0x26c7('0x3'));var express=require('express');var router=express[_0x26c7('0x4')]();var fs_extra=require(_0x26c7('0x5'));var auth=require(_0x26c7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x26c7('0x7'),auth['isAuthenticated'](),controller[_0x26c7('0x8')]);router['put'](_0x26c7('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x26c7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x26c7('0xa')]);module[_0x26c7('0xb')]=router;
\ No newline at end of file
+var _0xf661=['show','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated'];(function(_0x99167b,_0x4bb003){var _0x417386=function(_0x334ec3){while(--_0x334ec3){_0x99167b['push'](_0x99167b['shift']());}};_0x417386(++_0x4bb003);}(_0xf661,0x8e));var _0x1f66=function(_0x4e2897,_0x33a468){_0x4e2897=_0x4e2897-0x0;var _0x3a21c8=_0xf661[_0x4e2897];return _0x3a21c8;};'use strict';var multer=require('multer');var util=require(_0x1f66('0x0'));var path=require(_0x1f66('0x1'));var timeout=require(_0x1f66('0x2'));var express=require(_0x1f66('0x3'));var router=express[_0x1f66('0x4')]();var fs_extra=require(_0x1f66('0x5'));var auth=require(_0x1f66('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1f66('0x7'));var controller=require(_0x1f66('0x8'));router[_0x1f66('0x9')]('/:id',auth[_0x1f66('0xa')](),controller[_0x1f66('0xb')]);router[_0x1f66('0xc')](_0x1f66('0xd'),auth[_0x1f66('0xa')](),controller[_0x1f66('0xe')]);router[_0x1f66('0xf')](_0x1f66('0xd'),auth[_0x1f66('0xa')](),controller['destroy']);module[_0x1f66('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 454d802..8a36902 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 _0xb012=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3a07f5,_0x357c50){var _0x1ae6b9=function(_0x18579e){while(--_0x18579e){_0x3a07f5['push'](_0x3a07f5['shift']());}};_0x1ae6b9(++_0x357c50);}(_0xb012,0x92));var _0x2b01=function(_0x29b5f4,_0x453c8d){_0x29b5f4=_0x29b5f4-0x0;var _0x56c947=_0xb012[_0x29b5f4];return _0x56c947;};'use strict';var Sequelize=require(_0x2b01('0x0'));module[_0x2b01('0x1')]={'name':{'type':Sequelize[_0x2b01('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2b01('0x2')]},'write':{'type':Sequelize[_0x2b01('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xcba8=['sequelize','exports','STRING','BOOLEAN'];(function(_0x555b41,_0x19abf3){var _0x526d1f=function(_0x11f2c7){while(--_0x11f2c7){_0x555b41['push'](_0x555b41['shift']());}};_0x526d1f(++_0x19abf3);}(_0xcba8,0x1f0));var _0x8cba=function(_0x5c2c3d,_0x570a6d){_0x5c2c3d=_0x5c2c3d-0x0;var _0x1a926d=_0xcba8[_0x5c2c3d];return _0x1a926d;};'use strict';var Sequelize=require(_0x8cba('0x0'));module[_0x8cba('0x1')]={'name':{'type':Sequelize[_0x8cba('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8cba('0x2')]},'write':{'type':Sequelize[_0x8cba('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 e7ad7b9..c483478 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 _0x0025=['./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','ChatGroup','rows','catch','rawAttributes','create','body','find','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x109e92,_0xf03bcb){var _0x246ad4=function(_0x5cf1ed){while(--_0x5cf1ed){_0x109e92['push'](_0x109e92['shift']());}};_0x246ad4(++_0xf03bcb);}(_0x0025,0xa9));var _0x5002=function(_0x183d0a,_0x2ceffc){_0x183d0a=_0x183d0a-0x0;var _0x236d8f=_0x0025[_0x183d0a];return _0x236d8f;};'use strict';var emlformat=require(_0x5002('0x0'));var rimraf=require(_0x5002('0x1'));var zipdir=require(_0x5002('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5002('0x3'));var moment=require(_0x5002('0x4'));var BPromise=require(_0x5002('0x5'));var Mustache=require(_0x5002('0x6'));var util=require(_0x5002('0x7'));var path=require(_0x5002('0x8'));var sox=require(_0x5002('0x9'));var csv=require(_0x5002('0xa'));var ejs=require(_0x5002('0xb'));var fs=require('fs');var fs_extra=require(_0x5002('0xc'));var _=require(_0x5002('0xd'));var squel=require(_0x5002('0xe'));var crypto=require(_0x5002('0xf'));var jsforce=require(_0x5002('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5002('0x11'));var Papa=require(_0x5002('0x12'));var Redis=require(_0x5002('0x13'));var authService=require(_0x5002('0x14'));var qs=require(_0x5002('0x15'));var as=require(_0x5002('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5002('0x17'))(_0x5002('0x18'));var utils=require('../../config/utils');var config=require(_0x5002('0x19'));var licenseUtil=require(_0x5002('0x1a'));var db=require(_0x5002('0x1b'))['db'];config[_0x5002('0x1c')]=_[_0x5002('0x1d')](config[_0x5002('0x1c')],{'host':_0x5002('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5002('0x1c')]));require(_0x5002('0x1f'))[_0x5002('0x20')](socket);function respondWithStatusCode(_0x1da697,_0x8d4461){_0x8d4461=_0x8d4461||0xcc;return function(_0xc5f876){if(_0xc5f876){return _0x1da697[_0x5002('0x21')](_0x8d4461);}return _0x1da697[_0x5002('0x22')](_0x8d4461)[_0x5002('0x23')]();};}function respondWithResult(_0x4dde64,_0x3dad37){_0x3dad37=_0x3dad37||0xc8;return function(_0x28589d){if(_0x28589d){return _0x4dde64['status'](_0x3dad37)[_0x5002('0x24')](_0x28589d);}};}function respondWithFilteredResult(_0x59596e,_0x93236a){return function(_0x4627ee){if(_0x4627ee){var _0x50dd1d=typeof _0x93236a[_0x5002('0x25')]==='undefined'&&typeof _0x93236a[_0x5002('0x26')]===_0x5002('0x27');var _0x23b4c5=_0x4627ee[_0x5002('0x28')];var _0x30f3fa=_0x50dd1d?0x0:_0x93236a[_0x5002('0x25')];var _0x2621e6=_0x50dd1d?_0x4627ee[_0x5002('0x28')]:_0x93236a['offset']+_0x93236a[_0x5002('0x26')];var _0x5e3b1f;if(_0x2621e6>=_0x23b4c5){_0x2621e6=_0x23b4c5;_0x5e3b1f=0xc8;}else{_0x5e3b1f=0xce;}_0x59596e[_0x5002('0x22')](_0x5e3b1f);return _0x59596e[_0x5002('0x29')](_0x5002('0x2a'),_0x30f3fa+'-'+_0x2621e6+'/'+_0x23b4c5)['json'](_0x4627ee);}return null;};}function patchUpdates(_0x1b1499){return function(_0x3ab1e8){try{jsonpatch[_0x5002('0x2b')](_0x3ab1e8,_0x1b1499,!![]);}catch(_0x5e53ca){return BPromise[_0x5002('0x2c')](_0x5e53ca);}return _0x3ab1e8[_0x5002('0x2d')]();};}function saveUpdates(_0xddb361,_0x214664){return function(_0x58e977){if(_0x58e977){return _0x58e977[_0x5002('0x2e')](_0xddb361)['then'](function(_0x10bbfa){return _0x10bbfa;});}return null;};}function removeEntity(_0x350687,_0x466563){return function(_0x4a6e27){if(_0x4a6e27){return _0x4a6e27[_0x5002('0x2f')]()[_0x5002('0x30')](function(){_0x350687['status'](0xcc)[_0x5002('0x23')]();});}};}function handleEntityNotFound(_0x3b9fa6,_0x25a26c){return function(_0x491660){if(!_0x491660){_0x3b9fa6[_0x5002('0x21')](0x194);}return _0x491660;};}function handleError(_0x319f65,_0x550e85){_0x550e85=_0x550e85||0x1f4;return function(_0x57fc56){logger['error'](_0x57fc56[_0x5002('0x31')]);if(_0x57fc56[_0x5002('0x32')]){delete _0x57fc56[_0x5002('0x32')];}_0x319f65[_0x5002('0x22')](_0x550e85)[_0x5002('0x33')](_0x57fc56);};}exports['index']=function(_0x5e3274,_0x5bfd52){var _0x22ac42={},_0x55f412={},_0x4c64fe={'count':0x0,'rows':[]};var _0x363843=_[_0x5002('0x34')](db['ChatGroup']['rawAttributes'],function(_0x2ba5a6){return{'name':_0x2ba5a6['fieldName'],'type':_0x2ba5a6[_0x5002('0x35')][_0x5002('0x36')]};});_0x55f412[_0x5002('0x37')]=_['map'](_0x363843,_0x5002('0x32'));_0x55f412[_0x5002('0x38')]=_[_0x5002('0x39')](_0x5e3274['query']);_0x55f412[_0x5002('0x3a')]=_[_0x5002('0x3b')](_0x55f412['model'],_0x55f412[_0x5002('0x38')]);_0x22ac42[_0x5002('0x3c')]=_[_0x5002('0x3b')](_0x55f412[_0x5002('0x37')],qs[_0x5002('0x3d')](_0x5e3274[_0x5002('0x38')]['fields']));_0x22ac42[_0x5002('0x3c')]=_0x22ac42['attributes'][_0x5002('0x3e')]?_0x22ac42['attributes']:_0x55f412[_0x5002('0x37')];if(!_0x5e3274[_0x5002('0x38')][_0x5002('0x3f')](_0x5002('0x40'))){_0x22ac42[_0x5002('0x26')]=qs['limit'](_0x5e3274[_0x5002('0x38')][_0x5002('0x26')]);_0x22ac42['offset']=qs[_0x5002('0x25')](_0x5e3274[_0x5002('0x38')][_0x5002('0x25')]);}_0x22ac42[_0x5002('0x41')]=qs['sort'](_0x5e3274[_0x5002('0x38')][_0x5002('0x42')]);_0x22ac42[_0x5002('0x43')]=qs['filters'](_['pick'](_0x5e3274[_0x5002('0x38')],_0x55f412['filters']),_0x363843);if(_0x5e3274[_0x5002('0x38')][_0x5002('0x44')]){_0x22ac42[_0x5002('0x43')]=_[_0x5002('0x45')](_0x22ac42[_0x5002('0x43')],{'$or':_[_0x5002('0x34')](_0x363843,function(_0x5dd4bb){if(_0x5dd4bb[_0x5002('0x35')]!=='VIRTUAL'){var _0x31fc8b={};_0x31fc8b[_0x5dd4bb[_0x5002('0x32')]]={'$like':'%'+_0x5e3274['query'][_0x5002('0x44')]+'%'};return _0x31fc8b;}})});}_0x22ac42=_[_0x5002('0x45')]({},_0x22ac42,_0x5e3274[_0x5002('0x46')]);var _0x6fe909={'where':_0x22ac42[_0x5002('0x43')]};return db['ChatGroup'][_0x5002('0x28')](_0x6fe909)[_0x5002('0x30')](function(_0x222426){_0x4c64fe[_0x5002('0x28')]=_0x222426;if(_0x5e3274[_0x5002('0x38')][_0x5002('0x47')]){_0x22ac42[_0x5002('0x48')]=[{'all':!![]}];}return db[_0x5002('0x49')]['findAll'](_0x22ac42);})[_0x5002('0x30')](function(_0x2f3ce7){_0x4c64fe[_0x5002('0x4a')]=_0x2f3ce7;return _0x4c64fe;})[_0x5002('0x30')](respondWithFilteredResult(_0x5bfd52,_0x22ac42))[_0x5002('0x4b')](handleError(_0x5bfd52,null));};exports['show']=function(_0x3071b6,_0x2ea9d2){var _0x2da6c2={'raw':!![],'where':{'id':_0x3071b6['params']['id']}},_0x3f543e={};_0x3f543e[_0x5002('0x37')]=_[_0x5002('0x39')](db[_0x5002('0x49')][_0x5002('0x4c')]);_0x3f543e[_0x5002('0x38')]=_['keys'](_0x3071b6[_0x5002('0x38')]);_0x3f543e[_0x5002('0x3a')]=_[_0x5002('0x3b')](_0x3f543e[_0x5002('0x37')],_0x3f543e['query']);_0x2da6c2[_0x5002('0x3c')]=_['intersection'](_0x3f543e[_0x5002('0x37')],qs['fields'](_0x3071b6[_0x5002('0x38')][_0x5002('0x3d')]));_0x2da6c2['attributes']=_0x2da6c2[_0x5002('0x3c')][_0x5002('0x3e')]?_0x2da6c2[_0x5002('0x3c')]:_0x3f543e[_0x5002('0x37')];if(_0x3071b6[_0x5002('0x38')][_0x5002('0x47')]){_0x2da6c2['include']=[{'all':!![]}];}_0x2da6c2=_[_0x5002('0x45')]({},_0x2da6c2,_0x3071b6[_0x5002('0x46')]);return db[_0x5002('0x49')]['find'](_0x2da6c2)[_0x5002('0x30')](handleEntityNotFound(_0x2ea9d2,null))[_0x5002('0x30')](respondWithResult(_0x2ea9d2,null))[_0x5002('0x4b')](handleError(_0x2ea9d2,null));};exports[_0x5002('0x4d')]=function(_0x390099,_0xd3fd8b){return db['ChatGroup']['create'](_0x390099[_0x5002('0x4e')],{})[_0x5002('0x30')](respondWithResult(_0xd3fd8b,0xc9))[_0x5002('0x4b')](handleError(_0xd3fd8b,null));};exports['update']=function(_0x4a8ee3,_0x23f07a){if(_0x4a8ee3['body']['id']){delete _0x4a8ee3[_0x5002('0x4e')]['id'];}return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0x4a8ee3[_0x5002('0x50')]['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x23f07a,null))[_0x5002('0x30')](saveUpdates(_0x4a8ee3['body'],null))[_0x5002('0x30')](respondWithResult(_0x23f07a,null))[_0x5002('0x4b')](handleError(_0x23f07a,null));};exports[_0x5002('0x2f')]=function(_0x54deae,_0x165d1a){return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0x54deae['params']['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x165d1a,null))[_0x5002('0x30')](removeEntity(_0x165d1a,null))[_0x5002('0x4b')](handleError(_0x165d1a,null));};exports['describe']=function(_0x430132,_0x1472ae){return db[_0x5002('0x49')][_0x5002('0x51')]()[_0x5002('0x30')](respondWithResult(_0x1472ae,null))[_0x5002('0x4b')](handleError(_0x1472ae,null));};exports[_0x5002('0x52')]=function(_0x41d91a,_0xcc677d,_0x56c731){return db[_0x5002('0x53')]['count']({'where':{'ChatGroupId':_0x41d91a['params']['id'],'ToId':_0x41d91a[_0x5002('0x54')]['id'],'read':![]}})[_0x5002('0x30')](function(_0x438d05){return{'id':_[_0x5002('0x55')](_0x41d91a[_0x5002('0x50')]['id']),'count':_0x438d05};})[_0x5002('0x30')](respondWithResult(_0xcc677d,null))[_0x5002('0x4b')](handleError(_0xcc677d,null));};exports[_0x5002('0x56')]=function(_0x2ab415,_0x4c7ab5,_0x1e3275){return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0x2ab415['params']['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x4c7ab5,null))[_0x5002('0x30')](function(_0x2b7311){if(_0x2b7311){return _0x2b7311[_0x5002('0x56')](_0x2ab415[_0x5002('0x4e')][_0x5002('0x57')],_[_0x5002('0x58')](_0x2ab415[_0x5002('0x4e')],[_0x5002('0x57'),'id'])||{});}})[_0x5002('0x30')](respondWithResult(_0x4c7ab5,null))[_0x5002('0x4b')](handleError(_0x4c7ab5,null));};exports[_0x5002('0x59')]=function(_0x519ec3,_0x1e2658,_0x350c0c){var _0x57a7e9={};var _0xbba2cf={};var _0x4470ed;var _0x1d65b6;return db[_0x5002('0x49')][_0x5002('0x5a')]({'where':{'id':_0x519ec3[_0x5002('0x50')]['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x1e2658,null))[_0x5002('0x30')](function(_0x3e3ef7){if(_0x3e3ef7){_0x4470ed=_0x3e3ef7;_0xbba2cf[_0x5002('0x37')]=_[_0x5002('0x39')](db[_0x5002('0x5b')]['rawAttributes']);_0xbba2cf[_0x5002('0x38')]=_[_0x5002('0x39')](_0x519ec3['query']);_0xbba2cf[_0x5002('0x3a')]=_[_0x5002('0x3b')](_0xbba2cf[_0x5002('0x37')],_0xbba2cf[_0x5002('0x38')]);_0x57a7e9[_0x5002('0x3c')]=_[_0x5002('0x3b')](_0xbba2cf[_0x5002('0x37')],qs['fields'](_0x519ec3[_0x5002('0x38')]['fields']));_0x57a7e9[_0x5002('0x3c')]=_0x57a7e9[_0x5002('0x3c')][_0x5002('0x3e')]?_0x57a7e9[_0x5002('0x3c')]:_0xbba2cf[_0x5002('0x37')];_0x57a7e9[_0x5002('0x41')]=qs[_0x5002('0x42')](_0x519ec3[_0x5002('0x38')][_0x5002('0x42')]);_0x57a7e9[_0x5002('0x43')]=qs[_0x5002('0x3a')](_[_0x5002('0x5c')](_0x519ec3[_0x5002('0x38')],_0xbba2cf[_0x5002('0x3a')]));if(_0x519ec3[_0x5002('0x38')][_0x5002('0x44')]){_0x57a7e9['where']=_[_0x5002('0x45')](_0x57a7e9[_0x5002('0x43')],{'$or':_[_0x5002('0x34')](_0x57a7e9[_0x5002('0x3c')],function(_0xee49d6){var _0x319746={};_0x319746[_0xee49d6]={'$like':'%'+_0x519ec3[_0x5002('0x38')][_0x5002('0x44')]+'%'};return _0x319746;})});}_0x57a7e9=_[_0x5002('0x45')]({},_0x57a7e9,_0x519ec3[_0x5002('0x46')]);return _0x4470ed[_0x5002('0x59')](_0x57a7e9);}})['then'](function(_0x1778d1){if(_0x1778d1){_0x1d65b6=_0x1778d1[_0x5002('0x3e')];if(!_0x519ec3[_0x5002('0x38')]['hasOwnProperty'](_0x5002('0x40'))){_0x57a7e9[_0x5002('0x26')]=qs[_0x5002('0x26')](_0x519ec3['query'][_0x5002('0x26')]);_0x57a7e9[_0x5002('0x25')]=qs[_0x5002('0x25')](_0x519ec3[_0x5002('0x38')]['offset']);}return _0x4470ed[_0x5002('0x59')](_0x57a7e9);}})['then'](function(_0x1cd0c5){if(_0x1cd0c5){return _0x1cd0c5?{'count':_0x1d65b6,'rows':_0x1cd0c5}:null;}})['then'](respondWithResult(_0x1e2658,null))[_0x5002('0x4b')](handleError(_0x1e2658,null));};exports[_0x5002('0x5d')]=function(_0x1bf9bb,_0x248a3b,_0x5bae28){return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0x1bf9bb[_0x5002('0x50')]['id']}})[_0x5002('0x30')](handleEntityNotFound(_0x248a3b,null))[_0x5002('0x30')](function(_0xe8414c){if(_0xe8414c){return _0xe8414c[_0x5002('0x5d')](_0x1bf9bb[_0x5002('0x38')][_0x5002('0x57')]);}})[_0x5002('0x30')](respondWithStatusCode(_0x248a3b,null))[_0x5002('0x4b')](handleError(_0x248a3b,null));};exports[_0x5002('0x5e')]=function(_0xf27c82,_0xba7494,_0x2c6a86){if(_0xf27c82['body']['id']){delete _0xf27c82[_0x5002('0x4e')]['id'];}return db[_0x5002('0x49')][_0x5002('0x4f')]({'where':{'id':_0xf27c82[_0x5002('0x50')]['id']}})[_0x5002('0x30')](handleEntityNotFound(_0xba7494,null))[_0x5002('0x30')](function(_0x27f6ee){if(_0x27f6ee){_0xf27c82[_0x5002('0x4e')][_0x5002('0x5f')]=_0x27f6ee['id'];return db[_0x5002('0x53')]['create'](_0xf27c82[_0x5002('0x4e')]);}})[_0x5002('0x30')](respondWithResult(_0xba7494,null))[_0x5002('0x4b')](handleError(_0xba7494,null));};exports[_0x5002('0x60')]=function(_0x32fdec,_0x4f01c9,_0x1991d0){var _0x5ab4b7={};var _0x11a9d9={};var _0x278b64;var _0x34b7b4;return db['ChatGroup'][_0x5002('0x5a')]({'where':{'id':_0x32fdec[_0x5002('0x50')]['id']}})['then'](handleEntityNotFound(_0x4f01c9,null))['then'](function(_0x12d738){if(_0x12d738){_0x278b64=_0x12d738;_0x11a9d9[_0x5002('0x37')]=_['keys'](db[_0x5002('0x53')]['rawAttributes']);_0x11a9d9['query']=_['keys'](_0x32fdec[_0x5002('0x38')]);_0x11a9d9[_0x5002('0x3a')]=_['intersection'](_0x11a9d9[_0x5002('0x37')],_0x11a9d9[_0x5002('0x38')]);_0x5ab4b7[_0x5002('0x3c')]=_[_0x5002('0x3b')](_0x11a9d9[_0x5002('0x37')],qs[_0x5002('0x3d')](_0x32fdec['query'][_0x5002('0x3d')]));_0x5ab4b7['attributes']=_0x5ab4b7[_0x5002('0x3c')][_0x5002('0x3e')]?_0x5ab4b7[_0x5002('0x3c')]:_0x11a9d9[_0x5002('0x37')];_0x5ab4b7['order']=qs['sort'](_0x32fdec['query']['sort']);_0x5ab4b7[_0x5002('0x43')]=qs[_0x5002('0x3a')](_[_0x5002('0x5c')](_0x32fdec[_0x5002('0x38')],_0x11a9d9['filters']));if(_0x32fdec[_0x5002('0x38')]['filter']){_0x5ab4b7[_0x5002('0x43')]=_[_0x5002('0x45')](_0x5ab4b7[_0x5002('0x43')],{'$or':_['map'](_0x5ab4b7[_0x5002('0x3c')],function(_0x826c64){var _0x34a179={};_0x34a179[_0x826c64]={'$like':'%'+_0x32fdec[_0x5002('0x38')][_0x5002('0x44')]+'%'};return _0x34a179;})});}if(_0x32fdec[_0x5002('0x38')][_0x5002('0x61')]){var _0x20e0cf=_0x32fdec[_0x5002('0x38')][_0x5002('0x61')][_0x5002('0x62')](',');var _0x5e7b3d={};_0x5e7b3d[_0x20e0cf[0x0]]={'$gte':moment(_0x20e0cf[0x1])['format'](_0x5002('0x63'))};_0x5ab4b7[_0x5002('0x43')]=_[_0x5002('0x45')](_0x5ab4b7[_0x5002('0x43')],_0x5e7b3d);}_0x5ab4b7=_[_0x5002('0x45')]({},_0x5ab4b7,_0x32fdec['options']);return _0x278b64[_0x5002('0x60')](_0x5ab4b7);}})[_0x5002('0x30')](function(_0x5dd197){if(_0x5dd197){_0x34b7b4=_0x5dd197[_0x5002('0x3e')];if(!_0x32fdec[_0x5002('0x38')][_0x5002('0x3f')](_0x5002('0x40'))){_0x5ab4b7[_0x5002('0x26')]=qs['limit'](_0x32fdec['query'][_0x5002('0x26')]);_0x5ab4b7[_0x5002('0x25')]=qs[_0x5002('0x25')](_0x32fdec[_0x5002('0x38')][_0x5002('0x25')]);}return _0x278b64[_0x5002('0x60')](_0x5ab4b7);}})[_0x5002('0x30')](function(_0x5b710c){if(_0x5b710c){return _0x5b710c?{'count':_0x34b7b4,'rows':_0x5b710c}:null;}})[_0x5002('0x30')](respondWithResult(_0x4f01c9,null))[_0x5002('0x4b')](handleError(_0x4f01c9,null));};
\ No newline at end of file
+var _0xfbbb=['json','offset','limit','undefined','count','set','apply','reject','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','update','catch','describe','getUnread','user','toInteger','ids','omit','getMembers','findOne','length','removeMembers','ChatGroupId','getMessages','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./chatGroup.socket','register','sendStatus','status','end'];(function(_0x5a3c52,_0x371f4f){var _0x365b22=function(_0x15670c){while(--_0x15670c){_0x5a3c52['push'](_0x5a3c52['shift']());}};_0x365b22(++_0x371f4f);}(_0xfbbb,0xfc));var _0xbfbb=function(_0x1c8284,_0x546198){_0x1c8284=_0x1c8284-0x0;var _0x103f51=_0xfbbb[_0x1c8284];return _0x103f51;};'use strict';var emlformat=require(_0xbfbb('0x0'));var rimraf=require(_0xbfbb('0x1'));var zipdir=require(_0xbfbb('0x2'));var jsonpatch=require(_0xbfbb('0x3'));var rp=require(_0xbfbb('0x4'));var moment=require('moment');var BPromise=require(_0xbfbb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbfbb('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbfbb('0x7'));var squel=require(_0xbfbb('0x8'));var crypto=require(_0xbfbb('0x9'));var jsforce=require(_0xbfbb('0xa'));var deskjs=require(_0xbfbb('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbfbb('0xc'));var Papa=require(_0xbfbb('0xd'));var Redis=require('ioredis');var authService=require(_0xbfbb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbfbb('0xf'));var hardwareService=require(_0xbfbb('0x10'));var logger=require(_0xbfbb('0x11'))(_0xbfbb('0x12'));var utils=require(_0xbfbb('0x13'));var config=require(_0xbfbb('0x14'));var licenseUtil=require(_0xbfbb('0x15'));var db=require(_0xbfbb('0x16'))['db'];config['redis']=_[_0xbfbb('0x17')](config[_0xbfbb('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfbb('0x18')]));require(_0xbfbb('0x19'))[_0xbfbb('0x1a')](socket);function respondWithStatusCode(_0x2f2e37,_0x27fff8){_0x27fff8=_0x27fff8||0xcc;return function(_0x181dd8){if(_0x181dd8){return _0x2f2e37[_0xbfbb('0x1b')](_0x27fff8);}return _0x2f2e37[_0xbfbb('0x1c')](_0x27fff8)[_0xbfbb('0x1d')]();};}function respondWithResult(_0x14e00b,_0x2d139e){_0x2d139e=_0x2d139e||0xc8;return function(_0x5bfe3c){if(_0x5bfe3c){return _0x14e00b[_0xbfbb('0x1c')](_0x2d139e)[_0xbfbb('0x1e')](_0x5bfe3c);}};}function respondWithFilteredResult(_0x42bf40,_0x1765d5){return function(_0x1068e5){if(_0x1068e5){var _0x569fa7=typeof _0x1765d5[_0xbfbb('0x1f')]==='undefined'&&typeof _0x1765d5[_0xbfbb('0x20')]===_0xbfbb('0x21');var _0x5af45c=_0x1068e5['count'];var _0x3c2a34=_0x569fa7?0x0:_0x1765d5[_0xbfbb('0x1f')];var _0x4d3a74=_0x569fa7?_0x1068e5[_0xbfbb('0x22')]:_0x1765d5[_0xbfbb('0x1f')]+_0x1765d5[_0xbfbb('0x20')];var _0x351fa0;if(_0x4d3a74>=_0x5af45c){_0x4d3a74=_0x5af45c;_0x351fa0=0xc8;}else{_0x351fa0=0xce;}_0x42bf40[_0xbfbb('0x1c')](_0x351fa0);return _0x42bf40[_0xbfbb('0x23')]('Content-Range',_0x3c2a34+'-'+_0x4d3a74+'/'+_0x5af45c)[_0xbfbb('0x1e')](_0x1068e5);}return null;};}function patchUpdates(_0x2c4025){return function(_0x533fca){try{jsonpatch[_0xbfbb('0x24')](_0x533fca,_0x2c4025,!![]);}catch(_0x341c30){return BPromise[_0xbfbb('0x25')](_0x341c30);}return _0x533fca['save']();};}function saveUpdates(_0x4a549e,_0x8f00cf){return function(_0x598e12){if(_0x598e12){return _0x598e12['update'](_0x4a549e)[_0xbfbb('0x26')](function(_0x437df7){return _0x437df7;});}return null;};}function removeEntity(_0x2a87cb,_0x6adc89){return function(_0x4a4d45){if(_0x4a4d45){return _0x4a4d45[_0xbfbb('0x27')]()[_0xbfbb('0x26')](function(){_0x2a87cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58ad3d,_0x1bbb75){return function(_0x5e838a){if(!_0x5e838a){_0x58ad3d['sendStatus'](0x194);}return _0x5e838a;};}function handleError(_0x4d83dd,_0x20f6fe){_0x20f6fe=_0x20f6fe||0x1f4;return function(_0x493ca7){logger['error'](_0x493ca7[_0xbfbb('0x28')]);if(_0x493ca7[_0xbfbb('0x29')]){delete _0x493ca7['name'];}_0x4d83dd['status'](_0x20f6fe)[_0xbfbb('0x2a')](_0x493ca7);};}exports[_0xbfbb('0x2b')]=function(_0xfbdfba,_0x20b578){var _0x3c24d4={},_0x3e9246={},_0x5c69c0={'count':0x0,'rows':[]};var _0x4396a4=_[_0xbfbb('0x2c')](db[_0xbfbb('0x2d')][_0xbfbb('0x2e')],function(_0x12c9d0){return{'name':_0x12c9d0[_0xbfbb('0x2f')],'type':_0x12c9d0[_0xbfbb('0x30')][_0xbfbb('0x31')]};});_0x3e9246['model']=_[_0xbfbb('0x2c')](_0x4396a4,'name');_0x3e9246[_0xbfbb('0x32')]=_[_0xbfbb('0x33')](_0xfbdfba[_0xbfbb('0x32')]);_0x3e9246[_0xbfbb('0x34')]=_['intersection'](_0x3e9246['model'],_0x3e9246[_0xbfbb('0x32')]);_0x3c24d4[_0xbfbb('0x35')]=_[_0xbfbb('0x36')](_0x3e9246[_0xbfbb('0x37')],qs[_0xbfbb('0x38')](_0xfbdfba[_0xbfbb('0x32')][_0xbfbb('0x38')]));_0x3c24d4[_0xbfbb('0x35')]=_0x3c24d4[_0xbfbb('0x35')]['length']?_0x3c24d4[_0xbfbb('0x35')]:_0x3e9246[_0xbfbb('0x37')];if(!_0xfbdfba['query'][_0xbfbb('0x39')](_0xbfbb('0x3a'))){_0x3c24d4[_0xbfbb('0x20')]=qs[_0xbfbb('0x20')](_0xfbdfba[_0xbfbb('0x32')]['limit']);_0x3c24d4[_0xbfbb('0x1f')]=qs[_0xbfbb('0x1f')](_0xfbdfba[_0xbfbb('0x32')][_0xbfbb('0x1f')]);}_0x3c24d4[_0xbfbb('0x3b')]=qs[_0xbfbb('0x3c')](_0xfbdfba[_0xbfbb('0x32')]['sort']);_0x3c24d4[_0xbfbb('0x3d')]=qs['filters'](_[_0xbfbb('0x3e')](_0xfbdfba[_0xbfbb('0x32')],_0x3e9246[_0xbfbb('0x34')]),_0x4396a4);if(_0xfbdfba['query'][_0xbfbb('0x3f')]){_0x3c24d4[_0xbfbb('0x3d')]=_[_0xbfbb('0x40')](_0x3c24d4['where'],{'$or':_['map'](_0x4396a4,function(_0x33f60b){if(_0x33f60b[_0xbfbb('0x30')]!==_0xbfbb('0x41')){var _0x58590b={};_0x58590b[_0x33f60b[_0xbfbb('0x29')]]={'$like':'%'+_0xfbdfba[_0xbfbb('0x32')]['filter']+'%'};return _0x58590b;}})});}_0x3c24d4=_[_0xbfbb('0x40')]({},_0x3c24d4,_0xfbdfba[_0xbfbb('0x42')]);var _0x76bbf7={'where':_0x3c24d4[_0xbfbb('0x3d')]};return db['ChatGroup'][_0xbfbb('0x22')](_0x76bbf7)[_0xbfbb('0x26')](function(_0xc872ef){_0x5c69c0[_0xbfbb('0x22')]=_0xc872ef;if(_0xfbdfba[_0xbfbb('0x32')][_0xbfbb('0x43')]){_0x3c24d4[_0xbfbb('0x44')]=[{'all':!![]}];}return db[_0xbfbb('0x2d')]['findAll'](_0x3c24d4);})[_0xbfbb('0x26')](function(_0xc5b3a8){_0x5c69c0[_0xbfbb('0x45')]=_0xc5b3a8;return _0x5c69c0;})[_0xbfbb('0x26')](respondWithFilteredResult(_0x20b578,_0x3c24d4))['catch'](handleError(_0x20b578,null));};exports[_0xbfbb('0x46')]=function(_0x56dcb3,_0x300397){var _0x1c6fcb={'raw':!![],'where':{'id':_0x56dcb3[_0xbfbb('0x47')]['id']}},_0x3e7d94={};_0x3e7d94[_0xbfbb('0x37')]=_[_0xbfbb('0x33')](db[_0xbfbb('0x2d')][_0xbfbb('0x2e')]);_0x3e7d94['query']=_[_0xbfbb('0x33')](_0x56dcb3[_0xbfbb('0x32')]);_0x3e7d94[_0xbfbb('0x34')]=_['intersection'](_0x3e7d94[_0xbfbb('0x37')],_0x3e7d94[_0xbfbb('0x32')]);_0x1c6fcb[_0xbfbb('0x35')]=_[_0xbfbb('0x36')](_0x3e7d94[_0xbfbb('0x37')],qs['fields'](_0x56dcb3[_0xbfbb('0x32')]['fields']));_0x1c6fcb[_0xbfbb('0x35')]=_0x1c6fcb[_0xbfbb('0x35')]['length']?_0x1c6fcb[_0xbfbb('0x35')]:_0x3e7d94['model'];if(_0x56dcb3[_0xbfbb('0x32')]['includeAll']){_0x1c6fcb['include']=[{'all':!![]}];}_0x1c6fcb=_['merge']({},_0x1c6fcb,_0x56dcb3[_0xbfbb('0x42')]);return db['ChatGroup'][_0xbfbb('0x48')](_0x1c6fcb)[_0xbfbb('0x26')](handleEntityNotFound(_0x300397,null))['then'](respondWithResult(_0x300397,null))['catch'](handleError(_0x300397,null));};exports[_0xbfbb('0x49')]=function(_0x4f57d9,_0x27596d){return db[_0xbfbb('0x2d')][_0xbfbb('0x49')](_0x4f57d9[_0xbfbb('0x4a')],{})[_0xbfbb('0x26')](respondWithResult(_0x27596d,0xc9))['catch'](handleError(_0x27596d,null));};exports[_0xbfbb('0x4b')]=function(_0x1e7b7a,_0xd3e5ae){if(_0x1e7b7a[_0xbfbb('0x4a')]['id']){delete _0x1e7b7a[_0xbfbb('0x4a')]['id'];}return db[_0xbfbb('0x2d')][_0xbfbb('0x48')]({'where':{'id':_0x1e7b7a[_0xbfbb('0x47')]['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0xd3e5ae,null))[_0xbfbb('0x26')](saveUpdates(_0x1e7b7a[_0xbfbb('0x4a')],null))[_0xbfbb('0x26')](respondWithResult(_0xd3e5ae,null))[_0xbfbb('0x4c')](handleError(_0xd3e5ae,null));};exports[_0xbfbb('0x27')]=function(_0x25d423,_0x3ae00e){return db[_0xbfbb('0x2d')][_0xbfbb('0x48')]({'where':{'id':_0x25d423[_0xbfbb('0x47')]['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x3ae00e,null))[_0xbfbb('0x26')](removeEntity(_0x3ae00e,null))[_0xbfbb('0x4c')](handleError(_0x3ae00e,null));};exports['describe']=function(_0x16b929,_0x4f1647){return db[_0xbfbb('0x2d')][_0xbfbb('0x4d')]()[_0xbfbb('0x26')](respondWithResult(_0x4f1647,null))['catch'](handleError(_0x4f1647,null));};exports[_0xbfbb('0x4e')]=function(_0x1ef7d6,_0x3cdaea,_0x8bf778){return db['ChatInternalMessage'][_0xbfbb('0x22')]({'where':{'ChatGroupId':_0x1ef7d6[_0xbfbb('0x47')]['id'],'ToId':_0x1ef7d6[_0xbfbb('0x4f')]['id'],'read':![]}})[_0xbfbb('0x26')](function(_0x2cc513){return{'id':_[_0xbfbb('0x50')](_0x1ef7d6['params']['id']),'count':_0x2cc513};})[_0xbfbb('0x26')](respondWithResult(_0x3cdaea,null))[_0xbfbb('0x4c')](handleError(_0x3cdaea,null));};exports['addMembers']=function(_0x569f1a,_0x30ba64,_0x460a1e){return db[_0xbfbb('0x2d')]['find']({'where':{'id':_0x569f1a[_0xbfbb('0x47')]['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x30ba64,null))[_0xbfbb('0x26')](function(_0x2a08c3){if(_0x2a08c3){return _0x2a08c3['addMembers'](_0x569f1a[_0xbfbb('0x4a')][_0xbfbb('0x51')],_[_0xbfbb('0x52')](_0x569f1a[_0xbfbb('0x4a')],[_0xbfbb('0x51'),'id'])||{});}})[_0xbfbb('0x26')](respondWithResult(_0x30ba64,null))[_0xbfbb('0x4c')](handleError(_0x30ba64,null));};exports[_0xbfbb('0x53')]=function(_0x4a3ced,_0x131cbf,_0x2e822c){var _0x5f383c={};var _0x37814e={};var _0x1c9fc2;var _0x40545f;return db[_0xbfbb('0x2d')][_0xbfbb('0x54')]({'where':{'id':_0x4a3ced['params']['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x131cbf,null))[_0xbfbb('0x26')](function(_0xe399f7){if(_0xe399f7){_0x1c9fc2=_0xe399f7;_0x37814e[_0xbfbb('0x37')]=_['keys'](db['User'][_0xbfbb('0x2e')]);_0x37814e['query']=_[_0xbfbb('0x33')](_0x4a3ced[_0xbfbb('0x32')]);_0x37814e[_0xbfbb('0x34')]=_['intersection'](_0x37814e[_0xbfbb('0x37')],_0x37814e[_0xbfbb('0x32')]);_0x5f383c[_0xbfbb('0x35')]=_[_0xbfbb('0x36')](_0x37814e['model'],qs[_0xbfbb('0x38')](_0x4a3ced[_0xbfbb('0x32')]['fields']));_0x5f383c[_0xbfbb('0x35')]=_0x5f383c[_0xbfbb('0x35')][_0xbfbb('0x55')]?_0x5f383c['attributes']:_0x37814e['model'];_0x5f383c[_0xbfbb('0x3b')]=qs[_0xbfbb('0x3c')](_0x4a3ced['query'][_0xbfbb('0x3c')]);_0x5f383c['where']=qs[_0xbfbb('0x34')](_[_0xbfbb('0x3e')](_0x4a3ced[_0xbfbb('0x32')],_0x37814e['filters']));if(_0x4a3ced[_0xbfbb('0x32')]['filter']){_0x5f383c[_0xbfbb('0x3d')]=_[_0xbfbb('0x40')](_0x5f383c[_0xbfbb('0x3d')],{'$or':_[_0xbfbb('0x2c')](_0x5f383c[_0xbfbb('0x35')],function(_0x5b1001){var _0x43774b={};_0x43774b[_0x5b1001]={'$like':'%'+_0x4a3ced['query'][_0xbfbb('0x3f')]+'%'};return _0x43774b;})});}_0x5f383c=_[_0xbfbb('0x40')]({},_0x5f383c,_0x4a3ced[_0xbfbb('0x42')]);return _0x1c9fc2['getMembers'](_0x5f383c);}})[_0xbfbb('0x26')](function(_0xfaccc){if(_0xfaccc){_0x40545f=_0xfaccc[_0xbfbb('0x55')];if(!_0x4a3ced[_0xbfbb('0x32')]['hasOwnProperty']('nolimit')){_0x5f383c[_0xbfbb('0x20')]=qs[_0xbfbb('0x20')](_0x4a3ced[_0xbfbb('0x32')][_0xbfbb('0x20')]);_0x5f383c[_0xbfbb('0x1f')]=qs['offset'](_0x4a3ced[_0xbfbb('0x32')][_0xbfbb('0x1f')]);}return _0x1c9fc2['getMembers'](_0x5f383c);}})['then'](function(_0x21e69c){if(_0x21e69c){return _0x21e69c?{'count':_0x40545f,'rows':_0x21e69c}:null;}})['then'](respondWithResult(_0x131cbf,null))[_0xbfbb('0x4c')](handleError(_0x131cbf,null));};exports[_0xbfbb('0x56')]=function(_0x27d82c,_0x14dc3e,_0x449217){return db[_0xbfbb('0x2d')][_0xbfbb('0x48')]({'where':{'id':_0x27d82c[_0xbfbb('0x47')]['id']}})['then'](handleEntityNotFound(_0x14dc3e,null))[_0xbfbb('0x26')](function(_0x553fa2){if(_0x553fa2){return _0x553fa2[_0xbfbb('0x56')](_0x27d82c[_0xbfbb('0x32')][_0xbfbb('0x51')]);}})['then'](respondWithStatusCode(_0x14dc3e,null))[_0xbfbb('0x4c')](handleError(_0x14dc3e,null));};exports['addMessage']=function(_0x5aaff2,_0x1846b7,_0x1920e1){if(_0x5aaff2[_0xbfbb('0x4a')]['id']){delete _0x5aaff2['body']['id'];}return db[_0xbfbb('0x2d')][_0xbfbb('0x48')]({'where':{'id':_0x5aaff2[_0xbfbb('0x47')]['id']}})['then'](handleEntityNotFound(_0x1846b7,null))['then'](function(_0x9e646d){if(_0x9e646d){_0x5aaff2[_0xbfbb('0x4a')][_0xbfbb('0x57')]=_0x9e646d['id'];return db['ChatInternalMessage'][_0xbfbb('0x49')](_0x5aaff2[_0xbfbb('0x4a')]);}})['then'](respondWithResult(_0x1846b7,null))[_0xbfbb('0x4c')](handleError(_0x1846b7,null));};exports[_0xbfbb('0x58')]=function(_0x1c02b7,_0x5421a1,_0xdf59eb){var _0x4e0567={};var _0x15be5d={};var _0xaf1224;var _0x614f93;return db[_0xbfbb('0x2d')][_0xbfbb('0x54')]({'where':{'id':_0x1c02b7['params']['id']}})[_0xbfbb('0x26')](handleEntityNotFound(_0x5421a1,null))[_0xbfbb('0x26')](function(_0x41b371){if(_0x41b371){_0xaf1224=_0x41b371;_0x15be5d[_0xbfbb('0x37')]=_[_0xbfbb('0x33')](db[_0xbfbb('0x59')][_0xbfbb('0x2e')]);_0x15be5d[_0xbfbb('0x32')]=_[_0xbfbb('0x33')](_0x1c02b7[_0xbfbb('0x32')]);_0x15be5d[_0xbfbb('0x34')]=_[_0xbfbb('0x36')](_0x15be5d['model'],_0x15be5d[_0xbfbb('0x32')]);_0x4e0567['attributes']=_[_0xbfbb('0x36')](_0x15be5d[_0xbfbb('0x37')],qs['fields'](_0x1c02b7[_0xbfbb('0x32')]['fields']));_0x4e0567[_0xbfbb('0x35')]=_0x4e0567[_0xbfbb('0x35')][_0xbfbb('0x55')]?_0x4e0567[_0xbfbb('0x35')]:_0x15be5d[_0xbfbb('0x37')];_0x4e0567[_0xbfbb('0x3b')]=qs[_0xbfbb('0x3c')](_0x1c02b7['query'][_0xbfbb('0x3c')]);_0x4e0567[_0xbfbb('0x3d')]=qs['filters'](_[_0xbfbb('0x3e')](_0x1c02b7[_0xbfbb('0x32')],_0x15be5d[_0xbfbb('0x34')]));if(_0x1c02b7[_0xbfbb('0x32')][_0xbfbb('0x3f')]){_0x4e0567[_0xbfbb('0x3d')]=_[_0xbfbb('0x40')](_0x4e0567[_0xbfbb('0x3d')],{'$or':_[_0xbfbb('0x2c')](_0x4e0567[_0xbfbb('0x35')],function(_0x222c23){var _0xaf9e11={};_0xaf9e11[_0x222c23]={'$like':'%'+_0x1c02b7[_0xbfbb('0x32')]['filter']+'%'};return _0xaf9e11;})});}if(_0x1c02b7[_0xbfbb('0x32')][_0xbfbb('0x5a')]){var _0x55fb0b=_0x1c02b7['query']['$gte'][_0xbfbb('0x5b')](',');var _0x5c339e={};_0x5c339e[_0x55fb0b[0x0]]={'$gte':moment(_0x55fb0b[0x1])[_0xbfbb('0x5c')](_0xbfbb('0x5d'))};_0x4e0567[_0xbfbb('0x3d')]=_[_0xbfbb('0x40')](_0x4e0567[_0xbfbb('0x3d')],_0x5c339e);}_0x4e0567=_[_0xbfbb('0x40')]({},_0x4e0567,_0x1c02b7[_0xbfbb('0x42')]);return _0xaf1224[_0xbfbb('0x58')](_0x4e0567);}})[_0xbfbb('0x26')](function(_0x25e321){if(_0x25e321){_0x614f93=_0x25e321[_0xbfbb('0x55')];if(!_0x1c02b7[_0xbfbb('0x32')][_0xbfbb('0x39')](_0xbfbb('0x3a'))){_0x4e0567[_0xbfbb('0x20')]=qs[_0xbfbb('0x20')](_0x1c02b7['query'][_0xbfbb('0x20')]);_0x4e0567['offset']=qs[_0xbfbb('0x1f')](_0x1c02b7[_0xbfbb('0x32')][_0xbfbb('0x1f')]);}return _0xaf1224['getMessages'](_0x4e0567);}})['then'](function(_0x134885){if(_0x134885){return _0x134885?{'count':_0x614f93,'rows':_0x134885}:null;}})[_0xbfbb('0x26')](respondWithResult(_0x5421a1,null))[_0xbfbb('0x4c')](handleError(_0x5421a1,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 6d06a80..adabce5 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 _0x287e=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb','ChatGroup'];(function(_0x3d34f0,_0x4a5dc0){var _0x135ecd=function(_0x9a81d5){while(--_0x9a81d5){_0x3d34f0['push'](_0x3d34f0['shift']());}};_0x135ecd(++_0x4a5dc0);}(_0x287e,0x1e3));var _0xe287=function(_0x565bdf,_0x1dc64b){_0x565bdf=_0x565bdf-0x0;var _0x5f1f61=_0x287e[_0x565bdf];return _0x5f1f61;};'use strict';var EventEmitter=require(_0xe287('0x0'));var ChatGroup=require(_0xe287('0x1'))['db'][_0xe287('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe287('0x3')](0x0);var events={'afterCreate':_0xe287('0x4'),'afterUpdate':_0xe287('0x5'),'afterDestroy':_0xe287('0x6')};function emitEvent(_0x3ce68e){return function(_0x16d2d7,_0x5f34d6,_0x113035){ChatGroupEvents[_0xe287('0x7')](_0x3ce68e+':'+_0x16d2d7['id'],_0x16d2d7);ChatGroupEvents['emit'](_0x3ce68e,_0x16d2d7);_0x113035(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xe287('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xb2b0=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x729992,_0x45d9ce){var _0x27826f=function(_0x38b955){while(--_0x38b955){_0x729992['push'](_0x729992['shift']());}};_0x27826f(++_0x45d9ce);}(_0xb2b0,0x72));var _0x0b2b=function(_0x3166a6,_0x4e7127){_0x3166a6=_0x3166a6-0x0;var _0x36f73d=_0xb2b0[_0x3166a6];return _0x36f73d;};'use strict';var EventEmitter=require(_0x0b2b('0x0'));var ChatGroup=require(_0x0b2b('0x1'))['db'][_0x0b2b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0b2b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0b2b('0x4')};function emitEvent(_0x21fc00){return function(_0x2b241c,_0x51a18e,_0x96538a){ChatGroupEvents[_0x0b2b('0x5')](_0x21fc00+':'+_0x2b241c['id'],_0x2b241c);ChatGroupEvents[_0x0b2b('0x5')](_0x21fc00,_0x2b241c);_0x96538a(null);};}for(var e in events){if(events[_0x0b2b('0x6')](e)){var event=events[e];ChatGroup[_0x0b2b('0x7')](e,emitEvent(event));}}module[_0x0b2b('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index bd27352..4113de1 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 _0x0d60=['rimraf','../../config/environment','exports','ChatGroup','lodash','util','moment','bluebird','request-promise','path'];(function(_0x20dba9,_0x477048){var _0x1ad894=function(_0x96dfc2){while(--_0x96dfc2){_0x20dba9['push'](_0x20dba9['shift']());}};_0x1ad894(++_0x477048);}(_0x0d60,0x90));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x00d6('0x0'));var util=require(_0x00d6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x00d6('0x2'));var BPromise=require(_0x00d6('0x3'));var rp=require(_0x00d6('0x4'));var fs=require('fs');var path=require(_0x00d6('0x5'));var rimraf=require(_0x00d6('0x6'));var config=require(_0x00d6('0x7'));var attributes=require('./chatGroup.attributes');module[_0x00d6('0x8')]=function(_0x2a3210,_0x290f84){return _0x2a3210['define'](_0x00d6('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3aa5=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0x3aa5,0x121));var _0x53aa=function(_0x592a66,_0x16192e){_0x592a66=_0x592a66-0x0;var _0xa26208=_0x3aa5[_0x592a66];return _0xa26208;};'use strict';var _=require(_0x53aa('0x0'));var util=require(_0x53aa('0x1'));var logger=require(_0x53aa('0x2'))('api');var moment=require(_0x53aa('0x3'));var BPromise=require(_0x53aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53aa('0x5'));var rimraf=require(_0x53aa('0x6'));var config=require(_0x53aa('0x7'));var attributes=require(_0x53aa('0x8'));module[_0x53aa('0x9')]=function(_0x38007b,_0x483331){return _0x38007b[_0x53aa('0xa')](_0x53aa('0xb'),attributes,{'tableName':_0x53aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 952827a..381a87d 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 _0x0f17=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0x0f17,0x8b));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70f1('0x0'));var util=require(_0x70f1('0x1'));var moment=require(_0x70f1('0x2'));var BPromise=require(_0x70f1('0x3'));var rs=require(_0x70f1('0x4'));var fs=require('fs');var Redis=require(_0x70f1('0x5'));var db=require(_0x70f1('0x6'))['db'];var utils=require(_0x70f1('0x7'));var logger=require(_0x70f1('0x8'))(_0x70f1('0x9'));var config=require(_0x70f1('0xa'));var jayson=require(_0x70f1('0xb'));var client=jayson[_0x70f1('0xc')][_0x70f1('0xd')]({'port':0x232a});config[_0x70f1('0xe')]=_[_0x70f1('0xf')](config['redis'],{'host':_0x70f1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70f1('0xe')]));require(_0x70f1('0x11'))['register'](socket);function respondWithRpcPromise(_0x261425,_0x7c8ac5,_0x3ecfbf){return new BPromise(function(_0x50cd72,_0x4274e9){return client[_0x70f1('0x12')](_0x261425,_0x3ecfbf)['then'](function(_0x23fe2c){logger[_0x70f1('0x13')](_0x70f1('0x14'),_0x7c8ac5,_0x70f1('0x15'));logger[_0x70f1('0x16')](_0x70f1('0x17'),_0x7c8ac5,_0x70f1('0x15'),JSON[_0x70f1('0x18')](_0x23fe2c));if(_0x23fe2c['error']){if(_0x23fe2c[_0x70f1('0x19')]['code']===0x1f4){logger[_0x70f1('0x19')]('ChatGroup,\x20%s,\x20%s',_0x7c8ac5,_0x23fe2c[_0x70f1('0x19')][_0x70f1('0x1a')]);return _0x4274e9(_0x23fe2c[_0x70f1('0x19')][_0x70f1('0x1a')]);}logger[_0x70f1('0x19')](_0x70f1('0x14'),_0x7c8ac5,_0x23fe2c[_0x70f1('0x19')]['message']);return _0x50cd72(_0x23fe2c[_0x70f1('0x19')]['message']);}else{logger[_0x70f1('0x13')](_0x70f1('0x14'),_0x7c8ac5,_0x70f1('0x15'));_0x50cd72(_0x23fe2c[_0x70f1('0x1b')][_0x70f1('0x1a')]);}})['catch'](function(_0x48e81a){logger[_0x70f1('0x19')](_0x70f1('0x14'),_0x7c8ac5,_0x48e81a);_0x4274e9(_0x48e81a);});});}
\ No newline at end of file
+var _0xb3c2=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x30c151,_0x39df85){var _0x5806ad=function(_0x35e563){while(--_0x35e563){_0x30c151['push'](_0x30c151['shift']());}};_0x5806ad(++_0x39df85);}(_0xb3c2,0x152));var _0x2b3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3c2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2b3c('0x0'));var util=require(_0x2b3c('0x1'));var moment=require('moment');var BPromise=require(_0x2b3c('0x2'));var rs=require(_0x2b3c('0x3'));var fs=require('fs');var Redis=require(_0x2b3c('0x4'));var db=require(_0x2b3c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b3c('0x6'))(_0x2b3c('0x7'));var config=require(_0x2b3c('0x8'));var jayson=require(_0x2b3c('0x9'));var client=jayson[_0x2b3c('0xa')]['http']({'port':0x232a});config[_0x2b3c('0xb')]=_[_0x2b3c('0xc')](config[_0x2b3c('0xb')],{'host':_0x2b3c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2b3c('0xe'))[_0x2b3c('0xf')](socket);function respondWithRpcPromise(_0x3fea73,_0x535546,_0x149a3a){return new BPromise(function(_0x1a8e9d,_0x32209a){return client[_0x2b3c('0x10')](_0x3fea73,_0x149a3a)[_0x2b3c('0x11')](function(_0x14c977){logger[_0x2b3c('0x12')](_0x2b3c('0x13'),_0x535546,_0x2b3c('0x14'));logger[_0x2b3c('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x535546,_0x2b3c('0x14'),JSON['stringify'](_0x14c977));if(_0x14c977[_0x2b3c('0x16')]){if(_0x14c977[_0x2b3c('0x16')]['code']===0x1f4){logger[_0x2b3c('0x16')](_0x2b3c('0x13'),_0x535546,_0x14c977[_0x2b3c('0x16')]['message']);return _0x32209a(_0x14c977[_0x2b3c('0x16')][_0x2b3c('0x17')]);}logger[_0x2b3c('0x16')](_0x2b3c('0x13'),_0x535546,_0x14c977['error'][_0x2b3c('0x17')]);return _0x1a8e9d(_0x14c977[_0x2b3c('0x16')][_0x2b3c('0x17')]);}else{logger[_0x2b3c('0x12')](_0x2b3c('0x13'),_0x535546,_0x2b3c('0x14'));_0x1a8e9d(_0x14c977[_0x2b3c('0x18')][_0x2b3c('0x17')]);}})[_0x2b3c('0x19')](function(_0x285f7c){logger['error'](_0x2b3c('0x13'),_0x535546,_0x285f7c);_0x32209a(_0x285f7c);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index a3b7b0a..93dfbb8 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 _0x4177=['remove','update','emit','length','chatGroup:','./chatGroup.events','save'];(function(_0x177e34,_0x4d0a79){var _0x3776fc=function(_0x314261){while(--_0x314261){_0x177e34['push'](_0x177e34['shift']());}};_0x3776fc(++_0x4d0a79);}(_0x4177,0x15c));var _0x7417=function(_0x401505,_0x54c9d8){_0x401505=_0x401505-0x0;var _0x23f363=_0x4177[_0x401505];return _0x23f363;};'use strict';var ChatGroupEvents=require(_0x7417('0x0'));var events=[_0x7417('0x1'),_0x7417('0x2'),_0x7417('0x3')];function createListener(_0x2b4bac,_0x451677){return function(_0x3be39c){_0x451677[_0x7417('0x4')](_0x2b4bac,_0x3be39c);};}function removeListener(_0x1ec35e,_0x46ba76){return function(){ChatGroupEvents['removeListener'](_0x1ec35e,_0x46ba76);};}exports['register']=function(_0xdfcdc2){for(var _0x36f435=0x0,_0x1de982=events[_0x7417('0x5')];_0x36f435<_0x1de982;_0x36f435++){var _0x4e0ccc=events[_0x36f435];var _0x3a7205=createListener(_0x7417('0x6')+_0x4e0ccc,_0xdfcdc2);ChatGroupEvents['on'](_0x4e0ccc,_0x3a7205);}};
\ No newline at end of file
+var _0x77cc=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x77cc,0x15a));var _0xc77c=function(_0x191917,_0x552ff4){_0x191917=_0x191917-0x0;var _0x52a7ec=_0x77cc[_0x191917];return _0x52a7ec;};'use strict';var ChatGroupEvents=require(_0xc77c('0x0'));var events=[_0xc77c('0x1'),_0xc77c('0x2'),_0xc77c('0x3')];function createListener(_0x5ca990,_0x59ef97){return function(_0x474f9d){_0x59ef97[_0xc77c('0x4')](_0x5ca990,_0x474f9d);};}function removeListener(_0x3992d7,_0x2afb3c){return function(){ChatGroupEvents[_0xc77c('0x5')](_0x3992d7,_0x2afb3c);};}exports[_0xc77c('0x6')]=function(_0x2232f8){for(var _0x54bec2=0x0,_0x16ddb2=events[_0xc77c('0x7')];_0x54bec2<_0x16ddb2;_0x54bec2++){var _0x1f114d=events[_0x54bec2];var _0x4ed399=createListener(_0xc77c('0x8')+_0x1f114d,_0x2232f8);ChatGroupEvents['on'](_0x1f114d,_0x4ed399);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 243b68e..6bbc09d 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 _0x0ed0=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','post','/:id/members','addMembers','/:id/messages','addMessage','put','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x1b6807,_0x3ef980){var _0x281d96=function(_0x4fe4f4){while(--_0x4fe4f4){_0x1b6807['push'](_0x1b6807['shift']());}};_0x281d96(++_0x3ef980);}(_0x0ed0,0x19c));var _0x00ed=function(_0x4efcf3,_0x3ccdbd){_0x4efcf3=_0x4efcf3-0x0;var _0x51b972=_0x0ed0[_0x4efcf3];return _0x51b972;};'use strict';var multer=require(_0x00ed('0x0'));var util=require('util');var path=require(_0x00ed('0x1'));var timeout=require(_0x00ed('0x2'));var express=require('express');var router=express[_0x00ed('0x3')]();var fs_extra=require(_0x00ed('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x00ed('0x5'));var config=require(_0x00ed('0x6'));var controller=require(_0x00ed('0x7'));router[_0x00ed('0x8')]('/',auth[_0x00ed('0x9')](),controller[_0x00ed('0xa')]);router[_0x00ed('0x8')](_0x00ed('0xb'),auth['isAuthenticated'](),controller[_0x00ed('0xc')]);router[_0x00ed('0x8')](_0x00ed('0xd'),auth[_0x00ed('0x9')](),controller[_0x00ed('0xe')]);router[_0x00ed('0x8')](_0x00ed('0xf'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x10')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x00ed('0x11')]);router['get']('/:id/messages',auth[_0x00ed('0x9')](),controller[_0x00ed('0x12')]);router[_0x00ed('0x13')]('/',auth[_0x00ed('0x9')](),controller['create']);router['post'](_0x00ed('0x14'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x15')]);router[_0x00ed('0x13')](_0x00ed('0x16'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x17')]);router[_0x00ed('0x18')](_0x00ed('0xd'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x19')]);router[_0x00ed('0x1a')]('/:id',auth[_0x00ed('0x9')](),controller[_0x00ed('0x1b')]);router[_0x00ed('0x1a')](_0x00ed('0x14'),auth[_0x00ed('0x9')](),controller[_0x00ed('0x1c')]);module[_0x00ed('0x1d')]=router;
\ No newline at end of file
+var _0xcaa3=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','describe','/:id','show','get','/:id/unread','getUnread','getMembers','/:id/messages','post','create','/:id/members','addMembers','addMessage','update','delete','removeMembers'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0xcaa3,0x1a5));var _0x3caa=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0xcaa3[_0x8abd64];return _0xd2511e;};'use strict';var multer=require(_0x3caa('0x0'));var util=require(_0x3caa('0x1'));var path=require(_0x3caa('0x2'));var timeout=require(_0x3caa('0x3'));var express=require('express');var router=express[_0x3caa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3caa('0x5'));var interaction=require(_0x3caa('0x6'));var config=require(_0x3caa('0x7'));var controller=require(_0x3caa('0x8'));router['get']('/',auth[_0x3caa('0x9')](),controller[_0x3caa('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3caa('0xb')]);router['get'](_0x3caa('0xc'),auth[_0x3caa('0x9')](),controller[_0x3caa('0xd')]);router[_0x3caa('0xe')](_0x3caa('0xf'),auth[_0x3caa('0x9')](),controller[_0x3caa('0x10')]);router[_0x3caa('0xe')]('/:id/members',auth[_0x3caa('0x9')](),controller[_0x3caa('0x11')]);router[_0x3caa('0xe')](_0x3caa('0x12'),auth[_0x3caa('0x9')](),controller['getMessages']);router[_0x3caa('0x13')]('/',auth[_0x3caa('0x9')](),controller[_0x3caa('0x14')]);router[_0x3caa('0x13')](_0x3caa('0x15'),auth[_0x3caa('0x9')](),controller[_0x3caa('0x16')]);router[_0x3caa('0x13')]('/:id/messages',auth[_0x3caa('0x9')](),controller[_0x3caa('0x17')]);router['put'](_0x3caa('0xc'),auth[_0x3caa('0x9')](),controller[_0x3caa('0x18')]);router['delete'](_0x3caa('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x3caa('0x19')](_0x3caa('0x15'),auth[_0x3caa('0x9')](),controller[_0x3caa('0x1a')]);module[_0x3caa('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 120efb0..9513fc4 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 _0x7848=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x7848,0x194));var _0x8784=function(_0x2f3b14,_0x554f94){_0x2f3b14=_0x2f3b14-0x0;var _0x20e924=_0x7848[_0x2f3b14];return _0x20e924;};'use strict';var Sequelize=require(_0x8784('0x0'));module[_0x8784('0x1')]={'closed':{'type':Sequelize[_0x8784('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8784('0x3')]},'ratingType':{'type':Sequelize[_0x8784('0x4')](_0x8784('0x5'),_0x8784('0x6')),'defaultValue':_0x8784('0x5')},'ratingMessage':{'type':Sequelize[_0x8784('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x8784('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8784('0x9')]},'disposition':{'type':Sequelize[_0x8784('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8784('0x8')]},'browserName':{'type':Sequelize[_0x8784('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8784('0x8')]},'osVersion':{'type':Sequelize[_0x8784('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x8784('0x8')]},'deviceType':{'type':Sequelize[_0x8784('0x8')]},'referer':{'type':Sequelize[_0x8784('0x7')]},'customerIp':{'type':Sequelize[_0x8784('0x8')]},'formData':{'type':Sequelize[_0x8784('0x7')](_0x8784('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x8784('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x8784('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8784('0x8')]},'customerPort':{'type':Sequelize[_0x8784('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x8784('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8784('0x3')]}};
\ No newline at end of file
+var _0xbcbe=['thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','star'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xbcbe,0xcc));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xebcb('0x0'));module[_0xebcb('0x1')]={'closed':{'type':Sequelize[_0xebcb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xebcb('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xebcb('0x4'),_0xebcb('0x5')),'defaultValue':_0xebcb('0x4')},'ratingMessage':{'type':Sequelize[_0xebcb('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xebcb('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xebcb('0x8')]},'disposition':{'type':Sequelize[_0xebcb('0x7')]},'secondDisposition':{'type':Sequelize[_0xebcb('0x7')]},'thirdDisposition':{'type':Sequelize[_0xebcb('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xebcb('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xebcb('0x7')]},'osVersion':{'type':Sequelize[_0xebcb('0x7')]},'deviceModel':{'type':Sequelize[_0xebcb('0x7')]},'deviceVendor':{'type':Sequelize[_0xebcb('0x7')]},'deviceType':{'type':Sequelize[_0xebcb('0x7')]},'referer':{'type':Sequelize[_0xebcb('0x6')]},'customerIp':{'type':Sequelize[_0xebcb('0x7')]},'formData':{'type':Sequelize[_0xebcb('0x6')](_0xebcb('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xebcb('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xebcb('0x7')]},'customerPort':{'type':Sequelize[_0xebcb('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xebcb('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xebcb('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xebcb('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index d8f1f6e..9147f62 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 _0x5d4a=['pick','where','ChatInteractionId','filter','$gte','split','getMyMessages','nolimit','order','include','includeAgent','push','rows','addTags','setTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','toString','server','transcript-%d-%s.zip','firstName','lastName','attachments','read','Owner','get','mkdirSync','Chat','Account','N.A.','createdAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','offset','undefined','limit','count','set','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','query','user','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options','find','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','originalname','basename','file','mimetype','attachmentDownload','json','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','pathTranscript','Messages','User','ChatWebsite','ChatWebsiteId','UserId','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','Mail\x20Transcript','addMessage','ids','getMessages','hasOwnProperty','sort'];(function(_0x11bafd,_0x4d1ee2){var _0x26bb16=function(_0x51f72f){while(--_0x51f72f){_0x11bafd['push'](_0x11bafd['shift']());}};_0x26bb16(++_0x4d1ee2);}(_0x5d4a,0x1d4));var _0xa5d4=function(_0x4186a5,_0x1ecfe0){_0x4186a5=_0x4186a5-0x0;var _0x486c4b=_0x5d4a[_0x4186a5];return _0x486c4b;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xa5d4('0x0'));var rp=require('request-promise');var moment=require(_0xa5d4('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xa5d4('0x2'));var util=require(_0xa5d4('0x3'));var path=require(_0xa5d4('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa5d4('0x5'));var Redis=require(_0xa5d4('0x6'));var interaction=require(_0xa5d4('0x7'));var qs=require(_0xa5d4('0x8'));var pdf=require(_0xa5d4('0x9'));var logger=require(_0xa5d4('0xa'))('api');var config=require(_0xa5d4('0xb'));var db=require('../../mysqldb')['db'];config[_0xa5d4('0xc')]=_['defaults'](config[_0xa5d4('0xc')],{'host':_0xa5d4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa5d4('0xc')]));require(_0xa5d4('0xe'))[_0xa5d4('0xf')](socket);var jayson=require(_0xa5d4('0x10'));var client=jayson[_0xa5d4('0x11')][_0xa5d4('0x12')]({'port':0x232b});var client9004=jayson[_0xa5d4('0x11')][_0xa5d4('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x2b64a1,_0x4ea4ae,_0xb84d41,_0x5ae411){return new BPromise(function(_0x525464,_0x21ac88){var _0x15e575=_0x5ae411||client;return _0x15e575['request'](_0x2b64a1,_0xb84d41)[_0xa5d4('0x13')](function(_0x46706a){logger[_0xa5d4('0x14')](_0xa5d4('0x15'),_0x4ea4ae,_0xa5d4('0x16'));logger[_0xa5d4('0x17')](_0xa5d4('0x18'),_0x4ea4ae,_0xa5d4('0x16'),JSON[_0xa5d4('0x19')](_0x46706a));if(_0x46706a[_0xa5d4('0x1a')]){if(_0x46706a['error'][_0xa5d4('0x1b')]===0x1f4){logger[_0xa5d4('0x1a')](_0xa5d4('0x15'),_0x4ea4ae,_0x46706a['error']['message']);return _0x21ac88(_0x46706a['error'][_0xa5d4('0x1c')]);}logger[_0xa5d4('0x1a')](_0xa5d4('0x15'),_0x4ea4ae,_0x46706a['error'][_0xa5d4('0x1c')]);return _0x525464(_0x46706a['error'][_0xa5d4('0x1c')]);}else{logger[_0xa5d4('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x4ea4ae,_0xa5d4('0x16'));_0x525464(_0x46706a[_0xa5d4('0x1d')]['message']);}})[_0xa5d4('0x1e')](function(_0x46b923){logger[_0xa5d4('0x1a')](_0xa5d4('0x15'),_0x4ea4ae,_0x46b923);_0x21ac88(_0x46b923);});});}function respondWithStatusCode(_0x3363d2,_0x3e1d9a){_0x3e1d9a=_0x3e1d9a||0xcc;return function(_0x37ccb1){if(_0x37ccb1){return _0x3363d2['sendStatus'](_0x3e1d9a);}return _0x3363d2['status'](_0x3e1d9a)[_0xa5d4('0x1f')]();};}function respondWithResult(_0x12cb4e,_0x22fd64){_0x22fd64=_0x22fd64||0xc8;return function(_0x29c372){if(_0x29c372){return _0x12cb4e[_0xa5d4('0x20')](_0x22fd64)['json'](_0x29c372);}};}function respondWithFilteredResult(_0x2971da,_0x129537){return function(_0x5b8a6a){if(_0x5b8a6a){var _0x33e8d7=typeof _0x129537[_0xa5d4('0x21')]===_0xa5d4('0x22')&&typeof _0x129537[_0xa5d4('0x23')]===_0xa5d4('0x22');var _0x44f672=_0x5b8a6a[_0xa5d4('0x24')];var _0x3e6a2a=_0x33e8d7?0x0:_0x129537[_0xa5d4('0x21')];var _0x192289=_0x33e8d7?_0x5b8a6a['count']:_0x129537['offset']+_0x129537[_0xa5d4('0x23')];var _0xae60f;if(_0x192289>=_0x44f672){_0x192289=_0x44f672;_0xae60f=0xc8;}else{_0xae60f=0xce;}_0x2971da[_0xa5d4('0x20')](_0xae60f);return _0x2971da[_0xa5d4('0x25')]('Content-Range',_0x3e6a2a+'-'+_0x192289+'/'+_0x44f672)['json'](_0x5b8a6a);}return null;};}function saveUpdates(_0x59eda2){return function(_0xbd240f){if(_0xbd240f){return _0xbd240f[_0xa5d4('0x26')](_0x59eda2)[_0xa5d4('0x13')](function(_0x1eff32){return _0x1eff32;});}return null;};}function removeEntity(_0x445095){return function(_0x7b2fff){if(_0x7b2fff){return _0x7b2fff[_0xa5d4('0x27')]()['then'](function(){_0x445095[_0xa5d4('0x20')](0xcc)[_0xa5d4('0x1f')]();});}};}function handleEntityNotFound(_0x15c939){return function(_0x2a2aac){if(!_0x2a2aac){_0x15c939['sendStatus'](0x194);}return _0x2a2aac;};}function handleError(_0x1f6d72,_0x21e2a4){_0x21e2a4=_0x21e2a4||0x1f4;return function(_0x3a1284){logger[_0xa5d4('0x1a')](_0x3a1284[_0xa5d4('0x28')]);if(_0x3a1284[_0xa5d4('0x29')]){delete _0x3a1284[_0xa5d4('0x29')];}_0x1f6d72[_0xa5d4('0x20')](_0x21e2a4)[_0xa5d4('0x2a')](_0x3a1284);};}function getMustacheRender(_0x7ce9b,_0x2d6410){return Mustache[_0xa5d4('0x2b')](_0x7ce9b,_[_0xa5d4('0x2c')](_0x2d6410[_0xa5d4('0x2d')],{'contact':_0x2d6410[_0xa5d4('0x2e')],'message':_0x2d6410['message'],'agent':_0x2d6410[_0xa5d4('0x2f')],'interaction':_0x2d6410[_0xa5d4('0x30')],'account':_0x2d6410['account']}))||'';}exports['index']=function(_0x3ac57a,_0x50a77e){var _0x59c936={};var _0x3ae411=_[_0xa5d4('0x31')](db[_0xa5d4('0x32')]['rawAttributes'],function(_0xf0615d){return{'name':_0xf0615d[_0xa5d4('0x33')],'type':_0xf0615d[_0xa5d4('0x34')][_0xa5d4('0x35')]};});_0x59c936=qs[_0xa5d4('0x36')](_0x3ae411,_0x3ac57a);return interaction[_0xa5d4('0x37')](_0xa5d4('0x38'),_0x3ac57a[_0xa5d4('0x39')],_0x3ac57a[_0xa5d4('0x3a')],_0x59c936,_0x3ae411)['then'](respondWithFilteredResult(_0x50a77e,_0x59c936))['catch'](handleError(_0x50a77e,null));};exports['show']=function(_0x2ee0ba,_0xb8c31c){var _0x234594={'raw':![],'where':{'id':_0x2ee0ba['params']['id']}},_0xb3a58e={};_0xb3a58e[_0xa5d4('0x3b')]=_[_0xa5d4('0x3c')](db['ChatInteraction'][_0xa5d4('0x3d')]);_0xb3a58e[_0xa5d4('0x39')]=_[_0xa5d4('0x3c')](_0x2ee0ba[_0xa5d4('0x39')]);_0xb3a58e[_0xa5d4('0x3e')]=_[_0xa5d4('0x3f')](_0xb3a58e[_0xa5d4('0x3b')],_0xb3a58e[_0xa5d4('0x39')]);_0x234594[_0xa5d4('0x40')]=_[_0xa5d4('0x3f')](_0xb3a58e[_0xa5d4('0x3b')],qs[_0xa5d4('0x41')](_0x2ee0ba[_0xa5d4('0x39')][_0xa5d4('0x41')]));_0x234594['attributes']=_0x234594[_0xa5d4('0x40')][_0xa5d4('0x42')]?_0x234594[_0xa5d4('0x40')]:_0xb3a58e[_0xa5d4('0x3b')];if(_0x2ee0ba[_0xa5d4('0x39')][_0xa5d4('0x43')]){_0x234594['include']=[{'all':!![]}];}_0x234594=_['merge']({},_0x234594,_0x2ee0ba[_0xa5d4('0x44')]);return db[_0xa5d4('0x32')][_0xa5d4('0x45')](_0x234594)[_0xa5d4('0x13')](handleEntityNotFound(_0xb8c31c,null))['then'](respondWithResult(_0xb8c31c,null))['catch'](handleError(_0xb8c31c,null));};exports['create']=function(_0xcd3f23,_0x121de5){return db[_0xa5d4('0x32')][_0xa5d4('0x46')](_0xcd3f23[_0xa5d4('0x2d')],{})['then'](respondWithResult(_0x121de5,0xc9))[_0xa5d4('0x1e')](handleError(_0x121de5,null));};exports[_0xa5d4('0x26')]=function(_0x204363,_0x4ff1b4){if(_0x204363[_0xa5d4('0x2d')]['id']){delete _0x204363[_0xa5d4('0x2d')]['id'];}return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x204363['params']['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x4ff1b4,null))[_0xa5d4('0x13')](saveUpdates(_0x204363[_0xa5d4('0x2d')],null))[_0xa5d4('0x13')](respondWithResult(_0x4ff1b4,null))[_0xa5d4('0x1e')](handleError(_0x4ff1b4,null));};exports[_0xa5d4('0x27')]=function(_0x5b2559,_0x2445b4){return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x5b2559[_0xa5d4('0x47')]['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x2445b4,null))[_0xa5d4('0x13')](removeEntity(_0x2445b4,null))[_0xa5d4('0x1e')](handleError(_0x2445b4,null));};exports['describe']=function(_0x59914b,_0x273b09){return db[_0xa5d4('0x32')][_0xa5d4('0x48')]()[_0xa5d4('0x13')](respondWithResult(_0x273b09,null))[_0xa5d4('0x1e')](handleError(_0x273b09,null));};exports[_0xa5d4('0x49')]=function(_0x5cb453,_0x5a6f56){var _0x25bef9=_0x5cb453[_0xa5d4('0x47')]['id'];var _0x3a7887;var _0x250874;var _0x1382e8;return db['ChatInteraction'][_0xa5d4('0x4a')]({'where':{'id':_0x25bef9}})[_0xa5d4('0x13')](function(_0x234fa5){_0x3a7887=_0x234fa5;return db['ChatWebsite'][_0xa5d4('0x4a')]({'where':{'id':_0x234fa5['ChatWebsiteId']},'attributes':['id',_0xa5d4('0x4b'),_0xa5d4('0x4c'),_0xa5d4('0x4d'),_0xa5d4('0x4e'),_0xa5d4('0x4f')],'raw':!![]});})[_0xa5d4('0x13')](function(_0x3acf03){if(_0x3acf03&&_0x3acf03[_0xa5d4('0x4b')]&&_0x3acf03['vidaooEscalation']){_0x250874=_0x3acf03;var _0x413ad4={'interaction':{'id':_0x25bef9},'agent':{'id':_0x5cb453[_0xa5d4('0x3a')]['id'],'name':_0x5cb453['user'][_0xa5d4('0x29')],'fullname':_0x5cb453['user']['fullname'],'email':_0x5cb453['user'][_0xa5d4('0x50')]},'contact':_0x5cb453[_0xa5d4('0x2d')][_0xa5d4('0x2e')],'account':_0x5cb453['body'][_0xa5d4('0x51')]};var _0x59f7c3={'rejectUnauthorized':![],'method':_0xa5d4('0x52'),'url':_0xa5d4('0x53'),'headers':{'X-APIKEY':_0x3acf03['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5cb453[_0xa5d4('0x3a')][_0xa5d4('0x50')]],'buttons':null,'topic':_0x250874['vidaooTopic'],'note':_[_0xa5d4('0x54')](_0x250874[_0xa5d4('0x4e')])?null:getMustacheRender(_0x250874[_0xa5d4('0x4e')],_0x413ad4),'metadata':null},'redirect':_0xa5d4('0x55'),'json':!![]};try{if(!_[_0xa5d4('0x54')](_0x250874[_0xa5d4('0x4f')])){var _0x58f5f3=getMustacheRender(_0x250874[_0xa5d4('0x4f')],_0x413ad4);var _0x21b268=JSON[_0xa5d4('0x56')](_0x58f5f3);_0x59f7c3['body'][_0xa5d4('0x57')]=_0x21b268;}}catch(_0x4eabfd){throw new db['Sequelize']['ValidationError'](_0xa5d4('0x58'));}return rp(_0x59f7c3);}else{throw new db[(_0xa5d4('0x59'))][(_0xa5d4('0x5a'))](_0xa5d4('0x5b'));}})[_0xa5d4('0x13')](function(_0x212312){_0x1382e8=_0x212312;if(_0x1382e8['id']){var _0x376192={'body':_0x1382e8[_0xa5d4('0x5c')],'ChatWebsiteId':_0x250874['id'],'ChatInteractionId':_0x3a7887['id'],'direction':_0xa5d4('0x5d'),'UserId':_0x5cb453[_0xa5d4('0x3a')]['id']};return db[_0xa5d4('0x5e')]['create'](_0x376192,{});}else{throw new db[(_0xa5d4('0x59'))][(_0xa5d4('0x5a'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa5d4('0x13')](function(){return _0x3a7887['updateAttributes']({'vidaooSessionId':_0x1382e8['id']});})[_0xa5d4('0x13')](respondWithResult(_0x5a6f56,null))['catch'](handleError(_0x5a6f56,null));};exports['customUpdate']=function(_0x8495ad,_0x5adc8b){if(_0x8495ad['body']['id']){delete _0x8495ad[_0xa5d4('0x2d')]['id'];}return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x8495ad[_0xa5d4('0x47')]['id']},'include':[{'model':db[_0xa5d4('0x5f')],'as':_0xa5d4('0x60')}]})[_0xa5d4('0x13')](handleEntityNotFound(_0x5adc8b,null))[_0xa5d4('0x13')](saveUpdates(_0x8495ad['body'],null))[_0xa5d4('0x13')](respondWithResult(_0x5adc8b,null))[_0xa5d4('0x1e')](handleError(_0x5adc8b,null));};exports['abandon']=function(_0x4376ac,_0x4c8c52){if(_0x4376ac['body']['id']){delete _0x4376ac['body']['id'];}return db['ChatInteraction'][_0xa5d4('0x45')]({'where':{'id':_0x4376ac[_0xa5d4('0x47')]['id']}})[_0xa5d4('0x13')](function(_0x10df4a){if(!_0x10df4a){logger[_0xa5d4('0x1a')](_0xa5d4('0x61'),'abandon',0x194,_0xa5d4('0x62'));_0x4c8c52['sendStatus'](0x194);}else{if(_0x10df4a['UserId']){throw new db['Sequelize'][(_0xa5d4('0x5a'))](_0xa5d4('0x63'));}}return _0x10df4a;})[_0xa5d4('0x13')](function(_0x1dc53c){if(_0x1dc53c){return _0x1dc53c[_0xa5d4('0x26')]({'closed':_0x4376ac['body'][_0xa5d4('0x64')],'disposition':_0x4376ac[_0xa5d4('0x2d')][_0xa5d4('0x65')]})[_0xa5d4('0x13')](function(_0x2659d1){return _0x2659d1;});}})[_0xa5d4('0x13')](function(){return respondWithRpcPromise(_0xa5d4('0x66'),_0xa5d4('0x67'),_0x4376ac['body'],client9004);})[_0xa5d4('0x13')](respondWithResult(_0x4c8c52,null))[_0xa5d4('0x1e')](handleError(_0x4c8c52,null));};exports['attachmentUpload']=function(_0x143053,_0x13ef42){_0x143053[_0xa5d4('0x2d')][_0xa5d4('0x29')]=_0x143053['file'][_0xa5d4('0x68')];_0x143053[_0xa5d4('0x2d')][_0xa5d4('0x69')]=_0x143053[_0xa5d4('0x6a')]['filename'];_0x143053[_0xa5d4('0x2d')][_0xa5d4('0x34')]=_0x143053[_0xa5d4('0x6a')][_0xa5d4('0x6b')];return db['Attachment'][_0xa5d4('0x46')](_0x143053['body'])['then'](respondWithResult(_0x13ef42,0xc9))[_0xa5d4('0x1e')](handleError(_0x13ef42,null));};exports[_0xa5d4('0x6c')]=function(_0x37fac7,_0xa829a0){return db[_0xa5d4('0x32')]['findOne']({'where':{'id':_0x37fac7[_0xa5d4('0x47')]['id']},'raw':!![]})[_0xa5d4('0x13')](handleEntityNotFound(_0xa829a0,null))[_0xa5d4('0x13')](function(_0x52f8d7){if(_0x52f8d7){if(_0x52f8d7[_0xa5d4('0x64')]){return _0xa829a0[_0xa5d4('0x20')](0x193)[_0xa5d4('0x6d')]({'status':0x193,'message':_0xa5d4('0x6e')});}return db[_0xa5d4('0x6f')]['findOne']({'where':{'id':_0x37fac7['query'][_0xa5d4('0x70')]},'raw':!![]})[_0xa5d4('0x13')](handleEntityNotFound(_0xa829a0,null));}})[_0xa5d4('0x13')](function(_0x4020ac){if(_0x4020ac){var _0x9a7a3a=_0x4020ac['ChatOfflineMessageId']!==null;var _0x47af3b=path[_0xa5d4('0x71')](config[_0xa5d4('0x72')],_0xa5d4('0x73'));if(_0x9a7a3a){_0x47af3b=path[_0xa5d4('0x71')](_0x47af3b,_0xa5d4('0x74'));}var _0x2caf3c=path[_0xa5d4('0x71')](_0x47af3b,_0x4020ac[_0xa5d4('0x69')]);return _0xa829a0['download'](_0x2caf3c);}})[_0xa5d4('0x1e')](handleError(_0xa829a0,null));};exports[_0xa5d4('0x75')]=function(_0x1b254c,_0x53939b){var _0x1eff58=null;var _0x5a035b=null;var _0x2ba207=null;if(_0x1b254c[_0xa5d4('0x2d')]['id']){delete _0x1b254c[_0xa5d4('0x2d')]['id'];}if(_0x1b254c[_0xa5d4('0x2d')][_0xa5d4('0x76')]){_0x2ba207=path[_0xa5d4('0x71')](config[_0xa5d4('0x72')],_0xa5d4('0x77'),util[_0xa5d4('0x78')]('transcript-%s.txt',Date['now']()));_0x1b254c[_0xa5d4('0x2d')][_0xa5d4('0x79')]=_0x2ba207;}return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x1b254c[_0xa5d4('0x47')]['id']},'include':[{'model':db[_0xa5d4('0x5e')],'as':_0xa5d4('0x7a'),'include':[{'model':db[_0xa5d4('0x7b')],'as':_0xa5d4('0x7b')}]}]})[_0xa5d4('0x13')](handleEntityNotFound(_0x53939b,null))[_0xa5d4('0x13')](saveUpdates(_0x1b254c['body'],null))[_0xa5d4('0x13')](function(_0x24ae3c){if(_0x24ae3c){_0x1eff58=_0x24ae3c;return db[_0xa5d4('0x7c')][_0xa5d4('0x45')]({'where':{'id':_0x1eff58[_0xa5d4('0x7d')]}});}})['then'](function(_0x17bd07){if(_0x17bd07){_0x5a035b=_0x17bd07;return db[_0xa5d4('0x5f')][_0xa5d4('0x45')]({'where':{'id':_0x1eff58['ContactId']}});}})[_0xa5d4('0x13')](function(_0x1ff82c){if(_0x1ff82c){if(_0x2ba207){var _0x133c53=null;for(var _0x33554d=0x1;_0x33554d<_0x1eff58[_0xa5d4('0x7a')][_0xa5d4('0x42')];++_0x33554d){_0x133c53=_0x1eff58[_0xa5d4('0x7a')][_0x33554d];var _0x44a6a2=_0x133c53[_0xa5d4('0x7e')]?util[_0xa5d4('0x78')](_0xa5d4('0x7f'),_0x5a035b[_0xa5d4('0x80')],_0x133c53[_0xa5d4('0x7e')]):_0xa5d4('0x81');var _0x38c52a=_0x1b254c['body'][_0xa5d4('0x82')]||util[_0xa5d4('0x78')]('%s%d','Visitor',_0x133c53['ContactId']);switch(_0x5a035b['agentIdentifier']){case _0xa5d4('0x83'):_0x44a6a2=_0x133c53[_0xa5d4('0x7e')]?util['format'](_0xa5d4('0x7f'),_0x5a035b['agentAlias'],_0x133c53[_0xa5d4('0x7e')]):'System';break;case _0xa5d4('0x84'):_0x44a6a2=_0x133c53['UserId']?_0x133c53[_0xa5d4('0x7b')][_0xa5d4('0x85')]||_0x133c53[_0xa5d4('0x7b')][_0xa5d4('0x86')]:'System';break;case _0xa5d4('0x87'):_0x44a6a2=_0x133c53[_0xa5d4('0x7e')]?_0x133c53['User'][_0xa5d4('0x86')]:_0xa5d4('0x81');break;default:_0x44a6a2=_0x133c53[_0xa5d4('0x7e')]?util[_0xa5d4('0x78')](_0xa5d4('0x7f'),_0x5a035b['agentAlias'],_0x133c53[_0xa5d4('0x7e')]):'System';}var _0x4c830b=util[_0xa5d4('0x78')](_0xa5d4('0x88'),moment(_0x133c53['createdAt'])[_0xa5d4('0x78')](_0xa5d4('0x89')),_0x133c53[_0xa5d4('0x8a')]==='in'?_0x38c52a:_0x44a6a2,_0x133c53[_0xa5d4('0x2d')]);if(!_0x133c53[_0xa5d4('0x8b')]){fs[_0xa5d4('0x8c')](_0x2ba207,_0x4c830b);}}return db[_0xa5d4('0x8d')][_0xa5d4('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xa5d4('0x8e')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa5d4('0x8f')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xa5d4('0x13')](function(_0x2ab66e){if(!_0x2ab66e||!_0x2ab66e[_0xa5d4('0x90')]||!_0x1b254c[_0xa5d4('0x2d')])return _0x1eff58;var _0x1faed8=_0x2ab66e[_0xa5d4('0x91')]();return respondWithRpcPromise(_0xa5d4('0x92'),'sendMail',{'account':_0x1faed8,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2ab66e[_0xa5d4('0x29')],_0x2ab66e[_0xa5d4('0x50')]||_0x2ab66e[_0xa5d4('0x90')]['user']),'to':_0x1b254c['body'][_0xa5d4('0x76')],'subject':_0xa5d4('0x93'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1b254c[_0xa5d4('0x2d')]['mailTranscript']),'attachments':[{'path':_0x2ba207}]}})[_0xa5d4('0x13')](function(){return _0x1eff58;})[_0xa5d4('0x1e')](function(_0x1d3c42){logger[_0xa5d4('0x1a')](_0x1d3c42);});})[_0xa5d4('0x13')](respondWithStatusCode(_0x53939b,0xc8))[_0xa5d4('0x1e')](handleError(_0x53939b,null));};exports['addMessage']=function(_0x96fe07,_0x5c4ee2){return db[_0xa5d4('0x5e')][_0xa5d4('0x45')]({'where':{'id':_0x96fe07[_0xa5d4('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c4ee2,null))[_0xa5d4('0x13')](function(_0x5e3b78){if(_0x5e3b78){return _0x5e3b78[_0xa5d4('0x94')](_0x96fe07[_0xa5d4('0x2d')][_0xa5d4('0x95')],_['omit'](_0x96fe07[_0xa5d4('0x2d')],[_0xa5d4('0x95'),'id'])||{});}})[_0xa5d4('0x13')](respondWithResult(_0x5c4ee2,null))[_0xa5d4('0x1e')](handleError(_0x5c4ee2,null));};exports[_0xa5d4('0x96')]=function(_0x47f6ed,_0x4ebe22){var _0x5020d9={'raw':![],'where':{}};var _0x15c1d5={};var _0x14e2f1={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa5d4('0x4a')]({'where':{'id':_0x47f6ed[_0xa5d4('0x47')]['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x4ebe22,null))[_0xa5d4('0x13')](function(_0x4c9394){if(_0x4c9394){_0x15c1d5['model']=_[_0xa5d4('0x3c')](db[_0xa5d4('0x5e')][_0xa5d4('0x3d')]);_0x15c1d5[_0xa5d4('0x39')]=_[_0xa5d4('0x3c')](_0x47f6ed[_0xa5d4('0x39')]);_0x15c1d5[_0xa5d4('0x3e')]=_[_0xa5d4('0x3f')](_0x15c1d5[_0xa5d4('0x3b')],_0x15c1d5[_0xa5d4('0x39')]);_0x5020d9['attributes']=_[_0xa5d4('0x3f')](_0x15c1d5[_0xa5d4('0x3b')],qs[_0xa5d4('0x41')](_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x41')]));_0x5020d9[_0xa5d4('0x40')]=_0x5020d9[_0xa5d4('0x40')][_0xa5d4('0x42')]?_0x5020d9[_0xa5d4('0x40')]:_0x15c1d5[_0xa5d4('0x3b')];if(!_0x47f6ed['query'][_0xa5d4('0x97')]('nolimit')){_0x5020d9[_0xa5d4('0x23')]=qs['limit'](_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x23')]);_0x5020d9[_0xa5d4('0x21')]=qs['offset'](_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x21')]);}_0x5020d9['order']=qs[_0xa5d4('0x98')](_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x98')]);_0x5020d9['where']=qs[_0xa5d4('0x3e')](_[_0xa5d4('0x99')](_0x47f6ed[_0xa5d4('0x39')],_0x15c1d5[_0xa5d4('0x3e')]));_0x5020d9[_0xa5d4('0x9a')][_0xa5d4('0x9b')]=_0x4c9394['id'];if(_0x47f6ed[_0xa5d4('0x39')]['filter']){_0x5020d9[_0xa5d4('0x9a')]=_[_0xa5d4('0x2c')](_0x5020d9['where'],{'$or':_[_0xa5d4('0x31')](_0x5020d9['attributes'],function(_0x19e4ac){var _0x485b45={};_0x485b45[_0x19e4ac]={'$like':'%'+_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x9c')]+'%'};return _0x485b45;})});}if(_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x9d')]){var _0x5f0bd5=_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x9d')][_0xa5d4('0x9e')](',');var _0x2b3429={};_0x2b3429[_0x5f0bd5[0x0]]={'$gte':moment(_0x5f0bd5[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5020d9['where']=_[_0xa5d4('0x2c')](_0x5020d9[_0xa5d4('0x9a')],_0x2b3429);}_0x5020d9=_[_0xa5d4('0x2c')]({},_0x5020d9,_0x47f6ed[_0xa5d4('0x44')]);return db['ChatMessage'][_0xa5d4('0x24')]({'where':_0x5020d9['where']})[_0xa5d4('0x13')](function(_0x3f8f13){_0x14e2f1[_0xa5d4('0x24')]=_0x3f8f13;if(_0x47f6ed[_0xa5d4('0x39')][_0xa5d4('0x43')]){_0x5020d9['include']=[{'all':!![]}];}return db[_0xa5d4('0x5e')][_0xa5d4('0x37')](_0x5020d9);})[_0xa5d4('0x13')](function(_0x4df3ee){_0x14e2f1['rows']=_0x4df3ee;return _0x14e2f1;});}})[_0xa5d4('0x13')](respondWithFilteredResult(_0x4ebe22,_0x5020d9))[_0xa5d4('0x1e')](handleError(_0x4ebe22,null));};exports[_0xa5d4('0x9f')]=function(_0x2ef3e0,_0x33f5c2){var _0x3e1694={'where':{}},_0x58228c={},_0x5bb5c0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa5d4('0x4a')]({'where':{'id':_0x2ef3e0[_0xa5d4('0x47')]['id']}})['then'](handleEntityNotFound(_0x33f5c2,null))['then'](function(_0x27f043){if(_0x27f043){_0x58228c['model']=_['keys'](db[_0xa5d4('0x5e')][_0xa5d4('0x3d')]);_0x58228c[_0xa5d4('0x39')]=_[_0xa5d4('0x3c')](_0x2ef3e0['query']);_0x58228c['filters']=_[_0xa5d4('0x3f')](_0x58228c[_0xa5d4('0x3b')],_0x58228c['query']);_0x3e1694[_0xa5d4('0x40')]=_[_0xa5d4('0x3f')](_0x58228c[_0xa5d4('0x3b')],qs[_0xa5d4('0x41')](_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x41')]));_0x3e1694[_0xa5d4('0x40')]=_0x3e1694[_0xa5d4('0x40')][_0xa5d4('0x42')]?_0x3e1694[_0xa5d4('0x40')]:_0x58228c['model'];if(!_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x97')](_0xa5d4('0xa0'))){_0x3e1694[_0xa5d4('0x23')]=qs[_0xa5d4('0x23')](_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x23')]);_0x3e1694[_0xa5d4('0x21')]=qs['offset'](_0x2ef3e0['query'][_0xa5d4('0x21')]);}_0x3e1694[_0xa5d4('0xa1')]=qs[_0xa5d4('0x98')](_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x98')]);_0x3e1694[_0xa5d4('0x9a')]=qs[_0xa5d4('0x3e')](_['pick'](_0x2ef3e0[_0xa5d4('0x39')],_0x58228c['filters']));_0x3e1694[_0xa5d4('0x9a')][_0xa5d4('0x9b')]=_0x27f043['id'];if(_0x2ef3e0[_0xa5d4('0x39')]['filter']){_0x3e1694[_0xa5d4('0x9a')]=_[_0xa5d4('0x2c')](_0x3e1694[_0xa5d4('0x9a')],{'$or':_[_0xa5d4('0x31')](_0x3e1694[_0xa5d4('0x40')],function(_0xc9b0b2){var _0x177609={};_0x177609[_0xc9b0b2]={'$like':'%'+_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0x9c')]+'%'};return _0x177609;})});}_0x3e1694[_0xa5d4('0x9a')][_0xa5d4('0x8b')]=![];if(_0x2ef3e0[_0xa5d4('0x39')]['id']){_0x3e1694[_0xa5d4('0x9a')]['id']={'$gt':_0x2ef3e0['query']['id']};}_0x3e1694=_[_0xa5d4('0x2c')]({},_0x3e1694,_0x2ef3e0['options']);return db[_0xa5d4('0x5e')]['count']({'where':_0x3e1694['where']})[_0xa5d4('0x13')](function(_0x2bfbb6){_0x5bb5c0[_0xa5d4('0x24')]=_0x2bfbb6;_0x3e1694[_0xa5d4('0xa2')]=[];if(_0x2ef3e0[_0xa5d4('0x39')][_0xa5d4('0xa3')]){_0x3e1694[_0xa5d4('0xa2')][_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x7b')],'as':'User','attributes':['id',_0xa5d4('0x86'),_0xa5d4('0x85')]});}if(_0x2ef3e0['query']['includeAll']){_0x3e1694[_0xa5d4('0xa2')]=[{'all':!![]}];}return db[_0xa5d4('0x5e')]['findAll'](_0x3e1694);})['then'](function(_0x24ae18){_0x5bb5c0[_0xa5d4('0xa5')]=_0x24ae18;return _0x5bb5c0;});}})['then'](respondWithFilteredResult(_0x33f5c2,_0x3e1694))[_0xa5d4('0x1e')](handleError(_0x33f5c2,null));};exports[_0xa5d4('0xa6')]=function(_0x1e1938,_0x3633c2){return db[_0xa5d4('0x32')]['find']({'where':{'id':_0x1e1938[_0xa5d4('0x47')]['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x3633c2,null))['then'](function(_0x5f4f53){if(_0x5f4f53){return _0x5f4f53[_0xa5d4('0xa7')](_0x1e1938[_0xa5d4('0x2d')][_0xa5d4('0x95')],_[_0xa5d4('0xa8')](_0x1e1938[_0xa5d4('0x2d')],[_0xa5d4('0x95'),'id'])||{})[_0xa5d4('0xa9')](function(){return db['Tag'][_0xa5d4('0x37')]({'attributes':['id','name',_0xa5d4('0xaa')],'where':{'id':_0x1e1938[_0xa5d4('0x2d')][_0xa5d4('0x95')]}});})[_0xa5d4('0x13')](function(_0x1810c8){socket[_0xa5d4('0xab')](_0xa5d4('0xac'),{'id':Number(_0x1e1938['params']['id']),'tags':_0x1810c8||[]});return{'id':Number(_0x1e1938[_0xa5d4('0x47')]['id']),'tags':_0x1810c8||[]};});}})[_0xa5d4('0x13')](respondWithResult(_0x3633c2,null))['catch'](handleError(_0x3633c2,null));};exports['removeTags']=function(_0x3c7c6c,_0x572f42){return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x3c7c6c['params']['id']}})[_0xa5d4('0x13')](handleEntityNotFound(_0x572f42,null))['then'](function(_0xc566de){if(_0xc566de){return _0xc566de[_0xa5d4('0xad')](_0x3c7c6c[_0xa5d4('0x39')][_0xa5d4('0x95')]);}})[_0xa5d4('0x13')](respondWithStatusCode(_0x572f42,null))[_0xa5d4('0x1e')](handleError(_0x572f42,null));};exports['download']=function(_0x44d258,_0x57dec2){var _0x59a0db=moment()['unix']()[_0xa5d4('0xae')]();var _0x4eeea6=path[_0xa5d4('0x71')](config['root'],_0xa5d4('0xaf'),'files','tmp');var _0x1fde04=path[_0xa5d4('0x71')](config[_0xa5d4('0x72')],_0xa5d4('0xaf'),'files','attachments');var _0x3d4adb=path[_0xa5d4('0x71')](_0x4eeea6,_0x59a0db);var _0x2941fe=util[_0xa5d4('0x78')](_0xa5d4('0xb0'),_0x44d258['params']['id'],_0x59a0db);var _0x49ca3e=path[_0xa5d4('0x71')](_0x4eeea6,_0x2941fe);var _0x45483a=[];_0x45483a[_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x7b')],'as':_0xa5d4('0x7b'),'attributes':['id',_0xa5d4('0x86')],'raw':!![]});_0x45483a['push']({'model':db[_0xa5d4('0x5f')],'as':_0xa5d4('0x60'),'attributes':['id',_0xa5d4('0xb1'),_0xa5d4('0xb2')],'raw':!![]});if(_0x44d258[_0xa5d4('0x39')][_0xa5d4('0xb3')]){_0x45483a[_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x6f')],'as':_0xa5d4('0x6f'),'raw':!![]});}var _0x8aea71=[{'model':db[_0xa5d4('0x5e')],'as':_0xa5d4('0x7a'),'attributes':['id',_0xa5d4('0x2d'),'createdAt','direction',_0xa5d4('0x8b'),_0xa5d4('0xb4')],'include':_0x45483a}];_0x8aea71[_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x7c')],'as':'Account','attributes':['id',_0xa5d4('0x29')]});_0x8aea71[_0xa5d4('0xa4')]({'model':db[_0xa5d4('0x7b')],'as':_0xa5d4('0xb5'),'attributes':['id',_0xa5d4('0x86')]});return db[_0xa5d4('0x32')][_0xa5d4('0x45')]({'where':{'id':_0x44d258['params']['id']},'include':_0x8aea71})[_0xa5d4('0x13')](handleEntityNotFound(_0x57dec2,null))[_0xa5d4('0x13')](function(_0x4ac5e5){if(_0x4ac5e5){var _0x409897=_0x4ac5e5[_0xa5d4('0xb6')]({'plain':!![]});fs[_0xa5d4('0xb7')](_0x3d4adb);var _0x3bd317={'channel':_0xa5d4('0xb8'),'account':_0x409897[_0xa5d4('0xb9')][_0xa5d4('0x29')],'agent':_0x409897[_0xa5d4('0xb5')]?_0x409897[_0xa5d4('0xb5')][_0xa5d4('0x86')]:_0xa5d4('0xba'),'createdAt':moment(_0x409897[_0xa5d4('0xbb')])[_0xa5d4('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa5d4('0xae')](),'closedAt':_0x409897[_0xa5d4('0x64')]?moment(_0x409897['closedAt'])[_0xa5d4('0x78')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x409897[_0xa5d4('0x65')],'chatInfo':{'browser':_0x409897[_0xa5d4('0xbc')],'os':_0x409897[_0xa5d4('0xbd')],'referer':_0x409897[_0xa5d4('0xbe')],'customerIp':_0x409897[_0xa5d4('0xbf')],'customerPort':_0x409897['customerPort']?_0x409897[_0xa5d4('0xc0')]:'N.A.'},'messages':_(_0x409897[_0xa5d4('0x7a')])[_0xa5d4('0xc1')]()[_0xa5d4('0x9c')]({'secret':![]})['map'](function(_0x6b2d6a){if(_0x6b2d6a[_0xa5d4('0x6f')]){var _0xec798a=path[_0xa5d4('0x71')](_0x1fde04,_0x6b2d6a[_0xa5d4('0x6f')][_0xa5d4('0x69')]);if(fs[_0xa5d4('0xc2')](_0xec798a)){fs[_0xa5d4('0xc3')](_0xec798a)[_0xa5d4('0xc4')](fs[_0xa5d4('0xc5')](path[_0xa5d4('0x71')](_0x3d4adb,_0x6b2d6a['Attachment']['basename'])));}}return{'date':moment(_0x6b2d6a[_0xa5d4('0xbb')])['format'](_0xa5d4('0xc6'))[_0xa5d4('0xae')](),'sender':_0x6b2d6a[_0xa5d4('0x8a')]==='out'?_0x6b2d6a[_0xa5d4('0x7b')]?_0x6b2d6a[_0xa5d4('0x7b')][_0xa5d4('0x86')]:_0xa5d4('0x81'):_0x6b2d6a[_0xa5d4('0x60')]['firstName']+(_0x6b2d6a[_0xa5d4('0x60')]['lastName']?'\x20'+_0x6b2d6a[_0xa5d4('0x60')]['lastName']:''),'body':_0x6b2d6a[_0xa5d4('0x6f')]?_0x6b2d6a[_0xa5d4('0x6f')]['basename']:_0x6b2d6a[_0xa5d4('0x2d')],'direction':_0x6b2d6a[_0xa5d4('0x8a')]===_0xa5d4('0x5d')?'A':'C','secret':_0x6b2d6a['secret'],'read':_0x6b2d6a[_0xa5d4('0xb4')],'attachment':_0x6b2d6a[_0xa5d4('0x6f')]};})[_0xa5d4('0xc7')]()};return ejs[_0xa5d4('0xc8')](path[_0xa5d4('0x71')](config['root'],_0xa5d4('0xaf'),_0xa5d4('0xc9'),'downloadInteraction.ejs'),{'interaction':_0x3bd317})['then'](function(_0xc17f32){var _0x56f357=path[_0xa5d4('0x71')](_0x3d4adb,_0xa5d4('0xca')+_0x409897['id']+'-'+_0x59a0db+_0xa5d4('0xcb'));var _0x2714fa={'path':_0x56f357,'channel':_0xa5d4('0xb8'),'interactionId':_0x409897['id']};return pdf[_0xa5d4('0xcc')](_0xc17f32,_0x2714fa);})['then'](function(){return new Promise(function(_0x3d2c8d,_0x28e326){zipdir(_0x3d4adb,{'saveTo':_0x49ca3e},function(_0x182a1f,_0x34f1a6){if(_0x182a1f)return _0x28e326(_0x182a1f);return _0x3d2c8d(_0x34f1a6);});})[_0xa5d4('0x13')](function(){return new BPromise(function(_0x2bdfff,_0x478946){rimraf(_0x3d4adb,function(_0x42d808){if(_0x42d808)_0x478946(_0x42d808);return _0x2bdfff();});});})[_0xa5d4('0x13')](function(){return _0x57dec2['download'](_0x49ca3e,_0x2941fe,function(_0x5e808a){if(_0x5e808a){logger[_0xa5d4('0x1a')](_0xa5d4('0xcd'),_0x5e808a);}else{fs[_0xa5d4('0xce')](_0x49ca3e);}});});});}else{return _0x57dec2['sendStatus'](0xc8);}})[_0xa5d4('0x1e')](handleError(_0x57dec2,null));};
\ No newline at end of file
+var _0x52f2=['update','stack','name','send','render','merge','contact','agent','index','map','ChatInteraction','fieldName','type','key','chat','query','user','show','model','keys','rawAttributes','filters','intersection','attributes','fields','includeAll','include','options','find','create','body','params','destroy','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','join_url','ChatMessage','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','basename','download','close','mailTranscript','root','format','transcript-%s.txt','now','pathTranscript','User','Messages','length','agentAlias','System','customer','%s%d','ContactId','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','hasOwnProperty','includeAgent','push','alias','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','server','files','tmp','attachments','lastName','read','ChatWebsite','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','out','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','bluebird','mustache','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0xa3d443,_0x121b37){var _0x489486=function(_0x16ecd1){while(--_0x16ecd1){_0xa3d443['push'](_0xa3d443['shift']());}};_0x489486(++_0x121b37);}(_0x52f2,0x16b));var _0x252f=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x52f2[_0x9aada2];return _0x196dff;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x252f('0x0'));var rp=require('request-promise');var moment=require(_0x252f('0x1'));var BPromise=require(_0x252f('0x2'));var Mustache=require(_0x252f('0x3'));var util=require(_0x252f('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x252f('0x5'));var Redis=require(_0x252f('0x6'));var interaction=require(_0x252f('0x7'));var qs=require(_0x252f('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x252f('0x9'))(_0x252f('0xa'));var config=require(_0x252f('0xb'));var db=require('../../mysqldb')['db'];config[_0x252f('0xc')]=_[_0x252f('0xd')](config[_0x252f('0xc')],{'host':_0x252f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x252f('0xc')]));require(_0x252f('0xf'))[_0x252f('0x10')](socket);var jayson=require(_0x252f('0x11'));var client=jayson[_0x252f('0x12')][_0x252f('0x13')]({'port':0x232b});var client9004=jayson['client'][_0x252f('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x54c569,_0x2487cf,_0x240724,_0x1d6059){return new BPromise(function(_0xbc81a,_0x44da4e){var _0x1caae9=_0x1d6059||client;return _0x1caae9[_0x252f('0x14')](_0x54c569,_0x240724)[_0x252f('0x15')](function(_0x3e8db6){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x2487cf,_0x252f('0x16'));logger[_0x252f('0x17')](_0x252f('0x18'),_0x2487cf,_0x252f('0x16'),JSON[_0x252f('0x19')](_0x3e8db6));if(_0x3e8db6[_0x252f('0x1a')]){if(_0x3e8db6['error'][_0x252f('0x1b')]===0x1f4){logger['error'](_0x252f('0x1c'),_0x2487cf,_0x3e8db6[_0x252f('0x1a')][_0x252f('0x1d')]);return _0x44da4e(_0x3e8db6['error'][_0x252f('0x1d')]);}logger[_0x252f('0x1a')](_0x252f('0x1c'),_0x2487cf,_0x3e8db6[_0x252f('0x1a')]['message']);return _0xbc81a(_0x3e8db6[_0x252f('0x1a')][_0x252f('0x1d')]);}else{logger['info'](_0x252f('0x1c'),_0x2487cf,'request\x20sent');_0xbc81a(_0x3e8db6[_0x252f('0x1e')]['message']);}})[_0x252f('0x1f')](function(_0x578f73){logger[_0x252f('0x1a')](_0x252f('0x1c'),_0x2487cf,_0x578f73);_0x44da4e(_0x578f73);});});}function respondWithStatusCode(_0xfd680f,_0x1339e4){_0x1339e4=_0x1339e4||0xcc;return function(_0xd94eeb){if(_0xd94eeb){return _0xfd680f[_0x252f('0x20')](_0x1339e4);}return _0xfd680f[_0x252f('0x21')](_0x1339e4)[_0x252f('0x22')]();};}function respondWithResult(_0x145199,_0x52e810){_0x52e810=_0x52e810||0xc8;return function(_0x484169){if(_0x484169){return _0x145199[_0x252f('0x21')](_0x52e810)[_0x252f('0x23')](_0x484169);}};}function respondWithFilteredResult(_0x5a2b37,_0x1ab2d7){return function(_0x1916f6){if(_0x1916f6){var _0x286ae0=typeof _0x1ab2d7[_0x252f('0x24')]==='undefined'&&typeof _0x1ab2d7[_0x252f('0x25')]===_0x252f('0x26');var _0x32b1e8=_0x1916f6[_0x252f('0x27')];var _0x4649a6=_0x286ae0?0x0:_0x1ab2d7[_0x252f('0x24')];var _0xcea077=_0x286ae0?_0x1916f6[_0x252f('0x27')]:_0x1ab2d7[_0x252f('0x24')]+_0x1ab2d7[_0x252f('0x25')];var _0x50c773;if(_0xcea077>=_0x32b1e8){_0xcea077=_0x32b1e8;_0x50c773=0xc8;}else{_0x50c773=0xce;}_0x5a2b37[_0x252f('0x21')](_0x50c773);return _0x5a2b37[_0x252f('0x28')]('Content-Range',_0x4649a6+'-'+_0xcea077+'/'+_0x32b1e8)[_0x252f('0x23')](_0x1916f6);}return null;};}function saveUpdates(_0xa75d72){return function(_0x54a958){if(_0x54a958){return _0x54a958[_0x252f('0x29')](_0xa75d72)[_0x252f('0x15')](function(_0x56006c){return _0x56006c;});}return null;};}function removeEntity(_0x21f960){return function(_0x8fd69a){if(_0x8fd69a){return _0x8fd69a['destroy']()[_0x252f('0x15')](function(){_0x21f960[_0x252f('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48974c){return function(_0x4bd72f){if(!_0x4bd72f){_0x48974c[_0x252f('0x20')](0x194);}return _0x4bd72f;};}function handleError(_0x431955,_0x52fc83){_0x52fc83=_0x52fc83||0x1f4;return function(_0x3e8605){logger[_0x252f('0x1a')](_0x3e8605[_0x252f('0x2a')]);if(_0x3e8605[_0x252f('0x2b')]){delete _0x3e8605['name'];}_0x431955[_0x252f('0x21')](_0x52fc83)[_0x252f('0x2c')](_0x3e8605);};}function getMustacheRender(_0x5a0b48,_0x2ac684){return Mustache[_0x252f('0x2d')](_0x5a0b48,_[_0x252f('0x2e')](_0x2ac684['body'],{'contact':_0x2ac684[_0x252f('0x2f')],'message':_0x2ac684[_0x252f('0x1d')],'agent':_0x2ac684[_0x252f('0x30')],'interaction':_0x2ac684['interaction'],'account':_0x2ac684['account']}))||'';}exports[_0x252f('0x31')]=function(_0x4592ce,_0x1ddb21){var _0x510368={};var _0x200d06=_[_0x252f('0x32')](db[_0x252f('0x33')]['rawAttributes'],function(_0x147dcc){return{'name':_0x147dcc[_0x252f('0x34')],'type':_0x147dcc[_0x252f('0x35')][_0x252f('0x36')]};});_0x510368=qs['getOptions'](_0x200d06,_0x4592ce);return interaction['findAll'](_0x252f('0x37'),_0x4592ce[_0x252f('0x38')],_0x4592ce[_0x252f('0x39')],_0x510368,_0x200d06)[_0x252f('0x15')](respondWithFilteredResult(_0x1ddb21,_0x510368))[_0x252f('0x1f')](handleError(_0x1ddb21,null));};exports[_0x252f('0x3a')]=function(_0xf5973c,_0x38e393){var _0x563161={'raw':![],'where':{'id':_0xf5973c['params']['id']}},_0x259a39={};_0x259a39[_0x252f('0x3b')]=_[_0x252f('0x3c')](db[_0x252f('0x33')][_0x252f('0x3d')]);_0x259a39[_0x252f('0x38')]=_[_0x252f('0x3c')](_0xf5973c[_0x252f('0x38')]);_0x259a39[_0x252f('0x3e')]=_[_0x252f('0x3f')](_0x259a39['model'],_0x259a39['query']);_0x563161[_0x252f('0x40')]=_[_0x252f('0x3f')](_0x259a39['model'],qs[_0x252f('0x41')](_0xf5973c['query'][_0x252f('0x41')]));_0x563161[_0x252f('0x40')]=_0x563161[_0x252f('0x40')]['length']?_0x563161[_0x252f('0x40')]:_0x259a39[_0x252f('0x3b')];if(_0xf5973c['query'][_0x252f('0x42')]){_0x563161[_0x252f('0x43')]=[{'all':!![]}];}_0x563161=_[_0x252f('0x2e')]({},_0x563161,_0xf5973c[_0x252f('0x44')]);return db['ChatInteraction'][_0x252f('0x45')](_0x563161)[_0x252f('0x15')](handleEntityNotFound(_0x38e393,null))['then'](respondWithResult(_0x38e393,null))[_0x252f('0x1f')](handleError(_0x38e393,null));};exports[_0x252f('0x46')]=function(_0xb10a0b,_0x3af9a9){return db[_0x252f('0x33')][_0x252f('0x46')](_0xb10a0b[_0x252f('0x47')],{})['then'](respondWithResult(_0x3af9a9,0xc9))[_0x252f('0x1f')](handleError(_0x3af9a9,null));};exports['update']=function(_0x321d6f,_0x5a33ec){if(_0x321d6f[_0x252f('0x47')]['id']){delete _0x321d6f['body']['id'];}return db[_0x252f('0x33')][_0x252f('0x45')]({'where':{'id':_0x321d6f[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x5a33ec,null))[_0x252f('0x15')](saveUpdates(_0x321d6f[_0x252f('0x47')],null))['then'](respondWithResult(_0x5a33ec,null))[_0x252f('0x1f')](handleError(_0x5a33ec,null));};exports[_0x252f('0x49')]=function(_0x45724b,_0x548f06){return db['ChatInteraction']['find']({'where':{'id':_0x45724b[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x548f06,null))[_0x252f('0x15')](removeEntity(_0x548f06,null))['catch'](handleError(_0x548f06,null));};exports[_0x252f('0x4a')]=function(_0x51ef3b,_0x4fbf88){return db[_0x252f('0x33')][_0x252f('0x4a')]()[_0x252f('0x15')](respondWithResult(_0x4fbf88,null))['catch'](handleError(_0x4fbf88,null));};exports[_0x252f('0x4b')]=function(_0x1da66b,_0x5571da){var _0x1f0c1e=_0x1da66b['params']['id'];var _0x2f1df8;var _0x5df2c0;var _0x337ba9;return db['ChatInteraction'][_0x252f('0x4c')]({'where':{'id':_0x1f0c1e}})[_0x252f('0x15')](function(_0x3de19b){_0x2f1df8=_0x3de19b;return db['ChatWebsite'][_0x252f('0x4c')]({'where':{'id':_0x3de19b[_0x252f('0x4d')]},'attributes':['id','vidaooApiKey',_0x252f('0x4e'),_0x252f('0x4f'),'vidaooNote',_0x252f('0x50')],'raw':!![]});})[_0x252f('0x15')](function(_0x244a99){if(_0x244a99&&_0x244a99[_0x252f('0x51')]&&_0x244a99['vidaooEscalation']){_0x5df2c0=_0x244a99;var _0x1ac587={'interaction':{'id':_0x1f0c1e},'agent':{'id':_0x1da66b[_0x252f('0x39')]['id'],'name':_0x1da66b[_0x252f('0x39')][_0x252f('0x2b')],'fullname':_0x1da66b[_0x252f('0x39')][_0x252f('0x52')],'email':_0x1da66b[_0x252f('0x39')][_0x252f('0x53')]},'contact':_0x1da66b[_0x252f('0x47')]['contact'],'account':_0x1da66b[_0x252f('0x47')]['account']};var _0x5e24bb={'rejectUnauthorized':![],'method':'POST','url':_0x252f('0x54'),'headers':{'X-APIKEY':_0x244a99[_0x252f('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1da66b['user']['email']],'buttons':null,'topic':_0x5df2c0[_0x252f('0x4f')],'note':_[_0x252f('0x55')](_0x5df2c0[_0x252f('0x56')])?null:getMustacheRender(_0x5df2c0[_0x252f('0x56')],_0x1ac587),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5df2c0['vidaooMetadata'])){var _0x40b15d=getMustacheRender(_0x5df2c0[_0x252f('0x50')],_0x1ac587);var _0x1e520e=JSON[_0x252f('0x57')](_0x40b15d);_0x5e24bb[_0x252f('0x47')][_0x252f('0x58')]=_0x1e520e;}}catch(_0x13a5b0){throw new db[(_0x252f('0x59'))]['ValidationError'](_0x252f('0x5a'));}return rp(_0x5e24bb);}else{throw new db['Sequelize'][(_0x252f('0x5b'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x252f('0x15')](function(_0x44d7a2){_0x337ba9=_0x44d7a2;if(_0x337ba9['id']){var _0x543e51={'body':_0x337ba9[_0x252f('0x5c')],'ChatWebsiteId':_0x5df2c0['id'],'ChatInteractionId':_0x2f1df8['id'],'direction':'out','UserId':_0x1da66b[_0x252f('0x39')]['id']};return db[_0x252f('0x5d')][_0x252f('0x46')](_0x543e51,{});}else{throw new db[(_0x252f('0x59'))][(_0x252f('0x5b'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x252f('0x15')](function(){return _0x2f1df8['updateAttributes']({'vidaooSessionId':_0x337ba9['id']});})['then'](respondWithResult(_0x5571da,null))[_0x252f('0x1f')](handleError(_0x5571da,null));};exports['customUpdate']=function(_0x3d1f6a,_0x20fa60){if(_0x3d1f6a['body']['id']){delete _0x3d1f6a[_0x252f('0x47')]['id'];}return db[_0x252f('0x33')][_0x252f('0x45')]({'where':{'id':_0x3d1f6a[_0x252f('0x48')]['id']},'include':[{'model':db[_0x252f('0x5e')],'as':_0x252f('0x5f')}]})[_0x252f('0x15')](handleEntityNotFound(_0x20fa60,null))[_0x252f('0x15')](saveUpdates(_0x3d1f6a[_0x252f('0x47')],null))[_0x252f('0x15')](respondWithResult(_0x20fa60,null))[_0x252f('0x1f')](handleError(_0x20fa60,null));};exports[_0x252f('0x60')]=function(_0x293723,_0x29d904){if(_0x293723[_0x252f('0x47')]['id']){delete _0x293723['body']['id'];}return db[_0x252f('0x33')][_0x252f('0x45')]({'where':{'id':_0x293723['params']['id']}})[_0x252f('0x15')](function(_0x22e4dc){if(!_0x22e4dc){logger[_0x252f('0x1a')](_0x252f('0x61'),_0x252f('0x60'),0x194,_0x252f('0x62'));_0x29d904[_0x252f('0x20')](0x194);}else{if(_0x22e4dc[_0x252f('0x63')]){throw new db[(_0x252f('0x59'))][(_0x252f('0x5b'))](_0x252f('0x64'));}}return _0x22e4dc;})[_0x252f('0x15')](function(_0x4e8f0e){if(_0x4e8f0e){return _0x4e8f0e[_0x252f('0x29')]({'closed':_0x293723['body'][_0x252f('0x65')],'disposition':_0x293723[_0x252f('0x47')]['disposition']})[_0x252f('0x15')](function(_0x3b6362){return _0x3b6362;});}})[_0x252f('0x15')](function(){return respondWithRpcPromise('AbandonInteraction',_0x252f('0x60'),_0x293723[_0x252f('0x47')],client9004);})['then'](respondWithResult(_0x29d904,null))[_0x252f('0x1f')](handleError(_0x29d904,null));};exports['attachmentUpload']=function(_0x842418,_0x515d5d){_0x842418[_0x252f('0x47')][_0x252f('0x2b')]=_0x842418[_0x252f('0x66')]['originalname'];_0x842418[_0x252f('0x47')]['basename']=_0x842418[_0x252f('0x66')][_0x252f('0x67')];_0x842418['body'][_0x252f('0x35')]=_0x842418[_0x252f('0x66')][_0x252f('0x68')];return db[_0x252f('0x69')][_0x252f('0x46')](_0x842418[_0x252f('0x47')])['then'](respondWithResult(_0x515d5d,0xc9))[_0x252f('0x1f')](handleError(_0x515d5d,null));};exports[_0x252f('0x6a')]=function(_0x32ff64,_0x7efec0){return db[_0x252f('0x33')][_0x252f('0x4c')]({'where':{'id':_0x32ff64['params']['id']},'raw':!![]})[_0x252f('0x15')](handleEntityNotFound(_0x7efec0,null))['then'](function(_0x2e559b){if(_0x2e559b){if(_0x2e559b[_0x252f('0x65')]){return _0x7efec0[_0x252f('0x21')](0x193)['json']({'status':0x193,'message':_0x252f('0x6b')});}return db[_0x252f('0x69')]['findOne']({'where':{'id':_0x32ff64[_0x252f('0x38')][_0x252f('0x6c')]},'raw':!![]})[_0x252f('0x15')](handleEntityNotFound(_0x7efec0,null));}})[_0x252f('0x15')](function(_0xd05024){if(_0xd05024){var _0x4ac8ed=_0xd05024[_0x252f('0x6d')]!==null;var _0x4aed6a=path[_0x252f('0x6e')](config['root'],'server/files/attachments/');if(_0x4ac8ed){_0x4aed6a=path[_0x252f('0x6e')](_0x4aed6a,'offline-chat/');}var _0x1a29df=path[_0x252f('0x6e')](_0x4aed6a,_0xd05024[_0x252f('0x6f')]);return _0x7efec0[_0x252f('0x70')](_0x1a29df);}})['catch'](handleError(_0x7efec0,null));};exports[_0x252f('0x71')]=function(_0xa2d280,_0x20376c){var _0x5ec61f=null;var _0x4a815f=null;var _0xe7431b=null;if(_0xa2d280[_0x252f('0x47')]['id']){delete _0xa2d280[_0x252f('0x47')]['id'];}if(_0xa2d280[_0x252f('0x47')][_0x252f('0x72')]){_0xe7431b=path[_0x252f('0x6e')](config[_0x252f('0x73')],'server/files/chat/upload/',util[_0x252f('0x74')](_0x252f('0x75'),Date[_0x252f('0x76')]()));_0xa2d280['body'][_0x252f('0x77')]=_0xe7431b;}return db['ChatInteraction']['find']({'where':{'id':_0xa2d280[_0x252f('0x48')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x252f('0x78')],'as':_0x252f('0x78')}]}]})[_0x252f('0x15')](handleEntityNotFound(_0x20376c,null))[_0x252f('0x15')](saveUpdates(_0xa2d280['body'],null))[_0x252f('0x15')](function(_0x2a16b0){if(_0x2a16b0){_0x5ec61f=_0x2a16b0;return db['ChatWebsite'][_0x252f('0x45')]({'where':{'id':_0x5ec61f['ChatWebsiteId']}});}})[_0x252f('0x15')](function(_0x2291fe){if(_0x2291fe){_0x4a815f=_0x2291fe;return db[_0x252f('0x5e')][_0x252f('0x45')]({'where':{'id':_0x5ec61f['ContactId']}});}})[_0x252f('0x15')](function(_0x2fd6f0){if(_0x2fd6f0){if(_0xe7431b){var _0x1e022f=null;for(var _0x18aa9c=0x1;_0x18aa9c<_0x5ec61f[_0x252f('0x79')][_0x252f('0x7a')];++_0x18aa9c){_0x1e022f=_0x5ec61f[_0x252f('0x79')][_0x18aa9c];var _0x33c37c=_0x1e022f[_0x252f('0x63')]?util[_0x252f('0x74')]('%s%d',_0x4a815f[_0x252f('0x7b')],_0x1e022f[_0x252f('0x63')]):_0x252f('0x7c');var _0x2741b9=_0xa2d280[_0x252f('0x47')][_0x252f('0x7d')]||util['format'](_0x252f('0x7e'),'Visitor',_0x1e022f[_0x252f('0x7f')]);switch(_0x4a815f['agentIdentifier']){case'website_alias':_0x33c37c=_0x1e022f[_0x252f('0x63')]?util[_0x252f('0x74')](_0x252f('0x7e'),_0x4a815f['agentAlias'],_0x1e022f[_0x252f('0x63')]):_0x252f('0x7c');break;case'agent_alias':_0x33c37c=_0x1e022f[_0x252f('0x63')]?_0x1e022f['User']['alias']||_0x1e022f[_0x252f('0x78')][_0x252f('0x52')]:_0x252f('0x7c');break;case _0x252f('0x80'):_0x33c37c=_0x1e022f[_0x252f('0x63')]?_0x1e022f['User'][_0x252f('0x52')]:_0x252f('0x7c');break;default:_0x33c37c=_0x1e022f['UserId']?util[_0x252f('0x74')](_0x252f('0x7e'),_0x4a815f['agentAlias'],_0x1e022f[_0x252f('0x63')]):_0x252f('0x7c');}var _0x3a207e=util[_0x252f('0x74')](_0x252f('0x81'),moment(_0x1e022f[_0x252f('0x82')])[_0x252f('0x74')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1e022f[_0x252f('0x83')]==='in'?_0x2741b9:_0x33c37c,_0x1e022f[_0x252f('0x47')]);if(!_0x1e022f[_0x252f('0x84')]){fs[_0x252f('0x85')](_0xe7431b,_0x3a207e);}}return db[_0x252f('0x86')][_0x252f('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x252f('0x87')],'as':_0x252f('0x88'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x252f('0x15')](function(_0xe42d5){if(!_0xe42d5||!_0xe42d5['Smtp']||!_0xa2d280[_0x252f('0x47')])return _0x5ec61f;var _0x55d4b7=_0xe42d5[_0x252f('0x89')]();return respondWithRpcPromise('SendMail',_0x252f('0x8a'),{'account':_0x55d4b7,'message':{'from':util['format'](_0x252f('0x8b'),_0xe42d5[_0x252f('0x2b')],_0xe42d5[_0x252f('0x53')]||_0xe42d5[_0x252f('0x88')][_0x252f('0x39')]),'to':_0xa2d280[_0x252f('0x47')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xa2d280[_0x252f('0x47')]['mailTranscript']),'attachments':[{'path':_0xe7431b}]}})[_0x252f('0x15')](function(){return _0x5ec61f;})[_0x252f('0x1f')](function(_0x4178b7){logger[_0x252f('0x1a')](_0x4178b7);});})[_0x252f('0x15')](respondWithStatusCode(_0x20376c,0xc8))['catch'](handleError(_0x20376c,null));};exports['addMessage']=function(_0x112c9a,_0x5109af){return db[_0x252f('0x5d')][_0x252f('0x45')]({'where':{'id':_0x112c9a[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x5109af,null))[_0x252f('0x15')](function(_0x3b7fbf){if(_0x3b7fbf){return _0x3b7fbf[_0x252f('0x8c')](_0x112c9a[_0x252f('0x47')][_0x252f('0x8d')],_[_0x252f('0x8e')](_0x112c9a[_0x252f('0x47')],[_0x252f('0x8d'),'id'])||{});}})[_0x252f('0x15')](respondWithResult(_0x5109af,null))[_0x252f('0x1f')](handleError(_0x5109af,null));};exports['getMessages']=function(_0x58de24,_0x8b464a){var _0x28644b={'raw':![],'where':{}};var _0x1cc4fa={};var _0x245faa={'count':0x0,'rows':[]};return db[_0x252f('0x33')][_0x252f('0x4c')]({'where':{'id':_0x58de24[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x8b464a,null))[_0x252f('0x15')](function(_0x328dbd){if(_0x328dbd){_0x1cc4fa[_0x252f('0x3b')]=_[_0x252f('0x3c')](db['ChatMessage'][_0x252f('0x3d')]);_0x1cc4fa[_0x252f('0x38')]=_['keys'](_0x58de24[_0x252f('0x38')]);_0x1cc4fa[_0x252f('0x3e')]=_['intersection'](_0x1cc4fa[_0x252f('0x3b')],_0x1cc4fa[_0x252f('0x38')]);_0x28644b[_0x252f('0x40')]=_[_0x252f('0x3f')](_0x1cc4fa[_0x252f('0x3b')],qs['fields'](_0x58de24[_0x252f('0x38')][_0x252f('0x41')]));_0x28644b[_0x252f('0x40')]=_0x28644b[_0x252f('0x40')][_0x252f('0x7a')]?_0x28644b[_0x252f('0x40')]:_0x1cc4fa[_0x252f('0x3b')];if(!_0x58de24[_0x252f('0x38')]['hasOwnProperty'](_0x252f('0x8f'))){_0x28644b[_0x252f('0x25')]=qs[_0x252f('0x25')](_0x58de24[_0x252f('0x38')][_0x252f('0x25')]);_0x28644b['offset']=qs[_0x252f('0x24')](_0x58de24['query'][_0x252f('0x24')]);}_0x28644b[_0x252f('0x90')]=qs['sort'](_0x58de24[_0x252f('0x38')][_0x252f('0x91')]);_0x28644b[_0x252f('0x92')]=qs[_0x252f('0x3e')](_[_0x252f('0x93')](_0x58de24['query'],_0x1cc4fa[_0x252f('0x3e')]));_0x28644b[_0x252f('0x92')][_0x252f('0x94')]=_0x328dbd['id'];if(_0x58de24[_0x252f('0x38')][_0x252f('0x95')]){_0x28644b[_0x252f('0x92')]=_[_0x252f('0x2e')](_0x28644b[_0x252f('0x92')],{'$or':_[_0x252f('0x32')](_0x28644b[_0x252f('0x40')],function(_0x5405dd){var _0x4441a2={};_0x4441a2[_0x5405dd]={'$like':'%'+_0x58de24[_0x252f('0x38')]['filter']+'%'};return _0x4441a2;})});}if(_0x58de24[_0x252f('0x38')][_0x252f('0x96')]){var _0x3f56ac=_0x58de24[_0x252f('0x38')][_0x252f('0x96')][_0x252f('0x97')](',');var _0x19ed10={};_0x19ed10[_0x3f56ac[0x0]]={'$gte':moment(_0x3f56ac[0x1])['format'](_0x252f('0x98'))};_0x28644b['where']=_[_0x252f('0x2e')](_0x28644b[_0x252f('0x92')],_0x19ed10);}_0x28644b=_['merge']({},_0x28644b,_0x58de24[_0x252f('0x44')]);return db[_0x252f('0x5d')][_0x252f('0x27')]({'where':_0x28644b['where']})[_0x252f('0x15')](function(_0x327441){_0x245faa['count']=_0x327441;if(_0x58de24['query']['includeAll']){_0x28644b['include']=[{'all':!![]}];}return db['ChatMessage'][_0x252f('0x99')](_0x28644b);})[_0x252f('0x15')](function(_0x186815){_0x245faa[_0x252f('0x9a')]=_0x186815;return _0x245faa;});}})[_0x252f('0x15')](respondWithFilteredResult(_0x8b464a,_0x28644b))[_0x252f('0x1f')](handleError(_0x8b464a,null));};exports[_0x252f('0x9b')]=function(_0x21cac0,_0x2e6e08){var _0x2f228c={'where':{}},_0x5c454b={},_0x10cbc4={'count':0x0,'rows':[]};return db[_0x252f('0x33')][_0x252f('0x4c')]({'where':{'id':_0x21cac0[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0x2e6e08,null))[_0x252f('0x15')](function(_0x477eb3){if(_0x477eb3){_0x5c454b['model']=_[_0x252f('0x3c')](db[_0x252f('0x5d')][_0x252f('0x3d')]);_0x5c454b[_0x252f('0x38')]=_[_0x252f('0x3c')](_0x21cac0['query']);_0x5c454b['filters']=_[_0x252f('0x3f')](_0x5c454b[_0x252f('0x3b')],_0x5c454b[_0x252f('0x38')]);_0x2f228c[_0x252f('0x40')]=_[_0x252f('0x3f')](_0x5c454b[_0x252f('0x3b')],qs[_0x252f('0x41')](_0x21cac0['query']['fields']));_0x2f228c[_0x252f('0x40')]=_0x2f228c[_0x252f('0x40')][_0x252f('0x7a')]?_0x2f228c[_0x252f('0x40')]:_0x5c454b[_0x252f('0x3b')];if(!_0x21cac0['query'][_0x252f('0x9c')](_0x252f('0x8f'))){_0x2f228c['limit']=qs[_0x252f('0x25')](_0x21cac0[_0x252f('0x38')][_0x252f('0x25')]);_0x2f228c[_0x252f('0x24')]=qs[_0x252f('0x24')](_0x21cac0['query'][_0x252f('0x24')]);}_0x2f228c[_0x252f('0x90')]=qs[_0x252f('0x91')](_0x21cac0['query'][_0x252f('0x91')]);_0x2f228c[_0x252f('0x92')]=qs[_0x252f('0x3e')](_[_0x252f('0x93')](_0x21cac0['query'],_0x5c454b[_0x252f('0x3e')]));_0x2f228c[_0x252f('0x92')][_0x252f('0x94')]=_0x477eb3['id'];if(_0x21cac0[_0x252f('0x38')][_0x252f('0x95')]){_0x2f228c[_0x252f('0x92')]=_[_0x252f('0x2e')](_0x2f228c['where'],{'$or':_[_0x252f('0x32')](_0x2f228c[_0x252f('0x40')],function(_0x47ed1b){var _0x1b5e17={};_0x1b5e17[_0x47ed1b]={'$like':'%'+_0x21cac0[_0x252f('0x38')][_0x252f('0x95')]+'%'};return _0x1b5e17;})});}_0x2f228c['where'][_0x252f('0x84')]=![];if(_0x21cac0['query']['id']){_0x2f228c['where']['id']={'$gt':_0x21cac0[_0x252f('0x38')]['id']};}_0x2f228c=_[_0x252f('0x2e')]({},_0x2f228c,_0x21cac0[_0x252f('0x44')]);return db[_0x252f('0x5d')]['count']({'where':_0x2f228c['where']})[_0x252f('0x15')](function(_0x5978ba){_0x10cbc4[_0x252f('0x27')]=_0x5978ba;_0x2f228c['include']=[];if(_0x21cac0[_0x252f('0x38')][_0x252f('0x9d')]){_0x2f228c['include'][_0x252f('0x9e')]({'model':db[_0x252f('0x78')],'as':_0x252f('0x78'),'attributes':['id',_0x252f('0x52'),_0x252f('0x9f')]});}if(_0x21cac0[_0x252f('0x38')][_0x252f('0x42')]){_0x2f228c[_0x252f('0x43')]=[{'all':!![]}];}return db['ChatMessage'][_0x252f('0x99')](_0x2f228c);})[_0x252f('0x15')](function(_0x50171c){_0x10cbc4['rows']=_0x50171c;return _0x10cbc4;});}})['then'](respondWithFilteredResult(_0x2e6e08,_0x2f228c))[_0x252f('0x1f')](handleError(_0x2e6e08,null));};exports[_0x252f('0xa0')]=function(_0x392b5f,_0xc9ab90){return db[_0x252f('0x33')]['find']({'where':{'id':_0x392b5f[_0x252f('0x48')]['id']}})[_0x252f('0x15')](handleEntityNotFound(_0xc9ab90,null))[_0x252f('0x15')](function(_0x202ab3){if(_0x202ab3){return _0x202ab3[_0x252f('0xa1')](_0x392b5f[_0x252f('0x47')][_0x252f('0x8d')],_['omit'](_0x392b5f[_0x252f('0x47')],[_0x252f('0x8d'),'id'])||{})[_0x252f('0xa2')](function(){return db[_0x252f('0xa3')]['findAll']({'attributes':['id',_0x252f('0x2b'),_0x252f('0xa4')],'where':{'id':_0x392b5f['body']['ids']}});})['then'](function(_0x50284d){socket[_0x252f('0xa5')]('chatInteractionTags:save',{'id':Number(_0x392b5f['params']['id']),'tags':_0x50284d||[]});return{'id':Number(_0x392b5f[_0x252f('0x48')]['id']),'tags':_0x50284d||[]};});}})[_0x252f('0x15')](respondWithResult(_0xc9ab90,null))['catch'](handleError(_0xc9ab90,null));};exports[_0x252f('0xa6')]=function(_0x32d409,_0x457d78){return db['ChatInteraction'][_0x252f('0x45')]({'where':{'id':_0x32d409['params']['id']}})['then'](handleEntityNotFound(_0x457d78,null))['then'](function(_0x438cf0){if(_0x438cf0){return _0x438cf0[_0x252f('0xa6')](_0x32d409['query'][_0x252f('0x8d')]);}})[_0x252f('0x15')](respondWithStatusCode(_0x457d78,null))['catch'](handleError(_0x457d78,null));};exports[_0x252f('0x70')]=function(_0x501524,_0x19481d){var _0x1419a9=moment()[_0x252f('0xa7')]()[_0x252f('0xa8')]();var _0x5a4827=path[_0x252f('0x6e')](config[_0x252f('0x73')],_0x252f('0xa9'),_0x252f('0xaa'),_0x252f('0xab'));var _0x29de57=path[_0x252f('0x6e')](config['root'],_0x252f('0xa9'),'files',_0x252f('0xac'));var _0x192d2f=path[_0x252f('0x6e')](_0x5a4827,_0x1419a9);var _0x1d0baa=util['format']('transcript-%d-%s.zip',_0x501524[_0x252f('0x48')]['id'],_0x1419a9);var _0x3fdc34=path['join'](_0x5a4827,_0x1d0baa);var _0xdae8dd=[];_0xdae8dd[_0x252f('0x9e')]({'model':db[_0x252f('0x78')],'as':_0x252f('0x78'),'attributes':['id',_0x252f('0x52')],'raw':!![]});_0xdae8dd[_0x252f('0x9e')]({'model':db[_0x252f('0x5e')],'as':_0x252f('0x5f'),'attributes':['id','firstName',_0x252f('0xad')],'raw':!![]});if(_0x501524[_0x252f('0x38')][_0x252f('0xac')]){_0xdae8dd[_0x252f('0x9e')]({'model':db[_0x252f('0x69')],'as':_0x252f('0x69'),'raw':!![]});}var _0x1ed94c=[{'model':db[_0x252f('0x5d')],'as':_0x252f('0x79'),'attributes':['id',_0x252f('0x47'),'createdAt',_0x252f('0x83'),_0x252f('0x84'),_0x252f('0xae')],'include':_0xdae8dd}];_0x1ed94c[_0x252f('0x9e')]({'model':db[_0x252f('0xaf')],'as':_0x252f('0xb0'),'attributes':['id','name']});_0x1ed94c[_0x252f('0x9e')]({'model':db[_0x252f('0x78')],'as':_0x252f('0xb1'),'attributes':['id',_0x252f('0x52')]});return db[_0x252f('0x33')][_0x252f('0x45')]({'where':{'id':_0x501524[_0x252f('0x48')]['id']},'include':_0x1ed94c})[_0x252f('0x15')](handleEntityNotFound(_0x19481d,null))[_0x252f('0x15')](function(_0x11e1cb){if(_0x11e1cb){var _0x32d13f=_0x11e1cb[_0x252f('0xb2')]({'plain':!![]});fs[_0x252f('0xb3')](_0x192d2f);var _0x4272e0={'channel':_0x252f('0xb4'),'account':_0x32d13f[_0x252f('0xb0')][_0x252f('0x2b')],'agent':_0x32d13f[_0x252f('0xb1')]?_0x32d13f['Owner'][_0x252f('0x52')]:_0x252f('0xb5'),'createdAt':moment(_0x32d13f[_0x252f('0x82')])[_0x252f('0x74')](_0x252f('0x98'))[_0x252f('0xa8')](),'closedAt':_0x32d13f[_0x252f('0x65')]?moment(_0x32d13f[_0x252f('0xb6')])[_0x252f('0x74')]('YYYY-MM-DD\x20HH:mm:ss')[_0x252f('0xa8')]():'','disposition':_0x32d13f[_0x252f('0xb7')],'chatInfo':{'browser':_0x32d13f[_0x252f('0xb8')],'os':_0x32d13f[_0x252f('0xb9')],'referer':_0x32d13f[_0x252f('0xba')],'customerIp':_0x32d13f[_0x252f('0xbb')],'customerPort':_0x32d13f[_0x252f('0xbc')]?_0x32d13f[_0x252f('0xbc')]:_0x252f('0xb5')},'messages':_(_0x32d13f[_0x252f('0x79')])[_0x252f('0xbd')]()['filter']({'secret':![]})['map'](function(_0x3a0478){if(_0x3a0478[_0x252f('0x69')]){var _0x19e895=path[_0x252f('0x6e')](_0x29de57,_0x3a0478[_0x252f('0x69')][_0x252f('0x6f')]);if(fs['existsSync'](_0x19e895)){fs[_0x252f('0xbe')](_0x19e895)[_0x252f('0xbf')](fs['createWriteStream'](path[_0x252f('0x6e')](_0x192d2f,_0x3a0478['Attachment'][_0x252f('0x6f')])));}}return{'date':moment(_0x3a0478[_0x252f('0x82')])[_0x252f('0x74')](_0x252f('0x98'))[_0x252f('0xa8')](),'sender':_0x3a0478[_0x252f('0x83')]===_0x252f('0xc0')?_0x3a0478[_0x252f('0x78')]?_0x3a0478[_0x252f('0x78')][_0x252f('0x52')]:_0x252f('0x7c'):_0x3a0478[_0x252f('0x5f')][_0x252f('0xc1')]+(_0x3a0478[_0x252f('0x5f')][_0x252f('0xad')]?'\x20'+_0x3a0478[_0x252f('0x5f')][_0x252f('0xad')]:''),'body':_0x3a0478[_0x252f('0x69')]?_0x3a0478[_0x252f('0x69')][_0x252f('0x6f')]:_0x3a0478[_0x252f('0x47')],'direction':_0x3a0478[_0x252f('0x83')]===_0x252f('0xc0')?'A':'C','secret':_0x3a0478[_0x252f('0x84')],'read':_0x3a0478[_0x252f('0xae')],'attachment':_0x3a0478[_0x252f('0x69')]};})[_0x252f('0xc2')]()};return ejs['renderFile'](path[_0x252f('0x6e')](config[_0x252f('0x73')],_0x252f('0xa9'),_0x252f('0xc3'),_0x252f('0xc4')),{'interaction':_0x4272e0})[_0x252f('0x15')](function(_0x328d7a){var _0x59858b=path[_0x252f('0x6e')](_0x192d2f,_0x252f('0xc5')+_0x32d13f['id']+'-'+_0x1419a9+_0x252f('0xc6'));var _0x4c9daf={'path':_0x59858b,'channel':_0x252f('0xb4'),'interactionId':_0x32d13f['id']};return pdf[_0x252f('0xc7')](_0x328d7a,_0x4c9daf);})[_0x252f('0x15')](function(){return new Promise(function(_0x58d465,_0xf4423a){zipdir(_0x192d2f,{'saveTo':_0x3fdc34},function(_0x4b9e5c,_0x12fbe7){if(_0x4b9e5c)return _0xf4423a(_0x4b9e5c);return _0x58d465(_0x12fbe7);});})['then'](function(){return new BPromise(function(_0x2867f7,_0x13ba73){rimraf(_0x192d2f,function(_0xeb9fb4){if(_0xeb9fb4)_0x13ba73(_0xeb9fb4);return _0x2867f7();});});})[_0x252f('0x15')](function(){return _0x19481d[_0x252f('0x70')](_0x3fdc34,_0x1d0baa,function(_0x4ed3ab){if(_0x4ed3ab){logger[_0x252f('0x1a')](_0x252f('0xc8'),_0x4ed3ab);}else{fs[_0x252f('0xc9')](_0x3fdc34);}});});});}else{return _0x19481d[_0x252f('0x20')](0xc8);}})[_0x252f('0x1f')](handleError(_0x19481d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index e91ab4c..f3e0d7d 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 _0x9390=['length','emit','catch','hasOwnProperty','hook','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x9390,0x1ce));var _0x0939=function(_0x3040e0,_0x179258){_0x3040e0=_0x3040e0-0x0;var _0x885cd=_0x9390[_0x3040e0];return _0x885cd;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x0939('0x0')];var ChatMessage=require(_0x0939('0x1'))['db'][_0x0939('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0939('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0939('0x4'),'afterDestroy':_0x0939('0x5')};function emitEvent(_0x19241e){return function(_0x32920e,_0x1809b8,_0x42454d){_0x32920e[_0x0939('0x6')]({'attributes':['id'],'raw':!![]})[_0x0939('0x7')](function(_0x59d1a9){_0x32920e[_0x0939('0x8')](_0x0939('0x9'),_0x59d1a9[_0x0939('0xa')](function(_0x7e9ba4){return{'id':_0x7e9ba4['id']};}));return ChatMessage[_0x0939('0xb')]({'where':{'ChatInteractionId':_0x32920e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0939('0x7')](function(_0x47210a){_0x32920e[_0x0939('0x8')](_0x0939('0xc'),_0x47210a[_0x0939('0xd')]);ChatInteractionEvents[_0x0939('0xe')](_0x19241e+':'+_0x32920e['id'],_0x32920e);ChatInteractionEvents[_0x0939('0xe')](_0x19241e,_0x32920e);_0x42454d(null);})[_0x0939('0xf')](_0x42454d(null));};}for(var e in events){if(events[_0x0939('0x10')](e)){var event=events[e];ChatInteraction[_0x0939('0x11')](e,emitEvent(event));}}module[_0x0939('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x33f0=['setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','then'];(function(_0x2f87cd,_0xcaf299){var _0x5d7eda=function(_0x37ffb0){while(--_0x37ffb0){_0x2f87cd['push'](_0x2f87cd['shift']());}};_0x5d7eda(++_0xcaf299);}(_0x33f0,0x6f));var _0x033f=function(_0x647d4c,_0x45a2b8){_0x647d4c=_0x647d4c-0x0;var _0xf88e1c=_0x33f0[_0x647d4c];return _0xf88e1c;};'use strict';var EventEmitter=require(_0x033f('0x0'));var ChatInteraction=require(_0x033f('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x033f('0x1'))['db'][_0x033f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x033f('0x3')](0x0);var events={'afterCreate':_0x033f('0x4'),'afterUpdate':_0x033f('0x5'),'afterDestroy':_0x033f('0x6')};function emitEvent(_0x2d2513){return function(_0x1952b4,_0x1f7fb8,_0x2d4656){_0x1952b4['getUsers']({'attributes':['id'],'raw':!![]})[_0x033f('0x7')](function(_0x45f22b){_0x1952b4[_0x033f('0x8')]('Users',_0x45f22b[_0x033f('0x9')](function(_0x53e6f3){return{'id':_0x53e6f3['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1952b4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x9258f2){_0x1952b4[_0x033f('0x8')](_0x033f('0xa'),_0x9258f2[_0x033f('0xb')]);ChatInteractionEvents[_0x033f('0xc')](_0x2d2513+':'+_0x1952b4['id'],_0x1952b4);ChatInteractionEvents[_0x033f('0xc')](_0x2d2513,_0x1952b4);_0x2d4656(null);})[_0x033f('0xd')](_0x2d4656(null));};}for(var e in events){if(events[_0x033f('0xe')](e)){var event=events[e];ChatInteraction[_0x033f('0xf')](e,emitEvent(event));}}module[_0x033f('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index c62be35..8327994 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 _0x6d75=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','define','ChatInteraction','chat_interactions'];(function(_0x18710b,_0x34ea23){var _0x38d1de=function(_0x48dbae){while(--_0x48dbae){_0x18710b['push'](_0x18710b['shift']());}};_0x38d1de(++_0x34ea23);}(_0x6d75,0x116));var _0x56d7=function(_0x4c2b96,_0x17ab0d){_0x4c2b96=_0x4c2b96-0x0;var _0x2a62bf=_0x6d75[_0x4c2b96];return _0x2a62bf;};'use strict';var _=require(_0x56d7('0x0'));var util=require(_0x56d7('0x1'));var logger=require(_0x56d7('0x2'))(_0x56d7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x56d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56d7('0x5'));var config=require(_0x56d7('0x6'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x432387,_0x5c002d){return _0x432387[_0x56d7('0x7')](_0x56d7('0x8'),attributes,{'tableName':_0x56d7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b06e2,_0x4d8164,_0x1964b1){if(_0x5b06e2[_0x56d7('0xa')](_0x56d7('0xb'))){_0x5b06e2[_0x56d7('0xc')]=moment()['format'](_0x56d7('0xd'));}_0x1964b1(null,_0x5b06e2);}},'charset':_0x56d7('0xe'),'collate':_0x56d7('0xf')});};
\ No newline at end of file
+var _0x0f28=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','../../config/environment','exports','define','chat_interactions','closedAt'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f28,0x170));var _0x80f2=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0x0f28[_0x52980f];return _0x1f52a1;};'use strict';var _=require(_0x80f2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x80f2('0x1'));var moment=require(_0x80f2('0x2'));var BPromise=require(_0x80f2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80f2('0x4'));var rimraf=require('rimraf');var config=require(_0x80f2('0x5'));var attributes=require('./chatInteraction.attributes');module[_0x80f2('0x6')]=function(_0x279862,_0x4a47e3){return _0x279862[_0x80f2('0x7')]('ChatInteraction',attributes,{'tableName':_0x80f2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a299c,_0x236dc5,_0x22cf2c){if(_0x4a299c['changed']('closed')){_0x4a299c[_0x80f2('0x9')]=moment()[_0x80f2('0xa')](_0x80f2('0xb'));}_0x22cf2c(null,_0x4a299c);}},'charset':_0x80f2('0xc'),'collate':_0x80f2('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 518fca1..4d0ce83 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 _0x1ce0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','UpdateChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring'];(function(_0x2c3528,_0x3511de){var _0x93502d=function(_0x5905e){while(--_0x5905e){_0x2c3528['push'](_0x2c3528['shift']());}};_0x93502d(++_0x3511de);}(_0x1ce0,0x134));var _0x01ce=function(_0x510cd9,_0x551300){_0x510cd9=_0x510cd9-0x0;var _0x2b1f61=_0x1ce0[_0x510cd9];return _0x2b1f61;};'use strict';var _=require('lodash');var util=require(_0x01ce('0x0'));var moment=require(_0x01ce('0x1'));var BPromise=require(_0x01ce('0x2'));var rs=require(_0x01ce('0x3'));var fs=require('fs');var Redis=require(_0x01ce('0x4'));var db=require(_0x01ce('0x5'))['db'];var utils=require(_0x01ce('0x6'));var logger=require(_0x01ce('0x7'))(_0x01ce('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x01ce('0x9')]=_[_0x01ce('0xa')](config[_0x01ce('0x9')],{'host':_0x01ce('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4f74f2,_0x260f3e,_0x3ff41f){return new BPromise(function(_0x54d72f,_0x58445b){return client[_0x01ce('0xc')](_0x4f74f2,_0x3ff41f)[_0x01ce('0xd')](function(_0x1e2cad){logger[_0x01ce('0xe')](_0x01ce('0xf'),_0x260f3e,'request\x20sent');logger[_0x01ce('0x10')](_0x01ce('0x11'),_0x260f3e,'request\x20sent',JSON[_0x01ce('0x12')](_0x1e2cad));if(_0x1e2cad['error']){if(_0x1e2cad[_0x01ce('0x13')][_0x01ce('0x14')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x260f3e,_0x1e2cad[_0x01ce('0x13')][_0x01ce('0x15')]);return _0x58445b(_0x1e2cad['error']['message']);}logger[_0x01ce('0x13')](_0x01ce('0xf'),_0x260f3e,_0x1e2cad[_0x01ce('0x13')][_0x01ce('0x15')]);return _0x54d72f(_0x1e2cad['error'][_0x01ce('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x260f3e,_0x01ce('0x16'));_0x54d72f(_0x1e2cad['result'][_0x01ce('0x15')]);}})[_0x01ce('0x17')](function(_0x1657df){logger[_0x01ce('0x13')](_0x01ce('0xf'),_0x260f3e,_0x1657df);_0x58445b(_0x1657df);});});}exports[_0x01ce('0x18')]=function(_0x5aaa9d){var _0x2b02d1=this;return new Promise(function(_0x6d2c15,_0x2ed194){return db['ChatInteraction'][_0x01ce('0x19')](_0x5aaa9d[_0x01ce('0x1a')],{'raw':_0x5aaa9d[_0x01ce('0x1b')]?_0x5aaa9d['options'][_0x01ce('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aaa9d[_0x01ce('0x1b')]?_0x5aaa9d[_0x01ce('0x1b')]['where']||null:null,'attributes':_0x5aaa9d[_0x01ce('0x1b')]?_0x5aaa9d[_0x01ce('0x1b')][_0x01ce('0x1d')]||null:null,'limit':_0x5aaa9d[_0x01ce('0x1b')]?_0x5aaa9d[_0x01ce('0x1b')][_0x01ce('0x1e')]||null:null})['then'](function(_0x34170b){logger[_0x01ce('0xe')](_0x01ce('0x18'),_0x5aaa9d);logger[_0x01ce('0x10')](_0x01ce('0x18'),_0x5aaa9d,JSON['stringify'](_0x34170b));_0x6d2c15(_0x34170b);})['catch'](function(_0x322c04){logger[_0x01ce('0x13')](_0x01ce('0x18'),_0x322c04[_0x01ce('0x15')],_0x5aaa9d);_0x2ed194(_0x2b02d1['error'](0x1f4,_0x322c04[_0x01ce('0x15')]));});});};exports[_0x01ce('0x1f')]=function(_0x15cc71){return new Promise(function(_0x4520a1,_0x3463bf){return db[_0x01ce('0x20')][_0x01ce('0x21')]({'where':_0x15cc71[_0x01ce('0x1b')]?_0x15cc71[_0x01ce('0x1b')]['where']||null:null})[_0x01ce('0xd')](function(_0x260cf6){if(_0x260cf6){return _0x260cf6[_0x01ce('0x22')](_0x15cc71[_0x01ce('0x1a')][_0x01ce('0x23')],_[_0x01ce('0x24')](_0x15cc71[_0x01ce('0x1a')],[_0x01ce('0x23'),'id'])||{});}})[_0x01ce('0x25')](function(_0x5c25e9){logger[_0x01ce('0xe')]('AddTags',_0x15cc71);logger[_0x01ce('0x10')](_0x01ce('0x26'),_0x15cc71,JSON[_0x01ce('0x12')](_0x5c25e9));_0x4520a1(_0x5c25e9);})[_0x01ce('0x17')](function(_0x2a4cbf){logger[_0x01ce('0x13')](_0x01ce('0x26'),_0x2a4cbf[_0x01ce('0x15')],_0x15cc71);_0x3463bf(_this[_0x01ce('0x13')](0x1f4,_0x2a4cbf[_0x01ce('0x15')]));});});};
\ No newline at end of file
+var _0xd9df=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','find','body','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x30510e,_0x40f4b7){var _0x3497=function(_0x1c4097){while(--_0x1c4097){_0x30510e['push'](_0x30510e['shift']());}};_0x3497(++_0x40f4b7);}(_0xd9df,0x1c6));var _0xfd9d=function(_0xb4fa21,_0x56e470){_0xb4fa21=_0xb4fa21-0x0;var _0x456fcf=_0xd9df[_0xb4fa21];return _0x456fcf;};'use strict';var _=require(_0xfd9d('0x0'));var util=require(_0xfd9d('0x1'));var moment=require('moment');var BPromise=require(_0xfd9d('0x2'));var rs=require(_0xfd9d('0x3'));var fs=require('fs');var Redis=require(_0xfd9d('0x4'));var db=require(_0xfd9d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd9d('0x6'))(_0xfd9d('0x7'));var config=require(_0xfd9d('0x8'));var jayson=require(_0xfd9d('0x9'));var client=jayson[_0xfd9d('0xa')][_0xfd9d('0xb')]({'port':0x232a});config[_0xfd9d('0xc')]=_[_0xfd9d('0xd')](config[_0xfd9d('0xc')],{'host':_0xfd9d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd9d('0xc')]));require('./chatInteraction.socket')[_0xfd9d('0xf')](socket);function respondWithRpcPromise(_0x581447,_0x1d65c1,_0x14110a){return new BPromise(function(_0x37fd28,_0x4afa27){return client[_0xfd9d('0x10')](_0x581447,_0x14110a)[_0xfd9d('0x11')](function(_0x45be73){logger[_0xfd9d('0x12')](_0xfd9d('0x13'),_0x1d65c1,_0xfd9d('0x14'));logger[_0xfd9d('0x15')](_0xfd9d('0x16'),_0x1d65c1,_0xfd9d('0x14'),JSON[_0xfd9d('0x17')](_0x45be73));if(_0x45be73[_0xfd9d('0x18')]){if(_0x45be73[_0xfd9d('0x18')][_0xfd9d('0x19')]===0x1f4){logger[_0xfd9d('0x18')](_0xfd9d('0x13'),_0x1d65c1,_0x45be73[_0xfd9d('0x18')][_0xfd9d('0x1a')]);return _0x4afa27(_0x45be73['error'][_0xfd9d('0x1a')]);}logger[_0xfd9d('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1d65c1,_0x45be73[_0xfd9d('0x18')][_0xfd9d('0x1a')]);return _0x37fd28(_0x45be73['error']['message']);}else{logger[_0xfd9d('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1d65c1,_0xfd9d('0x14'));_0x37fd28(_0x45be73[_0xfd9d('0x1b')][_0xfd9d('0x1a')]);}})[_0xfd9d('0x1c')](function(_0xa626b0){logger[_0xfd9d('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1d65c1,_0xa626b0);_0x4afa27(_0xa626b0);});});}exports[_0xfd9d('0x1d')]=function(_0x509cf3){var _0x6bb7ac=this;return new Promise(function(_0x386c6e,_0x185a3f){return db[_0xfd9d('0x1e')][_0xfd9d('0x1f')](_0x509cf3['body'],{'raw':_0x509cf3[_0xfd9d('0x20')]?_0x509cf3[_0xfd9d('0x20')][_0xfd9d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x509cf3[_0xfd9d('0x20')]?_0x509cf3[_0xfd9d('0x20')][_0xfd9d('0x22')]||null:null,'attributes':_0x509cf3[_0xfd9d('0x20')]?_0x509cf3[_0xfd9d('0x20')][_0xfd9d('0x23')]||null:null,'limit':_0x509cf3[_0xfd9d('0x20')]?_0x509cf3[_0xfd9d('0x20')][_0xfd9d('0x24')]||null:null})[_0xfd9d('0x11')](function(_0x4719eb){logger['info']('UpdateChatInteraction',_0x509cf3);logger[_0xfd9d('0x15')](_0xfd9d('0x1d'),_0x509cf3,JSON[_0xfd9d('0x17')](_0x4719eb));_0x386c6e(_0x4719eb);})['catch'](function(_0x545700){logger[_0xfd9d('0x18')](_0xfd9d('0x1d'),_0x545700[_0xfd9d('0x1a')],_0x509cf3);_0x185a3f(_0x6bb7ac[_0xfd9d('0x18')](0x1f4,_0x545700[_0xfd9d('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x2f71c2){return new Promise(function(_0x538bf7,_0x343373){return db['ChatInteraction'][_0xfd9d('0x25')]({'where':_0x2f71c2[_0xfd9d('0x20')]?_0x2f71c2['options']['where']||null:null})['then'](function(_0x13acaa){if(_0x13acaa){return _0x13acaa['addTags'](_0x2f71c2[_0xfd9d('0x26')][_0xfd9d('0x27')],_[_0xfd9d('0x28')](_0x2f71c2['body'],[_0xfd9d('0x27'),'id'])||{});}})['spread'](function(_0x4f958f){logger[_0xfd9d('0x12')](_0xfd9d('0x29'),_0x2f71c2);logger['debug'](_0xfd9d('0x29'),_0x2f71c2,JSON[_0xfd9d('0x17')](_0x4f958f));_0x538bf7(_0x4f958f);})[_0xfd9d('0x1c')](function(_0x2ac080){logger[_0xfd9d('0x18')](_0xfd9d('0x29'),_0x2ac080[_0xfd9d('0x1a')],_0x2f71c2);_0x343373(_this[_0xfd9d('0x18')](0x1f4,_0x2ac080[_0xfd9d('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index c6a7cae..555542f 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 _0x6b7e=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6b7e,0xa5));var _0xe6b7=function(_0x2495da,_0x11a291){_0x2495da=_0x2495da-0x0;var _0x15575c=_0x6b7e[_0x2495da];return _0x15575c;};'use strict';var ChatInteractionEvents=require(_0xe6b7('0x0'));var events=[_0xe6b7('0x1'),_0xe6b7('0x2'),_0xe6b7('0x3')];function createListener(_0x31568f,_0x427090){return function(_0x5bf9a5){_0x427090['emit'](_0x31568f,_0x5bf9a5);};}function removeListener(_0x44ddff,_0x19d78a){return function(){ChatInteractionEvents[_0xe6b7('0x4')](_0x44ddff,_0x19d78a);};}exports[_0xe6b7('0x5')]=function(_0xb23513){for(var _0x2b0c3f=0x0,_0xb95ee1=events[_0xe6b7('0x6')];_0x2b0c3f<_0xb95ee1;_0x2b0c3f++){var _0x3d1901=events[_0x2b0c3f];var _0x4e0698=createListener(_0xe6b7('0x7')+_0x3d1901,_0xb23513);ChatInteractionEvents['on'](_0x3d1901,_0x4e0698);}};
\ No newline at end of file
+var _0xda3c=['./chatInteraction.events','save','remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0xda3c,0x1b9));var _0xcda3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xda3c[_0x40a045];return _0x1a687c;};'use strict';var ChatInteractionEvents=require(_0xcda3('0x0'));var events=[_0xcda3('0x1'),_0xcda3('0x2'),_0xcda3('0x3')];function createListener(_0x4ab139,_0x503200){return function(_0x5f0c7f){_0x503200[_0xcda3('0x4')](_0x4ab139,_0x5f0c7f);};}function removeListener(_0x387dc1,_0x2626ae){return function(){ChatInteractionEvents[_0xcda3('0x5')](_0x387dc1,_0x2626ae);};}exports[_0xcda3('0x6')]=function(_0x1f3de6){for(var _0x2fe7c4=0x0,_0x5d600f=events[_0xcda3('0x7')];_0x2fe7c4<_0x5d600f;_0x2fe7c4++){var _0x39ebe6=events[_0x2fe7c4];var _0x3ab5a2=createListener(_0xcda3('0x8')+_0x39ebe6,_0x1f3de6);ChatInteractionEvents['on'](_0x39ebe6,_0x3ab5a2);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index e00f745..3580014 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 _0xf0d2=['addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','destroy','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0d2,0x130));var _0x2f0d=function(_0x1d4f2a,_0x13a26c){_0x1d4f2a=_0x1d4f2a-0x0;var _0x526d8b=_0xf0d2[_0x1d4f2a];return _0x526d8b;};'use strict';var multer=require('multer');var util=require(_0x2f0d('0x0'));var path=require(_0x2f0d('0x1'));var timeout=require(_0x2f0d('0x2'));var express=require(_0x2f0d('0x3'));var router=express[_0x2f0d('0x4')]();var fs_extra=require(_0x2f0d('0x5'));var auth=require(_0x2f0d('0x6'));var interaction=require(_0x2f0d('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x2f0d('0x8')]('/',auth[_0x2f0d('0x9')](),controller[_0x2f0d('0xa')]);router[_0x2f0d('0x8')](_0x2f0d('0xb'),auth[_0x2f0d('0x9')](),controller['describe']);router[_0x2f0d('0x8')](_0x2f0d('0xc'),auth[_0x2f0d('0xd')](),controller[_0x2f0d('0xe')]);router[_0x2f0d('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x2f0d('0xf')]);router[_0x2f0d('0x8')]('/:id/messages',auth[_0x2f0d('0x9')](),controller[_0x2f0d('0x10')]);router['get'](_0x2f0d('0x11'),auth[_0x2f0d('0xd')](),controller['getMyMessages']);router[_0x2f0d('0x8')](_0x2f0d('0x12'),auth[_0x2f0d('0x9')](),controller[_0x2f0d('0x13')]);router['post']('/',auth[_0x2f0d('0x9')](),controller[_0x2f0d('0x14')]);router[_0x2f0d('0x15')](_0x2f0d('0x16'),auth[_0x2f0d('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3948a7,_0x43c695,_0x388cc5){_0x388cc5(null,path[_0x2f0d('0x17')](config[_0x2f0d('0x18')],_0x2f0d('0x19')));},'filename':function(_0x502f11,_0x3bb1be,_0x12611b){_0x12611b(null,util[_0x2f0d('0x1a')]('%s-%s',Date[_0x2f0d('0x1b')](),_0x3bb1be[_0x2f0d('0x1c')][_0x2f0d('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2f0d('0x15')](_0x2f0d('0x1e'),upload[_0x2f0d('0x1f')](_0x2f0d('0x20')),controller[_0x2f0d('0x21')]);router['post']('/:id/messages',auth[_0x2f0d('0xd')](),controller[_0x2f0d('0x22')]);router[_0x2f0d('0x15')](_0x2f0d('0x23'),auth['isAuthenticated'](),interaction[_0x2f0d('0x24')](_0x2f0d('0x25'),_0x2f0d('0x26')),controller[_0x2f0d('0x27')]);router['put'](_0x2f0d('0xc'),auth['isAuthenticated'](),interaction[_0x2f0d('0x24')](_0x2f0d('0x25'),'chatinteraction:update'),controller['update']);router[_0x2f0d('0x28')](_0x2f0d('0x29'),controller[_0x2f0d('0x2a')]);router[_0x2f0d('0x28')](_0x2f0d('0x2b'),auth[_0x2f0d('0xd')](),controller[_0x2f0d('0x2c')]);router[_0x2f0d('0x28')](_0x2f0d('0x2d'),controller[_0x2f0d('0x2e')]);router['delete'](_0x2f0d('0xc'),auth[_0x2f0d('0x9')](),interaction[_0x2f0d('0x24')](_0x2f0d('0x25'),'chatinteraction:destroy'),controller[_0x2f0d('0x2f')]);router['delete'](_0x2f0d('0x23'),auth['isAuthenticated'](),controller[_0x2f0d('0x30')]);module['exports']=router;
\ No newline at end of file
+var _0x0358=['format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','/:id/messages','addMessage','/:id/tags','put','tracked','chatinteraction:update','update','abandon','chat','chatinteraction:destroy','removeTags','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','/:id','isChatInteractionAuthorized','attachmentDownload','isAuthenticated','getMessages','getMyMessages','/:id/download','create','post','/:id/vidaoo','root','server/files/attachments/'];(function(_0x53d0f2,_0x461fff){var _0x4039fe=function(_0x1da59f){while(--_0x1da59f){_0x53d0f2['push'](_0x53d0f2['shift']());}};_0x4039fe(++_0x461fff);}(_0x0358,0x8a));var _0x8035=function(_0x47d68f,_0x767023){_0x47d68f=_0x47d68f-0x0;var _0x4ddfaa=_0x0358[_0x47d68f];return _0x4ddfaa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8035('0x0'));var timeout=require(_0x8035('0x1'));var express=require('express');var router=express[_0x8035('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8035('0x3'));var interaction=require(_0x8035('0x4'));var config=require(_0x8035('0x5'));var controller=require(_0x8035('0x6'));router[_0x8035('0x7')]('/',auth['isAuthenticated'](),controller[_0x8035('0x8')]);router[_0x8035('0x7')](_0x8035('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x8035('0x7')](_0x8035('0xa'),auth[_0x8035('0xb')](),controller['show']);router[_0x8035('0x7')]('/:id/attachment_download',auth[_0x8035('0xb')](),controller[_0x8035('0xc')]);router['get']('/:id/messages',auth[_0x8035('0xd')](),controller[_0x8035('0xe')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x8035('0xf')]);router[_0x8035('0x7')](_0x8035('0x10'),auth[_0x8035('0xd')](),controller['download']);router['post']('/',auth[_0x8035('0xd')](),controller[_0x8035('0x11')]);router[_0x8035('0x12')](_0x8035('0x13'),auth[_0x8035('0xd')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa56158,_0x479171,_0x4b5a4a){_0x4b5a4a(null,path['join'](config[_0x8035('0x14')],_0x8035('0x15')));},'filename':function(_0xaf5a68,_0x18423f,_0x458481){_0x458481(null,util[_0x8035('0x16')](_0x8035('0x17'),Date['now'](),_0x18423f[_0x8035('0x18')][_0x8035('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8035('0x12')](_0x8035('0x1a'),upload[_0x8035('0x1b')](_0x8035('0x1c')),controller['attachmentUpload']);router[_0x8035('0x12')](_0x8035('0x1d'),auth[_0x8035('0xb')](),controller[_0x8035('0x1e')]);router[_0x8035('0x12')](_0x8035('0x1f'),auth[_0x8035('0xd')](),interaction['tracked']('chat','chatinteraction:addtags'),controller['addTags']);router[_0x8035('0x20')]('/:id',auth[_0x8035('0xd')](),interaction[_0x8035('0x21')]('chat',_0x8035('0x22')),controller[_0x8035('0x23')]);router['put']('/:id/custom_update',controller['customUpdate']);router['put']('/:id/abandon',auth[_0x8035('0xb')](),controller[_0x8035('0x24')]);router['put']('/:id/close',controller['close']);router['delete'](_0x8035('0xa'),auth['isAuthenticated'](),interaction[_0x8035('0x21')](_0x8035('0x25'),_0x8035('0x26')),controller['destroy']);router['delete'](_0x8035('0x1f'),auth['isAuthenticated'](),controller[_0x8035('0x27')]);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 1ad6c9a..31fc503 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 _0x22f5=['exports','medium','BOOLEAN','INTEGER'];(function(_0xb499da,_0x2e8849){var _0x482dd6=function(_0x2b86ca){while(--_0x2b86ca){_0xb499da['push'](_0xb499da['shift']());}};_0x482dd6(++_0x2e8849);}(_0x22f5,0x70));var _0x522f=function(_0x797af1,_0x23abb1){_0x797af1=_0x797af1-0x0;var _0x4cef9c=_0x22f5[_0x797af1];return _0x4cef9c;};'use strict';var Sequelize=require('sequelize');module[_0x522f('0x0')]={'body':{'type':Sequelize['TEXT'](_0x522f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x522f('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x522f('0x3')]}};
\ No newline at end of file
+var _0x07ed=['exports','medium','INTEGER','sequelize'];(function(_0x55f8fa,_0x616528){var _0x20a9a9=function(_0x337bb5){while(--_0x337bb5){_0x55f8fa['push'](_0x55f8fa['shift']());}};_0x20a9a9(++_0x616528);}(_0x07ed,0x6f));var _0xd07e=function(_0x2ab8f4,_0x192abd){_0x2ab8f4=_0x2ab8f4-0x0;var _0xf1bee6=_0x07ed[_0x2ab8f4];return _0xf1bee6;};'use strict';var Sequelize=require(_0xd07e('0x0'));module[_0xd07e('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd07e('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd07e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 0a28ba2..1f25bf8 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 _0xac84=['describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','-createdAt','all','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','sort','where','pick','merge','filter','options','include','rows','show','keys','includeAll','find','catch','body','params'];(function(_0x4811ee,_0x1d5ce9){var _0x354c84=function(_0x5184e3){while(--_0x5184e3){_0x4811ee['push'](_0x4811ee['shift']());}};_0x354c84(++_0x1d5ce9);}(_0xac84,0x15a));var _0x4ac8=function(_0x2494f5,_0x1f1d3c){_0x2494f5=_0x2494f5-0x0;var _0x5c60a4=_0xac84[_0x2494f5];return _0x5c60a4;};'use strict';var emlformat=require(_0x4ac8('0x0'));var rimraf=require(_0x4ac8('0x1'));var zipdir=require(_0x4ac8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4ac8('0x3'));var BPromise=require(_0x4ac8('0x4'));var Mustache=require(_0x4ac8('0x5'));var util=require(_0x4ac8('0x6'));var path=require(_0x4ac8('0x7'));var sox=require(_0x4ac8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ac8('0x9'));var _=require('lodash');var squel=require(_0x4ac8('0xa'));var crypto=require(_0x4ac8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4ac8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4ac8('0xd'));var Papa=require('papaparse');var Redis=require(_0x4ac8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4ac8('0xf'));var as=require(_0x4ac8('0x10'));var hardwareService=require(_0x4ac8('0x11'));var logger=require(_0x4ac8('0x12'))(_0x4ac8('0x13'));var utils=require(_0x4ac8('0x14'));var config=require(_0x4ac8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4ac8('0x16')]=_[_0x4ac8('0x17')](config[_0x4ac8('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ac8('0x16')]));require(_0x4ac8('0x18'))[_0x4ac8('0x19')](socket);function respondWithStatusCode(_0x118e4f,_0x561850){_0x561850=_0x561850||0xcc;return function(_0x25bc1e){if(_0x25bc1e){return _0x118e4f[_0x4ac8('0x1a')](_0x561850);}return _0x118e4f[_0x4ac8('0x1b')](_0x561850)[_0x4ac8('0x1c')]();};}function respondWithResult(_0x1378c1,_0x1c3889){_0x1c3889=_0x1c3889||0xc8;return function(_0x1f086d){if(_0x1f086d){return _0x1378c1[_0x4ac8('0x1b')](_0x1c3889)[_0x4ac8('0x1d')](_0x1f086d);}};}function respondWithFilteredResult(_0x28dad6,_0x5d7a6e){return function(_0x2713f6){if(_0x2713f6){var _0x4b7a7e=typeof _0x5d7a6e['offset']===_0x4ac8('0x1e')&&typeof _0x5d7a6e[_0x4ac8('0x1f')]===_0x4ac8('0x1e');var _0x2d7e2a=_0x2713f6[_0x4ac8('0x20')];var _0x505553=_0x4b7a7e?0x0:_0x5d7a6e[_0x4ac8('0x21')];var _0x4ada6a=_0x4b7a7e?_0x2713f6[_0x4ac8('0x20')]:_0x5d7a6e[_0x4ac8('0x21')]+_0x5d7a6e[_0x4ac8('0x1f')];var _0x4adc7a;if(_0x4ada6a>=_0x2d7e2a){_0x4ada6a=_0x2d7e2a;_0x4adc7a=0xc8;}else{_0x4adc7a=0xce;}_0x28dad6[_0x4ac8('0x1b')](_0x4adc7a);return _0x28dad6[_0x4ac8('0x22')](_0x4ac8('0x23'),_0x505553+'-'+_0x4ada6a+'/'+_0x2d7e2a)[_0x4ac8('0x1d')](_0x2713f6);}return null;};}function patchUpdates(_0x3ea875){return function(_0x116d5f){try{jsonpatch[_0x4ac8('0x24')](_0x116d5f,_0x3ea875,!![]);}catch(_0x51a575){return BPromise[_0x4ac8('0x25')](_0x51a575);}return _0x116d5f[_0x4ac8('0x26')]();};}function saveUpdates(_0x5e39a6,_0x24a0a1){return function(_0x4f0069){if(_0x4f0069){return _0x4f0069[_0x4ac8('0x27')](_0x5e39a6)[_0x4ac8('0x28')](function(_0x419907){return _0x419907;});}return null;};}function removeEntity(_0x5fca00,_0x206faf){return function(_0x30a0fb){if(_0x30a0fb){return _0x30a0fb[_0x4ac8('0x29')]()[_0x4ac8('0x28')](function(){_0x5fca00[_0x4ac8('0x1b')](0xcc)[_0x4ac8('0x1c')]();});}};}function handleEntityNotFound(_0x5738e4,_0x13730d){return function(_0x1e15a7){if(!_0x1e15a7){_0x5738e4[_0x4ac8('0x1a')](0x194);}return _0x1e15a7;};}function handleError(_0x3c05fd,_0x465a95){_0x465a95=_0x465a95||0x1f4;return function(_0x46a41e){logger['error'](_0x46a41e[_0x4ac8('0x2a')]);if(_0x46a41e[_0x4ac8('0x2b')]){delete _0x46a41e[_0x4ac8('0x2b')];}_0x3c05fd['status'](_0x465a95)[_0x4ac8('0x2c')](_0x46a41e);};}exports[_0x4ac8('0x2d')]=function(_0x448b60,_0x5048af){var _0x1f6d5e={},_0x1daf4a={},_0x11cfaf={'count':0x0,'rows':[]};var _0x13b078=_[_0x4ac8('0x2e')](db[_0x4ac8('0x2f')][_0x4ac8('0x30')],function(_0x53fd0f){return{'name':_0x53fd0f[_0x4ac8('0x31')],'type':_0x53fd0f[_0x4ac8('0x32')][_0x4ac8('0x33')]};});_0x1daf4a[_0x4ac8('0x34')]=_[_0x4ac8('0x2e')](_0x13b078,_0x4ac8('0x2b'));_0x1daf4a[_0x4ac8('0x35')]=_['keys'](_0x448b60[_0x4ac8('0x35')]);_0x1daf4a[_0x4ac8('0x36')]=_[_0x4ac8('0x37')](_0x1daf4a[_0x4ac8('0x34')],_0x1daf4a[_0x4ac8('0x35')]);_0x1f6d5e['attributes']=_['intersection'](_0x1daf4a[_0x4ac8('0x34')],qs[_0x4ac8('0x38')](_0x448b60[_0x4ac8('0x35')][_0x4ac8('0x38')]));_0x1f6d5e[_0x4ac8('0x39')]=_0x1f6d5e[_0x4ac8('0x39')][_0x4ac8('0x3a')]?_0x1f6d5e[_0x4ac8('0x39')]:_0x1daf4a[_0x4ac8('0x34')];if(!_0x448b60[_0x4ac8('0x35')]['hasOwnProperty']('nolimit')){_0x1f6d5e[_0x4ac8('0x1f')]=qs['limit'](_0x448b60[_0x4ac8('0x35')][_0x4ac8('0x1f')]);_0x1f6d5e[_0x4ac8('0x21')]=qs[_0x4ac8('0x21')](_0x448b60['query'][_0x4ac8('0x21')]);}_0x1f6d5e['order']=qs[_0x4ac8('0x3b')](_0x448b60[_0x4ac8('0x35')][_0x4ac8('0x3b')]);_0x1f6d5e[_0x4ac8('0x3c')]=qs['filters'](_[_0x4ac8('0x3d')](_0x448b60[_0x4ac8('0x35')],_0x1daf4a[_0x4ac8('0x36')]),_0x13b078);if(_0x448b60['query']['filter']){_0x1f6d5e[_0x4ac8('0x3c')]=_[_0x4ac8('0x3e')](_0x1f6d5e[_0x4ac8('0x3c')],{'$or':_[_0x4ac8('0x2e')](_0x13b078,function(_0x1b7587){if(_0x1b7587[_0x4ac8('0x32')]!=='VIRTUAL'){var _0x26527a={};_0x26527a[_0x1b7587[_0x4ac8('0x2b')]]={'$like':'%'+_0x448b60[_0x4ac8('0x35')][_0x4ac8('0x3f')]+'%'};return _0x26527a;}})});}_0x1f6d5e=_[_0x4ac8('0x3e')]({},_0x1f6d5e,_0x448b60[_0x4ac8('0x40')]);var _0x5567c3={'where':_0x1f6d5e['where']};return db[_0x4ac8('0x2f')]['count'](_0x5567c3)[_0x4ac8('0x28')](function(_0x17c333){_0x11cfaf[_0x4ac8('0x20')]=_0x17c333;if(_0x448b60[_0x4ac8('0x35')]['includeAll']){_0x1f6d5e[_0x4ac8('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x1f6d5e);})[_0x4ac8('0x28')](function(_0x5b51f2){_0x11cfaf[_0x4ac8('0x42')]=_0x5b51f2;return _0x11cfaf;})[_0x4ac8('0x28')](respondWithFilteredResult(_0x5048af,_0x1f6d5e))['catch'](handleError(_0x5048af,null));};exports[_0x4ac8('0x43')]=function(_0x4f704c,_0x445384){var _0x24c225={'raw':!![],'where':{'id':_0x4f704c['params']['id']}},_0xf0b157={};_0xf0b157['model']=_[_0x4ac8('0x44')](db[_0x4ac8('0x2f')][_0x4ac8('0x30')]);_0xf0b157[_0x4ac8('0x35')]=_['keys'](_0x4f704c[_0x4ac8('0x35')]);_0xf0b157[_0x4ac8('0x36')]=_[_0x4ac8('0x37')](_0xf0b157[_0x4ac8('0x34')],_0xf0b157[_0x4ac8('0x35')]);_0x24c225[_0x4ac8('0x39')]=_['intersection'](_0xf0b157[_0x4ac8('0x34')],qs[_0x4ac8('0x38')](_0x4f704c[_0x4ac8('0x35')][_0x4ac8('0x38')]));_0x24c225[_0x4ac8('0x39')]=_0x24c225[_0x4ac8('0x39')]['length']?_0x24c225[_0x4ac8('0x39')]:_0xf0b157[_0x4ac8('0x34')];if(_0x4f704c[_0x4ac8('0x35')][_0x4ac8('0x45')]){_0x24c225[_0x4ac8('0x41')]=[{'all':!![]}];}_0x24c225=_['merge']({},_0x24c225,_0x4f704c[_0x4ac8('0x40')]);return db['ChatInternalMessage'][_0x4ac8('0x46')](_0x24c225)['then'](handleEntityNotFound(_0x445384,null))['then'](respondWithResult(_0x445384,null))[_0x4ac8('0x47')](handleError(_0x445384,null));};exports['create']=function(_0x1404ff,_0x3402e4){return db[_0x4ac8('0x2f')]['create'](_0x1404ff[_0x4ac8('0x48')],{})[_0x4ac8('0x28')](respondWithResult(_0x3402e4,0xc9))['catch'](handleError(_0x3402e4,null));};exports['update']=function(_0x5e0e16,_0x96ca89){if(_0x5e0e16[_0x4ac8('0x48')]['id']){delete _0x5e0e16[_0x4ac8('0x48')]['id'];}return db['ChatInternalMessage'][_0x4ac8('0x46')]({'where':{'id':_0x5e0e16[_0x4ac8('0x49')]['id']}})[_0x4ac8('0x28')](handleEntityNotFound(_0x96ca89,null))[_0x4ac8('0x28')](saveUpdates(_0x5e0e16['body'],null))[_0x4ac8('0x28')](respondWithResult(_0x96ca89,null))[_0x4ac8('0x47')](handleError(_0x96ca89,null));};exports[_0x4ac8('0x29')]=function(_0x825a42,_0x530d29){return db[_0x4ac8('0x2f')][_0x4ac8('0x46')]({'where':{'id':_0x825a42[_0x4ac8('0x49')]['id']}})[_0x4ac8('0x28')](handleEntityNotFound(_0x530d29,null))[_0x4ac8('0x28')](removeEntity(_0x530d29,null))[_0x4ac8('0x47')](handleError(_0x530d29,null));};exports[_0x4ac8('0x4a')]=function(_0x363bbe,_0x15eca2){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x15eca2,null))[_0x4ac8('0x47')](handleError(_0x15eca2,null));};function wrapUser(_0x3dccb1){return function(_0x258f80){var _0x1042bf=_0x3dccb1[_0x4ac8('0x4b')]({'plain':!![]});_0x1042bf[_0x4ac8('0x4c')]=[];if(_0x258f80){_0x1042bf[_0x4ac8('0x4d')]=_0x258f80[_0x4ac8('0x4e')];_0x1042bf[_0x4ac8('0x4f')]=_0x258f80;}else{_0x1042bf[_0x4ac8('0x4d')]=moment(0x0)['format'](_0x4ac8('0x50'));_0x1042bf[_0x4ac8('0x4f')]={};}return _0x1042bf;};}exports[_0x4ac8('0x51')]=function(_0x35b61,_0x3cc5d3,_0x255b1f){var _0x3c4efc=[];return db[_0x4ac8('0x52')][_0x4ac8('0x53')]({'where':{'role':[_0x4ac8('0x54'),_0x4ac8('0x55'),_0x4ac8('0x56')]},'attributes':['id',_0x4ac8('0x57'),_0x4ac8('0x2b'),'role',_0x4ac8('0x58'),_0x4ac8('0x59'),_0x4ac8('0x5a'),_0x4ac8('0x5b'),'allowmessenger','showWebBar'],'order':qs[_0x4ac8('0x3b')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x4ac8('0x5c'),'attributes':['id',_0x4ac8('0x2b'),_0x4ac8('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x47af1d){if(_0x47af1d){var _0x49f852=_0x35b61[_0x4ac8('0x56')][_0x4ac8('0x4b')]({'plain':!![]});if(!_0x49f852)throw new Error(_0x4ac8('0x5d'));if(_0x49f852[_0x4ac8('0x5e')]==='user'){return db[_0x4ac8('0x5f')][_0x4ac8('0x46')]({'where':{'name':_0x4ac8('0x60'),'userProfileId':_0x49f852[_0x4ac8('0x61')]},'raw':!![]})['then'](function(_0x4812c6){if(_0x4812c6){if(_0x4812c6[_0x4ac8('0x62')]===0x0){return db[_0x4ac8('0x63')][_0x4ac8('0x53')]({'where':{'sectionId':_0x4812c6['id']},'raw':!![]})[_0x4ac8('0x28')](function(_0x103c6e){var _0x38802b=[];if(_[_0x4ac8('0x64')](_0x103c6e)){_0x38802b=_[_0x4ac8('0x3f')](_0x47af1d,function(_0x372f4b){if(_0x372f4b['role']!==_0x4ac8('0x54')){return _0x372f4b;}});return _0x38802b;}else{for(var _0x59766d=0x0;_0x59766d<_0x47af1d[_0x4ac8('0x3a')];_0x59766d++){var _0x33f426=_0x47af1d[_0x59766d];if(_0x33f426[_0x4ac8('0x5e')]==='agent'){var _0x1c438f=_[_0x4ac8('0x46')](_0x103c6e,function(_0x5c60ba){return _0x5c60ba[_0x4ac8('0x65')]===_0x33f426['id'];});if(_0x1c438f)_0x38802b[_0x4ac8('0x66')](_0x33f426);}else{_0x38802b[_0x4ac8('0x66')](_0x33f426);}}return _0x38802b;}});}else{return _0x47af1d;}}else{var _0x4899b7=_[_0x4ac8('0x3f')](_0x47af1d,function(_0x495b32){if(_0x495b32[_0x4ac8('0x5e')]!==_0x4ac8('0x54')){return _0x495b32;}});return _0x4899b7;}});}else{return _0x47af1d;}}})['then'](function(_0x5515d2){var _0x428dc1=[];if(_0x5515d2){_0x3c4efc=_0x5515d2;for(var _0x12f6f6=0x0;_0x12f6f6<_0x5515d2[_0x4ac8('0x3a')];_0x12f6f6+=0x1){_0x3c4efc[_0x12f6f6][_0x4ac8('0x4c')]=[];_0x428dc1[_0x4ac8('0x66')](db[_0x4ac8('0x2f')][_0x4ac8('0x46')]({'where':{'FromId':[_0x35b61[_0x4ac8('0x56')]['id'],_0x5515d2[_0x12f6f6]['id']],'ToId':[_0x35b61['user']['id'],_0x5515d2[_0x12f6f6]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId','read',_0x4ac8('0x48')],'order':qs[_0x4ac8('0x3b')](_0x4ac8('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4ac8('0x28')](wrapUser(_0x5515d2[_0x12f6f6])));}return BPromise[_0x4ac8('0x68')](_0x428dc1);}return[];})[_0x4ac8('0x28')](function(_0x4a9c01){return{'rows':_0x4a9c01,'count':_0x4a9c01[_0x4ac8('0x3a')]};})[_0x4ac8('0x28')](respondWithResult(_0x3cc5d3,null))[_0x4ac8('0x47')](handleError(_0x3cc5d3,null));};
\ No newline at end of file
+var _0x19ee=['-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','catch','show','params','find','create','update','body','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','messages','push','FromId','ToId'];(function(_0x557507,_0x197b78){var _0x4c07d6=function(_0x524f78){while(--_0x524f78){_0x557507['push'](_0x557507['shift']());}};_0x4c07d6(++_0x197b78);}(_0x19ee,0x1c2));var _0xe19e=function(_0x543c51,_0xff0084){_0x543c51=_0x543c51-0x0;var _0x360555=_0x19ee[_0x543c51];return _0x360555;};'use strict';var emlformat=require(_0xe19e('0x0'));var rimraf=require(_0xe19e('0x1'));var zipdir=require(_0xe19e('0x2'));var jsonpatch=require(_0xe19e('0x3'));var rp=require(_0xe19e('0x4'));var moment=require(_0xe19e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe19e('0x6'));var path=require(_0xe19e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe19e('0x8'));var _=require('lodash');var squel=require(_0xe19e('0x9'));var crypto=require(_0xe19e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe19e('0xb'));var toCsv=require(_0xe19e('0xc'));var querystring=require(_0xe19e('0xd'));var Papa=require(_0xe19e('0xe'));var Redis=require(_0xe19e('0xf'));var authService=require(_0xe19e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe19e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe19e('0x12'))(_0xe19e('0x13'));var utils=require(_0xe19e('0x14'));var config=require(_0xe19e('0x15'));var licenseUtil=require(_0xe19e('0x16'));var db=require('../../mysqldb')['db'];config[_0xe19e('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe19e('0x18'))(new Redis(config[_0xe19e('0x17')]));require('./chatInternalMessage.socket')[_0xe19e('0x19')](socket);function respondWithStatusCode(_0x3b66f7,_0x17987b){_0x17987b=_0x17987b||0xcc;return function(_0x2cd82c){if(_0x2cd82c){return _0x3b66f7[_0xe19e('0x1a')](_0x17987b);}return _0x3b66f7[_0xe19e('0x1b')](_0x17987b)[_0xe19e('0x1c')]();};}function respondWithResult(_0x4a1e43,_0x4bfe6e){_0x4bfe6e=_0x4bfe6e||0xc8;return function(_0x2e3840){if(_0x2e3840){return _0x4a1e43['status'](_0x4bfe6e)['json'](_0x2e3840);}};}function respondWithFilteredResult(_0x192a48,_0x498ea4){return function(_0x29bb1a){if(_0x29bb1a){var _0x337e45=typeof _0x498ea4[_0xe19e('0x1d')]===_0xe19e('0x1e')&&typeof _0x498ea4[_0xe19e('0x1f')]===_0xe19e('0x1e');var _0x31e334=_0x29bb1a[_0xe19e('0x20')];var _0x49ec9f=_0x337e45?0x0:_0x498ea4[_0xe19e('0x1d')];var _0xe707d0=_0x337e45?_0x29bb1a[_0xe19e('0x20')]:_0x498ea4[_0xe19e('0x1d')]+_0x498ea4[_0xe19e('0x1f')];var _0x3c49dd;if(_0xe707d0>=_0x31e334){_0xe707d0=_0x31e334;_0x3c49dd=0xc8;}else{_0x3c49dd=0xce;}_0x192a48['status'](_0x3c49dd);return _0x192a48[_0xe19e('0x21')](_0xe19e('0x22'),_0x49ec9f+'-'+_0xe707d0+'/'+_0x31e334)[_0xe19e('0x23')](_0x29bb1a);}return null;};}function patchUpdates(_0x43fe95){return function(_0x4d8e67){try{jsonpatch[_0xe19e('0x24')](_0x4d8e67,_0x43fe95,!![]);}catch(_0x1b808e){return BPromise[_0xe19e('0x25')](_0x1b808e);}return _0x4d8e67[_0xe19e('0x26')]();};}function saveUpdates(_0x4c7d58,_0x18e890){return function(_0x2a1981){if(_0x2a1981){return _0x2a1981['update'](_0x4c7d58)['then'](function(_0x55ddec){return _0x55ddec;});}return null;};}function removeEntity(_0x3560f2,_0x93841d){return function(_0x1534f7){if(_0x1534f7){return _0x1534f7[_0xe19e('0x27')]()[_0xe19e('0x28')](function(){_0x3560f2[_0xe19e('0x1b')](0xcc)[_0xe19e('0x1c')]();});}};}function handleEntityNotFound(_0x2c3539,_0x50c17d){return function(_0x2fb703){if(!_0x2fb703){_0x2c3539[_0xe19e('0x1a')](0x194);}return _0x2fb703;};}function handleError(_0x5e7247,_0x213ab1){_0x213ab1=_0x213ab1||0x1f4;return function(_0xf3c4f3){logger[_0xe19e('0x29')](_0xf3c4f3[_0xe19e('0x2a')]);if(_0xf3c4f3['name']){delete _0xf3c4f3[_0xe19e('0x2b')];}_0x5e7247['status'](_0x213ab1)[_0xe19e('0x2c')](_0xf3c4f3);};}exports[_0xe19e('0x2d')]=function(_0x1320e3,_0x4fc526){var _0x2dd192={},_0x5153f7={},_0x1b0cb1={'count':0x0,'rows':[]};var _0x5101a8=_[_0xe19e('0x2e')](db['ChatInternalMessage'][_0xe19e('0x2f')],function(_0x2ac646){return{'name':_0x2ac646[_0xe19e('0x30')],'type':_0x2ac646['type'][_0xe19e('0x31')]};});_0x5153f7[_0xe19e('0x32')]=_[_0xe19e('0x2e')](_0x5101a8,_0xe19e('0x2b'));_0x5153f7[_0xe19e('0x33')]=_[_0xe19e('0x34')](_0x1320e3[_0xe19e('0x33')]);_0x5153f7[_0xe19e('0x35')]=_[_0xe19e('0x36')](_0x5153f7[_0xe19e('0x32')],_0x5153f7['query']);_0x2dd192[_0xe19e('0x37')]=_[_0xe19e('0x36')](_0x5153f7[_0xe19e('0x32')],qs[_0xe19e('0x38')](_0x1320e3[_0xe19e('0x33')]['fields']));_0x2dd192[_0xe19e('0x37')]=_0x2dd192[_0xe19e('0x37')][_0xe19e('0x39')]?_0x2dd192[_0xe19e('0x37')]:_0x5153f7[_0xe19e('0x32')];if(!_0x1320e3[_0xe19e('0x33')][_0xe19e('0x3a')](_0xe19e('0x3b'))){_0x2dd192[_0xe19e('0x1f')]=qs['limit'](_0x1320e3[_0xe19e('0x33')][_0xe19e('0x1f')]);_0x2dd192[_0xe19e('0x1d')]=qs[_0xe19e('0x1d')](_0x1320e3[_0xe19e('0x33')][_0xe19e('0x1d')]);}_0x2dd192[_0xe19e('0x3c')]=qs[_0xe19e('0x3d')](_0x1320e3[_0xe19e('0x33')][_0xe19e('0x3d')]);_0x2dd192[_0xe19e('0x3e')]=qs[_0xe19e('0x35')](_[_0xe19e('0x3f')](_0x1320e3[_0xe19e('0x33')],_0x5153f7['filters']),_0x5101a8);if(_0x1320e3[_0xe19e('0x33')][_0xe19e('0x40')]){_0x2dd192[_0xe19e('0x3e')]=_[_0xe19e('0x41')](_0x2dd192[_0xe19e('0x3e')],{'$or':_[_0xe19e('0x2e')](_0x5101a8,function(_0xae93c8){if(_0xae93c8[_0xe19e('0x42')]!==_0xe19e('0x43')){var _0x255b9c={};_0x255b9c[_0xae93c8[_0xe19e('0x2b')]]={'$like':'%'+_0x1320e3[_0xe19e('0x33')][_0xe19e('0x40')]+'%'};return _0x255b9c;}})});}_0x2dd192=_[_0xe19e('0x41')]({},_0x2dd192,_0x1320e3[_0xe19e('0x44')]);var _0x1e1512={'where':_0x2dd192['where']};return db[_0xe19e('0x45')][_0xe19e('0x20')](_0x1e1512)[_0xe19e('0x28')](function(_0x408957){_0x1b0cb1['count']=_0x408957;if(_0x1320e3[_0xe19e('0x33')][_0xe19e('0x46')]){_0x2dd192[_0xe19e('0x47')]=[{'all':!![]}];}return db[_0xe19e('0x45')][_0xe19e('0x48')](_0x2dd192);})[_0xe19e('0x28')](function(_0x4c1060){_0x1b0cb1['rows']=_0x4c1060;return _0x1b0cb1;})[_0xe19e('0x28')](respondWithFilteredResult(_0x4fc526,_0x2dd192))[_0xe19e('0x49')](handleError(_0x4fc526,null));};exports[_0xe19e('0x4a')]=function(_0x4c4340,_0x35c15b){var _0x5b80b7={'raw':!![],'where':{'id':_0x4c4340[_0xe19e('0x4b')]['id']}},_0x3c8c00={};_0x3c8c00[_0xe19e('0x32')]=_['keys'](db[_0xe19e('0x45')][_0xe19e('0x2f')]);_0x3c8c00[_0xe19e('0x33')]=_['keys'](_0x4c4340[_0xe19e('0x33')]);_0x3c8c00['filters']=_[_0xe19e('0x36')](_0x3c8c00[_0xe19e('0x32')],_0x3c8c00['query']);_0x5b80b7['attributes']=_[_0xe19e('0x36')](_0x3c8c00['model'],qs[_0xe19e('0x38')](_0x4c4340[_0xe19e('0x33')][_0xe19e('0x38')]));_0x5b80b7[_0xe19e('0x37')]=_0x5b80b7[_0xe19e('0x37')][_0xe19e('0x39')]?_0x5b80b7[_0xe19e('0x37')]:_0x3c8c00[_0xe19e('0x32')];if(_0x4c4340[_0xe19e('0x33')]['includeAll']){_0x5b80b7[_0xe19e('0x47')]=[{'all':!![]}];}_0x5b80b7=_['merge']({},_0x5b80b7,_0x4c4340[_0xe19e('0x44')]);return db[_0xe19e('0x45')][_0xe19e('0x4c')](_0x5b80b7)['then'](handleEntityNotFound(_0x35c15b,null))[_0xe19e('0x28')](respondWithResult(_0x35c15b,null))[_0xe19e('0x49')](handleError(_0x35c15b,null));};exports[_0xe19e('0x4d')]=function(_0x548bc3,_0x3dd774){return db[_0xe19e('0x45')][_0xe19e('0x4d')](_0x548bc3['body'],{})[_0xe19e('0x28')](respondWithResult(_0x3dd774,0xc9))['catch'](handleError(_0x3dd774,null));};exports[_0xe19e('0x4e')]=function(_0x28d440,_0x569bd9){if(_0x28d440[_0xe19e('0x4f')]['id']){delete _0x28d440[_0xe19e('0x4f')]['id'];}return db[_0xe19e('0x45')]['find']({'where':{'id':_0x28d440[_0xe19e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x569bd9,null))[_0xe19e('0x28')](saveUpdates(_0x28d440[_0xe19e('0x4f')],null))[_0xe19e('0x28')](respondWithResult(_0x569bd9,null))[_0xe19e('0x49')](handleError(_0x569bd9,null));};exports['destroy']=function(_0x47ca51,_0x27a178){return db[_0xe19e('0x45')]['find']({'where':{'id':_0x47ca51[_0xe19e('0x4b')]['id']}})[_0xe19e('0x28')](handleEntityNotFound(_0x27a178,null))['then'](removeEntity(_0x27a178,null))[_0xe19e('0x49')](handleError(_0x27a178,null));};exports['describe']=function(_0x43daed,_0x53b6f5){return db[_0xe19e('0x45')][_0xe19e('0x50')]()['then'](respondWithResult(_0x53b6f5,null))[_0xe19e('0x49')](handleError(_0x53b6f5,null));};function wrapUser(_0x5b96cc){return function(_0x253802){var _0x951bee=_0x5b96cc[_0xe19e('0x51')]({'plain':!![]});_0x951bee['messages']=[];if(_0x253802){_0x951bee[_0xe19e('0x52')]=_0x253802[_0xe19e('0x53')];_0x951bee[_0xe19e('0x54')]=_0x253802;}else{_0x951bee['lastMessageAt']=moment(0x0)['format'](_0xe19e('0x55'));_0x951bee[_0xe19e('0x54')]={};}return _0x951bee;};}exports[_0xe19e('0x56')]=function(_0x418df4,_0x51022c,_0x1a0bfe){var _0x405339=[];return db[_0xe19e('0x57')][_0xe19e('0x48')]({'where':{'role':['agent',_0xe19e('0x58'),_0xe19e('0x59')]},'attributes':['id',_0xe19e('0x5a'),_0xe19e('0x2b'),_0xe19e('0x5b'),_0xe19e('0x5c'),_0xe19e('0x5d'),'online','lastLoginAt',_0xe19e('0x5e'),_0xe19e('0x5f')],'order':qs[_0xe19e('0x3d')](_0xe19e('0x60')),'include':[{'model':db[_0xe19e('0x61')],'as':_0xe19e('0x62'),'attributes':['id',_0xe19e('0x2b'),_0xe19e('0x42')],'through':{'attributes':[]}}]})[_0xe19e('0x28')](function(_0x56a7ca){if(_0x56a7ca){var _0x304412=_0x418df4[_0xe19e('0x59')][_0xe19e('0x51')]({'plain':!![]});if(!_0x304412)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x304412[_0xe19e('0x5b')]===_0xe19e('0x59')){return db[_0xe19e('0x63')]['find']({'where':{'name':_0xe19e('0x64'),'userProfileId':_0x304412['userProfileId']},'raw':!![]})[_0xe19e('0x28')](function(_0x523e40){if(_0x523e40){if(_0x523e40[_0xe19e('0x65')]===0x0){return db[_0xe19e('0x66')][_0xe19e('0x48')]({'where':{'sectionId':_0x523e40['id']},'raw':!![]})[_0xe19e('0x28')](function(_0x669f01){var _0x41a609=[];if(_[_0xe19e('0x67')](_0x669f01)){_0x41a609=_[_0xe19e('0x40')](_0x56a7ca,function(_0x441c41){if(_0x441c41['role']!==_0xe19e('0x68')){return _0x441c41;}});return _0x41a609;}else{for(var _0x357394=0x0;_0x357394<_0x56a7ca[_0xe19e('0x39')];_0x357394++){var _0x16a1c5=_0x56a7ca[_0x357394];if(_0x16a1c5[_0xe19e('0x5b')]===_0xe19e('0x68')){var _0x2d40d7=_['find'](_0x669f01,function(_0x449e66){return _0x449e66[_0xe19e('0x69')]===_0x16a1c5['id'];});if(_0x2d40d7)_0x41a609['push'](_0x16a1c5);}else{_0x41a609['push'](_0x16a1c5);}}return _0x41a609;}});}else{return _0x56a7ca;}}else{var _0x2691c0=_[_0xe19e('0x40')](_0x56a7ca,function(_0x2b3789){if(_0x2b3789['role']!=='agent'){return _0x2b3789;}});return _0x2691c0;}});}else{return _0x56a7ca;}}})[_0xe19e('0x28')](function(_0x3b1a9f){var _0x3f8281=[];if(_0x3b1a9f){_0x405339=_0x3b1a9f;for(var _0x5d477f=0x0;_0x5d477f<_0x3b1a9f[_0xe19e('0x39')];_0x5d477f+=0x1){_0x405339[_0x5d477f][_0xe19e('0x6a')]=[];_0x3f8281[_0xe19e('0x6b')](db['ChatInternalMessage'][_0xe19e('0x4c')]({'where':{'FromId':[_0x418df4['user']['id'],_0x3b1a9f[_0x5d477f]['id']],'ToId':[_0x418df4[_0xe19e('0x59')]['id'],_0x3b1a9f[_0x5d477f]['id']],'ChatGroupId':null},'attributes':['id',_0xe19e('0x53'),_0xe19e('0x6c'),_0xe19e('0x6d'),'read',_0xe19e('0x4f')],'order':qs['sort'](_0xe19e('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe19e('0x28')](wrapUser(_0x3b1a9f[_0x5d477f])));}return BPromise[_0xe19e('0x6f')](_0x3f8281);}return[];})[_0xe19e('0x28')](function(_0x4dfdc3){return{'rows':_0x4dfdc3,'count':_0x4dfdc3[_0xe19e('0x39')]};})[_0xe19e('0x28')](respondWithResult(_0x51022c,null))[_0xe19e('0x49')](handleError(_0x51022c,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 6b619e7..ff1c73f 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 _0xea21=['hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0xea21,0xf4));var _0x1ea2=function(_0x3e1b94,_0x3c4e42){_0x3e1b94=_0x3e1b94-0x0;var _0x8cac39=_0xea21[_0x3e1b94];return _0x8cac39;};'use strict';var EventEmitter=require(_0x1ea2('0x0'));var ChatInternalMessage=require(_0x1ea2('0x1'))['db'][_0x1ea2('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1ea2('0x3')](0x0);var events={'afterCreate':_0x1ea2('0x4'),'afterUpdate':_0x1ea2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1e01aa){return function(_0x4e9772,_0x47f2d2,_0x39dffc){ChatInternalMessageEvents[_0x1ea2('0x6')](_0x1e01aa+':'+_0x4e9772['id'],_0x4e9772);ChatInternalMessageEvents[_0x1ea2('0x6')](_0x1e01aa,_0x4e9772);_0x39dffc(null);};}for(var e in events){if(events[_0x1ea2('0x7')](e)){var event=events[e];ChatInternalMessage[_0x1ea2('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xb10b=['hasOwnProperty','hook','events','ChatInternalMessage','setMaxListeners','save','remove','emit'];(function(_0x4ef8a0,_0x324b65){var _0x433802=function(_0x789516){while(--_0x789516){_0x4ef8a0['push'](_0x4ef8a0['shift']());}};_0x433802(++_0x324b65);}(_0xb10b,0x12a));var _0xbb10=function(_0x3f9aa0,_0x478ec3){_0x3f9aa0=_0x3f9aa0-0x0;var _0x4a82c0=_0xb10b[_0x3f9aa0];return _0x4a82c0;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatInternalMessageEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatInternalMessageEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatInternalMessage[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index dc4fe11..85fb2c5 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 _0x61ab=['path','rimraf','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x5f47ba,_0x2ccdd8){var _0x3f43d9=function(_0x5ca696){while(--_0x5ca696){_0x5f47ba['push'](_0x5f47ba['shift']());}};_0x3f43d9(++_0x2ccdd8);}(_0x61ab,0x150));var _0xb61a=function(_0x275c74,_0x544e35){_0x275c74=_0x275c74-0x0;var _0x2097e6=_0x61ab[_0x275c74];return _0x2097e6;};'use strict';var _=require(_0xb61a('0x0'));var util=require(_0xb61a('0x1'));var logger=require(_0xb61a('0x2'))('api');var moment=require(_0xb61a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb61a('0x4'));var rimraf=require(_0xb61a('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x1150e7,_0x592c18){return _0x1150e7['define'](_0xb61a('0x6'),attributes,{'tableName':_0xb61a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb61a('0x8'),'collate':_0xb61a('0x9')});};
\ No newline at end of file
+var _0xad0b=['moment','bluebird','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x50c389,_0x5da318){var _0x5ed2c8=function(_0x1984ab){while(--_0x1984ab){_0x50c389['push'](_0x50c389['shift']());}};_0x5ed2c8(++_0x5da318);}(_0xad0b,0x9a));var _0xbad0=function(_0x49ecd3,_0xf2f661){_0x49ecd3=_0x49ecd3-0x0;var _0x503006=_0xad0b[_0x49ecd3];return _0x503006;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbad0('0x0'))(_0xbad0('0x1'));var moment=require(_0xbad0('0x2'));var BPromise=require(_0xbad0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbad0('0x4'));var rimraf=require('rimraf');var config=require(_0xbad0('0x5'));var attributes=require(_0xbad0('0x6'));module[_0xbad0('0x7')]=function(_0x5c1c66,_0x2806df){return _0x5c1c66[_0xbad0('0x8')](_0xbad0('0x9'),attributes,{'tableName':_0xbad0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbad0('0xb'),'collate':_0xbad0('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 19e87b6..f803c86 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 _0x81a9=['redis','defaults','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http'];(function(_0x5a9666,_0x30bc94){var _0x28601f=function(_0x52e447){while(--_0x52e447){_0x5a9666['push'](_0x5a9666['shift']());}};_0x28601f(++_0x30bc94);}(_0x81a9,0x81));var _0x981a=function(_0x4ed865,_0x2f18d){_0x4ed865=_0x4ed865-0x0;var _0xc4e344=_0x81a9[_0x4ed865];return _0xc4e344;};'use strict';var _=require(_0x981a('0x0'));var util=require('util');var moment=require(_0x981a('0x1'));var BPromise=require(_0x981a('0x2'));var rs=require(_0x981a('0x3'));var fs=require('fs');var Redis=require(_0x981a('0x4'));var db=require(_0x981a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x981a('0x6'));var jayson=require(_0x981a('0x7'));var client=jayson['client'][_0x981a('0x8')]({'port':0x232a});config[_0x981a('0x9')]=_[_0x981a('0xa')](config[_0x981a('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x981a('0x9')]));require(_0x981a('0xb'))[_0x981a('0xc')](socket);function respondWithRpcPromise(_0x32f8d9,_0x381c86,_0x2d1b70){return new BPromise(function(_0x41854f,_0x5ab43b){return client[_0x981a('0xd')](_0x32f8d9,_0x2d1b70)['then'](function(_0x5076f9){logger[_0x981a('0xe')](_0x981a('0xf'),_0x381c86,_0x981a('0x10'));logger[_0x981a('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x381c86,'request\x20sent',JSON[_0x981a('0x12')](_0x5076f9));if(_0x5076f9[_0x981a('0x13')]){if(_0x5076f9['error'][_0x981a('0x14')]===0x1f4){logger[_0x981a('0x13')](_0x981a('0xf'),_0x381c86,_0x5076f9[_0x981a('0x13')][_0x981a('0x15')]);return _0x5ab43b(_0x5076f9[_0x981a('0x13')]['message']);}logger[_0x981a('0x13')](_0x981a('0xf'),_0x381c86,_0x5076f9[_0x981a('0x13')][_0x981a('0x15')]);return _0x41854f(_0x5076f9['error']['message']);}else{logger['info'](_0x981a('0xf'),_0x381c86,_0x981a('0x10'));_0x41854f(_0x5076f9['result'][_0x981a('0x15')]);}})[_0x981a('0x16')](function(_0x2968f8){logger[_0x981a('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x381c86,_0x2968f8);_0x5ab43b(_0x2968f8);});});}
\ No newline at end of file
+var _0x314a=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x5a3881,_0x13d038){var _0x2ef78b=function(_0x323906){while(--_0x323906){_0x5a3881['push'](_0x5a3881['shift']());}};_0x2ef78b(++_0x13d038);}(_0x314a,0xf9));var _0xa314=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0x314a[_0x45b29d];return _0x32d74;};'use strict';var _=require(_0xa314('0x0'));var util=require(_0xa314('0x1'));var moment=require(_0xa314('0x2'));var BPromise=require(_0xa314('0x3'));var rs=require(_0xa314('0x4'));var fs=require('fs');var Redis=require(_0xa314('0x5'));var db=require(_0xa314('0x6'))['db'];var utils=require(_0xa314('0x7'));var logger=require(_0xa314('0x8'))(_0xa314('0x9'));var config=require(_0xa314('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa314('0xb')][_0xa314('0xc')]({'port':0x232a});config[_0xa314('0xd')]=_[_0xa314('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa314('0xd')]));require(_0xa314('0xf'))[_0xa314('0x10')](socket);function respondWithRpcPromise(_0x43e382,_0x15d82f,_0x54d4d5){return new BPromise(function(_0x346b42,_0x1cff35){return client['request'](_0x43e382,_0x54d4d5)[_0xa314('0x11')](function(_0x45a536){logger[_0xa314('0x12')](_0xa314('0x13'),_0x15d82f,_0xa314('0x14'));logger['debug'](_0xa314('0x15'),_0x15d82f,'request\x20sent',JSON[_0xa314('0x16')](_0x45a536));if(_0x45a536['error']){if(_0x45a536[_0xa314('0x17')][_0xa314('0x18')]===0x1f4){logger['error'](_0xa314('0x13'),_0x15d82f,_0x45a536[_0xa314('0x17')][_0xa314('0x19')]);return _0x1cff35(_0x45a536['error']['message']);}logger[_0xa314('0x17')](_0xa314('0x13'),_0x15d82f,_0x45a536['error'][_0xa314('0x19')]);return _0x346b42(_0x45a536['error'][_0xa314('0x19')]);}else{logger[_0xa314('0x12')](_0xa314('0x13'),_0x15d82f,_0xa314('0x14'));_0x346b42(_0x45a536[_0xa314('0x1a')][_0xa314('0x19')]);}})['catch'](function(_0x190fcc){logger[_0xa314('0x17')](_0xa314('0x13'),_0x15d82f,_0x190fcc);_0x1cff35(_0x190fcc);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index a9d52b6..7334978 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 _0xc6fc=['emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x1c2d2a,_0x2dd149){var _0x71febb=function(_0x45568c){while(--_0x45568c){_0x1c2d2a['push'](_0x1c2d2a['shift']());}};_0x71febb(++_0x2dd149);}(_0xc6fc,0xa5));var _0xcc6f=function(_0x10b1bb,_0x2a5815){_0x10b1bb=_0x10b1bb-0x0;var _0x2d4e05=_0xc6fc[_0x10b1bb];return _0x2d4e05;};'use strict';var ChatInternalMessageEvents=require(_0xcc6f('0x0'));var events=['save',_0xcc6f('0x1'),_0xcc6f('0x2')];function createListener(_0x43829a,_0x16d05a){return function(_0x195f4e){_0x16d05a[_0xcc6f('0x3')](_0x43829a,_0x195f4e);};}function removeListener(_0xfa2545,_0x3b0a12){return function(){ChatInternalMessageEvents[_0xcc6f('0x4')](_0xfa2545,_0x3b0a12);};}exports[_0xcc6f('0x5')]=function(_0x413e5d){for(var _0x18281d=0x0,_0xd11a1c=events['length'];_0x18281d<_0xd11a1c;_0x18281d++){var _0x565532=events[_0x18281d];var _0x1aa042=createListener(_0xcc6f('0x6')+_0x565532,_0x413e5d);ChatInternalMessageEvents['on'](_0x565532,_0x1aa042);}};
\ No newline at end of file
+var _0x32d2=['removeListener','register','length','save','remove','update'];(function(_0x593acf,_0x2172be){var _0x247d38=function(_0x177d7e){while(--_0x177d7e){_0x593acf['push'](_0x593acf['shift']());}};_0x247d38(++_0x2172be);}(_0x32d2,0x87));var _0x232d=function(_0x20caed,_0x2ab574){_0x20caed=_0x20caed-0x0;var _0x61714a=_0x32d2[_0x20caed];return _0x61714a;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x232d('0x0'),_0x232d('0x1'),_0x232d('0x2')];function createListener(_0x5d4e39,_0x295f48){return function(_0x23cb17){_0x295f48['emit'](_0x5d4e39,_0x23cb17);};}function removeListener(_0x458fe4,_0x280fd6){return function(){ChatInternalMessageEvents[_0x232d('0x3')](_0x458fe4,_0x280fd6);};}exports[_0x232d('0x4')]=function(_0x1385da){for(var _0x337834=0x0,_0x2f2a7d=events[_0x232d('0x5')];_0x337834<_0x2f2a7d;_0x337834++){var _0x509028=events[_0x337834];var _0x516750=createListener('chatInternalMessage:'+_0x509028,_0x1385da);ChatInternalMessageEvents['on'](_0x509028,_0x516750);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index a72fbc4..d152a56 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 _0x034a=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','getUsers','/:id','post','create'];(function(_0x332ad6,_0x38c82b){var _0x34011e=function(_0x8de51d){while(--_0x8de51d){_0x332ad6['push'](_0x332ad6['shift']());}};_0x34011e(++_0x38c82b);}(_0x034a,0xd6));var _0xa034=function(_0x5721a3,_0x400204){_0x5721a3=_0x5721a3-0x0;var _0x11b5e9=_0x034a[_0x5721a3];return _0x11b5e9;};'use strict';var multer=require(_0xa034('0x0'));var util=require(_0xa034('0x1'));var path=require(_0xa034('0x2'));var timeout=require('connect-timeout');var express=require(_0xa034('0x3'));var router=express[_0xa034('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa034('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa034('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xa034('0x7')]('/',auth[_0xa034('0x8')](),controller['index']);router['get'](_0xa034('0x9'),auth[_0xa034('0x8')](),controller['describe']);router['get']('/users',auth[_0xa034('0x8')](),controller[_0xa034('0xa')]);router['get'](_0xa034('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa034('0xc')]('/',auth['isAuthenticated'](),controller[_0xa034('0xd')]);router[_0xa034('0xe')]('/:id',controller[_0xa034('0xf')]);router[_0xa034('0x10')](_0xa034('0xb'),auth[_0xa034('0x8')](),controller[_0xa034('0x11')]);module[_0xa034('0x12')]=router;
\ No newline at end of file
+var _0xebbd=['index','/describe','describe','/users','getUsers','/:id','post','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0xcb9f9b,_0x376855){var _0x1cc14c=function(_0x3ddf39){while(--_0x3ddf39){_0xcb9f9b['push'](_0xcb9f9b['shift']());}};_0x1cc14c(++_0x376855);}(_0xebbd,0x196));var _0xdebb=function(_0x175697,_0x8c0f37){_0x175697=_0x175697-0x0;var _0x14493c=_0xebbd[_0x175697];return _0x14493c;};'use strict';var multer=require('multer');var util=require(_0xdebb('0x0'));var path=require(_0xdebb('0x1'));var timeout=require(_0xdebb('0x2'));var express=require(_0xdebb('0x3'));var router=express[_0xdebb('0x4')]();var fs_extra=require(_0xdebb('0x5'));var auth=require(_0xdebb('0x6'));var interaction=require(_0xdebb('0x7'));var config=require(_0xdebb('0x8'));var controller=require(_0xdebb('0x9'));router[_0xdebb('0xa')]('/',auth[_0xdebb('0xb')](),controller[_0xdebb('0xc')]);router[_0xdebb('0xa')](_0xdebb('0xd'),auth[_0xdebb('0xb')](),controller[_0xdebb('0xe')]);router[_0xdebb('0xa')](_0xdebb('0xf'),auth[_0xdebb('0xb')](),controller[_0xdebb('0x10')]);router['get'](_0xdebb('0x11'),auth[_0xdebb('0xb')](),controller['show']);router[_0xdebb('0x12')]('/',auth[_0xdebb('0xb')](),controller[_0xdebb('0x13')]);router['put'](_0xdebb('0x11'),controller['update']);router[_0xdebb('0x14')]('/:id',auth[_0xdebb('0xb')](),controller[_0xdebb('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 1c55bbe..4eb4513 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 _0xc06d=['BOOLEAN','ENUM','DATE','sequelize','exports','TEXT','medium'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xc06d,0x15a));var _0xdc06=function(_0x5573cf,_0x45f321){_0x5573cf=_0x5573cf-0x0;var _0x52ecf3=_0xc06d[_0x5573cf];return _0x52ecf3;};'use strict';var Sequelize=require(_0xdc06('0x0'));module[_0xdc06('0x1')]={'body':{'type':Sequelize[_0xdc06('0x2')](_0xdc06('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xdc06('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdc06('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xdc06('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdc06('0x2')]}};
\ No newline at end of file
+var _0x39c4=['exports','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x3aad90,_0x5f5121){var _0x198c37=function(_0x58e07f){while(--_0x58e07f){_0x3aad90['push'](_0x3aad90['shift']());}};_0x198c37(++_0x5f5121);}(_0x39c4,0x174));var _0x439c=function(_0x52c214,_0x18ebcb){_0x52c214=_0x52c214-0x0;var _0x314e39=_0x39c4[_0x52c214];return _0x314e39;};'use strict';var Sequelize=require('sequelize');module[_0x439c('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x439c('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x439c('0x3')]},'providerName':{'type':Sequelize[_0x439c('0x4')]},'providerResponse':{'type':Sequelize[_0x439c('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 5a4a80d..9cbea74 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 _0x8fc5=['status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','update','body','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','channel','motionChannel','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','ContactId','interface','event','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus'];(function(_0xe786c2,_0x360b22){var _0x4a1d36=function(_0x4210c5){while(--_0x4210c5){_0xe786c2['push'](_0xe786c2['shift']());}};_0x4a1d36(++_0x360b22);}(_0x8fc5,0xe4));var _0x58fc=function(_0x410be1,_0x468d62){_0x410be1=_0x410be1-0x0;var _0x4406b1=_0x8fc5[_0x410be1];return _0x4406b1;};'use strict';var emlformat=require(_0x58fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58fc('0x1'));var jsonpatch=require(_0x58fc('0x2'));var rp=require(_0x58fc('0x3'));var moment=require(_0x58fc('0x4'));var BPromise=require(_0x58fc('0x5'));var Mustache=require('mustache');var util=require(_0x58fc('0x6'));var path=require(_0x58fc('0x7'));var sox=require(_0x58fc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58fc('0x9'));var _=require(_0x58fc('0xa'));var squel=require(_0x58fc('0xb'));var crypto=require('crypto');var jsforce=require(_0x58fc('0xc'));var deskjs=require(_0x58fc('0xd'));var toCsv=require(_0x58fc('0xe'));var querystring=require(_0x58fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x58fc('0x10'));var authService=require(_0x58fc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x58fc('0x12'));var hardwareService=require(_0x58fc('0x13'));var logger=require(_0x58fc('0x14'))(_0x58fc('0x15'));var utils=require(_0x58fc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x58fc('0x17'));var db=require(_0x58fc('0x18'))['db'];config[_0x58fc('0x19')]=_['defaults'](config[_0x58fc('0x19')],{'host':_0x58fc('0x1a'),'port':0x18eb});var socket=require(_0x58fc('0x1b'))(new Redis(config[_0x58fc('0x19')]));require(_0x58fc('0x1c'))[_0x58fc('0x1d')](socket);var jayson=require(_0x58fc('0x1e'));var client=jayson['client'][_0x58fc('0x1f')]({'port':0x232c});var client9002=jayson[_0x58fc('0x20')][_0x58fc('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x139e0c,_0x88bb3d,_0x2b020b,_0x44900f){return new BPromise(function(_0xa7598f,_0x3e6765){var _0xbf133e=_0x44900f||client;return _0xbf133e['request'](_0x139e0c,_0x2b020b)[_0x58fc('0x21')](function(_0x390f84){logger['info'](_0x58fc('0x22'),_0x88bb3d,_0x58fc('0x23'));logger[_0x58fc('0x24')](_0x58fc('0x25'),_0x88bb3d,_0x58fc('0x23'),JSON['stringify'](_0x390f84));if(_0x390f84[_0x58fc('0x26')]){if(_0x390f84[_0x58fc('0x26')]['code']===0x1f4){logger[_0x58fc('0x26')](_0x58fc('0x22'),_0x88bb3d,_0x390f84[_0x58fc('0x26')][_0x58fc('0x27')]);return _0x3e6765(_0x390f84[_0x58fc('0x26')][_0x58fc('0x27')]);}logger[_0x58fc('0x26')]('ChatMessage,\x20%s,\x20%s',_0x88bb3d,_0x390f84[_0x58fc('0x26')][_0x58fc('0x27')]);return _0xa7598f(_0x390f84['error'][_0x58fc('0x27')]);}else{logger[_0x58fc('0x28')](_0x58fc('0x22'),_0x88bb3d,_0x58fc('0x23'));_0xa7598f(_0x390f84[_0x58fc('0x29')][_0x58fc('0x27')]);}})[_0x58fc('0x2a')](function(_0x1e6a51){logger[_0x58fc('0x26')](_0x58fc('0x22'),_0x88bb3d,_0x1e6a51);_0x3e6765(_0x1e6a51);});});}function respondWithStatusCode(_0xc334fc,_0x54d6db){_0x54d6db=_0x54d6db||0xcc;return function(_0x36220f){if(_0x36220f){return _0xc334fc[_0x58fc('0x2b')](_0x54d6db);}return _0xc334fc[_0x58fc('0x2c')](_0x54d6db)[_0x58fc('0x2d')]();};}function respondWithResult(_0x1b1117,_0x4f0ed3){_0x4f0ed3=_0x4f0ed3||0xc8;return function(_0x3d170c){if(_0x3d170c){return _0x1b1117[_0x58fc('0x2c')](_0x4f0ed3)[_0x58fc('0x2e')](_0x3d170c);}};}function respondWithFilteredResult(_0x4e5772,_0x411839){return function(_0x27702f){if(_0x27702f){var _0x37cdc1=typeof _0x411839['offset']===_0x58fc('0x2f')&&typeof _0x411839['limit']===_0x58fc('0x2f');var _0x40a16b=_0x27702f[_0x58fc('0x30')];var _0x578ee2=_0x37cdc1?0x0:_0x411839[_0x58fc('0x31')];var _0x3db4e4=_0x37cdc1?_0x27702f['count']:_0x411839[_0x58fc('0x31')]+_0x411839[_0x58fc('0x32')];var _0x5d24d7;if(_0x3db4e4>=_0x40a16b){_0x3db4e4=_0x40a16b;_0x5d24d7=0xc8;}else{_0x5d24d7=0xce;}_0x4e5772[_0x58fc('0x2c')](_0x5d24d7);return _0x4e5772[_0x58fc('0x33')](_0x58fc('0x34'),_0x578ee2+'-'+_0x3db4e4+'/'+_0x40a16b)[_0x58fc('0x2e')](_0x27702f);}return null;};}function patchUpdates(_0x341603){return function(_0x1d5104){try{jsonpatch[_0x58fc('0x35')](_0x1d5104,_0x341603,!![]);}catch(_0x161943){return BPromise[_0x58fc('0x36')](_0x161943);}return _0x1d5104[_0x58fc('0x37')]();};}function saveUpdates(_0x377d41,_0x592abe){return function(_0x23f2a3){if(_0x23f2a3){return _0x23f2a3['update'](_0x377d41)['then'](function(_0x388dc3){return _0x388dc3;});}return null;};}function removeEntity(_0x1c5095,_0x489539){return function(_0x3111f8){if(_0x3111f8){return _0x3111f8[_0x58fc('0x38')]()[_0x58fc('0x21')](function(){_0x1c5095[_0x58fc('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fbcde,_0x1f155e){return function(_0x1f623c){if(!_0x1f623c){_0x2fbcde['sendStatus'](0x194);}return _0x1f623c;};}function handleError(_0x488201,_0x1bce27){_0x1bce27=_0x1bce27||0x1f4;return function(_0x4590a9){logger[_0x58fc('0x26')](_0x4590a9[_0x58fc('0x39')]);if(_0x4590a9[_0x58fc('0x3a')]){delete _0x4590a9[_0x58fc('0x3a')];}_0x488201[_0x58fc('0x2c')](_0x1bce27)[_0x58fc('0x3b')](_0x4590a9);};}exports[_0x58fc('0x3c')]=function(_0x4780dc,_0x397e7e){var _0x3292d4={},_0x3a4932={},_0x44f708={'count':0x0,'rows':[]};var _0x48dacb=_[_0x58fc('0x3d')](db[_0x58fc('0x3e')][_0x58fc('0x3f')],function(_0x4f4af9){return{'name':_0x4f4af9['fieldName'],'type':_0x4f4af9['type']['key']};});_0x3a4932[_0x58fc('0x40')]=_['map'](_0x48dacb,_0x58fc('0x3a'));_0x3a4932[_0x58fc('0x41')]=_[_0x58fc('0x42')](_0x4780dc[_0x58fc('0x41')]);_0x3a4932[_0x58fc('0x43')]=_[_0x58fc('0x44')](_0x3a4932['model'],_0x3a4932[_0x58fc('0x41')]);_0x3292d4[_0x58fc('0x45')]=_[_0x58fc('0x44')](_0x3a4932[_0x58fc('0x40')],qs[_0x58fc('0x46')](_0x4780dc[_0x58fc('0x41')][_0x58fc('0x46')]));_0x3292d4[_0x58fc('0x45')]=_0x3292d4[_0x58fc('0x45')][_0x58fc('0x47')]?_0x3292d4[_0x58fc('0x45')]:_0x3a4932[_0x58fc('0x40')];if(!_0x4780dc[_0x58fc('0x41')][_0x58fc('0x48')](_0x58fc('0x49'))){_0x3292d4[_0x58fc('0x32')]=qs[_0x58fc('0x32')](_0x4780dc[_0x58fc('0x41')][_0x58fc('0x32')]);_0x3292d4[_0x58fc('0x31')]=qs[_0x58fc('0x31')](_0x4780dc['query'][_0x58fc('0x31')]);}_0x3292d4[_0x58fc('0x4a')]=qs[_0x58fc('0x4b')](_0x4780dc['query'][_0x58fc('0x4b')]);_0x3292d4['where']=qs[_0x58fc('0x43')](_[_0x58fc('0x4c')](_0x4780dc[_0x58fc('0x41')],_0x3a4932[_0x58fc('0x43')]),_0x48dacb);if(_0x4780dc['query'][_0x58fc('0x4d')]){_0x3292d4['where']=_[_0x58fc('0x4e')](_0x3292d4[_0x58fc('0x4f')],{'$or':_[_0x58fc('0x3d')](_0x48dacb,function(_0x57deff){if(_0x57deff[_0x58fc('0x50')]!==_0x58fc('0x51')){var _0x54b093={};_0x54b093[_0x57deff['name']]={'$like':'%'+_0x4780dc[_0x58fc('0x41')][_0x58fc('0x4d')]+'%'};return _0x54b093;}})});}_0x3292d4=_[_0x58fc('0x4e')]({},_0x3292d4,_0x4780dc[_0x58fc('0x52')]);var _0x5986a5={'where':_0x3292d4[_0x58fc('0x4f')]};return db[_0x58fc('0x3e')][_0x58fc('0x30')](_0x5986a5)['then'](function(_0x8dd09d){_0x44f708[_0x58fc('0x30')]=_0x8dd09d;if(_0x4780dc[_0x58fc('0x41')][_0x58fc('0x53')]){_0x3292d4[_0x58fc('0x54')]=[{'all':!![]}];}return db[_0x58fc('0x3e')][_0x58fc('0x55')](_0x3292d4);})[_0x58fc('0x21')](function(_0x28733b){_0x44f708[_0x58fc('0x56')]=_0x28733b;return _0x44f708;})[_0x58fc('0x21')](respondWithFilteredResult(_0x397e7e,_0x3292d4))['catch'](handleError(_0x397e7e,null));};exports[_0x58fc('0x57')]=function(_0x5da06d,_0x3cbddf){var _0x897f90={'raw':!![],'where':{'id':_0x5da06d[_0x58fc('0x58')]['id']}},_0x56b50c={};_0x56b50c['model']=_[_0x58fc('0x42')](db[_0x58fc('0x3e')][_0x58fc('0x3f')]);_0x56b50c['query']=_[_0x58fc('0x42')](_0x5da06d[_0x58fc('0x41')]);_0x56b50c[_0x58fc('0x43')]=_[_0x58fc('0x44')](_0x56b50c[_0x58fc('0x40')],_0x56b50c[_0x58fc('0x41')]);_0x897f90[_0x58fc('0x45')]=_[_0x58fc('0x44')](_0x56b50c['model'],qs[_0x58fc('0x46')](_0x5da06d['query'][_0x58fc('0x46')]));_0x897f90[_0x58fc('0x45')]=_0x897f90[_0x58fc('0x45')][_0x58fc('0x47')]?_0x897f90[_0x58fc('0x45')]:_0x56b50c[_0x58fc('0x40')];if(_0x5da06d[_0x58fc('0x41')][_0x58fc('0x53')]){_0x897f90[_0x58fc('0x54')]=[{'all':!![]}];}_0x897f90=_['merge']({},_0x897f90,_0x5da06d[_0x58fc('0x52')]);return db[_0x58fc('0x3e')][_0x58fc('0x59')](_0x897f90)['then'](handleEntityNotFound(_0x3cbddf,null))[_0x58fc('0x21')](respondWithResult(_0x3cbddf,null))[_0x58fc('0x2a')](handleError(_0x3cbddf,null));};exports[_0x58fc('0x5a')]=function(_0x182114,_0x56fa06){return db['ChatMessage'][_0x58fc('0x5a')](_0x182114['body'],{})[_0x58fc('0x21')](respondWithResult(_0x56fa06,0xc9))['catch'](handleError(_0x56fa06,null));};exports[_0x58fc('0x5b')]=function(_0x4da317,_0x15b092){if(_0x4da317[_0x58fc('0x5c')]['id']){delete _0x4da317[_0x58fc('0x5c')]['id'];}return db[_0x58fc('0x3e')]['find']({'where':{'id':_0x4da317['params']['id']}})[_0x58fc('0x21')](handleEntityNotFound(_0x15b092,null))[_0x58fc('0x21')](saveUpdates(_0x4da317[_0x58fc('0x5c')],null))[_0x58fc('0x21')](respondWithResult(_0x15b092,null))[_0x58fc('0x2a')](handleError(_0x15b092,null));};exports['destroy']=function(_0x5cd6c6,_0xb477c){return db[_0x58fc('0x3e')][_0x58fc('0x59')]({'where':{'id':_0x5cd6c6['params']['id']}})[_0x58fc('0x21')](handleEntityNotFound(_0xb477c,null))[_0x58fc('0x21')](removeEntity(_0xb477c,null))[_0x58fc('0x2a')](handleError(_0xb477c,null));};exports[_0x58fc('0x5d')]=function(_0x16b1a1,_0x3280dc){return db[_0x58fc('0x3e')][_0x58fc('0x5d')]()[_0x58fc('0x21')](respondWithResult(_0x3280dc,null))[_0x58fc('0x2a')](handleError(_0x3280dc,null));};var interaction_log=require(_0x58fc('0x14'))(_0x58fc('0x5e'));exports[_0x58fc('0x5f')]=function(_0x1ccd86,_0x1d32be,_0x380775){var _0x3956e4={'agent':{},'channel':_0x58fc('0x60')};if(_0x1ccd86[_0x58fc('0x5c')]['id']){delete _0x1ccd86['body']['id'];}_0x1ccd86['body']['read']=!![];_0x1ccd86['body'][_0x58fc('0x61')]=moment()[_0x58fc('0x62')](_0x58fc('0x63'));_0x1ccd86['body'][_0x58fc('0x64')]=_0x1ccd86[_0x58fc('0x5c')][_0x58fc('0x64')]||_0x1ccd86[_0x58fc('0x65')]['id'];_0x3956e4[_0x58fc('0x66')]['id']=_0x1ccd86['body'][_0x58fc('0x64')];return db[_0x58fc('0x3e')][_0x58fc('0x59')]({'where':{'id':_0x1ccd86[_0x58fc('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1d32be,null))['then'](saveUpdates(_0x1ccd86[_0x58fc('0x5c')],null))[_0x58fc('0x21')](function(_0x540b30){if(_0x540b30){_0x3956e4[_0x58fc('0x27')]=_0x540b30[_0x58fc('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x58fc('0x59')]({'where':{'id':_0x540b30[_0x58fc('0x68')]}});}return null;})[_0x58fc('0x21')](handleEntityNotFound(_0x1d32be,null))[_0x58fc('0x21')](function(_0x232ff7){if(_0x232ff7){return _0x232ff7[_0x58fc('0x5b')]({'UserId':_0x1ccd86['body'][_0x58fc('0x64')],'read1stAt':_[_0x58fc('0x69')](_0x232ff7[_0x58fc('0x6a')])?moment()[_0x58fc('0x62')](_0x58fc('0x63')):undefined});}return null;})[_0x58fc('0x21')](function(_0x442f69){if(_0x442f69){_0x3956e4[_0x58fc('0x6b')]=_0x442f69[_0x58fc('0x67')]({'plain':!![]});interaction_log[_0x58fc('0x28')](_0x58fc('0x6c'),_0x1ccd86[_0x58fc('0x65')]['id'],_0x1ccd86[_0x58fc('0x65')][_0x58fc('0x3a')],_0x1ccd86[_0x58fc('0x65')][_0x58fc('0x6d')],_0x3956e4['interaction']['id'],_0x1ccd86[_0x58fc('0x5c')]?JSON['stringify'](_0x1ccd86['body']):_0x58fc('0x6e'));return respondWithRpcPromise(_0x58fc('0x6f'),_0x58fc('0x70'),_0x3956e4);}return null;})[_0x58fc('0x21')](function(_0xc62c7a){var _0x5071e8=_0x58fc('0x71')+_0xc62c7a['message']['ContactId'];return db[_0x58fc('0x72')][_0x58fc('0x41')](_0x5071e8,{'type':db[_0x58fc('0x73')][_0x58fc('0x74')][_0x58fc('0x75')],'raw':!![]})[_0x58fc('0x21')](function(_0x21d239){return _0x21d239;});})[_0x58fc('0x21')](function(_0x5f2e72){if(_0x5f2e72){_0x3956e4[_0x58fc('0x27')]['contact']=_0x5f2e72[0x0];if(!_0x1ccd86[_0x58fc('0x5c')][_0x58fc('0x64')])return;return db[_0x58fc('0x76')][_0x58fc('0x59')]({'where':{'id':_0x1ccd86[_0x58fc('0x5c')][_0x58fc('0x64')],'role':_0x58fc('0x66')},'attributes':['id',_0x58fc('0x3a'),_0x58fc('0x77'),_0x58fc('0x78'),_0x58fc('0x79')],'raw':!![]});}return null;})[_0x58fc('0x21')](function(_0x363bf5){if(!_0x363bf5)return null;_0x3956e4[_0x58fc('0x27')][_0x58fc('0x66')]=_0x363bf5;return _0x3956e4;})[_0x58fc('0x21')](function(_0x4ce671){if(_0x4ce671){if(_0x1ccd86['body']['manual']){_0x3956e4[_0x58fc('0x27')]['interface']=util['format']('SIP/%s',_0x1ccd86[_0x58fc('0x65')][_0x58fc('0x3a')]);_0x3956e4['message'][_0x58fc('0x7a')]=_0x3956e4[_0x58fc('0x7a')];_0x3956e4[_0x58fc('0x27')][_0x58fc('0x7b')]=_0x3956e4['channel'];_0x3956e4[_0x58fc('0x27')]['event']=_0x58fc('0x5f');return respondWithRpcPromise(_0x58fc('0x7c'),_0x58fc('0x7c'),{'event':_0x58fc('0x7d'),'message':_[_0x58fc('0x4e')](_0x3956e4['message'],JSON['parse'](_0x3956e4[_0x58fc('0x6b')][_0x58fc('0x7e')]))},client9002)[_0x58fc('0x21')](function(){return _0x3956e4;});}return _0x3956e4;}return null;})[_0x58fc('0x21')](respondWithResult(_0x1d32be,null))[_0x58fc('0x2a')](handleError(_0x1d32be,null));};var interaction_log=require('../../config/logger')(_0x58fc('0x5e'));exports[_0x58fc('0x36')]=function(_0xf5ba7d,_0x266812,_0x35ec1c){var _0x330943={'agent':{},'channel':_0x58fc('0x60')};if(_0xf5ba7d[_0x58fc('0x5c')]['id']){delete _0xf5ba7d[_0x58fc('0x5c')]['id'];}_0xf5ba7d[_0x58fc('0x5c')][_0x58fc('0x64')]=_0xf5ba7d['body'][_0x58fc('0x64')]||_0xf5ba7d[_0x58fc('0x65')]['id'];_0x330943['agent']['id']=_0xf5ba7d[_0x58fc('0x5c')][_0x58fc('0x64')];return db[_0x58fc('0x3e')][_0x58fc('0x59')]({'where':{'id':_0xf5ba7d[_0x58fc('0x58')]['id'],'UserId':null}})[_0x58fc('0x21')](handleEntityNotFound(_0x266812,null))[_0x58fc('0x21')](function(_0xe4633a){if(_0xe4633a){_0x330943[_0x58fc('0x27')]=_0xe4633a[_0x58fc('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x58fc('0x59')]({'where':{'id':_0xe4633a['ChatInteractionId']}});}return null;})[_0x58fc('0x21')](handleEntityNotFound(_0x266812,null))[_0x58fc('0x21')](function(_0xe65984){if(_0xe65984){_0x330943['interaction']=_0xe65984[_0x58fc('0x67')]({'plain':!![]});interaction_log[_0x58fc('0x28')](_0x58fc('0x7f'),_0xf5ba7d[_0x58fc('0x65')]['id'],_0xf5ba7d['user'][_0x58fc('0x3a')],_0xf5ba7d[_0x58fc('0x65')][_0x58fc('0x6d')],_0x330943[_0x58fc('0x6b')]['id'],_0xf5ba7d[_0x58fc('0x5c')]?JSON[_0x58fc('0x80')](_0xf5ba7d[_0x58fc('0x5c')]):'null');return respondWithRpcPromise(_0x58fc('0x81'),_0x58fc('0x82'),_0x330943);}return null;})[_0x58fc('0x21')](function(_0x20e930){var _0x1ccb9b=_0x58fc('0x71')+_0x20e930[_0x58fc('0x27')][_0x58fc('0x83')];return db['sequelize'][_0x58fc('0x41')](_0x1ccb9b,{'type':db[_0x58fc('0x73')]['QueryTypes'][_0x58fc('0x75')],'raw':!![]})['then'](function(_0x3547d2){return _0x3547d2;});})[_0x58fc('0x21')](function(_0x51cc66){if(_0x51cc66){_0x330943[_0x58fc('0x27')]['contact']=_0x51cc66[0x0];if(!_0xf5ba7d[_0x58fc('0x5c')][_0x58fc('0x64')])return;return db[_0x58fc('0x76')]['find']({'where':{'id':_0xf5ba7d[_0x58fc('0x5c')][_0x58fc('0x64')],'role':'agent'},'attributes':['id','name',_0x58fc('0x77'),_0x58fc('0x78'),_0x58fc('0x79')],'raw':!![]});}return null;})['then'](function(_0x504cee){if(!_0x504cee)return null;_0x330943[_0x58fc('0x27')][_0x58fc('0x66')]=_0x504cee;return _0x330943;})[_0x58fc('0x21')](function(_0x595f6b){if(_0x595f6b){_0x595f6b[_0x58fc('0x27')][_0x58fc('0x84')]=util[_0x58fc('0x62')]('SIP/%s',_0xf5ba7d['user'][_0x58fc('0x3a')]);_0x595f6b[_0x58fc('0x27')][_0x58fc('0x7a')]=_0x330943['channel'];_0x595f6b[_0x58fc('0x27')]['motionChannel']=_0x330943[_0x58fc('0x7a')];_0x595f6b[_0x58fc('0x27')][_0x58fc('0x85')]=_0x58fc('0x36');respondWithRpcPromise(_0x58fc('0x7c'),_0x58fc('0x7c'),{'event':_0x58fc('0x86'),'message':_[_0x58fc('0x4e')](_0x330943['message'],JSON[_0x58fc('0x87')](_0x330943['interaction'][_0x58fc('0x7e')]))},client9002);return _0x330943;}return null;})['then'](respondWithResult(_0x266812,null))[_0x58fc('0x2a')](handleError(_0x266812,null));};
\ No newline at end of file
+var _0xdddc=['info','ChatMessage,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','destroy','then','name','send','index','ChatMessage','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','find','create','body','update','params','describe','../../config/logger','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','null','acceptMessage','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','interface','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','http','client','request'];(function(_0x3c6616,_0x1721d6){var _0x49e614=function(_0x25f209){while(--_0x25f209){_0x3c6616['push'](_0x3c6616['shift']());}};_0x49e614(++_0x1721d6);}(_0xdddc,0x1d8));var _0xcddd=function(_0x5b8dbe,_0x4b420d){_0x5b8dbe=_0x5b8dbe-0x0;var _0x3f5bff=_0xdddc[_0x5b8dbe];return _0x3f5bff;};'use strict';var emlformat=require(_0xcddd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcddd('0x1'));var jsonpatch=require(_0xcddd('0x2'));var rp=require(_0xcddd('0x3'));var moment=require('moment');var BPromise=require(_0xcddd('0x4'));var Mustache=require(_0xcddd('0x5'));var util=require('util');var path=require(_0xcddd('0x6'));var sox=require('sox');var csv=require(_0xcddd('0x7'));var ejs=require(_0xcddd('0x8'));var fs=require('fs');var fs_extra=require(_0xcddd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcddd('0xa'));var deskjs=require(_0xcddd('0xb'));var toCsv=require(_0xcddd('0x7'));var querystring=require(_0xcddd('0xc'));var Papa=require('papaparse');var Redis=require(_0xcddd('0xd'));var authService=require(_0xcddd('0xe'));var qs=require(_0xcddd('0xf'));var as=require(_0xcddd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcddd('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcddd('0x12'))['db'];config['redis']=_[_0xcddd('0x13')](config[_0xcddd('0x14')],{'host':_0xcddd('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcddd('0x14')]));require(_0xcddd('0x16'))[_0xcddd('0x17')](socket);var jayson=require(_0xcddd('0x18'));var client=jayson['client'][_0xcddd('0x19')]({'port':0x232c});var client9002=jayson[_0xcddd('0x1a')][_0xcddd('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4bf27b,_0x4b09ca,_0x1a1ac8,_0x516248){return new BPromise(function(_0x519bdc,_0x1566ec){var _0x42fb45=_0x516248||client;return _0x42fb45[_0xcddd('0x1b')](_0x4bf27b,_0x1a1ac8)['then'](function(_0x44e5f2){logger[_0xcddd('0x1c')](_0xcddd('0x1d'),_0x4b09ca,'request\x20sent');logger[_0xcddd('0x1e')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4b09ca,'request\x20sent',JSON[_0xcddd('0x1f')](_0x44e5f2));if(_0x44e5f2['error']){if(_0x44e5f2[_0xcddd('0x20')]['code']===0x1f4){logger[_0xcddd('0x20')](_0xcddd('0x1d'),_0x4b09ca,_0x44e5f2['error'][_0xcddd('0x21')]);return _0x1566ec(_0x44e5f2[_0xcddd('0x20')][_0xcddd('0x21')]);}logger[_0xcddd('0x20')](_0xcddd('0x1d'),_0x4b09ca,_0x44e5f2[_0xcddd('0x20')][_0xcddd('0x21')]);return _0x519bdc(_0x44e5f2[_0xcddd('0x20')]['message']);}else{logger[_0xcddd('0x1c')]('ChatMessage,\x20%s,\x20%s',_0x4b09ca,_0xcddd('0x22'));_0x519bdc(_0x44e5f2[_0xcddd('0x23')][_0xcddd('0x21')]);}})[_0xcddd('0x24')](function(_0x57fd89){logger[_0xcddd('0x20')]('ChatMessage,\x20%s,\x20%s',_0x4b09ca,_0x57fd89);_0x1566ec(_0x57fd89);});});}function respondWithStatusCode(_0x21d537,_0x478af9){_0x478af9=_0x478af9||0xcc;return function(_0x2dcd76){if(_0x2dcd76){return _0x21d537[_0xcddd('0x25')](_0x478af9);}return _0x21d537['status'](_0x478af9)[_0xcddd('0x26')]();};}function respondWithResult(_0x4ef4fb,_0x208b86){_0x208b86=_0x208b86||0xc8;return function(_0x1f873b){if(_0x1f873b){return _0x4ef4fb[_0xcddd('0x27')](_0x208b86)['json'](_0x1f873b);}};}function respondWithFilteredResult(_0x351849,_0x36c5f6){return function(_0x5db917){if(_0x5db917){var _0x15ab28=typeof _0x36c5f6[_0xcddd('0x28')]===_0xcddd('0x29')&&typeof _0x36c5f6['limit']===_0xcddd('0x29');var _0x40adcd=_0x5db917[_0xcddd('0x2a')];var _0x4ff467=_0x15ab28?0x0:_0x36c5f6[_0xcddd('0x28')];var _0x53352d=_0x15ab28?_0x5db917[_0xcddd('0x2a')]:_0x36c5f6[_0xcddd('0x28')]+_0x36c5f6[_0xcddd('0x2b')];var _0x4675d9;if(_0x53352d>=_0x40adcd){_0x53352d=_0x40adcd;_0x4675d9=0xc8;}else{_0x4675d9=0xce;}_0x351849[_0xcddd('0x27')](_0x4675d9);return _0x351849[_0xcddd('0x2c')](_0xcddd('0x2d'),_0x4ff467+'-'+_0x53352d+'/'+_0x40adcd)[_0xcddd('0x2e')](_0x5db917);}return null;};}function patchUpdates(_0x4b386d){return function(_0x190309){try{jsonpatch['apply'](_0x190309,_0x4b386d,!![]);}catch(_0x3f0392){return BPromise['reject'](_0x3f0392);}return _0x190309[_0xcddd('0x2f')]();};}function saveUpdates(_0x1755fa,_0x169a8c){return function(_0x498ebc){if(_0x498ebc){return _0x498ebc['update'](_0x1755fa)['then'](function(_0x43189d){return _0x43189d;});}return null;};}function removeEntity(_0x256b78,_0x3edc77){return function(_0x474fa7){if(_0x474fa7){return _0x474fa7[_0xcddd('0x30')]()[_0xcddd('0x31')](function(){_0x256b78[_0xcddd('0x27')](0xcc)[_0xcddd('0x26')]();});}};}function handleEntityNotFound(_0x5ec2a7,_0x32402f){return function(_0x1cc740){if(!_0x1cc740){_0x5ec2a7[_0xcddd('0x25')](0x194);}return _0x1cc740;};}function handleError(_0x588b6f,_0x2c514e){_0x2c514e=_0x2c514e||0x1f4;return function(_0x3318ff){logger[_0xcddd('0x20')](_0x3318ff['stack']);if(_0x3318ff[_0xcddd('0x32')]){delete _0x3318ff['name'];}_0x588b6f['status'](_0x2c514e)[_0xcddd('0x33')](_0x3318ff);};}exports[_0xcddd('0x34')]=function(_0x6b9896,_0x290a88){var _0x367e7b={},_0x50884c={},_0x185e45={'count':0x0,'rows':[]};var _0x113502=_['map'](db[_0xcddd('0x35')][_0xcddd('0x36')],function(_0x21c0c7){return{'name':_0x21c0c7[_0xcddd('0x37')],'type':_0x21c0c7['type'][_0xcddd('0x38')]};});_0x50884c[_0xcddd('0x39')]=_[_0xcddd('0x3a')](_0x113502,_0xcddd('0x32'));_0x50884c['query']=_[_0xcddd('0x3b')](_0x6b9896[_0xcddd('0x3c')]);_0x50884c[_0xcddd('0x3d')]=_[_0xcddd('0x3e')](_0x50884c[_0xcddd('0x39')],_0x50884c[_0xcddd('0x3c')]);_0x367e7b[_0xcddd('0x3f')]=_[_0xcddd('0x3e')](_0x50884c['model'],qs[_0xcddd('0x40')](_0x6b9896[_0xcddd('0x3c')][_0xcddd('0x40')]));_0x367e7b[_0xcddd('0x3f')]=_0x367e7b[_0xcddd('0x3f')][_0xcddd('0x41')]?_0x367e7b[_0xcddd('0x3f')]:_0x50884c[_0xcddd('0x39')];if(!_0x6b9896[_0xcddd('0x3c')][_0xcddd('0x42')](_0xcddd('0x43'))){_0x367e7b[_0xcddd('0x2b')]=qs[_0xcddd('0x2b')](_0x6b9896['query'][_0xcddd('0x2b')]);_0x367e7b[_0xcddd('0x28')]=qs[_0xcddd('0x28')](_0x6b9896[_0xcddd('0x3c')][_0xcddd('0x28')]);}_0x367e7b[_0xcddd('0x44')]=qs['sort'](_0x6b9896['query'][_0xcddd('0x45')]);_0x367e7b['where']=qs[_0xcddd('0x3d')](_[_0xcddd('0x46')](_0x6b9896[_0xcddd('0x3c')],_0x50884c[_0xcddd('0x3d')]),_0x113502);if(_0x6b9896[_0xcddd('0x3c')]['filter']){_0x367e7b[_0xcddd('0x47')]=_[_0xcddd('0x48')](_0x367e7b[_0xcddd('0x47')],{'$or':_[_0xcddd('0x3a')](_0x113502,function(_0x3e0b9a){if(_0x3e0b9a['type']!=='VIRTUAL'){var _0x12763f={};_0x12763f[_0x3e0b9a[_0xcddd('0x32')]]={'$like':'%'+_0x6b9896['query']['filter']+'%'};return _0x12763f;}})});}_0x367e7b=_[_0xcddd('0x48')]({},_0x367e7b,_0x6b9896[_0xcddd('0x49')]);var _0x38f70a={'where':_0x367e7b[_0xcddd('0x47')]};return db['ChatMessage'][_0xcddd('0x2a')](_0x38f70a)['then'](function(_0x5931c5){_0x185e45[_0xcddd('0x2a')]=_0x5931c5;if(_0x6b9896['query'][_0xcddd('0x4a')]){_0x367e7b[_0xcddd('0x4b')]=[{'all':!![]}];}return db['ChatMessage'][_0xcddd('0x4c')](_0x367e7b);})[_0xcddd('0x31')](function(_0x15c0e1){_0x185e45[_0xcddd('0x4d')]=_0x15c0e1;return _0x185e45;})[_0xcddd('0x31')](respondWithFilteredResult(_0x290a88,_0x367e7b))[_0xcddd('0x24')](handleError(_0x290a88,null));};exports['show']=function(_0x5f3501,_0x53424e){var _0x17c051={'raw':!![],'where':{'id':_0x5f3501['params']['id']}},_0x769ec7={};_0x769ec7[_0xcddd('0x39')]=_[_0xcddd('0x3b')](db['ChatMessage'][_0xcddd('0x36')]);_0x769ec7[_0xcddd('0x3c')]=_['keys'](_0x5f3501['query']);_0x769ec7[_0xcddd('0x3d')]=_['intersection'](_0x769ec7[_0xcddd('0x39')],_0x769ec7['query']);_0x17c051['attributes']=_[_0xcddd('0x3e')](_0x769ec7[_0xcddd('0x39')],qs[_0xcddd('0x40')](_0x5f3501['query'][_0xcddd('0x40')]));_0x17c051[_0xcddd('0x3f')]=_0x17c051[_0xcddd('0x3f')][_0xcddd('0x41')]?_0x17c051[_0xcddd('0x3f')]:_0x769ec7[_0xcddd('0x39')];if(_0x5f3501[_0xcddd('0x3c')][_0xcddd('0x4a')]){_0x17c051[_0xcddd('0x4b')]=[{'all':!![]}];}_0x17c051=_[_0xcddd('0x48')]({},_0x17c051,_0x5f3501[_0xcddd('0x49')]);return db[_0xcddd('0x35')][_0xcddd('0x4e')](_0x17c051)['then'](handleEntityNotFound(_0x53424e,null))['then'](respondWithResult(_0x53424e,null))[_0xcddd('0x24')](handleError(_0x53424e,null));};exports['create']=function(_0x37f539,_0x295302){return db[_0xcddd('0x35')][_0xcddd('0x4f')](_0x37f539[_0xcddd('0x50')],{})[_0xcddd('0x31')](respondWithResult(_0x295302,0xc9))['catch'](handleError(_0x295302,null));};exports[_0xcddd('0x51')]=function(_0x4b9a6e,_0x6e1fcb){if(_0x4b9a6e[_0xcddd('0x50')]['id']){delete _0x4b9a6e[_0xcddd('0x50')]['id'];}return db['ChatMessage'][_0xcddd('0x4e')]({'where':{'id':_0x4b9a6e[_0xcddd('0x52')]['id']}})['then'](handleEntityNotFound(_0x6e1fcb,null))['then'](saveUpdates(_0x4b9a6e[_0xcddd('0x50')],null))['then'](respondWithResult(_0x6e1fcb,null))['catch'](handleError(_0x6e1fcb,null));};exports[_0xcddd('0x30')]=function(_0x14b7f3,_0x4f8bf6){return db['ChatMessage']['find']({'where':{'id':_0x14b7f3[_0xcddd('0x52')]['id']}})[_0xcddd('0x31')](handleEntityNotFound(_0x4f8bf6,null))[_0xcddd('0x31')](removeEntity(_0x4f8bf6,null))[_0xcddd('0x24')](handleError(_0x4f8bf6,null));};exports['describe']=function(_0x1f43b0,_0xc3c6fa){return db[_0xcddd('0x35')][_0xcddd('0x53')]()[_0xcddd('0x31')](respondWithResult(_0xc3c6fa,null))['catch'](handleError(_0xc3c6fa,null));};var interaction_log=require(_0xcddd('0x54'))(_0xcddd('0x55'));exports[_0xcddd('0x56')]=function(_0x2f714a,_0x1b5782,_0x28a155){var _0x1995a5={'agent':{},'channel':'chat'};if(_0x2f714a['body']['id']){delete _0x2f714a[_0xcddd('0x50')]['id'];}_0x2f714a[_0xcddd('0x50')]['read']=!![];_0x2f714a[_0xcddd('0x50')][_0xcddd('0x57')]=moment()['format'](_0xcddd('0x58'));_0x2f714a['body'][_0xcddd('0x59')]=_0x2f714a[_0xcddd('0x50')][_0xcddd('0x59')]||_0x2f714a[_0xcddd('0x5a')]['id'];_0x1995a5[_0xcddd('0x5b')]['id']=_0x2f714a[_0xcddd('0x50')][_0xcddd('0x59')];return db[_0xcddd('0x35')]['find']({'where':{'id':_0x2f714a[_0xcddd('0x52')]['id'],'UserId':null}})[_0xcddd('0x31')](handleEntityNotFound(_0x1b5782,null))[_0xcddd('0x31')](saveUpdates(_0x2f714a[_0xcddd('0x50')],null))[_0xcddd('0x31')](function(_0x194aaf){if(_0x194aaf){_0x1995a5['message']=_0x194aaf[_0xcddd('0x5c')]({'plain':!![]});return db[_0xcddd('0x5d')][_0xcddd('0x4e')]({'where':{'id':_0x194aaf[_0xcddd('0x5e')]}});}return null;})[_0xcddd('0x31')](handleEntityNotFound(_0x1b5782,null))[_0xcddd('0x31')](function(_0x4cee37){if(_0x4cee37){return _0x4cee37['update']({'UserId':_0x2f714a['body'][_0xcddd('0x59')],'read1stAt':_[_0xcddd('0x5f')](_0x4cee37[_0xcddd('0x60')])?moment()[_0xcddd('0x61')](_0xcddd('0x58')):undefined});}return null;})['then'](function(_0x3fbefd){if(_0x3fbefd){_0x1995a5[_0xcddd('0x62')]=_0x3fbefd[_0xcddd('0x5c')]({'plain':!![]});interaction_log[_0xcddd('0x1c')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2f714a[_0xcddd('0x5a')]['id'],_0x2f714a[_0xcddd('0x5a')][_0xcddd('0x32')],_0x2f714a[_0xcddd('0x5a')]['role'],_0x1995a5[_0xcddd('0x62')]['id'],_0x2f714a[_0xcddd('0x50')]?JSON[_0xcddd('0x1f')](_0x2f714a['body']):_0xcddd('0x63'));return respondWithRpcPromise('AcceptMessage',_0xcddd('0x64'),_0x1995a5);}return null;})['then'](function(_0x3f6953){var _0x41b9cd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f6953[_0xcddd('0x21')][_0xcddd('0x65')];return db[_0xcddd('0x66')][_0xcddd('0x3c')](_0x41b9cd,{'type':db[_0xcddd('0x67')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x280fd1){return _0x280fd1;});})[_0xcddd('0x31')](function(_0x5ab38f){if(_0x5ab38f){_0x1995a5[_0xcddd('0x21')][_0xcddd('0x68')]=_0x5ab38f[0x0];if(!_0x2f714a[_0xcddd('0x50')][_0xcddd('0x59')])return;return db[_0xcddd('0x69')][_0xcddd('0x4e')]({'where':{'id':_0x2f714a['body'][_0xcddd('0x59')],'role':_0xcddd('0x5b')},'attributes':['id',_0xcddd('0x32'),_0xcddd('0x6a'),_0xcddd('0x6b'),_0xcddd('0x6c')],'raw':!![]});}return null;})[_0xcddd('0x31')](function(_0x1ee350){if(!_0x1ee350)return null;_0x1995a5['message'][_0xcddd('0x5b')]=_0x1ee350;return _0x1995a5;})[_0xcddd('0x31')](function(_0x4d134f){if(_0x4d134f){if(_0x2f714a[_0xcddd('0x50')]['manual']){_0x1995a5[_0xcddd('0x21')]['interface']=util['format'](_0xcddd('0x6d'),_0x2f714a[_0xcddd('0x5a')][_0xcddd('0x32')]);_0x1995a5[_0xcddd('0x21')][_0xcddd('0x6e')]=_0x1995a5['channel'];_0x1995a5[_0xcddd('0x21')][_0xcddd('0x6f')]=_0x1995a5['channel'];_0x1995a5[_0xcddd('0x21')][_0xcddd('0x70')]=_0xcddd('0x56');return respondWithRpcPromise(_0xcddd('0x71'),'EventManager',{'event':'acceptmessage','message':_[_0xcddd('0x48')](_0x1995a5[_0xcddd('0x21')],JSON['parse'](_0x1995a5[_0xcddd('0x62')][_0xcddd('0x72')]))},client9002)[_0xcddd('0x31')](function(){return _0x1995a5;});}return _0x1995a5;}return null;})[_0xcddd('0x31')](respondWithResult(_0x1b5782,null))[_0xcddd('0x24')](handleError(_0x1b5782,null));};var interaction_log=require(_0xcddd('0x54'))('chat-interactions');exports[_0xcddd('0x73')]=function(_0x3e5edb,_0x5e8194,_0x56753a){var _0x4b9e02={'agent':{},'channel':_0xcddd('0x74')};if(_0x3e5edb[_0xcddd('0x50')]['id']){delete _0x3e5edb[_0xcddd('0x50')]['id'];}_0x3e5edb[_0xcddd('0x50')][_0xcddd('0x59')]=_0x3e5edb[_0xcddd('0x50')][_0xcddd('0x59')]||_0x3e5edb[_0xcddd('0x5a')]['id'];_0x4b9e02[_0xcddd('0x5b')]['id']=_0x3e5edb[_0xcddd('0x50')]['UserId'];return db[_0xcddd('0x35')][_0xcddd('0x4e')]({'where':{'id':_0x3e5edb[_0xcddd('0x52')]['id'],'UserId':null}})[_0xcddd('0x31')](handleEntityNotFound(_0x5e8194,null))[_0xcddd('0x31')](function(_0x4ffb9a){if(_0x4ffb9a){_0x4b9e02['message']=_0x4ffb9a[_0xcddd('0x5c')]({'plain':!![]});return db[_0xcddd('0x5d')][_0xcddd('0x4e')]({'where':{'id':_0x4ffb9a[_0xcddd('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x5e8194,null))[_0xcddd('0x31')](function(_0x3e6e32){if(_0x3e6e32){_0x4b9e02[_0xcddd('0x62')]=_0x3e6e32['get']({'plain':!![]});interaction_log[_0xcddd('0x1c')](_0xcddd('0x75'),_0x3e5edb[_0xcddd('0x5a')]['id'],_0x3e5edb[_0xcddd('0x5a')]['name'],_0x3e5edb['user']['role'],_0x4b9e02[_0xcddd('0x62')]['id'],_0x3e5edb[_0xcddd('0x50')]?JSON[_0xcddd('0x1f')](_0x3e5edb[_0xcddd('0x50')]):_0xcddd('0x63'));return respondWithRpcPromise('RejectMessage',_0xcddd('0x76'),_0x4b9e02);}return null;})[_0xcddd('0x31')](function(_0x458a1c){var _0xec134e=_0xcddd('0x77')+_0x458a1c[_0xcddd('0x21')][_0xcddd('0x65')];return db[_0xcddd('0x66')][_0xcddd('0x3c')](_0xec134e,{'type':db[_0xcddd('0x67')][_0xcddd('0x78')][_0xcddd('0x79')],'raw':!![]})[_0xcddd('0x31')](function(_0x3c4403){return _0x3c4403;});})['then'](function(_0x1c2e79){if(_0x1c2e79){_0x4b9e02[_0xcddd('0x21')][_0xcddd('0x68')]=_0x1c2e79[0x0];if(!_0x3e5edb[_0xcddd('0x50')][_0xcddd('0x59')])return;return db[_0xcddd('0x69')][_0xcddd('0x4e')]({'where':{'id':_0x3e5edb[_0xcddd('0x50')][_0xcddd('0x59')],'role':_0xcddd('0x5b')},'attributes':['id',_0xcddd('0x32'),_0xcddd('0x6a'),_0xcddd('0x6b'),_0xcddd('0x6c')],'raw':!![]});}return null;})[_0xcddd('0x31')](function(_0x3a677b){if(!_0x3a677b)return null;_0x4b9e02[_0xcddd('0x21')][_0xcddd('0x5b')]=_0x3a677b;return _0x4b9e02;})[_0xcddd('0x31')](function(_0x3178ea){if(_0x3178ea){_0x3178ea[_0xcddd('0x21')][_0xcddd('0x7a')]=util[_0xcddd('0x61')]('SIP/%s',_0x3e5edb[_0xcddd('0x5a')][_0xcddd('0x32')]);_0x3178ea[_0xcddd('0x21')][_0xcddd('0x6e')]=_0x4b9e02[_0xcddd('0x6e')];_0x3178ea['message'][_0xcddd('0x6f')]=_0x4b9e02[_0xcddd('0x6e')];_0x3178ea[_0xcddd('0x21')][_0xcddd('0x70')]=_0xcddd('0x73');respondWithRpcPromise(_0xcddd('0x71'),_0xcddd('0x71'),{'event':_0xcddd('0x7b'),'message':_[_0xcddd('0x48')](_0x4b9e02['message'],JSON[_0xcddd('0x7c')](_0x4b9e02['interaction']['formData']))},client9002);return _0x4b9e02;}return null;})[_0xcddd('0x31')](respondWithResult(_0x5e8194,null))[_0xcddd('0x24')](handleError(_0x5e8194,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 692c5d4..ccaf037 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 _0x5a2d=['save','remove','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x5a4d23,_0x45281){var _0x5108eb=function(_0x5ea989){while(--_0x5ea989){_0x5a4d23['push'](_0x5a4d23['shift']());}};_0x5108eb(++_0x45281);}(_0x5a2d,0x17f));var _0xd5a2=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0x5a2d[_0x4e4519];return _0x340044;};'use strict';var EventEmitter=require(_0xd5a2('0x0'));var ChatMessage=require(_0xd5a2('0x1'))['db'][_0xd5a2('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd5a2('0x3')](0x0);var events={'afterCreate':_0xd5a2('0x4'),'afterUpdate':'update','afterDestroy':_0xd5a2('0x5')};function emitEvent(_0x4008a3){return function(_0x427b21,_0x5e388b,_0x2845da){ChatMessageEvents['emit'](_0x4008a3+':'+_0x427b21['id'],_0x427b21);ChatMessageEvents[_0xd5a2('0x6')](_0x4008a3,_0x427b21);_0x2845da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xd5a2('0x7')](e,emitEvent(event));}}module[_0xd5a2('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x6d5b=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x246484,_0x339979){var _0x508019=function(_0x2317e8){while(--_0x2317e8){_0x246484['push'](_0x246484['shift']());}};_0x508019(++_0x339979);}(_0x6d5b,0x19e));var _0xb6d5=function(_0x893cd2,_0x504808){_0x893cd2=_0x893cd2-0x0;var _0x5a36b5=_0x6d5b[_0x893cd2];return _0x5a36b5;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb6d5('0x0'))['db'][_0xb6d5('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb6d5('0x2')](0x0);var events={'afterCreate':_0xb6d5('0x3'),'afterUpdate':_0xb6d5('0x4'),'afterDestroy':_0xb6d5('0x5')};function emitEvent(_0x28e98a){return function(_0xa52db1,_0x1f3ea4,_0x2fae09){ChatMessageEvents['emit'](_0x28e98a+':'+_0xa52db1['id'],_0xa52db1);ChatMessageEvents[_0xb6d5('0x6')](_0x28e98a,_0xa52db1);_0x2fae09(null);};}for(var e in events){if(events[_0xb6d5('0x7')](e)){var event=events[e];ChatMessage[_0xb6d5('0x8')](e,emitEvent(event));}}module[_0xb6d5('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 fc13a8e..e391a87 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 _0x2913=['models','get','direction','secret','isNil','findOne','then','update','createdAt','toLowerCase','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT'];(function(_0x184115,_0x1fe4ad){var _0x1a810d=function(_0x176d62){while(--_0x176d62){_0x184115['push'](_0x184115['shift']());}};_0x1a810d(++_0x1fe4ad);}(_0x2913,0x1c7));var _0x3291=function(_0xec4fa9,_0x5e70b4){_0xec4fa9=_0xec4fa9-0x0;var _0x242dd2=_0x2913[_0xec4fa9];return _0x242dd2;};'use strict';var _=require(_0x3291('0x0'));var util=require(_0x3291('0x1'));var logger=require(_0x3291('0x2'))(_0x3291('0x3'));var moment=require(_0x3291('0x4'));var BPromise=require(_0x3291('0x5'));var rp=require(_0x3291('0x6'));var fs=require('fs');var path=require(_0x3291('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x1d0abd,_0x5b915c){return _0x1d0abd[_0x3291('0x8')](_0x3291('0x9'),attributes,{'tableName':_0x3291('0xa'),'paranoid':![],'indexes':[{'name':_0x3291('0xb'),'fields':['body'],'type':_0x3291('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f94ba,_0x1d5bb7,_0x27c936){var _0x15aa15=_0x1d0abd[_0x3291('0xd')];var _0x3c12dc=_0x3f94ba[_0x3291('0xe')]({'plain':!![]});if(_0x3c12dc[_0x3291('0xf')]['toLowerCase']()==='in'||_0x3c12dc[_0x3291('0xf')]['toLowerCase']()==='out'&&!_0x3c12dc[_0x3291('0x10')]&&!_[_0x3291('0x11')](_0x3c12dc['UserId'])){_0x15aa15['ChatInteraction'][_0x3291('0x12')]({'where':{'id':_0x3c12dc['ChatInteractionId']}})[_0x3291('0x13')](function(_0x57ac78){if(_0x57ac78){_0x57ac78[_0x3291('0x14')]({'lastMsgAt':_0x3c12dc[_0x3291('0x15')],'lastMsgDirection':_0x3c12dc[_0x3291('0xf')][_0x3291('0x16')]()});}})[_0x3291('0x17')](function(_0x35a286){console[_0x3291('0x18')](_0x35a286);});}_0x27c936();}},'charset':_0x3291('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xcc08=['request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','toLowerCase','direction','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','lodash','../../config/logger','api','moment','bluebird'];(function(_0x34a2aa,_0x51846f){var _0x4ea6ec=function(_0x1e0865){while(--_0x1e0865){_0x34a2aa['push'](_0x34a2aa['shift']());}};_0x4ea6ec(++_0x51846f);}(_0xcc08,0xe3));var _0x8cc0=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xcc08[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0x8cc0('0x0'));var util=require('util');var logger=require(_0x8cc0('0x1'))(_0x8cc0('0x2'));var moment=require(_0x8cc0('0x3'));var BPromise=require(_0x8cc0('0x4'));var rp=require(_0x8cc0('0x5'));var fs=require('fs');var path=require(_0x8cc0('0x6'));var rimraf=require(_0x8cc0('0x7'));var config=require(_0x8cc0('0x8'));var attributes=require(_0x8cc0('0x9'));module[_0x8cc0('0xa')]=function(_0x14bf1c,_0x842217){return _0x14bf1c[_0x8cc0('0xb')](_0x8cc0('0xc'),attributes,{'tableName':_0x8cc0('0xd'),'paranoid':![],'indexes':[{'name':_0x8cc0('0xe'),'fields':[_0x8cc0('0xf')],'type':_0x8cc0('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb0af7f,_0x504906,_0x57030a){var _0x514dbd=_0x14bf1c[_0x8cc0('0x11')];var _0x158802=_0xb0af7f['get']({'plain':!![]});if(_0x158802['direction'][_0x8cc0('0x12')]()==='in'||_0x158802[_0x8cc0('0x13')][_0x8cc0('0x12')]()==='out'&&!_0x158802['secret']&&!_['isNil'](_0x158802[_0x8cc0('0x14')])){_0x514dbd[_0x8cc0('0x15')][_0x8cc0('0x16')]({'where':{'id':_0x158802[_0x8cc0('0x17')]}})[_0x8cc0('0x18')](function(_0x570145){if(_0x570145){_0x570145[_0x8cc0('0x19')]({'lastMsgAt':_0x158802[_0x8cc0('0x1a')],'lastMsgDirection':_0x158802[_0x8cc0('0x13')]['toLowerCase']()});}})[_0x8cc0('0x1b')](function(_0x5d9efd){console[_0x8cc0('0x1c')](_0x5d9efd);});}_0x57030a();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index fed4aea..8e1beba 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 _0xeba9=['request\x20sent','stringify','code','error','message','ChatMessage','create','options','raw','CreateChatMessage','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x57e6e2,_0x225f52){var _0x2734d6=function(_0x53791d){while(--_0x53791d){_0x57e6e2['push'](_0x57e6e2['shift']());}};_0x2734d6(++_0x225f52);}(_0xeba9,0xeb));var _0x9eba=function(_0xce1079,_0x59a87f){_0xce1079=_0xce1079-0x0;var _0x118ac4=_0xeba9[_0xce1079];return _0x118ac4;};'use strict';var _=require(_0x9eba('0x0'));var util=require('util');var moment=require(_0x9eba('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9eba('0x2'));var db=require(_0x9eba('0x3'))['db'];var utils=require(_0x9eba('0x4'));var logger=require(_0x9eba('0x5'))('rpc');var config=require(_0x9eba('0x6'));var jayson=require(_0x9eba('0x7'));var client=jayson[_0x9eba('0x8')][_0x9eba('0x9')]({'port':0x232a});config[_0x9eba('0xa')]=_[_0x9eba('0xb')](config[_0x9eba('0xa')],{'host':_0x9eba('0xc'),'port':0x18eb});var socket=require(_0x9eba('0xd'))(new Redis(config[_0x9eba('0xa')]));require(_0x9eba('0xe'))['register'](socket);function respondWithRpcPromise(_0x3b22e4,_0x3646bc,_0x102080){return new BPromise(function(_0x71a6f3,_0x424d61){return client[_0x9eba('0xf')](_0x3b22e4,_0x102080)[_0x9eba('0x10')](function(_0x3b7924){logger[_0x9eba('0x11')](_0x9eba('0x12'),_0x3646bc,'request\x20sent');logger[_0x9eba('0x13')](_0x9eba('0x14'),_0x3646bc,_0x9eba('0x15'),JSON[_0x9eba('0x16')](_0x3b7924));if(_0x3b7924['error']){if(_0x3b7924['error'][_0x9eba('0x17')]===0x1f4){logger[_0x9eba('0x18')](_0x9eba('0x12'),_0x3646bc,_0x3b7924[_0x9eba('0x18')]['message']);return _0x424d61(_0x3b7924[_0x9eba('0x18')]['message']);}logger[_0x9eba('0x18')](_0x9eba('0x12'),_0x3646bc,_0x3b7924[_0x9eba('0x18')]['message']);return _0x71a6f3(_0x3b7924['error'][_0x9eba('0x19')]);}else{logger[_0x9eba('0x11')](_0x9eba('0x12'),_0x3646bc,_0x9eba('0x15'));_0x71a6f3(_0x3b7924['result'][_0x9eba('0x19')]);}})['catch'](function(_0x328b44){logger[_0x9eba('0x18')](_0x9eba('0x12'),_0x3646bc,_0x328b44);_0x424d61(_0x328b44);});});}exports['CreateChatMessage']=function(_0x3ab7bb){var _0xf3fbb7=this;return new Promise(function(_0x484846,_0x33e6e8){return db[_0x9eba('0x1a')][_0x9eba('0x1b')](_0x3ab7bb['body'],{'raw':_0x3ab7bb[_0x9eba('0x1c')]?_0x3ab7bb[_0x9eba('0x1c')][_0x9eba('0x1d')]===undefined?!![]:![]:!![]})[_0x9eba('0x10')](function(_0xf1d972){logger[_0x9eba('0x11')]('CreateChatMessage',_0x3ab7bb);logger[_0x9eba('0x13')](_0x9eba('0x1e'),_0x3ab7bb,JSON[_0x9eba('0x16')](_0xf1d972));_0x484846(_0xf1d972);})[_0x9eba('0x1f')](function(_0x54cb21){logger[_0x9eba('0x18')]('CreateChatMessage',_0x54cb21[_0x9eba('0x19')],_0x3ab7bb);_0x33e6e8(_0xf3fbb7['error'](0x1f4,_0x54cb21['message']));});});};
\ No newline at end of file
+var _0xc39e=['message','result','CreateChatMessage','ChatMessage','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc39e,0x1b9));var _0xec39=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xc39e[_0x104e21];return _0x605b37;};'use strict';var _=require('lodash');var util=require(_0xec39('0x0'));var moment=require(_0xec39('0x1'));var BPromise=require(_0xec39('0x2'));var rs=require(_0xec39('0x3'));var fs=require('fs');var Redis=require(_0xec39('0x4'));var db=require(_0xec39('0x5'))['db'];var utils=require(_0xec39('0x6'));var logger=require(_0xec39('0x7'))('rpc');var config=require(_0xec39('0x8'));var jayson=require(_0xec39('0x9'));var client=jayson['client'][_0xec39('0xa')]({'port':0x232a});config[_0xec39('0xb')]=_[_0xec39('0xc')](config[_0xec39('0xb')],{'host':_0xec39('0xd'),'port':0x18eb});var socket=require(_0xec39('0xe'))(new Redis(config['redis']));require(_0xec39('0xf'))[_0xec39('0x10')](socket);function respondWithRpcPromise(_0x4e7d0e,_0x7b7a36,_0x3511e1){return new BPromise(function(_0x475573,_0x4e20d6){return client[_0xec39('0x11')](_0x4e7d0e,_0x3511e1)['then'](function(_0x251d44){logger[_0xec39('0x12')](_0xec39('0x13'),_0x7b7a36,_0xec39('0x14'));logger[_0xec39('0x15')](_0xec39('0x16'),_0x7b7a36,_0xec39('0x14'),JSON['stringify'](_0x251d44));if(_0x251d44['error']){if(_0x251d44[_0xec39('0x17')]['code']===0x1f4){logger[_0xec39('0x17')](_0xec39('0x13'),_0x7b7a36,_0x251d44[_0xec39('0x17')][_0xec39('0x18')]);return _0x4e20d6(_0x251d44['error'][_0xec39('0x18')]);}logger[_0xec39('0x17')]('ChatMessage,\x20%s,\x20%s',_0x7b7a36,_0x251d44[_0xec39('0x17')]['message']);return _0x475573(_0x251d44[_0xec39('0x17')][_0xec39('0x18')]);}else{logger[_0xec39('0x12')](_0xec39('0x13'),_0x7b7a36,_0xec39('0x14'));_0x475573(_0x251d44[_0xec39('0x19')][_0xec39('0x18')]);}})['catch'](function(_0xfb231b){logger['error'](_0xec39('0x13'),_0x7b7a36,_0xfb231b);_0x4e20d6(_0xfb231b);});});}exports[_0xec39('0x1a')]=function(_0x65ee0b){var _0x5703c2=this;return new Promise(function(_0x4421b2,_0x2d0498){return db[_0xec39('0x1b')]['create'](_0x65ee0b['body'],{'raw':_0x65ee0b[_0xec39('0x1c')]?_0x65ee0b[_0xec39('0x1c')][_0xec39('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2f847f){logger[_0xec39('0x12')](_0xec39('0x1a'),_0x65ee0b);logger[_0xec39('0x15')](_0xec39('0x1a'),_0x65ee0b,JSON['stringify'](_0x2f847f));_0x4421b2(_0x2f847f);})[_0xec39('0x1e')](function(_0x5a8d31){logger[_0xec39('0x17')](_0xec39('0x1a'),_0x5a8d31[_0xec39('0x18')],_0x65ee0b);_0x2d0498(_0x5703c2['error'](0x1f4,_0x5a8d31[_0xec39('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index f82e34b..eb4c1bd 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 _0x5455=['remove','update','emit','removeListener','register','length','chatMessage:','save'];(function(_0x2bbf97,_0x54d5e6){var _0x7a938=function(_0x37262b){while(--_0x37262b){_0x2bbf97['push'](_0x2bbf97['shift']());}};_0x7a938(++_0x54d5e6);}(_0x5455,0x197));var _0x5545=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5455[_0x19950b];return _0x3c6b41;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5545('0x0'),_0x5545('0x1'),_0x5545('0x2')];function createListener(_0x414d1c,_0xba68b3){return function(_0x38b608){_0xba68b3[_0x5545('0x3')](_0x414d1c,_0x38b608);};}function removeListener(_0x4cd466,_0x48fce5){return function(){ChatMessageEvents[_0x5545('0x4')](_0x4cd466,_0x48fce5);};}exports[_0x5545('0x5')]=function(_0x5c22f1){for(var _0x5a6ac7=0x0,_0x2ea57f=events[_0x5545('0x6')];_0x5a6ac7<_0x2ea57f;_0x5a6ac7++){var _0x5c2476=events[_0x5a6ac7];var _0x9cbb0d=createListener(_0x5545('0x7')+_0x5c2476,_0x5c22f1);ChatMessageEvents['on'](_0x5c2476,_0x9cbb0d);}};
\ No newline at end of file
+var _0xf873=['register','length','chatMessage:','save','remove','update','emit'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xf873,0xb2));var _0x3f87=function(_0x38790e,_0x3f9bc2){_0x38790e=_0x38790e-0x0;var _0x1a1d22=_0xf873[_0x38790e];return _0x1a1d22;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x3f87('0x0'),_0x3f87('0x1'),_0x3f87('0x2')];function createListener(_0x3ef688,_0x1c56a3){return function(_0xd4592c){_0x1c56a3[_0x3f87('0x3')](_0x3ef688,_0xd4592c);};}function removeListener(_0x1d68dd,_0x3c80d6){return function(){ChatMessageEvents['removeListener'](_0x1d68dd,_0x3c80d6);};}exports[_0x3f87('0x4')]=function(_0x43c8e4){for(var _0x27c03e=0x0,_0x5a5e37=events[_0x3f87('0x5')];_0x27c03e<_0x5a5e37;_0x27c03e++){var _0x2c7ccc=events[_0x27c03e];var _0x3b8e92=createListener(_0x3f87('0x6')+_0x2c7ccc,_0x43c8e4);ChatMessageEvents['on'](_0x2c7ccc,_0x3b8e92);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 6929514..413690d 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 _0x24b4=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','destroy','exports','util'];(function(_0x5209ef,_0x3a4592){var _0x63f75f=function(_0x2591e1){while(--_0x2591e1){_0x5209ef['push'](_0x5209ef['shift']());}};_0x63f75f(++_0x3a4592);}(_0x24b4,0x167));var _0x424b=function(_0x5a7725,_0x352098){_0x5a7725=_0x5a7725-0x0;var _0x36f933=_0x24b4[_0x5a7725];return _0x36f933;};'use strict';var multer=require('multer');var util=require(_0x424b('0x0'));var path=require(_0x424b('0x1'));var timeout=require(_0x424b('0x2'));var express=require(_0x424b('0x3'));var router=express[_0x424b('0x4')]();var fs_extra=require(_0x424b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x424b('0x6'));var config=require(_0x424b('0x7'));var controller=require(_0x424b('0x8'));router[_0x424b('0x9')]('/',auth[_0x424b('0xa')](),controller['index']);router[_0x424b('0x9')](_0x424b('0xb'),auth[_0x424b('0xa')](),controller[_0x424b('0xc')]);router[_0x424b('0x9')](_0x424b('0xd'),auth[_0x424b('0xa')](),controller[_0x424b('0xe')]);router[_0x424b('0xf')]('/',auth[_0x424b('0xa')](),interaction[_0x424b('0x10')](_0x424b('0x11'),_0x424b('0x12')),controller[_0x424b('0x13')]);router[_0x424b('0x14')](_0x424b('0xd'),controller[_0x424b('0x15')]);router[_0x424b('0x14')]('/:id/accept',auth[_0x424b('0xa')](),controller['accept']);router[_0x424b('0x14')]('/:id/reject',auth[_0x424b('0xa')](),controller['reject']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x424b('0x16')]);module[_0x424b('0x17')]=router;
\ No newline at end of file
+var _0x78b0=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','post','tracked','chat','chatmessage:create','/:id/accept','put','/:id/reject','reject','delete'];(function(_0x5bf485,_0x339edb){var _0x57cd1a=function(_0x590b34){while(--_0x590b34){_0x5bf485['push'](_0x5bf485['shift']());}};_0x57cd1a(++_0x339edb);}(_0x78b0,0x1dd));var _0x078b=function(_0x25e211,_0x2778fd){_0x25e211=_0x25e211-0x0;var _0x4e3f93=_0x78b0[_0x25e211];return _0x4e3f93;};'use strict';var multer=require(_0x078b('0x0'));var util=require('util');var path=require(_0x078b('0x1'));var timeout=require(_0x078b('0x2'));var express=require('express');var router=express[_0x078b('0x3')]();var fs_extra=require(_0x078b('0x4'));var auth=require(_0x078b('0x5'));var interaction=require(_0x078b('0x6'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth[_0x078b('0x7')](),controller[_0x078b('0x8')]);router['get'](_0x078b('0x9'),auth[_0x078b('0x7')](),controller[_0x078b('0xa')]);router[_0x078b('0xb')](_0x078b('0xc'),auth[_0x078b('0x7')](),controller[_0x078b('0xd')]);router[_0x078b('0xe')]('/',auth[_0x078b('0x7')](),interaction[_0x078b('0xf')](_0x078b('0x10'),_0x078b('0x11')),controller['create']);router['put'](_0x078b('0xc'),controller['update']);router['put'](_0x078b('0x12'),auth[_0x078b('0x7')](),controller['accept']);router[_0x078b('0x13')](_0x078b('0x14'),auth['isAuthenticated'](),controller[_0x078b('0x15')]);router[_0x078b('0x16')](_0x078b('0xc'),auth['isAuthenticated'](),controller[_0x078b('0x17')]);module[_0x078b('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index f3d7151..6c95288 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x12877b,_0x8650cf){_0x12877b=_0x12877b-0x0;var _0x3549ff=_0x0b0e[_0x12877b];return _0x3549ff;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x1de1be,_0x52d59f){var _0x3eb24b=function(_0x18c190){while(--_0x18c190){_0x1de1be['push'](_0x1de1be['shift']());}};_0x3eb24b(++_0x52d59f);}(_0xb10b,0x12a));var _0xbb10=function(_0x315861,_0x735b4){_0x315861=_0x315861-0x0;var _0x3e2b76=_0xb10b[_0x315861];return _0x3e2b76;};'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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 8802736..30c4f38 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x7a54,0x106));var _0x47a5=function(_0xd561ce,_0x5efbd2){_0xd561ce=_0xd561ce-0x0;var _0x1e7118=_0x7a54[_0xd561ce];return _0x1e7118;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x7a54,0x106));var _0x47a5=function(_0x311dfa,_0x1096f){_0x311dfa=_0x311dfa-0x0;var _0x3184b6=_0x7a54[_0x311dfa];return _0x3184b6;};'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 82f3d26..d841b67 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 _0x6d43=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0x164ddb,_0x460d50){var _0x467142=function(_0x543562){while(--_0x543562){_0x164ddb['push'](_0x164ddb['shift']());}};_0x467142(++_0x460d50);}(_0x6d43,0xe8));var _0x36d4=function(_0x5acaa4,_0xe42e0){_0x5acaa4=_0x5acaa4-0x0;var _0x1205fd=_0x6d43[_0x5acaa4];return _0x1205fd;};'use strict';var EventEmitter=require(_0x36d4('0x0'));var ChatOfflineMessage=require(_0x36d4('0x1'))['db'][_0x36d4('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x36d4('0x3')](0x0);var events={'afterCreate':_0x36d4('0x4'),'afterUpdate':_0x36d4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x63a7d9){return function(_0x17c6bf,_0x23c865,_0xc122f7){ChatOfflineMessageEvents['emit'](_0x63a7d9+':'+_0x17c6bf['id'],_0x17c6bf);ChatOfflineMessageEvents['emit'](_0x63a7d9,_0x17c6bf);_0xc122f7(null);};}for(var e in events){if(events[_0x36d4('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x36d4('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xdd33=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','remove'];(function(_0x1a0dc5,_0x21afef){var _0x55a5e4=function(_0x5c8165){while(--_0x5c8165){_0x1a0dc5['push'](_0x1a0dc5['shift']());}};_0x55a5e4(++_0x21afef);}(_0xdd33,0x1c6));var _0x3dd3=function(_0x12b05f,_0x50eb4c){_0x12b05f=_0x12b05f-0x0;var _0x15b135=_0xdd33[_0x12b05f];return _0x15b135;};'use strict';var EventEmitter=require(_0x3dd3('0x0'));var ChatOfflineMessage=require(_0x3dd3('0x1'))['db'][_0x3dd3('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3dd3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3dd3('0x4')};function emitEvent(_0x34930f){return function(_0xaac443,_0x9f29dd,_0x12823f){ChatOfflineMessageEvents[_0x3dd3('0x5')](_0x34930f+':'+_0xaac443['id'],_0xaac443);ChatOfflineMessageEvents['emit'](_0x34930f,_0xaac443);_0x12823f(null);};}for(var e in events){if(events[_0x3dd3('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3dd3('0x7')](e,emitEvent(event));}}module[_0x3dd3('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 7b23e0a..4459f4f 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 _0x02c7=['define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x504ff0,_0x1dcb50){var _0x9ca9b8=function(_0x540450){while(--_0x540450){_0x504ff0['push'](_0x504ff0['shift']());}};_0x9ca9b8(++_0x1dcb50);}(_0x02c7,0x1c1));var _0x702c=function(_0x4c742c,_0x3c1c46){_0x4c742c=_0x4c742c-0x0;var _0x5a0551=_0x02c7[_0x4c742c];return _0x5a0551;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x702c('0x0')]=function(_0x51adb4){return _0x51adb4[_0x702c('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x702c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x702c('0x3'),'collate':_0x702c('0x4')});};
\ No newline at end of file
+var _0xa09f=['utf8mb4_unicode_ci','define','ChatOfflineMessage','utf8mb4'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa09f,0x145));var _0xfa09=function(_0x4b3f00,_0xae36f2){_0x4b3f00=_0x4b3f00-0x0;var _0x471448=_0xa09f[_0x4b3f00];return _0x471448;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x315e49){return _0x315e49[_0xfa09('0x0')](_0xfa09('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa09('0x2'),'collate':_0xfa09('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 23fd28c..4e0856d 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 _0x3d4f=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5572b7,_0x244036){var _0x1bc232=function(_0x338cc0){while(--_0x338cc0){_0x5572b7['push'](_0x5572b7['shift']());}};_0x1bc232(++_0x244036);}(_0x3d4f,0x9f));var _0xf3d4=function(_0x353abb,_0x194c80){_0x353abb=_0x353abb-0x0;var _0x43c9c5=_0x3d4f[_0x353abb];return _0x43c9c5;};'use strict';var _=require(_0xf3d4('0x0'));var util=require(_0xf3d4('0x1'));var moment=require(_0xf3d4('0x2'));var BPromise=require(_0xf3d4('0x3'));var rs=require(_0xf3d4('0x4'));var fs=require('fs');var Redis=require(_0xf3d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3d4('0x6'));var logger=require('../../config/logger')(_0xf3d4('0x7'));var config=require(_0xf3d4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf3d4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b85a5,_0xc01d91,_0x344d29){return new BPromise(function(_0x362423,_0x591671){return client[_0xf3d4('0xa')](_0x1b85a5,_0x344d29)[_0xf3d4('0xb')](function(_0x4e4c22){logger['info'](_0xf3d4('0xc'),_0xc01d91,'request\x20sent');logger[_0xf3d4('0xd')](_0xf3d4('0xe'),_0xc01d91,_0xf3d4('0xf'),JSON[_0xf3d4('0x10')](_0x4e4c22));if(_0x4e4c22[_0xf3d4('0x11')]){if(_0x4e4c22[_0xf3d4('0x11')][_0xf3d4('0x12')]===0x1f4){logger[_0xf3d4('0x11')](_0xf3d4('0xc'),_0xc01d91,_0x4e4c22[_0xf3d4('0x11')][_0xf3d4('0x13')]);return _0x591671(_0x4e4c22[_0xf3d4('0x11')][_0xf3d4('0x13')]);}logger[_0xf3d4('0x11')](_0xf3d4('0xc'),_0xc01d91,_0x4e4c22[_0xf3d4('0x11')][_0xf3d4('0x13')]);return _0x362423(_0x4e4c22['error']['message']);}else{logger['info'](_0xf3d4('0xc'),_0xc01d91,_0xf3d4('0xf'));_0x362423(_0x4e4c22[_0xf3d4('0x14')][_0xf3d4('0x13')]);}})[_0xf3d4('0x15')](function(_0xa24879){logger[_0xf3d4('0x11')](_0xf3d4('0xc'),_0xc01d91,_0xa24879);_0x591671(_0xa24879);});});}
\ No newline at end of file
+var _0x95bb=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment'];(function(_0x678774,_0x4e110d){var _0x56c83a=function(_0xcedc08){while(--_0xcedc08){_0x678774['push'](_0x678774['shift']());}};_0x56c83a(++_0x4e110d);}(_0x95bb,0xed));var _0xb95b=function(_0x4d04d4,_0x4d449e){_0x4d04d4=_0x4d04d4-0x0;var _0x2537aa=_0x95bb[_0x4d04d4];return _0x2537aa;};'use strict';var _=require(_0xb95b('0x0'));var util=require(_0xb95b('0x1'));var moment=require(_0xb95b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb95b('0x3'));var fs=require('fs');var Redis=require(_0xb95b('0x4'));var db=require(_0xb95b('0x5'))['db'];var utils=require(_0xb95b('0x6'));var logger=require('../../config/logger')(_0xb95b('0x7'));var config=require(_0xb95b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb95b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17a603,_0x13a670,_0x5169bf){return new BPromise(function(_0x2a53ec,_0xa3e4){return client['request'](_0x17a603,_0x5169bf)[_0xb95b('0xa')](function(_0x286a87){logger['info'](_0xb95b('0xb'),_0x13a670,_0xb95b('0xc'));logger[_0xb95b('0xd')](_0xb95b('0xe'),_0x13a670,_0xb95b('0xc'),JSON['stringify'](_0x286a87));if(_0x286a87[_0xb95b('0xf')]){if(_0x286a87[_0xb95b('0xf')][_0xb95b('0x10')]===0x1f4){logger[_0xb95b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x13a670,_0x286a87[_0xb95b('0xf')]['message']);return _0xa3e4(_0x286a87[_0xb95b('0xf')][_0xb95b('0x11')]);}logger[_0xb95b('0xf')](_0xb95b('0xb'),_0x13a670,_0x286a87[_0xb95b('0xf')]['message']);return _0x2a53ec(_0x286a87[_0xb95b('0xf')][_0xb95b('0x11')]);}else{logger[_0xb95b('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x13a670,_0xb95b('0xc'));_0x2a53ec(_0x286a87['result']['message']);}})[_0xb95b('0x13')](function(_0x2b3fee){logger[_0xb95b('0xf')](_0xb95b('0xb'),_0x13a670,_0x2b3fee);_0xa3e4(_0x2b3fee);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e29b91c..31867c7 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 _0x4aa6=['put','/:id','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','show','post','create'];(function(_0x3c9eb2,_0x161a8a){var _0x2333ca=function(_0x42fc68){while(--_0x42fc68){_0x3c9eb2['push'](_0x3c9eb2['shift']());}};_0x2333ca(++_0x161a8a);}(_0x4aa6,0x12f));var _0x64aa=function(_0xbac4c1,_0x2c36e1){_0xbac4c1=_0xbac4c1-0x0;var _0x3415e2=_0x4aa6[_0xbac4c1];return _0x3415e2;};'use strict';var multer=require(_0x64aa('0x0'));var util=require(_0x64aa('0x1'));var path=require(_0x64aa('0x2'));var timeout=require('connect-timeout');var express=require(_0x64aa('0x3'));var router=express[_0x64aa('0x4')]();var fs_extra=require(_0x64aa('0x5'));var auth=require(_0x64aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x64aa('0x7'));var controller=require(_0x64aa('0x8'));router[_0x64aa('0x9')]('/',auth['isAuthenticated'](),controller[_0x64aa('0xa')]);router['get'](_0x64aa('0xb'),auth[_0x64aa('0xc')](),controller[_0x64aa('0xd')]);router['get']('/:id',auth[_0x64aa('0xc')](),controller[_0x64aa('0xe')]);router[_0x64aa('0xf')]('/',auth[_0x64aa('0xc')](),controller[_0x64aa('0x10')]);router[_0x64aa('0x11')](_0x64aa('0x12'),auth[_0x64aa('0xc')](),controller[_0x64aa('0x13')]);router['delete'](_0x64aa('0x12'),auth[_0x64aa('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x455b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x455b,0xd9));var _0xb455=function(_0x10aca9,_0x3be855){_0x10aca9=_0x10aca9-0x0;var _0x2dfec2=_0x455b[_0x10aca9];return _0x2dfec2;};'use strict';var multer=require('multer');var util=require(_0xb455('0x0'));var path=require(_0xb455('0x1'));var timeout=require(_0xb455('0x2'));var express=require(_0xb455('0x3'));var router=express[_0xb455('0x4')]();var fs_extra=require(_0xb455('0x5'));var auth=require(_0xb455('0x6'));var interaction=require(_0xb455('0x7'));var config=require(_0xb455('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0xb455('0x9')]('/',auth[_0xb455('0xa')](),controller[_0xb455('0xb')]);router[_0xb455('0x9')](_0xb455('0xc'),auth[_0xb455('0xa')](),controller[_0xb455('0xd')]);router['get'](_0xb455('0xe'),auth[_0xb455('0xa')](),controller[_0xb455('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb455('0x10')]);router[_0xb455('0x11')](_0xb455('0xe'),auth[_0xb455('0xa')](),controller[_0xb455('0x12')]);router[_0xb455('0x13')](_0xb455('0xe'),auth['isAuthenticated'](),controller[_0xb455('0x14')]);module[_0xb455('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index ce9978b..459b0be 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 _0xc149=['mouseOver','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x41ffa2,_0x84a9fd){var _0x2e1894=function(_0x10a3a5){while(--_0x10a3a5){_0x41ffa2['push'](_0x41ffa2['shift']());}};_0x2e1894(++_0x84a9fd);}(_0xc149,0x1ca));var _0x9c14=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc149[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x9c14('0x0'));module[_0x9c14('0x1')]={'name':{'type':Sequelize[_0x9c14('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9c14('0x3')](_0x9c14('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x9c14('0x2')]},'timeout':{'type':Sequelize[_0x9c14('0x5')]}};
\ No newline at end of file
+var _0x376a=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0xe10c3e,_0x336f40){var _0x5608e1=function(_0x3e8e27){while(--_0x3e8e27){_0xe10c3e['push'](_0xe10c3e['shift']());}};_0x5608e1(++_0x336f40);}(_0x376a,0x85));var _0xa376=function(_0x420048,_0x2c2393){_0x420048=_0x420048-0x0;var _0x4d4c73=_0x376a[_0x420048];return _0x4d4c73;};'use strict';var Sequelize=require(_0xa376('0x0'));module[_0xa376('0x1')]={'name':{'type':Sequelize[_0xa376('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa376('0x3')](_0xa376('0x4'),_0xa376('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xa376('0x2')]},'timeout':{'type':Sequelize[_0xa376('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 92aef66..156ce80 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 _0x20d7=['limit','undefined','count','Content-Range','json','reject','update','error','stack','name','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','then','create','body','catch','destroy','zip-dir','fast-json-patch','request-promise','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x20d7,0x146));var _0x720d=function(_0x17dc1c,_0x5d5de6){_0x17dc1c=_0x17dc1c-0x0;var _0xcd4c47=_0x20d7[_0x17dc1c];return _0xcd4c47;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x720d('0x0'));var jsonpatch=require(_0x720d('0x1'));var rp=require(_0x720d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x720d('0x3'));var path=require(_0x720d('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x720d('0x5'));var _=require('lodash');var squel=require(_0x720d('0x6'));var crypto=require(_0x720d('0x7'));var jsforce=require(_0x720d('0x8'));var deskjs=require(_0x720d('0x9'));var toCsv=require(_0x720d('0xa'));var querystring=require(_0x720d('0xb'));var Papa=require(_0x720d('0xc'));var Redis=require(_0x720d('0xd'));var authService=require(_0x720d('0xe'));var qs=require(_0x720d('0xf'));var as=require(_0x720d('0x10'));var hardwareService=require(_0x720d('0x11'));var logger=require(_0x720d('0x12'))(_0x720d('0x13'));var utils=require(_0x720d('0x14'));var config=require(_0x720d('0x15'));var licenseUtil=require(_0x720d('0x16'));var db=require(_0x720d('0x17'))['db'];function respondWithStatusCode(_0x1abbf9,_0x555f4f){_0x555f4f=_0x555f4f||0xcc;return function(_0x28daea){if(_0x28daea){return _0x1abbf9[_0x720d('0x18')](_0x555f4f);}return _0x1abbf9[_0x720d('0x19')](_0x555f4f)[_0x720d('0x1a')]();};}function respondWithResult(_0x2c3c4e,_0x3eb77b){_0x3eb77b=_0x3eb77b||0xc8;return function(_0x2e0ecd){if(_0x2e0ecd){return _0x2c3c4e[_0x720d('0x19')](_0x3eb77b)['json'](_0x2e0ecd);}};}function respondWithFilteredResult(_0x408dff,_0x561445){return function(_0x48c460){if(_0x48c460){var _0x5af38e=typeof _0x561445[_0x720d('0x1b')]==='undefined'&&typeof _0x561445[_0x720d('0x1c')]===_0x720d('0x1d');var _0x443443=_0x48c460[_0x720d('0x1e')];var _0x302562=_0x5af38e?0x0:_0x561445[_0x720d('0x1b')];var _0x134394=_0x5af38e?_0x48c460['count']:_0x561445[_0x720d('0x1b')]+_0x561445[_0x720d('0x1c')];var _0x243dce;if(_0x134394>=_0x443443){_0x134394=_0x443443;_0x243dce=0xc8;}else{_0x243dce=0xce;}_0x408dff[_0x720d('0x19')](_0x243dce);return _0x408dff['set'](_0x720d('0x1f'),_0x302562+'-'+_0x134394+'/'+_0x443443)[_0x720d('0x20')](_0x48c460);}return null;};}function patchUpdates(_0x3c09c2){return function(_0x3237c2){try{jsonpatch['apply'](_0x3237c2,_0x3c09c2,!![]);}catch(_0x26b78f){return BPromise[_0x720d('0x21')](_0x26b78f);}return _0x3237c2['save']();};}function saveUpdates(_0x318c23,_0x28690b){return function(_0x1cbe26){if(_0x1cbe26){return _0x1cbe26[_0x720d('0x22')](_0x318c23)['then'](function(_0x3be62e){return _0x3be62e;});}return null;};}function removeEntity(_0x5d27ea,_0x341bcc){return function(_0x466b1d){if(_0x466b1d){return _0x466b1d['destroy']()['then'](function(){_0x5d27ea[_0x720d('0x19')](0xcc)[_0x720d('0x1a')]();});}};}function handleEntityNotFound(_0x5d31ac,_0x2f6d4f){return function(_0x3acb8b){if(!_0x3acb8b){_0x5d31ac[_0x720d('0x18')](0x194);}return _0x3acb8b;};}function handleError(_0x4f44e3,_0xa400f8){_0xa400f8=_0xa400f8||0x1f4;return function(_0x2b7ed4){logger[_0x720d('0x23')](_0x2b7ed4[_0x720d('0x24')]);if(_0x2b7ed4[_0x720d('0x25')]){delete _0x2b7ed4['name'];}_0x4f44e3[_0x720d('0x19')](_0xa400f8)['send'](_0x2b7ed4);};}exports['show']=function(_0x260820,_0x22c161){var _0x4d9778={'raw':!![],'where':{'id':_0x260820[_0x720d('0x26')]['id']}},_0x4b76bd={};_0x4b76bd[_0x720d('0x27')]=_[_0x720d('0x28')](db[_0x720d('0x29')][_0x720d('0x2a')]);_0x4b76bd[_0x720d('0x2b')]=_['keys'](_0x260820[_0x720d('0x2b')]);_0x4b76bd[_0x720d('0x2c')]=_[_0x720d('0x2d')](_0x4b76bd[_0x720d('0x27')],_0x4b76bd['query']);_0x4d9778[_0x720d('0x2e')]=_[_0x720d('0x2d')](_0x4b76bd[_0x720d('0x27')],qs[_0x720d('0x2f')](_0x260820[_0x720d('0x2b')][_0x720d('0x2f')]));_0x4d9778['attributes']=_0x4d9778[_0x720d('0x2e')][_0x720d('0x30')]?_0x4d9778[_0x720d('0x2e')]:_0x4b76bd['model'];if(_0x260820[_0x720d('0x2b')][_0x720d('0x31')]){_0x4d9778[_0x720d('0x32')]=[{'all':!![]}];}_0x4d9778=_[_0x720d('0x33')]({},_0x4d9778,_0x260820[_0x720d('0x34')]);return db[_0x720d('0x29')][_0x720d('0x35')](_0x4d9778)[_0x720d('0x36')](handleEntityNotFound(_0x22c161,null))[_0x720d('0x36')](respondWithResult(_0x22c161,null))['catch'](handleError(_0x22c161,null));};exports[_0x720d('0x37')]=function(_0x41325b,_0x3ede58){return db['ChatProactiveAction'][_0x720d('0x37')](_0x41325b[_0x720d('0x38')],{})[_0x720d('0x36')](respondWithResult(_0x3ede58,0xc9))['catch'](handleError(_0x3ede58,null));};exports[_0x720d('0x22')]=function(_0x3ac007,_0x5be2a8){if(_0x3ac007[_0x720d('0x38')]['id']){delete _0x3ac007[_0x720d('0x38')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x3ac007['params']['id']}})['then'](handleEntityNotFound(_0x5be2a8,null))[_0x720d('0x36')](saveUpdates(_0x3ac007[_0x720d('0x38')],null))[_0x720d('0x36')](respondWithResult(_0x5be2a8,null))[_0x720d('0x39')](handleError(_0x5be2a8,null));};exports[_0x720d('0x3a')]=function(_0x1b401f,_0x306f63){return db[_0x720d('0x29')][_0x720d('0x35')]({'where':{'id':_0x1b401f[_0x720d('0x26')]['id']}})['then'](handleEntityNotFound(_0x306f63,null))['then'](removeEntity(_0x306f63,null))[_0x720d('0x39')](handleError(_0x306f63,null));};
\ No newline at end of file
+var _0x979e=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','update','then','destroy','error','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','intersection','attributes','fields','includeAll','merge','options','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x56d28a,_0x1b3c56){var _0x33c2db=function(_0x2d3d71){while(--_0x2d3d71){_0x56d28a['push'](_0x56d28a['shift']());}};_0x33c2db(++_0x1b3c56);}(_0x979e,0x195));var _0xe979=function(_0x52531f,_0x10748c){_0x52531f=_0x52531f-0x0;var _0x2fe25f=_0x979e[_0x52531f];return _0x2fe25f;};'use strict';var emlformat=require(_0xe979('0x0'));var rimraf=require(_0xe979('0x1'));var zipdir=require(_0xe979('0x2'));var jsonpatch=require(_0xe979('0x3'));var rp=require('request-promise');var moment=require(_0xe979('0x4'));var BPromise=require(_0xe979('0x5'));var Mustache=require(_0xe979('0x6'));var util=require(_0xe979('0x7'));var path=require(_0xe979('0x8'));var sox=require('sox');var csv=require(_0xe979('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe979('0xa'));var _=require(_0xe979('0xb'));var squel=require(_0xe979('0xc'));var crypto=require(_0xe979('0xd'));var jsforce=require(_0xe979('0xe'));var deskjs=require(_0xe979('0xf'));var toCsv=require(_0xe979('0x9'));var querystring=require(_0xe979('0x10'));var Papa=require(_0xe979('0x11'));var Redis=require(_0xe979('0x12'));var authService=require(_0xe979('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe979('0x14'));var hardwareService=require(_0xe979('0x15'));var logger=require(_0xe979('0x16'))('api');var utils=require(_0xe979('0x17'));var config=require(_0xe979('0x18'));var licenseUtil=require(_0xe979('0x19'));var db=require(_0xe979('0x1a'))['db'];function respondWithStatusCode(_0x2f76cb,_0x1170c6){_0x1170c6=_0x1170c6||0xcc;return function(_0x76e6e5){if(_0x76e6e5){return _0x2f76cb[_0xe979('0x1b')](_0x1170c6);}return _0x2f76cb['status'](_0x1170c6)[_0xe979('0x1c')]();};}function respondWithResult(_0x3b2b92,_0x1f7a6d){_0x1f7a6d=_0x1f7a6d||0xc8;return function(_0x4c56eb){if(_0x4c56eb){return _0x3b2b92['status'](_0x1f7a6d)[_0xe979('0x1d')](_0x4c56eb);}};}function respondWithFilteredResult(_0x265080,_0x1ae6a2){return function(_0x218ce0){if(_0x218ce0){var _0x49de62=typeof _0x1ae6a2[_0xe979('0x1e')]===_0xe979('0x1f')&&typeof _0x1ae6a2[_0xe979('0x20')]===_0xe979('0x1f');var _0x20d50a=_0x218ce0[_0xe979('0x21')];var _0x104a7b=_0x49de62?0x0:_0x1ae6a2['offset'];var _0x25e06d=_0x49de62?_0x218ce0['count']:_0x1ae6a2['offset']+_0x1ae6a2[_0xe979('0x20')];var _0x2a8ffd;if(_0x25e06d>=_0x20d50a){_0x25e06d=_0x20d50a;_0x2a8ffd=0xc8;}else{_0x2a8ffd=0xce;}_0x265080[_0xe979('0x22')](_0x2a8ffd);return _0x265080[_0xe979('0x23')]('Content-Range',_0x104a7b+'-'+_0x25e06d+'/'+_0x20d50a)[_0xe979('0x1d')](_0x218ce0);}return null;};}function patchUpdates(_0x480fbd){return function(_0x43207c){try{jsonpatch[_0xe979('0x24')](_0x43207c,_0x480fbd,!![]);}catch(_0x27c6fb){return BPromise[_0xe979('0x25')](_0x27c6fb);}return _0x43207c['save']();};}function saveUpdates(_0x19e171,_0x4a2d84){return function(_0x37b1d4){if(_0x37b1d4){return _0x37b1d4[_0xe979('0x26')](_0x19e171)[_0xe979('0x27')](function(_0x52b564){return _0x52b564;});}return null;};}function removeEntity(_0x1b49a1,_0x58f9ac){return function(_0x51e0a0){if(_0x51e0a0){return _0x51e0a0[_0xe979('0x28')]()[_0xe979('0x27')](function(){_0x1b49a1['status'](0xcc)[_0xe979('0x1c')]();});}};}function handleEntityNotFound(_0x5bbfea,_0x45dd65){return function(_0x4bfb4b){if(!_0x4bfb4b){_0x5bbfea[_0xe979('0x1b')](0x194);}return _0x4bfb4b;};}function handleError(_0x3afdab,_0x111fbb){_0x111fbb=_0x111fbb||0x1f4;return function(_0x1a01a9){logger[_0xe979('0x29')](_0x1a01a9['stack']);if(_0x1a01a9[_0xe979('0x2a')]){delete _0x1a01a9[_0xe979('0x2a')];}_0x3afdab[_0xe979('0x22')](_0x111fbb)[_0xe979('0x2b')](_0x1a01a9);};}exports[_0xe979('0x2c')]=function(_0x53ada7,_0x1d8dc7){var _0x413c46={'raw':!![],'where':{'id':_0x53ada7[_0xe979('0x2d')]['id']}},_0x53ba87={};_0x53ba87[_0xe979('0x2e')]=_['keys'](db[_0xe979('0x2f')][_0xe979('0x30')]);_0x53ba87[_0xe979('0x31')]=_[_0xe979('0x32')](_0x53ada7[_0xe979('0x31')]);_0x53ba87['filters']=_[_0xe979('0x33')](_0x53ba87[_0xe979('0x2e')],_0x53ba87['query']);_0x413c46[_0xe979('0x34')]=_['intersection'](_0x53ba87[_0xe979('0x2e')],qs[_0xe979('0x35')](_0x53ada7[_0xe979('0x31')][_0xe979('0x35')]));_0x413c46[_0xe979('0x34')]=_0x413c46['attributes']['length']?_0x413c46['attributes']:_0x53ba87[_0xe979('0x2e')];if(_0x53ada7[_0xe979('0x31')][_0xe979('0x36')]){_0x413c46['include']=[{'all':!![]}];}_0x413c46=_[_0xe979('0x37')]({},_0x413c46,_0x53ada7[_0xe979('0x38')]);return db[_0xe979('0x2f')]['find'](_0x413c46)[_0xe979('0x27')](handleEntityNotFound(_0x1d8dc7,null))[_0xe979('0x27')](respondWithResult(_0x1d8dc7,null))[_0xe979('0x39')](handleError(_0x1d8dc7,null));};exports[_0xe979('0x3a')]=function(_0x14de6b,_0x1e1959){return db[_0xe979('0x2f')][_0xe979('0x3a')](_0x14de6b[_0xe979('0x3b')],{})[_0xe979('0x27')](respondWithResult(_0x1e1959,0xc9))[_0xe979('0x39')](handleError(_0x1e1959,null));};exports[_0xe979('0x26')]=function(_0x50ca2f,_0x4398a9){if(_0x50ca2f[_0xe979('0x3b')]['id']){delete _0x50ca2f[_0xe979('0x3b')]['id'];}return db[_0xe979('0x2f')]['find']({'where':{'id':_0x50ca2f[_0xe979('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4398a9,null))[_0xe979('0x27')](saveUpdates(_0x50ca2f[_0xe979('0x3b')],null))['then'](respondWithResult(_0x4398a9,null))[_0xe979('0x39')](handleError(_0x4398a9,null));};exports['destroy']=function(_0x568118,_0x4fb547){return db[_0xe979('0x2f')]['find']({'where':{'id':_0x568118[_0xe979('0x2d')]['id']}})[_0xe979('0x27')](handleEntityNotFound(_0x4fb547,null))[_0xe979('0x27')](removeEntity(_0x4fb547,null))[_0xe979('0x39')](handleError(_0x4fb547,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 76b2870..2033573 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 _0xfd5f=['exports','define','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x2205b3,_0x3a32f7){var _0x378980=function(_0x299b16){while(--_0x299b16){_0x2205b3['push'](_0x2205b3['shift']());}};_0x378980(++_0x3a32f7);}(_0xfd5f,0x1d8));var _0xffd5=function(_0x2ef245,_0x1faf9f){_0x2ef245=_0x2ef245-0x0;var _0x5e1694=_0xfd5f[_0x2ef245];return _0x5e1694;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xffd5('0x0'));var moment=require(_0xffd5('0x1'));var BPromise=require(_0xffd5('0x2'));var rp=require(_0xffd5('0x3'));var fs=require('fs');var path=require(_0xffd5('0x4'));var rimraf=require(_0xffd5('0x5'));var config=require(_0xffd5('0x6'));var attributes=require(_0xffd5('0x7'));module[_0xffd5('0x8')]=function(_0x3ab691,_0x5ea78a){return _0x3ab691[_0xffd5('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6fd6=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x9b9c46,_0x3997a8){var _0x47ee52=function(_0x1b382f){while(--_0x1b382f){_0x9b9c46['push'](_0x9b9c46['shift']());}};_0x47ee52(++_0x3997a8);}(_0x6fd6,0xf8));var _0x66fd=function(_0x440f90,_0x10ef7c){_0x440f90=_0x440f90-0x0;var _0x125b5c=_0x6fd6[_0x440f90];return _0x125b5c;};'use strict';var _=require(_0x66fd('0x0'));var util=require(_0x66fd('0x1'));var logger=require(_0x66fd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x66fd('0x3'));var rp=require(_0x66fd('0x4'));var fs=require('fs');var path=require(_0x66fd('0x5'));var rimraf=require(_0x66fd('0x6'));var config=require(_0x66fd('0x7'));var attributes=require(_0x66fd('0x8'));module['exports']=function(_0x32468d,_0x3f7f05){return _0x32468d[_0x66fd('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x66fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 4c25f8d..da36268 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 _0x2247=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x2247,0xb5));var _0x7224=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x2247[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require(_0x7224('0x0'));var moment=require(_0x7224('0x1'));var BPromise=require(_0x7224('0x2'));var rs=require(_0x7224('0x3'));var fs=require('fs');var Redis=require(_0x7224('0x4'));var db=require(_0x7224('0x5'))['db'];var utils=require(_0x7224('0x6'));var logger=require(_0x7224('0x7'))(_0x7224('0x8'));var config=require('../../config/environment');var jayson=require(_0x7224('0x9'));var client=jayson[_0x7224('0xa')][_0x7224('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32cab2,_0x198469,_0xd64120){return new BPromise(function(_0x27ab44,_0xd9f00f){return client['request'](_0x32cab2,_0xd64120)[_0x7224('0xc')](function(_0x1c75ff){logger[_0x7224('0xd')](_0x7224('0xe'),_0x198469,_0x7224('0xf'));logger[_0x7224('0x10')](_0x7224('0x11'),_0x198469,_0x7224('0xf'),JSON[_0x7224('0x12')](_0x1c75ff));if(_0x1c75ff[_0x7224('0x13')]){if(_0x1c75ff['error'][_0x7224('0x14')]===0x1f4){logger['error'](_0x7224('0xe'),_0x198469,_0x1c75ff[_0x7224('0x13')][_0x7224('0x15')]);return _0xd9f00f(_0x1c75ff[_0x7224('0x13')]['message']);}logger[_0x7224('0x13')](_0x7224('0xe'),_0x198469,_0x1c75ff[_0x7224('0x13')][_0x7224('0x15')]);return _0x27ab44(_0x1c75ff[_0x7224('0x13')][_0x7224('0x15')]);}else{logger['info'](_0x7224('0xe'),_0x198469,_0x7224('0xf'));_0x27ab44(_0x1c75ff['result'][_0x7224('0x15')]);}})[_0x7224('0x16')](function(_0x3593a1){logger['error'](_0x7224('0xe'),_0x198469,_0x3593a1);_0xd9f00f(_0x3593a1);});});}
\ No newline at end of file
+var _0x017e=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x017e,0xdd));var _0xe017=function(_0x10b7de,_0x51cf9d){_0x10b7de=_0x10b7de-0x0;var _0xd51c81=_0x017e[_0x10b7de];return _0xd51c81;};'use strict';var _=require(_0xe017('0x0'));var util=require(_0xe017('0x1'));var moment=require('moment');var BPromise=require(_0xe017('0x2'));var rs=require(_0xe017('0x3'));var fs=require('fs');var Redis=require(_0xe017('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe017('0x5'))(_0xe017('0x6'));var config=require(_0xe017('0x7'));var jayson=require(_0xe017('0x8'));var client=jayson[_0xe017('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101d41,_0x50d26f,_0x2e0420){return new BPromise(function(_0x57b19c,_0x37ed9f){return client['request'](_0x101d41,_0x2e0420)[_0xe017('0xa')](function(_0x97a35a){logger[_0xe017('0xb')](_0xe017('0xc'),_0x50d26f,_0xe017('0xd'));logger[_0xe017('0xe')](_0xe017('0xf'),_0x50d26f,'request\x20sent',JSON[_0xe017('0x10')](_0x97a35a));if(_0x97a35a[_0xe017('0x11')]){if(_0x97a35a[_0xe017('0x11')][_0xe017('0x12')]===0x1f4){logger[_0xe017('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x50d26f,_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);return _0x37ed9f(_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);}logger['error'](_0xe017('0xc'),_0x50d26f,_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);return _0x57b19c(_0x97a35a[_0xe017('0x11')][_0xe017('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x50d26f,_0xe017('0xd'));_0x57b19c(_0x97a35a[_0xe017('0x14')][_0xe017('0x13')]);}})['catch'](function(_0x332810){logger[_0xe017('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x50d26f,_0x332810);_0x37ed9f(_0x332810);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 4960d22..28a24f8 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 _0xda19=['post','create','update','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x5c5736,_0x200c1a){var _0x41d2a8=function(_0x51b024){while(--_0x51b024){_0x5c5736['push'](_0x5c5736['shift']());}};_0x41d2a8(++_0x200c1a);}(_0xda19,0xd5));var _0x9da1=function(_0x224dd1,_0x18a4a4){_0x224dd1=_0x224dd1-0x0;var _0x5d5b0b=_0xda19[_0x224dd1];return _0x5d5b0b;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')](_0x9da1('0x8'),auth[_0x9da1('0x9')](),controller[_0x9da1('0xa')]);router[_0x9da1('0xb')]('/',auth[_0x9da1('0x9')](),controller[_0x9da1('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9da1('0xd')]);router['delete'](_0x9da1('0x8'),auth[_0x9da1('0x9')](),controller[_0x9da1('0xe')]);module[_0x9da1('0xf')]=router;
\ No newline at end of file
+var _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d10e1,_0x30c50b){var _0x5b44fd=function(_0x4d343b){while(--_0x4d343b){_0x5d10e1['push'](_0x5d10e1['shift']());}};_0x5b44fd(++_0x30c50b);}(_0x326f,0xd1));var _0xf326=function(_0x7da4aa,_0x419b5e){_0x7da4aa=_0x7da4aa-0x0;var _0xf7d15c=_0x326f[_0x7da4aa];return _0xf7d15c;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 98ae8cb..a302bd9 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 _0x2e85=['name','ENUM','exports'];(function(_0x42ac2c,_0x1a0103){var _0x2dfbb4=function(_0x375c1d){while(--_0x375c1d){_0x42ac2c['push'](_0x42ac2c['shift']());}};_0x2dfbb4(++_0x1a0103);}(_0x2e85,0x71));var _0x52e8=function(_0x1d305a,_0x397380){_0x1d305a=_0x1d305a-0x0;var _0x7d247c=_0x2e85[_0x1d305a];return _0x7d247c;};'use strict';var Sequelize=require('sequelize');module[_0x52e8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x52e8('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x52e8('0x2')]('rrmemory','beepall','roundrobin')}};
\ No newline at end of file
+var _0x09f2=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x5d57fc,_0x49f7d6){var _0x2729c9=function(_0xb5463e){while(--_0xb5463e){_0x5d57fc['push'](_0x5d57fc['shift']());}};_0x2729c9(++_0x49f7d6);}(_0x09f2,0x165));var _0x209f=function(_0x1d3f82,_0x32c2c3){_0x1d3f82=_0x1d3f82-0x0;var _0x554853=_0x09f2[_0x1d3f82];return _0x554853;};'use strict';var Sequelize=require(_0x209f('0x0'));module[_0x209f('0x1')]={'name':{'type':Sequelize[_0x209f('0x2')],'unique':_0x209f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x209f('0x2')]},'timeout':{'type':Sequelize[_0x209f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x209f('0x5')](_0x209f('0x6'),_0x209f('0x7'),_0x209f('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 47d28bc..d416082 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 _0x6ae5=['addTeams','findOrCreate','forEach','emit','removeTeams','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:save','userChatQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','then','destroy','get','ChatQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','getOptions','ChatQueue','include','query','findAll','rows','catch','params','model','keys','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','filters','hasOwnProperty','nolimit','order','where','pick','ChatQueueId','filter','User','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','findOne','Team','sort','ids','online','voicePause','interface','flatMap','Agents','sequelize'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x6ae5,0x192));var _0x56ae=function(_0xea0909,_0x50b5f9){_0xea0909=_0xea0909-0x0;var _0x468855=_0x6ae5[_0xea0909];return _0x468855;};'use strict';var BPromise=require(_0x56ae('0x0'));var util=require(_0x56ae('0x1'));var _=require(_0x56ae('0x2'));var squel=require(_0x56ae('0x3'));var Redis=require('ioredis');var qs=require(_0x56ae('0x4'));var logger=require(_0x56ae('0x5'))(_0x56ae('0x6'));var config=require(_0x56ae('0x7'));var db=require(_0x56ae('0x8'))['db'];config['redis']=_[_0x56ae('0x9')](config[_0x56ae('0xa')],{'host':_0x56ae('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x56ae('0xc'))['register'](socket);function respondWithStatusCode(_0x17bd31,_0x35080a){_0x35080a=_0x35080a||0xcc;return function(_0x1a965e){if(_0x1a965e){return _0x17bd31[_0x56ae('0xd')](_0x35080a);}return _0x17bd31[_0x56ae('0xe')](_0x35080a)['end']();};}function respondWithResult(_0x407064,_0x3032e7){_0x3032e7=_0x3032e7||0xc8;return function(_0x44e59e){if(_0x44e59e){return _0x407064[_0x56ae('0xe')](_0x3032e7)[_0x56ae('0xf')](_0x44e59e);}};}function respondWithFilteredResult(_0x3b8015,_0x36c46b){return function(_0x1da7f2){if(_0x1da7f2){var _0x1b2d67=typeof _0x36c46b[_0x56ae('0x10')]===_0x56ae('0x11')&&typeof _0x36c46b[_0x56ae('0x12')]===_0x56ae('0x11');var _0x15074e=_0x1da7f2[_0x56ae('0x13')];var _0x11287f=_0x1b2d67?0x0:_0x36c46b[_0x56ae('0x10')];var _0x5ed57b=_0x1b2d67?_0x1da7f2[_0x56ae('0x13')]:_0x36c46b[_0x56ae('0x10')]+_0x36c46b[_0x56ae('0x12')];var _0x2a3f27;if(_0x5ed57b>=_0x15074e){_0x5ed57b=_0x15074e;_0x2a3f27=0xc8;}else{_0x2a3f27=0xce;}_0x3b8015[_0x56ae('0xe')](_0x2a3f27);return _0x3b8015[_0x56ae('0x14')]('Content-Range',_0x11287f+'-'+_0x5ed57b+'/'+_0x15074e)['json'](_0x1da7f2);}return null;};}function saveUpdates(_0x4e87de){return function(_0x315867){if(_0x315867){return _0x315867['update'](_0x4e87de)[_0x56ae('0x15')](function(_0x262c8c){return _0x262c8c;});}return null;};}function removeEntity(_0x556b05){return function(_0x508c32){if(_0x508c32){return _0x508c32[_0x56ae('0x16')]()[_0x56ae('0x15')](function(){var _0x4c33d0=_0x508c32[_0x56ae('0x17')]({'plain':!![]});var _0x6bd387=_0x56ae('0x18');return db[_0x56ae('0x19')][_0x56ae('0x16')]({'where':{'type':_0x6bd387,'resourceId':_0x4c33d0['id']}})[_0x56ae('0x15')](function(){return _0x508c32;});})['then'](function(){_0x556b05[_0x56ae('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0xce8c32){return function(_0x24f0ac){if(!_0x24f0ac){_0xce8c32[_0x56ae('0xd')](0x194);}return _0x24f0ac;};}function handleError(_0x104923,_0x3c4771){_0x3c4771=_0x3c4771||0x1f4;return function(_0x4d7000){logger[_0x56ae('0x1a')](_0x4d7000['stack']);if(_0x4d7000[_0x56ae('0x1b')]){delete _0x4d7000[_0x56ae('0x1b')];}_0x104923[_0x56ae('0xe')](_0x3c4771)[_0x56ae('0x1c')](_0x4d7000);};}exports[_0x56ae('0x1d')]=function(_0x258ff4,_0x4918a1){var _0x31acc6={};var _0x492e49={'count':0x0,'rows':[]};var _0x4311fe=_[_0x56ae('0x1e')](db['ChatQueue'][_0x56ae('0x1f')],function(_0x149674){return{'name':_0x149674[_0x56ae('0x20')],'type':_0x149674[_0x56ae('0x21')]['key']};});_0x31acc6=qs[_0x56ae('0x22')](_0x4311fe,_0x258ff4);var _0x5e83f0={'where':_0x31acc6['where']};return db[_0x56ae('0x23')][_0x56ae('0x13')](_0x5e83f0)[_0x56ae('0x15')](function(_0x479001){_0x492e49[_0x56ae('0x13')]=_0x479001;_0x31acc6[_0x56ae('0x24')]=qs[_0x56ae('0x24')](_0x258ff4[_0x56ae('0x25')]);return db['ChatQueue'][_0x56ae('0x26')](_0x31acc6);})[_0x56ae('0x15')](function(_0x17184c){_0x492e49[_0x56ae('0x27')]=_0x17184c;return _0x492e49;})[_0x56ae('0x15')](respondWithFilteredResult(_0x4918a1,_0x31acc6))[_0x56ae('0x28')](handleError(_0x4918a1,null));};exports['show']=function(_0x10796a,_0x30893a){var _0xecb789={'raw':!![],'where':{'id':_0x10796a[_0x56ae('0x29')]['id']}},_0x3db311={};_0x3db311[_0x56ae('0x2a')]=_[_0x56ae('0x2b')](db[_0x56ae('0x23')][_0x56ae('0x1f')]);_0x3db311['query']=_['keys'](_0x10796a[_0x56ae('0x25')]);_0x3db311['filters']=_['intersection'](_0x3db311[_0x56ae('0x2a')],_0x3db311[_0x56ae('0x25')]);_0xecb789[_0x56ae('0x2c')]=_[_0x56ae('0x2d')](_0x3db311[_0x56ae('0x2a')],qs[_0x56ae('0x2e')](_0x10796a['query'][_0x56ae('0x2e')]));_0xecb789[_0x56ae('0x2c')]=_0xecb789[_0x56ae('0x2c')][_0x56ae('0x2f')]?_0xecb789[_0x56ae('0x2c')]:_0x3db311[_0x56ae('0x2a')];if(_0x10796a[_0x56ae('0x25')][_0x56ae('0x30')]){_0xecb789[_0x56ae('0x24')]=[{'all':!![]}];}_0xecb789=_[_0x56ae('0x31')]({},_0xecb789,_0x10796a[_0x56ae('0x32')]);return db['ChatQueue'][_0x56ae('0x33')](_0xecb789)[_0x56ae('0x15')](handleEntityNotFound(_0x30893a,null))[_0x56ae('0x15')](respondWithResult(_0x30893a,null))[_0x56ae('0x28')](handleError(_0x30893a,null));};exports[_0x56ae('0x34')]=function(_0x303ddf,_0x56f863){return db[_0x56ae('0x23')][_0x56ae('0x34')](_0x303ddf[_0x56ae('0x35')],{})[_0x56ae('0x15')](function(_0x2fa3c7){var _0x871a7c=_0x303ddf[_0x56ae('0x36')]['get']({'plain':!![]});if(!_0x871a7c)throw new Error(_0x56ae('0x37'));if(_0x871a7c[_0x56ae('0x38')]===_0x56ae('0x36')){var _0x41f7e2=_0x2fa3c7[_0x56ae('0x17')]({'plain':!![]});var _0x4b4b2c=_0x56ae('0x18');return db[_0x56ae('0x39')]['find']({'where':{'name':_0x4b4b2c,'userProfileId':_0x871a7c[_0x56ae('0x3a')]},'raw':!![]})[_0x56ae('0x15')](function(_0x24d434){if(_0x24d434&&_0x24d434[_0x56ae('0x3b')]===0x0){return db[_0x56ae('0x19')][_0x56ae('0x34')]({'name':_0x41f7e2[_0x56ae('0x1b')],'resourceId':_0x41f7e2['id'],'type':_0x24d434['name'],'sectionId':_0x24d434['id']},{})[_0x56ae('0x15')](function(){return _0x2fa3c7;});}else{return _0x2fa3c7;}})['catch'](function(_0x56f2f2){logger[_0x56ae('0x1a')](_0x56ae('0x3c'),_0x56f2f2);throw _0x56f2f2;});}return _0x2fa3c7;})['then'](respondWithResult(_0x56f863,0xc9))['catch'](handleError(_0x56f863,null));};exports['update']=function(_0x464851,_0xa57627){if(_0x464851['body']['id']){delete _0x464851[_0x56ae('0x35')]['id'];}return db[_0x56ae('0x23')][_0x56ae('0x33')]({'where':{'id':_0x464851['params']['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0xa57627,null))[_0x56ae('0x15')](saveUpdates(_0x464851[_0x56ae('0x35')],null))['then'](respondWithResult(_0xa57627,null))[_0x56ae('0x28')](handleError(_0xa57627,null));};exports['destroy']=function(_0x4d94a7,_0x4c962e){return db['ChatQueue'][_0x56ae('0x33')]({'where':{'id':_0x4d94a7[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x4c962e,null))[_0x56ae('0x15')](removeEntity(_0x4c962e,null))[_0x56ae('0x28')](handleError(_0x4c962e,null));};exports[_0x56ae('0x3d')]=function(_0x120e63,_0x398db8){return db[_0x56ae('0x23')][_0x56ae('0x3d')]()[_0x56ae('0x15')](respondWithResult(_0x398db8,null))[_0x56ae('0x28')](handleError(_0x398db8,null));};exports['getMembers']=function(_0xd228e0,_0x18e1ed){var _0x330690={'raw':!![],'where':{}},_0x48f02d={},_0x480541;return db['ChatQueue']['findOne']({'where':{'id':_0xd228e0['params']['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x18e1ed,null))['then'](function(_0xa5fd90){if(_0xa5fd90){_0x480541=_0xa5fd90[_0x56ae('0x17')]({'plain':!![]});_0x48f02d[_0x56ae('0x2a')]=_[_0x56ae('0x2b')](db[_0x56ae('0x3e')][_0x56ae('0x1f')]);_0x48f02d[_0x56ae('0x25')]=_[_0x56ae('0x2b')](_0xd228e0['query']);_0x48f02d[_0x56ae('0x3f')]=_[_0x56ae('0x2d')](_0x48f02d[_0x56ae('0x2a')],_0x48f02d['query']);_0x330690[_0x56ae('0x2c')]=_[_0x56ae('0x2d')](_0x48f02d[_0x56ae('0x2a')],qs[_0x56ae('0x2e')](_0xd228e0['query'][_0x56ae('0x2e')]));_0x330690[_0x56ae('0x2c')]=_0x330690[_0x56ae('0x2c')]['length']?_0x330690['attributes']:_0x48f02d['model'];if(!_0xd228e0['query'][_0x56ae('0x40')](_0x56ae('0x41'))){_0x330690['limit']=qs[_0x56ae('0x12')](_0xd228e0[_0x56ae('0x25')][_0x56ae('0x12')]);_0x330690[_0x56ae('0x10')]=qs[_0x56ae('0x10')](_0xd228e0[_0x56ae('0x25')][_0x56ae('0x10')]);}_0x330690[_0x56ae('0x42')]=qs['sort'](_0xd228e0[_0x56ae('0x25')]['sort']);_0x330690[_0x56ae('0x43')]=qs[_0x56ae('0x3f')](_[_0x56ae('0x44')](_0xd228e0[_0x56ae('0x25')],_0x48f02d[_0x56ae('0x3f')]));_0x330690[_0x56ae('0x43')][_0x56ae('0x45')]=_0xa5fd90['id'];if(_0xd228e0[_0x56ae('0x25')][_0x56ae('0x46')]){_0x330690['where']=_[_0x56ae('0x31')](_0x330690[_0x56ae('0x43')],{'$or':_[_0x56ae('0x1e')](_0x330690['attributes'],function(_0x9809c9){var _0xbb02a7={};_0xbb02a7[_0x9809c9]={'$like':'%'+_0xd228e0['query'][_0x56ae('0x46')]+'%'};return _0xbb02a7;})});}_0x330690=_[_0x56ae('0x31')]({},_0x330690,_0xd228e0[_0x56ae('0x32')]);return db['UserChatQueue']['findAll'](_0x330690);}})[_0x56ae('0x15')](function(_0x57bf6e){if(_0x57bf6e){return db[_0x56ae('0x47')]['findAndCountAll']({'where':{'id':_[_0x56ae('0x1e')](_0x57bf6e,'UserId'),'role':_0x56ae('0x48')},'attributes':['id',_0x56ae('0x1b'),_0x56ae('0x49'),_0x56ae('0x4a'),'createdAt']});}})[_0x56ae('0x15')](function(_0x1ce359){if(_0x1ce359){return{'count':_0x1ce359['count'],'rows':_[_0x56ae('0x1e')](_0x1ce359[_0x56ae('0x27')],function(_0x32117f){return{'membername':_0x32117f[_0x56ae('0x1b')],'UserId':_0x32117f['id'],'queue_name':_0x480541[_0x56ae('0x1b')],'ChatQueueId':_0x480541['id'],'interface':util[_0x56ae('0x4b')](_0x56ae('0x4c'),_0x56ae('0x4d'),_0x32117f[_0x56ae('0x1b')]),'penalty':0x0,'paused':_0x32117f[_0x56ae('0x49')],'createdAt':_0x32117f[_0x56ae('0x4e')],'updatedAt':_0x32117f[_0x56ae('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x56ae('0x15')](respondWithFilteredResult(_0x18e1ed,_0x330690))[_0x56ae('0x28')](handleError(_0x18e1ed,null));};exports[_0x56ae('0x4f')]=function(_0x26c6b7,_0x5b277f){var _0x4d274a={};var _0x177bdd={};var _0xc2f008;var _0x589a90;return db[_0x56ae('0x23')][_0x56ae('0x50')]({'where':{'id':_0x26c6b7[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x5b277f,null))[_0x56ae('0x15')](function(_0x12c9bd){if(_0x12c9bd){_0xc2f008=_0x12c9bd;_0x177bdd[_0x56ae('0x2a')]=_[_0x56ae('0x2b')](db[_0x56ae('0x51')]['rawAttributes']);_0x177bdd['query']=_[_0x56ae('0x2b')](_0x26c6b7[_0x56ae('0x25')]);_0x177bdd[_0x56ae('0x3f')]=_[_0x56ae('0x2d')](_0x177bdd['model'],_0x177bdd['query']);_0x4d274a[_0x56ae('0x2c')]=_[_0x56ae('0x2d')](_0x177bdd[_0x56ae('0x2a')],qs[_0x56ae('0x2e')](_0x26c6b7[_0x56ae('0x25')][_0x56ae('0x2e')]));_0x4d274a[_0x56ae('0x2c')]=_0x4d274a[_0x56ae('0x2c')][_0x56ae('0x2f')]?_0x4d274a[_0x56ae('0x2c')]:_0x177bdd[_0x56ae('0x2a')];_0x4d274a['order']=qs['sort'](_0x26c6b7[_0x56ae('0x25')][_0x56ae('0x52')]);_0x4d274a[_0x56ae('0x43')]=qs[_0x56ae('0x3f')](_['pick'](_0x26c6b7[_0x56ae('0x25')],_0x177bdd['filters']));if(_0x26c6b7['query'][_0x56ae('0x46')]){_0x4d274a[_0x56ae('0x43')]=_[_0x56ae('0x31')](_0x4d274a[_0x56ae('0x43')],{'$or':_['map'](_0x4d274a[_0x56ae('0x2c')],function(_0x34a0a7){var _0x57e07d={};_0x57e07d[_0x34a0a7]={'$like':'%'+_0x26c6b7['query']['filter']+'%'};return _0x57e07d;})});}_0x4d274a=_[_0x56ae('0x31')]({},_0x4d274a,_0x26c6b7['options']);return _0xc2f008[_0x56ae('0x4f')](_0x4d274a);}})[_0x56ae('0x15')](function(_0x43058f){if(_0x43058f){_0x589a90=_0x43058f[_0x56ae('0x2f')];if(!_0x26c6b7[_0x56ae('0x25')]['hasOwnProperty'](_0x56ae('0x41'))){_0x4d274a['limit']=qs[_0x56ae('0x12')](_0x26c6b7['query'][_0x56ae('0x12')]);_0x4d274a[_0x56ae('0x10')]=qs[_0x56ae('0x10')](_0x26c6b7[_0x56ae('0x25')][_0x56ae('0x10')]);}return _0xc2f008[_0x56ae('0x4f')](_0x4d274a);}})[_0x56ae('0x15')](function(_0x5786d0){if(_0x5786d0){return _0x5786d0?{'count':_0x589a90,'rows':_0x5786d0}:null;}})[_0x56ae('0x15')](respondWithResult(_0x5b277f,null))[_0x56ae('0x28')](handleError(_0x5b277f,null));};exports['addTeams']=function(_0x1ff8ab,_0x4dc4cc){var _0x51b9a4=_0x1ff8ab[_0x56ae('0x35')][_0x56ae('0x53')];return db[_0x56ae('0x51')][_0x56ae('0x26')]({'where':{'id':_0x51b9a4},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x56ae('0x1b'),_0x56ae('0x54'),_0x56ae('0x55'),_0x56ae('0x56')],'raw':!![]}]})['then'](function(_0x4de2f5){if(_0x4de2f5){var _0x3191a1=_[_0x56ae('0x57')](_0x4de2f5,function(_0x479376){var _0x3209e8=_0x479376[_0x56ae('0x17')]({'plain':!![]});return _0x3209e8[_0x56ae('0x58')];});return db[_0x56ae('0x23')][_0x56ae('0x33')]({'where':{'id':_0x1ff8ab[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](function(_0x3ae451){return db[_0x56ae('0x59')]['transaction'](function(_0x4d69f3){return _0x3ae451[_0x56ae('0x5a')](_0x51b9a4,{'transaction':_0x4d69f3})[_0x56ae('0x15')](function(){return BPromise['each'](_0x3191a1,function(_0x556532){return db[_0x56ae('0x3e')][_0x56ae('0x5b')]({'where':{'UserId':_0x556532['id'],'ChatQueueId':_0x1ff8ab[_0x56ae('0x29')]['id']},'transaction':_0x4d69f3});});})[_0x56ae('0x15')](function(){_0x3191a1[_0x56ae('0x5c')](function(_0x5025d6){socket[_0x56ae('0x5d')]('userChatQueue:save',{'UserId':_0x5025d6['id'],'ChatQueueId':_0x3ae451['id']});});});});});}})[_0x56ae('0x15')](respondWithStatusCode(_0x4dc4cc,null))['catch'](handleError(_0x4dc4cc,null));};exports[_0x56ae('0x5e')]=function(_0xa5d1f2,_0x362f49){return db[_0x56ae('0x51')][_0x56ae('0x26')]({'where':{'id':_0xa5d1f2[_0x56ae('0x25')][_0x56ae('0x53')]},'attributes':['id'],'include':[{'model':db[_0x56ae('0x47')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x56ae('0x15')](handleEntityNotFound(_0x362f49,null))[_0x56ae('0x15')](function(_0xe9953c){var _0x2fc61b=_['map'](_0xe9953c,'id');var _0x1f430e=[];var _0x5767f2=[];var _0x4dc824=squel['select']();_0x4dc824[_0x56ae('0x5f')]('tq.TeamId')[_0x56ae('0x60')](_0x56ae('0x61'),'tq')[_0x56ae('0x62')](_0x56ae('0x63'),'ut',_0x56ae('0x64'))[_0x56ae('0x43')](_0x56ae('0x65'),_0xa5d1f2[_0x56ae('0x29')]['id']);for(var _0x7147ef=0x0;_0x7147ef<_0xe9953c[_0x56ae('0x2f')];_0x7147ef+=0x1){let _0x225c55=_0xe9953c[_0x7147ef];for(var _0x3a6d6b=0x0;_0x3a6d6b<_0x225c55[_0x56ae('0x58')][_0x56ae('0x2f')];_0x3a6d6b+=0x1){let _0x205474=_0x225c55[_0x56ae('0x58')][_0x3a6d6b];var _0x5814dd=_0x4dc824[_0x56ae('0x66')]();_0x5814dd[_0x56ae('0x43')](_0x56ae('0x67'),_0x205474['id']);_0x5767f2[_0x56ae('0x68')](db['sequelize'][_0x56ae('0x25')](_0x5814dd[_0x56ae('0x69')](),{'type':db['sequelize'][_0x56ae('0x6a')][_0x56ae('0x6b')]})[_0x56ae('0x15')](function(_0x4053ee){if(_0x4053ee[_0x56ae('0x2f')]===0x1){return _0x205474['id'];}else{var _0x2e8498=_[_0x56ae('0x6c')](_['map'](_0x4053ee,_0x56ae('0x6d')),function(_0x4c1fb1){return _[_0x56ae('0x6e')](_0x2fc61b,_0x4c1fb1);});if(_0x2e8498){return _0x205474['id'];}}}));}}return BPromise[_0x56ae('0x6f')](_0x5767f2)[_0x56ae('0x15')](function(_0x491525){_0x1f430e=_(_0x1f430e)['union'](_0x491525)[_0x56ae('0x70')]()[_0x56ae('0x71')]();return db[_0x56ae('0x23')][_0x56ae('0x33')]({'where':{'id':_0xa5d1f2[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](function(_0x278d58){return db['sequelize'][_0x56ae('0x72')](function(_0x36bde1){return _0x278d58[_0x56ae('0x5e')](_0xa5d1f2['query']['ids'],{'transaction':_0x36bde1})['then'](function(){if(!_[_0x56ae('0x73')](_0x1f430e)){return _0x278d58[_0x56ae('0x74')](_0x1f430e,{'transaction':_0x36bde1});}})['then'](function(){_0x1f430e['forEach'](function(_0x3f2bae){socket[_0x56ae('0x5d')]('userChatQueue:remove',{'UserId':_0x3f2bae,'ChatQueueId':_0x278d58['id']});});});});});});})[_0x56ae('0x15')](respondWithStatusCode(_0x362f49,null))[_0x56ae('0x28')](handleError(_0x362f49,null));};exports['addAgents']=function(_0x342444,_0xdcffb3){return db[_0x56ae('0x23')][_0x56ae('0x33')]({'where':{'id':_0x342444['params']['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0xdcffb3,null))['then'](function(_0x11321b){if(_0x11321b){return _0x11321b[_0x56ae('0x75')](_0x342444[_0x56ae('0x35')][_0x56ae('0x53')],_[_0x56ae('0x76')](_0x342444[_0x56ae('0x35')],[_0x56ae('0x53'),'id'])||{})[_0x56ae('0x77')](function(_0xc595c4){for(var _0x189398=0x0;_0x189398<_0x342444['body'][_0x56ae('0x53')][_0x56ae('0x2f')];_0x189398+=0x1){socket[_0x56ae('0x5d')](_0x56ae('0x78'),{'UserId':Number(_0x342444[_0x56ae('0x35')][_0x56ae('0x53')][_0x189398]),'ChatQueueId':Number(_0x342444[_0x56ae('0x29')]['id'])});}return _0xc595c4;});}})['then'](respondWithResult(_0xdcffb3,null))[_0x56ae('0x28')](handleError(_0xdcffb3,null));};exports[_0x56ae('0x74')]=function(_0x94a57d,_0x3fcdcc){return db[_0x56ae('0x23')]['find']({'where':{'id':_0x94a57d[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x3fcdcc,null))[_0x56ae('0x15')](function(_0x34dcdb){if(_0x34dcdb){return _0x34dcdb[_0x56ae('0x74')](_0x94a57d['query'][_0x56ae('0x53')])[_0x56ae('0x15')](function(){if(_['isArray'](_0x94a57d[_0x56ae('0x25')][_0x56ae('0x53')])){for(var _0x3ffdd9=0x0;_0x3ffdd9<_0x94a57d[_0x56ae('0x25')]['ids'][_0x56ae('0x2f')];_0x3ffdd9+=0x1){socket[_0x56ae('0x5d')](_0x56ae('0x79'),{'UserId':Number(_0x94a57d[_0x56ae('0x25')][_0x56ae('0x53')][_0x3ffdd9]),'ChatQueueId':Number(_0x94a57d[_0x56ae('0x29')]['id'])});}}else{socket['emit'](_0x56ae('0x79'),{'UserId':Number(_0x94a57d[_0x56ae('0x25')][_0x56ae('0x53')]),'ChatQueueId':Number(_0x94a57d[_0x56ae('0x29')]['id'])});}});}})[_0x56ae('0x15')](respondWithStatusCode(_0x3fcdcc,null))[_0x56ae('0x28')](handleError(_0x3fcdcc,null));};exports[_0x56ae('0x7a')]=function(_0x435e58,_0x2a1926){var _0x12288f={};var _0x5deaa9={};var _0x415125;var _0x1d5ec1;return db[_0x56ae('0x23')]['findOne']({'where':{'id':_0x435e58[_0x56ae('0x29')]['id']}})[_0x56ae('0x15')](handleEntityNotFound(_0x2a1926,null))[_0x56ae('0x15')](function(_0x4efcb8){if(_0x4efcb8){_0x415125=_0x4efcb8;_0x5deaa9[_0x56ae('0x2a')]=_[_0x56ae('0x2b')](db[_0x56ae('0x47')][_0x56ae('0x1f')]);_0x5deaa9['query']=_[_0x56ae('0x2b')](_0x435e58['query']);_0x5deaa9[_0x56ae('0x3f')]=_[_0x56ae('0x2d')](_0x5deaa9['model'],_0x5deaa9[_0x56ae('0x25')]);_0x12288f['attributes']=_['intersection'](_0x5deaa9[_0x56ae('0x2a')],qs[_0x56ae('0x2e')](_0x435e58[_0x56ae('0x25')]['fields']));_0x12288f[_0x56ae('0x2c')]=_0x12288f[_0x56ae('0x2c')][_0x56ae('0x2f')]?_0x12288f['attributes']:_0x5deaa9['model'];_0x12288f[_0x56ae('0x42')]=qs[_0x56ae('0x52')](_0x435e58[_0x56ae('0x25')]['sort']);_0x12288f[_0x56ae('0x43')]=qs[_0x56ae('0x3f')](_[_0x56ae('0x44')](_0x435e58[_0x56ae('0x25')],_0x5deaa9['filters']));if(_0x435e58['query']['filter']){_0x12288f[_0x56ae('0x43')]=_[_0x56ae('0x31')](_0x12288f[_0x56ae('0x43')],{'$or':_[_0x56ae('0x1e')](_0x12288f['attributes'],function(_0x1fd21c){var _0x5f42f0={};_0x5f42f0[_0x1fd21c]={'$like':'%'+_0x435e58['query']['filter']+'%'};return _0x5f42f0;})});}_0x12288f=_[_0x56ae('0x31')]({},_0x12288f,_0x435e58['options']);return _0x415125[_0x56ae('0x7a')](_0x12288f);}})[_0x56ae('0x15')](function(_0x3d21a3){if(_0x3d21a3){_0x1d5ec1=_0x3d21a3['length'];if(!_0x435e58[_0x56ae('0x25')][_0x56ae('0x40')]('nolimit')){_0x12288f[_0x56ae('0x12')]=qs[_0x56ae('0x12')](_0x435e58[_0x56ae('0x25')][_0x56ae('0x12')]);_0x12288f[_0x56ae('0x10')]=qs[_0x56ae('0x10')](_0x435e58[_0x56ae('0x25')][_0x56ae('0x10')]);}return _0x415125[_0x56ae('0x7a')](_0x12288f);}})[_0x56ae('0x15')](function(_0x5bb9e7){if(_0x5bb9e7){return _0x5bb9e7?{'count':_0x1d5ec1,'rows':_0x5bb9e7}:null;}})[_0x56ae('0x15')](respondWithResult(_0x2a1926,null))['catch'](handleError(_0x2a1926,null));};
\ No newline at end of file
+var _0xee48=['status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','name','send','index','fieldName','type','key','getOptions','ChatQueue','include','query','findAll','catch','show','params','model','keys','rawAttributes','filters','attributes','fields','length','includeAll','options','create','body','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','intersection','hasOwnProperty','nolimit','limit','order','sort','where','pick','ChatQueueId','filter','merge','map','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','addTeams','ids','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','includes','all','union','compact','isEmpty','userChatQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','bluebird','util','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.socket','sendStatus'];(function(_0x58258c,_0x34e72f){var _0x174c02=function(_0x79838e){while(--_0x79838e){_0x58258c['push'](_0x58258c['shift']());}};_0x174c02(++_0x34e72f);}(_0xee48,0x15c));var _0x8ee4=function(_0x1b91c7,_0x539acd){_0x1b91c7=_0x1b91c7-0x0;var _0xbbe014=_0xee48[_0x1b91c7];return _0xbbe014;};'use strict';var BPromise=require(_0x8ee4('0x0'));var util=require(_0x8ee4('0x1'));var _=require(_0x8ee4('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x8ee4('0x3'));var logger=require(_0x8ee4('0x4'))('api');var config=require(_0x8ee4('0x5'));var db=require(_0x8ee4('0x6'))['db'];config['redis']=_[_0x8ee4('0x7')](config[_0x8ee4('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ee4('0x9'))(new Redis(config[_0x8ee4('0x8')]));require(_0x8ee4('0xa'))['register'](socket);function respondWithStatusCode(_0x83dfe2,_0x4c6681){_0x4c6681=_0x4c6681||0xcc;return function(_0x2547ab){if(_0x2547ab){return _0x83dfe2[_0x8ee4('0xb')](_0x4c6681);}return _0x83dfe2[_0x8ee4('0xc')](_0x4c6681)[_0x8ee4('0xd')]();};}function respondWithResult(_0xfe67f7,_0x822f0){_0x822f0=_0x822f0||0xc8;return function(_0x19ce74){if(_0x19ce74){return _0xfe67f7['status'](_0x822f0)[_0x8ee4('0xe')](_0x19ce74);}};}function respondWithFilteredResult(_0x1b4979,_0x3632e6){return function(_0x13a638){if(_0x13a638){var _0x1baebf=typeof _0x3632e6[_0x8ee4('0xf')]===_0x8ee4('0x10')&&typeof _0x3632e6['limit']===_0x8ee4('0x10');var _0x271103=_0x13a638[_0x8ee4('0x11')];var _0x1a955a=_0x1baebf?0x0:_0x3632e6[_0x8ee4('0xf')];var _0x58e7b9=_0x1baebf?_0x13a638[_0x8ee4('0x11')]:_0x3632e6['offset']+_0x3632e6['limit'];var _0x234fd6;if(_0x58e7b9>=_0x271103){_0x58e7b9=_0x271103;_0x234fd6=0xc8;}else{_0x234fd6=0xce;}_0x1b4979[_0x8ee4('0xc')](_0x234fd6);return _0x1b4979[_0x8ee4('0x12')](_0x8ee4('0x13'),_0x1a955a+'-'+_0x58e7b9+'/'+_0x271103)[_0x8ee4('0xe')](_0x13a638);}return null;};}function saveUpdates(_0x763dbd){return function(_0x531b6c){if(_0x531b6c){return _0x531b6c[_0x8ee4('0x14')](_0x763dbd)[_0x8ee4('0x15')](function(_0x3081cb){return _0x3081cb;});}return null;};}function removeEntity(_0x4c3115){return function(_0x20f0b6){if(_0x20f0b6){return _0x20f0b6[_0x8ee4('0x16')]()[_0x8ee4('0x15')](function(){var _0x3f5931=_0x20f0b6[_0x8ee4('0x17')]({'plain':!![]});var _0x5f1948=_0x8ee4('0x18');return db[_0x8ee4('0x19')][_0x8ee4('0x16')]({'where':{'type':_0x5f1948,'resourceId':_0x3f5931['id']}})[_0x8ee4('0x15')](function(){return _0x20f0b6;});})[_0x8ee4('0x15')](function(){_0x4c3115[_0x8ee4('0xc')](0xcc)[_0x8ee4('0xd')]();});}};}function handleEntityNotFound(_0x644247){return function(_0x1c9d09){if(!_0x1c9d09){_0x644247[_0x8ee4('0xb')](0x194);}return _0x1c9d09;};}function handleError(_0x2dbdba,_0x1a78bd){_0x1a78bd=_0x1a78bd||0x1f4;return function(_0x4b7a73){logger[_0x8ee4('0x1a')](_0x4b7a73['stack']);if(_0x4b7a73[_0x8ee4('0x1b')]){delete _0x4b7a73['name'];}_0x2dbdba[_0x8ee4('0xc')](_0x1a78bd)[_0x8ee4('0x1c')](_0x4b7a73);};}exports[_0x8ee4('0x1d')]=function(_0x91b89,_0x3d6006){var _0x21635b={};var _0x5765c4={'count':0x0,'rows':[]};var _0x351fbb=_['map'](db['ChatQueue']['rawAttributes'],function(_0x189240){return{'name':_0x189240[_0x8ee4('0x1e')],'type':_0x189240[_0x8ee4('0x1f')][_0x8ee4('0x20')]};});_0x21635b=qs[_0x8ee4('0x21')](_0x351fbb,_0x91b89);var _0xfc7539={'where':_0x21635b['where']};return db[_0x8ee4('0x22')][_0x8ee4('0x11')](_0xfc7539)['then'](function(_0x2dc3ca){_0x5765c4[_0x8ee4('0x11')]=_0x2dc3ca;_0x21635b['include']=qs[_0x8ee4('0x23')](_0x91b89[_0x8ee4('0x24')]);return db[_0x8ee4('0x22')][_0x8ee4('0x25')](_0x21635b);})['then'](function(_0x3f52c1){_0x5765c4['rows']=_0x3f52c1;return _0x5765c4;})[_0x8ee4('0x15')](respondWithFilteredResult(_0x3d6006,_0x21635b))[_0x8ee4('0x26')](handleError(_0x3d6006,null));};exports[_0x8ee4('0x27')]=function(_0x433ecd,_0x412ff2){var _0x5746cd={'raw':!![],'where':{'id':_0x433ecd[_0x8ee4('0x28')]['id']}},_0x39487e={};_0x39487e[_0x8ee4('0x29')]=_[_0x8ee4('0x2a')](db[_0x8ee4('0x22')][_0x8ee4('0x2b')]);_0x39487e['query']=_['keys'](_0x433ecd['query']);_0x39487e[_0x8ee4('0x2c')]=_['intersection'](_0x39487e[_0x8ee4('0x29')],_0x39487e[_0x8ee4('0x24')]);_0x5746cd[_0x8ee4('0x2d')]=_['intersection'](_0x39487e[_0x8ee4('0x29')],qs[_0x8ee4('0x2e')](_0x433ecd[_0x8ee4('0x24')][_0x8ee4('0x2e')]));_0x5746cd[_0x8ee4('0x2d')]=_0x5746cd[_0x8ee4('0x2d')][_0x8ee4('0x2f')]?_0x5746cd[_0x8ee4('0x2d')]:_0x39487e[_0x8ee4('0x29')];if(_0x433ecd[_0x8ee4('0x24')][_0x8ee4('0x30')]){_0x5746cd[_0x8ee4('0x23')]=[{'all':!![]}];}_0x5746cd=_['merge']({},_0x5746cd,_0x433ecd[_0x8ee4('0x31')]);return db[_0x8ee4('0x22')]['find'](_0x5746cd)[_0x8ee4('0x15')](handleEntityNotFound(_0x412ff2,null))[_0x8ee4('0x15')](respondWithResult(_0x412ff2,null))[_0x8ee4('0x26')](handleError(_0x412ff2,null));};exports[_0x8ee4('0x32')]=function(_0x2c93ad,_0xbe2fed){return db[_0x8ee4('0x22')][_0x8ee4('0x32')](_0x2c93ad[_0x8ee4('0x33')],{})[_0x8ee4('0x15')](function(_0x4fa218){var _0x1c3228=_0x2c93ad[_0x8ee4('0x34')][_0x8ee4('0x17')]({'plain':!![]});if(!_0x1c3228)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c3228[_0x8ee4('0x35')]===_0x8ee4('0x34')){var _0x188d12=_0x4fa218['get']({'plain':!![]});var _0x303f78='ChatQueues';return db['UserProfileSection'][_0x8ee4('0x36')]({'where':{'name':_0x303f78,'userProfileId':_0x1c3228['userProfileId']},'raw':!![]})[_0x8ee4('0x15')](function(_0x4235a0){if(_0x4235a0&&_0x4235a0[_0x8ee4('0x37')]===0x0){return db[_0x8ee4('0x19')][_0x8ee4('0x32')]({'name':_0x188d12[_0x8ee4('0x1b')],'resourceId':_0x188d12['id'],'type':_0x4235a0[_0x8ee4('0x1b')],'sectionId':_0x4235a0['id']},{})['then'](function(){return _0x4fa218;});}else{return _0x4fa218;}})[_0x8ee4('0x26')](function(_0x1f4214){logger[_0x8ee4('0x1a')](_0x8ee4('0x38'),_0x1f4214);throw _0x1f4214;});}return _0x4fa218;})[_0x8ee4('0x15')](respondWithResult(_0xbe2fed,0xc9))[_0x8ee4('0x26')](handleError(_0xbe2fed,null));};exports[_0x8ee4('0x14')]=function(_0x14e89a,_0x250910){if(_0x14e89a[_0x8ee4('0x33')]['id']){delete _0x14e89a[_0x8ee4('0x33')]['id'];}return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x14e89a[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x250910,null))[_0x8ee4('0x15')](saveUpdates(_0x14e89a[_0x8ee4('0x33')],null))['then'](respondWithResult(_0x250910,null))[_0x8ee4('0x26')](handleError(_0x250910,null));};exports[_0x8ee4('0x16')]=function(_0x5a0c1c,_0x17d85c){return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x5a0c1c[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x17d85c,null))[_0x8ee4('0x15')](removeEntity(_0x17d85c,null))[_0x8ee4('0x26')](handleError(_0x17d85c,null));};exports[_0x8ee4('0x39')]=function(_0x102dbe,_0x5b2ec){return db[_0x8ee4('0x22')][_0x8ee4('0x39')]()[_0x8ee4('0x15')](respondWithResult(_0x5b2ec,null))[_0x8ee4('0x26')](handleError(_0x5b2ec,null));};exports[_0x8ee4('0x3a')]=function(_0x46fcb6,_0x25c115){var _0x1e2695={'raw':!![],'where':{}},_0x4eafd7={},_0x8f5754;return db[_0x8ee4('0x22')][_0x8ee4('0x3b')]({'where':{'id':_0x46fcb6[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x25c115,null))[_0x8ee4('0x15')](function(_0x3a6ff9){if(_0x3a6ff9){_0x8f5754=_0x3a6ff9[_0x8ee4('0x17')]({'plain':!![]});_0x4eafd7[_0x8ee4('0x29')]=_[_0x8ee4('0x2a')](db[_0x8ee4('0x3c')][_0x8ee4('0x2b')]);_0x4eafd7['query']=_[_0x8ee4('0x2a')](_0x46fcb6['query']);_0x4eafd7[_0x8ee4('0x2c')]=_[_0x8ee4('0x3d')](_0x4eafd7[_0x8ee4('0x29')],_0x4eafd7['query']);_0x1e2695[_0x8ee4('0x2d')]=_[_0x8ee4('0x3d')](_0x4eafd7[_0x8ee4('0x29')],qs['fields'](_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x2e')]));_0x1e2695['attributes']=_0x1e2695['attributes'][_0x8ee4('0x2f')]?_0x1e2695['attributes']:_0x4eafd7[_0x8ee4('0x29')];if(!_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x3e')](_0x8ee4('0x3f'))){_0x1e2695[_0x8ee4('0x40')]=qs[_0x8ee4('0x40')](_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x40')]);_0x1e2695['offset']=qs[_0x8ee4('0xf')](_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0xf')]);}_0x1e2695[_0x8ee4('0x41')]=qs[_0x8ee4('0x42')](_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x42')]);_0x1e2695[_0x8ee4('0x43')]=qs[_0x8ee4('0x2c')](_[_0x8ee4('0x44')](_0x46fcb6['query'],_0x4eafd7['filters']));_0x1e2695[_0x8ee4('0x43')][_0x8ee4('0x45')]=_0x3a6ff9['id'];if(_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x46')]){_0x1e2695[_0x8ee4('0x43')]=_[_0x8ee4('0x47')](_0x1e2695['where'],{'$or':_[_0x8ee4('0x48')](_0x1e2695['attributes'],function(_0xb5bb19){var _0x3b19b1={};_0x3b19b1[_0xb5bb19]={'$like':'%'+_0x46fcb6[_0x8ee4('0x24')][_0x8ee4('0x46')]+'%'};return _0x3b19b1;})});}_0x1e2695=_[_0x8ee4('0x47')]({},_0x1e2695,_0x46fcb6[_0x8ee4('0x31')]);return db[_0x8ee4('0x3c')][_0x8ee4('0x25')](_0x1e2695);}})[_0x8ee4('0x15')](function(_0x2318b9){if(_0x2318b9){return db[_0x8ee4('0x49')][_0x8ee4('0x4a')]({'where':{'id':_['map'](_0x2318b9,_0x8ee4('0x4b')),'role':'agent'},'attributes':['id',_0x8ee4('0x1b'),_0x8ee4('0x4c'),_0x8ee4('0x4d'),_0x8ee4('0x4e')]});}})['then'](function(_0x5a700c){if(_0x5a700c){return{'count':_0x5a700c[_0x8ee4('0x11')],'rows':_[_0x8ee4('0x48')](_0x5a700c[_0x8ee4('0x4f')],function(_0x369c27){return{'membername':_0x369c27[_0x8ee4('0x1b')],'UserId':_0x369c27['id'],'queue_name':_0x8f5754[_0x8ee4('0x1b')],'ChatQueueId':_0x8f5754['id'],'interface':util['format'](_0x8ee4('0x50'),_0x8ee4('0x51'),_0x369c27['name']),'penalty':0x0,'paused':_0x369c27[_0x8ee4('0x4c')],'createdAt':_0x369c27['createdAt'],'updatedAt':_0x369c27[_0x8ee4('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8ee4('0x15')](respondWithFilteredResult(_0x25c115,_0x1e2695))[_0x8ee4('0x26')](handleError(_0x25c115,null));};exports[_0x8ee4('0x52')]=function(_0x43f74d,_0x27d395){var _0x134f3d={};var _0x42d94f={};var _0x5c364a;var _0xbeafa;return db[_0x8ee4('0x22')][_0x8ee4('0x3b')]({'where':{'id':_0x43f74d[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x27d395,null))[_0x8ee4('0x15')](function(_0x12ccb8){if(_0x12ccb8){_0x5c364a=_0x12ccb8;_0x42d94f[_0x8ee4('0x29')]=_[_0x8ee4('0x2a')](db[_0x8ee4('0x53')][_0x8ee4('0x2b')]);_0x42d94f[_0x8ee4('0x24')]=_[_0x8ee4('0x2a')](_0x43f74d[_0x8ee4('0x24')]);_0x42d94f[_0x8ee4('0x2c')]=_[_0x8ee4('0x3d')](_0x42d94f[_0x8ee4('0x29')],_0x42d94f[_0x8ee4('0x24')]);_0x134f3d[_0x8ee4('0x2d')]=_[_0x8ee4('0x3d')](_0x42d94f['model'],qs[_0x8ee4('0x2e')](_0x43f74d[_0x8ee4('0x24')][_0x8ee4('0x2e')]));_0x134f3d[_0x8ee4('0x2d')]=_0x134f3d[_0x8ee4('0x2d')][_0x8ee4('0x2f')]?_0x134f3d[_0x8ee4('0x2d')]:_0x42d94f[_0x8ee4('0x29')];_0x134f3d[_0x8ee4('0x41')]=qs[_0x8ee4('0x42')](_0x43f74d['query'][_0x8ee4('0x42')]);_0x134f3d[_0x8ee4('0x43')]=qs['filters'](_[_0x8ee4('0x44')](_0x43f74d[_0x8ee4('0x24')],_0x42d94f['filters']));if(_0x43f74d['query']['filter']){_0x134f3d['where']=_[_0x8ee4('0x47')](_0x134f3d['where'],{'$or':_[_0x8ee4('0x48')](_0x134f3d['attributes'],function(_0x9b6e21){var _0x55dbd0={};_0x55dbd0[_0x9b6e21]={'$like':'%'+_0x43f74d[_0x8ee4('0x24')]['filter']+'%'};return _0x55dbd0;})});}_0x134f3d=_[_0x8ee4('0x47')]({},_0x134f3d,_0x43f74d[_0x8ee4('0x31')]);return _0x5c364a[_0x8ee4('0x52')](_0x134f3d);}})[_0x8ee4('0x15')](function(_0x2f1bff){if(_0x2f1bff){_0xbeafa=_0x2f1bff[_0x8ee4('0x2f')];if(!_0x43f74d[_0x8ee4('0x24')][_0x8ee4('0x3e')](_0x8ee4('0x3f'))){_0x134f3d[_0x8ee4('0x40')]=qs[_0x8ee4('0x40')](_0x43f74d['query'][_0x8ee4('0x40')]);_0x134f3d[_0x8ee4('0xf')]=qs[_0x8ee4('0xf')](_0x43f74d[_0x8ee4('0x24')]['offset']);}return _0x5c364a['getTeams'](_0x134f3d);}})[_0x8ee4('0x15')](function(_0x339c67){if(_0x339c67){return _0x339c67?{'count':_0xbeafa,'rows':_0x339c67}:null;}})['then'](respondWithResult(_0x27d395,null))[_0x8ee4('0x26')](handleError(_0x27d395,null));};exports[_0x8ee4('0x54')]=function(_0x5cb433,_0x59798e){var _0x2fb2f6=_0x5cb433['body'][_0x8ee4('0x55')];return db[_0x8ee4('0x53')][_0x8ee4('0x25')]({'where':{'id':_0x2fb2f6},'attributes':['id'],'include':[{'model':db[_0x8ee4('0x49')],'as':'Agents','attributes':['id','name','online',_0x8ee4('0x56'),_0x8ee4('0x57')],'raw':!![]}]})[_0x8ee4('0x15')](function(_0x11939a){if(_0x11939a){var _0x3877f1=_[_0x8ee4('0x58')](_0x11939a,function(_0x59d288){var _0x533496=_0x59d288['get']({'plain':!![]});return _0x533496[_0x8ee4('0x59')];});return db[_0x8ee4('0x22')]['find']({'where':{'id':_0x5cb433['params']['id']}})[_0x8ee4('0x15')](function(_0x467515){return db['sequelize'][_0x8ee4('0x5a')](function(_0x3be986){return _0x467515[_0x8ee4('0x54')](_0x2fb2f6,{'transaction':_0x3be986})[_0x8ee4('0x15')](function(){return BPromise[_0x8ee4('0x5b')](_0x3877f1,function(_0x20398a){return db[_0x8ee4('0x3c')][_0x8ee4('0x5c')]({'where':{'UserId':_0x20398a['id'],'ChatQueueId':_0x5cb433[_0x8ee4('0x28')]['id']},'transaction':_0x3be986});});})['then'](function(){_0x3877f1[_0x8ee4('0x5d')](function(_0x430b45){socket[_0x8ee4('0x5e')](_0x8ee4('0x5f'),{'UserId':_0x430b45['id'],'ChatQueueId':_0x467515['id']});});});});});}})[_0x8ee4('0x15')](respondWithStatusCode(_0x59798e,null))[_0x8ee4('0x26')](handleError(_0x59798e,null));};exports[_0x8ee4('0x60')]=function(_0x1ba07e,_0x4fa86d){return db[_0x8ee4('0x53')][_0x8ee4('0x25')]({'where':{'id':_0x1ba07e[_0x8ee4('0x24')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8ee4('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8ee4('0x15')](handleEntityNotFound(_0x4fa86d,null))[_0x8ee4('0x15')](function(_0x236f7d){var _0x32d17d=_[_0x8ee4('0x48')](_0x236f7d,'id');var _0x45ef4d=[];var _0x3fcaeb=[];var _0x47caed=squel[_0x8ee4('0x61')]();_0x47caed[_0x8ee4('0x62')]('tq.TeamId')[_0x8ee4('0x63')]('team_has_chat_queues','tq')[_0x8ee4('0x64')]('user_has_teams','ut',_0x8ee4('0x65'))[_0x8ee4('0x43')](_0x8ee4('0x66'),_0x1ba07e[_0x8ee4('0x28')]['id']);for(var _0xffdf56=0x0;_0xffdf56<_0x236f7d[_0x8ee4('0x2f')];_0xffdf56+=0x1){let _0x239741=_0x236f7d[_0xffdf56];for(var _0x1bc51e=0x0;_0x1bc51e<_0x239741['Agents'][_0x8ee4('0x2f')];_0x1bc51e+=0x1){let _0x9555ae=_0x239741[_0x8ee4('0x59')][_0x1bc51e];var _0x3e0405=_0x47caed[_0x8ee4('0x67')]();_0x3e0405[_0x8ee4('0x43')](_0x8ee4('0x68'),_0x9555ae['id']);_0x3fcaeb[_0x8ee4('0x69')](db[_0x8ee4('0x6a')]['query'](_0x3e0405['toString'](),{'type':db[_0x8ee4('0x6a')][_0x8ee4('0x6b')][_0x8ee4('0x6c')]})[_0x8ee4('0x15')](function(_0x4a3440){if(_0x4a3440[_0x8ee4('0x2f')]===0x1){return _0x9555ae['id'];}else{var _0x5ab59d=_['every'](_[_0x8ee4('0x48')](_0x4a3440,'TeamId'),function(_0x56e39a){return _[_0x8ee4('0x6d')](_0x32d17d,_0x56e39a);});if(_0x5ab59d){return _0x9555ae['id'];}}}));}}return BPromise[_0x8ee4('0x6e')](_0x3fcaeb)['then'](function(_0x28649e){_0x45ef4d=_(_0x45ef4d)[_0x8ee4('0x6f')](_0x28649e)[_0x8ee4('0x70')]()['value']();return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x1ba07e['params']['id']}})[_0x8ee4('0x15')](function(_0x4433d0){return db[_0x8ee4('0x6a')][_0x8ee4('0x5a')](function(_0xa7aace){return _0x4433d0[_0x8ee4('0x60')](_0x1ba07e[_0x8ee4('0x24')][_0x8ee4('0x55')],{'transaction':_0xa7aace})[_0x8ee4('0x15')](function(){if(!_[_0x8ee4('0x71')](_0x45ef4d)){return _0x4433d0['removeAgents'](_0x45ef4d,{'transaction':_0xa7aace});}})[_0x8ee4('0x15')](function(){_0x45ef4d[_0x8ee4('0x5d')](function(_0x205bf8){socket[_0x8ee4('0x5e')](_0x8ee4('0x72'),{'UserId':_0x205bf8,'ChatQueueId':_0x4433d0['id']});});});});});});})['then'](respondWithStatusCode(_0x4fa86d,null))[_0x8ee4('0x26')](handleError(_0x4fa86d,null));};exports['addAgents']=function(_0x2fd895,_0x403d5f){return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x2fd895[_0x8ee4('0x28')]['id']}})['then'](handleEntityNotFound(_0x403d5f,null))[_0x8ee4('0x15')](function(_0xe00cd5){if(_0xe00cd5){return _0xe00cd5[_0x8ee4('0x73')](_0x2fd895[_0x8ee4('0x33')][_0x8ee4('0x55')],_['omit'](_0x2fd895[_0x8ee4('0x33')],['ids','id'])||{})[_0x8ee4('0x74')](function(_0x45c8a0){for(var _0x2865cd=0x0;_0x2865cd<_0x2fd895[_0x8ee4('0x33')][_0x8ee4('0x55')][_0x8ee4('0x2f')];_0x2865cd+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x2fd895['body'][_0x8ee4('0x55')][_0x2865cd]),'ChatQueueId':Number(_0x2fd895[_0x8ee4('0x28')]['id'])});}return _0x45c8a0;});}})['then'](respondWithResult(_0x403d5f,null))[_0x8ee4('0x26')](handleError(_0x403d5f,null));};exports[_0x8ee4('0x75')]=function(_0x166ac0,_0xd8c685){return db[_0x8ee4('0x22')][_0x8ee4('0x36')]({'where':{'id':_0x166ac0['params']['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0xd8c685,null))['then'](function(_0x56bec3){if(_0x56bec3){return _0x56bec3[_0x8ee4('0x75')](_0x166ac0[_0x8ee4('0x24')][_0x8ee4('0x55')])['then'](function(){if(_[_0x8ee4('0x76')](_0x166ac0['query'][_0x8ee4('0x55')])){for(var _0x57fb4b=0x0;_0x57fb4b<_0x166ac0[_0x8ee4('0x24')][_0x8ee4('0x55')][_0x8ee4('0x2f')];_0x57fb4b+=0x1){socket[_0x8ee4('0x5e')](_0x8ee4('0x72'),{'UserId':Number(_0x166ac0[_0x8ee4('0x24')][_0x8ee4('0x55')][_0x57fb4b]),'ChatQueueId':Number(_0x166ac0[_0x8ee4('0x28')]['id'])});}}else{socket[_0x8ee4('0x5e')](_0x8ee4('0x72'),{'UserId':Number(_0x166ac0[_0x8ee4('0x24')][_0x8ee4('0x55')]),'ChatQueueId':Number(_0x166ac0[_0x8ee4('0x28')]['id'])});}});}})[_0x8ee4('0x15')](respondWithStatusCode(_0xd8c685,null))['catch'](handleError(_0xd8c685,null));};exports[_0x8ee4('0x77')]=function(_0x1c6a75,_0x3cbbb4){var _0x115f1e={};var _0x2f5ba2={};var _0x3874fa;var _0x2f39a6;return db[_0x8ee4('0x22')][_0x8ee4('0x3b')]({'where':{'id':_0x1c6a75[_0x8ee4('0x28')]['id']}})[_0x8ee4('0x15')](handleEntityNotFound(_0x3cbbb4,null))['then'](function(_0x47a37c){if(_0x47a37c){_0x3874fa=_0x47a37c;_0x2f5ba2['model']=_[_0x8ee4('0x2a')](db[_0x8ee4('0x49')][_0x8ee4('0x2b')]);_0x2f5ba2[_0x8ee4('0x24')]=_['keys'](_0x1c6a75[_0x8ee4('0x24')]);_0x2f5ba2[_0x8ee4('0x2c')]=_['intersection'](_0x2f5ba2[_0x8ee4('0x29')],_0x2f5ba2[_0x8ee4('0x24')]);_0x115f1e[_0x8ee4('0x2d')]=_['intersection'](_0x2f5ba2[_0x8ee4('0x29')],qs[_0x8ee4('0x2e')](_0x1c6a75['query'][_0x8ee4('0x2e')]));_0x115f1e[_0x8ee4('0x2d')]=_0x115f1e[_0x8ee4('0x2d')][_0x8ee4('0x2f')]?_0x115f1e[_0x8ee4('0x2d')]:_0x2f5ba2[_0x8ee4('0x29')];_0x115f1e[_0x8ee4('0x41')]=qs[_0x8ee4('0x42')](_0x1c6a75[_0x8ee4('0x24')][_0x8ee4('0x42')]);_0x115f1e[_0x8ee4('0x43')]=qs['filters'](_[_0x8ee4('0x44')](_0x1c6a75[_0x8ee4('0x24')],_0x2f5ba2[_0x8ee4('0x2c')]));if(_0x1c6a75[_0x8ee4('0x24')]['filter']){_0x115f1e[_0x8ee4('0x43')]=_['merge'](_0x115f1e[_0x8ee4('0x43')],{'$or':_[_0x8ee4('0x48')](_0x115f1e[_0x8ee4('0x2d')],function(_0x25dd67){var _0x48304e={};_0x48304e[_0x25dd67]={'$like':'%'+_0x1c6a75['query'][_0x8ee4('0x46')]+'%'};return _0x48304e;})});}_0x115f1e=_['merge']({},_0x115f1e,_0x1c6a75[_0x8ee4('0x31')]);return _0x3874fa['getAgents'](_0x115f1e);}})[_0x8ee4('0x15')](function(_0x3ca996){if(_0x3ca996){_0x2f39a6=_0x3ca996[_0x8ee4('0x2f')];if(!_0x1c6a75[_0x8ee4('0x24')][_0x8ee4('0x3e')](_0x8ee4('0x3f'))){_0x115f1e[_0x8ee4('0x40')]=qs[_0x8ee4('0x40')](_0x1c6a75[_0x8ee4('0x24')]['limit']);_0x115f1e[_0x8ee4('0xf')]=qs['offset'](_0x1c6a75[_0x8ee4('0x24')][_0x8ee4('0xf')]);}return _0x3874fa[_0x8ee4('0x77')](_0x115f1e);}})[_0x8ee4('0x15')](function(_0x9fd9e5){if(_0x9fd9e5){return _0x9fd9e5?{'count':_0x2f39a6,'rows':_0x9fd9e5}:null;}})[_0x8ee4('0x15')](respondWithResult(_0x3cbbb4,null))[_0x8ee4('0x26')](handleError(_0x3cbbb4,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 8bf3b40..d9a7e9b 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 _0x075e=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x5a8b7f,_0x1d00e7){var _0x5ac4ba=function(_0x4ad317){while(--_0x4ad317){_0x5a8b7f['push'](_0x5a8b7f['shift']());}};_0x5ac4ba(++_0x1d00e7);}(_0x075e,0x92));var _0xe075=function(_0xa82fd8,_0x32d148){_0xa82fd8=_0xa82fd8-0x0;var _0x326265=_0x075e[_0xa82fd8];return _0x326265;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xe075('0x0'))['db'][_0xe075('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe075('0x2')](0x0);var events={'afterCreate':_0xe075('0x3'),'afterUpdate':_0xe075('0x4'),'afterDestroy':_0xe075('0x5')};function emitEvent(_0x15bef2){return function(_0x422c3a,_0x5eddf4,_0xc28e9d){ChatQueueEvents[_0xe075('0x6')](_0x15bef2+':'+_0x422c3a['id'],_0x422c3a);ChatQueueEvents['emit'](_0x15bef2,_0x422c3a);_0xc28e9d(null);};}for(var e in events){if(events[_0xe075('0x7')](e)){var event=events[e];ChatQueue[_0xe075('0x8')](e,emitEvent(event));}}module[_0xe075('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x0d1a=['events','../../mysqldb','ChatQueue','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x9cf723,_0x4fd2d4){var _0x58ed46=function(_0xb2ff39){while(--_0xb2ff39){_0x9cf723['push'](_0x9cf723['shift']());}};_0x58ed46(++_0x4fd2d4);}(_0x0d1a,0x1e6));var _0xa0d1=function(_0x1ea259,_0x4a177){_0x1ea259=_0x1ea259-0x0;var _0x5d13d1=_0x0d1a[_0x1ea259];return _0x5d13d1;};'use strict';var EventEmitter=require(_0xa0d1('0x0'));var ChatQueue=require(_0xa0d1('0x1'))['db'][_0xa0d1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa0d1('0x3'),'afterUpdate':'update','afterDestroy':_0xa0d1('0x4')};function emitEvent(_0x153ab5){return function(_0xaa0c3e,_0x1c0966,_0x466865){ChatQueueEvents['emit'](_0x153ab5+':'+_0xaa0c3e['id'],_0xaa0c3e);ChatQueueEvents[_0xa0d1('0x5')](_0x153ab5,_0xaa0c3e);_0x466865(null);};}for(var e in events){if(events[_0xa0d1('0x6')](e)){var event=events[e];ChatQueue[_0xa0d1('0x7')](e,emitEvent(event));}}module[_0xa0d1('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index ac006db..36256a1 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 _0x6329=['rimraf','./chatQueue.attributes','exports','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','path'];(function(_0x36e4de,_0x36e0d6){var _0x3642cf=function(_0x2c4a91){while(--_0x2c4a91){_0x36e4de['push'](_0x36e4de['shift']());}};_0x3642cf(++_0x36e0d6);}(_0x6329,0xc0));var _0x9632=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6329[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x9632('0x0'));var logger=require(_0x9632('0x1'))(_0x9632('0x2'));var moment=require(_0x9632('0x3'));var BPromise=require(_0x9632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9632('0x5'));var rimraf=require(_0x9632('0x6'));var config=require('../../config/environment');var attributes=require(_0x9632('0x7'));module[_0x9632('0x8')]=function(_0x4d3478,_0x3a9860){return _0x4d3478['define'](_0x9632('0x9'),attributes,{'tableName':_0x9632('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7ac=['request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x5900b5,_0x2a190b){var _0x3da078=function(_0x42b551){while(--_0x42b551){_0x5900b5['push'](_0x5900b5['shift']());}};_0x3da078(++_0x2a190b);}(_0xa7ac,0xba));var _0xca7a=function(_0x3eddfa,_0x45950e){_0x3eddfa=_0x3eddfa-0x0;var _0x21a5fe=_0xa7ac[_0x3eddfa];return _0x21a5fe;};'use strict';var _=require(_0xca7a('0x0'));var util=require('util');var logger=require(_0xca7a('0x1'))(_0xca7a('0x2'));var moment=require('moment');var BPromise=require(_0xca7a('0x3'));var rp=require(_0xca7a('0x4'));var fs=require('fs');var path=require(_0xca7a('0x5'));var rimraf=require('rimraf');var config=require(_0xca7a('0x6'));var attributes=require(_0xca7a('0x7'));module[_0xca7a('0x8')]=function(_0x2c35bb,_0xb2a120){return _0x2c35bb[_0xca7a('0x9')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 03597a7..8ae7330 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 _0x17bb=['ChatQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model','debug','ShowChatQueue'];(function(_0x5167a4,_0x4ac437){var _0xba0081=function(_0xad262a){while(--_0xad262a){_0x5167a4['push'](_0x5167a4['shift']());}};_0xba0081(++_0x4ac437);}(_0x17bb,0x188));var _0xb17b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x17bb[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xb17b('0x0'));var util=require(_0xb17b('0x1'));var moment=require(_0xb17b('0x2'));var BPromise=require(_0xb17b('0x3'));var rs=require(_0xb17b('0x4'));var fs=require('fs');var Redis=require(_0xb17b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb17b('0x6'));var logger=require(_0xb17b('0x7'))(_0xb17b('0x8'));var config=require(_0xb17b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb17b('0xa')]['http']({'port':0x232a});config[_0xb17b('0xb')]=_[_0xb17b('0xc')](config[_0xb17b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb17b('0xd'))(new Redis(config[_0xb17b('0xb')]));require(_0xb17b('0xe'))[_0xb17b('0xf')](socket);function respondWithRpcPromise(_0x420689,_0x32a3ab,_0x4141c9){return new BPromise(function(_0x7d398e,_0x2b8972){return client['request'](_0x420689,_0x4141c9)[_0xb17b('0x10')](function(_0x4bb871){logger[_0xb17b('0x11')](_0xb17b('0x12'),_0x32a3ab,_0xb17b('0x13'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x32a3ab,_0xb17b('0x13'),JSON[_0xb17b('0x14')](_0x4bb871));if(_0x4bb871[_0xb17b('0x15')]){if(_0x4bb871[_0xb17b('0x15')][_0xb17b('0x16')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x32a3ab,_0x4bb871['error']['message']);return _0x2b8972(_0x4bb871['error'][_0xb17b('0x17')]);}logger['error'](_0xb17b('0x12'),_0x32a3ab,_0x4bb871['error'][_0xb17b('0x17')]);return _0x7d398e(_0x4bb871[_0xb17b('0x15')][_0xb17b('0x17')]);}else{logger[_0xb17b('0x11')]('ChatQueue,\x20%s,\x20%s',_0x32a3ab,_0xb17b('0x13'));_0x7d398e(_0x4bb871[_0xb17b('0x18')][_0xb17b('0x17')]);}})[_0xb17b('0x19')](function(_0x8c7b17){logger[_0xb17b('0x15')](_0xb17b('0x12'),_0x32a3ab,_0x8c7b17);_0x2b8972(_0x8c7b17);});});}exports[_0xb17b('0x1a')]=function(_0x1d3134){var _0xcb3d3a=this;return new Promise(function(_0x268e9f,_0x852753){return db['ChatQueue'][_0xb17b('0x1b')]({'raw':_0x1d3134['options']?_0x1d3134[_0xb17b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1d3134[_0xb17b('0x1c')]?_0x1d3134[_0xb17b('0x1c')][_0xb17b('0x1d')]||null:null,'attributes':_0x1d3134[_0xb17b('0x1c')]?_0x1d3134['options'][_0xb17b('0x1e')]||null:null,'limit':_0x1d3134[_0xb17b('0x1c')]?_0x1d3134[_0xb17b('0x1c')][_0xb17b('0x1f')]||null:null,'include':_0x1d3134[_0xb17b('0x1c')]?_0x1d3134[_0xb17b('0x1c')][_0xb17b('0x20')]?_[_0xb17b('0x21')](_0x1d3134[_0xb17b('0x1c')][_0xb17b('0x20')],function(_0x1f6124){return{'model':db[_0x1f6124['model']],'as':_0x1f6124['as'],'attributes':_0x1f6124[_0xb17b('0x1e')],'include':_0x1f6124[_0xb17b('0x20')]?_['map'](_0x1f6124[_0xb17b('0x20')],function(_0x45b15a){return{'model':db[_0x45b15a['model']],'as':_0x45b15a['as'],'attributes':_0x45b15a[_0xb17b('0x1e')],'include':_0x45b15a['include']?_[_0xb17b('0x21')](_0x45b15a['include'],function(_0x425fb4){return{'model':db[_0x425fb4[_0xb17b('0x22')]],'as':_0x425fb4['as'],'attributes':_0x425fb4['attributes']};}):[]};}):[]};}):[]:[]})[_0xb17b('0x10')](function(_0x53ac71){logger[_0xb17b('0x11')](_0xb17b('0x1a'),_0x1d3134);logger[_0xb17b('0x23')](_0xb17b('0x1a'),_0x1d3134,JSON[_0xb17b('0x14')](_0x53ac71));_0x268e9f(_0x53ac71);})[_0xb17b('0x19')](function(_0x3c5a72){logger[_0xb17b('0x15')](_0xb17b('0x1a'),_0x3c5a72['message'],_0x1d3134);_0x852753(_0xcb3d3a[_0xb17b('0x15')](0x1f4,_0x3c5a72['message']));});});};exports[_0xb17b('0x24')]=function(_0x4b3fa4){var _0x276601=this;return new Promise(function(_0x221bbf,_0x88c4f1){return db[_0xb17b('0x25')]['find']({'raw':_0x4b3fa4['options']?_0x4b3fa4[_0xb17b('0x1c')][_0xb17b('0x26')]===undefined?!![]:![]:!![],'where':_0x4b3fa4['options']?_0x4b3fa4[_0xb17b('0x1c')][_0xb17b('0x1d')]||null:null,'attributes':_0x4b3fa4[_0xb17b('0x1c')]?_0x4b3fa4[_0xb17b('0x1c')][_0xb17b('0x1e')]||null:null,'include':_0x4b3fa4[_0xb17b('0x1c')]?_0x4b3fa4['options']['include']?_[_0xb17b('0x21')](_0x4b3fa4[_0xb17b('0x1c')]['include'],function(_0x469ab5){return{'model':db[_0x469ab5['model']],'as':_0x469ab5['as'],'attributes':_0x469ab5[_0xb17b('0x1e')],'include':_0x469ab5[_0xb17b('0x20')]?_['map'](_0x469ab5[_0xb17b('0x20')],function(_0x4b8934){return{'model':db[_0x4b8934[_0xb17b('0x22')]],'as':_0x4b8934['as'],'attributes':_0x4b8934[_0xb17b('0x1e')],'include':_0x4b8934[_0xb17b('0x20')]?_['map'](_0x4b8934['include'],function(_0x247a5d){return{'model':db[_0x247a5d[_0xb17b('0x22')]],'as':_0x247a5d['as'],'attributes':_0x247a5d[_0xb17b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb17b('0x10')](function(_0x3eaa43){logger['info'](_0xb17b('0x24'),_0x4b3fa4);logger[_0xb17b('0x23')](_0xb17b('0x24'),_0x4b3fa4,JSON[_0xb17b('0x14')](_0x3eaa43));_0x221bbf(_0x3eaa43);})['catch'](function(_0x6b2091){logger[_0xb17b('0x15')]('ShowChatQueue',_0x6b2091['message'],_0x4b3fa4);_0x88c4f1(_0x276601['error'](0x1f4,_0x6b2091[_0xb17b('0x17')]));});});};
\ No newline at end of file
+var _0x56a4=['where','map','include','model','attributes','then','catch','find','raw','ShowChatQueue','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','options'];(function(_0x49ca6b,_0x3ba842){var _0x1d957f=function(_0x12ef94){while(--_0x12ef94){_0x49ca6b['push'](_0x49ca6b['shift']());}};_0x1d957f(++_0x3ba842);}(_0x56a4,0x73));var _0x456a=function(_0x474a72,_0x439f5a){_0x474a72=_0x474a72-0x0;var _0x304966=_0x56a4[_0x474a72];return _0x304966;};'use strict';var _=require('lodash');var util=require(_0x456a('0x0'));var moment=require(_0x456a('0x1'));var BPromise=require(_0x456a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x456a('0x3'))['db'];var utils=require(_0x456a('0x4'));var logger=require(_0x456a('0x5'))(_0x456a('0x6'));var config=require(_0x456a('0x7'));var jayson=require(_0x456a('0x8'));var client=jayson[_0x456a('0x9')][_0x456a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x456a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x456a('0xb')]));require('./chatQueue.socket')[_0x456a('0xc')](socket);function respondWithRpcPromise(_0x86bcda,_0x177988,_0x2e5f10){return new BPromise(function(_0x12f945,_0x56f14c){return client[_0x456a('0xd')](_0x86bcda,_0x2e5f10)['then'](function(_0x59f11c){logger[_0x456a('0xe')](_0x456a('0xf'),_0x177988,_0x456a('0x10'));logger[_0x456a('0x11')](_0x456a('0x12'),_0x177988,_0x456a('0x10'),JSON[_0x456a('0x13')](_0x59f11c));if(_0x59f11c['error']){if(_0x59f11c[_0x456a('0x14')]['code']===0x1f4){logger[_0x456a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x177988,_0x59f11c[_0x456a('0x14')]['message']);return _0x56f14c(_0x59f11c[_0x456a('0x14')]['message']);}logger[_0x456a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x177988,_0x59f11c[_0x456a('0x14')][_0x456a('0x15')]);return _0x12f945(_0x59f11c[_0x456a('0x14')][_0x456a('0x15')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x177988,_0x456a('0x10'));_0x12f945(_0x59f11c[_0x456a('0x16')][_0x456a('0x15')]);}})['catch'](function(_0x5aaf40){logger[_0x456a('0x14')](_0x456a('0xf'),_0x177988,_0x5aaf40);_0x56f14c(_0x5aaf40);});});}exports[_0x456a('0x17')]=function(_0x5aff8b){var _0x202877=this;return new Promise(function(_0x2db147,_0x1378ae){return db['ChatQueue']['findAll']({'raw':_0x5aff8b['options']?_0x5aff8b[_0x456a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5aff8b[_0x456a('0x18')]?_0x5aff8b['options'][_0x456a('0x19')]||null:null,'attributes':_0x5aff8b[_0x456a('0x18')]?_0x5aff8b[_0x456a('0x18')]['attributes']||null:null,'limit':_0x5aff8b['options']?_0x5aff8b[_0x456a('0x18')]['limit']||null:null,'include':_0x5aff8b[_0x456a('0x18')]?_0x5aff8b[_0x456a('0x18')]['include']?_[_0x456a('0x1a')](_0x5aff8b[_0x456a('0x18')][_0x456a('0x1b')],function(_0x3f8967){return{'model':db[_0x3f8967[_0x456a('0x1c')]],'as':_0x3f8967['as'],'attributes':_0x3f8967[_0x456a('0x1d')],'include':_0x3f8967['include']?_[_0x456a('0x1a')](_0x3f8967['include'],function(_0x2f7e93){return{'model':db[_0x2f7e93[_0x456a('0x1c')]],'as':_0x2f7e93['as'],'attributes':_0x2f7e93['attributes'],'include':_0x2f7e93[_0x456a('0x1b')]?_['map'](_0x2f7e93[_0x456a('0x1b')],function(_0x3097fb){return{'model':db[_0x3097fb[_0x456a('0x1c')]],'as':_0x3097fb['as'],'attributes':_0x3097fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x456a('0x1e')](function(_0x25287a){logger[_0x456a('0xe')](_0x456a('0x17'),_0x5aff8b);logger[_0x456a('0x11')](_0x456a('0x17'),_0x5aff8b,JSON[_0x456a('0x13')](_0x25287a));_0x2db147(_0x25287a);})[_0x456a('0x1f')](function(_0x1b9af6){logger[_0x456a('0x14')]('GetChatQueue',_0x1b9af6[_0x456a('0x15')],_0x5aff8b);_0x1378ae(_0x202877[_0x456a('0x14')](0x1f4,_0x1b9af6[_0x456a('0x15')]));});});};exports['ShowChatQueue']=function(_0x1ef547){var _0x6d6e3c=this;return new Promise(function(_0x40445d,_0x21f232){return db['ChatQueue'][_0x456a('0x20')]({'raw':_0x1ef547[_0x456a('0x18')]?_0x1ef547[_0x456a('0x18')][_0x456a('0x21')]===undefined?!![]:![]:!![],'where':_0x1ef547['options']?_0x1ef547[_0x456a('0x18')]['where']||null:null,'attributes':_0x1ef547[_0x456a('0x18')]?_0x1ef547[_0x456a('0x18')][_0x456a('0x1d')]||null:null,'include':_0x1ef547['options']?_0x1ef547['options'][_0x456a('0x1b')]?_[_0x456a('0x1a')](_0x1ef547['options']['include'],function(_0x3c308b){return{'model':db[_0x3c308b['model']],'as':_0x3c308b['as'],'attributes':_0x3c308b[_0x456a('0x1d')],'include':_0x3c308b['include']?_[_0x456a('0x1a')](_0x3c308b[_0x456a('0x1b')],function(_0x1b234d){return{'model':db[_0x1b234d[_0x456a('0x1c')]],'as':_0x1b234d['as'],'attributes':_0x1b234d[_0x456a('0x1d')],'include':_0x1b234d[_0x456a('0x1b')]?_[_0x456a('0x1a')](_0x1b234d[_0x456a('0x1b')],function(_0x307440){return{'model':db[_0x307440['model']],'as':_0x307440['as'],'attributes':_0x307440['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5886ed){logger['info'](_0x456a('0x22'),_0x1ef547);logger[_0x456a('0x11')](_0x456a('0x22'),_0x1ef547,JSON[_0x456a('0x13')](_0x5886ed));_0x40445d(_0x5886ed);})[_0x456a('0x1f')](function(_0x2a8527){logger[_0x456a('0x14')](_0x456a('0x22'),_0x2a8527['message'],_0x1ef547);_0x21f232(_0x6d6e3c[_0x456a('0x14')](0x1f4,_0x2a8527[_0x456a('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 8a974ee..53fa1d5 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 _0x2123=['./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3d117d,_0x2aeca4){var _0x123029=function(_0xc93527){while(--_0xc93527){_0x3d117d['push'](_0x3d117d['shift']());}};_0x123029(++_0x2aeca4);}(_0x2123,0x190));var _0x3212=function(_0x49b4bb,_0x527d37){_0x49b4bb=_0x49b4bb-0x0;var _0x522ba3=_0x2123[_0x49b4bb];return _0x522ba3;};'use strict';var ChatQueueEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatQueueEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatQueue:'+_0x4b35e9,_0x5d9d36);ChatQueueEvents['on'](_0x4b35e9,_0x3e17a3);}};
\ No newline at end of file
+var _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0xc095d6,_0x1cd2ed){var _0x230abe=function(_0x33e8d0){while(--_0x33e8d0){_0xc095d6['push'](_0xc095d6['shift']());}};_0x230abe(++_0x1cd2ed);}(_0x5089,0x1bb));var _0x9508=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0x5089[_0x15cbce];return _0x257f29;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 94ac1df..49aa78d 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0xbf230e,_0x5eed50){_0xbf230e=_0xbf230e-0x0;var _0x2ab844=_0x3e74[_0xbf230e];return _0x2ab844;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x227dd9,_0x53f317){var _0x1e18dd=function(_0x38a46e){while(--_0x38a46e){_0x227dd9['push'](_0x227dd9['shift']());}};_0x1e18dd(++_0x53f317);}(_0x55ca,0x126));var _0xa55c=function(_0x437560,_0xc5d67f){_0x437560=_0x437560-0x0;var _0x278361=_0x55ca[_0x437560];return _0x278361;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e9a1f97..afa653d 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 _0x0a25=['DATE','moment','sequelize','exports','STRING'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x0a25,0x15f));var _0x50a2=function(_0xb30a60,_0x19580f){_0xb30a60=_0xb30a60-0x0;var _0x381a7b=_0x0a25[_0xb30a60];return _0x381a7b;};'use strict';var moment=require(_0x50a2('0x0'));var Sequelize=require(_0x50a2('0x1'));module[_0x50a2('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x50a2('0x3')]},'joinAt':{'type':Sequelize[_0x50a2('0x4')]},'leaveAt':{'type':Sequelize[_0x50a2('0x4')]},'acceptAt':{'type':Sequelize[_0x50a2('0x4')]},'exitAt':{'type':Sequelize[_0x50a2('0x4')]},'reason':{'type':Sequelize[_0x50a2('0x3')]}};
\ No newline at end of file
+var _0x00fc=['exports','STRING','DATE','moment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x00fc,0x143));var _0xc00f=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x00fc[_0x3e5086];return _0xfeb102;};'use strict';var moment=require(_0xc00f('0x0'));var Sequelize=require('sequelize');module[_0xc00f('0x1')]={'uniqueid':{'type':Sequelize[_0xc00f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc00f('0x2')]},'joinAt':{'type':Sequelize[_0xc00f('0x3')]},'leaveAt':{'type':Sequelize[_0xc00f('0x3')]},'acceptAt':{'type':Sequelize[_0xc00f('0x3')]},'exitAt':{'type':Sequelize[_0xc00f('0x3')]},'reason':{'type':Sequelize[_0xc00f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index f0968b2..2238ef8 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 _0x21cd=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','ChatQueueReport','findAll','rows','show','params','rawAttributes','include','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys'];(function(_0x444a7d,_0x5620ea){var _0x54e7f2=function(_0xddffca){while(--_0xddffca){_0x444a7d['push'](_0x444a7d['shift']());}};_0x54e7f2(++_0x5620ea);}(_0x21cd,0x6a));var _0xd21c=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x21cd[_0x20589d];return _0x422de9;};'use strict';var emlformat=require(_0xd21c('0x0'));var rimraf=require(_0xd21c('0x1'));var zipdir=require(_0xd21c('0x2'));var jsonpatch=require(_0xd21c('0x3'));var rp=require(_0xd21c('0x4'));var moment=require(_0xd21c('0x5'));var BPromise=require(_0xd21c('0x6'));var Mustache=require(_0xd21c('0x7'));var util=require(_0xd21c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd21c('0x9'));var ejs=require(_0xd21c('0xa'));var fs=require('fs');var fs_extra=require(_0xd21c('0xb'));var _=require(_0xd21c('0xc'));var squel=require(_0xd21c('0xd'));var crypto=require('crypto');var jsforce=require(_0xd21c('0xe'));var deskjs=require(_0xd21c('0xf'));var toCsv=require(_0xd21c('0x9'));var querystring=require(_0xd21c('0x10'));var Papa=require(_0xd21c('0x11'));var Redis=require('ioredis');var authService=require(_0xd21c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd21c('0x13'));var hardwareService=require(_0xd21c('0x14'));var logger=require(_0xd21c('0x15'))(_0xd21c('0x16'));var utils=require(_0xd21c('0x17'));var config=require(_0xd21c('0x18'));var licenseUtil=require(_0xd21c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x357c01,_0x620b37){_0x620b37=_0x620b37||0xcc;return function(_0x2da30c){if(_0x2da30c){return _0x357c01[_0xd21c('0x1a')](_0x620b37);}return _0x357c01[_0xd21c('0x1b')](_0x620b37)[_0xd21c('0x1c')]();};}function respondWithResult(_0x14d82e,_0x2a9362){_0x2a9362=_0x2a9362||0xc8;return function(_0x206aff){if(_0x206aff){return _0x14d82e[_0xd21c('0x1b')](_0x2a9362)[_0xd21c('0x1d')](_0x206aff);}};}function respondWithFilteredResult(_0xaecd8f,_0x5dcc9e){return function(_0x9f8774){if(_0x9f8774){var _0x2066bb=typeof _0x5dcc9e[_0xd21c('0x1e')]===_0xd21c('0x1f')&&typeof _0x5dcc9e[_0xd21c('0x20')]==='undefined';var _0x1df93f=_0x9f8774[_0xd21c('0x21')];var _0x1f60d1=_0x2066bb?0x0:_0x5dcc9e['offset'];var _0x9c294c=_0x2066bb?_0x9f8774[_0xd21c('0x21')]:_0x5dcc9e['offset']+_0x5dcc9e[_0xd21c('0x20')];var _0xa96896;if(_0x9c294c>=_0x1df93f){_0x9c294c=_0x1df93f;_0xa96896=0xc8;}else{_0xa96896=0xce;}_0xaecd8f['status'](_0xa96896);return _0xaecd8f[_0xd21c('0x22')]('Content-Range',_0x1f60d1+'-'+_0x9c294c+'/'+_0x1df93f)[_0xd21c('0x1d')](_0x9f8774);}return null;};}function patchUpdates(_0x21a175){return function(_0x1f00db){try{jsonpatch[_0xd21c('0x23')](_0x1f00db,_0x21a175,!![]);}catch(_0x52665c){return BPromise[_0xd21c('0x24')](_0x52665c);}return _0x1f00db['save']();};}function saveUpdates(_0x5cad51,_0x26e381){return function(_0x75bd03){if(_0x75bd03){return _0x75bd03[_0xd21c('0x25')](_0x5cad51)[_0xd21c('0x26')](function(_0x29ee5e){return _0x29ee5e;});}return null;};}function removeEntity(_0x1b05fa,_0xa04dd3){return function(_0x399a0a){if(_0x399a0a){return _0x399a0a[_0xd21c('0x27')]()[_0xd21c('0x26')](function(){_0x1b05fa[_0xd21c('0x1b')](0xcc)[_0xd21c('0x1c')]();});}};}function handleEntityNotFound(_0x537ca9,_0x44086e){return function(_0x5382bf){if(!_0x5382bf){_0x537ca9[_0xd21c('0x1a')](0x194);}return _0x5382bf;};}function handleError(_0x492cf7,_0xd95c7f){_0xd95c7f=_0xd95c7f||0x1f4;return function(_0x37d2ad){logger[_0xd21c('0x28')](_0x37d2ad[_0xd21c('0x29')]);if(_0x37d2ad[_0xd21c('0x2a')]){delete _0x37d2ad[_0xd21c('0x2a')];}_0x492cf7[_0xd21c('0x1b')](_0xd95c7f)[_0xd21c('0x2b')](_0x37d2ad);};}exports[_0xd21c('0x2c')]=function(_0x14cc32,_0x4e861b){var _0x416cca={},_0x2c09b3={},_0x5c0e39={'count':0x0,'rows':[]};var _0x9eff15=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x2a45c0){return{'name':_0x2a45c0[_0xd21c('0x2d')],'type':_0x2a45c0[_0xd21c('0x2e')][_0xd21c('0x2f')]};});_0x2c09b3[_0xd21c('0x30')]=_[_0xd21c('0x31')](_0x9eff15,'name');_0x2c09b3[_0xd21c('0x32')]=_[_0xd21c('0x33')](_0x14cc32[_0xd21c('0x32')]);_0x2c09b3[_0xd21c('0x34')]=_[_0xd21c('0x35')](_0x2c09b3['model'],_0x2c09b3[_0xd21c('0x32')]);_0x416cca[_0xd21c('0x36')]=_['intersection'](_0x2c09b3['model'],qs[_0xd21c('0x37')](_0x14cc32['query'][_0xd21c('0x37')]));_0x416cca[_0xd21c('0x36')]=_0x416cca['attributes'][_0xd21c('0x38')]?_0x416cca['attributes']:_0x2c09b3[_0xd21c('0x30')];if(!_0x14cc32['query'][_0xd21c('0x39')](_0xd21c('0x3a'))){_0x416cca[_0xd21c('0x20')]=qs[_0xd21c('0x20')](_0x14cc32[_0xd21c('0x32')][_0xd21c('0x20')]);_0x416cca[_0xd21c('0x1e')]=qs[_0xd21c('0x1e')](_0x14cc32[_0xd21c('0x32')][_0xd21c('0x1e')]);}_0x416cca[_0xd21c('0x3b')]=qs['sort'](_0x14cc32[_0xd21c('0x32')][_0xd21c('0x3c')]);_0x416cca[_0xd21c('0x3d')]=qs[_0xd21c('0x34')](_[_0xd21c('0x3e')](_0x14cc32[_0xd21c('0x32')],_0x2c09b3[_0xd21c('0x34')]),_0x9eff15);if(_0x14cc32[_0xd21c('0x32')][_0xd21c('0x3f')]){_0x416cca[_0xd21c('0x3d')]=_['merge'](_0x416cca[_0xd21c('0x3d')],{'$or':_[_0xd21c('0x31')](_0x9eff15,function(_0x210e5f){if(_0x210e5f[_0xd21c('0x2e')]!==_0xd21c('0x40')){var _0x4b8ee8={};_0x4b8ee8[_0x210e5f[_0xd21c('0x2a')]]={'$like':'%'+_0x14cc32[_0xd21c('0x32')]['filter']+'%'};return _0x4b8ee8;}})});}_0x416cca=_[_0xd21c('0x41')]({},_0x416cca,_0x14cc32[_0xd21c('0x42')]);var _0x57b4b7={'where':_0x416cca[_0xd21c('0x3d')]};return db[_0xd21c('0x43')][_0xd21c('0x21')](_0x57b4b7)[_0xd21c('0x26')](function(_0x2bffe1){_0x5c0e39[_0xd21c('0x21')]=_0x2bffe1;if(_0x14cc32[_0xd21c('0x32')]['includeAll']){_0x416cca['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xd21c('0x44')](_0x416cca);})[_0xd21c('0x26')](function(_0x26432f){_0x5c0e39[_0xd21c('0x45')]=_0x26432f;return _0x5c0e39;})[_0xd21c('0x26')](respondWithFilteredResult(_0x4e861b,_0x416cca))['catch'](handleError(_0x4e861b,null));};exports[_0xd21c('0x46')]=function(_0x37bf8e,_0x108ca2){var _0x2e7300={'raw':!![],'where':{'id':_0x37bf8e[_0xd21c('0x47')]['id']}},_0x9ca6f1={};_0x9ca6f1[_0xd21c('0x30')]=_[_0xd21c('0x33')](db['ChatQueueReport'][_0xd21c('0x48')]);_0x9ca6f1[_0xd21c('0x32')]=_[_0xd21c('0x33')](_0x37bf8e['query']);_0x9ca6f1[_0xd21c('0x34')]=_[_0xd21c('0x35')](_0x9ca6f1[_0xd21c('0x30')],_0x9ca6f1[_0xd21c('0x32')]);_0x2e7300['attributes']=_[_0xd21c('0x35')](_0x9ca6f1[_0xd21c('0x30')],qs['fields'](_0x37bf8e[_0xd21c('0x32')][_0xd21c('0x37')]));_0x2e7300[_0xd21c('0x36')]=_0x2e7300['attributes'][_0xd21c('0x38')]?_0x2e7300['attributes']:_0x9ca6f1[_0xd21c('0x30')];if(_0x37bf8e['query']['includeAll']){_0x2e7300[_0xd21c('0x49')]=[{'all':!![]}];}_0x2e7300=_[_0xd21c('0x41')]({},_0x2e7300,_0x37bf8e[_0xd21c('0x42')]);return db[_0xd21c('0x43')][_0xd21c('0x4a')](_0x2e7300)[_0xd21c('0x26')](handleEntityNotFound(_0x108ca2,null))[_0xd21c('0x26')](respondWithResult(_0x108ca2,null))['catch'](handleError(_0x108ca2,null));};exports['create']=function(_0x46bca9,_0x434c61){return db[_0xd21c('0x43')][_0xd21c('0x4b')](_0x46bca9[_0xd21c('0x4c')],{})['then'](respondWithResult(_0x434c61,0xc9))['catch'](handleError(_0x434c61,null));};exports[_0xd21c('0x25')]=function(_0x29c774,_0x572a75){if(_0x29c774[_0xd21c('0x4c')]['id']){delete _0x29c774['body']['id'];}return db['ChatQueueReport'][_0xd21c('0x4a')]({'where':{'id':_0x29c774['params']['id']}})['then'](handleEntityNotFound(_0x572a75,null))[_0xd21c('0x26')](saveUpdates(_0x29c774[_0xd21c('0x4c')],null))[_0xd21c('0x26')](respondWithResult(_0x572a75,null))[_0xd21c('0x4d')](handleError(_0x572a75,null));};exports['destroy']=function(_0x4ec106,_0xc33936){return db['ChatQueueReport'][_0xd21c('0x4a')]({'where':{'id':_0x4ec106[_0xd21c('0x47')]['id']}})[_0xd21c('0x26')](handleEntityNotFound(_0xc33936,null))['then'](removeEntity(_0xc33936,null))[_0xd21c('0x4d')](handleError(_0xc33936,null));};exports[_0xd21c('0x4e')]=function(_0x2f59ce,_0x5c765b){return db['ChatQueueReport'][_0xd21c('0x4e')]()['then'](respondWithResult(_0x5c765b,null))[_0xd21c('0x4d')](handleError(_0x5c765b,null));};
\ No newline at end of file
+var _0x11c1=['body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','create'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0x11c1,0x1cb));var _0x111c=function(_0x2deca1,_0x2f3e4e){_0x2deca1=_0x2deca1-0x0;var _0x35ce36=_0x11c1[_0x2deca1];return _0x35ce36;};'use strict';var emlformat=require(_0x111c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x111c('0x1'));var jsonpatch=require(_0x111c('0x2'));var rp=require(_0x111c('0x3'));var moment=require(_0x111c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x111c('0x5'));var util=require(_0x111c('0x6'));var path=require(_0x111c('0x7'));var sox=require(_0x111c('0x8'));var csv=require(_0x111c('0x9'));var ejs=require(_0x111c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x111c('0xb'));var squel=require(_0x111c('0xc'));var crypto=require(_0x111c('0xd'));var jsforce=require(_0x111c('0xe'));var deskjs=require(_0x111c('0xf'));var toCsv=require(_0x111c('0x9'));var querystring=require(_0x111c('0x10'));var Papa=require(_0x111c('0x11'));var Redis=require(_0x111c('0x12'));var authService=require(_0x111c('0x13'));var qs=require(_0x111c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x111c('0x15'));var config=require(_0x111c('0x16'));var licenseUtil=require(_0x111c('0x17'));var db=require(_0x111c('0x18'))['db'];function respondWithStatusCode(_0x161df9,_0x18f728){_0x18f728=_0x18f728||0xcc;return function(_0x37deee){if(_0x37deee){return _0x161df9[_0x111c('0x19')](_0x18f728);}return _0x161df9[_0x111c('0x1a')](_0x18f728)[_0x111c('0x1b')]();};}function respondWithResult(_0x1b0dd5,_0x37a4bd){_0x37a4bd=_0x37a4bd||0xc8;return function(_0x3ad856){if(_0x3ad856){return _0x1b0dd5[_0x111c('0x1a')](_0x37a4bd)[_0x111c('0x1c')](_0x3ad856);}};}function respondWithFilteredResult(_0x412f7e,_0x2d2adb){return function(_0x9e7a7c){if(_0x9e7a7c){var _0x3babf6=typeof _0x2d2adb['offset']==='undefined'&&typeof _0x2d2adb['limit']===_0x111c('0x1d');var _0x4bd3d8=_0x9e7a7c['count'];var _0x198249=_0x3babf6?0x0:_0x2d2adb[_0x111c('0x1e')];var _0x2d54e6=_0x3babf6?_0x9e7a7c[_0x111c('0x1f')]:_0x2d2adb[_0x111c('0x1e')]+_0x2d2adb[_0x111c('0x20')];var _0x5b9171;if(_0x2d54e6>=_0x4bd3d8){_0x2d54e6=_0x4bd3d8;_0x5b9171=0xc8;}else{_0x5b9171=0xce;}_0x412f7e[_0x111c('0x1a')](_0x5b9171);return _0x412f7e[_0x111c('0x21')]('Content-Range',_0x198249+'-'+_0x2d54e6+'/'+_0x4bd3d8)[_0x111c('0x1c')](_0x9e7a7c);}return null;};}function patchUpdates(_0x211de8){return function(_0x1df840){try{jsonpatch['apply'](_0x1df840,_0x211de8,!![]);}catch(_0x39ebe3){return BPromise[_0x111c('0x22')](_0x39ebe3);}return _0x1df840[_0x111c('0x23')]();};}function saveUpdates(_0x54a586,_0x31b236){return function(_0x17d02b){if(_0x17d02b){return _0x17d02b[_0x111c('0x24')](_0x54a586)[_0x111c('0x25')](function(_0x2c4c6b){return _0x2c4c6b;});}return null;};}function removeEntity(_0x3da021,_0xe5b252){return function(_0x3694b5){if(_0x3694b5){return _0x3694b5[_0x111c('0x26')]()['then'](function(){_0x3da021[_0x111c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26b3b8,_0x2576b8){return function(_0x5764b9){if(!_0x5764b9){_0x26b3b8[_0x111c('0x19')](0x194);}return _0x5764b9;};}function handleError(_0x17a9cd,_0x55e7d0){_0x55e7d0=_0x55e7d0||0x1f4;return function(_0x33040d){logger[_0x111c('0x27')](_0x33040d[_0x111c('0x28')]);if(_0x33040d[_0x111c('0x29')]){delete _0x33040d[_0x111c('0x29')];}_0x17a9cd[_0x111c('0x1a')](_0x55e7d0)[_0x111c('0x2a')](_0x33040d);};}exports[_0x111c('0x2b')]=function(_0x46e407,_0x70592b){var _0x5e3047={},_0x40d992={},_0x45bd8c={'count':0x0,'rows':[]};var _0x4c9c67=_[_0x111c('0x2c')](db[_0x111c('0x2d')]['rawAttributes'],function(_0x401138){return{'name':_0x401138[_0x111c('0x2e')],'type':_0x401138['type'][_0x111c('0x2f')]};});_0x40d992['model']=_['map'](_0x4c9c67,_0x111c('0x29'));_0x40d992[_0x111c('0x30')]=_[_0x111c('0x31')](_0x46e407[_0x111c('0x30')]);_0x40d992[_0x111c('0x32')]=_[_0x111c('0x33')](_0x40d992[_0x111c('0x34')],_0x40d992[_0x111c('0x30')]);_0x5e3047[_0x111c('0x35')]=_[_0x111c('0x33')](_0x40d992[_0x111c('0x34')],qs[_0x111c('0x36')](_0x46e407[_0x111c('0x30')]['fields']));_0x5e3047[_0x111c('0x35')]=_0x5e3047[_0x111c('0x35')][_0x111c('0x37')]?_0x5e3047['attributes']:_0x40d992[_0x111c('0x34')];if(!_0x46e407[_0x111c('0x30')][_0x111c('0x38')](_0x111c('0x39'))){_0x5e3047[_0x111c('0x20')]=qs[_0x111c('0x20')](_0x46e407[_0x111c('0x30')]['limit']);_0x5e3047[_0x111c('0x1e')]=qs['offset'](_0x46e407[_0x111c('0x30')][_0x111c('0x1e')]);}_0x5e3047[_0x111c('0x3a')]=qs[_0x111c('0x3b')](_0x46e407['query'][_0x111c('0x3b')]);_0x5e3047['where']=qs[_0x111c('0x32')](_['pick'](_0x46e407[_0x111c('0x30')],_0x40d992[_0x111c('0x32')]),_0x4c9c67);if(_0x46e407[_0x111c('0x30')][_0x111c('0x3c')]){_0x5e3047[_0x111c('0x3d')]=_[_0x111c('0x3e')](_0x5e3047[_0x111c('0x3d')],{'$or':_[_0x111c('0x2c')](_0x4c9c67,function(_0x56fb83){if(_0x56fb83[_0x111c('0x3f')]!==_0x111c('0x40')){var _0x591fe1={};_0x591fe1[_0x56fb83['name']]={'$like':'%'+_0x46e407[_0x111c('0x30')]['filter']+'%'};return _0x591fe1;}})});}_0x5e3047=_['merge']({},_0x5e3047,_0x46e407[_0x111c('0x41')]);var _0x5ffb09={'where':_0x5e3047[_0x111c('0x3d')]};return db[_0x111c('0x2d')][_0x111c('0x1f')](_0x5ffb09)[_0x111c('0x25')](function(_0x167b00){_0x45bd8c[_0x111c('0x1f')]=_0x167b00;if(_0x46e407[_0x111c('0x30')]['includeAll']){_0x5e3047[_0x111c('0x42')]=[{'all':!![]}];}return db[_0x111c('0x2d')][_0x111c('0x43')](_0x5e3047);})['then'](function(_0x354dca){_0x45bd8c['rows']=_0x354dca;return _0x45bd8c;})['then'](respondWithFilteredResult(_0x70592b,_0x5e3047))[_0x111c('0x44')](handleError(_0x70592b,null));};exports[_0x111c('0x45')]=function(_0x10f4f7,_0x22e95b){var _0x38d7a0={'raw':!![],'where':{'id':_0x10f4f7[_0x111c('0x46')]['id']}},_0x1b4e4f={};_0x1b4e4f[_0x111c('0x34')]=_['keys'](db[_0x111c('0x2d')]['rawAttributes']);_0x1b4e4f[_0x111c('0x30')]=_[_0x111c('0x31')](_0x10f4f7[_0x111c('0x30')]);_0x1b4e4f[_0x111c('0x32')]=_[_0x111c('0x33')](_0x1b4e4f['model'],_0x1b4e4f['query']);_0x38d7a0[_0x111c('0x35')]=_[_0x111c('0x33')](_0x1b4e4f[_0x111c('0x34')],qs['fields'](_0x10f4f7['query']['fields']));_0x38d7a0['attributes']=_0x38d7a0[_0x111c('0x35')]['length']?_0x38d7a0['attributes']:_0x1b4e4f['model'];if(_0x10f4f7[_0x111c('0x30')][_0x111c('0x47')]){_0x38d7a0['include']=[{'all':!![]}];}_0x38d7a0=_['merge']({},_0x38d7a0,_0x10f4f7['options']);return db[_0x111c('0x2d')]['find'](_0x38d7a0)[_0x111c('0x25')](handleEntityNotFound(_0x22e95b,null))[_0x111c('0x25')](respondWithResult(_0x22e95b,null))[_0x111c('0x44')](handleError(_0x22e95b,null));};exports[_0x111c('0x48')]=function(_0x2849b6,_0x137ee5){return db['ChatQueueReport'][_0x111c('0x48')](_0x2849b6[_0x111c('0x49')],{})['then'](respondWithResult(_0x137ee5,0xc9))[_0x111c('0x44')](handleError(_0x137ee5,null));};exports[_0x111c('0x24')]=function(_0x8cad9c,_0x24731d){if(_0x8cad9c[_0x111c('0x49')]['id']){delete _0x8cad9c[_0x111c('0x49')]['id'];}return db[_0x111c('0x2d')][_0x111c('0x4a')]({'where':{'id':_0x8cad9c[_0x111c('0x46')]['id']}})[_0x111c('0x25')](handleEntityNotFound(_0x24731d,null))['then'](saveUpdates(_0x8cad9c['body'],null))[_0x111c('0x25')](respondWithResult(_0x24731d,null))[_0x111c('0x44')](handleError(_0x24731d,null));};exports[_0x111c('0x26')]=function(_0x4288ab,_0x584c6f){return db['ChatQueueReport'][_0x111c('0x4a')]({'where':{'id':_0x4288ab[_0x111c('0x46')]['id']}})[_0x111c('0x25')](handleEntityNotFound(_0x584c6f,null))[_0x111c('0x25')](removeEntity(_0x584c6f,null))['catch'](handleError(_0x584c6f,null));};exports[_0x111c('0x4b')]=function(_0x288c34,_0x107c61){return db[_0x111c('0x2d')]['describe']()[_0x111c('0x25')](respondWithResult(_0x107c61,null))[_0x111c('0x44')](handleError(_0x107c61,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 19169f5..6b6f85e 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(_0x557e47,_0x3cf865){var _0x14d4f0=function(_0x2ebdb4){while(--_0x2ebdb4){_0x557e47['push'](_0x557e47['shift']());}};_0x14d4f0(++_0x3cf865);}(_0x757a,0xde));var _0xa757=function(_0x2531ff,_0x352b1c){_0x2531ff=_0x2531ff-0x0;var _0x57167e=_0x757a[_0x2531ff];return _0x57167e;};'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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x516c9b,_0x32dd27){var _0x4adea3=function(_0x4e9167){while(--_0x4e9167){_0x516c9b['push'](_0x516c9b['shift']());}};_0x4adea3(++_0x32dd27);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb7e7[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index f3b3c8c..be771f3 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 _0x86bb=['request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x86bb,0xfb));var _0xb86b=function(_0x588370,_0x4563b9){_0x588370=_0x588370-0x0;var _0x1b0dc1=_0x86bb[_0x588370];return _0x1b0dc1;};'use strict';var _=require('lodash');var util=require(_0xb86b('0x0'));var moment=require(_0xb86b('0x1'));var BPromise=require(_0xb86b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb86b('0x3'));var db=require(_0xb86b('0x4'))['db'];var utils=require(_0xb86b('0x5'));var logger=require(_0xb86b('0x6'))(_0xb86b('0x7'));var config=require('../../config/environment');var jayson=require(_0xb86b('0x8'));var client=jayson[_0xb86b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b1c4b,_0x3be905,_0x4d11a0){return new BPromise(function(_0x32a8a0,_0x5f398a){return client['request'](_0x2b1c4b,_0x4d11a0)[_0xb86b('0xa')](function(_0x5ab8b5){logger[_0xb86b('0xb')](_0xb86b('0xc'),_0x3be905,_0xb86b('0xd'));logger[_0xb86b('0xe')](_0xb86b('0xf'),_0x3be905,_0xb86b('0xd'),JSON[_0xb86b('0x10')](_0x5ab8b5));if(_0x5ab8b5['error']){if(_0x5ab8b5[_0xb86b('0x11')][_0xb86b('0x12')]===0x1f4){logger[_0xb86b('0x11')](_0xb86b('0xc'),_0x3be905,_0x5ab8b5[_0xb86b('0x11')]['message']);return _0x5f398a(_0x5ab8b5[_0xb86b('0x11')][_0xb86b('0x13')]);}logger[_0xb86b('0x11')](_0xb86b('0xc'),_0x3be905,_0x5ab8b5[_0xb86b('0x11')][_0xb86b('0x13')]);return _0x32a8a0(_0x5ab8b5[_0xb86b('0x11')]['message']);}else{logger['info'](_0xb86b('0xc'),_0x3be905,_0xb86b('0xd'));_0x32a8a0(_0x5ab8b5[_0xb86b('0x14')]['message']);}})[_0xb86b('0x15')](function(_0x54fc8c){logger[_0xb86b('0x11')](_0xb86b('0xc'),_0x3be905,_0x54fc8c);_0x5f398a(_0x54fc8c);});});}exports[_0xb86b('0x16')]=function(_0x16abc9){var _0x33163d=this;return new Promise(function(_0xf9cab6,_0x3d158a){return db[_0xb86b('0x17')][_0xb86b('0x18')](_0x16abc9[_0xb86b('0x19')],{'raw':_0x16abc9[_0xb86b('0x1a')]?_0x16abc9[_0xb86b('0x1a')][_0xb86b('0x1b')]===undefined?!![]:![]:!![]})[_0xb86b('0xa')](function(_0x1d3a95){logger[_0xb86b('0xb')](_0xb86b('0x16'),_0x16abc9);logger[_0xb86b('0xe')](_0xb86b('0x16'),_0x16abc9,JSON[_0xb86b('0x10')](_0x1d3a95));_0xf9cab6(_0x1d3a95);})[_0xb86b('0x15')](function(_0x128414){logger[_0xb86b('0x11')](_0xb86b('0x16'),_0x128414[_0xb86b('0x13')],_0x16abc9);_0x3d158a(_0x33163d['error'](0x1f4,_0x128414[_0xb86b('0x13')]));});});};exports[_0xb86b('0x1c')]=function(_0x4e66d4){var _0xdeb0dc=this;return new Promise(function(_0x3f5ce4,_0x2cab87){return db[_0xb86b('0x17')][_0xb86b('0x1d')](_0x4e66d4[_0xb86b('0x19')],{'raw':_0x4e66d4[_0xb86b('0x1a')]?_0x4e66d4['options'][_0xb86b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e66d4['options']?_0x4e66d4['options'][_0xb86b('0x1e')]||null:null,'attributes':_0x4e66d4[_0xb86b('0x1a')]?_0x4e66d4[_0xb86b('0x1a')][_0xb86b('0x1f')]||null:null,'limit':_0x4e66d4[_0xb86b('0x1a')]?_0x4e66d4[_0xb86b('0x1a')][_0xb86b('0x20')]||null:null})[_0xb86b('0xa')](function(_0x30e685){logger[_0xb86b('0xb')](_0xb86b('0x1c'),_0x4e66d4);logger['debug'](_0xb86b('0x1c'),_0x4e66d4,JSON[_0xb86b('0x10')](_0x30e685));_0x3f5ce4(_0x30e685);})[_0xb86b('0x15')](function(_0x32eb4d){logger[_0xb86b('0x11')](_0xb86b('0x1c'),_0x32eb4d[_0xb86b('0x13')],_0x4e66d4);_0x2cab87(_0xdeb0dc[_0xb86b('0x11')](0x1f4,_0x32eb4d['message']));});});};
\ No newline at end of file
+var _0x5b9e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','catch','where','UpdateChatQueueReport','lodash','util','moment'];(function(_0x26c8d6,_0x480d94){var _0x590fbd=function(_0x503b87){while(--_0x503b87){_0x26c8d6['push'](_0x26c8d6['shift']());}};_0x590fbd(++_0x480d94);}(_0x5b9e,0xe4));var _0xe5b9=function(_0x46b449,_0x37b7fa){_0x46b449=_0x46b449-0x0;var _0x486d66=_0x5b9e[_0x46b449];return _0x486d66;};'use strict';var _=require(_0xe5b9('0x0'));var util=require(_0xe5b9('0x1'));var moment=require(_0xe5b9('0x2'));var BPromise=require(_0xe5b9('0x3'));var rs=require(_0xe5b9('0x4'));var fs=require('fs');var Redis=require(_0xe5b9('0x5'));var db=require(_0xe5b9('0x6'))['db'];var utils=require(_0xe5b9('0x7'));var logger=require(_0xe5b9('0x8'))('rpc');var config=require(_0xe5b9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe5b9('0xa')][_0xe5b9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x464d91,_0x1a5498,_0x139c45){return new BPromise(function(_0x3f3b90,_0x2167c7){return client[_0xe5b9('0xc')](_0x464d91,_0x139c45)[_0xe5b9('0xd')](function(_0x10c91a){logger['info'](_0xe5b9('0xe'),_0x1a5498,_0xe5b9('0xf'));logger['debug'](_0xe5b9('0x10'),_0x1a5498,_0xe5b9('0xf'),JSON[_0xe5b9('0x11')](_0x10c91a));if(_0x10c91a[_0xe5b9('0x12')]){if(_0x10c91a[_0xe5b9('0x12')][_0xe5b9('0x13')]===0x1f4){logger['error'](_0xe5b9('0xe'),_0x1a5498,_0x10c91a['error'][_0xe5b9('0x14')]);return _0x2167c7(_0x10c91a[_0xe5b9('0x12')][_0xe5b9('0x14')]);}logger[_0xe5b9('0x12')](_0xe5b9('0xe'),_0x1a5498,_0x10c91a[_0xe5b9('0x12')][_0xe5b9('0x14')]);return _0x3f3b90(_0x10c91a[_0xe5b9('0x12')][_0xe5b9('0x14')]);}else{logger[_0xe5b9('0x15')](_0xe5b9('0xe'),_0x1a5498,_0xe5b9('0xf'));_0x3f3b90(_0x10c91a[_0xe5b9('0x16')][_0xe5b9('0x14')]);}})['catch'](function(_0x2f1239){logger[_0xe5b9('0x12')](_0xe5b9('0xe'),_0x1a5498,_0x2f1239);_0x2167c7(_0x2f1239);});});}exports[_0xe5b9('0x17')]=function(_0x421407){var _0x4ad623=this;return new Promise(function(_0x5477b8,_0x27eea6){return db[_0xe5b9('0x18')][_0xe5b9('0x19')](_0x421407[_0xe5b9('0x1a')],{'raw':_0x421407[_0xe5b9('0x1b')]?_0x421407[_0xe5b9('0x1b')][_0xe5b9('0x1c')]===undefined?!![]:![]:!![]})[_0xe5b9('0xd')](function(_0x10c9d1){logger[_0xe5b9('0x15')](_0xe5b9('0x17'),_0x421407);logger[_0xe5b9('0x1d')](_0xe5b9('0x17'),_0x421407,JSON[_0xe5b9('0x11')](_0x10c9d1));_0x5477b8(_0x10c9d1);})[_0xe5b9('0x1e')](function(_0x4760ce){logger[_0xe5b9('0x12')]('CreateChatQueueReport',_0x4760ce[_0xe5b9('0x14')],_0x421407);_0x27eea6(_0x4ad623[_0xe5b9('0x12')](0x1f4,_0x4760ce[_0xe5b9('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x3b628e){var _0x2cf33b=this;return new Promise(function(_0x46583b,_0x5bd531){return db[_0xe5b9('0x18')]['update'](_0x3b628e['body'],{'raw':_0x3b628e[_0xe5b9('0x1b')]?_0x3b628e[_0xe5b9('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b628e['options']?_0x3b628e[_0xe5b9('0x1b')][_0xe5b9('0x1f')]||null:null,'attributes':_0x3b628e[_0xe5b9('0x1b')]?_0x3b628e[_0xe5b9('0x1b')]['attributes']||null:null,'limit':_0x3b628e[_0xe5b9('0x1b')]?_0x3b628e[_0xe5b9('0x1b')]['limit']||null:null})[_0xe5b9('0xd')](function(_0x5bb79e){logger[_0xe5b9('0x15')](_0xe5b9('0x20'),_0x3b628e);logger[_0xe5b9('0x1d')](_0xe5b9('0x20'),_0x3b628e,JSON[_0xe5b9('0x11')](_0x5bb79e));_0x46583b(_0x5bb79e);})[_0xe5b9('0x1e')](function(_0x1bc4c6){logger[_0xe5b9('0x12')](_0xe5b9('0x20'),_0x1bc4c6[_0xe5b9('0x14')],_0x3b628e);_0x5bd531(_0x2cf33b[_0xe5b9('0x12')](0x1f4,_0x1bc4c6[_0xe5b9('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 4e1bfc8..3ae6358 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 _0x5d60=['create','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x5d60,0x1ba));var _0x05d6=function(_0x169a65,_0x2c8a7a){_0x169a65=_0x169a65-0x0;var _0xde27c9=_0x5d60[_0x169a65];return _0xde27c9;};'use strict';var multer=require('multer');var util=require(_0x05d6('0x0'));var path=require('path');var timeout=require(_0x05d6('0x1'));var express=require('express');var router=express[_0x05d6('0x2')]();var fs_extra=require(_0x05d6('0x3'));var auth=require(_0x05d6('0x4'));var interaction=require(_0x05d6('0x5'));var config=require('../../config/environment');var controller=require(_0x05d6('0x6'));router[_0x05d6('0x7')]('/',auth[_0x05d6('0x8')](),controller['index']);router['get'](_0x05d6('0x9'),auth['isAuthenticated'](),controller[_0x05d6('0xa')]);router[_0x05d6('0x7')](_0x05d6('0xb'),auth[_0x05d6('0x8')](),controller[_0x05d6('0xc')]);router[_0x05d6('0xd')]('/',auth[_0x05d6('0x8')](),controller[_0x05d6('0xe')]);router['put']('/:id',auth[_0x05d6('0x8')](),controller[_0x05d6('0xf')]);router[_0x05d6('0x10')](_0x05d6('0xb'),auth['isAuthenticated'](),controller[_0x05d6('0x11')]);module[_0x05d6('0x12')]=router;
\ No newline at end of file
+var _0x503a=['post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2f92e7,_0x572d0b){var _0x554de2=function(_0x1f33c4){while(--_0x1f33c4){_0x2f92e7['push'](_0x2f92e7['shift']());}};_0x554de2(++_0x572d0b);}(_0x503a,0xd6));var _0xa503=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x503a[_0x44b3bd];return _0x1efc4a;};'use strict';var multer=require(_0xa503('0x0'));var util=require(_0xa503('0x1'));var path=require(_0xa503('0x2'));var timeout=require(_0xa503('0x3'));var express=require(_0xa503('0x4'));var router=express[_0xa503('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa503('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa503('0x7'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xa503('0x8')](),controller[_0xa503('0x9')]);router['get'](_0xa503('0xa'),auth[_0xa503('0x8')](),controller[_0xa503('0xb')]);router['get'](_0xa503('0xc'),auth[_0xa503('0x8')](),controller[_0xa503('0xd')]);router[_0xa503('0xe')]('/',auth[_0xa503('0x8')](),controller[_0xa503('0xf')]);router[_0xa503('0x10')](_0xa503('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa503('0xc'),auth[_0xa503('0x8')](),controller[_0xa503('0x11')]);module[_0xa503('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 9abbd83..64f0d7b 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5850e0,_0x2c3e9a){var _0x3d0697=function(_0xfef92){while(--_0xfef92){_0x5850e0['push'](_0x5850e0['shift']());}};_0x3d0697(++_0x2c3e9a);}(_0x008c,0x188));var _0xc008=function(_0x4631eb,_0x55649e){_0x4631eb=_0x4631eb-0x0;var _0x562eca=_0x008c[_0x4631eb];return _0x562eca;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x20b1ca,_0xcaa99b){var _0x13a457=function(_0x49b381){while(--_0x49b381){_0x20b1ca['push'](_0x20b1ca['shift']());}};_0x13a457(++_0xcaa99b);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 2e3e0c4..bc378fe 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 _0x2ff8=['order','sort','where','filters','pick','merge','type','filter','options','ChatTransferReport','rows','catch','show','fields','length','includeAll','include','create','body','find','params','describe','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','hasOwnProperty','nolimit'];(function(_0x46e3ff,_0x50ca39){var _0x4bf847=function(_0x3fa9b9){while(--_0x3fa9b9){_0x46e3ff['push'](_0x46e3ff['shift']());}};_0x4bf847(++_0x50ca39);}(_0x2ff8,0xa4));var _0x82ff=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x2ff8[_0xa6cc5c];return _0x44803d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82ff('0x0'));var zipdir=require(_0x82ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82ff('0x2'));var moment=require(_0x82ff('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x82ff('0x4'));var sox=require(_0x82ff('0x5'));var csv=require(_0x82ff('0x6'));var ejs=require(_0x82ff('0x7'));var fs=require('fs');var fs_extra=require(_0x82ff('0x8'));var _=require(_0x82ff('0x9'));var squel=require(_0x82ff('0xa'));var crypto=require('crypto');var jsforce=require(_0x82ff('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x82ff('0x6'));var querystring=require(_0x82ff('0xc'));var Papa=require(_0x82ff('0xd'));var Redis=require(_0x82ff('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x82ff('0xf'));var hardwareService=require(_0x82ff('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82ff('0x11'));var config=require(_0x82ff('0x12'));var licenseUtil=require(_0x82ff('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x228b0e,_0x2ced18){_0x2ced18=_0x2ced18||0xcc;return function(_0x1d15e9){if(_0x1d15e9){return _0x228b0e[_0x82ff('0x14')](_0x2ced18);}return _0x228b0e[_0x82ff('0x15')](_0x2ced18)[_0x82ff('0x16')]();};}function respondWithResult(_0x23c524,_0x5446bb){_0x5446bb=_0x5446bb||0xc8;return function(_0xc3411a){if(_0xc3411a){return _0x23c524[_0x82ff('0x15')](_0x5446bb)[_0x82ff('0x17')](_0xc3411a);}};}function respondWithFilteredResult(_0x1fb8df,_0x253d48){return function(_0xc6b0db){if(_0xc6b0db){var _0x4a1e57=typeof _0x253d48['offset']===_0x82ff('0x18')&&typeof _0x253d48[_0x82ff('0x19')]===_0x82ff('0x18');var _0x9bb9c=_0xc6b0db[_0x82ff('0x1a')];var _0x42eb82=_0x4a1e57?0x0:_0x253d48[_0x82ff('0x1b')];var _0x3c19f5=_0x4a1e57?_0xc6b0db['count']:_0x253d48[_0x82ff('0x1b')]+_0x253d48[_0x82ff('0x19')];var _0x36d2e1;if(_0x3c19f5>=_0x9bb9c){_0x3c19f5=_0x9bb9c;_0x36d2e1=0xc8;}else{_0x36d2e1=0xce;}_0x1fb8df['status'](_0x36d2e1);return _0x1fb8df['set']('Content-Range',_0x42eb82+'-'+_0x3c19f5+'/'+_0x9bb9c)[_0x82ff('0x17')](_0xc6b0db);}return null;};}function patchUpdates(_0x10fb2a){return function(_0x5e52f6){try{jsonpatch['apply'](_0x5e52f6,_0x10fb2a,!![]);}catch(_0x3d0550){return BPromise[_0x82ff('0x1c')](_0x3d0550);}return _0x5e52f6[_0x82ff('0x1d')]();};}function saveUpdates(_0x2af402,_0xc3e3a8){return function(_0x3c3388){if(_0x3c3388){return _0x3c3388[_0x82ff('0x1e')](_0x2af402)[_0x82ff('0x1f')](function(_0x54c9eb){return _0x54c9eb;});}return null;};}function removeEntity(_0x1fa70c,_0x332991){return function(_0x26fb94){if(_0x26fb94){return _0x26fb94[_0x82ff('0x20')]()[_0x82ff('0x1f')](function(){_0x1fa70c['status'](0xcc)[_0x82ff('0x16')]();});}};}function handleEntityNotFound(_0x556610,_0x8487f0){return function(_0x48cfb9){if(!_0x48cfb9){_0x556610[_0x82ff('0x14')](0x194);}return _0x48cfb9;};}function handleError(_0x450490,_0x5d7241){_0x5d7241=_0x5d7241||0x1f4;return function(_0x76cb1f){logger[_0x82ff('0x21')](_0x76cb1f[_0x82ff('0x22')]);if(_0x76cb1f[_0x82ff('0x23')]){delete _0x76cb1f[_0x82ff('0x23')];}_0x450490[_0x82ff('0x15')](_0x5d7241)[_0x82ff('0x24')](_0x76cb1f);};}exports[_0x82ff('0x25')]=function(_0x9bb8ed,_0x2f459f){var _0x4c38cb={},_0x291ed2={},_0x5c3875={'count':0x0,'rows':[]};var _0x3b28a7=_[_0x82ff('0x26')](db['ChatTransferReport'][_0x82ff('0x27')],function(_0x269abe){return{'name':_0x269abe[_0x82ff('0x28')],'type':_0x269abe['type'][_0x82ff('0x29')]};});_0x291ed2['model']=_['map'](_0x3b28a7,_0x82ff('0x23'));_0x291ed2['query']=_[_0x82ff('0x2a')](_0x9bb8ed[_0x82ff('0x2b')]);_0x291ed2['filters']=_[_0x82ff('0x2c')](_0x291ed2[_0x82ff('0x2d')],_0x291ed2['query']);_0x4c38cb[_0x82ff('0x2e')]=_[_0x82ff('0x2c')](_0x291ed2[_0x82ff('0x2d')],qs['fields'](_0x9bb8ed[_0x82ff('0x2b')]['fields']));_0x4c38cb[_0x82ff('0x2e')]=_0x4c38cb[_0x82ff('0x2e')]['length']?_0x4c38cb[_0x82ff('0x2e')]:_0x291ed2[_0x82ff('0x2d')];if(!_0x9bb8ed[_0x82ff('0x2b')][_0x82ff('0x2f')](_0x82ff('0x30'))){_0x4c38cb[_0x82ff('0x19')]=qs[_0x82ff('0x19')](_0x9bb8ed[_0x82ff('0x2b')][_0x82ff('0x19')]);_0x4c38cb[_0x82ff('0x1b')]=qs[_0x82ff('0x1b')](_0x9bb8ed[_0x82ff('0x2b')]['offset']);}_0x4c38cb[_0x82ff('0x31')]=qs[_0x82ff('0x32')](_0x9bb8ed[_0x82ff('0x2b')][_0x82ff('0x32')]);_0x4c38cb[_0x82ff('0x33')]=qs[_0x82ff('0x34')](_[_0x82ff('0x35')](_0x9bb8ed['query'],_0x291ed2[_0x82ff('0x34')]),_0x3b28a7);if(_0x9bb8ed[_0x82ff('0x2b')]['filter']){_0x4c38cb[_0x82ff('0x33')]=_[_0x82ff('0x36')](_0x4c38cb[_0x82ff('0x33')],{'$or':_['map'](_0x3b28a7,function(_0xe721d9){if(_0xe721d9[_0x82ff('0x37')]!=='VIRTUAL'){var _0x3cf9d1={};_0x3cf9d1[_0xe721d9[_0x82ff('0x23')]]={'$like':'%'+_0x9bb8ed[_0x82ff('0x2b')][_0x82ff('0x38')]+'%'};return _0x3cf9d1;}})});}_0x4c38cb=_[_0x82ff('0x36')]({},_0x4c38cb,_0x9bb8ed[_0x82ff('0x39')]);var _0x52b9b9={'where':_0x4c38cb[_0x82ff('0x33')]};return db[_0x82ff('0x3a')][_0x82ff('0x1a')](_0x52b9b9)[_0x82ff('0x1f')](function(_0x3f5082){_0x5c3875[_0x82ff('0x1a')]=_0x3f5082;if(_0x9bb8ed[_0x82ff('0x2b')]['includeAll']){_0x4c38cb['include']=[{'all':!![]}];}return db[_0x82ff('0x3a')]['findAll'](_0x4c38cb);})[_0x82ff('0x1f')](function(_0xfd799f){_0x5c3875[_0x82ff('0x3b')]=_0xfd799f;return _0x5c3875;})[_0x82ff('0x1f')](respondWithFilteredResult(_0x2f459f,_0x4c38cb))[_0x82ff('0x3c')](handleError(_0x2f459f,null));};exports[_0x82ff('0x3d')]=function(_0x409792,_0x199eeb){var _0x5d8cfa={'raw':!![],'where':{'id':_0x409792['params']['id']}},_0x397c5a={};_0x397c5a[_0x82ff('0x2d')]=_[_0x82ff('0x2a')](db[_0x82ff('0x3a')][_0x82ff('0x27')]);_0x397c5a[_0x82ff('0x2b')]=_[_0x82ff('0x2a')](_0x409792['query']);_0x397c5a[_0x82ff('0x34')]=_['intersection'](_0x397c5a[_0x82ff('0x2d')],_0x397c5a['query']);_0x5d8cfa[_0x82ff('0x2e')]=_[_0x82ff('0x2c')](_0x397c5a['model'],qs[_0x82ff('0x3e')](_0x409792[_0x82ff('0x2b')]['fields']));_0x5d8cfa[_0x82ff('0x2e')]=_0x5d8cfa[_0x82ff('0x2e')][_0x82ff('0x3f')]?_0x5d8cfa[_0x82ff('0x2e')]:_0x397c5a[_0x82ff('0x2d')];if(_0x409792[_0x82ff('0x2b')][_0x82ff('0x40')]){_0x5d8cfa[_0x82ff('0x41')]=[{'all':!![]}];}_0x5d8cfa=_[_0x82ff('0x36')]({},_0x5d8cfa,_0x409792[_0x82ff('0x39')]);return db[_0x82ff('0x3a')]['find'](_0x5d8cfa)['then'](handleEntityNotFound(_0x199eeb,null))[_0x82ff('0x1f')](respondWithResult(_0x199eeb,null))[_0x82ff('0x3c')](handleError(_0x199eeb,null));};exports[_0x82ff('0x42')]=function(_0x56a47f,_0x260d95){return db[_0x82ff('0x3a')]['create'](_0x56a47f['body'],{})[_0x82ff('0x1f')](respondWithResult(_0x260d95,0xc9))[_0x82ff('0x3c')](handleError(_0x260d95,null));};exports[_0x82ff('0x1e')]=function(_0xe4f8ed,_0x5c6292){if(_0xe4f8ed[_0x82ff('0x43')]['id']){delete _0xe4f8ed[_0x82ff('0x43')]['id'];}return db[_0x82ff('0x3a')][_0x82ff('0x44')]({'where':{'id':_0xe4f8ed[_0x82ff('0x45')]['id']}})[_0x82ff('0x1f')](handleEntityNotFound(_0x5c6292,null))[_0x82ff('0x1f')](saveUpdates(_0xe4f8ed[_0x82ff('0x43')],null))['then'](respondWithResult(_0x5c6292,null))[_0x82ff('0x3c')](handleError(_0x5c6292,null));};exports[_0x82ff('0x20')]=function(_0x4acb08,_0x455863){return db['ChatTransferReport'][_0x82ff('0x44')]({'where':{'id':_0x4acb08['params']['id']}})[_0x82ff('0x1f')](handleEntityNotFound(_0x455863,null))[_0x82ff('0x1f')](removeEntity(_0x455863,null))[_0x82ff('0x3c')](handleError(_0x455863,null));};exports['describe']=function(_0x240280,_0x411975){return db[_0x82ff('0x3a')][_0x82ff('0x46')]()[_0x82ff('0x1f')](respondWithResult(_0x411975,null))[_0x82ff('0x3c')](handleError(_0x411975,null));};
\ No newline at end of file
+var _0x7af3=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','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'];(function(_0x557b44,_0x12aba8){var _0x311a77=function(_0x329c2d){while(--_0x329c2d){_0x557b44['push'](_0x557b44['shift']());}};_0x311a77(++_0x12aba8);}(_0x7af3,0x1c0));var _0x37af=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x7af3[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37af('0x0'));var zipdir=require(_0x37af('0x1'));var jsonpatch=require(_0x37af('0x2'));var rp=require('request-promise');var moment=require(_0x37af('0x3'));var BPromise=require(_0x37af('0x4'));var Mustache=require(_0x37af('0x5'));var util=require(_0x37af('0x6'));var path=require(_0x37af('0x7'));var sox=require('sox');var csv=require(_0x37af('0x8'));var ejs=require(_0x37af('0x9'));var fs=require('fs');var fs_extra=require(_0x37af('0xa'));var _=require('lodash');var squel=require(_0x37af('0xb'));var crypto=require(_0x37af('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x37af('0xd'));var toCsv=require(_0x37af('0x8'));var querystring=require('querystring');var Papa=require(_0x37af('0xe'));var Redis=require('ioredis');var authService=require(_0x37af('0xf'));var qs=require(_0x37af('0x10'));var as=require(_0x37af('0x11'));var hardwareService=require(_0x37af('0x12'));var logger=require(_0x37af('0x13'))(_0x37af('0x14'));var utils=require(_0x37af('0x15'));var config=require(_0x37af('0x16'));var licenseUtil=require(_0x37af('0x17'));var db=require(_0x37af('0x18'))['db'];function respondWithStatusCode(_0x53f45c,_0x2b6f3c){_0x2b6f3c=_0x2b6f3c||0xcc;return function(_0x3f3e87){if(_0x3f3e87){return _0x53f45c[_0x37af('0x19')](_0x2b6f3c);}return _0x53f45c[_0x37af('0x1a')](_0x2b6f3c)['end']();};}function respondWithResult(_0x551323,_0x4894d4){_0x4894d4=_0x4894d4||0xc8;return function(_0x338ca9){if(_0x338ca9){return _0x551323[_0x37af('0x1a')](_0x4894d4)[_0x37af('0x1b')](_0x338ca9);}};}function respondWithFilteredResult(_0x13bd26,_0x387c68){return function(_0x1c195d){if(_0x1c195d){var _0x2523f0=typeof _0x387c68[_0x37af('0x1c')]==='undefined'&&typeof _0x387c68['limit']===_0x37af('0x1d');var _0x988316=_0x1c195d[_0x37af('0x1e')];var _0x3ec1d0=_0x2523f0?0x0:_0x387c68['offset'];var _0x54573f=_0x2523f0?_0x1c195d[_0x37af('0x1e')]:_0x387c68[_0x37af('0x1c')]+_0x387c68[_0x37af('0x1f')];var _0x4b4a45;if(_0x54573f>=_0x988316){_0x54573f=_0x988316;_0x4b4a45=0xc8;}else{_0x4b4a45=0xce;}_0x13bd26['status'](_0x4b4a45);return _0x13bd26[_0x37af('0x20')](_0x37af('0x21'),_0x3ec1d0+'-'+_0x54573f+'/'+_0x988316)[_0x37af('0x1b')](_0x1c195d);}return null;};}function patchUpdates(_0x54e430){return function(_0xdf9df6){try{jsonpatch[_0x37af('0x22')](_0xdf9df6,_0x54e430,!![]);}catch(_0x3c9d4c){return BPromise[_0x37af('0x23')](_0x3c9d4c);}return _0xdf9df6[_0x37af('0x24')]();};}function saveUpdates(_0x2548c0,_0x42a952){return function(_0x4b1517){if(_0x4b1517){return _0x4b1517[_0x37af('0x25')](_0x2548c0)[_0x37af('0x26')](function(_0x1bdb64){return _0x1bdb64;});}return null;};}function removeEntity(_0x40c1b0,_0x492a9e){return function(_0x111419){if(_0x111419){return _0x111419['destroy']()['then'](function(){_0x40c1b0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x116e8a,_0x1cf5bf){return function(_0x4b4aa6){if(!_0x4b4aa6){_0x116e8a[_0x37af('0x19')](0x194);}return _0x4b4aa6;};}function handleError(_0x2f5dcb,_0x4b69e4){_0x4b69e4=_0x4b69e4||0x1f4;return function(_0x4a9c36){logger['error'](_0x4a9c36[_0x37af('0x27')]);if(_0x4a9c36[_0x37af('0x28')]){delete _0x4a9c36['name'];}_0x2f5dcb['status'](_0x4b69e4)[_0x37af('0x29')](_0x4a9c36);};}exports[_0x37af('0x2a')]=function(_0x5a3529,_0x498d96){var _0xa3fa70={},_0x495ac2={},_0x48fbab={'count':0x0,'rows':[]};var _0x414eca=_['map'](db[_0x37af('0x2b')][_0x37af('0x2c')],function(_0x3884ef){return{'name':_0x3884ef[_0x37af('0x2d')],'type':_0x3884ef[_0x37af('0x2e')][_0x37af('0x2f')]};});_0x495ac2[_0x37af('0x30')]=_[_0x37af('0x31')](_0x414eca,_0x37af('0x28'));_0x495ac2[_0x37af('0x32')]=_[_0x37af('0x33')](_0x5a3529[_0x37af('0x32')]);_0x495ac2[_0x37af('0x34')]=_[_0x37af('0x35')](_0x495ac2[_0x37af('0x30')],_0x495ac2[_0x37af('0x32')]);_0xa3fa70['attributes']=_[_0x37af('0x35')](_0x495ac2[_0x37af('0x30')],qs[_0x37af('0x36')](_0x5a3529[_0x37af('0x32')][_0x37af('0x36')]));_0xa3fa70['attributes']=_0xa3fa70[_0x37af('0x37')]['length']?_0xa3fa70[_0x37af('0x37')]:_0x495ac2[_0x37af('0x30')];if(!_0x5a3529[_0x37af('0x32')][_0x37af('0x38')](_0x37af('0x39'))){_0xa3fa70[_0x37af('0x1f')]=qs[_0x37af('0x1f')](_0x5a3529[_0x37af('0x32')][_0x37af('0x1f')]);_0xa3fa70[_0x37af('0x1c')]=qs[_0x37af('0x1c')](_0x5a3529[_0x37af('0x32')]['offset']);}_0xa3fa70[_0x37af('0x3a')]=qs[_0x37af('0x3b')](_0x5a3529[_0x37af('0x32')][_0x37af('0x3b')]);_0xa3fa70[_0x37af('0x3c')]=qs[_0x37af('0x34')](_[_0x37af('0x3d')](_0x5a3529[_0x37af('0x32')],_0x495ac2['filters']),_0x414eca);if(_0x5a3529[_0x37af('0x32')][_0x37af('0x3e')]){_0xa3fa70[_0x37af('0x3c')]=_[_0x37af('0x3f')](_0xa3fa70['where'],{'$or':_[_0x37af('0x31')](_0x414eca,function(_0x5f019c){if(_0x5f019c['type']!==_0x37af('0x40')){var _0xf88016={};_0xf88016[_0x5f019c[_0x37af('0x28')]]={'$like':'%'+_0x5a3529[_0x37af('0x32')][_0x37af('0x3e')]+'%'};return _0xf88016;}})});}_0xa3fa70=_[_0x37af('0x3f')]({},_0xa3fa70,_0x5a3529[_0x37af('0x41')]);var _0x44180d={'where':_0xa3fa70[_0x37af('0x3c')]};return db[_0x37af('0x2b')][_0x37af('0x1e')](_0x44180d)['then'](function(_0x112c6b){_0x48fbab[_0x37af('0x1e')]=_0x112c6b;if(_0x5a3529['query'][_0x37af('0x42')]){_0xa3fa70[_0x37af('0x43')]=[{'all':!![]}];}return db[_0x37af('0x2b')][_0x37af('0x44')](_0xa3fa70);})[_0x37af('0x26')](function(_0x3b3ad7){_0x48fbab[_0x37af('0x45')]=_0x3b3ad7;return _0x48fbab;})['then'](respondWithFilteredResult(_0x498d96,_0xa3fa70))[_0x37af('0x46')](handleError(_0x498d96,null));};exports[_0x37af('0x47')]=function(_0x564ddc,_0x4d051d){var _0x507dba={'raw':!![],'where':{'id':_0x564ddc[_0x37af('0x48')]['id']}},_0x35caea={};_0x35caea[_0x37af('0x30')]=_['keys'](db[_0x37af('0x2b')][_0x37af('0x2c')]);_0x35caea[_0x37af('0x32')]=_[_0x37af('0x33')](_0x564ddc[_0x37af('0x32')]);_0x35caea[_0x37af('0x34')]=_['intersection'](_0x35caea[_0x37af('0x30')],_0x35caea['query']);_0x507dba['attributes']=_[_0x37af('0x35')](_0x35caea[_0x37af('0x30')],qs[_0x37af('0x36')](_0x564ddc[_0x37af('0x32')]['fields']));_0x507dba[_0x37af('0x37')]=_0x507dba[_0x37af('0x37')][_0x37af('0x49')]?_0x507dba[_0x37af('0x37')]:_0x35caea[_0x37af('0x30')];if(_0x564ddc[_0x37af('0x32')]['includeAll']){_0x507dba[_0x37af('0x43')]=[{'all':!![]}];}_0x507dba=_['merge']({},_0x507dba,_0x564ddc[_0x37af('0x41')]);return db[_0x37af('0x2b')]['find'](_0x507dba)[_0x37af('0x26')](handleEntityNotFound(_0x4d051d,null))['then'](respondWithResult(_0x4d051d,null))[_0x37af('0x46')](handleError(_0x4d051d,null));};exports[_0x37af('0x4a')]=function(_0x229107,_0x55d359){return db[_0x37af('0x2b')]['create'](_0x229107[_0x37af('0x4b')],{})[_0x37af('0x26')](respondWithResult(_0x55d359,0xc9))[_0x37af('0x46')](handleError(_0x55d359,null));};exports[_0x37af('0x25')]=function(_0x45306e,_0x5a913f){if(_0x45306e[_0x37af('0x4b')]['id']){delete _0x45306e[_0x37af('0x4b')]['id'];}return db['ChatTransferReport'][_0x37af('0x4c')]({'where':{'id':_0x45306e[_0x37af('0x48')]['id']}})[_0x37af('0x26')](handleEntityNotFound(_0x5a913f,null))[_0x37af('0x26')](saveUpdates(_0x45306e[_0x37af('0x4b')],null))[_0x37af('0x26')](respondWithResult(_0x5a913f,null))[_0x37af('0x46')](handleError(_0x5a913f,null));};exports[_0x37af('0x4d')]=function(_0x5df5ef,_0x85c0e){return db['ChatTransferReport'][_0x37af('0x4c')]({'where':{'id':_0x5df5ef[_0x37af('0x48')]['id']}})['then'](handleEntityNotFound(_0x85c0e,null))[_0x37af('0x26')](removeEntity(_0x85c0e,null))[_0x37af('0x46')](handleError(_0x85c0e,null));};exports[_0x37af('0x4e')]=function(_0x768acc,_0x3de6b2){return db[_0x37af('0x2b')][_0x37af('0x4e')]()[_0x37af('0x26')](respondWithResult(_0x3de6b2,null))[_0x37af('0x46')](handleError(_0x3de6b2,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 4a98b4f..a7d98c0 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 _0x173f=['request-promise','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','lodash','util','api','moment','bluebird'];(function(_0xbbf92e,_0x4d5070){var _0x50bf0d=function(_0x3438df){while(--_0x3438df){_0xbbf92e['push'](_0xbbf92e['shift']());}};_0x50bf0d(++_0x4d5070);}(_0x173f,0x133));var _0xf173=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x173f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf173('0x0'));var util=require(_0xf173('0x1'));var logger=require('../../config/logger')(_0xf173('0x2'));var moment=require(_0xf173('0x3'));var BPromise=require(_0xf173('0x4'));var rp=require(_0xf173('0x5'));var fs=require('fs');var path=require(_0xf173('0x6'));var rimraf=require('rimraf');var config=require(_0xf173('0x7'));var attributes=require(_0xf173('0x8'));module['exports']=function(_0x45bbec,_0x4756e6){return _0x45bbec[_0xf173('0x9')](_0xf173('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf173('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9639=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x154b2d,_0x56251f){var _0x334119=function(_0x5919cf){while(--_0x5919cf){_0x154b2d['push'](_0x154b2d['shift']());}};_0x334119(++_0x56251f);}(_0x9639,0x1e9));var _0x9963=function(_0x350119,_0x3db5eb){_0x350119=_0x350119-0x0;var _0x297b6e=_0x9639[_0x350119];return _0x297b6e;};'use strict';var _=require(_0x9963('0x0'));var util=require(_0x9963('0x1'));var logger=require(_0x9963('0x2'))(_0x9963('0x3'));var moment=require(_0x9963('0x4'));var BPromise=require(_0x9963('0x5'));var rp=require(_0x9963('0x6'));var fs=require('fs');var path=require(_0x9963('0x7'));var rimraf=require(_0x9963('0x8'));var config=require(_0x9963('0x9'));var attributes=require(_0x9963('0xa'));module[_0x9963('0xb')]=function(_0x2cd21f,_0x4c7d88){return _0x2cd21f[_0x9963('0xc')](_0x9963('0xd'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9963('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 11b6e73..d4b953c 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 _0x2cea=['ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x2cea,0xa9));var _0xa2ce=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0x2cea[_0x40e854];return _0x1463b3;};'use strict';var _=require('lodash');var util=require(_0xa2ce('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa2ce('0x1'));var fs=require('fs');var Redis=require(_0xa2ce('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2ce('0x3'));var logger=require(_0xa2ce('0x4'))('rpc');var config=require(_0xa2ce('0x5'));var jayson=require(_0xa2ce('0x6'));var client=jayson[_0xa2ce('0x7')][_0xa2ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x176ab6,_0xf418f3,_0x443170){return new BPromise(function(_0x2dcaa1,_0x310cab){return client[_0xa2ce('0x9')](_0x176ab6,_0x443170)[_0xa2ce('0xa')](function(_0x12ba50){logger['info'](_0xa2ce('0xb'),_0xf418f3,'request\x20sent');logger['debug'](_0xa2ce('0xc'),_0xf418f3,_0xa2ce('0xd'),JSON[_0xa2ce('0xe')](_0x12ba50));if(_0x12ba50[_0xa2ce('0xf')]){if(_0x12ba50[_0xa2ce('0xf')][_0xa2ce('0x10')]===0x1f4){logger[_0xa2ce('0xf')](_0xa2ce('0xb'),_0xf418f3,_0x12ba50[_0xa2ce('0xf')]['message']);return _0x310cab(_0x12ba50[_0xa2ce('0xf')][_0xa2ce('0x11')]);}logger[_0xa2ce('0xf')](_0xa2ce('0xb'),_0xf418f3,_0x12ba50['error'][_0xa2ce('0x11')]);return _0x2dcaa1(_0x12ba50['error'][_0xa2ce('0x11')]);}else{logger[_0xa2ce('0x12')](_0xa2ce('0xb'),_0xf418f3,_0xa2ce('0xd'));_0x2dcaa1(_0x12ba50[_0xa2ce('0x13')][_0xa2ce('0x11')]);}})['catch'](function(_0xbc043a){logger[_0xa2ce('0xf')](_0xa2ce('0xb'),_0xf418f3,_0xbc043a);_0x310cab(_0xbc043a);});});}
\ No newline at end of file
+var _0x5b1d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','catch','lodash'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0x5b1d,0x1e3));var _0xd5b1=function(_0x1a9a5a,_0x47409e){_0x1a9a5a=_0x1a9a5a-0x0;var _0x4efa84=_0x5b1d[_0x1a9a5a];return _0x4efa84;};'use strict';var _=require(_0xd5b1('0x0'));var util=require(_0xd5b1('0x1'));var moment=require(_0xd5b1('0x2'));var BPromise=require(_0xd5b1('0x3'));var rs=require(_0xd5b1('0x4'));var fs=require('fs');var Redis=require(_0xd5b1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5b1('0x6'));var logger=require(_0xd5b1('0x7'))('rpc');var config=require(_0xd5b1('0x8'));var jayson=require(_0xd5b1('0x9'));var client=jayson['client'][_0xd5b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e8db4,_0x121e92,_0x548e08){return new BPromise(function(_0x41ed94,_0x15c457){return client['request'](_0x3e8db4,_0x548e08)[_0xd5b1('0xb')](function(_0xac6441){logger[_0xd5b1('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x121e92,'request\x20sent');logger[_0xd5b1('0xd')](_0xd5b1('0xe'),_0x121e92,_0xd5b1('0xf'),JSON[_0xd5b1('0x10')](_0xac6441));if(_0xac6441['error']){if(_0xac6441[_0xd5b1('0x11')][_0xd5b1('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x121e92,_0xac6441[_0xd5b1('0x11')][_0xd5b1('0x13')]);return _0x15c457(_0xac6441['error'][_0xd5b1('0x13')]);}logger['error'](_0xd5b1('0x14'),_0x121e92,_0xac6441[_0xd5b1('0x11')]['message']);return _0x41ed94(_0xac6441[_0xd5b1('0x11')]['message']);}else{logger[_0xd5b1('0xc')](_0xd5b1('0x14'),_0x121e92,_0xd5b1('0xf'));_0x41ed94(_0xac6441['result']['message']);}})[_0xd5b1('0x15')](function(_0x4f008a){logger[_0xd5b1('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x121e92,_0x4f008a);_0x15c457(_0x4f008a);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 6e4fee7..6396bd2 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 _0xcf4c=['show','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x216662,_0x211684){var _0xf6b3e=function(_0x1ee356){while(--_0x1ee356){_0x216662['push'](_0x216662['shift']());}};_0xf6b3e(++_0x211684);}(_0xcf4c,0x13b));var _0xccf4=function(_0x174cfc,_0x2b9617){_0x174cfc=_0x174cfc-0x0;var _0x81b2db=_0xcf4c[_0x174cfc];return _0x81b2db;};'use strict';var multer=require(_0xccf4('0x0'));var util=require(_0xccf4('0x1'));var path=require(_0xccf4('0x2'));var timeout=require(_0xccf4('0x3'));var express=require('express');var router=express[_0xccf4('0x4')]();var fs_extra=require(_0xccf4('0x5'));var auth=require(_0xccf4('0x6'));var interaction=require(_0xccf4('0x7'));var config=require(_0xccf4('0x8'));var controller=require(_0xccf4('0x9'));router[_0xccf4('0xa')]('/',auth[_0xccf4('0xb')](),controller[_0xccf4('0xc')]);router[_0xccf4('0xa')](_0xccf4('0xd'),auth[_0xccf4('0xb')](),controller[_0xccf4('0xe')]);router[_0xccf4('0xa')]('/:id',auth[_0xccf4('0xb')](),controller[_0xccf4('0xf')]);router[_0xccf4('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xccf4('0x11')](_0xccf4('0x12'),auth['isAuthenticated'](),controller[_0xccf4('0x13')]);router['delete'](_0xccf4('0x12'),auth['isAuthenticated'](),controller[_0xccf4('0x14')]);module[_0xccf4('0x15')]=router;
\ No newline at end of file
+var _0xea25=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','util'];(function(_0xd2e2ab,_0x2440cf){var _0x1703a2=function(_0x23deba){while(--_0x23deba){_0xd2e2ab['push'](_0xd2e2ab['shift']());}};_0x1703a2(++_0x2440cf);}(_0xea25,0xc7));var _0x5ea2=function(_0x40bab2,_0x179993){_0x40bab2=_0x40bab2-0x0;var _0x101246=_0xea25[_0x40bab2];return _0x101246;};'use strict';var multer=require('multer');var util=require(_0x5ea2('0x0'));var path=require(_0x5ea2('0x1'));var timeout=require(_0x5ea2('0x2'));var express=require(_0x5ea2('0x3'));var router=express[_0x5ea2('0x4')]();var fs_extra=require(_0x5ea2('0x5'));var auth=require(_0x5ea2('0x6'));var interaction=require(_0x5ea2('0x7'));var config=require('../../config/environment');var controller=require(_0x5ea2('0x8'));router[_0x5ea2('0x9')]('/',auth[_0x5ea2('0xa')](),controller[_0x5ea2('0xb')]);router[_0x5ea2('0x9')](_0x5ea2('0xc'),auth[_0x5ea2('0xa')](),controller[_0x5ea2('0xd')]);router[_0x5ea2('0x9')](_0x5ea2('0xe'),auth['isAuthenticated'](),controller[_0x5ea2('0xf')]);router['post']('/',auth[_0x5ea2('0xa')](),controller['create']);router[_0x5ea2('0x10')](_0x5ea2('0xe'),auth[_0x5ea2('0xa')](),controller[_0x5ea2('0x11')]);router[_0x5ea2('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5ea2('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 7c40263..3fbf244 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 _0x5a73=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Skip','Feedback','star','thumb','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','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}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5a73,0x1f3));var _0x35a7=function(_0x20b555,_0x17905c){_0x20b555=_0x20b555-0x0;var _0x313e74=_0x5a73[_0x20b555];return _0x313e74;};'use strict';var Sequelize=require(_0x35a7('0x0'));var rs=require(_0x35a7('0x1'));module[_0x35a7('0x2')]={'name':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'unique':_0x35a7('0x4')},'description':{'type':Sequelize[_0x35a7('0x3')]},'mapKey':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x5')},'key':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x6')},'customerAlias':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':_0x35a7('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':_0x35a7('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x35a7('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x35a7('0x9')]('rounded','squared'),'defaultValue':_0x35a7('0xa')},'header_online':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0xb')},'start_chat_button':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0xc')},'offline_chat_button':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x35a7('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x13')},'placeholderMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x14')},'closingMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x15')},'conditionAgreement':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x16')},'ratingType':{'type':Sequelize[_0x35a7('0x9')](_0x35a7('0x17'),_0x35a7('0x18')),'defaultValue':_0x35a7('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x35a7('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x35a7('0x19')]({'items':[{'type':_0x35a7('0x1a'),'variable':null,'config':{'placeholder':_0x35a7('0x1b'),'type':_0x35a7('0x1c'),'required':!![]},'props':{'title':_0x35a7('0x1b'),'helpText':''}},{'type':_0x35a7('0x1a'),'props':{'title':_0x35a7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x35a7('0x5'),'type':_0x35a7('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x35a7('0x1d'))?JSON[_0x35a7('0x1e')](this[_0x35a7('0x1f')]('onlineForm')):{};},'set':function(_0x19ebc4){return this[_0x35a7('0x20')]('onlineForm',JSON[_0x35a7('0x19')](_0x19ebc4));}},'offlineForm':{'type':Sequelize[_0x35a7('0x11')],'defaultValue':function(){return JSON[_0x35a7('0x19')]({'items':[{'type':'input','props':{'title':_0x35a7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x35a7('0x5'),'type':_0x35a7('0x5')},'variable':null},{'type':_0x35a7('0x21'),'config':{'placeholder':_0x35a7('0x22')},'props':{'title':'Comments','helpText':_0x35a7('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x35a7('0x1f')](_0x35a7('0x24'))?JSON[_0x35a7('0x1e')](this['getDataValue'](_0x35a7('0x24'))):{};},'set':function(_0x1a57b5){return this[_0x35a7('0x20')](_0x35a7('0x24'),JSON['stringify'](_0x1a57b5));}},'token':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x35a7('0x3')]},'forwardOffline':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x35a7('0x3')]},'waitingTitle':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x27')},'offlineMessageBody':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x29')},'skipUnmanaged':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x35a7('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x35a7('0x11')],'defaultValue':function(){return _0x35a7('0x2a');}},'notificationSound':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x35a7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x35a7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x2c')},'verticalAlignment':{'type':Sequelize[_0x35a7('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x35a7('0x3')],'defaultValue':_0x35a7('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x35a7('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x35a7('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':_0x35a7('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x35a7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x35a7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x35a7('0x30')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35a7('0x8')],'comment':_0x35a7('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![],'comment':_0x35a7('0x32'),'set':function(_0x504c67){if(!_0x504c67)this[_0x35a7('0x20')](_0x35a7('0x33'),null);this[_0x35a7('0x20')](_0x35a7('0x34'),_0x504c67);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x35a7('0x3')]},'vidaooTopic':{'type':Sequelize[_0x35a7('0x3')],'allowNull':![],'defaultValue':_0x35a7('0x35')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x35a7('0x36');}},'vidaooMetadata':{'type':Sequelize[_0x35a7('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x35a7('0x10')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xd5c3=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','website_alias','bottom_right','CHAT','alternate','#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','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','TEXT','input','name','text','onlineForm','parse','getDataValue','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x37cd83,_0x5563b6){var _0x5cd952=function(_0x1ad615){while(--_0x1ad615){_0x37cd83['push'](_0x37cd83['shift']());}};_0x5cd952(++_0x5563b6);}(_0xd5c3,0xa7));var _0x3d5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5c3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3d5c('0x0'));var rs=require(_0x3d5c('0x1'));module['exports']={'name':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3d5c('0x3')},'description':{'type':Sequelize[_0x3d5c('0x2')]},'mapKey':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x5')},'customerAlias':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3d5c('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![],'defaultValue':_0x3d5c('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3d5c('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3d5c('0x2')]},'animation':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3d5c('0xa')](_0x3d5c('0xb'),_0x3d5c('0xc')),'defaultValue':_0x3d5c('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0xd')},'offline_chat_button':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0xf')},'download_transcript':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3d5c('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x12')},'noteTitle':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x13')},'closingMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x14')},'closingMessageButton':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0xe')},'skipMessageButton':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x15')},'ratingType':{'type':Sequelize[_0x3d5c('0xa')](_0x3d5c('0x16'),'thumb'),'defaultValue':_0x3d5c('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3d5c('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3d5c('0x18'),'variable':null,'config':{'placeholder':_0x3d5c('0x19'),'type':_0x3d5c('0x1a'),'required':!![]},'props':{'title':_0x3d5c('0x19'),'helpText':''}},{'type':_0x3d5c('0x18'),'props':{'title':_0x3d5c('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3d5c('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x3d5c('0x1b'))?JSON[_0x3d5c('0x1c')](this[_0x3d5c('0x1d')](_0x3d5c('0x1b'))):{};},'set':function(_0x51428f){return this[_0x3d5c('0x1e')]('onlineForm',JSON['stringify'](_0x51428f));}},'offlineForm':{'type':Sequelize[_0x3d5c('0x17')],'defaultValue':function(){return JSON[_0x3d5c('0x1f')]({'items':[{'type':_0x3d5c('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3d5c('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x3d5c('0x20')},'props':{'title':'Comments','helpText':_0x3d5c('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x3d5c('0x1d')](_0x3d5c('0x22'))?JSON['parse'](this[_0x3d5c('0x1d')](_0x3d5c('0x22'))):{};},'set':function(_0x55a3cb){return this[_0x3d5c('0x1e')]('offlineForm',JSON[_0x3d5c('0x1f')](_0x55a3cb));}},'token':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':function(){return rs[_0x3d5c('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3d5c('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x24')},'waitingMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x28')},'sendUnmanaged':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3d5c('0x17')]},'showAgentAvatar':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3d5c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3d5c('0x17')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3d5c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3d5c('0x2b')},'messagesAlignment':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':_0x3d5c('0x2c')},'defaultTitle':{'type':Sequelize[_0x3d5c('0x2')]},'customerAvatar':{'type':Sequelize[_0x3d5c('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3d5c('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3d5c('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3d5c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3d5c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x3d5c('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3d5c('0x8')],'comment':_0x3d5c('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![],'comment':_0x3d5c('0x2f'),'set':function(_0x36d1a3){if(!_0x36d1a3)this['setDataValue'](_0x3d5c('0x30'),null);this['setDataValue']('mandatoryDisposition',_0x36d1a3);}},'vidaooEscalation':{'type':Sequelize[_0x3d5c('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3d5c('0x2')]},'vidaooTopic':{'type':Sequelize[_0x3d5c('0x2')],'allowNull':![],'defaultValue':_0x3d5c('0x31')},'vidaooNote':{'type':Sequelize[_0x3d5c('0x2')],'defaultValue':function(){return _0x3d5c('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x3d5c('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3d5c('0x9')],'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 9174e2b..b9ed79d 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 _0x8f18=['Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','asc','list','List','contact','headers','threadId','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','ChatInteraction','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','CloudProvider','Smtp','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','originalname','subjectOffline','toPairsIn','mapValues','email','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','ifTime','server/files/chat/iframe.ejs','origin','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','../../errors/api','APIBadRequestError','APINotFoundError','handleError','APIConflictError','url','URL','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','then','request\x20sent','debug','error','code','ChatWebsite,\x20%s,\x20%s','message','info','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','UserProfileResource','sendStatus','stack','name','setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','type','stringify','index','Pause','mandatoryDispositionPause','map','ChatWebsite','key','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','show','params','rawAttributes','length','find','create','testWildcardValidity','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','getDispositions','findOne','Disposition','options','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','pick','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','notify','from','From\x20is\x20mandatory','mapKey','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','updatedAt','createdAt','CompanyId','ListId','includes','Contacts','DESC','ChatApplication','Applications','Intervals','interval'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x8f18,0x1bf));var _0x88f1=function(_0x396b7d,_0x2470d2){_0x396b7d=_0x396b7d-0x0;var _0x339b7e=_0x8f18[_0x396b7d];return _0x339b7e;};'use strict';var Mustache=require('mustache');var util=require('util');var path=require(_0x88f1('0x0'));var ejs=require(_0x88f1('0x1'));var fs=require('fs');var fs_extra=require(_0x88f1('0x2'));var _=require(_0x88f1('0x3'));var querystring=require(_0x88f1('0x4'));var htmlToText=require('html-to-text');var Redis=require(_0x88f1('0x5'));var jayson=require(_0x88f1('0x6'));var qs=require(_0x88f1('0x7'));var logger=require('../../config/logger')(_0x88f1('0x8'));var config=require('../../config/environment');var APIBadRequestError=require(_0x88f1('0x9'))[_0x88f1('0xa')];var APINotFoundError=require(_0x88f1('0x9'))[_0x88f1('0xb')];var APIOutOfIntervalError=require(_0x88f1('0x9'))['APIOutOfIntervalError'];var APIHandleError=require(_0x88f1('0x9'))[_0x88f1('0xc')];var APIConflictError=require('../../errors/api')[_0x88f1('0xd')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x88f1('0xe'))[_0x88f1('0xf')];var db=require(_0x88f1('0x10'))['db'];config['redis']=_[_0x88f1('0x11')](config[_0x88f1('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x88f1('0x13'))(new Redis(config[_0x88f1('0x12')]));require(_0x88f1('0x14'))[_0x88f1('0x15')](socket);var client=jayson[_0x88f1('0x16')][_0x88f1('0x17')]({'port':0x232c});var client9002=jayson[_0x88f1('0x16')][_0x88f1('0x17')]({'port':0x232a});var client9003=jayson[_0x88f1('0x16')]['http']({'port':0x232b});var client9001=jayson['client'][_0x88f1('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x2e4844,_0x4ef270,_0x2a88fa,_0x439503){return new Promise(function(_0x30620b,_0x2585cb){var _0x2b77b1=_0x439503||client;return _0x2b77b1['request'](_0x2e4844,_0x2a88fa)[_0x88f1('0x18')](function(_0x2998e0){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4ef270,_0x88f1('0x19'));logger[_0x88f1('0x1a')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4ef270,_0x88f1('0x19'),JSON['stringify'](_0x2998e0));if(_0x2998e0['error']){if(_0x2998e0[_0x88f1('0x1b')][_0x88f1('0x1c')]===0x1f4){logger[_0x88f1('0x1b')](_0x88f1('0x1d'),_0x4ef270,_0x2998e0[_0x88f1('0x1b')]['message']);return _0x2585cb(_0x2998e0['error'][_0x88f1('0x1e')]);}logger[_0x88f1('0x1b')](_0x88f1('0x1d'),_0x4ef270,_0x2998e0[_0x88f1('0x1b')][_0x88f1('0x1e')]);return _0x30620b(_0x2998e0[_0x88f1('0x1b')][_0x88f1('0x1e')]);}else{logger[_0x88f1('0x1f')](_0x88f1('0x1d'),_0x4ef270,_0x88f1('0x19'));_0x30620b(_0x2998e0['result'][_0x88f1('0x1e')]);}})[_0x88f1('0x20')](function(_0xe39fa2){logger['error'](_0x88f1('0x1d'),_0x4ef270,_0xe39fa2);_0x2585cb(_0xe39fa2);});});}function respondWithStatusCode(_0x108c36,_0x29d8cf){_0x29d8cf=_0x29d8cf||0xcc;return function(_0x410053){if(_0x410053){return _0x108c36['sendStatus'](_0x29d8cf);}return _0x108c36[_0x88f1('0x21')](_0x29d8cf)[_0x88f1('0x22')]();};}function respondWithResult(_0x34c301,_0x4fef23){_0x4fef23=_0x4fef23||0xc8;return function(_0xb57853){if(_0xb57853){return _0x34c301[_0x88f1('0x21')](_0x4fef23)[_0x88f1('0x23')](_0xb57853);}};}function respondWithFilteredResult(_0x4f4588,_0x255164){return function(_0x1becc5){if(_0x1becc5){var _0x4104af=typeof _0x255164['offset']===_0x88f1('0x24')&&typeof _0x255164[_0x88f1('0x25')]===_0x88f1('0x24');var _0x48826f=_0x1becc5['count'];var _0x4a7788=_0x4104af?0x0:_0x255164['offset'];var _0x468e58=_0x4104af?_0x1becc5[_0x88f1('0x26')]:_0x255164[_0x88f1('0x27')]+_0x255164[_0x88f1('0x25')];var _0x508364;if(_0x468e58>=_0x48826f){_0x468e58=_0x48826f;_0x508364=0xc8;}else{_0x508364=0xce;}_0x4f4588[_0x88f1('0x21')](_0x508364);return _0x4f4588[_0x88f1('0x28')](_0x88f1('0x29'),_0x4a7788+'-'+_0x468e58+'/'+_0x48826f)[_0x88f1('0x23')](_0x1becc5);}return null;};}function saveUpdates(_0x201d9c){return function(_0x174095){if(_0x174095){return _0x174095[_0x88f1('0x2a')](_0x201d9c)[_0x88f1('0x18')](function(_0x50d6d3){return _0x50d6d3;});}return null;};}function removeEntity(_0x1da391){return function(_0x518fcd){if(_0x518fcd){return _0x518fcd[_0x88f1('0x2b')]()[_0x88f1('0x18')](function(){var _0x834ffb=_0x518fcd[_0x88f1('0x2c')]({'plain':!![]});var _0x12a486='ChatWebsites';return db[_0x88f1('0x2d')]['destroy']({'where':{'type':_0x12a486,'resourceId':_0x834ffb['id']}})[_0x88f1('0x18')](function(){return _0x518fcd;});})[_0x88f1('0x18')](function(){_0x1da391[_0x88f1('0x21')](0xcc)[_0x88f1('0x22')]();});}};}function handleEntityNotFound(_0x8be1ed){return function(_0x314fda){if(!_0x314fda){_0x8be1ed[_0x88f1('0x2e')](0x194);}return _0x314fda;};}function handleError(_0x37ac45,_0x415c7d){_0x415c7d=_0x415c7d||0x1f4;return function(_0x2204f0){logger[_0x88f1('0x1b')](_0x2204f0[_0x88f1('0x2f')]);if(_0x2204f0[_0x88f1('0x30')]){delete _0x2204f0[_0x88f1('0x30')];}_0x37ac45[_0x88f1('0x21')](_0x415c7d)['send'](_0x2204f0);};}function createInteractionObject(_0x333d20,_0x35f449,_0x2f9756,_0x5e7fbf){var _0x477781=require('user-agent-parser');var _0x15ec85=new _0x477781();var _0x29838a=_0x15ec85[_0x88f1('0x31')](_0x2f9756[_0x88f1('0x32')])[_0x88f1('0x33')]();var _0x437510=_0x35f449[_0x88f1('0x34')];if(_0x2f9756[_0x88f1('0x35')]){_0x437510=_0x2f9756['cf-connecting-ip'];}else if(_0x2f9756['x-forwarded-for']){_0x437510=_[_0x88f1('0x36')](_0x2f9756[_0x88f1('0x37')][_0x88f1('0x38')](','));}return{'ContactId':_0x5e7fbf['id'],'ChatWebsiteId':_0x333d20,'from':(_0x5e7fbf[_0x88f1('0x39')]||'')+'\x20'+(_0x5e7fbf[_0x88f1('0x3a')]||''),'customerIp':_0x437510,'customerPort':_0x2f9756[_0x88f1('0x3b')]?_0x2f9756[_0x88f1('0x3b')]:null,'referer':_0x35f449[_0x88f1('0x3c')],'browserName':_0x29838a['browser'][_0x88f1('0x30')]&&_0x29838a[_0x88f1('0x3d')][_0x88f1('0x3e')]?util[_0x88f1('0x3f')](_0x88f1('0x40'),_0x29838a[_0x88f1('0x3d')][_0x88f1('0x30')],_0x29838a[_0x88f1('0x3d')][_0x88f1('0x3e')]):'unknown','browserVersion':_0x29838a[_0x88f1('0x3d')]['version']||_0x88f1('0x41'),'osName':util[_0x88f1('0x3f')](_0x88f1('0x40'),_0x29838a['os'][_0x88f1('0x30')],_0x29838a['os']['version']),'osVersion':_0x29838a['os'][_0x88f1('0x3e')],'deviceModel':_0x29838a[_0x88f1('0x42')][_0x88f1('0x43')]&&_0x29838a['device'][_0x88f1('0x44')]?util['format']('%s\x20%s\x20%s',_0x29838a[_0x88f1('0x42')][_0x88f1('0x43')],_0x29838a['device'][_0x88f1('0x44')],_0x29838a[_0x88f1('0x42')][_0x88f1('0x45')]):null,'deviceVendor':_0x29838a[_0x88f1('0x42')][_0x88f1('0x44')],'deviceType':_0x29838a[_0x88f1('0x42')]['type'],'formData':JSON[_0x88f1('0x46')](_0x35f449)};}exports[_0x88f1('0x47')]=function(_0xd94f9b,_0x539816){var _0x2603fa={'include':[{'model':db[_0x88f1('0x48')],'as':_0x88f1('0x49')}]},_0x51d0c5={},_0x3919ff={'count':0x0,'rows':[]};var _0x1c6a6a=_[_0x88f1('0x4a')](db[_0x88f1('0x4b')]['rawAttributes'],function(_0x2b4c73){return{'name':_0x2b4c73['fieldName'],'type':_0x2b4c73[_0x88f1('0x45')][_0x88f1('0x4c')]};});_0x51d0c5[_0x88f1('0x43')]=_[_0x88f1('0x4a')](_0x1c6a6a,_0x88f1('0x30'));_0x51d0c5[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0xd94f9b[_0x88f1('0x4d')]);_0x51d0c5[_0x88f1('0x4f')]=_['intersection'](_0x51d0c5[_0x88f1('0x43')],_0x51d0c5['query']);_0x2603fa['attributes']=_[_0x88f1('0x50')](_0x51d0c5[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0xd94f9b[_0x88f1('0x4d')][_0x88f1('0x51')]));_0x2603fa[_0x88f1('0x52')]=_0x2603fa[_0x88f1('0x52')]['length']?_0x2603fa[_0x88f1('0x52')]:_0x51d0c5[_0x88f1('0x43')];if(!_0xd94f9b[_0x88f1('0x4d')]['hasOwnProperty'](_0x88f1('0x53'))){_0x2603fa[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0xd94f9b[_0x88f1('0x4d')]['limit']);_0x2603fa[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0xd94f9b['query'][_0x88f1('0x27')]);}_0x2603fa[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0xd94f9b[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x2603fa[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_['pick'](_0xd94f9b[_0x88f1('0x4d')],_0x51d0c5[_0x88f1('0x4f')]),_0x1c6a6a);if(_0xd94f9b['query']['filter']){_0x2603fa[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x2603fa[_0x88f1('0x56')],{'$or':_['map'](_0x1c6a6a,function(_0x1ae935){if(_0x1ae935[_0x88f1('0x45')]!==_0x88f1('0x58')){var _0x424ed1={};_0x424ed1[_0x1ae935[_0x88f1('0x30')]]={'$like':'%'+_0xd94f9b[_0x88f1('0x4d')][_0x88f1('0x59')]+'%'};return _0x424ed1;}})});}_0x2603fa=_[_0x88f1('0x57')]({},_0x2603fa,_0xd94f9b['options']);var _0x4394e6={'where':_0x2603fa[_0x88f1('0x56')]};return db[_0x88f1('0x4b')][_0x88f1('0x26')](_0x4394e6)[_0x88f1('0x18')](function(_0x324c07){_0x3919ff['count']=_0x324c07;if(_0xd94f9b[_0x88f1('0x4d')][_0x88f1('0x5a')]){_0x2603fa[_0x88f1('0x5b')]=[{'all':!![]}];}return db[_0x88f1('0x4b')]['findAll'](_0x2603fa);})[_0x88f1('0x18')](function(_0x1e924b){_0x3919ff[_0x88f1('0x5c')]=_0x1e924b;return _0x3919ff;})['then'](respondWithFilteredResult(_0x539816,_0x2603fa))['catch'](handleError(_0x539816,null));};exports[_0x88f1('0x5d')]=function(_0x149854,_0x3968ab){var _0x407087={'raw':![],'where':{'id':_0x149854[_0x88f1('0x5e')]['id']},'include':[{'model':db[_0x88f1('0x48')],'as':_0x88f1('0x49')}]},_0x5810ec={};_0x5810ec[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0x4b')][_0x88f1('0x5f')]);_0x5810ec[_0x88f1('0x4d')]=_['keys'](_0x149854[_0x88f1('0x4d')]);_0x5810ec[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x5810ec['model'],_0x5810ec['query']);_0x407087[_0x88f1('0x52')]=_[_0x88f1('0x50')](_0x5810ec[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0x149854['query'][_0x88f1('0x51')]));_0x407087['attributes']=_0x407087[_0x88f1('0x52')][_0x88f1('0x60')]?_0x407087['attributes']:_0x5810ec[_0x88f1('0x43')];if(_0x149854[_0x88f1('0x4d')][_0x88f1('0x5a')]){_0x407087['include']=[{'all':!![]}];}_0x407087=_[_0x88f1('0x57')]({},_0x407087,_0x149854['options']);return db[_0x88f1('0x4b')][_0x88f1('0x61')](_0x407087)[_0x88f1('0x18')](handleEntityNotFound(_0x3968ab,null))[_0x88f1('0x18')](respondWithResult(_0x3968ab,null))[_0x88f1('0x20')](handleError(_0x3968ab,null));};exports[_0x88f1('0x62')]=function(_0x3b43c8,_0x2d0266){if(!wildcardUtils[_0x88f1('0x63')](_0x3b43c8[_0x88f1('0x64')]['address'])){return handleError(_0x2d0266,null)(new APIBadRequestError('\x22'+_0x3b43c8['body'][_0x88f1('0x65')]+_0x88f1('0x66')));}return db[_0x88f1('0x4b')][_0x88f1('0x62')](_0x3b43c8[_0x88f1('0x64')],{})[_0x88f1('0x18')](function(_0x506fc9){var _0x25a516=_0x3b43c8['user'][_0x88f1('0x2c')]({'plain':!![]});if(!_0x25a516)throw new Error(_0x88f1('0x67'));if(_0x25a516[_0x88f1('0x68')]===_0x88f1('0x69')){var _0x41a608=_0x506fc9[_0x88f1('0x2c')]({'plain':!![]});var _0x58eccf='ChatWebsites';return db[_0x88f1('0x6a')][_0x88f1('0x61')]({'where':{'name':_0x58eccf,'userProfileId':_0x25a516[_0x88f1('0x6b')]},'raw':!![]})['then'](function(_0x6e38f4){if(_0x6e38f4&&_0x6e38f4['autoAssociation']===0x0){return db[_0x88f1('0x2d')][_0x88f1('0x62')]({'name':_0x41a608[_0x88f1('0x30')],'resourceId':_0x41a608['id'],'type':_0x6e38f4[_0x88f1('0x30')],'sectionId':_0x6e38f4['id']},{})[_0x88f1('0x18')](function(){return _0x506fc9;});}else{return _0x506fc9;}})[_0x88f1('0x20')](function(_0x42fe43){logger['error'](_0x88f1('0x6c'),_0x42fe43);throw _0x42fe43;});}return _0x506fc9;})[_0x88f1('0x18')](respondWithResult(_0x2d0266,0xc9))[_0x88f1('0x20')](handleError(_0x2d0266,null));};exports['update']=function(_0x3543f9,_0x57f7d9){if(!wildcardUtils[_0x88f1('0x63')](_0x3543f9[_0x88f1('0x64')]['address'])){return handleError(_0x57f7d9,null)(new APIBadRequestError('\x22'+_0x3543f9['body'][_0x88f1('0x65')]+_0x88f1('0x66')));}if(_0x3543f9[_0x88f1('0x64')]['id']){delete _0x3543f9[_0x88f1('0x64')]['id'];}return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x3543f9[_0x88f1('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0x88f1('0x49')}]})[_0x88f1('0x18')](handleEntityNotFound(_0x57f7d9,null))[_0x88f1('0x18')](saveUpdates(_0x3543f9[_0x88f1('0x64')],null))[_0x88f1('0x18')](respondWithResult(_0x57f7d9,null))['catch'](handleError(_0x57f7d9,null));};exports[_0x88f1('0x2b')]=function(_0x368881,_0x52ceed){return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x368881[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x52ceed,null))['then'](removeEntity(_0x52ceed,null))[_0x88f1('0x20')](handleError(_0x52ceed,null));};exports[_0x88f1('0x6d')]=function(_0x490b27,_0x5a637d){return db[_0x88f1('0x4b')][_0x88f1('0x6d')]()[_0x88f1('0x18')](respondWithResult(_0x5a637d,null))[_0x88f1('0x20')](handleError(_0x5a637d,null));};exports['addDisposition']=function(_0x4a0afb,_0x2184ac){if(_0x4a0afb[_0x88f1('0x64')]['id']){delete _0x4a0afb[_0x88f1('0x64')]['id'];}return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x4a0afb[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x2184ac,null))[_0x88f1('0x18')](function(_0x3395fa){if(_0x3395fa){_0x4a0afb[_0x88f1('0x64')][_0x88f1('0x6e')]=_0x3395fa['id'];return db['Disposition']['create'](_0x4a0afb['body']);}})[_0x88f1('0x18')](respondWithResult(_0x2184ac,null))[_0x88f1('0x20')](handleError(_0x2184ac,null));};exports[_0x88f1('0x6f')]=function(_0x4afc43,_0x140495){var _0x3007b5={'raw':![],'where':{}};var _0x12420a={};var _0x171225={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x88f1('0x70')]({'where':{'id':_0x4afc43[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x140495,null))[_0x88f1('0x18')](function(_0x1be68c){if(_0x1be68c){_0x12420a[_0x88f1('0x43')]=_['keys'](db[_0x88f1('0x71')][_0x88f1('0x5f')]);_0x12420a[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x4afc43[_0x88f1('0x4d')]);_0x12420a[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x12420a[_0x88f1('0x43')],_0x12420a[_0x88f1('0x4d')]);_0x3007b5[_0x88f1('0x52')]=_[_0x88f1('0x50')](_0x12420a['model'],qs[_0x88f1('0x51')](_0x4afc43[_0x88f1('0x4d')]['fields']));_0x3007b5[_0x88f1('0x52')]=_0x3007b5['attributes']['length']?_0x3007b5[_0x88f1('0x52')]:_0x12420a[_0x88f1('0x43')];if(!_0x4afc43[_0x88f1('0x4d')]['hasOwnProperty'](_0x88f1('0x53'))){_0x3007b5[_0x88f1('0x25')]=qs['limit'](_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x25')]);_0x3007b5[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x27')]);}_0x3007b5[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x3007b5['where']=qs[_0x88f1('0x4f')](_['pick'](_0x4afc43[_0x88f1('0x4d')],_0x12420a[_0x88f1('0x4f')]));_0x3007b5[_0x88f1('0x56')]['ChatWebsiteId']=_0x1be68c['id'];if(_0x4afc43['query']['filter']){_0x3007b5[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x3007b5[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x3007b5['attributes'],function(_0xee075){var _0x4223f9={};_0x4223f9[_0xee075]={'$like':'%'+_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x59')]+'%'};return _0x4223f9;})});}_0x3007b5=_[_0x88f1('0x57')]({},_0x3007b5,_0x4afc43[_0x88f1('0x72')]);return db[_0x88f1('0x71')][_0x88f1('0x26')]({'where':_0x3007b5[_0x88f1('0x56')]})['then'](function(_0x535a5e){_0x171225[_0x88f1('0x26')]=_0x535a5e;if(_0x4afc43[_0x88f1('0x4d')][_0x88f1('0x5a')]){_0x3007b5[_0x88f1('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0x88f1('0x73')](_0x3007b5);})['then'](function(_0x84e180){_0x171225[_0x88f1('0x5c')]=_0x84e180;return _0x171225;});}})[_0x88f1('0x18')](respondWithFilteredResult(_0x140495,_0x3007b5))[_0x88f1('0x20')](handleError(_0x140495,null));};exports[_0x88f1('0x74')]=function(_0x1ffa9b,_0x14a855){return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x1ffa9b[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x14a855,null))[_0x88f1('0x18')](function(_0x3c83dd){if(_0x3c83dd){return _0x3c83dd[_0x88f1('0x74')](_0x1ffa9b[_0x88f1('0x4d')][_0x88f1('0x75')]);}})[_0x88f1('0x18')](respondWithStatusCode(_0x14a855,null))[_0x88f1('0x20')](handleError(_0x14a855,null));};exports[_0x88f1('0x76')]=function(_0x384341,_0x5e62e6){if(_0x384341[_0x88f1('0x64')]['id']){delete _0x384341[_0x88f1('0x64')]['id'];}return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x384341[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x5e62e6,null))[_0x88f1('0x18')](function(_0x3e37f4){if(_0x3e37f4){_0x384341['body'][_0x88f1('0x6e')]=_0x3e37f4['id'];return db[_0x88f1('0x77')]['create'](_0x384341[_0x88f1('0x64')]);}})[_0x88f1('0x18')](respondWithResult(_0x5e62e6,null))[_0x88f1('0x20')](handleError(_0x5e62e6,null));};exports[_0x88f1('0x78')]=function(_0x416eb5,_0x156105){var _0x4b420c={'raw':![],'where':{}};var _0x83c679={};var _0x3d21ed={'count':0x0,'rows':[]};return db[_0x88f1('0x4b')][_0x88f1('0x70')]({'where':{'id':_0x416eb5[_0x88f1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x156105,null))['then'](function(_0x37fdec){if(_0x37fdec){_0x83c679[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0x77')][_0x88f1('0x5f')]);_0x83c679['query']=_[_0x88f1('0x4e')](_0x416eb5['query']);_0x83c679[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x83c679[_0x88f1('0x43')],_0x83c679[_0x88f1('0x4d')]);_0x4b420c[_0x88f1('0x52')]=_['intersection'](_0x83c679[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0x416eb5[_0x88f1('0x4d')]['fields']));_0x4b420c[_0x88f1('0x52')]=_0x4b420c[_0x88f1('0x52')]['length']?_0x4b420c[_0x88f1('0x52')]:_0x83c679['model'];if(!_0x416eb5[_0x88f1('0x4d')][_0x88f1('0x79')](_0x88f1('0x53'))){_0x4b420c[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0x416eb5[_0x88f1('0x4d')][_0x88f1('0x25')]);_0x4b420c[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0x416eb5[_0x88f1('0x4d')]['offset']);}_0x4b420c[_0x88f1('0x54')]=qs['sort'](_0x416eb5[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x4b420c[_0x88f1('0x56')]=qs['filters'](_[_0x88f1('0x7a')](_0x416eb5[_0x88f1('0x4d')],_0x83c679[_0x88f1('0x4f')]));_0x4b420c['where']['ChatWebsiteId']=_0x37fdec['id'];if(_0x416eb5[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x4b420c[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x4b420c['where'],{'$or':_[_0x88f1('0x4a')](_0x4b420c[_0x88f1('0x52')],function(_0x541045){var _0x39b36d={};_0x39b36d[_0x541045]={'$like':'%'+_0x416eb5['query']['filter']+'%'};return _0x39b36d;})});}_0x4b420c=_['merge']({},_0x4b420c,_0x416eb5[_0x88f1('0x72')]);return db['CannedAnswer'][_0x88f1('0x26')]({'where':_0x4b420c[_0x88f1('0x56')]})[_0x88f1('0x18')](function(_0x208305){_0x3d21ed['count']=_0x208305;if(_0x416eb5[_0x88f1('0x4d')]['includeAll']){_0x4b420c[_0x88f1('0x5b')]=[{'all':!![]}];}return db[_0x88f1('0x77')][_0x88f1('0x73')](_0x4b420c);})[_0x88f1('0x18')](function(_0x59b4cb){_0x3d21ed[_0x88f1('0x5c')]=_0x59b4cb;return _0x3d21ed;});}})[_0x88f1('0x18')](respondWithFilteredResult(_0x156105,_0x4b420c))[_0x88f1('0x20')](handleError(_0x156105,null));};exports[_0x88f1('0x7b')]=function(_0xc23b5f,_0x4c0f24){return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0xc23b5f['params']['id']}})['then'](handleEntityNotFound(_0x4c0f24,null))[_0x88f1('0x18')](function(_0x833c08){if(_0x833c08){return _0x833c08[_0x88f1('0x7b')](_0xc23b5f[_0x88f1('0x4d')]['ids']);}})[_0x88f1('0x18')](respondWithStatusCode(_0x4c0f24,null))[_0x88f1('0x20')](handleError(_0x4c0f24,null));};exports['addLogo']=function(_0x152342,_0x187896){_0x152342[_0x88f1('0x64')][_0x88f1('0x7c')]=_0x152342[_0x88f1('0x7d')][_0x88f1('0x7e')];return db['ChatWebsite'][_0x88f1('0x61')]({'where':{'id':_0x152342[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x187896,null))[_0x88f1('0x18')](saveUpdates(_0x152342['body'],null))[_0x88f1('0x18')](respondWithResult(_0x187896,null))['catch'](handleError(_0x187896,null));};exports[_0x88f1('0x7f')]=function(_0x4c3e68,_0x19fedb){_0x4c3e68[_0x88f1('0x64')][_0x88f1('0x80')]=_0x4c3e68[_0x88f1('0x7d')][_0x88f1('0x7e')];return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x4c3e68['params']['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x19fedb,null))[_0x88f1('0x18')](saveUpdates(_0x4c3e68[_0x88f1('0x64')],null))['then'](respondWithResult(_0x19fedb,null))[_0x88f1('0x20')](handleError(_0x19fedb,null));};exports[_0x88f1('0x81')]=function(_0x216e40,_0x33ebfb){_0x216e40['body'][_0x88f1('0x82')]=_0x216e40[_0x88f1('0x7d')][_0x88f1('0x7e')];return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x216e40['params']['id']}})['then'](handleEntityNotFound(_0x33ebfb,null))[_0x88f1('0x18')](saveUpdates(_0x216e40[_0x88f1('0x64')],null))['then'](respondWithResult(_0x33ebfb,null))[_0x88f1('0x20')](handleError(_0x33ebfb,null));};exports[_0x88f1('0x83')]=function(_0x2d2e63,_0x11fc50){_0x2d2e63[_0x88f1('0x64')][_0x88f1('0x84')]=_0x2d2e63[_0x88f1('0x7d')][_0x88f1('0x7e')];return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x2d2e63[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x11fc50,null))['then'](saveUpdates(_0x2d2e63[_0x88f1('0x64')],null))[_0x88f1('0x18')](respondWithResult(_0x11fc50,null))[_0x88f1('0x20')](handleError(_0x11fc50,null));};exports[_0x88f1('0x85')]=function(_0xc93dc6,_0x38ce71){var _0x51fc75=path[_0x88f1('0x86')](config[_0x88f1('0x87')],_0x88f1('0x88'));var _0x37bcf9={'where':{'id':_0xc93dc6[_0x88f1('0x5e')]['id']},'attributes':['id',_0x88f1('0x7c')],'raw':!![]};var _0x1fc680=![];return require(_0x88f1('0x89'))[_0x88f1('0x8a')]()[_0x88f1('0x18')](function(_0x51bab9){if(_0x51bab9){_0x1fc680=_0x51bab9['custom'];}})[_0x88f1('0x18')](function(){return db['ChatWebsite'][_0x88f1('0x61')](_0x37bcf9);})['then'](handleEntityNotFound(_0x38ce71,null))['then'](function(_0x3ede12){if(_0x3ede12){if(!_[_0x88f1('0x8b')](_0x3ede12[_0x88f1('0x7c')])){if(fs['existsSync'](path[_0x88f1('0x86')](config['root'],_0x88f1('0x8c'),_0x3ede12[_0x88f1('0x7c')]))&&_0x1fc680){_0x51fc75=path[_0x88f1('0x86')](config['root'],_0x88f1('0x8c'),_0x3ede12[_0x88f1('0x7c')]);}}return _0x38ce71[_0x88f1('0x8d')](_0x51fc75);}})[_0x88f1('0x20')](handleError(_0x38ce71,null));};exports['getAvatar']=function(_0xf89d80,_0x88e3f9){var _0x134d80=path[_0x88f1('0x86')](config['root'],_0x88f1('0x8e'));var _0x5bc0a4={'where':{'id':_0xf89d80['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x88f1('0x4b')][_0x88f1('0x61')](_0x5bc0a4)['then'](handleEntityNotFound(_0x88e3f9,null))[_0x88f1('0x18')](function(_0x5c526d){if(_0x5c526d){if(!_[_0x88f1('0x8b')](_0x5c526d[_0x88f1('0x80')])){if(fs[_0x88f1('0x8f')](path[_0x88f1('0x86')](config[_0x88f1('0x87')],'server/files/images/avatars/',_0x5c526d[_0x88f1('0x80')]))){_0x134d80=path['join'](config[_0x88f1('0x87')],_0x88f1('0x90'),_0x5c526d['agentAvatar']);}}return _0x88e3f9[_0x88f1('0x8d')](_0x134d80);}})[_0x88f1('0x20')](handleError(_0x88e3f9,null));};exports[_0x88f1('0x91')]=function(_0x3bb392,_0x51dccd){var _0x3f15db=path['join'](config['root'],_0x88f1('0x92'));var _0x476df9={'where':{'id':_0x3bb392[_0x88f1('0x5e')]['id']},'attributes':['id','customerAvatar',_0x88f1('0x93')],'raw':!![]};return db[_0x88f1('0x4b')]['find'](_0x476df9)[_0x88f1('0x18')](handleEntityNotFound(_0x51dccd,null))[_0x88f1('0x18')](function(_0x52b198){if(_0x52b198){if(!_[_0x88f1('0x8b')](_0x52b198[_0x88f1('0x82')])){if(fs[_0x88f1('0x8f')](path[_0x88f1('0x86')](config[_0x88f1('0x87')],'server/files/images/avatars/',_0x52b198['customerAvatar']))&&_0x52b198[_0x88f1('0x93')]){_0x3f15db=path['join'](config['root'],_0x88f1('0x90'),_0x52b198[_0x88f1('0x82')]);}}return _0x51dccd['download'](_0x3f15db);}})['catch'](handleError(_0x51dccd,null));};exports['getSystemAvatar']=function(_0x4ef1b4,_0x56cfe3){var _0x589f3d=path['join'](config[_0x88f1('0x87')],_0x88f1('0x94'));var _0x7626e7={'where':{'id':_0x4ef1b4[_0x88f1('0x5e')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x88f1('0x4b')][_0x88f1('0x61')](_0x7626e7)[_0x88f1('0x18')](handleEntityNotFound(_0x56cfe3,null))['then'](function(_0x17d603){if(_0x17d603){if(!_['isNil'](_0x17d603[_0x88f1('0x84')])){if(fs['existsSync'](path[_0x88f1('0x86')](config[_0x88f1('0x87')],_0x88f1('0x90'),_0x17d603[_0x88f1('0x84')]))){_0x589f3d=path[_0x88f1('0x86')](config['root'],_0x88f1('0x90'),_0x17d603[_0x88f1('0x84')]);}}return _0x56cfe3['download'](_0x589f3d);}})[_0x88f1('0x20')](handleError(_0x56cfe3,null));};function checkWebsiteInterval(_0x3bbd63){var _0x25bd6a=_0x3bbd63[_0x88f1('0x95')];if(!_0x25bd6a){return Promise[_0x88f1('0x96')](_0x3bbd63);}var _0x126951=_0x3bbd63[_0x88f1('0x97')]||undefined;return _0x25bd6a['ifTime'](_0x126951)['then'](function(_0x54e927){if(!_0x54e927){throw new APIOutOfIntervalError();}return _0x3bbd63;});}exports[_0x88f1('0x98')]=function(_0x5c623c,_0x2f050b){var _0x2c63fe={'body':_0x5c623c[_0x88f1('0x64')],'channel':'chat'};var _0x2d695b=[];var _0x2c2454=[];var _0x37a626={};var _0x11b0b1=![];if(_0x5c623c[_0x88f1('0x64')]['id']){delete _0x5c623c[_0x88f1('0x64')]['id'];}if(_[_0x88f1('0x8b')](_0x5c623c[_0x88f1('0x64')][_0x88f1('0x99')])){throw new APIBadRequestError(_0x88f1('0x9a'));}if(_[_0x88f1('0x8b')](_0x5c623c[_0x88f1('0x64')][_0x88f1('0x9b')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x88f1('0x9c')](_0x5c623c[_0x88f1('0x64')][_0x88f1('0x64')])){throw new APIBadRequestError(_0x88f1('0x9d'));}var _0x399009=_0x5c623c[_0x88f1('0x64')]['customerIp']&&_0x5c623c[_0x88f1('0x64')][_0x88f1('0x3c')];return db[_0x88f1('0x9e')][_0x88f1('0x6d')]()[_0x88f1('0x18')](function(_0x31881f){if(!_0x31881f){throw new Error(_0x88f1('0x9f'));}_0x2d695b=Object[_0x88f1('0x4e')](_0x31881f)[_0x88f1('0x59')](function(_0x1c9278){return!['createdAt',_0x88f1('0xa0')]['includes'](_0x1c9278);});_0x2c2454=Object[_0x88f1('0x4e')](_0x31881f)[_0x88f1('0x59')](function(_0x193b29){return![_0x88f1('0xa1'),_0x88f1('0xa0'),_0x88f1('0xa2'),_0x88f1('0xa3')][_0x88f1('0xa4')](_0x193b29);});if(!_[_0x88f1('0xa4')](_0x2c2454,_0x5c623c[_0x88f1('0x64')][_0x88f1('0x9b')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x2c2454[_0x88f1('0x86')](',\x20'));}_0x37a626[_0x5c623c[_0x88f1('0x64')][_0x88f1('0x9b')]]=_0x5c623c[_0x88f1('0x64')][_0x88f1('0x99')];})[_0x88f1('0x18')](function(){return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x5c623c['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x88f1('0x9e')],'as':_0x88f1('0xa5'),'where':_0x37a626,'limit':0x1,'order':[[_0x88f1('0xa0'),_0x88f1('0xa6')]]}]},{'model':db[_0x88f1('0xa7')],'as':_0x88f1('0xa8')},{'model':db[_0x88f1('0x95')],'as':_0x88f1('0x95'),'include':[{'model':db[_0x88f1('0x95')],'as':_0x88f1('0xa9'),'attributes':['id',_0x88f1('0xaa')],'raw':!![]}]}]});})[_0x88f1('0x18')](function(_0x1fe534){if(!_0x1fe534){throw new APINotFoundError(util['format'](_0x88f1('0xab'),_0x5c623c['params']['id']));}if(_0x399009){return checkWebsiteInterval(_0x1fe534);}return _0x1fe534;})[_0x88f1('0x18')](function(_0x11d7b9){_0x2c63fe[_0x88f1('0xac')]=_0x11d7b9;_0x2c63fe[_0x88f1('0xad')]=_[_0x88f1('0xae')](_0x11d7b9[_0x88f1('0xa8')],['priority'],[_0x88f1('0xaf')]);if(_0x2c63fe[_0x88f1('0xac')][_0x88f1('0xa8')]){delete _0x2c63fe['account'][_0x88f1('0xa8')];}_0x2c63fe[_0x88f1('0xb0')]=_0x11d7b9[_0x88f1('0xb1')]||{'id':_0x11d7b9['ListId']};if(_0x2c63fe[_0x88f1('0xb0')]&&_0x2c63fe[_0x88f1('0xb0')]['Contacts'][_0x88f1('0x60')]){return _0x2c63fe[_0x88f1('0xb0')]['Contacts'][0x0];}var _0x36c2f6=_[_0x88f1('0x11')](_0x5c623c['body'],{'firstName':_0x5c623c[_0x88f1('0x64')]['from'],'ListId':_0x11d7b9['ListId']});_0x36c2f6[_0x5c623c[_0x88f1('0x64')][_0x88f1('0x9b')]]=_0x5c623c[_0x88f1('0x64')][_0x88f1('0x99')];return db[_0x88f1('0x9e')][_0x88f1('0x62')](_0x36c2f6,{'fields':_0x2d695b,'raw':!![]});})[_0x88f1('0x18')](function(_0x350c6a){_0x2c63fe[_0x88f1('0xb2')]=_0x350c6a;var _0xc425fa=createInteractionObject(_0x5c623c[_0x88f1('0x5e')]['id'],_0x5c623c['body'],_0x5c623c[_0x88f1('0xb3')],_0x350c6a);var _0x4da6a5={'ChatWebsiteId':_0x5c623c[_0x88f1('0x5e')]['id']};if(_0x5c623c[_0x88f1('0x64')][_0x88f1('0xb4')]){_0x4da6a5[_0x88f1('0xb4')]=_0x5c623c['body'][_0x88f1('0xb4')];_0x4da6a5[_0x88f1('0xb5')]=![];return db['ChatInteraction'][_0x88f1('0x61')]({'where':_0x4da6a5})[_0x88f1('0x18')](function(_0x1e1ae0){var _0x40de2f=_0x5c623c[_0x88f1('0x64')][_0x88f1('0x34')]&&_0x5c623c[_0x88f1('0x64')]['referer'];if(_0x1e1ae0){_0x11b0b1=!![];return _0x1e1ae0;}else if(!_0x40de2f&&_0x1e1ae0&&_0x1e1ae0[_0x88f1('0xb5')]){throw new APIConflictError(_0x88f1('0xb6'));}_0xc425fa[_0x88f1('0xb4')]=_0x5c623c['body'][_0x88f1('0xb4')];_0xc425fa[_0x88f1('0xb7')]=_0x5c623c[_0x88f1('0x64')]['externalUrl'];return db['ChatInteraction']['create'](_0xc425fa);});}_0x4da6a5[_0x88f1('0xb8')]=_0x350c6a['id'];if(_0x5c623c[_0x88f1('0x64')][_0x88f1('0xb9')]&&_0x5c623c[_0x88f1('0x64')]['interaction']['id']){_0x4da6a5['id']=_0x5c623c['body'][_0x88f1('0xb9')]['id'];return db[_0x88f1('0xba')][_0x88f1('0x61')]({'where':_0x4da6a5})[_0x88f1('0x18')](function(_0x3a80d6){var _0x217508=_0x5c623c[_0x88f1('0x64')]['customerIp']&&_0x5c623c['body'][_0x88f1('0x3c')];if(!_0x217508&&_0x3a80d6&&_0x3a80d6['closed']){throw new APIConflictError(_0x88f1('0xb6'));}else if(_0x3a80d6){_0x11b0b1=!![];return _0x3a80d6;}else{return db[_0x88f1('0xba')][_0x88f1('0x62')](_0xc425fa);}});}return db['ChatInteraction'][_0x88f1('0x62')](_0xc425fa);})[_0x88f1('0x18')](function(_0x5a4958){if(!_0x11b0b1){return _0x5a4958;}var _0x54cced={'from':(_0x2c63fe[_0x88f1('0xb2')][_0x88f1('0x39')]||'')+'\x20'+(_0x2c63fe['contact'][_0x88f1('0x3a')]||'')};if(_0x5c623c[_0x88f1('0x64')][_0x88f1('0xb4')]&&_0x5c623c[_0x88f1('0x64')][_0x88f1('0xbb')]&&_0x5c623c['body'][_0x88f1('0xb4')]!=_0x5c623c[_0x88f1('0x64')][_0x88f1('0xbb')]){_0x54cced['threadId']=_0x5c623c[_0x88f1('0x64')][_0x88f1('0xbb')];}return _0x5a4958[_0x88f1('0x2a')](_0x54cced);})['then'](function(_0x5d0f0f){_0x2c63fe[_0x88f1('0xb9')]=_0x5d0f0f[_0x88f1('0x2c')]({'plain':!![]});_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xbc')]=!_0x11b0b1;if(_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xbc')]){if(_0x2c63fe[_0x88f1('0xac')][_0x88f1('0xbd')]){_0x2c63fe[_0x88f1('0xad')]['push']({'id':0x0,'priority':_0x2c63fe[_0x88f1('0xad')][_0x88f1('0x60')]+0x1,'app':_0x88f1('0xbe'),'appdata':_0x88f1('0xbf'),'interval':'*,*,*,*'});}}return db[_0x88f1('0xc0')][_0x88f1('0x62')]({'body':_0x5c623c[_0x88f1('0x64')][_0x88f1('0x64')],'ChatWebsiteId':_0x5c623c[_0x88f1('0x5e')]['id'],'ChatInteractionId':_0x5d0f0f['id'],'direction':'in','ContactId':_0x2c63fe[_0x88f1('0xb2')]['id'],'AttachmentId':_0x5c623c[_0x88f1('0x64')][_0x88f1('0xc1')]});})[_0x88f1('0x18')](function(_0x4a86a8){_0x2c63fe[_0x88f1('0x1e')]=_0x4a86a8;if(!_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xc2')]){return;}return db['User'][_0x88f1('0x61')]({'attributes':['id',_0x88f1('0x30')],'where':{'id':_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xc2')]}});})[_0x88f1('0x18')](function(_0x38cc73){if(_0x38cc73){_0x2c63fe[_0x88f1('0xad')][_0x88f1('0xc3')]({'id':0x0,'priority':0x0,'app':_0x88f1('0xc4'),'appdata':_0x38cc73[_0x88f1('0x30')]+','+(_0x2c63fe[_0x88f1('0xac')][_0x88f1('0xc5')]||0xa),'interval':_0x88f1('0xc6')});_0x2c63fe[_0x88f1('0xc7')]=!![];}if(!_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xc8')]){return;}return db['ChatQueue']['find']({'attributes':['id',_0x88f1('0x30')],'where':{'id':_0x2c63fe[_0x88f1('0xb9')][_0x88f1('0xc8')]}});})[_0x88f1('0x18')](function(_0x5acdbe){if(_0x5acdbe){_0x2c63fe[_0x88f1('0xad')][_0x88f1('0xc3')]({'id':0x0,'priority':0x1,'app':_0x88f1('0xc9'),'appdata':_0x5acdbe['name']+','+(_0x2c63fe[_0x88f1('0xac')][_0x88f1('0xca')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x88f1('0xcb'),_0x2c63fe);})[_0x88f1('0x18')](function(_0x3a7391){respondWithRpcPromise('EventManager',_0x88f1('0xcc'),{'event':_0x88f1('0x98'),'message':_0x3a7391},client9002);return _0x3a7391;})[_0x88f1('0x18')](respondWithResult(_0x2f050b,null))['catch'](APIHandleError(_0x2f050b));};exports[_0x88f1('0xcd')]=function(_0x31a00d,_0x159afc){var _0x4a20e7,_0x4442b3,_0x3be769;var _0x92f83f=[];var _0x126ef3={};var _0x16d55f=_0x31a00d[_0x88f1('0xce')]||[];var _0x401f93=[];var _0x14c171;return db[_0x88f1('0x9e')][_0x88f1('0x6d')]()['then'](function(_0x15d214){if(!_0x15d214){throw new db[(_0x88f1('0xcf'))][(_0x88f1('0xd0'))](_0x88f1('0xd1'));}_0x92f83f=_[_0x88f1('0xd2')](_[_0x88f1('0x4e')](_0x15d214),['createdAt',_0x88f1('0xa0'),'CompanyId',_0x88f1('0xa3')]);if(_0x31a00d[_0x88f1('0x64')]['id']){delete _0x31a00d['body']['id'];}if(_[_0x88f1('0x8b')](_0x31a00d[_0x88f1('0x64')][_0x88f1('0x99')])){throw _0x159afc[_0x88f1('0x21')](0x1f4)[_0x88f1('0xd3')](new db[(_0x88f1('0xcf'))][(_0x88f1('0xd0'))](_0x88f1('0xd4')));}if(_[_0x88f1('0x8b')](_0x31a00d[_0x88f1('0x64')][_0x88f1('0x64')])||_0x31a00d[_0x88f1('0x64')]['body']===''){throw _0x159afc['status'](0x1f4)[_0x88f1('0xd3')](new db[(_0x88f1('0xcf'))][(_0x88f1('0xd0'))](_0x88f1('0xd5')));}if(_[_0x88f1('0x8b')](_0x31a00d[_0x88f1('0x64')]['mapKeyOffline'])){throw _0x159afc[_0x88f1('0x21')](0x1f4)[_0x88f1('0xd3')](new db['Sequelize'][(_0x88f1('0xd0'))](_0x88f1('0xd6')+_0x92f83f));}if(!_[_0x88f1('0xa4')](_0x92f83f,_0x31a00d[_0x88f1('0x64')][_0x88f1('0xd7')])){throw _0x159afc[_0x88f1('0x21')](0x1f4)[_0x88f1('0xd3')](new db[(_0x88f1('0xcf'))][(_0x88f1('0xd0'))](_0x88f1('0xd8')+_0x92f83f));}_0x126ef3[_0x31a00d[_0x88f1('0x64')][_0x88f1('0xd7')]]=_0x31a00d[_0x88f1('0x64')][_0x88f1('0x99')];})['then'](function(){return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x31a00d['params']['id']},'include':[{'model':db[_0x88f1('0xd9')],'as':'List'},{'model':db[_0x88f1('0xda')],'as':_0x88f1('0xda')}]});})[_0x88f1('0x18')](handleEntityNotFound(_0x159afc,null))[_0x88f1('0x18')](function(_0x1e68c8){if(_0x1e68c8&&_0x1e68c8[_0x88f1('0xb1')]){_0x4442b3=_0x1e68c8;var _0x170707=_[_0x88f1('0x11')](_0x31a00d['body'],{'firstName':_0x31a00d['body'][_0x88f1('0x99')],'phone':_0x31a00d[_0x88f1('0x64')][_0x88f1('0x99')],'ListId':_0x1e68c8['ListId']});_0x170707[_0x31a00d[_0x88f1('0x64')][_0x88f1('0xd7')]]=_0x31a00d[_0x88f1('0x64')]['from'];return db[_0x88f1('0x9e')][_0x88f1('0xdb')]({'where':_0x126ef3,'defaults':_0x170707});}})[_0x88f1('0xdc')](function(_0x1c4d33){if(_0x1c4d33){_0x3be769=_0x1c4d33;var _0x5c8f40=fs[_0x88f1('0xdd')](path[_0x88f1('0x86')](config[_0x88f1('0x87')],_0x88f1('0xde')),_0x88f1('0xdf'));var _0x1f2160=ejs[_0x88f1('0xe0')](_0x5c8f40,{'body':_['toPairs'](_0x31a00d[_0x88f1('0x64')][_0x88f1('0x64')]),'bodyTitle':_0x4442b3['offlineMessageBody']});return db[_0x88f1('0xe1')][_0x88f1('0x62')]({'body':_0x1f2160,'plainBody':htmlToText[_0x88f1('0xe2')](_0x1f2160),'ContactId':_0x1c4d33['id'],'ChatWebsiteId':_0x4442b3['id']});}})[_0x88f1('0x18')](function(_0x13e8a0){_0x14c171=_0x13e8a0;if(_0x16d55f[_0x88f1('0x60')]){var _0x20bbdd=_0x16d55f[_0x88f1('0x4a')](function(_0x5707e7){return{'name':_0x5707e7['originalname'],'basename':_0x5707e7[_0x88f1('0x7e')],'type':_0x5707e7[_0x88f1('0xe3')],'ChatOfflineMessageId':_0x13e8a0['id']};});_0x401f93=_0x20bbdd[_0x88f1('0x4a')](_0x40a5a1=>{var _0x5c3f9e={'filename':_0x40a5a1[_0x88f1('0x30')],'path':path['join'](config[_0x88f1('0x87')],_0x88f1('0xe4'),_0x88f1('0xce'),_0x88f1('0xe5'),_0x88f1('0xe6'),_0x40a5a1['basename'])};return _0x5c3f9e;});if(!_0x4442b3[_0x88f1('0xe7')]){return db[_0x88f1('0xe8')][_0x88f1('0xe9')](function(_0x48a873){return db[_0x88f1('0xea')]['bulkCreate'](_0x20bbdd,{'transaction':_0x48a873});});}}})[_0x88f1('0x18')](function(){if(_0x14c171){_0x4a20e7=_0x14c171;return db[_0x88f1('0xda')][_0x88f1('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x88f1('0xeb')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x88f1('0xec'),'raw':!![]}]}]});}})['then'](function(_0x5eff5f){if(_0x5eff5f&&_0x5eff5f[_0x88f1('0xed')]&&_0x4442b3[_0x88f1('0xee')]&&_0x4442b3['forwardOfflineAddress']){var _0x1a6ceb=_0x5eff5f[_0x88f1('0xef')]();return respondWithRpcPromise('SendMail',_0x88f1('0xf0'),{'account':_0x1a6ceb,'message':{'from':util['format'](_0x88f1('0xf1'),_0x5eff5f['name'],_0x5eff5f['email']||_0x5eff5f[_0x88f1('0xed')][_0x88f1('0x69')]),'to':_0x4442b3['forwardOfflineAddress'],'subject':_0x4442b3['offlineMessageSubject'],'html':_0x4a20e7[_0x88f1('0x64')],'attachments':_0x401f93}},client9003)[_0x88f1('0x18')](function(){return _0x4a20e7;})[_0x88f1('0x20')](function(_0x22bbea){logger[_0x88f1('0x1b')](_0x22bbea);});}})[_0x88f1('0x18')](function(){if(_0x4442b3&&_0x4442b3[_0x88f1('0xe7')]&&_0x4442b3['MailAccountId']){var _0xb99085=[];if(_0x16d55f['length']){_0xb99085=_0x16d55f[_0x88f1('0x4a')](function(_0x2effa9){return{'name':_0x2effa9[_0x88f1('0xf2')],'basename':_0x2effa9[_0x88f1('0x7e')],'type':_0x2effa9[_0x88f1('0xe3')],'ChatOfflineMessageId':_0x14c171['id']};});}var _0x595b3e;if(!_[_0x88f1('0x8b')](_0x4442b3[_0x88f1('0xf3')])){var _0x11df81=_[_0x88f1('0x4a')](_0x31a00d[_0x88f1('0x64')],function(_0x33baf1){return _0x33baf1;});var _0x5ccfb0=_[_0x88f1('0xf4')](_0x11df81)[0x0];var _0x44665e=_[_0x88f1('0xf5')](_0x5ccfb0,function(_0x3d5d43){return _0x3d5d43;});_0x595b3e=_0x44665e[0x1][_0x4442b3[_0x88f1('0xf3')]];}var _0x568e09={'from':_0x3be769['email'],'firstName':_0x3be769[_0x88f1('0x39')],'lastName':_0x3be769[_0x88f1('0x3a')],'mapKey':_0x88f1('0xf6'),'message':{'from':_0x3be769[_0x88f1('0xf6')],'to':_0x4442b3[_0x88f1('0xda')][_0x88f1('0xf6')],'cc':'','subject':_[_0x88f1('0x8b')](_0x595b3e)?_0x4442b3['offlineMessageSubject']:_0x595b3e,'messageId':'','sentAt':new Date(),'attach':_0xb99085['length'],'attachments':_0xb99085,'originChannel':_0x88f1('0xf7'),'ChatWebsiteId':_0x4442b3['id'],'ChatOfflineMessageId':_0x4a20e7['id'],'originTo':_0x4442b3['MailAccount'][_0x88f1('0xf6')]},'body':_0x4a20e7[_0x88f1('0x64')]};var _0x2436b1={'account':{'id':_0x4442b3[_0x88f1('0xf8')]},'body':_0x568e09,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x88f1('0xf9'),'notifyMail',_0x2436b1,client9001)[_0x88f1('0x18')](function(){return _0x4a20e7;})['catch'](function(_0xf06bd1){logger[_0x88f1('0x1b')](_0xf06bd1);});}return;})[_0x88f1('0x18')](function(){if(_0x4a20e7){return _0x4a20e7;}})[_0x88f1('0x18')](respondWithResult(_0x159afc,null))[_0x88f1('0x20')](function(){for(var _0x4dbe94 of _0x16d55f){var _0x285f32=path[_0x88f1('0x86')](config['root'],'server',_0x88f1('0xce'),_0x88f1('0xe5'),_0x88f1('0xe6'),_0x4dbe94[_0x88f1('0x7e')]);fs_extra[_0x88f1('0xfa')](_0x285f32)[_0x88f1('0x20')](function(_0x5d0db9){logger[_0x88f1('0x1b')](_0x88f1('0xfb'),_0x285f32,_0x5d0db9);});}});};exports['addInteraction']=function(_0x3a87e4,_0x5ee78e){return db[_0x88f1('0xba')][_0x88f1('0x61')]({'where':{'id':_0x3a87e4[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x5ee78e,null))[_0x88f1('0x18')](function(_0x16744f){if(_0x16744f){return _0x16744f[_0x88f1('0xfc')](_0x3a87e4[_0x88f1('0x64')]['ids'],_[_0x88f1('0xfd')](_0x3a87e4['body'],[_0x88f1('0x75'),'id'])||{});}})[_0x88f1('0x18')](respondWithResult(_0x5ee78e,null))[_0x88f1('0x20')](handleError(_0x5ee78e,null));};exports[_0x88f1('0xfe')]=function(_0x34b907,_0xa872ca){var _0x1bd933={'raw':![],'where':{}};var _0x40ed14={};var _0x257da4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x88f1('0x70')]({'where':{'id':_0x34b907['params']['id']}})['then'](handleEntityNotFound(_0xa872ca,null))['then'](function(_0xac0fe7){if(_0xac0fe7){_0x40ed14[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0xba')][_0x88f1('0x5f')]);_0x40ed14[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x34b907['query']);_0x40ed14[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x40ed14['model'],_0x40ed14['query']);_0x1bd933['attributes']=_[_0x88f1('0x50')](_0x40ed14[_0x88f1('0x43')],qs['fields'](_0x34b907[_0x88f1('0x4d')]['fields']));_0x1bd933[_0x88f1('0x52')]=_0x1bd933[_0x88f1('0x52')][_0x88f1('0x60')]?_0x1bd933[_0x88f1('0x52')]:_0x40ed14['model'];if(!_0x34b907[_0x88f1('0x4d')][_0x88f1('0x79')](_0x88f1('0x53'))){_0x1bd933[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0x34b907[_0x88f1('0x4d')][_0x88f1('0x25')]);_0x1bd933[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0x34b907[_0x88f1('0x4d')][_0x88f1('0x27')]);}_0x1bd933['order']=qs[_0x88f1('0x55')](_0x34b907[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x1bd933[_0x88f1('0x56')]=qs['filters'](_[_0x88f1('0x7a')](_0x34b907[_0x88f1('0x4d')],_0x40ed14[_0x88f1('0x4f')]));_0x1bd933[_0x88f1('0x56')][_0x88f1('0x6e')]=_0xac0fe7['id'];if(_0x34b907[_0x88f1('0x4d')]['filter']){_0x1bd933['where']=_[_0x88f1('0x57')](_0x1bd933[_0x88f1('0x56')],{'$or':_['map'](_0x1bd933[_0x88f1('0x52')],function(_0x39075a){var _0x2475e5={};_0x2475e5[_0x39075a]={'$like':'%'+_0x34b907['query'][_0x88f1('0x59')]+'%'};return _0x2475e5;})});}_0x1bd933=_['merge']({},_0x1bd933,_0x34b907[_0x88f1('0x72')]);return db['ChatInteraction'][_0x88f1('0x26')]({'where':_0x1bd933[_0x88f1('0x56')]})[_0x88f1('0x18')](function(_0x470bab){_0x257da4[_0x88f1('0x26')]=_0x470bab;if(_0x34b907[_0x88f1('0x4d')][_0x88f1('0x5a')]){_0x1bd933['include']=[{'model':db[_0x88f1('0x9e')],'as':_0x88f1('0xff'),'required':![]},{'model':db[_0x88f1('0x100')],'as':_0x88f1('0x101'),'attributes':[_0x88f1('0x30'),_0x88f1('0x102'),_0x88f1('0x103')],'required':![]},{'model':db[_0x88f1('0x104')],'as':_0x88f1('0x105'),'attributes':['id',_0x88f1('0x30'),_0x88f1('0x106')],'where':_0x34b907['query']['tag']?{'id':_0x34b907['query'][_0x88f1('0x107')]}:undefined,'required':_0x34b907[_0x88f1('0x4d')][_0x88f1('0x107')]?!![]:![]}];}return db[_0x88f1('0xba')][_0x88f1('0x73')](_0x1bd933);})['then'](function(_0x55f65f){_0x257da4[_0x88f1('0x5c')]=_0x55f65f;return _0x257da4;});}})[_0x88f1('0x18')](respondWithFilteredResult(_0xa872ca,_0x1bd933))[_0x88f1('0x20')](handleError(_0xa872ca,null));};exports['getSnippet']=function(_0x3413c6,_0x486082){var _0x25241b=0x0;var _0x10e9dc=0x0;var _0x325134=![];var _0x18f7b3;var _0x5163ff;return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x3413c6[_0x88f1('0x5e')]['id']},'include':[{'model':db[_0x88f1('0x95')],'as':_0x88f1('0x95'),'include':[{'model':db[_0x88f1('0x95')],'as':_0x88f1('0xa9'),'attributes':['id','interval']}]}]})[_0x88f1('0x18')](handleEntityNotFound(_0x486082,null))[_0x88f1('0x18')](function(_0x243b2c){if(_0x243b2c){_0x18f7b3=_0x243b2c;return _0x243b2c[_0x88f1('0x108')]({'raw':!![]});}})[_0x88f1('0x18')](function(_0x3d4d4f){if(_0x18f7b3){if(_0x3d4d4f){_0x5163ff=_0x3d4d4f;}}return require('../../config/license/util')['getLicense']();})[_0x88f1('0x18')](function(_0x297967){if(_0x297967){_0x10e9dc=_0x297967[_0x88f1('0x109')];_0x325134=_0x297967[_0x88f1('0x10a')];}})[_0x88f1('0x18')](function(){return db[_0x88f1('0xba')]['count']({'where':{'closed':![]}});})['then'](function(_0x1cc900){_0x25241b=_0x1cc900;if(_0x10e9dc&&_0x1cc900>_0x10e9dc){return db[_0x88f1('0x10b')]['findOne']({'where':{'id':0x1}})['then'](function(_0x1c8638){if(_0x1c8638){_0x1c8638[_0x88f1('0x10c')](_0x88f1('0x10d'));}});}})[_0x88f1('0x18')](function(){var _0xa0bcf1=_0x18f7b3['Interval'];var _0xc61771=_0x18f7b3[_0x88f1('0x97')]||undefined;return _0xa0bcf1?_0xa0bcf1[_0x88f1('0x10e')](_0xc61771):!![];})[_0x88f1('0x18')](function(_0x65f75d){var _0x7f535e=fs[_0x88f1('0xdd')](path[_0x88f1('0x86')](config['root'],_0x88f1('0x10f')),'utf8');var _0x2c9c08='3.9.0';var _0x4832cf=![];try{const _0x15069c=new URL(_0x18f7b3[_0x88f1('0x65')]);_0x18f7b3[_0x88f1('0x65')]=_0x15069c[_0x88f1('0x110')];}catch(_0x134183){}var _0x59b40e;if(_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x3c')]){_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x3c')]=_0x3413c6['headers'][_0x88f1('0x3c')]['replace'](/\/$/,'');_0x59b40e=wildcardUtils[_0x88f1('0x111')](_0x18f7b3[_0x88f1('0x65')],_0x3413c6['headers'][_0x88f1('0x3c')]);}else{_0x3413c6['headers'][_0x88f1('0x3c')]=_0x18f7b3[_0x88f1('0x65')];_0x59b40e=!![];}var _0x11ea93={'chatVersion':_0x2c9c08,'chatWebsiteAddressOrigin':_0x59b40e?_0x3413c6['headers']['referer']:_0x18f7b3[_0x88f1('0x65')],'remote':_0x18f7b3[_0x88f1('0x112')],'query':querystring[_0x88f1('0x46')](_[_0x88f1('0x57')](_0x18f7b3[_0x88f1('0x2c')]({'plain':!![]}),{'customerIp':_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x37')]||_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x113')]||_0x3413c6[_0x88f1('0x114')][_0x88f1('0x115')]||_0x3413c6['ip'],'referer':_0x3413c6[_0x88f1('0xb3')]['referer'],'openedInteractions':_0x25241b,'maxInteractions':_0x10e9dc,'virtual':_0x325134['virtual'],'online':_0x65f75d,'custom':_0x325134,'address':_0x59b40e?_0x3413c6[_0x88f1('0xb3')][_0x88f1('0x3c')]:null}))['replace'](/'/g,'\x5c\x27')};_0x486082[_0x88f1('0xd3')](ejs['render'](Mustache['render'](_0x7f535e,_0x11ea93),{'proactiveActions':_0x5163ff,'alignment':_0x18f7b3[_0x88f1('0x116')],'verticalAlignment':_0x18f7b3[_0x88f1('0x117')],'div_color':_0x18f7b3[_0x88f1('0x106')],'labelText':_0x18f7b3[_0x88f1('0x118')],'text_color':_0x18f7b3[_0x88f1('0x119')],'text_button_color':_0x18f7b3['textButtonColor'],'button_color':_0x18f7b3['color_button'],'background_color':_0x18f7b3[_0x88f1('0x11a')],'hideWhenOffline':_0x18f7b3['hideWhenOffline'],'intervalId':_0x18f7b3[_0x88f1('0x11b')],'isDevelopment':_0x4832cf,'chatVersion':_0x2c9c08}));})['catch'](handleError(_0x486082,null));};exports[_0x88f1('0x11c')]=function(_0x276c5e,_0x596f1f){var _0x327ee2=_0x276c5e[_0x88f1('0x5e')]['id'];var _0x2465c4=_0x276c5e[_0x88f1('0x64')];var _0x415daf=0xc8;var _0x3a873c=null;return db[_0x88f1('0xe8')][_0x88f1('0xe9')]({'isolationLevel':db[_0x88f1('0xe8')][_0x88f1('0x11d')][_0x88f1('0x11e')][_0x88f1('0x11f')]},function(_0x3c0b75){return db['ChatWebsite'][_0x88f1('0x70')]({'where':{'id':_0x327ee2},'transaction':_0x3c0b75})[_0x88f1('0x18')](function(_0x2bb75a){if(_0x2bb75a){return db[_0x88f1('0xa7')]['destroy']({'where':{'ChatWebsiteId':_0x327ee2},'transaction':_0x3c0b75})['then'](function(){var _0x775ca7=_['map'](_0x2465c4,function(_0x5447e2){_0x5447e2[_0x88f1('0x6e')]=_0x327ee2;return _0x5447e2;});return db[_0x88f1('0xa7')][_0x88f1('0x120')](_0x775ca7,{'transaction':_0x3c0b75});});}else{_0x415daf=0x194;_0x3a873c=[];}});})[_0x88f1('0x18')](function(){if(_0x415daf!==0x194){return db[_0x88f1('0xa7')][_0x88f1('0x121')]({'where':{'ChatWebsiteId':_0x327ee2},'order':_0x88f1('0x122')})[_0x88f1('0x18')](function(_0x4c8b0b){_0x3a873c=_0x4c8b0b;});}})['catch'](function(_0x3afecd){_0x415daf=0x1f4;logger[_0x88f1('0x1b')](_0x3afecd[_0x88f1('0x2f')]);if(_0x3afecd['name']){delete _0x3afecd[_0x88f1('0x30')];}_0x3a873c=_0x3afecd;})[_0x88f1('0x123')](function(){if(_0x3a873c===null){_0x596f1f[_0x88f1('0x2e')](_0x415daf);}else{if(_0x415daf===0x1f4){_0x596f1f[_0x88f1('0x21')](_0x415daf)[_0x88f1('0xd3')](_0x3a873c);}else{_0x596f1f[_0x88f1('0x21')](_0x415daf)[_0x88f1('0x23')](_0x3a873c);}}});};exports['getApplications']=function(_0x4cea83,_0x1d1b61){var _0x5d9d08={};var _0x5cfbfb={};var _0x54bd4e;var _0xb72908;return db[_0x88f1('0x4b')][_0x88f1('0x70')]({'where':{'id':_0x4cea83['params']['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x1d1b61,null))[_0x88f1('0x18')](function(_0x211915){if(_0x211915){_0x54bd4e=_0x211915;_0x5cfbfb[_0x88f1('0x43')]=_['keys'](db[_0x88f1('0xa7')][_0x88f1('0x5f')]);_0x5cfbfb[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x4cea83['query']);_0x5cfbfb[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x5cfbfb[_0x88f1('0x43')],_0x5cfbfb['query']);_0x5d9d08[_0x88f1('0x52')]=_['intersection'](_0x5cfbfb['model'],qs[_0x88f1('0x51')](_0x4cea83[_0x88f1('0x4d')][_0x88f1('0x51')]));_0x5d9d08['attributes']=_0x5d9d08[_0x88f1('0x52')][_0x88f1('0x60')]?_0x5d9d08[_0x88f1('0x52')]:_0x5cfbfb[_0x88f1('0x43')];_0x5d9d08[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0x4cea83[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x5d9d08[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_[_0x88f1('0x7a')](_0x4cea83[_0x88f1('0x4d')],_0x5cfbfb[_0x88f1('0x4f')]));if(_0x4cea83[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x5d9d08[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x5d9d08[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x5d9d08[_0x88f1('0x52')],function(_0x17a906){var _0x4f3ae1={};_0x4f3ae1[_0x17a906]={'$like':'%'+_0x4cea83[_0x88f1('0x4d')]['filter']+'%'};return _0x4f3ae1;})});}_0x5d9d08=_[_0x88f1('0x57')]({},_0x5d9d08,_0x4cea83[_0x88f1('0x72')]);return _0x54bd4e[_0x88f1('0x124')](_0x5d9d08);}})[_0x88f1('0x18')](function(_0x2817bd){if(_0x2817bd){_0xb72908=_0x2817bd[_0x88f1('0x60')];if(!_0x4cea83['query']['hasOwnProperty']('nolimit')){_0x5d9d08[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0x4cea83['query'][_0x88f1('0x25')]);_0x5d9d08['offset']=qs[_0x88f1('0x27')](_0x4cea83['query'][_0x88f1('0x27')]);}return _0x54bd4e[_0x88f1('0x124')](_0x5d9d08);}})[_0x88f1('0x18')](function(_0x2c0129){if(_0x2c0129){return _0x2c0129?{'count':_0xb72908,'rows':_0x2c0129}:null;}})[_0x88f1('0x18')](respondWithResult(_0x1d1b61,null))[_0x88f1('0x20')](handleError(_0x1d1b61,null));};exports['addProactiveActions']=function(_0x7e8650,_0x519f7f){return db[_0x88f1('0x125')]['find']({'where':{'id':_0x7e8650[_0x88f1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x519f7f,null))[_0x88f1('0x18')](function(_0x5133be){if(_0x5133be){return _0x5133be[_0x88f1('0x126')](_0x7e8650[_0x88f1('0x64')]['ids'],_[_0x88f1('0xfd')](_0x7e8650[_0x88f1('0x64')],['ids','id'])||{});}})[_0x88f1('0x18')](respondWithResult(_0x519f7f,null))[_0x88f1('0x20')](handleError(_0x519f7f,null));};exports[_0x88f1('0x108')]=function(_0xc294f6,_0x2f25cc){var _0x2c885e={};var _0xd70b87={};var _0x5d68b4;var _0xf5f532;return db[_0x88f1('0x4b')][_0x88f1('0x70')]({'where':{'id':_0xc294f6[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x2f25cc,null))[_0x88f1('0x18')](function(_0x413322){if(_0x413322){_0x5d68b4=_0x413322;_0xd70b87[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0x127')][_0x88f1('0x5f')]);_0xd70b87['query']=_[_0x88f1('0x4e')](_0xc294f6[_0x88f1('0x4d')]);_0xd70b87[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0xd70b87[_0x88f1('0x43')],_0xd70b87[_0x88f1('0x4d')]);_0x2c885e[_0x88f1('0x52')]=_['intersection'](_0xd70b87[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0xc294f6[_0x88f1('0x4d')][_0x88f1('0x51')]));_0x2c885e[_0x88f1('0x52')]=_0x2c885e[_0x88f1('0x52')][_0x88f1('0x60')]?_0x2c885e[_0x88f1('0x52')]:_0xd70b87[_0x88f1('0x43')];_0x2c885e[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0xc294f6['query'][_0x88f1('0x55')]);_0x2c885e[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_['pick'](_0xc294f6[_0x88f1('0x4d')],_0xd70b87[_0x88f1('0x4f')]));if(_0xc294f6[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x2c885e['where']=_[_0x88f1('0x57')](_0x2c885e[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x2c885e[_0x88f1('0x52')],function(_0x3b4e2d){var _0x56b4ac={};_0x56b4ac[_0x3b4e2d]={'$like':'%'+_0xc294f6[_0x88f1('0x4d')][_0x88f1('0x59')]+'%'};return _0x56b4ac;})});}_0x2c885e=_[_0x88f1('0x57')]({},_0x2c885e,_0xc294f6[_0x88f1('0x72')]);return _0x5d68b4[_0x88f1('0x108')](_0x2c885e);}})[_0x88f1('0x18')](function(_0x58370a){if(_0x58370a){_0xf5f532=_0x58370a[_0x88f1('0x60')];if(!_0xc294f6[_0x88f1('0x4d')]['hasOwnProperty'](_0x88f1('0x53'))){_0x2c885e[_0x88f1('0x25')]=qs['limit'](_0xc294f6[_0x88f1('0x4d')][_0x88f1('0x25')]);_0x2c885e[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0xc294f6['query'][_0x88f1('0x27')]);}return _0x5d68b4[_0x88f1('0x108')](_0x2c885e);}})[_0x88f1('0x18')](function(_0x56954f){if(_0x56954f){return _0x56954f?{'count':_0xf5f532,'rows':_0x56954f}:null;}})[_0x88f1('0x18')](respondWithResult(_0x2f25cc,null))['catch'](handleError(_0x2f25cc,null));};exports[_0x88f1('0x128')]=function(_0x2f482b,_0x2f98c9){var _0x145a72=_0x2f482b[_0x88f1('0x4d')]['online']===_0x88f1('0x129')?'offlineForm':_0x88f1('0x12a');return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'attributes':['id',_0x145a72],'where':{'id':_0x2f482b[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x2f98c9,null))[_0x88f1('0x18')](function(_0x2dc831){if(_0x2dc831){var _0xa3b891=_0x2dc831[_0x145a72];var _0x1f0085=_0xa3b891&&_0xa3b891[_0x88f1('0x12b')]?_0xa3b891[_0x88f1('0x12b')]:[];_0x2f98c9[_0x88f1('0xd3')]({'fromKey':_['isNil'](_0xa3b891[_0x88f1('0x12c')])?undefined:_0xa3b891['fromKey'],'count':_0x1f0085[_0x88f1('0x60')],'rows':_0x1f0085});}})[_0x88f1('0x20')](handleError(_0x2f98c9,null));};exports[_0x88f1('0x12d')]=function(_0x5eb043,_0xe6f462){var _0x336d44={'raw':![],'where':{}};var _0x3cad62={};var _0x4abc8d={'count':0x0,'rows':[]};return db[_0x88f1('0x4b')][_0x88f1('0x70')]({'where':{'id':_0x5eb043[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0xe6f462,null))['then'](function(_0x1600a1){if(_0x1600a1){_0x3cad62[_0x88f1('0x43')]=_['keys'](db[_0x88f1('0xe1')][_0x88f1('0x5f')]);_0x3cad62[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x5eb043[_0x88f1('0x4d')]);_0x3cad62[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x3cad62[_0x88f1('0x43')],_0x3cad62['query']);_0x336d44[_0x88f1('0x52')]=_[_0x88f1('0x50')](_0x3cad62[_0x88f1('0x43')],qs[_0x88f1('0x51')](_0x5eb043[_0x88f1('0x4d')]['fields']));_0x336d44['attributes']=_0x336d44[_0x88f1('0x52')]['length']?_0x336d44[_0x88f1('0x52')]:_0x3cad62['model'];if(!_0x5eb043[_0x88f1('0x4d')]['hasOwnProperty'](_0x88f1('0x53'))){_0x336d44['limit']=qs[_0x88f1('0x25')](_0x5eb043['query']['limit']);_0x336d44[_0x88f1('0x27')]=qs[_0x88f1('0x27')](_0x5eb043[_0x88f1('0x4d')]['offset']);}_0x336d44[_0x88f1('0x54')]=qs[_0x88f1('0x55')](_0x5eb043['query'][_0x88f1('0x55')]);_0x336d44[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_[_0x88f1('0x7a')](_0x5eb043['query'],_0x3cad62[_0x88f1('0x4f')]));_0x336d44[_0x88f1('0x56')][_0x88f1('0x6e')]=_0x1600a1['id'];if(_0x5eb043[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x336d44[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x336d44[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x336d44['attributes'],function(_0x33a024){var _0x4ec371={};_0x4ec371[_0x33a024]={'$like':'%'+_0x5eb043['query']['filter']+'%'};return _0x4ec371;})});}_0x336d44=_[_0x88f1('0x57')]({},_0x336d44,_0x5eb043[_0x88f1('0x72')]);return db[_0x88f1('0xe1')][_0x88f1('0x26')]({'where':_0x336d44[_0x88f1('0x56')]})['then'](function(_0x283a03){_0x4abc8d['count']=_0x283a03;if(_0x5eb043['query'][_0x88f1('0x5a')]){_0x336d44[_0x88f1('0x5b')]=[{'all':!![]}];}else{_0x336d44[_0x88f1('0x5b')]=[{'model':db[_0x88f1('0x9e')],'as':_0x88f1('0xff'),'required':![]},{'model':db['Attachment'],'as':_0x88f1('0x12e'),'required':![]}];}return db[_0x88f1('0xe1')]['findAll'](_0x336d44);})['then'](function(_0x214833){_0x4abc8d[_0x88f1('0x5c')]=_0x214833;return _0x4abc8d;});}})['then'](respondWithFilteredResult(_0xe6f462,_0x336d44))[_0x88f1('0x20')](handleError(_0xe6f462,null));};exports[_0x88f1('0x12f')]=function(_0x3a5507,_0x3abb1b){return db[_0x88f1('0x4b')][_0x88f1('0x61')]({'where':{'id':_0x3a5507[_0x88f1('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3abb1b,null))[_0x88f1('0x18')](function(_0x165a57){if(_0x165a57){return _0x165a57['addAgents'](_0x3a5507[_0x88f1('0x64')][_0x88f1('0x75')],_['omit'](_0x3a5507[_0x88f1('0x64')],['ids','id'])||{})[_0x88f1('0xdc')](function(_0x3b898d){for(var _0x18ada9=0x0;_0x18ada9<_0x3a5507['body'][_0x88f1('0x75')][_0x88f1('0x60')];_0x18ada9+=0x1){socket[_0x88f1('0x130')]('userChatWebsite:save',{'UserId':Number(_0x3a5507[_0x88f1('0x64')][_0x88f1('0x75')][_0x18ada9]),'ChatWebsiteId':Number(_0x3a5507['params']['id'])});}return _0x3b898d;});}})['then'](respondWithResult(_0x3abb1b,null))['catch'](handleError(_0x3abb1b,null));};exports[_0x88f1('0x131')]=function(_0x269656,_0x4dfbaf){return db[_0x88f1('0x4b')]['find']({'where':{'id':_0x269656[_0x88f1('0x5e')]['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x4dfbaf,null))[_0x88f1('0x18')](function(_0x4d096b){if(_0x4d096b){return _0x4d096b[_0x88f1('0x131')](_0x269656[_0x88f1('0x4d')][_0x88f1('0x75')])[_0x88f1('0x18')](function(){if(_[_0x88f1('0x132')](_0x269656['query']['ids'])){for(var _0x4a5026=0x0;_0x4a5026<_0x269656[_0x88f1('0x4d')][_0x88f1('0x75')]['length'];_0x4a5026+=0x1){socket[_0x88f1('0x130')](_0x88f1('0x133'),{'UserId':Number(_0x269656['query'][_0x88f1('0x75')][_0x4a5026]),'ChatWebsiteId':Number(_0x269656[_0x88f1('0x5e')]['id'])});}}else{socket[_0x88f1('0x130')](_0x88f1('0x133'),{'UserId':Number(_0x269656[_0x88f1('0x4d')][_0x88f1('0x75')]),'ChatWebsiteId':Number(_0x269656[_0x88f1('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x4dfbaf,null))[_0x88f1('0x20')](handleError(_0x4dfbaf,null));};exports[_0x88f1('0x134')]=function(_0x4c8b37,_0x5032df){var _0x35fe29={};var _0x391773={};var _0x5d3e76;var _0x1fce16;return db[_0x88f1('0x4b')]['findOne']({'where':{'id':_0x4c8b37['params']['id']}})[_0x88f1('0x18')](handleEntityNotFound(_0x5032df,null))[_0x88f1('0x18')](function(_0x28c69d){if(_0x28c69d){_0x5d3e76=_0x28c69d;_0x391773[_0x88f1('0x43')]=_[_0x88f1('0x4e')](db[_0x88f1('0x100')]['rawAttributes']);_0x391773[_0x88f1('0x4d')]=_[_0x88f1('0x4e')](_0x4c8b37[_0x88f1('0x4d')]);_0x391773[_0x88f1('0x4f')]=_[_0x88f1('0x50')](_0x391773[_0x88f1('0x43')],_0x391773['query']);_0x35fe29[_0x88f1('0x52')]=_[_0x88f1('0x50')](_0x391773['model'],qs[_0x88f1('0x51')](_0x4c8b37['query']['fields']));_0x35fe29[_0x88f1('0x52')]=_0x35fe29['attributes'][_0x88f1('0x60')]?_0x35fe29['attributes']:_0x391773['model'];_0x35fe29['order']=qs['sort'](_0x4c8b37[_0x88f1('0x4d')][_0x88f1('0x55')]);_0x35fe29[_0x88f1('0x56')]=qs[_0x88f1('0x4f')](_['pick'](_0x4c8b37[_0x88f1('0x4d')],_0x391773[_0x88f1('0x4f')]));if(_0x4c8b37[_0x88f1('0x4d')][_0x88f1('0x59')]){_0x35fe29[_0x88f1('0x56')]=_[_0x88f1('0x57')](_0x35fe29[_0x88f1('0x56')],{'$or':_[_0x88f1('0x4a')](_0x35fe29[_0x88f1('0x52')],function(_0x33fbea){var _0x57d4d3={};_0x57d4d3[_0x33fbea]={'$like':'%'+_0x4c8b37[_0x88f1('0x4d')][_0x88f1('0x59')]+'%'};return _0x57d4d3;})});}_0x35fe29=_['merge']({},_0x35fe29,_0x4c8b37['options']);return _0x5d3e76['getAgents'](_0x35fe29);}})[_0x88f1('0x18')](function(_0x1aaa83){if(_0x1aaa83){_0x1fce16=_0x1aaa83[_0x88f1('0x60')];if(!_0x4c8b37['query'][_0x88f1('0x79')]('nolimit')){_0x35fe29[_0x88f1('0x25')]=qs[_0x88f1('0x25')](_0x4c8b37['query']['limit']);_0x35fe29['offset']=qs['offset'](_0x4c8b37['query']['offset']);}return _0x5d3e76[_0x88f1('0x134')](_0x35fe29);}})[_0x88f1('0x18')](function(_0xeac71c){if(_0xeac71c){return _0xeac71c?{'count':_0x1fce16,'rows':_0xeac71c}:null;}})[_0x88f1('0x18')](respondWithResult(_0x5032df,null))[_0x88f1('0x20')](handleError(_0x5032df,null));};
\ No newline at end of file
+var _0xee46=['first','split','firstName','lastName','x-real-port','version','format','%s\x20%s','browser','unknown','device','model','vendor','%s\x20%s\x20%s','type','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','keys','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','address','body','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','removeDispositions','ids','CannedAnswer','findOne','nolimit','removeAnswers','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','systemAvatar','getLogo','join','root','../../config/license/util','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','referer','CmContact','No\x20available\x20attributes','includes','createdAt','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','updatedAt','DESC','ChatApplication','Applications','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','priority','list','contact','headers','threadId','closed','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','account','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','waitForTheAssignedQueue','Start','startRouting','EventManager','files','Sequelize','ValidationError','no\x20available\x20attributes','CompanyId','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','addInteraction','fullname','internal','Tags','tag','getSnippet','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','origin','replace','testWebsiteWithWildcard','x-real-ip','connection','alignment','color','labelText','textColor','textButtonColor','backgroundColor','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','URL','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','update','destroy','ChatWebsites','UserProfileResource','name','user-agent-parser','setUA','user-agent','customerIp','x-forwarded-for'];(function(_0x4fe5b5,_0x41efab){var _0x221fbe=function(_0x35fd94){while(--_0x35fd94){_0x4fe5b5['push'](_0x4fe5b5['shift']());}};_0x221fbe(++_0x41efab);}(_0xee46,0xf2));var _0x6ee4=function(_0x246251,_0x5974c0){_0x246251=_0x246251-0x0;var _0x58d5ee=_0xee46[_0x246251];return _0x58d5ee;};'use strict';var Mustache=require('mustache');var util=require(_0x6ee4('0x0'));var path=require(_0x6ee4('0x1'));var ejs=require(_0x6ee4('0x2'));var fs=require('fs');var fs_extra=require(_0x6ee4('0x3'));var _=require(_0x6ee4('0x4'));var querystring=require(_0x6ee4('0x5'));var htmlToText=require('html-to-text');var Redis=require(_0x6ee4('0x6'));var jayson=require(_0x6ee4('0x7'));var qs=require(_0x6ee4('0x8'));var logger=require(_0x6ee4('0x9'))(_0x6ee4('0xa'));var config=require(_0x6ee4('0xb'));var APIBadRequestError=require('../../errors/api')[_0x6ee4('0xc')];var APINotFoundError=require(_0x6ee4('0xd'))[_0x6ee4('0xe')];var APIOutOfIntervalError=require(_0x6ee4('0xd'))[_0x6ee4('0xf')];var APIHandleError=require(_0x6ee4('0xd'))[_0x6ee4('0x10')];var APIConflictError=require(_0x6ee4('0xd'))[_0x6ee4('0x11')];var wildcardUtils=require(_0x6ee4('0x12'));var URL=require('url')[_0x6ee4('0x13')];var db=require('../../mysqldb')['db'];config[_0x6ee4('0x14')]=_[_0x6ee4('0x15')](config['redis'],{'host':_0x6ee4('0x16'),'port':0x18eb});var socket=require(_0x6ee4('0x17'))(new Redis(config['redis']));require(_0x6ee4('0x18'))[_0x6ee4('0x19')](socket);var client=jayson[_0x6ee4('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0x6ee4('0x1b')]({'port':0x232a});var client9003=jayson[_0x6ee4('0x1a')][_0x6ee4('0x1b')]({'port':0x232b});var client9001=jayson[_0x6ee4('0x1a')][_0x6ee4('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x2eca80,_0x4af711,_0x2af5f8,_0x4ba6dc){return new Promise(function(_0x2886c2,_0x4c1192){var _0x9d4ae8=_0x4ba6dc||client;return _0x9d4ae8['request'](_0x2eca80,_0x2af5f8)[_0x6ee4('0x1c')](function(_0x3cdcae){logger[_0x6ee4('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x4af711,_0x6ee4('0x1e'));logger[_0x6ee4('0x1f')](_0x6ee4('0x20'),_0x4af711,'request\x20sent',JSON[_0x6ee4('0x21')](_0x3cdcae));if(_0x3cdcae[_0x6ee4('0x22')]){if(_0x3cdcae[_0x6ee4('0x22')][_0x6ee4('0x23')]===0x1f4){logger[_0x6ee4('0x22')](_0x6ee4('0x24'),_0x4af711,_0x3cdcae[_0x6ee4('0x22')][_0x6ee4('0x25')]);return _0x4c1192(_0x3cdcae[_0x6ee4('0x22')]['message']);}logger[_0x6ee4('0x22')](_0x6ee4('0x24'),_0x4af711,_0x3cdcae[_0x6ee4('0x22')][_0x6ee4('0x25')]);return _0x2886c2(_0x3cdcae[_0x6ee4('0x22')]['message']);}else{logger[_0x6ee4('0x1d')](_0x6ee4('0x24'),_0x4af711,_0x6ee4('0x1e'));_0x2886c2(_0x3cdcae[_0x6ee4('0x26')]['message']);}})[_0x6ee4('0x27')](function(_0x293d0b){logger[_0x6ee4('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x4af711,_0x293d0b);_0x4c1192(_0x293d0b);});});}function respondWithStatusCode(_0x5639e5,_0x520dd2){_0x520dd2=_0x520dd2||0xcc;return function(_0x18efa3){if(_0x18efa3){return _0x5639e5[_0x6ee4('0x28')](_0x520dd2);}return _0x5639e5[_0x6ee4('0x29')](_0x520dd2)[_0x6ee4('0x2a')]();};}function respondWithResult(_0xf76d23,_0x22a43e){_0x22a43e=_0x22a43e||0xc8;return function(_0x5784a0){if(_0x5784a0){return _0xf76d23[_0x6ee4('0x29')](_0x22a43e)[_0x6ee4('0x2b')](_0x5784a0);}};}function respondWithFilteredResult(_0x2eab8a,_0x2fcb80){return function(_0x48b762){if(_0x48b762){var _0x2193b1=typeof _0x2fcb80['offset']==='undefined'&&typeof _0x2fcb80[_0x6ee4('0x2c')]===_0x6ee4('0x2d');var _0x11fafb=_0x48b762[_0x6ee4('0x2e')];var _0x4f1481=_0x2193b1?0x0:_0x2fcb80[_0x6ee4('0x2f')];var _0x1e53f9=_0x2193b1?_0x48b762[_0x6ee4('0x2e')]:_0x2fcb80[_0x6ee4('0x2f')]+_0x2fcb80[_0x6ee4('0x2c')];var _0x4da82d;if(_0x1e53f9>=_0x11fafb){_0x1e53f9=_0x11fafb;_0x4da82d=0xc8;}else{_0x4da82d=0xce;}_0x2eab8a['status'](_0x4da82d);return _0x2eab8a['set'](_0x6ee4('0x30'),_0x4f1481+'-'+_0x1e53f9+'/'+_0x11fafb)[_0x6ee4('0x2b')](_0x48b762);}return null;};}function saveUpdates(_0x33bcb0){return function(_0x132291){if(_0x132291){return _0x132291[_0x6ee4('0x31')](_0x33bcb0)[_0x6ee4('0x1c')](function(_0x19ed72){return _0x19ed72;});}return null;};}function removeEntity(_0x54b88c){return function(_0x5273bc){if(_0x5273bc){return _0x5273bc[_0x6ee4('0x32')]()[_0x6ee4('0x1c')](function(){var _0x2a6d38=_0x5273bc['get']({'plain':!![]});var _0x15d653=_0x6ee4('0x33');return db[_0x6ee4('0x34')][_0x6ee4('0x32')]({'where':{'type':_0x15d653,'resourceId':_0x2a6d38['id']}})[_0x6ee4('0x1c')](function(){return _0x5273bc;});})[_0x6ee4('0x1c')](function(){_0x54b88c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x258e0f){return function(_0x2ec82f){if(!_0x2ec82f){_0x258e0f[_0x6ee4('0x28')](0x194);}return _0x2ec82f;};}function handleError(_0x5a6e44,_0x1de2b4){_0x1de2b4=_0x1de2b4||0x1f4;return function(_0x26abb0){logger[_0x6ee4('0x22')](_0x26abb0['stack']);if(_0x26abb0[_0x6ee4('0x35')]){delete _0x26abb0[_0x6ee4('0x35')];}_0x5a6e44[_0x6ee4('0x29')](_0x1de2b4)['send'](_0x26abb0);};}function createInteractionObject(_0x1215e5,_0x26e5cb,_0x42399c,_0x5eb568){var _0x5f0e3f=require(_0x6ee4('0x36'));var _0x45b871=new _0x5f0e3f();var _0x575e97=_0x45b871[_0x6ee4('0x37')](_0x42399c[_0x6ee4('0x38')])['getResult']();var _0x3b48e3=_0x26e5cb[_0x6ee4('0x39')];if(_0x42399c['cf-connecting-ip']){_0x3b48e3=_0x42399c['cf-connecting-ip'];}else if(_0x42399c[_0x6ee4('0x3a')]){_0x3b48e3=_[_0x6ee4('0x3b')](_0x42399c['x-forwarded-for'][_0x6ee4('0x3c')](','));}return{'ContactId':_0x5eb568['id'],'ChatWebsiteId':_0x1215e5,'from':(_0x5eb568[_0x6ee4('0x3d')]||'')+'\x20'+(_0x5eb568[_0x6ee4('0x3e')]||''),'customerIp':_0x3b48e3,'customerPort':_0x42399c[_0x6ee4('0x3f')]?_0x42399c[_0x6ee4('0x3f')]:null,'referer':_0x26e5cb['referer'],'browserName':_0x575e97['browser'][_0x6ee4('0x35')]&&_0x575e97['browser'][_0x6ee4('0x40')]?util[_0x6ee4('0x41')](_0x6ee4('0x42'),_0x575e97[_0x6ee4('0x43')][_0x6ee4('0x35')],_0x575e97[_0x6ee4('0x43')][_0x6ee4('0x40')]):_0x6ee4('0x44'),'browserVersion':_0x575e97[_0x6ee4('0x43')]['version']||'unknown','osName':util[_0x6ee4('0x41')](_0x6ee4('0x42'),_0x575e97['os'][_0x6ee4('0x35')],_0x575e97['os'][_0x6ee4('0x40')]),'osVersion':_0x575e97['os'][_0x6ee4('0x40')],'deviceModel':_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x46')]&&_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x47')]?util[_0x6ee4('0x41')](_0x6ee4('0x48'),_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x46')],_0x575e97['device'][_0x6ee4('0x47')],_0x575e97['device'][_0x6ee4('0x49')]):null,'deviceVendor':_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x47')],'deviceType':_0x575e97[_0x6ee4('0x45')][_0x6ee4('0x49')],'formData':JSON[_0x6ee4('0x21')](_0x26e5cb)};}exports['index']=function(_0x115a29,_0x19443c){var _0x314963={'include':[{'model':db[_0x6ee4('0x4a')],'as':_0x6ee4('0x4b')}]},_0x303510={},_0x5c4880={'count':0x0,'rows':[]};var _0xa5771a=_[_0x6ee4('0x4c')](db[_0x6ee4('0x4d')][_0x6ee4('0x4e')],function(_0x43b31d){return{'name':_0x43b31d[_0x6ee4('0x4f')],'type':_0x43b31d[_0x6ee4('0x49')]['key']};});_0x303510[_0x6ee4('0x46')]=_[_0x6ee4('0x4c')](_0xa5771a,_0x6ee4('0x35'));_0x303510['query']=_[_0x6ee4('0x50')](_0x115a29[_0x6ee4('0x51')]);_0x303510['filters']=_[_0x6ee4('0x52')](_0x303510[_0x6ee4('0x46')],_0x303510[_0x6ee4('0x51')]);_0x314963[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x303510[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x314963[_0x6ee4('0x53')]=_0x314963['attributes'][_0x6ee4('0x55')]?_0x314963['attributes']:_0x303510[_0x6ee4('0x46')];if(!_0x115a29[_0x6ee4('0x51')]['hasOwnProperty']('nolimit')){_0x314963[_0x6ee4('0x2c')]=qs['limit'](_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x314963['offset']=qs['offset'](_0x115a29[_0x6ee4('0x51')]['offset']);}_0x314963[_0x6ee4('0x56')]=qs[_0x6ee4('0x57')](_0x115a29[_0x6ee4('0x51')]['sort']);_0x314963[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_[_0x6ee4('0x5a')](_0x115a29['query'],_0x303510['filters']),_0xa5771a);if(_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x314963[_0x6ee4('0x58')]=_[_0x6ee4('0x5c')](_0x314963[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0xa5771a,function(_0x51623b){if(_0x51623b[_0x6ee4('0x49')]!==_0x6ee4('0x5d')){var _0x1dfc51={};_0x1dfc51[_0x51623b[_0x6ee4('0x35')]]={'$like':'%'+_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x1dfc51;}})});}_0x314963=_[_0x6ee4('0x5c')]({},_0x314963,_0x115a29[_0x6ee4('0x5e')]);var _0x2dfbbe={'where':_0x314963[_0x6ee4('0x58')]};return db[_0x6ee4('0x4d')][_0x6ee4('0x2e')](_0x2dfbbe)[_0x6ee4('0x1c')](function(_0x37deb3){_0x5c4880[_0x6ee4('0x2e')]=_0x37deb3;if(_0x115a29[_0x6ee4('0x51')][_0x6ee4('0x5f')]){_0x314963[_0x6ee4('0x60')]=[{'all':!![]}];}return db['ChatWebsite'][_0x6ee4('0x61')](_0x314963);})['then'](function(_0x413aa2){_0x5c4880[_0x6ee4('0x62')]=_0x413aa2;return _0x5c4880;})[_0x6ee4('0x1c')](respondWithFilteredResult(_0x19443c,_0x314963))[_0x6ee4('0x27')](handleError(_0x19443c,null));};exports[_0x6ee4('0x63')]=function(_0x3f3480,_0x2683f1){var _0x3e6d47={'raw':![],'where':{'id':_0x3f3480[_0x6ee4('0x64')]['id']},'include':[{'model':db[_0x6ee4('0x4a')],'as':'mandatoryDispositionPause'}]},_0x3f209c={};_0x3f209c[_0x6ee4('0x46')]=_[_0x6ee4('0x50')](db[_0x6ee4('0x4d')]['rawAttributes']);_0x3f209c[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x3f3480[_0x6ee4('0x51')]);_0x3f209c[_0x6ee4('0x59')]=_[_0x6ee4('0x52')](_0x3f209c[_0x6ee4('0x46')],_0x3f209c[_0x6ee4('0x51')]);_0x3e6d47[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x3f209c[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x3f3480[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x3e6d47['attributes']=_0x3e6d47[_0x6ee4('0x53')][_0x6ee4('0x55')]?_0x3e6d47[_0x6ee4('0x53')]:_0x3f209c[_0x6ee4('0x46')];if(_0x3f3480[_0x6ee4('0x51')][_0x6ee4('0x5f')]){_0x3e6d47[_0x6ee4('0x60')]=[{'all':!![]}];}_0x3e6d47=_[_0x6ee4('0x5c')]({},_0x3e6d47,_0x3f3480[_0x6ee4('0x5e')]);return db['ChatWebsite'][_0x6ee4('0x65')](_0x3e6d47)[_0x6ee4('0x1c')](handleEntityNotFound(_0x2683f1,null))[_0x6ee4('0x1c')](respondWithResult(_0x2683f1,null))[_0x6ee4('0x27')](handleError(_0x2683f1,null));};exports[_0x6ee4('0x66')]=function(_0x569bab,_0x16d65c){if(!wildcardUtils['testWildcardValidity'](_0x569bab['body'][_0x6ee4('0x67')])){return handleError(_0x16d65c,null)(new APIBadRequestError('\x22'+_0x569bab[_0x6ee4('0x68')][_0x6ee4('0x67')]+_0x6ee4('0x69')));}return db[_0x6ee4('0x4d')][_0x6ee4('0x66')](_0x569bab['body'],{})[_0x6ee4('0x1c')](function(_0x16dae9){var _0x18fa52=_0x569bab[_0x6ee4('0x6a')][_0x6ee4('0x6b')]({'plain':!![]});if(!_0x18fa52)throw new Error(_0x6ee4('0x6c'));if(_0x18fa52['role']===_0x6ee4('0x6a')){var _0x34d4a7=_0x16dae9[_0x6ee4('0x6b')]({'plain':!![]});var _0x106156='ChatWebsites';return db[_0x6ee4('0x6d')][_0x6ee4('0x65')]({'where':{'name':_0x106156,'userProfileId':_0x18fa52[_0x6ee4('0x6e')]},'raw':!![]})[_0x6ee4('0x1c')](function(_0x3dcb65){if(_0x3dcb65&&_0x3dcb65['autoAssociation']===0x0){return db[_0x6ee4('0x34')][_0x6ee4('0x66')]({'name':_0x34d4a7[_0x6ee4('0x35')],'resourceId':_0x34d4a7['id'],'type':_0x3dcb65[_0x6ee4('0x35')],'sectionId':_0x3dcb65['id']},{})[_0x6ee4('0x1c')](function(){return _0x16dae9;});}else{return _0x16dae9;}})[_0x6ee4('0x27')](function(_0x49498f){logger[_0x6ee4('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49498f);throw _0x49498f;});}return _0x16dae9;})[_0x6ee4('0x1c')](respondWithResult(_0x16d65c,0xc9))[_0x6ee4('0x27')](handleError(_0x16d65c,null));};exports[_0x6ee4('0x31')]=function(_0x372986,_0x5a70ba){if(!wildcardUtils['testWildcardValidity'](_0x372986['body'][_0x6ee4('0x67')])){return handleError(_0x5a70ba,null)(new APIBadRequestError('\x22'+_0x372986[_0x6ee4('0x68')]['address']+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}if(_0x372986['body']['id']){delete _0x372986[_0x6ee4('0x68')]['id'];}return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x372986[_0x6ee4('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0x6ee4('0x4b')}]})['then'](handleEntityNotFound(_0x5a70ba,null))['then'](saveUpdates(_0x372986[_0x6ee4('0x68')],null))['then'](respondWithResult(_0x5a70ba,null))['catch'](handleError(_0x5a70ba,null));};exports[_0x6ee4('0x32')]=function(_0x2d8684,_0x10cae9){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x2d8684[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x10cae9,null))[_0x6ee4('0x1c')](removeEntity(_0x10cae9,null))[_0x6ee4('0x27')](handleError(_0x10cae9,null));};exports[_0x6ee4('0x6f')]=function(_0x102d59,_0x323292){return db[_0x6ee4('0x4d')][_0x6ee4('0x6f')]()[_0x6ee4('0x1c')](respondWithResult(_0x323292,null))[_0x6ee4('0x27')](handleError(_0x323292,null));};exports[_0x6ee4('0x70')]=function(_0x7a3961,_0x5d7b71){if(_0x7a3961[_0x6ee4('0x68')]['id']){delete _0x7a3961['body']['id'];}return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x7a3961['params']['id']}})['then'](handleEntityNotFound(_0x5d7b71,null))['then'](function(_0x723769){if(_0x723769){_0x7a3961['body'][_0x6ee4('0x71')]=_0x723769['id'];return db[_0x6ee4('0x72')][_0x6ee4('0x66')](_0x7a3961[_0x6ee4('0x68')]);}})['then'](respondWithResult(_0x5d7b71,null))[_0x6ee4('0x27')](handleError(_0x5d7b71,null));};exports['getDispositions']=function(_0x58ac9e,_0x5ab1e5){var _0x48ee5f={'raw':![],'where':{}};var _0x12c941={};var _0x257a2a={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x58ac9e[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x5ab1e5,null))[_0x6ee4('0x1c')](function(_0x5c6143){if(_0x5c6143){_0x12c941[_0x6ee4('0x46')]=_[_0x6ee4('0x50')](db[_0x6ee4('0x72')][_0x6ee4('0x4e')]);_0x12c941[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x58ac9e[_0x6ee4('0x51')]);_0x12c941['filters']=_[_0x6ee4('0x52')](_0x12c941[_0x6ee4('0x46')],_0x12c941[_0x6ee4('0x51')]);_0x48ee5f[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x12c941[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x58ac9e['query'][_0x6ee4('0x54')]));_0x48ee5f[_0x6ee4('0x53')]=_0x48ee5f['attributes'][_0x6ee4('0x55')]?_0x48ee5f['attributes']:_0x12c941['model'];if(!_0x58ac9e['query'][_0x6ee4('0x73')]('nolimit')){_0x48ee5f[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x58ac9e[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x48ee5f['offset']=qs['offset'](_0x58ac9e['query'][_0x6ee4('0x2f')]);}_0x48ee5f[_0x6ee4('0x56')]=qs['sort'](_0x58ac9e[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x48ee5f[_0x6ee4('0x58')]=qs['filters'](_['pick'](_0x58ac9e[_0x6ee4('0x51')],_0x12c941[_0x6ee4('0x59')]));_0x48ee5f[_0x6ee4('0x58')][_0x6ee4('0x71')]=_0x5c6143['id'];if(_0x58ac9e[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x48ee5f[_0x6ee4('0x58')]=_[_0x6ee4('0x5c')](_0x48ee5f[_0x6ee4('0x58')],{'$or':_['map'](_0x48ee5f[_0x6ee4('0x53')],function(_0x56ff80){var _0x332e43={};_0x332e43[_0x56ff80]={'$like':'%'+_0x58ac9e[_0x6ee4('0x51')]['filter']+'%'};return _0x332e43;})});}_0x48ee5f=_[_0x6ee4('0x5c')]({},_0x48ee5f,_0x58ac9e[_0x6ee4('0x5e')]);return db[_0x6ee4('0x72')][_0x6ee4('0x2e')]({'where':_0x48ee5f['where']})[_0x6ee4('0x1c')](function(_0xcb434d){_0x257a2a[_0x6ee4('0x2e')]=_0xcb434d;if(_0x58ac9e['query'][_0x6ee4('0x5f')]){_0x48ee5f[_0x6ee4('0x60')]=[{'all':!![]}];}return db[_0x6ee4('0x72')]['findAll'](_0x48ee5f);})[_0x6ee4('0x1c')](function(_0x1e9a22){_0x257a2a[_0x6ee4('0x62')]=_0x1e9a22;return _0x257a2a;});}})[_0x6ee4('0x1c')](respondWithFilteredResult(_0x5ab1e5,_0x48ee5f))[_0x6ee4('0x27')](handleError(_0x5ab1e5,null));};exports[_0x6ee4('0x74')]=function(_0x5c4995,_0x386a3e){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x5c4995['params']['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x386a3e,null))[_0x6ee4('0x1c')](function(_0x277498){if(_0x277498){return _0x277498[_0x6ee4('0x74')](_0x5c4995['query'][_0x6ee4('0x75')]);}})[_0x6ee4('0x1c')](respondWithStatusCode(_0x386a3e,null))[_0x6ee4('0x27')](handleError(_0x386a3e,null));};exports['addAnswer']=function(_0x44d112,_0x846410){if(_0x44d112[_0x6ee4('0x68')]['id']){delete _0x44d112['body']['id'];}return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x44d112[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x846410,null))['then'](function(_0x4f3531){if(_0x4f3531){_0x44d112['body']['ChatWebsiteId']=_0x4f3531['id'];return db[_0x6ee4('0x76')][_0x6ee4('0x66')](_0x44d112[_0x6ee4('0x68')]);}})['then'](respondWithResult(_0x846410,null))[_0x6ee4('0x27')](handleError(_0x846410,null));};exports['getAnswers']=function(_0x3afdd7,_0x16c52a){var _0x472665={'raw':![],'where':{}};var _0x1435ba={};var _0x5daf9c={'count':0x0,'rows':[]};return db[_0x6ee4('0x4d')][_0x6ee4('0x77')]({'where':{'id':_0x3afdd7[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x16c52a,null))[_0x6ee4('0x1c')](function(_0x2b15cb){if(_0x2b15cb){_0x1435ba[_0x6ee4('0x46')]=_['keys'](db[_0x6ee4('0x76')][_0x6ee4('0x4e')]);_0x1435ba[_0x6ee4('0x51')]=_['keys'](_0x3afdd7[_0x6ee4('0x51')]);_0x1435ba[_0x6ee4('0x59')]=_[_0x6ee4('0x52')](_0x1435ba['model'],_0x1435ba[_0x6ee4('0x51')]);_0x472665[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x1435ba[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x3afdd7[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x472665[_0x6ee4('0x53')]=_0x472665[_0x6ee4('0x53')][_0x6ee4('0x55')]?_0x472665[_0x6ee4('0x53')]:_0x1435ba[_0x6ee4('0x46')];if(!_0x3afdd7[_0x6ee4('0x51')]['hasOwnProperty'](_0x6ee4('0x78'))){_0x472665['limit']=qs[_0x6ee4('0x2c')](_0x3afdd7['query'][_0x6ee4('0x2c')]);_0x472665['offset']=qs['offset'](_0x3afdd7[_0x6ee4('0x51')]['offset']);}_0x472665['order']=qs['sort'](_0x3afdd7[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x472665[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_[_0x6ee4('0x5a')](_0x3afdd7[_0x6ee4('0x51')],_0x1435ba[_0x6ee4('0x59')]));_0x472665[_0x6ee4('0x58')]['ChatWebsiteId']=_0x2b15cb['id'];if(_0x3afdd7[_0x6ee4('0x51')]['filter']){_0x472665[_0x6ee4('0x58')]=_[_0x6ee4('0x5c')](_0x472665[_0x6ee4('0x58')],{'$or':_['map'](_0x472665[_0x6ee4('0x53')],function(_0xf66acb){var _0x5218fc={};_0x5218fc[_0xf66acb]={'$like':'%'+_0x3afdd7[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x5218fc;})});}_0x472665=_[_0x6ee4('0x5c')]({},_0x472665,_0x3afdd7[_0x6ee4('0x5e')]);return db[_0x6ee4('0x76')]['count']({'where':_0x472665[_0x6ee4('0x58')]})[_0x6ee4('0x1c')](function(_0x263fa3){_0x5daf9c[_0x6ee4('0x2e')]=_0x263fa3;if(_0x3afdd7[_0x6ee4('0x51')][_0x6ee4('0x5f')]){_0x472665[_0x6ee4('0x60')]=[{'all':!![]}];}return db[_0x6ee4('0x76')][_0x6ee4('0x61')](_0x472665);})[_0x6ee4('0x1c')](function(_0x32b797){_0x5daf9c['rows']=_0x32b797;return _0x5daf9c;});}})['then'](respondWithFilteredResult(_0x16c52a,_0x472665))[_0x6ee4('0x27')](handleError(_0x16c52a,null));};exports[_0x6ee4('0x79')]=function(_0xe4fc98,_0x4328ef){return db['ChatWebsite'][_0x6ee4('0x65')]({'where':{'id':_0xe4fc98[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x4328ef,null))['then'](function(_0x34b30b){if(_0x34b30b){return _0x34b30b[_0x6ee4('0x79')](_0xe4fc98[_0x6ee4('0x51')]['ids']);}})[_0x6ee4('0x1c')](respondWithStatusCode(_0x4328ef,null))[_0x6ee4('0x27')](handleError(_0x4328ef,null));};exports[_0x6ee4('0x7a')]=function(_0x4c284e,_0x427c09){_0x4c284e[_0x6ee4('0x68')][_0x6ee4('0x7b')]=_0x4c284e['file'][_0x6ee4('0x7c')];return db['ChatWebsite'][_0x6ee4('0x65')]({'where':{'id':_0x4c284e[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x427c09,null))[_0x6ee4('0x1c')](saveUpdates(_0x4c284e[_0x6ee4('0x68')],null))[_0x6ee4('0x1c')](respondWithResult(_0x427c09,null))[_0x6ee4('0x27')](handleError(_0x427c09,null));};exports[_0x6ee4('0x7d')]=function(_0x33b36b,_0x3e71d4){_0x33b36b[_0x6ee4('0x68')]['agentAvatar']=_0x33b36b[_0x6ee4('0x7e')]['filename'];return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x33b36b[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x3e71d4,null))[_0x6ee4('0x1c')](saveUpdates(_0x33b36b[_0x6ee4('0x68')],null))[_0x6ee4('0x1c')](respondWithResult(_0x3e71d4,null))[_0x6ee4('0x27')](handleError(_0x3e71d4,null));};exports[_0x6ee4('0x7f')]=function(_0x1f8542,_0x5401bd){_0x1f8542[_0x6ee4('0x68')]['customerAvatar']=_0x1f8542[_0x6ee4('0x7e')]['filename'];return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x1f8542['params']['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x5401bd,null))[_0x6ee4('0x1c')](saveUpdates(_0x1f8542[_0x6ee4('0x68')],null))['then'](respondWithResult(_0x5401bd,null))['catch'](handleError(_0x5401bd,null));};exports['addSystemAvatar']=function(_0x44f74b,_0x2d2d47){_0x44f74b[_0x6ee4('0x68')][_0x6ee4('0x80')]=_0x44f74b[_0x6ee4('0x7e')][_0x6ee4('0x7c')];return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x44f74b[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x2d2d47,null))[_0x6ee4('0x1c')](saveUpdates(_0x44f74b[_0x6ee4('0x68')],null))['then'](respondWithResult(_0x2d2d47,null))['catch'](handleError(_0x2d2d47,null));};exports[_0x6ee4('0x81')]=function(_0x2c366f,_0x52509d){var _0x2b57da=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],'server/files/images/logos/default_logo.svg');var _0x2b54b8={'where':{'id':_0x2c366f[_0x6ee4('0x64')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x48ac0b=![];return require(_0x6ee4('0x84'))['getLicense']()[_0x6ee4('0x1c')](function(_0x47725e){if(_0x47725e){_0x48ac0b=_0x47725e[_0x6ee4('0x85')];}})[_0x6ee4('0x1c')](function(){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')](_0x2b54b8);})['then'](handleEntityNotFound(_0x52509d,null))[_0x6ee4('0x1c')](function(_0x2e0cda){if(_0x2e0cda){if(!_[_0x6ee4('0x86')](_0x2e0cda[_0x6ee4('0x7b')])){if(fs['existsSync'](path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],_0x6ee4('0x87'),_0x2e0cda[_0x6ee4('0x7b')]))&&_0x48ac0b){_0x2b57da=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],_0x6ee4('0x87'),_0x2e0cda['sitepic']);}}return _0x52509d[_0x6ee4('0x88')](_0x2b57da);}})[_0x6ee4('0x27')](handleError(_0x52509d,null));};exports['getAvatar']=function(_0x4390c7,_0x37c866){var _0x434dab=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],_0x6ee4('0x89'));var _0x341b73={'where':{'id':_0x4390c7[_0x6ee4('0x64')]['id']},'attributes':['id',_0x6ee4('0x8a')],'raw':!![]};return db[_0x6ee4('0x4d')]['find'](_0x341b73)[_0x6ee4('0x1c')](handleEntityNotFound(_0x37c866,null))['then'](function(_0x5a5852){if(_0x5a5852){if(!_[_0x6ee4('0x86')](_0x5a5852[_0x6ee4('0x8a')])){if(fs[_0x6ee4('0x8b')](path[_0x6ee4('0x82')](config['root'],'server/files/images/avatars/',_0x5a5852[_0x6ee4('0x8a')]))){_0x434dab=path['join'](config[_0x6ee4('0x83')],_0x6ee4('0x8c'),_0x5a5852[_0x6ee4('0x8a')]);}}return _0x37c866[_0x6ee4('0x88')](_0x434dab);}})[_0x6ee4('0x27')](handleError(_0x37c866,null));};exports[_0x6ee4('0x8d')]=function(_0x3a02fa,_0x47c5ec){var _0x42f9f1=path['join'](config[_0x6ee4('0x83')],_0x6ee4('0x8e'));var _0x1bbd7c={'where':{'id':_0x3a02fa[_0x6ee4('0x64')]['id']},'attributes':['id',_0x6ee4('0x8f'),_0x6ee4('0x90')],'raw':!![]};return db[_0x6ee4('0x4d')][_0x6ee4('0x65')](_0x1bbd7c)[_0x6ee4('0x1c')](handleEntityNotFound(_0x47c5ec,null))[_0x6ee4('0x1c')](function(_0xee57a5){if(_0xee57a5){if(!_[_0x6ee4('0x86')](_0xee57a5['customerAvatar'])){if(fs[_0x6ee4('0x8b')](path[_0x6ee4('0x82')](config['root'],'server/files/images/avatars/',_0xee57a5['customerAvatar']))&&_0xee57a5[_0x6ee4('0x90')]){_0x42f9f1=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],_0x6ee4('0x8c'),_0xee57a5[_0x6ee4('0x8f')]);}}return _0x47c5ec[_0x6ee4('0x88')](_0x42f9f1);}})[_0x6ee4('0x27')](handleError(_0x47c5ec,null));};exports[_0x6ee4('0x91')]=function(_0x111c35,_0x5eaa62){var _0x4135d9=path[_0x6ee4('0x82')](config['root'],_0x6ee4('0x92'));var _0x1e4fbf={'where':{'id':_0x111c35[_0x6ee4('0x64')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x6ee4('0x65')](_0x1e4fbf)[_0x6ee4('0x1c')](handleEntityNotFound(_0x5eaa62,null))[_0x6ee4('0x1c')](function(_0x400c11){if(_0x400c11){if(!_['isNil'](_0x400c11[_0x6ee4('0x80')])){if(fs[_0x6ee4('0x8b')](path['join'](config[_0x6ee4('0x83')],'server/files/images/avatars/',_0x400c11[_0x6ee4('0x80')]))){_0x4135d9=path['join'](config[_0x6ee4('0x83')],'server/files/images/avatars/',_0x400c11[_0x6ee4('0x80')]);}}return _0x5eaa62[_0x6ee4('0x88')](_0x4135d9);}})['catch'](handleError(_0x5eaa62,null));};function checkWebsiteInterval(_0x3acc94){var _0x87f63b=_0x3acc94[_0x6ee4('0x93')];if(!_0x87f63b){return Promise['resolve'](_0x3acc94);}var _0x4c3d02=_0x3acc94[_0x6ee4('0x94')]||undefined;return _0x87f63b[_0x6ee4('0x95')](_0x4c3d02)[_0x6ee4('0x1c')](function(_0x1b65f8){if(!_0x1b65f8){throw new APIOutOfIntervalError();}return _0x3acc94;});}exports[_0x6ee4('0x96')]=function(_0x4e858a,_0x451975){var _0x1dbf0e={'body':_0x4e858a[_0x6ee4('0x68')],'channel':_0x6ee4('0x97')};var _0x2e377c=[];var _0x57a6c4=[];var _0x48df37={};var _0x433eed=![];if(_0x4e858a[_0x6ee4('0x68')]['id']){delete _0x4e858a[_0x6ee4('0x68')]['id'];}if(_[_0x6ee4('0x86')](_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x98')])){throw new APIBadRequestError(_0x6ee4('0x99'));}if(_[_0x6ee4('0x86')](_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9a')])){throw new APIBadRequestError(_0x6ee4('0x9b'));}if(_[_0x6ee4('0x9c')](_0x4e858a['body']['body'])){throw new APIBadRequestError(_0x6ee4('0x9d'));}var _0x102a15=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x39')]&&_0x4e858a['body'][_0x6ee4('0x9e')];return db[_0x6ee4('0x9f')]['describe']()['then'](function(_0x5abd81){if(!_0x5abd81){throw new Error(_0x6ee4('0xa0'));}_0x2e377c=Object['keys'](_0x5abd81)[_0x6ee4('0x5b')](function(_0x4d4b90){return!['createdAt','updatedAt'][_0x6ee4('0xa1')](_0x4d4b90);});_0x57a6c4=Object[_0x6ee4('0x50')](_0x5abd81)['filter'](function(_0x587b72){return![_0x6ee4('0xa2'),'updatedAt','CompanyId',_0x6ee4('0xa3')][_0x6ee4('0xa1')](_0x587b72);});if(!_[_0x6ee4('0xa1')](_0x57a6c4,_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9a')])){throw new APIBadRequestError(_0x6ee4('0xa4')+_0x57a6c4[_0x6ee4('0x82')](',\x20'));}_0x48df37[_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9a')]]=_0x4e858a[_0x6ee4('0x68')]['from'];})['then'](function(){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x4e858a[_0x6ee4('0x64')]['id']},'include':[{'model':db[_0x6ee4('0xa5')],'as':_0x6ee4('0xa6'),'include':[{'model':db['CmContact'],'as':_0x6ee4('0xa7'),'where':_0x48df37,'limit':0x1,'order':[[_0x6ee4('0xa8'),_0x6ee4('0xa9')]]}]},{'model':db[_0x6ee4('0xaa')],'as':_0x6ee4('0xab')},{'model':db[_0x6ee4('0x93')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x6ee4('0xac')],'raw':!![]}]}]});})[_0x6ee4('0x1c')](function(_0x197ba5){if(!_0x197ba5){throw new APINotFoundError(util[_0x6ee4('0x41')](_0x6ee4('0xad'),_0x4e858a['params']['id']));}if(_0x102a15){return checkWebsiteInterval(_0x197ba5);}return _0x197ba5;})[_0x6ee4('0x1c')](function(_0xe860e6){_0x1dbf0e['account']=_0xe860e6;_0x1dbf0e[_0x6ee4('0xae')]=_['orderBy'](_0xe860e6[_0x6ee4('0xab')],[_0x6ee4('0xaf')],['asc']);if(_0x1dbf0e['account'][_0x6ee4('0xab')]){delete _0x1dbf0e['account'][_0x6ee4('0xab')];}_0x1dbf0e['list']=_0xe860e6['List']||{'id':_0xe860e6[_0x6ee4('0xa3')]};if(_0x1dbf0e[_0x6ee4('0xb0')]&&_0x1dbf0e[_0x6ee4('0xb0')][_0x6ee4('0xa7')][_0x6ee4('0x55')]){return _0x1dbf0e['list'][_0x6ee4('0xa7')][0x0];}var _0x230535=_[_0x6ee4('0x15')](_0x4e858a[_0x6ee4('0x68')],{'firstName':_0x4e858a['body'][_0x6ee4('0x98')],'ListId':_0xe860e6[_0x6ee4('0xa3')]});_0x230535[_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9a')]]=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x98')];return db[_0x6ee4('0x9f')]['create'](_0x230535,{'fields':_0x2e377c,'raw':!![]});})['then'](function(_0x110c18){_0x1dbf0e[_0x6ee4('0xb1')]=_0x110c18;var _0x40e45f=createInteractionObject(_0x4e858a[_0x6ee4('0x64')]['id'],_0x4e858a['body'],_0x4e858a[_0x6ee4('0xb2')],_0x110c18);var _0x698ed8={'ChatWebsiteId':_0x4e858a[_0x6ee4('0x64')]['id']};if(_0x4e858a['body'][_0x6ee4('0xb3')]){_0x698ed8['threadId']=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb3')];_0x698ed8[_0x6ee4('0xb4')]=![];return db['ChatInteraction'][_0x6ee4('0x65')]({'where':_0x698ed8})['then'](function(_0x19d48e){var _0x38d053=_0x4e858a[_0x6ee4('0x68')]['customerIp']&&_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x9e')];if(_0x19d48e){_0x433eed=!![];return _0x19d48e;}else if(!_0x38d053&&_0x19d48e&&_0x19d48e[_0x6ee4('0xb4')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x40e45f[_0x6ee4('0xb3')]=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb3')];_0x40e45f['externalUrl']=_0x4e858a['body'][_0x6ee4('0xb5')];return db[_0x6ee4('0xb6')]['create'](_0x40e45f);});}_0x698ed8[_0x6ee4('0xb7')]=_0x110c18['id'];if(_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb8')]&&_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb8')]['id']){_0x698ed8['id']=_0x4e858a[_0x6ee4('0x68')]['interaction']['id'];return db[_0x6ee4('0xb6')][_0x6ee4('0x65')]({'where':_0x698ed8})[_0x6ee4('0x1c')](function(_0x545ea5){var _0x3bd78c=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x39')]&&_0x4e858a['body'][_0x6ee4('0x9e')];if(!_0x3bd78c&&_0x545ea5&&_0x545ea5[_0x6ee4('0xb4')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x545ea5){_0x433eed=!![];return _0x545ea5;}else{return db[_0x6ee4('0xb6')][_0x6ee4('0x66')](_0x40e45f);}});}return db['ChatInteraction'][_0x6ee4('0x66')](_0x40e45f);})[_0x6ee4('0x1c')](function(_0x5844cd){if(!_0x433eed){return _0x5844cd;}var _0x13a5d9={'from':(_0x1dbf0e['contact'][_0x6ee4('0x3d')]||'')+'\x20'+(_0x1dbf0e[_0x6ee4('0xb1')]['lastName']||'')};if(_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb3')]&&_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb9')]&&_0x4e858a['body']['threadId']!=_0x4e858a['body'][_0x6ee4('0xb9')]){_0x13a5d9[_0x6ee4('0xb3')]=_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0xb9')];}return _0x5844cd[_0x6ee4('0x31')](_0x13a5d9);})[_0x6ee4('0x1c')](function(_0x30d491){_0x1dbf0e['interaction']=_0x30d491[_0x6ee4('0x6b')]({'plain':!![]});_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xba')]=!_0x433eed;if(_0x1dbf0e['interaction'][_0x6ee4('0xba')]){if(_0x1dbf0e[_0x6ee4('0xbb')][_0x6ee4('0xbc')]){_0x1dbf0e[_0x6ee4('0xae')][_0x6ee4('0xbd')]({'id':0x0,'priority':_0x1dbf0e[_0x6ee4('0xae')][_0x6ee4('0x55')]+0x1,'app':_0x6ee4('0xbe'),'appdata':_0x6ee4('0xbf'),'interval':_0x6ee4('0xc0')});}}return db[_0x6ee4('0xc1')][_0x6ee4('0x66')]({'body':_0x4e858a[_0x6ee4('0x68')][_0x6ee4('0x68')],'ChatWebsiteId':_0x4e858a[_0x6ee4('0x64')]['id'],'ChatInteractionId':_0x30d491['id'],'direction':'in','ContactId':_0x1dbf0e[_0x6ee4('0xb1')]['id'],'AttachmentId':_0x4e858a[_0x6ee4('0x68')]['AttachmentId']});})[_0x6ee4('0x1c')](function(_0x1afa76){_0x1dbf0e['message']=_0x1afa76;if(!_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xc2')]){return;}return db[_0x6ee4('0xc3')][_0x6ee4('0x65')]({'attributes':['id',_0x6ee4('0x35')],'where':{'id':_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xc2')]}});})[_0x6ee4('0x1c')](function(_0x1bfe88){if(_0x1bfe88){_0x1dbf0e[_0x6ee4('0xae')][_0x6ee4('0xc4')]({'id':0x0,'priority':0x0,'app':_0x6ee4('0xc5'),'appdata':_0x1bfe88[_0x6ee4('0x35')]+','+(_0x1dbf0e[_0x6ee4('0xbb')][_0x6ee4('0xc6')]||0xa),'interval':'*,*,*,*'});_0x1dbf0e[_0x6ee4('0xc7')]=!![];}if(!_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xc8')]){return;}return db['ChatQueue'][_0x6ee4('0x65')]({'attributes':['id',_0x6ee4('0x35')],'where':{'id':_0x1dbf0e[_0x6ee4('0xb8')][_0x6ee4('0xc8')]}});})[_0x6ee4('0x1c')](function(_0x5da74e){if(_0x5da74e){_0x1dbf0e[_0x6ee4('0xae')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5da74e[_0x6ee4('0x35')]+','+(_0x1dbf0e['account'][_0x6ee4('0xc9')]||0x12c),'interval':_0x6ee4('0xc0')});}return respondWithRpcPromise(_0x6ee4('0xca'),_0x6ee4('0xcb'),_0x1dbf0e);})[_0x6ee4('0x1c')](function(_0x5c40e1){respondWithRpcPromise(_0x6ee4('0xcc'),_0x6ee4('0xcc'),{'event':_0x6ee4('0x96'),'message':_0x5c40e1},client9002);return _0x5c40e1;})['then'](respondWithResult(_0x451975,null))[_0x6ee4('0x27')](APIHandleError(_0x451975));};exports['offline']=function(_0x1b1097,_0x49c69e){var _0x5b7182,_0x545a2c,_0x51e539;var _0x18a528=[];var _0xe34109={};var _0x588f32=_0x1b1097[_0x6ee4('0xcd')]||[];var _0x55d681=[];var _0x15d330;return db[_0x6ee4('0x9f')][_0x6ee4('0x6f')]()[_0x6ee4('0x1c')](function(_0x151773){if(!_0x151773){throw new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))](_0x6ee4('0xd0'));}_0x18a528=_['difference'](_[_0x6ee4('0x50')](_0x151773),[_0x6ee4('0xa2'),_0x6ee4('0xa8'),_0x6ee4('0xd1'),_0x6ee4('0xa3')]);if(_0x1b1097['body']['id']){delete _0x1b1097[_0x6ee4('0x68')]['id'];}if(_[_0x6ee4('0x86')](_0x1b1097['body'][_0x6ee4('0x98')])){throw _0x49c69e['status'](0x1f4)[_0x6ee4('0xd2')](new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))](_0x6ee4('0xd3')));}if(_[_0x6ee4('0x86')](_0x1b1097[_0x6ee4('0x68')]['body'])||_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0x68')]===''){throw _0x49c69e['status'](0x1f4)['send'](new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))](_0x6ee4('0xd4')));}if(_[_0x6ee4('0x86')](_0x1b1097['body'][_0x6ee4('0xd5')])){throw _0x49c69e[_0x6ee4('0x29')](0x1f4)[_0x6ee4('0xd2')](new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))](_0x6ee4('0xd6')+_0x18a528));}if(!_['includes'](_0x18a528,_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0xd5')])){throw _0x49c69e[_0x6ee4('0x29')](0x1f4)[_0x6ee4('0xd2')](new db[(_0x6ee4('0xce'))][(_0x6ee4('0xcf'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18a528));}_0xe34109[_0x1b1097['body'][_0x6ee4('0xd5')]]=_0x1b1097[_0x6ee4('0x68')]['from'];})[_0x6ee4('0x1c')](function(){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x1b1097[_0x6ee4('0x64')]['id']},'include':[{'model':db[_0x6ee4('0xa5')],'as':_0x6ee4('0xa6')},{'model':db[_0x6ee4('0xd7')],'as':_0x6ee4('0xd7')}]});})[_0x6ee4('0x1c')](handleEntityNotFound(_0x49c69e,null))['then'](function(_0x1d06e3){if(_0x1d06e3&&_0x1d06e3['List']){_0x545a2c=_0x1d06e3;var _0x265a0c=_[_0x6ee4('0x15')](_0x1b1097[_0x6ee4('0x68')],{'firstName':_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0x98')],'phone':_0x1b1097['body']['from'],'ListId':_0x1d06e3[_0x6ee4('0xa3')]});_0x265a0c[_0x1b1097['body'][_0x6ee4('0xd5')]]=_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0x98')];return db[_0x6ee4('0x9f')]['findOrCreate']({'where':_0xe34109,'defaults':_0x265a0c});}})[_0x6ee4('0xd8')](function(_0x521c4b){if(_0x521c4b){_0x51e539=_0x521c4b;var _0x3eef07=fs[_0x6ee4('0xd9')](path['join'](config[_0x6ee4('0x83')],_0x6ee4('0xda')),'utf8');var _0x5d3c6d=ejs[_0x6ee4('0xdb')](_0x3eef07,{'body':_[_0x6ee4('0xdc')](_0x1b1097[_0x6ee4('0x68')][_0x6ee4('0x68')]),'bodyTitle':_0x545a2c[_0x6ee4('0xdd')]});return db['ChatOfflineMessage'][_0x6ee4('0x66')]({'body':_0x5d3c6d,'plainBody':htmlToText[_0x6ee4('0xde')](_0x5d3c6d),'ContactId':_0x521c4b['id'],'ChatWebsiteId':_0x545a2c['id']});}})[_0x6ee4('0x1c')](function(_0x1ac102){_0x15d330=_0x1ac102;if(_0x588f32['length']){var _0x4bafe4=_0x588f32[_0x6ee4('0x4c')](function(_0x517722){return{'name':_0x517722[_0x6ee4('0xdf')],'basename':_0x517722[_0x6ee4('0x7c')],'type':_0x517722[_0x6ee4('0xe0')],'ChatOfflineMessageId':_0x1ac102['id']};});_0x55d681=_0x4bafe4[_0x6ee4('0x4c')](_0x133982=>{var _0xcbcaa7={'filename':_0x133982[_0x6ee4('0x35')],'path':path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],'server',_0x6ee4('0xcd'),_0x6ee4('0xe1'),_0x6ee4('0xe2'),_0x133982[_0x6ee4('0xe3')])};return _0xcbcaa7;});if(!_0x545a2c[_0x6ee4('0xe4')]){return db['sequelize'][_0x6ee4('0xe5')](function(_0x31b6c6){return db[_0x6ee4('0xe6')][_0x6ee4('0xe7')](_0x4bafe4,{'transaction':_0x31b6c6});});}}})[_0x6ee4('0x1c')](function(){if(_0x15d330){_0x5b7182=_0x15d330;return db[_0x6ee4('0xd7')][_0x6ee4('0x77')]({'where':{'service':!![]},'include':[{'model':db[_0x6ee4('0xe8')],'as':_0x6ee4('0xe9'),'raw':!![],'include':[{'model':db[_0x6ee4('0xea')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x566f57){if(_0x566f57&&_0x566f57['Smtp']&&_0x545a2c[_0x6ee4('0xeb')]&&_0x545a2c[_0x6ee4('0xec')]){var _0x59f2cd=_0x566f57[_0x6ee4('0xed')]();return respondWithRpcPromise(_0x6ee4('0xee'),_0x6ee4('0xef'),{'account':_0x59f2cd,'message':{'from':util['format'](_0x6ee4('0xf0'),_0x566f57[_0x6ee4('0x35')],_0x566f57[_0x6ee4('0xf1')]||_0x566f57[_0x6ee4('0xe9')]['user']),'to':_0x545a2c[_0x6ee4('0xec')],'subject':_0x545a2c[_0x6ee4('0xf2')],'html':_0x5b7182[_0x6ee4('0x68')],'attachments':_0x55d681}},client9003)[_0x6ee4('0x1c')](function(){return _0x5b7182;})['catch'](function(_0x100a5b){logger[_0x6ee4('0x22')](_0x100a5b);});}})[_0x6ee4('0x1c')](function(){if(_0x545a2c&&_0x545a2c[_0x6ee4('0xe4')]&&_0x545a2c['MailAccountId']){var _0x4f5c9e=[];if(_0x588f32['length']){_0x4f5c9e=_0x588f32[_0x6ee4('0x4c')](function(_0x43b99f){return{'name':_0x43b99f[_0x6ee4('0xdf')],'basename':_0x43b99f[_0x6ee4('0x7c')],'type':_0x43b99f[_0x6ee4('0xe0')],'ChatOfflineMessageId':_0x15d330['id']};});}var _0x37137e;if(!_[_0x6ee4('0x86')](_0x545a2c[_0x6ee4('0xf3')])){var _0x18cc73=_[_0x6ee4('0x4c')](_0x1b1097[_0x6ee4('0x68')],function(_0x54aec7){return _0x54aec7;});var _0x4580cd=_[_0x6ee4('0xf4')](_0x18cc73)[0x0];var _0x2c5aba=_[_0x6ee4('0xf5')](_0x4580cd,function(_0xbcc979){return _0xbcc979;});_0x37137e=_0x2c5aba[0x1][_0x545a2c[_0x6ee4('0xf3')]];}var _0x19ef93={'from':_0x51e539[_0x6ee4('0xf1')],'firstName':_0x51e539[_0x6ee4('0x3d')],'lastName':_0x51e539['lastName'],'mapKey':_0x6ee4('0xf1'),'message':{'from':_0x51e539['email'],'to':_0x545a2c[_0x6ee4('0xd7')][_0x6ee4('0xf1')],'cc':'','subject':_[_0x6ee4('0x86')](_0x37137e)?_0x545a2c[_0x6ee4('0xf2')]:_0x37137e,'messageId':'','sentAt':new Date(),'attach':_0x4f5c9e[_0x6ee4('0x55')],'attachments':_0x4f5c9e,'originChannel':_0x6ee4('0xf6'),'ChatWebsiteId':_0x545a2c['id'],'ChatOfflineMessageId':_0x5b7182['id'],'originTo':_0x545a2c[_0x6ee4('0xd7')]['email']},'body':_0x5b7182[_0x6ee4('0x68')]};var _0xc8a872={'account':{'id':_0x545a2c[_0x6ee4('0xf7')]},'body':_0x19ef93,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x6ee4('0xf8'),_0x6ee4('0xf9'),_0xc8a872,client9001)[_0x6ee4('0x1c')](function(){return _0x5b7182;})[_0x6ee4('0x27')](function(_0x321d72){logger[_0x6ee4('0x22')](_0x321d72);});}return;})[_0x6ee4('0x1c')](function(){if(_0x5b7182){return _0x5b7182;}})[_0x6ee4('0x1c')](respondWithResult(_0x49c69e,null))[_0x6ee4('0x27')](function(){for(var _0x4d1406 of _0x588f32){var _0x3cdc9e=path[_0x6ee4('0x82')](config[_0x6ee4('0x83')],'server','files',_0x6ee4('0xe1'),_0x6ee4('0xe2'),_0x4d1406['filename']);fs_extra['remove'](_0x3cdc9e)['catch'](function(_0x4af932){logger[_0x6ee4('0x22')]('Could\x20not\x20remove\x20attachment\x20file',_0x3cdc9e,_0x4af932);});}});};exports[_0x6ee4('0xfa')]=function(_0x1561e8,_0x1200f8){return db[_0x6ee4('0xb6')][_0x6ee4('0x65')]({'where':{'id':_0x1561e8['params']['id']}})['then'](handleEntityNotFound(_0x1200f8,null))[_0x6ee4('0x1c')](function(_0x3d7a6a){if(_0x3d7a6a){return _0x3d7a6a[_0x6ee4('0xfa')](_0x1561e8[_0x6ee4('0x68')][_0x6ee4('0x75')],_['omit'](_0x1561e8[_0x6ee4('0x68')],[_0x6ee4('0x75'),'id'])||{});}})[_0x6ee4('0x1c')](respondWithResult(_0x1200f8,null))[_0x6ee4('0x27')](handleError(_0x1200f8,null));};exports['getInteractions']=function(_0x1ad77b,_0x17f2df){var _0x432ec7={'raw':![],'where':{}};var _0x547298={};var _0x21e7be={'count':0x0,'rows':[]};return db[_0x6ee4('0x4d')]['findOne']({'where':{'id':_0x1ad77b[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x17f2df,null))[_0x6ee4('0x1c')](function(_0x141220){if(_0x141220){_0x547298['model']=_[_0x6ee4('0x50')](db[_0x6ee4('0xb6')][_0x6ee4('0x4e')]);_0x547298[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x1ad77b[_0x6ee4('0x51')]);_0x547298['filters']=_[_0x6ee4('0x52')](_0x547298[_0x6ee4('0x46')],_0x547298[_0x6ee4('0x51')]);_0x432ec7[_0x6ee4('0x53')]=_['intersection'](_0x547298[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x432ec7[_0x6ee4('0x53')]=_0x432ec7[_0x6ee4('0x53')]['length']?_0x432ec7[_0x6ee4('0x53')]:_0x547298[_0x6ee4('0x46')];if(!_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x432ec7[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x432ec7[_0x6ee4('0x2f')]=qs['offset'](_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x2f')]);}_0x432ec7['order']=qs[_0x6ee4('0x57')](_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x432ec7[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_['pick'](_0x1ad77b[_0x6ee4('0x51')],_0x547298[_0x6ee4('0x59')]));_0x432ec7[_0x6ee4('0x58')][_0x6ee4('0x71')]=_0x141220['id'];if(_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x432ec7[_0x6ee4('0x58')]=_['merge'](_0x432ec7[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x432ec7[_0x6ee4('0x53')],function(_0x142d8f){var _0x39ddb6={};_0x39ddb6[_0x142d8f]={'$like':'%'+_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x39ddb6;})});}_0x432ec7=_[_0x6ee4('0x5c')]({},_0x432ec7,_0x1ad77b[_0x6ee4('0x5e')]);return db[_0x6ee4('0xb6')]['count']({'where':_0x432ec7['where']})[_0x6ee4('0x1c')](function(_0x3fc60e){_0x21e7be[_0x6ee4('0x2e')]=_0x3fc60e;if(_0x1ad77b[_0x6ee4('0x51')]['includeAll']){_0x432ec7[_0x6ee4('0x60')]=[{'model':db[_0x6ee4('0x9f')],'as':'Contact','required':![]},{'model':db[_0x6ee4('0xc3')],'as':'Owner','attributes':[_0x6ee4('0x35'),_0x6ee4('0xfb'),_0x6ee4('0xfc')],'required':![]},{'model':db['Tag'],'as':_0x6ee4('0xfd'),'attributes':['id',_0x6ee4('0x35'),'color'],'where':_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0xfe')]?{'id':_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0xfe')]}:undefined,'required':_0x1ad77b[_0x6ee4('0x51')][_0x6ee4('0xfe')]?!![]:![]}];}return db[_0x6ee4('0xb6')][_0x6ee4('0x61')](_0x432ec7);})[_0x6ee4('0x1c')](function(_0x17d405){_0x21e7be[_0x6ee4('0x62')]=_0x17d405;return _0x21e7be;});}})[_0x6ee4('0x1c')](respondWithFilteredResult(_0x17f2df,_0x432ec7))['catch'](handleError(_0x17f2df,null));};exports[_0x6ee4('0xff')]=function(_0x588fb3,_0x45d4f0){var _0x415189=0x0;var _0xfce68e=0x0;var _0x4f6186=![];var _0xd20adc;var _0x1b6033;return db['ChatWebsite'][_0x6ee4('0x65')]({'where':{'id':_0x588fb3['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x6ee4('0x93')],'as':'Intervals','attributes':['id',_0x6ee4('0xac')]}]}]})[_0x6ee4('0x1c')](handleEntityNotFound(_0x45d4f0,null))['then'](function(_0x58a21b){if(_0x58a21b){_0xd20adc=_0x58a21b;return _0x58a21b[_0x6ee4('0x100')]({'raw':!![]});}})['then'](function(_0x453fdb){if(_0xd20adc){if(_0x453fdb){_0x1b6033=_0x453fdb;}}return require(_0x6ee4('0x84'))[_0x6ee4('0x101')]();})[_0x6ee4('0x1c')](function(_0x55d59a){if(_0x55d59a){_0xfce68e=_0x55d59a[_0x6ee4('0x102')];_0x4f6186=_0x55d59a['custom'];}})[_0x6ee4('0x1c')](function(){return db[_0x6ee4('0xb6')]['count']({'where':{'closed':![]}});})['then'](function(_0x23a8ab){_0x415189=_0x23a8ab;if(_0xfce68e&&_0x23a8ab>_0xfce68e){return db[_0x6ee4('0x103')]['findOne']({'where':{'id':0x1}})['then'](function(_0x4267c4){if(_0x4267c4){_0x4267c4[_0x6ee4('0x104')](_0x6ee4('0x105'));}});}})[_0x6ee4('0x1c')](function(){var _0x5a5a66=_0xd20adc['Interval'];var _0x16bd8e=_0xd20adc[_0x6ee4('0x94')]||undefined;return _0x5a5a66?_0x5a5a66[_0x6ee4('0x95')](_0x16bd8e):!![];})[_0x6ee4('0x1c')](function(_0x45a2be){var _0x37f43f=fs[_0x6ee4('0xd9')](path[_0x6ee4('0x82')](config['root'],_0x6ee4('0x106')),'utf8');var _0x2b3189=_0x6ee4('0x107');var _0x58b943=![];try{const _0x32ac65=new URL(_0xd20adc['address']);_0xd20adc[_0x6ee4('0x67')]=_0x32ac65[_0x6ee4('0x108')];}catch(_0x40e571){}var _0x2b8971;if(_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x9e')]){_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x9e')]=_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x9e')][_0x6ee4('0x109')](/\/$/,'');_0x2b8971=wildcardUtils[_0x6ee4('0x10a')](_0xd20adc[_0x6ee4('0x67')],_0x588fb3['headers'][_0x6ee4('0x9e')]);}else{_0x588fb3['headers'][_0x6ee4('0x9e')]=_0xd20adc['address'];_0x2b8971=!![];}var _0x1a1523={'chatVersion':_0x2b3189,'chatWebsiteAddressOrigin':_0x2b8971?_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x9e')]:_0xd20adc['address'],'remote':_0xd20adc['remote'],'query':querystring[_0x6ee4('0x21')](_[_0x6ee4('0x5c')](_0xd20adc['get']({'plain':!![]}),{'customerIp':_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x3a')]||_0x588fb3[_0x6ee4('0xb2')][_0x6ee4('0x10b')]||_0x588fb3[_0x6ee4('0x10c')]['remoteAddress']||_0x588fb3['ip'],'referer':_0x588fb3['headers'][_0x6ee4('0x9e')],'openedInteractions':_0x415189,'maxInteractions':_0xfce68e,'virtual':_0x4f6186['virtual'],'online':_0x45a2be,'custom':_0x4f6186,'address':_0x2b8971?_0x588fb3['headers'][_0x6ee4('0x9e')]:null}))[_0x6ee4('0x109')](/'/g,'\x5c\x27')};_0x45d4f0[_0x6ee4('0xd2')](ejs['render'](Mustache[_0x6ee4('0xdb')](_0x37f43f,_0x1a1523),{'proactiveActions':_0x1b6033,'alignment':_0xd20adc[_0x6ee4('0x10d')],'verticalAlignment':_0xd20adc['verticalAlignment'],'div_color':_0xd20adc[_0x6ee4('0x10e')],'labelText':_0xd20adc[_0x6ee4('0x10f')],'text_color':_0xd20adc[_0x6ee4('0x110')],'text_button_color':_0xd20adc[_0x6ee4('0x111')],'button_color':_0xd20adc['color_button'],'background_color':_0xd20adc[_0x6ee4('0x112')],'hideWhenOffline':_0xd20adc['hideWhenOffline'],'intervalId':_0xd20adc['IntervalId'],'isDevelopment':_0x58b943,'chatVersion':_0x2b3189}));})[_0x6ee4('0x27')](handleError(_0x45d4f0,null));};exports[_0x6ee4('0x113')]=function(_0x2c4419,_0x2857e3){var _0x4eb1a2=_0x2c4419[_0x6ee4('0x64')]['id'];var _0x44be61=_0x2c4419['body'];var _0x384df0=0xc8;var _0x22e51b=null;return db[_0x6ee4('0x114')][_0x6ee4('0xe5')]({'isolationLevel':db[_0x6ee4('0x114')]['Transaction'][_0x6ee4('0x115')][_0x6ee4('0x116')]},function(_0x481021){return db[_0x6ee4('0x4d')]['findOne']({'where':{'id':_0x4eb1a2},'transaction':_0x481021})[_0x6ee4('0x1c')](function(_0x439277){if(_0x439277){return db[_0x6ee4('0xaa')][_0x6ee4('0x32')]({'where':{'ChatWebsiteId':_0x4eb1a2},'transaction':_0x481021})[_0x6ee4('0x1c')](function(){var _0x386398=_['map'](_0x44be61,function(_0x8fdaa3){_0x8fdaa3[_0x6ee4('0x71')]=_0x4eb1a2;return _0x8fdaa3;});return db[_0x6ee4('0xaa')]['bulkCreate'](_0x386398,{'transaction':_0x481021});});}else{_0x384df0=0x194;_0x22e51b=[];}});})[_0x6ee4('0x1c')](function(){if(_0x384df0!==0x194){return db[_0x6ee4('0xaa')][_0x6ee4('0x117')]({'where':{'ChatWebsiteId':_0x4eb1a2},'order':_0x6ee4('0xaf')})[_0x6ee4('0x1c')](function(_0x355c45){_0x22e51b=_0x355c45;});}})[_0x6ee4('0x27')](function(_0x24f4e0){_0x384df0=0x1f4;logger[_0x6ee4('0x22')](_0x24f4e0[_0x6ee4('0x118')]);if(_0x24f4e0[_0x6ee4('0x35')]){delete _0x24f4e0[_0x6ee4('0x35')];}_0x22e51b=_0x24f4e0;})[_0x6ee4('0x119')](function(){if(_0x22e51b===null){_0x2857e3[_0x6ee4('0x28')](_0x384df0);}else{if(_0x384df0===0x1f4){_0x2857e3['status'](_0x384df0)[_0x6ee4('0xd2')](_0x22e51b);}else{_0x2857e3[_0x6ee4('0x29')](_0x384df0)['json'](_0x22e51b);}}});};exports[_0x6ee4('0x11a')]=function(_0x2d1dfa,_0x29b280){var _0x3c029f={};var _0x2a4beb={};var _0x308981;var _0x999e20;return db[_0x6ee4('0x4d')][_0x6ee4('0x77')]({'where':{'id':_0x2d1dfa[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x29b280,null))[_0x6ee4('0x1c')](function(_0x379cb1){if(_0x379cb1){_0x308981=_0x379cb1;_0x2a4beb['model']=_[_0x6ee4('0x50')](db[_0x6ee4('0xaa')]['rawAttributes']);_0x2a4beb['query']=_['keys'](_0x2d1dfa[_0x6ee4('0x51')]);_0x2a4beb[_0x6ee4('0x59')]=_['intersection'](_0x2a4beb[_0x6ee4('0x46')],_0x2a4beb[_0x6ee4('0x51')]);_0x3c029f[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x2a4beb[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x3c029f[_0x6ee4('0x53')]=_0x3c029f[_0x6ee4('0x53')][_0x6ee4('0x55')]?_0x3c029f[_0x6ee4('0x53')]:_0x2a4beb['model'];_0x3c029f['order']=qs[_0x6ee4('0x57')](_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x3c029f[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_[_0x6ee4('0x5a')](_0x2d1dfa['query'],_0x2a4beb['filters']));if(_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x3c029f['where']=_[_0x6ee4('0x5c')](_0x3c029f[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x3c029f[_0x6ee4('0x53')],function(_0x4e3df0){var _0x5417c3={};_0x5417c3[_0x4e3df0]={'$like':'%'+_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x5417c3;})});}_0x3c029f=_[_0x6ee4('0x5c')]({},_0x3c029f,_0x2d1dfa['options']);return _0x308981['getApplications'](_0x3c029f);}})[_0x6ee4('0x1c')](function(_0x386c43){if(_0x386c43){_0x999e20=_0x386c43[_0x6ee4('0x55')];if(!_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x3c029f[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x3c029f[_0x6ee4('0x2f')]=qs[_0x6ee4('0x2f')](_0x2d1dfa[_0x6ee4('0x51')][_0x6ee4('0x2f')]);}return _0x308981[_0x6ee4('0x11a')](_0x3c029f);}})[_0x6ee4('0x1c')](function(_0x59fa6a){if(_0x59fa6a){return _0x59fa6a?{'count':_0x999e20,'rows':_0x59fa6a}:null;}})[_0x6ee4('0x1c')](respondWithResult(_0x29b280,null))[_0x6ee4('0x27')](handleError(_0x29b280,null));};exports[_0x6ee4('0x11b')]=function(_0x5b2f95,_0x470cfc){return db[_0x6ee4('0x11c')][_0x6ee4('0x65')]({'where':{'id':_0x5b2f95[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x470cfc,null))[_0x6ee4('0x1c')](function(_0x5bac39){if(_0x5bac39){return _0x5bac39[_0x6ee4('0x11b')](_0x5b2f95[_0x6ee4('0x68')][_0x6ee4('0x75')],_[_0x6ee4('0x11d')](_0x5b2f95['body'],[_0x6ee4('0x75'),'id'])||{});}})[_0x6ee4('0x1c')](respondWithResult(_0x470cfc,null))[_0x6ee4('0x27')](handleError(_0x470cfc,null));};exports[_0x6ee4('0x100')]=function(_0x49528d,_0x482582){var _0x36d87f={};var _0x36b2d={};var _0x4f4455;var _0x337c0f;return db['ChatWebsite'][_0x6ee4('0x77')]({'where':{'id':_0x49528d[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x482582,null))[_0x6ee4('0x1c')](function(_0x51ed20){if(_0x51ed20){_0x4f4455=_0x51ed20;_0x36b2d['model']=_[_0x6ee4('0x50')](db['ChatProactiveAction'][_0x6ee4('0x4e')]);_0x36b2d[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x49528d[_0x6ee4('0x51')]);_0x36b2d['filters']=_['intersection'](_0x36b2d[_0x6ee4('0x46')],_0x36b2d[_0x6ee4('0x51')]);_0x36d87f[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x36b2d[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x36d87f[_0x6ee4('0x53')]=_0x36d87f[_0x6ee4('0x53')][_0x6ee4('0x55')]?_0x36d87f[_0x6ee4('0x53')]:_0x36b2d['model'];_0x36d87f['order']=qs['sort'](_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x36d87f['where']=qs[_0x6ee4('0x59')](_['pick'](_0x49528d[_0x6ee4('0x51')],_0x36b2d['filters']));if(_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x36d87f['where']=_['merge'](_0x36d87f[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x36d87f[_0x6ee4('0x53')],function(_0x2ad2ef){var _0x5111ac={};_0x5111ac[_0x2ad2ef]={'$like':'%'+_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x5111ac;})});}_0x36d87f=_[_0x6ee4('0x5c')]({},_0x36d87f,_0x49528d[_0x6ee4('0x5e')]);return _0x4f4455[_0x6ee4('0x100')](_0x36d87f);}})['then'](function(_0x1e80d1){if(_0x1e80d1){_0x337c0f=_0x1e80d1[_0x6ee4('0x55')];if(!_0x49528d[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x36d87f[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x49528d[_0x6ee4('0x51')]['limit']);_0x36d87f[_0x6ee4('0x2f')]=qs[_0x6ee4('0x2f')](_0x49528d['query'][_0x6ee4('0x2f')]);}return _0x4f4455[_0x6ee4('0x100')](_0x36d87f);}})['then'](function(_0x31683d){if(_0x31683d){return _0x31683d?{'count':_0x337c0f,'rows':_0x31683d}:null;}})[_0x6ee4('0x1c')](respondWithResult(_0x482582,null))[_0x6ee4('0x27')](handleError(_0x482582,null));};exports[_0x6ee4('0x11e')]=function(_0x14d9dd,_0x2e6160){var _0x4338d2=_0x14d9dd['query'][_0x6ee4('0x11f')]===_0x6ee4('0x120')?_0x6ee4('0x121'):'onlineForm';return db['ChatWebsite'][_0x6ee4('0x65')]({'attributes':['id',_0x4338d2],'where':{'id':_0x14d9dd[_0x6ee4('0x64')]['id']}})['then'](handleEntityNotFound(_0x2e6160,null))[_0x6ee4('0x1c')](function(_0x8083c7){if(_0x8083c7){var _0x2fe4bb=_0x8083c7[_0x4338d2];var _0x1504da=_0x2fe4bb&&_0x2fe4bb[_0x6ee4('0x122')]?_0x2fe4bb['items']:[];_0x2e6160['send']({'fromKey':_[_0x6ee4('0x86')](_0x2fe4bb[_0x6ee4('0x123')])?undefined:_0x2fe4bb[_0x6ee4('0x123')],'count':_0x1504da[_0x6ee4('0x55')],'rows':_0x1504da});}})[_0x6ee4('0x27')](handleError(_0x2e6160,null));};exports['getOfflineMessages']=function(_0x2a75b3,_0x16c23b){var _0x4ca942={'raw':![],'where':{}};var _0x2e4e99={};var _0x709458={'count':0x0,'rows':[]};return db[_0x6ee4('0x4d')]['findOne']({'where':{'id':_0x2a75b3[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x16c23b,null))[_0x6ee4('0x1c')](function(_0x26a59c){if(_0x26a59c){_0x2e4e99[_0x6ee4('0x46')]=_[_0x6ee4('0x50')](db[_0x6ee4('0x124')][_0x6ee4('0x4e')]);_0x2e4e99[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x2a75b3[_0x6ee4('0x51')]);_0x2e4e99['filters']=_[_0x6ee4('0x52')](_0x2e4e99[_0x6ee4('0x46')],_0x2e4e99[_0x6ee4('0x51')]);_0x4ca942[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x2e4e99[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x4ca942['attributes']=_0x4ca942[_0x6ee4('0x53')]['length']?_0x4ca942[_0x6ee4('0x53')]:_0x2e4e99[_0x6ee4('0x46')];if(!_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x4ca942[_0x6ee4('0x2c')]=qs[_0x6ee4('0x2c')](_0x2a75b3['query'][_0x6ee4('0x2c')]);_0x4ca942[_0x6ee4('0x2f')]=qs['offset'](_0x2a75b3['query']['offset']);}_0x4ca942[_0x6ee4('0x56')]=qs[_0x6ee4('0x57')](_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x4ca942[_0x6ee4('0x58')]=qs[_0x6ee4('0x59')](_[_0x6ee4('0x5a')](_0x2a75b3[_0x6ee4('0x51')],_0x2e4e99[_0x6ee4('0x59')]));_0x4ca942['where']['ChatWebsiteId']=_0x26a59c['id'];if(_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x5b')]){_0x4ca942[_0x6ee4('0x58')]=_[_0x6ee4('0x5c')](_0x4ca942[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x4ca942['attributes'],function(_0x2067ad){var _0x369057={};_0x369057[_0x2067ad]={'$like':'%'+_0x2a75b3[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x369057;})});}_0x4ca942=_[_0x6ee4('0x5c')]({},_0x4ca942,_0x2a75b3['options']);return db[_0x6ee4('0x124')]['count']({'where':_0x4ca942[_0x6ee4('0x58')]})['then'](function(_0x338963){_0x709458['count']=_0x338963;if(_0x2a75b3['query']['includeAll']){_0x4ca942[_0x6ee4('0x60')]=[{'all':!![]}];}else{_0x4ca942[_0x6ee4('0x60')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x6ee4('0xe6')],'as':_0x6ee4('0x125'),'required':![]}];}return db[_0x6ee4('0x124')][_0x6ee4('0x61')](_0x4ca942);})[_0x6ee4('0x1c')](function(_0x23e500){_0x709458[_0x6ee4('0x62')]=_0x23e500;return _0x709458;});}})['then'](respondWithFilteredResult(_0x16c23b,_0x4ca942))[_0x6ee4('0x27')](handleError(_0x16c23b,null));};exports[_0x6ee4('0x126')]=function(_0x5002fe,_0x488e31){return db[_0x6ee4('0x4d')][_0x6ee4('0x65')]({'where':{'id':_0x5002fe[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x488e31,null))[_0x6ee4('0x1c')](function(_0xed8a33){if(_0xed8a33){return _0xed8a33[_0x6ee4('0x126')](_0x5002fe[_0x6ee4('0x68')][_0x6ee4('0x75')],_['omit'](_0x5002fe['body'],[_0x6ee4('0x75'),'id'])||{})[_0x6ee4('0xd8')](function(_0x3d250d){for(var _0xdf9e70=0x0;_0xdf9e70<_0x5002fe[_0x6ee4('0x68')][_0x6ee4('0x75')]['length'];_0xdf9e70+=0x1){socket[_0x6ee4('0x127')](_0x6ee4('0x128'),{'UserId':Number(_0x5002fe['body'][_0x6ee4('0x75')][_0xdf9e70]),'ChatWebsiteId':Number(_0x5002fe[_0x6ee4('0x64')]['id'])});}return _0x3d250d;});}})[_0x6ee4('0x1c')](respondWithResult(_0x488e31,null))['catch'](handleError(_0x488e31,null));};exports[_0x6ee4('0x129')]=function(_0x199807,_0x1bb4a2){return db[_0x6ee4('0x4d')]['find']({'where':{'id':_0x199807[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x1bb4a2,null))[_0x6ee4('0x1c')](function(_0x3fe511){if(_0x3fe511){return _0x3fe511[_0x6ee4('0x129')](_0x199807['query']['ids'])[_0x6ee4('0x1c')](function(){if(_[_0x6ee4('0x12a')](_0x199807[_0x6ee4('0x51')][_0x6ee4('0x75')])){for(var _0x2a01ed=0x0;_0x2a01ed<_0x199807[_0x6ee4('0x51')]['ids'][_0x6ee4('0x55')];_0x2a01ed+=0x1){socket[_0x6ee4('0x127')](_0x6ee4('0x12b'),{'UserId':Number(_0x199807[_0x6ee4('0x51')]['ids'][_0x2a01ed]),'ChatWebsiteId':Number(_0x199807[_0x6ee4('0x64')]['id'])});}}else{socket[_0x6ee4('0x127')](_0x6ee4('0x12b'),{'UserId':Number(_0x199807[_0x6ee4('0x51')][_0x6ee4('0x75')]),'ChatWebsiteId':Number(_0x199807[_0x6ee4('0x64')]['id'])});}});}})[_0x6ee4('0x1c')](respondWithStatusCode(_0x1bb4a2,null))[_0x6ee4('0x27')](handleError(_0x1bb4a2,null));};exports[_0x6ee4('0x12c')]=function(_0x31dfe6,_0x4bce61){var _0x3952e7={};var _0x5012f6={};var _0x2eed44;var _0x5eada9;return db[_0x6ee4('0x4d')][_0x6ee4('0x77')]({'where':{'id':_0x31dfe6[_0x6ee4('0x64')]['id']}})[_0x6ee4('0x1c')](handleEntityNotFound(_0x4bce61,null))[_0x6ee4('0x1c')](function(_0x3a75b1){if(_0x3a75b1){_0x2eed44=_0x3a75b1;_0x5012f6[_0x6ee4('0x46')]=_['keys'](db[_0x6ee4('0xc3')][_0x6ee4('0x4e')]);_0x5012f6[_0x6ee4('0x51')]=_[_0x6ee4('0x50')](_0x31dfe6[_0x6ee4('0x51')]);_0x5012f6['filters']=_[_0x6ee4('0x52')](_0x5012f6[_0x6ee4('0x46')],_0x5012f6[_0x6ee4('0x51')]);_0x3952e7[_0x6ee4('0x53')]=_[_0x6ee4('0x52')](_0x5012f6[_0x6ee4('0x46')],qs[_0x6ee4('0x54')](_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x54')]));_0x3952e7[_0x6ee4('0x53')]=_0x3952e7[_0x6ee4('0x53')]['length']?_0x3952e7['attributes']:_0x5012f6['model'];_0x3952e7[_0x6ee4('0x56')]=qs['sort'](_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x57')]);_0x3952e7[_0x6ee4('0x58')]=qs['filters'](_[_0x6ee4('0x5a')](_0x31dfe6[_0x6ee4('0x51')],_0x5012f6[_0x6ee4('0x59')]));if(_0x31dfe6[_0x6ee4('0x51')]['filter']){_0x3952e7['where']=_[_0x6ee4('0x5c')](_0x3952e7[_0x6ee4('0x58')],{'$or':_[_0x6ee4('0x4c')](_0x3952e7[_0x6ee4('0x53')],function(_0x288f14){var _0x3309af={};_0x3309af[_0x288f14]={'$like':'%'+_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x5b')]+'%'};return _0x3309af;})});}_0x3952e7=_[_0x6ee4('0x5c')]({},_0x3952e7,_0x31dfe6[_0x6ee4('0x5e')]);return _0x2eed44['getAgents'](_0x3952e7);}})[_0x6ee4('0x1c')](function(_0x15250f){if(_0x15250f){_0x5eada9=_0x15250f[_0x6ee4('0x55')];if(!_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x73')](_0x6ee4('0x78'))){_0x3952e7['limit']=qs[_0x6ee4('0x2c')](_0x31dfe6[_0x6ee4('0x51')][_0x6ee4('0x2c')]);_0x3952e7[_0x6ee4('0x2f')]=qs['offset'](_0x31dfe6['query']['offset']);}return _0x2eed44[_0x6ee4('0x12c')](_0x3952e7);}})[_0x6ee4('0x1c')](function(_0x4d839e){if(_0x4d839e){return _0x4d839e?{'count':_0x5eada9,'rows':_0x4d839e}:null;}})[_0x6ee4('0x1c')](respondWithResult(_0x4bce61,null))[_0x6ee4('0x27')](handleError(_0x4bce61,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 0ce68f1..96f5dd7 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 _0xad36=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0xe19540,_0x322387){var _0xee5410=function(_0x1a0099){while(--_0x1a0099){_0xe19540['push'](_0xe19540['shift']());}};_0xee5410(++_0x322387);}(_0xad36,0x11c));var _0x6ad3=function(_0x5f09fc,_0x2beba0){_0x5f09fc=_0x5f09fc-0x0;var _0x5537af=_0xad36[_0x5f09fc];return _0x5537af;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x6ad3('0x0'))['db'][_0x6ad3('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6ad3('0x2')](0x0);var events={'afterCreate':_0x6ad3('0x3'),'afterUpdate':_0x6ad3('0x4'),'afterDestroy':_0x6ad3('0x5')};function emitEvent(_0xef54ab){return function(_0x17a9b2,_0x3d8fee,_0x4bc79b){ChatWebsiteEvents[_0x6ad3('0x6')](_0xef54ab+':'+_0x17a9b2['id'],_0x17a9b2);ChatWebsiteEvents[_0x6ad3('0x6')](_0xef54ab,_0x17a9b2);_0x4bc79b(null);};}for(var e in events){if(events[_0x6ad3('0x7')](e)){var event=events[e];ChatWebsite[_0x6ad3('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xdbd0=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4bdbbe,_0x29c144){var _0x340998=function(_0x32d56c){while(--_0x32d56c){_0x4bdbbe['push'](_0x4bdbbe['shift']());}};_0x340998(++_0x29c144);}(_0xdbd0,0x88));var _0x0dbd=function(_0x38a9c7,_0x28d3ef){_0x38a9c7=_0x38a9c7-0x0;var _0x2ab87=_0xdbd0[_0x38a9c7];return _0x2ab87;};'use strict';var EventEmitter=require(_0x0dbd('0x0'));var ChatWebsite=require(_0x0dbd('0x1'))['db'][_0x0dbd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0dbd('0x3')](0x0);var events={'afterCreate':_0x0dbd('0x4'),'afterUpdate':'update','afterDestroy':_0x0dbd('0x5')};function emitEvent(_0x190897){return function(_0x1aeffb,_0x5ec8d7,_0x333815){ChatWebsiteEvents[_0x0dbd('0x6')](_0x190897+':'+_0x1aeffb['id'],_0x1aeffb);ChatWebsiteEvents[_0x0dbd('0x6')](_0x190897,_0x1aeffb);_0x333815(null);};}for(var e in events){if(events[_0x0dbd('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 37f3046..9c9e659 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 _0xb760=['../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','rimraf'];(function(_0x40dc7e,_0x322488){var _0x31f6d4=function(_0x2db5e2){while(--_0x2db5e2){_0x40dc7e['push'](_0x40dc7e['shift']());}};_0x31f6d4(++_0x322488);}(_0xb760,0xb9));var _0x0b76=function(_0x41502b,_0x577b3a){_0x41502b=_0x41502b-0x0;var _0x109f0f=_0xb760[_0x41502b];return _0x109f0f;};'use strict';var _=require(_0x0b76('0x0'));var util=require(_0x0b76('0x1'));var logger=require(_0x0b76('0x2'))(_0x0b76('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0b76('0x4'));var config=require(_0x0b76('0x5'));var attributes=require(_0x0b76('0x6'));module[_0x0b76('0x7')]=function(_0x244c20,_0x50cf57){return _0x244c20['define'](_0x0b76('0x8'),attributes,{'tableName':_0x0b76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x862d=['api','moment','bluebird','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger'];(function(_0x32e1fb,_0x59b069){var _0xc106ee=function(_0x5f0d01){while(--_0x5f0d01){_0x32e1fb['push'](_0x32e1fb['shift']());}};_0xc106ee(++_0x59b069);}(_0x862d,0x1d2));var _0xd862=function(_0x18d278,_0x23925a){_0x18d278=_0x18d278-0x0;var _0x51bf38=_0x862d[_0x18d278];return _0x51bf38;};'use strict';var _=require(_0xd862('0x0'));var util=require('util');var logger=require(_0xd862('0x1'))(_0xd862('0x2'));var moment=require(_0xd862('0x3'));var BPromise=require(_0xd862('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd862('0x5'));var rimraf=require(_0xd862('0x6'));var config=require('../../config/environment');var attributes=require(_0xd862('0x7'));module[_0xd862('0x8')]=function(_0x1b2d24,_0x248a48){return _0x1b2d24[_0xd862('0x9')](_0xd862('0xa'),attributes,{'tableName':_0xd862('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 4aaea24..a967312 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 _0xfaaf=['socket.io-emitter','./chatWebsite.socket','register','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost'];(function(_0x39fbbc,_0x9d36ab){var _0x1c171d=function(_0x2d00e7){while(--_0x2d00e7){_0x39fbbc['push'](_0x39fbbc['shift']());}};_0x1c171d(++_0x9d36ab);}(_0xfaaf,0x139));var _0xffaa=function(_0x109371,_0x441c8e){_0x109371=_0x109371-0x0;var _0x4fd858=_0xfaaf[_0x109371];return _0x4fd858;};'use strict';var _=require(_0xffaa('0x0'));var util=require('util');var moment=require(_0xffaa('0x1'));var BPromise=require(_0xffaa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffaa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xffaa('0x4'));var logger=require(_0xffaa('0x5'))(_0xffaa('0x6'));var config=require('../../config/environment');var jayson=require(_0xffaa('0x7'));var client=jayson[_0xffaa('0x8')][_0xffaa('0x9')]({'port':0x232a});config['redis']=_[_0xffaa('0xa')](config['redis'],{'host':_0xffaa('0xb'),'port':0x18eb});var socket=require(_0xffaa('0xc'))(new Redis(config['redis']));require(_0xffaa('0xd'))[_0xffaa('0xe')](socket);function respondWithRpcPromise(_0x3493ba,_0x62302d,_0x11a6a6){return new BPromise(function(_0x5de6c8,_0x35e4ff){return client['request'](_0x3493ba,_0x11a6a6)['then'](function(_0x1bb066){logger['info'](_0xffaa('0xf'),_0x62302d,'request\x20sent');logger[_0xffaa('0x10')](_0xffaa('0x11'),_0x62302d,_0xffaa('0x12'),JSON[_0xffaa('0x13')](_0x1bb066));if(_0x1bb066[_0xffaa('0x14')]){if(_0x1bb066['error'][_0xffaa('0x15')]===0x1f4){logger['error'](_0xffaa('0xf'),_0x62302d,_0x1bb066[_0xffaa('0x14')][_0xffaa('0x16')]);return _0x35e4ff(_0x1bb066[_0xffaa('0x14')]['message']);}logger[_0xffaa('0x14')](_0xffaa('0xf'),_0x62302d,_0x1bb066[_0xffaa('0x14')][_0xffaa('0x16')]);return _0x5de6c8(_0x1bb066[_0xffaa('0x14')][_0xffaa('0x16')]);}else{logger[_0xffaa('0x17')](_0xffaa('0xf'),_0x62302d,_0xffaa('0x12'));_0x5de6c8(_0x1bb066[_0xffaa('0x18')][_0xffaa('0x16')]);}})['catch'](function(_0x42ebf3){logger[_0xffaa('0x14')](_0xffaa('0xf'),_0x62302d,_0x42ebf3);_0x35e4ff(_0x42ebf3);});});}
\ No newline at end of file
+var _0x1037=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result'];(function(_0x117792,_0x32582c){var _0x305c60=function(_0x4a6202){while(--_0x4a6202){_0x117792['push'](_0x117792['shift']());}};_0x305c60(++_0x32582c);}(_0x1037,0x153));var _0x7103=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x1037[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x7103('0x0'));var util=require('util');var moment=require(_0x7103('0x1'));var BPromise=require('bluebird');var rs=require(_0x7103('0x2'));var fs=require('fs');var Redis=require(_0x7103('0x3'));var db=require(_0x7103('0x4'))['db'];var utils=require(_0x7103('0x5'));var logger=require(_0x7103('0x6'))(_0x7103('0x7'));var config=require(_0x7103('0x8'));var jayson=require(_0x7103('0x9'));var client=jayson['client'][_0x7103('0xa')]({'port':0x232a});config[_0x7103('0xb')]=_[_0x7103('0xc')](config[_0x7103('0xb')],{'host':_0x7103('0xd'),'port':0x18eb});var socket=require(_0x7103('0xe'))(new Redis(config[_0x7103('0xb')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x2a0fee,_0x3a6258,_0x51db87){return new BPromise(function(_0x15773c,_0x3ad160){return client[_0x7103('0xf')](_0x2a0fee,_0x51db87)[_0x7103('0x10')](function(_0x10c2ae){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3a6258,_0x7103('0x11'));logger[_0x7103('0x12')](_0x7103('0x13'),_0x3a6258,_0x7103('0x11'),JSON[_0x7103('0x14')](_0x10c2ae));if(_0x10c2ae[_0x7103('0x15')]){if(_0x10c2ae['error']['code']===0x1f4){logger[_0x7103('0x15')](_0x7103('0x16'),_0x3a6258,_0x10c2ae[_0x7103('0x15')]['message']);return _0x3ad160(_0x10c2ae[_0x7103('0x15')][_0x7103('0x17')]);}logger[_0x7103('0x15')](_0x7103('0x16'),_0x3a6258,_0x10c2ae['error'][_0x7103('0x17')]);return _0x15773c(_0x10c2ae[_0x7103('0x15')][_0x7103('0x17')]);}else{logger['info'](_0x7103('0x16'),_0x3a6258,_0x7103('0x11'));_0x15773c(_0x10c2ae[_0x7103('0x18')]['message']);}})[_0x7103('0x19')](function(_0x7b683e){logger[_0x7103('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x3a6258,_0x7b683e);_0x3ad160(_0x7b683e);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8d61396..5e3f255 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 _0x2de1=['removeListener','register','chatWebsite:','save','remove','update'];(function(_0x5e3ba8,_0x330069){var _0x442f6c=function(_0xb3a7f){while(--_0xb3a7f){_0x5e3ba8['push'](_0x5e3ba8['shift']());}};_0x442f6c(++_0x330069);}(_0x2de1,0x6f));var _0x12de=function(_0x3ff6fb,_0x4f56f4){_0x3ff6fb=_0x3ff6fb-0x0;var _0x15f6e3=_0x2de1[_0x3ff6fb];return _0x15f6e3;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x12de('0x0'),_0x12de('0x1'),_0x12de('0x2')];function createListener(_0x4914c8,_0x49ee78){return function(_0x13b620){_0x49ee78['emit'](_0x4914c8,_0x13b620);};}function removeListener(_0x1fe4ec,_0x236644){return function(){ChatWebsiteEvents[_0x12de('0x3')](_0x1fe4ec,_0x236644);};}exports[_0x12de('0x4')]=function(_0x2e6cf4){for(var _0xe4946d=0x0,_0x47e5a0=events['length'];_0xe4946d<_0x47e5a0;_0xe4946d++){var _0x1c11cc=events[_0xe4946d];var _0x10d8ff=createListener(_0x12de('0x5')+_0x1c11cc,_0x2e6cf4);ChatWebsiteEvents['on'](_0x1c11cc,_0x10d8ff);}};
\ No newline at end of file
+var _0x433e=['removeListener','register','chatWebsite:','./chatWebsite.events','save','remove','emit'];(function(_0x364390,_0x46b408){var _0x3cf60d=function(_0x551d05){while(--_0x551d05){_0x364390['push'](_0x364390['shift']());}};_0x3cf60d(++_0x46b408);}(_0x433e,0xf8));var _0xe433=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x433e[_0x20a584];return _0x4b41a8;};'use strict';var ChatWebsiteEvents=require(_0xe433('0x0'));var events=[_0xe433('0x1'),_0xe433('0x2'),'update'];function createListener(_0x38472e,_0x394fc1){return function(_0x166975){_0x394fc1[_0xe433('0x3')](_0x38472e,_0x166975);};}function removeListener(_0x2e996a,_0x4792af){return function(){ChatWebsiteEvents[_0xe433('0x4')](_0x2e996a,_0x4792af);};}exports[_0xe433('0x5')]=function(_0x2fadd8){for(var _0x2ab33a=0x0,_0x5e953a=events['length'];_0x2ab33a<_0x5e953a;_0x2ab33a++){var _0x49b7e2=events[_0x2ab33a];var _0x488088=createListener(_0xe433('0x6')+_0x49b7e2,_0x2fadd8);ChatWebsiteEvents['on'](_0x49b7e2,_0x488088);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index c66f900..c1927eb 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6170=['([\x5cw]+)','test','exports','../../../utils/misc','escapeRegExp','url','URL','replace','localhost'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6170,0x17d));var _0x0617=function(_0x2eb0d6,_0x3d73db){_0x2eb0d6=_0x2eb0d6-0x0;var _0x8b4f8=_0x6170[_0x2eb0d6];return _0x8b4f8;};var escapeRegExp=require(_0x0617('0x0'))[_0x0617('0x1')];var URL=require(_0x0617('0x2'))[_0x0617('0x3')];function testWildcardValidity(_0x532d4e){let _0x1b262d=!![];try{new URL(_0x532d4e[_0x0617('0x4')]('*',_0x0617('0x5')));}catch(_0x4f4584){_0x1b262d=![];}return _0x1b262d&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x532d4e);}function testWebsiteWithWildcard(_0x533a29,_0xf7b877){let _0x4cb118;const _0x3bffba=escapeRegExp(_0x533a29)[_0x0617('0x4')]('\x5c*',_0x0617('0x6'));try{new URL(_0x533a29[_0x0617('0x4')]('\x5c*',_0x0617('0x5')));_0x4cb118=new RegExp(_0x3bffba)[_0x0617('0x7')](_0xf7b877);}catch(_0x8de8b3){_0x4cb118=![];}return _0x4cb118;}module[_0x0617('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x0624=['exports','replace','localhost','test','([\x5cw]+)'];(function(_0x4e3ac5,_0x18d402){var _0x3b408f=function(_0xd0214a){while(--_0xd0214a){_0x4e3ac5['push'](_0x4e3ac5['shift']());}};_0x3b408f(++_0x18d402);}(_0x0624,0x132));var _0x4062=function(_0x50b8dc,_0x1a6352){_0x50b8dc=_0x50b8dc-0x0;var _0x439b2a=_0x0624[_0x50b8dc];return _0x439b2a;};var escapeRegExp=require('../../../utils/misc')['escapeRegExp'];var URL=require('url')['URL'];function testWildcardValidity(_0x2d6840){let _0x144406=!![];try{new URL(_0x2d6840[_0x4062('0x0')]('*',_0x4062('0x1')));}catch(_0x29add8){_0x144406=![];}return _0x144406&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x4062('0x2')](_0x2d6840);}function testWebsiteWithWildcard(_0x4bb157,_0x553d08){let _0x353a85;const _0x2ec6dd=escapeRegExp(_0x4bb157)[_0x4062('0x0')]('\x5c*',_0x4062('0x3'));try{new URL(_0x4bb157[_0x4062('0x0')]('\x5c*','localhost'));_0x353a85=new RegExp(_0x2ec6dd)[_0x4062('0x2')](_0x553d08);}catch(_0x4b36f6){_0x353a85=![];}return _0x353a85;}module[_0x4062('0x4')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 71c6601..70b2d9a 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 _0x6ce5=['/:id/users','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','file','server/files/images/avatars/','addAvatar','originalname','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','/:id','destroy','removeAnswers','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getOfflineMessages'];(function(_0xfb9aa7,_0x1bfc34){var _0xe996d7=function(_0x175c01){while(--_0x175c01){_0xfb9aa7['push'](_0xfb9aa7['shift']());}};_0xe996d7(++_0x1bfc34);}(_0x6ce5,0xaf));var _0x56ce=function(_0x588a94,_0x18540b){_0x588a94=_0x588a94-0x0;var _0x2bb5fc=_0x6ce5[_0x588a94];return _0x2bb5fc;};'use strict';var multer=require(_0x56ce('0x0'));var util=require(_0x56ce('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56ce('0x2'));var router=express['Router']();var fs_extra=require(_0x56ce('0x3'));var auth=require(_0x56ce('0x4'));var interaction=require(_0x56ce('0x5'));var config=require(_0x56ce('0x6'));var controller=require(_0x56ce('0x7'));router[_0x56ce('0x8')]('/',auth['isAuthenticated'](),controller[_0x56ce('0x9')]);router[_0x56ce('0x8')](_0x56ce('0xa'),auth[_0x56ce('0xb')](),controller[_0x56ce('0xc')]);router[_0x56ce('0x8')]('/:id',auth[_0x56ce('0xb')](),controller['show']);router[_0x56ce('0x8')](_0x56ce('0xd'),auth[_0x56ce('0xb')](),controller[_0x56ce('0xe')]);router[_0x56ce('0x8')](_0x56ce('0xf'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x10')]);router['get'](_0x56ce('0x11'),controller['getLogo']);router['get'](_0x56ce('0x12'),controller[_0x56ce('0x13')]);router[_0x56ce('0x8')]('/:id/customer_avatar',controller[_0x56ce('0x14')]);router[_0x56ce('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x56ce('0x8')](_0x56ce('0x15'),auth[_0x56ce('0xb')](),controller['getInteractions']);router[_0x56ce('0x8')](_0x56ce('0x16'),controller[_0x56ce('0x17')]);router[_0x56ce('0x8')](_0x56ce('0x18'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x19')]);router[_0x56ce('0x8')](_0x56ce('0x1a'),auth['isAuthenticated'](),controller[_0x56ce('0x1b')]);router['get']('/:id/fields',controller['getFields']);router[_0x56ce('0x8')]('/:id/offline_messages',auth[_0x56ce('0xb')](),controller[_0x56ce('0x1c')]);router['get'](_0x56ce('0x1d'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x1e')]);router[_0x56ce('0x1f')]('/',auth[_0x56ce('0xb')](),controller[_0x56ce('0x20')]);router[_0x56ce('0x1f')](_0x56ce('0xd'),auth[_0x56ce('0xb')](),controller['addDisposition']);router['post'](_0x56ce('0xf'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x21')]);var upload=multer({'storage':multer[_0x56ce('0x22')]({'destination':function(_0x5ebdda,_0x37b29c,_0x5de222){_0x5de222(null,path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x25')));},'filename':function(_0x349328,_0x58b4e3,_0x555cc1){_0x555cc1(null,util[_0x56ce('0x26')](_0x56ce('0x27'),Date[_0x56ce('0x28')](),_0x58b4e3['originalname']));}})});router[_0x56ce('0x1f')](_0x56ce('0x11'),upload[_0x56ce('0x29')](_0x56ce('0x2a')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4f9cff,_0x11954d,_0x98fbcd){_0x98fbcd(null,path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x2b')));},'filename':function(_0x1409f6,_0x9753ab,_0x29bcfc){_0x29bcfc(null,util[_0x56ce('0x26')]('%s-%s',Date[_0x56ce('0x28')](),_0x9753ab['originalname']));}})});router[_0x56ce('0x1f')](_0x56ce('0x12'),upload['single'](_0x56ce('0x2a')),controller[_0x56ce('0x2c')]);var upload=multer({'storage':multer[_0x56ce('0x22')]({'destination':function(_0x5c457e,_0xdf8498,_0x15a17e){_0x15a17e(null,path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x2b')));},'filename':function(_0x4b4385,_0x464928,_0x5c6238){_0x5c6238(null,util[_0x56ce('0x26')](_0x56ce('0x27'),Date['now'](),_0x464928[_0x56ce('0x2d')]));}})});router[_0x56ce('0x1f')](_0x56ce('0x2e'),upload[_0x56ce('0x29')](_0x56ce('0x2a')),controller[_0x56ce('0x2f')]);var upload=multer({'storage':multer[_0x56ce('0x22')]({'destination':function(_0x3ed0c5,_0xf15233,_0x21b04a){_0x21b04a(null,path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x2b')));},'filename':function(_0x2f2e74,_0x531171,_0x910c52){_0x910c52(null,util[_0x56ce('0x26')](_0x56ce('0x27'),Date[_0x56ce('0x28')](),_0x531171[_0x56ce('0x2d')]));}})});router[_0x56ce('0x1f')](_0x56ce('0x30'),upload[_0x56ce('0x29')](_0x56ce('0x2a')),controller[_0x56ce('0x31')]);router[_0x56ce('0x1f')](_0x56ce('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x25f513,_0x43f810,_0x4e522e){const _0x33fa1e=path[_0x56ce('0x23')](config[_0x56ce('0x24')],_0x56ce('0x33'),'attachments','offline-chat');fs_extra['ensureDir'](_0x33fa1e,function(){_0x4e522e(null,_0x33fa1e);});},'filename':function(_0x5d2dd9,_0x23535b,_0x4bafc9){const _0x3d542b=_0x23535b[_0x56ce('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4dd5f2=path[_0x56ce('0x34')](_0x3d542b);const _0x5beb36=Date['now']()+'-'+_0x3d542b['replace'](_0x4dd5f2,'')+_0x4dd5f2;_0x4bafc9(null,_0x5beb36);}})});router[_0x56ce('0x1f')](_0x56ce('0x35'),offlineUploadMulter[_0x56ce('0x36')](),controller[_0x56ce('0x37')]);router[_0x56ce('0x1f')](_0x56ce('0x15'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x38')]);router[_0x56ce('0x1f')](_0x56ce('0x18'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x39')]);router['post'](_0x56ce('0x1a'),auth['isAuthenticated'](),controller[_0x56ce('0x3a')]);router[_0x56ce('0x1f')](_0x56ce('0x1d'),auth['isAuthenticated'](),controller[_0x56ce('0x3b')]);router[_0x56ce('0x3c')]('/:id',auth[_0x56ce('0xb')](),controller[_0x56ce('0x3d')]);router[_0x56ce('0x3e')](_0x56ce('0x3f'),auth['isAuthenticated'](),controller[_0x56ce('0x40')]);router[_0x56ce('0x3e')](_0x56ce('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x56ce('0x3e')]('/:id/canned_answers',auth[_0x56ce('0xb')](),controller[_0x56ce('0x41')]);router['delete'](_0x56ce('0x1d'),auth[_0x56ce('0xb')](),controller[_0x56ce('0x42')]);module[_0x56ce('0x43')]=router;
\ No newline at end of file
+var _0x0bc4=['getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','now','originalname','/:id/logo','file','addLogo','%s-%s','addAvatar','diskStorage','single','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions'];(function(_0x380dcc,_0x3648aa){var _0x1b5915=function(_0x5ea9ef){while(--_0x5ea9ef){_0x380dcc['push'](_0x380dcc['shift']());}};_0x1b5915(++_0x3648aa);}(_0x0bc4,0x1a5));var _0x40bc=function(_0x40753a,_0x4f8ec6){_0x40753a=_0x40753a-0x0;var _0x516d00=_0x0bc4[_0x40753a];return _0x516d00;};'use strict';var multer=require(_0x40bc('0x0'));var util=require(_0x40bc('0x1'));var path=require(_0x40bc('0x2'));var timeout=require(_0x40bc('0x3'));var express=require(_0x40bc('0x4'));var router=express[_0x40bc('0x5')]();var fs_extra=require(_0x40bc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x40bc('0x7'));var config=require(_0x40bc('0x8'));var controller=require('./chatWebsite.controller');router[_0x40bc('0x9')]('/',auth[_0x40bc('0xa')](),controller[_0x40bc('0xb')]);router[_0x40bc('0x9')](_0x40bc('0xc'),auth[_0x40bc('0xa')](),controller['describe']);router[_0x40bc('0x9')](_0x40bc('0xd'),auth[_0x40bc('0xa')](),controller[_0x40bc('0xe')]);router[_0x40bc('0x9')](_0x40bc('0xf'),auth[_0x40bc('0xa')](),controller['getDispositions']);router['get'](_0x40bc('0x10'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x11')]);router[_0x40bc('0x9')]('/:id/logo',controller[_0x40bc('0x12')]);router['get'](_0x40bc('0x13'),controller['getAvatar']);router[_0x40bc('0x9')](_0x40bc('0x14'),controller[_0x40bc('0x15')]);router[_0x40bc('0x9')](_0x40bc('0x16'),controller['getSystemAvatar']);router[_0x40bc('0x9')]('/:id/interactions',auth[_0x40bc('0xa')](),controller[_0x40bc('0x17')]);router[_0x40bc('0x9')](_0x40bc('0x18'),controller[_0x40bc('0x19')]);router[_0x40bc('0x9')](_0x40bc('0x1a'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x1b')]);router[_0x40bc('0x9')](_0x40bc('0x1c'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x1d')]);router['get'](_0x40bc('0x1e'),controller[_0x40bc('0x1f')]);router[_0x40bc('0x9')](_0x40bc('0x20'),auth['isAuthenticated'](),controller[_0x40bc('0x21')]);router['get'](_0x40bc('0x22'),auth[_0x40bc('0xa')](),controller['getAgents']);router[_0x40bc('0x23')]('/',auth[_0x40bc('0xa')](),controller['create']);router[_0x40bc('0x23')]('/:id/dispositions',auth[_0x40bc('0xa')](),controller[_0x40bc('0x24')]);router[_0x40bc('0x23')]('/:id/canned_answers',auth[_0x40bc('0xa')](),controller[_0x40bc('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x533a8b,_0x431ecd,_0x3b10bd){_0x3b10bd(null,path[_0x40bc('0x26')](config[_0x40bc('0x27')],_0x40bc('0x28')));},'filename':function(_0x105755,_0x4e12c6,_0x1eb66e){_0x1eb66e(null,util[_0x40bc('0x29')]('%s-%s',Date[_0x40bc('0x2a')](),_0x4e12c6[_0x40bc('0x2b')]));}})});router[_0x40bc('0x23')](_0x40bc('0x2c'),upload['single'](_0x40bc('0x2d')),controller[_0x40bc('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dd976,_0x504826,_0x59d0af){_0x59d0af(null,path[_0x40bc('0x26')](config[_0x40bc('0x27')],'server/files/images/avatars/'));},'filename':function(_0x3eae0b,_0x5598c1,_0x35013e){_0x35013e(null,util['format'](_0x40bc('0x2f'),Date[_0x40bc('0x2a')](),_0x5598c1[_0x40bc('0x2b')]));}})});router[_0x40bc('0x23')]('/:id/avatar',upload['single']('file'),controller[_0x40bc('0x30')]);var upload=multer({'storage':multer[_0x40bc('0x31')]({'destination':function(_0x32ba43,_0x493677,_0x235e41){_0x235e41(null,path[_0x40bc('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xea153b,_0x3ad4f8,_0x238366){_0x238366(null,util[_0x40bc('0x29')](_0x40bc('0x2f'),Date[_0x40bc('0x2a')](),_0x3ad4f8['originalname']));}})});router[_0x40bc('0x23')]('/:id/customer_avatar',upload[_0x40bc('0x32')](_0x40bc('0x2d')),controller[_0x40bc('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2fa0ec,_0x1f9f8a,_0x14c4fb){_0x14c4fb(null,path[_0x40bc('0x26')](config[_0x40bc('0x27')],_0x40bc('0x34')));},'filename':function(_0x649c15,_0x186aee,_0x39405d){_0x39405d(null,util[_0x40bc('0x29')](_0x40bc('0x2f'),Date[_0x40bc('0x2a')](),_0x186aee['originalname']));}})});router['post'](_0x40bc('0x16'),upload['single'](_0x40bc('0x2d')),controller[_0x40bc('0x35')]);router[_0x40bc('0x23')](_0x40bc('0x36'),controller[_0x40bc('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3b3767,_0x34b3e2,_0x153863){const _0x2ec81f=path[_0x40bc('0x26')](config['root'],_0x40bc('0x38'),_0x40bc('0x39'),'offline-chat');fs_extra[_0x40bc('0x3a')](_0x2ec81f,function(){_0x153863(null,_0x2ec81f);});},'filename':function(_0x36a20c,_0xacce26,_0x1421bc){const _0x583e46=_0xacce26['originalname'][_0x40bc('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5c8017=path[_0x40bc('0x3c')](_0x583e46);const _0x1b307a=Date[_0x40bc('0x2a')]()+'-'+_0x583e46[_0x40bc('0x3b')](_0x5c8017,'')+_0x5c8017;_0x1421bc(null,_0x1b307a);}})});router['post']('/:id/offline',offlineUploadMulter[_0x40bc('0x3d')](),controller[_0x40bc('0x3e')]);router[_0x40bc('0x23')](_0x40bc('0x3f'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x40')]);router['post'](_0x40bc('0x1a'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x41')]);router['post'](_0x40bc('0x1c'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x42')]);router[_0x40bc('0x23')](_0x40bc('0x22'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x43')]);router[_0x40bc('0x44')](_0x40bc('0xd'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x45')]);router['delete'](_0x40bc('0xd'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x46')]);router[_0x40bc('0x47')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x40bc('0x48')]);router[_0x40bc('0x47')](_0x40bc('0x10'),auth[_0x40bc('0xa')](),controller[_0x40bc('0x49')]);router[_0x40bc('0x47')](_0x40bc('0x22'),auth['isAuthenticated'](),controller[_0x40bc('0x4a')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 86adbaa..4e54fd3 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 _0xc0f9=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','beaver-logger/server','express','../config/environment','Router','env'];(function(_0x1d2ca4,_0x469af6){var _0x35398a=function(_0x3638f6){while(--_0x3638f6){_0x1d2ca4['push'](_0x1d2ca4['shift']());}};_0x35398a(++_0x469af6);}(_0xc0f9,0xa4));var _0x9c0f=function(_0xc3aae7,_0x3bfa91){_0xc3aae7=_0xc3aae7-0x0;var _0x1f365a=_0xc0f9[_0xc3aae7];return _0x1f365a;};var beaverLogger=require(_0x9c0f('0x0'));var express=require(_0x9c0f('0x1'));var auth=require('../components/auth/service');var config=require(_0x9c0f('0x2'));var router=express[_0x9c0f('0x3')]();var isProduction=config[_0x9c0f('0x4')]===_0x9c0f('0x5')||![];function clientSideLogs(_0x2f42e8,_0x802b80,_0x3d160d){var _0xf96a2e=_0x2f42e8[_0x9c0f('0x6')][_0x9c0f('0x7')](_0x9c0f('0x8'));if(!_0xf96a2e){throw new Error(_0x9c0f('0x9'));}return beaverLogger[_0x9c0f('0xa')]({'uri':'/client-logs','logger':_0xf96a2e,'enableCors':!isProduction})(_0x2f42e8,_0x802b80,_0x3d160d);}router['use'](auth[_0x9c0f('0xb')](),clientSideLogs);module[_0x9c0f('0xc')]=router;
\ No newline at end of file
+var _0x1649=['Client-Side\x20logger\x20not\x20found!','/client-logs','isAuthenticated','beaver-logger/server','express','../config/environment','env','production','app','get','client-side-logger'];(function(_0x337408,_0x49418b){var _0x88e674=function(_0x306620){while(--_0x306620){_0x337408['push'](_0x337408['shift']());}};_0x88e674(++_0x49418b);}(_0x1649,0xbe));var _0x9164=function(_0x38afa6,_0x1ae790){_0x38afa6=_0x38afa6-0x0;var _0x7707ea=_0x1649[_0x38afa6];return _0x7707ea;};var beaverLogger=require(_0x9164('0x0'));var express=require(_0x9164('0x1'));var auth=require('../components/auth/service');var config=require(_0x9164('0x2'));var router=express['Router']();var isProduction=config[_0x9164('0x3')]===_0x9164('0x4')||![];function clientSideLogs(_0x297f4e,_0x5d980f,_0x473255){var _0x4b9ef8=_0x297f4e[_0x9164('0x5')][_0x9164('0x6')](_0x9164('0x7'));if(!_0x4b9ef8){throw new Error(_0x9164('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x9164('0x9'),'logger':_0x4b9ef8,'enableCors':!isProduction})(_0x297f4e,_0x5d980f,_0x473255);}router['use'](auth[_0x9164('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index aec33a9..ebdf2c6 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 _0xea51=['MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x3686a8,_0x4e3062){var _0x4e8136=function(_0x516487){while(--_0x516487){_0x3686a8['push'](_0x3686a8['shift']());}};_0x4e8136(++_0x4e3062);}(_0xea51,0x114));var _0x1ea5=function(_0x68e69a,_0x3a44b8){_0x68e69a=_0x68e69a-0x0;var _0x2eb629=_0xea51[_0x68e69a];return _0x2eb629;};'use strict';var Sequelize=require(_0x1ea5('0x0'));module[_0x1ea5('0x1')]={'name':{'type':Sequelize[_0x1ea5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1ea5('0x3')]('AmazonAWS','Google',_0x1ea5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1ea5('0x3')]('Outlook365',_0x1ea5('0x5'))},'data1':{'type':Sequelize[_0x1ea5('0x2')],'comment':_0x1ea5('0x6')},'data2':{'type':Sequelize[_0x1ea5('0x2')],'comment':_0x1ea5('0x7')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x1ea5('0x2')],'comment':_0x1ea5('0x8')},'data5':{'type':Sequelize[_0x1ea5('0x9')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0x1ea5('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0xfd63=['ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','sequelize','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xfd63,0xef));var _0x3fd6=function(_0x3910e7,_0x46aa99){_0x3910e7=_0x3910e7-0x0;var _0x3b2a91=_0xfd63[_0x3910e7];return _0x3b2a91;};'use strict';var Sequelize=require(_0x3fd6('0x0'));module[_0x3fd6('0x1')]={'name':{'type':Sequelize[_0x3fd6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3fd6('0x3')](_0x3fd6('0x4'),'Google',_0x3fd6('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3fd6('0x6'),_0x3fd6('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x3fd6('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x3fd6('0x2')],'comment':_0x3fd6('0x8')},'data5':{'type':Sequelize[_0x3fd6('0x9')],'comment':_0x3fd6('0xa')},'data6':{'type':Sequelize[_0x3fd6('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ce3c394..4aceb87 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 _0xcdee=['get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','refresh_token','data6','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','socket.io-emitter','status','end','json','undefined','count','offset','limit','set','update','then','sendStatus','error','stack','name','send','padEnd','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','CloudProvider','includeAll','include','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback'];(function(_0x4fe726,_0x277e39){var _0x132568=function(_0x527eb4){while(--_0x527eb4){_0x4fe726['push'](_0x4fe726['shift']());}};_0x132568(++_0x277e39);}(_0xcdee,0xd5));var _0xecde=function(_0x10e39f,_0x15d428){_0x10e39f=_0x10e39f-0x0;var _0x4a364e=_0xcdee[_0x10e39f];return _0x4a364e;};'use strict';var _=require(_0xecde('0x0'));var Redis=require(_0xecde('0x1'));var qs=require(_0xecde('0x2'));var encryptor=require(_0xecde('0x3'));var config=require(_0xecde('0x4'));var logger=require('../../config/logger')(_0xecde('0x5'));var db=require(_0xecde('0x6'))['db'];var oauth=require(_0xecde('0x7'));config['redis']=_[_0xecde('0x8')](config[_0xecde('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xecde('0xa'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x16c171,_0x2b2cb6){_0x2b2cb6=_0x2b2cb6||0xcc;return function(_0x218ff0){if(_0x218ff0){return _0x16c171['sendStatus'](_0x2b2cb6);}return _0x16c171[_0xecde('0xb')](_0x2b2cb6)[_0xecde('0xc')]();};}function respondWithResult(_0xa2541,_0x5811f9){_0x5811f9=_0x5811f9||0xc8;return function(_0x344057){if(_0x344057){return _0xa2541[_0xecde('0xb')](_0x5811f9)[_0xecde('0xd')](_0x344057);}};}function respondWithFilteredResult(_0x20bf35,_0x900506){return function(_0x45700e){if(_0x45700e){var _0x20057d=typeof _0x900506['offset']===_0xecde('0xe')&&typeof _0x900506['limit']===_0xecde('0xe');var _0x523e1c=_0x45700e[_0xecde('0xf')];var _0x31e63b=_0x20057d?0x0:_0x900506[_0xecde('0x10')];var _0x59df6c=_0x20057d?_0x45700e['count']:_0x900506[_0xecde('0x10')]+_0x900506[_0xecde('0x11')];var _0x24d051;if(_0x59df6c>=_0x523e1c){_0x59df6c=_0x523e1c;_0x24d051=0xc8;}else{_0x24d051=0xce;}_0x20bf35[_0xecde('0xb')](_0x24d051);return _0x20bf35[_0xecde('0x12')]('Content-Range',_0x31e63b+'-'+_0x59df6c+'/'+_0x523e1c)[_0xecde('0xd')](_0x45700e);}return null;};}function saveUpdates(_0x20c118){return function(_0x251bc1){if(_0x251bc1){return _0x251bc1[_0xecde('0x13')](_0x20c118)[_0xecde('0x14')](function(_0x42f309){return _0x42f309;});}return null;};}function removeEntity(_0xdc1f61){return function(_0x57ff49){if(_0x57ff49){return _0x57ff49['destroy']()['then'](function(){_0xdc1f61[_0xecde('0xb')](0xcc)[_0xecde('0xc')]();});}};}function handleEntityNotFound(_0x16d84d){return function(_0x50aaf8){if(!_0x50aaf8){_0x16d84d[_0xecde('0x15')](0x194);}return _0x50aaf8;};}function handleError(_0x3043c0,_0x5b6474){_0x5b6474=_0x5b6474||0x1f4;return function(_0x32115d){logger[_0xecde('0x16')](_0x32115d[_0xecde('0x17')]);if(_0x32115d[_0xecde('0x18')]){delete _0x32115d[_0xecde('0x18')];}_0x3043c0[_0xecde('0xb')](_0x5b6474)[_0xecde('0x19')](_0x32115d);};}function maskClientSecret(_0x459112){return _[_0xecde('0x1a')](_0x459112['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x1bbae0,_0x43f2cc){var _0xce5303={},_0xaf0a51={},_0x3bee49={'count':0x0,'rows':[]};var _0x1e5073=_[_0xecde('0x1b')](db['CloudProvider'][_0xecde('0x1c')],function(_0x10c8a0){return{'name':_0x10c8a0[_0xecde('0x1d')],'type':_0x10c8a0[_0xecde('0x1e')]['key']};});_0xaf0a51[_0xecde('0x1f')]=_[_0xecde('0x1b')](_0x1e5073,_0xecde('0x18'));_0xaf0a51[_0xecde('0x20')]=_[_0xecde('0x21')](_0x1bbae0[_0xecde('0x20')]);_0xaf0a51[_0xecde('0x22')]=_[_0xecde('0x23')](_0xaf0a51[_0xecde('0x1f')],_0xaf0a51[_0xecde('0x20')]);_0xce5303[_0xecde('0x24')]=_[_0xecde('0x23')](_0xaf0a51[_0xecde('0x1f')],qs[_0xecde('0x25')](_0x1bbae0[_0xecde('0x20')][_0xecde('0x25')]));_0xce5303[_0xecde('0x24')]=_0xce5303[_0xecde('0x24')][_0xecde('0x26')]?_0xce5303[_0xecde('0x24')]:_0xaf0a51[_0xecde('0x1f')];if(!_0x1bbae0[_0xecde('0x20')][_0xecde('0x27')](_0xecde('0x28'))){_0xce5303[_0xecde('0x11')]=qs[_0xecde('0x11')](_0x1bbae0[_0xecde('0x20')][_0xecde('0x11')]);_0xce5303[_0xecde('0x10')]=qs[_0xecde('0x10')](_0x1bbae0[_0xecde('0x20')][_0xecde('0x10')]);}_0xce5303[_0xecde('0x29')]=qs['sort'](_0x1bbae0[_0xecde('0x20')]['sort']);_0xce5303[_0xecde('0x2a')]=qs[_0xecde('0x22')](_[_0xecde('0x2b')](_0x1bbae0[_0xecde('0x20')],_0xaf0a51['filters']),_0x1e5073);if(_0x1bbae0[_0xecde('0x20')][_0xecde('0x2c')]){_0xce5303[_0xecde('0x2a')]=_['merge'](_0xce5303['where'],{'$or':_['map'](_0x1e5073,function(_0x29115a){if(_0x29115a['type']!=='VIRTUAL'){var _0x502a2b={};_0x502a2b[_0x29115a[_0xecde('0x18')]]={'$like':'%'+_0x1bbae0[_0xecde('0x20')][_0xecde('0x2c')]+'%'};return _0x502a2b;}})});}_0xce5303=_[_0xecde('0x2d')]({},_0xce5303,_0x1bbae0['options']);var _0x3fd488={'where':_0xce5303[_0xecde('0x2a')]};return db[_0xecde('0x2e')][_0xecde('0xf')](_0x3fd488)[_0xecde('0x14')](function(_0x450d9b){_0x3bee49['count']=_0x450d9b;if(_0x1bbae0[_0xecde('0x20')][_0xecde('0x2f')]){_0xce5303[_0xecde('0x30')]=[{'all':!![]}];}return db[_0xecde('0x2e')]['findAll'](_0xce5303);})[_0xecde('0x14')](function(_0x58ae40){_0x3bee49['rows']=_['map'](_0x58ae40,function(_0xaaba4f){if(_0xaaba4f[_0xecde('0x31')]===_0xecde('0x32')){var _0x48876a=encryptor[_0xecde('0x33')](_0xaaba4f[_0xecde('0x34')]);_0xaaba4f[_0xecde('0x34')]=maskClientSecret(_0x48876a);}return _0xaaba4f;});return _0x3bee49;})[_0xecde('0x14')](respondWithFilteredResult(_0x43f2cc,_0xce5303))[_0xecde('0x35')](handleError(_0x43f2cc,null));};exports[_0xecde('0x36')]=function(_0x4ef8ca,_0x3cd4c4){var _0x971e30={'raw':!![],'where':{'id':_0x4ef8ca[_0xecde('0x37')]['id']}},_0x525c84={};_0x525c84[_0xecde('0x1f')]=_[_0xecde('0x21')](db[_0xecde('0x2e')][_0xecde('0x1c')]);_0x525c84[_0xecde('0x20')]=_[_0xecde('0x21')](_0x4ef8ca[_0xecde('0x20')]);_0x525c84[_0xecde('0x22')]=_[_0xecde('0x23')](_0x525c84[_0xecde('0x1f')],_0x525c84[_0xecde('0x20')]);_0x971e30[_0xecde('0x24')]=_[_0xecde('0x23')](_0x525c84[_0xecde('0x1f')],qs[_0xecde('0x25')](_0x4ef8ca[_0xecde('0x20')][_0xecde('0x25')]));_0x971e30[_0xecde('0x24')]=_0x971e30[_0xecde('0x24')][_0xecde('0x26')]?_0x971e30[_0xecde('0x24')]:_0x525c84[_0xecde('0x1f')];if(_0x4ef8ca[_0xecde('0x20')]['includeAll']){_0x971e30[_0xecde('0x30')]=[{'all':!![]}];}_0x971e30=_[_0xecde('0x2d')]({},_0x971e30,_0x4ef8ca[_0xecde('0x38')]);return db[_0xecde('0x2e')][_0xecde('0x39')](_0x971e30)[_0xecde('0x14')](handleEntityNotFound(_0x3cd4c4,null))[_0xecde('0x14')](function(_0x2f5441){if(_0x2f5441[_0xecde('0x31')]===_0xecde('0x32')){var _0x2fb39e=encryptor['decryptString'](_0x2f5441[_0xecde('0x34')]);_0x2f5441[_0xecde('0x34')]=maskClientSecret(_0x2fb39e);}return _0x2f5441;})[_0xecde('0x14')](respondWithResult(_0x3cd4c4,null))['catch'](handleError(_0x3cd4c4,null));};exports['create']=function(_0x40575f,_0x44e4e4){if(!_0x40575f[_0xecde('0x3a')][_0xecde('0x18')])throw new Error(_0xecde('0x3b'));if(!_0x40575f[_0xecde('0x3a')][_0xecde('0x31')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x344497=db['CloudProvider'][_0xecde('0x1c')]['service'][_0xecde('0x3c')];if(!_0x344497[_0xecde('0x3d')](_0x40575f[_0xecde('0x3a')][_0xecde('0x31')]))throw new Error(_0xecde('0x3e')+_0x344497[_0xecde('0x3f')](',\x20'));if(_0x40575f[_0xecde('0x3a')][_0xecde('0x31')]===_0xecde('0x32')&&_0x40575f[_0xecde('0x3a')][_0xecde('0x34')]){_0x40575f['body'][_0xecde('0x34')]=encryptor[_0xecde('0x40')](_0x40575f[_0xecde('0x3a')][_0xecde('0x34')]);}return db[_0xecde('0x2e')][_0xecde('0x41')](_0x40575f[_0xecde('0x3a')],{})['then'](respondWithResult(_0x44e4e4,0xc9))['catch'](handleError(_0x44e4e4,null));};exports['update']=function(_0x36f5fc,_0x65bb7b){if(_0x36f5fc[_0xecde('0x3a')]['id']){delete _0x36f5fc[_0xecde('0x3a')]['id'];}return db[_0xecde('0x2e')][_0xecde('0x39')]({'where':{'id':_0x36f5fc['params']['id']}})[_0xecde('0x14')](handleEntityNotFound(_0x65bb7b,null))['then'](function(_0x4f3b70){if(_0x4f3b70['service']===_0xecde('0x32')&&_0x36f5fc[_0xecde('0x3a')][_0xecde('0x34')]){_0x36f5fc[_0xecde('0x3a')][_0xecde('0x34')]=encryptor[_0xecde('0x40')](_0x36f5fc[_0xecde('0x3a')]['data3']);}return _0x4f3b70;})['then'](saveUpdates(_0x36f5fc['body'],null))[_0xecde('0x14')](respondWithResult(_0x65bb7b,null))[_0xecde('0x35')](handleError(_0x65bb7b,null));};exports[_0xecde('0x42')]=function(_0x5e2fd6,_0x9ee1e){return db[_0xecde('0x2e')]['find']({'where':{'id':_0x5e2fd6[_0xecde('0x37')]['id']}})[_0xecde('0x14')](handleEntityNotFound(_0x9ee1e,null))[_0xecde('0x14')](removeEntity(_0x9ee1e,null))['catch'](handleError(_0x9ee1e,null));};exports[_0xecde('0x43')]=function(_0x12674d,_0x36e6bb){return db[_0xecde('0x2e')][_0xecde('0x44')]({'where':{'id':_0x12674d['params']['id']},'raw':!![]})['then'](function(_0x580f3c){if(!_0x580f3c)return _0x36e6bb[_0xecde('0x15')](0x194);return{'url':oauth[_0xecde('0x45')](_0x580f3c,_0x12674d[_0xecde('0x46')]['id'])};})[_0xecde('0x14')](respondWithResult(_0x36e6bb,null))['catch'](handleError(_0x36e6bb,null));};exports[_0xecde('0x47')]=function(_0x5e9768,_0x586dbe){var _0x4755bc=_0x5e9768[_0xecde('0x3a')];var _0x2e0aa4;var _0x4d6565;if(_0x4755bc[_0xecde('0x16')])throw _0x4755bc;redis[_0xecde('0x48')](_0x4755bc[_0xecde('0x49')])['then'](function(_0x3937ff){if(!_0x3937ff)throw new Error(_0xecde('0x4a'));_0x2e0aa4=JSON[_0xecde('0x4b')](_0x3937ff);var _0xd1bbb2=Buffer[_0xecde('0x4c')](_0x4755bc[_0xecde('0x49')],_0xecde('0x4d'))['toString'](_0xecde('0x4e'));_0x4d6565=JSON[_0xecde('0x4b')](_0xd1bbb2);if(!oauth[_0xecde('0x4f')](_0x4755bc['id_token'],_0x2e0aa4[_0xecde('0x50')]))throw new Error(_0xecde('0x51'));redis[_0xecde('0x52')](_0x4755bc[_0xecde('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x4755bc[_0xecde('0x53')],_0x2e0aa4);})['then'](function(_0x698a95){_0x2e0aa4[_0xecde('0x54')]=_0x698a95[_0xecde('0x55')];_0x2e0aa4['data6']=_0x698a95[_0xecde('0x56')];return db[_0xecde('0x2e')]['update']({'data5':_0x2e0aa4[_0xecde('0x54')],'data6':_0x2e0aa4[_0xecde('0x57')]},{'where':{'id':_0x2e0aa4['id']}});})[_0xecde('0x14')](function(){oauth[_0xecde('0x58')](_0x2e0aa4);socket['emit'](_0xecde('0x59'),{'id':_0x4d6565['id']});return;})[_0xecde('0x14')](respondWithStatusCode(_0x586dbe,null))[_0xecde('0x35')](function(_0x4d0d3d){if(_0x4d6565){socket['emit'](_0xecde('0x5a'),{'id':_0x4d6565['id']});}if(!_0x2e0aa4){logger['error'](_0xecde('0x5b'),_0x4d0d3d);return _0x586dbe[_0xecde('0xb')](0x1f4)[_0xecde('0x19')](_0x4d0d3d[_0xecde('0x5c')]);}logger['error'](_0xecde('0x5d'),_0x2e0aa4['id'],JSON[_0xecde('0x5e')](_0x4d0d3d));});};
\ No newline at end of file
+var _0x69a7=['base64','toString','isValidIdToken','id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../config/environment','../../config/logger','api','./cloudProvider.oauth','defaults','redis','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','name','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','service','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','state','parse','from'];(function(_0x21bf1f,_0x451580){var _0x2d2020=function(_0x46370f){while(--_0x46370f){_0x21bf1f['push'](_0x21bf1f['shift']());}};_0x2d2020(++_0x451580);}(_0x69a7,0x67));var _0x769a=function(_0x45aa72,_0x8af642){_0x45aa72=_0x45aa72-0x0;var _0x75adaa=_0x69a7[_0x45aa72];return _0x75adaa;};'use strict';var _=require(_0x769a('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x769a('0x1'));var logger=require(_0x769a('0x2'))(_0x769a('0x3'));var db=require('../../mysqldb')['db'];var oauth=require(_0x769a('0x4'));config['redis']=_[_0x769a('0x5')](config[_0x769a('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x769a('0x6')]);function respondWithStatusCode(_0x462d2b,_0x303930){_0x303930=_0x303930||0xcc;return function(_0x86760d){if(_0x86760d){return _0x462d2b[_0x769a('0x7')](_0x303930);}return _0x462d2b[_0x769a('0x8')](_0x303930)[_0x769a('0x9')]();};}function respondWithResult(_0x21df77,_0x12530f){_0x12530f=_0x12530f||0xc8;return function(_0x2c8744){if(_0x2c8744){return _0x21df77['status'](_0x12530f)[_0x769a('0xa')](_0x2c8744);}};}function respondWithFilteredResult(_0x118297,_0x4e7223){return function(_0x449feb){if(_0x449feb){var _0x1f5444=typeof _0x4e7223[_0x769a('0xb')]===_0x769a('0xc')&&typeof _0x4e7223[_0x769a('0xd')]===_0x769a('0xc');var _0x4c8b90=_0x449feb[_0x769a('0xe')];var _0x31287d=_0x1f5444?0x0:_0x4e7223['offset'];var _0x475483=_0x1f5444?_0x449feb[_0x769a('0xe')]:_0x4e7223[_0x769a('0xb')]+_0x4e7223[_0x769a('0xd')];var _0x34dab5;if(_0x475483>=_0x4c8b90){_0x475483=_0x4c8b90;_0x34dab5=0xc8;}else{_0x34dab5=0xce;}_0x118297[_0x769a('0x8')](_0x34dab5);return _0x118297[_0x769a('0xf')](_0x769a('0x10'),_0x31287d+'-'+_0x475483+'/'+_0x4c8b90)[_0x769a('0xa')](_0x449feb);}return null;};}function saveUpdates(_0x5e924b){return function(_0x549d15){if(_0x549d15){return _0x549d15[_0x769a('0x11')](_0x5e924b)[_0x769a('0x12')](function(_0x15bc1c){return _0x15bc1c;});}return null;};}function removeEntity(_0x528b09){return function(_0x13c319){if(_0x13c319){return _0x13c319[_0x769a('0x13')]()[_0x769a('0x12')](function(){_0x528b09['status'](0xcc)[_0x769a('0x9')]();});}};}function handleEntityNotFound(_0x54a2b0){return function(_0x5a291c){if(!_0x5a291c){_0x54a2b0[_0x769a('0x7')](0x194);}return _0x5a291c;};}function handleError(_0x3619a7,_0x5348f5){_0x5348f5=_0x5348f5||0x1f4;return function(_0x3fe62c){logger['error'](_0x3fe62c['stack']);if(_0x3fe62c[_0x769a('0x14')]){delete _0x3fe62c[_0x769a('0x14')];}_0x3619a7['status'](_0x5348f5)['send'](_0x3fe62c);};}function maskClientSecret(_0x3534b5){return _[_0x769a('0x15')](_0x3534b5[_0x769a('0x16')](0x0,0x3),0x14,'*');}exports[_0x769a('0x17')]=function(_0x29812e,_0x530ed7){var _0x324f18={},_0x74a5c1={},_0x27f5cf={'count':0x0,'rows':[]};var _0x228b7f=_[_0x769a('0x18')](db[_0x769a('0x19')][_0x769a('0x1a')],function(_0x24856c){return{'name':_0x24856c[_0x769a('0x1b')],'type':_0x24856c[_0x769a('0x1c')]['key']};});_0x74a5c1[_0x769a('0x1d')]=_[_0x769a('0x18')](_0x228b7f,_0x769a('0x14'));_0x74a5c1['query']=_[_0x769a('0x1e')](_0x29812e[_0x769a('0x1f')]);_0x74a5c1[_0x769a('0x20')]=_[_0x769a('0x21')](_0x74a5c1['model'],_0x74a5c1['query']);_0x324f18[_0x769a('0x22')]=_[_0x769a('0x21')](_0x74a5c1[_0x769a('0x1d')],qs[_0x769a('0x23')](_0x29812e['query'][_0x769a('0x23')]));_0x324f18[_0x769a('0x22')]=_0x324f18[_0x769a('0x22')][_0x769a('0x24')]?_0x324f18[_0x769a('0x22')]:_0x74a5c1[_0x769a('0x1d')];if(!_0x29812e[_0x769a('0x1f')][_0x769a('0x25')]('nolimit')){_0x324f18[_0x769a('0xd')]=qs['limit'](_0x29812e[_0x769a('0x1f')][_0x769a('0xd')]);_0x324f18[_0x769a('0xb')]=qs[_0x769a('0xb')](_0x29812e['query'][_0x769a('0xb')]);}_0x324f18[_0x769a('0x26')]=qs['sort'](_0x29812e[_0x769a('0x1f')]['sort']);_0x324f18[_0x769a('0x27')]=qs[_0x769a('0x20')](_[_0x769a('0x28')](_0x29812e['query'],_0x74a5c1[_0x769a('0x20')]),_0x228b7f);if(_0x29812e['query']['filter']){_0x324f18['where']=_[_0x769a('0x29')](_0x324f18[_0x769a('0x27')],{'$or':_[_0x769a('0x18')](_0x228b7f,function(_0x457dec){if(_0x457dec[_0x769a('0x1c')]!==_0x769a('0x2a')){var _0x154c3a={};_0x154c3a[_0x457dec[_0x769a('0x14')]]={'$like':'%'+_0x29812e[_0x769a('0x1f')][_0x769a('0x2b')]+'%'};return _0x154c3a;}})});}_0x324f18=_[_0x769a('0x29')]({},_0x324f18,_0x29812e['options']);var _0x400465={'where':_0x324f18[_0x769a('0x27')]};return db[_0x769a('0x19')][_0x769a('0xe')](_0x400465)[_0x769a('0x12')](function(_0x2cf8de){_0x27f5cf['count']=_0x2cf8de;if(_0x29812e[_0x769a('0x1f')]['includeAll']){_0x324f18['include']=[{'all':!![]}];}return db[_0x769a('0x19')][_0x769a('0x2c')](_0x324f18);})['then'](function(_0xc59096){_0x27f5cf[_0x769a('0x2d')]=_[_0x769a('0x18')](_0xc59096,function(_0x791b56){if(_0x791b56['service']===_0x769a('0x2e')){var _0x534bf5=encryptor[_0x769a('0x2f')](_0x791b56[_0x769a('0x30')]);_0x791b56['data3']=maskClientSecret(_0x534bf5);}return _0x791b56;});return _0x27f5cf;})['then'](respondWithFilteredResult(_0x530ed7,_0x324f18))[_0x769a('0x31')](handleError(_0x530ed7,null));};exports[_0x769a('0x32')]=function(_0x461d96,_0x302730){var _0x28c9e4={'raw':!![],'where':{'id':_0x461d96[_0x769a('0x33')]['id']}},_0x2eb57a={};_0x2eb57a[_0x769a('0x1d')]=_['keys'](db[_0x769a('0x19')][_0x769a('0x1a')]);_0x2eb57a[_0x769a('0x1f')]=_[_0x769a('0x1e')](_0x461d96[_0x769a('0x1f')]);_0x2eb57a['filters']=_['intersection'](_0x2eb57a[_0x769a('0x1d')],_0x2eb57a[_0x769a('0x1f')]);_0x28c9e4[_0x769a('0x22')]=_[_0x769a('0x21')](_0x2eb57a['model'],qs['fields'](_0x461d96[_0x769a('0x1f')][_0x769a('0x23')]));_0x28c9e4['attributes']=_0x28c9e4[_0x769a('0x22')][_0x769a('0x24')]?_0x28c9e4[_0x769a('0x22')]:_0x2eb57a[_0x769a('0x1d')];if(_0x461d96[_0x769a('0x1f')]['includeAll']){_0x28c9e4['include']=[{'all':!![]}];}_0x28c9e4=_[_0x769a('0x29')]({},_0x28c9e4,_0x461d96[_0x769a('0x34')]);return db['CloudProvider'][_0x769a('0x35')](_0x28c9e4)[_0x769a('0x12')](handleEntityNotFound(_0x302730,null))[_0x769a('0x12')](function(_0x310b71){if(_0x310b71[_0x769a('0x36')]==='MicrosoftAzure'){var _0x54d012=encryptor[_0x769a('0x2f')](_0x310b71[_0x769a('0x30')]);_0x310b71[_0x769a('0x30')]=maskClientSecret(_0x54d012);}return _0x310b71;})[_0x769a('0x12')](respondWithResult(_0x302730,null))['catch'](handleError(_0x302730,null));};exports[_0x769a('0x37')]=function(_0x447efe,_0x288685){if(!_0x447efe[_0x769a('0x38')][_0x769a('0x14')])throw new Error(_0x769a('0x39'));if(!_0x447efe[_0x769a('0x38')][_0x769a('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x543d17=db['CloudProvider'][_0x769a('0x1a')][_0x769a('0x36')]['values'];if(!_0x543d17[_0x769a('0x3a')](_0x447efe['body'][_0x769a('0x36')]))throw new Error(_0x769a('0x3b')+_0x543d17[_0x769a('0x3c')](',\x20'));if(_0x447efe[_0x769a('0x38')]['service']===_0x769a('0x2e')&&_0x447efe[_0x769a('0x38')][_0x769a('0x30')]){_0x447efe[_0x769a('0x38')][_0x769a('0x30')]=encryptor[_0x769a('0x3d')](_0x447efe[_0x769a('0x38')][_0x769a('0x30')]);}return db[_0x769a('0x19')][_0x769a('0x37')](_0x447efe[_0x769a('0x38')],{})[_0x769a('0x12')](respondWithResult(_0x288685,0xc9))['catch'](handleError(_0x288685,null));};exports[_0x769a('0x11')]=function(_0xe2b731,_0x2437db){if(_0xe2b731['body']['id']){delete _0xe2b731['body']['id'];}return db[_0x769a('0x19')][_0x769a('0x35')]({'where':{'id':_0xe2b731[_0x769a('0x33')]['id']}})['then'](handleEntityNotFound(_0x2437db,null))[_0x769a('0x12')](function(_0x3c929d){if(_0x3c929d[_0x769a('0x36')]===_0x769a('0x2e')&&_0xe2b731[_0x769a('0x38')][_0x769a('0x30')]){_0xe2b731[_0x769a('0x38')][_0x769a('0x30')]=encryptor[_0x769a('0x3d')](_0xe2b731[_0x769a('0x38')][_0x769a('0x30')]);}return _0x3c929d;})[_0x769a('0x12')](saveUpdates(_0xe2b731[_0x769a('0x38')],null))[_0x769a('0x12')](respondWithResult(_0x2437db,null))[_0x769a('0x31')](handleError(_0x2437db,null));};exports[_0x769a('0x13')]=function(_0xf6be0d,_0x1670b9){return db['CloudProvider'][_0x769a('0x35')]({'where':{'id':_0xf6be0d[_0x769a('0x33')]['id']}})[_0x769a('0x12')](handleEntityNotFound(_0x1670b9,null))[_0x769a('0x12')](removeEntity(_0x1670b9,null))[_0x769a('0x31')](handleError(_0x1670b9,null));};exports[_0x769a('0x3e')]=function(_0x1575c3,_0x4e6949){return db[_0x769a('0x19')][_0x769a('0x3f')]({'where':{'id':_0x1575c3[_0x769a('0x33')]['id']},'raw':!![]})['then'](function(_0x574f15){if(!_0x574f15)return _0x4e6949[_0x769a('0x7')](0x194);return{'url':oauth[_0x769a('0x40')](_0x574f15,_0x1575c3[_0x769a('0x41')]['id'])};})[_0x769a('0x12')](respondWithResult(_0x4e6949,null))['catch'](handleError(_0x4e6949,null));};exports[_0x769a('0x42')]=function(_0x4711ef,_0x728717){var _0x197e8f=_0x4711ef[_0x769a('0x38')];var _0x54779f;var _0x2fa765;if(_0x197e8f[_0x769a('0x43')])throw _0x197e8f;redis['get'](_0x197e8f[_0x769a('0x44')])[_0x769a('0x12')](function(_0xf7aae9){if(!_0xf7aae9)throw new Error('Invalid\x20state\x20parameter');_0x54779f=JSON[_0x769a('0x45')](_0xf7aae9);var _0x217de5=Buffer[_0x769a('0x46')](_0x197e8f['state'],_0x769a('0x47'))[_0x769a('0x48')]('ascii');_0x2fa765=JSON[_0x769a('0x45')](_0x217de5);if(!oauth[_0x769a('0x49')](_0x197e8f[_0x769a('0x4a')],_0x54779f['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x769a('0x4b')](_0x197e8f[_0x769a('0x44')]);return oauth[_0x769a('0x4c')](_0x197e8f['code'],_0x54779f);})[_0x769a('0x12')](function(_0x2a5445){_0x54779f[_0x769a('0x4d')]=_0x2a5445[_0x769a('0x4e')];_0x54779f[_0x769a('0x4f')]=_0x2a5445[_0x769a('0x50')];return db[_0x769a('0x19')]['update']({'data5':_0x54779f[_0x769a('0x4d')],'data6':_0x54779f['data6']},{'where':{'id':_0x54779f['id']}});})['then'](function(){oauth[_0x769a('0x51')](_0x54779f);socket[_0x769a('0x52')](_0x769a('0x53'),{'id':_0x2fa765['id']});return;})[_0x769a('0x12')](respondWithStatusCode(_0x728717,null))[_0x769a('0x31')](function(_0xabd27f){if(_0x2fa765){socket[_0x769a('0x52')]('microsoftAuthorization:error',{'id':_0x2fa765['id']});}if(!_0x54779f){logger[_0x769a('0x43')]('Invalid\x20authentication\x20state\x20parameter',_0xabd27f);return _0x728717[_0x769a('0x8')](0x1f4)[_0x769a('0x54')](_0xabd27f[_0x769a('0x55')]);}logger[_0x769a('0x43')](_0x769a('0x56'),_0x54779f['id'],JSON['stringify'](_0xabd27f));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 497840a..eb27c94 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 _0x7722=['./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x775ff4,_0x14d00f){var _0x2e6abe=function(_0x5ad039){while(--_0x5ad039){_0x775ff4['push'](_0x775ff4['shift']());}};_0x2e6abe(++_0x14d00f);}(_0x7722,0x148));var _0x2772=function(_0x367903,_0x18ab26){_0x367903=_0x367903-0x0;var _0x4ffbb6=_0x7722[_0x367903];return _0x4ffbb6;};'use strict';var _=require(_0x2772('0x0'));var util=require(_0x2772('0x1'));var logger=require(_0x2772('0x2'))('api');var moment=require(_0x2772('0x3'));var BPromise=require(_0x2772('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2772('0x5'));module['exports']=function(_0x50c454,_0x2b18ef){return _0x50c454[_0x2772('0x6')](_0x2772('0x7'),attributes,{'tableName':_0x2772('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x08b4=['bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','api','moment'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x08b4,0x164));var _0x408b=function(_0x22ee0f,_0x22e6d2){_0x22ee0f=_0x22ee0f-0x0;var _0x204696=_0x08b4[_0x22ee0f];return _0x204696;};'use strict';var _=require('lodash');var util=require(_0x408b('0x0'));var logger=require(_0x408b('0x1'))(_0x408b('0x2'));var moment=require(_0x408b('0x3'));var BPromise=require(_0x408b('0x4'));var rp=require(_0x408b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x408b('0x6'));var config=require(_0x408b('0x7'));var attributes=require(_0x408b('0x8'));module[_0x408b('0x9')]=function(_0x3440de,_0xe9752d){return _0x3440de[_0x408b('0xa')](_0x408b('0xb'),attributes,{'tableName':'cloud_providers','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 44e99fa..f2973d2 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 _0x617b=['https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','scope','state','nonce','login','key','oauth2Claims','oauth2/','set','payload','issuer','aud','audience','isAfter','unix','exp','resolve','CloudProvider','findOne','then','refresh_token','decryptString','data3','POST','data5','access_token','data6','update','catch','error','authorization_code','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','localhost','redis'];(function(_0x23ba0a,_0x56a52d){var _0xb6e43c=function(_0x219f92){while(--_0x219f92){_0x23ba0a['push'](_0x23ba0a['shift']());}};_0xb6e43c(++_0x56a52d);}(_0x617b,0xe3));var _0xb617=function(_0xeb027e,_0xf4aaf4){_0xeb027e=_0xeb027e-0x0;var _0x652cac=_0x617b[_0xeb027e];return _0x652cac;};'use strict';var _=require(_0xb617('0x0'));var crypto=require(_0xb617('0x1'));var jwt=require(_0xb617('0x2'));var moment=require(_0xb617('0x3'));var Redis=require(_0xb617('0x4'));var rp=require(_0xb617('0x5'));var util=require(_0xb617('0x6'));var encryptor=require(_0xb617('0x7'));var config=require(_0xb617('0x8'));var logger=require(_0xb617('0x9'))(_0xb617('0xa'));var schedule=require(_0xb617('0xb'));var db=require(_0xb617('0xc'))['db'];config['redis']=_[_0xb617('0xd')](config['redis'],{'host':_0xb617('0xe'),'port':0x18eb});var redis=new Redis(config[_0xb617('0xf')]);var MICROSOFT_AUTH_URL=_0xb617('0x10');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xb617('0x11'),_0xb617('0x12'),_0xb617('0x13'),_0xb617('0x14'),_0xb617('0x15'),_0xb617('0x16')],'Dynamics365':[_0xb617('0x17'),_0xb617('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x34def2){var _0x5a9582=_[_0xb617('0x18')](AZURE_AUTH_SCOPES[_0x34def2[_0xb617('0x19')]]);if(_0x34def2['type']===_0xb617('0x1a'))_0x5a9582['push'](_0x34def2[_0xb617('0x1b')]+_0xb617('0x1c'));return _0x5a9582[_0xb617('0x1d')]('\x20');}function getAccessTokenScope(_0x540bce){if(_0x540bce[_0xb617('0x19')]===_0xb617('0x1e'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x540bce['type']===_0xb617('0x1a'))return _0x540bce[_0xb617('0x1b')]+_0xb617('0x1c');}function generateMicrosoftAuthorizationUrl(_0x25621b,_0x2263b1){var _0x2a8b9f=MICROSOFT_AUTH_URL[_0xb617('0x1f')](_0xb617('0x20'),_0x25621b[_0xb617('0x21')]);var _0x42f9cc=[_0xb617('0x22'),_0xb617('0x23')];var _0x3ac964=Buffer[_0xb617('0x24')](JSON[_0xb617('0x25')]({'id':_0x2263b1}))['toString']('base64');var _0x37f9ef=crypto[_0xb617('0x26')](0x10)['toString'](_0xb617('0x27'));var _0x46a4f0=getAuthorizationScopes(_0x25621b);var _0x402749=[{'key':_0xb617('0x28'),'value':_0x25621b[_0xb617('0x29')]},{'key':_0xb617('0x2a'),'value':encodeURIComponent(_0x42f9cc[_0xb617('0x1d')]('\x20'))},{'key':_0xb617('0x2b'),'value':_0x25621b[_0xb617('0x2c')]},{'key':_0xb617('0x2d'),'value':'form_post'},{'key':_0xb617('0x2e'),'value':encodeURIComponent(_0x46a4f0)},{'key':_0xb617('0x2f'),'value':_0x3ac964},{'key':_0xb617('0x30'),'value':_0x37f9ef},{'key':'prompt','value':_0xb617('0x31')}];var _0xd8637b=_0x2a8b9f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb617('0x18')](_0x402749,function(_0x45ea7e){return _0x45ea7e[_0xb617('0x32')]+'='+_0x45ea7e['value'];})[_0xb617('0x1d')]('&');_0x25621b[_0xb617('0x33')]={'issuer':_0x2a8b9f[_0xb617('0x1f')](_0xb617('0x34'),''),'audience':_0x25621b[_0xb617('0x29')],'state':_0x3ac964,'nonce':_0x37f9ef};redis[_0xb617('0x35')](_0x3ac964,JSON[_0xb617('0x25')](_0x25621b));return _0xd8637b;}function isValidIdToken(_0x469361,_0x52a8fa){try{var _0x1241dd=jwt['decode'](_0x469361,{'complete':!![]});var _0x31db75=_0x1241dd[_0xb617('0x36')];if(_0x31db75['iss']!==_0x52a8fa[_0xb617('0x37')])return![];if(_0x31db75[_0xb617('0x38')]!==_0x52a8fa[_0xb617('0x39')])return![];if(_0x31db75[_0xb617('0x30')]!==_0x52a8fa[_0xb617('0x30')])return![];if(moment()[_0xb617('0x3a')](moment[_0xb617('0x3b')](_0x31db75[_0xb617('0x3c')])))return![];return!![];}catch(_0x59c6cc){throw _0x59c6cc;}}function refreshOauth2MicrosoftAccessToken(_0x27a8b2){return Promise[_0xb617('0x3d')]()['then'](function(){if(_0x27a8b2['data3'])return _0x27a8b2;return db[_0xb617('0x3e')][_0xb617('0x3f')]({'where':{'id':_0x27a8b2['id']},'raw':!![]});})[_0xb617('0x40')](function(_0x126166){var _0x4b9558={'grant_type':_0xb617('0x41'),'refresh_token':_0x126166['data6'],'scope':getAccessTokenScope(_0x126166),'redirect_uri':_0x126166[_0xb617('0x2c')],'client_id':_0x126166['data1'],'client_secret':encryptor[_0xb617('0x42')](_0x126166[_0xb617('0x43')])};var _0x49095e={'method':_0xb617('0x44'),'uri':MICROSOFT_AUTH_URL[_0xb617('0x1f')](_0xb617('0x20'),_0x126166[_0xb617('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b9558,'json':!![]};return rp(_0x49095e);})[_0xb617('0x40')](function(_0x2f146f){_0x27a8b2[_0xb617('0x45')]=_0x2f146f[_0xb617('0x46')];_0x27a8b2[_0xb617('0x47')]=_0x2f146f[_0xb617('0x41')];return db['CloudProvider'][_0xb617('0x48')]({'data5':_0x27a8b2[_0xb617('0x45')],'data6':_0x27a8b2[_0xb617('0x47')]},{'where':{'id':_0x27a8b2['id']}});})['then'](function(){return _0x27a8b2;})[_0xb617('0x49')](function(_0x375aef){logger[_0xb617('0x4a')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x27a8b2['id'],_0x375aef);});}function getOauth2MicrosoftAccessToken(_0x43904d,_0x2e28e7){var _0x135dba={'grant_type':_0xb617('0x4b'),'code':_0x43904d,'scope':getAccessTokenScope(_0x2e28e7),'redirect_uri':_0x2e28e7['data4'],'client_id':_0x2e28e7[_0xb617('0x29')],'client_secret':encryptor['decryptString'](_0x2e28e7[_0xb617('0x43')])};var _0x5653b5={'method':_0xb617('0x44'),'uri':MICROSOFT_AUTH_URL[_0xb617('0x1f')]('{TENANT_ID}',_0x2e28e7[_0xb617('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x135dba,'json':!![]};return rp(_0x5653b5);}function startRefreshInterval(_0x4b7b5e){var _0x3d967b=schedule[_0xb617('0x4c')];if(_0x3d967b[_0x4b7b5e['id']])clearInterval(_0x3d967b[_0x4b7b5e['id']]);_0x3d967b[_0x4b7b5e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb617('0x4d')](this,{'id':_0x4b7b5e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb617('0x4c')]=_0x3d967b;}function startAllRefreshIntervals(){return db[_0xb617('0x3e')][_0xb617('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb617('0x40')](function(_0x5e1e8e){var _0x569946=_0x5e1e8e['map'](function(_0x56f5eb){return refreshOauth2MicrosoftAccessToken(_0x56f5eb)[_0xb617('0x40')](function(_0x21d049){startRefreshInterval(_0x21d049);});});return Promise[_0xb617('0x4f')](_0x569946);})[_0xb617('0x49')](function(_0x32ee04){var _0x148ef8=_0x32ee04?util['inspect'](_0x32ee04,{'showHidden':![],'depth':null}):'';logger[_0xb617('0x4a')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x148ef8);});}module[_0xb617('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x9e23=['set','stringify','decode','payload','iss','aud','audience','isAfter','exp','then','CloudProvider','refresh_token','decryptString','POST','{TENANT_ID}','data5','access_token','data6','update','catch','authorization_code','data3','bind','intervals','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','data2','id_token','from','toString','base64','randomBytes','hex','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','key','value','oauth2Claims'];(function(_0x563e7e,_0x4f9e06){var _0x80868a=function(_0x255620){while(--_0x255620){_0x563e7e['push'](_0x563e7e['shift']());}};_0x80868a(++_0x4f9e06);}(_0x9e23,0x15a));var _0x39e2=function(_0x31a4b1,_0x1656bb){_0x31a4b1=_0x31a4b1-0x0;var _0x444b04=_0x9e23[_0x31a4b1];return _0x444b04;};'use strict';var _=require('lodash');var crypto=require(_0x39e2('0x0'));var jwt=require(_0x39e2('0x1'));var moment=require(_0x39e2('0x2'));var Redis=require('ioredis');var rp=require(_0x39e2('0x3'));var util=require(_0x39e2('0x4'));var encryptor=require(_0x39e2('0x5'));var config=require(_0x39e2('0x6'));var logger=require(_0x39e2('0x7'))('api');var schedule=require(_0x39e2('0x8'));var db=require(_0x39e2('0x9'))['db'];config[_0x39e2('0xa')]=_[_0x39e2('0xb')](config[_0x39e2('0xa')],{'host':_0x39e2('0xc'),'port':0x18eb});var redis=new Redis(config[_0x39e2('0xa')]);var MICROSOFT_AUTH_URL=_0x39e2('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x39e2('0xe'),_0x39e2('0xf'),_0x39e2('0x10'),_0x39e2('0x11'),_0x39e2('0x12')],'Dynamics365':['openid',_0x39e2('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x39e2('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x39e2('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x56b010){var _0x549626=_[_0x39e2('0x15')](AZURE_AUTH_SCOPES[_0x56b010[_0x39e2('0x16')]]);if(_0x56b010[_0x39e2('0x16')]===_0x39e2('0x17'))_0x549626['push'](_0x56b010[_0x39e2('0x18')]+_0x39e2('0x19'));return _0x549626[_0x39e2('0x1a')]('\x20');}function getAccessTokenScope(_0x297418){if(_0x297418[_0x39e2('0x16')]===_0x39e2('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x297418[_0x39e2('0x16')]===_0x39e2('0x17'))return _0x297418['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0xde6505,_0x39480a){var _0x3c8a4d=MICROSOFT_AUTH_URL[_0x39e2('0x1c')]('{TENANT_ID}',_0xde6505[_0x39e2('0x1d')]);var _0x4dea1a=['code',_0x39e2('0x1e')];var _0x3347ba=Buffer[_0x39e2('0x1f')](JSON['stringify']({'id':_0x39480a}))[_0x39e2('0x20')](_0x39e2('0x21'));var _0x2b229d=crypto[_0x39e2('0x22')](0x10)['toString'](_0x39e2('0x23'));var _0xe0fc03=getAuthorizationScopes(_0xde6505);var _0x1231bc=[{'key':'client_id','value':_0xde6505[_0x39e2('0x24')]},{'key':_0x39e2('0x25'),'value':encodeURIComponent(_0x4dea1a[_0x39e2('0x1a')]('\x20'))},{'key':_0x39e2('0x26'),'value':_0xde6505[_0x39e2('0x27')]},{'key':_0x39e2('0x28'),'value':_0x39e2('0x29')},{'key':_0x39e2('0x2a'),'value':encodeURIComponent(_0xe0fc03)},{'key':'state','value':_0x3347ba},{'key':_0x39e2('0x2b'),'value':_0x2b229d},{'key':_0x39e2('0x2c'),'value':_0x39e2('0x2d')}];var _0x3ab13e=_0x3c8a4d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x39e2('0x15')](_0x1231bc,function(_0x185e05){return _0x185e05[_0x39e2('0x2e')]+'='+_0x185e05[_0x39e2('0x2f')];})['join']('&');_0xde6505[_0x39e2('0x30')]={'issuer':_0x3c8a4d['replace']('oauth2/',''),'audience':_0xde6505['data1'],'state':_0x3347ba,'nonce':_0x2b229d};redis[_0x39e2('0x31')](_0x3347ba,JSON[_0x39e2('0x32')](_0xde6505));return _0x3ab13e;}function isValidIdToken(_0x41209c,_0x4e46d1){try{var _0x3b0d7f=jwt[_0x39e2('0x33')](_0x41209c,{'complete':!![]});var _0x2ede89=_0x3b0d7f[_0x39e2('0x34')];if(_0x2ede89[_0x39e2('0x35')]!==_0x4e46d1['issuer'])return![];if(_0x2ede89[_0x39e2('0x36')]!==_0x4e46d1[_0x39e2('0x37')])return![];if(_0x2ede89[_0x39e2('0x2b')]!==_0x4e46d1[_0x39e2('0x2b')])return![];if(moment()[_0x39e2('0x38')](moment['unix'](_0x2ede89[_0x39e2('0x39')])))return![];return!![];}catch(_0x3962bb){throw _0x3962bb;}}function refreshOauth2MicrosoftAccessToken(_0x12f2a3){return Promise['resolve']()[_0x39e2('0x3a')](function(){if(_0x12f2a3['data3'])return _0x12f2a3;return db[_0x39e2('0x3b')]['findOne']({'where':{'id':_0x12f2a3['id']},'raw':!![]});})[_0x39e2('0x3a')](function(_0x266941){var _0x28d018={'grant_type':_0x39e2('0x3c'),'refresh_token':_0x266941['data6'],'scope':getAccessTokenScope(_0x266941),'redirect_uri':_0x266941['data4'],'client_id':_0x266941[_0x39e2('0x24')],'client_secret':encryptor[_0x39e2('0x3d')](_0x266941['data3'])};var _0x4b1b33={'method':_0x39e2('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x39e2('0x1c')](_0x39e2('0x3f'),_0x266941[_0x39e2('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x28d018,'json':!![]};return rp(_0x4b1b33);})[_0x39e2('0x3a')](function(_0x434607){_0x12f2a3[_0x39e2('0x40')]=_0x434607[_0x39e2('0x41')];_0x12f2a3[_0x39e2('0x42')]=_0x434607[_0x39e2('0x3c')];return db[_0x39e2('0x3b')][_0x39e2('0x43')]({'data5':_0x12f2a3[_0x39e2('0x40')],'data6':_0x12f2a3[_0x39e2('0x42')]},{'where':{'id':_0x12f2a3['id']}});})[_0x39e2('0x3a')](function(){return _0x12f2a3;})[_0x39e2('0x44')](function(_0x11f02a){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x12f2a3['id'],_0x11f02a);});}function getOauth2MicrosoftAccessToken(_0x1976e3,_0x3b7166){var _0x3708f7={'grant_type':_0x39e2('0x45'),'code':_0x1976e3,'scope':getAccessTokenScope(_0x3b7166),'redirect_uri':_0x3b7166['data4'],'client_id':_0x3b7166[_0x39e2('0x24')],'client_secret':encryptor[_0x39e2('0x3d')](_0x3b7166[_0x39e2('0x46')])};var _0x11cf93={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x39e2('0x1c')](_0x39e2('0x3f'),_0x3b7166['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3708f7,'json':!![]};return rp(_0x11cf93);}function startRefreshInterval(_0x294f77){var _0x30ac05=schedule['intervals'];if(_0x30ac05[_0x294f77['id']])clearInterval(_0x30ac05[_0x294f77['id']]);_0x30ac05[_0x294f77['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x39e2('0x47')](this,{'id':_0x294f77['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x39e2('0x48')]=_0x30ac05;}function startAllRefreshIntervals(){return db[_0x39e2('0x3b')][_0x39e2('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x39e2('0x3a')](function(_0x5141df){var _0x5c7dac=_0x5141df[_0x39e2('0x15')](function(_0xcb2805){return refreshOauth2MicrosoftAccessToken(_0xcb2805)[_0x39e2('0x3a')](function(_0x4bed98){startRefreshInterval(_0x4bed98);});});return Promise[_0x39e2('0x4a')](_0x5c7dac);})[_0x39e2('0x44')](function(_0x58725a){var _0x11a43f=_0x58725a?util[_0x39e2('0x4b')](_0x58725a,{'showHidden':![],'depth':null}):'';logger[_0x39e2('0x4c')](_0x39e2('0x4d'),_0x11a43f);});}module[_0x39e2('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index e4cc104..02f45f2 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 _0xa24d=['http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2e6a65,_0x5027c8){var _0xf0a1aa=function(_0x554bb4){while(--_0x554bb4){_0x2e6a65['push'](_0x2e6a65['shift']());}};_0xf0a1aa(++_0x5027c8);}(_0xa24d,0x1c1));var _0xda24=function(_0x4dade6,_0x16b01d){_0x4dade6=_0x4dade6-0x0;var _0x513270=_0xa24d[_0x4dade6];return _0x513270;};'use strict';var _=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var moment=require(_0xda24('0x2'));var BPromise=require(_0xda24('0x3'));var rs=require(_0xda24('0x4'));var fs=require('fs');var Redis=require(_0xda24('0x5'));var db=require(_0xda24('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xda24('0x7'))(_0xda24('0x8'));var config=require(_0xda24('0x9'));var jayson=require(_0xda24('0xa'));var client=jayson['client'][_0xda24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdba54e,_0x5868af,_0x3d0ec5){return new BPromise(function(_0x48117a,_0x446e2e){return client[_0xda24('0xc')](_0xdba54e,_0x3d0ec5)[_0xda24('0xd')](function(_0x1dccb2){logger['info'](_0xda24('0xe'),_0x5868af,_0xda24('0xf'));logger[_0xda24('0x10')](_0xda24('0x11'),_0x5868af,_0xda24('0xf'),JSON['stringify'](_0x1dccb2));if(_0x1dccb2[_0xda24('0x12')]){if(_0x1dccb2['error'][_0xda24('0x13')]===0x1f4){logger[_0xda24('0x12')]('CloudProvider,\x20%s,\x20%s',_0x5868af,_0x1dccb2['error'][_0xda24('0x14')]);return _0x446e2e(_0x1dccb2[_0xda24('0x12')][_0xda24('0x14')]);}logger[_0xda24('0x12')]('CloudProvider,\x20%s,\x20%s',_0x5868af,_0x1dccb2[_0xda24('0x12')]['message']);return _0x48117a(_0x1dccb2[_0xda24('0x12')][_0xda24('0x14')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x5868af,_0xda24('0xf'));_0x48117a(_0x1dccb2[_0xda24('0x15')][_0xda24('0x14')]);}})[_0xda24('0x16')](function(_0x3348e0){logger[_0xda24('0x12')](_0xda24('0xe'),_0x5868af,_0x3348e0);_0x446e2e(_0x3348e0);});});}
\ No newline at end of file
+var _0x97ce=['jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x928c11,_0xe40543){var _0x238a4c=function(_0x1ba59a){while(--_0x1ba59a){_0x928c11['push'](_0x928c11['shift']());}};_0x238a4c(++_0xe40543);}(_0x97ce,0x151));var _0xe97c=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x97ce[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var BPromise=require(_0xe97c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe97c('0x5'));var logger=require('../../config/logger')(_0xe97c('0x6'));var config=require(_0xe97c('0x7'));var jayson=require(_0xe97c('0x8'));var client=jayson[_0xe97c('0x9')][_0xe97c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6603e0,_0x522f0a,_0x3bf4ef){return new BPromise(function(_0x9c1b00,_0x9ce6d){return client['request'](_0x6603e0,_0x3bf4ef)[_0xe97c('0xb')](function(_0x5717fb){logger[_0xe97c('0xc')](_0xe97c('0xd'),_0x522f0a,_0xe97c('0xe'));logger[_0xe97c('0xf')](_0xe97c('0x10'),_0x522f0a,_0xe97c('0xe'),JSON[_0xe97c('0x11')](_0x5717fb));if(_0x5717fb['error']){if(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x13')]===0x1f4){logger[_0xe97c('0x12')](_0xe97c('0xd'),_0x522f0a,_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);return _0x9ce6d(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);}logger[_0xe97c('0x12')]('CloudProvider,\x20%s,\x20%s',_0x522f0a,_0x5717fb['error'][_0xe97c('0x14')]);return _0x9c1b00(_0x5717fb['error'][_0xe97c('0x14')]);}else{logger[_0xe97c('0xc')]('CloudProvider,\x20%s,\x20%s',_0x522f0a,'request\x20sent');_0x9c1b00(_0x5717fb[_0xe97c('0x15')][_0xe97c('0x14')]);}})[_0xe97c('0x16')](function(_0x2e026d){logger['error']('CloudProvider,\x20%s,\x20%s',_0x522f0a,_0x2e026d);_0x9ce6d(_0x2e026d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 460bc4f..2f40822 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 _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x22cd70,_0x53a8e4){var _0x294433=function(_0x5915a8){while(--_0x5915a8){_0x22cd70['push'](_0x22cd70['shift']());}};_0x294433(++_0x53a8e4);}(_0xdb28,0x106));var _0x8db2=function(_0x4e54cc,_0x3f961){_0x4e54cc=_0x4e54cc-0x0;var _0x666e=_0xdb28[_0x4e54cc];return _0x666e;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x1261,0x144));var _0x1126=function(_0x4b9c29,_0x46c107){_0x4b9c29=_0x4b9c29-0x0;var _0xfacb34=_0x1261[_0x4b9c29];return _0xfacb34;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index d10772b..b6ab592 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 _0x3fe3=['sequelize','exports','STRING'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x3fe3,0x1aa));var _0x33fe=function(_0x4e2070,_0x5b96b6){_0x4e2070=_0x4e2070-0x0;var _0x562301=_0x3fe3[_0x4e2070];return _0x562301;};'use strict';var Sequelize=require(_0x33fe('0x0'));module[_0x33fe('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x33fe('0x2')]},'companyId':{'type':Sequelize[_0x33fe('0x2')]},'website':{'type':Sequelize[_0x33fe('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x33fe('0x2')]},'type':{'type':Sequelize[_0x33fe('0x2')]},'street':{'type':Sequelize[_0x33fe('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x33fe('0x2')]},'country':{'type':Sequelize[_0x33fe('0x2')]},'email':{'type':Sequelize[_0x33fe('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x33fe('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x44c5=['STRING','name','sequelize','exports'];(function(_0x5eb081,_0xdd0b42){var _0x21db0b=function(_0x21095a){while(--_0x21095a){_0x5eb081['push'](_0x5eb081['shift']());}};_0x21db0b(++_0xdd0b42);}(_0x44c5,0x76));var _0x544c=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x44c5[_0xaa6a4];return _0xdc31a4;};'use strict';var Sequelize=require(_0x544c('0x0'));module[_0x544c('0x1')]={'name':{'type':Sequelize[_0x544c('0x2')],'unique':_0x544c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x544c('0x2')]},'website':{'type':Sequelize[_0x544c('0x2')]},'phone':{'type':Sequelize[_0x544c('0x2')]},'fax':{'type':Sequelize[_0x544c('0x2')]},'type':{'type':Sequelize[_0x544c('0x2')]},'street':{'type':Sequelize[_0x544c('0x2')]},'postalCode':{'type':Sequelize[_0x544c('0x2')]},'city':{'type':Sequelize[_0x544c('0x2')]},'country':{'type':Sequelize[_0x544c('0x2')]},'email':{'type':Sequelize[_0x544c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x544c('0x2')]},'sStreet':{'type':Sequelize[_0x544c('0x2')]},'sPostalCode':{'type':Sequelize[_0x544c('0x2')]},'sCity':{'type':Sequelize[_0x544c('0x2')]},'sCountry':{'type':Sequelize[_0x544c('0x2')]},'description':{'type':Sequelize[_0x544c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 06e63e4..99e3e0a 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 _0xdefc=['reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','filter','options','CmCompany','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','merge','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x3411fa,_0x57f41d){var _0x5f20d1=function(_0x3a40ba){while(--_0x3a40ba){_0x3411fa['push'](_0x3411fa['shift']());}};_0x5f20d1(++_0x57f41d);}(_0xdefc,0x197));var _0xcdef=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0xdefc[_0x330141];return _0x1b68a2;};'use strict';var emlformat=require(_0xcdef('0x0'));var rimraf=require(_0xcdef('0x1'));var zipdir=require(_0xcdef('0x2'));var jsonpatch=require(_0xcdef('0x3'));var rp=require(_0xcdef('0x4'));var moment=require(_0xcdef('0x5'));var BPromise=require(_0xcdef('0x6'));var Mustache=require('mustache');var util=require(_0xcdef('0x7'));var path=require('path');var sox=require(_0xcdef('0x8'));var csv=require(_0xcdef('0x9'));var ejs=require(_0xcdef('0xa'));var fs=require('fs');var fs_extra=require(_0xcdef('0xb'));var _=require('lodash');var squel=require(_0xcdef('0xc'));var crypto=require(_0xcdef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcdef('0xe'));var toCsv=require(_0xcdef('0x9'));var querystring=require('querystring');var Papa=require(_0xcdef('0xf'));var Redis=require(_0xcdef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcdef('0x11'));var as=require(_0xcdef('0x12'));var hardwareService=require(_0xcdef('0x13'));var logger=require(_0xcdef('0x14'))(_0xcdef('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcdef('0x16'));var db=require(_0xcdef('0x17'))['db'];function respondWithStatusCode(_0xb4eff0,_0x346d9f){_0x346d9f=_0x346d9f||0xcc;return function(_0x4b82b3){if(_0x4b82b3){return _0xb4eff0['sendStatus'](_0x346d9f);}return _0xb4eff0[_0xcdef('0x18')](_0x346d9f)[_0xcdef('0x19')]();};}function respondWithResult(_0x301922,_0x4fccdb){_0x4fccdb=_0x4fccdb||0xc8;return function(_0x27e24c){if(_0x27e24c){return _0x301922['status'](_0x4fccdb)[_0xcdef('0x1a')](_0x27e24c);}};}function respondWithFilteredResult(_0x24def0,_0x2acbf5){return function(_0xbba4aa){if(_0xbba4aa){var _0x51c3d7=typeof _0x2acbf5['offset']===_0xcdef('0x1b')&&typeof _0x2acbf5[_0xcdef('0x1c')]===_0xcdef('0x1b');var _0x3c2418=_0xbba4aa[_0xcdef('0x1d')];var _0x41f85e=_0x51c3d7?0x0:_0x2acbf5[_0xcdef('0x1e')];var _0x13d0dd=_0x51c3d7?_0xbba4aa[_0xcdef('0x1d')]:_0x2acbf5['offset']+_0x2acbf5[_0xcdef('0x1c')];var _0x4713fa;if(_0x13d0dd>=_0x3c2418){_0x13d0dd=_0x3c2418;_0x4713fa=0xc8;}else{_0x4713fa=0xce;}_0x24def0[_0xcdef('0x18')](_0x4713fa);return _0x24def0[_0xcdef('0x1f')](_0xcdef('0x20'),_0x41f85e+'-'+_0x13d0dd+'/'+_0x3c2418)[_0xcdef('0x1a')](_0xbba4aa);}return null;};}function patchUpdates(_0x455624){return function(_0x5834c7){try{jsonpatch['apply'](_0x5834c7,_0x455624,!![]);}catch(_0x1c127b){return BPromise[_0xcdef('0x21')](_0x1c127b);}return _0x5834c7[_0xcdef('0x22')]();};}function saveUpdates(_0x46d4ca,_0x46ba21){return function(_0x2f6c3c){if(_0x2f6c3c){return _0x2f6c3c[_0xcdef('0x23')](_0x46d4ca)[_0xcdef('0x24')](function(_0x389b3a){return _0x389b3a;});}return null;};}function removeEntity(_0xa938b7,_0x5330eb){return function(_0x4d1bde){if(_0x4d1bde){return _0x4d1bde[_0xcdef('0x25')]()[_0xcdef('0x24')](function(){var _0x3daeae=_0x4d1bde[_0xcdef('0x26')]({'plain':!![]});var _0x45721a=_0xcdef('0x27');return db[_0xcdef('0x28')][_0xcdef('0x25')]({'where':{'type':_0x45721a,'resourceId':_0x3daeae['id']}})[_0xcdef('0x24')](function(){return _0x4d1bde;});})[_0xcdef('0x24')](function(){_0xa938b7['status'](0xcc)[_0xcdef('0x19')]();});}};}function handleEntityNotFound(_0x5a8f0c,_0x16d3c7){return function(_0x4834b6){if(!_0x4834b6){_0x5a8f0c[_0xcdef('0x29')](0x194);}return _0x4834b6;};}function handleError(_0x16c2d7,_0x12d008){_0x12d008=_0x12d008||0x1f4;return function(_0x1798bf){logger[_0xcdef('0x2a')](_0x1798bf[_0xcdef('0x2b')]);if(_0x1798bf[_0xcdef('0x2c')]){delete _0x1798bf[_0xcdef('0x2c')];}_0x16c2d7['status'](_0x12d008)[_0xcdef('0x2d')](_0x1798bf);};}exports[_0xcdef('0x2e')]=function(_0x192b10,_0x9769f6){var _0x5a9bba={},_0x2f3abd={},_0x189965={'count':0x0,'rows':[]};return db['CmCompany'][_0xcdef('0x2f')]()[_0xcdef('0x24')](function(_0x5dacc8){_0x2f3abd[_0xcdef('0x30')]=_['keys'](_0x5dacc8);_0x2f3abd[_0xcdef('0x31')]=_[_0xcdef('0x32')](_0x192b10['query']);_0x2f3abd[_0xcdef('0x33')]=_[_0xcdef('0x34')](_0x2f3abd[_0xcdef('0x30')],_0x2f3abd['query']);_0x5a9bba[_0xcdef('0x35')]=_['intersection'](_0x2f3abd[_0xcdef('0x30')],qs[_0xcdef('0x36')](_0x192b10[_0xcdef('0x31')][_0xcdef('0x36')]));_0x5a9bba['attributes']=_0x5a9bba[_0xcdef('0x35')][_0xcdef('0x37')]?_0x5a9bba[_0xcdef('0x35')]:_0x2f3abd[_0xcdef('0x30')];if(!_0x192b10['query'][_0xcdef('0x38')](_0xcdef('0x39'))){_0x5a9bba[_0xcdef('0x1c')]=qs[_0xcdef('0x1c')](_0x192b10[_0xcdef('0x31')][_0xcdef('0x1c')]);_0x5a9bba[_0xcdef('0x1e')]=qs[_0xcdef('0x1e')](_0x192b10[_0xcdef('0x31')][_0xcdef('0x1e')]);}_0x5a9bba[_0xcdef('0x3a')]=qs[_0xcdef('0x3b')](_0x192b10[_0xcdef('0x31')][_0xcdef('0x3b')]);_0x5a9bba[_0xcdef('0x3c')]=qs[_0xcdef('0x33')](_[_0xcdef('0x3d')](_0x192b10[_0xcdef('0x31')],_0x2f3abd[_0xcdef('0x33')]),_0x5dacc8);if(_0x192b10[_0xcdef('0x31')]['filter']){_0x5a9bba['where']=_['merge'](_0x5a9bba['where'],{'$or':_[_0xcdef('0x3e')](_0x5a9bba[_0xcdef('0x35')],function(_0xe9ea62){var _0x7c5a0a={};_0x7c5a0a[_0xe9ea62]={'$like':'%'+_0x192b10['query'][_0xcdef('0x3f')]+'%'};return _0x7c5a0a;})});}_0x5a9bba=_['merge']({},_0x5a9bba,_0x192b10[_0xcdef('0x40')]);var _0x5bda55={'where':_0x5a9bba[_0xcdef('0x3c')]};return db[_0xcdef('0x41')][_0xcdef('0x1d')](_0x5bda55)[_0xcdef('0x24')](function(_0x46236e){_0x189965[_0xcdef('0x1d')]=_0x46236e;if(_0x192b10[_0xcdef('0x31')][_0xcdef('0x42')]){_0x5a9bba[_0xcdef('0x43')]=[{'all':!![]}];}return db['CmCompany'][_0xcdef('0x44')](_0x5a9bba);})[_0xcdef('0x24')](function(_0x4b252e){_0x189965[_0xcdef('0x45')]=_0x4b252e;return _0x189965;})[_0xcdef('0x24')](respondWithFilteredResult(_0x9769f6,_0x5a9bba))[_0xcdef('0x46')](handleError(_0x9769f6,null));})[_0xcdef('0x46')](handleError(_0x9769f6,null));};exports[_0xcdef('0x47')]=function(_0x15dd5c,_0x374b60){var _0xfa9d5e={'raw':![],'where':{'id':_0x15dd5c['params']['id']}},_0x3d8a91={};_0x3d8a91['model']=_['keys'](db[_0xcdef('0x41')][_0xcdef('0x48')]);_0x3d8a91[_0xcdef('0x31')]=_[_0xcdef('0x32')](_0x15dd5c[_0xcdef('0x31')]);_0x3d8a91['filters']=_['intersection'](_0x3d8a91[_0xcdef('0x30')],_0x3d8a91[_0xcdef('0x31')]);_0xfa9d5e[_0xcdef('0x35')]=_[_0xcdef('0x34')](_0x3d8a91['model'],qs['fields'](_0x15dd5c[_0xcdef('0x31')][_0xcdef('0x36')]));_0xfa9d5e[_0xcdef('0x35')]=_0xfa9d5e[_0xcdef('0x35')][_0xcdef('0x37')]?_0xfa9d5e['attributes']:_0x3d8a91['model'];if(_0x15dd5c[_0xcdef('0x31')]['includeAll']){_0xfa9d5e[_0xcdef('0x43')]=[{'all':!![]}];}_0xfa9d5e=_['merge']({},_0xfa9d5e,_0x15dd5c[_0xcdef('0x40')]);return db[_0xcdef('0x41')]['find'](_0xfa9d5e)[_0xcdef('0x24')](handleEntityNotFound(_0x374b60,null))[_0xcdef('0x24')](respondWithResult(_0x374b60,null))[_0xcdef('0x46')](handleError(_0x374b60,null));};exports[_0xcdef('0x49')]=function(_0x102174,_0x56a5a7){return db[_0xcdef('0x41')]['create'](_0x102174[_0xcdef('0x4a')],{})[_0xcdef('0x24')](function(_0x494fb1){var _0x2da6fd=_0x102174[_0xcdef('0x4b')][_0xcdef('0x26')]({'plain':!![]});if(!_0x2da6fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2da6fd['role']===_0xcdef('0x4b')){var _0x317952=_0x494fb1['get']({'plain':!![]});var _0x36e26b='Companies';return db['UserProfileSection'][_0xcdef('0x4c')]({'where':{'name':_0x36e26b,'userProfileId':_0x2da6fd[_0xcdef('0x4d')]},'raw':!![]})['then'](function(_0x1f685b){if(_0x1f685b&&_0x1f685b[_0xcdef('0x4e')]===0x0){return db['UserProfileResource'][_0xcdef('0x49')]({'name':_0x317952[_0xcdef('0x2c')],'resourceId':_0x317952['id'],'type':_0x1f685b[_0xcdef('0x2c')],'sectionId':_0x1f685b['id']},{})[_0xcdef('0x24')](function(){return _0x494fb1;});}else{return _0x494fb1;}})[_0xcdef('0x46')](function(_0x48c355){logger[_0xcdef('0x2a')](_0xcdef('0x4f'),_0x48c355);throw _0x48c355;});}return _0x494fb1;})[_0xcdef('0x24')](respondWithResult(_0x56a5a7,0xc9))['catch'](handleError(_0x56a5a7,null));};exports[_0xcdef('0x23')]=function(_0x5678e8,_0x1ed5bf){if(_0x5678e8[_0xcdef('0x4a')]['id']){delete _0x5678e8[_0xcdef('0x4a')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x5678e8['params']['id']}})[_0xcdef('0x24')](handleEntityNotFound(_0x1ed5bf,null))[_0xcdef('0x24')](saveUpdates(_0x5678e8[_0xcdef('0x4a')],null))['then'](respondWithResult(_0x1ed5bf,null))[_0xcdef('0x46')](handleError(_0x1ed5bf,null));};exports[_0xcdef('0x25')]=function(_0xab49f3,_0x11c691){return db[_0xcdef('0x41')]['find']({'where':{'id':_0xab49f3[_0xcdef('0x50')]['id']}})[_0xcdef('0x24')](handleEntityNotFound(_0x11c691,null))[_0xcdef('0x24')](removeEntity(_0x11c691,null))[_0xcdef('0x46')](handleError(_0x11c691,null));};exports[_0xcdef('0x2f')]=function(_0x2d5010,_0x299f89){return db[_0xcdef('0x41')][_0xcdef('0x2f')]()[_0xcdef('0x24')](respondWithResult(_0x299f89,null))[_0xcdef('0x46')](handleError(_0x299f89,null));};exports[_0xcdef('0x51')]=function(_0x56e4f1,_0x423cef,_0x448545){return db[_0xcdef('0x52')][_0xcdef('0x4c')]({'where':{'id':_0x56e4f1[_0xcdef('0x50')]['id']}})[_0xcdef('0x24')](handleEntityNotFound(_0x423cef,null))['then'](function(_0x29b2c8){if(_0x29b2c8){return _0x29b2c8[_0xcdef('0x51')](_0x56e4f1[_0xcdef('0x4a')][_0xcdef('0x53')],_[_0xcdef('0x54')](_0x56e4f1[_0xcdef('0x4a')],[_0xcdef('0x53'),'id'])||{});}})[_0xcdef('0x24')](respondWithResult(_0x423cef,null))['catch'](handleError(_0x423cef,null));};exports[_0xcdef('0x55')]=function(_0x215f29,_0x5a3b97,_0x246671){var _0x54a947={};var _0x49fc94={};var _0x5ceefc;var _0x299397;return db[_0xcdef('0x41')][_0xcdef('0x56')]({'where':{'id':_0x215f29[_0xcdef('0x50')]['id']}})[_0xcdef('0x24')](handleEntityNotFound(_0x5a3b97,null))[_0xcdef('0x24')](function(_0x547449){if(_0x547449){_0x5ceefc=_0x547449;_0x49fc94[_0xcdef('0x30')]=_[_0xcdef('0x32')](db[_0xcdef('0x52')][_0xcdef('0x48')]);_0x49fc94[_0xcdef('0x31')]=_['keys'](_0x215f29[_0xcdef('0x31')]);_0x49fc94[_0xcdef('0x33')]=_['intersection'](_0x49fc94[_0xcdef('0x30')],_0x49fc94[_0xcdef('0x31')]);_0x54a947[_0xcdef('0x35')]=_[_0xcdef('0x34')](_0x49fc94[_0xcdef('0x30')],qs['fields'](_0x215f29['query']['fields']));_0x54a947[_0xcdef('0x35')]=_0x54a947[_0xcdef('0x35')][_0xcdef('0x37')]?_0x54a947[_0xcdef('0x35')]:_0x49fc94[_0xcdef('0x30')];_0x54a947[_0xcdef('0x3a')]=qs[_0xcdef('0x3b')](_0x215f29['query'][_0xcdef('0x3b')]);_0x54a947[_0xcdef('0x3c')]=qs['filters'](_[_0xcdef('0x3d')](_0x215f29[_0xcdef('0x31')],_0x49fc94[_0xcdef('0x33')]));if(_0x215f29[_0xcdef('0x31')][_0xcdef('0x3f')]){_0x54a947[_0xcdef('0x3c')]=_['merge'](_0x54a947['where'],{'$or':_[_0xcdef('0x3e')](_0x54a947['attributes'],function(_0xc8258e){var _0x54e0a0={};_0x54e0a0[_0xc8258e]={'$like':'%'+_0x215f29[_0xcdef('0x31')][_0xcdef('0x3f')]+'%'};return _0x54e0a0;})});}_0x54a947=_[_0xcdef('0x57')]({},_0x54a947,_0x215f29[_0xcdef('0x40')]);return _0x5ceefc[_0xcdef('0x55')](_0x54a947);}})[_0xcdef('0x24')](function(_0x4a5892){if(_0x4a5892){_0x299397=_0x4a5892['length'];if(!_0x215f29['query'][_0xcdef('0x38')](_0xcdef('0x39'))){_0x54a947[_0xcdef('0x1c')]=qs[_0xcdef('0x1c')](_0x215f29[_0xcdef('0x31')][_0xcdef('0x1c')]);_0x54a947['offset']=qs['offset'](_0x215f29['query'][_0xcdef('0x1e')]);}return _0x5ceefc[_0xcdef('0x55')](_0x54a947);}})[_0xcdef('0x24')](function(_0x116e38){if(_0x116e38){return _0x116e38?{'count':_0x299397,'rows':_0x116e38}:null;}})[_0xcdef('0x24')](respondWithResult(_0x5a3b97,null))[_0xcdef('0x46')](handleError(_0x5a3b97,null));};
\ No newline at end of file
+var _0x76b4=['ejs','fs-extra','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','save','then','destroy','Companies','UserProfileResource','stack','name','index','CmCompany','describe','keys','query','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','include','rows','catch','show','params','fields','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','findOne','rawAttributes','filter','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x76b4,0x18f));var _0x476b=function(_0x4228e7,_0x31f8b3){_0x4228e7=_0x4228e7-0x0;var _0x4fb2df=_0x76b4[_0x4228e7];return _0x4fb2df;};'use strict';var emlformat=require(_0x476b('0x0'));var rimraf=require(_0x476b('0x1'));var zipdir=require(_0x476b('0x2'));var jsonpatch=require(_0x476b('0x3'));var rp=require(_0x476b('0x4'));var moment=require('moment');var BPromise=require(_0x476b('0x5'));var Mustache=require(_0x476b('0x6'));var util=require(_0x476b('0x7'));var path=require(_0x476b('0x8'));var sox=require(_0x476b('0x9'));var csv=require(_0x476b('0xa'));var ejs=require(_0x476b('0xb'));var fs=require('fs');var fs_extra=require(_0x476b('0xc'));var _=require('lodash');var squel=require(_0x476b('0xd'));var crypto=require(_0x476b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x476b('0xa'));var querystring=require('querystring');var Papa=require(_0x476b('0xf'));var Redis=require('ioredis');var authService=require(_0x476b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x476b('0x11'));var hardwareService=require(_0x476b('0x12'));var logger=require(_0x476b('0x13'))('api');var utils=require(_0x476b('0x14'));var config=require(_0x476b('0x15'));var licenseUtil=require(_0x476b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29d29b,_0x584933){_0x584933=_0x584933||0xcc;return function(_0x306adf){if(_0x306adf){return _0x29d29b['sendStatus'](_0x584933);}return _0x29d29b[_0x476b('0x17')](_0x584933)[_0x476b('0x18')]();};}function respondWithResult(_0x26ef22,_0x624393){_0x624393=_0x624393||0xc8;return function(_0x49e471){if(_0x49e471){return _0x26ef22[_0x476b('0x17')](_0x624393)[_0x476b('0x19')](_0x49e471);}};}function respondWithFilteredResult(_0x3d095f,_0x4ae6f4){return function(_0x354584){if(_0x354584){var _0x4a9947=typeof _0x4ae6f4[_0x476b('0x1a')]===_0x476b('0x1b')&&typeof _0x4ae6f4[_0x476b('0x1c')]===_0x476b('0x1b');var _0x2c3b89=_0x354584[_0x476b('0x1d')];var _0x5ea21c=_0x4a9947?0x0:_0x4ae6f4[_0x476b('0x1a')];var _0x5a30a6=_0x4a9947?_0x354584[_0x476b('0x1d')]:_0x4ae6f4[_0x476b('0x1a')]+_0x4ae6f4[_0x476b('0x1c')];var _0x5dd385;if(_0x5a30a6>=_0x2c3b89){_0x5a30a6=_0x2c3b89;_0x5dd385=0xc8;}else{_0x5dd385=0xce;}_0x3d095f[_0x476b('0x17')](_0x5dd385);return _0x3d095f[_0x476b('0x1e')]('Content-Range',_0x5ea21c+'-'+_0x5a30a6+'/'+_0x2c3b89)[_0x476b('0x19')](_0x354584);}return null;};}function patchUpdates(_0x4b281b){return function(_0x7fd81e){try{jsonpatch['apply'](_0x7fd81e,_0x4b281b,!![]);}catch(_0x1fc7f0){return BPromise['reject'](_0x1fc7f0);}return _0x7fd81e[_0x476b('0x1f')]();};}function saveUpdates(_0x190c7f,_0x2a59af){return function(_0x490fc3){if(_0x490fc3){return _0x490fc3['update'](_0x190c7f)[_0x476b('0x20')](function(_0x4d80ad){return _0x4d80ad;});}return null;};}function removeEntity(_0x405023,_0x5c5c6d){return function(_0x494b7f){if(_0x494b7f){return _0x494b7f[_0x476b('0x21')]()[_0x476b('0x20')](function(){var _0x4de7c0=_0x494b7f['get']({'plain':!![]});var _0x479209=_0x476b('0x22');return db[_0x476b('0x23')][_0x476b('0x21')]({'where':{'type':_0x479209,'resourceId':_0x4de7c0['id']}})[_0x476b('0x20')](function(){return _0x494b7f;});})[_0x476b('0x20')](function(){_0x405023[_0x476b('0x17')](0xcc)[_0x476b('0x18')]();});}};}function handleEntityNotFound(_0x3d9b61,_0x4c0b45){return function(_0x4ccf46){if(!_0x4ccf46){_0x3d9b61['sendStatus'](0x194);}return _0x4ccf46;};}function handleError(_0x39aa47,_0x75421d){_0x75421d=_0x75421d||0x1f4;return function(_0x2064d8){logger['error'](_0x2064d8[_0x476b('0x24')]);if(_0x2064d8[_0x476b('0x25')]){delete _0x2064d8[_0x476b('0x25')];}_0x39aa47[_0x476b('0x17')](_0x75421d)['send'](_0x2064d8);};}exports[_0x476b('0x26')]=function(_0x12e9a7,_0x59808e){var _0x49855d={},_0x3381c7={},_0x46b9a8={'count':0x0,'rows':[]};return db[_0x476b('0x27')][_0x476b('0x28')]()[_0x476b('0x20')](function(_0x5161b3){_0x3381c7['model']=_[_0x476b('0x29')](_0x5161b3);_0x3381c7[_0x476b('0x2a')]=_[_0x476b('0x29')](_0x12e9a7[_0x476b('0x2a')]);_0x3381c7[_0x476b('0x2b')]=_[_0x476b('0x2c')](_0x3381c7['model'],_0x3381c7[_0x476b('0x2a')]);_0x49855d[_0x476b('0x2d')]=_['intersection'](_0x3381c7[_0x476b('0x2e')],qs['fields'](_0x12e9a7[_0x476b('0x2a')]['fields']));_0x49855d[_0x476b('0x2d')]=_0x49855d[_0x476b('0x2d')][_0x476b('0x2f')]?_0x49855d[_0x476b('0x2d')]:_0x3381c7['model'];if(!_0x12e9a7[_0x476b('0x2a')][_0x476b('0x30')](_0x476b('0x31'))){_0x49855d['limit']=qs[_0x476b('0x1c')](_0x12e9a7[_0x476b('0x2a')]['limit']);_0x49855d[_0x476b('0x1a')]=qs[_0x476b('0x1a')](_0x12e9a7[_0x476b('0x2a')][_0x476b('0x1a')]);}_0x49855d[_0x476b('0x32')]=qs[_0x476b('0x33')](_0x12e9a7[_0x476b('0x2a')][_0x476b('0x33')]);_0x49855d[_0x476b('0x34')]=qs[_0x476b('0x2b')](_[_0x476b('0x35')](_0x12e9a7[_0x476b('0x2a')],_0x3381c7[_0x476b('0x2b')]),_0x5161b3);if(_0x12e9a7[_0x476b('0x2a')]['filter']){_0x49855d['where']=_['merge'](_0x49855d['where'],{'$or':_['map'](_0x49855d[_0x476b('0x2d')],function(_0x11400f){var _0x2d0caf={};_0x2d0caf[_0x11400f]={'$like':'%'+_0x12e9a7[_0x476b('0x2a')]['filter']+'%'};return _0x2d0caf;})});}_0x49855d=_[_0x476b('0x36')]({},_0x49855d,_0x12e9a7['options']);var _0x2050d3={'where':_0x49855d[_0x476b('0x34')]};return db['CmCompany'][_0x476b('0x1d')](_0x2050d3)[_0x476b('0x20')](function(_0x17a195){_0x46b9a8[_0x476b('0x1d')]=_0x17a195;if(_0x12e9a7[_0x476b('0x2a')]['includeAll']){_0x49855d[_0x476b('0x37')]=[{'all':!![]}];}return db[_0x476b('0x27')]['findAll'](_0x49855d);})[_0x476b('0x20')](function(_0x34790c){_0x46b9a8[_0x476b('0x38')]=_0x34790c;return _0x46b9a8;})[_0x476b('0x20')](respondWithFilteredResult(_0x59808e,_0x49855d))['catch'](handleError(_0x59808e,null));})[_0x476b('0x39')](handleError(_0x59808e,null));};exports[_0x476b('0x3a')]=function(_0x392b8a,_0x1cec07){var _0x17d5b2={'raw':![],'where':{'id':_0x392b8a[_0x476b('0x3b')]['id']}},_0x51de94={};_0x51de94[_0x476b('0x2e')]=_[_0x476b('0x29')](db[_0x476b('0x27')]['rawAttributes']);_0x51de94[_0x476b('0x2a')]=_[_0x476b('0x29')](_0x392b8a[_0x476b('0x2a')]);_0x51de94[_0x476b('0x2b')]=_['intersection'](_0x51de94[_0x476b('0x2e')],_0x51de94['query']);_0x17d5b2[_0x476b('0x2d')]=_[_0x476b('0x2c')](_0x51de94[_0x476b('0x2e')],qs[_0x476b('0x3c')](_0x392b8a[_0x476b('0x2a')][_0x476b('0x3c')]));_0x17d5b2[_0x476b('0x2d')]=_0x17d5b2['attributes']['length']?_0x17d5b2[_0x476b('0x2d')]:_0x51de94[_0x476b('0x2e')];if(_0x392b8a['query'][_0x476b('0x3d')]){_0x17d5b2[_0x476b('0x37')]=[{'all':!![]}];}_0x17d5b2=_['merge']({},_0x17d5b2,_0x392b8a['options']);return db[_0x476b('0x27')][_0x476b('0x3e')](_0x17d5b2)[_0x476b('0x20')](handleEntityNotFound(_0x1cec07,null))['then'](respondWithResult(_0x1cec07,null))[_0x476b('0x39')](handleError(_0x1cec07,null));};exports[_0x476b('0x3f')]=function(_0x66a418,_0x53edb3){return db['CmCompany']['create'](_0x66a418[_0x476b('0x40')],{})[_0x476b('0x20')](function(_0x3ab3ef){var _0x54dcb5=_0x66a418[_0x476b('0x41')][_0x476b('0x42')]({'plain':!![]});if(!_0x54dcb5)throw new Error(_0x476b('0x43'));if(_0x54dcb5[_0x476b('0x44')]===_0x476b('0x41')){var _0x485ace=_0x3ab3ef[_0x476b('0x42')]({'plain':!![]});var _0x556905='Companies';return db['UserProfileSection'][_0x476b('0x3e')]({'where':{'name':_0x556905,'userProfileId':_0x54dcb5['userProfileId']},'raw':!![]})['then'](function(_0x54c15e){if(_0x54c15e&&_0x54c15e[_0x476b('0x45')]===0x0){return db[_0x476b('0x23')][_0x476b('0x3f')]({'name':_0x485ace[_0x476b('0x25')],'resourceId':_0x485ace['id'],'type':_0x54c15e['name'],'sectionId':_0x54c15e['id']},{})[_0x476b('0x20')](function(){return _0x3ab3ef;});}else{return _0x3ab3ef;}})[_0x476b('0x39')](function(_0x45b3e5){logger[_0x476b('0x46')](_0x476b('0x47'),_0x45b3e5);throw _0x45b3e5;});}return _0x3ab3ef;})[_0x476b('0x20')](respondWithResult(_0x53edb3,0xc9))['catch'](handleError(_0x53edb3,null));};exports[_0x476b('0x48')]=function(_0x3de89b,_0x4e4d9c){if(_0x3de89b['body']['id']){delete _0x3de89b[_0x476b('0x40')]['id'];}return db['CmCompany'][_0x476b('0x3e')]({'where':{'id':_0x3de89b[_0x476b('0x3b')]['id']}})[_0x476b('0x20')](handleEntityNotFound(_0x4e4d9c,null))[_0x476b('0x20')](saveUpdates(_0x3de89b[_0x476b('0x40')],null))[_0x476b('0x20')](respondWithResult(_0x4e4d9c,null))[_0x476b('0x39')](handleError(_0x4e4d9c,null));};exports[_0x476b('0x21')]=function(_0x4b914f,_0x2550c1){return db[_0x476b('0x27')][_0x476b('0x3e')]({'where':{'id':_0x4b914f['params']['id']}})['then'](handleEntityNotFound(_0x2550c1,null))[_0x476b('0x20')](removeEntity(_0x2550c1,null))['catch'](handleError(_0x2550c1,null));};exports[_0x476b('0x28')]=function(_0x17a32c,_0x4a63f2){return db['CmCompany']['describe']()[_0x476b('0x20')](respondWithResult(_0x4a63f2,null))['catch'](handleError(_0x4a63f2,null));};exports[_0x476b('0x49')]=function(_0x1ac042,_0x307343,_0x568269){return db[_0x476b('0x4a')][_0x476b('0x3e')]({'where':{'id':_0x1ac042[_0x476b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x307343,null))['then'](function(_0x8de5cb){if(_0x8de5cb){return _0x8de5cb['addContacts'](_0x1ac042[_0x476b('0x40')][_0x476b('0x4b')],_[_0x476b('0x4c')](_0x1ac042['body'],[_0x476b('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x307343,null))['catch'](handleError(_0x307343,null));};exports['getContacts']=function(_0x277fc5,_0x965e62,_0x5d40db){var _0xf2889f={};var _0x31530b={};var _0x77378d;var _0x122bb1;return db[_0x476b('0x27')][_0x476b('0x4d')]({'where':{'id':_0x277fc5[_0x476b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x965e62,null))[_0x476b('0x20')](function(_0xc93b20){if(_0xc93b20){_0x77378d=_0xc93b20;_0x31530b[_0x476b('0x2e')]=_[_0x476b('0x29')](db[_0x476b('0x4a')][_0x476b('0x4e')]);_0x31530b[_0x476b('0x2a')]=_[_0x476b('0x29')](_0x277fc5['query']);_0x31530b[_0x476b('0x2b')]=_[_0x476b('0x2c')](_0x31530b['model'],_0x31530b[_0x476b('0x2a')]);_0xf2889f[_0x476b('0x2d')]=_[_0x476b('0x2c')](_0x31530b['model'],qs[_0x476b('0x3c')](_0x277fc5['query'][_0x476b('0x3c')]));_0xf2889f[_0x476b('0x2d')]=_0xf2889f[_0x476b('0x2d')][_0x476b('0x2f')]?_0xf2889f[_0x476b('0x2d')]:_0x31530b['model'];_0xf2889f[_0x476b('0x32')]=qs[_0x476b('0x33')](_0x277fc5[_0x476b('0x2a')]['sort']);_0xf2889f[_0x476b('0x34')]=qs[_0x476b('0x2b')](_['pick'](_0x277fc5['query'],_0x31530b['filters']));if(_0x277fc5['query'][_0x476b('0x4f')]){_0xf2889f[_0x476b('0x34')]=_[_0x476b('0x36')](_0xf2889f[_0x476b('0x34')],{'$or':_[_0x476b('0x50')](_0xf2889f[_0x476b('0x2d')],function(_0x119a4d){var _0x432388={};_0x432388[_0x119a4d]={'$like':'%'+_0x277fc5[_0x476b('0x2a')][_0x476b('0x4f')]+'%'};return _0x432388;})});}_0xf2889f=_[_0x476b('0x36')]({},_0xf2889f,_0x277fc5['options']);return _0x77378d[_0x476b('0x51')](_0xf2889f);}})['then'](function(_0x7b044f){if(_0x7b044f){_0x122bb1=_0x7b044f['length'];if(!_0x277fc5[_0x476b('0x2a')][_0x476b('0x30')](_0x476b('0x31'))){_0xf2889f[_0x476b('0x1c')]=qs[_0x476b('0x1c')](_0x277fc5['query']['limit']);_0xf2889f[_0x476b('0x1a')]=qs[_0x476b('0x1a')](_0x277fc5['query'][_0x476b('0x1a')]);}return _0x77378d[_0x476b('0x51')](_0xf2889f);}})[_0x476b('0x20')](function(_0x352f6b){if(_0x352f6b){return _0x352f6b?{'count':_0x122bb1,'rows':_0x352f6b}:null;}})[_0x476b('0x20')](respondWithResult(_0x965e62,null))[_0x476b('0x39')](handleError(_0x965e62,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 722dbba..df6479a 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 _0x1ef9=['bluebird','path','../../config/environment','define','CmCompany','lodash','../../config/logger','api','moment'];(function(_0x460103,_0x5397b7){var _0x44499c=function(_0x1da241){while(--_0x1da241){_0x460103['push'](_0x460103['shift']());}};_0x44499c(++_0x5397b7);}(_0x1ef9,0x1be));var _0x91ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ef9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91ef('0x0'));var util=require('util');var logger=require(_0x91ef('0x1'))(_0x91ef('0x2'));var moment=require(_0x91ef('0x3'));var BPromise=require(_0x91ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91ef('0x5'));var rimraf=require('rimraf');var config=require(_0x91ef('0x6'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x4efe10,_0x5d8750){return _0x4efe10[_0x91ef('0x7')](_0x91ef('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe03e=['../../config/environment','./cmCompany.attributes','exports','cm_companies','api','moment','bluebird','request-promise','rimraf'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe03e,0x1e1));var _0xee03=function(_0x5db38a,_0x3750d3){_0x5db38a=_0x5db38a-0x0;var _0x79eb3f=_0xe03e[_0x5db38a];return _0x79eb3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xee03('0x0'));var moment=require(_0xee03('0x1'));var BPromise=require(_0xee03('0x2'));var rp=require(_0xee03('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee03('0x4'));var config=require(_0xee03('0x5'));var attributes=require(_0xee03('0x6'));module[_0xee03('0x7')]=function(_0xdb8d90,_0x531db8){return _0xdb8d90['define']('CmCompany',attributes,{'tableName':_0xee03('0x8'),'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 04f7b5e..030b03c 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 _0xc217=['rpc','../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xc217,0x68));var _0x7c21=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xc217[_0x158f01];return _0x5ef74e;};'use strict';var _=require(_0x7c21('0x0'));var util=require(_0x7c21('0x1'));var moment=require('moment');var BPromise=require(_0x7c21('0x2'));var rs=require(_0x7c21('0x3'));var fs=require('fs');var Redis=require(_0x7c21('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c21('0x5'));var logger=require('../../config/logger')(_0x7c21('0x6'));var config=require(_0x7c21('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7c21('0x8')][_0x7c21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32de9e,_0xb50afe,_0xdcd342){return new BPromise(function(_0x4faa55,_0x2f9b53){return client['request'](_0x32de9e,_0xdcd342)[_0x7c21('0xa')](function(_0x835270){logger[_0x7c21('0xb')](_0x7c21('0xc'),_0xb50afe,_0x7c21('0xd'));logger[_0x7c21('0xe')](_0x7c21('0xf'),_0xb50afe,'request\x20sent',JSON[_0x7c21('0x10')](_0x835270));if(_0x835270[_0x7c21('0x11')]){if(_0x835270['error'][_0x7c21('0x12')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0xb50afe,_0x835270['error'][_0x7c21('0x13')]);return _0x2f9b53(_0x835270[_0x7c21('0x11')][_0x7c21('0x13')]);}logger[_0x7c21('0x11')](_0x7c21('0xc'),_0xb50afe,_0x835270[_0x7c21('0x11')][_0x7c21('0x13')]);return _0x4faa55(_0x835270[_0x7c21('0x11')]['message']);}else{logger[_0x7c21('0xb')](_0x7c21('0xc'),_0xb50afe,_0x7c21('0xd'));_0x4faa55(_0x835270[_0x7c21('0x14')]['message']);}})[_0x7c21('0x15')](function(_0x308ce2){logger[_0x7c21('0x11')](_0x7c21('0xc'),_0xb50afe,_0x308ce2);_0x2f9b53(_0x308ce2);});});}
\ No newline at end of file
+var _0x6a7f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash'];(function(_0x5ee8ef,_0x411b49){var _0x286dc4=function(_0x5df061){while(--_0x5df061){_0x5ee8ef['push'](_0x5ee8ef['shift']());}};_0x286dc4(++_0x411b49);}(_0x6a7f,0x72));var _0xf6a7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6a7f[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf6a7('0x0'));var util=require(_0xf6a7('0x1'));var moment=require(_0xf6a7('0x2'));var BPromise=require(_0xf6a7('0x3'));var rs=require(_0xf6a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6a7('0x5'))['db'];var utils=require(_0xf6a7('0x6'));var logger=require('../../config/logger')(_0xf6a7('0x7'));var config=require(_0xf6a7('0x8'));var jayson=require(_0xf6a7('0x9'));var client=jayson[_0xf6a7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c83d3,_0xb2177b,_0x10f204){return new BPromise(function(_0x1c697f,_0x956862){return client['request'](_0x4c83d3,_0x10f204)[_0xf6a7('0xb')](function(_0x26c852){logger['info'](_0xf6a7('0xc'),_0xb2177b,'request\x20sent');logger[_0xf6a7('0xd')](_0xf6a7('0xe'),_0xb2177b,'request\x20sent',JSON[_0xf6a7('0xf')](_0x26c852));if(_0x26c852[_0xf6a7('0x10')]){if(_0x26c852['error'][_0xf6a7('0x11')]===0x1f4){logger['error'](_0xf6a7('0xc'),_0xb2177b,_0x26c852[_0xf6a7('0x10')][_0xf6a7('0x12')]);return _0x956862(_0x26c852[_0xf6a7('0x10')][_0xf6a7('0x12')]);}logger[_0xf6a7('0x10')](_0xf6a7('0xc'),_0xb2177b,_0x26c852[_0xf6a7('0x10')]['message']);return _0x1c697f(_0x26c852[_0xf6a7('0x10')][_0xf6a7('0x12')]);}else{logger[_0xf6a7('0x13')]('CmCompany,\x20%s,\x20%s',_0xb2177b,_0xf6a7('0x14'));_0x1c697f(_0x26c852[_0xf6a7('0x15')][_0xf6a7('0x12')]);}})[_0xf6a7('0x16')](function(_0x138af0){logger['error']('CmCompany,\x20%s,\x20%s',_0xb2177b,_0x138af0);_0x956862(_0x138af0);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 4684b53..5ef19a0 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 _0x9900=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','connect-timeout','express'];(function(_0x2e068a,_0x29903b){var _0x4c6aae=function(_0x1bc648){while(--_0x1bc648){_0x2e068a['push'](_0x2e068a['shift']());}};_0x4c6aae(++_0x29903b);}(_0x9900,0x16e));var _0x0990=function(_0x3f7edf,_0x2c96ce){_0x3f7edf=_0x3f7edf-0x0;var _0xa8d31c=_0x9900[_0x3f7edf];return _0xa8d31c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0990('0x0'));var express=require(_0x0990('0x1'));var router=express[_0x0990('0x2')]();var fs_extra=require(_0x0990('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0990('0x4'));var config=require(_0x0990('0x5'));var controller=require(_0x0990('0x6'));router['get']('/',auth[_0x0990('0x7')](),controller[_0x0990('0x8')]);router[_0x0990('0x9')](_0x0990('0xa'),auth[_0x0990('0x7')](),controller[_0x0990('0xb')]);router['get'](_0x0990('0xc'),auth['isAuthenticated'](),controller[_0x0990('0xd')]);router['get'](_0x0990('0xe'),auth[_0x0990('0x7')](),controller['getContacts']);router[_0x0990('0xf')]('/',auth[_0x0990('0x7')](),controller[_0x0990('0x10')]);router[_0x0990('0xf')](_0x0990('0xe'),auth['isAuthenticated'](),controller[_0x0990('0x11')]);router[_0x0990('0x12')](_0x0990('0xc'),auth[_0x0990('0x7')](),controller[_0x0990('0x13')]);router[_0x0990('0x14')](_0x0990('0xc'),auth[_0x0990('0x7')](),controller[_0x0990('0x15')]);module[_0x0990('0x16')]=router;
\ No newline at end of file
+var _0x3867=['describe','/:id','show','/:id/contacts','getContacts','addContacts','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x4b0c90,_0x265ec3){var _0x22ca66=function(_0x5aac20){while(--_0x5aac20){_0x4b0c90['push'](_0x4b0c90['shift']());}};_0x22ca66(++_0x265ec3);}(_0x3867,0x15f));var _0x7386=function(_0x432664,_0x4edf2e){_0x432664=_0x432664-0x0;var _0x3338b3=_0x3867[_0x432664];return _0x3338b3;};'use strict';var multer=require('multer');var util=require(_0x7386('0x0'));var path=require(_0x7386('0x1'));var timeout=require(_0x7386('0x2'));var express=require('express');var router=express[_0x7386('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7386('0x4'));var interaction=require(_0x7386('0x5'));var config=require(_0x7386('0x6'));var controller=require('./cmCompany.controller');router[_0x7386('0x7')]('/',auth['isAuthenticated'](),controller[_0x7386('0x8')]);router['get']('/describe',auth[_0x7386('0x9')](),controller[_0x7386('0xa')]);router[_0x7386('0x7')](_0x7386('0xb'),auth[_0x7386('0x9')](),controller[_0x7386('0xc')]);router[_0x7386('0x7')](_0x7386('0xd'),auth[_0x7386('0x9')](),controller[_0x7386('0xe')]);router['post']('/',auth[_0x7386('0x9')](),controller['create']);router['post'](_0x7386('0xd'),auth[_0x7386('0x9')](),controller[_0x7386('0xf')]);router['put']('/:id',auth[_0x7386('0x9')](),controller[_0x7386('0x10')]);router[_0x7386('0x11')](_0x7386('0xb'),auth[_0x7386('0x9')](),controller['destroy']);module[_0x7386('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index e5a2411..f68ee90 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 _0x1e37=['TEXT','UNSIGNED','INTEGER','lodash','sequelize','exports','STRING'];(function(_0x445587,_0x20453a){var _0x3d795c=function(_0x5a2f5d){while(--_0x5a2f5d){_0x445587['push'](_0x445587['shift']());}};_0x3d795c(++_0x20453a);}(_0x1e37,0xff));var _0x71e3=function(_0x935271,_0x3c166c){_0x935271=_0x935271-0x0;var _0xa79e5e=_0x1e37[_0x935271];return _0xa79e5e;};'use strict';var _=require(_0x71e3('0x0'));var Sequelize=require(_0x71e3('0x1'));module[_0x71e3('0x2')]={'firstName':{'type':Sequelize[_0x71e3('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x71e3('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x71e3('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x71e3('0x3')]},'description':{'type':Sequelize[_0x71e3('0x4')]},'phone':{'type':Sequelize[_0x71e3('0x3')]},'mobile':{'type':Sequelize[_0x71e3('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x71e3('0x3')]},'url':{'type':Sequelize[_0x71e3('0x3')]},'facebook':{'type':Sequelize[_0x71e3('0x3')]},'fb_data':{'type':Sequelize[_0x71e3('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x71e3('0x3')]},'teams':{'type':Sequelize[_0x71e3('0x3')]},'viber':{'type':Sequelize[_0x71e3('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x71e3('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x71e3('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x71e3('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x71e3('0x3')]},'utcOffset':{'type':Sequelize[_0x71e3('0x6')]}};
\ No newline at end of file
+var _0xf068=['exports','STRING','INTEGER','UNSIGNED','NOW','lodash'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xf068,0xa7));var _0x8f06=function(_0x2a59b0,_0x481f45){_0x2a59b0=_0x2a59b0-0x0;var _0x2f5b70=_0xf068[_0x2a59b0];return _0x2f5b70;};'use strict';var _=require(_0x8f06('0x0'));var Sequelize=require('sequelize');module[_0x8f06('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x8f06('0x2')]},'street':{'type':Sequelize[_0x8f06('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8f06('0x2')]},'country':{'type':Sequelize[_0x8f06('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8f06('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x8f06('0x2')]},'mobile':{'type':Sequelize[_0x8f06('0x2')]},'fax':{'type':Sequelize[_0x8f06('0x2')]},'email':{'type':Sequelize[_0x8f06('0x2')]},'url':{'type':Sequelize[_0x8f06('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x8f06('0x2')]},'twitter':{'type':Sequelize[_0x8f06('0x2')]},'skype':{'type':Sequelize[_0x8f06('0x2')]},'teams':{'type':Sequelize[_0x8f06('0x2')]},'viber':{'type':Sequelize[_0x8f06('0x2')]},'line':{'type':Sequelize[_0x8f06('0x2')]},'wechat':{'type':Sequelize[_0x8f06('0x2')]},'telegram':{'type':Sequelize[_0x8f06('0x2')]},'UserId':{'type':Sequelize[_0x8f06('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x8f06('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8f06('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8f06('0x5')]},'dialTimezone':{'type':Sequelize[_0x8f06('0x2')]},'utcOffset':{'type':Sequelize[_0x8f06('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 5140576..8f60593 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 _0x9797=['$and','omit','map','format','cf_%d','pickBy','isEmpty','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','model','Tag','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','options','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','PHONE','literal','`ItemType`.OrderBy','ItemType.OrderBy','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','findOne','ContactId','includeAll','include','rows','getHopperFinals','CmHopperFinal','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','join','root','server/files/tmp','file','filename','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','meta','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','destination','callerid','starttime','duration','createdAt','userDisposition','UserId','fullname','DESC','startCase','Website','Account','closed','closedAt','thirdDisposition','key','Owner','Tags','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','defaults','register','status','undefined','count','offset','limit','set','json','update','then','destroy','end','sendStatus','error','stack','name','index','describe','findAll','query','user','CmContact','find','params','catch','tags','keys','length','startsWith','columnName','analytics','CmCustomField','cf_','displayName','alias','custom','type','values','info','forEach','merge','body','from','get','mergeWith','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','WhatsappMessage','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','hasOwnProperty','contact','all','show','tag','Phones','ContactItemType','ItemType','sequelize','Phones.OrderBy'];(function(_0x20e295,_0x308599){var _0x33ffbe=function(_0x2eeb46){while(--_0x2eeb46){_0x20e295['push'](_0x20e295['shift']());}};_0x33ffbe(++_0x308599);}(_0x9797,0x185));var _0x7979=function(_0x37ef22,_0x348c92){_0x37ef22=_0x37ef22-0x0;var _0x49eeb3=_0x9797[_0x37ef22];return _0x49eeb3;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x7979('0x0'));var path=require(_0x7979('0x1'));var fs=require('fs');var _=require(_0x7979('0x2'));var squel=require(_0x7979('0x3'));var Papa=require(_0x7979('0x4'));var Redis=require(_0x7979('0x5'));var contacts=require(_0x7979('0x6'));var qs=require(_0x7979('0x7'));var logger=require(_0x7979('0x8'))(_0x7979('0x9'));var config=require('../../config/environment');var shared=require(_0x7979('0xa'));var db=require(_0x7979('0xb'))['db'];config[_0x7979('0xc')]=_[_0x7979('0xd')](config[_0x7979('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7979('0xc')]));require('./cmContact.socket')[_0x7979('0xe')](socket);function respondWithResult(_0x40c911,_0x3e6c7f){_0x3e6c7f=_0x3e6c7f||0xc8;return function(_0x36f764){if(_0x36f764){return _0x40c911[_0x7979('0xf')](_0x3e6c7f)['json'](_0x36f764);}};}function respondWithFilteredResult(_0xb5af4b,_0x1986e6){return function(_0x29692d){if(_0x29692d){var _0x182fd2=typeof _0x1986e6['offset']===_0x7979('0x10')&&typeof _0x1986e6['limit']===_0x7979('0x10');var _0x17429a=_0x29692d[_0x7979('0x11')];var _0x509583=_0x182fd2?0x0:_0x1986e6[_0x7979('0x12')];var _0x1cfb9a=_0x182fd2?_0x29692d[_0x7979('0x11')]:_0x1986e6[_0x7979('0x12')]+_0x1986e6[_0x7979('0x13')];var _0x336f28;if(_0x1cfb9a>=_0x17429a){_0x1cfb9a=_0x17429a;_0x336f28=0xc8;}else{_0x336f28=0xce;}_0xb5af4b[_0x7979('0xf')](_0x336f28);return _0xb5af4b[_0x7979('0x14')]('Content-Range',_0x509583+'-'+_0x1cfb9a+'/'+_0x17429a)[_0x7979('0x15')](_0x29692d);}return null;};}function saveUpdates(_0x36b718){return function(_0x33832a){if(_0x33832a){return _0x33832a[_0x7979('0x16')](_0x36b718)[_0x7979('0x17')](function(_0x2c760c){return _0x2c760c;});}return null;};}function removeEntity(_0x2d313f){return function(_0x2aecdd){if(_0x2aecdd){return _0x2aecdd[_0x7979('0x18')]()['then'](function(){_0x2d313f[_0x7979('0xf')](0xcc)[_0x7979('0x19')]();});}};}function handleEntityNotFound(_0x503bea){return function(_0x559a18){if(!_0x559a18){_0x503bea[_0x7979('0x1a')](0x194);}return _0x559a18;};}function handleError(_0x5a4ed2,_0x2d8d5d){_0x2d8d5d=_0x2d8d5d||0x1f4;return function(_0x26f3b9){logger[_0x7979('0x1b')](_0x26f3b9[_0x7979('0x1c')]);if(_0x26f3b9[_0x7979('0x1d')]){delete _0x26f3b9['name'];}_0x5a4ed2[_0x7979('0xf')](_0x2d8d5d)['send'](_0x26f3b9);};}exports[_0x7979('0x1e')]=function(_0x592aba,_0x1cc86f){var _0x2509b5={};return contacts[_0x7979('0x1f')]()[_0x7979('0x17')](function(_0x5c62eb){_0x2509b5=qs['getOptions'](_0x5c62eb,_0x592aba);return contacts[_0x7979('0x20')](_0x592aba[_0x7979('0x21')],_0x592aba[_0x7979('0x22')],_0x2509b5,_0x5c62eb);})['then'](respondWithFilteredResult(_0x1cc86f,_0x2509b5))['catch'](handleError(_0x1cc86f,null));};exports[_0x7979('0x18')]=function(_0x47a768,_0x4f6d07){return db[_0x7979('0x23')][_0x7979('0x24')]({'where':{'id':_0x47a768[_0x7979('0x25')]['id']}})[_0x7979('0x17')](handleEntityNotFound(_0x4f6d07,null))[_0x7979('0x17')](removeEntity(_0x4f6d07,null))[_0x7979('0x26')](handleError(_0x4f6d07,null));};exports[_0x7979('0x1f')]=function(_0x4070cb,_0x53dec0){return db[_0x7979('0x23')][_0x7979('0x1f')]()[_0x7979('0x17')](function(_0x537117){delete _0x537117[_0x7979('0x27')];for(var _0x58197d=0x0;_0x58197d
','Attachments','Title'];(function(_0x5f5c61,_0x1efb7b){var _0x6b498=function(_0x32c92d){while(--_0x32c92d){_0x5f5c61['push'](_0x5f5c61['shift']());}};_0x6b498(++_0x1efb7b);}(_0xafa1,0x131));var _0x1afa=function(_0x3655e5,_0x469eae){_0x3655e5=_0x3655e5-0x0;var _0x37dfac=_0xafa1[_0x3655e5];return _0x37dfac;};'use strict';var _=require(_0x1afa('0x0'));var moment=require(_0x1afa('0x1'));var random=require(_0x1afa('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x1afa('0x3'));var tnef=require(_0x1afa('0x4'));var logger=require(_0x1afa('0x5'))(_0x1afa('0x6'));var config=require(_0x1afa('0x7'));function getAddress(_0x389538){var _0x35175a=_['head'](_0x389538[_0x1afa('0x8')]);return _0x35175a&&_0x35175a[_0x1afa('0x9')]?_0x35175a[_0x1afa('0x9')]:'anonymous'+random[_0x1afa('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x496723){var _0x490d46=_[_0x1afa('0xb')](_0x496723[_0x1afa('0x8')]);if(_0x490d46&&_0x490d46[_0x1afa('0xc')]){if(_0x490d46['name']==_0x490d46[_0x1afa('0x9')]){return _0x490d46[_0x1afa('0xc')][_0x1afa('0xd')](0x0,_0x490d46['name'][_0x1afa('0xe')]('@'));}var _0x7d0fb2=_0x490d46[_0x1afa('0xc')]['split'](/\s+/);return _0x7d0fb2[_0x1afa('0xf')]>0x1?_0x7d0fb2[_0x1afa('0x10')](0x0,-0x1)[_0x1afa('0x11')]('\x20'):_0x490d46[_0x1afa('0xc')];}return _0x1afa('0x12');}function getLastName(_0x4831ea){var _0x2d72b8=_[_0x1afa('0xb')](_0x4831ea['value']);if(_0x2d72b8&&_0x2d72b8['name']){var _0x13f8fa=_0x2d72b8[_0x1afa('0xc')][_0x1afa('0x13')](/\s+/);return _0x13f8fa['length']>0x1?_0x13f8fa['pop']():'';}return'';}function getMails(_0x1ba9ea,_0xffa56e){var _0x4cf5a2='';for(var _0x3474f7=0x0;_0x3474f7<_0xffa56e[_0x1afa('0x8')]['length'];_0x3474f7+=0x1){if(_0xffa56e[_0x1afa('0x8')][_0x3474f7][_0x1afa('0x9')]!==_0x1ba9ea){if(!_[_0x1afa('0x14')](_0x4cf5a2)){_0x4cf5a2+=',';}_0x4cf5a2+=_0xffa56e[_0x1afa('0x8')][_0x3474f7][_0x1afa('0xc')]||_0xffa56e[_0x1afa('0x8')][_0x3474f7][_0x1afa('0x9')]||'';_0x4cf5a2+='\x20<';_0x4cf5a2+=_0xffa56e[_0x1afa('0x8')][_0x3474f7][_0x1afa('0x9')]?_0xffa56e[_0x1afa('0x8')][_0x3474f7]['address']:_0x1afa('0x15')+random['generate'](0x6)+_0x1afa('0x16');_0x4cf5a2+='>';}}return _0x4cf5a2;}function parseEmail(_0x4f9b00,_0x25efe1,_0x2cf208){if(_0x25efe1[_0x1afa('0x17')]){var _0x334e88=/