From: Andrea Amorese
Date: Mon, 15 Nov 2021 16:23:22 +0000 (+0100)
Subject: Built motion from commit 107dfbfd.|2.5.38
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=4fdb91d37f32eb63c00cd4a6ed3b97d1ba74c650;p=motion2.git
Built motion from commit 107dfbfd.|2.5.38
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 5a0d7b0..6e04bf9 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-15T15:45:23.098Z",
+ "time": "2021-11-15T16:07:22.101Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 6fb6742..340552d 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-15T15:45:23.098Z",
+ "time": "2021-11-15T16:07:22.101Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 2adff88..2cf0d88 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 _0x370d=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','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)]'];(function(_0x346220,_0x3b77a8){var _0x542ca6=function(_0x63e9d6){while(--_0x63e9d6){_0x346220['push'](_0x346220['shift']());}};_0x542ca6(++_0x3b77a8);}(_0x370d,0x194));var _0xd370=function(_0x52b539,_0x50e7b1){_0x52b539=_0x52b539-0x0;var _0x553aa7=_0x370d[_0x52b539];return _0x553aa7;};'use strict';var Sequelize=require(_0xd370('0x0'));module['exports']={'name':{'type':Sequelize[_0xd370('0x1')],'get':function(_0x508794){return this[_0xd370('0x2')](_0xd370('0x3'));}},'action':{'type':Sequelize[_0xd370('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xd370('0x5'),_0xd370('0x6'),_0xd370('0x7'),_0xd370('0x8'),_0xd370('0x9'),_0xd370('0xa'),_0xd370('0xb'),_0xd370('0xc')]],'msg':_0xd370('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xd370('0x4')](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[_0xd370('0x4')](0x1000),'comment':_0xd370('0xe')},'data3':{'type':Sequelize[_0xd370('0x4')](0x1000),'comment':_0xd370('0xf')},'data4':{'type':Sequelize[_0xd370('0x4')](0x1000),'comments':_0xd370('0x10')},'data5':{'type':Sequelize[_0xd370('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xd370('0x4')],'comments':_0xd370('0x11')},'data7':{'type':Sequelize[_0xd370('0x12')],'comments':_0xd370('0x13')}};
\ No newline at end of file
+var _0xcb07=['browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','jscripty'];(function(_0xea8eb3,_0x2c0514){var _0x1b24ba=function(_0x5e8635){while(--_0x5e8635){_0xea8eb3['push'](_0xea8eb3['shift']());}};_0x1b24ba(++_0x2c0514);}(_0xcb07,0x98));var _0x7cb0=function(_0x1b964a,_0x40fdc2){_0x1b964a=_0x1b964a-0x0;var _0x2559fa=_0xcb07[_0x1b964a];return _0x2559fa;};'use strict';var Sequelize=require(_0x7cb0('0x0'));module[_0x7cb0('0x1')]={'name':{'type':Sequelize[_0x7cb0('0x2')],'get':function(_0x195b62){return this[_0x7cb0('0x3')]('action');}},'action':{'type':Sequelize[_0x7cb0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7cb0('0x5'),_0x7cb0('0x6'),'motionbar',_0x7cb0('0x7'),'urlForward',_0x7cb0('0x8'),_0x7cb0('0x9'),'script']],'msg':_0x7cb0('0xa')}},'comment':_0x7cb0('0xa')},'data1':{'type':Sequelize[_0x7cb0('0x4')](0x1000),'comment':_0x7cb0('0xb')},'data2':{'type':Sequelize[_0x7cb0('0x4')](0x1000),'comment':_0x7cb0('0xc')},'data3':{'type':Sequelize[_0x7cb0('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x7cb0('0x4')](0x1000),'comments':_0x7cb0('0xd')},'data5':{'type':Sequelize[_0x7cb0('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x7cb0('0xe')},'data7':{'type':Sequelize[_0x7cb0('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 5c0aab4..141e30a 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 _0xa57c=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','update','then','destroy','end','error','stack','name','send','find','catch','Action','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x47dec4,_0x2797b4){var _0x1161a6=function(_0x5a83fd){while(--_0x5a83fd){_0x47dec4['push'](_0x47dec4['shift']());}};_0x1161a6(++_0x2797b4);}(_0xa57c,0xb8));var _0xca57=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xa57c[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca57('0x0'));var zipdir=require(_0xca57('0x1'));var jsonpatch=require(_0xca57('0x2'));var rp=require(_0xca57('0x3'));var moment=require(_0xca57('0x4'));var BPromise=require(_0xca57('0x5'));var Mustache=require(_0xca57('0x6'));var util=require(_0xca57('0x7'));var path=require(_0xca57('0x8'));var sox=require('sox');var csv=require(_0xca57('0x9'));var ejs=require(_0xca57('0xa'));var fs=require('fs');var fs_extra=require(_0xca57('0xb'));var _=require(_0xca57('0xc'));var squel=require(_0xca57('0xd'));var crypto=require(_0xca57('0xe'));var jsforce=require(_0xca57('0xf'));var deskjs=require(_0xca57('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xca57('0x11'));var Redis=require(_0xca57('0x12'));var authService=require(_0xca57('0x13'));var qs=require(_0xca57('0x14'));var as=require(_0xca57('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca57('0x16'))(_0xca57('0x17'));var utils=require(_0xca57('0x18'));var config=require(_0xca57('0x19'));var licenseUtil=require(_0xca57('0x1a'));var db=require(_0xca57('0x1b'))['db'];function respondWithStatusCode(_0x41c46f,_0x244ead){_0x244ead=_0x244ead||0xcc;return function(_0x32795f){if(_0x32795f){return _0x41c46f[_0xca57('0x1c')](_0x244ead);}return _0x41c46f[_0xca57('0x1d')](_0x244ead)['end']();};}function respondWithResult(_0x466233,_0x3be3b2){_0x3be3b2=_0x3be3b2||0xc8;return function(_0x16ef2a){if(_0x16ef2a){return _0x466233[_0xca57('0x1d')](_0x3be3b2)['json'](_0x16ef2a);}};}function respondWithFilteredResult(_0x509442,_0x4aa03b){return function(_0x56e9c5){if(_0x56e9c5){var _0x34dcf6=typeof _0x4aa03b[_0xca57('0x1e')]===_0xca57('0x1f')&&typeof _0x4aa03b[_0xca57('0x20')]===_0xca57('0x1f');var _0x46cf84=_0x56e9c5[_0xca57('0x21')];var _0x10257a=_0x34dcf6?0x0:_0x4aa03b['offset'];var _0x565f0e=_0x34dcf6?_0x56e9c5[_0xca57('0x21')]:_0x4aa03b[_0xca57('0x1e')]+_0x4aa03b['limit'];var _0x4b3eaf;if(_0x565f0e>=_0x46cf84){_0x565f0e=_0x46cf84;_0x4b3eaf=0xc8;}else{_0x4b3eaf=0xce;}_0x509442[_0xca57('0x1d')](_0x4b3eaf);return _0x509442['set']('Content-Range',_0x10257a+'-'+_0x565f0e+'/'+_0x46cf84)[_0xca57('0x22')](_0x56e9c5);}return null;};}function patchUpdates(_0xd608b0){return function(_0xcb04d3){try{jsonpatch[_0xca57('0x23')](_0xcb04d3,_0xd608b0,!![]);}catch(_0x3d38e7){return BPromise['reject'](_0x3d38e7);}return _0xcb04d3['save']();};}function saveUpdates(_0x3b2153,_0x4d5bef){return function(_0x3334fa){if(_0x3334fa){return _0x3334fa[_0xca57('0x24')](_0x3b2153)[_0xca57('0x25')](function(_0x11b5f8){return _0x11b5f8;});}return null;};}function removeEntity(_0xe28f89,_0x2ddd73){return function(_0x3ab972){if(_0x3ab972){return _0x3ab972[_0xca57('0x26')]()['then'](function(){_0xe28f89[_0xca57('0x1d')](0xcc)[_0xca57('0x27')]();});}};}function handleEntityNotFound(_0x361dbe,_0x33c3d7){return function(_0x433155){if(!_0x433155){_0x361dbe['sendStatus'](0x194);}return _0x433155;};}function handleError(_0x3ea14a,_0x552b17){_0x552b17=_0x552b17||0x1f4;return function(_0x56960c){logger[_0xca57('0x28')](_0x56960c[_0xca57('0x29')]);if(_0x56960c['name']){delete _0x56960c[_0xca57('0x2a')];}_0x3ea14a[_0xca57('0x1d')](_0x552b17)[_0xca57('0x2b')](_0x56960c);};}exports[_0xca57('0x24')]=function(_0x11c295,_0x411c4a){if(_0x11c295['body']['id']){delete _0x11c295['body']['id'];}return db['Action'][_0xca57('0x2c')]({'where':{'id':_0x11c295['params']['id']}})[_0xca57('0x25')](handleEntityNotFound(_0x411c4a,null))[_0xca57('0x25')](saveUpdates(_0x11c295['body'],null))[_0xca57('0x25')](respondWithResult(_0x411c4a,null))[_0xca57('0x2d')](handleError(_0x411c4a,null));};exports[_0xca57('0x26')]=function(_0x2a34b2,_0x5203a9){return db[_0xca57('0x2e')][_0xca57('0x2c')]({'where':{'id':_0x2a34b2[_0xca57('0x2f')]['id']}})[_0xca57('0x25')](handleEntityNotFound(_0x5203a9,null))['then'](removeEntity(_0x5203a9,null))[_0xca57('0x2d')](handleError(_0x5203a9,null));};
\ No newline at end of file
+var _0x700e=['body','Action','find','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','then','destroy','end','error','stack','name','send'];(function(_0x37322d,_0x5805c6){var _0x1c09dd=function(_0xeb8b68){while(--_0xeb8b68){_0x37322d['push'](_0x37322d['shift']());}};_0x1c09dd(++_0x5805c6);}(_0x700e,0x125));var _0xe700=function(_0xa45b4c,_0x3f4980){_0xa45b4c=_0xa45b4c-0x0;var _0xc1a86c=_0x700e[_0xa45b4c];return _0xc1a86c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe700('0x0'));var zipdir=require(_0xe700('0x1'));var jsonpatch=require(_0xe700('0x2'));var rp=require(_0xe700('0x3'));var moment=require('moment');var BPromise=require(_0xe700('0x4'));var Mustache=require(_0xe700('0x5'));var util=require(_0xe700('0x6'));var path=require('path');var sox=require(_0xe700('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe700('0x8'));var _=require(_0xe700('0x9'));var squel=require(_0xe700('0xa'));var crypto=require(_0xe700('0xb'));var jsforce=require(_0xe700('0xc'));var deskjs=require(_0xe700('0xd'));var toCsv=require(_0xe700('0xe'));var querystring=require(_0xe700('0xf'));var Papa=require(_0xe700('0x10'));var Redis=require(_0xe700('0x11'));var authService=require(_0xe700('0x12'));var qs=require(_0xe700('0x13'));var as=require(_0xe700('0x14'));var hardwareService=require(_0xe700('0x15'));var logger=require('../../config/logger')(_0xe700('0x16'));var utils=require(_0xe700('0x17'));var config=require(_0xe700('0x18'));var licenseUtil=require(_0xe700('0x19'));var db=require(_0xe700('0x1a'))['db'];function respondWithStatusCode(_0x27b7b8,_0x14afea){_0x14afea=_0x14afea||0xcc;return function(_0x1f7823){if(_0x1f7823){return _0x27b7b8[_0xe700('0x1b')](_0x14afea);}return _0x27b7b8['status'](_0x14afea)['end']();};}function respondWithResult(_0x29c3b5,_0x24bccc){_0x24bccc=_0x24bccc||0xc8;return function(_0x1dfc39){if(_0x1dfc39){return _0x29c3b5[_0xe700('0x1c')](_0x24bccc)[_0xe700('0x1d')](_0x1dfc39);}};}function respondWithFilteredResult(_0x46ed46,_0x339b61){return function(_0x2d6c5f){if(_0x2d6c5f){var _0x410e39=typeof _0x339b61[_0xe700('0x1e')]===_0xe700('0x1f')&&typeof _0x339b61['limit']===_0xe700('0x1f');var _0x1c41ed=_0x2d6c5f[_0xe700('0x20')];var _0xa277f6=_0x410e39?0x0:_0x339b61[_0xe700('0x1e')];var _0x478677=_0x410e39?_0x2d6c5f[_0xe700('0x20')]:_0x339b61[_0xe700('0x1e')]+_0x339b61[_0xe700('0x21')];var _0x24147e;if(_0x478677>=_0x1c41ed){_0x478677=_0x1c41ed;_0x24147e=0xc8;}else{_0x24147e=0xce;}_0x46ed46[_0xe700('0x1c')](_0x24147e);return _0x46ed46[_0xe700('0x22')]('Content-Range',_0xa277f6+'-'+_0x478677+'/'+_0x1c41ed)['json'](_0x2d6c5f);}return null;};}function patchUpdates(_0x2e2dd9){return function(_0x36dc47){try{jsonpatch[_0xe700('0x23')](_0x36dc47,_0x2e2dd9,!![]);}catch(_0x135416){return BPromise['reject'](_0x135416);}return _0x36dc47['save']();};}function saveUpdates(_0x4179b9,_0x3a7483){return function(_0x366f94){if(_0x366f94){return _0x366f94['update'](_0x4179b9)[_0xe700('0x24')](function(_0x13ead8){return _0x13ead8;});}return null;};}function removeEntity(_0x5ece99,_0x5ed68a){return function(_0x5c4040){if(_0x5c4040){return _0x5c4040[_0xe700('0x25')]()['then'](function(){_0x5ece99[_0xe700('0x1c')](0xcc)[_0xe700('0x26')]();});}};}function handleEntityNotFound(_0x2cda7e,_0x32a15c){return function(_0x4261bc){if(!_0x4261bc){_0x2cda7e[_0xe700('0x1b')](0x194);}return _0x4261bc;};}function handleError(_0x4d8a47,_0x1fe0ef){_0x1fe0ef=_0x1fe0ef||0x1f4;return function(_0x277f29){logger[_0xe700('0x27')](_0x277f29[_0xe700('0x28')]);if(_0x277f29['name']){delete _0x277f29[_0xe700('0x29')];}_0x4d8a47['status'](_0x1fe0ef)[_0xe700('0x2a')](_0x277f29);};}exports['update']=function(_0x2c7082,_0x46eeec){if(_0x2c7082[_0xe700('0x2b')]['id']){delete _0x2c7082[_0xe700('0x2b')]['id'];}return db[_0xe700('0x2c')][_0xe700('0x2d')]({'where':{'id':_0x2c7082['params']['id']}})[_0xe700('0x24')](handleEntityNotFound(_0x46eeec,null))['then'](saveUpdates(_0x2c7082['body'],null))['then'](respondWithResult(_0x46eeec,null))[_0xe700('0x2e')](handleError(_0x46eeec,null));};exports[_0xe700('0x25')]=function(_0x30dd56,_0x27a095){return db['Action'][_0xe700('0x2d')]({'where':{'id':_0x30dd56[_0xe700('0x2f')]['id']}})[_0xe700('0x24')](handleEntityNotFound(_0x27a095,null))[_0xe700('0x24')](removeEntity(_0x27a095,null))[_0xe700('0x2e')](handleError(_0x27a095,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 85d4244..72d3c6a 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 _0x04ca=['./action.attributes','define','Action','tools_actions','lodash','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x5ce7e2,_0x8dd5de){var _0x5224d1=function(_0x3b04f1){while(--_0x3b04f1){_0x5ce7e2['push'](_0x5ce7e2['shift']());}};_0x5224d1(++_0x8dd5de);}(_0x04ca,0x1c6));var _0xa04c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x04ca[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xa04c('0x0'));var util=require('util');var logger=require(_0xa04c('0x1'))(_0xa04c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa04c('0x3'));var rimraf=require(_0xa04c('0x4'));var config=require(_0xa04c('0x5'));var attributes=require(_0xa04c('0x6'));module['exports']=function(_0x465276,_0x422021){return _0x465276[_0xa04c('0x7')](_0xa04c('0x8'),attributes,{'tableName':_0xa04c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x819d=['tools_actions','util','../../config/logger','moment','path','../../config/environment','exports','define','Action'];(function(_0x1b7228,_0xb09719){var _0x52b5f9=function(_0x48b740){while(--_0x48b740){_0x1b7228['push'](_0x1b7228['shift']());}};_0x52b5f9(++_0xb09719);}(_0x819d,0x10f));var _0xd819=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x819d[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xd819('0x0'));var logger=require(_0xd819('0x1'))('api');var moment=require(_0xd819('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd819('0x3'));var rimraf=require('rimraf');var config=require(_0xd819('0x4'));var attributes=require('./action.attributes');module[_0xd819('0x5')]=function(_0x5422e0,_0x4ca395){return _0x5422e0[_0xd819('0x6')](_0xd819('0x7'),attributes,{'tableName':_0xd819('0x8'),'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 4171f36..5df1eb1 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(_0x5b5faa,_0x3cc849){var _0x283a5d=function(_0x2674f5){while(--_0x2674f5){_0x5b5faa['push'](_0x5b5faa['shift']());}};_0x283a5d(++_0x3cc849);}(_0x1261,0x144));var _0x1126=function(_0x3490c2,_0x548c5e){_0x3490c2=_0x3490c2-0x0;var _0x891d41=_0x1261[_0x3490c2];return _0x891d41;};'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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1a4a52,_0x2e4314){var _0x2eaeab=function(_0x382bf){while(--_0x382bf){_0x1a4a52['push'](_0x1a4a52['shift']());}};_0x2eaeab(++_0x2e4314);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 532845e..71f2227 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 _0x3e7b=['put','/:id','update','isAuthenticated','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./action.controller'];(function(_0x32f41d,_0x37a235){var _0x57195b=function(_0x2341db){while(--_0x2341db){_0x32f41d['push'](_0x32f41d['shift']());}};_0x57195b(++_0x37a235);}(_0x3e7b,0x19d));var _0xb3e7=function(_0x46e47d,_0x4d0fc9){_0x46e47d=_0x46e47d-0x0;var _0x3c8abd=_0x3e7b[_0x46e47d];return _0x3c8abd;};'use strict';var multer=require(_0xb3e7('0x0'));var util=require('util');var path=require(_0xb3e7('0x1'));var timeout=require(_0xb3e7('0x2'));var express=require(_0xb3e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb3e7('0x4'));var interaction=require(_0xb3e7('0x5'));var config=require('../../config/environment');var controller=require(_0xb3e7('0x6'));router[_0xb3e7('0x7')](_0xb3e7('0x8'),auth['isAuthenticated'](),controller[_0xb3e7('0x9')]);router['delete'](_0xb3e7('0x8'),auth[_0xb3e7('0xa')](),controller[_0xb3e7('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x5c72=['exports','path','connect-timeout','fs-extra','../../components/auth/service','./action.controller','/:id','isAuthenticated','update','delete'];(function(_0x7a3977,_0x4f25f1){var _0x4cba4d=function(_0x355edb){while(--_0x355edb){_0x7a3977['push'](_0x7a3977['shift']());}};_0x4cba4d(++_0x4f25f1);}(_0x5c72,0xa1));var _0x25c7=function(_0xb769d,_0x21f932){_0xb769d=_0xb769d-0x0;var _0x1d8640=_0x5c72[_0xb769d];return _0x1d8640;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x25c7('0x0'));var timeout=require(_0x25c7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25c7('0x2'));var auth=require(_0x25c7('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x25c7('0x4'));router['put'](_0x25c7('0x5'),auth[_0x25c7('0x6')](),controller[_0x25c7('0x7')]);router[_0x25c7('0x8')](_0x25c7('0x5'),auth[_0x25c7('0x6')](),controller['destroy']);module[_0x25c7('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 2759c29..51e97aa 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x1c1f16,_0x4914a8){var _0x3be0ec=function(_0x302adb){while(--_0x302adb){_0x1c1f16['push'](_0x1c1f16['shift']());}};_0x3be0ec(++_0x4914a8);}(_0x98a8,0x12c));var _0x898a=function(_0x3aad1c,_0x2e6285){_0x3aad1c=_0x3aad1c-0x0;var _0x4a6d6e=_0x98a8[_0x3aad1c];return _0x4a6d6e;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x3a1256,_0x1fe2db){var _0x1bd352=function(_0x509c54){while(--_0x509c54){_0x3a1256['push'](_0x3a1256['shift']());}};_0x1bd352(++_0x1fe2db);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index d432d34..7608c61 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 _0x2bae=['dbH','end','json','offset','limit','undefined','status','set','Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','sendStatus','stack','name','send','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','params','rawAttributes','include','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','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)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','MetricId','function','format','groupBy','orderBy','DESC','alias','joins','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','parse','clone','debug','Limited\x20Query:','sequelize','QueryTypes','GROUP_CONCAT(%s)','ROUND(%s)','ValidationErrorItem','select','from','metric','replace','output','web','fullPath','%s-%s.%s','generate','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','toString','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','left_join','right_join','IS\x20NULL','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb'];(function(_0x36610a,_0x5954f0){var _0x56e2ad=function(_0x577d45){while(--_0x577d45){_0x36610a['push'](_0x36610a['shift']());}};_0x56e2ad(++_0x5954f0);}(_0x2bae,0x1db));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe2ba('0x0'));var rimraf=require(_0xe2ba('0x1'));var zipdir=require(_0xe2ba('0x2'));var jsonpatch=require(_0xe2ba('0x3'));var rp=require(_0xe2ba('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe2ba('0x5'));var sox=require(_0xe2ba('0x6'));var csv=require('to-csv');var ejs=require(_0xe2ba('0x7'));var fs=require('fs');var fs_extra=require(_0xe2ba('0x8'));var _=require(_0xe2ba('0x9'));var squel=require(_0xe2ba('0xa'));var crypto=require(_0xe2ba('0xb'));var jsforce=require(_0xe2ba('0xc'));var deskjs=require(_0xe2ba('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe2ba('0xe'));var Redis=require(_0xe2ba('0xf'));var authService=require(_0xe2ba('0x10'));var qs=require(_0xe2ba('0x11'));var as=require(_0xe2ba('0x12'));var hardwareService=require(_0xe2ba('0x13'));var logger=require('../../config/logger')(_0xe2ba('0x14'));var utils=require(_0xe2ba('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe2ba('0x16'))['db'];var dbH=require(_0xe2ba('0x16'))[_0xe2ba('0x17')];function respondWithStatusCode(_0x4a0a02,_0x448992){_0x448992=_0x448992||0xcc;return function(_0x2241d0){if(_0x2241d0){return _0x4a0a02['sendStatus'](_0x448992);}return _0x4a0a02['status'](_0x448992)[_0xe2ba('0x18')]();};}function respondWithResult(_0x10ab90,_0x3ce1a4){_0x3ce1a4=_0x3ce1a4||0xc8;return function(_0x302dd6){if(_0x302dd6){return _0x10ab90['status'](_0x3ce1a4)[_0xe2ba('0x19')](_0x302dd6);}};}function respondWithFilteredResult(_0x4235b6,_0x413956){return function(_0x23146e){if(_0x23146e){var _0x3db77b=typeof _0x413956[_0xe2ba('0x1a')]==='undefined'&&typeof _0x413956[_0xe2ba('0x1b')]===_0xe2ba('0x1c');var _0xce9690=_0x23146e['count'];var _0x92808c=_0x3db77b?0x0:_0x413956[_0xe2ba('0x1a')];var _0x1c7b1e=_0x3db77b?_0x23146e['count']:_0x413956['offset']+_0x413956[_0xe2ba('0x1b')];var _0x9119d0;if(_0x1c7b1e>=_0xce9690){_0x1c7b1e=_0xce9690;_0x9119d0=0xc8;}else{_0x9119d0=0xce;}_0x4235b6[_0xe2ba('0x1d')](_0x9119d0);return _0x4235b6[_0xe2ba('0x1e')](_0xe2ba('0x1f'),_0x92808c+'-'+_0x1c7b1e+'/'+_0xce9690)[_0xe2ba('0x19')](_0x23146e);}return null;};}function patchUpdates(_0x51ab20){return function(_0x390ad1){try{jsonpatch[_0xe2ba('0x20')](_0x390ad1,_0x51ab20,!![]);}catch(_0x4b4036){return BPromise[_0xe2ba('0x21')](_0x4b4036);}return _0x390ad1[_0xe2ba('0x22')]();};}function saveUpdates(_0x1b1e83,_0x3add49){return function(_0x293473){if(_0x293473){return _0x293473['update'](_0x1b1e83)[_0xe2ba('0x23')](function(_0x2c843b){return _0x2c843b;});}return null;};}function removeEntity(_0x49a155,_0x43775f){return function(_0x1fc06f){if(_0x1fc06f){return _0x1fc06f[_0xe2ba('0x24')]()[_0xe2ba('0x23')](function(){var _0x1823eb=_0x1fc06f[_0xe2ba('0x25')]({'plain':!![]});var _0x2c1683=_0xe2ba('0x26');return db[_0xe2ba('0x27')][_0xe2ba('0x24')]({'where':{'type':_0x2c1683,'resourceId':_0x1823eb['id']}})[_0xe2ba('0x23')](function(){return _0x1fc06f;});})[_0xe2ba('0x23')](function(){_0x49a155['status'](0xcc)[_0xe2ba('0x18')]();});}};}function handleEntityNotFound(_0x413b18,_0x5587bc){return function(_0x19e818){if(!_0x19e818){_0x413b18[_0xe2ba('0x28')](0x194);}return _0x19e818;};}function handleError(_0x5d73c9,_0x40bce9){_0x40bce9=_0x40bce9||0x1f4;return function(_0xb09c93){logger['error'](_0xb09c93[_0xe2ba('0x29')]);if(_0xb09c93['name']){delete _0xb09c93[_0xe2ba('0x2a')];}_0x5d73c9[_0xe2ba('0x1d')](_0x40bce9)[_0xe2ba('0x2b')](_0xb09c93);};}exports['index']=function(_0x21dcea,_0x37e811){var _0x3d9969={},_0x21b5da={},_0x3feae1={'count':0x0,'rows':[]};var _0x20a059=_[_0xe2ba('0x2c')](db[_0xe2ba('0x2d')]['rawAttributes'],function(_0x592f44){return{'name':_0x592f44[_0xe2ba('0x2e')],'type':_0x592f44[_0xe2ba('0x2f')][_0xe2ba('0x30')]};});_0x21b5da[_0xe2ba('0x31')]=_[_0xe2ba('0x2c')](_0x20a059,_0xe2ba('0x2a'));_0x21b5da[_0xe2ba('0x32')]=_[_0xe2ba('0x33')](_0x21dcea['query']);_0x21b5da[_0xe2ba('0x34')]=_[_0xe2ba('0x35')](_0x21b5da[_0xe2ba('0x31')],_0x21b5da[_0xe2ba('0x32')]);_0x3d9969[_0xe2ba('0x36')]=_['intersection'](_0x21b5da['model'],qs[_0xe2ba('0x37')](_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x37')]));_0x3d9969[_0xe2ba('0x36')]=_0x3d9969[_0xe2ba('0x36')]['length']?_0x3d9969[_0xe2ba('0x36')]:_0x21b5da['model'];if(!_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x38')](_0xe2ba('0x39'))){_0x3d9969[_0xe2ba('0x1b')]=qs[_0xe2ba('0x1b')](_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x1b')]);_0x3d9969[_0xe2ba('0x1a')]=qs['offset'](_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x1a')]);}_0x3d9969[_0xe2ba('0x3a')]=qs[_0xe2ba('0x3b')](_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x3b')]);_0x3d9969[_0xe2ba('0x3c')]=qs['filters'](_[_0xe2ba('0x3d')](_0x21dcea[_0xe2ba('0x32')],_0x21b5da[_0xe2ba('0x34')]),_0x20a059);if(_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x3e')]){_0x3d9969[_0xe2ba('0x3c')]=_[_0xe2ba('0x3f')](_0x3d9969[_0xe2ba('0x3c')],{'$or':_['map'](_0x20a059,function(_0x1ba4b0){if(_0x1ba4b0['type']!==_0xe2ba('0x40')){var _0x156bef={};_0x156bef[_0x1ba4b0[_0xe2ba('0x2a')]]={'$like':'%'+_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x3e')]+'%'};return _0x156bef;}})});}_0x3d9969=_[_0xe2ba('0x3f')]({},_0x3d9969,_0x21dcea['options']);var _0x5079ee={'where':_0x3d9969[_0xe2ba('0x3c')]};return db[_0xe2ba('0x2d')][_0xe2ba('0x41')](_0x5079ee)[_0xe2ba('0x23')](function(_0x39b20){_0x3feae1[_0xe2ba('0x41')]=_0x39b20;if(_0x21dcea[_0xe2ba('0x32')][_0xe2ba('0x42')]){_0x3d9969['include']=[{'all':!![]}];}return db[_0xe2ba('0x2d')][_0xe2ba('0x43')](_0x3d9969);})[_0xe2ba('0x23')](function(_0x10ff76){_0x3feae1['rows']=_0x10ff76;return _0x3feae1;})[_0xe2ba('0x23')](respondWithFilteredResult(_0x37e811,_0x3d9969))['catch'](handleError(_0x37e811,null));};exports['show']=function(_0x5f4d05,_0x2fb518){var _0x2f255b={'raw':![],'where':{'id':_0x5f4d05[_0xe2ba('0x44')]['id']}},_0x326f02={};_0x326f02[_0xe2ba('0x31')]=_['keys'](db['AnalyticCustomReport'][_0xe2ba('0x45')]);_0x326f02['query']=_[_0xe2ba('0x33')](_0x5f4d05[_0xe2ba('0x32')]);_0x326f02[_0xe2ba('0x34')]=_[_0xe2ba('0x35')](_0x326f02[_0xe2ba('0x31')],_0x326f02['query']);_0x2f255b['attributes']=_[_0xe2ba('0x35')](_0x326f02['model'],qs[_0xe2ba('0x37')](_0x5f4d05[_0xe2ba('0x32')]['fields']));_0x2f255b[_0xe2ba('0x36')]=_0x2f255b[_0xe2ba('0x36')]['length']?_0x2f255b['attributes']:_0x326f02[_0xe2ba('0x31')];if(_0x5f4d05[_0xe2ba('0x32')][_0xe2ba('0x42')]){_0x2f255b[_0xe2ba('0x46')]=[{'all':!![]}];}_0x2f255b=_[_0xe2ba('0x3f')]({},_0x2f255b,_0x5f4d05[_0xe2ba('0x47')]);return db[_0xe2ba('0x2d')][_0xe2ba('0x48')](_0x2f255b)[_0xe2ba('0x23')](handleEntityNotFound(_0x2fb518,null))['then'](respondWithResult(_0x2fb518,null))[_0xe2ba('0x49')](handleError(_0x2fb518,null));};exports[_0xe2ba('0x4a')]=function(_0x1d9f01,_0x10e251){return db[_0xe2ba('0x2d')][_0xe2ba('0x4a')](_0x1d9f01[_0xe2ba('0x4b')],{})[_0xe2ba('0x23')](function(_0x2eefea){var _0x98ad3f=_0x1d9f01['user']['get']({'plain':!![]});if(!_0x98ad3f)throw new Error(_0xe2ba('0x4c'));if(_0x98ad3f[_0xe2ba('0x4d')]===_0xe2ba('0x4e')){var _0x58b225=_0x2eefea[_0xe2ba('0x25')]({'plain':!![]});var _0x321c27=_0xe2ba('0x4f');return db[_0xe2ba('0x50')][_0xe2ba('0x48')]({'where':{'name':_0x321c27,'userProfileId':_0x98ad3f[_0xe2ba('0x51')]},'raw':!![]})[_0xe2ba('0x23')](function(_0x137cb3){if(_0x137cb3&&_0x137cb3[_0xe2ba('0x52')]===0x0){return db['UserProfileResource'][_0xe2ba('0x4a')]({'name':_0x58b225[_0xe2ba('0x2a')],'resourceId':_0x58b225['id'],'type':_0xe2ba('0x26'),'sectionId':_0x137cb3['id']},{})[_0xe2ba('0x23')](function(){return _0x2eefea;});}else{return _0x2eefea;}})[_0xe2ba('0x49')](function(_0x385362){logger[_0xe2ba('0x53')](_0xe2ba('0x54'),_0x385362);throw _0x385362;});}return _0x2eefea;})[_0xe2ba('0x23')](respondWithResult(_0x10e251,0xc9))[_0xe2ba('0x49')](handleError(_0x10e251,null));};exports[_0xe2ba('0x55')]=function(_0x206a74,_0x10a8f4){if(_0x206a74[_0xe2ba('0x4b')]['id']){delete _0x206a74[_0xe2ba('0x4b')]['id'];}return db['AnalyticCustomReport'][_0xe2ba('0x48')]({'where':{'id':_0x206a74[_0xe2ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x10a8f4,null))[_0xe2ba('0x23')](saveUpdates(_0x206a74['body'],null))[_0xe2ba('0x23')](respondWithResult(_0x10a8f4,null))[_0xe2ba('0x49')](handleError(_0x10a8f4,null));};exports['destroy']=function(_0x226224,_0x44110a){return db[_0xe2ba('0x2d')][_0xe2ba('0x48')]({'where':{'id':_0x226224[_0xe2ba('0x44')]['id']}})[_0xe2ba('0x23')](handleEntityNotFound(_0x44110a,null))[_0xe2ba('0x23')](removeEntity(_0x44110a,null))[_0xe2ba('0x49')](handleError(_0x44110a,null));};exports[_0xe2ba('0x56')]=function(_0xe0e471,_0x22ccd3){var _0x2413d9=0xa;var _0x33abe1=[_0xe2ba('0x57'),'left_join','right_join',_0xe2ba('0x58')];var _0x2a3bf5={'SUM':_0xe2ba('0x59'),'COUNT':_0xe2ba('0x5a'),'COUNT DISTINCT':_0xe2ba('0x5b'),'MAX':_0xe2ba('0x5c'),'MIN':_0xe2ba('0x5d'),'AVG':_0xe2ba('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe2ba('0x5f'),'GROUP_CONCAT DESC':_0xe2ba('0x60')};var _0x53c935={'SEC_TO_TIME':_0xe2ba('0x61'),'DATE':_0xe2ba('0x62'),'HOUR':_0xe2ba('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xe2ba('0x64')};var _0x46fef9=function(_0x4c34f4){return!_[_0xe2ba('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe2ba('0x66'),_0xe2ba('0x67')],_0x4c34f4);};var _0x314cb7=function(_0x1523a1){if(!_0x1523a1||!_0x1523a1[_0xe2ba('0x68')][_0xe2ba('0x69')]){return'';}for(var _0x8aae7c='(',_0x4aca05=0x0;_0x4aca05<_0x1523a1['rules']['length'];_0x4aca05+=0x1){_0x4aca05>0x0&&(_0x8aae7c+='\x20'+_0x1523a1[_0xe2ba('0x6a')]+'\x20');_0x8aae7c+=_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6b')]?_0x314cb7(_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6b')]):_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6c')]+'\x20'+_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6d')]+(_0x46fef9(_0x1523a1['rules'][_0x4aca05][_0xe2ba('0x6d')])?'\x20'+_0x1523a1[_0xe2ba('0x68')][_0x4aca05][_0xe2ba('0x6e')]:'');}return _0x8aae7c+')';};var _0x24114a={'where':{'id':_0xe0e471[_0xe2ba('0x44')]['id']}},_0x2774bc,_0x56cd0f,_0x3af5a9,_0x1826ae,_0x1cc110;_0x24114a=_[_0xe2ba('0x3f')]({},_0x24114a,_0xe0e471[_0xe2ba('0x47')]);return db['AnalyticCustomReport'][_0xe2ba('0x48')](_0x24114a)[_0xe2ba('0x23')](function(_0xfade14){if(_0xfade14){_0x2774bc=_0xfade14;return _0xfade14['getFields']();}return null;})[_0xe2ba('0x23')](function(_0x304184){if(_0x304184){if(!_0x304184['length']){throw new db[(_0xe2ba('0x6f'))]['ValidationErrorItem'](_0xe2ba('0x70'),0x193);}_0x56cd0f=_0x304184;return db[_0xe2ba('0x71')][_0xe2ba('0x43')]({'raw':!![]});}return null;})[_0xe2ba('0x23')](function(_0x2931e9){if(_0x2931e9){_0x3af5a9=_[_0xe2ba('0x72')](_0x2931e9,'id');var _0x42731e;var _0x4f0d84=squel['select']();_0x4f0d84['from'](_0x2774bc['table']);for(var _0x162335=0x0;_0x162335<_0x56cd0f[_0xe2ba('0x69')];_0x162335+=0x1){_0x42731e=_0x56cd0f[_0x162335][_0xe2ba('0x73')]?_0x3af5a9[_0x56cd0f[_0x162335][_0xe2ba('0x73')]]['metric']:_0x56cd0f[_0x162335][_0xe2ba('0x6c')];_0x42731e=_0x56cd0f[_0x162335]['function']?_['replace'](_0x2a3bf5[_0x56cd0f[_0x162335][_0xe2ba('0x74')]],'%s',_0x42731e):_0x42731e;_0x42731e=_0x56cd0f[_0x162335][_0xe2ba('0x75')]?_['replace'](_0x53c935[_0x56cd0f[_0x162335]['format']],'%s',_0x42731e):_0x42731e;if(_0x56cd0f[_0x162335][_0xe2ba('0x76')]){_0x4f0d84['group'](_0x42731e);}_0x56cd0f[_0x162335]['orderBy']&&_0x4f0d84[_0xe2ba('0x3a')](_0x42731e,_0x56cd0f[_0x162335][_0xe2ba('0x77')]===_0xe2ba('0x78')?![]:!![]);_0x4f0d84[_0xe2ba('0x6c')](_0x42731e,_0x56cd0f[_0x162335][_0xe2ba('0x79')]||_0x42731e);}if(_0x2774bc[_0xe2ba('0x7a')]){_0x2774bc[_0xe2ba('0x7a')]=JSON['parse'](_0x2774bc[_0xe2ba('0x7a')]);for(var _0x10cd52=0x0;_0x10cd52<_0x2774bc[_0xe2ba('0x7a')][_0xe2ba('0x69')];_0x10cd52+=0x1){if(_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x2f')]&&_[_0xe2ba('0x65')](_0x33abe1,_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x2f')])&&_0x2774bc[_0xe2ba('0x7a')][_0x10cd52]['parentKey']&&_0x2774bc['joins'][_0x10cd52]['foreignTable']&&_0x2774bc['joins'][_0x10cd52][_0xe2ba('0x7b')]){_0x4f0d84[_0x2774bc['joins'][_0x10cd52]['type']](_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x7c')],null,util['format'](_0xe2ba('0x7d'),_0x2774bc[_0xe2ba('0x7e')],_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x7f')],_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x7c')],_0x2774bc[_0xe2ba('0x7a')][_0x10cd52][_0xe2ba('0x7b')]));}}}if(_0x2774bc['conditions']){_0x2774bc[_0xe2ba('0x80')]=JSON[_0xe2ba('0x81')](_0x2774bc['conditions']);_0x4f0d84[_0xe2ba('0x3c')](_0x314cb7(_0x2774bc[_0xe2ba('0x80')][_0xe2ba('0x6b')]));}_0x1cc110=_0x4f0d84[_0xe2ba('0x82')]();_0x4f0d84[_0xe2ba('0x1b')](_0x2413d9);_0x4f0d84['offset'](0x0);logger[_0xe2ba('0x83')](_0xe2ba('0x84'),_0x4f0d84['toString']());return dbH[_0xe2ba('0x85')][_0xe2ba('0x32')](_0x4f0d84['toString'](),{'type':dbH[_0xe2ba('0x85')][_0xe2ba('0x86')]['SELECT']});}})[_0xe2ba('0x23')](respondWithResult(_0x22ccd3,null))['catch'](handleError(_0x22ccd3,null));};function runReport(_0x31e2a6,_0x56d3f4,_0x4d5066){var _0x486d3c=_0x56d3f4[_0xe2ba('0x2a')];var _0x39f4ba=0xa;var _0x5cc5e6=[_0xe2ba('0x57'),'left_join','right_join','cross_join'];var _0x593324={'SUM':_0xe2ba('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe2ba('0x5b'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe2ba('0x5e'),'GROUP_CONCAT':_0xe2ba('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe2ba('0x60')};var _0x411109={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe2ba('0x62'),'HOUR':_0xe2ba('0x63'),'ROUND':_0xe2ba('0x88'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x6ea8f8=function(_0xea18a){return!_[_0xe2ba('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe2ba('0x66'),'IS\x20NOT\x20EMPTY'],_0xea18a);};var _0x3cfd5d=function(_0x180bd8){if(!_0x180bd8||!_0x180bd8[_0xe2ba('0x68')]['length']){return'';}for(var _0x3d9681='(',_0x32b838=0x0;_0x32b838<_0x180bd8[_0xe2ba('0x68')][_0xe2ba('0x69')];_0x32b838+=0x1){_0x32b838>0x0&&(_0x3d9681+='\x20'+_0x180bd8['operator']+'\x20');_0x3d9681+=_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6b')]?_0x3cfd5d(_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6b')]):_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6c')]+'\x20'+_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6d')]+(_0x6ea8f8(_0x180bd8[_0xe2ba('0x68')][_0x32b838]['condition'])?'\x20'+_0x180bd8[_0xe2ba('0x68')][_0x32b838][_0xe2ba('0x6e')]:'');}return _0x3d9681+')';};var _0x5df79a={'where':{'id':_0x31e2a6['id']}},_0x2712e8,_0x3326a,_0x20f802,_0xba9a28,_0x3011f3;_0x5df79a=_[_0xe2ba('0x3f')]({},_0x5df79a,_0x4d5066);return db[_0xe2ba('0x2d')][_0xe2ba('0x48')](_0x5df79a)[_0xe2ba('0x23')](function(_0xcbf2cb){if(_0xcbf2cb){_0x2712e8=_0xcbf2cb;return _0xcbf2cb['getFields']();}return null;})[_0xe2ba('0x23')](function(_0x572726){if(_0x572726){if(!_0x572726[_0xe2ba('0x69')]){throw new db[(_0xe2ba('0x6f'))][(_0xe2ba('0x89'))](_0xe2ba('0x70'),0x193);}_0x3326a=_0x572726;return db[_0xe2ba('0x71')][_0xe2ba('0x43')]({'raw':!![]});}return null;})['then'](function(_0x3190bc){if(_0x3190bc){_0x20f802=_[_0xe2ba('0x72')](_0x3190bc,'id');var _0x1e8bc2;var _0x5ae702=squel[_0xe2ba('0x8a')]();_0x5ae702[_0xe2ba('0x8b')](_0x2712e8['table']);for(var _0x398d84=0x0;_0x398d84<_0x3326a['length'];_0x398d84+=0x1){_0x1e8bc2=_0x3326a[_0x398d84][_0xe2ba('0x73')]?_0x20f802[_0x3326a[_0x398d84][_0xe2ba('0x73')]][_0xe2ba('0x8c')]:_0x3326a[_0x398d84]['field'];_0x1e8bc2=_0x3326a[_0x398d84][_0xe2ba('0x74')]?_[_0xe2ba('0x8d')](_0x593324[_0x3326a[_0x398d84]['function']],'%s',_0x1e8bc2):_0x1e8bc2;_0x1e8bc2=_0x3326a[_0x398d84]['format']?_['replace'](_0x411109[_0x3326a[_0x398d84][_0xe2ba('0x75')]],'%s',_0x1e8bc2):_0x1e8bc2;if(_0x3326a[_0x398d84][_0xe2ba('0x76')]){_0x5ae702[_0xe2ba('0x6b')](_0x1e8bc2);}_0x3326a[_0x398d84][_0xe2ba('0x77')]&&_0x5ae702['order'](_0x1e8bc2,_0x3326a[_0x398d84][_0xe2ba('0x77')]==='DESC'?![]:!![]);_0x5ae702[_0xe2ba('0x6c')](_0x1e8bc2,_0x3326a[_0x398d84][_0xe2ba('0x79')]||_0x1e8bc2);}if(_0x2712e8['joins']){_0x2712e8[_0xe2ba('0x7a')]=JSON[_0xe2ba('0x81')](_0x2712e8[_0xe2ba('0x7a')]);for(var _0x399581=0x0;_0x399581<_0x2712e8[_0xe2ba('0x7a')]['length'];_0x399581+=0x1){if(_0x2712e8['joins'][_0x399581][_0xe2ba('0x2f')]&&_['includes'](_0x5cc5e6,_0x2712e8[_0xe2ba('0x7a')][_0x399581]['type'])&&_0x2712e8[_0xe2ba('0x7a')][_0x399581]['parentKey']&&_0x2712e8['joins'][_0x399581][_0xe2ba('0x7c')]&&_0x2712e8[_0xe2ba('0x7a')][_0x399581][_0xe2ba('0x7b')]){_0x5ae702[_0x2712e8[_0xe2ba('0x7a')][_0x399581]['type']](_0x2712e8['joins'][_0x399581][_0xe2ba('0x7c')],null,util[_0xe2ba('0x75')](_0xe2ba('0x7d'),_0x2712e8[_0xe2ba('0x7e')],_0x2712e8[_0xe2ba('0x7a')][_0x399581][_0xe2ba('0x7f')],_0x2712e8[_0xe2ba('0x7a')][_0x399581][_0xe2ba('0x7c')],_0x2712e8['joins'][_0x399581][_0xe2ba('0x7b')]));}}}if(_0x2712e8[_0xe2ba('0x80')]){_0x2712e8[_0xe2ba('0x80')]=JSON['parse'](_0x2712e8[_0xe2ba('0x80')]);_0x5ae702['where'](_0x3cfd5d(_0x2712e8[_0xe2ba('0x80')][_0xe2ba('0x6b')]));}_0x3011f3=_0x5ae702[_0xe2ba('0x82')]();_0x5ae702[_0xe2ba('0x1b')](_0x39f4ba);_0x5ae702['offset'](0x0);return;}})[_0xe2ba('0x23')](function(){if(_0x56d3f4[_0xe2ba('0x8e')]===_0xe2ba('0x8f')){return null;}var _0x54b008=_[_0xe2ba('0x3f')](_0x56d3f4,{'name':_0x56d3f4[_0xe2ba('0x90')]||_0x56d3f4['name']||_0x2712e8[_0xe2ba('0x2a')],'basename':_0x486d3c,'savename':util['format'](_0xe2ba('0x91'),_0x56d3f4['name']||_0x2712e8[_0xe2ba('0x2a')],require('randomstring')[_0xe2ba('0x92')](0x4),_0x56d3f4[_0xe2ba('0x8e')]||_0xe2ba('0x93')),'reportId':_0x2712e8['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xe2ba('0x4a')](_0x54b008,{'raw':!![]});})['then'](function(_0x4b3e09){if(_0x2712e8[_0xe2ba('0x7e')]==='cdr'){_0x3011f3[_0xe2ba('0x3c')](_0x2712e8[_0xe2ba('0x7e')]+_0xe2ba('0x94'),_0x56d3f4[_0xe2ba('0x95')],_0x56d3f4[_0xe2ba('0x96')]);}else{_0x3011f3[_0xe2ba('0x3c')](_0x2712e8[_0xe2ba('0x7e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x56d3f4['startDate'],_0x56d3f4[_0xe2ba('0x96')]);}if(_0x4b3e09){logger[_0xe2ba('0x97')](_0xe2ba('0x98'),_0x3011f3[_0xe2ba('0x99')]());require(_0xe2ba('0x9a'))['fork'](path[_0xe2ba('0x57')](__dirname,_0xe2ba('0x9b'),_0x4b3e09[_0xe2ba('0x8e')]),[_0x4b3e09['id'],_0x3011f3['toString'](),path['join'](__dirname,_0xe2ba('0x9c'),_0x4b3e09[_0xe2ba('0x9d')]),_0x486d3c]);return _0x4b3e09;}else{var _0x538e52=squel[_0xe2ba('0x8a')]();_0x538e52['from']('('+_0x3011f3['toString']()+')',_0xe2ba('0x9e'));_0x538e52['field'](_0xe2ba('0x9f'),'count');_0x3011f3[_0xe2ba('0x1b')](_0x56d3f4[_0xe2ba('0x1b')]||_0x39f4ba);_0x3011f3[_0xe2ba('0x1a')](_0x56d3f4[_0xe2ba('0x1a')]||0x0);return dbH[_0xe2ba('0x85')][_0xe2ba('0x32')](_0x538e52[_0xe2ba('0x99')](),{'type':dbH[_0xe2ba('0x85')][_0xe2ba('0x86')][_0xe2ba('0xa0')]})[_0xe2ba('0x23')](function(_0x2234f2){if(!_0x2234f2['length']){_0xba9a28=0x0;}else{_0xba9a28=_0x2234f2[0x0][_0xe2ba('0x41')]||0x0;}return dbH[_0xe2ba('0x85')][_0xe2ba('0x32')](_0x3011f3[_0xe2ba('0x99')](),{'type':dbH[_0xe2ba('0x85')][_0xe2ba('0x86')][_0xe2ba('0xa0')]});})[_0xe2ba('0x23')](function(_0x5f21d5){return{'rows':_0x5f21d5||[],'count':_0xba9a28};});}});}exports[_0xe2ba('0xa1')]=function(_0x567c4f,_0xd9f1f8){return runReport(_0x567c4f[_0xe2ba('0x44')],_0x567c4f[_0xe2ba('0x32')],_0x567c4f['options'])[_0xe2ba('0x23')](respondWithResult(_0xd9f1f8,null))[_0xe2ba('0x49')](handleError(_0xd9f1f8,null));};exports['runReport']=runReport;exports[_0xe2ba('0x32')]=function(_0x4f0910,_0x3dbf1e){var _0x1fd1e9=0xa;var _0x520149=[_0xe2ba('0x57'),_0xe2ba('0xa2'),_0xe2ba('0xa3'),_0xe2ba('0x58')];var _0x4dfdf9={'SUM':_0xe2ba('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe2ba('0x5b'),'MAX':'MAX(%s)','MIN':_0xe2ba('0x5d'),'AVG':_0xe2ba('0x5e'),'GROUP_CONCAT':_0xe2ba('0x87'),'GROUP_CONCAT ASC':_0xe2ba('0x5f'),'GROUP_CONCAT DESC':_0xe2ba('0x60')};var _0x528d94={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe2ba('0x62'),'HOUR':_0xe2ba('0x63'),'ROUND':_0xe2ba('0x88'),'UNIX_TIMESTAMP':_0xe2ba('0x64')};var _0x453735=function(_0x24e476){return!_['includes']([_0xe2ba('0xa4'),_0xe2ba('0xa5'),_0xe2ba('0x66'),_0xe2ba('0x67')],_0x24e476);};var _0x5958f3=function(_0x190084){if(!_0x190084||!_0x190084[_0xe2ba('0x68')][_0xe2ba('0x69')]){return'';}for(var _0x3485f0='(',_0x3f368e=0x0;_0x3f368e<_0x190084[_0xe2ba('0x68')][_0xe2ba('0x69')];_0x3f368e+=0x1){_0x3f368e>0x0&&(_0x3485f0+='\x20'+_0x190084[_0xe2ba('0x6a')]+'\x20');_0x3485f0+=_0x190084[_0xe2ba('0x68')][_0x3f368e][_0xe2ba('0x6b')]?_0x5958f3(_0x190084[_0xe2ba('0x68')][_0x3f368e]['group']):_0x190084[_0xe2ba('0x68')][_0x3f368e][_0xe2ba('0x6c')]+'\x20'+_0x190084['rules'][_0x3f368e][_0xe2ba('0x6d')]+(_0x453735(_0x190084['rules'][_0x3f368e][_0xe2ba('0x6d')])?'\x20'+_0x190084['rules'][_0x3f368e][_0xe2ba('0x6e')]:'');}return _0x3485f0+')';};var _0x110b05={'where':{'id':_0x4f0910['params']['id']}},_0x45ef77,_0x154eeb,_0x5b30a6,_0x542866,_0x50c58e;_0x110b05=_[_0xe2ba('0x3f')]({},_0x110b05,_0x4f0910[_0xe2ba('0x47')]);return db[_0xe2ba('0x2d')][_0xe2ba('0x48')](_0x110b05)[_0xe2ba('0x23')](function(_0x57e076){if(_0x57e076){_0x45ef77=_0x57e076;return _0x57e076['getFields']();}return null;})[_0xe2ba('0x23')](function(_0x52e0e7){if(_0x52e0e7){if(!_0x52e0e7['length']){throw new db[(_0xe2ba('0x6f'))][(_0xe2ba('0x89'))](_0xe2ba('0x70'),0x193);}_0x154eeb=_0x52e0e7;return db[_0xe2ba('0x71')][_0xe2ba('0x43')]({'raw':!![]});}return null;})[_0xe2ba('0x23')](function(_0xaf9d86){if(_0xaf9d86){_0x5b30a6=_[_0xe2ba('0x72')](_0xaf9d86,'id');var _0x4a6abc;var _0x4dde61=squel[_0xe2ba('0x8a')]();_0x4dde61[_0xe2ba('0x8b')](_0x45ef77[_0xe2ba('0x7e')]);for(var _0x48af8c=0x0;_0x48af8c<_0x154eeb['length'];_0x48af8c+=0x1){_0x4a6abc=_0x154eeb[_0x48af8c][_0xe2ba('0x73')]?_0x5b30a6[_0x154eeb[_0x48af8c]['MetricId']][_0xe2ba('0x8c')]:_0x154eeb[_0x48af8c][_0xe2ba('0x6c')];_0x4a6abc=_0x154eeb[_0x48af8c]['function']?_[_0xe2ba('0x8d')](_0x4dfdf9[_0x154eeb[_0x48af8c]['function']],'%s',_0x4a6abc):_0x4a6abc;_0x4a6abc=_0x154eeb[_0x48af8c]['format']?_[_0xe2ba('0x8d')](_0x528d94[_0x154eeb[_0x48af8c][_0xe2ba('0x75')]],'%s',_0x4a6abc):_0x4a6abc;if(_0x154eeb[_0x48af8c][_0xe2ba('0x76')]){_0x4dde61[_0xe2ba('0x6b')](_0x4a6abc);}_0x154eeb[_0x48af8c]['orderBy']&&_0x4dde61[_0xe2ba('0x3a')](_0x4a6abc,_0x154eeb[_0x48af8c][_0xe2ba('0x77')]==='DESC'?![]:!![]);_0x4dde61[_0xe2ba('0x6c')](_0x4a6abc,_0x154eeb[_0x48af8c]['alias']||_0x4a6abc);}if(_0x45ef77[_0xe2ba('0x7a')]){_0x45ef77['joins']=JSON[_0xe2ba('0x81')](_0x45ef77['joins']);for(var _0x1aca48=0x0;_0x1aca48<_0x45ef77['joins'][_0xe2ba('0x69')];_0x1aca48+=0x1){if(_0x45ef77['joins'][_0x1aca48][_0xe2ba('0x2f')]&&_[_0xe2ba('0x65')](_0x520149,_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x2f')])&&_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x7f')]&&_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x7c')]&&_0x45ef77['joins'][_0x1aca48][_0xe2ba('0x7b')]){_0x4dde61[_0x45ef77['joins'][_0x1aca48][_0xe2ba('0x2f')]](_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x7c')],null,util[_0xe2ba('0x75')]('%s.%s\x20=\x20%s.%s',_0x45ef77[_0xe2ba('0x7e')],_0x45ef77[_0xe2ba('0x7a')][_0x1aca48]['parentKey'],_0x45ef77[_0xe2ba('0x7a')][_0x1aca48][_0xe2ba('0x7c')],_0x45ef77[_0xe2ba('0x7a')][_0x1aca48]['foreignKey']));}}}if(_0x45ef77[_0xe2ba('0x80')]){_0x45ef77['conditions']=JSON[_0xe2ba('0x81')](_0x45ef77[_0xe2ba('0x80')]);_0x4dde61[_0xe2ba('0x3c')](_0x5958f3(_0x45ef77[_0xe2ba('0x80')][_0xe2ba('0x6b')]));}_0x50c58e=_0x4dde61['clone']();_0x4dde61[_0xe2ba('0x1b')](_0x1fd1e9);_0x4dde61['offset'](0x0);logger['debug']('Limited\x20Query:',_0x4dde61['toString']());return dbH['sequelize'][_0xe2ba('0x32')](_0x4dde61[_0xe2ba('0x99')](),{'type':dbH[_0xe2ba('0x85')]['QueryTypes'][_0xe2ba('0xa0')]});}})[_0xe2ba('0x23')](function(){return{'sql':_0x50c58e['toString']()};})['then'](respondWithResult(_0x3dbf1e,null))[_0xe2ba('0x49')](handleError(_0x3dbf1e,null));};
\ No newline at end of file
+var _0x7cd8=['request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','show','params','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','function','replace','format','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','Sequelize','ValidationErrorItem','from','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','COUNT(%s)','MAX(%s)','debug','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3de969,_0x4676c8){var _0x4faf7b=function(_0x37be19){while(--_0x37be19){_0x3de969['push'](_0x3de969['shift']());}};_0x4faf7b(++_0x4676c8);}(_0x7cd8,0x1f4));var _0x87cd=function(_0x2d3b9e,_0x2ce5ea){_0x2d3b9e=_0x2d3b9e-0x0;var _0x94a172=_0x7cd8[_0x2d3b9e];return _0x94a172;};'use strict';var emlformat=require(_0x87cd('0x0'));var rimraf=require(_0x87cd('0x1'));var zipdir=require(_0x87cd('0x2'));var jsonpatch=require(_0x87cd('0x3'));var rp=require(_0x87cd('0x4'));var moment=require('moment');var BPromise=require(_0x87cd('0x5'));var Mustache=require(_0x87cd('0x6'));var util=require('util');var path=require(_0x87cd('0x7'));var sox=require(_0x87cd('0x8'));var csv=require(_0x87cd('0x9'));var ejs=require(_0x87cd('0xa'));var fs=require('fs');var fs_extra=require(_0x87cd('0xb'));var _=require(_0x87cd('0xc'));var squel=require(_0x87cd('0xd'));var crypto=require(_0x87cd('0xe'));var jsforce=require(_0x87cd('0xf'));var deskjs=require(_0x87cd('0x10'));var toCsv=require('to-csv');var querystring=require(_0x87cd('0x11'));var Papa=require(_0x87cd('0x12'));var Redis=require(_0x87cd('0x13'));var authService=require(_0x87cd('0x14'));var qs=require(_0x87cd('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87cd('0x16'));var logger=require(_0x87cd('0x17'))(_0x87cd('0x18'));var utils=require('../../config/utils');var config=require(_0x87cd('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x87cd('0x1a'))['db'];var dbH=require(_0x87cd('0x1a'))[_0x87cd('0x1b')];function respondWithStatusCode(_0x1cfd66,_0x1fd1f1){_0x1fd1f1=_0x1fd1f1||0xcc;return function(_0x2d0768){if(_0x2d0768){return _0x1cfd66['sendStatus'](_0x1fd1f1);}return _0x1cfd66[_0x87cd('0x1c')](_0x1fd1f1)[_0x87cd('0x1d')]();};}function respondWithResult(_0x5a6534,_0x4e0cd1){_0x4e0cd1=_0x4e0cd1||0xc8;return function(_0x195dcd){if(_0x195dcd){return _0x5a6534[_0x87cd('0x1c')](_0x4e0cd1)[_0x87cd('0x1e')](_0x195dcd);}};}function respondWithFilteredResult(_0xa345d9,_0x2cb3e1){return function(_0x2b8348){if(_0x2b8348){var _0x5a92f5=typeof _0x2cb3e1[_0x87cd('0x1f')]===_0x87cd('0x20')&&typeof _0x2cb3e1['limit']===_0x87cd('0x20');var _0x5cc20f=_0x2b8348['count'];var _0x13b769=_0x5a92f5?0x0:_0x2cb3e1[_0x87cd('0x1f')];var _0x2a6e48=_0x5a92f5?_0x2b8348[_0x87cd('0x21')]:_0x2cb3e1[_0x87cd('0x1f')]+_0x2cb3e1['limit'];var _0x6b0f1b;if(_0x2a6e48>=_0x5cc20f){_0x2a6e48=_0x5cc20f;_0x6b0f1b=0xc8;}else{_0x6b0f1b=0xce;}_0xa345d9[_0x87cd('0x1c')](_0x6b0f1b);return _0xa345d9[_0x87cd('0x22')](_0x87cd('0x23'),_0x13b769+'-'+_0x2a6e48+'/'+_0x5cc20f)[_0x87cd('0x1e')](_0x2b8348);}return null;};}function patchUpdates(_0x24e31e){return function(_0x1a722e){try{jsonpatch[_0x87cd('0x24')](_0x1a722e,_0x24e31e,!![]);}catch(_0x1af2f1){return BPromise[_0x87cd('0x25')](_0x1af2f1);}return _0x1a722e['save']();};}function saveUpdates(_0x118ff8,_0x73ace9){return function(_0x1efa03){if(_0x1efa03){return _0x1efa03[_0x87cd('0x26')](_0x118ff8)['then'](function(_0x2a9c51){return _0x2a9c51;});}return null;};}function removeEntity(_0x5bd585,_0x559763){return function(_0x24d6a0){if(_0x24d6a0){return _0x24d6a0[_0x87cd('0x27')]()[_0x87cd('0x28')](function(){var _0x2221cf=_0x24d6a0[_0x87cd('0x29')]({'plain':!![]});var _0x28ecfd='CustomReports';return db[_0x87cd('0x2a')]['destroy']({'where':{'type':_0x28ecfd,'resourceId':_0x2221cf['id']}})['then'](function(){return _0x24d6a0;});})[_0x87cd('0x28')](function(){_0x5bd585[_0x87cd('0x1c')](0xcc)[_0x87cd('0x1d')]();});}};}function handleEntityNotFound(_0x3216e4,_0x39ce11){return function(_0x295c3b){if(!_0x295c3b){_0x3216e4[_0x87cd('0x2b')](0x194);}return _0x295c3b;};}function handleError(_0x5832eb,_0x4c4dfe){_0x4c4dfe=_0x4c4dfe||0x1f4;return function(_0x50c71b){logger[_0x87cd('0x2c')](_0x50c71b[_0x87cd('0x2d')]);if(_0x50c71b[_0x87cd('0x2e')]){delete _0x50c71b[_0x87cd('0x2e')];}_0x5832eb[_0x87cd('0x1c')](_0x4c4dfe)['send'](_0x50c71b);};}exports['index']=function(_0x120d32,_0x3f23ae){var _0x25bb78={},_0x306a1c={},_0x272a44={'count':0x0,'rows':[]};var _0x189971=_[_0x87cd('0x2f')](db[_0x87cd('0x30')][_0x87cd('0x31')],function(_0x2c1354){return{'name':_0x2c1354[_0x87cd('0x32')],'type':_0x2c1354[_0x87cd('0x33')][_0x87cd('0x34')]};});_0x306a1c[_0x87cd('0x35')]=_['map'](_0x189971,'name');_0x306a1c[_0x87cd('0x36')]=_[_0x87cd('0x37')](_0x120d32[_0x87cd('0x36')]);_0x306a1c[_0x87cd('0x38')]=_['intersection'](_0x306a1c['model'],_0x306a1c['query']);_0x25bb78[_0x87cd('0x39')]=_[_0x87cd('0x3a')](_0x306a1c['model'],qs[_0x87cd('0x3b')](_0x120d32[_0x87cd('0x36')][_0x87cd('0x3b')]));_0x25bb78[_0x87cd('0x39')]=_0x25bb78[_0x87cd('0x39')][_0x87cd('0x3c')]?_0x25bb78['attributes']:_0x306a1c[_0x87cd('0x35')];if(!_0x120d32[_0x87cd('0x36')]['hasOwnProperty'](_0x87cd('0x3d'))){_0x25bb78[_0x87cd('0x3e')]=qs[_0x87cd('0x3e')](_0x120d32['query'][_0x87cd('0x3e')]);_0x25bb78[_0x87cd('0x1f')]=qs[_0x87cd('0x1f')](_0x120d32[_0x87cd('0x36')]['offset']);}_0x25bb78[_0x87cd('0x3f')]=qs[_0x87cd('0x40')](_0x120d32[_0x87cd('0x36')][_0x87cd('0x40')]);_0x25bb78[_0x87cd('0x41')]=qs[_0x87cd('0x38')](_[_0x87cd('0x42')](_0x120d32['query'],_0x306a1c[_0x87cd('0x38')]),_0x189971);if(_0x120d32[_0x87cd('0x36')]['filter']){_0x25bb78[_0x87cd('0x41')]=_['merge'](_0x25bb78[_0x87cd('0x41')],{'$or':_[_0x87cd('0x2f')](_0x189971,function(_0x3c3fdb){if(_0x3c3fdb[_0x87cd('0x33')]!==_0x87cd('0x43')){var _0x11a5c3={};_0x11a5c3[_0x3c3fdb['name']]={'$like':'%'+_0x120d32[_0x87cd('0x36')]['filter']+'%'};return _0x11a5c3;}})});}_0x25bb78=_[_0x87cd('0x44')]({},_0x25bb78,_0x120d32[_0x87cd('0x45')]);var _0x3ff852={'where':_0x25bb78[_0x87cd('0x41')]};return db[_0x87cd('0x30')][_0x87cd('0x21')](_0x3ff852)[_0x87cd('0x28')](function(_0x8c614d){_0x272a44[_0x87cd('0x21')]=_0x8c614d;if(_0x120d32['query'][_0x87cd('0x46')]){_0x25bb78[_0x87cd('0x47')]=[{'all':!![]}];}return db[_0x87cd('0x30')]['findAll'](_0x25bb78);})['then'](function(_0xac1a24){_0x272a44['rows']=_0xac1a24;return _0x272a44;})[_0x87cd('0x28')](respondWithFilteredResult(_0x3f23ae,_0x25bb78))['catch'](handleError(_0x3f23ae,null));};exports[_0x87cd('0x48')]=function(_0x262c90,_0x55ba79){var _0x1a00b9={'raw':![],'where':{'id':_0x262c90[_0x87cd('0x49')]['id']}},_0x136165={};_0x136165[_0x87cd('0x35')]=_[_0x87cd('0x37')](db[_0x87cd('0x30')][_0x87cd('0x31')]);_0x136165[_0x87cd('0x36')]=_[_0x87cd('0x37')](_0x262c90[_0x87cd('0x36')]);_0x136165[_0x87cd('0x38')]=_[_0x87cd('0x3a')](_0x136165[_0x87cd('0x35')],_0x136165['query']);_0x1a00b9[_0x87cd('0x39')]=_['intersection'](_0x136165[_0x87cd('0x35')],qs[_0x87cd('0x3b')](_0x262c90[_0x87cd('0x36')][_0x87cd('0x3b')]));_0x1a00b9[_0x87cd('0x39')]=_0x1a00b9[_0x87cd('0x39')][_0x87cd('0x3c')]?_0x1a00b9[_0x87cd('0x39')]:_0x136165[_0x87cd('0x35')];if(_0x262c90[_0x87cd('0x36')]['includeAll']){_0x1a00b9['include']=[{'all':!![]}];}_0x1a00b9=_[_0x87cd('0x44')]({},_0x1a00b9,_0x262c90['options']);return db[_0x87cd('0x30')][_0x87cd('0x4a')](_0x1a00b9)[_0x87cd('0x28')](handleEntityNotFound(_0x55ba79,null))[_0x87cd('0x28')](respondWithResult(_0x55ba79,null))['catch'](handleError(_0x55ba79,null));};exports['create']=function(_0x1bf957,_0x46980e){return db['AnalyticCustomReport'][_0x87cd('0x4b')](_0x1bf957[_0x87cd('0x4c')],{})[_0x87cd('0x28')](function(_0x28147a){var _0x239ea0=_0x1bf957[_0x87cd('0x4d')][_0x87cd('0x29')]({'plain':!![]});if(!_0x239ea0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x239ea0[_0x87cd('0x4e')]===_0x87cd('0x4d')){var _0xb93650=_0x28147a[_0x87cd('0x29')]({'plain':!![]});var _0x473415=_0x87cd('0x4f');return db[_0x87cd('0x50')][_0x87cd('0x4a')]({'where':{'name':_0x473415,'userProfileId':_0x239ea0[_0x87cd('0x51')]},'raw':!![]})['then'](function(_0x20561c){if(_0x20561c&&_0x20561c[_0x87cd('0x52')]===0x0){return db[_0x87cd('0x2a')][_0x87cd('0x4b')]({'name':_0xb93650[_0x87cd('0x2e')],'resourceId':_0xb93650['id'],'type':'CustomReports','sectionId':_0x20561c['id']},{})[_0x87cd('0x28')](function(){return _0x28147a;});}else{return _0x28147a;}})[_0x87cd('0x53')](function(_0x5c72c4){logger[_0x87cd('0x2c')](_0x87cd('0x54'),_0x5c72c4);throw _0x5c72c4;});}return _0x28147a;})[_0x87cd('0x28')](respondWithResult(_0x46980e,0xc9))[_0x87cd('0x53')](handleError(_0x46980e,null));};exports[_0x87cd('0x26')]=function(_0x2c6a7e,_0x20f899){if(_0x2c6a7e['body']['id']){delete _0x2c6a7e[_0x87cd('0x4c')]['id'];}return db['AnalyticCustomReport'][_0x87cd('0x4a')]({'where':{'id':_0x2c6a7e[_0x87cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x20f899,null))['then'](saveUpdates(_0x2c6a7e['body'],null))['then'](respondWithResult(_0x20f899,null))['catch'](handleError(_0x20f899,null));};exports['destroy']=function(_0x34ff38,_0x2e8bf6){return db[_0x87cd('0x30')][_0x87cd('0x4a')]({'where':{'id':_0x34ff38[_0x87cd('0x49')]['id']}})[_0x87cd('0x28')](handleEntityNotFound(_0x2e8bf6,null))[_0x87cd('0x28')](removeEntity(_0x2e8bf6,null))[_0x87cd('0x53')](handleError(_0x2e8bf6,null));};exports[_0x87cd('0x55')]=function(_0x3f1b09,_0x5233a6){var _0x3c29ae=0xa;var _0x4ffa9a=[_0x87cd('0x56'),_0x87cd('0x57'),_0x87cd('0x58'),_0x87cd('0x59')];var _0x1dc858={'SUM':_0x87cd('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x87cd('0x5b'),'AVG':_0x87cd('0x5c'),'GROUP_CONCAT':_0x87cd('0x5d'),'GROUP_CONCAT ASC':_0x87cd('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xef1d8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x87cd('0x5f'),'HOUR':_0x87cd('0x60'),'ROUND':_0x87cd('0x61'),'UNIX_TIMESTAMP':_0x87cd('0x62')};var _0x89b3c4=function(_0x152406){return!_[_0x87cd('0x63')]([_0x87cd('0x64'),_0x87cd('0x65'),_0x87cd('0x66'),_0x87cd('0x67')],_0x152406);};var _0x4ed62a=function(_0x3e4e1a){if(!_0x3e4e1a||!_0x3e4e1a[_0x87cd('0x68')]['length']){return'';}for(var _0x4f6a9b='(',_0x2b93c8=0x0;_0x2b93c8<_0x3e4e1a[_0x87cd('0x68')]['length'];_0x2b93c8+=0x1){_0x2b93c8>0x0&&(_0x4f6a9b+='\x20'+_0x3e4e1a[_0x87cd('0x69')]+'\x20');_0x4f6a9b+=_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8][_0x87cd('0x6a')]?_0x4ed62a(_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8]['group']):_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8][_0x87cd('0x6b')]+'\x20'+_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8][_0x87cd('0x6c')]+(_0x89b3c4(_0x3e4e1a['rules'][_0x2b93c8][_0x87cd('0x6c')])?'\x20'+_0x3e4e1a[_0x87cd('0x68')][_0x2b93c8][_0x87cd('0x6d')]:'');}return _0x4f6a9b+')';};var _0x116256={'where':{'id':_0x3f1b09[_0x87cd('0x49')]['id']}},_0x38cd5f,_0x18e74e,_0x20edc8,_0x5acb58,_0xf07173;_0x116256=_[_0x87cd('0x44')]({},_0x116256,_0x3f1b09['options']);return db['AnalyticCustomReport'][_0x87cd('0x4a')](_0x116256)[_0x87cd('0x28')](function(_0x62a115){if(_0x62a115){_0x38cd5f=_0x62a115;return _0x62a115[_0x87cd('0x6e')]();}return null;})[_0x87cd('0x28')](function(_0x5c0fdf){if(_0x5c0fdf){if(!_0x5c0fdf['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x87cd('0x6f'),0x193);}_0x18e74e=_0x5c0fdf;return db[_0x87cd('0x70')][_0x87cd('0x71')]({'raw':!![]});}return null;})[_0x87cd('0x28')](function(_0x50e7f7){if(_0x50e7f7){_0x20edc8=_[_0x87cd('0x72')](_0x50e7f7,'id');var _0x56d11f;var _0x4a17f0=squel[_0x87cd('0x73')]();_0x4a17f0['from'](_0x38cd5f[_0x87cd('0x74')]);for(var _0x30d928=0x0;_0x30d928<_0x18e74e[_0x87cd('0x3c')];_0x30d928+=0x1){_0x56d11f=_0x18e74e[_0x30d928][_0x87cd('0x75')]?_0x20edc8[_0x18e74e[_0x30d928][_0x87cd('0x75')]][_0x87cd('0x76')]:_0x18e74e[_0x30d928][_0x87cd('0x6b')];_0x56d11f=_0x18e74e[_0x30d928][_0x87cd('0x77')]?_[_0x87cd('0x78')](_0x1dc858[_0x18e74e[_0x30d928][_0x87cd('0x77')]],'%s',_0x56d11f):_0x56d11f;_0x56d11f=_0x18e74e[_0x30d928][_0x87cd('0x79')]?_['replace'](_0xef1d8[_0x18e74e[_0x30d928]['format']],'%s',_0x56d11f):_0x56d11f;if(_0x18e74e[_0x30d928]['groupBy']){_0x4a17f0['group'](_0x56d11f);}_0x18e74e[_0x30d928][_0x87cd('0x7a')]&&_0x4a17f0[_0x87cd('0x3f')](_0x56d11f,_0x18e74e[_0x30d928]['orderBy']===_0x87cd('0x7b')?![]:!![]);_0x4a17f0[_0x87cd('0x6b')](_0x56d11f,_0x18e74e[_0x30d928]['alias']||_0x56d11f);}if(_0x38cd5f[_0x87cd('0x7c')]){_0x38cd5f[_0x87cd('0x7c')]=JSON[_0x87cd('0x7d')](_0x38cd5f[_0x87cd('0x7c')]);for(var _0x402ef6=0x0;_0x402ef6<_0x38cd5f[_0x87cd('0x7c')][_0x87cd('0x3c')];_0x402ef6+=0x1){if(_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x33')]&&_[_0x87cd('0x63')](_0x4ffa9a,_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x33')])&&_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x7e')]&&_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x7f')]&&_0x38cd5f['joins'][_0x402ef6][_0x87cd('0x80')]){_0x4a17f0[_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x33')]](_0x38cd5f['joins'][_0x402ef6][_0x87cd('0x7f')],null,util[_0x87cd('0x79')](_0x87cd('0x81'),_0x38cd5f[_0x87cd('0x74')],_0x38cd5f['joins'][_0x402ef6]['parentKey'],_0x38cd5f[_0x87cd('0x7c')][_0x402ef6][_0x87cd('0x7f')],_0x38cd5f[_0x87cd('0x7c')][_0x402ef6]['foreignKey']));}}}if(_0x38cd5f[_0x87cd('0x82')]){_0x38cd5f[_0x87cd('0x82')]=JSON[_0x87cd('0x7d')](_0x38cd5f[_0x87cd('0x82')]);_0x4a17f0[_0x87cd('0x41')](_0x4ed62a(_0x38cd5f[_0x87cd('0x82')][_0x87cd('0x6a')]));}_0xf07173=_0x4a17f0[_0x87cd('0x83')]();_0x4a17f0[_0x87cd('0x3e')](_0x3c29ae);_0x4a17f0[_0x87cd('0x1f')](0x0);logger['debug'](_0x87cd('0x84'),_0x4a17f0[_0x87cd('0x85')]());return dbH[_0x87cd('0x86')]['query'](_0x4a17f0[_0x87cd('0x85')](),{'type':dbH[_0x87cd('0x86')][_0x87cd('0x87')][_0x87cd('0x88')]});}})['then'](respondWithResult(_0x5233a6,null))['catch'](handleError(_0x5233a6,null));};function runReport(_0x21f5c,_0x396927,_0x4f67f8){var _0x1fb9cc=_0x396927['name'];var _0x1487a1=0xa;var _0x2a3505=[_0x87cd('0x56'),_0x87cd('0x57'),_0x87cd('0x58'),'cross_join'];var _0x40a19b={'SUM':_0x87cd('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x87cd('0x89'),'MAX':'MAX(%s)','MIN':_0x87cd('0x5b'),'AVG':_0x87cd('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x87cd('0x5e'),'GROUP_CONCAT DESC':_0x87cd('0x8a')};var _0x34d63a={'SEC_TO_TIME':_0x87cd('0x8b'),'DATE':_0x87cd('0x5f'),'HOUR':_0x87cd('0x60'),'ROUND':_0x87cd('0x61'),'UNIX_TIMESTAMP':_0x87cd('0x62')};var _0x1c33db=function(_0x23bba0){return!_[_0x87cd('0x63')]([_0x87cd('0x64'),_0x87cd('0x65'),_0x87cd('0x66'),'IS\x20NOT\x20EMPTY'],_0x23bba0);};var _0x4c4d58=function(_0x59dd85){if(!_0x59dd85||!_0x59dd85['rules'][_0x87cd('0x3c')]){return'';}for(var _0xfa4a86='(',_0x4022ae=0x0;_0x4022ae<_0x59dd85['rules']['length'];_0x4022ae+=0x1){_0x4022ae>0x0&&(_0xfa4a86+='\x20'+_0x59dd85[_0x87cd('0x69')]+'\x20');_0xfa4a86+=_0x59dd85[_0x87cd('0x68')][_0x4022ae]['group']?_0x4c4d58(_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6a')]):_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6b')]+'\x20'+_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6c')]+(_0x1c33db(_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6c')])?'\x20'+_0x59dd85[_0x87cd('0x68')][_0x4022ae][_0x87cd('0x6d')]:'');}return _0xfa4a86+')';};var _0x48aefe={'where':{'id':_0x21f5c['id']}},_0x1a5fcc,_0x25386d,_0x42d79e,_0x1a72af,_0x22cf6a;_0x48aefe=_['merge']({},_0x48aefe,_0x4f67f8);return db['AnalyticCustomReport']['find'](_0x48aefe)[_0x87cd('0x28')](function(_0x51f7b1){if(_0x51f7b1){_0x1a5fcc=_0x51f7b1;return _0x51f7b1[_0x87cd('0x6e')]();}return null;})[_0x87cd('0x28')](function(_0x344015){if(_0x344015){if(!_0x344015[_0x87cd('0x3c')]){throw new db[(_0x87cd('0x8c'))][(_0x87cd('0x8d'))](_0x87cd('0x6f'),0x193);}_0x25386d=_0x344015;return db[_0x87cd('0x70')][_0x87cd('0x71')]({'raw':!![]});}return null;})[_0x87cd('0x28')](function(_0xdcafc1){if(_0xdcafc1){_0x42d79e=_[_0x87cd('0x72')](_0xdcafc1,'id');var _0x4703af;var _0x46fddf=squel[_0x87cd('0x73')]();_0x46fddf[_0x87cd('0x8e')](_0x1a5fcc['table']);for(var _0x43d352=0x0;_0x43d352<_0x25386d[_0x87cd('0x3c')];_0x43d352+=0x1){_0x4703af=_0x25386d[_0x43d352]['MetricId']?_0x42d79e[_0x25386d[_0x43d352][_0x87cd('0x75')]][_0x87cd('0x76')]:_0x25386d[_0x43d352]['field'];_0x4703af=_0x25386d[_0x43d352][_0x87cd('0x77')]?_[_0x87cd('0x78')](_0x40a19b[_0x25386d[_0x43d352]['function']],'%s',_0x4703af):_0x4703af;_0x4703af=_0x25386d[_0x43d352]['format']?_[_0x87cd('0x78')](_0x34d63a[_0x25386d[_0x43d352][_0x87cd('0x79')]],'%s',_0x4703af):_0x4703af;if(_0x25386d[_0x43d352][_0x87cd('0x8f')]){_0x46fddf['group'](_0x4703af);}_0x25386d[_0x43d352][_0x87cd('0x7a')]&&_0x46fddf[_0x87cd('0x3f')](_0x4703af,_0x25386d[_0x43d352][_0x87cd('0x7a')]===_0x87cd('0x7b')?![]:!![]);_0x46fddf['field'](_0x4703af,_0x25386d[_0x43d352][_0x87cd('0x90')]||_0x4703af);}if(_0x1a5fcc[_0x87cd('0x7c')]){_0x1a5fcc[_0x87cd('0x7c')]=JSON[_0x87cd('0x7d')](_0x1a5fcc[_0x87cd('0x7c')]);for(var _0x4dc5cb=0x0;_0x4dc5cb<_0x1a5fcc[_0x87cd('0x7c')][_0x87cd('0x3c')];_0x4dc5cb+=0x1){if(_0x1a5fcc['joins'][_0x4dc5cb][_0x87cd('0x33')]&&_[_0x87cd('0x63')](_0x2a3505,_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x33')])&&_0x1a5fcc['joins'][_0x4dc5cb][_0x87cd('0x7e')]&&_0x1a5fcc['joins'][_0x4dc5cb][_0x87cd('0x7f')]&&_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x80')]){_0x46fddf[_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x33')]](_0x1a5fcc['joins'][_0x4dc5cb][_0x87cd('0x7f')],null,util[_0x87cd('0x79')](_0x87cd('0x81'),_0x1a5fcc[_0x87cd('0x74')],_0x1a5fcc['joins'][_0x4dc5cb]['parentKey'],_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x7f')],_0x1a5fcc[_0x87cd('0x7c')][_0x4dc5cb][_0x87cd('0x80')]));}}}if(_0x1a5fcc[_0x87cd('0x82')]){_0x1a5fcc[_0x87cd('0x82')]=JSON[_0x87cd('0x7d')](_0x1a5fcc[_0x87cd('0x82')]);_0x46fddf[_0x87cd('0x41')](_0x4c4d58(_0x1a5fcc['conditions'][_0x87cd('0x6a')]));}_0x22cf6a=_0x46fddf['clone']();_0x46fddf[_0x87cd('0x3e')](_0x1487a1);_0x46fddf[_0x87cd('0x1f')](0x0);return;}})[_0x87cd('0x28')](function(){if(_0x396927[_0x87cd('0x91')]===_0x87cd('0x92')){return null;}var _0x5d60de=_['merge'](_0x396927,{'name':_0x396927[_0x87cd('0x93')]||_0x396927[_0x87cd('0x2e')]||_0x1a5fcc[_0x87cd('0x2e')],'basename':_0x1fb9cc,'savename':util['format'](_0x87cd('0x94'),_0x396927['name']||_0x1a5fcc[_0x87cd('0x2e')],require('randomstring')[_0x87cd('0x95')](0x4),_0x396927[_0x87cd('0x91')]||_0x87cd('0x96')),'reportId':_0x1a5fcc['id'],'reportType':_0x87cd('0x97')});return db[_0x87cd('0x98')][_0x87cd('0x4b')](_0x5d60de,{'raw':!![]});})[_0x87cd('0x28')](function(_0x2958a6){if(_0x1a5fcc['table']==='cdr'){_0x22cf6a['where'](_0x1a5fcc['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x396927[_0x87cd('0x99')],_0x396927['endDate']);}else{_0x22cf6a[_0x87cd('0x41')](_0x1a5fcc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x396927[_0x87cd('0x99')],_0x396927[_0x87cd('0x9a')]);}if(_0x2958a6){logger['info'](_0x87cd('0x9b'),_0x22cf6a[_0x87cd('0x85')]());require(_0x87cd('0x9c'))[_0x87cd('0x9d')](path[_0x87cd('0x56')](__dirname,_0x87cd('0x9e'),_0x2958a6[_0x87cd('0x91')]),[_0x2958a6['id'],_0x22cf6a[_0x87cd('0x85')](),path[_0x87cd('0x56')](__dirname,_0x87cd('0x9f'),_0x2958a6[_0x87cd('0xa0')]),_0x1fb9cc]);return _0x2958a6;}else{var _0x4af41c=squel['select']();_0x4af41c['from']('('+_0x22cf6a[_0x87cd('0x85')]()+')',_0x87cd('0xa1'));_0x4af41c[_0x87cd('0x6b')](_0x87cd('0xa2'),_0x87cd('0x21'));_0x22cf6a[_0x87cd('0x3e')](_0x396927['limit']||_0x1487a1);_0x22cf6a[_0x87cd('0x1f')](_0x396927['offset']||0x0);return dbH['sequelize'][_0x87cd('0x36')](_0x4af41c[_0x87cd('0x85')](),{'type':dbH[_0x87cd('0x86')][_0x87cd('0x87')][_0x87cd('0x88')]})[_0x87cd('0x28')](function(_0x4273ed){if(!_0x4273ed[_0x87cd('0x3c')]){_0x1a72af=0x0;}else{_0x1a72af=_0x4273ed[0x0][_0x87cd('0x21')]||0x0;}return dbH[_0x87cd('0x86')][_0x87cd('0x36')](_0x22cf6a['toString'](),{'type':dbH[_0x87cd('0x86')][_0x87cd('0x87')][_0x87cd('0x88')]});})['then'](function(_0x33b9d){return{'rows':_0x33b9d||[],'count':_0x1a72af};});}});}exports[_0x87cd('0xa3')]=function(_0x4620c6,_0x3dfc33){return runReport(_0x4620c6[_0x87cd('0x49')],_0x4620c6['query'],_0x4620c6['options'])[_0x87cd('0x28')](respondWithResult(_0x3dfc33,null))[_0x87cd('0x53')](handleError(_0x3dfc33,null));};exports[_0x87cd('0xa4')]=runReport;exports[_0x87cd('0x36')]=function(_0x4f72d5,_0x57ad9e){var _0x26a2ad=0xa;var _0x52e52c=[_0x87cd('0x56'),_0x87cd('0x57'),_0x87cd('0x58'),_0x87cd('0x59')];var _0x3e3a20={'SUM':_0x87cd('0x5a'),'COUNT':_0x87cd('0xa5'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x87cd('0xa6'),'MIN':'MIN(%s)','AVG':_0x87cd('0x5c'),'GROUP_CONCAT':_0x87cd('0x5d'),'GROUP_CONCAT ASC':_0x87cd('0x5e'),'GROUP_CONCAT DESC':_0x87cd('0x8a')};var _0x318a11={'SEC_TO_TIME':_0x87cd('0x8b'),'DATE':_0x87cd('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x87cd('0x61'),'UNIX_TIMESTAMP':_0x87cd('0x62')};var _0x23d619=function(_0xd4580c){return!_[_0x87cd('0x63')]([_0x87cd('0x64'),_0x87cd('0x65'),_0x87cd('0x66'),'IS\x20NOT\x20EMPTY'],_0xd4580c);};var _0x2f3be1=function(_0x4cfad1){if(!_0x4cfad1||!_0x4cfad1[_0x87cd('0x68')]['length']){return'';}for(var _0x3eeb06='(',_0x164d9b=0x0;_0x164d9b<_0x4cfad1[_0x87cd('0x68')][_0x87cd('0x3c')];_0x164d9b+=0x1){_0x164d9b>0x0&&(_0x3eeb06+='\x20'+_0x4cfad1[_0x87cd('0x69')]+'\x20');_0x3eeb06+=_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6a')]?_0x2f3be1(_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6a')]):_0x4cfad1['rules'][_0x164d9b][_0x87cd('0x6b')]+'\x20'+_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6c')]+(_0x23d619(_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6c')])?'\x20'+_0x4cfad1[_0x87cd('0x68')][_0x164d9b][_0x87cd('0x6d')]:'');}return _0x3eeb06+')';};var _0x550e20={'where':{'id':_0x4f72d5['params']['id']}},_0x2c87c4,_0x3a78e8,_0x37ccf1,_0x2829d2,_0x20541c;_0x550e20=_[_0x87cd('0x44')]({},_0x550e20,_0x4f72d5[_0x87cd('0x45')]);return db[_0x87cd('0x30')][_0x87cd('0x4a')](_0x550e20)[_0x87cd('0x28')](function(_0xaf70d5){if(_0xaf70d5){_0x2c87c4=_0xaf70d5;return _0xaf70d5['getFields']();}return null;})[_0x87cd('0x28')](function(_0x4e10ef){if(_0x4e10ef){if(!_0x4e10ef['length']){throw new db[(_0x87cd('0x8c'))][(_0x87cd('0x8d'))](_0x87cd('0x6f'),0x193);}_0x3a78e8=_0x4e10ef;return db[_0x87cd('0x70')][_0x87cd('0x71')]({'raw':!![]});}return null;})['then'](function(_0x29be8e){if(_0x29be8e){_0x37ccf1=_[_0x87cd('0x72')](_0x29be8e,'id');var _0x2daf4f;var _0x3b2a9f=squel[_0x87cd('0x73')]();_0x3b2a9f[_0x87cd('0x8e')](_0x2c87c4[_0x87cd('0x74')]);for(var _0xa39509=0x0;_0xa39509<_0x3a78e8[_0x87cd('0x3c')];_0xa39509+=0x1){_0x2daf4f=_0x3a78e8[_0xa39509]['MetricId']?_0x37ccf1[_0x3a78e8[_0xa39509][_0x87cd('0x75')]][_0x87cd('0x76')]:_0x3a78e8[_0xa39509][_0x87cd('0x6b')];_0x2daf4f=_0x3a78e8[_0xa39509][_0x87cd('0x77')]?_[_0x87cd('0x78')](_0x3e3a20[_0x3a78e8[_0xa39509][_0x87cd('0x77')]],'%s',_0x2daf4f):_0x2daf4f;_0x2daf4f=_0x3a78e8[_0xa39509][_0x87cd('0x79')]?_[_0x87cd('0x78')](_0x318a11[_0x3a78e8[_0xa39509][_0x87cd('0x79')]],'%s',_0x2daf4f):_0x2daf4f;if(_0x3a78e8[_0xa39509][_0x87cd('0x8f')]){_0x3b2a9f[_0x87cd('0x6a')](_0x2daf4f);}_0x3a78e8[_0xa39509][_0x87cd('0x7a')]&&_0x3b2a9f['order'](_0x2daf4f,_0x3a78e8[_0xa39509][_0x87cd('0x7a')]===_0x87cd('0x7b')?![]:!![]);_0x3b2a9f['field'](_0x2daf4f,_0x3a78e8[_0xa39509][_0x87cd('0x90')]||_0x2daf4f);}if(_0x2c87c4[_0x87cd('0x7c')]){_0x2c87c4[_0x87cd('0x7c')]=JSON[_0x87cd('0x7d')](_0x2c87c4[_0x87cd('0x7c')]);for(var _0x48c6c1=0x0;_0x48c6c1<_0x2c87c4[_0x87cd('0x7c')]['length'];_0x48c6c1+=0x1){if(_0x2c87c4['joins'][_0x48c6c1][_0x87cd('0x33')]&&_[_0x87cd('0x63')](_0x52e52c,_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1]['type'])&&_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x7e')]&&_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x7f')]&&_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x80')]){_0x3b2a9f[_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x33')]](_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1][_0x87cd('0x7f')],null,util[_0x87cd('0x79')]('%s.%s\x20=\x20%s.%s',_0x2c87c4[_0x87cd('0x74')],_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1]['parentKey'],_0x2c87c4[_0x87cd('0x7c')][_0x48c6c1]['foreignTable'],_0x2c87c4['joins'][_0x48c6c1]['foreignKey']));}}}if(_0x2c87c4[_0x87cd('0x82')]){_0x2c87c4[_0x87cd('0x82')]=JSON['parse'](_0x2c87c4[_0x87cd('0x82')]);_0x3b2a9f[_0x87cd('0x41')](_0x2f3be1(_0x2c87c4[_0x87cd('0x82')]['group']));}_0x20541c=_0x3b2a9f[_0x87cd('0x83')]();_0x3b2a9f[_0x87cd('0x3e')](_0x26a2ad);_0x3b2a9f['offset'](0x0);logger[_0x87cd('0xa7')](_0x87cd('0x84'),_0x3b2a9f[_0x87cd('0x85')]());return dbH[_0x87cd('0x86')][_0x87cd('0x36')](_0x3b2a9f[_0x87cd('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x87cd('0x88')]});}})[_0x87cd('0x28')](function(){return{'sql':_0x20541c[_0x87cd('0x85')]()};})[_0x87cd('0x28')](respondWithResult(_0x57ad9e,null))['catch'](handleError(_0x57ad9e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index d3c62fb..3922097 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 _0xe4a5=['lodash','api','moment','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x2749d1,_0x2114e7){var _0x5f0d94=function(_0x24bb5b){while(--_0x24bb5b){_0x2749d1['push'](_0x2749d1['shift']());}};_0x5f0d94(++_0x2114e7);}(_0xe4a5,0x168));var _0x5e4a=function(_0x1d27a8,_0x2f5d59){_0x1d27a8=_0x1d27a8-0x0;var _0x37adc5=_0xe4a5[_0x1d27a8];return _0x37adc5;};'use strict';var _=require(_0x5e4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5e4a('0x1'));var moment=require(_0x5e4a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e4a('0x3'));var rimraf=require(_0x5e4a('0x4'));var config=require('../../config/environment');var attributes=require(_0x5e4a('0x5'));module[_0x5e4a('0x6')]=function(_0xb7c287,_0xf90ca2){return _0xb7c287[_0x5e4a('0x7')](_0x5e4a('0x8'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b51=['request-promise','path','../../config/environment','exports','define','AnalyticCustomReport','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2d223a,_0x3c63cb){var _0x28c01a=function(_0x2a97a0){while(--_0x2a97a0){_0x2d223a['push'](_0x2d223a['shift']());}};_0x28c01a(++_0x3c63cb);}(_0x6b51,0x192));var _0x16b5=function(_0x10b328,_0x2438b5){_0x10b328=_0x10b328-0x0;var _0x364727=_0x6b51[_0x10b328];return _0x364727;};'use strict';var _=require(_0x16b5('0x0'));var util=require('util');var logger=require(_0x16b5('0x1'))(_0x16b5('0x2'));var moment=require(_0x16b5('0x3'));var BPromise=require(_0x16b5('0x4'));var rp=require(_0x16b5('0x5'));var fs=require('fs');var path=require(_0x16b5('0x6'));var rimraf=require('rimraf');var config=require(_0x16b5('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x16b5('0x8')]=function(_0x76aecd,_0x62a6cb){return _0x76aecd[_0x16b5('0x9')](_0x16b5('0xa'),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 1395d89..b11238a 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 _0xc0f1=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5881b2,_0x1170b7){var _0x21c207=function(_0x1712ec){while(--_0x1712ec){_0x5881b2['push'](_0x5881b2['shift']());}};_0x21c207(++_0x1170b7);}(_0xc0f1,0x101));var _0x1c0f=function(_0x5875ad,_0x3597b8){_0x5875ad=_0x5875ad-0x0;var _0x32a922=_0xc0f1[_0x5875ad];return _0x32a922;};'use strict';var _=require(_0x1c0f('0x0'));var util=require('util');var moment=require(_0x1c0f('0x1'));var BPromise=require(_0x1c0f('0x2'));var rs=require(_0x1c0f('0x3'));var fs=require('fs');var Redis=require(_0x1c0f('0x4'));var db=require(_0x1c0f('0x5'))['db'];var utils=require(_0x1c0f('0x6'));var logger=require(_0x1c0f('0x7'))(_0x1c0f('0x8'));var config=require(_0x1c0f('0x9'));var jayson=require(_0x1c0f('0xa'));var client=jayson[_0x1c0f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb8988c,_0x59b79a,_0x2a9cd2){return new BPromise(function(_0xb0f56,_0x85a58e){return client[_0x1c0f('0xc')](_0xb8988c,_0x2a9cd2)[_0x1c0f('0xd')](function(_0x55c4d7){logger[_0x1c0f('0xe')](_0x1c0f('0xf'),_0x59b79a,_0x1c0f('0x10'));logger[_0x1c0f('0x11')](_0x1c0f('0x12'),_0x59b79a,_0x1c0f('0x10'),JSON[_0x1c0f('0x13')](_0x55c4d7));if(_0x55c4d7[_0x1c0f('0x14')]){if(_0x55c4d7[_0x1c0f('0x14')][_0x1c0f('0x15')]===0x1f4){logger[_0x1c0f('0x14')](_0x1c0f('0xf'),_0x59b79a,_0x55c4d7[_0x1c0f('0x14')][_0x1c0f('0x16')]);return _0x85a58e(_0x55c4d7[_0x1c0f('0x14')][_0x1c0f('0x16')]);}logger[_0x1c0f('0x14')](_0x1c0f('0xf'),_0x59b79a,_0x55c4d7[_0x1c0f('0x14')]['message']);return _0xb0f56(_0x55c4d7[_0x1c0f('0x14')][_0x1c0f('0x16')]);}else{logger[_0x1c0f('0xe')](_0x1c0f('0xf'),_0x59b79a,'request\x20sent');_0xb0f56(_0x55c4d7[_0x1c0f('0x17')][_0x1c0f('0x16')]);}})[_0x1c0f('0x18')](function(_0x3154e7){logger[_0x1c0f('0x14')](_0x1c0f('0xf'),_0x59b79a,_0x3154e7);_0x85a58e(_0x3154e7);});});}
\ No newline at end of file
+var _0x3a5a=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x16a21a,_0x4f28e6){var _0x5ed3c4=function(_0x1c5156){while(--_0x1c5156){_0x16a21a['push'](_0x16a21a['shift']());}};_0x5ed3c4(++_0x4f28e6);}(_0x3a5a,0xab));var _0xa3a5=function(_0x5be0cf,_0x4cfe44){_0x5be0cf=_0x5be0cf-0x0;var _0xecd17a=_0x3a5a[_0x5be0cf];return _0xecd17a;};'use strict';var _=require('lodash');var util=require(_0xa3a5('0x0'));var moment=require(_0xa3a5('0x1'));var BPromise=require(_0xa3a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3a5('0x3'))['db'];var utils=require(_0xa3a5('0x4'));var logger=require(_0xa3a5('0x5'))('rpc');var config=require(_0xa3a5('0x6'));var jayson=require(_0xa3a5('0x7'));var client=jayson[_0xa3a5('0x8')][_0xa3a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b50ef,_0x208615,_0x1bbed0){return new BPromise(function(_0x1a0b05,_0x1bb0b1){return client[_0xa3a5('0xa')](_0x3b50ef,_0x1bbed0)[_0xa3a5('0xb')](function(_0x4fd9b8){logger[_0xa3a5('0xc')](_0xa3a5('0xd'),_0x208615,'request\x20sent');logger[_0xa3a5('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x208615,'request\x20sent',JSON[_0xa3a5('0xf')](_0x4fd9b8));if(_0x4fd9b8[_0xa3a5('0x10')]){if(_0x4fd9b8[_0xa3a5('0x10')]['code']===0x1f4){logger[_0xa3a5('0x10')](_0xa3a5('0xd'),_0x208615,_0x4fd9b8[_0xa3a5('0x10')][_0xa3a5('0x11')]);return _0x1bb0b1(_0x4fd9b8[_0xa3a5('0x10')][_0xa3a5('0x11')]);}logger[_0xa3a5('0x10')](_0xa3a5('0xd'),_0x208615,_0x4fd9b8['error'][_0xa3a5('0x11')]);return _0x1a0b05(_0x4fd9b8[_0xa3a5('0x10')]['message']);}else{logger[_0xa3a5('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x208615,_0xa3a5('0x12'));_0x1a0b05(_0x4fd9b8['result'][_0xa3a5('0x11')]);}})[_0xa3a5('0x13')](function(_0x36b8d0){logger[_0xa3a5('0x10')](_0xa3a5('0xd'),_0x208615,_0x36b8d0);_0x1bb0b1(_0x36b8d0);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index b35a7e7..41a29ac 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 _0x1a0a=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x224457,_0x5a8a46){var _0x538686=function(_0x1dbf49){while(--_0x1dbf49){_0x224457['push'](_0x224457['shift']());}};_0x538686(++_0x5a8a46);}(_0x1a0a,0x12d));var _0xa1a0=function(_0x4becb8,_0x4ad3d3){_0x4becb8=_0x4becb8-0x0;var _0x5c8a37=_0x1a0a[_0x4becb8];return _0x5c8a37;};'use strict';var multer=require(_0xa1a0('0x0'));var util=require(_0xa1a0('0x1'));var path=require(_0xa1a0('0x2'));var timeout=require(_0xa1a0('0x3'));var express=require(_0xa1a0('0x4'));var router=express['Router']();var fs_extra=require(_0xa1a0('0x5'));var auth=require(_0xa1a0('0x6'));var interaction=require(_0xa1a0('0x7'));var config=require(_0xa1a0('0x8'));var controller=require(_0xa1a0('0x9'));router['get']('/',auth[_0xa1a0('0xa')](),controller[_0xa1a0('0xb')]);router[_0xa1a0('0xc')](_0xa1a0('0xd'),auth[_0xa1a0('0xa')](),controller[_0xa1a0('0xe')]);router[_0xa1a0('0xc')](_0xa1a0('0xf'),auth[_0xa1a0('0xa')](),controller[_0xa1a0('0x10')]);router['get'](_0xa1a0('0x11'),auth[_0xa1a0('0xa')](),controller['run']);router[_0xa1a0('0xc')](_0xa1a0('0x12'),auth[_0xa1a0('0xa')](),controller[_0xa1a0('0x13')]);router['post']('/',auth[_0xa1a0('0xa')](),controller['create']);router['put']('/:id',auth[_0xa1a0('0xa')](),controller['update']);router[_0xa1a0('0x14')](_0xa1a0('0xd'),auth[_0xa1a0('0xa')](),controller[_0xa1a0('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xbabf=['query','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x37276f,_0x3e9aed){var _0x31c6ed=function(_0x50df8f){while(--_0x50df8f){_0x37276f['push'](_0x37276f['shift']());}};_0x31c6ed(++_0x3e9aed);}(_0xbabf,0x1be));var _0xfbab=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbabf[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0xfbab('0x0'));var util=require(_0xfbab('0x1'));var path=require('path');var timeout=require(_0xfbab('0x2'));var express=require(_0xfbab('0x3'));var router=express[_0xfbab('0x4')]();var fs_extra=require(_0xfbab('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfbab('0x6'));var controller=require(_0xfbab('0x7'));router['get']('/',auth[_0xfbab('0x8')](),controller[_0xfbab('0x9')]);router[_0xfbab('0xa')](_0xfbab('0xb'),auth[_0xfbab('0x8')](),controller[_0xfbab('0xc')]);router[_0xfbab('0xa')](_0xfbab('0xd'),auth['isAuthenticated'](),controller[_0xfbab('0xe')]);router[_0xfbab('0xa')](_0xfbab('0xf'),auth[_0xfbab('0x8')](),controller['run']);router[_0xfbab('0xa')]('/:id/query',auth[_0xfbab('0x8')](),controller[_0xfbab('0x10')]);router[_0xfbab('0x11')]('/',auth['isAuthenticated'](),controller[_0xfbab('0x12')]);router[_0xfbab('0x13')](_0xfbab('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfbab('0x14')](_0xfbab('0xb'),auth['isAuthenticated'](),controller[_0xfbab('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index c450716..0979d32 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 _0xbd51=['sequelize','STRING'];(function(_0x153810,_0x4b3117){var _0x3df31a=function(_0x239357){while(--_0x239357){_0x153810['push'](_0x153810['shift']());}};_0x3df31a(++_0x4b3117);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3f0524,_0x55c95a){_0x3f0524=_0x3f0524-0x0;var _0x164a07=_0xbd51[_0x3f0524];return _0x164a07;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x2675,0x75));var _0x5267=function(_0x100e0e,_0x2c2f2c){_0x100e0e=_0x100e0e-0x0;var _0x5ba0f8=_0x2675[_0x100e0e];return _0x5ba0f8;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 156c03c..e096734 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x432e77,_0x2e7381){var _0x585ac6=function(_0x2f72c3){while(--_0x2f72c3){_0x432e77['push'](_0x432e77['shift']());}};_0x585ac6(++_0x2e7381);}(_0xda19,0xd5));var _0x9da1=function(_0x51212f,_0x4a7ff4){_0x51212f=_0x51212f-0x0;var _0x33f6d5=_0xda19[_0x51212f];return _0x33f6d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
+var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','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','catch','preview','join','left_join','MAX(%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)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x3ebeca,_0x349ec2){var _0xd86f9e=function(_0x19fdc2){while(--_0x19fdc2){_0x3ebeca['push'](_0x3ebeca['shift']());}};_0xd86f9e(++_0x349ec2);}(_0x53ec,0x192));var _0xc53e=function(_0x40edbb,_0x4b8e85){_0x40edbb=_0x40edbb-0x0;var _0x1c34e1=_0x53ec[_0x40edbb];return _0x1c34e1;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index d659d3a..0f4a272 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 _0xda16=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports'];(function(_0x14977c,_0x2c6d7e){var _0xafe01a=function(_0x3e0ded){while(--_0x3e0ded){_0x14977c['push'](_0x14977c['shift']());}};_0xafe01a(++_0x2c6d7e);}(_0xda16,0x14a));var _0x6da1=function(_0x1671c9,_0x4640d3){_0x1671c9=_0x1671c9-0x0;var _0x15b4ba=_0xda16[_0x1671c9];return _0x15b4ba;};'use strict';var _=require(_0x6da1('0x0'));var util=require('util');var logger=require(_0x6da1('0x1'))(_0x6da1('0x2'));var moment=require(_0x6da1('0x3'));var BPromise=require('bluebird');var rp=require(_0x6da1('0x4'));var fs=require('fs');var path=require(_0x6da1('0x5'));var rimraf=require('rimraf');var config=require(_0x6da1('0x6'));var attributes=require(_0x6da1('0x7'));module[_0x6da1('0x8')]=function(_0x50ab5f,_0x27a492){return _0x50ab5f['define']('AnalyticDefaultReport',attributes,{'tableName':_0x6da1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c6e=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x55a357,_0x3902ac){var _0x39b515=function(_0x2d9956){while(--_0x2d9956){_0x55a357['push'](_0x55a357['shift']());}};_0x39b515(++_0x3902ac);}(_0x3c6e,0xdd));var _0xe3c6=function(_0x13175f,_0x4133d6){_0x13175f=_0x13175f-0x0;var _0x1f127c=_0x3c6e[_0x13175f];return _0x1f127c;};'use strict';var _=require(_0xe3c6('0x0'));var util=require('util');var logger=require(_0xe3c6('0x1'))(_0xe3c6('0x2'));var moment=require(_0xe3c6('0x3'));var BPromise=require(_0xe3c6('0x4'));var rp=require(_0xe3c6('0x5'));var fs=require('fs');var path=require(_0xe3c6('0x6'));var rimraf=require(_0xe3c6('0x7'));var config=require(_0xe3c6('0x8'));var attributes=require(_0xe3c6('0x9'));module['exports']=function(_0x123a7e,_0x4e835c){return _0x123a7e[_0xe3c6('0xa')](_0xe3c6('0xb'),attributes,{'tableName':_0xe3c6('0xc'),'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 95f8ae2..da4c46a 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 _0xc558=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x396d8a,_0x293874){var _0x3f4cca=function(_0xfe3ae2){while(--_0xfe3ae2){_0x396d8a['push'](_0x396d8a['shift']());}};_0x3f4cca(++_0x293874);}(_0xc558,0x1d0));var _0x8c55=function(_0x335db4,_0x3006c9){_0x335db4=_0x335db4-0x0;var _0x699903=_0xc558[_0x335db4];return _0x699903;};'use strict';var _=require(_0x8c55('0x0'));var util=require(_0x8c55('0x1'));var moment=require(_0x8c55('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c55('0x3'));var fs=require('fs');var Redis=require(_0x8c55('0x4'));var db=require(_0x8c55('0x5'))['db'];var utils=require(_0x8c55('0x6'));var logger=require(_0x8c55('0x7'))('rpc');var config=require(_0x8c55('0x8'));var jayson=require(_0x8c55('0x9'));var client=jayson[_0x8c55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x467796,_0x2fc1bb,_0x39bf49){return new BPromise(function(_0x54ccf1,_0x1627b1){return client[_0x8c55('0xb')](_0x467796,_0x39bf49)[_0x8c55('0xc')](function(_0x25225d){logger['info'](_0x8c55('0xd'),_0x2fc1bb,_0x8c55('0xe'));logger[_0x8c55('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2fc1bb,'request\x20sent',JSON['stringify'](_0x25225d));if(_0x25225d[_0x8c55('0x10')]){if(_0x25225d[_0x8c55('0x10')]['code']===0x1f4){logger['error'](_0x8c55('0xd'),_0x2fc1bb,_0x25225d[_0x8c55('0x10')][_0x8c55('0x11')]);return _0x1627b1(_0x25225d['error'][_0x8c55('0x11')]);}logger[_0x8c55('0x10')](_0x8c55('0xd'),_0x2fc1bb,_0x25225d['error'][_0x8c55('0x11')]);return _0x54ccf1(_0x25225d[_0x8c55('0x10')][_0x8c55('0x11')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2fc1bb,_0x8c55('0xe'));_0x54ccf1(_0x25225d[_0x8c55('0x12')][_0x8c55('0x11')]);}})[_0x8c55('0x13')](function(_0x3a2c3d){logger[_0x8c55('0x10')](_0x8c55('0xd'),_0x2fc1bb,_0x3a2c3d);_0x1627b1(_0x3a2c3d);});});}
\ No newline at end of file
+var _0x0ca8=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x31a755,_0x203ce1){var _0x4aa72b=function(_0xa3568c){while(--_0xa3568c){_0x31a755['push'](_0x31a755['shift']());}};_0x4aa72b(++_0x203ce1);}(_0x0ca8,0x6e));var _0x80ca=function(_0x4bbf71,_0xf724a2){_0x4bbf71=_0x4bbf71-0x0;var _0x21f28f=_0x0ca8[_0x4bbf71];return _0x21f28f;};'use strict';var _=require(_0x80ca('0x0'));var util=require(_0x80ca('0x1'));var moment=require(_0x80ca('0x2'));var BPromise=require('bluebird');var rs=require(_0x80ca('0x3'));var fs=require('fs');var Redis=require(_0x80ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x80ca('0x5'));var logger=require('../../config/logger')(_0x80ca('0x6'));var config=require(_0x80ca('0x7'));var jayson=require(_0x80ca('0x8'));var client=jayson[_0x80ca('0x9')][_0x80ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3435b9,_0x416f41,_0xf827fa){return new BPromise(function(_0x399016,_0x39f678){return client['request'](_0x3435b9,_0xf827fa)[_0x80ca('0xb')](function(_0x96c26b){logger[_0x80ca('0xc')](_0x80ca('0xd'),_0x416f41,'request\x20sent');logger['debug'](_0x80ca('0xe'),_0x416f41,_0x80ca('0xf'),JSON[_0x80ca('0x10')](_0x96c26b));if(_0x96c26b['error']){if(_0x96c26b['error']['code']===0x1f4){logger['error'](_0x80ca('0xd'),_0x416f41,_0x96c26b['error']['message']);return _0x39f678(_0x96c26b[_0x80ca('0x11')]['message']);}logger['error'](_0x80ca('0xd'),_0x416f41,_0x96c26b[_0x80ca('0x11')][_0x80ca('0x12')]);return _0x399016(_0x96c26b[_0x80ca('0x11')][_0x80ca('0x12')]);}else{logger[_0x80ca('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x416f41,_0x80ca('0xf'));_0x399016(_0x96c26b[_0x80ca('0x13')][_0x80ca('0x12')]);}})[_0x80ca('0x14')](function(_0x5e057e){logger[_0x80ca('0x11')](_0x80ca('0xd'),_0x416f41,_0x5e057e);_0x39f678(_0x5e057e);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index a7d63e6..06b34bd 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 _0x03c6=['isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id'];(function(_0xb7cb72,_0x19d391){var _0x4b7570=function(_0x5a4a93){while(--_0x5a4a93){_0xb7cb72['push'](_0xb7cb72['shift']());}};_0x4b7570(++_0x19d391);}(_0x03c6,0x84));var _0x603c=function(_0x20a6c8,_0x3d7c7c){_0x20a6c8=_0x20a6c8-0x0;var _0xdcff8c=_0x03c6[_0x20a6c8];return _0xdcff8c;};'use strict';var multer=require('multer');var util=require(_0x603c('0x0'));var path=require(_0x603c('0x1'));var timeout=require(_0x603c('0x2'));var express=require('express');var router=express[_0x603c('0x3')]();var fs_extra=require(_0x603c('0x4'));var auth=require(_0x603c('0x5'));var interaction=require(_0x603c('0x6'));var config=require(_0x603c('0x7'));var controller=require(_0x603c('0x8'));router[_0x603c('0x9')]('/',auth['isAuthenticated'](),controller[_0x603c('0xa')]);router[_0x603c('0x9')](_0x603c('0xb'),auth[_0x603c('0xc')](),controller[_0x603c('0xd')]);router[_0x603c('0x9')](_0x603c('0xe'),auth[_0x603c('0xc')](),controller[_0x603c('0xf')]);router[_0x603c('0x9')](_0x603c('0x10'),auth['isAuthenticated'](),controller[_0x603c('0x11')]);router['get'](_0x603c('0x12'),auth[_0x603c('0xc')](),controller[_0x603c('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x603c('0x14')]);router['put'](_0x603c('0xb'),auth[_0x603c('0xc')](),controller['update']);router[_0x603c('0x15')](_0x603c('0xb'),auth['isAuthenticated'](),controller[_0x603c('0x16')]);module[_0x603c('0x17')]=router;
\ No newline at end of file
+var _0xf567=['/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','run'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0xf567,0x118));var _0x7f56=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf567[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var path=require(_0x7f56('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f56('0x3'));var router=express[_0x7f56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f56('0x5'));var interaction=require(_0x7f56('0x6'));var config=require(_0x7f56('0x7'));var controller=require(_0x7f56('0x8'));router['get']('/',auth[_0x7f56('0x9')](),controller[_0x7f56('0xa')]);router[_0x7f56('0xb')]('/:id',auth[_0x7f56('0x9')](),controller[_0x7f56('0xc')]);router[_0x7f56('0xb')](_0x7f56('0xd'),auth[_0x7f56('0x9')](),controller[_0x7f56('0xe')]);router[_0x7f56('0xb')](_0x7f56('0xf'),auth[_0x7f56('0x9')](),controller[_0x7f56('0x10')]);router[_0x7f56('0xb')](_0x7f56('0x11'),auth[_0x7f56('0x9')](),controller[_0x7f56('0x12')]);router[_0x7f56('0x13')]('/',auth[_0x7f56('0x9')](),controller[_0x7f56('0x14')]);router[_0x7f56('0x15')](_0x7f56('0x16'),auth[_0x7f56('0x9')](),controller[_0x7f56('0x17')]);router[_0x7f56('0x18')]('/:id',auth[_0x7f56('0x9')](),controller[_0x7f56('0x19')]);module[_0x7f56('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 66c213c..84a652c 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 _0x171e=['manual','scheduled','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','csv','Loading'];(function(_0xaecc27,_0x3b15ab){var _0x2203ec=function(_0x47efdf){while(--_0x47efdf){_0xaecc27['push'](_0xaecc27['shift']());}};_0x2203ec(++_0x3b15ab);}(_0x171e,0x141));var _0xe171=function(_0x3094c5,_0x69d9d){_0x3094c5=_0x3094c5-0x0;var _0x16665c=_0x171e[_0x3094c5];return _0x16665c;};'use strict';var Sequelize=require(_0xe171('0x0'));var moment=require(_0xe171('0x1'));module[_0xe171('0x2')]={'name':{'type':Sequelize[_0xe171('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xe171('0x4')]('csv',_0xe171('0x5'),_0xe171('0x6')),'allowNull':![],'defaultValue':_0xe171('0x7')},'savename':{'type':Sequelize[_0xe171('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xe171('0x3')],'defaultValue':_0xe171('0x8')},'type':{'type':Sequelize[_0xe171('0x4')](_0xe171('0x9'),_0xe171('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe171('0x3')]}};
\ No newline at end of file
+var _0x0d2a=['INTEGER','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x0d2a,0xd2));var _0xa0d2=function(_0x10059e,_0x136375){_0x10059e=_0x10059e-0x0;var _0x1e558f=_0x0d2a[_0x10059e];return _0x1e558f;};'use strict';var Sequelize=require(_0xa0d2('0x0'));var moment=require(_0xa0d2('0x1'));module[_0xa0d2('0x2')]={'name':{'type':Sequelize[_0xa0d2('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xa0d2('0x4'),_0xa0d2('0x5'),_0xa0d2('0x6')),'allowNull':![],'defaultValue':_0xa0d2('0x4')},'savename':{'type':Sequelize[_0xa0d2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa0d2('0x7')]},'endDate':{'type':Sequelize[_0xa0d2('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xa0d2('0x8')](_0xa0d2('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xa0d2('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xa0d2('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 00a52ee..d8e32f5 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 _0x6ef3=['desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','filter','includeAll','include','rows','show','params','rawAttributes','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','autoAssociation','catch','download','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','eml-format','rimraf','request-promise','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x27874d,_0x54b50a){var _0x5074db=function(_0x445ea9){while(--_0x445ea9){_0x27874d['push'](_0x27874d['shift']());}};_0x5074db(++_0x54b50a);}(_0x6ef3,0x15d));var _0x36ef=function(_0x33c023,_0x6aec4){_0x33c023=_0x33c023-0x0;var _0x47f08b=_0x6ef3[_0x33c023];return _0x47f08b;};'use strict';var emlformat=require(_0x36ef('0x0'));var rimraf=require(_0x36ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x36ef('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x36ef('0x3'));var path=require(_0x36ef('0x4'));var sox=require(_0x36ef('0x5'));var csv=require(_0x36ef('0x6'));var ejs=require(_0x36ef('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x36ef('0x8'));var crypto=require(_0x36ef('0x9'));var jsforce=require(_0x36ef('0xa'));var deskjs=require(_0x36ef('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x36ef('0xc'));var Redis=require(_0x36ef('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x36ef('0xe'));var hardwareService=require(_0x36ef('0xf'));var logger=require(_0x36ef('0x10'))(_0x36ef('0x11'));var utils=require(_0x36ef('0x12'));var config=require(_0x36ef('0x13'));var licenseUtil=require(_0x36ef('0x14'));var db=require(_0x36ef('0x15'))['db'];function respondWithStatusCode(_0x200a12,_0x33586c){_0x33586c=_0x33586c||0xcc;return function(_0x4d6c1b){if(_0x4d6c1b){return _0x200a12[_0x36ef('0x16')](_0x33586c);}return _0x200a12[_0x36ef('0x17')](_0x33586c)[_0x36ef('0x18')]();};}function respondWithResult(_0x1e7d6e,_0x487c64){_0x487c64=_0x487c64||0xc8;return function(_0x45d990){if(_0x45d990){return _0x1e7d6e[_0x36ef('0x17')](_0x487c64)[_0x36ef('0x19')](_0x45d990);}};}function respondWithFilteredResult(_0x46fe6b,_0x2021e4){return function(_0x1a581f){if(_0x1a581f){var _0x5e2b0a=typeof _0x2021e4[_0x36ef('0x1a')]==='undefined'&&typeof _0x2021e4[_0x36ef('0x1b')]===_0x36ef('0x1c');var _0xe88b16=_0x1a581f[_0x36ef('0x1d')];var _0x119908=_0x5e2b0a?0x0:_0x2021e4['offset'];var _0x586b2b=_0x5e2b0a?_0x1a581f[_0x36ef('0x1d')]:_0x2021e4[_0x36ef('0x1a')]+_0x2021e4['limit'];var _0x46273b;if(_0x586b2b>=_0xe88b16){_0x586b2b=_0xe88b16;_0x46273b=0xc8;}else{_0x46273b=0xce;}_0x46fe6b[_0x36ef('0x17')](_0x46273b);return _0x46fe6b[_0x36ef('0x1e')](_0x36ef('0x1f'),_0x119908+'-'+_0x586b2b+'/'+_0xe88b16)[_0x36ef('0x19')](_0x1a581f);}return null;};}function patchUpdates(_0x28ff3b){return function(_0x54aed3){try{jsonpatch['apply'](_0x54aed3,_0x28ff3b,!![]);}catch(_0x5cc91f){return BPromise['reject'](_0x5cc91f);}return _0x54aed3[_0x36ef('0x20')]();};}function saveUpdates(_0x638dc4,_0x1f283b){return function(_0x222130){if(_0x222130){return _0x222130[_0x36ef('0x21')](_0x638dc4)[_0x36ef('0x22')](function(_0x51ae94){return _0x51ae94;});}return null;};}function removeEntity(_0x42bfb3,_0x322941){return function(_0x4ec71d){if(_0x4ec71d){return _0x4ec71d[_0x36ef('0x23')]()[_0x36ef('0x22')](function(){var _0x1000f7=_0x4ec71d['get']({'plain':!![]});var _0x56bbb0='ExtractedReports';return db[_0x36ef('0x24')][_0x36ef('0x23')]({'where':{'type':_0x56bbb0,'resourceId':_0x1000f7['id']}})[_0x36ef('0x22')](function(){return _0x4ec71d;});})[_0x36ef('0x22')](function(){_0x42bfb3['status'](0xcc)[_0x36ef('0x18')]();});}};}function handleEntityNotFound(_0x1cf7fd,_0x61f0f2){return function(_0x2af17a){if(!_0x2af17a){_0x1cf7fd['sendStatus'](0x194);}return _0x2af17a;};}function handleError(_0x247dd3,_0x4d828c){_0x4d828c=_0x4d828c||0x1f4;return function(_0x71218c){logger[_0x36ef('0x25')](_0x71218c[_0x36ef('0x26')]);if(_0x71218c[_0x36ef('0x27')]){delete _0x71218c['name'];}_0x247dd3[_0x36ef('0x17')](_0x4d828c)[_0x36ef('0x28')](_0x71218c);};}exports[_0x36ef('0x29')]=function(_0x290365,_0x26b972){var _0x20150f={},_0x13783b={},_0xeacb81={'count':0x0,'rows':[]};var _0x5e5d0c=_[_0x36ef('0x2a')](db[_0x36ef('0x2b')]['rawAttributes'],function(_0x317b22){return{'name':_0x317b22[_0x36ef('0x2c')],'type':_0x317b22[_0x36ef('0x2d')][_0x36ef('0x2e')]};});_0x13783b[_0x36ef('0x2f')]=_[_0x36ef('0x2a')](_0x5e5d0c,_0x36ef('0x27'));_0x13783b[_0x36ef('0x30')]=_[_0x36ef('0x31')](_0x290365['query']);_0x13783b[_0x36ef('0x32')]=_[_0x36ef('0x33')](_0x13783b['model'],_0x13783b[_0x36ef('0x30')]);_0x20150f[_0x36ef('0x34')]=_[_0x36ef('0x33')](_0x13783b['model'],qs[_0x36ef('0x35')](_0x290365[_0x36ef('0x30')][_0x36ef('0x35')]));_0x20150f[_0x36ef('0x34')]=_0x20150f[_0x36ef('0x34')][_0x36ef('0x36')]?_0x20150f['attributes']:_0x13783b['model'];if(!_0x290365[_0x36ef('0x30')]['hasOwnProperty'](_0x36ef('0x37'))){_0x20150f[_0x36ef('0x1b')]=qs[_0x36ef('0x1b')](_0x290365['query'][_0x36ef('0x1b')]);_0x20150f[_0x36ef('0x1a')]=qs[_0x36ef('0x1a')](_0x290365[_0x36ef('0x30')]['offset']);}_0x20150f[_0x36ef('0x38')]=qs[_0x36ef('0x39')](_0x290365[_0x36ef('0x30')]['sort']);_0x20150f[_0x36ef('0x3a')]=qs[_0x36ef('0x32')](_['pick'](_0x290365[_0x36ef('0x30')],_0x13783b[_0x36ef('0x32')]),_0x5e5d0c);if(_0x290365['query']['filter']){_0x20150f[_0x36ef('0x3a')]=_[_0x36ef('0x3b')](_0x20150f['where'],{'$or':_['map'](_0x5e5d0c,function(_0x35d3b6){if(_0x35d3b6[_0x36ef('0x2d')]!=='VIRTUAL'){var _0x4dcc36={};_0x4dcc36[_0x35d3b6[_0x36ef('0x27')]]={'$like':'%'+_0x290365[_0x36ef('0x30')][_0x36ef('0x3c')]+'%'};return _0x4dcc36;}})});}_0x20150f=_['merge']({},_0x20150f,_0x290365['options']);var _0x20f7d8={'where':_0x20150f[_0x36ef('0x3a')]};return db[_0x36ef('0x2b')][_0x36ef('0x1d')](_0x20f7d8)[_0x36ef('0x22')](function(_0x584f95){_0xeacb81[_0x36ef('0x1d')]=_0x584f95;if(_0x290365[_0x36ef('0x30')][_0x36ef('0x3d')]){_0x20150f[_0x36ef('0x3e')]=[{'all':!![]}];}return db[_0x36ef('0x2b')]['findAll'](_0x20150f);})[_0x36ef('0x22')](function(_0x195311){_0xeacb81[_0x36ef('0x3f')]=_0x195311;return _0xeacb81;})[_0x36ef('0x22')](respondWithFilteredResult(_0x26b972,_0x20150f))['catch'](handleError(_0x26b972,null));};exports[_0x36ef('0x40')]=function(_0x29c212,_0x499273){var _0x216fd4={'raw':!![],'where':{'id':_0x29c212[_0x36ef('0x41')]['id']}},_0x16e242={};_0x16e242['model']=_[_0x36ef('0x31')](db[_0x36ef('0x2b')][_0x36ef('0x42')]);_0x16e242[_0x36ef('0x30')]=_[_0x36ef('0x31')](_0x29c212[_0x36ef('0x30')]);_0x16e242[_0x36ef('0x32')]=_['intersection'](_0x16e242[_0x36ef('0x2f')],_0x16e242['query']);_0x216fd4[_0x36ef('0x34')]=_[_0x36ef('0x33')](_0x16e242['model'],qs[_0x36ef('0x35')](_0x29c212[_0x36ef('0x30')][_0x36ef('0x35')]));_0x216fd4['attributes']=_0x216fd4[_0x36ef('0x34')][_0x36ef('0x36')]?_0x216fd4[_0x36ef('0x34')]:_0x16e242[_0x36ef('0x2f')];if(_0x29c212[_0x36ef('0x30')][_0x36ef('0x3d')]){_0x216fd4['include']=[{'all':!![]}];}_0x216fd4=_[_0x36ef('0x3b')]({},_0x216fd4,_0x29c212[_0x36ef('0x43')]);return db['AnalyticExtractedReport'][_0x36ef('0x44')](_0x216fd4)[_0x36ef('0x22')](handleEntityNotFound(_0x499273,null))[_0x36ef('0x22')](respondWithResult(_0x499273,null))['catch'](handleError(_0x499273,null));};exports[_0x36ef('0x45')]=function(_0x3367d3,_0x47106e){return db[_0x36ef('0x2b')]['create'](_0x3367d3[_0x36ef('0x46')],{})[_0x36ef('0x22')](function(_0x2fefbb){var _0x23be31=_0x3367d3[_0x36ef('0x47')][_0x36ef('0x48')]({'plain':!![]});if(!_0x23be31)throw new Error(_0x36ef('0x49'));if(_0x23be31[_0x36ef('0x4a')]===_0x36ef('0x47')){var _0xfee25=_0x2fefbb[_0x36ef('0x48')]({'plain':!![]});var _0x72b22c=_0x36ef('0x4b');return db['UserProfileSection'][_0x36ef('0x44')]({'where':{'name':_0x72b22c,'userProfileId':_0x23be31[_0x36ef('0x4c')]},'raw':!![]})[_0x36ef('0x22')](function(_0x1ebed6){if(_0x1ebed6&&_0x1ebed6[_0x36ef('0x4d')]===0x0){return db[_0x36ef('0x24')][_0x36ef('0x45')]({'name':_0xfee25[_0x36ef('0x27')],'resourceId':_0xfee25['id'],'type':_0x1ebed6[_0x36ef('0x27')],'sectionId':_0x1ebed6['id']},{})['then'](function(){return _0x2fefbb;});}else{return _0x2fefbb;}})[_0x36ef('0x4e')](function(_0x583c4d){logger[_0x36ef('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x583c4d);throw _0x583c4d;});}return _0x2fefbb;})[_0x36ef('0x22')](respondWithResult(_0x47106e,0xc9))['catch'](handleError(_0x47106e,null));};exports[_0x36ef('0x21')]=function(_0x19b349,_0xf339b1){if(_0x19b349['body']['id']){delete _0x19b349[_0x36ef('0x46')]['id'];}return db['AnalyticExtractedReport'][_0x36ef('0x44')]({'where':{'id':_0x19b349[_0x36ef('0x41')]['id']}})[_0x36ef('0x22')](handleEntityNotFound(_0xf339b1,null))[_0x36ef('0x22')](saveUpdates(_0x19b349[_0x36ef('0x46')],null))[_0x36ef('0x22')](respondWithResult(_0xf339b1,null))[_0x36ef('0x4e')](handleError(_0xf339b1,null));};exports[_0x36ef('0x23')]=function(_0x11de40,_0x7b4c7){return db[_0x36ef('0x2b')][_0x36ef('0x44')]({'where':{'id':_0x11de40[_0x36ef('0x41')]['id']}})['then'](handleEntityNotFound(_0x7b4c7,null))[_0x36ef('0x22')](removeEntity(_0x7b4c7,null))[_0x36ef('0x4e')](handleError(_0x7b4c7,null));};exports[_0x36ef('0x4f')]=function(_0x38024e,_0xb206a,_0x33a802){return db['AnalyticExtractedReport'][_0x36ef('0x44')]({'where':{'id':_0x38024e['params']['id']},'attributes':['name','basename',_0x36ef('0x50'),_0x36ef('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0xb206a,null))['then'](function(_0x43945d){if(_0x43945d){if(!fs['existsSync'](path[_0x36ef('0x52')](config[_0x36ef('0x53')],_0x36ef('0x54'),_0x43945d['savename']))){throw new db[(_0x36ef('0x55'))][(_0x36ef('0x56'))](_0x36ef('0x57'));}if(_0x38024e['query'][_0x36ef('0x58')]){return _0xb206a[_0x36ef('0x16')](0xc8);}return _0xb206a[_0x36ef('0x4f')](path[_0x36ef('0x52')](config[_0x36ef('0x53')],'server/files/reports',_0x43945d[_0x36ef('0x50')]),util[_0x36ef('0x59')]('%s.%s',_0x43945d['basename']||_0x43945d[_0x36ef('0x27')],_0x43945d[_0x36ef('0x51')]['toLowerCase']()));}})[_0x36ef('0x4e')](handleError(_0xb206a,null));};
\ No newline at end of file
+var _0xfd1c=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','ExtractedReports','UserProfileResource','destroy','end','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','options','includeAll','findAll','rows','show','params','include','merge','find','catch','create','get','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','existsSync','join','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','root','server/files/reports','format','%s.%s','basename','output','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x571bc2,_0x4f6080){var _0x1ca9cf=function(_0x57aad5){while(--_0x57aad5){_0x571bc2['push'](_0x571bc2['shift']());}};_0x1ca9cf(++_0x4f6080);}(_0xfd1c,0x1ee));var _0xcfd1=function(_0x209bbf,_0x2e2375){_0x209bbf=_0x209bbf-0x0;var _0x592d4b=_0xfd1c[_0x209bbf];return _0x592d4b;};'use strict';var emlformat=require(_0xcfd1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfd1('0x1'));var jsonpatch=require(_0xcfd1('0x2'));var rp=require(_0xcfd1('0x3'));var moment=require(_0xcfd1('0x4'));var BPromise=require(_0xcfd1('0x5'));var Mustache=require(_0xcfd1('0x6'));var util=require(_0xcfd1('0x7'));var path=require(_0xcfd1('0x8'));var sox=require(_0xcfd1('0x9'));var csv=require(_0xcfd1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfd1('0xb'));var _=require(_0xcfd1('0xc'));var squel=require(_0xcfd1('0xd'));var crypto=require(_0xcfd1('0xe'));var jsforce=require(_0xcfd1('0xf'));var deskjs=require(_0xcfd1('0x10'));var toCsv=require(_0xcfd1('0xa'));var querystring=require(_0xcfd1('0x11'));var Papa=require(_0xcfd1('0x12'));var Redis=require(_0xcfd1('0x13'));var authService=require(_0xcfd1('0x14'));var qs=require(_0xcfd1('0x15'));var as=require(_0xcfd1('0x16'));var hardwareService=require(_0xcfd1('0x17'));var logger=require(_0xcfd1('0x18'))(_0xcfd1('0x19'));var utils=require(_0xcfd1('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xcfd1('0x1b'));var db=require(_0xcfd1('0x1c'))['db'];function respondWithStatusCode(_0x2337d9,_0x1f25d8){_0x1f25d8=_0x1f25d8||0xcc;return function(_0x5082a2){if(_0x5082a2){return _0x2337d9[_0xcfd1('0x1d')](_0x1f25d8);}return _0x2337d9['status'](_0x1f25d8)['end']();};}function respondWithResult(_0x906055,_0x33dd22){_0x33dd22=_0x33dd22||0xc8;return function(_0x632788){if(_0x632788){return _0x906055[_0xcfd1('0x1e')](_0x33dd22)['json'](_0x632788);}};}function respondWithFilteredResult(_0x237d47,_0x26da8a){return function(_0x3ac44a){if(_0x3ac44a){var _0x3b6841=typeof _0x26da8a[_0xcfd1('0x1f')]==='undefined'&&typeof _0x26da8a[_0xcfd1('0x20')]===_0xcfd1('0x21');var _0x4d675f=_0x3ac44a[_0xcfd1('0x22')];var _0x55c211=_0x3b6841?0x0:_0x26da8a[_0xcfd1('0x1f')];var _0x3dc121=_0x3b6841?_0x3ac44a['count']:_0x26da8a['offset']+_0x26da8a[_0xcfd1('0x20')];var _0x414b1b;if(_0x3dc121>=_0x4d675f){_0x3dc121=_0x4d675f;_0x414b1b=0xc8;}else{_0x414b1b=0xce;}_0x237d47['status'](_0x414b1b);return _0x237d47[_0xcfd1('0x23')](_0xcfd1('0x24'),_0x55c211+'-'+_0x3dc121+'/'+_0x4d675f)[_0xcfd1('0x25')](_0x3ac44a);}return null;};}function patchUpdates(_0x5f25ec){return function(_0x1884cd){try{jsonpatch[_0xcfd1('0x26')](_0x1884cd,_0x5f25ec,!![]);}catch(_0x409d25){return BPromise[_0xcfd1('0x27')](_0x409d25);}return _0x1884cd[_0xcfd1('0x28')]();};}function saveUpdates(_0x1259e7,_0x1c35e1){return function(_0xa64b64){if(_0xa64b64){return _0xa64b64['update'](_0x1259e7)['then'](function(_0x2cef4f){return _0x2cef4f;});}return null;};}function removeEntity(_0x56cc5c,_0x55422e){return function(_0x19e12a){if(_0x19e12a){return _0x19e12a['destroy']()[_0xcfd1('0x29')](function(){var _0x50104a=_0x19e12a['get']({'plain':!![]});var _0x36f1ba=_0xcfd1('0x2a');return db[_0xcfd1('0x2b')][_0xcfd1('0x2c')]({'where':{'type':_0x36f1ba,'resourceId':_0x50104a['id']}})[_0xcfd1('0x29')](function(){return _0x19e12a;});})[_0xcfd1('0x29')](function(){_0x56cc5c[_0xcfd1('0x1e')](0xcc)[_0xcfd1('0x2d')]();});}};}function handleEntityNotFound(_0x3eb130,_0x39fe65){return function(_0x3b5f8b){if(!_0x3b5f8b){_0x3eb130[_0xcfd1('0x1d')](0x194);}return _0x3b5f8b;};}function handleError(_0x5d9d3f,_0x15c8a7){_0x15c8a7=_0x15c8a7||0x1f4;return function(_0xe426ec){logger[_0xcfd1('0x2e')](_0xe426ec[_0xcfd1('0x2f')]);if(_0xe426ec[_0xcfd1('0x30')]){delete _0xe426ec[_0xcfd1('0x30')];}_0x5d9d3f[_0xcfd1('0x1e')](_0x15c8a7)[_0xcfd1('0x31')](_0xe426ec);};}exports[_0xcfd1('0x32')]=function(_0x2e7c25,_0x3b7ffd){var _0x14d0c8={},_0x3d816e={},_0x16e5db={'count':0x0,'rows':[]};var _0x24d957=_[_0xcfd1('0x33')](db[_0xcfd1('0x34')][_0xcfd1('0x35')],function(_0x9bba30){return{'name':_0x9bba30[_0xcfd1('0x36')],'type':_0x9bba30[_0xcfd1('0x37')][_0xcfd1('0x38')]};});_0x3d816e[_0xcfd1('0x39')]=_[_0xcfd1('0x33')](_0x24d957,'name');_0x3d816e[_0xcfd1('0x3a')]=_[_0xcfd1('0x3b')](_0x2e7c25['query']);_0x3d816e[_0xcfd1('0x3c')]=_[_0xcfd1('0x3d')](_0x3d816e[_0xcfd1('0x39')],_0x3d816e[_0xcfd1('0x3a')]);_0x14d0c8['attributes']=_[_0xcfd1('0x3d')](_0x3d816e['model'],qs['fields'](_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x3e')]));_0x14d0c8[_0xcfd1('0x3f')]=_0x14d0c8[_0xcfd1('0x3f')][_0xcfd1('0x40')]?_0x14d0c8[_0xcfd1('0x3f')]:_0x3d816e[_0xcfd1('0x39')];if(!_0x2e7c25[_0xcfd1('0x3a')]['hasOwnProperty'](_0xcfd1('0x41'))){_0x14d0c8[_0xcfd1('0x20')]=qs[_0xcfd1('0x20')](_0x2e7c25[_0xcfd1('0x3a')]['limit']);_0x14d0c8['offset']=qs[_0xcfd1('0x1f')](_0x2e7c25['query'][_0xcfd1('0x1f')]);}_0x14d0c8[_0xcfd1('0x42')]=qs[_0xcfd1('0x43')](_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x43')]);_0x14d0c8[_0xcfd1('0x44')]=qs[_0xcfd1('0x3c')](_['pick'](_0x2e7c25[_0xcfd1('0x3a')],_0x3d816e[_0xcfd1('0x3c')]),_0x24d957);if(_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x45')]){_0x14d0c8['where']=_['merge'](_0x14d0c8[_0xcfd1('0x44')],{'$or':_[_0xcfd1('0x33')](_0x24d957,function(_0x53e15d){if(_0x53e15d[_0xcfd1('0x37')]!=='VIRTUAL'){var _0x4ad489={};_0x4ad489[_0x53e15d['name']]={'$like':'%'+_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x45')]+'%'};return _0x4ad489;}})});}_0x14d0c8=_['merge']({},_0x14d0c8,_0x2e7c25[_0xcfd1('0x46')]);var _0x9abd40={'where':_0x14d0c8[_0xcfd1('0x44')]};return db[_0xcfd1('0x34')]['count'](_0x9abd40)[_0xcfd1('0x29')](function(_0x65dd7d){_0x16e5db[_0xcfd1('0x22')]=_0x65dd7d;if(_0x2e7c25[_0xcfd1('0x3a')][_0xcfd1('0x47')]){_0x14d0c8['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xcfd1('0x48')](_0x14d0c8);})[_0xcfd1('0x29')](function(_0x44fec1){_0x16e5db[_0xcfd1('0x49')]=_0x44fec1;return _0x16e5db;})[_0xcfd1('0x29')](respondWithFilteredResult(_0x3b7ffd,_0x14d0c8))['catch'](handleError(_0x3b7ffd,null));};exports[_0xcfd1('0x4a')]=function(_0x4615d9,_0x3b4cb0){var _0x2d9903={'raw':!![],'where':{'id':_0x4615d9[_0xcfd1('0x4b')]['id']}},_0x21d31f={};_0x21d31f[_0xcfd1('0x39')]=_[_0xcfd1('0x3b')](db[_0xcfd1('0x34')][_0xcfd1('0x35')]);_0x21d31f['query']=_[_0xcfd1('0x3b')](_0x4615d9[_0xcfd1('0x3a')]);_0x21d31f[_0xcfd1('0x3c')]=_[_0xcfd1('0x3d')](_0x21d31f[_0xcfd1('0x39')],_0x21d31f['query']);_0x2d9903['attributes']=_['intersection'](_0x21d31f[_0xcfd1('0x39')],qs[_0xcfd1('0x3e')](_0x4615d9[_0xcfd1('0x3a')][_0xcfd1('0x3e')]));_0x2d9903['attributes']=_0x2d9903[_0xcfd1('0x3f')]['length']?_0x2d9903[_0xcfd1('0x3f')]:_0x21d31f[_0xcfd1('0x39')];if(_0x4615d9[_0xcfd1('0x3a')][_0xcfd1('0x47')]){_0x2d9903[_0xcfd1('0x4c')]=[{'all':!![]}];}_0x2d9903=_[_0xcfd1('0x4d')]({},_0x2d9903,_0x4615d9[_0xcfd1('0x46')]);return db[_0xcfd1('0x34')][_0xcfd1('0x4e')](_0x2d9903)[_0xcfd1('0x29')](handleEntityNotFound(_0x3b4cb0,null))[_0xcfd1('0x29')](respondWithResult(_0x3b4cb0,null))[_0xcfd1('0x4f')](handleError(_0x3b4cb0,null));};exports[_0xcfd1('0x50')]=function(_0x1b560d,_0x8f86e1){return db[_0xcfd1('0x34')][_0xcfd1('0x50')](_0x1b560d['body'],{})[_0xcfd1('0x29')](function(_0x49f31c){var _0xb430cc=_0x1b560d['user'][_0xcfd1('0x51')]({'plain':!![]});if(!_0xb430cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb430cc[_0xcfd1('0x52')]===_0xcfd1('0x53')){var _0x30e91f=_0x49f31c[_0xcfd1('0x51')]({'plain':!![]});var _0x87f027=_0xcfd1('0x2a');return db['UserProfileSection'][_0xcfd1('0x4e')]({'where':{'name':_0x87f027,'userProfileId':_0xb430cc[_0xcfd1('0x54')]},'raw':!![]})[_0xcfd1('0x29')](function(_0x315915){if(_0x315915&&_0x315915['autoAssociation']===0x0){return db[_0xcfd1('0x2b')][_0xcfd1('0x50')]({'name':_0x30e91f[_0xcfd1('0x30')],'resourceId':_0x30e91f['id'],'type':_0x315915[_0xcfd1('0x30')],'sectionId':_0x315915['id']},{})[_0xcfd1('0x29')](function(){return _0x49f31c;});}else{return _0x49f31c;}})[_0xcfd1('0x4f')](function(_0x40fe96){logger[_0xcfd1('0x2e')](_0xcfd1('0x55'),_0x40fe96);throw _0x40fe96;});}return _0x49f31c;})[_0xcfd1('0x29')](respondWithResult(_0x8f86e1,0xc9))[_0xcfd1('0x4f')](handleError(_0x8f86e1,null));};exports[_0xcfd1('0x56')]=function(_0x284bfb,_0x3c22af){if(_0x284bfb[_0xcfd1('0x57')]['id']){delete _0x284bfb[_0xcfd1('0x57')]['id'];}return db[_0xcfd1('0x34')][_0xcfd1('0x4e')]({'where':{'id':_0x284bfb[_0xcfd1('0x4b')]['id']}})[_0xcfd1('0x29')](handleEntityNotFound(_0x3c22af,null))[_0xcfd1('0x29')](saveUpdates(_0x284bfb[_0xcfd1('0x57')],null))['then'](respondWithResult(_0x3c22af,null))[_0xcfd1('0x4f')](handleError(_0x3c22af,null));};exports[_0xcfd1('0x2c')]=function(_0x188c76,_0xd71a46){return db[_0xcfd1('0x34')]['find']({'where':{'id':_0x188c76[_0xcfd1('0x4b')]['id']}})[_0xcfd1('0x29')](handleEntityNotFound(_0xd71a46,null))[_0xcfd1('0x29')](removeEntity(_0xd71a46,null))[_0xcfd1('0x4f')](handleError(_0xd71a46,null));};exports[_0xcfd1('0x58')]=function(_0xc12981,_0x23f22d,_0x247bba){return db[_0xcfd1('0x34')][_0xcfd1('0x4e')]({'where':{'id':_0xc12981[_0xcfd1('0x4b')]['id']},'attributes':[_0xcfd1('0x30'),'basename','savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x23f22d,null))[_0xcfd1('0x29')](function(_0xe59b9b){if(_0xe59b9b){if(!fs[_0xcfd1('0x59')](path[_0xcfd1('0x5a')](config['root'],'server/files/reports',_0xe59b9b[_0xcfd1('0x5b')]))){throw new db[(_0xcfd1('0x5c'))][(_0xcfd1('0x5d'))](_0xcfd1('0x5e'));}if(_0xc12981[_0xcfd1('0x3a')]['exists']){return _0x23f22d['sendStatus'](0xc8);}return _0x23f22d[_0xcfd1('0x58')](path[_0xcfd1('0x5a')](config[_0xcfd1('0x5f')],_0xcfd1('0x60'),_0xe59b9b[_0xcfd1('0x5b')]),util[_0xcfd1('0x61')](_0xcfd1('0x62'),_0xe59b9b[_0xcfd1('0x63')]||_0xe59b9b[_0xcfd1('0x30')],_0xe59b9b[_0xcfd1('0x64')]['toLowerCase']()));}})['catch'](handleError(_0x23f22d,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 04ef13b..b16827e 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 _0x18ea=['AnalyticExtractedReport','lodash','api','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x145016,_0x40ba0b){var _0x4a57e8=function(_0x11ea2a){while(--_0x11ea2a){_0x145016['push'](_0x145016['shift']());}};_0x4a57e8(++_0x40ba0b);}(_0x18ea,0xa3));var _0xa18e=function(_0x5cb9b,_0x3b98e5){_0x5cb9b=_0x5cb9b-0x0;var _0x35caae=_0x18ea[_0x5cb9b];return _0x35caae;};'use strict';var _=require(_0xa18e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa18e('0x1'));var moment=require('moment');var BPromise=require(_0xa18e('0x2'));var rp=require(_0xa18e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa18e('0x4'));var attributes=require(_0xa18e('0x5'));module[_0xa18e('0x6')]=function(_0x3c5e47,_0x939ed5){return _0x3c5e47[_0xa18e('0x7')](_0xa18e('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde91=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x2ff0e4,_0x480398){var _0x3c15b7=function(_0x242b21){while(--_0x242b21){_0x2ff0e4['push'](_0x2ff0e4['shift']());}};_0x3c15b7(++_0x480398);}(_0xde91,0x192));var _0x1de9=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xde91[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x1de9('0x0'));var util=require('util');var logger=require(_0x1de9('0x1'))(_0x1de9('0x2'));var moment=require(_0x1de9('0x3'));var BPromise=require(_0x1de9('0x4'));var rp=require(_0x1de9('0x5'));var fs=require('fs');var path=require(_0x1de9('0x6'));var rimraf=require(_0x1de9('0x7'));var config=require(_0x1de9('0x8'));var attributes=require(_0x1de9('0x9'));module['exports']=function(_0x1bfda3,_0x546baa){return _0x1bfda3[_0x1de9('0xa')](_0x1de9('0xb'),attributes,{'tableName':_0x1de9('0xc'),'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 d99ac57..f394d51 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 _0x2a5d=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c58b6,_0x15b786){var _0x1f658f=function(_0x4b1fdd){while(--_0x4b1fdd){_0x1c58b6['push'](_0x1c58b6['shift']());}};_0x1f658f(++_0x15b786);}(_0x2a5d,0x182));var _0xd2a5=function(_0x8a7e38,_0x473a5d){_0x8a7e38=_0x8a7e38-0x0;var _0x228609=_0x2a5d[_0x8a7e38];return _0x228609;};'use strict';var _=require(_0xd2a5('0x0'));var util=require(_0xd2a5('0x1'));var moment=require(_0xd2a5('0x2'));var BPromise=require(_0xd2a5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2a5('0x4'));var db=require(_0xd2a5('0x5'))['db'];var utils=require(_0xd2a5('0x6'));var logger=require('../../config/logger')(_0xd2a5('0x7'));var config=require(_0xd2a5('0x8'));var jayson=require(_0xd2a5('0x9'));var client=jayson[_0xd2a5('0xa')][_0xd2a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f34c5,_0x5b5e05,_0x15e3b6){return new BPromise(function(_0x25172c,_0x7de88e){return client[_0xd2a5('0xc')](_0x2f34c5,_0x15e3b6)[_0xd2a5('0xd')](function(_0x55a618){logger[_0xd2a5('0xe')](_0xd2a5('0xf'),_0x5b5e05,_0xd2a5('0x10'));logger['debug'](_0xd2a5('0x11'),_0x5b5e05,'request\x20sent',JSON[_0xd2a5('0x12')](_0x55a618));if(_0x55a618[_0xd2a5('0x13')]){if(_0x55a618['error'][_0xd2a5('0x14')]===0x1f4){logger['error'](_0xd2a5('0xf'),_0x5b5e05,_0x55a618[_0xd2a5('0x13')][_0xd2a5('0x15')]);return _0x7de88e(_0x55a618[_0xd2a5('0x13')][_0xd2a5('0x15')]);}logger['error'](_0xd2a5('0xf'),_0x5b5e05,_0x55a618[_0xd2a5('0x13')][_0xd2a5('0x15')]);return _0x25172c(_0x55a618[_0xd2a5('0x13')][_0xd2a5('0x15')]);}else{logger['info'](_0xd2a5('0xf'),_0x5b5e05,_0xd2a5('0x10'));_0x25172c(_0x55a618[_0xd2a5('0x16')][_0xd2a5('0x15')]);}})[_0xd2a5('0x17')](function(_0x5c2dbf){logger[_0xd2a5('0x13')](_0xd2a5('0xf'),_0x5b5e05,_0x5c2dbf);_0x7de88e(_0x5c2dbf);});});}
\ No newline at end of file
+var _0xeeeb=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeeeb,0x16a));var _0xbeee=function(_0x2905d6,_0x1fde4a){_0x2905d6=_0x2905d6-0x0;var _0x2b9333=_0xeeeb[_0x2905d6];return _0x2b9333;};'use strict';var _=require(_0xbeee('0x0'));var util=require(_0xbeee('0x1'));var moment=require(_0xbeee('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbeee('0x3'));var db=require(_0xbeee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbeee('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbeee('0x6'));var client=jayson[_0xbeee('0x7')][_0xbeee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f5db5,_0x47a8d8,_0x343c8c){return new BPromise(function(_0x139458,_0x9b3f99){return client['request'](_0x1f5db5,_0x343c8c)[_0xbeee('0x9')](function(_0xb75546){logger['info'](_0xbeee('0xa'),_0x47a8d8,_0xbeee('0xb'));logger[_0xbeee('0xc')](_0xbeee('0xd'),_0x47a8d8,_0xbeee('0xb'),JSON[_0xbeee('0xe')](_0xb75546));if(_0xb75546[_0xbeee('0xf')]){if(_0xb75546['error']['code']===0x1f4){logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x47a8d8,_0xb75546[_0xbeee('0xf')][_0xbeee('0x10')]);return _0x9b3f99(_0xb75546['error'][_0xbeee('0x10')]);}logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x47a8d8,_0xb75546[_0xbeee('0xf')][_0xbeee('0x10')]);return _0x139458(_0xb75546[_0xbeee('0xf')][_0xbeee('0x10')]);}else{logger[_0xbeee('0x11')](_0xbeee('0xa'),_0x47a8d8,_0xbeee('0xb'));_0x139458(_0xb75546[_0xbeee('0x12')][_0xbeee('0x10')]);}})[_0xbeee('0x13')](function(_0x123ee0){logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x47a8d8,_0x123ee0);_0x9b3f99(_0x123ee0);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index bcb1c4f..ec44201 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 _0x20ab=['get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','update','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x453a78,_0x196cae){var _0x43fd7e=function(_0x5aa2f1){while(--_0x5aa2f1){_0x453a78['push'](_0x453a78['shift']());}};_0x43fd7e(++_0x196cae);}(_0x20ab,0x197));var _0xb20a=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0x20ab[_0xb6e43];return _0x47c40f;};'use strict';var multer=require(_0xb20a('0x0'));var util=require('util');var path=require(_0xb20a('0x1'));var timeout=require('connect-timeout');var express=require(_0xb20a('0x2'));var router=express['Router']();var fs_extra=require(_0xb20a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb20a('0x4'));var config=require(_0xb20a('0x5'));var controller=require(_0xb20a('0x6'));router[_0xb20a('0x7')]('/',auth[_0xb20a('0x8')](),controller[_0xb20a('0x9')]);router['get']('/:id',auth[_0xb20a('0x8')](),controller[_0xb20a('0xa')]);router[_0xb20a('0x7')](_0xb20a('0xb'),auth[_0xb20a('0x8')](),controller[_0xb20a('0xc')]);router[_0xb20a('0xd')]('/',auth[_0xb20a('0x8')](),controller['create']);router[_0xb20a('0xe')](_0xb20a('0xf'),auth[_0xb20a('0x8')](),controller[_0xb20a('0x10')]);router['delete'](_0xb20a('0xf'),auth[_0xb20a('0x8')](),controller['destroy']);module[_0xb20a('0x11')]=router;
\ No newline at end of file
+var _0x4fda=['/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x4fda,0x1e7));var _0xa4fd=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x4fda[_0x1ebce2];return _0x4a330c;};'use strict';var multer=require(_0xa4fd('0x0'));var util=require(_0xa4fd('0x1'));var path=require(_0xa4fd('0x2'));var timeout=require(_0xa4fd('0x3'));var express=require('express');var router=express[_0xa4fd('0x4')]();var fs_extra=require(_0xa4fd('0x5'));var auth=require(_0xa4fd('0x6'));var interaction=require(_0xa4fd('0x7'));var config=require(_0xa4fd('0x8'));var controller=require(_0xa4fd('0x9'));router[_0xa4fd('0xa')]('/',auth[_0xa4fd('0xb')](),controller[_0xa4fd('0xc')]);router[_0xa4fd('0xa')](_0xa4fd('0xd'),auth[_0xa4fd('0xb')](),controller[_0xa4fd('0xe')]);router[_0xa4fd('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xa4fd('0xb')](),controller['create']);router[_0xa4fd('0xf')]('/:id',auth[_0xa4fd('0xb')](),controller[_0xa4fd('0x10')]);router[_0xa4fd('0x11')](_0xa4fd('0xd'),auth[_0xa4fd('0xb')](),controller[_0xa4fd('0x12')]);module[_0xa4fd('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c279b8f..d716f68 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 _0x3d67=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0xffbd19,_0x18fb82){var _0x619464=function(_0x123e2a){while(--_0x123e2a){_0xffbd19['push'](_0xffbd19['shift']());}};_0x619464(++_0x18fb82);}(_0x3d67,0x144));var _0x73d6=function(_0x552291,_0x37ae2f){_0x552291=_0x552291-0x0;var _0x4985c2=_0x3d67[_0x552291];return _0x4985c2;};'use strict';var Sequelize=require(_0x73d6('0x0'));module[_0x73d6('0x1')]={'field':{'type':Sequelize[_0x73d6('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x73d6('0x3')]},'format':{'type':Sequelize[_0x73d6('0x3')]},'groupBy':{'type':Sequelize[_0x73d6('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x73d6('0x3')]},'custom':{'type':Sequelize[_0x73d6('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb77d=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb77d,0xf5));var _0xdb77=function(_0x3c235f,_0x29a577){_0x3c235f=_0x3c235f-0x0;var _0x4447d8=_0xb77d[_0x3c235f];return _0x4447d8;};'use strict';var Sequelize=require(_0xdb77('0x0'));module[_0xdb77('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdb77('0x2')]},'function':{'type':Sequelize[_0xdb77('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xdb77('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdb77('0x2')]},'custom':{'type':Sequelize[_0xdb77('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 9ec5314..6b6a069 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 _0xcbba=['addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','rows','show','find','create','body','catch','bulkCreate','params','destroy','bulkDestroy','ids'];(function(_0x3b6fef,_0x5ae452){var _0x227b3f=function(_0x1c7883){while(--_0x1c7883){_0x3b6fef['push'](_0x3b6fef['shift']());}};_0x227b3f(++_0x5ae452);}(_0xcbba,0x16a));var _0xacbb=function(_0x145bd7,_0x2699f3){_0x145bd7=_0x145bd7-0x0;var _0x498b85=_0xcbba[_0x145bd7];return _0x498b85;};'use strict';var emlformat=require(_0xacbb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xacbb('0x1'));var jsonpatch=require(_0xacbb('0x2'));var rp=require(_0xacbb('0x3'));var moment=require(_0xacbb('0x4'));var BPromise=require(_0xacbb('0x5'));var Mustache=require(_0xacbb('0x6'));var util=require('util');var path=require(_0xacbb('0x7'));var sox=require(_0xacbb('0x8'));var csv=require(_0xacbb('0x9'));var ejs=require(_0xacbb('0xa'));var fs=require('fs');var fs_extra=require(_0xacbb('0xb'));var _=require(_0xacbb('0xc'));var squel=require(_0xacbb('0xd'));var crypto=require(_0xacbb('0xe'));var jsforce=require(_0xacbb('0xf'));var deskjs=require(_0xacbb('0x10'));var toCsv=require(_0xacbb('0x9'));var querystring=require(_0xacbb('0x11'));var Papa=require(_0xacbb('0x12'));var Redis=require(_0xacbb('0x13'));var authService=require(_0xacbb('0x14'));var qs=require(_0xacbb('0x15'));var as=require(_0xacbb('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacbb('0x17'))(_0xacbb('0x18'));var utils=require(_0xacbb('0x19'));var config=require(_0xacbb('0x1a'));var licenseUtil=require(_0xacbb('0x1b'));var db=require(_0xacbb('0x1c'))['db'];function respondWithStatusCode(_0xc639c6,_0xeadcd8){_0xeadcd8=_0xeadcd8||0xcc;return function(_0x254017){if(_0x254017){return _0xc639c6[_0xacbb('0x1d')](_0xeadcd8);}return _0xc639c6[_0xacbb('0x1e')](_0xeadcd8)[_0xacbb('0x1f')]();};}function respondWithResult(_0x55ada0,_0x34b2ba){_0x34b2ba=_0x34b2ba||0xc8;return function(_0x22ef55){if(_0x22ef55){return _0x55ada0[_0xacbb('0x1e')](_0x34b2ba)[_0xacbb('0x20')](_0x22ef55);}};}function respondWithFilteredResult(_0x5c438b,_0x2d9dd2){return function(_0x1b18da){if(_0x1b18da){var _0x121095=typeof _0x2d9dd2[_0xacbb('0x21')]==='undefined'&&typeof _0x2d9dd2[_0xacbb('0x22')]===_0xacbb('0x23');var _0x5bb654=_0x1b18da['count'];var _0x5c4c58=_0x121095?0x0:_0x2d9dd2[_0xacbb('0x21')];var _0x411049=_0x121095?_0x1b18da[_0xacbb('0x24')]:_0x2d9dd2['offset']+_0x2d9dd2['limit'];var _0x38255e;if(_0x411049>=_0x5bb654){_0x411049=_0x5bb654;_0x38255e=0xc8;}else{_0x38255e=0xce;}_0x5c438b['status'](_0x38255e);return _0x5c438b[_0xacbb('0x25')](_0xacbb('0x26'),_0x5c4c58+'-'+_0x411049+'/'+_0x5bb654)[_0xacbb('0x20')](_0x1b18da);}return null;};}function patchUpdates(_0xfba26c){return function(_0x131e7a){try{jsonpatch[_0xacbb('0x27')](_0x131e7a,_0xfba26c,!![]);}catch(_0x76c954){return BPromise[_0xacbb('0x28')](_0x76c954);}return _0x131e7a[_0xacbb('0x29')]();};}function saveUpdates(_0x15ce6c,_0x28cba4){return function(_0x4c4050){if(_0x4c4050){return _0x4c4050[_0xacbb('0x2a')](_0x15ce6c)[_0xacbb('0x2b')](function(_0x276b0f){return _0x276b0f;});}return null;};}function removeEntity(_0x28f664,_0xa8b587){return function(_0x2485e2){if(_0x2485e2){return _0x2485e2['destroy']()[_0xacbb('0x2b')](function(){_0x28f664[_0xacbb('0x1e')](0xcc)[_0xacbb('0x1f')]();});}};}function handleEntityNotFound(_0x2edae3,_0x3d5af4){return function(_0x26d971){if(!_0x26d971){_0x2edae3[_0xacbb('0x1d')](0x194);}return _0x26d971;};}function handleError(_0x392543,_0x3a833c){_0x3a833c=_0x3a833c||0x1f4;return function(_0x17b91f){logger[_0xacbb('0x2c')](_0x17b91f[_0xacbb('0x2d')]);if(_0x17b91f[_0xacbb('0x2e')]){delete _0x17b91f[_0xacbb('0x2e')];}_0x392543[_0xacbb('0x1e')](_0x3a833c)[_0xacbb('0x2f')](_0x17b91f);};}exports[_0xacbb('0x30')]=function(_0x3b4480,_0x578143){var _0x1fe214={},_0x321110={},_0x351502={'count':0x0,'rows':[]};var _0x2c7de9=_[_0xacbb('0x31')](db[_0xacbb('0x32')][_0xacbb('0x33')],function(_0x2ab96f){return{'name':_0x2ab96f[_0xacbb('0x34')],'type':_0x2ab96f[_0xacbb('0x35')][_0xacbb('0x36')]};});_0x321110[_0xacbb('0x37')]=_[_0xacbb('0x31')](_0x2c7de9,_0xacbb('0x2e'));_0x321110[_0xacbb('0x38')]=_[_0xacbb('0x39')](_0x3b4480[_0xacbb('0x38')]);_0x321110[_0xacbb('0x3a')]=_[_0xacbb('0x3b')](_0x321110[_0xacbb('0x37')],_0x321110[_0xacbb('0x38')]);_0x1fe214[_0xacbb('0x3c')]=_['intersection'](_0x321110[_0xacbb('0x37')],qs[_0xacbb('0x3d')](_0x3b4480[_0xacbb('0x38')][_0xacbb('0x3d')]));_0x1fe214['attributes']=_0x1fe214[_0xacbb('0x3c')][_0xacbb('0x3e')]?_0x1fe214[_0xacbb('0x3c')]:_0x321110['model'];if(!_0x3b4480[_0xacbb('0x38')][_0xacbb('0x3f')](_0xacbb('0x40'))){_0x1fe214[_0xacbb('0x22')]=qs[_0xacbb('0x22')](_0x3b4480[_0xacbb('0x38')]['limit']);_0x1fe214[_0xacbb('0x21')]=qs[_0xacbb('0x21')](_0x3b4480[_0xacbb('0x38')][_0xacbb('0x21')]);}_0x1fe214['order']=qs[_0xacbb('0x41')](_0x3b4480[_0xacbb('0x38')][_0xacbb('0x41')]);_0x1fe214['where']=qs[_0xacbb('0x3a')](_['pick'](_0x3b4480[_0xacbb('0x38')],_0x321110[_0xacbb('0x3a')]),_0x2c7de9);if(_0x3b4480[_0xacbb('0x38')][_0xacbb('0x42')]){_0x1fe214['where']=_[_0xacbb('0x43')](_0x1fe214[_0xacbb('0x44')],{'$or':_[_0xacbb('0x31')](_0x2c7de9,function(_0x499d10){if(_0x499d10[_0xacbb('0x35')]!=='VIRTUAL'){var _0x1f4cb={};_0x1f4cb[_0x499d10[_0xacbb('0x2e')]]={'$like':'%'+_0x3b4480[_0xacbb('0x38')]['filter']+'%'};return _0x1f4cb;}})});}_0x1fe214=_['merge']({},_0x1fe214,_0x3b4480[_0xacbb('0x45')]);var _0x538c71={'where':_0x1fe214[_0xacbb('0x44')]};return db[_0xacbb('0x32')][_0xacbb('0x24')](_0x538c71)[_0xacbb('0x2b')](function(_0x2254f1){_0x351502['count']=_0x2254f1;if(_0x3b4480['query'][_0xacbb('0x46')]){_0x1fe214[_0xacbb('0x47')]=[{'all':!![]}];}return db[_0xacbb('0x32')]['findAll'](_0x1fe214);})['then'](function(_0x132d93){_0x351502[_0xacbb('0x48')]=_0x132d93;return _0x351502;})[_0xacbb('0x2b')](respondWithFilteredResult(_0x578143,_0x1fe214))['catch'](handleError(_0x578143,null));};exports[_0xacbb('0x49')]=function(_0x58e367,_0x5cb38f){var _0x38df9e={'raw':![],'where':{'id':_0x58e367['params']['id']}},_0x45ce70={};_0x45ce70[_0xacbb('0x37')]=_['keys'](db[_0xacbb('0x32')][_0xacbb('0x33')]);_0x45ce70[_0xacbb('0x38')]=_[_0xacbb('0x39')](_0x58e367['query']);_0x45ce70[_0xacbb('0x3a')]=_[_0xacbb('0x3b')](_0x45ce70[_0xacbb('0x37')],_0x45ce70[_0xacbb('0x38')]);_0x38df9e[_0xacbb('0x3c')]=_[_0xacbb('0x3b')](_0x45ce70[_0xacbb('0x37')],qs[_0xacbb('0x3d')](_0x58e367[_0xacbb('0x38')][_0xacbb('0x3d')]));_0x38df9e[_0xacbb('0x3c')]=_0x38df9e[_0xacbb('0x3c')]['length']?_0x38df9e[_0xacbb('0x3c')]:_0x45ce70[_0xacbb('0x37')];if(_0x58e367[_0xacbb('0x38')]['includeAll']){_0x38df9e[_0xacbb('0x47')]=[{'all':!![]}];}_0x38df9e=_['merge']({},_0x38df9e,_0x58e367['options']);return db[_0xacbb('0x32')][_0xacbb('0x4a')](_0x38df9e)[_0xacbb('0x2b')](handleEntityNotFound(_0x5cb38f,null))['then'](respondWithResult(_0x5cb38f,null))['catch'](handleError(_0x5cb38f,null));};exports[_0xacbb('0x4b')]=function(_0x7e9af2,_0x5ac7ad){return db[_0xacbb('0x32')][_0xacbb('0x4b')](_0x7e9af2[_0xacbb('0x4c')],{})['then'](respondWithResult(_0x5ac7ad,0xc9))[_0xacbb('0x4d')](handleError(_0x5ac7ad,null));};exports[_0xacbb('0x4e')]=function(_0x1992e9,_0x3e7409){return db[_0xacbb('0x32')][_0xacbb('0x4e')](_0x1992e9[_0xacbb('0x4c')],{'raw':![],'individualHooks':!![]})[_0xacbb('0x2b')](respondWithResult(_0x3e7409,0xc9))[_0xacbb('0x4d')](handleError(_0x3e7409,null));};exports['update']=function(_0x31949a,_0x545958){if(_0x31949a['body']['id']){delete _0x31949a[_0xacbb('0x4c')]['id'];}return db[_0xacbb('0x32')][_0xacbb('0x4a')]({'where':{'id':_0x31949a[_0xacbb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x545958,null))[_0xacbb('0x2b')](saveUpdates(_0x31949a[_0xacbb('0x4c')],null))[_0xacbb('0x2b')](respondWithResult(_0x545958,null))[_0xacbb('0x4d')](handleError(_0x545958,null));};exports[_0xacbb('0x50')]=function(_0x9dbfff,_0xdabe33){return db[_0xacbb('0x32')][_0xacbb('0x4a')]({'where':{'id':_0x9dbfff['params']['id']}})['then'](handleEntityNotFound(_0xdabe33,null))[_0xacbb('0x2b')](removeEntity(_0xdabe33,null))[_0xacbb('0x4d')](handleError(_0xdabe33,null));};exports[_0xacbb('0x51')]=function(_0x4140ab,_0x2401a9){return db['AnalyticFieldReport'][_0xacbb('0x50')]({'where':{'id':_0x4140ab[_0xacbb('0x38')][_0xacbb('0x52')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2401a9,0xcc))[_0xacbb('0x4d')](handleError(_0x2401a9,null));};exports[_0xacbb('0x53')]=function(_0x13bdc2,_0x481a49,_0x4b6bd3){return db[_0xacbb('0x54')][_0xacbb('0x55')]({'where':{'id':_0x13bdc2[_0xacbb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x481a49,null))[_0xacbb('0x2b')](function(_0x57016b){if(_0x57016b){return db[_0xacbb('0x56')]['transaction'](function(_0x4458c3){return db[_0xacbb('0x32')][_0xacbb('0x50')]({'where':{'CustomReportId':_0x13bdc2['params']['id']},'transaction':_0x4458c3})['then'](function(_0x11efc6){var _0x15a2aa=_[_0xacbb('0x31')](_0x13bdc2[_0xacbb('0x4c')],function(_0x107e04){delete _0x107e04['id'];_0x107e04[_0xacbb('0x57')]=_0x13bdc2['params']['id'];return _0x107e04;});return db[_0xacbb('0x32')][_0xacbb('0x4e')](_0x15a2aa,{'transaction':_0x4458c3});});})[_0xacbb('0x2b')](function(){return db[_0xacbb('0x32')][_0xacbb('0x58')]({'where':{'CustomReportId':_0x13bdc2[_0xacbb('0x4f')]['id']}});});}})[_0xacbb('0x2b')](respondWithResult(_0x481a49,null))[_0xacbb('0x4d')](handleError(_0x481a49,null));};
\ No newline at end of file
+var _0xb43b=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','rows','catch','show','params','includeAll','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','CustomReportId','findAll','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query'];(function(_0x34176d,_0x13188d){var _0x492df5=function(_0x4f1346){while(--_0x4f1346){_0x34176d['push'](_0x34176d['shift']());}};_0x492df5(++_0x13188d);}(_0xb43b,0x10b));var _0xbb43=function(_0x3812b5,_0x16e889){_0x3812b5=_0x3812b5-0x0;var _0x337af7=_0xb43b[_0x3812b5];return _0x337af7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb43('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x1'));var rp=require('request-promise');var moment=require(_0xbb43('0x2'));var BPromise=require(_0xbb43('0x3'));var Mustache=require(_0xbb43('0x4'));var util=require('util');var path=require(_0xbb43('0x5'));var sox=require(_0xbb43('0x6'));var csv=require(_0xbb43('0x7'));var ejs=require(_0xbb43('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb43('0x9'));var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbb43('0xc'));var toCsv=require(_0xbb43('0x7'));var querystring=require(_0xbb43('0xd'));var Papa=require(_0xbb43('0xe'));var Redis=require(_0xbb43('0xf'));var authService=require(_0xbb43('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb43('0x11'));var logger=require(_0xbb43('0x12'))(_0xbb43('0x13'));var utils=require('../../config/utils');var config=require(_0xbb43('0x14'));var licenseUtil=require(_0xbb43('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496b03,_0x42bf6d){_0x42bf6d=_0x42bf6d||0xcc;return function(_0x61525b){if(_0x61525b){return _0x496b03[_0xbb43('0x16')](_0x42bf6d);}return _0x496b03[_0xbb43('0x17')](_0x42bf6d)[_0xbb43('0x18')]();};}function respondWithResult(_0x6cabe3,_0x3897d6){_0x3897d6=_0x3897d6||0xc8;return function(_0x3a77f3){if(_0x3a77f3){return _0x6cabe3[_0xbb43('0x17')](_0x3897d6)[_0xbb43('0x19')](_0x3a77f3);}};}function respondWithFilteredResult(_0x458b0a,_0x3d1732){return function(_0x15854b){if(_0x15854b){var _0x2985fc=typeof _0x3d1732[_0xbb43('0x1a')]==='undefined'&&typeof _0x3d1732[_0xbb43('0x1b')]===_0xbb43('0x1c');var _0x2d22c8=_0x15854b[_0xbb43('0x1d')];var _0x2afd77=_0x2985fc?0x0:_0x3d1732['offset'];var _0x3f37b7=_0x2985fc?_0x15854b[_0xbb43('0x1d')]:_0x3d1732[_0xbb43('0x1a')]+_0x3d1732[_0xbb43('0x1b')];var _0x260af8;if(_0x3f37b7>=_0x2d22c8){_0x3f37b7=_0x2d22c8;_0x260af8=0xc8;}else{_0x260af8=0xce;}_0x458b0a['status'](_0x260af8);return _0x458b0a[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2afd77+'-'+_0x3f37b7+'/'+_0x2d22c8)[_0xbb43('0x19')](_0x15854b);}return null;};}function patchUpdates(_0x230f33){return function(_0x33c5d9){try{jsonpatch[_0xbb43('0x20')](_0x33c5d9,_0x230f33,!![]);}catch(_0x987a58){return BPromise[_0xbb43('0x21')](_0x987a58);}return _0x33c5d9[_0xbb43('0x22')]();};}function saveUpdates(_0x41e1f1,_0x9e6286){return function(_0x545789){if(_0x545789){return _0x545789[_0xbb43('0x23')](_0x41e1f1)['then'](function(_0x16e599){return _0x16e599;});}return null;};}function removeEntity(_0x4a790d,_0x586c82){return function(_0x464534){if(_0x464534){return _0x464534[_0xbb43('0x24')]()[_0xbb43('0x25')](function(){_0x4a790d[_0xbb43('0x17')](0xcc)[_0xbb43('0x18')]();});}};}function handleEntityNotFound(_0x297778,_0x4a9f81){return function(_0x27b6dc){if(!_0x27b6dc){_0x297778[_0xbb43('0x16')](0x194);}return _0x27b6dc;};}function handleError(_0x4173a6,_0x3f114d){_0x3f114d=_0x3f114d||0x1f4;return function(_0x308be4){logger['error'](_0x308be4['stack']);if(_0x308be4[_0xbb43('0x26')]){delete _0x308be4[_0xbb43('0x26')];}_0x4173a6['status'](_0x3f114d)[_0xbb43('0x27')](_0x308be4);};}exports[_0xbb43('0x28')]=function(_0x5e668a,_0xaeb1e4){var _0x554771={},_0x2b5e07={},_0x24f4fa={'count':0x0,'rows':[]};var _0x2c5799=_[_0xbb43('0x29')](db[_0xbb43('0x2a')]['rawAttributes'],function(_0x37792d){return{'name':_0x37792d[_0xbb43('0x2b')],'type':_0x37792d[_0xbb43('0x2c')][_0xbb43('0x2d')]};});_0x2b5e07[_0xbb43('0x2e')]=_[_0xbb43('0x29')](_0x2c5799,_0xbb43('0x26'));_0x2b5e07['query']=_[_0xbb43('0x2f')](_0x5e668a[_0xbb43('0x30')]);_0x2b5e07[_0xbb43('0x31')]=_[_0xbb43('0x32')](_0x2b5e07[_0xbb43('0x2e')],_0x2b5e07[_0xbb43('0x30')]);_0x554771[_0xbb43('0x33')]=_[_0xbb43('0x32')](_0x2b5e07[_0xbb43('0x2e')],qs[_0xbb43('0x34')](_0x5e668a[_0xbb43('0x30')][_0xbb43('0x34')]));_0x554771[_0xbb43('0x33')]=_0x554771[_0xbb43('0x33')][_0xbb43('0x35')]?_0x554771[_0xbb43('0x33')]:_0x2b5e07[_0xbb43('0x2e')];if(!_0x5e668a[_0xbb43('0x30')][_0xbb43('0x36')](_0xbb43('0x37'))){_0x554771[_0xbb43('0x1b')]=qs[_0xbb43('0x1b')](_0x5e668a[_0xbb43('0x30')][_0xbb43('0x1b')]);_0x554771[_0xbb43('0x1a')]=qs['offset'](_0x5e668a[_0xbb43('0x30')][_0xbb43('0x1a')]);}_0x554771[_0xbb43('0x38')]=qs[_0xbb43('0x39')](_0x5e668a['query']['sort']);_0x554771[_0xbb43('0x3a')]=qs[_0xbb43('0x31')](_[_0xbb43('0x3b')](_0x5e668a['query'],_0x2b5e07[_0xbb43('0x31')]),_0x2c5799);if(_0x5e668a[_0xbb43('0x30')]['filter']){_0x554771['where']=_[_0xbb43('0x3c')](_0x554771[_0xbb43('0x3a')],{'$or':_[_0xbb43('0x29')](_0x2c5799,function(_0x442940){if(_0x442940[_0xbb43('0x2c')]!=='VIRTUAL'){var _0x46de11={};_0x46de11[_0x442940[_0xbb43('0x26')]]={'$like':'%'+_0x5e668a['query'][_0xbb43('0x3d')]+'%'};return _0x46de11;}})});}_0x554771=_[_0xbb43('0x3c')]({},_0x554771,_0x5e668a[_0xbb43('0x3e')]);var _0x43eb8a={'where':_0x554771['where']};return db[_0xbb43('0x2a')][_0xbb43('0x1d')](_0x43eb8a)[_0xbb43('0x25')](function(_0x252e43){_0x24f4fa['count']=_0x252e43;if(_0x5e668a[_0xbb43('0x30')]['includeAll']){_0x554771[_0xbb43('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x554771);})['then'](function(_0x3abdf6){_0x24f4fa[_0xbb43('0x40')]=_0x3abdf6;return _0x24f4fa;})['then'](respondWithFilteredResult(_0xaeb1e4,_0x554771))[_0xbb43('0x41')](handleError(_0xaeb1e4,null));};exports[_0xbb43('0x42')]=function(_0x5a0376,_0x3671f4){var _0x228bbe={'raw':![],'where':{'id':_0x5a0376[_0xbb43('0x43')]['id']}},_0x55fa09={};_0x55fa09['model']=_[_0xbb43('0x2f')](db[_0xbb43('0x2a')]['rawAttributes']);_0x55fa09[_0xbb43('0x30')]=_[_0xbb43('0x2f')](_0x5a0376[_0xbb43('0x30')]);_0x55fa09[_0xbb43('0x31')]=_[_0xbb43('0x32')](_0x55fa09[_0xbb43('0x2e')],_0x55fa09['query']);_0x228bbe['attributes']=_['intersection'](_0x55fa09[_0xbb43('0x2e')],qs[_0xbb43('0x34')](_0x5a0376[_0xbb43('0x30')]['fields']));_0x228bbe[_0xbb43('0x33')]=_0x228bbe[_0xbb43('0x33')][_0xbb43('0x35')]?_0x228bbe[_0xbb43('0x33')]:_0x55fa09['model'];if(_0x5a0376[_0xbb43('0x30')][_0xbb43('0x44')]){_0x228bbe[_0xbb43('0x3f')]=[{'all':!![]}];}_0x228bbe=_['merge']({},_0x228bbe,_0x5a0376[_0xbb43('0x3e')]);return db[_0xbb43('0x2a')][_0xbb43('0x45')](_0x228bbe)['then'](handleEntityNotFound(_0x3671f4,null))[_0xbb43('0x25')](respondWithResult(_0x3671f4,null))[_0xbb43('0x41')](handleError(_0x3671f4,null));};exports[_0xbb43('0x46')]=function(_0x2cd365,_0xb34bbd){return db[_0xbb43('0x2a')][_0xbb43('0x46')](_0x2cd365['body'],{})[_0xbb43('0x25')](respondWithResult(_0xb34bbd,0xc9))[_0xbb43('0x41')](handleError(_0xb34bbd,null));};exports[_0xbb43('0x47')]=function(_0x5cb5e0,_0x40b926){return db[_0xbb43('0x2a')][_0xbb43('0x47')](_0x5cb5e0[_0xbb43('0x48')],{'raw':![],'individualHooks':!![]})[_0xbb43('0x25')](respondWithResult(_0x40b926,0xc9))['catch'](handleError(_0x40b926,null));};exports[_0xbb43('0x23')]=function(_0x8011cb,_0xff9d13){if(_0x8011cb['body']['id']){delete _0x8011cb[_0xbb43('0x48')]['id'];}return db['AnalyticFieldReport'][_0xbb43('0x45')]({'where':{'id':_0x8011cb['params']['id']}})[_0xbb43('0x25')](handleEntityNotFound(_0xff9d13,null))[_0xbb43('0x25')](saveUpdates(_0x8011cb['body'],null))['then'](respondWithResult(_0xff9d13,null))[_0xbb43('0x41')](handleError(_0xff9d13,null));};exports['destroy']=function(_0x4991db,_0x2e266b){return db[_0xbb43('0x2a')][_0xbb43('0x45')]({'where':{'id':_0x4991db[_0xbb43('0x43')]['id']}})[_0xbb43('0x25')](handleEntityNotFound(_0x2e266b,null))[_0xbb43('0x25')](removeEntity(_0x2e266b,null))['catch'](handleError(_0x2e266b,null));};exports[_0xbb43('0x49')]=function(_0x2dcf90,_0x2cc449){return db[_0xbb43('0x2a')]['destroy']({'where':{'id':_0x2dcf90['query'][_0xbb43('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xbb43('0x25')](respondWithResult(_0x2cc449,0xcc))[_0xbb43('0x41')](handleError(_0x2cc449,null));};exports[_0xbb43('0x4b')]=function(_0x1eb364,_0x320e15,_0xcdbe61){return db[_0xbb43('0x4c')]['findOne']({'where':{'id':_0x1eb364[_0xbb43('0x43')]['id']}})[_0xbb43('0x25')](handleEntityNotFound(_0x320e15,null))[_0xbb43('0x25')](function(_0x13a19b){if(_0x13a19b){return db['sequelize']['transaction'](function(_0x529bac){return db['AnalyticFieldReport'][_0xbb43('0x24')]({'where':{'CustomReportId':_0x1eb364[_0xbb43('0x43')]['id']},'transaction':_0x529bac})['then'](function(_0x5e1ecf){var _0x5bec6d=_[_0xbb43('0x29')](_0x1eb364[_0xbb43('0x48')],function(_0xf2b12a){delete _0xf2b12a['id'];_0xf2b12a[_0xbb43('0x4d')]=_0x1eb364[_0xbb43('0x43')]['id'];return _0xf2b12a;});return db[_0xbb43('0x2a')][_0xbb43('0x47')](_0x5bec6d,{'transaction':_0x529bac});});})['then'](function(){return db[_0xbb43('0x2a')][_0xbb43('0x4e')]({'where':{'CustomReportId':_0x1eb364[_0xbb43('0x43')]['id']}});});}})[_0xbb43('0x25')](respondWithResult(_0x320e15,null))[_0xbb43('0x41')](handleError(_0x320e15,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 67b2f87..3de363d 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 _0xb738=['moment','bluebird','request-promise','rimraf','../../config/environment','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb738,0xa8));var _0x8b73=function(_0x7b6ffe,_0x2bc84a){_0x7b6ffe=_0x7b6ffe-0x0;var _0x3822d0=_0xb738[_0x7b6ffe];return _0x3822d0;};'use strict';var _=require(_0x8b73('0x0'));var util=require('util');var logger=require(_0x8b73('0x1'))('api');var moment=require(_0x8b73('0x2'));var BPromise=require(_0x8b73('0x3'));var rp=require(_0x8b73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b73('0x5'));var config=require(_0x8b73('0x6'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x2ef00e,_0x32bbf9){return _0x2ef00e[_0x8b73('0x7')](_0x8b73('0x8'),attributes,{'tableName':_0x8b73('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc062=['request-promise','exports','define','AnalyticFieldReport','bluebird'];(function(_0x52755a,_0x1196ce){var _0xe47ee6=function(_0x5a81a1){while(--_0x5a81a1){_0x52755a['push'](_0x52755a['shift']());}};_0xe47ee6(++_0x1196ce);}(_0xc062,0x162));var _0x2c06=function(_0x4406d1,_0x1a8ab9){_0x4406d1=_0x4406d1-0x0;var _0x476373=_0xc062[_0x4406d1];return _0x476373;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2c06('0x0'));var rp=require(_0x2c06('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x2c06('0x2')]=function(_0xdaac71,_0x1ec7d5){return _0xdaac71[_0x2c06('0x3')](_0x2c06('0x4'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 2ff4691..b83f046 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 _0x2fd6=['rpc','../../config/environment','jayson/promise','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5047e9,_0x226f03){var _0x41796b=function(_0x3ff2ff){while(--_0x3ff2ff){_0x5047e9['push'](_0x5047e9['shift']());}};_0x41796b(++_0x226f03);}(_0x2fd6,0x1d4));var _0x62fd=function(_0x3e478c,_0x152670){_0x3e478c=_0x3e478c-0x0;var _0x29ef89=_0x2fd6[_0x3e478c];return _0x29ef89;};'use strict';var _=require('lodash');var util=require(_0x62fd('0x0'));var moment=require('moment');var BPromise=require(_0x62fd('0x1'));var rs=require(_0x62fd('0x2'));var fs=require('fs');var Redis=require(_0x62fd('0x3'));var db=require(_0x62fd('0x4'))['db'];var utils=require(_0x62fd('0x5'));var logger=require(_0x62fd('0x6'))(_0x62fd('0x7'));var config=require(_0x62fd('0x8'));var jayson=require(_0x62fd('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc96b,_0x1ed970,_0xc32be4){return new BPromise(function(_0x4feb8b,_0x6411b){return client[_0x62fd('0xa')](_0x4dc96b,_0xc32be4)[_0x62fd('0xb')](function(_0x16be4f){logger['info'](_0x62fd('0xc'),_0x1ed970,_0x62fd('0xd'));logger['debug'](_0x62fd('0xe'),_0x1ed970,_0x62fd('0xd'),JSON['stringify'](_0x16be4f));if(_0x16be4f[_0x62fd('0xf')]){if(_0x16be4f['error']['code']===0x1f4){logger[_0x62fd('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1ed970,_0x16be4f[_0x62fd('0xf')][_0x62fd('0x10')]);return _0x6411b(_0x16be4f[_0x62fd('0xf')][_0x62fd('0x10')]);}logger[_0x62fd('0xf')](_0x62fd('0xc'),_0x1ed970,_0x16be4f[_0x62fd('0xf')][_0x62fd('0x10')]);return _0x4feb8b(_0x16be4f[_0x62fd('0xf')][_0x62fd('0x10')]);}else{logger[_0x62fd('0x11')](_0x62fd('0xc'),_0x1ed970,_0x62fd('0xd'));_0x4feb8b(_0x16be4f[_0x62fd('0x12')]['message']);}})['catch'](function(_0x49e593){logger['error'](_0x62fd('0xc'),_0x1ed970,_0x49e593);_0x6411b(_0x49e593);});});}
\ No newline at end of file
+var _0x5f27=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x729918,_0x123cc5){var _0x29cc31=function(_0xc05a35){while(--_0xc05a35){_0x729918['push'](_0x729918['shift']());}};_0x29cc31(++_0x123cc5);}(_0x5f27,0x12c));var _0x75f2=function(_0x1a8925,_0x4d676a){_0x1a8925=_0x1a8925-0x0;var _0xe9f6d9=_0x5f27[_0x1a8925];return _0xe9f6d9;};'use strict';var _=require(_0x75f2('0x0'));var util=require(_0x75f2('0x1'));var moment=require(_0x75f2('0x2'));var BPromise=require(_0x75f2('0x3'));var rs=require(_0x75f2('0x4'));var fs=require('fs');var Redis=require(_0x75f2('0x5'));var db=require(_0x75f2('0x6'))['db'];var utils=require(_0x75f2('0x7'));var logger=require(_0x75f2('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x75f2('0x9'));var client=jayson[_0x75f2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x285616,_0x41dd7b,_0x3efd1a){return new BPromise(function(_0x45cf67,_0x1a8f08){return client[_0x75f2('0xb')](_0x285616,_0x3efd1a)[_0x75f2('0xc')](function(_0x320cba){logger[_0x75f2('0xd')](_0x75f2('0xe'),_0x41dd7b,_0x75f2('0xf'));logger[_0x75f2('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x41dd7b,'request\x20sent',JSON[_0x75f2('0x11')](_0x320cba));if(_0x320cba['error']){if(_0x320cba[_0x75f2('0x12')][_0x75f2('0x13')]===0x1f4){logger[_0x75f2('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x41dd7b,_0x320cba[_0x75f2('0x12')]['message']);return _0x1a8f08(_0x320cba['error'][_0x75f2('0x14')]);}logger[_0x75f2('0x12')](_0x75f2('0xe'),_0x41dd7b,_0x320cba[_0x75f2('0x12')][_0x75f2('0x14')]);return _0x45cf67(_0x320cba[_0x75f2('0x12')][_0x75f2('0x14')]);}else{logger['info'](_0x75f2('0xe'),_0x41dd7b,'request\x20sent');_0x45cf67(_0x320cba[_0x75f2('0x15')]['message']);}})[_0x75f2('0x16')](function(_0x296ad7){logger[_0x75f2('0x12')](_0x75f2('0xe'),_0x41dd7b,_0x296ad7);_0x1a8f08(_0x296ad7);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index ff3c735..e0cd8b1 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(_0x4a65be,_0x25e73b){var _0x4bfdc8=function(_0x1a42be){while(--_0x1a42be){_0x4a65be['push'](_0x4a65be['shift']());}};_0x4bfdc8(++_0x25e73b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x18d5bc,_0x3020a5){var _0x37f9a6=function(_0x465dd8){while(--_0x465dd8){_0x18d5bc['push'](_0x18d5bc['shift']());}};_0x37f9a6(++_0x3020a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 00d2f7c..8da72b9 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 _0xa4db=['TEXT','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4db,0x139));var _0xba4d=function(_0x37d672,_0x58e9cd){_0x37d672=_0x37d672-0x0;var _0x4804e8=_0xa4db[_0x37d672];return _0x4804e8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xba4d('0x0')},'table':{'type':Sequelize[_0xba4d('0x1')]},'metric':{'type':Sequelize[_0xba4d('0x2')]},'description':{'type':Sequelize[_0xba4d('0x1')]}};
\ No newline at end of file
+var _0xaa1b=['sequelize','exports','STRING'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbaa1('0x0'));module[_0xbaa1('0x1')]={'name':{'type':Sequelize[_0xbaa1('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xbaa1('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xbaa1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 726112a..e899d0d 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 _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','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','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x3401ab,_0x5e1301){var _0x438391=function(_0x3b886d){while(--_0x3b886d){_0x3401ab['push'](_0x3401ab['shift']());}};_0x438391(++_0x5e1301);}(_0x81bd,0x7c));var _0xd81b=function(_0x42f270,_0x452dec){_0x42f270=_0x42f270-0x0;var _0x57bc5b=_0x81bd[_0x42f270];return _0x57bc5b;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../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','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x48ac6f,_0x3afacb){var _0x4d01b8=function(_0x4fc24a){while(--_0x4fc24a){_0x48ac6f['push'](_0x48ac6f['shift']());}};_0x4d01b8(++_0x3afacb);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0xf2ca[_0x2431d6];return _0x4d0f9b;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 0d82b1e..7045aae 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 _0xf006=['bluebird','path','./analyticMetric.attributes','exports','define','analytics_metrics','../../config/logger','api'];(function(_0x1c8c4b,_0x3763cb){var _0x24d7b4=function(_0x534597){while(--_0x534597){_0x1c8c4b['push'](_0x1c8c4b['shift']());}};_0x24d7b4(++_0x3763cb);}(_0xf006,0x146));var _0x6f00=function(_0x5f35e9,_0x22a510){_0x5f35e9=_0x5f35e9-0x0;var _0x593ea1=_0xf006[_0x5f35e9];return _0x593ea1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var moment=require('moment');var BPromise=require(_0x6f00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f00('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f00('0x4'));module[_0x6f00('0x5')]=function(_0x141e71,_0x52c9a2){return _0x141e71[_0x6f00('0x6')]('AnalyticMetric',attributes,{'tableName':_0x6f00('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa6bb=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x43e7f6,_0xf7329e){var _0xfebcb1=function(_0x1f3632){while(--_0x1f3632){_0x43e7f6['push'](_0x43e7f6['shift']());}};_0xfebcb1(++_0xf7329e);}(_0xa6bb,0x12c));var _0xba6b=function(_0x85072a,_0xc297e7){_0x85072a=_0x85072a-0x0;var _0x397bb7=_0xa6bb[_0x85072a];return _0x397bb7;};'use strict';var _=require('lodash');var util=require(_0xba6b('0x0'));var logger=require(_0xba6b('0x1'))(_0xba6b('0x2'));var moment=require(_0xba6b('0x3'));var BPromise=require(_0xba6b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xba6b('0x5'));var config=require(_0xba6b('0x6'));var attributes=require(_0xba6b('0x7'));module[_0xba6b('0x8')]=function(_0x517d10,_0x4cc381){return _0x517d10[_0xba6b('0x9')](_0xba6b('0xa'),attributes,{'tableName':_0xba6b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 20c930f..9a0fd88 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 _0x3748=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x3748,0x1e3));var _0x8374=function(_0x218f86,_0x2c6878){_0x218f86=_0x218f86-0x0;var _0x1c1f7c=_0x3748[_0x218f86];return _0x1c1f7c;};'use strict';var _=require(_0x8374('0x0'));var util=require(_0x8374('0x1'));var moment=require(_0x8374('0x2'));var BPromise=require(_0x8374('0x3'));var rs=require(_0x8374('0x4'));var fs=require('fs');var Redis=require(_0x8374('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8374('0x6'));var logger=require(_0x8374('0x7'))('rpc');var config=require(_0x8374('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8374('0x9')][_0x8374('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b8748,_0x4c6aab,_0x449112){return new BPromise(function(_0x32ffb0,_0x5daf65){return client[_0x8374('0xb')](_0x1b8748,_0x449112)[_0x8374('0xc')](function(_0x17b4a8){logger['info'](_0x8374('0xd'),_0x4c6aab,_0x8374('0xe'));logger[_0x8374('0xf')](_0x8374('0x10'),_0x4c6aab,'request\x20sent',JSON['stringify'](_0x17b4a8));if(_0x17b4a8['error']){if(_0x17b4a8[_0x8374('0x11')]['code']===0x1f4){logger[_0x8374('0x11')](_0x8374('0xd'),_0x4c6aab,_0x17b4a8[_0x8374('0x11')][_0x8374('0x12')]);return _0x5daf65(_0x17b4a8[_0x8374('0x11')]['message']);}logger[_0x8374('0x11')](_0x8374('0xd'),_0x4c6aab,_0x17b4a8[_0x8374('0x11')]['message']);return _0x32ffb0(_0x17b4a8[_0x8374('0x11')]['message']);}else{logger['info'](_0x8374('0xd'),_0x4c6aab,_0x8374('0xe'));_0x32ffb0(_0x17b4a8[_0x8374('0x13')]['message']);}})[_0x8374('0x14')](function(_0x4616c5){logger[_0x8374('0x11')](_0x8374('0xd'),_0x4c6aab,_0x4616c5);_0x5daf65(_0x4616c5);});});}
\ No newline at end of file
+var _0xeba2=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x159095,_0x203b3b){var _0x15f816=function(_0x55930e){while(--_0x55930e){_0x159095['push'](_0x159095['shift']());}};_0x15f816(++_0x203b3b);}(_0xeba2,0x18a));var _0x2eba=function(_0x2f7023,_0x1aa399){_0x2f7023=_0x2f7023-0x0;var _0x2f5e4e=_0xeba2[_0x2f7023];return _0x2f5e4e;};'use strict';var _=require(_0x2eba('0x0'));var util=require(_0x2eba('0x1'));var moment=require(_0x2eba('0x2'));var BPromise=require(_0x2eba('0x3'));var rs=require(_0x2eba('0x4'));var fs=require('fs');var Redis=require(_0x2eba('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2eba('0x6'))(_0x2eba('0x7'));var config=require('../../config/environment');var jayson=require(_0x2eba('0x8'));var client=jayson['client'][_0x2eba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x555cd6,_0x5a9048,_0x359825){return new BPromise(function(_0x3b6313,_0x576dd7){return client[_0x2eba('0xa')](_0x555cd6,_0x359825)[_0x2eba('0xb')](function(_0x565efb){logger['info'](_0x2eba('0xc'),_0x5a9048,_0x2eba('0xd'));logger[_0x2eba('0xe')](_0x2eba('0xf'),_0x5a9048,_0x2eba('0xd'),JSON[_0x2eba('0x10')](_0x565efb));if(_0x565efb[_0x2eba('0x11')]){if(_0x565efb[_0x2eba('0x11')][_0x2eba('0x12')]===0x1f4){logger[_0x2eba('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x5a9048,_0x565efb[_0x2eba('0x11')]['message']);return _0x576dd7(_0x565efb[_0x2eba('0x11')][_0x2eba('0x13')]);}logger['error'](_0x2eba('0xc'),_0x5a9048,_0x565efb[_0x2eba('0x11')]['message']);return _0x3b6313(_0x565efb['error'][_0x2eba('0x13')]);}else{logger[_0x2eba('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x5a9048,'request\x20sent');_0x3b6313(_0x565efb[_0x2eba('0x15')]['message']);}})[_0x2eba('0x16')](function(_0x413238){logger['error'](_0x2eba('0xc'),_0x5a9048,_0x413238);_0x576dd7(_0x413238);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 70b3c0c..26208ef 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 _0xd8a7=['express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','get','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x24c5dc,_0x19cf4f){var _0x248618=function(_0x31edc9){while(--_0x31edc9){_0x24c5dc['push'](_0x24c5dc['shift']());}};_0x248618(++_0x19cf4f);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x291554,_0x13ae4d){_0x291554=_0x291554-0x0;var _0x1a6980=_0xd8a7[_0x291554];return _0x1a6980;};'use strict';var multer=require(_0x7d8a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7d8a('0x1'));var router=express[_0x7d8a('0x2')]();var fs_extra=require(_0x7d8a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7d8a('0x4'));var config=require('../../config/environment');var controller=require(_0x7d8a('0x5'));router['get']('/',auth[_0x7d8a('0x6')](),controller['index']);router[_0x7d8a('0x7')](_0x7d8a('0x8'),auth[_0x7d8a('0x6')](),controller['show']);router[_0x7d8a('0x9')]('/',auth[_0x7d8a('0x6')](),controller[_0x7d8a('0xa')]);router[_0x7d8a('0xb')](_0x7d8a('0x8'),auth[_0x7d8a('0x6')](),controller[_0x7d8a('0xc')]);router[_0x7d8a('0xd')](_0x7d8a('0x8'),auth[_0x7d8a('0x6')](),controller[_0x7d8a('0xe')]);module[_0x7d8a('0xf')]=router;
\ No newline at end of file
+var _0x2f2e=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','create','update','delete','destroy','util','path','express','fs-extra'];(function(_0x20d3b5,_0x27a07e){var _0x4a8a53=function(_0x38d9d9){while(--_0x38d9d9){_0x20d3b5['push'](_0x20d3b5['shift']());}};_0x4a8a53(++_0x27a07e);}(_0x2f2e,0x146));var _0xe2f2=function(_0x50aea5,_0x5dd077){_0x50aea5=_0x50aea5-0x0;var _0x4657f1=_0x2f2e[_0x50aea5];return _0x4657f1;};'use strict';var multer=require('multer');var util=require(_0xe2f2('0x0'));var path=require(_0xe2f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe2f2('0x2'));var router=express['Router']();var fs_extra=require(_0xe2f2('0x3'));var auth=require(_0xe2f2('0x4'));var interaction=require(_0xe2f2('0x5'));var config=require(_0xe2f2('0x6'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe2f2('0x7')]);router[_0xe2f2('0x8')](_0xe2f2('0x9'),auth[_0xe2f2('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe2f2('0xb')]);router['put'](_0xe2f2('0x9'),auth[_0xe2f2('0xa')](),controller[_0xe2f2('0xc')]);router[_0xe2f2('0xd')]('/:id',auth[_0xe2f2('0xa')](),controller[_0xe2f2('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 734e61d..a8a406d 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 _0x90fe=['TEXT','sequelize'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x90fe,0x173));var _0xe90f=function(_0x50753e,_0x155b95){_0x50753e=_0x50753e-0x0;var _0x510b61=_0x90fe[_0x50753e];return _0x510b61;};'use strict';var Sequelize=require(_0xe90f('0x0'));module['exports']={'tree':{'type':Sequelize[_0xe90f('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x2b06=['exports','TEXT','sequelize'];(function(_0x5f1213,_0x47c092){var _0x1c2ff2=function(_0x3baccb){while(--_0x3baccb){_0x5f1213['push'](_0x5f1213['shift']());}};_0x1c2ff2(++_0x47c092);}(_0x2b06,0xf8));var _0x62b0=function(_0xf4129c,_0x44fcf1){_0xf4129c=_0xf4129c-0x0;var _0x426611=_0x2b06[_0xf4129c];return _0x426611;};'use strict';var Sequelize=require(_0x62b0('0x0'));module[_0x62b0('0x1')]={'tree':{'type':Sequelize[_0x62b0('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 00d9eae..b43b813 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 _0x1744=['../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xcec5ef,_0x1cca96){var _0x2ce2a7=function(_0x5b765b){while(--_0x5b765b){_0xcec5ef['push'](_0xcec5ef['shift']());}};_0x2ce2a7(++_0x1cca96);}(_0x1744,0xd3));var _0x4174=function(_0x4ac2f2,_0x43a291){_0x4ac2f2=_0x4ac2f2-0x0;var _0x4bf328=_0x1744[_0x4ac2f2];return _0x4bf328;};'use strict';var emlformat=require(_0x4174('0x0'));var rimraf=require(_0x4174('0x1'));var zipdir=require(_0x4174('0x2'));var jsonpatch=require(_0x4174('0x3'));var rp=require('request-promise');var moment=require(_0x4174('0x4'));var BPromise=require(_0x4174('0x5'));var Mustache=require(_0x4174('0x6'));var util=require(_0x4174('0x7'));var path=require(_0x4174('0x8'));var sox=require(_0x4174('0x9'));var csv=require(_0x4174('0xa'));var ejs=require(_0x4174('0xb'));var fs=require('fs');var fs_extra=require(_0x4174('0xc'));var _=require('lodash');var squel=require(_0x4174('0xd'));var crypto=require(_0x4174('0xe'));var jsforce=require(_0x4174('0xf'));var deskjs=require(_0x4174('0x10'));var toCsv=require(_0x4174('0xa'));var querystring=require('querystring');var Papa=require(_0x4174('0x11'));var Redis=require(_0x4174('0x12'));var authService=require(_0x4174('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4174('0x14'));var logger=require(_0x4174('0x15'))(_0x4174('0x16'));var utils=require(_0x4174('0x17'));var config=require(_0x4174('0x18'));var licenseUtil=require(_0x4174('0x19'));var db=require(_0x4174('0x1a'))['db'];function respondWithStatusCode(_0xcec7d4,_0x503488){_0x503488=_0x503488||0xcc;return function(_0x4da4d2){if(_0x4da4d2){return _0xcec7d4[_0x4174('0x1b')](_0x503488);}return _0xcec7d4[_0x4174('0x1c')](_0x503488)[_0x4174('0x1d')]();};}function respondWithResult(_0x4ffaf5,_0x5f1f6c){_0x5f1f6c=_0x5f1f6c||0xc8;return function(_0x52b951){if(_0x52b951){return _0x4ffaf5[_0x4174('0x1c')](_0x5f1f6c)[_0x4174('0x1e')](_0x52b951);}};}function respondWithFilteredResult(_0x1253ed,_0x464a52){return function(_0x55e503){if(_0x55e503){var _0x30ad32=typeof _0x464a52['offset']===_0x4174('0x1f')&&typeof _0x464a52[_0x4174('0x20')]===_0x4174('0x1f');var _0x5e68c8=_0x55e503['count'];var _0x19a33a=_0x30ad32?0x0:_0x464a52[_0x4174('0x21')];var _0xdff745=_0x30ad32?_0x55e503[_0x4174('0x22')]:_0x464a52[_0x4174('0x21')]+_0x464a52['limit'];var _0x383222;if(_0xdff745>=_0x5e68c8){_0xdff745=_0x5e68c8;_0x383222=0xc8;}else{_0x383222=0xce;}_0x1253ed['status'](_0x383222);return _0x1253ed[_0x4174('0x23')](_0x4174('0x24'),_0x19a33a+'-'+_0xdff745+'/'+_0x5e68c8)['json'](_0x55e503);}return null;};}function patchUpdates(_0x1be702){return function(_0x30c517){try{jsonpatch[_0x4174('0x25')](_0x30c517,_0x1be702,!![]);}catch(_0x40e717){return BPromise[_0x4174('0x26')](_0x40e717);}return _0x30c517[_0x4174('0x27')]();};}function saveUpdates(_0x19759a,_0x1c3f94){return function(_0x4c7d28){if(_0x4c7d28){return _0x4c7d28[_0x4174('0x28')](_0x19759a)[_0x4174('0x29')](function(_0x56d68f){return _0x56d68f;});}return null;};}function removeEntity(_0x34ef03,_0x34318b){return function(_0x2fad77){if(_0x2fad77){return _0x2fad77['destroy']()[_0x4174('0x29')](function(){_0x34ef03[_0x4174('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b7a23,_0x5f507f){return function(_0x4132d8){if(!_0x4132d8){_0x5b7a23[_0x4174('0x1b')](0x194);}return _0x4132d8;};}function handleError(_0x264ef1,_0x584e4b){_0x584e4b=_0x584e4b||0x1f4;return function(_0xa19b7c){logger[_0x4174('0x2a')](_0xa19b7c[_0x4174('0x2b')]);if(_0xa19b7c[_0x4174('0x2c')]){delete _0xa19b7c[_0x4174('0x2c')];}_0x264ef1[_0x4174('0x1c')](_0x584e4b)[_0x4174('0x2d')](_0xa19b7c);};}exports[_0x4174('0x2e')]=function(_0x18c7a4,_0x360f13){var _0x526964={},_0x5e4241={},_0x3d511e={'count':0x0,'rows':[]};var _0x4b84ef=_[_0x4174('0x2f')](db[_0x4174('0x30')][_0x4174('0x31')],function(_0x5aefca){return{'name':_0x5aefca['fieldName'],'type':_0x5aefca[_0x4174('0x32')][_0x4174('0x33')]};});_0x5e4241[_0x4174('0x34')]=_['map'](_0x4b84ef,_0x4174('0x2c'));_0x5e4241[_0x4174('0x35')]=_['keys'](_0x18c7a4[_0x4174('0x35')]);_0x5e4241[_0x4174('0x36')]=_[_0x4174('0x37')](_0x5e4241[_0x4174('0x34')],_0x5e4241[_0x4174('0x35')]);_0x526964[_0x4174('0x38')]=_[_0x4174('0x37')](_0x5e4241[_0x4174('0x34')],qs[_0x4174('0x39')](_0x18c7a4['query']['fields']));_0x526964['attributes']=_0x526964[_0x4174('0x38')]['length']?_0x526964['attributes']:_0x5e4241[_0x4174('0x34')];if(!_0x18c7a4[_0x4174('0x35')]['hasOwnProperty'](_0x4174('0x3a'))){_0x526964['limit']=qs['limit'](_0x18c7a4['query'][_0x4174('0x20')]);_0x526964[_0x4174('0x21')]=qs['offset'](_0x18c7a4['query']['offset']);}_0x526964[_0x4174('0x3b')]=qs[_0x4174('0x3c')](_0x18c7a4[_0x4174('0x35')]['sort']);_0x526964[_0x4174('0x3d')]=qs[_0x4174('0x36')](_[_0x4174('0x3e')](_0x18c7a4[_0x4174('0x35')],_0x5e4241[_0x4174('0x36')]),_0x4b84ef);if(_0x18c7a4[_0x4174('0x35')][_0x4174('0x3f')]){_0x526964[_0x4174('0x3d')]=_[_0x4174('0x40')](_0x526964['where'],{'$or':_[_0x4174('0x2f')](_0x4b84ef,function(_0x4459dc){if(_0x4459dc[_0x4174('0x32')]!==_0x4174('0x41')){var _0x5ed32f={};_0x5ed32f[_0x4459dc[_0x4174('0x2c')]]={'$like':'%'+_0x18c7a4[_0x4174('0x35')][_0x4174('0x3f')]+'%'};return _0x5ed32f;}})});}_0x526964=_[_0x4174('0x40')]({},_0x526964,_0x18c7a4[_0x4174('0x42')]);var _0x3a39e2={'where':_0x526964[_0x4174('0x3d')]};return db['AnalyticTreeReport']['count'](_0x3a39e2)[_0x4174('0x29')](function(_0x5d82ec){_0x3d511e[_0x4174('0x22')]=_0x5d82ec;if(_0x18c7a4[_0x4174('0x35')][_0x4174('0x43')]){_0x526964[_0x4174('0x44')]=[{'all':!![]}];}return db[_0x4174('0x30')][_0x4174('0x45')](_0x526964);})[_0x4174('0x29')](function(_0x130978){_0x3d511e[_0x4174('0x46')]=_0x130978;return _0x3d511e;})['then'](respondWithFilteredResult(_0x360f13,_0x526964))[_0x4174('0x47')](handleError(_0x360f13,null));};exports[_0x4174('0x48')]=function(_0xc3213f,_0xd4d02d){var _0x1adeb9={'raw':!![],'where':{'id':_0xc3213f['params']['id']}},_0x309d9c={};_0x309d9c[_0x4174('0x34')]=_[_0x4174('0x49')](db[_0x4174('0x30')][_0x4174('0x31')]);_0x309d9c[_0x4174('0x35')]=_[_0x4174('0x49')](_0xc3213f[_0x4174('0x35')]);_0x309d9c[_0x4174('0x36')]=_[_0x4174('0x37')](_0x309d9c[_0x4174('0x34')],_0x309d9c[_0x4174('0x35')]);_0x1adeb9['attributes']=_[_0x4174('0x37')](_0x309d9c[_0x4174('0x34')],qs[_0x4174('0x39')](_0xc3213f['query'][_0x4174('0x39')]));_0x1adeb9[_0x4174('0x38')]=_0x1adeb9[_0x4174('0x38')][_0x4174('0x4a')]?_0x1adeb9['attributes']:_0x309d9c[_0x4174('0x34')];if(_0xc3213f[_0x4174('0x35')][_0x4174('0x43')]){_0x1adeb9[_0x4174('0x44')]=[{'all':!![]}];}_0x1adeb9=_[_0x4174('0x40')]({},_0x1adeb9,_0xc3213f[_0x4174('0x42')]);return db['AnalyticTreeReport'][_0x4174('0x4b')](_0x1adeb9)[_0x4174('0x29')](handleEntityNotFound(_0xd4d02d,null))[_0x4174('0x29')](respondWithResult(_0xd4d02d,null))['catch'](handleError(_0xd4d02d,null));};exports[_0x4174('0x4c')]=function(_0x584953,_0x1f2548){return db[_0x4174('0x30')][_0x4174('0x4c')](_0x584953[_0x4174('0x4d')],{})[_0x4174('0x29')](respondWithResult(_0x1f2548,0xc9))[_0x4174('0x47')](handleError(_0x1f2548,null));};exports[_0x4174('0x28')]=function(_0x165e5d,_0x4eee28){if(_0x165e5d[_0x4174('0x4d')]['id']){delete _0x165e5d['body']['id'];}return db[_0x4174('0x30')][_0x4174('0x4b')]({'where':{'id':_0x165e5d[_0x4174('0x4e')]['id']}})[_0x4174('0x29')](handleEntityNotFound(_0x4eee28,null))['then'](saveUpdates(_0x165e5d[_0x4174('0x4d')],null))['then'](respondWithResult(_0x4eee28,null))[_0x4174('0x47')](handleError(_0x4eee28,null));};exports['destroy']=function(_0x7ffb02,_0x3d684c){return db[_0x4174('0x30')][_0x4174('0x4b')]({'where':{'id':_0x7ffb02['params']['id']}})['then'](handleEntityNotFound(_0x3d684c,null))['then'](removeEntity(_0x3d684c,null))[_0x4174('0x47')](handleError(_0x3d684c,null));};
\ No newline at end of file
+var _0x9501=['moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','intersection','attributes','fields','sort','where','pick','filters','merge','options','includeAll','findAll','catch','show','params','keys','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x9501,0x1b1));var _0x1950=function(_0xeaff44,_0x4901cf){_0xeaff44=_0xeaff44-0x0;var _0x3512a5=_0x9501[_0xeaff44];return _0x3512a5;};'use strict';var emlformat=require(_0x1950('0x0'));var rimraf=require(_0x1950('0x1'));var zipdir=require(_0x1950('0x2'));var jsonpatch=require(_0x1950('0x3'));var rp=require(_0x1950('0x4'));var moment=require(_0x1950('0x5'));var BPromise=require(_0x1950('0x6'));var Mustache=require(_0x1950('0x7'));var util=require(_0x1950('0x8'));var path=require(_0x1950('0x9'));var sox=require('sox');var csv=require(_0x1950('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1950('0xb'));var _=require('lodash');var squel=require(_0x1950('0xc'));var crypto=require(_0x1950('0xd'));var jsforce=require(_0x1950('0xe'));var deskjs=require(_0x1950('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1950('0x10'));var Papa=require(_0x1950('0x11'));var Redis=require(_0x1950('0x12'));var authService=require(_0x1950('0x13'));var qs=require(_0x1950('0x14'));var as=require(_0x1950('0x15'));var hardwareService=require(_0x1950('0x16'));var logger=require(_0x1950('0x17'))(_0x1950('0x18'));var utils=require(_0x1950('0x19'));var config=require(_0x1950('0x1a'));var licenseUtil=require(_0x1950('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37ca9e,_0x44b5db){_0x44b5db=_0x44b5db||0xcc;return function(_0x5a4632){if(_0x5a4632){return _0x37ca9e[_0x1950('0x1c')](_0x44b5db);}return _0x37ca9e[_0x1950('0x1d')](_0x44b5db)[_0x1950('0x1e')]();};}function respondWithResult(_0x5f3391,_0x1c467d){_0x1c467d=_0x1c467d||0xc8;return function(_0x17b64f){if(_0x17b64f){return _0x5f3391['status'](_0x1c467d)[_0x1950('0x1f')](_0x17b64f);}};}function respondWithFilteredResult(_0x396a57,_0x38d653){return function(_0x40f63d){if(_0x40f63d){var _0x54e61b=typeof _0x38d653[_0x1950('0x20')]==='undefined'&&typeof _0x38d653[_0x1950('0x21')]===_0x1950('0x22');var _0x26c71=_0x40f63d[_0x1950('0x23')];var _0xd1171=_0x54e61b?0x0:_0x38d653[_0x1950('0x20')];var _0x269975=_0x54e61b?_0x40f63d[_0x1950('0x23')]:_0x38d653[_0x1950('0x20')]+_0x38d653['limit'];var _0x2091c3;if(_0x269975>=_0x26c71){_0x269975=_0x26c71;_0x2091c3=0xc8;}else{_0x2091c3=0xce;}_0x396a57['status'](_0x2091c3);return _0x396a57[_0x1950('0x24')](_0x1950('0x25'),_0xd1171+'-'+_0x269975+'/'+_0x26c71)[_0x1950('0x1f')](_0x40f63d);}return null;};}function patchUpdates(_0x3fef68){return function(_0xe58227){try{jsonpatch[_0x1950('0x26')](_0xe58227,_0x3fef68,!![]);}catch(_0x17031f){return BPromise['reject'](_0x17031f);}return _0xe58227['save']();};}function saveUpdates(_0x2c0af1,_0x274e84){return function(_0x3de5f){if(_0x3de5f){return _0x3de5f[_0x1950('0x27')](_0x2c0af1)[_0x1950('0x28')](function(_0x31e75b){return _0x31e75b;});}return null;};}function removeEntity(_0x32fa23,_0x34efc7){return function(_0x5d8dd7){if(_0x5d8dd7){return _0x5d8dd7[_0x1950('0x29')]()[_0x1950('0x28')](function(){_0x32fa23[_0x1950('0x1d')](0xcc)[_0x1950('0x1e')]();});}};}function handleEntityNotFound(_0xa75682,_0x574c7c){return function(_0x1ece54){if(!_0x1ece54){_0xa75682[_0x1950('0x1c')](0x194);}return _0x1ece54;};}function handleError(_0x30d5f5,_0x445cfd){_0x445cfd=_0x445cfd||0x1f4;return function(_0x359377){logger[_0x1950('0x2a')](_0x359377[_0x1950('0x2b')]);if(_0x359377[_0x1950('0x2c')]){delete _0x359377[_0x1950('0x2c')];}_0x30d5f5[_0x1950('0x1d')](_0x445cfd)[_0x1950('0x2d')](_0x359377);};}exports[_0x1950('0x2e')]=function(_0x44501b,_0x1afb57){var _0x4c19bb={},_0x412f90={},_0x29a593={'count':0x0,'rows':[]};var _0xde2a60=_[_0x1950('0x2f')](db[_0x1950('0x30')][_0x1950('0x31')],function(_0x178de4){return{'name':_0x178de4['fieldName'],'type':_0x178de4[_0x1950('0x32')][_0x1950('0x33')]};});_0x412f90[_0x1950('0x34')]=_[_0x1950('0x2f')](_0xde2a60,_0x1950('0x2c'));_0x412f90[_0x1950('0x35')]=_['keys'](_0x44501b[_0x1950('0x35')]);_0x412f90['filters']=_[_0x1950('0x36')](_0x412f90['model'],_0x412f90['query']);_0x4c19bb[_0x1950('0x37')]=_[_0x1950('0x36')](_0x412f90[_0x1950('0x34')],qs[_0x1950('0x38')](_0x44501b[_0x1950('0x35')][_0x1950('0x38')]));_0x4c19bb[_0x1950('0x37')]=_0x4c19bb[_0x1950('0x37')]['length']?_0x4c19bb['attributes']:_0x412f90['model'];if(!_0x44501b[_0x1950('0x35')]['hasOwnProperty']('nolimit')){_0x4c19bb[_0x1950('0x21')]=qs[_0x1950('0x21')](_0x44501b['query']['limit']);_0x4c19bb[_0x1950('0x20')]=qs[_0x1950('0x20')](_0x44501b[_0x1950('0x35')]['offset']);}_0x4c19bb['order']=qs[_0x1950('0x39')](_0x44501b['query']['sort']);_0x4c19bb[_0x1950('0x3a')]=qs['filters'](_[_0x1950('0x3b')](_0x44501b[_0x1950('0x35')],_0x412f90[_0x1950('0x3c')]),_0xde2a60);if(_0x44501b['query']['filter']){_0x4c19bb[_0x1950('0x3a')]=_[_0x1950('0x3d')](_0x4c19bb[_0x1950('0x3a')],{'$or':_[_0x1950('0x2f')](_0xde2a60,function(_0x5b7083){if(_0x5b7083['type']!=='VIRTUAL'){var _0x1ae67f={};_0x1ae67f[_0x5b7083[_0x1950('0x2c')]]={'$like':'%'+_0x44501b[_0x1950('0x35')]['filter']+'%'};return _0x1ae67f;}})});}_0x4c19bb=_[_0x1950('0x3d')]({},_0x4c19bb,_0x44501b[_0x1950('0x3e')]);var _0x1a4d53={'where':_0x4c19bb['where']};return db[_0x1950('0x30')][_0x1950('0x23')](_0x1a4d53)[_0x1950('0x28')](function(_0x4efe72){_0x29a593[_0x1950('0x23')]=_0x4efe72;if(_0x44501b[_0x1950('0x35')][_0x1950('0x3f')]){_0x4c19bb['include']=[{'all':!![]}];}return db[_0x1950('0x30')][_0x1950('0x40')](_0x4c19bb);})[_0x1950('0x28')](function(_0x3f2be9){_0x29a593['rows']=_0x3f2be9;return _0x29a593;})[_0x1950('0x28')](respondWithFilteredResult(_0x1afb57,_0x4c19bb))[_0x1950('0x41')](handleError(_0x1afb57,null));};exports[_0x1950('0x42')]=function(_0x2d1903,_0x147c57){var _0x526f83={'raw':!![],'where':{'id':_0x2d1903[_0x1950('0x43')]['id']}},_0xbd187={};_0xbd187[_0x1950('0x34')]=_['keys'](db[_0x1950('0x30')][_0x1950('0x31')]);_0xbd187['query']=_[_0x1950('0x44')](_0x2d1903[_0x1950('0x35')]);_0xbd187['filters']=_[_0x1950('0x36')](_0xbd187['model'],_0xbd187[_0x1950('0x35')]);_0x526f83[_0x1950('0x37')]=_[_0x1950('0x36')](_0xbd187['model'],qs[_0x1950('0x38')](_0x2d1903['query'][_0x1950('0x38')]));_0x526f83[_0x1950('0x37')]=_0x526f83[_0x1950('0x37')]['length']?_0x526f83['attributes']:_0xbd187[_0x1950('0x34')];if(_0x2d1903[_0x1950('0x35')][_0x1950('0x3f')]){_0x526f83[_0x1950('0x45')]=[{'all':!![]}];}_0x526f83=_['merge']({},_0x526f83,_0x2d1903[_0x1950('0x3e')]);return db['AnalyticTreeReport']['find'](_0x526f83)[_0x1950('0x28')](handleEntityNotFound(_0x147c57,null))[_0x1950('0x28')](respondWithResult(_0x147c57,null))[_0x1950('0x41')](handleError(_0x147c57,null));};exports[_0x1950('0x46')]=function(_0x1528fb,_0x2de458){return db['AnalyticTreeReport']['create'](_0x1528fb[_0x1950('0x47')],{})[_0x1950('0x28')](respondWithResult(_0x2de458,0xc9))['catch'](handleError(_0x2de458,null));};exports[_0x1950('0x27')]=function(_0x7cb1a5,_0x5816ee){if(_0x7cb1a5[_0x1950('0x47')]['id']){delete _0x7cb1a5[_0x1950('0x47')]['id'];}return db[_0x1950('0x30')]['find']({'where':{'id':_0x7cb1a5[_0x1950('0x43')]['id']}})[_0x1950('0x28')](handleEntityNotFound(_0x5816ee,null))['then'](saveUpdates(_0x7cb1a5[_0x1950('0x47')],null))['then'](respondWithResult(_0x5816ee,null))[_0x1950('0x41')](handleError(_0x5816ee,null));};exports['destroy']=function(_0x303b4e,_0x3ef8ac){return db[_0x1950('0x30')][_0x1950('0x48')]({'where':{'id':_0x303b4e['params']['id']}})[_0x1950('0x28')](handleEntityNotFound(_0x3ef8ac,null))[_0x1950('0x28')](removeEntity(_0x3ef8ac,null))['catch'](handleError(_0x3ef8ac,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 34d36a9..af78e62 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 _0xaf68=['../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','request-promise','path'];(function(_0x60bdc0,_0x350d76){var _0x39ece1=function(_0x3ada47){while(--_0x3ada47){_0x60bdc0['push'](_0x60bdc0['shift']());}};_0x39ece1(++_0x350d76);}(_0xaf68,0x1cf));var _0x8af6=function(_0x43fdd3,_0x275f0c){_0x43fdd3=_0x43fdd3-0x0;var _0x4e7c03=_0xaf68[_0x43fdd3];return _0x4e7c03;};'use strict';var _=require(_0x8af6('0x0'));var util=require('util');var logger=require(_0x8af6('0x1'))(_0x8af6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8af6('0x3'));var fs=require('fs');var path=require(_0x8af6('0x4'));var rimraf=require('rimraf');var config=require(_0x8af6('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0x8af6('0x6')]=function(_0x520698,_0x2569bc){return _0x520698['define'](_0x8af6('0x7'),attributes,{'tableName':_0x8af6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7941=['path','rimraf','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7941,0x1ce));var _0x1794=function(_0x17f5df,_0x27b10c){_0x17f5df=_0x17f5df-0x0;var _0x273bc7=_0x7941[_0x17f5df];return _0x273bc7;};'use strict';var _=require(_0x1794('0x0'));var util=require(_0x1794('0x1'));var logger=require(_0x1794('0x2'))(_0x1794('0x3'));var moment=require('moment');var BPromise=require(_0x1794('0x4'));var rp=require(_0x1794('0x5'));var fs=require('fs');var path=require(_0x1794('0x6'));var rimraf=require(_0x1794('0x7'));var config=require('../../config/environment');var attributes=require(_0x1794('0x8'));module[_0x1794('0x9')]=function(_0x369b27,_0x40a834){return _0x369b27[_0x1794('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x1794('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 38b2a20..5914c54 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x89cf24,_0x217ee8){var _0x42a9fd=function(_0x426489){while(--_0x426489){_0x89cf24['push'](_0x89cf24['shift']());}};_0x42a9fd(++_0x217ee8);}(_0x2ef3,0xba));var _0x32ef=function(_0x4d8e1a,_0x52c766){_0x4d8e1a=_0x4d8e1a-0x0;var _0x183f73=_0x2ef3[_0x4d8e1a];return _0x183f73;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3a94c9,_0x375448){var _0x1622e7=function(_0x3d2ad2){while(--_0x3d2ad2){_0x3a94c9['push'](_0x3a94c9['shift']());}};_0x1622e7(++_0x375448);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3afb31,_0x324f2a){_0x3afb31=_0x3afb31-0x0;var _0x4a0a8b=_0x5f2f[_0x3afb31];return _0x4a0a8b;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index d93b5a8..d578ea4 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 _0xe225=['show','post','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id'];(function(_0x2fb348,_0x1c536d){var _0x58b929=function(_0x58fc89){while(--_0x58fc89){_0x2fb348['push'](_0x2fb348['shift']());}};_0x58b929(++_0x1c536d);}(_0xe225,0x181));var _0x5e22=function(_0x295771,_0x11e035){_0x295771=_0x295771-0x0;var _0x5130ee=_0xe225[_0x295771];return _0x5130ee;};'use strict';var multer=require(_0x5e22('0x0'));var util=require(_0x5e22('0x1'));var path=require(_0x5e22('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e22('0x3')]();var fs_extra=require(_0x5e22('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5e22('0x5'));var config=require('../../config/environment');var controller=require(_0x5e22('0x6'));router[_0x5e22('0x7')]('/',auth[_0x5e22('0x8')](),controller[_0x5e22('0x9')]);router['get'](_0x5e22('0xa'),auth[_0x5e22('0x8')](),controller[_0x5e22('0xb')]);router[_0x5e22('0xc')]('/',auth['isAuthenticated'](),controller[_0x5e22('0xd')]);router[_0x5e22('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5e22('0xf')]);router[_0x5e22('0x10')](_0x5e22('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5e22('0x11')]=router;
\ No newline at end of file
+var _0x8874=['express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','/:id','show','post','create','put','delete','destroy','util','path'];(function(_0x133fa0,_0x753f0c){var _0x169817=function(_0x3e5edc){while(--_0x3e5edc){_0x133fa0['push'](_0x133fa0['shift']());}};_0x169817(++_0x753f0c);}(_0x8874,0xee));var _0x4887=function(_0xde00f5,_0x2635aa){_0xde00f5=_0xde00f5-0x0;var _0x93f684=_0x8874[_0xde00f5];return _0x93f684;};'use strict';var multer=require('multer');var util=require(_0x4887('0x0'));var path=require(_0x4887('0x1'));var timeout=require('connect-timeout');var express=require(_0x4887('0x2'));var router=express[_0x4887('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4887('0x4'));var interaction=require(_0x4887('0x5'));var config=require('../../config/environment');var controller=require(_0x4887('0x6'));router['get']('/',auth[_0x4887('0x7')](),controller['index']);router['get'](_0x4887('0x8'),auth[_0x4887('0x7')](),controller[_0x4887('0x9')]);router[_0x4887('0xa')]('/',auth[_0x4887('0x7')](),controller[_0x4887('0xb')]);router[_0x4887('0xc')](_0x4887('0x8'),auth[_0x4887('0x7')](),controller['update']);router[_0x4887('0xd')](_0x4887('0x8'),auth[_0x4887('0x7')](),controller[_0x4887('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 8566fc2..bf0bd60 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 _0xffe1=['STRING','sequelize','exports'];(function(_0x5dff0c,_0x2bdeb4){var _0x15615f=function(_0x22956e){while(--_0x22956e){_0x5dff0c['push'](_0x5dff0c['shift']());}};_0x15615f(++_0x2bdeb4);}(_0xffe1,0x175));var _0x1ffe=function(_0x3ac442,_0x252283){_0x3ac442=_0x3ac442-0x0;var _0x199070=_0xffe1[_0x3ac442];return _0x199070;};'use strict';var Sequelize=require(_0x1ffe('0x0'));module[_0x1ffe('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1ffe('0x2')]}};
\ No newline at end of file
+var _0xb4e6=['sequelize','exports','STRING'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0xb4e6[_0x456032];return _0x1a53cd;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module[_0x6b4e('0x1')]={'name':{'type':Sequelize[_0x6b4e('0x2')]},'basename':{'type':Sequelize[_0x6b4e('0x2')]},'type':{'type':Sequelize[_0x6b4e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index f59e96b..20dd86c 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 _0x775b=['create','update','originalname','basename','file','filename','findOne','ChatOfflineMessageId','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','VIRTUAL','filter','merge','options','Attachment','includeAll','include','findAll','catch','params','find','clone','get','omit','createdAt','body','updatedAt'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0x775b,0xb4));var _0xb775=function(_0x53f1c1,_0x6f6512){_0x53f1c1=_0x53f1c1-0x0;var _0x464d14=_0x775b[_0x53f1c1];return _0x464d14;};'use strict';var emlformat=require(_0xb775('0x0'));var rimraf=require(_0xb775('0x1'));var zipdir=require(_0xb775('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb775('0x3'));var moment=require(_0xb775('0x4'));var BPromise=require(_0xb775('0x5'));var Mustache=require(_0xb775('0x6'));var util=require('util');var path=require(_0xb775('0x7'));var sox=require(_0xb775('0x8'));var csv=require(_0xb775('0x9'));var ejs=require(_0xb775('0xa'));var fs=require('fs');var fs_extra=require(_0xb775('0xb'));var _=require('lodash');var squel=require(_0xb775('0xc'));var crypto=require(_0xb775('0xd'));var jsforce=require(_0xb775('0xe'));var deskjs=require(_0xb775('0xf'));var toCsv=require(_0xb775('0x9'));var querystring=require('querystring');var Papa=require(_0xb775('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb775('0x11'));var logger=require(_0xb775('0x12'))(_0xb775('0x13'));var utils=require(_0xb775('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb775('0x15'))['db'];function respondWithStatusCode(_0xe890d,_0x1a690c){_0x1a690c=_0x1a690c||0xcc;return function(_0x931114){if(_0x931114){return _0xe890d[_0xb775('0x16')](_0x1a690c);}return _0xe890d[_0xb775('0x17')](_0x1a690c)['end']();};}function respondWithResult(_0x4b0a22,_0x2c3df5){_0x2c3df5=_0x2c3df5||0xc8;return function(_0x465832){if(_0x465832){return _0x4b0a22[_0xb775('0x17')](_0x2c3df5)['json'](_0x465832);}};}function respondWithFilteredResult(_0x493239,_0x2bf6db){return function(_0x15382f){if(_0x15382f){var _0x523715=typeof _0x2bf6db[_0xb775('0x18')]===_0xb775('0x19')&&typeof _0x2bf6db[_0xb775('0x1a')]===_0xb775('0x19');var _0x4ccbd1=_0x15382f['count'];var _0xba454a=_0x523715?0x0:_0x2bf6db['offset'];var _0x121ad7=_0x523715?_0x15382f[_0xb775('0x1b')]:_0x2bf6db[_0xb775('0x18')]+_0x2bf6db[_0xb775('0x1a')];var _0x388c0d;if(_0x121ad7>=_0x4ccbd1){_0x121ad7=_0x4ccbd1;_0x388c0d=0xc8;}else{_0x388c0d=0xce;}_0x493239[_0xb775('0x17')](_0x388c0d);return _0x493239[_0xb775('0x1c')](_0xb775('0x1d'),_0xba454a+'-'+_0x121ad7+'/'+_0x4ccbd1)[_0xb775('0x1e')](_0x15382f);}return null;};}function patchUpdates(_0x448197){return function(_0x218e22){try{jsonpatch[_0xb775('0x1f')](_0x218e22,_0x448197,!![]);}catch(_0x1a3de2){return BPromise[_0xb775('0x20')](_0x1a3de2);}return _0x218e22[_0xb775('0x21')]();};}function saveUpdates(_0x13f2c2,_0x323af3){return function(_0x1df0bc){if(_0x1df0bc){return _0x1df0bc['update'](_0x13f2c2)[_0xb775('0x22')](function(_0x723d82){return _0x723d82;});}return null;};}function removeEntity(_0x11fcc0,_0x5ddd6e){return function(_0x583c74){if(_0x583c74){return _0x583c74[_0xb775('0x23')]()[_0xb775('0x22')](function(){_0x11fcc0['status'](0xcc)[_0xb775('0x24')]();});}};}function handleEntityNotFound(_0x311265,_0xdffb39){return function(_0x5a0388){if(!_0x5a0388){_0x311265[_0xb775('0x16')](0x194);}return _0x5a0388;};}function handleError(_0x37c4be,_0x46c350){_0x46c350=_0x46c350||0x1f4;return function(_0x34ec90){logger[_0xb775('0x25')](_0x34ec90[_0xb775('0x26')]);if(_0x34ec90[_0xb775('0x27')]){delete _0x34ec90[_0xb775('0x27')];}_0x37c4be[_0xb775('0x17')](_0x46c350)['send'](_0x34ec90);};}exports[_0xb775('0x28')]=function(_0x3d07f2,_0x2caae8){var _0x5e63ea={},_0x346fe6={},_0x5d9bfa={'count':0x0,'rows':[]};var _0x21154f=_['map'](db['Attachment'][_0xb775('0x29')],function(_0x5440aa){return{'name':_0x5440aa['fieldName'],'type':_0x5440aa[_0xb775('0x2a')][_0xb775('0x2b')]};});_0x346fe6[_0xb775('0x2c')]=_['map'](_0x21154f,_0xb775('0x27'));_0x346fe6[_0xb775('0x2d')]=_[_0xb775('0x2e')](_0x3d07f2[_0xb775('0x2d')]);_0x346fe6[_0xb775('0x2f')]=_[_0xb775('0x30')](_0x346fe6[_0xb775('0x2c')],_0x346fe6['query']);_0x5e63ea[_0xb775('0x31')]=_[_0xb775('0x30')](_0x346fe6[_0xb775('0x2c')],qs[_0xb775('0x32')](_0x3d07f2[_0xb775('0x2d')][_0xb775('0x32')]));_0x5e63ea['attributes']=_0x5e63ea['attributes'][_0xb775('0x33')]?_0x5e63ea[_0xb775('0x31')]:_0x346fe6[_0xb775('0x2c')];if(!_0x3d07f2[_0xb775('0x2d')][_0xb775('0x34')]('nolimit')){_0x5e63ea[_0xb775('0x1a')]=qs[_0xb775('0x1a')](_0x3d07f2['query'][_0xb775('0x1a')]);_0x5e63ea[_0xb775('0x18')]=qs['offset'](_0x3d07f2[_0xb775('0x2d')]['offset']);}_0x5e63ea[_0xb775('0x35')]=qs['sort'](_0x3d07f2[_0xb775('0x2d')][_0xb775('0x36')]);_0x5e63ea[_0xb775('0x37')]=qs[_0xb775('0x2f')](_[_0xb775('0x38')](_0x3d07f2[_0xb775('0x2d')],_0x346fe6[_0xb775('0x2f')]),_0x21154f);if(_0x3d07f2[_0xb775('0x2d')]['filter']){_0x5e63ea['where']=_['merge'](_0x5e63ea[_0xb775('0x37')],{'$or':_[_0xb775('0x39')](_0x21154f,function(_0x48888e){if(_0x48888e['type']!==_0xb775('0x3a')){var _0xe7ea21={};_0xe7ea21[_0x48888e[_0xb775('0x27')]]={'$like':'%'+_0x3d07f2[_0xb775('0x2d')][_0xb775('0x3b')]+'%'};return _0xe7ea21;}})});}_0x5e63ea=_[_0xb775('0x3c')]({},_0x5e63ea,_0x3d07f2[_0xb775('0x3d')]);var _0x17dafe={'where':_0x5e63ea[_0xb775('0x37')]};return db[_0xb775('0x3e')][_0xb775('0x1b')](_0x17dafe)[_0xb775('0x22')](function(_0x4defc5){_0x5d9bfa[_0xb775('0x1b')]=_0x4defc5;if(_0x3d07f2[_0xb775('0x2d')][_0xb775('0x3f')]){_0x5e63ea[_0xb775('0x40')]=[{'all':!![]}];}return db['Attachment'][_0xb775('0x41')](_0x5e63ea);})[_0xb775('0x22')](function(_0x267d7b){_0x5d9bfa['rows']=_0x267d7b;return _0x5d9bfa;})[_0xb775('0x22')](respondWithFilteredResult(_0x2caae8,_0x5e63ea))[_0xb775('0x42')](handleError(_0x2caae8,null));};exports['show']=function(_0x3f6911,_0x368a6b){var _0x3f5fb0={'raw':!![],'where':{'id':_0x3f6911[_0xb775('0x43')]['id']}},_0x37f9b2={};_0x37f9b2[_0xb775('0x2c')]=_[_0xb775('0x2e')](db[_0xb775('0x3e')][_0xb775('0x29')]);_0x37f9b2[_0xb775('0x2d')]=_['keys'](_0x3f6911[_0xb775('0x2d')]);_0x37f9b2[_0xb775('0x2f')]=_[_0xb775('0x30')](_0x37f9b2[_0xb775('0x2c')],_0x37f9b2[_0xb775('0x2d')]);_0x3f5fb0['attributes']=_[_0xb775('0x30')](_0x37f9b2[_0xb775('0x2c')],qs[_0xb775('0x32')](_0x3f6911[_0xb775('0x2d')]['fields']));_0x3f5fb0['attributes']=_0x3f5fb0[_0xb775('0x31')][_0xb775('0x33')]?_0x3f5fb0[_0xb775('0x31')]:_0x37f9b2[_0xb775('0x2c')];if(_0x3f6911['query']['includeAll']){_0x3f5fb0[_0xb775('0x40')]=[{'all':!![]}];}_0x3f5fb0=_['merge']({},_0x3f5fb0,_0x3f6911[_0xb775('0x3d')]);return db['Attachment'][_0xb775('0x44')](_0x3f5fb0)[_0xb775('0x22')](handleEntityNotFound(_0x368a6b,null))['then'](respondWithResult(_0x368a6b,null))[_0xb775('0x42')](handleError(_0x368a6b,null));};exports[_0xb775('0x45')]=function(_0x5c0292,_0x1734ea){var _0x300b5e={'where':{'id':_0x5c0292['params']['id']}},_0x2755eb={};_0x2755eb[_0xb775('0x2c')]=_[_0xb775('0x2e')](db[_0xb775('0x3e')][_0xb775('0x29')]);_0x300b5e[_0xb775('0x31')]=_['intersection'](_0x2755eb[_0xb775('0x2c')],qs[_0xb775('0x32')](_0x5c0292['query']['fields']));_0x300b5e[_0xb775('0x31')]=_0x300b5e[_0xb775('0x31')]['length']?_0x300b5e['attributes']:_0x2755eb[_0xb775('0x2c')];if(_0x5c0292[_0xb775('0x2d')][_0xb775('0x3f')]){_0x300b5e[_0xb775('0x40')]=[{'all':!![]}];}_0x300b5e=_[_0xb775('0x3c')]({},_0x300b5e,_0x5c0292[_0xb775('0x3d')]);return db[_0xb775('0x3e')][_0xb775('0x44')](_0x300b5e)[_0xb775('0x22')](handleEntityNotFound(_0x1734ea,null))['then'](function(_0x2db19e){if(_0x2db19e){var _0x7637e1=_0x2db19e[_0xb775('0x46')]({'plain':!![]});_0x7637e1=qs[_0xb775('0x47')](_0x7637e1,['id',_0xb775('0x48'),'updatedAt']);_0x5c0292['body']=_[_0xb775('0x47')](_0x5c0292[_0xb775('0x49')],['id',_0xb775('0x48'),_0xb775('0x4a')]);return db[_0xb775('0x3e')][_0xb775('0x4b')](_[_0xb775('0x3c')](_0x7637e1,_0x5c0292[_0xb775('0x49')]),{'include':_0x5c0292[_0xb775('0x2d')][_0xb775('0x3f')]?[{'all':!![]}]:undefined});}})[_0xb775('0x22')](respondWithResult(_0x1734ea,0xc9))[_0xb775('0x42')](handleError(_0x1734ea,null));};exports[_0xb775('0x4c')]=function(_0xf4ee97,_0x300534){if(_0xf4ee97[_0xb775('0x49')]['id']){delete _0xf4ee97[_0xb775('0x49')]['id'];}return db[_0xb775('0x3e')][_0xb775('0x44')]({'where':{'id':_0xf4ee97[_0xb775('0x43')]['id']}})[_0xb775('0x22')](handleEntityNotFound(_0x300534,null))['then'](saveUpdates(_0xf4ee97['body'],null))[_0xb775('0x22')](respondWithResult(_0x300534,null))[_0xb775('0x42')](handleError(_0x300534,null));};exports['destroy']=function(_0x545147,_0x192826){return db[_0xb775('0x3e')][_0xb775('0x44')]({'where':{'id':_0x545147[_0xb775('0x43')]['id']}})['then'](handleEntityNotFound(_0x192826,null))[_0xb775('0x22')](removeEntity(_0x192826,null))[_0xb775('0x42')](handleError(_0x192826,null));};exports[_0xb775('0x4b')]=function(_0x296d86,_0x48354b,_0x28a2ba){_0x296d86[_0xb775('0x49')][_0xb775('0x27')]=_0x296d86['file'][_0xb775('0x4d')];_0x296d86['body'][_0xb775('0x4e')]=_0x296d86[_0xb775('0x4f')][_0xb775('0x50')];_0x296d86['body'][_0xb775('0x2a')]=_0x296d86['file']['mimetype'];return db[_0xb775('0x3e')][_0xb775('0x4b')](_0x296d86['body'])[_0xb775('0x22')](respondWithResult(_0x48354b,0xc9))[_0xb775('0x42')](handleError(_0x48354b,null));};exports['download']=function(_0xc09cdc,_0xc2cbf3,_0x3f532a){return db[_0xb775('0x3e')][_0xb775('0x51')]({'where':{'id':_0xc09cdc[_0xb775('0x43')]['id']},'raw':!![]})[_0xb775('0x22')](handleEntityNotFound(_0xc2cbf3,null))[_0xb775('0x22')](function(_0x51d193){if(_0x51d193){var _0x1a22a2=_0x51d193[_0xb775('0x52')]!==null;var _0x424ede=path['join'](config['root'],'server/files/attachments/');if(_0x1a22a2){_0x424ede=path[_0xb775('0x53')](_0x424ede,_0xb775('0x54'));}var _0x37742b=path[_0xb775('0x53')](_0x424ede,_0x51d193[_0xb775('0x4e')]);return _0xc2cbf3['download'](_0x37742b);}})['catch'](handleError(_0xc2cbf3,null));};
\ No newline at end of file
+var _0xc2da=['filters','pick','filter','merge','options','include','findAll','rows','includeAll','find','catch','clone','params','rawAttributes','omit','createdAt','updatedAt','create','body','update','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','then','destroy','error','stack','name','index','map','Attachment','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x553851,_0x4b5f21){var _0x13672e=function(_0x2d6b41){while(--_0x2d6b41){_0x553851['push'](_0x553851['shift']());}};_0x13672e(++_0x4b5f21);}(_0xc2da,0xcb));var _0xac2d=function(_0x250c78,_0x25b838){_0x250c78=_0x250c78-0x0;var _0x44f07a=_0xc2da[_0x250c78];return _0x44f07a;};'use strict';var emlformat=require(_0xac2d('0x0'));var rimraf=require(_0xac2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac2d('0x2'));var rp=require('request-promise');var moment=require(_0xac2d('0x3'));var BPromise=require(_0xac2d('0x4'));var Mustache=require(_0xac2d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xac2d('0x6'));var csv=require(_0xac2d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac2d('0x8'));var _=require(_0xac2d('0x9'));var squel=require(_0xac2d('0xa'));var crypto=require(_0xac2d('0xb'));var jsforce=require(_0xac2d('0xc'));var deskjs=require(_0xac2d('0xd'));var toCsv=require(_0xac2d('0x7'));var querystring=require(_0xac2d('0xe'));var Papa=require(_0xac2d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xac2d('0x10'));var as=require(_0xac2d('0x11'));var hardwareService=require(_0xac2d('0x12'));var logger=require(_0xac2d('0x13'))('api');var utils=require(_0xac2d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac2d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21cb40,_0x7d21fd){_0x7d21fd=_0x7d21fd||0xcc;return function(_0x1ee408){if(_0x1ee408){return _0x21cb40[_0xac2d('0x16')](_0x7d21fd);}return _0x21cb40[_0xac2d('0x17')](_0x7d21fd)[_0xac2d('0x18')]();};}function respondWithResult(_0x296c77,_0x5c3dd5){_0x5c3dd5=_0x5c3dd5||0xc8;return function(_0x4f9d6c){if(_0x4f9d6c){return _0x296c77['status'](_0x5c3dd5)['json'](_0x4f9d6c);}};}function respondWithFilteredResult(_0x539b47,_0x28007){return function(_0x4b20ad){if(_0x4b20ad){var _0x47fd13=typeof _0x28007['offset']===_0xac2d('0x19')&&typeof _0x28007[_0xac2d('0x1a')]===_0xac2d('0x19');var _0x1de7bd=_0x4b20ad[_0xac2d('0x1b')];var _0xd73b4=_0x47fd13?0x0:_0x28007[_0xac2d('0x1c')];var _0x1ff689=_0x47fd13?_0x4b20ad[_0xac2d('0x1b')]:_0x28007[_0xac2d('0x1c')]+_0x28007[_0xac2d('0x1a')];var _0x2976eb;if(_0x1ff689>=_0x1de7bd){_0x1ff689=_0x1de7bd;_0x2976eb=0xc8;}else{_0x2976eb=0xce;}_0x539b47[_0xac2d('0x17')](_0x2976eb);return _0x539b47[_0xac2d('0x1d')](_0xac2d('0x1e'),_0xd73b4+'-'+_0x1ff689+'/'+_0x1de7bd)[_0xac2d('0x1f')](_0x4b20ad);}return null;};}function patchUpdates(_0x1525c5){return function(_0x11646d){try{jsonpatch['apply'](_0x11646d,_0x1525c5,!![]);}catch(_0x33fc13){return BPromise[_0xac2d('0x20')](_0x33fc13);}return _0x11646d['save']();};}function saveUpdates(_0x4c2348,_0x584e03){return function(_0x3a5f1a){if(_0x3a5f1a){return _0x3a5f1a['update'](_0x4c2348)[_0xac2d('0x21')](function(_0x5bde51){return _0x5bde51;});}return null;};}function removeEntity(_0x5c6630,_0x19c26c){return function(_0x1e307e){if(_0x1e307e){return _0x1e307e[_0xac2d('0x22')]()['then'](function(){_0x5c6630[_0xac2d('0x17')](0xcc)[_0xac2d('0x18')]();});}};}function handleEntityNotFound(_0x25bdff,_0xd6d881){return function(_0x1dfada){if(!_0x1dfada){_0x25bdff[_0xac2d('0x16')](0x194);}return _0x1dfada;};}function handleError(_0x28267b,_0x35834f){_0x35834f=_0x35834f||0x1f4;return function(_0x12a66e){logger[_0xac2d('0x23')](_0x12a66e[_0xac2d('0x24')]);if(_0x12a66e[_0xac2d('0x25')]){delete _0x12a66e[_0xac2d('0x25')];}_0x28267b['status'](_0x35834f)['send'](_0x12a66e);};}exports[_0xac2d('0x26')]=function(_0x30f8d2,_0x4a466a){var _0x4eb6e5={},_0x5b1721={},_0x16ab6b={'count':0x0,'rows':[]};var _0x27daa7=_[_0xac2d('0x27')](db[_0xac2d('0x28')]['rawAttributes'],function(_0x2c8d31){return{'name':_0x2c8d31[_0xac2d('0x29')],'type':_0x2c8d31[_0xac2d('0x2a')]['key']};});_0x5b1721[_0xac2d('0x2b')]=_[_0xac2d('0x27')](_0x27daa7,_0xac2d('0x25'));_0x5b1721[_0xac2d('0x2c')]=_[_0xac2d('0x2d')](_0x30f8d2[_0xac2d('0x2c')]);_0x5b1721['filters']=_[_0xac2d('0x2e')](_0x5b1721[_0xac2d('0x2b')],_0x5b1721[_0xac2d('0x2c')]);_0x4eb6e5['attributes']=_[_0xac2d('0x2e')](_0x5b1721[_0xac2d('0x2b')],qs[_0xac2d('0x2f')](_0x30f8d2[_0xac2d('0x2c')]['fields']));_0x4eb6e5[_0xac2d('0x30')]=_0x4eb6e5[_0xac2d('0x30')][_0xac2d('0x31')]?_0x4eb6e5['attributes']:_0x5b1721[_0xac2d('0x2b')];if(!_0x30f8d2[_0xac2d('0x2c')][_0xac2d('0x32')](_0xac2d('0x33'))){_0x4eb6e5[_0xac2d('0x1a')]=qs[_0xac2d('0x1a')](_0x30f8d2['query'][_0xac2d('0x1a')]);_0x4eb6e5[_0xac2d('0x1c')]=qs[_0xac2d('0x1c')](_0x30f8d2[_0xac2d('0x2c')][_0xac2d('0x1c')]);}_0x4eb6e5[_0xac2d('0x34')]=qs[_0xac2d('0x35')](_0x30f8d2[_0xac2d('0x2c')][_0xac2d('0x35')]);_0x4eb6e5[_0xac2d('0x36')]=qs[_0xac2d('0x37')](_[_0xac2d('0x38')](_0x30f8d2[_0xac2d('0x2c')],_0x5b1721[_0xac2d('0x37')]),_0x27daa7);if(_0x30f8d2[_0xac2d('0x2c')][_0xac2d('0x39')]){_0x4eb6e5[_0xac2d('0x36')]=_[_0xac2d('0x3a')](_0x4eb6e5[_0xac2d('0x36')],{'$or':_[_0xac2d('0x27')](_0x27daa7,function(_0x33ee79){if(_0x33ee79[_0xac2d('0x2a')]!=='VIRTUAL'){var _0x9204c9={};_0x9204c9[_0x33ee79[_0xac2d('0x25')]]={'$like':'%'+_0x30f8d2['query'][_0xac2d('0x39')]+'%'};return _0x9204c9;}})});}_0x4eb6e5=_[_0xac2d('0x3a')]({},_0x4eb6e5,_0x30f8d2[_0xac2d('0x3b')]);var _0x5a1c32={'where':_0x4eb6e5['where']};return db[_0xac2d('0x28')]['count'](_0x5a1c32)[_0xac2d('0x21')](function(_0xd2e8f3){_0x16ab6b['count']=_0xd2e8f3;if(_0x30f8d2[_0xac2d('0x2c')]['includeAll']){_0x4eb6e5[_0xac2d('0x3c')]=[{'all':!![]}];}return db[_0xac2d('0x28')][_0xac2d('0x3d')](_0x4eb6e5);})['then'](function(_0x312b01){_0x16ab6b[_0xac2d('0x3e')]=_0x312b01;return _0x16ab6b;})[_0xac2d('0x21')](respondWithFilteredResult(_0x4a466a,_0x4eb6e5))['catch'](handleError(_0x4a466a,null));};exports['show']=function(_0x40eea0,_0x412ea1){var _0x340087={'raw':!![],'where':{'id':_0x40eea0['params']['id']}},_0x3f24b8={};_0x3f24b8[_0xac2d('0x2b')]=_[_0xac2d('0x2d')](db[_0xac2d('0x28')]['rawAttributes']);_0x3f24b8['query']=_[_0xac2d('0x2d')](_0x40eea0[_0xac2d('0x2c')]);_0x3f24b8[_0xac2d('0x37')]=_[_0xac2d('0x2e')](_0x3f24b8[_0xac2d('0x2b')],_0x3f24b8[_0xac2d('0x2c')]);_0x340087['attributes']=_['intersection'](_0x3f24b8[_0xac2d('0x2b')],qs['fields'](_0x40eea0[_0xac2d('0x2c')][_0xac2d('0x2f')]));_0x340087[_0xac2d('0x30')]=_0x340087[_0xac2d('0x30')]['length']?_0x340087[_0xac2d('0x30')]:_0x3f24b8[_0xac2d('0x2b')];if(_0x40eea0[_0xac2d('0x2c')][_0xac2d('0x3f')]){_0x340087['include']=[{'all':!![]}];}_0x340087=_[_0xac2d('0x3a')]({},_0x340087,_0x40eea0[_0xac2d('0x3b')]);return db[_0xac2d('0x28')][_0xac2d('0x40')](_0x340087)[_0xac2d('0x21')](handleEntityNotFound(_0x412ea1,null))[_0xac2d('0x21')](respondWithResult(_0x412ea1,null))[_0xac2d('0x41')](handleError(_0x412ea1,null));};exports[_0xac2d('0x42')]=function(_0x1e5fb8,_0x3a7d28){var _0x5d73d2={'where':{'id':_0x1e5fb8[_0xac2d('0x43')]['id']}},_0x58b95b={};_0x58b95b[_0xac2d('0x2b')]=_['keys'](db[_0xac2d('0x28')][_0xac2d('0x44')]);_0x5d73d2[_0xac2d('0x30')]=_['intersection'](_0x58b95b['model'],qs[_0xac2d('0x2f')](_0x1e5fb8[_0xac2d('0x2c')][_0xac2d('0x2f')]));_0x5d73d2[_0xac2d('0x30')]=_0x5d73d2[_0xac2d('0x30')][_0xac2d('0x31')]?_0x5d73d2[_0xac2d('0x30')]:_0x58b95b[_0xac2d('0x2b')];if(_0x1e5fb8[_0xac2d('0x2c')][_0xac2d('0x3f')]){_0x5d73d2[_0xac2d('0x3c')]=[{'all':!![]}];}_0x5d73d2=_['merge']({},_0x5d73d2,_0x1e5fb8[_0xac2d('0x3b')]);return db['Attachment']['find'](_0x5d73d2)[_0xac2d('0x21')](handleEntityNotFound(_0x3a7d28,null))[_0xac2d('0x21')](function(_0x2cb902){if(_0x2cb902){var _0x101313=_0x2cb902['get']({'plain':!![]});_0x101313=qs[_0xac2d('0x45')](_0x101313,['id',_0xac2d('0x46'),_0xac2d('0x47')]);_0x1e5fb8['body']=_[_0xac2d('0x45')](_0x1e5fb8['body'],['id','createdAt',_0xac2d('0x47')]);return db[_0xac2d('0x28')][_0xac2d('0x48')](_[_0xac2d('0x3a')](_0x101313,_0x1e5fb8[_0xac2d('0x49')]),{'include':_0x1e5fb8['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xac2d('0x21')](respondWithResult(_0x3a7d28,0xc9))[_0xac2d('0x41')](handleError(_0x3a7d28,null));};exports[_0xac2d('0x4a')]=function(_0x250a15,_0x3ae25a){if(_0x250a15[_0xac2d('0x49')]['id']){delete _0x250a15[_0xac2d('0x49')]['id'];}return db['Attachment'][_0xac2d('0x40')]({'where':{'id':_0x250a15[_0xac2d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ae25a,null))[_0xac2d('0x21')](saveUpdates(_0x250a15[_0xac2d('0x49')],null))['then'](respondWithResult(_0x3ae25a,null))[_0xac2d('0x41')](handleError(_0x3ae25a,null));};exports[_0xac2d('0x22')]=function(_0x48d420,_0x204bca){return db[_0xac2d('0x28')][_0xac2d('0x40')]({'where':{'id':_0x48d420[_0xac2d('0x43')]['id']}})[_0xac2d('0x21')](handleEntityNotFound(_0x204bca,null))['then'](removeEntity(_0x204bca,null))[_0xac2d('0x41')](handleError(_0x204bca,null));};exports['create']=function(_0x57cf52,_0x44680a,_0x3142db){_0x57cf52[_0xac2d('0x49')][_0xac2d('0x25')]=_0x57cf52[_0xac2d('0x4b')]['originalname'];_0x57cf52[_0xac2d('0x49')][_0xac2d('0x4c')]=_0x57cf52['file'][_0xac2d('0x4d')];_0x57cf52[_0xac2d('0x49')][_0xac2d('0x2a')]=_0x57cf52[_0xac2d('0x4b')][_0xac2d('0x4e')];return db[_0xac2d('0x28')][_0xac2d('0x48')](_0x57cf52[_0xac2d('0x49')])[_0xac2d('0x21')](respondWithResult(_0x44680a,0xc9))['catch'](handleError(_0x44680a,null));};exports[_0xac2d('0x4f')]=function(_0x59cb9a,_0x33c9bc,_0x1006fc){return db['Attachment'][_0xac2d('0x50')]({'where':{'id':_0x59cb9a[_0xac2d('0x43')]['id']},'raw':!![]})[_0xac2d('0x21')](handleEntityNotFound(_0x33c9bc,null))[_0xac2d('0x21')](function(_0x47cfc5){if(_0x47cfc5){var _0x3fa10c=_0x47cfc5[_0xac2d('0x51')]!==null;var _0x270d20=path[_0xac2d('0x52')](config[_0xac2d('0x53')],_0xac2d('0x54'));if(_0x3fa10c){_0x270d20=path[_0xac2d('0x52')](_0x270d20,_0xac2d('0x55'));}var _0x2408e8=path['join'](_0x270d20,_0x47cfc5[_0xac2d('0x4c')]);return _0x33c9bc['download'](_0x2408e8);}})['catch'](handleError(_0x33c9bc,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 712f23b..7603f27 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 _0xf2c1=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./attachment.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2c1,0x122));var _0x1f2c=function(_0x14a205,_0x122dbc){_0x14a205=_0x14a205-0x0;var _0x5e8e21=_0xf2c1[_0x14a205];return _0x5e8e21;};'use strict';var _=require(_0x1f2c('0x0'));var util=require(_0x1f2c('0x1'));var logger=require(_0x1f2c('0x2'))(_0x1f2c('0x3'));var moment=require(_0x1f2c('0x4'));var BPromise=require(_0x1f2c('0x5'));var rp=require(_0x1f2c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1f2c('0x7'));var attributes=require(_0x1f2c('0x8'));module[_0x1f2c('0x9')]=function(_0x12a1a7,_0x49a6b9){return _0x12a1a7[_0x1f2c('0xa')](_0x1f2c('0xb'),attributes,{'tableName':_0x1f2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x68f3=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','attachments'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x68f3,0xa0));var _0x368f=function(_0x8c6e15,_0x511675){_0x8c6e15=_0x8c6e15-0x0;var _0x27c04c=_0x68f3[_0x8c6e15];return _0x27c04c;};'use strict';var _=require(_0x368f('0x0'));var util=require('util');var logger=require(_0x368f('0x1'))('api');var moment=require(_0x368f('0x2'));var BPromise=require(_0x368f('0x3'));var rp=require(_0x368f('0x4'));var fs=require('fs');var path=require(_0x368f('0x5'));var rimraf=require(_0x368f('0x6'));var config=require(_0x368f('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x4b6236,_0x1c90ab){return _0x4b6236[_0x368f('0x8')]('Attachment',attributes,{'tableName':_0x368f('0x9'),'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 86bcdce..1523e32 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 _0x7980=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateAttachment','lodash','util','moment'];(function(_0x4c183f,_0x17495c){var _0x243302=function(_0x4793c9){while(--_0x4793c9){_0x4c183f['push'](_0x4c183f['shift']());}};_0x243302(++_0x17495c);}(_0x7980,0xab));var _0x0798=function(_0xab68d7,_0x2c55c0){_0xab68d7=_0xab68d7-0x0;var _0x3f7154=_0x7980[_0xab68d7];return _0x3f7154;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e534f,_0x34f808,_0x467859){return new BPromise(function(_0x54da10,_0x5151b3){return client[_0x0798('0xb')](_0x1e534f,_0x467859)[_0x0798('0xc')](function(_0x301a55){logger[_0x0798('0xd')](_0x0798('0xe'),_0x34f808,_0x0798('0xf'));logger[_0x0798('0x10')](_0x0798('0x11'),_0x34f808,_0x0798('0xf'),JSON[_0x0798('0x12')](_0x301a55));if(_0x301a55['error']){if(_0x301a55[_0x0798('0x13')][_0x0798('0x14')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x34f808,_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);return _0x5151b3(_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);}logger[_0x0798('0x13')](_0x0798('0xe'),_0x34f808,_0x301a55[_0x0798('0x13')]['message']);return _0x54da10(_0x301a55['error'][_0x0798('0x15')]);}else{logger[_0x0798('0xd')]('Attachment,\x20%s,\x20%s',_0x34f808,'request\x20sent');_0x54da10(_0x301a55[_0x0798('0x16')][_0x0798('0x15')]);}})[_0x0798('0x17')](function(_0x5dc617){logger['error'](_0x0798('0xe'),_0x34f808,_0x5dc617);_0x5151b3(_0x5dc617);});});}exports['CreateAttachment']=function(_0x41e217){var _0x46e74c=this;return new Promise(function(_0x288f41,_0x145197){return db['Attachment'][_0x0798('0x18')](_0x41e217[_0x0798('0x19')],{'raw':_0x41e217['options']?_0x41e217[_0x0798('0x1a')][_0x0798('0x1b')]===undefined?!![]:![]:!![]})[_0x0798('0xc')](function(_0x44ac33){logger[_0x0798('0xd')](_0x0798('0x1c'),_0x41e217);logger[_0x0798('0x10')](_0x0798('0x1c'),_0x41e217,JSON[_0x0798('0x12')](_0x44ac33));_0x288f41(_0x44ac33);})['catch'](function(_0x2aaabf){logger[_0x0798('0x13')](_0x0798('0x1c'),_0x2aaabf[_0x0798('0x15')],_0x41e217);_0x145197(_0x46e74c[_0x0798('0x13')](0x1f4,_0x2aaabf[_0x0798('0x15')]));});});};
\ No newline at end of file
+var _0x5c12=['CreateAttachment','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','info','options','raw'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x5c12,0x188));var _0x25c1=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0x5c12[_0x37d3f3];return _0x185c9c;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('Attachment,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('Attachment,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('Attachment,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});}exports['CreateAttachment']=function(_0x61a29f){var _0x4c0d49=this;return new Promise(function(_0x7175d4,_0x23a418){return db['Attachment']['create'](_0x61a29f['body'],{'raw':_0x61a29f[_0x25c1('0x14')]?_0x61a29f[_0x25c1('0x14')][_0x25c1('0x15')]===undefined?!![]:![]:!![]})[_0x25c1('0xc')](function(_0x481c12){logger[_0x25c1('0x13')](_0x25c1('0x16'),_0x61a29f);logger[_0x25c1('0xf')](_0x25c1('0x16'),_0x61a29f,JSON['stringify'](_0x481c12));_0x7175d4(_0x481c12);})['catch'](function(_0x2a8a84){logger[_0x25c1('0x11')](_0x25c1('0x16'),_0x2a8a84[_0x25c1('0x12')],_0x61a29f);_0x23a418(_0x4c0d49[_0x25c1('0x11')](0x1f4,_0x2a8a84[_0x25c1('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 900067f..20026c0 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 _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(_0x6ac818,_0x1d54cf){var _0x53e672=function(_0x3520ed){while(--_0x3520ed){_0x6ac818['push'](_0x6ac818['shift']());}};_0x53e672(++_0x1d54cf);}(_0x2032,0xd9));var _0x2203=function(_0x3201fe,_0x3de53c){_0x3201fe=_0x3201fe-0x0;var _0x2078f6=_0x2032[_0x3201fe];return _0x2078f6;};'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
+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(_0x31b307,_0x3ae2cc){_0x31b307=_0x31b307-0x0;var _0x337cd0=_0xdb28[_0x31b307];return _0x337cd0;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index da4bd18..ea77a5b 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 _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);}));
\ No newline at end of file
+var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 99adfef..33c21b9 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 _0x78a1=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x78a1,0xec));var _0x178a=function(_0x6dc2ea,_0x1f47b6){_0x6dc2ea=_0x6dc2ea-0x0;var _0x292f75=_0x78a1[_0x6dc2ea];return _0x292f75;};'use strict';var express=require('express');var router=express[_0x178a('0x0')]();var controller=require(_0x178a('0x1'));router[_0x178a('0x2')]('/',controller[_0x178a('0x3')]);module[_0x178a('0x4')]=router;
\ No newline at end of file
+var _0xa2a0=['post','login','Router','./authActiveDirectory.controller'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0xa2a0,0x182));var _0x0a2a=function(_0xb638a8,_0x12a581){_0xb638a8=_0xb638a8-0x0;var _0x42f193=_0xa2a0[_0xb638a8];return _0x42f193;};'use strict';var express=require('express');var router=express[_0x0a2a('0x0')]();var controller=require(_0x0a2a('0x1'));router[_0x0a2a('0x2')]('/',controller[_0x0a2a('0x3')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index c75c658..b9125bf 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(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x7a54,0x106));var _0x47a5=function(_0x317ed1,_0xf30c53){_0x317ed1=_0x317ed1-0x0;var _0x3579a7=_0x7a54[_0x317ed1];return _0x3579a7;};'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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4a668a,_0x204bba){var _0x43d0b6=function(_0x532416){while(--_0x532416){_0x4a668a['push'](_0x4a668a['shift']());}};_0x43d0b6(++_0x204bba);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index b026b4f..a1b98b3 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 _0x8a06=['login','/callback','callback','exports','express','passport','Router','../../components/auth/service','get'];(function(_0x5843c1,_0x372d51){var _0x56fbcd=function(_0x4dfc2a){while(--_0x4dfc2a){_0x5843c1['push'](_0x5843c1['shift']());}};_0x56fbcd(++_0x372d51);}(_0x8a06,0x1c6));var _0x68a0=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x8a06[_0x16de68];return _0x1c277e;};'use strict';var express=require(_0x68a0('0x0'));var passport=require(_0x68a0('0x1'));var router=express[_0x68a0('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x68a0('0x3'));router[_0x68a0('0x4')]('/',controller[_0x68a0('0x5')]);router[_0x68a0('0x4')](_0x68a0('0x6'),controller[_0x68a0('0x7')],authService['isMiddleware'],userController[_0x68a0('0x5')],authService['setTokenCookie']);module[_0x68a0('0x8')]=router;
\ No newline at end of file
+var _0xa6fa=['passport','Router','./authGoogle.controller','get','/callback','callback','login','exports'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0xa6fa,0x130));var _0xaa6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa6fa[_0x14add3];return _0x4a174f;};'use strict';var express=require('express');var passport=require(_0xaa6f('0x0'));var router=express[_0xaa6f('0x1')]();var controller=require(_0xaa6f('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xaa6f('0x3')]('/',controller['login']);router[_0xaa6f('0x3')](_0xaa6f('0x4'),controller[_0xaa6f('0x5')],authService['isMiddleware'],userController[_0xaa6f('0x6')],authService['setTokenCookie']);module[_0xaa6f('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 806a1b3..2d37129 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 _0x1260=['host','port','secure','auth','pass','merge','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','email','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','find','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordExpires','Password\x20reset!','use','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','then','name','salt','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','service'];(function(_0x2c48df,_0x46e91c){var _0x5f223a=function(_0x11f763){while(--_0x11f763){_0x2c48df['push'](_0x2c48df['shift']());}};_0x5f223a(++_0x46e91c);}(_0x1260,0x184));var _0x0126=function(_0x2a64e5,_0x138274){_0x2a64e5=_0x2a64e5-0x0;var _0x2a2e0c=_0x1260[_0x2a64e5];return _0x2a2e0c;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')[_0x0126('0x0')];var jayson=require('jayson/promise');var _=require(_0x0126('0x1'));var rs=require('randomstring');var moment=require(_0x0126('0x2'));var db=require(_0x0126('0x3'))['db'];var authService=require(_0x0126('0x4'));var utils=require(_0x0126('0x5'));var client=jayson[_0x0126('0x6')][_0x0126('0x7')]({'port':0x232b});function localAuthenticate(_0x143372,_0x1c53bd,_0x12b584,_0x5b9749){var _0x1c438f,_0x1ba604;return db[_0x0126('0x8')][_0x0126('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x0126('0xa')](function(_0x1cc7ba){_0x1c438f=_0x1cc7ba;return _0x143372[_0x0126('0x9')]({'attributes':['id',_0x0126('0xb'),'password',_0x0126('0xc'),'role','disabled',_0x0126('0xd'),_0x0126('0xe'),_0x0126('0xf')],'where':{'name':_0x1c53bd,'role':{'$or':[_0x0126('0x10'),_0x0126('0x11'),_0x0126('0x12')]}}});})[_0x0126('0xa')](function(_0x28e26d){if(!_0x28e26d||_0x28e26d&&_0x28e26d[_0x0126('0xb')]!==_0x1c53bd){throw new Error(_0x0126('0x13'));}else{_0x1ba604=_0x28e26d;return _0x1ba604;}})[_0x0126('0xa')](function(){_0x1ba604['authenticate'](_0x12b584,function(_0x47945a,_0x117136){var _0x29e7e7=_0x1ba604['loginAttempts']+0x1;if(_0x47945a){return _0x5b9749(_0x47945a);}else if(!_0x117136){if(_0x1ba604[_0x0126('0x14')]){return _0x5b9749(null,![],{'message':_0x0126('0x13')});}else if(_0x1c438f[_0x0126('0x15')]>0x0){if(_0x1ba604['blocked']){if(_0x1c438f[_0x0126('0x16')]>0x0){if(moment(_0x1ba604[_0x0126('0xe')])[_0x0126('0x17')](_0x1c438f[_0x0126('0x16')],_0x0126('0x18'))>moment()){return _0x5b9749(null,![],{'message':_0x0126('0x13')});}else{return utils[_0x0126('0x19')](_0x1ba604,_0x29e7e7,![],null)[_0x0126('0xa')](function(){return _0x5b9749(null,![],{'message':_0x0126('0x13')});});}}else{return _0x5b9749(null,![],{'message':_0x0126('0x13')});}}else{if(_0x29e7e7>=_0x1c438f[_0x0126('0x15')]){return utils[_0x0126('0x19')](_0x1ba604,0x0,!![],moment())['then'](function(){return _0x5b9749(null,![],{'message':_0x0126('0x13')});});}else{return utils['clearBlockUser'](_0x1ba604,_0x29e7e7,![],null)[_0x0126('0xa')](function(){return _0x5b9749(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5b9749(null,![],{'message':_0x0126('0x13')});}}else{if(_0x1ba604[_0x0126('0x14')]){return _0x5b9749(null,![],{'message':_0x0126('0x13')});}else if(_0x1c438f[_0x0126('0x15')]>0x0){if(_0x1ba604[_0x0126('0xd')]){if(_0x1c438f['blockDuration']>0x0){if(moment(_0x1ba604['blockedAt'])[_0x0126('0x17')](_0x1c438f['blockDuration'],'minutes')>moment()){return _0x5b9749(null,![],{'message':_0x0126('0x13')});}else{return utils['clearBlockUser'](_0x1ba604,0x0,![],null)[_0x0126('0xa')](function(){return utils[_0x0126('0x1a')](_0x1ba604);})[_0x0126('0xa')](function(){return _0x5b9749(null,_0x1ba604);});}}else{return _0x5b9749(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0126('0x19')](_0x1ba604,0x0,![],null)['then'](function(){return utils[_0x0126('0x1a')](_0x1ba604);})['then'](function(){return _0x5b9749(null,_0x1ba604);})['catch'](function(_0x4c6608){return _0x5b9749(null,![],_0x4c6608);});}}else{if(_0x1ba604[_0x0126('0xd')]){return _0x5b9749(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0126('0x1a')](_0x1ba604)[_0x0126('0xa')](function(){return _0x5b9749(null,_0x1ba604);});}}}});})[_0x0126('0x1b')](function(_0x412c23){return _0x5b9749(null,![],_0x412c23);});}function sendServiceMail(_0x51e50f){return db[_0x0126('0x1c')]['find']({'where':{'service':!![]},'attributes':['id',_0x0126('0xb'),'email'],'include':[{'model':db[_0x0126('0x1d')],'as':_0x0126('0x1e')}]})[_0x0126('0xa')](function(_0x5e2d55){if(!_0x5e2d55){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x455585={'tls':{'rejectUnauthorized':![]}};if(_0x5e2d55[_0x0126('0x1e')]['service']){_0x455585['service']=_0x5e2d55[_0x0126('0x1e')][_0x0126('0x1f')];}else{_0x455585[_0x0126('0x20')]=_0x5e2d55[_0x0126('0x1e')][_0x0126('0x20')];_0x455585[_0x0126('0x21')]=_0x5e2d55[_0x0126('0x1e')][_0x0126('0x21')];_0x455585[_0x0126('0x22')]=_0x5e2d55[_0x0126('0x1e')][_0x0126('0x22')];}if(_0x5e2d55['Smtp']['authentication']){_0x455585[_0x0126('0x23')]={'user':_0x5e2d55[_0x0126('0x1e')][_0x0126('0x11')],'pass':_0x5e2d55['Smtp'][_0x0126('0x24')]};}var _0x55a7d8={'account':_0x455585,'message':_[_0x0126('0x25')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x5e2d55['name'],_0x5e2d55['email']||_0x5e2d55['Smtp'][_0x0126('0x11')])},_0x51e50f)};return client[_0x0126('0x26')](_0x0126('0x27'),_0x55a7d8);})[_0x0126('0xa')](function(_0x3f0c43){if(_0x3f0c43[_0x0126('0x28')]){throw new Error(util['format'](_0x0126('0x29'),_0x3f0c43['error'][_0x0126('0x2a')]||JSON[_0x0126('0x2b')](_0x3f0c43[_0x0126('0x28')])));}return!![];});}function handleError(_0x3a2f13,_0x14a84d,_0x547ea0){return _0x3a2f13['status'](_0x14a84d||0x1f4)[_0x0126('0x2c')]({'message':_0x547ea0?_0x547ea0[_0x0126('0x2a')]||_0x547ea0:''});}exports[_0x0126('0x2d')]=function(_0x30312c,_0x3341a4,_0x58ac41){passport[_0x0126('0x2e')](_0x0126('0x2f'),function(_0x35a948,_0x428dd9,_0x56b0d6){var _0x4a07c2=_0x35a948||_0x56b0d6;if(_0x4a07c2){return handleError(_0x3341a4,0x191,_0x4a07c2);}if(!_0x428dd9){return handleError(_0x3341a4,0x194,{'message':_0x0126('0x30')});}else{var _0x378d53={'payload':{'id':_0x428dd9['id'],'role':_0x428dd9[_0x0126('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x0126('0x32')](_0x378d53)[_0x0126('0xa')](function(_0x57cf7b){_0x3341a4[_0x0126('0x33')]({'id':_0x428dd9['id'],'token':_0x57cf7b,'statusCall':'','isAlreadyLogged':_0x428dd9['online']});});}})(_0x30312c,_0x3341a4,_0x58ac41);};exports[_0x0126('0x34')]=function(_0x290073,_0x50022f,_0x3bab73){if(!_0x290073[_0x0126('0x35')]['email']){return handleError(_0x50022f,0x1f4,{'message':_0x0126('0x36')});}var _0xefd9f7=rs[_0x0126('0x37')]();_0x290073[_0x0126('0x35')][_0x0126('0x38')]=_0x290073[_0x0126('0x35')][_0x0126('0x38')]['trim']()['toLowerCase']();var _0xb0f3a4;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0126('0x16')],'raw':!![]})[_0x0126('0xa')](function(_0x4cfe4a){_0xb0f3a4=_0x4cfe4a;return db[_0x0126('0x39')]['find']({'where':{'email':_0x290073[_0x0126('0x35')][_0x0126('0x38')]}});})['then'](function(_0x3132bc){if(!_0x3132bc){throw new Error(_0x0126('0x3a'));}if(_0x3132bc['disabled']){throw new Error(_0x0126('0x3b'));}if(_0x3132bc[_0x0126('0xd')]){if(moment(_0x3132bc[_0x0126('0xe')])[_0x0126('0x17')](_0xb0f3a4[_0x0126('0x16')],_0x0126('0x18'))>moment()){throw new Error(_0x0126('0x3c'));}else{_0x3132bc[_0x0126('0xd')]=![];_0x3132bc[_0x0126('0xe')]=null;}}_0x3132bc[_0x0126('0x3d')]=_0xefd9f7;_0x3132bc['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x3132bc[_0x0126('0x3e')]();})[_0x0126('0xa')](function(){return sendServiceMail({'to':_0x290073[_0x0126('0x35')]['email'],'subject':_0x0126('0x3f'),'text':_0x0126('0x40')+_0x0126('0x41')+_0x0126('0x42')+_0x290073[_0x0126('0x43')][_0x0126('0x20')]+_0x0126('0x44')+_0xefd9f7+'\x0a\x0a'+_0x0126('0x45')});})['then'](function(){_0x50022f['status'](0xc8)[_0x0126('0x2c')]({'message':_0x0126('0x46')});})[_0x0126('0x1b')](function(_0xb0a2e0){return handleError(_0x50022f,0x1f4,_0xb0a2e0);});};exports['reset']=function(_0x171caf,_0x497d07,_0x33681a){return db[_0x0126('0x39')][_0x0126('0x47')]({'where':{'resetPasswordToken':_0x171caf[_0x0126('0x48')]['token'],'resetPasswordExpires':{'$gt':Date[_0x0126('0x49')]()}}})[_0x0126('0xa')](function(_0x3ad688){if(!_0x3ad688){throw new Error(_0x0126('0x4a'));}return db[_0x0126('0x8')][_0x0126('0x9')]({'attributes':['id',_0x0126('0x4b'),_0x0126('0x4c'),_0x0126('0x4d')]})[_0x0126('0xa')](function(_0x21d027){if(_0x21d027[_0x0126('0x4b')])authService[_0x0126('0x4e')](_0x171caf['body'][_0x0126('0x4f')]);if(!_0x21d027[_0x0126('0x4c')]||!_0x3ad688['previousPasswords'])return _0x3ad688;authService['validatePasswordHistory'](_0x171caf[_0x0126('0x35')][_0x0126('0x4f')],_0x3ad688[_0x0126('0x50')],_0x21d027[_0x0126('0x4d')]);return _0x3ad688;})[_0x0126('0xa')](function(){_0x3ad688[_0x0126('0x4f')]=_0x171caf[_0x0126('0x35')][_0x0126('0x4f')];_0x3ad688[_0x0126('0x3d')]=null;_0x3ad688[_0x0126('0x51')]=null;return _0x3ad688[_0x0126('0x3e')]();});})[_0x0126('0xa')](function(){_0x497d07['status'](0xc8)['send']({'message':_0x0126('0x52')});})[_0x0126('0x1b')](function(_0x1831ea){return handleError(_0x497d07,0x1f4,_0x1831ea);});};passport[_0x0126('0x53')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x0126('0x4f')},function(_0x383fdd,_0x568d97,_0x324557){return localAuthenticate(db['User'],_0x383fdd,_0x568d97,_0x324557);}));
\ No newline at end of file
+var _0x543b=['name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','minutes','getLicense','catch','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','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.','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then'];(function(_0x4bea2f,_0x20f5b8){var _0x619486=function(_0x120d83){while(--_0x120d83){_0x4bea2f['push'](_0x4bea2f['shift']());}};_0x619486(++_0x20f5b8);}(_0x543b,0x14c));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xb543('0x0'));var passport=require(_0xb543('0x1'));var LocalStrategy=require(_0xb543('0x2'))['Strategy'];var jayson=require(_0xb543('0x3'));var _=require(_0xb543('0x4'));var rs=require(_0xb543('0x5'));var moment=require(_0xb543('0x6'));var db=require(_0xb543('0x7'))['db'];var authService=require(_0xb543('0x8'));var utils=require(_0xb543('0x9'));var client=jayson[_0xb543('0xa')][_0xb543('0xb')]({'port':0x232b});function localAuthenticate(_0x4fb7e9,_0x35b33e,_0x928483,_0x26ba16){var _0x189892,_0x311a44;return db[_0xb543('0xc')][_0xb543('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb543('0xe')],'raw':!![]})[_0xb543('0xf')](function(_0x1b8af7){_0x189892=_0x1b8af7;return _0x4fb7e9[_0xb543('0xd')]({'attributes':['id',_0xb543('0x10'),_0xb543('0x11'),'salt',_0xb543('0x12'),_0xb543('0x13'),_0xb543('0x14'),_0xb543('0x15'),_0xb543('0x16')],'where':{'name':_0x35b33e,'role':{'$or':[_0xb543('0x17'),_0xb543('0x18'),'agent']}}});})[_0xb543('0xf')](function(_0x1ad62d){if(!_0x1ad62d||_0x1ad62d&&_0x1ad62d['name']!==_0x35b33e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x311a44=_0x1ad62d;return _0x311a44;}})['then'](function(){_0x311a44[_0xb543('0x19')](_0x928483,function(_0x19d879,_0x25b9c0){var _0x225ae9=_0x311a44[_0xb543('0x16')]+0x1;if(_0x19d879){return _0x26ba16(_0x19d879);}else if(!_0x25b9c0){if(_0x311a44[_0xb543('0x13')]){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else if(_0x189892[_0xb543('0x1b')]>0x0){if(_0x311a44[_0xb543('0x14')]){if(_0x189892[_0xb543('0xe')]>0x0){if(moment(_0x311a44[_0xb543('0x15')])[_0xb543('0x1c')](_0x189892[_0xb543('0xe')],'minutes')>moment()){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else{return utils[_0xb543('0x1d')](_0x311a44,_0x225ae9,![],null)[_0xb543('0xf')](function(){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});});}}else{return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}}else{if(_0x225ae9>=_0x189892[_0xb543('0x1b')]){return utils['clearBlockUser'](_0x311a44,0x0,!![],moment())[_0xb543('0xf')](function(){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});});}else{return utils['clearBlockUser'](_0x311a44,_0x225ae9,![],null)[_0xb543('0xf')](function(){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});});}}}else{return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}}else{if(_0x311a44['disabled']){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else if(_0x189892[_0xb543('0x1b')]>0x0){if(_0x311a44[_0xb543('0x14')]){if(_0x189892[_0xb543('0xe')]>0x0){if(moment(_0x311a44[_0xb543('0x15')])[_0xb543('0x1c')](_0x189892[_0xb543('0xe')],_0xb543('0x1e'))>moment()){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else{return utils[_0xb543('0x1d')](_0x311a44,0x0,![],null)[_0xb543('0xf')](function(){return utils[_0xb543('0x1f')](_0x311a44);})[_0xb543('0xf')](function(){return _0x26ba16(null,_0x311a44);});}}else{return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}}else{return utils[_0xb543('0x1d')](_0x311a44,0x0,![],null)['then'](function(){return utils[_0xb543('0x1f')](_0x311a44);})['then'](function(){return _0x26ba16(null,_0x311a44);})[_0xb543('0x20')](function(_0x36caa3){return _0x26ba16(null,![],_0x36caa3);});}}else{if(_0x311a44['blocked']){return _0x26ba16(null,![],{'message':_0xb543('0x1a')});}else{return utils[_0xb543('0x1f')](_0x311a44)[_0xb543('0xf')](function(){return _0x26ba16(null,_0x311a44);});}}}});})[_0xb543('0x20')](function(_0x5030a0){return _0x26ba16(null,![],_0x5030a0);});}function sendServiceMail(_0x2713d7){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xb543('0x10'),_0xb543('0x21')],'include':[{'model':db[_0xb543('0x22')],'as':'Smtp'}]})['then'](function(_0x36bf35){if(!_0x36bf35){throw new Error(_0xb543('0x23'));}var _0x3c7ab2={'tls':{'rejectUnauthorized':![]}};if(_0x36bf35[_0xb543('0x24')][_0xb543('0x25')]){_0x3c7ab2[_0xb543('0x25')]=_0x36bf35['Smtp'][_0xb543('0x25')];}else{_0x3c7ab2[_0xb543('0x26')]=_0x36bf35[_0xb543('0x24')][_0xb543('0x26')];_0x3c7ab2[_0xb543('0x27')]=_0x36bf35['Smtp'][_0xb543('0x27')];_0x3c7ab2[_0xb543('0x28')]=_0x36bf35['Smtp'][_0xb543('0x28')];}if(_0x36bf35[_0xb543('0x24')][_0xb543('0x29')]){_0x3c7ab2[_0xb543('0x2a')]={'user':_0x36bf35['Smtp'][_0xb543('0x18')],'pass':_0x36bf35['Smtp'][_0xb543('0x2b')]};}var _0xb508ff={'account':_0x3c7ab2,'message':_[_0xb543('0x2c')]({'from':util['format'](_0xb543('0x2d'),_0x36bf35[_0xb543('0x10')],_0x36bf35[_0xb543('0x21')]||_0x36bf35[_0xb543('0x24')]['user'])},_0x2713d7)};return client['request'](_0xb543('0x2e'),_0xb508ff);})[_0xb543('0xf')](function(_0x312bde){if(_0x312bde[_0xb543('0x2f')]){throw new Error(util[_0xb543('0x30')](_0xb543('0x31'),_0x312bde[_0xb543('0x2f')][_0xb543('0x32')]||JSON[_0xb543('0x33')](_0x312bde[_0xb543('0x2f')])));}return!![];});}function handleError(_0x415243,_0x130a46,_0x150ae5){return _0x415243[_0xb543('0x34')](_0x130a46||0x1f4)[_0xb543('0x35')]({'message':_0x150ae5?_0x150ae5[_0xb543('0x32')]||_0x150ae5:''});}exports[_0xb543('0x36')]=function(_0x51a099,_0xb1db9b,_0x2aadcc){passport[_0xb543('0x19')](_0xb543('0x37'),function(_0x1ac7c7,_0x2c7b0e,_0x50c84c){var _0x3a695a=_0x1ac7c7||_0x50c84c;if(_0x3a695a){return handleError(_0xb1db9b,0x191,_0x3a695a);}if(!_0x2c7b0e){return handleError(_0xb1db9b,0x194,{'message':_0xb543('0x38')});}else{var _0x3e1540={'payload':{'id':_0x2c7b0e['id'],'role':_0x2c7b0e['role']},'options':{'expiresIn':0x15180}};return authService[_0xb543('0x39')](_0x3e1540)[_0xb543('0xf')](function(_0x47af3a){_0xb1db9b['json']({'id':_0x2c7b0e['id'],'token':_0x47af3a,'statusCall':'','isAlreadyLogged':_0x2c7b0e[_0xb543('0x3a')]});});}})(_0x51a099,_0xb1db9b,_0x2aadcc);};exports[_0xb543('0x3b')]=function(_0x5c7e81,_0x50a77f,_0x229541){if(!_0x5c7e81[_0xb543('0x3c')][_0xb543('0x21')]){return handleError(_0x50a77f,0x1f4,{'message':_0xb543('0x3d')});}var _0x2b6614=rs[_0xb543('0x3e')]();_0x5c7e81['body'][_0xb543('0x21')]=_0x5c7e81['body'][_0xb543('0x21')][_0xb543('0x3f')]()[_0xb543('0x40')]();var _0x3abdaf;return db[_0xb543('0xc')][_0xb543('0xd')]({'where':{'id':0x1},'attributes':[_0xb543('0x1b'),_0xb543('0xe')],'raw':!![]})[_0xb543('0xf')](function(_0xc8920b){_0x3abdaf=_0xc8920b;return db[_0xb543('0x41')][_0xb543('0x42')]({'where':{'email':_0x5c7e81[_0xb543('0x3c')][_0xb543('0x21')]}});})[_0xb543('0xf')](function(_0x43bb79){if(!_0x43bb79){throw new Error(_0xb543('0x43'));}if(_0x43bb79[_0xb543('0x13')]){throw new Error(_0xb543('0x44'));}if(_0x43bb79[_0xb543('0x14')]){if(moment(_0x43bb79['blockedAt'])[_0xb543('0x1c')](_0x3abdaf['blockDuration'],_0xb543('0x1e'))>moment()){throw new Error(_0xb543('0x45'));}else{_0x43bb79[_0xb543('0x14')]=![];_0x43bb79['blockedAt']=null;}}_0x43bb79['resetPasswordToken']=_0x2b6614;_0x43bb79['resetPasswordExpires']=Date[_0xb543('0x46')]()+0x36ee80;return _0x43bb79[_0xb543('0x47')]();})['then'](function(){return sendServiceMail({'to':_0x5c7e81[_0xb543('0x3c')][_0xb543('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xb543('0x48')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xb543('0x49')+_0x5c7e81[_0xb543('0x4a')]['host']+_0xb543('0x4b')+_0x2b6614+'\x0a\x0a'+_0xb543('0x4c')});})[_0xb543('0xf')](function(){_0x50a77f[_0xb543('0x34')](0xc8)[_0xb543('0x35')]({'message':_0xb543('0x4d')});})[_0xb543('0x20')](function(_0xbe514a){return handleError(_0x50a77f,0x1f4,_0xbe514a);});};exports['reset']=function(_0x4d7087,_0x1bdbd4,_0x19fa7c){return db[_0xb543('0x41')][_0xb543('0x42')]({'where':{'resetPasswordToken':_0x4d7087['params'][_0xb543('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xb543('0x46')]()}}})[_0xb543('0xf')](function(_0x497e15){if(!_0x497e15){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xb543('0xc')][_0xb543('0xd')]({'attributes':['id','securePassword',_0xb543('0x4f'),_0xb543('0x50')]})[_0xb543('0xf')](function(_0x52b8d3){if(_0x52b8d3[_0xb543('0x51')])authService['validatePasswordPattern'](_0x4d7087['body']['password']);if(!_0x52b8d3[_0xb543('0x4f')]||!_0x497e15[_0xb543('0x52')])return _0x497e15;authService[_0xb543('0x53')](_0x4d7087[_0xb543('0x3c')][_0xb543('0x11')],_0x497e15[_0xb543('0x52')],_0x52b8d3[_0xb543('0x50')]);return _0x497e15;})[_0xb543('0xf')](function(){_0x497e15[_0xb543('0x11')]=_0x4d7087[_0xb543('0x3c')][_0xb543('0x11')];_0x497e15[_0xb543('0x54')]=null;_0x497e15['resetPasswordExpires']=null;return _0x497e15[_0xb543('0x47')]();});})[_0xb543('0xf')](function(){_0x1bdbd4['status'](0xc8)[_0xb543('0x35')]({'message':_0xb543('0x55')});})[_0xb543('0x20')](function(_0x226923){return handleError(_0x1bdbd4,0x1f4,_0x226923);});};passport[_0xb543('0x56')](_0xb543('0x37'),new LocalStrategy({'usernameField':'name','passwordField':_0xb543('0x11')},function(_0x5deb25,_0x59a403,_0x3b9cec){return localAuthenticate(db[_0xb543('0x41')],_0x5deb25,_0x59a403,_0x3b9cec);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index c1aae88..12ab1fa 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 _0xb0f5=['Router','./authLocal.controller','post','/reset/:token','reset','exports','express'];(function(_0x28d7a8,_0x3e52a1){var _0x5d5a5c=function(_0x556bd3){while(--_0x556bd3){_0x28d7a8['push'](_0x28d7a8['shift']());}};_0x5d5a5c(++_0x3e52a1);}(_0xb0f5,0x1cd));var _0x5b0f=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xb0f5[_0x36884e];return _0x1cc367;};'use strict';var express=require(_0x5b0f('0x0'));var router=express[_0x5b0f('0x1')]();var controller=require(_0x5b0f('0x2'));router[_0x5b0f('0x3')]('/',controller['login']);router['post']('/forgot',controller['forgot']);router[_0x5b0f('0x3')](_0x5b0f('0x4'),controller[_0x5b0f('0x5')]);module[_0x5b0f('0x6')]=router;
\ No newline at end of file
+var _0xa91c=['reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x3aa399,_0xb110bc){var _0x5a4dc9=function(_0x4e1b8f){while(--_0x4e1b8f){_0x3aa399['push'](_0x3aa399['shift']());}};_0x5a4dc9(++_0xb110bc);}(_0xa91c,0xda));var _0xca91=function(_0x2caae5,_0x23acda){_0x2caae5=_0x2caae5-0x0;var _0x5e1f96=_0xa91c[_0x2caae5];return _0x5e1f96;};'use strict';var express=require(_0xca91('0x0'));var router=express[_0xca91('0x1')]();var controller=require(_0xca91('0x2'));router[_0xca91('0x3')]('/',controller[_0xca91('0x4')]);router['post']('/forgot',controller[_0xca91('0x5')]);router[_0xca91('0x3')]('/reset/:token',controller[_0xca91('0x6')]);module[_0xca91('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 0f0c123..28b1900 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 _0x128f=['INTEGER','STRING','BOOLEAN'];(function(_0xca58b5,_0x21cc00){var _0x6c254b=function(_0x39c480){while(--_0x39c480){_0xca58b5['push'](_0xca58b5['shift']());}};_0x6c254b(++_0x21cc00);}(_0x128f,0xa0));var _0xf128=function(_0x4e9178,_0x5d09b7){_0x4e9178=_0x4e9178-0x0;var _0x278dbe=_0x128f[_0x4e9178];return _0x278dbe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf128('0x0')]},'status':{'type':Sequelize[_0xf128('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf128('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xbb53=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0xea8207,_0xa7aa07){var _0x54a40a=function(_0xec4503){while(--_0xec4503){_0xea8207['push'](_0xea8207['shift']());}};_0x54a40a(++_0xa7aa07);}(_0xbb53,0x124));var _0x3bb5=function(_0x552041,_0xc34ee7){_0x552041=_0x552041-0x0;var _0x198a1a=_0xbb53[_0x552041];return _0x198a1a;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3bb5('0x2')]},'description':{'type':Sequelize[_0x3bb5('0x2')]},'status':{'type':Sequelize[_0x3bb5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3bb5('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 979f826..97536c5 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 _0x60ce=['VIRTUAL','options','then','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','update','addConditions','Condition','ids','omit','getConditions','addActions','getActions','findOne','Action','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','stack','name','send','index','map','Automation','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge'];(function(_0x535ee3,_0x439dfa){var _0x1cc2d0=function(_0x540422){while(--_0x540422){_0x535ee3['push'](_0x535ee3['shift']());}};_0x1cc2d0(++_0x439dfa);}(_0x60ce,0x70));var _0xe60c=function(_0x43cae5,_0x6ffe11){_0x43cae5=_0x43cae5-0x0;var _0x5e7250=_0x60ce[_0x43cae5];return _0x5e7250;};'use strict';var emlformat=require(_0xe60c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe60c('0x1'));var jsonpatch=require(_0xe60c('0x2'));var rp=require('request-promise');var moment=require(_0xe60c('0x3'));var BPromise=require(_0xe60c('0x4'));var Mustache=require(_0xe60c('0x5'));var util=require('util');var path=require(_0xe60c('0x6'));var sox=require(_0xe60c('0x7'));var csv=require(_0xe60c('0x8'));var ejs=require(_0xe60c('0x9'));var fs=require('fs');var fs_extra=require(_0xe60c('0xa'));var _=require(_0xe60c('0xb'));var squel=require(_0xe60c('0xc'));var crypto=require(_0xe60c('0xd'));var jsforce=require(_0xe60c('0xe'));var deskjs=require(_0xe60c('0xf'));var toCsv=require(_0xe60c('0x8'));var querystring=require(_0xe60c('0x10'));var Papa=require(_0xe60c('0x11'));var Redis=require(_0xe60c('0x12'));var authService=require(_0xe60c('0x13'));var qs=require(_0xe60c('0x14'));var as=require(_0xe60c('0x15'));var hardwareService=require(_0xe60c('0x16'));var logger=require(_0xe60c('0x17'))(_0xe60c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe60c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x576c89,_0x21624b){_0x21624b=_0x21624b||0xcc;return function(_0x52889c){if(_0x52889c){return _0x576c89[_0xe60c('0x1a')](_0x21624b);}return _0x576c89[_0xe60c('0x1b')](_0x21624b)[_0xe60c('0x1c')]();};}function respondWithResult(_0x4bcf2d,_0x18ef4a){_0x18ef4a=_0x18ef4a||0xc8;return function(_0x356017){if(_0x356017){return _0x4bcf2d[_0xe60c('0x1b')](_0x18ef4a)[_0xe60c('0x1d')](_0x356017);}};}function respondWithFilteredResult(_0x129ab9,_0x997be4){return function(_0x8c22c){if(_0x8c22c){var _0x1427b7=typeof _0x997be4[_0xe60c('0x1e')]===_0xe60c('0x1f')&&typeof _0x997be4[_0xe60c('0x20')]===_0xe60c('0x1f');var _0x2c8f68=_0x8c22c[_0xe60c('0x21')];var _0x215e22=_0x1427b7?0x0:_0x997be4[_0xe60c('0x1e')];var _0x2fbe7b=_0x1427b7?_0x8c22c[_0xe60c('0x21')]:_0x997be4['offset']+_0x997be4[_0xe60c('0x20')];var _0x2d96e7;if(_0x2fbe7b>=_0x2c8f68){_0x2fbe7b=_0x2c8f68;_0x2d96e7=0xc8;}else{_0x2d96e7=0xce;}_0x129ab9['status'](_0x2d96e7);return _0x129ab9[_0xe60c('0x22')](_0xe60c('0x23'),_0x215e22+'-'+_0x2fbe7b+'/'+_0x2c8f68)[_0xe60c('0x1d')](_0x8c22c);}return null;};}function patchUpdates(_0x53a29c){return function(_0x31c4b9){try{jsonpatch[_0xe60c('0x24')](_0x31c4b9,_0x53a29c,!![]);}catch(_0x55d374){return BPromise['reject'](_0x55d374);}return _0x31c4b9[_0xe60c('0x25')]();};}function saveUpdates(_0x426e18,_0x124c1e){return function(_0x1a19a9){if(_0x1a19a9){return _0x1a19a9['update'](_0x426e18)['then'](function(_0x1b1094){return _0x1b1094;});}return null;};}function removeEntity(_0x43cb53,_0x295357){return function(_0x19db72){if(_0x19db72){return _0x19db72[_0xe60c('0x26')]()['then'](function(){_0x43cb53[_0xe60c('0x1b')](0xcc)[_0xe60c('0x1c')]();});}};}function handleEntityNotFound(_0x3001e7,_0x35e314){return function(_0x2eaa73){if(!_0x2eaa73){_0x3001e7['sendStatus'](0x194);}return _0x2eaa73;};}function handleError(_0x1c4792,_0x61c2c){_0x61c2c=_0x61c2c||0x1f4;return function(_0x43c695){logger['error'](_0x43c695[_0xe60c('0x27')]);if(_0x43c695['name']){delete _0x43c695[_0xe60c('0x28')];}_0x1c4792[_0xe60c('0x1b')](_0x61c2c)[_0xe60c('0x29')](_0x43c695);};}exports[_0xe60c('0x2a')]=function(_0x203333,_0x4d4577){var _0x2b576a={},_0x461fa0={},_0x13e685={'count':0x0,'rows':[]};var _0xd47e53=_[_0xe60c('0x2b')](db[_0xe60c('0x2c')]['rawAttributes'],function(_0x59ad88){return{'name':_0x59ad88['fieldName'],'type':_0x59ad88[_0xe60c('0x2d')][_0xe60c('0x2e')]};});_0x461fa0[_0xe60c('0x2f')]=_[_0xe60c('0x2b')](_0xd47e53,_0xe60c('0x28'));_0x461fa0[_0xe60c('0x30')]=_['keys'](_0x203333[_0xe60c('0x30')]);_0x461fa0['filters']=_[_0xe60c('0x31')](_0x461fa0[_0xe60c('0x2f')],_0x461fa0['query']);_0x2b576a[_0xe60c('0x32')]=_[_0xe60c('0x31')](_0x461fa0[_0xe60c('0x2f')],qs[_0xe60c('0x33')](_0x203333[_0xe60c('0x30')][_0xe60c('0x33')]));_0x2b576a['attributes']=_0x2b576a['attributes'][_0xe60c('0x34')]?_0x2b576a[_0xe60c('0x32')]:_0x461fa0[_0xe60c('0x2f')];if(!_0x203333[_0xe60c('0x30')][_0xe60c('0x35')](_0xe60c('0x36'))){_0x2b576a[_0xe60c('0x20')]=qs[_0xe60c('0x20')](_0x203333[_0xe60c('0x30')][_0xe60c('0x20')]);_0x2b576a[_0xe60c('0x1e')]=qs[_0xe60c('0x1e')](_0x203333['query']['offset']);}_0x2b576a[_0xe60c('0x37')]=qs['sort'](_0x203333[_0xe60c('0x30')][_0xe60c('0x38')]);_0x2b576a[_0xe60c('0x39')]=qs['filters'](_[_0xe60c('0x3a')](_0x203333[_0xe60c('0x30')],_0x461fa0[_0xe60c('0x3b')]),_0xd47e53);if(_0x203333[_0xe60c('0x30')][_0xe60c('0x3c')]){_0x2b576a[_0xe60c('0x39')]=_[_0xe60c('0x3d')](_0x2b576a['where'],{'$or':_[_0xe60c('0x2b')](_0xd47e53,function(_0x560cc8){if(_0x560cc8[_0xe60c('0x2d')]!==_0xe60c('0x3e')){var _0x28a033={};_0x28a033[_0x560cc8[_0xe60c('0x28')]]={'$like':'%'+_0x203333[_0xe60c('0x30')][_0xe60c('0x3c')]+'%'};return _0x28a033;}})});}_0x2b576a=_['merge']({},_0x2b576a,_0x203333[_0xe60c('0x3f')]);var _0x1abfd3={'where':_0x2b576a[_0xe60c('0x39')]};return db[_0xe60c('0x2c')][_0xe60c('0x21')](_0x1abfd3)[_0xe60c('0x40')](function(_0x4dcb58){_0x13e685['count']=_0x4dcb58;if(_0x203333[_0xe60c('0x30')]['includeAll']){_0x2b576a[_0xe60c('0x41')]=[{'all':!![]}];}return db['Automation'][_0xe60c('0x42')](_0x2b576a);})[_0xe60c('0x40')](function(_0x267f4c){_0x13e685[_0xe60c('0x43')]=_0x267f4c;return _0x13e685;})[_0xe60c('0x40')](respondWithFilteredResult(_0x4d4577,_0x2b576a))[_0xe60c('0x44')](handleError(_0x4d4577,null));};exports[_0xe60c('0x45')]=function(_0x8f5f30,_0x4fb0e9){var _0x154e71={'raw':![],'where':{'id':_0x8f5f30[_0xe60c('0x46')]['id']}},_0x29081a={};_0x29081a['model']=_[_0xe60c('0x47')](db[_0xe60c('0x2c')][_0xe60c('0x48')]);_0x29081a[_0xe60c('0x30')]=_[_0xe60c('0x47')](_0x8f5f30[_0xe60c('0x30')]);_0x29081a[_0xe60c('0x3b')]=_[_0xe60c('0x31')](_0x29081a[_0xe60c('0x2f')],_0x29081a[_0xe60c('0x30')]);_0x154e71[_0xe60c('0x32')]=_[_0xe60c('0x31')](_0x29081a[_0xe60c('0x2f')],qs[_0xe60c('0x33')](_0x8f5f30[_0xe60c('0x30')]['fields']));_0x154e71[_0xe60c('0x32')]=_0x154e71[_0xe60c('0x32')]['length']?_0x154e71[_0xe60c('0x32')]:_0x29081a[_0xe60c('0x2f')];if(_0x8f5f30[_0xe60c('0x30')][_0xe60c('0x49')]){_0x154e71[_0xe60c('0x41')]=[{'all':!![]}];}_0x154e71=_[_0xe60c('0x3d')]({},_0x154e71,_0x8f5f30['options']);return db[_0xe60c('0x2c')][_0xe60c('0x4a')](_0x154e71)['then'](handleEntityNotFound(_0x4fb0e9,null))[_0xe60c('0x40')](respondWithResult(_0x4fb0e9,null))[_0xe60c('0x44')](handleError(_0x4fb0e9,null));};exports[_0xe60c('0x4b')]=function(_0x282bf2,_0x2d4bd8){return db[_0xe60c('0x2c')][_0xe60c('0x4b')](_0x282bf2[_0xe60c('0x4c')],{})[_0xe60c('0x40')](respondWithResult(_0x2d4bd8,0xc9))[_0xe60c('0x44')](handleError(_0x2d4bd8,null));};exports[_0xe60c('0x4d')]=function(_0x4a5c2a,_0x53ce82){if(_0x4a5c2a[_0xe60c('0x4c')]['id']){delete _0x4a5c2a[_0xe60c('0x4c')]['id'];}return db['Automation']['find']({'where':{'id':_0x4a5c2a['params']['id']}})[_0xe60c('0x40')](handleEntityNotFound(_0x53ce82,null))[_0xe60c('0x40')](saveUpdates(_0x4a5c2a['body'],null))['then'](respondWithResult(_0x53ce82,null))[_0xe60c('0x44')](handleError(_0x53ce82,null));};exports['destroy']=function(_0x2aed85,_0x1dae5e){return db[_0xe60c('0x2c')]['find']({'where':{'id':_0x2aed85[_0xe60c('0x46')]['id']}})['then'](handleEntityNotFound(_0x1dae5e,null))['then'](removeEntity(_0x1dae5e,null))['catch'](handleError(_0x1dae5e,null));};exports[_0xe60c('0x4e')]=function(_0x205a44,_0x575a8f,_0x36942e){return db[_0xe60c('0x4f')]['find']({'where':{'id':_0x205a44[_0xe60c('0x46')]['id']}})[_0xe60c('0x40')](handleEntityNotFound(_0x575a8f,null))['then'](function(_0x26d221){if(_0x26d221){return _0x26d221[_0xe60c('0x4e')](_0x205a44[_0xe60c('0x4c')][_0xe60c('0x50')],_[_0xe60c('0x51')](_0x205a44[_0xe60c('0x4c')],['ids','id'])||{});}})[_0xe60c('0x40')](respondWithResult(_0x575a8f,null))[_0xe60c('0x44')](handleError(_0x575a8f,null));};exports[_0xe60c('0x52')]=function(_0x1c8bfd,_0x4a6be8,_0x48c6f3){var _0x1e25bc={};var _0x864d6b={};var _0x1ac8f5;var _0xf43f75;return db['Automation']['findOne']({'where':{'id':_0x1c8bfd[_0xe60c('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a6be8,null))[_0xe60c('0x40')](function(_0x4239ea){if(_0x4239ea){_0x1ac8f5=_0x4239ea;_0x864d6b[_0xe60c('0x2f')]=_[_0xe60c('0x47')](db[_0xe60c('0x4f')][_0xe60c('0x48')]);_0x864d6b['query']=_[_0xe60c('0x47')](_0x1c8bfd[_0xe60c('0x30')]);_0x864d6b[_0xe60c('0x3b')]=_['intersection'](_0x864d6b['model'],_0x864d6b[_0xe60c('0x30')]);_0x1e25bc[_0xe60c('0x32')]=_[_0xe60c('0x31')](_0x864d6b['model'],qs[_0xe60c('0x33')](_0x1c8bfd['query'][_0xe60c('0x33')]));_0x1e25bc[_0xe60c('0x32')]=_0x1e25bc[_0xe60c('0x32')]['length']?_0x1e25bc[_0xe60c('0x32')]:_0x864d6b[_0xe60c('0x2f')];_0x1e25bc['order']=qs[_0xe60c('0x38')](_0x1c8bfd[_0xe60c('0x30')][_0xe60c('0x38')]);_0x1e25bc[_0xe60c('0x39')]=qs[_0xe60c('0x3b')](_['pick'](_0x1c8bfd[_0xe60c('0x30')],_0x864d6b['filters']));if(_0x1c8bfd[_0xe60c('0x30')][_0xe60c('0x3c')]){_0x1e25bc[_0xe60c('0x39')]=_[_0xe60c('0x3d')](_0x1e25bc['where'],{'$or':_[_0xe60c('0x2b')](_0x1e25bc[_0xe60c('0x32')],function(_0x16c20f){var _0x1b6e9e={};_0x1b6e9e[_0x16c20f]={'$like':'%'+_0x1c8bfd[_0xe60c('0x30')]['filter']+'%'};return _0x1b6e9e;})});}_0x1e25bc=_[_0xe60c('0x3d')]({},_0x1e25bc,_0x1c8bfd[_0xe60c('0x3f')]);return _0x1ac8f5['getConditions'](_0x1e25bc);}})['then'](function(_0x1bbccf){if(_0x1bbccf){_0xf43f75=_0x1bbccf[_0xe60c('0x34')];if(!_0x1c8bfd[_0xe60c('0x30')]['hasOwnProperty'](_0xe60c('0x36'))){_0x1e25bc[_0xe60c('0x20')]=qs[_0xe60c('0x20')](_0x1c8bfd['query'][_0xe60c('0x20')]);_0x1e25bc[_0xe60c('0x1e')]=qs[_0xe60c('0x1e')](_0x1c8bfd[_0xe60c('0x30')][_0xe60c('0x1e')]);}return _0x1ac8f5[_0xe60c('0x52')](_0x1e25bc);}})[_0xe60c('0x40')](function(_0x413038){if(_0x413038){return _0x413038?{'count':_0xf43f75,'rows':_0x413038}:null;}})[_0xe60c('0x40')](respondWithResult(_0x4a6be8,null))[_0xe60c('0x44')](handleError(_0x4a6be8,null));};exports[_0xe60c('0x53')]=function(_0x109114,_0x2b3248,_0x139086){return db['Action']['find']({'where':{'id':_0x109114[_0xe60c('0x46')]['id']}})[_0xe60c('0x40')](handleEntityNotFound(_0x2b3248,null))[_0xe60c('0x40')](function(_0x4c0294){if(_0x4c0294){return _0x4c0294[_0xe60c('0x53')](_0x109114['body'][_0xe60c('0x50')],_[_0xe60c('0x51')](_0x109114[_0xe60c('0x4c')],[_0xe60c('0x50'),'id'])||{});}})[_0xe60c('0x40')](respondWithResult(_0x2b3248,null))[_0xe60c('0x44')](handleError(_0x2b3248,null));};exports[_0xe60c('0x54')]=function(_0x1d2351,_0x12d484,_0x76fe7a){var _0x31a70c={};var _0x5516f4={};var _0x3792c0;var _0x333318;return db['Automation'][_0xe60c('0x55')]({'where':{'id':_0x1d2351[_0xe60c('0x46')]['id']}})[_0xe60c('0x40')](handleEntityNotFound(_0x12d484,null))[_0xe60c('0x40')](function(_0x33b04c){if(_0x33b04c){_0x3792c0=_0x33b04c;_0x5516f4[_0xe60c('0x2f')]=_[_0xe60c('0x47')](db[_0xe60c('0x56')][_0xe60c('0x48')]);_0x5516f4['query']=_[_0xe60c('0x47')](_0x1d2351['query']);_0x5516f4[_0xe60c('0x3b')]=_[_0xe60c('0x31')](_0x5516f4[_0xe60c('0x2f')],_0x5516f4[_0xe60c('0x30')]);_0x31a70c[_0xe60c('0x32')]=_['intersection'](_0x5516f4[_0xe60c('0x2f')],qs[_0xe60c('0x33')](_0x1d2351['query']['fields']));_0x31a70c[_0xe60c('0x32')]=_0x31a70c['attributes']['length']?_0x31a70c[_0xe60c('0x32')]:_0x5516f4[_0xe60c('0x2f')];_0x31a70c[_0xe60c('0x37')]=qs['sort'](_0x1d2351[_0xe60c('0x30')][_0xe60c('0x38')]);_0x31a70c[_0xe60c('0x39')]=qs[_0xe60c('0x3b')](_[_0xe60c('0x3a')](_0x1d2351[_0xe60c('0x30')],_0x5516f4['filters']));if(_0x1d2351[_0xe60c('0x30')][_0xe60c('0x3c')]){_0x31a70c[_0xe60c('0x39')]=_['merge'](_0x31a70c[_0xe60c('0x39')],{'$or':_[_0xe60c('0x2b')](_0x31a70c[_0xe60c('0x32')],function(_0x13d4fd){var _0x387166={};_0x387166[_0x13d4fd]={'$like':'%'+_0x1d2351[_0xe60c('0x30')][_0xe60c('0x3c')]+'%'};return _0x387166;})});}_0x31a70c=_['merge']({},_0x31a70c,_0x1d2351[_0xe60c('0x3f')]);return _0x3792c0['getActions'](_0x31a70c);}})[_0xe60c('0x40')](function(_0x27b28f){if(_0x27b28f){_0x333318=_0x27b28f['length'];if(!_0x1d2351[_0xe60c('0x30')][_0xe60c('0x35')](_0xe60c('0x36'))){_0x31a70c[_0xe60c('0x20')]=qs[_0xe60c('0x20')](_0x1d2351[_0xe60c('0x30')][_0xe60c('0x20')]);_0x31a70c[_0xe60c('0x1e')]=qs[_0xe60c('0x1e')](_0x1d2351['query'][_0xe60c('0x1e')]);}return _0x3792c0['getActions'](_0x31a70c);}})[_0xe60c('0x40')](function(_0x5c8d03){if(_0x5c8d03){return _0x5c8d03?{'count':_0x333318,'rows':_0x5c8d03}:null;}})[_0xe60c('0x40')](respondWithResult(_0x12d484,null))[_0xe60c('0x44')](handleError(_0x12d484,null));};
\ No newline at end of file
+var _0x8366=['index','map','rawAttributes','fieldName','type','key','query','attributes','intersection','fields','length','model','hasOwnProperty','order','sort','filters','filter','where','VIRTUAL','merge','options','Automation','includeAll','include','rows','params','keys','find','catch','body','addConditions','Condition','ids','getConditions','pick','Action','addActions','omit','getActions','findOne','eml-format','rimraf','zip-dir','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','end','error','name','send'];(function(_0x484e64,_0x459f04){var _0x218ce8=function(_0x1d8c5f){while(--_0x1d8c5f){_0x484e64['push'](_0x484e64['shift']());}};_0x218ce8(++_0x459f04);}(_0x8366,0x11b));var _0x6836=function(_0x42fa9d,_0x51add9){_0x42fa9d=_0x42fa9d-0x0;var _0x148963=_0x8366[_0x42fa9d];return _0x148963;};'use strict';var emlformat=require(_0x6836('0x0'));var rimraf=require(_0x6836('0x1'));var zipdir=require(_0x6836('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6836('0x3'));var Mustache=require('mustache');var util=require(_0x6836('0x4'));var path=require(_0x6836('0x5'));var sox=require(_0x6836('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6836('0x7'));var _=require(_0x6836('0x8'));var squel=require('squel');var crypto=require(_0x6836('0x9'));var jsforce=require(_0x6836('0xa'));var deskjs=require(_0x6836('0xb'));var toCsv=require(_0x6836('0xc'));var querystring=require(_0x6836('0xd'));var Papa=require(_0x6836('0xe'));var Redis=require(_0x6836('0xf'));var authService=require(_0x6836('0x10'));var qs=require(_0x6836('0x11'));var as=require(_0x6836('0x12'));var hardwareService=require(_0x6836('0x13'));var logger=require(_0x6836('0x14'))('api');var utils=require(_0x6836('0x15'));var config=require(_0x6836('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6836('0x17'))['db'];function respondWithStatusCode(_0x59f213,_0xb49b3d){_0xb49b3d=_0xb49b3d||0xcc;return function(_0x388568){if(_0x388568){return _0x59f213[_0x6836('0x18')](_0xb49b3d);}return _0x59f213[_0x6836('0x19')](_0xb49b3d)['end']();};}function respondWithResult(_0x3f929c,_0x1c761b){_0x1c761b=_0x1c761b||0xc8;return function(_0x4cb7f2){if(_0x4cb7f2){return _0x3f929c['status'](_0x1c761b)[_0x6836('0x1a')](_0x4cb7f2);}};}function respondWithFilteredResult(_0x24d525,_0xdc1f66){return function(_0x46af2d){if(_0x46af2d){var _0x37e257=typeof _0xdc1f66['offset']===_0x6836('0x1b')&&typeof _0xdc1f66[_0x6836('0x1c')]===_0x6836('0x1b');var _0x3c0f45=_0x46af2d[_0x6836('0x1d')];var _0x1d5de9=_0x37e257?0x0:_0xdc1f66[_0x6836('0x1e')];var _0x4e1b03=_0x37e257?_0x46af2d[_0x6836('0x1d')]:_0xdc1f66[_0x6836('0x1e')]+_0xdc1f66['limit'];var _0x227b61;if(_0x4e1b03>=_0x3c0f45){_0x4e1b03=_0x3c0f45;_0x227b61=0xc8;}else{_0x227b61=0xce;}_0x24d525[_0x6836('0x19')](_0x227b61);return _0x24d525[_0x6836('0x1f')](_0x6836('0x20'),_0x1d5de9+'-'+_0x4e1b03+'/'+_0x3c0f45)[_0x6836('0x1a')](_0x46af2d);}return null;};}function patchUpdates(_0x3b1cb1){return function(_0x1fe869){try{jsonpatch['apply'](_0x1fe869,_0x3b1cb1,!![]);}catch(_0x21773f){return BPromise[_0x6836('0x21')](_0x21773f);}return _0x1fe869['save']();};}function saveUpdates(_0x3f848d,_0x38ac87){return function(_0x40de5f){if(_0x40de5f){return _0x40de5f[_0x6836('0x22')](_0x3f848d)[_0x6836('0x23')](function(_0x2ff596){return _0x2ff596;});}return null;};}function removeEntity(_0x1d2d21,_0x3ace74){return function(_0x7d2353){if(_0x7d2353){return _0x7d2353[_0x6836('0x24')]()['then'](function(){_0x1d2d21[_0x6836('0x19')](0xcc)[_0x6836('0x25')]();});}};}function handleEntityNotFound(_0x56f20f,_0x47e1ea){return function(_0x3d9269){if(!_0x3d9269){_0x56f20f[_0x6836('0x18')](0x194);}return _0x3d9269;};}function handleError(_0x5df4fc,_0x2718a6){_0x2718a6=_0x2718a6||0x1f4;return function(_0x540989){logger[_0x6836('0x26')](_0x540989['stack']);if(_0x540989[_0x6836('0x27')]){delete _0x540989[_0x6836('0x27')];}_0x5df4fc[_0x6836('0x19')](_0x2718a6)[_0x6836('0x28')](_0x540989);};}exports[_0x6836('0x29')]=function(_0x5addda,_0x5a27ff){var _0x15c6e6={},_0x2e702b={},_0x30f2b7={'count':0x0,'rows':[]};var _0x246261=_[_0x6836('0x2a')](db['Automation'][_0x6836('0x2b')],function(_0x4ce0e5){return{'name':_0x4ce0e5[_0x6836('0x2c')],'type':_0x4ce0e5[_0x6836('0x2d')][_0x6836('0x2e')]};});_0x2e702b['model']=_[_0x6836('0x2a')](_0x246261,_0x6836('0x27'));_0x2e702b[_0x6836('0x2f')]=_['keys'](_0x5addda[_0x6836('0x2f')]);_0x2e702b['filters']=_['intersection'](_0x2e702b['model'],_0x2e702b['query']);_0x15c6e6[_0x6836('0x30')]=_[_0x6836('0x31')](_0x2e702b['model'],qs['fields'](_0x5addda[_0x6836('0x2f')][_0x6836('0x32')]));_0x15c6e6[_0x6836('0x30')]=_0x15c6e6[_0x6836('0x30')][_0x6836('0x33')]?_0x15c6e6['attributes']:_0x2e702b[_0x6836('0x34')];if(!_0x5addda[_0x6836('0x2f')][_0x6836('0x35')]('nolimit')){_0x15c6e6['limit']=qs[_0x6836('0x1c')](_0x5addda['query']['limit']);_0x15c6e6['offset']=qs['offset'](_0x5addda[_0x6836('0x2f')][_0x6836('0x1e')]);}_0x15c6e6[_0x6836('0x36')]=qs[_0x6836('0x37')](_0x5addda[_0x6836('0x2f')]['sort']);_0x15c6e6['where']=qs[_0x6836('0x38')](_['pick'](_0x5addda[_0x6836('0x2f')],_0x2e702b['filters']),_0x246261);if(_0x5addda[_0x6836('0x2f')][_0x6836('0x39')]){_0x15c6e6[_0x6836('0x3a')]=_['merge'](_0x15c6e6['where'],{'$or':_[_0x6836('0x2a')](_0x246261,function(_0x45fbf3){if(_0x45fbf3[_0x6836('0x2d')]!==_0x6836('0x3b')){var _0x40270f={};_0x40270f[_0x45fbf3[_0x6836('0x27')]]={'$like':'%'+_0x5addda['query']['filter']+'%'};return _0x40270f;}})});}_0x15c6e6=_[_0x6836('0x3c')]({},_0x15c6e6,_0x5addda[_0x6836('0x3d')]);var _0x545151={'where':_0x15c6e6['where']};return db[_0x6836('0x3e')][_0x6836('0x1d')](_0x545151)[_0x6836('0x23')](function(_0x285648){_0x30f2b7['count']=_0x285648;if(_0x5addda[_0x6836('0x2f')][_0x6836('0x3f')]){_0x15c6e6[_0x6836('0x40')]=[{'all':!![]}];}return db[_0x6836('0x3e')]['findAll'](_0x15c6e6);})[_0x6836('0x23')](function(_0x3d8410){_0x30f2b7[_0x6836('0x41')]=_0x3d8410;return _0x30f2b7;})['then'](respondWithFilteredResult(_0x5a27ff,_0x15c6e6))['catch'](handleError(_0x5a27ff,null));};exports['show']=function(_0x557dbc,_0x551f85){var _0x5aa8f8={'raw':![],'where':{'id':_0x557dbc[_0x6836('0x42')]['id']}},_0x47d88c={};_0x47d88c[_0x6836('0x34')]=_['keys'](db[_0x6836('0x3e')][_0x6836('0x2b')]);_0x47d88c[_0x6836('0x2f')]=_[_0x6836('0x43')](_0x557dbc['query']);_0x47d88c['filters']=_['intersection'](_0x47d88c[_0x6836('0x34')],_0x47d88c[_0x6836('0x2f')]);_0x5aa8f8[_0x6836('0x30')]=_[_0x6836('0x31')](_0x47d88c[_0x6836('0x34')],qs[_0x6836('0x32')](_0x557dbc[_0x6836('0x2f')][_0x6836('0x32')]));_0x5aa8f8['attributes']=_0x5aa8f8[_0x6836('0x30')][_0x6836('0x33')]?_0x5aa8f8[_0x6836('0x30')]:_0x47d88c['model'];if(_0x557dbc[_0x6836('0x2f')][_0x6836('0x3f')]){_0x5aa8f8[_0x6836('0x40')]=[{'all':!![]}];}_0x5aa8f8=_['merge']({},_0x5aa8f8,_0x557dbc['options']);return db[_0x6836('0x3e')][_0x6836('0x44')](_0x5aa8f8)['then'](handleEntityNotFound(_0x551f85,null))[_0x6836('0x23')](respondWithResult(_0x551f85,null))[_0x6836('0x45')](handleError(_0x551f85,null));};exports['create']=function(_0x3b5285,_0x55ba1d){return db[_0x6836('0x3e')]['create'](_0x3b5285[_0x6836('0x46')],{})['then'](respondWithResult(_0x55ba1d,0xc9))[_0x6836('0x45')](handleError(_0x55ba1d,null));};exports['update']=function(_0x3306bd,_0x5336d3){if(_0x3306bd[_0x6836('0x46')]['id']){delete _0x3306bd['body']['id'];}return db[_0x6836('0x3e')][_0x6836('0x44')]({'where':{'id':_0x3306bd[_0x6836('0x42')]['id']}})[_0x6836('0x23')](handleEntityNotFound(_0x5336d3,null))['then'](saveUpdates(_0x3306bd[_0x6836('0x46')],null))[_0x6836('0x23')](respondWithResult(_0x5336d3,null))[_0x6836('0x45')](handleError(_0x5336d3,null));};exports[_0x6836('0x24')]=function(_0xadde5a,_0x52403d){return db['Automation'][_0x6836('0x44')]({'where':{'id':_0xadde5a[_0x6836('0x42')]['id']}})['then'](handleEntityNotFound(_0x52403d,null))['then'](removeEntity(_0x52403d,null))[_0x6836('0x45')](handleError(_0x52403d,null));};exports[_0x6836('0x47')]=function(_0x4a9c33,_0x5162e0,_0x554e85){return db[_0x6836('0x48')][_0x6836('0x44')]({'where':{'id':_0x4a9c33['params']['id']}})[_0x6836('0x23')](handleEntityNotFound(_0x5162e0,null))[_0x6836('0x23')](function(_0xdbf0){if(_0xdbf0){return _0xdbf0[_0x6836('0x47')](_0x4a9c33[_0x6836('0x46')][_0x6836('0x49')],_['omit'](_0x4a9c33[_0x6836('0x46')],[_0x6836('0x49'),'id'])||{});}})[_0x6836('0x23')](respondWithResult(_0x5162e0,null))['catch'](handleError(_0x5162e0,null));};exports[_0x6836('0x4a')]=function(_0x1c6ce7,_0x5e596a,_0x32f6ec){var _0x36e0f9={};var _0x5b5658={};var _0x210c2b;var _0x4636bd;return db['Automation']['findOne']({'where':{'id':_0x1c6ce7[_0x6836('0x42')]['id']}})[_0x6836('0x23')](handleEntityNotFound(_0x5e596a,null))[_0x6836('0x23')](function(_0x915396){if(_0x915396){_0x210c2b=_0x915396;_0x5b5658[_0x6836('0x34')]=_[_0x6836('0x43')](db['Condition'][_0x6836('0x2b')]);_0x5b5658['query']=_[_0x6836('0x43')](_0x1c6ce7['query']);_0x5b5658[_0x6836('0x38')]=_[_0x6836('0x31')](_0x5b5658[_0x6836('0x34')],_0x5b5658[_0x6836('0x2f')]);_0x36e0f9[_0x6836('0x30')]=_[_0x6836('0x31')](_0x5b5658[_0x6836('0x34')],qs['fields'](_0x1c6ce7['query'][_0x6836('0x32')]));_0x36e0f9[_0x6836('0x30')]=_0x36e0f9[_0x6836('0x30')][_0x6836('0x33')]?_0x36e0f9[_0x6836('0x30')]:_0x5b5658['model'];_0x36e0f9[_0x6836('0x36')]=qs[_0x6836('0x37')](_0x1c6ce7[_0x6836('0x2f')]['sort']);_0x36e0f9[_0x6836('0x3a')]=qs[_0x6836('0x38')](_[_0x6836('0x4b')](_0x1c6ce7[_0x6836('0x2f')],_0x5b5658[_0x6836('0x38')]));if(_0x1c6ce7[_0x6836('0x2f')]['filter']){_0x36e0f9[_0x6836('0x3a')]=_[_0x6836('0x3c')](_0x36e0f9[_0x6836('0x3a')],{'$or':_[_0x6836('0x2a')](_0x36e0f9[_0x6836('0x30')],function(_0x57f37c){var _0xa5e5e9={};_0xa5e5e9[_0x57f37c]={'$like':'%'+_0x1c6ce7[_0x6836('0x2f')][_0x6836('0x39')]+'%'};return _0xa5e5e9;})});}_0x36e0f9=_[_0x6836('0x3c')]({},_0x36e0f9,_0x1c6ce7[_0x6836('0x3d')]);return _0x210c2b[_0x6836('0x4a')](_0x36e0f9);}})['then'](function(_0x23da0a){if(_0x23da0a){_0x4636bd=_0x23da0a[_0x6836('0x33')];if(!_0x1c6ce7['query'][_0x6836('0x35')]('nolimit')){_0x36e0f9[_0x6836('0x1c')]=qs[_0x6836('0x1c')](_0x1c6ce7[_0x6836('0x2f')][_0x6836('0x1c')]);_0x36e0f9[_0x6836('0x1e')]=qs[_0x6836('0x1e')](_0x1c6ce7[_0x6836('0x2f')][_0x6836('0x1e')]);}return _0x210c2b[_0x6836('0x4a')](_0x36e0f9);}})['then'](function(_0x775eff){if(_0x775eff){return _0x775eff?{'count':_0x4636bd,'rows':_0x775eff}:null;}})[_0x6836('0x23')](respondWithResult(_0x5e596a,null))[_0x6836('0x45')](handleError(_0x5e596a,null));};exports['addActions']=function(_0x2e1aba,_0x306c90,_0x2a5a95){return db[_0x6836('0x4c')][_0x6836('0x44')]({'where':{'id':_0x2e1aba[_0x6836('0x42')]['id']}})[_0x6836('0x23')](handleEntityNotFound(_0x306c90,null))[_0x6836('0x23')](function(_0x4a8acb){if(_0x4a8acb){return _0x4a8acb[_0x6836('0x4d')](_0x2e1aba[_0x6836('0x46')]['ids'],_[_0x6836('0x4e')](_0x2e1aba['body'],['ids','id'])||{});}})[_0x6836('0x23')](respondWithResult(_0x306c90,null))[_0x6836('0x45')](handleError(_0x306c90,null));};exports[_0x6836('0x4f')]=function(_0x477efe,_0x252085,_0x37b088){var _0x419700={};var _0x4a30fe={};var _0x123853;var _0x54191d;return db[_0x6836('0x3e')][_0x6836('0x50')]({'where':{'id':_0x477efe[_0x6836('0x42')]['id']}})['then'](handleEntityNotFound(_0x252085,null))[_0x6836('0x23')](function(_0x1f8272){if(_0x1f8272){_0x123853=_0x1f8272;_0x4a30fe[_0x6836('0x34')]=_['keys'](db[_0x6836('0x4c')][_0x6836('0x2b')]);_0x4a30fe[_0x6836('0x2f')]=_['keys'](_0x477efe[_0x6836('0x2f')]);_0x4a30fe[_0x6836('0x38')]=_[_0x6836('0x31')](_0x4a30fe['model'],_0x4a30fe[_0x6836('0x2f')]);_0x419700[_0x6836('0x30')]=_['intersection'](_0x4a30fe[_0x6836('0x34')],qs[_0x6836('0x32')](_0x477efe[_0x6836('0x2f')][_0x6836('0x32')]));_0x419700[_0x6836('0x30')]=_0x419700[_0x6836('0x30')][_0x6836('0x33')]?_0x419700[_0x6836('0x30')]:_0x4a30fe[_0x6836('0x34')];_0x419700[_0x6836('0x36')]=qs[_0x6836('0x37')](_0x477efe[_0x6836('0x2f')][_0x6836('0x37')]);_0x419700[_0x6836('0x3a')]=qs[_0x6836('0x38')](_[_0x6836('0x4b')](_0x477efe[_0x6836('0x2f')],_0x4a30fe[_0x6836('0x38')]));if(_0x477efe[_0x6836('0x2f')][_0x6836('0x39')]){_0x419700[_0x6836('0x3a')]=_['merge'](_0x419700[_0x6836('0x3a')],{'$or':_['map'](_0x419700[_0x6836('0x30')],function(_0x1393a8){var _0x17322f={};_0x17322f[_0x1393a8]={'$like':'%'+_0x477efe[_0x6836('0x2f')]['filter']+'%'};return _0x17322f;})});}_0x419700=_[_0x6836('0x3c')]({},_0x419700,_0x477efe[_0x6836('0x3d')]);return _0x123853[_0x6836('0x4f')](_0x419700);}})[_0x6836('0x23')](function(_0x2a79a8){if(_0x2a79a8){_0x54191d=_0x2a79a8[_0x6836('0x33')];if(!_0x477efe[_0x6836('0x2f')][_0x6836('0x35')]('nolimit')){_0x419700[_0x6836('0x1c')]=qs['limit'](_0x477efe[_0x6836('0x2f')][_0x6836('0x1c')]);_0x419700['offset']=qs[_0x6836('0x1e')](_0x477efe[_0x6836('0x2f')][_0x6836('0x1e')]);}return _0x123853[_0x6836('0x4f')](_0x419700);}})['then'](function(_0x114c39){if(_0x114c39){return _0x114c39?{'count':_0x54191d,'rows':_0x114c39}:null;}})[_0x6836('0x23')](respondWithResult(_0x252085,null))[_0x6836('0x45')](handleError(_0x252085,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 128a7eb..eb22eda 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 _0x2cb0=['define','Automation','tools_automations','lodash','util','../../config/logger','api','request-promise','rimraf','./automation.attributes','exports'];(function(_0x48fc57,_0x179633){var _0x2afb6a=function(_0x229e94){while(--_0x229e94){_0x48fc57['push'](_0x48fc57['shift']());}};_0x2afb6a(++_0x179633);}(_0x2cb0,0x137));var _0x02cb=function(_0x32d3cd,_0x353cb1){_0x32d3cd=_0x32d3cd-0x0;var _0x100006=_0x2cb0[_0x32d3cd];return _0x100006;};'use strict';var _=require(_0x02cb('0x0'));var util=require(_0x02cb('0x1'));var logger=require(_0x02cb('0x2'))(_0x02cb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x02cb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02cb('0x5'));var config=require('../../config/environment');var attributes=require(_0x02cb('0x6'));module[_0x02cb('0x7')]=function(_0x218024,_0x3e3e5b){return _0x218024[_0x02cb('0x8')](_0x02cb('0x9'),attributes,{'tableName':_0x02cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdaca=['bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x2e0546,_0xb7003f){var _0x3e45e0=function(_0x409b87){while(--_0x409b87){_0x2e0546['push'](_0x2e0546['shift']());}};_0x3e45e0(++_0xb7003f);}(_0xdaca,0x1ca));var _0xadac=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0xdaca[_0x4e783c];return _0x2fbd6d;};'use strict';var _=require(_0xadac('0x0'));var util=require(_0xadac('0x1'));var logger=require(_0xadac('0x2'))('api');var moment=require(_0xadac('0x3'));var BPromise=require(_0xadac('0x4'));var rp=require(_0xadac('0x5'));var fs=require('fs');var path=require(_0xadac('0x6'));var rimraf=require(_0xadac('0x7'));var config=require('../../config/environment');var attributes=require(_0xadac('0x8'));module[_0xadac('0x9')]=function(_0x1e5c81,_0x38dff4){return _0x1e5c81[_0xadac('0xa')]('Automation',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 0ded98d..542d159 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 _0x110e=['ioredis','../../mysqldb','../../config/utils','client','request','then','info','request\x20sent','debug','stringify','error','message','Automation,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x110e,0x68));var _0xe110=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x110e[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xe110('0x0'));var util=require(_0xe110('0x1'));var moment=require('moment');var BPromise=require(_0xe110('0x2'));var rs=require(_0xe110('0x3'));var fs=require('fs');var Redis=require(_0xe110('0x4'));var db=require(_0xe110('0x5'))['db'];var utils=require(_0xe110('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe110('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd83c,_0x1ebbac,_0x2b69c5){return new BPromise(function(_0x23c5ae,_0x44050a){return client[_0xe110('0x8')](_0x3dd83c,_0x2b69c5)[_0xe110('0x9')](function(_0x3c194a){logger[_0xe110('0xa')]('Automation,\x20%s,\x20%s',_0x1ebbac,_0xe110('0xb'));logger[_0xe110('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x1ebbac,_0xe110('0xb'),JSON[_0xe110('0xd')](_0x3c194a));if(_0x3c194a[_0xe110('0xe')]){if(_0x3c194a[_0xe110('0xe')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x1ebbac,_0x3c194a[_0xe110('0xe')][_0xe110('0xf')]);return _0x44050a(_0x3c194a['error']['message']);}logger['error'](_0xe110('0x10'),_0x1ebbac,_0x3c194a[_0xe110('0xe')]['message']);return _0x23c5ae(_0x3c194a['error'][_0xe110('0xf')]);}else{logger['info'](_0xe110('0x10'),_0x1ebbac,_0xe110('0xb'));_0x23c5ae(_0x3c194a[_0xe110('0x11')][_0xe110('0xf')]);}})['catch'](function(_0xa23c0c){logger[_0xe110('0xe')]('Automation,\x20%s,\x20%s',_0x1ebbac,_0xa23c0c);_0x44050a(_0xa23c0c);});});}
\ No newline at end of file
+var _0x3fce=['info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then'];(function(_0x4579fd,_0x436cbc){var _0x4d86f3=function(_0xa1ed87){while(--_0xa1ed87){_0x4579fd['push'](_0x4579fd['shift']());}};_0x4d86f3(++_0x436cbc);}(_0x3fce,0x121));var _0xe3fc=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x3fce[_0x59f0dc];return _0x5b5445;};'use strict';var _=require('lodash');var util=require(_0xe3fc('0x0'));var moment=require(_0xe3fc('0x1'));var BPromise=require(_0xe3fc('0x2'));var rs=require(_0xe3fc('0x3'));var fs=require('fs');var Redis=require(_0xe3fc('0x4'));var db=require(_0xe3fc('0x5'))['db'];var utils=require(_0xe3fc('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe3fc('0x7')][_0xe3fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x523982,_0x200715,_0x49c611){return new BPromise(function(_0x40660f,_0x4a192d){return client[_0xe3fc('0x9')](_0x523982,_0x49c611)[_0xe3fc('0xa')](function(_0x1bb7be){logger[_0xe3fc('0xb')](_0xe3fc('0xc'),_0x200715,'request\x20sent');logger['debug'](_0xe3fc('0xd'),_0x200715,_0xe3fc('0xe'),JSON[_0xe3fc('0xf')](_0x1bb7be));if(_0x1bb7be['error']){if(_0x1bb7be[_0xe3fc('0x10')][_0xe3fc('0x11')]===0x1f4){logger[_0xe3fc('0x10')](_0xe3fc('0xc'),_0x200715,_0x1bb7be[_0xe3fc('0x10')][_0xe3fc('0x12')]);return _0x4a192d(_0x1bb7be[_0xe3fc('0x10')]['message']);}logger[_0xe3fc('0x10')](_0xe3fc('0xc'),_0x200715,_0x1bb7be['error'][_0xe3fc('0x12')]);return _0x40660f(_0x1bb7be[_0xe3fc('0x10')]['message']);}else{logger[_0xe3fc('0xb')](_0xe3fc('0xc'),_0x200715,'request\x20sent');_0x40660f(_0x1bb7be['result']['message']);}})[_0xe3fc('0x13')](function(_0x4283be){logger[_0xe3fc('0x10')]('Automation,\x20%s,\x20%s',_0x200715,_0x4283be);_0x4a192d(_0x4283be);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 6271882..a772969 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 _0x2a8d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/actions','post','/:id/conditions','addConditions','addActions','put','update','destroy'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x2a8d,0x11e));var _0xd2a8=function(_0x406ba5,_0x39fa4b){_0x406ba5=_0x406ba5-0x0;var _0x557db7=_0x2a8d[_0x406ba5];return _0x557db7;};'use strict';var multer=require(_0xd2a8('0x0'));var util=require(_0xd2a8('0x1'));var path=require(_0xd2a8('0x2'));var timeout=require(_0xd2a8('0x3'));var express=require(_0xd2a8('0x4'));var router=express[_0xd2a8('0x5')]();var fs_extra=require(_0xd2a8('0x6'));var auth=require(_0xd2a8('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2a8('0x8'));router[_0xd2a8('0x9')]('/',auth[_0xd2a8('0xa')](),controller[_0xd2a8('0xb')]);router[_0xd2a8('0x9')](_0xd2a8('0xc'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0xd')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0xd2a8('0x9')](_0xd2a8('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0xd2a8('0xf')]('/',auth[_0xd2a8('0xa')](),controller['create']);router[_0xd2a8('0xf')](_0xd2a8('0x10'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x11')]);router[_0xd2a8('0xf')](_0xd2a8('0xe'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x12')]);router[_0xd2a8('0x13')]('/:id',auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x14')]);router['delete'](_0xd2a8('0xc'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x077a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x077a,0x1f2));var _0xa077=function(_0x236380,_0x25476c){_0x236380=_0x236380-0x0;var _0x2e4104=_0x077a[_0x236380];return _0x2e4104;};'use strict';var multer=require(_0xa077('0x0'));var util=require('util');var path=require(_0xa077('0x1'));var timeout=require(_0xa077('0x2'));var express=require(_0xa077('0x3'));var router=express[_0xa077('0x4')]();var fs_extra=require(_0xa077('0x5'));var auth=require(_0xa077('0x6'));var interaction=require(_0xa077('0x7'));var config=require(_0xa077('0x8'));var controller=require('./automation.controller');router[_0xa077('0x9')]('/',auth[_0xa077('0xa')](),controller['index']);router['get']('/:id',auth[_0xa077('0xa')](),controller[_0xa077('0xb')]);router['get']('/:id/conditions',auth[_0xa077('0xa')](),controller[_0xa077('0xc')]);router[_0xa077('0x9')](_0xa077('0xd'),auth[_0xa077('0xa')](),controller[_0xa077('0xe')]);router[_0xa077('0xf')]('/',auth['isAuthenticated'](),controller[_0xa077('0x10')]);router[_0xa077('0xf')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller['addConditions']);router['post'](_0xa077('0xd'),auth[_0xa077('0xa')](),controller[_0xa077('0x12')]);router[_0xa077('0x13')](_0xa077('0x14'),auth[_0xa077('0xa')](),controller[_0xa077('0x15')]);router[_0xa077('0x16')](_0xa077('0x14'),auth[_0xa077('0xa')](),controller[_0xa077('0x17')]);module[_0xa077('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 40c22f2..7c24c14 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 _0x88de=['#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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\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)','ENUM','always','never','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0x88de,0x19c));var _0xe88d=function(_0x301f56,_0x4a41b6){_0x301f56=_0x301f56-0x0;var _0x2e45ad=_0x88de[_0x301f56];return _0x2e45ad;};'use strict';var Sequelize=require(_0xe88d('0x0'));module[_0xe88d('0x1')]={'name':{'type':Sequelize[_0xe88d('0x2')],'unique':_0xe88d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xe88d('0x2')]},'active':{'type':Sequelize[_0xe88d('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xe88d('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe88d('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe88d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe88d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe88d('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xe88d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe88d('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xe88d('0xd')](_0xe88d('0xe'),_0xe88d('0xf'),'onlyIfOpen'),'defaultValue':_0xe88d('0xe')},'dialAMDActive':{'type':Sequelize[_0xe88d('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe88d('0x10')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe88d('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe88d('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe88d('0x5')](0x9)[_0xe88d('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe88d('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xe88d('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe88d('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xe88d('0x5')](0x9)[_0xe88d('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe88d('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe88d('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe88d('0x5')](0x9)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe88d('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe88d('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe88d('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe88d('0xd')](_0xe88d('0x19'),_0xe88d('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xe88d('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xe88d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe88d('0x1b')},'dialCutDigit':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe88d('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe88d('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe88d('0x5')](0x3)[_0xe88d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe88d('0x5')](0x5)[_0xe88d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe88d('0x23')}};
\ No newline at end of file
+var _0xbd38=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2ba979,_0x1ba808){var _0x35e643=function(_0x1ee295){while(--_0x1ee295){_0x2ba979['push'](_0x2ba979['shift']());}};_0x35e643(++_0x1ba808);}(_0xbd38,0xe2));var _0x8bd3=function(_0x5c8e32,_0x900b24){_0x5c8e32=_0x5c8e32-0x0;var _0xa4b5ba=_0xbd38[_0x5c8e32];return _0xa4b5ba;};'use strict';var Sequelize=require(_0x8bd3('0x0'));module[_0x8bd3('0x1')]={'name':{'type':Sequelize[_0x8bd3('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8bd3('0x3')](_0x8bd3('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8bd3('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x8bd3('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8bd3('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8bd3('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bd3('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8bd3('0xc')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8bd3('0x2')],'defaultValue':_0x8bd3('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x8bd3('0x3')](_0x8bd3('0xe'),_0x8bd3('0xf'),_0x8bd3('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x8bd3('0x11')],'defaultValue':0x0,'comment':_0x8bd3('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8bd3('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8bd3('0x6')](0x9)[_0x8bd3('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8bd3('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x8bd3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bd3('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8bd3('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8bd3('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8bd3('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8bd3('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8bd3('0x6')](0x9)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8bd3('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8bd3('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8bd3('0x6')](0x9)[_0x8bd3('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bd3('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8bd3('0x3')](_0x8bd3('0x1a'),_0x8bd3('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x8bd3('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8bd3('0x1c')},'dialCutDigit':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8bd3('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bd3('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bd3('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bd3('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8bd3('0x6')](0x3)[_0x8bd3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bd3('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8bd3('0x6')](0x5)[_0x8bd3('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4f36655..b3236e7 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 _0x7d78=['api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','IvrCampaigns','UserProfileResource','error','stack','map','Campaign','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','name','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','destroy','findOne','CmHopper','pick','options','rows','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0x7d78,0x176));var _0x87d7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7d78[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x87d7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x87d7('0x1'));var rp=require(_0x87d7('0x2'));var moment=require('moment');var BPromise=require(_0x87d7('0x3'));var Mustache=require(_0x87d7('0x4'));var util=require(_0x87d7('0x5'));var path=require(_0x87d7('0x6'));var sox=require(_0x87d7('0x7'));var csv=require(_0x87d7('0x8'));var ejs=require(_0x87d7('0x9'));var fs=require('fs');var fs_extra=require(_0x87d7('0xa'));var _=require(_0x87d7('0xb'));var squel=require(_0x87d7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87d7('0xd'));var toCsv=require(_0x87d7('0x8'));var querystring=require(_0x87d7('0xe'));var Papa=require(_0x87d7('0xf'));var Redis=require('ioredis');var authService=require(_0x87d7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x87d7('0x11'));var hardwareService=require(_0x87d7('0x12'));var logger=require('../../config/logger')(_0x87d7('0x13'));var utils=require(_0x87d7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x87d7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x127378,_0x3401ed){_0x3401ed=_0x3401ed||0xcc;return function(_0x270fa1){if(_0x270fa1){return _0x127378[_0x87d7('0x16')](_0x3401ed);}return _0x127378[_0x87d7('0x17')](_0x3401ed)[_0x87d7('0x18')]();};}function respondWithResult(_0x48cecd,_0x4003bd){_0x4003bd=_0x4003bd||0xc8;return function(_0x204ba8){if(_0x204ba8){return _0x48cecd[_0x87d7('0x17')](_0x4003bd)[_0x87d7('0x19')](_0x204ba8);}};}function respondWithFilteredResult(_0x925895,_0x3546fb){return function(_0x189887){if(_0x189887){var _0x39221c=typeof _0x3546fb['offset']===_0x87d7('0x1a')&&typeof _0x3546fb[_0x87d7('0x1b')]===_0x87d7('0x1a');var _0x1e0035=_0x189887[_0x87d7('0x1c')];var _0xc6edff=_0x39221c?0x0:_0x3546fb[_0x87d7('0x1d')];var _0x17adb9=_0x39221c?_0x189887[_0x87d7('0x1c')]:_0x3546fb[_0x87d7('0x1d')]+_0x3546fb['limit'];var _0x7f0e78;if(_0x17adb9>=_0x1e0035){_0x17adb9=_0x1e0035;_0x7f0e78=0xc8;}else{_0x7f0e78=0xce;}_0x925895[_0x87d7('0x17')](_0x7f0e78);return _0x925895[_0x87d7('0x1e')](_0x87d7('0x1f'),_0xc6edff+'-'+_0x17adb9+'/'+_0x1e0035)[_0x87d7('0x19')](_0x189887);}return null;};}function patchUpdates(_0xa70954){return function(_0x542bf5){try{jsonpatch[_0x87d7('0x20')](_0x542bf5,_0xa70954,!![]);}catch(_0x546750){return BPromise[_0x87d7('0x21')](_0x546750);}return _0x542bf5['save']();};}function saveUpdates(_0x211861,_0x490ec8){return function(_0xf534d2){if(_0xf534d2){return _0xf534d2[_0x87d7('0x22')](_0x211861)[_0x87d7('0x23')](function(_0x2a1d42){return _0x2a1d42;});}return null;};}function removeEntity(_0x227cac,_0x2760e3){return function(_0x279375){if(_0x279375){return _0x279375['destroy']()[_0x87d7('0x23')](function(){var _0x59c263=_0x279375['get']({'plain':!![]});var _0x127f32=_0x87d7('0x24');return db[_0x87d7('0x25')]['destroy']({'where':{'type':_0x127f32,'resourceId':_0x59c263['id']}})['then'](function(){return _0x279375;});})[_0x87d7('0x23')](function(){_0x227cac[_0x87d7('0x17')](0xcc)[_0x87d7('0x18')]();});}};}function handleEntityNotFound(_0x156976,_0x5ec3fb){return function(_0x43cc52){if(!_0x43cc52){_0x156976['sendStatus'](0x194);}return _0x43cc52;};}function handleError(_0x30a01c,_0x5df6a4){_0x5df6a4=_0x5df6a4||0x1f4;return function(_0x282728){logger[_0x87d7('0x26')](_0x282728[_0x87d7('0x27')]);if(_0x282728['name']){delete _0x282728['name'];}_0x30a01c['status'](_0x5df6a4)['send'](_0x282728);};}exports['index']=function(_0x4adaef,_0x16bac5){var _0x50a2f6={},_0xbf8bc5={},_0x2dab56={'count':0x0,'rows':[]};var _0x2f9c03=_[_0x87d7('0x28')](db[_0x87d7('0x29')]['rawAttributes'],function(_0x2ecdfc){return{'name':_0x2ecdfc['fieldName'],'type':_0x2ecdfc['type'][_0x87d7('0x2a')]};});_0xbf8bc5[_0x87d7('0x2b')]=_[_0x87d7('0x28')](_0x2f9c03,'name');_0xbf8bc5['query']=_[_0x87d7('0x2c')](_0x4adaef[_0x87d7('0x2d')]);_0xbf8bc5[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0xbf8bc5[_0x87d7('0x2b')],_0xbf8bc5['query']);_0x50a2f6['attributes']=_[_0x87d7('0x2f')](_0xbf8bc5[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x4adaef['query']['fields']));_0x50a2f6[_0x87d7('0x31')]=_0x50a2f6[_0x87d7('0x31')][_0x87d7('0x32')]?_0x50a2f6[_0x87d7('0x31')]:_0xbf8bc5[_0x87d7('0x2b')];if(!_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0x50a2f6[_0x87d7('0x1b')]=qs[_0x87d7('0x1b')](_0x4adaef['query'][_0x87d7('0x1b')]);_0x50a2f6[_0x87d7('0x1d')]=qs[_0x87d7('0x1d')](_0x4adaef['query'][_0x87d7('0x1d')]);}_0x50a2f6[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x36')]);_0x50a2f6[_0x87d7('0x37')]=qs[_0x87d7('0x2e')](_['pick'](_0x4adaef['query'],_0xbf8bc5[_0x87d7('0x2e')]),_0x2f9c03);if(_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x38')]){_0x50a2f6[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x50a2f6[_0x87d7('0x37')],{'$or':_['map'](_0x2f9c03,function(_0x3d1ed9){if(_0x3d1ed9[_0x87d7('0x3a')]!==_0x87d7('0x3b')){var _0x1233b4={};_0x1233b4[_0x3d1ed9[_0x87d7('0x3c')]]={'$like':'%'+_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x38')]+'%'};return _0x1233b4;}})});}_0x50a2f6=_['merge']({},_0x50a2f6,_0x4adaef['options']);var _0x5b9cb7={'where':_0x50a2f6[_0x87d7('0x37')]};return db[_0x87d7('0x29')][_0x87d7('0x1c')](_0x5b9cb7)[_0x87d7('0x23')](function(_0x177529){_0x2dab56[_0x87d7('0x1c')]=_0x177529;if(_0x4adaef[_0x87d7('0x2d')][_0x87d7('0x3d')]){_0x50a2f6[_0x87d7('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0x87d7('0x3f')](_0x50a2f6);})[_0x87d7('0x23')](function(_0x314e8e){_0x2dab56['rows']=_0x314e8e;return _0x2dab56;})[_0x87d7('0x23')](respondWithFilteredResult(_0x16bac5,_0x50a2f6))[_0x87d7('0x40')](handleError(_0x16bac5,null));};exports[_0x87d7('0x41')]=function(_0x1b7a02,_0x17c48c){var _0x7c1fd6={'raw':![],'where':{'id':_0x1b7a02[_0x87d7('0x42')]['id']}},_0x10e956={};_0x10e956[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db[_0x87d7('0x29')][_0x87d7('0x43')]);_0x10e956[_0x87d7('0x2d')]=_[_0x87d7('0x2c')](_0x1b7a02['query']);_0x10e956[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0x10e956['model'],_0x10e956[_0x87d7('0x2d')]);_0x7c1fd6[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x10e956['model'],qs[_0x87d7('0x30')](_0x1b7a02[_0x87d7('0x2d')]['fields']));_0x7c1fd6[_0x87d7('0x31')]=_0x7c1fd6[_0x87d7('0x31')][_0x87d7('0x32')]?_0x7c1fd6['attributes']:_0x10e956[_0x87d7('0x2b')];if(_0x1b7a02[_0x87d7('0x2d')][_0x87d7('0x3d')]){_0x7c1fd6['include']=[{'all':!![]}];}_0x7c1fd6=_[_0x87d7('0x39')]({},_0x7c1fd6,_0x1b7a02['options']);return db[_0x87d7('0x29')][_0x87d7('0x44')](_0x7c1fd6)['then'](handleEntityNotFound(_0x17c48c,null))[_0x87d7('0x23')](respondWithResult(_0x17c48c,null))['catch'](handleError(_0x17c48c,null));};exports[_0x87d7('0x45')]=function(_0x418365,_0x404f2b){return db['Campaign']['create'](_0x418365[_0x87d7('0x46')],{})[_0x87d7('0x23')](function(_0x5db0e9){var _0x339fd8=_0x418365['user'][_0x87d7('0x47')]({'plain':!![]});if(!_0x339fd8)throw new Error(_0x87d7('0x48'));if(_0x339fd8[_0x87d7('0x49')]===_0x87d7('0x4a')){var _0x5303ed=_0x5db0e9[_0x87d7('0x47')]({'plain':!![]});var _0x563b12=_0x87d7('0x24');return db['UserProfileSection'][_0x87d7('0x44')]({'where':{'name':_0x563b12,'userProfileId':_0x339fd8[_0x87d7('0x4b')]},'raw':!![]})[_0x87d7('0x23')](function(_0x456faa){if(_0x456faa&&_0x456faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5303ed['name'],'resourceId':_0x5303ed['id'],'type':_0x456faa['name'],'sectionId':_0x456faa['id']},{})[_0x87d7('0x23')](function(){return _0x5db0e9;});}else{return _0x5db0e9;}})['catch'](function(_0x473d5f){logger[_0x87d7('0x26')](_0x87d7('0x4c'),_0x473d5f);throw _0x473d5f;});}return _0x5db0e9;})[_0x87d7('0x23')](respondWithResult(_0x404f2b,0xc9))['catch'](handleError(_0x404f2b,null));};exports[_0x87d7('0x4d')]=function(_0x2ca6c8,_0xab1c13){var _0x347ecd={'where':{'id':_0x2ca6c8[_0x87d7('0x42')]['id']}},_0x27de8a={};_0x27de8a['model']=_[_0x87d7('0x2c')](db['Campaign'][_0x87d7('0x43')]);_0x347ecd[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x27de8a[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x2ca6c8[_0x87d7('0x2d')]['fields']));_0x347ecd[_0x87d7('0x31')]=_0x347ecd[_0x87d7('0x31')][_0x87d7('0x32')]?_0x347ecd[_0x87d7('0x31')]:_0x27de8a['model'];if(_0x2ca6c8[_0x87d7('0x2d')][_0x87d7('0x3d')]){_0x347ecd[_0x87d7('0x3e')]=[{'all':!![]}];}_0x347ecd=_[_0x87d7('0x39')]({},_0x347ecd,_0x2ca6c8['options']);return db[_0x87d7('0x29')][_0x87d7('0x44')](_0x347ecd)[_0x87d7('0x23')](handleEntityNotFound(_0xab1c13,null))[_0x87d7('0x23')](function(_0x5eef25){if(_0x5eef25){var _0x4e8122=_0x5eef25[_0x87d7('0x47')]({'plain':!![]});_0x4e8122=qs[_0x87d7('0x4e')](_0x4e8122,['id',_0x87d7('0x4f'),_0x87d7('0x50')]);_0x2ca6c8[_0x87d7('0x46')]=_[_0x87d7('0x4e')](_0x2ca6c8[_0x87d7('0x46')],['id',_0x87d7('0x4f'),'updatedAt']);return db[_0x87d7('0x29')]['create'](_['merge'](_0x4e8122,_0x2ca6c8[_0x87d7('0x46')]),{'include':_0x2ca6c8[_0x87d7('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0x87d7('0x23')](function(_0x1c6f21){var _0x266b74=_0x2ca6c8[_0x87d7('0x4a')][_0x87d7('0x47')]({'plain':!![]});if(!_0x266b74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x266b74['role']===_0x87d7('0x4a')){var _0x214e86=_0x1c6f21['get']({'plain':!![]});var _0x319adf='IvrCampaigns';return db[_0x87d7('0x51')][_0x87d7('0x44')]({'where':{'name':_0x319adf,'userProfileId':_0x266b74['userProfileId']},'raw':!![]})[_0x87d7('0x23')](function(_0x108a58){if(_0x108a58&&_0x108a58[_0x87d7('0x52')]===0x0){return db[_0x87d7('0x25')][_0x87d7('0x45')]({'name':_0x214e86[_0x87d7('0x3c')],'resourceId':_0x214e86['id'],'type':_0x108a58[_0x87d7('0x3c')],'sectionId':_0x108a58['id']},{})[_0x87d7('0x23')](function(){return _0x1c6f21;});}else{return _0x1c6f21;}})[_0x87d7('0x40')](function(_0x1c83d3){logger[_0x87d7('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c83d3);throw _0x1c83d3;});}return _0x1c6f21;});}})['then'](respondWithResult(_0xab1c13,0xc9))[_0x87d7('0x40')](handleError(_0xab1c13,null));};exports[_0x87d7('0x22')]=function(_0x3af515,_0x36eafe){if(_0x3af515[_0x87d7('0x46')]['id']){delete _0x3af515[_0x87d7('0x46')]['id'];}return db[_0x87d7('0x29')]['find']({'where':{'id':_0x3af515[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x36eafe,null))[_0x87d7('0x23')](saveUpdates(_0x3af515[_0x87d7('0x46')],null))[_0x87d7('0x23')](respondWithResult(_0x36eafe,null))['catch'](handleError(_0x36eafe,null));};exports[_0x87d7('0x53')]=function(_0x211472,_0x321c22){return db[_0x87d7('0x29')][_0x87d7('0x44')]({'where':{'id':_0x211472[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x321c22,null))[_0x87d7('0x23')](removeEntity(_0x321c22,null))[_0x87d7('0x40')](handleError(_0x321c22,null));};exports['getHoppers']=function(_0x403af1,_0x1b25ba,_0x8484f1){var _0x50f735={'raw':!![],'where':{}};var _0x1cc79d={};var _0x14daa8={'count':0x0,'rows':[]};return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x403af1['params']['id']}})['then'](handleEntityNotFound(_0x1b25ba,null))[_0x87d7('0x23')](function(_0x35e1e4){if(_0x35e1e4){_0x1cc79d[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db[_0x87d7('0x55')][_0x87d7('0x43')]);_0x1cc79d[_0x87d7('0x2d')]=_[_0x87d7('0x2c')](_0x403af1[_0x87d7('0x2d')]);_0x1cc79d[_0x87d7('0x2e')]=_['intersection'](_0x1cc79d[_0x87d7('0x2b')],_0x1cc79d[_0x87d7('0x2d')]);_0x50f735[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x1cc79d['model'],qs[_0x87d7('0x30')](_0x403af1['query'][_0x87d7('0x30')]));_0x50f735[_0x87d7('0x31')]=_0x50f735[_0x87d7('0x31')][_0x87d7('0x32')]?_0x50f735['attributes']:_0x1cc79d[_0x87d7('0x2b')];if(!_0x403af1[_0x87d7('0x2d')]['hasOwnProperty']('nolimit')){_0x50f735['limit']=qs['limit'](_0x403af1[_0x87d7('0x2d')][_0x87d7('0x1b')]);_0x50f735[_0x87d7('0x1d')]=qs[_0x87d7('0x1d')](_0x403af1[_0x87d7('0x2d')][_0x87d7('0x1d')]);}_0x50f735['order']=qs['sort'](_0x403af1[_0x87d7('0x2d')][_0x87d7('0x36')]);_0x50f735['where']=qs[_0x87d7('0x2e')](_[_0x87d7('0x56')](_0x403af1['query'],_0x1cc79d[_0x87d7('0x2e')]));_0x50f735[_0x87d7('0x37')]['CampaignId']=_0x35e1e4['id'];if(_0x403af1[_0x87d7('0x2d')][_0x87d7('0x38')]){_0x50f735[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x50f735[_0x87d7('0x37')],{'$or':_[_0x87d7('0x28')](_0x50f735[_0x87d7('0x31')],function(_0x12f5ff){var _0x3a4245={};_0x3a4245[_0x12f5ff]={'$like':'%'+_0x403af1[_0x87d7('0x2d')]['filter']+'%'};return _0x3a4245;})});}_0x50f735=_[_0x87d7('0x39')]({},_0x50f735,_0x403af1[_0x87d7('0x57')]);return db['CmHopper'][_0x87d7('0x1c')]({'where':_0x50f735[_0x87d7('0x37')]})[_0x87d7('0x23')](function(_0x266d94){_0x14daa8[_0x87d7('0x1c')]=_0x266d94;if(_0x403af1[_0x87d7('0x2d')][_0x87d7('0x3d')]){_0x50f735['include']=[{'all':!![]}];}return db[_0x87d7('0x55')][_0x87d7('0x3f')](_0x50f735);})[_0x87d7('0x23')](function(_0x46a67c){_0x14daa8[_0x87d7('0x58')]=_0x46a67c;return _0x14daa8;});}})['then'](respondWithFilteredResult(_0x1b25ba,_0x50f735))[_0x87d7('0x40')](handleError(_0x1b25ba,null));};exports['getHopperHistories']=function(_0x299dce,_0x17df07,_0x3222bb){var _0x2e57aa={'raw':!![],'where':{}};var _0x4604f6={};var _0x388a8a={'count':0x0,'rows':[]};return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x299dce['params']['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x17df07,null))[_0x87d7('0x23')](function(_0x3d32b1){if(_0x3d32b1){_0x4604f6[_0x87d7('0x2b')]=_['keys'](db[_0x87d7('0x59')][_0x87d7('0x43')]);_0x4604f6['query']=_['keys'](_0x299dce['query']);_0x4604f6[_0x87d7('0x2e')]=_['intersection'](_0x4604f6[_0x87d7('0x2b')],_0x4604f6[_0x87d7('0x2d')]);_0x2e57aa[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x4604f6['model'],qs[_0x87d7('0x30')](_0x299dce['query'][_0x87d7('0x30')]));_0x2e57aa[_0x87d7('0x31')]=_0x2e57aa[_0x87d7('0x31')][_0x87d7('0x32')]?_0x2e57aa['attributes']:_0x4604f6[_0x87d7('0x2b')];if(!_0x299dce[_0x87d7('0x2d')]['hasOwnProperty']('nolimit')){_0x2e57aa[_0x87d7('0x1b')]=qs['limit'](_0x299dce[_0x87d7('0x2d')][_0x87d7('0x1b')]);_0x2e57aa[_0x87d7('0x1d')]=qs['offset'](_0x299dce[_0x87d7('0x2d')][_0x87d7('0x1d')]);}_0x2e57aa[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x299dce['query'][_0x87d7('0x36')]);_0x2e57aa[_0x87d7('0x37')]=qs[_0x87d7('0x2e')](_['pick'](_0x299dce[_0x87d7('0x2d')],_0x4604f6['filters']));_0x2e57aa[_0x87d7('0x37')][_0x87d7('0x5a')]=_0x3d32b1['id'];if(_0x299dce['query'][_0x87d7('0x38')]){_0x2e57aa[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x2e57aa[_0x87d7('0x37')],{'$or':_['map'](_0x2e57aa['attributes'],function(_0x42140a){var _0x2717a5={};_0x2717a5[_0x42140a]={'$like':'%'+_0x299dce['query'][_0x87d7('0x38')]+'%'};return _0x2717a5;})});}_0x2e57aa=_[_0x87d7('0x39')]({},_0x2e57aa,_0x299dce[_0x87d7('0x57')]);return db[_0x87d7('0x59')][_0x87d7('0x1c')]({'where':_0x2e57aa['where']})[_0x87d7('0x23')](function(_0x1c318e){_0x388a8a[_0x87d7('0x1c')]=_0x1c318e;if(_0x299dce['query'][_0x87d7('0x3d')]){_0x2e57aa['include']=[{'all':!![]}];}return db[_0x87d7('0x59')]['findAll'](_0x2e57aa);})[_0x87d7('0x23')](function(_0x1fd8c1){_0x388a8a['rows']=_0x1fd8c1;return _0x388a8a;});}})['then'](respondWithFilteredResult(_0x17df07,_0x2e57aa))[_0x87d7('0x40')](handleError(_0x17df07,null));};exports['getHopperFinals']=function(_0x25e802,_0x8bbea9,_0x3037f5){var _0x323b32={'raw':!![],'where':{}};var _0x1d79e8={};var _0x100087={'count':0x0,'rows':[]};return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x25e802['params']['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x8bbea9,null))['then'](function(_0x3adbd9){if(_0x3adbd9){_0x1d79e8[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db[_0x87d7('0x5b')][_0x87d7('0x43')]);_0x1d79e8[_0x87d7('0x2d')]=_[_0x87d7('0x2c')](_0x25e802['query']);_0x1d79e8[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0x1d79e8[_0x87d7('0x2b')],_0x1d79e8['query']);_0x323b32[_0x87d7('0x31')]=_['intersection'](_0x1d79e8[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x25e802['query'][_0x87d7('0x30')]));_0x323b32[_0x87d7('0x31')]=_0x323b32[_0x87d7('0x31')][_0x87d7('0x32')]?_0x323b32[_0x87d7('0x31')]:_0x1d79e8[_0x87d7('0x2b')];if(!_0x25e802[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0x323b32[_0x87d7('0x1b')]=qs[_0x87d7('0x1b')](_0x25e802['query'][_0x87d7('0x1b')]);_0x323b32['offset']=qs[_0x87d7('0x1d')](_0x25e802['query'][_0x87d7('0x1d')]);}_0x323b32[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x25e802[_0x87d7('0x2d')][_0x87d7('0x36')]);_0x323b32[_0x87d7('0x37')]=qs[_0x87d7('0x2e')](_['pick'](_0x25e802[_0x87d7('0x2d')],_0x1d79e8[_0x87d7('0x2e')]));_0x323b32['where'][_0x87d7('0x5a')]=_0x3adbd9['id'];if(_0x25e802['query'][_0x87d7('0x38')]){_0x323b32[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x323b32[_0x87d7('0x37')],{'$or':_[_0x87d7('0x28')](_0x323b32[_0x87d7('0x31')],function(_0x288189){var _0x150263={};_0x150263[_0x288189]={'$like':'%'+_0x25e802[_0x87d7('0x2d')][_0x87d7('0x38')]+'%'};return _0x150263;})});}_0x323b32=_[_0x87d7('0x39')]({},_0x323b32,_0x25e802['options']);return db[_0x87d7('0x5b')][_0x87d7('0x1c')]({'where':_0x323b32[_0x87d7('0x37')]})[_0x87d7('0x23')](function(_0x25457b){_0x100087[_0x87d7('0x1c')]=_0x25457b;if(_0x25e802[_0x87d7('0x2d')]['includeAll']){_0x323b32[_0x87d7('0x3e')]=[{'all':!![]}];}return db[_0x87d7('0x5b')][_0x87d7('0x3f')](_0x323b32);})[_0x87d7('0x23')](function(_0x34e45f){_0x100087[_0x87d7('0x58')]=_0x34e45f;return _0x100087;});}})[_0x87d7('0x23')](respondWithFilteredResult(_0x8bbea9,_0x323b32))[_0x87d7('0x40')](handleError(_0x8bbea9,null));};exports[_0x87d7('0x5c')]=function(_0x3f27fa,_0x476404,_0x35375e){var _0x2b8a31={'raw':!![],'where':{}};var _0x170f59={};var _0xf95b08={'count':0x0,'rows':[]};return db['Campaign'][_0x87d7('0x54')]({'where':{'id':_0x3f27fa[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x476404,null))[_0x87d7('0x23')](function(_0x11a74f){if(_0x11a74f){_0x170f59[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db[_0x87d7('0x5d')][_0x87d7('0x43')]);_0x170f59[_0x87d7('0x2d')]=_['keys'](_0x3f27fa[_0x87d7('0x2d')]);_0x170f59[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0x170f59[_0x87d7('0x2b')],_0x170f59[_0x87d7('0x2d')]);_0x2b8a31[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x170f59[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x3f27fa[_0x87d7('0x2d')]['fields']));_0x2b8a31[_0x87d7('0x31')]=_0x2b8a31[_0x87d7('0x31')][_0x87d7('0x32')]?_0x2b8a31[_0x87d7('0x31')]:_0x170f59[_0x87d7('0x2b')];if(!_0x3f27fa[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0x2b8a31[_0x87d7('0x1b')]=qs[_0x87d7('0x1b')](_0x3f27fa[_0x87d7('0x2d')][_0x87d7('0x1b')]);_0x2b8a31['offset']=qs[_0x87d7('0x1d')](_0x3f27fa['query'][_0x87d7('0x1d')]);}_0x2b8a31[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x3f27fa['query'][_0x87d7('0x36')]);_0x2b8a31['where']=qs[_0x87d7('0x2e')](_[_0x87d7('0x56')](_0x3f27fa[_0x87d7('0x2d')],_0x170f59[_0x87d7('0x2e')]));_0x2b8a31[_0x87d7('0x37')][_0x87d7('0x5a')]=_0x11a74f['id'];if(_0x3f27fa['query'][_0x87d7('0x38')]){_0x2b8a31[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0x2b8a31[_0x87d7('0x37')],{'$or':_['map'](_0x2b8a31[_0x87d7('0x31')],function(_0x4511aa){var _0x504222={};_0x504222[_0x4511aa]={'$like':'%'+_0x3f27fa[_0x87d7('0x2d')]['filter']+'%'};return _0x504222;})});}_0x2b8a31=_[_0x87d7('0x39')]({},_0x2b8a31,_0x3f27fa[_0x87d7('0x57')]);return db[_0x87d7('0x5d')][_0x87d7('0x1c')]({'where':_0x2b8a31[_0x87d7('0x37')]})[_0x87d7('0x23')](function(_0x491616){_0xf95b08[_0x87d7('0x1c')]=_0x491616;if(_0x3f27fa['query']['includeAll']){_0x2b8a31[_0x87d7('0x3e')]=[{'all':!![]}];}return db[_0x87d7('0x5d')][_0x87d7('0x3f')](_0x2b8a31);})[_0x87d7('0x23')](function(_0x1854ba){_0xf95b08[_0x87d7('0x58')]=_0x1854ba;return _0xf95b08;});}})[_0x87d7('0x23')](respondWithFilteredResult(_0x476404,_0x2b8a31))[_0x87d7('0x40')](handleError(_0x476404,null));};exports[_0x87d7('0x5e')]=function(_0x529d3e,_0x4e94e1,_0x55806b){var _0x73737a={};var _0x591cbe={};var _0x162c44;var _0x1bd318;return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x529d3e[_0x87d7('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e94e1,null))[_0x87d7('0x23')](function(_0x474cc2){if(_0x474cc2){_0x162c44=_0x474cc2;_0x591cbe['model']=_[_0x87d7('0x2c')](db[_0x87d7('0x5f')][_0x87d7('0x43')]);_0x591cbe['query']=_[_0x87d7('0x2c')](_0x529d3e[_0x87d7('0x2d')]);_0x591cbe['filters']=_[_0x87d7('0x2f')](_0x591cbe[_0x87d7('0x2b')],_0x591cbe[_0x87d7('0x2d')]);_0x73737a[_0x87d7('0x31')]=_[_0x87d7('0x2f')](_0x591cbe[_0x87d7('0x2b')],qs[_0x87d7('0x30')](_0x529d3e[_0x87d7('0x2d')][_0x87d7('0x30')]));_0x73737a['attributes']=_0x73737a[_0x87d7('0x31')][_0x87d7('0x32')]?_0x73737a['attributes']:_0x591cbe[_0x87d7('0x2b')];_0x73737a[_0x87d7('0x35')]=qs[_0x87d7('0x36')](_0x529d3e[_0x87d7('0x2d')][_0x87d7('0x36')]);_0x73737a[_0x87d7('0x37')]=qs[_0x87d7('0x2e')](_[_0x87d7('0x56')](_0x529d3e[_0x87d7('0x2d')],_0x591cbe[_0x87d7('0x2e')]));if(_0x529d3e[_0x87d7('0x2d')]['filter']){_0x73737a[_0x87d7('0x37')]=_['merge'](_0x73737a['where'],{'$or':_['map'](_0x73737a[_0x87d7('0x31')],function(_0x4979f9){var _0x453901={};_0x453901[_0x4979f9]={'$like':'%'+_0x529d3e[_0x87d7('0x2d')]['filter']+'%'};return _0x453901;})});}_0x73737a=_['merge']({},_0x73737a,_0x529d3e[_0x87d7('0x57')]);return _0x162c44[_0x87d7('0x5e')](_0x73737a);}})[_0x87d7('0x23')](function(_0x1678b2){if(_0x1678b2){_0x1bd318=_0x1678b2[_0x87d7('0x32')];if(!_0x529d3e[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0x73737a['limit']=qs[_0x87d7('0x1b')](_0x529d3e[_0x87d7('0x2d')][_0x87d7('0x1b')]);_0x73737a[_0x87d7('0x1d')]=qs[_0x87d7('0x1d')](_0x529d3e['query']['offset']);}return _0x162c44['getLists'](_0x73737a);}})[_0x87d7('0x23')](function(_0x5438fa){if(_0x5438fa){return _0x5438fa?{'count':_0x1bd318,'rows':_0x5438fa}:null;}})[_0x87d7('0x23')](respondWithResult(_0x4e94e1,null))[_0x87d7('0x40')](handleError(_0x4e94e1,null));};exports[_0x87d7('0x60')]=function(_0x1ef0e7,_0xd16736,_0x3ce97d){var _0x16aa6f,_0xed3cc;return db[_0x87d7('0x29')][_0x87d7('0x44')]({'where':{'id':_0x1ef0e7['params']['id']}})['then'](handleEntityNotFound(_0xd16736,null))[_0x87d7('0x23')](function(_0x19efd9){if(_0x19efd9){_0xed3cc=_0x19efd9;return _0x19efd9[_0x87d7('0x60')](_0x1ef0e7[_0x87d7('0x46')][_0x87d7('0x61')],_[_0x87d7('0x4e')](_0x1ef0e7[_0x87d7('0x46')],[_0x87d7('0x61'),'id'])||{});}return null;})[_0x87d7('0x62')](function(_0x1c030c){var _0x159669;_0x16aa6f=_0x1c030c||[];var _0x5edca9=[];if(_0x1c030c){for(var _0x32aea5=0x0;_0x32aea5<_0x1c030c[_0x87d7('0x32')];_0x32aea5+=0x1){var _0x21d71f=_0x1c030c[_0x32aea5][_0x87d7('0x47')]({'plain':!![]});_0xed3cc['dialCheckDuplicateType']=_0x1ef0e7['body'][_0x87d7('0x63')]?_0x1ef0e7[_0x87d7('0x46')][_0x87d7('0x63')]:_0xed3cc[_0x87d7('0x63')];switch(_0xed3cc[_0x87d7('0x63')]){case _0x87d7('0x64'):_0x159669=squel[_0x87d7('0x65')]()[_0x87d7('0x66')]('cm_hopper')[_0x87d7('0x67')](['phone',_0x87d7('0x68'),'ContactId',_0x87d7('0x69'),_0x87d7('0x5a'),'createdAt','updatedAt'],squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x6c'),'phone')[_0x87d7('0x6b')](_0x87d7('0x6d'),'scheduledAt')[_0x87d7('0x6b')]('id',_0x87d7('0x6e'))[_0x87d7('0x6b')](_0x21d71f[_0x87d7('0x6f')][_0x87d7('0x70')](),_0x87d7('0x69'))[_0x87d7('0x6b')](_0x1ef0e7[_0x87d7('0x42')]['id'][_0x87d7('0x70')](),_0x87d7('0x5a'))['field'](_0x87d7('0x6d'),_0x87d7('0x4f'))[_0x87d7('0x6b')](_0x87d7('0x6d'),'updatedAt')[_0x87d7('0x71')](_0x87d7('0x72'))[_0x87d7('0x37')](_0x87d7('0x73'))['where'](_0x87d7('0x74'),_0x21d71f['CmListId'][_0x87d7('0x70')]())[_0x87d7('0x37')](_0x87d7('0x75'))[_0x87d7('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x76'))[_0x87d7('0x71')](_0x87d7('0x77'))[_0x87d7('0x37')](_0x87d7('0x78'),_0x1ef0e7[_0x87d7('0x42')]['id'][_0x87d7('0x70')]()))[_0x87d7('0x37')](_0x87d7('0x79'),squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')]('COALESCE(phone,\x27\x27)')[_0x87d7('0x71')]('cm_hopper')['where'](_0x87d7('0x78'),_0x1ef0e7[_0x87d7('0x42')]['id'][_0x87d7('0x70')]())))['toString']();break;case'onlyIfOpen':_0x159669=squel[_0x87d7('0x65')]()[_0x87d7('0x66')](_0x87d7('0x7a'))[_0x87d7('0x67')]([_0x87d7('0x6c'),_0x87d7('0x68'),_0x87d7('0x6e'),_0x87d7('0x69'),_0x87d7('0x5a'),_0x87d7('0x4f'),_0x87d7('0x50')],squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x6c'),'phone')[_0x87d7('0x6b')]('NOW()','scheduledAt')[_0x87d7('0x6b')]('id','ContactId')['field'](_0x21d71f[_0x87d7('0x6f')][_0x87d7('0x70')](),_0x87d7('0x69'))['field'](_0x1ef0e7[_0x87d7('0x42')]['id'][_0x87d7('0x70')](),_0x87d7('0x5a'))[_0x87d7('0x6b')]('NOW()',_0x87d7('0x4f'))[_0x87d7('0x6b')](_0x87d7('0x6d'),_0x87d7('0x50'))[_0x87d7('0x71')](_0x87d7('0x72'))[_0x87d7('0x37')]('deletedAt\x20IS\x20NULL')['where'](_0x87d7('0x74'),_0x21d71f['CmListId'][_0x87d7('0x70')]())['where'](_0x87d7('0x75'))[_0x87d7('0x37')](_0x87d7('0x79'),squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x7b'))['from'](_0x87d7('0x7a'))[_0x87d7('0x37')](_0x87d7('0x78'),_0x1ef0e7[_0x87d7('0x42')]['id']['toString']())))[_0x87d7('0x70')]();break;default:_0x159669=squel[_0x87d7('0x65')]()['into'](_0x87d7('0x7a'))['fromQuery']([_0x87d7('0x6c'),_0x87d7('0x68'),_0x87d7('0x6e'),_0x87d7('0x69'),'CampaignId',_0x87d7('0x4f'),_0x87d7('0x50')],squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')](_0x87d7('0x6c'),_0x87d7('0x6c'))['field']('NOW()',_0x87d7('0x68'))[_0x87d7('0x6b')]('id',_0x87d7('0x6e'))['field'](_0x21d71f[_0x87d7('0x6f')][_0x87d7('0x70')](),'ListId')[_0x87d7('0x6b')](_0x1ef0e7[_0x87d7('0x42')]['id']['toString'](),_0x87d7('0x5a'))[_0x87d7('0x6b')](_0x87d7('0x6d'),_0x87d7('0x4f'))[_0x87d7('0x6b')]('NOW()',_0x87d7('0x50'))[_0x87d7('0x71')]('cm_contacts')[_0x87d7('0x37')]('deletedAt\x20IS\x20NULL')[_0x87d7('0x37')](_0x87d7('0x74'),_0x21d71f['CmListId'][_0x87d7('0x70')]())[_0x87d7('0x37')]('phone\x20IS\x20NOT\x20NULL'))[_0x87d7('0x70')]();}_0x5edca9[_0x87d7('0x7c')](db[_0x87d7('0x7d')][_0x87d7('0x2d')](_0x159669));}return BPromise[_0x87d7('0x7e')](_0x5edca9);}})[_0x87d7('0x23')](function(){return _0x16aa6f;})['then'](respondWithResult(_0xd16736,null))[_0x87d7('0x40')](handleError(_0xd16736,null));};exports[_0x87d7('0x7f')]=function(_0x313205,_0x41ed7c,_0x5d359e){return db[_0x87d7('0x29')]['find']({'where':{'id':_0x313205[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x41ed7c,null))['then'](function(_0x3676cc){if(_0x3676cc){return _0x3676cc[_0x87d7('0x7f')](_0x313205[_0x87d7('0x2d')][_0x87d7('0x61')]);}})[_0x87d7('0x23')](function(_0x1cb70f){if(_0x1cb70f){return db['CmHopper'][_0x87d7('0x53')]({'where':{'ListId':_0x313205[_0x87d7('0x2d')][_0x87d7('0x61')],'CampaignId':_0x313205['params']['id']}})['then'](function(){return _0x1cb70f;});}})['then'](respondWithStatusCode(_0x41ed7c,null))['catch'](handleError(_0x41ed7c,null));};exports[_0x87d7('0x80')]=function(_0x266eb5,_0xbec92a,_0x4ef1f9){var _0xfa6236={};var _0x5a851c={};var _0x54e4a3;var _0x53b641;return db[_0x87d7('0x29')][_0x87d7('0x54')]({'where':{'id':_0x266eb5['params']['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0xbec92a,null))[_0x87d7('0x23')](function(_0x189569){if(_0x189569){_0x54e4a3=_0x189569;_0x5a851c[_0x87d7('0x2b')]=_[_0x87d7('0x2c')](db['CmList'][_0x87d7('0x43')]);_0x5a851c['query']=_[_0x87d7('0x2c')](_0x266eb5[_0x87d7('0x2d')]);_0x5a851c[_0x87d7('0x2e')]=_[_0x87d7('0x2f')](_0x5a851c[_0x87d7('0x2b')],_0x5a851c['query']);_0xfa6236[_0x87d7('0x31')]=_['intersection'](_0x5a851c['model'],qs['fields'](_0x266eb5[_0x87d7('0x2d')]['fields']));_0xfa6236['attributes']=_0xfa6236[_0x87d7('0x31')]['length']?_0xfa6236[_0x87d7('0x31')]:_0x5a851c[_0x87d7('0x2b')];_0xfa6236['order']=qs[_0x87d7('0x36')](_0x266eb5[_0x87d7('0x2d')][_0x87d7('0x36')]);_0xfa6236[_0x87d7('0x37')]=qs['filters'](_['pick'](_0x266eb5[_0x87d7('0x2d')],_0x5a851c[_0x87d7('0x2e')]));if(_0x266eb5[_0x87d7('0x2d')]['filter']){_0xfa6236[_0x87d7('0x37')]=_[_0x87d7('0x39')](_0xfa6236[_0x87d7('0x37')],{'$or':_[_0x87d7('0x28')](_0xfa6236[_0x87d7('0x31')],function(_0xc754bf){var _0x424ced={};_0x424ced[_0xc754bf]={'$like':'%'+_0x266eb5[_0x87d7('0x2d')]['filter']+'%'};return _0x424ced;})});}_0xfa6236=_[_0x87d7('0x39')]({},_0xfa6236,_0x266eb5[_0x87d7('0x57')]);return _0x54e4a3[_0x87d7('0x80')](_0xfa6236);}})[_0x87d7('0x23')](function(_0x227031){if(_0x227031){_0x53b641=_0x227031['length'];if(!_0x266eb5[_0x87d7('0x2d')][_0x87d7('0x33')](_0x87d7('0x34'))){_0xfa6236[_0x87d7('0x1b')]=qs[_0x87d7('0x1b')](_0x266eb5[_0x87d7('0x2d')]['limit']);_0xfa6236[_0x87d7('0x1d')]=qs[_0x87d7('0x1d')](_0x266eb5[_0x87d7('0x2d')][_0x87d7('0x1d')]);}return _0x54e4a3[_0x87d7('0x80')](_0xfa6236);}})['then'](function(_0x1a0bc0){if(_0x1a0bc0){return _0x1a0bc0?{'count':_0x53b641,'rows':_0x1a0bc0}:null;}})[_0x87d7('0x23')](respondWithResult(_0xbec92a,null))[_0x87d7('0x40')](handleError(_0xbec92a,null));};exports[_0x87d7('0x81')]=function(_0x4eca28,_0x5f3e4d,_0x44853e){var _0x42f549,_0x428dfb;return db[_0x87d7('0x29')][_0x87d7('0x44')]({'where':{'id':_0x4eca28[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x5f3e4d,null))['then'](function(_0x2e1f05){if(_0x2e1f05){_0x428dfb=_0x2e1f05;return _0x2e1f05[_0x87d7('0x81')](_0x4eca28[_0x87d7('0x46')][_0x87d7('0x61')],_[_0x87d7('0x4e')](_0x4eca28[_0x87d7('0x46')],[_0x87d7('0x61'),'id'])||{});}return null;})[_0x87d7('0x62')](function(_0x4bc349){var _0x5c0292;_0x42f549=_0x4bc349||[];var _0x332991=[];if(_0x4bc349){for(var _0x413513=0x0;_0x413513<_0x4bc349[_0x87d7('0x32')];_0x413513+=0x1){var _0x5c6fcb=_0x4bc349[_0x413513][_0x87d7('0x47')]({'plain':!![]});_0x5c0292=squel['insert']()[_0x87d7('0x66')](_0x87d7('0x82'))[_0x87d7('0x67')]([_0x87d7('0x6c'),_0x87d7('0x6e'),_0x87d7('0x69'),_0x87d7('0x5a'),_0x87d7('0x4f'),'updatedAt'],squel[_0x87d7('0x6a')]()[_0x87d7('0x6b')]('phone','phone')[_0x87d7('0x6b')]('id','ContactId')['field'](_0x5c6fcb[_0x87d7('0x6f')][_0x87d7('0x70')](),_0x87d7('0x69'))[_0x87d7('0x6b')](_0x4eca28[_0x87d7('0x42')]['id'][_0x87d7('0x70')](),'CampaignId')[_0x87d7('0x6b')]('NOW()',_0x87d7('0x4f'))[_0x87d7('0x6b')](_0x87d7('0x6d'),'updatedAt')[_0x87d7('0x71')](_0x87d7('0x72'))[_0x87d7('0x37')](_0x87d7('0x73'))[_0x87d7('0x37')](_0x87d7('0x74'),_0x5c6fcb['CmListId']['toString']())['where'](_0x87d7('0x75')))[_0x87d7('0x70')]();_0x332991[_0x87d7('0x7c')](db[_0x87d7('0x7d')][_0x87d7('0x2d')](_0x5c0292));}return BPromise[_0x87d7('0x7e')](_0x332991);}})[_0x87d7('0x23')](function(){return _0x42f549;})[_0x87d7('0x23')](respondWithResult(_0x5f3e4d,null))[_0x87d7('0x40')](handleError(_0x5f3e4d,null));};exports['removeBlackLists']=function(_0x4d7127,_0x537440,_0x319f60){return db['Campaign'][_0x87d7('0x44')]({'where':{'id':_0x4d7127[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](handleEntityNotFound(_0x537440,null))[_0x87d7('0x23')](function(_0x537a8d){if(_0x537a8d){return _0x537a8d['removeBlackLists'](_0x4d7127[_0x87d7('0x2d')][_0x87d7('0x61')]);}})[_0x87d7('0x23')](function(_0x4aac42){if(_0x4aac42){return db['CmHopperBlack'][_0x87d7('0x53')]({'where':{'ListId':_0x4d7127[_0x87d7('0x2d')][_0x87d7('0x61')],'CampaignId':_0x4d7127[_0x87d7('0x42')]['id']}})[_0x87d7('0x23')](function(){return _0x4aac42;});}})[_0x87d7('0x23')](respondWithStatusCode(_0x537440,null))['catch'](handleError(_0x537440,null));};
\ No newline at end of file
+var _0x83cc=['type','key','model','keys','query','filters','fields','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','intersection','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','includeAll','options','find','omit','createdAt','body','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','field','NOW()','ContactId','toString','ListId','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','sequelize','all','removeLists','getBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes'];(function(_0x513e46,_0x798ec6){var _0x5dc950=function(_0x4abfd6){while(--_0x4abfd6){_0x513e46['push'](_0x513e46['shift']());}};_0x5dc950(++_0x798ec6);}(_0x83cc,0xde));var _0xc83c=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x83cc[_0x179e11];return _0x549f04;};'use strict';var emlformat=require(_0xc83c('0x0'));var rimraf=require(_0xc83c('0x1'));var zipdir=require(_0xc83c('0x2'));var jsonpatch=require(_0xc83c('0x3'));var rp=require(_0xc83c('0x4'));var moment=require(_0xc83c('0x5'));var BPromise=require(_0xc83c('0x6'));var Mustache=require(_0xc83c('0x7'));var util=require(_0xc83c('0x8'));var path=require(_0xc83c('0x9'));var sox=require(_0xc83c('0xa'));var csv=require(_0xc83c('0xb'));var ejs=require(_0xc83c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc83c('0xd'));var squel=require(_0xc83c('0xe'));var crypto=require(_0xc83c('0xf'));var jsforce=require(_0xc83c('0x10'));var deskjs=require(_0xc83c('0x11'));var toCsv=require('to-csv');var querystring=require(_0xc83c('0x12'));var Papa=require('papaparse');var Redis=require(_0xc83c('0x13'));var authService=require(_0xc83c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc83c('0x15'));var hardwareService=require(_0xc83c('0x16'));var logger=require(_0xc83c('0x17'))(_0xc83c('0x18'));var utils=require(_0xc83c('0x19'));var config=require(_0xc83c('0x1a'));var licenseUtil=require(_0xc83c('0x1b'));var db=require(_0xc83c('0x1c'))['db'];function respondWithStatusCode(_0x889313,_0x3072d4){_0x3072d4=_0x3072d4||0xcc;return function(_0x440392){if(_0x440392){return _0x889313[_0xc83c('0x1d')](_0x3072d4);}return _0x889313['status'](_0x3072d4)[_0xc83c('0x1e')]();};}function respondWithResult(_0x38a66c,_0x3f6f43){_0x3f6f43=_0x3f6f43||0xc8;return function(_0x3222cf){if(_0x3222cf){return _0x38a66c[_0xc83c('0x1f')](_0x3f6f43)[_0xc83c('0x20')](_0x3222cf);}};}function respondWithFilteredResult(_0x23b3f2,_0x30d46d){return function(_0x5e3b49){if(_0x5e3b49){var _0x47c524=typeof _0x30d46d['offset']===_0xc83c('0x21')&&typeof _0x30d46d[_0xc83c('0x22')]===_0xc83c('0x21');var _0x2c5870=_0x5e3b49[_0xc83c('0x23')];var _0x2e84d4=_0x47c524?0x0:_0x30d46d[_0xc83c('0x24')];var _0x57f97e=_0x47c524?_0x5e3b49[_0xc83c('0x23')]:_0x30d46d['offset']+_0x30d46d[_0xc83c('0x22')];var _0x97e9fb;if(_0x57f97e>=_0x2c5870){_0x57f97e=_0x2c5870;_0x97e9fb=0xc8;}else{_0x97e9fb=0xce;}_0x23b3f2['status'](_0x97e9fb);return _0x23b3f2[_0xc83c('0x25')]('Content-Range',_0x2e84d4+'-'+_0x57f97e+'/'+_0x2c5870)[_0xc83c('0x20')](_0x5e3b49);}return null;};}function patchUpdates(_0x1a5b50){return function(_0x4b04cf){try{jsonpatch[_0xc83c('0x26')](_0x4b04cf,_0x1a5b50,!![]);}catch(_0xa0d708){return BPromise[_0xc83c('0x27')](_0xa0d708);}return _0x4b04cf[_0xc83c('0x28')]();};}function saveUpdates(_0x137886,_0x1ea51a){return function(_0x54bd80){if(_0x54bd80){return _0x54bd80[_0xc83c('0x29')](_0x137886)[_0xc83c('0x2a')](function(_0x94986d){return _0x94986d;});}return null;};}function removeEntity(_0x260a5e,_0x4863d6){return function(_0x1b4853){if(_0x1b4853){return _0x1b4853[_0xc83c('0x2b')]()[_0xc83c('0x2a')](function(){var _0x5d1ffb=_0x1b4853[_0xc83c('0x2c')]({'plain':!![]});var _0x15a715='IvrCampaigns';return db[_0xc83c('0x2d')][_0xc83c('0x2b')]({'where':{'type':_0x15a715,'resourceId':_0x5d1ffb['id']}})['then'](function(){return _0x1b4853;});})['then'](function(){_0x260a5e['status'](0xcc)[_0xc83c('0x1e')]();});}};}function handleEntityNotFound(_0x2849d8,_0x21cb7c){return function(_0x22f2e4){if(!_0x22f2e4){_0x2849d8['sendStatus'](0x194);}return _0x22f2e4;};}function handleError(_0x44f037,_0x2ae7e8){_0x2ae7e8=_0x2ae7e8||0x1f4;return function(_0x10bdf2){logger[_0xc83c('0x2e')](_0x10bdf2[_0xc83c('0x2f')]);if(_0x10bdf2[_0xc83c('0x30')]){delete _0x10bdf2[_0xc83c('0x30')];}_0x44f037[_0xc83c('0x1f')](_0x2ae7e8)[_0xc83c('0x31')](_0x10bdf2);};}exports[_0xc83c('0x32')]=function(_0xcf188f,_0x4fd895){var _0x5b3b29={},_0x1d9958={},_0x1506d3={'count':0x0,'rows':[]};var _0x207aa6=_[_0xc83c('0x33')](db[_0xc83c('0x34')][_0xc83c('0x35')],function(_0x14e4c6){return{'name':_0x14e4c6['fieldName'],'type':_0x14e4c6[_0xc83c('0x36')][_0xc83c('0x37')]};});_0x1d9958[_0xc83c('0x38')]=_[_0xc83c('0x33')](_0x207aa6,_0xc83c('0x30'));_0x1d9958['query']=_[_0xc83c('0x39')](_0xcf188f[_0xc83c('0x3a')]);_0x1d9958[_0xc83c('0x3b')]=_['intersection'](_0x1d9958[_0xc83c('0x38')],_0x1d9958[_0xc83c('0x3a')]);_0x5b3b29['attributes']=_['intersection'](_0x1d9958[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x3c')]));_0x5b3b29[_0xc83c('0x3d')]=_0x5b3b29[_0xc83c('0x3d')]['length']?_0x5b3b29[_0xc83c('0x3d')]:_0x1d9958['model'];if(!_0xcf188f[_0xc83c('0x3a')]['hasOwnProperty'](_0xc83c('0x3e'))){_0x5b3b29[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x5b3b29[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0xcf188f['query'][_0xc83c('0x24')]);}_0x5b3b29[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x5b3b29['where']=qs[_0xc83c('0x3b')](_[_0xc83c('0x41')](_0xcf188f[_0xc83c('0x3a')],_0x1d9958[_0xc83c('0x3b')]),_0x207aa6);if(_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x5b3b29[_0xc83c('0x43')]=_[_0xc83c('0x44')](_0x5b3b29[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x207aa6,function(_0x2d2a6c){if(_0x2d2a6c['type']!==_0xc83c('0x45')){var _0x52689a={};_0x52689a[_0x2d2a6c['name']]={'$like':'%'+_0xcf188f[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x52689a;}})});}_0x5b3b29=_[_0xc83c('0x44')]({},_0x5b3b29,_0xcf188f['options']);var _0xc81208={'where':_0x5b3b29[_0xc83c('0x43')]};return db[_0xc83c('0x34')][_0xc83c('0x23')](_0xc81208)['then'](function(_0x4bf55b){_0x1506d3['count']=_0x4bf55b;if(_0xcf188f[_0xc83c('0x3a')]['includeAll']){_0x5b3b29[_0xc83c('0x46')]=[{'all':!![]}];}return db['Campaign'][_0xc83c('0x47')](_0x5b3b29);})['then'](function(_0x5d80bb){_0x1506d3[_0xc83c('0x48')]=_0x5d80bb;return _0x1506d3;})['then'](respondWithFilteredResult(_0x4fd895,_0x5b3b29))[_0xc83c('0x49')](handleError(_0x4fd895,null));};exports[_0xc83c('0x4a')]=function(_0x3860bb,_0x364fe8){var _0x57486f={'raw':![],'where':{'id':_0x3860bb['params']['id']}},_0x2a5954={};_0x2a5954[_0xc83c('0x38')]=_[_0xc83c('0x39')](db[_0xc83c('0x34')]['rawAttributes']);_0x2a5954[_0xc83c('0x3a')]=_['keys'](_0x3860bb[_0xc83c('0x3a')]);_0x2a5954[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0x2a5954[_0xc83c('0x38')],_0x2a5954[_0xc83c('0x3a')]);_0x57486f['attributes']=_['intersection'](_0x2a5954[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x3860bb[_0xc83c('0x3a')]['fields']));_0x57486f['attributes']=_0x57486f[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x57486f[_0xc83c('0x3d')]:_0x2a5954['model'];if(_0x3860bb['query']['includeAll']){_0x57486f[_0xc83c('0x46')]=[{'all':!![]}];}_0x57486f=_[_0xc83c('0x44')]({},_0x57486f,_0x3860bb['options']);return db[_0xc83c('0x34')]['find'](_0x57486f)[_0xc83c('0x2a')](handleEntityNotFound(_0x364fe8,null))[_0xc83c('0x2a')](respondWithResult(_0x364fe8,null))[_0xc83c('0x49')](handleError(_0x364fe8,null));};exports[_0xc83c('0x4d')]=function(_0x503bbc,_0x29b115){return db[_0xc83c('0x34')][_0xc83c('0x4d')](_0x503bbc['body'],{})[_0xc83c('0x2a')](function(_0x5de1f0){var _0x4a025c=_0x503bbc[_0xc83c('0x4e')][_0xc83c('0x2c')]({'plain':!![]});if(!_0x4a025c)throw new Error(_0xc83c('0x4f'));if(_0x4a025c['role']===_0xc83c('0x4e')){var _0x3cc3c1=_0x5de1f0['get']({'plain':!![]});var _0x5a0f86='IvrCampaigns';return db[_0xc83c('0x50')]['find']({'where':{'name':_0x5a0f86,'userProfileId':_0x4a025c[_0xc83c('0x51')]},'raw':!![]})[_0xc83c('0x2a')](function(_0x217e60){if(_0x217e60&&_0x217e60[_0xc83c('0x52')]===0x0){return db['UserProfileResource'][_0xc83c('0x4d')]({'name':_0x3cc3c1[_0xc83c('0x30')],'resourceId':_0x3cc3c1['id'],'type':_0x217e60[_0xc83c('0x30')],'sectionId':_0x217e60['id']},{})[_0xc83c('0x2a')](function(){return _0x5de1f0;});}else{return _0x5de1f0;}})[_0xc83c('0x49')](function(_0x224f29){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x224f29);throw _0x224f29;});}return _0x5de1f0;})['then'](respondWithResult(_0x29b115,0xc9))[_0xc83c('0x49')](handleError(_0x29b115,null));};exports['clone']=function(_0x38d7fa,_0x155875){var _0x569a52={'where':{'id':_0x38d7fa[_0xc83c('0x53')]['id']}},_0x1b8ae9={};_0x1b8ae9['model']=_[_0xc83c('0x39')](db['Campaign'][_0xc83c('0x35')]);_0x569a52['attributes']=_[_0xc83c('0x4b')](_0x1b8ae9['model'],qs[_0xc83c('0x3c')](_0x38d7fa[_0xc83c('0x3a')][_0xc83c('0x3c')]));_0x569a52[_0xc83c('0x3d')]=_0x569a52[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x569a52['attributes']:_0x1b8ae9['model'];if(_0x38d7fa[_0xc83c('0x3a')][_0xc83c('0x54')]){_0x569a52[_0xc83c('0x46')]=[{'all':!![]}];}_0x569a52=_['merge']({},_0x569a52,_0x38d7fa[_0xc83c('0x55')]);return db[_0xc83c('0x34')][_0xc83c('0x56')](_0x569a52)[_0xc83c('0x2a')](handleEntityNotFound(_0x155875,null))[_0xc83c('0x2a')](function(_0x1ff19d){if(_0x1ff19d){var _0x331f92=_0x1ff19d[_0xc83c('0x2c')]({'plain':!![]});_0x331f92=qs[_0xc83c('0x57')](_0x331f92,['id',_0xc83c('0x58'),'updatedAt']);_0x38d7fa['body']=_[_0xc83c('0x57')](_0x38d7fa[_0xc83c('0x59')],['id',_0xc83c('0x58'),'updatedAt']);return db[_0xc83c('0x34')][_0xc83c('0x4d')](_[_0xc83c('0x44')](_0x331f92,_0x38d7fa[_0xc83c('0x59')]),{'include':_0x38d7fa['query'][_0xc83c('0x54')]?[{'all':!![]}]:undefined})[_0xc83c('0x2a')](function(_0x3ed866){var _0x4a863c=_0x38d7fa[_0xc83c('0x4e')][_0xc83c('0x2c')]({'plain':!![]});if(!_0x4a863c)throw new Error(_0xc83c('0x4f'));if(_0x4a863c[_0xc83c('0x5a')]==='user'){var _0x2c1b80=_0x3ed866[_0xc83c('0x2c')]({'plain':!![]});var _0x51ce70='IvrCampaigns';return db[_0xc83c('0x50')]['find']({'where':{'name':_0x51ce70,'userProfileId':_0x4a863c[_0xc83c('0x51')]},'raw':!![]})[_0xc83c('0x2a')](function(_0x52fc95){if(_0x52fc95&&_0x52fc95[_0xc83c('0x52')]===0x0){return db['UserProfileResource'][_0xc83c('0x4d')]({'name':_0x2c1b80[_0xc83c('0x30')],'resourceId':_0x2c1b80['id'],'type':_0x52fc95[_0xc83c('0x30')],'sectionId':_0x52fc95['id']},{})[_0xc83c('0x2a')](function(){return _0x3ed866;});}else{return _0x3ed866;}})[_0xc83c('0x49')](function(_0x4fc99a){logger[_0xc83c('0x2e')](_0xc83c('0x5b'),_0x4fc99a);throw _0x4fc99a;});}return _0x3ed866;});}})[_0xc83c('0x2a')](respondWithResult(_0x155875,0xc9))[_0xc83c('0x49')](handleError(_0x155875,null));};exports[_0xc83c('0x29')]=function(_0x35fcf7,_0x30a095){if(_0x35fcf7['body']['id']){delete _0x35fcf7[_0xc83c('0x59')]['id'];}return db[_0xc83c('0x34')]['find']({'where':{'id':_0x35fcf7[_0xc83c('0x53')]['id']}})['then'](handleEntityNotFound(_0x30a095,null))[_0xc83c('0x2a')](saveUpdates(_0x35fcf7[_0xc83c('0x59')],null))[_0xc83c('0x2a')](respondWithResult(_0x30a095,null))[_0xc83c('0x49')](handleError(_0x30a095,null));};exports[_0xc83c('0x2b')]=function(_0x274f8b,_0x428923){return db[_0xc83c('0x34')]['find']({'where':{'id':_0x274f8b['params']['id']}})['then'](handleEntityNotFound(_0x428923,null))[_0xc83c('0x2a')](removeEntity(_0x428923,null))[_0xc83c('0x49')](handleError(_0x428923,null));};exports[_0xc83c('0x5c')]=function(_0x55c9da,_0x51e0ba,_0x1cddde){var _0x5123fc={'raw':!![],'where':{}};var _0x3e5141={};var _0x428303={'count':0x0,'rows':[]};return db[_0xc83c('0x34')][_0xc83c('0x5d')]({'where':{'id':_0x55c9da['params']['id']}})['then'](handleEntityNotFound(_0x51e0ba,null))[_0xc83c('0x2a')](function(_0x465c16){if(_0x465c16){_0x3e5141['model']=_[_0xc83c('0x39')](db[_0xc83c('0x5e')]['rawAttributes']);_0x3e5141[_0xc83c('0x3a')]=_['keys'](_0x55c9da['query']);_0x3e5141[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0x3e5141['model'],_0x3e5141['query']);_0x5123fc['attributes']=_['intersection'](_0x3e5141[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x55c9da[_0xc83c('0x3a')]['fields']));_0x5123fc['attributes']=_0x5123fc[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x5123fc[_0xc83c('0x3d')]:_0x3e5141[_0xc83c('0x38')];if(!_0x55c9da['query'][_0xc83c('0x5f')]('nolimit')){_0x5123fc[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x5123fc[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x55c9da['query'][_0xc83c('0x24')]);}_0x5123fc[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x5123fc[_0xc83c('0x43')]=qs[_0xc83c('0x3b')](_[_0xc83c('0x41')](_0x55c9da['query'],_0x3e5141['filters']));_0x5123fc[_0xc83c('0x43')][_0xc83c('0x60')]=_0x465c16['id'];if(_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x5123fc['where']=_[_0xc83c('0x44')](_0x5123fc[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x5123fc[_0xc83c('0x3d')],function(_0x5e5539){var _0x50f53f={};_0x50f53f[_0x5e5539]={'$like':'%'+_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x50f53f;})});}_0x5123fc=_[_0xc83c('0x44')]({},_0x5123fc,_0x55c9da[_0xc83c('0x55')]);return db[_0xc83c('0x5e')]['count']({'where':_0x5123fc[_0xc83c('0x43')]})[_0xc83c('0x2a')](function(_0x2f381e){_0x428303[_0xc83c('0x23')]=_0x2f381e;if(_0x55c9da[_0xc83c('0x3a')][_0xc83c('0x54')]){_0x5123fc[_0xc83c('0x46')]=[{'all':!![]}];}return db[_0xc83c('0x5e')][_0xc83c('0x47')](_0x5123fc);})[_0xc83c('0x2a')](function(_0x2f41bc){_0x428303[_0xc83c('0x48')]=_0x2f41bc;return _0x428303;});}})[_0xc83c('0x2a')](respondWithFilteredResult(_0x51e0ba,_0x5123fc))[_0xc83c('0x49')](handleError(_0x51e0ba,null));};exports[_0xc83c('0x61')]=function(_0x5a2601,_0x4fc2c0,_0x3f956c){var _0x293205={'raw':!![],'where':{}};var _0xad83f1={};var _0x12e162={'count':0x0,'rows':[]};return db['Campaign'][_0xc83c('0x5d')]({'where':{'id':_0x5a2601[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x4fc2c0,null))['then'](function(_0x331909){if(_0x331909){_0xad83f1[_0xc83c('0x38')]=_[_0xc83c('0x39')](db[_0xc83c('0x62')][_0xc83c('0x35')]);_0xad83f1[_0xc83c('0x3a')]=_[_0xc83c('0x39')](_0x5a2601[_0xc83c('0x3a')]);_0xad83f1[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0xad83f1['model'],_0xad83f1['query']);_0x293205[_0xc83c('0x3d')]=_[_0xc83c('0x4b')](_0xad83f1[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x5a2601['query'][_0xc83c('0x3c')]));_0x293205[_0xc83c('0x3d')]=_0x293205[_0xc83c('0x3d')]['length']?_0x293205[_0xc83c('0x3d')]:_0xad83f1[_0xc83c('0x38')];if(!_0x5a2601[_0xc83c('0x3a')][_0xc83c('0x5f')](_0xc83c('0x3e'))){_0x293205[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x5a2601['query'][_0xc83c('0x22')]);_0x293205[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x5a2601[_0xc83c('0x3a')]['offset']);}_0x293205[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0x5a2601[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x293205['where']=qs[_0xc83c('0x3b')](_[_0xc83c('0x41')](_0x5a2601['query'],_0xad83f1[_0xc83c('0x3b')]));_0x293205['where'][_0xc83c('0x60')]=_0x331909['id'];if(_0x5a2601[_0xc83c('0x3a')]['filter']){_0x293205[_0xc83c('0x43')]=_[_0xc83c('0x44')](_0x293205[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x293205[_0xc83c('0x3d')],function(_0x2ffc78){var _0x27b5f0={};_0x27b5f0[_0x2ffc78]={'$like':'%'+_0x5a2601[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x27b5f0;})});}_0x293205=_[_0xc83c('0x44')]({},_0x293205,_0x5a2601[_0xc83c('0x55')]);return db['CmHopperHistory']['count']({'where':_0x293205[_0xc83c('0x43')]})[_0xc83c('0x2a')](function(_0x4ab880){_0x12e162[_0xc83c('0x23')]=_0x4ab880;if(_0x5a2601[_0xc83c('0x3a')][_0xc83c('0x54')]){_0x293205[_0xc83c('0x46')]=[{'all':!![]}];}return db[_0xc83c('0x62')]['findAll'](_0x293205);})[_0xc83c('0x2a')](function(_0x1a6608){_0x12e162[_0xc83c('0x48')]=_0x1a6608;return _0x12e162;});}})[_0xc83c('0x2a')](respondWithFilteredResult(_0x4fc2c0,_0x293205))[_0xc83c('0x49')](handleError(_0x4fc2c0,null));};exports['getHopperFinals']=function(_0x2cde73,_0x193e6d,_0x5050fb){var _0x419447={'raw':!![],'where':{}};var _0x8e05c0={};var _0x5b08d6={'count':0x0,'rows':[]};return db[_0xc83c('0x34')][_0xc83c('0x5d')]({'where':{'id':_0x2cde73[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x193e6d,null))[_0xc83c('0x2a')](function(_0x469180){if(_0x469180){_0x8e05c0['model']=_[_0xc83c('0x39')](db[_0xc83c('0x63')][_0xc83c('0x35')]);_0x8e05c0[_0xc83c('0x3a')]=_[_0xc83c('0x39')](_0x2cde73['query']);_0x8e05c0[_0xc83c('0x3b')]=_['intersection'](_0x8e05c0['model'],_0x8e05c0[_0xc83c('0x3a')]);_0x419447['attributes']=_['intersection'](_0x8e05c0['model'],qs['fields'](_0x2cde73['query'][_0xc83c('0x3c')]));_0x419447[_0xc83c('0x3d')]=_0x419447[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x419447[_0xc83c('0x3d')]:_0x8e05c0[_0xc83c('0x38')];if(!_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x5f')]('nolimit')){_0x419447['limit']=qs[_0xc83c('0x22')](_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x419447[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x24')]);}_0x419447[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x419447[_0xc83c('0x43')]=qs['filters'](_[_0xc83c('0x41')](_0x2cde73[_0xc83c('0x3a')],_0x8e05c0[_0xc83c('0x3b')]));_0x419447[_0xc83c('0x43')]['CampaignId']=_0x469180['id'];if(_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x419447[_0xc83c('0x43')]=_[_0xc83c('0x44')](_0x419447[_0xc83c('0x43')],{'$or':_['map'](_0x419447[_0xc83c('0x3d')],function(_0x42db2b){var _0x280c31={};_0x280c31[_0x42db2b]={'$like':'%'+_0x2cde73[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x280c31;})});}_0x419447=_[_0xc83c('0x44')]({},_0x419447,_0x2cde73[_0xc83c('0x55')]);return db[_0xc83c('0x63')][_0xc83c('0x23')]({'where':_0x419447[_0xc83c('0x43')]})[_0xc83c('0x2a')](function(_0x443c96){_0x5b08d6[_0xc83c('0x23')]=_0x443c96;if(_0x2cde73[_0xc83c('0x3a')]['includeAll']){_0x419447[_0xc83c('0x46')]=[{'all':!![]}];}return db[_0xc83c('0x63')][_0xc83c('0x47')](_0x419447);})[_0xc83c('0x2a')](function(_0x1e996c){_0x5b08d6['rows']=_0x1e996c;return _0x5b08d6;});}})[_0xc83c('0x2a')](respondWithFilteredResult(_0x193e6d,_0x419447))[_0xc83c('0x49')](handleError(_0x193e6d,null));};exports[_0xc83c('0x64')]=function(_0x26f7a3,_0x22c2a1,_0x3b36d4){var _0x16f2e0={'raw':!![],'where':{}};var _0x5b1087={};var _0x35a48a={'count':0x0,'rows':[]};return db[_0xc83c('0x34')]['findOne']({'where':{'id':_0x26f7a3[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x22c2a1,null))[_0xc83c('0x2a')](function(_0x2ed153){if(_0x2ed153){_0x5b1087[_0xc83c('0x38')]=_['keys'](db['CmHopperBlack'][_0xc83c('0x35')]);_0x5b1087[_0xc83c('0x3a')]=_[_0xc83c('0x39')](_0x26f7a3[_0xc83c('0x3a')]);_0x5b1087[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0x5b1087[_0xc83c('0x38')],_0x5b1087[_0xc83c('0x3a')]);_0x16f2e0[_0xc83c('0x3d')]=_['intersection'](_0x5b1087[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x26f7a3[_0xc83c('0x3a')]['fields']));_0x16f2e0[_0xc83c('0x3d')]=_0x16f2e0[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x16f2e0['attributes']:_0x5b1087[_0xc83c('0x38')];if(!_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x5f')](_0xc83c('0x3e'))){_0x16f2e0[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x26f7a3['query'][_0xc83c('0x22')]);_0x16f2e0[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x24')]);}_0x16f2e0[_0xc83c('0x3f')]=qs['sort'](_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x16f2e0[_0xc83c('0x43')]=qs[_0xc83c('0x3b')](_['pick'](_0x26f7a3[_0xc83c('0x3a')],_0x5b1087[_0xc83c('0x3b')]));_0x16f2e0[_0xc83c('0x43')]['CampaignId']=_0x2ed153['id'];if(_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x16f2e0[_0xc83c('0x43')]=_['merge'](_0x16f2e0[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x16f2e0[_0xc83c('0x3d')],function(_0xfc9b7b){var _0x115e18={};_0x115e18[_0xfc9b7b]={'$like':'%'+_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x115e18;})});}_0x16f2e0=_[_0xc83c('0x44')]({},_0x16f2e0,_0x26f7a3[_0xc83c('0x55')]);return db['CmHopperBlack'][_0xc83c('0x23')]({'where':_0x16f2e0[_0xc83c('0x43')]})[_0xc83c('0x2a')](function(_0xb99392){_0x35a48a[_0xc83c('0x23')]=_0xb99392;if(_0x26f7a3[_0xc83c('0x3a')][_0xc83c('0x54')]){_0x16f2e0['include']=[{'all':!![]}];}return db[_0xc83c('0x65')][_0xc83c('0x47')](_0x16f2e0);})[_0xc83c('0x2a')](function(_0x181e0f){_0x35a48a[_0xc83c('0x48')]=_0x181e0f;return _0x35a48a;});}})[_0xc83c('0x2a')](respondWithFilteredResult(_0x22c2a1,_0x16f2e0))['catch'](handleError(_0x22c2a1,null));};exports[_0xc83c('0x66')]=function(_0x1a6143,_0xe4f80e,_0x911524){var _0x5aabd7={};var _0x90f524={};var _0x59d1b0;var _0x437e64;return db[_0xc83c('0x34')]['findOne']({'where':{'id':_0x1a6143[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0xe4f80e,null))[_0xc83c('0x2a')](function(_0x2f617e){if(_0x2f617e){_0x59d1b0=_0x2f617e;_0x90f524[_0xc83c('0x38')]=_[_0xc83c('0x39')](db[_0xc83c('0x67')][_0xc83c('0x35')]);_0x90f524[_0xc83c('0x3a')]=_[_0xc83c('0x39')](_0x1a6143[_0xc83c('0x3a')]);_0x90f524['filters']=_[_0xc83c('0x4b')](_0x90f524[_0xc83c('0x38')],_0x90f524[_0xc83c('0x3a')]);_0x5aabd7[_0xc83c('0x3d')]=_[_0xc83c('0x4b')](_0x90f524[_0xc83c('0x38')],qs['fields'](_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x3c')]));_0x5aabd7[_0xc83c('0x3d')]=_0x5aabd7[_0xc83c('0x3d')][_0xc83c('0x4c')]?_0x5aabd7[_0xc83c('0x3d')]:_0x90f524[_0xc83c('0x38')];_0x5aabd7['order']=qs['sort'](_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x40')]);_0x5aabd7[_0xc83c('0x43')]=qs[_0xc83c('0x3b')](_[_0xc83c('0x41')](_0x1a6143[_0xc83c('0x3a')],_0x90f524[_0xc83c('0x3b')]));if(_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x5aabd7[_0xc83c('0x43')]=_[_0xc83c('0x44')](_0x5aabd7[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x5aabd7[_0xc83c('0x3d')],function(_0x2e4c0b){var _0x650040={};_0x650040[_0x2e4c0b]={'$like':'%'+_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x42')]+'%'};return _0x650040;})});}_0x5aabd7=_[_0xc83c('0x44')]({},_0x5aabd7,_0x1a6143[_0xc83c('0x55')]);return _0x59d1b0[_0xc83c('0x66')](_0x5aabd7);}})[_0xc83c('0x2a')](function(_0x2eba9d){if(_0x2eba9d){_0x437e64=_0x2eba9d[_0xc83c('0x4c')];if(!_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x5f')](_0xc83c('0x3e'))){_0x5aabd7[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x5aabd7[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x1a6143[_0xc83c('0x3a')][_0xc83c('0x24')]);}return _0x59d1b0[_0xc83c('0x66')](_0x5aabd7);}})['then'](function(_0x47d7e9){if(_0x47d7e9){return _0x47d7e9?{'count':_0x437e64,'rows':_0x47d7e9}:null;}})['then'](respondWithResult(_0xe4f80e,null))['catch'](handleError(_0xe4f80e,null));};exports[_0xc83c('0x68')]=function(_0x113b24,_0x7fef7c,_0x63f95d){var _0x45b4d1,_0x211a41;return db[_0xc83c('0x34')][_0xc83c('0x56')]({'where':{'id':_0x113b24[_0xc83c('0x53')]['id']}})['then'](handleEntityNotFound(_0x7fef7c,null))[_0xc83c('0x2a')](function(_0x57f3ba){if(_0x57f3ba){_0x211a41=_0x57f3ba;return _0x57f3ba[_0xc83c('0x68')](_0x113b24[_0xc83c('0x59')][_0xc83c('0x69')],_[_0xc83c('0x57')](_0x113b24['body'],['ids','id'])||{});}return null;})[_0xc83c('0x6a')](function(_0x257903){var _0x2cf3a7;_0x45b4d1=_0x257903||[];var _0x5ec872=[];if(_0x257903){for(var _0xece747=0x0;_0xece747<_0x257903['length'];_0xece747+=0x1){var _0x5633c1=_0x257903[_0xece747][_0xc83c('0x2c')]({'plain':!![]});_0x211a41[_0xc83c('0x6b')]=_0x113b24[_0xc83c('0x59')][_0xc83c('0x6b')]?_0x113b24['body'][_0xc83c('0x6b')]:_0x211a41[_0xc83c('0x6b')];switch(_0x211a41[_0xc83c('0x6b')]){case _0xc83c('0x6c'):_0x2cf3a7=squel['insert']()['into'](_0xc83c('0x6d'))[_0xc83c('0x6e')]([_0xc83c('0x6f'),_0xc83c('0x70'),'ContactId','ListId',_0xc83c('0x60'),'createdAt','updatedAt'],squel['select']()[_0xc83c('0x71')](_0xc83c('0x6f'),_0xc83c('0x6f'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x70'))['field']('id',_0xc83c('0x73'))[_0xc83c('0x71')](_0x5633c1['CmListId'][_0xc83c('0x74')](),_0xc83c('0x75'))[_0xc83c('0x71')](_0x113b24[_0xc83c('0x53')]['id'][_0xc83c('0x74')](),_0xc83c('0x60'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x58'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x76'))[_0xc83c('0x77')](_0xc83c('0x78'))[_0xc83c('0x43')](_0xc83c('0x79'))[_0xc83c('0x43')]('ListId\x20=\x20?',_0x5633c1[_0xc83c('0x7a')][_0xc83c('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xc83c('0x43')](_0xc83c('0x7b'),squel[_0xc83c('0x7c')]()[_0xc83c('0x71')](_0xc83c('0x7d'))['from']('cm_hopper_final')[_0xc83c('0x43')](_0xc83c('0x7e'),_0x113b24['params']['id']['toString']()))['where'](_0xc83c('0x7b'),squel[_0xc83c('0x7c')]()[_0xc83c('0x71')](_0xc83c('0x7f'))[_0xc83c('0x77')](_0xc83c('0x6d'))['where'](_0xc83c('0x7e'),_0x113b24[_0xc83c('0x53')]['id'][_0xc83c('0x74')]())))[_0xc83c('0x74')]();break;case _0xc83c('0x80'):_0x2cf3a7=squel[_0xc83c('0x81')]()[_0xc83c('0x82')](_0xc83c('0x6d'))[_0xc83c('0x6e')](['phone','scheduledAt',_0xc83c('0x73'),'ListId',_0xc83c('0x60'),_0xc83c('0x58'),_0xc83c('0x76')],squel[_0xc83c('0x7c')]()['field'](_0xc83c('0x6f'),'phone')[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x70'))[_0xc83c('0x71')]('id','ContactId')[_0xc83c('0x71')](_0x5633c1[_0xc83c('0x7a')][_0xc83c('0x74')](),_0xc83c('0x75'))[_0xc83c('0x71')](_0x113b24[_0xc83c('0x53')]['id'][_0xc83c('0x74')](),_0xc83c('0x60'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x58'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x76'))[_0xc83c('0x77')](_0xc83c('0x78'))[_0xc83c('0x43')](_0xc83c('0x79'))['where'](_0xc83c('0x83'),_0x5633c1[_0xc83c('0x7a')]['toString']())[_0xc83c('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0xc83c('0x43')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xc83c('0x71')]('COALESCE(phone,\x27\x27)')[_0xc83c('0x77')](_0xc83c('0x6d'))[_0xc83c('0x43')](_0xc83c('0x7e'),_0x113b24[_0xc83c('0x53')]['id'][_0xc83c('0x74')]())))[_0xc83c('0x74')]();break;default:_0x2cf3a7=squel[_0xc83c('0x81')]()[_0xc83c('0x82')]('cm_hopper')[_0xc83c('0x6e')]([_0xc83c('0x6f'),_0xc83c('0x70'),_0xc83c('0x73'),_0xc83c('0x75'),_0xc83c('0x60'),_0xc83c('0x58'),_0xc83c('0x76')],squel[_0xc83c('0x7c')]()[_0xc83c('0x71')](_0xc83c('0x6f'),_0xc83c('0x6f'))['field'](_0xc83c('0x72'),_0xc83c('0x70'))[_0xc83c('0x71')]('id','ContactId')[_0xc83c('0x71')](_0x5633c1[_0xc83c('0x7a')]['toString'](),'ListId')[_0xc83c('0x71')](_0x113b24['params']['id']['toString'](),_0xc83c('0x60'))[_0xc83c('0x71')]('NOW()',_0xc83c('0x58'))['field'](_0xc83c('0x72'),_0xc83c('0x76'))['from'](_0xc83c('0x78'))[_0xc83c('0x43')](_0xc83c('0x79'))[_0xc83c('0x43')](_0xc83c('0x83'),_0x5633c1[_0xc83c('0x7a')][_0xc83c('0x74')]())[_0xc83c('0x43')](_0xc83c('0x84')))[_0xc83c('0x74')]();}_0x5ec872['push'](db[_0xc83c('0x85')]['query'](_0x2cf3a7));}return BPromise[_0xc83c('0x86')](_0x5ec872);}})[_0xc83c('0x2a')](function(){return _0x45b4d1;})[_0xc83c('0x2a')](respondWithResult(_0x7fef7c,null))[_0xc83c('0x49')](handleError(_0x7fef7c,null));};exports[_0xc83c('0x87')]=function(_0x49778d,_0x5b04c0,_0x5bff1d){return db[_0xc83c('0x34')][_0xc83c('0x56')]({'where':{'id':_0x49778d['params']['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x5b04c0,null))[_0xc83c('0x2a')](function(_0x4e20c9){if(_0x4e20c9){return _0x4e20c9[_0xc83c('0x87')](_0x49778d[_0xc83c('0x3a')][_0xc83c('0x69')]);}})[_0xc83c('0x2a')](function(_0x12130a){if(_0x12130a){return db['CmHopper']['destroy']({'where':{'ListId':_0x49778d['query'][_0xc83c('0x69')],'CampaignId':_0x49778d[_0xc83c('0x53')]['id']}})['then'](function(){return _0x12130a;});}})[_0xc83c('0x2a')](respondWithStatusCode(_0x5b04c0,null))[_0xc83c('0x49')](handleError(_0x5b04c0,null));};exports['getBlackLists']=function(_0x6bf887,_0x2cd6db,_0x16807f){var _0x259771={};var _0x57520f={};var _0x2e28c9;var _0x242e46;return db[_0xc83c('0x34')][_0xc83c('0x5d')]({'where':{'id':_0x6bf887[_0xc83c('0x53')]['id']}})['then'](handleEntityNotFound(_0x2cd6db,null))['then'](function(_0x41448f){if(_0x41448f){_0x2e28c9=_0x41448f;_0x57520f[_0xc83c('0x38')]=_[_0xc83c('0x39')](db[_0xc83c('0x67')]['rawAttributes']);_0x57520f['query']=_[_0xc83c('0x39')](_0x6bf887[_0xc83c('0x3a')]);_0x57520f[_0xc83c('0x3b')]=_[_0xc83c('0x4b')](_0x57520f['model'],_0x57520f['query']);_0x259771[_0xc83c('0x3d')]=_['intersection'](_0x57520f[_0xc83c('0x38')],qs[_0xc83c('0x3c')](_0x6bf887[_0xc83c('0x3a')][_0xc83c('0x3c')]));_0x259771[_0xc83c('0x3d')]=_0x259771['attributes'][_0xc83c('0x4c')]?_0x259771['attributes']:_0x57520f['model'];_0x259771[_0xc83c('0x3f')]=qs[_0xc83c('0x40')](_0x6bf887['query']['sort']);_0x259771[_0xc83c('0x43')]=qs['filters'](_[_0xc83c('0x41')](_0x6bf887[_0xc83c('0x3a')],_0x57520f[_0xc83c('0x3b')]));if(_0x6bf887[_0xc83c('0x3a')][_0xc83c('0x42')]){_0x259771['where']=_['merge'](_0x259771[_0xc83c('0x43')],{'$or':_[_0xc83c('0x33')](_0x259771['attributes'],function(_0x39569f){var _0x585c45={};_0x585c45[_0x39569f]={'$like':'%'+_0x6bf887[_0xc83c('0x3a')]['filter']+'%'};return _0x585c45;})});}_0x259771=_['merge']({},_0x259771,_0x6bf887['options']);return _0x2e28c9['getBlackLists'](_0x259771);}})['then'](function(_0x166587){if(_0x166587){_0x242e46=_0x166587[_0xc83c('0x4c')];if(!_0x6bf887[_0xc83c('0x3a')]['hasOwnProperty'](_0xc83c('0x3e'))){_0x259771[_0xc83c('0x22')]=qs[_0xc83c('0x22')](_0x6bf887[_0xc83c('0x3a')][_0xc83c('0x22')]);_0x259771[_0xc83c('0x24')]=qs[_0xc83c('0x24')](_0x6bf887[_0xc83c('0x3a')][_0xc83c('0x24')]);}return _0x2e28c9[_0xc83c('0x88')](_0x259771);}})[_0xc83c('0x2a')](function(_0x5682ae){if(_0x5682ae){return _0x5682ae?{'count':_0x242e46,'rows':_0x5682ae}:null;}})[_0xc83c('0x2a')](respondWithResult(_0x2cd6db,null))[_0xc83c('0x49')](handleError(_0x2cd6db,null));};exports['addBlackLists']=function(_0x5478c8,_0x188e4b,_0x44652a){var _0x1ebb22,_0x3eefbd;return db[_0xc83c('0x34')]['find']({'where':{'id':_0x5478c8[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](handleEntityNotFound(_0x188e4b,null))[_0xc83c('0x2a')](function(_0x40d2ff){if(_0x40d2ff){_0x3eefbd=_0x40d2ff;return _0x40d2ff['addBlackLists'](_0x5478c8[_0xc83c('0x59')]['ids'],_[_0xc83c('0x57')](_0x5478c8[_0xc83c('0x59')],[_0xc83c('0x69'),'id'])||{});}return null;})[_0xc83c('0x6a')](function(_0x58c1b0){var _0x515c41;_0x1ebb22=_0x58c1b0||[];var _0x3ffa06=[];if(_0x58c1b0){for(var _0x49e3e7=0x0;_0x49e3e7<_0x58c1b0[_0xc83c('0x4c')];_0x49e3e7+=0x1){var _0x5287b8=_0x58c1b0[_0x49e3e7]['get']({'plain':!![]});_0x515c41=squel[_0xc83c('0x81')]()[_0xc83c('0x82')]('cm_hopper_black')[_0xc83c('0x6e')]([_0xc83c('0x6f'),_0xc83c('0x73'),'ListId',_0xc83c('0x60'),_0xc83c('0x58'),_0xc83c('0x76')],squel[_0xc83c('0x7c')]()[_0xc83c('0x71')](_0xc83c('0x6f'),_0xc83c('0x6f'))[_0xc83c('0x71')]('id',_0xc83c('0x73'))[_0xc83c('0x71')](_0x5287b8[_0xc83c('0x7a')][_0xc83c('0x74')](),_0xc83c('0x75'))[_0xc83c('0x71')](_0x5478c8[_0xc83c('0x53')]['id'][_0xc83c('0x74')](),_0xc83c('0x60'))[_0xc83c('0x71')](_0xc83c('0x72'),_0xc83c('0x58'))['field']('NOW()','updatedAt')['from'](_0xc83c('0x78'))[_0xc83c('0x43')](_0xc83c('0x79'))[_0xc83c('0x43')]('ListId\x20=\x20?',_0x5287b8[_0xc83c('0x7a')][_0xc83c('0x74')]())[_0xc83c('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0xc83c('0x74')]();_0x3ffa06['push'](db[_0xc83c('0x85')][_0xc83c('0x3a')](_0x515c41));}return BPromise['all'](_0x3ffa06);}})[_0xc83c('0x2a')](function(){return _0x1ebb22;})[_0xc83c('0x2a')](respondWithResult(_0x188e4b,null))['catch'](handleError(_0x188e4b,null));};exports[_0xc83c('0x89')]=function(_0x33faa4,_0x32400f,_0x5047fa){return db[_0xc83c('0x34')][_0xc83c('0x56')]({'where':{'id':_0x33faa4[_0xc83c('0x53')]['id']}})['then'](handleEntityNotFound(_0x32400f,null))[_0xc83c('0x2a')](function(_0x171bfa){if(_0x171bfa){return _0x171bfa[_0xc83c('0x89')](_0x33faa4[_0xc83c('0x3a')][_0xc83c('0x69')]);}})[_0xc83c('0x2a')](function(_0x5b7505){if(_0x5b7505){return db['CmHopperBlack'][_0xc83c('0x2b')]({'where':{'ListId':_0x33faa4['query'][_0xc83c('0x69')],'CampaignId':_0x33faa4[_0xc83c('0x53')]['id']}})[_0xc83c('0x2a')](function(){return _0x5b7505;});}})[_0xc83c('0x2a')](respondWithStatusCode(_0x32400f,null))['catch'](handleError(_0x32400f,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index a03e68e..34ebd52 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xe5819f,_0x23d35a){var _0x4898bf=function(_0x10be86){while(--_0x10be86){_0xe5819f['push'](_0xe5819f['shift']());}};_0x4898bf(++_0x23d35a);}(_0x7a54,0x106));var _0x47a5=function(_0x507d94,_0x48a3eb){_0x507d94=_0x507d94-0x0;var _0x46562a=_0x7a54[_0x507d94];return _0x46562a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 294905a..17528aa 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 _0x6c6f=['model','GetCampaign','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','findAll','options','raw','where','attributes','include','map'];(function(_0x1cc232,_0x18c4e7){var _0x179524=function(_0xead52e){while(--_0xead52e){_0x1cc232['push'](_0x1cc232['shift']());}};_0x179524(++_0x18c4e7);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x33bbe3,_0x3f46c9){_0x33bbe3=_0x33bbe3-0x0;var _0x23387f=_0x6c6f[_0x33bbe3];return _0x23387f;};'use strict';var _=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var moment=require(_0xf6c6('0x2'));var BPromise=require(_0xf6c6('0x3'));var rs=require(_0xf6c6('0x4'));var fs=require('fs');var Redis=require(_0xf6c6('0x5'));var db=require(_0xf6c6('0x6'))['db'];var utils=require(_0xf6c6('0x7'));var logger=require(_0xf6c6('0x8'))(_0xf6c6('0x9'));var config=require(_0xf6c6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf6c6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c27f8,_0x34ea40,_0x5b34df){return new BPromise(function(_0x308c42,_0x296564){return client[_0xf6c6('0xc')](_0x4c27f8,_0x5b34df)[_0xf6c6('0xd')](function(_0x2d2053){logger['info'](_0xf6c6('0xe'),_0x34ea40,_0xf6c6('0xf'));logger['debug'](_0xf6c6('0x10'),_0x34ea40,_0xf6c6('0xf'),JSON[_0xf6c6('0x11')](_0x2d2053));if(_0x2d2053['error']){if(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x13')]===0x1f4){logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);return _0x296564(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);}logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x2d2053['error'][_0xf6c6('0x14')]);return _0x308c42(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);}else{logger[_0xf6c6('0x15')]('Campaign,\x20%s,\x20%s',_0x34ea40,'request\x20sent');_0x308c42(_0x2d2053[_0xf6c6('0x16')][_0xf6c6('0x14')]);}})['catch'](function(_0x9f633c){logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x9f633c);_0x296564(_0x9f633c);});});}exports['GetCampaign']=function(_0x8d6718){var _0x1455c5=this;return new Promise(function(_0x57a496,_0x23ed9c){return db['Campaign'][_0xf6c6('0x17')]({'raw':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718['options'][_0xf6c6('0x19')]===undefined?!![]:![]:!![],'where':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1a')]||null:null,'attributes':_0x8d6718['options']?_0x8d6718['options'][_0xf6c6('0x1b')]||null:null,'limit':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')]['limit']||null:null,'include':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1c')],function(_0x43e074){return{'model':db[_0x43e074[_0xf6c6('0x1e')]],'as':_0x43e074['as'],'attributes':_0x43e074['attributes'],'include':_0x43e074[_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x43e074[_0xf6c6('0x1c')],function(_0x37cc28){return{'model':db[_0x37cc28['model']],'as':_0x37cc28['as'],'attributes':_0x37cc28[_0xf6c6('0x1b')],'include':_0x37cc28[_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x37cc28[_0xf6c6('0x1c')],function(_0x365f43){return{'model':db[_0x365f43[_0xf6c6('0x1e')]],'as':_0x365f43['as'],'attributes':_0x365f43[_0xf6c6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf6c6('0xd')](function(_0x3f00ae){logger[_0xf6c6('0x15')](_0xf6c6('0x1f'),_0x8d6718);logger[_0xf6c6('0x20')](_0xf6c6('0x1f'),_0x8d6718,JSON[_0xf6c6('0x11')](_0x3f00ae));_0x57a496(_0x3f00ae);})[_0xf6c6('0x21')](function(_0x4c5a20){logger[_0xf6c6('0x12')](_0xf6c6('0x1f'),_0x4c5a20[_0xf6c6('0x14')],_0x8d6718);_0x23ed9c(_0x1455c5[_0xf6c6('0x12')](0x1f4,_0x4c5a20[_0xf6c6('0x14')]));});});};
\ No newline at end of file
+var _0xab3a=['request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetCampaign','Campaign','findAll','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab3a,0x1d3));var _0xaab3=function(_0x4c29f9,_0x5bddd4){_0x4c29f9=_0x4c29f9-0x0;var _0x4e17b8=_0xab3a[_0x4c29f9];return _0x4e17b8;};'use strict';var _=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var moment=require(_0xaab3('0x2'));var BPromise=require(_0xaab3('0x3'));var rs=require(_0xaab3('0x4'));var fs=require('fs');var Redis=require(_0xaab3('0x5'));var db=require(_0xaab3('0x6'))['db'];var utils=require(_0xaab3('0x7'));var logger=require(_0xaab3('0x8'))(_0xaab3('0x9'));var config=require(_0xaab3('0xa'));var jayson=require(_0xaab3('0xb'));var client=jayson[_0xaab3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5760e8,_0x501657,_0x1fd19f){return new BPromise(function(_0x146453,_0x21527a){return client[_0xaab3('0xd')](_0x5760e8,_0x1fd19f)[_0xaab3('0xe')](function(_0x15841e){logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));logger[_0xaab3('0x12')]('Campaign,\x20%s,\x20%s,\x20%s',_0x501657,'request\x20sent',JSON[_0xaab3('0x13')](_0x15841e));if(_0x15841e[_0xaab3('0x14')]){if(_0x15841e[_0xaab3('0x14')][_0xaab3('0x15')]===0x1f4){logger['error'](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x21527a(_0x15841e['error'][_0xaab3('0x16')]);}logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x146453(_0x15841e[_0xaab3('0x14')]['message']);}else{logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));_0x146453(_0x15841e['result']['message']);}})['catch'](function(_0x484dc5){logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x484dc5);_0x21527a(_0x484dc5);});});}exports[_0xaab3('0x17')]=function(_0x5a3ecc){var _0x3052a5=this;return new Promise(function(_0x46aefc,_0x3a06f2){return db[_0xaab3('0x18')][_0xaab3('0x19')]({'raw':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1b')]||null:null,'attributes':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['attributes']||null:null,'limit':_0x5a3ecc['options']?_0x5a3ecc['options']['limit']||null:null,'include':_0x5a3ecc['options']?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')],function(_0x1816ab){return{'model':db[_0x1816ab[_0xaab3('0x1e')]],'as':_0x1816ab['as'],'attributes':_0x1816ab[_0xaab3('0x1f')],'include':_0x1816ab[_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x1816ab[_0xaab3('0x1c')],function(_0x3097ec){return{'model':db[_0x3097ec[_0xaab3('0x1e')]],'as':_0x3097ec['as'],'attributes':_0x3097ec['attributes'],'include':_0x3097ec[_0xaab3('0x1c')]?_['map'](_0x3097ec[_0xaab3('0x1c')],function(_0x2904f8){return{'model':db[_0x2904f8['model']],'as':_0x2904f8['as'],'attributes':_0x2904f8[_0xaab3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaab3('0xe')](function(_0x263362){logger['info']('GetCampaign',_0x5a3ecc);logger[_0xaab3('0x12')](_0xaab3('0x17'),_0x5a3ecc,JSON[_0xaab3('0x13')](_0x263362));_0x46aefc(_0x263362);})['catch'](function(_0x168eb0){logger[_0xaab3('0x14')](_0xaab3('0x17'),_0x168eb0[_0xaab3('0x16')],_0x5a3ecc);_0x3a06f2(_0x3052a5[_0xaab3('0x14')](0x1f4,_0x168eb0[_0xaab3('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 2032af2..c3f8444 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 _0x4dbf=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0xcf1b7e,_0x1a0d6a){var _0x474286=function(_0x2b440a){while(--_0x2b440a){_0xcf1b7e['push'](_0xcf1b7e['shift']());}};_0x474286(++_0x1a0d6a);}(_0x4dbf,0xe8));var _0xf4db=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x4dbf[_0x556927];return _0x5f1235;};'use strict';var multer=require(_0xf4db('0x0'));var util=require(_0xf4db('0x1'));var path=require(_0xf4db('0x2'));var timeout=require(_0xf4db('0x3'));var express=require(_0xf4db('0x4'));var router=express[_0xf4db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf4db('0x6'));var interaction=require(_0xf4db('0x7'));var config=require(_0xf4db('0x8'));var controller=require(_0xf4db('0x9'));router[_0xf4db('0xa')]('/',auth[_0xf4db('0xb')](),controller[_0xf4db('0xc')]);router[_0xf4db('0xa')](_0xf4db('0xd'),auth[_0xf4db('0xb')](),controller[_0xf4db('0xe')]);router[_0xf4db('0xa')](_0xf4db('0xf'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x10')]);router['get'](_0xf4db('0x11'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x12')]);router[_0xf4db('0xa')](_0xf4db('0x13'),auth['isAuthenticated'](),controller[_0xf4db('0x14')]);router['get'](_0xf4db('0x15'),auth['isAuthenticated'](),controller[_0xf4db('0x16')]);router[_0xf4db('0xa')](_0xf4db('0x17'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x18')]);router['get'](_0xf4db('0x19'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0xf4db('0xb')](),controller[_0xf4db('0x1a')]);router[_0xf4db('0x1b')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0xf4db('0x1b')](_0xf4db('0x17'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x1c')]);router[_0xf4db('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xf4db('0x1d')]);router[_0xf4db('0x1e')](_0xf4db('0xd'),auth[_0xf4db('0xb')](),controller[_0xf4db('0x1f')]);router[_0xf4db('0x20')]('/:id',auth[_0xf4db('0xb')](),controller['destroy']);router[_0xf4db('0x20')]('/:id/lists',auth[_0xf4db('0xb')](),controller[_0xf4db('0x21')]);router[_0xf4db('0x20')]('/:id/blacklists',auth[_0xf4db('0xb')](),controller[_0xf4db('0x22')]);module[_0xf4db('0x23')]=router;
\ No newline at end of file
+var _0x3bff=['index','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','addLists','put','update','delete','removeBlackLists','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x3bff,0xd0));var _0xf3bf=function(_0x263965,_0x1167b8){_0x263965=_0x263965-0x0;var _0x50ecac=_0x3bff[_0x263965];return _0x50ecac;};'use strict';var multer=require(_0xf3bf('0x0'));var util=require('util');var path=require(_0xf3bf('0x1'));var timeout=require(_0xf3bf('0x2'));var express=require('express');var router=express[_0xf3bf('0x3')]();var fs_extra=require(_0xf3bf('0x4'));var auth=require(_0xf3bf('0x5'));var interaction=require(_0xf3bf('0x6'));var config=require('../../config/environment');var controller=require(_0xf3bf('0x7'));router['get']('/',auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x9')]);router[_0xf3bf('0xa')](_0xf3bf('0xb'),auth['isAuthenticated'](),controller[_0xf3bf('0xc')]);router['get'](_0xf3bf('0xd'),auth[_0xf3bf('0x8')](),controller['getHoppers']);router[_0xf3bf('0xa')](_0xf3bf('0xe'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0xf')]);router['get'](_0xf3bf('0x10'),auth[_0xf3bf('0x8')](),controller['getHopperFinals']);router[_0xf3bf('0xa')](_0xf3bf('0x11'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x12')]);router['get'](_0xf3bf('0x13'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x14')]);router['get'](_0xf3bf('0x15'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x16')]);router['post']('/',auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x17')]);router[_0xf3bf('0x18')]('/:id/clone',auth[_0xf3bf('0x8')](),controller['clone']);router['post'](_0xf3bf('0x13'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x19')]);router[_0xf3bf('0x18')](_0xf3bf('0x15'),auth[_0xf3bf('0x8')](),controller['addBlackLists']);router[_0xf3bf('0x1a')](_0xf3bf('0xb'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x1b')]);router[_0xf3bf('0x1c')](_0xf3bf('0xb'),auth[_0xf3bf('0x8')](),controller['destroy']);router[_0xf3bf('0x1c')](_0xf3bf('0x13'),auth['isAuthenticated'](),controller['removeLists']);router[_0xf3bf('0x1c')](_0xf3bf('0x15'),auth[_0xf3bf('0x8')](),controller[_0xf3bf('0x1d')]);module[_0xf3bf('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 5462892..9cc4368 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 _0x9d92=['VIRTUAL','getDataValue','sequelize','exports','STRING','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9d92,0xe0));var _0x29d9=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x9d92[_0xa3fadc];return _0x23ecb8;};'use strict';var Sequelize=require(_0x29d9('0x0'));module[_0x29d9('0x1')]={'key':{'type':Sequelize[_0x29d9('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x29d9('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x29d9('0x4')],'get':function(){return this[_0x29d9('0x5')]('key');}}};
\ No newline at end of file
+var _0x64df=['TEXT','STRING','key','sequelize','exports'];(function(_0xf1de36,_0x5983c6){var _0x2240eb=function(_0xd0c4b9){while(--_0xd0c4b9){_0xf1de36['push'](_0xf1de36['shift']());}};_0x2240eb(++_0x5983c6);}(_0x64df,0x152));var _0xf64d=function(_0x41b683,_0x10e5ab){_0x41b683=_0x41b683-0x0;var _0x3e8d91=_0x64df[_0x41b683];return _0x3e8d91;};'use strict';var Sequelize=require(_0xf64d('0x0'));module[_0xf64d('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf64d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf64d('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xf64d('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 9398776..d6e9c0e 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 _0x94a9=['offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','CannedAnswer','includeAll','include','findAll','rows','catch','params','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x2f7f5d,_0x5a5b8f){var _0x2850b2=function(_0x1e3f80){while(--_0x1e3f80){_0x2f7f5d['push'](_0x2f7f5d['shift']());}};_0x2850b2(++_0x5a5b8f);}(_0x94a9,0x1ea));var _0x994a=function(_0x2a6f13,_0x4af20b){_0x2a6f13=_0x2a6f13-0x0;var _0x57b5ab=_0x94a9[_0x2a6f13];return _0x57b5ab;};'use strict';var emlformat=require(_0x994a('0x0'));var rimraf=require(_0x994a('0x1'));var zipdir=require(_0x994a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x994a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x994a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x994a('0x5'));var csv=require(_0x994a('0x6'));var ejs=require(_0x994a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x994a('0x8'));var squel=require('squel');var crypto=require(_0x994a('0x9'));var jsforce=require(_0x994a('0xa'));var deskjs=require(_0x994a('0xb'));var toCsv=require(_0x994a('0x6'));var querystring=require('querystring');var Papa=require(_0x994a('0xc'));var Redis=require('ioredis');var authService=require(_0x994a('0xd'));var qs=require(_0x994a('0xe'));var as=require(_0x994a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x994a('0x10'))('api');var utils=require(_0x994a('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x994a('0x12'));var db=require(_0x994a('0x13'))['db'];function respondWithStatusCode(_0x1ee87c,_0x18e87a){_0x18e87a=_0x18e87a||0xcc;return function(_0x10e125){if(_0x10e125){return _0x1ee87c[_0x994a('0x14')](_0x18e87a);}return _0x1ee87c[_0x994a('0x15')](_0x18e87a)[_0x994a('0x16')]();};}function respondWithResult(_0x3b1f58,_0xf8b4c6){_0xf8b4c6=_0xf8b4c6||0xc8;return function(_0x577254){if(_0x577254){return _0x3b1f58[_0x994a('0x15')](_0xf8b4c6)[_0x994a('0x17')](_0x577254);}};}function respondWithFilteredResult(_0x1cd561,_0x24269c){return function(_0x30c094){if(_0x30c094){var _0x4e1155=typeof _0x24269c['offset']===_0x994a('0x18')&&typeof _0x24269c[_0x994a('0x19')]===_0x994a('0x18');var _0x2e1774=_0x30c094['count'];var _0x9c9085=_0x4e1155?0x0:_0x24269c[_0x994a('0x1a')];var _0x37da4a=_0x4e1155?_0x30c094[_0x994a('0x1b')]:_0x24269c[_0x994a('0x1a')]+_0x24269c[_0x994a('0x19')];var _0x71873b;if(_0x37da4a>=_0x2e1774){_0x37da4a=_0x2e1774;_0x71873b=0xc8;}else{_0x71873b=0xce;}_0x1cd561[_0x994a('0x15')](_0x71873b);return _0x1cd561[_0x994a('0x1c')](_0x994a('0x1d'),_0x9c9085+'-'+_0x37da4a+'/'+_0x2e1774)[_0x994a('0x17')](_0x30c094);}return null;};}function patchUpdates(_0x472fba){return function(_0x4c16cc){try{jsonpatch[_0x994a('0x1e')](_0x4c16cc,_0x472fba,!![]);}catch(_0x48b02c){return BPromise[_0x994a('0x1f')](_0x48b02c);}return _0x4c16cc[_0x994a('0x20')]();};}function saveUpdates(_0x4f5951,_0x4fd313){return function(_0x3be584){if(_0x3be584){return _0x3be584[_0x994a('0x21')](_0x4f5951)[_0x994a('0x22')](function(_0x3ce980){return _0x3ce980;});}return null;};}function removeEntity(_0x5656d2,_0x5cf5c1){return function(_0x5cd778){if(_0x5cd778){return _0x5cd778[_0x994a('0x23')]()['then'](function(){var _0xa8967=_0x5cd778[_0x994a('0x24')]({'plain':!![]});var _0x349841='CannedAnswers';return db[_0x994a('0x25')][_0x994a('0x23')]({'where':{'type':_0x349841,'resourceId':_0xa8967['id']}})[_0x994a('0x22')](function(){return _0x5cd778;});})[_0x994a('0x22')](function(){_0x5656d2[_0x994a('0x15')](0xcc)[_0x994a('0x16')]();});}};}function handleEntityNotFound(_0xb54f0d,_0xdbcb5c){return function(_0xa938d3){if(!_0xa938d3){_0xb54f0d['sendStatus'](0x194);}return _0xa938d3;};}function handleError(_0x9fb3a,_0x3dc839){_0x3dc839=_0x3dc839||0x1f4;return function(_0x172846){logger[_0x994a('0x26')](_0x172846['stack']);if(_0x172846[_0x994a('0x27')]){delete _0x172846[_0x994a('0x27')];}_0x9fb3a[_0x994a('0x15')](_0x3dc839)[_0x994a('0x28')](_0x172846);};}exports[_0x994a('0x29')]=function(_0x21178d,_0xc70f92){var _0x200705={},_0x4b78b8={},_0x124779={'count':0x0,'rows':[]};var _0x592269=_[_0x994a('0x2a')](db['CannedAnswer'][_0x994a('0x2b')],function(_0x1139de){return{'name':_0x1139de[_0x994a('0x2c')],'type':_0x1139de[_0x994a('0x2d')][_0x994a('0x2e')]};});_0x4b78b8['model']=_[_0x994a('0x2a')](_0x592269,_0x994a('0x27'));_0x4b78b8[_0x994a('0x2f')]=_[_0x994a('0x30')](_0x21178d['query']);_0x4b78b8[_0x994a('0x31')]=_[_0x994a('0x32')](_0x4b78b8[_0x994a('0x33')],_0x4b78b8[_0x994a('0x2f')]);_0x200705[_0x994a('0x34')]=_['intersection'](_0x4b78b8['model'],qs[_0x994a('0x35')](_0x21178d[_0x994a('0x2f')]['fields']));_0x200705['attributes']=_0x200705['attributes']['length']?_0x200705[_0x994a('0x34')]:_0x4b78b8[_0x994a('0x33')];if(!_0x21178d[_0x994a('0x2f')][_0x994a('0x36')](_0x994a('0x37'))){_0x200705[_0x994a('0x19')]=qs[_0x994a('0x19')](_0x21178d[_0x994a('0x2f')]['limit']);_0x200705[_0x994a('0x1a')]=qs[_0x994a('0x1a')](_0x21178d[_0x994a('0x2f')][_0x994a('0x1a')]);}_0x200705[_0x994a('0x38')]=qs[_0x994a('0x39')](_0x21178d[_0x994a('0x2f')][_0x994a('0x39')]);_0x200705['where']=qs[_0x994a('0x31')](_[_0x994a('0x3a')](_0x21178d['query'],_0x4b78b8[_0x994a('0x31')]),_0x592269);if(_0x21178d[_0x994a('0x2f')][_0x994a('0x3b')]){_0x200705[_0x994a('0x3c')]=_[_0x994a('0x3d')](_0x200705[_0x994a('0x3c')],{'$or':[{'key':{'$like':'%'+_0x21178d[_0x994a('0x2f')][_0x994a('0x3b')]+'%'}},{'value':{'$like':'%'+_0x21178d[_0x994a('0x2f')][_0x994a('0x3b')]+'%'}}]});}_0x200705=_[_0x994a('0x3d')]({},_0x200705,_0x21178d['options']);var _0x2e0bcf={'where':_0x200705['where']};return db[_0x994a('0x3e')][_0x994a('0x1b')](_0x2e0bcf)[_0x994a('0x22')](function(_0x53db31){_0x124779['count']=_0x53db31;if(_0x21178d[_0x994a('0x2f')][_0x994a('0x3f')]){_0x200705[_0x994a('0x40')]=[{'all':!![]}];}return db[_0x994a('0x3e')][_0x994a('0x41')](_0x200705);})['then'](function(_0x4c684b){_0x124779[_0x994a('0x42')]=_0x4c684b;return _0x124779;})[_0x994a('0x22')](respondWithFilteredResult(_0xc70f92,_0x200705))[_0x994a('0x43')](handleError(_0xc70f92,null));};exports['show']=function(_0x338a90,_0x3245a5){var _0x5354f3={'raw':!![],'where':{'id':_0x338a90[_0x994a('0x44')]['id']}},_0xf41a95={};_0xf41a95[_0x994a('0x33')]=_[_0x994a('0x30')](db[_0x994a('0x3e')]['rawAttributes']);_0xf41a95[_0x994a('0x2f')]=_[_0x994a('0x30')](_0x338a90[_0x994a('0x2f')]);_0xf41a95[_0x994a('0x31')]=_[_0x994a('0x32')](_0xf41a95['model'],_0xf41a95['query']);_0x5354f3[_0x994a('0x34')]=_[_0x994a('0x32')](_0xf41a95['model'],qs[_0x994a('0x35')](_0x338a90[_0x994a('0x2f')][_0x994a('0x35')]));_0x5354f3[_0x994a('0x34')]=_0x5354f3[_0x994a('0x34')]['length']?_0x5354f3[_0x994a('0x34')]:_0xf41a95[_0x994a('0x33')];if(_0x338a90[_0x994a('0x2f')]['includeAll']){_0x5354f3[_0x994a('0x40')]=[{'all':!![]}];}_0x5354f3=_[_0x994a('0x3d')]({},_0x5354f3,_0x338a90[_0x994a('0x45')]);return db['CannedAnswer'][_0x994a('0x46')](_0x5354f3)['then'](handleEntityNotFound(_0x3245a5,null))[_0x994a('0x22')](respondWithResult(_0x3245a5,null))[_0x994a('0x43')](handleError(_0x3245a5,null));};exports[_0x994a('0x21')]=function(_0x584a21,_0x38a085){if(_0x584a21[_0x994a('0x47')]['id']){delete _0x584a21[_0x994a('0x47')]['id'];}return db[_0x994a('0x3e')][_0x994a('0x46')]({'where':{'id':_0x584a21[_0x994a('0x44')]['id']}})['then'](handleEntityNotFound(_0x38a085,null))[_0x994a('0x22')](saveUpdates(_0x584a21[_0x994a('0x47')],null))[_0x994a('0x22')](respondWithResult(_0x38a085,null))['catch'](handleError(_0x38a085,null));};exports[_0x994a('0x23')]=function(_0x4e6b56,_0x20c623){return db[_0x994a('0x3e')]['find']({'where':{'id':_0x4e6b56[_0x994a('0x44')]['id']}})[_0x994a('0x22')](handleEntityNotFound(_0x20c623,null))[_0x994a('0x22')](removeEntity(_0x20c623,null))[_0x994a('0x43')](handleError(_0x20c623,null));};exports[_0x994a('0x48')]=function(_0x5068a0,_0x265224){var _0x420efe={'key':_0x5068a0[_0x994a('0x47')][_0x994a('0x2e')]};if(_0x5068a0[_0x994a('0x47')][_0x994a('0x49')]){_0x420efe[_0x994a('0x49')]=_0x5068a0[_0x994a('0x47')]['MailAccountId'];}else if(_0x5068a0[_0x994a('0x47')][_0x994a('0x4a')]){_0x420efe['SmsAccountId']=_0x5068a0[_0x994a('0x47')][_0x994a('0x4a')];}else if(_0x5068a0['body'][_0x994a('0x4b')]){_0x420efe['OpenchannelAccountId']=_0x5068a0[_0x994a('0x47')][_0x994a('0x4b')];}else if(_0x5068a0[_0x994a('0x47')][_0x994a('0x4c')]){_0x420efe[_0x994a('0x4c')]=_0x5068a0[_0x994a('0x47')][_0x994a('0x4c')];}return db[_0x994a('0x3e')]['find']({'where':_0x420efe})[_0x994a('0x22')](function(_0x13e098){if(_0x13e098){throw new db[(_0x994a('0x4d'))]['ValidationError'](_0x994a('0x4e'));}return db[_0x994a('0x3e')][_0x994a('0x48')](_0x5068a0['body']);})[_0x994a('0x22')](function(_0x38d036){var _0x2d1c20=_0x5068a0[_0x994a('0x4f')]['get']({'plain':!![]});if(!_0x2d1c20)throw new Error(_0x994a('0x50'));if(_0x2d1c20[_0x994a('0x51')]===_0x994a('0x4f')){var _0x47d3ee=_0x38d036['get']({'plain':!![]});return db[_0x994a('0x52')]['find']({'where':{'name':_0x994a('0x53'),'userProfileId':_0x2d1c20['userProfileId']},'raw':!![]})[_0x994a('0x22')](function(_0x1f6aba){if(_0x1f6aba&&_0x1f6aba[_0x994a('0x54')]===0x0){return db[_0x994a('0x25')][_0x994a('0x48')]({'name':_0x47d3ee['name'],'resourceId':_0x47d3ee['id'],'type':_0x1f6aba['name'],'sectionId':_0x1f6aba['id']},{})['then'](function(){return _0x38d036;});}else{return _0x38d036;}})['catch'](function(_0x579afd){logger['error'](_0x994a('0x55'),_0x579afd);throw _0x579afd;});}return _0x38d036;})[_0x994a('0x22')](respondWithResult(_0x265224,0xc9))[_0x994a('0x43')](handleError(_0x265224,null));};
\ No newline at end of file
+var _0x4735=['ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','index','CannedAnswer','rawAttributes','fieldName','key','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','findAll','rows','params','options','find','body','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize'];(function(_0x305528,_0x263ca6){var _0x2531f0=function(_0x4b379a){while(--_0x4b379a){_0x305528['push'](_0x305528['shift']());}};_0x2531f0(++_0x263ca6);}(_0x4735,0x1b2));var _0x5473=function(_0x158b34,_0x2a8fb1){_0x158b34=_0x158b34-0x0;var _0x2f5449=_0x4735[_0x158b34];return _0x2f5449;};'use strict';var emlformat=require(_0x5473('0x0'));var rimraf=require(_0x5473('0x1'));var zipdir=require(_0x5473('0x2'));var jsonpatch=require(_0x5473('0x3'));var rp=require('request-promise');var moment=require(_0x5473('0x4'));var BPromise=require(_0x5473('0x5'));var Mustache=require(_0x5473('0x6'));var util=require(_0x5473('0x7'));var path=require(_0x5473('0x8'));var sox=require('sox');var csv=require(_0x5473('0x9'));var ejs=require(_0x5473('0xa'));var fs=require('fs');var fs_extra=require(_0x5473('0xb'));var _=require('lodash');var squel=require(_0x5473('0xc'));var crypto=require(_0x5473('0xd'));var jsforce=require(_0x5473('0xe'));var deskjs=require(_0x5473('0xf'));var toCsv=require(_0x5473('0x9'));var querystring=require('querystring');var Papa=require(_0x5473('0x10'));var Redis=require(_0x5473('0x11'));var authService=require(_0x5473('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5473('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5473('0x14'))(_0x5473('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5473('0x16'));var db=require(_0x5473('0x17'))['db'];function respondWithStatusCode(_0x5ab499,_0x28d978){_0x28d978=_0x28d978||0xcc;return function(_0xdaef94){if(_0xdaef94){return _0x5ab499[_0x5473('0x18')](_0x28d978);}return _0x5ab499[_0x5473('0x19')](_0x28d978)[_0x5473('0x1a')]();};}function respondWithResult(_0x340981,_0x5700b3){_0x5700b3=_0x5700b3||0xc8;return function(_0x202390){if(_0x202390){return _0x340981[_0x5473('0x19')](_0x5700b3)[_0x5473('0x1b')](_0x202390);}};}function respondWithFilteredResult(_0x5b7b66,_0x429b71){return function(_0xfdb37c){if(_0xfdb37c){var _0x5b1ab7=typeof _0x429b71[_0x5473('0x1c')]===_0x5473('0x1d')&&typeof _0x429b71['limit']===_0x5473('0x1d');var _0x20254a=_0xfdb37c['count'];var _0x35b680=_0x5b1ab7?0x0:_0x429b71[_0x5473('0x1c')];var _0xae89c0=_0x5b1ab7?_0xfdb37c[_0x5473('0x1e')]:_0x429b71[_0x5473('0x1c')]+_0x429b71['limit'];var _0xd06364;if(_0xae89c0>=_0x20254a){_0xae89c0=_0x20254a;_0xd06364=0xc8;}else{_0xd06364=0xce;}_0x5b7b66[_0x5473('0x19')](_0xd06364);return _0x5b7b66['set'](_0x5473('0x1f'),_0x35b680+'-'+_0xae89c0+'/'+_0x20254a)[_0x5473('0x1b')](_0xfdb37c);}return null;};}function patchUpdates(_0x19275a){return function(_0x110a51){try{jsonpatch[_0x5473('0x20')](_0x110a51,_0x19275a,!![]);}catch(_0x1784cf){return BPromise[_0x5473('0x21')](_0x1784cf);}return _0x110a51[_0x5473('0x22')]();};}function saveUpdates(_0x50e429,_0x1b912b){return function(_0x16e37a){if(_0x16e37a){return _0x16e37a[_0x5473('0x23')](_0x50e429)[_0x5473('0x24')](function(_0xc2754a){return _0xc2754a;});}return null;};}function removeEntity(_0x173947,_0x3de156){return function(_0x27194e){if(_0x27194e){return _0x27194e[_0x5473('0x25')]()[_0x5473('0x24')](function(){var _0x5cd616=_0x27194e[_0x5473('0x26')]({'plain':!![]});var _0x15fd84='CannedAnswers';return db[_0x5473('0x27')][_0x5473('0x25')]({'where':{'type':_0x15fd84,'resourceId':_0x5cd616['id']}})[_0x5473('0x24')](function(){return _0x27194e;});})[_0x5473('0x24')](function(){_0x173947[_0x5473('0x19')](0xcc)[_0x5473('0x1a')]();});}};}function handleEntityNotFound(_0x32a956,_0x357cc8){return function(_0x434018){if(!_0x434018){_0x32a956[_0x5473('0x18')](0x194);}return _0x434018;};}function handleError(_0x5b59f4,_0x1741ee){_0x1741ee=_0x1741ee||0x1f4;return function(_0x3e9ceb){logger['error'](_0x3e9ceb['stack']);if(_0x3e9ceb['name']){delete _0x3e9ceb['name'];}_0x5b59f4['status'](_0x1741ee)['send'](_0x3e9ceb);};}exports[_0x5473('0x28')]=function(_0x1f98d8,_0x5441cb){var _0x1be2c0={},_0x5076d7={},_0x5b2d51={'count':0x0,'rows':[]};var _0x190c57=_['map'](db[_0x5473('0x29')][_0x5473('0x2a')],function(_0x576d84){return{'name':_0x576d84[_0x5473('0x2b')],'type':_0x576d84['type'][_0x5473('0x2c')]};});_0x5076d7[_0x5473('0x2d')]=_[_0x5473('0x2e')](_0x190c57,_0x5473('0x2f'));_0x5076d7[_0x5473('0x30')]=_[_0x5473('0x31')](_0x1f98d8[_0x5473('0x30')]);_0x5076d7['filters']=_[_0x5473('0x32')](_0x5076d7[_0x5473('0x2d')],_0x5076d7['query']);_0x1be2c0[_0x5473('0x33')]=_[_0x5473('0x32')](_0x5076d7[_0x5473('0x2d')],qs[_0x5473('0x34')](_0x1f98d8[_0x5473('0x30')][_0x5473('0x34')]));_0x1be2c0[_0x5473('0x33')]=_0x1be2c0[_0x5473('0x33')][_0x5473('0x35')]?_0x1be2c0[_0x5473('0x33')]:_0x5076d7[_0x5473('0x2d')];if(!_0x1f98d8['query'][_0x5473('0x36')](_0x5473('0x37'))){_0x1be2c0[_0x5473('0x38')]=qs[_0x5473('0x38')](_0x1f98d8[_0x5473('0x30')][_0x5473('0x38')]);_0x1be2c0[_0x5473('0x1c')]=qs[_0x5473('0x1c')](_0x1f98d8[_0x5473('0x30')]['offset']);}_0x1be2c0['order']=qs['sort'](_0x1f98d8[_0x5473('0x30')][_0x5473('0x39')]);_0x1be2c0[_0x5473('0x3a')]=qs[_0x5473('0x3b')](_[_0x5473('0x3c')](_0x1f98d8['query'],_0x5076d7[_0x5473('0x3b')]),_0x190c57);if(_0x1f98d8['query'][_0x5473('0x3d')]){_0x1be2c0[_0x5473('0x3a')]=_['merge'](_0x1be2c0['where'],{'$or':[{'key':{'$like':'%'+_0x1f98d8[_0x5473('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x1f98d8[_0x5473('0x30')][_0x5473('0x3d')]+'%'}}]});}_0x1be2c0=_[_0x5473('0x3e')]({},_0x1be2c0,_0x1f98d8['options']);var _0x58bca0={'where':_0x1be2c0['where']};return db['CannedAnswer'][_0x5473('0x1e')](_0x58bca0)['then'](function(_0x582aef){_0x5b2d51[_0x5473('0x1e')]=_0x582aef;if(_0x1f98d8[_0x5473('0x30')]['includeAll']){_0x1be2c0['include']=[{'all':!![]}];}return db[_0x5473('0x29')][_0x5473('0x3f')](_0x1be2c0);})[_0x5473('0x24')](function(_0x8b8c2a){_0x5b2d51[_0x5473('0x40')]=_0x8b8c2a;return _0x5b2d51;})['then'](respondWithFilteredResult(_0x5441cb,_0x1be2c0))['catch'](handleError(_0x5441cb,null));};exports['show']=function(_0x351b59,_0x1cfbc4){var _0x129edc={'raw':!![],'where':{'id':_0x351b59[_0x5473('0x41')]['id']}},_0x39cc90={};_0x39cc90[_0x5473('0x2d')]=_['keys'](db['CannedAnswer'][_0x5473('0x2a')]);_0x39cc90[_0x5473('0x30')]=_[_0x5473('0x31')](_0x351b59[_0x5473('0x30')]);_0x39cc90[_0x5473('0x3b')]=_[_0x5473('0x32')](_0x39cc90['model'],_0x39cc90['query']);_0x129edc[_0x5473('0x33')]=_[_0x5473('0x32')](_0x39cc90[_0x5473('0x2d')],qs[_0x5473('0x34')](_0x351b59['query'][_0x5473('0x34')]));_0x129edc['attributes']=_0x129edc[_0x5473('0x33')][_0x5473('0x35')]?_0x129edc[_0x5473('0x33')]:_0x39cc90[_0x5473('0x2d')];if(_0x351b59[_0x5473('0x30')]['includeAll']){_0x129edc['include']=[{'all':!![]}];}_0x129edc=_[_0x5473('0x3e')]({},_0x129edc,_0x351b59[_0x5473('0x42')]);return db[_0x5473('0x29')][_0x5473('0x43')](_0x129edc)[_0x5473('0x24')](handleEntityNotFound(_0x1cfbc4,null))[_0x5473('0x24')](respondWithResult(_0x1cfbc4,null))['catch'](handleError(_0x1cfbc4,null));};exports[_0x5473('0x23')]=function(_0x482657,_0x350a9e){if(_0x482657['body']['id']){delete _0x482657[_0x5473('0x44')]['id'];}return db[_0x5473('0x29')][_0x5473('0x43')]({'where':{'id':_0x482657[_0x5473('0x41')]['id']}})[_0x5473('0x24')](handleEntityNotFound(_0x350a9e,null))[_0x5473('0x24')](saveUpdates(_0x482657[_0x5473('0x44')],null))['then'](respondWithResult(_0x350a9e,null))[_0x5473('0x45')](handleError(_0x350a9e,null));};exports[_0x5473('0x25')]=function(_0x1c84ca,_0x54cfbb){return db[_0x5473('0x29')][_0x5473('0x43')]({'where':{'id':_0x1c84ca['params']['id']}})[_0x5473('0x24')](handleEntityNotFound(_0x54cfbb,null))[_0x5473('0x24')](removeEntity(_0x54cfbb,null))[_0x5473('0x45')](handleError(_0x54cfbb,null));};exports[_0x5473('0x46')]=function(_0x5e74a8,_0x3a63c6){var _0x3fdf0d={'key':_0x5e74a8[_0x5473('0x44')]['key']};if(_0x5e74a8[_0x5473('0x44')][_0x5473('0x47')]){_0x3fdf0d['MailAccountId']=_0x5e74a8['body'][_0x5473('0x47')];}else if(_0x5e74a8['body'][_0x5473('0x48')]){_0x3fdf0d['SmsAccountId']=_0x5e74a8[_0x5473('0x44')][_0x5473('0x48')];}else if(_0x5e74a8[_0x5473('0x44')][_0x5473('0x49')]){_0x3fdf0d[_0x5473('0x49')]=_0x5e74a8[_0x5473('0x44')][_0x5473('0x49')];}else if(_0x5e74a8[_0x5473('0x44')][_0x5473('0x4a')]){_0x3fdf0d[_0x5473('0x4a')]=_0x5e74a8[_0x5473('0x44')][_0x5473('0x4a')];}return db[_0x5473('0x29')]['find']({'where':_0x3fdf0d})[_0x5473('0x24')](function(_0x2bbc2a){if(_0x2bbc2a){throw new db[(_0x5473('0x4b'))][(_0x5473('0x4c'))](_0x5473('0x4d'));}return db['CannedAnswer'][_0x5473('0x46')](_0x5e74a8[_0x5473('0x44')]);})['then'](function(_0x3debd7){var _0x3abed2=_0x5e74a8[_0x5473('0x4e')][_0x5473('0x26')]({'plain':!![]});if(!_0x3abed2)throw new Error(_0x5473('0x4f'));if(_0x3abed2[_0x5473('0x50')]===_0x5473('0x4e')){var _0x260063=_0x3debd7[_0x5473('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5473('0x51'),'userProfileId':_0x3abed2['userProfileId']},'raw':!![]})['then'](function(_0x5e7a7a){if(_0x5e7a7a&&_0x5e7a7a[_0x5473('0x52')]===0x0){return db[_0x5473('0x27')][_0x5473('0x46')]({'name':_0x260063[_0x5473('0x2f')],'resourceId':_0x260063['id'],'type':_0x5e7a7a[_0x5473('0x2f')],'sectionId':_0x5e7a7a['id']},{})[_0x5473('0x24')](function(){return _0x3debd7;});}else{return _0x3debd7;}})[_0x5473('0x45')](function(_0x85543a){logger[_0x5473('0x53')](_0x5473('0x54'),_0x85543a);throw _0x85543a;});}return _0x3debd7;})[_0x5473('0x24')](respondWithResult(_0x3a63c6,0xc9))[_0x5473('0x45')](handleError(_0x3a63c6,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 616d464..f117ea6 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 _0x96dd=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','define','CannedAnswer'];(function(_0x355eb4,_0x374bbc){var _0x4f623f=function(_0x177fef){while(--_0x177fef){_0x355eb4['push'](_0x355eb4['shift']());}};_0x4f623f(++_0x374bbc);}(_0x96dd,0x162));var _0xd96d=function(_0x41c149,_0x347948){_0x41c149=_0x41c149-0x0;var _0x4aca6b=_0x96dd[_0x41c149];return _0x4aca6b;};'use strict';var _=require('lodash');var util=require(_0xd96d('0x0'));var logger=require(_0xd96d('0x1'))(_0xd96d('0x2'));var moment=require(_0xd96d('0x3'));var BPromise=require(_0xd96d('0x4'));var rp=require(_0xd96d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd96d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd96d('0x7'));module['exports']=function(_0x5956ea,_0x3192be){return _0x5956ea[_0xd96d('0x8')](_0xd96d('0x9'),attributes,{'tableName':_0xd96d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd96d('0xb'),'collate':_0xd96d('0xc')});};
\ No newline at end of file
+var _0x75a2=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util'];(function(_0x10d29b,_0x57a0a1){var _0x3d297e=function(_0x2062fa){while(--_0x2062fa){_0x10d29b['push'](_0x10d29b['shift']());}};_0x3d297e(++_0x57a0a1);}(_0x75a2,0x85));var _0x275a=function(_0x332957,_0x1dae22){_0x332957=_0x332957-0x0;var _0x226105=_0x75a2[_0x332957];return _0x226105;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var logger=require(_0x275a('0x2'))(_0x275a('0x3'));var moment=require(_0x275a('0x4'));var BPromise=require('bluebird');var rp=require(_0x275a('0x5'));var fs=require('fs');var path=require(_0x275a('0x6'));var rimraf=require(_0x275a('0x7'));var config=require(_0x275a('0x8'));var attributes=require(_0x275a('0x9'));module[_0x275a('0xa')]=function(_0x4548ca,_0x5dd171){return _0x4548ca[_0x275a('0xb')](_0x275a('0xc'),attributes,{'tableName':_0x275a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x275a('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index dddba79..ecb273a 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(_0x49b979,_0x8f819d){var _0x52b435=function(_0xfb55d9){while(--_0xfb55d9){_0x49b979['push'](_0x49b979['shift']());}};_0x52b435(++_0x8f819d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x49c258,_0x3dca5e){var _0xdaac28=function(_0x419209){while(--_0x419209){_0x49c258['push'](_0x49c258['shift']());}};_0xdaac28(++_0x3dca5e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 ef01cb3..68e97d3 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 _0xe01b=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xe01b,0x109));var _0xbe01=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0xe01b[_0x2d2ca2];return _0x48489d;};'use strict';var multer=require(_0xbe01('0x0'));var util=require(_0xbe01('0x1'));var path=require(_0xbe01('0x2'));var timeout=require(_0xbe01('0x3'));var express=require(_0xbe01('0x4'));var router=express[_0xbe01('0x5')]();var fs_extra=require(_0xbe01('0x6'));var auth=require(_0xbe01('0x7'));var interaction=require(_0xbe01('0x8'));var config=require(_0xbe01('0x9'));var controller=require(_0xbe01('0xa'));router[_0xbe01('0xb')]('/',auth[_0xbe01('0xc')](),controller['index']);router[_0xbe01('0xb')](_0xbe01('0xd'),auth['isAuthenticated'](),controller[_0xbe01('0xe')]);router[_0xbe01('0xf')]('/',auth['isAuthenticated'](),controller[_0xbe01('0x10')]);router[_0xbe01('0x11')](_0xbe01('0xd'),auth[_0xbe01('0xc')](),controller[_0xbe01('0x12')]);router[_0xbe01('0x13')]('/:id',auth[_0xbe01('0xc')](),controller['destroy']);module[_0xbe01('0x14')]=router;
\ No newline at end of file
+var _0x9fcb=['destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x19132a,_0x4388b3){var _0x279eaa=function(_0x9cdf38){while(--_0x9cdf38){_0x19132a['push'](_0x19132a['shift']());}};_0x279eaa(++_0x4388b3);}(_0x9fcb,0x10c));var _0xb9fc=function(_0xb34b31,_0x4cdb01){_0xb34b31=_0xb34b31-0x0;var _0x4d6e7c=_0x9fcb[_0xb34b31];return _0x4d6e7c;};'use strict';var multer=require('multer');var util=require(_0xb9fc('0x0'));var path=require(_0xb9fc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb9fc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb9fc('0x3'));var interaction=require(_0xb9fc('0x4'));var config=require(_0xb9fc('0x5'));var controller=require(_0xb9fc('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb9fc('0x7')]);router[_0xb9fc('0x8')](_0xb9fc('0x9'),auth[_0xb9fc('0xa')](),controller[_0xb9fc('0xb')]);router[_0xb9fc('0xc')]('/',auth['isAuthenticated'](),controller[_0xb9fc('0xd')]);router[_0xb9fc('0xe')](_0xb9fc('0x9'),auth[_0xb9fc('0xa')](),controller[_0xb9fc('0xf')]);router[_0xb9fc('0x10')](_0xb9fc('0x9'),auth[_0xb9fc('0xa')](),controller[_0xb9fc('0x11')]);module[_0xb9fc('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 9cd18f8..04655a9 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 _0x3f19=['sequelize','STRING','INTEGER'];(function(_0x59cbab,_0x18cdc0){var _0x2a7cec=function(_0x17ce90){while(--_0x17ce90){_0x59cbab['push'](_0x59cbab['shift']());}};_0x2a7cec(++_0x18cdc0);}(_0x3f19,0xc0));var _0x93f1=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0x3f19[_0x5192de];return _0x4e287e;};'use strict';var Sequelize=require(_0x93f1('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x93f1('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x93f1('0x1')]},'dcontext':{'type':Sequelize[_0x93f1('0x1')]},'channel':{'type':Sequelize[_0x93f1('0x1')]},'dstchannel':{'type':Sequelize[_0x93f1('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x93f1('0x1')]},'duration':{'type':Sequelize[_0x93f1('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x93f1('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x93f1('0x1')]},'amaflags':{'type':Sequelize[_0x93f1('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x93f1('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x93f1('0x1')]},'linkedid':{'type':Sequelize[_0x93f1('0x1')]},'sequence':{'type':Sequelize[_0x93f1('0x1')]},'peeraccount':{'type':Sequelize[_0x93f1('0x1')]},'type':{'type':Sequelize[_0x93f1('0x1')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x47fd=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x4e8a59,_0x32bc84){var _0x22ba3e=function(_0x187e2f){while(--_0x187e2f){_0x4e8a59['push'](_0x4e8a59['shift']());}};_0x22ba3e(++_0x32bc84);}(_0x47fd,0x13c));var _0xd47f=function(_0xac2edb,_0x7ee06d){_0xac2edb=_0xac2edb-0x0;var _0x5eb36e=_0x47fd[_0xac2edb];return _0x5eb36e;};'use strict';var Sequelize=require(_0xd47f('0x0'));module[_0xd47f('0x1')]={'calldate':{'type':Sequelize[_0xd47f('0x2')],'allowNull':![],'defaultValue':_0xd47f('0x3')},'clid':{'type':Sequelize[_0xd47f('0x4')]},'src':{'type':Sequelize[_0xd47f('0x4')]},'dst':{'type':Sequelize[_0xd47f('0x4')]},'dcontext':{'type':Sequelize[_0xd47f('0x4')]},'channel':{'type':Sequelize[_0xd47f('0x4')]},'dstchannel':{'type':Sequelize[_0xd47f('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xd47f('0x4')]},'duration':{'type':Sequelize[_0xd47f('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd47f('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xd47f('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xd47f('0x4')]},'peeraccount':{'type':Sequelize[_0xd47f('0x4')]},'type':{'type':Sequelize[_0xd47f('0x4')]},'tag':{'type':Sequelize[_0xd47f('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index ec55c22..b2b2424 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 _0x032e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Cdr','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x55670d,_0x1f84da){var _0x1c46ae=function(_0x3059aa){while(--_0x3059aa){_0x55670d['push'](_0x55670d['shift']());}};_0x1c46ae(++_0x1f84da);}(_0x032e,0x124));var _0xe032=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x032e[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['Cdr'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_0x4e8b72,_0xe032('0x29'));_0x469290[_0xe032('0x30')]=_[_0xe032('0x31')](_0x5573e4['query']);_0x469290[_0xe032('0x32')]=_[_0xe032('0x33')](_0x469290[_0xe032('0x2e')],_0x469290[_0xe032('0x30')]);_0x38e7ea['attributes']=_[_0xe032('0x33')](_0x469290['model'],qs[_0xe032('0x34')](_0x5573e4['query'][_0xe032('0x34')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x35')]['length']?_0x38e7ea[_0xe032('0x35')]:_0x469290[_0xe032('0x2e')];if(!_0x5573e4['query'][_0xe032('0x36')](_0xe032('0x37'))){_0x38e7ea[_0xe032('0x21')]=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea['offset']=qs[_0xe032('0x1f')](_0x5573e4[_0xe032('0x30')]['offset']);}_0x38e7ea[_0xe032('0x38')]=qs[_0xe032('0x39')](_0x5573e4['query'][_0xe032('0x39')]);_0x38e7ea[_0xe032('0x3a')]=qs[_0xe032('0x32')](_[_0xe032('0x3b')](_0x5573e4[_0xe032('0x30')],_0x469290[_0xe032('0x32')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x30')][_0xe032('0x3c')]){_0x38e7ea[_0xe032('0x3a')]=_[_0xe032('0x3d')](_0x38e7ea[_0xe032('0x3a')],{'$or':_[_0xe032('0x2f')](_0x4e8b72,function(_0x30571c){if(_0x30571c[_0xe032('0x2d')]!==_0xe032('0x3e')){var _0x14ea1a={};_0x14ea1a[_0x30571c[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3c')]+'%'};return _0x14ea1a;}})});}_0x38e7ea=_['merge']({},_0x38e7ea,_0x5573e4[_0xe032('0x3f')]);var _0x2bcfb4={'where':_0x38e7ea[_0xe032('0x3a')]};return db[_0xe032('0x40')][_0xe032('0x22')](_0x2bcfb4)['then'](function(_0x132d25){_0xae116e['count']=_0x132d25;if(_0x5573e4[_0xe032('0x30')]['includeAll']){_0x38e7ea[_0xe032('0x41')]=[{'all':!![]}];}return db[_0xe032('0x40')][_0xe032('0x42')](_0x38e7ea);})[_0xe032('0x27')](function(_0x4dc836){_0xae116e[_0xe032('0x43')]=_0x4dc836;return _0xae116e;})['then'](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x44')](handleError(_0x3e2575,null));};exports[_0xe032('0x45')]=function(_0x3c43f1,_0xe572b6){var _0x4b58eb={'raw':!![],'where':{'id':_0x3c43f1[_0xe032('0x46')]['id']}},_0x513b0c={};_0x513b0c[_0xe032('0x2e')]=_['keys'](db[_0xe032('0x40')][_0xe032('0x2b')]);_0x513b0c[_0xe032('0x30')]=_[_0xe032('0x31')](_0x3c43f1[_0xe032('0x30')]);_0x513b0c['filters']=_[_0xe032('0x33')](_0x513b0c[_0xe032('0x2e')],_0x513b0c[_0xe032('0x30')]);_0x4b58eb[_0xe032('0x35')]=_[_0xe032('0x33')](_0x513b0c[_0xe032('0x2e')],qs[_0xe032('0x34')](_0x3c43f1[_0xe032('0x30')]['fields']));_0x4b58eb['attributes']=_0x4b58eb[_0xe032('0x35')]['length']?_0x4b58eb[_0xe032('0x35')]:_0x513b0c[_0xe032('0x2e')];if(_0x3c43f1[_0xe032('0x30')][_0xe032('0x47')]){_0x4b58eb[_0xe032('0x41')]=[{'all':!![]}];}_0x4b58eb=_[_0xe032('0x3d')]({},_0x4b58eb,_0x3c43f1[_0xe032('0x3f')]);return db[_0xe032('0x40')][_0xe032('0x48')](_0x4b58eb)['then'](handleEntityNotFound(_0xe572b6,null))[_0xe032('0x27')](respondWithResult(_0xe572b6,null))['catch'](handleError(_0xe572b6,null));};exports['create']=function(_0x28f973,_0x2583e9){return db[_0xe032('0x40')][_0xe032('0x49')](_0x28f973['body'],{})[_0xe032('0x27')](respondWithResult(_0x2583e9,0xc9))[_0xe032('0x44')](handleError(_0x2583e9,null));};exports[_0xe032('0x26')]=function(_0x39ffb7,_0x1b3172){if(_0x39ffb7[_0xe032('0x4a')]['id']){delete _0x39ffb7[_0xe032('0x4a')]['id'];}return db['Cdr'][_0xe032('0x48')]({'where':{'id':_0x39ffb7[_0xe032('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b3172,null))[_0xe032('0x27')](saveUpdates(_0x39ffb7[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x1b3172,null))[_0xe032('0x44')](handleError(_0x1b3172,null));};exports[_0xe032('0x4b')]=function(_0x434f1a,_0x24b013){return db[_0xe032('0x40')][_0xe032('0x48')]({'where':{'id':_0x434f1a[_0xe032('0x46')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x24b013,null))[_0xe032('0x27')](removeEntity(_0x24b013,null))[_0xe032('0x44')](handleError(_0x24b013,null));};exports[_0xe032('0x4c')]=function(_0x4eabfc,_0x1c8b32){return db['Cdr'][_0xe032('0x4c')]()[_0xe032('0x27')](respondWithResult(_0x1c8b32,null))[_0xe032('0x44')](handleError(_0x1c8b32,null));};
\ No newline at end of file
+var _0xf987=['attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','model','keys','filters','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf987,0x18a));var _0x7f98=function(_0x5b47fb,_0x315692){_0x5b47fb=_0x5b47fb-0x0;var _0x3baae3=_0xf987[_0x5b47fb];return _0x3baae3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];function respondWithStatusCode(_0x4c4ae9,_0x9c2633){_0x9c2633=_0x9c2633||0xcc;return function(_0x2c26d8){if(_0x2c26d8){return _0x4c4ae9[_0x7f98('0x18')](_0x9c2633);}return _0x4c4ae9[_0x7f98('0x19')](_0x9c2633)[_0x7f98('0x1a')]();};}function respondWithResult(_0x11b1f8,_0x33108e){_0x33108e=_0x33108e||0xc8;return function(_0x3044d4){if(_0x3044d4){return _0x11b1f8[_0x7f98('0x19')](_0x33108e)[_0x7f98('0x1b')](_0x3044d4);}};}function respondWithFilteredResult(_0x2d366a,_0x1fa829){return function(_0x5e3bb5){if(_0x5e3bb5){var _0xcab406=typeof _0x1fa829['offset']==='undefined'&&typeof _0x1fa829[_0x7f98('0x1c')]===_0x7f98('0x1d');var _0x585a1a=_0x5e3bb5['count'];var _0x5f27dd=_0xcab406?0x0:_0x1fa829['offset'];var _0x111385=_0xcab406?_0x5e3bb5[_0x7f98('0x1e')]:_0x1fa829['offset']+_0x1fa829['limit'];var _0x4f3ac0;if(_0x111385>=_0x585a1a){_0x111385=_0x585a1a;_0x4f3ac0=0xc8;}else{_0x4f3ac0=0xce;}_0x2d366a[_0x7f98('0x19')](_0x4f3ac0);return _0x2d366a['set'](_0x7f98('0x1f'),_0x5f27dd+'-'+_0x111385+'/'+_0x585a1a)[_0x7f98('0x1b')](_0x5e3bb5);}return null;};}function patchUpdates(_0x3e78e2){return function(_0x446dd5){try{jsonpatch[_0x7f98('0x20')](_0x446dd5,_0x3e78e2,!![]);}catch(_0x1f2e6c){return BPromise[_0x7f98('0x21')](_0x1f2e6c);}return _0x446dd5[_0x7f98('0x22')]();};}function saveUpdates(_0x20ad36,_0x53c1ef){return function(_0x55189b){if(_0x55189b){return _0x55189b[_0x7f98('0x23')](_0x20ad36)['then'](function(_0xf39ff1){return _0xf39ff1;});}return null;};}function removeEntity(_0x2d9e09,_0x51eca3){return function(_0x417ad4){if(_0x417ad4){return _0x417ad4[_0x7f98('0x24')]()['then'](function(){_0x2d9e09[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1d6bdb,_0x1a5788){return function(_0x3e1cd5){if(!_0x3e1cd5){_0x1d6bdb[_0x7f98('0x18')](0x194);}return _0x3e1cd5;};}function handleError(_0x2b58d0,_0x8b27a4){_0x8b27a4=_0x8b27a4||0x1f4;return function(_0x1d086f){logger[_0x7f98('0x25')](_0x1d086f[_0x7f98('0x26')]);if(_0x1d086f[_0x7f98('0x27')]){delete _0x1d086f[_0x7f98('0x27')];}_0x2b58d0['status'](_0x8b27a4)['send'](_0x1d086f);};}exports[_0x7f98('0x28')]=function(_0x2122f4,_0x186519){var _0x1dd8d5={},_0xc8f69f={},_0x16a8cb={'count':0x0,'rows':[]};var _0x20ff8d=_[_0x7f98('0x29')](db[_0x7f98('0x2a')][_0x7f98('0x2b')],function(_0x544bae){return{'name':_0x544bae[_0x7f98('0x2c')],'type':_0x544bae[_0x7f98('0x2d')]['key']};});_0xc8f69f[_0x7f98('0x2e')]=_[_0x7f98('0x29')](_0x20ff8d,_0x7f98('0x27'));_0xc8f69f['query']=_[_0x7f98('0x2f')](_0x2122f4['query']);_0xc8f69f[_0x7f98('0x30')]=_['intersection'](_0xc8f69f[_0x7f98('0x2e')],_0xc8f69f[_0x7f98('0x31')]);_0x1dd8d5[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0xc8f69f[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x2122f4[_0x7f98('0x31')]['fields']));_0x1dd8d5['attributes']=_0x1dd8d5[_0x7f98('0x32')][_0x7f98('0x35')]?_0x1dd8d5[_0x7f98('0x32')]:_0xc8f69f[_0x7f98('0x2e')];if(!_0x2122f4[_0x7f98('0x31')][_0x7f98('0x36')](_0x7f98('0x37'))){_0x1dd8d5['limit']=qs['limit'](_0x2122f4[_0x7f98('0x31')]['limit']);_0x1dd8d5[_0x7f98('0x38')]=qs['offset'](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x38')]);}_0x1dd8d5[_0x7f98('0x39')]=qs[_0x7f98('0x3a')](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3a')]);_0x1dd8d5[_0x7f98('0x3b')]=qs[_0x7f98('0x30')](_[_0x7f98('0x3c')](_0x2122f4[_0x7f98('0x31')],_0xc8f69f[_0x7f98('0x30')]),_0x20ff8d);if(_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3d')]){_0x1dd8d5[_0x7f98('0x3b')]=_[_0x7f98('0x3e')](_0x1dd8d5[_0x7f98('0x3b')],{'$or':_[_0x7f98('0x29')](_0x20ff8d,function(_0x45f280){if(_0x45f280[_0x7f98('0x2d')]!==_0x7f98('0x3f')){var _0x1b82cc={};_0x1b82cc[_0x45f280[_0x7f98('0x27')]]={'$like':'%'+_0x2122f4[_0x7f98('0x31')]['filter']+'%'};return _0x1b82cc;}})});}_0x1dd8d5=_[_0x7f98('0x3e')]({},_0x1dd8d5,_0x2122f4[_0x7f98('0x40')]);var _0x57a855={'where':_0x1dd8d5[_0x7f98('0x3b')]};return db['Cdr']['count'](_0x57a855)[_0x7f98('0x41')](function(_0x24bbdc){_0x16a8cb['count']=_0x24bbdc;if(_0x2122f4[_0x7f98('0x31')]['includeAll']){_0x1dd8d5['include']=[{'all':!![]}];}return db['Cdr'][_0x7f98('0x42')](_0x1dd8d5);})['then'](function(_0x2ab479){_0x16a8cb['rows']=_0x2ab479;return _0x16a8cb;})[_0x7f98('0x41')](respondWithFilteredResult(_0x186519,_0x1dd8d5))[_0x7f98('0x43')](handleError(_0x186519,null));};exports[_0x7f98('0x44')]=function(_0x1d53eb,_0x48ede9){var _0x55a8cc={'raw':!![],'where':{'id':_0x1d53eb[_0x7f98('0x45')]['id']}},_0x5b8fef={};_0x5b8fef[_0x7f98('0x2e')]=_['keys'](db['Cdr'][_0x7f98('0x2b')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x2f')](_0x1d53eb[_0x7f98('0x31')]);_0x5b8fef[_0x7f98('0x30')]=_[_0x7f98('0x33')](_0x5b8fef['model'],_0x5b8fef[_0x7f98('0x31')]);_0x55a8cc[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0x5b8fef[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x1d53eb[_0x7f98('0x31')][_0x7f98('0x34')]));_0x55a8cc[_0x7f98('0x32')]=_0x55a8cc[_0x7f98('0x32')][_0x7f98('0x35')]?_0x55a8cc[_0x7f98('0x32')]:_0x5b8fef[_0x7f98('0x2e')];if(_0x1d53eb['query']['includeAll']){_0x55a8cc['include']=[{'all':!![]}];}_0x55a8cc=_[_0x7f98('0x3e')]({},_0x55a8cc,_0x1d53eb[_0x7f98('0x40')]);return db['Cdr'][_0x7f98('0x46')](_0x55a8cc)[_0x7f98('0x41')](handleEntityNotFound(_0x48ede9,null))[_0x7f98('0x41')](respondWithResult(_0x48ede9,null))[_0x7f98('0x43')](handleError(_0x48ede9,null));};exports[_0x7f98('0x47')]=function(_0x83db32,_0x157723){return db[_0x7f98('0x2a')][_0x7f98('0x47')](_0x83db32['body'],{})[_0x7f98('0x41')](respondWithResult(_0x157723,0xc9))[_0x7f98('0x43')](handleError(_0x157723,null));};exports[_0x7f98('0x23')]=function(_0x32e242,_0x3396a7){if(_0x32e242['body']['id']){delete _0x32e242[_0x7f98('0x48')]['id'];}return db[_0x7f98('0x2a')]['find']({'where':{'id':_0x32e242[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3396a7,null))[_0x7f98('0x41')](saveUpdates(_0x32e242[_0x7f98('0x48')],null))['then'](respondWithResult(_0x3396a7,null))[_0x7f98('0x43')](handleError(_0x3396a7,null));};exports['destroy']=function(_0x513c2f,_0x3467ad){return db[_0x7f98('0x2a')][_0x7f98('0x46')]({'where':{'id':_0x513c2f[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3467ad,null))[_0x7f98('0x41')](removeEntity(_0x3467ad,null))[_0x7f98('0x43')](handleError(_0x3467ad,null));};exports[_0x7f98('0x49')]=function(_0x3b268d,_0x203a53){return db['Cdr'][_0x7f98('0x49')]()[_0x7f98('0x41')](respondWithResult(_0x203a53,null))[_0x7f98('0x43')](handleError(_0x203a53,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 728c71e..0adb725 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(_0x718183,_0x396d32){var _0x1cf449=function(_0x3dc19f){while(--_0x3dc19f){_0x718183['push'](_0x718183['shift']());}};_0x1cf449(++_0x396d32);}(_0x7a54,0x106));var _0x47a5=function(_0x1d3462,_0xeabcf4){_0x1d3462=_0x1d3462-0x0;var _0x263001=_0x7a54[_0x1d3462];return _0x263001;};'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(_0x379e34,_0x199e44){var _0x36a674=function(_0x25a880){while(--_0x25a880){_0x379e34['push'](_0x379e34['shift']());}};_0x36a674(++_0x199e44);}(_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':'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 e8aa0e0..806e6fe 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 _0x31cd=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','bluebird','randomstring','ioredis'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x31cd,0x19e));var _0xd31c=function(_0x53f7d0,_0x1f6111){_0x53f7d0=_0x53f7d0-0x0;var _0x5179aa=_0x31cd[_0x53f7d0];return _0x5179aa;};'use strict';var _=require(_0xd31c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd31c('0x1'));var rs=require(_0xd31c('0x2'));var fs=require('fs');var Redis=require(_0xd31c('0x3'));var db=require(_0xd31c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd31c('0x5'))(_0xd31c('0x6'));var config=require(_0xd31c('0x7'));var jayson=require(_0xd31c('0x8'));var client=jayson[_0xd31c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cf974,_0x959f4e,_0x33f381){return new BPromise(function(_0x1b95f8,_0x20f162){return client[_0xd31c('0xa')](_0x2cf974,_0x33f381)[_0xd31c('0xb')](function(_0xc5c12f){logger[_0xd31c('0xc')](_0xd31c('0xd'),_0x959f4e,_0xd31c('0xe'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x959f4e,_0xd31c('0xe'),JSON[_0xd31c('0xf')](_0xc5c12f));if(_0xc5c12f[_0xd31c('0x10')]){if(_0xc5c12f[_0xd31c('0x10')]['code']===0x1f4){logger[_0xd31c('0x10')]('Cdr,\x20%s,\x20%s',_0x959f4e,_0xc5c12f[_0xd31c('0x10')][_0xd31c('0x11')]);return _0x20f162(_0xc5c12f[_0xd31c('0x10')][_0xd31c('0x11')]);}logger[_0xd31c('0x10')]('Cdr,\x20%s,\x20%s',_0x959f4e,_0xc5c12f[_0xd31c('0x10')][_0xd31c('0x11')]);return _0x1b95f8(_0xc5c12f['error'][_0xd31c('0x11')]);}else{logger[_0xd31c('0xc')](_0xd31c('0xd'),_0x959f4e,'request\x20sent');_0x1b95f8(_0xc5c12f[_0xd31c('0x12')][_0xd31c('0x11')]);}})['catch'](function(_0x4fae15){logger[_0xd31c('0x10')]('Cdr,\x20%s,\x20%s',_0x959f4e,_0x4fae15);_0x20f162(_0x4fae15);});});}
\ No newline at end of file
+var _0x9f8a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','randomstring'];(function(_0x4f0726,_0x4f85bb){var _0xcd2134=function(_0x219af6){while(--_0x219af6){_0x4f0726['push'](_0x4f0726['shift']());}};_0xcd2134(++_0x4f85bb);}(_0x9f8a,0x17a));var _0xa9f8=function(_0xf64c27,_0x1ac538){_0xf64c27=_0xf64c27-0x0;var _0x5d778d=_0x9f8a[_0xf64c27];return _0x5d778d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa9f8('0x0'));var BPromise=require('bluebird');var rs=require(_0xa9f8('0x1'));var fs=require('fs');var Redis=require(_0xa9f8('0x2'));var db=require(_0xa9f8('0x3'))['db'];var utils=require(_0xa9f8('0x4'));var logger=require(_0xa9f8('0x5'))(_0xa9f8('0x6'));var config=require(_0xa9f8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa9f8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41ffd4,_0xc90efe,_0xea2134){return new BPromise(function(_0x343f38,_0x182545){return client[_0xa9f8('0x9')](_0x41ffd4,_0xea2134)['then'](function(_0x2dbed8){logger[_0xa9f8('0xa')](_0xa9f8('0xb'),_0xc90efe,_0xa9f8('0xc'));logger[_0xa9f8('0xd')](_0xa9f8('0xe'),_0xc90efe,_0xa9f8('0xc'),JSON['stringify'](_0x2dbed8));if(_0x2dbed8[_0xa9f8('0xf')]){if(_0x2dbed8[_0xa9f8('0xf')][_0xa9f8('0x10')]===0x1f4){logger[_0xa9f8('0xf')]('Cdr,\x20%s,\x20%s',_0xc90efe,_0x2dbed8['error'][_0xa9f8('0x11')]);return _0x182545(_0x2dbed8['error'][_0xa9f8('0x11')]);}logger['error'](_0xa9f8('0xb'),_0xc90efe,_0x2dbed8[_0xa9f8('0xf')][_0xa9f8('0x11')]);return _0x343f38(_0x2dbed8[_0xa9f8('0xf')]['message']);}else{logger[_0xa9f8('0xa')](_0xa9f8('0xb'),_0xc90efe,'request\x20sent');_0x343f38(_0x2dbed8[_0xa9f8('0x12')]['message']);}})['catch'](function(_0x19a2d2){logger[_0xa9f8('0xf')](_0xa9f8('0xb'),_0xc90efe,_0x19a2d2);_0x182545(_0x19a2d2);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 98bd9e1..b1d2e69 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(_0x34366b,_0x248c3c){var _0x33921b=function(_0x55946a){while(--_0x55946a){_0x34366b['push'](_0x34366b['shift']());}};_0x33921b(++_0x248c3c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4baac3,_0x481c9a){var _0x4fb4bc=function(_0x27d865){while(--_0x27d865){_0x4baac3['push'](_0x4baac3['shift']());}};_0x4fb4bc(++_0x481c9a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 87804c1..50b2962 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 _0xf0ca=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x3b2f12,_0x30c73f){var _0x828b14=function(_0x50a2ed){while(--_0x50a2ed){_0x3b2f12['push'](_0x3b2f12['shift']());}};_0x828b14(++_0x30c73f);}(_0xf0ca,0xf4));var _0xaf0c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xf0ca[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0xaf0c('0x0'));module[_0xaf0c('0x1')]={'priority':{'type':Sequelize[_0xaf0c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaf0c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xaf0c('0x4')]()},'description':{'type':Sequelize[_0xaf0c('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x432c=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x44ca45,_0x205db4){var _0x47839f=function(_0x2cc87e){while(--_0x2cc87e){_0x44ca45['push'](_0x44ca45['shift']());}};_0x47839f(++_0x205db4);}(_0x432c,0x18b));var _0xc432=function(_0x1f4c1f,_0x19ff7f){_0x1f4c1f=_0x1f4c1f-0x0;var _0x56ef12=_0x432c[_0x1f4c1f];return _0x56ef12;};'use strict';var Sequelize=require(_0xc432('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc432('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc432('0x2')],'allowNull':![],'defaultValue':_0xc432('0x3')},'appdata':{'type':Sequelize[_0xc432('0x4')]()},'description':{'type':Sequelize[_0xc432('0x2')]},'interval':{'type':Sequelize[_0xc432('0x2')],'defaultValue':_0xc432('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index acc091e..f960289 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 _0xc817=['bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','show','params','model','ChatApplication','rawAttributes','keys','intersection','query','attributes','fields','include','merge','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0xc9b747,_0x2c973a){var _0x9d53d8=function(_0x4d8eb7){while(--_0x4d8eb7){_0xc9b747['push'](_0xc9b747['shift']());}};_0x9d53d8(++_0x2c973a);}(_0xc817,0x75));var _0x7c81=function(_0x3c08af,_0x4cb004){_0x3c08af=_0x3c08af-0x0;var _0x27e893=_0xc817[_0x3c08af];return _0x27e893;};'use strict';var emlformat=require(_0x7c81('0x0'));var rimraf=require(_0x7c81('0x1'));var zipdir=require(_0x7c81('0x2'));var jsonpatch=require(_0x7c81('0x3'));var rp=require('request-promise');var moment=require(_0x7c81('0x4'));var BPromise=require(_0x7c81('0x5'));var Mustache=require(_0x7c81('0x6'));var util=require(_0x7c81('0x7'));var path=require(_0x7c81('0x8'));var sox=require(_0x7c81('0x9'));var csv=require('to-csv');var ejs=require(_0x7c81('0xa'));var fs=require('fs');var fs_extra=require(_0x7c81('0xb'));var _=require('lodash');var squel=require(_0x7c81('0xc'));var crypto=require(_0x7c81('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c81('0xe'));var toCsv=require(_0x7c81('0xf'));var querystring=require(_0x7c81('0x10'));var Papa=require(_0x7c81('0x11'));var Redis=require(_0x7c81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7c81('0x13'));var as=require(_0x7c81('0x14'));var hardwareService=require(_0x7c81('0x15'));var logger=require(_0x7c81('0x16'))(_0x7c81('0x17'));var utils=require(_0x7c81('0x18'));var config=require(_0x7c81('0x19'));var licenseUtil=require(_0x7c81('0x1a'));var db=require(_0x7c81('0x1b'))['db'];function respondWithStatusCode(_0x1f7771,_0xe463e){_0xe463e=_0xe463e||0xcc;return function(_0x1f7b5c){if(_0x1f7b5c){return _0x1f7771[_0x7c81('0x1c')](_0xe463e);}return _0x1f7771[_0x7c81('0x1d')](_0xe463e)[_0x7c81('0x1e')]();};}function respondWithResult(_0xebb73,_0x9362c4){_0x9362c4=_0x9362c4||0xc8;return function(_0x1abf26){if(_0x1abf26){return _0xebb73[_0x7c81('0x1d')](_0x9362c4)['json'](_0x1abf26);}};}function respondWithFilteredResult(_0x439b1c,_0x18aefa){return function(_0x2f3de2){if(_0x2f3de2){var _0x1021f8=typeof _0x18aefa[_0x7c81('0x1f')]===_0x7c81('0x20')&&typeof _0x18aefa[_0x7c81('0x21')]===_0x7c81('0x20');var _0x266bb0=_0x2f3de2['count'];var _0x14cce5=_0x1021f8?0x0:_0x18aefa[_0x7c81('0x1f')];var _0xfd62e=_0x1021f8?_0x2f3de2[_0x7c81('0x22')]:_0x18aefa['offset']+_0x18aefa[_0x7c81('0x21')];var _0x2e2b44;if(_0xfd62e>=_0x266bb0){_0xfd62e=_0x266bb0;_0x2e2b44=0xc8;}else{_0x2e2b44=0xce;}_0x439b1c[_0x7c81('0x1d')](_0x2e2b44);return _0x439b1c[_0x7c81('0x23')](_0x7c81('0x24'),_0x14cce5+'-'+_0xfd62e+'/'+_0x266bb0)['json'](_0x2f3de2);}return null;};}function patchUpdates(_0x679b81){return function(_0x1a9cee){try{jsonpatch[_0x7c81('0x25')](_0x1a9cee,_0x679b81,!![]);}catch(_0x35761d){return BPromise[_0x7c81('0x26')](_0x35761d);}return _0x1a9cee['save']();};}function saveUpdates(_0x887753,_0x198390){return function(_0x4704e9){if(_0x4704e9){return _0x4704e9[_0x7c81('0x27')](_0x887753)['then'](function(_0x3bdca5){return _0x3bdca5;});}return null;};}function removeEntity(_0x53bdb2,_0x4ecf3b){return function(_0x53f49c){if(_0x53f49c){return _0x53f49c[_0x7c81('0x28')]()['then'](function(){_0x53bdb2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x349b5c,_0x5e707e){return function(_0x23de92){if(!_0x23de92){_0x349b5c[_0x7c81('0x1c')](0x194);}return _0x23de92;};}function handleError(_0x2e166f,_0x596d69){_0x596d69=_0x596d69||0x1f4;return function(_0xaedec){logger[_0x7c81('0x29')](_0xaedec[_0x7c81('0x2a')]);if(_0xaedec[_0x7c81('0x2b')]){delete _0xaedec[_0x7c81('0x2b')];}_0x2e166f[_0x7c81('0x1d')](_0x596d69)['send'](_0xaedec);};}exports[_0x7c81('0x2c')]=function(_0x5c8206,_0x2089c4){var _0x4f00be={'raw':!![],'where':{'id':_0x5c8206[_0x7c81('0x2d')]['id']}},_0x32c30f={};_0x32c30f[_0x7c81('0x2e')]=_['keys'](db[_0x7c81('0x2f')][_0x7c81('0x30')]);_0x32c30f['query']=_[_0x7c81('0x31')](_0x5c8206['query']);_0x32c30f['filters']=_[_0x7c81('0x32')](_0x32c30f[_0x7c81('0x2e')],_0x32c30f[_0x7c81('0x33')]);_0x4f00be[_0x7c81('0x34')]=_[_0x7c81('0x32')](_0x32c30f[_0x7c81('0x2e')],qs[_0x7c81('0x35')](_0x5c8206[_0x7c81('0x33')]['fields']));_0x4f00be[_0x7c81('0x34')]=_0x4f00be[_0x7c81('0x34')]['length']?_0x4f00be[_0x7c81('0x34')]:_0x32c30f[_0x7c81('0x2e')];if(_0x5c8206[_0x7c81('0x33')]['includeAll']){_0x4f00be[_0x7c81('0x36')]=[{'all':!![]}];}_0x4f00be=_[_0x7c81('0x37')]({},_0x4f00be,_0x5c8206[_0x7c81('0x38')]);return db[_0x7c81('0x2f')][_0x7c81('0x39')](_0x4f00be)[_0x7c81('0x3a')](handleEntityNotFound(_0x2089c4,null))[_0x7c81('0x3a')](respondWithResult(_0x2089c4,null))[_0x7c81('0x3b')](handleError(_0x2089c4,null));};exports[_0x7c81('0x27')]=function(_0x2dcef6,_0x3a5351){if(_0x2dcef6[_0x7c81('0x3c')]['id']){delete _0x2dcef6[_0x7c81('0x3c')]['id'];}return db['ChatApplication'][_0x7c81('0x39')]({'where':{'id':_0x2dcef6[_0x7c81('0x2d')]['id']}})[_0x7c81('0x3a')](handleEntityNotFound(_0x3a5351,null))[_0x7c81('0x3a')](saveUpdates(_0x2dcef6[_0x7c81('0x3c')],null))['then'](respondWithResult(_0x3a5351,null))['catch'](handleError(_0x3a5351,null));};exports[_0x7c81('0x28')]=function(_0x3bcd76,_0x397a61){return db[_0x7c81('0x2f')][_0x7c81('0x39')]({'where':{'id':_0x3bcd76['params']['id']}})[_0x7c81('0x3a')](handleEntityNotFound(_0x397a61,null))[_0x7c81('0x3a')](removeEntity(_0x397a61,null))[_0x7c81('0x3b')](handleError(_0x397a61,null));};
\ No newline at end of file
+var _0x780f=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','attributes','intersection','fields','length','include','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel'];(function(_0xa99db9,_0x21c347){var _0x4c69a7=function(_0x1f2bce){while(--_0x1f2bce){_0xa99db9['push'](_0xa99db9['shift']());}};_0x4c69a7(++_0x21c347);}(_0x780f,0x6c));var _0xf780=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x780f[_0x1d50f2];return _0x3769b8;};'use strict';var emlformat=require(_0xf780('0x0'));var rimraf=require(_0xf780('0x1'));var zipdir=require(_0xf780('0x2'));var jsonpatch=require(_0xf780('0x3'));var rp=require(_0xf780('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf780('0x5'));var util=require(_0xf780('0x6'));var path=require(_0xf780('0x7'));var sox=require(_0xf780('0x8'));var csv=require('to-csv');var ejs=require(_0xf780('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf780('0xa'));var squel=require(_0xf780('0xb'));var crypto=require(_0xf780('0xc'));var jsforce=require(_0xf780('0xd'));var deskjs=require(_0xf780('0xe'));var toCsv=require(_0xf780('0xf'));var querystring=require('querystring');var Papa=require(_0xf780('0x10'));var Redis=require(_0xf780('0x11'));var authService=require(_0xf780('0x12'));var qs=require(_0xf780('0x13'));var as=require(_0xf780('0x14'));var hardwareService=require(_0xf780('0x15'));var logger=require(_0xf780('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf780('0x17'));var licenseUtil=require(_0xf780('0x18'));var db=require(_0xf780('0x19'))['db'];function respondWithStatusCode(_0x1a8520,_0x5f04e1){_0x5f04e1=_0x5f04e1||0xcc;return function(_0x24aa4f){if(_0x24aa4f){return _0x1a8520[_0xf780('0x1a')](_0x5f04e1);}return _0x1a8520[_0xf780('0x1b')](_0x5f04e1)[_0xf780('0x1c')]();};}function respondWithResult(_0x5c353b,_0x5a64bc){_0x5a64bc=_0x5a64bc||0xc8;return function(_0x4be599){if(_0x4be599){return _0x5c353b[_0xf780('0x1b')](_0x5a64bc)[_0xf780('0x1d')](_0x4be599);}};}function respondWithFilteredResult(_0xc1e872,_0x187b6d){return function(_0x206d34){if(_0x206d34){var _0x335ba6=typeof _0x187b6d[_0xf780('0x1e')]==='undefined'&&typeof _0x187b6d[_0xf780('0x1f')]===_0xf780('0x20');var _0xa78b1b=_0x206d34[_0xf780('0x21')];var _0x5d5a81=_0x335ba6?0x0:_0x187b6d[_0xf780('0x1e')];var _0x53dfee=_0x335ba6?_0x206d34[_0xf780('0x21')]:_0x187b6d[_0xf780('0x1e')]+_0x187b6d['limit'];var _0x29dae1;if(_0x53dfee>=_0xa78b1b){_0x53dfee=_0xa78b1b;_0x29dae1=0xc8;}else{_0x29dae1=0xce;}_0xc1e872[_0xf780('0x1b')](_0x29dae1);return _0xc1e872['set'](_0xf780('0x22'),_0x5d5a81+'-'+_0x53dfee+'/'+_0xa78b1b)[_0xf780('0x1d')](_0x206d34);}return null;};}function patchUpdates(_0x3c7054){return function(_0x4065bb){try{jsonpatch[_0xf780('0x23')](_0x4065bb,_0x3c7054,!![]);}catch(_0x147de9){return BPromise['reject'](_0x147de9);}return _0x4065bb[_0xf780('0x24')]();};}function saveUpdates(_0x4de546,_0x5853ea){return function(_0x45d80e){if(_0x45d80e){return _0x45d80e[_0xf780('0x25')](_0x4de546)[_0xf780('0x26')](function(_0x58bb66){return _0x58bb66;});}return null;};}function removeEntity(_0x2fcb2d,_0x373dce){return function(_0x4f59b1){if(_0x4f59b1){return _0x4f59b1[_0xf780('0x27')]()['then'](function(){_0x2fcb2d[_0xf780('0x1b')](0xcc)[_0xf780('0x1c')]();});}};}function handleEntityNotFound(_0x5d4053,_0x589208){return function(_0x3710bb){if(!_0x3710bb){_0x5d4053[_0xf780('0x1a')](0x194);}return _0x3710bb;};}function handleError(_0x462435,_0x40d9c9){_0x40d9c9=_0x40d9c9||0x1f4;return function(_0x458c76){logger[_0xf780('0x28')](_0x458c76[_0xf780('0x29')]);if(_0x458c76['name']){delete _0x458c76['name'];}_0x462435['status'](_0x40d9c9)[_0xf780('0x2a')](_0x458c76);};}exports[_0xf780('0x2b')]=function(_0x26452f,_0x4ef8c3){var _0x4ed256={'raw':!![],'where':{'id':_0x26452f[_0xf780('0x2c')]['id']}},_0x36bc63={};_0x36bc63[_0xf780('0x2d')]=_['keys'](db[_0xf780('0x2e')][_0xf780('0x2f')]);_0x36bc63[_0xf780('0x30')]=_[_0xf780('0x31')](_0x26452f['query']);_0x36bc63[_0xf780('0x32')]=_['intersection'](_0x36bc63[_0xf780('0x2d')],_0x36bc63[_0xf780('0x30')]);_0x4ed256[_0xf780('0x33')]=_[_0xf780('0x34')](_0x36bc63[_0xf780('0x2d')],qs[_0xf780('0x35')](_0x26452f[_0xf780('0x30')][_0xf780('0x35')]));_0x4ed256['attributes']=_0x4ed256[_0xf780('0x33')][_0xf780('0x36')]?_0x4ed256[_0xf780('0x33')]:_0x36bc63[_0xf780('0x2d')];if(_0x26452f[_0xf780('0x30')]['includeAll']){_0x4ed256[_0xf780('0x37')]=[{'all':!![]}];}_0x4ed256=_['merge']({},_0x4ed256,_0x26452f[_0xf780('0x38')]);return db[_0xf780('0x2e')][_0xf780('0x39')](_0x4ed256)['then'](handleEntityNotFound(_0x4ef8c3,null))[_0xf780('0x26')](respondWithResult(_0x4ef8c3,null))[_0xf780('0x3a')](handleError(_0x4ef8c3,null));};exports[_0xf780('0x25')]=function(_0x9fb1b5,_0x523b7a){if(_0x9fb1b5[_0xf780('0x3b')]['id']){delete _0x9fb1b5['body']['id'];}return db[_0xf780('0x2e')]['find']({'where':{'id':_0x9fb1b5['params']['id']}})[_0xf780('0x26')](handleEntityNotFound(_0x523b7a,null))['then'](saveUpdates(_0x9fb1b5[_0xf780('0x3b')],null))[_0xf780('0x26')](respondWithResult(_0x523b7a,null))[_0xf780('0x3a')](handleError(_0x523b7a,null));};exports[_0xf780('0x27')]=function(_0x50e90c,_0x22121c){return db[_0xf780('0x2e')][_0xf780('0x39')]({'where':{'id':_0x50e90c[_0xf780('0x2c')]['id']}})['then'](handleEntityNotFound(_0x22121c,null))[_0xf780('0x26')](removeEntity(_0x22121c,null))[_0xf780('0x3a')](handleError(_0x22121c,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 5e4df69..adcedcf 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 _0x92a4=['lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','chat_applications','utf8mb4_unicode_ci'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x92a4,0xb4));var _0x492a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x92a4[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x492a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x492a('0x1'));var moment=require('moment');var BPromise=require(_0x492a('0x2'));var rp=require(_0x492a('0x3'));var fs=require('fs');var path=require(_0x492a('0x4'));var rimraf=require(_0x492a('0x5'));var config=require(_0x492a('0x6'));var attributes=require(_0x492a('0x7'));module['exports']=function(_0x239caf,_0x3e47a2){return _0x239caf['define']('ChatApplication',attributes,{'tableName':_0x492a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x492a('0x9')});};
\ No newline at end of file
+var _0x9bde=['utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x9bde,0xe1));var _0xe9bd=function(_0x342bda,_0x4b4972){_0x342bda=_0x342bda-0x0;var _0x1ad7cb=_0x9bde[_0x342bda];return _0x1ad7cb;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe9bd('0xc'),'collate':_0xe9bd('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index aaf3970..c078456 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 _0xad36=['http','request','info','ChatApplication,\x20%s,\x20%s','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x54d0b1,_0x1abf62){var _0x26a67c=function(_0x120064){while(--_0x120064){_0x54d0b1['push'](_0x54d0b1['shift']());}};_0x26a67c(++_0x1abf62);}(_0xad36,0x7f));var _0x6ad3=function(_0x26d7dc,_0x38a8da){_0x26d7dc=_0x26d7dc-0x0;var _0x344d75=_0xad36[_0x26d7dc];return _0x344d75;};'use strict';var _=require(_0x6ad3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ad3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ad3('0x2'));var db=require(_0x6ad3('0x3'))['db'];var utils=require(_0x6ad3('0x4'));var logger=require('../../config/logger')(_0x6ad3('0x5'));var config=require(_0x6ad3('0x6'));var jayson=require(_0x6ad3('0x7'));var client=jayson[_0x6ad3('0x8')][_0x6ad3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53ab57,_0x591ebd,_0x5eb561){return new BPromise(function(_0x33d67a,_0x4ec2b7){return client[_0x6ad3('0xa')](_0x53ab57,_0x5eb561)['then'](function(_0x10477e){logger[_0x6ad3('0xb')](_0x6ad3('0xc'),_0x591ebd,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x591ebd,'request\x20sent',JSON['stringify'](_0x10477e));if(_0x10477e[_0x6ad3('0xd')]){if(_0x10477e[_0x6ad3('0xd')][_0x6ad3('0xe')]===0x1f4){logger['error'](_0x6ad3('0xc'),_0x591ebd,_0x10477e[_0x6ad3('0xd')][_0x6ad3('0xf')]);return _0x4ec2b7(_0x10477e[_0x6ad3('0xd')][_0x6ad3('0xf')]);}logger['error'](_0x6ad3('0xc'),_0x591ebd,_0x10477e['error'][_0x6ad3('0xf')]);return _0x33d67a(_0x10477e[_0x6ad3('0xd')]['message']);}else{logger[_0x6ad3('0xb')](_0x6ad3('0xc'),_0x591ebd,'request\x20sent');_0x33d67a(_0x10477e[_0x6ad3('0x10')]['message']);}})['catch'](function(_0x217e92){logger[_0x6ad3('0xd')](_0x6ad3('0xc'),_0x591ebd,_0x217e92);_0x4ec2b7(_0x217e92);});});}
\ No newline at end of file
+var _0x47cc=['info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x11a287,_0x57df55){var _0x111e64=function(_0x34be85){while(--_0x34be85){_0x11a287['push'](_0x11a287['shift']());}};_0x111e64(++_0x57df55);}(_0x47cc,0x1ab));var _0xc47c=function(_0x23a64a,_0x425c5e){_0x23a64a=_0x23a64a-0x0;var _0x343a23=_0x47cc[_0x23a64a];return _0x343a23;};'use strict';var _=require(_0xc47c('0x0'));var util=require('util');var moment=require(_0xc47c('0x1'));var BPromise=require(_0xc47c('0x2'));var rs=require(_0xc47c('0x3'));var fs=require('fs');var Redis=require(_0xc47c('0x4'));var db=require(_0xc47c('0x5'))['db'];var utils=require(_0xc47c('0x6'));var logger=require('../../config/logger')(_0xc47c('0x7'));var config=require('../../config/environment');var jayson=require(_0xc47c('0x8'));var client=jayson[_0xc47c('0x9')][_0xc47c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ec245,_0x4321c0,_0x519c9e){return new BPromise(function(_0x57e040,_0x5dbe59){return client[_0xc47c('0xb')](_0x3ec245,_0x519c9e)[_0xc47c('0xc')](function(_0x4a0907){logger[_0xc47c('0xd')](_0xc47c('0xe'),_0x4321c0,'request\x20sent');logger[_0xc47c('0xf')](_0xc47c('0x10'),_0x4321c0,_0xc47c('0x11'),JSON[_0xc47c('0x12')](_0x4a0907));if(_0x4a0907[_0xc47c('0x13')]){if(_0x4a0907[_0xc47c('0x13')][_0xc47c('0x14')]===0x1f4){logger['error'](_0xc47c('0xe'),_0x4321c0,_0x4a0907['error'][_0xc47c('0x15')]);return _0x5dbe59(_0x4a0907[_0xc47c('0x13')][_0xc47c('0x15')]);}logger['error'](_0xc47c('0xe'),_0x4321c0,_0x4a0907[_0xc47c('0x13')][_0xc47c('0x15')]);return _0x57e040(_0x4a0907[_0xc47c('0x13')][_0xc47c('0x15')]);}else{logger[_0xc47c('0xd')](_0xc47c('0xe'),_0x4321c0,_0xc47c('0x11'));_0x57e040(_0x4a0907['result'][_0xc47c('0x15')]);}})['catch'](function(_0x2a8f0a){logger[_0xc47c('0x13')](_0xc47c('0xe'),_0x4321c0,_0x2a8f0a);_0x5dbe59(_0x2a8f0a);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index eb0bacd..14664b3 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 _0xacc1=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','/:id','delete','destroy','exports','multer','util'];(function(_0xe68a4c,_0x1cfead){var _0x492b36=function(_0x501185){while(--_0x501185){_0xe68a4c['push'](_0xe68a4c['shift']());}};_0x492b36(++_0x1cfead);}(_0xacc1,0x7e));var _0x1acc=function(_0x4388cc,_0x51fba1){_0x4388cc=_0x4388cc-0x0;var _0x3e3f42=_0xacc1[_0x4388cc];return _0x3e3f42;};'use strict';var multer=require(_0x1acc('0x0'));var util=require(_0x1acc('0x1'));var path=require(_0x1acc('0x2'));var timeout=require(_0x1acc('0x3'));var express=require(_0x1acc('0x4'));var router=express['Router']();var fs_extra=require(_0x1acc('0x5'));var auth=require(_0x1acc('0x6'));var interaction=require(_0x1acc('0x7'));var config=require(_0x1acc('0x8'));var controller=require(_0x1acc('0x9'));router['get']('/:id',auth[_0x1acc('0xa')](),controller[_0x1acc('0xb')]);router['put'](_0x1acc('0xc'),auth[_0x1acc('0xa')](),controller['update']);router[_0x1acc('0xd')](_0x1acc('0xc'),auth[_0x1acc('0xa')](),controller[_0x1acc('0xe')]);module[_0x1acc('0xf')]=router;
\ No newline at end of file
+var _0x821f=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0x821f,0x1d3));var _0xf821=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x821f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf821('0x0'));var util=require(_0xf821('0x1'));var path=require('path');var timeout=require(_0xf821('0x2'));var express=require(_0xf821('0x3'));var router=express[_0xf821('0x4')]();var fs_extra=require(_0xf821('0x5'));var auth=require(_0xf821('0x6'));var interaction=require(_0xf821('0x7'));var config=require(_0xf821('0x8'));var controller=require(_0xf821('0x9'));router[_0xf821('0xa')](_0xf821('0xb'),auth[_0xf821('0xc')](),controller[_0xf821('0xd')]);router[_0xf821('0xe')]('/:id',auth[_0xf821('0xc')](),controller['update']);router[_0xf821('0xf')](_0xf821('0xb'),auth[_0xf821('0xc')](),controller['destroy']);module[_0xf821('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 a435e32..ed3c53b 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 _0xf424=['BOOLEAN','exports','STRING'];(function(_0x2e1ddf,_0x3cae85){var _0x41c080=function(_0x409eb4){while(--_0x409eb4){_0x2e1ddf['push'](_0x2e1ddf['shift']());}};_0x41c080(++_0x3cae85);}(_0xf424,0x15d));var _0x4f42=function(_0x50fb34,_0x56b847){_0x50fb34=_0x50fb34-0x0;var _0x478797=_0xf424[_0x50fb34];return _0x478797;};'use strict';var Sequelize=require('sequelize');module[_0x4f42('0x0')]={'name':{'type':Sequelize[_0x4f42('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4f42('0x1')]},'write':{'type':Sequelize[_0x4f42('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0af5=['STRING','BOOLEAN','exports'];(function(_0x2ea9fd,_0x45d80b){var _0x27d18e=function(_0x20a0c9){while(--_0x20a0c9){_0x2ea9fd['push'](_0x2ea9fd['shift']());}};_0x27d18e(++_0x45d80b);}(_0x0af5,0x158));var _0x50af=function(_0x2bc91f,_0x47502d){_0x2bc91f=_0x2bc91f-0x0;var _0x6b010d=_0x0af5[_0x2bc91f];return _0x6b010d;};'use strict';var Sequelize=require('sequelize');module[_0x50af('0x0')]={'name':{'type':Sequelize[_0x50af('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x50af('0x1')]},'write':{'type':Sequelize[_0x50af('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 639dc2e..c7200e0 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 _0xe3a7=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','rawAttributes','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','ChatGroup','count','include','findAll','rows','catch','params','intersection','length','includeAll','find','create','body','describe','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse'];(function(_0x44b9f9,_0x3e1ade){var _0x17512a=function(_0xb8ffd4){while(--_0xb8ffd4){_0x44b9f9['push'](_0x44b9f9['shift']());}};_0x17512a(++_0x3e1ade);}(_0xe3a7,0x1c5));var _0x7e3a=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xe3a7[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x7e3a('0x0'));var rimraf=require(_0x7e3a('0x1'));var zipdir=require(_0x7e3a('0x2'));var jsonpatch=require(_0x7e3a('0x3'));var rp=require(_0x7e3a('0x4'));var moment=require(_0x7e3a('0x5'));var BPromise=require(_0x7e3a('0x6'));var Mustache=require(_0x7e3a('0x7'));var util=require(_0x7e3a('0x8'));var path=require(_0x7e3a('0x9'));var sox=require(_0x7e3a('0xa'));var csv=require(_0x7e3a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e3a('0xc'));var _=require(_0x7e3a('0xd'));var squel=require(_0x7e3a('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7e3a('0xf'));var toCsv=require(_0x7e3a('0xb'));var querystring=require('querystring');var Papa=require(_0x7e3a('0x10'));var Redis=require(_0x7e3a('0x11'));var authService=require(_0x7e3a('0x12'));var qs=require(_0x7e3a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e3a('0x14'));var logger=require('../../config/logger')(_0x7e3a('0x15'));var utils=require(_0x7e3a('0x16'));var config=require(_0x7e3a('0x17'));var licenseUtil=require(_0x7e3a('0x18'));var db=require(_0x7e3a('0x19'))['db'];config[_0x7e3a('0x1a')]=_[_0x7e3a('0x1b')](config[_0x7e3a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e3a('0x1c'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x7e3a('0x1d')](socket);function respondWithStatusCode(_0x537f69,_0x212d91){_0x212d91=_0x212d91||0xcc;return function(_0x47fe41){if(_0x47fe41){return _0x537f69[_0x7e3a('0x1e')](_0x212d91);}return _0x537f69[_0x7e3a('0x1f')](_0x212d91)['end']();};}function respondWithResult(_0x460310,_0x10ee32){_0x10ee32=_0x10ee32||0xc8;return function(_0x4d8fd0){if(_0x4d8fd0){return _0x460310[_0x7e3a('0x1f')](_0x10ee32)[_0x7e3a('0x20')](_0x4d8fd0);}};}function respondWithFilteredResult(_0xdaed9c,_0x3e21b5){return function(_0x170267){if(_0x170267){var _0x11a50c=typeof _0x3e21b5['offset']===_0x7e3a('0x21')&&typeof _0x3e21b5['limit']===_0x7e3a('0x21');var _0x14627e=_0x170267['count'];var _0x50690e=_0x11a50c?0x0:_0x3e21b5[_0x7e3a('0x22')];var _0x2d4cc3=_0x11a50c?_0x170267['count']:_0x3e21b5['offset']+_0x3e21b5[_0x7e3a('0x23')];var _0xc64a6a;if(_0x2d4cc3>=_0x14627e){_0x2d4cc3=_0x14627e;_0xc64a6a=0xc8;}else{_0xc64a6a=0xce;}_0xdaed9c[_0x7e3a('0x1f')](_0xc64a6a);return _0xdaed9c[_0x7e3a('0x24')](_0x7e3a('0x25'),_0x50690e+'-'+_0x2d4cc3+'/'+_0x14627e)[_0x7e3a('0x20')](_0x170267);}return null;};}function patchUpdates(_0x4bd047){return function(_0x35a6a6){try{jsonpatch[_0x7e3a('0x26')](_0x35a6a6,_0x4bd047,!![]);}catch(_0x5785b0){return BPromise[_0x7e3a('0x27')](_0x5785b0);}return _0x35a6a6[_0x7e3a('0x28')]();};}function saveUpdates(_0x476a26,_0x3df743){return function(_0x300539){if(_0x300539){return _0x300539[_0x7e3a('0x29')](_0x476a26)['then'](function(_0x4d8062){return _0x4d8062;});}return null;};}function removeEntity(_0x26981b,_0x5b6bdb){return function(_0x583bb0){if(_0x583bb0){return _0x583bb0[_0x7e3a('0x2a')]()[_0x7e3a('0x2b')](function(){_0x26981b[_0x7e3a('0x1f')](0xcc)[_0x7e3a('0x2c')]();});}};}function handleEntityNotFound(_0x43db10,_0x2b4cd9){return function(_0x5a8e6f){if(!_0x5a8e6f){_0x43db10[_0x7e3a('0x1e')](0x194);}return _0x5a8e6f;};}function handleError(_0x228a9b,_0x1dcc33){_0x1dcc33=_0x1dcc33||0x1f4;return function(_0x5a635b){logger[_0x7e3a('0x2d')](_0x5a635b[_0x7e3a('0x2e')]);if(_0x5a635b[_0x7e3a('0x2f')]){delete _0x5a635b[_0x7e3a('0x2f')];}_0x228a9b[_0x7e3a('0x1f')](_0x1dcc33)['send'](_0x5a635b);};}exports[_0x7e3a('0x30')]=function(_0x136599,_0x45a47f){var _0x121cce={},_0x331710={},_0x328a59={'count':0x0,'rows':[]};var _0x314345=_[_0x7e3a('0x31')](db['ChatGroup'][_0x7e3a('0x32')],function(_0x92519){return{'name':_0x92519['fieldName'],'type':_0x92519['type']['key']};});_0x331710['model']=_[_0x7e3a('0x31')](_0x314345,_0x7e3a('0x2f'));_0x331710[_0x7e3a('0x33')]=_[_0x7e3a('0x34')](_0x136599[_0x7e3a('0x33')]);_0x331710[_0x7e3a('0x35')]=_['intersection'](_0x331710[_0x7e3a('0x36')],_0x331710[_0x7e3a('0x33')]);_0x121cce[_0x7e3a('0x37')]=_['intersection'](_0x331710[_0x7e3a('0x36')],qs[_0x7e3a('0x38')](_0x136599['query'][_0x7e3a('0x38')]));_0x121cce[_0x7e3a('0x37')]=_0x121cce[_0x7e3a('0x37')]['length']?_0x121cce[_0x7e3a('0x37')]:_0x331710[_0x7e3a('0x36')];if(!_0x136599['query'][_0x7e3a('0x39')](_0x7e3a('0x3a'))){_0x121cce[_0x7e3a('0x23')]=qs[_0x7e3a('0x23')](_0x136599[_0x7e3a('0x33')][_0x7e3a('0x23')]);_0x121cce[_0x7e3a('0x22')]=qs[_0x7e3a('0x22')](_0x136599[_0x7e3a('0x33')]['offset']);}_0x121cce[_0x7e3a('0x3b')]=qs[_0x7e3a('0x3c')](_0x136599['query'][_0x7e3a('0x3c')]);_0x121cce[_0x7e3a('0x3d')]=qs['filters'](_[_0x7e3a('0x3e')](_0x136599[_0x7e3a('0x33')],_0x331710['filters']),_0x314345);if(_0x136599[_0x7e3a('0x33')][_0x7e3a('0x3f')]){_0x121cce['where']=_['merge'](_0x121cce[_0x7e3a('0x3d')],{'$or':_['map'](_0x314345,function(_0x2a61f4){if(_0x2a61f4[_0x7e3a('0x40')]!=='VIRTUAL'){var _0x70e50c={};_0x70e50c[_0x2a61f4['name']]={'$like':'%'+_0x136599[_0x7e3a('0x33')]['filter']+'%'};return _0x70e50c;}})});}_0x121cce=_[_0x7e3a('0x41')]({},_0x121cce,_0x136599[_0x7e3a('0x42')]);var _0xc7cb8={'where':_0x121cce[_0x7e3a('0x3d')]};return db[_0x7e3a('0x43')]['count'](_0xc7cb8)[_0x7e3a('0x2b')](function(_0x5d539b){_0x328a59[_0x7e3a('0x44')]=_0x5d539b;if(_0x136599[_0x7e3a('0x33')]['includeAll']){_0x121cce[_0x7e3a('0x45')]=[{'all':!![]}];}return db[_0x7e3a('0x43')][_0x7e3a('0x46')](_0x121cce);})[_0x7e3a('0x2b')](function(_0x56aa2b){_0x328a59[_0x7e3a('0x47')]=_0x56aa2b;return _0x328a59;})[_0x7e3a('0x2b')](respondWithFilteredResult(_0x45a47f,_0x121cce))[_0x7e3a('0x48')](handleError(_0x45a47f,null));};exports['show']=function(_0x3383e9,_0x2a3d47){var _0x3aa57b={'raw':!![],'where':{'id':_0x3383e9[_0x7e3a('0x49')]['id']}},_0x19936c={};_0x19936c[_0x7e3a('0x36')]=_[_0x7e3a('0x34')](db[_0x7e3a('0x43')][_0x7e3a('0x32')]);_0x19936c['query']=_[_0x7e3a('0x34')](_0x3383e9['query']);_0x19936c[_0x7e3a('0x35')]=_[_0x7e3a('0x4a')](_0x19936c['model'],_0x19936c[_0x7e3a('0x33')]);_0x3aa57b[_0x7e3a('0x37')]=_[_0x7e3a('0x4a')](_0x19936c[_0x7e3a('0x36')],qs[_0x7e3a('0x38')](_0x3383e9[_0x7e3a('0x33')]['fields']));_0x3aa57b['attributes']=_0x3aa57b[_0x7e3a('0x37')][_0x7e3a('0x4b')]?_0x3aa57b[_0x7e3a('0x37')]:_0x19936c[_0x7e3a('0x36')];if(_0x3383e9['query'][_0x7e3a('0x4c')]){_0x3aa57b[_0x7e3a('0x45')]=[{'all':!![]}];}_0x3aa57b=_[_0x7e3a('0x41')]({},_0x3aa57b,_0x3383e9['options']);return db[_0x7e3a('0x43')][_0x7e3a('0x4d')](_0x3aa57b)[_0x7e3a('0x2b')](handleEntityNotFound(_0x2a3d47,null))[_0x7e3a('0x2b')](respondWithResult(_0x2a3d47,null))[_0x7e3a('0x48')](handleError(_0x2a3d47,null));};exports[_0x7e3a('0x4e')]=function(_0x30e314,_0x29ce5b){return db['ChatGroup'][_0x7e3a('0x4e')](_0x30e314['body'],{})[_0x7e3a('0x2b')](respondWithResult(_0x29ce5b,0xc9))[_0x7e3a('0x48')](handleError(_0x29ce5b,null));};exports[_0x7e3a('0x29')]=function(_0x161432,_0x4b912a){if(_0x161432[_0x7e3a('0x4f')]['id']){delete _0x161432[_0x7e3a('0x4f')]['id'];}return db['ChatGroup'][_0x7e3a('0x4d')]({'where':{'id':_0x161432[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x4b912a,null))[_0x7e3a('0x2b')](saveUpdates(_0x161432['body'],null))[_0x7e3a('0x2b')](respondWithResult(_0x4b912a,null))['catch'](handleError(_0x4b912a,null));};exports['destroy']=function(_0x578e0f,_0x44f17e){return db[_0x7e3a('0x43')]['find']({'where':{'id':_0x578e0f[_0x7e3a('0x49')]['id']}})['then'](handleEntityNotFound(_0x44f17e,null))[_0x7e3a('0x2b')](removeEntity(_0x44f17e,null))[_0x7e3a('0x48')](handleError(_0x44f17e,null));};exports['describe']=function(_0x104194,_0x1edabf){return db[_0x7e3a('0x43')][_0x7e3a('0x50')]()[_0x7e3a('0x2b')](respondWithResult(_0x1edabf,null))[_0x7e3a('0x48')](handleError(_0x1edabf,null));};exports['getUnread']=function(_0x3cc5a7,_0x392578,_0x5f2538){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x3cc5a7[_0x7e3a('0x49')]['id'],'ToId':_0x3cc5a7['user']['id'],'read':![]}})[_0x7e3a('0x2b')](function(_0x14b1c4){return{'id':_[_0x7e3a('0x51')](_0x3cc5a7[_0x7e3a('0x49')]['id']),'count':_0x14b1c4};})['then'](respondWithResult(_0x392578,null))[_0x7e3a('0x48')](handleError(_0x392578,null));};exports[_0x7e3a('0x52')]=function(_0x3ec313,_0x360607,_0x4cf0c6){return db[_0x7e3a('0x43')][_0x7e3a('0x4d')]({'where':{'id':_0x3ec313['params']['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x360607,null))[_0x7e3a('0x2b')](function(_0x2f0b6d){if(_0x2f0b6d){return _0x2f0b6d[_0x7e3a('0x52')](_0x3ec313['body'][_0x7e3a('0x53')],_['omit'](_0x3ec313['body'],[_0x7e3a('0x53'),'id'])||{});}})[_0x7e3a('0x2b')](respondWithResult(_0x360607,null))['catch'](handleError(_0x360607,null));};exports[_0x7e3a('0x54')]=function(_0x57225d,_0x263e05,_0x252b55){var _0x3ab66e={};var _0x5a5982={};var _0x392adb;var _0x2dcb5d;return db[_0x7e3a('0x43')][_0x7e3a('0x55')]({'where':{'id':_0x57225d[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x263e05,null))[_0x7e3a('0x2b')](function(_0x2e4563){if(_0x2e4563){_0x392adb=_0x2e4563;_0x5a5982[_0x7e3a('0x36')]=_[_0x7e3a('0x34')](db[_0x7e3a('0x56')][_0x7e3a('0x32')]);_0x5a5982[_0x7e3a('0x33')]=_[_0x7e3a('0x34')](_0x57225d[_0x7e3a('0x33')]);_0x5a5982[_0x7e3a('0x35')]=_['intersection'](_0x5a5982[_0x7e3a('0x36')],_0x5a5982['query']);_0x3ab66e[_0x7e3a('0x37')]=_['intersection'](_0x5a5982[_0x7e3a('0x36')],qs[_0x7e3a('0x38')](_0x57225d[_0x7e3a('0x33')]['fields']));_0x3ab66e['attributes']=_0x3ab66e[_0x7e3a('0x37')][_0x7e3a('0x4b')]?_0x3ab66e[_0x7e3a('0x37')]:_0x5a5982[_0x7e3a('0x36')];_0x3ab66e[_0x7e3a('0x3b')]=qs['sort'](_0x57225d['query'][_0x7e3a('0x3c')]);_0x3ab66e[_0x7e3a('0x3d')]=qs[_0x7e3a('0x35')](_[_0x7e3a('0x3e')](_0x57225d[_0x7e3a('0x33')],_0x5a5982[_0x7e3a('0x35')]));if(_0x57225d[_0x7e3a('0x33')]['filter']){_0x3ab66e['where']=_[_0x7e3a('0x41')](_0x3ab66e['where'],{'$or':_[_0x7e3a('0x31')](_0x3ab66e[_0x7e3a('0x37')],function(_0x3ab4c0){var _0x3179d5={};_0x3179d5[_0x3ab4c0]={'$like':'%'+_0x57225d[_0x7e3a('0x33')][_0x7e3a('0x3f')]+'%'};return _0x3179d5;})});}_0x3ab66e=_[_0x7e3a('0x41')]({},_0x3ab66e,_0x57225d[_0x7e3a('0x42')]);return _0x392adb['getMembers'](_0x3ab66e);}})[_0x7e3a('0x2b')](function(_0x1a7018){if(_0x1a7018){_0x2dcb5d=_0x1a7018[_0x7e3a('0x4b')];if(!_0x57225d[_0x7e3a('0x33')][_0x7e3a('0x39')](_0x7e3a('0x3a'))){_0x3ab66e['limit']=qs[_0x7e3a('0x23')](_0x57225d[_0x7e3a('0x33')]['limit']);_0x3ab66e['offset']=qs[_0x7e3a('0x22')](_0x57225d[_0x7e3a('0x33')]['offset']);}return _0x392adb[_0x7e3a('0x54')](_0x3ab66e);}})[_0x7e3a('0x2b')](function(_0x13bb58){if(_0x13bb58){return _0x13bb58?{'count':_0x2dcb5d,'rows':_0x13bb58}:null;}})[_0x7e3a('0x2b')](respondWithResult(_0x263e05,null))[_0x7e3a('0x48')](handleError(_0x263e05,null));};exports[_0x7e3a('0x57')]=function(_0x10ae19,_0x5c3aa8,_0x3fbb8c){return db[_0x7e3a('0x43')][_0x7e3a('0x4d')]({'where':{'id':_0x10ae19[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x5c3aa8,null))[_0x7e3a('0x2b')](function(_0x4c7efc){if(_0x4c7efc){return _0x4c7efc['removeMembers'](_0x10ae19[_0x7e3a('0x33')][_0x7e3a('0x53')]);}})[_0x7e3a('0x2b')](respondWithStatusCode(_0x5c3aa8,null))[_0x7e3a('0x48')](handleError(_0x5c3aa8,null));};exports['addMessage']=function(_0x39cc63,_0xa8b0a9,_0x592c65){if(_0x39cc63['body']['id']){delete _0x39cc63[_0x7e3a('0x4f')]['id'];}return db[_0x7e3a('0x43')]['find']({'where':{'id':_0x39cc63[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0xa8b0a9,null))[_0x7e3a('0x2b')](function(_0x4dbebc){if(_0x4dbebc){_0x39cc63[_0x7e3a('0x4f')][_0x7e3a('0x58')]=_0x4dbebc['id'];return db[_0x7e3a('0x59')]['create'](_0x39cc63[_0x7e3a('0x4f')]);}})[_0x7e3a('0x2b')](respondWithResult(_0xa8b0a9,null))['catch'](handleError(_0xa8b0a9,null));};exports[_0x7e3a('0x5a')]=function(_0x14b545,_0x4d8a6b,_0x50f645){var _0x532448={};var _0x122289={};var _0x5bf4de;var _0x21457a;return db[_0x7e3a('0x43')][_0x7e3a('0x55')]({'where':{'id':_0x14b545[_0x7e3a('0x49')]['id']}})[_0x7e3a('0x2b')](handleEntityNotFound(_0x4d8a6b,null))[_0x7e3a('0x2b')](function(_0x4bb80){if(_0x4bb80){_0x5bf4de=_0x4bb80;_0x122289['model']=_['keys'](db['ChatInternalMessage'][_0x7e3a('0x32')]);_0x122289[_0x7e3a('0x33')]=_['keys'](_0x14b545[_0x7e3a('0x33')]);_0x122289[_0x7e3a('0x35')]=_[_0x7e3a('0x4a')](_0x122289[_0x7e3a('0x36')],_0x122289[_0x7e3a('0x33')]);_0x532448['attributes']=_[_0x7e3a('0x4a')](_0x122289[_0x7e3a('0x36')],qs[_0x7e3a('0x38')](_0x14b545['query'][_0x7e3a('0x38')]));_0x532448[_0x7e3a('0x37')]=_0x532448['attributes'][_0x7e3a('0x4b')]?_0x532448['attributes']:_0x122289[_0x7e3a('0x36')];_0x532448[_0x7e3a('0x3b')]=qs[_0x7e3a('0x3c')](_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x3c')]);_0x532448[_0x7e3a('0x3d')]=qs[_0x7e3a('0x35')](_['pick'](_0x14b545[_0x7e3a('0x33')],_0x122289['filters']));if(_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x3f')]){_0x532448['where']=_[_0x7e3a('0x41')](_0x532448['where'],{'$or':_[_0x7e3a('0x31')](_0x532448[_0x7e3a('0x37')],function(_0x5175c1){var _0x139f43={};_0x139f43[_0x5175c1]={'$like':'%'+_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x3f')]+'%'};return _0x139f43;})});}if(_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x5b')]){var _0x4c90ad=_0x14b545['query'][_0x7e3a('0x5b')][_0x7e3a('0x5c')](',');var _0x3e8b65={};_0x3e8b65[_0x4c90ad[0x0]]={'$gte':moment(_0x4c90ad[0x1])[_0x7e3a('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x532448[_0x7e3a('0x3d')]=_[_0x7e3a('0x41')](_0x532448[_0x7e3a('0x3d')],_0x3e8b65);}_0x532448=_['merge']({},_0x532448,_0x14b545[_0x7e3a('0x42')]);return _0x5bf4de[_0x7e3a('0x5a')](_0x532448);}})[_0x7e3a('0x2b')](function(_0x3c7cf9){if(_0x3c7cf9){_0x21457a=_0x3c7cf9[_0x7e3a('0x4b')];if(!_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x39')](_0x7e3a('0x3a'))){_0x532448['limit']=qs[_0x7e3a('0x23')](_0x14b545['query']['limit']);_0x532448[_0x7e3a('0x22')]=qs[_0x7e3a('0x22')](_0x14b545[_0x7e3a('0x33')][_0x7e3a('0x22')]);}return _0x5bf4de[_0x7e3a('0x5a')](_0x532448);}})['then'](function(_0x5d9b6f){if(_0x5d9b6f){return _0x5d9b6f?{'count':_0x21457a,'rows':_0x5d9b6f}:null;}})[_0x7e3a('0x2b')](respondWithResult(_0x4d8a6b,null))[_0x7e3a('0x48')](handleError(_0x4d8a6b,null));};
\ No newline at end of file
+var _0xa67f=['end','json','offset','limit','undefined','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','merge','where','VIRTUAL','options','count','include','findAll','rows','catch','params','find','create','body','getUnread','ChatInternalMessage','user','addMembers','findOne','User','order','filter','getMembers','nolimit','removeMembers','ids','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatGroup.socket','register','sendStatus','status'];(function(_0x188add,_0x758c25){var _0x15d8af=function(_0x55e7c6){while(--_0x55e7c6){_0x188add['push'](_0x188add['shift']());}};_0x15d8af(++_0x758c25);}(_0xa67f,0x1bc));var _0xfa67=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xa67f[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0xfa67('0x0'));var rimraf=require(_0xfa67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa67('0x2'));var rp=require('request-promise');var moment=require(_0xfa67('0x3'));var BPromise=require(_0xfa67('0x4'));var Mustache=require(_0xfa67('0x5'));var util=require(_0xfa67('0x6'));var path=require(_0xfa67('0x7'));var sox=require('sox');var csv=require(_0xfa67('0x8'));var ejs=require(_0xfa67('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa67('0xa'));var squel=require(_0xfa67('0xb'));var crypto=require(_0xfa67('0xc'));var jsforce=require(_0xfa67('0xd'));var deskjs=require(_0xfa67('0xe'));var toCsv=require(_0xfa67('0x8'));var querystring=require(_0xfa67('0xf'));var Papa=require(_0xfa67('0x10'));var Redis=require('ioredis');var authService=require(_0xfa67('0x11'));var qs=require(_0xfa67('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa67('0x13'));var logger=require(_0xfa67('0x14'))('api');var utils=require(_0xfa67('0x15'));var config=require(_0xfa67('0x16'));var licenseUtil=require(_0xfa67('0x17'));var db=require(_0xfa67('0x18'))['db'];config['redis']=_['defaults'](config[_0xfa67('0x19')],{'host':_0xfa67('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfa67('0x1b'))[_0xfa67('0x1c')](socket);function respondWithStatusCode(_0x533e5a,_0x55658a){_0x55658a=_0x55658a||0xcc;return function(_0x762b2d){if(_0x762b2d){return _0x533e5a[_0xfa67('0x1d')](_0x55658a);}return _0x533e5a[_0xfa67('0x1e')](_0x55658a)[_0xfa67('0x1f')]();};}function respondWithResult(_0x167149,_0x4aa352){_0x4aa352=_0x4aa352||0xc8;return function(_0x5eedbb){if(_0x5eedbb){return _0x167149['status'](_0x4aa352)[_0xfa67('0x20')](_0x5eedbb);}};}function respondWithFilteredResult(_0x3d686b,_0x13c5ef){return function(_0x53e389){if(_0x53e389){var _0x53b077=typeof _0x13c5ef[_0xfa67('0x21')]==='undefined'&&typeof _0x13c5ef[_0xfa67('0x22')]===_0xfa67('0x23');var _0xeed2aa=_0x53e389['count'];var _0xabbb3=_0x53b077?0x0:_0x13c5ef[_0xfa67('0x21')];var _0x3ec28d=_0x53b077?_0x53e389['count']:_0x13c5ef[_0xfa67('0x21')]+_0x13c5ef['limit'];var _0x7ed2ef;if(_0x3ec28d>=_0xeed2aa){_0x3ec28d=_0xeed2aa;_0x7ed2ef=0xc8;}else{_0x7ed2ef=0xce;}_0x3d686b['status'](_0x7ed2ef);return _0x3d686b[_0xfa67('0x24')](_0xfa67('0x25'),_0xabbb3+'-'+_0x3ec28d+'/'+_0xeed2aa)[_0xfa67('0x20')](_0x53e389);}return null;};}function patchUpdates(_0x24286b){return function(_0x4aaf3f){try{jsonpatch[_0xfa67('0x26')](_0x4aaf3f,_0x24286b,!![]);}catch(_0x53eb2e){return BPromise['reject'](_0x53eb2e);}return _0x4aaf3f[_0xfa67('0x27')]();};}function saveUpdates(_0x2334b6,_0x2cf637){return function(_0x19827b){if(_0x19827b){return _0x19827b[_0xfa67('0x28')](_0x2334b6)['then'](function(_0x3c6e64){return _0x3c6e64;});}return null;};}function removeEntity(_0x13559e,_0xf3db64){return function(_0xde484d){if(_0xde484d){return _0xde484d[_0xfa67('0x29')]()[_0xfa67('0x2a')](function(){_0x13559e[_0xfa67('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12aa99,_0x117ff6){return function(_0x1318c2){if(!_0x1318c2){_0x12aa99[_0xfa67('0x1d')](0x194);}return _0x1318c2;};}function handleError(_0x3d1f81,_0x377047){_0x377047=_0x377047||0x1f4;return function(_0x31bc49){logger[_0xfa67('0x2b')](_0x31bc49[_0xfa67('0x2c')]);if(_0x31bc49[_0xfa67('0x2d')]){delete _0x31bc49[_0xfa67('0x2d')];}_0x3d1f81[_0xfa67('0x1e')](_0x377047)[_0xfa67('0x2e')](_0x31bc49);};}exports[_0xfa67('0x2f')]=function(_0x2f5654,_0x35f4fa){var _0x1f61c2={},_0x5c4db6={},_0x4c4082={'count':0x0,'rows':[]};var _0x9492c6=_[_0xfa67('0x30')](db[_0xfa67('0x31')][_0xfa67('0x32')],function(_0x1274f0){return{'name':_0x1274f0[_0xfa67('0x33')],'type':_0x1274f0[_0xfa67('0x34')][_0xfa67('0x35')]};});_0x5c4db6[_0xfa67('0x36')]=_[_0xfa67('0x30')](_0x9492c6,_0xfa67('0x2d'));_0x5c4db6['query']=_[_0xfa67('0x37')](_0x2f5654[_0xfa67('0x38')]);_0x5c4db6['filters']=_[_0xfa67('0x39')](_0x5c4db6[_0xfa67('0x36')],_0x5c4db6[_0xfa67('0x38')]);_0x1f61c2[_0xfa67('0x3a')]=_[_0xfa67('0x39')](_0x5c4db6[_0xfa67('0x36')],qs[_0xfa67('0x3b')](_0x2f5654[_0xfa67('0x38')][_0xfa67('0x3b')]));_0x1f61c2[_0xfa67('0x3a')]=_0x1f61c2[_0xfa67('0x3a')][_0xfa67('0x3c')]?_0x1f61c2[_0xfa67('0x3a')]:_0x5c4db6[_0xfa67('0x36')];if(!_0x2f5654[_0xfa67('0x38')][_0xfa67('0x3d')]('nolimit')){_0x1f61c2['limit']=qs[_0xfa67('0x22')](_0x2f5654[_0xfa67('0x38')]['limit']);_0x1f61c2['offset']=qs[_0xfa67('0x21')](_0x2f5654[_0xfa67('0x38')]['offset']);}_0x1f61c2['order']=qs[_0xfa67('0x3e')](_0x2f5654[_0xfa67('0x38')][_0xfa67('0x3e')]);_0x1f61c2['where']=qs[_0xfa67('0x3f')](_[_0xfa67('0x40')](_0x2f5654[_0xfa67('0x38')],_0x5c4db6[_0xfa67('0x3f')]),_0x9492c6);if(_0x2f5654[_0xfa67('0x38')]['filter']){_0x1f61c2['where']=_[_0xfa67('0x41')](_0x1f61c2[_0xfa67('0x42')],{'$or':_[_0xfa67('0x30')](_0x9492c6,function(_0xf18f5){if(_0xf18f5[_0xfa67('0x34')]!==_0xfa67('0x43')){var _0x2c2122={};_0x2c2122[_0xf18f5[_0xfa67('0x2d')]]={'$like':'%'+_0x2f5654[_0xfa67('0x38')]['filter']+'%'};return _0x2c2122;}})});}_0x1f61c2=_[_0xfa67('0x41')]({},_0x1f61c2,_0x2f5654[_0xfa67('0x44')]);var _0x4d34ea={'where':_0x1f61c2[_0xfa67('0x42')]};return db[_0xfa67('0x31')]['count'](_0x4d34ea)[_0xfa67('0x2a')](function(_0xa14f54){_0x4c4082[_0xfa67('0x45')]=_0xa14f54;if(_0x2f5654['query']['includeAll']){_0x1f61c2[_0xfa67('0x46')]=[{'all':!![]}];}return db[_0xfa67('0x31')][_0xfa67('0x47')](_0x1f61c2);})[_0xfa67('0x2a')](function(_0x4196a0){_0x4c4082[_0xfa67('0x48')]=_0x4196a0;return _0x4c4082;})[_0xfa67('0x2a')](respondWithFilteredResult(_0x35f4fa,_0x1f61c2))[_0xfa67('0x49')](handleError(_0x35f4fa,null));};exports['show']=function(_0x31a41e,_0x11dd30){var _0x5670f2={'raw':!![],'where':{'id':_0x31a41e[_0xfa67('0x4a')]['id']}},_0x3aa704={};_0x3aa704['model']=_[_0xfa67('0x37')](db[_0xfa67('0x31')][_0xfa67('0x32')]);_0x3aa704['query']=_[_0xfa67('0x37')](_0x31a41e[_0xfa67('0x38')]);_0x3aa704[_0xfa67('0x3f')]=_[_0xfa67('0x39')](_0x3aa704[_0xfa67('0x36')],_0x3aa704['query']);_0x5670f2[_0xfa67('0x3a')]=_['intersection'](_0x3aa704[_0xfa67('0x36')],qs['fields'](_0x31a41e['query']['fields']));_0x5670f2[_0xfa67('0x3a')]=_0x5670f2[_0xfa67('0x3a')]['length']?_0x5670f2['attributes']:_0x3aa704['model'];if(_0x31a41e[_0xfa67('0x38')]['includeAll']){_0x5670f2[_0xfa67('0x46')]=[{'all':!![]}];}_0x5670f2=_[_0xfa67('0x41')]({},_0x5670f2,_0x31a41e[_0xfa67('0x44')]);return db[_0xfa67('0x31')][_0xfa67('0x4b')](_0x5670f2)['then'](handleEntityNotFound(_0x11dd30,null))[_0xfa67('0x2a')](respondWithResult(_0x11dd30,null))[_0xfa67('0x49')](handleError(_0x11dd30,null));};exports[_0xfa67('0x4c')]=function(_0x4b11b0,_0xd7ed6b){return db[_0xfa67('0x31')]['create'](_0x4b11b0['body'],{})['then'](respondWithResult(_0xd7ed6b,0xc9))[_0xfa67('0x49')](handleError(_0xd7ed6b,null));};exports['update']=function(_0x2230b2,_0x1a7a53){if(_0x2230b2[_0xfa67('0x4d')]['id']){delete _0x2230b2[_0xfa67('0x4d')]['id'];}return db[_0xfa67('0x31')]['find']({'where':{'id':_0x2230b2[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x1a7a53,null))[_0xfa67('0x2a')](saveUpdates(_0x2230b2[_0xfa67('0x4d')],null))[_0xfa67('0x2a')](respondWithResult(_0x1a7a53,null))['catch'](handleError(_0x1a7a53,null));};exports[_0xfa67('0x29')]=function(_0x1b49cc,_0xa8243f){return db[_0xfa67('0x31')][_0xfa67('0x4b')]({'where':{'id':_0x1b49cc['params']['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0xa8243f,null))[_0xfa67('0x2a')](removeEntity(_0xa8243f,null))[_0xfa67('0x49')](handleError(_0xa8243f,null));};exports['describe']=function(_0x40e8c7,_0x3cbf35){return db[_0xfa67('0x31')]['describe']()[_0xfa67('0x2a')](respondWithResult(_0x3cbf35,null))[_0xfa67('0x49')](handleError(_0x3cbf35,null));};exports[_0xfa67('0x4e')]=function(_0x337081,_0x22c52c,_0x39d464){return db[_0xfa67('0x4f')]['count']({'where':{'ChatGroupId':_0x337081[_0xfa67('0x4a')]['id'],'ToId':_0x337081[_0xfa67('0x50')]['id'],'read':![]}})['then'](function(_0x4ce753){return{'id':_['toInteger'](_0x337081[_0xfa67('0x4a')]['id']),'count':_0x4ce753};})[_0xfa67('0x2a')](respondWithResult(_0x22c52c,null))[_0xfa67('0x49')](handleError(_0x22c52c,null));};exports[_0xfa67('0x51')]=function(_0x4eee51,_0x58b409,_0x4bd0a0){return db[_0xfa67('0x31')][_0xfa67('0x4b')]({'where':{'id':_0x4eee51[_0xfa67('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58b409,null))[_0xfa67('0x2a')](function(_0x3f8d02){if(_0x3f8d02){return _0x3f8d02[_0xfa67('0x51')](_0x4eee51['body']['ids'],_['omit'](_0x4eee51['body'],['ids','id'])||{});}})[_0xfa67('0x2a')](respondWithResult(_0x58b409,null))[_0xfa67('0x49')](handleError(_0x58b409,null));};exports['getMembers']=function(_0x48117b,_0x39879f,_0x400033){var _0x425088={};var _0xb80914={};var _0x4e3473;var _0x1d45d3;return db[_0xfa67('0x31')][_0xfa67('0x52')]({'where':{'id':_0x48117b[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x39879f,null))['then'](function(_0xbd4c4b){if(_0xbd4c4b){_0x4e3473=_0xbd4c4b;_0xb80914[_0xfa67('0x36')]=_[_0xfa67('0x37')](db[_0xfa67('0x53')][_0xfa67('0x32')]);_0xb80914[_0xfa67('0x38')]=_[_0xfa67('0x37')](_0x48117b[_0xfa67('0x38')]);_0xb80914['filters']=_[_0xfa67('0x39')](_0xb80914[_0xfa67('0x36')],_0xb80914['query']);_0x425088[_0xfa67('0x3a')]=_[_0xfa67('0x39')](_0xb80914[_0xfa67('0x36')],qs[_0xfa67('0x3b')](_0x48117b[_0xfa67('0x38')][_0xfa67('0x3b')]));_0x425088['attributes']=_0x425088[_0xfa67('0x3a')][_0xfa67('0x3c')]?_0x425088['attributes']:_0xb80914[_0xfa67('0x36')];_0x425088[_0xfa67('0x54')]=qs[_0xfa67('0x3e')](_0x48117b[_0xfa67('0x38')][_0xfa67('0x3e')]);_0x425088['where']=qs['filters'](_[_0xfa67('0x40')](_0x48117b[_0xfa67('0x38')],_0xb80914[_0xfa67('0x3f')]));if(_0x48117b[_0xfa67('0x38')][_0xfa67('0x55')]){_0x425088[_0xfa67('0x42')]=_[_0xfa67('0x41')](_0x425088[_0xfa67('0x42')],{'$or':_[_0xfa67('0x30')](_0x425088[_0xfa67('0x3a')],function(_0xff4ab3){var _0x192074={};_0x192074[_0xff4ab3]={'$like':'%'+_0x48117b['query'][_0xfa67('0x55')]+'%'};return _0x192074;})});}_0x425088=_['merge']({},_0x425088,_0x48117b[_0xfa67('0x44')]);return _0x4e3473[_0xfa67('0x56')](_0x425088);}})['then'](function(_0x37e0c6){if(_0x37e0c6){_0x1d45d3=_0x37e0c6[_0xfa67('0x3c')];if(!_0x48117b[_0xfa67('0x38')]['hasOwnProperty'](_0xfa67('0x57'))){_0x425088['limit']=qs['limit'](_0x48117b[_0xfa67('0x38')][_0xfa67('0x22')]);_0x425088[_0xfa67('0x21')]=qs[_0xfa67('0x21')](_0x48117b[_0xfa67('0x38')]['offset']);}return _0x4e3473['getMembers'](_0x425088);}})['then'](function(_0x54ecc2){if(_0x54ecc2){return _0x54ecc2?{'count':_0x1d45d3,'rows':_0x54ecc2}:null;}})['then'](respondWithResult(_0x39879f,null))[_0xfa67('0x49')](handleError(_0x39879f,null));};exports[_0xfa67('0x58')]=function(_0x588a6d,_0x19039f,_0x408bee){return db[_0xfa67('0x31')][_0xfa67('0x4b')]({'where':{'id':_0x588a6d[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x19039f,null))[_0xfa67('0x2a')](function(_0x6caae9){if(_0x6caae9){return _0x6caae9[_0xfa67('0x58')](_0x588a6d['query'][_0xfa67('0x59')]);}})[_0xfa67('0x2a')](respondWithStatusCode(_0x19039f,null))['catch'](handleError(_0x19039f,null));};exports['addMessage']=function(_0x360092,_0x9afcd7,_0x355b34){if(_0x360092[_0xfa67('0x4d')]['id']){delete _0x360092[_0xfa67('0x4d')]['id'];}return db['ChatGroup'][_0xfa67('0x4b')]({'where':{'id':_0x360092[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x9afcd7,null))[_0xfa67('0x2a')](function(_0x4f99e5){if(_0x4f99e5){_0x360092[_0xfa67('0x4d')][_0xfa67('0x5a')]=_0x4f99e5['id'];return db[_0xfa67('0x4f')]['create'](_0x360092[_0xfa67('0x4d')]);}})[_0xfa67('0x2a')](respondWithResult(_0x9afcd7,null))[_0xfa67('0x49')](handleError(_0x9afcd7,null));};exports[_0xfa67('0x5b')]=function(_0x1801b5,_0x342fbb,_0x23917a){var _0x530dee={};var _0x3f2b01={};var _0x225e1b;var _0x3451fc;return db['ChatGroup'][_0xfa67('0x52')]({'where':{'id':_0x1801b5[_0xfa67('0x4a')]['id']}})[_0xfa67('0x2a')](handleEntityNotFound(_0x342fbb,null))[_0xfa67('0x2a')](function(_0x44f067){if(_0x44f067){_0x225e1b=_0x44f067;_0x3f2b01[_0xfa67('0x36')]=_['keys'](db['ChatInternalMessage'][_0xfa67('0x32')]);_0x3f2b01[_0xfa67('0x38')]=_[_0xfa67('0x37')](_0x1801b5[_0xfa67('0x38')]);_0x3f2b01[_0xfa67('0x3f')]=_[_0xfa67('0x39')](_0x3f2b01[_0xfa67('0x36')],_0x3f2b01[_0xfa67('0x38')]);_0x530dee[_0xfa67('0x3a')]=_['intersection'](_0x3f2b01[_0xfa67('0x36')],qs[_0xfa67('0x3b')](_0x1801b5[_0xfa67('0x38')][_0xfa67('0x3b')]));_0x530dee[_0xfa67('0x3a')]=_0x530dee[_0xfa67('0x3a')][_0xfa67('0x3c')]?_0x530dee['attributes']:_0x3f2b01['model'];_0x530dee[_0xfa67('0x54')]=qs['sort'](_0x1801b5[_0xfa67('0x38')][_0xfa67('0x3e')]);_0x530dee[_0xfa67('0x42')]=qs[_0xfa67('0x3f')](_[_0xfa67('0x40')](_0x1801b5['query'],_0x3f2b01[_0xfa67('0x3f')]));if(_0x1801b5[_0xfa67('0x38')][_0xfa67('0x55')]){_0x530dee['where']=_['merge'](_0x530dee[_0xfa67('0x42')],{'$or':_['map'](_0x530dee[_0xfa67('0x3a')],function(_0x15150b){var _0x165c78={};_0x165c78[_0x15150b]={'$like':'%'+_0x1801b5[_0xfa67('0x38')][_0xfa67('0x55')]+'%'};return _0x165c78;})});}if(_0x1801b5[_0xfa67('0x38')]['$gte']){var _0x172ef0=_0x1801b5[_0xfa67('0x38')][_0xfa67('0x5c')][_0xfa67('0x5d')](',');var _0x1a5c3c={};_0x1a5c3c[_0x172ef0[0x0]]={'$gte':moment(_0x172ef0[0x1])[_0xfa67('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x530dee[_0xfa67('0x42')]=_[_0xfa67('0x41')](_0x530dee['where'],_0x1a5c3c);}_0x530dee=_[_0xfa67('0x41')]({},_0x530dee,_0x1801b5[_0xfa67('0x44')]);return _0x225e1b[_0xfa67('0x5b')](_0x530dee);}})[_0xfa67('0x2a')](function(_0x403ba1){if(_0x403ba1){_0x3451fc=_0x403ba1[_0xfa67('0x3c')];if(!_0x1801b5[_0xfa67('0x38')][_0xfa67('0x3d')](_0xfa67('0x57'))){_0x530dee[_0xfa67('0x22')]=qs[_0xfa67('0x22')](_0x1801b5['query'][_0xfa67('0x22')]);_0x530dee[_0xfa67('0x21')]=qs[_0xfa67('0x21')](_0x1801b5[_0xfa67('0x38')][_0xfa67('0x21')]);}return _0x225e1b[_0xfa67('0x5b')](_0x530dee);}})[_0xfa67('0x2a')](function(_0x342df7){if(_0x342df7){return _0x342df7?{'count':_0x3451fc,'rows':_0x342df7}:null;}})[_0xfa67('0x2a')](respondWithResult(_0x342fbb,null))[_0xfa67('0x49')](handleError(_0x342fbb,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index cf61ee8..103cd5a 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 _0x078f=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','save','update','remove'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x078f,0x1b4));var _0xf078=function(_0x311c4d,_0xd99948){_0x311c4d=_0x311c4d-0x0;var _0x2677ce=_0x078f[_0x311c4d];return _0x2677ce;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xf078('0x0'))['db'][_0xf078('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf078('0x2'),'afterUpdate':_0xf078('0x3'),'afterDestroy':_0xf078('0x4')};function emitEvent(_0x1b4e81){return function(_0x5da705,_0x288c1a,_0x203e73){ChatGroupEvents[_0xf078('0x5')](_0x1b4e81+':'+_0x5da705['id'],_0x5da705);ChatGroupEvents[_0xf078('0x5')](_0x1b4e81,_0x5da705);_0x203e73(null);};}for(var e in events){if(events[_0xf078('0x6')](e)){var event=events[e];ChatGroup[_0xf078('0x7')](e,emitEvent(event));}}module[_0xf078('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x3588=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x294fe1,_0x9e5abf){var _0x79432d=function(_0x38d6ee){while(--_0x38d6ee){_0x294fe1['push'](_0x294fe1['shift']());}};_0x79432d(++_0x9e5abf);}(_0x3588,0x82));var _0x8358=function(_0x95b585,_0x282d1b){_0x95b585=_0x95b585-0x0;var _0x4c3d88=_0x3588[_0x95b585];return _0x4c3d88;};'use strict';var EventEmitter=require(_0x8358('0x0'));var ChatGroup=require(_0x8358('0x1'))['db'][_0x8358('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8358('0x3')](0x0);var events={'afterCreate':_0x8358('0x4'),'afterUpdate':_0x8358('0x5'),'afterDestroy':_0x8358('0x6')};function emitEvent(_0x586dd2){return function(_0x3fd803,_0xa7a3d4,_0x146ed6){ChatGroupEvents[_0x8358('0x7')](_0x586dd2+':'+_0x3fd803['id'],_0x3fd803);ChatGroupEvents['emit'](_0x586dd2,_0x3fd803);_0x146ed6(null);};}for(var e in events){if(events[_0x8358('0x8')](e)){var event=events[e];ChatGroup[_0x8358('0x9')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 06689f3..cf81c49 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 _0x70da=['request-promise','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','api','bluebird'];(function(_0x319e63,_0x14449b){var _0x3d1626=function(_0x5dce6a){while(--_0x5dce6a){_0x319e63['push'](_0x319e63['shift']());}};_0x3d1626(++_0x14449b);}(_0x70da,0x16e));var _0xa70d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x70da[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xa70d('0x0'));var util=require(_0xa70d('0x1'));var logger=require('../../config/logger')(_0xa70d('0x2'));var moment=require('moment');var BPromise=require(_0xa70d('0x3'));var rp=require(_0xa70d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa70d('0x5'));var config=require('../../config/environment');var attributes=require(_0xa70d('0x6'));module[_0xa70d('0x7')]=function(_0x37d7a4,_0x577d8b){return _0x37d7a4[_0xa70d('0x8')](_0xa70d('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3bf4=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x276fae,_0x1424c1){var _0x132c7e=function(_0x4bf08a){while(--_0x4bf08a){_0x276fae['push'](_0x276fae['shift']());}};_0x132c7e(++_0x1424c1);}(_0x3bf4,0x155));var _0x43bf=function(_0x95d377,_0x3b6143){_0x95d377=_0x95d377-0x0;var _0x4d7405=_0x3bf4[_0x95d377];return _0x4d7405;};'use strict';var _=require(_0x43bf('0x0'));var util=require(_0x43bf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x43bf('0x2'));var BPromise=require('bluebird');var rp=require(_0x43bf('0x3'));var fs=require('fs');var path=require(_0x43bf('0x4'));var rimraf=require(_0x43bf('0x5'));var config=require(_0x43bf('0x6'));var attributes=require(_0x43bf('0x7'));module[_0x43bf('0x8')]=function(_0x5ace7c,_0x35d83e){return _0x5ace7c[_0x43bf('0x9')](_0x43bf('0xa'),attributes,{'tableName':_0x43bf('0xb'),'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 6ae2561..0b8563a 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 _0xbe2a=['defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','request\x20sent','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x205426,_0x1d4d5c){var _0x596b9c=function(_0xcf2c4d){while(--_0xcf2c4d){_0x205426['push'](_0x205426['shift']());}};_0x596b9c(++_0x1d4d5c);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x112ce9,_0x47b7fd){_0x112ce9=_0x112ce9-0x0;var _0x5af3ee=_0xbe2a[_0x112ce9];return _0x5af3ee;};'use strict';var _=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var moment=require(_0xabe2('0x2'));var BPromise=require(_0xabe2('0x3'));var rs=require(_0xabe2('0x4'));var fs=require('fs');var Redis=require(_0xabe2('0x5'));var db=require(_0xabe2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xabe2('0x7'))('rpc');var config=require(_0xabe2('0x8'));var jayson=require(_0xabe2('0x9'));var client=jayson[_0xabe2('0xa')][_0xabe2('0xb')]({'port':0x232a});config[_0xabe2('0xc')]=_[_0xabe2('0xd')](config['redis'],{'host':_0xabe2('0xe'),'port':0x18eb});var socket=require(_0xabe2('0xf'))(new Redis(config[_0xabe2('0xc')]));require(_0xabe2('0x10'))[_0xabe2('0x11')](socket);function respondWithRpcPromise(_0x1b6319,_0x53a91f,_0x27fbaa){return new BPromise(function(_0x307e01,_0x35ddd1){return client['request'](_0x1b6319,_0x27fbaa)['then'](function(_0x5742c5){logger[_0xabe2('0x12')]('ChatGroup,\x20%s,\x20%s',_0x53a91f,_0xabe2('0x13'));logger[_0xabe2('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x53a91f,'request\x20sent',JSON[_0xabe2('0x15')](_0x5742c5));if(_0x5742c5[_0xabe2('0x16')]){if(_0x5742c5[_0xabe2('0x16')][_0xabe2('0x17')]===0x1f4){logger[_0xabe2('0x16')](_0xabe2('0x18'),_0x53a91f,_0x5742c5[_0xabe2('0x16')][_0xabe2('0x19')]);return _0x35ddd1(_0x5742c5[_0xabe2('0x16')][_0xabe2('0x19')]);}logger['error'](_0xabe2('0x18'),_0x53a91f,_0x5742c5[_0xabe2('0x16')][_0xabe2('0x19')]);return _0x307e01(_0x5742c5['error'][_0xabe2('0x19')]);}else{logger[_0xabe2('0x12')](_0xabe2('0x18'),_0x53a91f,_0xabe2('0x13'));_0x307e01(_0x5742c5['result'][_0xabe2('0x19')]);}})[_0xabe2('0x1a')](function(_0x50a49a){logger[_0xabe2('0x16')](_0xabe2('0x18'),_0x53a91f,_0x50a49a);_0x35ddd1(_0x50a49a);});});}
\ No newline at end of file
+var _0xeb0d=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatGroup.socket','register'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x40bf14,_0x4cdad8){_0x40bf14=_0x40bf14-0x0;var _0x312c6d=_0xeb0d[_0x40bf14];return _0x312c6d;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdeb0('0x1'));var fs=require('fs');var Redis=require(_0xdeb0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdeb0('0x3'));var logger=require(_0xdeb0('0x4'))(_0xdeb0('0x5'));var config=require(_0xdeb0('0x6'));var jayson=require(_0xdeb0('0x7'));var client=jayson[_0xdeb0('0x8')][_0xdeb0('0x9')]({'port':0x232a});config[_0xdeb0('0xa')]=_['defaults'](config[_0xdeb0('0xa')],{'host':_0xdeb0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdeb0('0xa')]));require(_0xdeb0('0xc'))[_0xdeb0('0xd')](socket);function respondWithRpcPromise(_0x307271,_0x13e2c4,_0x43c43e){return new BPromise(function(_0x2eac19,_0x1ac0cf){return client['request'](_0x307271,_0x43c43e)['then'](function(_0x4169b0){logger['info'](_0xdeb0('0xe'),_0x13e2c4,_0xdeb0('0xf'));logger[_0xdeb0('0x10')](_0xdeb0('0x11'),_0x13e2c4,_0xdeb0('0xf'),JSON[_0xdeb0('0x12')](_0x4169b0));if(_0x4169b0[_0xdeb0('0x13')]){if(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x14')]===0x1f4){logger['error'](_0xdeb0('0xe'),_0x13e2c4,_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);return _0x1ac0cf(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);}logger['error'](_0xdeb0('0xe'),_0x13e2c4,_0x4169b0['error'][_0xdeb0('0x15')]);return _0x2eac19(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);}else{logger['info'](_0xdeb0('0xe'),_0x13e2c4,'request\x20sent');_0x2eac19(_0x4169b0[_0xdeb0('0x16')][_0xdeb0('0x15')]);}})[_0xdeb0('0x17')](function(_0x52b34d){logger[_0xdeb0('0x13')]('ChatGroup,\x20%s,\x20%s',_0x13e2c4,_0x52b34d);_0x1ac0cf(_0x52b34d);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index bd56dd4..7a36ad0 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 _0x45c2=['register','length','chatGroup:','remove','update','emit'];(function(_0x17fc05,_0x303972){var _0x58c557=function(_0x1b3816){while(--_0x1b3816){_0x17fc05['push'](_0x17fc05['shift']());}};_0x58c557(++_0x303972);}(_0x45c2,0x111));var _0x245c=function(_0x43c8de,_0x4ac946){_0x43c8de=_0x43c8de-0x0;var _0x17430a=_0x45c2[_0x43c8de];return _0x17430a;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x245c('0x0'),_0x245c('0x1')];function createListener(_0x47384a,_0x5d4ae6){return function(_0x9adba8){_0x5d4ae6[_0x245c('0x2')](_0x47384a,_0x9adba8);};}function removeListener(_0x9cff52,_0x110ba2){return function(){ChatGroupEvents['removeListener'](_0x9cff52,_0x110ba2);};}exports[_0x245c('0x3')]=function(_0x5be884){for(var _0x425bb5=0x0,_0x55bbeb=events[_0x245c('0x4')];_0x425bb5<_0x55bbeb;_0x425bb5++){var _0x5f09db=events[_0x425bb5];var _0x24657c=createListener(_0x245c('0x5')+_0x5f09db,_0x5be884);ChatGroupEvents['on'](_0x5f09db,_0x24657c);}};
\ No newline at end of file
+var _0x3304=['save','remove','register','length','chatGroup:','./chatGroup.events'];(function(_0x239e73,_0x236bd4){var _0x22e419=function(_0x50ec42){while(--_0x50ec42){_0x239e73['push'](_0x239e73['shift']());}};_0x22e419(++_0x236bd4);}(_0x3304,0x1d3));var _0x4330=function(_0x4a4f3e,_0x49950f){_0x4a4f3e=_0x4a4f3e-0x0;var _0x5e38f3=_0x3304[_0x4a4f3e];return _0x5e38f3;};'use strict';var ChatGroupEvents=require(_0x4330('0x0'));var events=[_0x4330('0x1'),_0x4330('0x2'),'update'];function createListener(_0x4b39b8,_0x469cd3){return function(_0x4759ca){_0x469cd3['emit'](_0x4b39b8,_0x4759ca);};}function removeListener(_0x45e4eb,_0x4269bd){return function(){ChatGroupEvents['removeListener'](_0x45e4eb,_0x4269bd);};}exports[_0x4330('0x3')]=function(_0x687853){for(var _0x70ce27=0x0,_0x41173a=events[_0x4330('0x4')];_0x70ce27<_0x41173a;_0x70ce27++){var _0x213702=events[_0x70ce27];var _0x1ac93a=createListener(_0x4330('0x5')+_0x213702,_0x687853);ChatGroupEvents['on'](_0x213702,_0x1ac93a);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 4243eab..385ec1a 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 _0x2f3d=['describe','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','delete','/:id','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0x2f3d,0x1ef));var _0xd2f3=function(_0x548585,_0xb3c573){_0x548585=_0x548585-0x0;var _0x7c573d=_0x2f3d[_0x548585];return _0x7c573d;};'use strict';var multer=require(_0xd2f3('0x0'));var util=require(_0xd2f3('0x1'));var path=require(_0xd2f3('0x2'));var timeout=require(_0xd2f3('0x3'));var express=require(_0xd2f3('0x4'));var router=express[_0xd2f3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd2f3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd2f3('0x7'));var controller=require(_0xd2f3('0x8'));router[_0xd2f3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd2f3('0x9')]('/describe',auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xb')]);router[_0xd2f3('0x9')]('/:id',auth[_0xd2f3('0xa')](),controller['show']);router[_0xd2f3('0x9')](_0xd2f3('0xc'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xd')]);router[_0xd2f3('0x9')](_0xd2f3('0xe'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xf')]);router[_0xd2f3('0x9')](_0xd2f3('0x10'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0x11')]);router[_0xd2f3('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd2f3('0x12')](_0xd2f3('0xe'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0x13')]);router[_0xd2f3('0x12')](_0xd2f3('0x10'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0x14')]);router['put']('/:id',auth[_0xd2f3('0xa')](),controller['update']);router[_0xd2f3('0x15')](_0xd2f3('0x16'),auth['isAuthenticated'](),controller['destroy']);router[_0xd2f3('0x15')]('/:id/members',auth[_0xd2f3('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x62a9=['isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','create','post','addMembers','/:id/messages','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get'];(function(_0x358718,_0x17ffd9){var _0x23d079=function(_0x587e08){while(--_0x587e08){_0x358718['push'](_0x358718['shift']());}};_0x23d079(++_0x17ffd9);}(_0x62a9,0x138));var _0x962a=function(_0x5e3f0f,_0x16c6c7){_0x5e3f0f=_0x5e3f0f-0x0;var _0xbd8d66=_0x62a9[_0x5e3f0f];return _0xbd8d66;};'use strict';var multer=require(_0x962a('0x0'));var util=require(_0x962a('0x1'));var path=require(_0x962a('0x2'));var timeout=require(_0x962a('0x3'));var express=require(_0x962a('0x4'));var router=express[_0x962a('0x5')]();var fs_extra=require(_0x962a('0x6'));var auth=require(_0x962a('0x7'));var interaction=require(_0x962a('0x8'));var config=require(_0x962a('0x9'));var controller=require(_0x962a('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x962a('0xb')]('/describe',auth[_0x962a('0xc')](),controller['describe']);router[_0x962a('0xb')](_0x962a('0xd'),auth[_0x962a('0xc')](),controller[_0x962a('0xe')]);router[_0x962a('0xb')](_0x962a('0xf'),auth[_0x962a('0xc')](),controller[_0x962a('0x10')]);router['get'](_0x962a('0x11'),auth[_0x962a('0xc')](),controller[_0x962a('0x12')]);router[_0x962a('0xb')]('/:id/messages',auth[_0x962a('0xc')](),controller[_0x962a('0x13')]);router['post']('/',auth[_0x962a('0xc')](),controller[_0x962a('0x14')]);router[_0x962a('0x15')](_0x962a('0x11'),auth[_0x962a('0xc')](),controller[_0x962a('0x16')]);router[_0x962a('0x15')](_0x962a('0x17'),auth[_0x962a('0xc')](),controller['addMessage']);router[_0x962a('0x18')]('/:id',auth[_0x962a('0xc')](),controller['update']);router[_0x962a('0x19')](_0x962a('0xd'),auth[_0x962a('0xc')](),controller['destroy']);router[_0x962a('0x19')](_0x962a('0x11'),auth[_0x962a('0xc')](),controller['removeMembers']);module[_0x962a('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 1aa5c86..bc85655 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 _0x1ba2=['sequelize','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE','long','out'];(function(_0x49b7d9,_0x300676){var _0x42835e=function(_0x399247){while(--_0x399247){_0x49b7d9['push'](_0x49b7d9['shift']());}};_0x42835e(++_0x300676);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x21ba('0x0'));module['exports']={'closed':{'type':Sequelize[_0x21ba('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x21ba('0x2')](_0x21ba('0x3'),_0x21ba('0x4')),'defaultValue':_0x21ba('0x3')},'ratingMessage':{'type':Sequelize[_0x21ba('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x21ba('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x21ba('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x21ba('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x21ba('0x6')]},'browserName':{'type':Sequelize[_0x21ba('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x21ba('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x21ba('0x6')]},'deviceVendor':{'type':Sequelize[_0x21ba('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x21ba('0x5')]},'customerIp':{'type':Sequelize[_0x21ba('0x6')]},'formData':{'type':Sequelize[_0x21ba('0x5')](_0x21ba('0x8'))},'read1stAt':{'type':Sequelize[_0x21ba('0x7')]},'lastMsgAt':{'type':Sequelize[_0x21ba('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x21ba('0x2')]('in',_0x21ba('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x21ba('0x6')]},'customerPort':{'type':Sequelize[_0x21ba('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x21ba('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x21ba('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf2a6=['star','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','ENUM','thumb'];(function(_0x2d35a3,_0xdc27d0){var _0x327d35=function(_0x593038){while(--_0x593038){_0x2d35a3['push'](_0x2d35a3['shift']());}};_0x327d35(++_0xdc27d0);}(_0xf2a6,0x13d));var _0x6f2a=function(_0x47665e,_0x4009db){_0x47665e=_0x47665e-0x0;var _0x36318c=_0xf2a6[_0x47665e];return _0x36318c;};'use strict';var Sequelize=require(_0x6f2a('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x6f2a('0x1')]('star',_0x6f2a('0x2')),'defaultValue':_0x6f2a('0x3')},'ratingMessage':{'type':Sequelize[_0x6f2a('0x4')]},'pathTranscript':{'type':Sequelize[_0x6f2a('0x4')]},'mailTranscript':{'type':Sequelize[_0x6f2a('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6f2a('0x6')]},'disposition':{'type':Sequelize[_0x6f2a('0x5')]},'secondDisposition':{'type':Sequelize[_0x6f2a('0x5')]},'thirdDisposition':{'type':Sequelize[_0x6f2a('0x5')]},'note':{'type':Sequelize[_0x6f2a('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x6f2a('0x5')]},'osName':{'type':Sequelize[_0x6f2a('0x5')]},'osVersion':{'type':Sequelize[_0x6f2a('0x5')]},'deviceModel':{'type':Sequelize[_0x6f2a('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x6f2a('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x6f2a('0x5')]},'formData':{'type':Sequelize[_0x6f2a('0x4')](_0x6f2a('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x6f2a('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6f2a('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6f2a('0x5')]},'customerPort':{'type':Sequelize[_0x6f2a('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x6f2a('0x9')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4cb71f4..9e88951 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 _0x3f27=['AbandonInteraction','attachmentUpload','file','originalname','basename','Attachment','attachmentDownload','Unauthorized','attachId','join','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','CmContact','Messages','%s%d','agentAlias','customer','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','ChatMessage','sort','options','findAll','getMyMessages','addTags','setTags','spread','emit','chatInteractionTags:save','server','files','tmp','attachments','firstName','lastName','direction','Owner','get','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createWriteStream','views','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','render','merge','body','agent','interaction','Users','map','fullname','Tags','TagIds','split','talking','unmanaged','abandoned','closed','UserId','waiting','disposition','answered','total','index','ChatInteraction','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_chat_interactions','users','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','search','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','fields','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','groupBy','ChatInteractionId','push','rows','params','rawAttributes','includeAll','include','create','update','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned'];(function(_0x417854,_0x4d921d){var _0x1d73ef=function(_0x44b1a6){while(--_0x44b1a6){_0x417854['push'](_0x417854['shift']());}};_0x1d73ef(++_0x4d921d);}(_0x3f27,0x18b));var _0x73f2=function(_0x5f4523,_0x249874){_0x5f4523=_0x5f4523-0x0;var _0x2e6cee=_0x3f27[_0x5f4523];return _0x2e6cee;};'use strict';var emlformat=require(_0x73f2('0x0'));var rimraf=require(_0x73f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73f2('0x2'));var rp=require(_0x73f2('0x3'));var moment=require(_0x73f2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x73f2('0x5'));var util=require('util');var path=require(_0x73f2('0x6'));var sox=require(_0x73f2('0x7'));var csv=require(_0x73f2('0x8'));var ejs=require(_0x73f2('0x9'));var fs=require('fs');var fs_extra=require(_0x73f2('0xa'));var _=require(_0x73f2('0xb'));var squel=require('squel');var crypto=require(_0x73f2('0xc'));var jsforce=require(_0x73f2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x73f2('0xe'));var Papa=require('papaparse');var Redis=require(_0x73f2('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x73f2('0x10'));var pdf=require(_0x73f2('0x11'));var hardwareService=require(_0x73f2('0x12'));var logger=require('../../config/logger')(_0x73f2('0x13'));var utils=require(_0x73f2('0x14'));var config=require(_0x73f2('0x15'));var licenseUtil=require(_0x73f2('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x73f2('0x17')],{'host':_0x73f2('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73f2('0x17')]));require(_0x73f2('0x19'))[_0x73f2('0x1a')](socket);var jayson=require(_0x73f2('0x1b'));var client=jayson['client'][_0x73f2('0x1c')]({'port':0x232b});var client9004=jayson[_0x73f2('0x1d')][_0x73f2('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x471f7b,_0x569e5a,_0x43bd18,_0x2c3805){return new BPromise(function(_0x57d1b8,_0x1b1bca){var _0xa75624=_0x2c3805||client;return _0xa75624[_0x73f2('0x1e')](_0x471f7b,_0x43bd18)[_0x73f2('0x1f')](function(_0x5132cf){logger[_0x73f2('0x20')](_0x73f2('0x21'),_0x569e5a,_0x73f2('0x22'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x569e5a,_0x73f2('0x22'),JSON[_0x73f2('0x23')](_0x5132cf));if(_0x5132cf[_0x73f2('0x24')]){if(_0x5132cf[_0x73f2('0x24')][_0x73f2('0x25')]===0x1f4){logger[_0x73f2('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x569e5a,_0x5132cf[_0x73f2('0x24')]['message']);return _0x1b1bca(_0x5132cf['error'][_0x73f2('0x26')]);}logger['error'](_0x73f2('0x21'),_0x569e5a,_0x5132cf[_0x73f2('0x24')]['message']);return _0x57d1b8(_0x5132cf[_0x73f2('0x24')]['message']);}else{logger[_0x73f2('0x20')](_0x73f2('0x21'),_0x569e5a,_0x73f2('0x22'));_0x57d1b8(_0x5132cf['result'][_0x73f2('0x26')]);}})[_0x73f2('0x27')](function(_0x3422a1){logger[_0x73f2('0x24')](_0x73f2('0x21'),_0x569e5a,_0x3422a1);_0x1b1bca(_0x3422a1);});});}function respondWithStatusCode(_0x2e438a,_0x3a355a){_0x3a355a=_0x3a355a||0xcc;return function(_0x444ec6){if(_0x444ec6){return _0x2e438a[_0x73f2('0x28')](_0x3a355a);}return _0x2e438a['status'](_0x3a355a)[_0x73f2('0x29')]();};}function respondWithResult(_0x4aee32,_0x355149){_0x355149=_0x355149||0xc8;return function(_0x13ea88){if(_0x13ea88){return _0x4aee32[_0x73f2('0x2a')](_0x355149)[_0x73f2('0x2b')](_0x13ea88);}};}function respondWithFilteredResult(_0x270ccd,_0x4ca88d){return function(_0x66a821){if(_0x66a821){var _0x206fb1=typeof _0x4ca88d['offset']===_0x73f2('0x2c')&&typeof _0x4ca88d[_0x73f2('0x2d')]===_0x73f2('0x2c');var _0x13891a=_0x66a821[_0x73f2('0x2e')];var _0x43a5d0=_0x206fb1?0x0:_0x4ca88d[_0x73f2('0x2f')];var _0x3353aa=_0x206fb1?_0x66a821[_0x73f2('0x2e')]:_0x4ca88d['offset']+_0x4ca88d[_0x73f2('0x2d')];var _0x5799ec;if(_0x3353aa>=_0x13891a){_0x3353aa=_0x13891a;_0x5799ec=0xc8;}else{_0x5799ec=0xce;}_0x270ccd[_0x73f2('0x2a')](_0x5799ec);return _0x270ccd[_0x73f2('0x30')](_0x73f2('0x31'),_0x43a5d0+'-'+_0x3353aa+'/'+_0x13891a)[_0x73f2('0x2b')](_0x66a821);}return null;};}function patchUpdates(_0x2df9e6){return function(_0x3f486a){try{jsonpatch[_0x73f2('0x32')](_0x3f486a,_0x2df9e6,!![]);}catch(_0x3d7a8a){return BPromise[_0x73f2('0x33')](_0x3d7a8a);}return _0x3f486a[_0x73f2('0x34')]();};}function saveUpdates(_0x20b634,_0x66cfa9){return function(_0x462ce3){if(_0x462ce3){return _0x462ce3['update'](_0x20b634)[_0x73f2('0x1f')](function(_0xc4a30){return _0xc4a30;});}return null;};}function removeEntity(_0x103aae,_0x2fd269){return function(_0xb0a8ec){if(_0xb0a8ec){return _0xb0a8ec[_0x73f2('0x35')]()[_0x73f2('0x1f')](function(){_0x103aae[_0x73f2('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x510aff,_0x277af3){return function(_0x128b4a){if(!_0x128b4a){_0x510aff[_0x73f2('0x28')](0x194);}return _0x128b4a;};}function handleError(_0x100559,_0x2e162e){_0x2e162e=_0x2e162e||0x1f4;return function(_0x297ed7){logger[_0x73f2('0x24')](_0x297ed7[_0x73f2('0x36')]);if(_0x297ed7['name']){delete _0x297ed7[_0x73f2('0x37')];}_0x100559['status'](_0x2e162e)[_0x73f2('0x38')](_0x297ed7);};}function getMustacheRender(_0x3a876e,_0x7999b2){return Mustache[_0x73f2('0x39')](_0x3a876e,_[_0x73f2('0x3a')](_0x7999b2[_0x73f2('0x3b')],{'contact':_0x7999b2['contact'],'message':_0x7999b2[_0x73f2('0x26')],'agent':_0x7999b2[_0x73f2('0x3c')],'interaction':_0x7999b2[_0x73f2('0x3d')],'account':_0x7999b2['account']}))||'';}function getInteractionUsers(_0x1a3380,_0x45c2cb){return new BPromise(function(_0x2ab080,_0x453e47){try{if(_0x45c2cb[_0x1a3380['id']]){_0x1a3380[_0x73f2('0x3e')]=_[_0x73f2('0x3f')](_0x45c2cb[_0x1a3380['id']],function(_0x484912){return{'id':_0x484912['id'],'fullname':_0x484912[_0x73f2('0x40')]};});}}catch(_0x5c72d1){_0x453e47(_0x5c72d1);}_0x2ab080(_0x1a3380);});}function getInteractionTags(_0x15fc40,_0x4e93a9){return new BPromise(function(_0x465720,_0x4136bd){try{if(_0x15fc40['TagIds']){_0x15fc40[_0x73f2('0x41')]=[];_0x15fc40[_0x73f2('0x42')][_0x73f2('0x43')](',')['forEach'](function(_0x5e75e2){_0x15fc40[_0x73f2('0x41')]['push'](_0x4e93a9[_0x5e75e2]);});}delete _0x15fc40[_0x73f2('0x42')];}catch(_0x541223){_0x4136bd(_0x541223);}_0x465720(_0x15fc40);});}function updateChatInteraction(_0x2fed76,_0x541977,_0xf80c8a){return new BPromise(function(_0x335409,_0x41667f){return getInteractionUsers(_0x2fed76,_0xf80c8a)[_0x73f2('0x1f')](function(_0x4eb89f){return getInteractionTags(_0x4eb89f,_0x541977);})[_0x73f2('0x1f')](function(_0x346554){return getStateInteraction(_0x346554);})[_0x73f2('0x1f')](function(_0x501ca2){_0x335409(_0x501ca2);})[_0x73f2('0x27')](function(_0x47cd3a){_0x41667f(_0x47cd3a);});});}function getStateInteraction(_0x18cebe){return new BPromise(function(_0x5dcc3f){_0x18cebe['waiting']=0x0;_0x18cebe[_0x73f2('0x44')]=0x0;_0x18cebe['answered']=0x0;_0x18cebe[_0x73f2('0x45')]=0x0;_0x18cebe[_0x73f2('0x46')]=0x0;_0x18cebe['total']=0x0;if(!_0x18cebe[_0x73f2('0x47')]&&!_0x18cebe[_0x73f2('0x48')]){_0x18cebe[_0x73f2('0x49')]+=0x1;}if(!_0x18cebe['closed']&&_0x18cebe[_0x73f2('0x48')]){_0x18cebe[_0x73f2('0x44')]+=0x1;if(_0x18cebe[_0x73f2('0x49')]){_0x18cebe[_0x73f2('0x49')]-=0x1;}}if(_0x18cebe[_0x73f2('0x47')]&&_0x18cebe['disposition']===_0x73f2('0x46')){_0x18cebe[_0x73f2('0x46')]+=0x1;if(_0x18cebe[_0x73f2('0x49')]){_0x18cebe['waiting']-=0x1;}}else if(_0x18cebe[_0x73f2('0x47')]&&!_0x18cebe[_0x73f2('0x48')]&&_0x18cebe[_0x73f2('0x4a')]){_0x18cebe[_0x73f2('0x45')]+=0x1;if(_0x18cebe['waiting']){_0x18cebe[_0x73f2('0x49')]-=0x1;}}else if(_0x18cebe[_0x73f2('0x47')]&&_0x18cebe[_0x73f2('0x48')]){_0x18cebe[_0x73f2('0x4b')]+=0x1;if(_0x18cebe['talking']){_0x18cebe[_0x73f2('0x44')]-=0x1;}}_0x18cebe[_0x73f2('0x4c')]+=0x1;_0x5dcc3f(_0x18cebe);});}exports[_0x73f2('0x4d')]=function(_0x15a5a8,_0x2b2dcc){var _0x551be1={},_0x48873d={},_0x5c8127={'count':0x0,'rows':[]};var _0x4d1b31=_['map'](db[_0x73f2('0x4e')]['rawAttributes'],function(_0x2e40e7){return{'name':_0x2e40e7['fieldName'],'type':_0x2e40e7[_0x73f2('0x4f')][_0x73f2('0x50')]};});_0x48873d['model']=_[_0x73f2('0x3f')](_0x4d1b31,_0x73f2('0x37'));_0x48873d['query']=_[_0x73f2('0x51')](_0x15a5a8[_0x73f2('0x52')]);_0x48873d[_0x73f2('0x53')]=_[_0x73f2('0x54')](_0x48873d[_0x73f2('0x55')],_0x48873d[_0x73f2('0x52')]);_0x551be1[_0x73f2('0x56')]=_[_0x73f2('0x54')](_0x48873d[_0x73f2('0x55')],qs['fields'](_0x15a5a8[_0x73f2('0x52')]['fields']));_0x551be1[_0x73f2('0x56')]=_0x551be1[_0x73f2('0x56')][_0x73f2('0x57')]?_0x551be1['attributes']:_0x48873d['model'];if(!_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x58')](_0x73f2('0x59'))){_0x551be1['limit']=qs['limit'](_0x15a5a8['query']['limit']);_0x551be1[_0x73f2('0x2f')]=qs[_0x73f2('0x2f')](_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x2f')]);}_0x551be1[_0x73f2('0x5a')]=qs['sort'](_0x15a5a8[_0x73f2('0x52')]['sort']);_0x551be1[_0x73f2('0x5b')]=qs[_0x73f2('0x53')](_[_0x73f2('0x5c')](_0x15a5a8[_0x73f2('0x52')],_0x48873d[_0x73f2('0x53')]),_0x4d1b31);var _0x45c18f=[];var _0xa17cc3=squel[_0x73f2('0x5d')]()[_0x73f2('0x5e')]('id')[_0x73f2('0x5e')](_0x73f2('0x37'))[_0x73f2('0x5e')](_0x73f2('0x5f'))[_0x73f2('0x60')](_0x73f2('0x61'));var _0x15bd4e=squel[_0x73f2('0x5d')]()['field'](_0x73f2('0x62'))[_0x73f2('0x5e')](_0x73f2('0x63'))['field']('ui.ChatInteractionId')[_0x73f2('0x60')](_0x73f2('0x64'),'ui')['left_join'](_0x73f2('0x65'),'u','u.id\x20=\x20ui.UserId');var _0x5903da=squel[_0x73f2('0x5d')]()[_0x73f2('0x60')](_0x73f2('0x66'),'i')[_0x73f2('0x67')](_0x73f2('0x68'),'c',_0x73f2('0x69'))['left_join'](_0x73f2('0x65'),'o',_0x73f2('0x6a'))['left_join'](_0x73f2('0x6b'),'a',_0x73f2('0x6c'))[_0x73f2('0x67')](_0x73f2('0x6d'),'me',_0x73f2('0x6e'))[_0x73f2('0x67')]('chat_interaction_has_tags','it',_0x73f2('0x6f'))[_0x73f2('0x67')](_0x73f2('0x61'),'t','t.id\x20=\x20it.TagId');var _0x418481=squel['expr']();var _0x191d72=[];var _0x1e21c5=squel[_0x73f2('0x70')]();var _0x39f6fe;if(_0x15a5a8['query'][_0x73f2('0x71')]){_0x39f6fe=as['parseSearch'](_0x15a5a8[_0x73f2('0x52')]['search']);var _0x5266b2=_0x39f6fe['sqlOperator'];for(var _0x5aa3ef=0x0;_0x5aa3ef<_0x39f6fe[_0x73f2('0x72')][_0x73f2('0x57')];_0x5aa3ef++){var _0x7a0791=_0x39f6fe[_0x73f2('0x72')][_0x5aa3ef];var _0x1f17e7='i';var _0x2bbbb6=_[_0x73f2('0x73')](_0x4d1b31,[_0x73f2('0x37'),_0x7a0791[_0x73f2('0x5e')]]);if(!_0x2bbbb6){switch(_0x7a0791[_0x73f2('0x5e')]){case'unreadMessages':if(_0x7a0791[_0x73f2('0x74')]==0x1){_0x5903da[_0x73f2('0x75')]('`'+_0x7a0791[_0x73f2('0x5e')]+_0x73f2('0x76'));}else{_0x5903da[_0x73f2('0x75')]('`'+_0x7a0791['field']+_0x73f2('0x77'));}break;case _0x73f2('0x78'):if(_0x7a0791[_0x73f2('0x79')]===_0x73f2('0x7a')){if(_0x7a0791[_0x73f2('0x74')]['split']('\x20')[_0x73f2('0x57')]>0x1){_0x418481[_0x5266b2](_0x73f2('0x7b'),qs['getFullTextValue'](_0x7a0791[_0x73f2('0x74')]),null);}else{var _0x1c2ae9='%'+_0x7a0791[_0x73f2('0x74')]+'%';_0x418481[_0x5266b2](_0x73f2('0x7c'),_0x1c2ae9,_0x1c2ae9,_0x1c2ae9);}}else{_0x2bbbb6=_[_0x73f2('0x73')](_0x4d1b31,[_0x73f2('0x37'),_0x73f2('0x7d')]);_0x7a0791[_0x73f2('0x5e')]=_0x73f2('0x7d');_0xf5d9c6=as[_0x73f2('0x7e')](_0x1f17e7,_0x2bbbb6[_0x73f2('0x4f')],_0x7a0791);_0x418481[_0x5266b2](_0xf5d9c6[_0x73f2('0x7f')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x80')],_0xf5d9c6['value'][_0x73f2('0x29')]);}break;case _0x73f2('0x81'):var _0x5a97d8=_0x7a0791[_0x73f2('0x74')]['split'](',')[_0x73f2('0x3f')](function(_0x1a07ce){return Number(_0x1a07ce);});_0x5a97d8[_0x73f2('0x82')](function(_0x40e4e5){_0x1e21c5['or'](_0x73f2('0x83'),'%,'+_0x40e4e5+',%');});_0x191d72=_['union'](_0x191d72,_0x5a97d8);break;case _0x73f2('0x84'):if(_0x7a0791[_0x73f2('0x79')]==='$substring'){_0x418481[_0x5266b2](_0x73f2('0x85'),'%'+_0x7a0791[_0x73f2('0x74')]+'%',null);}else{_0x2bbbb6=_[_0x73f2('0x73')](_0x4d1b31,[_0x73f2('0x37'),_0x73f2('0x48')]);_0x7a0791[_0x73f2('0x5e')]='UserId';_0xf5d9c6=as[_0x73f2('0x7e')](_0x1f17e7,_0x2bbbb6[_0x73f2('0x4f')],_0x7a0791);_0x418481[_0x5266b2](_0xf5d9c6[_0x73f2('0x7f')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x80')],_0xf5d9c6['value'][_0x73f2('0x29')]);}break;case _0x73f2('0x3b'):_0xf5d9c6=as['buildExpression']('me',null,_0x7a0791);_0x418481[_0x5266b2](_0xf5d9c6[_0x73f2('0x7f')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x80')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x29')]);break;}}else{var _0xf5d9c6=as[_0x73f2('0x7e')](_0x1f17e7,_0x2bbbb6[_0x73f2('0x4f')],_0x7a0791);_0x418481[_0x5266b2](_0xf5d9c6[_0x73f2('0x7f')],_0xf5d9c6[_0x73f2('0x74')][_0x73f2('0x80')],_0xf5d9c6[_0x73f2('0x74')]['end']);}}}else{var _0x57da5b=_(_0x15a5a8[_0x73f2('0x52')])[_0x73f2('0x51')]()[_0x73f2('0x3f')](function(_0x2d9273){return _[_0x73f2('0x86')](_0x4d1b31,[_0x73f2('0x37'),_0x2d9273])?_0x2d9273:undefined;})[_0x73f2('0x87')]()['value']();if(!_[_0x73f2('0x88')](_0x57da5b)){_0x57da5b[_0x73f2('0x82')](function(_0x2258fe){if(_0x2258fe===_0x73f2('0x89')){_0x5903da[_0x73f2('0x5b')](_0x73f2('0x8a'),[][_0x73f2('0x8b')](_0x15a5a8[_0x73f2('0x52')][_0x2258fe]));}else if(_0x2258fe===_0x73f2('0x8c')){var _0x130579=JSON[_0x73f2('0x8d')](_0x15a5a8[_0x73f2('0x52')][_0x2258fe])[_0x73f2('0x8e')];var _0x393aad=JSON[_0x73f2('0x8d')](_0x15a5a8[_0x73f2('0x52')][_0x2258fe])['$lte'];_0x5903da[_0x73f2('0x5b')](_0x73f2('0x8f'),_0x130579,_0x393aad);}else{if(_0x15a5a8[_0x73f2('0x52')][_0x2258fe]==='null'){_0x5903da['where']('i.'+_0x2258fe+'\x20IS\x20NULL');}else{_0x5903da[_0x73f2('0x5b')]('i.'+_0x2258fe+_0x73f2('0x90'),_0x15a5a8[_0x73f2('0x52')][_0x2258fe]);}}});}if(_0x15a5a8[_0x73f2('0x52')]['read']){if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x91')]==0x1){_0x5903da[_0x73f2('0x75')](_0x73f2('0x92'));}else{_0x5903da[_0x73f2('0x75')](_0x73f2('0x93'));}}if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x94')]){_0x191d72=_[_0x73f2('0x95')](_0x15a5a8['query']['tag'])?_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x94')]:new Array(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x94')]);_0x191d72[_0x73f2('0x82')](function(_0xb3ad22){_0x1e21c5['or'](_0x73f2('0x83'),'%,'+_0xb3ad22+',%');});}if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x96')]){var _0x46a2ad=_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x96')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x46a2ad)){_0x418481['or'](_0x73f2('0x97'),_0x46a2ad+'%');}else{_0x418481['or'](_0x73f2('0x98'),qs['getFullTextValue'](_0x46a2ad))['or'](_0x73f2('0x99'),_0x46a2ad+'%');}}}_0x5903da[_0x73f2('0x5b')](_0x418481);_0x5903da['group'](_0x73f2('0x9a'));var _0x12d4db={'type':db['Sequelize'][_0x73f2('0x9b')][_0x73f2('0x9c')],'raw':!![]};var _0x5e7254=_0x5903da[_0x73f2('0x9d')]();_0x5e7254[_0x73f2('0x5e')](_0x73f2('0x9a'));_0x5e7254[_0x73f2('0x5e')](_0x73f2('0x9e'),_0x73f2('0x9f'));if(_0x551be1[_0x73f2('0x5a')]){_0x551be1[_0x73f2('0x5a')][_0x73f2('0x82')](function(_0xbec1d2){var _0x3c34fa=_0xbec1d2[0x0]===_0x73f2('0xa0')?_0xbec1d2[0x0]:'i.'+_0xbec1d2[0x0];_0x5903da[_0x73f2('0x5a')](_0x3c34fa,_0xbec1d2[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x191d72)){_0x5903da['having'](_0x1e21c5);_0x5e7254[_0x73f2('0x5b')](_0x73f2('0xa1'),_0x191d72);}BPromise['resolve']()[_0x73f2('0x1f')](function(){if(!_0x39f6fe){if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x89')])return;_0x5e7254[_0x73f2('0x5b')](_0x73f2('0xa2'));_0x5903da[_0x73f2('0x5b')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x15a5a8[_0x73f2('0xa3')][_0x73f2('0xa4')]!==_0x73f2('0x3c'))return;return _0x15a5a8['user'][_0x73f2('0xa5')]({'attributes':['id'],'raw':!![]})[_0x73f2('0x1f')](function(_0x31a9c8){if(_[_0x73f2('0x88')](_0x31a9c8)){_0x5e7254[_0x73f2('0x5b')](_0x73f2('0xa6'));_0x5903da['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x5e7254[_0x73f2('0x5b')](_0x73f2('0x8a'),_[_0x73f2('0x3f')](_0x31a9c8,'id'));_0x5903da[_0x73f2('0x5b')]('i.ChatWebsiteId\x20IN\x20?',_[_0x73f2('0x3f')](_0x31a9c8,'id'));}});})[_0x73f2('0x1f')](function(){if(_0x15a5a8[_0x73f2('0xa3')][_0x73f2('0xa4')]===_0x73f2('0x3c')&&!_0x39f6fe&&!_0x15a5a8[_0x73f2('0x52')][_0x73f2('0x89')])return[];return db['sequelize'][_0x73f2('0x52')](_0x5e7254[_0x73f2('0xa7')](),_0x12d4db);})[_0x73f2('0x1f')](function(_0x4520e8){_0x5c8127[_0x73f2('0x2e')]=_0x4520e8[_0x73f2('0x57')];if(_0x5c8127['count']===0x0)return[];return db[_0x73f2('0xa8')]['query'](_0xa17cc3[_0x73f2('0xa7')](),_0x12d4db)[_0x73f2('0x1f')](function(_0xf24cac){_0x45c18f=_[_0x73f2('0xa9')](_0xf24cac,'id');_0x12d4db=_[_0x73f2('0x3a')](_0x12d4db,{'model':db[_0x73f2('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15a5a8[_0x73f2('0x52')][_0x73f2('0xaa')]){_0x551be1['attributes'][_0x73f2('0x82')](function(_0x17461f){_0x5903da[_0x73f2('0x5e')]('i.'+_0x17461f);});}else{_0x5903da[_0x73f2('0x5e')](_0x73f2('0x9e'),_0x73f2('0x9f'));_0x5903da[_0x73f2('0x5e')]('a.key',_0x73f2('0xab'));_0x5903da['field'](_0x73f2('0xac'),_0x73f2('0xad'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xae'),_0x73f2('0xa0'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xaf'));_0x5903da['field']('c.firstName',_0x73f2('0xb0'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xb1'),_0x73f2('0xb2'));_0x5903da[_0x73f2('0x5e')]('c.email',_0x73f2('0xb3'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xb4'),_0x73f2('0xb5'));_0x5903da[_0x73f2('0x5e')]('c.mobile',_0x73f2('0xb6'));_0x5903da['field'](_0x73f2('0xb7'),_0x73f2('0xb8'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xb9'),_0x73f2('0xba'));_0x5903da[_0x73f2('0x5e')](_0x73f2('0xbb'),'Owner.internal');_0x5903da[_0x73f2('0x5e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x73f2('0x42'));}if(_0x551be1[_0x73f2('0x2d')])_0x5903da['limit'](_0x551be1[_0x73f2('0x2d')]);if(_0x551be1[_0x73f2('0x2f')])_0x5903da[_0x73f2('0x2f')](_0x551be1['offset']);return db[_0x73f2('0xa8')][_0x73f2('0x52')](_0x5903da[_0x73f2('0xa7')](),_0x12d4db);})[_0x73f2('0x1f')](function(_0x133bd9){if(_0x133bd9[_0x73f2('0x57')]>0x0)_0x15bd4e[_0x73f2('0x5b')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x133bd9,'id'));return db[_0x73f2('0xa8')][_0x73f2('0x52')](_0x15bd4e['toString'](),_0x12d4db)[_0x73f2('0x1f')](function(_0x551e92){var _0x36ac29=_[_0x73f2('0xbc')](_0x551e92,_0x73f2('0xbd'));var _0x48dfc5=[];_0x133bd9[_0x73f2('0x82')](function(_0x3da6bc){_0x48dfc5[_0x73f2('0xbe')](updateChatInteraction(_0x3da6bc,_0x45c18f,_0x36ac29));});return BPromise['all'](_0x48dfc5);});});})['then'](function(_0x5ac7ae){_0x5c8127[_0x73f2('0xbf')]=_0x5ac7ae;return _0x5c8127;})[_0x73f2('0x1f')](respondWithFilteredResult(_0x2b2dcc,_0x551be1))[_0x73f2('0x27')](handleError(_0x2b2dcc,null));};exports['show']=function(_0x881caa,_0x442935){var _0x21f000={'raw':![],'where':{'id':_0x881caa[_0x73f2('0xc0')]['id']}},_0x33f85b={};_0x33f85b['model']=_['keys'](db['ChatInteraction'][_0x73f2('0xc1')]);_0x33f85b[_0x73f2('0x52')]=_[_0x73f2('0x51')](_0x881caa[_0x73f2('0x52')]);_0x33f85b[_0x73f2('0x53')]=_[_0x73f2('0x54')](_0x33f85b[_0x73f2('0x55')],_0x33f85b[_0x73f2('0x52')]);_0x21f000[_0x73f2('0x56')]=_['intersection'](_0x33f85b['model'],qs[_0x73f2('0xaa')](_0x881caa['query'][_0x73f2('0xaa')]));_0x21f000['attributes']=_0x21f000['attributes'][_0x73f2('0x57')]?_0x21f000['attributes']:_0x33f85b['model'];if(_0x881caa[_0x73f2('0x52')][_0x73f2('0xc2')]){_0x21f000[_0x73f2('0xc3')]=[{'all':!![]}];}_0x21f000=_[_0x73f2('0x3a')]({},_0x21f000,_0x881caa['options']);return db[_0x73f2('0x4e')][_0x73f2('0x73')](_0x21f000)['then'](handleEntityNotFound(_0x442935,null))[_0x73f2('0x1f')](respondWithResult(_0x442935,null))[_0x73f2('0x27')](handleError(_0x442935,null));};exports[_0x73f2('0xc4')]=function(_0xbf0ddb,_0x5f25aa){return db['ChatInteraction'][_0x73f2('0xc4')](_0xbf0ddb[_0x73f2('0x3b')],{})[_0x73f2('0x1f')](respondWithResult(_0x5f25aa,0xc9))[_0x73f2('0x27')](handleError(_0x5f25aa,null));};exports[_0x73f2('0xc5')]=function(_0x58abb4,_0x32716f){if(_0x58abb4[_0x73f2('0x3b')]['id']){delete _0x58abb4[_0x73f2('0x3b')]['id'];}return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x58abb4[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x32716f,null))[_0x73f2('0x1f')](saveUpdates(_0x58abb4['body'],null))[_0x73f2('0x1f')](respondWithResult(_0x32716f,null))[_0x73f2('0x27')](handleError(_0x32716f,null));};exports['destroy']=function(_0x5850eb,_0x40d405){return db['ChatInteraction'][_0x73f2('0x73')]({'where':{'id':_0x5850eb[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x40d405,null))['then'](removeEntity(_0x40d405,null))[_0x73f2('0x27')](handleError(_0x40d405,null));};exports[_0x73f2('0xc6')]=function(_0x5367dd,_0x484fd3){return db[_0x73f2('0x4e')][_0x73f2('0xc6')]()[_0x73f2('0x1f')](respondWithResult(_0x484fd3,null))[_0x73f2('0x27')](handleError(_0x484fd3,null));};exports[_0x73f2('0xc7')]=function(_0x11fe65,_0x55d7ce){var _0x108ea1=_0x11fe65[_0x73f2('0xc0')]['id'];var _0x4c50ec;var _0x38e07f;var _0x4df069;return db['ChatInteraction']['findOne']({'where':{'id':_0x108ea1}})[_0x73f2('0x1f')](function(_0x28446d){_0x4c50ec=_0x28446d;return db[_0x73f2('0xc8')][_0x73f2('0xc9')]({'where':{'id':_0x28446d[_0x73f2('0x89')]},'attributes':['id',_0x73f2('0xca'),_0x73f2('0xcb'),_0x73f2('0xcc'),_0x73f2('0xcd'),'vidaooMetadata'],'raw':!![]});})[_0x73f2('0x1f')](function(_0x18dd08){if(_0x18dd08&&_0x18dd08[_0x73f2('0xca')]&&_0x18dd08[_0x73f2('0xcb')]){_0x38e07f=_0x18dd08;var _0x4f1b3d={'interaction':{'id':_0x108ea1},'agent':{'id':_0x11fe65[_0x73f2('0xa3')]['id'],'name':_0x11fe65[_0x73f2('0xa3')][_0x73f2('0x37')],'fullname':_0x11fe65[_0x73f2('0xa3')][_0x73f2('0x40')],'email':_0x11fe65[_0x73f2('0xa3')][_0x73f2('0xce')]},'contact':_0x11fe65[_0x73f2('0x3b')]['contact'],'account':_0x11fe65[_0x73f2('0x3b')][_0x73f2('0xcf')]};var _0x18d222={'rejectUnauthorized':![],'method':_0x73f2('0xd0'),'url':_0x73f2('0xd1'),'headers':{'X-APIKEY':_0x18dd08[_0x73f2('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11fe65[_0x73f2('0xa3')][_0x73f2('0xce')]],'buttons':null,'topic':_0x38e07f[_0x73f2('0xcc')],'note':_[_0x73f2('0xd2')](_0x38e07f['vidaooNote'])?null:getMustacheRender(_0x38e07f[_0x73f2('0xcd')],_0x4f1b3d),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x73f2('0xd2')](_0x38e07f[_0x73f2('0xd3')])){var _0x3a3bbb=getMustacheRender(_0x38e07f[_0x73f2('0xd3')],_0x4f1b3d);var _0x29e3dc=JSON['parse'](_0x3a3bbb);_0x18d222[_0x73f2('0x3b')][_0x73f2('0xd4')]=_0x29e3dc;}}catch(_0x4b06c2){throw new db[(_0x73f2('0xd5'))][(_0x73f2('0xd6'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x18d222);}else{throw new db[(_0x73f2('0xd5'))]['ValidationError'](_0x73f2('0xd7'));}})['then'](function(_0x1562d9){_0x4df069=_0x1562d9;if(_0x4df069['id']){var _0x252150={'body':_0x4df069[_0x73f2('0xd8')],'ChatWebsiteId':_0x38e07f['id'],'ChatInteractionId':_0x4c50ec['id'],'direction':_0x73f2('0xd9'),'UserId':_0x11fe65[_0x73f2('0xa3')]['id']};return db['ChatMessage']['create'](_0x252150,{});}else{throw new db[(_0x73f2('0xd5'))][(_0x73f2('0xd6'))](_0x73f2('0xda'));}})['then'](function(){return _0x4c50ec[_0x73f2('0xdb')]({'vidaooSessionId':_0x4df069['id']});})['then'](respondWithResult(_0x55d7ce,null))['catch'](handleError(_0x55d7ce,null));};exports[_0x73f2('0xdc')]=function(_0x443362,_0x340ba5){if(_0x443362[_0x73f2('0x3b')]['id']){delete _0x443362[_0x73f2('0x3b')]['id'];}return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x443362[_0x73f2('0xc0')]['id']},'include':[{'model':db['CmContact'],'as':_0x73f2('0x78')}]})[_0x73f2('0x1f')](handleEntityNotFound(_0x340ba5,null))['then'](saveUpdates(_0x443362[_0x73f2('0x3b')],null))['then'](respondWithResult(_0x340ba5,null))[_0x73f2('0x27')](handleError(_0x340ba5,null));};exports[_0x73f2('0xdd')]=function(_0x248823,_0x107259,_0x46b458){if(_0x248823[_0x73f2('0x3b')]['id']){delete _0x248823[_0x73f2('0x3b')]['id'];}return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x248823[_0x73f2('0xc0')]['id']}})['then'](function(_0x7e3581){if(!_0x7e3581){logger[_0x73f2('0x24')](_0x73f2('0xde'),_0x73f2('0xdd'),0x194,_0x73f2('0xdf'));_0x107259[_0x73f2('0x28')](0x194);}else{if(_0x7e3581[_0x73f2('0x48')]){throw new db[(_0x73f2('0xd5'))][(_0x73f2('0xd6'))](_0x73f2('0xe0'));}}return _0x7e3581;})[_0x73f2('0x1f')](function(_0x32726f){if(_0x32726f){return _0x32726f['update']({'closed':_0x248823[_0x73f2('0x3b')][_0x73f2('0x47')],'disposition':_0x248823[_0x73f2('0x3b')][_0x73f2('0x4a')]})[_0x73f2('0x1f')](function(_0x44c5cd){return _0x44c5cd;});}})[_0x73f2('0x1f')](function(_0x41b33e){return respondWithRpcPromise(_0x73f2('0xe1'),_0x73f2('0xdd'),_0x248823[_0x73f2('0x3b')],client9004);})[_0x73f2('0x1f')](respondWithResult(_0x107259,null))['catch'](handleError(_0x107259,null));};exports[_0x73f2('0xe2')]=function(_0x736034,_0x33e307,_0x42cd87){_0x736034[_0x73f2('0x3b')]['name']=_0x736034[_0x73f2('0xe3')][_0x73f2('0xe4')];_0x736034[_0x73f2('0x3b')][_0x73f2('0xe5')]=_0x736034[_0x73f2('0xe3')]['filename'];_0x736034[_0x73f2('0x3b')][_0x73f2('0x4f')]=_0x736034[_0x73f2('0xe3')]['mimetype'];return db[_0x73f2('0xe6')][_0x73f2('0xc4')](_0x736034[_0x73f2('0x3b')])[_0x73f2('0x1f')](respondWithResult(_0x33e307,0xc9))['catch'](handleError(_0x33e307,null));};exports[_0x73f2('0xe7')]=function(_0x26cdf3,_0x4cbc74,_0x11f29e){return db[_0x73f2('0x4e')]['findOne']({'where':{'id':_0x26cdf3[_0x73f2('0xc0')]['id']},'raw':!![]})[_0x73f2('0x1f')](handleEntityNotFound(_0x4cbc74,null))[_0x73f2('0x1f')](function(_0x123353){if(_0x123353){if(_0x123353[_0x73f2('0x47')]){return _0x4cbc74[_0x73f2('0x2a')](0x193)[_0x73f2('0x2b')]({'status':0x193,'message':_0x73f2('0xe8')});}return db[_0x73f2('0xe6')]['findOne']({'where':{'id':_0x26cdf3[_0x73f2('0x52')][_0x73f2('0xe9')]},'raw':!![]})[_0x73f2('0x1f')](handleEntityNotFound(_0x4cbc74,null));}})['then'](function(_0x2b679e){if(_0x2b679e){var _0x193f19=_0x2b679e['ChatOfflineMessageId']!==null;var _0x15e34d=path['join'](config['root'],'server/files/attachments/');if(_0x193f19){_0x15e34d=path[_0x73f2('0xea')](_0x15e34d,'offline-chat/');}var _0x3abdc0=path[_0x73f2('0xea')](_0x15e34d,_0x2b679e[_0x73f2('0xe5')]);return _0x4cbc74[_0x73f2('0xeb')](_0x3abdc0);}})['catch'](handleError(_0x4cbc74,null));};exports[_0x73f2('0xec')]=function(_0x239a9f,_0x5a5384){var _0x48288c=null;var _0xf89dad=null;var _0x42d1a0=null;var _0x55b111=null;if(_0x239a9f['body']['id']){delete _0x239a9f[_0x73f2('0x3b')]['id'];}if(_0x239a9f[_0x73f2('0x3b')][_0x73f2('0xed')]){_0x55b111=path[_0x73f2('0xea')](config[_0x73f2('0xee')],_0x73f2('0xef'),util[_0x73f2('0xf0')](_0x73f2('0xf1'),Date['now']()));_0x239a9f['body']['pathTranscript']=_0x55b111;}return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x239a9f['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x73f2('0x84')],'as':_0x73f2('0x84')}]}]})[_0x73f2('0x1f')](handleEntityNotFound(_0x5a5384,null))['then'](saveUpdates(_0x239a9f[_0x73f2('0x3b')],null))[_0x73f2('0x1f')](function(_0xfd0442){if(_0xfd0442){_0x48288c=_0xfd0442;return db[_0x73f2('0xc8')][_0x73f2('0x73')]({'where':{'id':_0x48288c[_0x73f2('0x89')]}});}})[_0x73f2('0x1f')](function(_0xb84dc4){if(_0xb84dc4){_0x42d1a0=_0xb84dc4;return db[_0x73f2('0xf2')][_0x73f2('0x73')]({'where':{'id':_0x48288c['ContactId']}});}})[_0x73f2('0x1f')](function(_0x3f0a04){if(_0x3f0a04){_0xf89dad=_0x3f0a04;if(_0x55b111){var _0x5f1b36=null;for(var _0x54eb41=0x1;_0x54eb41<_0x48288c[_0x73f2('0xf3')][_0x73f2('0x57')];++_0x54eb41){_0x5f1b36=_0x48288c[_0x73f2('0xf3')][_0x54eb41];var _0x1c5764=_0x5f1b36[_0x73f2('0x48')]?util[_0x73f2('0xf0')](_0x73f2('0xf4'),_0x42d1a0[_0x73f2('0xf5')],_0x5f1b36[_0x73f2('0x48')]):'System';var _0xf16069=_0x239a9f[_0x73f2('0x3b')][_0x73f2('0xf6')]||util[_0x73f2('0xf0')](_0x73f2('0xf4'),'Visitor',_0x5f1b36['ContactId']);switch(_0x42d1a0[_0x73f2('0xf7')]){case _0x73f2('0xf8'):_0x1c5764=_0x5f1b36[_0x73f2('0x48')]?util[_0x73f2('0xf0')]('%s%d',_0x42d1a0[_0x73f2('0xf5')],_0x5f1b36[_0x73f2('0x48')]):_0x73f2('0xf9');break;case _0x73f2('0xfa'):_0x1c5764=_0x5f1b36['UserId']?_0x5f1b36[_0x73f2('0x84')][_0x73f2('0xfb')]||_0x5f1b36[_0x73f2('0x84')][_0x73f2('0x40')]:_0x73f2('0xf9');break;case _0x73f2('0xfc'):_0x1c5764=_0x5f1b36['UserId']?_0x5f1b36[_0x73f2('0x84')][_0x73f2('0x40')]:'System';break;default:_0x1c5764=_0x5f1b36[_0x73f2('0x48')]?util['format'](_0x73f2('0xf4'),_0x42d1a0['agentAlias'],_0x5f1b36[_0x73f2('0x48')]):'System';}var _0xecc8ab=util[_0x73f2('0xf0')](_0x73f2('0xfd'),moment(_0x5f1b36[_0x73f2('0x8c')])[_0x73f2('0xf0')]('MM/DD/YYYY\x20HH:mm:ss'),_0x5f1b36['direction']==='in'?_0xf16069:_0x1c5764,_0x5f1b36[_0x73f2('0x3b')]);if(!_0x5f1b36[_0x73f2('0xfe')]){fs[_0x73f2('0xff')](_0x55b111,_0xecc8ab);}}return db['MailAccount'][_0x73f2('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x73f2('0x100')],'as':_0x73f2('0x101'),'raw':!![]}]});}}})[_0x73f2('0x1f')](function(_0x3a0ec2){if(_0x3a0ec2&&_0x3a0ec2[_0x73f2('0x101')]&&_0x239a9f[_0x73f2('0x3b')]){var _0x28e876={'tls':{'rejectUnauthorized':![]}};if(_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0x102')]){_0x28e876[_0x73f2('0x102')]=_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0x102')];}else{_0x28e876[_0x73f2('0x103')]=_0x3a0ec2[_0x73f2('0x101')]['host'];_0x28e876['port']=_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0x104')];_0x28e876[_0x73f2('0x105')]=_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0x105')];}if(_0x3a0ec2['Smtp'][_0x73f2('0x106')]){_0x28e876[_0x73f2('0x107')]={'user':_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0xa3')],'pass':_0x3a0ec2['Smtp'][_0x73f2('0x108')]};}return respondWithRpcPromise(_0x73f2('0x109'),_0x73f2('0x10a'),{'account':_0x28e876,'message':{'from':util[_0x73f2('0xf0')](_0x73f2('0x10b'),_0x3a0ec2[_0x73f2('0x37')],_0x3a0ec2[_0x73f2('0xce')]||_0x3a0ec2[_0x73f2('0x101')][_0x73f2('0xa3')]),'to':_0x239a9f[_0x73f2('0x3b')][_0x73f2('0xed')],'subject':_0x73f2('0x10c'),'text':util['format'](_0x73f2('0x10d'),_0x239a9f[_0x73f2('0x3b')][_0x73f2('0xed')]),'attachments':[{'path':_0x55b111}]}})[_0x73f2('0x1f')](function(){return _0x48288c;})[_0x73f2('0x27')](function(_0x46a69c){console[_0x73f2('0x24')](_0x46a69c);});}else{return _0x48288c;}})['then'](respondWithStatusCode(_0x5a5384,0xc8))['catch'](handleError(_0x5a5384,null));};exports[_0x73f2('0x10e')]=function(_0x1b87bb,_0x5e30ea,_0x29ae80){return db['ChatMessage'][_0x73f2('0x73')]({'where':{'id':_0x1b87bb['params']['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x5e30ea,null))[_0x73f2('0x1f')](function(_0xb94183){if(_0xb94183){return _0xb94183[_0x73f2('0x10e')](_0x1b87bb[_0x73f2('0x3b')]['ids'],_[_0x73f2('0x10f')](_0x1b87bb[_0x73f2('0x3b')],[_0x73f2('0x110'),'id'])||{});}})['then'](respondWithResult(_0x5e30ea,null))[_0x73f2('0x27')](handleError(_0x5e30ea,null));};exports['getMessages']=function(_0xa022bc,_0x2660d2,_0x47cbca){var _0x1e72d7={'raw':![],'where':{}};var _0x92cfb0={};var _0x40cf7e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x73f2('0xc9')]({'where':{'id':_0xa022bc[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x2660d2,null))[_0x73f2('0x1f')](function(_0x383f49){if(_0x383f49){_0x92cfb0[_0x73f2('0x55')]=_['keys'](db[_0x73f2('0x111')][_0x73f2('0xc1')]);_0x92cfb0[_0x73f2('0x52')]=_[_0x73f2('0x51')](_0xa022bc['query']);_0x92cfb0[_0x73f2('0x53')]=_[_0x73f2('0x54')](_0x92cfb0[_0x73f2('0x55')],_0x92cfb0[_0x73f2('0x52')]);_0x1e72d7[_0x73f2('0x56')]=_[_0x73f2('0x54')](_0x92cfb0[_0x73f2('0x55')],qs['fields'](_0xa022bc['query'][_0x73f2('0xaa')]));_0x1e72d7[_0x73f2('0x56')]=_0x1e72d7[_0x73f2('0x56')][_0x73f2('0x57')]?_0x1e72d7['attributes']:_0x92cfb0[_0x73f2('0x55')];if(!_0xa022bc[_0x73f2('0x52')][_0x73f2('0x58')](_0x73f2('0x59'))){_0x1e72d7[_0x73f2('0x2d')]=qs[_0x73f2('0x2d')](_0xa022bc[_0x73f2('0x52')]['limit']);_0x1e72d7[_0x73f2('0x2f')]=qs[_0x73f2('0x2f')](_0xa022bc[_0x73f2('0x52')][_0x73f2('0x2f')]);}_0x1e72d7[_0x73f2('0x5a')]=qs[_0x73f2('0x112')](_0xa022bc[_0x73f2('0x52')]['sort']);_0x1e72d7[_0x73f2('0x5b')]=qs[_0x73f2('0x53')](_[_0x73f2('0x5c')](_0xa022bc[_0x73f2('0x52')],_0x92cfb0[_0x73f2('0x53')]));_0x1e72d7['where'][_0x73f2('0xbd')]=_0x383f49['id'];if(_0xa022bc[_0x73f2('0x52')][_0x73f2('0x96')]){_0x1e72d7['where']=_[_0x73f2('0x3a')](_0x1e72d7['where'],{'$or':_[_0x73f2('0x3f')](_0x1e72d7['attributes'],function(_0x51c5e3){var _0x2bd280={};_0x2bd280[_0x51c5e3]={'$like':'%'+_0xa022bc[_0x73f2('0x52')][_0x73f2('0x96')]+'%'};return _0x2bd280;})});}if(_0xa022bc[_0x73f2('0x52')][_0x73f2('0x8e')]){var _0x3abcab=_0xa022bc[_0x73f2('0x52')][_0x73f2('0x8e')][_0x73f2('0x43')](',');var _0x5a31a2={};_0x5a31a2[_0x3abcab[0x0]]={'$gte':moment(_0x3abcab[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1e72d7[_0x73f2('0x5b')]=_[_0x73f2('0x3a')](_0x1e72d7[_0x73f2('0x5b')],_0x5a31a2);}_0x1e72d7=_[_0x73f2('0x3a')]({},_0x1e72d7,_0xa022bc[_0x73f2('0x113')]);return db[_0x73f2('0x111')][_0x73f2('0x2e')]({'where':_0x1e72d7['where']})[_0x73f2('0x1f')](function(_0x3060ea){_0x40cf7e[_0x73f2('0x2e')]=_0x3060ea;if(_0xa022bc['query'][_0x73f2('0xc2')]){_0x1e72d7[_0x73f2('0xc3')]=[{'all':!![]}];}return db['ChatMessage'][_0x73f2('0x114')](_0x1e72d7);})[_0x73f2('0x1f')](function(_0x2e0c48){_0x40cf7e['rows']=_0x2e0c48;return _0x40cf7e;});}})['then'](respondWithFilteredResult(_0x2660d2,_0x1e72d7))[_0x73f2('0x27')](handleError(_0x2660d2,null));};exports[_0x73f2('0x115')]=function(_0x332969,_0x26e109,_0x258b2a){var _0x1576fc={'where':{}},_0xe74e30={},_0x163add={'count':0x0,'rows':[]};return db[_0x73f2('0x4e')][_0x73f2('0xc9')]({'where':{'id':_0x332969[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x26e109,null))[_0x73f2('0x1f')](function(_0x8b4e17){if(_0x8b4e17){_0xe74e30[_0x73f2('0x55')]=_['keys'](db[_0x73f2('0x111')][_0x73f2('0xc1')]);_0xe74e30[_0x73f2('0x52')]=_[_0x73f2('0x51')](_0x332969[_0x73f2('0x52')]);_0xe74e30['filters']=_[_0x73f2('0x54')](_0xe74e30[_0x73f2('0x55')],_0xe74e30[_0x73f2('0x52')]);_0x1576fc[_0x73f2('0x56')]=_[_0x73f2('0x54')](_0xe74e30[_0x73f2('0x55')],qs['fields'](_0x332969[_0x73f2('0x52')]['fields']));_0x1576fc['attributes']=_0x1576fc['attributes'][_0x73f2('0x57')]?_0x1576fc[_0x73f2('0x56')]:_0xe74e30[_0x73f2('0x55')];if(!_0x332969[_0x73f2('0x52')][_0x73f2('0x58')](_0x73f2('0x59'))){_0x1576fc[_0x73f2('0x2d')]=qs['limit'](_0x332969['query'][_0x73f2('0x2d')]);_0x1576fc['offset']=qs[_0x73f2('0x2f')](_0x332969[_0x73f2('0x52')][_0x73f2('0x2f')]);}_0x1576fc[_0x73f2('0x5a')]=qs[_0x73f2('0x112')](_0x332969[_0x73f2('0x52')][_0x73f2('0x112')]);_0x1576fc[_0x73f2('0x5b')]=qs[_0x73f2('0x53')](_[_0x73f2('0x5c')](_0x332969[_0x73f2('0x52')],_0xe74e30[_0x73f2('0x53')]));_0x1576fc['where']['ChatInteractionId']=_0x8b4e17['id'];if(_0x332969[_0x73f2('0x52')]['filter']){_0x1576fc['where']=_[_0x73f2('0x3a')](_0x1576fc['where'],{'$or':_[_0x73f2('0x3f')](_0x1576fc[_0x73f2('0x56')],function(_0x33bb53){var _0x1afcce={};_0x1afcce[_0x33bb53]={'$like':'%'+_0x332969[_0x73f2('0x52')]['filter']+'%'};return _0x1afcce;})});}_0x1576fc[_0x73f2('0x5b')][_0x73f2('0xfe')]=![];if(_0x332969[_0x73f2('0x52')]['id']){_0x1576fc[_0x73f2('0x5b')]['id']={'$gt':_0x332969[_0x73f2('0x52')]['id']};}_0x1576fc=_[_0x73f2('0x3a')]({},_0x1576fc,_0x332969['options']);return db[_0x73f2('0x111')][_0x73f2('0x2e')]({'where':_0x1576fc[_0x73f2('0x5b')]})[_0x73f2('0x1f')](function(_0x59bdac){_0x163add['count']=_0x59bdac;_0x1576fc[_0x73f2('0xc3')]=[];if(_0x332969['query']['includeAgent']){_0x1576fc[_0x73f2('0xc3')][_0x73f2('0xbe')]({'model':db[_0x73f2('0x84')],'as':_0x73f2('0x84'),'attributes':['id',_0x73f2('0x40'),_0x73f2('0xfb')]});}if(_0x332969[_0x73f2('0x52')]['includeAll']){_0x1576fc[_0x73f2('0xc3')]=[{'all':!![]}];}return db[_0x73f2('0x111')][_0x73f2('0x114')](_0x1576fc);})['then'](function(_0x151baf){_0x163add[_0x73f2('0xbf')]=_0x151baf;return _0x163add;});}})[_0x73f2('0x1f')](respondWithFilteredResult(_0x26e109,_0x1576fc))[_0x73f2('0x27')](handleError(_0x26e109,null));};exports[_0x73f2('0x116')]=function(_0x27c960,_0x41b143,_0x12f555){return db[_0x73f2('0x4e')]['find']({'where':{'id':_0x27c960[_0x73f2('0xc0')]['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x41b143,null))['then'](function(_0x29bd0d){if(_0x29bd0d){return _0x29bd0d[_0x73f2('0x117')](_0x27c960[_0x73f2('0x3b')][_0x73f2('0x110')],_[_0x73f2('0x10f')](_0x27c960[_0x73f2('0x3b')],[_0x73f2('0x110'),'id'])||{})[_0x73f2('0x118')](function(){return db[_0x73f2('0x81')][_0x73f2('0x114')]({'attributes':['id',_0x73f2('0x37'),_0x73f2('0x5f')],'where':{'id':_0x27c960[_0x73f2('0x3b')][_0x73f2('0x110')]}});})[_0x73f2('0x1f')](function(_0x1415bf){socket[_0x73f2('0x119')](_0x73f2('0x11a'),{'id':Number(_0x27c960[_0x73f2('0xc0')]['id']),'tags':_0x1415bf||[]});return{'id':Number(_0x27c960[_0x73f2('0xc0')]['id']),'tags':_0x1415bf||[]};});}})[_0x73f2('0x1f')](respondWithResult(_0x41b143,null))[_0x73f2('0x27')](handleError(_0x41b143,null));};exports['removeTags']=function(_0x49ee11,_0x3472c5,_0x205fcf){return db['ChatInteraction'][_0x73f2('0x73')]({'where':{'id':_0x49ee11['params']['id']}})[_0x73f2('0x1f')](handleEntityNotFound(_0x3472c5,null))[_0x73f2('0x1f')](function(_0x3d55be){if(_0x3d55be){return _0x3d55be['removeTags'](_0x49ee11['query']['ids']);}})[_0x73f2('0x1f')](respondWithStatusCode(_0x3472c5,null))['catch'](handleError(_0x3472c5,null));};exports[_0x73f2('0xeb')]=function(_0x4cc062,_0x48678b){var _0x235710=moment()['unix']()['toString']();var _0x5357ac=path['join'](config[_0x73f2('0xee')],_0x73f2('0x11b'),_0x73f2('0x11c'),_0x73f2('0x11d'));var _0x202617=path['join'](config[_0x73f2('0xee')],_0x73f2('0x11b'),_0x73f2('0x11c'),_0x73f2('0x11e'));var _0x4b05fe=path['join'](_0x5357ac,_0x235710);var _0x52078c=util[_0x73f2('0xf0')]('transcript-%d-%s.zip',_0x4cc062[_0x73f2('0xc0')]['id'],_0x235710);var _0x24b3d5=path[_0x73f2('0xea')](_0x5357ac,_0x52078c);var _0x3abfdd=[];_0x3abfdd[_0x73f2('0xbe')]({'model':db['User'],'as':_0x73f2('0x84'),'attributes':['id','fullname'],'raw':!![]});_0x3abfdd['push']({'model':db[_0x73f2('0xf2')],'as':_0x73f2('0x78'),'attributes':['id',_0x73f2('0x11f'),_0x73f2('0x120')],'raw':!![]});if(_0x4cc062['query'][_0x73f2('0x11e')]){_0x3abfdd['push']({'model':db[_0x73f2('0xe6')],'as':'Attachment','raw':!![]});}var _0x2b857a=[{'model':db[_0x73f2('0x111')],'as':_0x73f2('0xf3'),'attributes':['id','body','createdAt',_0x73f2('0x121'),_0x73f2('0xfe'),_0x73f2('0x91')],'include':_0x3abfdd}];_0x2b857a[_0x73f2('0xbe')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x73f2('0x37')]});_0x2b857a[_0x73f2('0xbe')]({'model':db[_0x73f2('0x84')],'as':_0x73f2('0x122'),'attributes':['id',_0x73f2('0x40')]});return db[_0x73f2('0x4e')][_0x73f2('0x73')]({'where':{'id':_0x4cc062[_0x73f2('0xc0')]['id']},'include':_0x2b857a})[_0x73f2('0x1f')](handleEntityNotFound(_0x48678b,null))[_0x73f2('0x1f')](function(_0x484a6c){if(_0x484a6c){var _0x1d8905=_0x484a6c[_0x73f2('0x123')]({'plain':!![]});fs['mkdirSync'](_0x4b05fe);var _0x38cc72={'channel':_0x73f2('0x124'),'account':_0x1d8905[_0x73f2('0x125')][_0x73f2('0x37')],'agent':_0x1d8905[_0x73f2('0x122')]?_0x1d8905['Owner'][_0x73f2('0x40')]:_0x73f2('0x126'),'createdAt':moment(_0x1d8905[_0x73f2('0x8c')])['format'](_0x73f2('0x127'))[_0x73f2('0xa7')](),'closedAt':_0x1d8905['closed']?moment(_0x1d8905[_0x73f2('0x128')])[_0x73f2('0xf0')](_0x73f2('0x127'))[_0x73f2('0xa7')]():'','disposition':_0x1d8905[_0x73f2('0x4a')],'chatInfo':{'browser':_0x1d8905[_0x73f2('0x129')],'os':_0x1d8905[_0x73f2('0x12a')],'referer':_0x1d8905[_0x73f2('0x12b')],'customerIp':_0x1d8905[_0x73f2('0x12c')],'customerPort':_0x1d8905[_0x73f2('0x12d')]?_0x1d8905[_0x73f2('0x12d')]:_0x73f2('0x126')},'messages':_(_0x1d8905['Messages'])[_0x73f2('0x12e')]()[_0x73f2('0x96')]({'secret':![]})['map'](function(_0x2901a7){if(_0x2901a7['Attachment']){var _0x3a79df=path[_0x73f2('0xea')](_0x202617,_0x2901a7[_0x73f2('0xe6')][_0x73f2('0xe5')]);if(fs['existsSync'](_0x3a79df)){fs['createReadStream'](_0x3a79df)['pipe'](fs[_0x73f2('0x12f')](path[_0x73f2('0xea')](_0x4b05fe,_0x2901a7[_0x73f2('0xe6')][_0x73f2('0xe5')])));}}return{'date':moment(_0x2901a7[_0x73f2('0x8c')])[_0x73f2('0xf0')](_0x73f2('0x127'))[_0x73f2('0xa7')](),'sender':_0x2901a7[_0x73f2('0x121')]===_0x73f2('0xd9')?_0x2901a7[_0x73f2('0x84')]?_0x2901a7[_0x73f2('0x84')]['fullname']:'System':_0x2901a7[_0x73f2('0x78')][_0x73f2('0x11f')]+(_0x2901a7[_0x73f2('0x78')]['lastName']?'\x20'+_0x2901a7['Contact'][_0x73f2('0x120')]:''),'body':_0x2901a7[_0x73f2('0xe6')]?_0x2901a7[_0x73f2('0xe6')][_0x73f2('0xe5')]:_0x2901a7[_0x73f2('0x3b')],'direction':_0x2901a7[_0x73f2('0x121')]==='out'?'A':'C','secret':_0x2901a7['secret'],'read':_0x2901a7[_0x73f2('0x91')],'attachment':_0x2901a7['Attachment']};})[_0x73f2('0x74')]()};return ejs['renderFile'](path['join'](config[_0x73f2('0xee')],'server',_0x73f2('0x130'),'downloadInteraction.ejs'),{'interaction':_0x38cc72})[_0x73f2('0x1f')](function(_0x3f6d64){var _0x357620=path[_0x73f2('0xea')](_0x4b05fe,_0x73f2('0x131')+_0x1d8905['id']+'-'+_0x235710+_0x73f2('0x132'));var _0x5da581={'path':_0x357620,'channel':_0x73f2('0x124'),'interactionId':_0x1d8905['id']};return pdf[_0x73f2('0x133')](_0x3f6d64,_0x5da581);})[_0x73f2('0x1f')](function(){return new BPromise(function(_0x4497b2,_0x230dd3){zipdir(_0x4b05fe,{'saveTo':_0x24b3d5},function(_0x5756ca,_0x3e1867){if(_0x5756ca)return _0x230dd3(_0x5756ca);return _0x4497b2(_0x3e1867);});})[_0x73f2('0x1f')](function(){return new BPromise(function(_0x1711f3,_0x50cd7d){rimraf(_0x4b05fe,function(_0x1b72c7){if(_0x1b72c7)_0x50cd7d(_0x1b72c7);return _0x1711f3();});});})[_0x73f2('0x1f')](function(){return _0x48678b[_0x73f2('0xeb')](_0x24b3d5,_0x52078c,function(_0x29fe63){if(_0x29fe63){console[_0x73f2('0x134')](_0x73f2('0x135'),_0x29fe63);}else{fs['unlinkSync'](_0x24b3d5);}});});});}else{return _0x48678b[_0x73f2('0x28')](0xc8);}})[_0x73f2('0x27')](handleError(_0x48678b,null));};
\ No newline at end of file
+var _0xcbeb=['json','update','destroy','end','name','send','render','merge','body','contact','agent','account','Users','map','TagIds','Tags','split','forEach','waiting','talking','unmanaged','abandoned','total','UserId','closed','disposition','answered','index','ChatInteraction','rawAttributes','fieldName','key','query','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','text','keys','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','tag','isArray','filter','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','includeAll','include','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','download','mailTranscript','root','format','transcript-%s.txt','now','Messages','%s%d','agentAlias','customer','agentIdentifier','website_alias','System','alias','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','omit','YYYY-MM-DD\x20HH:mm:ss','findAll','pick','includeAgent','push','addTags','setTags','ids','spread','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','out','firstName','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x3cf78d,_0x3a467a){var _0x35e8d6=function(_0x24dfe1){while(--_0x24dfe1){_0x3cf78d['push'](_0x3cf78d['shift']());}};_0x35e8d6(++_0x3a467a);}(_0xcbeb,0x107));var _0xbcbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbeb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbcbe('0x0'));var rimraf=require(_0xbcbe('0x1'));var zipdir=require(_0xbcbe('0x2'));var jsonpatch=require(_0xbcbe('0x3'));var rp=require('request-promise');var moment=require(_0xbcbe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbcbe('0x5'));var util=require('util');var path=require(_0xbcbe('0x6'));var sox=require('sox');var csv=require(_0xbcbe('0x7'));var ejs=require(_0xbcbe('0x8'));var fs=require('fs');var fs_extra=require(_0xbcbe('0x9'));var _=require(_0xbcbe('0xa'));var squel=require(_0xbcbe('0xb'));var crypto=require(_0xbcbe('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbcbe('0x7'));var querystring=require(_0xbcbe('0xd'));var Papa=require(_0xbcbe('0xe'));var Redis=require(_0xbcbe('0xf'));var authService=require(_0xbcbe('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbcbe('0x11'));var pdf=require(_0xbcbe('0x12'));var hardwareService=require(_0xbcbe('0x13'));var logger=require(_0xbcbe('0x14'))(_0xbcbe('0x15'));var utils=require(_0xbcbe('0x16'));var config=require(_0xbcbe('0x17'));var licenseUtil=require(_0xbcbe('0x18'));var db=require(_0xbcbe('0x19'))['db'];config[_0xbcbe('0x1a')]=_[_0xbcbe('0x1b')](config[_0xbcbe('0x1a')],{'host':_0xbcbe('0x1c'),'port':0x18eb});var socket=require(_0xbcbe('0x1d'))(new Redis(config[_0xbcbe('0x1a')]));require(_0xbcbe('0x1e'))[_0xbcbe('0x1f')](socket);var jayson=require(_0xbcbe('0x20'));var client=jayson[_0xbcbe('0x21')][_0xbcbe('0x22')]({'port':0x232b});var client9004=jayson[_0xbcbe('0x21')][_0xbcbe('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x26aebb,_0x281197,_0x3e2f24,_0x2c15e3){return new BPromise(function(_0x57b8d5,_0x21321b){var _0x2055fd=_0x2c15e3||client;return _0x2055fd[_0xbcbe('0x23')](_0x26aebb,_0x3e2f24)[_0xbcbe('0x24')](function(_0x2e65b4){logger[_0xbcbe('0x25')](_0xbcbe('0x26'),_0x281197,_0xbcbe('0x27'));logger['debug'](_0xbcbe('0x28'),_0x281197,_0xbcbe('0x27'),JSON[_0xbcbe('0x29')](_0x2e65b4));if(_0x2e65b4[_0xbcbe('0x2a')]){if(_0x2e65b4[_0xbcbe('0x2a')][_0xbcbe('0x2b')]===0x1f4){logger['error'](_0xbcbe('0x26'),_0x281197,_0x2e65b4[_0xbcbe('0x2a')][_0xbcbe('0x2c')]);return _0x21321b(_0x2e65b4['error'][_0xbcbe('0x2c')]);}logger['error'](_0xbcbe('0x26'),_0x281197,_0x2e65b4[_0xbcbe('0x2a')][_0xbcbe('0x2c')]);return _0x57b8d5(_0x2e65b4[_0xbcbe('0x2a')][_0xbcbe('0x2c')]);}else{logger[_0xbcbe('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x281197,_0xbcbe('0x27'));_0x57b8d5(_0x2e65b4[_0xbcbe('0x2d')][_0xbcbe('0x2c')]);}})[_0xbcbe('0x2e')](function(_0x2d1f77){logger[_0xbcbe('0x2a')](_0xbcbe('0x26'),_0x281197,_0x2d1f77);_0x21321b(_0x2d1f77);});});}function respondWithStatusCode(_0x561a8a,_0xa15fe5){_0xa15fe5=_0xa15fe5||0xcc;return function(_0x4a9495){if(_0x4a9495){return _0x561a8a[_0xbcbe('0x2f')](_0xa15fe5);}return _0x561a8a[_0xbcbe('0x30')](_0xa15fe5)['end']();};}function respondWithResult(_0x55a5ec,_0x26a206){_0x26a206=_0x26a206||0xc8;return function(_0x1b5bad){if(_0x1b5bad){return _0x55a5ec[_0xbcbe('0x30')](_0x26a206)['json'](_0x1b5bad);}};}function respondWithFilteredResult(_0xddf77,_0x898b5c){return function(_0x5bf775){if(_0x5bf775){var _0xa5acc9=typeof _0x898b5c[_0xbcbe('0x31')]===_0xbcbe('0x32')&&typeof _0x898b5c[_0xbcbe('0x33')]===_0xbcbe('0x32');var _0x2075c6=_0x5bf775[_0xbcbe('0x34')];var _0x5ed83f=_0xa5acc9?0x0:_0x898b5c['offset'];var _0x28a66c=_0xa5acc9?_0x5bf775[_0xbcbe('0x34')]:_0x898b5c[_0xbcbe('0x31')]+_0x898b5c[_0xbcbe('0x33')];var _0x4fddae;if(_0x28a66c>=_0x2075c6){_0x28a66c=_0x2075c6;_0x4fddae=0xc8;}else{_0x4fddae=0xce;}_0xddf77[_0xbcbe('0x30')](_0x4fddae);return _0xddf77[_0xbcbe('0x35')]('Content-Range',_0x5ed83f+'-'+_0x28a66c+'/'+_0x2075c6)[_0xbcbe('0x36')](_0x5bf775);}return null;};}function patchUpdates(_0x3e388b){return function(_0x54f7fb){try{jsonpatch['apply'](_0x54f7fb,_0x3e388b,!![]);}catch(_0x371363){return BPromise['reject'](_0x371363);}return _0x54f7fb['save']();};}function saveUpdates(_0x491bdc,_0x43beb0){return function(_0x56c513){if(_0x56c513){return _0x56c513[_0xbcbe('0x37')](_0x491bdc)[_0xbcbe('0x24')](function(_0x4bb01a){return _0x4bb01a;});}return null;};}function removeEntity(_0x3f6cff,_0x31fbd5){return function(_0x393182){if(_0x393182){return _0x393182[_0xbcbe('0x38')]()[_0xbcbe('0x24')](function(){_0x3f6cff['status'](0xcc)[_0xbcbe('0x39')]();});}};}function handleEntityNotFound(_0x25793a,_0x4d6b77){return function(_0x4f74fe){if(!_0x4f74fe){_0x25793a['sendStatus'](0x194);}return _0x4f74fe;};}function handleError(_0x33b5b7,_0x59f06b){_0x59f06b=_0x59f06b||0x1f4;return function(_0x35e79d){logger[_0xbcbe('0x2a')](_0x35e79d['stack']);if(_0x35e79d[_0xbcbe('0x3a')]){delete _0x35e79d['name'];}_0x33b5b7[_0xbcbe('0x30')](_0x59f06b)[_0xbcbe('0x3b')](_0x35e79d);};}function getMustacheRender(_0x1661b7,_0xb6d76e){return Mustache[_0xbcbe('0x3c')](_0x1661b7,_[_0xbcbe('0x3d')](_0xb6d76e[_0xbcbe('0x3e')],{'contact':_0xb6d76e[_0xbcbe('0x3f')],'message':_0xb6d76e[_0xbcbe('0x2c')],'agent':_0xb6d76e[_0xbcbe('0x40')],'interaction':_0xb6d76e['interaction'],'account':_0xb6d76e[_0xbcbe('0x41')]}))||'';}function getInteractionUsers(_0x1e7171,_0x4e194c){return new BPromise(function(_0x57ea30,_0x2c9a5c){try{if(_0x4e194c[_0x1e7171['id']]){_0x1e7171[_0xbcbe('0x42')]=_[_0xbcbe('0x43')](_0x4e194c[_0x1e7171['id']],function(_0x397c91){return{'id':_0x397c91['id'],'fullname':_0x397c91['fullname']};});}}catch(_0x3983c8){_0x2c9a5c(_0x3983c8);}_0x57ea30(_0x1e7171);});}function getInteractionTags(_0x212065,_0xb67053){return new BPromise(function(_0x2889ce,_0x24f038){try{if(_0x212065[_0xbcbe('0x44')]){_0x212065[_0xbcbe('0x45')]=[];_0x212065[_0xbcbe('0x44')][_0xbcbe('0x46')](',')[_0xbcbe('0x47')](function(_0x542e3f){_0x212065[_0xbcbe('0x45')]['push'](_0xb67053[_0x542e3f]);});}delete _0x212065[_0xbcbe('0x44')];}catch(_0x1a21da){_0x24f038(_0x1a21da);}_0x2889ce(_0x212065);});}function updateChatInteraction(_0x51601d,_0x44013a,_0x30dbb6){return new BPromise(function(_0x3afc89,_0x1c9d2c){return getInteractionUsers(_0x51601d,_0x30dbb6)[_0xbcbe('0x24')](function(_0x5ae401){return getInteractionTags(_0x5ae401,_0x44013a);})[_0xbcbe('0x24')](function(_0x2c715a){return getStateInteraction(_0x2c715a);})['then'](function(_0x41df68){_0x3afc89(_0x41df68);})['catch'](function(_0x41244e){_0x1c9d2c(_0x41244e);});});}function getStateInteraction(_0x64b7c7){return new BPromise(function(_0x58e33c){_0x64b7c7[_0xbcbe('0x48')]=0x0;_0x64b7c7[_0xbcbe('0x49')]=0x0;_0x64b7c7['answered']=0x0;_0x64b7c7[_0xbcbe('0x4a')]=0x0;_0x64b7c7[_0xbcbe('0x4b')]=0x0;_0x64b7c7[_0xbcbe('0x4c')]=0x0;if(!_0x64b7c7['closed']&&!_0x64b7c7[_0xbcbe('0x4d')]){_0x64b7c7['waiting']+=0x1;}if(!_0x64b7c7[_0xbcbe('0x4e')]&&_0x64b7c7[_0xbcbe('0x4d')]){_0x64b7c7[_0xbcbe('0x49')]+=0x1;if(_0x64b7c7[_0xbcbe('0x48')]){_0x64b7c7['waiting']-=0x1;}}if(_0x64b7c7[_0xbcbe('0x4e')]&&_0x64b7c7[_0xbcbe('0x4f')]===_0xbcbe('0x4b')){_0x64b7c7[_0xbcbe('0x4b')]+=0x1;if(_0x64b7c7[_0xbcbe('0x48')]){_0x64b7c7['waiting']-=0x1;}}else if(_0x64b7c7['closed']&&!_0x64b7c7[_0xbcbe('0x4d')]&&_0x64b7c7[_0xbcbe('0x4f')]){_0x64b7c7[_0xbcbe('0x4a')]+=0x1;if(_0x64b7c7[_0xbcbe('0x48')]){_0x64b7c7[_0xbcbe('0x48')]-=0x1;}}else if(_0x64b7c7[_0xbcbe('0x4e')]&&_0x64b7c7['UserId']){_0x64b7c7[_0xbcbe('0x50')]+=0x1;if(_0x64b7c7[_0xbcbe('0x49')]){_0x64b7c7[_0xbcbe('0x49')]-=0x1;}}_0x64b7c7['total']+=0x1;_0x58e33c(_0x64b7c7);});}exports[_0xbcbe('0x51')]=function(_0x3ecac2,_0x202fd1){var _0x1587b2={},_0x569238={},_0x8f3fe6={'count':0x0,'rows':[]};var _0x2e3250=_[_0xbcbe('0x43')](db[_0xbcbe('0x52')][_0xbcbe('0x53')],function(_0x407293){return{'name':_0x407293[_0xbcbe('0x54')],'type':_0x407293['type'][_0xbcbe('0x55')]};});_0x569238['model']=_['map'](_0x2e3250,_0xbcbe('0x3a'));_0x569238[_0xbcbe('0x56')]=_['keys'](_0x3ecac2[_0xbcbe('0x56')]);_0x569238['filters']=_['intersection'](_0x569238['model'],_0x569238[_0xbcbe('0x56')]);_0x1587b2[_0xbcbe('0x57')]=_[_0xbcbe('0x58')](_0x569238['model'],qs[_0xbcbe('0x59')](_0x3ecac2['query'][_0xbcbe('0x59')]));_0x1587b2[_0xbcbe('0x57')]=_0x1587b2['attributes'][_0xbcbe('0x5a')]?_0x1587b2['attributes']:_0x569238[_0xbcbe('0x5b')];if(!_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x5c')](_0xbcbe('0x5d'))){_0x1587b2['limit']=qs[_0xbcbe('0x33')](_0x3ecac2['query']['limit']);_0x1587b2[_0xbcbe('0x31')]=qs['offset'](_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x31')]);}_0x1587b2[_0xbcbe('0x5e')]=qs['sort'](_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x5f')]);_0x1587b2[_0xbcbe('0x60')]=qs[_0xbcbe('0x61')](_['pick'](_0x3ecac2[_0xbcbe('0x56')],_0x569238[_0xbcbe('0x61')]),_0x2e3250);var _0x3c3bf4=[];var _0x2c65fd=squel[_0xbcbe('0x62')]()['field']('id')[_0xbcbe('0x63')](_0xbcbe('0x3a'))['field'](_0xbcbe('0x64'))[_0xbcbe('0x65')](_0xbcbe('0x66'));var _0x5e1058=squel[_0xbcbe('0x62')]()[_0xbcbe('0x63')](_0xbcbe('0x67'))[_0xbcbe('0x63')](_0xbcbe('0x68'))[_0xbcbe('0x63')](_0xbcbe('0x69'))['from']('user_has_chat_interactions','ui')[_0xbcbe('0x6a')](_0xbcbe('0x6b'),'u',_0xbcbe('0x6c'));var _0x41252f=squel['select']()['from']('chat_interactions','i')[_0xbcbe('0x6a')](_0xbcbe('0x6d'),'c',_0xbcbe('0x6e'))['left_join']('users','o',_0xbcbe('0x6f'))[_0xbcbe('0x6a')]('chat_websites','a',_0xbcbe('0x70'))['left_join'](_0xbcbe('0x71'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xbcbe('0x6a')](_0xbcbe('0x72'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xbcbe('0x6a')](_0xbcbe('0x66'),'t',_0xbcbe('0x73'));var _0x43f428=squel[_0xbcbe('0x74')]();var _0x3e77cf=[];var _0xca5b17=squel[_0xbcbe('0x74')]();var _0x5f3edb;if(_0x3ecac2['query'][_0xbcbe('0x75')]){_0x5f3edb=as[_0xbcbe('0x76')](_0x3ecac2['query']['search']);var _0x1c4e4e=_0x5f3edb[_0xbcbe('0x77')];for(var _0x1fec02=0x0;_0x1fec02<_0x5f3edb[_0xbcbe('0x78')][_0xbcbe('0x5a')];_0x1fec02++){var _0x31e8d5=_0x5f3edb[_0xbcbe('0x78')][_0x1fec02];var _0x27d564='i';var _0x48cb64=_['find'](_0x2e3250,[_0xbcbe('0x3a'),_0x31e8d5['field']]);if(!_0x48cb64){switch(_0x31e8d5[_0xbcbe('0x63')]){case _0xbcbe('0x79'):if(_0x31e8d5['value']==0x1){_0x41252f[_0xbcbe('0x7a')]('`'+_0x31e8d5[_0xbcbe('0x63')]+'`\x20=\x200');}else{_0x41252f[_0xbcbe('0x7a')]('`'+_0x31e8d5['field']+'`\x20>\x200');}break;case _0xbcbe('0x7b'):if(_0x31e8d5[_0xbcbe('0x7c')]==='$substring'){if(_0x31e8d5['value']['split']('\x20')['length']>0x1){_0x43f428[_0x1c4e4e](_0xbcbe('0x7d'),qs[_0xbcbe('0x7e')](_0x31e8d5[_0xbcbe('0x7f')]),null);}else{var _0x42aaae='%'+_0x31e8d5['value']+'%';_0x43f428[_0x1c4e4e](_0xbcbe('0x80'),_0x42aaae,_0x42aaae,_0x42aaae);}}else{_0x48cb64=_[_0xbcbe('0x81')](_0x2e3250,[_0xbcbe('0x3a'),'ContactId']);_0x31e8d5[_0xbcbe('0x63')]=_0xbcbe('0x82');_0x49045b=as[_0xbcbe('0x83')](_0x27d564,_0x48cb64[_0xbcbe('0x84')],_0x31e8d5);_0x43f428[_0x1c4e4e](_0x49045b['text'],_0x49045b[_0xbcbe('0x7f')][_0xbcbe('0x85')],_0x49045b['value'][_0xbcbe('0x39')]);}break;case _0xbcbe('0x86'):var _0x566eb8=_0x31e8d5[_0xbcbe('0x7f')][_0xbcbe('0x46')](',')[_0xbcbe('0x43')](function(_0x3b790f){return Number(_0x3b790f);});_0x566eb8[_0xbcbe('0x47')](function(_0x5b7e9b){_0xca5b17['or'](_0xbcbe('0x87'),'%,'+_0x5b7e9b+',%');});_0x3e77cf=_[_0xbcbe('0x88')](_0x3e77cf,_0x566eb8);break;case _0xbcbe('0x89'):if(_0x31e8d5[_0xbcbe('0x7c')]===_0xbcbe('0x8a')){_0x43f428[_0x1c4e4e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x31e8d5['value']+'%',null);}else{_0x48cb64=_[_0xbcbe('0x81')](_0x2e3250,['name',_0xbcbe('0x4d')]);_0x31e8d5[_0xbcbe('0x63')]='UserId';_0x49045b=as[_0xbcbe('0x83')](_0x27d564,_0x48cb64[_0xbcbe('0x84')],_0x31e8d5);_0x43f428[_0x1c4e4e](_0x49045b[_0xbcbe('0x8b')],_0x49045b[_0xbcbe('0x7f')]['start'],_0x49045b[_0xbcbe('0x7f')][_0xbcbe('0x39')]);}break;case _0xbcbe('0x3e'):_0x49045b=as['buildExpression']('me',null,_0x31e8d5);_0x43f428[_0x1c4e4e](_0x49045b[_0xbcbe('0x8b')],_0x49045b[_0xbcbe('0x7f')]['start'],_0x49045b[_0xbcbe('0x7f')][_0xbcbe('0x39')]);break;}}else{var _0x49045b=as['buildExpression'](_0x27d564,_0x48cb64[_0xbcbe('0x84')],_0x31e8d5);_0x43f428[_0x1c4e4e](_0x49045b[_0xbcbe('0x8b')],_0x49045b[_0xbcbe('0x7f')][_0xbcbe('0x85')],_0x49045b[_0xbcbe('0x7f')]['end']);}}}else{var _0x5c4a18=_(_0x3ecac2['query'])[_0xbcbe('0x8c')]()[_0xbcbe('0x43')](function(_0x49d3bb){return _[_0xbcbe('0x8d')](_0x2e3250,[_0xbcbe('0x3a'),_0x49d3bb])?_0x49d3bb:undefined;})[_0xbcbe('0x8e')]()['value']();if(!_[_0xbcbe('0x8f')](_0x5c4a18)){_0x5c4a18['forEach'](function(_0x5b86a0){if(_0x5b86a0===_0xbcbe('0x90')){_0x41252f['where'](_0xbcbe('0x91'),[][_0xbcbe('0x92')](_0x3ecac2[_0xbcbe('0x56')][_0x5b86a0]));}else if(_0x5b86a0===_0xbcbe('0x93')){var _0x467601=JSON[_0xbcbe('0x94')](_0x3ecac2['query'][_0x5b86a0])[_0xbcbe('0x95')];var _0x491a18=JSON[_0xbcbe('0x94')](_0x3ecac2[_0xbcbe('0x56')][_0x5b86a0])[_0xbcbe('0x96')];_0x41252f[_0xbcbe('0x60')](_0xbcbe('0x97'),_0x467601,_0x491a18);}else{if(_0x3ecac2[_0xbcbe('0x56')][_0x5b86a0]===_0xbcbe('0x98')){_0x41252f[_0xbcbe('0x60')]('i.'+_0x5b86a0+_0xbcbe('0x99'));}else{_0x41252f[_0xbcbe('0x60')]('i.'+_0x5b86a0+_0xbcbe('0x9a'),_0x3ecac2[_0xbcbe('0x56')][_0x5b86a0]);}}});}if(_0x3ecac2[_0xbcbe('0x56')]['read']){if(_0x3ecac2[_0xbcbe('0x56')]['read']==0x1){_0x41252f['having'](_0xbcbe('0x9b'));}else{_0x41252f[_0xbcbe('0x7a')]('`unreadMessages`\x20>\x200');}}if(_0x3ecac2['query'][_0xbcbe('0x9c')]){_0x3e77cf=_[_0xbcbe('0x9d')](_0x3ecac2[_0xbcbe('0x56')]['tag'])?_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x9c')]:new Array(_0x3ecac2[_0xbcbe('0x56')]['tag']);_0x3e77cf['forEach'](function(_0x204841){_0xca5b17['or'](_0xbcbe('0x87'),'%,'+_0x204841+',%');});}if(_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x9e')]){var _0x1e8e79=_0x3ecac2[_0xbcbe('0x56')][_0xbcbe('0x9e')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1e8e79)){_0x43f428['or'](_0xbcbe('0x9f'),_0x1e8e79+'%');}else{_0x43f428['or'](_0xbcbe('0xa0'),qs[_0xbcbe('0x7e')](_0x1e8e79))['or'](_0xbcbe('0xa1'),_0x1e8e79+'%');}}}_0x41252f[_0xbcbe('0x60')](_0x43f428);_0x41252f[_0xbcbe('0xa2')](_0xbcbe('0xa3'));var _0x492790={'type':db['Sequelize']['QueryTypes'][_0xbcbe('0xa4')],'raw':!![]};var _0x3ed201=_0x41252f['clone']();_0x3ed201['field']('i.id');_0x3ed201['field'](_0xbcbe('0xa5'),_0xbcbe('0x79'));if(_0x1587b2[_0xbcbe('0x5e')]){_0x1587b2[_0xbcbe('0x5e')]['forEach'](function(_0x3cfc23){var _0x1bc2a1=_0x3cfc23[0x0]===_0xbcbe('0xa6')?_0x3cfc23[0x0]:'i.'+_0x3cfc23[0x0];_0x41252f[_0xbcbe('0x5e')](_0x1bc2a1,_0x3cfc23[0x1]===_0xbcbe('0xa7')?![]:!![]);});}if(!_[_0xbcbe('0x8f')](_0x3e77cf)){_0x41252f['having'](_0xca5b17);_0x3ed201['where'](_0xbcbe('0xa8'),_0x3e77cf);}BPromise[_0xbcbe('0xa9')]()[_0xbcbe('0x24')](function(){if(!_0x5f3edb){if(_0x3ecac2['query']['ChatWebsiteId'])return;_0x3ed201['where'](_0xbcbe('0xaa'));_0x41252f[_0xbcbe('0x60')](_0xbcbe('0xaa'));return;}if(_0x3ecac2[_0xbcbe('0xab')][_0xbcbe('0xac')]!==_0xbcbe('0x40'))return;return _0x3ecac2[_0xbcbe('0xab')][_0xbcbe('0xad')]({'attributes':['id'],'raw':!![]})[_0xbcbe('0x24')](function(_0x146316){if(_[_0xbcbe('0x8f')](_0x146316)){_0x3ed201['where'](_0xbcbe('0xae'));_0x41252f['where'](_0xbcbe('0xae'));}else{_0x3ed201[_0xbcbe('0x60')](_0xbcbe('0x91'),_[_0xbcbe('0x43')](_0x146316,'id'));_0x41252f[_0xbcbe('0x60')](_0xbcbe('0x91'),_[_0xbcbe('0x43')](_0x146316,'id'));}});})[_0xbcbe('0x24')](function(){if(_0x3ecac2[_0xbcbe('0xab')]['role']===_0xbcbe('0x40')&&!_0x5f3edb&&!_0x3ecac2[_0xbcbe('0x56')]['ChatWebsiteId'])return[];return db[_0xbcbe('0xaf')][_0xbcbe('0x56')](_0x3ed201[_0xbcbe('0xb0')](),_0x492790);})['then'](function(_0x46a25a){_0x8f3fe6[_0xbcbe('0x34')]=_0x46a25a[_0xbcbe('0x5a')];if(_0x8f3fe6[_0xbcbe('0x34')]===0x0)return[];return db[_0xbcbe('0xaf')][_0xbcbe('0x56')](_0x2c65fd[_0xbcbe('0xb0')](),_0x492790)['then'](function(_0x435edf){_0x3c3bf4=_[_0xbcbe('0xb1')](_0x435edf,'id');_0x492790=_[_0xbcbe('0x3d')](_0x492790,{'model':db[_0xbcbe('0x52')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ecac2['query'][_0xbcbe('0x59')]){_0x1587b2[_0xbcbe('0x57')][_0xbcbe('0x47')](function(_0x1fbd44){_0x41252f[_0xbcbe('0x63')]('i.'+_0x1fbd44);});}else{_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xa5'),_0xbcbe('0x79'));_0x41252f['field'](_0xbcbe('0xb2'),'Account.key');_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xb3'),_0xbcbe('0xb4'));_0x41252f['field'](_0xbcbe('0xb5'),'contactName');_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xb6'));_0x41252f['field']('c.firstName',_0xbcbe('0xb7'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xb8'),_0xbcbe('0xb9'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xba'),'Contact.email');_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xbb'),_0xbcbe('0xbc'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xbd'),_0xbcbe('0xbe'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xbf'),_0xbcbe('0xc0'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xc1'),_0xbcbe('0xc2'));_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xc3'),'Owner.internal');_0x41252f[_0xbcbe('0x63')](_0xbcbe('0xc4'),_0xbcbe('0x44'));}if(_0x1587b2[_0xbcbe('0x33')])_0x41252f[_0xbcbe('0x33')](_0x1587b2['limit']);if(_0x1587b2[_0xbcbe('0x31')])_0x41252f[_0xbcbe('0x31')](_0x1587b2[_0xbcbe('0x31')]);return db[_0xbcbe('0xaf')][_0xbcbe('0x56')](_0x41252f['toString'](),_0x492790);})[_0xbcbe('0x24')](function(_0x36a77c){if(_0x36a77c[_0xbcbe('0x5a')]>0x0)_0x5e1058[_0xbcbe('0x60')](_0xbcbe('0xc5'),_[_0xbcbe('0x43')](_0x36a77c,'id'));return db[_0xbcbe('0xaf')][_0xbcbe('0x56')](_0x5e1058[_0xbcbe('0xb0')](),_0x492790)['then'](function(_0xad4627){var _0x5ef2ee=_['groupBy'](_0xad4627,_0xbcbe('0xc6'));var _0x3ccded=[];_0x36a77c[_0xbcbe('0x47')](function(_0x502451){_0x3ccded['push'](updateChatInteraction(_0x502451,_0x3c3bf4,_0x5ef2ee));});return BPromise[_0xbcbe('0xc7')](_0x3ccded);});});})['then'](function(_0x360973){_0x8f3fe6[_0xbcbe('0xc8')]=_0x360973;return _0x8f3fe6;})[_0xbcbe('0x24')](respondWithFilteredResult(_0x202fd1,_0x1587b2))['catch'](handleError(_0x202fd1,null));};exports[_0xbcbe('0xc9')]=function(_0x3cecfe,_0x2c1cbc){var _0x1a8fda={'raw':![],'where':{'id':_0x3cecfe['params']['id']}},_0x25540e={};_0x25540e[_0xbcbe('0x5b')]=_[_0xbcbe('0x8c')](db['ChatInteraction'][_0xbcbe('0x53')]);_0x25540e[_0xbcbe('0x56')]=_['keys'](_0x3cecfe[_0xbcbe('0x56')]);_0x25540e[_0xbcbe('0x61')]=_[_0xbcbe('0x58')](_0x25540e[_0xbcbe('0x5b')],_0x25540e['query']);_0x1a8fda[_0xbcbe('0x57')]=_[_0xbcbe('0x58')](_0x25540e['model'],qs[_0xbcbe('0x59')](_0x3cecfe[_0xbcbe('0x56')][_0xbcbe('0x59')]));_0x1a8fda[_0xbcbe('0x57')]=_0x1a8fda[_0xbcbe('0x57')]['length']?_0x1a8fda[_0xbcbe('0x57')]:_0x25540e[_0xbcbe('0x5b')];if(_0x3cecfe['query'][_0xbcbe('0xca')]){_0x1a8fda[_0xbcbe('0xcb')]=[{'all':!![]}];}_0x1a8fda=_[_0xbcbe('0x3d')]({},_0x1a8fda,_0x3cecfe[_0xbcbe('0xcc')]);return db[_0xbcbe('0x52')][_0xbcbe('0x81')](_0x1a8fda)['then'](handleEntityNotFound(_0x2c1cbc,null))[_0xbcbe('0x24')](respondWithResult(_0x2c1cbc,null))[_0xbcbe('0x2e')](handleError(_0x2c1cbc,null));};exports[_0xbcbe('0xcd')]=function(_0x3cf2ed,_0x32cfa7){return db[_0xbcbe('0x52')][_0xbcbe('0xcd')](_0x3cf2ed[_0xbcbe('0x3e')],{})[_0xbcbe('0x24')](respondWithResult(_0x32cfa7,0xc9))[_0xbcbe('0x2e')](handleError(_0x32cfa7,null));};exports['update']=function(_0x132f8b,_0x1b2be4){if(_0x132f8b[_0xbcbe('0x3e')]['id']){delete _0x132f8b['body']['id'];}return db['ChatInteraction'][_0xbcbe('0x81')]({'where':{'id':_0x132f8b[_0xbcbe('0xce')]['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x1b2be4,null))[_0xbcbe('0x24')](saveUpdates(_0x132f8b[_0xbcbe('0x3e')],null))[_0xbcbe('0x24')](respondWithResult(_0x1b2be4,null))[_0xbcbe('0x2e')](handleError(_0x1b2be4,null));};exports[_0xbcbe('0x38')]=function(_0x35cc0e,_0x24ebad){return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0x35cc0e['params']['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x24ebad,null))['then'](removeEntity(_0x24ebad,null))[_0xbcbe('0x2e')](handleError(_0x24ebad,null));};exports['describe']=function(_0x159d9a,_0x5e7b51){return db[_0xbcbe('0x52')][_0xbcbe('0xcf')]()[_0xbcbe('0x24')](respondWithResult(_0x5e7b51,null))['catch'](handleError(_0x5e7b51,null));};exports[_0xbcbe('0xd0')]=function(_0x42bc6a,_0x29e792){var _0x360db2=_0x42bc6a[_0xbcbe('0xce')]['id'];var _0x420e74;var _0x589177;var _0x7d3f53;return db['ChatInteraction'][_0xbcbe('0xd1')]({'where':{'id':_0x360db2}})[_0xbcbe('0x24')](function(_0x2a40ee){_0x420e74=_0x2a40ee;return db[_0xbcbe('0xd2')][_0xbcbe('0xd1')]({'where':{'id':_0x2a40ee[_0xbcbe('0x90')]},'attributes':['id',_0xbcbe('0xd3'),'vidaooEscalation',_0xbcbe('0xd4'),_0xbcbe('0xd5'),_0xbcbe('0xd6')],'raw':!![]});})['then'](function(_0xf7531c){if(_0xf7531c&&_0xf7531c[_0xbcbe('0xd3')]&&_0xf7531c[_0xbcbe('0xd7')]){_0x589177=_0xf7531c;var _0x1a0106={'interaction':{'id':_0x360db2},'agent':{'id':_0x42bc6a[_0xbcbe('0xab')]['id'],'name':_0x42bc6a[_0xbcbe('0xab')][_0xbcbe('0x3a')],'fullname':_0x42bc6a[_0xbcbe('0xab')][_0xbcbe('0xd8')],'email':_0x42bc6a[_0xbcbe('0xab')][_0xbcbe('0xd9')]},'contact':_0x42bc6a[_0xbcbe('0x3e')]['contact'],'account':_0x42bc6a[_0xbcbe('0x3e')][_0xbcbe('0x41')]};var _0x301e38={'rejectUnauthorized':![],'method':'POST','url':_0xbcbe('0xda'),'headers':{'X-APIKEY':_0xf7531c[_0xbcbe('0xd3')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x42bc6a['user'][_0xbcbe('0xd9')]],'buttons':null,'topic':_0x589177[_0xbcbe('0xd4')],'note':_['isNull'](_0x589177['vidaooNote'])?null:getMustacheRender(_0x589177[_0xbcbe('0xd5')],_0x1a0106),'metadata':null},'redirect':_0xbcbe('0xdb'),'json':!![]};try{if(!_[_0xbcbe('0xdc')](_0x589177[_0xbcbe('0xd6')])){var _0x383254=getMustacheRender(_0x589177[_0xbcbe('0xd6')],_0x1a0106);var _0x15e1e9=JSON['parse'](_0x383254);_0x301e38['body']['metadata']=_0x15e1e9;}}catch(_0x4e4d0b){throw new db[(_0xbcbe('0xdd'))][(_0xbcbe('0xde'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x301e38);}else{throw new db['Sequelize'][(_0xbcbe('0xde'))](_0xbcbe('0xdf'));}})[_0xbcbe('0x24')](function(_0x506ff4){_0x7d3f53=_0x506ff4;if(_0x7d3f53['id']){var _0x487fdd={'body':_0x7d3f53['join_url'],'ChatWebsiteId':_0x589177['id'],'ChatInteractionId':_0x420e74['id'],'direction':'out','UserId':_0x42bc6a[_0xbcbe('0xab')]['id']};return db['ChatMessage'][_0xbcbe('0xcd')](_0x487fdd,{});}else{throw new db[(_0xbcbe('0xdd'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xbcbe('0x24')](function(){return _0x420e74[_0xbcbe('0xe0')]({'vidaooSessionId':_0x7d3f53['id']});})[_0xbcbe('0x24')](respondWithResult(_0x29e792,null))[_0xbcbe('0x2e')](handleError(_0x29e792,null));};exports[_0xbcbe('0xe1')]=function(_0xd44569,_0x5b6bba){if(_0xd44569['body']['id']){delete _0xd44569[_0xbcbe('0x3e')]['id'];}return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0xd44569['params']['id']},'include':[{'model':db[_0xbcbe('0xe2')],'as':_0xbcbe('0x7b')}]})['then'](handleEntityNotFound(_0x5b6bba,null))[_0xbcbe('0x24')](saveUpdates(_0xd44569[_0xbcbe('0x3e')],null))[_0xbcbe('0x24')](respondWithResult(_0x5b6bba,null))[_0xbcbe('0x2e')](handleError(_0x5b6bba,null));};exports[_0xbcbe('0xe3')]=function(_0x13fd3b,_0x3b9854,_0x5e4185){if(_0x13fd3b['body']['id']){delete _0x13fd3b['body']['id'];}return db[_0xbcbe('0x52')]['find']({'where':{'id':_0x13fd3b['params']['id']}})['then'](function(_0x1f903d){if(!_0x1f903d){logger[_0xbcbe('0x2a')](_0xbcbe('0xe4'),_0xbcbe('0xe3'),0x194,_0xbcbe('0xe5'));_0x3b9854['sendStatus'](0x194);}else{if(_0x1f903d['UserId']){throw new db['Sequelize'][(_0xbcbe('0xde'))](_0xbcbe('0xe6'));}}return _0x1f903d;})[_0xbcbe('0x24')](function(_0x5e38cc){if(_0x5e38cc){return _0x5e38cc[_0xbcbe('0x37')]({'closed':_0x13fd3b['body']['closed'],'disposition':_0x13fd3b[_0xbcbe('0x3e')][_0xbcbe('0x4f')]})[_0xbcbe('0x24')](function(_0x4c793c){return _0x4c793c;});}})[_0xbcbe('0x24')](function(_0x212539){return respondWithRpcPromise(_0xbcbe('0xe7'),_0xbcbe('0xe3'),_0x13fd3b[_0xbcbe('0x3e')],client9004);})['then'](respondWithResult(_0x3b9854,null))[_0xbcbe('0x2e')](handleError(_0x3b9854,null));};exports[_0xbcbe('0xe8')]=function(_0x4c3174,_0x46ee01,_0x461642){_0x4c3174['body'][_0xbcbe('0x3a')]=_0x4c3174[_0xbcbe('0xe9')]['originalname'];_0x4c3174[_0xbcbe('0x3e')][_0xbcbe('0xea')]=_0x4c3174[_0xbcbe('0xe9')]['filename'];_0x4c3174[_0xbcbe('0x3e')]['type']=_0x4c3174[_0xbcbe('0xe9')][_0xbcbe('0xeb')];return db[_0xbcbe('0xec')]['create'](_0x4c3174['body'])[_0xbcbe('0x24')](respondWithResult(_0x46ee01,0xc9))[_0xbcbe('0x2e')](handleError(_0x46ee01,null));};exports[_0xbcbe('0xed')]=function(_0x5e8923,_0x145662,_0x17d6c6){return db['ChatInteraction']['findOne']({'where':{'id':_0x5e8923[_0xbcbe('0xce')]['id']},'raw':!![]})[_0xbcbe('0x24')](handleEntityNotFound(_0x145662,null))['then'](function(_0x41e48c){if(_0x41e48c){if(_0x41e48c[_0xbcbe('0x4e')]){return _0x145662['status'](0x193)[_0xbcbe('0x36')]({'status':0x193,'message':_0xbcbe('0xee')});}return db[_0xbcbe('0xec')]['findOne']({'where':{'id':_0x5e8923[_0xbcbe('0x56')][_0xbcbe('0xef')]},'raw':!![]})[_0xbcbe('0x24')](handleEntityNotFound(_0x145662,null));}})[_0xbcbe('0x24')](function(_0x449583){if(_0x449583){var _0xf08456=_0x449583[_0xbcbe('0xf0')]!==null;var _0x12cf8c=path[_0xbcbe('0xf1')](config['root'],'server/files/attachments/');if(_0xf08456){_0x12cf8c=path[_0xbcbe('0xf1')](_0x12cf8c,_0xbcbe('0xf2'));}var _0xf385a6=path[_0xbcbe('0xf1')](_0x12cf8c,_0x449583[_0xbcbe('0xea')]);return _0x145662[_0xbcbe('0xf3')](_0xf385a6);}})[_0xbcbe('0x2e')](handleError(_0x145662,null));};exports['close']=function(_0x5ac2e4,_0x3d77a4){var _0x46c80d=null;var _0x1aafb8=null;var _0x4f6321=null;var _0x5dad91=null;if(_0x5ac2e4[_0xbcbe('0x3e')]['id']){delete _0x5ac2e4[_0xbcbe('0x3e')]['id'];}if(_0x5ac2e4[_0xbcbe('0x3e')][_0xbcbe('0xf4')]){_0x5dad91=path['join'](config[_0xbcbe('0xf5')],'server/files/chat/upload/',util[_0xbcbe('0xf6')](_0xbcbe('0xf7'),Date[_0xbcbe('0xf8')]()));_0x5ac2e4['body']['pathTranscript']=_0x5dad91;}return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0x5ac2e4[_0xbcbe('0xce')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xbcbe('0xf9'),'include':[{'model':db['User'],'as':_0xbcbe('0x89')}]}]})[_0xbcbe('0x24')](handleEntityNotFound(_0x3d77a4,null))[_0xbcbe('0x24')](saveUpdates(_0x5ac2e4[_0xbcbe('0x3e')],null))[_0xbcbe('0x24')](function(_0x5a2d9d){if(_0x5a2d9d){_0x46c80d=_0x5a2d9d;return db[_0xbcbe('0xd2')][_0xbcbe('0x81')]({'where':{'id':_0x46c80d['ChatWebsiteId']}});}})[_0xbcbe('0x24')](function(_0x33da14){if(_0x33da14){_0x4f6321=_0x33da14;return db[_0xbcbe('0xe2')][_0xbcbe('0x81')]({'where':{'id':_0x46c80d[_0xbcbe('0x82')]}});}})[_0xbcbe('0x24')](function(_0x5b9c0d){if(_0x5b9c0d){_0x1aafb8=_0x5b9c0d;if(_0x5dad91){var _0x1d27f8=null;for(var _0xee0416=0x1;_0xee0416<_0x46c80d[_0xbcbe('0xf9')][_0xbcbe('0x5a')];++_0xee0416){_0x1d27f8=_0x46c80d['Messages'][_0xee0416];var _0x20408a=_0x1d27f8[_0xbcbe('0x4d')]?util['format'](_0xbcbe('0xfa'),_0x4f6321[_0xbcbe('0xfb')],_0x1d27f8['UserId']):'System';var _0x1430ef=_0x5ac2e4[_0xbcbe('0x3e')][_0xbcbe('0xfc')]||util[_0xbcbe('0xf6')](_0xbcbe('0xfa'),'Visitor',_0x1d27f8[_0xbcbe('0x82')]);switch(_0x4f6321[_0xbcbe('0xfd')]){case _0xbcbe('0xfe'):_0x20408a=_0x1d27f8[_0xbcbe('0x4d')]?util['format'](_0xbcbe('0xfa'),_0x4f6321[_0xbcbe('0xfb')],_0x1d27f8[_0xbcbe('0x4d')]):_0xbcbe('0xff');break;case'agent_alias':_0x20408a=_0x1d27f8[_0xbcbe('0x4d')]?_0x1d27f8[_0xbcbe('0x89')][_0xbcbe('0x100')]||_0x1d27f8[_0xbcbe('0x89')]['fullname']:'System';break;case'agent_fullname':_0x20408a=_0x1d27f8[_0xbcbe('0x4d')]?_0x1d27f8[_0xbcbe('0x89')][_0xbcbe('0xd8')]:_0xbcbe('0xff');break;default:_0x20408a=_0x1d27f8['UserId']?util[_0xbcbe('0xf6')](_0xbcbe('0xfa'),_0x4f6321['agentAlias'],_0x1d27f8[_0xbcbe('0x4d')]):_0xbcbe('0xff');}var _0x3eeaa3=util['format'](_0xbcbe('0x101'),moment(_0x1d27f8[_0xbcbe('0x93')])[_0xbcbe('0xf6')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1d27f8[_0xbcbe('0x102')]==='in'?_0x1430ef:_0x20408a,_0x1d27f8[_0xbcbe('0x3e')]);if(!_0x1d27f8[_0xbcbe('0x103')]){fs[_0xbcbe('0x104')](_0x5dad91,_0x3eeaa3);}}return db[_0xbcbe('0x105')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xbcbe('0x106')],'as':_0xbcbe('0x107'),'raw':!![]}]});}}})[_0xbcbe('0x24')](function(_0x10f99a){if(_0x10f99a&&_0x10f99a[_0xbcbe('0x107')]&&_0x5ac2e4[_0xbcbe('0x3e')]){var _0x4396d1={'tls':{'rejectUnauthorized':![]}};if(_0x10f99a[_0xbcbe('0x107')]['service']){_0x4396d1[_0xbcbe('0x108')]=_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x108')];}else{_0x4396d1[_0xbcbe('0x109')]=_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x109')];_0x4396d1[_0xbcbe('0x10a')]=_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x10a')];_0x4396d1['secure']=_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x10b')];}if(_0x10f99a[_0xbcbe('0x107')][_0xbcbe('0x10c')]){_0x4396d1[_0xbcbe('0x10d')]={'user':_0x10f99a['Smtp']['user'],'pass':_0x10f99a['Smtp'][_0xbcbe('0x10e')]};}return respondWithRpcPromise(_0xbcbe('0x10f'),_0xbcbe('0x110'),{'account':_0x4396d1,'message':{'from':util[_0xbcbe('0xf6')](_0xbcbe('0x111'),_0x10f99a['name'],_0x10f99a[_0xbcbe('0xd9')]||_0x10f99a[_0xbcbe('0x107')]['user']),'to':_0x5ac2e4[_0xbcbe('0x3e')]['mailTranscript'],'subject':_0xbcbe('0x112'),'text':util['format'](_0xbcbe('0x113'),_0x5ac2e4[_0xbcbe('0x3e')][_0xbcbe('0xf4')]),'attachments':[{'path':_0x5dad91}]}})[_0xbcbe('0x24')](function(){return _0x46c80d;})[_0xbcbe('0x2e')](function(_0x19d16c){console['error'](_0x19d16c);});}else{return _0x46c80d;}})[_0xbcbe('0x24')](respondWithStatusCode(_0x3d77a4,0xc8))[_0xbcbe('0x2e')](handleError(_0x3d77a4,null));};exports[_0xbcbe('0x114')]=function(_0x1934bc,_0x5c28a5,_0x54266f){return db[_0xbcbe('0x115')][_0xbcbe('0x81')]({'where':{'id':_0x1934bc['params']['id']}})['then'](handleEntityNotFound(_0x5c28a5,null))[_0xbcbe('0x24')](function(_0x5a177c){if(_0x5a177c){return _0x5a177c[_0xbcbe('0x114')](_0x1934bc[_0xbcbe('0x3e')]['ids'],_[_0xbcbe('0x116')](_0x1934bc[_0xbcbe('0x3e')],['ids','id'])||{});}})[_0xbcbe('0x24')](respondWithResult(_0x5c28a5,null))['catch'](handleError(_0x5c28a5,null));};exports['getMessages']=function(_0x1da477,_0x13868d,_0x1f559c){var _0x1ef58e={'raw':![],'where':{}};var _0x2e998f={};var _0x4344b8={'count':0x0,'rows':[]};return db[_0xbcbe('0x52')][_0xbcbe('0xd1')]({'where':{'id':_0x1da477[_0xbcbe('0xce')]['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x13868d,null))['then'](function(_0x3e04a5){if(_0x3e04a5){_0x2e998f['model']=_[_0xbcbe('0x8c')](db[_0xbcbe('0x115')][_0xbcbe('0x53')]);_0x2e998f[_0xbcbe('0x56')]=_[_0xbcbe('0x8c')](_0x1da477[_0xbcbe('0x56')]);_0x2e998f['filters']=_[_0xbcbe('0x58')](_0x2e998f[_0xbcbe('0x5b')],_0x2e998f[_0xbcbe('0x56')]);_0x1ef58e['attributes']=_[_0xbcbe('0x58')](_0x2e998f[_0xbcbe('0x5b')],qs['fields'](_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x59')]));_0x1ef58e[_0xbcbe('0x57')]=_0x1ef58e['attributes']['length']?_0x1ef58e[_0xbcbe('0x57')]:_0x2e998f[_0xbcbe('0x5b')];if(!_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x5c')](_0xbcbe('0x5d'))){_0x1ef58e['limit']=qs[_0xbcbe('0x33')](_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x33')]);_0x1ef58e[_0xbcbe('0x31')]=qs[_0xbcbe('0x31')](_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x31')]);}_0x1ef58e[_0xbcbe('0x5e')]=qs[_0xbcbe('0x5f')](_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x5f')]);_0x1ef58e['where']=qs[_0xbcbe('0x61')](_['pick'](_0x1da477['query'],_0x2e998f[_0xbcbe('0x61')]));_0x1ef58e[_0xbcbe('0x60')]['ChatInteractionId']=_0x3e04a5['id'];if(_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x9e')]){_0x1ef58e['where']=_['merge'](_0x1ef58e[_0xbcbe('0x60')],{'$or':_[_0xbcbe('0x43')](_0x1ef58e['attributes'],function(_0x31dc6c){var _0x22e045={};_0x22e045[_0x31dc6c]={'$like':'%'+_0x1da477['query']['filter']+'%'};return _0x22e045;})});}if(_0x1da477[_0xbcbe('0x56')][_0xbcbe('0x95')]){var _0x481b82=_0x1da477[_0xbcbe('0x56')]['$gte'][_0xbcbe('0x46')](',');var _0x3d0005={};_0x3d0005[_0x481b82[0x0]]={'$gte':moment(_0x481b82[0x1])[_0xbcbe('0xf6')](_0xbcbe('0x117'))};_0x1ef58e[_0xbcbe('0x60')]=_[_0xbcbe('0x3d')](_0x1ef58e['where'],_0x3d0005);}_0x1ef58e=_[_0xbcbe('0x3d')]({},_0x1ef58e,_0x1da477[_0xbcbe('0xcc')]);return db[_0xbcbe('0x115')]['count']({'where':_0x1ef58e['where']})[_0xbcbe('0x24')](function(_0x3ccb5b){_0x4344b8[_0xbcbe('0x34')]=_0x3ccb5b;if(_0x1da477[_0xbcbe('0x56')][_0xbcbe('0xca')]){_0x1ef58e[_0xbcbe('0xcb')]=[{'all':!![]}];}return db[_0xbcbe('0x115')][_0xbcbe('0x118')](_0x1ef58e);})[_0xbcbe('0x24')](function(_0xb2314){_0x4344b8[_0xbcbe('0xc8')]=_0xb2314;return _0x4344b8;});}})[_0xbcbe('0x24')](respondWithFilteredResult(_0x13868d,_0x1ef58e))[_0xbcbe('0x2e')](handleError(_0x13868d,null));};exports['getMyMessages']=function(_0x32e41a,_0x3bc0cf,_0x3c0dfd){var _0x1d97d5={'where':{}},_0x5a9e0c={},_0x413403={'count':0x0,'rows':[]};return db[_0xbcbe('0x52')]['findOne']({'where':{'id':_0x32e41a[_0xbcbe('0xce')]['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x3bc0cf,null))['then'](function(_0x270b81){if(_0x270b81){_0x5a9e0c['model']=_[_0xbcbe('0x8c')](db[_0xbcbe('0x115')]['rawAttributes']);_0x5a9e0c[_0xbcbe('0x56')]=_['keys'](_0x32e41a['query']);_0x5a9e0c[_0xbcbe('0x61')]=_[_0xbcbe('0x58')](_0x5a9e0c[_0xbcbe('0x5b')],_0x5a9e0c[_0xbcbe('0x56')]);_0x1d97d5[_0xbcbe('0x57')]=_[_0xbcbe('0x58')](_0x5a9e0c[_0xbcbe('0x5b')],qs[_0xbcbe('0x59')](_0x32e41a[_0xbcbe('0x56')][_0xbcbe('0x59')]));_0x1d97d5[_0xbcbe('0x57')]=_0x1d97d5['attributes'][_0xbcbe('0x5a')]?_0x1d97d5['attributes']:_0x5a9e0c[_0xbcbe('0x5b')];if(!_0x32e41a[_0xbcbe('0x56')][_0xbcbe('0x5c')](_0xbcbe('0x5d'))){_0x1d97d5[_0xbcbe('0x33')]=qs['limit'](_0x32e41a['query']['limit']);_0x1d97d5[_0xbcbe('0x31')]=qs[_0xbcbe('0x31')](_0x32e41a[_0xbcbe('0x56')][_0xbcbe('0x31')]);}_0x1d97d5[_0xbcbe('0x5e')]=qs[_0xbcbe('0x5f')](_0x32e41a['query']['sort']);_0x1d97d5[_0xbcbe('0x60')]=qs[_0xbcbe('0x61')](_[_0xbcbe('0x119')](_0x32e41a[_0xbcbe('0x56')],_0x5a9e0c[_0xbcbe('0x61')]));_0x1d97d5[_0xbcbe('0x60')][_0xbcbe('0xc6')]=_0x270b81['id'];if(_0x32e41a[_0xbcbe('0x56')]['filter']){_0x1d97d5[_0xbcbe('0x60')]=_['merge'](_0x1d97d5[_0xbcbe('0x60')],{'$or':_['map'](_0x1d97d5[_0xbcbe('0x57')],function(_0x30d3bf){var _0x374280={};_0x374280[_0x30d3bf]={'$like':'%'+_0x32e41a[_0xbcbe('0x56')][_0xbcbe('0x9e')]+'%'};return _0x374280;})});}_0x1d97d5[_0xbcbe('0x60')][_0xbcbe('0x103')]=![];if(_0x32e41a[_0xbcbe('0x56')]['id']){_0x1d97d5[_0xbcbe('0x60')]['id']={'$gt':_0x32e41a[_0xbcbe('0x56')]['id']};}_0x1d97d5=_[_0xbcbe('0x3d')]({},_0x1d97d5,_0x32e41a[_0xbcbe('0xcc')]);return db['ChatMessage'][_0xbcbe('0x34')]({'where':_0x1d97d5[_0xbcbe('0x60')]})[_0xbcbe('0x24')](function(_0x98a0c){_0x413403[_0xbcbe('0x34')]=_0x98a0c;_0x1d97d5[_0xbcbe('0xcb')]=[];if(_0x32e41a['query'][_0xbcbe('0x11a')]){_0x1d97d5['include'][_0xbcbe('0x11b')]({'model':db[_0xbcbe('0x89')],'as':_0xbcbe('0x89'),'attributes':['id',_0xbcbe('0xd8'),_0xbcbe('0x100')]});}if(_0x32e41a[_0xbcbe('0x56')]['includeAll']){_0x1d97d5['include']=[{'all':!![]}];}return db[_0xbcbe('0x115')][_0xbcbe('0x118')](_0x1d97d5);})['then'](function(_0x585582){_0x413403[_0xbcbe('0xc8')]=_0x585582;return _0x413403;});}})[_0xbcbe('0x24')](respondWithFilteredResult(_0x3bc0cf,_0x1d97d5))[_0xbcbe('0x2e')](handleError(_0x3bc0cf,null));};exports[_0xbcbe('0x11c')]=function(_0x4022a3,_0x461af4,_0x5e4909){return db[_0xbcbe('0x52')]['find']({'where':{'id':_0x4022a3['params']['id']}})[_0xbcbe('0x24')](handleEntityNotFound(_0x461af4,null))[_0xbcbe('0x24')](function(_0x4e57ac){if(_0x4e57ac){return _0x4e57ac[_0xbcbe('0x11d')](_0x4022a3[_0xbcbe('0x3e')][_0xbcbe('0x11e')],_[_0xbcbe('0x116')](_0x4022a3[_0xbcbe('0x3e')],[_0xbcbe('0x11e'),'id'])||{})[_0xbcbe('0x11f')](function(){return db[_0xbcbe('0x86')]['findAll']({'attributes':['id',_0xbcbe('0x3a'),_0xbcbe('0x64')],'where':{'id':_0x4022a3[_0xbcbe('0x3e')][_0xbcbe('0x11e')]}});})['then'](function(_0x5f2da5){socket[_0xbcbe('0x120')](_0xbcbe('0x121'),{'id':Number(_0x4022a3['params']['id']),'tags':_0x5f2da5||[]});return{'id':Number(_0x4022a3[_0xbcbe('0xce')]['id']),'tags':_0x5f2da5||[]};});}})['then'](respondWithResult(_0x461af4,null))['catch'](handleError(_0x461af4,null));};exports[_0xbcbe('0x122')]=function(_0x2b96b8,_0x37bf30,_0x4975b9){return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0x2b96b8['params']['id']}})['then'](handleEntityNotFound(_0x37bf30,null))[_0xbcbe('0x24')](function(_0x31d39f){if(_0x31d39f){return _0x31d39f[_0xbcbe('0x122')](_0x2b96b8['query'][_0xbcbe('0x11e')]);}})[_0xbcbe('0x24')](respondWithStatusCode(_0x37bf30,null))[_0xbcbe('0x2e')](handleError(_0x37bf30,null));};exports[_0xbcbe('0xf3')]=function(_0x5c9a2d,_0x3f9e50){var _0x28523c=moment()['unix']()[_0xbcbe('0xb0')]();var _0x478f65=path[_0xbcbe('0xf1')](config['root'],_0xbcbe('0x123'),_0xbcbe('0x124'),_0xbcbe('0x125'));var _0x313643=path[_0xbcbe('0xf1')](config[_0xbcbe('0xf5')],'server',_0xbcbe('0x124'),_0xbcbe('0x126'));var _0x1fd19d=path[_0xbcbe('0xf1')](_0x478f65,_0x28523c);var _0x106624=util[_0xbcbe('0xf6')](_0xbcbe('0x127'),_0x5c9a2d[_0xbcbe('0xce')]['id'],_0x28523c);var _0x52141d=path[_0xbcbe('0xf1')](_0x478f65,_0x106624);var _0x32d2d0=[];_0x32d2d0[_0xbcbe('0x11b')]({'model':db[_0xbcbe('0x89')],'as':_0xbcbe('0x89'),'attributes':['id',_0xbcbe('0xd8')],'raw':!![]});_0x32d2d0[_0xbcbe('0x11b')]({'model':db[_0xbcbe('0xe2')],'as':_0xbcbe('0x7b'),'attributes':['id','firstName',_0xbcbe('0x128')],'raw':!![]});if(_0x5c9a2d[_0xbcbe('0x56')][_0xbcbe('0x126')]){_0x32d2d0[_0xbcbe('0x11b')]({'model':db[_0xbcbe('0xec')],'as':'Attachment','raw':!![]});}var _0x206ce7=[{'model':db[_0xbcbe('0x115')],'as':_0xbcbe('0xf9'),'attributes':['id',_0xbcbe('0x3e'),_0xbcbe('0x93'),'direction',_0xbcbe('0x103'),'read'],'include':_0x32d2d0}];_0x206ce7['push']({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xbcbe('0x3a')]});_0x206ce7[_0xbcbe('0x11b')]({'model':db[_0xbcbe('0x89')],'as':_0xbcbe('0x129'),'attributes':['id',_0xbcbe('0xd8')]});return db[_0xbcbe('0x52')][_0xbcbe('0x81')]({'where':{'id':_0x5c9a2d[_0xbcbe('0xce')]['id']},'include':_0x206ce7})[_0xbcbe('0x24')](handleEntityNotFound(_0x3f9e50,null))[_0xbcbe('0x24')](function(_0x326fb5){if(_0x326fb5){var _0x30ac13=_0x326fb5[_0xbcbe('0x12a')]({'plain':!![]});fs[_0xbcbe('0x12b')](_0x1fd19d);var _0x54e214={'channel':_0xbcbe('0x12c'),'account':_0x30ac13['Account']['name'],'agent':_0x30ac13[_0xbcbe('0x129')]?_0x30ac13['Owner']['fullname']:'N.A.','createdAt':moment(_0x30ac13['createdAt'])[_0xbcbe('0xf6')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x30ac13[_0xbcbe('0x4e')]?moment(_0x30ac13[_0xbcbe('0x12d')])[_0xbcbe('0xf6')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbcbe('0xb0')]():'','disposition':_0x30ac13[_0xbcbe('0x4f')],'chatInfo':{'browser':_0x30ac13[_0xbcbe('0x12e')],'os':_0x30ac13[_0xbcbe('0x12f')],'referer':_0x30ac13[_0xbcbe('0x130')],'customerIp':_0x30ac13[_0xbcbe('0x131')],'customerPort':_0x30ac13[_0xbcbe('0x132')]?_0x30ac13[_0xbcbe('0x132')]:'N.A.'},'messages':_(_0x30ac13[_0xbcbe('0xf9')])[_0xbcbe('0x133')]()[_0xbcbe('0x9e')]({'secret':![]})[_0xbcbe('0x43')](function(_0x195a4b){if(_0x195a4b[_0xbcbe('0xec')]){var _0x3c9666=path[_0xbcbe('0xf1')](_0x313643,_0x195a4b[_0xbcbe('0xec')][_0xbcbe('0xea')]);if(fs['existsSync'](_0x3c9666)){fs[_0xbcbe('0x134')](_0x3c9666)[_0xbcbe('0x135')](fs['createWriteStream'](path['join'](_0x1fd19d,_0x195a4b[_0xbcbe('0xec')][_0xbcbe('0xea')])));}}return{'date':moment(_0x195a4b[_0xbcbe('0x93')])[_0xbcbe('0xf6')](_0xbcbe('0x117'))[_0xbcbe('0xb0')](),'sender':_0x195a4b[_0xbcbe('0x102')]===_0xbcbe('0x136')?_0x195a4b[_0xbcbe('0x89')]?_0x195a4b[_0xbcbe('0x89')][_0xbcbe('0xd8')]:_0xbcbe('0xff'):_0x195a4b['Contact'][_0xbcbe('0x137')]+(_0x195a4b[_0xbcbe('0x7b')][_0xbcbe('0x128')]?'\x20'+_0x195a4b[_0xbcbe('0x7b')][_0xbcbe('0x128')]:''),'body':_0x195a4b[_0xbcbe('0xec')]?_0x195a4b[_0xbcbe('0xec')][_0xbcbe('0xea')]:_0x195a4b[_0xbcbe('0x3e')],'direction':_0x195a4b[_0xbcbe('0x102')]===_0xbcbe('0x136')?'A':'C','secret':_0x195a4b[_0xbcbe('0x103')],'read':_0x195a4b['read'],'attachment':_0x195a4b[_0xbcbe('0xec')]};})[_0xbcbe('0x7f')]()};return ejs['renderFile'](path[_0xbcbe('0xf1')](config[_0xbcbe('0xf5')],_0xbcbe('0x123'),'views','downloadInteraction.ejs'),{'interaction':_0x54e214})[_0xbcbe('0x24')](function(_0x513354){var _0x5de455=path[_0xbcbe('0xf1')](_0x1fd19d,_0xbcbe('0x138')+_0x30ac13['id']+'-'+_0x28523c+_0xbcbe('0x139'));var _0x5759aa={'path':_0x5de455,'channel':_0xbcbe('0x12c'),'interactionId':_0x30ac13['id']};return pdf['createPdfFromHTML'](_0x513354,_0x5759aa);})[_0xbcbe('0x24')](function(){return new BPromise(function(_0x2f7b00,_0x5e9255){zipdir(_0x1fd19d,{'saveTo':_0x52141d},function(_0x2ddf3,_0x22f9e6){if(_0x2ddf3)return _0x5e9255(_0x2ddf3);return _0x2f7b00(_0x22f9e6);});})[_0xbcbe('0x24')](function(){return new BPromise(function(_0x13a02b,_0x37d3cd){rimraf(_0x1fd19d,function(_0x3f992b){if(_0x3f992b)_0x37d3cd(_0x3f992b);return _0x13a02b();});});})[_0xbcbe('0x24')](function(){return _0x3f9e50[_0xbcbe('0xf3')](_0x52141d,_0x106624,function(_0x146a8a){if(_0x146a8a){console[_0xbcbe('0x13a')](_0xbcbe('0x13b'),_0x146a8a);}else{fs[_0xbcbe('0x13c')](_0x52141d);}});});});}else{return _0x3f9e50[_0xbcbe('0x2f')](0xc8);}})[_0xbcbe('0x2e')](handleError(_0x3f9e50,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 75612f4..4dc7029 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 _0xd57d=['findAll','length','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map'];(function(_0x1d03f1,_0x7f2edf){var _0x40c77e=function(_0x2f1025){while(--_0x2f1025){_0x1d03f1['push'](_0x1d03f1['shift']());}};_0x40c77e(++_0x7f2edf);}(_0xd57d,0x15e));var _0xdd57=function(_0x25b514,_0x5adb8b){_0x25b514=_0x25b514-0x0;var _0x2218aa=_0xd57d[_0x25b514];return _0x2218aa;};'use strict';var EventEmitter=require(_0xdd57('0x0'));var ChatInteraction=require(_0xdd57('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xdd57('0x1'))['db'][_0xdd57('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdd57('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdd57('0x4')};function emitEvent(_0x37aeb2){return function(_0x28b2aa,_0x4298e9,_0x5ec543){_0x28b2aa[_0xdd57('0x5')]({'attributes':['id'],'raw':!![]})[_0xdd57('0x6')](function(_0x427c0e){_0x28b2aa[_0xdd57('0x7')](_0xdd57('0x8'),_0x427c0e[_0xdd57('0x9')](function(_0x5267b2){return{'id':_0x5267b2['id']};}));return ChatMessage[_0xdd57('0xa')]({'where':{'ChatInteractionId':_0x28b2aa['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3626b9){_0x28b2aa['setDataValue']('unreadMessages',_0x3626b9[_0xdd57('0xb')]);ChatInteractionEvents[_0xdd57('0xc')](_0x37aeb2+':'+_0x28b2aa['id'],_0x28b2aa);ChatInteractionEvents['emit'](_0x37aeb2,_0x28b2aa);_0x5ec543(null);})['catch'](_0x5ec543(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdd57('0xd')](e,emitEvent(event));}}module[_0xdd57('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xdcf3=['save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x50bff6,_0x5f1b2b){var _0x10c8bf=function(_0xdb4bc4){while(--_0xdb4bc4){_0x50bff6['push'](_0x50bff6['shift']());}};_0x10c8bf(++_0x5f1b2b);}(_0xdcf3,0x7a));var _0x3dcf=function(_0x3b21ed,_0x516768){_0x3b21ed=_0x3b21ed-0x0;var _0x3c275f=_0xdcf3[_0x3b21ed];return _0x3c275f;};'use strict';var EventEmitter=require(_0x3dcf('0x0'));var ChatInteraction=require(_0x3dcf('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x3dcf('0x1'))['db'][_0x3dcf('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3dcf('0x3')](0x0);var events={'afterCreate':_0x3dcf('0x4'),'afterUpdate':_0x3dcf('0x5'),'afterDestroy':_0x3dcf('0x6')};function emitEvent(_0x5de87d){return function(_0x3efbfb,_0x449b46,_0xe29e0a){_0x3efbfb[_0x3dcf('0x7')]({'attributes':['id'],'raw':!![]})[_0x3dcf('0x8')](function(_0x3847eb){_0x3efbfb[_0x3dcf('0x9')](_0x3dcf('0xa'),_0x3847eb[_0x3dcf('0xb')](function(_0x232959){return{'id':_0x232959['id']};}));return ChatMessage[_0x3dcf('0xc')]({'where':{'ChatInteractionId':_0x3efbfb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3dcf('0x8')](function(_0x5751c7){_0x3efbfb[_0x3dcf('0x9')](_0x3dcf('0xd'),_0x5751c7[_0x3dcf('0xe')]);ChatInteractionEvents[_0x3dcf('0xf')](_0x5de87d+':'+_0x3efbfb['id'],_0x3efbfb);ChatInteractionEvents[_0x3dcf('0xf')](_0x5de87d,_0x3efbfb);_0xe29e0a(null);})[_0x3dcf('0x10')](_0xe29e0a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x3dcf('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 5b29339..2097eb3 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 _0x4940=['api','bluebird','request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1c4f71,_0x94a635){var _0x43a28b=function(_0x479f6b){while(--_0x479f6b){_0x1c4f71['push'](_0x1c4f71['shift']());}};_0x43a28b(++_0x94a635);}(_0x4940,0x1b7));var _0x0494=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4940[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x0494('0x0'));var util=require(_0x0494('0x1'));var logger=require(_0x0494('0x2'))(_0x0494('0x3'));var moment=require('moment');var BPromise=require(_0x0494('0x4'));var rp=require(_0x0494('0x5'));var fs=require('fs');var path=require(_0x0494('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0494('0x7'));module[_0x0494('0x8')]=function(_0x350f45,_0x55c2f7){return _0x350f45[_0x0494('0x9')](_0x0494('0xa'),attributes,{'tableName':_0x0494('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c5480,_0x31ea9a,_0x585a21){if(_0x4c5480['changed']('closed')){_0x4c5480[_0x0494('0xc')]=moment()[_0x0494('0xd')](_0x0494('0xe'));}_0x585a21(null,_0x4c5480);}},'charset':_0x0494('0xf'),'collate':_0x0494('0x10')});};
\ No newline at end of file
+var _0xe288=['./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','format','utf8mb4','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x3d85ee,_0x372cbd){var _0x276478=function(_0x56b2d8){while(--_0x56b2d8){_0x3d85ee['push'](_0x3d85ee['shift']());}};_0x276478(++_0x372cbd);}(_0xe288,0xb8));var _0x8e28=function(_0x3f8d95,_0xf30c58){_0x3f8d95=_0x3f8d95-0x0;var _0x50d325=_0xe288[_0x3f8d95];return _0x50d325;};'use strict';var _=require(_0x8e28('0x0'));var util=require(_0x8e28('0x1'));var logger=require(_0x8e28('0x2'))(_0x8e28('0x3'));var moment=require('moment');var BPromise=require(_0x8e28('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e28('0x5'));var rimraf=require(_0x8e28('0x6'));var config=require(_0x8e28('0x7'));var attributes=require(_0x8e28('0x8'));module[_0x8e28('0x9')]=function(_0x295c28,_0x4c9cd9){return _0x295c28[_0x8e28('0xa')](_0x8e28('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46cd0b,_0x43a75e,_0x1aeb9a){if(_0x46cd0b['changed'](_0x8e28('0xc'))){_0x46cd0b[_0x8e28('0xd')]=moment()[_0x8e28('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1aeb9a(null,_0x46cd0b);}},'charset':_0x8e28('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 6657c2f..2f6b728 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 _0x7917=['socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','options','raw','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','body','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x27d66e,_0x114031){var _0x4211f0=function(_0x3008ec){while(--_0x3008ec){_0x27d66e['push'](_0x27d66e['shift']());}};_0x4211f0(++_0x114031);}(_0x7917,0x6d));var _0x7791=function(_0x4090f8,_0x3df966){_0x4090f8=_0x4090f8-0x0;var _0x2a7827=_0x7917[_0x4090f8];return _0x2a7827;};'use strict';var _=require(_0x7791('0x0'));var util=require(_0x7791('0x1'));var moment=require('moment');var BPromise=require(_0x7791('0x2'));var rs=require(_0x7791('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7791('0x4'))['db'];var utils=require(_0x7791('0x5'));var logger=require('../../config/logger')(_0x7791('0x6'));var config=require(_0x7791('0x7'));var jayson=require(_0x7791('0x8'));var client=jayson[_0x7791('0x9')][_0x7791('0xa')]({'port':0x232a});config[_0x7791('0xb')]=_[_0x7791('0xc')](config[_0x7791('0xb')],{'host':_0x7791('0xd'),'port':0x18eb});var socket=require(_0x7791('0xe'))(new Redis(config['redis']));require(_0x7791('0xf'))[_0x7791('0x10')](socket);function respondWithRpcPromise(_0x2b8465,_0x48b500,_0x3766cc){return new BPromise(function(_0x96db3e,_0x547df1){return client[_0x7791('0x11')](_0x2b8465,_0x3766cc)[_0x7791('0x12')](function(_0x231e2a){logger[_0x7791('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x48b500,_0x7791('0x14'));logger[_0x7791('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x48b500,_0x7791('0x14'),JSON[_0x7791('0x16')](_0x231e2a));if(_0x231e2a[_0x7791('0x17')]){if(_0x231e2a[_0x7791('0x17')]['code']===0x1f4){logger['error'](_0x7791('0x18'),_0x48b500,_0x231e2a[_0x7791('0x17')][_0x7791('0x19')]);return _0x547df1(_0x231e2a['error'][_0x7791('0x19')]);}logger[_0x7791('0x17')](_0x7791('0x18'),_0x48b500,_0x231e2a[_0x7791('0x17')][_0x7791('0x19')]);return _0x96db3e(_0x231e2a[_0x7791('0x17')]['message']);}else{logger[_0x7791('0x13')](_0x7791('0x18'),_0x48b500,'request\x20sent');_0x96db3e(_0x231e2a[_0x7791('0x1a')][_0x7791('0x19')]);}})[_0x7791('0x1b')](function(_0x1e0736){logger[_0x7791('0x17')](_0x7791('0x18'),_0x48b500,_0x1e0736);_0x547df1(_0x1e0736);});});}exports['UpdateChatInteraction']=function(_0x14551b){var _0x1e21e4=this;return new Promise(function(_0x53df93,_0x4c182b){return db[_0x7791('0x1c')][_0x7791('0x1d')](_0x14551b['body'],{'raw':_0x14551b[_0x7791('0x1e')]?_0x14551b[_0x7791('0x1e')][_0x7791('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14551b[_0x7791('0x1e')]?_0x14551b[_0x7791('0x1e')]['where']||null:null,'attributes':_0x14551b['options']?_0x14551b[_0x7791('0x1e')]['attributes']||null:null,'limit':_0x14551b[_0x7791('0x1e')]?_0x14551b['options'][_0x7791('0x20')]||null:null})[_0x7791('0x12')](function(_0x29cf9e){logger['info']('UpdateChatInteraction',_0x14551b);logger['debug'](_0x7791('0x21'),_0x14551b,JSON[_0x7791('0x16')](_0x29cf9e));_0x53df93(_0x29cf9e);})[_0x7791('0x1b')](function(_0x51d2f9){logger[_0x7791('0x17')](_0x7791('0x21'),_0x51d2f9[_0x7791('0x19')],_0x14551b);_0x4c182b(_0x1e21e4[_0x7791('0x17')](0x1f4,_0x51d2f9[_0x7791('0x19')]));});});};exports[_0x7791('0x22')]=function(_0x14419b){return new Promise(function(_0x3a5e5f,_0x4f9ff9){return db[_0x7791('0x1c')][_0x7791('0x23')]({'where':_0x14419b[_0x7791('0x1e')]?_0x14419b[_0x7791('0x1e')]['where']||null:null})[_0x7791('0x12')](function(_0x530b70){if(_0x530b70){return _0x530b70['addTags'](_0x14419b[_0x7791('0x24')]['ids'],_[_0x7791('0x25')](_0x14419b['body'],[_0x7791('0x26'),'id'])||{});}})[_0x7791('0x27')](function(_0x57e3b6){logger[_0x7791('0x13')](_0x7791('0x28'),_0x14419b);logger[_0x7791('0x15')](_0x7791('0x28'),_0x14419b,JSON[_0x7791('0x16')](_0x57e3b6));_0x3a5e5f(_0x57e3b6);})[_0x7791('0x1b')](function(_0x47401){logger[_0x7791('0x17')](_0x7791('0x28'),_0x47401[_0x7791('0x19')],_0x14419b);_0x4f9ff9(_this[_0x7791('0x17')](0x1f4,_0x47401['message']));});});};
\ No newline at end of file
+var _0x441f=['then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','catch','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request'];(function(_0xee9a4d,_0x434e9d){var _0x3ba5c3=function(_0x3aff70){while(--_0x3aff70){_0xee9a4d['push'](_0xee9a4d['shift']());}};_0x3ba5c3(++_0x434e9d);}(_0x441f,0x12f));var _0xf441=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x441f[_0x5a99db];return _0x3aad62;};'use strict';var _=require('lodash');var util=require(_0xf441('0x0'));var moment=require('moment');var BPromise=require(_0xf441('0x1'));var rs=require(_0xf441('0x2'));var fs=require('fs');var Redis=require(_0xf441('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf441('0x4'))(_0xf441('0x5'));var config=require(_0xf441('0x6'));var jayson=require(_0xf441('0x7'));var client=jayson[_0xf441('0x8')][_0xf441('0x9')]({'port':0x232a});config[_0xf441('0xa')]=_[_0xf441('0xb')](config[_0xf441('0xa')],{'host':_0xf441('0xc'),'port':0x18eb});var socket=require(_0xf441('0xd'))(new Redis(config[_0xf441('0xa')]));require(_0xf441('0xe'))[_0xf441('0xf')](socket);function respondWithRpcPromise(_0x405458,_0x37a068,_0x453d93){return new BPromise(function(_0x29d618,_0x49ab6d){return client[_0xf441('0x10')](_0x405458,_0x453d93)[_0xf441('0x11')](function(_0x462bcb){logger['info'](_0xf441('0x12'),_0x37a068,_0xf441('0x13'));logger[_0xf441('0x14')](_0xf441('0x15'),_0x37a068,_0xf441('0x13'),JSON[_0xf441('0x16')](_0x462bcb));if(_0x462bcb[_0xf441('0x17')]){if(_0x462bcb['error']['code']===0x1f4){logger[_0xf441('0x17')](_0xf441('0x12'),_0x37a068,_0x462bcb[_0xf441('0x17')][_0xf441('0x18')]);return _0x49ab6d(_0x462bcb[_0xf441('0x17')][_0xf441('0x18')]);}logger['error'](_0xf441('0x12'),_0x37a068,_0x462bcb[_0xf441('0x17')]['message']);return _0x29d618(_0x462bcb[_0xf441('0x17')]['message']);}else{logger[_0xf441('0x19')](_0xf441('0x12'),_0x37a068,_0xf441('0x13'));_0x29d618(_0x462bcb[_0xf441('0x1a')][_0xf441('0x18')]);}})['catch'](function(_0x37bc26){logger[_0xf441('0x17')](_0xf441('0x12'),_0x37a068,_0x37bc26);_0x49ab6d(_0x37bc26);});});}exports[_0xf441('0x1b')]=function(_0x53004c){var _0xf415c9=this;return new Promise(function(_0x18f36c,_0x1fac5c){return db[_0xf441('0x1c')][_0xf441('0x1d')](_0x53004c[_0xf441('0x1e')],{'raw':_0x53004c[_0xf441('0x1f')]?_0x53004c[_0xf441('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53004c['options']?_0x53004c[_0xf441('0x1f')][_0xf441('0x20')]||null:null,'attributes':_0x53004c['options']?_0x53004c[_0xf441('0x1f')][_0xf441('0x21')]||null:null,'limit':_0x53004c[_0xf441('0x1f')]?_0x53004c[_0xf441('0x1f')]['limit']||null:null})[_0xf441('0x11')](function(_0x45cab3){logger['info'](_0xf441('0x1b'),_0x53004c);logger[_0xf441('0x14')](_0xf441('0x1b'),_0x53004c,JSON[_0xf441('0x16')](_0x45cab3));_0x18f36c(_0x45cab3);})[_0xf441('0x22')](function(_0x5b96b5){logger[_0xf441('0x17')](_0xf441('0x1b'),_0x5b96b5['message'],_0x53004c);_0x1fac5c(_0xf415c9[_0xf441('0x17')](0x1f4,_0x5b96b5[_0xf441('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x573709){return new Promise(function(_0x350f11,_0x24a6e0){return db['ChatInteraction']['find']({'where':_0x573709[_0xf441('0x1f')]?_0x573709[_0xf441('0x1f')][_0xf441('0x20')]||null:null})[_0xf441('0x11')](function(_0x210f0c){if(_0x210f0c){return _0x210f0c[_0xf441('0x23')](_0x573709[_0xf441('0x1e')][_0xf441('0x24')],_[_0xf441('0x25')](_0x573709[_0xf441('0x1e')],[_0xf441('0x24'),'id'])||{});}})[_0xf441('0x26')](function(_0xc319b6){logger[_0xf441('0x19')](_0xf441('0x27'),_0x573709);logger[_0xf441('0x14')](_0xf441('0x27'),_0x573709,JSON[_0xf441('0x16')](_0xc319b6));_0x350f11(_0xc319b6);})[_0xf441('0x22')](function(_0x53928f){logger[_0xf441('0x17')](_0xf441('0x27'),_0x53928f[_0xf441('0x18')],_0x573709);_0x24a6e0(_this[_0xf441('0x17')](0x1f4,_0x53928f[_0xf441('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index d0027b1..c60d6b3 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 _0xcb97=['save','remove','emit','removeListener','register','length','./chatInteraction.events'];(function(_0x16a7bc,_0x3ee4fb){var _0x54e51d=function(_0x37aa57){while(--_0x37aa57){_0x16a7bc['push'](_0x16a7bc['shift']());}};_0x54e51d(++_0x3ee4fb);}(_0xcb97,0x14f));var _0x7cb9=function(_0x48dba4,_0x1619e8){_0x48dba4=_0x48dba4-0x0;var _0x3ff0a0=_0xcb97[_0x48dba4];return _0x3ff0a0;};'use strict';var ChatInteractionEvents=require(_0x7cb9('0x0'));var events=[_0x7cb9('0x1'),_0x7cb9('0x2'),'update'];function createListener(_0x4bec05,_0x4b901a){return function(_0x311317){_0x4b901a[_0x7cb9('0x3')](_0x4bec05,_0x311317);};}function removeListener(_0x28e79f,_0x7e831a){return function(){ChatInteractionEvents[_0x7cb9('0x4')](_0x28e79f,_0x7e831a);};}exports[_0x7cb9('0x5')]=function(_0x1994aa){for(var _0x209a67=0x0,_0x9be7a0=events[_0x7cb9('0x6')];_0x209a67<_0x9be7a0;_0x209a67++){var _0x3ac7a6=events[_0x209a67];var _0x1402ed=createListener('chatInteraction:'+_0x3ac7a6,_0x1994aa);ChatInteractionEvents['on'](_0x3ac7a6,_0x1402ed);}};
\ No newline at end of file
+var _0xbdb0=['chatInteraction:','./chatInteraction.events','save','remove','emit','removeListener','length'];(function(_0xf6e5c5,_0x51424e){var _0x541517=function(_0x37b788){while(--_0x37b788){_0xf6e5c5['push'](_0xf6e5c5['shift']());}};_0x541517(++_0x51424e);}(_0xbdb0,0x189));var _0x0bdb=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0xbdb0[_0x147497];return _0x35f45;};'use strict';var ChatInteractionEvents=require(_0x0bdb('0x0'));var events=[_0x0bdb('0x1'),_0x0bdb('0x2'),'update'];function createListener(_0x3867c6,_0x3c39ef){return function(_0xede3c3){_0x3c39ef[_0x0bdb('0x3')](_0x3867c6,_0xede3c3);};}function removeListener(_0x361014,_0x4af929){return function(){ChatInteractionEvents[_0x0bdb('0x4')](_0x361014,_0x4af929);};}exports['register']=function(_0x168689){for(var _0x5254ca=0x0,_0x1458e4=events[_0x0bdb('0x5')];_0x5254ca<_0x1458e4;_0x5254ca++){var _0x9a24fd=events[_0x5254ca];var _0x3afa5e=createListener(_0x0bdb('0x6')+_0x9a24fd,_0x168689);ChatInteractionEvents['on'](_0x9a24fd,_0x3afa5e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 3b4ab84..0ad0265 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 _0xd709=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3fdae4,_0x16182d){var _0x5c4538=function(_0x26c46d){while(--_0x26c46d){_0x3fdae4['push'](_0x3fdae4['shift']());}};_0x5c4538(++_0x16182d);}(_0xd709,0xd6));var _0x9d70=function(_0x39e943,_0x1926ba){_0x39e943=_0x39e943-0x0;var _0x587ad7=_0xd709[_0x39e943];return _0x587ad7;};'use strict';var multer=require(_0x9d70('0x0'));var util=require(_0x9d70('0x1'));var path=require(_0x9d70('0x2'));var timeout=require(_0x9d70('0x3'));var express=require('express');var router=express[_0x9d70('0x4')]();var fs_extra=require(_0x9d70('0x5'));var auth=require(_0x9d70('0x6'));var interaction=require(_0x9d70('0x7'));var config=require(_0x9d70('0x8'));var controller=require(_0x9d70('0x9'));router['get']('/',auth[_0x9d70('0xa')](),controller[_0x9d70('0xb')]);router[_0x9d70('0xc')](_0x9d70('0xd'),auth['isAuthenticated'](),controller[_0x9d70('0xe')]);router['get'](_0x9d70('0xf'),auth[_0x9d70('0x10')](),controller[_0x9d70('0x11')]);router[_0x9d70('0xc')](_0x9d70('0x12'),auth[_0x9d70('0x10')](),controller[_0x9d70('0x13')]);router[_0x9d70('0xc')](_0x9d70('0x14'),auth['isAuthenticated'](),controller[_0x9d70('0x15')]);router[_0x9d70('0xc')](_0x9d70('0x16'),auth[_0x9d70('0x10')](),controller['getMyMessages']);router[_0x9d70('0xc')](_0x9d70('0x17'),auth[_0x9d70('0xa')](),controller[_0x9d70('0x18')]);router['post']('/',auth[_0x9d70('0xa')](),controller[_0x9d70('0x19')]);router[_0x9d70('0x1a')](_0x9d70('0x1b'),auth[_0x9d70('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x9d70('0x1c')]({'destination':function(_0x40818a,_0x19a8e4,_0x372998){_0x372998(null,path[_0x9d70('0x1d')](config[_0x9d70('0x1e')],_0x9d70('0x1f')));},'filename':function(_0x235feb,_0x52f4f9,_0x2b850e){_0x2b850e(null,util[_0x9d70('0x20')]('%s-%s',Date['now'](),_0x52f4f9['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9d70('0x1a')](_0x9d70('0x21'),upload[_0x9d70('0x22')](_0x9d70('0x23')),controller[_0x9d70('0x24')]);router[_0x9d70('0x1a')](_0x9d70('0x14'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x9d70('0x1a')](_0x9d70('0x25'),auth[_0x9d70('0xa')](),interaction[_0x9d70('0x26')](_0x9d70('0x27'),_0x9d70('0x28')),controller[_0x9d70('0x29')]);router[_0x9d70('0x2a')](_0x9d70('0xf'),auth[_0x9d70('0xa')](),interaction[_0x9d70('0x26')](_0x9d70('0x27'),_0x9d70('0x2b')),controller[_0x9d70('0x2c')]);router[_0x9d70('0x2a')]('/:id/custom_update',controller[_0x9d70('0x2d')]);router['put'](_0x9d70('0x2e'),auth['isChatInteractionAuthorized'](),controller[_0x9d70('0x2f')]);router[_0x9d70('0x2a')](_0x9d70('0x30'),controller[_0x9d70('0x31')]);router[_0x9d70('0x32')](_0x9d70('0xf'),auth[_0x9d70('0xa')](),interaction[_0x9d70('0x26')](_0x9d70('0x27'),_0x9d70('0x33')),controller[_0x9d70('0x34')]);router[_0x9d70('0x32')](_0x9d70('0x25'),auth[_0x9d70('0xa')](),controller[_0x9d70('0x35')]);module[_0x9d70('0x36')]=router;
\ No newline at end of file
+var _0x0e0f=['post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','single','attachmentUpload','addMessage','chat','addTags','put','tracked','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','delete','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x0e0f,0x1cc));var _0xf0e0=function(_0xbfd048,_0x382dbf){_0xbfd048=_0xbfd048-0x0;var _0x36bf45=_0x0e0f[_0xbfd048];return _0x36bf45;};'use strict';var multer=require(_0xf0e0('0x0'));var util=require('util');var path=require(_0xf0e0('0x1'));var timeout=require(_0xf0e0('0x2'));var express=require('express');var router=express[_0xf0e0('0x3')]();var fs_extra=require(_0xf0e0('0x4'));var auth=require(_0xf0e0('0x5'));var interaction=require(_0xf0e0('0x6'));var config=require(_0xf0e0('0x7'));var controller=require(_0xf0e0('0x8'));router[_0xf0e0('0x9')]('/',auth[_0xf0e0('0xa')](),controller[_0xf0e0('0xb')]);router[_0xf0e0('0x9')](_0xf0e0('0xc'),auth[_0xf0e0('0xa')](),controller['describe']);router['get'](_0xf0e0('0xd'),auth[_0xf0e0('0xe')](),controller['show']);router[_0xf0e0('0x9')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0xf0e0('0xf')]);router[_0xf0e0('0x9')](_0xf0e0('0x10'),auth[_0xf0e0('0xa')](),controller[_0xf0e0('0x11')]);router[_0xf0e0('0x9')]('/:id/my_messages',auth[_0xf0e0('0xe')](),controller[_0xf0e0('0x12')]);router['get'](_0xf0e0('0x13'),auth[_0xf0e0('0xa')](),controller['download']);router['post']('/',auth[_0xf0e0('0xa')](),controller['create']);router[_0xf0e0('0x14')](_0xf0e0('0x15'),auth['isAuthenticated'](),controller[_0xf0e0('0x16')]);var upload=multer({'storage':multer[_0xf0e0('0x17')]({'destination':function(_0xe50f39,_0x3aff64,_0x595348){_0x595348(null,path[_0xf0e0('0x18')](config[_0xf0e0('0x19')],_0xf0e0('0x1a')));},'filename':function(_0x477912,_0x19cbbf,_0xee0cd2){_0xee0cd2(null,util[_0xf0e0('0x1b')](_0xf0e0('0x1c'),Date[_0xf0e0('0x1d')](),_0x19cbbf['originalname'][_0xf0e0('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0xf0e0('0x1f')]('file'),controller[_0xf0e0('0x20')]);router[_0xf0e0('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xf0e0('0x21')]);router[_0xf0e0('0x14')]('/:id/tags',auth[_0xf0e0('0xa')](),interaction['tracked'](_0xf0e0('0x22'),'chatinteraction:addtags'),controller[_0xf0e0('0x23')]);router[_0xf0e0('0x24')](_0xf0e0('0xd'),auth[_0xf0e0('0xa')](),interaction[_0xf0e0('0x25')](_0xf0e0('0x22'),_0xf0e0('0x26')),controller[_0xf0e0('0x27')]);router[_0xf0e0('0x24')]('/:id/custom_update',controller[_0xf0e0('0x28')]);router[_0xf0e0('0x24')](_0xf0e0('0x29'),auth[_0xf0e0('0xe')](),controller[_0xf0e0('0x2a')]);router[_0xf0e0('0x24')]('/:id/close',controller['close']);router[_0xf0e0('0x2b')]('/:id',auth['isAuthenticated'](),interaction[_0xf0e0('0x25')]('chat','chatinteraction:destroy'),controller[_0xf0e0('0x2c')]);router[_0xf0e0('0x2b')](_0xf0e0('0x2d'),auth[_0xf0e0('0xa')](),controller[_0xf0e0('0x2e')]);module[_0xf0e0('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index e9afbe7..229ee8d 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 _0xa2bc=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x540fca,_0x54263f){var _0x15e0cc=function(_0x4ab3b5){while(--_0x4ab3b5){_0x540fca['push'](_0x540fca['shift']());}};_0x15e0cc(++_0x54263f);}(_0xa2bc,0xac));var _0xca2b=function(_0xa978e7,_0x38a984){_0xa978e7=_0xa978e7-0x0;var _0x557f98=_0xa2bc[_0xa978e7];return _0x557f98;};'use strict';var Sequelize=require(_0xca2b('0x0'));module[_0xca2b('0x1')]={'body':{'type':Sequelize[_0xca2b('0x2')](_0xca2b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xca2b('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xca2b('0x5')]}};
\ No newline at end of file
+var _0xa2df=['exports','TEXT','medium','sequelize'];(function(_0x509eeb,_0x35e432){var _0x275d4b=function(_0x4c73f6){while(--_0x4c73f6){_0x509eeb['push'](_0x509eeb['shift']());}};_0x275d4b(++_0x35e432);}(_0xa2df,0x157));var _0xfa2d=function(_0x2f5e6a,_0x555bce){_0x2f5e6a=_0x2f5e6a-0x0;var _0x1eaefc=_0xa2df[_0x2f5e6a];return _0x1eaefc;};'use strict';var Sequelize=require(_0xfa2d('0x0'));module[_0xfa2d('0x1')]={'body':{'type':Sequelize[_0xfa2d('0x2')](_0xfa2d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 59e9c8d..ff15ab0 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 _0xca9d=['sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit'];(function(_0x37e0a8,_0x184bc8){var _0x5ca63c=function(_0x1af002){while(--_0x1af002){_0x37e0a8['push'](_0x37e0a8['shift']());}};_0x5ca63c(++_0x184bc8);}(_0xca9d,0x184));var _0xdca9=function(_0x5088a2,_0x77cce5){_0x5088a2=_0x5088a2-0x0;var _0x2e6ac8=_0xca9d[_0x5088a2];return _0x2e6ac8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdca9('0x0'));var zipdir=require(_0xdca9('0x1'));var jsonpatch=require(_0xdca9('0x2'));var rp=require('request-promise');var moment=require(_0xdca9('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdca9('0x4'));var path=require('path');var sox=require(_0xdca9('0x5'));var csv=require(_0xdca9('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdca9('0x7'));var _=require(_0xdca9('0x8'));var squel=require(_0xdca9('0x9'));var crypto=require(_0xdca9('0xa'));var jsforce=require(_0xdca9('0xb'));var deskjs=require(_0xdca9('0xc'));var toCsv=require(_0xdca9('0x6'));var querystring=require('querystring');var Papa=require(_0xdca9('0xd'));var Redis=require(_0xdca9('0xe'));var authService=require(_0xdca9('0xf'));var qs=require(_0xdca9('0x10'));var as=require(_0xdca9('0x11'));var hardwareService=require(_0xdca9('0x12'));var logger=require(_0xdca9('0x13'))(_0xdca9('0x14'));var utils=require(_0xdca9('0x15'));var config=require(_0xdca9('0x16'));var licenseUtil=require(_0xdca9('0x17'));var db=require(_0xdca9('0x18'))['db'];config[_0xdca9('0x19')]=_[_0xdca9('0x1a')](config['redis'],{'host':_0xdca9('0x1b'),'port':0x18eb});var socket=require(_0xdca9('0x1c'))(new Redis(config[_0xdca9('0x19')]));require(_0xdca9('0x1d'))[_0xdca9('0x1e')](socket);function respondWithStatusCode(_0x2d899b,_0x182f6c){_0x182f6c=_0x182f6c||0xcc;return function(_0xa58ebf){if(_0xa58ebf){return _0x2d899b['sendStatus'](_0x182f6c);}return _0x2d899b[_0xdca9('0x1f')](_0x182f6c)[_0xdca9('0x20')]();};}function respondWithResult(_0x316d67,_0x5ad61e){_0x5ad61e=_0x5ad61e||0xc8;return function(_0x2d0850){if(_0x2d0850){return _0x316d67[_0xdca9('0x1f')](_0x5ad61e)[_0xdca9('0x21')](_0x2d0850);}};}function respondWithFilteredResult(_0x2bd4b3,_0x286795){return function(_0x44ef9c){if(_0x44ef9c){var _0x2ce4ba=typeof _0x286795[_0xdca9('0x22')]===_0xdca9('0x23')&&typeof _0x286795['limit']===_0xdca9('0x23');var _0x1da794=_0x44ef9c[_0xdca9('0x24')];var _0x326af8=_0x2ce4ba?0x0:_0x286795[_0xdca9('0x22')];var _0x3e8296=_0x2ce4ba?_0x44ef9c[_0xdca9('0x24')]:_0x286795['offset']+_0x286795[_0xdca9('0x25')];var _0x21094c;if(_0x3e8296>=_0x1da794){_0x3e8296=_0x1da794;_0x21094c=0xc8;}else{_0x21094c=0xce;}_0x2bd4b3[_0xdca9('0x1f')](_0x21094c);return _0x2bd4b3['set']('Content-Range',_0x326af8+'-'+_0x3e8296+'/'+_0x1da794)[_0xdca9('0x21')](_0x44ef9c);}return null;};}function patchUpdates(_0xc75ef2){return function(_0x2750b2){try{jsonpatch[_0xdca9('0x26')](_0x2750b2,_0xc75ef2,!![]);}catch(_0x525dda){return BPromise[_0xdca9('0x27')](_0x525dda);}return _0x2750b2[_0xdca9('0x28')]();};}function saveUpdates(_0x36911a,_0x4295ea){return function(_0x1ef49d){if(_0x1ef49d){return _0x1ef49d[_0xdca9('0x29')](_0x36911a)[_0xdca9('0x2a')](function(_0xbc9dc8){return _0xbc9dc8;});}return null;};}function removeEntity(_0x1b6174,_0x29a762){return function(_0x6b4b0a){if(_0x6b4b0a){return _0x6b4b0a['destroy']()[_0xdca9('0x2a')](function(){_0x1b6174[_0xdca9('0x1f')](0xcc)[_0xdca9('0x20')]();});}};}function handleEntityNotFound(_0x4d65a0,_0x1db505){return function(_0x221418){if(!_0x221418){_0x4d65a0[_0xdca9('0x2b')](0x194);}return _0x221418;};}function handleError(_0x37dd68,_0x2405cd){_0x2405cd=_0x2405cd||0x1f4;return function(_0x42f73d){logger[_0xdca9('0x2c')](_0x42f73d[_0xdca9('0x2d')]);if(_0x42f73d['name']){delete _0x42f73d[_0xdca9('0x2e')];}_0x37dd68[_0xdca9('0x1f')](_0x2405cd)[_0xdca9('0x2f')](_0x42f73d);};}exports[_0xdca9('0x30')]=function(_0x5489f6,_0xe1fe5f){var _0xdea677={},_0x2769f7={},_0x2d43ad={'count':0x0,'rows':[]};var _0x18e340=_[_0xdca9('0x31')](db[_0xdca9('0x32')][_0xdca9('0x33')],function(_0x533c31){return{'name':_0x533c31[_0xdca9('0x34')],'type':_0x533c31[_0xdca9('0x35')][_0xdca9('0x36')]};});_0x2769f7['model']=_[_0xdca9('0x31')](_0x18e340,_0xdca9('0x2e'));_0x2769f7[_0xdca9('0x37')]=_['keys'](_0x5489f6[_0xdca9('0x37')]);_0x2769f7[_0xdca9('0x38')]=_['intersection'](_0x2769f7['model'],_0x2769f7[_0xdca9('0x37')]);_0xdea677[_0xdca9('0x39')]=_[_0xdca9('0x3a')](_0x2769f7[_0xdca9('0x3b')],qs['fields'](_0x5489f6[_0xdca9('0x37')][_0xdca9('0x3c')]));_0xdea677[_0xdca9('0x39')]=_0xdea677[_0xdca9('0x39')][_0xdca9('0x3d')]?_0xdea677[_0xdca9('0x39')]:_0x2769f7[_0xdca9('0x3b')];if(!_0x5489f6['query'][_0xdca9('0x3e')](_0xdca9('0x3f'))){_0xdea677[_0xdca9('0x25')]=qs[_0xdca9('0x25')](_0x5489f6[_0xdca9('0x37')][_0xdca9('0x25')]);_0xdea677[_0xdca9('0x22')]=qs[_0xdca9('0x22')](_0x5489f6[_0xdca9('0x37')]['offset']);}_0xdea677['order']=qs[_0xdca9('0x40')](_0x5489f6[_0xdca9('0x37')][_0xdca9('0x40')]);_0xdea677[_0xdca9('0x41')]=qs['filters'](_[_0xdca9('0x42')](_0x5489f6[_0xdca9('0x37')],_0x2769f7[_0xdca9('0x38')]),_0x18e340);if(_0x5489f6[_0xdca9('0x37')][_0xdca9('0x43')]){_0xdea677[_0xdca9('0x41')]=_[_0xdca9('0x44')](_0xdea677[_0xdca9('0x41')],{'$or':_['map'](_0x18e340,function(_0x579e09){if(_0x579e09[_0xdca9('0x35')]!=='VIRTUAL'){var _0x22b72b={};_0x22b72b[_0x579e09[_0xdca9('0x2e')]]={'$like':'%'+_0x5489f6[_0xdca9('0x37')][_0xdca9('0x43')]+'%'};return _0x22b72b;}})});}_0xdea677=_[_0xdca9('0x44')]({},_0xdea677,_0x5489f6[_0xdca9('0x45')]);var _0x23b8bd={'where':_0xdea677['where']};return db[_0xdca9('0x32')][_0xdca9('0x24')](_0x23b8bd)[_0xdca9('0x2a')](function(_0x73668e){_0x2d43ad[_0xdca9('0x24')]=_0x73668e;if(_0x5489f6[_0xdca9('0x37')][_0xdca9('0x46')]){_0xdea677[_0xdca9('0x47')]=[{'all':!![]}];}return db[_0xdca9('0x32')]['findAll'](_0xdea677);})[_0xdca9('0x2a')](function(_0x33f50c){_0x2d43ad['rows']=_0x33f50c;return _0x2d43ad;})[_0xdca9('0x2a')](respondWithFilteredResult(_0xe1fe5f,_0xdea677))[_0xdca9('0x48')](handleError(_0xe1fe5f,null));};exports[_0xdca9('0x49')]=function(_0x2cb4c4,_0x308b7e){var _0x127dbc={'raw':!![],'where':{'id':_0x2cb4c4[_0xdca9('0x4a')]['id']}},_0xca5bbb={};_0xca5bbb[_0xdca9('0x3b')]=_[_0xdca9('0x4b')](db[_0xdca9('0x32')][_0xdca9('0x33')]);_0xca5bbb[_0xdca9('0x37')]=_['keys'](_0x2cb4c4[_0xdca9('0x37')]);_0xca5bbb[_0xdca9('0x38')]=_[_0xdca9('0x3a')](_0xca5bbb[_0xdca9('0x3b')],_0xca5bbb[_0xdca9('0x37')]);_0x127dbc[_0xdca9('0x39')]=_[_0xdca9('0x3a')](_0xca5bbb['model'],qs[_0xdca9('0x3c')](_0x2cb4c4['query'][_0xdca9('0x3c')]));_0x127dbc[_0xdca9('0x39')]=_0x127dbc[_0xdca9('0x39')]['length']?_0x127dbc['attributes']:_0xca5bbb[_0xdca9('0x3b')];if(_0x2cb4c4[_0xdca9('0x37')][_0xdca9('0x46')]){_0x127dbc[_0xdca9('0x47')]=[{'all':!![]}];}_0x127dbc=_[_0xdca9('0x44')]({},_0x127dbc,_0x2cb4c4[_0xdca9('0x45')]);return db['ChatInternalMessage'][_0xdca9('0x4c')](_0x127dbc)[_0xdca9('0x2a')](handleEntityNotFound(_0x308b7e,null))[_0xdca9('0x2a')](respondWithResult(_0x308b7e,null))[_0xdca9('0x48')](handleError(_0x308b7e,null));};exports[_0xdca9('0x4d')]=function(_0x2257d3,_0x5d102b){return db[_0xdca9('0x32')][_0xdca9('0x4d')](_0x2257d3[_0xdca9('0x4e')],{})[_0xdca9('0x2a')](respondWithResult(_0x5d102b,0xc9))[_0xdca9('0x48')](handleError(_0x5d102b,null));};exports[_0xdca9('0x29')]=function(_0x14c1d5,_0x1d9fc7){if(_0x14c1d5['body']['id']){delete _0x14c1d5[_0xdca9('0x4e')]['id'];}return db[_0xdca9('0x32')][_0xdca9('0x4c')]({'where':{'id':_0x14c1d5[_0xdca9('0x4a')]['id']}})[_0xdca9('0x2a')](handleEntityNotFound(_0x1d9fc7,null))[_0xdca9('0x2a')](saveUpdates(_0x14c1d5[_0xdca9('0x4e')],null))['then'](respondWithResult(_0x1d9fc7,null))['catch'](handleError(_0x1d9fc7,null));};exports[_0xdca9('0x4f')]=function(_0x44806c,_0x30d17e){return db[_0xdca9('0x32')][_0xdca9('0x4c')]({'where':{'id':_0x44806c[_0xdca9('0x4a')]['id']}})[_0xdca9('0x2a')](handleEntityNotFound(_0x30d17e,null))['then'](removeEntity(_0x30d17e,null))['catch'](handleError(_0x30d17e,null));};exports[_0xdca9('0x50')]=function(_0x299722,_0x5cd6d2){return db[_0xdca9('0x32')][_0xdca9('0x50')]()[_0xdca9('0x2a')](respondWithResult(_0x5cd6d2,null))[_0xdca9('0x48')](handleError(_0x5cd6d2,null));};function wrapUser(_0x33b762){return function(_0x41f3ae){var _0x527b96=_0x33b762[_0xdca9('0x51')]({'plain':!![]});_0x527b96[_0xdca9('0x52')]=[];if(_0x41f3ae){_0x527b96[_0xdca9('0x53')]=_0x41f3ae[_0xdca9('0x54')];_0x527b96[_0xdca9('0x55')]=_0x41f3ae;}else{_0x527b96['lastMessageAt']=moment(0x0)[_0xdca9('0x56')](_0xdca9('0x57'));_0x527b96[_0xdca9('0x55')]={};}return _0x527b96;};}exports['getUsers']=function(_0x463ae7,_0x43329a,_0xc52268){var _0x23dfd0=[];return db[_0xdca9('0x58')][_0xdca9('0x59')]({'where':{'role':['agent',_0xdca9('0x5a'),_0xdca9('0x5b')]},'attributes':['id',_0xdca9('0x5c'),_0xdca9('0x2e'),_0xdca9('0x5d'),_0xdca9('0x5e'),'internal','online',_0xdca9('0x5f'),_0xdca9('0x60'),_0xdca9('0x61')],'order':qs[_0xdca9('0x40')](_0xdca9('0x62')),'include':[{'model':db[_0xdca9('0x63')],'as':_0xdca9('0x64'),'attributes':['id',_0xdca9('0x2e'),'type'],'through':{'attributes':[]}}]})[_0xdca9('0x2a')](function(_0x39b540){if(_0x39b540){var _0xc697d=_0x463ae7[_0xdca9('0x5b')]['get']({'plain':!![]});if(!_0xc697d)throw new Error(_0xdca9('0x65'));if(_0xc697d['role']===_0xdca9('0x5b')){return db[_0xdca9('0x66')][_0xdca9('0x4c')]({'where':{'name':_0xdca9('0x67'),'userProfileId':_0xc697d[_0xdca9('0x68')]},'raw':!![]})[_0xdca9('0x2a')](function(_0x372903){if(_0x372903){if(_0x372903[_0xdca9('0x69')]===0x0){return db[_0xdca9('0x6a')]['findAll']({'where':{'sectionId':_0x372903['id']},'raw':!![]})['then'](function(_0x7160f5){var _0x4ab539=[];if(_[_0xdca9('0x6b')](_0x7160f5)){_0x4ab539=_['filter'](_0x39b540,function(_0x57c461){if(_0x57c461['role']!=='agent'){return _0x57c461;}});return _0x4ab539;}else{for(var _0x53f0c3=0x0;_0x53f0c3<_0x39b540[_0xdca9('0x3d')];_0x53f0c3++){var _0x13e681=_0x39b540[_0x53f0c3];if(_0x13e681[_0xdca9('0x5d')]===_0xdca9('0x6c')){var _0x3d195f=_[_0xdca9('0x4c')](_0x7160f5,function(_0x4f3421){return _0x4f3421[_0xdca9('0x6d')]===_0x13e681['id'];});if(_0x3d195f)_0x4ab539['push'](_0x13e681);}else{_0x4ab539[_0xdca9('0x6e')](_0x13e681);}}return _0x4ab539;}});}else{return _0x39b540;}}else{var _0x4fce88=_[_0xdca9('0x43')](_0x39b540,function(_0x1c7caf){if(_0x1c7caf[_0xdca9('0x5d')]!==_0xdca9('0x6c')){return _0x1c7caf;}});return _0x4fce88;}});}else{return _0x39b540;}}})[_0xdca9('0x2a')](function(_0x32fa0a){var _0x143b5c=[];if(_0x32fa0a){_0x23dfd0=_0x32fa0a;for(var _0x4caec3=0x0;_0x4caec3<_0x32fa0a[_0xdca9('0x3d')];_0x4caec3+=0x1){_0x23dfd0[_0x4caec3][_0xdca9('0x52')]=[];_0x143b5c['push'](db[_0xdca9('0x32')][_0xdca9('0x4c')]({'where':{'FromId':[_0x463ae7[_0xdca9('0x5b')]['id'],_0x32fa0a[_0x4caec3]['id']],'ToId':[_0x463ae7[_0xdca9('0x5b')]['id'],_0x32fa0a[_0x4caec3]['id']],'ChatGroupId':null},'attributes':['id',_0xdca9('0x54'),_0xdca9('0x6f'),_0xdca9('0x70'),'read',_0xdca9('0x4e')],'order':qs[_0xdca9('0x40')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdca9('0x2a')](wrapUser(_0x32fa0a[_0x4caec3])));}return BPromise['all'](_0x143b5c);}return[];})[_0xdca9('0x2a')](function(_0x29b6a5){return{'rows':_0x29b6a5,'count':_0x29b6a5[_0xdca9('0x3d')]};})[_0xdca9('0x2a')](respondWithResult(_0x43329a,null))[_0xdca9('0x48')](handleError(_0x43329a,null));};
\ No newline at end of file
+var _0xbdab=['type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','update','then','error','stack','name','send','index','map','fieldName','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','rawAttributes','length','create','body','find','params','describe','get','messages','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xbdab,0x79));var _0xbbda=function(_0x4e21ac,_0x9a1cc2){_0x4e21ac=_0x4e21ac-0x0;var _0x52cfe3=_0xbdab[_0x4e21ac];return _0x52cfe3;};'use strict';var emlformat=require(_0xbbda('0x0'));var rimraf=require(_0xbbda('0x1'));var zipdir=require(_0xbbda('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbda('0x3'));var moment=require(_0xbbda('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbbda('0x5'));var util=require('util');var path=require(_0xbbda('0x6'));var sox=require('sox');var csv=require(_0xbbda('0x7'));var ejs=require(_0xbbda('0x8'));var fs=require('fs');var fs_extra=require(_0xbbda('0x9'));var _=require(_0xbbda('0xa'));var squel=require(_0xbbda('0xb'));var crypto=require(_0xbbda('0xc'));var jsforce=require(_0xbbda('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbbda('0x7'));var querystring=require(_0xbbda('0xe'));var Papa=require(_0xbbda('0xf'));var Redis=require(_0xbbda('0x10'));var authService=require(_0xbbda('0x11'));var qs=require(_0xbbda('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbbda('0x13'));var logger=require('../../config/logger')(_0xbbda('0x14'));var utils=require(_0xbbda('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbbda('0x16'));var db=require('../../mysqldb')['db'];config[_0xbbda('0x17')]=_[_0xbbda('0x18')](config[_0xbbda('0x17')],{'host':_0xbbda('0x19'),'port':0x18eb});var socket=require(_0xbbda('0x1a'))(new Redis(config[_0xbbda('0x17')]));require(_0xbbda('0x1b'))[_0xbbda('0x1c')](socket);function respondWithStatusCode(_0x3d02ff,_0x4a944a){_0x4a944a=_0x4a944a||0xcc;return function(_0x4aa8cb){if(_0x4aa8cb){return _0x3d02ff[_0xbbda('0x1d')](_0x4a944a);}return _0x3d02ff[_0xbbda('0x1e')](_0x4a944a)[_0xbbda('0x1f')]();};}function respondWithResult(_0x2add39,_0x4b64e2){_0x4b64e2=_0x4b64e2||0xc8;return function(_0x70ecb0){if(_0x70ecb0){return _0x2add39[_0xbbda('0x1e')](_0x4b64e2)['json'](_0x70ecb0);}};}function respondWithFilteredResult(_0x5a0a8e,_0x1bd0e2){return function(_0x226770){if(_0x226770){var _0x3ce4ab=typeof _0x1bd0e2['offset']===_0xbbda('0x20')&&typeof _0x1bd0e2[_0xbbda('0x21')]===_0xbbda('0x20');var _0x39d7e2=_0x226770[_0xbbda('0x22')];var _0x240e60=_0x3ce4ab?0x0:_0x1bd0e2[_0xbbda('0x23')];var _0x593202=_0x3ce4ab?_0x226770[_0xbbda('0x22')]:_0x1bd0e2[_0xbbda('0x23')]+_0x1bd0e2['limit'];var _0x4f07c4;if(_0x593202>=_0x39d7e2){_0x593202=_0x39d7e2;_0x4f07c4=0xc8;}else{_0x4f07c4=0xce;}_0x5a0a8e[_0xbbda('0x1e')](_0x4f07c4);return _0x5a0a8e[_0xbbda('0x24')]('Content-Range',_0x240e60+'-'+_0x593202+'/'+_0x39d7e2)[_0xbbda('0x25')](_0x226770);}return null;};}function patchUpdates(_0x1a899c){return function(_0xc60791){try{jsonpatch['apply'](_0xc60791,_0x1a899c,!![]);}catch(_0x2d1f03){return BPromise[_0xbbda('0x26')](_0x2d1f03);}return _0xc60791['save']();};}function saveUpdates(_0x13ac11,_0x23f45e){return function(_0x1fa799){if(_0x1fa799){return _0x1fa799[_0xbbda('0x27')](_0x13ac11)['then'](function(_0x2f9ea4){return _0x2f9ea4;});}return null;};}function removeEntity(_0x4cad15,_0x561499){return function(_0x551516){if(_0x551516){return _0x551516['destroy']()[_0xbbda('0x28')](function(){_0x4cad15[_0xbbda('0x1e')](0xcc)[_0xbbda('0x1f')]();});}};}function handleEntityNotFound(_0x1fabfe,_0x1b5e13){return function(_0x12eca9){if(!_0x12eca9){_0x1fabfe[_0xbbda('0x1d')](0x194);}return _0x12eca9;};}function handleError(_0x1d10a0,_0x4136f9){_0x4136f9=_0x4136f9||0x1f4;return function(_0x2d1bb4){logger[_0xbbda('0x29')](_0x2d1bb4[_0xbbda('0x2a')]);if(_0x2d1bb4[_0xbbda('0x2b')]){delete _0x2d1bb4['name'];}_0x1d10a0[_0xbbda('0x1e')](_0x4136f9)[_0xbbda('0x2c')](_0x2d1bb4);};}exports[_0xbbda('0x2d')]=function(_0x3a6405,_0x526b29){var _0x10c1b1={},_0x21e953={},_0x364c88={'count':0x0,'rows':[]};var _0xd8c985=_[_0xbbda('0x2e')](db['ChatInternalMessage']['rawAttributes'],function(_0x41895e){return{'name':_0x41895e[_0xbbda('0x2f')],'type':_0x41895e['type']['key']};});_0x21e953[_0xbbda('0x30')]=_[_0xbbda('0x2e')](_0xd8c985,'name');_0x21e953[_0xbbda('0x31')]=_['keys'](_0x3a6405[_0xbbda('0x31')]);_0x21e953['filters']=_['intersection'](_0x21e953[_0xbbda('0x30')],_0x21e953[_0xbbda('0x31')]);_0x10c1b1[_0xbbda('0x32')]=_[_0xbbda('0x33')](_0x21e953[_0xbbda('0x30')],qs['fields'](_0x3a6405[_0xbbda('0x31')][_0xbbda('0x34')]));_0x10c1b1[_0xbbda('0x32')]=_0x10c1b1[_0xbbda('0x32')]['length']?_0x10c1b1[_0xbbda('0x32')]:_0x21e953[_0xbbda('0x30')];if(!_0x3a6405[_0xbbda('0x31')][_0xbbda('0x35')](_0xbbda('0x36'))){_0x10c1b1['limit']=qs['limit'](_0x3a6405['query'][_0xbbda('0x21')]);_0x10c1b1[_0xbbda('0x23')]=qs['offset'](_0x3a6405[_0xbbda('0x31')][_0xbbda('0x23')]);}_0x10c1b1[_0xbbda('0x37')]=qs['sort'](_0x3a6405['query'][_0xbbda('0x38')]);_0x10c1b1[_0xbbda('0x39')]=qs[_0xbbda('0x3a')](_[_0xbbda('0x3b')](_0x3a6405[_0xbbda('0x31')],_0x21e953['filters']),_0xd8c985);if(_0x3a6405['query'][_0xbbda('0x3c')]){_0x10c1b1['where']=_[_0xbbda('0x3d')](_0x10c1b1[_0xbbda('0x39')],{'$or':_[_0xbbda('0x2e')](_0xd8c985,function(_0x538680){if(_0x538680['type']!==_0xbbda('0x3e')){var _0x126158={};_0x126158[_0x538680['name']]={'$like':'%'+_0x3a6405['query'][_0xbbda('0x3c')]+'%'};return _0x126158;}})});}_0x10c1b1=_[_0xbbda('0x3d')]({},_0x10c1b1,_0x3a6405[_0xbbda('0x3f')]);var _0x290bdb={'where':_0x10c1b1[_0xbbda('0x39')]};return db[_0xbbda('0x40')]['count'](_0x290bdb)[_0xbbda('0x28')](function(_0x50633b){_0x364c88['count']=_0x50633b;if(_0x3a6405['query'][_0xbbda('0x41')]){_0x10c1b1[_0xbbda('0x42')]=[{'all':!![]}];}return db[_0xbbda('0x40')][_0xbbda('0x43')](_0x10c1b1);})[_0xbbda('0x28')](function(_0x418e29){_0x364c88[_0xbbda('0x44')]=_0x418e29;return _0x364c88;})[_0xbbda('0x28')](respondWithFilteredResult(_0x526b29,_0x10c1b1))[_0xbbda('0x45')](handleError(_0x526b29,null));};exports[_0xbbda('0x46')]=function(_0x12077f,_0x51e060){var _0x431b7b={'raw':!![],'where':{'id':_0x12077f['params']['id']}},_0x35bad4={};_0x35bad4[_0xbbda('0x30')]=_['keys'](db[_0xbbda('0x40')][_0xbbda('0x47')]);_0x35bad4['query']=_['keys'](_0x12077f[_0xbbda('0x31')]);_0x35bad4[_0xbbda('0x3a')]=_[_0xbbda('0x33')](_0x35bad4['model'],_0x35bad4[_0xbbda('0x31')]);_0x431b7b[_0xbbda('0x32')]=_['intersection'](_0x35bad4[_0xbbda('0x30')],qs[_0xbbda('0x34')](_0x12077f[_0xbbda('0x31')][_0xbbda('0x34')]));_0x431b7b[_0xbbda('0x32')]=_0x431b7b[_0xbbda('0x32')][_0xbbda('0x48')]?_0x431b7b[_0xbbda('0x32')]:_0x35bad4['model'];if(_0x12077f[_0xbbda('0x31')][_0xbbda('0x41')]){_0x431b7b['include']=[{'all':!![]}];}_0x431b7b=_[_0xbbda('0x3d')]({},_0x431b7b,_0x12077f['options']);return db['ChatInternalMessage']['find'](_0x431b7b)[_0xbbda('0x28')](handleEntityNotFound(_0x51e060,null))['then'](respondWithResult(_0x51e060,null))[_0xbbda('0x45')](handleError(_0x51e060,null));};exports['create']=function(_0x3d5e02,_0x55c467){return db['ChatInternalMessage'][_0xbbda('0x49')](_0x3d5e02['body'],{})['then'](respondWithResult(_0x55c467,0xc9))['catch'](handleError(_0x55c467,null));};exports[_0xbbda('0x27')]=function(_0x155a65,_0x2d3155){if(_0x155a65[_0xbbda('0x4a')]['id']){delete _0x155a65['body']['id'];}return db['ChatInternalMessage'][_0xbbda('0x4b')]({'where':{'id':_0x155a65['params']['id']}})[_0xbbda('0x28')](handleEntityNotFound(_0x2d3155,null))['then'](saveUpdates(_0x155a65[_0xbbda('0x4a')],null))[_0xbbda('0x28')](respondWithResult(_0x2d3155,null))[_0xbbda('0x45')](handleError(_0x2d3155,null));};exports['destroy']=function(_0x8c19be,_0x5a7d32){return db[_0xbbda('0x40')][_0xbbda('0x4b')]({'where':{'id':_0x8c19be[_0xbbda('0x4c')]['id']}})[_0xbbda('0x28')](handleEntityNotFound(_0x5a7d32,null))[_0xbbda('0x28')](removeEntity(_0x5a7d32,null))['catch'](handleError(_0x5a7d32,null));};exports[_0xbbda('0x4d')]=function(_0x596405,_0x3899ef){return db[_0xbbda('0x40')][_0xbbda('0x4d')]()[_0xbbda('0x28')](respondWithResult(_0x3899ef,null))[_0xbbda('0x45')](handleError(_0x3899ef,null));};function wrapUser(_0x458a17){return function(_0x1296a1){var _0x15be53=_0x458a17[_0xbbda('0x4e')]({'plain':!![]});_0x15be53[_0xbbda('0x4f')]=[];if(_0x1296a1){_0x15be53['lastMessageAt']=_0x1296a1['createdAt'];_0x15be53['lastMessage']=_0x1296a1;}else{_0x15be53['lastMessageAt']=moment(0x0)[_0xbbda('0x50')](_0xbbda('0x51'));_0x15be53[_0xbbda('0x52')]={};}return _0x15be53;};}exports['getUsers']=function(_0x367158,_0x321bed,_0x1008ae){var _0x92877a=[];return db[_0xbbda('0x53')][_0xbbda('0x43')]({'where':{'role':[_0xbbda('0x54'),_0xbbda('0x55'),'user']},'attributes':['id',_0xbbda('0x56'),_0xbbda('0x2b'),_0xbbda('0x57'),_0xbbda('0x58'),_0xbbda('0x59'),_0xbbda('0x5a'),'lastLoginAt',_0xbbda('0x5b'),_0xbbda('0x5c')],'order':qs[_0xbbda('0x38')](_0xbbda('0x5d')),'include':[{'model':db[_0xbbda('0x5e')],'as':'VoiceQueues','attributes':['id',_0xbbda('0x2b'),_0xbbda('0x5f')],'through':{'attributes':[]}}]})[_0xbbda('0x28')](function(_0x26488a){if(_0x26488a){var _0x42d430=_0x367158[_0xbbda('0x60')][_0xbbda('0x4e')]({'plain':!![]});if(!_0x42d430)throw new Error(_0xbbda('0x61'));if(_0x42d430['role']===_0xbbda('0x60')){return db['UserProfileSection'][_0xbbda('0x4b')]({'where':{'name':_0xbbda('0x62'),'userProfileId':_0x42d430[_0xbbda('0x63')]},'raw':!![]})['then'](function(_0x364bdc){if(_0x364bdc){if(_0x364bdc[_0xbbda('0x64')]===0x0){return db['UserProfileResource'][_0xbbda('0x43')]({'where':{'sectionId':_0x364bdc['id']},'raw':!![]})[_0xbbda('0x28')](function(_0x11da10){var _0x3b49a0=[];if(_[_0xbbda('0x65')](_0x11da10)){_0x3b49a0=_[_0xbbda('0x3c')](_0x26488a,function(_0x137ed1){if(_0x137ed1[_0xbbda('0x57')]!=='agent'){return _0x137ed1;}});return _0x3b49a0;}else{for(var _0x17ee37=0x0;_0x17ee37<_0x26488a['length'];_0x17ee37++){var _0x4aba20=_0x26488a[_0x17ee37];if(_0x4aba20[_0xbbda('0x57')]===_0xbbda('0x54')){var _0x5b8213=_[_0xbbda('0x4b')](_0x11da10,function(_0x451fb4){return _0x451fb4[_0xbbda('0x66')]===_0x4aba20['id'];});if(_0x5b8213)_0x3b49a0[_0xbbda('0x67')](_0x4aba20);}else{_0x3b49a0[_0xbbda('0x67')](_0x4aba20);}}return _0x3b49a0;}});}else{return _0x26488a;}}else{var _0x2fd64c=_['filter'](_0x26488a,function(_0x1cdc63){if(_0x1cdc63[_0xbbda('0x57')]!==_0xbbda('0x54')){return _0x1cdc63;}});return _0x2fd64c;}});}else{return _0x26488a;}}})[_0xbbda('0x28')](function(_0x59a8f1){var _0xff6d3c=[];if(_0x59a8f1){_0x92877a=_0x59a8f1;for(var _0x1dcff9=0x0;_0x1dcff9<_0x59a8f1[_0xbbda('0x48')];_0x1dcff9+=0x1){_0x92877a[_0x1dcff9][_0xbbda('0x4f')]=[];_0xff6d3c['push'](db[_0xbbda('0x40')][_0xbbda('0x4b')]({'where':{'FromId':[_0x367158[_0xbbda('0x60')]['id'],_0x59a8f1[_0x1dcff9]['id']],'ToId':[_0x367158[_0xbbda('0x60')]['id'],_0x59a8f1[_0x1dcff9]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xbbda('0x68'),_0xbbda('0x69'),_0xbbda('0x6a'),_0xbbda('0x4a')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbbda('0x28')](wrapUser(_0x59a8f1[_0x1dcff9])));}return BPromise[_0xbbda('0x6b')](_0xff6d3c);}return[];})[_0xbbda('0x28')](function(_0x30da31){return{'rows':_0x30da31,'count':_0x30da31[_0xbbda('0x48')]};})[_0xbbda('0x28')](respondWithResult(_0x321bed,null))[_0xbbda('0x45')](handleError(_0x321bed,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 701320b..617d19b 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 _0xe137=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x2b9557,_0x8143ac){var _0x5939c4=function(_0x227087){while(--_0x227087){_0x2b9557['push'](_0x2b9557['shift']());}};_0x5939c4(++_0x8143ac);}(_0xe137,0xb3));var _0x7e13=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0xe137[_0x5192de];return _0x4e287e;};'use strict';var EventEmitter=require(_0x7e13('0x0'));var ChatInternalMessage=require(_0x7e13('0x1'))['db'][_0x7e13('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7e13('0x3')](0x0);var events={'afterCreate':_0x7e13('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xbadfac){return function(_0x4bbfd9,_0x3e4871,_0x515228){ChatInternalMessageEvents['emit'](_0xbadfac+':'+_0x4bbfd9['id'],_0x4bbfd9);ChatInternalMessageEvents['emit'](_0xbadfac,_0x4bbfd9);_0x515228(null);};}for(var e in events){if(events[_0x7e13('0x5')](e)){var event=events[e];ChatInternalMessage[_0x7e13('0x6')](e,emitEvent(event));}}module[_0x7e13('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x3d27=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x170cea,_0xb78475){var _0x6436d0=function(_0x56ce69){while(--_0x56ce69){_0x170cea['push'](_0x170cea['shift']());}};_0x6436d0(++_0xb78475);}(_0x3d27,0x7c));var _0x73d2=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x3d27[_0x3cbe1c];return _0x5ee08b;};'use strict';var EventEmitter=require(_0x73d2('0x0'));var ChatInternalMessage=require(_0x73d2('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x73d2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x73d2('0x3'),'afterDestroy':_0x73d2('0x4')};function emitEvent(_0x1a3dce){return function(_0x27f43d,_0x2549cc,_0x591082){ChatInternalMessageEvents[_0x73d2('0x5')](_0x1a3dce+':'+_0x27f43d['id'],_0x27f43d);ChatInternalMessageEvents['emit'](_0x1a3dce,_0x27f43d);_0x591082(null);};}for(var e in events){if(events[_0x73d2('0x6')](e)){var event=events[e];ChatInternalMessage[_0x73d2('0x7')](e,emitEvent(event));}}module[_0x73d2('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 013aec4..6fabb4e 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 _0x6f96=['bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x6f96,0x172));var _0x66f9=function(_0x4c16ec,_0x3a43bd){_0x4c16ec=_0x4c16ec-0x0;var _0x219a9a=_0x6f96[_0x4c16ec];return _0x219a9a;};'use strict';var _=require(_0x66f9('0x0'));var util=require(_0x66f9('0x1'));var logger=require(_0x66f9('0x2'))(_0x66f9('0x3'));var moment=require(_0x66f9('0x4'));var BPromise=require(_0x66f9('0x5'));var rp=require(_0x66f9('0x6'));var fs=require('fs');var path=require(_0x66f9('0x7'));var rimraf=require('rimraf');var config=require(_0x66f9('0x8'));var attributes=require(_0x66f9('0x9'));module['exports']=function(_0x2f4c99,_0x26d599){return _0x2f4c99[_0x66f9('0xa')](_0x66f9('0xb'),attributes,{'tableName':_0x66f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x66f9('0xd'),'collate':_0x66f9('0xe')});};
\ No newline at end of file
+var _0xf04d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5627eb,_0x3dd952){var _0x458797=function(_0x9fbdf4){while(--_0x9fbdf4){_0x5627eb['push'](_0x5627eb['shift']());}};_0x458797(++_0x3dd952);}(_0xf04d,0x16a));var _0xdf04=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0xf04d[_0x561f25];return _0x150e4c;};'use strict';var _=require(_0xdf04('0x0'));var util=require(_0xdf04('0x1'));var logger=require(_0xdf04('0x2'))(_0xdf04('0x3'));var moment=require(_0xdf04('0x4'));var BPromise=require(_0xdf04('0x5'));var rp=require(_0xdf04('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf04('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xdf04('0x8')]=function(_0x594ada,_0x3ae8d8){return _0x594ada[_0xdf04('0x9')](_0xdf04('0xa'),attributes,{'tableName':_0xdf04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdf04('0xc'),'collate':_0xdf04('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9cb9f53..27d4cf6 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 _0x530a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','info','result','util'];(function(_0x19f670,_0x36d23f){var _0x3ffd49=function(_0x5d9e05){while(--_0x5d9e05){_0x19f670['push'](_0x19f670['shift']());}};_0x3ffd49(++_0x36d23f);}(_0x530a,0x81));var _0xa530=function(_0x2758c0,_0x54e50d){_0x2758c0=_0x2758c0-0x0;var _0x258d9e=_0x530a[_0x2758c0];return _0x258d9e;};'use strict';var _=require('lodash');var util=require(_0xa530('0x0'));var moment=require(_0xa530('0x1'));var BPromise=require(_0xa530('0x2'));var rs=require(_0xa530('0x3'));var fs=require('fs');var Redis=require(_0xa530('0x4'));var db=require(_0xa530('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa530('0x6'))(_0xa530('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa530('0x8')][_0xa530('0x9')]({'port':0x232a});config['redis']=_[_0xa530('0xa')](config[_0xa530('0xb')],{'host':_0xa530('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa530('0xb')]));require(_0xa530('0xd'))[_0xa530('0xe')](socket);function respondWithRpcPromise(_0x18887a,_0x55606e,_0x6a7687){return new BPromise(function(_0x5e6107,_0x247c1d){return client[_0xa530('0xf')](_0x18887a,_0x6a7687)[_0xa530('0x10')](function(_0x153a1c){logger['info'](_0xa530('0x11'),_0x55606e,'request\x20sent');logger[_0xa530('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x55606e,_0xa530('0x13'),JSON[_0xa530('0x14')](_0x153a1c));if(_0x153a1c['error']){if(_0x153a1c['error'][_0xa530('0x15')]===0x1f4){logger[_0xa530('0x16')](_0xa530('0x11'),_0x55606e,_0x153a1c[_0xa530('0x16')][_0xa530('0x17')]);return _0x247c1d(_0x153a1c['error']['message']);}logger['error'](_0xa530('0x11'),_0x55606e,_0x153a1c['error'][_0xa530('0x17')]);return _0x5e6107(_0x153a1c[_0xa530('0x16')][_0xa530('0x17')]);}else{logger[_0xa530('0x18')](_0xa530('0x11'),_0x55606e,_0xa530('0x13'));_0x5e6107(_0x153a1c[_0xa530('0x19')][_0xa530('0x17')]);}})['catch'](function(_0xfbcba0){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x55606e,_0xfbcba0);_0x247c1d(_0xfbcba0);});});}
\ No newline at end of file
+var _0x0ba7=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info'];(function(_0x38370a,_0x226474){var _0x24fd54=function(_0x5e43b0){while(--_0x5e43b0){_0x38370a['push'](_0x38370a['shift']());}};_0x24fd54(++_0x226474);}(_0x0ba7,0x16d));var _0x70ba=function(_0x538af2,_0x333205){_0x538af2=_0x538af2-0x0;var _0x308960=_0x0ba7[_0x538af2];return _0x308960;};'use strict';var _=require(_0x70ba('0x0'));var util=require('util');var moment=require(_0x70ba('0x1'));var BPromise=require(_0x70ba('0x2'));var rs=require(_0x70ba('0x3'));var fs=require('fs');var Redis=require(_0x70ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x70ba('0x5'));var logger=require(_0x70ba('0x6'))(_0x70ba('0x7'));var config=require(_0x70ba('0x8'));var jayson=require(_0x70ba('0x9'));var client=jayson[_0x70ba('0xa')][_0x70ba('0xb')]({'port':0x232a});config[_0x70ba('0xc')]=_[_0x70ba('0xd')](config[_0x70ba('0xc')],{'host':_0x70ba('0xe'),'port':0x18eb});var socket=require(_0x70ba('0xf'))(new Redis(config[_0x70ba('0xc')]));require(_0x70ba('0x10'))[_0x70ba('0x11')](socket);function respondWithRpcPromise(_0x5dd8cb,_0x38f104,_0x4de64d){return new BPromise(function(_0x3fe801,_0x258604){return client[_0x70ba('0x12')](_0x5dd8cb,_0x4de64d)[_0x70ba('0x13')](function(_0x593fe9){logger['info'](_0x70ba('0x14'),_0x38f104,'request\x20sent');logger[_0x70ba('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x38f104,_0x70ba('0x16'),JSON[_0x70ba('0x17')](_0x593fe9));if(_0x593fe9['error']){if(_0x593fe9[_0x70ba('0x18')]['code']===0x1f4){logger[_0x70ba('0x18')](_0x70ba('0x14'),_0x38f104,_0x593fe9[_0x70ba('0x18')][_0x70ba('0x19')]);return _0x258604(_0x593fe9[_0x70ba('0x18')][_0x70ba('0x19')]);}logger[_0x70ba('0x18')](_0x70ba('0x14'),_0x38f104,_0x593fe9[_0x70ba('0x18')][_0x70ba('0x19')]);return _0x3fe801(_0x593fe9[_0x70ba('0x18')][_0x70ba('0x19')]);}else{logger[_0x70ba('0x1a')](_0x70ba('0x14'),_0x38f104,'request\x20sent');_0x3fe801(_0x593fe9['result']['message']);}})[_0x70ba('0x1b')](function(_0x2dd33a){logger[_0x70ba('0x18')](_0x70ba('0x14'),_0x38f104,_0x2dd33a);_0x258604(_0x2dd33a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index dc68feb..bcc5936 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 _0xb187=['length','./chatInternalMessage.events','remove','update','removeListener'];(function(_0x212cc8,_0x593d9d){var _0x4cc4d9=function(_0x5626b5){while(--_0x5626b5){_0x212cc8['push'](_0x212cc8['shift']());}};_0x4cc4d9(++_0x593d9d);}(_0xb187,0x128));var _0x7b18=function(_0x50b66d,_0x11c61c){_0x50b66d=_0x50b66d-0x0;var _0x41aa8e=_0xb187[_0x50b66d];return _0x41aa8e;};'use strict';var ChatInternalMessageEvents=require(_0x7b18('0x0'));var events=['save',_0x7b18('0x1'),_0x7b18('0x2')];function createListener(_0xdae1e,_0x34c247){return function(_0x5c1dbd){_0x34c247['emit'](_0xdae1e,_0x5c1dbd);};}function removeListener(_0x5d8b68,_0x52c756){return function(){ChatInternalMessageEvents[_0x7b18('0x3')](_0x5d8b68,_0x52c756);};}exports['register']=function(_0x4ed057){for(var _0x1455ee=0x0,_0x2ade1b=events[_0x7b18('0x4')];_0x1455ee<_0x2ade1b;_0x1455ee++){var _0xebf1af=events[_0x1455ee];var _0x5a7d1b=createListener('chatInternalMessage:'+_0xebf1af,_0x4ed057);ChatInternalMessageEvents['on'](_0xebf1af,_0x5a7d1b);}};
\ No newline at end of file
+var _0xdceb=['length','chatInternalMessage:','remove','update','emit','register'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0xdceb,0xb6));var _0xbdce=function(_0x158785,_0x1cd5a8){_0x158785=_0x158785-0x0;var _0x202bb3=_0xdceb[_0x158785];return _0x202bb3;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xbdce('0x0'),_0xbdce('0x1')];function createListener(_0x5f4b0c,_0x1520db){return function(_0xe1ec07){_0x1520db[_0xbdce('0x2')](_0x5f4b0c,_0xe1ec07);};}function removeListener(_0x1485cc,_0x198c01){return function(){ChatInternalMessageEvents['removeListener'](_0x1485cc,_0x198c01);};}exports[_0xbdce('0x3')]=function(_0x24f477){for(var _0x9525cd=0x0,_0xec8394=events[_0xbdce('0x4')];_0x9525cd<_0xec8394;_0x9525cd++){var _0x165029=events[_0x9525cd];var _0x1c1067=createListener(_0xbdce('0x5')+_0x165029,_0x24f477);ChatInternalMessageEvents['on'](_0x165029,_0x1c1067);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index b074f15..b0c717c 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 _0x5591=['post','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','/:id'];(function(_0x30e403,_0x200281){var _0x38ec4b=function(_0x4f62ab){while(--_0x4f62ab){_0x30e403['push'](_0x30e403['shift']());}};_0x38ec4b(++_0x200281);}(_0x5591,0x196));var _0x1559=function(_0xaaf6a3,_0x46bf1c){_0xaaf6a3=_0xaaf6a3-0x0;var _0x255dbe=_0x5591[_0xaaf6a3];return _0x255dbe;};'use strict';var multer=require(_0x1559('0x0'));var util=require(_0x1559('0x1'));var path=require(_0x1559('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1559('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1559('0x4'));var config=require(_0x1559('0x5'));var controller=require(_0x1559('0x6'));router[_0x1559('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1559('0x7')](_0x1559('0x8'),auth[_0x1559('0x9')](),controller['describe']);router['get'](_0x1559('0xa'),auth[_0x1559('0x9')](),controller['getUsers']);router['get'](_0x1559('0xb'),auth[_0x1559('0x9')](),controller['show']);router[_0x1559('0xc')]('/',auth[_0x1559('0x9')](),controller[_0x1559('0xd')]);router[_0x1559('0xe')]('/:id',controller[_0x1559('0xf')]);router[_0x1559('0x10')](_0x1559('0xb'),auth[_0x1559('0x9')](),controller[_0x1559('0x11')]);module[_0x1559('0x12')]=router;
\ No newline at end of file
+var _0x7da1=['update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','describe','/users','getUsers','/:id','show','post','create','put'];(function(_0x55864a,_0xf552bf){var _0x22a9b0=function(_0x17890a){while(--_0x17890a){_0x55864a['push'](_0x55864a['shift']());}};_0x22a9b0(++_0xf552bf);}(_0x7da1,0x1bb));var _0x17da=function(_0x2b1c60,_0x505cd2){_0x2b1c60=_0x2b1c60-0x0;var _0x3caefa=_0x7da1[_0x2b1c60];return _0x3caefa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x17da('0x0'));var timeout=require(_0x17da('0x1'));var express=require(_0x17da('0x2'));var router=express[_0x17da('0x3')]();var fs_extra=require(_0x17da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x17da('0x5'));var config=require(_0x17da('0x6'));var controller=require(_0x17da('0x7'));router['get']('/',auth[_0x17da('0x8')](),controller[_0x17da('0x9')]);router[_0x17da('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x17da('0xb')]);router[_0x17da('0xa')](_0x17da('0xc'),auth[_0x17da('0x8')](),controller[_0x17da('0xd')]);router['get'](_0x17da('0xe'),auth[_0x17da('0x8')](),controller[_0x17da('0xf')]);router[_0x17da('0x10')]('/',auth[_0x17da('0x8')](),controller[_0x17da('0x11')]);router[_0x17da('0x12')](_0x17da('0xe'),controller[_0x17da('0x13')]);router[_0x17da('0x14')](_0x17da('0xe'),auth['isAuthenticated'](),controller[_0x17da('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 846b422..d5bff34 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 _0x9d5b=['BOOLEAN','out','DATE','STRING','exports','TEXT','medium'];(function(_0xa46e5a,_0x5786d6){var _0x57c35c=function(_0x3fbf2d){while(--_0x3fbf2d){_0xa46e5a['push'](_0xa46e5a['shift']());}};_0x57c35c(++_0x5786d6);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x5ae2c9,_0x197fe8){_0x5ae2c9=_0x5ae2c9-0x0;var _0x55e4f3=_0x9d5b[_0x5ae2c9];return _0x55e4f3;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'body':{'type':Sequelize[_0xb9d5('0x1')](_0xb9d5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9d5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb9d5('0x5')]},'providerName':{'type':Sequelize[_0xb9d5('0x6')]},'providerResponse':{'type':Sequelize[_0xb9d5('0x1')]}};
\ No newline at end of file
+var _0xe2cf=['ENUM','out','STRING','TEXT','exports','medium','BOOLEAN'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x4deff,_0x42c328){_0x4deff=_0x4deff-0x0;var _0x440123=_0xe2cf[_0x4deff];return _0x440123;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'body':{'type':Sequelize['TEXT'](_0xfe2c('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfe2c('0x3')]('in',_0xfe2c('0x4')),'defaultValue':_0xfe2c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xfe2c('0x5')]},'providerResponse':{'type':Sequelize[_0xfe2c('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 328ba1a..c7fb946 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 _0x14e4=['chat','read','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','interaction','formData','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','internal','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','reject','update','name','index','map','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','ChatMessage','findAll','rows','params','keys','rawAttributes','includeAll','find','create','body','destroy','describe','../../config/logger','chat-interactions','accept'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x14e4,0xa2));var _0x414e=function(_0x55095d,_0x33366d){_0x55095d=_0x55095d-0x0;var _0x50adb2=_0x14e4[_0x55095d];return _0x50adb2;};'use strict';var emlformat=require(_0x414e('0x0'));var rimraf=require(_0x414e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x414e('0x2'));var rp=require(_0x414e('0x3'));var moment=require(_0x414e('0x4'));var BPromise=require(_0x414e('0x5'));var Mustache=require(_0x414e('0x6'));var util=require(_0x414e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x414e('0x8'));var ejs=require(_0x414e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x414e('0xa'));var squel=require('squel');var crypto=require(_0x414e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x414e('0x8'));var querystring=require(_0x414e('0xc'));var Papa=require(_0x414e('0xd'));var Redis=require(_0x414e('0xe'));var authService=require(_0x414e('0xf'));var qs=require(_0x414e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x414e('0x11'));var logger=require('../../config/logger')(_0x414e('0x12'));var utils=require(_0x414e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x414e('0x14'));var db=require(_0x414e('0x15'))['db'];config[_0x414e('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x414e('0x17'))(new Redis(config[_0x414e('0x16')]));require(_0x414e('0x18'))[_0x414e('0x19')](socket);var jayson=require(_0x414e('0x1a'));var client=jayson[_0x414e('0x1b')][_0x414e('0x1c')]({'port':0x232c});var client9002=jayson[_0x414e('0x1b')][_0x414e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x35130a,_0x281ed5,_0x59a1d9,_0x38d2cb){return new BPromise(function(_0x3ff732,_0x204525){var _0x3d4b01=_0x38d2cb||client;return _0x3d4b01[_0x414e('0x1d')](_0x35130a,_0x59a1d9)[_0x414e('0x1e')](function(_0x523012){logger[_0x414e('0x1f')](_0x414e('0x20'),_0x281ed5,_0x414e('0x21'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x281ed5,_0x414e('0x21'),JSON[_0x414e('0x22')](_0x523012));if(_0x523012[_0x414e('0x23')]){if(_0x523012[_0x414e('0x23')][_0x414e('0x24')]===0x1f4){logger[_0x414e('0x23')]('ChatMessage,\x20%s,\x20%s',_0x281ed5,_0x523012['error']['message']);return _0x204525(_0x523012[_0x414e('0x23')][_0x414e('0x25')]);}logger[_0x414e('0x23')](_0x414e('0x20'),_0x281ed5,_0x523012[_0x414e('0x23')][_0x414e('0x25')]);return _0x3ff732(_0x523012[_0x414e('0x23')][_0x414e('0x25')]);}else{logger[_0x414e('0x1f')](_0x414e('0x20'),_0x281ed5,_0x414e('0x21'));_0x3ff732(_0x523012[_0x414e('0x26')][_0x414e('0x25')]);}})[_0x414e('0x27')](function(_0x567faa){logger[_0x414e('0x23')](_0x414e('0x20'),_0x281ed5,_0x567faa);_0x204525(_0x567faa);});});}function respondWithStatusCode(_0x137966,_0x1616ac){_0x1616ac=_0x1616ac||0xcc;return function(_0x465655){if(_0x465655){return _0x137966[_0x414e('0x28')](_0x1616ac);}return _0x137966['status'](_0x1616ac)[_0x414e('0x29')]();};}function respondWithResult(_0x2cd5e3,_0x2db290){_0x2db290=_0x2db290||0xc8;return function(_0x10f8d6){if(_0x10f8d6){return _0x2cd5e3[_0x414e('0x2a')](_0x2db290)['json'](_0x10f8d6);}};}function respondWithFilteredResult(_0x3724cd,_0x290922){return function(_0x4f9f8a){if(_0x4f9f8a){var _0xa01f4=typeof _0x290922[_0x414e('0x2b')]===_0x414e('0x2c')&&typeof _0x290922['limit']===_0x414e('0x2c');var _0x594f12=_0x4f9f8a[_0x414e('0x2d')];var _0x3662ea=_0xa01f4?0x0:_0x290922[_0x414e('0x2b')];var _0x6314c0=_0xa01f4?_0x4f9f8a[_0x414e('0x2d')]:_0x290922[_0x414e('0x2b')]+_0x290922[_0x414e('0x2e')];var _0xc88a30;if(_0x6314c0>=_0x594f12){_0x6314c0=_0x594f12;_0xc88a30=0xc8;}else{_0xc88a30=0xce;}_0x3724cd[_0x414e('0x2a')](_0xc88a30);return _0x3724cd[_0x414e('0x2f')](_0x414e('0x30'),_0x3662ea+'-'+_0x6314c0+'/'+_0x594f12)['json'](_0x4f9f8a);}return null;};}function patchUpdates(_0x465e2b){return function(_0x43f9c9){try{jsonpatch['apply'](_0x43f9c9,_0x465e2b,!![]);}catch(_0x2cbb85){return BPromise[_0x414e('0x31')](_0x2cbb85);}return _0x43f9c9['save']();};}function saveUpdates(_0x2febdb,_0x3e0b3d){return function(_0x3436b9){if(_0x3436b9){return _0x3436b9[_0x414e('0x32')](_0x2febdb)[_0x414e('0x1e')](function(_0x367b00){return _0x367b00;});}return null;};}function removeEntity(_0x41de63,_0x2eb647){return function(_0x4229f3){if(_0x4229f3){return _0x4229f3['destroy']()[_0x414e('0x1e')](function(){_0x41de63[_0x414e('0x2a')](0xcc)[_0x414e('0x29')]();});}};}function handleEntityNotFound(_0x31bf1a,_0x12beba){return function(_0x110c77){if(!_0x110c77){_0x31bf1a[_0x414e('0x28')](0x194);}return _0x110c77;};}function handleError(_0x2d68eb,_0x1202f7){_0x1202f7=_0x1202f7||0x1f4;return function(_0x10bf04){logger[_0x414e('0x23')](_0x10bf04['stack']);if(_0x10bf04[_0x414e('0x33')]){delete _0x10bf04[_0x414e('0x33')];}_0x2d68eb['status'](_0x1202f7)['send'](_0x10bf04);};}exports[_0x414e('0x34')]=function(_0x950f9f,_0x328349){var _0x455b87={},_0x341606={},_0xb8a07b={'count':0x0,'rows':[]};var _0x70f3b4=_[_0x414e('0x35')](db['ChatMessage']['rawAttributes'],function(_0x229a58){return{'name':_0x229a58['fieldName'],'type':_0x229a58[_0x414e('0x36')][_0x414e('0x37')]};});_0x341606[_0x414e('0x38')]=_['map'](_0x70f3b4,_0x414e('0x33'));_0x341606['query']=_['keys'](_0x950f9f['query']);_0x341606[_0x414e('0x39')]=_[_0x414e('0x3a')](_0x341606[_0x414e('0x38')],_0x341606[_0x414e('0x3b')]);_0x455b87[_0x414e('0x3c')]=_[_0x414e('0x3a')](_0x341606['model'],qs[_0x414e('0x3d')](_0x950f9f['query'][_0x414e('0x3d')]));_0x455b87[_0x414e('0x3c')]=_0x455b87[_0x414e('0x3c')][_0x414e('0x3e')]?_0x455b87['attributes']:_0x341606[_0x414e('0x38')];if(!_0x950f9f[_0x414e('0x3b')][_0x414e('0x3f')](_0x414e('0x40'))){_0x455b87[_0x414e('0x2e')]=qs[_0x414e('0x2e')](_0x950f9f[_0x414e('0x3b')][_0x414e('0x2e')]);_0x455b87[_0x414e('0x2b')]=qs[_0x414e('0x2b')](_0x950f9f[_0x414e('0x3b')][_0x414e('0x2b')]);}_0x455b87['order']=qs[_0x414e('0x41')](_0x950f9f[_0x414e('0x3b')]['sort']);_0x455b87[_0x414e('0x42')]=qs[_0x414e('0x39')](_[_0x414e('0x43')](_0x950f9f[_0x414e('0x3b')],_0x341606[_0x414e('0x39')]),_0x70f3b4);if(_0x950f9f[_0x414e('0x3b')][_0x414e('0x44')]){_0x455b87['where']=_[_0x414e('0x45')](_0x455b87[_0x414e('0x42')],{'$or':_[_0x414e('0x35')](_0x70f3b4,function(_0x2e238b){if(_0x2e238b[_0x414e('0x36')]!==_0x414e('0x46')){var _0x26eb9b={};_0x26eb9b[_0x2e238b['name']]={'$like':'%'+_0x950f9f[_0x414e('0x3b')][_0x414e('0x44')]+'%'};return _0x26eb9b;}})});}_0x455b87=_[_0x414e('0x45')]({},_0x455b87,_0x950f9f[_0x414e('0x47')]);var _0x3a0e55={'where':_0x455b87['where']};return db['ChatMessage'][_0x414e('0x2d')](_0x3a0e55)[_0x414e('0x1e')](function(_0x225dc5){_0xb8a07b[_0x414e('0x2d')]=_0x225dc5;if(_0x950f9f[_0x414e('0x3b')]['includeAll']){_0x455b87[_0x414e('0x48')]=[{'all':!![]}];}return db[_0x414e('0x49')][_0x414e('0x4a')](_0x455b87);})[_0x414e('0x1e')](function(_0x62057f){_0xb8a07b[_0x414e('0x4b')]=_0x62057f;return _0xb8a07b;})[_0x414e('0x1e')](respondWithFilteredResult(_0x328349,_0x455b87))[_0x414e('0x27')](handleError(_0x328349,null));};exports['show']=function(_0x36bdf6,_0x285b9a){var _0x55bbdc={'raw':!![],'where':{'id':_0x36bdf6[_0x414e('0x4c')]['id']}},_0x255f02={};_0x255f02[_0x414e('0x38')]=_[_0x414e('0x4d')](db[_0x414e('0x49')][_0x414e('0x4e')]);_0x255f02['query']=_['keys'](_0x36bdf6['query']);_0x255f02[_0x414e('0x39')]=_[_0x414e('0x3a')](_0x255f02[_0x414e('0x38')],_0x255f02[_0x414e('0x3b')]);_0x55bbdc[_0x414e('0x3c')]=_[_0x414e('0x3a')](_0x255f02[_0x414e('0x38')],qs[_0x414e('0x3d')](_0x36bdf6[_0x414e('0x3b')]['fields']));_0x55bbdc[_0x414e('0x3c')]=_0x55bbdc['attributes'][_0x414e('0x3e')]?_0x55bbdc[_0x414e('0x3c')]:_0x255f02['model'];if(_0x36bdf6[_0x414e('0x3b')][_0x414e('0x4f')]){_0x55bbdc[_0x414e('0x48')]=[{'all':!![]}];}_0x55bbdc=_[_0x414e('0x45')]({},_0x55bbdc,_0x36bdf6[_0x414e('0x47')]);return db[_0x414e('0x49')][_0x414e('0x50')](_0x55bbdc)[_0x414e('0x1e')](handleEntityNotFound(_0x285b9a,null))['then'](respondWithResult(_0x285b9a,null))['catch'](handleError(_0x285b9a,null));};exports[_0x414e('0x51')]=function(_0x24a468,_0x5db87a){return db[_0x414e('0x49')]['create'](_0x24a468[_0x414e('0x52')],{})[_0x414e('0x1e')](respondWithResult(_0x5db87a,0xc9))[_0x414e('0x27')](handleError(_0x5db87a,null));};exports[_0x414e('0x32')]=function(_0x2dd996,_0x4717e6){if(_0x2dd996['body']['id']){delete _0x2dd996[_0x414e('0x52')]['id'];}return db[_0x414e('0x49')][_0x414e('0x50')]({'where':{'id':_0x2dd996['params']['id']}})['then'](handleEntityNotFound(_0x4717e6,null))[_0x414e('0x1e')](saveUpdates(_0x2dd996[_0x414e('0x52')],null))[_0x414e('0x1e')](respondWithResult(_0x4717e6,null))[_0x414e('0x27')](handleError(_0x4717e6,null));};exports[_0x414e('0x53')]=function(_0x107e8e,_0xcac6cc){return db[_0x414e('0x49')]['find']({'where':{'id':_0x107e8e[_0x414e('0x4c')]['id']}})['then'](handleEntityNotFound(_0xcac6cc,null))[_0x414e('0x1e')](removeEntity(_0xcac6cc,null))['catch'](handleError(_0xcac6cc,null));};exports[_0x414e('0x54')]=function(_0x1ed6a7,_0x270df4){return db[_0x414e('0x49')][_0x414e('0x54')]()[_0x414e('0x1e')](respondWithResult(_0x270df4,null))['catch'](handleError(_0x270df4,null));};var interaction_log=require(_0x414e('0x55'))(_0x414e('0x56'));exports[_0x414e('0x57')]=function(_0x283211,_0x56c853,_0x503898){var _0x4728e1={'agent':{},'channel':_0x414e('0x58')};if(_0x283211[_0x414e('0x52')]['id']){delete _0x283211[_0x414e('0x52')]['id'];}_0x283211['body'][_0x414e('0x59')]=!![];_0x283211[_0x414e('0x52')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x283211[_0x414e('0x52')]['UserId']=_0x283211[_0x414e('0x52')][_0x414e('0x5a')]||_0x283211[_0x414e('0x5b')]['id'];_0x4728e1[_0x414e('0x5c')]['id']=_0x283211[_0x414e('0x52')][_0x414e('0x5a')];return db[_0x414e('0x49')][_0x414e('0x50')]({'where':{'id':_0x283211[_0x414e('0x4c')]['id'],'UserId':null}})[_0x414e('0x1e')](handleEntityNotFound(_0x56c853,null))[_0x414e('0x1e')](saveUpdates(_0x283211[_0x414e('0x52')],null))[_0x414e('0x1e')](function(_0x19430a){if(_0x19430a){_0x4728e1[_0x414e('0x25')]=_0x19430a[_0x414e('0x5d')]({'plain':!![]});return db[_0x414e('0x5e')][_0x414e('0x50')]({'where':{'id':_0x19430a[_0x414e('0x5f')]}});}return null;})[_0x414e('0x1e')](handleEntityNotFound(_0x56c853,null))[_0x414e('0x1e')](function(_0x194abd){if(_0x194abd){return _0x194abd[_0x414e('0x32')]({'UserId':_0x283211[_0x414e('0x52')][_0x414e('0x5a')],'read1stAt':_['isNil'](_0x194abd[_0x414e('0x60')])?moment()[_0x414e('0x61')](_0x414e('0x62')):undefined});}return null;})[_0x414e('0x1e')](function(_0x592a8d){if(_0x592a8d){_0x4728e1['interaction']=_0x592a8d[_0x414e('0x5d')]({'plain':!![]});interaction_log[_0x414e('0x1f')](_0x414e('0x63'),_0x283211[_0x414e('0x5b')]['id'],_0x283211[_0x414e('0x5b')]['name'],_0x283211['user'][_0x414e('0x64')],_0x4728e1['interaction']['id'],_0x283211[_0x414e('0x52')]?JSON[_0x414e('0x22')](_0x283211[_0x414e('0x52')]):_0x414e('0x65'));return respondWithRpcPromise(_0x414e('0x66'),_0x414e('0x67'),_0x4728e1);}return null;})[_0x414e('0x1e')](function(_0x20c5ea){var _0x5d1a71='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20c5ea['message'][_0x414e('0x68')];return db['sequelize'][_0x414e('0x3b')](_0x5d1a71,{'type':db[_0x414e('0x69')][_0x414e('0x6a')][_0x414e('0x6b')],'raw':!![]})['then'](function(_0x115028){return _0x115028;});})['then'](function(_0x2f3c86){if(_0x2f3c86){_0x4728e1['message']['contact']=_0x2f3c86[0x0];if(!_0x283211[_0x414e('0x52')]['UserId'])return;return db[_0x414e('0x6c')]['find']({'where':{'id':_0x283211[_0x414e('0x52')][_0x414e('0x5a')],'role':_0x414e('0x5c')},'attributes':['id','name',_0x414e('0x6d'),_0x414e('0x6e'),'internal'],'raw':!![]});}return null;})[_0x414e('0x1e')](function(_0xbcc910){if(!_0xbcc910)return null;_0x4728e1[_0x414e('0x25')][_0x414e('0x5c')]=_0xbcc910;return _0x4728e1;})[_0x414e('0x1e')](function(_0x1bddc4){if(_0x1bddc4){if(_0x283211[_0x414e('0x52')]['manual']){_0x4728e1['message'][_0x414e('0x6f')]=util[_0x414e('0x61')]('SIP/%s',_0x283211[_0x414e('0x5b')][_0x414e('0x33')]);_0x4728e1[_0x414e('0x25')]['channel']=_0x4728e1[_0x414e('0x70')];_0x4728e1[_0x414e('0x25')][_0x414e('0x71')]=_0x4728e1[_0x414e('0x70')];_0x4728e1[_0x414e('0x25')][_0x414e('0x72')]='accept';return respondWithRpcPromise(_0x414e('0x73'),'EventManager',{'event':_0x414e('0x74'),'message':_[_0x414e('0x45')](_0x4728e1['message'],JSON[_0x414e('0x75')](_0x4728e1[_0x414e('0x76')][_0x414e('0x77')]))},client9002)[_0x414e('0x1e')](function(){return _0x4728e1;});}return _0x4728e1;}return null;})[_0x414e('0x1e')](respondWithResult(_0x56c853,null))['catch'](handleError(_0x56c853,null));};var interaction_log=require(_0x414e('0x55'))('chat-interactions');exports[_0x414e('0x31')]=function(_0x3a5a59,_0x5d9f51,_0x493c61){var _0x3f8968={'agent':{},'channel':'chat'};if(_0x3a5a59['body']['id']){delete _0x3a5a59['body']['id'];}_0x3a5a59['body'][_0x414e('0x5a')]=_0x3a5a59['body'][_0x414e('0x5a')]||_0x3a5a59[_0x414e('0x5b')]['id'];_0x3f8968[_0x414e('0x5c')]['id']=_0x3a5a59[_0x414e('0x52')][_0x414e('0x5a')];return db['ChatMessage']['find']({'where':{'id':_0x3a5a59[_0x414e('0x4c')]['id'],'UserId':null}})[_0x414e('0x1e')](handleEntityNotFound(_0x5d9f51,null))[_0x414e('0x1e')](function(_0x1a9dbe){if(_0x1a9dbe){_0x3f8968['message']=_0x1a9dbe[_0x414e('0x5d')]({'plain':!![]});return db[_0x414e('0x5e')]['find']({'where':{'id':_0x1a9dbe[_0x414e('0x5f')]}});}return null;})[_0x414e('0x1e')](handleEntityNotFound(_0x5d9f51,null))[_0x414e('0x1e')](function(_0x20f8c8){if(_0x20f8c8){_0x3f8968['interaction']=_0x20f8c8[_0x414e('0x5d')]({'plain':!![]});interaction_log[_0x414e('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a5a59[_0x414e('0x5b')]['id'],_0x3a5a59[_0x414e('0x5b')]['name'],_0x3a5a59[_0x414e('0x5b')][_0x414e('0x64')],_0x3f8968[_0x414e('0x76')]['id'],_0x3a5a59['body']?JSON['stringify'](_0x3a5a59[_0x414e('0x52')]):_0x414e('0x65'));return respondWithRpcPromise('RejectMessage',_0x414e('0x78'),_0x3f8968);}return null;})['then'](function(_0x23b756){var _0x12882d=_0x414e('0x79')+_0x23b756[_0x414e('0x25')][_0x414e('0x68')];return db[_0x414e('0x7a')][_0x414e('0x3b')](_0x12882d,{'type':db['Sequelize'][_0x414e('0x6a')][_0x414e('0x6b')],'raw':!![]})[_0x414e('0x1e')](function(_0x1db1ed){return _0x1db1ed;});})['then'](function(_0x34db37){if(_0x34db37){_0x3f8968[_0x414e('0x25')][_0x414e('0x7b')]=_0x34db37[0x0];if(!_0x3a5a59[_0x414e('0x52')][_0x414e('0x5a')])return;return db[_0x414e('0x6c')][_0x414e('0x50')]({'where':{'id':_0x3a5a59['body'][_0x414e('0x5a')],'role':_0x414e('0x5c')},'attributes':['id',_0x414e('0x33'),_0x414e('0x6d'),_0x414e('0x6e'),_0x414e('0x7c')],'raw':!![]});}return null;})[_0x414e('0x1e')](function(_0x251862){if(!_0x251862)return null;_0x3f8968[_0x414e('0x25')][_0x414e('0x5c')]=_0x251862;return _0x3f8968;})[_0x414e('0x1e')](function(_0x2fe2f4){if(_0x2fe2f4){_0x2fe2f4[_0x414e('0x25')][_0x414e('0x6f')]=util[_0x414e('0x61')]('SIP/%s',_0x3a5a59[_0x414e('0x5b')]['name']);_0x2fe2f4[_0x414e('0x25')][_0x414e('0x70')]=_0x3f8968[_0x414e('0x70')];_0x2fe2f4['message']['motionChannel']=_0x3f8968['channel'];_0x2fe2f4[_0x414e('0x25')][_0x414e('0x72')]=_0x414e('0x31');respondWithRpcPromise(_0x414e('0x73'),_0x414e('0x73'),{'event':'rejectmessage','message':_[_0x414e('0x45')](_0x3f8968['message'],JSON['parse'](_0x3f8968['interaction'][_0x414e('0x77')]))},client9002);return _0x3f8968;}return null;})['then'](respondWithResult(_0x5d9f51,null))[_0x414e('0x27')](handleError(_0x5d9f51,null));};
\ No newline at end of file
+var _0x7599=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','then','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','end','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','params','include','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','RejectMessage','rejectMessage','ContactId','contact','fullname','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x7843c8,_0x2e73cf){var _0x238f6d=function(_0x5624e9){while(--_0x5624e9){_0x7843c8['push'](_0x7843c8['shift']());}};_0x238f6d(++_0x2e73cf);}(_0x7599,0xfb));var _0x9759=function(_0x56435d,_0x34da28){_0x56435d=_0x56435d-0x0;var _0x5b9a61=_0x7599[_0x56435d];return _0x5b9a61;};'use strict';var emlformat=require(_0x9759('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9759('0x1'));var jsonpatch=require(_0x9759('0x2'));var rp=require(_0x9759('0x3'));var moment=require(_0x9759('0x4'));var BPromise=require(_0x9759('0x5'));var Mustache=require(_0x9759('0x6'));var util=require(_0x9759('0x7'));var path=require(_0x9759('0x8'));var sox=require(_0x9759('0x9'));var csv=require(_0x9759('0xa'));var ejs=require(_0x9759('0xb'));var fs=require('fs');var fs_extra=require(_0x9759('0xc'));var _=require(_0x9759('0xd'));var squel=require(_0x9759('0xe'));var crypto=require(_0x9759('0xf'));var jsforce=require(_0x9759('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9759('0xa'));var querystring=require(_0x9759('0x11'));var Papa=require(_0x9759('0x12'));var Redis=require(_0x9759('0x13'));var authService=require(_0x9759('0x14'));var qs=require(_0x9759('0x15'));var as=require(_0x9759('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9759('0x17'))(_0x9759('0x18'));var utils=require('../../config/utils');var config=require(_0x9759('0x19'));var licenseUtil=require(_0x9759('0x1a'));var db=require(_0x9759('0x1b'))['db'];config[_0x9759('0x1c')]=_['defaults'](config[_0x9759('0x1c')],{'host':_0x9759('0x1d'),'port':0x18eb});var socket=require(_0x9759('0x1e'))(new Redis(config[_0x9759('0x1c')]));require(_0x9759('0x1f'))['register'](socket);var jayson=require(_0x9759('0x20'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x9759('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4f6eea,_0x4b4e93,_0x38c2c8,_0x2c72b6){return new BPromise(function(_0x484670,_0x21672b){var _0x23063d=_0x2c72b6||client;return _0x23063d['request'](_0x4f6eea,_0x38c2c8)[_0x9759('0x22')](function(_0x1d979f){logger['info'](_0x9759('0x23'),_0x4b4e93,'request\x20sent');logger['debug'](_0x9759('0x24'),_0x4b4e93,_0x9759('0x25'),JSON['stringify'](_0x1d979f));if(_0x1d979f[_0x9759('0x26')]){if(_0x1d979f['error'][_0x9759('0x27')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4b4e93,_0x1d979f['error'][_0x9759('0x28')]);return _0x21672b(_0x1d979f[_0x9759('0x26')][_0x9759('0x28')]);}logger['error'](_0x9759('0x23'),_0x4b4e93,_0x1d979f[_0x9759('0x26')][_0x9759('0x28')]);return _0x484670(_0x1d979f[_0x9759('0x26')][_0x9759('0x28')]);}else{logger[_0x9759('0x29')]('ChatMessage,\x20%s,\x20%s',_0x4b4e93,_0x9759('0x25'));_0x484670(_0x1d979f['result']['message']);}})[_0x9759('0x2a')](function(_0x442449){logger[_0x9759('0x26')](_0x9759('0x23'),_0x4b4e93,_0x442449);_0x21672b(_0x442449);});});}function respondWithStatusCode(_0xcafab1,_0x19de1f){_0x19de1f=_0x19de1f||0xcc;return function(_0x52bea5){if(_0x52bea5){return _0xcafab1[_0x9759('0x2b')](_0x19de1f);}return _0xcafab1[_0x9759('0x2c')](_0x19de1f)['end']();};}function respondWithResult(_0x22c49e,_0x4c66d4){_0x4c66d4=_0x4c66d4||0xc8;return function(_0x7e1bf8){if(_0x7e1bf8){return _0x22c49e['status'](_0x4c66d4)[_0x9759('0x2d')](_0x7e1bf8);}};}function respondWithFilteredResult(_0x59f84c,_0x3042af){return function(_0x3e24a2){if(_0x3e24a2){var _0x3f8153=typeof _0x3042af[_0x9759('0x2e')]===_0x9759('0x2f')&&typeof _0x3042af[_0x9759('0x30')]===_0x9759('0x2f');var _0xbb0507=_0x3e24a2['count'];var _0x47a5ee=_0x3f8153?0x0:_0x3042af[_0x9759('0x2e')];var _0x2cef99=_0x3f8153?_0x3e24a2['count']:_0x3042af[_0x9759('0x2e')]+_0x3042af['limit'];var _0x5e9bf0;if(_0x2cef99>=_0xbb0507){_0x2cef99=_0xbb0507;_0x5e9bf0=0xc8;}else{_0x5e9bf0=0xce;}_0x59f84c['status'](_0x5e9bf0);return _0x59f84c[_0x9759('0x31')](_0x9759('0x32'),_0x47a5ee+'-'+_0x2cef99+'/'+_0xbb0507)[_0x9759('0x2d')](_0x3e24a2);}return null;};}function patchUpdates(_0x3a0660){return function(_0x55bb89){try{jsonpatch[_0x9759('0x33')](_0x55bb89,_0x3a0660,!![]);}catch(_0x476677){return BPromise['reject'](_0x476677);}return _0x55bb89[_0x9759('0x34')]();};}function saveUpdates(_0x8da52c,_0x4c0b11){return function(_0x166672){if(_0x166672){return _0x166672[_0x9759('0x35')](_0x8da52c)[_0x9759('0x22')](function(_0x30ac73){return _0x30ac73;});}return null;};}function removeEntity(_0x378549,_0xb327bb){return function(_0x325332){if(_0x325332){return _0x325332[_0x9759('0x36')]()[_0x9759('0x22')](function(){_0x378549['status'](0xcc)[_0x9759('0x37')]();});}};}function handleEntityNotFound(_0x34f6f1,_0x1efcf7){return function(_0x16ff2b){if(!_0x16ff2b){_0x34f6f1[_0x9759('0x2b')](0x194);}return _0x16ff2b;};}function handleError(_0x3a476a,_0xae15e8){_0xae15e8=_0xae15e8||0x1f4;return function(_0x498c1a){logger[_0x9759('0x26')](_0x498c1a['stack']);if(_0x498c1a[_0x9759('0x38')]){delete _0x498c1a['name'];}_0x3a476a[_0x9759('0x2c')](_0xae15e8)[_0x9759('0x39')](_0x498c1a);};}exports[_0x9759('0x3a')]=function(_0x105981,_0x4cfb1a){var _0x1069bc={},_0x3bc37d={},_0x231cd9={'count':0x0,'rows':[]};var _0x1202fe=_['map'](db[_0x9759('0x3b')][_0x9759('0x3c')],function(_0x5ade40){return{'name':_0x5ade40[_0x9759('0x3d')],'type':_0x5ade40[_0x9759('0x3e')][_0x9759('0x3f')]};});_0x3bc37d[_0x9759('0x40')]=_[_0x9759('0x41')](_0x1202fe,_0x9759('0x38'));_0x3bc37d[_0x9759('0x42')]=_[_0x9759('0x43')](_0x105981[_0x9759('0x42')]);_0x3bc37d[_0x9759('0x44')]=_[_0x9759('0x45')](_0x3bc37d[_0x9759('0x40')],_0x3bc37d[_0x9759('0x42')]);_0x1069bc[_0x9759('0x46')]=_[_0x9759('0x45')](_0x3bc37d[_0x9759('0x40')],qs[_0x9759('0x47')](_0x105981['query'][_0x9759('0x47')]));_0x1069bc[_0x9759('0x46')]=_0x1069bc['attributes'][_0x9759('0x48')]?_0x1069bc[_0x9759('0x46')]:_0x3bc37d['model'];if(!_0x105981[_0x9759('0x42')][_0x9759('0x49')](_0x9759('0x4a'))){_0x1069bc[_0x9759('0x30')]=qs['limit'](_0x105981[_0x9759('0x42')]['limit']);_0x1069bc[_0x9759('0x2e')]=qs[_0x9759('0x2e')](_0x105981[_0x9759('0x42')][_0x9759('0x2e')]);}_0x1069bc['order']=qs[_0x9759('0x4b')](_0x105981['query'][_0x9759('0x4b')]);_0x1069bc[_0x9759('0x4c')]=qs[_0x9759('0x44')](_[_0x9759('0x4d')](_0x105981[_0x9759('0x42')],_0x3bc37d[_0x9759('0x44')]),_0x1202fe);if(_0x105981[_0x9759('0x42')][_0x9759('0x4e')]){_0x1069bc[_0x9759('0x4c')]=_[_0x9759('0x4f')](_0x1069bc[_0x9759('0x4c')],{'$or':_['map'](_0x1202fe,function(_0x3c279e){if(_0x3c279e[_0x9759('0x3e')]!==_0x9759('0x50')){var _0x45e7a4={};_0x45e7a4[_0x3c279e[_0x9759('0x38')]]={'$like':'%'+_0x105981['query'][_0x9759('0x4e')]+'%'};return _0x45e7a4;}})});}_0x1069bc=_[_0x9759('0x4f')]({},_0x1069bc,_0x105981[_0x9759('0x51')]);var _0x595285={'where':_0x1069bc['where']};return db[_0x9759('0x3b')][_0x9759('0x52')](_0x595285)[_0x9759('0x22')](function(_0x584173){_0x231cd9[_0x9759('0x52')]=_0x584173;if(_0x105981[_0x9759('0x42')][_0x9759('0x53')]){_0x1069bc['include']=[{'all':!![]}];}return db[_0x9759('0x3b')][_0x9759('0x54')](_0x1069bc);})[_0x9759('0x22')](function(_0x5321f2){_0x231cd9['rows']=_0x5321f2;return _0x231cd9;})[_0x9759('0x22')](respondWithFilteredResult(_0x4cfb1a,_0x1069bc))[_0x9759('0x2a')](handleError(_0x4cfb1a,null));};exports['show']=function(_0x433462,_0x2ce36c){var _0x164851={'raw':!![],'where':{'id':_0x433462[_0x9759('0x55')]['id']}},_0x441020={};_0x441020[_0x9759('0x40')]=_[_0x9759('0x43')](db[_0x9759('0x3b')][_0x9759('0x3c')]);_0x441020[_0x9759('0x42')]=_[_0x9759('0x43')](_0x433462[_0x9759('0x42')]);_0x441020[_0x9759('0x44')]=_['intersection'](_0x441020[_0x9759('0x40')],_0x441020[_0x9759('0x42')]);_0x164851['attributes']=_[_0x9759('0x45')](_0x441020[_0x9759('0x40')],qs['fields'](_0x433462['query'][_0x9759('0x47')]));_0x164851['attributes']=_0x164851[_0x9759('0x46')][_0x9759('0x48')]?_0x164851[_0x9759('0x46')]:_0x441020[_0x9759('0x40')];if(_0x433462[_0x9759('0x42')][_0x9759('0x53')]){_0x164851[_0x9759('0x56')]=[{'all':!![]}];}_0x164851=_[_0x9759('0x4f')]({},_0x164851,_0x433462['options']);return db[_0x9759('0x3b')][_0x9759('0x57')](_0x164851)[_0x9759('0x22')](handleEntityNotFound(_0x2ce36c,null))[_0x9759('0x22')](respondWithResult(_0x2ce36c,null))[_0x9759('0x2a')](handleError(_0x2ce36c,null));};exports['create']=function(_0x13c16e,_0x4cc1fc){return db[_0x9759('0x3b')][_0x9759('0x58')](_0x13c16e[_0x9759('0x59')],{})[_0x9759('0x22')](respondWithResult(_0x4cc1fc,0xc9))[_0x9759('0x2a')](handleError(_0x4cc1fc,null));};exports[_0x9759('0x35')]=function(_0x25d50e,_0x6e4d05){if(_0x25d50e['body']['id']){delete _0x25d50e[_0x9759('0x59')]['id'];}return db[_0x9759('0x3b')][_0x9759('0x57')]({'where':{'id':_0x25d50e[_0x9759('0x55')]['id']}})[_0x9759('0x22')](handleEntityNotFound(_0x6e4d05,null))[_0x9759('0x22')](saveUpdates(_0x25d50e['body'],null))[_0x9759('0x22')](respondWithResult(_0x6e4d05,null))['catch'](handleError(_0x6e4d05,null));};exports[_0x9759('0x36')]=function(_0x318383,_0x4c9730){return db[_0x9759('0x3b')]['find']({'where':{'id':_0x318383[_0x9759('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c9730,null))[_0x9759('0x22')](removeEntity(_0x4c9730,null))['catch'](handleError(_0x4c9730,null));};exports[_0x9759('0x5a')]=function(_0x32eb46,_0x3d85ed){return db[_0x9759('0x3b')][_0x9759('0x5a')]()[_0x9759('0x22')](respondWithResult(_0x3d85ed,null))[_0x9759('0x2a')](handleError(_0x3d85ed,null));};var interaction_log=require(_0x9759('0x17'))(_0x9759('0x5b'));exports[_0x9759('0x5c')]=function(_0x5e6d56,_0x12b7d0,_0x3db839){var _0xef069d={'agent':{},'channel':_0x9759('0x5d')};if(_0x5e6d56[_0x9759('0x59')]['id']){delete _0x5e6d56[_0x9759('0x59')]['id'];}_0x5e6d56[_0x9759('0x59')][_0x9759('0x5e')]=!![];_0x5e6d56['body'][_0x9759('0x5f')]=moment()['format'](_0x9759('0x60'));_0x5e6d56[_0x9759('0x59')][_0x9759('0x61')]=_0x5e6d56[_0x9759('0x59')][_0x9759('0x61')]||_0x5e6d56[_0x9759('0x62')]['id'];_0xef069d[_0x9759('0x63')]['id']=_0x5e6d56['body'][_0x9759('0x61')];return db[_0x9759('0x3b')][_0x9759('0x57')]({'where':{'id':_0x5e6d56[_0x9759('0x55')]['id'],'UserId':null}})[_0x9759('0x22')](handleEntityNotFound(_0x12b7d0,null))[_0x9759('0x22')](saveUpdates(_0x5e6d56['body'],null))[_0x9759('0x22')](function(_0x561bec){if(_0x561bec){_0xef069d[_0x9759('0x28')]=_0x561bec[_0x9759('0x64')]({'plain':!![]});return db[_0x9759('0x65')][_0x9759('0x57')]({'where':{'id':_0x561bec[_0x9759('0x66')]}});}return null;})[_0x9759('0x22')](handleEntityNotFound(_0x12b7d0,null))[_0x9759('0x22')](function(_0x42dca6){if(_0x42dca6){return _0x42dca6[_0x9759('0x35')]({'UserId':_0x5e6d56['body'][_0x9759('0x61')],'read1stAt':_[_0x9759('0x67')](_0x42dca6['read1stAt'])?moment()['format'](_0x9759('0x60')):undefined});}return null;})[_0x9759('0x22')](function(_0x20a587){if(_0x20a587){_0xef069d[_0x9759('0x68')]=_0x20a587[_0x9759('0x64')]({'plain':!![]});interaction_log[_0x9759('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e6d56[_0x9759('0x62')]['id'],_0x5e6d56[_0x9759('0x62')][_0x9759('0x38')],_0x5e6d56[_0x9759('0x62')][_0x9759('0x69')],_0xef069d[_0x9759('0x68')]['id'],_0x5e6d56[_0x9759('0x59')]?JSON[_0x9759('0x6a')](_0x5e6d56['body']):_0x9759('0x6b'));return respondWithRpcPromise(_0x9759('0x6c'),_0x9759('0x6d'),_0xef069d);}return null;})[_0x9759('0x22')](function(_0x2711bb){var _0x582e7b=_0x9759('0x6e')+_0x2711bb[_0x9759('0x28')]['ContactId'];return db[_0x9759('0x6f')]['query'](_0x582e7b,{'type':db[_0x9759('0x70')][_0x9759('0x71')][_0x9759('0x72')],'raw':!![]})['then'](function(_0x5427da){return _0x5427da;});})[_0x9759('0x22')](function(_0x33f0ee){if(_0x33f0ee){_0xef069d['message']['contact']=_0x33f0ee[0x0];if(!_0x5e6d56[_0x9759('0x59')][_0x9759('0x61')])return;return db[_0x9759('0x73')][_0x9759('0x57')]({'where':{'id':_0x5e6d56[_0x9759('0x59')][_0x9759('0x61')],'role':'agent'},'attributes':['id',_0x9759('0x38'),'fullname',_0x9759('0x74'),_0x9759('0x75')],'raw':!![]});}return null;})[_0x9759('0x22')](function(_0x137d41){if(!_0x137d41)return null;_0xef069d['message'][_0x9759('0x63')]=_0x137d41;return _0xef069d;})['then'](function(_0x1b2815){if(_0x1b2815){if(_0x5e6d56[_0x9759('0x59')][_0x9759('0x76')]){_0xef069d[_0x9759('0x28')][_0x9759('0x77')]=util[_0x9759('0x78')](_0x9759('0x79'),_0x5e6d56[_0x9759('0x62')][_0x9759('0x38')]);_0xef069d[_0x9759('0x28')][_0x9759('0x7a')]=_0xef069d['channel'];_0xef069d[_0x9759('0x28')][_0x9759('0x7b')]=_0xef069d['channel'];_0xef069d[_0x9759('0x28')][_0x9759('0x7c')]=_0x9759('0x5c');return respondWithRpcPromise(_0x9759('0x7d'),_0x9759('0x7d'),{'event':_0x9759('0x7e'),'message':_[_0x9759('0x4f')](_0xef069d[_0x9759('0x28')],JSON[_0x9759('0x7f')](_0xef069d[_0x9759('0x68')][_0x9759('0x80')]))},client9002)[_0x9759('0x22')](function(){return _0xef069d;});}return _0xef069d;}return null;})['then'](respondWithResult(_0x12b7d0,null))['catch'](handleError(_0x12b7d0,null));};var interaction_log=require(_0x9759('0x17'))(_0x9759('0x5b'));exports[_0x9759('0x81')]=function(_0xa08caa,_0xb36bb9,_0x235bcd){var _0x1ff4e4={'agent':{},'channel':_0x9759('0x5d')};if(_0xa08caa['body']['id']){delete _0xa08caa[_0x9759('0x59')]['id'];}_0xa08caa['body']['UserId']=_0xa08caa[_0x9759('0x59')]['UserId']||_0xa08caa[_0x9759('0x62')]['id'];_0x1ff4e4[_0x9759('0x63')]['id']=_0xa08caa['body'][_0x9759('0x61')];return db[_0x9759('0x3b')][_0x9759('0x57')]({'where':{'id':_0xa08caa[_0x9759('0x55')]['id'],'UserId':null}})[_0x9759('0x22')](handleEntityNotFound(_0xb36bb9,null))[_0x9759('0x22')](function(_0x4a5f8c){if(_0x4a5f8c){_0x1ff4e4[_0x9759('0x28')]=_0x4a5f8c['get']({'plain':!![]});return db[_0x9759('0x65')][_0x9759('0x57')]({'where':{'id':_0x4a5f8c[_0x9759('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xb36bb9,null))[_0x9759('0x22')](function(_0x175401){if(_0x175401){_0x1ff4e4[_0x9759('0x68')]=_0x175401['get']({'plain':!![]});interaction_log[_0x9759('0x29')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa08caa[_0x9759('0x62')]['id'],_0xa08caa[_0x9759('0x62')][_0x9759('0x38')],_0xa08caa[_0x9759('0x62')][_0x9759('0x69')],_0x1ff4e4[_0x9759('0x68')]['id'],_0xa08caa[_0x9759('0x59')]?JSON[_0x9759('0x6a')](_0xa08caa[_0x9759('0x59')]):_0x9759('0x6b'));return respondWithRpcPromise(_0x9759('0x82'),_0x9759('0x83'),_0x1ff4e4);}return null;})[_0x9759('0x22')](function(_0x5d0f3f){var _0x152e91=_0x9759('0x6e')+_0x5d0f3f['message'][_0x9759('0x84')];return db[_0x9759('0x6f')][_0x9759('0x42')](_0x152e91,{'type':db[_0x9759('0x70')][_0x9759('0x71')][_0x9759('0x72')],'raw':!![]})['then'](function(_0x302afa){return _0x302afa;});})['then'](function(_0x5148c3){if(_0x5148c3){_0x1ff4e4[_0x9759('0x28')][_0x9759('0x85')]=_0x5148c3[0x0];if(!_0xa08caa[_0x9759('0x59')][_0x9759('0x61')])return;return db['User'][_0x9759('0x57')]({'where':{'id':_0xa08caa[_0x9759('0x59')][_0x9759('0x61')],'role':_0x9759('0x63')},'attributes':['id','name',_0x9759('0x86'),_0x9759('0x74'),_0x9759('0x75')],'raw':!![]});}return null;})[_0x9759('0x22')](function(_0x45eea4){if(!_0x45eea4)return null;_0x1ff4e4[_0x9759('0x28')][_0x9759('0x63')]=_0x45eea4;return _0x1ff4e4;})['then'](function(_0x369481){if(_0x369481){_0x369481[_0x9759('0x28')][_0x9759('0x77')]=util['format'](_0x9759('0x79'),_0xa08caa[_0x9759('0x62')]['name']);_0x369481[_0x9759('0x28')][_0x9759('0x7a')]=_0x1ff4e4[_0x9759('0x7a')];_0x369481['message'][_0x9759('0x7b')]=_0x1ff4e4['channel'];_0x369481[_0x9759('0x28')][_0x9759('0x7c')]='reject';respondWithRpcPromise('EventManager',_0x9759('0x7d'),{'event':'rejectmessage','message':_[_0x9759('0x4f')](_0x1ff4e4[_0x9759('0x28')],JSON[_0x9759('0x7f')](_0x1ff4e4[_0x9759('0x68')][_0x9759('0x80')]))},client9002);return _0x1ff4e4;}return null;})[_0x9759('0x22')](respondWithResult(_0xb36bb9,null))[_0x9759('0x2a')](handleError(_0xb36bb9,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index bb623e0..da56e1f 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 _0x1930=['hook','exports','events','../../mysqldb','ChatMessage','update','remove','emit','hasOwnProperty'];(function(_0x26b2d8,_0xb2448c){var _0x24d7ad=function(_0x2674a9){while(--_0x2674a9){_0x26b2d8['push'](_0x26b2d8['shift']());}};_0x24d7ad(++_0xb2448c);}(_0x1930,0x134));var _0x0193=function(_0x1f5935,_0x7c6aa6){_0x1f5935=_0x1f5935-0x0;var _0x4e5764=_0x1930[_0x1f5935];return _0x4e5764;};'use strict';var EventEmitter=require(_0x0193('0x0'));var ChatMessage=require(_0x0193('0x1'))['db'][_0x0193('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0193('0x3'),'afterDestroy':_0x0193('0x4')};function emitEvent(_0x40a2e3){return function(_0x40569e,_0x8a823,_0x5206a9){ChatMessageEvents[_0x0193('0x5')](_0x40a2e3+':'+_0x40569e['id'],_0x40569e);ChatMessageEvents['emit'](_0x40a2e3,_0x40569e);_0x5206a9(null);};}for(var e in events){if(events[_0x0193('0x6')](e)){var event=events[e];ChatMessage[_0x0193('0x7')](e,emitEvent(event));}}module[_0x0193('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xe5f5=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x220ff3,_0x4d7661){var _0x1c10a7=function(_0x106268){while(--_0x106268){_0x220ff3['push'](_0x220ff3['shift']());}};_0x1c10a7(++_0x4d7661);}(_0xe5f5,0xb3));var _0x5e5f=function(_0x5a08f5,_0x2e99f1){_0x5a08f5=_0x5a08f5-0x0;var _0x573b18=_0xe5f5[_0x5a08f5];return _0x573b18;};'use strict';var EventEmitter=require(_0x5e5f('0x0'));var ChatMessage=require(_0x5e5f('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5e5f('0x2')](0x0);var events={'afterCreate':_0x5e5f('0x3'),'afterUpdate':_0x5e5f('0x4'),'afterDestroy':_0x5e5f('0x5')};function emitEvent(_0x4ae9a0){return function(_0x1c081b,_0xd8775,_0x3cd3f8){ChatMessageEvents[_0x5e5f('0x6')](_0x4ae9a0+':'+_0x1c081b['id'],_0x1c081b);ChatMessageEvents['emit'](_0x4ae9a0,_0x1c081b);_0x3cd3f8(null);};}for(var e in events){if(events[_0x5e5f('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5e5f('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index b210c54..e59827a 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 _0xbc25=['../../config/logger','api','moment','request-promise','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0xe61569,_0x38c173){var _0x459e38=function(_0x7cbee3){while(--_0x7cbee3){_0xe61569['push'](_0xe61569['shift']());}};_0x459e38(++_0x38c173);}(_0xbc25,0x81));var _0x5bc2=function(_0x12b7cb,_0x3d428e){_0x12b7cb=_0x12b7cb-0x0;var _0x7acbd4=_0xbc25[_0x12b7cb];return _0x7acbd4;};'use strict';var _=require('lodash');var util=require(_0x5bc2('0x0'));var logger=require(_0x5bc2('0x1'))(_0x5bc2('0x2'));var moment=require(_0x5bc2('0x3'));var BPromise=require('bluebird');var rp=require(_0x5bc2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5bc2('0x5'));var attributes=require(_0x5bc2('0x6'));module[_0x5bc2('0x7')]=function(_0x51aeb6,_0x5aa0cd){return _0x51aeb6[_0x5bc2('0x8')](_0x5bc2('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x5bc2('0xa'),'fields':[_0x5bc2('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b88f7,_0x31e56b,_0x37059a){var _0x181f1f=_0x51aeb6[_0x5bc2('0xc')];var _0xa74e80=_0x4b88f7[_0x5bc2('0xd')]({'plain':!![]});if(_0xa74e80[_0x5bc2('0xe')][_0x5bc2('0xf')]()==='in'||_0xa74e80[_0x5bc2('0xe')][_0x5bc2('0xf')]()==='out'&&!_0xa74e80[_0x5bc2('0x10')]&&!_[_0x5bc2('0x11')](_0xa74e80[_0x5bc2('0x12')])){_0x181f1f[_0x5bc2('0x13')]['findOne']({'where':{'id':_0xa74e80['ChatInteractionId']}})['then'](function(_0x2bf4a2){if(_0x2bf4a2){_0x2bf4a2[_0x5bc2('0x14')]({'lastMsgAt':_0xa74e80[_0x5bc2('0x15')],'lastMsgDirection':_0xa74e80[_0x5bc2('0xe')]['toLowerCase']()});}})[_0x5bc2('0x16')](function(_0x526e63){console[_0x5bc2('0x17')](_0x526e63);});}_0x37059a();}},'charset':_0x5bc2('0x18'),'collate':_0x5bc2('0x19')});};
\ No newline at end of file
+var _0xb3a1=['error','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch'];(function(_0x289799,_0x34b7b3){var _0x4faecc=function(_0x5b11a2){while(--_0x5b11a2){_0x289799['push'](_0x289799['shift']());}};_0x4faecc(++_0x34b7b3);}(_0xb3a1,0x1bc));var _0x1b3a=function(_0x5642a4,_0x3b3752){_0x5642a4=_0x5642a4-0x0;var _0x20b040=_0xb3a1[_0x5642a4];return _0x20b040;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b3a('0x0'))('api');var moment=require(_0x1b3a('0x1'));var BPromise=require(_0x1b3a('0x2'));var rp=require(_0x1b3a('0x3'));var fs=require('fs');var path=require(_0x1b3a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0x1b3a('0x5')]=function(_0x368430,_0x196f3c){return _0x368430[_0x1b3a('0x6')](_0x1b3a('0x7'),attributes,{'tableName':_0x1b3a('0x8'),'paranoid':![],'indexes':[{'name':_0x1b3a('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21a30b,_0x478e01,_0x2e0a3e){var _0x3da1a8=_0x368430[_0x1b3a('0xa')];var _0x2c70a=_0x21a30b[_0x1b3a('0xb')]({'plain':!![]});if(_0x2c70a[_0x1b3a('0xc')][_0x1b3a('0xd')]()==='in'||_0x2c70a[_0x1b3a('0xc')][_0x1b3a('0xd')]()===_0x1b3a('0xe')&&!_0x2c70a[_0x1b3a('0xf')]&&!_[_0x1b3a('0x10')](_0x2c70a['UserId'])){_0x3da1a8[_0x1b3a('0x11')][_0x1b3a('0x12')]({'where':{'id':_0x2c70a[_0x1b3a('0x13')]}})[_0x1b3a('0x14')](function(_0x166d45){if(_0x166d45){_0x166d45[_0x1b3a('0x15')]({'lastMsgAt':_0x2c70a[_0x1b3a('0x16')],'lastMsgDirection':_0x2c70a['direction']['toLowerCase']()});}})[_0x1b3a('0x17')](function(_0x1d4be2){console[_0x1b3a('0x18')](_0x1d4be2);});}_0x2e0a3e();}},'charset':'utf8mb4','collate':_0x1b3a('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 7f65bc4..11956b0 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 _0x5776=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird'];(function(_0x151b7b,_0x5bcc53){var _0x1f61a4=function(_0x1be453){while(--_0x1be453){_0x151b7b['push'](_0x151b7b['shift']());}};_0x1f61a4(++_0x5bcc53);}(_0x5776,0x17d));var _0x6577=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5776[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x6577('0x0'));var util=require(_0x6577('0x1'));var moment=require(_0x6577('0x2'));var BPromise=require(_0x6577('0x3'));var rs=require(_0x6577('0x4'));var fs=require('fs');var Redis=require(_0x6577('0x5'));var db=require(_0x6577('0x6'))['db'];var utils=require(_0x6577('0x7'));var logger=require(_0x6577('0x8'))(_0x6577('0x9'));var config=require(_0x6577('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6577('0xb')][_0x6577('0xc')]({'port':0x232a});config['redis']=_[_0x6577('0xd')](config[_0x6577('0xe')],{'host':_0x6577('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6577('0xe')]));require(_0x6577('0x10'))[_0x6577('0x11')](socket);function respondWithRpcPromise(_0x219f81,_0x57608d,_0x444aaf){return new BPromise(function(_0x38a6d2,_0x2e0589){return client[_0x6577('0x12')](_0x219f81,_0x444aaf)[_0x6577('0x13')](function(_0x287aee){logger[_0x6577('0x14')]('ChatMessage,\x20%s,\x20%s',_0x57608d,_0x6577('0x15'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x57608d,_0x6577('0x15'),JSON[_0x6577('0x16')](_0x287aee));if(_0x287aee[_0x6577('0x17')]){if(_0x287aee['error'][_0x6577('0x18')]===0x1f4){logger['error'](_0x6577('0x19'),_0x57608d,_0x287aee[_0x6577('0x17')][_0x6577('0x1a')]);return _0x2e0589(_0x287aee[_0x6577('0x17')]['message']);}logger[_0x6577('0x17')](_0x6577('0x19'),_0x57608d,_0x287aee[_0x6577('0x17')]['message']);return _0x38a6d2(_0x287aee[_0x6577('0x17')]['message']);}else{logger[_0x6577('0x14')](_0x6577('0x19'),_0x57608d,_0x6577('0x15'));_0x38a6d2(_0x287aee['result'][_0x6577('0x1a')]);}})[_0x6577('0x1b')](function(_0x4d4065){logger[_0x6577('0x17')]('ChatMessage,\x20%s,\x20%s',_0x57608d,_0x4d4065);_0x2e0589(_0x4d4065);});});}exports[_0x6577('0x1c')]=function(_0x3c0f4c){var _0x26cd8c=this;return new Promise(function(_0x34f43a,_0x44905a){return db[_0x6577('0x1d')][_0x6577('0x1e')](_0x3c0f4c[_0x6577('0x1f')],{'raw':_0x3c0f4c[_0x6577('0x20')]?_0x3c0f4c[_0x6577('0x20')][_0x6577('0x21')]===undefined?!![]:![]:!![]})[_0x6577('0x13')](function(_0x1c6e2b){logger[_0x6577('0x14')](_0x6577('0x1c'),_0x3c0f4c);logger[_0x6577('0x22')](_0x6577('0x1c'),_0x3c0f4c,JSON[_0x6577('0x16')](_0x1c6e2b));_0x34f43a(_0x1c6e2b);})[_0x6577('0x1b')](function(_0xc463ca){logger['error'](_0x6577('0x1c'),_0xc463ca[_0x6577('0x1a')],_0x3c0f4c);_0x44905a(_0x26cd8c[_0x6577('0x17')](0x1f4,_0xc463ca['message']));});});};
\ No newline at end of file
+var _0xe558=['code','message','result','CreateChatMessage','ChatMessage','create','body','raw','catch','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x529401,_0x68cf8e){var _0xdcaaa2=function(_0x1ab7f2){while(--_0x1ab7f2){_0x529401['push'](_0x529401['shift']());}};_0xdcaaa2(++_0x68cf8e);}(_0xe558,0x69));var _0x8e55=function(_0x58ba1d,_0x3b345d){_0x58ba1d=_0x58ba1d-0x0;var _0x1d5647=_0xe558[_0x58ba1d];return _0x1d5647;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e55('0x0'));var fs=require('fs');var Redis=require(_0x8e55('0x1'));var db=require(_0x8e55('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e55('0x3'))(_0x8e55('0x4'));var config=require(_0x8e55('0x5'));var jayson=require(_0x8e55('0x6'));var client=jayson[_0x8e55('0x7')][_0x8e55('0x8')]({'port':0x232a});config[_0x8e55('0x9')]=_[_0x8e55('0xa')](config[_0x8e55('0x9')],{'host':_0x8e55('0xb'),'port':0x18eb});var socket=require(_0x8e55('0xc'))(new Redis(config[_0x8e55('0x9')]));require(_0x8e55('0xd'))[_0x8e55('0xe')](socket);function respondWithRpcPromise(_0x330c27,_0xdb8a8,_0x707751){return new BPromise(function(_0x49befa,_0x3be648){return client['request'](_0x330c27,_0x707751)[_0x8e55('0xf')](function(_0x3ef0b1){logger[_0x8e55('0x10')](_0x8e55('0x11'),_0xdb8a8,_0x8e55('0x12'));logger[_0x8e55('0x13')](_0x8e55('0x14'),_0xdb8a8,'request\x20sent',JSON[_0x8e55('0x15')](_0x3ef0b1));if(_0x3ef0b1[_0x8e55('0x16')]){if(_0x3ef0b1['error'][_0x8e55('0x17')]===0x1f4){logger[_0x8e55('0x16')](_0x8e55('0x11'),_0xdb8a8,_0x3ef0b1[_0x8e55('0x16')]['message']);return _0x3be648(_0x3ef0b1[_0x8e55('0x16')][_0x8e55('0x18')]);}logger[_0x8e55('0x16')]('ChatMessage,\x20%s,\x20%s',_0xdb8a8,_0x3ef0b1['error'][_0x8e55('0x18')]);return _0x49befa(_0x3ef0b1[_0x8e55('0x16')][_0x8e55('0x18')]);}else{logger['info'](_0x8e55('0x11'),_0xdb8a8,_0x8e55('0x12'));_0x49befa(_0x3ef0b1[_0x8e55('0x19')][_0x8e55('0x18')]);}})['catch'](function(_0x380035){logger[_0x8e55('0x16')](_0x8e55('0x11'),_0xdb8a8,_0x380035);_0x3be648(_0x380035);});});}exports[_0x8e55('0x1a')]=function(_0x14e47b){var _0x53c2a4=this;return new Promise(function(_0x2ddf53,_0x2b10f6){return db[_0x8e55('0x1b')][_0x8e55('0x1c')](_0x14e47b[_0x8e55('0x1d')],{'raw':_0x14e47b['options']?_0x14e47b['options'][_0x8e55('0x1e')]===undefined?!![]:![]:!![]})[_0x8e55('0xf')](function(_0x18a86e){logger[_0x8e55('0x10')](_0x8e55('0x1a'),_0x14e47b);logger[_0x8e55('0x13')](_0x8e55('0x1a'),_0x14e47b,JSON[_0x8e55('0x15')](_0x18a86e));_0x2ddf53(_0x18a86e);})[_0x8e55('0x1f')](function(_0x1d9358){logger[_0x8e55('0x16')]('CreateChatMessage',_0x1d9358[_0x8e55('0x18')],_0x14e47b);_0x2b10f6(_0x53c2a4['error'](0x1f4,_0x1d9358[_0x8e55('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 85b5a87..c72a517 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 _0xf006=['register','chatMessage:','remove','update','emit','removeListener'];(function(_0x5b17e5,_0x21e3c2){var _0x4b56bb=function(_0x2441ce){while(--_0x2441ce){_0x5b17e5['push'](_0x5b17e5['shift']());}};_0x4b56bb(++_0x21e3c2);}(_0xf006,0x146));var _0x6f00=function(_0x2de8fe,_0x4e6786){_0x2de8fe=_0x2de8fe-0x0;var _0x4e4089=_0xf006[_0x2de8fe];return _0x4e4089;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x6f00('0x0'),_0x6f00('0x1')];function createListener(_0x5914f3,_0xbab575){return function(_0x4e9dbc){_0xbab575[_0x6f00('0x2')](_0x5914f3,_0x4e9dbc);};}function removeListener(_0x4f4466,_0x5039fb){return function(){ChatMessageEvents[_0x6f00('0x3')](_0x4f4466,_0x5039fb);};}exports[_0x6f00('0x4')]=function(_0x141e71){for(var _0x52c9a2=0x0,_0x3c29ff=events['length'];_0x52c9a2<_0x3c29ff;_0x52c9a2++){var _0x3875fb=events[_0x52c9a2];var _0x3001b1=createListener(_0x6f00('0x5')+_0x3875fb,_0x141e71);ChatMessageEvents['on'](_0x3875fb,_0x3001b1);}};
\ No newline at end of file
+var _0x84e7=['save','remove','emit','removeListener','register'];(function(_0x17c241,_0x1bf660){var _0x472397=function(_0x5cf779){while(--_0x5cf779){_0x17c241['push'](_0x17c241['shift']());}};_0x472397(++_0x1bf660);}(_0x84e7,0x122));var _0x784e=function(_0x2ae37b,_0x180ac3){_0x2ae37b=_0x2ae37b-0x0;var _0x591143=_0x84e7[_0x2ae37b];return _0x591143;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x784e('0x0'),_0x784e('0x1'),'update'];function createListener(_0x3548d2,_0x2c1d96){return function(_0x50f44d){_0x2c1d96[_0x784e('0x2')](_0x3548d2,_0x50f44d);};}function removeListener(_0x14cee2,_0x205619){return function(){ChatMessageEvents[_0x784e('0x3')](_0x14cee2,_0x205619);};}exports[_0x784e('0x4')]=function(_0x133296){for(var _0x48ed22=0x0,_0x3cbdd1=events['length'];_0x48ed22<_0x3cbdd1;_0x48ed22++){var _0xfaa170=events[_0x48ed22];var _0x24654d=createListener('chatMessage:'+_0xfaa170,_0x133296);ChatMessageEvents['on'](_0xfaa170,_0x24654d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 01bb034..fd22fd2 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 _0xe465=['express','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout'];(function(_0x41e529,_0xe38ab6){var _0x18681f=function(_0x15a8a8){while(--_0x15a8a8){_0x41e529['push'](_0x41e529['shift']());}};_0x18681f(++_0xe38ab6);}(_0xe465,0x10c));var _0x5e46=function(_0x5d40b1,_0x5f7f65){_0x5d40b1=_0x5d40b1-0x0;var _0xa98d8b=_0xe465[_0x5d40b1];return _0xa98d8b;};'use strict';var multer=require('multer');var util=require(_0x5e46('0x0'));var path=require('path');var timeout=require(_0x5e46('0x1'));var express=require(_0x5e46('0x2'));var router=express[_0x5e46('0x3')]();var fs_extra=require(_0x5e46('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5e46('0x5'));var config=require('../../config/environment');var controller=require(_0x5e46('0x6'));router[_0x5e46('0x7')]('/',auth[_0x5e46('0x8')](),controller[_0x5e46('0x9')]);router[_0x5e46('0x7')](_0x5e46('0xa'),auth[_0x5e46('0x8')](),controller[_0x5e46('0xb')]);router[_0x5e46('0x7')](_0x5e46('0xc'),auth[_0x5e46('0x8')](),controller[_0x5e46('0xd')]);router[_0x5e46('0xe')]('/',auth[_0x5e46('0x8')](),interaction[_0x5e46('0xf')](_0x5e46('0x10'),_0x5e46('0x11')),controller[_0x5e46('0x12')]);router[_0x5e46('0x13')](_0x5e46('0xc'),controller['update']);router[_0x5e46('0x13')](_0x5e46('0x14'),auth[_0x5e46('0x8')](),controller[_0x5e46('0x15')]);router[_0x5e46('0x13')](_0x5e46('0x16'),auth['isAuthenticated'](),controller[_0x5e46('0x17')]);router[_0x5e46('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x5e46('0x19')]);module[_0x5e46('0x1a')]=router;
\ No newline at end of file
+var _0xf609=['connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','tracked','chat','chatmessage:create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xf609,0xf0));var _0x9f60=function(_0x5b14ec,_0x3cee49){_0x5b14ec=_0x5b14ec-0x0;var _0x13673a=_0xf609[_0x5b14ec];return _0x13673a;};'use strict';var multer=require(_0x9f60('0x0'));var util=require(_0x9f60('0x1'));var path=require(_0x9f60('0x2'));var timeout=require(_0x9f60('0x3'));var express=require(_0x9f60('0x4'));var router=express[_0x9f60('0x5')]();var fs_extra=require(_0x9f60('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9f60('0x7'));var controller=require(_0x9f60('0x8'));router[_0x9f60('0x9')]('/',auth['isAuthenticated'](),controller[_0x9f60('0xa')]);router['get'](_0x9f60('0xb'),auth['isAuthenticated'](),controller[_0x9f60('0xc')]);router[_0x9f60('0x9')](_0x9f60('0xd'),auth[_0x9f60('0xe')](),controller[_0x9f60('0xf')]);router[_0x9f60('0x10')]('/',auth[_0x9f60('0xe')](),interaction[_0x9f60('0x11')](_0x9f60('0x12'),_0x9f60('0x13')),controller['create']);router[_0x9f60('0x14')](_0x9f60('0xd'),controller[_0x9f60('0x15')]);router[_0x9f60('0x14')](_0x9f60('0x16'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x9f60('0x17'),auth[_0x9f60('0xe')](),controller[_0x9f60('0x18')]);router['delete']('/:id',auth[_0x9f60('0xe')](),controller[_0x9f60('0x19')]);module[_0x9f60('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 685d03b..83c8104 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 _0x63e5=['sequelize','exports','TEXT','medium'];(function(_0x55ba13,_0x55b31b){var _0x3d04eb=function(_0x5c01b6){while(--_0x5c01b6){_0x55ba13['push'](_0x55ba13['shift']());}};_0x3d04eb(++_0x55b31b);}(_0x63e5,0x144));var _0x563e=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x63e5[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0x563e('0x0'));module[_0x563e('0x1')]={'body':{'type':Sequelize[_0x563e('0x2')](_0x563e('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x8c84=['exports','TEXT','sequelize'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0x8c84,0x83));var _0x48c8=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8c84[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x48c8('0x0'));module[_0x48c8('0x1')]={'body':{'type':Sequelize[_0x48c8('0x2')]('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 3f714d9..4b7568c 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5728d1,_0x6c0913){var _0x310f61=function(_0x455909){while(--_0x455909){_0x5728d1['push'](_0x5728d1['shift']());}};_0x310f61(++_0x6c0913);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x7a54,0x106));var _0x47a5=function(_0xfe1dfc,_0x1826f4){_0xfe1dfc=_0xfe1dfc-0x0;var _0x2f568b=_0x7a54[_0xfe1dfc];return _0x2f568b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 371e9eb..268952c 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 _0x2611=['chat_offline_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0x2611,0x1b5));var _0x1261=function(_0x8e1e8,_0x27e413){_0x8e1e8=_0x8e1e8-0x0;var _0x5b78bb=_0x2611[_0x8e1e8];return _0x5b78bb;};'use strict';var _=require(_0x1261('0x0'));var util=require(_0x1261('0x1'));var logger=require(_0x1261('0x2'))(_0x1261('0x3'));var moment=require(_0x1261('0x4'));var BPromise=require(_0x1261('0x5'));var rp=require(_0x1261('0x6'));var fs=require('fs');var path=require(_0x1261('0x7'));var rimraf=require(_0x1261('0x8'));var config=require(_0x1261('0x9'));var attributes=require(_0x1261('0xa'));module[_0x1261('0xb')]=function(_0x5596a1,_0x1172df){return _0x5596a1['define'](_0x1261('0xc'),attributes,{'tableName':_0x1261('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1261('0xe')});};
\ No newline at end of file
+var _0xf2fa=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0xac72f7,_0x237a87){var _0x5b1c13=function(_0x465d93){while(--_0x465d93){_0xac72f7['push'](_0xac72f7['shift']());}};_0x5b1c13(++_0x237a87);}(_0xf2fa,0xd7));var _0xaf2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf2fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaf2f('0x0'));var util=require('util');var logger=require(_0xaf2f('0x1'))(_0xaf2f('0x2'));var moment=require(_0xaf2f('0x3'));var BPromise=require(_0xaf2f('0x4'));var rp=require(_0xaf2f('0x5'));var fs=require('fs');var path=require(_0xaf2f('0x6'));var rimraf=require(_0xaf2f('0x7'));var config=require(_0xaf2f('0x8'));var attributes=require(_0xaf2f('0x9'));module['exports']=function(_0x2e0de4,_0x389f76){return _0x2e0de4[_0xaf2f('0xa')](_0xaf2f('0xb'),attributes,{'tableName':_0xaf2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf2f('0xd'),'collate':_0xaf2f('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index ee68102..45ed349 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 _0x66c7=['../../config/logger','rpc','jayson/promise','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x66c7,0x19d));var _0x766c=function(_0x5b8cd2,_0xd73d07){_0x5b8cd2=_0x5b8cd2-0x0;var _0x34754a=_0x66c7[_0x5b8cd2];return _0x34754a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x766c('0x0'));var BPromise=require(_0x766c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x766c('0x2'));var db=require(_0x766c('0x3'))['db'];var utils=require(_0x766c('0x4'));var logger=require(_0x766c('0x5'))(_0x766c('0x6'));var config=require('../../config/environment');var jayson=require(_0x766c('0x7'));var client=jayson['client'][_0x766c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46e166,_0x24aed7,_0x3a1a72){return new BPromise(function(_0x41156e,_0x452352){return client[_0x766c('0x9')](_0x46e166,_0x3a1a72)['then'](function(_0x564d00){logger['info'](_0x766c('0xa'),_0x24aed7,_0x766c('0xb'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x24aed7,_0x766c('0xb'),JSON[_0x766c('0xc')](_0x564d00));if(_0x564d00['error']){if(_0x564d00['error'][_0x766c('0xd')]===0x1f4){logger[_0x766c('0xe')](_0x766c('0xa'),_0x24aed7,_0x564d00[_0x766c('0xe')][_0x766c('0xf')]);return _0x452352(_0x564d00[_0x766c('0xe')]['message']);}logger['error'](_0x766c('0xa'),_0x24aed7,_0x564d00['error']['message']);return _0x41156e(_0x564d00[_0x766c('0xe')][_0x766c('0xf')]);}else{logger[_0x766c('0x10')](_0x766c('0xa'),_0x24aed7,'request\x20sent');_0x41156e(_0x564d00[_0x766c('0x11')][_0x766c('0xf')]);}})[_0x766c('0x12')](function(_0x1978b9){logger[_0x766c('0xe')](_0x766c('0xa'),_0x24aed7,_0x1978b9);_0x452352(_0x1978b9);});});}
\ No newline at end of file
+var _0x2061=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x406436,_0x47a2b4){var _0x251b20=function(_0x5d6dae){while(--_0x5d6dae){_0x406436['push'](_0x406436['shift']());}};_0x251b20(++_0x47a2b4);}(_0x2061,0x80));var _0x1206=function(_0x6b2e00,_0x4734cb){_0x6b2e00=_0x6b2e00-0x0;var _0x5527fe=_0x2061[_0x6b2e00];return _0x5527fe;};'use strict';var _=require(_0x1206('0x0'));var util=require(_0x1206('0x1'));var moment=require('moment');var BPromise=require(_0x1206('0x2'));var rs=require(_0x1206('0x3'));var fs=require('fs');var Redis=require(_0x1206('0x4'));var db=require(_0x1206('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1206('0x6'));var config=require(_0x1206('0x7'));var jayson=require(_0x1206('0x8'));var client=jayson[_0x1206('0x9')][_0x1206('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed569,_0x10581f,_0x2152d9){return new BPromise(function(_0x117653,_0x1647b5){return client['request'](_0x5ed569,_0x2152d9)[_0x1206('0xb')](function(_0xab3513){logger[_0x1206('0xc')](_0x1206('0xd'),_0x10581f,_0x1206('0xe'));logger[_0x1206('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x10581f,'request\x20sent',JSON[_0x1206('0x10')](_0xab3513));if(_0xab3513[_0x1206('0x11')]){if(_0xab3513[_0x1206('0x11')][_0x1206('0x12')]===0x1f4){logger[_0x1206('0x11')](_0x1206('0xd'),_0x10581f,_0xab3513[_0x1206('0x11')][_0x1206('0x13')]);return _0x1647b5(_0xab3513[_0x1206('0x11')][_0x1206('0x13')]);}logger[_0x1206('0x11')](_0x1206('0xd'),_0x10581f,_0xab3513[_0x1206('0x11')][_0x1206('0x13')]);return _0x117653(_0xab3513['error'][_0x1206('0x13')]);}else{logger[_0x1206('0xc')](_0x1206('0xd'),_0x10581f,_0x1206('0xe'));_0x117653(_0xab3513[_0x1206('0x14')][_0x1206('0x13')]);}})[_0x1206('0x15')](function(_0x573c95){logger[_0x1206('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x10581f,_0x573c95);_0x1647b5(_0x573c95);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index ebc3cd9..ed90972 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 _0xc7b1=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4c61d3,_0x4fe494){var _0x1a73fe=function(_0x1c1e51){while(--_0x1c1e51){_0x4c61d3['push'](_0x4c61d3['shift']());}};_0x1a73fe(++_0x4fe494);}(_0xc7b1,0x105));var _0x1c7b=function(_0x6c59fc,_0x5fe88d){_0x6c59fc=_0x6c59fc-0x0;var _0x17c96f=_0xc7b1[_0x6c59fc];return _0x17c96f;};'use strict';var multer=require(_0x1c7b('0x0'));var util=require(_0x1c7b('0x1'));var path=require(_0x1c7b('0x2'));var timeout=require(_0x1c7b('0x3'));var express=require(_0x1c7b('0x4'));var router=express[_0x1c7b('0x5')]();var fs_extra=require(_0x1c7b('0x6'));var auth=require(_0x1c7b('0x7'));var interaction=require(_0x1c7b('0x8'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x1c7b('0x9')]('/',auth[_0x1c7b('0xa')](),controller['index']);router[_0x1c7b('0x9')](_0x1c7b('0xb'),auth[_0x1c7b('0xa')](),controller['describe']);router[_0x1c7b('0x9')](_0x1c7b('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x1c7b('0xd')]);router[_0x1c7b('0xe')](_0x1c7b('0xc'),auth[_0x1c7b('0xa')](),controller[_0x1c7b('0xf')]);router[_0x1c7b('0x10')](_0x1c7b('0xc'),auth['isAuthenticated'](),controller[_0x1c7b('0x11')]);module[_0x1c7b('0x12')]=router;
\ No newline at end of file
+var _0xf878=['../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x176606,_0x2cb8d9){var _0x4a2abc=function(_0x3d8fb2){while(--_0x3d8fb2){_0x176606['push'](_0x176606['shift']());}};_0x4a2abc(++_0x2cb8d9);}(_0xf878,0x100));var _0x8f87=function(_0x2f0e61,_0x24f38d){_0x2f0e61=_0x2f0e61-0x0;var _0x344a68=_0xf878[_0x2f0e61];return _0x344a68;};'use strict';var multer=require(_0x8f87('0x0'));var util=require(_0x8f87('0x1'));var path=require(_0x8f87('0x2'));var timeout=require(_0x8f87('0x3'));var express=require(_0x8f87('0x4'));var router=express[_0x8f87('0x5')]();var fs_extra=require(_0x8f87('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8f87('0x7'));var config=require(_0x8f87('0x8'));var controller=require(_0x8f87('0x9'));router[_0x8f87('0xa')]('/',auth[_0x8f87('0xb')](),controller[_0x8f87('0xc')]);router[_0x8f87('0xa')](_0x8f87('0xd'),auth[_0x8f87('0xb')](),controller[_0x8f87('0xe')]);router['get'](_0x8f87('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8f87('0x10')]('/',auth[_0x8f87('0xb')](),controller[_0x8f87('0x11')]);router[_0x8f87('0x12')](_0x8f87('0xf'),auth[_0x8f87('0xb')](),controller[_0x8f87('0x13')]);router[_0x8f87('0x14')](_0x8f87('0xf'),auth[_0x8f87('0xb')](),controller['destroy']);module[_0x8f87('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 a092753..bbfde69 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 _0x724b=['sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0x724b,0x78));var _0xb724=function(_0x5909a3,_0x4e4609){_0x5909a3=_0x5909a3-0x0;var _0x7c4c65=_0x724b[_0x5909a3];return _0x7c4c65;};'use strict';var Sequelize=require(_0xb724('0x0'));module[_0xb724('0x1')]={'name':{'type':Sequelize[_0xb724('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb724('0x3')](_0xb724('0x4'),_0xb724('0x5')),'defaultValue':_0xb724('0x4')},'selector':{'type':Sequelize[_0xb724('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x7a95=['ENUM','mouseOver','INTEGER','exports','STRING'];(function(_0x52a2be,_0x4bd252){var _0x246f1d=function(_0x410395){while(--_0x410395){_0x52a2be['push'](_0x52a2be['shift']());}};_0x246f1d(++_0x4bd252);}(_0x7a95,0xe4));var _0x57a9=function(_0x2ac1c8,_0x5b8ae4){_0x2ac1c8=_0x2ac1c8-0x0;var _0x2447bd=_0x7a95[_0x2ac1c8];return _0x2447bd;};'use strict';var Sequelize=require('sequelize');module[_0x57a9('0x0')]={'name':{'type':Sequelize[_0x57a9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x57a9('0x2')](_0x57a9('0x3'),'timeout'),'defaultValue':_0x57a9('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x57a9('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 599c0f3..85b4f8a 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 _0x5ad3=['show','keys','rawAttributes','intersection','attributes','model','query','length','includeAll','include','merge','options','ChatProactiveAction','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0x1627cd,_0x2a9058){var _0x3d7971=function(_0x15d6a8){while(--_0x15d6a8){_0x1627cd['push'](_0x1627cd['shift']());}};_0x3d7971(++_0x2a9058);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0x5ad3[_0x421e36];return _0x20b3e3;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={'raw':!![],'where':{'id':_0x11da54['params']['id']}},_0x2c82f1={};_0x2c82f1['model']=_[_0x35ad('0x29')](db['ChatProactiveAction'][_0x35ad('0x2a')]);_0x2c82f1['query']=_['keys'](_0x11da54['query']);_0x2c82f1['filters']=_[_0x35ad('0x2b')](_0x2c82f1['model'],_0x2c82f1['query']);_0x34b8b9[_0x35ad('0x2c')]=_['intersection'](_0x2c82f1[_0x35ad('0x2d')],qs['fields'](_0x11da54[_0x35ad('0x2e')]['fields']));_0x34b8b9[_0x35ad('0x2c')]=_0x34b8b9['attributes'][_0x35ad('0x2f')]?_0x34b8b9[_0x35ad('0x2c')]:_0x2c82f1[_0x35ad('0x2d')];if(_0x11da54['query'][_0x35ad('0x30')]){_0x34b8b9[_0x35ad('0x31')]=[{'all':!![]}];}_0x34b8b9=_[_0x35ad('0x32')]({},_0x34b8b9,_0x11da54[_0x35ad('0x33')]);return db[_0x35ad('0x34')]['find'](_0x34b8b9)['then'](handleEntityNotFound(_0x2f8b3,null))[_0x35ad('0x23')](respondWithResult(_0x2f8b3,null))[_0x35ad('0x35')](handleError(_0x2f8b3,null));};exports[_0x35ad('0x36')]=function(_0x1c8a3d,_0x55e676){return db[_0x35ad('0x34')][_0x35ad('0x36')](_0x1c8a3d[_0x35ad('0x37')],{})[_0x35ad('0x23')](respondWithResult(_0x55e676,0xc9))[_0x35ad('0x35')](handleError(_0x55e676,null));};exports[_0x35ad('0x22')]=function(_0x49c33d,_0x58250d){if(_0x49c33d[_0x35ad('0x37')]['id']){delete _0x49c33d[_0x35ad('0x37')]['id'];}return db[_0x35ad('0x34')][_0x35ad('0x38')]({'where':{'id':_0x49c33d[_0x35ad('0x39')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x58250d,null))[_0x35ad('0x23')](saveUpdates(_0x49c33d[_0x35ad('0x37')],null))[_0x35ad('0x23')](respondWithResult(_0x58250d,null))['catch'](handleError(_0x58250d,null));};exports[_0x35ad('0x24')]=function(_0x4f975b,_0x25e63e){return db[_0x35ad('0x34')][_0x35ad('0x38')]({'where':{'id':_0x4f975b[_0x35ad('0x39')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x25e63e,null))[_0x35ad('0x23')](removeEntity(_0x25e63e,null))[_0x35ad('0x35')](handleError(_0x25e63e,null));};
\ No newline at end of file
+var _0xcb66=['include','merge','options','find','catch','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','end','name','send','show','model','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xcb66,0x19f));var _0x6cb6=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0xcb66[_0x19dd7a];return _0x3feb6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cb6('0x0'));var zipdir=require(_0x6cb6('0x1'));var jsonpatch=require(_0x6cb6('0x2'));var rp=require(_0x6cb6('0x3'));var moment=require(_0x6cb6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6cb6('0x5'));var util=require(_0x6cb6('0x6'));var path=require(_0x6cb6('0x7'));var sox=require(_0x6cb6('0x8'));var csv=require(_0x6cb6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cb6('0xa'));var squel=require(_0x6cb6('0xb'));var crypto=require(_0x6cb6('0xc'));var jsforce=require(_0x6cb6('0xd'));var deskjs=require(_0x6cb6('0xe'));var toCsv=require(_0x6cb6('0x9'));var querystring=require(_0x6cb6('0xf'));var Papa=require(_0x6cb6('0x10'));var Redis=require(_0x6cb6('0x11'));var authService=require(_0x6cb6('0x12'));var qs=require(_0x6cb6('0x13'));var as=require(_0x6cb6('0x14'));var hardwareService=require(_0x6cb6('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6cb6('0x16'));var db=require(_0x6cb6('0x17'))['db'];function respondWithStatusCode(_0xad49d9,_0x2604e7){_0x2604e7=_0x2604e7||0xcc;return function(_0x585233){if(_0x585233){return _0xad49d9[_0x6cb6('0x18')](_0x2604e7);}return _0xad49d9[_0x6cb6('0x19')](_0x2604e7)['end']();};}function respondWithResult(_0x1e5468,_0x14a581){_0x14a581=_0x14a581||0xc8;return function(_0x5af476){if(_0x5af476){return _0x1e5468[_0x6cb6('0x19')](_0x14a581)[_0x6cb6('0x1a')](_0x5af476);}};}function respondWithFilteredResult(_0x492629,_0x5ab865){return function(_0x505b4d){if(_0x505b4d){var _0x5dd4cd=typeof _0x5ab865[_0x6cb6('0x1b')]===_0x6cb6('0x1c')&&typeof _0x5ab865[_0x6cb6('0x1d')]===_0x6cb6('0x1c');var _0x432e48=_0x505b4d[_0x6cb6('0x1e')];var _0x5b8a17=_0x5dd4cd?0x0:_0x5ab865[_0x6cb6('0x1b')];var _0xc0bdea=_0x5dd4cd?_0x505b4d['count']:_0x5ab865['offset']+_0x5ab865['limit'];var _0x5b5dab;if(_0xc0bdea>=_0x432e48){_0xc0bdea=_0x432e48;_0x5b5dab=0xc8;}else{_0x5b5dab=0xce;}_0x492629['status'](_0x5b5dab);return _0x492629['set'](_0x6cb6('0x1f'),_0x5b8a17+'-'+_0xc0bdea+'/'+_0x432e48)[_0x6cb6('0x1a')](_0x505b4d);}return null;};}function patchUpdates(_0x407455){return function(_0x2d41c4){try{jsonpatch[_0x6cb6('0x20')](_0x2d41c4,_0x407455,!![]);}catch(_0x5e14c8){return BPromise['reject'](_0x5e14c8);}return _0x2d41c4[_0x6cb6('0x21')]();};}function saveUpdates(_0x1d35d1,_0x1c4bcd){return function(_0x153915){if(_0x153915){return _0x153915['update'](_0x1d35d1)[_0x6cb6('0x22')](function(_0x19837e){return _0x19837e;});}return null;};}function removeEntity(_0x58a6ed,_0x5ad4f2){return function(_0xea5ee5){if(_0xea5ee5){return _0xea5ee5['destroy']()[_0x6cb6('0x22')](function(){_0x58a6ed[_0x6cb6('0x19')](0xcc)[_0x6cb6('0x23')]();});}};}function handleEntityNotFound(_0x18ecb9,_0x299830){return function(_0x16db1d){if(!_0x16db1d){_0x18ecb9[_0x6cb6('0x18')](0x194);}return _0x16db1d;};}function handleError(_0xcae6af,_0x1cc1ed){_0x1cc1ed=_0x1cc1ed||0x1f4;return function(_0x112e47){logger['error'](_0x112e47['stack']);if(_0x112e47['name']){delete _0x112e47[_0x6cb6('0x24')];}_0xcae6af[_0x6cb6('0x19')](_0x1cc1ed)[_0x6cb6('0x25')](_0x112e47);};}exports[_0x6cb6('0x26')]=function(_0x1f8c9d,_0x3b62e6){var _0x57cd74={'raw':!![],'where':{'id':_0x1f8c9d['params']['id']}},_0x124291={};_0x124291[_0x6cb6('0x27')]=_['keys'](db[_0x6cb6('0x28')][_0x6cb6('0x29')]);_0x124291[_0x6cb6('0x2a')]=_['keys'](_0x1f8c9d[_0x6cb6('0x2a')]);_0x124291[_0x6cb6('0x2b')]=_[_0x6cb6('0x2c')](_0x124291['model'],_0x124291[_0x6cb6('0x2a')]);_0x57cd74[_0x6cb6('0x2d')]=_[_0x6cb6('0x2c')](_0x124291['model'],qs[_0x6cb6('0x2e')](_0x1f8c9d[_0x6cb6('0x2a')]['fields']));_0x57cd74[_0x6cb6('0x2d')]=_0x57cd74[_0x6cb6('0x2d')][_0x6cb6('0x2f')]?_0x57cd74[_0x6cb6('0x2d')]:_0x124291[_0x6cb6('0x27')];if(_0x1f8c9d[_0x6cb6('0x2a')][_0x6cb6('0x30')]){_0x57cd74[_0x6cb6('0x31')]=[{'all':!![]}];}_0x57cd74=_[_0x6cb6('0x32')]({},_0x57cd74,_0x1f8c9d[_0x6cb6('0x33')]);return db['ChatProactiveAction'][_0x6cb6('0x34')](_0x57cd74)[_0x6cb6('0x22')](handleEntityNotFound(_0x3b62e6,null))[_0x6cb6('0x22')](respondWithResult(_0x3b62e6,null))[_0x6cb6('0x35')](handleError(_0x3b62e6,null));};exports['create']=function(_0x558494,_0x59dd76){return db[_0x6cb6('0x28')][_0x6cb6('0x36')](_0x558494[_0x6cb6('0x37')],{})[_0x6cb6('0x22')](respondWithResult(_0x59dd76,0xc9))[_0x6cb6('0x35')](handleError(_0x59dd76,null));};exports[_0x6cb6('0x38')]=function(_0x317c84,_0x950248){if(_0x317c84['body']['id']){delete _0x317c84[_0x6cb6('0x37')]['id'];}return db['ChatProactiveAction'][_0x6cb6('0x34')]({'where':{'id':_0x317c84[_0x6cb6('0x39')]['id']}})[_0x6cb6('0x22')](handleEntityNotFound(_0x950248,null))[_0x6cb6('0x22')](saveUpdates(_0x317c84[_0x6cb6('0x37')],null))[_0x6cb6('0x22')](respondWithResult(_0x950248,null))[_0x6cb6('0x35')](handleError(_0x950248,null));};exports['destroy']=function(_0x45a2d5,_0x58a304){return db[_0x6cb6('0x28')][_0x6cb6('0x34')]({'where':{'id':_0x45a2d5[_0x6cb6('0x39')]['id']}})['then'](handleEntityNotFound(_0x58a304,null))['then'](removeEntity(_0x58a304,null))[_0x6cb6('0x35')](handleError(_0x58a304,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index c074c2f..d458037 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 _0x14c6=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x14c6,0x149));var _0x614c=function(_0x4212c9,_0x4d5e11){_0x4212c9=_0x4212c9-0x0;var _0x3ba13f=_0x14c6[_0x4212c9];return _0x3ba13f;};'use strict';var _=require('lodash');var util=require(_0x614c('0x0'));var logger=require(_0x614c('0x1'))('api');var moment=require(_0x614c('0x2'));var BPromise=require(_0x614c('0x3'));var rp=require(_0x614c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x614c('0x5'));var config=require(_0x614c('0x6'));var attributes=require(_0x614c('0x7'));module[_0x614c('0x8')]=function(_0x4a8a4e,_0x45aa47){return _0x4a8a4e['define'](_0x614c('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x24a2=['moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','lodash','util','api'];(function(_0xdede30,_0x2df45b){var _0x32edc0=function(_0x54e624){while(--_0x54e624){_0xdede30['push'](_0xdede30['shift']());}};_0x32edc0(++_0x2df45b);}(_0x24a2,0x1dd));var _0x224a=function(_0x5c783d,_0x30cb4f){_0x5c783d=_0x5c783d-0x0;var _0x3e58ba=_0x24a2[_0x5c783d];return _0x3e58ba;};'use strict';var _=require(_0x224a('0x0'));var util=require(_0x224a('0x1'));var logger=require('../../config/logger')(_0x224a('0x2'));var moment=require(_0x224a('0x3'));var BPromise=require(_0x224a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x224a('0x5'));var rimraf=require(_0x224a('0x6'));var config=require(_0x224a('0x7'));var attributes=require(_0x224a('0x8'));module[_0x224a('0x9')]=function(_0x24b9a1,_0xcbebc3){return _0x24b9a1['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','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 bf8225f..cef0812 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 _0x0698=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring'];(function(_0x2c18f5,_0x6ca4d9){var _0x347ae4=function(_0x16fde2){while(--_0x16fde2){_0x2c18f5['push'](_0x2c18f5['shift']());}};_0x347ae4(++_0x6ca4d9);}(_0x0698,0xc4));var _0x8069=function(_0x1408b4,_0x22e866){_0x1408b4=_0x1408b4-0x0;var _0x39276b=_0x0698[_0x1408b4];return _0x39276b;};'use strict';var _=require('lodash');var util=require(_0x8069('0x0'));var moment=require(_0x8069('0x1'));var BPromise=require(_0x8069('0x2'));var rs=require(_0x8069('0x3'));var fs=require('fs');var Redis=require(_0x8069('0x4'));var db=require(_0x8069('0x5'))['db'];var utils=require(_0x8069('0x6'));var logger=require(_0x8069('0x7'))(_0x8069('0x8'));var config=require(_0x8069('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8069('0xa')][_0x8069('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x653c3a,_0x1780d6,_0x33e6d2){return new BPromise(function(_0x3a0ae1,_0xd5e58a){return client[_0x8069('0xc')](_0x653c3a,_0x33e6d2)[_0x8069('0xd')](function(_0x3074e9){logger[_0x8069('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x1780d6,_0x8069('0xf'));logger[_0x8069('0x10')](_0x8069('0x11'),_0x1780d6,_0x8069('0xf'),JSON[_0x8069('0x12')](_0x3074e9));if(_0x3074e9[_0x8069('0x13')]){if(_0x3074e9[_0x8069('0x13')][_0x8069('0x14')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1780d6,_0x3074e9['error'][_0x8069('0x15')]);return _0xd5e58a(_0x3074e9[_0x8069('0x13')]['message']);}logger[_0x8069('0x13')](_0x8069('0x16'),_0x1780d6,_0x3074e9[_0x8069('0x13')][_0x8069('0x15')]);return _0x3a0ae1(_0x3074e9[_0x8069('0x13')]['message']);}else{logger[_0x8069('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x1780d6,'request\x20sent');_0x3a0ae1(_0x3074e9[_0x8069('0x17')][_0x8069('0x15')]);}})[_0x8069('0x18')](function(_0x4090d6){logger[_0x8069('0x13')](_0x8069('0x16'),_0x1780d6,_0x4090d6);_0xd5e58a(_0x4090d6);});});}
\ No newline at end of file
+var _0x05ee=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x05ee,0x1c4));var _0xe05e=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x05ee[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0xe05e('0x0'));var util=require(_0xe05e('0x1'));var moment=require(_0xe05e('0x2'));var BPromise=require(_0xe05e('0x3'));var rs=require(_0xe05e('0x4'));var fs=require('fs');var Redis=require(_0xe05e('0x5'));var db=require(_0xe05e('0x6'))['db'];var utils=require(_0xe05e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe05e('0x8'));var jayson=require(_0xe05e('0x9'));var client=jayson[_0xe05e('0xa')][_0xe05e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31f1e2,_0x390123,_0x526c53){return new BPromise(function(_0x4afb7f,_0x27fa27){return client[_0xe05e('0xc')](_0x31f1e2,_0x526c53)[_0xe05e('0xd')](function(_0x2a5b58){logger[_0xe05e('0xe')](_0xe05e('0xf'),_0x390123,'request\x20sent');logger[_0xe05e('0x10')](_0xe05e('0x11'),_0x390123,_0xe05e('0x12'),JSON[_0xe05e('0x13')](_0x2a5b58));if(_0x2a5b58[_0xe05e('0x14')]){if(_0x2a5b58[_0xe05e('0x14')][_0xe05e('0x15')]===0x1f4){logger[_0xe05e('0x14')](_0xe05e('0xf'),_0x390123,_0x2a5b58[_0xe05e('0x14')]['message']);return _0x27fa27(_0x2a5b58['error'][_0xe05e('0x16')]);}logger['error'](_0xe05e('0xf'),_0x390123,_0x2a5b58['error'][_0xe05e('0x16')]);return _0x4afb7f(_0x2a5b58['error']['message']);}else{logger[_0xe05e('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x390123,_0xe05e('0x12'));_0x4afb7f(_0x2a5b58[_0xe05e('0x17')][_0xe05e('0x16')]);}})[_0xe05e('0x18')](function(_0x5a6ac5){logger[_0xe05e('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x390123,_0x5a6ac5);_0x27fa27(_0x5a6ac5);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 500dc41..bd9e811 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 _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2260a0,_0x2cb170){var _0x3978d7=function(_0x30844d){while(--_0x30844d){_0x2260a0['push'](_0x2260a0['shift']());}};_0x3978d7(++_0x2cb170);}(_0x6aa7,0x178));var _0x76aa=function(_0x2512ed,_0x283e80){_0x2512ed=_0x2512ed-0x0;var _0x1debf0=_0x6aa7[_0x2512ed];return _0x1debf0;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router;
\ No newline at end of file
+var _0x1cb9=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller'];(function(_0x367dbd,_0x106eba){var _0x3ddb21=function(_0x1107f5){while(--_0x1107f5){_0x367dbd['push'](_0x367dbd['shift']());}};_0x3ddb21(++_0x106eba);}(_0x1cb9,0x14e));var _0x91cb=function(_0x33a2e3,_0x12e5a3){_0x33a2e3=_0x33a2e3-0x0;var _0xce0f1f=_0x1cb9[_0x33a2e3];return _0xce0f1f;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0xb')]);router[_0x91cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x91cb('0xd')]);router['put'](_0x91cb('0x9'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0x10')]);module[_0x91cb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index e6aad3b..b465cf3 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 _0x7101=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7101,0x78));var _0x1710=function(_0x46b0ba,_0x5a767c){_0x46b0ba=_0x46b0ba-0x0;var _0x2e53e0=_0x7101[_0x46b0ba];return _0x2e53e0;};'use strict';var Sequelize=require(_0x1710('0x0'));module[_0x1710('0x1')]={'name':{'type':Sequelize[_0x1710('0x2')],'unique':_0x1710('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1710('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1710('0x5')](_0x1710('0x6'),_0x1710('0x7'),'roundrobin')}};
\ No newline at end of file
+var _0xc299=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x177cc9,_0x3f6fdd){var _0x2fe577=function(_0xa98e83){while(--_0xa98e83){_0x177cc9['push'](_0x177cc9['shift']());}};_0x2fe577(++_0x3f6fdd);}(_0xc299,0xe0));var _0x9c29=function(_0x584d37,_0x13fb20){_0x584d37=_0x584d37-0x0;var _0x1a1dbf=_0xc299[_0x584d37];return _0x1a1dbf;};'use strict';var Sequelize=require(_0x9c29('0x0'));module[_0x9c29('0x1')]={'name':{'type':Sequelize[_0x9c29('0x2')],'unique':_0x9c29('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9c29('0x2')]},'timeout':{'type':Sequelize[_0x9c29('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9c29('0x5')](_0x9c29('0x6'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 48914cc..098e045 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 _0x4990=['updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','get','ChatQueues','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filters','findAll','User','findAndCountAll','UserId','agent','chatPause'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x4990,0xc8));var _0x0499=function(_0x3074f1,_0x4901aa){_0x3074f1=_0x3074f1-0x0;var _0x149af8=_0x4990[_0x3074f1];return _0x149af8;};'use strict';var emlformat=require(_0x0499('0x0'));var rimraf=require(_0x0499('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0499('0x2'));var rp=require(_0x0499('0x3'));var moment=require(_0x0499('0x4'));var BPromise=require(_0x0499('0x5'));var Mustache=require(_0x0499('0x6'));var util=require('util');var path=require(_0x0499('0x7'));var sox=require(_0x0499('0x8'));var csv=require(_0x0499('0x9'));var ejs=require(_0x0499('0xa'));var fs=require('fs');var fs_extra=require(_0x0499('0xb'));var _=require('lodash');var squel=require(_0x0499('0xc'));var crypto=require(_0x0499('0xd'));var jsforce=require(_0x0499('0xe'));var deskjs=require(_0x0499('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0499('0x10'));var Papa=require('papaparse');var Redis=require(_0x0499('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0499('0x12'));var as=require(_0x0499('0x13'));var hardwareService=require(_0x0499('0x14'));var logger=require(_0x0499('0x15'))(_0x0499('0x16'));var utils=require(_0x0499('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0499('0x18'));var db=require(_0x0499('0x19'))['db'];config[_0x0499('0x1a')]=_[_0x0499('0x1b')](config[_0x0499('0x1a')],{'host':_0x0499('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0499('0x1a')]));require(_0x0499('0x1d'))['register'](socket);var jayson=require(_0x0499('0x1e'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dde1c,_0x376b70,_0x34fe20,_0x247e9a){return new BPromise(function(_0x4ad0d6,_0x40af46){var _0x5e82cb=_0x247e9a||client;return _0x5e82cb[_0x0499('0x1f')](_0x4dde1c,_0x34fe20)[_0x0499('0x20')](function(_0x4fc9a5){logger[_0x0499('0x21')](_0x0499('0x22'),_0x376b70,_0x0499('0x23'));logger[_0x0499('0x24')](_0x0499('0x25'),_0x376b70,_0x0499('0x23'),JSON[_0x0499('0x26')](_0x4fc9a5));if(_0x4fc9a5[_0x0499('0x27')]){if(_0x4fc9a5[_0x0499('0x27')][_0x0499('0x28')]===0x1f4){logger[_0x0499('0x27')](_0x0499('0x22'),_0x376b70,_0x4fc9a5[_0x0499('0x27')][_0x0499('0x29')]);return _0x40af46(_0x4fc9a5['error']['message']);}logger[_0x0499('0x27')](_0x0499('0x22'),_0x376b70,_0x4fc9a5[_0x0499('0x27')][_0x0499('0x29')]);return _0x4ad0d6(_0x4fc9a5[_0x0499('0x27')][_0x0499('0x29')]);}else{logger[_0x0499('0x21')](_0x0499('0x22'),_0x376b70,_0x0499('0x23'));_0x4ad0d6(_0x4fc9a5['result'][_0x0499('0x29')]);}})[_0x0499('0x2a')](function(_0x1c9d32){logger[_0x0499('0x27')](_0x0499('0x22'),_0x376b70,_0x1c9d32);_0x40af46(_0x1c9d32);});});}function respondWithStatusCode(_0x57f193,_0x1dacfc){_0x1dacfc=_0x1dacfc||0xcc;return function(_0x4d97cb){if(_0x4d97cb){return _0x57f193['sendStatus'](_0x1dacfc);}return _0x57f193['status'](_0x1dacfc)['end']();};}function respondWithResult(_0xbd27d4,_0x2b58c5){_0x2b58c5=_0x2b58c5||0xc8;return function(_0x3f3d2b){if(_0x3f3d2b){return _0xbd27d4[_0x0499('0x2b')](_0x2b58c5)[_0x0499('0x2c')](_0x3f3d2b);}};}function respondWithFilteredResult(_0x9819d,_0x69acad){return function(_0xfd548f){if(_0xfd548f){var _0x330c91=typeof _0x69acad[_0x0499('0x2d')]===_0x0499('0x2e')&&typeof _0x69acad[_0x0499('0x2f')]===_0x0499('0x2e');var _0x3ebc1c=_0xfd548f[_0x0499('0x30')];var _0x3457da=_0x330c91?0x0:_0x69acad[_0x0499('0x2d')];var _0x54f9be=_0x330c91?_0xfd548f[_0x0499('0x30')]:_0x69acad[_0x0499('0x2d')]+_0x69acad[_0x0499('0x2f')];var _0x111ce;if(_0x54f9be>=_0x3ebc1c){_0x54f9be=_0x3ebc1c;_0x111ce=0xc8;}else{_0x111ce=0xce;}_0x9819d[_0x0499('0x2b')](_0x111ce);return _0x9819d[_0x0499('0x31')](_0x0499('0x32'),_0x3457da+'-'+_0x54f9be+'/'+_0x3ebc1c)[_0x0499('0x2c')](_0xfd548f);}return null;};}function patchUpdates(_0x10f389){return function(_0x54989d){try{jsonpatch['apply'](_0x54989d,_0x10f389,!![]);}catch(_0x2630ad){return BPromise['reject'](_0x2630ad);}return _0x54989d['save']();};}function saveUpdates(_0x35a2f0,_0x403dd8){return function(_0x5ef86b){if(_0x5ef86b){return _0x5ef86b[_0x0499('0x33')](_0x35a2f0)[_0x0499('0x20')](function(_0x2dd210){return _0x2dd210;});}return null;};}function removeEntity(_0x3bbc8f,_0x3b9cbb){return function(_0x33e01c){if(_0x33e01c){return _0x33e01c['destroy']()['then'](function(){var _0x232e4d=_0x33e01c[_0x0499('0x34')]({'plain':!![]});var _0x328cfe=_0x0499('0x35');return db[_0x0499('0x36')][_0x0499('0x37')]({'where':{'type':_0x328cfe,'resourceId':_0x232e4d['id']}})[_0x0499('0x20')](function(){return _0x33e01c;});})[_0x0499('0x20')](function(){_0x3bbc8f[_0x0499('0x2b')](0xcc)[_0x0499('0x38')]();});}};}function handleEntityNotFound(_0x388db9,_0x1f2008){return function(_0x47dd58){if(!_0x47dd58){_0x388db9[_0x0499('0x39')](0x194);}return _0x47dd58;};}function handleError(_0x1bf257,_0x232d37){_0x232d37=_0x232d37||0x1f4;return function(_0x32e764){logger['error'](_0x32e764[_0x0499('0x3a')]);if(_0x32e764[_0x0499('0x3b')]){delete _0x32e764[_0x0499('0x3b')];}_0x1bf257[_0x0499('0x2b')](_0x232d37)[_0x0499('0x3c')](_0x32e764);};}exports[_0x0499('0x3d')]=function(_0x1d2037,_0x5b858a){var _0x45c6e2={},_0x5ab8bf={},_0x594d59={'count':0x0,'rows':[]};var _0x1f7a71=_[_0x0499('0x3e')](db[_0x0499('0x3f')][_0x0499('0x40')],function(_0x3cd2ba){return{'name':_0x3cd2ba[_0x0499('0x41')],'type':_0x3cd2ba[_0x0499('0x42')][_0x0499('0x43')]};});_0x5ab8bf[_0x0499('0x44')]=_[_0x0499('0x3e')](_0x1f7a71,_0x0499('0x3b'));_0x5ab8bf[_0x0499('0x45')]=_[_0x0499('0x46')](_0x1d2037[_0x0499('0x45')]);_0x5ab8bf['filters']=_[_0x0499('0x47')](_0x5ab8bf['model'],_0x5ab8bf[_0x0499('0x45')]);_0x45c6e2[_0x0499('0x48')]=_[_0x0499('0x47')](_0x5ab8bf['model'],qs[_0x0499('0x49')](_0x1d2037[_0x0499('0x45')]['fields']));_0x45c6e2[_0x0499('0x48')]=_0x45c6e2[_0x0499('0x48')]['length']?_0x45c6e2[_0x0499('0x48')]:_0x5ab8bf[_0x0499('0x44')];if(!_0x1d2037[_0x0499('0x45')][_0x0499('0x4a')](_0x0499('0x4b'))){_0x45c6e2[_0x0499('0x2f')]=qs['limit'](_0x1d2037['query'][_0x0499('0x2f')]);_0x45c6e2['offset']=qs['offset'](_0x1d2037['query'][_0x0499('0x2d')]);}_0x45c6e2[_0x0499('0x4c')]=qs[_0x0499('0x4d')](_0x1d2037['query'][_0x0499('0x4d')]);_0x45c6e2[_0x0499('0x4e')]=qs['filters'](_[_0x0499('0x4f')](_0x1d2037[_0x0499('0x45')],_0x5ab8bf['filters']),_0x1f7a71);if(_0x1d2037[_0x0499('0x45')][_0x0499('0x50')]){_0x45c6e2[_0x0499('0x4e')]=_[_0x0499('0x51')](_0x45c6e2[_0x0499('0x4e')],{'$or':_['map'](_0x1f7a71,function(_0x163ea6){if(_0x163ea6['type']!==_0x0499('0x52')){var _0x557600={};_0x557600[_0x163ea6['name']]={'$like':'%'+_0x1d2037[_0x0499('0x45')][_0x0499('0x50')]+'%'};return _0x557600;}})});}_0x45c6e2=_[_0x0499('0x51')]({},_0x45c6e2,_0x1d2037['options']);var _0x54a6f0={'where':_0x45c6e2[_0x0499('0x4e')]};return db[_0x0499('0x3f')][_0x0499('0x30')](_0x54a6f0)[_0x0499('0x20')](function(_0x492c21){_0x594d59[_0x0499('0x30')]=_0x492c21;if(_0x1d2037[_0x0499('0x45')][_0x0499('0x53')]){_0x45c6e2['include']=[{'all':!![]}];}return db[_0x0499('0x3f')]['findAll'](_0x45c6e2);})[_0x0499('0x20')](function(_0x106237){_0x594d59[_0x0499('0x54')]=_0x106237;return _0x594d59;})[_0x0499('0x20')](respondWithFilteredResult(_0x5b858a,_0x45c6e2))[_0x0499('0x2a')](handleError(_0x5b858a,null));};exports[_0x0499('0x55')]=function(_0x2a8e93,_0x1c2943){var _0x146909={'raw':!![],'where':{'id':_0x2a8e93[_0x0499('0x56')]['id']}},_0x55c976={};_0x55c976[_0x0499('0x44')]=_['keys'](db[_0x0499('0x3f')][_0x0499('0x40')]);_0x55c976[_0x0499('0x45')]=_[_0x0499('0x46')](_0x2a8e93[_0x0499('0x45')]);_0x55c976['filters']=_[_0x0499('0x47')](_0x55c976['model'],_0x55c976[_0x0499('0x45')]);_0x146909[_0x0499('0x48')]=_[_0x0499('0x47')](_0x55c976[_0x0499('0x44')],qs[_0x0499('0x49')](_0x2a8e93[_0x0499('0x45')][_0x0499('0x49')]));_0x146909['attributes']=_0x146909['attributes'][_0x0499('0x57')]?_0x146909[_0x0499('0x48')]:_0x55c976[_0x0499('0x44')];if(_0x2a8e93[_0x0499('0x45')][_0x0499('0x53')]){_0x146909['include']=[{'all':!![]}];}_0x146909=_[_0x0499('0x51')]({},_0x146909,_0x2a8e93[_0x0499('0x58')]);return db[_0x0499('0x3f')][_0x0499('0x59')](_0x146909)[_0x0499('0x20')](handleEntityNotFound(_0x1c2943,null))[_0x0499('0x20')](respondWithResult(_0x1c2943,null))[_0x0499('0x2a')](handleError(_0x1c2943,null));};exports[_0x0499('0x5a')]=function(_0x2befbd,_0x288b0f){return db[_0x0499('0x3f')]['create'](_0x2befbd[_0x0499('0x5b')],{})[_0x0499('0x20')](function(_0x4cba88){var _0x5ec53d=_0x2befbd['user'][_0x0499('0x34')]({'plain':!![]});if(!_0x5ec53d)throw new Error(_0x0499('0x5c'));if(_0x5ec53d[_0x0499('0x5d')]==='user'){var _0x30c44c=_0x4cba88[_0x0499('0x34')]({'plain':!![]});var _0x2b5ce9=_0x0499('0x35');return db[_0x0499('0x5e')]['find']({'where':{'name':_0x2b5ce9,'userProfileId':_0x5ec53d['userProfileId']},'raw':!![]})[_0x0499('0x20')](function(_0x4a7706){if(_0x4a7706&&_0x4a7706[_0x0499('0x5f')]===0x0){return db[_0x0499('0x36')]['create']({'name':_0x30c44c[_0x0499('0x3b')],'resourceId':_0x30c44c['id'],'type':_0x4a7706['name'],'sectionId':_0x4a7706['id']},{})[_0x0499('0x20')](function(){return _0x4cba88;});}else{return _0x4cba88;}})['catch'](function(_0x2d9078){logger[_0x0499('0x27')](_0x0499('0x60'),_0x2d9078);throw _0x2d9078;});}return _0x4cba88;})[_0x0499('0x20')](respondWithResult(_0x288b0f,0xc9))[_0x0499('0x2a')](handleError(_0x288b0f,null));};exports[_0x0499('0x33')]=function(_0x40a438,_0x43f1f7){if(_0x40a438[_0x0499('0x5b')]['id']){delete _0x40a438['body']['id'];}return db[_0x0499('0x3f')][_0x0499('0x59')]({'where':{'id':_0x40a438[_0x0499('0x56')]['id']}})[_0x0499('0x20')](handleEntityNotFound(_0x43f1f7,null))['then'](saveUpdates(_0x40a438[_0x0499('0x5b')],null))[_0x0499('0x20')](respondWithResult(_0x43f1f7,null))[_0x0499('0x2a')](handleError(_0x43f1f7,null));};exports['destroy']=function(_0x5ee89d,_0x52ab71){return db[_0x0499('0x3f')][_0x0499('0x59')]({'where':{'id':_0x5ee89d[_0x0499('0x56')]['id']}})['then'](handleEntityNotFound(_0x52ab71,null))['then'](removeEntity(_0x52ab71,null))['catch'](handleError(_0x52ab71,null));};exports[_0x0499('0x61')]=function(_0x200b83,_0x1f5989){return db[_0x0499('0x3f')][_0x0499('0x61')]()[_0x0499('0x20')](respondWithResult(_0x1f5989,null))[_0x0499('0x2a')](handleError(_0x1f5989,null));};exports[_0x0499('0x62')]=function(_0x2ac0ca,_0x1bcbb3,_0x11cabc){var _0x524aed={'raw':!![],'where':{}},_0x1d3680={},_0x3148ba;return db['ChatQueue'][_0x0499('0x63')]({'where':{'id':_0x2ac0ca[_0x0499('0x56')]['id']}})[_0x0499('0x20')](handleEntityNotFound(_0x1bcbb3,null))['then'](function(_0x1e0050){if(_0x1e0050){_0x3148ba=_0x1e0050[_0x0499('0x34')]({'plain':!![]});_0x1d3680['model']=_['keys'](db[_0x0499('0x64')][_0x0499('0x40')]);_0x1d3680['query']=_[_0x0499('0x46')](_0x2ac0ca[_0x0499('0x45')]);_0x1d3680[_0x0499('0x65')]=_[_0x0499('0x47')](_0x1d3680[_0x0499('0x44')],_0x1d3680[_0x0499('0x45')]);_0x524aed['attributes']=_[_0x0499('0x47')](_0x1d3680[_0x0499('0x44')],qs[_0x0499('0x49')](_0x2ac0ca[_0x0499('0x45')][_0x0499('0x49')]));_0x524aed[_0x0499('0x48')]=_0x524aed[_0x0499('0x48')][_0x0499('0x57')]?_0x524aed[_0x0499('0x48')]:_0x1d3680['model'];if(!_0x2ac0ca[_0x0499('0x45')][_0x0499('0x4a')](_0x0499('0x4b'))){_0x524aed['limit']=qs['limit'](_0x2ac0ca[_0x0499('0x45')][_0x0499('0x2f')]);_0x524aed['offset']=qs[_0x0499('0x2d')](_0x2ac0ca['query'][_0x0499('0x2d')]);}_0x524aed['order']=qs[_0x0499('0x4d')](_0x2ac0ca[_0x0499('0x45')][_0x0499('0x4d')]);_0x524aed[_0x0499('0x4e')]=qs[_0x0499('0x65')](_[_0x0499('0x4f')](_0x2ac0ca[_0x0499('0x45')],_0x1d3680['filters']));_0x524aed[_0x0499('0x4e')]['ChatQueueId']=_0x1e0050['id'];if(_0x2ac0ca[_0x0499('0x45')][_0x0499('0x50')]){_0x524aed[_0x0499('0x4e')]=_['merge'](_0x524aed['where'],{'$or':_[_0x0499('0x3e')](_0x524aed[_0x0499('0x48')],function(_0x6e5528){var _0x355da0={};_0x355da0[_0x6e5528]={'$like':'%'+_0x2ac0ca['query'][_0x0499('0x50')]+'%'};return _0x355da0;})});}_0x524aed=_[_0x0499('0x51')]({},_0x524aed,_0x2ac0ca[_0x0499('0x58')]);return db[_0x0499('0x64')][_0x0499('0x66')](_0x524aed);}})[_0x0499('0x20')](function(_0x1f50f8){if(_0x1f50f8){return db[_0x0499('0x67')][_0x0499('0x68')]({'where':{'id':_[_0x0499('0x3e')](_0x1f50f8,_0x0499('0x69')),'role':_0x0499('0x6a')},'attributes':['id','name',_0x0499('0x6b'),_0x0499('0x6c'),_0x0499('0x6d')]});}})[_0x0499('0x20')](function(_0x2c8743){if(_0x2c8743){return{'count':_0x2c8743[_0x0499('0x30')],'rows':_[_0x0499('0x3e')](_0x2c8743['rows'],function(_0x2d2b13){return{'membername':_0x2d2b13[_0x0499('0x3b')],'UserId':_0x2d2b13['id'],'queue_name':_0x3148ba[_0x0499('0x3b')],'ChatQueueId':_0x3148ba['id'],'interface':util['format']('%s/%s',_0x0499('0x6e'),_0x2d2b13['name']),'penalty':0x0,'paused':_0x2d2b13[_0x0499('0x6b')],'createdAt':_0x2d2b13[_0x0499('0x6d')],'updatedAt':_0x2d2b13[_0x0499('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0499('0x20')](respondWithFilteredResult(_0x1bcbb3,_0x524aed))[_0x0499('0x2a')](handleError(_0x1bcbb3,null));};exports[_0x0499('0x6f')]=function(_0x27b607,_0x43905e,_0x47826b){var _0x30e822={};var _0xc69f27={};var _0x4851a7;var _0x5711da;return db['ChatQueue'][_0x0499('0x63')]({'where':{'id':_0x27b607[_0x0499('0x56')]['id']}})['then'](handleEntityNotFound(_0x43905e,null))[_0x0499('0x20')](function(_0x26a6e0){if(_0x26a6e0){_0x4851a7=_0x26a6e0;_0xc69f27[_0x0499('0x44')]=_[_0x0499('0x46')](db[_0x0499('0x70')][_0x0499('0x40')]);_0xc69f27[_0x0499('0x45')]=_['keys'](_0x27b607[_0x0499('0x45')]);_0xc69f27[_0x0499('0x65')]=_[_0x0499('0x47')](_0xc69f27[_0x0499('0x44')],_0xc69f27[_0x0499('0x45')]);_0x30e822[_0x0499('0x48')]=_[_0x0499('0x47')](_0xc69f27[_0x0499('0x44')],qs['fields'](_0x27b607[_0x0499('0x45')][_0x0499('0x49')]));_0x30e822[_0x0499('0x48')]=_0x30e822[_0x0499('0x48')][_0x0499('0x57')]?_0x30e822[_0x0499('0x48')]:_0xc69f27[_0x0499('0x44')];_0x30e822[_0x0499('0x4c')]=qs['sort'](_0x27b607[_0x0499('0x45')]['sort']);_0x30e822[_0x0499('0x4e')]=qs[_0x0499('0x65')](_[_0x0499('0x4f')](_0x27b607[_0x0499('0x45')],_0xc69f27[_0x0499('0x65')]));if(_0x27b607[_0x0499('0x45')][_0x0499('0x50')]){_0x30e822[_0x0499('0x4e')]=_[_0x0499('0x51')](_0x30e822['where'],{'$or':_['map'](_0x30e822[_0x0499('0x48')],function(_0x606270){var _0x1678db={};_0x1678db[_0x606270]={'$like':'%'+_0x27b607[_0x0499('0x45')]['filter']+'%'};return _0x1678db;})});}_0x30e822=_[_0x0499('0x51')]({},_0x30e822,_0x27b607[_0x0499('0x58')]);return _0x4851a7[_0x0499('0x6f')](_0x30e822);}})[_0x0499('0x20')](function(_0x2d1c65){if(_0x2d1c65){_0x5711da=_0x2d1c65[_0x0499('0x57')];if(!_0x27b607[_0x0499('0x45')]['hasOwnProperty'](_0x0499('0x4b'))){_0x30e822[_0x0499('0x2f')]=qs[_0x0499('0x2f')](_0x27b607[_0x0499('0x45')][_0x0499('0x2f')]);_0x30e822[_0x0499('0x2d')]=qs[_0x0499('0x2d')](_0x27b607['query']['offset']);}return _0x4851a7['getTeams'](_0x30e822);}})['then'](function(_0x39d9e2){if(_0x39d9e2){return _0x39d9e2?{'count':_0x5711da,'rows':_0x39d9e2}:null;}})['then'](respondWithResult(_0x43905e,null))['catch'](handleError(_0x43905e,null));};exports[_0x0499('0x71')]=function(_0xa3ee62,_0x1193bb,_0x27b0a1){var _0x4b0e84=_0xa3ee62[_0x0499('0x5b')][_0x0499('0x72')];return db[_0x0499('0x70')][_0x0499('0x66')]({'where':{'id':_0x4b0e84},'attributes':['id'],'include':[{'model':db[_0x0499('0x67')],'as':_0x0499('0x73'),'attributes':['id',_0x0499('0x3b'),_0x0499('0x74'),'voicePause',_0x0499('0x75')],'raw':!![]}]})[_0x0499('0x20')](function(_0x4e27d4){if(_0x4e27d4){var _0x329779=_[_0x0499('0x76')](_0x4e27d4,function(_0x575a47){var _0xb73530=_0x575a47[_0x0499('0x34')]({'plain':!![]});return _0xb73530[_0x0499('0x73')];});return db[_0x0499('0x3f')]['find']({'where':{'id':_0xa3ee62[_0x0499('0x56')]['id']}})[_0x0499('0x20')](function(_0x16b231){return db[_0x0499('0x77')][_0x0499('0x78')](function(_0x3abe2b){return _0x16b231[_0x0499('0x71')](_0x4b0e84,{'transaction':_0x3abe2b})[_0x0499('0x20')](function(){return BPromise[_0x0499('0x79')](_0x329779,function(_0x5e8def){return db[_0x0499('0x64')][_0x0499('0x7a')]({'where':{'UserId':_0x5e8def['id'],'ChatQueueId':_0xa3ee62[_0x0499('0x56')]['id']},'transaction':_0x3abe2b});});})[_0x0499('0x20')](function(){_0x329779[_0x0499('0x7b')](function(_0x59d462){socket[_0x0499('0x7c')](_0x0499('0x7d'),{'UserId':_0x59d462['id'],'ChatQueueId':_0x16b231['id']});});});});});}})[_0x0499('0x20')](respondWithStatusCode(_0x1193bb,null))[_0x0499('0x2a')](handleError(_0x1193bb,null));};exports[_0x0499('0x7e')]=function(_0x524b07,_0x45cc1b,_0x53817b){return db[_0x0499('0x70')]['findAll']({'where':{'id':_0x524b07[_0x0499('0x45')][_0x0499('0x72')]},'attributes':['id'],'include':[{'model':db[_0x0499('0x67')],'as':_0x0499('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x45cc1b,null))[_0x0499('0x20')](function(_0x967c49){var _0x52de6a=_[_0x0499('0x3e')](_0x967c49,'id');var _0x49ac44=[];var _0x7ff5c=[];var _0x317de2=squel[_0x0499('0x7f')]();_0x317de2[_0x0499('0x80')](_0x0499('0x81'))[_0x0499('0x82')](_0x0499('0x83'),'tq')[_0x0499('0x84')](_0x0499('0x85'),'ut',_0x0499('0x86'))[_0x0499('0x4e')](_0x0499('0x87'),_0x524b07[_0x0499('0x56')]['id']);for(var _0x4f08b8=0x0;_0x4f08b8<_0x967c49[_0x0499('0x57')];_0x4f08b8+=0x1){let _0x1a839f=_0x967c49[_0x4f08b8];for(var _0x4131bb=0x0;_0x4131bb<_0x1a839f['Agents'][_0x0499('0x57')];_0x4131bb+=0x1){let _0x49dda4=_0x1a839f['Agents'][_0x4131bb];var _0x52b9e8=_0x317de2['clone']();_0x52b9e8[_0x0499('0x4e')](_0x0499('0x88'),_0x49dda4['id']);_0x7ff5c[_0x0499('0x89')](db['sequelize'][_0x0499('0x45')](_0x52b9e8['toString'](),{'type':db[_0x0499('0x77')][_0x0499('0x8a')][_0x0499('0x8b')]})['then'](function(_0x519479){if(_0x519479[_0x0499('0x57')]===0x1){return _0x49dda4['id'];}else{var _0x125683=_[_0x0499('0x8c')](_['map'](_0x519479,'TeamId'),function(_0x28d7ad){return _[_0x0499('0x8d')](_0x52de6a,_0x28d7ad);});if(_0x125683){return _0x49dda4['id'];}}}));}}return BPromise[_0x0499('0x8e')](_0x7ff5c)[_0x0499('0x20')](function(_0x50dd95){_0x49ac44=_(_0x49ac44)[_0x0499('0x8f')](_0x50dd95)[_0x0499('0x90')]()[_0x0499('0x91')]();return db[_0x0499('0x3f')][_0x0499('0x59')]({'where':{'id':_0x524b07['params']['id']}})[_0x0499('0x20')](function(_0x411452){return db[_0x0499('0x77')][_0x0499('0x78')](function(_0x40dab9){return _0x411452[_0x0499('0x7e')](_0x524b07[_0x0499('0x45')][_0x0499('0x72')],{'transaction':_0x40dab9})['then'](function(){if(!_[_0x0499('0x92')](_0x49ac44)){return _0x411452[_0x0499('0x93')](_0x49ac44,{'transaction':_0x40dab9});}})[_0x0499('0x20')](function(){_0x49ac44[_0x0499('0x7b')](function(_0x1b8954){socket[_0x0499('0x7c')](_0x0499('0x94'),{'UserId':_0x1b8954,'ChatQueueId':_0x411452['id']});});});});});});})['then'](respondWithStatusCode(_0x45cc1b,null))[_0x0499('0x2a')](handleError(_0x45cc1b,null));};exports[_0x0499('0x95')]=function(_0x4a9889,_0x4730ac,_0x172151){return db['ChatQueue'][_0x0499('0x59')]({'where':{'id':_0x4a9889[_0x0499('0x56')]['id']}})[_0x0499('0x20')](handleEntityNotFound(_0x4730ac,null))[_0x0499('0x20')](function(_0x46c4b5){if(_0x46c4b5){return _0x46c4b5[_0x0499('0x95')](_0x4a9889['body'][_0x0499('0x72')],_[_0x0499('0x96')](_0x4a9889[_0x0499('0x5b')],['ids','id'])||{})[_0x0499('0x97')](function(_0x3691ed){for(var _0x4d674a=0x0;_0x4d674a<_0x4a9889[_0x0499('0x5b')][_0x0499('0x72')][_0x0499('0x57')];_0x4d674a+=0x1){socket[_0x0499('0x7c')](_0x0499('0x7d'),{'UserId':Number(_0x4a9889['body'][_0x0499('0x72')][_0x4d674a]),'ChatQueueId':Number(_0x4a9889['params']['id'])});}return _0x3691ed;});}})[_0x0499('0x20')](respondWithResult(_0x4730ac,null))[_0x0499('0x2a')](handleError(_0x4730ac,null));};exports[_0x0499('0x93')]=function(_0x1b7928,_0x1ca036,_0x38a213){return db[_0x0499('0x3f')][_0x0499('0x59')]({'where':{'id':_0x1b7928[_0x0499('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ca036,null))['then'](function(_0xa888a3){if(_0xa888a3){return _0xa888a3[_0x0499('0x93')](_0x1b7928[_0x0499('0x45')][_0x0499('0x72')])[_0x0499('0x20')](function(){if(_[_0x0499('0x98')](_0x1b7928[_0x0499('0x45')][_0x0499('0x72')])){for(var _0x48d218=0x0;_0x48d218<_0x1b7928[_0x0499('0x45')]['ids']['length'];_0x48d218+=0x1){socket[_0x0499('0x7c')](_0x0499('0x94'),{'UserId':Number(_0x1b7928[_0x0499('0x45')][_0x0499('0x72')][_0x48d218]),'ChatQueueId':Number(_0x1b7928[_0x0499('0x56')]['id'])});}}else{socket[_0x0499('0x7c')](_0x0499('0x94'),{'UserId':Number(_0x1b7928[_0x0499('0x45')][_0x0499('0x72')]),'ChatQueueId':Number(_0x1b7928[_0x0499('0x56')]['id'])});}});}})[_0x0499('0x20')](respondWithStatusCode(_0x1ca036,null))[_0x0499('0x2a')](handleError(_0x1ca036,null));};exports[_0x0499('0x99')]=function(_0x7b912b,_0x32b757,_0x36b422){var _0x2d6d56={};var _0x2ef60b={};var _0x2db2fa;var _0x1d9c48;return db[_0x0499('0x3f')][_0x0499('0x63')]({'where':{'id':_0x7b912b[_0x0499('0x56')]['id']}})['then'](handleEntityNotFound(_0x32b757,null))[_0x0499('0x20')](function(_0x588299){if(_0x588299){_0x2db2fa=_0x588299;_0x2ef60b[_0x0499('0x44')]=_['keys'](db[_0x0499('0x67')][_0x0499('0x40')]);_0x2ef60b[_0x0499('0x45')]=_['keys'](_0x7b912b[_0x0499('0x45')]);_0x2ef60b[_0x0499('0x65')]=_[_0x0499('0x47')](_0x2ef60b[_0x0499('0x44')],_0x2ef60b[_0x0499('0x45')]);_0x2d6d56[_0x0499('0x48')]=_['intersection'](_0x2ef60b['model'],qs[_0x0499('0x49')](_0x7b912b[_0x0499('0x45')][_0x0499('0x49')]));_0x2d6d56[_0x0499('0x48')]=_0x2d6d56[_0x0499('0x48')][_0x0499('0x57')]?_0x2d6d56[_0x0499('0x48')]:_0x2ef60b[_0x0499('0x44')];_0x2d6d56[_0x0499('0x4c')]=qs[_0x0499('0x4d')](_0x7b912b['query']['sort']);_0x2d6d56[_0x0499('0x4e')]=qs[_0x0499('0x65')](_['pick'](_0x7b912b[_0x0499('0x45')],_0x2ef60b[_0x0499('0x65')]));if(_0x7b912b[_0x0499('0x45')][_0x0499('0x50')]){_0x2d6d56[_0x0499('0x4e')]=_[_0x0499('0x51')](_0x2d6d56['where'],{'$or':_[_0x0499('0x3e')](_0x2d6d56[_0x0499('0x48')],function(_0x1b75fb){var _0x1a8b78={};_0x1a8b78[_0x1b75fb]={'$like':'%'+_0x7b912b[_0x0499('0x45')][_0x0499('0x50')]+'%'};return _0x1a8b78;})});}_0x2d6d56=_['merge']({},_0x2d6d56,_0x7b912b['options']);return _0x2db2fa[_0x0499('0x99')](_0x2d6d56);}})[_0x0499('0x20')](function(_0x598942){if(_0x598942){_0x1d9c48=_0x598942[_0x0499('0x57')];if(!_0x7b912b[_0x0499('0x45')][_0x0499('0x4a')]('nolimit')){_0x2d6d56[_0x0499('0x2f')]=qs[_0x0499('0x2f')](_0x7b912b[_0x0499('0x45')][_0x0499('0x2f')]);_0x2d6d56[_0x0499('0x2d')]=qs['offset'](_0x7b912b['query']['offset']);}return _0x2db2fa[_0x0499('0x99')](_0x2d6d56);}})['then'](function(_0x407364){if(_0x407364){return _0x407364?{'count':_0x1d9c48,'rows':_0x407364}:null;}})[_0x0499('0x20')](respondWithResult(_0x32b757,null))[_0x0499('0x2a')](handleError(_0x32b757,null));};
\ No newline at end of file
+var _0xeeec=['register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','ChatQueues','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','ChatQueue','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','rawAttributes','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','findAll','ids','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeAgents','addAgents','spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket'];(function(_0x3f4a8e,_0x507c39){var _0x7f68fd=function(_0x29890f){while(--_0x29890f){_0x3f4a8e['push'](_0x3f4a8e['shift']());}};_0x7f68fd(++_0x507c39);}(_0xeeec,0x116));var _0xceee=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xeeec[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require(_0xceee('0x0'));var rimraf=require(_0xceee('0x1'));var zipdir=require(_0xceee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceee('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xceee('0x4'));var util=require(_0xceee('0x5'));var path=require(_0xceee('0x6'));var sox=require('sox');var csv=require(_0xceee('0x7'));var ejs=require(_0xceee('0x8'));var fs=require('fs');var fs_extra=require(_0xceee('0x9'));var _=require(_0xceee('0xa'));var squel=require(_0xceee('0xb'));var crypto=require(_0xceee('0xc'));var jsforce=require(_0xceee('0xd'));var deskjs=require(_0xceee('0xe'));var toCsv=require('to-csv');var querystring=require(_0xceee('0xf'));var Papa=require('papaparse');var Redis=require(_0xceee('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xceee('0x11'));var as=require(_0xceee('0x12'));var hardwareService=require(_0xceee('0x13'));var logger=require(_0xceee('0x14'))(_0xceee('0x15'));var utils=require(_0xceee('0x16'));var config=require(_0xceee('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xceee('0x18')]=_[_0xceee('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xceee('0x1a'))(new Redis(config[_0xceee('0x18')]));require(_0xceee('0x1b'))[_0xceee('0x1c')](socket);var jayson=require(_0xceee('0x1d'));var client=jayson['client'][_0xceee('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5c9c53,_0x3cafb9,_0x4ec92a,_0x18561f){return new BPromise(function(_0x346e27,_0x4a80fd){var _0x3ad780=_0x18561f||client;return _0x3ad780[_0xceee('0x1f')](_0x5c9c53,_0x4ec92a)[_0xceee('0x20')](function(_0x23a16f){logger[_0xceee('0x21')]('ChatQueue,\x20%s,\x20%s',_0x3cafb9,_0xceee('0x22'));logger[_0xceee('0x23')](_0xceee('0x24'),_0x3cafb9,'request\x20sent',JSON[_0xceee('0x25')](_0x23a16f));if(_0x23a16f[_0xceee('0x26')]){if(_0x23a16f[_0xceee('0x26')]['code']===0x1f4){logger[_0xceee('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3cafb9,_0x23a16f[_0xceee('0x26')][_0xceee('0x27')]);return _0x4a80fd(_0x23a16f[_0xceee('0x26')][_0xceee('0x27')]);}logger[_0xceee('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3cafb9,_0x23a16f[_0xceee('0x26')][_0xceee('0x27')]);return _0x346e27(_0x23a16f[_0xceee('0x26')][_0xceee('0x27')]);}else{logger['info'](_0xceee('0x28'),_0x3cafb9,_0xceee('0x22'));_0x346e27(_0x23a16f[_0xceee('0x29')]['message']);}})['catch'](function(_0x5a354a){logger[_0xceee('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3cafb9,_0x5a354a);_0x4a80fd(_0x5a354a);});});}function respondWithStatusCode(_0x5c7f8c,_0x34eb31){_0x34eb31=_0x34eb31||0xcc;return function(_0x378117){if(_0x378117){return _0x5c7f8c['sendStatus'](_0x34eb31);}return _0x5c7f8c['status'](_0x34eb31)['end']();};}function respondWithResult(_0x38a6d8,_0x430b21){_0x430b21=_0x430b21||0xc8;return function(_0xa1c4d1){if(_0xa1c4d1){return _0x38a6d8[_0xceee('0x2a')](_0x430b21)[_0xceee('0x2b')](_0xa1c4d1);}};}function respondWithFilteredResult(_0x17e66e,_0x44f475){return function(_0x393931){if(_0x393931){var _0x407ea8=typeof _0x44f475[_0xceee('0x2c')]===_0xceee('0x2d')&&typeof _0x44f475[_0xceee('0x2e')]==='undefined';var _0x1ba401=_0x393931[_0xceee('0x2f')];var _0x1448c7=_0x407ea8?0x0:_0x44f475[_0xceee('0x2c')];var _0x350ba2=_0x407ea8?_0x393931['count']:_0x44f475[_0xceee('0x2c')]+_0x44f475['limit'];var _0x2982ff;if(_0x350ba2>=_0x1ba401){_0x350ba2=_0x1ba401;_0x2982ff=0xc8;}else{_0x2982ff=0xce;}_0x17e66e[_0xceee('0x2a')](_0x2982ff);return _0x17e66e[_0xceee('0x30')](_0xceee('0x31'),_0x1448c7+'-'+_0x350ba2+'/'+_0x1ba401)[_0xceee('0x2b')](_0x393931);}return null;};}function patchUpdates(_0x10101c){return function(_0x422e85){try{jsonpatch[_0xceee('0x32')](_0x422e85,_0x10101c,!![]);}catch(_0x20bd82){return BPromise[_0xceee('0x33')](_0x20bd82);}return _0x422e85[_0xceee('0x34')]();};}function saveUpdates(_0x11490d,_0x5152b1){return function(_0x4ce0ff){if(_0x4ce0ff){return _0x4ce0ff[_0xceee('0x35')](_0x11490d)[_0xceee('0x20')](function(_0x137abd){return _0x137abd;});}return null;};}function removeEntity(_0x2c1430,_0x45152d){return function(_0x4ee9ab){if(_0x4ee9ab){return _0x4ee9ab['destroy']()[_0xceee('0x20')](function(){var _0x4e5226=_0x4ee9ab[_0xceee('0x36')]({'plain':!![]});var _0x4bfdcf=_0xceee('0x37');return db[_0xceee('0x38')][_0xceee('0x39')]({'where':{'type':_0x4bfdcf,'resourceId':_0x4e5226['id']}})[_0xceee('0x20')](function(){return _0x4ee9ab;});})[_0xceee('0x20')](function(){_0x2c1430['status'](0xcc)[_0xceee('0x3a')]();});}};}function handleEntityNotFound(_0x2807ff,_0x19699d){return function(_0x5599c6){if(!_0x5599c6){_0x2807ff[_0xceee('0x3b')](0x194);}return _0x5599c6;};}function handleError(_0x185136,_0x2ba10f){_0x2ba10f=_0x2ba10f||0x1f4;return function(_0x1e006a){logger[_0xceee('0x26')](_0x1e006a[_0xceee('0x3c')]);if(_0x1e006a['name']){delete _0x1e006a[_0xceee('0x3d')];}_0x185136['status'](_0x2ba10f)[_0xceee('0x3e')](_0x1e006a);};}exports[_0xceee('0x3f')]=function(_0x5eef18,_0xeb1657){var _0xd87357={},_0x2ccd77={},_0x41e6c5={'count':0x0,'rows':[]};var _0x15526b=_[_0xceee('0x40')](db[_0xceee('0x41')]['rawAttributes'],function(_0x2b4323){return{'name':_0x2b4323['fieldName'],'type':_0x2b4323[_0xceee('0x42')][_0xceee('0x43')]};});_0x2ccd77[_0xceee('0x44')]=_[_0xceee('0x40')](_0x15526b,_0xceee('0x3d'));_0x2ccd77[_0xceee('0x45')]=_[_0xceee('0x46')](_0x5eef18[_0xceee('0x45')]);_0x2ccd77[_0xceee('0x47')]=_[_0xceee('0x48')](_0x2ccd77[_0xceee('0x44')],_0x2ccd77['query']);_0xd87357[_0xceee('0x49')]=_[_0xceee('0x48')](_0x2ccd77[_0xceee('0x44')],qs[_0xceee('0x4a')](_0x5eef18[_0xceee('0x45')]['fields']));_0xd87357['attributes']=_0xd87357[_0xceee('0x49')][_0xceee('0x4b')]?_0xd87357[_0xceee('0x49')]:_0x2ccd77[_0xceee('0x44')];if(!_0x5eef18['query'][_0xceee('0x4c')](_0xceee('0x4d'))){_0xd87357[_0xceee('0x2e')]=qs[_0xceee('0x2e')](_0x5eef18[_0xceee('0x45')][_0xceee('0x2e')]);_0xd87357[_0xceee('0x2c')]=qs[_0xceee('0x2c')](_0x5eef18['query']['offset']);}_0xd87357[_0xceee('0x4e')]=qs[_0xceee('0x4f')](_0x5eef18['query']['sort']);_0xd87357[_0xceee('0x50')]=qs['filters'](_[_0xceee('0x51')](_0x5eef18[_0xceee('0x45')],_0x2ccd77['filters']),_0x15526b);if(_0x5eef18[_0xceee('0x45')][_0xceee('0x52')]){_0xd87357['where']=_[_0xceee('0x53')](_0xd87357[_0xceee('0x50')],{'$or':_['map'](_0x15526b,function(_0x1b625f){if(_0x1b625f[_0xceee('0x42')]!==_0xceee('0x54')){var _0x45d75f={};_0x45d75f[_0x1b625f[_0xceee('0x3d')]]={'$like':'%'+_0x5eef18[_0xceee('0x45')]['filter']+'%'};return _0x45d75f;}})});}_0xd87357=_[_0xceee('0x53')]({},_0xd87357,_0x5eef18[_0xceee('0x55')]);var _0x5f3d54={'where':_0xd87357[_0xceee('0x50')]};return db[_0xceee('0x41')]['count'](_0x5f3d54)['then'](function(_0x4fb676){_0x41e6c5[_0xceee('0x2f')]=_0x4fb676;if(_0x5eef18[_0xceee('0x45')][_0xceee('0x56')]){_0xd87357[_0xceee('0x57')]=[{'all':!![]}];}return db[_0xceee('0x41')]['findAll'](_0xd87357);})[_0xceee('0x20')](function(_0x184a68){_0x41e6c5[_0xceee('0x58')]=_0x184a68;return _0x41e6c5;})[_0xceee('0x20')](respondWithFilteredResult(_0xeb1657,_0xd87357))['catch'](handleError(_0xeb1657,null));};exports[_0xceee('0x59')]=function(_0x35936a,_0x1f0f11){var _0x38841c={'raw':!![],'where':{'id':_0x35936a['params']['id']}},_0x17b2ef={};_0x17b2ef[_0xceee('0x44')]=_[_0xceee('0x46')](db['ChatQueue'][_0xceee('0x5a')]);_0x17b2ef[_0xceee('0x45')]=_[_0xceee('0x46')](_0x35936a[_0xceee('0x45')]);_0x17b2ef[_0xceee('0x47')]=_[_0xceee('0x48')](_0x17b2ef[_0xceee('0x44')],_0x17b2ef[_0xceee('0x45')]);_0x38841c['attributes']=_[_0xceee('0x48')](_0x17b2ef[_0xceee('0x44')],qs[_0xceee('0x4a')](_0x35936a[_0xceee('0x45')][_0xceee('0x4a')]));_0x38841c[_0xceee('0x49')]=_0x38841c['attributes'][_0xceee('0x4b')]?_0x38841c[_0xceee('0x49')]:_0x17b2ef[_0xceee('0x44')];if(_0x35936a[_0xceee('0x45')]['includeAll']){_0x38841c[_0xceee('0x57')]=[{'all':!![]}];}_0x38841c=_[_0xceee('0x53')]({},_0x38841c,_0x35936a[_0xceee('0x55')]);return db[_0xceee('0x41')][_0xceee('0x5b')](_0x38841c)['then'](handleEntityNotFound(_0x1f0f11,null))[_0xceee('0x20')](respondWithResult(_0x1f0f11,null))[_0xceee('0x5c')](handleError(_0x1f0f11,null));};exports[_0xceee('0x5d')]=function(_0x552dc7,_0x3270f6){return db[_0xceee('0x41')][_0xceee('0x5d')](_0x552dc7[_0xceee('0x5e')],{})[_0xceee('0x20')](function(_0x15a265){var _0x4c37cb=_0x552dc7[_0xceee('0x5f')][_0xceee('0x36')]({'plain':!![]});if(!_0x4c37cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c37cb[_0xceee('0x60')]==='user'){var _0x489a42=_0x15a265[_0xceee('0x36')]({'plain':!![]});var _0x15ab5b=_0xceee('0x37');return db[_0xceee('0x61')][_0xceee('0x5b')]({'where':{'name':_0x15ab5b,'userProfileId':_0x4c37cb[_0xceee('0x62')]},'raw':!![]})['then'](function(_0x5953b8){if(_0x5953b8&&_0x5953b8[_0xceee('0x63')]===0x0){return db[_0xceee('0x38')][_0xceee('0x5d')]({'name':_0x489a42[_0xceee('0x3d')],'resourceId':_0x489a42['id'],'type':_0x5953b8[_0xceee('0x3d')],'sectionId':_0x5953b8['id']},{})[_0xceee('0x20')](function(){return _0x15a265;});}else{return _0x15a265;}})[_0xceee('0x5c')](function(_0x58aee2){logger[_0xceee('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58aee2);throw _0x58aee2;});}return _0x15a265;})[_0xceee('0x20')](respondWithResult(_0x3270f6,0xc9))[_0xceee('0x5c')](handleError(_0x3270f6,null));};exports['update']=function(_0x42d744,_0x297902){if(_0x42d744[_0xceee('0x5e')]['id']){delete _0x42d744[_0xceee('0x5e')]['id'];}return db['ChatQueue'][_0xceee('0x5b')]({'where':{'id':_0x42d744['params']['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x297902,null))[_0xceee('0x20')](saveUpdates(_0x42d744[_0xceee('0x5e')],null))[_0xceee('0x20')](respondWithResult(_0x297902,null))['catch'](handleError(_0x297902,null));};exports[_0xceee('0x39')]=function(_0x9add0c,_0x4134f8){return db[_0xceee('0x41')][_0xceee('0x5b')]({'where':{'id':_0x9add0c[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x4134f8,null))[_0xceee('0x20')](removeEntity(_0x4134f8,null))[_0xceee('0x5c')](handleError(_0x4134f8,null));};exports[_0xceee('0x65')]=function(_0xddc3b8,_0x424ad2){return db[_0xceee('0x41')][_0xceee('0x65')]()['then'](respondWithResult(_0x424ad2,null))[_0xceee('0x5c')](handleError(_0x424ad2,null));};exports[_0xceee('0x66')]=function(_0x4de96f,_0x54eb76,_0x1bc38d){var _0x47311c={'raw':!![],'where':{}},_0x55c4fd={},_0x1e16b1;return db[_0xceee('0x41')][_0xceee('0x67')]({'where':{'id':_0x4de96f[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x54eb76,null))[_0xceee('0x20')](function(_0x6ee7ee){if(_0x6ee7ee){_0x1e16b1=_0x6ee7ee['get']({'plain':!![]});_0x55c4fd['model']=_[_0xceee('0x46')](db[_0xceee('0x68')][_0xceee('0x5a')]);_0x55c4fd[_0xceee('0x45')]=_[_0xceee('0x46')](_0x4de96f['query']);_0x55c4fd[_0xceee('0x47')]=_[_0xceee('0x48')](_0x55c4fd[_0xceee('0x44')],_0x55c4fd['query']);_0x47311c[_0xceee('0x49')]=_[_0xceee('0x48')](_0x55c4fd['model'],qs['fields'](_0x4de96f[_0xceee('0x45')][_0xceee('0x4a')]));_0x47311c[_0xceee('0x49')]=_0x47311c[_0xceee('0x49')][_0xceee('0x4b')]?_0x47311c['attributes']:_0x55c4fd[_0xceee('0x44')];if(!_0x4de96f[_0xceee('0x45')]['hasOwnProperty']('nolimit')){_0x47311c['limit']=qs[_0xceee('0x2e')](_0x4de96f[_0xceee('0x45')]['limit']);_0x47311c['offset']=qs['offset'](_0x4de96f[_0xceee('0x45')][_0xceee('0x2c')]);}_0x47311c['order']=qs['sort'](_0x4de96f[_0xceee('0x45')][_0xceee('0x4f')]);_0x47311c[_0xceee('0x50')]=qs[_0xceee('0x47')](_[_0xceee('0x51')](_0x4de96f[_0xceee('0x45')],_0x55c4fd['filters']));_0x47311c[_0xceee('0x50')][_0xceee('0x69')]=_0x6ee7ee['id'];if(_0x4de96f[_0xceee('0x45')]['filter']){_0x47311c['where']=_[_0xceee('0x53')](_0x47311c[_0xceee('0x50')],{'$or':_[_0xceee('0x40')](_0x47311c[_0xceee('0x49')],function(_0x1d6c1d){var _0x39c9a6={};_0x39c9a6[_0x1d6c1d]={'$like':'%'+_0x4de96f[_0xceee('0x45')]['filter']+'%'};return _0x39c9a6;})});}_0x47311c=_[_0xceee('0x53')]({},_0x47311c,_0x4de96f['options']);return db[_0xceee('0x68')]['findAll'](_0x47311c);}})[_0xceee('0x20')](function(_0x396f95){if(_0x396f95){return db[_0xceee('0x6a')][_0xceee('0x6b')]({'where':{'id':_[_0xceee('0x40')](_0x396f95,_0xceee('0x6c')),'role':_0xceee('0x6d')},'attributes':['id','name',_0xceee('0x6e'),_0xceee('0x6f'),_0xceee('0x70')]});}})[_0xceee('0x20')](function(_0xa81e24){if(_0xa81e24){return{'count':_0xa81e24['count'],'rows':_[_0xceee('0x40')](_0xa81e24['rows'],function(_0x34a643){return{'membername':_0x34a643[_0xceee('0x3d')],'UserId':_0x34a643['id'],'queue_name':_0x1e16b1[_0xceee('0x3d')],'ChatQueueId':_0x1e16b1['id'],'interface':util['format']('%s/%s',_0xceee('0x71'),_0x34a643[_0xceee('0x3d')]),'penalty':0x0,'paused':_0x34a643['chatPause'],'createdAt':_0x34a643[_0xceee('0x70')],'updatedAt':_0x34a643['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x54eb76,_0x47311c))[_0xceee('0x5c')](handleError(_0x54eb76,null));};exports[_0xceee('0x72')]=function(_0x1ae8d5,_0x184cd9,_0x494347){var _0x55b29d={};var _0x397d1d={};var _0x183f9d;var _0x404cfc;return db[_0xceee('0x41')][_0xceee('0x67')]({'where':{'id':_0x1ae8d5[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x184cd9,null))[_0xceee('0x20')](function(_0x15fa4d){if(_0x15fa4d){_0x183f9d=_0x15fa4d;_0x397d1d[_0xceee('0x44')]=_[_0xceee('0x46')](db[_0xceee('0x73')]['rawAttributes']);_0x397d1d[_0xceee('0x45')]=_['keys'](_0x1ae8d5[_0xceee('0x45')]);_0x397d1d[_0xceee('0x47')]=_[_0xceee('0x48')](_0x397d1d[_0xceee('0x44')],_0x397d1d[_0xceee('0x45')]);_0x55b29d[_0xceee('0x49')]=_[_0xceee('0x48')](_0x397d1d[_0xceee('0x44')],qs[_0xceee('0x4a')](_0x1ae8d5[_0xceee('0x45')]['fields']));_0x55b29d['attributes']=_0x55b29d[_0xceee('0x49')]['length']?_0x55b29d[_0xceee('0x49')]:_0x397d1d[_0xceee('0x44')];_0x55b29d[_0xceee('0x4e')]=qs[_0xceee('0x4f')](_0x1ae8d5[_0xceee('0x45')][_0xceee('0x4f')]);_0x55b29d[_0xceee('0x50')]=qs[_0xceee('0x47')](_[_0xceee('0x51')](_0x1ae8d5[_0xceee('0x45')],_0x397d1d[_0xceee('0x47')]));if(_0x1ae8d5['query'][_0xceee('0x52')]){_0x55b29d[_0xceee('0x50')]=_[_0xceee('0x53')](_0x55b29d['where'],{'$or':_[_0xceee('0x40')](_0x55b29d['attributes'],function(_0x29327b){var _0x206ead={};_0x206ead[_0x29327b]={'$like':'%'+_0x1ae8d5[_0xceee('0x45')][_0xceee('0x52')]+'%'};return _0x206ead;})});}_0x55b29d=_[_0xceee('0x53')]({},_0x55b29d,_0x1ae8d5[_0xceee('0x55')]);return _0x183f9d['getTeams'](_0x55b29d);}})['then'](function(_0x4a5645){if(_0x4a5645){_0x404cfc=_0x4a5645[_0xceee('0x4b')];if(!_0x1ae8d5['query']['hasOwnProperty']('nolimit')){_0x55b29d[_0xceee('0x2e')]=qs[_0xceee('0x2e')](_0x1ae8d5[_0xceee('0x45')][_0xceee('0x2e')]);_0x55b29d[_0xceee('0x2c')]=qs[_0xceee('0x2c')](_0x1ae8d5[_0xceee('0x45')][_0xceee('0x2c')]);}return _0x183f9d['getTeams'](_0x55b29d);}})[_0xceee('0x20')](function(_0x55e088){if(_0x55e088){return _0x55e088?{'count':_0x404cfc,'rows':_0x55e088}:null;}})[_0xceee('0x20')](respondWithResult(_0x184cd9,null))[_0xceee('0x5c')](handleError(_0x184cd9,null));};exports['addTeams']=function(_0x3be869,_0x2d2455,_0x3c3829){var _0x5c0373=_0x3be869[_0xceee('0x5e')]['ids'];return db[_0xceee('0x73')]['findAll']({'where':{'id':_0x5c0373},'attributes':['id'],'include':[{'model':db[_0xceee('0x6a')],'as':_0xceee('0x74'),'attributes':['id',_0xceee('0x3d'),'online',_0xceee('0x75'),_0xceee('0x76')],'raw':!![]}]})[_0xceee('0x20')](function(_0x3b2d3d){if(_0x3b2d3d){var _0x46ac2d=_[_0xceee('0x77')](_0x3b2d3d,function(_0x25e5ac){var _0x486619=_0x25e5ac['get']({'plain':!![]});return _0x486619[_0xceee('0x74')];});return db['ChatQueue'][_0xceee('0x5b')]({'where':{'id':_0x3be869['params']['id']}})[_0xceee('0x20')](function(_0x4c0cae){return db[_0xceee('0x78')][_0xceee('0x79')](function(_0x1b675a){return _0x4c0cae[_0xceee('0x7a')](_0x5c0373,{'transaction':_0x1b675a})[_0xceee('0x20')](function(){return BPromise[_0xceee('0x7b')](_0x46ac2d,function(_0x47c20c){return db[_0xceee('0x68')][_0xceee('0x7c')]({'where':{'UserId':_0x47c20c['id'],'ChatQueueId':_0x3be869[_0xceee('0x64')]['id']},'transaction':_0x1b675a});});})['then'](function(){_0x46ac2d[_0xceee('0x7d')](function(_0x448cf1){socket[_0xceee('0x7e')]('userChatQueue:save',{'UserId':_0x448cf1['id'],'ChatQueueId':_0x4c0cae['id']});});});});});}})[_0xceee('0x20')](respondWithStatusCode(_0x2d2455,null))[_0xceee('0x5c')](handleError(_0x2d2455,null));};exports[_0xceee('0x7f')]=function(_0x1d55e2,_0x1b8541,_0x15a2af){return db['Team'][_0xceee('0x80')]({'where':{'id':_0x1d55e2[_0xceee('0x45')][_0xceee('0x81')]},'attributes':['id'],'include':[{'model':db[_0xceee('0x6a')],'as':_0xceee('0x74'),'attributes':['id'],'raw':!![]}]})[_0xceee('0x20')](handleEntityNotFound(_0x1b8541,null))[_0xceee('0x20')](function(_0x3184f5){var _0x324a57=_[_0xceee('0x40')](_0x3184f5,'id');var _0x3cbf36=[];var _0x5d5cf8=[];var _0x40d0ee=squel['select']();_0x40d0ee[_0xceee('0x82')](_0xceee('0x83'))[_0xceee('0x84')](_0xceee('0x85'),'tq')[_0xceee('0x86')](_0xceee('0x87'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xceee('0x50')](_0xceee('0x88'),_0x1d55e2[_0xceee('0x64')]['id']);for(var _0x51e76c=0x0;_0x51e76c<_0x3184f5[_0xceee('0x4b')];_0x51e76c+=0x1){let _0x254620=_0x3184f5[_0x51e76c];for(var _0x433275=0x0;_0x433275<_0x254620[_0xceee('0x74')][_0xceee('0x4b')];_0x433275+=0x1){let _0x3db59b=_0x254620['Agents'][_0x433275];var _0x31881c=_0x40d0ee['clone']();_0x31881c[_0xceee('0x50')](_0xceee('0x89'),_0x3db59b['id']);_0x5d5cf8[_0xceee('0x8a')](db[_0xceee('0x78')][_0xceee('0x45')](_0x31881c[_0xceee('0x8b')](),{'type':db[_0xceee('0x78')][_0xceee('0x8c')][_0xceee('0x8d')]})[_0xceee('0x20')](function(_0x26e08b){if(_0x26e08b[_0xceee('0x4b')]===0x1){return _0x3db59b['id'];}else{var _0x1f4749=_['every'](_[_0xceee('0x40')](_0x26e08b,'TeamId'),function(_0x3bb94d){return _[_0xceee('0x8e')](_0x324a57,_0x3bb94d);});if(_0x1f4749){return _0x3db59b['id'];}}}));}}return BPromise[_0xceee('0x8f')](_0x5d5cf8)[_0xceee('0x20')](function(_0x20b6cc){_0x3cbf36=_(_0x3cbf36)[_0xceee('0x90')](_0x20b6cc)[_0xceee('0x91')]()[_0xceee('0x92')]();return db['ChatQueue']['find']({'where':{'id':_0x1d55e2[_0xceee('0x64')]['id']}})[_0xceee('0x20')](function(_0x393edf){return db['sequelize']['transaction'](function(_0x752edc){return _0x393edf[_0xceee('0x7f')](_0x1d55e2['query']['ids'],{'transaction':_0x752edc})[_0xceee('0x20')](function(){if(!_['isEmpty'](_0x3cbf36)){return _0x393edf[_0xceee('0x93')](_0x3cbf36,{'transaction':_0x752edc});}})[_0xceee('0x20')](function(){_0x3cbf36[_0xceee('0x7d')](function(_0x27f9a9){socket['emit']('userChatQueue:remove',{'UserId':_0x27f9a9,'ChatQueueId':_0x393edf['id']});});});});});});})['then'](respondWithStatusCode(_0x1b8541,null))[_0xceee('0x5c')](handleError(_0x1b8541,null));};exports['addAgents']=function(_0x36837f,_0x306579,_0x18c801){return db[_0xceee('0x41')][_0xceee('0x5b')]({'where':{'id':_0x36837f[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x306579,null))[_0xceee('0x20')](function(_0x572f31){if(_0x572f31){return _0x572f31[_0xceee('0x94')](_0x36837f[_0xceee('0x5e')][_0xceee('0x81')],_['omit'](_0x36837f[_0xceee('0x5e')],['ids','id'])||{})[_0xceee('0x95')](function(_0x580cba){for(var _0x3f833e=0x0;_0x3f833e<_0x36837f[_0xceee('0x5e')][_0xceee('0x81')]['length'];_0x3f833e+=0x1){socket[_0xceee('0x7e')](_0xceee('0x96'),{'UserId':Number(_0x36837f[_0xceee('0x5e')][_0xceee('0x81')][_0x3f833e]),'ChatQueueId':Number(_0x36837f['params']['id'])});}return _0x580cba;});}})[_0xceee('0x20')](respondWithResult(_0x306579,null))[_0xceee('0x5c')](handleError(_0x306579,null));};exports[_0xceee('0x93')]=function(_0x3ce8d5,_0x136e43,_0x1fa00b){return db['ChatQueue']['find']({'where':{'id':_0x3ce8d5[_0xceee('0x64')]['id']}})['then'](handleEntityNotFound(_0x136e43,null))[_0xceee('0x20')](function(_0x3be75a){if(_0x3be75a){return _0x3be75a[_0xceee('0x93')](_0x3ce8d5[_0xceee('0x45')][_0xceee('0x81')])['then'](function(){if(_[_0xceee('0x97')](_0x3ce8d5[_0xceee('0x45')][_0xceee('0x81')])){for(var _0x7a6c9f=0x0;_0x7a6c9f<_0x3ce8d5[_0xceee('0x45')][_0xceee('0x81')][_0xceee('0x4b')];_0x7a6c9f+=0x1){socket[_0xceee('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x3ce8d5[_0xceee('0x45')][_0xceee('0x81')][_0x7a6c9f]),'ChatQueueId':Number(_0x3ce8d5[_0xceee('0x64')]['id'])});}}else{socket[_0xceee('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x3ce8d5['query']['ids']),'ChatQueueId':Number(_0x3ce8d5[_0xceee('0x64')]['id'])});}});}})[_0xceee('0x20')](respondWithStatusCode(_0x136e43,null))[_0xceee('0x5c')](handleError(_0x136e43,null));};exports[_0xceee('0x98')]=function(_0x479029,_0x364b08,_0x30ff61){var _0x3018af={};var _0xc0f769={};var _0xc1447f;var _0x18bf45;return db[_0xceee('0x41')]['findOne']({'where':{'id':_0x479029[_0xceee('0x64')]['id']}})[_0xceee('0x20')](handleEntityNotFound(_0x364b08,null))[_0xceee('0x20')](function(_0x89076a){if(_0x89076a){_0xc1447f=_0x89076a;_0xc0f769['model']=_[_0xceee('0x46')](db[_0xceee('0x6a')][_0xceee('0x5a')]);_0xc0f769[_0xceee('0x45')]=_[_0xceee('0x46')](_0x479029['query']);_0xc0f769[_0xceee('0x47')]=_[_0xceee('0x48')](_0xc0f769[_0xceee('0x44')],_0xc0f769[_0xceee('0x45')]);_0x3018af[_0xceee('0x49')]=_[_0xceee('0x48')](_0xc0f769[_0xceee('0x44')],qs[_0xceee('0x4a')](_0x479029[_0xceee('0x45')][_0xceee('0x4a')]));_0x3018af[_0xceee('0x49')]=_0x3018af['attributes'][_0xceee('0x4b')]?_0x3018af[_0xceee('0x49')]:_0xc0f769[_0xceee('0x44')];_0x3018af[_0xceee('0x4e')]=qs[_0xceee('0x4f')](_0x479029['query'][_0xceee('0x4f')]);_0x3018af[_0xceee('0x50')]=qs[_0xceee('0x47')](_[_0xceee('0x51')](_0x479029[_0xceee('0x45')],_0xc0f769[_0xceee('0x47')]));if(_0x479029[_0xceee('0x45')][_0xceee('0x52')]){_0x3018af[_0xceee('0x50')]=_[_0xceee('0x53')](_0x3018af[_0xceee('0x50')],{'$or':_[_0xceee('0x40')](_0x3018af[_0xceee('0x49')],function(_0x1fd080){var _0x1e1094={};_0x1e1094[_0x1fd080]={'$like':'%'+_0x479029['query'][_0xceee('0x52')]+'%'};return _0x1e1094;})});}_0x3018af=_[_0xceee('0x53')]({},_0x3018af,_0x479029[_0xceee('0x55')]);return _0xc1447f[_0xceee('0x98')](_0x3018af);}})[_0xceee('0x20')](function(_0x10823e){if(_0x10823e){_0x18bf45=_0x10823e[_0xceee('0x4b')];if(!_0x479029[_0xceee('0x45')][_0xceee('0x4c')]('nolimit')){_0x3018af[_0xceee('0x2e')]=qs['limit'](_0x479029[_0xceee('0x45')][_0xceee('0x2e')]);_0x3018af[_0xceee('0x2c')]=qs[_0xceee('0x2c')](_0x479029[_0xceee('0x45')]['offset']);}return _0xc1447f[_0xceee('0x98')](_0x3018af);}})[_0xceee('0x20')](function(_0x59fb4e){if(_0x59fb4e){return _0x59fb4e?{'count':_0x18bf45,'rows':_0x59fb4e}:null;}})[_0xceee('0x20')](respondWithResult(_0x364b08,null))['catch'](handleError(_0x364b08,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index bcb3cac..7392b4b 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 _0xf73a=['events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3d066a,_0x424cb0){var _0x262376=function(_0x3a8e27){while(--_0x3a8e27){_0x3d066a['push'](_0x3d066a['shift']());}};_0x262376(++_0x424cb0);}(_0xf73a,0xd8));var _0xaf73=function(_0x9c1eca,_0x5a0ab3){_0x9c1eca=_0x9c1eca-0x0;var _0x400385=_0xf73a[_0x9c1eca];return _0x400385;};'use strict';var EventEmitter=require(_0xaf73('0x0'));var ChatQueue=require(_0xaf73('0x1'))['db'][_0xaf73('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaf73('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaf73('0x4'),'afterDestroy':_0xaf73('0x5')};function emitEvent(_0x401aef){return function(_0x294407,_0x498db0,_0x31df1d){ChatQueueEvents[_0xaf73('0x6')](_0x401aef+':'+_0x294407['id'],_0x294407);ChatQueueEvents[_0xaf73('0x6')](_0x401aef,_0x294407);_0x31df1d(null);};}for(var e in events){if(events[_0xaf73('0x7')](e)){var event=events[e];ChatQueue[_0xaf73('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x193a=['emit','hook','events','../../mysqldb','ChatQueue','setMaxListeners','update'];(function(_0x35ed44,_0x265d05){var _0x479406=function(_0x95239a){while(--_0x95239a){_0x35ed44['push'](_0x35ed44['shift']());}};_0x479406(++_0x265d05);}(_0x193a,0x95));var _0xa193=function(_0x13845a,_0x3ae746){_0x13845a=_0x13845a-0x0;var _0xa7dce0=_0x193a[_0x13845a];return _0xa7dce0;};'use strict';var EventEmitter=require(_0xa193('0x0'));var ChatQueue=require(_0xa193('0x1'))['db'][_0xa193('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa193('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa193('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fe750){return function(_0xdd4e5,_0x42f1e0,_0x7e7613){ChatQueueEvents[_0xa193('0x5')](_0x4fe750+':'+_0xdd4e5['id'],_0xdd4e5);ChatQueueEvents[_0xa193('0x5')](_0x4fe750,_0xdd4e5);_0x7e7613(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xa193('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 4a0547c..7c7e312 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 _0x5f37=['path','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x50c409,_0x2c78cc){var _0x52bf09=function(_0x1ad704){while(--_0x1ad704){_0x50c409['push'](_0x50c409['shift']());}};_0x52bf09(++_0x2c78cc);}(_0x5f37,0x1c7));var _0x75f3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5f37[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x75f3('0x0'));var util=require(_0x75f3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75f3('0x2'));var BPromise=require(_0x75f3('0x3'));var rp=require(_0x75f3('0x4'));var fs=require('fs');var path=require(_0x75f3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x75f3('0x6'));module[_0x75f3('0x7')]=function(_0x42fc78,_0x4cd887){return _0x42fc78['define'](_0x75f3('0x8'),attributes,{'tableName':_0x75f3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc70e=['../../config/environment','./chatQueue.attributes','exports','chat_queues','util','moment','request-promise','path','rimraf'];(function(_0x2a9658,_0x22f838){var _0x375348=function(_0x20016f){while(--_0x20016f){_0x2a9658['push'](_0x2a9658['shift']());}};_0x375348(++_0x22f838);}(_0xc70e,0x11b));var _0xec70=function(_0xc43657,_0x17b2d8){_0xc43657=_0xc43657-0x0;var _0x6eca29=_0xc70e[_0xc43657];return _0x6eca29;};'use strict';var _=require('lodash');var util=require(_0xec70('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xec70('0x1'));var BPromise=require('bluebird');var rp=require(_0xec70('0x2'));var fs=require('fs');var path=require(_0xec70('0x3'));var rimraf=require(_0xec70('0x4'));var config=require(_0xec70('0x5'));var attributes=require(_0xec70('0x6'));module[_0xec70('0x7')]=function(_0x4d7e16,_0x65e518){return _0x4d7e16['define']('ChatQueue',attributes,{'tableName':_0xec70('0x8'),'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 e56e5e9..82be3d8 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 _0x4965=['request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','model','map','ShowChatQueue','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatQueue.socket','register'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x4965,0x16e));var _0x5496=function(_0x18deef,_0x5b8774){_0x18deef=_0x18deef-0x0;var _0x3f4361=_0x4965[_0x18deef];return _0x3f4361;};'use strict';var _=require(_0x5496('0x0'));var util=require(_0x5496('0x1'));var moment=require(_0x5496('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5496('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5496('0x4'))(_0x5496('0x5'));var config=require(_0x5496('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5496('0x7')][_0x5496('0x8')]({'port':0x232a});config[_0x5496('0x9')]=_[_0x5496('0xa')](config['redis'],{'host':_0x5496('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5496('0x9')]));require(_0x5496('0xc'))[_0x5496('0xd')](socket);function respondWithRpcPromise(_0x5dc64a,_0x443752,_0xd18801){return new BPromise(function(_0x42f073,_0x13f202){return client[_0x5496('0xe')](_0x5dc64a,_0xd18801)[_0x5496('0xf')](function(_0x25d676){logger[_0x5496('0x10')](_0x5496('0x11'),_0x443752,_0x5496('0x12'));logger[_0x5496('0x13')](_0x5496('0x14'),_0x443752,_0x5496('0x12'),JSON[_0x5496('0x15')](_0x25d676));if(_0x25d676[_0x5496('0x16')]){if(_0x25d676['error'][_0x5496('0x17')]===0x1f4){logger[_0x5496('0x16')](_0x5496('0x11'),_0x443752,_0x25d676[_0x5496('0x16')][_0x5496('0x18')]);return _0x13f202(_0x25d676[_0x5496('0x16')][_0x5496('0x18')]);}logger[_0x5496('0x16')]('ChatQueue,\x20%s,\x20%s',_0x443752,_0x25d676['error'][_0x5496('0x18')]);return _0x42f073(_0x25d676[_0x5496('0x16')][_0x5496('0x18')]);}else{logger[_0x5496('0x10')](_0x5496('0x11'),_0x443752,_0x5496('0x12'));_0x42f073(_0x25d676[_0x5496('0x19')][_0x5496('0x18')]);}})[_0x5496('0x1a')](function(_0x512872){logger['error'](_0x5496('0x11'),_0x443752,_0x512872);_0x13f202(_0x512872);});});}exports[_0x5496('0x1b')]=function(_0x10599a){var _0x2cd842=this;return new Promise(function(_0x4d2a9d,_0x701eca){return db[_0x5496('0x1c')]['findAll']({'raw':_0x10599a[_0x5496('0x1d')]?_0x10599a[_0x5496('0x1d')][_0x5496('0x1e')]===undefined?!![]:![]:!![],'where':_0x10599a[_0x5496('0x1d')]?_0x10599a[_0x5496('0x1d')][_0x5496('0x1f')]||null:null,'attributes':_0x10599a[_0x5496('0x1d')]?_0x10599a[_0x5496('0x1d')][_0x5496('0x20')]||null:null,'limit':_0x10599a[_0x5496('0x1d')]?_0x10599a[_0x5496('0x1d')][_0x5496('0x21')]||null:null,'include':_0x10599a[_0x5496('0x1d')]?_0x10599a['options'][_0x5496('0x22')]?_['map'](_0x10599a['options']['include'],function(_0xc6e98b){return{'model':db[_0xc6e98b[_0x5496('0x23')]],'as':_0xc6e98b['as'],'attributes':_0xc6e98b[_0x5496('0x20')],'include':_0xc6e98b[_0x5496('0x22')]?_[_0x5496('0x24')](_0xc6e98b[_0x5496('0x22')],function(_0x38ff07){return{'model':db[_0x38ff07[_0x5496('0x23')]],'as':_0x38ff07['as'],'attributes':_0x38ff07[_0x5496('0x20')],'include':_0x38ff07[_0x5496('0x22')]?_['map'](_0x38ff07[_0x5496('0x22')],function(_0x28d7d5){return{'model':db[_0x28d7d5['model']],'as':_0x28d7d5['as'],'attributes':_0x28d7d5[_0x5496('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5496('0xf')](function(_0x119a56){logger['info']('GetChatQueue',_0x10599a);logger['debug']('GetChatQueue',_0x10599a,JSON[_0x5496('0x15')](_0x119a56));_0x4d2a9d(_0x119a56);})[_0x5496('0x1a')](function(_0x33ae26){logger[_0x5496('0x16')](_0x5496('0x1b'),_0x33ae26[_0x5496('0x18')],_0x10599a);_0x701eca(_0x2cd842['error'](0x1f4,_0x33ae26[_0x5496('0x18')]));});});};exports[_0x5496('0x25')]=function(_0x539489){var _0x2c6514=this;return new Promise(function(_0x903d94,_0xf1b3cf){return db[_0x5496('0x1c')]['find']({'raw':_0x539489['options']?_0x539489[_0x5496('0x1d')][_0x5496('0x1e')]===undefined?!![]:![]:!![],'where':_0x539489[_0x5496('0x1d')]?_0x539489[_0x5496('0x1d')][_0x5496('0x1f')]||null:null,'attributes':_0x539489[_0x5496('0x1d')]?_0x539489[_0x5496('0x1d')]['attributes']||null:null,'include':_0x539489['options']?_0x539489[_0x5496('0x1d')]['include']?_[_0x5496('0x24')](_0x539489[_0x5496('0x1d')][_0x5496('0x22')],function(_0x16bd72){return{'model':db[_0x16bd72[_0x5496('0x23')]],'as':_0x16bd72['as'],'attributes':_0x16bd72['attributes'],'include':_0x16bd72[_0x5496('0x22')]?_['map'](_0x16bd72[_0x5496('0x22')],function(_0xfac994){return{'model':db[_0xfac994['model']],'as':_0xfac994['as'],'attributes':_0xfac994[_0x5496('0x20')],'include':_0xfac994[_0x5496('0x22')]?_['map'](_0xfac994[_0x5496('0x22')],function(_0x3dae10){return{'model':db[_0x3dae10[_0x5496('0x23')]],'as':_0x3dae10['as'],'attributes':_0x3dae10[_0x5496('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x505d9b){logger['info'](_0x5496('0x25'),_0x539489);logger['debug']('ShowChatQueue',_0x539489,JSON[_0x5496('0x15')](_0x505d9b));_0x903d94(_0x505d9b);})[_0x5496('0x1a')](function(_0x53227c){logger[_0x5496('0x16')](_0x5496('0x25'),_0x53227c['message'],_0x539489);_0xf1b3cf(_0x2c6514[_0x5496('0x16')](0x1f4,_0x53227c[_0x5496('0x18')]));});});};
\ No newline at end of file
+var _0x46aa=['error','code','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','catch','find','raw','ShowChatQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x39ff4b,_0x111bdc){var _0xc8e827=function(_0x4e26c1){while(--_0x4e26c1){_0x39ff4b['push'](_0x39ff4b['shift']());}};_0xc8e827(++_0x111bdc);}(_0x46aa,0x90));var _0xa46a=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x46aa[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0xa46a('0x0'));var util=require(_0xa46a('0x1'));var moment=require(_0xa46a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa46a('0x3'));var db=require(_0xa46a('0x4'))['db'];var utils=require(_0xa46a('0x5'));var logger=require(_0xa46a('0x6'))(_0xa46a('0x7'));var config=require(_0xa46a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa46a('0x9')]['http']({'port':0x232a});config[_0xa46a('0xa')]=_[_0xa46a('0xb')](config[_0xa46a('0xa')],{'host':_0xa46a('0xc'),'port':0x18eb});var socket=require(_0xa46a('0xd'))(new Redis(config[_0xa46a('0xa')]));require(_0xa46a('0xe'))[_0xa46a('0xf')](socket);function respondWithRpcPromise(_0x3fd2f5,_0x4df886,_0x597f42){return new BPromise(function(_0x33053a,_0x293bb1){return client[_0xa46a('0x10')](_0x3fd2f5,_0x597f42)[_0xa46a('0x11')](function(_0x2dce6d){logger[_0xa46a('0x12')](_0xa46a('0x13'),_0x4df886,'request\x20sent');logger[_0xa46a('0x14')](_0xa46a('0x15'),_0x4df886,_0xa46a('0x16'),JSON[_0xa46a('0x17')](_0x2dce6d));if(_0x2dce6d[_0xa46a('0x18')]){if(_0x2dce6d[_0xa46a('0x18')][_0xa46a('0x19')]===0x1f4){logger[_0xa46a('0x18')](_0xa46a('0x13'),_0x4df886,_0x2dce6d['error'][_0xa46a('0x1a')]);return _0x293bb1(_0x2dce6d[_0xa46a('0x18')][_0xa46a('0x1a')]);}logger[_0xa46a('0x18')]('ChatQueue,\x20%s,\x20%s',_0x4df886,_0x2dce6d[_0xa46a('0x18')]['message']);return _0x33053a(_0x2dce6d[_0xa46a('0x18')]['message']);}else{logger[_0xa46a('0x12')](_0xa46a('0x13'),_0x4df886,_0xa46a('0x16'));_0x33053a(_0x2dce6d[_0xa46a('0x1b')][_0xa46a('0x1a')]);}})['catch'](function(_0x26412c){logger['error'](_0xa46a('0x13'),_0x4df886,_0x26412c);_0x293bb1(_0x26412c);});});}exports[_0xa46a('0x1c')]=function(_0x15d126){var _0x4b32e5=this;return new Promise(function(_0x216909,_0x5f0daf){return db[_0xa46a('0x1d')][_0xa46a('0x1e')]({'raw':_0x15d126[_0xa46a('0x1f')]?_0x15d126[_0xa46a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x15d126['options']?_0x15d126['options'][_0xa46a('0x20')]||null:null,'attributes':_0x15d126[_0xa46a('0x1f')]?_0x15d126[_0xa46a('0x1f')][_0xa46a('0x21')]||null:null,'limit':_0x15d126[_0xa46a('0x1f')]?_0x15d126[_0xa46a('0x1f')][_0xa46a('0x22')]||null:null,'include':_0x15d126[_0xa46a('0x1f')]?_0x15d126[_0xa46a('0x1f')][_0xa46a('0x23')]?_[_0xa46a('0x24')](_0x15d126[_0xa46a('0x1f')][_0xa46a('0x23')],function(_0xe668f0){return{'model':db[_0xe668f0[_0xa46a('0x25')]],'as':_0xe668f0['as'],'attributes':_0xe668f0[_0xa46a('0x21')],'include':_0xe668f0[_0xa46a('0x23')]?_[_0xa46a('0x24')](_0xe668f0['include'],function(_0x170ac9){return{'model':db[_0x170ac9[_0xa46a('0x25')]],'as':_0x170ac9['as'],'attributes':_0x170ac9[_0xa46a('0x21')],'include':_0x170ac9['include']?_[_0xa46a('0x24')](_0x170ac9[_0xa46a('0x23')],function(_0x100770){return{'model':db[_0x100770[_0xa46a('0x25')]],'as':_0x100770['as'],'attributes':_0x100770[_0xa46a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa46a('0x11')](function(_0x2df63d){logger[_0xa46a('0x12')](_0xa46a('0x1c'),_0x15d126);logger[_0xa46a('0x14')]('GetChatQueue',_0x15d126,JSON['stringify'](_0x2df63d));_0x216909(_0x2df63d);})[_0xa46a('0x26')](function(_0x19dbf4){logger['error'](_0xa46a('0x1c'),_0x19dbf4[_0xa46a('0x1a')],_0x15d126);_0x5f0daf(_0x4b32e5[_0xa46a('0x18')](0x1f4,_0x19dbf4[_0xa46a('0x1a')]));});});};exports['ShowChatQueue']=function(_0x593f40){var _0x200686=this;return new Promise(function(_0x316161,_0x4702aa){return db[_0xa46a('0x1d')][_0xa46a('0x27')]({'raw':_0x593f40['options']?_0x593f40[_0xa46a('0x1f')][_0xa46a('0x28')]===undefined?!![]:![]:!![],'where':_0x593f40['options']?_0x593f40[_0xa46a('0x1f')]['where']||null:null,'attributes':_0x593f40[_0xa46a('0x1f')]?_0x593f40[_0xa46a('0x1f')][_0xa46a('0x21')]||null:null,'include':_0x593f40['options']?_0x593f40[_0xa46a('0x1f')]['include']?_[_0xa46a('0x24')](_0x593f40[_0xa46a('0x1f')][_0xa46a('0x23')],function(_0x4e218c){return{'model':db[_0x4e218c[_0xa46a('0x25')]],'as':_0x4e218c['as'],'attributes':_0x4e218c['attributes'],'include':_0x4e218c[_0xa46a('0x23')]?_['map'](_0x4e218c['include'],function(_0x5dce40){return{'model':db[_0x5dce40['model']],'as':_0x5dce40['as'],'attributes':_0x5dce40[_0xa46a('0x21')],'include':_0x5dce40[_0xa46a('0x23')]?_[_0xa46a('0x24')](_0x5dce40[_0xa46a('0x23')],function(_0x4860b4){return{'model':db[_0x4860b4['model']],'as':_0x4860b4['as'],'attributes':_0x4860b4[_0xa46a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a860e){logger[_0xa46a('0x12')](_0xa46a('0x29'),_0x593f40);logger[_0xa46a('0x14')]('ShowChatQueue',_0x593f40,JSON[_0xa46a('0x17')](_0x4a860e));_0x316161(_0x4a860e);})[_0xa46a('0x26')](function(_0x56b791){logger[_0xa46a('0x18')](_0xa46a('0x29'),_0x56b791[_0xa46a('0x1a')],_0x593f40);_0x4702aa(_0x200686[_0xa46a('0x18')](0x1f4,_0x56b791[_0xa46a('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 82c913e..53f549c 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 _0x0faf=['update','emit','removeListener','length','chatQueue:','./chatQueue.events','remove'];(function(_0x50e703,_0x127370){var _0xf1840c=function(_0x1418df){while(--_0x1418df){_0x50e703['push'](_0x50e703['shift']());}};_0xf1840c(++_0x127370);}(_0x0faf,0x132));var _0xf0fa=function(_0x491082,_0x28f78b){_0x491082=_0x491082-0x0;var _0x5797d9=_0x0faf[_0x491082];return _0x5797d9;};'use strict';var ChatQueueEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatQueueEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatQueueEvents['on'](_0x2db1d9,_0x587865);}};
\ No newline at end of file
+var _0xd0bb=['chatQueue:','./chatQueue.events','save','remove','emit','register','length'];(function(_0x17c4d1,_0x132786){var _0x5364fc=function(_0x4b0ef8){while(--_0x4b0ef8){_0x17c4d1['push'](_0x17c4d1['shift']());}};_0x5364fc(++_0x132786);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x59625f,_0x3b2c76){_0x59625f=_0x59625f-0x0;var _0x498e1e=_0xd0bb[_0x59625f];return _0x498e1e;};'use strict';var ChatQueueEvents=require(_0xbd0b('0x0'));var events=[_0xbd0b('0x1'),_0xbd0b('0x2'),'update'];function createListener(_0x68ea36,_0x4ab08f){return function(_0x39b03a){_0x4ab08f[_0xbd0b('0x3')](_0x68ea36,_0x39b03a);};}function removeListener(_0x53e6ce,_0x432acf){return function(){ChatQueueEvents['removeListener'](_0x53e6ce,_0x432acf);};}exports[_0xbd0b('0x4')]=function(_0x1b2499){for(var _0x158b5c=0x0,_0x37c205=events[_0xbd0b('0x5')];_0x158b5c<_0x37c205;_0x158b5c++){var _0x5eb975=events[_0x158b5c];var _0x2a4075=createListener(_0xbd0b('0x6')+_0x5eb975,_0x1b2499);ChatQueueEvents['on'](_0x5eb975,_0x2a4075);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 622736f..00d050b 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5323fe,_0x1836ad){var _0x406cd8=function(_0x1d9724){while(--_0x1d9724){_0x5323fe['push'](_0x5323fe['shift']());}};_0x406cd8(++_0x1836ad);}(_0x7217,0x19e));var _0x7721=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x7217[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0xd8a3b0,_0x296d12){var _0xf9276=function(_0x582a30){while(--_0x582a30){_0xd8a3b0['push'](_0xd8a3b0['shift']());}};_0xf9276(++_0x296d12);}(_0x814b,0x1a2));var _0xb814=function(_0x3cbe3a,_0x78bfce){_0x3cbe3a=_0x3cbe3a-0x0;var _0x24ffc1=_0x814b[_0x3cbe3a];return _0x24ffc1;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index c0662c3..98e06d2 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 _0x3bd0=['STRING','DATE','moment','sequelize','exports'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x3bd0,0x93));var _0x03bd=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x3bd0[_0x4812e0];return _0x252e0f;};'use strict';var moment=require(_0x03bd('0x0'));var Sequelize=require(_0x03bd('0x1'));module[_0x03bd('0x2')]={'uniqueid':{'type':Sequelize[_0x03bd('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x03bd('0x3')]},'joinAt':{'type':Sequelize[_0x03bd('0x4')]},'leaveAt':{'type':Sequelize[_0x03bd('0x4')]},'acceptAt':{'type':Sequelize[_0x03bd('0x4')]},'exitAt':{'type':Sequelize[_0x03bd('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xabf1=['moment','sequelize','exports','STRING','DATE'];(function(_0x3e079f,_0x189e15){var _0x296a34=function(_0xa31a0a){while(--_0xa31a0a){_0x3e079f['push'](_0x3e079f['shift']());}};_0x296a34(++_0x189e15);}(_0xabf1,0xa0));var _0x1abf=function(_0x54749f,_0x58a224){_0x54749f=_0x54749f-0x0;var _0x2dc80b=_0xabf1[_0x54749f];return _0x2dc80b;};'use strict';var moment=require(_0x1abf('0x0'));var Sequelize=require(_0x1abf('0x1'));module[_0x1abf('0x2')]={'uniqueid':{'type':Sequelize[_0x1abf('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1abf('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1abf('0x4')]},'reason':{'type':Sequelize[_0x1abf('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 4a380da..ee915b1 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 _0x5430=['update','then','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save'];(function(_0x151a73,_0x299e95){var _0x2b581c=function(_0x2f052b){while(--_0x2f052b){_0x151a73['push'](_0x151a73['shift']());}};_0x2b581c(++_0x299e95);}(_0x5430,0x10c));var _0x0543=function(_0x1bd5ae,_0x2a6921){_0x1bd5ae=_0x1bd5ae-0x0;var _0xb817cf=_0x5430[_0x1bd5ae];return _0xb817cf;};'use strict';var emlformat=require(_0x0543('0x0'));var rimraf=require(_0x0543('0x1'));var zipdir=require(_0x0543('0x2'));var jsonpatch=require(_0x0543('0x3'));var rp=require(_0x0543('0x4'));var moment=require(_0x0543('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0543('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0543('0x7'));var ejs=require(_0x0543('0x8'));var fs=require('fs');var fs_extra=require(_0x0543('0x9'));var _=require(_0x0543('0xa'));var squel=require(_0x0543('0xb'));var crypto=require('crypto');var jsforce=require(_0x0543('0xc'));var deskjs=require(_0x0543('0xd'));var toCsv=require(_0x0543('0x7'));var querystring=require(_0x0543('0xe'));var Papa=require(_0x0543('0xf'));var Redis=require(_0x0543('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0543('0x11'));var as=require(_0x0543('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0543('0x13'))(_0x0543('0x14'));var utils=require(_0x0543('0x15'));var config=require(_0x0543('0x16'));var licenseUtil=require(_0x0543('0x17'));var db=require(_0x0543('0x18'))['db'];function respondWithStatusCode(_0x30c54e,_0x27290d){_0x27290d=_0x27290d||0xcc;return function(_0x46d176){if(_0x46d176){return _0x30c54e[_0x0543('0x19')](_0x27290d);}return _0x30c54e[_0x0543('0x1a')](_0x27290d)[_0x0543('0x1b')]();};}function respondWithResult(_0x552980,_0x4f1f2a){_0x4f1f2a=_0x4f1f2a||0xc8;return function(_0x21e9ac){if(_0x21e9ac){return _0x552980['status'](_0x4f1f2a)['json'](_0x21e9ac);}};}function respondWithFilteredResult(_0xcb09df,_0x40fb03){return function(_0x1dff7d){if(_0x1dff7d){var _0x1cfadf=typeof _0x40fb03[_0x0543('0x1c')]==='undefined'&&typeof _0x40fb03[_0x0543('0x1d')]===_0x0543('0x1e');var _0x2dd5cb=_0x1dff7d[_0x0543('0x1f')];var _0x20b396=_0x1cfadf?0x0:_0x40fb03[_0x0543('0x1c')];var _0x577cf0=_0x1cfadf?_0x1dff7d['count']:_0x40fb03[_0x0543('0x1c')]+_0x40fb03['limit'];var _0x50ea84;if(_0x577cf0>=_0x2dd5cb){_0x577cf0=_0x2dd5cb;_0x50ea84=0xc8;}else{_0x50ea84=0xce;}_0xcb09df[_0x0543('0x1a')](_0x50ea84);return _0xcb09df[_0x0543('0x20')](_0x0543('0x21'),_0x20b396+'-'+_0x577cf0+'/'+_0x2dd5cb)['json'](_0x1dff7d);}return null;};}function patchUpdates(_0x3f0452){return function(_0x51c271){try{jsonpatch[_0x0543('0x22')](_0x51c271,_0x3f0452,!![]);}catch(_0x411ec2){return BPromise['reject'](_0x411ec2);}return _0x51c271[_0x0543('0x23')]();};}function saveUpdates(_0x333c72,_0x427919){return function(_0x110060){if(_0x110060){return _0x110060[_0x0543('0x24')](_0x333c72)[_0x0543('0x25')](function(_0x4adba7){return _0x4adba7;});}return null;};}function removeEntity(_0x5979d2,_0x59f1b2){return function(_0xbfe5dc){if(_0xbfe5dc){return _0xbfe5dc[_0x0543('0x26')]()[_0x0543('0x25')](function(){_0x5979d2[_0x0543('0x1a')](0xcc)[_0x0543('0x1b')]();});}};}function handleEntityNotFound(_0x26e500,_0x36d824){return function(_0x17a3de){if(!_0x17a3de){_0x26e500[_0x0543('0x19')](0x194);}return _0x17a3de;};}function handleError(_0xf1eccf,_0x40a261){_0x40a261=_0x40a261||0x1f4;return function(_0x21fc63){logger['error'](_0x21fc63[_0x0543('0x27')]);if(_0x21fc63[_0x0543('0x28')]){delete _0x21fc63[_0x0543('0x28')];}_0xf1eccf['status'](_0x40a261)[_0x0543('0x29')](_0x21fc63);};}exports[_0x0543('0x2a')]=function(_0x41c4a7,_0x10b881){var _0x5dd789={},_0x1732be={},_0x10b9f3={'count':0x0,'rows':[]};var _0x492f60=_['map'](db[_0x0543('0x2b')][_0x0543('0x2c')],function(_0x51d49d){return{'name':_0x51d49d[_0x0543('0x2d')],'type':_0x51d49d[_0x0543('0x2e')][_0x0543('0x2f')]};});_0x1732be[_0x0543('0x30')]=_[_0x0543('0x31')](_0x492f60,_0x0543('0x28'));_0x1732be[_0x0543('0x32')]=_['keys'](_0x41c4a7[_0x0543('0x32')]);_0x1732be['filters']=_[_0x0543('0x33')](_0x1732be[_0x0543('0x30')],_0x1732be[_0x0543('0x32')]);_0x5dd789[_0x0543('0x34')]=_[_0x0543('0x33')](_0x1732be['model'],qs[_0x0543('0x35')](_0x41c4a7['query'][_0x0543('0x35')]));_0x5dd789[_0x0543('0x34')]=_0x5dd789[_0x0543('0x34')][_0x0543('0x36')]?_0x5dd789['attributes']:_0x1732be[_0x0543('0x30')];if(!_0x41c4a7['query'][_0x0543('0x37')](_0x0543('0x38'))){_0x5dd789[_0x0543('0x1d')]=qs[_0x0543('0x1d')](_0x41c4a7[_0x0543('0x32')][_0x0543('0x1d')]);_0x5dd789[_0x0543('0x1c')]=qs[_0x0543('0x1c')](_0x41c4a7[_0x0543('0x32')][_0x0543('0x1c')]);}_0x5dd789['order']=qs[_0x0543('0x39')](_0x41c4a7[_0x0543('0x32')]['sort']);_0x5dd789[_0x0543('0x3a')]=qs['filters'](_[_0x0543('0x3b')](_0x41c4a7[_0x0543('0x32')],_0x1732be['filters']),_0x492f60);if(_0x41c4a7['query'][_0x0543('0x3c')]){_0x5dd789[_0x0543('0x3a')]=_['merge'](_0x5dd789[_0x0543('0x3a')],{'$or':_[_0x0543('0x31')](_0x492f60,function(_0x54543f){if(_0x54543f[_0x0543('0x2e')]!==_0x0543('0x3d')){var _0x3ecd70={};_0x3ecd70[_0x54543f[_0x0543('0x28')]]={'$like':'%'+_0x41c4a7[_0x0543('0x32')]['filter']+'%'};return _0x3ecd70;}})});}_0x5dd789=_['merge']({},_0x5dd789,_0x41c4a7['options']);var _0x486d9c={'where':_0x5dd789[_0x0543('0x3a')]};return db[_0x0543('0x2b')][_0x0543('0x1f')](_0x486d9c)['then'](function(_0xc66396){_0x10b9f3[_0x0543('0x1f')]=_0xc66396;if(_0x41c4a7[_0x0543('0x32')][_0x0543('0x3e')]){_0x5dd789[_0x0543('0x3f')]=[{'all':!![]}];}return db[_0x0543('0x2b')][_0x0543('0x40')](_0x5dd789);})['then'](function(_0x24a891){_0x10b9f3[_0x0543('0x41')]=_0x24a891;return _0x10b9f3;})[_0x0543('0x25')](respondWithFilteredResult(_0x10b881,_0x5dd789))[_0x0543('0x42')](handleError(_0x10b881,null));};exports[_0x0543('0x43')]=function(_0x43b7e8,_0x5bf53d){var _0x53dfb8={'raw':!![],'where':{'id':_0x43b7e8[_0x0543('0x44')]['id']}},_0x44116a={};_0x44116a[_0x0543('0x30')]=_[_0x0543('0x45')](db[_0x0543('0x2b')][_0x0543('0x2c')]);_0x44116a[_0x0543('0x32')]=_[_0x0543('0x45')](_0x43b7e8[_0x0543('0x32')]);_0x44116a['filters']=_['intersection'](_0x44116a[_0x0543('0x30')],_0x44116a[_0x0543('0x32')]);_0x53dfb8['attributes']=_['intersection'](_0x44116a[_0x0543('0x30')],qs[_0x0543('0x35')](_0x43b7e8['query'][_0x0543('0x35')]));_0x53dfb8['attributes']=_0x53dfb8[_0x0543('0x34')][_0x0543('0x36')]?_0x53dfb8['attributes']:_0x44116a['model'];if(_0x43b7e8[_0x0543('0x32')]['includeAll']){_0x53dfb8[_0x0543('0x3f')]=[{'all':!![]}];}_0x53dfb8=_[_0x0543('0x46')]({},_0x53dfb8,_0x43b7e8[_0x0543('0x47')]);return db[_0x0543('0x2b')][_0x0543('0x48')](_0x53dfb8)[_0x0543('0x25')](handleEntityNotFound(_0x5bf53d,null))['then'](respondWithResult(_0x5bf53d,null))[_0x0543('0x42')](handleError(_0x5bf53d,null));};exports[_0x0543('0x49')]=function(_0xb8076c,_0xf0a28f){return db[_0x0543('0x2b')]['create'](_0xb8076c[_0x0543('0x4a')],{})['then'](respondWithResult(_0xf0a28f,0xc9))[_0x0543('0x42')](handleError(_0xf0a28f,null));};exports[_0x0543('0x24')]=function(_0x3f4c40,_0x46d398){if(_0x3f4c40[_0x0543('0x4a')]['id']){delete _0x3f4c40[_0x0543('0x4a')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x3f4c40['params']['id']}})[_0x0543('0x25')](handleEntityNotFound(_0x46d398,null))[_0x0543('0x25')](saveUpdates(_0x3f4c40['body'],null))[_0x0543('0x25')](respondWithResult(_0x46d398,null))[_0x0543('0x42')](handleError(_0x46d398,null));};exports[_0x0543('0x26')]=function(_0x3d3bfc,_0x90dd22){return db[_0x0543('0x2b')]['find']({'where':{'id':_0x3d3bfc[_0x0543('0x44')]['id']}})[_0x0543('0x25')](handleEntityNotFound(_0x90dd22,null))[_0x0543('0x25')](removeEntity(_0x90dd22,null))[_0x0543('0x42')](handleError(_0x90dd22,null));};exports[_0x0543('0x4b')]=function(_0x449150,_0x265bc1){return db[_0x0543('0x2b')][_0x0543('0x4b')]()[_0x0543('0x25')](respondWithResult(_0x265bc1,null))[_0x0543('0x42')](handleError(_0x265bc1,null));};
\ No newline at end of file
+var _0x19fb=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','ChatQueueReport','findAll','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1fb4d7,_0x5c252d){var _0x37b2bd=function(_0x29a9eb){while(--_0x29a9eb){_0x1fb4d7['push'](_0x1fb4d7['shift']());}};_0x37b2bd(++_0x5c252d);}(_0x19fb,0xdd));var _0xb19f=function(_0x3b18f4,_0x569bee){_0x3b18f4=_0x3b18f4-0x0;var _0x5d748b=_0x19fb[_0x3b18f4];return _0x5d748b;};'use strict';var emlformat=require(_0xb19f('0x0'));var rimraf=require(_0xb19f('0x1'));var zipdir=require(_0xb19f('0x2'));var jsonpatch=require(_0xb19f('0x3'));var rp=require(_0xb19f('0x4'));var moment=require(_0xb19f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb19f('0x6'));var path=require(_0xb19f('0x7'));var sox=require(_0xb19f('0x8'));var csv=require(_0xb19f('0x9'));var ejs=require(_0xb19f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb19f('0xb'));var squel=require(_0xb19f('0xc'));var crypto=require(_0xb19f('0xd'));var jsforce=require(_0xb19f('0xe'));var deskjs=require(_0xb19f('0xf'));var toCsv=require(_0xb19f('0x9'));var querystring=require(_0xb19f('0x10'));var Papa=require(_0xb19f('0x11'));var Redis=require('ioredis');var authService=require(_0xb19f('0x12'));var qs=require(_0xb19f('0x13'));var as=require(_0xb19f('0x14'));var hardwareService=require(_0xb19f('0x15'));var logger=require(_0xb19f('0x16'))(_0xb19f('0x17'));var utils=require(_0xb19f('0x18'));var config=require(_0xb19f('0x19'));var licenseUtil=require(_0xb19f('0x1a'));var db=require(_0xb19f('0x1b'))['db'];function respondWithStatusCode(_0x22272f,_0x26a1d1){_0x26a1d1=_0x26a1d1||0xcc;return function(_0xc4a0b5){if(_0xc4a0b5){return _0x22272f[_0xb19f('0x1c')](_0x26a1d1);}return _0x22272f[_0xb19f('0x1d')](_0x26a1d1)['end']();};}function respondWithResult(_0x214290,_0x3482f9){_0x3482f9=_0x3482f9||0xc8;return function(_0x34518a){if(_0x34518a){return _0x214290['status'](_0x3482f9)[_0xb19f('0x1e')](_0x34518a);}};}function respondWithFilteredResult(_0x13ebd4,_0x46b688){return function(_0x5640ea){if(_0x5640ea){var _0x11318c=typeof _0x46b688[_0xb19f('0x1f')]===_0xb19f('0x20')&&typeof _0x46b688['limit']===_0xb19f('0x20');var _0x49d304=_0x5640ea['count'];var _0x5b52d9=_0x11318c?0x0:_0x46b688[_0xb19f('0x1f')];var _0x3b4367=_0x11318c?_0x5640ea[_0xb19f('0x21')]:_0x46b688[_0xb19f('0x1f')]+_0x46b688['limit'];var _0x2aedec;if(_0x3b4367>=_0x49d304){_0x3b4367=_0x49d304;_0x2aedec=0xc8;}else{_0x2aedec=0xce;}_0x13ebd4[_0xb19f('0x1d')](_0x2aedec);return _0x13ebd4['set'](_0xb19f('0x22'),_0x5b52d9+'-'+_0x3b4367+'/'+_0x49d304)['json'](_0x5640ea);}return null;};}function patchUpdates(_0x3950c9){return function(_0x2acb39){try{jsonpatch[_0xb19f('0x23')](_0x2acb39,_0x3950c9,!![]);}catch(_0xb449b4){return BPromise[_0xb19f('0x24')](_0xb449b4);}return _0x2acb39[_0xb19f('0x25')]();};}function saveUpdates(_0x333198,_0x4eb288){return function(_0x9ab8fc){if(_0x9ab8fc){return _0x9ab8fc[_0xb19f('0x26')](_0x333198)[_0xb19f('0x27')](function(_0x34c638){return _0x34c638;});}return null;};}function removeEntity(_0x47e313,_0x25fbdc){return function(_0x33b4ad){if(_0x33b4ad){return _0x33b4ad[_0xb19f('0x28')]()[_0xb19f('0x27')](function(){_0x47e313[_0xb19f('0x1d')](0xcc)[_0xb19f('0x29')]();});}};}function handleEntityNotFound(_0x28e0ad,_0x388b28){return function(_0xf528d){if(!_0xf528d){_0x28e0ad[_0xb19f('0x1c')](0x194);}return _0xf528d;};}function handleError(_0x2e0544,_0x59ccde){_0x59ccde=_0x59ccde||0x1f4;return function(_0x3e1365){logger[_0xb19f('0x2a')](_0x3e1365['stack']);if(_0x3e1365[_0xb19f('0x2b')]){delete _0x3e1365[_0xb19f('0x2b')];}_0x2e0544['status'](_0x59ccde)['send'](_0x3e1365);};}exports[_0xb19f('0x2c')]=function(_0x17c22d,_0x3d2f84){var _0x46abbe={},_0x5e479a={},_0x5043b2={'count':0x0,'rows':[]};var _0x5e4a74=_[_0xb19f('0x2d')](db['ChatQueueReport']['rawAttributes'],function(_0x4b06eb){return{'name':_0x4b06eb[_0xb19f('0x2e')],'type':_0x4b06eb[_0xb19f('0x2f')][_0xb19f('0x30')]};});_0x5e479a[_0xb19f('0x31')]=_[_0xb19f('0x2d')](_0x5e4a74,_0xb19f('0x2b'));_0x5e479a['query']=_[_0xb19f('0x32')](_0x17c22d[_0xb19f('0x33')]);_0x5e479a['filters']=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],_0x5e479a[_0xb19f('0x33')]);_0x46abbe[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],qs['fields'](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x36')]));_0x46abbe[_0xb19f('0x35')]=_0x46abbe[_0xb19f('0x35')][_0xb19f('0x37')]?_0x46abbe[_0xb19f('0x35')]:_0x5e479a['model'];if(!_0x17c22d[_0xb19f('0x33')][_0xb19f('0x38')](_0xb19f('0x39'))){_0x46abbe[_0xb19f('0x3a')]=qs[_0xb19f('0x3a')](_0x17c22d[_0xb19f('0x33')]['limit']);_0x46abbe[_0xb19f('0x1f')]=qs[_0xb19f('0x1f')](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x1f')]);}_0x46abbe[_0xb19f('0x3b')]=qs[_0xb19f('0x3c')](_0x17c22d[_0xb19f('0x33')]['sort']);_0x46abbe[_0xb19f('0x3d')]=qs['filters'](_[_0xb19f('0x3e')](_0x17c22d[_0xb19f('0x33')],_0x5e479a[_0xb19f('0x3f')]),_0x5e4a74);if(_0x17c22d['query'][_0xb19f('0x40')]){_0x46abbe['where']=_[_0xb19f('0x41')](_0x46abbe[_0xb19f('0x3d')],{'$or':_['map'](_0x5e4a74,function(_0x1e0a79){if(_0x1e0a79[_0xb19f('0x2f')]!==_0xb19f('0x42')){var _0x13afe8={};_0x13afe8[_0x1e0a79['name']]={'$like':'%'+_0x17c22d[_0xb19f('0x33')][_0xb19f('0x40')]+'%'};return _0x13afe8;}})});}_0x46abbe=_[_0xb19f('0x41')]({},_0x46abbe,_0x17c22d[_0xb19f('0x43')]);var _0x2b4b5d={'where':_0x46abbe[_0xb19f('0x3d')]};return db['ChatQueueReport'][_0xb19f('0x21')](_0x2b4b5d)['then'](function(_0x1b85f6){_0x5043b2['count']=_0x1b85f6;if(_0x17c22d[_0xb19f('0x33')][_0xb19f('0x44')]){_0x46abbe['include']=[{'all':!![]}];}return db[_0xb19f('0x45')][_0xb19f('0x46')](_0x46abbe);})[_0xb19f('0x27')](function(_0x13cae8){_0x5043b2['rows']=_0x13cae8;return _0x5043b2;})[_0xb19f('0x27')](respondWithFilteredResult(_0x3d2f84,_0x46abbe))[_0xb19f('0x47')](handleError(_0x3d2f84,null));};exports[_0xb19f('0x48')]=function(_0x52c368,_0x2c68de){var _0x5772ac={'raw':!![],'where':{'id':_0x52c368[_0xb19f('0x49')]['id']}},_0x16bf0d={};_0x16bf0d[_0xb19f('0x31')]=_[_0xb19f('0x32')](db[_0xb19f('0x45')][_0xb19f('0x4a')]);_0x16bf0d[_0xb19f('0x33')]=_[_0xb19f('0x32')](_0x52c368['query']);_0x16bf0d[_0xb19f('0x3f')]=_[_0xb19f('0x34')](_0x16bf0d['model'],_0x16bf0d[_0xb19f('0x33')]);_0x5772ac[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x16bf0d['model'],qs[_0xb19f('0x36')](_0x52c368['query'][_0xb19f('0x36')]));_0x5772ac['attributes']=_0x5772ac[_0xb19f('0x35')]['length']?_0x5772ac[_0xb19f('0x35')]:_0x16bf0d[_0xb19f('0x31')];if(_0x52c368[_0xb19f('0x33')]['includeAll']){_0x5772ac['include']=[{'all':!![]}];}_0x5772ac=_[_0xb19f('0x41')]({},_0x5772ac,_0x52c368[_0xb19f('0x43')]);return db[_0xb19f('0x45')]['find'](_0x5772ac)['then'](handleEntityNotFound(_0x2c68de,null))['then'](respondWithResult(_0x2c68de,null))[_0xb19f('0x47')](handleError(_0x2c68de,null));};exports[_0xb19f('0x4b')]=function(_0x5dbfdc,_0x194910){return db['ChatQueueReport'][_0xb19f('0x4b')](_0x5dbfdc[_0xb19f('0x4c')],{})[_0xb19f('0x27')](respondWithResult(_0x194910,0xc9))[_0xb19f('0x47')](handleError(_0x194910,null));};exports[_0xb19f('0x26')]=function(_0x401787,_0x20da72){if(_0x401787[_0xb19f('0x4c')]['id']){delete _0x401787[_0xb19f('0x4c')]['id'];}return db[_0xb19f('0x45')][_0xb19f('0x4d')]({'where':{'id':_0x401787['params']['id']}})['then'](handleEntityNotFound(_0x20da72,null))[_0xb19f('0x27')](saveUpdates(_0x401787[_0xb19f('0x4c')],null))[_0xb19f('0x27')](respondWithResult(_0x20da72,null))[_0xb19f('0x47')](handleError(_0x20da72,null));};exports[_0xb19f('0x28')]=function(_0x57812a,_0x58b3c5){return db[_0xb19f('0x45')]['find']({'where':{'id':_0x57812a[_0xb19f('0x49')]['id']}})[_0xb19f('0x27')](handleEntityNotFound(_0x58b3c5,null))[_0xb19f('0x27')](removeEntity(_0x58b3c5,null))['catch'](handleError(_0x58b3c5,null));};exports[_0xb19f('0x4e')]=function(_0x12b227,_0x1b7e57){return db[_0xb19f('0x45')][_0xb19f('0x4e')]()[_0xb19f('0x27')](respondWithResult(_0x1b7e57,null))[_0xb19f('0x47')](handleError(_0x1b7e57,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 611e5f7..39281e0 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x430524,_0x23b611){var _0x3a726d=function(_0x5cc39d){while(--_0x5cc39d){_0x430524['push'](_0x430524['shift']());}};_0x3a726d(++_0x23b611);}(_0xe706,0xa3));var _0x6e70=function(_0x567703,_0x4b1cfa){_0x567703=_0x567703-0x0;var _0x1cd94a=_0xe706[_0x567703];return _0x1cd94a;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 2d583f1..e0b7a31 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 _0x0145=['then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','debug','UpdateChatQueueReport','update','raw','where','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x0145,0xc5));var _0x5014=function(_0x58d40c,_0x28e394){_0x58d40c=_0x58d40c-0x0;var _0x70ea9e=_0x0145[_0x58d40c];return _0x70ea9e;};'use strict';var _=require(_0x5014('0x0'));var util=require(_0x5014('0x1'));var moment=require(_0x5014('0x2'));var BPromise=require('bluebird');var rs=require(_0x5014('0x3'));var fs=require('fs');var Redis=require(_0x5014('0x4'));var db=require(_0x5014('0x5'))['db'];var utils=require(_0x5014('0x6'));var logger=require(_0x5014('0x7'))(_0x5014('0x8'));var config=require(_0x5014('0x9'));var jayson=require(_0x5014('0xa'));var client=jayson[_0x5014('0xb')][_0x5014('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2baf7f,_0x5cfcfd,_0x1decac){return new BPromise(function(_0x2dad9f,_0x343899){return client['request'](_0x2baf7f,_0x1decac)[_0x5014('0xd')](function(_0x44d221){logger[_0x5014('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x5cfcfd,_0x5014('0xf'));logger['debug'](_0x5014('0x10'),_0x5cfcfd,_0x5014('0xf'),JSON[_0x5014('0x11')](_0x44d221));if(_0x44d221[_0x5014('0x12')]){if(_0x44d221[_0x5014('0x12')][_0x5014('0x13')]===0x1f4){logger[_0x5014('0x12')](_0x5014('0x14'),_0x5cfcfd,_0x44d221['error'][_0x5014('0x15')]);return _0x343899(_0x44d221[_0x5014('0x12')][_0x5014('0x15')]);}logger[_0x5014('0x12')](_0x5014('0x14'),_0x5cfcfd,_0x44d221[_0x5014('0x12')][_0x5014('0x15')]);return _0x2dad9f(_0x44d221[_0x5014('0x12')][_0x5014('0x15')]);}else{logger[_0x5014('0xe')](_0x5014('0x14'),_0x5cfcfd,'request\x20sent');_0x2dad9f(_0x44d221[_0x5014('0x16')][_0x5014('0x15')]);}})[_0x5014('0x17')](function(_0x296471){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x5cfcfd,_0x296471);_0x343899(_0x296471);});});}exports[_0x5014('0x18')]=function(_0x4f1a36){var _0x273018=this;return new Promise(function(_0x1c9451,_0x4a8f04){return db[_0x5014('0x19')][_0x5014('0x1a')](_0x4f1a36[_0x5014('0x1b')],{'raw':_0x4f1a36[_0x5014('0x1c')]?_0x4f1a36[_0x5014('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x5014('0xd')](function(_0x59ea2a){logger[_0x5014('0xe')]('CreateChatQueueReport',_0x4f1a36);logger[_0x5014('0x1d')](_0x5014('0x18'),_0x4f1a36,JSON[_0x5014('0x11')](_0x59ea2a));_0x1c9451(_0x59ea2a);})[_0x5014('0x17')](function(_0x44cfb1){logger['error'](_0x5014('0x18'),_0x44cfb1[_0x5014('0x15')],_0x4f1a36);_0x4a8f04(_0x273018[_0x5014('0x12')](0x1f4,_0x44cfb1[_0x5014('0x15')]));});});};exports[_0x5014('0x1e')]=function(_0x2ba853){var _0x569ef9=this;return new Promise(function(_0x241314,_0x378e46){return db[_0x5014('0x19')][_0x5014('0x1f')](_0x2ba853[_0x5014('0x1b')],{'raw':_0x2ba853[_0x5014('0x1c')]?_0x2ba853['options'][_0x5014('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ba853['options']?_0x2ba853['options'][_0x5014('0x21')]||null:null,'attributes':_0x2ba853[_0x5014('0x1c')]?_0x2ba853[_0x5014('0x1c')]['attributes']||null:null,'limit':_0x2ba853['options']?_0x2ba853[_0x5014('0x1c')][_0x5014('0x22')]||null:null})[_0x5014('0xd')](function(_0x5beaec){logger[_0x5014('0xe')](_0x5014('0x1e'),_0x2ba853);logger[_0x5014('0x1d')]('UpdateChatQueueReport',_0x2ba853,JSON['stringify'](_0x5beaec));_0x241314(_0x5beaec);})[_0x5014('0x17')](function(_0x55f98c){logger[_0x5014('0x12')](_0x5014('0x1e'),_0x55f98c[_0x5014('0x15')],_0x2ba853);_0x378e46(_0x569ef9[_0x5014('0x12')](0x1f4,_0x55f98c[_0x5014('0x15')]));});});};
\ No newline at end of file
+var _0x2c5e=['catch','UpdateChatQueueReport','update','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw'];(function(_0x431c04,_0xf7760c){var _0x3bd133=function(_0x39141c){while(--_0x39141c){_0x431c04['push'](_0x431c04['shift']());}};_0x3bd133(++_0xf7760c);}(_0x2c5e,0x19d));var _0xe2c5=function(_0x11c77a,_0x51c1f7){_0x11c77a=_0x11c77a-0x0;var _0x3778da=_0x2c5e[_0x11c77a];return _0x3778da;};'use strict';var _=require(_0xe2c5('0x0'));var util=require('util');var moment=require(_0xe2c5('0x1'));var BPromise=require(_0xe2c5('0x2'));var rs=require(_0xe2c5('0x3'));var fs=require('fs');var Redis=require(_0xe2c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2c5('0x5'));var logger=require(_0xe2c5('0x6'))(_0xe2c5('0x7'));var config=require(_0xe2c5('0x8'));var jayson=require(_0xe2c5('0x9'));var client=jayson[_0xe2c5('0xa')][_0xe2c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52249b,_0x2f1077,_0x5f0ce3){return new BPromise(function(_0x454a8e,_0x9aa7e0){return client['request'](_0x52249b,_0x5f0ce3)[_0xe2c5('0xc')](function(_0x3a7854){logger[_0xe2c5('0xd')](_0xe2c5('0xe'),_0x2f1077,_0xe2c5('0xf'));logger[_0xe2c5('0x10')](_0xe2c5('0x11'),_0x2f1077,_0xe2c5('0xf'),JSON[_0xe2c5('0x12')](_0x3a7854));if(_0x3a7854[_0xe2c5('0x13')]){if(_0x3a7854[_0xe2c5('0x13')][_0xe2c5('0x14')]===0x1f4){logger[_0xe2c5('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x2f1077,_0x3a7854['error'][_0xe2c5('0x15')]);return _0x9aa7e0(_0x3a7854[_0xe2c5('0x13')][_0xe2c5('0x15')]);}logger[_0xe2c5('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x2f1077,_0x3a7854[_0xe2c5('0x13')][_0xe2c5('0x15')]);return _0x454a8e(_0x3a7854[_0xe2c5('0x13')][_0xe2c5('0x15')]);}else{logger[_0xe2c5('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x2f1077,_0xe2c5('0xf'));_0x454a8e(_0x3a7854[_0xe2c5('0x16')][_0xe2c5('0x15')]);}})['catch'](function(_0x56bae2){logger[_0xe2c5('0x13')](_0xe2c5('0xe'),_0x2f1077,_0x56bae2);_0x9aa7e0(_0x56bae2);});});}exports[_0xe2c5('0x17')]=function(_0x2df4c3){var _0x13a197=this;return new Promise(function(_0x56f52c,_0x42dc74){return db[_0xe2c5('0x18')][_0xe2c5('0x19')](_0x2df4c3[_0xe2c5('0x1a')],{'raw':_0x2df4c3[_0xe2c5('0x1b')]?_0x2df4c3[_0xe2c5('0x1b')][_0xe2c5('0x1c')]===undefined?!![]:![]:!![]})[_0xe2c5('0xc')](function(_0x2ac22d){logger[_0xe2c5('0xd')](_0xe2c5('0x17'),_0x2df4c3);logger['debug'](_0xe2c5('0x17'),_0x2df4c3,JSON[_0xe2c5('0x12')](_0x2ac22d));_0x56f52c(_0x2ac22d);})[_0xe2c5('0x1d')](function(_0x427a79){logger['error'](_0xe2c5('0x17'),_0x427a79['message'],_0x2df4c3);_0x42dc74(_0x13a197[_0xe2c5('0x13')](0x1f4,_0x427a79['message']));});});};exports[_0xe2c5('0x1e')]=function(_0xa284d1){var _0x3d3bd0=this;return new Promise(function(_0x27b670,_0x50c684){return db[_0xe2c5('0x18')][_0xe2c5('0x1f')](_0xa284d1[_0xe2c5('0x1a')],{'raw':_0xa284d1['options']?_0xa284d1[_0xe2c5('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa284d1[_0xe2c5('0x1b')]?_0xa284d1[_0xe2c5('0x1b')]['where']||null:null,'attributes':_0xa284d1[_0xe2c5('0x1b')]?_0xa284d1[_0xe2c5('0x1b')][_0xe2c5('0x20')]||null:null,'limit':_0xa284d1[_0xe2c5('0x1b')]?_0xa284d1[_0xe2c5('0x1b')][_0xe2c5('0x21')]||null:null})[_0xe2c5('0xc')](function(_0x201b78){logger['info'](_0xe2c5('0x1e'),_0xa284d1);logger[_0xe2c5('0x10')](_0xe2c5('0x1e'),_0xa284d1,JSON[_0xe2c5('0x12')](_0x201b78));_0x27b670(_0x201b78);})['catch'](function(_0x3992dd){logger[_0xe2c5('0x13')](_0xe2c5('0x1e'),_0x3992dd['message'],_0xa284d1);_0x50c684(_0x3d3bd0[_0xe2c5('0x13')](0x1f4,_0x3992dd[_0xe2c5('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 505d167..9a114d0 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 _0xe125=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xe125,0x1b1));var _0x5e12=function(_0x2c321f,_0x183faf){_0x2c321f=_0x2c321f-0x0;var _0x5300a0=_0xe125[_0x2c321f];return _0x5300a0;};'use strict';var multer=require(_0x5e12('0x0'));var util=require(_0x5e12('0x1'));var path=require(_0x5e12('0x2'));var timeout=require(_0x5e12('0x3'));var express=require(_0x5e12('0x4'));var router=express[_0x5e12('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5e12('0x6'));var interaction=require(_0x5e12('0x7'));var config=require(_0x5e12('0x8'));var controller=require('./chatQueueReport.controller');router[_0x5e12('0x9')]('/',auth[_0x5e12('0xa')](),controller['index']);router[_0x5e12('0x9')](_0x5e12('0xb'),auth[_0x5e12('0xa')](),controller['describe']);router[_0x5e12('0x9')]('/:id',auth[_0x5e12('0xa')](),controller[_0x5e12('0xc')]);router[_0x5e12('0xd')]('/',auth[_0x5e12('0xa')](),controller['create']);router[_0x5e12('0xe')](_0x5e12('0xf'),auth['isAuthenticated'](),controller[_0x5e12('0x10')]);router[_0x5e12('0x11')](_0x5e12('0xf'),auth[_0x5e12('0xa')](),controller[_0x5e12('0x12')]);module[_0x5e12('0x13')]=router;
\ No newline at end of file
+var _0xa9ed=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','path','express','Router'];(function(_0x10bb9c,_0x311990){var _0x379d24=function(_0x2565b6){while(--_0x2565b6){_0x10bb9c['push'](_0x10bb9c['shift']());}};_0x379d24(++_0x311990);}(_0xa9ed,0x11b));var _0xda9e=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0xa9ed[_0x43026b];return _0x4a96cd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xda9e('0x0'));var timeout=require('connect-timeout');var express=require(_0xda9e('0x1'));var router=express[_0xda9e('0x2')]();var fs_extra=require(_0xda9e('0x3'));var auth=require(_0xda9e('0x4'));var interaction=require(_0xda9e('0x5'));var config=require(_0xda9e('0x6'));var controller=require(_0xda9e('0x7'));router[_0xda9e('0x8')]('/',auth[_0xda9e('0x9')](),controller[_0xda9e('0xa')]);router[_0xda9e('0x8')](_0xda9e('0xb'),auth[_0xda9e('0x9')](),controller[_0xda9e('0xc')]);router[_0xda9e('0x8')](_0xda9e('0xd'),auth[_0xda9e('0x9')](),controller[_0xda9e('0xe')]);router[_0xda9e('0xf')]('/',auth['isAuthenticated'](),controller[_0xda9e('0x10')]);router[_0xda9e('0x11')](_0xda9e('0xd'),auth[_0xda9e('0x9')](),controller[_0xda9e('0x12')]);router[_0xda9e('0x13')](_0xda9e('0xd'),auth[_0xda9e('0x9')](),controller[_0xda9e('0x14')]);module[_0xda9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0b509b4..ef6c23b 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0xfec81c,_0x3f7f63){var _0x5d21f6=function(_0x2a0813){while(--_0x2a0813){_0xfec81c['push'](_0xfec81c['shift']());}};_0x5d21f6(++_0x3f7f63);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x5cc9ae,_0x116739){var _0xef9aa1=function(_0x403b0c){while(--_0x403b0c){_0x5cc9ae['push'](_0x5cc9ae['shift']());}};_0xef9aa1(++_0x116739);}(_0x54ef,0x112));var _0xf54e=function(_0x2cd04e,_0x56b3cd){_0x2cd04e=_0x2cd04e-0x0;var _0x28beda=_0x54ef[_0x2cd04e];return _0x28beda;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 5ae14db..d5803f4 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 _0xf87b=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','update','destroy','then','end','stack','name','send','index','map','ChatTransferReport','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','catch','show','params','rawAttributes','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel'];(function(_0x3b086e,_0x38d0ce){var _0x14dbd3=function(_0x264610){while(--_0x264610){_0x3b086e['push'](_0x3b086e['shift']());}};_0x14dbd3(++_0x38d0ce);}(_0xf87b,0x156));var _0xbf87=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf87b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xbf87('0x0'));var rimraf=require(_0xbf87('0x1'));var zipdir=require(_0xbf87('0x2'));var jsonpatch=require(_0xbf87('0x3'));var rp=require(_0xbf87('0x4'));var moment=require(_0xbf87('0x5'));var BPromise=require(_0xbf87('0x6'));var Mustache=require(_0xbf87('0x7'));var util=require(_0xbf87('0x8'));var path=require(_0xbf87('0x9'));var sox=require('sox');var csv=require(_0xbf87('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf87('0xb'));var _=require('lodash');var squel=require(_0xbf87('0xc'));var crypto=require('crypto');var jsforce=require(_0xbf87('0xd'));var deskjs=require(_0xbf87('0xe'));var toCsv=require(_0xbf87('0xa'));var querystring=require(_0xbf87('0xf'));var Papa=require('papaparse');var Redis=require(_0xbf87('0x10'));var authService=require(_0xbf87('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf87('0x12'));var logger=require(_0xbf87('0x13'))(_0xbf87('0x14'));var utils=require('../../config/utils');var config=require(_0xbf87('0x15'));var licenseUtil=require(_0xbf87('0x16'));var db=require(_0xbf87('0x17'))['db'];function respondWithStatusCode(_0x2ad1e2,_0x302ac0){_0x302ac0=_0x302ac0||0xcc;return function(_0x4035c2){if(_0x4035c2){return _0x2ad1e2[_0xbf87('0x18')](_0x302ac0);}return _0x2ad1e2[_0xbf87('0x19')](_0x302ac0)['end']();};}function respondWithResult(_0x584d3c,_0x52277a){_0x52277a=_0x52277a||0xc8;return function(_0x81f4d6){if(_0x81f4d6){return _0x584d3c[_0xbf87('0x19')](_0x52277a)['json'](_0x81f4d6);}};}function respondWithFilteredResult(_0x1e8dd5,_0x4d0527){return function(_0x449cb1){if(_0x449cb1){var _0x5bc1a7=typeof _0x4d0527[_0xbf87('0x1a')]==='undefined'&&typeof _0x4d0527[_0xbf87('0x1b')]==='undefined';var _0x52a0a8=_0x449cb1[_0xbf87('0x1c')];var _0x4d70ca=_0x5bc1a7?0x0:_0x4d0527[_0xbf87('0x1a')];var _0x33cfc1=_0x5bc1a7?_0x449cb1[_0xbf87('0x1c')]:_0x4d0527[_0xbf87('0x1a')]+_0x4d0527[_0xbf87('0x1b')];var _0xf3e2c4;if(_0x33cfc1>=_0x52a0a8){_0x33cfc1=_0x52a0a8;_0xf3e2c4=0xc8;}else{_0xf3e2c4=0xce;}_0x1e8dd5['status'](_0xf3e2c4);return _0x1e8dd5[_0xbf87('0x1d')](_0xbf87('0x1e'),_0x4d70ca+'-'+_0x33cfc1+'/'+_0x52a0a8)['json'](_0x449cb1);}return null;};}function patchUpdates(_0x28fe91){return function(_0x431943){try{jsonpatch['apply'](_0x431943,_0x28fe91,!![]);}catch(_0x2ebd3a){return BPromise['reject'](_0x2ebd3a);}return _0x431943['save']();};}function saveUpdates(_0x29e964,_0x9c71af){return function(_0x5681fe){if(_0x5681fe){return _0x5681fe[_0xbf87('0x1f')](_0x29e964)['then'](function(_0x315424){return _0x315424;});}return null;};}function removeEntity(_0x4eb504,_0x1b80cf){return function(_0x511df2){if(_0x511df2){return _0x511df2[_0xbf87('0x20')]()[_0xbf87('0x21')](function(){_0x4eb504[_0xbf87('0x19')](0xcc)[_0xbf87('0x22')]();});}};}function handleEntityNotFound(_0x24c3ad,_0x335960){return function(_0x26d299){if(!_0x26d299){_0x24c3ad[_0xbf87('0x18')](0x194);}return _0x26d299;};}function handleError(_0x31fcbf,_0x2212ce){_0x2212ce=_0x2212ce||0x1f4;return function(_0x976d48){logger['error'](_0x976d48[_0xbf87('0x23')]);if(_0x976d48['name']){delete _0x976d48[_0xbf87('0x24')];}_0x31fcbf['status'](_0x2212ce)[_0xbf87('0x25')](_0x976d48);};}exports[_0xbf87('0x26')]=function(_0x3acf58,_0x5d976d){var _0x15bc12={},_0x66bce={},_0x245961={'count':0x0,'rows':[]};var _0x1092a7=_[_0xbf87('0x27')](db[_0xbf87('0x28')]['rawAttributes'],function(_0x5b3c02){return{'name':_0x5b3c02[_0xbf87('0x29')],'type':_0x5b3c02['type'][_0xbf87('0x2a')]};});_0x66bce['model']=_[_0xbf87('0x27')](_0x1092a7,_0xbf87('0x24'));_0x66bce[_0xbf87('0x2b')]=_[_0xbf87('0x2c')](_0x3acf58['query']);_0x66bce['filters']=_['intersection'](_0x66bce[_0xbf87('0x2d')],_0x66bce[_0xbf87('0x2b')]);_0x15bc12[_0xbf87('0x2e')]=_['intersection'](_0x66bce['model'],qs[_0xbf87('0x2f')](_0x3acf58[_0xbf87('0x2b')]['fields']));_0x15bc12[_0xbf87('0x2e')]=_0x15bc12[_0xbf87('0x2e')][_0xbf87('0x30')]?_0x15bc12[_0xbf87('0x2e')]:_0x66bce[_0xbf87('0x2d')];if(!_0x3acf58['query'][_0xbf87('0x31')](_0xbf87('0x32'))){_0x15bc12[_0xbf87('0x1b')]=qs[_0xbf87('0x1b')](_0x3acf58['query'][_0xbf87('0x1b')]);_0x15bc12[_0xbf87('0x1a')]=qs['offset'](_0x3acf58[_0xbf87('0x2b')][_0xbf87('0x1a')]);}_0x15bc12['order']=qs[_0xbf87('0x33')](_0x3acf58['query'][_0xbf87('0x33')]);_0x15bc12[_0xbf87('0x34')]=qs[_0xbf87('0x35')](_[_0xbf87('0x36')](_0x3acf58['query'],_0x66bce[_0xbf87('0x35')]),_0x1092a7);if(_0x3acf58['query'][_0xbf87('0x37')]){_0x15bc12[_0xbf87('0x34')]=_[_0xbf87('0x38')](_0x15bc12['where'],{'$or':_['map'](_0x1092a7,function(_0x26e36a){if(_0x26e36a[_0xbf87('0x39')]!=='VIRTUAL'){var _0x1ff46e={};_0x1ff46e[_0x26e36a[_0xbf87('0x24')]]={'$like':'%'+_0x3acf58[_0xbf87('0x2b')]['filter']+'%'};return _0x1ff46e;}})});}_0x15bc12=_[_0xbf87('0x38')]({},_0x15bc12,_0x3acf58[_0xbf87('0x3a')]);var _0x3ad355={'where':_0x15bc12['where']};return db[_0xbf87('0x28')]['count'](_0x3ad355)['then'](function(_0x1d0d1f){_0x245961['count']=_0x1d0d1f;if(_0x3acf58[_0xbf87('0x2b')][_0xbf87('0x3b')]){_0x15bc12[_0xbf87('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xbf87('0x3d')](_0x15bc12);})['then'](function(_0x2a680a){_0x245961['rows']=_0x2a680a;return _0x245961;})[_0xbf87('0x21')](respondWithFilteredResult(_0x5d976d,_0x15bc12))[_0xbf87('0x3e')](handleError(_0x5d976d,null));};exports[_0xbf87('0x3f')]=function(_0x2b3c1a,_0x3436a8){var _0x5f240d={'raw':!![],'where':{'id':_0x2b3c1a[_0xbf87('0x40')]['id']}},_0x578a2f={};_0x578a2f[_0xbf87('0x2d')]=_[_0xbf87('0x2c')](db[_0xbf87('0x28')][_0xbf87('0x41')]);_0x578a2f['query']=_[_0xbf87('0x2c')](_0x2b3c1a[_0xbf87('0x2b')]);_0x578a2f[_0xbf87('0x35')]=_['intersection'](_0x578a2f['model'],_0x578a2f[_0xbf87('0x2b')]);_0x5f240d[_0xbf87('0x2e')]=_[_0xbf87('0x42')](_0x578a2f[_0xbf87('0x2d')],qs[_0xbf87('0x2f')](_0x2b3c1a[_0xbf87('0x2b')][_0xbf87('0x2f')]));_0x5f240d[_0xbf87('0x2e')]=_0x5f240d[_0xbf87('0x2e')][_0xbf87('0x30')]?_0x5f240d[_0xbf87('0x2e')]:_0x578a2f[_0xbf87('0x2d')];if(_0x2b3c1a[_0xbf87('0x2b')][_0xbf87('0x3b')]){_0x5f240d['include']=[{'all':!![]}];}_0x5f240d=_['merge']({},_0x5f240d,_0x2b3c1a[_0xbf87('0x3a')]);return db[_0xbf87('0x28')][_0xbf87('0x43')](_0x5f240d)[_0xbf87('0x21')](handleEntityNotFound(_0x3436a8,null))[_0xbf87('0x21')](respondWithResult(_0x3436a8,null))[_0xbf87('0x3e')](handleError(_0x3436a8,null));};exports[_0xbf87('0x44')]=function(_0x440155,_0x16566c){return db[_0xbf87('0x28')][_0xbf87('0x44')](_0x440155['body'],{})[_0xbf87('0x21')](respondWithResult(_0x16566c,0xc9))[_0xbf87('0x3e')](handleError(_0x16566c,null));};exports['update']=function(_0x4296b0,_0x4d5f15){if(_0x4296b0[_0xbf87('0x45')]['id']){delete _0x4296b0[_0xbf87('0x45')]['id'];}return db[_0xbf87('0x28')]['find']({'where':{'id':_0x4296b0[_0xbf87('0x40')]['id']}})['then'](handleEntityNotFound(_0x4d5f15,null))[_0xbf87('0x21')](saveUpdates(_0x4296b0['body'],null))[_0xbf87('0x21')](respondWithResult(_0x4d5f15,null))[_0xbf87('0x3e')](handleError(_0x4d5f15,null));};exports['destroy']=function(_0x32bf66,_0x2e1105){return db[_0xbf87('0x28')][_0xbf87('0x43')]({'where':{'id':_0x32bf66['params']['id']}})[_0xbf87('0x21')](handleEntityNotFound(_0x2e1105,null))[_0xbf87('0x21')](removeEntity(_0x2e1105,null))[_0xbf87('0x3e')](handleError(_0x2e1105,null));};exports[_0xbf87('0x46')]=function(_0xa683f3,_0x45da2b){return db[_0xbf87('0x28')][_0xbf87('0x46')]()[_0xbf87('0x21')](respondWithResult(_0x45da2b,null))[_0xbf87('0x3e')](handleError(_0x45da2b,null));};
\ No newline at end of file
+var _0x3887=['papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','then','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2631ea,_0x5ce0b0){var _0x4c3808=function(_0x8e021d){while(--_0x8e021d){_0x2631ea['push'](_0x2631ea['shift']());}};_0x4c3808(++_0x5ce0b0);}(_0x3887,0x82));var _0x7388=function(_0x2f49df,_0x518919){_0x2f49df=_0x2f49df-0x0;var _0x1ec090=_0x3887[_0x2f49df];return _0x1ec090;};'use strict';var emlformat=require(_0x7388('0x0'));var rimraf=require(_0x7388('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7388('0x2'));var BPromise=require(_0x7388('0x3'));var Mustache=require(_0x7388('0x4'));var util=require(_0x7388('0x5'));var path=require(_0x7388('0x6'));var sox=require('sox');var csv=require(_0x7388('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7388('0x8'));var squel=require(_0x7388('0x9'));var crypto=require(_0x7388('0xa'));var jsforce=require(_0x7388('0xb'));var deskjs=require(_0x7388('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7388('0xd'));var Papa=require(_0x7388('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7388('0xf'));var hardwareService=require(_0x7388('0x10'));var logger=require(_0x7388('0x11'))(_0x7388('0x12'));var utils=require(_0x7388('0x13'));var config=require(_0x7388('0x14'));var licenseUtil=require(_0x7388('0x15'));var db=require(_0x7388('0x16'))['db'];function respondWithStatusCode(_0x1009ba,_0xbd4f0d){_0xbd4f0d=_0xbd4f0d||0xcc;return function(_0x32a1b1){if(_0x32a1b1){return _0x1009ba[_0x7388('0x17')](_0xbd4f0d);}return _0x1009ba[_0x7388('0x18')](_0xbd4f0d)[_0x7388('0x19')]();};}function respondWithResult(_0x4b4a79,_0x16cc8d){_0x16cc8d=_0x16cc8d||0xc8;return function(_0xc13899){if(_0xc13899){return _0x4b4a79['status'](_0x16cc8d)[_0x7388('0x1a')](_0xc13899);}};}function respondWithFilteredResult(_0x8df6f7,_0x12effe){return function(_0x352c63){if(_0x352c63){var _0x2d252c=typeof _0x12effe[_0x7388('0x1b')]==='undefined'&&typeof _0x12effe[_0x7388('0x1c')]===_0x7388('0x1d');var _0x305751=_0x352c63[_0x7388('0x1e')];var _0x4ac3ca=_0x2d252c?0x0:_0x12effe[_0x7388('0x1b')];var _0x4b4f92=_0x2d252c?_0x352c63['count']:_0x12effe[_0x7388('0x1b')]+_0x12effe[_0x7388('0x1c')];var _0x49eb55;if(_0x4b4f92>=_0x305751){_0x4b4f92=_0x305751;_0x49eb55=0xc8;}else{_0x49eb55=0xce;}_0x8df6f7[_0x7388('0x18')](_0x49eb55);return _0x8df6f7[_0x7388('0x1f')](_0x7388('0x20'),_0x4ac3ca+'-'+_0x4b4f92+'/'+_0x305751)[_0x7388('0x1a')](_0x352c63);}return null;};}function patchUpdates(_0x28f1da){return function(_0xc69ded){try{jsonpatch[_0x7388('0x21')](_0xc69ded,_0x28f1da,!![]);}catch(_0x50cf8a){return BPromise[_0x7388('0x22')](_0x50cf8a);}return _0xc69ded['save']();};}function saveUpdates(_0x10c0d8,_0xde4f98){return function(_0x44e25a){if(_0x44e25a){return _0x44e25a['update'](_0x10c0d8)['then'](function(_0x480b26){return _0x480b26;});}return null;};}function removeEntity(_0x214896,_0xf312ee){return function(_0x128caa){if(_0x128caa){return _0x128caa['destroy']()['then'](function(){_0x214896[_0x7388('0x18')](0xcc)[_0x7388('0x19')]();});}};}function handleEntityNotFound(_0x6ef790,_0x5e30b0){return function(_0x187710){if(!_0x187710){_0x6ef790[_0x7388('0x17')](0x194);}return _0x187710;};}function handleError(_0x1774f2,_0x178ee0){_0x178ee0=_0x178ee0||0x1f4;return function(_0x228b64){logger[_0x7388('0x23')](_0x228b64[_0x7388('0x24')]);if(_0x228b64[_0x7388('0x25')]){delete _0x228b64['name'];}_0x1774f2[_0x7388('0x18')](_0x178ee0)['send'](_0x228b64);};}exports[_0x7388('0x26')]=function(_0x16cceb,_0x57ed12){var _0x4f8988={},_0xcc36b5={},_0x29d093={'count':0x0,'rows':[]};var _0x4d2ffc=_['map'](db[_0x7388('0x27')][_0x7388('0x28')],function(_0x4c50e7){return{'name':_0x4c50e7[_0x7388('0x29')],'type':_0x4c50e7['type']['key']};});_0xcc36b5[_0x7388('0x2a')]=_['map'](_0x4d2ffc,'name');_0xcc36b5[_0x7388('0x2b')]=_[_0x7388('0x2c')](_0x16cceb['query']);_0xcc36b5[_0x7388('0x2d')]=_[_0x7388('0x2e')](_0xcc36b5[_0x7388('0x2a')],_0xcc36b5['query']);_0x4f8988[_0x7388('0x2f')]=_[_0x7388('0x2e')](_0xcc36b5[_0x7388('0x2a')],qs[_0x7388('0x30')](_0x16cceb[_0x7388('0x2b')][_0x7388('0x30')]));_0x4f8988[_0x7388('0x2f')]=_0x4f8988[_0x7388('0x2f')][_0x7388('0x31')]?_0x4f8988['attributes']:_0xcc36b5[_0x7388('0x2a')];if(!_0x16cceb['query']['hasOwnProperty'](_0x7388('0x32'))){_0x4f8988[_0x7388('0x1c')]=qs['limit'](_0x16cceb['query'][_0x7388('0x1c')]);_0x4f8988[_0x7388('0x1b')]=qs['offset'](_0x16cceb[_0x7388('0x2b')][_0x7388('0x1b')]);}_0x4f8988[_0x7388('0x33')]=qs[_0x7388('0x34')](_0x16cceb[_0x7388('0x2b')][_0x7388('0x34')]);_0x4f8988['where']=qs[_0x7388('0x2d')](_[_0x7388('0x35')](_0x16cceb[_0x7388('0x2b')],_0xcc36b5[_0x7388('0x2d')]),_0x4d2ffc);if(_0x16cceb[_0x7388('0x2b')][_0x7388('0x36')]){_0x4f8988[_0x7388('0x37')]=_[_0x7388('0x38')](_0x4f8988[_0x7388('0x37')],{'$or':_[_0x7388('0x39')](_0x4d2ffc,function(_0xc3b574){if(_0xc3b574['type']!==_0x7388('0x3a')){var _0x282c66={};_0x282c66[_0xc3b574[_0x7388('0x25')]]={'$like':'%'+_0x16cceb[_0x7388('0x2b')][_0x7388('0x36')]+'%'};return _0x282c66;}})});}_0x4f8988=_['merge']({},_0x4f8988,_0x16cceb[_0x7388('0x3b')]);var _0xf92b70={'where':_0x4f8988[_0x7388('0x37')]};return db[_0x7388('0x27')][_0x7388('0x1e')](_0xf92b70)['then'](function(_0x15225b){_0x29d093['count']=_0x15225b;if(_0x16cceb['query'][_0x7388('0x3c')]){_0x4f8988[_0x7388('0x3d')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x4f8988);})[_0x7388('0x3e')](function(_0x3d1118){_0x29d093[_0x7388('0x3f')]=_0x3d1118;return _0x29d093;})[_0x7388('0x3e')](respondWithFilteredResult(_0x57ed12,_0x4f8988))[_0x7388('0x40')](handleError(_0x57ed12,null));};exports[_0x7388('0x41')]=function(_0x1087f0,_0x2a1148){var _0x11e003={'raw':!![],'where':{'id':_0x1087f0[_0x7388('0x42')]['id']}},_0x24fa29={};_0x24fa29['model']=_[_0x7388('0x2c')](db[_0x7388('0x27')][_0x7388('0x28')]);_0x24fa29[_0x7388('0x2b')]=_[_0x7388('0x2c')](_0x1087f0[_0x7388('0x2b')]);_0x24fa29['filters']=_['intersection'](_0x24fa29[_0x7388('0x2a')],_0x24fa29[_0x7388('0x2b')]);_0x11e003[_0x7388('0x2f')]=_['intersection'](_0x24fa29['model'],qs[_0x7388('0x30')](_0x1087f0[_0x7388('0x2b')]['fields']));_0x11e003[_0x7388('0x2f')]=_0x11e003['attributes'][_0x7388('0x31')]?_0x11e003[_0x7388('0x2f')]:_0x24fa29[_0x7388('0x2a')];if(_0x1087f0[_0x7388('0x2b')][_0x7388('0x3c')]){_0x11e003['include']=[{'all':!![]}];}_0x11e003=_['merge']({},_0x11e003,_0x1087f0['options']);return db[_0x7388('0x27')][_0x7388('0x43')](_0x11e003)[_0x7388('0x3e')](handleEntityNotFound(_0x2a1148,null))[_0x7388('0x3e')](respondWithResult(_0x2a1148,null))[_0x7388('0x40')](handleError(_0x2a1148,null));};exports['create']=function(_0x48d694,_0x1b41ef){return db[_0x7388('0x27')][_0x7388('0x44')](_0x48d694['body'],{})[_0x7388('0x3e')](respondWithResult(_0x1b41ef,0xc9))[_0x7388('0x40')](handleError(_0x1b41ef,null));};exports['update']=function(_0x537f3a,_0x12ce0f){if(_0x537f3a[_0x7388('0x45')]['id']){delete _0x537f3a['body']['id'];}return db[_0x7388('0x27')][_0x7388('0x43')]({'where':{'id':_0x537f3a[_0x7388('0x42')]['id']}})[_0x7388('0x3e')](handleEntityNotFound(_0x12ce0f,null))[_0x7388('0x3e')](saveUpdates(_0x537f3a[_0x7388('0x45')],null))[_0x7388('0x3e')](respondWithResult(_0x12ce0f,null))[_0x7388('0x40')](handleError(_0x12ce0f,null));};exports[_0x7388('0x46')]=function(_0x3b86c0,_0x2eab90){return db[_0x7388('0x27')][_0x7388('0x43')]({'where':{'id':_0x3b86c0[_0x7388('0x42')]['id']}})[_0x7388('0x3e')](handleEntityNotFound(_0x2eab90,null))[_0x7388('0x3e')](removeEntity(_0x2eab90,null))[_0x7388('0x40')](handleError(_0x2eab90,null));};exports[_0x7388('0x47')]=function(_0x29c307,_0x3f7171){return db[_0x7388('0x27')][_0x7388('0x47')]()[_0x7388('0x3e')](respondWithResult(_0x3f7171,null))[_0x7388('0x40')](handleError(_0x3f7171,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 3eca36b..3250b0b 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 _0xcf0b=['ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','define'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xcf0b,0x6f));var _0xbcf0=function(_0x4a7b46,_0x5e916c){_0x4a7b46=_0x4a7b46-0x0;var _0x436bee=_0xcf0b[_0x4a7b46];return _0x436bee;};'use strict';var _=require('lodash');var util=require(_0xbcf0('0x0'));var logger=require(_0xbcf0('0x1'))(_0xbcf0('0x2'));var moment=require(_0xbcf0('0x3'));var BPromise=require(_0xbcf0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcf0('0x5'));var rimraf=require('rimraf');var config=require(_0xbcf0('0x6'));var attributes=require(_0xbcf0('0x7'));module['exports']=function(_0x1da870,_0x52bbe8){return _0x1da870[_0xbcf0('0x8')](_0xbcf0('0x9'),attributes,{'tableName':_0xbcf0('0xa'),'paranoid':![],'indexes':[{'name':_0xbcf0('0xb'),'fields':[_0xbcf0('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8833=['request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2accb3,_0x11f159){var _0x1380f2=function(_0x1abdbe){while(--_0x1abdbe){_0x2accb3['push'](_0x2accb3['shift']());}};_0x1380f2(++_0x11f159);}(_0x8833,0x15a));var _0x3883=function(_0x3ad3b3,_0x3592ff){_0x3ad3b3=_0x3ad3b3-0x0;var _0x58817b=_0x8833[_0x3ad3b3];return _0x58817b;};'use strict';var _=require(_0x3883('0x0'));var util=require(_0x3883('0x1'));var logger=require(_0x3883('0x2'))('api');var moment=require(_0x3883('0x3'));var BPromise=require(_0x3883('0x4'));var rp=require(_0x3883('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3883('0x6'));var config=require(_0x3883('0x7'));var attributes=require(_0x3883('0x8'));module[_0x3883('0x9')]=function(_0x1d3c6d,_0xd4d615){return _0x1d3c6d['define'](_0x3883('0xa'),attributes,{'tableName':_0x3883('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3883('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 25500e6..89b1f76 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 _0x77bf=['then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3a85ab,_0x1f3525){var _0x32d91a=function(_0x216ab1){while(--_0x216ab1){_0x3a85ab['push'](_0x3a85ab['shift']());}};_0x32d91a(++_0x1f3525);}(_0x77bf,0x19b));var _0xf77b=function(_0x2dbc6e,_0x29fd87){_0x2dbc6e=_0x2dbc6e-0x0;var _0x331650=_0x77bf[_0x2dbc6e];return _0x331650;};'use strict';var _=require(_0xf77b('0x0'));var util=require(_0xf77b('0x1'));var moment=require(_0xf77b('0x2'));var BPromise=require(_0xf77b('0x3'));var rs=require(_0xf77b('0x4'));var fs=require('fs');var Redis=require(_0xf77b('0x5'));var db=require(_0xf77b('0x6'))['db'];var utils=require(_0xf77b('0x7'));var logger=require('../../config/logger')(_0xf77b('0x8'));var config=require(_0xf77b('0x9'));var jayson=require(_0xf77b('0xa'));var client=jayson[_0xf77b('0xb')][_0xf77b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a77d9,_0x573516,_0x67976d){return new BPromise(function(_0x4b833d,_0x19fb60){return client[_0xf77b('0xd')](_0x5a77d9,_0x67976d)[_0xf77b('0xe')](function(_0x46fcb9){logger[_0xf77b('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x573516,_0xf77b('0x10'));logger[_0xf77b('0x11')](_0xf77b('0x12'),_0x573516,'request\x20sent',JSON[_0xf77b('0x13')](_0x46fcb9));if(_0x46fcb9[_0xf77b('0x14')]){if(_0x46fcb9['error'][_0xf77b('0x15')]===0x1f4){logger[_0xf77b('0x14')](_0xf77b('0x16'),_0x573516,_0x46fcb9[_0xf77b('0x14')][_0xf77b('0x17')]);return _0x19fb60(_0x46fcb9[_0xf77b('0x14')][_0xf77b('0x17')]);}logger[_0xf77b('0x14')](_0xf77b('0x16'),_0x573516,_0x46fcb9[_0xf77b('0x14')]['message']);return _0x4b833d(_0x46fcb9[_0xf77b('0x14')][_0xf77b('0x17')]);}else{logger[_0xf77b('0xf')](_0xf77b('0x16'),_0x573516,_0xf77b('0x10'));_0x4b833d(_0x46fcb9['result']['message']);}})[_0xf77b('0x18')](function(_0x4c0900){logger[_0xf77b('0x14')](_0xf77b('0x16'),_0x573516,_0x4c0900);_0x19fb60(_0x4c0900);});});}
\ No newline at end of file
+var _0x0243=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5f3ba6,_0x2be137){var _0x3cef72=function(_0x31aad6){while(--_0x31aad6){_0x5f3ba6['push'](_0x5f3ba6['shift']());}};_0x3cef72(++_0x2be137);}(_0x0243,0x144));var _0x3024=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0x0243[_0xa3c06b];return _0x33aa1d;};'use strict';var _=require(_0x3024('0x0'));var util=require(_0x3024('0x1'));var moment=require(_0x3024('0x2'));var BPromise=require(_0x3024('0x3'));var rs=require(_0x3024('0x4'));var fs=require('fs');var Redis=require(_0x3024('0x5'));var db=require(_0x3024('0x6'))['db'];var utils=require(_0x3024('0x7'));var logger=require(_0x3024('0x8'))(_0x3024('0x9'));var config=require(_0x3024('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3024('0xb')][_0x3024('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22c905,_0x24b8c2,_0x2f2952){return new BPromise(function(_0x563dbe,_0x11672d){return client[_0x3024('0xd')](_0x22c905,_0x2f2952)[_0x3024('0xe')](function(_0x355988){logger[_0x3024('0xf')](_0x3024('0x10'),_0x24b8c2,_0x3024('0x11'));logger['debug'](_0x3024('0x12'),_0x24b8c2,_0x3024('0x11'),JSON[_0x3024('0x13')](_0x355988));if(_0x355988[_0x3024('0x14')]){if(_0x355988['error'][_0x3024('0x15')]===0x1f4){logger[_0x3024('0x14')](_0x3024('0x10'),_0x24b8c2,_0x355988[_0x3024('0x14')][_0x3024('0x16')]);return _0x11672d(_0x355988[_0x3024('0x14')]['message']);}logger[_0x3024('0x14')](_0x3024('0x10'),_0x24b8c2,_0x355988['error']['message']);return _0x563dbe(_0x355988[_0x3024('0x14')][_0x3024('0x16')]);}else{logger[_0x3024('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x24b8c2,_0x3024('0x11'));_0x563dbe(_0x355988[_0x3024('0x17')][_0x3024('0x16')]);}})[_0x3024('0x18')](function(_0x174226){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x24b8c2,_0x174226);_0x11672d(_0x174226);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index de624c9..68dec13 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 _0x3ef2=['get','show','post','create','/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','./chatTransferReport.controller','isAuthenticated','index','/describe','describe'];(function(_0x20f1d7,_0x1dec28){var _0x205df5=function(_0x31ebda){while(--_0x31ebda){_0x20f1d7['push'](_0x20f1d7['shift']());}};_0x205df5(++_0x1dec28);}(_0x3ef2,0x170));var _0x23ef=function(_0x267a94,_0xed628d){_0x267a94=_0x267a94-0x0;var _0x2d4af1=_0x3ef2[_0x267a94];return _0x2d4af1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x23ef('0x0'));var timeout=require(_0x23ef('0x1'));var express=require(_0x23ef('0x2'));var router=express[_0x23ef('0x3')]();var fs_extra=require(_0x23ef('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x23ef('0x5'));router['get']('/',auth[_0x23ef('0x6')](),controller[_0x23ef('0x7')]);router['get'](_0x23ef('0x8'),auth[_0x23ef('0x6')](),controller[_0x23ef('0x9')]);router[_0x23ef('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x23ef('0xb')]);router[_0x23ef('0xc')]('/',auth['isAuthenticated'](),controller[_0x23ef('0xd')]);router['put'](_0x23ef('0xe'),auth[_0x23ef('0x6')](),controller[_0x23ef('0xf')]);router[_0x23ef('0x10')](_0x23ef('0xe'),auth[_0x23ef('0x6')](),controller['destroy']);module[_0x23ef('0x11')]=router;
\ No newline at end of file
+var _0x7a35=['index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0xb0726e,_0x349901){var _0x376fc5=function(_0x472ac1){while(--_0x472ac1){_0xb0726e['push'](_0xb0726e['shift']());}};_0x376fc5(++_0x349901);}(_0x7a35,0x1ea));var _0x57a3=function(_0x829616,_0x5d9318){_0x829616=_0x829616-0x0;var _0x35857a=_0x7a35[_0x829616];return _0x35857a;};'use strict';var multer=require(_0x57a3('0x0'));var util=require('util');var path=require(_0x57a3('0x1'));var timeout=require('connect-timeout');var express=require(_0x57a3('0x2'));var router=express[_0x57a3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x57a3('0x4'));var interaction=require(_0x57a3('0x5'));var config=require(_0x57a3('0x6'));var controller=require(_0x57a3('0x7'));router[_0x57a3('0x8')]('/',auth[_0x57a3('0x9')](),controller[_0x57a3('0xa')]);router[_0x57a3('0x8')](_0x57a3('0xb'),auth['isAuthenticated'](),controller[_0x57a3('0xc')]);router['get'](_0x57a3('0xd'),auth['isAuthenticated'](),controller[_0x57a3('0xe')]);router['post']('/',auth[_0x57a3('0x9')](),controller[_0x57a3('0xf')]);router[_0x57a3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x57a3('0x11')]);router[_0x57a3('0x12')](_0x57a3('0xd'),auth[_0x57a3('0x9')](),controller[_0x57a3('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 f14d3a0..7a110e2 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 _0x0e07=['INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','star','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A'];(function(_0x3b4eb0,_0x221801){var _0x21232e=function(_0x438ec9){while(--_0x438ec9){_0x3b4eb0['push'](_0x3b4eb0['shift']());}};_0x21232e(++_0x221801);}(_0x0e07,0x9b));var _0x70e0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0e07[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x70e0('0x0'));var rs=require(_0x70e0('0x1'));module[_0x70e0('0x2')]={'name':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x70e0('0x3')]},'mapKey':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x4')},'mapKeyOffline':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x4')},'key':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x5')},'customerAlias':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x70e0('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![],'defaultValue':_0x70e0('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x70e0('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x70e0('0x3')]},'animation':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x70e0('0x9')](_0x70e0('0xa'),_0x70e0('0xb')),'defaultValue':_0x70e0('0xa')},'header_online':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x70e0('0xd')},'offline_chat_button':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0xe')},'header_offline':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x13')},'noteTitle':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x70e0('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x70e0('0x16')},'closingMessageButton':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x17')},'ratingType':{'type':Sequelize['ENUM']('star',_0x70e0('0x18')),'defaultValue':_0x70e0('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x70e0('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x70e0('0x1a')],'defaultValue':function(){return JSON[_0x70e0('0x1b')]({'items':[{'type':_0x70e0('0x1c'),'variable':null,'config':{'placeholder':_0x70e0('0x1d'),'type':_0x70e0('0x1e'),'required':!![]},'props':{'title':_0x70e0('0x1d'),'helpText':''}},{'type':_0x70e0('0x1c'),'props':{'title':_0x70e0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x70e0('0x4'),'type':_0x70e0('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x70e0('0x1f')](_0x70e0('0x20'))?JSON[_0x70e0('0x21')](this[_0x70e0('0x1f')](_0x70e0('0x20'))):{};},'set':function(_0x429ae9){return this[_0x70e0('0x22')](_0x70e0('0x20'),JSON[_0x70e0('0x1b')](_0x429ae9));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x70e0('0x1b')]({'items':[{'type':_0x70e0('0x1c'),'props':{'title':_0x70e0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x70e0('0x4'),'type':'email'},'variable':null},{'type':_0x70e0('0x23'),'config':{'placeholder':'Comments'},'props':{'title':_0x70e0('0x24'),'helpText':_0x70e0('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x70e0('0x1f')](_0x70e0('0x26'))?JSON['parse'](this[_0x70e0('0x1f')](_0x70e0('0x26'))):{};},'set':function(_0x32151d){return this['setDataValue'](_0x70e0('0x26'),JSON['stringify'](_0x32151d));}},'token':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':function(){return rs[_0x70e0('0x27')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x70e0('0x3')]},'waitingTitle':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x28')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2b')},'sendUnmanaged':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x70e0('0x1a')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x70e0('0x3')]},'notificationTemplate':{'type':Sequelize[_0x70e0('0x1a')],'defaultValue':function(){return _0x70e0('0x2c');}},'notificationSound':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0x70e0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2e')},'verticalAlignment':{'type':Sequelize[_0x70e0('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x2f')},'messagesAlignment':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':_0x70e0('0x30')},'defaultTitle':{'type':Sequelize[_0x70e0('0x3')]},'customerAvatar':{'type':Sequelize[_0x70e0('0x1a')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x70e0('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x70e0('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x70e0('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![],'comment':_0x70e0('0x32'),'set':function(_0x36e91d){if(!_0x36e91d)this['setDataValue'](_0x70e0('0x33'),null);this[_0x70e0('0x22')]('mandatoryDisposition',_0x36e91d);}},'vidaooEscalation':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x70e0('0x3')]},'vidaooTopic':{'type':Sequelize[_0x70e0('0x3')],'allowNull':![],'defaultValue':_0x70e0('0x34')},'vidaooNote':{'type':Sequelize[_0x70e0('0x3')],'defaultValue':function(){return _0x70e0('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x70e0('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x70e0('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x70e0('0x1a')]}};
\ No newline at end of file
+var _0xb37d=['squared','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','stringify','name','text','parse','getDataValue','onlineForm','setDataValue','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','TEXT','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded'];(function(_0x29a4ad,_0x33c4bf){var _0x2ac926=function(_0x4c199b){while(--_0x4c199b){_0x29a4ad['push'](_0x29a4ad['shift']());}};_0x2ac926(++_0x33c4bf);}(_0xb37d,0x1b7));var _0xdb37=function(_0x4e06e7,_0x54bcbf){_0x4e06e7=_0x4e06e7-0x0;var _0x28d1dd=_0xb37d[_0x4e06e7];return _0x28d1dd;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdb37('0x0'));module[_0xdb37('0x1')]={'name':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![],'unique':_0xdb37('0x3')},'description':{'type':Sequelize[_0xdb37('0x2')]},'mapKey':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x4')},'mapKeyOffline':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x4')},'key':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x5')},'customerAlias':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![],'defaultValue':_0xdb37('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![],'defaultValue':_0xdb37('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdb37('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xdb37('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xdb37('0x9')](_0xdb37('0xa'),_0xdb37('0xb')),'defaultValue':_0xdb37('0xa')},'header_online':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0xd')},'header_offline':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0xe')},'download_transcript':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x13')},'noteTitle':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x14')},'placeholderMessage':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x15')},'closingMessage':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x17')},'conditionAgreement':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x18')},'ratingType':{'type':Sequelize[_0xdb37('0x9')]('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdb37('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xdb37('0x1a'),'type':_0xdb37('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xdb37('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0xdb37('0x1c')](this[_0xdb37('0x1d')](_0xdb37('0x1e'))):{};},'set':function(_0x2b54bd){return this[_0xdb37('0x1f')](_0xdb37('0x1e'),JSON[_0xdb37('0x19')](_0x2b54bd));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdb37('0x19')]({'items':[{'type':_0xdb37('0x20'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xdb37('0x4')},'variable':null},{'type':_0xdb37('0x21'),'config':{'placeholder':_0xdb37('0x22')},'props':{'title':_0xdb37('0x22'),'helpText':_0xdb37('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xdb37('0x1d')](_0xdb37('0x24'))?JSON[_0xdb37('0x1c')](this['getDataValue'](_0xdb37('0x24'))):{};},'set':function(_0x97c559){return this[_0xdb37('0x1f')](_0xdb37('0x24'),JSON[_0xdb37('0x19')](_0x97c559));}},'token':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':function(){return rs[_0xdb37('0x25')]();}},'autoclose':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdb37('0x2')]},'forwardOffline':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xdb37('0x2')]},'waitingTitle':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x26')},'waitingMessage':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x27')},'offlineMessageBody':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0x28')},'skipUnmanaged':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x17')},'sendUnmanaged':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xdb37('0x29')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xdb37('0x29')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x2b')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xdb37('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![],'defaultValue':_0xdb37('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xdb37('0x2')],'defaultValue':_0xdb37('0x2e')},'systemAvatar':{'type':Sequelize[_0xdb37('0x29')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdb37('0x8')],'comment':_0xdb37('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![],'comment':_0xdb37('0x30'),'set':function(_0x5c1ad7){if(!_0x5c1ad7)this[_0xdb37('0x1f')]('mandatoryDispositionPauseId',null);this[_0xdb37('0x1f')]('mandatoryDisposition',_0x5c1ad7);}},'vidaooEscalation':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xdb37('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xdb37('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xdb37('0x29')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xdb37('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xdb37('0x29')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index b8ac3c9..a4fab49 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 _0xf244=['iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','push','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','Transaction','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','get','ChatWebsites','destroy','end','sendStatus','stack','name','send','index','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','includeAll','rows','show','params','mandatoryDispositionPause','include','options','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','ChatWebsiteId','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','addCustomerAvatar','filename','getLogo','join','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','customerAvatar','showCustomerAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','browser','version','format','%s\x20%s','device','vendor','stringify','threadId','ChatInteraction','externalUrl','interaction','spread','contact','lastName','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','forcedOwnership','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0xf244,0x160));var _0x4f24=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf244[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require(_0x4f24('0x0'));var Mustache=require('mustache');var util=require(_0x4f24('0x1'));var path=require(_0x4f24('0x2'));var ejs=require(_0x4f24('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f24('0x4'));var querystring=require(_0x4f24('0x5'));var Redis=require(_0x4f24('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x4f24('0x7'))(_0x4f24('0x8'));var config=require(_0x4f24('0x9'));var db=require(_0x4f24('0xa'))['db'];config[_0x4f24('0xb')]=_[_0x4f24('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f24('0xb')]));require('./chatWebsite.socket')[_0x4f24('0xd')](socket);var jayson=require(_0x4f24('0xe'));var client=jayson[_0x4f24('0xf')][_0x4f24('0x10')]({'port':0x232c});var client9002=jayson[_0x4f24('0xf')]['http']({'port':0x232a});var client9003=jayson[_0x4f24('0xf')][_0x4f24('0x10')]({'port':0x232b});var client9001=jayson[_0x4f24('0xf')][_0x4f24('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x353e91,_0x228105,_0x3f7634,_0x7db0fa){return new BPromise(function(_0x38174f,_0x3d566a){var _0x1e14d2=_0x7db0fa||client;return _0x1e14d2[_0x4f24('0x11')](_0x353e91,_0x3f7634)[_0x4f24('0x12')](function(_0x316b85){logger[_0x4f24('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x228105,_0x4f24('0x14'));logger[_0x4f24('0x15')](_0x4f24('0x16'),_0x228105,_0x4f24('0x14'),JSON['stringify'](_0x316b85));if(_0x316b85[_0x4f24('0x17')]){if(_0x316b85[_0x4f24('0x17')][_0x4f24('0x18')]===0x1f4){logger[_0x4f24('0x17')](_0x4f24('0x19'),_0x228105,_0x316b85[_0x4f24('0x17')][_0x4f24('0x1a')]);return _0x3d566a(_0x316b85['error'][_0x4f24('0x1a')]);}logger['error'](_0x4f24('0x19'),_0x228105,_0x316b85[_0x4f24('0x17')][_0x4f24('0x1a')]);return _0x38174f(_0x316b85[_0x4f24('0x17')]['message']);}else{logger[_0x4f24('0x13')](_0x4f24('0x19'),_0x228105,_0x4f24('0x14'));_0x38174f(_0x316b85[_0x4f24('0x1b')][_0x4f24('0x1a')]);}})[_0x4f24('0x1c')](function(_0x5f02be){logger[_0x4f24('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x228105,_0x5f02be);_0x3d566a(_0x5f02be);});});}function respondWithStatusCode(_0x512e2a,_0x4817a8){_0x4817a8=_0x4817a8||0xcc;return function(_0x490b9c){if(_0x490b9c){return _0x512e2a['sendStatus'](_0x4817a8);}return _0x512e2a[_0x4f24('0x1d')](_0x4817a8)['end']();};}function respondWithResult(_0x5bd42c,_0x2d99cb){_0x2d99cb=_0x2d99cb||0xc8;return function(_0x4f8236){if(_0x4f8236){return _0x5bd42c[_0x4f24('0x1d')](_0x2d99cb)[_0x4f24('0x1e')](_0x4f8236);}};}function respondWithFilteredResult(_0x5a2be9,_0xd1cf6a){return function(_0xa28ae5){if(_0xa28ae5){var _0x849518=typeof _0xd1cf6a[_0x4f24('0x1f')]===_0x4f24('0x20')&&typeof _0xd1cf6a['limit']===_0x4f24('0x20');var _0x2a3d76=_0xa28ae5['count'];var _0x138c85=_0x849518?0x0:_0xd1cf6a[_0x4f24('0x1f')];var _0x3d761a=_0x849518?_0xa28ae5[_0x4f24('0x21')]:_0xd1cf6a[_0x4f24('0x1f')]+_0xd1cf6a[_0x4f24('0x22')];var _0x4fc7bf;if(_0x3d761a>=_0x2a3d76){_0x3d761a=_0x2a3d76;_0x4fc7bf=0xc8;}else{_0x4fc7bf=0xce;}_0x5a2be9['status'](_0x4fc7bf);return _0x5a2be9[_0x4f24('0x23')](_0x4f24('0x24'),_0x138c85+'-'+_0x3d761a+'/'+_0x2a3d76)[_0x4f24('0x1e')](_0xa28ae5);}return null;};}function saveUpdates(_0xe4cd25){return function(_0x3a052f){if(_0x3a052f){return _0x3a052f[_0x4f24('0x25')](_0xe4cd25)[_0x4f24('0x12')](function(_0x4113df){return _0x4113df;});}return null;};}function removeEntity(_0x53d2ca){return function(_0x25867b){if(_0x25867b){return _0x25867b['destroy']()[_0x4f24('0x12')](function(){var _0x490409=_0x25867b[_0x4f24('0x26')]({'plain':!![]});var _0x41b8e2=_0x4f24('0x27');return db['UserProfileResource'][_0x4f24('0x28')]({'where':{'type':_0x41b8e2,'resourceId':_0x490409['id']}})[_0x4f24('0x12')](function(){return _0x25867b;});})['then'](function(){_0x53d2ca['status'](0xcc)[_0x4f24('0x29')]();});}};}function handleEntityNotFound(_0x4da862){return function(_0x585ee0){if(!_0x585ee0){_0x4da862[_0x4f24('0x2a')](0x194);}return _0x585ee0;};}function handleError(_0x21f14b,_0x4a7353){_0x4a7353=_0x4a7353||0x1f4;return function(_0x863b04){logger[_0x4f24('0x17')](_0x863b04[_0x4f24('0x2b')]);if(_0x863b04[_0x4f24('0x2c')]){delete _0x863b04['name'];}_0x21f14b[_0x4f24('0x1d')](_0x4a7353)[_0x4f24('0x2d')](_0x863b04);};}exports[_0x4f24('0x2e')]=function(_0x3dd529,_0xe93c54){var _0x2af53e={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x569745={},_0x3b1e61={'count':0x0,'rows':[]};var _0x5ca672=_[_0x4f24('0x2f')](db[_0x4f24('0x30')][_0x4f24('0x31')],function(_0x977100){return{'name':_0x977100['fieldName'],'type':_0x977100[_0x4f24('0x32')][_0x4f24('0x33')]};});_0x569745[_0x4f24('0x34')]=_[_0x4f24('0x2f')](_0x5ca672,_0x4f24('0x2c'));_0x569745[_0x4f24('0x35')]=_[_0x4f24('0x36')](_0x3dd529[_0x4f24('0x35')]);_0x569745[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0x569745[_0x4f24('0x34')],_0x569745[_0x4f24('0x35')]);_0x2af53e[_0x4f24('0x39')]=_[_0x4f24('0x38')](_0x569745[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x3dd529[_0x4f24('0x35')]['fields']));_0x2af53e['attributes']=_0x2af53e[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x2af53e['attributes']:_0x569745[_0x4f24('0x34')];if(!_0x3dd529[_0x4f24('0x35')][_0x4f24('0x3c')](_0x4f24('0x3d'))){_0x2af53e[_0x4f24('0x22')]=qs['limit'](_0x3dd529['query'][_0x4f24('0x22')]);_0x2af53e['offset']=qs['offset'](_0x3dd529[_0x4f24('0x35')][_0x4f24('0x1f')]);}_0x2af53e[_0x4f24('0x3e')]=qs['sort'](_0x3dd529[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x2af53e['where']=qs[_0x4f24('0x37')](_[_0x4f24('0x40')](_0x3dd529[_0x4f24('0x35')],_0x569745[_0x4f24('0x37')]),_0x5ca672);if(_0x3dd529[_0x4f24('0x35')][_0x4f24('0x41')]){_0x2af53e['where']=_[_0x4f24('0x42')](_0x2af53e['where'],{'$or':_[_0x4f24('0x2f')](_0x5ca672,function(_0x1a74a5){if(_0x1a74a5[_0x4f24('0x32')]!==_0x4f24('0x43')){var _0x4838dd={};_0x4838dd[_0x1a74a5[_0x4f24('0x2c')]]={'$like':'%'+_0x3dd529[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x4838dd;}})});}_0x2af53e=_[_0x4f24('0x42')]({},_0x2af53e,_0x3dd529['options']);var _0x1d0bea={'where':_0x2af53e[_0x4f24('0x44')]};return db[_0x4f24('0x30')]['count'](_0x1d0bea)[_0x4f24('0x12')](function(_0x36ecae){_0x3b1e61['count']=_0x36ecae;if(_0x3dd529[_0x4f24('0x35')][_0x4f24('0x45')]){_0x2af53e['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x2af53e);})['then'](function(_0x3086de){_0x3b1e61[_0x4f24('0x46')]=_0x3086de;return _0x3b1e61;})[_0x4f24('0x12')](respondWithFilteredResult(_0xe93c54,_0x2af53e))[_0x4f24('0x1c')](handleError(_0xe93c54,null));};exports[_0x4f24('0x47')]=function(_0x268821,_0x573d48){var _0x1cb788={'raw':![],'where':{'id':_0x268821[_0x4f24('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0x4f24('0x49')}]},_0x49a9a8={};_0x49a9a8[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0x30')][_0x4f24('0x31')]);_0x49a9a8[_0x4f24('0x35')]=_['keys'](_0x268821[_0x4f24('0x35')]);_0x49a9a8[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0x49a9a8[_0x4f24('0x34')],_0x49a9a8[_0x4f24('0x35')]);_0x1cb788['attributes']=_[_0x4f24('0x38')](_0x49a9a8[_0x4f24('0x34')],qs['fields'](_0x268821[_0x4f24('0x35')][_0x4f24('0x3a')]));_0x1cb788[_0x4f24('0x39')]=_0x1cb788[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x1cb788[_0x4f24('0x39')]:_0x49a9a8[_0x4f24('0x34')];if(_0x268821[_0x4f24('0x35')][_0x4f24('0x45')]){_0x1cb788[_0x4f24('0x4a')]=[{'all':!![]}];}_0x1cb788=_[_0x4f24('0x42')]({},_0x1cb788,_0x268821[_0x4f24('0x4b')]);return db[_0x4f24('0x30')][_0x4f24('0x4c')](_0x1cb788)[_0x4f24('0x12')](handleEntityNotFound(_0x573d48,null))[_0x4f24('0x12')](respondWithResult(_0x573d48,null))[_0x4f24('0x1c')](handleError(_0x573d48,null));};exports['create']=function(_0x175326,_0x19e835){return db[_0x4f24('0x30')]['create'](_0x175326[_0x4f24('0x4d')],{})[_0x4f24('0x12')](function(_0x70bf39){var _0x23c02a=_0x175326[_0x4f24('0x4e')][_0x4f24('0x26')]({'plain':!![]});if(!_0x23c02a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23c02a[_0x4f24('0x4f')]===_0x4f24('0x4e')){var _0x500b0a=_0x70bf39['get']({'plain':!![]});var _0x3f5a99=_0x4f24('0x27');return db[_0x4f24('0x50')]['find']({'where':{'name':_0x3f5a99,'userProfileId':_0x23c02a[_0x4f24('0x51')]},'raw':!![]})[_0x4f24('0x12')](function(_0x12abac){if(_0x12abac&&_0x12abac[_0x4f24('0x52')]===0x0){return db[_0x4f24('0x53')][_0x4f24('0x54')]({'name':_0x500b0a[_0x4f24('0x2c')],'resourceId':_0x500b0a['id'],'type':_0x12abac['name'],'sectionId':_0x12abac['id']},{})[_0x4f24('0x12')](function(){return _0x70bf39;});}else{return _0x70bf39;}})[_0x4f24('0x1c')](function(_0x4b27a4){logger[_0x4f24('0x17')](_0x4f24('0x55'),_0x4b27a4);throw _0x4b27a4;});}return _0x70bf39;})[_0x4f24('0x12')](respondWithResult(_0x19e835,0xc9))[_0x4f24('0x1c')](handleError(_0x19e835,null));};exports[_0x4f24('0x25')]=function(_0x621776,_0x158266){if(_0x621776['body']['id']){delete _0x621776['body']['id'];}return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x621776['params']['id']},'include':[{'model':db[_0x4f24('0x56')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x158266,null))['then'](saveUpdates(_0x621776[_0x4f24('0x4d')],null))[_0x4f24('0x12')](respondWithResult(_0x158266,null))[_0x4f24('0x1c')](handleError(_0x158266,null));};exports['destroy']=function(_0x580d0c,_0x3d1638){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x580d0c[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x3d1638,null))[_0x4f24('0x12')](removeEntity(_0x3d1638,null))[_0x4f24('0x1c')](handleError(_0x3d1638,null));};exports['describe']=function(_0x5cd8c3,_0x5a155d){return db[_0x4f24('0x30')][_0x4f24('0x57')]()[_0x4f24('0x12')](respondWithResult(_0x5a155d,null))[_0x4f24('0x1c')](handleError(_0x5a155d,null));};exports[_0x4f24('0x58')]=function(_0x2b7c7d,_0x2cb300){if(_0x2b7c7d[_0x4f24('0x4d')]['id']){delete _0x2b7c7d[_0x4f24('0x4d')]['id'];}return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x2b7c7d['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x2cb300,null))[_0x4f24('0x12')](function(_0x9ab93c){if(_0x9ab93c){_0x2b7c7d[_0x4f24('0x4d')]['ChatWebsiteId']=_0x9ab93c['id'];return db[_0x4f24('0x59')][_0x4f24('0x54')](_0x2b7c7d[_0x4f24('0x4d')]);}})[_0x4f24('0x12')](respondWithResult(_0x2cb300,null))['catch'](handleError(_0x2cb300,null));};exports[_0x4f24('0x5a')]=function(_0x10f91c,_0x3894a4){var _0x393101={'raw':![],'where':{}};var _0xef4a23={};var _0x45d274={'count':0x0,'rows':[]};return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x10f91c[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x3894a4,null))[_0x4f24('0x12')](function(_0x2ab115){if(_0x2ab115){_0xef4a23[_0x4f24('0x34')]=_['keys'](db['Disposition'][_0x4f24('0x31')]);_0xef4a23[_0x4f24('0x35')]=_['keys'](_0x10f91c['query']);_0xef4a23[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0xef4a23[_0x4f24('0x34')],_0xef4a23[_0x4f24('0x35')]);_0x393101[_0x4f24('0x39')]=_[_0x4f24('0x38')](_0xef4a23[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x10f91c[_0x4f24('0x35')][_0x4f24('0x3a')]));_0x393101[_0x4f24('0x39')]=_0x393101[_0x4f24('0x39')]['length']?_0x393101['attributes']:_0xef4a23[_0x4f24('0x34')];if(!_0x10f91c[_0x4f24('0x35')][_0x4f24('0x3c')](_0x4f24('0x3d'))){_0x393101['limit']=qs[_0x4f24('0x22')](_0x10f91c[_0x4f24('0x35')][_0x4f24('0x22')]);_0x393101[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x10f91c['query']['offset']);}_0x393101['order']=qs[_0x4f24('0x3f')](_0x10f91c[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x393101[_0x4f24('0x44')]=qs[_0x4f24('0x37')](_[_0x4f24('0x40')](_0x10f91c['query'],_0xef4a23[_0x4f24('0x37')]));_0x393101[_0x4f24('0x44')]['ChatWebsiteId']=_0x2ab115['id'];if(_0x10f91c['query'][_0x4f24('0x41')]){_0x393101[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x393101[_0x4f24('0x44')],{'$or':_[_0x4f24('0x2f')](_0x393101[_0x4f24('0x39')],function(_0x1a2c47){var _0x4a2033={};_0x4a2033[_0x1a2c47]={'$like':'%'+_0x10f91c[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x4a2033;})});}_0x393101=_['merge']({},_0x393101,_0x10f91c['options']);return db[_0x4f24('0x59')]['count']({'where':_0x393101[_0x4f24('0x44')]})[_0x4f24('0x12')](function(_0x41b9c4){_0x45d274['count']=_0x41b9c4;if(_0x10f91c[_0x4f24('0x35')][_0x4f24('0x45')]){_0x393101[_0x4f24('0x4a')]=[{'all':!![]}];}return db['Disposition'][_0x4f24('0x5c')](_0x393101);})['then'](function(_0x6c4672){_0x45d274[_0x4f24('0x46')]=_0x6c4672;return _0x45d274;});}})[_0x4f24('0x12')](respondWithFilteredResult(_0x3894a4,_0x393101))[_0x4f24('0x1c')](handleError(_0x3894a4,null));};exports[_0x4f24('0x5d')]=function(_0x1fe626,_0x394194){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x1fe626[_0x4f24('0x48')]['id']}})['then'](handleEntityNotFound(_0x394194,null))[_0x4f24('0x12')](function(_0x1ea8f1){if(_0x1ea8f1){return _0x1ea8f1['removeDispositions'](_0x1fe626[_0x4f24('0x35')][_0x4f24('0x5e')]);}})[_0x4f24('0x12')](respondWithStatusCode(_0x394194,null))['catch'](handleError(_0x394194,null));};exports[_0x4f24('0x5f')]=function(_0x5655b7,_0x5dac84){if(_0x5655b7[_0x4f24('0x4d')]['id']){delete _0x5655b7['body']['id'];}return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x5655b7[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x5dac84,null))[_0x4f24('0x12')](function(_0x40ba5e){if(_0x40ba5e){_0x5655b7[_0x4f24('0x4d')]['ChatWebsiteId']=_0x40ba5e['id'];return db[_0x4f24('0x60')]['create'](_0x5655b7[_0x4f24('0x4d')]);}})['then'](respondWithResult(_0x5dac84,null))[_0x4f24('0x1c')](handleError(_0x5dac84,null));};exports['getAnswers']=function(_0x53f299,_0x2d592e){var _0x3ff640={'raw':![],'where':{}};var _0x8b48c8={};var _0x320a00={'count':0x0,'rows':[]};return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x53f299[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x2d592e,null))[_0x4f24('0x12')](function(_0x19b04c){if(_0x19b04c){_0x8b48c8[_0x4f24('0x34')]=_['keys'](db['CannedAnswer'][_0x4f24('0x31')]);_0x8b48c8[_0x4f24('0x35')]=_['keys'](_0x53f299[_0x4f24('0x35')]);_0x8b48c8['filters']=_[_0x4f24('0x38')](_0x8b48c8[_0x4f24('0x34')],_0x8b48c8[_0x4f24('0x35')]);_0x3ff640[_0x4f24('0x39')]=_[_0x4f24('0x38')](_0x8b48c8[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x53f299['query'][_0x4f24('0x3a')]));_0x3ff640['attributes']=_0x3ff640[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x3ff640['attributes']:_0x8b48c8['model'];if(!_0x53f299[_0x4f24('0x35')]['hasOwnProperty'](_0x4f24('0x3d'))){_0x3ff640[_0x4f24('0x22')]=qs['limit'](_0x53f299[_0x4f24('0x35')][_0x4f24('0x22')]);_0x3ff640[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x53f299[_0x4f24('0x35')][_0x4f24('0x1f')]);}_0x3ff640['order']=qs['sort'](_0x53f299[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x3ff640['where']=qs[_0x4f24('0x37')](_[_0x4f24('0x40')](_0x53f299[_0x4f24('0x35')],_0x8b48c8[_0x4f24('0x37')]));_0x3ff640['where'][_0x4f24('0x61')]=_0x19b04c['id'];if(_0x53f299[_0x4f24('0x35')][_0x4f24('0x41')]){_0x3ff640[_0x4f24('0x44')]=_['merge'](_0x3ff640['where'],{'$or':_[_0x4f24('0x2f')](_0x3ff640[_0x4f24('0x39')],function(_0x39511c){var _0x4e7df7={};_0x4e7df7[_0x39511c]={'$like':'%'+_0x53f299['query'][_0x4f24('0x41')]+'%'};return _0x4e7df7;})});}_0x3ff640=_['merge']({},_0x3ff640,_0x53f299[_0x4f24('0x4b')]);return db[_0x4f24('0x60')][_0x4f24('0x21')]({'where':_0x3ff640[_0x4f24('0x44')]})['then'](function(_0x33723c){_0x320a00[_0x4f24('0x21')]=_0x33723c;if(_0x53f299[_0x4f24('0x35')]['includeAll']){_0x3ff640[_0x4f24('0x4a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4f24('0x5c')](_0x3ff640);})[_0x4f24('0x12')](function(_0x299ee3){_0x320a00[_0x4f24('0x46')]=_0x299ee3;return _0x320a00;});}})[_0x4f24('0x12')](respondWithFilteredResult(_0x2d592e,_0x3ff640))[_0x4f24('0x1c')](handleError(_0x2d592e,null));};exports[_0x4f24('0x62')]=function(_0x36a103,_0x29651b){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x36a103[_0x4f24('0x48')]['id']}})['then'](handleEntityNotFound(_0x29651b,null))[_0x4f24('0x12')](function(_0x484d88){if(_0x484d88){return _0x484d88[_0x4f24('0x62')](_0x36a103[_0x4f24('0x35')][_0x4f24('0x5e')]);}})['then'](respondWithStatusCode(_0x29651b,null))[_0x4f24('0x1c')](handleError(_0x29651b,null));};exports[_0x4f24('0x63')]=function(_0x464ddd,_0x2d69d0){_0x464ddd[_0x4f24('0x4d')][_0x4f24('0x64')]=_0x464ddd[_0x4f24('0x65')]['filename'];return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x464ddd[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x2d69d0,null))['then'](saveUpdates(_0x464ddd[_0x4f24('0x4d')],null))[_0x4f24('0x12')](respondWithResult(_0x2d69d0,null))[_0x4f24('0x1c')](handleError(_0x2d69d0,null));};exports[_0x4f24('0x66')]=function(_0x2da11e,_0x26aecc){_0x2da11e['body'][_0x4f24('0x67')]=_0x2da11e[_0x4f24('0x65')]['filename'];return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x2da11e[_0x4f24('0x48')]['id']}})['then'](handleEntityNotFound(_0x26aecc,null))['then'](saveUpdates(_0x2da11e[_0x4f24('0x4d')],null))['then'](respondWithResult(_0x26aecc,null))['catch'](handleError(_0x26aecc,null));};exports[_0x4f24('0x68')]=function(_0x1c4218,_0xaf485a){_0x1c4218[_0x4f24('0x4d')]['customerAvatar']=_0x1c4218[_0x4f24('0x65')][_0x4f24('0x69')];return db['ChatWebsite'][_0x4f24('0x4c')]({'where':{'id':_0x1c4218[_0x4f24('0x48')]['id']}})['then'](handleEntityNotFound(_0xaf485a,null))['then'](saveUpdates(_0x1c4218[_0x4f24('0x4d')],null))['then'](respondWithResult(_0xaf485a,null))[_0x4f24('0x1c')](handleError(_0xaf485a,null));};exports['addSystemAvatar']=function(_0xf0df00,_0x4a6dad){_0xf0df00[_0x4f24('0x4d')]['systemAvatar']=_0xf0df00[_0x4f24('0x65')][_0x4f24('0x69')];return db['ChatWebsite'][_0x4f24('0x4c')]({'where':{'id':_0xf0df00[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x4a6dad,null))[_0x4f24('0x12')](saveUpdates(_0xf0df00['body'],null))[_0x4f24('0x12')](respondWithResult(_0x4a6dad,null))[_0x4f24('0x1c')](handleError(_0x4a6dad,null));};exports[_0x4f24('0x6a')]=function(_0x3e4b6f,_0x4ab395){var _0x14cbec=path[_0x4f24('0x6b')](config['root'],'server/files/images/logos/default_logo.svg');var _0xd98f6a={'where':{'id':_0x3e4b6f[_0x4f24('0x48')]['id']},'attributes':['id',_0x4f24('0x64')],'raw':!![]};var _0x5d3810=![];return require('../../config/license/util')[_0x4f24('0x6c')]()[_0x4f24('0x12')](function(_0x5d49d0){if(_0x5d49d0){_0x5d3810=_0x5d49d0[_0x4f24('0x6d')];}})[_0x4f24('0x12')](function(){return db['ChatWebsite'][_0x4f24('0x4c')](_0xd98f6a);})['then'](handleEntityNotFound(_0x4ab395,null))[_0x4f24('0x12')](function(_0x148171){if(_0x148171){if(!_[_0x4f24('0x6e')](_0x148171[_0x4f24('0x64')])){if(fs[_0x4f24('0x6f')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x71'),_0x148171['sitepic']))&&_0x5d3810){_0x14cbec=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x71'),_0x148171[_0x4f24('0x64')]);}}return _0x4ab395['download'](_0x14cbec);}})[_0x4f24('0x1c')](handleError(_0x4ab395,null));};exports[_0x4f24('0x72')]=function(_0x32c537,_0x19d0d1){var _0x48fa76=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x73'));var _0x5253fe={'where':{'id':_0x32c537['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x4f24('0x30')][_0x4f24('0x4c')](_0x5253fe)['then'](handleEntityNotFound(_0x19d0d1,null))['then'](function(_0x1cc835){if(_0x1cc835){if(!_[_0x4f24('0x6e')](_0x1cc835[_0x4f24('0x67')])){if(fs[_0x4f24('0x6f')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x74'),_0x1cc835[_0x4f24('0x67')]))){_0x48fa76=path['join'](config[_0x4f24('0x70')],_0x4f24('0x74'),_0x1cc835[_0x4f24('0x67')]);}}return _0x19d0d1[_0x4f24('0x75')](_0x48fa76);}})['catch'](handleError(_0x19d0d1,null));};exports[_0x4f24('0x76')]=function(_0x42c21a,_0x49f9db){var _0x53e591=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],'server/files/images/avatars/customer_avatar.png');var _0x330b5b={'where':{'id':_0x42c21a[_0x4f24('0x48')]['id']},'attributes':['id',_0x4f24('0x77'),_0x4f24('0x78')],'raw':!![]};return db[_0x4f24('0x30')][_0x4f24('0x4c')](_0x330b5b)[_0x4f24('0x12')](handleEntityNotFound(_0x49f9db,null))[_0x4f24('0x12')](function(_0x5688e3){if(_0x5688e3){if(!_[_0x4f24('0x6e')](_0x5688e3['customerAvatar'])){if(fs[_0x4f24('0x6f')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],'server/files/images/avatars/',_0x5688e3['customerAvatar']))&&_0x5688e3[_0x4f24('0x78')]){_0x53e591=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x74'),_0x5688e3[_0x4f24('0x77')]);}}return _0x49f9db['download'](_0x53e591);}})['catch'](handleError(_0x49f9db,null));};exports['getSystemAvatar']=function(_0x519edd,_0x59305c){var _0x23e957=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],'server/files/images/avatars/system_avatar.png');var _0x456484={'where':{'id':_0x519edd[_0x4f24('0x48')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x4f24('0x30')]['find'](_0x456484)[_0x4f24('0x12')](handleEntityNotFound(_0x59305c,null))[_0x4f24('0x12')](function(_0x5b47b5){if(_0x5b47b5){if(!_['isNil'](_0x5b47b5[_0x4f24('0x79')])){if(fs[_0x4f24('0x6f')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0x74'),_0x5b47b5['systemAvatar']))){_0x23e957=path[_0x4f24('0x6b')](config['root'],_0x4f24('0x74'),_0x5b47b5[_0x4f24('0x79')]);}}return _0x59305c[_0x4f24('0x75')](_0x23e957);}})['catch'](handleError(_0x59305c,null));};exports[_0x4f24('0x7a')]=function(_0x4d308f,_0x28573d){var _0x3bce6c=require(_0x4f24('0x7b'));var _0x24de6a=new _0x3bce6c();var _0x549f46=_0x24de6a[_0x4f24('0x7c')](_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x7e')])['getResult']();var _0x4ece0e={'body':_0x4d308f[_0x4f24('0x4d')],'channel':_0x4f24('0x7f')};var _0x13b251=[];var _0x4f487a=[];var _0x1e5bb4={};var _0x5ef174=![];return db[_0x4f24('0x80')]['describe']()[_0x4f24('0x12')](function(_0x350536){if(!_0x350536){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x83'));}_0x13b251=_['difference'](_[_0x4f24('0x36')](_0x350536),[_0x4f24('0x84'),_0x4f24('0x85')]);_0x4f487a=_[_0x4f24('0x86')](_[_0x4f24('0x36')](_0x350536),[_0x4f24('0x84'),_0x4f24('0x85'),_0x4f24('0x87'),_0x4f24('0x88')]);if(_0x4d308f[_0x4f24('0x4d')]['id']){delete _0x4d308f['body']['id'];}if(_[_0x4f24('0x6e')](_0x4d308f[_0x4f24('0x4d')]['from'])){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x89'));}if(_[_0x4f24('0x6e')](_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x4d')])||_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x4d')]===''){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4f24('0x6e')](_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8a')])){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x8b')+_0x4f487a);}if(!_[_0x4f24('0x8c')](_0x4f487a,_0x4d308f['body'][_0x4f24('0x8a')])){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x8d')+_0x4f487a);}_0x1e5bb4[_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8a')]]=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8e')];})[_0x4f24('0x12')](function(){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x4d308f[_0x4f24('0x48')]['id']},'include':[{'model':db[_0x4f24('0x8f')],'as':_0x4f24('0x90'),'include':[{'model':db[_0x4f24('0x80')],'as':_0x4f24('0x91'),'where':_0x1e5bb4,'limit':0x1,'order':[['updatedAt',_0x4f24('0x92')]]}]},{'model':db[_0x4f24('0x93')],'as':_0x4f24('0x94')}]});})[_0x4f24('0x12')](handleEntityNotFound(_0x28573d,null))[_0x4f24('0x12')](function(_0x25dbe8){if(_0x25dbe8&&_0x25dbe8[_0x4f24('0x90')]){_0x4ece0e[_0x4f24('0x95')]=_0x25dbe8;_0x4ece0e[_0x4f24('0x96')]=_0x25dbe8[_0x4f24('0x94')];_0x4ece0e[_0x4f24('0x97')]=_0x25dbe8['List'];_0x4ece0e[_0x4f24('0x96')]=_['orderBy'](_0x4ece0e[_0x4f24('0x96')],[_0x4f24('0x98')],[_0x4f24('0x99')]);if(_0x4ece0e[_0x4f24('0x95')][_0x4f24('0x94')]){delete _0x4ece0e['account'][_0x4f24('0x94')];}if(_0x4ece0e['account'][_0x4f24('0x90')]&&_0x4ece0e[_0x4f24('0x95')]['List'][_0x4f24('0x91')]['length']){return _0x4ece0e[_0x4f24('0x95')][_0x4f24('0x90')][_0x4f24('0x91')][0x0];}var _0x4c5802=_[_0x4f24('0xc')](_0x4d308f[_0x4f24('0x4d')],{'firstName':_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8e')],'ListId':_0x25dbe8[_0x4f24('0x88')]});_0x4c5802[_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x8a')]]=_0x4d308f['body']['from'];return db[_0x4f24('0x80')][_0x4f24('0x54')](_0x4c5802,{'fields':_0x13b251,'raw':!![]});}})[_0x4f24('0x12')](handleEntityNotFound(_0x28573d,null))[_0x4f24('0x12')](function(_0x710b03){_0x4ece0e['contact']=_0x710b03;var _0x29ea86=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0x9a')];if(_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x9b')]){_0x29ea86=_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x9b')];}else if(_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x9c')]){_0x29ea86=_[_0x4f24('0x9d')](_0x4d308f[_0x4f24('0x7d')][_0x4f24('0x9c')][_0x4f24('0x9e')](','));}if(_0x710b03){var _0x20dac3={'ContactId':_0x710b03['id'],'ChatWebsiteId':_0x4d308f['params']['id'],'from':(_0x710b03[_0x4f24('0x9f')]||'')+'\x20'+(_0x710b03['lastName']||''),'customerIp':_0x29ea86,'customerPort':_0x4d308f[_0x4f24('0x7d')][_0x4f24('0xa0')]?_0x4d308f[_0x4f24('0x7d')][_0x4f24('0xa0')]:null,'referer':_0x4d308f['body']['referer'],'browserName':_0x549f46[_0x4f24('0xa1')]['name']&&_0x549f46['browser'][_0x4f24('0xa2')]?util[_0x4f24('0xa3')](_0x4f24('0xa4'),_0x549f46[_0x4f24('0xa1')]['name'],_0x549f46['browser']['version']):'unknown','browserVersion':_0x549f46[_0x4f24('0xa1')][_0x4f24('0xa2')]||'unknown','osName':util[_0x4f24('0xa3')](_0x4f24('0xa4'),_0x549f46['os'][_0x4f24('0x2c')],_0x549f46['os']['version']),'osVersion':_0x549f46['os']['version'],'deviceModel':_0x549f46['device'][_0x4f24('0x34')]&&_0x549f46[_0x4f24('0xa5')]['vendor']?util['format']('%s\x20%s\x20%s',_0x549f46['device']['model'],_0x549f46[_0x4f24('0xa5')][_0x4f24('0xa6')],_0x549f46[_0x4f24('0xa5')][_0x4f24('0x32')]):null,'deviceVendor':_0x549f46[_0x4f24('0xa5')][_0x4f24('0xa6')],'deviceType':_0x549f46[_0x4f24('0xa5')][_0x4f24('0x32')],'formData':JSON[_0x4f24('0xa7')](_0x4d308f[_0x4f24('0x4d')])};var _0x19fdb2={'ChatWebsiteId':_0x4d308f[_0x4f24('0x48')]['id'],'closed':![]};if(_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xa8')]){_0x19fdb2[_0x4f24('0xa8')]=_0x4d308f['body'][_0x4f24('0xa8')];return db[_0x4f24('0xa9')][_0x4f24('0x4c')]({'where':_0x19fdb2})[_0x4f24('0x12')](function(_0x54bc51){if(_0x54bc51){return[_0x54bc51,![]];}_0x20dac3['threadId']=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xa8')];_0x20dac3['externalUrl']=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xaa')];return db[_0x4f24('0xa9')]['create'](_0x20dac3)[_0x4f24('0x12')](function(_0x466bd3){return[_0x466bd3,!![]];});});}_0x19fdb2['ContactId']=_0x710b03['id'];if(_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xab')]&&_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xab')]['id']){_0x19fdb2['id']=_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xab')]['id'];return db['ChatInteraction'][_0x4f24('0x4c')]({'where':_0x19fdb2})[_0x4f24('0x12')](function(_0x56be77){if(_0x56be77){return[_0x56be77,![]];}return db[_0x4f24('0xa9')]['create'](_0x20dac3)[_0x4f24('0x12')](function(_0x5c0efd){return[_0x5c0efd,!![]];});});}return db[_0x4f24('0xa9')][_0x4f24('0x54')](_0x20dac3)[_0x4f24('0x12')](function(_0x13cb29){return[_0x13cb29,!![]];});}})[_0x4f24('0xac')](function(_0x1c3e2f,_0x2adc38){if(_0x1c3e2f){_0x5ef174=_0x2adc38;if(!_0x2adc38){var _0x372ee7={'from':(_0x4ece0e['contact']['firstName']||'')+'\x20'+(_0x4ece0e[_0x4f24('0xad')][_0x4f24('0xae')]||'')};if(_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xa8')]&&_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xaf')]&&_0x4d308f[_0x4f24('0x4d')][_0x4f24('0xa8')]!=_0x4d308f[_0x4f24('0x4d')]['messageId']){_0x372ee7[_0x4f24('0xa8')]=_0x4d308f['body'][_0x4f24('0xaf')];}return _0x1c3e2f[_0x4f24('0x25')](_0x372ee7);}else{return _0x1c3e2f;}}})[_0x4f24('0x12')](function(_0x3582fb){_0x4ece0e[_0x4f24('0xab')]=_0x3582fb[_0x4f24('0x26')]({'plain':!![]});_0x4ece0e[_0x4f24('0xab')][_0x4f24('0xb0')]=_0x5ef174;if(_0x4ece0e['interaction'][_0x4f24('0xb0')]){if(_0x4ece0e[_0x4f24('0x95')][_0x4f24('0xb1')]){_0x4ece0e['applications']['push']({'id':0x0,'priority':_0x4ece0e[_0x4f24('0x96')][_0x4f24('0x3b')]+0x1,'app':'close','appdata':_0x4f24('0xb2'),'interval':_0x4f24('0xb3')});}}return db[_0x4f24('0xb4')][_0x4f24('0x54')]({'body':_0x4d308f['body']['body'],'ChatWebsiteId':_0x4d308f[_0x4f24('0x48')]['id'],'ChatInteractionId':_0x3582fb['id'],'direction':'in','ContactId':_0x4ece0e[_0x4f24('0xad')]['id'],'AttachmentId':_0x4d308f[_0x4f24('0x4d')]['AttachmentId']});})['then'](function(_0x4024d6){_0x4ece0e['message']=_0x4024d6;if(_0x4ece0e[_0x4f24('0xab')][_0x4f24('0xb5')]){return db['User']['find']({'attributes':['id',_0x4f24('0x2c')],'where':{'id':_0x4ece0e[_0x4f24('0xab')]['UserId']}})[_0x4f24('0x12')](function(_0x40f489){if(_0x40f489){_0x4ece0e[_0x4f24('0x96')][_0x4f24('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x40f489[_0x4f24('0x2c')]+','+(_0x4ece0e[_0x4f24('0x95')]['waitForTheAssignedAgent']||0xa),'interval':_0x4f24('0xb3')});_0x4ece0e[_0x4f24('0xb7')]=!![];}return respondWithRpcPromise(_0x4f24('0xb8'),'startRouting',_0x4ece0e);});}return respondWithRpcPromise('Start',_0x4f24('0xb9'),_0x4ece0e);})[_0x4f24('0x12')](function(_0x3cae4a){respondWithRpcPromise(_0x4f24('0xba'),_0x4f24('0xba'),{'event':_0x4f24('0x7a'),'message':_0x3cae4a},client9002);return _0x3cae4a;})[_0x4f24('0x12')](respondWithResult(_0x28573d,null))['catch'](handleError(_0x28573d,null));};exports[_0x4f24('0xbb')]=function(_0x7c9994,_0x21310b){var _0x400d11,_0xc1ca1,_0x32efd9;var _0x53ee62=[];var _0x5a1ff7={};var _0x1c4751=_0x7c9994[_0x4f24('0xbc')]||[];var _0xef889f=[];var _0x944846;return db[_0x4f24('0x80')][_0x4f24('0x57')]()[_0x4f24('0x12')](function(_0x36da26){if(!_0x36da26){throw new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0x83'));}_0x53ee62=_['difference'](_['keys'](_0x36da26),[_0x4f24('0x84'),_0x4f24('0x85'),_0x4f24('0x87'),'ListId']);if(_0x7c9994[_0x4f24('0x4d')]['id']){delete _0x7c9994['body']['id'];}if(_['isNil'](_0x7c9994[_0x4f24('0x4d')][_0x4f24('0x8e')])){throw _0x21310b[_0x4f24('0x1d')](0x1f4)[_0x4f24('0x2d')](new db[(_0x4f24('0x81'))]['ValidationError'](_0x4f24('0x89')));}if(_[_0x4f24('0x6e')](_0x7c9994[_0x4f24('0x4d')][_0x4f24('0x4d')])||_0x7c9994['body'][_0x4f24('0x4d')]===''){throw _0x21310b[_0x4f24('0x1d')](0x1f4)[_0x4f24('0x2d')](new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0xbd')));}if(_[_0x4f24('0x6e')](_0x7c9994[_0x4f24('0x4d')][_0x4f24('0xbe')])){throw _0x21310b[_0x4f24('0x1d')](0x1f4)['send'](new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))](_0x4f24('0xbf')+_0x53ee62));}if(!_['includes'](_0x53ee62,_0x7c9994[_0x4f24('0x4d')]['mapKeyOffline'])){throw _0x21310b['status'](0x1f4)[_0x4f24('0x2d')](new db[(_0x4f24('0x81'))][(_0x4f24('0x82'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x53ee62));}_0x5a1ff7[_0x7c9994[_0x4f24('0x4d')][_0x4f24('0xbe')]]=_0x7c9994[_0x4f24('0x4d')]['from'];})[_0x4f24('0x12')](function(){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x7c9994[_0x4f24('0x48')]['id']},'include':[{'model':db[_0x4f24('0x8f')],'as':_0x4f24('0x90')},{'model':db[_0x4f24('0xc0')],'as':_0x4f24('0xc0')}]});})[_0x4f24('0x12')](handleEntityNotFound(_0x21310b,null))[_0x4f24('0x12')](function(_0x48f7e1){if(_0x48f7e1&&_0x48f7e1[_0x4f24('0x90')]){_0xc1ca1=_0x48f7e1;var _0x3e2336=_[_0x4f24('0xc')](_0x7c9994[_0x4f24('0x4d')],{'firstName':_0x7c9994['body']['from'],'phone':_0x7c9994['body'][_0x4f24('0x8e')],'ListId':_0x48f7e1[_0x4f24('0x88')]});_0x3e2336[_0x7c9994['body'][_0x4f24('0xbe')]]=_0x7c9994[_0x4f24('0x4d')][_0x4f24('0x8e')];return db['CmContact'][_0x4f24('0xc1')]({'where':_0x5a1ff7,'defaults':_0x3e2336});}})['spread'](function(_0x802c6d){if(_0x802c6d){_0x32efd9=_0x802c6d;var _0x1702bf=fs[_0x4f24('0xc2')](path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0xc3')),_0x4f24('0xc4'));var _0x157b1e=ejs[_0x4f24('0xc5')](_0x1702bf,{'body':_[_0x4f24('0xc6')](_0x7c9994[_0x4f24('0x4d')][_0x4f24('0x4d')]),'bodyTitle':_0xc1ca1[_0x4f24('0xc7')]});return db[_0x4f24('0xc8')][_0x4f24('0x54')]({'body':_0x157b1e,'ContactId':_0x802c6d['id'],'ChatWebsiteId':_0xc1ca1['id']});}})['then'](function(_0x946400){_0x944846=_0x946400;if(_0x1c4751[_0x4f24('0x3b')]){var _0x57a220=_0x1c4751[_0x4f24('0x2f')](function(_0xdd0829){return{'name':_0xdd0829[_0x4f24('0xc9')],'basename':_0xdd0829[_0x4f24('0x69')],'type':_0xdd0829['mimetype'],'ChatOfflineMessageId':_0x946400['id']};});_0xef889f=_0x57a220[_0x4f24('0x2f')](_0x35002c=>{var _0x2cb72c={'filename':_0x35002c[_0x4f24('0x2c')],'path':path[_0x4f24('0x6b')](config[_0x4f24('0x70')],_0x4f24('0xca'),_0x4f24('0xbc'),_0x4f24('0xcb'),_0x4f24('0xcc'),_0x35002c[_0x4f24('0xcd')])};return _0x2cb72c;});if(!_0xc1ca1[_0x4f24('0xce')]){return db[_0x4f24('0xcf')]['transaction'](function(_0x5db914){return db['Attachment'][_0x4f24('0xd0')](_0x57a220,{'transaction':_0x5db914});});}}})[_0x4f24('0x12')](function(){if(_0x944846){_0x400d11=_0x944846;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4f24('0xd1'),'raw':!![]}]});}})['then'](function(_0x1e6876){if(_0x1e6876&&_0x1e6876[_0x4f24('0xd1')]&&_0xc1ca1[_0x4f24('0xd2')]&&_0xc1ca1[_0x4f24('0xd3')]){var _0x432c60={'tls':{'rejectUnauthorized':![]}};if(_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd4')]){_0x432c60[_0x4f24('0xd4')]=_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd4')];}else{_0x432c60[_0x4f24('0xd5')]=_0x1e6876[_0x4f24('0xd1')]['host'];_0x432c60['port']=_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd6')];_0x432c60[_0x4f24('0xd7')]=_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd7')];}if(_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xd8')]){_0x432c60[_0x4f24('0xd9')]={'user':_0x1e6876[_0x4f24('0xd1')][_0x4f24('0x4e')],'pass':_0x1e6876[_0x4f24('0xd1')][_0x4f24('0xda')]};}return respondWithRpcPromise(_0x4f24('0xdb'),_0x4f24('0xdc'),{'account':_0x432c60,'message':{'from':util[_0x4f24('0xa3')](_0x4f24('0xdd'),_0x1e6876[_0x4f24('0x2c')],_0x1e6876[_0x4f24('0xde')]||_0x1e6876[_0x4f24('0xd1')][_0x4f24('0x4e')]),'to':_0xc1ca1['forwardOfflineAddress'],'subject':_0xc1ca1[_0x4f24('0xdf')],'html':_0x400d11['body'],'attachments':_0xef889f}},client9003)['then'](function(){return _0x400d11;})['catch'](function(_0x10085a){console[_0x4f24('0x17')](_0x10085a);});}})[_0x4f24('0x12')](function(){if(_0xc1ca1&&_0xc1ca1[_0x4f24('0xce')]&&_0xc1ca1['MailAccountId']){var _0x5d8f95=[];if(_0x1c4751[_0x4f24('0x3b')]){_0x5d8f95=_0x1c4751[_0x4f24('0x2f')](function(_0x4a8b78){return{'name':_0x4a8b78['originalname'],'basename':_0x4a8b78['filename'],'type':_0x4a8b78[_0x4f24('0xe0')],'ChatOfflineMessageId':_0x944846['id']};});}var _0x3d119c;if(!_[_0x4f24('0x6e')](_0xc1ca1[_0x4f24('0xe1')])){var _0x503e50=_[_0x4f24('0x2f')](_0x7c9994[_0x4f24('0x4d')],function(_0x2b0ad8){return _0x2b0ad8;});var _0x415d49=_[_0x4f24('0xe2')](_0x503e50)[0x0];var _0x536331=_['mapValues'](_0x415d49,function(_0x3aa4e2){return _0x3aa4e2;});_0x3d119c=_0x536331[0x1][_0xc1ca1[_0x4f24('0xe1')]];}var _0x2a1c71={'from':_0x32efd9[_0x4f24('0xde')],'firstName':_0x32efd9[_0x4f24('0x9f')],'lastName':_0x32efd9[_0x4f24('0xae')],'mapKey':'email','message':{'from':_0x32efd9[_0x4f24('0xde')],'to':_0xc1ca1[_0x4f24('0xc0')][_0x4f24('0xde')],'cc':'','subject':_[_0x4f24('0x6e')](_0x3d119c)?_0xc1ca1[_0x4f24('0xdf')]:_0x3d119c,'messageId':'','sentAt':new Date(),'attach':_0x5d8f95[_0x4f24('0x3b')],'attachments':_0x5d8f95,'originChannel':_0x4f24('0xe3'),'ChatWebsiteId':_0xc1ca1['id'],'ChatOfflineMessageId':_0x400d11['id'],'originTo':_0xc1ca1[_0x4f24('0xc0')][_0x4f24('0xde')]},'body':_0x400d11[_0x4f24('0x4d')]};var _0x51d9c4={'account':{'id':_0xc1ca1[_0x4f24('0xe4')]},'body':_0x2a1c71,'log':_0x4f24('0xe5')};return respondWithRpcPromise(_0x4f24('0xe5'),'notifyMail',_0x51d9c4,client9001)[_0x4f24('0x12')](function(){return _0x400d11;})[_0x4f24('0x1c')](function(_0x2c3451){console[_0x4f24('0x17')](_0x2c3451);});}return;})[_0x4f24('0x12')](function(){if(_0x400d11){return _0x400d11;}})[_0x4f24('0x12')](respondWithResult(_0x21310b,null))['catch'](function(_0x40e193){console[_0x4f24('0x17')](_0x4f24('0x1c'),_0x40e193);for(var _0x4a17d4 of _0x1c4751){var _0x3d1dbe=path[_0x4f24('0x6b')](config[_0x4f24('0x70')],'server','files',_0x4f24('0xcb'),_0x4f24('0xcc'),_0x4a17d4[_0x4f24('0x69')]);fs_extra[_0x4f24('0xe6')](_0x3d1dbe)[_0x4f24('0x1c')](function(_0x36a498){console['error'](_0x4f24('0xe7'),_0x3d1dbe,_0x36a498);});}});};exports[_0x4f24('0xe8')]=function(_0x5c2b4f,_0x16016a){return db[_0x4f24('0xa9')]['find']({'where':{'id':_0x5c2b4f[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x16016a,null))[_0x4f24('0x12')](function(_0x23c46b){if(_0x23c46b){return _0x23c46b[_0x4f24('0xe8')](_0x5c2b4f[_0x4f24('0x4d')][_0x4f24('0x5e')],_[_0x4f24('0xe9')](_0x5c2b4f[_0x4f24('0x4d')],[_0x4f24('0x5e'),'id'])||{});}})[_0x4f24('0x12')](respondWithResult(_0x16016a,null))['catch'](handleError(_0x16016a,null));};exports['getInteractions']=function(_0x59b390,_0x104333){var _0xf92d65={'raw':![],'where':{}};var _0x39ffd7={};var _0x52af4b={'count':0x0,'rows':[]};return db[_0x4f24('0x30')]['findOne']({'where':{'id':_0x59b390['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x104333,null))[_0x4f24('0x12')](function(_0x2dadff){if(_0x2dadff){_0x39ffd7[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0xa9')][_0x4f24('0x31')]);_0x39ffd7[_0x4f24('0x35')]=_[_0x4f24('0x36')](_0x59b390[_0x4f24('0x35')]);_0x39ffd7['filters']=_['intersection'](_0x39ffd7['model'],_0x39ffd7[_0x4f24('0x35')]);_0xf92d65['attributes']=_[_0x4f24('0x38')](_0x39ffd7[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x59b390[_0x4f24('0x35')]['fields']));_0xf92d65[_0x4f24('0x39')]=_0xf92d65[_0x4f24('0x39')][_0x4f24('0x3b')]?_0xf92d65[_0x4f24('0x39')]:_0x39ffd7[_0x4f24('0x34')];if(!_0x59b390[_0x4f24('0x35')]['hasOwnProperty'](_0x4f24('0x3d'))){_0xf92d65[_0x4f24('0x22')]=qs[_0x4f24('0x22')](_0x59b390[_0x4f24('0x35')][_0x4f24('0x22')]);_0xf92d65[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x59b390[_0x4f24('0x35')][_0x4f24('0x1f')]);}_0xf92d65[_0x4f24('0x3e')]=qs[_0x4f24('0x3f')](_0x59b390[_0x4f24('0x35')][_0x4f24('0x3f')]);_0xf92d65['where']=qs[_0x4f24('0x37')](_[_0x4f24('0x40')](_0x59b390[_0x4f24('0x35')],_0x39ffd7[_0x4f24('0x37')]));_0xf92d65[_0x4f24('0x44')][_0x4f24('0x61')]=_0x2dadff['id'];if(_0x59b390[_0x4f24('0x35')]['filter']){_0xf92d65[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0xf92d65[_0x4f24('0x44')],{'$or':_['map'](_0xf92d65['attributes'],function(_0x152c66){var _0x3babb0={};_0x3babb0[_0x152c66]={'$like':'%'+_0x59b390['query'][_0x4f24('0x41')]+'%'};return _0x3babb0;})});}_0xf92d65=_[_0x4f24('0x42')]({},_0xf92d65,_0x59b390[_0x4f24('0x4b')]);return db['ChatInteraction'][_0x4f24('0x21')]({'where':_0xf92d65[_0x4f24('0x44')]})[_0x4f24('0x12')](function(_0xd0e129){_0x52af4b[_0x4f24('0x21')]=_0xd0e129;if(_0x59b390[_0x4f24('0x35')][_0x4f24('0x45')]){_0xf92d65[_0x4f24('0x4a')]=[{'model':db[_0x4f24('0x80')],'as':_0x4f24('0xea'),'required':![]},{'model':db[_0x4f24('0xeb')],'as':_0x4f24('0xec'),'attributes':[_0x4f24('0x2c'),_0x4f24('0xed'),_0x4f24('0xee')],'required':![]},{'model':db[_0x4f24('0xef')],'as':_0x4f24('0xf0'),'attributes':['id','name',_0x4f24('0xf1')],'where':_0x59b390['query'][_0x4f24('0xf2')]?{'id':_0x59b390[_0x4f24('0x35')][_0x4f24('0xf2')]}:undefined,'required':_0x59b390[_0x4f24('0x35')][_0x4f24('0xf2')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0xf92d65);})[_0x4f24('0x12')](function(_0x4f0606){_0x52af4b['rows']=_0x4f0606;return _0x52af4b;});}})['then'](respondWithFilteredResult(_0x104333,_0xf92d65))[_0x4f24('0x1c')](handleError(_0x104333,null));};function iftimePromise(_0xa3235e,_0x122007){return respondWithRpcPromise(_0x4f24('0xf3'),_0x4f24('0xf4'),{'command':_0x122007['timezone']?util[_0x4f24('0xa3')](_0x4f24('0xf5'),_0xa3235e[_0x4f24('0xf6')],_0x122007[_0x4f24('0xf7')]):util[_0x4f24('0xa3')](_0x4f24('0xf8'),_0xa3235e[_0x4f24('0xf6')])},client9002)[_0x4f24('0x12')](function(_0x45d367){var _0x2d1fae=_0x45d367&&_0x45d367[_0x4f24('0xf9')](_0x4f24('0xfa'))>=0x0?!![]:![];logger['info'](_0x4f24('0xfb'),_0x122007['id'],_0xa3235e['id'],_0xa3235e[_0x4f24('0xf6')],_0x2d1fae?'ONLINE':_0x4f24('0xfc'),_0x122007[_0x4f24('0xf7')]?_0x122007['timezone']:_0x4f24('0xfd'));return _0x2d1fae;})['catch'](function(_0x3dc535){logger[_0x4f24('0x17')](_0x4f24('0xfb'),_0x122007['id'],_0xa3235e['id'],_0xa3235e[_0x4f24('0xf6')],util[_0x4f24('0xfe')](_0x3dc535,{'showHidden':![],'depth':null}),_0x122007[_0x4f24('0xf7')]?_0x122007[_0x4f24('0xf7')]:_0x4f24('0xfd'));return![];});}exports[_0x4f24('0xf4')]=function(_0x293d01,_0x106024){var _0x3ec9cc=0x0;var _0x48e403=0x0;var _0x571842=![];var _0x34fdfd;var _0x12550f;return db['ChatWebsite']['find']({'where':{'id':_0x293d01['params']['id']},'include':[{'model':db[_0x4f24('0xff')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x4f24('0x100'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x4f24('0x12')](handleEntityNotFound(_0x106024,null))['then'](function(_0x237d8b){if(_0x237d8b){_0x34fdfd=_0x237d8b;return _0x237d8b[_0x4f24('0x101')]({'raw':!![]});}})[_0x4f24('0x12')](function(_0x58ff18){if(_0x34fdfd){if(_0x58ff18){_0x12550f=_0x58ff18;}}return require('../../config/license/util')[_0x4f24('0x6c')]();})[_0x4f24('0x12')](function(_0x46561b){if(_0x46561b){_0x48e403=_0x46561b[_0x4f24('0x102')];_0x571842=_0x46561b[_0x4f24('0x6d')];}})[_0x4f24('0x12')](function(){return db[_0x4f24('0xa9')][_0x4f24('0x21')]({'where':{'closed':![]}});})[_0x4f24('0x12')](function(_0x2d3074){_0x3ec9cc=_0x2d3074;if(_0x48e403&&_0x2d3074>_0x48e403){return db[_0x4f24('0x103')]['findOne']({'where':{'id':0x1}})['then'](function(_0x3eb63c){if(_0x3eb63c){_0x3eb63c[_0x4f24('0x104')](_0x4f24('0x105'));}});}})[_0x4f24('0x12')](function(){if(_0x34fdfd[_0x4f24('0xff')]&&_0x34fdfd[_0x4f24('0xff')][_0x4f24('0x100')]){var _0x53ec78=[];for(var _0x40724a=0x0;_0x40724a<_0x34fdfd['Interval'][_0x4f24('0x100')][_0x4f24('0x3b')];_0x40724a++){var _0x25b90e=_0x34fdfd[_0x4f24('0xff')][_0x4f24('0x100')][_0x40724a][_0x4f24('0x26')]({'plain':!![]});_0x53ec78[_0x4f24('0x106')](iftimePromise(_0x25b90e,_0x34fdfd));}return BPromise[_0x4f24('0x107')](_0x53ec78)[_0x4f24('0x12')](function(_0x38d11f){return _['some'](_0x38d11f);});}else{return!![];}})[_0x4f24('0x12')](function(_0x44ae30){var _0x523ee8=fs[_0x4f24('0xc2')](path[_0x4f24('0x6b')](config['root'],_0x4f24('0x108')),_0x4f24('0xc4'));var _0xa8e0e={'remote':_0x34fdfd[_0x4f24('0x109')],'query':querystring[_0x4f24('0xa7')](_[_0x4f24('0x42')](_0x34fdfd[_0x4f24('0x26')]({'plain':!![]}),{'customerIp':_0x293d01[_0x4f24('0x7d')][_0x4f24('0x9c')]||_0x293d01['headers'][_0x4f24('0x10a')]||_0x293d01[_0x4f24('0x10b')][_0x4f24('0x10c')]||_0x293d01['ip'],'referer':_0x293d01[_0x4f24('0x7d')][_0x4f24('0x10d')],'openedInteractions':_0x3ec9cc,'maxInteractions':_0x48e403,'virtual':_0x571842[_0x4f24('0x102')],'online':_0x44ae30,'custom':_0x571842}))['replace'](/'/g,'\x5c\x27')};_0x106024[_0x4f24('0x2d')](ejs['render'](Mustache[_0x4f24('0xc5')](_0x523ee8,_0xa8e0e),{'proactiveActions':_0x12550f,'alignment':_0x34fdfd[_0x4f24('0x10e')],'verticalAlignment':_0x34fdfd[_0x4f24('0x10f')],'div_color':_0x34fdfd[_0x4f24('0xf1')],'labelText':_0x34fdfd['labelText'],'text_color':_0x34fdfd[_0x4f24('0x110')],'button_color':_0x34fdfd[_0x4f24('0x111')],'background_color':_0x34fdfd[_0x4f24('0x112')]}));})[_0x4f24('0x1c')](handleError(_0x106024,null));};exports[_0x4f24('0x113')]=function(_0xf88892,_0x5ab35b){var _0x554f4b=_0xf88892[_0x4f24('0x48')]['id'];var _0x495b7b=_0xf88892[_0x4f24('0x4d')];var _0x2b83e5=0xc8;var _0x1028f9=null;return db[_0x4f24('0xcf')][_0x4f24('0x114')]({'isolationLevel':db[_0x4f24('0xcf')][_0x4f24('0x115')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x57a05b){return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x554f4b},'transaction':_0x57a05b})[_0x4f24('0x12')](function(_0x5ae965){if(_0x5ae965){return db['ChatApplication'][_0x4f24('0x28')]({'where':{'ChatWebsiteId':_0x554f4b},'transaction':_0x57a05b})[_0x4f24('0x12')](function(){var _0x50ff29=_[_0x4f24('0x2f')](_0x495b7b,function(_0x5cdaa9){_0x5cdaa9[_0x4f24('0x61')]=_0x554f4b;return _0x5cdaa9;});return db[_0x4f24('0x93')]['bulkCreate'](_0x50ff29,{'transaction':_0x57a05b});});}else{_0x2b83e5=0x194;_0x1028f9=[];}});})[_0x4f24('0x12')](function(){if(_0x2b83e5!==0x194){return db[_0x4f24('0x93')][_0x4f24('0x116')]({'where':{'ChatWebsiteId':_0x554f4b},'order':_0x4f24('0x98')})['then'](function(_0x385e39){_0x1028f9=_0x385e39;});}})[_0x4f24('0x1c')](function(_0x42cfd6){_0x2b83e5=0x1f4;logger['error'](_0x42cfd6[_0x4f24('0x2b')]);if(_0x42cfd6[_0x4f24('0x2c')]){delete _0x42cfd6[_0x4f24('0x2c')];}_0x1028f9=_0x42cfd6;})[_0x4f24('0x117')](function(){if(_0x1028f9===null){_0x5ab35b[_0x4f24('0x2a')](_0x2b83e5);}else{if(_0x2b83e5===0x1f4){_0x5ab35b[_0x4f24('0x1d')](_0x2b83e5)[_0x4f24('0x2d')](_0x1028f9);}else{_0x5ab35b[_0x4f24('0x1d')](_0x2b83e5)['json'](_0x1028f9);}}});};exports[_0x4f24('0x118')]=function(_0x50284f,_0x55f3eb){var _0x47a42a={};var _0x18fe14={};var _0x4bd32f;var _0x187ad2;return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x50284f[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x55f3eb,null))[_0x4f24('0x12')](function(_0x2ce8f6){if(_0x2ce8f6){_0x4bd32f=_0x2ce8f6;_0x18fe14[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0x93')][_0x4f24('0x31')]);_0x18fe14[_0x4f24('0x35')]=_[_0x4f24('0x36')](_0x50284f[_0x4f24('0x35')]);_0x18fe14['filters']=_[_0x4f24('0x38')](_0x18fe14[_0x4f24('0x34')],_0x18fe14[_0x4f24('0x35')]);_0x47a42a[_0x4f24('0x39')]=_['intersection'](_0x18fe14['model'],qs[_0x4f24('0x3a')](_0x50284f[_0x4f24('0x35')]['fields']));_0x47a42a[_0x4f24('0x39')]=_0x47a42a[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x47a42a['attributes']:_0x18fe14[_0x4f24('0x34')];_0x47a42a[_0x4f24('0x3e')]=qs[_0x4f24('0x3f')](_0x50284f[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x47a42a[_0x4f24('0x44')]=qs['filters'](_['pick'](_0x50284f[_0x4f24('0x35')],_0x18fe14[_0x4f24('0x37')]));if(_0x50284f[_0x4f24('0x35')][_0x4f24('0x41')]){_0x47a42a[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x47a42a[_0x4f24('0x44')],{'$or':_['map'](_0x47a42a[_0x4f24('0x39')],function(_0x13ffec){var _0x21ecda={};_0x21ecda[_0x13ffec]={'$like':'%'+_0x50284f[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x21ecda;})});}_0x47a42a=_[_0x4f24('0x42')]({},_0x47a42a,_0x50284f[_0x4f24('0x4b')]);return _0x4bd32f[_0x4f24('0x118')](_0x47a42a);}})[_0x4f24('0x12')](function(_0x28f310){if(_0x28f310){_0x187ad2=_0x28f310['length'];if(!_0x50284f['query'][_0x4f24('0x3c')](_0x4f24('0x3d'))){_0x47a42a[_0x4f24('0x22')]=qs[_0x4f24('0x22')](_0x50284f['query'][_0x4f24('0x22')]);_0x47a42a['offset']=qs[_0x4f24('0x1f')](_0x50284f['query']['offset']);}return _0x4bd32f['getApplications'](_0x47a42a);}})[_0x4f24('0x12')](function(_0x41d2cd){if(_0x41d2cd){return _0x41d2cd?{'count':_0x187ad2,'rows':_0x41d2cd}:null;}})['then'](respondWithResult(_0x55f3eb,null))[_0x4f24('0x1c')](handleError(_0x55f3eb,null));};exports[_0x4f24('0x119')]=function(_0x2c67df,_0x241854){return db[_0x4f24('0x11a')][_0x4f24('0x4c')]({'where':{'id':_0x2c67df['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x241854,null))[_0x4f24('0x12')](function(_0x46c083){if(_0x46c083){return _0x46c083[_0x4f24('0x119')](_0x2c67df['body'][_0x4f24('0x5e')],_[_0x4f24('0xe9')](_0x2c67df[_0x4f24('0x4d')],[_0x4f24('0x5e'),'id'])||{});}})[_0x4f24('0x12')](respondWithResult(_0x241854,null))['catch'](handleError(_0x241854,null));};exports[_0x4f24('0x101')]=function(_0x45fd8a,_0x28d5c3){var _0x42c593={};var _0x4c3196={};var _0x4a807a;var _0x3f14b3;return db[_0x4f24('0x30')]['findOne']({'where':{'id':_0x45fd8a[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x28d5c3,null))['then'](function(_0x525338){if(_0x525338){_0x4a807a=_0x525338;_0x4c3196[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0x11b')]['rawAttributes']);_0x4c3196['query']=_['keys'](_0x45fd8a[_0x4f24('0x35')]);_0x4c3196['filters']=_[_0x4f24('0x38')](_0x4c3196[_0x4f24('0x34')],_0x4c3196[_0x4f24('0x35')]);_0x42c593[_0x4f24('0x39')]=_[_0x4f24('0x38')](_0x4c3196[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x45fd8a['query'][_0x4f24('0x3a')]));_0x42c593['attributes']=_0x42c593[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x42c593[_0x4f24('0x39')]:_0x4c3196[_0x4f24('0x34')];_0x42c593[_0x4f24('0x3e')]=qs[_0x4f24('0x3f')](_0x45fd8a[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x42c593[_0x4f24('0x44')]=qs['filters'](_['pick'](_0x45fd8a[_0x4f24('0x35')],_0x4c3196[_0x4f24('0x37')]));if(_0x45fd8a['query'][_0x4f24('0x41')]){_0x42c593[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x42c593[_0x4f24('0x44')],{'$or':_[_0x4f24('0x2f')](_0x42c593['attributes'],function(_0x26b4e4){var _0x69c9fb={};_0x69c9fb[_0x26b4e4]={'$like':'%'+_0x45fd8a[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x69c9fb;})});}_0x42c593=_['merge']({},_0x42c593,_0x45fd8a[_0x4f24('0x4b')]);return _0x4a807a['getProactiveActions'](_0x42c593);}})[_0x4f24('0x12')](function(_0xd15b90){if(_0xd15b90){_0x3f14b3=_0xd15b90[_0x4f24('0x3b')];if(!_0x45fd8a['query']['hasOwnProperty']('nolimit')){_0x42c593['limit']=qs[_0x4f24('0x22')](_0x45fd8a[_0x4f24('0x35')]['limit']);_0x42c593['offset']=qs[_0x4f24('0x1f')](_0x45fd8a[_0x4f24('0x35')][_0x4f24('0x1f')]);}return _0x4a807a[_0x4f24('0x101')](_0x42c593);}})[_0x4f24('0x12')](function(_0x2a46aa){if(_0x2a46aa){return _0x2a46aa?{'count':_0x3f14b3,'rows':_0x2a46aa}:null;}})[_0x4f24('0x12')](respondWithResult(_0x28d5c3,null))['catch'](handleError(_0x28d5c3,null));};exports[_0x4f24('0x11c')]=function(_0x3fede3,_0x567b7f){var _0x53298c=_0x3fede3['query'][_0x4f24('0x11d')]===_0x4f24('0x11e')?_0x4f24('0x11f'):_0x4f24('0x120');return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'attributes':['id',_0x53298c],'where':{'id':_0x3fede3['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x567b7f,null))[_0x4f24('0x12')](function(_0x25ff10){if(_0x25ff10){var _0xacc145=_0x25ff10[_0x53298c];var _0x317baf=_0xacc145&&_0xacc145['items']?_0xacc145[_0x4f24('0x121')]:[];_0x567b7f['send']({'fromKey':_[_0x4f24('0x6e')](_0xacc145[_0x4f24('0x122')])?undefined:_0xacc145[_0x4f24('0x122')],'count':_0x317baf['length'],'rows':_0x317baf});}})[_0x4f24('0x1c')](handleError(_0x567b7f,null));};exports[_0x4f24('0x123')]=function(_0x60ceb9,_0x313773){var _0x520dde={'raw':![],'where':{}};var _0x112ca3={};var _0x22dc63={'count':0x0,'rows':[]};return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x60ceb9['params']['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x313773,null))[_0x4f24('0x12')](function(_0x1f9330){if(_0x1f9330){_0x112ca3[_0x4f24('0x34')]=_['keys'](db[_0x4f24('0xc8')][_0x4f24('0x31')]);_0x112ca3['query']=_[_0x4f24('0x36')](_0x60ceb9[_0x4f24('0x35')]);_0x112ca3[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0x112ca3[_0x4f24('0x34')],_0x112ca3[_0x4f24('0x35')]);_0x520dde[_0x4f24('0x39')]=_['intersection'](_0x112ca3[_0x4f24('0x34')],qs[_0x4f24('0x3a')](_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x3a')]));_0x520dde[_0x4f24('0x39')]=_0x520dde['attributes']['length']?_0x520dde[_0x4f24('0x39')]:_0x112ca3['model'];if(!_0x60ceb9[_0x4f24('0x35')]['hasOwnProperty'](_0x4f24('0x3d'))){_0x520dde[_0x4f24('0x22')]=qs[_0x4f24('0x22')](_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x22')]);_0x520dde[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x1f')]);}_0x520dde[_0x4f24('0x3e')]=qs[_0x4f24('0x3f')](_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x3f')]);_0x520dde['where']=qs[_0x4f24('0x37')](_['pick'](_0x60ceb9[_0x4f24('0x35')],_0x112ca3[_0x4f24('0x37')]));_0x520dde[_0x4f24('0x44')]['ChatWebsiteId']=_0x1f9330['id'];if(_0x60ceb9['query'][_0x4f24('0x41')]){_0x520dde[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x520dde[_0x4f24('0x44')],{'$or':_[_0x4f24('0x2f')](_0x520dde[_0x4f24('0x39')],function(_0xe04fb){var _0x293ffb={};_0x293ffb[_0xe04fb]={'$like':'%'+_0x60ceb9['query']['filter']+'%'};return _0x293ffb;})});}_0x520dde=_['merge']({},_0x520dde,_0x60ceb9[_0x4f24('0x4b')]);return db[_0x4f24('0xc8')][_0x4f24('0x21')]({'where':_0x520dde[_0x4f24('0x44')]})[_0x4f24('0x12')](function(_0x98822e){_0x22dc63[_0x4f24('0x21')]=_0x98822e;if(_0x60ceb9[_0x4f24('0x35')][_0x4f24('0x45')]){_0x520dde[_0x4f24('0x4a')]=[{'all':!![]}];}else{_0x520dde[_0x4f24('0x4a')]=[{'model':db[_0x4f24('0x80')],'as':_0x4f24('0xea'),'required':![]},{'model':db['Attachment'],'as':_0x4f24('0x124'),'required':![]}];}return db[_0x4f24('0xc8')][_0x4f24('0x5c')](_0x520dde);})[_0x4f24('0x12')](function(_0x560f19){_0x22dc63[_0x4f24('0x46')]=_0x560f19;return _0x22dc63;});}})['then'](respondWithFilteredResult(_0x313773,_0x520dde))[_0x4f24('0x1c')](handleError(_0x313773,null));};exports[_0x4f24('0x125')]=function(_0x36e5a5,_0x42d171){return db['ChatWebsite'][_0x4f24('0x4c')]({'where':{'id':_0x36e5a5[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x42d171,null))['then'](function(_0xd63a76){if(_0xd63a76){return _0xd63a76[_0x4f24('0x125')](_0x36e5a5[_0x4f24('0x4d')]['ids'],_[_0x4f24('0xe9')](_0x36e5a5[_0x4f24('0x4d')],['ids','id'])||{})['spread'](function(_0x41e7a2){for(var _0xc5f660=0x0;_0xc5f660<_0x36e5a5['body'][_0x4f24('0x5e')][_0x4f24('0x3b')];_0xc5f660+=0x1){socket[_0x4f24('0x126')](_0x4f24('0x127'),{'UserId':Number(_0x36e5a5[_0x4f24('0x4d')][_0x4f24('0x5e')][_0xc5f660]),'ChatWebsiteId':Number(_0x36e5a5[_0x4f24('0x48')]['id'])});}return _0x41e7a2;});}})[_0x4f24('0x12')](respondWithResult(_0x42d171,null))[_0x4f24('0x1c')](handleError(_0x42d171,null));};exports[_0x4f24('0x128')]=function(_0x1e4ff1,_0x1cac05){return db[_0x4f24('0x30')][_0x4f24('0x4c')]({'where':{'id':_0x1e4ff1[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x1cac05,null))[_0x4f24('0x12')](function(_0x52125b){if(_0x52125b){return _0x52125b['removeAgents'](_0x1e4ff1[_0x4f24('0x35')][_0x4f24('0x5e')])['then'](function(){if(_[_0x4f24('0x129')](_0x1e4ff1['query']['ids'])){for(var _0x1b89bf=0x0;_0x1b89bf<_0x1e4ff1[_0x4f24('0x35')][_0x4f24('0x5e')][_0x4f24('0x3b')];_0x1b89bf+=0x1){socket[_0x4f24('0x126')](_0x4f24('0x12a'),{'UserId':Number(_0x1e4ff1[_0x4f24('0x35')]['ids'][_0x1b89bf]),'ChatWebsiteId':Number(_0x1e4ff1['params']['id'])});}}else{socket[_0x4f24('0x126')](_0x4f24('0x12a'),{'UserId':Number(_0x1e4ff1[_0x4f24('0x35')][_0x4f24('0x5e')]),'ChatWebsiteId':Number(_0x1e4ff1[_0x4f24('0x48')]['id'])});}});}})[_0x4f24('0x12')](respondWithStatusCode(_0x1cac05,null))['catch'](handleError(_0x1cac05,null));};exports[_0x4f24('0x12b')]=function(_0x4e3c50,_0x2fe8d7){var _0x102b43={};var _0xd3aadf={};var _0x4ff820;var _0x68f89f;return db[_0x4f24('0x30')][_0x4f24('0x5b')]({'where':{'id':_0x4e3c50[_0x4f24('0x48')]['id']}})[_0x4f24('0x12')](handleEntityNotFound(_0x2fe8d7,null))[_0x4f24('0x12')](function(_0x4abad2){if(_0x4abad2){_0x4ff820=_0x4abad2;_0xd3aadf[_0x4f24('0x34')]=_[_0x4f24('0x36')](db[_0x4f24('0xeb')][_0x4f24('0x31')]);_0xd3aadf[_0x4f24('0x35')]=_[_0x4f24('0x36')](_0x4e3c50[_0x4f24('0x35')]);_0xd3aadf[_0x4f24('0x37')]=_[_0x4f24('0x38')](_0xd3aadf['model'],_0xd3aadf['query']);_0x102b43['attributes']=_['intersection'](_0xd3aadf['model'],qs[_0x4f24('0x3a')](_0x4e3c50[_0x4f24('0x35')][_0x4f24('0x3a')]));_0x102b43[_0x4f24('0x39')]=_0x102b43[_0x4f24('0x39')][_0x4f24('0x3b')]?_0x102b43[_0x4f24('0x39')]:_0xd3aadf[_0x4f24('0x34')];_0x102b43['order']=qs['sort'](_0x4e3c50['query'][_0x4f24('0x3f')]);_0x102b43[_0x4f24('0x44')]=qs[_0x4f24('0x37')](_['pick'](_0x4e3c50[_0x4f24('0x35')],_0xd3aadf[_0x4f24('0x37')]));if(_0x4e3c50['query']['filter']){_0x102b43[_0x4f24('0x44')]=_[_0x4f24('0x42')](_0x102b43['where'],{'$or':_[_0x4f24('0x2f')](_0x102b43['attributes'],function(_0x4a16cd){var _0x22ac7c={};_0x22ac7c[_0x4a16cd]={'$like':'%'+_0x4e3c50[_0x4f24('0x35')][_0x4f24('0x41')]+'%'};return _0x22ac7c;})});}_0x102b43=_[_0x4f24('0x42')]({},_0x102b43,_0x4e3c50[_0x4f24('0x4b')]);return _0x4ff820[_0x4f24('0x12b')](_0x102b43);}})['then'](function(_0x1f8a55){if(_0x1f8a55){_0x68f89f=_0x1f8a55[_0x4f24('0x3b')];if(!_0x4e3c50['query'][_0x4f24('0x3c')](_0x4f24('0x3d'))){_0x102b43[_0x4f24('0x22')]=qs['limit'](_0x4e3c50[_0x4f24('0x35')][_0x4f24('0x22')]);_0x102b43[_0x4f24('0x1f')]=qs[_0x4f24('0x1f')](_0x4e3c50[_0x4f24('0x35')][_0x4f24('0x1f')]);}return _0x4ff820['getAgents'](_0x102b43);}})[_0x4f24('0x12')](function(_0x2b8c73){if(_0x2b8c73){return _0x2b8c73?{'count':_0x68f89f,'rows':_0x2b8c73}:null;}})[_0x4f24('0x12')](respondWithResult(_0x2fe8d7,null))[_0x4f24('0x1c')](handleError(_0x2fe8d7,null));};
\ No newline at end of file
+var _0xce58=['unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','difference','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','getLicense','License','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','referer','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','keys','options','find','create','body','user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','order','pick','rows','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','addLogo','file','agentAvatar','filename','addCustomerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','custom','isNil','getAvatar','existsSync','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','headers','user-agent','getResult','CmContact','Sequelize','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','Applications','List','applications','priority','asc','account','defaults','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','format','version'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xce58,0x1b4));var _0x8ce5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce58[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x8ce5('0x0'));var Mustache=require(_0x8ce5('0x1'));var util=require(_0x8ce5('0x2'));var path=require(_0x8ce5('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x8ce5('0x4'));var Redis=require(_0x8ce5('0x5'));var qs=require(_0x8ce5('0x6'));var logger=require(_0x8ce5('0x7'))(_0x8ce5('0x8'));var config=require(_0x8ce5('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x8ce5('0xa')],{'host':_0x8ce5('0xb'),'port':0x18eb});var socket=require(_0x8ce5('0xc'))(new Redis(config[_0x8ce5('0xa')]));require(_0x8ce5('0xd'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8ce5('0xe')][_0x8ce5('0xf')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x8ce5('0xe')][_0x8ce5('0xf')]({'port':0x232b});var client9001=jayson[_0x8ce5('0xe')][_0x8ce5('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x2c958c,_0x3dd0ea,_0x4a47e7,_0x5acf6f){return new BPromise(function(_0xea380c,_0x62d4b0){var _0x18847b=_0x5acf6f||client;return _0x18847b[_0x8ce5('0x10')](_0x2c958c,_0x4a47e7)[_0x8ce5('0x11')](function(_0x3db1a7){logger[_0x8ce5('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x3dd0ea,_0x8ce5('0x13'));logger[_0x8ce5('0x14')](_0x8ce5('0x15'),_0x3dd0ea,_0x8ce5('0x13'),JSON[_0x8ce5('0x16')](_0x3db1a7));if(_0x3db1a7[_0x8ce5('0x17')]){if(_0x3db1a7[_0x8ce5('0x17')][_0x8ce5('0x18')]===0x1f4){logger[_0x8ce5('0x17')](_0x8ce5('0x19'),_0x3dd0ea,_0x3db1a7[_0x8ce5('0x17')]['message']);return _0x62d4b0(_0x3db1a7[_0x8ce5('0x17')][_0x8ce5('0x1a')]);}logger[_0x8ce5('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x3dd0ea,_0x3db1a7[_0x8ce5('0x17')][_0x8ce5('0x1a')]);return _0xea380c(_0x3db1a7[_0x8ce5('0x17')]['message']);}else{logger[_0x8ce5('0x12')](_0x8ce5('0x19'),_0x3dd0ea,_0x8ce5('0x13'));_0xea380c(_0x3db1a7[_0x8ce5('0x1b')]['message']);}})[_0x8ce5('0x1c')](function(_0x23a993){logger[_0x8ce5('0x17')](_0x8ce5('0x19'),_0x3dd0ea,_0x23a993);_0x62d4b0(_0x23a993);});});}function respondWithStatusCode(_0xb18987,_0x14dd60){_0x14dd60=_0x14dd60||0xcc;return function(_0x322e45){if(_0x322e45){return _0xb18987[_0x8ce5('0x1d')](_0x14dd60);}return _0xb18987['status'](_0x14dd60)[_0x8ce5('0x1e')]();};}function respondWithResult(_0x15e20e,_0x19f426){_0x19f426=_0x19f426||0xc8;return function(_0x331e76){if(_0x331e76){return _0x15e20e[_0x8ce5('0x1f')](_0x19f426)[_0x8ce5('0x20')](_0x331e76);}};}function respondWithFilteredResult(_0x853770,_0x380c4e){return function(_0x4b7873){if(_0x4b7873){var _0x22881c=typeof _0x380c4e[_0x8ce5('0x21')]===_0x8ce5('0x22')&&typeof _0x380c4e[_0x8ce5('0x23')]==='undefined';var _0x4a9d30=_0x4b7873[_0x8ce5('0x24')];var _0x49d65c=_0x22881c?0x0:_0x380c4e[_0x8ce5('0x21')];var _0x513aee=_0x22881c?_0x4b7873[_0x8ce5('0x24')]:_0x380c4e['offset']+_0x380c4e[_0x8ce5('0x23')];var _0x4b0bd0;if(_0x513aee>=_0x4a9d30){_0x513aee=_0x4a9d30;_0x4b0bd0=0xc8;}else{_0x4b0bd0=0xce;}_0x853770['status'](_0x4b0bd0);return _0x853770[_0x8ce5('0x25')](_0x8ce5('0x26'),_0x49d65c+'-'+_0x513aee+'/'+_0x4a9d30)[_0x8ce5('0x20')](_0x4b7873);}return null;};}function saveUpdates(_0x16743d){return function(_0x436ab3){if(_0x436ab3){return _0x436ab3[_0x8ce5('0x27')](_0x16743d)[_0x8ce5('0x11')](function(_0x553256){return _0x553256;});}return null;};}function removeEntity(_0x36a704){return function(_0xfbd1a6){if(_0xfbd1a6){return _0xfbd1a6[_0x8ce5('0x28')]()['then'](function(){var _0x65ed6e=_0xfbd1a6[_0x8ce5('0x29')]({'plain':!![]});var _0xaeb2a2='ChatWebsites';return db[_0x8ce5('0x2a')][_0x8ce5('0x28')]({'where':{'type':_0xaeb2a2,'resourceId':_0x65ed6e['id']}})[_0x8ce5('0x11')](function(){return _0xfbd1a6;});})['then'](function(){_0x36a704[_0x8ce5('0x1f')](0xcc)[_0x8ce5('0x1e')]();});}};}function handleEntityNotFound(_0x190183){return function(_0x5a6b39){if(!_0x5a6b39){_0x190183[_0x8ce5('0x1d')](0x194);}return _0x5a6b39;};}function handleError(_0x4f4020,_0x39c784){_0x39c784=_0x39c784||0x1f4;return function(_0x5c2f81){logger[_0x8ce5('0x17')](_0x5c2f81[_0x8ce5('0x2b')]);if(_0x5c2f81[_0x8ce5('0x2c')]){delete _0x5c2f81[_0x8ce5('0x2c')];}_0x4f4020[_0x8ce5('0x1f')](_0x39c784)[_0x8ce5('0x2d')](_0x5c2f81);};}exports['index']=function(_0x109c71,_0x2c4aeb){var _0x478a2c={'include':[{'model':db[_0x8ce5('0x2e')],'as':_0x8ce5('0x2f')}]},_0x2adc21={},_0x39447d={'count':0x0,'rows':[]};var _0x5ac99b=_['map'](db[_0x8ce5('0x30')][_0x8ce5('0x31')],function(_0x11ea0f){return{'name':_0x11ea0f[_0x8ce5('0x32')],'type':_0x11ea0f[_0x8ce5('0x33')][_0x8ce5('0x34')]};});_0x2adc21['model']=_[_0x8ce5('0x35')](_0x5ac99b,_0x8ce5('0x2c'));_0x2adc21[_0x8ce5('0x36')]=_['keys'](_0x109c71[_0x8ce5('0x36')]);_0x2adc21[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x2adc21['model'],_0x2adc21[_0x8ce5('0x36')]);_0x478a2c[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x2adc21[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x109c71[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x478a2c['attributes']=_0x478a2c[_0x8ce5('0x39')][_0x8ce5('0x3c')]?_0x478a2c[_0x8ce5('0x39')]:_0x2adc21[_0x8ce5('0x3a')];if(!_0x109c71['query'][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x478a2c['limit']=qs[_0x8ce5('0x23')](_0x109c71['query'][_0x8ce5('0x23')]);_0x478a2c[_0x8ce5('0x21')]=qs['offset'](_0x109c71['query'][_0x8ce5('0x21')]);}_0x478a2c['order']=qs[_0x8ce5('0x3f')](_0x109c71[_0x8ce5('0x36')][_0x8ce5('0x3f')]);_0x478a2c[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_['pick'](_0x109c71[_0x8ce5('0x36')],_0x2adc21['filters']),_0x5ac99b);if(_0x109c71['query'][_0x8ce5('0x41')]){_0x478a2c[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x478a2c[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x5ac99b,function(_0x1c5a78){if(_0x1c5a78[_0x8ce5('0x33')]!==_0x8ce5('0x43')){var _0xd9329f={};_0xd9329f[_0x1c5a78[_0x8ce5('0x2c')]]={'$like':'%'+_0x109c71[_0x8ce5('0x36')]['filter']+'%'};return _0xd9329f;}})});}_0x478a2c=_[_0x8ce5('0x42')]({},_0x478a2c,_0x109c71['options']);var _0x696e19={'where':_0x478a2c['where']};return db[_0x8ce5('0x30')][_0x8ce5('0x24')](_0x696e19)[_0x8ce5('0x11')](function(_0x25dfa2){_0x39447d[_0x8ce5('0x24')]=_0x25dfa2;if(_0x109c71['query'][_0x8ce5('0x44')]){_0x478a2c[_0x8ce5('0x45')]=[{'all':!![]}];}return db[_0x8ce5('0x30')][_0x8ce5('0x46')](_0x478a2c);})['then'](function(_0x429098){_0x39447d['rows']=_0x429098;return _0x39447d;})[_0x8ce5('0x11')](respondWithFilteredResult(_0x2c4aeb,_0x478a2c))[_0x8ce5('0x1c')](handleError(_0x2c4aeb,null));};exports[_0x8ce5('0x47')]=function(_0x58289f,_0x532e33){var _0x11c839={'raw':![],'where':{'id':_0x58289f[_0x8ce5('0x48')]['id']},'include':[{'model':db[_0x8ce5('0x2e')],'as':_0x8ce5('0x2f')}]},_0x216363={};_0x216363[_0x8ce5('0x3a')]=_['keys'](db['ChatWebsite'][_0x8ce5('0x31')]);_0x216363['query']=_[_0x8ce5('0x49')](_0x58289f[_0x8ce5('0x36')]);_0x216363[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x216363[_0x8ce5('0x3a')],_0x216363[_0x8ce5('0x36')]);_0x11c839['attributes']=_[_0x8ce5('0x38')](_0x216363[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x58289f[_0x8ce5('0x36')]['fields']));_0x11c839[_0x8ce5('0x39')]=_0x11c839['attributes'][_0x8ce5('0x3c')]?_0x11c839['attributes']:_0x216363[_0x8ce5('0x3a')];if(_0x58289f[_0x8ce5('0x36')][_0x8ce5('0x44')]){_0x11c839[_0x8ce5('0x45')]=[{'all':!![]}];}_0x11c839=_['merge']({},_0x11c839,_0x58289f[_0x8ce5('0x4a')]);return db[_0x8ce5('0x30')][_0x8ce5('0x4b')](_0x11c839)[_0x8ce5('0x11')](handleEntityNotFound(_0x532e33,null))[_0x8ce5('0x11')](respondWithResult(_0x532e33,null))['catch'](handleError(_0x532e33,null));};exports['create']=function(_0x3824bb,_0x2595f4){return db['ChatWebsite'][_0x8ce5('0x4c')](_0x3824bb[_0x8ce5('0x4d')],{})['then'](function(_0xd9e4f5){var _0x77ae6b=_0x3824bb[_0x8ce5('0x4e')][_0x8ce5('0x29')]({'plain':!![]});if(!_0x77ae6b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x77ae6b[_0x8ce5('0x4f')]===_0x8ce5('0x4e')){var _0x542ddd=_0xd9e4f5[_0x8ce5('0x29')]({'plain':!![]});var _0x44dabf=_0x8ce5('0x50');return db[_0x8ce5('0x51')][_0x8ce5('0x4b')]({'where':{'name':_0x44dabf,'userProfileId':_0x77ae6b['userProfileId']},'raw':!![]})[_0x8ce5('0x11')](function(_0x3dc0c1){if(_0x3dc0c1&&_0x3dc0c1[_0x8ce5('0x52')]===0x0){return db[_0x8ce5('0x2a')][_0x8ce5('0x4c')]({'name':_0x542ddd[_0x8ce5('0x2c')],'resourceId':_0x542ddd['id'],'type':_0x3dc0c1[_0x8ce5('0x2c')],'sectionId':_0x3dc0c1['id']},{})[_0x8ce5('0x11')](function(){return _0xd9e4f5;});}else{return _0xd9e4f5;}})[_0x8ce5('0x1c')](function(_0x4c914c){logger[_0x8ce5('0x17')](_0x8ce5('0x53'),_0x4c914c);throw _0x4c914c;});}return _0xd9e4f5;})[_0x8ce5('0x11')](respondWithResult(_0x2595f4,0xc9))[_0x8ce5('0x1c')](handleError(_0x2595f4,null));};exports[_0x8ce5('0x27')]=function(_0x2247c9,_0x35c780){if(_0x2247c9['body']['id']){delete _0x2247c9['body']['id'];}return db[_0x8ce5('0x30')]['find']({'where':{'id':_0x2247c9[_0x8ce5('0x48')]['id']},'include':[{'model':db[_0x8ce5('0x2e')],'as':_0x8ce5('0x2f')}]})[_0x8ce5('0x11')](handleEntityNotFound(_0x35c780,null))[_0x8ce5('0x11')](saveUpdates(_0x2247c9['body'],null))[_0x8ce5('0x11')](respondWithResult(_0x35c780,null))[_0x8ce5('0x1c')](handleError(_0x35c780,null));};exports['destroy']=function(_0x50d3e7,_0x3690f2){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x50d3e7[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x3690f2,null))['then'](removeEntity(_0x3690f2,null))[_0x8ce5('0x1c')](handleError(_0x3690f2,null));};exports[_0x8ce5('0x54')]=function(_0x484fa7,_0x42b4bd){return db[_0x8ce5('0x30')][_0x8ce5('0x54')]()['then'](respondWithResult(_0x42b4bd,null))['catch'](handleError(_0x42b4bd,null));};exports[_0x8ce5('0x55')]=function(_0x43ec3f,_0x57e226){if(_0x43ec3f['body']['id']){delete _0x43ec3f['body']['id'];}return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x43ec3f[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x57e226,null))[_0x8ce5('0x11')](function(_0x265dc5){if(_0x265dc5){_0x43ec3f[_0x8ce5('0x4d')]['ChatWebsiteId']=_0x265dc5['id'];return db[_0x8ce5('0x56')][_0x8ce5('0x4c')](_0x43ec3f[_0x8ce5('0x4d')]);}})[_0x8ce5('0x11')](respondWithResult(_0x57e226,null))[_0x8ce5('0x1c')](handleError(_0x57e226,null));};exports[_0x8ce5('0x57')]=function(_0x15fbbf,_0x26875c){var _0x418509={'raw':![],'where':{}};var _0x6b0713={};var _0x39873e={'count':0x0,'rows':[]};return db[_0x8ce5('0x30')][_0x8ce5('0x58')]({'where':{'id':_0x15fbbf['params']['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x26875c,null))[_0x8ce5('0x11')](function(_0x23d2e7){if(_0x23d2e7){_0x6b0713[_0x8ce5('0x3a')]=_['keys'](db[_0x8ce5('0x56')][_0x8ce5('0x31')]);_0x6b0713['query']=_[_0x8ce5('0x49')](_0x15fbbf[_0x8ce5('0x36')]);_0x6b0713[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x6b0713[_0x8ce5('0x3a')],_0x6b0713[_0x8ce5('0x36')]);_0x418509[_0x8ce5('0x39')]=_['intersection'](_0x6b0713['model'],qs[_0x8ce5('0x3b')](_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x418509[_0x8ce5('0x39')]=_0x418509[_0x8ce5('0x39')][_0x8ce5('0x3c')]?_0x418509[_0x8ce5('0x39')]:_0x6b0713[_0x8ce5('0x3a')];if(!_0x15fbbf[_0x8ce5('0x36')]['hasOwnProperty'](_0x8ce5('0x3e'))){_0x418509['limit']=qs[_0x8ce5('0x23')](_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x418509[_0x8ce5('0x21')]=qs['offset'](_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x21')]);}_0x418509[_0x8ce5('0x59')]=qs['sort'](_0x15fbbf['query'][_0x8ce5('0x3f')]);_0x418509[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x15fbbf[_0x8ce5('0x36')],_0x6b0713[_0x8ce5('0x37')]));_0x418509[_0x8ce5('0x40')]['ChatWebsiteId']=_0x23d2e7['id'];if(_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x41')]){_0x418509[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x418509[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x418509[_0x8ce5('0x39')],function(_0x10ba3e){var _0x2c7179={};_0x2c7179[_0x10ba3e]={'$like':'%'+_0x15fbbf[_0x8ce5('0x36')]['filter']+'%'};return _0x2c7179;})});}_0x418509=_[_0x8ce5('0x42')]({},_0x418509,_0x15fbbf['options']);return db['Disposition'][_0x8ce5('0x24')]({'where':_0x418509[_0x8ce5('0x40')]})[_0x8ce5('0x11')](function(_0x22cc8d){_0x39873e[_0x8ce5('0x24')]=_0x22cc8d;if(_0x15fbbf[_0x8ce5('0x36')][_0x8ce5('0x44')]){_0x418509[_0x8ce5('0x45')]=[{'all':!![]}];}return db[_0x8ce5('0x56')][_0x8ce5('0x46')](_0x418509);})[_0x8ce5('0x11')](function(_0xe07d40){_0x39873e[_0x8ce5('0x5b')]=_0xe07d40;return _0x39873e;});}})[_0x8ce5('0x11')](respondWithFilteredResult(_0x26875c,_0x418509))[_0x8ce5('0x1c')](handleError(_0x26875c,null));};exports['removeDispositions']=function(_0x5eea95,_0x28f437){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x5eea95['params']['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x28f437,null))[_0x8ce5('0x11')](function(_0x52f721){if(_0x52f721){return _0x52f721[_0x8ce5('0x5c')](_0x5eea95[_0x8ce5('0x36')][_0x8ce5('0x5d')]);}})[_0x8ce5('0x11')](respondWithStatusCode(_0x28f437,null))['catch'](handleError(_0x28f437,null));};exports[_0x8ce5('0x5e')]=function(_0x4dad8e,_0xd7b9d4){if(_0x4dad8e['body']['id']){delete _0x4dad8e[_0x8ce5('0x4d')]['id'];}return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x4dad8e[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0xd7b9d4,null))['then'](function(_0x6c98ae){if(_0x6c98ae){_0x4dad8e[_0x8ce5('0x4d')][_0x8ce5('0x5f')]=_0x6c98ae['id'];return db[_0x8ce5('0x60')][_0x8ce5('0x4c')](_0x4dad8e[_0x8ce5('0x4d')]);}})[_0x8ce5('0x11')](respondWithResult(_0xd7b9d4,null))['catch'](handleError(_0xd7b9d4,null));};exports[_0x8ce5('0x61')]=function(_0x25c83b,_0x315afc){var _0x3f234a={'raw':![],'where':{}};var _0x3cb63e={};var _0x11a148={'count':0x0,'rows':[]};return db[_0x8ce5('0x30')][_0x8ce5('0x58')]({'where':{'id':_0x25c83b[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x315afc,null))[_0x8ce5('0x11')](function(_0x1cbfaa){if(_0x1cbfaa){_0x3cb63e[_0x8ce5('0x3a')]=_[_0x8ce5('0x49')](db['CannedAnswer'][_0x8ce5('0x31')]);_0x3cb63e[_0x8ce5('0x36')]=_[_0x8ce5('0x49')](_0x25c83b[_0x8ce5('0x36')]);_0x3cb63e[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x3cb63e[_0x8ce5('0x3a')],_0x3cb63e['query']);_0x3f234a['attributes']=_[_0x8ce5('0x38')](_0x3cb63e[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x25c83b['query']['fields']));_0x3f234a[_0x8ce5('0x39')]=_0x3f234a['attributes'][_0x8ce5('0x3c')]?_0x3f234a[_0x8ce5('0x39')]:_0x3cb63e[_0x8ce5('0x3a')];if(!_0x25c83b[_0x8ce5('0x36')][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x3f234a[_0x8ce5('0x23')]=qs['limit'](_0x25c83b[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x3f234a[_0x8ce5('0x21')]=qs['offset'](_0x25c83b[_0x8ce5('0x36')]['offset']);}_0x3f234a['order']=qs[_0x8ce5('0x3f')](_0x25c83b[_0x8ce5('0x36')][_0x8ce5('0x3f')]);_0x3f234a[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x25c83b[_0x8ce5('0x36')],_0x3cb63e['filters']));_0x3f234a[_0x8ce5('0x40')][_0x8ce5('0x5f')]=_0x1cbfaa['id'];if(_0x25c83b['query']['filter']){_0x3f234a[_0x8ce5('0x40')]=_['merge'](_0x3f234a[_0x8ce5('0x40')],{'$or':_['map'](_0x3f234a['attributes'],function(_0x4ef60e){var _0xeb7e80={};_0xeb7e80[_0x4ef60e]={'$like':'%'+_0x25c83b[_0x8ce5('0x36')]['filter']+'%'};return _0xeb7e80;})});}_0x3f234a=_[_0x8ce5('0x42')]({},_0x3f234a,_0x25c83b[_0x8ce5('0x4a')]);return db[_0x8ce5('0x60')][_0x8ce5('0x24')]({'where':_0x3f234a['where']})[_0x8ce5('0x11')](function(_0x590191){_0x11a148[_0x8ce5('0x24')]=_0x590191;if(_0x25c83b['query'][_0x8ce5('0x44')]){_0x3f234a[_0x8ce5('0x45')]=[{'all':!![]}];}return db[_0x8ce5('0x60')]['findAll'](_0x3f234a);})['then'](function(_0x2ab6a0){_0x11a148[_0x8ce5('0x5b')]=_0x2ab6a0;return _0x11a148;});}})[_0x8ce5('0x11')](respondWithFilteredResult(_0x315afc,_0x3f234a))[_0x8ce5('0x1c')](handleError(_0x315afc,null));};exports[_0x8ce5('0x62')]=function(_0x58fd6e,_0x16536b){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x58fd6e[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x16536b,null))[_0x8ce5('0x11')](function(_0x54d27e){if(_0x54d27e){return _0x54d27e[_0x8ce5('0x62')](_0x58fd6e['query']['ids']);}})[_0x8ce5('0x11')](respondWithStatusCode(_0x16536b,null))[_0x8ce5('0x1c')](handleError(_0x16536b,null));};exports[_0x8ce5('0x63')]=function(_0x427cf9,_0x2a04ef){_0x427cf9['body']['sitepic']=_0x427cf9[_0x8ce5('0x64')]['filename'];return db[_0x8ce5('0x30')]['find']({'where':{'id':_0x427cf9[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a04ef,null))[_0x8ce5('0x11')](saveUpdates(_0x427cf9[_0x8ce5('0x4d')],null))[_0x8ce5('0x11')](respondWithResult(_0x2a04ef,null))[_0x8ce5('0x1c')](handleError(_0x2a04ef,null));};exports['addAvatar']=function(_0x30a858,_0x438a49){_0x30a858[_0x8ce5('0x4d')][_0x8ce5('0x65')]=_0x30a858[_0x8ce5('0x64')][_0x8ce5('0x66')];return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x30a858[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x438a49,null))[_0x8ce5('0x11')](saveUpdates(_0x30a858[_0x8ce5('0x4d')],null))['then'](respondWithResult(_0x438a49,null))[_0x8ce5('0x1c')](handleError(_0x438a49,null));};exports[_0x8ce5('0x67')]=function(_0x1fb2ff,_0x10918a){_0x1fb2ff[_0x8ce5('0x4d')]['customerAvatar']=_0x1fb2ff[_0x8ce5('0x64')][_0x8ce5('0x66')];return db['ChatWebsite'][_0x8ce5('0x4b')]({'where':{'id':_0x1fb2ff[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x10918a,null))[_0x8ce5('0x11')](saveUpdates(_0x1fb2ff['body'],null))['then'](respondWithResult(_0x10918a,null))['catch'](handleError(_0x10918a,null));};exports['addSystemAvatar']=function(_0x4f5ec3,_0x21b225){_0x4f5ec3['body']['systemAvatar']=_0x4f5ec3[_0x8ce5('0x64')]['filename'];return db['ChatWebsite'][_0x8ce5('0x4b')]({'where':{'id':_0x4f5ec3[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x21b225,null))[_0x8ce5('0x11')](saveUpdates(_0x4f5ec3['body'],null))[_0x8ce5('0x11')](respondWithResult(_0x21b225,null))[_0x8ce5('0x1c')](handleError(_0x21b225,null));};exports[_0x8ce5('0x68')]=function(_0x17e796,_0xe88aab){var _0x1d34c7=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x6b'));var _0xd63bd3={'where':{'id':_0x17e796[_0x8ce5('0x48')]['id']},'attributes':['id',_0x8ce5('0x6c')],'raw':!![]};var _0x407867=![];return require('../../config/license/util')['getLicense']()[_0x8ce5('0x11')](function(_0x4f4621){if(_0x4f4621){_0x407867=_0x4f4621[_0x8ce5('0x6d')];}})[_0x8ce5('0x11')](function(){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')](_0xd63bd3);})['then'](handleEntityNotFound(_0xe88aab,null))[_0x8ce5('0x11')](function(_0x7a6a81){if(_0x7a6a81){if(!_[_0x8ce5('0x6e')](_0x7a6a81[_0x8ce5('0x6c')])){if(fs['existsSync'](path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],'server/files/images/logos/',_0x7a6a81[_0x8ce5('0x6c')]))&&_0x407867){_0x1d34c7=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],'server/files/images/logos/',_0x7a6a81[_0x8ce5('0x6c')]);}}return _0xe88aab['download'](_0x1d34c7);}})['catch'](handleError(_0xe88aab,null));};exports[_0x8ce5('0x6f')]=function(_0x3128d5,_0x206c46){var _0x46370d=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],'server/files/images/avatars/default_avatar.png');var _0x2e4a0a={'where':{'id':_0x3128d5[_0x8ce5('0x48')]['id']},'attributes':['id',_0x8ce5('0x65')],'raw':!![]};return db[_0x8ce5('0x30')][_0x8ce5('0x4b')](_0x2e4a0a)[_0x8ce5('0x11')](handleEntityNotFound(_0x206c46,null))[_0x8ce5('0x11')](function(_0x426fd2){if(_0x426fd2){if(!_[_0x8ce5('0x6e')](_0x426fd2[_0x8ce5('0x65')])){if(fs[_0x8ce5('0x70')](path[_0x8ce5('0x69')](config['root'],_0x8ce5('0x71'),_0x426fd2[_0x8ce5('0x65')]))){_0x46370d=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x426fd2['agentAvatar']);}}return _0x206c46[_0x8ce5('0x72')](_0x46370d);}})['catch'](handleError(_0x206c46,null));};exports[_0x8ce5('0x73')]=function(_0x457b77,_0x1c1fbc){var _0x558d1=path['join'](config['root'],_0x8ce5('0x74'));var _0x23f84b={'where':{'id':_0x457b77['params']['id']},'attributes':['id',_0x8ce5('0x75'),_0x8ce5('0x76')],'raw':!![]};return db['ChatWebsite']['find'](_0x23f84b)[_0x8ce5('0x11')](handleEntityNotFound(_0x1c1fbc,null))[_0x8ce5('0x11')](function(_0x3003ce){if(_0x3003ce){if(!_[_0x8ce5('0x6e')](_0x3003ce['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x3003ce[_0x8ce5('0x75')]))&&_0x3003ce[_0x8ce5('0x76')]){_0x558d1=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x3003ce[_0x8ce5('0x75')]);}}return _0x1c1fbc['download'](_0x558d1);}})[_0x8ce5('0x1c')](handleError(_0x1c1fbc,null));};exports[_0x8ce5('0x77')]=function(_0x2baec1,_0x161008){var _0x4afd64=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x78'));var _0x947248={'where':{'id':_0x2baec1['params']['id']},'attributes':['id',_0x8ce5('0x79')],'raw':!![]};return db[_0x8ce5('0x30')][_0x8ce5('0x4b')](_0x947248)['then'](handleEntityNotFound(_0x161008,null))['then'](function(_0x3d9399){if(_0x3d9399){if(!_['isNil'](_0x3d9399[_0x8ce5('0x79')])){if(fs[_0x8ce5('0x70')](path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x3d9399['systemAvatar']))){_0x4afd64=path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0x71'),_0x3d9399[_0x8ce5('0x79')]);}}return _0x161008['download'](_0x4afd64);}})[_0x8ce5('0x1c')](handleError(_0x161008,null));};exports[_0x8ce5('0x7a')]=function(_0x86bb70,_0x4b3354){var _0x78c4af=require(_0x8ce5('0x7b'));var _0x319d89=new _0x78c4af();var _0x2d6986=_0x319d89['setUA'](_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x7d')])[_0x8ce5('0x7e')]();var _0xac2738={'body':_0x86bb70[_0x8ce5('0x4d')],'channel':'chat'};var _0xf08172=[];var _0x4bf4b4=[];var _0x2e1fe7={};var _0x2f7bec=![];return db[_0x8ce5('0x7f')]['describe']()['then'](function(_0x1b90b6){if(!_0x1b90b6){throw new db[(_0x8ce5('0x80'))]['ValidationError']('no\x20available\x20attributes');}_0xf08172=_['difference'](_['keys'](_0x1b90b6),[_0x8ce5('0x81'),_0x8ce5('0x82')]);_0x4bf4b4=_['difference'](_[_0x8ce5('0x49')](_0x1b90b6),[_0x8ce5('0x81'),_0x8ce5('0x82'),_0x8ce5('0x83'),_0x8ce5('0x84')]);if(_0x86bb70[_0x8ce5('0x4d')]['id']){delete _0x86bb70[_0x8ce5('0x4d')]['id'];}if(_[_0x8ce5('0x6e')](_0x86bb70['body'][_0x8ce5('0x85')])){throw new db[(_0x8ce5('0x80'))]['ValidationError'](_0x8ce5('0x86'));}if(_[_0x8ce5('0x6e')](_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x4d')])||_0x86bb70['body']['body']===''){throw new db['Sequelize'][(_0x8ce5('0x87'))](_0x8ce5('0x88'));}if(_[_0x8ce5('0x6e')](_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x89')])){throw new db[(_0x8ce5('0x80'))][(_0x8ce5('0x87'))](_0x8ce5('0x8a')+_0x4bf4b4);}if(!_[_0x8ce5('0x8b')](_0x4bf4b4,_0x86bb70['body'][_0x8ce5('0x89')])){throw new db[(_0x8ce5('0x80'))]['ValidationError'](_0x8ce5('0x8c')+_0x4bf4b4);}_0x2e1fe7[_0x86bb70[_0x8ce5('0x4d')]['mapKey']]=_0x86bb70['body']['from'];})['then'](function(){return db[_0x8ce5('0x30')]['find']({'where':{'id':_0x86bb70['params']['id']},'include':[{'model':db[_0x8ce5('0x8d')],'as':'List','include':[{'model':db[_0x8ce5('0x7f')],'as':_0x8ce5('0x8e'),'where':_0x2e1fe7,'limit':0x1,'order':[[_0x8ce5('0x82'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x8ce5('0x8f')}]});})['then'](handleEntityNotFound(_0x4b3354,null))[_0x8ce5('0x11')](function(_0x27f4ca){if(_0x27f4ca&&_0x27f4ca[_0x8ce5('0x90')]){_0xac2738['account']=_0x27f4ca;_0xac2738['applications']=_0x27f4ca[_0x8ce5('0x8f')];_0xac2738['list']=_0x27f4ca[_0x8ce5('0x90')];_0xac2738[_0x8ce5('0x91')]=_['orderBy'](_0xac2738['applications'],[_0x8ce5('0x92')],[_0x8ce5('0x93')]);if(_0xac2738[_0x8ce5('0x94')]['Applications']){delete _0xac2738[_0x8ce5('0x94')]['Applications'];}if(_0xac2738[_0x8ce5('0x94')]['List']&&_0xac2738['account']['List'][_0x8ce5('0x8e')][_0x8ce5('0x3c')]){return _0xac2738[_0x8ce5('0x94')][_0x8ce5('0x90')]['Contacts'][0x0];}var _0x5327b1=_[_0x8ce5('0x95')](_0x86bb70[_0x8ce5('0x4d')],{'firstName':_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x85')],'ListId':_0x27f4ca[_0x8ce5('0x84')]});_0x5327b1[_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x89')]]=_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x85')];return db[_0x8ce5('0x7f')]['create'](_0x5327b1,{'fields':_0xf08172,'raw':!![]});}})[_0x8ce5('0x11')](handleEntityNotFound(_0x4b3354,null))[_0x8ce5('0x11')](function(_0x4b732d){_0xac2738[_0x8ce5('0x96')]=_0x4b732d;var _0x52d3ae=_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x97')];if(_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x98')]){_0x52d3ae=_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x98')];}else if(_0x86bb70[_0x8ce5('0x7c')]['x-forwarded-for']){_0x52d3ae=_[_0x8ce5('0x99')](_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x9a')][_0x8ce5('0x9b')](','));}if(_0x4b732d){var _0x1eb502={'ContactId':_0x4b732d['id'],'ChatWebsiteId':_0x86bb70['params']['id'],'from':(_0x4b732d[_0x8ce5('0x9c')]||'')+'\x20'+(_0x4b732d[_0x8ce5('0x9d')]||''),'customerIp':_0x52d3ae,'customerPort':_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x9e')]?_0x86bb70[_0x8ce5('0x7c')][_0x8ce5('0x9e')]:null,'referer':_0x86bb70['body']['referer'],'browserName':_0x2d6986['browser'][_0x8ce5('0x2c')]&&_0x2d6986[_0x8ce5('0x9f')]['version']?util[_0x8ce5('0xa0')]('%s\x20%s',_0x2d6986[_0x8ce5('0x9f')][_0x8ce5('0x2c')],_0x2d6986[_0x8ce5('0x9f')][_0x8ce5('0xa1')]):_0x8ce5('0xa2'),'browserVersion':_0x2d6986[_0x8ce5('0x9f')]['version']||'unknown','osName':util[_0x8ce5('0xa0')](_0x8ce5('0xa3'),_0x2d6986['os']['name'],_0x2d6986['os'][_0x8ce5('0xa1')]),'osVersion':_0x2d6986['os']['version'],'deviceModel':_0x2d6986[_0x8ce5('0xa4')]['model']&&_0x2d6986[_0x8ce5('0xa4')][_0x8ce5('0xa5')]?util[_0x8ce5('0xa0')](_0x8ce5('0xa6'),_0x2d6986[_0x8ce5('0xa4')]['model'],_0x2d6986[_0x8ce5('0xa4')][_0x8ce5('0xa5')],_0x2d6986['device'][_0x8ce5('0x33')]):null,'deviceVendor':_0x2d6986[_0x8ce5('0xa4')]['vendor'],'deviceType':_0x2d6986[_0x8ce5('0xa4')][_0x8ce5('0x33')],'formData':JSON[_0x8ce5('0x16')](_0x86bb70[_0x8ce5('0x4d')])};var _0x5ec746={'ChatWebsiteId':_0x86bb70[_0x8ce5('0x48')]['id'],'closed':![]};if(_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xa7')]){_0x5ec746[_0x8ce5('0xa7')]=_0x86bb70[_0x8ce5('0x4d')]['threadId'];return db[_0x8ce5('0xa8')][_0x8ce5('0x4b')]({'where':_0x5ec746})['then'](function(_0xfa51d4){if(_0xfa51d4){return[_0xfa51d4,![]];}_0x1eb502[_0x8ce5('0xa7')]=_0x86bb70['body']['threadId'];_0x1eb502[_0x8ce5('0xa9')]=_0x86bb70[_0x8ce5('0x4d')]['externalUrl'];return db[_0x8ce5('0xa8')][_0x8ce5('0x4c')](_0x1eb502)['then'](function(_0xdc768a){return[_0xdc768a,!![]];});});}_0x5ec746[_0x8ce5('0xaa')]=_0x4b732d['id'];if(_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xab')]&&_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xab')]['id']){_0x5ec746['id']=_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xab')]['id'];return db['ChatInteraction'][_0x8ce5('0x4b')]({'where':_0x5ec746})[_0x8ce5('0x11')](function(_0x37f96b){if(_0x37f96b){return[_0x37f96b,![]];}return db['ChatInteraction'][_0x8ce5('0x4c')](_0x1eb502)['then'](function(_0x355d15){return[_0x355d15,!![]];});});}return db[_0x8ce5('0xa8')][_0x8ce5('0x4c')](_0x1eb502)[_0x8ce5('0x11')](function(_0xcca985){return[_0xcca985,!![]];});}})[_0x8ce5('0xac')](function(_0x5e7340,_0xb4b30){if(_0x5e7340){_0x2f7bec=_0xb4b30;if(!_0xb4b30){var _0x194841={'from':(_0xac2738[_0x8ce5('0x96')][_0x8ce5('0x9c')]||'')+'\x20'+(_0xac2738[_0x8ce5('0x96')][_0x8ce5('0x9d')]||'')};if(_0x86bb70[_0x8ce5('0x4d')]['threadId']&&_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0xad')]&&_0x86bb70[_0x8ce5('0x4d')]['threadId']!=_0x86bb70['body']['messageId']){_0x194841[_0x8ce5('0xa7')]=_0x86bb70['body'][_0x8ce5('0xad')];}return _0x5e7340[_0x8ce5('0x27')](_0x194841);}else{return _0x5e7340;}}})['then'](function(_0x3d819a){_0xac2738['interaction']=_0x3d819a[_0x8ce5('0x29')]({'plain':!![]});_0xac2738[_0x8ce5('0xab')][_0x8ce5('0xae')]=_0x2f7bec;if(_0xac2738[_0x8ce5('0xab')]['created']){if(_0xac2738['account'][_0x8ce5('0xaf')]){_0xac2738[_0x8ce5('0x91')][_0x8ce5('0xb0')]({'id':0x0,'priority':_0xac2738['applications'][_0x8ce5('0x3c')]+0x1,'app':_0x8ce5('0xb1'),'appdata':_0x8ce5('0xb2'),'interval':_0x8ce5('0xb3')});}}return db[_0x8ce5('0xb4')][_0x8ce5('0x4c')]({'body':_0x86bb70[_0x8ce5('0x4d')][_0x8ce5('0x4d')],'ChatWebsiteId':_0x86bb70[_0x8ce5('0x48')]['id'],'ChatInteractionId':_0x3d819a['id'],'direction':'in','ContactId':_0xac2738[_0x8ce5('0x96')]['id'],'AttachmentId':_0x86bb70[_0x8ce5('0x4d')]['AttachmentId']});})['then'](function(_0x1488ac){_0xac2738['message']=_0x1488ac;if(_0xac2738['interaction'][_0x8ce5('0xb5')]){return db['User'][_0x8ce5('0x4b')]({'attributes':['id',_0x8ce5('0x2c')],'where':{'id':_0xac2738[_0x8ce5('0xab')][_0x8ce5('0xb5')]}})['then'](function(_0x547f41){if(_0x547f41){_0xac2738['applications'][_0x8ce5('0xb6')]({'id':0x0,'priority':0x0,'app':_0x8ce5('0xb7'),'appdata':_0x547f41[_0x8ce5('0x2c')]+','+(_0xac2738[_0x8ce5('0x94')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0xac2738[_0x8ce5('0xb8')]=!![];}return respondWithRpcPromise(_0x8ce5('0xb9'),_0x8ce5('0xba'),_0xac2738);});}return respondWithRpcPromise(_0x8ce5('0xb9'),'startRouting',_0xac2738);})[_0x8ce5('0x11')](function(_0x24375e){respondWithRpcPromise(_0x8ce5('0xbb'),'EventManager',{'event':'notify','message':_0x24375e},client9002);return _0x24375e;})[_0x8ce5('0x11')](respondWithResult(_0x4b3354,null))[_0x8ce5('0x1c')](handleError(_0x4b3354,null));};exports[_0x8ce5('0xbc')]=function(_0xb13982,_0x483c05){var _0x176695,_0x1a8baa,_0x40071e;var _0x3a925e=[];var _0x253594={};var _0x176f95=_0xb13982[_0x8ce5('0xbd')]||[];var _0x4657e7=[];var _0x74ad30;return db[_0x8ce5('0x7f')]['describe']()['then'](function(_0x5ba893){if(!_0x5ba893){throw new db[(_0x8ce5('0x80'))][(_0x8ce5('0x87'))](_0x8ce5('0xbe'));}_0x3a925e=_[_0x8ce5('0xbf')](_[_0x8ce5('0x49')](_0x5ba893),['createdAt','updatedAt',_0x8ce5('0x83'),_0x8ce5('0x84')]);if(_0xb13982[_0x8ce5('0x4d')]['id']){delete _0xb13982['body']['id'];}if(_['isNil'](_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')])){throw _0x483c05[_0x8ce5('0x1f')](0x1f4)[_0x8ce5('0x2d')](new db[(_0x8ce5('0x80'))][(_0x8ce5('0x87'))](_0x8ce5('0x86')));}if(_['isNil'](_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x4d')])||_0xb13982[_0x8ce5('0x4d')]['body']===''){throw _0x483c05[_0x8ce5('0x1f')](0x1f4)[_0x8ce5('0x2d')](new db['Sequelize'][(_0x8ce5('0x87'))](_0x8ce5('0x88')));}if(_[_0x8ce5('0x6e')](_0xb13982[_0x8ce5('0x4d')]['mapKeyOffline'])){throw _0x483c05[_0x8ce5('0x1f')](0x1f4)[_0x8ce5('0x2d')](new db['Sequelize']['ValidationError'](_0x8ce5('0xc0')+_0x3a925e));}if(!_[_0x8ce5('0x8b')](_0x3a925e,_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0xc1')])){throw _0x483c05[_0x8ce5('0x1f')](0x1f4)['send'](new db[(_0x8ce5('0x80'))][(_0x8ce5('0x87'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3a925e));}_0x253594[_0xb13982[_0x8ce5('0x4d')]['mapKeyOffline']]=_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')];})[_0x8ce5('0x11')](function(){return db['ChatWebsite']['find']({'where':{'id':_0xb13982[_0x8ce5('0x48')]['id']},'include':[{'model':db[_0x8ce5('0x8d')],'as':_0x8ce5('0x90')},{'model':db[_0x8ce5('0xc2')],'as':_0x8ce5('0xc2')}]});})[_0x8ce5('0x11')](handleEntityNotFound(_0x483c05,null))[_0x8ce5('0x11')](function(_0x236519){if(_0x236519&&_0x236519[_0x8ce5('0x90')]){_0x1a8baa=_0x236519;var _0x499fd6=_[_0x8ce5('0x95')](_0xb13982[_0x8ce5('0x4d')],{'firstName':_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')],'phone':_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')],'ListId':_0x236519[_0x8ce5('0x84')]});_0x499fd6[_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0xc1')]]=_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x85')];return db[_0x8ce5('0x7f')][_0x8ce5('0xc3')]({'where':_0x253594,'defaults':_0x499fd6});}})[_0x8ce5('0xac')](function(_0x2a142c){if(_0x2a142c){_0x40071e=_0x2a142c;var _0x5799bb=fs[_0x8ce5('0xc4')](path['join'](config[_0x8ce5('0x6a')],_0x8ce5('0xc5')),_0x8ce5('0xc6'));var _0x33de36=ejs[_0x8ce5('0xc7')](_0x5799bb,{'body':_[_0x8ce5('0xc8')](_0xb13982[_0x8ce5('0x4d')][_0x8ce5('0x4d')]),'bodyTitle':_0x1a8baa[_0x8ce5('0xc9')]});return db[_0x8ce5('0xca')]['create']({'body':_0x33de36,'ContactId':_0x2a142c['id'],'ChatWebsiteId':_0x1a8baa['id']});}})[_0x8ce5('0x11')](function(_0x155ac6){_0x74ad30=_0x155ac6;if(_0x176f95[_0x8ce5('0x3c')]){var _0x32bc2c=_0x176f95[_0x8ce5('0x35')](function(_0x544291){return{'name':_0x544291[_0x8ce5('0xcb')],'basename':_0x544291['filename'],'type':_0x544291[_0x8ce5('0xcc')],'ChatOfflineMessageId':_0x155ac6['id']};});_0x4657e7=_0x32bc2c[_0x8ce5('0x35')](_0x512e48=>{var _0x319ab3={'filename':_0x512e48[_0x8ce5('0x2c')],'path':path[_0x8ce5('0x69')](config[_0x8ce5('0x6a')],_0x8ce5('0xcd'),_0x8ce5('0xbd'),_0x8ce5('0xce'),_0x8ce5('0xcf'),_0x512e48[_0x8ce5('0xd0')])};return _0x319ab3;});if(!_0x1a8baa[_0x8ce5('0xd1')]){return db[_0x8ce5('0xd2')][_0x8ce5('0xd3')](function(_0x586254){return db[_0x8ce5('0xd4')][_0x8ce5('0xd5')](_0x32bc2c,{'transaction':_0x586254});});}}})['then'](function(){if(_0x74ad30){_0x176695=_0x74ad30;return db[_0x8ce5('0xc2')][_0x8ce5('0x58')]({'where':{'active':!![]},'include':[{'model':db[_0x8ce5('0xd6')],'as':_0x8ce5('0xd7'),'raw':!![]}]});}})[_0x8ce5('0x11')](function(_0xc1eeb2){if(_0xc1eeb2&&_0xc1eeb2[_0x8ce5('0xd7')]&&_0x1a8baa[_0x8ce5('0xd8')]&&_0x1a8baa[_0x8ce5('0xd9')]){var _0x296e8f={'tls':{'rejectUnauthorized':![]}};if(_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0xda')]){_0x296e8f[_0x8ce5('0xda')]=_0xc1eeb2[_0x8ce5('0xd7')]['service'];}else{_0x296e8f['host']=_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0xdb')];_0x296e8f[_0x8ce5('0xdc')]=_0xc1eeb2[_0x8ce5('0xd7')]['port'];_0x296e8f['secure']=_0xc1eeb2[_0x8ce5('0xd7')]['secure'];}if(_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0xdd')]){_0x296e8f[_0x8ce5('0xde')]={'user':_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0x4e')],'pass':_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0xdf')]};}return respondWithRpcPromise(_0x8ce5('0xe0'),_0x8ce5('0xe1'),{'account':_0x296e8f,'message':{'from':util[_0x8ce5('0xa0')](_0x8ce5('0xe2'),_0xc1eeb2[_0x8ce5('0x2c')],_0xc1eeb2[_0x8ce5('0xe3')]||_0xc1eeb2[_0x8ce5('0xd7')][_0x8ce5('0x4e')]),'to':_0x1a8baa[_0x8ce5('0xd9')],'subject':_0x1a8baa['offlineMessageSubject'],'html':_0x176695[_0x8ce5('0x4d')],'attachments':_0x4657e7}},client9003)[_0x8ce5('0x11')](function(){return _0x176695;})[_0x8ce5('0x1c')](function(_0x16bf44){console[_0x8ce5('0x17')](_0x16bf44);});}})[_0x8ce5('0x11')](function(){if(_0x1a8baa&&_0x1a8baa['openNewInteraction']&&_0x1a8baa['MailAccountId']){var _0x26ae16=[];if(_0x176f95[_0x8ce5('0x3c')]){_0x26ae16=_0x176f95['map'](function(_0x6c263c){return{'name':_0x6c263c[_0x8ce5('0xcb')],'basename':_0x6c263c['filename'],'type':_0x6c263c[_0x8ce5('0xcc')],'ChatOfflineMessageId':_0x74ad30['id']};});}var _0xb4a65d;if(!_[_0x8ce5('0x6e')](_0x1a8baa['subjectOffline'])){var _0x9f7d84=_[_0x8ce5('0x35')](_0xb13982['body'],function(_0x446e2e){return _0x446e2e;});var _0x2e536c=_['toPairsIn'](_0x9f7d84)[0x0];var _0x17b7e6=_['mapValues'](_0x2e536c,function(_0x436e25){return _0x436e25;});_0xb4a65d=_0x17b7e6[0x1][_0x1a8baa[_0x8ce5('0xe4')]];}var _0x5bf15b={'from':_0x40071e[_0x8ce5('0xe3')],'firstName':_0x40071e[_0x8ce5('0x9c')],'lastName':_0x40071e['lastName'],'mapKey':_0x8ce5('0xe3'),'message':{'from':_0x40071e['email'],'to':_0x1a8baa[_0x8ce5('0xc2')][_0x8ce5('0xe3')],'cc':'','subject':_[_0x8ce5('0x6e')](_0xb4a65d)?_0x1a8baa['offlineMessageSubject']:_0xb4a65d,'messageId':'','sentAt':new Date(),'attach':_0x26ae16['length'],'attachments':_0x26ae16,'originChannel':_0x8ce5('0xe5'),'ChatWebsiteId':_0x1a8baa['id'],'ChatOfflineMessageId':_0x176695['id'],'originTo':_0x1a8baa[_0x8ce5('0xc2')][_0x8ce5('0xe3')]},'body':_0x176695[_0x8ce5('0x4d')]};var _0x20a41d={'account':{'id':_0x1a8baa['MailAccountId']},'body':_0x5bf15b,'log':_0x8ce5('0xe6')};return respondWithRpcPromise(_0x8ce5('0xe6'),_0x8ce5('0xe7'),_0x20a41d,client9001)['then'](function(){return _0x176695;})['catch'](function(_0x350501){console[_0x8ce5('0x17')](_0x350501);});}return;})['then'](function(){if(_0x176695){return _0x176695;}})[_0x8ce5('0x11')](respondWithResult(_0x483c05,null))[_0x8ce5('0x1c')](function(_0x1a52c0){console[_0x8ce5('0x17')](_0x8ce5('0x1c'),_0x1a52c0);for(var _0x2841a1 of _0x176f95){var _0x146a52=path[_0x8ce5('0x69')](config['root'],'server',_0x8ce5('0xbd'),_0x8ce5('0xce'),_0x8ce5('0xcf'),_0x2841a1[_0x8ce5('0x66')]);fs_extra[_0x8ce5('0xe8')](_0x146a52)[_0x8ce5('0x1c')](function(_0x70d81d){console[_0x8ce5('0x17')](_0x8ce5('0xe9'),_0x146a52,_0x70d81d);});}});};exports[_0x8ce5('0xea')]=function(_0x517ea0,_0x209565){return db[_0x8ce5('0xa8')][_0x8ce5('0x4b')]({'where':{'id':_0x517ea0[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x209565,null))[_0x8ce5('0x11')](function(_0x4d8831){if(_0x4d8831){return _0x4d8831[_0x8ce5('0xea')](_0x517ea0[_0x8ce5('0x4d')]['ids'],_[_0x8ce5('0xeb')](_0x517ea0[_0x8ce5('0x4d')],[_0x8ce5('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x209565,null))['catch'](handleError(_0x209565,null));};exports[_0x8ce5('0xec')]=function(_0x1776c9,_0x54dfb2){var _0x5adf25={'raw':![],'where':{}};var _0x25489f={};var _0x2e3be4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8ce5('0x58')]({'where':{'id':_0x1776c9[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x54dfb2,null))['then'](function(_0x10748a){if(_0x10748a){_0x25489f[_0x8ce5('0x3a')]=_[_0x8ce5('0x49')](db[_0x8ce5('0xa8')][_0x8ce5('0x31')]);_0x25489f[_0x8ce5('0x36')]=_[_0x8ce5('0x49')](_0x1776c9['query']);_0x25489f[_0x8ce5('0x37')]=_[_0x8ce5('0x38')](_0x25489f['model'],_0x25489f[_0x8ce5('0x36')]);_0x5adf25[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x25489f['model'],qs[_0x8ce5('0x3b')](_0x1776c9['query'][_0x8ce5('0x3b')]));_0x5adf25['attributes']=_0x5adf25['attributes'][_0x8ce5('0x3c')]?_0x5adf25[_0x8ce5('0x39')]:_0x25489f['model'];if(!_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x5adf25[_0x8ce5('0x23')]=qs[_0x8ce5('0x23')](_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x5adf25[_0x8ce5('0x21')]=qs[_0x8ce5('0x21')](_0x1776c9[_0x8ce5('0x36')]['offset']);}_0x5adf25[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x1776c9[_0x8ce5('0x36')]['sort']);_0x5adf25['where']=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x1776c9[_0x8ce5('0x36')],_0x25489f['filters']));_0x5adf25[_0x8ce5('0x40')][_0x8ce5('0x5f')]=_0x10748a['id'];if(_0x1776c9[_0x8ce5('0x36')]['filter']){_0x5adf25[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x5adf25[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x5adf25[_0x8ce5('0x39')],function(_0x3e286a){var _0x118d81={};_0x118d81[_0x3e286a]={'$like':'%'+_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x118d81;})});}_0x5adf25=_[_0x8ce5('0x42')]({},_0x5adf25,_0x1776c9['options']);return db['ChatInteraction'][_0x8ce5('0x24')]({'where':_0x5adf25[_0x8ce5('0x40')]})['then'](function(_0x56cb08){_0x2e3be4[_0x8ce5('0x24')]=_0x56cb08;if(_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0x44')]){_0x5adf25['include']=[{'model':db[_0x8ce5('0x7f')],'as':_0x8ce5('0xed'),'required':![]},{'model':db[_0x8ce5('0xee')],'as':'Owner','attributes':['name',_0x8ce5('0xef'),_0x8ce5('0xf0')],'required':![]},{'model':db[_0x8ce5('0xf1')],'as':_0x8ce5('0xf2'),'attributes':['id',_0x8ce5('0x2c'),_0x8ce5('0xf3')],'where':_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0xf4')]?{'id':_0x1776c9[_0x8ce5('0x36')][_0x8ce5('0xf4')]}:undefined,'required':_0x1776c9['query'][_0x8ce5('0xf4')]?!![]:![]}];}return db[_0x8ce5('0xa8')][_0x8ce5('0x46')](_0x5adf25);})['then'](function(_0x3447bd){_0x2e3be4[_0x8ce5('0x5b')]=_0x3447bd;return _0x2e3be4;});}})['then'](respondWithFilteredResult(_0x54dfb2,_0x5adf25))[_0x8ce5('0x1c')](handleError(_0x54dfb2,null));};function iftimePromise(_0x2e9492,_0x4f01a8){return respondWithRpcPromise(_0x8ce5('0xf5'),'getSnippet',{'command':_0x4f01a8['timezone']?util[_0x8ce5('0xa0')](_0x8ce5('0xf6'),_0x2e9492[_0x8ce5('0xf7')],_0x4f01a8[_0x8ce5('0xf8')]):util[_0x8ce5('0xa0')](_0x8ce5('0xf9'),_0x2e9492[_0x8ce5('0xf7')])},client9002)[_0x8ce5('0x11')](function(_0x10b562){var _0x5b7d45=_0x10b562&&_0x10b562[_0x8ce5('0xfa')]('true')>=0x0?!![]:![];logger[_0x8ce5('0x12')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4f01a8['id'],_0x2e9492['id'],_0x2e9492['interval'],_0x5b7d45?_0x8ce5('0xfb'):_0x8ce5('0xfc'),_0x4f01a8[_0x8ce5('0xf8')]?_0x4f01a8['timezone']:_0x8ce5('0xfd'));return _0x5b7d45;})[_0x8ce5('0x1c')](function(_0x340a8a){logger[_0x8ce5('0x17')](_0x8ce5('0xfe'),_0x4f01a8['id'],_0x2e9492['id'],_0x2e9492['interval'],util[_0x8ce5('0xff')](_0x340a8a,{'showHidden':![],'depth':null}),_0x4f01a8[_0x8ce5('0xf8')]?_0x4f01a8[_0x8ce5('0xf8')]:_0x8ce5('0xfd'));return![];});}exports[_0x8ce5('0x100')]=function(_0x146737,_0x2f0aaf){var _0x1b8afa=0x0;var _0x428735=0x0;var _0x33f780=![];var _0x4b439a;var _0x3f54a3;return db['ChatWebsite'][_0x8ce5('0x4b')]({'where':{'id':_0x146737[_0x8ce5('0x48')]['id']},'include':[{'model':db[_0x8ce5('0x101')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x8ce5('0x102'),'attributes':['id',_0x8ce5('0xf7')],'raw':!![]}]}]})[_0x8ce5('0x11')](handleEntityNotFound(_0x2f0aaf,null))['then'](function(_0x35218d){if(_0x35218d){_0x4b439a=_0x35218d;return _0x35218d[_0x8ce5('0x103')]({'raw':!![]});}})['then'](function(_0x412289){if(_0x4b439a){if(_0x412289){_0x3f54a3=_0x412289;}}return require(_0x8ce5('0x104'))[_0x8ce5('0x105')]();})['then'](function(_0x2b166d){if(_0x2b166d){_0x428735=_0x2b166d['virtual'];_0x33f780=_0x2b166d[_0x8ce5('0x6d')];}})[_0x8ce5('0x11')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x509967){_0x1b8afa=_0x509967;if(_0x428735&&_0x509967>_0x428735){return db[_0x8ce5('0x106')]['findOne']({'where':{'id':0x1}})[_0x8ce5('0x11')](function(_0x4739d9){if(_0x4739d9){_0x4739d9['increment']('chatLicenseExceeded');}});}})[_0x8ce5('0x11')](function(){if(_0x4b439a['Interval']&&_0x4b439a['Interval'][_0x8ce5('0x102')]){var _0x22f4be=[];for(var _0x53b785=0x0;_0x53b785<_0x4b439a['Interval'][_0x8ce5('0x102')][_0x8ce5('0x3c')];_0x53b785++){var _0x20427c=_0x4b439a[_0x8ce5('0x101')][_0x8ce5('0x102')][_0x53b785]['get']({'plain':!![]});_0x22f4be[_0x8ce5('0xb0')](iftimePromise(_0x20427c,_0x4b439a));}return BPromise[_0x8ce5('0x107')](_0x22f4be)['then'](function(_0xf0d2ad){return _[_0x8ce5('0x108')](_0xf0d2ad);});}else{return!![];}})[_0x8ce5('0x11')](function(_0x309520){var _0x37511a=fs['readFileSync'](path['join'](config[_0x8ce5('0x6a')],_0x8ce5('0x109')),_0x8ce5('0xc6'));var _0x2a33d3={'remote':_0x4b439a[_0x8ce5('0x10a')],'query':querystring['stringify'](_[_0x8ce5('0x42')](_0x4b439a[_0x8ce5('0x29')]({'plain':!![]}),{'customerIp':_0x146737[_0x8ce5('0x7c')]['x-forwarded-for']||_0x146737[_0x8ce5('0x7c')][_0x8ce5('0x10b')]||_0x146737[_0x8ce5('0x10c')]['remoteAddress']||_0x146737['ip'],'referer':_0x146737[_0x8ce5('0x7c')][_0x8ce5('0x10d')],'openedInteractions':_0x1b8afa,'maxInteractions':_0x428735,'virtual':_0x33f780['virtual'],'online':_0x309520,'custom':_0x33f780}))[_0x8ce5('0x10e')](/'/g,'\x5c\x27')};_0x2f0aaf[_0x8ce5('0x2d')](ejs['render'](Mustache[_0x8ce5('0xc7')](_0x37511a,_0x2a33d3),{'proactiveActions':_0x3f54a3,'alignment':_0x4b439a[_0x8ce5('0x10f')],'verticalAlignment':_0x4b439a[_0x8ce5('0x110')],'div_color':_0x4b439a[_0x8ce5('0xf3')],'labelText':_0x4b439a[_0x8ce5('0x111')],'text_color':_0x4b439a[_0x8ce5('0x112')],'button_color':_0x4b439a[_0x8ce5('0x113')],'background_color':_0x4b439a[_0x8ce5('0x114')]}));})['catch'](handleError(_0x2f0aaf,null));};exports[_0x8ce5('0x115')]=function(_0x2424eb,_0x281850){var _0xfbb735=_0x2424eb[_0x8ce5('0x48')]['id'];var _0x9c7a5e=_0x2424eb[_0x8ce5('0x4d')];var _0x337eef=0xc8;var _0x29d589=null;return db[_0x8ce5('0xd2')][_0x8ce5('0xd3')]({'isolationLevel':db[_0x8ce5('0xd2')][_0x8ce5('0x116')][_0x8ce5('0x117')][_0x8ce5('0x118')]},function(_0x1174e7){return db[_0x8ce5('0x30')][_0x8ce5('0x58')]({'where':{'id':_0xfbb735},'transaction':_0x1174e7})[_0x8ce5('0x11')](function(_0xe43a07){if(_0xe43a07){return db[_0x8ce5('0x119')][_0x8ce5('0x28')]({'where':{'ChatWebsiteId':_0xfbb735},'transaction':_0x1174e7})[_0x8ce5('0x11')](function(){var _0x6fcde6=_[_0x8ce5('0x35')](_0x9c7a5e,function(_0x4ab365){_0x4ab365['ChatWebsiteId']=_0xfbb735;return _0x4ab365;});return db[_0x8ce5('0x119')]['bulkCreate'](_0x6fcde6,{'transaction':_0x1174e7});});}else{_0x337eef=0x194;_0x29d589=[];}});})['then'](function(){if(_0x337eef!==0x194){return db[_0x8ce5('0x119')][_0x8ce5('0x11a')]({'where':{'ChatWebsiteId':_0xfbb735},'order':_0x8ce5('0x92')})['then'](function(_0x2bb26c){_0x29d589=_0x2bb26c;});}})[_0x8ce5('0x1c')](function(_0x4b3ddf){_0x337eef=0x1f4;logger[_0x8ce5('0x17')](_0x4b3ddf[_0x8ce5('0x2b')]);if(_0x4b3ddf[_0x8ce5('0x2c')]){delete _0x4b3ddf[_0x8ce5('0x2c')];}_0x29d589=_0x4b3ddf;})[_0x8ce5('0x11b')](function(){if(_0x29d589===null){_0x281850[_0x8ce5('0x1d')](_0x337eef);}else{if(_0x337eef===0x1f4){_0x281850[_0x8ce5('0x1f')](_0x337eef)[_0x8ce5('0x2d')](_0x29d589);}else{_0x281850[_0x8ce5('0x1f')](_0x337eef)[_0x8ce5('0x20')](_0x29d589);}}});};exports['getApplications']=function(_0x3fe09e,_0xae4332){var _0x188a7f={};var _0x1c9841={};var _0x47ceef;var _0x4f04a3;return db[_0x8ce5('0x30')][_0x8ce5('0x58')]({'where':{'id':_0x3fe09e[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0xae4332,null))['then'](function(_0x237abd){if(_0x237abd){_0x47ceef=_0x237abd;_0x1c9841['model']=_[_0x8ce5('0x49')](db[_0x8ce5('0x119')][_0x8ce5('0x31')]);_0x1c9841['query']=_['keys'](_0x3fe09e['query']);_0x1c9841['filters']=_[_0x8ce5('0x38')](_0x1c9841[_0x8ce5('0x3a')],_0x1c9841[_0x8ce5('0x36')]);_0x188a7f[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x1c9841[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x188a7f[_0x8ce5('0x39')]=_0x188a7f[_0x8ce5('0x39')]['length']?_0x188a7f['attributes']:_0x1c9841['model'];_0x188a7f[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x3fe09e['query'][_0x8ce5('0x3f')]);_0x188a7f[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x3fe09e[_0x8ce5('0x36')],_0x1c9841[_0x8ce5('0x37')]));if(_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x41')]){_0x188a7f[_0x8ce5('0x40')]=_['merge'](_0x188a7f[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x188a7f[_0x8ce5('0x39')],function(_0x2a3f17){var _0x1b118d={};_0x1b118d[_0x2a3f17]={'$like':'%'+_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x1b118d;})});}_0x188a7f=_[_0x8ce5('0x42')]({},_0x188a7f,_0x3fe09e['options']);return _0x47ceef['getApplications'](_0x188a7f);}})[_0x8ce5('0x11')](function(_0x5398c){if(_0x5398c){_0x4f04a3=_0x5398c['length'];if(!_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x3d')]('nolimit')){_0x188a7f[_0x8ce5('0x23')]=qs[_0x8ce5('0x23')](_0x3fe09e[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x188a7f['offset']=qs[_0x8ce5('0x21')](_0x3fe09e['query']['offset']);}return _0x47ceef[_0x8ce5('0x11c')](_0x188a7f);}})['then'](function(_0x585a09){if(_0x585a09){return _0x585a09?{'count':_0x4f04a3,'rows':_0x585a09}:null;}})['then'](respondWithResult(_0xae4332,null))[_0x8ce5('0x1c')](handleError(_0xae4332,null));};exports[_0x8ce5('0x11d')]=function(_0x304b41,_0x147357){return db[_0x8ce5('0x11e')]['find']({'where':{'id':_0x304b41[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x147357,null))[_0x8ce5('0x11')](function(_0x3a0700){if(_0x3a0700){return _0x3a0700['addProactiveActions'](_0x304b41[_0x8ce5('0x4d')]['ids'],_['omit'](_0x304b41[_0x8ce5('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x147357,null))[_0x8ce5('0x1c')](handleError(_0x147357,null));};exports[_0x8ce5('0x103')]=function(_0x16a04e,_0x2d285d){var _0x36b574={};var _0x55c7ee={};var _0x689ff5;var _0x4b14a0;return db['ChatWebsite'][_0x8ce5('0x58')]({'where':{'id':_0x16a04e[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x2d285d,null))['then'](function(_0x26e4e2){if(_0x26e4e2){_0x689ff5=_0x26e4e2;_0x55c7ee['model']=_['keys'](db['ChatProactiveAction'][_0x8ce5('0x31')]);_0x55c7ee['query']=_['keys'](_0x16a04e[_0x8ce5('0x36')]);_0x55c7ee['filters']=_[_0x8ce5('0x38')](_0x55c7ee[_0x8ce5('0x3a')],_0x55c7ee[_0x8ce5('0x36')]);_0x36b574[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x55c7ee[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x36b574[_0x8ce5('0x39')]=_0x36b574[_0x8ce5('0x39')][_0x8ce5('0x3c')]?_0x36b574['attributes']:_0x55c7ee[_0x8ce5('0x3a')];_0x36b574[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x16a04e[_0x8ce5('0x36')]['sort']);_0x36b574[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x16a04e[_0x8ce5('0x36')],_0x55c7ee['filters']));if(_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x41')]){_0x36b574[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x36b574['where'],{'$or':_['map'](_0x36b574[_0x8ce5('0x39')],function(_0x31725f){var _0x1fb829={};_0x1fb829[_0x31725f]={'$like':'%'+_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x1fb829;})});}_0x36b574=_['merge']({},_0x36b574,_0x16a04e[_0x8ce5('0x4a')]);return _0x689ff5[_0x8ce5('0x103')](_0x36b574);}})[_0x8ce5('0x11')](function(_0x22699c){if(_0x22699c){_0x4b14a0=_0x22699c[_0x8ce5('0x3c')];if(!_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x36b574[_0x8ce5('0x23')]=qs['limit'](_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x36b574[_0x8ce5('0x21')]=qs[_0x8ce5('0x21')](_0x16a04e[_0x8ce5('0x36')][_0x8ce5('0x21')]);}return _0x689ff5[_0x8ce5('0x103')](_0x36b574);}})[_0x8ce5('0x11')](function(_0x21c55f){if(_0x21c55f){return _0x21c55f?{'count':_0x4b14a0,'rows':_0x21c55f}:null;}})[_0x8ce5('0x11')](respondWithResult(_0x2d285d,null))[_0x8ce5('0x1c')](handleError(_0x2d285d,null));};exports['getFields']=function(_0x22980a,_0x2b157f){var _0x163889=_0x22980a[_0x8ce5('0x36')]['online']===_0x8ce5('0x11f')?_0x8ce5('0x120'):'onlineForm';return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'attributes':['id',_0x163889],'where':{'id':_0x22980a['params']['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x2b157f,null))['then'](function(_0x5883c3){if(_0x5883c3){var _0x1d0ead=_0x5883c3[_0x163889];var _0x492782=_0x1d0ead&&_0x1d0ead[_0x8ce5('0x121')]?_0x1d0ead[_0x8ce5('0x121')]:[];_0x2b157f[_0x8ce5('0x2d')]({'fromKey':_[_0x8ce5('0x6e')](_0x1d0ead[_0x8ce5('0x122')])?undefined:_0x1d0ead['fromKey'],'count':_0x492782[_0x8ce5('0x3c')],'rows':_0x492782});}})[_0x8ce5('0x1c')](handleError(_0x2b157f,null));};exports[_0x8ce5('0x123')]=function(_0x5256de,_0xd9c926){var _0x270f00={'raw':![],'where':{}};var _0x146289={};var _0x423df8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8ce5('0x58')]({'where':{'id':_0x5256de[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0xd9c926,null))[_0x8ce5('0x11')](function(_0x372a34){if(_0x372a34){_0x146289[_0x8ce5('0x3a')]=_[_0x8ce5('0x49')](db[_0x8ce5('0xca')][_0x8ce5('0x31')]);_0x146289[_0x8ce5('0x36')]=_[_0x8ce5('0x49')](_0x5256de[_0x8ce5('0x36')]);_0x146289['filters']=_[_0x8ce5('0x38')](_0x146289['model'],_0x146289['query']);_0x270f00[_0x8ce5('0x39')]=_['intersection'](_0x146289[_0x8ce5('0x3a')],qs['fields'](_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x3b')]));_0x270f00[_0x8ce5('0x39')]=_0x270f00[_0x8ce5('0x39')][_0x8ce5('0x3c')]?_0x270f00['attributes']:_0x146289[_0x8ce5('0x3a')];if(!_0x5256de[_0x8ce5('0x36')]['hasOwnProperty'](_0x8ce5('0x3e'))){_0x270f00[_0x8ce5('0x23')]=qs['limit'](_0x5256de['query']['limit']);_0x270f00[_0x8ce5('0x21')]=qs[_0x8ce5('0x21')](_0x5256de['query'][_0x8ce5('0x21')]);}_0x270f00[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x3f')]);_0x270f00[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_[_0x8ce5('0x5a')](_0x5256de['query'],_0x146289[_0x8ce5('0x37')]));_0x270f00[_0x8ce5('0x40')][_0x8ce5('0x5f')]=_0x372a34['id'];if(_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x41')]){_0x270f00[_0x8ce5('0x40')]=_[_0x8ce5('0x42')](_0x270f00['where'],{'$or':_[_0x8ce5('0x35')](_0x270f00[_0x8ce5('0x39')],function(_0x3a3ace){var _0x3b7eb7={};_0x3b7eb7[_0x3a3ace]={'$like':'%'+_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x3b7eb7;})});}_0x270f00=_['merge']({},_0x270f00,_0x5256de[_0x8ce5('0x4a')]);return db[_0x8ce5('0xca')][_0x8ce5('0x24')]({'where':_0x270f00['where']})[_0x8ce5('0x11')](function(_0x195ed8){_0x423df8[_0x8ce5('0x24')]=_0x195ed8;if(_0x5256de[_0x8ce5('0x36')][_0x8ce5('0x44')]){_0x270f00[_0x8ce5('0x45')]=[{'all':!![]}];}else{_0x270f00[_0x8ce5('0x45')]=[{'model':db[_0x8ce5('0x7f')],'as':_0x8ce5('0xed'),'required':![]},{'model':db[_0x8ce5('0xd4')],'as':_0x8ce5('0x124'),'required':![]}];}return db[_0x8ce5('0xca')][_0x8ce5('0x46')](_0x270f00);})['then'](function(_0x558958){_0x423df8[_0x8ce5('0x5b')]=_0x558958;return _0x423df8;});}})['then'](respondWithFilteredResult(_0xd9c926,_0x270f00))[_0x8ce5('0x1c')](handleError(_0xd9c926,null));};exports[_0x8ce5('0x125')]=function(_0x4a0393,_0x9cb84){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x4a0393[_0x8ce5('0x48')]['id']}})['then'](handleEntityNotFound(_0x9cb84,null))[_0x8ce5('0x11')](function(_0x41e921){if(_0x41e921){return _0x41e921['addAgents'](_0x4a0393[_0x8ce5('0x4d')][_0x8ce5('0x5d')],_['omit'](_0x4a0393[_0x8ce5('0x4d')],[_0x8ce5('0x5d'),'id'])||{})[_0x8ce5('0xac')](function(_0x25b9d9){for(var _0x514079=0x0;_0x514079<_0x4a0393[_0x8ce5('0x4d')]['ids'][_0x8ce5('0x3c')];_0x514079+=0x1){socket[_0x8ce5('0x126')](_0x8ce5('0x127'),{'UserId':Number(_0x4a0393[_0x8ce5('0x4d')][_0x8ce5('0x5d')][_0x514079]),'ChatWebsiteId':Number(_0x4a0393[_0x8ce5('0x48')]['id'])});}return _0x25b9d9;});}})[_0x8ce5('0x11')](respondWithResult(_0x9cb84,null))['catch'](handleError(_0x9cb84,null));};exports[_0x8ce5('0x128')]=function(_0x2dd111,_0x5bfac0){return db[_0x8ce5('0x30')][_0x8ce5('0x4b')]({'where':{'id':_0x2dd111[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x5bfac0,null))[_0x8ce5('0x11')](function(_0xd96ac7){if(_0xd96ac7){return _0xd96ac7[_0x8ce5('0x128')](_0x2dd111[_0x8ce5('0x36')][_0x8ce5('0x5d')])['then'](function(){if(_['isArray'](_0x2dd111['query'][_0x8ce5('0x5d')])){for(var _0xf1e9d=0x0;_0xf1e9d<_0x2dd111[_0x8ce5('0x36')]['ids'][_0x8ce5('0x3c')];_0xf1e9d+=0x1){socket[_0x8ce5('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x2dd111[_0x8ce5('0x36')]['ids'][_0xf1e9d]),'ChatWebsiteId':Number(_0x2dd111[_0x8ce5('0x48')]['id'])});}}else{socket['emit'](_0x8ce5('0x129'),{'UserId':Number(_0x2dd111[_0x8ce5('0x36')]['ids']),'ChatWebsiteId':Number(_0x2dd111[_0x8ce5('0x48')]['id'])});}});}})[_0x8ce5('0x11')](respondWithStatusCode(_0x5bfac0,null))[_0x8ce5('0x1c')](handleError(_0x5bfac0,null));};exports['getAgents']=function(_0x2d63e7,_0x1ce5e3){var _0x3e6d04={};var _0x50a06f={};var _0x55eaf4;var _0xe6753;return db['ChatWebsite'][_0x8ce5('0x58')]({'where':{'id':_0x2d63e7[_0x8ce5('0x48')]['id']}})[_0x8ce5('0x11')](handleEntityNotFound(_0x1ce5e3,null))[_0x8ce5('0x11')](function(_0x54bda2){if(_0x54bda2){_0x55eaf4=_0x54bda2;_0x50a06f[_0x8ce5('0x3a')]=_[_0x8ce5('0x49')](db['User'][_0x8ce5('0x31')]);_0x50a06f[_0x8ce5('0x36')]=_[_0x8ce5('0x49')](_0x2d63e7[_0x8ce5('0x36')]);_0x50a06f['filters']=_[_0x8ce5('0x38')](_0x50a06f[_0x8ce5('0x3a')],_0x50a06f['query']);_0x3e6d04[_0x8ce5('0x39')]=_[_0x8ce5('0x38')](_0x50a06f[_0x8ce5('0x3a')],qs[_0x8ce5('0x3b')](_0x2d63e7['query']['fields']));_0x3e6d04['attributes']=_0x3e6d04['attributes'][_0x8ce5('0x3c')]?_0x3e6d04[_0x8ce5('0x39')]:_0x50a06f[_0x8ce5('0x3a')];_0x3e6d04[_0x8ce5('0x59')]=qs[_0x8ce5('0x3f')](_0x2d63e7[_0x8ce5('0x36')]['sort']);_0x3e6d04[_0x8ce5('0x40')]=qs[_0x8ce5('0x37')](_['pick'](_0x2d63e7['query'],_0x50a06f[_0x8ce5('0x37')]));if(_0x2d63e7['query'][_0x8ce5('0x41')]){_0x3e6d04[_0x8ce5('0x40')]=_['merge'](_0x3e6d04[_0x8ce5('0x40')],{'$or':_[_0x8ce5('0x35')](_0x3e6d04['attributes'],function(_0x59a77f){var _0x4cf9c1={};_0x4cf9c1[_0x59a77f]={'$like':'%'+_0x2d63e7[_0x8ce5('0x36')][_0x8ce5('0x41')]+'%'};return _0x4cf9c1;})});}_0x3e6d04=_['merge']({},_0x3e6d04,_0x2d63e7[_0x8ce5('0x4a')]);return _0x55eaf4[_0x8ce5('0x12a')](_0x3e6d04);}})[_0x8ce5('0x11')](function(_0x573520){if(_0x573520){_0xe6753=_0x573520[_0x8ce5('0x3c')];if(!_0x2d63e7['query'][_0x8ce5('0x3d')](_0x8ce5('0x3e'))){_0x3e6d04['limit']=qs[_0x8ce5('0x23')](_0x2d63e7[_0x8ce5('0x36')][_0x8ce5('0x23')]);_0x3e6d04[_0x8ce5('0x21')]=qs[_0x8ce5('0x21')](_0x2d63e7[_0x8ce5('0x36')]['offset']);}return _0x55eaf4[_0x8ce5('0x12a')](_0x3e6d04);}})['then'](function(_0x84b31f){if(_0x84b31f){return _0x84b31f?{'count':_0xe6753,'rows':_0x84b31f}:null;}})[_0x8ce5('0x11')](respondWithResult(_0x1ce5e3,null))['catch'](handleError(_0x1ce5e3,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index b8a68d9..a7ea573 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 _0xea81=['remove','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x13b9d0,_0x29ba8d){var _0x42c59c=function(_0x4b79b5){while(--_0x4b79b5){_0x13b9d0['push'](_0x13b9d0['shift']());}};_0x42c59c(++_0x29ba8d);}(_0xea81,0x1ed));var _0x1ea8=function(_0x47b3ff,_0x44b244){_0x47b3ff=_0x47b3ff-0x0;var _0x37289d=_0xea81[_0x47b3ff];return _0x37289d;};'use strict';var EventEmitter=require(_0x1ea8('0x0'));var ChatWebsite=require(_0x1ea8('0x1'))['db'][_0x1ea8('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1ea8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1ea8('0x4')};function emitEvent(_0x8f20e2){return function(_0x2e6a47,_0x298375,_0x292a48){ChatWebsiteEvents['emit'](_0x8f20e2+':'+_0x2e6a47['id'],_0x2e6a47);ChatWebsiteEvents['emit'](_0x8f20e2,_0x2e6a47);_0x292a48(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x1ea8('0x5')](e,emitEvent(event));}}module[_0x1ea8('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x56a4=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x1c5275,_0x4bbabd){var _0x3c4297=function(_0x3c3786){while(--_0x3c3786){_0x1c5275['push'](_0x1c5275['shift']());}};_0x3c4297(++_0x4bbabd);}(_0x56a4,0x11b));var _0x456a=function(_0x1f0213,_0x3c3c9e){_0x1f0213=_0x1f0213-0x0;var _0x2048c4=_0x56a4[_0x1f0213];return _0x2048c4;};'use strict';var EventEmitter=require(_0x456a('0x0'));var ChatWebsite=require(_0x456a('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x456a('0x2')](0x0);var events={'afterCreate':_0x456a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x26a7c6){return function(_0x3a11ee,_0x143999,_0x1c904){ChatWebsiteEvents[_0x456a('0x4')](_0x26a7c6+':'+_0x3a11ee['id'],_0x3a11ee);ChatWebsiteEvents['emit'](_0x26a7c6,_0x3a11ee);_0x1c904(null);};}for(var e in events){if(events[_0x456a('0x5')](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 5d53c15..da2fa9d 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 _0x4d84=['moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','define','chat_websites','lodash','util','../../config/logger','api'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4d84,0x104));var _0x44d8=function(_0x18849b,_0x530b07){_0x18849b=_0x18849b-0x0;var _0x23b2df=_0x4d84[_0x18849b];return _0x23b2df;};'use strict';var _=require(_0x44d8('0x0'));var util=require(_0x44d8('0x1'));var logger=require(_0x44d8('0x2'))(_0x44d8('0x3'));var moment=require(_0x44d8('0x4'));var BPromise=require(_0x44d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44d8('0x6'));var rimraf=require(_0x44d8('0x7'));var config=require(_0x44d8('0x8'));var attributes=require(_0x44d8('0x9'));module['exports']=function(_0x15fe59,_0x1c67e3){return _0x15fe59[_0x44d8('0xa')]('ChatWebsite',attributes,{'tableName':_0x44d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0781=['bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','api','moment'];(function(_0x3fa13c,_0x3f108f){var _0x18fae2=function(_0x2ab137){while(--_0x2ab137){_0x3fa13c['push'](_0x3fa13c['shift']());}};_0x18fae2(++_0x3f108f);}(_0x0781,0xa3));var _0x1078=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0781[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1078('0x0'));var moment=require(_0x1078('0x1'));var BPromise=require(_0x1078('0x2'));var rp=require(_0x1078('0x3'));var fs=require('fs');var path=require(_0x1078('0x4'));var rimraf=require(_0x1078('0x5'));var config=require('../../config/environment');var attributes=require(_0x1078('0x6'));module[_0x1078('0x7')]=function(_0x4345f8,_0x1db0e5){return _0x4345f8[_0x1078('0x8')](_0x1078('0x9'),attributes,{'tableName':_0x1078('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 9b995fa..e9037fa 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 _0xd77a=['localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xd77a,0x131));var _0xad77=function(_0xe94020,_0x409805){_0xe94020=_0xe94020-0x0;var _0x4191b5=_0xd77a[_0xe94020];return _0x4191b5;};'use strict';var _=require('lodash');var util=require(_0xad77('0x0'));var moment=require(_0xad77('0x1'));var BPromise=require(_0xad77('0x2'));var rs=require(_0xad77('0x3'));var fs=require('fs');var Redis=require(_0xad77('0x4'));var db=require(_0xad77('0x5'))['db'];var utils=require(_0xad77('0x6'));var logger=require(_0xad77('0x7'))('rpc');var config=require(_0xad77('0x8'));var jayson=require(_0xad77('0x9'));var client=jayson[_0xad77('0xa')][_0xad77('0xb')]({'port':0x232a});config[_0xad77('0xc')]=_[_0xad77('0xd')](config[_0xad77('0xc')],{'host':_0xad77('0xe'),'port':0x18eb});var socket=require(_0xad77('0xf'))(new Redis(config[_0xad77('0xc')]));require(_0xad77('0x10'))[_0xad77('0x11')](socket);function respondWithRpcPromise(_0x997970,_0x41bfc5,_0x42325b){return new BPromise(function(_0x413533,_0x515c50){return client[_0xad77('0x12')](_0x997970,_0x42325b)['then'](function(_0xefaf9b){logger[_0xad77('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x41bfc5,_0xad77('0x14'));logger['debug'](_0xad77('0x15'),_0x41bfc5,_0xad77('0x14'),JSON[_0xad77('0x16')](_0xefaf9b));if(_0xefaf9b[_0xad77('0x17')]){if(_0xefaf9b[_0xad77('0x17')][_0xad77('0x18')]===0x1f4){logger[_0xad77('0x17')](_0xad77('0x19'),_0x41bfc5,_0xefaf9b[_0xad77('0x17')]['message']);return _0x515c50(_0xefaf9b[_0xad77('0x17')][_0xad77('0x1a')]);}logger[_0xad77('0x17')](_0xad77('0x19'),_0x41bfc5,_0xefaf9b['error'][_0xad77('0x1a')]);return _0x413533(_0xefaf9b[_0xad77('0x17')][_0xad77('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x41bfc5,_0xad77('0x14'));_0x413533(_0xefaf9b[_0xad77('0x1b')][_0xad77('0x1a')]);}})[_0xad77('0x1c')](function(_0x561981){logger[_0xad77('0x17')](_0xad77('0x19'),_0x41bfc5,_0x561981);_0x515c50(_0x561981);});});}
\ No newline at end of file
+var _0x4503=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./chatWebsite.socket','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','catch','util'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4503,0x67));var _0x3450=function(_0x55b362,_0x1966c1){_0x55b362=_0x55b362-0x0;var _0x2467a1=_0x4503[_0x55b362];return _0x2467a1;};'use strict';var _=require('lodash');var util=require(_0x3450('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3450('0x1'));var fs=require('fs');var Redis=require(_0x3450('0x2'));var db=require(_0x3450('0x3'))['db'];var utils=require(_0x3450('0x4'));var logger=require(_0x3450('0x5'))(_0x3450('0x6'));var config=require(_0x3450('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3450('0x8')][_0x3450('0x9')]({'port':0x232a});config['redis']=_[_0x3450('0xa')](config[_0x3450('0xb')],{'host':_0x3450('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3450('0xb')]));require(_0x3450('0xd'))[_0x3450('0xe')](socket);function respondWithRpcPromise(_0x974cd7,_0x171b36,_0x153928){return new BPromise(function(_0x1610c5,_0xc30a95){return client[_0x3450('0xf')](_0x974cd7,_0x153928)[_0x3450('0x10')](function(_0xd2307d){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x171b36,_0x3450('0x11'));logger[_0x3450('0x12')](_0x3450('0x13'),_0x171b36,_0x3450('0x11'),JSON[_0x3450('0x14')](_0xd2307d));if(_0xd2307d[_0x3450('0x15')]){if(_0xd2307d['error']['code']===0x1f4){logger[_0x3450('0x15')](_0x3450('0x16'),_0x171b36,_0xd2307d['error'][_0x3450('0x17')]);return _0xc30a95(_0xd2307d[_0x3450('0x15')][_0x3450('0x17')]);}logger[_0x3450('0x15')](_0x3450('0x16'),_0x171b36,_0xd2307d[_0x3450('0x15')][_0x3450('0x17')]);return _0x1610c5(_0xd2307d['error'][_0x3450('0x17')]);}else{logger[_0x3450('0x18')](_0x3450('0x16'),_0x171b36,_0x3450('0x11'));_0x1610c5(_0xd2307d['result']['message']);}})[_0x3450('0x19')](function(_0x273c48){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x171b36,_0x273c48);_0xc30a95(_0x273c48);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index b0658a9..74cf458 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 _0xcdf5=['chatWebsite:','./chatWebsite.events','save','remove','emit','register','length'];(function(_0x3bab62,_0xb3b36d){var _0x1d8987=function(_0x172ff6){while(--_0x172ff6){_0x3bab62['push'](_0x3bab62['shift']());}};_0x1d8987(++_0xb3b36d);}(_0xcdf5,0x1c8));var _0x5cdf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcdf5[_0x5b644e];return _0x49c6bf;};'use strict';var ChatWebsiteEvents=require(_0x5cdf('0x0'));var events=[_0x5cdf('0x1'),_0x5cdf('0x2'),'update'];function createListener(_0x5e5f1b,_0x1666b7){return function(_0x5ac7ce){_0x1666b7[_0x5cdf('0x3')](_0x5e5f1b,_0x5ac7ce);};}function removeListener(_0x5b53bb,_0x228182){return function(){ChatWebsiteEvents['removeListener'](_0x5b53bb,_0x228182);};}exports[_0x5cdf('0x4')]=function(_0x494f0d){for(var _0x12191f=0x0,_0xb2145a=events[_0x5cdf('0x5')];_0x12191f<_0xb2145a;_0x12191f++){var _0x19997a=events[_0x12191f];var _0x4c5861=createListener(_0x5cdf('0x6')+_0x19997a,_0x494f0d);ChatWebsiteEvents['on'](_0x19997a,_0x4c5861);}};
\ No newline at end of file
+var _0x5e3c=['emit','removeListener','register','./chatWebsite.events','save','remove','update'];(function(_0x1b120e,_0x42bcd4){var _0x18d6b4=function(_0x5ccfa8){while(--_0x5ccfa8){_0x1b120e['push'](_0x1b120e['shift']());}};_0x18d6b4(++_0x42bcd4);}(_0x5e3c,0x106));var _0xc5e3=function(_0x28d9e1,_0x4fac68){_0x28d9e1=_0x28d9e1-0x0;var _0x3e6c20=_0x5e3c[_0x28d9e1];return _0x3e6c20;};'use strict';var ChatWebsiteEvents=require(_0xc5e3('0x0'));var events=[_0xc5e3('0x1'),_0xc5e3('0x2'),_0xc5e3('0x3')];function createListener(_0xbfe53,_0x37069a){return function(_0x4febec){_0x37069a[_0xc5e3('0x4')](_0xbfe53,_0x4febec);};}function removeListener(_0x57e298,_0x492144){return function(){ChatWebsiteEvents[_0xc5e3('0x5')](_0x57e298,_0x492144);};}exports[_0xc5e3('0x6')]=function(_0x1aecd4){for(var _0x3a0491=0x0,_0x312626=events['length'];_0x3a0491<_0x312626;_0x3a0491++){var _0x40504c=events[_0x3a0491];var _0x27cf37=createListener('chatWebsite:'+_0x40504c,_0x1aecd4);ChatWebsiteEvents['on'](_0x40504c,_0x27cf37);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index cc72a64..4c37fa4 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 _0x4258=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','join','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','root','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x4258,0x118));var _0x8425=function(_0x2f2376,_0x20f9f5){_0x2f2376=_0x2f2376-0x0;var _0x174600=_0x4258[_0x2f2376];return _0x174600;};'use strict';var multer=require(_0x8425('0x0'));var util=require('util');var path=require(_0x8425('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8425('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8425('0x3'));var interaction=require(_0x8425('0x4'));var config=require(_0x8425('0x5'));var controller=require(_0x8425('0x6'));router[_0x8425('0x7')]('/',auth[_0x8425('0x8')](),controller[_0x8425('0x9')]);router[_0x8425('0x7')](_0x8425('0xa'),auth['isAuthenticated'](),controller[_0x8425('0xb')]);router[_0x8425('0x7')](_0x8425('0xc'),auth[_0x8425('0x8')](),controller[_0x8425('0xd')]);router[_0x8425('0x7')](_0x8425('0xe'),auth['isAuthenticated'](),controller[_0x8425('0xf')]);router['get']('/:id/canned_answers',auth[_0x8425('0x8')](),controller[_0x8425('0x10')]);router[_0x8425('0x7')](_0x8425('0x11'),controller['getLogo']);router[_0x8425('0x7')]('/:id/avatar',controller[_0x8425('0x12')]);router[_0x8425('0x7')](_0x8425('0x13'),controller[_0x8425('0x14')]);router[_0x8425('0x7')]('/:id/system_avatar',controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x8425('0x8')](),controller[_0x8425('0x15')]);router[_0x8425('0x7')](_0x8425('0x16'),controller[_0x8425('0x17')]);router[_0x8425('0x7')](_0x8425('0x18'),auth[_0x8425('0x8')](),controller[_0x8425('0x19')]);router[_0x8425('0x7')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x8425('0x7')](_0x8425('0x1a'),controller[_0x8425('0x1b')]);router[_0x8425('0x7')](_0x8425('0x1c'),auth[_0x8425('0x8')](),controller['getOfflineMessages']);router[_0x8425('0x7')](_0x8425('0x1d'),auth['isAuthenticated'](),controller[_0x8425('0x1e')]);router[_0x8425('0x1f')]('/',auth[_0x8425('0x8')](),controller[_0x8425('0x20')]);router[_0x8425('0x1f')]('/:id/dispositions',auth[_0x8425('0x8')](),controller[_0x8425('0x21')]);router[_0x8425('0x1f')](_0x8425('0x22'),auth[_0x8425('0x8')](),controller[_0x8425('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x317713,_0x255de2,_0x24b8aa){_0x24b8aa(null,path[_0x8425('0x24')](config['root'],_0x8425('0x25')));},'filename':function(_0x2b0065,_0x590c08,_0x543c1e){_0x543c1e(null,util[_0x8425('0x26')](_0x8425('0x27'),Date[_0x8425('0x28')](),_0x590c08[_0x8425('0x29')]));}})});router[_0x8425('0x1f')](_0x8425('0x11'),upload[_0x8425('0x2a')](_0x8425('0x2b')),controller[_0x8425('0x2c')]);var upload=multer({'storage':multer[_0x8425('0x2d')]({'destination':function(_0x52a7e3,_0x5e44e8,_0x418001){_0x418001(null,path[_0x8425('0x24')](config[_0x8425('0x2e')],_0x8425('0x2f')));},'filename':function(_0x5deb7a,_0x42bc34,_0x213621){_0x213621(null,util[_0x8425('0x26')](_0x8425('0x27'),Date[_0x8425('0x28')](),_0x42bc34[_0x8425('0x29')]));}})});router['post']('/:id/avatar',upload[_0x8425('0x2a')](_0x8425('0x2b')),controller[_0x8425('0x30')]);var upload=multer({'storage':multer[_0x8425('0x2d')]({'destination':function(_0x1ae6b0,_0x2283ec,_0x42f3bb){_0x42f3bb(null,path['join'](config[_0x8425('0x2e')],_0x8425('0x2f')));},'filename':function(_0x1fae26,_0x32b710,_0x4e5901){_0x4e5901(null,util['format'](_0x8425('0x27'),Date[_0x8425('0x28')](),_0x32b710[_0x8425('0x29')]));}})});router[_0x8425('0x1f')](_0x8425('0x13'),upload[_0x8425('0x2a')](_0x8425('0x2b')),controller[_0x8425('0x31')]);var upload=multer({'storage':multer[_0x8425('0x2d')]({'destination':function(_0x23f7e5,_0x346e75,_0xc153b6){_0xc153b6(null,path[_0x8425('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x2ff0df,_0x4aa811,_0x347e85){_0x347e85(null,util[_0x8425('0x26')](_0x8425('0x27'),Date[_0x8425('0x28')](),_0x4aa811[_0x8425('0x29')]));}})});router[_0x8425('0x1f')]('/:id/system_avatar',upload[_0x8425('0x2a')]('file'),controller['addSystemAvatar']);router[_0x8425('0x1f')](_0x8425('0x32'),controller[_0x8425('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x8425('0x2d')]({'destination':function(_0x59c998,_0x38839a,_0x575d62){const _0x4b17fd=path['join'](config[_0x8425('0x2e')],_0x8425('0x34'),'attachments',_0x8425('0x35'));fs_extra[_0x8425('0x36')](_0x4b17fd,function(){_0x575d62(null,_0x4b17fd);});},'filename':function(_0x446c62,_0x150dc8,_0x272a93){const _0x477e9d=_0x150dc8[_0x8425('0x29')][_0x8425('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1bf27c=path['extname'](_0x477e9d);const _0x2552c4=Date[_0x8425('0x28')]()+'-'+_0x477e9d[_0x8425('0x37')](_0x1bf27c,'')+_0x1bf27c;_0x272a93(null,_0x2552c4);}})});router[_0x8425('0x1f')](_0x8425('0x38'),offlineUploadMulter[_0x8425('0x39')](),controller[_0x8425('0x3a')]);router[_0x8425('0x1f')](_0x8425('0x3b'),auth[_0x8425('0x8')](),controller[_0x8425('0x3c')]);router[_0x8425('0x1f')](_0x8425('0x18'),auth[_0x8425('0x8')](),controller[_0x8425('0x3d')]);router[_0x8425('0x1f')](_0x8425('0x3e'),auth[_0x8425('0x8')](),controller[_0x8425('0x3f')]);router[_0x8425('0x1f')](_0x8425('0x1d'),auth['isAuthenticated'](),controller[_0x8425('0x40')]);router[_0x8425('0x41')]('/:id',auth[_0x8425('0x8')](),controller[_0x8425('0x42')]);router[_0x8425('0x43')](_0x8425('0xc'),auth['isAuthenticated'](),controller[_0x8425('0x44')]);router[_0x8425('0x43')](_0x8425('0xe'),auth[_0x8425('0x8')](),controller[_0x8425('0x45')]);router['delete'](_0x8425('0x22'),auth[_0x8425('0x8')](),controller[_0x8425('0x46')]);router[_0x8425('0x43')](_0x8425('0x1d'),auth[_0x8425('0x8')](),controller['removeAgents']);module[_0x8425('0x47')]=router;
\ No newline at end of file
+var _0x0c87=['ensureDir','replace','offline','addInteraction','addProactiveActions','put','update','delete','removeAnswers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','/:id/notify','notify','server/files'];(function(_0x409cc2,_0x3d45e7){var _0x4e8b68=function(_0x420dbe){while(--_0x420dbe){_0x409cc2['push'](_0x409cc2['shift']());}};_0x4e8b68(++_0x3d45e7);}(_0x0c87,0x8a));var _0x70c8=function(_0x5a81e0,_0xc3b682){_0x5a81e0=_0x5a81e0-0x0;var _0x337051=_0x0c87[_0x5a81e0];return _0x337051;};'use strict';var multer=require('multer');var util=require(_0x70c8('0x0'));var path=require(_0x70c8('0x1'));var timeout=require(_0x70c8('0x2'));var express=require(_0x70c8('0x3'));var router=express['Router']();var fs_extra=require(_0x70c8('0x4'));var auth=require(_0x70c8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x70c8('0x6'));var controller=require(_0x70c8('0x7'));router[_0x70c8('0x8')]('/',auth[_0x70c8('0x9')](),controller[_0x70c8('0xa')]);router[_0x70c8('0x8')](_0x70c8('0xb'),auth[_0x70c8('0x9')](),controller[_0x70c8('0xc')]);router[_0x70c8('0x8')](_0x70c8('0xd'),auth[_0x70c8('0x9')](),controller['show']);router[_0x70c8('0x8')](_0x70c8('0xe'),auth['isAuthenticated'](),controller[_0x70c8('0xf')]);router[_0x70c8('0x8')](_0x70c8('0x10'),auth[_0x70c8('0x9')](),controller['getAnswers']);router[_0x70c8('0x8')](_0x70c8('0x11'),controller[_0x70c8('0x12')]);router['get'](_0x70c8('0x13'),controller[_0x70c8('0x14')]);router[_0x70c8('0x8')](_0x70c8('0x15'),controller[_0x70c8('0x16')]);router['get'](_0x70c8('0x17'),controller['getSystemAvatar']);router[_0x70c8('0x8')](_0x70c8('0x18'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x19')]);router['get'](_0x70c8('0x1a'),controller[_0x70c8('0x1b')]);router['get'](_0x70c8('0x1c'),auth['isAuthenticated'](),controller[_0x70c8('0x1d')]);router[_0x70c8('0x8')](_0x70c8('0x1e'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x1f')]);router[_0x70c8('0x8')]('/:id/fields',controller[_0x70c8('0x20')]);router[_0x70c8('0x8')]('/:id/offline_messages',auth[_0x70c8('0x9')](),controller[_0x70c8('0x21')]);router[_0x70c8('0x8')](_0x70c8('0x22'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x23')]);router['post']('/',auth['isAuthenticated'](),controller[_0x70c8('0x24')]);router[_0x70c8('0x25')](_0x70c8('0xe'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x26')]);router[_0x70c8('0x25')](_0x70c8('0x10'),auth[_0x70c8('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12c650,_0x55f236,_0xde99c0){_0xde99c0(null,path[_0x70c8('0x27')](config[_0x70c8('0x28')],_0x70c8('0x29')));},'filename':function(_0x95fcfc,_0x52e20a,_0x588dfb){_0x588dfb(null,util[_0x70c8('0x2a')]('%s-%s',Date[_0x70c8('0x2b')](),_0x52e20a[_0x70c8('0x2c')]));}})});router[_0x70c8('0x25')](_0x70c8('0x11'),upload[_0x70c8('0x2d')](_0x70c8('0x2e')),controller[_0x70c8('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5eada5,_0x59ceac,_0xd2c054){_0xd2c054(null,path[_0x70c8('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x40935f,_0x3780ee,_0x1225aa){_0x1225aa(null,util['format']('%s-%s',Date[_0x70c8('0x2b')](),_0x3780ee['originalname']));}})});router['post']('/:id/avatar',upload[_0x70c8('0x2d')](_0x70c8('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x70c8('0x30')]({'destination':function(_0x1593ae,_0x38aabb,_0x4b1a04){_0x4b1a04(null,path[_0x70c8('0x27')](config[_0x70c8('0x28')],_0x70c8('0x31')));},'filename':function(_0x379a62,_0x4c248f,_0x55d9c1){_0x55d9c1(null,util[_0x70c8('0x2a')]('%s-%s',Date['now'](),_0x4c248f['originalname']));}})});router[_0x70c8('0x25')](_0x70c8('0x15'),upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x20e574,_0x2a64ad,_0xd7cad2){_0xd7cad2(null,path[_0x70c8('0x27')](config[_0x70c8('0x28')],_0x70c8('0x31')));},'filename':function(_0x320b35,_0x1caa9c,_0x30ba86){_0x30ba86(null,util[_0x70c8('0x2a')](_0x70c8('0x32'),Date[_0x70c8('0x2b')](),_0x1caa9c[_0x70c8('0x2c')]));}})});router[_0x70c8('0x25')](_0x70c8('0x17'),upload[_0x70c8('0x2d')](_0x70c8('0x2e')),controller['addSystemAvatar']);router['post'](_0x70c8('0x33'),controller[_0x70c8('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x70c8('0x30')]({'destination':function(_0x2f15a5,_0x2e4eee,_0x2d94dc){const _0x580c0e=path[_0x70c8('0x27')](config[_0x70c8('0x28')],_0x70c8('0x35'),'attachments','offline-chat');fs_extra[_0x70c8('0x36')](_0x580c0e,function(){_0x2d94dc(null,_0x580c0e);});},'filename':function(_0x157270,_0x1e2d3e,_0x17df67){const _0x5e2d30=_0x1e2d3e['originalname'][_0x70c8('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5af5f0=path['extname'](_0x5e2d30);const _0x47e233=Date[_0x70c8('0x2b')]()+'-'+_0x5e2d30[_0x70c8('0x37')](_0x5af5f0,'')+_0x5af5f0;_0x17df67(null,_0x47e233);}})});router[_0x70c8('0x25')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x70c8('0x38')]);router['post'](_0x70c8('0x18'),auth['isAuthenticated'](),controller[_0x70c8('0x39')]);router[_0x70c8('0x25')](_0x70c8('0x1c'),auth[_0x70c8('0x9')](),controller['addApplications']);router['post'](_0x70c8('0x1e'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x3a')]);router[_0x70c8('0x25')]('/:id/users',auth[_0x70c8('0x9')](),controller['addAgents']);router[_0x70c8('0x3b')](_0x70c8('0xd'),auth[_0x70c8('0x9')](),controller[_0x70c8('0x3c')]);router[_0x70c8('0x3d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x70c8('0x3d')](_0x70c8('0xe'),auth[_0x70c8('0x9')](),controller['removeDispositions']);router[_0x70c8('0x3d')](_0x70c8('0x10'),auth['isAuthenticated'](),controller[_0x70c8('0x3e')]);router['delete'](_0x70c8('0x22'),auth[_0x70c8('0x9')](),controller['removeAgents']);module[_0x70c8('0x3f')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 6413224..94ffce8 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 _0x7722=['STRING','ENUM','AmazonAWS','Google','sequelize','exports'];(function(_0x2f421b,_0x170048){var _0x5ebb64=function(_0x2b9b65){while(--_0x2b9b65){_0x2f421b['push'](_0x2f421b['shift']());}};_0x5ebb64(++_0x170048);}(_0x7722,0x14e));var _0x2772=function(_0x5cb03d,_0x337c8e){_0x5cb03d=_0x5cb03d-0x0;var _0x11e7d=_0x7722[_0x5cb03d];return _0x11e7d;};'use strict';var Sequelize=require(_0x2772('0x0'));module[_0x2772('0x1')]={'name':{'type':Sequelize[_0x2772('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2772('0x3')](_0x2772('0x4'),_0x2772('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2772('0x2')]},'data2':{'type':Sequelize[_0x2772('0x2')]}};
\ No newline at end of file
+var _0x631c=['ENUM','AmazonAWS','STRING','sequelize','exports'];(function(_0x512588,_0x352902){var _0x3d0d1e=function(_0x5e32ce){while(--_0x5e32ce){_0x512588['push'](_0x512588['shift']());}};_0x3d0d1e(++_0x352902);}(_0x631c,0x1b6));var _0xc631=function(_0x597cb2,_0x2b78a7){_0x597cb2=_0x597cb2-0x0;var _0x4bc732=_0x631c[_0x597cb2];return _0x4bc732;};'use strict';var Sequelize=require(_0xc631('0x0'));module[_0xc631('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc631('0x2')](_0xc631('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xc631('0x4')]},'data2':{'type':Sequelize[_0xc631('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ed2d0f4..82bea4d 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xadb5,0xad));var _0x5adb=function(_0x52e035,_0x592898){_0x52e035=_0x52e035-0x0;var _0x8c07ee=_0xadb5[_0x52e035];return _0x8c07ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
+var _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','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','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x46a137,_0x3be24d){var _0xbcba75=function(_0x44cac3){while(--_0x44cac3){_0x46a137['push'](_0x46a137['shift']());}};_0xbcba75(++_0x3be24d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x0b0e[_0x27c068];return _0xe5a67f;};'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'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 28ebcf1..67aaa49 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 _0xdfaa=['rimraf','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x1ee161,_0x324229){var _0x288cf6=function(_0x555d2f){while(--_0x555d2f){_0x1ee161['push'](_0x1ee161['shift']());}};_0x288cf6(++_0x324229);}(_0xdfaa,0x1e9));var _0xadfa=function(_0x22927d,_0x5214d4){_0x22927d=_0x22927d-0x0;var _0x517939=_0xdfaa[_0x22927d];return _0x517939;};'use strict';var _=require(_0xadfa('0x0'));var util=require(_0xadfa('0x1'));var logger=require(_0xadfa('0x2'))(_0xadfa('0x3'));var moment=require('moment');var BPromise=require(_0xadfa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xadfa('0x5'));var rimraf=require(_0xadfa('0x6'));var config=require('../../config/environment');var attributes=require(_0xadfa('0x7'));module[_0xadfa('0x8')]=function(_0x14d709,_0x364a06){return _0x14d709[_0xadfa('0x9')](_0xadfa('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x60bf=['cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','CloudProvider'];(function(_0x524b59,_0x2584f4){var _0x41cc8f=function(_0x3b8ee9){while(--_0x3b8ee9){_0x524b59['push'](_0x524b59['shift']());}};_0x41cc8f(++_0x2584f4);}(_0x60bf,0x1a5));var _0xf60b=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x60bf[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0xf60b('0x0'));var util=require(_0xf60b('0x1'));var logger=require(_0xf60b('0x2'))(_0xf60b('0x3'));var moment=require(_0xf60b('0x4'));var BPromise=require(_0xf60b('0x5'));var rp=require(_0xf60b('0x6'));var fs=require('fs');var path=require(_0xf60b('0x7'));var rimraf=require(_0xf60b('0x8'));var config=require('../../config/environment');var attributes=require(_0xf60b('0x9'));module['exports']=function(_0xeff023,_0x5a8b36){return _0xeff023['define'](_0xf60b('0xa'),attributes,{'tableName':_0xf60b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 2b4ebd2..c3d37c4 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 _0xa064=['stringify','error','message','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x58bdae,_0xd4a4f){var _0x226c2a=function(_0x59234b){while(--_0x59234b){_0x58bdae['push'](_0x58bdae['shift']());}};_0x226c2a(++_0xd4a4f);}(_0xa064,0x192));var _0x4a06=function(_0x4f11cb,_0x14e174){_0x4f11cb=_0x4f11cb-0x0;var _0x491488=_0xa064[_0x4f11cb];return _0x491488;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var moment=require(_0x4a06('0x2'));var BPromise=require(_0x4a06('0x3'));var rs=require(_0x4a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a06('0x5'));var logger=require('../../config/logger')(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a06('0x8')][_0x4a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d4e3,_0x3b01cc,_0x454574){return new BPromise(function(_0x4c966b,_0x5e3342){return client[_0x4a06('0xa')](_0x55d4e3,_0x454574)[_0x4a06('0xb')](function(_0x3a8db5){logger[_0x4a06('0xc')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));logger[_0x4a06('0xe')](_0x4a06('0xf'),_0x3b01cc,_0x4a06('0xd'),JSON[_0x4a06('0x10')](_0x3a8db5));if(_0x3a8db5[_0x4a06('0x11')]){if(_0x3a8db5[_0x4a06('0x11')]['code']===0x1f4){logger[_0x4a06('0x11')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);return _0x5e3342(_0x3a8db5[_0x4a06('0x11')]['message']);}logger[_0x4a06('0x11')](_0x4a06('0x13'),_0x3b01cc,_0x3a8db5[_0x4a06('0x11')]['message']);return _0x4c966b(_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);}else{logger[_0x4a06('0xc')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));_0x4c966b(_0x3a8db5[_0x4a06('0x14')][_0x4a06('0x12')]);}})[_0x4a06('0x15')](function(_0x15b067){logger['error'](_0x4a06('0x13'),_0x3b01cc,_0x15b067);_0x5e3342(_0x15b067);});});}
\ No newline at end of file
+var _0xcefd=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0xcefd,0x126));var _0xdcef=function(_0x29969b,_0x2982c4){_0x29969b=_0x29969b-0x0;var _0x16bdad=_0xcefd[_0x29969b];return _0x16bdad;};'use strict';var _=require(_0xdcef('0x0'));var util=require(_0xdcef('0x1'));var moment=require(_0xdcef('0x2'));var BPromise=require('bluebird');var rs=require(_0xdcef('0x3'));var fs=require('fs');var Redis=require(_0xdcef('0x4'));var db=require(_0xdcef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdcef('0x6'))(_0xdcef('0x7'));var config=require(_0xdcef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdcef('0x9')][_0xdcef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fb1b7,_0x3260fe,_0x53e707){return new BPromise(function(_0x56ee48,_0x8b30d4){return client[_0xdcef('0xb')](_0x3fb1b7,_0x53e707)[_0xdcef('0xc')](function(_0x5d601b){logger[_0xdcef('0xd')](_0xdcef('0xe'),_0x3260fe,_0xdcef('0xf'));logger[_0xdcef('0x10')](_0xdcef('0x11'),_0x3260fe,_0xdcef('0xf'),JSON['stringify'](_0x5d601b));if(_0x5d601b['error']){if(_0x5d601b[_0xdcef('0x12')][_0xdcef('0x13')]===0x1f4){logger['error'](_0xdcef('0xe'),_0x3260fe,_0x5d601b['error']['message']);return _0x8b30d4(_0x5d601b[_0xdcef('0x12')][_0xdcef('0x14')]);}logger[_0xdcef('0x12')](_0xdcef('0xe'),_0x3260fe,_0x5d601b[_0xdcef('0x12')][_0xdcef('0x14')]);return _0x56ee48(_0x5d601b[_0xdcef('0x12')][_0xdcef('0x14')]);}else{logger[_0xdcef('0xd')](_0xdcef('0xe'),_0x3260fe,_0xdcef('0xf'));_0x56ee48(_0x5d601b[_0xdcef('0x15')]['message']);}})[_0xdcef('0x16')](function(_0x4dd058){logger[_0xdcef('0x12')](_0xdcef('0xe'),_0x3260fe,_0x4dd058);_0x8b30d4(_0x4dd058);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 60e18f4..4eb3f7d 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 _0x594e=['show','isAuthenticated','put','update','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x54b73a,_0x2afab9){var _0x3b87ff=function(_0x297046){while(--_0x297046){_0x54b73a['push'](_0x54b73a['shift']());}};_0x3b87ff(++_0x2afab9);}(_0x594e,0x11e));var _0xe594=function(_0x50cc18,_0x1b2df4){_0x50cc18=_0x50cc18-0x0;var _0x59f3c7=_0x594e[_0x50cc18];return _0x59f3c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe594('0x0'));var timeout=require('connect-timeout');var express=require(_0xe594('0x1'));var router=express['Router']();var fs_extra=require(_0xe594('0x2'));var auth=require(_0xe594('0x3'));var interaction=require(_0xe594('0x4'));var config=require(_0xe594('0x5'));var controller=require('./cloudProvider.controller');router[_0xe594('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe594('0x6')](_0xe594('0x7'),auth['isAuthenticated'](),controller[_0xe594('0x8')]);router['post']('/',auth[_0xe594('0x9')](),controller['create']);router[_0xe594('0xa')](_0xe594('0x7'),auth['isAuthenticated'](),controller[_0xe594('0xb')]);router['delete'](_0xe594('0x7'),auth['isAuthenticated'](),controller[_0xe594('0xc')]);module[_0xe594('0xd')]=router;
\ No newline at end of file
+var _0x10ad=['update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x12256d,_0x455511){var _0x440df1=function(_0x55af65){while(--_0x55af65){_0x12256d['push'](_0x12256d['shift']());}};_0x440df1(++_0x455511);}(_0x10ad,0xf4));var _0xd10a=function(_0x5ce2e7,_0x2611f0){_0x5ce2e7=_0x5ce2e7-0x0;var _0x35d0d6=_0x10ad[_0x5ce2e7];return _0x35d0d6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd10a('0x0'));var express=require('express');var router=express[_0xd10a('0x1')]();var fs_extra=require(_0xd10a('0x2'));var auth=require(_0xd10a('0x3'));var interaction=require(_0xd10a('0x4'));var config=require('../../config/environment');var controller=require(_0xd10a('0x5'));router[_0xd10a('0x6')]('/',auth[_0xd10a('0x7')](),controller[_0xd10a('0x8')]);router[_0xd10a('0x6')](_0xd10a('0x9'),auth[_0xd10a('0x7')](),controller[_0xd10a('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd10a('0xb')]);router['put'](_0xd10a('0x9'),auth[_0xd10a('0x7')](),controller[_0xd10a('0xc')]);router[_0xd10a('0xd')]('/:id',auth[_0xd10a('0x7')](),controller[_0xd10a('0xe')]);module[_0xd10a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 5a478cc..3d73717 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 _0x8530=['name','exports','STRING'];(function(_0x31d721,_0x463ef8){var _0x2608d6=function(_0x2d6ebc){while(--_0x2d6ebc){_0x31d721['push'](_0x31d721['shift']());}};_0x2608d6(++_0x463ef8);}(_0x8530,0xf7));var _0x0853=function(_0x297e62,_0x3b2cd6){_0x297e62=_0x297e62-0x0;var _0x4da028=_0x8530[_0x297e62];return _0x4da028;};'use strict';var Sequelize=require('sequelize');module[_0x0853('0x0')]={'name':{'type':Sequelize[_0x0853('0x1')],'unique':_0x0853('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x0853('0x1')]},'website':{'type':Sequelize[_0x0853('0x1')]},'phone':{'type':Sequelize[_0x0853('0x1')]},'fax':{'type':Sequelize[_0x0853('0x1')]},'type':{'type':Sequelize[_0x0853('0x1')]},'street':{'type':Sequelize[_0x0853('0x1')]},'postalCode':{'type':Sequelize[_0x0853('0x1')]},'city':{'type':Sequelize[_0x0853('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0853('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0853('0x1')]},'sStreet':{'type':Sequelize[_0x0853('0x1')]},'sPostalCode':{'type':Sequelize[_0x0853('0x1')]},'sCity':{'type':Sequelize[_0x0853('0x1')]},'sCountry':{'type':Sequelize[_0x0853('0x1')]},'description':{'type':Sequelize[_0x0853('0x1')]}};
\ No newline at end of file
+var _0x15b3=['STRING','sequelize','exports','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x15b3,0x17d));var _0x315b=function(_0x42d683,_0x398322){_0x42d683=_0x42d683-0x0;var _0x41a563=_0x15b3[_0x42d683];return _0x41a563;};'use strict';var Sequelize=require(_0x315b('0x0'));module[_0x315b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x315b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x315b('0x3')]},'website':{'type':Sequelize[_0x315b('0x3')]},'phone':{'type':Sequelize[_0x315b('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x315b('0x3')]},'street':{'type':Sequelize[_0x315b('0x3')]},'postalCode':{'type':Sequelize[_0x315b('0x3')]},'city':{'type':Sequelize[_0x315b('0x3')]},'country':{'type':Sequelize[_0x315b('0x3')]},'email':{'type':Sequelize[_0x315b('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x315b('0x3')]},'sStreet':{'type':Sequelize[_0x315b('0x3')]},'sPostalCode':{'type':Sequelize[_0x315b('0x3')]},'sCity':{'type':Sequelize[_0x315b('0x3')]},'sCountry':{'type':Sequelize[_0x315b('0x3')]},'description':{'type':Sequelize[_0x315b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 14ec369..88df92b 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 _0x7faa=['options','includeAll','include','rows','catch','show','rawAttributes','create','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','Companies','UserProfileResource','error','stack','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map'];(function(_0x81f738,_0x576329){var _0xe6b18c=function(_0x30c5e4){while(--_0x30c5e4){_0x81f738['push'](_0x81f738['shift']());}};_0xe6b18c(++_0x576329);}(_0x7faa,0x167));var _0xa7fa=function(_0x4eea11,_0x21db54){_0x4eea11=_0x4eea11-0x0;var _0x1c1d03=_0x7faa[_0x4eea11];return _0x1c1d03;};'use strict';var emlformat=require(_0xa7fa('0x0'));var rimraf=require(_0xa7fa('0x1'));var zipdir=require(_0xa7fa('0x2'));var jsonpatch=require(_0xa7fa('0x3'));var rp=require(_0xa7fa('0x4'));var moment=require('moment');var BPromise=require(_0xa7fa('0x5'));var Mustache=require(_0xa7fa('0x6'));var util=require(_0xa7fa('0x7'));var path=require(_0xa7fa('0x8'));var sox=require(_0xa7fa('0x9'));var csv=require(_0xa7fa('0xa'));var ejs=require(_0xa7fa('0xb'));var fs=require('fs');var fs_extra=require(_0xa7fa('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa7fa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa7fa('0xa'));var querystring=require(_0xa7fa('0xe'));var Papa=require(_0xa7fa('0xf'));var Redis=require('ioredis');var authService=require(_0xa7fa('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa7fa('0x11'));var hardwareService=require(_0xa7fa('0x12'));var logger=require('../../config/logger')(_0xa7fa('0x13'));var utils=require(_0xa7fa('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa7fa('0x15'))['db'];function respondWithStatusCode(_0x56eae3,_0x5a68e8){_0x5a68e8=_0x5a68e8||0xcc;return function(_0x195584){if(_0x195584){return _0x56eae3[_0xa7fa('0x16')](_0x5a68e8);}return _0x56eae3[_0xa7fa('0x17')](_0x5a68e8)[_0xa7fa('0x18')]();};}function respondWithResult(_0x20ee3a,_0x35be21){_0x35be21=_0x35be21||0xc8;return function(_0x1e9cb6){if(_0x1e9cb6){return _0x20ee3a[_0xa7fa('0x17')](_0x35be21)[_0xa7fa('0x19')](_0x1e9cb6);}};}function respondWithFilteredResult(_0x315b7f,_0x3bdb88){return function(_0x11976){if(_0x11976){var _0x11b60e=typeof _0x3bdb88[_0xa7fa('0x1a')]===_0xa7fa('0x1b')&&typeof _0x3bdb88[_0xa7fa('0x1c')]===_0xa7fa('0x1b');var _0xd7bb7e=_0x11976[_0xa7fa('0x1d')];var _0x5c1c2c=_0x11b60e?0x0:_0x3bdb88[_0xa7fa('0x1a')];var _0x49a0bf=_0x11b60e?_0x11976[_0xa7fa('0x1d')]:_0x3bdb88[_0xa7fa('0x1a')]+_0x3bdb88[_0xa7fa('0x1c')];var _0xa1042b;if(_0x49a0bf>=_0xd7bb7e){_0x49a0bf=_0xd7bb7e;_0xa1042b=0xc8;}else{_0xa1042b=0xce;}_0x315b7f['status'](_0xa1042b);return _0x315b7f[_0xa7fa('0x1e')]('Content-Range',_0x5c1c2c+'-'+_0x49a0bf+'/'+_0xd7bb7e)[_0xa7fa('0x19')](_0x11976);}return null;};}function patchUpdates(_0x4775fc){return function(_0x40557c){try{jsonpatch[_0xa7fa('0x1f')](_0x40557c,_0x4775fc,!![]);}catch(_0x3c5fd2){return BPromise[_0xa7fa('0x20')](_0x3c5fd2);}return _0x40557c[_0xa7fa('0x21')]();};}function saveUpdates(_0x1d3969,_0x4fe609){return function(_0x21a30e){if(_0x21a30e){return _0x21a30e[_0xa7fa('0x22')](_0x1d3969)[_0xa7fa('0x23')](function(_0x19e3e0){return _0x19e3e0;});}return null;};}function removeEntity(_0xcaf801,_0x1d03a5){return function(_0x21f8f2){if(_0x21f8f2){return _0x21f8f2[_0xa7fa('0x24')]()[_0xa7fa('0x23')](function(){var _0xf2f0df=_0x21f8f2['get']({'plain':!![]});var _0xb0f8eb=_0xa7fa('0x25');return db[_0xa7fa('0x26')][_0xa7fa('0x24')]({'where':{'type':_0xb0f8eb,'resourceId':_0xf2f0df['id']}})[_0xa7fa('0x23')](function(){return _0x21f8f2;});})[_0xa7fa('0x23')](function(){_0xcaf801[_0xa7fa('0x17')](0xcc)[_0xa7fa('0x18')]();});}};}function handleEntityNotFound(_0x5f3686,_0x1d921b){return function(_0x2cc914){if(!_0x2cc914){_0x5f3686[_0xa7fa('0x16')](0x194);}return _0x2cc914;};}function handleError(_0x220130,_0x2c88dd){_0x2c88dd=_0x2c88dd||0x1f4;return function(_0x3fc953){logger[_0xa7fa('0x27')](_0x3fc953[_0xa7fa('0x28')]);if(_0x3fc953['name']){delete _0x3fc953[_0xa7fa('0x29')];}_0x220130['status'](_0x2c88dd)['send'](_0x3fc953);};}exports['index']=function(_0x5e8628,_0x11bdfc){var _0x259a44={},_0x3bcaf9={},_0x4b338d={'count':0x0,'rows':[]};return db[_0xa7fa('0x2a')][_0xa7fa('0x2b')]()[_0xa7fa('0x23')](function(_0x2ece68){_0x3bcaf9[_0xa7fa('0x2c')]=_[_0xa7fa('0x2d')](_0x2ece68);_0x3bcaf9[_0xa7fa('0x2e')]=_[_0xa7fa('0x2d')](_0x5e8628[_0xa7fa('0x2e')]);_0x3bcaf9[_0xa7fa('0x2f')]=_[_0xa7fa('0x30')](_0x3bcaf9[_0xa7fa('0x2c')],_0x3bcaf9[_0xa7fa('0x2e')]);_0x259a44[_0xa7fa('0x31')]=_['intersection'](_0x3bcaf9[_0xa7fa('0x2c')],qs[_0xa7fa('0x32')](_0x5e8628[_0xa7fa('0x2e')][_0xa7fa('0x32')]));_0x259a44['attributes']=_0x259a44['attributes'][_0xa7fa('0x33')]?_0x259a44['attributes']:_0x3bcaf9[_0xa7fa('0x2c')];if(!_0x5e8628[_0xa7fa('0x2e')][_0xa7fa('0x34')](_0xa7fa('0x35'))){_0x259a44[_0xa7fa('0x1c')]=qs[_0xa7fa('0x1c')](_0x5e8628[_0xa7fa('0x2e')][_0xa7fa('0x1c')]);_0x259a44[_0xa7fa('0x1a')]=qs[_0xa7fa('0x1a')](_0x5e8628['query']['offset']);}_0x259a44[_0xa7fa('0x36')]=qs['sort'](_0x5e8628['query'][_0xa7fa('0x37')]);_0x259a44['where']=qs[_0xa7fa('0x2f')](_[_0xa7fa('0x38')](_0x5e8628[_0xa7fa('0x2e')],_0x3bcaf9[_0xa7fa('0x2f')]),_0x2ece68);if(_0x5e8628['query'][_0xa7fa('0x39')]){_0x259a44[_0xa7fa('0x3a')]=_[_0xa7fa('0x3b')](_0x259a44['where'],{'$or':_[_0xa7fa('0x3c')](_0x259a44['attributes'],function(_0x33bfc1){var _0x2325e9={};_0x2325e9[_0x33bfc1]={'$like':'%'+_0x5e8628['query'][_0xa7fa('0x39')]+'%'};return _0x2325e9;})});}_0x259a44=_['merge']({},_0x259a44,_0x5e8628[_0xa7fa('0x3d')]);var _0x17e2cf={'where':_0x259a44[_0xa7fa('0x3a')]};return db['CmCompany'][_0xa7fa('0x1d')](_0x17e2cf)[_0xa7fa('0x23')](function(_0x1f0994){_0x4b338d[_0xa7fa('0x1d')]=_0x1f0994;if(_0x5e8628['query'][_0xa7fa('0x3e')]){_0x259a44[_0xa7fa('0x3f')]=[{'all':!![]}];}return db[_0xa7fa('0x2a')]['findAll'](_0x259a44);})[_0xa7fa('0x23')](function(_0x28df25){_0x4b338d[_0xa7fa('0x40')]=_0x28df25;return _0x4b338d;})['then'](respondWithFilteredResult(_0x11bdfc,_0x259a44))[_0xa7fa('0x41')](handleError(_0x11bdfc,null));})['catch'](handleError(_0x11bdfc,null));};exports[_0xa7fa('0x42')]=function(_0x4ba578,_0x1243ae){var _0x15bd14={'raw':![],'where':{'id':_0x4ba578['params']['id']}},_0x1baed8={};_0x1baed8[_0xa7fa('0x2c')]=_[_0xa7fa('0x2d')](db[_0xa7fa('0x2a')][_0xa7fa('0x43')]);_0x1baed8[_0xa7fa('0x2e')]=_[_0xa7fa('0x2d')](_0x4ba578[_0xa7fa('0x2e')]);_0x1baed8[_0xa7fa('0x2f')]=_[_0xa7fa('0x30')](_0x1baed8[_0xa7fa('0x2c')],_0x1baed8['query']);_0x15bd14[_0xa7fa('0x31')]=_[_0xa7fa('0x30')](_0x1baed8['model'],qs['fields'](_0x4ba578['query'][_0xa7fa('0x32')]));_0x15bd14['attributes']=_0x15bd14[_0xa7fa('0x31')][_0xa7fa('0x33')]?_0x15bd14[_0xa7fa('0x31')]:_0x1baed8[_0xa7fa('0x2c')];if(_0x4ba578['query'][_0xa7fa('0x3e')]){_0x15bd14[_0xa7fa('0x3f')]=[{'all':!![]}];}_0x15bd14=_[_0xa7fa('0x3b')]({},_0x15bd14,_0x4ba578['options']);return db['CmCompany']['find'](_0x15bd14)[_0xa7fa('0x23')](handleEntityNotFound(_0x1243ae,null))[_0xa7fa('0x23')](respondWithResult(_0x1243ae,null))[_0xa7fa('0x41')](handleError(_0x1243ae,null));};exports[_0xa7fa('0x44')]=function(_0x491844,_0x27657e){return db['CmCompany']['create'](_0x491844['body'],{})['then'](function(_0x4cdc1d){var _0x512b00=_0x491844['user'][_0xa7fa('0x45')]({'plain':!![]});if(!_0x512b00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x512b00[_0xa7fa('0x46')]===_0xa7fa('0x47')){var _0x6cec7=_0x4cdc1d['get']({'plain':!![]});var _0x478bdd='Companies';return db[_0xa7fa('0x48')][_0xa7fa('0x49')]({'where':{'name':_0x478bdd,'userProfileId':_0x512b00[_0xa7fa('0x4a')]},'raw':!![]})[_0xa7fa('0x23')](function(_0x449e68){if(_0x449e68&&_0x449e68[_0xa7fa('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x6cec7[_0xa7fa('0x29')],'resourceId':_0x6cec7['id'],'type':_0x449e68['name'],'sectionId':_0x449e68['id']},{})[_0xa7fa('0x23')](function(){return _0x4cdc1d;});}else{return _0x4cdc1d;}})['catch'](function(_0x562159){logger['error'](_0xa7fa('0x4c'),_0x562159);throw _0x562159;});}return _0x4cdc1d;})[_0xa7fa('0x23')](respondWithResult(_0x27657e,0xc9))[_0xa7fa('0x41')](handleError(_0x27657e,null));};exports['update']=function(_0x3a03fa,_0x245ac3){if(_0x3a03fa[_0xa7fa('0x4d')]['id']){delete _0x3a03fa[_0xa7fa('0x4d')]['id'];}return db[_0xa7fa('0x2a')][_0xa7fa('0x49')]({'where':{'id':_0x3a03fa['params']['id']}})[_0xa7fa('0x23')](handleEntityNotFound(_0x245ac3,null))['then'](saveUpdates(_0x3a03fa['body'],null))[_0xa7fa('0x23')](respondWithResult(_0x245ac3,null))[_0xa7fa('0x41')](handleError(_0x245ac3,null));};exports['destroy']=function(_0x3deb0f,_0x3d6c8c){return db['CmCompany'][_0xa7fa('0x49')]({'where':{'id':_0x3deb0f[_0xa7fa('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d6c8c,null))[_0xa7fa('0x23')](removeEntity(_0x3d6c8c,null))[_0xa7fa('0x41')](handleError(_0x3d6c8c,null));};exports['describe']=function(_0x22cb60,_0x2efb49){return db[_0xa7fa('0x2a')][_0xa7fa('0x2b')]()[_0xa7fa('0x23')](respondWithResult(_0x2efb49,null))['catch'](handleError(_0x2efb49,null));};exports[_0xa7fa('0x4f')]=function(_0x48e5f1,_0x5cb05e,_0x5baa2b){return db[_0xa7fa('0x50')][_0xa7fa('0x49')]({'where':{'id':_0x48e5f1[_0xa7fa('0x4e')]['id']}})[_0xa7fa('0x23')](handleEntityNotFound(_0x5cb05e,null))[_0xa7fa('0x23')](function(_0x12fbe3){if(_0x12fbe3){return _0x12fbe3[_0xa7fa('0x4f')](_0x48e5f1['body']['ids'],_['omit'](_0x48e5f1[_0xa7fa('0x4d')],[_0xa7fa('0x51'),'id'])||{});}})[_0xa7fa('0x23')](respondWithResult(_0x5cb05e,null))[_0xa7fa('0x41')](handleError(_0x5cb05e,null));};exports[_0xa7fa('0x52')]=function(_0x46ccd1,_0x385fb9,_0x47a355){var _0x4fd6d1={};var _0x50012={};var _0x398810;var _0x9278dc;return db['CmCompany'][_0xa7fa('0x53')]({'where':{'id':_0x46ccd1['params']['id']}})[_0xa7fa('0x23')](handleEntityNotFound(_0x385fb9,null))[_0xa7fa('0x23')](function(_0x33f2d0){if(_0x33f2d0){_0x398810=_0x33f2d0;_0x50012['model']=_[_0xa7fa('0x2d')](db[_0xa7fa('0x50')][_0xa7fa('0x43')]);_0x50012['query']=_[_0xa7fa('0x2d')](_0x46ccd1['query']);_0x50012['filters']=_[_0xa7fa('0x30')](_0x50012[_0xa7fa('0x2c')],_0x50012[_0xa7fa('0x2e')]);_0x4fd6d1[_0xa7fa('0x31')]=_['intersection'](_0x50012[_0xa7fa('0x2c')],qs[_0xa7fa('0x32')](_0x46ccd1[_0xa7fa('0x2e')][_0xa7fa('0x32')]));_0x4fd6d1[_0xa7fa('0x31')]=_0x4fd6d1[_0xa7fa('0x31')][_0xa7fa('0x33')]?_0x4fd6d1['attributes']:_0x50012['model'];_0x4fd6d1[_0xa7fa('0x36')]=qs[_0xa7fa('0x37')](_0x46ccd1['query'][_0xa7fa('0x37')]);_0x4fd6d1['where']=qs[_0xa7fa('0x2f')](_[_0xa7fa('0x38')](_0x46ccd1[_0xa7fa('0x2e')],_0x50012[_0xa7fa('0x2f')]));if(_0x46ccd1[_0xa7fa('0x2e')][_0xa7fa('0x39')]){_0x4fd6d1[_0xa7fa('0x3a')]=_[_0xa7fa('0x3b')](_0x4fd6d1[_0xa7fa('0x3a')],{'$or':_[_0xa7fa('0x3c')](_0x4fd6d1[_0xa7fa('0x31')],function(_0x5cb77b){var _0x45c2ad={};_0x45c2ad[_0x5cb77b]={'$like':'%'+_0x46ccd1['query'][_0xa7fa('0x39')]+'%'};return _0x45c2ad;})});}_0x4fd6d1=_[_0xa7fa('0x3b')]({},_0x4fd6d1,_0x46ccd1['options']);return _0x398810[_0xa7fa('0x52')](_0x4fd6d1);}})[_0xa7fa('0x23')](function(_0x3af3e5){if(_0x3af3e5){_0x9278dc=_0x3af3e5[_0xa7fa('0x33')];if(!_0x46ccd1[_0xa7fa('0x2e')]['hasOwnProperty'](_0xa7fa('0x35'))){_0x4fd6d1['limit']=qs[_0xa7fa('0x1c')](_0x46ccd1['query']['limit']);_0x4fd6d1[_0xa7fa('0x1a')]=qs[_0xa7fa('0x1a')](_0x46ccd1[_0xa7fa('0x2e')][_0xa7fa('0x1a')]);}return _0x398810[_0xa7fa('0x52')](_0x4fd6d1);}})[_0xa7fa('0x23')](function(_0x125f68){if(_0x125f68){return _0x125f68?{'count':_0x9278dc,'rows':_0x125f68}:null;}})['then'](respondWithResult(_0x385fb9,null))[_0xa7fa('0x41')](handleError(_0x385fb9,null));};
\ No newline at end of file
+var _0x9146=['undefined','limit','count','Content-Range','apply','reject','then','UserProfileResource','destroy','sendStatus','name','send','index','CmCompany','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','get','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','ids','getContacts','findOne','CmContact','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0x9146,0x179));var _0x6914=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x9146[_0xd0b415];return _0x2bdf2c;};'use strict';var emlformat=require(_0x6914('0x0'));var rimraf=require(_0x6914('0x1'));var zipdir=require(_0x6914('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6914('0x3'));var moment=require(_0x6914('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6914('0x5'));var util=require(_0x6914('0x6'));var path=require(_0x6914('0x7'));var sox=require(_0x6914('0x8'));var csv=require(_0x6914('0x9'));var ejs=require(_0x6914('0xa'));var fs=require('fs');var fs_extra=require(_0x6914('0xb'));var _=require('lodash');var squel=require(_0x6914('0xc'));var crypto=require('crypto');var jsforce=require(_0x6914('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6914('0x9'));var querystring=require(_0x6914('0xe'));var Papa=require(_0x6914('0xf'));var Redis=require('ioredis');var authService=require(_0x6914('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6914('0x11'));var hardwareService=require(_0x6914('0x12'));var logger=require(_0x6914('0x13'))(_0x6914('0x14'));var utils=require(_0x6914('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6914('0x16'));var db=require(_0x6914('0x17'))['db'];function respondWithStatusCode(_0x4969ba,_0x61e47c){_0x61e47c=_0x61e47c||0xcc;return function(_0x4cc123){if(_0x4cc123){return _0x4969ba['sendStatus'](_0x61e47c);}return _0x4969ba[_0x6914('0x18')](_0x61e47c)[_0x6914('0x19')]();};}function respondWithResult(_0x563758,_0x7496d0){_0x7496d0=_0x7496d0||0xc8;return function(_0x2dcf53){if(_0x2dcf53){return _0x563758[_0x6914('0x18')](_0x7496d0)[_0x6914('0x1a')](_0x2dcf53);}};}function respondWithFilteredResult(_0xc15581,_0x3e6168){return function(_0x39ba4c){if(_0x39ba4c){var _0xeb4e00=typeof _0x3e6168[_0x6914('0x1b')]===_0x6914('0x1c')&&typeof _0x3e6168[_0x6914('0x1d')]==='undefined';var _0x5be42e=_0x39ba4c['count'];var _0x47d62b=_0xeb4e00?0x0:_0x3e6168[_0x6914('0x1b')];var _0x4da9f1=_0xeb4e00?_0x39ba4c[_0x6914('0x1e')]:_0x3e6168['offset']+_0x3e6168[_0x6914('0x1d')];var _0x3373bf;if(_0x4da9f1>=_0x5be42e){_0x4da9f1=_0x5be42e;_0x3373bf=0xc8;}else{_0x3373bf=0xce;}_0xc15581[_0x6914('0x18')](_0x3373bf);return _0xc15581['set'](_0x6914('0x1f'),_0x47d62b+'-'+_0x4da9f1+'/'+_0x5be42e)[_0x6914('0x1a')](_0x39ba4c);}return null;};}function patchUpdates(_0x579654){return function(_0x46af94){try{jsonpatch[_0x6914('0x20')](_0x46af94,_0x579654,!![]);}catch(_0x59b6d5){return BPromise[_0x6914('0x21')](_0x59b6d5);}return _0x46af94['save']();};}function saveUpdates(_0x1b9209,_0x305815){return function(_0x32ecb4){if(_0x32ecb4){return _0x32ecb4['update'](_0x1b9209)[_0x6914('0x22')](function(_0x300540){return _0x300540;});}return null;};}function removeEntity(_0x4c942f,_0x1396e3){return function(_0x11bf02){if(_0x11bf02){return _0x11bf02['destroy']()['then'](function(){var _0x41abb1=_0x11bf02['get']({'plain':!![]});var _0x4f3fcb='Companies';return db[_0x6914('0x23')][_0x6914('0x24')]({'where':{'type':_0x4f3fcb,'resourceId':_0x41abb1['id']}})[_0x6914('0x22')](function(){return _0x11bf02;});})['then'](function(){_0x4c942f['status'](0xcc)[_0x6914('0x19')]();});}};}function handleEntityNotFound(_0x19d36c,_0x4435ff){return function(_0x53c57f){if(!_0x53c57f){_0x19d36c[_0x6914('0x25')](0x194);}return _0x53c57f;};}function handleError(_0x38e7cd,_0x502309){_0x502309=_0x502309||0x1f4;return function(_0x4f2a37){logger['error'](_0x4f2a37['stack']);if(_0x4f2a37[_0x6914('0x26')]){delete _0x4f2a37['name'];}_0x38e7cd['status'](_0x502309)[_0x6914('0x27')](_0x4f2a37);};}exports[_0x6914('0x28')]=function(_0x432d78,_0x262b87){var _0x475d5b={},_0x50dd6e={},_0x4ff9ad={'count':0x0,'rows':[]};return db[_0x6914('0x29')]['describe']()[_0x6914('0x22')](function(_0x25cd6f){_0x50dd6e[_0x6914('0x2a')]=_['keys'](_0x25cd6f);_0x50dd6e[_0x6914('0x2b')]=_[_0x6914('0x2c')](_0x432d78[_0x6914('0x2b')]);_0x50dd6e[_0x6914('0x2d')]=_[_0x6914('0x2e')](_0x50dd6e['model'],_0x50dd6e[_0x6914('0x2b')]);_0x475d5b[_0x6914('0x2f')]=_['intersection'](_0x50dd6e[_0x6914('0x2a')],qs['fields'](_0x432d78[_0x6914('0x2b')][_0x6914('0x30')]));_0x475d5b[_0x6914('0x2f')]=_0x475d5b[_0x6914('0x2f')][_0x6914('0x31')]?_0x475d5b[_0x6914('0x2f')]:_0x50dd6e['model'];if(!_0x432d78['query'][_0x6914('0x32')]('nolimit')){_0x475d5b[_0x6914('0x1d')]=qs[_0x6914('0x1d')](_0x432d78[_0x6914('0x2b')][_0x6914('0x1d')]);_0x475d5b[_0x6914('0x1b')]=qs['offset'](_0x432d78[_0x6914('0x2b')]['offset']);}_0x475d5b[_0x6914('0x33')]=qs['sort'](_0x432d78[_0x6914('0x2b')][_0x6914('0x34')]);_0x475d5b[_0x6914('0x35')]=qs[_0x6914('0x2d')](_[_0x6914('0x36')](_0x432d78[_0x6914('0x2b')],_0x50dd6e[_0x6914('0x2d')]),_0x25cd6f);if(_0x432d78[_0x6914('0x2b')]['filter']){_0x475d5b[_0x6914('0x35')]=_['merge'](_0x475d5b[_0x6914('0x35')],{'$or':_[_0x6914('0x37')](_0x475d5b['attributes'],function(_0x2956e1){var _0x2f319d={};_0x2f319d[_0x2956e1]={'$like':'%'+_0x432d78['query'][_0x6914('0x38')]+'%'};return _0x2f319d;})});}_0x475d5b=_[_0x6914('0x39')]({},_0x475d5b,_0x432d78[_0x6914('0x3a')]);var _0x1cdecd={'where':_0x475d5b[_0x6914('0x35')]};return db[_0x6914('0x29')][_0x6914('0x1e')](_0x1cdecd)[_0x6914('0x22')](function(_0x2dcacc){_0x4ff9ad[_0x6914('0x1e')]=_0x2dcacc;if(_0x432d78[_0x6914('0x2b')][_0x6914('0x3b')]){_0x475d5b[_0x6914('0x3c')]=[{'all':!![]}];}return db[_0x6914('0x29')][_0x6914('0x3d')](_0x475d5b);})['then'](function(_0x3dc17d){_0x4ff9ad[_0x6914('0x3e')]=_0x3dc17d;return _0x4ff9ad;})['then'](respondWithFilteredResult(_0x262b87,_0x475d5b))['catch'](handleError(_0x262b87,null));})[_0x6914('0x3f')](handleError(_0x262b87,null));};exports[_0x6914('0x40')]=function(_0x1e60f4,_0x4abf3e){var _0x28e1a6={'raw':![],'where':{'id':_0x1e60f4[_0x6914('0x41')]['id']}},_0x5005a3={};_0x5005a3[_0x6914('0x2a')]=_[_0x6914('0x2c')](db[_0x6914('0x29')][_0x6914('0x42')]);_0x5005a3['query']=_[_0x6914('0x2c')](_0x1e60f4[_0x6914('0x2b')]);_0x5005a3[_0x6914('0x2d')]=_[_0x6914('0x2e')](_0x5005a3[_0x6914('0x2a')],_0x5005a3[_0x6914('0x2b')]);_0x28e1a6[_0x6914('0x2f')]=_[_0x6914('0x2e')](_0x5005a3[_0x6914('0x2a')],qs[_0x6914('0x30')](_0x1e60f4[_0x6914('0x2b')][_0x6914('0x30')]));_0x28e1a6[_0x6914('0x2f')]=_0x28e1a6[_0x6914('0x2f')][_0x6914('0x31')]?_0x28e1a6[_0x6914('0x2f')]:_0x5005a3[_0x6914('0x2a')];if(_0x1e60f4[_0x6914('0x2b')]['includeAll']){_0x28e1a6[_0x6914('0x3c')]=[{'all':!![]}];}_0x28e1a6=_['merge']({},_0x28e1a6,_0x1e60f4[_0x6914('0x3a')]);return db[_0x6914('0x29')][_0x6914('0x43')](_0x28e1a6)[_0x6914('0x22')](handleEntityNotFound(_0x4abf3e,null))['then'](respondWithResult(_0x4abf3e,null))[_0x6914('0x3f')](handleError(_0x4abf3e,null));};exports[_0x6914('0x44')]=function(_0x3e721f,_0x1501ab){return db[_0x6914('0x29')]['create'](_0x3e721f['body'],{})[_0x6914('0x22')](function(_0x4ad95b){var _0x5dca70=_0x3e721f[_0x6914('0x45')][_0x6914('0x46')]({'plain':!![]});if(!_0x5dca70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5dca70[_0x6914('0x47')]===_0x6914('0x45')){var _0x2eafd2=_0x4ad95b[_0x6914('0x46')]({'plain':!![]});var _0x19482a='Companies';return db['UserProfileSection'][_0x6914('0x43')]({'where':{'name':_0x19482a,'userProfileId':_0x5dca70['userProfileId']},'raw':!![]})[_0x6914('0x22')](function(_0xe4202a){if(_0xe4202a&&_0xe4202a['autoAssociation']===0x0){return db['UserProfileResource'][_0x6914('0x44')]({'name':_0x2eafd2[_0x6914('0x26')],'resourceId':_0x2eafd2['id'],'type':_0xe4202a[_0x6914('0x26')],'sectionId':_0xe4202a['id']},{})[_0x6914('0x22')](function(){return _0x4ad95b;});}else{return _0x4ad95b;}})[_0x6914('0x3f')](function(_0x475768){logger['error'](_0x6914('0x48'),_0x475768);throw _0x475768;});}return _0x4ad95b;})[_0x6914('0x22')](respondWithResult(_0x1501ab,0xc9))[_0x6914('0x3f')](handleError(_0x1501ab,null));};exports['update']=function(_0x2edf2d,_0x399ca4){if(_0x2edf2d[_0x6914('0x49')]['id']){delete _0x2edf2d[_0x6914('0x49')]['id'];}return db[_0x6914('0x29')][_0x6914('0x43')]({'where':{'id':_0x2edf2d[_0x6914('0x41')]['id']}})['then'](handleEntityNotFound(_0x399ca4,null))[_0x6914('0x22')](saveUpdates(_0x2edf2d[_0x6914('0x49')],null))['then'](respondWithResult(_0x399ca4,null))[_0x6914('0x3f')](handleError(_0x399ca4,null));};exports[_0x6914('0x24')]=function(_0x2ee0d2,_0x3a6b32){return db['CmCompany'][_0x6914('0x43')]({'where':{'id':_0x2ee0d2[_0x6914('0x41')]['id']}})[_0x6914('0x22')](handleEntityNotFound(_0x3a6b32,null))['then'](removeEntity(_0x3a6b32,null))[_0x6914('0x3f')](handleError(_0x3a6b32,null));};exports['describe']=function(_0x1a67c5,_0x29045f){return db[_0x6914('0x29')][_0x6914('0x4a')]()[_0x6914('0x22')](respondWithResult(_0x29045f,null))[_0x6914('0x3f')](handleError(_0x29045f,null));};exports[_0x6914('0x4b')]=function(_0x5020df,_0xceedf3,_0x32a286){return db['CmContact'][_0x6914('0x43')]({'where':{'id':_0x5020df[_0x6914('0x41')]['id']}})[_0x6914('0x22')](handleEntityNotFound(_0xceedf3,null))[_0x6914('0x22')](function(_0x2006c4){if(_0x2006c4){return _0x2006c4[_0x6914('0x4b')](_0x5020df[_0x6914('0x49')][_0x6914('0x4c')],_['omit'](_0x5020df[_0x6914('0x49')],['ids','id'])||{});}})['then'](respondWithResult(_0xceedf3,null))[_0x6914('0x3f')](handleError(_0xceedf3,null));};exports[_0x6914('0x4d')]=function(_0x337ee4,_0x5edd00,_0x2b090f){var _0x654db9={};var _0x4c43f7={};var _0x6af79c;var _0x1a239a;return db[_0x6914('0x29')][_0x6914('0x4e')]({'where':{'id':_0x337ee4[_0x6914('0x41')]['id']}})[_0x6914('0x22')](handleEntityNotFound(_0x5edd00,null))['then'](function(_0x169014){if(_0x169014){_0x6af79c=_0x169014;_0x4c43f7['model']=_['keys'](db[_0x6914('0x4f')][_0x6914('0x42')]);_0x4c43f7[_0x6914('0x2b')]=_[_0x6914('0x2c')](_0x337ee4['query']);_0x4c43f7[_0x6914('0x2d')]=_['intersection'](_0x4c43f7[_0x6914('0x2a')],_0x4c43f7[_0x6914('0x2b')]);_0x654db9[_0x6914('0x2f')]=_[_0x6914('0x2e')](_0x4c43f7[_0x6914('0x2a')],qs[_0x6914('0x30')](_0x337ee4[_0x6914('0x2b')][_0x6914('0x30')]));_0x654db9[_0x6914('0x2f')]=_0x654db9['attributes'][_0x6914('0x31')]?_0x654db9['attributes']:_0x4c43f7['model'];_0x654db9['order']=qs['sort'](_0x337ee4['query'][_0x6914('0x34')]);_0x654db9[_0x6914('0x35')]=qs[_0x6914('0x2d')](_[_0x6914('0x36')](_0x337ee4[_0x6914('0x2b')],_0x4c43f7[_0x6914('0x2d')]));if(_0x337ee4[_0x6914('0x2b')][_0x6914('0x38')]){_0x654db9[_0x6914('0x35')]=_[_0x6914('0x39')](_0x654db9[_0x6914('0x35')],{'$or':_[_0x6914('0x37')](_0x654db9[_0x6914('0x2f')],function(_0x2f8e66){var _0x8dddfb={};_0x8dddfb[_0x2f8e66]={'$like':'%'+_0x337ee4[_0x6914('0x2b')][_0x6914('0x38')]+'%'};return _0x8dddfb;})});}_0x654db9=_[_0x6914('0x39')]({},_0x654db9,_0x337ee4['options']);return _0x6af79c['getContacts'](_0x654db9);}})[_0x6914('0x22')](function(_0x43b399){if(_0x43b399){_0x1a239a=_0x43b399[_0x6914('0x31')];if(!_0x337ee4[_0x6914('0x2b')][_0x6914('0x32')](_0x6914('0x50'))){_0x654db9[_0x6914('0x1d')]=qs[_0x6914('0x1d')](_0x337ee4[_0x6914('0x2b')][_0x6914('0x1d')]);_0x654db9['offset']=qs[_0x6914('0x1b')](_0x337ee4[_0x6914('0x2b')][_0x6914('0x1b')]);}return _0x6af79c[_0x6914('0x4d')](_0x654db9);}})['then'](function(_0x11a134){if(_0x11a134){return _0x11a134?{'count':_0x1a239a,'rows':_0x11a134}:null;}})[_0x6914('0x22')](respondWithResult(_0x5edd00,null))[_0x6914('0x3f')](handleError(_0x5edd00,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index cb93106..de0badd 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 _0xdf66=['./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x1fe140,_0x19263c){var _0x59877c=function(_0x89f57e){while(--_0x89f57e){_0x1fe140['push'](_0x1fe140['shift']());}};_0x59877c(++_0x19263c);}(_0xdf66,0xa0));var _0x6df6=function(_0x27125a,_0x252d0d){_0x27125a=_0x27125a-0x0;var _0x391f7a=_0xdf66[_0x27125a];return _0x391f7a;};'use strict';var _=require(_0x6df6('0x0'));var util=require(_0x6df6('0x1'));var logger=require(_0x6df6('0x2'))(_0x6df6('0x3'));var moment=require(_0x6df6('0x4'));var BPromise=require('bluebird');var rp=require(_0x6df6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6df6('0x6'));var config=require(_0x6df6('0x7'));var attributes=require(_0x6df6('0x8'));module[_0x6df6('0x9')]=function(_0x3b121f,_0x5424b6){return _0x3b121f[_0x6df6('0xa')]('CmCompany',attributes,{'tableName':_0x6df6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x01cd=['cm_companies','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x34b87e,_0x565dbc){var _0x19b1f8=function(_0x371c47){while(--_0x371c47){_0x34b87e['push'](_0x34b87e['shift']());}};_0x19b1f8(++_0x565dbc);}(_0x01cd,0x109));var _0xd01c=function(_0x54a709,_0x58f79b){_0x54a709=_0x54a709-0x0;var _0x100251=_0x01cd[_0x54a709];return _0x100251;};'use strict';var _=require(_0xd01c('0x0'));var util=require(_0xd01c('0x1'));var logger=require(_0xd01c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd01c('0x3'));var rp=require(_0xd01c('0x4'));var fs=require('fs');var path=require(_0xd01c('0x5'));var rimraf=require(_0xd01c('0x6'));var config=require(_0xd01c('0x7'));var attributes=require(_0xd01c('0x8'));module['exports']=function(_0x2d4d31,_0x213b75){return _0x2d4d31[_0xd01c('0x9')](_0xd01c('0xa'),attributes,{'tableName':_0xd01c('0xb'),'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 84025a8..4758c69 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 _0xed3a=['client','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2b1605,_0xbcbab){var _0x4861c0=function(_0x3e0445){while(--_0x3e0445){_0x2b1605['push'](_0x2b1605['shift']());}};_0x4861c0(++_0xbcbab);}(_0xed3a,0xb6));var _0xaed3=function(_0x831910,_0x1c5de3){_0x831910=_0x831910-0x0;var _0x35e93c=_0xed3a[_0x831910];return _0x35e93c;};'use strict';var _=require(_0xaed3('0x0'));var util=require(_0xaed3('0x1'));var moment=require(_0xaed3('0x2'));var BPromise=require(_0xaed3('0x3'));var rs=require(_0xaed3('0x4'));var fs=require('fs');var Redis=require(_0xaed3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaed3('0x6'));var logger=require(_0xaed3('0x7'))(_0xaed3('0x8'));var config=require(_0xaed3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaed3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaf3c10,_0x40479b,_0x2d3685){return new BPromise(function(_0x5428f1,_0x28c7a9){return client[_0xaed3('0xb')](_0xaf3c10,_0x2d3685)[_0xaed3('0xc')](function(_0x1c6de2){logger[_0xaed3('0xd')](_0xaed3('0xe'),_0x40479b,'request\x20sent');logger[_0xaed3('0xf')](_0xaed3('0x10'),_0x40479b,_0xaed3('0x11'),JSON[_0xaed3('0x12')](_0x1c6de2));if(_0x1c6de2[_0xaed3('0x13')]){if(_0x1c6de2[_0xaed3('0x13')][_0xaed3('0x14')]===0x1f4){logger[_0xaed3('0x13')]('CmCompany,\x20%s,\x20%s',_0x40479b,_0x1c6de2[_0xaed3('0x13')][_0xaed3('0x15')]);return _0x28c7a9(_0x1c6de2[_0xaed3('0x13')][_0xaed3('0x15')]);}logger[_0xaed3('0x13')](_0xaed3('0xe'),_0x40479b,_0x1c6de2[_0xaed3('0x13')][_0xaed3('0x15')]);return _0x5428f1(_0x1c6de2['error']['message']);}else{logger[_0xaed3('0xd')]('CmCompany,\x20%s,\x20%s',_0x40479b,'request\x20sent');_0x5428f1(_0x1c6de2[_0xaed3('0x16')][_0xaed3('0x15')]);}})[_0xaed3('0x17')](function(_0x54651c){logger['error'](_0xaed3('0xe'),_0x40479b,_0x54651c);_0x28c7a9(_0x54651c);});});}
\ No newline at end of file
+var _0xedc3=['code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x282780,_0x49c2d3){var _0x3f8c44=function(_0x534f3d){while(--_0x534f3d){_0x282780['push'](_0x282780['shift']());}};_0x3f8c44(++_0x49c2d3);}(_0xedc3,0x1bd));var _0x3edc=function(_0x2a2670,_0x73baa3){_0x2a2670=_0x2a2670-0x0;var _0x304d6f=_0xedc3[_0x2a2670];return _0x304d6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3edc('0x0'));var rs=require(_0x3edc('0x1'));var fs=require('fs');var Redis=require(_0x3edc('0x2'));var db=require(_0x3edc('0x3'))['db'];var utils=require(_0x3edc('0x4'));var logger=require(_0x3edc('0x5'))('rpc');var config=require(_0x3edc('0x6'));var jayson=require(_0x3edc('0x7'));var client=jayson['client'][_0x3edc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40dcee,_0xf3e4b6,_0x531dd2){return new BPromise(function(_0x4bb2b5,_0x402e3b){return client[_0x3edc('0x9')](_0x40dcee,_0x531dd2)['then'](function(_0x196687){logger[_0x3edc('0xa')](_0x3edc('0xb'),_0xf3e4b6,_0x3edc('0xc'));logger[_0x3edc('0xd')](_0x3edc('0xe'),_0xf3e4b6,_0x3edc('0xc'),JSON[_0x3edc('0xf')](_0x196687));if(_0x196687['error']){if(_0x196687[_0x3edc('0x10')][_0x3edc('0x11')]===0x1f4){logger['error'](_0x3edc('0xb'),_0xf3e4b6,_0x196687[_0x3edc('0x10')]['message']);return _0x402e3b(_0x196687['error'][_0x3edc('0x12')]);}logger[_0x3edc('0x10')](_0x3edc('0xb'),_0xf3e4b6,_0x196687[_0x3edc('0x10')][_0x3edc('0x12')]);return _0x4bb2b5(_0x196687[_0x3edc('0x10')]['message']);}else{logger[_0x3edc('0xa')](_0x3edc('0xb'),_0xf3e4b6,_0x3edc('0xc'));_0x4bb2b5(_0x196687[_0x3edc('0x13')][_0x3edc('0x12')]);}})[_0x3edc('0x14')](function(_0x2b138d){logger['error'](_0x3edc('0xb'),_0xf3e4b6,_0x2b138d);_0x402e3b(_0x2b138d);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d2fc800..32bb453 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 _0xaa71=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/:id','/:id/contacts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa71,0x1e6));var _0x1aa7=function(_0xe717cd,_0x3f2654){_0xe717cd=_0xe717cd-0x0;var _0x5a3776=_0xaa71[_0xe717cd];return _0x5a3776;};'use strict';var multer=require(_0x1aa7('0x0'));var util=require(_0x1aa7('0x1'));var path=require(_0x1aa7('0x2'));var timeout=require(_0x1aa7('0x3'));var express=require(_0x1aa7('0x4'));var router=express['Router']();var fs_extra=require(_0x1aa7('0x5'));var auth=require(_0x1aa7('0x6'));var interaction=require(_0x1aa7('0x7'));var config=require('../../config/environment');var controller=require(_0x1aa7('0x8'));router[_0x1aa7('0x9')]('/',auth[_0x1aa7('0xa')](),controller[_0x1aa7('0xb')]);router[_0x1aa7('0x9')]('/describe',auth[_0x1aa7('0xa')](),controller['describe']);router['get'](_0x1aa7('0xc'),auth[_0x1aa7('0xa')](),controller['show']);router[_0x1aa7('0x9')](_0x1aa7('0xd'),auth[_0x1aa7('0xa')](),controller['getContacts']);router[_0x1aa7('0xe')]('/',auth[_0x1aa7('0xa')](),controller[_0x1aa7('0xf')]);router[_0x1aa7('0xe')](_0x1aa7('0xd'),auth[_0x1aa7('0xa')](),controller['addContacts']);router[_0x1aa7('0x10')](_0x1aa7('0xc'),auth['isAuthenticated'](),controller[_0x1aa7('0x11')]);router['delete']('/:id',auth[_0x1aa7('0xa')](),controller[_0x1aa7('0x12')]);module[_0x1aa7('0x13')]=router;
\ No newline at end of file
+var _0x0243=['/describe','isAuthenticated','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3e1b10,_0xf07e4f){var _0x20247a=function(_0x4b4d16){while(--_0x4b4d16){_0x3e1b10['push'](_0x3e1b10['shift']());}};_0x20247a(++_0xf07e4f);}(_0x0243,0x17c));var _0x3024=function(_0x30b4cb,_0x100ec7){_0x30b4cb=_0x30b4cb-0x0;var _0x57e060=_0x0243[_0x30b4cb];return _0x57e060;};'use strict';var multer=require(_0x3024('0x0'));var util=require(_0x3024('0x1'));var path=require(_0x3024('0x2'));var timeout=require(_0x3024('0x3'));var express=require(_0x3024('0x4'));var router=express[_0x3024('0x5')]();var fs_extra=require(_0x3024('0x6'));var auth=require(_0x3024('0x7'));var interaction=require(_0x3024('0x8'));var config=require(_0x3024('0x9'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3024('0xa')](_0x3024('0xb'),auth[_0x3024('0xc')](),controller['describe']);router['get'](_0x3024('0xd'),auth[_0x3024('0xc')](),controller[_0x3024('0xe')]);router['get']('/:id/contacts',auth[_0x3024('0xc')](),controller[_0x3024('0xf')]);router[_0x3024('0x10')]('/',auth[_0x3024('0xc')](),controller[_0x3024('0x11')]);router['post'](_0x3024('0x12'),auth[_0x3024('0xc')](),controller[_0x3024('0x13')]);router[_0x3024('0x14')](_0x3024('0xd'),auth[_0x3024('0xc')](),controller['update']);router['delete'](_0x3024('0xd'),auth[_0x3024('0xc')](),controller[_0x3024('0x15')]);module[_0x3024('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 40079d9..6bfcfb3 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 _0x2191=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x3345b7,_0x37e5fe){var _0x21340f=function(_0xd2c2f1){while(--_0xd2c2f1){_0x3345b7['push'](_0x3345b7['shift']());}};_0x21340f(++_0x37e5fe);}(_0x2191,0x1c0));var _0x1219=function(_0x478d41,_0x4ba80b){_0x478d41=_0x478d41-0x0;var _0x3a4522=_0x2191[_0x478d41];return _0x3a4522;};'use strict';var _=require(_0x1219('0x0'));var Sequelize=require(_0x1219('0x1'));module[_0x1219('0x2')]={'firstName':{'type':Sequelize[_0x1219('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1219('0x3')]},'street':{'type':Sequelize[_0x1219('0x3')]},'postalCode':{'type':Sequelize[_0x1219('0x3')]},'city':{'type':Sequelize[_0x1219('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1219('0x3')]},'description':{'type':Sequelize[_0x1219('0x4')]},'phone':{'type':Sequelize[_0x1219('0x3')]},'mobile':{'type':Sequelize[_0x1219('0x3')]},'fax':{'type':Sequelize[_0x1219('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x1219('0x3')]},'facebook':{'type':Sequelize[_0x1219('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x1219('0x3')]},'skype':{'type':Sequelize[_0x1219('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1219('0x3')]},'line':{'type':Sequelize[_0x1219('0x3')]},'wechat':{'type':Sequelize[_0x1219('0x3')]},'telegram':{'type':Sequelize[_0x1219('0x3')]},'UserId':{'type':Sequelize[_0x1219('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x1219('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1219('0x7')],'defaultValue':Sequelize[_0x1219('0x8')]}};
\ No newline at end of file
+var _0x8ef5=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x8ef5,0x6a));var _0x58ef=function(_0x212c72,_0x3eaf34){_0x212c72=_0x212c72-0x0;var _0x40b902=_0x8ef5[_0x212c72];return _0x40b902;};'use strict';var _=require(_0x58ef('0x0'));var Sequelize=require(_0x58ef('0x1'));module[_0x58ef('0x2')]={'firstName':{'type':Sequelize[_0x58ef('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x58ef('0x3')]},'postalCode':{'type':Sequelize[_0x58ef('0x3')]},'city':{'type':Sequelize[_0x58ef('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x58ef('0x4')]},'phone':{'type':Sequelize[_0x58ef('0x3')]},'mobile':{'type':Sequelize[_0x58ef('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x58ef('0x3')]},'url':{'type':Sequelize[_0x58ef('0x3')]},'facebook':{'type':Sequelize[_0x58ef('0x3')]},'fb_data':{'type':Sequelize[_0x58ef('0x3')]},'twitter':{'type':Sequelize[_0x58ef('0x3')]},'skype':{'type':Sequelize[_0x58ef('0x3')]},'teams':{'type':Sequelize[_0x58ef('0x3')]},'viber':{'type':Sequelize[_0x58ef('0x3')]},'line':{'type':Sequelize[_0x58ef('0x3')]},'wechat':{'type':Sequelize[_0x58ef('0x3')]},'telegram':{'type':Sequelize[_0x58ef('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x58ef('0x5')](0x2)[_0x58ef('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x58ef('0x7')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 9ffac30..21109f7 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 _0x9f75=['WhatsappInteraction','WhatsappQueueReport','join','create','bulkCreate','duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','CmHopper','getTags','intersection','pick','options','setTags','ids','getHoppers','rawAttributes','ContactId','include','includeAll','getHopperFinals','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','binding_keys','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','meta','binding','phone','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','destination','callerid','starttime','duration','createdAt','userDisposition','userThirdDisposition','UserId','alias','findAndCountAll','startCase','Website','Account','closedAt','note','thirdDisposition','key','fullname','browserName','customerIp','customerPort','osName','ratingType','ratingValue','referer','mail','subject','substatus','externalUrl','threadId','Interaction','Owner','flatten','sortBy','reverse','slice','moment','util','path','lodash','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','register','json','offset','limit','undefined','count','status','set','Content-Range','update','destroy','sendStatus','error','stack','name','send','index','CmContact','describe','then','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','fieldType','model','query','filters','attributes','fields','nolimit','order','sort','select','field','color','from','tools_tags','left_join','cm_user_has_contacts','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','dateOfBirth','datetime','castTo','DATE','buildExpression','type','text','start','end','hasOwnProperty','filter','isNil','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','c.id','DESC','having','t.id\x20IN\x20?','resolve','user','role','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','keyBy','c.lastName','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','columnName','displayName','analytics','findAll','values','merge','body','get','mergeWith','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport'];(function(_0x10fd32,_0x24b1e0){var _0x52a409=function(_0x41691b){while(--_0x41691b){_0x10fd32['push'](_0x10fd32['shift']());}};_0x52a409(++_0x24b1e0);}(_0x9f75,0x18a));var _0x59f7=function(_0x267771,_0x5a0f06){_0x267771=_0x267771-0x0;var _0x572b63=_0x9f75[_0x267771];return _0x572b63;};'use strict';var moment=require(_0x59f7('0x0'));var BPromise=require('bluebird');var util=require(_0x59f7('0x1'));var path=require(_0x59f7('0x2'));var fs=require('fs');var _=require(_0x59f7('0x3'));var squel=require('squel');var Papa=require(_0x59f7('0x4'));var Redis=require('ioredis');var qs=require(_0x59f7('0x5'));var as=require(_0x59f7('0x6'));var logger=require(_0x59f7('0x7'))(_0x59f7('0x8'));var config=require(_0x59f7('0x9'));var db=require('../../mysqldb')['db'];config[_0x59f7('0xa')]=_['defaults'](config[_0x59f7('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x59f7('0xa')]));require('./cmContact.socket')[_0x59f7('0xb')](socket);function respondWithResult(_0x1d70dd,_0x2a7bff){_0x2a7bff=_0x2a7bff||0xc8;return function(_0x354216){if(_0x354216){return _0x1d70dd['status'](_0x2a7bff)[_0x59f7('0xc')](_0x354216);}};}function respondWithFilteredResult(_0x38fe16,_0x24c15c){return function(_0x1176dd){if(_0x1176dd){var _0x2fd278=typeof _0x24c15c[_0x59f7('0xd')]==='undefined'&&typeof _0x24c15c[_0x59f7('0xe')]===_0x59f7('0xf');var _0x5a3452=_0x1176dd[_0x59f7('0x10')];var _0x331a42=_0x2fd278?0x0:_0x24c15c[_0x59f7('0xd')];var _0x4006d2=_0x2fd278?_0x1176dd['count']:_0x24c15c[_0x59f7('0xd')]+_0x24c15c[_0x59f7('0xe')];var _0x36d63c;if(_0x4006d2>=_0x5a3452){_0x4006d2=_0x5a3452;_0x36d63c=0xc8;}else{_0x36d63c=0xce;}_0x38fe16[_0x59f7('0x11')](_0x36d63c);return _0x38fe16[_0x59f7('0x12')](_0x59f7('0x13'),_0x331a42+'-'+_0x4006d2+'/'+_0x5a3452)[_0x59f7('0xc')](_0x1176dd);}return null;};}function saveUpdates(_0x2f9108){return function(_0x44eca7){if(_0x44eca7){return _0x44eca7[_0x59f7('0x14')](_0x2f9108)['then'](function(_0x36719d){return _0x36719d;});}return null;};}function removeEntity(_0x2bb8f9){return function(_0x13b04b){if(_0x13b04b){return _0x13b04b[_0x59f7('0x15')]()['then'](function(){_0x2bb8f9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e8dfa){return function(_0x5e1110){if(!_0x5e1110){_0x1e8dfa[_0x59f7('0x16')](0x194);}return _0x5e1110;};}function handleError(_0x5b9edd,_0x516e80){_0x516e80=_0x516e80||0x1f4;return function(_0x2eb958){logger[_0x59f7('0x17')](_0x2eb958[_0x59f7('0x18')]);if(_0x2eb958[_0x59f7('0x19')]){delete _0x2eb958[_0x59f7('0x19')];}_0x5b9edd[_0x59f7('0x11')](_0x516e80)[_0x59f7('0x1a')](_0x2eb958);};}exports[_0x59f7('0x1b')]=function(_0x14fb80,_0x4a81d1){var _0x350efc={},_0x32b3a9={},_0x31e010={'count':0x0,'rows':[]};return db[_0x59f7('0x1c')][_0x59f7('0x1d')]()[_0x59f7('0x1e')](function(_0x5176b8){var _0x57c609=[];for(var _0x12de7f=0x0;_0x12de7f
','Attachments','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head'];(function(_0x4dc7ea,_0x1f325b){var _0x4185dd=function(_0x38c225){while(--_0x38c225){_0x4dc7ea['push'](_0x4dc7ea['shift']());}};_0x4185dd(++_0x1f325b);}(_0x677a,0xd6));var _0xa677=function(_0xa4ed28,_0x31e209){_0xa4ed28=_0xa4ed28-0x0;var _0x3dd21c=_0x677a[_0xa4ed28];return _0x3dd21c;};'use strict';var _=require(_0xa677('0x0'));var moment=require('moment');var random=require(_0xa677('0x1'));var fs=require('fs');var path=require(_0xa677('0x2'));var util=require(_0xa677('0x3'));var tnef=require(_0xa677('0x4'));var logger=require(_0xa677('0x5'))('email');var config=require(_0xa677('0x6'));function getAddress(_0x2e46f8){var _0x45eebf=_[_0xa677('0x7')](_0x2e46f8[_0xa677('0x8')]);return _0x45eebf&&_0x45eebf['address']?_0x45eebf[_0xa677('0x9')]:_0xa677('0xa')+random[_0xa677('0xb')](0x6)+_0xa677('0xc');}function getFirstName(_0x568910){var _0x56585c=_['head'](_0x568910[_0xa677('0x8')]);if(_0x56585c&&_0x56585c['name']){if(_0x56585c[_0xa677('0xd')]==_0x56585c[_0xa677('0x9')]){return _0x56585c['name'][_0xa677('0xe')](0x0,_0x56585c[_0xa677('0xd')][_0xa677('0xf')]('@'));}var _0x96f98d=_0x56585c['name'][_0xa677('0x10')](/\s+/);return _0x96f98d[_0xa677('0x11')]>0x1?_0x96f98d[_0xa677('0x12')](0x0,-0x1)[_0xa677('0x13')]('\x20'):_0x56585c['name'];}return _0xa677('0x14');}function getLastName(_0x5de5c8){var _0x1faba2=_[_0xa677('0x7')](_0x5de5c8[_0xa677('0x8')]);if(_0x1faba2&&_0x1faba2[_0xa677('0xd')]){var _0xca5d15=_0x1faba2[_0xa677('0xd')][_0xa677('0x10')](/\s+/);return _0xca5d15[_0xa677('0x11')]>0x1?_0xca5d15[_0xa677('0x15')]():'';}return'';}function getMails(_0x230363,_0x25c63b){var _0x1dfee0='';for(var _0x37316c=0x0;_0x37316c<_0x25c63b[_0xa677('0x8')]['length'];_0x37316c+=0x1){if(_0x25c63b[_0xa677('0x8')][_0x37316c][_0xa677('0x9')]!==_0x230363){if(!_['isEmpty'](_0x1dfee0)){_0x1dfee0+=',';}_0x1dfee0+=_0x25c63b['value'][_0x37316c][_0xa677('0xd')]||_0x25c63b[_0xa677('0x8')][_0x37316c][_0xa677('0x9')]||'';_0x1dfee0+='\x20<';_0x1dfee0+=_0x25c63b[_0xa677('0x8')][_0x37316c]['address']?_0x25c63b[_0xa677('0x8')][_0x37316c][_0xa677('0x9')]:_0xa677('0xa')+random[_0xa677('0xb')](0x6)+_0xa677('0xc');_0x1dfee0+='>';}}return _0x1dfee0;}function parseEmail(_0x2085c6,_0x5cbea0,_0x2e8113){if(_0x5cbea0['html']){var _0x470e0a=/