From: support
Date: Fri, 15 Jul 2022 07:25:36 +0000 (+0000)
Subject: Built motion from commit 79c7c506.|2.6.12
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20110license.mail?a=commitdiff_plain;h=d1148890bfb71a4f9f5146c986498fef313c23d2;p=motion2.git
Built motion from commit 79c7c506.|2.6.12
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 179e544..5693245 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-15T07:03:09.832Z",
+ "time": "2022-07-15T07:17:21.265Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9f0eaf5..e42e02f 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-15T07:03:09.832Z",
+ "time": "2022-07-15T07:17:21.265Z",
"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 6c6a32b..12061a6 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 _0x5e85=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','STRING','motionbar','jscripty','browser'];(function(_0x1c8de9,_0x5b826b){var _0x284b59=function(_0xb0c110){while(--_0xb0c110){_0x1c8de9['push'](_0x1c8de9['shift']());}};_0x284b59(++_0x5b826b);}(_0x5e85,0x161));var _0x55e8=function(_0x878aa5,_0x163df7){_0x878aa5=_0x878aa5-0x0;var _0x35534b=_0x5e85[_0x878aa5];return _0x35534b;};'use strict';var Sequelize=require(_0x55e8('0x0'));module[_0x55e8('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b3374){return this[_0x55e8('0x2')]('action');}},'action':{'type':Sequelize[_0x55e8('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x55e8('0x4'),_0x55e8('0x5'),'urlForward',_0x55e8('0x6'),_0x55e8('0x7'),_0x55e8('0x8')]],'msg':_0x55e8('0x9')}},'comment':_0x55e8('0x9')},'data1':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comment':_0x55e8('0xa')},'data2':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comment':_0x55e8('0xb')},'data3':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comment':_0x55e8('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x55e8('0xd')},'data5':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comments':_0x55e8('0xe')},'data6':{'type':Sequelize[_0x55e8('0x3')],'comments':_0x55e8('0xf')},'data7':{'type':Sequelize[_0x55e8('0x10')],'comments':_0x55e8('0x11')}};
\ No newline at end of file
+var _0xf5cc=['exports','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x4bd7c1,_0x49412b){var _0x3b64fe=function(_0x289658){while(--_0x289658){_0x4bd7c1['push'](_0x4bd7c1['shift']());}};_0x3b64fe(++_0x49412b);}(_0xf5cc,0x1af));var _0xcf5c=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0xf5cc[_0x13137e];return _0x346261;};'use strict';var Sequelize=require(_0xcf5c('0x0'));module[_0xcf5c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3a0aed){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0xcf5c('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xcf5c('0x3'),_0xcf5c('0x4'),_0xcf5c('0x5'),_0xcf5c('0x6'),_0xcf5c('0x7'),'browser',_0xcf5c('0x8'),_0xcf5c('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xcf5c('0xa')},'data1':{'type':Sequelize[_0xcf5c('0x2')](0x1000),'comment':_0xcf5c('0xb')},'data2':{'type':Sequelize[_0xcf5c('0x2')](0x1000),'comment':_0xcf5c('0xc')},'data3':{'type':Sequelize[_0xcf5c('0x2')](0x1000),'comment':_0xcf5c('0xd')},'data4':{'type':Sequelize[_0xcf5c('0x2')](0x1000),'comments':_0xcf5c('0xe')},'data5':{'type':Sequelize[_0xcf5c('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0xcf5c('0xf')},'data7':{'type':Sequelize[_0xcf5c('0x10')],'comments':_0xcf5c('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index bfed0dc..aca7d9f 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 _0x5cf8=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','body','find','params','Action','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv'];(function(_0x80b32f,_0x890ca){var _0x599198=function(_0x4aa7db){while(--_0x4aa7db){_0x80b32f['push'](_0x80b32f['shift']());}};_0x599198(++_0x890ca);}(_0x5cf8,0xe0));var _0x85cf=function(_0x55e45c,_0x3fd637){_0x55e45c=_0x55e45c-0x0;var _0x5d304e=_0x5cf8[_0x55e45c];return _0x5d304e;};'use strict';var emlformat=require(_0x85cf('0x0'));var rimraf=require(_0x85cf('0x1'));var zipdir=require(_0x85cf('0x2'));var jsonpatch=require(_0x85cf('0x3'));var rp=require(_0x85cf('0x4'));var moment=require('moment');var BPromise=require(_0x85cf('0x5'));var Mustache=require(_0x85cf('0x6'));var util=require(_0x85cf('0x7'));var path=require('path');var sox=require(_0x85cf('0x8'));var csv=require('to-csv');var ejs=require(_0x85cf('0x9'));var fs=require('fs');var fs_extra=require(_0x85cf('0xa'));var _=require(_0x85cf('0xb'));var squel=require(_0x85cf('0xc'));var crypto=require(_0x85cf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x85cf('0xe'));var toCsv=require(_0x85cf('0xf'));var querystring=require(_0x85cf('0x10'));var Papa=require(_0x85cf('0x11'));var Redis=require(_0x85cf('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x85cf('0x13'));var hardwareService=require(_0x85cf('0x14'));var logger=require(_0x85cf('0x15'))(_0x85cf('0x16'));var utils=require(_0x85cf('0x17'));var config=require(_0x85cf('0x18'));var licenseUtil=require(_0x85cf('0x19'));var db=require(_0x85cf('0x1a'))['db'];function respondWithStatusCode(_0x2c87ad,_0x3249f8){_0x3249f8=_0x3249f8||0xcc;return function(_0x4c005b){if(_0x4c005b){return _0x2c87ad[_0x85cf('0x1b')](_0x3249f8);}return _0x2c87ad[_0x85cf('0x1c')](_0x3249f8)[_0x85cf('0x1d')]();};}function respondWithResult(_0x16595e,_0x2200e4){_0x2200e4=_0x2200e4||0xc8;return function(_0x2a3606){if(_0x2a3606){return _0x16595e[_0x85cf('0x1c')](_0x2200e4)[_0x85cf('0x1e')](_0x2a3606);}};}function respondWithFilteredResult(_0x4eb40f,_0x34b31d){return function(_0x284aac){if(_0x284aac){var _0x5b4702=typeof _0x34b31d[_0x85cf('0x1f')]==='undefined'&&typeof _0x34b31d['limit']==='undefined';var _0x305869=_0x284aac[_0x85cf('0x20')];var _0x4128c6=_0x5b4702?0x0:_0x34b31d[_0x85cf('0x1f')];var _0x425294=_0x5b4702?_0x284aac['count']:_0x34b31d[_0x85cf('0x1f')]+_0x34b31d[_0x85cf('0x21')];var _0x1abac3;if(_0x425294>=_0x305869){_0x425294=_0x305869;_0x1abac3=0xc8;}else{_0x1abac3=0xce;}_0x4eb40f['status'](_0x1abac3);return _0x4eb40f[_0x85cf('0x22')](_0x85cf('0x23'),_0x4128c6+'-'+_0x425294+'/'+_0x305869)['json'](_0x284aac);}return null;};}function patchUpdates(_0x52d19d){return function(_0x2aa61c){try{jsonpatch[_0x85cf('0x24')](_0x2aa61c,_0x52d19d,!![]);}catch(_0x95943e){return BPromise[_0x85cf('0x25')](_0x95943e);}return _0x2aa61c['save']();};}function saveUpdates(_0x3708d9,_0xe27031){return function(_0x1101a5){if(_0x1101a5){return _0x1101a5[_0x85cf('0x26')](_0x3708d9)[_0x85cf('0x27')](function(_0x1a9135){return _0x1a9135;});}return null;};}function removeEntity(_0x49943e,_0x343254){return function(_0x1369a1){if(_0x1369a1){return _0x1369a1[_0x85cf('0x28')]()['then'](function(){_0x49943e['status'](0xcc)[_0x85cf('0x1d')]();});}};}function handleEntityNotFound(_0x5f30ef,_0x16f14f){return function(_0x338b19){if(!_0x338b19){_0x5f30ef['sendStatus'](0x194);}return _0x338b19;};}function handleError(_0x584e8c,_0x2c389b){_0x2c389b=_0x2c389b||0x1f4;return function(_0x58fbbd){logger['error'](_0x58fbbd[_0x85cf('0x29')]);if(_0x58fbbd[_0x85cf('0x2a')]){delete _0x58fbbd[_0x85cf('0x2a')];}_0x584e8c['status'](_0x2c389b)['send'](_0x58fbbd);};}exports[_0x85cf('0x26')]=function(_0x2b3965,_0x52c79f){if(_0x2b3965[_0x85cf('0x2b')]['id']){delete _0x2b3965[_0x85cf('0x2b')]['id'];}return db['Action'][_0x85cf('0x2c')]({'where':{'id':_0x2b3965[_0x85cf('0x2d')]['id']}})[_0x85cf('0x27')](handleEntityNotFound(_0x52c79f,null))[_0x85cf('0x27')](saveUpdates(_0x2b3965[_0x85cf('0x2b')],null))[_0x85cf('0x27')](respondWithResult(_0x52c79f,null))['catch'](handleError(_0x52c79f,null));};exports[_0x85cf('0x28')]=function(_0x369aaa,_0x50e783){return db[_0x85cf('0x2e')]['find']({'where':{'id':_0x369aaa['params']['id']}})['then'](handleEntityNotFound(_0x50e783,null))[_0x85cf('0x27')](removeEntity(_0x50e783,null))[_0x85cf('0x2f')](handleError(_0x50e783,null));};
\ No newline at end of file
+var _0xa9f7=['fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','reject','save','update','then','destroy','sendStatus','stack','name','send','body','Action','params','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x5e96ec,_0x4e09da){var _0x27d5a5=function(_0x422fda){while(--_0x422fda){_0x5e96ec['push'](_0x5e96ec['shift']());}};_0x27d5a5(++_0x4e09da);}(_0xa9f7,0x19b));var _0x7a9f=function(_0x1662b1,_0xed1ef0){_0x1662b1=_0x1662b1-0x0;var _0x5bd242=_0xa9f7[_0x1662b1];return _0x5bd242;};'use strict';var emlformat=require(_0x7a9f('0x0'));var rimraf=require(_0x7a9f('0x1'));var zipdir=require(_0x7a9f('0x2'));var jsonpatch=require(_0x7a9f('0x3'));var rp=require(_0x7a9f('0x4'));var moment=require(_0x7a9f('0x5'));var BPromise=require(_0x7a9f('0x6'));var Mustache=require(_0x7a9f('0x7'));var util=require('util');var path=require(_0x7a9f('0x8'));var sox=require(_0x7a9f('0x9'));var csv=require(_0x7a9f('0xa'));var ejs=require(_0x7a9f('0xb'));var fs=require('fs');var fs_extra=require(_0x7a9f('0xc'));var _=require(_0x7a9f('0xd'));var squel=require(_0x7a9f('0xe'));var crypto=require(_0x7a9f('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7a9f('0xa'));var querystring=require(_0x7a9f('0x10'));var Papa=require('papaparse');var Redis=require(_0x7a9f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7a9f('0x12'));var as=require(_0x7a9f('0x13'));var hardwareService=require(_0x7a9f('0x14'));var logger=require(_0x7a9f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x7a9f('0x16'));var licenseUtil=require(_0x7a9f('0x17'));var db=require(_0x7a9f('0x18'))['db'];function respondWithStatusCode(_0x383594,_0x3d48e7){_0x3d48e7=_0x3d48e7||0xcc;return function(_0x2a8f4b){if(_0x2a8f4b){return _0x383594['sendStatus'](_0x3d48e7);}return _0x383594[_0x7a9f('0x19')](_0x3d48e7)[_0x7a9f('0x1a')]();};}function respondWithResult(_0x41aaa4,_0xde7ca6){_0xde7ca6=_0xde7ca6||0xc8;return function(_0xc8faa){if(_0xc8faa){return _0x41aaa4['status'](_0xde7ca6)['json'](_0xc8faa);}};}function respondWithFilteredResult(_0x28102b,_0x5efa67){return function(_0x128058){if(_0x128058){var _0x444f40=typeof _0x5efa67[_0x7a9f('0x1b')]===_0x7a9f('0x1c')&&typeof _0x5efa67['limit']===_0x7a9f('0x1c');var _0x1f1cb7=_0x128058[_0x7a9f('0x1d')];var _0x122d1f=_0x444f40?0x0:_0x5efa67[_0x7a9f('0x1b')];var _0x1c966a=_0x444f40?_0x128058[_0x7a9f('0x1d')]:_0x5efa67[_0x7a9f('0x1b')]+_0x5efa67[_0x7a9f('0x1e')];var _0x159496;if(_0x1c966a>=_0x1f1cb7){_0x1c966a=_0x1f1cb7;_0x159496=0xc8;}else{_0x159496=0xce;}_0x28102b['status'](_0x159496);return _0x28102b[_0x7a9f('0x1f')]('Content-Range',_0x122d1f+'-'+_0x1c966a+'/'+_0x1f1cb7)[_0x7a9f('0x20')](_0x128058);}return null;};}function patchUpdates(_0x257063){return function(_0x23a93a){try{jsonpatch['apply'](_0x23a93a,_0x257063,!![]);}catch(_0x5c218d){return BPromise[_0x7a9f('0x21')](_0x5c218d);}return _0x23a93a[_0x7a9f('0x22')]();};}function saveUpdates(_0xd27ea5,_0x736edb){return function(_0x443179){if(_0x443179){return _0x443179[_0x7a9f('0x23')](_0xd27ea5)[_0x7a9f('0x24')](function(_0xbc2f8a){return _0xbc2f8a;});}return null;};}function removeEntity(_0x108130,_0x276d78){return function(_0x5914cb){if(_0x5914cb){return _0x5914cb[_0x7a9f('0x25')]()[_0x7a9f('0x24')](function(){_0x108130[_0x7a9f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59382c,_0x2f069b){return function(_0x5f5170){if(!_0x5f5170){_0x59382c[_0x7a9f('0x26')](0x194);}return _0x5f5170;};}function handleError(_0x469222,_0xc93bb9){_0xc93bb9=_0xc93bb9||0x1f4;return function(_0x24d9d7){logger['error'](_0x24d9d7[_0x7a9f('0x27')]);if(_0x24d9d7[_0x7a9f('0x28')]){delete _0x24d9d7[_0x7a9f('0x28')];}_0x469222[_0x7a9f('0x19')](_0xc93bb9)[_0x7a9f('0x29')](_0x24d9d7);};}exports[_0x7a9f('0x23')]=function(_0x18d4c3,_0x3caf9a){if(_0x18d4c3[_0x7a9f('0x2a')]['id']){delete _0x18d4c3[_0x7a9f('0x2a')]['id'];}return db[_0x7a9f('0x2b')]['find']({'where':{'id':_0x18d4c3[_0x7a9f('0x2c')]['id']}})[_0x7a9f('0x24')](handleEntityNotFound(_0x3caf9a,null))[_0x7a9f('0x24')](saveUpdates(_0x18d4c3[_0x7a9f('0x2a')],null))[_0x7a9f('0x24')](respondWithResult(_0x3caf9a,null))['catch'](handleError(_0x3caf9a,null));};exports[_0x7a9f('0x25')]=function(_0x2d22bb,_0x10e1aa){return db[_0x7a9f('0x2b')][_0x7a9f('0x2d')]({'where':{'id':_0x2d22bb['params']['id']}})[_0x7a9f('0x24')](handleEntityNotFound(_0x10e1aa,null))[_0x7a9f('0x24')](removeEntity(_0x10e1aa,null))[_0x7a9f('0x2e')](handleError(_0x10e1aa,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index ec6ba48..4928d01 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 _0xff01=['rimraf','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4e198a,_0x5a6bad){var _0xb84bfe=function(_0x58d2b2){while(--_0x58d2b2){_0x4e198a['push'](_0x4e198a['shift']());}};_0xb84bfe(++_0x5a6bad);}(_0xff01,0x130));var _0x1ff0=function(_0xfe28c5,_0x452499){_0xfe28c5=_0xfe28c5-0x0;var _0xad25d1=_0xff01[_0xfe28c5];return _0xad25d1;};'use strict';var _=require(_0x1ff0('0x0'));var util=require(_0x1ff0('0x1'));var logger=require(_0x1ff0('0x2'))(_0x1ff0('0x3'));var moment=require(_0x1ff0('0x4'));var BPromise=require(_0x1ff0('0x5'));var rp=require(_0x1ff0('0x6'));var fs=require('fs');var path=require(_0x1ff0('0x7'));var rimraf=require(_0x1ff0('0x8'));var config=require('../../config/environment');var attributes=require(_0x1ff0('0x9'));module['exports']=function(_0x34c0f2,_0x43d97b){return _0x34c0f2[_0x1ff0('0xa')](_0x1ff0('0xb'),attributes,{'tableName':_0x1ff0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1596=['define','Action','tools_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./action.attributes','exports'];(function(_0x22c0a4,_0x57a1f5){var _0x1b0bea=function(_0x9958e8){while(--_0x9958e8){_0x22c0a4['push'](_0x22c0a4['shift']());}};_0x1b0bea(++_0x57a1f5);}(_0x1596,0x16f));var _0x6159=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1596[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x6159('0x0'));var util=require(_0x6159('0x1'));var logger=require(_0x6159('0x2'))(_0x6159('0x3'));var moment=require('moment');var BPromise=require(_0x6159('0x4'));var rp=require(_0x6159('0x5'));var fs=require('fs');var path=require(_0x6159('0x6'));var rimraf=require('rimraf');var config=require(_0x6159('0x7'));var attributes=require(_0x6159('0x8'));module[_0x6159('0x9')]=function(_0x50665b,_0x21f136){return _0x50665b[_0x6159('0xa')](_0x6159('0xb'),attributes,{'tableName':_0x6159('0xc'),'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 1e5d425..1b2d353 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 _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(_0x822d4e,_0x3acaac){var _0x5b7fd9=function(_0x4055e6){while(--_0x4055e6){_0x822d4e['push'](_0x822d4e['shift']());}};_0x5b7fd9(++_0x3acaac);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'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
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x542575,_0x251452){var _0x11ad0a=function(_0x4bbede){while(--_0x4bbede){_0x542575['push'](_0x542575['shift']());}};_0x11ad0a(++_0x251452);}(_0x5fab,0x177));var _0xb5fa=function(_0x475278,_0x38c7a9){_0x475278=_0x475278-0x0;var _0x26da4e=_0x5fab[_0x475278];return _0x26da4e;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 97def7a..b76ae69 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 _0x347e=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated','update','delete','exports','multer','util','path'];(function(_0x1a45e3,_0x385589){var _0x3615f8=function(_0x40ce0a){while(--_0x40ce0a){_0x1a45e3['push'](_0x1a45e3['shift']());}};_0x3615f8(++_0x385589);}(_0x347e,0x135));var _0xe347=function(_0x24e893,_0x130483){_0x24e893=_0x24e893-0x0;var _0x437e82=_0x347e[_0x24e893];return _0x437e82;};'use strict';var multer=require(_0xe347('0x0'));var util=require(_0xe347('0x1'));var path=require(_0xe347('0x2'));var timeout=require(_0xe347('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe347('0x4'));var auth=require(_0xe347('0x5'));var interaction=require(_0xe347('0x6'));var config=require('../../config/environment');var controller=require(_0xe347('0x7'));router['put'](_0xe347('0x8'),auth[_0xe347('0x9')](),controller[_0xe347('0xa')]);router[_0xe347('0xb')]('/:id',auth[_0xe347('0x9')](),controller['destroy']);module[_0xe347('0xc')]=router;
\ No newline at end of file
+var _0xeb6a=['multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','destroy','exports'];(function(_0x208f6d,_0x428050){var _0x8e579e=function(_0x7482e1){while(--_0x7482e1){_0x208f6d['push'](_0x208f6d['shift']());}};_0x8e579e(++_0x428050);}(_0xeb6a,0x18c));var _0xaeb6=function(_0x2bce9c,_0x45ebd1){_0x2bce9c=_0x2bce9c-0x0;var _0x1a91c3=_0xeb6a[_0x2bce9c];return _0x1a91c3;};'use strict';var multer=require(_0xaeb6('0x0'));var util=require(_0xaeb6('0x1'));var path=require(_0xaeb6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xaeb6('0x3'));var auth=require(_0xaeb6('0x4'));var interaction=require(_0xaeb6('0x5'));var config=require('../../config/environment');var controller=require(_0xaeb6('0x6'));router[_0xaeb6('0x7')](_0xaeb6('0x8'),auth[_0xaeb6('0x9')](),controller['update']);router['delete'](_0xaeb6('0x8'),auth[_0xaeb6('0x9')](),controller[_0xaeb6('0xa')]);module[_0xaeb6('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 296788e..5214ea1 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 _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x1a043b,_0x4d540a){var _0x105ff5=function(_0x49532e){while(--_0x49532e){_0x1a043b['push'](_0x1a043b['shift']());}};_0x105ff5(++_0x4d540a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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
+var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x17f822,_0x484879){_0x17f822=_0x17f822-0x0;var _0x4a5bfa=_0x8ef6[_0x17f822];return _0x4a5bfa;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 6bb2151..2212be1 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 _0x1e91=['send','index','map','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','AnalyticCustomReport','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','QueryTypes','COUNT(%s)','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','Sequelize','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','savename','COUNT(*)','sequelize','SELECT','run','runReport','value','select','metric','debug','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','../../mysqldb','dbH','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','get','UserProfileResource','error','name'];(function(_0x3ba1b1,_0x35446d){var _0x473018=function(_0x11ca92){while(--_0x11ca92){_0x3ba1b1['push'](_0x3ba1b1['shift']());}};_0x473018(++_0x35446d);}(_0x1e91,0x1d0));var _0x11e9=function(_0x27f424,_0xa6af37){_0x27f424=_0x27f424-0x0;var _0x5ae589=_0x1e91[_0x27f424];return _0x5ae589;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11e9('0x0'));var zipdir=require(_0x11e9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11e9('0x2'));var moment=require(_0x11e9('0x3'));var BPromise=require(_0x11e9('0x4'));var Mustache=require(_0x11e9('0x5'));var util=require('util');var path=require(_0x11e9('0x6'));var sox=require(_0x11e9('0x7'));var csv=require(_0x11e9('0x8'));var ejs=require(_0x11e9('0x9'));var fs=require('fs');var fs_extra=require(_0x11e9('0xa'));var _=require('lodash');var squel=require(_0x11e9('0xb'));var crypto=require(_0x11e9('0xc'));var jsforce=require(_0x11e9('0xd'));var deskjs=require(_0x11e9('0xe'));var toCsv=require(_0x11e9('0x8'));var querystring=require('querystring');var Papa=require(_0x11e9('0xf'));var Redis=require(_0x11e9('0x10'));var authService=require(_0x11e9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x11e9('0x12'));var logger=require(_0x11e9('0x13'))(_0x11e9('0x14'));var utils=require(_0x11e9('0x15'));var config=require(_0x11e9('0x16'));var licenseUtil=require(_0x11e9('0x17'));var db=require(_0x11e9('0x18'))['db'];var dbH=require(_0x11e9('0x18'))[_0x11e9('0x19')];function respondWithStatusCode(_0x3f51c6,_0x2e9c78){_0x2e9c78=_0x2e9c78||0xcc;return function(_0x290e9b){if(_0x290e9b){return _0x3f51c6['sendStatus'](_0x2e9c78);}return _0x3f51c6['status'](_0x2e9c78)[_0x11e9('0x1a')]();};}function respondWithResult(_0x2abd33,_0x5b3e0a){_0x5b3e0a=_0x5b3e0a||0xc8;return function(_0x30629e){if(_0x30629e){return _0x2abd33[_0x11e9('0x1b')](_0x5b3e0a)[_0x11e9('0x1c')](_0x30629e);}};}function respondWithFilteredResult(_0x4b2364,_0x19031d){return function(_0xecf89a){if(_0xecf89a){var _0x1d831d=typeof _0x19031d[_0x11e9('0x1d')]===_0x11e9('0x1e')&&typeof _0x19031d['limit']===_0x11e9('0x1e');var _0x468e66=_0xecf89a[_0x11e9('0x1f')];var _0x232622=_0x1d831d?0x0:_0x19031d[_0x11e9('0x1d')];var _0x49679b=_0x1d831d?_0xecf89a[_0x11e9('0x1f')]:_0x19031d[_0x11e9('0x1d')]+_0x19031d[_0x11e9('0x20')];var _0x384608;if(_0x49679b>=_0x468e66){_0x49679b=_0x468e66;_0x384608=0xc8;}else{_0x384608=0xce;}_0x4b2364[_0x11e9('0x1b')](_0x384608);return _0x4b2364[_0x11e9('0x21')]('Content-Range',_0x232622+'-'+_0x49679b+'/'+_0x468e66)[_0x11e9('0x1c')](_0xecf89a);}return null;};}function patchUpdates(_0x48fb76){return function(_0x4cb8cf){try{jsonpatch[_0x11e9('0x22')](_0x4cb8cf,_0x48fb76,!![]);}catch(_0x57eebe){return BPromise[_0x11e9('0x23')](_0x57eebe);}return _0x4cb8cf[_0x11e9('0x24')]();};}function saveUpdates(_0x5a0744,_0x598c76){return function(_0x38831c){if(_0x38831c){return _0x38831c[_0x11e9('0x25')](_0x5a0744)[_0x11e9('0x26')](function(_0x27eb23){return _0x27eb23;});}return null;};}function removeEntity(_0x1521c4,_0xccaa9b){return function(_0x1c73c8){if(_0x1c73c8){return _0x1c73c8['destroy']()[_0x11e9('0x26')](function(){var _0x278a2f=_0x1c73c8[_0x11e9('0x27')]({'plain':!![]});var _0x43f763='CustomReports';return db[_0x11e9('0x28')]['destroy']({'where':{'type':_0x43f763,'resourceId':_0x278a2f['id']}})[_0x11e9('0x26')](function(){return _0x1c73c8;});})[_0x11e9('0x26')](function(){_0x1521c4['status'](0xcc)[_0x11e9('0x1a')]();});}};}function handleEntityNotFound(_0x46af11,_0x40279d){return function(_0x44ebd5){if(!_0x44ebd5){_0x46af11['sendStatus'](0x194);}return _0x44ebd5;};}function handleError(_0x42096e,_0x4ca2bd){_0x4ca2bd=_0x4ca2bd||0x1f4;return function(_0x3a0c78){logger[_0x11e9('0x29')](_0x3a0c78['stack']);if(_0x3a0c78['name']){delete _0x3a0c78[_0x11e9('0x2a')];}_0x42096e[_0x11e9('0x1b')](_0x4ca2bd)[_0x11e9('0x2b')](_0x3a0c78);};}exports[_0x11e9('0x2c')]=function(_0x1a1bde,_0x582079){var _0x1b8281={},_0x1f668f={},_0x1f309f={'count':0x0,'rows':[]};var _0x502bf2=_[_0x11e9('0x2d')](db['AnalyticCustomReport']['rawAttributes'],function(_0x33b7e0){return{'name':_0x33b7e0['fieldName'],'type':_0x33b7e0[_0x11e9('0x2e')][_0x11e9('0x2f')]};});_0x1f668f[_0x11e9('0x30')]=_[_0x11e9('0x2d')](_0x502bf2,_0x11e9('0x2a'));_0x1f668f['query']=_[_0x11e9('0x31')](_0x1a1bde['query']);_0x1f668f['filters']=_[_0x11e9('0x32')](_0x1f668f[_0x11e9('0x30')],_0x1f668f[_0x11e9('0x33')]);_0x1b8281[_0x11e9('0x34')]=_['intersection'](_0x1f668f['model'],qs[_0x11e9('0x35')](_0x1a1bde['query'][_0x11e9('0x35')]));_0x1b8281[_0x11e9('0x34')]=_0x1b8281[_0x11e9('0x34')][_0x11e9('0x36')]?_0x1b8281['attributes']:_0x1f668f[_0x11e9('0x30')];if(!_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x37')](_0x11e9('0x38'))){_0x1b8281[_0x11e9('0x20')]=qs[_0x11e9('0x20')](_0x1a1bde['query'][_0x11e9('0x20')]);_0x1b8281[_0x11e9('0x1d')]=qs[_0x11e9('0x1d')](_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x1d')]);}_0x1b8281[_0x11e9('0x39')]=qs[_0x11e9('0x3a')](_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x3a')]);_0x1b8281[_0x11e9('0x3b')]=qs[_0x11e9('0x3c')](_[_0x11e9('0x3d')](_0x1a1bde[_0x11e9('0x33')],_0x1f668f['filters']),_0x502bf2);if(_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x3e')]){_0x1b8281[_0x11e9('0x3b')]=_['merge'](_0x1b8281[_0x11e9('0x3b')],{'$or':_[_0x11e9('0x2d')](_0x502bf2,function(_0x43a37f){if(_0x43a37f[_0x11e9('0x2e')]!=='VIRTUAL'){var _0x1cd6e7={};_0x1cd6e7[_0x43a37f['name']]={'$like':'%'+_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x3e')]+'%'};return _0x1cd6e7;}})});}_0x1b8281=_[_0x11e9('0x3f')]({},_0x1b8281,_0x1a1bde[_0x11e9('0x40')]);var _0x252abb={'where':_0x1b8281[_0x11e9('0x3b')]};return db[_0x11e9('0x41')][_0x11e9('0x1f')](_0x252abb)[_0x11e9('0x26')](function(_0x3022e6){_0x1f309f[_0x11e9('0x1f')]=_0x3022e6;if(_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x42')]){_0x1b8281['include']=[{'all':!![]}];}return db[_0x11e9('0x41')][_0x11e9('0x43')](_0x1b8281);})[_0x11e9('0x26')](function(_0x52b6c3){_0x1f309f[_0x11e9('0x44')]=_0x52b6c3;return _0x1f309f;})[_0x11e9('0x26')](respondWithFilteredResult(_0x582079,_0x1b8281))[_0x11e9('0x45')](handleError(_0x582079,null));};exports[_0x11e9('0x46')]=function(_0x2b88ec,_0x3fe633){var _0x962f9b={'raw':![],'where':{'id':_0x2b88ec[_0x11e9('0x47')]['id']}},_0x354edc={};_0x354edc['model']=_[_0x11e9('0x31')](db['AnalyticCustomReport'][_0x11e9('0x48')]);_0x354edc['query']=_['keys'](_0x2b88ec[_0x11e9('0x33')]);_0x354edc[_0x11e9('0x3c')]=_[_0x11e9('0x32')](_0x354edc[_0x11e9('0x30')],_0x354edc[_0x11e9('0x33')]);_0x962f9b['attributes']=_['intersection'](_0x354edc[_0x11e9('0x30')],qs[_0x11e9('0x35')](_0x2b88ec[_0x11e9('0x33')][_0x11e9('0x35')]));_0x962f9b[_0x11e9('0x34')]=_0x962f9b[_0x11e9('0x34')][_0x11e9('0x36')]?_0x962f9b['attributes']:_0x354edc[_0x11e9('0x30')];if(_0x2b88ec[_0x11e9('0x33')][_0x11e9('0x42')]){_0x962f9b[_0x11e9('0x49')]=[{'all':!![]}];}_0x962f9b=_[_0x11e9('0x3f')]({},_0x962f9b,_0x2b88ec[_0x11e9('0x40')]);return db['AnalyticCustomReport'][_0x11e9('0x4a')](_0x962f9b)[_0x11e9('0x26')](handleEntityNotFound(_0x3fe633,null))[_0x11e9('0x26')](respondWithResult(_0x3fe633,null))[_0x11e9('0x45')](handleError(_0x3fe633,null));};exports['create']=function(_0x41099,_0x472cde){return db[_0x11e9('0x41')][_0x11e9('0x4b')](_0x41099[_0x11e9('0x4c')],{})[_0x11e9('0x26')](function(_0x3186e4){var _0x7e4ea7=_0x41099[_0x11e9('0x4d')][_0x11e9('0x27')]({'plain':!![]});if(!_0x7e4ea7)throw new Error(_0x11e9('0x4e'));if(_0x7e4ea7[_0x11e9('0x4f')]==='user'){var _0x12323c=_0x3186e4[_0x11e9('0x27')]({'plain':!![]});var _0x282bd7=_0x11e9('0x50');return db[_0x11e9('0x51')][_0x11e9('0x4a')]({'where':{'name':_0x282bd7,'userProfileId':_0x7e4ea7['userProfileId']},'raw':!![]})[_0x11e9('0x26')](function(_0x4c6f74){if(_0x4c6f74&&_0x4c6f74[_0x11e9('0x52')]===0x0){return db['UserProfileResource'][_0x11e9('0x4b')]({'name':_0x12323c[_0x11e9('0x2a')],'resourceId':_0x12323c['id'],'type':_0x11e9('0x53'),'sectionId':_0x4c6f74['id']},{})[_0x11e9('0x26')](function(){return _0x3186e4;});}else{return _0x3186e4;}})[_0x11e9('0x45')](function(_0x15cef8){logger['error'](_0x11e9('0x54'),_0x15cef8);throw _0x15cef8;});}return _0x3186e4;})[_0x11e9('0x26')](respondWithResult(_0x472cde,0xc9))[_0x11e9('0x45')](handleError(_0x472cde,null));};exports[_0x11e9('0x25')]=function(_0x5dc41e,_0x588d8e){if(_0x5dc41e[_0x11e9('0x4c')]['id']){delete _0x5dc41e[_0x11e9('0x4c')]['id'];}return db[_0x11e9('0x41')][_0x11e9('0x4a')]({'where':{'id':_0x5dc41e[_0x11e9('0x47')]['id']}})[_0x11e9('0x26')](handleEntityNotFound(_0x588d8e,null))[_0x11e9('0x26')](saveUpdates(_0x5dc41e[_0x11e9('0x4c')],null))[_0x11e9('0x26')](respondWithResult(_0x588d8e,null))['catch'](handleError(_0x588d8e,null));};exports[_0x11e9('0x55')]=function(_0x4ca36a,_0x1a30be){return db['AnalyticCustomReport'][_0x11e9('0x4a')]({'where':{'id':_0x4ca36a[_0x11e9('0x47')]['id']}})[_0x11e9('0x26')](handleEntityNotFound(_0x1a30be,null))[_0x11e9('0x26')](removeEntity(_0x1a30be,null))[_0x11e9('0x45')](handleError(_0x1a30be,null));};exports[_0x11e9('0x56')]=function(_0x2f231e,_0x31949e){var _0x56c81f=0xa;var _0x201756=[_0x11e9('0x57'),_0x11e9('0x58'),_0x11e9('0x59'),_0x11e9('0x5a')];var _0x549b79={'SUM':_0x11e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x11e9('0x5c'),'MAX':_0x11e9('0x5d'),'MIN':_0x11e9('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x11e9('0x5f'),'GROUP_CONCAT ASC':_0x11e9('0x60'),'GROUP_CONCAT DESC':_0x11e9('0x61')};var _0x3b4f91={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x11e9('0x62'),'ROUND':_0x11e9('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4fa69e=function(_0x239f29){return!_[_0x11e9('0x64')]([_0x11e9('0x65'),_0x11e9('0x66'),'IS\x20EMPTY',_0x11e9('0x67')],_0x239f29);};var _0x99fd7=function(_0x165cfd){if(!_0x165cfd||!_0x165cfd['rules'][_0x11e9('0x36')]){return'';}for(var _0x3340e0='(',_0x1e29b0=0x0;_0x1e29b0<_0x165cfd[_0x11e9('0x68')][_0x11e9('0x36')];_0x1e29b0+=0x1){_0x1e29b0>0x0&&(_0x3340e0+='\x20'+_0x165cfd[_0x11e9('0x69')]+'\x20');_0x3340e0+=_0x165cfd[_0x11e9('0x68')][_0x1e29b0][_0x11e9('0x6a')]?_0x99fd7(_0x165cfd[_0x11e9('0x68')][_0x1e29b0][_0x11e9('0x6a')]):_0x165cfd[_0x11e9('0x68')][_0x1e29b0]['field']+'\x20'+_0x165cfd['rules'][_0x1e29b0]['condition']+(_0x4fa69e(_0x165cfd[_0x11e9('0x68')][_0x1e29b0][_0x11e9('0x6b')])?'\x20'+_0x165cfd[_0x11e9('0x68')][_0x1e29b0]['value']:'');}return _0x3340e0+')';};var _0x361c8c={'where':{'id':_0x2f231e['params']['id']}},_0x124532,_0xffad16,_0x3801f0,_0x3572e1,_0x7341eb;_0x361c8c=_[_0x11e9('0x3f')]({},_0x361c8c,_0x2f231e[_0x11e9('0x40')]);return db[_0x11e9('0x41')][_0x11e9('0x4a')](_0x361c8c)['then'](function(_0x26984a){if(_0x26984a){_0x124532=_0x26984a;return _0x26984a[_0x11e9('0x6c')]();}return null;})[_0x11e9('0x26')](function(_0x44caf0){if(_0x44caf0){if(!_0x44caf0[_0x11e9('0x36')]){throw new db['Sequelize'][(_0x11e9('0x6d'))](_0x11e9('0x6e'),0x193);}_0xffad16=_0x44caf0;return db[_0x11e9('0x6f')][_0x11e9('0x43')]({'raw':!![]});}return null;})[_0x11e9('0x26')](function(_0x344095){if(_0x344095){_0x3801f0=_[_0x11e9('0x70')](_0x344095,'id');var _0x39acd1;var _0x3d48a1=squel['select']();_0x3d48a1[_0x11e9('0x71')](_0x124532[_0x11e9('0x72')]);for(var _0x2de040=0x0;_0x2de040<_0xffad16[_0x11e9('0x36')];_0x2de040+=0x1){_0x39acd1=_0xffad16[_0x2de040][_0x11e9('0x73')]?_0x3801f0[_0xffad16[_0x2de040][_0x11e9('0x73')]]['metric']:_0xffad16[_0x2de040][_0x11e9('0x74')];_0x39acd1=_0xffad16[_0x2de040][_0x11e9('0x75')]?_[_0x11e9('0x76')](_0x549b79[_0xffad16[_0x2de040][_0x11e9('0x75')]],'%s',_0x39acd1):_0x39acd1;_0x39acd1=_0xffad16[_0x2de040][_0x11e9('0x77')]?_['replace'](_0x3b4f91[_0xffad16[_0x2de040][_0x11e9('0x77')]],'%s',_0x39acd1):_0x39acd1;if(_0xffad16[_0x2de040][_0x11e9('0x78')]){_0x3d48a1['group'](_0x39acd1);}_0xffad16[_0x2de040]['orderBy']&&_0x3d48a1[_0x11e9('0x39')](_0x39acd1,_0xffad16[_0x2de040][_0x11e9('0x79')]===_0x11e9('0x7a')?![]:!![]);_0x3d48a1['field'](_0x39acd1,_0xffad16[_0x2de040][_0x11e9('0x7b')]||_0x39acd1);}if(_0x124532[_0x11e9('0x7c')]){_0x124532[_0x11e9('0x7c')]=JSON[_0x11e9('0x7d')](_0x124532['joins']);for(var _0x7ef269=0x0;_0x7ef269<_0x124532[_0x11e9('0x7c')][_0x11e9('0x36')];_0x7ef269+=0x1){if(_0x124532['joins'][_0x7ef269][_0x11e9('0x2e')]&&_['includes'](_0x201756,_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x2e')])&&_0x124532['joins'][_0x7ef269][_0x11e9('0x7e')]&&_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x7f')]&&_0x124532[_0x11e9('0x7c')][_0x7ef269]['foreignKey']){_0x3d48a1[_0x124532['joins'][_0x7ef269]['type']](_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x7f')],null,util['format'](_0x11e9('0x80'),_0x124532[_0x11e9('0x72')],_0x124532[_0x11e9('0x7c')][_0x7ef269]['parentKey'],_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x7f')],_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x81')]));}}}if(_0x124532['conditions']){_0x124532[_0x11e9('0x82')]=JSON[_0x11e9('0x7d')](_0x124532['conditions']);_0x3d48a1[_0x11e9('0x3b')](_0x99fd7(_0x124532[_0x11e9('0x82')][_0x11e9('0x6a')]));}_0x7341eb=_0x3d48a1[_0x11e9('0x83')]();_0x3d48a1[_0x11e9('0x20')](_0x56c81f);_0x3d48a1[_0x11e9('0x1d')](0x0);logger['debug'](_0x11e9('0x84'),_0x3d48a1[_0x11e9('0x85')]());return dbH['sequelize']['query'](_0x3d48a1[_0x11e9('0x85')](),{'type':dbH['sequelize'][_0x11e9('0x86')]['SELECT']});}})[_0x11e9('0x26')](respondWithResult(_0x31949e,null))[_0x11e9('0x45')](handleError(_0x31949e,null));};function runReport(_0x56d38b,_0x40b67d,_0x5d29ed){var _0x13b7eb=_0x40b67d['name'];var _0x2297a4=0xa;var _0x270905=[_0x11e9('0x57'),_0x11e9('0x58'),_0x11e9('0x59'),_0x11e9('0x5a')];var _0x2ed1fd={'SUM':'SUM(%s)','COUNT':_0x11e9('0x87'),'COUNT DISTINCT':_0x11e9('0x5c'),'MAX':_0x11e9('0x5d'),'MIN':_0x11e9('0x5e'),'AVG':_0x11e9('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x11e9('0x60'),'GROUP_CONCAT DESC':_0x11e9('0x61')};var _0x49d3a2={'SEC_TO_TIME':_0x11e9('0x89'),'DATE':_0x11e9('0x8a'),'HOUR':_0x11e9('0x62'),'ROUND':_0x11e9('0x63'),'UNIX_TIMESTAMP':_0x11e9('0x8b')};var _0x145727=function(_0x43376e){return!_['includes']([_0x11e9('0x65'),_0x11e9('0x66'),_0x11e9('0x8c'),_0x11e9('0x67')],_0x43376e);};var _0x49d742=function(_0xeb16a9){if(!_0xeb16a9||!_0xeb16a9[_0x11e9('0x68')][_0x11e9('0x36')]){return'';}for(var _0x540d1f='(',_0x42c6b3=0x0;_0x42c6b3<_0xeb16a9['rules'][_0x11e9('0x36')];_0x42c6b3+=0x1){_0x42c6b3>0x0&&(_0x540d1f+='\x20'+_0xeb16a9['operator']+'\x20');_0x540d1f+=_0xeb16a9[_0x11e9('0x68')][_0x42c6b3][_0x11e9('0x6a')]?_0x49d742(_0xeb16a9[_0x11e9('0x68')][_0x42c6b3][_0x11e9('0x6a')]):_0xeb16a9[_0x11e9('0x68')][_0x42c6b3]['field']+'\x20'+_0xeb16a9[_0x11e9('0x68')][_0x42c6b3][_0x11e9('0x6b')]+(_0x145727(_0xeb16a9['rules'][_0x42c6b3][_0x11e9('0x6b')])?'\x20'+_0xeb16a9['rules'][_0x42c6b3]['value']:'');}return _0x540d1f+')';};var _0x203c03={'where':{'id':_0x56d38b['id']}},_0x4bf3c4,_0x5a38e2,_0x34d8e7,_0xbc6a54,_0x209e8e;_0x203c03=_['merge']({},_0x203c03,_0x5d29ed);return db[_0x11e9('0x41')]['find'](_0x203c03)['then'](function(_0x4b1a87){if(_0x4b1a87){_0x4bf3c4=_0x4b1a87;return _0x4b1a87[_0x11e9('0x6c')]();}return null;})[_0x11e9('0x26')](function(_0x556ca9){if(_0x556ca9){if(!_0x556ca9[_0x11e9('0x36')]){throw new db[(_0x11e9('0x8d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5a38e2=_0x556ca9;return db[_0x11e9('0x6f')][_0x11e9('0x43')]({'raw':!![]});}return null;})[_0x11e9('0x26')](function(_0x56b34f){if(_0x56b34f){_0x34d8e7=_['keyBy'](_0x56b34f,'id');var _0x124cee;var _0x36217d=squel['select']();_0x36217d[_0x11e9('0x71')](_0x4bf3c4[_0x11e9('0x72')]);for(var _0x4de937=0x0;_0x4de937<_0x5a38e2[_0x11e9('0x36')];_0x4de937+=0x1){_0x124cee=_0x5a38e2[_0x4de937]['MetricId']?_0x34d8e7[_0x5a38e2[_0x4de937]['MetricId']]['metric']:_0x5a38e2[_0x4de937]['field'];_0x124cee=_0x5a38e2[_0x4de937][_0x11e9('0x75')]?_[_0x11e9('0x76')](_0x2ed1fd[_0x5a38e2[_0x4de937]['function']],'%s',_0x124cee):_0x124cee;_0x124cee=_0x5a38e2[_0x4de937]['format']?_[_0x11e9('0x76')](_0x49d3a2[_0x5a38e2[_0x4de937]['format']],'%s',_0x124cee):_0x124cee;if(_0x5a38e2[_0x4de937][_0x11e9('0x78')]){_0x36217d[_0x11e9('0x6a')](_0x124cee);}_0x5a38e2[_0x4de937][_0x11e9('0x79')]&&_0x36217d[_0x11e9('0x39')](_0x124cee,_0x5a38e2[_0x4de937]['orderBy']===_0x11e9('0x7a')?![]:!![]);_0x36217d[_0x11e9('0x74')](_0x124cee,_0x5a38e2[_0x4de937][_0x11e9('0x7b')]||_0x124cee);}if(_0x4bf3c4[_0x11e9('0x7c')]){_0x4bf3c4['joins']=JSON[_0x11e9('0x7d')](_0x4bf3c4[_0x11e9('0x7c')]);for(var _0x357077=0x0;_0x357077<_0x4bf3c4['joins'][_0x11e9('0x36')];_0x357077+=0x1){if(_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x2e')]&&_['includes'](_0x270905,_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x2e')])&&_0x4bf3c4['joins'][_0x357077]['parentKey']&&_0x4bf3c4[_0x11e9('0x7c')][_0x357077]['foreignTable']&&_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x81')]){_0x36217d[_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x2e')]](_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x7f')],null,util[_0x11e9('0x77')]('%s.%s\x20=\x20%s.%s',_0x4bf3c4[_0x11e9('0x72')],_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x7e')],_0x4bf3c4[_0x11e9('0x7c')][_0x357077]['foreignTable'],_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x81')]));}}}if(_0x4bf3c4[_0x11e9('0x82')]){_0x4bf3c4[_0x11e9('0x82')]=JSON[_0x11e9('0x7d')](_0x4bf3c4[_0x11e9('0x82')]);_0x36217d[_0x11e9('0x3b')](_0x49d742(_0x4bf3c4[_0x11e9('0x82')][_0x11e9('0x6a')]));}_0x209e8e=_0x36217d[_0x11e9('0x83')]();_0x36217d[_0x11e9('0x20')](_0x2297a4);_0x36217d[_0x11e9('0x1d')](0x0);return;}})[_0x11e9('0x26')](function(){if(_0x40b67d[_0x11e9('0x8e')]===_0x11e9('0x8f')){return null;}var _0x456074=_[_0x11e9('0x3f')](_0x40b67d,{'name':_0x40b67d[_0x11e9('0x90')]||_0x40b67d[_0x11e9('0x2a')]||_0x4bf3c4[_0x11e9('0x2a')],'basename':_0x13b7eb,'savename':util[_0x11e9('0x77')]('%s-%s.%s',_0x40b67d[_0x11e9('0x2a')]||_0x4bf3c4[_0x11e9('0x2a')],require(_0x11e9('0x91'))[_0x11e9('0x92')](0x4),_0x40b67d[_0x11e9('0x8e')]||_0x11e9('0x93')),'reportId':_0x4bf3c4['id'],'reportType':_0x11e9('0x94')});return db[_0x11e9('0x95')]['create'](_0x456074,{'raw':!![]});})['then'](function(_0x134f75){if(_0x4bf3c4['table']==='cdr'){_0x209e8e['where'](_0x4bf3c4[_0x11e9('0x72')]+_0x11e9('0x96'),_0x40b67d[_0x11e9('0x97')],_0x40b67d[_0x11e9('0x98')]);}else{_0x209e8e[_0x11e9('0x3b')](_0x4bf3c4[_0x11e9('0x72')]+_0x11e9('0x99'),_0x40b67d[_0x11e9('0x97')],_0x40b67d[_0x11e9('0x98')]);}if(_0x134f75){logger[_0x11e9('0x9a')](_0x11e9('0x9b'),_0x209e8e[_0x11e9('0x85')]());require(_0x11e9('0x9c'))[_0x11e9('0x9d')](path['join'](__dirname,_0x11e9('0x9e'),_0x134f75['output']),[_0x134f75['id'],_0x209e8e[_0x11e9('0x85')](),path[_0x11e9('0x57')](__dirname,'../../files/reports',_0x134f75[_0x11e9('0x9f')]),_0x13b7eb]);return _0x134f75;}else{var _0xc2f347=squel['select']();_0xc2f347[_0x11e9('0x71')]('('+_0x209e8e[_0x11e9('0x85')]()+')','countTable');_0xc2f347[_0x11e9('0x74')](_0x11e9('0xa0'),_0x11e9('0x1f'));_0x209e8e[_0x11e9('0x20')](_0x40b67d['limit']||_0x2297a4);_0x209e8e[_0x11e9('0x1d')](_0x40b67d[_0x11e9('0x1d')]||0x0);return dbH[_0x11e9('0xa1')]['query'](_0xc2f347['toString'](),{'type':dbH[_0x11e9('0xa1')][_0x11e9('0x86')]['SELECT']})[_0x11e9('0x26')](function(_0x21592d){if(!_0x21592d[_0x11e9('0x36')]){_0xbc6a54=0x0;}else{_0xbc6a54=_0x21592d[0x0][_0x11e9('0x1f')]||0x0;}return dbH[_0x11e9('0xa1')]['query'](_0x209e8e[_0x11e9('0x85')](),{'type':dbH[_0x11e9('0xa1')][_0x11e9('0x86')][_0x11e9('0xa2')]});})['then'](function(_0x5ebccf){return{'rows':_0x5ebccf||[],'count':_0xbc6a54};});}});}exports[_0x11e9('0xa3')]=function(_0x299dc7,_0x51e2d5){return runReport(_0x299dc7[_0x11e9('0x47')],_0x299dc7['query'],_0x299dc7[_0x11e9('0x40')])['then'](respondWithResult(_0x51e2d5,null))['catch'](handleError(_0x51e2d5,null));};exports[_0x11e9('0xa4')]=runReport;exports[_0x11e9('0x33')]=function(_0x221300,_0x5dd0a5){var _0x2e3ed0=0xa;var _0x1333e4=[_0x11e9('0x57'),_0x11e9('0x58'),_0x11e9('0x59'),_0x11e9('0x5a')];var _0xd2aa06={'SUM':_0x11e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x11e9('0x5c'),'MAX':_0x11e9('0x5d'),'MIN':_0x11e9('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x11e9('0x5f'),'GROUP_CONCAT ASC':_0x11e9('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xe8b688={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x11e9('0x8a'),'HOUR':_0x11e9('0x62'),'ROUND':_0x11e9('0x63'),'UNIX_TIMESTAMP':_0x11e9('0x8b')};var _0x440c64=function(_0x432da6){return!_['includes']([_0x11e9('0x65'),_0x11e9('0x66'),_0x11e9('0x8c'),_0x11e9('0x67')],_0x432da6);};var _0x7aee04=function(_0x13b7f6){if(!_0x13b7f6||!_0x13b7f6[_0x11e9('0x68')][_0x11e9('0x36')]){return'';}for(var _0x202bbd='(',_0x7a25b1=0x0;_0x7a25b1<_0x13b7f6[_0x11e9('0x68')][_0x11e9('0x36')];_0x7a25b1+=0x1){_0x7a25b1>0x0&&(_0x202bbd+='\x20'+_0x13b7f6[_0x11e9('0x69')]+'\x20');_0x202bbd+=_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6a')]?_0x7aee04(_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6a')]):_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x74')]+'\x20'+_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6b')]+(_0x440c64(_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6b')])?'\x20'+_0x13b7f6['rules'][_0x7a25b1][_0x11e9('0xa5')]:'');}return _0x202bbd+')';};var _0x19cb52={'where':{'id':_0x221300[_0x11e9('0x47')]['id']}},_0x1c2031,_0x377fdf,_0x5b2a4c,_0x5bf5f7,_0x404128;_0x19cb52=_[_0x11e9('0x3f')]({},_0x19cb52,_0x221300[_0x11e9('0x40')]);return db[_0x11e9('0x41')][_0x11e9('0x4a')](_0x19cb52)['then'](function(_0x1dd63c){if(_0x1dd63c){_0x1c2031=_0x1dd63c;return _0x1dd63c['getFields']();}return null;})[_0x11e9('0x26')](function(_0x43e7b4){if(_0x43e7b4){if(!_0x43e7b4['length']){throw new db['Sequelize'][(_0x11e9('0x6d'))](_0x11e9('0x6e'),0x193);}_0x377fdf=_0x43e7b4;return db[_0x11e9('0x6f')][_0x11e9('0x43')]({'raw':!![]});}return null;})[_0x11e9('0x26')](function(_0x20fbd8){if(_0x20fbd8){_0x5b2a4c=_[_0x11e9('0x70')](_0x20fbd8,'id');var _0x557f0d;var _0x430002=squel[_0x11e9('0xa6')]();_0x430002[_0x11e9('0x71')](_0x1c2031[_0x11e9('0x72')]);for(var _0x460cd9=0x0;_0x460cd9<_0x377fdf['length'];_0x460cd9+=0x1){_0x557f0d=_0x377fdf[_0x460cd9][_0x11e9('0x73')]?_0x5b2a4c[_0x377fdf[_0x460cd9][_0x11e9('0x73')]][_0x11e9('0xa7')]:_0x377fdf[_0x460cd9]['field'];_0x557f0d=_0x377fdf[_0x460cd9]['function']?_[_0x11e9('0x76')](_0xd2aa06[_0x377fdf[_0x460cd9][_0x11e9('0x75')]],'%s',_0x557f0d):_0x557f0d;_0x557f0d=_0x377fdf[_0x460cd9][_0x11e9('0x77')]?_[_0x11e9('0x76')](_0xe8b688[_0x377fdf[_0x460cd9]['format']],'%s',_0x557f0d):_0x557f0d;if(_0x377fdf[_0x460cd9][_0x11e9('0x78')]){_0x430002[_0x11e9('0x6a')](_0x557f0d);}_0x377fdf[_0x460cd9][_0x11e9('0x79')]&&_0x430002['order'](_0x557f0d,_0x377fdf[_0x460cd9]['orderBy']===_0x11e9('0x7a')?![]:!![]);_0x430002[_0x11e9('0x74')](_0x557f0d,_0x377fdf[_0x460cd9]['alias']||_0x557f0d);}if(_0x1c2031[_0x11e9('0x7c')]){_0x1c2031[_0x11e9('0x7c')]=JSON['parse'](_0x1c2031[_0x11e9('0x7c')]);for(var _0x4108a9=0x0;_0x4108a9<_0x1c2031[_0x11e9('0x7c')][_0x11e9('0x36')];_0x4108a9+=0x1){if(_0x1c2031['joins'][_0x4108a9]['type']&&_[_0x11e9('0x64')](_0x1333e4,_0x1c2031['joins'][_0x4108a9]['type'])&&_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x7e')]&&_0x1c2031['joins'][_0x4108a9][_0x11e9('0x7f')]&&_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x81')]){_0x430002[_0x1c2031['joins'][_0x4108a9]['type']](_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x7f')],null,util[_0x11e9('0x77')]('%s.%s\x20=\x20%s.%s',_0x1c2031['table'],_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x7e')],_0x1c2031['joins'][_0x4108a9][_0x11e9('0x7f')],_0x1c2031['joins'][_0x4108a9][_0x11e9('0x81')]));}}}if(_0x1c2031[_0x11e9('0x82')]){_0x1c2031['conditions']=JSON[_0x11e9('0x7d')](_0x1c2031['conditions']);_0x430002['where'](_0x7aee04(_0x1c2031['conditions'][_0x11e9('0x6a')]));}_0x404128=_0x430002['clone']();_0x430002[_0x11e9('0x20')](_0x2e3ed0);_0x430002[_0x11e9('0x1d')](0x0);logger[_0x11e9('0xa8')]('Limited\x20Query:',_0x430002[_0x11e9('0x85')]());return dbH[_0x11e9('0xa1')][_0x11e9('0x33')](_0x430002['toString'](),{'type':dbH[_0x11e9('0xa1')][_0x11e9('0x86')][_0x11e9('0xa2')]});}})[_0x11e9('0x26')](function(){return{'sql':_0x404128['toString']()};})['then'](respondWithResult(_0x5dd0a5,null))['catch'](handleError(_0x5dd0a5,null));};
\ No newline at end of file
+var _0xebfc=['name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','includeAll','include','catch','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','MetricId','metric','function','format','replace','orderBy','alias','joins','foreignTable','foreignKey','table','parentKey','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','left_join','SUM(%s)','AVG(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','select','DESC','%s.%s\x20=\x20%s.%s','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','SEC_TO_TIME(%s)','operator','groupBy','eml-format','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack'];(function(_0x54ece6,_0x11a6c6){var _0x2cfd35=function(_0x8163c6){while(--_0x8163c6){_0x54ece6['push'](_0x54ece6['shift']());}};_0x2cfd35(++_0x11a6c6);}(_0xebfc,0x12b));var _0xcebf=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xebfc[_0x59bcb1];return _0x4a737f;};'use strict';var emlformat=require(_0xcebf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcebf('0x1'));var moment=require(_0xcebf('0x2'));var BPromise=require(_0xcebf('0x3'));var Mustache=require(_0xcebf('0x4'));var util=require('util');var path=require(_0xcebf('0x5'));var sox=require(_0xcebf('0x6'));var csv=require('to-csv');var ejs=require(_0xcebf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcebf('0x8'));var squel=require(_0xcebf('0x9'));var crypto=require(_0xcebf('0xa'));var jsforce=require(_0xcebf('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcebf('0xc'));var Papa=require('papaparse');var Redis=require(_0xcebf('0xd'));var authService=require(_0xcebf('0xe'));var qs=require(_0xcebf('0xf'));var as=require(_0xcebf('0x10'));var hardwareService=require(_0xcebf('0x11'));var logger=require(_0xcebf('0x12'))(_0xcebf('0x13'));var utils=require(_0xcebf('0x14'));var config=require(_0xcebf('0x15'));var licenseUtil=require(_0xcebf('0x16'));var db=require(_0xcebf('0x17'))['db'];var dbH=require(_0xcebf('0x17'))[_0xcebf('0x18')];function respondWithStatusCode(_0x3f1ced,_0x4ca807){_0x4ca807=_0x4ca807||0xcc;return function(_0x2d2854){if(_0x2d2854){return _0x3f1ced['sendStatus'](_0x4ca807);}return _0x3f1ced[_0xcebf('0x19')](_0x4ca807)[_0xcebf('0x1a')]();};}function respondWithResult(_0xf1d6b9,_0x2d397c){_0x2d397c=_0x2d397c||0xc8;return function(_0x5bfc37){if(_0x5bfc37){return _0xf1d6b9[_0xcebf('0x19')](_0x2d397c)[_0xcebf('0x1b')](_0x5bfc37);}};}function respondWithFilteredResult(_0xc46843,_0x53c9fd){return function(_0x1820ab){if(_0x1820ab){var _0x549321=typeof _0x53c9fd[_0xcebf('0x1c')]===_0xcebf('0x1d')&&typeof _0x53c9fd['limit']===_0xcebf('0x1d');var _0x2c7f46=_0x1820ab[_0xcebf('0x1e')];var _0xaf825d=_0x549321?0x0:_0x53c9fd[_0xcebf('0x1c')];var _0x7854db=_0x549321?_0x1820ab[_0xcebf('0x1e')]:_0x53c9fd['offset']+_0x53c9fd[_0xcebf('0x1f')];var _0x12c4cf;if(_0x7854db>=_0x2c7f46){_0x7854db=_0x2c7f46;_0x12c4cf=0xc8;}else{_0x12c4cf=0xce;}_0xc46843[_0xcebf('0x19')](_0x12c4cf);return _0xc46843[_0xcebf('0x20')](_0xcebf('0x21'),_0xaf825d+'-'+_0x7854db+'/'+_0x2c7f46)['json'](_0x1820ab);}return null;};}function patchUpdates(_0x1a307e){return function(_0x4d19de){try{jsonpatch[_0xcebf('0x22')](_0x4d19de,_0x1a307e,!![]);}catch(_0x4e9e76){return BPromise[_0xcebf('0x23')](_0x4e9e76);}return _0x4d19de[_0xcebf('0x24')]();};}function saveUpdates(_0x59cf79,_0x11dd83){return function(_0x657bdc){if(_0x657bdc){return _0x657bdc[_0xcebf('0x25')](_0x59cf79)[_0xcebf('0x26')](function(_0x4e1461){return _0x4e1461;});}return null;};}function removeEntity(_0x427736,_0xb38452){return function(_0x5d187c){if(_0x5d187c){return _0x5d187c[_0xcebf('0x27')]()['then'](function(){var _0x2428d5=_0x5d187c['get']({'plain':!![]});var _0x415b39=_0xcebf('0x28');return db[_0xcebf('0x29')]['destroy']({'where':{'type':_0x415b39,'resourceId':_0x2428d5['id']}})[_0xcebf('0x26')](function(){return _0x5d187c;});})['then'](function(){_0x427736['status'](0xcc)[_0xcebf('0x1a')]();});}};}function handleEntityNotFound(_0x5aea6a,_0x3e046a){return function(_0x281282){if(!_0x281282){_0x5aea6a[_0xcebf('0x2a')](0x194);}return _0x281282;};}function handleError(_0x3268d7,_0x5997fd){_0x5997fd=_0x5997fd||0x1f4;return function(_0x1dcd53){logger[_0xcebf('0x2b')](_0x1dcd53[_0xcebf('0x2c')]);if(_0x1dcd53[_0xcebf('0x2d')]){delete _0x1dcd53[_0xcebf('0x2d')];}_0x3268d7['status'](_0x5997fd)[_0xcebf('0x2e')](_0x1dcd53);};}exports[_0xcebf('0x2f')]=function(_0x215cd3,_0x2e7b11){var _0xf30306={},_0x93f444={},_0x5a867e={'count':0x0,'rows':[]};var _0x2cfd7f=_[_0xcebf('0x30')](db[_0xcebf('0x31')][_0xcebf('0x32')],function(_0x577366){return{'name':_0x577366[_0xcebf('0x33')],'type':_0x577366[_0xcebf('0x34')][_0xcebf('0x35')]};});_0x93f444[_0xcebf('0x36')]=_[_0xcebf('0x30')](_0x2cfd7f,_0xcebf('0x2d'));_0x93f444[_0xcebf('0x37')]=_[_0xcebf('0x38')](_0x215cd3['query']);_0x93f444[_0xcebf('0x39')]=_[_0xcebf('0x3a')](_0x93f444['model'],_0x93f444[_0xcebf('0x37')]);_0xf30306['attributes']=_[_0xcebf('0x3a')](_0x93f444[_0xcebf('0x36')],qs[_0xcebf('0x3b')](_0x215cd3[_0xcebf('0x37')]['fields']));_0xf30306['attributes']=_0xf30306['attributes']['length']?_0xf30306[_0xcebf('0x3c')]:_0x93f444[_0xcebf('0x36')];if(!_0x215cd3[_0xcebf('0x37')][_0xcebf('0x3d')](_0xcebf('0x3e'))){_0xf30306['limit']=qs['limit'](_0x215cd3[_0xcebf('0x37')][_0xcebf('0x1f')]);_0xf30306[_0xcebf('0x1c')]=qs[_0xcebf('0x1c')](_0x215cd3[_0xcebf('0x37')][_0xcebf('0x1c')]);}_0xf30306[_0xcebf('0x3f')]=qs['sort'](_0x215cd3[_0xcebf('0x37')]['sort']);_0xf30306[_0xcebf('0x40')]=qs[_0xcebf('0x39')](_[_0xcebf('0x41')](_0x215cd3[_0xcebf('0x37')],_0x93f444[_0xcebf('0x39')]),_0x2cfd7f);if(_0x215cd3[_0xcebf('0x37')][_0xcebf('0x42')]){_0xf30306[_0xcebf('0x40')]=_['merge'](_0xf30306[_0xcebf('0x40')],{'$or':_[_0xcebf('0x30')](_0x2cfd7f,function(_0x4327e6){if(_0x4327e6[_0xcebf('0x34')]!==_0xcebf('0x43')){var _0x52cdf3={};_0x52cdf3[_0x4327e6[_0xcebf('0x2d')]]={'$like':'%'+_0x215cd3['query'][_0xcebf('0x42')]+'%'};return _0x52cdf3;}})});}_0xf30306=_[_0xcebf('0x44')]({},_0xf30306,_0x215cd3['options']);var _0x57516a={'where':_0xf30306[_0xcebf('0x40')]};return db['AnalyticCustomReport']['count'](_0x57516a)[_0xcebf('0x26')](function(_0x1c1a37){_0x5a867e[_0xcebf('0x1e')]=_0x1c1a37;if(_0x215cd3[_0xcebf('0x37')][_0xcebf('0x45')]){_0xf30306[_0xcebf('0x46')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0xf30306);})[_0xcebf('0x26')](function(_0x168d52){_0x5a867e['rows']=_0x168d52;return _0x5a867e;})[_0xcebf('0x26')](respondWithFilteredResult(_0x2e7b11,_0xf30306))[_0xcebf('0x47')](handleError(_0x2e7b11,null));};exports[_0xcebf('0x48')]=function(_0x720d6f,_0x1481ee){var _0x1af596={'raw':![],'where':{'id':_0x720d6f[_0xcebf('0x49')]['id']}},_0x30985a={};_0x30985a['model']=_[_0xcebf('0x38')](db[_0xcebf('0x31')][_0xcebf('0x32')]);_0x30985a[_0xcebf('0x37')]=_[_0xcebf('0x38')](_0x720d6f[_0xcebf('0x37')]);_0x30985a['filters']=_['intersection'](_0x30985a[_0xcebf('0x36')],_0x30985a[_0xcebf('0x37')]);_0x1af596[_0xcebf('0x3c')]=_[_0xcebf('0x3a')](_0x30985a[_0xcebf('0x36')],qs['fields'](_0x720d6f[_0xcebf('0x37')][_0xcebf('0x3b')]));_0x1af596[_0xcebf('0x3c')]=_0x1af596['attributes'][_0xcebf('0x4a')]?_0x1af596[_0xcebf('0x3c')]:_0x30985a['model'];if(_0x720d6f[_0xcebf('0x37')][_0xcebf('0x45')]){_0x1af596[_0xcebf('0x46')]=[{'all':!![]}];}_0x1af596=_[_0xcebf('0x44')]({},_0x1af596,_0x720d6f['options']);return db[_0xcebf('0x31')]['find'](_0x1af596)[_0xcebf('0x26')](handleEntityNotFound(_0x1481ee,null))['then'](respondWithResult(_0x1481ee,null))[_0xcebf('0x47')](handleError(_0x1481ee,null));};exports['create']=function(_0x562f19,_0x4d45e6){return db['AnalyticCustomReport'][_0xcebf('0x4b')](_0x562f19[_0xcebf('0x4c')],{})[_0xcebf('0x26')](function(_0x20c070){var _0x39867b=_0x562f19[_0xcebf('0x4d')][_0xcebf('0x4e')]({'plain':!![]});if(!_0x39867b)throw new Error(_0xcebf('0x4f'));if(_0x39867b['role']===_0xcebf('0x4d')){var _0x4da9e5=_0x20c070[_0xcebf('0x4e')]({'plain':!![]});var _0x17da20=_0xcebf('0x50');return db[_0xcebf('0x51')][_0xcebf('0x52')]({'where':{'name':_0x17da20,'userProfileId':_0x39867b[_0xcebf('0x53')]},'raw':!![]})[_0xcebf('0x26')](function(_0x1eb47f){if(_0x1eb47f&&_0x1eb47f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4da9e5[_0xcebf('0x2d')],'resourceId':_0x4da9e5['id'],'type':'CustomReports','sectionId':_0x1eb47f['id']},{})[_0xcebf('0x26')](function(){return _0x20c070;});}else{return _0x20c070;}})[_0xcebf('0x47')](function(_0x401d94){logger[_0xcebf('0x2b')](_0xcebf('0x54'),_0x401d94);throw _0x401d94;});}return _0x20c070;})['then'](respondWithResult(_0x4d45e6,0xc9))[_0xcebf('0x47')](handleError(_0x4d45e6,null));};exports[_0xcebf('0x25')]=function(_0x3bc55d,_0x3fd64c){if(_0x3bc55d['body']['id']){delete _0x3bc55d[_0xcebf('0x4c')]['id'];}return db[_0xcebf('0x31')][_0xcebf('0x52')]({'where':{'id':_0x3bc55d[_0xcebf('0x49')]['id']}})[_0xcebf('0x26')](handleEntityNotFound(_0x3fd64c,null))[_0xcebf('0x26')](saveUpdates(_0x3bc55d[_0xcebf('0x4c')],null))['then'](respondWithResult(_0x3fd64c,null))[_0xcebf('0x47')](handleError(_0x3fd64c,null));};exports[_0xcebf('0x27')]=function(_0x352d52,_0x141169){return db['AnalyticCustomReport'][_0xcebf('0x52')]({'where':{'id':_0x352d52[_0xcebf('0x49')]['id']}})[_0xcebf('0x26')](handleEntityNotFound(_0x141169,null))[_0xcebf('0x26')](removeEntity(_0x141169,null))['catch'](handleError(_0x141169,null));};exports[_0xcebf('0x55')]=function(_0x1801d8,_0x753eac){var _0x50f2dc=0xa;var _0x5ee6d2=[_0xcebf('0x56'),'left_join',_0xcebf('0x57'),_0xcebf('0x58')];var _0x58cf16={'SUM':'SUM(%s)','COUNT':_0xcebf('0x59'),'COUNT DISTINCT':_0xcebf('0x5a'),'MAX':_0xcebf('0x5b'),'MIN':_0xcebf('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcebf('0x5d'),'GROUP_CONCAT ASC':_0xcebf('0x5e'),'GROUP_CONCAT DESC':_0xcebf('0x5f')};var _0xd24097={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcebf('0x60'),'HOUR':_0xcebf('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xcebf('0x62')};var _0x3b3801=function(_0x21d32e){return!_[_0xcebf('0x63')](['IS\x20NULL',_0xcebf('0x64'),_0xcebf('0x65'),'IS\x20NOT\x20EMPTY'],_0x21d32e);};var _0x4a71d1=function(_0x18562d){if(!_0x18562d||!_0x18562d[_0xcebf('0x66')][_0xcebf('0x4a')]){return'';}for(var _0x1f0038='(',_0x20a713=0x0;_0x20a713<_0x18562d[_0xcebf('0x66')][_0xcebf('0x4a')];_0x20a713+=0x1){_0x20a713>0x0&&(_0x1f0038+='\x20'+_0x18562d['operator']+'\x20');_0x1f0038+=_0x18562d[_0xcebf('0x66')][_0x20a713]['group']?_0x4a71d1(_0x18562d[_0xcebf('0x66')][_0x20a713][_0xcebf('0x67')]):_0x18562d[_0xcebf('0x66')][_0x20a713][_0xcebf('0x68')]+'\x20'+_0x18562d['rules'][_0x20a713][_0xcebf('0x69')]+(_0x3b3801(_0x18562d['rules'][_0x20a713][_0xcebf('0x69')])?'\x20'+_0x18562d[_0xcebf('0x66')][_0x20a713][_0xcebf('0x6a')]:'');}return _0x1f0038+')';};var _0x4e9dc5={'where':{'id':_0x1801d8['params']['id']}},_0x3f2796,_0x705fcc,_0x332159,_0x3478eb,_0xe6a966;_0x4e9dc5=_[_0xcebf('0x44')]({},_0x4e9dc5,_0x1801d8[_0xcebf('0x6b')]);return db['AnalyticCustomReport'][_0xcebf('0x52')](_0x4e9dc5)[_0xcebf('0x26')](function(_0x31d007){if(_0x31d007){_0x3f2796=_0x31d007;return _0x31d007[_0xcebf('0x6c')]();}return null;})['then'](function(_0x4350c2){if(_0x4350c2){if(!_0x4350c2[_0xcebf('0x4a')]){throw new db[(_0xcebf('0x6d'))][(_0xcebf('0x6e'))](_0xcebf('0x6f'),0x193);}_0x705fcc=_0x4350c2;return db[_0xcebf('0x70')][_0xcebf('0x71')]({'raw':!![]});}return null;})['then'](function(_0x4b6907){if(_0x4b6907){_0x332159=_[_0xcebf('0x72')](_0x4b6907,'id');var _0xa22c3d;var _0x5692e6=squel['select']();_0x5692e6[_0xcebf('0x73')](_0x3f2796['table']);for(var _0x53793a=0x0;_0x53793a<_0x705fcc[_0xcebf('0x4a')];_0x53793a+=0x1){_0xa22c3d=_0x705fcc[_0x53793a]['MetricId']?_0x332159[_0x705fcc[_0x53793a][_0xcebf('0x74')]][_0xcebf('0x75')]:_0x705fcc[_0x53793a][_0xcebf('0x68')];_0xa22c3d=_0x705fcc[_0x53793a]['function']?_['replace'](_0x58cf16[_0x705fcc[_0x53793a][_0xcebf('0x76')]],'%s',_0xa22c3d):_0xa22c3d;_0xa22c3d=_0x705fcc[_0x53793a][_0xcebf('0x77')]?_[_0xcebf('0x78')](_0xd24097[_0x705fcc[_0x53793a]['format']],'%s',_0xa22c3d):_0xa22c3d;if(_0x705fcc[_0x53793a]['groupBy']){_0x5692e6[_0xcebf('0x67')](_0xa22c3d);}_0x705fcc[_0x53793a]['orderBy']&&_0x5692e6[_0xcebf('0x3f')](_0xa22c3d,_0x705fcc[_0x53793a][_0xcebf('0x79')]==='DESC'?![]:!![]);_0x5692e6[_0xcebf('0x68')](_0xa22c3d,_0x705fcc[_0x53793a][_0xcebf('0x7a')]||_0xa22c3d);}if(_0x3f2796[_0xcebf('0x7b')]){_0x3f2796[_0xcebf('0x7b')]=JSON['parse'](_0x3f2796[_0xcebf('0x7b')]);for(var _0x55088b=0x0;_0x55088b<_0x3f2796[_0xcebf('0x7b')][_0xcebf('0x4a')];_0x55088b+=0x1){if(_0x3f2796[_0xcebf('0x7b')][_0x55088b]['type']&&_['includes'](_0x5ee6d2,_0x3f2796[_0xcebf('0x7b')][_0x55088b]['type'])&&_0x3f2796[_0xcebf('0x7b')][_0x55088b]['parentKey']&&_0x3f2796[_0xcebf('0x7b')][_0x55088b][_0xcebf('0x7c')]&&_0x3f2796[_0xcebf('0x7b')][_0x55088b][_0xcebf('0x7d')]){_0x5692e6[_0x3f2796[_0xcebf('0x7b')][_0x55088b]['type']](_0x3f2796[_0xcebf('0x7b')][_0x55088b][_0xcebf('0x7c')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3f2796[_0xcebf('0x7e')],_0x3f2796[_0xcebf('0x7b')][_0x55088b][_0xcebf('0x7f')],_0x3f2796['joins'][_0x55088b][_0xcebf('0x7c')],_0x3f2796[_0xcebf('0x7b')][_0x55088b][_0xcebf('0x7d')]));}}}if(_0x3f2796[_0xcebf('0x80')]){_0x3f2796[_0xcebf('0x80')]=JSON[_0xcebf('0x81')](_0x3f2796[_0xcebf('0x80')]);_0x5692e6[_0xcebf('0x40')](_0x4a71d1(_0x3f2796[_0xcebf('0x80')]['group']));}_0xe6a966=_0x5692e6['clone']();_0x5692e6['limit'](_0x50f2dc);_0x5692e6['offset'](0x0);logger[_0xcebf('0x82')](_0xcebf('0x83'),_0x5692e6['toString']());return dbH[_0xcebf('0x84')]['query'](_0x5692e6[_0xcebf('0x85')](),{'type':dbH[_0xcebf('0x84')][_0xcebf('0x86')][_0xcebf('0x87')]});}})[_0xcebf('0x26')](respondWithResult(_0x753eac,null))[_0xcebf('0x47')](handleError(_0x753eac,null));};function runReport(_0x3f3dad,_0x333d56,_0x4a5be4){var _0x9d9c60=_0x333d56[_0xcebf('0x2d')];var _0x3aaee1=0xa;var _0x2eab23=[_0xcebf('0x56'),_0xcebf('0x88'),_0xcebf('0x57'),_0xcebf('0x58')];var _0xbf8ced={'SUM':_0xcebf('0x89'),'COUNT':_0xcebf('0x59'),'COUNT DISTINCT':_0xcebf('0x5a'),'MAX':_0xcebf('0x5b'),'MIN':_0xcebf('0x5c'),'AVG':_0xcebf('0x8a'),'GROUP_CONCAT':_0xcebf('0x5d'),'GROUP_CONCAT ASC':_0xcebf('0x5e'),'GROUP_CONCAT DESC':_0xcebf('0x5f')};var _0x2f2a2a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcebf('0x8b'),'UNIX_TIMESTAMP':_0xcebf('0x62')};var _0x551834=function(_0x529f62){return!_[_0xcebf('0x63')]([_0xcebf('0x8c'),_0xcebf('0x64'),_0xcebf('0x65'),_0xcebf('0x8d')],_0x529f62);};var _0x5ce925=function(_0x1845c8){if(!_0x1845c8||!_0x1845c8[_0xcebf('0x66')]['length']){return'';}for(var _0x59cf21='(',_0x4e8bab=0x0;_0x4e8bab<_0x1845c8[_0xcebf('0x66')]['length'];_0x4e8bab+=0x1){_0x4e8bab>0x0&&(_0x59cf21+='\x20'+_0x1845c8['operator']+'\x20');_0x59cf21+=_0x1845c8['rules'][_0x4e8bab]['group']?_0x5ce925(_0x1845c8[_0xcebf('0x66')][_0x4e8bab][_0xcebf('0x67')]):_0x1845c8[_0xcebf('0x66')][_0x4e8bab][_0xcebf('0x68')]+'\x20'+_0x1845c8[_0xcebf('0x66')][_0x4e8bab][_0xcebf('0x69')]+(_0x551834(_0x1845c8[_0xcebf('0x66')][_0x4e8bab][_0xcebf('0x69')])?'\x20'+_0x1845c8[_0xcebf('0x66')][_0x4e8bab][_0xcebf('0x6a')]:'');}return _0x59cf21+')';};var _0x287b51={'where':{'id':_0x3f3dad['id']}},_0x5d21ea,_0x57d72b,_0x14bea9,_0xc53a80,_0x789912;_0x287b51=_[_0xcebf('0x44')]({},_0x287b51,_0x4a5be4);return db[_0xcebf('0x31')]['find'](_0x287b51)[_0xcebf('0x26')](function(_0x54a4d2){if(_0x54a4d2){_0x5d21ea=_0x54a4d2;return _0x54a4d2['getFields']();}return null;})[_0xcebf('0x26')](function(_0x58ff0d){if(_0x58ff0d){if(!_0x58ff0d[_0xcebf('0x4a')]){throw new db[(_0xcebf('0x6d'))][(_0xcebf('0x6e'))](_0xcebf('0x6f'),0x193);}_0x57d72b=_0x58ff0d;return db['AnalyticMetric'][_0xcebf('0x71')]({'raw':!![]});}return null;})[_0xcebf('0x26')](function(_0x3619ca){if(_0x3619ca){_0x14bea9=_[_0xcebf('0x72')](_0x3619ca,'id');var _0x57c655;var _0x32bde4=squel[_0xcebf('0x8e')]();_0x32bde4[_0xcebf('0x73')](_0x5d21ea[_0xcebf('0x7e')]);for(var _0xe6645b=0x0;_0xe6645b<_0x57d72b[_0xcebf('0x4a')];_0xe6645b+=0x1){_0x57c655=_0x57d72b[_0xe6645b][_0xcebf('0x74')]?_0x14bea9[_0x57d72b[_0xe6645b]['MetricId']][_0xcebf('0x75')]:_0x57d72b[_0xe6645b]['field'];_0x57c655=_0x57d72b[_0xe6645b]['function']?_[_0xcebf('0x78')](_0xbf8ced[_0x57d72b[_0xe6645b][_0xcebf('0x76')]],'%s',_0x57c655):_0x57c655;_0x57c655=_0x57d72b[_0xe6645b][_0xcebf('0x77')]?_[_0xcebf('0x78')](_0x2f2a2a[_0x57d72b[_0xe6645b][_0xcebf('0x77')]],'%s',_0x57c655):_0x57c655;if(_0x57d72b[_0xe6645b]['groupBy']){_0x32bde4['group'](_0x57c655);}_0x57d72b[_0xe6645b][_0xcebf('0x79')]&&_0x32bde4['order'](_0x57c655,_0x57d72b[_0xe6645b][_0xcebf('0x79')]===_0xcebf('0x8f')?![]:!![]);_0x32bde4['field'](_0x57c655,_0x57d72b[_0xe6645b]['alias']||_0x57c655);}if(_0x5d21ea[_0xcebf('0x7b')]){_0x5d21ea[_0xcebf('0x7b')]=JSON['parse'](_0x5d21ea[_0xcebf('0x7b')]);for(var _0x1ca85e=0x0;_0x1ca85e<_0x5d21ea[_0xcebf('0x7b')][_0xcebf('0x4a')];_0x1ca85e+=0x1){if(_0x5d21ea[_0xcebf('0x7b')][_0x1ca85e][_0xcebf('0x34')]&&_[_0xcebf('0x63')](_0x2eab23,_0x5d21ea[_0xcebf('0x7b')][_0x1ca85e][_0xcebf('0x34')])&&_0x5d21ea['joins'][_0x1ca85e][_0xcebf('0x7f')]&&_0x5d21ea['joins'][_0x1ca85e][_0xcebf('0x7c')]&&_0x5d21ea[_0xcebf('0x7b')][_0x1ca85e][_0xcebf('0x7d')]){_0x32bde4[_0x5d21ea[_0xcebf('0x7b')][_0x1ca85e]['type']](_0x5d21ea[_0xcebf('0x7b')][_0x1ca85e]['foreignTable'],null,util[_0xcebf('0x77')](_0xcebf('0x90'),_0x5d21ea['table'],_0x5d21ea[_0xcebf('0x7b')][_0x1ca85e][_0xcebf('0x7f')],_0x5d21ea[_0xcebf('0x7b')][_0x1ca85e][_0xcebf('0x7c')],_0x5d21ea[_0xcebf('0x7b')][_0x1ca85e][_0xcebf('0x7d')]));}}}if(_0x5d21ea[_0xcebf('0x80')]){_0x5d21ea[_0xcebf('0x80')]=JSON['parse'](_0x5d21ea[_0xcebf('0x80')]);_0x32bde4[_0xcebf('0x40')](_0x5ce925(_0x5d21ea[_0xcebf('0x80')][_0xcebf('0x67')]));}_0x789912=_0x32bde4[_0xcebf('0x91')]();_0x32bde4[_0xcebf('0x1f')](_0x3aaee1);_0x32bde4[_0xcebf('0x1c')](0x0);return;}})[_0xcebf('0x26')](function(){if(_0x333d56[_0xcebf('0x92')]===_0xcebf('0x93')){return null;}var _0x51707c=_[_0xcebf('0x44')](_0x333d56,{'name':_0x333d56[_0xcebf('0x94')]||_0x333d56['name']||_0x5d21ea['name'],'basename':_0x9d9c60,'savename':util[_0xcebf('0x77')](_0xcebf('0x95'),_0x333d56[_0xcebf('0x2d')]||_0x5d21ea['name'],require(_0xcebf('0x96'))[_0xcebf('0x97')](0x4),_0x333d56[_0xcebf('0x92')]||_0xcebf('0x98')),'reportId':_0x5d21ea['id'],'reportType':_0xcebf('0x99')});return db[_0xcebf('0x9a')][_0xcebf('0x4b')](_0x51707c,{'raw':!![]});})[_0xcebf('0x26')](function(_0x3d8a9e){if(_0x5d21ea[_0xcebf('0x7e')]===_0xcebf('0x9b')){_0x789912['where'](_0x5d21ea[_0xcebf('0x7e')]+_0xcebf('0x9c'),_0x333d56['startDate'],_0x333d56['endDate']);}else{_0x789912[_0xcebf('0x40')](_0x5d21ea['table']+_0xcebf('0x9d'),_0x333d56[_0xcebf('0x9e')],_0x333d56[_0xcebf('0x9f')]);}if(_0x3d8a9e){logger[_0xcebf('0xa0')](_0xcebf('0xa1'),_0x789912[_0xcebf('0x85')]());require(_0xcebf('0xa2'))[_0xcebf('0xa3')](path[_0xcebf('0x56')](__dirname,'../../components/export/',_0x3d8a9e[_0xcebf('0x92')]),[_0x3d8a9e['id'],_0x789912['toString'](),path['join'](__dirname,_0xcebf('0xa4'),_0x3d8a9e[_0xcebf('0xa5')]),_0x9d9c60]);return _0x3d8a9e;}else{var _0x2acfcb=squel[_0xcebf('0x8e')]();_0x2acfcb[_0xcebf('0x73')]('('+_0x789912[_0xcebf('0x85')]()+')',_0xcebf('0xa6'));_0x2acfcb['field']('COUNT(*)',_0xcebf('0x1e'));_0x789912[_0xcebf('0x1f')](_0x333d56['limit']||_0x3aaee1);_0x789912[_0xcebf('0x1c')](_0x333d56[_0xcebf('0x1c')]||0x0);return dbH['sequelize']['query'](_0x2acfcb[_0xcebf('0x85')](),{'type':dbH[_0xcebf('0x84')][_0xcebf('0x86')][_0xcebf('0x87')]})[_0xcebf('0x26')](function(_0x1195ef){if(!_0x1195ef[_0xcebf('0x4a')]){_0xc53a80=0x0;}else{_0xc53a80=_0x1195ef[0x0]['count']||0x0;}return dbH[_0xcebf('0x84')]['query'](_0x789912['toString'](),{'type':dbH[_0xcebf('0x84')]['QueryTypes'][_0xcebf('0x87')]});})['then'](function(_0x10283a){return{'rows':_0x10283a||[],'count':_0xc53a80};});}});}exports[_0xcebf('0xa7')]=function(_0x322dc1,_0x916310){return runReport(_0x322dc1['params'],_0x322dc1[_0xcebf('0x37')],_0x322dc1[_0xcebf('0x6b')])['then'](respondWithResult(_0x916310,null))['catch'](handleError(_0x916310,null));};exports[_0xcebf('0xa8')]=runReport;exports['query']=function(_0x30573a,_0xd34285){var _0x553521=0xa;var _0x57a12a=[_0xcebf('0x56'),'left_join',_0xcebf('0x57'),_0xcebf('0x58')];var _0x295a3f={'SUM':'SUM(%s)','COUNT':_0xcebf('0x59'),'COUNT DISTINCT':_0xcebf('0x5a'),'MAX':_0xcebf('0x5b'),'MIN':_0xcebf('0x5c'),'AVG':_0xcebf('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcebf('0x5f')};var _0x4410fc={'SEC_TO_TIME':_0xcebf('0xa9'),'DATE':_0xcebf('0x60'),'HOUR':_0xcebf('0x61'),'ROUND':_0xcebf('0x8b'),'UNIX_TIMESTAMP':_0xcebf('0x62')};var _0x27ecb7=function(_0x41660c){return!_[_0xcebf('0x63')]([_0xcebf('0x8c'),_0xcebf('0x64'),'IS\x20EMPTY',_0xcebf('0x8d')],_0x41660c);};var _0x1e12e6=function(_0x51c88d){if(!_0x51c88d||!_0x51c88d[_0xcebf('0x66')][_0xcebf('0x4a')]){return'';}for(var _0x3e21df='(',_0x4a9129=0x0;_0x4a9129<_0x51c88d[_0xcebf('0x66')][_0xcebf('0x4a')];_0x4a9129+=0x1){_0x4a9129>0x0&&(_0x3e21df+='\x20'+_0x51c88d[_0xcebf('0xaa')]+'\x20');_0x3e21df+=_0x51c88d[_0xcebf('0x66')][_0x4a9129][_0xcebf('0x67')]?_0x1e12e6(_0x51c88d['rules'][_0x4a9129][_0xcebf('0x67')]):_0x51c88d[_0xcebf('0x66')][_0x4a9129][_0xcebf('0x68')]+'\x20'+_0x51c88d[_0xcebf('0x66')][_0x4a9129]['condition']+(_0x27ecb7(_0x51c88d[_0xcebf('0x66')][_0x4a9129][_0xcebf('0x69')])?'\x20'+_0x51c88d[_0xcebf('0x66')][_0x4a9129][_0xcebf('0x6a')]:'');}return _0x3e21df+')';};var _0x4510ed={'where':{'id':_0x30573a[_0xcebf('0x49')]['id']}},_0x400543,_0x1a32b4,_0x37cc5f,_0x4b4ed2,_0x460872;_0x4510ed=_[_0xcebf('0x44')]({},_0x4510ed,_0x30573a[_0xcebf('0x6b')]);return db[_0xcebf('0x31')]['find'](_0x4510ed)['then'](function(_0x761e7e){if(_0x761e7e){_0x400543=_0x761e7e;return _0x761e7e[_0xcebf('0x6c')]();}return null;})[_0xcebf('0x26')](function(_0x243a4d){if(_0x243a4d){if(!_0x243a4d[_0xcebf('0x4a')]){throw new db[(_0xcebf('0x6d'))]['ValidationErrorItem'](_0xcebf('0x6f'),0x193);}_0x1a32b4=_0x243a4d;return db[_0xcebf('0x70')]['findAll']({'raw':!![]});}return null;})[_0xcebf('0x26')](function(_0x2fd76e){if(_0x2fd76e){_0x37cc5f=_[_0xcebf('0x72')](_0x2fd76e,'id');var _0x160af7;var _0x2f5a32=squel['select']();_0x2f5a32[_0xcebf('0x73')](_0x400543[_0xcebf('0x7e')]);for(var _0x2d8832=0x0;_0x2d8832<_0x1a32b4[_0xcebf('0x4a')];_0x2d8832+=0x1){_0x160af7=_0x1a32b4[_0x2d8832][_0xcebf('0x74')]?_0x37cc5f[_0x1a32b4[_0x2d8832][_0xcebf('0x74')]]['metric']:_0x1a32b4[_0x2d8832][_0xcebf('0x68')];_0x160af7=_0x1a32b4[_0x2d8832][_0xcebf('0x76')]?_[_0xcebf('0x78')](_0x295a3f[_0x1a32b4[_0x2d8832][_0xcebf('0x76')]],'%s',_0x160af7):_0x160af7;_0x160af7=_0x1a32b4[_0x2d8832]['format']?_[_0xcebf('0x78')](_0x4410fc[_0x1a32b4[_0x2d8832]['format']],'%s',_0x160af7):_0x160af7;if(_0x1a32b4[_0x2d8832][_0xcebf('0xab')]){_0x2f5a32[_0xcebf('0x67')](_0x160af7);}_0x1a32b4[_0x2d8832][_0xcebf('0x79')]&&_0x2f5a32['order'](_0x160af7,_0x1a32b4[_0x2d8832]['orderBy']==='DESC'?![]:!![]);_0x2f5a32[_0xcebf('0x68')](_0x160af7,_0x1a32b4[_0x2d8832]['alias']||_0x160af7);}if(_0x400543['joins']){_0x400543['joins']=JSON[_0xcebf('0x81')](_0x400543[_0xcebf('0x7b')]);for(var _0x1e55e2=0x0;_0x1e55e2<_0x400543[_0xcebf('0x7b')][_0xcebf('0x4a')];_0x1e55e2+=0x1){if(_0x400543[_0xcebf('0x7b')][_0x1e55e2][_0xcebf('0x34')]&&_[_0xcebf('0x63')](_0x57a12a,_0x400543[_0xcebf('0x7b')][_0x1e55e2][_0xcebf('0x34')])&&_0x400543['joins'][_0x1e55e2][_0xcebf('0x7f')]&&_0x400543[_0xcebf('0x7b')][_0x1e55e2][_0xcebf('0x7c')]&&_0x400543[_0xcebf('0x7b')][_0x1e55e2][_0xcebf('0x7d')]){_0x2f5a32[_0x400543[_0xcebf('0x7b')][_0x1e55e2][_0xcebf('0x34')]](_0x400543[_0xcebf('0x7b')][_0x1e55e2][_0xcebf('0x7c')],null,util[_0xcebf('0x77')](_0xcebf('0x90'),_0x400543['table'],_0x400543['joins'][_0x1e55e2]['parentKey'],_0x400543[_0xcebf('0x7b')][_0x1e55e2][_0xcebf('0x7c')],_0x400543[_0xcebf('0x7b')][_0x1e55e2][_0xcebf('0x7d')]));}}}if(_0x400543[_0xcebf('0x80')]){_0x400543[_0xcebf('0x80')]=JSON['parse'](_0x400543['conditions']);_0x2f5a32[_0xcebf('0x40')](_0x1e12e6(_0x400543[_0xcebf('0x80')]['group']));}_0x460872=_0x2f5a32[_0xcebf('0x91')]();_0x2f5a32[_0xcebf('0x1f')](_0x553521);_0x2f5a32[_0xcebf('0x1c')](0x0);logger['debug'](_0xcebf('0x83'),_0x2f5a32[_0xcebf('0x85')]());return dbH[_0xcebf('0x84')]['query'](_0x2f5a32[_0xcebf('0x85')](),{'type':dbH['sequelize'][_0xcebf('0x86')]['SELECT']});}})[_0xcebf('0x26')](function(){return{'sql':_0x460872[_0xcebf('0x85')]()};})[_0xcebf('0x26')](respondWithResult(_0xd34285,null))[_0xcebf('0x47')](handleError(_0xd34285,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 03bcfc6..5ed97ae 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 _0xe657=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x8473ab,_0x11263e){var _0x3a89c0=function(_0x95ab9f){while(--_0x95ab9f){_0x8473ab['push'](_0x8473ab['shift']());}};_0x3a89c0(++_0x11263e);}(_0xe657,0x1c1));var _0x7e65=function(_0xdfe8c4,_0x3f695c){_0xdfe8c4=_0xdfe8c4-0x0;var _0x5ee124=_0xe657[_0xdfe8c4];return _0x5ee124;};'use strict';var _=require(_0x7e65('0x0'));var util=require(_0x7e65('0x1'));var logger=require(_0x7e65('0x2'))('api');var moment=require(_0x7e65('0x3'));var BPromise=require(_0x7e65('0x4'));var rp=require(_0x7e65('0x5'));var fs=require('fs');var path=require(_0x7e65('0x6'));var rimraf=require(_0x7e65('0x7'));var config=require(_0x7e65('0x8'));var attributes=require(_0x7e65('0x9'));module['exports']=function(_0x4e416a,_0x51ba1d){return _0x4e416a[_0x7e65('0xa')](_0x7e65('0xb'),attributes,{'tableName':_0x7e65('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x82c2=['lodash','util','api','bluebird','rimraf','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x259f30,_0x1ada25){var _0xa8bc49=function(_0x2f7721){while(--_0x2f7721){_0x259f30['push'](_0x259f30['shift']());}};_0xa8bc49(++_0x1ada25);}(_0x82c2,0x1e6));var _0x282c=function(_0x54bf67,_0x5381e5){_0x54bf67=_0x54bf67-0x0;var _0x5f18a9=_0x82c2[_0x54bf67];return _0x5f18a9;};'use strict';var _=require(_0x282c('0x0'));var util=require(_0x282c('0x1'));var logger=require('../../config/logger')(_0x282c('0x2'));var moment=require('moment');var BPromise=require(_0x282c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x282c('0x4'));var config=require('../../config/environment');var attributes=require(_0x282c('0x5'));module['exports']=function(_0x414d8e,_0x1012ef){return _0x414d8e[_0x282c('0x6')](_0x282c('0x7'),attributes,{'tableName':_0x282c('0x8'),'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 c7f31ea..6bc0266 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 _0xd3be=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2514ff,_0x381293){var _0x21579d=function(_0x411c12){while(--_0x411c12){_0x2514ff['push'](_0x2514ff['shift']());}};_0x21579d(++_0x381293);}(_0xd3be,0xdf));var _0xed3b=function(_0x5d35b7,_0x3337e2){_0x5d35b7=_0x5d35b7-0x0;var _0x158b8b=_0xd3be[_0x5d35b7];return _0x158b8b;};'use strict';var _=require(_0xed3b('0x0'));var util=require(_0xed3b('0x1'));var moment=require(_0xed3b('0x2'));var BPromise=require('bluebird');var rs=require(_0xed3b('0x3'));var fs=require('fs');var Redis=require(_0xed3b('0x4'));var db=require(_0xed3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed3b('0x6'))(_0xed3b('0x7'));var config=require(_0xed3b('0x8'));var jayson=require(_0xed3b('0x9'));var client=jayson['client'][_0xed3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47dbac,_0x4d281e,_0x44bfb7){return new BPromise(function(_0x16bea0,_0x4f5223){return client[_0xed3b('0xb')](_0x47dbac,_0x44bfb7)[_0xed3b('0xc')](function(_0x3ff99d){logger[_0xed3b('0xd')](_0xed3b('0xe'),_0x4d281e,_0xed3b('0xf'));logger['debug'](_0xed3b('0x10'),_0x4d281e,'request\x20sent',JSON['stringify'](_0x3ff99d));if(_0x3ff99d[_0xed3b('0x11')]){if(_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x12')]===0x1f4){logger[_0xed3b('0x11')](_0xed3b('0xe'),_0x4d281e,_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x13')]);return _0x4f5223(_0x3ff99d['error'][_0xed3b('0x13')]);}logger[_0xed3b('0x11')](_0xed3b('0xe'),_0x4d281e,_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x13')]);return _0x16bea0(_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x13')]);}else{logger[_0xed3b('0xd')](_0xed3b('0xe'),_0x4d281e,_0xed3b('0xf'));_0x16bea0(_0x3ff99d[_0xed3b('0x14')]['message']);}})[_0xed3b('0x15')](function(_0x3ff86b){logger[_0xed3b('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4d281e,_0x3ff86b);_0x4f5223(_0x3ff86b);});});}
\ No newline at end of file
+var _0x4f9f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0xbed8a2,_0x578ae3){var _0x11d4f2=function(_0x49e846){while(--_0x49e846){_0xbed8a2['push'](_0xbed8a2['shift']());}};_0x11d4f2(++_0x578ae3);}(_0x4f9f,0x1b1));var _0xf4f9=function(_0x4afa89,_0x1b9ed3){_0x4afa89=_0x4afa89-0x0;var _0x151c58=_0x4f9f[_0x4afa89];return _0x151c58;};'use strict';var _=require(_0xf4f9('0x0'));var util=require(_0xf4f9('0x1'));var moment=require(_0xf4f9('0x2'));var BPromise=require(_0xf4f9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4f9('0x4'));var db=require(_0xf4f9('0x5'))['db'];var utils=require(_0xf4f9('0x6'));var logger=require(_0xf4f9('0x7'))(_0xf4f9('0x8'));var config=require(_0xf4f9('0x9'));var jayson=require(_0xf4f9('0xa'));var client=jayson['client'][_0xf4f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54eb22,_0x4fec19,_0x215924){return new BPromise(function(_0x193f3d,_0x33a13e){return client[_0xf4f9('0xc')](_0x54eb22,_0x215924)[_0xf4f9('0xd')](function(_0x4beed0){logger[_0xf4f9('0xe')](_0xf4f9('0xf'),_0x4fec19,_0xf4f9('0x10'));logger['debug'](_0xf4f9('0x11'),_0x4fec19,'request\x20sent',JSON[_0xf4f9('0x12')](_0x4beed0));if(_0x4beed0['error']){if(_0x4beed0[_0xf4f9('0x13')][_0xf4f9('0x14')]===0x1f4){logger[_0xf4f9('0x13')](_0xf4f9('0xf'),_0x4fec19,_0x4beed0[_0xf4f9('0x13')]['message']);return _0x33a13e(_0x4beed0[_0xf4f9('0x13')][_0xf4f9('0x15')]);}logger['error'](_0xf4f9('0xf'),_0x4fec19,_0x4beed0[_0xf4f9('0x13')][_0xf4f9('0x15')]);return _0x193f3d(_0x4beed0[_0xf4f9('0x13')]['message']);}else{logger[_0xf4f9('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4fec19,_0xf4f9('0x10'));_0x193f3d(_0x4beed0['result'][_0xf4f9('0x15')]);}})[_0xf4f9('0x16')](function(_0x139735){logger[_0xf4f9('0x13')](_0xf4f9('0xf'),_0x4fec19,_0x139735);_0x33a13e(_0x139735);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index cb4cf2c..1426b4a 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 _0xd78c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','query','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0xd78c,0x10d));var _0xcd78=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xd78c[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xcd78('0x0'));var util=require(_0xcd78('0x1'));var path=require(_0xcd78('0x2'));var timeout=require(_0xcd78('0x3'));var express=require(_0xcd78('0x4'));var router=express[_0xcd78('0x5')]();var fs_extra=require(_0xcd78('0x6'));var auth=require(_0xcd78('0x7'));var interaction=require(_0xcd78('0x8'));var config=require(_0xcd78('0x9'));var controller=require(_0xcd78('0xa'));router[_0xcd78('0xb')]('/',auth[_0xcd78('0xc')](),controller['index']);router[_0xcd78('0xb')](_0xcd78('0xd'),auth['isAuthenticated'](),controller[_0xcd78('0xe')]);router['get'](_0xcd78('0xf'),auth['isAuthenticated'](),controller[_0xcd78('0x10')]);router[_0xcd78('0xb')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xcd78('0xb')]('/:id/query',auth[_0xcd78('0xc')](),controller[_0xcd78('0x11')]);router[_0xcd78('0x12')]('/',auth[_0xcd78('0xc')](),controller[_0xcd78('0x13')]);router[_0xcd78('0x14')](_0xcd78('0xd'),auth[_0xcd78('0xc')](),controller['update']);router[_0xcd78('0x15')](_0xcd78('0xd'),auth[_0xcd78('0xc')](),controller['destroy']);module[_0xcd78('0x16')]=router;
\ No newline at end of file
+var _0xad25=['get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','destroy','exports','util','path','../../components/auth/service','./analyticCustomReport.controller'];(function(_0x37002e,_0x41f2f5){var _0x25d8db=function(_0x46fa9b){while(--_0x46fa9b){_0x37002e['push'](_0x37002e['shift']());}};_0x25d8db(++_0x41f2f5);}(_0xad25,0xe6));var _0x5ad2=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xad25[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0x5ad2('0x0'));var path=require(_0x5ad2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5ad2('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5ad2('0x3'));router[_0x5ad2('0x4')]('/',auth[_0x5ad2('0x5')](),controller[_0x5ad2('0x6')]);router['get'](_0x5ad2('0x7'),auth[_0x5ad2('0x5')](),controller[_0x5ad2('0x8')]);router[_0x5ad2('0x4')](_0x5ad2('0x9'),auth['isAuthenticated'](),controller['preview']);router[_0x5ad2('0x4')](_0x5ad2('0xa'),auth[_0x5ad2('0x5')](),controller[_0x5ad2('0xb')]);router['get'](_0x5ad2('0xc'),auth[_0x5ad2('0x5')](),controller['query']);router[_0x5ad2('0xd')]('/',auth[_0x5ad2('0x5')](),controller[_0x5ad2('0xe')]);router[_0x5ad2('0xf')](_0x5ad2('0x7'),auth[_0x5ad2('0x5')](),controller['update']);router['delete'](_0x5ad2('0x7'),auth[_0x5ad2('0x5')](),controller[_0x5ad2('0x10')]);module[_0x5ad2('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 6afd776..b868094 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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x55ad58,_0x44c12f){var _0x471b98=function(_0x52a1cd){while(--_0x52a1cd){_0x55ad58['push'](_0x55ad58['shift']());}};_0x471b98(++_0x44c12f);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x299565,_0x13b4df){_0x299565=_0x299565-0x0;var _0x413367=_0x3eea[_0x299565];return _0x413367;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
+var _0x2eb2=['TEXT','exports','STRING'];(function(_0x3e330a,_0x11bf04){var _0x451dee=function(_0x1074b7){while(--_0x1074b7){_0x3e330a['push'](_0x3e330a['shift']());}};_0x451dee(++_0x11bf04);}(_0x2eb2,0x19f));var _0x22eb=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x2eb2[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index ca4c3af..8d33155 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x191559,_0xb1a10f){var _0x1f6626=function(_0x61578b){while(--_0x61578b){_0x191559['push'](_0x191559['shift']());}};_0x1f6626(++_0xb1a10f);}(_0x814b,0x1a2));var _0xb814=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x814b[_0x5a2299];return _0xedff0f;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
+var _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x2d2fb0,_0x165e6e){var _0xc057c0=function(_0x1e17ba){while(--_0x1e17ba){_0x2d2fb0['push'](_0x2d2fb0['shift']());}};_0xc057c0(++_0x165e6e);}(_0x187d,0x93));var _0xd187=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x187d[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 0f4255e..2d64818 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 _0xab19=['AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0xab19,0x138));var _0x9ab1=function(_0x3750cb,_0x505a79){_0x3750cb=_0x3750cb-0x0;var _0xc93ab6=_0xab19[_0x3750cb];return _0xc93ab6;};'use strict';var _=require('lodash');var util=require(_0x9ab1('0x0'));var logger=require('../../config/logger')(_0x9ab1('0x1'));var moment=require(_0x9ab1('0x2'));var BPromise=require(_0x9ab1('0x3'));var rp=require(_0x9ab1('0x4'));var fs=require('fs');var path=require(_0x9ab1('0x5'));var rimraf=require(_0x9ab1('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ab1('0x7'));module['exports']=function(_0x2aff26,_0xb5bba5){return _0x2aff26['define'](_0x9ab1('0x8'),attributes,{'tableName':_0x9ab1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6a7=['exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xe6a7,0xac));var _0x7e6a=function(_0x524870,_0x553a86){_0x524870=_0x524870-0x0;var _0x1f9c95=_0xe6a7[_0x524870];return _0x1f9c95;};'use strict';var _=require(_0x7e6a('0x0'));var util=require(_0x7e6a('0x1'));var logger=require('../../config/logger')(_0x7e6a('0x2'));var moment=require(_0x7e6a('0x3'));var BPromise=require(_0x7e6a('0x4'));var rp=require(_0x7e6a('0x5'));var fs=require('fs');var path=require(_0x7e6a('0x6'));var rimraf=require(_0x7e6a('0x7'));var config=require(_0x7e6a('0x8'));var attributes=require(_0x7e6a('0x9'));module[_0x7e6a('0xa')]=function(_0x2574ca,_0x1d977d){return _0x2574ca['define'](_0x7e6a('0xb'),attributes,{'tableName':_0x7e6a('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 41147b9..ae620b8 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 _0x1d37=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x2c4d32,_0x69e859){var _0x19fe28=function(_0x167e8e){while(--_0x167e8e){_0x2c4d32['push'](_0x2c4d32['shift']());}};_0x19fe28(++_0x69e859);}(_0x1d37,0xfe));var _0x71d3=function(_0x45fc9c,_0x70f2cb){_0x45fc9c=_0x45fc9c-0x0;var _0x984946=_0x1d37[_0x45fc9c];return _0x984946;};'use strict';var _=require(_0x71d3('0x0'));var util=require('util');var moment=require(_0x71d3('0x1'));var BPromise=require(_0x71d3('0x2'));var rs=require(_0x71d3('0x3'));var fs=require('fs');var Redis=require(_0x71d3('0x4'));var db=require(_0x71d3('0x5'))['db'];var utils=require(_0x71d3('0x6'));var logger=require(_0x71d3('0x7'))(_0x71d3('0x8'));var config=require('../../config/environment');var jayson=require(_0x71d3('0x9'));var client=jayson['client'][_0x71d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48971f,_0x4fad8f,_0x5cd9cb){return new BPromise(function(_0x37ff50,_0x2c72f6){return client[_0x71d3('0xb')](_0x48971f,_0x5cd9cb)['then'](function(_0xd89246){logger[_0x71d3('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4fad8f,_0x71d3('0xd'));logger[_0x71d3('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4fad8f,'request\x20sent',JSON[_0x71d3('0xf')](_0xd89246));if(_0xd89246[_0x71d3('0x10')]){if(_0xd89246[_0x71d3('0x10')]['code']===0x1f4){logger['error'](_0x71d3('0x11'),_0x4fad8f,_0xd89246[_0x71d3('0x10')][_0x71d3('0x12')]);return _0x2c72f6(_0xd89246['error'][_0x71d3('0x12')]);}logger[_0x71d3('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4fad8f,_0xd89246[_0x71d3('0x10')][_0x71d3('0x12')]);return _0x37ff50(_0xd89246[_0x71d3('0x10')][_0x71d3('0x12')]);}else{logger[_0x71d3('0xc')](_0x71d3('0x11'),_0x4fad8f,_0x71d3('0xd'));_0x37ff50(_0xd89246[_0x71d3('0x13')][_0x71d3('0x12')]);}})[_0x71d3('0x14')](function(_0x5143d7){logger['error'](_0x71d3('0x11'),_0x4fad8f,_0x5143d7);_0x2c72f6(_0x5143d7);});});}
\ No newline at end of file
+var _0xb31a=['client','http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5257fc,_0x4e0ed6){var _0x15662f=function(_0x29b1f9){while(--_0x29b1f9){_0x5257fc['push'](_0x5257fc['shift']());}};_0x15662f(++_0x4e0ed6);}(_0xb31a,0x199));var _0xab31=function(_0x53e738,_0x2005a6){_0x53e738=_0x53e738-0x0;var _0x149beb=_0xb31a[_0x53e738];return _0x149beb;};'use strict';var _=require(_0xab31('0x0'));var util=require(_0xab31('0x1'));var moment=require(_0xab31('0x2'));var BPromise=require(_0xab31('0x3'));var rs=require(_0xab31('0x4'));var fs=require('fs');var Redis=require(_0xab31('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xab31('0x6'));var logger=require(_0xab31('0x7'))(_0xab31('0x8'));var config=require(_0xab31('0x9'));var jayson=require(_0xab31('0xa'));var client=jayson[_0xab31('0xb')][_0xab31('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ad297,_0x168b0b,_0x538886){return new BPromise(function(_0x2c87a2,_0x5f12ed){return client['request'](_0x2ad297,_0x538886)['then'](function(_0x2f3bde){logger[_0xab31('0xd')](_0xab31('0xe'),_0x168b0b,_0xab31('0xf'));logger[_0xab31('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x168b0b,_0xab31('0xf'),JSON[_0xab31('0x11')](_0x2f3bde));if(_0x2f3bde[_0xab31('0x12')]){if(_0x2f3bde[_0xab31('0x12')]['code']===0x1f4){logger[_0xab31('0x12')](_0xab31('0xe'),_0x168b0b,_0x2f3bde[_0xab31('0x12')][_0xab31('0x13')]);return _0x5f12ed(_0x2f3bde[_0xab31('0x12')][_0xab31('0x13')]);}logger['error'](_0xab31('0xe'),_0x168b0b,_0x2f3bde['error'][_0xab31('0x13')]);return _0x2c87a2(_0x2f3bde[_0xab31('0x12')][_0xab31('0x13')]);}else{logger[_0xab31('0xd')](_0xab31('0xe'),_0x168b0b,_0xab31('0xf'));_0x2c87a2(_0x2f3bde['result'][_0xab31('0x13')]);}})[_0xab31('0x14')](function(_0x3cc14a){logger[_0xab31('0x12')](_0xab31('0xe'),_0x168b0b,_0x3cc14a);_0x5f12ed(_0x3cc14a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 2bce2b6..60325fc 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 _0x4f14=['preview','/:id/run','run','/:id/query','query','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview'];(function(_0x23bddf,_0x4c3a28){var _0x3feb29=function(_0x1bcc05){while(--_0x1bcc05){_0x23bddf['push'](_0x23bddf['shift']());}};_0x3feb29(++_0x4c3a28);}(_0x4f14,0x11d));var _0x44f1=function(_0x55edc6,_0x18485c){_0x55edc6=_0x55edc6-0x0;var _0xd2d02c=_0x4f14[_0x55edc6];return _0xd2d02c;};'use strict';var multer=require(_0x44f1('0x0'));var util=require(_0x44f1('0x1'));var path=require(_0x44f1('0x2'));var timeout=require(_0x44f1('0x3'));var express=require(_0x44f1('0x4'));var router=express[_0x44f1('0x5')]();var fs_extra=require(_0x44f1('0x6'));var auth=require(_0x44f1('0x7'));var interaction=require(_0x44f1('0x8'));var config=require('../../config/environment');var controller=require(_0x44f1('0x9'));router[_0x44f1('0xa')]('/',auth[_0x44f1('0xb')](),controller[_0x44f1('0xc')]);router[_0x44f1('0xa')](_0x44f1('0xd'),auth[_0x44f1('0xb')](),controller['show']);router[_0x44f1('0xa')](_0x44f1('0xe'),auth[_0x44f1('0xb')](),controller[_0x44f1('0xf')]);router[_0x44f1('0xa')](_0x44f1('0x10'),auth[_0x44f1('0xb')](),controller[_0x44f1('0x11')]);router['get'](_0x44f1('0x12'),auth[_0x44f1('0xb')](),controller[_0x44f1('0x13')]);router[_0x44f1('0x14')]('/',auth[_0x44f1('0xb')](),controller[_0x44f1('0x15')]);router[_0x44f1('0x16')](_0x44f1('0xd'),auth[_0x44f1('0xb')](),controller['update']);router[_0x44f1('0x17')](_0x44f1('0xd'),auth[_0x44f1('0xb')](),controller['destroy']);module[_0x44f1('0x18')]=router;
\ No newline at end of file
+var _0x8ef4=['util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','preview','/:id/run','/:id/query','query','post','create','update','delete','destroy','exports','multer'];(function(_0x12e55a,_0x240ea7){var _0x1d7aec=function(_0x579192){while(--_0x579192){_0x12e55a['push'](_0x12e55a['shift']());}};_0x1d7aec(++_0x240ea7);}(_0x8ef4,0x11d));var _0x48ef=function(_0x7a8365,_0x563ade){_0x7a8365=_0x7a8365-0x0;var _0x55359f=_0x8ef4[_0x7a8365];return _0x55359f;};'use strict';var multer=require(_0x48ef('0x0'));var util=require(_0x48ef('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x48ef('0x2'));var router=express[_0x48ef('0x3')]();var fs_extra=require(_0x48ef('0x4'));var auth=require(_0x48ef('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x48ef('0x6'));var controller=require(_0x48ef('0x7'));router['get']('/',auth[_0x48ef('0x8')](),controller[_0x48ef('0x9')]);router[_0x48ef('0xa')](_0x48ef('0xb'),auth[_0x48ef('0x8')](),controller['show']);router[_0x48ef('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x48ef('0xc')]);router[_0x48ef('0xa')](_0x48ef('0xd'),auth[_0x48ef('0x8')](),controller['run']);router['get'](_0x48ef('0xe'),auth[_0x48ef('0x8')](),controller[_0x48ef('0xf')]);router[_0x48ef('0x10')]('/',auth[_0x48ef('0x8')](),controller[_0x48ef('0x11')]);router['put'](_0x48ef('0xb'),auth['isAuthenticated'](),controller[_0x48ef('0x12')]);router[_0x48ef('0x13')]('/:id',auth[_0x48ef('0x8')](),controller[_0x48ef('0x14')]);module[_0x48ef('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 560f72f..da150e7 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 _0x0244=['scheduled','INTEGER','UNSIGNED','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual'];(function(_0x385ef4,_0x593598){var _0x2a7f3f=function(_0x7898fc){while(--_0x7898fc){_0x385ef4['push'](_0x385ef4['shift']());}};_0x2a7f3f(++_0x593598);}(_0x0244,0x10b));var _0x4024=function(_0x4421a0,_0x1525bc){_0x4421a0=_0x4421a0-0x0;var _0x5626d0=_0x0244[_0x4421a0];return _0x5626d0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4024('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0x4024('0x1')]('csv',_0x4024('0x2'),_0x4024('0x3')),'allowNull':![],'defaultValue':_0x4024('0x4')},'savename':{'type':Sequelize[_0x4024('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4024('0x5')]},'endDate':{'type':Sequelize[_0x4024('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x4024('0x6')},'type':{'type':Sequelize['ENUM'](_0x4024('0x7'),_0x4024('0x8')),'allowNull':![],'defaultValue':_0x4024('0x7')},'reportId':{'type':Sequelize[_0x4024('0x9')](0xb)[_0x4024('0xa')]},'reportType':{'type':Sequelize[_0x4024('0x0')]}};
\ No newline at end of file
+var _0x24e7=['xlsx','csv','DATE','ENUM','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','pdf'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x24e7,0xdf));var _0x724e=function(_0x3202a5,_0x41aa0f){_0x3202a5=_0x3202a5-0x0;var _0xd8ce1=_0x24e7[_0x3202a5];return _0xd8ce1;};'use strict';var Sequelize=require(_0x724e('0x0'));var moment=require(_0x724e('0x1'));module[_0x724e('0x2')]={'name':{'type':Sequelize[_0x724e('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x724e('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x724e('0x4'),_0x724e('0x5')),'allowNull':![],'defaultValue':_0x724e('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x724e('0x7')]},'endDate':{'type':Sequelize[_0x724e('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x724e('0x8')]('manual',_0x724e('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x724e('0xa')](0xb)[_0x724e('0xb')]},'reportType':{'type':Sequelize[_0x724e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index cfdeb01..1bc5f56 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 _0x98ba=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x98ba,0x147));var _0xa98b=function(_0x3ce878,_0x5bff06){_0x3ce878=_0x3ce878-0x0;var _0x39e51f=_0x98ba[_0x3ce878];return _0x39e51f;};'use strict';var emlformat=require(_0xa98b('0x0'));var rimraf=require(_0xa98b('0x1'));var zipdir=require(_0xa98b('0x2'));var jsonpatch=require(_0xa98b('0x3'));var rp=require('request-promise');var moment=require(_0xa98b('0x4'));var BPromise=require(_0xa98b('0x5'));var Mustache=require(_0xa98b('0x6'));var util=require(_0xa98b('0x7'));var path=require('path');var sox=require(_0xa98b('0x8'));var csv=require('to-csv');var ejs=require(_0xa98b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa98b('0xa'));var squel=require(_0xa98b('0xb'));var crypto=require(_0xa98b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa98b('0xd'));var toCsv=require(_0xa98b('0xe'));var querystring=require(_0xa98b('0xf'));var Papa=require(_0xa98b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa98b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa98b('0x12'));var logger=require(_0xa98b('0x13'))(_0xa98b('0x14'));var utils=require(_0xa98b('0x15'));var config=require(_0xa98b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa98b('0x17'))['db'];function respondWithStatusCode(_0x4e1158,_0x22cf16){_0x22cf16=_0x22cf16||0xcc;return function(_0x45284e){if(_0x45284e){return _0x4e1158[_0xa98b('0x18')](_0x22cf16);}return _0x4e1158[_0xa98b('0x19')](_0x22cf16)[_0xa98b('0x1a')]();};}function respondWithResult(_0x2d0a5f,_0x3efbcc){_0x3efbcc=_0x3efbcc||0xc8;return function(_0x42922b){if(_0x42922b){return _0x2d0a5f[_0xa98b('0x19')](_0x3efbcc)[_0xa98b('0x1b')](_0x42922b);}};}function respondWithFilteredResult(_0x27153b,_0x12f5da){return function(_0x36b004){if(_0x36b004){var _0x52c2e2=typeof _0x12f5da[_0xa98b('0x1c')]===_0xa98b('0x1d')&&typeof _0x12f5da[_0xa98b('0x1e')]===_0xa98b('0x1d');var _0x498e64=_0x36b004[_0xa98b('0x1f')];var _0x292ade=_0x52c2e2?0x0:_0x12f5da[_0xa98b('0x1c')];var _0x181ab9=_0x52c2e2?_0x36b004[_0xa98b('0x1f')]:_0x12f5da[_0xa98b('0x1c')]+_0x12f5da['limit'];var _0x3f4880;if(_0x181ab9>=_0x498e64){_0x181ab9=_0x498e64;_0x3f4880=0xc8;}else{_0x3f4880=0xce;}_0x27153b['status'](_0x3f4880);return _0x27153b[_0xa98b('0x20')](_0xa98b('0x21'),_0x292ade+'-'+_0x181ab9+'/'+_0x498e64)[_0xa98b('0x1b')](_0x36b004);}return null;};}function patchUpdates(_0xb3e6ed){return function(_0x11abea){try{jsonpatch[_0xa98b('0x22')](_0x11abea,_0xb3e6ed,!![]);}catch(_0x4f3dc9){return BPromise[_0xa98b('0x23')](_0x4f3dc9);}return _0x11abea['save']();};}function saveUpdates(_0x233c6f,_0x3c712b){return function(_0x550ae0){if(_0x550ae0){return _0x550ae0['update'](_0x233c6f)['then'](function(_0x28a356){return _0x28a356;});}return null;};}function removeEntity(_0x5bc0d4,_0x5e0eff){return function(_0x54d478){if(_0x54d478){return _0x54d478[_0xa98b('0x24')]()[_0xa98b('0x25')](function(){var _0x102109=_0x54d478[_0xa98b('0x26')]({'plain':!![]});var _0x4f119f=_0xa98b('0x27');return db['UserProfileResource'][_0xa98b('0x24')]({'where':{'type':_0x4f119f,'resourceId':_0x102109['id']}})[_0xa98b('0x25')](function(){return _0x54d478;});})[_0xa98b('0x25')](function(){_0x5bc0d4[_0xa98b('0x19')](0xcc)[_0xa98b('0x1a')]();});}};}function handleEntityNotFound(_0x495c88,_0x4e4bf7){return function(_0x19c6cb){if(!_0x19c6cb){_0x495c88[_0xa98b('0x18')](0x194);}return _0x19c6cb;};}function handleError(_0x15daf9,_0x469e7a){_0x469e7a=_0x469e7a||0x1f4;return function(_0x2524ea){logger['error'](_0x2524ea[_0xa98b('0x28')]);if(_0x2524ea[_0xa98b('0x29')]){delete _0x2524ea[_0xa98b('0x29')];}_0x15daf9[_0xa98b('0x19')](_0x469e7a)[_0xa98b('0x2a')](_0x2524ea);};}exports[_0xa98b('0x2b')]=function(_0x58e809,_0x406a4c){var _0x227797={},_0x5a78db={},_0x1a7038={'count':0x0,'rows':[]};var _0x1bd565=_[_0xa98b('0x2c')](db[_0xa98b('0x2d')][_0xa98b('0x2e')],function(_0x4aa678){return{'name':_0x4aa678[_0xa98b('0x2f')],'type':_0x4aa678[_0xa98b('0x30')][_0xa98b('0x31')]};});_0x5a78db[_0xa98b('0x32')]=_['map'](_0x1bd565,_0xa98b('0x29'));_0x5a78db[_0xa98b('0x33')]=_[_0xa98b('0x34')](_0x58e809[_0xa98b('0x33')]);_0x5a78db[_0xa98b('0x35')]=_[_0xa98b('0x36')](_0x5a78db[_0xa98b('0x32')],_0x5a78db[_0xa98b('0x33')]);_0x227797[_0xa98b('0x37')]=_['intersection'](_0x5a78db['model'],qs[_0xa98b('0x38')](_0x58e809['query'][_0xa98b('0x38')]));_0x227797[_0xa98b('0x37')]=_0x227797[_0xa98b('0x37')][_0xa98b('0x39')]?_0x227797[_0xa98b('0x37')]:_0x5a78db[_0xa98b('0x32')];if(!_0x58e809[_0xa98b('0x33')][_0xa98b('0x3a')](_0xa98b('0x3b'))){_0x227797[_0xa98b('0x1e')]=qs['limit'](_0x58e809[_0xa98b('0x33')][_0xa98b('0x1e')]);_0x227797[_0xa98b('0x1c')]=qs[_0xa98b('0x1c')](_0x58e809[_0xa98b('0x33')][_0xa98b('0x1c')]);}_0x227797['order']=qs[_0xa98b('0x3c')](_0x58e809[_0xa98b('0x33')]['sort']);_0x227797[_0xa98b('0x3d')]=qs['filters'](_[_0xa98b('0x3e')](_0x58e809[_0xa98b('0x33')],_0x5a78db[_0xa98b('0x35')]),_0x1bd565);if(_0x58e809[_0xa98b('0x33')][_0xa98b('0x3f')]){_0x227797[_0xa98b('0x3d')]=_[_0xa98b('0x40')](_0x227797[_0xa98b('0x3d')],{'$or':_['map'](_0x1bd565,function(_0x3b23ff){if(_0x3b23ff['type']!==_0xa98b('0x41')){var _0x50bc61={};_0x50bc61[_0x3b23ff[_0xa98b('0x29')]]={'$like':'%'+_0x58e809[_0xa98b('0x33')][_0xa98b('0x3f')]+'%'};return _0x50bc61;}})});}_0x227797=_[_0xa98b('0x40')]({},_0x227797,_0x58e809['options']);var _0x132760={'where':_0x227797[_0xa98b('0x3d')]};return db[_0xa98b('0x2d')][_0xa98b('0x1f')](_0x132760)['then'](function(_0x502fc1){_0x1a7038[_0xa98b('0x1f')]=_0x502fc1;if(_0x58e809[_0xa98b('0x33')][_0xa98b('0x42')]){_0x227797[_0xa98b('0x43')]=[{'all':!![]}];}return db[_0xa98b('0x2d')][_0xa98b('0x44')](_0x227797);})[_0xa98b('0x25')](function(_0x2c9e20){_0x1a7038['rows']=_0x2c9e20;return _0x1a7038;})[_0xa98b('0x25')](respondWithFilteredResult(_0x406a4c,_0x227797))['catch'](handleError(_0x406a4c,null));};exports[_0xa98b('0x45')]=function(_0x3cf813,_0xea6b9d){var _0x3c748a={'raw':!![],'where':{'id':_0x3cf813[_0xa98b('0x46')]['id']}},_0x18ff73={};_0x18ff73[_0xa98b('0x32')]=_[_0xa98b('0x34')](db[_0xa98b('0x2d')][_0xa98b('0x2e')]);_0x18ff73[_0xa98b('0x33')]=_[_0xa98b('0x34')](_0x3cf813[_0xa98b('0x33')]);_0x18ff73[_0xa98b('0x35')]=_['intersection'](_0x18ff73[_0xa98b('0x32')],_0x18ff73[_0xa98b('0x33')]);_0x3c748a[_0xa98b('0x37')]=_[_0xa98b('0x36')](_0x18ff73[_0xa98b('0x32')],qs[_0xa98b('0x38')](_0x3cf813[_0xa98b('0x33')][_0xa98b('0x38')]));_0x3c748a[_0xa98b('0x37')]=_0x3c748a[_0xa98b('0x37')][_0xa98b('0x39')]?_0x3c748a[_0xa98b('0x37')]:_0x18ff73[_0xa98b('0x32')];if(_0x3cf813[_0xa98b('0x33')][_0xa98b('0x42')]){_0x3c748a[_0xa98b('0x43')]=[{'all':!![]}];}_0x3c748a=_[_0xa98b('0x40')]({},_0x3c748a,_0x3cf813[_0xa98b('0x47')]);return db[_0xa98b('0x2d')]['find'](_0x3c748a)[_0xa98b('0x25')](handleEntityNotFound(_0xea6b9d,null))[_0xa98b('0x25')](respondWithResult(_0xea6b9d,null))[_0xa98b('0x48')](handleError(_0xea6b9d,null));};exports[_0xa98b('0x49')]=function(_0x2e9a10,_0x473ce8){return db[_0xa98b('0x2d')][_0xa98b('0x49')](_0x2e9a10[_0xa98b('0x4a')],{})[_0xa98b('0x25')](function(_0x3fba50){var _0x341936=_0x2e9a10[_0xa98b('0x4b')]['get']({'plain':!![]});if(!_0x341936)throw new Error(_0xa98b('0x4c'));if(_0x341936[_0xa98b('0x4d')]===_0xa98b('0x4b')){var _0x86c04e=_0x3fba50[_0xa98b('0x26')]({'plain':!![]});var _0x4e3587=_0xa98b('0x27');return db[_0xa98b('0x4e')][_0xa98b('0x4f')]({'where':{'name':_0x4e3587,'userProfileId':_0x341936['userProfileId']},'raw':!![]})[_0xa98b('0x25')](function(_0x12f9b9){if(_0x12f9b9&&_0x12f9b9['autoAssociation']===0x0){return db[_0xa98b('0x50')]['create']({'name':_0x86c04e[_0xa98b('0x29')],'resourceId':_0x86c04e['id'],'type':_0x12f9b9[_0xa98b('0x29')],'sectionId':_0x12f9b9['id']},{})['then'](function(){return _0x3fba50;});}else{return _0x3fba50;}})[_0xa98b('0x48')](function(_0x418dd0){logger[_0xa98b('0x51')](_0xa98b('0x52'),_0x418dd0);throw _0x418dd0;});}return _0x3fba50;})[_0xa98b('0x25')](respondWithResult(_0x473ce8,0xc9))[_0xa98b('0x48')](handleError(_0x473ce8,null));};exports['update']=function(_0xaea4ae,_0x148603){if(_0xaea4ae[_0xa98b('0x4a')]['id']){delete _0xaea4ae['body']['id'];}return db[_0xa98b('0x2d')][_0xa98b('0x4f')]({'where':{'id':_0xaea4ae[_0xa98b('0x46')]['id']}})[_0xa98b('0x25')](handleEntityNotFound(_0x148603,null))[_0xa98b('0x25')](saveUpdates(_0xaea4ae[_0xa98b('0x4a')],null))[_0xa98b('0x25')](respondWithResult(_0x148603,null))[_0xa98b('0x48')](handleError(_0x148603,null));};exports[_0xa98b('0x24')]=function(_0x6408e3,_0x3d5344){return db['AnalyticExtractedReport'][_0xa98b('0x4f')]({'where':{'id':_0x6408e3[_0xa98b('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d5344,null))[_0xa98b('0x25')](removeEntity(_0x3d5344,null))[_0xa98b('0x48')](handleError(_0x3d5344,null));};exports[_0xa98b('0x53')]=function(_0xa264e7,_0x24db6e,_0x32b25c){return db[_0xa98b('0x2d')]['find']({'where':{'id':_0xa264e7[_0xa98b('0x46')]['id']},'attributes':[_0xa98b('0x29'),_0xa98b('0x54'),_0xa98b('0x55'),_0xa98b('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x24db6e,null))[_0xa98b('0x25')](function(_0x52b386){if(_0x52b386){if(!fs[_0xa98b('0x57')](path[_0xa98b('0x58')](config[_0xa98b('0x59')],_0xa98b('0x5a'),_0x52b386[_0xa98b('0x55')]))){throw new db['Sequelize'][(_0xa98b('0x5b'))](_0xa98b('0x5c'));}if(_0xa264e7[_0xa98b('0x33')][_0xa98b('0x5d')]){return _0x24db6e[_0xa98b('0x18')](0xc8);}return _0x24db6e['download'](path[_0xa98b('0x58')](config['root'],_0xa98b('0x5a'),_0x52b386[_0xa98b('0x55')]),util['format']('%s.%s',_0x52b386[_0xa98b('0x54')]||_0x52b386[_0xa98b('0x29')],_0x52b386[_0xa98b('0x56')][_0xa98b('0x5e')]()));}})[_0xa98b('0x48')](handleError(_0x24db6e,null));};
\ No newline at end of file
+var _0xe815=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','type','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','include','rows','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','update','params','download','basename','savename','output','existsSync','join','server/files/reports','ValidationError','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x263ba6,_0x54b977){var _0x110a7a=function(_0x50a2cd){while(--_0x50a2cd){_0x263ba6['push'](_0x263ba6['shift']());}};_0x110a7a(++_0x54b977);}(_0xe815,0x1dc));var _0x5e81=function(_0x4f785c,_0x301bff){_0x4f785c=_0x4f785c-0x0;var _0x3d81f8=_0xe815[_0x4f785c];return _0x3d81f8;};'use strict';var emlformat=require(_0x5e81('0x0'));var rimraf=require(_0x5e81('0x1'));var zipdir=require(_0x5e81('0x2'));var jsonpatch=require(_0x5e81('0x3'));var rp=require('request-promise');var moment=require(_0x5e81('0x4'));var BPromise=require(_0x5e81('0x5'));var Mustache=require('mustache');var util=require(_0x5e81('0x6'));var path=require(_0x5e81('0x7'));var sox=require(_0x5e81('0x8'));var csv=require(_0x5e81('0x9'));var ejs=require(_0x5e81('0xa'));var fs=require('fs');var fs_extra=require(_0x5e81('0xb'));var _=require(_0x5e81('0xc'));var squel=require('squel');var crypto=require(_0x5e81('0xd'));var jsforce=require(_0x5e81('0xe'));var deskjs=require(_0x5e81('0xf'));var toCsv=require(_0x5e81('0x9'));var querystring=require(_0x5e81('0x10'));var Papa=require(_0x5e81('0x11'));var Redis=require(_0x5e81('0x12'));var authService=require(_0x5e81('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5e81('0x14'));var hardwareService=require(_0x5e81('0x15'));var logger=require(_0x5e81('0x16'))(_0x5e81('0x17'));var utils=require('../../config/utils');var config=require(_0x5e81('0x18'));var licenseUtil=require(_0x5e81('0x19'));var db=require(_0x5e81('0x1a'))['db'];function respondWithStatusCode(_0x11b798,_0x4adfd7){_0x4adfd7=_0x4adfd7||0xcc;return function(_0x5f0308){if(_0x5f0308){return _0x11b798[_0x5e81('0x1b')](_0x4adfd7);}return _0x11b798[_0x5e81('0x1c')](_0x4adfd7)[_0x5e81('0x1d')]();};}function respondWithResult(_0x502db7,_0x71e3f8){_0x71e3f8=_0x71e3f8||0xc8;return function(_0x550848){if(_0x550848){return _0x502db7[_0x5e81('0x1c')](_0x71e3f8)[_0x5e81('0x1e')](_0x550848);}};}function respondWithFilteredResult(_0x5e0ab3,_0x2f3ffd){return function(_0x3765e0){if(_0x3765e0){var _0x384395=typeof _0x2f3ffd[_0x5e81('0x1f')]===_0x5e81('0x20')&&typeof _0x2f3ffd['limit']===_0x5e81('0x20');var _0x5577f7=_0x3765e0[_0x5e81('0x21')];var _0x58b997=_0x384395?0x0:_0x2f3ffd['offset'];var _0x5d690e=_0x384395?_0x3765e0[_0x5e81('0x21')]:_0x2f3ffd['offset']+_0x2f3ffd[_0x5e81('0x22')];var _0x39a4b8;if(_0x5d690e>=_0x5577f7){_0x5d690e=_0x5577f7;_0x39a4b8=0xc8;}else{_0x39a4b8=0xce;}_0x5e0ab3[_0x5e81('0x1c')](_0x39a4b8);return _0x5e0ab3[_0x5e81('0x23')](_0x5e81('0x24'),_0x58b997+'-'+_0x5d690e+'/'+_0x5577f7)[_0x5e81('0x1e')](_0x3765e0);}return null;};}function patchUpdates(_0x507ec3){return function(_0x3d5e3c){try{jsonpatch[_0x5e81('0x25')](_0x3d5e3c,_0x507ec3,!![]);}catch(_0x323975){return BPromise['reject'](_0x323975);}return _0x3d5e3c[_0x5e81('0x26')]();};}function saveUpdates(_0x4db016,_0x1e9ea7){return function(_0x779424){if(_0x779424){return _0x779424['update'](_0x4db016)[_0x5e81('0x27')](function(_0x4ad617){return _0x4ad617;});}return null;};}function removeEntity(_0x328bbf,_0x3899c6){return function(_0x54ad74){if(_0x54ad74){return _0x54ad74[_0x5e81('0x28')]()[_0x5e81('0x27')](function(){var _0x3ccb87=_0x54ad74[_0x5e81('0x29')]({'plain':!![]});var _0x2dd980=_0x5e81('0x2a');return db[_0x5e81('0x2b')][_0x5e81('0x28')]({'where':{'type':_0x2dd980,'resourceId':_0x3ccb87['id']}})[_0x5e81('0x27')](function(){return _0x54ad74;});})['then'](function(){_0x328bbf['status'](0xcc)[_0x5e81('0x1d')]();});}};}function handleEntityNotFound(_0x64b69a,_0x2fa316){return function(_0x26025f){if(!_0x26025f){_0x64b69a[_0x5e81('0x1b')](0x194);}return _0x26025f;};}function handleError(_0x20d452,_0x536f1c){_0x536f1c=_0x536f1c||0x1f4;return function(_0x359dd6){logger[_0x5e81('0x2c')](_0x359dd6[_0x5e81('0x2d')]);if(_0x359dd6['name']){delete _0x359dd6['name'];}_0x20d452[_0x5e81('0x1c')](_0x536f1c)[_0x5e81('0x2e')](_0x359dd6);};}exports[_0x5e81('0x2f')]=function(_0x442a1c,_0x457a13){var _0x495b1b={},_0x3ec488={},_0x3119e8={'count':0x0,'rows':[]};var _0x3e3527=_[_0x5e81('0x30')](db['AnalyticExtractedReport'][_0x5e81('0x31')],function(_0x458c63){return{'name':_0x458c63[_0x5e81('0x32')],'type':_0x458c63['type'][_0x5e81('0x33')]};});_0x3ec488[_0x5e81('0x34')]=_[_0x5e81('0x30')](_0x3e3527,_0x5e81('0x35'));_0x3ec488[_0x5e81('0x36')]=_['keys'](_0x442a1c[_0x5e81('0x36')]);_0x3ec488['filters']=_['intersection'](_0x3ec488[_0x5e81('0x34')],_0x3ec488['query']);_0x495b1b[_0x5e81('0x37')]=_[_0x5e81('0x38')](_0x3ec488[_0x5e81('0x34')],qs[_0x5e81('0x39')](_0x442a1c[_0x5e81('0x36')][_0x5e81('0x39')]));_0x495b1b[_0x5e81('0x37')]=_0x495b1b[_0x5e81('0x37')][_0x5e81('0x3a')]?_0x495b1b[_0x5e81('0x37')]:_0x3ec488[_0x5e81('0x34')];if(!_0x442a1c['query'][_0x5e81('0x3b')](_0x5e81('0x3c'))){_0x495b1b['limit']=qs[_0x5e81('0x22')](_0x442a1c[_0x5e81('0x36')][_0x5e81('0x22')]);_0x495b1b['offset']=qs[_0x5e81('0x1f')](_0x442a1c[_0x5e81('0x36')][_0x5e81('0x1f')]);}_0x495b1b['order']=qs[_0x5e81('0x3d')](_0x442a1c[_0x5e81('0x36')][_0x5e81('0x3d')]);_0x495b1b['where']=qs['filters'](_[_0x5e81('0x3e')](_0x442a1c[_0x5e81('0x36')],_0x3ec488[_0x5e81('0x3f')]),_0x3e3527);if(_0x442a1c['query'][_0x5e81('0x40')]){_0x495b1b[_0x5e81('0x41')]=_['merge'](_0x495b1b[_0x5e81('0x41')],{'$or':_['map'](_0x3e3527,function(_0x5855fc){if(_0x5855fc[_0x5e81('0x42')]!==_0x5e81('0x43')){var _0x4fc130={};_0x4fc130[_0x5855fc[_0x5e81('0x35')]]={'$like':'%'+_0x442a1c[_0x5e81('0x36')]['filter']+'%'};return _0x4fc130;}})});}_0x495b1b=_[_0x5e81('0x44')]({},_0x495b1b,_0x442a1c[_0x5e81('0x45')]);var _0x3027f8={'where':_0x495b1b[_0x5e81('0x41')]};return db[_0x5e81('0x46')][_0x5e81('0x21')](_0x3027f8)[_0x5e81('0x27')](function(_0x2e62ad){_0x3119e8[_0x5e81('0x21')]=_0x2e62ad;if(_0x442a1c[_0x5e81('0x36')][_0x5e81('0x47')]){_0x495b1b[_0x5e81('0x48')]=[{'all':!![]}];}return db[_0x5e81('0x46')]['findAll'](_0x495b1b);})['then'](function(_0xbd1b21){_0x3119e8[_0x5e81('0x49')]=_0xbd1b21;return _0x3119e8;})[_0x5e81('0x27')](respondWithFilteredResult(_0x457a13,_0x495b1b))[_0x5e81('0x4a')](handleError(_0x457a13,null));};exports[_0x5e81('0x4b')]=function(_0x40595a,_0x222008){var _0x3e35f8={'raw':!![],'where':{'id':_0x40595a['params']['id']}},_0x10385a={};_0x10385a[_0x5e81('0x34')]=_[_0x5e81('0x4c')](db[_0x5e81('0x46')][_0x5e81('0x31')]);_0x10385a[_0x5e81('0x36')]=_[_0x5e81('0x4c')](_0x40595a[_0x5e81('0x36')]);_0x10385a[_0x5e81('0x3f')]=_[_0x5e81('0x38')](_0x10385a[_0x5e81('0x34')],_0x10385a['query']);_0x3e35f8[_0x5e81('0x37')]=_[_0x5e81('0x38')](_0x10385a['model'],qs[_0x5e81('0x39')](_0x40595a[_0x5e81('0x36')][_0x5e81('0x39')]));_0x3e35f8[_0x5e81('0x37')]=_0x3e35f8['attributes']['length']?_0x3e35f8[_0x5e81('0x37')]:_0x10385a[_0x5e81('0x34')];if(_0x40595a[_0x5e81('0x36')][_0x5e81('0x47')]){_0x3e35f8[_0x5e81('0x48')]=[{'all':!![]}];}_0x3e35f8=_[_0x5e81('0x44')]({},_0x3e35f8,_0x40595a['options']);return db[_0x5e81('0x46')]['find'](_0x3e35f8)[_0x5e81('0x27')](handleEntityNotFound(_0x222008,null))['then'](respondWithResult(_0x222008,null))[_0x5e81('0x4a')](handleError(_0x222008,null));};exports[_0x5e81('0x4d')]=function(_0x5da436,_0x4b8f33){return db[_0x5e81('0x46')][_0x5e81('0x4d')](_0x5da436[_0x5e81('0x4e')],{})[_0x5e81('0x27')](function(_0x1a0c41){var _0x32266a=_0x5da436[_0x5e81('0x4f')]['get']({'plain':!![]});if(!_0x32266a)throw new Error(_0x5e81('0x50'));if(_0x32266a[_0x5e81('0x51')]===_0x5e81('0x4f')){var _0x502ef7=_0x1a0c41[_0x5e81('0x29')]({'plain':!![]});var _0x25bac1=_0x5e81('0x2a');return db['UserProfileSection'][_0x5e81('0x52')]({'where':{'name':_0x25bac1,'userProfileId':_0x32266a[_0x5e81('0x53')]},'raw':!![]})[_0x5e81('0x27')](function(_0x40dc96){if(_0x40dc96&&_0x40dc96[_0x5e81('0x54')]===0x0){return db[_0x5e81('0x2b')]['create']({'name':_0x502ef7[_0x5e81('0x35')],'resourceId':_0x502ef7['id'],'type':_0x40dc96['name'],'sectionId':_0x40dc96['id']},{})['then'](function(){return _0x1a0c41;});}else{return _0x1a0c41;}})[_0x5e81('0x4a')](function(_0x36ff00){logger[_0x5e81('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36ff00);throw _0x36ff00;});}return _0x1a0c41;})[_0x5e81('0x27')](respondWithResult(_0x4b8f33,0xc9))['catch'](handleError(_0x4b8f33,null));};exports[_0x5e81('0x55')]=function(_0x50f4b3,_0x390af1){if(_0x50f4b3['body']['id']){delete _0x50f4b3[_0x5e81('0x4e')]['id'];}return db[_0x5e81('0x46')][_0x5e81('0x52')]({'where':{'id':_0x50f4b3[_0x5e81('0x56')]['id']}})[_0x5e81('0x27')](handleEntityNotFound(_0x390af1,null))['then'](saveUpdates(_0x50f4b3[_0x5e81('0x4e')],null))[_0x5e81('0x27')](respondWithResult(_0x390af1,null))[_0x5e81('0x4a')](handleError(_0x390af1,null));};exports[_0x5e81('0x28')]=function(_0x22fc81,_0x259fa6){return db[_0x5e81('0x46')]['find']({'where':{'id':_0x22fc81['params']['id']}})['then'](handleEntityNotFound(_0x259fa6,null))[_0x5e81('0x27')](removeEntity(_0x259fa6,null))['catch'](handleError(_0x259fa6,null));};exports[_0x5e81('0x57')]=function(_0x3a12f8,_0x1177c9,_0x19df6f){return db[_0x5e81('0x46')]['find']({'where':{'id':_0x3a12f8[_0x5e81('0x56')]['id']},'attributes':[_0x5e81('0x35'),_0x5e81('0x58'),_0x5e81('0x59'),_0x5e81('0x5a')],'raw':!![]})[_0x5e81('0x27')](handleEntityNotFound(_0x1177c9,null))['then'](function(_0x3b7250){if(_0x3b7250){if(!fs[_0x5e81('0x5b')](path[_0x5e81('0x5c')](config['root'],_0x5e81('0x5d'),_0x3b7250[_0x5e81('0x59')]))){throw new db['Sequelize'][(_0x5e81('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3a12f8[_0x5e81('0x36')]['exists']){return _0x1177c9[_0x5e81('0x1b')](0xc8);}return _0x1177c9[_0x5e81('0x57')](path[_0x5e81('0x5c')](config['root'],_0x5e81('0x5d'),_0x3b7250['savename']),util[_0x5e81('0x5f')](_0x5e81('0x60'),_0x3b7250[_0x5e81('0x58')]||_0x3b7250['name'],_0x3b7250[_0x5e81('0x5a')][_0x5e81('0x61')]()));}})[_0x5e81('0x4a')](handleError(_0x1177c9,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 4c38967..eb5d6b7 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 _0x5beb=['moment','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api'];(function(_0x86f228,_0x6e0345){var _0x3b0c39=function(_0xa7cb1d){while(--_0xa7cb1d){_0x86f228['push'](_0x86f228['shift']());}};_0x3b0c39(++_0x6e0345);}(_0x5beb,0x81));var _0xb5be=function(_0x3f22a9,_0x2908fb){_0x3f22a9=_0x3f22a9-0x0;var _0x48143c=_0x5beb[_0x3f22a9];return _0x48143c;};'use strict';var _=require(_0xb5be('0x0'));var util=require(_0xb5be('0x1'));var logger=require('../../config/logger')(_0xb5be('0x2'));var moment=require(_0xb5be('0x3'));var BPromise=require('bluebird');var rp=require(_0xb5be('0x4'));var fs=require('fs');var path=require(_0xb5be('0x5'));var rimraf=require('rimraf');var config=require(_0xb5be('0x6'));var attributes=require(_0xb5be('0x7'));module[_0xb5be('0x8')]=function(_0x141bcb,_0x47bc3d){return _0x141bcb[_0xb5be('0x9')](_0xb5be('0xa'),attributes,{'tableName':_0xb5be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7169=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash'];(function(_0x95cf3f,_0x25e260){var _0x305d5f=function(_0x59e82c){while(--_0x59e82c){_0x95cf3f['push'](_0x95cf3f['shift']());}};_0x305d5f(++_0x25e260);}(_0x7169,0x1af));var _0x9716=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x7169[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x9716('0x0'));var util=require('util');var logger=require(_0x9716('0x1'))(_0x9716('0x2'));var moment=require(_0x9716('0x3'));var BPromise=require('bluebird');var rp=require(_0x9716('0x4'));var fs=require('fs');var path=require(_0x9716('0x5'));var rimraf=require(_0x9716('0x6'));var config=require(_0x9716('0x7'));var attributes=require(_0x9716('0x8'));module[_0x9716('0x9')]=function(_0xffdb6,_0xdcb2a3){return _0xffdb6[_0x9716('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x9716('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 62228a0..4c890fc 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 _0x1c52=['code','message','info','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x5d5fcd,_0x165444){var _0x5ec451=function(_0x1fb0c5){while(--_0x1fb0c5){_0x5d5fcd['push'](_0x5d5fcd['shift']());}};_0x5ec451(++_0x165444);}(_0x1c52,0x7c));var _0x21c5=function(_0x50c1cf,_0x4d75e8){_0x50c1cf=_0x50c1cf-0x0;var _0x4c285c=_0x1c52[_0x50c1cf];return _0x4c285c;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require(_0x21c5('0x2'));var BPromise=require(_0x21c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x21c5('0x4'));var logger=require(_0x21c5('0x5'))('rpc');var config=require(_0x21c5('0x6'));var jayson=require(_0x21c5('0x7'));var client=jayson[_0x21c5('0x8')][_0x21c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b12d5,_0xed0195,_0xb4b1e4){return new BPromise(function(_0x4c5a4f,_0xd34da2){return client[_0x21c5('0xa')](_0x5b12d5,_0xb4b1e4)[_0x21c5('0xb')](function(_0x27389f){logger['info'](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));logger[_0x21c5('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xed0195,_0x21c5('0xd'),JSON['stringify'](_0x27389f));if(_0x27389f[_0x21c5('0xf')]){if(_0x27389f[_0x21c5('0xf')][_0x21c5('0x10')]===0x1f4){logger[_0x21c5('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xed0195,_0x27389f[_0x21c5('0xf')]['message']);return _0xd34da2(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}logger['error'](_0x21c5('0xc'),_0xed0195,_0x27389f['error']['message']);return _0x4c5a4f(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}else{logger[_0x21c5('0x12')](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));_0x4c5a4f(_0x27389f[_0x21c5('0x13')][_0x21c5('0x11')]);}})['catch'](function(_0x331080){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0xed0195,_0x331080);_0xd34da2(_0x331080);});});}
\ No newline at end of file
+var _0x61ac=['ioredis','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','catch','util','bluebird','randomstring'];(function(_0x60277,_0x1e776a){var _0x1f48aa=function(_0x2f3972){while(--_0x2f3972){_0x60277['push'](_0x60277['shift']());}};_0x1f48aa(++_0x1e776a);}(_0x61ac,0x82));var _0xc61a=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x61ac[_0x30b0d8];return _0x459c09;};'use strict';var _=require('lodash');var util=require(_0xc61a('0x0'));var moment=require('moment');var BPromise=require(_0xc61a('0x1'));var rs=require(_0xc61a('0x2'));var fs=require('fs');var Redis=require(_0xc61a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc61a('0x4'))(_0xc61a('0x5'));var config=require(_0xc61a('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd3713d,_0x44dc3a,_0x18c5f6){return new BPromise(function(_0x142793,_0x249565){return client[_0xc61a('0x7')](_0xd3713d,_0x18c5f6)[_0xc61a('0x8')](function(_0x11db87){logger[_0xc61a('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x44dc3a,_0xc61a('0xa'));logger[_0xc61a('0xb')](_0xc61a('0xc'),_0x44dc3a,_0xc61a('0xa'),JSON[_0xc61a('0xd')](_0x11db87));if(_0x11db87[_0xc61a('0xe')]){if(_0x11db87['error'][_0xc61a('0xf')]===0x1f4){logger[_0xc61a('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x44dc3a,_0x11db87[_0xc61a('0xe')]['message']);return _0x249565(_0x11db87['error'][_0xc61a('0x10')]);}logger['error'](_0xc61a('0x11'),_0x44dc3a,_0x11db87['error'][_0xc61a('0x10')]);return _0x142793(_0x11db87[_0xc61a('0xe')][_0xc61a('0x10')]);}else{logger[_0xc61a('0x9')](_0xc61a('0x11'),_0x44dc3a,'request\x20sent');_0x142793(_0x11db87['result']['message']);}})[_0xc61a('0x12')](function(_0x2af687){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x44dc3a,_0x2af687);_0x249565(_0x2af687);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index b1d301c..f7fca46 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 _0x7311=['/:id','show','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7311,0xc6));var _0x1731=function(_0x2d4686,_0x3d6dbb){_0x2d4686=_0x2d4686-0x0;var _0x16f68b=_0x7311[_0x2d4686];return _0x16f68b;};'use strict';var multer=require(_0x1731('0x0'));var util=require(_0x1731('0x1'));var path=require(_0x1731('0x2'));var timeout=require(_0x1731('0x3'));var express=require(_0x1731('0x4'));var router=express[_0x1731('0x5')]();var fs_extra=require(_0x1731('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1731('0x7'));var controller=require(_0x1731('0x8'));router[_0x1731('0x9')]('/',auth[_0x1731('0xa')](),controller[_0x1731('0xb')]);router['get'](_0x1731('0xc'),auth['isAuthenticated'](),controller[_0x1731('0xd')]);router['get']('/:id/download',auth[_0x1731('0xa')](),controller[_0x1731('0xe')]);router[_0x1731('0xf')]('/',auth['isAuthenticated'](),controller[_0x1731('0x10')]);router[_0x1731('0x11')]('/:id',auth[_0x1731('0xa')](),controller[_0x1731('0x12')]);router[_0x1731('0x13')](_0x1731('0xc'),auth[_0x1731('0xa')](),controller[_0x1731('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x6cef=['/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','delete'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x6cef,0x168));var _0xf6ce=function(_0x5759e0,_0x31984b){_0x5759e0=_0x5759e0-0x0;var _0x1a64cd=_0x6cef[_0x5759e0];return _0x1a64cd;};'use strict';var multer=require(_0xf6ce('0x0'));var util=require(_0xf6ce('0x1'));var path=require('path');var timeout=require(_0xf6ce('0x2'));var express=require(_0xf6ce('0x3'));var router=express['Router']();var fs_extra=require(_0xf6ce('0x4'));var auth=require(_0xf6ce('0x5'));var interaction=require(_0xf6ce('0x6'));var config=require(_0xf6ce('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xf6ce('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xf6ce('0x9')](),controller[_0xf6ce('0xa')]);router[_0xf6ce('0x8')]('/:id/download',auth[_0xf6ce('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xf6ce('0xb')]);router[_0xf6ce('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf6ce('0xd')](_0xf6ce('0xe'),auth[_0xf6ce('0x9')](),controller[_0xf6ce('0xf')]);module[_0xf6ce('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 3604fab..a534833 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 _0xdebb=['TEXT','STRING','BOOLEAN','exports'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0xdebb,0x19f));var _0xbdeb=function(_0x51a5f0,_0x242359){_0x51a5f0=_0x51a5f0-0x0;var _0x5e4c22=_0xdebb[_0x51a5f0];return _0x5e4c22;};'use strict';var Sequelize=require('sequelize');module[_0xbdeb('0x0')]={'field':{'type':Sequelize[_0xbdeb('0x1')]},'alias':{'type':Sequelize[_0xbdeb('0x2')]},'function':{'type':Sequelize[_0xbdeb('0x2')]},'format':{'type':Sequelize[_0xbdeb('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbdeb('0x2')]},'custom':{'type':Sequelize[_0xbdeb('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9957=['exports','STRING','BOOLEAN','sequelize'];(function(_0x145a20,_0x36bf23){var _0x2e94a2=function(_0x1a2666){while(--_0x1a2666){_0x145a20['push'](_0x145a20['shift']());}};_0x2e94a2(++_0x36bf23);}(_0x9957,0x1c7));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x7995('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x7995('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7995('0x2')]},'custom':{'type':Sequelize[_0x7995('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 6c0bb7a..0c39fb1 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 _0xb107=['filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','find','catch','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','status','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x595e6a,_0x470428){var _0x1ab357=function(_0x13be26){while(--_0x13be26){_0x595e6a['push'](_0x595e6a['shift']());}};_0x1ab357(++_0x470428);}(_0xb107,0x157));var _0x7b10=function(_0x43ae08,_0x17c9a7){_0x43ae08=_0x43ae08-0x0;var _0x368c3e=_0xb107[_0x43ae08];return _0x368c3e;};'use strict';var emlformat=require(_0x7b10('0x0'));var rimraf=require(_0x7b10('0x1'));var zipdir=require(_0x7b10('0x2'));var jsonpatch=require(_0x7b10('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7b10('0x4'));var Mustache=require(_0x7b10('0x5'));var util=require(_0x7b10('0x6'));var path=require(_0x7b10('0x7'));var sox=require(_0x7b10('0x8'));var csv=require(_0x7b10('0x9'));var ejs=require(_0x7b10('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b10('0xb'));var squel=require(_0x7b10('0xc'));var crypto=require(_0x7b10('0xd'));var jsforce=require(_0x7b10('0xe'));var deskjs=require(_0x7b10('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7b10('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b10('0x11'));var logger=require(_0x7b10('0x12'))(_0x7b10('0x13'));var utils=require(_0x7b10('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x357792,_0x148f0c){_0x148f0c=_0x148f0c||0xcc;return function(_0x495171){if(_0x495171){return _0x357792['sendStatus'](_0x148f0c);}return _0x357792['status'](_0x148f0c)[_0x7b10('0x15')]();};}function respondWithResult(_0x26b85b,_0xa47908){_0xa47908=_0xa47908||0xc8;return function(_0x16e739){if(_0x16e739){return _0x26b85b['status'](_0xa47908)['json'](_0x16e739);}};}function respondWithFilteredResult(_0x2ad258,_0xe65ddc){return function(_0x315ef3){if(_0x315ef3){var _0x429520=typeof _0xe65ddc[_0x7b10('0x16')]===_0x7b10('0x17')&&typeof _0xe65ddc[_0x7b10('0x18')]==='undefined';var _0x2fdc4a=_0x315ef3[_0x7b10('0x19')];var _0x13286a=_0x429520?0x0:_0xe65ddc['offset'];var _0x10dad7=_0x429520?_0x315ef3[_0x7b10('0x19')]:_0xe65ddc[_0x7b10('0x16')]+_0xe65ddc['limit'];var _0x74bc51;if(_0x10dad7>=_0x2fdc4a){_0x10dad7=_0x2fdc4a;_0x74bc51=0xc8;}else{_0x74bc51=0xce;}_0x2ad258['status'](_0x74bc51);return _0x2ad258[_0x7b10('0x1a')](_0x7b10('0x1b'),_0x13286a+'-'+_0x10dad7+'/'+_0x2fdc4a)[_0x7b10('0x1c')](_0x315ef3);}return null;};}function patchUpdates(_0x2fa0c1){return function(_0x8fde2b){try{jsonpatch['apply'](_0x8fde2b,_0x2fa0c1,!![]);}catch(_0x599610){return BPromise[_0x7b10('0x1d')](_0x599610);}return _0x8fde2b['save']();};}function saveUpdates(_0x30314d,_0x5af895){return function(_0x5254c0){if(_0x5254c0){return _0x5254c0[_0x7b10('0x1e')](_0x30314d)[_0x7b10('0x1f')](function(_0x1d01c1){return _0x1d01c1;});}return null;};}function removeEntity(_0x4201ab,_0x39ba60){return function(_0x5ca8fe){if(_0x5ca8fe){return _0x5ca8fe[_0x7b10('0x20')]()['then'](function(){_0x4201ab[_0x7b10('0x21')](0xcc)[_0x7b10('0x15')]();});}};}function handleEntityNotFound(_0x42b2c9,_0x58b147){return function(_0x5c3745){if(!_0x5c3745){_0x42b2c9[_0x7b10('0x22')](0x194);}return _0x5c3745;};}function handleError(_0x106b69,_0x12304a){_0x12304a=_0x12304a||0x1f4;return function(_0x1b585b){logger[_0x7b10('0x23')](_0x1b585b[_0x7b10('0x24')]);if(_0x1b585b[_0x7b10('0x25')]){delete _0x1b585b['name'];}_0x106b69['status'](_0x12304a)[_0x7b10('0x26')](_0x1b585b);};}exports[_0x7b10('0x27')]=function(_0x348a09,_0x15b653){var _0x3756b={},_0x41508d={},_0x29875f={'count':0x0,'rows':[]};var _0x4c7c60=_[_0x7b10('0x28')](db[_0x7b10('0x29')]['rawAttributes'],function(_0xbd9eb4){return{'name':_0xbd9eb4[_0x7b10('0x2a')],'type':_0xbd9eb4[_0x7b10('0x2b')][_0x7b10('0x2c')]};});_0x41508d['model']=_[_0x7b10('0x28')](_0x4c7c60,_0x7b10('0x25'));_0x41508d[_0x7b10('0x2d')]=_[_0x7b10('0x2e')](_0x348a09[_0x7b10('0x2d')]);_0x41508d[_0x7b10('0x2f')]=_[_0x7b10('0x30')](_0x41508d[_0x7b10('0x31')],_0x41508d[_0x7b10('0x2d')]);_0x3756b['attributes']=_[_0x7b10('0x30')](_0x41508d[_0x7b10('0x31')],qs[_0x7b10('0x32')](_0x348a09[_0x7b10('0x2d')][_0x7b10('0x32')]));_0x3756b['attributes']=_0x3756b['attributes']['length']?_0x3756b[_0x7b10('0x33')]:_0x41508d['model'];if(!_0x348a09[_0x7b10('0x2d')][_0x7b10('0x34')](_0x7b10('0x35'))){_0x3756b[_0x7b10('0x18')]=qs[_0x7b10('0x18')](_0x348a09[_0x7b10('0x2d')][_0x7b10('0x18')]);_0x3756b[_0x7b10('0x16')]=qs[_0x7b10('0x16')](_0x348a09[_0x7b10('0x2d')][_0x7b10('0x16')]);}_0x3756b[_0x7b10('0x36')]=qs['sort'](_0x348a09['query'][_0x7b10('0x37')]);_0x3756b[_0x7b10('0x38')]=qs[_0x7b10('0x2f')](_['pick'](_0x348a09[_0x7b10('0x2d')],_0x41508d[_0x7b10('0x2f')]),_0x4c7c60);if(_0x348a09['query'][_0x7b10('0x39')]){_0x3756b['where']=_[_0x7b10('0x3a')](_0x3756b[_0x7b10('0x38')],{'$or':_['map'](_0x4c7c60,function(_0x416d1e){if(_0x416d1e[_0x7b10('0x2b')]!==_0x7b10('0x3b')){var _0x316ab4={};_0x316ab4[_0x416d1e[_0x7b10('0x25')]]={'$like':'%'+_0x348a09['query'][_0x7b10('0x39')]+'%'};return _0x316ab4;}})});}_0x3756b=_[_0x7b10('0x3a')]({},_0x3756b,_0x348a09[_0x7b10('0x3c')]);var _0x5218ad={'where':_0x3756b[_0x7b10('0x38')]};return db[_0x7b10('0x29')][_0x7b10('0x19')](_0x5218ad)[_0x7b10('0x1f')](function(_0xa200e7){_0x29875f[_0x7b10('0x19')]=_0xa200e7;if(_0x348a09[_0x7b10('0x2d')][_0x7b10('0x3d')]){_0x3756b[_0x7b10('0x3e')]=[{'all':!![]}];}return db[_0x7b10('0x29')]['findAll'](_0x3756b);})[_0x7b10('0x1f')](function(_0x152e8c){_0x29875f[_0x7b10('0x3f')]=_0x152e8c;return _0x29875f;})[_0x7b10('0x1f')](respondWithFilteredResult(_0x15b653,_0x3756b))['catch'](handleError(_0x15b653,null));};exports[_0x7b10('0x40')]=function(_0x2f1219,_0x1f6998){var _0x1e6253={'raw':![],'where':{'id':_0x2f1219[_0x7b10('0x41')]['id']}},_0x155a25={};_0x155a25[_0x7b10('0x31')]=_[_0x7b10('0x2e')](db['AnalyticFieldReport'][_0x7b10('0x42')]);_0x155a25['query']=_[_0x7b10('0x2e')](_0x2f1219['query']);_0x155a25[_0x7b10('0x2f')]=_[_0x7b10('0x30')](_0x155a25[_0x7b10('0x31')],_0x155a25[_0x7b10('0x2d')]);_0x1e6253[_0x7b10('0x33')]=_['intersection'](_0x155a25['model'],qs['fields'](_0x2f1219['query'][_0x7b10('0x32')]));_0x1e6253[_0x7b10('0x33')]=_0x1e6253[_0x7b10('0x33')][_0x7b10('0x43')]?_0x1e6253['attributes']:_0x155a25[_0x7b10('0x31')];if(_0x2f1219[_0x7b10('0x2d')][_0x7b10('0x3d')]){_0x1e6253[_0x7b10('0x3e')]=[{'all':!![]}];}_0x1e6253=_[_0x7b10('0x3a')]({},_0x1e6253,_0x2f1219[_0x7b10('0x3c')]);return db[_0x7b10('0x29')][_0x7b10('0x44')](_0x1e6253)[_0x7b10('0x1f')](handleEntityNotFound(_0x1f6998,null))[_0x7b10('0x1f')](respondWithResult(_0x1f6998,null))[_0x7b10('0x45')](handleError(_0x1f6998,null));};exports[_0x7b10('0x46')]=function(_0x59eb92,_0x248b38){return db[_0x7b10('0x29')][_0x7b10('0x46')](_0x59eb92[_0x7b10('0x47')],{})[_0x7b10('0x1f')](respondWithResult(_0x248b38,0xc9))[_0x7b10('0x45')](handleError(_0x248b38,null));};exports[_0x7b10('0x48')]=function(_0x403760,_0x44af1c){return db[_0x7b10('0x29')][_0x7b10('0x48')](_0x403760[_0x7b10('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x44af1c,0xc9))['catch'](handleError(_0x44af1c,null));};exports[_0x7b10('0x1e')]=function(_0x3284a1,_0x502df7){if(_0x3284a1[_0x7b10('0x47')]['id']){delete _0x3284a1[_0x7b10('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7b10('0x44')]({'where':{'id':_0x3284a1[_0x7b10('0x41')]['id']}})[_0x7b10('0x1f')](handleEntityNotFound(_0x502df7,null))[_0x7b10('0x1f')](saveUpdates(_0x3284a1[_0x7b10('0x47')],null))['then'](respondWithResult(_0x502df7,null))[_0x7b10('0x45')](handleError(_0x502df7,null));};exports[_0x7b10('0x20')]=function(_0x5c0742,_0xf7b42a){return db[_0x7b10('0x29')][_0x7b10('0x44')]({'where':{'id':_0x5c0742[_0x7b10('0x41')]['id']}})[_0x7b10('0x1f')](handleEntityNotFound(_0xf7b42a,null))['then'](removeEntity(_0xf7b42a,null))[_0x7b10('0x45')](handleError(_0xf7b42a,null));};exports['bulkDestroy']=function(_0x39f9de,_0x1eda68){return db['AnalyticFieldReport'][_0x7b10('0x20')]({'where':{'id':_0x39f9de[_0x7b10('0x2d')][_0x7b10('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x7b10('0x1f')](respondWithResult(_0x1eda68,0xcc))[_0x7b10('0x45')](handleError(_0x1eda68,null));};exports[_0x7b10('0x4a')]=function(_0xc68cfc,_0x3ec1f9,_0x24f101){return db[_0x7b10('0x4b')][_0x7b10('0x4c')]({'where':{'id':_0xc68cfc[_0x7b10('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ec1f9,null))[_0x7b10('0x1f')](function(_0x3c0bc5){if(_0x3c0bc5){return db[_0x7b10('0x4d')][_0x7b10('0x4e')](function(_0xbc74fe){return db[_0x7b10('0x29')]['destroy']({'where':{'CustomReportId':_0xc68cfc[_0x7b10('0x41')]['id']},'transaction':_0xbc74fe})[_0x7b10('0x1f')](function(_0x17d2eb){var _0x3c194c=_[_0x7b10('0x28')](_0xc68cfc[_0x7b10('0x47')],function(_0x5b023d){delete _0x5b023d['id'];_0x5b023d[_0x7b10('0x4f')]=_0xc68cfc[_0x7b10('0x41')]['id'];return _0x5b023d;});return db[_0x7b10('0x29')][_0x7b10('0x48')](_0x3c194c,{'transaction':_0xbc74fe});});})[_0x7b10('0x1f')](function(){return db[_0x7b10('0x29')]['findAll']({'where':{'CustomReportId':_0xc68cfc['params']['id']}});});}})[_0x7b10('0x1f')](respondWithResult(_0x3ec1f9,null))['catch'](handleError(_0x3ec1f9,null));};
\ No newline at end of file
+var _0x3054=['bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','catch','create','bulkCreate','body','bulkDestroy','ids','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x13bd18,_0x5a0a04){var _0x22505d=function(_0x22f135){while(--_0x22f135){_0x13bd18['push'](_0x13bd18['shift']());}};_0x22505d(++_0x5a0a04);}(_0x3054,0x9d));var _0x4305=function(_0x434f9a,_0x47a0ea){_0x434f9a=_0x434f9a-0x0;var _0x43877e=_0x3054[_0x434f9a];return _0x43877e;};'use strict';var emlformat=require(_0x4305('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4305('0x1'));var jsonpatch=require(_0x4305('0x2'));var rp=require(_0x4305('0x3'));var moment=require(_0x4305('0x4'));var BPromise=require(_0x4305('0x5'));var Mustache=require(_0x4305('0x6'));var util=require(_0x4305('0x7'));var path=require(_0x4305('0x8'));var sox=require(_0x4305('0x9'));var csv=require('to-csv');var ejs=require(_0x4305('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4305('0xb'));var squel=require(_0x4305('0xc'));var crypto=require(_0x4305('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4305('0xe'));var querystring=require(_0x4305('0xf'));var Papa=require(_0x4305('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4305('0x11'));var as=require(_0x4305('0x12'));var hardwareService=require(_0x4305('0x13'));var logger=require('../../config/logger')(_0x4305('0x14'));var utils=require(_0x4305('0x15'));var config=require(_0x4305('0x16'));var licenseUtil=require(_0x4305('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fb3cb,_0x3531a6){_0x3531a6=_0x3531a6||0xcc;return function(_0x56b247){if(_0x56b247){return _0x4fb3cb[_0x4305('0x18')](_0x3531a6);}return _0x4fb3cb[_0x4305('0x19')](_0x3531a6)[_0x4305('0x1a')]();};}function respondWithResult(_0x29f4fd,_0x401cee){_0x401cee=_0x401cee||0xc8;return function(_0x5d00b9){if(_0x5d00b9){return _0x29f4fd['status'](_0x401cee)[_0x4305('0x1b')](_0x5d00b9);}};}function respondWithFilteredResult(_0x1e10fa,_0xde2ce8){return function(_0xcacefb){if(_0xcacefb){var _0x52f790=typeof _0xde2ce8[_0x4305('0x1c')]===_0x4305('0x1d')&&typeof _0xde2ce8[_0x4305('0x1e')]===_0x4305('0x1d');var _0x4d73f4=_0xcacefb[_0x4305('0x1f')];var _0x41d1b8=_0x52f790?0x0:_0xde2ce8[_0x4305('0x1c')];var _0x201d40=_0x52f790?_0xcacefb[_0x4305('0x1f')]:_0xde2ce8[_0x4305('0x1c')]+_0xde2ce8['limit'];var _0x341fa0;if(_0x201d40>=_0x4d73f4){_0x201d40=_0x4d73f4;_0x341fa0=0xc8;}else{_0x341fa0=0xce;}_0x1e10fa['status'](_0x341fa0);return _0x1e10fa[_0x4305('0x20')](_0x4305('0x21'),_0x41d1b8+'-'+_0x201d40+'/'+_0x4d73f4)['json'](_0xcacefb);}return null;};}function patchUpdates(_0x176f50){return function(_0x433203){try{jsonpatch[_0x4305('0x22')](_0x433203,_0x176f50,!![]);}catch(_0x5cc90a){return BPromise['reject'](_0x5cc90a);}return _0x433203[_0x4305('0x23')]();};}function saveUpdates(_0x4498b1,_0x1f7d8f){return function(_0x451660){if(_0x451660){return _0x451660[_0x4305('0x24')](_0x4498b1)[_0x4305('0x25')](function(_0x269151){return _0x269151;});}return null;};}function removeEntity(_0x30ca31,_0x5a27c0){return function(_0x3038d1){if(_0x3038d1){return _0x3038d1[_0x4305('0x26')]()[_0x4305('0x25')](function(){_0x30ca31['status'](0xcc)[_0x4305('0x1a')]();});}};}function handleEntityNotFound(_0x1cf6b6,_0x3563b9){return function(_0x3ab565){if(!_0x3ab565){_0x1cf6b6['sendStatus'](0x194);}return _0x3ab565;};}function handleError(_0x3ccdfc,_0x2796c7){_0x2796c7=_0x2796c7||0x1f4;return function(_0x5e9ecd){logger['error'](_0x5e9ecd[_0x4305('0x27')]);if(_0x5e9ecd[_0x4305('0x28')]){delete _0x5e9ecd['name'];}_0x3ccdfc[_0x4305('0x19')](_0x2796c7)[_0x4305('0x29')](_0x5e9ecd);};}exports[_0x4305('0x2a')]=function(_0x1d66ea,_0x1b33d9){var _0x85c563={},_0x910886={},_0x6f5671={'count':0x0,'rows':[]};var _0x28fff8=_[_0x4305('0x2b')](db[_0x4305('0x2c')][_0x4305('0x2d')],function(_0x13f3a3){return{'name':_0x13f3a3[_0x4305('0x2e')],'type':_0x13f3a3[_0x4305('0x2f')][_0x4305('0x30')]};});_0x910886[_0x4305('0x31')]=_['map'](_0x28fff8,_0x4305('0x28'));_0x910886['query']=_[_0x4305('0x32')](_0x1d66ea[_0x4305('0x33')]);_0x910886[_0x4305('0x34')]=_[_0x4305('0x35')](_0x910886['model'],_0x910886['query']);_0x85c563['attributes']=_[_0x4305('0x35')](_0x910886[_0x4305('0x31')],qs[_0x4305('0x36')](_0x1d66ea[_0x4305('0x33')][_0x4305('0x36')]));_0x85c563[_0x4305('0x37')]=_0x85c563[_0x4305('0x37')]['length']?_0x85c563['attributes']:_0x910886[_0x4305('0x31')];if(!_0x1d66ea[_0x4305('0x33')][_0x4305('0x38')](_0x4305('0x39'))){_0x85c563[_0x4305('0x1e')]=qs[_0x4305('0x1e')](_0x1d66ea[_0x4305('0x33')]['limit']);_0x85c563['offset']=qs[_0x4305('0x1c')](_0x1d66ea[_0x4305('0x33')][_0x4305('0x1c')]);}_0x85c563['order']=qs[_0x4305('0x3a')](_0x1d66ea[_0x4305('0x33')]['sort']);_0x85c563[_0x4305('0x3b')]=qs['filters'](_['pick'](_0x1d66ea[_0x4305('0x33')],_0x910886['filters']),_0x28fff8);if(_0x1d66ea[_0x4305('0x33')][_0x4305('0x3c')]){_0x85c563[_0x4305('0x3b')]=_[_0x4305('0x3d')](_0x85c563[_0x4305('0x3b')],{'$or':_[_0x4305('0x2b')](_0x28fff8,function(_0x4065d4){if(_0x4065d4[_0x4305('0x2f')]!==_0x4305('0x3e')){var _0x3e24a8={};_0x3e24a8[_0x4065d4['name']]={'$like':'%'+_0x1d66ea['query'][_0x4305('0x3c')]+'%'};return _0x3e24a8;}})});}_0x85c563=_['merge']({},_0x85c563,_0x1d66ea[_0x4305('0x3f')]);var _0x279519={'where':_0x85c563[_0x4305('0x3b')]};return db[_0x4305('0x2c')][_0x4305('0x1f')](_0x279519)[_0x4305('0x25')](function(_0x1ea355){_0x6f5671[_0x4305('0x1f')]=_0x1ea355;if(_0x1d66ea['query'][_0x4305('0x40')]){_0x85c563[_0x4305('0x41')]=[{'all':!![]}];}return db[_0x4305('0x2c')][_0x4305('0x42')](_0x85c563);})[_0x4305('0x25')](function(_0x186aa4){_0x6f5671['rows']=_0x186aa4;return _0x6f5671;})[_0x4305('0x25')](respondWithFilteredResult(_0x1b33d9,_0x85c563))['catch'](handleError(_0x1b33d9,null));};exports[_0x4305('0x43')]=function(_0x386054,_0x425e77){var _0x48e217={'raw':![],'where':{'id':_0x386054[_0x4305('0x44')]['id']}},_0x151b7a={};_0x151b7a[_0x4305('0x31')]=_[_0x4305('0x32')](db[_0x4305('0x2c')]['rawAttributes']);_0x151b7a[_0x4305('0x33')]=_['keys'](_0x386054[_0x4305('0x33')]);_0x151b7a['filters']=_['intersection'](_0x151b7a[_0x4305('0x31')],_0x151b7a[_0x4305('0x33')]);_0x48e217[_0x4305('0x37')]=_['intersection'](_0x151b7a[_0x4305('0x31')],qs[_0x4305('0x36')](_0x386054[_0x4305('0x33')][_0x4305('0x36')]));_0x48e217[_0x4305('0x37')]=_0x48e217[_0x4305('0x37')][_0x4305('0x45')]?_0x48e217['attributes']:_0x151b7a[_0x4305('0x31')];if(_0x386054[_0x4305('0x33')][_0x4305('0x40')]){_0x48e217[_0x4305('0x41')]=[{'all':!![]}];}_0x48e217=_[_0x4305('0x3d')]({},_0x48e217,_0x386054[_0x4305('0x3f')]);return db[_0x4305('0x2c')][_0x4305('0x46')](_0x48e217)[_0x4305('0x25')](handleEntityNotFound(_0x425e77,null))[_0x4305('0x25')](respondWithResult(_0x425e77,null))[_0x4305('0x47')](handleError(_0x425e77,null));};exports[_0x4305('0x48')]=function(_0xf2cb1b,_0x3f9d1b){return db[_0x4305('0x2c')]['create'](_0xf2cb1b['body'],{})[_0x4305('0x25')](respondWithResult(_0x3f9d1b,0xc9))[_0x4305('0x47')](handleError(_0x3f9d1b,null));};exports[_0x4305('0x49')]=function(_0x24dd3f,_0x239f57){return db['AnalyticFieldReport'][_0x4305('0x49')](_0x24dd3f[_0x4305('0x4a')],{'raw':![],'individualHooks':!![]})[_0x4305('0x25')](respondWithResult(_0x239f57,0xc9))[_0x4305('0x47')](handleError(_0x239f57,null));};exports[_0x4305('0x24')]=function(_0x2dde8b,_0x53ca6b){if(_0x2dde8b[_0x4305('0x4a')]['id']){delete _0x2dde8b['body']['id'];}return db[_0x4305('0x2c')][_0x4305('0x46')]({'where':{'id':_0x2dde8b[_0x4305('0x44')]['id']}})[_0x4305('0x25')](handleEntityNotFound(_0x53ca6b,null))[_0x4305('0x25')](saveUpdates(_0x2dde8b[_0x4305('0x4a')],null))[_0x4305('0x25')](respondWithResult(_0x53ca6b,null))[_0x4305('0x47')](handleError(_0x53ca6b,null));};exports[_0x4305('0x26')]=function(_0x57922e,_0x172b1){return db[_0x4305('0x2c')][_0x4305('0x46')]({'where':{'id':_0x57922e[_0x4305('0x44')]['id']}})[_0x4305('0x25')](handleEntityNotFound(_0x172b1,null))[_0x4305('0x25')](removeEntity(_0x172b1,null))['catch'](handleError(_0x172b1,null));};exports[_0x4305('0x4b')]=function(_0x2f6b5f,_0x1fcd75){return db['AnalyticFieldReport'][_0x4305('0x26')]({'where':{'id':_0x2f6b5f[_0x4305('0x33')][_0x4305('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1fcd75,0xcc))[_0x4305('0x47')](handleError(_0x1fcd75,null));};exports['addFields']=function(_0x52b8a1,_0x423c0f,_0x5cfdda){return db['AnalyticCustomReport'][_0x4305('0x4d')]({'where':{'id':_0x52b8a1[_0x4305('0x44')]['id']}})[_0x4305('0x25')](handleEntityNotFound(_0x423c0f,null))[_0x4305('0x25')](function(_0x2997c0){if(_0x2997c0){return db[_0x4305('0x4e')][_0x4305('0x4f')](function(_0x395b82){return db[_0x4305('0x2c')][_0x4305('0x26')]({'where':{'CustomReportId':_0x52b8a1[_0x4305('0x44')]['id']},'transaction':_0x395b82})[_0x4305('0x25')](function(_0x1f0b81){var _0xc0606e=_['map'](_0x52b8a1[_0x4305('0x4a')],function(_0x281ad9){delete _0x281ad9['id'];_0x281ad9[_0x4305('0x50')]=_0x52b8a1[_0x4305('0x44')]['id'];return _0x281ad9;});return db[_0x4305('0x2c')][_0x4305('0x49')](_0xc0606e,{'transaction':_0x395b82});});})[_0x4305('0x25')](function(){return db[_0x4305('0x2c')][_0x4305('0x42')]({'where':{'CustomReportId':_0x52b8a1['params']['id']}});});}})['then'](respondWithResult(_0x423c0f,null))[_0x4305('0x47')](handleError(_0x423c0f,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 631cd8b..1bcc255 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 _0x87cc=['api','moment','bluebird','request-promise','../../config/environment','AnalyticFieldReport','analytics_report_fields','util','../../config/logger'];(function(_0xc2a130,_0x900599){var _0x247f87=function(_0x3c78c3){while(--_0x3c78c3){_0xc2a130['push'](_0xc2a130['shift']());}};_0x247f87(++_0x900599);}(_0x87cc,0x19c));var _0xc87c=function(_0x49f9e8,_0x54ee65){_0x49f9e8=_0x49f9e8-0x0;var _0xdd03e4=_0x87cc[_0x49f9e8];return _0xdd03e4;};'use strict';var _=require('lodash');var util=require(_0xc87c('0x0'));var logger=require(_0xc87c('0x1'))(_0xc87c('0x2'));var moment=require(_0xc87c('0x3'));var BPromise=require(_0xc87c('0x4'));var rp=require(_0xc87c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc87c('0x6'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x41cbfc,_0x553ace){return _0x41cbfc['define'](_0xc87c('0x7'),attributes,{'tableName':_0xc87c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1075=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields'];(function(_0x27db09,_0x440a29){var _0x2c2ee0=function(_0xc378c2){while(--_0xc378c2){_0x27db09['push'](_0x27db09['shift']());}};_0x2c2ee0(++_0x440a29);}(_0x1075,0x1e0));var _0x5107=function(_0xe506a9,_0x3105d4){_0xe506a9=_0xe506a9-0x0;var _0x12ca6f=_0x1075[_0xe506a9];return _0x12ca6f;};'use strict';var _=require(_0x5107('0x0'));var util=require(_0x5107('0x1'));var logger=require(_0x5107('0x2'))(_0x5107('0x3'));var moment=require(_0x5107('0x4'));var BPromise=require(_0x5107('0x5'));var rp=require(_0x5107('0x6'));var fs=require('fs');var path=require(_0x5107('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5107('0x8'));module[_0x5107('0x9')]=function(_0x4a777a,_0x3049e0){return _0x4a777a['define'](_0x5107('0xa'),attributes,{'tableName':_0x5107('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 6a97e37..5007bb0 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 _0x6449=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x32ac3d,_0x12aef3){var _0x4065b8=function(_0x2dcca7){while(--_0x2dcca7){_0x32ac3d['push'](_0x32ac3d['shift']());}};_0x4065b8(++_0x12aef3);}(_0x6449,0x1a4));var _0x9644=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x6449[_0x31ced5];return _0x10d9e5;};'use strict';var _=require('lodash');var util=require(_0x9644('0x0'));var moment=require(_0x9644('0x1'));var BPromise=require(_0x9644('0x2'));var rs=require(_0x9644('0x3'));var fs=require('fs');var Redis=require(_0x9644('0x4'));var db=require(_0x9644('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9644('0x6'))(_0x9644('0x7'));var config=require(_0x9644('0x8'));var jayson=require(_0x9644('0x9'));var client=jayson['client'][_0x9644('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4662b1,_0x3aab6a,_0x4445bc){return new BPromise(function(_0x1067c5,_0x3eae31){return client[_0x9644('0xb')](_0x4662b1,_0x4445bc)[_0x9644('0xc')](function(_0x9b8175){logger[_0x9644('0xd')](_0x9644('0xe'),_0x3aab6a,_0x9644('0xf'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3aab6a,_0x9644('0xf'),JSON['stringify'](_0x9b8175));if(_0x9b8175[_0x9644('0x10')]){if(_0x9b8175[_0x9644('0x10')][_0x9644('0x11')]===0x1f4){logger[_0x9644('0x10')](_0x9644('0xe'),_0x3aab6a,_0x9b8175[_0x9644('0x10')][_0x9644('0x12')]);return _0x3eae31(_0x9b8175[_0x9644('0x10')][_0x9644('0x12')]);}logger[_0x9644('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3aab6a,_0x9b8175['error'][_0x9644('0x12')]);return _0x1067c5(_0x9b8175[_0x9644('0x10')][_0x9644('0x12')]);}else{logger[_0x9644('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3aab6a,_0x9644('0xf'));_0x1067c5(_0x9b8175[_0x9644('0x13')][_0x9644('0x12')]);}})[_0x9644('0x14')](function(_0x2d54e3){logger[_0x9644('0x10')](_0x9644('0xe'),_0x3aab6a,_0x2d54e3);_0x3eae31(_0x2d54e3);});});}
\ No newline at end of file
+var _0x012d=['../../config/environment','jayson/promise','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3a87c9,_0x132bad){var _0x4e1ad8=function(_0x4ef7cd){while(--_0x4ef7cd){_0x3a87c9['push'](_0x3a87c9['shift']());}};_0x4e1ad8(++_0x132bad);}(_0x012d,0xdb));var _0xd012=function(_0x5c600e,_0x3c2fbc){_0x5c600e=_0x5c600e-0x0;var _0x12821d=_0x012d[_0x5c600e];return _0x12821d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd012('0x0'));var BPromise=require(_0xd012('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd012('0x2'))['db'];var utils=require(_0xd012('0x3'));var logger=require(_0xd012('0x4'))('rpc');var config=require(_0xd012('0x5'));var jayson=require(_0xd012('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x214d8a,_0x4de228,_0x1a4bc0){return new BPromise(function(_0x8fae65,_0x2fd76c){return client[_0xd012('0x7')](_0x214d8a,_0x1a4bc0)['then'](function(_0x555840){logger[_0xd012('0x8')](_0xd012('0x9'),_0x4de228,_0xd012('0xa'));logger[_0xd012('0xb')](_0xd012('0xc'),_0x4de228,_0xd012('0xa'),JSON['stringify'](_0x555840));if(_0x555840[_0xd012('0xd')]){if(_0x555840[_0xd012('0xd')][_0xd012('0xe')]===0x1f4){logger[_0xd012('0xd')](_0xd012('0x9'),_0x4de228,_0x555840[_0xd012('0xd')][_0xd012('0xf')]);return _0x2fd76c(_0x555840['error'][_0xd012('0xf')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4de228,_0x555840[_0xd012('0xd')][_0xd012('0xf')]);return _0x8fae65(_0x555840[_0xd012('0xd')][_0xd012('0xf')]);}else{logger[_0xd012('0x8')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4de228,_0xd012('0xa'));_0x8fae65(_0x555840['result'][_0xd012('0xf')]);}})['catch'](function(_0x35de5e){logger[_0xd012('0xd')](_0xd012('0x9'),_0x4de228,_0x35de5e);_0x2fd76c(_0x35de5e);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 45c786d..33785dd 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(_0x54919b,_0x23ff76){var _0x49a8a5=function(_0x37ee89){while(--_0x37ee89){_0x54919b['push'](_0x54919b['shift']());}};_0x49a8a5(++_0x23ff76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x3461db,_0x3e64bf){var _0xf49372=function(_0x2f11c8){while(--_0x2f11c8){_0x3461db['push'](_0x3461db['shift']());}};_0xf49372(++_0x3e64bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 b3bd9bb..1081c45 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 _0xc686=['STRING'];(function(_0x346b2b,_0x3c7be1){var _0xe31b68=function(_0xd2f439){while(--_0xd2f439){_0x346b2b['push'](_0x346b2b['shift']());}};_0xe31b68(++_0x3c7be1);}(_0xc686,0x148));var _0x6c68=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc686[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6c68('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x6c68('0x0')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x6c68('0x0')]}};
\ No newline at end of file
+var _0x6b24=['exports','STRING','name'];(function(_0x562b2c,_0x597e60){var _0xaf8f62=function(_0xe1b3ff){while(--_0xe1b3ff){_0x562b2c['push'](_0x562b2c['shift']());}};_0xaf8f62(++_0x597e60);}(_0x6b24,0x1ce));var _0x46b2=function(_0x382ca6,_0x1aaf79){_0x382ca6=_0x382ca6-0x0;var _0x295a6c=_0x6b24[_0x382ca6];return _0x295a6c;};'use strict';var Sequelize=require('sequelize');module[_0x46b2('0x0')]={'name':{'type':Sequelize[_0x46b2('0x1')],'allowNull':![],'unique':_0x46b2('0x2')},'table':{'type':Sequelize[_0x46b2('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 25b9895..ca51e05 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0x84ab,0x12f));var _0xb84a=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x84ab[_0x37ffea];return _0x2e2615;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,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(_0x46717d,_0x71b508){var _0x35f49e=function(_0x3d1b39){while(--_0x3d1b39){_0x46717d['push'](_0x46717d['shift']());}};_0x35f49e(++_0x71b508);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x450f09,_0x59561d){_0x450f09=_0x450f09-0x0;var _0x4e22ec=_0xf2ca[_0x450f09];return _0x4e22ec;};'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 5020ef9..2d20054 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 _0xc5c8=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x307462,_0x58a62f){var _0x7bced2=function(_0x5aacee){while(--_0x5aacee){_0x307462['push'](_0x307462['shift']());}};_0x7bced2(++_0x58a62f);}(_0xc5c8,0x118));var _0x8c5c=function(_0x5c8aee,_0x374f36){_0x5c8aee=_0x5c8aee-0x0;var _0x292920=_0xc5c8[_0x5c8aee];return _0x292920;};'use strict';var _=require(_0x8c5c('0x0'));var util=require(_0x8c5c('0x1'));var logger=require(_0x8c5c('0x2'))('api');var moment=require(_0x8c5c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c5c('0x4'));var rimraf=require(_0x8c5c('0x5'));var config=require('../../config/environment');var attributes=require(_0x8c5c('0x6'));module[_0x8c5c('0x7')]=function(_0x390b86,_0x2e297d){return _0x390b86[_0x8c5c('0x8')](_0x8c5c('0x9'),attributes,{'tableName':_0x8c5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb931=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x11f9cc,_0xe933d9){var _0x48d3d3=function(_0x5c442b){while(--_0x5c442b){_0x11f9cc['push'](_0x11f9cc['shift']());}};_0x48d3d3(++_0xe933d9);}(_0xb931,0x155));var _0x1b93=function(_0x347a6a,_0x353c64){_0x347a6a=_0x347a6a-0x0;var _0x4a07d8=_0xb931[_0x347a6a];return _0x4a07d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b93('0x0'))('api');var moment=require('moment');var BPromise=require(_0x1b93('0x1'));var rp=require(_0x1b93('0x2'));var fs=require('fs');var path=require(_0x1b93('0x3'));var rimraf=require(_0x1b93('0x4'));var config=require(_0x1b93('0x5'));var attributes=require(_0x1b93('0x6'));module[_0x1b93('0x7')]=function(_0x3a30b2,_0x701ab1){return _0x3a30b2[_0x1b93('0x8')](_0x1b93('0x9'),attributes,{'tableName':_0x1b93('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index d01fdf6..64310cc 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 _0x06bb=['debug','error','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x58401b,_0x1fe81c){var _0x5d7f3f=function(_0x1f8cd8){while(--_0x1f8cd8){_0x58401b['push'](_0x58401b['shift']());}};_0x5d7f3f(++_0x1fe81c);}(_0x06bb,0x17e));var _0xb06b=function(_0x4467f2,_0x512525){_0x4467f2=_0x4467f2-0x0;var _0x1fcc7d=_0x06bb[_0x4467f2];return _0x1fcc7d;};'use strict';var _=require(_0xb06b('0x0'));var util=require('util');var moment=require(_0xb06b('0x1'));var BPromise=require('bluebird');var rs=require(_0xb06b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb06b('0x3'))['db'];var utils=require(_0xb06b('0x4'));var logger=require(_0xb06b('0x5'))(_0xb06b('0x6'));var config=require(_0xb06b('0x7'));var jayson=require(_0xb06b('0x8'));var client=jayson[_0xb06b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27578e,_0x104306,_0xcbf83d){return new BPromise(function(_0x527159,_0x36cb7c){return client[_0xb06b('0xa')](_0x27578e,_0xcbf83d)['then'](function(_0x382c44){logger[_0xb06b('0xb')](_0xb06b('0xc'),_0x104306,_0xb06b('0xd'));logger[_0xb06b('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x104306,'request\x20sent',JSON['stringify'](_0x382c44));if(_0x382c44[_0xb06b('0xf')]){if(_0x382c44[_0xb06b('0xf')]['code']===0x1f4){logger[_0xb06b('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x104306,_0x382c44['error'][_0xb06b('0x10')]);return _0x36cb7c(_0x382c44[_0xb06b('0xf')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x104306,_0x382c44[_0xb06b('0xf')][_0xb06b('0x10')]);return _0x527159(_0x382c44[_0xb06b('0xf')][_0xb06b('0x10')]);}else{logger[_0xb06b('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x104306,_0xb06b('0xd'));_0x527159(_0x382c44['result'][_0xb06b('0x10')]);}})[_0xb06b('0x11')](function(_0x22e9a8){logger['error'](_0xb06b('0xc'),_0x104306,_0x22e9a8);_0x36cb7c(_0x22e9a8);});});}
\ No newline at end of file
+var _0x1810=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','info','request\x20sent','catch','lodash'];(function(_0x4941ee,_0x465d06){var _0x567c9c=function(_0x5a368f){while(--_0x5a368f){_0x4941ee['push'](_0x4941ee['shift']());}};_0x567c9c(++_0x465d06);}(_0x1810,0x15f));var _0x0181=function(_0x1ca66c,_0x3e3868){_0x1ca66c=_0x1ca66c-0x0;var _0x5a78ce=_0x1810[_0x1ca66c];return _0x5a78ce;};'use strict';var _=require(_0x0181('0x0'));var util=require('util');var moment=require(_0x0181('0x1'));var BPromise=require(_0x0181('0x2'));var rs=require(_0x0181('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0181('0x4'))['db'];var utils=require(_0x0181('0x5'));var logger=require(_0x0181('0x6'))(_0x0181('0x7'));var config=require(_0x0181('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0181('0x9')][_0x0181('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x153c6d,_0x3e1c8d,_0x3ea7b7){return new BPromise(function(_0x15b912,_0x2ecc7d){return client[_0x0181('0xb')](_0x153c6d,_0x3ea7b7)[_0x0181('0xc')](function(_0x4a2dfa){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x3e1c8d,'request\x20sent');logger[_0x0181('0xd')](_0x0181('0xe'),_0x3e1c8d,'request\x20sent',JSON[_0x0181('0xf')](_0x4a2dfa));if(_0x4a2dfa[_0x0181('0x10')]){if(_0x4a2dfa[_0x0181('0x10')]['code']===0x1f4){logger[_0x0181('0x10')](_0x0181('0x11'),_0x3e1c8d,_0x4a2dfa[_0x0181('0x10')]['message']);return _0x2ecc7d(_0x4a2dfa[_0x0181('0x10')][_0x0181('0x12')]);}logger[_0x0181('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x3e1c8d,_0x4a2dfa['error'][_0x0181('0x12')]);return _0x15b912(_0x4a2dfa[_0x0181('0x10')][_0x0181('0x12')]);}else{logger[_0x0181('0x13')](_0x0181('0x11'),_0x3e1c8d,_0x0181('0x14'));_0x15b912(_0x4a2dfa['result']['message']);}})[_0x0181('0x15')](function(_0xd3e00f){logger[_0x0181('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x3e1c8d,_0xd3e00f);_0x2ecc7d(_0xd3e00f);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 27728f6..a683d69 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 _0xd206=['isAuthenticated','/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x26c1ea,_0x1c2f33){var _0x394cee=function(_0x22b216){while(--_0x22b216){_0x26c1ea['push'](_0x26c1ea['shift']());}};_0x394cee(++_0x1c2f33);}(_0xd206,0x107));var _0x6d20=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xd206[_0x616290];return _0x453879;};'use strict';var multer=require(_0x6d20('0x0'));var util=require(_0x6d20('0x1'));var path=require('path');var timeout=require(_0x6d20('0x2'));var express=require(_0x6d20('0x3'));var router=express[_0x6d20('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d20('0x5'));var interaction=require(_0x6d20('0x6'));var config=require(_0x6d20('0x7'));var controller=require(_0x6d20('0x8'));router['get']('/',auth[_0x6d20('0x9')](),controller['index']);router['get'](_0x6d20('0xa'),auth[_0x6d20('0x9')](),controller['show']);router[_0x6d20('0xb')]('/',auth['isAuthenticated'](),controller[_0x6d20('0xc')]);router[_0x6d20('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6d20('0xe')](_0x6d20('0xa'),auth['isAuthenticated'](),controller[_0x6d20('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xdd68=['post','isAuthenticated','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','show'];(function(_0x2b28e0,_0x4f4540){var _0x345d8b=function(_0x7fc60a){while(--_0x7fc60a){_0x2b28e0['push'](_0x2b28e0['shift']());}};_0x345d8b(++_0x4f4540);}(_0xdd68,0x196));var _0x8dd6=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0xdd68[_0xc8a11];return _0x55a500;};'use strict';var multer=require(_0x8dd6('0x0'));var util=require('util');var path=require(_0x8dd6('0x1'));var timeout=require(_0x8dd6('0x2'));var express=require(_0x8dd6('0x3'));var router=express[_0x8dd6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8dd6('0x5'));var interaction=require(_0x8dd6('0x6'));var config=require('../../config/environment');var controller=require(_0x8dd6('0x7'));router[_0x8dd6('0x8')]('/',auth['isAuthenticated'](),controller[_0x8dd6('0x9')]);router['get'](_0x8dd6('0xa'),auth['isAuthenticated'](),controller[_0x8dd6('0xb')]);router[_0x8dd6('0xc')]('/',auth[_0x8dd6('0xd')](),controller['create']);router[_0x8dd6('0xe')](_0x8dd6('0xa'),auth[_0x8dd6('0xd')](),controller[_0x8dd6('0xf')]);router[_0x8dd6('0x10')](_0x8dd6('0xa'),auth[_0x8dd6('0xd')](),controller[_0x8dd6('0x11')]);module[_0x8dd6('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 6ec9d95..abba461 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 _0x8ead=['exports','TEXT','sequelize'];(function(_0x23d313,_0x4a9058){var _0x30aaa0=function(_0x4f3735){while(--_0x4f3735){_0x23d313['push'](_0x23d313['shift']());}};_0x30aaa0(++_0x4a9058);}(_0x8ead,0x1c4));var _0xd8ea=function(_0x4ef375,_0x2be61a){_0x4ef375=_0x4ef375-0x0;var _0x4bd11a=_0x8ead[_0x4ef375];return _0x4bd11a;};'use strict';var Sequelize=require(_0xd8ea('0x0'));module[_0xd8ea('0x1')]={'tree':{'type':Sequelize[_0xd8ea('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xfb3c=['exports','TEXT','sequelize'];(function(_0x5a50d4,_0x230600){var _0x27fc12=function(_0x4753fc){while(--_0x4753fc){_0x5a50d4['push'](_0x5a50d4['shift']());}};_0x27fc12(++_0x230600);}(_0xfb3c,0x1df));var _0xcfb3=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xfb3c[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xcfb3('0x0'));module[_0xcfb3('0x1')]={'tree':{'type':Sequelize[_0xcfb3('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 b1e73cf..38263bf 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 _0x79b6=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','stack','name','index','map','AnalyticTreeReport','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x197122,_0x350384){var _0x405a4a=function(_0xcf36eb){while(--_0xcf36eb){_0x197122['push'](_0x197122['shift']());}};_0x405a4a(++_0x350384);}(_0x79b6,0x84));var _0x679b=function(_0x327c0e,_0xcd6344){_0x327c0e=_0x327c0e-0x0;var _0x3a38b6=_0x79b6[_0x327c0e];return _0x3a38b6;};'use strict';var emlformat=require(_0x679b('0x0'));var rimraf=require(_0x679b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x679b('0x2'));var moment=require(_0x679b('0x3'));var BPromise=require(_0x679b('0x4'));var Mustache=require('mustache');var util=require(_0x679b('0x5'));var path=require(_0x679b('0x6'));var sox=require(_0x679b('0x7'));var csv=require(_0x679b('0x8'));var ejs=require(_0x679b('0x9'));var fs=require('fs');var fs_extra=require(_0x679b('0xa'));var _=require(_0x679b('0xb'));var squel=require('squel');var crypto=require(_0x679b('0xc'));var jsforce=require(_0x679b('0xd'));var deskjs=require(_0x679b('0xe'));var toCsv=require(_0x679b('0x8'));var querystring=require(_0x679b('0xf'));var Papa=require(_0x679b('0x10'));var Redis=require('ioredis');var authService=require(_0x679b('0x11'));var qs=require(_0x679b('0x12'));var as=require(_0x679b('0x13'));var hardwareService=require(_0x679b('0x14'));var logger=require('../../config/logger')(_0x679b('0x15'));var utils=require('../../config/utils');var config=require(_0x679b('0x16'));var licenseUtil=require(_0x679b('0x17'));var db=require(_0x679b('0x18'))['db'];function respondWithStatusCode(_0xd605b0,_0x8b5fc8){_0x8b5fc8=_0x8b5fc8||0xcc;return function(_0x1a34ef){if(_0x1a34ef){return _0xd605b0[_0x679b('0x19')](_0x8b5fc8);}return _0xd605b0['status'](_0x8b5fc8)['end']();};}function respondWithResult(_0x58a662,_0x183b7b){_0x183b7b=_0x183b7b||0xc8;return function(_0xb67091){if(_0xb67091){return _0x58a662[_0x679b('0x1a')](_0x183b7b)[_0x679b('0x1b')](_0xb67091);}};}function respondWithFilteredResult(_0x1bf1eb,_0x4b04ef){return function(_0x2a4ab6){if(_0x2a4ab6){var _0x2296bd=typeof _0x4b04ef[_0x679b('0x1c')]==='undefined'&&typeof _0x4b04ef['limit']===_0x679b('0x1d');var _0x59ff82=_0x2a4ab6[_0x679b('0x1e')];var _0x2c6c23=_0x2296bd?0x0:_0x4b04ef['offset'];var _0x1b6b1e=_0x2296bd?_0x2a4ab6[_0x679b('0x1e')]:_0x4b04ef[_0x679b('0x1c')]+_0x4b04ef[_0x679b('0x1f')];var _0x3a2071;if(_0x1b6b1e>=_0x59ff82){_0x1b6b1e=_0x59ff82;_0x3a2071=0xc8;}else{_0x3a2071=0xce;}_0x1bf1eb[_0x679b('0x1a')](_0x3a2071);return _0x1bf1eb[_0x679b('0x20')]('Content-Range',_0x2c6c23+'-'+_0x1b6b1e+'/'+_0x59ff82)[_0x679b('0x1b')](_0x2a4ab6);}return null;};}function patchUpdates(_0x622957){return function(_0x231e01){try{jsonpatch[_0x679b('0x21')](_0x231e01,_0x622957,!![]);}catch(_0x5f1603){return BPromise['reject'](_0x5f1603);}return _0x231e01[_0x679b('0x22')]();};}function saveUpdates(_0x2644e3,_0x513613){return function(_0x408ca8){if(_0x408ca8){return _0x408ca8[_0x679b('0x23')](_0x2644e3)[_0x679b('0x24')](function(_0x591e36){return _0x591e36;});}return null;};}function removeEntity(_0x195942,_0x588496){return function(_0x2c2c6f){if(_0x2c2c6f){return _0x2c2c6f[_0x679b('0x25')]()[_0x679b('0x24')](function(){_0x195942['status'](0xcc)[_0x679b('0x26')]();});}};}function handleEntityNotFound(_0x1cc5fd,_0x35bbc7){return function(_0x25538b){if(!_0x25538b){_0x1cc5fd[_0x679b('0x19')](0x194);}return _0x25538b;};}function handleError(_0x3f36c5,_0x59e586){_0x59e586=_0x59e586||0x1f4;return function(_0xdd548f){logger['error'](_0xdd548f[_0x679b('0x27')]);if(_0xdd548f[_0x679b('0x28')]){delete _0xdd548f[_0x679b('0x28')];}_0x3f36c5['status'](_0x59e586)['send'](_0xdd548f);};}exports[_0x679b('0x29')]=function(_0x37a86c,_0xe9f57){var _0x430a11={},_0x262099={},_0x24c8e2={'count':0x0,'rows':[]};var _0x294063=_[_0x679b('0x2a')](db[_0x679b('0x2b')]['rawAttributes'],function(_0x6a8a4a){return{'name':_0x6a8a4a[_0x679b('0x2c')],'type':_0x6a8a4a[_0x679b('0x2d')]['key']};});_0x262099['model']=_['map'](_0x294063,_0x679b('0x28'));_0x262099[_0x679b('0x2e')]=_[_0x679b('0x2f')](_0x37a86c[_0x679b('0x2e')]);_0x262099[_0x679b('0x30')]=_[_0x679b('0x31')](_0x262099[_0x679b('0x32')],_0x262099[_0x679b('0x2e')]);_0x430a11[_0x679b('0x33')]=_[_0x679b('0x31')](_0x262099['model'],qs[_0x679b('0x34')](_0x37a86c[_0x679b('0x2e')][_0x679b('0x34')]));_0x430a11[_0x679b('0x33')]=_0x430a11[_0x679b('0x33')]['length']?_0x430a11[_0x679b('0x33')]:_0x262099[_0x679b('0x32')];if(!_0x37a86c[_0x679b('0x2e')][_0x679b('0x35')](_0x679b('0x36'))){_0x430a11[_0x679b('0x1f')]=qs['limit'](_0x37a86c[_0x679b('0x2e')][_0x679b('0x1f')]);_0x430a11[_0x679b('0x1c')]=qs[_0x679b('0x1c')](_0x37a86c['query'][_0x679b('0x1c')]);}_0x430a11[_0x679b('0x37')]=qs[_0x679b('0x38')](_0x37a86c[_0x679b('0x2e')][_0x679b('0x38')]);_0x430a11['where']=qs[_0x679b('0x30')](_[_0x679b('0x39')](_0x37a86c['query'],_0x262099[_0x679b('0x30')]),_0x294063);if(_0x37a86c[_0x679b('0x2e')][_0x679b('0x3a')]){_0x430a11['where']=_[_0x679b('0x3b')](_0x430a11[_0x679b('0x3c')],{'$or':_[_0x679b('0x2a')](_0x294063,function(_0x39f42b){if(_0x39f42b[_0x679b('0x2d')]!=='VIRTUAL'){var _0x55404d={};_0x55404d[_0x39f42b[_0x679b('0x28')]]={'$like':'%'+_0x37a86c['query'][_0x679b('0x3a')]+'%'};return _0x55404d;}})});}_0x430a11=_[_0x679b('0x3b')]({},_0x430a11,_0x37a86c[_0x679b('0x3d')]);var _0x2da713={'where':_0x430a11[_0x679b('0x3c')]};return db[_0x679b('0x2b')][_0x679b('0x1e')](_0x2da713)[_0x679b('0x24')](function(_0x7706ef){_0x24c8e2[_0x679b('0x1e')]=_0x7706ef;if(_0x37a86c[_0x679b('0x2e')][_0x679b('0x3e')]){_0x430a11[_0x679b('0x3f')]=[{'all':!![]}];}return db[_0x679b('0x2b')][_0x679b('0x40')](_0x430a11);})[_0x679b('0x24')](function(_0x4d1504){_0x24c8e2[_0x679b('0x41')]=_0x4d1504;return _0x24c8e2;})[_0x679b('0x24')](respondWithFilteredResult(_0xe9f57,_0x430a11))[_0x679b('0x42')](handleError(_0xe9f57,null));};exports[_0x679b('0x43')]=function(_0x534108,_0x2061dd){var _0xa33260={'raw':!![],'where':{'id':_0x534108['params']['id']}},_0x468939={};_0x468939['model']=_[_0x679b('0x2f')](db[_0x679b('0x2b')]['rawAttributes']);_0x468939['query']=_['keys'](_0x534108['query']);_0x468939[_0x679b('0x30')]=_[_0x679b('0x31')](_0x468939[_0x679b('0x32')],_0x468939[_0x679b('0x2e')]);_0xa33260['attributes']=_[_0x679b('0x31')](_0x468939[_0x679b('0x32')],qs[_0x679b('0x34')](_0x534108[_0x679b('0x2e')][_0x679b('0x34')]));_0xa33260[_0x679b('0x33')]=_0xa33260[_0x679b('0x33')]['length']?_0xa33260[_0x679b('0x33')]:_0x468939[_0x679b('0x32')];if(_0x534108[_0x679b('0x2e')]['includeAll']){_0xa33260[_0x679b('0x3f')]=[{'all':!![]}];}_0xa33260=_['merge']({},_0xa33260,_0x534108['options']);return db['AnalyticTreeReport']['find'](_0xa33260)[_0x679b('0x24')](handleEntityNotFound(_0x2061dd,null))[_0x679b('0x24')](respondWithResult(_0x2061dd,null))[_0x679b('0x42')](handleError(_0x2061dd,null));};exports[_0x679b('0x44')]=function(_0x7e0ac3,_0x20b8e4){return db[_0x679b('0x2b')]['create'](_0x7e0ac3[_0x679b('0x45')],{})['then'](respondWithResult(_0x20b8e4,0xc9))[_0x679b('0x42')](handleError(_0x20b8e4,null));};exports['update']=function(_0x2a69d1,_0x3c8ac4){if(_0x2a69d1['body']['id']){delete _0x2a69d1[_0x679b('0x45')]['id'];}return db[_0x679b('0x2b')][_0x679b('0x46')]({'where':{'id':_0x2a69d1[_0x679b('0x47')]['id']}})[_0x679b('0x24')](handleEntityNotFound(_0x3c8ac4,null))[_0x679b('0x24')](saveUpdates(_0x2a69d1[_0x679b('0x45')],null))['then'](respondWithResult(_0x3c8ac4,null))[_0x679b('0x42')](handleError(_0x3c8ac4,null));};exports[_0x679b('0x25')]=function(_0x15597c,_0x39d4bb){return db['AnalyticTreeReport'][_0x679b('0x46')]({'where':{'id':_0x15597c[_0x679b('0x47')]['id']}})[_0x679b('0x24')](handleEntityNotFound(_0x39d4bb,null))[_0x679b('0x24')](removeEntity(_0x39d4bb,null))[_0x679b('0x42')](handleError(_0x39d4bb,null));};
\ No newline at end of file
+var _0x9bc4=['jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','lodash','squel','crypto'];(function(_0x19bcd2,_0x47fd97){var _0x152996=function(_0x41f195){while(--_0x41f195){_0x19bcd2['push'](_0x19bcd2['shift']());}};_0x152996(++_0x47fd97);}(_0x9bc4,0xd1));var _0x49bc=function(_0x143bb5,_0x2400ad){_0x143bb5=_0x143bb5-0x0;var _0x54cb40=_0x9bc4[_0x143bb5];return _0x54cb40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x49bc('0x0'));var zipdir=require(_0x49bc('0x1'));var jsonpatch=require(_0x49bc('0x2'));var rp=require(_0x49bc('0x3'));var moment=require('moment');var BPromise=require(_0x49bc('0x4'));var Mustache=require(_0x49bc('0x5'));var util=require(_0x49bc('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x49bc('0x7'));var squel=require(_0x49bc('0x8'));var crypto=require(_0x49bc('0x9'));var jsforce=require(_0x49bc('0xa'));var deskjs=require(_0x49bc('0xb'));var toCsv=require(_0x49bc('0xc'));var querystring=require(_0x49bc('0xd'));var Papa=require('papaparse');var Redis=require(_0x49bc('0xe'));var authService=require(_0x49bc('0xf'));var qs=require(_0x49bc('0x10'));var as=require(_0x49bc('0x11'));var hardwareService=require(_0x49bc('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x49bc('0x13'));var config=require(_0x49bc('0x14'));var licenseUtil=require(_0x49bc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x452268,_0x4709bd){_0x4709bd=_0x4709bd||0xcc;return function(_0x563ccc){if(_0x563ccc){return _0x452268[_0x49bc('0x16')](_0x4709bd);}return _0x452268['status'](_0x4709bd)[_0x49bc('0x17')]();};}function respondWithResult(_0x4b2fc2,_0x36ca90){_0x36ca90=_0x36ca90||0xc8;return function(_0x9fa191){if(_0x9fa191){return _0x4b2fc2['status'](_0x36ca90)[_0x49bc('0x18')](_0x9fa191);}};}function respondWithFilteredResult(_0xe97bc0,_0x221d62){return function(_0x5a60ca){if(_0x5a60ca){var _0x23c89d=typeof _0x221d62['offset']==='undefined'&&typeof _0x221d62[_0x49bc('0x19')]===_0x49bc('0x1a');var _0x133701=_0x5a60ca[_0x49bc('0x1b')];var _0x4294af=_0x23c89d?0x0:_0x221d62[_0x49bc('0x1c')];var _0x1eb04d=_0x23c89d?_0x5a60ca[_0x49bc('0x1b')]:_0x221d62['offset']+_0x221d62['limit'];var _0x40093c;if(_0x1eb04d>=_0x133701){_0x1eb04d=_0x133701;_0x40093c=0xc8;}else{_0x40093c=0xce;}_0xe97bc0[_0x49bc('0x1d')](_0x40093c);return _0xe97bc0['set'](_0x49bc('0x1e'),_0x4294af+'-'+_0x1eb04d+'/'+_0x133701)[_0x49bc('0x18')](_0x5a60ca);}return null;};}function patchUpdates(_0x1b2afa){return function(_0x190759){try{jsonpatch['apply'](_0x190759,_0x1b2afa,!![]);}catch(_0x11b023){return BPromise[_0x49bc('0x1f')](_0x11b023);}return _0x190759[_0x49bc('0x20')]();};}function saveUpdates(_0x5e5e18,_0x6c54bc){return function(_0x538e81){if(_0x538e81){return _0x538e81[_0x49bc('0x21')](_0x5e5e18)[_0x49bc('0x22')](function(_0x34dfb2){return _0x34dfb2;});}return null;};}function removeEntity(_0x14226d,_0x2367d5){return function(_0x57cc8e){if(_0x57cc8e){return _0x57cc8e[_0x49bc('0x23')]()['then'](function(){_0x14226d[_0x49bc('0x1d')](0xcc)[_0x49bc('0x17')]();});}};}function handleEntityNotFound(_0x13e168,_0x2f7c6a){return function(_0x5bf2d5){if(!_0x5bf2d5){_0x13e168[_0x49bc('0x16')](0x194);}return _0x5bf2d5;};}function handleError(_0x15df54,_0x3244a3){_0x3244a3=_0x3244a3||0x1f4;return function(_0x5e292e){logger[_0x49bc('0x24')](_0x5e292e[_0x49bc('0x25')]);if(_0x5e292e[_0x49bc('0x26')]){delete _0x5e292e['name'];}_0x15df54[_0x49bc('0x1d')](_0x3244a3)[_0x49bc('0x27')](_0x5e292e);};}exports[_0x49bc('0x28')]=function(_0x3aa3da,_0x3fef37){var _0x542e84={},_0x3daea1={},_0x3dd64d={'count':0x0,'rows':[]};var _0x23d977=_[_0x49bc('0x29')](db[_0x49bc('0x2a')][_0x49bc('0x2b')],function(_0x3985e0){return{'name':_0x3985e0[_0x49bc('0x2c')],'type':_0x3985e0[_0x49bc('0x2d')][_0x49bc('0x2e')]};});_0x3daea1['model']=_[_0x49bc('0x29')](_0x23d977,_0x49bc('0x26'));_0x3daea1['query']=_[_0x49bc('0x2f')](_0x3aa3da[_0x49bc('0x30')]);_0x3daea1[_0x49bc('0x31')]=_[_0x49bc('0x32')](_0x3daea1[_0x49bc('0x33')],_0x3daea1[_0x49bc('0x30')]);_0x542e84[_0x49bc('0x34')]=_[_0x49bc('0x32')](_0x3daea1[_0x49bc('0x33')],qs['fields'](_0x3aa3da[_0x49bc('0x30')][_0x49bc('0x35')]));_0x542e84[_0x49bc('0x34')]=_0x542e84[_0x49bc('0x34')][_0x49bc('0x36')]?_0x542e84[_0x49bc('0x34')]:_0x3daea1[_0x49bc('0x33')];if(!_0x3aa3da[_0x49bc('0x30')][_0x49bc('0x37')](_0x49bc('0x38'))){_0x542e84[_0x49bc('0x19')]=qs['limit'](_0x3aa3da[_0x49bc('0x30')]['limit']);_0x542e84[_0x49bc('0x1c')]=qs[_0x49bc('0x1c')](_0x3aa3da['query'][_0x49bc('0x1c')]);}_0x542e84[_0x49bc('0x39')]=qs[_0x49bc('0x3a')](_0x3aa3da[_0x49bc('0x30')]['sort']);_0x542e84[_0x49bc('0x3b')]=qs['filters'](_[_0x49bc('0x3c')](_0x3aa3da[_0x49bc('0x30')],_0x3daea1[_0x49bc('0x31')]),_0x23d977);if(_0x3aa3da[_0x49bc('0x30')]['filter']){_0x542e84[_0x49bc('0x3b')]=_[_0x49bc('0x3d')](_0x542e84[_0x49bc('0x3b')],{'$or':_[_0x49bc('0x29')](_0x23d977,function(_0x56960a){if(_0x56960a['type']!==_0x49bc('0x3e')){var _0x364703={};_0x364703[_0x56960a[_0x49bc('0x26')]]={'$like':'%'+_0x3aa3da['query'][_0x49bc('0x3f')]+'%'};return _0x364703;}})});}_0x542e84=_['merge']({},_0x542e84,_0x3aa3da[_0x49bc('0x40')]);var _0x4f81d8={'where':_0x542e84[_0x49bc('0x3b')]};return db['AnalyticTreeReport'][_0x49bc('0x1b')](_0x4f81d8)['then'](function(_0x375fd0){_0x3dd64d[_0x49bc('0x1b')]=_0x375fd0;if(_0x3aa3da['query'][_0x49bc('0x41')]){_0x542e84[_0x49bc('0x42')]=[{'all':!![]}];}return db[_0x49bc('0x2a')][_0x49bc('0x43')](_0x542e84);})[_0x49bc('0x22')](function(_0x3e1a1d){_0x3dd64d['rows']=_0x3e1a1d;return _0x3dd64d;})['then'](respondWithFilteredResult(_0x3fef37,_0x542e84))[_0x49bc('0x44')](handleError(_0x3fef37,null));};exports['show']=function(_0x453f3d,_0x16530d){var _0x542136={'raw':!![],'where':{'id':_0x453f3d[_0x49bc('0x45')]['id']}},_0x469675={};_0x469675[_0x49bc('0x33')]=_[_0x49bc('0x2f')](db[_0x49bc('0x2a')]['rawAttributes']);_0x469675['query']=_[_0x49bc('0x2f')](_0x453f3d[_0x49bc('0x30')]);_0x469675[_0x49bc('0x31')]=_[_0x49bc('0x32')](_0x469675['model'],_0x469675['query']);_0x542136[_0x49bc('0x34')]=_[_0x49bc('0x32')](_0x469675[_0x49bc('0x33')],qs[_0x49bc('0x35')](_0x453f3d[_0x49bc('0x30')][_0x49bc('0x35')]));_0x542136[_0x49bc('0x34')]=_0x542136['attributes'][_0x49bc('0x36')]?_0x542136[_0x49bc('0x34')]:_0x469675['model'];if(_0x453f3d['query'][_0x49bc('0x41')]){_0x542136[_0x49bc('0x42')]=[{'all':!![]}];}_0x542136=_[_0x49bc('0x3d')]({},_0x542136,_0x453f3d[_0x49bc('0x40')]);return db[_0x49bc('0x2a')][_0x49bc('0x46')](_0x542136)[_0x49bc('0x22')](handleEntityNotFound(_0x16530d,null))['then'](respondWithResult(_0x16530d,null))['catch'](handleError(_0x16530d,null));};exports[_0x49bc('0x47')]=function(_0xfef2a5,_0x578b9d){return db[_0x49bc('0x2a')][_0x49bc('0x47')](_0xfef2a5[_0x49bc('0x48')],{})['then'](respondWithResult(_0x578b9d,0xc9))[_0x49bc('0x44')](handleError(_0x578b9d,null));};exports[_0x49bc('0x21')]=function(_0x47e55f,_0x1d0935){if(_0x47e55f[_0x49bc('0x48')]['id']){delete _0x47e55f[_0x49bc('0x48')]['id'];}return db['AnalyticTreeReport'][_0x49bc('0x46')]({'where':{'id':_0x47e55f[_0x49bc('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d0935,null))[_0x49bc('0x22')](saveUpdates(_0x47e55f[_0x49bc('0x48')],null))[_0x49bc('0x22')](respondWithResult(_0x1d0935,null))[_0x49bc('0x44')](handleError(_0x1d0935,null));};exports[_0x49bc('0x23')]=function(_0xa3d06e,_0x349123){return db[_0x49bc('0x2a')][_0x49bc('0x46')]({'where':{'id':_0xa3d06e['params']['id']}})['then'](handleEntityNotFound(_0x349123,null))[_0x49bc('0x22')](removeEntity(_0x349123,null))[_0x49bc('0x44')](handleError(_0x349123,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 83431c4..7f39060 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 _0x52f0=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0x52f0,0xa1));var _0x052f=function(_0x1765c4,_0x151565){_0x1765c4=_0x1765c4-0x0;var _0x56645f=_0x52f0[_0x1765c4];return _0x56645f;};'use strict';var _=require(_0x052f('0x0'));var util=require(_0x052f('0x1'));var logger=require(_0x052f('0x2'))('api');var moment=require(_0x052f('0x3'));var BPromise=require(_0x052f('0x4'));var rp=require(_0x052f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x052f('0x6'));var config=require(_0x052f('0x7'));var attributes=require(_0x052f('0x8'));module[_0x052f('0x9')]=function(_0x3010e8,_0x172e9b){return _0x3010e8[_0x052f('0xa')](_0x052f('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x33f3=['define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x3ab5b5,_0x51ac49){var _0xec5463=function(_0x3d71ba){while(--_0x3d71ba){_0x3ab5b5['push'](_0x3ab5b5['shift']());}};_0xec5463(++_0x51ac49);}(_0x33f3,0x1ef));var _0x333f=function(_0xbd7af7,_0xac5f7){_0xbd7af7=_0xbd7af7-0x0;var _0x151e9d=_0x33f3[_0xbd7af7];return _0x151e9d;};'use strict';var _=require('lodash');var util=require(_0x333f('0x0'));var logger=require(_0x333f('0x1'))('api');var moment=require(_0x333f('0x2'));var BPromise=require(_0x333f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x333f('0x4'));var rimraf=require(_0x333f('0x5'));var config=require(_0x333f('0x6'));var attributes=require(_0x333f('0x7'));module[_0x333f('0x8')]=function(_0x52ba27,_0x462f3f){return _0x52ba27[_0x333f('0x9')](_0x333f('0xa'),attributes,{'tableName':_0x333f('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 bad7b32..0c5466e 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x191323,_0x395e8c){var _0xa3d43f=function(_0x408d9f){while(--_0x408d9f){_0x191323['push'](_0x191323['shift']());}};_0xa3d43f(++_0x395e8c);}(_0xdb28,0x106));var _0x8db2=function(_0xe14ea0,_0xfb030e){_0xe14ea0=_0xe14ea0-0x0;var _0x365aa2=_0xdb28[_0xe14ea0];return _0x365aa2;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x2312dd,_0x4c5ccf){_0x2312dd=_0x2312dd-0x0;var _0x3df0c0=_0x7a54[_0x2312dd];return _0x3df0c0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 182e949..2dd244c 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 _0x8913=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','../../config/environment'];(function(_0x3f80a6,_0x3960a8){var _0x20ffcb=function(_0x331363){while(--_0x331363){_0x3f80a6['push'](_0x3f80a6['shift']());}};_0x20ffcb(++_0x3960a8);}(_0x8913,0xab));var _0x3891=function(_0x1280b8,_0x403c4f){_0x1280b8=_0x1280b8-0x0;var _0x54b802=_0x8913[_0x1280b8];return _0x54b802;};'use strict';var multer=require(_0x3891('0x0'));var util=require('util');var path=require(_0x3891('0x1'));var timeout=require(_0x3891('0x2'));var express=require(_0x3891('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3891('0x4'));var controller=require(_0x3891('0x5'));router[_0x3891('0x6')]('/',auth[_0x3891('0x7')](),controller[_0x3891('0x8')]);router['get'](_0x3891('0x9'),auth[_0x3891('0x7')](),controller[_0x3891('0xa')]);router[_0x3891('0xb')]('/',auth[_0x3891('0x7')](),controller['create']);router[_0x3891('0xc')](_0x3891('0x9'),auth[_0x3891('0x7')](),controller[_0x3891('0xd')]);router[_0x3891('0xe')](_0x3891('0x9'),auth[_0x3891('0x7')](),controller[_0x3891('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x66e4=['connect-timeout','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x66e4,0x76));var _0x466e=function(_0x5685f7,_0x53e368){_0x5685f7=_0x5685f7-0x0;var _0x446dab=_0x66e4[_0x5685f7];return _0x446dab;};'use strict';var multer=require(_0x466e('0x0'));var util=require(_0x466e('0x1'));var path=require('path');var timeout=require(_0x466e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x466e('0x3'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x466e('0x4')]('/',auth['isAuthenticated'](),controller[_0x466e('0x5')]);router[_0x466e('0x4')](_0x466e('0x6'),auth[_0x466e('0x7')](),controller[_0x466e('0x8')]);router[_0x466e('0x9')]('/',auth[_0x466e('0x7')](),controller[_0x466e('0xa')]);router[_0x466e('0xb')](_0x466e('0x6'),auth['isAuthenticated'](),controller[_0x466e('0xc')]);router[_0x466e('0xd')](_0x466e('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0x466e('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 73f6fce..ead80cd 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 _0x9009=['sequelize','STRING'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9009,0x1d4));var _0x9900=function(_0x5d0877,_0x4423e5){_0x5d0877=_0x5d0877-0x0;var _0x8413be=_0x9009[_0x5d0877];return _0x8413be;};'use strict';var Sequelize=require(_0x9900('0x0'));module['exports']={'name':{'type':Sequelize[_0x9900('0x1')]},'basename':{'type':Sequelize[_0x9900('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x48ea=['sequelize','STRING'];(function(_0x16d8fe,_0x5b9abd){var _0x1dac64=function(_0x33d7ef){while(--_0x33d7ef){_0x16d8fe['push'](_0x16d8fe['shift']());}};_0x1dac64(++_0x5b9abd);}(_0x48ea,0x9c));var _0xa48e=function(_0x108a1d,_0x2e0098){_0x108a1d=_0x108a1d-0x0;var _0x150a18=_0x48ea[_0x108a1d];return _0x150a18;};'use strict';var Sequelize=require(_0xa48e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa48e('0x1')]},'basename':{'type':Sequelize[_0xa48e('0x1')]},'type':{'type':Sequelize[_0xa48e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 9cc546f..d03f3fa 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 _0x7968=['mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','rows','catch','show','params','include','merge','find','clone','get','createdAt','body','updatedAt','create','originalname','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x2ea58d,_0x3bf0ee){var _0x538406=function(_0x3d0f06){while(--_0x3d0f06){_0x2ea58d['push'](_0x2ea58d['shift']());}};_0x538406(++_0x3bf0ee);}(_0x7968,0x1bd));var _0x8796=function(_0x1c6ac9,_0x1a4c6e){_0x1c6ac9=_0x1c6ac9-0x0;var _0x1286ce=_0x7968[_0x1c6ac9];return _0x1286ce;};'use strict';var emlformat=require(_0x8796('0x0'));var rimraf=require(_0x8796('0x1'));var zipdir=require(_0x8796('0x2'));var jsonpatch=require(_0x8796('0x3'));var rp=require('request-promise');var moment=require(_0x8796('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8796('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8796('0x6'));var ejs=require(_0x8796('0x7'));var fs=require('fs');var fs_extra=require(_0x8796('0x8'));var _=require(_0x8796('0x9'));var squel=require(_0x8796('0xa'));var crypto=require(_0x8796('0xb'));var jsforce=require(_0x8796('0xc'));var deskjs=require(_0x8796('0xd'));var toCsv=require(_0x8796('0x6'));var querystring=require(_0x8796('0xe'));var Papa=require(_0x8796('0xf'));var Redis=require('ioredis');var authService=require(_0x8796('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8796('0x11'));var hardwareService=require(_0x8796('0x12'));var logger=require(_0x8796('0x13'))(_0x8796('0x14'));var utils=require(_0x8796('0x15'));var config=require(_0x8796('0x16'));var licenseUtil=require(_0x8796('0x17'));var db=require(_0x8796('0x18'))['db'];function respondWithStatusCode(_0x18b5d9,_0x33ce42){_0x33ce42=_0x33ce42||0xcc;return function(_0x48c700){if(_0x48c700){return _0x18b5d9[_0x8796('0x19')](_0x33ce42);}return _0x18b5d9['status'](_0x33ce42)[_0x8796('0x1a')]();};}function respondWithResult(_0x417ade,_0x4bf70a){_0x4bf70a=_0x4bf70a||0xc8;return function(_0x4a8f24){if(_0x4a8f24){return _0x417ade[_0x8796('0x1b')](_0x4bf70a)['json'](_0x4a8f24);}};}function respondWithFilteredResult(_0x4ca2fe,_0x2fa708){return function(_0x1c595e){if(_0x1c595e){var _0x5037fc=typeof _0x2fa708[_0x8796('0x1c')]==='undefined'&&typeof _0x2fa708[_0x8796('0x1d')]===_0x8796('0x1e');var _0x3c53c7=_0x1c595e[_0x8796('0x1f')];var _0x39959d=_0x5037fc?0x0:_0x2fa708[_0x8796('0x1c')];var _0x414391=_0x5037fc?_0x1c595e['count']:_0x2fa708[_0x8796('0x1c')]+_0x2fa708[_0x8796('0x1d')];var _0x9aac38;if(_0x414391>=_0x3c53c7){_0x414391=_0x3c53c7;_0x9aac38=0xc8;}else{_0x9aac38=0xce;}_0x4ca2fe['status'](_0x9aac38);return _0x4ca2fe[_0x8796('0x20')](_0x8796('0x21'),_0x39959d+'-'+_0x414391+'/'+_0x3c53c7)[_0x8796('0x22')](_0x1c595e);}return null;};}function patchUpdates(_0x16c8a9){return function(_0xe43e91){try{jsonpatch['apply'](_0xe43e91,_0x16c8a9,!![]);}catch(_0x5ebefe){return BPromise['reject'](_0x5ebefe);}return _0xe43e91[_0x8796('0x23')]();};}function saveUpdates(_0x508243,_0x597823){return function(_0x2cf38a){if(_0x2cf38a){return _0x2cf38a[_0x8796('0x24')](_0x508243)[_0x8796('0x25')](function(_0x3b4e78){return _0x3b4e78;});}return null;};}function removeEntity(_0x5c5f1e,_0x500cb){return function(_0x3e667c){if(_0x3e667c){return _0x3e667c[_0x8796('0x26')]()[_0x8796('0x25')](function(){_0x5c5f1e[_0x8796('0x1b')](0xcc)[_0x8796('0x1a')]();});}};}function handleEntityNotFound(_0x30cfd5,_0x41250f){return function(_0x47e070){if(!_0x47e070){_0x30cfd5[_0x8796('0x19')](0x194);}return _0x47e070;};}function handleError(_0x36638f,_0x510941){_0x510941=_0x510941||0x1f4;return function(_0x3be189){logger[_0x8796('0x27')](_0x3be189[_0x8796('0x28')]);if(_0x3be189[_0x8796('0x29')]){delete _0x3be189[_0x8796('0x29')];}_0x36638f[_0x8796('0x1b')](_0x510941)[_0x8796('0x2a')](_0x3be189);};}exports[_0x8796('0x2b')]=function(_0xae3c72,_0x5ab9bc){var _0x3d0e47={},_0x53d8bc={},_0x417d7b={'count':0x0,'rows':[]};var _0x2b6d76=_[_0x8796('0x2c')](db[_0x8796('0x2d')]['rawAttributes'],function(_0x454c40){return{'name':_0x454c40[_0x8796('0x2e')],'type':_0x454c40['type']['key']};});_0x53d8bc['model']=_[_0x8796('0x2c')](_0x2b6d76,_0x8796('0x29'));_0x53d8bc[_0x8796('0x2f')]=_[_0x8796('0x30')](_0xae3c72[_0x8796('0x2f')]);_0x53d8bc[_0x8796('0x31')]=_[_0x8796('0x32')](_0x53d8bc[_0x8796('0x33')],_0x53d8bc['query']);_0x3d0e47[_0x8796('0x34')]=_['intersection'](_0x53d8bc[_0x8796('0x33')],qs[_0x8796('0x35')](_0xae3c72[_0x8796('0x2f')][_0x8796('0x35')]));_0x3d0e47[_0x8796('0x34')]=_0x3d0e47['attributes'][_0x8796('0x36')]?_0x3d0e47[_0x8796('0x34')]:_0x53d8bc['model'];if(!_0xae3c72[_0x8796('0x2f')][_0x8796('0x37')](_0x8796('0x38'))){_0x3d0e47[_0x8796('0x1d')]=qs[_0x8796('0x1d')](_0xae3c72[_0x8796('0x2f')][_0x8796('0x1d')]);_0x3d0e47['offset']=qs[_0x8796('0x1c')](_0xae3c72['query']['offset']);}_0x3d0e47['order']=qs['sort'](_0xae3c72[_0x8796('0x2f')][_0x8796('0x39')]);_0x3d0e47[_0x8796('0x3a')]=qs[_0x8796('0x31')](_[_0x8796('0x3b')](_0xae3c72['query'],_0x53d8bc['filters']),_0x2b6d76);if(_0xae3c72['query'][_0x8796('0x3c')]){_0x3d0e47[_0x8796('0x3a')]=_['merge'](_0x3d0e47['where'],{'$or':_[_0x8796('0x2c')](_0x2b6d76,function(_0x210c5f){if(_0x210c5f[_0x8796('0x3d')]!==_0x8796('0x3e')){var _0x4ecbe9={};_0x4ecbe9[_0x210c5f[_0x8796('0x29')]]={'$like':'%'+_0xae3c72[_0x8796('0x2f')][_0x8796('0x3c')]+'%'};return _0x4ecbe9;}})});}_0x3d0e47=_['merge']({},_0x3d0e47,_0xae3c72[_0x8796('0x3f')]);var _0x27fc10={'where':_0x3d0e47[_0x8796('0x3a')]};return db['Attachment']['count'](_0x27fc10)['then'](function(_0x16b586){_0x417d7b['count']=_0x16b586;if(_0xae3c72[_0x8796('0x2f')][_0x8796('0x40')]){_0x3d0e47['include']=[{'all':!![]}];}return db[_0x8796('0x2d')]['findAll'](_0x3d0e47);})['then'](function(_0x4a832f){_0x417d7b[_0x8796('0x41')]=_0x4a832f;return _0x417d7b;})[_0x8796('0x25')](respondWithFilteredResult(_0x5ab9bc,_0x3d0e47))[_0x8796('0x42')](handleError(_0x5ab9bc,null));};exports[_0x8796('0x43')]=function(_0xfcad66,_0x836ac3){var _0x1c433c={'raw':!![],'where':{'id':_0xfcad66[_0x8796('0x44')]['id']}},_0x2bfb58={};_0x2bfb58['model']=_[_0x8796('0x30')](db[_0x8796('0x2d')]['rawAttributes']);_0x2bfb58[_0x8796('0x2f')]=_[_0x8796('0x30')](_0xfcad66[_0x8796('0x2f')]);_0x2bfb58[_0x8796('0x31')]=_[_0x8796('0x32')](_0x2bfb58[_0x8796('0x33')],_0x2bfb58[_0x8796('0x2f')]);_0x1c433c[_0x8796('0x34')]=_[_0x8796('0x32')](_0x2bfb58['model'],qs[_0x8796('0x35')](_0xfcad66[_0x8796('0x2f')][_0x8796('0x35')]));_0x1c433c['attributes']=_0x1c433c['attributes']['length']?_0x1c433c[_0x8796('0x34')]:_0x2bfb58[_0x8796('0x33')];if(_0xfcad66[_0x8796('0x2f')][_0x8796('0x40')]){_0x1c433c[_0x8796('0x45')]=[{'all':!![]}];}_0x1c433c=_[_0x8796('0x46')]({},_0x1c433c,_0xfcad66[_0x8796('0x3f')]);return db[_0x8796('0x2d')][_0x8796('0x47')](_0x1c433c)[_0x8796('0x25')](handleEntityNotFound(_0x836ac3,null))[_0x8796('0x25')](respondWithResult(_0x836ac3,null))[_0x8796('0x42')](handleError(_0x836ac3,null));};exports[_0x8796('0x48')]=function(_0x45af25,_0x4b5955){var _0x323452={'where':{'id':_0x45af25[_0x8796('0x44')]['id']}},_0x166e73={};_0x166e73[_0x8796('0x33')]=_['keys'](db[_0x8796('0x2d')]['rawAttributes']);_0x323452['attributes']=_[_0x8796('0x32')](_0x166e73[_0x8796('0x33')],qs['fields'](_0x45af25[_0x8796('0x2f')][_0x8796('0x35')]));_0x323452[_0x8796('0x34')]=_0x323452[_0x8796('0x34')][_0x8796('0x36')]?_0x323452[_0x8796('0x34')]:_0x166e73['model'];if(_0x45af25[_0x8796('0x2f')][_0x8796('0x40')]){_0x323452['include']=[{'all':!![]}];}_0x323452=_[_0x8796('0x46')]({},_0x323452,_0x45af25['options']);return db[_0x8796('0x2d')][_0x8796('0x47')](_0x323452)[_0x8796('0x25')](handleEntityNotFound(_0x4b5955,null))['then'](function(_0x20c448){if(_0x20c448){var _0xa0a53a=_0x20c448[_0x8796('0x49')]({'plain':!![]});_0xa0a53a=qs['omit'](_0xa0a53a,['id',_0x8796('0x4a'),'updatedAt']);_0x45af25[_0x8796('0x4b')]=_['omit'](_0x45af25[_0x8796('0x4b')],['id','createdAt',_0x8796('0x4c')]);return db['Attachment'][_0x8796('0x4d')](_[_0x8796('0x46')](_0xa0a53a,_0x45af25['body']),{'include':_0x45af25['query'][_0x8796('0x40')]?[{'all':!![]}]:undefined});}})[_0x8796('0x25')](respondWithResult(_0x4b5955,0xc9))[_0x8796('0x42')](handleError(_0x4b5955,null));};exports[_0x8796('0x24')]=function(_0x3b35c9,_0x1c5fe9){if(_0x3b35c9[_0x8796('0x4b')]['id']){delete _0x3b35c9[_0x8796('0x4b')]['id'];}return db[_0x8796('0x2d')]['find']({'where':{'id':_0x3b35c9['params']['id']}})[_0x8796('0x25')](handleEntityNotFound(_0x1c5fe9,null))[_0x8796('0x25')](saveUpdates(_0x3b35c9['body'],null))[_0x8796('0x25')](respondWithResult(_0x1c5fe9,null))[_0x8796('0x42')](handleError(_0x1c5fe9,null));};exports[_0x8796('0x26')]=function(_0x32fd76,_0xcbae6a){return db[_0x8796('0x2d')][_0x8796('0x47')]({'where':{'id':_0x32fd76[_0x8796('0x44')]['id']}})[_0x8796('0x25')](handleEntityNotFound(_0xcbae6a,null))[_0x8796('0x25')](removeEntity(_0xcbae6a,null))[_0x8796('0x42')](handleError(_0xcbae6a,null));};exports['create']=function(_0x28c690,_0x4e2507,_0x319bdc){_0x28c690[_0x8796('0x4b')][_0x8796('0x29')]=_0x28c690['file'][_0x8796('0x4e')];_0x28c690[_0x8796('0x4b')]['basename']=_0x28c690[_0x8796('0x4f')][_0x8796('0x50')];_0x28c690[_0x8796('0x4b')]['type']=_0x28c690[_0x8796('0x4f')][_0x8796('0x51')];return db[_0x8796('0x2d')][_0x8796('0x4d')](_0x28c690[_0x8796('0x4b')])['then'](respondWithResult(_0x4e2507,0xc9))[_0x8796('0x42')](handleError(_0x4e2507,null));};exports[_0x8796('0x52')]=function(_0x452825,_0x3a0946,_0x406765){return db[_0x8796('0x2d')][_0x8796('0x53')]({'where':{'id':_0x452825[_0x8796('0x44')]['id']},'raw':!![]})[_0x8796('0x25')](handleEntityNotFound(_0x3a0946,null))[_0x8796('0x25')](function(_0x52cf8a){if(_0x52cf8a){var _0x7e17de=_0x52cf8a[_0x8796('0x54')]!==null;var _0x58690d=path[_0x8796('0x55')](config[_0x8796('0x56')],_0x8796('0x57'));if(_0x7e17de){_0x58690d=path[_0x8796('0x55')](_0x58690d,_0x8796('0x58'));}var _0x2ed0b1=path[_0x8796('0x55')](_0x58690d,_0x52cf8a[_0x8796('0x59')]);return _0x3a0946[_0x8796('0x52')](_0x2ed0b1);}})[_0x8796('0x42')](handleError(_0x3a0946,null));};
\ No newline at end of file
+var _0x1141=['order','sort','filter','merge','where','map','VIRTUAL','options','include','findAll','catch','show','includeAll','find','clone','params','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','sendStatus','json','limit','undefined','offset','count','set','apply','reject','save','update','then','destroy','error','name','status','index','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x1141,0xcc));var _0x1114=function(_0x382ca6,_0x1aaf79){_0x382ca6=_0x382ca6-0x0;var _0x295a6c=_0x1141[_0x382ca6];return _0x295a6c;};'use strict';var emlformat=require(_0x1114('0x0'));var rimraf=require(_0x1114('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1114('0x2'));var rp=require(_0x1114('0x3'));var moment=require(_0x1114('0x4'));var BPromise=require(_0x1114('0x5'));var Mustache=require(_0x1114('0x6'));var util=require(_0x1114('0x7'));var path=require('path');var sox=require(_0x1114('0x8'));var csv=require(_0x1114('0x9'));var ejs=require(_0x1114('0xa'));var fs=require('fs');var fs_extra=require(_0x1114('0xb'));var _=require('lodash');var squel=require(_0x1114('0xc'));var crypto=require('crypto');var jsforce=require(_0x1114('0xd'));var deskjs=require(_0x1114('0xe'));var toCsv=require(_0x1114('0x9'));var querystring=require(_0x1114('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1114('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1114('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x1114('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1114('0x13'))['db'];function respondWithStatusCode(_0x32bdd5,_0x1d1914){_0x1d1914=_0x1d1914||0xcc;return function(_0x52fae6){if(_0x52fae6){return _0x32bdd5[_0x1114('0x14')](_0x1d1914);}return _0x32bdd5['status'](_0x1d1914)['end']();};}function respondWithResult(_0xb6209a,_0x38d888){_0x38d888=_0x38d888||0xc8;return function(_0x3feb53){if(_0x3feb53){return _0xb6209a['status'](_0x38d888)[_0x1114('0x15')](_0x3feb53);}};}function respondWithFilteredResult(_0x4cfdb4,_0x546c44){return function(_0x5e790f){if(_0x5e790f){var _0x4f0769=typeof _0x546c44['offset']==='undefined'&&typeof _0x546c44[_0x1114('0x16')]===_0x1114('0x17');var _0x43d582=_0x5e790f['count'];var _0x54db49=_0x4f0769?0x0:_0x546c44[_0x1114('0x18')];var _0x35979d=_0x4f0769?_0x5e790f[_0x1114('0x19')]:_0x546c44[_0x1114('0x18')]+_0x546c44[_0x1114('0x16')];var _0x244e5f;if(_0x35979d>=_0x43d582){_0x35979d=_0x43d582;_0x244e5f=0xc8;}else{_0x244e5f=0xce;}_0x4cfdb4['status'](_0x244e5f);return _0x4cfdb4[_0x1114('0x1a')]('Content-Range',_0x54db49+'-'+_0x35979d+'/'+_0x43d582)[_0x1114('0x15')](_0x5e790f);}return null;};}function patchUpdates(_0x480104){return function(_0x312d55){try{jsonpatch[_0x1114('0x1b')](_0x312d55,_0x480104,!![]);}catch(_0x441e97){return BPromise[_0x1114('0x1c')](_0x441e97);}return _0x312d55[_0x1114('0x1d')]();};}function saveUpdates(_0x13722f,_0x20125b){return function(_0x444e69){if(_0x444e69){return _0x444e69[_0x1114('0x1e')](_0x13722f)[_0x1114('0x1f')](function(_0x31a96d){return _0x31a96d;});}return null;};}function removeEntity(_0x3fa872,_0x3513fd){return function(_0x2227b9){if(_0x2227b9){return _0x2227b9[_0x1114('0x20')]()[_0x1114('0x1f')](function(){_0x3fa872['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9e1bc9,_0x151bc9){return function(_0x418252){if(!_0x418252){_0x9e1bc9['sendStatus'](0x194);}return _0x418252;};}function handleError(_0x3a4efc,_0x35b45a){_0x35b45a=_0x35b45a||0x1f4;return function(_0xfeaaa3){logger[_0x1114('0x21')](_0xfeaaa3['stack']);if(_0xfeaaa3[_0x1114('0x22')]){delete _0xfeaaa3['name'];}_0x3a4efc[_0x1114('0x23')](_0x35b45a)['send'](_0xfeaaa3);};}exports[_0x1114('0x24')]=function(_0x1eb397,_0x2d4220){var _0x5b0068={},_0x3d2275={},_0x1fb843={'count':0x0,'rows':[]};var _0x93444e=_['map'](db[_0x1114('0x25')][_0x1114('0x26')],function(_0x57f56a){return{'name':_0x57f56a[_0x1114('0x27')],'type':_0x57f56a[_0x1114('0x28')][_0x1114('0x29')]};});_0x3d2275[_0x1114('0x2a')]=_['map'](_0x93444e,'name');_0x3d2275[_0x1114('0x2b')]=_[_0x1114('0x2c')](_0x1eb397[_0x1114('0x2b')]);_0x3d2275[_0x1114('0x2d')]=_[_0x1114('0x2e')](_0x3d2275[_0x1114('0x2a')],_0x3d2275[_0x1114('0x2b')]);_0x5b0068[_0x1114('0x2f')]=_[_0x1114('0x2e')](_0x3d2275[_0x1114('0x2a')],qs[_0x1114('0x30')](_0x1eb397[_0x1114('0x2b')][_0x1114('0x30')]));_0x5b0068[_0x1114('0x2f')]=_0x5b0068['attributes'][_0x1114('0x31')]?_0x5b0068[_0x1114('0x2f')]:_0x3d2275['model'];if(!_0x1eb397['query']['hasOwnProperty'](_0x1114('0x32'))){_0x5b0068[_0x1114('0x16')]=qs[_0x1114('0x16')](_0x1eb397['query'][_0x1114('0x16')]);_0x5b0068[_0x1114('0x18')]=qs[_0x1114('0x18')](_0x1eb397['query'][_0x1114('0x18')]);}_0x5b0068[_0x1114('0x33')]=qs[_0x1114('0x34')](_0x1eb397[_0x1114('0x2b')][_0x1114('0x34')]);_0x5b0068['where']=qs[_0x1114('0x2d')](_['pick'](_0x1eb397[_0x1114('0x2b')],_0x3d2275[_0x1114('0x2d')]),_0x93444e);if(_0x1eb397[_0x1114('0x2b')][_0x1114('0x35')]){_0x5b0068['where']=_[_0x1114('0x36')](_0x5b0068[_0x1114('0x37')],{'$or':_[_0x1114('0x38')](_0x93444e,function(_0x252792){if(_0x252792[_0x1114('0x28')]!==_0x1114('0x39')){var _0x2e1086={};_0x2e1086[_0x252792[_0x1114('0x22')]]={'$like':'%'+_0x1eb397['query'][_0x1114('0x35')]+'%'};return _0x2e1086;}})});}_0x5b0068=_[_0x1114('0x36')]({},_0x5b0068,_0x1eb397[_0x1114('0x3a')]);var _0x49b295={'where':_0x5b0068[_0x1114('0x37')]};return db[_0x1114('0x25')]['count'](_0x49b295)['then'](function(_0x536ac7){_0x1fb843[_0x1114('0x19')]=_0x536ac7;if(_0x1eb397[_0x1114('0x2b')]['includeAll']){_0x5b0068[_0x1114('0x3b')]=[{'all':!![]}];}return db[_0x1114('0x25')][_0x1114('0x3c')](_0x5b0068);})['then'](function(_0x378d2a){_0x1fb843['rows']=_0x378d2a;return _0x1fb843;})[_0x1114('0x1f')](respondWithFilteredResult(_0x2d4220,_0x5b0068))[_0x1114('0x3d')](handleError(_0x2d4220,null));};exports[_0x1114('0x3e')]=function(_0x29d817,_0x21d885){var _0x447f78={'raw':!![],'where':{'id':_0x29d817['params']['id']}},_0x2232b1={};_0x2232b1['model']=_[_0x1114('0x2c')](db[_0x1114('0x25')][_0x1114('0x26')]);_0x2232b1[_0x1114('0x2b')]=_[_0x1114('0x2c')](_0x29d817[_0x1114('0x2b')]);_0x2232b1[_0x1114('0x2d')]=_['intersection'](_0x2232b1[_0x1114('0x2a')],_0x2232b1[_0x1114('0x2b')]);_0x447f78['attributes']=_[_0x1114('0x2e')](_0x2232b1[_0x1114('0x2a')],qs[_0x1114('0x30')](_0x29d817[_0x1114('0x2b')][_0x1114('0x30')]));_0x447f78[_0x1114('0x2f')]=_0x447f78[_0x1114('0x2f')][_0x1114('0x31')]?_0x447f78[_0x1114('0x2f')]:_0x2232b1['model'];if(_0x29d817[_0x1114('0x2b')][_0x1114('0x3f')]){_0x447f78[_0x1114('0x3b')]=[{'all':!![]}];}_0x447f78=_[_0x1114('0x36')]({},_0x447f78,_0x29d817[_0x1114('0x3a')]);return db[_0x1114('0x25')][_0x1114('0x40')](_0x447f78)[_0x1114('0x1f')](handleEntityNotFound(_0x21d885,null))[_0x1114('0x1f')](respondWithResult(_0x21d885,null))[_0x1114('0x3d')](handleError(_0x21d885,null));};exports[_0x1114('0x41')]=function(_0x5f315c,_0x464204){var _0x21bb72={'where':{'id':_0x5f315c[_0x1114('0x42')]['id']}},_0x5b9ddf={};_0x5b9ddf[_0x1114('0x2a')]=_['keys'](db[_0x1114('0x25')][_0x1114('0x26')]);_0x21bb72[_0x1114('0x2f')]=_[_0x1114('0x2e')](_0x5b9ddf[_0x1114('0x2a')],qs[_0x1114('0x30')](_0x5f315c['query'][_0x1114('0x30')]));_0x21bb72[_0x1114('0x2f')]=_0x21bb72[_0x1114('0x2f')]['length']?_0x21bb72[_0x1114('0x2f')]:_0x5b9ddf['model'];if(_0x5f315c['query'][_0x1114('0x3f')]){_0x21bb72[_0x1114('0x3b')]=[{'all':!![]}];}_0x21bb72=_[_0x1114('0x36')]({},_0x21bb72,_0x5f315c['options']);return db[_0x1114('0x25')][_0x1114('0x40')](_0x21bb72)[_0x1114('0x1f')](handleEntityNotFound(_0x464204,null))[_0x1114('0x1f')](function(_0x165ecf){if(_0x165ecf){var _0x241850=_0x165ecf[_0x1114('0x43')]({'plain':!![]});_0x241850=qs[_0x1114('0x44')](_0x241850,['id',_0x1114('0x45'),_0x1114('0x46')]);_0x5f315c[_0x1114('0x47')]=_[_0x1114('0x44')](_0x5f315c[_0x1114('0x47')],['id',_0x1114('0x45'),_0x1114('0x46')]);return db[_0x1114('0x25')][_0x1114('0x48')](_['merge'](_0x241850,_0x5f315c[_0x1114('0x47')]),{'include':_0x5f315c[_0x1114('0x2b')][_0x1114('0x3f')]?[{'all':!![]}]:undefined});}})[_0x1114('0x1f')](respondWithResult(_0x464204,0xc9))[_0x1114('0x3d')](handleError(_0x464204,null));};exports[_0x1114('0x1e')]=function(_0x46bae5,_0x2bd0cb){if(_0x46bae5[_0x1114('0x47')]['id']){delete _0x46bae5[_0x1114('0x47')]['id'];}return db[_0x1114('0x25')]['find']({'where':{'id':_0x46bae5['params']['id']}})[_0x1114('0x1f')](handleEntityNotFound(_0x2bd0cb,null))[_0x1114('0x1f')](saveUpdates(_0x46bae5['body'],null))[_0x1114('0x1f')](respondWithResult(_0x2bd0cb,null))[_0x1114('0x3d')](handleError(_0x2bd0cb,null));};exports['destroy']=function(_0x3ddb11,_0x2b7e03){return db[_0x1114('0x25')][_0x1114('0x40')]({'where':{'id':_0x3ddb11[_0x1114('0x42')]['id']}})[_0x1114('0x1f')](handleEntityNotFound(_0x2b7e03,null))[_0x1114('0x1f')](removeEntity(_0x2b7e03,null))[_0x1114('0x3d')](handleError(_0x2b7e03,null));};exports['create']=function(_0x211950,_0x584692,_0x148430){_0x211950[_0x1114('0x47')]['name']=_0x211950['file'][_0x1114('0x49')];_0x211950['body'][_0x1114('0x4a')]=_0x211950[_0x1114('0x4b')][_0x1114('0x4c')];_0x211950[_0x1114('0x47')][_0x1114('0x28')]=_0x211950[_0x1114('0x4b')][_0x1114('0x4d')];return db[_0x1114('0x25')][_0x1114('0x48')](_0x211950[_0x1114('0x47')])[_0x1114('0x1f')](respondWithResult(_0x584692,0xc9))[_0x1114('0x3d')](handleError(_0x584692,null));};exports[_0x1114('0x4e')]=function(_0x546b6f,_0x2afff4,_0x32f9a7){return db[_0x1114('0x25')][_0x1114('0x4f')]({'where':{'id':_0x546b6f[_0x1114('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2afff4,null))[_0x1114('0x1f')](function(_0x3e6555){if(_0x3e6555){var _0x4d02d5=_0x3e6555[_0x1114('0x50')]!==null;var _0x5b892a=path['join'](config[_0x1114('0x51')],_0x1114('0x52'));if(_0x4d02d5){_0x5b892a=path['join'](_0x5b892a,_0x1114('0x53'));}var _0x2ea27b=path[_0x1114('0x54')](_0x5b892a,_0x3e6555['basename']);return _0x2afff4['download'](_0x2ea27b);}})[_0x1114('0x3d')](handleError(_0x2afff4,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 05fb964..e080d58 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 _0x1f66=['./attachment.attributes','exports','Attachment','lodash','util','bluebird','rimraf','../../config/environment'];(function(_0x2e2aa7,_0x29adde){var _0x4c4445=function(_0x124d5b){while(--_0x124d5b){_0x2e2aa7['push'](_0x2e2aa7['shift']());}};_0x4c4445(++_0x29adde);}(_0x1f66,0xeb));var _0x61f6=function(_0x1bbd1f,_0x3ddc56){_0x1bbd1f=_0x1bbd1f-0x0;var _0x5c88b0=_0x1f66[_0x1bbd1f];return _0x5c88b0;};'use strict';var _=require(_0x61f6('0x0'));var util=require(_0x61f6('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x61f6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x61f6('0x3'));var config=require(_0x61f6('0x4'));var attributes=require(_0x61f6('0x5'));module[_0x61f6('0x6')]=function(_0x4709c0,_0x10eca7){return _0x4709c0['define'](_0x61f6('0x7'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fcc=['bluebird','request-promise','path','rimraf','../../config/environment','define','Attachment','attachments','lodash','api'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x0fcc,0x9e));var _0xc0fc=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0x0fcc[_0x1afabf];return _0x497ff1;};'use strict';var _=require(_0xc0fc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc0fc('0x1'));var moment=require('moment');var BPromise=require(_0xc0fc('0x2'));var rp=require(_0xc0fc('0x3'));var fs=require('fs');var path=require(_0xc0fc('0x4'));var rimraf=require(_0xc0fc('0x5'));var config=require(_0xc0fc('0x6'));var attributes=require('./attachment.attributes');module['exports']=function(_0x250d67,_0x5189ec){return _0x250d67[_0xc0fc('0x7')](_0xc0fc('0x8'),attributes,{'tableName':_0xc0fc('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 9432525..e0238fc 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 _0x8b29=['bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateAttachment','create','body','options','lodash','moment'];(function(_0x4102f9,_0x47ff76){var _0x2d3ebc=function(_0x2ede38){while(--_0x2ede38){_0x4102f9['push'](_0x4102f9['shift']());}};_0x2d3ebc(++_0x47ff76);}(_0x8b29,0xbe));var _0x98b2=function(_0xa0cbbd,_0x49e591){_0xa0cbbd=_0xa0cbbd-0x0;var _0x21d204=_0x8b29[_0xa0cbbd];return _0x21d204;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var moment=require(_0x98b2('0x1'));var BPromise=require(_0x98b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98b2('0x3'))['db'];var utils=require(_0x98b2('0x4'));var logger=require('../../config/logger')(_0x98b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x98b2('0x6'));var client=jayson[_0x98b2('0x7')][_0x98b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ef5,_0x221cee,_0x2cd0cb){return new BPromise(function(_0x417ca6,_0x388827){return client[_0x98b2('0x9')](_0x3e7ef5,_0x2cd0cb)[_0x98b2('0xa')](function(_0x501b51){logger['info'](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));logger[_0x98b2('0xd')](_0x98b2('0xe'),_0x221cee,_0x98b2('0xc'),JSON[_0x98b2('0xf')](_0x501b51));if(_0x501b51['error']){if(_0x501b51[_0x98b2('0x10')][_0x98b2('0x11')]===0x1f4){logger['error'](_0x98b2('0xb'),_0x221cee,_0x501b51[_0x98b2('0x10')][_0x98b2('0x12')]);return _0x388827(_0x501b51['error']['message']);}logger[_0x98b2('0x10')]('Attachment,\x20%s,\x20%s',_0x221cee,_0x501b51[_0x98b2('0x10')]['message']);return _0x417ca6(_0x501b51['error']['message']);}else{logger[_0x98b2('0x13')](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));_0x417ca6(_0x501b51['result']['message']);}})['catch'](function(_0x389d22){logger[_0x98b2('0x10')](_0x98b2('0xb'),_0x221cee,_0x389d22);_0x388827(_0x389d22);});});}exports[_0x98b2('0x14')]=function(_0x4b9f2c){var _0x1cd8c6=this;return new Promise(function(_0x588837,_0x989082){return db['Attachment'][_0x98b2('0x15')](_0x4b9f2c[_0x98b2('0x16')],{'raw':_0x4b9f2c[_0x98b2('0x17')]?_0x4b9f2c[_0x98b2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x98b2('0xa')](function(_0x242cbd){logger['info']('CreateAttachment',_0x4b9f2c);logger[_0x98b2('0xd')](_0x98b2('0x14'),_0x4b9f2c,JSON['stringify'](_0x242cbd));_0x588837(_0x242cbd);})['catch'](function(_0x3796c0){logger[_0x98b2('0x10')]('CreateAttachment',_0x3796c0[_0x98b2('0x12')],_0x4b9f2c);_0x989082(_0x1cd8c6[_0x98b2('0x10')](0x1f4,_0x3796c0[_0x98b2('0x12')]));});});};
\ No newline at end of file
+var _0x2333=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateAttachment','options','raw','stringify','lodash','util','randomstring','ioredis'];(function(_0x167e46,_0x5d0cb2){var _0x544e7b=function(_0x261b0e){while(--_0x261b0e){_0x167e46['push'](_0x167e46['shift']());}};_0x544e7b(++_0x5d0cb2);}(_0x2333,0x11a));var _0x3233=function(_0x1f1061,_0xbe6428){_0x1f1061=_0x1f1061-0x0;var _0x4a94f4=_0x2333[_0x1f1061];return _0x4a94f4;};'use strict';var _=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3233('0x2'));var fs=require('fs');var Redis=require(_0x3233('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3233('0x4'));var logger=require(_0x3233('0x5'))(_0x3233('0x6'));var config=require(_0x3233('0x7'));var jayson=require(_0x3233('0x8'));var client=jayson[_0x3233('0x9')][_0x3233('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33a56d,_0x1e93e8,_0x1842a1){return new BPromise(function(_0x1837b6,_0x2ee6df){return client[_0x3233('0xb')](_0x33a56d,_0x1842a1)[_0x3233('0xc')](function(_0x7ff4bd){logger[_0x3233('0xd')](_0x3233('0xe'),_0x1e93e8,_0x3233('0xf'));logger[_0x3233('0x10')](_0x3233('0x11'),_0x1e93e8,_0x3233('0xf'),JSON['stringify'](_0x7ff4bd));if(_0x7ff4bd[_0x3233('0x12')]){if(_0x7ff4bd[_0x3233('0x12')][_0x3233('0x13')]===0x1f4){logger[_0x3233('0x12')](_0x3233('0xe'),_0x1e93e8,_0x7ff4bd[_0x3233('0x12')][_0x3233('0x14')]);return _0x2ee6df(_0x7ff4bd[_0x3233('0x12')][_0x3233('0x14')]);}logger[_0x3233('0x12')](_0x3233('0xe'),_0x1e93e8,_0x7ff4bd[_0x3233('0x12')][_0x3233('0x14')]);return _0x1837b6(_0x7ff4bd['error']['message']);}else{logger[_0x3233('0xd')](_0x3233('0xe'),_0x1e93e8,_0x3233('0xf'));_0x1837b6(_0x7ff4bd['result'][_0x3233('0x14')]);}})[_0x3233('0x15')](function(_0x127227){logger['error'](_0x3233('0xe'),_0x1e93e8,_0x127227);_0x2ee6df(_0x127227);});});}exports[_0x3233('0x16')]=function(_0x55fa30){var _0x38a9c0=this;return new Promise(function(_0x58420c,_0x233141){return db['Attachment']['create'](_0x55fa30['body'],{'raw':_0x55fa30[_0x3233('0x17')]?_0x55fa30['options'][_0x3233('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x305227){logger[_0x3233('0xd')](_0x3233('0x16'),_0x55fa30);logger[_0x3233('0x10')]('CreateAttachment',_0x55fa30,JSON[_0x3233('0x19')](_0x305227));_0x58420c(_0x305227);})[_0x3233('0x15')](function(_0x56fa5a){logger['error'](_0x3233('0x16'),_0x56fa5a['message'],_0x55fa30);_0x233141(_0x38a9c0[_0x3233('0x12')](0x1f4,_0x56fa5a[_0x3233('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 4b3f771..ea746a5 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x472ffa,_0x22e185){var _0x2bfefd=function(_0x5a95b3){while(--_0x5a95b3){_0x472ffa['push'](_0x472ffa['shift']());}};_0x2bfefd(++_0x22e185);}(_0x5f2f,0x73));var _0xf5f2=function(_0x19e013,_0x5c74e0){_0x19e013=_0x19e013-0x0;var _0x58c128=_0x5f2f[_0x19e013];return _0x58c128;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x142fcd,_0x4e41ff){_0x142fcd=_0x142fcd-0x0;var _0x1d4c77=_0xdb28[_0x142fcd];return _0x1d4c77;};'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 4ec1d0d..4b6af5c 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 _0x40a3=['role','blockedAt','online','admin','user','agent','name','blockDuration','blocked','minutes','getLicense','catch','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x40a3,0x1c3));var _0x340a=function(_0x302e77,_0x3bc416){_0x302e77=_0x302e77-0x0;var _0x490f3d=_0x40a3[_0x302e77];return _0x490f3d;};'use strict';var passport=require(_0x340a('0x0'));var LocalStrategy=require(_0x340a('0x1'))[_0x340a('0x2')];var moment=require(_0x340a('0x3'));var ActiveDirectory=require(_0x340a('0x4'));var BPromise=require('bluebird');var util=require(_0x340a('0x5'));var db=require(_0x340a('0x6'))['db'];var authService=require(_0x340a('0x7'));var utils=require(_0x340a('0x8'));var config=require(_0x340a('0x9'));var logger=require(_0x340a('0xa'))(_0x340a('0xb'));function isActiveDirectoryConfigured(_0x33e52b){var _0xd4559f=![];if(typeof _0x33e52b[_0x340a('0xc')]!==_0x340a('0xd')){_0xd4559f=_0x33e52b[_0x340a('0xc')][_0x340a('0xe')]&&_0x33e52b['activedirectory']['url']&&_0x33e52b[_0x340a('0xc')][_0x340a('0xf')];}return _0xd4559f;}function adAuthenticate(_0x245459,_0x80c108,_0x158db8){return new BPromise(function(_0x19c616,_0x27e260){try{var _0x16a530=new ActiveDirectory(_0x245459);_0x16a530[_0x340a('0x10')](_0x80c108,_0x158db8,function(_0x4c7cfa,_0x41586b){if(_0x4c7cfa){logger[_0x340a('0x11')](_0x340a('0x12'),_0x80c108,util[_0x340a('0x13')](_0x4c7cfa,{'showHidden':![],'depth':null}));_0x27e260('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x41586b){logger[_0x340a('0x11')](_0x340a('0x14'),_0x80c108);_0x27e260(_0x340a('0x15'));}else{_0x19c616(_0x41586b);}});}catch(_0x12dd29){_0x27e260(_0x12dd29);}});}function ActiveDirectoryAuthenticate(_0x180789,_0x12070b,_0x3aaf46,_0x529397){var _0x36c2d7,_0x4b145f;if(!isActiveDirectoryConfigured(config)){logger[_0x340a('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x12070b);return _0x529397(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x340a('0x16')][_0x340a('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0x340a('0x18')](function(_0x46c98f){_0x36c2d7=_0x46c98f;if(!_0x36c2d7[_0x340a('0x19')]){logger[_0x340a('0x11')](_0x340a('0x1a'),_0x12070b);throw new Error(_0x340a('0x15'));}return _0x180789[_0x340a('0x17')]({'attributes':['id','name',_0x340a('0x1b'),_0x340a('0x1c'),_0x340a('0x1d'),'disabled','blocked',_0x340a('0x1e'),_0x340a('0x1f')],'where':{'name':_0x12070b,'role':{'$or':[_0x340a('0x20'),_0x340a('0x21'),_0x340a('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0xe7c338){if(!_0xe7c338||_0xe7c338&&_0xe7c338[_0x340a('0x23')]!==_0x12070b){throw new Error(_0x340a('0x15'));}_0x4b145f=_0xe7c338;var _0x4418bf=_0x4b145f[_0x340a('0x23')]+'@'+config[_0x340a('0xc')]['domain'];return adAuthenticate(config[_0x340a('0xc')],_0x4418bf,_0x3aaf46);})[_0x340a('0x18')](function(_0x459a99){if(_0x4b145f['disabled']){throw new Error(_0x340a('0x15'));}if(_0x36c2d7[_0x340a('0x24')]>0x0){if(_0x4b145f[_0x340a('0x25')]){if(moment(_0x4b145f[_0x340a('0x1e')])['add'](_0x36c2d7['blockDuration'],_0x340a('0x26'))>moment()){throw new Error(_0x340a('0x15'));}return utils['clearBlockUser'](_0x4b145f,0x0,![],null)['then'](function(){return utils[_0x340a('0x27')](_0x4b145f);})[_0x340a('0x18')](function(){return _0x529397(null,_0x4b145f);});}else{return utils[_0x340a('0x27')](_0x4b145f)['then'](function(){return _0x529397(null,_0x4b145f);});}}else{return utils[_0x340a('0x27')](_0x4b145f)[_0x340a('0x18')](function(){return _0x529397(null,_0x4b145f);});}})[_0x340a('0x28')](function(_0x596299){return _0x529397(null,![],_0x596299);});}function handleError(_0x2c5d7d,_0x952a95,_0x26ed27){return _0x2c5d7d['status'](_0x952a95||0x1f4)['send']({'message':_0x26ed27?_0x26ed27[_0x340a('0x29')]||_0x26ed27:''});}exports[_0x340a('0x2a')]=function(_0x4f474c,_0x231e00,_0x446b98){passport[_0x340a('0x10')](_0x340a('0x2b'),function(_0xd54679,_0x4e3bc6,_0x351e8a){var _0x2f1ce4=_0xd54679||_0x351e8a;if(_0x2f1ce4){return handleError(_0x231e00,0x191,_0x2f1ce4);}if(!_0x4e3bc6){return handleError(_0x231e00,0x194,{'message':_0x340a('0x2c')});}else{var _0x1c0916={'payload':{'id':_0x4e3bc6['id'],'role':_0x4e3bc6[_0x340a('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x340a('0x2d')](_0x1c0916)[_0x340a('0x18')](function(_0x5c9adf){_0x231e00[_0x340a('0x2e')]({'id':_0x4e3bc6['id'],'token':_0x5c9adf,'statusCall':'','isAlreadyLogged':_0x4e3bc6[_0x340a('0x1f')]});});}})(_0x4f474c,_0x231e00,_0x446b98);};passport['use'](_0x340a('0x2b'),new LocalStrategy({'usernameField':_0x340a('0x23'),'passwordField':_0x340a('0x1b')},function(_0x397831,_0x1cdee6,_0x4b7c19){return ActiveDirectoryAuthenticate(db[_0x340a('0x2f')],_0x397831,_0x1cdee6,_0x4b7c19);}));
\ No newline at end of file
+var _0xc5b0=['add','clearBlockUser','getLicense','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','password','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','name','salt','role','disabled','blocked','blockedAt','admin','user','agent','blockDuration'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc5b0,0x173));var _0x0c5b=function(_0x397f7f,_0x3c97e9){_0x397f7f=_0x397f7f-0x0;var _0x49984f=_0xc5b0[_0x397f7f];return _0x49984f;};'use strict';var passport=require(_0x0c5b('0x0'));var LocalStrategy=require(_0x0c5b('0x1'))[_0x0c5b('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x0c5b('0x3'));var BPromise=require(_0x0c5b('0x4'));var util=require(_0x0c5b('0x5'));var db=require(_0x0c5b('0x6'))['db'];var authService=require(_0x0c5b('0x7'));var utils=require(_0x0c5b('0x8'));var config=require(_0x0c5b('0x9'));var logger=require(_0x0c5b('0xa'))(_0x0c5b('0xb'));function isActiveDirectoryConfigured(_0x407e85){var _0x405f66=![];if(typeof _0x407e85[_0x0c5b('0xc')]!==_0x0c5b('0xd')){_0x405f66=_0x407e85['activedirectory'][_0x0c5b('0xe')]&&_0x407e85[_0x0c5b('0xc')][_0x0c5b('0xf')]&&_0x407e85[_0x0c5b('0xc')][_0x0c5b('0x10')];}return _0x405f66;}function adAuthenticate(_0x25b0dc,_0x27380e,_0x3b65ab){return new BPromise(function(_0x14a066,_0x2b3568){try{var _0x44fcaa=new ActiveDirectory(_0x25b0dc);_0x44fcaa[_0x0c5b('0x11')](_0x27380e,_0x3b65ab,function(_0x4c6a32,_0x4b7c05){if(_0x4c6a32){logger[_0x0c5b('0x12')](_0x0c5b('0x13'),_0x27380e,util[_0x0c5b('0x14')](_0x4c6a32,{'showHidden':![],'depth':null}));_0x2b3568('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x4b7c05){logger[_0x0c5b('0x12')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x27380e);_0x2b3568(_0x0c5b('0x15'));}else{_0x14a066(_0x4b7c05);}});}catch(_0x1ffb31){_0x2b3568(_0x1ffb31);}});}function ActiveDirectoryAuthenticate(_0x173bc1,_0xaddc05,_0xfcbf03,_0x391040){var _0x4c9822,_0x151dc4;if(!isActiveDirectoryConfigured(config)){logger[_0x0c5b('0x12')](_0x0c5b('0x16'),_0xaddc05);return _0x391040(null,![],{'message':_0x0c5b('0x15')});}return db[_0x0c5b('0x17')][_0x0c5b('0x18')]({'where':{'id':0x1},'attributes':[_0x0c5b('0x19'),'blockDuration'],'raw':!![]})[_0x0c5b('0x1a')](function(_0x1babdd){_0x4c9822=_0x1babdd;if(!_0x4c9822[_0x0c5b('0x19')]){logger[_0x0c5b('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0xaddc05);throw new Error(_0x0c5b('0x15'));}return _0x173bc1[_0x0c5b('0x18')]({'attributes':['id',_0x0c5b('0x1b'),'password',_0x0c5b('0x1c'),_0x0c5b('0x1d'),_0x0c5b('0x1e'),_0x0c5b('0x1f'),_0x0c5b('0x20'),'online'],'where':{'name':_0xaddc05,'role':{'$or':[_0x0c5b('0x21'),_0x0c5b('0x22'),_0x0c5b('0x23')]},'adSsoEnabled':!![]}});})['then'](function(_0xee0988){if(!_0xee0988||_0xee0988&&_0xee0988[_0x0c5b('0x1b')]!==_0xaddc05){throw new Error(_0x0c5b('0x15'));}_0x151dc4=_0xee0988;var _0x2215b5=_0x151dc4[_0x0c5b('0x1b')]+'@'+config[_0x0c5b('0xc')][_0x0c5b('0x10')];return adAuthenticate(config[_0x0c5b('0xc')],_0x2215b5,_0xfcbf03);})[_0x0c5b('0x1a')](function(_0x3de5a0){if(_0x151dc4[_0x0c5b('0x1e')]){throw new Error(_0x0c5b('0x15'));}if(_0x4c9822[_0x0c5b('0x24')]>0x0){if(_0x151dc4[_0x0c5b('0x1f')]){if(moment(_0x151dc4[_0x0c5b('0x20')])[_0x0c5b('0x25')](_0x4c9822[_0x0c5b('0x24')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x0c5b('0x26')](_0x151dc4,0x0,![],null)[_0x0c5b('0x1a')](function(){return utils[_0x0c5b('0x27')](_0x151dc4);})[_0x0c5b('0x1a')](function(){return _0x391040(null,_0x151dc4);});}else{return utils['getLicense'](_0x151dc4)[_0x0c5b('0x1a')](function(){return _0x391040(null,_0x151dc4);});}}else{return utils[_0x0c5b('0x27')](_0x151dc4)[_0x0c5b('0x1a')](function(){return _0x391040(null,_0x151dc4);});}})['catch'](function(_0x4e940f){return _0x391040(null,![],_0x4e940f);});}function handleError(_0x215234,_0x470634,_0xd14a67){return _0x215234['status'](_0x470634||0x1f4)[_0x0c5b('0x28')]({'message':_0xd14a67?_0xd14a67[_0x0c5b('0x29')]||_0xd14a67:''});}exports[_0x0c5b('0x2a')]=function(_0x399a95,_0x1914da,_0x419baf){passport[_0x0c5b('0x11')](_0x0c5b('0x2b'),function(_0x43ae64,_0x7c53cd,_0x317132){var _0x4399cc=_0x43ae64||_0x317132;if(_0x4399cc){return handleError(_0x1914da,0x191,_0x4399cc);}if(!_0x7c53cd){return handleError(_0x1914da,0x194,{'message':_0x0c5b('0x2c')});}else{var _0x1f208b={'payload':{'id':_0x7c53cd['id'],'role':_0x7c53cd[_0x0c5b('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x0c5b('0x2d')](_0x1f208b)[_0x0c5b('0x1a')](function(_0x245e81){_0x1914da[_0x0c5b('0x2e')]({'id':_0x7c53cd['id'],'token':_0x245e81,'statusCall':'','isAlreadyLogged':_0x7c53cd[_0x0c5b('0x2f')]});});}})(_0x399a95,_0x1914da,_0x419baf);};passport[_0x0c5b('0x30')](_0x0c5b('0x2b'),new LocalStrategy({'usernameField':_0x0c5b('0x1b'),'passwordField':_0x0c5b('0x31')},function(_0x1dc04f,_0x1f30aa,_0xe73a08){return ActiveDirectoryAuthenticate(db[_0x0c5b('0x32')],_0x1dc04f,_0x1f30aa,_0xe73a08);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 640e0c0..3ea002f 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 _0x7e2f=['exports','express','Router','post','login'];(function(_0x116482,_0x35ddae){var _0x56db37=function(_0xc3685c){while(--_0xc3685c){_0x116482['push'](_0x116482['shift']());}};_0x56db37(++_0x35ddae);}(_0x7e2f,0x164));var _0xf7e2=function(_0x100dea,_0x2ca828){_0x100dea=_0x100dea-0x0;var _0x785cb5=_0x7e2f[_0x100dea];return _0x785cb5;};'use strict';var express=require(_0xf7e2('0x0'));var router=express[_0xf7e2('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xf7e2('0x2')]('/',controller[_0xf7e2('0x3')]);module[_0xf7e2('0x4')]=router;
\ No newline at end of file
+var _0x6c80=['Router','./authActiveDirectory.controller','post','exports'];(function(_0x6dccf9,_0x4b2c5f){var _0x3fbde4=function(_0x82b170){while(--_0x82b170){_0x6dccf9['push'](_0x6dccf9['shift']());}};_0x3fbde4(++_0x4b2c5f);}(_0x6c80,0x18c));var _0x06c8=function(_0x41113f,_0x299dd9){_0x41113f=_0x41113f-0x0;var _0x7168f5=_0x6c80[_0x41113f];return _0x7168f5;};'use strict';var express=require('express');var router=express[_0x06c8('0x0')]();var controller=require(_0x06c8('0x1'));router[_0x06c8('0x2')]('/',controller['login']);module[_0x06c8('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index b8c0c10..573373e 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(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7a54,0x106));var _0x47a5=function(_0x51d9c4,_0x3d1835){_0x51d9c4=_0x51d9c4-0x0;var _0x1f3b35=_0x7a54[_0x51d9c4];return _0x1f3b35;};'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(_0x92c366,_0x43503f){var _0x50aa8e=function(_0x5a0273){while(--_0x5a0273){_0x92c366['push'](_0x92c366['shift']());}};_0x50aa8e(++_0x43503f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 2dbdf99..1cd2457 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 _0x433b=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','passport','Router'];(function(_0x46744a,_0x5725f9){var _0x3a1d95=function(_0x1b40a7){while(--_0x1b40a7){_0x46744a['push'](_0x46744a['shift']());}};_0x3a1d95(++_0x5725f9);}(_0x433b,0x15c));var _0xb433=function(_0x47c5bd,_0x7605da){_0x47c5bd=_0x47c5bd-0x0;var _0x2447dc=_0x433b[_0x47c5bd];return _0x2447dc;};'use strict';var express=require('express');var passport=require(_0xb433('0x0'));var router=express[_0xb433('0x1')]();var controller=require(_0xb433('0x2'));var userController=require(_0xb433('0x3'));var authService=require(_0xb433('0x4'));router[_0xb433('0x5')]('/',controller[_0xb433('0x6')]);router[_0xb433('0x5')](_0xb433('0x7'),controller[_0xb433('0x8')],authService['isMiddleware'],userController[_0xb433('0x6')],authService[_0xb433('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0x0a13=['callback','setTokenCookie','exports','express','passport','../../components/auth/service','get','login'];(function(_0x5c0015,_0xb4fcbf){var _0x526496=function(_0x267630){while(--_0x267630){_0x5c0015['push'](_0x5c0015['shift']());}};_0x526496(++_0xb4fcbf);}(_0x0a13,0x123));var _0x30a1=function(_0x289330,_0x54f85a){_0x289330=_0x289330-0x0;var _0x22d2d0=_0x0a13[_0x289330];return _0x22d2d0;};'use strict';var express=require(_0x30a1('0x0'));var passport=require(_0x30a1('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x30a1('0x2'));router[_0x30a1('0x3')]('/',controller[_0x30a1('0x4')]);router[_0x30a1('0x3')]('/callback',controller[_0x30a1('0x5')],authService['isMiddleware'],userController['login'],authService[_0x30a1('0x6')]);module[_0x30a1('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 6ecf4f0..3bf76cb 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 _0x310f=['resetPasswordToken','resetPasswordExpires','Password\x20reset!','util','passport-local','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','name','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory'];(function(_0x22574c,_0x416cfd){var _0x38a919=function(_0x164633){while(--_0x164633){_0x22574c['push'](_0x22574c['shift']());}};_0x38a919(++_0x416cfd);}(_0x310f,0xf9));var _0xf310=function(_0x2ba3a2,_0x27b815){_0x2ba3a2=_0x2ba3a2-0x0;var _0x25870e=_0x310f[_0x2ba3a2];return _0x25870e;};'use strict';var util=require(_0xf310('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf310('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xf310('0x2'));var moment=require(_0xf310('0x3'));var db=require(_0xf310('0x4'))['db'];var authService=require(_0xf310('0x5'));var utils=require(_0xf310('0x6'));var client=jayson['client'][_0xf310('0x7')]({'port':0x232b});function localAuthenticate(_0x8bbf06,_0x39ec73,_0x4d7965,_0x608a73){var _0x5c90c6,_0x31eff2;return db[_0xf310('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xf310('0x9'),_0xf310('0xa')],'raw':!![]})[_0xf310('0xb')](function(_0x33ed89){_0x5c90c6=_0x33ed89;return _0x8bbf06[_0xf310('0xc')]({'attributes':['id','name',_0xf310('0xd'),_0xf310('0xe'),'role','disabled',_0xf310('0xf'),_0xf310('0x10'),_0xf310('0x11')],'where':{'name':_0x39ec73,'role':{'$or':[_0xf310('0x12'),_0xf310('0x13'),_0xf310('0x14')]}}});})[_0xf310('0xb')](function(_0x569925){if(!_0x569925||_0x569925&&_0x569925['name']!==_0x39ec73){throw new Error(_0xf310('0x15'));}else{_0x31eff2=_0x569925;return _0x31eff2;}})[_0xf310('0xb')](function(){_0x31eff2[_0xf310('0x16')](_0x4d7965,function(_0x2bd0ed,_0x5330ca){var _0x743d40=_0x31eff2[_0xf310('0x11')]+0x1;if(_0x2bd0ed){return _0x608a73(_0x2bd0ed);}else if(!_0x5330ca){if(_0x31eff2[_0xf310('0x17')]){return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5c90c6[_0xf310('0x9')]>0x0){if(_0x31eff2['blocked']){if(_0x5c90c6['blockDuration']>0x0){if(moment(_0x31eff2['blockedAt'])[_0xf310('0x18')](_0x5c90c6['blockDuration'],_0xf310('0x19'))>moment()){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else{return utils['clearBlockUser'](_0x31eff2,_0x743d40,![],null)[_0xf310('0xb')](function(){return _0x608a73(null,![],{'message':_0xf310('0x15')});});}}else{return _0x608a73(null,![],{'message':_0xf310('0x15')});}}else{if(_0x743d40>=_0x5c90c6[_0xf310('0x9')]){return utils[_0xf310('0x1a')](_0x31eff2,0x0,!![],moment())['then'](function(){return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf310('0x1a')](_0x31eff2,_0x743d40,![],null)[_0xf310('0xb')](function(){return _0x608a73(null,![],{'message':_0xf310('0x15')});});}}}else{return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x31eff2[_0xf310('0x17')]){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else if(_0x5c90c6['allowedLoginAttempts']>0x0){if(_0x31eff2[_0xf310('0xf')]){if(_0x5c90c6[_0xf310('0xa')]>0x0){if(moment(_0x31eff2[_0xf310('0x10')])[_0xf310('0x18')](_0x5c90c6[_0xf310('0xa')],_0xf310('0x19'))>moment()){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else{return utils[_0xf310('0x1a')](_0x31eff2,0x0,![],null)['then'](function(){return utils[_0xf310('0x1b')](_0x31eff2);})[_0xf310('0xb')](function(){return _0x608a73(null,_0x31eff2);});}}else{return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xf310('0x1a')](_0x31eff2,0x0,![],null)[_0xf310('0xb')](function(){return utils[_0xf310('0x1b')](_0x31eff2);})[_0xf310('0xb')](function(){return _0x608a73(null,_0x31eff2);})[_0xf310('0x1c')](function(_0x258fdb){return _0x608a73(null,![],_0x258fdb);});}}else{if(_0x31eff2[_0xf310('0xf')]){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else{return utils[_0xf310('0x1b')](_0x31eff2)[_0xf310('0xb')](function(){return _0x608a73(null,_0x31eff2);});}}}});})[_0xf310('0x1c')](function(_0x19bb3c){return _0x608a73(null,![],_0x19bb3c);});}function sendServiceMail(_0x2d5d60){return db[_0xf310('0x1d')][_0xf310('0x1e')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0xf310('0x1f'),'include':[{'model':db['CloudProvider'],'as':_0xf310('0x20')}]}]})[_0xf310('0xb')](function(_0x1aca71){if(!_0x1aca71){throw new Error(_0xf310('0x21'));}var _0x462979=_0x1aca71[_0xf310('0x22')]();var _0x23ea19={'account':_0x462979,'message':_[_0xf310('0x23')]({'from':util[_0xf310('0x24')]('\x22%s\x22\x20<%s>',_0x1aca71[_0xf310('0x25')],_0x1aca71[_0xf310('0x26')]||_0x1aca71[_0xf310('0x1f')][_0xf310('0x13')])},_0x2d5d60)};return client[_0xf310('0x27')](_0xf310('0x28'),_0x23ea19);})[_0xf310('0xb')](function(_0x2ca45f){if(_0x2ca45f[_0xf310('0x29')]){throw new Error(util[_0xf310('0x24')](_0xf310('0x2a'),_0x2ca45f[_0xf310('0x29')][_0xf310('0x2b')]||JSON[_0xf310('0x2c')](_0x2ca45f[_0xf310('0x29')])));}return!![];});}function handleError(_0x288cf2,_0x1a1fb4,_0x49b461){return _0x288cf2[_0xf310('0x2d')](_0x1a1fb4||0x1f4)[_0xf310('0x2e')]({'message':_0x49b461?_0x49b461[_0xf310('0x2b')]||_0x49b461:''});}exports[_0xf310('0x2f')]=function(_0x223cda,_0x2eb74a,_0x4b3133){passport[_0xf310('0x16')](_0xf310('0x30'),function(_0x3d12c1,_0x29445a,_0x36fbd1){var _0xe943d5=_0x3d12c1||_0x36fbd1;if(_0xe943d5){return handleError(_0x2eb74a,0x191,_0xe943d5);}if(!_0x29445a){return handleError(_0x2eb74a,0x194,{'message':_0xf310('0x31')});}else{var _0x63851f={'payload':{'id':_0x29445a['id'],'role':_0x29445a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x63851f)[_0xf310('0xb')](function(_0x2ec5e0){_0x2eb74a[_0xf310('0x32')]({'id':_0x29445a['id'],'token':_0x2ec5e0,'statusCall':'','isAlreadyLogged':_0x29445a[_0xf310('0x33')]});});}})(_0x223cda,_0x2eb74a,_0x4b3133);};exports['forgot']=function(_0x3e1cf7,_0x3e3950){if(!_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')]){return handleError(_0x3e3950,0x1f4,{'message':_0xf310('0x35')});}var _0x402999=rs[_0xf310('0x36')]();_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')]=_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')][_0xf310('0x37')]()[_0xf310('0x38')]();var _0x152c06;return db[_0xf310('0x8')][_0xf310('0xc')]({'where':{'id':0x1},'attributes':[_0xf310('0x9'),_0xf310('0xa')],'raw':!![]})[_0xf310('0xb')](function(_0xc6094a){_0x152c06=_0xc6094a;return db[_0xf310('0x39')][_0xf310('0x1e')]({'where':{'email':_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')]}});})[_0xf310('0xb')](function(_0x3307a4){if(!_0x3307a4){throw new Error(_0xf310('0x3a'));}if(_0x3307a4[_0xf310('0x17')]){throw new Error(_0xf310('0x3b'));}if(_0x3307a4['blocked']){if(moment(_0x3307a4[_0xf310('0x10')])[_0xf310('0x18')](_0x152c06[_0xf310('0xa')],_0xf310('0x19'))>moment()){throw new Error(_0xf310('0x3c'));}else{_0x3307a4[_0xf310('0xf')]=![];_0x3307a4[_0xf310('0x10')]=null;}}_0x3307a4['resetPasswordToken']=_0x402999;_0x3307a4['resetPasswordExpires']=Date[_0xf310('0x3d')]()+0x36ee80;return _0x3307a4[_0xf310('0x3e')]();})[_0xf310('0xb')](function(){return sendServiceMail({'to':_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')],'subject':_0xf310('0x3f'),'text':_0xf310('0x40')+_0xf310('0x41')+_0xf310('0x42')+_0x3e1cf7[_0xf310('0x43')][_0xf310('0x44')]+'/reset/'+_0x402999+'\x0a\x0a'+_0xf310('0x45')});})['then'](function(){_0x3e3950[_0xf310('0x2d')](0xc8)[_0xf310('0x2e')]({'message':_0xf310('0x46')});})[_0xf310('0x1c')](function(_0x31aead){return handleError(_0x3e3950,0x1f4,_0x31aead);});};exports['reset']=function(_0x24ac9a,_0x5ad28f){return db[_0xf310('0x39')][_0xf310('0x1e')]({'where':{'resetPasswordToken':_0x24ac9a[_0xf310('0x47')][_0xf310('0x48')],'resetPasswordExpires':{'$gt':Date[_0xf310('0x3d')]()}}})[_0xf310('0xb')](function(_0xb10fc7){if(!_0xb10fc7){throw new Error(_0xf310('0x49'));}return db[_0xf310('0x8')]['findOne']({'attributes':['id','securePassword',_0xf310('0x4a'),_0xf310('0x4b')]})[_0xf310('0xb')](function(_0x170f3e){if(_0x170f3e[_0xf310('0x4c')])authService[_0xf310('0x4d')](_0x24ac9a['body'][_0xf310('0xd')]);if(!_0x170f3e[_0xf310('0x4a')]||!_0xb10fc7['previousPasswords'])return _0xb10fc7;authService[_0xf310('0x4e')](_0x24ac9a[_0xf310('0x34')][_0xf310('0xd')],_0xb10fc7['previousPasswords'],_0x170f3e[_0xf310('0x4b')]);return _0xb10fc7;})['then'](function(){_0xb10fc7[_0xf310('0xd')]=_0x24ac9a['body'][_0xf310('0xd')];_0xb10fc7[_0xf310('0x4f')]=null;_0xb10fc7[_0xf310('0x50')]=null;return _0xb10fc7[_0xf310('0x3e')]();});})[_0xf310('0xb')](function(){_0x5ad28f[_0xf310('0x2d')](0xc8)[_0xf310('0x2e')]({'message':_0xf310('0x51')});})[_0xf310('0x1c')](function(_0x4ddc4c){return handleError(_0x5ad28f,0x1f4,_0x4ddc4c);});};passport['use'](_0xf310('0x30'),new LocalStrategy({'usernameField':'name','passwordField':_0xf310('0xd')},function(_0x324b6b,_0x4ae829,_0x154be5){return localAuthenticate(db[_0xf310('0x39')],_0x324b6b,_0x4ae829,_0x154be5);}));
\ No newline at end of file
+var _0xaae9=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','password','send','Password\x20reset!','use','local-login','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','then','role','disabled','blocked','loginAttempts','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','generate','body','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0xc036bb,_0x5cab81){var _0x523ab9=function(_0x2eed72){while(--_0x2eed72){_0xc036bb['push'](_0xc036bb['shift']());}};_0x523ab9(++_0x5cab81);}(_0xaae9,0x194));var _0x9aae=function(_0xbaaffc,_0xc5ce9b){_0xbaaffc=_0xbaaffc-0x0;var _0x1f91a4=_0xaae9[_0xbaaffc];return _0x1f91a4;};'use strict';var util=require('util');var passport=require(_0x9aae('0x0'));var LocalStrategy=require(_0x9aae('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x9aae('0x2'));var rs=require('randomstring');var moment=require(_0x9aae('0x3'));var db=require(_0x9aae('0x4'))['db'];var authService=require(_0x9aae('0x5'));var utils=require(_0x9aae('0x6'));var client=jayson[_0x9aae('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x3ac299,_0x5c8c60,_0x26e6f9,_0x1bdfe2){var _0x2bcc4f,_0x3a0b9f;return db['Setting'][_0x9aae('0x8')]({'where':{'id':0x1},'attributes':[_0x9aae('0x9'),'blockDuration'],'raw':!![]})[_0x9aae('0xa')](function(_0x19e807){_0x2bcc4f=_0x19e807;return _0x3ac299[_0x9aae('0x8')]({'attributes':['id','name','password','salt',_0x9aae('0xb'),_0x9aae('0xc'),_0x9aae('0xd'),'blockedAt',_0x9aae('0xe')],'where':{'name':_0x5c8c60,'role':{'$or':['admin',_0x9aae('0xf'),'agent']}}});})[_0x9aae('0xa')](function(_0x28f016){if(!_0x28f016||_0x28f016&&_0x28f016[_0x9aae('0x10')]!==_0x5c8c60){throw new Error(_0x9aae('0x11'));}else{_0x3a0b9f=_0x28f016;return _0x3a0b9f;}})[_0x9aae('0xa')](function(){_0x3a0b9f[_0x9aae('0x12')](_0x26e6f9,function(_0x22cba8,_0xfd9565){var _0x20f68e=_0x3a0b9f[_0x9aae('0xe')]+0x1;if(_0x22cba8){return _0x1bdfe2(_0x22cba8);}else if(!_0xfd9565){if(_0x3a0b9f[_0x9aae('0xc')]){return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});}else if(_0x2bcc4f[_0x9aae('0x9')]>0x0){if(_0x3a0b9f[_0x9aae('0xd')]){if(_0x2bcc4f[_0x9aae('0x13')]>0x0){if(moment(_0x3a0b9f[_0x9aae('0x14')])[_0x9aae('0x15')](_0x2bcc4f[_0x9aae('0x13')],'minutes')>moment()){return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});}else{return utils[_0x9aae('0x16')](_0x3a0b9f,_0x20f68e,![],null)[_0x9aae('0xa')](function(){return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});});}}else{return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});}}else{if(_0x20f68e>=_0x2bcc4f[_0x9aae('0x9')]){return utils[_0x9aae('0x16')](_0x3a0b9f,0x0,!![],moment())[_0x9aae('0xa')](function(){return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});});}else{return utils[_0x9aae('0x16')](_0x3a0b9f,_0x20f68e,![],null)[_0x9aae('0xa')](function(){return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});});}}}else{return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});}}else{if(_0x3a0b9f['disabled']){return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});}else if(_0x2bcc4f[_0x9aae('0x9')]>0x0){if(_0x3a0b9f[_0x9aae('0xd')]){if(_0x2bcc4f['blockDuration']>0x0){if(moment(_0x3a0b9f[_0x9aae('0x14')])[_0x9aae('0x15')](_0x2bcc4f[_0x9aae('0x13')],_0x9aae('0x17'))>moment()){return _0x1bdfe2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9aae('0x16')](_0x3a0b9f,0x0,![],null)[_0x9aae('0xa')](function(){return utils[_0x9aae('0x18')](_0x3a0b9f);})[_0x9aae('0xa')](function(){return _0x1bdfe2(null,_0x3a0b9f);});}}else{return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});}}else{return utils[_0x9aae('0x16')](_0x3a0b9f,0x0,![],null)[_0x9aae('0xa')](function(){return utils[_0x9aae('0x18')](_0x3a0b9f);})[_0x9aae('0xa')](function(){return _0x1bdfe2(null,_0x3a0b9f);})[_0x9aae('0x19')](function(_0x6fb7c6){return _0x1bdfe2(null,![],_0x6fb7c6);});}}else{if(_0x3a0b9f['blocked']){return _0x1bdfe2(null,![],{'message':_0x9aae('0x11')});}else{return utils[_0x9aae('0x18')](_0x3a0b9f)[_0x9aae('0xa')](function(){return _0x1bdfe2(null,_0x3a0b9f);});}}}});})['catch'](function(_0x1aef99){return _0x1bdfe2(null,![],_0x1aef99);});}function sendServiceMail(_0x486911){return db[_0x9aae('0x1a')][_0x9aae('0x1b')]({'where':{'service':!![]},'attributes':['id','name',_0x9aae('0x1c')],'include':[{'model':db['MailServerOut'],'as':_0x9aae('0x1d'),'include':[{'model':db[_0x9aae('0x1e')],'as':_0x9aae('0x1e')}]}]})['then'](function(_0x392106){if(!_0x392106){throw new Error(_0x9aae('0x1f'));}var _0x5e6794=_0x392106[_0x9aae('0x20')]();var _0x4890ec={'account':_0x5e6794,'message':_['merge']({'from':util['format'](_0x9aae('0x21'),_0x392106[_0x9aae('0x10')],_0x392106[_0x9aae('0x1c')]||_0x392106[_0x9aae('0x1d')]['user'])},_0x486911)};return client[_0x9aae('0x22')](_0x9aae('0x23'),_0x4890ec);})[_0x9aae('0xa')](function(_0x110d6f){if(_0x110d6f[_0x9aae('0x24')]){throw new Error(util['format'](_0x9aae('0x25'),_0x110d6f[_0x9aae('0x24')]['message']||JSON[_0x9aae('0x26')](_0x110d6f[_0x9aae('0x24')])));}return!![];});}function handleError(_0x236924,_0x77b2ee,_0x1ff3aa){return _0x236924[_0x9aae('0x27')](_0x77b2ee||0x1f4)['send']({'message':_0x1ff3aa?_0x1ff3aa['message']||_0x1ff3aa:''});}exports[_0x9aae('0x28')]=function(_0x1bf381,_0x58c327,_0x3c8c8){passport[_0x9aae('0x12')]('local-login',function(_0x3d242b,_0x1fc4a2,_0x25b380){var _0x28be07=_0x3d242b||_0x25b380;if(_0x28be07){return handleError(_0x58c327,0x191,_0x28be07);}if(!_0x1fc4a2){return handleError(_0x58c327,0x194,{'message':_0x9aae('0x29')});}else{var _0x81bbf2={'payload':{'id':_0x1fc4a2['id'],'role':_0x1fc4a2['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x81bbf2)[_0x9aae('0xa')](function(_0x29ef2b){_0x58c327[_0x9aae('0x2a')]({'id':_0x1fc4a2['id'],'token':_0x29ef2b,'statusCall':'','isAlreadyLogged':_0x1fc4a2[_0x9aae('0x2b')]});});}})(_0x1bf381,_0x58c327,_0x3c8c8);};exports[_0x9aae('0x2c')]=function(_0x39653c,_0x2154d9){if(!_0x39653c['body'][_0x9aae('0x1c')]){return handleError(_0x2154d9,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x41c635=rs[_0x9aae('0x2d')]();_0x39653c[_0x9aae('0x2e')][_0x9aae('0x1c')]=_0x39653c[_0x9aae('0x2e')][_0x9aae('0x1c')]['trim']()[_0x9aae('0x2f')]();var _0x182f27;return db[_0x9aae('0x30')][_0x9aae('0x8')]({'where':{'id':0x1},'attributes':[_0x9aae('0x9'),_0x9aae('0x13')],'raw':!![]})[_0x9aae('0xa')](function(_0x461976){_0x182f27=_0x461976;return db[_0x9aae('0x31')][_0x9aae('0x1b')]({'where':{'email':_0x39653c[_0x9aae('0x2e')][_0x9aae('0x1c')]}});})[_0x9aae('0xa')](function(_0x3f6ce8){if(!_0x3f6ce8){throw new Error(_0x9aae('0x32'));}if(_0x3f6ce8[_0x9aae('0xc')]){throw new Error(_0x9aae('0x33'));}if(_0x3f6ce8[_0x9aae('0xd')]){if(moment(_0x3f6ce8[_0x9aae('0x14')])['add'](_0x182f27[_0x9aae('0x13')],_0x9aae('0x17'))>moment()){throw new Error(_0x9aae('0x34'));}else{_0x3f6ce8[_0x9aae('0xd')]=![];_0x3f6ce8[_0x9aae('0x14')]=null;}}_0x3f6ce8[_0x9aae('0x35')]=_0x41c635;_0x3f6ce8[_0x9aae('0x36')]=Date[_0x9aae('0x37')]()+0x36ee80;return _0x3f6ce8['save']();})['then'](function(){return sendServiceMail({'to':_0x39653c[_0x9aae('0x2e')][_0x9aae('0x1c')],'subject':_0x9aae('0x38'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x9aae('0x39')+_0x9aae('0x3a')+_0x39653c[_0x9aae('0x3b')]['host']+_0x9aae('0x3c')+_0x41c635+'\x0a\x0a'+_0x9aae('0x3d')});})['then'](function(){_0x2154d9['status'](0xc8)['send']({'message':_0x9aae('0x3e')});})['catch'](function(_0x1bafa9){return handleError(_0x2154d9,0x1f4,_0x1bafa9);});};exports['reset']=function(_0x210012,_0x53fdd0){return db[_0x9aae('0x31')][_0x9aae('0x1b')]({'where':{'resetPasswordToken':_0x210012[_0x9aae('0x3f')]['token'],'resetPasswordExpires':{'$gt':Date[_0x9aae('0x37')]()}}})[_0x9aae('0xa')](function(_0xeb4f11){if(!_0xeb4f11){throw new Error(_0x9aae('0x40'));}return db[_0x9aae('0x30')]['findOne']({'attributes':['id',_0x9aae('0x41'),_0x9aae('0x42'),_0x9aae('0x43')]})[_0x9aae('0xa')](function(_0x3ce500){if(_0x3ce500[_0x9aae('0x41')])authService[_0x9aae('0x44')](_0x210012['body']['password']);if(!_0x3ce500[_0x9aae('0x42')]||!_0xeb4f11[_0x9aae('0x45')])return _0xeb4f11;authService[_0x9aae('0x46')](_0x210012[_0x9aae('0x2e')][_0x9aae('0x47')],_0xeb4f11[_0x9aae('0x45')],_0x3ce500['passwordHistoryLimit']);return _0xeb4f11;})[_0x9aae('0xa')](function(){_0xeb4f11[_0x9aae('0x47')]=_0x210012[_0x9aae('0x2e')][_0x9aae('0x47')];_0xeb4f11[_0x9aae('0x35')]=null;_0xeb4f11[_0x9aae('0x36')]=null;return _0xeb4f11['save']();});})['then'](function(){_0x53fdd0[_0x9aae('0x27')](0xc8)[_0x9aae('0x48')]({'message':_0x9aae('0x49')});})[_0x9aae('0x19')](function(_0x2ff719){return handleError(_0x53fdd0,0x1f4,_0x2ff719);});};passport[_0x9aae('0x4a')](_0x9aae('0x4b'),new LocalStrategy({'usernameField':_0x9aae('0x10'),'passwordField':_0x9aae('0x47')},function(_0x597c5,_0x34585b,_0x5efca3){return localAuthenticate(db[_0x9aae('0x31')],_0x597c5,_0x34585b,_0x5efca3);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 8d0126c..1245a73 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 _0xf8f5=['exports','Router','./authLocal.controller','login','post','reset'];(function(_0x59591b,_0x354045){var _0x576642=function(_0x12d1ce){while(--_0x12d1ce){_0x59591b['push'](_0x59591b['shift']());}};_0x576642(++_0x354045);}(_0xf8f5,0x13f));var _0x5f8f=function(_0x1e80f9,_0xa68ab1){_0x1e80f9=_0x1e80f9-0x0;var _0x46f8f5=_0xf8f5[_0x1e80f9];return _0x46f8f5;};'use strict';var express=require('express');var router=express[_0x5f8f('0x0')]();var controller=require(_0x5f8f('0x1'));router['post']('/',controller[_0x5f8f('0x2')]);router[_0x5f8f('0x3')]('/forgot',controller['forgot']);router[_0x5f8f('0x3')]('/reset/:token',controller[_0x5f8f('0x4')]);module[_0x5f8f('0x5')]=router;
\ No newline at end of file
+var _0xc4a4=['./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x92dfa8,_0x192395){var _0x473bdc=function(_0x356816){while(--_0x356816){_0x92dfa8['push'](_0x92dfa8['shift']());}};_0x473bdc(++_0x192395);}(_0xc4a4,0xa9));var _0x4c4a=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xc4a4[_0x1035c1];return _0x308d67;};'use strict';var express=require(_0x4c4a('0x0'));var router=express[_0x4c4a('0x1')]();var controller=require(_0x4c4a('0x2'));router[_0x4c4a('0x3')]('/',controller['login']);router[_0x4c4a('0x3')](_0x4c4a('0x4'),controller[_0x4c4a('0x5')]);router[_0x4c4a('0x3')](_0x4c4a('0x6'),controller[_0x4c4a('0x7')]);module[_0x4c4a('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index ccba078..5837344 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 _0x3511=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x3511,0x1c2));var _0x1351=function(_0x5ecac1,_0x2d7338){_0x5ecac1=_0x5ecac1-0x0;var _0x1fe487=_0x3511[_0x5ecac1];return _0x1fe487;};'use strict';var Sequelize=require(_0x1351('0x0'));module[_0x1351('0x1')]={'name':{'type':Sequelize[_0x1351('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1351('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1351('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x0e22=['STRING','BOOLEAN','exports'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x0e22,0x1ee));var _0x20e2=function(_0x260ce2,_0x2e22b8){_0x260ce2=_0x260ce2-0x0;var _0x16b105=_0x0e22[_0x260ce2];return _0x16b105;};'use strict';var Sequelize=require('sequelize');module[_0x20e2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x20e2('0x1')]},'status':{'type':Sequelize[_0x20e2('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 2239a5a..b2e6e57 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 _0x08ff=['name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','findAll','catch','length','find','create','body','params','destroy','Condition','addConditions','ids','omit','getConditions','filter','addActions','getActions','findOne','Action','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','reject','save','update','then','error','stack','send','index','map','Automation','rawAttributes','fieldName','key','model'];(function(_0x5177c4,_0x1a76ab){var _0x6be752=function(_0x2269a3){while(--_0x2269a3){_0x5177c4['push'](_0x5177c4['shift']());}};_0x6be752(++_0x1a76ab);}(_0x08ff,0xbc));var _0xf08f=function(_0x23f5f6,_0x3950b2){_0x23f5f6=_0x23f5f6-0x0;var _0x686cbd=_0x08ff[_0x23f5f6];return _0x686cbd;};'use strict';var emlformat=require(_0xf08f('0x0'));var rimraf=require(_0xf08f('0x1'));var zipdir=require(_0xf08f('0x2'));var jsonpatch=require(_0xf08f('0x3'));var rp=require(_0xf08f('0x4'));var moment=require('moment');var BPromise=require(_0xf08f('0x5'));var Mustache=require(_0xf08f('0x6'));var util=require(_0xf08f('0x7'));var path=require(_0xf08f('0x8'));var sox=require(_0xf08f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf08f('0xa'));var _=require(_0xf08f('0xb'));var squel=require(_0xf08f('0xc'));var crypto=require('crypto');var jsforce=require(_0xf08f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf08f('0xe'));var querystring=require(_0xf08f('0xf'));var Papa=require(_0xf08f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf08f('0x11'));var as=require(_0xf08f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf08f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf08f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf08f('0x15'))['db'];function respondWithStatusCode(_0x17c011,_0x382e72){_0x382e72=_0x382e72||0xcc;return function(_0x6827d6){if(_0x6827d6){return _0x17c011[_0xf08f('0x16')](_0x382e72);}return _0x17c011[_0xf08f('0x17')](_0x382e72)[_0xf08f('0x18')]();};}function respondWithResult(_0x526131,_0x3c1151){_0x3c1151=_0x3c1151||0xc8;return function(_0x3768f0){if(_0x3768f0){return _0x526131[_0xf08f('0x17')](_0x3c1151)[_0xf08f('0x19')](_0x3768f0);}};}function respondWithFilteredResult(_0x949955,_0x3d37bc){return function(_0x4995f2){if(_0x4995f2){var _0xca2cb0=typeof _0x3d37bc[_0xf08f('0x1a')]==='undefined'&&typeof _0x3d37bc[_0xf08f('0x1b')]==='undefined';var _0x403ec2=_0x4995f2['count'];var _0x20acb4=_0xca2cb0?0x0:_0x3d37bc[_0xf08f('0x1a')];var _0x4480ff=_0xca2cb0?_0x4995f2[_0xf08f('0x1c')]:_0x3d37bc[_0xf08f('0x1a')]+_0x3d37bc[_0xf08f('0x1b')];var _0x17044a;if(_0x4480ff>=_0x403ec2){_0x4480ff=_0x403ec2;_0x17044a=0xc8;}else{_0x17044a=0xce;}_0x949955['status'](_0x17044a);return _0x949955['set']('Content-Range',_0x20acb4+'-'+_0x4480ff+'/'+_0x403ec2)[_0xf08f('0x19')](_0x4995f2);}return null;};}function patchUpdates(_0x400748){return function(_0x1e9046){try{jsonpatch['apply'](_0x1e9046,_0x400748,!![]);}catch(_0x180ff2){return BPromise[_0xf08f('0x1d')](_0x180ff2);}return _0x1e9046[_0xf08f('0x1e')]();};}function saveUpdates(_0x1d87cc,_0x39bd6e){return function(_0xd2c69c){if(_0xd2c69c){return _0xd2c69c[_0xf08f('0x1f')](_0x1d87cc)[_0xf08f('0x20')](function(_0x1fcbb7){return _0x1fcbb7;});}return null;};}function removeEntity(_0x5d36cc,_0x42d1f9){return function(_0x2d2b6a){if(_0x2d2b6a){return _0x2d2b6a['destroy']()[_0xf08f('0x20')](function(){_0x5d36cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d6db2,_0x24bc3e){return function(_0x3b9c9d){if(!_0x3b9c9d){_0x1d6db2[_0xf08f('0x16')](0x194);}return _0x3b9c9d;};}function handleError(_0x1e00a0,_0x5ba820){_0x5ba820=_0x5ba820||0x1f4;return function(_0x4eaef4){logger[_0xf08f('0x21')](_0x4eaef4[_0xf08f('0x22')]);if(_0x4eaef4['name']){delete _0x4eaef4['name'];}_0x1e00a0['status'](_0x5ba820)[_0xf08f('0x23')](_0x4eaef4);};}exports[_0xf08f('0x24')]=function(_0xff880f,_0x151aa5){var _0x516f26={},_0xba1c49={},_0x2313d5={'count':0x0,'rows':[]};var _0x2fb007=_[_0xf08f('0x25')](db[_0xf08f('0x26')][_0xf08f('0x27')],function(_0x5678fe){return{'name':_0x5678fe[_0xf08f('0x28')],'type':_0x5678fe['type'][_0xf08f('0x29')]};});_0xba1c49[_0xf08f('0x2a')]=_[_0xf08f('0x25')](_0x2fb007,_0xf08f('0x2b'));_0xba1c49[_0xf08f('0x2c')]=_[_0xf08f('0x2d')](_0xff880f['query']);_0xba1c49[_0xf08f('0x2e')]=_[_0xf08f('0x2f')](_0xba1c49[_0xf08f('0x2a')],_0xba1c49[_0xf08f('0x2c')]);_0x516f26[_0xf08f('0x30')]=_['intersection'](_0xba1c49[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0xff880f[_0xf08f('0x2c')][_0xf08f('0x31')]));_0x516f26[_0xf08f('0x30')]=_0x516f26[_0xf08f('0x30')]['length']?_0x516f26[_0xf08f('0x30')]:_0xba1c49['model'];if(!_0xff880f['query'][_0xf08f('0x32')](_0xf08f('0x33'))){_0x516f26['limit']=qs[_0xf08f('0x1b')](_0xff880f[_0xf08f('0x2c')][_0xf08f('0x1b')]);_0x516f26[_0xf08f('0x1a')]=qs[_0xf08f('0x1a')](_0xff880f[_0xf08f('0x2c')]['offset']);}_0x516f26[_0xf08f('0x34')]=qs[_0xf08f('0x35')](_0xff880f[_0xf08f('0x2c')][_0xf08f('0x35')]);_0x516f26[_0xf08f('0x36')]=qs['filters'](_['pick'](_0xff880f[_0xf08f('0x2c')],_0xba1c49['filters']),_0x2fb007);if(_0xff880f[_0xf08f('0x2c')]['filter']){_0x516f26[_0xf08f('0x36')]=_['merge'](_0x516f26['where'],{'$or':_[_0xf08f('0x25')](_0x2fb007,function(_0x40a929){if(_0x40a929['type']!=='VIRTUAL'){var _0x3f6ae0={};_0x3f6ae0[_0x40a929[_0xf08f('0x2b')]]={'$like':'%'+_0xff880f[_0xf08f('0x2c')]['filter']+'%'};return _0x3f6ae0;}})});}_0x516f26=_[_0xf08f('0x37')]({},_0x516f26,_0xff880f[_0xf08f('0x38')]);var _0x26863b={'where':_0x516f26[_0xf08f('0x36')]};return db[_0xf08f('0x26')]['count'](_0x26863b)[_0xf08f('0x20')](function(_0x562704){_0x2313d5[_0xf08f('0x1c')]=_0x562704;if(_0xff880f[_0xf08f('0x2c')][_0xf08f('0x39')]){_0x516f26['include']=[{'all':!![]}];}return db[_0xf08f('0x26')][_0xf08f('0x3a')](_0x516f26);})[_0xf08f('0x20')](function(_0x566ad6){_0x2313d5['rows']=_0x566ad6;return _0x2313d5;})['then'](respondWithFilteredResult(_0x151aa5,_0x516f26))[_0xf08f('0x3b')](handleError(_0x151aa5,null));};exports['show']=function(_0x379140,_0x17bce3){var _0x38f5c1={'raw':![],'where':{'id':_0x379140['params']['id']}},_0xc12883={};_0xc12883[_0xf08f('0x2a')]=_[_0xf08f('0x2d')](db[_0xf08f('0x26')][_0xf08f('0x27')]);_0xc12883['query']=_[_0xf08f('0x2d')](_0x379140[_0xf08f('0x2c')]);_0xc12883['filters']=_[_0xf08f('0x2f')](_0xc12883[_0xf08f('0x2a')],_0xc12883['query']);_0x38f5c1[_0xf08f('0x30')]=_['intersection'](_0xc12883[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0x379140[_0xf08f('0x2c')]['fields']));_0x38f5c1[_0xf08f('0x30')]=_0x38f5c1[_0xf08f('0x30')][_0xf08f('0x3c')]?_0x38f5c1[_0xf08f('0x30')]:_0xc12883[_0xf08f('0x2a')];if(_0x379140[_0xf08f('0x2c')][_0xf08f('0x39')]){_0x38f5c1['include']=[{'all':!![]}];}_0x38f5c1=_[_0xf08f('0x37')]({},_0x38f5c1,_0x379140[_0xf08f('0x38')]);return db[_0xf08f('0x26')][_0xf08f('0x3d')](_0x38f5c1)[_0xf08f('0x20')](handleEntityNotFound(_0x17bce3,null))[_0xf08f('0x20')](respondWithResult(_0x17bce3,null))[_0xf08f('0x3b')](handleError(_0x17bce3,null));};exports[_0xf08f('0x3e')]=function(_0x224944,_0x380b9b){return db[_0xf08f('0x26')][_0xf08f('0x3e')](_0x224944[_0xf08f('0x3f')],{})[_0xf08f('0x20')](respondWithResult(_0x380b9b,0xc9))[_0xf08f('0x3b')](handleError(_0x380b9b,null));};exports[_0xf08f('0x1f')]=function(_0xb8e17d,_0x2b9052){if(_0xb8e17d[_0xf08f('0x3f')]['id']){delete _0xb8e17d[_0xf08f('0x3f')]['id'];}return db['Automation'][_0xf08f('0x3d')]({'where':{'id':_0xb8e17d[_0xf08f('0x40')]['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0x2b9052,null))[_0xf08f('0x20')](saveUpdates(_0xb8e17d[_0xf08f('0x3f')],null))[_0xf08f('0x20')](respondWithResult(_0x2b9052,null))[_0xf08f('0x3b')](handleError(_0x2b9052,null));};exports[_0xf08f('0x41')]=function(_0x20c80f,_0xb1f6c2){return db['Automation'][_0xf08f('0x3d')]({'where':{'id':_0x20c80f[_0xf08f('0x40')]['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0xb1f6c2,null))[_0xf08f('0x20')](removeEntity(_0xb1f6c2,null))['catch'](handleError(_0xb1f6c2,null));};exports['addConditions']=function(_0x2cbe89,_0x192dd7,_0x52119b){return db[_0xf08f('0x42')][_0xf08f('0x3d')]({'where':{'id':_0x2cbe89[_0xf08f('0x40')]['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0x192dd7,null))['then'](function(_0x7a47fe){if(_0x7a47fe){return _0x7a47fe[_0xf08f('0x43')](_0x2cbe89['body'][_0xf08f('0x44')],_[_0xf08f('0x45')](_0x2cbe89[_0xf08f('0x3f')],[_0xf08f('0x44'),'id'])||{});}})[_0xf08f('0x20')](respondWithResult(_0x192dd7,null))['catch'](handleError(_0x192dd7,null));};exports[_0xf08f('0x46')]=function(_0x1c35c8,_0x28aeae,_0x3542a9){var _0x382317={};var _0x26ec05={};var _0x342df1;var _0x40914a;return db[_0xf08f('0x26')]['findOne']({'where':{'id':_0x1c35c8[_0xf08f('0x40')]['id']}})['then'](handleEntityNotFound(_0x28aeae,null))[_0xf08f('0x20')](function(_0x4121f8){if(_0x4121f8){_0x342df1=_0x4121f8;_0x26ec05[_0xf08f('0x2a')]=_[_0xf08f('0x2d')](db[_0xf08f('0x42')][_0xf08f('0x27')]);_0x26ec05['query']=_[_0xf08f('0x2d')](_0x1c35c8[_0xf08f('0x2c')]);_0x26ec05[_0xf08f('0x2e')]=_[_0xf08f('0x2f')](_0x26ec05['model'],_0x26ec05[_0xf08f('0x2c')]);_0x382317[_0xf08f('0x30')]=_[_0xf08f('0x2f')](_0x26ec05[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0x1c35c8['query'][_0xf08f('0x31')]));_0x382317[_0xf08f('0x30')]=_0x382317[_0xf08f('0x30')][_0xf08f('0x3c')]?_0x382317['attributes']:_0x26ec05[_0xf08f('0x2a')];_0x382317[_0xf08f('0x34')]=qs[_0xf08f('0x35')](_0x1c35c8[_0xf08f('0x2c')][_0xf08f('0x35')]);_0x382317[_0xf08f('0x36')]=qs[_0xf08f('0x2e')](_['pick'](_0x1c35c8[_0xf08f('0x2c')],_0x26ec05[_0xf08f('0x2e')]));if(_0x1c35c8['query'][_0xf08f('0x47')]){_0x382317['where']=_['merge'](_0x382317['where'],{'$or':_[_0xf08f('0x25')](_0x382317[_0xf08f('0x30')],function(_0x470ceb){var _0x13151c={};_0x13151c[_0x470ceb]={'$like':'%'+_0x1c35c8[_0xf08f('0x2c')][_0xf08f('0x47')]+'%'};return _0x13151c;})});}_0x382317=_[_0xf08f('0x37')]({},_0x382317,_0x1c35c8[_0xf08f('0x38')]);return _0x342df1[_0xf08f('0x46')](_0x382317);}})[_0xf08f('0x20')](function(_0x1aa1fb){if(_0x1aa1fb){_0x40914a=_0x1aa1fb['length'];if(!_0x1c35c8[_0xf08f('0x2c')]['hasOwnProperty'](_0xf08f('0x33'))){_0x382317['limit']=qs[_0xf08f('0x1b')](_0x1c35c8['query'][_0xf08f('0x1b')]);_0x382317[_0xf08f('0x1a')]=qs[_0xf08f('0x1a')](_0x1c35c8['query'][_0xf08f('0x1a')]);}return _0x342df1[_0xf08f('0x46')](_0x382317);}})['then'](function(_0x356fd1){if(_0x356fd1){return _0x356fd1?{'count':_0x40914a,'rows':_0x356fd1}:null;}})[_0xf08f('0x20')](respondWithResult(_0x28aeae,null))[_0xf08f('0x3b')](handleError(_0x28aeae,null));};exports['addActions']=function(_0xe69279,_0x437051,_0xf02ee0){return db['Action'][_0xf08f('0x3d')]({'where':{'id':_0xe69279['params']['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0x437051,null))['then'](function(_0x7d2a63){if(_0x7d2a63){return _0x7d2a63[_0xf08f('0x48')](_0xe69279['body'][_0xf08f('0x44')],_[_0xf08f('0x45')](_0xe69279[_0xf08f('0x3f')],['ids','id'])||{});}})[_0xf08f('0x20')](respondWithResult(_0x437051,null))[_0xf08f('0x3b')](handleError(_0x437051,null));};exports[_0xf08f('0x49')]=function(_0x34ac4b,_0x31fafb,_0x44133a){var _0x3b84ac={};var _0x53bbe9={};var _0x3ba856;var _0x15a0e0;return db[_0xf08f('0x26')][_0xf08f('0x4a')]({'where':{'id':_0x34ac4b['params']['id']}})['then'](handleEntityNotFound(_0x31fafb,null))[_0xf08f('0x20')](function(_0x622562){if(_0x622562){_0x3ba856=_0x622562;_0x53bbe9[_0xf08f('0x2a')]=_[_0xf08f('0x2d')](db[_0xf08f('0x4b')]['rawAttributes']);_0x53bbe9['query']=_['keys'](_0x34ac4b[_0xf08f('0x2c')]);_0x53bbe9[_0xf08f('0x2e')]=_[_0xf08f('0x2f')](_0x53bbe9[_0xf08f('0x2a')],_0x53bbe9[_0xf08f('0x2c')]);_0x3b84ac[_0xf08f('0x30')]=_[_0xf08f('0x2f')](_0x53bbe9[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0x34ac4b[_0xf08f('0x2c')]['fields']));_0x3b84ac[_0xf08f('0x30')]=_0x3b84ac['attributes'][_0xf08f('0x3c')]?_0x3b84ac['attributes']:_0x53bbe9[_0xf08f('0x2a')];_0x3b84ac[_0xf08f('0x34')]=qs['sort'](_0x34ac4b[_0xf08f('0x2c')]['sort']);_0x3b84ac[_0xf08f('0x36')]=qs[_0xf08f('0x2e')](_[_0xf08f('0x4c')](_0x34ac4b[_0xf08f('0x2c')],_0x53bbe9[_0xf08f('0x2e')]));if(_0x34ac4b['query'][_0xf08f('0x47')]){_0x3b84ac[_0xf08f('0x36')]=_[_0xf08f('0x37')](_0x3b84ac[_0xf08f('0x36')],{'$or':_[_0xf08f('0x25')](_0x3b84ac['attributes'],function(_0xa12d2d){var _0x1c2b46={};_0x1c2b46[_0xa12d2d]={'$like':'%'+_0x34ac4b['query'][_0xf08f('0x47')]+'%'};return _0x1c2b46;})});}_0x3b84ac=_[_0xf08f('0x37')]({},_0x3b84ac,_0x34ac4b[_0xf08f('0x38')]);return _0x3ba856[_0xf08f('0x49')](_0x3b84ac);}})[_0xf08f('0x20')](function(_0x317a3f){if(_0x317a3f){_0x15a0e0=_0x317a3f['length'];if(!_0x34ac4b['query'][_0xf08f('0x32')]('nolimit')){_0x3b84ac['limit']=qs[_0xf08f('0x1b')](_0x34ac4b[_0xf08f('0x2c')][_0xf08f('0x1b')]);_0x3b84ac['offset']=qs[_0xf08f('0x1a')](_0x34ac4b[_0xf08f('0x2c')][_0xf08f('0x1a')]);}return _0x3ba856[_0xf08f('0x49')](_0x3b84ac);}})[_0xf08f('0x20')](function(_0x25403a){if(_0x25403a){return _0x25403a?{'count':_0x15a0e0,'rows':_0x25403a}:null;}})[_0xf08f('0x20')](respondWithResult(_0x31fafb,null))[_0xf08f('0x3b')](handleError(_0x31fafb,null));};
\ No newline at end of file
+var _0x05e8=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','addConditions','ids','omit','getConditions','findOne','sort','addActions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Automation','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter'];(function(_0x33c1b1,_0x2355fb){var _0x2c2037=function(_0x1200fd){while(--_0x1200fd){_0x33c1b1['push'](_0x33c1b1['shift']());}};_0x2c2037(++_0x2355fb);}(_0x05e8,0x104));var _0x805e=function(_0x12b5f1,_0x2ad05e){_0x12b5f1=_0x12b5f1-0x0;var _0x5f2511=_0x05e8[_0x12b5f1];return _0x5f2511;};'use strict';var emlformat=require(_0x805e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x805e('0x1'));var rp=require(_0x805e('0x2'));var moment=require(_0x805e('0x3'));var BPromise=require(_0x805e('0x4'));var Mustache=require('mustache');var util=require(_0x805e('0x5'));var path=require(_0x805e('0x6'));var sox=require(_0x805e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x805e('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x805e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x805e('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x805e('0xb'));var authService=require(_0x805e('0xc'));var qs=require(_0x805e('0xd'));var as=require(_0x805e('0xe'));var hardwareService=require(_0x805e('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x805e('0x10'));var licenseUtil=require(_0x805e('0x11'));var db=require(_0x805e('0x12'))['db'];function respondWithStatusCode(_0x18bb8e,_0x368f18){_0x368f18=_0x368f18||0xcc;return function(_0x588a7f){if(_0x588a7f){return _0x18bb8e[_0x805e('0x13')](_0x368f18);}return _0x18bb8e[_0x805e('0x14')](_0x368f18)[_0x805e('0x15')]();};}function respondWithResult(_0x28f8a4,_0x508767){_0x508767=_0x508767||0xc8;return function(_0x43b478){if(_0x43b478){return _0x28f8a4['status'](_0x508767)['json'](_0x43b478);}};}function respondWithFilteredResult(_0x5366f0,_0x2e0ec3){return function(_0x9d8944){if(_0x9d8944){var _0x51feb8=typeof _0x2e0ec3[_0x805e('0x16')]==='undefined'&&typeof _0x2e0ec3[_0x805e('0x17')]===_0x805e('0x18');var _0x4ea9fa=_0x9d8944[_0x805e('0x19')];var _0x40de42=_0x51feb8?0x0:_0x2e0ec3[_0x805e('0x16')];var _0x5641f1=_0x51feb8?_0x9d8944['count']:_0x2e0ec3[_0x805e('0x16')]+_0x2e0ec3['limit'];var _0x50b630;if(_0x5641f1>=_0x4ea9fa){_0x5641f1=_0x4ea9fa;_0x50b630=0xc8;}else{_0x50b630=0xce;}_0x5366f0[_0x805e('0x14')](_0x50b630);return _0x5366f0[_0x805e('0x1a')](_0x805e('0x1b'),_0x40de42+'-'+_0x5641f1+'/'+_0x4ea9fa)[_0x805e('0x1c')](_0x9d8944);}return null;};}function patchUpdates(_0x398635){return function(_0x30cc53){try{jsonpatch[_0x805e('0x1d')](_0x30cc53,_0x398635,!![]);}catch(_0x19417){return BPromise[_0x805e('0x1e')](_0x19417);}return _0x30cc53[_0x805e('0x1f')]();};}function saveUpdates(_0x10182a,_0x5669ea){return function(_0xb0a263){if(_0xb0a263){return _0xb0a263[_0x805e('0x20')](_0x10182a)[_0x805e('0x21')](function(_0x41157f){return _0x41157f;});}return null;};}function removeEntity(_0x4cb96d,_0x43ec9a){return function(_0x54650b){if(_0x54650b){return _0x54650b[_0x805e('0x22')]()[_0x805e('0x21')](function(){_0x4cb96d[_0x805e('0x14')](0xcc)[_0x805e('0x15')]();});}};}function handleEntityNotFound(_0x66f9fa,_0x3f78cc){return function(_0x2ca1fa){if(!_0x2ca1fa){_0x66f9fa[_0x805e('0x13')](0x194);}return _0x2ca1fa;};}function handleError(_0x31ea9f,_0x559a99){_0x559a99=_0x559a99||0x1f4;return function(_0x12a40c){logger[_0x805e('0x23')](_0x12a40c['stack']);if(_0x12a40c['name']){delete _0x12a40c[_0x805e('0x24')];}_0x31ea9f[_0x805e('0x14')](_0x559a99)[_0x805e('0x25')](_0x12a40c);};}exports[_0x805e('0x26')]=function(_0x52497c,_0xc450e1){var _0x51022={},_0x3dd5cf={},_0x11f00b={'count':0x0,'rows':[]};var _0x319992=_[_0x805e('0x27')](db[_0x805e('0x28')]['rawAttributes'],function(_0x29d9a9){return{'name':_0x29d9a9['fieldName'],'type':_0x29d9a9[_0x805e('0x29')]['key']};});_0x3dd5cf[_0x805e('0x2a')]=_['map'](_0x319992,'name');_0x3dd5cf[_0x805e('0x2b')]=_[_0x805e('0x2c')](_0x52497c['query']);_0x3dd5cf[_0x805e('0x2d')]=_[_0x805e('0x2e')](_0x3dd5cf['model'],_0x3dd5cf[_0x805e('0x2b')]);_0x51022[_0x805e('0x2f')]=_[_0x805e('0x2e')](_0x3dd5cf[_0x805e('0x2a')],qs[_0x805e('0x30')](_0x52497c[_0x805e('0x2b')][_0x805e('0x30')]));_0x51022['attributes']=_0x51022[_0x805e('0x2f')][_0x805e('0x31')]?_0x51022['attributes']:_0x3dd5cf[_0x805e('0x2a')];if(!_0x52497c[_0x805e('0x2b')][_0x805e('0x32')](_0x805e('0x33'))){_0x51022[_0x805e('0x17')]=qs[_0x805e('0x17')](_0x52497c[_0x805e('0x2b')][_0x805e('0x17')]);_0x51022[_0x805e('0x16')]=qs[_0x805e('0x16')](_0x52497c['query'][_0x805e('0x16')]);}_0x51022[_0x805e('0x34')]=qs['sort'](_0x52497c[_0x805e('0x2b')]['sort']);_0x51022[_0x805e('0x35')]=qs[_0x805e('0x2d')](_[_0x805e('0x36')](_0x52497c['query'],_0x3dd5cf[_0x805e('0x2d')]),_0x319992);if(_0x52497c[_0x805e('0x2b')][_0x805e('0x37')]){_0x51022[_0x805e('0x35')]=_[_0x805e('0x38')](_0x51022['where'],{'$or':_['map'](_0x319992,function(_0x3497d1){if(_0x3497d1['type']!==_0x805e('0x39')){var _0x50b080={};_0x50b080[_0x3497d1['name']]={'$like':'%'+_0x52497c[_0x805e('0x2b')][_0x805e('0x37')]+'%'};return _0x50b080;}})});}_0x51022=_[_0x805e('0x38')]({},_0x51022,_0x52497c[_0x805e('0x3a')]);var _0x577f11={'where':_0x51022[_0x805e('0x35')]};return db[_0x805e('0x28')][_0x805e('0x19')](_0x577f11)[_0x805e('0x21')](function(_0x46b92e){_0x11f00b[_0x805e('0x19')]=_0x46b92e;if(_0x52497c[_0x805e('0x2b')][_0x805e('0x3b')]){_0x51022[_0x805e('0x3c')]=[{'all':!![]}];}return db[_0x805e('0x28')][_0x805e('0x3d')](_0x51022);})[_0x805e('0x21')](function(_0x44ad56){_0x11f00b[_0x805e('0x3e')]=_0x44ad56;return _0x11f00b;})[_0x805e('0x21')](respondWithFilteredResult(_0xc450e1,_0x51022))['catch'](handleError(_0xc450e1,null));};exports[_0x805e('0x3f')]=function(_0x4500ce,_0x24d727){var _0x24b051={'raw':![],'where':{'id':_0x4500ce[_0x805e('0x40')]['id']}},_0x7beca4={};_0x7beca4['model']=_['keys'](db[_0x805e('0x28')][_0x805e('0x41')]);_0x7beca4['query']=_[_0x805e('0x2c')](_0x4500ce[_0x805e('0x2b')]);_0x7beca4[_0x805e('0x2d')]=_[_0x805e('0x2e')](_0x7beca4['model'],_0x7beca4['query']);_0x24b051[_0x805e('0x2f')]=_[_0x805e('0x2e')](_0x7beca4[_0x805e('0x2a')],qs['fields'](_0x4500ce['query'][_0x805e('0x30')]));_0x24b051[_0x805e('0x2f')]=_0x24b051[_0x805e('0x2f')][_0x805e('0x31')]?_0x24b051[_0x805e('0x2f')]:_0x7beca4[_0x805e('0x2a')];if(_0x4500ce[_0x805e('0x2b')]['includeAll']){_0x24b051[_0x805e('0x3c')]=[{'all':!![]}];}_0x24b051=_['merge']({},_0x24b051,_0x4500ce['options']);return db[_0x805e('0x28')][_0x805e('0x42')](_0x24b051)[_0x805e('0x21')](handleEntityNotFound(_0x24d727,null))[_0x805e('0x21')](respondWithResult(_0x24d727,null))[_0x805e('0x43')](handleError(_0x24d727,null));};exports[_0x805e('0x44')]=function(_0x2751f7,_0x275a86){return db[_0x805e('0x28')][_0x805e('0x44')](_0x2751f7[_0x805e('0x45')],{})[_0x805e('0x21')](respondWithResult(_0x275a86,0xc9))[_0x805e('0x43')](handleError(_0x275a86,null));};exports['update']=function(_0x3425ce,_0x3b1ac8){if(_0x3425ce[_0x805e('0x45')]['id']){delete _0x3425ce[_0x805e('0x45')]['id'];}return db[_0x805e('0x28')][_0x805e('0x42')]({'where':{'id':_0x3425ce[_0x805e('0x40')]['id']}})[_0x805e('0x21')](handleEntityNotFound(_0x3b1ac8,null))[_0x805e('0x21')](saveUpdates(_0x3425ce[_0x805e('0x45')],null))[_0x805e('0x21')](respondWithResult(_0x3b1ac8,null))[_0x805e('0x43')](handleError(_0x3b1ac8,null));};exports[_0x805e('0x22')]=function(_0x12a78f,_0x4f4c42){return db['Automation'][_0x805e('0x42')]({'where':{'id':_0x12a78f['params']['id']}})[_0x805e('0x21')](handleEntityNotFound(_0x4f4c42,null))['then'](removeEntity(_0x4f4c42,null))[_0x805e('0x43')](handleError(_0x4f4c42,null));};exports[_0x805e('0x46')]=function(_0x2f00ac,_0x2fa306,_0x30e6ab){return db['Condition'][_0x805e('0x42')]({'where':{'id':_0x2f00ac[_0x805e('0x40')]['id']}})['then'](handleEntityNotFound(_0x2fa306,null))[_0x805e('0x21')](function(_0x3484ea){if(_0x3484ea){return _0x3484ea['addConditions'](_0x2f00ac[_0x805e('0x45')][_0x805e('0x47')],_[_0x805e('0x48')](_0x2f00ac[_0x805e('0x45')],[_0x805e('0x47'),'id'])||{});}})[_0x805e('0x21')](respondWithResult(_0x2fa306,null))[_0x805e('0x43')](handleError(_0x2fa306,null));};exports[_0x805e('0x49')]=function(_0x53959e,_0x3ff8b5,_0x30cce6){var _0x550f7b={};var _0x66c671={};var _0x43ce67;var _0x173d22;return db[_0x805e('0x28')][_0x805e('0x4a')]({'where':{'id':_0x53959e['params']['id']}})['then'](handleEntityNotFound(_0x3ff8b5,null))[_0x805e('0x21')](function(_0x526610){if(_0x526610){_0x43ce67=_0x526610;_0x66c671[_0x805e('0x2a')]=_[_0x805e('0x2c')](db['Condition'][_0x805e('0x41')]);_0x66c671[_0x805e('0x2b')]=_[_0x805e('0x2c')](_0x53959e['query']);_0x66c671[_0x805e('0x2d')]=_[_0x805e('0x2e')](_0x66c671[_0x805e('0x2a')],_0x66c671[_0x805e('0x2b')]);_0x550f7b[_0x805e('0x2f')]=_[_0x805e('0x2e')](_0x66c671[_0x805e('0x2a')],qs[_0x805e('0x30')](_0x53959e[_0x805e('0x2b')][_0x805e('0x30')]));_0x550f7b[_0x805e('0x2f')]=_0x550f7b['attributes'][_0x805e('0x31')]?_0x550f7b[_0x805e('0x2f')]:_0x66c671[_0x805e('0x2a')];_0x550f7b['order']=qs[_0x805e('0x4b')](_0x53959e[_0x805e('0x2b')][_0x805e('0x4b')]);_0x550f7b['where']=qs['filters'](_[_0x805e('0x36')](_0x53959e[_0x805e('0x2b')],_0x66c671[_0x805e('0x2d')]));if(_0x53959e[_0x805e('0x2b')][_0x805e('0x37')]){_0x550f7b[_0x805e('0x35')]=_[_0x805e('0x38')](_0x550f7b[_0x805e('0x35')],{'$or':_[_0x805e('0x27')](_0x550f7b[_0x805e('0x2f')],function(_0x3579e9){var _0x2046b4={};_0x2046b4[_0x3579e9]={'$like':'%'+_0x53959e[_0x805e('0x2b')]['filter']+'%'};return _0x2046b4;})});}_0x550f7b=_['merge']({},_0x550f7b,_0x53959e['options']);return _0x43ce67['getConditions'](_0x550f7b);}})['then'](function(_0x555e29){if(_0x555e29){_0x173d22=_0x555e29[_0x805e('0x31')];if(!_0x53959e[_0x805e('0x2b')][_0x805e('0x32')](_0x805e('0x33'))){_0x550f7b['limit']=qs[_0x805e('0x17')](_0x53959e[_0x805e('0x2b')][_0x805e('0x17')]);_0x550f7b[_0x805e('0x16')]=qs[_0x805e('0x16')](_0x53959e['query'][_0x805e('0x16')]);}return _0x43ce67['getConditions'](_0x550f7b);}})[_0x805e('0x21')](function(_0x3cac22){if(_0x3cac22){return _0x3cac22?{'count':_0x173d22,'rows':_0x3cac22}:null;}})[_0x805e('0x21')](respondWithResult(_0x3ff8b5,null))[_0x805e('0x43')](handleError(_0x3ff8b5,null));};exports[_0x805e('0x4c')]=function(_0x2454ab,_0xa413b2,_0x235fe1){return db[_0x805e('0x4d')][_0x805e('0x42')]({'where':{'id':_0x2454ab[_0x805e('0x40')]['id']}})['then'](handleEntityNotFound(_0xa413b2,null))[_0x805e('0x21')](function(_0x59cfbd){if(_0x59cfbd){return _0x59cfbd[_0x805e('0x4c')](_0x2454ab[_0x805e('0x45')][_0x805e('0x47')],_[_0x805e('0x48')](_0x2454ab[_0x805e('0x45')],[_0x805e('0x47'),'id'])||{});}})[_0x805e('0x21')](respondWithResult(_0xa413b2,null))[_0x805e('0x43')](handleError(_0xa413b2,null));};exports[_0x805e('0x4e')]=function(_0xc9bcbd,_0x43e9fc,_0xd9a853){var _0xd2bc51={};var _0xa29893={};var _0xe308fe;var _0xf8a64c;return db[_0x805e('0x28')][_0x805e('0x4a')]({'where':{'id':_0xc9bcbd[_0x805e('0x40')]['id']}})['then'](handleEntityNotFound(_0x43e9fc,null))[_0x805e('0x21')](function(_0x916c2f){if(_0x916c2f){_0xe308fe=_0x916c2f;_0xa29893['model']=_['keys'](db[_0x805e('0x4d')][_0x805e('0x41')]);_0xa29893[_0x805e('0x2b')]=_[_0x805e('0x2c')](_0xc9bcbd[_0x805e('0x2b')]);_0xa29893['filters']=_['intersection'](_0xa29893[_0x805e('0x2a')],_0xa29893['query']);_0xd2bc51[_0x805e('0x2f')]=_[_0x805e('0x2e')](_0xa29893[_0x805e('0x2a')],qs[_0x805e('0x30')](_0xc9bcbd[_0x805e('0x2b')][_0x805e('0x30')]));_0xd2bc51['attributes']=_0xd2bc51[_0x805e('0x2f')][_0x805e('0x31')]?_0xd2bc51['attributes']:_0xa29893[_0x805e('0x2a')];_0xd2bc51[_0x805e('0x34')]=qs[_0x805e('0x4b')](_0xc9bcbd['query'][_0x805e('0x4b')]);_0xd2bc51[_0x805e('0x35')]=qs['filters'](_[_0x805e('0x36')](_0xc9bcbd[_0x805e('0x2b')],_0xa29893[_0x805e('0x2d')]));if(_0xc9bcbd[_0x805e('0x2b')]['filter']){_0xd2bc51[_0x805e('0x35')]=_[_0x805e('0x38')](_0xd2bc51[_0x805e('0x35')],{'$or':_['map'](_0xd2bc51[_0x805e('0x2f')],function(_0x1b5b06){var _0x33c2a3={};_0x33c2a3[_0x1b5b06]={'$like':'%'+_0xc9bcbd[_0x805e('0x2b')][_0x805e('0x37')]+'%'};return _0x33c2a3;})});}_0xd2bc51=_[_0x805e('0x38')]({},_0xd2bc51,_0xc9bcbd['options']);return _0xe308fe['getActions'](_0xd2bc51);}})[_0x805e('0x21')](function(_0x134f12){if(_0x134f12){_0xf8a64c=_0x134f12[_0x805e('0x31')];if(!_0xc9bcbd[_0x805e('0x2b')][_0x805e('0x32')](_0x805e('0x33'))){_0xd2bc51['limit']=qs['limit'](_0xc9bcbd['query'][_0x805e('0x17')]);_0xd2bc51['offset']=qs['offset'](_0xc9bcbd[_0x805e('0x2b')][_0x805e('0x16')]);}return _0xe308fe[_0x805e('0x4e')](_0xd2bc51);}})['then'](function(_0x2631fa){if(_0x2631fa){return _0x2631fa?{'count':_0xf8a64c,'rows':_0x2631fa}:null;}})[_0x805e('0x21')](respondWithResult(_0x43e9fc,null))[_0x805e('0x43')](handleError(_0x43e9fc,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index dc5ebe2..0851da5 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 _0x8a11=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations'];(function(_0x260072,_0x163b97){var _0x28380a=function(_0x2aba52){while(--_0x2aba52){_0x260072['push'](_0x260072['shift']());}};_0x28380a(++_0x163b97);}(_0x8a11,0x84));var _0x18a1=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x8a11[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require(_0x18a1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x18a1('0x1'));var moment=require(_0x18a1('0x2'));var BPromise=require(_0x18a1('0x3'));var rp=require(_0x18a1('0x4'));var fs=require('fs');var path=require(_0x18a1('0x5'));var rimraf=require(_0x18a1('0x6'));var config=require(_0x18a1('0x7'));var attributes=require(_0x18a1('0x8'));module[_0x18a1('0x9')]=function(_0x58089f,_0x2e0370){return _0x58089f['define']('Automation',attributes,{'tableName':_0x18a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xba04=['../../config/logger','api','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util'];(function(_0x10dfc9,_0x25b62c){var _0x154afc=function(_0x5099ac){while(--_0x5099ac){_0x10dfc9['push'](_0x10dfc9['shift']());}};_0x154afc(++_0x25b62c);}(_0xba04,0x10f));var _0x4ba0=function(_0x859f36,_0x30dffb){_0x859f36=_0x859f36-0x0;var _0x35107b=_0xba04[_0x859f36];return _0x35107b;};'use strict';var _=require(_0x4ba0('0x0'));var util=require(_0x4ba0('0x1'));var logger=require(_0x4ba0('0x2'))(_0x4ba0('0x3'));var moment=require('moment');var BPromise=require(_0x4ba0('0x4'));var rp=require(_0x4ba0('0x5'));var fs=require('fs');var path=require(_0x4ba0('0x6'));var rimraf=require(_0x4ba0('0x7'));var config=require('../../config/environment');var attributes=require(_0x4ba0('0x8'));module[_0x4ba0('0x9')]=function(_0x145342,_0x392784){return _0x145342[_0x4ba0('0xa')](_0x4ba0('0xb'),attributes,{'tableName':_0x4ba0('0xc'),'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 5359c5d..ded4ffb 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 _0x349e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x349e,0xcb));var _0xe349=function(_0x41da72,_0x224fd6){_0x41da72=_0x41da72-0x0;var _0x36aade=_0x349e[_0x41da72];return _0x36aade;};'use strict';var _=require(_0xe349('0x0'));var util=require(_0xe349('0x1'));var moment=require(_0xe349('0x2'));var BPromise=require(_0xe349('0x3'));var rs=require(_0xe349('0x4'));var fs=require('fs');var Redis=require(_0xe349('0x5'));var db=require(_0xe349('0x6'))['db'];var utils=require(_0xe349('0x7'));var logger=require(_0xe349('0x8'))('rpc');var config=require(_0xe349('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe349('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494605,_0xcb9b49,_0x6efb47){return new BPromise(function(_0x535968,_0x114c1b){return client[_0xe349('0xb')](_0x494605,_0x6efb47)[_0xe349('0xc')](function(_0x7b08d2){logger[_0xe349('0xd')]('Automation,\x20%s,\x20%s',_0xcb9b49,_0xe349('0xe'));logger[_0xe349('0xf')](_0xe349('0x10'),_0xcb9b49,_0xe349('0xe'),JSON[_0xe349('0x11')](_0x7b08d2));if(_0x7b08d2[_0xe349('0x12')]){if(_0x7b08d2[_0xe349('0x12')][_0xe349('0x13')]===0x1f4){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);return _0x114c1b(_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);}logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')]['message']);return _0x535968(_0x7b08d2[_0xe349('0x12')]['message']);}else{logger[_0xe349('0xd')](_0xe349('0x14'),_0xcb9b49,_0xe349('0xe'));_0x535968(_0x7b08d2['result']['message']);}})[_0xe349('0x16')](function(_0x3ff17c){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x3ff17c);_0x114c1b(_0x3ff17c);});});}
\ No newline at end of file
+var _0x3f72=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x3f72,0xaf));var _0x23f7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3f72[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var moment=require(_0x23f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23f7('0x3'));var db=require(_0x23f7('0x4'))['db'];var utils=require(_0x23f7('0x5'));var logger=require(_0x23f7('0x6'))(_0x23f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x23f7('0x8'));var client=jayson['client'][_0x23f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cc54a,_0x23e468,_0x2db48b){return new BPromise(function(_0x412d29,_0x258026){return client[_0x23f7('0xa')](_0x5cc54a,_0x2db48b)[_0x23f7('0xb')](function(_0x3a048c){logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));logger['debug'](_0x23f7('0xf'),_0x23e468,_0x23f7('0xe'),JSON[_0x23f7('0x10')](_0x3a048c));if(_0x3a048c['error']){if(_0x3a048c['error'][_0x23f7('0x11')]===0x1f4){logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);return _0x258026(_0x3a048c['error'][_0x23f7('0x13')]);}logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')]['message']);return _0x412d29(_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);}else{logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));_0x412d29(_0x3a048c[_0x23f7('0x14')][_0x23f7('0x13')]);}})['catch'](function(_0x2669ab){logger[_0x23f7('0x12')]('Automation,\x20%s,\x20%s',_0x23e468,_0x2669ab);_0x258026(_0x2669ab);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index dcd6f8a..77f78ff 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 _0x7bb8=['isAuthenticated','index','show','get','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','/:id','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller'];(function(_0x2c05d6,_0xf8af3d){var _0xb11f76=function(_0x2b4052){while(--_0x2b4052){_0x2c05d6['push'](_0x2c05d6['shift']());}};_0xb11f76(++_0xf8af3d);}(_0x7bb8,0xe8));var _0x87bb=function(_0x350610,_0x3f4eef){_0x350610=_0x350610-0x0;var _0x3b33c6=_0x7bb8[_0x350610];return _0x3b33c6;};'use strict';var multer=require('multer');var util=require(_0x87bb('0x0'));var path=require(_0x87bb('0x1'));var timeout=require(_0x87bb('0x2'));var express=require(_0x87bb('0x3'));var router=express['Router']();var fs_extra=require(_0x87bb('0x4'));var auth=require(_0x87bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x87bb('0x6'));var controller=require(_0x87bb('0x7'));router['get']('/',auth[_0x87bb('0x8')](),controller[_0x87bb('0x9')]);router['get']('/:id',auth[_0x87bb('0x8')](),controller[_0x87bb('0xa')]);router[_0x87bb('0xb')]('/:id/conditions',auth[_0x87bb('0x8')](),controller[_0x87bb('0xc')]);router[_0x87bb('0xb')](_0x87bb('0xd'),auth[_0x87bb('0x8')](),controller[_0x87bb('0xe')]);router[_0x87bb('0xf')]('/',auth[_0x87bb('0x8')](),controller[_0x87bb('0x10')]);router[_0x87bb('0xf')](_0x87bb('0x11'),auth[_0x87bb('0x8')](),controller['addConditions']);router[_0x87bb('0xf')](_0x87bb('0xd'),auth[_0x87bb('0x8')](),controller[_0x87bb('0x12')]);router[_0x87bb('0x13')](_0x87bb('0x14'),auth['isAuthenticated'](),controller[_0x87bb('0x15')]);router[_0x87bb('0x16')](_0x87bb('0x14'),auth[_0x87bb('0x8')](),controller['destroy']);module[_0x87bb('0x17')]=router;
\ No newline at end of file
+var _0x6dd1=['getActions','create','post','addConditions','addActions','put','/:id','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id/conditions','getConditions','/:id/actions'];(function(_0x5aabcb,_0x219fbd){var _0x4b6e71=function(_0x1546ee){while(--_0x1546ee){_0x5aabcb['push'](_0x5aabcb['shift']());}};_0x4b6e71(++_0x219fbd);}(_0x6dd1,0x111));var _0x16dd=function(_0x33418d,_0x2aaedc){_0x33418d=_0x33418d-0x0;var _0x363ce2=_0x6dd1[_0x33418d];return _0x363ce2;};'use strict';var multer=require(_0x16dd('0x0'));var util=require('util');var path=require(_0x16dd('0x1'));var timeout=require(_0x16dd('0x2'));var express=require('express');var router=express[_0x16dd('0x3')]();var fs_extra=require(_0x16dd('0x4'));var auth=require(_0x16dd('0x5'));var interaction=require(_0x16dd('0x6'));var config=require(_0x16dd('0x7'));var controller=require(_0x16dd('0x8'));router[_0x16dd('0x9')]('/',auth[_0x16dd('0xa')](),controller[_0x16dd('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x16dd('0x9')](_0x16dd('0xc'),auth[_0x16dd('0xa')](),controller[_0x16dd('0xd')]);router['get'](_0x16dd('0xe'),auth['isAuthenticated'](),controller[_0x16dd('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x16dd('0x10')]);router[_0x16dd('0x11')]('/:id/conditions',auth[_0x16dd('0xa')](),controller[_0x16dd('0x12')]);router[_0x16dd('0x11')]('/:id/actions',auth[_0x16dd('0xa')](),controller[_0x16dd('0x13')]);router[_0x16dd('0x14')](_0x16dd('0x15'),auth[_0x16dd('0xa')](),controller['update']);router['delete'](_0x16dd('0x15'),auth['isAuthenticated'](),controller[_0x16dd('0x16')]);module[_0x16dd('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index dfcb05d..415217a 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 _0xa9bf=['UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER'];(function(_0x5c028c,_0x4fbf6d){var _0x9a4301=function(_0x27831a){while(--_0x27831a){_0x5c028c['push'](_0x5c028c['shift']());}};_0x9a4301(++_0x4fbf6d);}(_0xa9bf,0x136));var _0xfa9b=function(_0x51b8e7,_0x5c70fb){_0x51b8e7=_0x51b8e7-0x0;var _0x81fd25=_0xa9bf[_0x51b8e7];return _0x81fd25;};'use strict';var Sequelize=require(_0xfa9b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xfa9b('0x1')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xfa9b('0x2')],'defaultValue':0x0,'comment':_0xfa9b('0x3')},'limitCalls':{'type':Sequelize[_0xfa9b('0x4')](0x4)[_0xfa9b('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfa9b('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfa9b('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfa9b('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xfa9b('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xfa9b('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xfa9b('0xc')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xfa9b('0xd'),_0xfa9b('0xe'),_0xfa9b('0xf')),'defaultValue':_0xfa9b('0xd')},'dialAMDActive':{'type':Sequelize[_0xfa9b('0x2')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfa9b('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfa9b('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfa9b('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xfa9b('0x4')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfa9b('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfa9b('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfa9b('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xfa9b('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfa9b('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfa9b('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfa9b('0x17')](_0xfa9b('0x18'),'ASC'),'defaultValue':_0xfa9b('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfa9b('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa9b('0x19')},'dialCutDigit':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa9b('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x22')}};
\ No newline at end of file
+var _0xa270=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x1765c4,_0x151565){var _0x56645f=function(_0x12dfbe){while(--_0x12dfbe){_0x1765c4['push'](_0x1765c4['shift']());}};_0x56645f(++_0x151565);}(_0xa270,0x18d));var _0x0a27=function(_0x2dc6f2,_0x34fc64){_0x2dc6f2=_0x2dc6f2-0x0;var _0x4b7f98=_0xa270[_0x2dc6f2];return _0x4b7f98;};'use strict';var Sequelize=require(_0x0a27('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a27('0x1')],'unique':_0x0a27('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x0a27('0x1')]},'active':{'type':Sequelize[_0x0a27('0x3')],'defaultValue':0x0,'comment':_0x0a27('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0a27('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a27('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a27('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a27('0x6')](0x3)[_0x0a27('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a27('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a27('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0a27('0x6')](0x5)[_0x0a27('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a27('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a27('0x6')](0x3)[_0x0a27('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a27('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a27('0x6')](0x5)[_0x0a27('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a27('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a27('0x6')](0x3)[_0x0a27('0x5')],'defaultValue':0x3,'comment':_0x0a27('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a27('0x6')](0x5)[_0x0a27('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a27('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a27('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a27('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a27('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x0a27('0xe')](_0x0a27('0xf'),_0x0a27('0x10'),_0x0a27('0x11')),'defaultValue':_0x0a27('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0a27('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a27('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x0a27('0x6')](0x9)[_0x0a27('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a27('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a27('0x6')](0x9)[_0x0a27('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a27('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a27('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a27('0x6')](0x9)[_0x0a27('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a27('0x6')](0x9)[_0x0a27('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0a27('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0a27('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0a27('0x6')](0x5)[_0x0a27('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a27('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a27('0x6')](0x9)[_0x0a27('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a27('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0a27('0xe')](_0x0a27('0x19'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0a27('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0a27('0x6')](0x3)[_0x0a27('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a27('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a27('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a27('0x6')](0x3)[_0x0a27('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a27('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a27('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x0a27('0x6')](0x3)[_0x0a27('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x0a27('0x6')](0x5)[_0x0a27('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a27('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0a27('0x6')](0x3)[_0x0a27('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a27('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a27('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a27('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a27('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a27('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a27('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a27('0x6')](0x3)[_0x0a27('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a27('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a27('0x5')],'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 bebed2f..aa29d9f 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 _0xbca8=['hasOwnProperty','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','NOW()','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','apply','reject','then','destroy','get','IvrCampaigns','end','error','name','send','map','Campaign','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','clone','params','options','createdAt','updatedAt','body','omit','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper'];(function(_0x2a4d83,_0x2f548c){var _0x1f223d=function(_0x513327){while(--_0x513327){_0x2a4d83['push'](_0x2a4d83['shift']());}};_0x1f223d(++_0x2f548c);}(_0xbca8,0xcc));var _0x8bca=function(_0x40d342,_0x110e54){_0x40d342=_0x40d342-0x0;var _0x153c50=_0xbca8[_0x40d342];return _0x153c50;};'use strict';var emlformat=require(_0x8bca('0x0'));var rimraf=require(_0x8bca('0x1'));var zipdir=require(_0x8bca('0x2'));var jsonpatch=require(_0x8bca('0x3'));var rp=require(_0x8bca('0x4'));var moment=require('moment');var BPromise=require(_0x8bca('0x5'));var Mustache=require(_0x8bca('0x6'));var util=require(_0x8bca('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8bca('0x8'));var ejs=require(_0x8bca('0x9'));var fs=require('fs');var fs_extra=require(_0x8bca('0xa'));var _=require(_0x8bca('0xb'));var squel=require('squel');var crypto=require(_0x8bca('0xc'));var jsforce=require(_0x8bca('0xd'));var deskjs=require(_0x8bca('0xe'));var toCsv=require(_0x8bca('0x8'));var querystring=require(_0x8bca('0xf'));var Papa=require(_0x8bca('0x10'));var Redis=require(_0x8bca('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8bca('0x12'));var hardwareService=require(_0x8bca('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8bca('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8bca('0x15'));var db=require(_0x8bca('0x16'))['db'];function respondWithStatusCode(_0x5eec01,_0x62c6d1){_0x62c6d1=_0x62c6d1||0xcc;return function(_0x1fe1b5){if(_0x1fe1b5){return _0x5eec01[_0x8bca('0x17')](_0x62c6d1);}return _0x5eec01[_0x8bca('0x18')](_0x62c6d1)['end']();};}function respondWithResult(_0x4bbf5c,_0x250d09){_0x250d09=_0x250d09||0xc8;return function(_0x59b65b){if(_0x59b65b){return _0x4bbf5c[_0x8bca('0x18')](_0x250d09)[_0x8bca('0x19')](_0x59b65b);}};}function respondWithFilteredResult(_0x145cfd,_0x2e3633){return function(_0x1c3590){if(_0x1c3590){var _0x1c78d5=typeof _0x2e3633['offset']==='undefined'&&typeof _0x2e3633[_0x8bca('0x1a')]==='undefined';var _0x2bd7b1=_0x1c3590[_0x8bca('0x1b')];var _0x4e24c8=_0x1c78d5?0x0:_0x2e3633['offset'];var _0x5622ba=_0x1c78d5?_0x1c3590[_0x8bca('0x1b')]:_0x2e3633[_0x8bca('0x1c')]+_0x2e3633['limit'];var _0x1a834c;if(_0x5622ba>=_0x2bd7b1){_0x5622ba=_0x2bd7b1;_0x1a834c=0xc8;}else{_0x1a834c=0xce;}_0x145cfd['status'](_0x1a834c);return _0x145cfd['set']('Content-Range',_0x4e24c8+'-'+_0x5622ba+'/'+_0x2bd7b1)[_0x8bca('0x19')](_0x1c3590);}return null;};}function patchUpdates(_0x17046f){return function(_0xdafaa1){try{jsonpatch[_0x8bca('0x1d')](_0xdafaa1,_0x17046f,!![]);}catch(_0x2d64cd){return BPromise[_0x8bca('0x1e')](_0x2d64cd);}return _0xdafaa1['save']();};}function saveUpdates(_0x315a59,_0x20dc10){return function(_0xf3296b){if(_0xf3296b){return _0xf3296b['update'](_0x315a59)[_0x8bca('0x1f')](function(_0x5ac207){return _0x5ac207;});}return null;};}function removeEntity(_0x1f014d,_0x4e4bff){return function(_0x2e3522){if(_0x2e3522){return _0x2e3522[_0x8bca('0x20')]()[_0x8bca('0x1f')](function(){var _0x8620e2=_0x2e3522[_0x8bca('0x21')]({'plain':!![]});var _0x3a7498=_0x8bca('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a7498,'resourceId':_0x8620e2['id']}})[_0x8bca('0x1f')](function(){return _0x2e3522;});})[_0x8bca('0x1f')](function(){_0x1f014d['status'](0xcc)[_0x8bca('0x23')]();});}};}function handleEntityNotFound(_0x706106,_0x103b53){return function(_0x344eae){if(!_0x344eae){_0x706106[_0x8bca('0x17')](0x194);}return _0x344eae;};}function handleError(_0x54ccae,_0x4767b5){_0x4767b5=_0x4767b5||0x1f4;return function(_0x58bfda){logger[_0x8bca('0x24')](_0x58bfda['stack']);if(_0x58bfda[_0x8bca('0x25')]){delete _0x58bfda[_0x8bca('0x25')];}_0x54ccae[_0x8bca('0x18')](_0x4767b5)[_0x8bca('0x26')](_0x58bfda);};}exports['index']=function(_0x252819,_0x429c3a){var _0x288f99={},_0x543897={},_0x539f7e={'count':0x0,'rows':[]};var _0x4dc8ef=_[_0x8bca('0x27')](db[_0x8bca('0x28')][_0x8bca('0x29')],function(_0x5b13a1){return{'name':_0x5b13a1[_0x8bca('0x2a')],'type':_0x5b13a1[_0x8bca('0x2b')]['key']};});_0x543897[_0x8bca('0x2c')]=_[_0x8bca('0x27')](_0x4dc8ef,_0x8bca('0x25'));_0x543897[_0x8bca('0x2d')]=_[_0x8bca('0x2e')](_0x252819['query']);_0x543897[_0x8bca('0x2f')]=_[_0x8bca('0x30')](_0x543897[_0x8bca('0x2c')],_0x543897[_0x8bca('0x2d')]);_0x288f99[_0x8bca('0x31')]=_['intersection'](_0x543897[_0x8bca('0x2c')],qs['fields'](_0x252819['query'][_0x8bca('0x32')]));_0x288f99[_0x8bca('0x31')]=_0x288f99['attributes']['length']?_0x288f99[_0x8bca('0x31')]:_0x543897[_0x8bca('0x2c')];if(!_0x252819[_0x8bca('0x2d')]['hasOwnProperty'](_0x8bca('0x33'))){_0x288f99['limit']=qs[_0x8bca('0x1a')](_0x252819[_0x8bca('0x2d')]['limit']);_0x288f99[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x252819[_0x8bca('0x2d')]['offset']);}_0x288f99[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x252819['query']['sort']);_0x288f99[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x252819['query'],_0x543897[_0x8bca('0x2f')]),_0x4dc8ef);if(_0x252819[_0x8bca('0x2d')][_0x8bca('0x37')]){_0x288f99[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x288f99[_0x8bca('0x36')],{'$or':_['map'](_0x4dc8ef,function(_0x150b0d){if(_0x150b0d[_0x8bca('0x2b')]!==_0x8bca('0x39')){var _0x8873d1={};_0x8873d1[_0x150b0d[_0x8bca('0x25')]]={'$like':'%'+_0x252819[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x8873d1;}})});}_0x288f99=_[_0x8bca('0x38')]({},_0x288f99,_0x252819['options']);var _0x4c01f7={'where':_0x288f99[_0x8bca('0x36')]};return db[_0x8bca('0x28')]['count'](_0x4c01f7)[_0x8bca('0x1f')](function(_0x2bc3ff){_0x539f7e[_0x8bca('0x1b')]=_0x2bc3ff;if(_0x252819[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x288f99[_0x8bca('0x3b')]=[{'all':!![]}];}return db[_0x8bca('0x28')][_0x8bca('0x3c')](_0x288f99);})[_0x8bca('0x1f')](function(_0x4b2839){_0x539f7e[_0x8bca('0x3d')]=_0x4b2839;return _0x539f7e;})['then'](respondWithFilteredResult(_0x429c3a,_0x288f99))[_0x8bca('0x3e')](handleError(_0x429c3a,null));};exports[_0x8bca('0x3f')]=function(_0x23bd03,_0x11a4be){var _0x291a77={'raw':![],'where':{'id':_0x23bd03['params']['id']}},_0x165404={};_0x165404[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db['Campaign'][_0x8bca('0x29')]);_0x165404['query']=_['keys'](_0x23bd03['query']);_0x165404['filters']=_[_0x8bca('0x30')](_0x165404[_0x8bca('0x2c')],_0x165404[_0x8bca('0x2d')]);_0x291a77[_0x8bca('0x31')]=_['intersection'](_0x165404[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x23bd03[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x291a77['attributes']=_0x291a77[_0x8bca('0x31')][_0x8bca('0x40')]?_0x291a77[_0x8bca('0x31')]:_0x165404[_0x8bca('0x2c')];if(_0x23bd03[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x291a77[_0x8bca('0x3b')]=[{'all':!![]}];}_0x291a77=_[_0x8bca('0x38')]({},_0x291a77,_0x23bd03['options']);return db[_0x8bca('0x28')][_0x8bca('0x41')](_0x291a77)['then'](handleEntityNotFound(_0x11a4be,null))['then'](respondWithResult(_0x11a4be,null))[_0x8bca('0x3e')](handleError(_0x11a4be,null));};exports[_0x8bca('0x42')]=function(_0x41379f,_0x58a6c0){return db[_0x8bca('0x28')][_0x8bca('0x42')](_0x41379f['body'],{})[_0x8bca('0x1f')](function(_0x123e37){var _0x32e030=_0x41379f[_0x8bca('0x43')]['get']({'plain':!![]});if(!_0x32e030)throw new Error(_0x8bca('0x44'));if(_0x32e030[_0x8bca('0x45')]==='user'){var _0x3174b0=_0x123e37[_0x8bca('0x21')]({'plain':!![]});var _0x16dfb9='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x16dfb9,'userProfileId':_0x32e030[_0x8bca('0x46')]},'raw':!![]})['then'](function(_0x3547bd){if(_0x3547bd&&_0x3547bd[_0x8bca('0x47')]===0x0){return db['UserProfileResource'][_0x8bca('0x42')]({'name':_0x3174b0[_0x8bca('0x25')],'resourceId':_0x3174b0['id'],'type':_0x3547bd['name'],'sectionId':_0x3547bd['id']},{})[_0x8bca('0x1f')](function(){return _0x123e37;});}else{return _0x123e37;}})[_0x8bca('0x3e')](function(_0x5b4ffd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b4ffd);throw _0x5b4ffd;});}return _0x123e37;})[_0x8bca('0x1f')](respondWithResult(_0x58a6c0,0xc9))[_0x8bca('0x3e')](handleError(_0x58a6c0,null));};exports[_0x8bca('0x48')]=function(_0x134d07,_0x5c14dd){var _0xc2ec12={'where':{'id':_0x134d07[_0x8bca('0x49')]['id']}},_0x6e7dd7={};_0x6e7dd7[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db[_0x8bca('0x28')][_0x8bca('0x29')]);_0xc2ec12[_0x8bca('0x31')]=_[_0x8bca('0x30')](_0x6e7dd7[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x134d07[_0x8bca('0x2d')][_0x8bca('0x32')]));_0xc2ec12[_0x8bca('0x31')]=_0xc2ec12[_0x8bca('0x31')]['length']?_0xc2ec12[_0x8bca('0x31')]:_0x6e7dd7[_0x8bca('0x2c')];if(_0x134d07['query'][_0x8bca('0x3a')]){_0xc2ec12[_0x8bca('0x3b')]=[{'all':!![]}];}_0xc2ec12=_[_0x8bca('0x38')]({},_0xc2ec12,_0x134d07[_0x8bca('0x4a')]);return db[_0x8bca('0x28')][_0x8bca('0x41')](_0xc2ec12)[_0x8bca('0x1f')](handleEntityNotFound(_0x5c14dd,null))[_0x8bca('0x1f')](function(_0x2ce8fb){if(_0x2ce8fb){var _0x411772=_0x2ce8fb[_0x8bca('0x21')]({'plain':!![]});_0x411772=qs['omit'](_0x411772,['id',_0x8bca('0x4b'),_0x8bca('0x4c')]);_0x134d07[_0x8bca('0x4d')]=_[_0x8bca('0x4e')](_0x134d07['body'],['id',_0x8bca('0x4b'),_0x8bca('0x4c')]);return db[_0x8bca('0x28')][_0x8bca('0x42')](_['merge'](_0x411772,_0x134d07[_0x8bca('0x4d')]),{'include':_0x134d07[_0x8bca('0x2d')][_0x8bca('0x3a')]?[{'all':!![]}]:undefined})[_0x8bca('0x1f')](function(_0x1d3975){var _0x13d038=_0x134d07[_0x8bca('0x43')][_0x8bca('0x21')]({'plain':!![]});if(!_0x13d038)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13d038['role']===_0x8bca('0x43')){var _0x1d9b41=_0x1d3975[_0x8bca('0x21')]({'plain':!![]});var _0x30f6b3=_0x8bca('0x22');return db[_0x8bca('0x4f')]['find']({'where':{'name':_0x30f6b3,'userProfileId':_0x13d038[_0x8bca('0x46')]},'raw':!![]})['then'](function(_0x1672fe){if(_0x1672fe&&_0x1672fe['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1d9b41[_0x8bca('0x25')],'resourceId':_0x1d9b41['id'],'type':_0x1672fe[_0x8bca('0x25')],'sectionId':_0x1672fe['id']},{})[_0x8bca('0x1f')](function(){return _0x1d3975;});}else{return _0x1d3975;}})[_0x8bca('0x3e')](function(_0x153116){logger['error'](_0x8bca('0x50'),_0x153116);throw _0x153116;});}return _0x1d3975;});}})[_0x8bca('0x1f')](respondWithResult(_0x5c14dd,0xc9))[_0x8bca('0x3e')](handleError(_0x5c14dd,null));};exports[_0x8bca('0x51')]=function(_0x17cb8e,_0x1133fe){if(_0x17cb8e['body']['id']){delete _0x17cb8e['body']['id'];}return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x17cb8e['params']['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x1133fe,null))[_0x8bca('0x1f')](saveUpdates(_0x17cb8e[_0x8bca('0x4d')],null))[_0x8bca('0x1f')](respondWithResult(_0x1133fe,null))[_0x8bca('0x3e')](handleError(_0x1133fe,null));};exports[_0x8bca('0x20')]=function(_0x2621ac,_0x3e8058){return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x2621ac['params']['id']}})['then'](handleEntityNotFound(_0x3e8058,null))[_0x8bca('0x1f')](removeEntity(_0x3e8058,null))[_0x8bca('0x3e')](handleError(_0x3e8058,null));};exports[_0x8bca('0x52')]=function(_0x12ab81,_0x33d117,_0x26f374){var _0x18c6cb={'raw':!![],'where':{}};var _0x4dd3d5={};var _0x35e6eb={'count':0x0,'rows':[]};return db[_0x8bca('0x28')]['findOne']({'where':{'id':_0x12ab81[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x33d117,null))[_0x8bca('0x1f')](function(_0x243988){if(_0x243988){_0x4dd3d5['model']=_[_0x8bca('0x2e')](db[_0x8bca('0x53')][_0x8bca('0x29')]);_0x4dd3d5[_0x8bca('0x2d')]=_[_0x8bca('0x2e')](_0x12ab81[_0x8bca('0x2d')]);_0x4dd3d5[_0x8bca('0x2f')]=_['intersection'](_0x4dd3d5['model'],_0x4dd3d5[_0x8bca('0x2d')]);_0x18c6cb[_0x8bca('0x31')]=_[_0x8bca('0x30')](_0x4dd3d5[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x18c6cb['attributes']=_0x18c6cb[_0x8bca('0x31')][_0x8bca('0x40')]?_0x18c6cb[_0x8bca('0x31')]:_0x4dd3d5[_0x8bca('0x2c')];if(!_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x18c6cb[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x12ab81[_0x8bca('0x2d')]['limit']);_0x18c6cb[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x12ab81['query'][_0x8bca('0x1c')]);}_0x18c6cb[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x18c6cb['where']=qs[_0x8bca('0x2f')](_[_0x8bca('0x55')](_0x12ab81[_0x8bca('0x2d')],_0x4dd3d5[_0x8bca('0x2f')]));_0x18c6cb[_0x8bca('0x36')][_0x8bca('0x56')]=_0x243988['id'];if(_0x12ab81['query'][_0x8bca('0x37')]){_0x18c6cb[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x18c6cb[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x18c6cb['attributes'],function(_0x35958f){var _0x42b85b={};_0x42b85b[_0x35958f]={'$like':'%'+_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x42b85b;})});}_0x18c6cb=_[_0x8bca('0x38')]({},_0x18c6cb,_0x12ab81[_0x8bca('0x4a')]);return db['CmHopper'][_0x8bca('0x1b')]({'where':_0x18c6cb[_0x8bca('0x36')]})[_0x8bca('0x1f')](function(_0x4d9477){_0x35e6eb['count']=_0x4d9477;if(_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x18c6cb[_0x8bca('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0x8bca('0x3c')](_0x18c6cb);})['then'](function(_0x12fc38){_0x35e6eb['rows']=_0x12fc38;return _0x35e6eb;});}})['then'](respondWithFilteredResult(_0x33d117,_0x18c6cb))[_0x8bca('0x3e')](handleError(_0x33d117,null));};exports[_0x8bca('0x57')]=function(_0x18d999,_0x57ae60,_0x1fa442){var _0x46d56a={'raw':!![],'where':{}};var _0x5e5b2c={};var _0x3281c7={'count':0x0,'rows':[]};return db['Campaign'][_0x8bca('0x58')]({'where':{'id':_0x18d999['params']['id']}})['then'](handleEntityNotFound(_0x57ae60,null))[_0x8bca('0x1f')](function(_0x2a308b){if(_0x2a308b){_0x5e5b2c['model']=_[_0x8bca('0x2e')](db[_0x8bca('0x59')][_0x8bca('0x29')]);_0x5e5b2c[_0x8bca('0x2d')]=_[_0x8bca('0x2e')](_0x18d999[_0x8bca('0x2d')]);_0x5e5b2c['filters']=_['intersection'](_0x5e5b2c[_0x8bca('0x2c')],_0x5e5b2c['query']);_0x46d56a['attributes']=_['intersection'](_0x5e5b2c['model'],qs[_0x8bca('0x32')](_0x18d999['query'][_0x8bca('0x32')]));_0x46d56a[_0x8bca('0x31')]=_0x46d56a[_0x8bca('0x31')][_0x8bca('0x40')]?_0x46d56a[_0x8bca('0x31')]:_0x5e5b2c[_0x8bca('0x2c')];if(!_0x18d999[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x46d56a['limit']=qs[_0x8bca('0x1a')](_0x18d999[_0x8bca('0x2d')][_0x8bca('0x1a')]);_0x46d56a[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x18d999[_0x8bca('0x2d')][_0x8bca('0x1c')]);}_0x46d56a['order']=qs[_0x8bca('0x35')](_0x18d999[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x46d56a[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x18d999['query'],_0x5e5b2c[_0x8bca('0x2f')]));_0x46d56a[_0x8bca('0x36')]['CampaignId']=_0x2a308b['id'];if(_0x18d999[_0x8bca('0x2d')]['filter']){_0x46d56a[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x46d56a[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x46d56a[_0x8bca('0x31')],function(_0x153ff1){var _0x1455fd={};_0x1455fd[_0x153ff1]={'$like':'%'+_0x18d999[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x1455fd;})});}_0x46d56a=_['merge']({},_0x46d56a,_0x18d999[_0x8bca('0x4a')]);return db[_0x8bca('0x59')][_0x8bca('0x1b')]({'where':_0x46d56a[_0x8bca('0x36')]})[_0x8bca('0x1f')](function(_0x566946){_0x3281c7['count']=_0x566946;if(_0x18d999[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x46d56a['include']=[{'all':!![]}];}return db[_0x8bca('0x59')][_0x8bca('0x3c')](_0x46d56a);})[_0x8bca('0x1f')](function(_0x3dde74){_0x3281c7[_0x8bca('0x3d')]=_0x3dde74;return _0x3281c7;});}})['then'](respondWithFilteredResult(_0x57ae60,_0x46d56a))[_0x8bca('0x3e')](handleError(_0x57ae60,null));};exports[_0x8bca('0x5a')]=function(_0x319387,_0xef2a8b,_0x2c1557){var _0x473672={'raw':!![],'where':{}};var _0x222efa={};var _0x90fafe={'count':0x0,'rows':[]};return db[_0x8bca('0x28')]['findOne']({'where':{'id':_0x319387[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0xef2a8b,null))['then'](function(_0x2143e2){if(_0x2143e2){_0x222efa[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db['CmHopperFinal'][_0x8bca('0x29')]);_0x222efa[_0x8bca('0x2d')]=_['keys'](_0x319387[_0x8bca('0x2d')]);_0x222efa[_0x8bca('0x2f')]=_[_0x8bca('0x30')](_0x222efa[_0x8bca('0x2c')],_0x222efa[_0x8bca('0x2d')]);_0x473672['attributes']=_[_0x8bca('0x30')](_0x222efa[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x319387[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x473672['attributes']=_0x473672[_0x8bca('0x31')][_0x8bca('0x40')]?_0x473672[_0x8bca('0x31')]:_0x222efa['model'];if(!_0x319387['query']['hasOwnProperty'](_0x8bca('0x33'))){_0x473672[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x319387[_0x8bca('0x2d')]['limit']);_0x473672['offset']=qs[_0x8bca('0x1c')](_0x319387[_0x8bca('0x2d')][_0x8bca('0x1c')]);}_0x473672[_0x8bca('0x34')]=qs['sort'](_0x319387['query'][_0x8bca('0x35')]);_0x473672['where']=qs[_0x8bca('0x2f')](_[_0x8bca('0x55')](_0x319387[_0x8bca('0x2d')],_0x222efa[_0x8bca('0x2f')]));_0x473672[_0x8bca('0x36')]['CampaignId']=_0x2143e2['id'];if(_0x319387['query'][_0x8bca('0x37')]){_0x473672[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x473672[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x473672['attributes'],function(_0x49e6f0){var _0x2d6d91={};_0x2d6d91[_0x49e6f0]={'$like':'%'+_0x319387[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x2d6d91;})});}_0x473672=_[_0x8bca('0x38')]({},_0x473672,_0x319387[_0x8bca('0x4a')]);return db[_0x8bca('0x5b')][_0x8bca('0x1b')]({'where':_0x473672[_0x8bca('0x36')]})[_0x8bca('0x1f')](function(_0x30470c){_0x90fafe[_0x8bca('0x1b')]=_0x30470c;if(_0x319387[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x473672['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x8bca('0x3c')](_0x473672);})[_0x8bca('0x1f')](function(_0x5dbd2e){_0x90fafe[_0x8bca('0x3d')]=_0x5dbd2e;return _0x90fafe;});}})[_0x8bca('0x1f')](respondWithFilteredResult(_0xef2a8b,_0x473672))[_0x8bca('0x3e')](handleError(_0xef2a8b,null));};exports[_0x8bca('0x5c')]=function(_0x280d1d,_0x215c78,_0x45bd58){var _0x1a5a65={'raw':!![],'where':{}};var _0x194f58={};var _0x12d957={'count':0x0,'rows':[]};return db['Campaign'][_0x8bca('0x58')]({'where':{'id':_0x280d1d[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x215c78,null))[_0x8bca('0x1f')](function(_0xd09bd0){if(_0xd09bd0){_0x194f58[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db[_0x8bca('0x5d')][_0x8bca('0x29')]);_0x194f58[_0x8bca('0x2d')]=_['keys'](_0x280d1d[_0x8bca('0x2d')]);_0x194f58[_0x8bca('0x2f')]=_[_0x8bca('0x30')](_0x194f58['model'],_0x194f58[_0x8bca('0x2d')]);_0x1a5a65[_0x8bca('0x31')]=_[_0x8bca('0x30')](_0x194f58[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x1a5a65[_0x8bca('0x31')]=_0x1a5a65[_0x8bca('0x31')][_0x8bca('0x40')]?_0x1a5a65[_0x8bca('0x31')]:_0x194f58[_0x8bca('0x2c')];if(!_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x1a5a65[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x1a')]);_0x1a5a65[_0x8bca('0x1c')]=qs['offset'](_0x280d1d['query']['offset']);}_0x1a5a65[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x1a5a65[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x280d1d[_0x8bca('0x2d')],_0x194f58['filters']));_0x1a5a65[_0x8bca('0x36')]['CampaignId']=_0xd09bd0['id'];if(_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x37')]){_0x1a5a65['where']=_['merge'](_0x1a5a65[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x1a5a65[_0x8bca('0x31')],function(_0x4fb3e2){var _0x5cfce1={};_0x5cfce1[_0x4fb3e2]={'$like':'%'+_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x5cfce1;})});}_0x1a5a65=_[_0x8bca('0x38')]({},_0x1a5a65,_0x280d1d[_0x8bca('0x4a')]);return db[_0x8bca('0x5d')][_0x8bca('0x1b')]({'where':_0x1a5a65['where']})['then'](function(_0x2b1e57){_0x12d957[_0x8bca('0x1b')]=_0x2b1e57;if(_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x1a5a65[_0x8bca('0x3b')]=[{'all':!![]}];}return db[_0x8bca('0x5d')][_0x8bca('0x3c')](_0x1a5a65);})[_0x8bca('0x1f')](function(_0x204d9c){_0x12d957[_0x8bca('0x3d')]=_0x204d9c;return _0x12d957;});}})[_0x8bca('0x1f')](respondWithFilteredResult(_0x215c78,_0x1a5a65))[_0x8bca('0x3e')](handleError(_0x215c78,null));};exports[_0x8bca('0x5e')]=function(_0x2d3041,_0x3421ae,_0x16b698){var _0x31070e={};var _0x22c9f1={};var _0x364e03;var _0x1fb3d2;return db[_0x8bca('0x28')][_0x8bca('0x58')]({'where':{'id':_0x2d3041[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x3421ae,null))[_0x8bca('0x1f')](function(_0x4cefb0){if(_0x4cefb0){_0x364e03=_0x4cefb0;_0x22c9f1[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db[_0x8bca('0x5f')]['rawAttributes']);_0x22c9f1[_0x8bca('0x2d')]=_['keys'](_0x2d3041[_0x8bca('0x2d')]);_0x22c9f1[_0x8bca('0x2f')]=_['intersection'](_0x22c9f1[_0x8bca('0x2c')],_0x22c9f1['query']);_0x31070e[_0x8bca('0x31')]=_['intersection'](_0x22c9f1[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x2d3041[_0x8bca('0x2d')]['fields']));_0x31070e[_0x8bca('0x31')]=_0x31070e['attributes'][_0x8bca('0x40')]?_0x31070e[_0x8bca('0x31')]:_0x22c9f1['model'];_0x31070e[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x2d3041[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x31070e[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x2d3041['query'],_0x22c9f1[_0x8bca('0x2f')]));if(_0x2d3041['query'][_0x8bca('0x37')]){_0x31070e[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x31070e[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x31070e[_0x8bca('0x31')],function(_0x55b799){var _0x5e02d2={};_0x5e02d2[_0x55b799]={'$like':'%'+_0x2d3041['query']['filter']+'%'};return _0x5e02d2;})});}_0x31070e=_[_0x8bca('0x38')]({},_0x31070e,_0x2d3041[_0x8bca('0x4a')]);return _0x364e03[_0x8bca('0x5e')](_0x31070e);}})[_0x8bca('0x1f')](function(_0x6cedc3){if(_0x6cedc3){_0x1fb3d2=_0x6cedc3['length'];if(!_0x2d3041['query'][_0x8bca('0x54')](_0x8bca('0x33'))){_0x31070e[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x2d3041['query'][_0x8bca('0x1a')]);_0x31070e[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x2d3041['query'][_0x8bca('0x1c')]);}return _0x364e03[_0x8bca('0x5e')](_0x31070e);}})[_0x8bca('0x1f')](function(_0xe6d2c6){if(_0xe6d2c6){return _0xe6d2c6?{'count':_0x1fb3d2,'rows':_0xe6d2c6}:null;}})['then'](respondWithResult(_0x3421ae,null))[_0x8bca('0x3e')](handleError(_0x3421ae,null));};exports[_0x8bca('0x60')]=function(_0x14a9c1,_0x146796,_0x3e7d0c){var _0x29eac1,_0x49c29a;var _0x2ec68f=[];var _0x3c17a4=moment()[_0x8bca('0x61')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x14a9c1[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x146796,null))[_0x8bca('0x1f')](function(_0x5b601d){if(_0x5b601d){_0x49c29a=_0x5b601d;return _0x5b601d['addLists'](_0x14a9c1[_0x8bca('0x4d')][_0x8bca('0x62')],_[_0x8bca('0x4e')](_0x14a9c1[_0x8bca('0x4d')],[_0x8bca('0x62'),'id'])||{});}return null;})[_0x8bca('0x63')](function(_0x446d0b){var _0x4a8102;var _0x19da71;_0x29eac1=_0x446d0b||[];var _0xaae941=[];if(_0x446d0b){for(var _0x37e651=0x0;_0x37e651<_0x446d0b[_0x8bca('0x40')];_0x37e651+=0x1){var _0x265c90=_0x446d0b[_0x37e651][_0x8bca('0x21')]({'plain':!![]});_0x49c29a[_0x8bca('0x64')]=_0x14a9c1[_0x8bca('0x4d')][_0x8bca('0x64')]?_0x14a9c1['body']['dialCheckDuplicateType']:_0x49c29a['dialCheckDuplicateType'];switch(_0x49c29a[_0x8bca('0x64')]){case _0x8bca('0x65'):_0x4a8102=squel['insert']()[_0x8bca('0x66')](_0x8bca('0x67'))[_0x8bca('0x68')]([_0x8bca('0x69'),_0x8bca('0x6a'),_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x56'),_0x8bca('0x4b'),_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()['field'](_0x8bca('0x69'),_0x8bca('0x69'))[_0x8bca('0x6e')]('NOW()',_0x8bca('0x6a'))[_0x8bca('0x6e')]('id','ContactId')[_0x8bca('0x6e')](_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')](),_0x8bca('0x6c'))['field'](_0x14a9c1['params']['id']['toString'](),_0x8bca('0x56'))[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27','createdAt')[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')](_0x8bca('0x72'))[_0x8bca('0x36')](_0x8bca('0x73'))['where']('ListId\x20=\x20?',_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')]())[_0x8bca('0x36')](_0x8bca('0x74'))[_0x8bca('0x36')](_0x8bca('0x75'),squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x76'))[_0x8bca('0x71')](_0x8bca('0x77'))[_0x8bca('0x36')](_0x8bca('0x78'),_0x14a9c1[_0x8bca('0x49')]['id']['toString']()))[_0x8bca('0x36')](_0x8bca('0x75'),squel['select']()['field'](_0x8bca('0x79'))[_0x8bca('0x71')]('cm_hopper')['where'](_0x8bca('0x78'),_0x14a9c1['params']['id'][_0x8bca('0x70')]())))[_0x8bca('0x70')]();break;case _0x8bca('0x7a'):_0x4a8102=squel[_0x8bca('0x7b')]()[_0x8bca('0x66')](_0x8bca('0x67'))[_0x8bca('0x68')](['phone',_0x8bca('0x6a'),_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x56'),'createdAt',_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x69'),_0x8bca('0x69'))[_0x8bca('0x6e')](_0x8bca('0x7c'),_0x8bca('0x6a'))[_0x8bca('0x6e')]('id',_0x8bca('0x6b'))[_0x8bca('0x6e')](_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')](),'ListId')[_0x8bca('0x6e')](_0x14a9c1[_0x8bca('0x49')]['id'][_0x8bca('0x70')](),_0x8bca('0x56'))['field']('\x27'+_0x3c17a4+'\x27','createdAt')[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')]('cm_contacts')[_0x8bca('0x36')]('deletedAt\x20IS\x20NULL')[_0x8bca('0x36')](_0x8bca('0x7d'),_0x265c90[_0x8bca('0x6f')]['toString']())['where'](_0x8bca('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x79'))[_0x8bca('0x71')](_0x8bca('0x67'))[_0x8bca('0x36')]('CampaignId\x20=\x20?',_0x14a9c1[_0x8bca('0x49')]['id'][_0x8bca('0x70')]())))[_0x8bca('0x70')]();break;default:_0x4a8102=squel['insert']()['into']('cm_hopper')[_0x8bca('0x68')]([_0x8bca('0x69'),'scheduledAt',_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x56'),_0x8bca('0x4b'),'updatedAt'],squel['select']()[_0x8bca('0x6e')]('phone',_0x8bca('0x69'))[_0x8bca('0x6e')]('NOW()','scheduledAt')[_0x8bca('0x6e')]('id',_0x8bca('0x6b'))[_0x8bca('0x6e')](_0x265c90['CmListId'][_0x8bca('0x70')](),'ListId')[_0x8bca('0x6e')](_0x14a9c1['params']['id']['toString'](),'CampaignId')['field']('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4b'))['field']('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')](_0x8bca('0x72'))[_0x8bca('0x36')](_0x8bca('0x73'))[_0x8bca('0x36')]('ListId\x20=\x20?',_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')]())['where'](_0x8bca('0x74')))['toString']();}_0x19da71=squel[_0x8bca('0x7b')]()[_0x8bca('0x66')](_0x8bca('0x7e'))[_0x8bca('0x68')]([_0x8bca('0x7f'),_0x8bca('0x6a'),'phone','OrderBy',_0x8bca('0x4b'),_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x80'),'id')[_0x8bca('0x6e')](_0x8bca('0x7c'),'scheduledAt')['field']('ci.item',_0x8bca('0x69'))[_0x8bca('0x6e')](_0x8bca('0x81'),_0x8bca('0x82'))[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4b'))[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')]('cm_contact_has_items','ci')[_0x8bca('0x83')](_0x8bca('0x67'),'h',_0x8bca('0x84'))[_0x8bca('0x36')](_0x8bca('0x85'),_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')]())[_0x8bca('0x36')](_0x8bca('0x86'),_0x14a9c1[_0x8bca('0x49')]['id']['toString']())[_0x8bca('0x36')](_0x8bca('0x87'),_0x3c17a4))[_0x8bca('0x70')]();_0xaae941[_0x8bca('0x88')](db[_0x8bca('0x89')][_0x8bca('0x2d')](_0x4a8102));_0x2ec68f[_0x8bca('0x88')](db['sequelize'][_0x8bca('0x2d')](_0x19da71));}return BPromise[_0x8bca('0x8a')](_0xaae941);}})[_0x8bca('0x1f')](function(){return BPromise[_0x8bca('0x8a')](_0x2ec68f);})[_0x8bca('0x1f')](function(){return _0x29eac1;})[_0x8bca('0x1f')](respondWithResult(_0x146796,null))[_0x8bca('0x3e')](handleError(_0x146796,null));};exports['removeLists']=function(_0x22c7c7,_0x17b179,_0x8e017c){return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x22c7c7[_0x8bca('0x49')]['id']}})['then'](handleEntityNotFound(_0x17b179,null))['then'](function(_0x314497){if(_0x314497){return _0x314497[_0x8bca('0x8b')](_0x22c7c7[_0x8bca('0x2d')][_0x8bca('0x62')]);}})[_0x8bca('0x1f')](function(_0x4525ce){if(_0x4525ce){return db[_0x8bca('0x53')][_0x8bca('0x20')]({'where':{'ListId':_0x22c7c7[_0x8bca('0x2d')][_0x8bca('0x62')],'CampaignId':_0x22c7c7[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](function(){return _0x4525ce;});}})[_0x8bca('0x1f')](respondWithStatusCode(_0x17b179,null))['catch'](handleError(_0x17b179,null));};exports[_0x8bca('0x8c')]=function(_0x510ba5,_0x27a4be,_0x44aea0){var _0x47cec2={};var _0x4e8b75={};var _0x4fa822;var _0x227f3f;return db[_0x8bca('0x28')][_0x8bca('0x58')]({'where':{'id':_0x510ba5[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x27a4be,null))[_0x8bca('0x1f')](function(_0x192bd5){if(_0x192bd5){_0x4fa822=_0x192bd5;_0x4e8b75['model']=_[_0x8bca('0x2e')](db['CmList'][_0x8bca('0x29')]);_0x4e8b75[_0x8bca('0x2d')]=_['keys'](_0x510ba5[_0x8bca('0x2d')]);_0x4e8b75[_0x8bca('0x2f')]=_['intersection'](_0x4e8b75[_0x8bca('0x2c')],_0x4e8b75[_0x8bca('0x2d')]);_0x47cec2['attributes']=_[_0x8bca('0x30')](_0x4e8b75['model'],qs[_0x8bca('0x32')](_0x510ba5[_0x8bca('0x2d')]['fields']));_0x47cec2['attributes']=_0x47cec2[_0x8bca('0x31')]['length']?_0x47cec2[_0x8bca('0x31')]:_0x4e8b75[_0x8bca('0x2c')];_0x47cec2[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x510ba5[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x47cec2['where']=qs['filters'](_[_0x8bca('0x55')](_0x510ba5['query'],_0x4e8b75[_0x8bca('0x2f')]));if(_0x510ba5[_0x8bca('0x2d')][_0x8bca('0x37')]){_0x47cec2[_0x8bca('0x36')]=_['merge'](_0x47cec2[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x47cec2['attributes'],function(_0x10d2f5){var _0x23f618={};_0x23f618[_0x10d2f5]={'$like':'%'+_0x510ba5[_0x8bca('0x2d')]['filter']+'%'};return _0x23f618;})});}_0x47cec2=_[_0x8bca('0x38')]({},_0x47cec2,_0x510ba5[_0x8bca('0x4a')]);return _0x4fa822[_0x8bca('0x8c')](_0x47cec2);}})[_0x8bca('0x1f')](function(_0x23c6a2){if(_0x23c6a2){_0x227f3f=_0x23c6a2[_0x8bca('0x40')];if(!_0x510ba5[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x47cec2[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x510ba5['query'][_0x8bca('0x1a')]);_0x47cec2[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x510ba5['query'][_0x8bca('0x1c')]);}return _0x4fa822[_0x8bca('0x8c')](_0x47cec2);}})['then'](function(_0x3e243d){if(_0x3e243d){return _0x3e243d?{'count':_0x227f3f,'rows':_0x3e243d}:null;}})[_0x8bca('0x1f')](respondWithResult(_0x27a4be,null))[_0x8bca('0x3e')](handleError(_0x27a4be,null));};exports[_0x8bca('0x8d')]=function(_0x1d2df1,_0x44dc99,_0x385119){var _0x1671d6,_0x21534b;var _0x28400f=[];var _0x2cc157=moment()[_0x8bca('0x61')](_0x8bca('0x8e'));return db['Campaign']['find']({'where':{'id':_0x1d2df1[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x44dc99,null))[_0x8bca('0x1f')](function(_0x52bef4){if(_0x52bef4){_0x21534b=_0x52bef4;return _0x52bef4[_0x8bca('0x8d')](_0x1d2df1[_0x8bca('0x4d')][_0x8bca('0x62')],_[_0x8bca('0x4e')](_0x1d2df1['body'],[_0x8bca('0x62'),'id'])||{});}return null;})[_0x8bca('0x63')](function(_0xf7b106){var _0x34fb34;var _0x13841a;_0x1671d6=_0xf7b106||[];var _0x5b9fd9=[];if(_0xf7b106){for(var _0x355512=0x0;_0x355512<_0xf7b106['length'];_0x355512+=0x1){var _0x30d51c=_0xf7b106[_0x355512][_0x8bca('0x21')]({'plain':!![]});_0x34fb34=squel[_0x8bca('0x7b')]()[_0x8bca('0x66')]('cm_hopper_black')[_0x8bca('0x68')](['phone','ContactId',_0x8bca('0x6c'),_0x8bca('0x56'),_0x8bca('0x4b'),_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()['field']('phone',_0x8bca('0x69'))['field']('id',_0x8bca('0x6b'))[_0x8bca('0x6e')](_0x30d51c[_0x8bca('0x6f')][_0x8bca('0x70')](),_0x8bca('0x6c'))[_0x8bca('0x6e')](_0x1d2df1[_0x8bca('0x49')]['id'][_0x8bca('0x70')](),_0x8bca('0x56'))[_0x8bca('0x6e')](_0x8bca('0x7c'),'createdAt')[_0x8bca('0x6e')]('NOW()',_0x8bca('0x4c'))[_0x8bca('0x71')](_0x8bca('0x72'))[_0x8bca('0x36')](_0x8bca('0x73'))[_0x8bca('0x36')](_0x8bca('0x7d'),_0x30d51c[_0x8bca('0x6f')][_0x8bca('0x70')]())['where'](_0x8bca('0x74')))[_0x8bca('0x70')]();_0x5b9fd9['push'](db[_0x8bca('0x89')]['query'](_0x34fb34));}return BPromise[_0x8bca('0x8a')](_0x5b9fd9);}})[_0x8bca('0x1f')](function(){return _0x1671d6;})['then'](respondWithResult(_0x44dc99,null))['catch'](handleError(_0x44dc99,null));};exports[_0x8bca('0x8f')]=function(_0x2dbd22,_0x570de3,_0x21d79c){return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x2dbd22[_0x8bca('0x49')]['id']}})['then'](handleEntityNotFound(_0x570de3,null))[_0x8bca('0x1f')](function(_0x21ec10){if(_0x21ec10){return _0x21ec10[_0x8bca('0x8f')](_0x2dbd22['query'][_0x8bca('0x62')]);}})[_0x8bca('0x1f')](function(_0x10b7ec){if(_0x10b7ec){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x2dbd22[_0x8bca('0x2d')][_0x8bca('0x62')],'CampaignId':_0x2dbd22[_0x8bca('0x49')]['id']}})['then'](function(){return _0x10b7ec;});}})[_0x8bca('0x1f')](respondWithStatusCode(_0x570de3,null))['catch'](handleError(_0x570de3,null));};
\ No newline at end of file
+var _0xce2f=['IvrCampaigns','error','stack','name','send','map','Campaign','fieldName','type','model','query','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','find','body','user','role','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','getHoppers','findOne','CmHopper','length','hasOwnProperty','CampaignId','CmHopperHistory','pick','findAll','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce2f,0x18a));var _0xfce2=function(_0x595334,_0x475958){_0x595334=_0x595334-0x0;var _0x14abc8=_0xce2f[_0x595334];return _0x14abc8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfce2('0x0'));var zipdir=require(_0xfce2('0x1'));var jsonpatch=require(_0xfce2('0x2'));var rp=require(_0xfce2('0x3'));var moment=require(_0xfce2('0x4'));var BPromise=require(_0xfce2('0x5'));var Mustache=require('mustache');var util=require(_0xfce2('0x6'));var path=require('path');var sox=require(_0xfce2('0x7'));var csv=require('to-csv');var ejs=require(_0xfce2('0x8'));var fs=require('fs');var fs_extra=require(_0xfce2('0x9'));var _=require(_0xfce2('0xa'));var squel=require(_0xfce2('0xb'));var crypto=require(_0xfce2('0xc'));var jsforce=require(_0xfce2('0xd'));var deskjs=require(_0xfce2('0xe'));var toCsv=require(_0xfce2('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfce2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfce2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfce2('0x12'));var logger=require('../../config/logger')(_0xfce2('0x13'));var utils=require(_0xfce2('0x14'));var config=require(_0xfce2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfce2('0x16'))['db'];function respondWithStatusCode(_0x5bc459,_0x14cf81){_0x14cf81=_0x14cf81||0xcc;return function(_0x1149ac){if(_0x1149ac){return _0x5bc459[_0xfce2('0x17')](_0x14cf81);}return _0x5bc459[_0xfce2('0x18')](_0x14cf81)[_0xfce2('0x19')]();};}function respondWithResult(_0x3fa748,_0x272f58){_0x272f58=_0x272f58||0xc8;return function(_0x4fdcc2){if(_0x4fdcc2){return _0x3fa748[_0xfce2('0x18')](_0x272f58)[_0xfce2('0x1a')](_0x4fdcc2);}};}function respondWithFilteredResult(_0x47c53a,_0x32094b){return function(_0x1d35c5){if(_0x1d35c5){var _0x5781fe=typeof _0x32094b['offset']===_0xfce2('0x1b')&&typeof _0x32094b[_0xfce2('0x1c')]==='undefined';var _0x18e430=_0x1d35c5[_0xfce2('0x1d')];var _0x1e02a6=_0x5781fe?0x0:_0x32094b[_0xfce2('0x1e')];var _0x2ad9f5=_0x5781fe?_0x1d35c5[_0xfce2('0x1d')]:_0x32094b[_0xfce2('0x1e')]+_0x32094b[_0xfce2('0x1c')];var _0x1cdd29;if(_0x2ad9f5>=_0x18e430){_0x2ad9f5=_0x18e430;_0x1cdd29=0xc8;}else{_0x1cdd29=0xce;}_0x47c53a[_0xfce2('0x18')](_0x1cdd29);return _0x47c53a['set']('Content-Range',_0x1e02a6+'-'+_0x2ad9f5+'/'+_0x18e430)[_0xfce2('0x1a')](_0x1d35c5);}return null;};}function patchUpdates(_0x3ea07b){return function(_0x312c10){try{jsonpatch[_0xfce2('0x1f')](_0x312c10,_0x3ea07b,!![]);}catch(_0x4bbebc){return BPromise[_0xfce2('0x20')](_0x4bbebc);}return _0x312c10[_0xfce2('0x21')]();};}function saveUpdates(_0x33ced0,_0x4c239b){return function(_0x4088c7){if(_0x4088c7){return _0x4088c7[_0xfce2('0x22')](_0x33ced0)[_0xfce2('0x23')](function(_0x4d59b7){return _0x4d59b7;});}return null;};}function removeEntity(_0x57bc28,_0x39476b){return function(_0x208903){if(_0x208903){return _0x208903[_0xfce2('0x24')]()[_0xfce2('0x23')](function(){var _0x57d743=_0x208903[_0xfce2('0x25')]({'plain':!![]});var _0x5cd9b2=_0xfce2('0x26');return db['UserProfileResource'][_0xfce2('0x24')]({'where':{'type':_0x5cd9b2,'resourceId':_0x57d743['id']}})[_0xfce2('0x23')](function(){return _0x208903;});})[_0xfce2('0x23')](function(){_0x57bc28['status'](0xcc)[_0xfce2('0x19')]();});}};}function handleEntityNotFound(_0x2358dc,_0x175bcc){return function(_0x112f0a){if(!_0x112f0a){_0x2358dc['sendStatus'](0x194);}return _0x112f0a;};}function handleError(_0x6c8a47,_0xef1b38){_0xef1b38=_0xef1b38||0x1f4;return function(_0x58022e){logger[_0xfce2('0x27')](_0x58022e[_0xfce2('0x28')]);if(_0x58022e[_0xfce2('0x29')]){delete _0x58022e[_0xfce2('0x29')];}_0x6c8a47['status'](_0xef1b38)[_0xfce2('0x2a')](_0x58022e);};}exports['index']=function(_0x1b211c,_0x468739){var _0x3332f9={},_0x35b7fe={},_0x1882cd={'count':0x0,'rows':[]};var _0x101107=_[_0xfce2('0x2b')](db[_0xfce2('0x2c')]['rawAttributes'],function(_0x10b9ec){return{'name':_0x10b9ec[_0xfce2('0x2d')],'type':_0x10b9ec[_0xfce2('0x2e')]['key']};});_0x35b7fe[_0xfce2('0x2f')]=_['map'](_0x101107,'name');_0x35b7fe[_0xfce2('0x30')]=_['keys'](_0x1b211c[_0xfce2('0x30')]);_0x35b7fe[_0xfce2('0x31')]=_[_0xfce2('0x32')](_0x35b7fe[_0xfce2('0x2f')],_0x35b7fe['query']);_0x3332f9['attributes']=_['intersection'](_0x35b7fe[_0xfce2('0x2f')],qs[_0xfce2('0x33')](_0x1b211c[_0xfce2('0x30')][_0xfce2('0x33')]));_0x3332f9[_0xfce2('0x34')]=_0x3332f9['attributes']['length']?_0x3332f9[_0xfce2('0x34')]:_0x35b7fe[_0xfce2('0x2f')];if(!_0x1b211c[_0xfce2('0x30')]['hasOwnProperty'](_0xfce2('0x35'))){_0x3332f9['limit']=qs[_0xfce2('0x1c')](_0x1b211c[_0xfce2('0x30')][_0xfce2('0x1c')]);_0x3332f9['offset']=qs['offset'](_0x1b211c[_0xfce2('0x30')][_0xfce2('0x1e')]);}_0x3332f9[_0xfce2('0x36')]=qs[_0xfce2('0x37')](_0x1b211c['query'][_0xfce2('0x37')]);_0x3332f9['where']=qs[_0xfce2('0x31')](_['pick'](_0x1b211c[_0xfce2('0x30')],_0x35b7fe[_0xfce2('0x31')]),_0x101107);if(_0x1b211c[_0xfce2('0x30')][_0xfce2('0x38')]){_0x3332f9[_0xfce2('0x39')]=_['merge'](_0x3332f9[_0xfce2('0x39')],{'$or':_[_0xfce2('0x2b')](_0x101107,function(_0x52ae47){if(_0x52ae47[_0xfce2('0x2e')]!==_0xfce2('0x3a')){var _0x3df655={};_0x3df655[_0x52ae47[_0xfce2('0x29')]]={'$like':'%'+_0x1b211c[_0xfce2('0x30')]['filter']+'%'};return _0x3df655;}})});}_0x3332f9=_[_0xfce2('0x3b')]({},_0x3332f9,_0x1b211c['options']);var _0x35108a={'where':_0x3332f9[_0xfce2('0x39')]};return db[_0xfce2('0x2c')][_0xfce2('0x1d')](_0x35108a)[_0xfce2('0x23')](function(_0x51037e){_0x1882cd['count']=_0x51037e;if(_0x1b211c[_0xfce2('0x30')][_0xfce2('0x3c')]){_0x3332f9[_0xfce2('0x3d')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x3332f9);})['then'](function(_0x3fcd0e){_0x1882cd[_0xfce2('0x3e')]=_0x3fcd0e;return _0x1882cd;})['then'](respondWithFilteredResult(_0x468739,_0x3332f9))[_0xfce2('0x3f')](handleError(_0x468739,null));};exports[_0xfce2('0x40')]=function(_0x5beb7a,_0x2faefa){var _0x158bbe={'raw':![],'where':{'id':_0x5beb7a[_0xfce2('0x41')]['id']}},_0x5ad765={};_0x5ad765[_0xfce2('0x2f')]=_[_0xfce2('0x42')](db[_0xfce2('0x2c')][_0xfce2('0x43')]);_0x5ad765['query']=_['keys'](_0x5beb7a[_0xfce2('0x30')]);_0x5ad765[_0xfce2('0x31')]=_['intersection'](_0x5ad765['model'],_0x5ad765[_0xfce2('0x30')]);_0x158bbe[_0xfce2('0x34')]=_[_0xfce2('0x32')](_0x5ad765[_0xfce2('0x2f')],qs['fields'](_0x5beb7a[_0xfce2('0x30')][_0xfce2('0x33')]));_0x158bbe['attributes']=_0x158bbe[_0xfce2('0x34')]['length']?_0x158bbe[_0xfce2('0x34')]:_0x5ad765[_0xfce2('0x2f')];if(_0x5beb7a[_0xfce2('0x30')][_0xfce2('0x3c')]){_0x158bbe[_0xfce2('0x3d')]=[{'all':!![]}];}_0x158bbe=_['merge']({},_0x158bbe,_0x5beb7a[_0xfce2('0x44')]);return db[_0xfce2('0x2c')][_0xfce2('0x45')](_0x158bbe)['then'](handleEntityNotFound(_0x2faefa,null))[_0xfce2('0x23')](respondWithResult(_0x2faefa,null))[_0xfce2('0x3f')](handleError(_0x2faefa,null));};exports['create']=function(_0x281b4f,_0x2f64d7){return db['Campaign']['create'](_0x281b4f[_0xfce2('0x46')],{})[_0xfce2('0x23')](function(_0x388424){var _0x486750=_0x281b4f[_0xfce2('0x47')][_0xfce2('0x25')]({'plain':!![]});if(!_0x486750)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x486750[_0xfce2('0x48')]===_0xfce2('0x47')){var _0xdecfe0=_0x388424[_0xfce2('0x25')]({'plain':!![]});var _0x418f39=_0xfce2('0x26');return db['UserProfileSection'][_0xfce2('0x45')]({'where':{'name':_0x418f39,'userProfileId':_0x486750[_0xfce2('0x49')]},'raw':!![]})[_0xfce2('0x23')](function(_0x2c04d2){if(_0x2c04d2&&_0x2c04d2[_0xfce2('0x4a')]===0x0){return db[_0xfce2('0x4b')][_0xfce2('0x4c')]({'name':_0xdecfe0[_0xfce2('0x29')],'resourceId':_0xdecfe0['id'],'type':_0x2c04d2[_0xfce2('0x29')],'sectionId':_0x2c04d2['id']},{})[_0xfce2('0x23')](function(){return _0x388424;});}else{return _0x388424;}})[_0xfce2('0x3f')](function(_0x4f8a2f){logger[_0xfce2('0x27')](_0xfce2('0x4d'),_0x4f8a2f);throw _0x4f8a2f;});}return _0x388424;})['then'](respondWithResult(_0x2f64d7,0xc9))['catch'](handleError(_0x2f64d7,null));};exports[_0xfce2('0x4e')]=function(_0x889efe,_0x58417a){var _0x2ce4f3={'where':{'id':_0x889efe['params']['id']}},_0x157f50={};_0x157f50[_0xfce2('0x2f')]=_[_0xfce2('0x42')](db[_0xfce2('0x2c')][_0xfce2('0x43')]);_0x2ce4f3[_0xfce2('0x34')]=_[_0xfce2('0x32')](_0x157f50[_0xfce2('0x2f')],qs['fields'](_0x889efe[_0xfce2('0x30')][_0xfce2('0x33')]));_0x2ce4f3[_0xfce2('0x34')]=_0x2ce4f3[_0xfce2('0x34')]['length']?_0x2ce4f3[_0xfce2('0x34')]:_0x157f50[_0xfce2('0x2f')];if(_0x889efe[_0xfce2('0x30')]['includeAll']){_0x2ce4f3[_0xfce2('0x3d')]=[{'all':!![]}];}_0x2ce4f3=_['merge']({},_0x2ce4f3,_0x889efe[_0xfce2('0x44')]);return db[_0xfce2('0x2c')][_0xfce2('0x45')](_0x2ce4f3)['then'](handleEntityNotFound(_0x58417a,null))[_0xfce2('0x23')](function(_0x29c464){if(_0x29c464){var _0x1a76db=_0x29c464['get']({'plain':!![]});_0x1a76db=qs[_0xfce2('0x4f')](_0x1a76db,['id',_0xfce2('0x50'),_0xfce2('0x51')]);_0x889efe[_0xfce2('0x46')]=_[_0xfce2('0x4f')](_0x889efe[_0xfce2('0x46')],['id','createdAt',_0xfce2('0x51')]);return db[_0xfce2('0x2c')][_0xfce2('0x4c')](_['merge'](_0x1a76db,_0x889efe[_0xfce2('0x46')]),{'include':_0x889efe[_0xfce2('0x30')][_0xfce2('0x3c')]?[{'all':!![]}]:undefined})[_0xfce2('0x23')](function(_0x26a041){var _0x27ca29=_0x889efe[_0xfce2('0x47')][_0xfce2('0x25')]({'plain':!![]});if(!_0x27ca29)throw new Error(_0xfce2('0x52'));if(_0x27ca29[_0xfce2('0x48')]===_0xfce2('0x47')){var _0x2a8691=_0x26a041[_0xfce2('0x25')]({'plain':!![]});var _0xcaf8c2=_0xfce2('0x26');return db[_0xfce2('0x53')][_0xfce2('0x45')]({'where':{'name':_0xcaf8c2,'userProfileId':_0x27ca29['userProfileId']},'raw':!![]})[_0xfce2('0x23')](function(_0x5651c5){if(_0x5651c5&&_0x5651c5['autoAssociation']===0x0){return db[_0xfce2('0x4b')][_0xfce2('0x4c')]({'name':_0x2a8691[_0xfce2('0x29')],'resourceId':_0x2a8691['id'],'type':_0x5651c5[_0xfce2('0x29')],'sectionId':_0x5651c5['id']},{})[_0xfce2('0x23')](function(){return _0x26a041;});}else{return _0x26a041;}})[_0xfce2('0x3f')](function(_0x52fdd2){logger[_0xfce2('0x27')](_0xfce2('0x4d'),_0x52fdd2);throw _0x52fdd2;});}return _0x26a041;});}})['then'](respondWithResult(_0x58417a,0xc9))[_0xfce2('0x3f')](handleError(_0x58417a,null));};exports[_0xfce2('0x22')]=function(_0x27027c,_0xaeaab5){if(_0x27027c[_0xfce2('0x46')]['id']){delete _0x27027c['body']['id'];}return db[_0xfce2('0x2c')]['find']({'where':{'id':_0x27027c['params']['id']}})['then'](handleEntityNotFound(_0xaeaab5,null))[_0xfce2('0x23')](saveUpdates(_0x27027c['body'],null))[_0xfce2('0x23')](respondWithResult(_0xaeaab5,null))[_0xfce2('0x3f')](handleError(_0xaeaab5,null));};exports[_0xfce2('0x24')]=function(_0x270a73,_0x5e571a){return db['Campaign'][_0xfce2('0x45')]({'where':{'id':_0x270a73[_0xfce2('0x41')]['id']}})['then'](handleEntityNotFound(_0x5e571a,null))[_0xfce2('0x23')](removeEntity(_0x5e571a,null))['catch'](handleError(_0x5e571a,null));};exports[_0xfce2('0x54')]=function(_0x2c6131,_0x52605b,_0x457ca4){var _0xf55475={'raw':!![],'where':{}};var _0x2960c8={};var _0x4783a4={'count':0x0,'rows':[]};return db[_0xfce2('0x2c')][_0xfce2('0x55')]({'where':{'id':_0x2c6131[_0xfce2('0x41')]['id']}})[_0xfce2('0x23')](handleEntityNotFound(_0x52605b,null))[_0xfce2('0x23')](function(_0x5abd7b){if(_0x5abd7b){_0x2960c8[_0xfce2('0x2f')]=_[_0xfce2('0x42')](db[_0xfce2('0x56')]['rawAttributes']);_0x2960c8[_0xfce2('0x30')]=_[_0xfce2('0x42')](_0x2c6131[_0xfce2('0x30')]);_0x2960c8[_0xfce2('0x31')]=_[_0xfce2('0x32')](_0x2960c8[_0xfce2('0x2f')],_0x2960c8[_0xfce2('0x30')]);_0xf55475[_0xfce2('0x34')]=_[_0xfce2('0x32')](_0x2960c8[_0xfce2('0x2f')],qs[_0xfce2('0x33')](_0x2c6131[_0xfce2('0x30')]['fields']));_0xf55475['attributes']=_0xf55475[_0xfce2('0x34')][_0xfce2('0x57')]?_0xf55475[_0xfce2('0x34')]:_0x2960c8[_0xfce2('0x2f')];if(!_0x2c6131[_0xfce2('0x30')][_0xfce2('0x58')]('nolimit')){_0xf55475[_0xfce2('0x1c')]=qs[_0xfce2('0x1c')](_0x2c6131[_0xfce2('0x30')][_0xfce2('0x1c')]);_0xf55475[_0xfce2('0x1e')]=qs['offset'](_0x2c6131[_0xfce2('0x30')][_0xfce2('0x1e')]);}_0xf55475[_0xfce2('0x36')]=qs[_0xfce2('0x37')](_0x2c6131[_0xfce2('0x30')][_0xfce2('0x37')]);_0xf55475[_0xfce2('0x39')]=qs[_0xfce2('0x31')](_['pick'](_0x2c6131['query'],_0x2960c8[_0xfce2('0x31')]));_0xf55475[_0xfce2('0x39')][_0xfce2('0x59')]=_0x5abd7b['id'];if(_0x2c6131[_0xfce2('0x30')][_0xfce2('0x38')]){_0xf55475[_0xfce2('0x39')]=_[_0xfce2('0x3b')](_0xf55475[_0xfce2('0x39')],{'$or':_[_0xfce2('0x2b')](_0xf55475[_0xfce2('0x34')],function(_0x4e3e10){var _0x3ed5a0={};_0x3ed5a0[_0x4e3e10]={'$like':'%'+_0x2c6131['query']['filter']+'%'};return _0x3ed5a0;})});}_0xf55475=_['merge']({},_0xf55475,_0x2c6131[_0xfce2('0x44')]);return db[_0xfce2('0x56')][_0xfce2('0x1d')]({'where':_0xf55475[_0xfce2('0x39')]})[_0xfce2('0x23')](function(_0x4312b8){_0x4783a4[_0xfce2('0x1d')]=_0x4312b8;if(_0x2c6131[_0xfce2('0x30')][_0xfce2('0x3c')]){_0xf55475[_0xfce2('0x3d')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0xf55475);})['then'](function(_0x18fb08){_0x4783a4['rows']=_0x18fb08;return _0x4783a4;});}})[_0xfce2('0x23')](respondWithFilteredResult(_0x52605b,_0xf55475))[_0xfce2('0x3f')](handleError(_0x52605b,null));};exports['getHopperHistories']=function(_0x1ecb8d,_0x38040c,_0x53bb66){var _0x279d9a={'raw':!![],'where':{}};var _0x3d0f85={};var _0x3fb980={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1ecb8d[_0xfce2('0x41')]['id']}})['then'](handleEntityNotFound(_0x38040c,null))[_0xfce2('0x23')](function(_0x4c1cd8){if(_0x4c1cd8){_0x3d0f85[_0xfce2('0x2f')]=_['keys'](db[_0xfce2('0x5a')]['rawAttributes']);_0x3d0f85[_0xfce2('0x30')]=_[_0xfce2('0x42')](_0x1ecb8d[_0xfce2('0x30')]);_0x3d0f85[_0xfce2('0x31')]=_[_0xfce2('0x32')](_0x3d0f85[_0xfce2('0x2f')],_0x3d0f85[_0xfce2('0x30')]);_0x279d9a[_0xfce2('0x34')]=_['intersection'](_0x3d0f85[_0xfce2('0x2f')],qs[_0xfce2('0x33')](_0x1ecb8d[_0xfce2('0x30')][_0xfce2('0x33')]));_0x279d9a[_0xfce2('0x34')]=_0x279d9a[_0xfce2('0x34')][_0xfce2('0x57')]?_0x279d9a[_0xfce2('0x34')]:_0x3d0f85['model'];if(!_0x1ecb8d[_0xfce2('0x30')]['hasOwnProperty'](_0xfce2('0x35'))){_0x279d9a['limit']=qs[_0xfce2('0x1c')](_0x1ecb8d[_0xfce2('0x30')]['limit']);_0x279d9a[_0xfce2('0x1e')]=qs['offset'](_0x1ecb8d[_0xfce2('0x30')]['offset']);}_0x279d9a[_0xfce2('0x36')]=qs['sort'](_0x1ecb8d[_0xfce2('0x30')]['sort']);_0x279d9a[_0xfce2('0x39')]=qs['filters'](_[_0xfce2('0x5b')](_0x1ecb8d[_0xfce2('0x30')],_0x3d0f85[_0xfce2('0x31')]));_0x279d9a['where']['CampaignId']=_0x4c1cd8['id'];if(_0x1ecb8d[_0xfce2('0x30')]['filter']){_0x279d9a[_0xfce2('0x39')]=_[_0xfce2('0x3b')](_0x279d9a[_0xfce2('0x39')],{'$or':_['map'](_0x279d9a[_0xfce2('0x34')],function(_0x45a5b7){var _0x3abf0b={};_0x3abf0b[_0x45a5b7]={'$like':'%'+_0x1ecb8d[_0xfce2('0x30')][_0xfce2('0x38')]+'%'};return _0x3abf0b;})});}_0x279d9a=_[_0xfce2('0x3b')]({},_0x279d9a,_0x1ecb8d['options']);return db['CmHopperHistory']['count']({'where':_0x279d9a['where']})[_0xfce2('0x23')](function(_0x16a6f0){_0x3fb980[_0xfce2('0x1d')]=_0x16a6f0;if(_0x1ecb8d['query'][_0xfce2('0x3c')]){_0x279d9a[_0xfce2('0x3d')]=[{'all':!![]}];}return db[_0xfce2('0x5a')][_0xfce2('0x5c')](_0x279d9a);})[_0xfce2('0x23')](function(_0x2042b1){_0x3fb980[_0xfce2('0x3e')]=_0x2042b1;return _0x3fb980;});}})[_0xfce2('0x23')](respondWithFilteredResult(_0x38040c,_0x279d9a))[_0xfce2('0x3f')](handleError(_0x38040c,null));};exports['getHopperFinals']=function(_0x211219,_0x224d14,_0x5da57a){var _0x439b22={'raw':!![],'where':{}};var _0x4279fc={};var _0x3ecc30={'count':0x0,'rows':[]};return db[_0xfce2('0x2c')][_0xfce2('0x55')]({'where':{'id':_0x211219[_0xfce2('0x41')]['id']}})[_0xfce2('0x23')](handleEntityNotFound(_0x224d14,null))['then'](function(_0x4b6980){if(_0x4b6980){_0x4279fc[_0xfce2('0x2f')]=_[_0xfce2('0x42')](db['CmHopperFinal'][_0xfce2('0x43')]);_0x4279fc[_0xfce2('0x30')]=_[_0xfce2('0x42')](_0x211219[_0xfce2('0x30')]);_0x4279fc['filters']=_['intersection'](_0x4279fc[_0xfce2('0x2f')],_0x4279fc[_0xfce2('0x30')]);_0x439b22[_0xfce2('0x34')]=_[_0xfce2('0x32')](_0x4279fc['model'],qs[_0xfce2('0x33')](_0x211219['query']['fields']));_0x439b22[_0xfce2('0x34')]=_0x439b22[_0xfce2('0x34')][_0xfce2('0x57')]?_0x439b22[_0xfce2('0x34')]:_0x4279fc[_0xfce2('0x2f')];if(!_0x211219[_0xfce2('0x30')][_0xfce2('0x58')](_0xfce2('0x35'))){_0x439b22[_0xfce2('0x1c')]=qs[_0xfce2('0x1c')](_0x211219['query'][_0xfce2('0x1c')]);_0x439b22['offset']=qs[_0xfce2('0x1e')](_0x211219[_0xfce2('0x30')][_0xfce2('0x1e')]);}_0x439b22[_0xfce2('0x36')]=qs['sort'](_0x211219['query']['sort']);_0x439b22[_0xfce2('0x39')]=qs[_0xfce2('0x31')](_['pick'](_0x211219[_0xfce2('0x30')],_0x4279fc[_0xfce2('0x31')]));_0x439b22[_0xfce2('0x39')]['CampaignId']=_0x4b6980['id'];if(_0x211219[_0xfce2('0x30')][_0xfce2('0x38')]){_0x439b22['where']=_['merge'](_0x439b22['where'],{'$or':_[_0xfce2('0x2b')](_0x439b22['attributes'],function(_0x476eb8){var _0xd34078={};_0xd34078[_0x476eb8]={'$like':'%'+_0x211219['query'][_0xfce2('0x38')]+'%'};return _0xd34078;})});}_0x439b22=_[_0xfce2('0x3b')]({},_0x439b22,_0x211219['options']);return db[_0xfce2('0x5d')][_0xfce2('0x1d')]({'where':_0x439b22[_0xfce2('0x39')]})['then'](function(_0x4a8660){_0x3ecc30[_0xfce2('0x1d')]=_0x4a8660;if(_0x211219['query'][_0xfce2('0x3c')]){_0x439b22[_0xfce2('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xfce2('0x5c')](_0x439b22);})['then'](function(_0x1efff7){_0x3ecc30['rows']=_0x1efff7;return _0x3ecc30;});}})[_0xfce2('0x23')](respondWithFilteredResult(_0x224d14,_0x439b22))[_0xfce2('0x3f')](handleError(_0x224d14,null));};exports[_0xfce2('0x5e')]=function(_0x486911,_0x19be6a,_0xe396fc){var _0x290ba0={'raw':!![],'where':{}};var _0x55f34e={};var _0x1809d4={'count':0x0,'rows':[]};return db[_0xfce2('0x2c')][_0xfce2('0x55')]({'where':{'id':_0x486911[_0xfce2('0x41')]['id']}})[_0xfce2('0x23')](handleEntityNotFound(_0x19be6a,null))[_0xfce2('0x23')](function(_0x5daed7){if(_0x5daed7){_0x55f34e['model']=_['keys'](db[_0xfce2('0x5f')][_0xfce2('0x43')]);_0x55f34e[_0xfce2('0x30')]=_[_0xfce2('0x42')](_0x486911[_0xfce2('0x30')]);_0x55f34e['filters']=_[_0xfce2('0x32')](_0x55f34e[_0xfce2('0x2f')],_0x55f34e[_0xfce2('0x30')]);_0x290ba0[_0xfce2('0x34')]=_[_0xfce2('0x32')](_0x55f34e[_0xfce2('0x2f')],qs[_0xfce2('0x33')](_0x486911[_0xfce2('0x30')]['fields']));_0x290ba0[_0xfce2('0x34')]=_0x290ba0['attributes'][_0xfce2('0x57')]?_0x290ba0['attributes']:_0x55f34e[_0xfce2('0x2f')];if(!_0x486911[_0xfce2('0x30')][_0xfce2('0x58')](_0xfce2('0x35'))){_0x290ba0['limit']=qs[_0xfce2('0x1c')](_0x486911[_0xfce2('0x30')][_0xfce2('0x1c')]);_0x290ba0[_0xfce2('0x1e')]=qs[_0xfce2('0x1e')](_0x486911[_0xfce2('0x30')][_0xfce2('0x1e')]);}_0x290ba0['order']=qs[_0xfce2('0x37')](_0x486911['query'][_0xfce2('0x37')]);_0x290ba0['where']=qs[_0xfce2('0x31')](_['pick'](_0x486911[_0xfce2('0x30')],_0x55f34e[_0xfce2('0x31')]));_0x290ba0[_0xfce2('0x39')]['CampaignId']=_0x5daed7['id'];if(_0x486911['query'][_0xfce2('0x38')]){_0x290ba0[_0xfce2('0x39')]=_['merge'](_0x290ba0[_0xfce2('0x39')],{'$or':_['map'](_0x290ba0[_0xfce2('0x34')],function(_0x1e71de){var _0x1ba17e={};_0x1ba17e[_0x1e71de]={'$like':'%'+_0x486911[_0xfce2('0x30')][_0xfce2('0x38')]+'%'};return _0x1ba17e;})});}_0x290ba0=_[_0xfce2('0x3b')]({},_0x290ba0,_0x486911[_0xfce2('0x44')]);return db['CmHopperBlack']['count']({'where':_0x290ba0[_0xfce2('0x39')]})[_0xfce2('0x23')](function(_0x13d2d2){_0x1809d4[_0xfce2('0x1d')]=_0x13d2d2;if(_0x486911[_0xfce2('0x30')]['includeAll']){_0x290ba0[_0xfce2('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x290ba0);})[_0xfce2('0x23')](function(_0x3e351e){_0x1809d4[_0xfce2('0x3e')]=_0x3e351e;return _0x1809d4;});}})[_0xfce2('0x23')](respondWithFilteredResult(_0x19be6a,_0x290ba0))['catch'](handleError(_0x19be6a,null));};exports[_0xfce2('0x60')]=function(_0xa3128a,_0x307403,_0x4237d0){var _0x27bba5={};var _0x362aaa={};var _0x39f6d4;var _0x4a39bc;return db[_0xfce2('0x2c')][_0xfce2('0x55')]({'where':{'id':_0xa3128a[_0xfce2('0x41')]['id']}})['then'](handleEntityNotFound(_0x307403,null))[_0xfce2('0x23')](function(_0x6fe993){if(_0x6fe993){_0x39f6d4=_0x6fe993;_0x362aaa[_0xfce2('0x2f')]=_[_0xfce2('0x42')](db[_0xfce2('0x61')][_0xfce2('0x43')]);_0x362aaa[_0xfce2('0x30')]=_[_0xfce2('0x42')](_0xa3128a[_0xfce2('0x30')]);_0x362aaa[_0xfce2('0x31')]=_[_0xfce2('0x32')](_0x362aaa[_0xfce2('0x2f')],_0x362aaa[_0xfce2('0x30')]);_0x27bba5['attributes']=_['intersection'](_0x362aaa[_0xfce2('0x2f')],qs[_0xfce2('0x33')](_0xa3128a['query']['fields']));_0x27bba5[_0xfce2('0x34')]=_0x27bba5[_0xfce2('0x34')][_0xfce2('0x57')]?_0x27bba5[_0xfce2('0x34')]:_0x362aaa[_0xfce2('0x2f')];_0x27bba5[_0xfce2('0x36')]=qs[_0xfce2('0x37')](_0xa3128a[_0xfce2('0x30')][_0xfce2('0x37')]);_0x27bba5[_0xfce2('0x39')]=qs[_0xfce2('0x31')](_[_0xfce2('0x5b')](_0xa3128a[_0xfce2('0x30')],_0x362aaa['filters']));if(_0xa3128a[_0xfce2('0x30')][_0xfce2('0x38')]){_0x27bba5[_0xfce2('0x39')]=_[_0xfce2('0x3b')](_0x27bba5[_0xfce2('0x39')],{'$or':_[_0xfce2('0x2b')](_0x27bba5[_0xfce2('0x34')],function(_0x5d90c6){var _0x29e5ed={};_0x29e5ed[_0x5d90c6]={'$like':'%'+_0xa3128a[_0xfce2('0x30')]['filter']+'%'};return _0x29e5ed;})});}_0x27bba5=_['merge']({},_0x27bba5,_0xa3128a[_0xfce2('0x44')]);return _0x39f6d4[_0xfce2('0x60')](_0x27bba5);}})[_0xfce2('0x23')](function(_0x58b095){if(_0x58b095){_0x4a39bc=_0x58b095[_0xfce2('0x57')];if(!_0xa3128a['query'][_0xfce2('0x58')](_0xfce2('0x35'))){_0x27bba5[_0xfce2('0x1c')]=qs[_0xfce2('0x1c')](_0xa3128a[_0xfce2('0x30')][_0xfce2('0x1c')]);_0x27bba5[_0xfce2('0x1e')]=qs[_0xfce2('0x1e')](_0xa3128a['query'][_0xfce2('0x1e')]);}return _0x39f6d4[_0xfce2('0x60')](_0x27bba5);}})[_0xfce2('0x23')](function(_0x27c9ed){if(_0x27c9ed){return _0x27c9ed?{'count':_0x4a39bc,'rows':_0x27c9ed}:null;}})[_0xfce2('0x23')](respondWithResult(_0x307403,null))[_0xfce2('0x3f')](handleError(_0x307403,null));};exports[_0xfce2('0x62')]=function(_0x1defe4,_0x18239a,_0x42e152){var _0x55c743,_0x1942ae;var _0x3997d3=[];var _0xe2234=moment()['format'](_0xfce2('0x63'));return db['Campaign'][_0xfce2('0x45')]({'where':{'id':_0x1defe4[_0xfce2('0x41')]['id']}})[_0xfce2('0x23')](handleEntityNotFound(_0x18239a,null))[_0xfce2('0x23')](function(_0x27fd4d){if(_0x27fd4d){_0x1942ae=_0x27fd4d;return _0x27fd4d['addLists'](_0x1defe4[_0xfce2('0x46')][_0xfce2('0x64')],_['omit'](_0x1defe4[_0xfce2('0x46')],[_0xfce2('0x64'),'id'])||{});}return null;})[_0xfce2('0x65')](function(_0x2177bb){var _0x40a812;var _0x41962d;_0x55c743=_0x2177bb||[];var _0x2014c2=[];if(_0x2177bb){for(var _0x2bf272=0x0;_0x2bf272<_0x2177bb[_0xfce2('0x57')];_0x2bf272+=0x1){var _0x4f9441=_0x2177bb[_0x2bf272][_0xfce2('0x25')]({'plain':!![]});_0x1942ae[_0xfce2('0x66')]=_0x1defe4[_0xfce2('0x46')][_0xfce2('0x66')]?_0x1defe4['body'][_0xfce2('0x66')]:_0x1942ae[_0xfce2('0x66')];switch(_0x1942ae['dialCheckDuplicateType']){case _0xfce2('0x67'):_0x40a812=squel[_0xfce2('0x68')]()[_0xfce2('0x69')](_0xfce2('0x6a'))[_0xfce2('0x6b')](['phone','scheduledAt',_0xfce2('0x6c'),_0xfce2('0x6d'),'CampaignId',_0xfce2('0x50'),_0xfce2('0x51')],squel[_0xfce2('0x6e')]()[_0xfce2('0x6f')](_0xfce2('0x70'),_0xfce2('0x70'))['field'](_0xfce2('0x71'),'scheduledAt')[_0xfce2('0x6f')]('id',_0xfce2('0x6c'))[_0xfce2('0x6f')](_0x4f9441[_0xfce2('0x72')]['toString'](),'ListId')[_0xfce2('0x6f')](_0x1defe4[_0xfce2('0x41')]['id'][_0xfce2('0x73')](),_0xfce2('0x59'))[_0xfce2('0x6f')]('\x27'+_0xe2234+'\x27','createdAt')[_0xfce2('0x6f')]('\x27'+_0xe2234+'\x27',_0xfce2('0x51'))['from'](_0xfce2('0x74'))['where']('deletedAt\x20IS\x20NULL')[_0xfce2('0x39')]('ListId\x20=\x20?',_0x4f9441['CmListId'][_0xfce2('0x73')]())[_0xfce2('0x39')](_0xfce2('0x75'))[_0xfce2('0x39')](_0xfce2('0x76'),squel[_0xfce2('0x6e')]()[_0xfce2('0x6f')](_0xfce2('0x77'))[_0xfce2('0x78')]('cm_hopper_final')[_0xfce2('0x39')](_0xfce2('0x79'),_0x1defe4['params']['id'][_0xfce2('0x73')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xfce2('0x6f')](_0xfce2('0x7a'))[_0xfce2('0x78')](_0xfce2('0x6a'))[_0xfce2('0x39')](_0xfce2('0x79'),_0x1defe4[_0xfce2('0x41')]['id'][_0xfce2('0x73')]())))['toString']();break;case _0xfce2('0x7b'):_0x40a812=squel[_0xfce2('0x68')]()['into'](_0xfce2('0x6a'))[_0xfce2('0x6b')]([_0xfce2('0x70'),_0xfce2('0x7c'),_0xfce2('0x6c'),_0xfce2('0x6d'),'CampaignId',_0xfce2('0x50'),_0xfce2('0x51')],squel[_0xfce2('0x6e')]()[_0xfce2('0x6f')](_0xfce2('0x70'),_0xfce2('0x70'))['field'](_0xfce2('0x71'),_0xfce2('0x7c'))[_0xfce2('0x6f')]('id','ContactId')[_0xfce2('0x6f')](_0x4f9441[_0xfce2('0x72')][_0xfce2('0x73')](),'ListId')[_0xfce2('0x6f')](_0x1defe4[_0xfce2('0x41')]['id'][_0xfce2('0x73')](),_0xfce2('0x59'))[_0xfce2('0x6f')]('\x27'+_0xe2234+'\x27',_0xfce2('0x50'))['field']('\x27'+_0xe2234+'\x27',_0xfce2('0x51'))[_0xfce2('0x78')](_0xfce2('0x74'))[_0xfce2('0x39')](_0xfce2('0x7d'))[_0xfce2('0x39')](_0xfce2('0x7e'),_0x4f9441[_0xfce2('0x72')][_0xfce2('0x73')]())[_0xfce2('0x39')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xfce2('0x76'),squel[_0xfce2('0x6e')]()[_0xfce2('0x6f')]('COALESCE(phone,\x27\x27)')[_0xfce2('0x78')](_0xfce2('0x6a'))[_0xfce2('0x39')](_0xfce2('0x79'),_0x1defe4['params']['id']['toString']())))[_0xfce2('0x73')]();break;default:_0x40a812=squel['insert']()[_0xfce2('0x69')](_0xfce2('0x6a'))['fromQuery']([_0xfce2('0x70'),_0xfce2('0x7c'),_0xfce2('0x6c'),_0xfce2('0x6d'),_0xfce2('0x59'),_0xfce2('0x50'),'updatedAt'],squel[_0xfce2('0x6e')]()[_0xfce2('0x6f')](_0xfce2('0x70'),'phone')['field'](_0xfce2('0x71'),'scheduledAt')[_0xfce2('0x6f')]('id',_0xfce2('0x6c'))[_0xfce2('0x6f')](_0x4f9441[_0xfce2('0x72')]['toString'](),_0xfce2('0x6d'))[_0xfce2('0x6f')](_0x1defe4[_0xfce2('0x41')]['id'][_0xfce2('0x73')](),_0xfce2('0x59'))[_0xfce2('0x6f')]('\x27'+_0xe2234+'\x27',_0xfce2('0x50'))[_0xfce2('0x6f')]('\x27'+_0xe2234+'\x27',_0xfce2('0x51'))[_0xfce2('0x78')]('cm_contacts')['where'](_0xfce2('0x7d'))['where']('ListId\x20=\x20?',_0x4f9441[_0xfce2('0x72')]['toString']())[_0xfce2('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0xfce2('0x73')]();}_0x41962d=squel[_0xfce2('0x68')]()[_0xfce2('0x69')]('cm_hopper_additional_phones')[_0xfce2('0x6b')](['cmHopperId',_0xfce2('0x7c'),_0xfce2('0x70'),_0xfce2('0x7f'),_0xfce2('0x50'),'updatedAt'],squel['select']()['field'](_0xfce2('0x80'),'id')[_0xfce2('0x6f')](_0xfce2('0x71'),'scheduledAt')['field'](_0xfce2('0x81'),_0xfce2('0x70'))[_0xfce2('0x6f')](_0xfce2('0x82'),_0xfce2('0x7f'))[_0xfce2('0x6f')]('\x27'+_0xe2234+'\x27',_0xfce2('0x50'))[_0xfce2('0x6f')]('\x27'+_0xe2234+'\x27','updatedAt')[_0xfce2('0x78')](_0xfce2('0x83'),'ci')[_0xfce2('0x84')](_0xfce2('0x6a'),'h',_0xfce2('0x85'))[_0xfce2('0x39')](_0xfce2('0x86'),_0x4f9441[_0xfce2('0x72')]['toString']())[_0xfce2('0x39')](_0xfce2('0x87'),_0x1defe4[_0xfce2('0x41')]['id']['toString']())[_0xfce2('0x39')](_0xfce2('0x88'),_0xe2234))[_0xfce2('0x73')]();_0x2014c2[_0xfce2('0x89')](db[_0xfce2('0x8a')][_0xfce2('0x30')](_0x40a812));_0x3997d3['push'](db[_0xfce2('0x8a')]['query'](_0x41962d));}return BPromise[_0xfce2('0x8b')](_0x2014c2);}})[_0xfce2('0x23')](function(){return BPromise[_0xfce2('0x8b')](_0x3997d3);})['then'](function(){return _0x55c743;})[_0xfce2('0x23')](respondWithResult(_0x18239a,null))[_0xfce2('0x3f')](handleError(_0x18239a,null));};exports['removeLists']=function(_0x410ad7,_0xe0dbb7,_0x427a23){return db[_0xfce2('0x2c')]['find']({'where':{'id':_0x410ad7[_0xfce2('0x41')]['id']}})[_0xfce2('0x23')](handleEntityNotFound(_0xe0dbb7,null))[_0xfce2('0x23')](function(_0x10e68f){if(_0x10e68f){return _0x10e68f['removeLists'](_0x410ad7[_0xfce2('0x30')][_0xfce2('0x64')]);}})[_0xfce2('0x23')](function(_0x24a264){if(_0x24a264){return db[_0xfce2('0x56')]['destroy']({'where':{'ListId':_0x410ad7['query'][_0xfce2('0x64')],'CampaignId':_0x410ad7[_0xfce2('0x41')]['id']}})[_0xfce2('0x23')](function(){return _0x24a264;});}})[_0xfce2('0x23')](respondWithStatusCode(_0xe0dbb7,null))[_0xfce2('0x3f')](handleError(_0xe0dbb7,null));};exports[_0xfce2('0x8c')]=function(_0x4e8c09,_0x1319b2,_0x5b0823){var _0x50e0e0={};var _0x4c60ee={};var _0x313a32;var _0x439a2d;return db['Campaign'][_0xfce2('0x55')]({'where':{'id':_0x4e8c09[_0xfce2('0x41')]['id']}})[_0xfce2('0x23')](handleEntityNotFound(_0x1319b2,null))[_0xfce2('0x23')](function(_0x334079){if(_0x334079){_0x313a32=_0x334079;_0x4c60ee[_0xfce2('0x2f')]=_[_0xfce2('0x42')](db[_0xfce2('0x61')][_0xfce2('0x43')]);_0x4c60ee['query']=_[_0xfce2('0x42')](_0x4e8c09[_0xfce2('0x30')]);_0x4c60ee[_0xfce2('0x31')]=_[_0xfce2('0x32')](_0x4c60ee[_0xfce2('0x2f')],_0x4c60ee[_0xfce2('0x30')]);_0x50e0e0[_0xfce2('0x34')]=_[_0xfce2('0x32')](_0x4c60ee[_0xfce2('0x2f')],qs[_0xfce2('0x33')](_0x4e8c09[_0xfce2('0x30')]['fields']));_0x50e0e0[_0xfce2('0x34')]=_0x50e0e0[_0xfce2('0x34')][_0xfce2('0x57')]?_0x50e0e0['attributes']:_0x4c60ee[_0xfce2('0x2f')];_0x50e0e0[_0xfce2('0x36')]=qs[_0xfce2('0x37')](_0x4e8c09[_0xfce2('0x30')][_0xfce2('0x37')]);_0x50e0e0['where']=qs[_0xfce2('0x31')](_[_0xfce2('0x5b')](_0x4e8c09['query'],_0x4c60ee[_0xfce2('0x31')]));if(_0x4e8c09[_0xfce2('0x30')]['filter']){_0x50e0e0['where']=_['merge'](_0x50e0e0[_0xfce2('0x39')],{'$or':_[_0xfce2('0x2b')](_0x50e0e0[_0xfce2('0x34')],function(_0x1d163e){var _0x591b15={};_0x591b15[_0x1d163e]={'$like':'%'+_0x4e8c09[_0xfce2('0x30')][_0xfce2('0x38')]+'%'};return _0x591b15;})});}_0x50e0e0=_['merge']({},_0x50e0e0,_0x4e8c09[_0xfce2('0x44')]);return _0x313a32[_0xfce2('0x8c')](_0x50e0e0);}})[_0xfce2('0x23')](function(_0xc1df00){if(_0xc1df00){_0x439a2d=_0xc1df00[_0xfce2('0x57')];if(!_0x4e8c09['query'][_0xfce2('0x58')](_0xfce2('0x35'))){_0x50e0e0['limit']=qs[_0xfce2('0x1c')](_0x4e8c09[_0xfce2('0x30')]['limit']);_0x50e0e0[_0xfce2('0x1e')]=qs[_0xfce2('0x1e')](_0x4e8c09['query'][_0xfce2('0x1e')]);}return _0x313a32['getBlackLists'](_0x50e0e0);}})[_0xfce2('0x23')](function(_0x447029){if(_0x447029){return _0x447029?{'count':_0x439a2d,'rows':_0x447029}:null;}})['then'](respondWithResult(_0x1319b2,null))['catch'](handleError(_0x1319b2,null));};exports[_0xfce2('0x8d')]=function(_0x5cb503,_0x5cf2a8,_0x30517e){var _0x3a91d3,_0x2d5628;var _0x594d5c=[];var _0x4b180f=moment()['format'](_0xfce2('0x63'));return db[_0xfce2('0x2c')]['find']({'where':{'id':_0x5cb503[_0xfce2('0x41')]['id']}})['then'](handleEntityNotFound(_0x5cf2a8,null))[_0xfce2('0x23')](function(_0x117586){if(_0x117586){_0x2d5628=_0x117586;return _0x117586[_0xfce2('0x8d')](_0x5cb503[_0xfce2('0x46')]['ids'],_[_0xfce2('0x4f')](_0x5cb503[_0xfce2('0x46')],[_0xfce2('0x64'),'id'])||{});}return null;})['spread'](function(_0x2505b0){var _0x425438;var _0x1fe7f5;_0x3a91d3=_0x2505b0||[];var _0x77cde0=[];if(_0x2505b0){for(var _0x53c639=0x0;_0x53c639<_0x2505b0[_0xfce2('0x57')];_0x53c639+=0x1){var _0x1108e3=_0x2505b0[_0x53c639][_0xfce2('0x25')]({'plain':!![]});_0x425438=squel[_0xfce2('0x68')]()['into'](_0xfce2('0x8e'))['fromQuery']([_0xfce2('0x70'),'ContactId',_0xfce2('0x6d'),'CampaignId',_0xfce2('0x50'),'updatedAt'],squel[_0xfce2('0x6e')]()[_0xfce2('0x6f')](_0xfce2('0x70'),_0xfce2('0x70'))[_0xfce2('0x6f')]('id',_0xfce2('0x6c'))[_0xfce2('0x6f')](_0x1108e3[_0xfce2('0x72')]['toString'](),_0xfce2('0x6d'))[_0xfce2('0x6f')](_0x5cb503['params']['id']['toString'](),_0xfce2('0x59'))[_0xfce2('0x6f')]('NOW()','createdAt')[_0xfce2('0x6f')](_0xfce2('0x71'),'updatedAt')['from']('cm_contacts')[_0xfce2('0x39')](_0xfce2('0x7d'))[_0xfce2('0x39')](_0xfce2('0x7e'),_0x1108e3[_0xfce2('0x72')][_0xfce2('0x73')]())[_0xfce2('0x39')](_0xfce2('0x75')))[_0xfce2('0x73')]();_0x77cde0[_0xfce2('0x89')](db[_0xfce2('0x8a')]['query'](_0x425438));}return BPromise[_0xfce2('0x8b')](_0x77cde0);}})[_0xfce2('0x23')](function(){return _0x3a91d3;})[_0xfce2('0x23')](respondWithResult(_0x5cf2a8,null))[_0xfce2('0x3f')](handleError(_0x5cf2a8,null));};exports['removeBlackLists']=function(_0xb90b71,_0x156528,_0x1dd5e5){return db[_0xfce2('0x2c')][_0xfce2('0x45')]({'where':{'id':_0xb90b71[_0xfce2('0x41')]['id']}})[_0xfce2('0x23')](handleEntityNotFound(_0x156528,null))[_0xfce2('0x23')](function(_0xf9b381){if(_0xf9b381){return _0xf9b381[_0xfce2('0x8f')](_0xb90b71[_0xfce2('0x30')]['ids']);}})[_0xfce2('0x23')](function(_0x14b4ab){if(_0x14b4ab){return db[_0xfce2('0x5f')][_0xfce2('0x24')]({'where':{'ListId':_0xb90b71[_0xfce2('0x30')]['ids'],'CampaignId':_0xb90b71[_0xfce2('0x41')]['id']}})[_0xfce2('0x23')](function(){return _0x14b4ab;});}})[_0xfce2('0x23')](respondWithStatusCode(_0x156528,null))[_0xfce2('0x3f')](handleError(_0x156528,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 7af845c..1b04d62 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(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x2c341e,_0x414d11){var _0x43c1e8=function(_0xe783f3){while(--_0xe783f3){_0x2c341e['push'](_0x2c341e['shift']());}};_0x43c1e8(++_0x414d11);}(_0x7a54,0x106));var _0x47a5=function(_0x6c8a75,_0x21879b){_0x6c8a75=_0x6c8a75-0x0;var _0x378714=_0x7a54[_0x6c8a75];return _0x378714;};'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 3aebb79..5c49078 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 _0xce25=['code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x3ab4bb,_0x4568e8){var _0x46aa87=function(_0xcc43bf){while(--_0xcc43bf){_0x3ab4bb['push'](_0x3ab4bb['shift']());}};_0x46aa87(++_0x4568e8);}(_0xce25,0x196));var _0x5ce2=function(_0x238020,_0x3fa739){_0x238020=_0x238020-0x0;var _0x550533=_0xce25[_0x238020];return _0x550533;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5ce2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ce2('0x1'))['db'];var utils=require(_0x5ce2('0x2'));var logger=require('../../config/logger')(_0x5ce2('0x3'));var config=require(_0x5ce2('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ce2('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x417149,_0x1ab2e7,_0xcb80ee){return new BPromise(function(_0x4a57a6,_0x2ccf81){return client[_0x5ce2('0x6')](_0x417149,_0xcb80ee)[_0x5ce2('0x7')](function(_0x49ede4){logger[_0x5ce2('0x8')](_0x5ce2('0x9'),_0x1ab2e7,_0x5ce2('0xa'));logger[_0x5ce2('0xb')](_0x5ce2('0xc'),_0x1ab2e7,_0x5ce2('0xa'),JSON['stringify'](_0x49ede4));if(_0x49ede4[_0x5ce2('0xd')]){if(_0x49ede4['error'][_0x5ce2('0xe')]===0x1f4){logger[_0x5ce2('0xd')]('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4['error']['message']);return _0x2ccf81(_0x49ede4['error'][_0x5ce2('0xf')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4[_0x5ce2('0xd')]['message']);return _0x4a57a6(_0x49ede4[_0x5ce2('0xd')][_0x5ce2('0xf')]);}else{logger[_0x5ce2('0x8')]('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x5ce2('0xa'));_0x4a57a6(_0x49ede4[_0x5ce2('0x10')][_0x5ce2('0xf')]);}})['catch'](function(_0x4b89d3){logger[_0x5ce2('0xd')](_0x5ce2('0x9'),_0x1ab2e7,_0x4b89d3);_0x2ccf81(_0x4b89d3);});});}exports[_0x5ce2('0x11')]=function(_0x5369e7){var _0x19915d=this;return new Promise(function(_0x30cb39,_0x3dd57a){return db[_0x5ce2('0x12')][_0x5ce2('0x13')]({'raw':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x15')]===undefined?!![]:![]:!![],'where':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x16')]||null:null,'attributes':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x17')]||null:null,'limit':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x18')]||null:null,'include':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')]['include']?_['map'](_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x19')],function(_0x3440b5){return{'model':db[_0x3440b5['model']],'as':_0x3440b5['as'],'attributes':_0x3440b5['attributes'],'include':_0x3440b5[_0x5ce2('0x19')]?_[_0x5ce2('0x1a')](_0x3440b5['include'],function(_0x3008af){return{'model':db[_0x3008af[_0x5ce2('0x1b')]],'as':_0x3008af['as'],'attributes':_0x3008af[_0x5ce2('0x17')],'include':_0x3008af[_0x5ce2('0x19')]?_[_0x5ce2('0x1a')](_0x3008af[_0x5ce2('0x19')],function(_0x3a4bb9){return{'model':db[_0x3a4bb9[_0x5ce2('0x1b')]],'as':_0x3a4bb9['as'],'attributes':_0x3a4bb9[_0x5ce2('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5ce2('0x7')](function(_0x2f4ccd){logger[_0x5ce2('0x8')](_0x5ce2('0x11'),_0x5369e7);logger[_0x5ce2('0xb')](_0x5ce2('0x11'),_0x5369e7,JSON[_0x5ce2('0x1c')](_0x2f4ccd));_0x30cb39(_0x2f4ccd);})[_0x5ce2('0x1d')](function(_0x2898ae){logger[_0x5ce2('0xd')](_0x5ce2('0x11'),_0x2898ae[_0x5ce2('0xf')],_0x5369e7);_0x3dd57a(_0x19915d[_0x5ce2('0xd')](0x1f4,_0x2898ae[_0x5ce2('0xf')]));});});};
\ No newline at end of file
+var _0x8d9b=['info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','attributes','include','map','model','debug','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','request','then'];(function(_0x57b58b,_0x59b61e){var _0x453a3a=function(_0x7b6f5e){while(--_0x7b6f5e){_0x57b58b['push'](_0x57b58b['shift']());}};_0x453a3a(++_0x59b61e);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var moment=require(_0xb8d9('0x2'));var BPromise=require(_0xb8d9('0x3'));var rs=require(_0xb8d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb8d9('0x5'));var logger=require('../../config/logger')(_0xb8d9('0x6'));var config=require(_0xb8d9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21c87d,_0x537b18,_0x53339b){return new BPromise(function(_0x4c2b8f,_0x13352e){return client[_0xb8d9('0x8')](_0x21c87d,_0x53339b)[_0xb8d9('0x9')](function(_0x2189b1){logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));logger['debug'](_0xb8d9('0xd'),_0x537b18,'request\x20sent',JSON[_0xb8d9('0xe')](_0x2189b1));if(_0x2189b1[_0xb8d9('0xf')]){if(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x10')]===0x1f4){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x13352e(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);}logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x4c2b8f(_0x2189b1['error'][_0xb8d9('0x11')]);}else{logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));_0x4c2b8f(_0x2189b1[_0xb8d9('0x12')]['message']);}})['catch'](function(_0x5b7d5a){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x5b7d5a);_0x13352e(_0x5b7d5a);});});}exports[_0xb8d9('0x13')]=function(_0x1183e4){var _0x4fec1e=this;return new Promise(function(_0x31b33f,_0x59b7f6){return db[_0xb8d9('0x14')][_0xb8d9('0x15')]({'raw':_0x1183e4[_0xb8d9('0x16')]?_0x1183e4[_0xb8d9('0x16')][_0xb8d9('0x17')]===undefined?!![]:![]:!![],'where':_0x1183e4['options']?_0x1183e4['options']['where']||null:null,'attributes':_0x1183e4[_0xb8d9('0x16')]?_0x1183e4[_0xb8d9('0x16')][_0xb8d9('0x18')]||null:null,'limit':_0x1183e4[_0xb8d9('0x16')]?_0x1183e4[_0xb8d9('0x16')]['limit']||null:null,'include':_0x1183e4[_0xb8d9('0x16')]?_0x1183e4[_0xb8d9('0x16')][_0xb8d9('0x19')]?_[_0xb8d9('0x1a')](_0x1183e4[_0xb8d9('0x16')][_0xb8d9('0x19')],function(_0x3f4b9d){return{'model':db[_0x3f4b9d[_0xb8d9('0x1b')]],'as':_0x3f4b9d['as'],'attributes':_0x3f4b9d[_0xb8d9('0x18')],'include':_0x3f4b9d[_0xb8d9('0x19')]?_['map'](_0x3f4b9d[_0xb8d9('0x19')],function(_0x49380d){return{'model':db[_0x49380d['model']],'as':_0x49380d['as'],'attributes':_0x49380d[_0xb8d9('0x18')],'include':_0x49380d[_0xb8d9('0x19')]?_[_0xb8d9('0x1a')](_0x49380d[_0xb8d9('0x19')],function(_0x30b346){return{'model':db[_0x30b346['model']],'as':_0x30b346['as'],'attributes':_0x30b346[_0xb8d9('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb8d9('0x9')](function(_0x3111aa){logger['info'](_0xb8d9('0x13'),_0x1183e4);logger[_0xb8d9('0x1c')](_0xb8d9('0x13'),_0x1183e4,JSON['stringify'](_0x3111aa));_0x31b33f(_0x3111aa);})[_0xb8d9('0x1d')](function(_0x12a043){logger['error'](_0xb8d9('0x13'),_0x12a043[_0xb8d9('0x11')],_0x1183e4);_0x59b7f6(_0x4fec1e[_0xb8d9('0xf')](0x1f4,_0x12a043[_0xb8d9('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 3d000d7..74ef8e6 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 _0x5119=['/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','clone','addLists','put','/:id','update','destroy','removeLists','delete','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','show','get','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x19e785,_0x115ef1){var _0x5b4a67=function(_0x156346){while(--_0x156346){_0x19e785['push'](_0x19e785['shift']());}};_0x5b4a67(++_0x115ef1);}(_0x5119,0xc0));var _0x9511=function(_0x3b6d96,_0x5d3241){_0x3b6d96=_0x3b6d96-0x0;var _0x1e6b1c=_0x5119[_0x3b6d96];return _0x1e6b1c;};'use strict';var multer=require(_0x9511('0x0'));var util=require('util');var path=require(_0x9511('0x1'));var timeout=require(_0x9511('0x2'));var express=require(_0x9511('0x3'));var router=express[_0x9511('0x4')]();var fs_extra=require(_0x9511('0x5'));var auth=require(_0x9511('0x6'));var interaction=require(_0x9511('0x7'));var config=require(_0x9511('0x8'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9511('0x9')]);router['get']('/:id',auth[_0x9511('0xa')](),controller[_0x9511('0xb')]);router[_0x9511('0xc')](_0x9511('0xd'),auth[_0x9511('0xa')](),controller[_0x9511('0xe')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x9511('0xf')]);router[_0x9511('0xc')](_0x9511('0x10'),auth['isAuthenticated'](),controller[_0x9511('0x11')]);router[_0x9511('0xc')](_0x9511('0x12'),auth[_0x9511('0xa')](),controller[_0x9511('0x13')]);router[_0x9511('0xc')](_0x9511('0x14'),auth[_0x9511('0xa')](),controller['getLists']);router[_0x9511('0xc')](_0x9511('0x15'),auth[_0x9511('0xa')](),controller['getBlackLists']);router[_0x9511('0x16')]('/',auth['isAuthenticated'](),controller[_0x9511('0x17')]);router['post'](_0x9511('0x18'),auth[_0x9511('0xa')](),controller[_0x9511('0x19')]);router['post'](_0x9511('0x14'),auth[_0x9511('0xa')](),controller[_0x9511('0x1a')]);router[_0x9511('0x16')](_0x9511('0x15'),auth[_0x9511('0xa')](),controller['addBlackLists']);router[_0x9511('0x1b')](_0x9511('0x1c'),auth['isAuthenticated'](),controller[_0x9511('0x1d')]);router['delete']('/:id',auth[_0x9511('0xa')](),controller[_0x9511('0x1e')]);router['delete'](_0x9511('0x14'),auth[_0x9511('0xa')](),controller[_0x9511('0x1f')]);router[_0x9511('0x20')](_0x9511('0x15'),auth[_0x9511('0xa')](),controller[_0x9511('0x21')]);module[_0x9511('0x22')]=router;
\ No newline at end of file
+var _0xcd56=['put','/:id','update','delete','destroy','removeLists','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','create','clone','post','addLists','addBlackLists'];(function(_0x101a1e,_0x4db125){var _0x1c4615=function(_0x22a357){while(--_0x22a357){_0x101a1e['push'](_0x101a1e['shift']());}};_0x1c4615(++_0x4db125);}(_0xcd56,0xb1));var _0x6cd5=function(_0x3faa28,_0x3d2352){_0x3faa28=_0x3faa28-0x0;var _0x467d46=_0xcd56[_0x3faa28];return _0x467d46;};'use strict';var multer=require(_0x6cd5('0x0'));var util=require(_0x6cd5('0x1'));var path=require('path');var timeout=require(_0x6cd5('0x2'));var express=require(_0x6cd5('0x3'));var router=express['Router']();var fs_extra=require(_0x6cd5('0x4'));var auth=require(_0x6cd5('0x5'));var interaction=require(_0x6cd5('0x6'));var config=require('../../config/environment');var controller=require(_0x6cd5('0x7'));router[_0x6cd5('0x8')]('/',auth[_0x6cd5('0x9')](),controller[_0x6cd5('0xa')]);router[_0x6cd5('0x8')]('/:id',auth[_0x6cd5('0x9')](),controller[_0x6cd5('0xb')]);router[_0x6cd5('0x8')](_0x6cd5('0xc'),auth[_0x6cd5('0x9')](),controller[_0x6cd5('0xd')]);router[_0x6cd5('0x8')]('/:id/hopper_histories',auth[_0x6cd5('0x9')](),controller[_0x6cd5('0xe')]);router[_0x6cd5('0x8')](_0x6cd5('0xf'),auth[_0x6cd5('0x9')](),controller[_0x6cd5('0x10')]);router[_0x6cd5('0x8')](_0x6cd5('0x11'),auth[_0x6cd5('0x9')](),controller[_0x6cd5('0x12')]);router[_0x6cd5('0x8')](_0x6cd5('0x13'),auth['isAuthenticated'](),controller['getLists']);router[_0x6cd5('0x8')](_0x6cd5('0x14'),auth[_0x6cd5('0x9')](),controller[_0x6cd5('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6cd5('0x16')]);router['post']('/:id/clone',auth[_0x6cd5('0x9')](),controller[_0x6cd5('0x17')]);router[_0x6cd5('0x18')](_0x6cd5('0x13'),auth[_0x6cd5('0x9')](),controller[_0x6cd5('0x19')]);router[_0x6cd5('0x18')](_0x6cd5('0x14'),auth['isAuthenticated'](),controller[_0x6cd5('0x1a')]);router[_0x6cd5('0x1b')](_0x6cd5('0x1c'),auth[_0x6cd5('0x9')](),controller[_0x6cd5('0x1d')]);router[_0x6cd5('0x1e')]('/:id',auth[_0x6cd5('0x9')](),controller[_0x6cd5('0x1f')]);router['delete']('/:id/lists',auth[_0x6cd5('0x9')](),controller[_0x6cd5('0x20')]);router[_0x6cd5('0x1e')](_0x6cd5('0x14'),auth[_0x6cd5('0x9')](),controller['removeBlackLists']);module[_0x6cd5('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index a079c6f..a2776ab 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 _0x1497=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x4a258b,_0xb0006c){var _0x5ea6dc=function(_0x43bae0){while(--_0x43bae0){_0x4a258b['push'](_0x4a258b['shift']());}};_0x5ea6dc(++_0xb0006c);}(_0x1497,0x1ec));var _0x7149=function(_0x435d38,_0x2a187a){_0x435d38=_0x435d38-0x0;var _0x49e4f7=_0x1497[_0x435d38];return _0x49e4f7;};'use strict';var Sequelize=require(_0x7149('0x0'));module[_0x7149('0x1')]={'key':{'type':Sequelize[_0x7149('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7149('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x7149('0x2')]},'name':{'type':Sequelize[_0x7149('0x4')],'get':function(){return this[_0x7149('0x5')](_0x7149('0x6'));}}};
\ No newline at end of file
+var _0x9f50=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x517d9e,_0x214a0a){var _0x2da8ac=function(_0xf5e07c){while(--_0xf5e07c){_0x517d9e['push'](_0x517d9e['shift']());}};_0x2da8ac(++_0x214a0a);}(_0x9f50,0x13b));var _0x09f5=function(_0x3d8240,_0x2663d4){_0x3d8240=_0x3d8240-0x0;var _0x3d0372=_0x9f50[_0x3d8240];return _0x3d0372;};'use strict';var Sequelize=require(_0x09f5('0x0'));module[_0x09f5('0x1')]={'key':{'type':Sequelize[_0x09f5('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x09f5('0x2')]},'name':{'type':Sequelize[_0x09f5('0x3')],'get':function(){return this[_0x09f5('0x4')](_0x09f5('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 0bdddc0..e336730 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 _0xf530=['autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','CannedAnswers','end','sendStatus','error','stack','name','send','map','CannedAnswer','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','rows','catch','show','params','rawAttributes','include','find','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','get','UserProfileSection','userProfileId'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xf530,0xf6));var _0x0f53=function(_0x4e5d34,_0x42fc23){_0x4e5d34=_0x4e5d34-0x0;var _0xdf9586=_0xf530[_0x4e5d34];return _0xdf9586;};'use strict';var emlformat=require(_0x0f53('0x0'));var rimraf=require(_0x0f53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f53('0x2'));var rp=require(_0x0f53('0x3'));var moment=require(_0x0f53('0x4'));var BPromise=require(_0x0f53('0x5'));var Mustache=require(_0x0f53('0x6'));var util=require(_0x0f53('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0f53('0x8'));var crypto=require(_0x0f53('0x9'));var jsforce=require(_0x0f53('0xa'));var deskjs=require(_0x0f53('0xb'));var toCsv=require(_0x0f53('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0f53('0xd'));var authService=require(_0x0f53('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0f53('0xf'));var hardwareService=require(_0x0f53('0x10'));var logger=require(_0x0f53('0x11'))(_0x0f53('0x12'));var utils=require('../../config/utils');var config=require(_0x0f53('0x13'));var licenseUtil=require(_0x0f53('0x14'));var db=require(_0x0f53('0x15'))['db'];function respondWithStatusCode(_0x590db3,_0x3fa5a9){_0x3fa5a9=_0x3fa5a9||0xcc;return function(_0x5eca1c){if(_0x5eca1c){return _0x590db3['sendStatus'](_0x3fa5a9);}return _0x590db3[_0x0f53('0x16')](_0x3fa5a9)['end']();};}function respondWithResult(_0x2fdd43,_0x5aa4a1){_0x5aa4a1=_0x5aa4a1||0xc8;return function(_0x273b7c){if(_0x273b7c){return _0x2fdd43[_0x0f53('0x16')](_0x5aa4a1)['json'](_0x273b7c);}};}function respondWithFilteredResult(_0x1975b1,_0x101c9e){return function(_0x2415b4){if(_0x2415b4){var _0x444529=typeof _0x101c9e[_0x0f53('0x17')]===_0x0f53('0x18')&&typeof _0x101c9e['limit']===_0x0f53('0x18');var _0x1bd151=_0x2415b4[_0x0f53('0x19')];var _0x3af042=_0x444529?0x0:_0x101c9e['offset'];var _0x405e2c=_0x444529?_0x2415b4[_0x0f53('0x19')]:_0x101c9e[_0x0f53('0x17')]+_0x101c9e[_0x0f53('0x1a')];var _0x3fcbc2;if(_0x405e2c>=_0x1bd151){_0x405e2c=_0x1bd151;_0x3fcbc2=0xc8;}else{_0x3fcbc2=0xce;}_0x1975b1['status'](_0x3fcbc2);return _0x1975b1[_0x0f53('0x1b')](_0x0f53('0x1c'),_0x3af042+'-'+_0x405e2c+'/'+_0x1bd151)['json'](_0x2415b4);}return null;};}function patchUpdates(_0x1d3ead){return function(_0x5e1b19){try{jsonpatch[_0x0f53('0x1d')](_0x5e1b19,_0x1d3ead,!![]);}catch(_0x1b4e6f){return BPromise[_0x0f53('0x1e')](_0x1b4e6f);}return _0x5e1b19['save']();};}function saveUpdates(_0x759735,_0x49dc3e){return function(_0x186071){if(_0x186071){return _0x186071['update'](_0x759735)[_0x0f53('0x1f')](function(_0x50a6dc){return _0x50a6dc;});}return null;};}function removeEntity(_0x5c70b7,_0x82879e){return function(_0x192dee){if(_0x192dee){return _0x192dee[_0x0f53('0x20')]()[_0x0f53('0x1f')](function(){var _0x4dc0d6=_0x192dee['get']({'plain':!![]});var _0x196782=_0x0f53('0x21');return db['UserProfileResource'][_0x0f53('0x20')]({'where':{'type':_0x196782,'resourceId':_0x4dc0d6['id']}})[_0x0f53('0x1f')](function(){return _0x192dee;});})['then'](function(){_0x5c70b7['status'](0xcc)[_0x0f53('0x22')]();});}};}function handleEntityNotFound(_0x3a480c,_0x41b7ad){return function(_0x302f03){if(!_0x302f03){_0x3a480c[_0x0f53('0x23')](0x194);}return _0x302f03;};}function handleError(_0x1ecf62,_0x66e399){_0x66e399=_0x66e399||0x1f4;return function(_0x299dd8){logger[_0x0f53('0x24')](_0x299dd8[_0x0f53('0x25')]);if(_0x299dd8[_0x0f53('0x26')]){delete _0x299dd8[_0x0f53('0x26')];}_0x1ecf62[_0x0f53('0x16')](_0x66e399)[_0x0f53('0x27')](_0x299dd8);};}exports['index']=function(_0x38cbe6,_0x53d371){var _0x3d3c35={},_0x693e27={},_0x51748b={'count':0x0,'rows':[]};var _0x2b1ea9=_[_0x0f53('0x28')](db[_0x0f53('0x29')]['rawAttributes'],function(_0x24cb74){return{'name':_0x24cb74['fieldName'],'type':_0x24cb74['type'][_0x0f53('0x2a')]};});_0x693e27['model']=_[_0x0f53('0x28')](_0x2b1ea9,_0x0f53('0x26'));_0x693e27[_0x0f53('0x2b')]=_[_0x0f53('0x2c')](_0x38cbe6[_0x0f53('0x2b')]);_0x693e27[_0x0f53('0x2d')]=_[_0x0f53('0x2e')](_0x693e27[_0x0f53('0x2f')],_0x693e27[_0x0f53('0x2b')]);_0x3d3c35[_0x0f53('0x30')]=_[_0x0f53('0x2e')](_0x693e27['model'],qs[_0x0f53('0x31')](_0x38cbe6['query'][_0x0f53('0x31')]));_0x3d3c35[_0x0f53('0x30')]=_0x3d3c35['attributes'][_0x0f53('0x32')]?_0x3d3c35[_0x0f53('0x30')]:_0x693e27[_0x0f53('0x2f')];if(!_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x33')](_0x0f53('0x34'))){_0x3d3c35[_0x0f53('0x1a')]=qs[_0x0f53('0x1a')](_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x1a')]);_0x3d3c35[_0x0f53('0x17')]=qs['offset'](_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x17')]);}_0x3d3c35[_0x0f53('0x35')]=qs[_0x0f53('0x36')](_0x38cbe6[_0x0f53('0x2b')]['sort']);_0x3d3c35[_0x0f53('0x37')]=qs[_0x0f53('0x2d')](_['pick'](_0x38cbe6['query'],_0x693e27[_0x0f53('0x2d')]),_0x2b1ea9);if(_0x38cbe6['query']['filter']){_0x3d3c35[_0x0f53('0x37')]=_[_0x0f53('0x38')](_0x3d3c35[_0x0f53('0x37')],{'$or':[{'key':{'$like':'%'+_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x39')]+'%'}},{'value':{'$like':'%'+_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x39')]+'%'}}]});}_0x3d3c35=_['merge']({},_0x3d3c35,_0x38cbe6[_0x0f53('0x3a')]);var _0x9b503e={'where':_0x3d3c35[_0x0f53('0x37')]};return db[_0x0f53('0x29')]['count'](_0x9b503e)[_0x0f53('0x1f')](function(_0x38d8fd){_0x51748b[_0x0f53('0x19')]=_0x38d8fd;if(_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x3b')]){_0x3d3c35['include']=[{'all':!![]}];}return db[_0x0f53('0x29')]['findAll'](_0x3d3c35);})[_0x0f53('0x1f')](function(_0x216b2f){_0x51748b[_0x0f53('0x3c')]=_0x216b2f;return _0x51748b;})['then'](respondWithFilteredResult(_0x53d371,_0x3d3c35))[_0x0f53('0x3d')](handleError(_0x53d371,null));};exports[_0x0f53('0x3e')]=function(_0x2e081a,_0x729fe6){var _0x35bf00={'raw':!![],'where':{'id':_0x2e081a[_0x0f53('0x3f')]['id']}},_0x38733c={};_0x38733c[_0x0f53('0x2f')]=_[_0x0f53('0x2c')](db[_0x0f53('0x29')][_0x0f53('0x40')]);_0x38733c['query']=_['keys'](_0x2e081a[_0x0f53('0x2b')]);_0x38733c[_0x0f53('0x2d')]=_[_0x0f53('0x2e')](_0x38733c[_0x0f53('0x2f')],_0x38733c['query']);_0x35bf00[_0x0f53('0x30')]=_[_0x0f53('0x2e')](_0x38733c[_0x0f53('0x2f')],qs[_0x0f53('0x31')](_0x2e081a[_0x0f53('0x2b')]['fields']));_0x35bf00['attributes']=_0x35bf00[_0x0f53('0x30')][_0x0f53('0x32')]?_0x35bf00[_0x0f53('0x30')]:_0x38733c[_0x0f53('0x2f')];if(_0x2e081a[_0x0f53('0x2b')]['includeAll']){_0x35bf00[_0x0f53('0x41')]=[{'all':!![]}];}_0x35bf00=_[_0x0f53('0x38')]({},_0x35bf00,_0x2e081a['options']);return db[_0x0f53('0x29')][_0x0f53('0x42')](_0x35bf00)[_0x0f53('0x1f')](handleEntityNotFound(_0x729fe6,null))[_0x0f53('0x1f')](respondWithResult(_0x729fe6,null))[_0x0f53('0x3d')](handleError(_0x729fe6,null));};exports[_0x0f53('0x43')]=function(_0x1d990e,_0x596c77){if(_0x1d990e[_0x0f53('0x44')]['id']){delete _0x1d990e['body']['id'];}return db[_0x0f53('0x29')][_0x0f53('0x42')]({'where':{'id':_0x1d990e[_0x0f53('0x3f')]['id']}})['then'](handleEntityNotFound(_0x596c77,null))['then'](saveUpdates(_0x1d990e[_0x0f53('0x44')],null))['then'](respondWithResult(_0x596c77,null))[_0x0f53('0x3d')](handleError(_0x596c77,null));};exports[_0x0f53('0x20')]=function(_0x1db7be,_0x5619df){return db[_0x0f53('0x29')][_0x0f53('0x42')]({'where':{'id':_0x1db7be[_0x0f53('0x3f')]['id']}})[_0x0f53('0x1f')](handleEntityNotFound(_0x5619df,null))[_0x0f53('0x1f')](removeEntity(_0x5619df,null))['catch'](handleError(_0x5619df,null));};exports['create']=function(_0x580def,_0x5291fb){var _0x5f3357={'key':_0x580def['body']['key']};if(_0x580def[_0x0f53('0x44')][_0x0f53('0x45')]){_0x5f3357['MailAccountId']=_0x580def[_0x0f53('0x44')][_0x0f53('0x45')];}else if(_0x580def[_0x0f53('0x44')][_0x0f53('0x46')]){_0x5f3357['SmsAccountId']=_0x580def['body'][_0x0f53('0x46')];}else if(_0x580def['body'][_0x0f53('0x47')]){_0x5f3357['OpenchannelAccountId']=_0x580def['body'][_0x0f53('0x47')];}else if(_0x580def['body'][_0x0f53('0x48')]){_0x5f3357[_0x0f53('0x48')]=_0x580def[_0x0f53('0x44')][_0x0f53('0x48')];}return db['CannedAnswer']['find']({'where':_0x5f3357})[_0x0f53('0x1f')](function(_0x4282d8){if(_0x4282d8){throw new db['Sequelize']['ValidationError'](_0x0f53('0x49'));}return db['CannedAnswer']['create'](_0x580def[_0x0f53('0x44')]);})[_0x0f53('0x1f')](function(_0x40c458){var _0x26406b=_0x580def[_0x0f53('0x4a')]['get']({'plain':!![]});if(!_0x26406b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26406b['role']===_0x0f53('0x4a')){var _0x37a297=_0x40c458[_0x0f53('0x4b')]({'plain':!![]});return db[_0x0f53('0x4c')][_0x0f53('0x42')]({'where':{'name':'CannedAnswers','userProfileId':_0x26406b[_0x0f53('0x4d')]},'raw':!![]})[_0x0f53('0x1f')](function(_0x39c837){if(_0x39c837&&_0x39c837[_0x0f53('0x4e')]===0x0){return db['UserProfileResource'][_0x0f53('0x4f')]({'name':_0x37a297[_0x0f53('0x26')],'resourceId':_0x37a297['id'],'type':_0x39c837[_0x0f53('0x26')],'sectionId':_0x39c837['id']},{})[_0x0f53('0x1f')](function(){return _0x40c458;});}else{return _0x40c458;}})[_0x0f53('0x3d')](function(_0x1bccfd){logger[_0x0f53('0x24')](_0x0f53('0x50'),_0x1bccfd);throw _0x1bccfd;});}return _0x40c458;})[_0x0f53('0x1f')](respondWithResult(_0x5291fb,0xc9))['catch'](handleError(_0x5291fb,null));};
\ No newline at end of file
+var _0xdad8=['error','stack','name','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','options','includeAll','include','CannedAnswer','findAll','show','params','merge','catch','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers'];(function(_0x544c03,_0x558fe4){var _0x5e86ad=function(_0x3b2aaf){while(--_0x3b2aaf){_0x544c03['push'](_0x544c03['shift']());}};_0x5e86ad(++_0x558fe4);}(_0xdad8,0x84));var _0x8dad=function(_0x3c0276,_0x3e2e1d){_0x3c0276=_0x3c0276-0x0;var _0x554860=_0xdad8[_0x3c0276];return _0x554860;};'use strict';var emlformat=require(_0x8dad('0x0'));var rimraf=require(_0x8dad('0x1'));var zipdir=require(_0x8dad('0x2'));var jsonpatch=require(_0x8dad('0x3'));var rp=require(_0x8dad('0x4'));var moment=require('moment');var BPromise=require(_0x8dad('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8dad('0x6'));var sox=require(_0x8dad('0x7'));var csv=require(_0x8dad('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8dad('0x9'));var _=require(_0x8dad('0xa'));var squel=require(_0x8dad('0xb'));var crypto=require('crypto');var jsforce=require(_0x8dad('0xc'));var deskjs=require(_0x8dad('0xd'));var toCsv=require(_0x8dad('0x8'));var querystring=require('querystring');var Papa=require(_0x8dad('0xe'));var Redis=require('ioredis');var authService=require(_0x8dad('0xf'));var qs=require(_0x8dad('0x10'));var as=require(_0x8dad('0x11'));var hardwareService=require(_0x8dad('0x12'));var logger=require(_0x8dad('0x13'))(_0x8dad('0x14'));var utils=require(_0x8dad('0x15'));var config=require(_0x8dad('0x16'));var licenseUtil=require(_0x8dad('0x17'));var db=require(_0x8dad('0x18'))['db'];function respondWithStatusCode(_0x2a3b5f,_0xaf5cf3){_0xaf5cf3=_0xaf5cf3||0xcc;return function(_0x2ebe94){if(_0x2ebe94){return _0x2a3b5f[_0x8dad('0x19')](_0xaf5cf3);}return _0x2a3b5f['status'](_0xaf5cf3)[_0x8dad('0x1a')]();};}function respondWithResult(_0x43d8d7,_0x3d12a9){_0x3d12a9=_0x3d12a9||0xc8;return function(_0x442640){if(_0x442640){return _0x43d8d7[_0x8dad('0x1b')](_0x3d12a9)[_0x8dad('0x1c')](_0x442640);}};}function respondWithFilteredResult(_0x152b87,_0x13ab7){return function(_0x1808e1){if(_0x1808e1){var _0x23f682=typeof _0x13ab7['offset']==='undefined'&&typeof _0x13ab7[_0x8dad('0x1d')]===_0x8dad('0x1e');var _0x1d75ae=_0x1808e1[_0x8dad('0x1f')];var _0x248074=_0x23f682?0x0:_0x13ab7[_0x8dad('0x20')];var _0x21b25b=_0x23f682?_0x1808e1[_0x8dad('0x1f')]:_0x13ab7['offset']+_0x13ab7['limit'];var _0x524ad6;if(_0x21b25b>=_0x1d75ae){_0x21b25b=_0x1d75ae;_0x524ad6=0xc8;}else{_0x524ad6=0xce;}_0x152b87[_0x8dad('0x1b')](_0x524ad6);return _0x152b87[_0x8dad('0x21')](_0x8dad('0x22'),_0x248074+'-'+_0x21b25b+'/'+_0x1d75ae)[_0x8dad('0x1c')](_0x1808e1);}return null;};}function patchUpdates(_0x2c0e19){return function(_0x26696d){try{jsonpatch[_0x8dad('0x23')](_0x26696d,_0x2c0e19,!![]);}catch(_0x2ac814){return BPromise[_0x8dad('0x24')](_0x2ac814);}return _0x26696d['save']();};}function saveUpdates(_0x507025,_0x53aa8b){return function(_0x258dea){if(_0x258dea){return _0x258dea[_0x8dad('0x25')](_0x507025)['then'](function(_0x1cb4b4){return _0x1cb4b4;});}return null;};}function removeEntity(_0x3cfa93,_0x5c5be3){return function(_0x3e5444){if(_0x3e5444){return _0x3e5444[_0x8dad('0x26')]()[_0x8dad('0x27')](function(){var _0x2356b5=_0x3e5444[_0x8dad('0x28')]({'plain':!![]});var _0x1ac8c2=_0x8dad('0x29');return db['UserProfileResource'][_0x8dad('0x26')]({'where':{'type':_0x1ac8c2,'resourceId':_0x2356b5['id']}})[_0x8dad('0x27')](function(){return _0x3e5444;});})[_0x8dad('0x27')](function(){_0x3cfa93['status'](0xcc)[_0x8dad('0x1a')]();});}};}function handleEntityNotFound(_0x243c94,_0x28a6a5){return function(_0x2c680a){if(!_0x2c680a){_0x243c94[_0x8dad('0x19')](0x194);}return _0x2c680a;};}function handleError(_0x30843f,_0x2e2a2e){_0x2e2a2e=_0x2e2a2e||0x1f4;return function(_0x5dfd77){logger[_0x8dad('0x2a')](_0x5dfd77[_0x8dad('0x2b')]);if(_0x5dfd77[_0x8dad('0x2c')]){delete _0x5dfd77['name'];}_0x30843f['status'](_0x2e2a2e)['send'](_0x5dfd77);};}exports['index']=function(_0x4abdee,_0x348c59){var _0x3bb175={},_0x50cd45={},_0x3cd45b={'count':0x0,'rows':[]};var _0x1b1e53=_[_0x8dad('0x2d')](db['CannedAnswer'][_0x8dad('0x2e')],function(_0x3a895f){return{'name':_0x3a895f[_0x8dad('0x2f')],'type':_0x3a895f['type'][_0x8dad('0x30')]};});_0x50cd45['model']=_['map'](_0x1b1e53,_0x8dad('0x2c'));_0x50cd45[_0x8dad('0x31')]=_[_0x8dad('0x32')](_0x4abdee[_0x8dad('0x31')]);_0x50cd45[_0x8dad('0x33')]=_[_0x8dad('0x34')](_0x50cd45[_0x8dad('0x35')],_0x50cd45['query']);_0x3bb175[_0x8dad('0x36')]=_[_0x8dad('0x34')](_0x50cd45[_0x8dad('0x35')],qs[_0x8dad('0x37')](_0x4abdee[_0x8dad('0x31')]['fields']));_0x3bb175[_0x8dad('0x36')]=_0x3bb175[_0x8dad('0x36')][_0x8dad('0x38')]?_0x3bb175['attributes']:_0x50cd45['model'];if(!_0x4abdee[_0x8dad('0x31')]['hasOwnProperty'](_0x8dad('0x39'))){_0x3bb175[_0x8dad('0x1d')]=qs[_0x8dad('0x1d')](_0x4abdee[_0x8dad('0x31')]['limit']);_0x3bb175[_0x8dad('0x20')]=qs[_0x8dad('0x20')](_0x4abdee['query'][_0x8dad('0x20')]);}_0x3bb175[_0x8dad('0x3a')]=qs[_0x8dad('0x3b')](_0x4abdee['query'][_0x8dad('0x3b')]);_0x3bb175[_0x8dad('0x3c')]=qs[_0x8dad('0x33')](_[_0x8dad('0x3d')](_0x4abdee[_0x8dad('0x31')],_0x50cd45[_0x8dad('0x33')]),_0x1b1e53);if(_0x4abdee[_0x8dad('0x31')][_0x8dad('0x3e')]){_0x3bb175[_0x8dad('0x3c')]=_['merge'](_0x3bb175[_0x8dad('0x3c')],{'$or':[{'key':{'$like':'%'+_0x4abdee[_0x8dad('0x31')][_0x8dad('0x3e')]+'%'}},{'value':{'$like':'%'+_0x4abdee[_0x8dad('0x31')]['filter']+'%'}}]});}_0x3bb175=_['merge']({},_0x3bb175,_0x4abdee[_0x8dad('0x3f')]);var _0xb24bc6={'where':_0x3bb175['where']};return db['CannedAnswer']['count'](_0xb24bc6)['then'](function(_0x2962d2){_0x3cd45b[_0x8dad('0x1f')]=_0x2962d2;if(_0x4abdee['query'][_0x8dad('0x40')]){_0x3bb175[_0x8dad('0x41')]=[{'all':!![]}];}return db[_0x8dad('0x42')][_0x8dad('0x43')](_0x3bb175);})[_0x8dad('0x27')](function(_0x8fee69){_0x3cd45b['rows']=_0x8fee69;return _0x3cd45b;})[_0x8dad('0x27')](respondWithFilteredResult(_0x348c59,_0x3bb175))['catch'](handleError(_0x348c59,null));};exports[_0x8dad('0x44')]=function(_0x325658,_0x39f211){var _0x153f56={'raw':!![],'where':{'id':_0x325658[_0x8dad('0x45')]['id']}},_0x51c80d={};_0x51c80d[_0x8dad('0x35')]=_[_0x8dad('0x32')](db[_0x8dad('0x42')][_0x8dad('0x2e')]);_0x51c80d['query']=_[_0x8dad('0x32')](_0x325658[_0x8dad('0x31')]);_0x51c80d['filters']=_[_0x8dad('0x34')](_0x51c80d[_0x8dad('0x35')],_0x51c80d[_0x8dad('0x31')]);_0x153f56[_0x8dad('0x36')]=_['intersection'](_0x51c80d[_0x8dad('0x35')],qs['fields'](_0x325658['query'][_0x8dad('0x37')]));_0x153f56['attributes']=_0x153f56[_0x8dad('0x36')][_0x8dad('0x38')]?_0x153f56['attributes']:_0x51c80d[_0x8dad('0x35')];if(_0x325658[_0x8dad('0x31')]['includeAll']){_0x153f56[_0x8dad('0x41')]=[{'all':!![]}];}_0x153f56=_[_0x8dad('0x46')]({},_0x153f56,_0x325658['options']);return db[_0x8dad('0x42')]['find'](_0x153f56)[_0x8dad('0x27')](handleEntityNotFound(_0x39f211,null))['then'](respondWithResult(_0x39f211,null))[_0x8dad('0x47')](handleError(_0x39f211,null));};exports[_0x8dad('0x25')]=function(_0x31210b,_0x3bb35a){if(_0x31210b['body']['id']){delete _0x31210b[_0x8dad('0x48')]['id'];}return db[_0x8dad('0x42')]['find']({'where':{'id':_0x31210b[_0x8dad('0x45')]['id']}})[_0x8dad('0x27')](handleEntityNotFound(_0x3bb35a,null))[_0x8dad('0x27')](saveUpdates(_0x31210b[_0x8dad('0x48')],null))['then'](respondWithResult(_0x3bb35a,null))[_0x8dad('0x47')](handleError(_0x3bb35a,null));};exports[_0x8dad('0x26')]=function(_0x5c0b45,_0x53e1ae){return db[_0x8dad('0x42')][_0x8dad('0x49')]({'where':{'id':_0x5c0b45['params']['id']}})[_0x8dad('0x27')](handleEntityNotFound(_0x53e1ae,null))[_0x8dad('0x27')](removeEntity(_0x53e1ae,null))[_0x8dad('0x47')](handleError(_0x53e1ae,null));};exports['create']=function(_0x248096,_0x286c57){var _0x5ebccd={'key':_0x248096[_0x8dad('0x48')][_0x8dad('0x30')]};if(_0x248096[_0x8dad('0x48')][_0x8dad('0x4a')]){_0x5ebccd[_0x8dad('0x4a')]=_0x248096[_0x8dad('0x48')][_0x8dad('0x4a')];}else if(_0x248096[_0x8dad('0x48')]['SmsAccountId']){_0x5ebccd[_0x8dad('0x4b')]=_0x248096[_0x8dad('0x48')][_0x8dad('0x4b')];}else if(_0x248096[_0x8dad('0x48')][_0x8dad('0x4c')]){_0x5ebccd['OpenchannelAccountId']=_0x248096['body'][_0x8dad('0x4c')];}else if(_0x248096[_0x8dad('0x48')]['ChatWebsiteId']){_0x5ebccd['ChatWebsiteId']=_0x248096['body'][_0x8dad('0x4d')];}return db[_0x8dad('0x42')][_0x8dad('0x49')]({'where':_0x5ebccd})[_0x8dad('0x27')](function(_0x306459){if(_0x306459){throw new db[(_0x8dad('0x4e'))]['ValidationError'](_0x8dad('0x4f'));}return db['CannedAnswer']['create'](_0x248096[_0x8dad('0x48')]);})['then'](function(_0x20dd45){var _0x4f5207=_0x248096[_0x8dad('0x50')][_0x8dad('0x28')]({'plain':!![]});if(!_0x4f5207)throw new Error(_0x8dad('0x51'));if(_0x4f5207[_0x8dad('0x52')]===_0x8dad('0x50')){var _0x1714e9=_0x20dd45[_0x8dad('0x28')]({'plain':!![]});return db[_0x8dad('0x53')][_0x8dad('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x4f5207[_0x8dad('0x54')]},'raw':!![]})['then'](function(_0x53d1b0){if(_0x53d1b0&&_0x53d1b0[_0x8dad('0x55')]===0x0){return db[_0x8dad('0x56')]['create']({'name':_0x1714e9['name'],'resourceId':_0x1714e9['id'],'type':_0x53d1b0[_0x8dad('0x2c')],'sectionId':_0x53d1b0['id']},{})['then'](function(){return _0x20dd45;});}else{return _0x20dd45;}})[_0x8dad('0x47')](function(_0x3bdb06){logger[_0x8dad('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bdb06);throw _0x3bdb06;});}return _0x20dd45;})[_0x8dad('0x27')](respondWithResult(_0x286c57,0xc9))['catch'](handleError(_0x286c57,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index b3f2af4..d54ba8c 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 _0xb545=['util','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x49f7fb,_0xc53472){var _0x7a885e=function(_0x452160){while(--_0x452160){_0x49f7fb['push'](_0x49f7fb['shift']());}};_0x7a885e(++_0xc53472);}(_0xb545,0x74));var _0x5b54=function(_0x49eb9d,_0x3e8ff7){_0x49eb9d=_0x49eb9d-0x0;var _0x43124d=_0xb545[_0x49eb9d];return _0x43124d;};'use strict';var _=require(_0x5b54('0x0'));var util=require(_0x5b54('0x1'));var logger=require('../../config/logger')(_0x5b54('0x2'));var moment=require(_0x5b54('0x3'));var BPromise=require(_0x5b54('0x4'));var rp=require(_0x5b54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5b54('0x6'));var attributes=require(_0x5b54('0x7'));module['exports']=function(_0x52b69a,_0x358863){return _0x52b69a[_0x5b54('0x8')](_0x5b54('0x9'),attributes,{'tableName':_0x5b54('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5b54('0xb'),'collate':_0x5b54('0xc')});};
\ No newline at end of file
+var _0xaaf6=['path','rimraf','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2741c2,_0x5851d1){var _0x29ade5=function(_0x536c5b){while(--_0x536c5b){_0x2741c2['push'](_0x2741c2['shift']());}};_0x29ade5(++_0x5851d1);}(_0xaaf6,0x182));var _0x6aaf=function(_0x7d7194,_0x2ab6d8){_0x7d7194=_0x7d7194-0x0;var _0x25b172=_0xaaf6[_0x7d7194];return _0x25b172;};'use strict';var _=require(_0x6aaf('0x0'));var util=require(_0x6aaf('0x1'));var logger=require(_0x6aaf('0x2'))(_0x6aaf('0x3'));var moment=require(_0x6aaf('0x4'));var BPromise=require('bluebird');var rp=require(_0x6aaf('0x5'));var fs=require('fs');var path=require(_0x6aaf('0x6'));var rimraf=require(_0x6aaf('0x7'));var config=require(_0x6aaf('0x8'));var attributes=require(_0x6aaf('0x9'));module['exports']=function(_0xbe18a8,_0x56a41b){return _0xbe18a8['define'](_0x6aaf('0xa'),attributes,{'tableName':_0x6aaf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6aaf('0xc'),'collate':_0x6aaf('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 7610ac5..1a02a06 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(_0x23e063,_0x3412f7){var _0xe60535=function(_0x1a8434){while(--_0x1a8434){_0x23e063['push'](_0x23e063['shift']());}};_0xe60535(++_0x3412f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x2fa9b7,_0x5db005){var _0x2042eb=function(_0x57c795){while(--_0x57c795){_0x2fa9b7['push'](_0x2fa9b7['shift']());}};_0x2042eb(++_0x5db005);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 39adbde..e510b2d 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 _0x5eab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x45376e,_0x1ed151){var _0x4f5baf=function(_0x5cb66d){while(--_0x5cb66d){_0x45376e['push'](_0x45376e['shift']());}};_0x4f5baf(++_0x1ed151);}(_0x5eab,0xe4));var _0xb5ea=function(_0x215b11,_0xf38206){_0x215b11=_0x215b11-0x0;var _0x32b490=_0x5eab[_0x215b11];return _0x32b490;};'use strict';var multer=require(_0xb5ea('0x0'));var util=require(_0xb5ea('0x1'));var path=require(_0xb5ea('0x2'));var timeout=require('connect-timeout');var express=require(_0xb5ea('0x3'));var router=express[_0xb5ea('0x4')]();var fs_extra=require(_0xb5ea('0x5'));var auth=require(_0xb5ea('0x6'));var interaction=require(_0xb5ea('0x7'));var config=require(_0xb5ea('0x8'));var controller=require(_0xb5ea('0x9'));router[_0xb5ea('0xa')]('/',auth[_0xb5ea('0xb')](),controller[_0xb5ea('0xc')]);router['get'](_0xb5ea('0xd'),auth['isAuthenticated'](),controller[_0xb5ea('0xe')]);router[_0xb5ea('0xf')]('/',auth[_0xb5ea('0xb')](),controller[_0xb5ea('0x10')]);router[_0xb5ea('0x11')](_0xb5ea('0xd'),auth['isAuthenticated'](),controller[_0xb5ea('0x12')]);router['delete'](_0xb5ea('0xd'),auth[_0xb5ea('0xb')](),controller[_0xb5ea('0x13')]);module[_0xb5ea('0x14')]=router;
\ No newline at end of file
+var _0x5a2a=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','multer','util','path','connect-timeout','express'];(function(_0x4b869a,_0x1f993d){var _0x10d713=function(_0x30266e){while(--_0x30266e){_0x4b869a['push'](_0x4b869a['shift']());}};_0x10d713(++_0x1f993d);}(_0x5a2a,0x1ab));var _0xa5a2=function(_0x2f7489,_0x5035ba){_0x2f7489=_0x2f7489-0x0;var _0x32c14e=_0x5a2a[_0x2f7489];return _0x32c14e;};'use strict';var multer=require(_0xa5a2('0x0'));var util=require(_0xa5a2('0x1'));var path=require(_0xa5a2('0x2'));var timeout=require(_0xa5a2('0x3'));var express=require(_0xa5a2('0x4'));var router=express[_0xa5a2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa5a2('0x6'));var interaction=require(_0xa5a2('0x7'));var config=require(_0xa5a2('0x8'));var controller=require(_0xa5a2('0x9'));router[_0xa5a2('0xa')]('/',auth[_0xa5a2('0xb')](),controller[_0xa5a2('0xc')]);router[_0xa5a2('0xa')](_0xa5a2('0xd'),auth[_0xa5a2('0xb')](),controller['show']);router[_0xa5a2('0xe')]('/',auth[_0xa5a2('0xb')](),controller[_0xa5a2('0xf')]);router[_0xa5a2('0x10')]('/:id',auth[_0xa5a2('0xb')](),controller['update']);router['delete'](_0xa5a2('0xd'),auth[_0xa5a2('0xb')](),controller[_0xa5a2('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 6d9cc9b..9739e71 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 _0x90db=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x1bc598,_0x3eda62){var _0x14aa71=function(_0x526a01){while(--_0x526a01){_0x1bc598['push'](_0x1bc598['shift']());}};_0x14aa71(++_0x3eda62);}(_0x90db,0x1c0));var _0xb90d=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x90db[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require('sequelize');module[_0xb90d('0x0')]={'calldate':{'type':Sequelize[_0xb90d('0x1')],'allowNull':![],'defaultValue':_0xb90d('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xb90d('0x3')]},'lastapp':{'type':Sequelize[_0xb90d('0x3')]},'lastdata':{'type':Sequelize[_0xb90d('0x3')]},'duration':{'type':Sequelize[_0xb90d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb90d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb90d('0x3')]},'amaflags':{'type':Sequelize[_0xb90d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb90d('0x3')]},'userfield':{'type':Sequelize[_0xb90d('0x3')]},'uniqueid':{'type':Sequelize[_0xb90d('0x3')]},'linkedid':{'type':Sequelize[_0xb90d('0x3')]},'sequence':{'type':Sequelize[_0xb90d('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb90d('0x3')]},'tag':{'type':Sequelize[_0xb90d('0x3')]}};
\ No newline at end of file
+var _0xb4c2=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x37a80d,_0x24a9d0){var _0x15e145=function(_0x4b982a){while(--_0x4b982a){_0x37a80d['push'](_0x37a80d['shift']());}};_0x15e145(++_0x24a9d0);}(_0xb4c2,0x19c));var _0x2b4c=function(_0xf1aeac,_0x4003b6){_0xf1aeac=_0xf1aeac-0x0;var _0x5025c7=_0xb4c2[_0xf1aeac];return _0x5025c7;};'use strict';var Sequelize=require('sequelize');module[_0x2b4c('0x0')]={'calldate':{'type':Sequelize[_0x2b4c('0x1')],'allowNull':![],'defaultValue':_0x2b4c('0x2')},'clid':{'type':Sequelize[_0x2b4c('0x3')]},'src':{'type':Sequelize[_0x2b4c('0x3')]},'dst':{'type':Sequelize[_0x2b4c('0x3')]},'dcontext':{'type':Sequelize[_0x2b4c('0x3')]},'channel':{'type':Sequelize[_0x2b4c('0x3')]},'dstchannel':{'type':Sequelize[_0x2b4c('0x3')]},'lastapp':{'type':Sequelize[_0x2b4c('0x3')]},'lastdata':{'type':Sequelize[_0x2b4c('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2b4c('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x2b4c('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x2b4c('0x3')]},'uniqueid':{'type':Sequelize[_0x2b4c('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x2b4c('0x3')]},'peeraccount':{'type':Sequelize[_0x2b4c('0x3')]},'type':{'type':Sequelize[_0x2b4c('0x3')]},'tag':{'type':Sequelize[_0x2b4c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 879cad4..1f6df89 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 _0x1224=['sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order'];(function(_0x4551fb,_0x2b8b8e){var _0x562381=function(_0x3b3bff){while(--_0x3b3bff){_0x4551fb['push'](_0x4551fb['shift']());}};_0x562381(++_0x2b8b8e);}(_0x1224,0x10d));var _0x4122=function(_0x2c85c0,_0x1dac4f){_0x2c85c0=_0x2c85c0-0x0;var _0xf4d4c9=_0x1224[_0x2c85c0];return _0xf4d4c9;};'use strict';var emlformat=require(_0x4122('0x0'));var rimraf=require(_0x4122('0x1'));var zipdir=require(_0x4122('0x2'));var jsonpatch=require(_0x4122('0x3'));var rp=require(_0x4122('0x4'));var moment=require(_0x4122('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4122('0x6'));var util=require(_0x4122('0x7'));var path=require(_0x4122('0x8'));var sox=require('sox');var csv=require(_0x4122('0x9'));var ejs=require(_0x4122('0xa'));var fs=require('fs');var fs_extra=require(_0x4122('0xb'));var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0x9'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var Redis=require(_0x4122('0x13'));var authService=require(_0x4122('0x14'));var qs=require(_0x4122('0x15'));var as=require(_0x4122('0x16'));var hardwareService=require(_0x4122('0x17'));var logger=require(_0x4122('0x18'))(_0x4122('0x19'));var utils=require(_0x4122('0x1a'));var config=require(_0x4122('0x1b'));var licenseUtil=require(_0x4122('0x1c'));var db=require(_0x4122('0x1d'))['db'];function respondWithStatusCode(_0x440ff0,_0x8d4876){_0x8d4876=_0x8d4876||0xcc;return function(_0xe213d){if(_0xe213d){return _0x440ff0[_0x4122('0x1e')](_0x8d4876);}return _0x440ff0[_0x4122('0x1f')](_0x8d4876)[_0x4122('0x20')]();};}function respondWithResult(_0x421ee3,_0x1a701e){_0x1a701e=_0x1a701e||0xc8;return function(_0x3a88fe){if(_0x3a88fe){return _0x421ee3['status'](_0x1a701e)[_0x4122('0x21')](_0x3a88fe);}};}function respondWithFilteredResult(_0x3c674e,_0x192e77){return function(_0x359909){if(_0x359909){var _0x520300=typeof _0x192e77[_0x4122('0x22')]===_0x4122('0x23')&&typeof _0x192e77['limit']===_0x4122('0x23');var _0x3ec4d3=_0x359909[_0x4122('0x24')];var _0x4636ae=_0x520300?0x0:_0x192e77[_0x4122('0x22')];var _0x42374d=_0x520300?_0x359909[_0x4122('0x24')]:_0x192e77['offset']+_0x192e77['limit'];var _0x586105;if(_0x42374d>=_0x3ec4d3){_0x42374d=_0x3ec4d3;_0x586105=0xc8;}else{_0x586105=0xce;}_0x3c674e[_0x4122('0x1f')](_0x586105);return _0x3c674e[_0x4122('0x25')](_0x4122('0x26'),_0x4636ae+'-'+_0x42374d+'/'+_0x3ec4d3)[_0x4122('0x21')](_0x359909);}return null;};}function patchUpdates(_0xef6995){return function(_0xb0a7d){try{jsonpatch[_0x4122('0x27')](_0xb0a7d,_0xef6995,!![]);}catch(_0x46b24e){return BPromise['reject'](_0x46b24e);}return _0xb0a7d[_0x4122('0x28')]();};}function saveUpdates(_0x50e243,_0x4f949a){return function(_0x508cd7){if(_0x508cd7){return _0x508cd7[_0x4122('0x29')](_0x50e243)[_0x4122('0x2a')](function(_0x317418){return _0x317418;});}return null;};}function removeEntity(_0x4eb35b,_0x128fde){return function(_0x386cdc){if(_0x386cdc){return _0x386cdc['destroy']()['then'](function(){_0x4eb35b[_0x4122('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db23e,_0x59895d){return function(_0x1b449b){if(!_0x1b449b){_0x4db23e[_0x4122('0x1e')](0x194);}return _0x1b449b;};}function handleError(_0xbb76e1,_0x1bb51b){_0x1bb51b=_0x1bb51b||0x1f4;return function(_0x31568f){logger[_0x4122('0x2b')](_0x31568f[_0x4122('0x2c')]);if(_0x31568f[_0x4122('0x2d')]){delete _0x31568f[_0x4122('0x2d')];}_0xbb76e1[_0x4122('0x1f')](_0x1bb51b)[_0x4122('0x2e')](_0x31568f);};}exports[_0x4122('0x2f')]=function(_0xfefaf6,_0x5f32c5){var _0x2e5bc2={},_0x43c51c={},_0x79c85={'count':0x0,'rows':[]};var _0x31f141=_['map'](db[_0x4122('0x30')]['rawAttributes'],function(_0x3e4eee){return{'name':_0x3e4eee[_0x4122('0x31')],'type':_0x3e4eee[_0x4122('0x32')][_0x4122('0x33')]};});_0x43c51c[_0x4122('0x34')]=_[_0x4122('0x35')](_0x31f141,_0x4122('0x2d'));_0x43c51c[_0x4122('0x36')]=_['keys'](_0xfefaf6[_0x4122('0x36')]);_0x43c51c[_0x4122('0x37')]=_['intersection'](_0x43c51c[_0x4122('0x34')],_0x43c51c[_0x4122('0x36')]);_0x2e5bc2[_0x4122('0x38')]=_[_0x4122('0x39')](_0x43c51c['model'],qs[_0x4122('0x3a')](_0xfefaf6[_0x4122('0x36')]['fields']));_0x2e5bc2['attributes']=_0x2e5bc2[_0x4122('0x38')]['length']?_0x2e5bc2[_0x4122('0x38')]:_0x43c51c[_0x4122('0x34')];if(!_0xfefaf6['query'][_0x4122('0x3b')](_0x4122('0x3c'))){_0x2e5bc2[_0x4122('0x3d')]=qs['limit'](_0xfefaf6[_0x4122('0x36')]['limit']);_0x2e5bc2[_0x4122('0x22')]=qs[_0x4122('0x22')](_0xfefaf6[_0x4122('0x36')]['offset']);}_0x2e5bc2[_0x4122('0x3e')]=qs['sort'](_0xfefaf6[_0x4122('0x36')][_0x4122('0x3f')]);_0x2e5bc2['where']=qs['filters'](_['pick'](_0xfefaf6[_0x4122('0x36')],_0x43c51c['filters']),_0x31f141);if(_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]){_0x2e5bc2[_0x4122('0x41')]=_[_0x4122('0x42')](_0x2e5bc2[_0x4122('0x41')],{'$or':_['map'](_0x31f141,function(_0x5c20ec){if(_0x5c20ec[_0x4122('0x32')]!=='VIRTUAL'){var _0xf4ab54={};_0xf4ab54[_0x5c20ec['name']]={'$like':'%'+_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]+'%'};return _0xf4ab54;}})});}_0x2e5bc2=_['merge']({},_0x2e5bc2,_0xfefaf6[_0x4122('0x43')]);var _0x2b7d56={'where':_0x2e5bc2[_0x4122('0x41')]};return db[_0x4122('0x30')][_0x4122('0x24')](_0x2b7d56)[_0x4122('0x2a')](function(_0x5b8fe2){_0x79c85[_0x4122('0x24')]=_0x5b8fe2;if(_0xfefaf6['query'][_0x4122('0x44')]){_0x2e5bc2['include']=[{'all':!![]}];}return db[_0x4122('0x30')][_0x4122('0x45')](_0x2e5bc2);})[_0x4122('0x2a')](function(_0x469fdd){_0x79c85[_0x4122('0x46')]=_0x469fdd;return _0x79c85;})['then'](respondWithFilteredResult(_0x5f32c5,_0x2e5bc2))[_0x4122('0x47')](handleError(_0x5f32c5,null));};exports[_0x4122('0x48')]=function(_0x59ed80,_0x589b39){var _0x5853ae={'raw':!![],'where':{'id':_0x59ed80[_0x4122('0x49')]['id']}},_0x297937={};_0x297937[_0x4122('0x34')]=_[_0x4122('0x4a')](db[_0x4122('0x30')][_0x4122('0x4b')]);_0x297937[_0x4122('0x36')]=_[_0x4122('0x4a')](_0x59ed80[_0x4122('0x36')]);_0x297937['filters']=_[_0x4122('0x39')](_0x297937['model'],_0x297937['query']);_0x5853ae[_0x4122('0x38')]=_[_0x4122('0x39')](_0x297937[_0x4122('0x34')],qs['fields'](_0x59ed80[_0x4122('0x36')][_0x4122('0x3a')]));_0x5853ae['attributes']=_0x5853ae[_0x4122('0x38')][_0x4122('0x4c')]?_0x5853ae[_0x4122('0x38')]:_0x297937[_0x4122('0x34')];if(_0x59ed80['query'][_0x4122('0x44')]){_0x5853ae[_0x4122('0x4d')]=[{'all':!![]}];}_0x5853ae=_[_0x4122('0x42')]({},_0x5853ae,_0x59ed80[_0x4122('0x43')]);return db[_0x4122('0x30')]['find'](_0x5853ae)['then'](handleEntityNotFound(_0x589b39,null))[_0x4122('0x2a')](respondWithResult(_0x589b39,null))[_0x4122('0x47')](handleError(_0x589b39,null));};exports[_0x4122('0x4e')]=function(_0x13cc1d,_0x144d4c){return db['Cdr'][_0x4122('0x4e')](_0x13cc1d[_0x4122('0x4f')],{})[_0x4122('0x2a')](respondWithResult(_0x144d4c,0xc9))['catch'](handleError(_0x144d4c,null));};exports[_0x4122('0x29')]=function(_0x53f7d9,_0x39515c){if(_0x53f7d9[_0x4122('0x4f')]['id']){delete _0x53f7d9[_0x4122('0x4f')]['id'];}return db[_0x4122('0x30')]['find']({'where':{'id':_0x53f7d9['params']['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x39515c,null))[_0x4122('0x2a')](saveUpdates(_0x53f7d9[_0x4122('0x4f')],null))[_0x4122('0x2a')](respondWithResult(_0x39515c,null))['catch'](handleError(_0x39515c,null));};exports[_0x4122('0x50')]=function(_0x5678ff,_0x376782){return db['Cdr'][_0x4122('0x51')]({'where':{'id':_0x5678ff[_0x4122('0x49')]['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x376782,null))[_0x4122('0x2a')](removeEntity(_0x376782,null))[_0x4122('0x47')](handleError(_0x376782,null));};exports[_0x4122('0x52')]=function(_0x4fb7ac,_0xf265ed){return db['Cdr'][_0x4122('0x52')]()[_0x4122('0x2a')](respondWithResult(_0xf265ed,null))[_0x4122('0x47')](handleError(_0xf265ed,null));};
\ No newline at end of file
+var _0x1cb9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr'];(function(_0x1c94a1,_0x5476cc){var _0x2a5838=function(_0x494224){while(--_0x494224){_0x1c94a1['push'](_0x1c94a1['shift']());}};_0x2a5838(++_0x5476cc);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2044d1,_0x3b5985){_0x2044d1=_0x2044d1-0x0;var _0x3fe489=_0x1cb9[_0x2044d1];return _0x3fe489;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x423c4f,_0x264e9b){return function(_0x4c8438){if(!_0x4c8438){_0x423c4f['sendStatus'](0x194);}return _0x4c8438;};}function handleError(_0x234eb1,_0x554350){_0x554350=_0x554350||0x1f4;return function(_0x1c67d2){logger[_0x91cb('0x27')](_0x1c67d2[_0x91cb('0x28')]);if(_0x1c67d2['name']){delete _0x1c67d2[_0x91cb('0x29')];}_0x234eb1['status'](_0x554350)[_0x91cb('0x2a')](_0x1c67d2);};}exports[_0x91cb('0x2b')]=function(_0x3b3ee6,_0x2fb473){var _0x468908={},_0x504275={},_0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x2c')](db[_0x91cb('0x2d')][_0x91cb('0x2e')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x2f')],'type':_0x4944bd[_0x91cb('0x30')][_0x91cb('0x31')]};});_0x504275[_0x91cb('0x32')]=_[_0x91cb('0x2c')](_0x52670a,_0x91cb('0x29'));_0x504275[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x3b3ee6[_0x91cb('0x33')]);_0x504275['filters']=_[_0x91cb('0x35')](_0x504275[_0x91cb('0x32')],_0x504275[_0x91cb('0x33')]);_0x468908[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x504275['model'],qs[_0x91cb('0x37')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x37')]));_0x468908[_0x91cb('0x36')]=_0x468908[_0x91cb('0x36')]['length']?_0x468908[_0x91cb('0x36')]:_0x504275['model'];if(!_0x3b3ee6['query']['hasOwnProperty'](_0x91cb('0x38'))){_0x468908['limit']=qs[_0x91cb('0x1d')](_0x3b3ee6['query']['limit']);_0x468908[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x1f')]);}_0x468908[_0x91cb('0x39')]=qs['sort'](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3a')]);_0x468908[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_['pick'](_0x3b3ee6['query'],_0x504275[_0x91cb('0x3c')]),_0x52670a);if(_0x3b3ee6[_0x91cb('0x33')]['filter']){_0x468908[_0x91cb('0x3b')]=_[_0x91cb('0x3d')](_0x468908['where'],{'$or':_[_0x91cb('0x2c')](_0x52670a,function(_0xddc409){if(_0xddc409['type']!==_0x91cb('0x3e')){var _0x545687={};_0x545687[_0xddc409[_0x91cb('0x29')]]={'$like':'%'+_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3f')]+'%'};return _0x545687;}})});}_0x468908=_[_0x91cb('0x3d')]({},_0x468908,_0x3b3ee6[_0x91cb('0x40')]);var _0x20bf50={'where':_0x468908['where']};return db[_0x91cb('0x2d')][_0x91cb('0x1e')](_0x20bf50)['then'](function(_0x312581){_0x2f04a3['count']=_0x312581;if(_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x41')]){_0x468908[_0x91cb('0x42')]=[{'all':!![]}];}return db[_0x91cb('0x2d')]['findAll'](_0x468908);})[_0x91cb('0x25')](function(_0x5af0e6){_0x2f04a3[_0x91cb('0x43')]=_0x5af0e6;return _0x2f04a3;})[_0x91cb('0x25')](respondWithFilteredResult(_0x2fb473,_0x468908))[_0x91cb('0x44')](handleError(_0x2fb473,null));};exports[_0x91cb('0x45')]=function(_0x451463,_0x111cc0){var _0x325dca={'raw':!![],'where':{'id':_0x451463['params']['id']}},_0x3cc4c1={};_0x3cc4c1[_0x91cb('0x32')]=_['keys'](db[_0x91cb('0x2d')]['rawAttributes']);_0x3cc4c1[_0x91cb('0x33')]=_['keys'](_0x451463[_0x91cb('0x33')]);_0x3cc4c1[_0x91cb('0x3c')]=_[_0x91cb('0x35')](_0x3cc4c1[_0x91cb('0x32')],_0x3cc4c1['query']);_0x325dca[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x3cc4c1['model'],qs[_0x91cb('0x37')](_0x451463[_0x91cb('0x33')][_0x91cb('0x37')]));_0x325dca[_0x91cb('0x36')]=_0x325dca[_0x91cb('0x36')][_0x91cb('0x46')]?_0x325dca[_0x91cb('0x36')]:_0x3cc4c1[_0x91cb('0x32')];if(_0x451463[_0x91cb('0x33')]['includeAll']){_0x325dca[_0x91cb('0x42')]=[{'all':!![]}];}_0x325dca=_[_0x91cb('0x3d')]({},_0x325dca,_0x451463[_0x91cb('0x40')]);return db[_0x91cb('0x2d')][_0x91cb('0x47')](_0x325dca)[_0x91cb('0x25')](handleEntityNotFound(_0x111cc0,null))[_0x91cb('0x25')](respondWithResult(_0x111cc0,null))[_0x91cb('0x44')](handleError(_0x111cc0,null));};exports['create']=function(_0x348d78,_0x46caf1){return db[_0x91cb('0x2d')][_0x91cb('0x48')](_0x348d78['body'],{})[_0x91cb('0x25')](respondWithResult(_0x46caf1,0xc9))[_0x91cb('0x44')](handleError(_0x46caf1,null));};exports['update']=function(_0x212473,_0x47cdb7){if(_0x212473[_0x91cb('0x49')]['id']){delete _0x212473['body']['id'];}return db['Cdr']['find']({'where':{'id':_0x212473[_0x91cb('0x4a')]['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x47cdb7,null))[_0x91cb('0x25')](saveUpdates(_0x212473[_0x91cb('0x49')],null))[_0x91cb('0x25')](respondWithResult(_0x47cdb7,null))['catch'](handleError(_0x47cdb7,null));};exports['destroy']=function(_0x1d26b8,_0xfe6692){return db[_0x91cb('0x2d')][_0x91cb('0x47')]({'where':{'id':_0x1d26b8['params']['id']}})['then'](handleEntityNotFound(_0xfe6692,null))['then'](removeEntity(_0xfe6692,null))[_0x91cb('0x44')](handleError(_0xfe6692,null));};exports['describe']=function(_0x3f22a1,_0x4aa670){return db[_0x91cb('0x2d')][_0x91cb('0x4b')]()[_0x91cb('0x25')](respondWithResult(_0x4aa670,null))[_0x91cb('0x44')](handleError(_0x4aa670,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 11d8fa1..f59b90d 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(_0x696973,_0x3b62b4){var _0x527f71=function(_0x4e0db0){while(--_0x4e0db0){_0x696973['push'](_0x696973['shift']());}};_0x527f71(++_0x3b62b4);}(_0x7a54,0x106));var _0x47a5=function(_0x8713ca,_0x1ce76d){_0x8713ca=_0x8713ca-0x0;var _0x2dc080=_0x7a54[_0x8713ca];return _0x2dc080;};'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(_0x5ed00c,_0x526749){var _0x2368e9=function(_0x452632){while(--_0x452632){_0x5ed00c['push'](_0x5ed00c['shift']());}};_0x2368e9(++_0x526749);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index a7c8824..3b1c894 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 _0xf34b=['debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf34b,0xe5));var _0xbf34=function(_0x46e4fd,_0x2a3819){_0x46e4fd=_0x46e4fd-0x0;var _0x2032e1=_0xf34b[_0x46e4fd];return _0x2032e1;};'use strict';var _=require('lodash');var util=require(_0xbf34('0x0'));var moment=require(_0xbf34('0x1'));var BPromise=require(_0xbf34('0x2'));var rs=require(_0xbf34('0x3'));var fs=require('fs');var Redis=require(_0xbf34('0x4'));var db=require(_0xbf34('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf34('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf34('0x7'));var client=jayson[_0xbf34('0x8')][_0xbf34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x495e47,_0x136354,_0x1f50c3){return new BPromise(function(_0x3e1ce2,_0x35897e){return client['request'](_0x495e47,_0x1f50c3)[_0xbf34('0xa')](function(_0x212bc5){logger[_0xbf34('0xb')](_0xbf34('0xc'),_0x136354,'request\x20sent');logger[_0xbf34('0xd')](_0xbf34('0xe'),_0x136354,_0xbf34('0xf'),JSON[_0xbf34('0x10')](_0x212bc5));if(_0x212bc5[_0xbf34('0x11')]){if(_0x212bc5[_0xbf34('0x11')][_0xbf34('0x12')]===0x1f4){logger[_0xbf34('0x11')](_0xbf34('0xc'),_0x136354,_0x212bc5[_0xbf34('0x11')][_0xbf34('0x13')]);return _0x35897e(_0x212bc5[_0xbf34('0x11')]['message']);}logger[_0xbf34('0x11')](_0xbf34('0xc'),_0x136354,_0x212bc5[_0xbf34('0x11')][_0xbf34('0x13')]);return _0x3e1ce2(_0x212bc5[_0xbf34('0x11')][_0xbf34('0x13')]);}else{logger[_0xbf34('0xb')](_0xbf34('0xc'),_0x136354,'request\x20sent');_0x3e1ce2(_0x212bc5[_0xbf34('0x14')][_0xbf34('0x13')]);}})[_0xbf34('0x15')](function(_0x198e9c){logger[_0xbf34('0x11')](_0xbf34('0xc'),_0x136354,_0x198e9c);_0x35897e(_0x198e9c);});});}
\ No newline at end of file
+var _0x2b87=['request\x20sent','debug','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s'];(function(_0x3de1c9,_0x47ab64){var _0x5e8188=function(_0x59135e){while(--_0x59135e){_0x3de1c9['push'](_0x3de1c9['shift']());}};_0x5e8188(++_0x47ab64);}(_0x2b87,0x75));var _0x72b8=function(_0x4443d8,_0x1091e3){_0x4443d8=_0x4443d8-0x0;var _0x34c4a1=_0x2b87[_0x4443d8];return _0x34c4a1;};'use strict';var _=require(_0x72b8('0x0'));var util=require(_0x72b8('0x1'));var moment=require('moment');var BPromise=require(_0x72b8('0x2'));var rs=require(_0x72b8('0x3'));var fs=require('fs');var Redis=require(_0x72b8('0x4'));var db=require(_0x72b8('0x5'))['db'];var utils=require(_0x72b8('0x6'));var logger=require(_0x72b8('0x7'))('rpc');var config=require(_0x72b8('0x8'));var jayson=require(_0x72b8('0x9'));var client=jayson[_0x72b8('0xa')][_0x72b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18f3e2,_0x1fc70c,_0x4446ed){return new BPromise(function(_0x4affda,_0x432dc5){return client[_0x72b8('0xc')](_0x18f3e2,_0x4446ed)[_0x72b8('0xd')](function(_0x173265){logger['info'](_0x72b8('0xe'),_0x1fc70c,_0x72b8('0xf'));logger[_0x72b8('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x1fc70c,_0x72b8('0xf'),JSON['stringify'](_0x173265));if(_0x173265[_0x72b8('0x11')]){if(_0x173265[_0x72b8('0x11')][_0x72b8('0x12')]===0x1f4){logger['error'](_0x72b8('0xe'),_0x1fc70c,_0x173265[_0x72b8('0x11')][_0x72b8('0x13')]);return _0x432dc5(_0x173265[_0x72b8('0x11')][_0x72b8('0x13')]);}logger[_0x72b8('0x11')](_0x72b8('0xe'),_0x1fc70c,_0x173265[_0x72b8('0x11')][_0x72b8('0x13')]);return _0x4affda(_0x173265['error'][_0x72b8('0x13')]);}else{logger[_0x72b8('0x14')](_0x72b8('0xe'),_0x1fc70c,_0x72b8('0xf'));_0x4affda(_0x173265[_0x72b8('0x15')][_0x72b8('0x13')]);}})['catch'](function(_0x7a3f04){logger[_0x72b8('0x11')]('Cdr,\x20%s,\x20%s',_0x1fc70c,_0x7a3f04);_0x432dc5(_0x7a3f04);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index c527281..896b345 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(_0x46891a,_0x3e3051){var _0x4c578d=function(_0x3cf400){while(--_0x3cf400){_0x46891a['push'](_0x46891a['shift']());}};_0x4c578d(++_0x3e3051);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 24f61d0..38bfda5 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 _0x4089=['INTEGER','STRING','noop','*,*,*,*'];(function(_0x43fd11,_0x5f4a49){var _0x402181=function(_0x4e2ab2){while(--_0x4e2ab2){_0x43fd11['push'](_0x43fd11['shift']());}};_0x402181(++_0x5f4a49);}(_0x4089,0x84));var _0x9408=function(_0x30fb66,_0x35da54){_0x30fb66=_0x30fb66-0x0;var _0x2880d9=_0x4089[_0x30fb66];return _0x2880d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9408('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9408('0x1')],'allowNull':![],'defaultValue':_0x9408('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9408('0x1')]},'interval':{'type':Sequelize[_0x9408('0x1')],'defaultValue':_0x9408('0x3')}};
\ No newline at end of file
+var _0x6598=['noop','STRING','*,*,*,*','sequelize'];(function(_0x1d8f95,_0xcd1d0e){var _0x4cb618=function(_0xddea13){while(--_0xddea13){_0x1d8f95['push'](_0x1d8f95['shift']());}};_0x4cb618(++_0xcd1d0e);}(_0x6598,0x1cb));var _0x8659=function(_0x1073cc,_0x35a19c){_0x1073cc=_0x1073cc-0x0;var _0x34a481=_0x6598[_0x1073cc];return _0x34a481;};'use strict';var Sequelize=require(_0x8659('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8659('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8659('0x2')],'defaultValue':_0x8659('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index c358aef..4206474 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 _0xd52d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','ChatApplication','catch','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x541c5d,_0x2ef384){var _0x3568b5=function(_0x589bd1){while(--_0x589bd1){_0x541c5d['push'](_0x541c5d['shift']());}};_0x3568b5(++_0x2ef384);}(_0xd52d,0x1c7));var _0xdd52=function(_0x2a5497,_0x19bceb){_0x2a5497=_0x2a5497-0x0;var _0x5a335a=_0xd52d[_0x2a5497];return _0x5a335a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd52('0x0'));var zipdir=require(_0xdd52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd52('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd52('0x3'));var util=require(_0xdd52('0x4'));var path=require(_0xdd52('0x5'));var sox=require(_0xdd52('0x6'));var csv=require(_0xdd52('0x7'));var ejs=require(_0xdd52('0x8'));var fs=require('fs');var fs_extra=require(_0xdd52('0x9'));var _=require(_0xdd52('0xa'));var squel=require('squel');var crypto=require(_0xdd52('0xb'));var jsforce=require(_0xdd52('0xc'));var deskjs=require(_0xdd52('0xd'));var toCsv=require(_0xdd52('0x7'));var querystring=require(_0xdd52('0xe'));var Papa=require(_0xdd52('0xf'));var Redis=require(_0xdd52('0x10'));var authService=require(_0xdd52('0x11'));var qs=require(_0xdd52('0x12'));var as=require(_0xdd52('0x13'));var hardwareService=require(_0xdd52('0x14'));var logger=require(_0xdd52('0x15'))(_0xdd52('0x16'));var utils=require('../../config/utils');var config=require(_0xdd52('0x17'));var licenseUtil=require(_0xdd52('0x18'));var db=require(_0xdd52('0x19'))['db'];function respondWithStatusCode(_0x2e940f,_0x19283f){_0x19283f=_0x19283f||0xcc;return function(_0xee8463){if(_0xee8463){return _0x2e940f['sendStatus'](_0x19283f);}return _0x2e940f[_0xdd52('0x1a')](_0x19283f)[_0xdd52('0x1b')]();};}function respondWithResult(_0x2e5642,_0x55b823){_0x55b823=_0x55b823||0xc8;return function(_0x3f6585){if(_0x3f6585){return _0x2e5642[_0xdd52('0x1a')](_0x55b823)[_0xdd52('0x1c')](_0x3f6585);}};}function respondWithFilteredResult(_0x181876,_0x336797){return function(_0x12c6da){if(_0x12c6da){var _0x25a2b7=typeof _0x336797[_0xdd52('0x1d')]==='undefined'&&typeof _0x336797[_0xdd52('0x1e')]==='undefined';var _0x2822be=_0x12c6da[_0xdd52('0x1f')];var _0x4568dc=_0x25a2b7?0x0:_0x336797[_0xdd52('0x1d')];var _0x4dc017=_0x25a2b7?_0x12c6da[_0xdd52('0x1f')]:_0x336797[_0xdd52('0x1d')]+_0x336797[_0xdd52('0x1e')];var _0x13f667;if(_0x4dc017>=_0x2822be){_0x4dc017=_0x2822be;_0x13f667=0xc8;}else{_0x13f667=0xce;}_0x181876['status'](_0x13f667);return _0x181876[_0xdd52('0x20')]('Content-Range',_0x4568dc+'-'+_0x4dc017+'/'+_0x2822be)[_0xdd52('0x1c')](_0x12c6da);}return null;};}function patchUpdates(_0x56e1db){return function(_0x30c411){try{jsonpatch[_0xdd52('0x21')](_0x30c411,_0x56e1db,!![]);}catch(_0x5a671a){return BPromise[_0xdd52('0x22')](_0x5a671a);}return _0x30c411['save']();};}function saveUpdates(_0x38c153,_0x59a041){return function(_0x14cd54){if(_0x14cd54){return _0x14cd54[_0xdd52('0x23')](_0x38c153)[_0xdd52('0x24')](function(_0xfd321){return _0xfd321;});}return null;};}function removeEntity(_0x1e8dbb,_0x455e74){return function(_0x3ce226){if(_0x3ce226){return _0x3ce226[_0xdd52('0x25')]()['then'](function(){_0x1e8dbb[_0xdd52('0x1a')](0xcc)[_0xdd52('0x1b')]();});}};}function handleEntityNotFound(_0x592f15,_0x1156cc){return function(_0x353fde){if(!_0x353fde){_0x592f15[_0xdd52('0x26')](0x194);}return _0x353fde;};}function handleError(_0x2f2dfa,_0x4ee66d){_0x4ee66d=_0x4ee66d||0x1f4;return function(_0x41c7e5){logger[_0xdd52('0x27')](_0x41c7e5[_0xdd52('0x28')]);if(_0x41c7e5['name']){delete _0x41c7e5['name'];}_0x2f2dfa[_0xdd52('0x1a')](_0x4ee66d)['send'](_0x41c7e5);};}exports[_0xdd52('0x29')]=function(_0x3f96bd,_0xeb81a0){var _0x539418={'raw':!![],'where':{'id':_0x3f96bd[_0xdd52('0x2a')]['id']}},_0x499e14={};_0x499e14[_0xdd52('0x2b')]=_[_0xdd52('0x2c')](db['ChatApplication']['rawAttributes']);_0x499e14[_0xdd52('0x2d')]=_['keys'](_0x3f96bd[_0xdd52('0x2d')]);_0x499e14[_0xdd52('0x2e')]=_[_0xdd52('0x2f')](_0x499e14[_0xdd52('0x2b')],_0x499e14[_0xdd52('0x2d')]);_0x539418[_0xdd52('0x30')]=_[_0xdd52('0x2f')](_0x499e14[_0xdd52('0x2b')],qs[_0xdd52('0x31')](_0x3f96bd[_0xdd52('0x2d')][_0xdd52('0x31')]));_0x539418[_0xdd52('0x30')]=_0x539418[_0xdd52('0x30')][_0xdd52('0x32')]?_0x539418[_0xdd52('0x30')]:_0x499e14[_0xdd52('0x2b')];if(_0x3f96bd[_0xdd52('0x2d')][_0xdd52('0x33')]){_0x539418[_0xdd52('0x34')]=[{'all':!![]}];}_0x539418=_[_0xdd52('0x35')]({},_0x539418,_0x3f96bd[_0xdd52('0x36')]);return db['ChatApplication'][_0xdd52('0x37')](_0x539418)[_0xdd52('0x24')](handleEntityNotFound(_0xeb81a0,null))['then'](respondWithResult(_0xeb81a0,null))['catch'](handleError(_0xeb81a0,null));};exports['update']=function(_0x17f735,_0x10d053){if(_0x17f735[_0xdd52('0x38')]['id']){delete _0x17f735[_0xdd52('0x38')]['id'];}return db[_0xdd52('0x39')][_0xdd52('0x37')]({'where':{'id':_0x17f735[_0xdd52('0x2a')]['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x10d053,null))[_0xdd52('0x24')](saveUpdates(_0x17f735[_0xdd52('0x38')],null))['then'](respondWithResult(_0x10d053,null))[_0xdd52('0x3a')](handleError(_0x10d053,null));};exports[_0xdd52('0x25')]=function(_0x19ab35,_0x3497c3){return db[_0xdd52('0x39')][_0xdd52('0x37')]({'where':{'id':_0x19ab35[_0xdd52('0x2a')]['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x3497c3,null))[_0xdd52('0x24')](removeEntity(_0x3497c3,null))[_0xdd52('0x3a')](handleError(_0x3497c3,null));};
\ No newline at end of file
+var _0x67da=['end','sendStatus','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x67da,0x192));var _0xa67d=function(_0x688de0,_0x3cb0dd){_0x688de0=_0x688de0-0x0;var _0x220f5d=_0x67da[_0x688de0];return _0x220f5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67d('0x0'));var zipdir=require(_0xa67d('0x1'));var jsonpatch=require(_0xa67d('0x2'));var rp=require(_0xa67d('0x3'));var moment=require(_0xa67d('0x4'));var BPromise=require(_0xa67d('0x5'));var Mustache=require(_0xa67d('0x6'));var util=require(_0xa67d('0x7'));var path=require(_0xa67d('0x8'));var sox=require(_0xa67d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa67d('0xa'));var _=require('lodash');var squel=require(_0xa67d('0xb'));var crypto=require(_0xa67d('0xc'));var jsforce=require(_0xa67d('0xd'));var deskjs=require(_0xa67d('0xe'));var toCsv=require(_0xa67d('0xf'));var querystring=require(_0xa67d('0x10'));var Papa=require(_0xa67d('0x11'));var Redis=require(_0xa67d('0x12'));var authService=require(_0xa67d('0x13'));var qs=require(_0xa67d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa67d('0x15'));var logger=require(_0xa67d('0x16'))(_0xa67d('0x17'));var utils=require(_0xa67d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa67d('0x19'));var db=require(_0xa67d('0x1a'))['db'];function respondWithStatusCode(_0x560485,_0x4e86f6){_0x4e86f6=_0x4e86f6||0xcc;return function(_0x304ee2){if(_0x304ee2){return _0x560485['sendStatus'](_0x4e86f6);}return _0x560485[_0xa67d('0x1b')](_0x4e86f6)['end']();};}function respondWithResult(_0x5d757b,_0x22dcc7){_0x22dcc7=_0x22dcc7||0xc8;return function(_0x3b99e3){if(_0x3b99e3){return _0x5d757b['status'](_0x22dcc7)[_0xa67d('0x1c')](_0x3b99e3);}};}function respondWithFilteredResult(_0x267a67,_0x1cfe81){return function(_0x288e5f){if(_0x288e5f){var _0x5a47de=typeof _0x1cfe81['offset']==='undefined'&&typeof _0x1cfe81['limit']===_0xa67d('0x1d');var _0x553811=_0x288e5f[_0xa67d('0x1e')];var _0xf8422c=_0x5a47de?0x0:_0x1cfe81[_0xa67d('0x1f')];var _0x1b58c3=_0x5a47de?_0x288e5f[_0xa67d('0x1e')]:_0x1cfe81[_0xa67d('0x1f')]+_0x1cfe81[_0xa67d('0x20')];var _0x5538a5;if(_0x1b58c3>=_0x553811){_0x1b58c3=_0x553811;_0x5538a5=0xc8;}else{_0x5538a5=0xce;}_0x267a67[_0xa67d('0x1b')](_0x5538a5);return _0x267a67[_0xa67d('0x21')](_0xa67d('0x22'),_0xf8422c+'-'+_0x1b58c3+'/'+_0x553811)[_0xa67d('0x1c')](_0x288e5f);}return null;};}function patchUpdates(_0x28f38b){return function(_0x1c3498){try{jsonpatch['apply'](_0x1c3498,_0x28f38b,!![]);}catch(_0x3f1898){return BPromise[_0xa67d('0x23')](_0x3f1898);}return _0x1c3498[_0xa67d('0x24')]();};}function saveUpdates(_0xed6c3e,_0x48f240){return function(_0x276ef7){if(_0x276ef7){return _0x276ef7['update'](_0xed6c3e)[_0xa67d('0x25')](function(_0x415141){return _0x415141;});}return null;};}function removeEntity(_0x46bbc8,_0x9c2935){return function(_0x559009){if(_0x559009){return _0x559009[_0xa67d('0x26')]()[_0xa67d('0x25')](function(){_0x46bbc8['status'](0xcc)[_0xa67d('0x27')]();});}};}function handleEntityNotFound(_0x3dd0b9,_0x2b890c){return function(_0xe0c7b2){if(!_0xe0c7b2){_0x3dd0b9[_0xa67d('0x28')](0x194);}return _0xe0c7b2;};}function handleError(_0x1d6e68,_0x5ef92a){_0x5ef92a=_0x5ef92a||0x1f4;return function(_0x435e56){logger[_0xa67d('0x29')](_0x435e56['stack']);if(_0x435e56[_0xa67d('0x2a')]){delete _0x435e56[_0xa67d('0x2a')];}_0x1d6e68[_0xa67d('0x1b')](_0x5ef92a)[_0xa67d('0x2b')](_0x435e56);};}exports[_0xa67d('0x2c')]=function(_0x8793cf,_0x42c858){var _0xf4fc64={'raw':!![],'where':{'id':_0x8793cf[_0xa67d('0x2d')]['id']}},_0x204f83={};_0x204f83[_0xa67d('0x2e')]=_[_0xa67d('0x2f')](db[_0xa67d('0x30')][_0xa67d('0x31')]);_0x204f83['query']=_[_0xa67d('0x2f')](_0x8793cf[_0xa67d('0x32')]);_0x204f83[_0xa67d('0x33')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],_0x204f83['query']);_0xf4fc64[_0xa67d('0x35')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],qs[_0xa67d('0x36')](_0x8793cf[_0xa67d('0x32')][_0xa67d('0x36')]));_0xf4fc64[_0xa67d('0x35')]=_0xf4fc64[_0xa67d('0x35')][_0xa67d('0x37')]?_0xf4fc64[_0xa67d('0x35')]:_0x204f83['model'];if(_0x8793cf[_0xa67d('0x32')]['includeAll']){_0xf4fc64[_0xa67d('0x38')]=[{'all':!![]}];}_0xf4fc64=_[_0xa67d('0x39')]({},_0xf4fc64,_0x8793cf[_0xa67d('0x3a')]);return db['ChatApplication'][_0xa67d('0x3b')](_0xf4fc64)[_0xa67d('0x25')](handleEntityNotFound(_0x42c858,null))[_0xa67d('0x25')](respondWithResult(_0x42c858,null))[_0xa67d('0x3c')](handleError(_0x42c858,null));};exports[_0xa67d('0x3d')]=function(_0x199e8f,_0x4ded76){if(_0x199e8f[_0xa67d('0x3e')]['id']){delete _0x199e8f[_0xa67d('0x3e')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x199e8f['params']['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x4ded76,null))['then'](saveUpdates(_0x199e8f[_0xa67d('0x3e')],null))[_0xa67d('0x25')](respondWithResult(_0x4ded76,null))[_0xa67d('0x3c')](handleError(_0x4ded76,null));};exports[_0xa67d('0x26')]=function(_0x35a0a0,_0x44310e){return db[_0xa67d('0x30')][_0xa67d('0x3b')]({'where':{'id':_0x35a0a0[_0xa67d('0x2d')]['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x44310e,null))[_0xa67d('0x25')](removeEntity(_0x44310e,null))[_0xa67d('0x3c')](handleError(_0x44310e,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 3c1ba58..ace1f8e 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 _0xd2d6=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xd2d6,0xa3));var _0x6d2d=function(_0x2b30cc,_0x54f567){_0x2b30cc=_0x2b30cc-0x0;var _0x39122c=_0xd2d6[_0x2b30cc];return _0x39122c;};'use strict';var _=require(_0x6d2d('0x0'));var util=require(_0x6d2d('0x1'));var logger=require(_0x6d2d('0x2'))('api');var moment=require(_0x6d2d('0x3'));var BPromise=require(_0x6d2d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d2d('0x5'));var rimraf=require(_0x6d2d('0x6'));var config=require(_0x6d2d('0x7'));var attributes=require(_0x6d2d('0x8'));module[_0x6d2d('0x9')]=function(_0x43dfa0,_0x3575eb){return _0x43dfa0[_0x6d2d('0xa')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d2d('0xb'),'collate':_0x6d2d('0xc')});};
\ No newline at end of file
+var _0x5137=['./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x147b6b,_0x23c714){var _0x8da7ac=function(_0x282beb){while(--_0x282beb){_0x147b6b['push'](_0x147b6b['shift']());}};_0x8da7ac(++_0x23c714);}(_0x5137,0x1e5));var _0x7513=function(_0x3379af,_0x416f71){_0x3379af=_0x3379af-0x0;var _0x30134e=_0x5137[_0x3379af];return _0x30134e;};'use strict';var _=require(_0x7513('0x0'));var util=require(_0x7513('0x1'));var logger=require(_0x7513('0x2'))('api');var moment=require(_0x7513('0x3'));var BPromise=require('bluebird');var rp=require(_0x7513('0x4'));var fs=require('fs');var path=require(_0x7513('0x5'));var rimraf=require('rimraf');var config=require(_0x7513('0x6'));var attributes=require(_0x7513('0x7'));module['exports']=function(_0x5c7bdc,_0x1ceb08){return _0x5c7bdc['define'](_0x7513('0x8'),attributes,{'tableName':_0x7513('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7513('0xa'),'collate':_0x7513('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 97d4ef2..eb21030 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 _0x1ec9=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ChatApplication,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x1ec9,0x142));var _0x91ec=function(_0x7dfaa,_0x1c8ae2){_0x7dfaa=_0x7dfaa-0x0;var _0x561f7d=_0x1ec9[_0x7dfaa];return _0x561f7d;};'use strict';var _=require(_0x91ec('0x0'));var util=require(_0x91ec('0x1'));var moment=require('moment');var BPromise=require(_0x91ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91ec('0x3'))['db'];var utils=require(_0x91ec('0x4'));var logger=require(_0x91ec('0x5'))(_0x91ec('0x6'));var config=require(_0x91ec('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x539328,_0x4266ed,_0xdfe11d){return new BPromise(function(_0x5ccb50,_0x198664){return client[_0x91ec('0x9')](_0x539328,_0xdfe11d)[_0x91ec('0xa')](function(_0x42f1a2){logger['info'](_0x91ec('0xb'),_0x4266ed,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4266ed,'request\x20sent',JSON[_0x91ec('0xc')](_0x42f1a2));if(_0x42f1a2[_0x91ec('0xd')]){if(_0x42f1a2['error'][_0x91ec('0xe')]===0x1f4){logger[_0x91ec('0xd')](_0x91ec('0xb'),_0x4266ed,_0x42f1a2[_0x91ec('0xd')][_0x91ec('0xf')]);return _0x198664(_0x42f1a2[_0x91ec('0xd')][_0x91ec('0xf')]);}logger[_0x91ec('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4266ed,_0x42f1a2[_0x91ec('0xd')][_0x91ec('0xf')]);return _0x5ccb50(_0x42f1a2[_0x91ec('0xd')]['message']);}else{logger[_0x91ec('0x10')]('ChatApplication,\x20%s,\x20%s',_0x4266ed,'request\x20sent');_0x5ccb50(_0x42f1a2[_0x91ec('0x11')][_0x91ec('0xf')]);}})[_0x91ec('0x12')](function(_0x4075ed){logger[_0x91ec('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4266ed,_0x4075ed);_0x198664(_0x4075ed);});});}
\ No newline at end of file
+var _0x8952=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x8952,0x75));var _0x2895=function(_0x4bd5c8,_0x3ef87e){_0x4bd5c8=_0x4bd5c8-0x0;var _0x50cfda=_0x8952[_0x4bd5c8];return _0x50cfda;};'use strict';var _=require(_0x2895('0x0'));var util=require(_0x2895('0x1'));var moment=require(_0x2895('0x2'));var BPromise=require(_0x2895('0x3'));var rs=require(_0x2895('0x4'));var fs=require('fs');var Redis=require(_0x2895('0x5'));var db=require(_0x2895('0x6'))['db'];var utils=require(_0x2895('0x7'));var logger=require(_0x2895('0x8'))(_0x2895('0x9'));var config=require(_0x2895('0xa'));var jayson=require(_0x2895('0xb'));var client=jayson['client'][_0x2895('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ff232,_0x11adc8,_0x5a5766){return new BPromise(function(_0x462fbf,_0x1fb8e4){return client[_0x2895('0xd')](_0x2ff232,_0x5a5766)[_0x2895('0xe')](function(_0x112962){logger['info']('ChatApplication,\x20%s,\x20%s',_0x11adc8,_0x2895('0xf'));logger['debug'](_0x2895('0x10'),_0x11adc8,_0x2895('0xf'),JSON[_0x2895('0x11')](_0x112962));if(_0x112962['error']){if(_0x112962[_0x2895('0x12')]['code']===0x1f4){logger['error'](_0x2895('0x13'),_0x11adc8,_0x112962[_0x2895('0x12')][_0x2895('0x14')]);return _0x1fb8e4(_0x112962['error'][_0x2895('0x14')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x11adc8,_0x112962[_0x2895('0x12')][_0x2895('0x14')]);return _0x462fbf(_0x112962[_0x2895('0x12')]['message']);}else{logger['info'](_0x2895('0x13'),_0x11adc8,_0x2895('0xf'));_0x462fbf(_0x112962[_0x2895('0x15')]['message']);}})[_0x2895('0x16')](function(_0x3e3032){logger[_0x2895('0x12')]('ChatApplication,\x20%s,\x20%s',_0x11adc8,_0x3e3032);_0x1fb8e4(_0x3e3032);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index ef4ed64..810ab20 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 _0xaa79=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x8c20da,_0x49cfd6){var _0x50d918=function(_0xeaf97d){while(--_0xeaf97d){_0x8c20da['push'](_0x8c20da['shift']());}};_0x50d918(++_0x49cfd6);}(_0xaa79,0xd6));var _0x9aa7=function(_0x396052,_0x46a315){_0x396052=_0x396052-0x0;var _0x2221c4=_0xaa79[_0x396052];return _0x2221c4;};'use strict';var multer=require(_0x9aa7('0x0'));var util=require(_0x9aa7('0x1'));var path=require(_0x9aa7('0x2'));var timeout=require(_0x9aa7('0x3'));var express=require(_0x9aa7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9aa7('0x5'));var interaction=require(_0x9aa7('0x6'));var config=require(_0x9aa7('0x7'));var controller=require(_0x9aa7('0x8'));router[_0x9aa7('0x9')](_0x9aa7('0xa'),auth[_0x9aa7('0xb')](),controller[_0x9aa7('0xc')]);router['put'](_0x9aa7('0xa'),auth[_0x9aa7('0xb')](),controller[_0x9aa7('0xd')]);router[_0x9aa7('0xe')]('/:id',auth[_0x9aa7('0xb')](),controller[_0x9aa7('0xf')]);module[_0x9aa7('0x10')]=router;
\ No newline at end of file
+var _0x3fe1=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','exports'];(function(_0x407fda,_0x3967f7){var _0x3b0fe2=function(_0x1a47ec){while(--_0x1a47ec){_0x407fda['push'](_0x407fda['shift']());}};_0x3b0fe2(++_0x3967f7);}(_0x3fe1,0x1a4));var _0x13fe=function(_0x545ced,_0x2eb3d3){_0x545ced=_0x545ced-0x0;var _0x40da32=_0x3fe1[_0x545ced];return _0x40da32;};'use strict';var multer=require(_0x13fe('0x0'));var util=require('util');var path=require(_0x13fe('0x1'));var timeout=require('connect-timeout');var express=require(_0x13fe('0x2'));var router=express[_0x13fe('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x13fe('0x4'));var interaction=require(_0x13fe('0x5'));var config=require('../../config/environment');var controller=require(_0x13fe('0x6'));router[_0x13fe('0x7')](_0x13fe('0x8'),auth[_0x13fe('0x9')](),controller[_0x13fe('0xa')]);router[_0x13fe('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x13fe('0xc')]);router['delete']('/:id',auth[_0x13fe('0x9')](),controller['destroy']);module[_0x13fe('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 41dcc55..477a5b5 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 _0xc177=['STRING','BOOLEAN','sequelize','exports'];(function(_0x51c021,_0x1706ca){var _0xab7c52=function(_0x32f913){while(--_0x32f913){_0x51c021['push'](_0x51c021['shift']());}};_0xab7c52(++_0x1706ca);}(_0xc177,0x1b2));var _0x7c17=function(_0x319f8c,_0x4db9c4){_0x319f8c=_0x319f8c-0x0;var _0x9be6dc=_0xc177[_0x319f8c];return _0x9be6dc;};'use strict';var Sequelize=require(_0x7c17('0x0'));module[_0x7c17('0x1')]={'name':{'type':Sequelize[_0x7c17('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7c17('0x2')]},'write':{'type':Sequelize[_0x7c17('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x09a7=['BOOLEAN','sequelize','STRING'];(function(_0x40f52b,_0x5d64d9){var _0x107c47=function(_0x4668a0){while(--_0x4668a0){_0x40f52b['push'](_0x40f52b['shift']());}};_0x107c47(++_0x5d64d9);}(_0x09a7,0x15d));var _0x709a=function(_0x4db784,_0x11e9f2){_0x4db784=_0x4db784-0x0;var _0x343347=_0x09a7[_0x4db784];return _0x343347;};'use strict';var Sequelize=require(_0x709a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x709a('0x1')]},'write':{'type':Sequelize[_0x709a('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 268f618..73bb95e 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 _0xfcb2=['offset','undefined','limit','count','Content-Range','json','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','where','merge','VIRTUAL','includeAll','ChatGroup','rows','catch','show','params','include','options','find','create','body','getUnread','ChatInternalMessage','addMembers','ids','omit','pick','filter','length','hasOwnProperty','getMembers','removeMembers','addMessage','ChatGroupId','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','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','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','end','status'];(function(_0x14d17d,_0x56493b){var _0x388bb6=function(_0x3dd963){while(--_0x3dd963){_0x14d17d['push'](_0x14d17d['shift']());}};_0x388bb6(++_0x56493b);}(_0xfcb2,0xa2));var _0x2fcb=function(_0x523297,_0x15f343){_0x523297=_0x523297-0x0;var _0x530017=_0xfcb2[_0x523297];return _0x530017;};'use strict';var emlformat=require(_0x2fcb('0x0'));var rimraf=require(_0x2fcb('0x1'));var zipdir=require(_0x2fcb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fcb('0x3'));var moment=require('moment');var BPromise=require(_0x2fcb('0x4'));var Mustache=require(_0x2fcb('0x5'));var util=require(_0x2fcb('0x6'));var path=require(_0x2fcb('0x7'));var sox=require(_0x2fcb('0x8'));var csv=require('to-csv');var ejs=require(_0x2fcb('0x9'));var fs=require('fs');var fs_extra=require(_0x2fcb('0xa'));var _=require(_0x2fcb('0xb'));var squel=require('squel');var crypto=require(_0x2fcb('0xc'));var jsforce=require(_0x2fcb('0xd'));var deskjs=require(_0x2fcb('0xe'));var toCsv=require(_0x2fcb('0xf'));var querystring=require('querystring');var Papa=require(_0x2fcb('0x10'));var Redis=require(_0x2fcb('0x11'));var authService=require(_0x2fcb('0x12'));var qs=require(_0x2fcb('0x13'));var as=require(_0x2fcb('0x14'));var hardwareService=require(_0x2fcb('0x15'));var logger=require(_0x2fcb('0x16'))(_0x2fcb('0x17'));var utils=require(_0x2fcb('0x18'));var config=require(_0x2fcb('0x19'));var licenseUtil=require(_0x2fcb('0x1a'));var db=require(_0x2fcb('0x1b'))['db'];config['redis']=_[_0x2fcb('0x1c')](config[_0x2fcb('0x1d')],{'host':_0x2fcb('0x1e'),'port':0x18eb});var socket=require(_0x2fcb('0x1f'))(new Redis(config[_0x2fcb('0x1d')]));require(_0x2fcb('0x20'))['register'](socket);function respondWithStatusCode(_0x1bc884,_0xba21d7){_0xba21d7=_0xba21d7||0xcc;return function(_0x3d69ce){if(_0x3d69ce){return _0x1bc884[_0x2fcb('0x21')](_0xba21d7);}return _0x1bc884['status'](_0xba21d7)[_0x2fcb('0x22')]();};}function respondWithResult(_0x8e5a34,_0x2f1a49){_0x2f1a49=_0x2f1a49||0xc8;return function(_0x2c0d19){if(_0x2c0d19){return _0x8e5a34[_0x2fcb('0x23')](_0x2f1a49)['json'](_0x2c0d19);}};}function respondWithFilteredResult(_0x4453fb,_0x28dd2d){return function(_0x5311b1){if(_0x5311b1){var _0x10ffbc=typeof _0x28dd2d[_0x2fcb('0x24')]===_0x2fcb('0x25')&&typeof _0x28dd2d[_0x2fcb('0x26')]===_0x2fcb('0x25');var _0x1f68aa=_0x5311b1[_0x2fcb('0x27')];var _0x5bf009=_0x10ffbc?0x0:_0x28dd2d[_0x2fcb('0x24')];var _0x518d68=_0x10ffbc?_0x5311b1[_0x2fcb('0x27')]:_0x28dd2d[_0x2fcb('0x24')]+_0x28dd2d[_0x2fcb('0x26')];var _0x1c674d;if(_0x518d68>=_0x1f68aa){_0x518d68=_0x1f68aa;_0x1c674d=0xc8;}else{_0x1c674d=0xce;}_0x4453fb[_0x2fcb('0x23')](_0x1c674d);return _0x4453fb['set'](_0x2fcb('0x28'),_0x5bf009+'-'+_0x518d68+'/'+_0x1f68aa)[_0x2fcb('0x29')](_0x5311b1);}return null;};}function patchUpdates(_0x155464){return function(_0x35159b){try{jsonpatch['apply'](_0x35159b,_0x155464,!![]);}catch(_0x59c5c8){return BPromise['reject'](_0x59c5c8);}return _0x35159b[_0x2fcb('0x2a')]();};}function saveUpdates(_0x41bb07,_0x4e1f71){return function(_0x53b6ed){if(_0x53b6ed){return _0x53b6ed[_0x2fcb('0x2b')](_0x41bb07)['then'](function(_0x5b4498){return _0x5b4498;});}return null;};}function removeEntity(_0x243786,_0x51e378){return function(_0x131383){if(_0x131383){return _0x131383[_0x2fcb('0x2c')]()[_0x2fcb('0x2d')](function(){_0x243786[_0x2fcb('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a847,_0x326298){return function(_0x311904){if(!_0x311904){_0x51a847[_0x2fcb('0x21')](0x194);}return _0x311904;};}function handleError(_0xc4d7fe,_0x34d225){_0x34d225=_0x34d225||0x1f4;return function(_0x4b5464){logger[_0x2fcb('0x2e')](_0x4b5464[_0x2fcb('0x2f')]);if(_0x4b5464[_0x2fcb('0x30')]){delete _0x4b5464[_0x2fcb('0x30')];}_0xc4d7fe[_0x2fcb('0x23')](_0x34d225)[_0x2fcb('0x31')](_0x4b5464);};}exports[_0x2fcb('0x32')]=function(_0x72424b,_0x4858b9){var _0x469d66={},_0x1b186f={},_0x5d836c={'count':0x0,'rows':[]};var _0x5542c8=_[_0x2fcb('0x33')](db['ChatGroup'][_0x2fcb('0x34')],function(_0x2d3c1e){return{'name':_0x2d3c1e[_0x2fcb('0x35')],'type':_0x2d3c1e[_0x2fcb('0x36')][_0x2fcb('0x37')]};});_0x1b186f[_0x2fcb('0x38')]=_[_0x2fcb('0x33')](_0x5542c8,_0x2fcb('0x30'));_0x1b186f[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0x72424b[_0x2fcb('0x39')]);_0x1b186f['filters']=_[_0x2fcb('0x3b')](_0x1b186f[_0x2fcb('0x38')],_0x1b186f[_0x2fcb('0x39')]);_0x469d66[_0x2fcb('0x3c')]=_[_0x2fcb('0x3b')](_0x1b186f[_0x2fcb('0x38')],qs['fields'](_0x72424b[_0x2fcb('0x39')][_0x2fcb('0x3d')]));_0x469d66['attributes']=_0x469d66[_0x2fcb('0x3c')]['length']?_0x469d66['attributes']:_0x1b186f['model'];if(!_0x72424b[_0x2fcb('0x39')]['hasOwnProperty'](_0x2fcb('0x3e'))){_0x469d66[_0x2fcb('0x26')]=qs[_0x2fcb('0x26')](_0x72424b[_0x2fcb('0x39')][_0x2fcb('0x26')]);_0x469d66['offset']=qs[_0x2fcb('0x24')](_0x72424b[_0x2fcb('0x39')]['offset']);}_0x469d66[_0x2fcb('0x3f')]=qs['sort'](_0x72424b[_0x2fcb('0x39')][_0x2fcb('0x40')]);_0x469d66['where']=qs['filters'](_['pick'](_0x72424b[_0x2fcb('0x39')],_0x1b186f[_0x2fcb('0x41')]),_0x5542c8);if(_0x72424b['query']['filter']){_0x469d66[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x469d66[_0x2fcb('0x42')],{'$or':_[_0x2fcb('0x33')](_0x5542c8,function(_0x279db2){if(_0x279db2[_0x2fcb('0x36')]!==_0x2fcb('0x44')){var _0x4fd0ab={};_0x4fd0ab[_0x279db2[_0x2fcb('0x30')]]={'$like':'%'+_0x72424b['query']['filter']+'%'};return _0x4fd0ab;}})});}_0x469d66=_[_0x2fcb('0x43')]({},_0x469d66,_0x72424b['options']);var _0x3241df={'where':_0x469d66[_0x2fcb('0x42')]};return db['ChatGroup'][_0x2fcb('0x27')](_0x3241df)[_0x2fcb('0x2d')](function(_0x3a242d){_0x5d836c['count']=_0x3a242d;if(_0x72424b['query'][_0x2fcb('0x45')]){_0x469d66['include']=[{'all':!![]}];}return db[_0x2fcb('0x46')]['findAll'](_0x469d66);})[_0x2fcb('0x2d')](function(_0x1db681){_0x5d836c[_0x2fcb('0x47')]=_0x1db681;return _0x5d836c;})['then'](respondWithFilteredResult(_0x4858b9,_0x469d66))[_0x2fcb('0x48')](handleError(_0x4858b9,null));};exports[_0x2fcb('0x49')]=function(_0x283367,_0x20fb0a){var _0x1a11a7={'raw':!![],'where':{'id':_0x283367[_0x2fcb('0x4a')]['id']}},_0x3c543d={};_0x3c543d['model']=_[_0x2fcb('0x3a')](db[_0x2fcb('0x46')][_0x2fcb('0x34')]);_0x3c543d[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0x283367['query']);_0x3c543d[_0x2fcb('0x41')]=_[_0x2fcb('0x3b')](_0x3c543d[_0x2fcb('0x38')],_0x3c543d['query']);_0x1a11a7[_0x2fcb('0x3c')]=_[_0x2fcb('0x3b')](_0x3c543d[_0x2fcb('0x38')],qs[_0x2fcb('0x3d')](_0x283367[_0x2fcb('0x39')][_0x2fcb('0x3d')]));_0x1a11a7['attributes']=_0x1a11a7[_0x2fcb('0x3c')]['length']?_0x1a11a7['attributes']:_0x3c543d['model'];if(_0x283367['query']['includeAll']){_0x1a11a7[_0x2fcb('0x4b')]=[{'all':!![]}];}_0x1a11a7=_[_0x2fcb('0x43')]({},_0x1a11a7,_0x283367[_0x2fcb('0x4c')]);return db[_0x2fcb('0x46')][_0x2fcb('0x4d')](_0x1a11a7)[_0x2fcb('0x2d')](handleEntityNotFound(_0x20fb0a,null))['then'](respondWithResult(_0x20fb0a,null))[_0x2fcb('0x48')](handleError(_0x20fb0a,null));};exports[_0x2fcb('0x4e')]=function(_0x4feba0,_0x348b04){return db[_0x2fcb('0x46')][_0x2fcb('0x4e')](_0x4feba0[_0x2fcb('0x4f')],{})[_0x2fcb('0x2d')](respondWithResult(_0x348b04,0xc9))[_0x2fcb('0x48')](handleError(_0x348b04,null));};exports[_0x2fcb('0x2b')]=function(_0x9850d0,_0x283d7f){if(_0x9850d0[_0x2fcb('0x4f')]['id']){delete _0x9850d0[_0x2fcb('0x4f')]['id'];}return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x9850d0[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x283d7f,null))[_0x2fcb('0x2d')](saveUpdates(_0x9850d0['body'],null))[_0x2fcb('0x2d')](respondWithResult(_0x283d7f,null))[_0x2fcb('0x48')](handleError(_0x283d7f,null));};exports[_0x2fcb('0x2c')]=function(_0x510b54,_0x1c577d){return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x510b54[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x1c577d,null))[_0x2fcb('0x2d')](removeEntity(_0x1c577d,null))['catch'](handleError(_0x1c577d,null));};exports['describe']=function(_0x13c461,_0x1c3f0f){return db[_0x2fcb('0x46')]['describe']()[_0x2fcb('0x2d')](respondWithResult(_0x1c3f0f,null))[_0x2fcb('0x48')](handleError(_0x1c3f0f,null));};exports[_0x2fcb('0x50')]=function(_0x1dd70,_0x551a53,_0x1cd9fa){return db[_0x2fcb('0x51')][_0x2fcb('0x27')]({'where':{'ChatGroupId':_0x1dd70[_0x2fcb('0x4a')]['id'],'ToId':_0x1dd70['user']['id'],'read':![]}})['then'](function(_0x20cf4e){return{'id':_['toInteger'](_0x1dd70[_0x2fcb('0x4a')]['id']),'count':_0x20cf4e};})[_0x2fcb('0x2d')](respondWithResult(_0x551a53,null))[_0x2fcb('0x48')](handleError(_0x551a53,null));};exports[_0x2fcb('0x52')]=function(_0x18b5a6,_0x383137,_0x59abf1){return db[_0x2fcb('0x46')]['find']({'where':{'id':_0x18b5a6[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x383137,null))[_0x2fcb('0x2d')](function(_0x39646b){if(_0x39646b){return _0x39646b[_0x2fcb('0x52')](_0x18b5a6['body'][_0x2fcb('0x53')],_[_0x2fcb('0x54')](_0x18b5a6[_0x2fcb('0x4f')],['ids','id'])||{});}})[_0x2fcb('0x2d')](respondWithResult(_0x383137,null))['catch'](handleError(_0x383137,null));};exports['getMembers']=function(_0xabd242,_0x3c7ec0,_0x3563c2){var _0x3bdafd={};var _0x26f81b={};var _0xb9fa9f;var _0x21a55f;return db[_0x2fcb('0x46')]['findOne']({'where':{'id':_0xabd242[_0x2fcb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c7ec0,null))[_0x2fcb('0x2d')](function(_0x161c0f){if(_0x161c0f){_0xb9fa9f=_0x161c0f;_0x26f81b[_0x2fcb('0x38')]=_[_0x2fcb('0x3a')](db['User']['rawAttributes']);_0x26f81b[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0xabd242[_0x2fcb('0x39')]);_0x26f81b['filters']=_[_0x2fcb('0x3b')](_0x26f81b[_0x2fcb('0x38')],_0x26f81b['query']);_0x3bdafd[_0x2fcb('0x3c')]=_['intersection'](_0x26f81b[_0x2fcb('0x38')],qs[_0x2fcb('0x3d')](_0xabd242[_0x2fcb('0x39')]['fields']));_0x3bdafd['attributes']=_0x3bdafd[_0x2fcb('0x3c')]['length']?_0x3bdafd['attributes']:_0x26f81b[_0x2fcb('0x38')];_0x3bdafd[_0x2fcb('0x3f')]=qs[_0x2fcb('0x40')](_0xabd242['query']['sort']);_0x3bdafd['where']=qs[_0x2fcb('0x41')](_[_0x2fcb('0x55')](_0xabd242[_0x2fcb('0x39')],_0x26f81b[_0x2fcb('0x41')]));if(_0xabd242['query'][_0x2fcb('0x56')]){_0x3bdafd[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x3bdafd[_0x2fcb('0x42')],{'$or':_['map'](_0x3bdafd[_0x2fcb('0x3c')],function(_0x594044){var _0x4f8ebb={};_0x4f8ebb[_0x594044]={'$like':'%'+_0xabd242[_0x2fcb('0x39')][_0x2fcb('0x56')]+'%'};return _0x4f8ebb;})});}_0x3bdafd=_[_0x2fcb('0x43')]({},_0x3bdafd,_0xabd242[_0x2fcb('0x4c')]);return _0xb9fa9f['getMembers'](_0x3bdafd);}})[_0x2fcb('0x2d')](function(_0xedff81){if(_0xedff81){_0x21a55f=_0xedff81[_0x2fcb('0x57')];if(!_0xabd242[_0x2fcb('0x39')][_0x2fcb('0x58')](_0x2fcb('0x3e'))){_0x3bdafd[_0x2fcb('0x26')]=qs[_0x2fcb('0x26')](_0xabd242[_0x2fcb('0x39')][_0x2fcb('0x26')]);_0x3bdafd[_0x2fcb('0x24')]=qs['offset'](_0xabd242['query'][_0x2fcb('0x24')]);}return _0xb9fa9f[_0x2fcb('0x59')](_0x3bdafd);}})[_0x2fcb('0x2d')](function(_0x48ee49){if(_0x48ee49){return _0x48ee49?{'count':_0x21a55f,'rows':_0x48ee49}:null;}})[_0x2fcb('0x2d')](respondWithResult(_0x3c7ec0,null))[_0x2fcb('0x48')](handleError(_0x3c7ec0,null));};exports[_0x2fcb('0x5a')]=function(_0x71e11,_0x249f4f,_0x4ce9dd){return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x71e11['params']['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x249f4f,null))[_0x2fcb('0x2d')](function(_0x45bc34){if(_0x45bc34){return _0x45bc34[_0x2fcb('0x5a')](_0x71e11[_0x2fcb('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x249f4f,null))[_0x2fcb('0x48')](handleError(_0x249f4f,null));};exports[_0x2fcb('0x5b')]=function(_0x44e6d5,_0x5edbfb,_0x1fa3a8){if(_0x44e6d5[_0x2fcb('0x4f')]['id']){delete _0x44e6d5[_0x2fcb('0x4f')]['id'];}return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x44e6d5[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x5edbfb,null))[_0x2fcb('0x2d')](function(_0x316cc6){if(_0x316cc6){_0x44e6d5[_0x2fcb('0x4f')][_0x2fcb('0x5c')]=_0x316cc6['id'];return db[_0x2fcb('0x51')][_0x2fcb('0x4e')](_0x44e6d5[_0x2fcb('0x4f')]);}})[_0x2fcb('0x2d')](respondWithResult(_0x5edbfb,null))[_0x2fcb('0x48')](handleError(_0x5edbfb,null));};exports['getMessages']=function(_0x1d974f,_0x1bd307,_0x545e68){var _0x22125d={};var _0x43f3f4={};var _0x33b687;var _0x52f5c0;return db['ChatGroup'][_0x2fcb('0x5d')]({'where':{'id':_0x1d974f[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x1bd307,null))[_0x2fcb('0x2d')](function(_0x2861bd){if(_0x2861bd){_0x33b687=_0x2861bd;_0x43f3f4[_0x2fcb('0x38')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x43f3f4[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0x1d974f[_0x2fcb('0x39')]);_0x43f3f4['filters']=_[_0x2fcb('0x3b')](_0x43f3f4[_0x2fcb('0x38')],_0x43f3f4['query']);_0x22125d[_0x2fcb('0x3c')]=_[_0x2fcb('0x3b')](_0x43f3f4['model'],qs[_0x2fcb('0x3d')](_0x1d974f[_0x2fcb('0x39')][_0x2fcb('0x3d')]));_0x22125d[_0x2fcb('0x3c')]=_0x22125d['attributes'][_0x2fcb('0x57')]?_0x22125d['attributes']:_0x43f3f4[_0x2fcb('0x38')];_0x22125d['order']=qs[_0x2fcb('0x40')](_0x1d974f[_0x2fcb('0x39')][_0x2fcb('0x40')]);_0x22125d['where']=qs[_0x2fcb('0x41')](_[_0x2fcb('0x55')](_0x1d974f['query'],_0x43f3f4[_0x2fcb('0x41')]));if(_0x1d974f[_0x2fcb('0x39')]['filter']){_0x22125d[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x22125d[_0x2fcb('0x42')],{'$or':_[_0x2fcb('0x33')](_0x22125d['attributes'],function(_0x36ed8a){var _0x44fe1c={};_0x44fe1c[_0x36ed8a]={'$like':'%'+_0x1d974f['query'][_0x2fcb('0x56')]+'%'};return _0x44fe1c;})});}if(_0x1d974f['query']['$gte']){var _0x3e48ea=_0x1d974f[_0x2fcb('0x39')][_0x2fcb('0x5e')][_0x2fcb('0x5f')](',');var _0x47054c={};_0x47054c[_0x3e48ea[0x0]]={'$gte':moment(_0x3e48ea[0x1])[_0x2fcb('0x60')](_0x2fcb('0x61'))};_0x22125d[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x22125d[_0x2fcb('0x42')],_0x47054c);}_0x22125d=_[_0x2fcb('0x43')]({},_0x22125d,_0x1d974f[_0x2fcb('0x4c')]);return _0x33b687[_0x2fcb('0x62')](_0x22125d);}})[_0x2fcb('0x2d')](function(_0x419a37){if(_0x419a37){_0x52f5c0=_0x419a37[_0x2fcb('0x57')];if(!_0x1d974f[_0x2fcb('0x39')]['hasOwnProperty'](_0x2fcb('0x3e'))){_0x22125d['limit']=qs['limit'](_0x1d974f['query'][_0x2fcb('0x26')]);_0x22125d[_0x2fcb('0x24')]=qs[_0x2fcb('0x24')](_0x1d974f[_0x2fcb('0x39')]['offset']);}return _0x33b687[_0x2fcb('0x62')](_0x22125d);}})[_0x2fcb('0x2d')](function(_0x383e77){if(_0x383e77){return _0x383e77?{'count':_0x52f5c0,'rows':_0x383e77}:null;}})[_0x2fcb('0x2d')](respondWithResult(_0x1bd307,null))[_0x2fcb('0x48')](handleError(_0x1bd307,null));};
\ No newline at end of file
+var _0x41a8=['addMembers','ids','omit','User','filter','getMembers','removeMembers','addMessage','getMessages','findOne','$gte','split','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','error','name','send','ChatGroup','fieldName','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','destroy','getUnread','ChatInternalMessage','toInteger'];(function(_0x98aa6f,_0x1c2cb0){var _0x1371ec=function(_0x56db51){while(--_0x56db51){_0x98aa6f['push'](_0x98aa6f['shift']());}};_0x1371ec(++_0x1c2cb0);}(_0x41a8,0x120));var _0x841a=function(_0x2f621b,_0x222f2f){_0x2f621b=_0x2f621b-0x0;var _0x5f234e=_0x41a8[_0x2f621b];return _0x5f234e;};'use strict';var emlformat=require(_0x841a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x841a('0x1'));var jsonpatch=require(_0x841a('0x2'));var rp=require(_0x841a('0x3'));var moment=require(_0x841a('0x4'));var BPromise=require(_0x841a('0x5'));var Mustache=require('mustache');var util=require(_0x841a('0x6'));var path=require('path');var sox=require(_0x841a('0x7'));var csv=require(_0x841a('0x8'));var ejs=require(_0x841a('0x9'));var fs=require('fs');var fs_extra=require(_0x841a('0xa'));var _=require('lodash');var squel=require(_0x841a('0xb'));var crypto=require(_0x841a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x841a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x841a('0xe'));var Papa=require(_0x841a('0xf'));var Redis=require(_0x841a('0x10'));var authService=require(_0x841a('0x11'));var qs=require(_0x841a('0x12'));var as=require(_0x841a('0x13'));var hardwareService=require(_0x841a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x841a('0x15'));var config=require(_0x841a('0x16'));var licenseUtil=require(_0x841a('0x17'));var db=require(_0x841a('0x18'))['db'];config[_0x841a('0x19')]=_[_0x841a('0x1a')](config[_0x841a('0x19')],{'host':_0x841a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x841a('0x1c'))['register'](socket);function respondWithStatusCode(_0xa2161d,_0x1df99b){_0x1df99b=_0x1df99b||0xcc;return function(_0xdb3770){if(_0xdb3770){return _0xa2161d['sendStatus'](_0x1df99b);}return _0xa2161d[_0x841a('0x1d')](_0x1df99b)[_0x841a('0x1e')]();};}function respondWithResult(_0x637a9e,_0x3e52fe){_0x3e52fe=_0x3e52fe||0xc8;return function(_0x48e690){if(_0x48e690){return _0x637a9e['status'](_0x3e52fe)['json'](_0x48e690);}};}function respondWithFilteredResult(_0xd12ab3,_0x10bc52){return function(_0x49cd6a){if(_0x49cd6a){var _0x4da48c=typeof _0x10bc52['offset']===_0x841a('0x1f')&&typeof _0x10bc52[_0x841a('0x20')]==='undefined';var _0x5ee0c1=_0x49cd6a[_0x841a('0x21')];var _0x5ce943=_0x4da48c?0x0:_0x10bc52[_0x841a('0x22')];var _0x499d4e=_0x4da48c?_0x49cd6a[_0x841a('0x21')]:_0x10bc52[_0x841a('0x22')]+_0x10bc52[_0x841a('0x20')];var _0x8bdb15;if(_0x499d4e>=_0x5ee0c1){_0x499d4e=_0x5ee0c1;_0x8bdb15=0xc8;}else{_0x8bdb15=0xce;}_0xd12ab3[_0x841a('0x1d')](_0x8bdb15);return _0xd12ab3['set']('Content-Range',_0x5ce943+'-'+_0x499d4e+'/'+_0x5ee0c1)[_0x841a('0x23')](_0x49cd6a);}return null;};}function patchUpdates(_0x76872b){return function(_0x1cd59e){try{jsonpatch[_0x841a('0x24')](_0x1cd59e,_0x76872b,!![]);}catch(_0x4dfb0e){return BPromise[_0x841a('0x25')](_0x4dfb0e);}return _0x1cd59e[_0x841a('0x26')]();};}function saveUpdates(_0x35a6d1,_0x57eae5){return function(_0x500a39){if(_0x500a39){return _0x500a39[_0x841a('0x27')](_0x35a6d1)[_0x841a('0x28')](function(_0x2d21ed){return _0x2d21ed;});}return null;};}function removeEntity(_0x392424,_0x1c7f80){return function(_0x2917d0){if(_0x2917d0){return _0x2917d0['destroy']()[_0x841a('0x28')](function(){_0x392424[_0x841a('0x1d')](0xcc)[_0x841a('0x1e')]();});}};}function handleEntityNotFound(_0x44dac8,_0x2c72c6){return function(_0x4032fc){if(!_0x4032fc){_0x44dac8['sendStatus'](0x194);}return _0x4032fc;};}function handleError(_0x303e2b,_0x516754){_0x516754=_0x516754||0x1f4;return function(_0x5949f3){logger[_0x841a('0x29')](_0x5949f3['stack']);if(_0x5949f3['name']){delete _0x5949f3[_0x841a('0x2a')];}_0x303e2b[_0x841a('0x1d')](_0x516754)[_0x841a('0x2b')](_0x5949f3);};}exports['index']=function(_0x1f81b4,_0x10ec31){var _0x573f10={},_0x4d6346={},_0x283643={'count':0x0,'rows':[]};var _0xd4a0c3=_['map'](db[_0x841a('0x2c')]['rawAttributes'],function(_0x15d761){return{'name':_0x15d761[_0x841a('0x2d')],'type':_0x15d761['type'][_0x841a('0x2e')]};});_0x4d6346[_0x841a('0x2f')]=_[_0x841a('0x30')](_0xd4a0c3,_0x841a('0x2a'));_0x4d6346['query']=_[_0x841a('0x31')](_0x1f81b4['query']);_0x4d6346['filters']=_[_0x841a('0x32')](_0x4d6346[_0x841a('0x2f')],_0x4d6346[_0x841a('0x33')]);_0x573f10[_0x841a('0x34')]=_['intersection'](_0x4d6346['model'],qs[_0x841a('0x35')](_0x1f81b4[_0x841a('0x33')][_0x841a('0x35')]));_0x573f10[_0x841a('0x34')]=_0x573f10[_0x841a('0x34')][_0x841a('0x36')]?_0x573f10[_0x841a('0x34')]:_0x4d6346['model'];if(!_0x1f81b4[_0x841a('0x33')][_0x841a('0x37')](_0x841a('0x38'))){_0x573f10['limit']=qs['limit'](_0x1f81b4[_0x841a('0x33')]['limit']);_0x573f10['offset']=qs[_0x841a('0x22')](_0x1f81b4[_0x841a('0x33')]['offset']);}_0x573f10[_0x841a('0x39')]=qs['sort'](_0x1f81b4[_0x841a('0x33')][_0x841a('0x3a')]);_0x573f10[_0x841a('0x3b')]=qs[_0x841a('0x3c')](_[_0x841a('0x3d')](_0x1f81b4['query'],_0x4d6346[_0x841a('0x3c')]),_0xd4a0c3);if(_0x1f81b4[_0x841a('0x33')]['filter']){_0x573f10['where']=_[_0x841a('0x3e')](_0x573f10[_0x841a('0x3b')],{'$or':_[_0x841a('0x30')](_0xd4a0c3,function(_0x3692d4){if(_0x3692d4[_0x841a('0x3f')]!==_0x841a('0x40')){var _0x475d69={};_0x475d69[_0x3692d4[_0x841a('0x2a')]]={'$like':'%'+_0x1f81b4[_0x841a('0x33')]['filter']+'%'};return _0x475d69;}})});}_0x573f10=_[_0x841a('0x3e')]({},_0x573f10,_0x1f81b4[_0x841a('0x41')]);var _0x4a9ef7={'where':_0x573f10[_0x841a('0x3b')]};return db[_0x841a('0x2c')]['count'](_0x4a9ef7)[_0x841a('0x28')](function(_0x1f3117){_0x283643['count']=_0x1f3117;if(_0x1f81b4['query'][_0x841a('0x42')]){_0x573f10['include']=[{'all':!![]}];}return db['ChatGroup'][_0x841a('0x43')](_0x573f10);})[_0x841a('0x28')](function(_0x5ecbcd){_0x283643['rows']=_0x5ecbcd;return _0x283643;})[_0x841a('0x28')](respondWithFilteredResult(_0x10ec31,_0x573f10))[_0x841a('0x44')](handleError(_0x10ec31,null));};exports[_0x841a('0x45')]=function(_0x593488,_0x458cf4){var _0xed1947={'raw':!![],'where':{'id':_0x593488[_0x841a('0x46')]['id']}},_0x4ffcdf={};_0x4ffcdf['model']=_[_0x841a('0x31')](db['ChatGroup'][_0x841a('0x47')]);_0x4ffcdf[_0x841a('0x33')]=_['keys'](_0x593488[_0x841a('0x33')]);_0x4ffcdf[_0x841a('0x3c')]=_[_0x841a('0x32')](_0x4ffcdf['model'],_0x4ffcdf[_0x841a('0x33')]);_0xed1947['attributes']=_[_0x841a('0x32')](_0x4ffcdf[_0x841a('0x2f')],qs['fields'](_0x593488['query']['fields']));_0xed1947[_0x841a('0x34')]=_0xed1947['attributes']['length']?_0xed1947[_0x841a('0x34')]:_0x4ffcdf['model'];if(_0x593488['query']['includeAll']){_0xed1947[_0x841a('0x48')]=[{'all':!![]}];}_0xed1947=_[_0x841a('0x3e')]({},_0xed1947,_0x593488['options']);return db['ChatGroup'][_0x841a('0x49')](_0xed1947)[_0x841a('0x28')](handleEntityNotFound(_0x458cf4,null))[_0x841a('0x28')](respondWithResult(_0x458cf4,null))[_0x841a('0x44')](handleError(_0x458cf4,null));};exports[_0x841a('0x4a')]=function(_0x196d66,_0x5e6ba0){return db[_0x841a('0x2c')][_0x841a('0x4a')](_0x196d66[_0x841a('0x4b')],{})[_0x841a('0x28')](respondWithResult(_0x5e6ba0,0xc9))[_0x841a('0x44')](handleError(_0x5e6ba0,null));};exports[_0x841a('0x27')]=function(_0x1c24a9,_0x3c3f49){if(_0x1c24a9[_0x841a('0x4b')]['id']){delete _0x1c24a9[_0x841a('0x4b')]['id'];}return db['ChatGroup'][_0x841a('0x49')]({'where':{'id':_0x1c24a9[_0x841a('0x46')]['id']}})[_0x841a('0x28')](handleEntityNotFound(_0x3c3f49,null))[_0x841a('0x28')](saveUpdates(_0x1c24a9[_0x841a('0x4b')],null))['then'](respondWithResult(_0x3c3f49,null))[_0x841a('0x44')](handleError(_0x3c3f49,null));};exports[_0x841a('0x4c')]=function(_0x198f04,_0x25dce1){return db['ChatGroup'][_0x841a('0x49')]({'where':{'id':_0x198f04['params']['id']}})[_0x841a('0x28')](handleEntityNotFound(_0x25dce1,null))['then'](removeEntity(_0x25dce1,null))[_0x841a('0x44')](handleError(_0x25dce1,null));};exports['describe']=function(_0x149d7a,_0x153f1c){return db[_0x841a('0x2c')]['describe']()[_0x841a('0x28')](respondWithResult(_0x153f1c,null))[_0x841a('0x44')](handleError(_0x153f1c,null));};exports[_0x841a('0x4d')]=function(_0x1afd61,_0x3f033b,_0x20f999){return db[_0x841a('0x4e')]['count']({'where':{'ChatGroupId':_0x1afd61['params']['id'],'ToId':_0x1afd61['user']['id'],'read':![]}})['then'](function(_0x5d2e5a){return{'id':_[_0x841a('0x4f')](_0x1afd61[_0x841a('0x46')]['id']),'count':_0x5d2e5a};})[_0x841a('0x28')](respondWithResult(_0x3f033b,null))['catch'](handleError(_0x3f033b,null));};exports[_0x841a('0x50')]=function(_0x4e9823,_0x40bc27,_0x12579f){return db[_0x841a('0x2c')]['find']({'where':{'id':_0x4e9823[_0x841a('0x46')]['id']}})['then'](handleEntityNotFound(_0x40bc27,null))['then'](function(_0x4a340f){if(_0x4a340f){return _0x4a340f[_0x841a('0x50')](_0x4e9823[_0x841a('0x4b')][_0x841a('0x51')],_[_0x841a('0x52')](_0x4e9823[_0x841a('0x4b')],[_0x841a('0x51'),'id'])||{});}})[_0x841a('0x28')](respondWithResult(_0x40bc27,null))['catch'](handleError(_0x40bc27,null));};exports['getMembers']=function(_0x4501b0,_0x3cc76e,_0x13b8d2){var _0x58d613={};var _0x1eea8a={};var _0x21547e;var _0x4df8de;return db['ChatGroup']['findOne']({'where':{'id':_0x4501b0[_0x841a('0x46')]['id']}})[_0x841a('0x28')](handleEntityNotFound(_0x3cc76e,null))['then'](function(_0x2ad4e3){if(_0x2ad4e3){_0x21547e=_0x2ad4e3;_0x1eea8a['model']=_[_0x841a('0x31')](db[_0x841a('0x53')][_0x841a('0x47')]);_0x1eea8a['query']=_['keys'](_0x4501b0['query']);_0x1eea8a[_0x841a('0x3c')]=_['intersection'](_0x1eea8a[_0x841a('0x2f')],_0x1eea8a[_0x841a('0x33')]);_0x58d613[_0x841a('0x34')]=_['intersection'](_0x1eea8a[_0x841a('0x2f')],qs[_0x841a('0x35')](_0x4501b0['query'][_0x841a('0x35')]));_0x58d613[_0x841a('0x34')]=_0x58d613[_0x841a('0x34')][_0x841a('0x36')]?_0x58d613[_0x841a('0x34')]:_0x1eea8a['model'];_0x58d613['order']=qs['sort'](_0x4501b0['query'][_0x841a('0x3a')]);_0x58d613[_0x841a('0x3b')]=qs[_0x841a('0x3c')](_['pick'](_0x4501b0[_0x841a('0x33')],_0x1eea8a[_0x841a('0x3c')]));if(_0x4501b0[_0x841a('0x33')]['filter']){_0x58d613[_0x841a('0x3b')]=_[_0x841a('0x3e')](_0x58d613['where'],{'$or':_[_0x841a('0x30')](_0x58d613['attributes'],function(_0x32f36d){var _0x5e1b32={};_0x5e1b32[_0x32f36d]={'$like':'%'+_0x4501b0[_0x841a('0x33')][_0x841a('0x54')]+'%'};return _0x5e1b32;})});}_0x58d613=_[_0x841a('0x3e')]({},_0x58d613,_0x4501b0[_0x841a('0x41')]);return _0x21547e[_0x841a('0x55')](_0x58d613);}})[_0x841a('0x28')](function(_0x3c4ef4){if(_0x3c4ef4){_0x4df8de=_0x3c4ef4[_0x841a('0x36')];if(!_0x4501b0[_0x841a('0x33')]['hasOwnProperty'](_0x841a('0x38'))){_0x58d613['limit']=qs[_0x841a('0x20')](_0x4501b0[_0x841a('0x33')][_0x841a('0x20')]);_0x58d613[_0x841a('0x22')]=qs[_0x841a('0x22')](_0x4501b0[_0x841a('0x33')][_0x841a('0x22')]);}return _0x21547e[_0x841a('0x55')](_0x58d613);}})['then'](function(_0x5999b2){if(_0x5999b2){return _0x5999b2?{'count':_0x4df8de,'rows':_0x5999b2}:null;}})['then'](respondWithResult(_0x3cc76e,null))['catch'](handleError(_0x3cc76e,null));};exports[_0x841a('0x56')]=function(_0x1a2908,_0x109580,_0x3cc349){return db[_0x841a('0x2c')][_0x841a('0x49')]({'where':{'id':_0x1a2908[_0x841a('0x46')]['id']}})['then'](handleEntityNotFound(_0x109580,null))['then'](function(_0x25f208){if(_0x25f208){return _0x25f208['removeMembers'](_0x1a2908[_0x841a('0x33')][_0x841a('0x51')]);}})[_0x841a('0x28')](respondWithStatusCode(_0x109580,null))[_0x841a('0x44')](handleError(_0x109580,null));};exports[_0x841a('0x57')]=function(_0x56d0e9,_0x192889,_0x4694ff){if(_0x56d0e9['body']['id']){delete _0x56d0e9[_0x841a('0x4b')]['id'];}return db[_0x841a('0x2c')][_0x841a('0x49')]({'where':{'id':_0x56d0e9['params']['id']}})[_0x841a('0x28')](handleEntityNotFound(_0x192889,null))[_0x841a('0x28')](function(_0xb334f7){if(_0xb334f7){_0x56d0e9[_0x841a('0x4b')]['ChatGroupId']=_0xb334f7['id'];return db['ChatInternalMessage']['create'](_0x56d0e9[_0x841a('0x4b')]);}})[_0x841a('0x28')](respondWithResult(_0x192889,null))['catch'](handleError(_0x192889,null));};exports[_0x841a('0x58')]=function(_0x5dbbce,_0x34dcaf,_0x249c9b){var _0x53cf24={};var _0x107b16={};var _0xc7941c;var _0xb25ff1;return db[_0x841a('0x2c')][_0x841a('0x59')]({'where':{'id':_0x5dbbce['params']['id']}})[_0x841a('0x28')](handleEntityNotFound(_0x34dcaf,null))[_0x841a('0x28')](function(_0x1d0d31){if(_0x1d0d31){_0xc7941c=_0x1d0d31;_0x107b16[_0x841a('0x2f')]=_[_0x841a('0x31')](db['ChatInternalMessage'][_0x841a('0x47')]);_0x107b16['query']=_['keys'](_0x5dbbce[_0x841a('0x33')]);_0x107b16['filters']=_[_0x841a('0x32')](_0x107b16[_0x841a('0x2f')],_0x107b16[_0x841a('0x33')]);_0x53cf24[_0x841a('0x34')]=_[_0x841a('0x32')](_0x107b16[_0x841a('0x2f')],qs[_0x841a('0x35')](_0x5dbbce[_0x841a('0x33')][_0x841a('0x35')]));_0x53cf24[_0x841a('0x34')]=_0x53cf24[_0x841a('0x34')]['length']?_0x53cf24[_0x841a('0x34')]:_0x107b16[_0x841a('0x2f')];_0x53cf24[_0x841a('0x39')]=qs[_0x841a('0x3a')](_0x5dbbce[_0x841a('0x33')]['sort']);_0x53cf24[_0x841a('0x3b')]=qs['filters'](_['pick'](_0x5dbbce['query'],_0x107b16['filters']));if(_0x5dbbce['query'][_0x841a('0x54')]){_0x53cf24[_0x841a('0x3b')]=_[_0x841a('0x3e')](_0x53cf24['where'],{'$or':_[_0x841a('0x30')](_0x53cf24[_0x841a('0x34')],function(_0x30c268){var _0x13eb16={};_0x13eb16[_0x30c268]={'$like':'%'+_0x5dbbce[_0x841a('0x33')][_0x841a('0x54')]+'%'};return _0x13eb16;})});}if(_0x5dbbce[_0x841a('0x33')][_0x841a('0x5a')]){var _0x1cd9eb=_0x5dbbce[_0x841a('0x33')][_0x841a('0x5a')][_0x841a('0x5b')](',');var _0x23e512={};_0x23e512[_0x1cd9eb[0x0]]={'$gte':moment(_0x1cd9eb[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x53cf24[_0x841a('0x3b')]=_[_0x841a('0x3e')](_0x53cf24['where'],_0x23e512);}_0x53cf24=_[_0x841a('0x3e')]({},_0x53cf24,_0x5dbbce[_0x841a('0x41')]);return _0xc7941c[_0x841a('0x58')](_0x53cf24);}})[_0x841a('0x28')](function(_0x61bd21){if(_0x61bd21){_0xb25ff1=_0x61bd21[_0x841a('0x36')];if(!_0x5dbbce[_0x841a('0x33')][_0x841a('0x37')](_0x841a('0x38'))){_0x53cf24['limit']=qs[_0x841a('0x20')](_0x5dbbce[_0x841a('0x33')][_0x841a('0x20')]);_0x53cf24['offset']=qs[_0x841a('0x22')](_0x5dbbce['query'][_0x841a('0x22')]);}return _0xc7941c[_0x841a('0x58')](_0x53cf24);}})[_0x841a('0x28')](function(_0x21d2a5){if(_0x21d2a5){return _0x21d2a5?{'count':_0xb25ff1,'rows':_0x21d2a5}:null;}})['then'](respondWithResult(_0x34dcaf,null))[_0x841a('0x44')](handleError(_0x34dcaf,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 7d34ca8..f883443 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 _0x626d=['ChatGroup','setMaxListeners','save','remove','emit','exports','events'];(function(_0xc85e7f,_0x10574a){var _0x90e7c6=function(_0x4b2c85){while(--_0x4b2c85){_0xc85e7f['push'](_0xc85e7f['shift']());}};_0x90e7c6(++_0x10574a);}(_0x626d,0xa0));var _0xd626=function(_0x989980,_0x1e5018){_0x989980=_0x989980-0x0;var _0x939945=_0x626d[_0x989980];return _0x939945;};'use strict';var EventEmitter=require(_0xd626('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xd626('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd626('0x2')](0x0);var events={'afterCreate':_0xd626('0x3'),'afterUpdate':'update','afterDestroy':_0xd626('0x4')};function emitEvent(_0x33e3fc){return function(_0x31b2a5,_0x1ea984,_0xada387){ChatGroupEvents['emit'](_0x33e3fc+':'+_0x31b2a5['id'],_0x31b2a5);ChatGroupEvents[_0xd626('0x5')](_0x33e3fc,_0x31b2a5);_0xada387(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xd626('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0xd07e=['ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x40ec55,_0x1c66a4){var _0x5a6be9=function(_0x1a69c9){while(--_0x1a69c9){_0x40ec55['push'](_0x40ec55['shift']());}};_0x5a6be9(++_0x1c66a4);}(_0xd07e,0x8e));var _0xed07=function(_0x37fff5,_0x2e32a4){_0x37fff5=_0x37fff5-0x0;var _0x51c788=_0xd07e[_0x37fff5];return _0x51c788;};'use strict';var EventEmitter=require(_0xed07('0x0'));var ChatGroup=require(_0xed07('0x1'))['db'][_0xed07('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xed07('0x3')](0x0);var events={'afterCreate':_0xed07('0x4'),'afterUpdate':'update','afterDestroy':_0xed07('0x5')};function emitEvent(_0x1d1e24){return function(_0x1546dd,_0x580878,_0x44e93e){ChatGroupEvents[_0xed07('0x6')](_0x1d1e24+':'+_0x1546dd['id'],_0x1546dd);ChatGroupEvents['emit'](_0x1d1e24,_0x1546dd);_0x44e93e(null);};}for(var e in events){if(events[_0xed07('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xed07('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index eee08cc..8345ccd 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 _0x4d7f=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x4d2612,_0x1f2501){var _0x1f21c4=function(_0x51ecab){while(--_0x51ecab){_0x4d2612['push'](_0x4d2612['shift']());}};_0x1f21c4(++_0x1f2501);}(_0x4d7f,0x161));var _0xf4d7=function(_0x580ea0,_0x3f57ef){_0x580ea0=_0x580ea0-0x0;var _0x54755e=_0x4d7f[_0x580ea0];return _0x54755e;};'use strict';var _=require(_0xf4d7('0x0'));var util=require(_0xf4d7('0x1'));var logger=require(_0xf4d7('0x2'))(_0xf4d7('0x3'));var moment=require(_0xf4d7('0x4'));var BPromise=require(_0xf4d7('0x5'));var rp=require(_0xf4d7('0x6'));var fs=require('fs');var path=require(_0xf4d7('0x7'));var rimraf=require(_0xf4d7('0x8'));var config=require(_0xf4d7('0x9'));var attributes=require(_0xf4d7('0xa'));module['exports']=function(_0x169cc6,_0x5793e4){return _0x169cc6[_0xf4d7('0xb')](_0xf4d7('0xc'),attributes,{'tableName':_0xf4d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cdc=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x6f114,_0x2ac0f9){var _0x40546b=function(_0x3902ac){while(--_0x3902ac){_0x6f114['push'](_0x6f114['shift']());}};_0x40546b(++_0x2ac0f9);}(_0x1cdc,0x15d));var _0xc1cd=function(_0x55f480,_0x256438){_0x55f480=_0x55f480-0x0;var _0x13dfa1=_0x1cdc[_0x55f480];return _0x13dfa1;};'use strict';var _=require(_0xc1cd('0x0'));var util=require(_0xc1cd('0x1'));var logger=require(_0xc1cd('0x2'))(_0xc1cd('0x3'));var moment=require(_0xc1cd('0x4'));var BPromise=require(_0xc1cd('0x5'));var rp=require(_0xc1cd('0x6'));var fs=require('fs');var path=require(_0xc1cd('0x7'));var rimraf=require('rimraf');var config=require(_0xc1cd('0x8'));var attributes=require('./chatGroup.attributes');module[_0xc1cd('0x9')]=function(_0xc3370f,_0x12bfcf){return _0xc3370f[_0xc1cd('0xa')](_0xc1cd('0xb'),attributes,{'tableName':_0xc1cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 63bbc99..9ac39f3 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 _0x8ece=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1ffa28,_0x104537){var _0x235fbb=function(_0x1dcc42){while(--_0x1dcc42){_0x1ffa28['push'](_0x1ffa28['shift']());}};_0x235fbb(++_0x104537);}(_0x8ece,0x195));var _0xe8ec=function(_0x3b8576,_0x241739){_0x3b8576=_0x3b8576-0x0;var _0x410744=_0x8ece[_0x3b8576];return _0x410744;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var moment=require(_0xe8ec('0x2'));var BPromise=require(_0xe8ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8ec('0x4'))['db'];var utils=require(_0xe8ec('0x5'));var logger=require(_0xe8ec('0x6'))(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8ec('0x9')][_0xe8ec('0xa')]({'port':0x232a});config[_0xe8ec('0xb')]=_[_0xe8ec('0xc')](config[_0xe8ec('0xb')],{'host':_0xe8ec('0xd'),'port':0x18eb});var socket=require(_0xe8ec('0xe'))(new Redis(config['redis']));require(_0xe8ec('0xf'))['register'](socket);function respondWithRpcPromise(_0x1345e0,_0x5b1569,_0x1b0a84){return new BPromise(function(_0x278f86,_0x4ff773){return client[_0xe8ec('0x10')](_0x1345e0,_0x1b0a84)[_0xe8ec('0x11')](function(_0x959f4){logger[_0xe8ec('0x12')](_0xe8ec('0x13'),_0x5b1569,_0xe8ec('0x14'));logger[_0xe8ec('0x15')](_0xe8ec('0x16'),_0x5b1569,_0xe8ec('0x14'),JSON[_0xe8ec('0x17')](_0x959f4));if(_0x959f4['error']){if(_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x19')]===0x1f4){logger[_0xe8ec('0x18')](_0xe8ec('0x13'),_0x5b1569,_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);return _0x4ff773(_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);}logger['error'](_0xe8ec('0x13'),_0x5b1569,_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);return _0x278f86(_0x959f4['error'][_0xe8ec('0x1a')]);}else{logger[_0xe8ec('0x12')](_0xe8ec('0x13'),_0x5b1569,_0xe8ec('0x14'));_0x278f86(_0x959f4[_0xe8ec('0x1b')][_0xe8ec('0x1a')]);}})[_0xe8ec('0x1c')](function(_0x2e54f0){logger['error'](_0xe8ec('0x13'),_0x5b1569,_0x2e54f0);_0x4ff773(_0x2e54f0);});});}
\ No newline at end of file
+var _0xfbf0=['ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','info'];(function(_0x2e45c2,_0x40ca8a){var _0x4df9cb=function(_0x452f3d){while(--_0x452f3d){_0x2e45c2['push'](_0x2e45c2['shift']());}};_0x4df9cb(++_0x40ca8a);}(_0xfbf0,0x141));var _0x0fbf=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xfbf0[_0x2283dc];return _0x16db90;};'use strict';var _=require('lodash');var util=require(_0x0fbf('0x0'));var moment=require(_0x0fbf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fbf('0x2'));var db=require(_0x0fbf('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fbf('0x4'))('rpc');var config=require(_0x0fbf('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0fbf('0x6')][_0x0fbf('0x7')]({'port':0x232a});config['redis']=_[_0x0fbf('0x8')](config[_0x0fbf('0x9')],{'host':_0x0fbf('0xa'),'port':0x18eb});var socket=require(_0x0fbf('0xb'))(new Redis(config[_0x0fbf('0x9')]));require(_0x0fbf('0xc'))[_0x0fbf('0xd')](socket);function respondWithRpcPromise(_0x409b04,_0x165eec,_0x174e66){return new BPromise(function(_0x4d1f16,_0x3b2a6a){return client['request'](_0x409b04,_0x174e66)['then'](function(_0x45e96e){logger[_0x0fbf('0xe')](_0x0fbf('0xf'),_0x165eec,_0x0fbf('0x10'));logger['debug'](_0x0fbf('0x11'),_0x165eec,_0x0fbf('0x10'),JSON[_0x0fbf('0x12')](_0x45e96e));if(_0x45e96e[_0x0fbf('0x13')]){if(_0x45e96e[_0x0fbf('0x13')][_0x0fbf('0x14')]===0x1f4){logger[_0x0fbf('0x13')](_0x0fbf('0xf'),_0x165eec,_0x45e96e[_0x0fbf('0x13')][_0x0fbf('0x15')]);return _0x3b2a6a(_0x45e96e[_0x0fbf('0x13')][_0x0fbf('0x15')]);}logger[_0x0fbf('0x13')](_0x0fbf('0xf'),_0x165eec,_0x45e96e[_0x0fbf('0x13')][_0x0fbf('0x15')]);return _0x4d1f16(_0x45e96e[_0x0fbf('0x13')][_0x0fbf('0x15')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x165eec,'request\x20sent');_0x4d1f16(_0x45e96e[_0x0fbf('0x16')][_0x0fbf('0x15')]);}})[_0x0fbf('0x17')](function(_0x296602){logger[_0x0fbf('0x13')](_0x0fbf('0xf'),_0x165eec,_0x296602);_0x3b2a6a(_0x296602);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index c3bd289..e5ba595 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 _0x363a=['./chatGroup.events','remove','emit','register','chatGroup:'];(function(_0x51d92a,_0x49d811){var _0x1236b0=function(_0x46c098){while(--_0x46c098){_0x51d92a['push'](_0x51d92a['shift']());}};_0x1236b0(++_0x49d811);}(_0x363a,0x1d6));var _0xa363=function(_0x1475a6,_0x56628c){_0x1475a6=_0x1475a6-0x0;var _0x3c0d07=_0x363a[_0x1475a6];return _0x3c0d07;};'use strict';var ChatGroupEvents=require(_0xa363('0x0'));var events=['save',_0xa363('0x1'),'update'];function createListener(_0x3e3904,_0x3ed619){return function(_0x38b957){_0x3ed619[_0xa363('0x2')](_0x3e3904,_0x38b957);};}function removeListener(_0x19adfb,_0x117c5a){return function(){ChatGroupEvents['removeListener'](_0x19adfb,_0x117c5a);};}exports[_0xa363('0x3')]=function(_0x16526d){for(var _0x43de0a=0x0,_0x135b6f=events['length'];_0x43de0a<_0x135b6f;_0x43de0a++){var _0x28b096=events[_0x43de0a];var _0x5447ed=createListener(_0xa363('0x4')+_0x28b096,_0x16526d);ChatGroupEvents['on'](_0x28b096,_0x5447ed);}};
\ No newline at end of file
+var _0x59ba=['remove','update','emit','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x59ba,0x1ae));var _0xa59b=function(_0x2347b5,_0x384435){_0x2347b5=_0x2347b5-0x0;var _0x5c5c12=_0x59ba[_0x2347b5];return _0x5c5c12;};'use strict';var ChatGroupEvents=require(_0xa59b('0x0'));var events=[_0xa59b('0x1'),_0xa59b('0x2'),_0xa59b('0x3')];function createListener(_0x701629,_0x399042){return function(_0x26b559){_0x399042[_0xa59b('0x4')](_0x701629,_0x26b559);};}function removeListener(_0xff5ee8,_0x2e5418){return function(){ChatGroupEvents['removeListener'](_0xff5ee8,_0x2e5418);};}exports[_0xa59b('0x5')]=function(_0x3b23fa){for(var _0x4713ad=0x0,_0xa1abe1=events[_0xa59b('0x6')];_0x4713ad<_0xa1abe1;_0x4713ad++){var _0x51d0d9=events[_0x4713ad];var _0x44c804=createListener(_0xa59b('0x7')+_0x51d0d9,_0x3b23fa);ChatGroupEvents['on'](_0x51d0d9,_0x44c804);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index fe0edf5..8971501 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 _0x4219=['post','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','create'];(function(_0x484a3e,_0x4c0eda){var _0x29a66a=function(_0x5310c3){while(--_0x5310c3){_0x484a3e['push'](_0x484a3e['shift']());}};_0x29a66a(++_0x4c0eda);}(_0x4219,0x17d));var _0x9421=function(_0xd89388,_0x33c473){_0xd89388=_0xd89388-0x0;var _0x4157a3=_0x4219[_0xd89388];return _0x4157a3;};'use strict';var multer=require('multer');var util=require(_0x9421('0x0'));var path=require(_0x9421('0x1'));var timeout=require(_0x9421('0x2'));var express=require(_0x9421('0x3'));var router=express[_0x9421('0x4')]();var fs_extra=require(_0x9421('0x5'));var auth=require(_0x9421('0x6'));var interaction=require(_0x9421('0x7'));var config=require(_0x9421('0x8'));var controller=require(_0x9421('0x9'));router['get']('/',auth[_0x9421('0xa')](),controller[_0x9421('0xb')]);router[_0x9421('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x9421('0xd')]);router['get'](_0x9421('0xe'),auth[_0x9421('0xa')](),controller[_0x9421('0xf')]);router[_0x9421('0xc')](_0x9421('0x10'),auth[_0x9421('0xa')](),controller[_0x9421('0x11')]);router[_0x9421('0xc')]('/:id/members',auth[_0x9421('0xa')](),controller[_0x9421('0x12')]);router[_0x9421('0xc')](_0x9421('0x13'),auth[_0x9421('0xa')](),controller[_0x9421('0x14')]);router['post']('/',auth[_0x9421('0xa')](),controller[_0x9421('0x15')]);router[_0x9421('0x16')](_0x9421('0x17'),auth[_0x9421('0xa')](),controller[_0x9421('0x18')]);router[_0x9421('0x16')]('/:id/messages',auth[_0x9421('0xa')](),controller[_0x9421('0x19')]);router[_0x9421('0x1a')](_0x9421('0xe'),auth[_0x9421('0xa')](),controller[_0x9421('0x1b')]);router[_0x9421('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x9421('0x1d')]);router[_0x9421('0x1c')](_0x9421('0x17'),auth[_0x9421('0xa')](),controller[_0x9421('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0xfe9d=['describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','put','delete','destroy','removeMembers','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','isAuthenticated'];(function(_0x2d530c,_0x3cfc95){var _0x41b1a8=function(_0x1e4be3){while(--_0x1e4be3){_0x2d530c['push'](_0x2d530c['shift']());}};_0x41b1a8(++_0x3cfc95);}(_0xfe9d,0x151));var _0xdfe9=function(_0x3629b9,_0xfff26e){_0x3629b9=_0x3629b9-0x0;var _0xadcff3=_0xfe9d[_0x3629b9];return _0xadcff3;};'use strict';var multer=require(_0xdfe9('0x0'));var util=require(_0xdfe9('0x1'));var path=require(_0xdfe9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdfe9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdfe9('0x4'));var interaction=require(_0xdfe9('0x5'));var config=require(_0xdfe9('0x6'));var controller=require(_0xdfe9('0x7'));router[_0xdfe9('0x8')]('/',auth['isAuthenticated'](),controller[_0xdfe9('0x9')]);router[_0xdfe9('0x8')]('/describe',auth[_0xdfe9('0xa')](),controller[_0xdfe9('0xb')]);router['get'](_0xdfe9('0xc'),auth['isAuthenticated'](),controller[_0xdfe9('0xd')]);router['get'](_0xdfe9('0xe'),auth[_0xdfe9('0xa')](),controller[_0xdfe9('0xf')]);router['get'](_0xdfe9('0x10'),auth['isAuthenticated'](),controller[_0xdfe9('0x11')]);router[_0xdfe9('0x8')](_0xdfe9('0x12'),auth[_0xdfe9('0xa')](),controller[_0xdfe9('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdfe9('0x14')]);router[_0xdfe9('0x15')](_0xdfe9('0x10'),auth['isAuthenticated'](),controller[_0xdfe9('0x16')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xdfe9('0x17')]);router[_0xdfe9('0x18')](_0xdfe9('0xc'),auth[_0xdfe9('0xa')](),controller['update']);router[_0xdfe9('0x19')](_0xdfe9('0xc'),auth[_0xdfe9('0xa')](),controller[_0xdfe9('0x1a')]);router['delete'](_0xdfe9('0x10'),auth[_0xdfe9('0xa')](),controller[_0xdfe9('0x1b')]);module[_0xdfe9('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index b5b3e44..d23b485 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 _0xb248=['INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN'];(function(_0x2d5818,_0xc9aa8b){var _0x1d1e9d=function(_0xdea9e8){while(--_0xdea9e8){_0x2d5818['push'](_0x2d5818['shift']());}};_0x1d1e9d(++_0xc9aa8b);}(_0xb248,0xc6));var _0x8b24=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xb248[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x8b24('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8b24('0x2')]},'ratingType':{'type':Sequelize[_0x8b24('0x3')](_0x8b24('0x4'),'thumb'),'defaultValue':_0x8b24('0x4')},'ratingMessage':{'type':Sequelize[_0x8b24('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x8b24('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8b24('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8b24('0x6')]},'thirdDisposition':{'type':Sequelize[_0x8b24('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x8b24('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8b24('0x6')]},'osVersion':{'type':Sequelize[_0x8b24('0x6')]},'deviceModel':{'type':Sequelize[_0x8b24('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x8b24('0x6')]},'referer':{'type':Sequelize[_0x8b24('0x5')]},'customerIp':{'type':Sequelize[_0x8b24('0x6')]},'formData':{'type':Sequelize[_0x8b24('0x5')](_0x8b24('0x8'))},'read1stAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x8b24('0x3')]('in',_0x8b24('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8b24('0x6')]},'customerPort':{'type':Sequelize[_0x8b24('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x8b24('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4227=['thumb','TEXT','STRING','DATE','long','ENUM','BOOLEAN','sequelize','INTEGER','star'];(function(_0x1cafa2,_0x370ccb){var _0x51e4f3=function(_0x30d879){while(--_0x30d879){_0x1cafa2['push'](_0x1cafa2['shift']());}};_0x51e4f3(++_0x370ccb);}(_0x4227,0x89));var _0x7422=function(_0x23db00,_0x28891e){_0x23db00=_0x23db00-0x0;var _0x4daf8d=_0x4227[_0x23db00];return _0x4daf8d;};'use strict';var Sequelize=require(_0x7422('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7422('0x1')]},'ratingType':{'type':Sequelize['ENUM'](_0x7422('0x2'),_0x7422('0x3')),'defaultValue':_0x7422('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7422('0x4')]},'mailTranscript':{'type':Sequelize[_0x7422('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7422('0x6')]},'disposition':{'type':Sequelize[_0x7422('0x5')]},'secondDisposition':{'type':Sequelize[_0x7422('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7422('0x5')]},'note':{'type':Sequelize[_0x7422('0x5')]},'browserName':{'type':Sequelize[_0x7422('0x5')]},'browserVersion':{'type':Sequelize[_0x7422('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x7422('0x5')]},'deviceModel':{'type':Sequelize[_0x7422('0x5')]},'deviceVendor':{'type':Sequelize[_0x7422('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x7422('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7422('0x4')](_0x7422('0x7'))},'read1stAt':{'type':Sequelize[_0x7422('0x6')]},'lastMsgAt':{'type':Sequelize[_0x7422('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x7422('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x7422('0x5')]},'customerPort':{'type':Sequelize[_0x7422('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x7422('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 c856604..1430d15 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 _0xa641=['unlinkSync','zip-dir','request-promise','util','path','ejs','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','destroy','name','send','render','merge','body','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','params','model','keys','filters','intersection','attributes','fields','include','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','mailTranscript','format','transcript-%s.txt','now','User','ChatWebsite','ContactId','Messages','length','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','ChatInteractionId','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','rows','getMyMessages','push','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','direction','read','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','existsSync','pipe','createWriteStream','out','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xa641,0x199));var _0x1a64=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa641[_0x4e676e];return _0x336a3c;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x1a64('0x0'));var rp=require(_0x1a64('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a64('0x2'));var path=require(_0x1a64('0x3'));var ejs=require(_0x1a64('0x4'));var fs=require('fs');var _=require(_0x1a64('0x5'));var Redis=require(_0x1a64('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x1a64('0x7'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x1a64('0x8'));var config=require(_0x1a64('0x9'));var db=require(_0x1a64('0xa'))['db'];config['redis']=_[_0x1a64('0xb')](config[_0x1a64('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a64('0xd'))(new Redis(config[_0x1a64('0xc')]));require(_0x1a64('0xe'))['register'](socket);var jayson=require(_0x1a64('0xf'));var client=jayson[_0x1a64('0x10')][_0x1a64('0x11')]({'port':0x232b});var client9004=jayson['client'][_0x1a64('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x15a5d3,_0x37b612,_0x5ba2e9,_0x195186){return new BPromise(function(_0x5b385e,_0x231d68){var _0x51a48c=_0x195186||client;return _0x51a48c[_0x1a64('0x12')](_0x15a5d3,_0x5ba2e9)[_0x1a64('0x13')](function(_0x950204){logger[_0x1a64('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x37b612,'request\x20sent');logger[_0x1a64('0x15')](_0x1a64('0x16'),_0x37b612,_0x1a64('0x17'),JSON['stringify'](_0x950204));if(_0x950204['error']){if(_0x950204[_0x1a64('0x18')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x37b612,_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);return _0x231d68(_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);}logger[_0x1a64('0x18')](_0x1a64('0x1a'),_0x37b612,_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);return _0x5b385e(_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);}else{logger[_0x1a64('0x14')](_0x1a64('0x1a'),_0x37b612,_0x1a64('0x17'));_0x5b385e(_0x950204[_0x1a64('0x1b')][_0x1a64('0x19')]);}})[_0x1a64('0x1c')](function(_0x5ea058){logger[_0x1a64('0x18')](_0x1a64('0x1a'),_0x37b612,_0x5ea058);_0x231d68(_0x5ea058);});});}function respondWithStatusCode(_0x1f6fb5,_0x516c69){_0x516c69=_0x516c69||0xcc;return function(_0xc71066){if(_0xc71066){return _0x1f6fb5[_0x1a64('0x1d')](_0x516c69);}return _0x1f6fb5['status'](_0x516c69)[_0x1a64('0x1e')]();};}function respondWithResult(_0x3c74ec,_0x5630ce){_0x5630ce=_0x5630ce||0xc8;return function(_0x286743){if(_0x286743){return _0x3c74ec[_0x1a64('0x1f')](_0x5630ce)['json'](_0x286743);}};}function respondWithFilteredResult(_0xf3ad73,_0x4e3f92){return function(_0x523d6e){if(_0x523d6e){var _0x57168c=typeof _0x4e3f92['offset']==='undefined'&&typeof _0x4e3f92[_0x1a64('0x20')]===_0x1a64('0x21');var _0x21084f=_0x523d6e[_0x1a64('0x22')];var _0x17fbc0=_0x57168c?0x0:_0x4e3f92['offset'];var _0x5916bc=_0x57168c?_0x523d6e[_0x1a64('0x22')]:_0x4e3f92[_0x1a64('0x23')]+_0x4e3f92[_0x1a64('0x20')];var _0x2e3da4;if(_0x5916bc>=_0x21084f){_0x5916bc=_0x21084f;_0x2e3da4=0xc8;}else{_0x2e3da4=0xce;}_0xf3ad73[_0x1a64('0x1f')](_0x2e3da4);return _0xf3ad73[_0x1a64('0x24')](_0x1a64('0x25'),_0x17fbc0+'-'+_0x5916bc+'/'+_0x21084f)['json'](_0x523d6e);}return null;};}function saveUpdates(_0x3c2b26){return function(_0x1004ad){if(_0x1004ad){return _0x1004ad['update'](_0x3c2b26)['then'](function(_0x212d33){return _0x212d33;});}return null;};}function removeEntity(_0x264138){return function(_0xfe058d){if(_0xfe058d){return _0xfe058d[_0x1a64('0x26')]()['then'](function(){_0x264138[_0x1a64('0x1f')](0xcc)[_0x1a64('0x1e')]();});}};}function handleEntityNotFound(_0x3c12f6){return function(_0x4563a1){if(!_0x4563a1){_0x3c12f6[_0x1a64('0x1d')](0x194);}return _0x4563a1;};}function handleError(_0x3a42fc,_0x53ff3e){_0x53ff3e=_0x53ff3e||0x1f4;return function(_0x2fd0c8){logger[_0x1a64('0x18')](_0x2fd0c8['stack']);if(_0x2fd0c8[_0x1a64('0x27')]){delete _0x2fd0c8[_0x1a64('0x27')];}_0x3a42fc[_0x1a64('0x1f')](_0x53ff3e)[_0x1a64('0x28')](_0x2fd0c8);};}function getMustacheRender(_0x235c58,_0x4a6b9f){return Mustache[_0x1a64('0x29')](_0x235c58,_[_0x1a64('0x2a')](_0x4a6b9f[_0x1a64('0x2b')],{'contact':_0x4a6b9f['contact'],'message':_0x4a6b9f[_0x1a64('0x19')],'agent':_0x4a6b9f['agent'],'interaction':_0x4a6b9f[_0x1a64('0x2c')],'account':_0x4a6b9f[_0x1a64('0x2d')]}))||'';}exports[_0x1a64('0x2e')]=function(_0x18d31a,_0x59aaf2){var _0x4a9ca5={};var _0x82ab76=_[_0x1a64('0x2f')](db[_0x1a64('0x30')][_0x1a64('0x31')],function(_0x5c953c){return{'name':_0x5c953c[_0x1a64('0x32')],'type':_0x5c953c[_0x1a64('0x33')][_0x1a64('0x34')]};});_0x4a9ca5=qs[_0x1a64('0x35')](_0x82ab76,_0x18d31a);return interaction[_0x1a64('0x36')](_0x1a64('0x37'),_0x18d31a[_0x1a64('0x38')],_0x18d31a[_0x1a64('0x39')],_0x4a9ca5,_0x82ab76)[_0x1a64('0x13')](respondWithFilteredResult(_0x59aaf2,_0x4a9ca5))['catch'](handleError(_0x59aaf2,null));};exports['show']=function(_0x3d3b4c,_0x2b1a1e){var _0x437a36={'raw':![],'where':{'id':_0x3d3b4c[_0x1a64('0x3a')]['id']}},_0x183501={};_0x183501[_0x1a64('0x3b')]=_[_0x1a64('0x3c')](db[_0x1a64('0x30')][_0x1a64('0x31')]);_0x183501[_0x1a64('0x38')]=_[_0x1a64('0x3c')](_0x3d3b4c[_0x1a64('0x38')]);_0x183501[_0x1a64('0x3d')]=_[_0x1a64('0x3e')](_0x183501[_0x1a64('0x3b')],_0x183501[_0x1a64('0x38')]);_0x437a36[_0x1a64('0x3f')]=_[_0x1a64('0x3e')](_0x183501['model'],qs[_0x1a64('0x40')](_0x3d3b4c[_0x1a64('0x38')]['fields']));_0x437a36[_0x1a64('0x3f')]=_0x437a36[_0x1a64('0x3f')]['length']?_0x437a36[_0x1a64('0x3f')]:_0x183501[_0x1a64('0x3b')];if(_0x3d3b4c[_0x1a64('0x38')]['includeAll']){_0x437a36[_0x1a64('0x41')]=[{'all':!![]}];}_0x437a36=_[_0x1a64('0x2a')]({},_0x437a36,_0x3d3b4c['options']);return db['ChatInteraction'][_0x1a64('0x42')](_0x437a36)[_0x1a64('0x13')](handleEntityNotFound(_0x2b1a1e,null))[_0x1a64('0x13')](respondWithResult(_0x2b1a1e,null))[_0x1a64('0x1c')](handleError(_0x2b1a1e,null));};exports['create']=function(_0x54777b,_0x48a095){return db['ChatInteraction'][_0x1a64('0x43')](_0x54777b['body'],{})['then'](respondWithResult(_0x48a095,0xc9))[_0x1a64('0x1c')](handleError(_0x48a095,null));};exports['update']=function(_0x558e63,_0x176d5c){if(_0x558e63[_0x1a64('0x2b')]['id']){delete _0x558e63[_0x1a64('0x2b')]['id'];}return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x558e63[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x176d5c,null))['then'](saveUpdates(_0x558e63[_0x1a64('0x2b')],null))[_0x1a64('0x13')](respondWithResult(_0x176d5c,null))[_0x1a64('0x1c')](handleError(_0x176d5c,null));};exports['destroy']=function(_0x4441b5,_0x3a24ea){return db[_0x1a64('0x30')]['find']({'where':{'id':_0x4441b5['params']['id']}})['then'](handleEntityNotFound(_0x3a24ea,null))[_0x1a64('0x13')](removeEntity(_0x3a24ea,null))[_0x1a64('0x1c')](handleError(_0x3a24ea,null));};exports[_0x1a64('0x44')]=function(_0x54ffee,_0x303447){return db[_0x1a64('0x30')][_0x1a64('0x44')]()[_0x1a64('0x13')](respondWithResult(_0x303447,null))[_0x1a64('0x1c')](handleError(_0x303447,null));};exports[_0x1a64('0x45')]=function(_0x29c915,_0x3c62ef){var _0x2279bd=_0x29c915['params']['id'];var _0x3e0a5c;var _0x19b7a9;var _0x530d47;return db[_0x1a64('0x30')][_0x1a64('0x46')]({'where':{'id':_0x2279bd}})[_0x1a64('0x13')](function(_0x2a7931){_0x3e0a5c=_0x2a7931;return db['ChatWebsite']['findOne']({'where':{'id':_0x2a7931[_0x1a64('0x47')]},'attributes':['id',_0x1a64('0x48'),_0x1a64('0x49'),_0x1a64('0x4a'),_0x1a64('0x4b'),_0x1a64('0x4c')],'raw':!![]});})[_0x1a64('0x13')](function(_0x4b94a0){if(_0x4b94a0&&_0x4b94a0['vidaooApiKey']&&_0x4b94a0['vidaooEscalation']){_0x19b7a9=_0x4b94a0;var _0x17fa55={'interaction':{'id':_0x2279bd},'agent':{'id':_0x29c915[_0x1a64('0x39')]['id'],'name':_0x29c915['user'][_0x1a64('0x27')],'fullname':_0x29c915[_0x1a64('0x39')][_0x1a64('0x4d')],'email':_0x29c915['user'][_0x1a64('0x4e')]},'contact':_0x29c915[_0x1a64('0x2b')][_0x1a64('0x4f')],'account':_0x29c915['body'][_0x1a64('0x2d')]};var _0x54f570={'rejectUnauthorized':![],'method':_0x1a64('0x50'),'url':_0x1a64('0x51'),'headers':{'X-APIKEY':_0x4b94a0[_0x1a64('0x48')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x29c915[_0x1a64('0x39')][_0x1a64('0x4e')]],'buttons':null,'topic':_0x19b7a9[_0x1a64('0x4a')],'note':_[_0x1a64('0x52')](_0x19b7a9[_0x1a64('0x4b')])?null:getMustacheRender(_0x19b7a9['vidaooNote'],_0x17fa55),'metadata':null},'redirect':_0x1a64('0x53'),'json':!![]};try{if(!_[_0x1a64('0x52')](_0x19b7a9[_0x1a64('0x4c')])){var _0x1aa14e=getMustacheRender(_0x19b7a9[_0x1a64('0x4c')],_0x17fa55);var _0x565e78=JSON[_0x1a64('0x54')](_0x1aa14e);_0x54f570[_0x1a64('0x2b')][_0x1a64('0x55')]=_0x565e78;}}catch(_0x319363){throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x54f570);}else{throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x1a64('0x13')](function(_0x581434){_0x530d47=_0x581434;if(_0x530d47['id']){var _0x665aae={'body':_0x530d47[_0x1a64('0x58')],'ChatWebsiteId':_0x19b7a9['id'],'ChatInteractionId':_0x3e0a5c['id'],'direction':'out','UserId':_0x29c915[_0x1a64('0x39')]['id']};return db[_0x1a64('0x59')][_0x1a64('0x43')](_0x665aae,{});}else{throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1a64('0x13')](function(){return _0x3e0a5c[_0x1a64('0x5a')]({'vidaooSessionId':_0x530d47['id']});})[_0x1a64('0x13')](respondWithResult(_0x3c62ef,null))[_0x1a64('0x1c')](handleError(_0x3c62ef,null));};exports[_0x1a64('0x5b')]=function(_0x5dd1f4,_0x24b291){if(_0x5dd1f4[_0x1a64('0x2b')]['id']){delete _0x5dd1f4[_0x1a64('0x2b')]['id'];}return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x5dd1f4[_0x1a64('0x3a')]['id']},'include':[{'model':db[_0x1a64('0x5c')],'as':_0x1a64('0x5d')}]})['then'](handleEntityNotFound(_0x24b291,null))[_0x1a64('0x13')](saveUpdates(_0x5dd1f4[_0x1a64('0x2b')],null))[_0x1a64('0x13')](respondWithResult(_0x24b291,null))[_0x1a64('0x1c')](handleError(_0x24b291,null));};exports[_0x1a64('0x5e')]=function(_0x3ecf23,_0x108da6){if(_0x3ecf23[_0x1a64('0x2b')]['id']){delete _0x3ecf23['body']['id'];}return db['ChatInteraction'][_0x1a64('0x42')]({'where':{'id':_0x3ecf23[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](function(_0x1be29f){if(!_0x1be29f){logger[_0x1a64('0x18')](_0x1a64('0x5f'),_0x1a64('0x5e'),0x194,_0x1a64('0x60'));_0x108da6[_0x1a64('0x1d')](0x194);}else{if(_0x1be29f[_0x1a64('0x61')]){throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))](_0x1a64('0x62'));}}return _0x1be29f;})['then'](function(_0x5e0627){if(_0x5e0627){return _0x5e0627['update']({'closed':_0x3ecf23[_0x1a64('0x2b')][_0x1a64('0x63')],'disposition':_0x3ecf23['body']['disposition']})['then'](function(_0x191c21){return _0x191c21;});}})[_0x1a64('0x13')](function(){return respondWithRpcPromise('AbandonInteraction',_0x1a64('0x5e'),_0x3ecf23['body'],client9004);})[_0x1a64('0x13')](respondWithResult(_0x108da6,null))[_0x1a64('0x1c')](handleError(_0x108da6,null));};exports[_0x1a64('0x64')]=function(_0x46c07b,_0x2c63bf){_0x46c07b[_0x1a64('0x2b')][_0x1a64('0x27')]=_0x46c07b[_0x1a64('0x65')][_0x1a64('0x66')];_0x46c07b['body'][_0x1a64('0x67')]=_0x46c07b[_0x1a64('0x65')][_0x1a64('0x68')];_0x46c07b[_0x1a64('0x2b')]['type']=_0x46c07b[_0x1a64('0x65')][_0x1a64('0x69')];return db[_0x1a64('0x6a')][_0x1a64('0x43')](_0x46c07b['body'])[_0x1a64('0x13')](respondWithResult(_0x2c63bf,0xc9))[_0x1a64('0x1c')](handleError(_0x2c63bf,null));};exports[_0x1a64('0x6b')]=function(_0x4e1d73,_0x2f3338){return db[_0x1a64('0x30')][_0x1a64('0x46')]({'where':{'id':_0x4e1d73['params']['id']},'raw':!![]})[_0x1a64('0x13')](handleEntityNotFound(_0x2f3338,null))['then'](function(_0xba9f42){if(_0xba9f42){if(_0xba9f42[_0x1a64('0x63')]){return _0x2f3338[_0x1a64('0x1f')](0x193)[_0x1a64('0x6c')]({'status':0x193,'message':_0x1a64('0x6d')});}return db['Attachment'][_0x1a64('0x46')]({'where':{'id':_0x4e1d73['query'][_0x1a64('0x6e')]},'raw':!![]})[_0x1a64('0x13')](handleEntityNotFound(_0x2f3338,null));}})['then'](function(_0x1a7539){if(_0x1a7539){var _0x4d895b=_0x1a7539['ChatOfflineMessageId']!==null;var _0x6c8f4d=path[_0x1a64('0x6f')](config[_0x1a64('0x70')],_0x1a64('0x71'));if(_0x4d895b){_0x6c8f4d=path['join'](_0x6c8f4d,_0x1a64('0x72'));}var _0x4edd79=path['join'](_0x6c8f4d,_0x1a7539[_0x1a64('0x67')]);return _0x2f3338['download'](_0x4edd79);}})['catch'](handleError(_0x2f3338,null));};exports['close']=function(_0x14ce35,_0x466e70){var _0x499857=null;var _0x2ed772=null;var _0x359d57=null;if(_0x14ce35['body']['id']){delete _0x14ce35[_0x1a64('0x2b')]['id'];}if(_0x14ce35[_0x1a64('0x2b')][_0x1a64('0x73')]){_0x359d57=path[_0x1a64('0x6f')](config[_0x1a64('0x70')],'server/files/chat/upload/',util[_0x1a64('0x74')](_0x1a64('0x75'),Date[_0x1a64('0x76')]()));_0x14ce35[_0x1a64('0x2b')]['pathTranscript']=_0x359d57;}return db['ChatInteraction'][_0x1a64('0x42')]({'where':{'id':_0x14ce35['params']['id']},'include':[{'model':db[_0x1a64('0x59')],'as':'Messages','include':[{'model':db[_0x1a64('0x77')],'as':_0x1a64('0x77')}]}]})[_0x1a64('0x13')](handleEntityNotFound(_0x466e70,null))[_0x1a64('0x13')](saveUpdates(_0x14ce35[_0x1a64('0x2b')],null))[_0x1a64('0x13')](function(_0xda163e){if(_0xda163e){_0x499857=_0xda163e;return db[_0x1a64('0x78')]['find']({'where':{'id':_0x499857[_0x1a64('0x47')]}});}})[_0x1a64('0x13')](function(_0xa24c0a){if(_0xa24c0a){_0x2ed772=_0xa24c0a;return db[_0x1a64('0x5c')]['find']({'where':{'id':_0x499857[_0x1a64('0x79')]}});}})[_0x1a64('0x13')](function(_0x2176c7){if(_0x2176c7){if(_0x359d57){var _0x3cfb92=null;for(var _0x3308e1=0x1;_0x3308e1<_0x499857[_0x1a64('0x7a')][_0x1a64('0x7b')];++_0x3308e1){_0x3cfb92=_0x499857['Messages'][_0x3308e1];var _0x2fea2e=_0x3cfb92['UserId']?util[_0x1a64('0x74')](_0x1a64('0x7c'),_0x2ed772[_0x1a64('0x7d')],_0x3cfb92[_0x1a64('0x61')]):'System';var _0x557867=_0x14ce35[_0x1a64('0x2b')][_0x1a64('0x7e')]||util['format'](_0x1a64('0x7c'),_0x1a64('0x7f'),_0x3cfb92[_0x1a64('0x79')]);switch(_0x2ed772[_0x1a64('0x80')]){case _0x1a64('0x81'):_0x2fea2e=_0x3cfb92['UserId']?util['format'](_0x1a64('0x7c'),_0x2ed772['agentAlias'],_0x3cfb92['UserId']):_0x1a64('0x82');break;case'agent_alias':_0x2fea2e=_0x3cfb92['UserId']?_0x3cfb92[_0x1a64('0x77')][_0x1a64('0x83')]||_0x3cfb92[_0x1a64('0x77')][_0x1a64('0x4d')]:_0x1a64('0x82');break;case'agent_fullname':_0x2fea2e=_0x3cfb92[_0x1a64('0x61')]?_0x3cfb92[_0x1a64('0x77')][_0x1a64('0x4d')]:_0x1a64('0x82');break;default:_0x2fea2e=_0x3cfb92['UserId']?util[_0x1a64('0x74')](_0x1a64('0x7c'),_0x2ed772[_0x1a64('0x7d')],_0x3cfb92[_0x1a64('0x61')]):_0x1a64('0x82');}var _0xd884a1=util[_0x1a64('0x74')](_0x1a64('0x84'),moment(_0x3cfb92[_0x1a64('0x85')])[_0x1a64('0x74')](_0x1a64('0x86')),_0x3cfb92['direction']==='in'?_0x557867:_0x2fea2e,_0x3cfb92['body']);if(!_0x3cfb92[_0x1a64('0x87')]){fs[_0x1a64('0x88')](_0x359d57,_0xd884a1);}}return db[_0x1a64('0x89')][_0x1a64('0x46')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1a64('0x8a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x1a64('0x13')](function(_0x4aa540){if(!_0x4aa540||!_0x4aa540[_0x1a64('0x8a')]||!_0x14ce35[_0x1a64('0x2b')])return _0x499857;var _0xad1595=_0x4aa540[_0x1a64('0x8b')]();return respondWithRpcPromise('SendMail',_0x1a64('0x8c'),{'account':_0xad1595,'message':{'from':util[_0x1a64('0x74')](_0x1a64('0x8d'),_0x4aa540[_0x1a64('0x27')],_0x4aa540[_0x1a64('0x4e')]||_0x4aa540[_0x1a64('0x8a')][_0x1a64('0x39')]),'to':_0x14ce35[_0x1a64('0x2b')][_0x1a64('0x73')],'subject':_0x1a64('0x8e'),'text':util[_0x1a64('0x74')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x14ce35['body'][_0x1a64('0x73')]),'attachments':[{'path':_0x359d57}]}})[_0x1a64('0x13')](function(){return _0x499857;})[_0x1a64('0x1c')](function(_0x37a943){logger['error'](_0x37a943);});})['then'](respondWithStatusCode(_0x466e70,0xc8))[_0x1a64('0x1c')](handleError(_0x466e70,null));};exports[_0x1a64('0x8f')]=function(_0x171499,_0x8e9541){return db['ChatMessage'][_0x1a64('0x42')]({'where':{'id':_0x171499[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x8e9541,null))[_0x1a64('0x13')](function(_0x286b91){if(_0x286b91){return _0x286b91[_0x1a64('0x8f')](_0x171499['body'][_0x1a64('0x90')],_[_0x1a64('0x91')](_0x171499['body'],[_0x1a64('0x90'),'id'])||{});}})[_0x1a64('0x13')](respondWithResult(_0x8e9541,null))[_0x1a64('0x1c')](handleError(_0x8e9541,null));};exports[_0x1a64('0x92')]=function(_0x3ba777,_0x467fb1){var _0xd8bead={'raw':![],'where':{}};var _0x1e5f01={};var _0x590db6={'count':0x0,'rows':[]};return db[_0x1a64('0x30')]['findOne']({'where':{'id':_0x3ba777[_0x1a64('0x3a')]['id']}})['then'](handleEntityNotFound(_0x467fb1,null))[_0x1a64('0x13')](function(_0x47a817){if(_0x47a817){_0x1e5f01['model']=_[_0x1a64('0x3c')](db[_0x1a64('0x59')][_0x1a64('0x31')]);_0x1e5f01[_0x1a64('0x38')]=_[_0x1a64('0x3c')](_0x3ba777[_0x1a64('0x38')]);_0x1e5f01[_0x1a64('0x3d')]=_['intersection'](_0x1e5f01['model'],_0x1e5f01[_0x1a64('0x38')]);_0xd8bead[_0x1a64('0x3f')]=_[_0x1a64('0x3e')](_0x1e5f01[_0x1a64('0x3b')],qs[_0x1a64('0x40')](_0x3ba777[_0x1a64('0x38')]['fields']));_0xd8bead['attributes']=_0xd8bead[_0x1a64('0x3f')][_0x1a64('0x7b')]?_0xd8bead['attributes']:_0x1e5f01['model'];if(!_0x3ba777[_0x1a64('0x38')][_0x1a64('0x93')](_0x1a64('0x94'))){_0xd8bead[_0x1a64('0x20')]=qs[_0x1a64('0x20')](_0x3ba777['query'][_0x1a64('0x20')]);_0xd8bead['offset']=qs[_0x1a64('0x23')](_0x3ba777['query'][_0x1a64('0x23')]);}_0xd8bead[_0x1a64('0x95')]=qs[_0x1a64('0x96')](_0x3ba777['query'][_0x1a64('0x96')]);_0xd8bead['where']=qs['filters'](_[_0x1a64('0x97')](_0x3ba777[_0x1a64('0x38')],_0x1e5f01[_0x1a64('0x3d')]));_0xd8bead['where'][_0x1a64('0x98')]=_0x47a817['id'];if(_0x3ba777[_0x1a64('0x38')]['filter']){_0xd8bead[_0x1a64('0x99')]=_[_0x1a64('0x2a')](_0xd8bead[_0x1a64('0x99')],{'$or':_[_0x1a64('0x2f')](_0xd8bead[_0x1a64('0x3f')],function(_0x513e72){var _0x577af4={};_0x577af4[_0x513e72]={'$like':'%'+_0x3ba777[_0x1a64('0x38')][_0x1a64('0x9a')]+'%'};return _0x577af4;})});}if(_0x3ba777[_0x1a64('0x38')][_0x1a64('0x9b')]){var _0x294799=_0x3ba777[_0x1a64('0x38')]['$gte'][_0x1a64('0x9c')](',');var _0x404058={};_0x404058[_0x294799[0x0]]={'$gte':moment(_0x294799[0x1])[_0x1a64('0x74')](_0x1a64('0x9d'))};_0xd8bead[_0x1a64('0x99')]=_['merge'](_0xd8bead[_0x1a64('0x99')],_0x404058);}_0xd8bead=_['merge']({},_0xd8bead,_0x3ba777[_0x1a64('0x9e')]);return db['ChatMessage']['count']({'where':_0xd8bead[_0x1a64('0x99')]})[_0x1a64('0x13')](function(_0x4724b7){_0x590db6['count']=_0x4724b7;if(_0x3ba777[_0x1a64('0x38')][_0x1a64('0x9f')]){_0xd8bead[_0x1a64('0x41')]=[{'all':!![]}];}return db[_0x1a64('0x59')][_0x1a64('0x36')](_0xd8bead);})[_0x1a64('0x13')](function(_0x31f7f1){_0x590db6[_0x1a64('0xa0')]=_0x31f7f1;return _0x590db6;});}})[_0x1a64('0x13')](respondWithFilteredResult(_0x467fb1,_0xd8bead))[_0x1a64('0x1c')](handleError(_0x467fb1,null));};exports[_0x1a64('0xa1')]=function(_0x17f008,_0x5cf9fe){var _0x4266d4={'where':{}},_0x8cdf89={},_0x4c44ba={'count':0x0,'rows':[]};return db[_0x1a64('0x30')][_0x1a64('0x46')]({'where':{'id':_0x17f008['params']['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x5cf9fe,null))['then'](function(_0x2a7d11){if(_0x2a7d11){_0x8cdf89[_0x1a64('0x3b')]=_[_0x1a64('0x3c')](db[_0x1a64('0x59')][_0x1a64('0x31')]);_0x8cdf89[_0x1a64('0x38')]=_[_0x1a64('0x3c')](_0x17f008['query']);_0x8cdf89[_0x1a64('0x3d')]=_[_0x1a64('0x3e')](_0x8cdf89['model'],_0x8cdf89[_0x1a64('0x38')]);_0x4266d4['attributes']=_[_0x1a64('0x3e')](_0x8cdf89[_0x1a64('0x3b')],qs[_0x1a64('0x40')](_0x17f008[_0x1a64('0x38')][_0x1a64('0x40')]));_0x4266d4[_0x1a64('0x3f')]=_0x4266d4[_0x1a64('0x3f')][_0x1a64('0x7b')]?_0x4266d4['attributes']:_0x8cdf89[_0x1a64('0x3b')];if(!_0x17f008[_0x1a64('0x38')][_0x1a64('0x93')](_0x1a64('0x94'))){_0x4266d4[_0x1a64('0x20')]=qs[_0x1a64('0x20')](_0x17f008[_0x1a64('0x38')][_0x1a64('0x20')]);_0x4266d4[_0x1a64('0x23')]=qs[_0x1a64('0x23')](_0x17f008[_0x1a64('0x38')]['offset']);}_0x4266d4[_0x1a64('0x95')]=qs['sort'](_0x17f008['query']['sort']);_0x4266d4[_0x1a64('0x99')]=qs[_0x1a64('0x3d')](_[_0x1a64('0x97')](_0x17f008[_0x1a64('0x38')],_0x8cdf89['filters']));_0x4266d4[_0x1a64('0x99')][_0x1a64('0x98')]=_0x2a7d11['id'];if(_0x17f008[_0x1a64('0x38')]['filter']){_0x4266d4[_0x1a64('0x99')]=_[_0x1a64('0x2a')](_0x4266d4[_0x1a64('0x99')],{'$or':_[_0x1a64('0x2f')](_0x4266d4[_0x1a64('0x3f')],function(_0x33a008){var _0x3040ca={};_0x3040ca[_0x33a008]={'$like':'%'+_0x17f008[_0x1a64('0x38')][_0x1a64('0x9a')]+'%'};return _0x3040ca;})});}_0x4266d4['where'][_0x1a64('0x87')]=![];if(_0x17f008[_0x1a64('0x38')]['id']){_0x4266d4[_0x1a64('0x99')]['id']={'$gt':_0x17f008[_0x1a64('0x38')]['id']};}_0x4266d4=_[_0x1a64('0x2a')]({},_0x4266d4,_0x17f008[_0x1a64('0x9e')]);return db[_0x1a64('0x59')][_0x1a64('0x22')]({'where':_0x4266d4[_0x1a64('0x99')]})[_0x1a64('0x13')](function(_0x283bc5){_0x4c44ba[_0x1a64('0x22')]=_0x283bc5;_0x4266d4[_0x1a64('0x41')]=[];if(_0x17f008[_0x1a64('0x38')]['includeAgent']){_0x4266d4[_0x1a64('0x41')][_0x1a64('0xa2')]({'model':db[_0x1a64('0x77')],'as':_0x1a64('0x77'),'attributes':['id',_0x1a64('0x4d'),_0x1a64('0x83')]});}if(_0x17f008['query'][_0x1a64('0x9f')]){_0x4266d4[_0x1a64('0x41')]=[{'all':!![]}];}return db[_0x1a64('0x59')]['findAll'](_0x4266d4);})['then'](function(_0x3be321){_0x4c44ba[_0x1a64('0xa0')]=_0x3be321;return _0x4c44ba;});}})[_0x1a64('0x13')](respondWithFilteredResult(_0x5cf9fe,_0x4266d4))['catch'](handleError(_0x5cf9fe,null));};exports[_0x1a64('0xa3')]=function(_0x4bf208,_0x54ecd5){return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x4bf208[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x54ecd5,null))['then'](function(_0x17c76d){if(_0x17c76d){return _0x17c76d[_0x1a64('0xa4')](_0x4bf208['body'][_0x1a64('0x90')],_['omit'](_0x4bf208[_0x1a64('0x2b')],[_0x1a64('0x90'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x1a64('0x27'),_0x1a64('0xa5')],'where':{'id':_0x4bf208['body']['ids']}});})[_0x1a64('0x13')](function(_0x3d6e4f){socket[_0x1a64('0xa6')](_0x1a64('0xa7'),{'id':Number(_0x4bf208[_0x1a64('0x3a')]['id']),'tags':_0x3d6e4f||[]});return{'id':Number(_0x4bf208[_0x1a64('0x3a')]['id']),'tags':_0x3d6e4f||[]};});}})['then'](respondWithResult(_0x54ecd5,null))[_0x1a64('0x1c')](handleError(_0x54ecd5,null));};exports[_0x1a64('0xa8')]=function(_0xe59e81,_0x4873b5){return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0xe59e81['params']['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x4873b5,null))[_0x1a64('0x13')](function(_0x54f1c6){if(_0x54f1c6){return _0x54f1c6['removeTags'](_0xe59e81[_0x1a64('0x38')][_0x1a64('0x90')]);}})[_0x1a64('0x13')](respondWithStatusCode(_0x4873b5,null))[_0x1a64('0x1c')](handleError(_0x4873b5,null));};exports[_0x1a64('0xa9')]=function(_0x3f30fa,_0x38aa49){var _0x5aa2b0=moment()['unix']()[_0x1a64('0xaa')]();var _0x4927cf=path[_0x1a64('0x6f')](config[_0x1a64('0x70')],_0x1a64('0xab'),_0x1a64('0xac'),_0x1a64('0xad'));var _0x5b88fe=path['join'](config[_0x1a64('0x70')],_0x1a64('0xab'),_0x1a64('0xac'),_0x1a64('0xae'));var _0x2fa326=path[_0x1a64('0x6f')](_0x4927cf,_0x5aa2b0);var _0x54de0d=util['format'](_0x1a64('0xaf'),_0x3f30fa[_0x1a64('0x3a')]['id'],_0x5aa2b0);var _0x366745=path[_0x1a64('0x6f')](_0x4927cf,_0x54de0d);var _0x5c1706=[];_0x5c1706['push']({'model':db[_0x1a64('0x77')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5c1706[_0x1a64('0xa2')]({'model':db[_0x1a64('0x5c')],'as':_0x1a64('0x5d'),'attributes':['id',_0x1a64('0xb0'),'lastName'],'raw':!![]});if(_0x3f30fa['query']['attachments']){_0x5c1706[_0x1a64('0xa2')]({'model':db['Attachment'],'as':_0x1a64('0x6a'),'raw':!![]});}var _0x368a01=[{'model':db['ChatMessage'],'as':_0x1a64('0x7a'),'attributes':['id',_0x1a64('0x2b'),_0x1a64('0x85'),_0x1a64('0xb1'),_0x1a64('0x87'),_0x1a64('0xb2')],'include':_0x5c1706}];_0x368a01[_0x1a64('0xa2')]({'model':db[_0x1a64('0x78')],'as':_0x1a64('0xb3'),'attributes':['id',_0x1a64('0x27')]});_0x368a01[_0x1a64('0xa2')]({'model':db[_0x1a64('0x77')],'as':_0x1a64('0xb4'),'attributes':['id','fullname']});return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x3f30fa['params']['id']},'include':_0x368a01})[_0x1a64('0x13')](handleEntityNotFound(_0x38aa49,null))[_0x1a64('0x13')](function(_0x5d4f34){if(_0x5d4f34){var _0x20a865=_0x5d4f34[_0x1a64('0xb5')]({'plain':!![]});fs[_0x1a64('0xb6')](_0x2fa326);var _0xea5e27={'channel':'Chat','account':_0x20a865[_0x1a64('0xb3')][_0x1a64('0x27')],'agent':_0x20a865[_0x1a64('0xb4')]?_0x20a865['Owner'][_0x1a64('0x4d')]:_0x1a64('0xb7'),'createdAt':moment(_0x20a865[_0x1a64('0x85')])[_0x1a64('0x74')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x20a865[_0x1a64('0x63')]?moment(_0x20a865[_0x1a64('0xb8')])[_0x1a64('0x74')](_0x1a64('0x9d'))[_0x1a64('0xaa')]():'','disposition':_0x20a865[_0x1a64('0xb9')],'chatInfo':{'browser':_0x20a865[_0x1a64('0xba')],'os':_0x20a865[_0x1a64('0xbb')],'referer':_0x20a865[_0x1a64('0xbc')],'customerIp':_0x20a865[_0x1a64('0xbd')],'customerPort':_0x20a865[_0x1a64('0xbe')]?_0x20a865[_0x1a64('0xbe')]:_0x1a64('0xb7')},'messages':_(_0x20a865[_0x1a64('0x7a')])['tail']()[_0x1a64('0x9a')]({'secret':![]})[_0x1a64('0x2f')](function(_0x1048d4){if(_0x1048d4[_0x1a64('0x6a')]){var _0x449543=path[_0x1a64('0x6f')](_0x5b88fe,_0x1048d4['Attachment'][_0x1a64('0x67')]);if(fs[_0x1a64('0xbf')](_0x449543)){fs['createReadStream'](_0x449543)[_0x1a64('0xc0')](fs[_0x1a64('0xc1')](path[_0x1a64('0x6f')](_0x2fa326,_0x1048d4['Attachment'][_0x1a64('0x67')])));}}return{'date':moment(_0x1048d4[_0x1a64('0x85')])['format'](_0x1a64('0x9d'))[_0x1a64('0xaa')](),'sender':_0x1048d4['direction']===_0x1a64('0xc2')?_0x1048d4[_0x1a64('0x77')]?_0x1048d4[_0x1a64('0x77')][_0x1a64('0x4d')]:_0x1a64('0x82'):_0x1048d4[_0x1a64('0x5d')]['firstName']+(_0x1048d4['Contact'][_0x1a64('0xc3')]?'\x20'+_0x1048d4[_0x1a64('0x5d')][_0x1a64('0xc3')]:''),'body':_0x1048d4[_0x1a64('0x6a')]?_0x1048d4['Attachment'][_0x1a64('0x67')]:_0x1048d4[_0x1a64('0x2b')],'direction':_0x1048d4['direction']===_0x1a64('0xc2')?'A':'C','secret':_0x1048d4['secret'],'read':_0x1048d4['read'],'attachment':_0x1048d4[_0x1a64('0x6a')]};})[_0x1a64('0xc4')]()};return ejs[_0x1a64('0xc5')](path[_0x1a64('0x6f')](config[_0x1a64('0x70')],'server',_0x1a64('0xc6'),_0x1a64('0xc7')),{'interaction':_0xea5e27})['then'](function(_0x1c6318){var _0x52f59e=path[_0x1a64('0x6f')](_0x2fa326,'transcript-'+_0x20a865['id']+'-'+_0x5aa2b0+_0x1a64('0xc8'));var _0x52a754={'path':_0x52f59e,'channel':_0x1a64('0xc9'),'interactionId':_0x20a865['id']};return pdf[_0x1a64('0xca')](_0x1c6318,_0x52a754);})['then'](function(){return new Promise(function(_0x19ee42,_0x456154){zipdir(_0x2fa326,{'saveTo':_0x366745},function(_0x481f6c,_0x5b5923){if(_0x481f6c)return _0x456154(_0x481f6c);return _0x19ee42(_0x5b5923);});})[_0x1a64('0x13')](function(){return new BPromise(function(_0x4f3340,_0x122bc8){rimraf(_0x2fa326,function(_0x803957){if(_0x803957)_0x122bc8(_0x803957);return _0x4f3340();});});})[_0x1a64('0x13')](function(){return _0x38aa49[_0x1a64('0xa9')](_0x366745,_0x54de0d,function(_0x2b6aff){if(_0x2b6aff){logger[_0x1a64('0x18')]('err',_0x2b6aff);}else{fs[_0x1a64('0xcb')](_0x366745);}});});});}else{return _0x38aa49[_0x1a64('0x1d')](0xc8);}})[_0x1a64('0x1c')](handleError(_0x38aa49,null));};
\ No newline at end of file
+var _0x28ba=['Owner','get','mkdirSync','Account','N.A.','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','mustache','util','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','destroy','stack','render','merge','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','chat','query','user','show','params','keys','model','attributes','fields','length','includeAll','include','options','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','name','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','create','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','User','ContactId','format','%s%d','UserId','System','customer','Visitor','agentIdentifier','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','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','ids','omit','getMessages','intersection','hasOwnProperty','nolimit','order','sort','where','filters','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','fullname','setTags','spread','emit','chatInteractionTags:save','removeTags','toString','files','server','attachments','transcript-%d-%s.zip','firstName','push','read'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x28ba,0x1be));var _0xa28b=function(_0x291a2d,_0x56ce92){_0x291a2d=_0x291a2d-0x0;var _0x4a660a=_0x28ba[_0x291a2d];return _0x4a660a;};'use strict';var rimraf=require(_0xa28b('0x0'));var zipdir=require(_0xa28b('0x1'));var rp=require(_0xa28b('0x2'));var moment=require(_0xa28b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa28b('0x4'));var util=require(_0xa28b('0x5'));var path=require('path');var ejs=require(_0xa28b('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa28b('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xa28b('0x8'));var pdf=require(_0xa28b('0x9'));var logger=require(_0xa28b('0xa'))(_0xa28b('0xb'));var config=require(_0xa28b('0xc'));var db=require(_0xa28b('0xd'))['db'];config[_0xa28b('0xe')]=_[_0xa28b('0xf')](config['redis'],{'host':_0xa28b('0x10'),'port':0x18eb});var socket=require(_0xa28b('0x11'))(new Redis(config[_0xa28b('0xe')]));require(_0xa28b('0x12'))[_0xa28b('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa28b('0x14')][_0xa28b('0x15')]({'port':0x232b});var client9004=jayson[_0xa28b('0x14')][_0xa28b('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x14463a,_0xf0d998,_0x5375ef,_0xb392d1){return new BPromise(function(_0x331a09,_0x5b1130){var _0x3887e6=_0xb392d1||client;return _0x3887e6[_0xa28b('0x16')](_0x14463a,_0x5375ef)[_0xa28b('0x17')](function(_0x36f834){logger[_0xa28b('0x18')](_0xa28b('0x19'),_0xf0d998,_0xa28b('0x1a'));logger[_0xa28b('0x1b')](_0xa28b('0x1c'),_0xf0d998,_0xa28b('0x1a'),JSON[_0xa28b('0x1d')](_0x36f834));if(_0x36f834[_0xa28b('0x1e')]){if(_0x36f834['error'][_0xa28b('0x1f')]===0x1f4){logger['error'](_0xa28b('0x19'),_0xf0d998,_0x36f834[_0xa28b('0x1e')][_0xa28b('0x20')]);return _0x5b1130(_0x36f834[_0xa28b('0x1e')][_0xa28b('0x20')]);}logger[_0xa28b('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0xf0d998,_0x36f834[_0xa28b('0x1e')][_0xa28b('0x20')]);return _0x331a09(_0x36f834['error'][_0xa28b('0x20')]);}else{logger[_0xa28b('0x18')]('ChatInteraction,\x20%s,\x20%s',_0xf0d998,'request\x20sent');_0x331a09(_0x36f834[_0xa28b('0x21')][_0xa28b('0x20')]);}})[_0xa28b('0x22')](function(_0x21596a){logger[_0xa28b('0x1e')](_0xa28b('0x19'),_0xf0d998,_0x21596a);_0x5b1130(_0x21596a);});});}function respondWithStatusCode(_0x2b0f64,_0x381974){_0x381974=_0x381974||0xcc;return function(_0x2cc6ee){if(_0x2cc6ee){return _0x2b0f64[_0xa28b('0x23')](_0x381974);}return _0x2b0f64[_0xa28b('0x24')](_0x381974)[_0xa28b('0x25')]();};}function respondWithResult(_0x3f56e4,_0x4f2012){_0x4f2012=_0x4f2012||0xc8;return function(_0x504122){if(_0x504122){return _0x3f56e4[_0xa28b('0x24')](_0x4f2012)[_0xa28b('0x26')](_0x504122);}};}function respondWithFilteredResult(_0x2fd971,_0x264070){return function(_0x501c4b){if(_0x501c4b){var _0x411f0f=typeof _0x264070['offset']===_0xa28b('0x27')&&typeof _0x264070[_0xa28b('0x28')]==='undefined';var _0x297f10=_0x501c4b[_0xa28b('0x29')];var _0x3cd9f4=_0x411f0f?0x0:_0x264070[_0xa28b('0x2a')];var _0xcb72d4=_0x411f0f?_0x501c4b['count']:_0x264070['offset']+_0x264070['limit'];var _0x25aebd;if(_0xcb72d4>=_0x297f10){_0xcb72d4=_0x297f10;_0x25aebd=0xc8;}else{_0x25aebd=0xce;}_0x2fd971['status'](_0x25aebd);return _0x2fd971['set'](_0xa28b('0x2b'),_0x3cd9f4+'-'+_0xcb72d4+'/'+_0x297f10)[_0xa28b('0x26')](_0x501c4b);}return null;};}function saveUpdates(_0x4599e7){return function(_0x10f0a9){if(_0x10f0a9){return _0x10f0a9[_0xa28b('0x2c')](_0x4599e7)[_0xa28b('0x17')](function(_0x2ffb8a){return _0x2ffb8a;});}return null;};}function removeEntity(_0x4b8974){return function(_0x565f24){if(_0x565f24){return _0x565f24[_0xa28b('0x2d')]()[_0xa28b('0x17')](function(){_0x4b8974[_0xa28b('0x24')](0xcc)[_0xa28b('0x25')]();});}};}function handleEntityNotFound(_0x170d65){return function(_0x2e3c67){if(!_0x2e3c67){_0x170d65['sendStatus'](0x194);}return _0x2e3c67;};}function handleError(_0xcee7d4,_0x32ce5f){_0x32ce5f=_0x32ce5f||0x1f4;return function(_0x1f52e1){logger[_0xa28b('0x1e')](_0x1f52e1[_0xa28b('0x2e')]);if(_0x1f52e1['name']){delete _0x1f52e1['name'];}_0xcee7d4[_0xa28b('0x24')](_0x32ce5f)['send'](_0x1f52e1);};}function getMustacheRender(_0x11943b,_0x353337){return Mustache[_0xa28b('0x2f')](_0x11943b,_[_0xa28b('0x30')](_0x353337[_0xa28b('0x31')],{'contact':_0x353337[_0xa28b('0x32')],'message':_0x353337[_0xa28b('0x20')],'agent':_0x353337[_0xa28b('0x33')],'interaction':_0x353337[_0xa28b('0x34')],'account':_0x353337[_0xa28b('0x35')]}))||'';}exports['index']=function(_0x227722,_0x31f43f){var _0x4079c8={};var _0x3ca4e0=_[_0xa28b('0x36')](db[_0xa28b('0x37')][_0xa28b('0x38')],function(_0x5e3e74){return{'name':_0x5e3e74[_0xa28b('0x39')],'type':_0x5e3e74[_0xa28b('0x3a')]['key']};});_0x4079c8=qs[_0xa28b('0x3b')](_0x3ca4e0,_0x227722);return interaction[_0xa28b('0x3c')](_0xa28b('0x3d'),_0x227722[_0xa28b('0x3e')],_0x227722[_0xa28b('0x3f')],_0x4079c8,_0x3ca4e0)['then'](respondWithFilteredResult(_0x31f43f,_0x4079c8))[_0xa28b('0x22')](handleError(_0x31f43f,null));};exports[_0xa28b('0x40')]=function(_0x981495,_0x291ab0){var _0x9a8e8={'raw':![],'where':{'id':_0x981495[_0xa28b('0x41')]['id']}},_0x6279f1={};_0x6279f1['model']=_['keys'](db['ChatInteraction']['rawAttributes']);_0x6279f1[_0xa28b('0x3e')]=_[_0xa28b('0x42')](_0x981495[_0xa28b('0x3e')]);_0x6279f1['filters']=_['intersection'](_0x6279f1[_0xa28b('0x43')],_0x6279f1[_0xa28b('0x3e')]);_0x9a8e8[_0xa28b('0x44')]=_['intersection'](_0x6279f1[_0xa28b('0x43')],qs[_0xa28b('0x45')](_0x981495[_0xa28b('0x3e')]['fields']));_0x9a8e8['attributes']=_0x9a8e8[_0xa28b('0x44')][_0xa28b('0x46')]?_0x9a8e8[_0xa28b('0x44')]:_0x6279f1[_0xa28b('0x43')];if(_0x981495[_0xa28b('0x3e')][_0xa28b('0x47')]){_0x9a8e8[_0xa28b('0x48')]=[{'all':!![]}];}_0x9a8e8=_[_0xa28b('0x30')]({},_0x9a8e8,_0x981495[_0xa28b('0x49')]);return db['ChatInteraction'][_0xa28b('0x4a')](_0x9a8e8)[_0xa28b('0x17')](handleEntityNotFound(_0x291ab0,null))[_0xa28b('0x17')](respondWithResult(_0x291ab0,null))['catch'](handleError(_0x291ab0,null));};exports['create']=function(_0x21026b,_0x18ac45){return db[_0xa28b('0x37')]['create'](_0x21026b['body'],{})[_0xa28b('0x17')](respondWithResult(_0x18ac45,0xc9))[_0xa28b('0x22')](handleError(_0x18ac45,null));};exports['update']=function(_0x1bcdee,_0x3c349f){if(_0x1bcdee['body']['id']){delete _0x1bcdee[_0xa28b('0x31')]['id'];}return db[_0xa28b('0x37')][_0xa28b('0x4a')]({'where':{'id':_0x1bcdee[_0xa28b('0x41')]['id']}})[_0xa28b('0x17')](handleEntityNotFound(_0x3c349f,null))[_0xa28b('0x17')](saveUpdates(_0x1bcdee[_0xa28b('0x31')],null))[_0xa28b('0x17')](respondWithResult(_0x3c349f,null))[_0xa28b('0x22')](handleError(_0x3c349f,null));};exports[_0xa28b('0x2d')]=function(_0x2a702c,_0x4ac6da){return db['ChatInteraction']['find']({'where':{'id':_0x2a702c[_0xa28b('0x41')]['id']}})[_0xa28b('0x17')](handleEntityNotFound(_0x4ac6da,null))[_0xa28b('0x17')](removeEntity(_0x4ac6da,null))[_0xa28b('0x22')](handleError(_0x4ac6da,null));};exports[_0xa28b('0x4b')]=function(_0x1e7ec5,_0x192928){return db['ChatInteraction'][_0xa28b('0x4b')]()[_0xa28b('0x17')](respondWithResult(_0x192928,null))[_0xa28b('0x22')](handleError(_0x192928,null));};exports[_0xa28b('0x4c')]=function(_0x965fd2,_0x32e82e){var _0x193e98=_0x965fd2[_0xa28b('0x41')]['id'];var _0x310f5f;var _0x16f7b4;var _0x1c5b04;return db[_0xa28b('0x37')][_0xa28b('0x4d')]({'where':{'id':_0x193e98}})['then'](function(_0x3313fd){_0x310f5f=_0x3313fd;return db[_0xa28b('0x4e')][_0xa28b('0x4d')]({'where':{'id':_0x3313fd[_0xa28b('0x4f')]},'attributes':['id',_0xa28b('0x50'),_0xa28b('0x51'),_0xa28b('0x52'),_0xa28b('0x53'),_0xa28b('0x54')],'raw':!![]});})['then'](function(_0x3197ee){if(_0x3197ee&&_0x3197ee['vidaooApiKey']&&_0x3197ee[_0xa28b('0x51')]){_0x16f7b4=_0x3197ee;var _0x29f256={'interaction':{'id':_0x193e98},'agent':{'id':_0x965fd2['user']['id'],'name':_0x965fd2[_0xa28b('0x3f')][_0xa28b('0x55')],'fullname':_0x965fd2[_0xa28b('0x3f')]['fullname'],'email':_0x965fd2[_0xa28b('0x3f')]['email']},'contact':_0x965fd2[_0xa28b('0x31')][_0xa28b('0x32')],'account':_0x965fd2['body'][_0xa28b('0x35')]};var _0x325db8={'rejectUnauthorized':![],'method':'POST','url':_0xa28b('0x56'),'headers':{'X-APIKEY':_0x3197ee[_0xa28b('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x965fd2[_0xa28b('0x3f')][_0xa28b('0x57')]],'buttons':null,'topic':_0x16f7b4['vidaooTopic'],'note':_[_0xa28b('0x58')](_0x16f7b4[_0xa28b('0x53')])?null:getMustacheRender(_0x16f7b4[_0xa28b('0x53')],_0x29f256),'metadata':null},'redirect':_0xa28b('0x59'),'json':!![]};try{if(!_[_0xa28b('0x58')](_0x16f7b4[_0xa28b('0x54')])){var _0x2a5983=getMustacheRender(_0x16f7b4[_0xa28b('0x54')],_0x29f256);var _0x503797=JSON[_0xa28b('0x5a')](_0x2a5983);_0x325db8['body'][_0xa28b('0x5b')]=_0x503797;}}catch(_0x2d05b4){throw new db[(_0xa28b('0x5c'))]['ValidationError'](_0xa28b('0x5d'));}return rp(_0x325db8);}else{throw new db[(_0xa28b('0x5c'))][(_0xa28b('0x5e'))](_0xa28b('0x5f'));}})['then'](function(_0x11c2c2){_0x1c5b04=_0x11c2c2;if(_0x1c5b04['id']){var _0x356acd={'body':_0x1c5b04['join_url'],'ChatWebsiteId':_0x16f7b4['id'],'ChatInteractionId':_0x310f5f['id'],'direction':_0xa28b('0x60'),'UserId':_0x965fd2['user']['id']};return db[_0xa28b('0x61')]['create'](_0x356acd,{});}else{throw new db['Sequelize'][(_0xa28b('0x5e'))](_0xa28b('0x62'));}})[_0xa28b('0x17')](function(){return _0x310f5f[_0xa28b('0x63')]({'vidaooSessionId':_0x1c5b04['id']});})[_0xa28b('0x17')](respondWithResult(_0x32e82e,null))[_0xa28b('0x22')](handleError(_0x32e82e,null));};exports[_0xa28b('0x64')]=function(_0x1d6e08,_0x5d29d1){if(_0x1d6e08['body']['id']){delete _0x1d6e08['body']['id'];}return db['ChatInteraction'][_0xa28b('0x4a')]({'where':{'id':_0x1d6e08['params']['id']},'include':[{'model':db[_0xa28b('0x65')],'as':_0xa28b('0x66')}]})[_0xa28b('0x17')](handleEntityNotFound(_0x5d29d1,null))[_0xa28b('0x17')](saveUpdates(_0x1d6e08[_0xa28b('0x31')],null))[_0xa28b('0x17')](respondWithResult(_0x5d29d1,null))['catch'](handleError(_0x5d29d1,null));};exports[_0xa28b('0x67')]=function(_0x28823b,_0x4f98e6){if(_0x28823b[_0xa28b('0x31')]['id']){delete _0x28823b[_0xa28b('0x31')]['id'];}return db[_0xa28b('0x37')]['find']({'where':{'id':_0x28823b[_0xa28b('0x41')]['id']}})[_0xa28b('0x17')](function(_0x725364){if(!_0x725364){logger[_0xa28b('0x1e')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xa28b('0x67'),0x194,_0xa28b('0x68'));_0x4f98e6[_0xa28b('0x23')](0x194);}else{if(_0x725364['UserId']){throw new db[(_0xa28b('0x5c'))][(_0xa28b('0x5e'))](_0xa28b('0x69'));}}return _0x725364;})[_0xa28b('0x17')](function(_0x45f99b){if(_0x45f99b){return _0x45f99b[_0xa28b('0x2c')]({'closed':_0x28823b[_0xa28b('0x31')][_0xa28b('0x6a')],'disposition':_0x28823b['body'][_0xa28b('0x6b')]})[_0xa28b('0x17')](function(_0x1c8fe6){return _0x1c8fe6;});}})[_0xa28b('0x17')](function(){return respondWithRpcPromise(_0xa28b('0x6c'),_0xa28b('0x67'),_0x28823b['body'],client9004);})['then'](respondWithResult(_0x4f98e6,null))['catch'](handleError(_0x4f98e6,null));};exports[_0xa28b('0x6d')]=function(_0x5764bf,_0x10b832){_0x5764bf[_0xa28b('0x31')][_0xa28b('0x55')]=_0x5764bf[_0xa28b('0x6e')][_0xa28b('0x6f')];_0x5764bf[_0xa28b('0x31')][_0xa28b('0x70')]=_0x5764bf[_0xa28b('0x6e')][_0xa28b('0x71')];_0x5764bf['body']['type']=_0x5764bf['file'][_0xa28b('0x72')];return db[_0xa28b('0x73')][_0xa28b('0x74')](_0x5764bf[_0xa28b('0x31')])[_0xa28b('0x17')](respondWithResult(_0x10b832,0xc9))[_0xa28b('0x22')](handleError(_0x10b832,null));};exports[_0xa28b('0x75')]=function(_0x160a84,_0x5765d9){return db['ChatInteraction'][_0xa28b('0x4d')]({'where':{'id':_0x160a84[_0xa28b('0x41')]['id']},'raw':!![]})[_0xa28b('0x17')](handleEntityNotFound(_0x5765d9,null))[_0xa28b('0x17')](function(_0x2e1f88){if(_0x2e1f88){if(_0x2e1f88[_0xa28b('0x6a')]){return _0x5765d9[_0xa28b('0x24')](0x193)[_0xa28b('0x26')]({'status':0x193,'message':_0xa28b('0x76')});}return db[_0xa28b('0x73')]['findOne']({'where':{'id':_0x160a84['query']['attachId']},'raw':!![]})[_0xa28b('0x17')](handleEntityNotFound(_0x5765d9,null));}})[_0xa28b('0x17')](function(_0xbd02e){if(_0xbd02e){var _0x3c3a5b=_0xbd02e[_0xa28b('0x77')]!==null;var _0x3c9c80=path['join'](config[_0xa28b('0x78')],_0xa28b('0x79'));if(_0x3c3a5b){_0x3c9c80=path[_0xa28b('0x7a')](_0x3c9c80,_0xa28b('0x7b'));}var _0x2ba7fb=path[_0xa28b('0x7a')](_0x3c9c80,_0xbd02e[_0xa28b('0x70')]);return _0x5765d9[_0xa28b('0x7c')](_0x2ba7fb);}})[_0xa28b('0x22')](handleError(_0x5765d9,null));};exports['close']=function(_0x309952,_0xccc5a){var _0x152a37=null;var _0x1cf021=null;var _0x15f6ec=null;if(_0x309952[_0xa28b('0x31')]['id']){delete _0x309952[_0xa28b('0x31')]['id'];}if(_0x309952[_0xa28b('0x31')][_0xa28b('0x7d')]){_0x15f6ec=path[_0xa28b('0x7a')](config['root'],_0xa28b('0x7e'),util['format'](_0xa28b('0x7f'),Date['now']()));_0x309952[_0xa28b('0x31')][_0xa28b('0x80')]=_0x15f6ec;}return db[_0xa28b('0x37')][_0xa28b('0x4a')]({'where':{'id':_0x309952['params']['id']},'include':[{'model':db[_0xa28b('0x61')],'as':_0xa28b('0x81'),'include':[{'model':db[_0xa28b('0x82')],'as':'User'}]}]})[_0xa28b('0x17')](handleEntityNotFound(_0xccc5a,null))[_0xa28b('0x17')](saveUpdates(_0x309952['body'],null))[_0xa28b('0x17')](function(_0x5aab41){if(_0x5aab41){_0x152a37=_0x5aab41;return db[_0xa28b('0x4e')][_0xa28b('0x4a')]({'where':{'id':_0x152a37[_0xa28b('0x4f')]}});}})['then'](function(_0x341689){if(_0x341689){_0x1cf021=_0x341689;return db[_0xa28b('0x65')][_0xa28b('0x4a')]({'where':{'id':_0x152a37[_0xa28b('0x83')]}});}})[_0xa28b('0x17')](function(_0x44531a){if(_0x44531a){if(_0x15f6ec){var _0x392317=null;for(var _0x12ea30=0x1;_0x12ea30<_0x152a37[_0xa28b('0x81')][_0xa28b('0x46')];++_0x12ea30){_0x392317=_0x152a37[_0xa28b('0x81')][_0x12ea30];var _0x44e315=_0x392317['UserId']?util[_0xa28b('0x84')](_0xa28b('0x85'),_0x1cf021['agentAlias'],_0x392317[_0xa28b('0x86')]):_0xa28b('0x87');var _0x4d9654=_0x309952[_0xa28b('0x31')][_0xa28b('0x88')]||util['format'](_0xa28b('0x85'),_0xa28b('0x89'),_0x392317['ContactId']);switch(_0x1cf021[_0xa28b('0x8a')]){case'website_alias':_0x44e315=_0x392317['UserId']?util['format']('%s%d',_0x1cf021[_0xa28b('0x8b')],_0x392317[_0xa28b('0x86')]):'System';break;case _0xa28b('0x8c'):_0x44e315=_0x392317['UserId']?_0x392317[_0xa28b('0x82')][_0xa28b('0x8d')]||_0x392317['User']['fullname']:'System';break;case _0xa28b('0x8e'):_0x44e315=_0x392317[_0xa28b('0x86')]?_0x392317['User']['fullname']:_0xa28b('0x87');break;default:_0x44e315=_0x392317['UserId']?util[_0xa28b('0x84')]('%s%d',_0x1cf021[_0xa28b('0x8b')],_0x392317['UserId']):_0xa28b('0x87');}var _0x18fc7f=util[_0xa28b('0x84')](_0xa28b('0x8f'),moment(_0x392317[_0xa28b('0x90')])[_0xa28b('0x84')]('MM/DD/YYYY\x20HH:mm:ss'),_0x392317[_0xa28b('0x91')]==='in'?_0x4d9654:_0x44e315,_0x392317['body']);if(!_0x392317[_0xa28b('0x92')]){fs[_0xa28b('0x93')](_0x15f6ec,_0x18fc7f);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xa28b('0x94')],'as':_0xa28b('0x95'),'raw':!![],'include':[{'model':db[_0xa28b('0x96')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xa28b('0x17')](function(_0x59ec0d){if(!_0x59ec0d||!_0x59ec0d['Smtp']||!_0x309952['body'])return _0x152a37;var _0x47ac25=_0x59ec0d[_0xa28b('0x97')]();return respondWithRpcPromise(_0xa28b('0x98'),_0xa28b('0x99'),{'account':_0x47ac25,'message':{'from':util[_0xa28b('0x84')](_0xa28b('0x9a'),_0x59ec0d[_0xa28b('0x55')],_0x59ec0d['email']||_0x59ec0d[_0xa28b('0x95')][_0xa28b('0x3f')]),'to':_0x309952[_0xa28b('0x31')][_0xa28b('0x7d')],'subject':_0xa28b('0x9b'),'text':util[_0xa28b('0x84')](_0xa28b('0x9c'),_0x309952[_0xa28b('0x31')][_0xa28b('0x7d')]),'attachments':[{'path':_0x15f6ec}]}})[_0xa28b('0x17')](function(){return _0x152a37;})[_0xa28b('0x22')](function(_0x197cc0){logger['error'](_0x197cc0);});})['then'](respondWithStatusCode(_0xccc5a,0xc8))[_0xa28b('0x22')](handleError(_0xccc5a,null));};exports[_0xa28b('0x9d')]=function(_0x4ab03d,_0x5245d0){return db['ChatMessage'][_0xa28b('0x4a')]({'where':{'id':_0x4ab03d[_0xa28b('0x41')]['id']}})[_0xa28b('0x17')](handleEntityNotFound(_0x5245d0,null))[_0xa28b('0x17')](function(_0x3b7060){if(_0x3b7060){return _0x3b7060[_0xa28b('0x9d')](_0x4ab03d['body'][_0xa28b('0x9e')],_[_0xa28b('0x9f')](_0x4ab03d[_0xa28b('0x31')],[_0xa28b('0x9e'),'id'])||{});}})[_0xa28b('0x17')](respondWithResult(_0x5245d0,null))[_0xa28b('0x22')](handleError(_0x5245d0,null));};exports[_0xa28b('0xa0')]=function(_0x471155,_0x4cad74){var _0x15c790={'raw':![],'where':{}};var _0x56b1d1={};var _0x513079={'count':0x0,'rows':[]};return db[_0xa28b('0x37')][_0xa28b('0x4d')]({'where':{'id':_0x471155[_0xa28b('0x41')]['id']}})[_0xa28b('0x17')](handleEntityNotFound(_0x4cad74,null))[_0xa28b('0x17')](function(_0x542f60){if(_0x542f60){_0x56b1d1[_0xa28b('0x43')]=_['keys'](db[_0xa28b('0x61')][_0xa28b('0x38')]);_0x56b1d1['query']=_[_0xa28b('0x42')](_0x471155[_0xa28b('0x3e')]);_0x56b1d1['filters']=_[_0xa28b('0xa1')](_0x56b1d1[_0xa28b('0x43')],_0x56b1d1['query']);_0x15c790['attributes']=_[_0xa28b('0xa1')](_0x56b1d1[_0xa28b('0x43')],qs['fields'](_0x471155['query'][_0xa28b('0x45')]));_0x15c790['attributes']=_0x15c790['attributes'][_0xa28b('0x46')]?_0x15c790[_0xa28b('0x44')]:_0x56b1d1['model'];if(!_0x471155[_0xa28b('0x3e')][_0xa28b('0xa2')](_0xa28b('0xa3'))){_0x15c790[_0xa28b('0x28')]=qs[_0xa28b('0x28')](_0x471155[_0xa28b('0x3e')][_0xa28b('0x28')]);_0x15c790['offset']=qs[_0xa28b('0x2a')](_0x471155[_0xa28b('0x3e')][_0xa28b('0x2a')]);}_0x15c790[_0xa28b('0xa4')]=qs[_0xa28b('0xa5')](_0x471155[_0xa28b('0x3e')][_0xa28b('0xa5')]);_0x15c790[_0xa28b('0xa6')]=qs[_0xa28b('0xa7')](_[_0xa28b('0xa8')](_0x471155['query'],_0x56b1d1[_0xa28b('0xa7')]));_0x15c790[_0xa28b('0xa6')][_0xa28b('0xa9')]=_0x542f60['id'];if(_0x471155[_0xa28b('0x3e')][_0xa28b('0xaa')]){_0x15c790[_0xa28b('0xa6')]=_[_0xa28b('0x30')](_0x15c790[_0xa28b('0xa6')],{'$or':_[_0xa28b('0x36')](_0x15c790['attributes'],function(_0x23de92){var _0x314bf6={};_0x314bf6[_0x23de92]={'$like':'%'+_0x471155[_0xa28b('0x3e')][_0xa28b('0xaa')]+'%'};return _0x314bf6;})});}if(_0x471155['query']['$gte']){var _0x46d7da=_0x471155[_0xa28b('0x3e')][_0xa28b('0xab')]['split'](',');var _0x2a7caf={};_0x2a7caf[_0x46d7da[0x0]]={'$gte':moment(_0x46d7da[0x1])[_0xa28b('0x84')](_0xa28b('0xac'))};_0x15c790[_0xa28b('0xa6')]=_[_0xa28b('0x30')](_0x15c790[_0xa28b('0xa6')],_0x2a7caf);}_0x15c790=_[_0xa28b('0x30')]({},_0x15c790,_0x471155[_0xa28b('0x49')]);return db[_0xa28b('0x61')]['count']({'where':_0x15c790[_0xa28b('0xa6')]})[_0xa28b('0x17')](function(_0xd8bb98){_0x513079[_0xa28b('0x29')]=_0xd8bb98;if(_0x471155['query']['includeAll']){_0x15c790[_0xa28b('0x48')]=[{'all':!![]}];}return db[_0xa28b('0x61')]['findAll'](_0x15c790);})['then'](function(_0x28b95c){_0x513079[_0xa28b('0xad')]=_0x28b95c;return _0x513079;});}})[_0xa28b('0x17')](respondWithFilteredResult(_0x4cad74,_0x15c790))[_0xa28b('0x22')](handleError(_0x4cad74,null));};exports[_0xa28b('0xae')]=function(_0x22f1f8,_0x5326b9){var _0x1361e6={'where':{}},_0x1d5640={},_0x368c1d={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa28b('0x4d')]({'where':{'id':_0x22f1f8[_0xa28b('0x41')]['id']}})['then'](handleEntityNotFound(_0x5326b9,null))['then'](function(_0x3d654d){if(_0x3d654d){_0x1d5640[_0xa28b('0x43')]=_[_0xa28b('0x42')](db['ChatMessage']['rawAttributes']);_0x1d5640[_0xa28b('0x3e')]=_[_0xa28b('0x42')](_0x22f1f8[_0xa28b('0x3e')]);_0x1d5640[_0xa28b('0xa7')]=_[_0xa28b('0xa1')](_0x1d5640[_0xa28b('0x43')],_0x1d5640[_0xa28b('0x3e')]);_0x1361e6['attributes']=_[_0xa28b('0xa1')](_0x1d5640['model'],qs['fields'](_0x22f1f8['query'][_0xa28b('0x45')]));_0x1361e6[_0xa28b('0x44')]=_0x1361e6[_0xa28b('0x44')][_0xa28b('0x46')]?_0x1361e6[_0xa28b('0x44')]:_0x1d5640[_0xa28b('0x43')];if(!_0x22f1f8['query'][_0xa28b('0xa2')]('nolimit')){_0x1361e6[_0xa28b('0x28')]=qs[_0xa28b('0x28')](_0x22f1f8[_0xa28b('0x3e')][_0xa28b('0x28')]);_0x1361e6[_0xa28b('0x2a')]=qs['offset'](_0x22f1f8[_0xa28b('0x3e')][_0xa28b('0x2a')]);}_0x1361e6[_0xa28b('0xa4')]=qs[_0xa28b('0xa5')](_0x22f1f8[_0xa28b('0x3e')][_0xa28b('0xa5')]);_0x1361e6[_0xa28b('0xa6')]=qs['filters'](_[_0xa28b('0xa8')](_0x22f1f8[_0xa28b('0x3e')],_0x1d5640['filters']));_0x1361e6[_0xa28b('0xa6')][_0xa28b('0xa9')]=_0x3d654d['id'];if(_0x22f1f8[_0xa28b('0x3e')][_0xa28b('0xaa')]){_0x1361e6[_0xa28b('0xa6')]=_['merge'](_0x1361e6[_0xa28b('0xa6')],{'$or':_['map'](_0x1361e6[_0xa28b('0x44')],function(_0x314c94){var _0x3f2f72={};_0x3f2f72[_0x314c94]={'$like':'%'+_0x22f1f8[_0xa28b('0x3e')][_0xa28b('0xaa')]+'%'};return _0x3f2f72;})});}_0x1361e6['where'][_0xa28b('0x92')]=![];if(_0x22f1f8[_0xa28b('0x3e')]['id']){_0x1361e6[_0xa28b('0xa6')]['id']={'$gt':_0x22f1f8[_0xa28b('0x3e')]['id']};}_0x1361e6=_[_0xa28b('0x30')]({},_0x1361e6,_0x22f1f8[_0xa28b('0x49')]);return db[_0xa28b('0x61')][_0xa28b('0x29')]({'where':_0x1361e6[_0xa28b('0xa6')]})['then'](function(_0x113837){_0x368c1d[_0xa28b('0x29')]=_0x113837;_0x1361e6[_0xa28b('0x48')]=[];if(_0x22f1f8[_0xa28b('0x3e')][_0xa28b('0xaf')]){_0x1361e6[_0xa28b('0x48')]['push']({'model':db[_0xa28b('0x82')],'as':_0xa28b('0x82'),'attributes':['id',_0xa28b('0xb0'),_0xa28b('0x8d')]});}if(_0x22f1f8[_0xa28b('0x3e')][_0xa28b('0x47')]){_0x1361e6[_0xa28b('0x48')]=[{'all':!![]}];}return db[_0xa28b('0x61')][_0xa28b('0x3c')](_0x1361e6);})['then'](function(_0x1a6284){_0x368c1d['rows']=_0x1a6284;return _0x368c1d;});}})[_0xa28b('0x17')](respondWithFilteredResult(_0x5326b9,_0x1361e6))['catch'](handleError(_0x5326b9,null));};exports['addTags']=function(_0x4f030d,_0x269f51){return db[_0xa28b('0x37')][_0xa28b('0x4a')]({'where':{'id':_0x4f030d[_0xa28b('0x41')]['id']}})[_0xa28b('0x17')](handleEntityNotFound(_0x269f51,null))[_0xa28b('0x17')](function(_0x31ad71){if(_0x31ad71){return _0x31ad71[_0xa28b('0xb1')](_0x4f030d[_0xa28b('0x31')][_0xa28b('0x9e')],_['omit'](_0x4f030d['body'],['ids','id'])||{})[_0xa28b('0xb2')](function(){return db['Tag'][_0xa28b('0x3c')]({'attributes':['id',_0xa28b('0x55'),'color'],'where':{'id':_0x4f030d[_0xa28b('0x31')]['ids']}});})['then'](function(_0x42b90e){socket[_0xa28b('0xb3')](_0xa28b('0xb4'),{'id':Number(_0x4f030d[_0xa28b('0x41')]['id']),'tags':_0x42b90e||[]});return{'id':Number(_0x4f030d[_0xa28b('0x41')]['id']),'tags':_0x42b90e||[]};});}})[_0xa28b('0x17')](respondWithResult(_0x269f51,null))[_0xa28b('0x22')](handleError(_0x269f51,null));};exports[_0xa28b('0xb5')]=function(_0xce3a98,_0xb5d817){return db[_0xa28b('0x37')][_0xa28b('0x4a')]({'where':{'id':_0xce3a98[_0xa28b('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5d817,null))[_0xa28b('0x17')](function(_0x40804b){if(_0x40804b){return _0x40804b[_0xa28b('0xb5')](_0xce3a98[_0xa28b('0x3e')][_0xa28b('0x9e')]);}})[_0xa28b('0x17')](respondWithStatusCode(_0xb5d817,null))[_0xa28b('0x22')](handleError(_0xb5d817,null));};exports[_0xa28b('0x7c')]=function(_0x442d2b,_0x27417a){var _0x41329c=moment()['unix']()[_0xa28b('0xb6')]();var _0x4fe5fd=path[_0xa28b('0x7a')](config[_0xa28b('0x78')],'server',_0xa28b('0xb7'),'tmp');var _0x1f2e9b=path['join'](config[_0xa28b('0x78')],_0xa28b('0xb8'),_0xa28b('0xb7'),_0xa28b('0xb9'));var _0x23e2b5=path['join'](_0x4fe5fd,_0x41329c);var _0x2b1ad9=util[_0xa28b('0x84')](_0xa28b('0xba'),_0x442d2b[_0xa28b('0x41')]['id'],_0x41329c);var _0x224365=path['join'](_0x4fe5fd,_0x2b1ad9);var _0x427cf2=[];_0x427cf2['push']({'model':db[_0xa28b('0x82')],'as':_0xa28b('0x82'),'attributes':['id','fullname'],'raw':!![]});_0x427cf2['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xa28b('0xbb'),'lastName'],'raw':!![]});if(_0x442d2b[_0xa28b('0x3e')][_0xa28b('0xb9')]){_0x427cf2[_0xa28b('0xbc')]({'model':db['Attachment'],'as':_0xa28b('0x73'),'raw':!![]});}var _0x3908a1=[{'model':db['ChatMessage'],'as':_0xa28b('0x81'),'attributes':['id',_0xa28b('0x31'),_0xa28b('0x90'),_0xa28b('0x91'),'secret',_0xa28b('0xbd')],'include':_0x427cf2}];_0x3908a1[_0xa28b('0xbc')]({'model':db[_0xa28b('0x4e')],'as':'Account','attributes':['id',_0xa28b('0x55')]});_0x3908a1[_0xa28b('0xbc')]({'model':db[_0xa28b('0x82')],'as':_0xa28b('0xbe'),'attributes':['id',_0xa28b('0xb0')]});return db[_0xa28b('0x37')]['find']({'where':{'id':_0x442d2b[_0xa28b('0x41')]['id']},'include':_0x3908a1})[_0xa28b('0x17')](handleEntityNotFound(_0x27417a,null))[_0xa28b('0x17')](function(_0x3be289){if(_0x3be289){var _0x328978=_0x3be289[_0xa28b('0xbf')]({'plain':!![]});fs[_0xa28b('0xc0')](_0x23e2b5);var _0x1eb219={'channel':'Chat','account':_0x328978[_0xa28b('0xc1')][_0xa28b('0x55')],'agent':_0x328978[_0xa28b('0xbe')]?_0x328978[_0xa28b('0xbe')][_0xa28b('0xb0')]:_0xa28b('0xc2'),'createdAt':moment(_0x328978[_0xa28b('0x90')])[_0xa28b('0x84')](_0xa28b('0xac'))['toString'](),'closedAt':_0x328978['closed']?moment(_0x328978['closedAt'])[_0xa28b('0x84')](_0xa28b('0xac'))[_0xa28b('0xb6')]():'','disposition':_0x328978[_0xa28b('0x6b')],'chatInfo':{'browser':_0x328978[_0xa28b('0xc3')],'os':_0x328978[_0xa28b('0xc4')],'referer':_0x328978[_0xa28b('0xc5')],'customerIp':_0x328978[_0xa28b('0xc6')],'customerPort':_0x328978['customerPort']?_0x328978[_0xa28b('0xc7')]:_0xa28b('0xc2')},'messages':_(_0x328978[_0xa28b('0x81')])[_0xa28b('0xc8')]()[_0xa28b('0xaa')]({'secret':![]})['map'](function(_0x2fb166){if(_0x2fb166[_0xa28b('0x73')]){var _0x1f373e=path[_0xa28b('0x7a')](_0x1f2e9b,_0x2fb166['Attachment'][_0xa28b('0x70')]);if(fs['existsSync'](_0x1f373e)){fs[_0xa28b('0xc9')](_0x1f373e)[_0xa28b('0xca')](fs[_0xa28b('0xcb')](path['join'](_0x23e2b5,_0x2fb166['Attachment'][_0xa28b('0x70')])));}}return{'date':moment(_0x2fb166[_0xa28b('0x90')])['format'](_0xa28b('0xac'))[_0xa28b('0xb6')](),'sender':_0x2fb166[_0xa28b('0x91')]==='out'?_0x2fb166[_0xa28b('0x82')]?_0x2fb166[_0xa28b('0x82')][_0xa28b('0xb0')]:_0xa28b('0x87'):_0x2fb166[_0xa28b('0x66')][_0xa28b('0xbb')]+(_0x2fb166[_0xa28b('0x66')][_0xa28b('0xcc')]?'\x20'+_0x2fb166['Contact'][_0xa28b('0xcc')]:''),'body':_0x2fb166[_0xa28b('0x73')]?_0x2fb166['Attachment'][_0xa28b('0x70')]:_0x2fb166['body'],'direction':_0x2fb166[_0xa28b('0x91')]==='out'?'A':'C','secret':_0x2fb166[_0xa28b('0x92')],'read':_0x2fb166['read'],'attachment':_0x2fb166[_0xa28b('0x73')]};})[_0xa28b('0xcd')]()};return ejs[_0xa28b('0xce')](path[_0xa28b('0x7a')](config[_0xa28b('0x78')],'server',_0xa28b('0xcf'),_0xa28b('0xd0')),{'interaction':_0x1eb219})['then'](function(_0x16ce6f){var _0x13cc87=path[_0xa28b('0x7a')](_0x23e2b5,'transcript-'+_0x328978['id']+'-'+_0x41329c+_0xa28b('0xd1'));var _0x76089c={'path':_0x13cc87,'channel':_0xa28b('0xd2'),'interactionId':_0x328978['id']};return pdf[_0xa28b('0xd3')](_0x16ce6f,_0x76089c);})[_0xa28b('0x17')](function(){return new Promise(function(_0x3e638c,_0x16d97f){zipdir(_0x23e2b5,{'saveTo':_0x224365},function(_0x45e144,_0x65621a){if(_0x45e144)return _0x16d97f(_0x45e144);return _0x3e638c(_0x65621a);});})[_0xa28b('0x17')](function(){return new BPromise(function(_0xc58c76,_0x4db9f2){rimraf(_0x23e2b5,function(_0xed80c5){if(_0xed80c5)_0x4db9f2(_0xed80c5);return _0xc58c76();});});})['then'](function(){return _0x27417a[_0xa28b('0x7c')](_0x224365,_0x2b1ad9,function(_0x28506f){if(_0x28506f){logger[_0xa28b('0x1e')]('err',_0x28506f);}else{fs['unlinkSync'](_0x224365);}});});});}else{return _0x27417a[_0xa28b('0x23')](0xc8);}})['catch'](handleError(_0x27417a,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 39a0bdd..7bc487f 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 _0x155b=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0x155b,0x16a));var _0xb155=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x155b[_0x3817a9];return _0x443f30;};'use strict';var EventEmitter=require(_0xb155('0x0'));var ChatInteraction=require(_0xb155('0x1'))['db'][_0xb155('0x2')];var ChatMessage=require(_0xb155('0x1'))['db'][_0xb155('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb155('0x4')](0x0);var events={'afterCreate':_0xb155('0x5'),'afterUpdate':_0xb155('0x6'),'afterDestroy':_0xb155('0x7')};function emitEvent(_0x1a9f1f){return function(_0x495da9,_0x46b008,_0x8bc4c){_0x495da9[_0xb155('0x8')]({'attributes':['id'],'raw':!![]})[_0xb155('0x9')](function(_0x112068){_0x495da9['setDataValue'](_0xb155('0xa'),_0x112068[_0xb155('0xb')](function(_0x3e17ad){return{'id':_0x3e17ad['id']};}));return ChatMessage[_0xb155('0xc')]({'where':{'ChatInteractionId':_0x495da9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb155('0x9')](function(_0xe9fe15){_0x495da9[_0xb155('0xd')](_0xb155('0xe'),_0xe9fe15[_0xb155('0xf')]);ChatInteractionEvents[_0xb155('0x10')](_0x1a9f1f+':'+_0x495da9['id'],_0x495da9);ChatInteractionEvents[_0xb155('0x10')](_0x1a9f1f,_0x495da9);_0x8bc4c(null);})[_0xb155('0x11')](_0x8bc4c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xb155('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x1b27=['update','remove','getUsers','then','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1b27,0x1cf));var _0x71b2=function(_0x5e973d,_0x201874){_0x5e973d=_0x5e973d-0x0;var _0x20eb1c=_0x1b27[_0x5e973d];return _0x20eb1c;};'use strict';var EventEmitter=require(_0x71b2('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x71b2('0x1')];var ChatMessage=require(_0x71b2('0x2'))['db'][_0x71b2('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x71b2('0x4'),'afterUpdate':_0x71b2('0x5'),'afterDestroy':_0x71b2('0x6')};function emitEvent(_0x1655a4){return function(_0x25b188,_0x2d0f90,_0xaf0c2b){_0x25b188[_0x71b2('0x7')]({'attributes':['id'],'raw':!![]})[_0x71b2('0x8')](function(_0x91641c){_0x25b188['setDataValue'](_0x71b2('0x9'),_0x91641c[_0x71b2('0xa')](function(_0x18ad0e){return{'id':_0x18ad0e['id']};}));return ChatMessage[_0x71b2('0xb')]({'where':{'ChatInteractionId':_0x25b188['id'],'direction':'in','read':![]},'raw':!![]});})[_0x71b2('0x8')](function(_0x4b609b){_0x25b188['setDataValue'](_0x71b2('0xc'),_0x4b609b['length']);ChatInteractionEvents[_0x71b2('0xd')](_0x1655a4+':'+_0x25b188['id'],_0x25b188);ChatInteractionEvents[_0x71b2('0xd')](_0x1655a4,_0x25b188);_0xaf0c2b(null);})[_0x71b2('0xe')](_0xaf0c2b(null));};}for(var e in events){if(events[_0x71b2('0xf')](e)){var event=events[e];ChatInteraction[_0x71b2('0x10')](e,emitEvent(event));}}module[_0x71b2('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index aa006ac..96105a6 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 _0x1396=['changed','closed','format','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0xda8f6f,_0x11c149){var _0x1b3e68=function(_0x168b8d){while(--_0x168b8d){_0xda8f6f['push'](_0xda8f6f['shift']());}};_0x1b3e68(++_0x11c149);}(_0x1396,0x122));var _0x6139=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x1396[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6139('0x0'))(_0x6139('0x1'));var moment=require('moment');var BPromise=require(_0x6139('0x2'));var rp=require(_0x6139('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6139('0x4'));var config=require(_0x6139('0x5'));var attributes=require(_0x6139('0x6'));module[_0x6139('0x7')]=function(_0x152d10,_0x591dc2){return _0x152d10[_0x6139('0x8')](_0x6139('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x564e83,_0x1041b5,_0x1a2d2e){if(_0x564e83[_0x6139('0xa')](_0x6139('0xb'))){_0x564e83['closedAt']=moment()[_0x6139('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1a2d2e(null,_0x564e83);}},'charset':_0x6139('0xd'),'collate':_0x6139('0xe')});};
\ No newline at end of file
+var _0x7884=['closed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions'];(function(_0x22fe71,_0x4554de){var _0x1283ab=function(_0x12a750){while(--_0x12a750){_0x22fe71['push'](_0x22fe71['shift']());}};_0x1283ab(++_0x4554de);}(_0x7884,0x19c));var _0x4788=function(_0x7ba025,_0xf0e9f4){_0x7ba025=_0x7ba025-0x0;var _0x5dce8f=_0x7884[_0x7ba025];return _0x5dce8f;};'use strict';var _=require(_0x4788('0x0'));var util=require(_0x4788('0x1'));var logger=require(_0x4788('0x2'))(_0x4788('0x3'));var moment=require(_0x4788('0x4'));var BPromise=require(_0x4788('0x5'));var rp=require(_0x4788('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4788('0x7'));var config=require(_0x4788('0x8'));var attributes=require(_0x4788('0x9'));module[_0x4788('0xa')]=function(_0x3e147a,_0xc0a619){return _0x3e147a[_0x4788('0xb')]('ChatInteraction',attributes,{'tableName':_0x4788('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5079b1,_0x1105c7,_0x4af43c){if(_0x5079b1['changed'](_0x4788('0xd'))){_0x5079b1['closedAt']=moment()[_0x4788('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4af43c(null,_0x5079b1);}},'charset':_0x4788('0xf'),'collate':_0x4788('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 337601d..aae49f1 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 _0x067d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','options','raw','where','attributes','limit','then','catch','AddTagsToChatInteraction','addTags','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis'];(function(_0x868d30,_0x121202){var _0xe498ab=function(_0x55f7b6){while(--_0x55f7b6){_0x868d30['push'](_0x868d30['shift']());}};_0xe498ab(++_0x121202);}(_0x067d,0xcd));var _0xd067=function(_0x1b2667,_0x279eb1){_0x1b2667=_0x1b2667-0x0;var _0x179ae8=_0x067d[_0x1b2667];return _0x179ae8;};'use strict';var _=require(_0xd067('0x0'));var util=require(_0xd067('0x1'));var moment=require(_0xd067('0x2'));var BPromise=require('bluebird');var rs=require(_0xd067('0x3'));var fs=require('fs');var Redis=require(_0xd067('0x4'));var db=require(_0xd067('0x5'))['db'];var utils=require(_0xd067('0x6'));var logger=require(_0xd067('0x7'))(_0xd067('0x8'));var config=require(_0xd067('0x9'));var jayson=require(_0xd067('0xa'));var client=jayson[_0xd067('0xb')][_0xd067('0xc')]({'port':0x232a});config[_0xd067('0xd')]=_['defaults'](config[_0xd067('0xd')],{'host':_0xd067('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd067('0xd')]));require(_0xd067('0xf'))[_0xd067('0x10')](socket);function respondWithRpcPromise(_0xdcbfce,_0x214593,_0x566763){return new BPromise(function(_0x5cfe3d,_0x561c78){return client[_0xd067('0x11')](_0xdcbfce,_0x566763)['then'](function(_0x5b4bc6){logger[_0xd067('0x12')](_0xd067('0x13'),_0x214593,'request\x20sent');logger[_0xd067('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x214593,'request\x20sent',JSON[_0xd067('0x15')](_0x5b4bc6));if(_0x5b4bc6[_0xd067('0x16')]){if(_0x5b4bc6['error'][_0xd067('0x17')]===0x1f4){logger[_0xd067('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x214593,_0x5b4bc6[_0xd067('0x16')][_0xd067('0x18')]);return _0x561c78(_0x5b4bc6['error'][_0xd067('0x18')]);}logger[_0xd067('0x16')](_0xd067('0x13'),_0x214593,_0x5b4bc6[_0xd067('0x16')]['message']);return _0x5cfe3d(_0x5b4bc6[_0xd067('0x16')][_0xd067('0x18')]);}else{logger['info'](_0xd067('0x13'),_0x214593,_0xd067('0x19'));_0x5cfe3d(_0x5b4bc6[_0xd067('0x1a')]['message']);}})['catch'](function(_0x33fe23){logger[_0xd067('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x214593,_0x33fe23);_0x561c78(_0x33fe23);});});}exports[_0xd067('0x1b')]=function(_0x96fa05){var _0x524132=this;return new Promise(function(_0x256d9e,_0xfd0b13){return db[_0xd067('0x1c')]['update'](_0x96fa05['body'],{'raw':_0x96fa05['options']?_0x96fa05[_0xd067('0x1d')][_0xd067('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96fa05['options']?_0x96fa05[_0xd067('0x1d')][_0xd067('0x1f')]||null:null,'attributes':_0x96fa05[_0xd067('0x1d')]?_0x96fa05['options'][_0xd067('0x20')]||null:null,'limit':_0x96fa05['options']?_0x96fa05[_0xd067('0x1d')][_0xd067('0x21')]||null:null})[_0xd067('0x22')](function(_0x29bc3b){logger[_0xd067('0x12')]('UpdateChatInteraction',_0x96fa05);logger[_0xd067('0x14')](_0xd067('0x1b'),_0x96fa05,JSON[_0xd067('0x15')](_0x29bc3b));_0x256d9e(_0x29bc3b);})[_0xd067('0x23')](function(_0x34de72){logger[_0xd067('0x16')](_0xd067('0x1b'),_0x34de72[_0xd067('0x18')],_0x96fa05);_0xfd0b13(_0x524132[_0xd067('0x16')](0x1f4,_0x34de72[_0xd067('0x18')]));});});};exports[_0xd067('0x24')]=function(_0x30474f){return new Promise(function(_0x50e112,_0x486ee8){return db[_0xd067('0x1c')]['find']({'where':_0x30474f[_0xd067('0x1d')]?_0x30474f[_0xd067('0x1d')]['where']||null:null})[_0xd067('0x22')](function(_0x2200c7){if(_0x2200c7){return _0x2200c7[_0xd067('0x25')](_0x30474f[_0xd067('0x26')][_0xd067('0x27')],_['omit'](_0x30474f['body'],[_0xd067('0x27'),'id'])||{});}})[_0xd067('0x28')](function(_0x2172ff){logger[_0xd067('0x12')](_0xd067('0x29'),_0x30474f);logger['debug']('AddTags',_0x30474f,JSON['stringify'](_0x2172ff));_0x50e112(_0x2172ff);})[_0xd067('0x23')](function(_0x2e8d0a){logger[_0xd067('0x16')](_0xd067('0x29'),_0x2e8d0a['message'],_0x30474f);_0x486ee8(_this[_0xd067('0x16')](0x1f4,_0x2e8d0a[_0xd067('0x18')]));});});};
\ No newline at end of file
+var _0xbdcb=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatInteraction,\x20%s,\x20%s','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','limit','catch','find','where','addTags','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis'];(function(_0x494a97,_0xa61382){var _0x4a14ff=function(_0x4b2560){while(--_0x4b2560){_0x494a97['push'](_0x494a97['shift']());}};_0x4a14ff(++_0xa61382);}(_0xbdcb,0xf7));var _0xbbdc=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xbdcb[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xbbdc('0x0'));var util=require(_0xbbdc('0x1'));var moment=require(_0xbbdc('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbdc('0x3'));var fs=require('fs');var Redis=require(_0xbbdc('0x4'));var db=require(_0xbbdc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbdc('0x6'))(_0xbbdc('0x7'));var config=require(_0xbbdc('0x8'));var jayson=require(_0xbbdc('0x9'));var client=jayson[_0xbbdc('0xa')][_0xbbdc('0xb')]({'port':0x232a});config[_0xbbdc('0xc')]=_[_0xbbdc('0xd')](config[_0xbbdc('0xc')],{'host':_0xbbdc('0xe'),'port':0x18eb});var socket=require(_0xbbdc('0xf'))(new Redis(config['redis']));require(_0xbbdc('0x10'))['register'](socket);function respondWithRpcPromise(_0x23eb67,_0x5afc9a,_0x2513a2){return new BPromise(function(_0x1cfcc8,_0x58cc4b){return client['request'](_0x23eb67,_0x2513a2)[_0xbbdc('0x11')](function(_0x8f3697){logger[_0xbbdc('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x5afc9a,_0xbbdc('0x13'));logger[_0xbbdc('0x14')](_0xbbdc('0x15'),_0x5afc9a,'request\x20sent',JSON[_0xbbdc('0x16')](_0x8f3697));if(_0x8f3697['error']){if(_0x8f3697['error'][_0xbbdc('0x17')]===0x1f4){logger[_0xbbdc('0x18')](_0xbbdc('0x19'),_0x5afc9a,_0x8f3697['error'][_0xbbdc('0x1a')]);return _0x58cc4b(_0x8f3697[_0xbbdc('0x18')][_0xbbdc('0x1a')]);}logger[_0xbbdc('0x18')](_0xbbdc('0x19'),_0x5afc9a,_0x8f3697[_0xbbdc('0x18')][_0xbbdc('0x1a')]);return _0x1cfcc8(_0x8f3697[_0xbbdc('0x18')][_0xbbdc('0x1a')]);}else{logger[_0xbbdc('0x12')](_0xbbdc('0x19'),_0x5afc9a,_0xbbdc('0x13'));_0x1cfcc8(_0x8f3697[_0xbbdc('0x1b')][_0xbbdc('0x1a')]);}})['catch'](function(_0x2abbdb){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5afc9a,_0x2abbdb);_0x58cc4b(_0x2abbdb);});});}exports[_0xbbdc('0x1c')]=function(_0x11c044){var _0x229cf0=this;return new Promise(function(_0x3a2068,_0x3c8be6){return db[_0xbbdc('0x1d')][_0xbbdc('0x1e')](_0x11c044[_0xbbdc('0x1f')],{'raw':_0x11c044[_0xbbdc('0x20')]?_0x11c044[_0xbbdc('0x20')][_0xbbdc('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11c044[_0xbbdc('0x20')]?_0x11c044[_0xbbdc('0x20')]['where']||null:null,'attributes':_0x11c044[_0xbbdc('0x20')]?_0x11c044[_0xbbdc('0x20')]['attributes']||null:null,'limit':_0x11c044[_0xbbdc('0x20')]?_0x11c044[_0xbbdc('0x20')][_0xbbdc('0x22')]||null:null})['then'](function(_0x765af9){logger[_0xbbdc('0x12')](_0xbbdc('0x1c'),_0x11c044);logger[_0xbbdc('0x14')](_0xbbdc('0x1c'),_0x11c044,JSON[_0xbbdc('0x16')](_0x765af9));_0x3a2068(_0x765af9);})[_0xbbdc('0x23')](function(_0x23bedc){logger[_0xbbdc('0x18')](_0xbbdc('0x1c'),_0x23bedc[_0xbbdc('0x1a')],_0x11c044);_0x3c8be6(_0x229cf0[_0xbbdc('0x18')](0x1f4,_0x23bedc[_0xbbdc('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x5b586b){return new Promise(function(_0x18585b,_0x551b4c){return db[_0xbbdc('0x1d')][_0xbbdc('0x24')]({'where':_0x5b586b['options']?_0x5b586b[_0xbbdc('0x20')][_0xbbdc('0x25')]||null:null})[_0xbbdc('0x11')](function(_0x4ec61c){if(_0x4ec61c){return _0x4ec61c[_0xbbdc('0x26')](_0x5b586b[_0xbbdc('0x1f')]['ids'],_['omit'](_0x5b586b['body'],[_0xbbdc('0x27'),'id'])||{});}})[_0xbbdc('0x28')](function(_0x5280e7){logger[_0xbbdc('0x12')](_0xbbdc('0x29'),_0x5b586b);logger[_0xbbdc('0x14')](_0xbbdc('0x29'),_0x5b586b,JSON[_0xbbdc('0x16')](_0x5280e7));_0x18585b(_0x5280e7);})[_0xbbdc('0x23')](function(_0x11031f){logger[_0xbbdc('0x18')](_0xbbdc('0x29'),_0x11031f[_0xbbdc('0x1a')],_0x5b586b);_0x551b4c(_this['error'](0x1f4,_0x11031f[_0xbbdc('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 20f2575..0e0d077 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 _0x15d6=['save','remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x366d42,_0x338fb4){var _0x1a47f7=function(_0x404f01){while(--_0x404f01){_0x366d42['push'](_0x366d42['shift']());}};_0x1a47f7(++_0x338fb4);}(_0x15d6,0xb3));var _0x615d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x15d6[_0xa464c9];return _0x3d73c4;};'use strict';var ChatInteractionEvents=require(_0x615d('0x0'));var events=[_0x615d('0x1'),_0x615d('0x2'),_0x615d('0x3')];function createListener(_0x46ca8b,_0x423267){return function(_0x688729){_0x423267[_0x615d('0x4')](_0x46ca8b,_0x688729);};}function removeListener(_0x2c6415,_0x5d4beb){return function(){ChatInteractionEvents[_0x615d('0x5')](_0x2c6415,_0x5d4beb);};}exports[_0x615d('0x6')]=function(_0x5296d4){for(var _0x58fdaa=0x0,_0x162493=events[_0x615d('0x7')];_0x58fdaa<_0x162493;_0x58fdaa++){var _0x42ee0f=events[_0x58fdaa];var _0x1cb449=createListener(_0x615d('0x8')+_0x42ee0f,_0x5296d4);ChatInteractionEvents['on'](_0x42ee0f,_0x1cb449);}};
\ No newline at end of file
+var _0x4133=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x236092,_0x2f90ba){var _0x353481=function(_0x591807){while(--_0x591807){_0x236092['push'](_0x236092['shift']());}};_0x353481(++_0x2f90ba);}(_0x4133,0x14a));var _0x3413=function(_0x98d5fb,_0x22a6b1){_0x98d5fb=_0x98d5fb-0x0;var _0x545f94=_0x4133[_0x98d5fb];return _0x545f94;};'use strict';var ChatInteractionEvents=require(_0x3413('0x0'));var events=[_0x3413('0x1'),_0x3413('0x2'),_0x3413('0x3')];function createListener(_0x474054,_0x87e11f){return function(_0x3864c9){_0x87e11f[_0x3413('0x4')](_0x474054,_0x3864c9);};}function removeListener(_0xcd7884,_0x1986f6){return function(){ChatInteractionEvents[_0x3413('0x5')](_0xcd7884,_0x1986f6);};}exports[_0x3413('0x6')]=function(_0xf7eec0){for(var _0x1cc3c8=0x0,_0x71d523=events[_0x3413('0x7')];_0x1cc3c8<_0x71d523;_0x1cc3c8++){var _0x426ff0=events[_0x1cc3c8];var _0x4c5d7e=createListener(_0x3413('0x8')+_0x426ff0,_0xf7eec0);ChatInteractionEvents['on'](_0x426ff0,_0x4c5d7e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 2b96b2b..dc623bb 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 _0x9b6d=['describe','/:id','show','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','root','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x483461,_0x3a7690){var _0x1c851f=function(_0x3683ca){while(--_0x3683ca){_0x483461['push'](_0x483461['shift']());}};_0x1c851f(++_0x3a7690);}(_0x9b6d,0x1d5));var _0xd9b6=function(_0x15b6bc,_0x47b90f){_0x15b6bc=_0x15b6bc-0x0;var _0x50fb17=_0x9b6d[_0x15b6bc];return _0x50fb17;};'use strict';var multer=require('multer');var util=require(_0xd9b6('0x0'));var path=require('path');var timeout=require(_0xd9b6('0x1'));var express=require(_0xd9b6('0x2'));var router=express[_0xd9b6('0x3')]();var fs_extra=require(_0xd9b6('0x4'));var auth=require(_0xd9b6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd9b6('0x6'));var controller=require('./chatInteraction.controller');router[_0xd9b6('0x7')]('/',auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x9')]);router[_0xd9b6('0x7')](_0xd9b6('0xa'),auth[_0xd9b6('0x8')](),controller[_0xd9b6('0xb')]);router[_0xd9b6('0x7')](_0xd9b6('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xd9b6('0xd')]);router[_0xd9b6('0x7')]('/:id/attachment_download',auth[_0xd9b6('0xe')](),controller['attachmentDownload']);router[_0xd9b6('0x7')](_0xd9b6('0xf'),auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x10')]);router[_0xd9b6('0x7')](_0xd9b6('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xd9b6('0x12')]);router['get'](_0xd9b6('0x13'),auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x14')]);router[_0xd9b6('0x15')]('/',auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x16')]);router[_0xd9b6('0x15')](_0xd9b6('0x17'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xd9b6('0x18')]({'destination':function(_0xa05025,_0x590f10,_0x3030a9){_0x3030a9(null,path['join'](config[_0xd9b6('0x19')],'server/files/attachments/'));},'filename':function(_0x83eaad,_0xc863be,_0xcf1ef5){_0xcf1ef5(null,util['format'](_0xd9b6('0x1a'),Date[_0xd9b6('0x1b')](),_0xc863be['originalname'][_0xd9b6('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd9b6('0x15')](_0xd9b6('0x1d'),upload[_0xd9b6('0x1e')](_0xd9b6('0x1f')),controller[_0xd9b6('0x20')]);router['post'](_0xd9b6('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xd9b6('0x21')]);router[_0xd9b6('0x15')]('/:id/tags',auth[_0xd9b6('0x8')](),interaction['tracked'](_0xd9b6('0x22'),'chatinteraction:addtags'),controller[_0xd9b6('0x23')]);router[_0xd9b6('0x24')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xd9b6('0x22'),_0xd9b6('0x25')),controller[_0xd9b6('0x26')]);router[_0xd9b6('0x24')]('/:id/custom_update',controller[_0xd9b6('0x27')]);router[_0xd9b6('0x24')](_0xd9b6('0x28'),auth[_0xd9b6('0xe')](),controller['abandon']);router[_0xd9b6('0x24')](_0xd9b6('0x29'),controller[_0xd9b6('0x2a')]);router[_0xd9b6('0x2b')](_0xd9b6('0xc'),auth[_0xd9b6('0x8')](),interaction['tracked']('chat',_0xd9b6('0x2c')),controller[_0xd9b6('0x2d')]);router[_0xd9b6('0x2b')]('/:id/tags',auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x2e')]);module[_0xd9b6('0x2f')]=router;
\ No newline at end of file
+var _0x013d=['addMessage','/:id/tags','tracked','chatinteraction:addtags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','getMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','format','now','originalname','/:id/attachment_upload','single','file','attachmentUpload'];(function(_0x1785d4,_0x2faaf0){var _0x4dcdca=function(_0xad1fbe){while(--_0xad1fbe){_0x1785d4['push'](_0x1785d4['shift']());}};_0x4dcdca(++_0x2faaf0);}(_0x013d,0x13e));var _0xd013=function(_0x33c70e,_0xd8cb0b){_0x33c70e=_0x33c70e-0x0;var _0x5a33e5=_0x013d[_0x33c70e];return _0x5a33e5;};'use strict';var multer=require(_0xd013('0x0'));var util=require(_0xd013('0x1'));var path=require(_0xd013('0x2'));var timeout=require(_0xd013('0x3'));var express=require(_0xd013('0x4'));var router=express[_0xd013('0x5')]();var fs_extra=require(_0xd013('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd013('0x7'));var config=require(_0xd013('0x8'));var controller=require(_0xd013('0x9'));router[_0xd013('0xa')]('/',auth[_0xd013('0xb')](),controller[_0xd013('0xc')]);router['get'](_0xd013('0xd'),auth[_0xd013('0xb')](),controller['describe']);router['get'](_0xd013('0xe'),auth[_0xd013('0xf')](),controller[_0xd013('0x10')]);router[_0xd013('0xa')]('/:id/attachment_download',auth[_0xd013('0xf')](),controller['attachmentDownload']);router[_0xd013('0xa')]('/:id/messages',auth[_0xd013('0xb')](),controller[_0xd013('0x11')]);router[_0xd013('0xa')]('/:id/my_messages',auth[_0xd013('0xf')](),controller['getMyMessages']);router[_0xd013('0xa')]('/:id/download',auth[_0xd013('0xb')](),controller[_0xd013('0x12')]);router[_0xd013('0x13')]('/',auth[_0xd013('0xb')](),controller[_0xd013('0x14')]);router[_0xd013('0x13')](_0xd013('0x15'),auth[_0xd013('0xb')](),controller[_0xd013('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4244a9,_0x3c08c7,_0x410ea0){_0x410ea0(null,path[_0xd013('0x17')](config[_0xd013('0x18')],'server/files/attachments/'));},'filename':function(_0x2713bc,_0x56d624,_0x191e89){_0x191e89(null,util[_0xd013('0x19')]('%s-%s',Date[_0xd013('0x1a')](),_0x56d624[_0xd013('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd013('0x13')](_0xd013('0x1c'),upload[_0xd013('0x1d')](_0xd013('0x1e')),controller[_0xd013('0x1f')]);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xd013('0x20')]);router[_0xd013('0x13')](_0xd013('0x21'),auth[_0xd013('0xb')](),interaction[_0xd013('0x22')]('chat',_0xd013('0x23')),controller['addTags']);router[_0xd013('0x24')](_0xd013('0xe'),auth[_0xd013('0xb')](),interaction[_0xd013('0x22')](_0xd013('0x25'),_0xd013('0x26')),controller[_0xd013('0x27')]);router[_0xd013('0x24')](_0xd013('0x28'),controller[_0xd013('0x29')]);router['put'](_0xd013('0x2a'),auth[_0xd013('0xf')](),controller[_0xd013('0x2b')]);router[_0xd013('0x24')]('/:id/close',controller[_0xd013('0x2c')]);router[_0xd013('0x2d')](_0xd013('0xe'),auth[_0xd013('0xb')](),interaction[_0xd013('0x22')]('chat',_0xd013('0x2e')),controller[_0xd013('0x2f')]);router[_0xd013('0x2d')](_0xd013('0x21'),auth[_0xd013('0xb')](),controller[_0xd013('0x30')]);module[_0xd013('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index d0c99fa..d4ec850 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 _0xf492=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0xf492,0x102));var _0x2f49=function(_0x1f1578,_0x33d122){_0x1f1578=_0x1f1578-0x0;var _0x2603f6=_0xf492[_0x1f1578];return _0x2603f6;};'use strict';var Sequelize=require(_0x2f49('0x0'));module['exports']={'body':{'type':Sequelize[_0x2f49('0x1')](_0x2f49('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2f49('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2f49('0x4')]}};
\ No newline at end of file
+var _0x29d9=['medium','BOOLEAN','sequelize','exports','TEXT'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x29d9,0x11a));var _0x929d=function(_0x4b89f1,_0x590c84){_0x4b89f1=_0x4b89f1-0x0;var _0x3530fd=_0x29d9[_0x4b89f1];return _0x3530fd;};'use strict';var Sequelize=require(_0x929d('0x0'));module[_0x929d('0x1')]={'body':{'type':Sequelize[_0x929d('0x2')](_0x929d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x929d('0x4')],'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 3d358e8..cbb362b 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 _0xc027=['sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','show','params','intersection','include','find','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','findAll','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','autoAssociation','isEmpty','agent','resourceId','push','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path'];(function(_0x1d61ca,_0x19164c){var _0x2fdf1f=function(_0x1526e3){while(--_0x1526e3){_0x1d61ca['push'](_0x1d61ca['shift']());}};_0x2fdf1f(++_0x19164c);}(_0xc027,0xcf));var _0x7c02=function(_0x2871c2,_0xe4c551){_0x2871c2=_0x2871c2-0x0;var _0x279bac=_0xc027[_0x2871c2];return _0x279bac;};'use strict';var emlformat=require(_0x7c02('0x0'));var rimraf=require(_0x7c02('0x1'));var zipdir=require(_0x7c02('0x2'));var jsonpatch=require(_0x7c02('0x3'));var rp=require(_0x7c02('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7c02('0x5'));var util=require('util');var path=require(_0x7c02('0x6'));var sox=require(_0x7c02('0x7'));var csv=require('to-csv');var ejs=require(_0x7c02('0x8'));var fs=require('fs');var fs_extra=require(_0x7c02('0x9'));var _=require(_0x7c02('0xa'));var squel=require(_0x7c02('0xb'));var crypto=require('crypto');var jsforce=require(_0x7c02('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7c02('0xd'));var querystring=require(_0x7c02('0xe'));var Papa=require('papaparse');var Redis=require(_0x7c02('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7c02('0x10'));var as=require(_0x7c02('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c02('0x12'));var utils=require(_0x7c02('0x13'));var config=require(_0x7c02('0x14'));var licenseUtil=require(_0x7c02('0x15'));var db=require(_0x7c02('0x16'))['db'];config[_0x7c02('0x17')]=_[_0x7c02('0x18')](config[_0x7c02('0x17')],{'host':_0x7c02('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c02('0x17')]));require(_0x7c02('0x1a'))[_0x7c02('0x1b')](socket);function respondWithStatusCode(_0x36f34b,_0x5728a0){_0x5728a0=_0x5728a0||0xcc;return function(_0x341976){if(_0x341976){return _0x36f34b[_0x7c02('0x1c')](_0x5728a0);}return _0x36f34b[_0x7c02('0x1d')](_0x5728a0)[_0x7c02('0x1e')]();};}function respondWithResult(_0x38f8ab,_0x2b23ea){_0x2b23ea=_0x2b23ea||0xc8;return function(_0x39a1f9){if(_0x39a1f9){return _0x38f8ab[_0x7c02('0x1d')](_0x2b23ea)[_0x7c02('0x1f')](_0x39a1f9);}};}function respondWithFilteredResult(_0x102706,_0x222ba0){return function(_0x2f9f1d){if(_0x2f9f1d){var _0x4ae159=typeof _0x222ba0[_0x7c02('0x20')]===_0x7c02('0x21')&&typeof _0x222ba0[_0x7c02('0x22')]==='undefined';var _0x1eeb3a=_0x2f9f1d[_0x7c02('0x23')];var _0x3a3950=_0x4ae159?0x0:_0x222ba0[_0x7c02('0x20')];var _0x70055d=_0x4ae159?_0x2f9f1d[_0x7c02('0x23')]:_0x222ba0[_0x7c02('0x20')]+_0x222ba0[_0x7c02('0x22')];var _0x3a474e;if(_0x70055d>=_0x1eeb3a){_0x70055d=_0x1eeb3a;_0x3a474e=0xc8;}else{_0x3a474e=0xce;}_0x102706[_0x7c02('0x1d')](_0x3a474e);return _0x102706[_0x7c02('0x24')](_0x7c02('0x25'),_0x3a3950+'-'+_0x70055d+'/'+_0x1eeb3a)[_0x7c02('0x1f')](_0x2f9f1d);}return null;};}function patchUpdates(_0x3ce541){return function(_0x761643){try{jsonpatch[_0x7c02('0x26')](_0x761643,_0x3ce541,!![]);}catch(_0x5edd8c){return BPromise[_0x7c02('0x27')](_0x5edd8c);}return _0x761643[_0x7c02('0x28')]();};}function saveUpdates(_0x5522af,_0x17c2cb){return function(_0x1ed8f4){if(_0x1ed8f4){return _0x1ed8f4[_0x7c02('0x29')](_0x5522af)[_0x7c02('0x2a')](function(_0x5183f7){return _0x5183f7;});}return null;};}function removeEntity(_0x54bf4c,_0x366ba1){return function(_0x352380){if(_0x352380){return _0x352380['destroy']()[_0x7c02('0x2a')](function(){_0x54bf4c['status'](0xcc)[_0x7c02('0x1e')]();});}};}function handleEntityNotFound(_0x2e615d,_0x2c6701){return function(_0x2395ea){if(!_0x2395ea){_0x2e615d['sendStatus'](0x194);}return _0x2395ea;};}function handleError(_0x45e0e8,_0x5e13d8){_0x5e13d8=_0x5e13d8||0x1f4;return function(_0x584c2e){logger[_0x7c02('0x2b')](_0x584c2e[_0x7c02('0x2c')]);if(_0x584c2e[_0x7c02('0x2d')]){delete _0x584c2e[_0x7c02('0x2d')];}_0x45e0e8[_0x7c02('0x1d')](_0x5e13d8)[_0x7c02('0x2e')](_0x584c2e);};}exports[_0x7c02('0x2f')]=function(_0x498bdc,_0x949df5){var _0x5e3b42={},_0xce8aff={},_0x579339={'count':0x0,'rows':[]};var _0x11baa5=_[_0x7c02('0x30')](db[_0x7c02('0x31')][_0x7c02('0x32')],function(_0x56e48d){return{'name':_0x56e48d['fieldName'],'type':_0x56e48d[_0x7c02('0x33')][_0x7c02('0x34')]};});_0xce8aff['model']=_[_0x7c02('0x30')](_0x11baa5,'name');_0xce8aff[_0x7c02('0x35')]=_[_0x7c02('0x36')](_0x498bdc[_0x7c02('0x35')]);_0xce8aff[_0x7c02('0x37')]=_['intersection'](_0xce8aff[_0x7c02('0x38')],_0xce8aff['query']);_0x5e3b42['attributes']=_['intersection'](_0xce8aff[_0x7c02('0x38')],qs[_0x7c02('0x39')](_0x498bdc[_0x7c02('0x35')][_0x7c02('0x39')]));_0x5e3b42[_0x7c02('0x3a')]=_0x5e3b42['attributes'][_0x7c02('0x3b')]?_0x5e3b42[_0x7c02('0x3a')]:_0xce8aff['model'];if(!_0x498bdc[_0x7c02('0x35')][_0x7c02('0x3c')](_0x7c02('0x3d'))){_0x5e3b42[_0x7c02('0x22')]=qs[_0x7c02('0x22')](_0x498bdc[_0x7c02('0x35')][_0x7c02('0x22')]);_0x5e3b42[_0x7c02('0x20')]=qs[_0x7c02('0x20')](_0x498bdc[_0x7c02('0x35')][_0x7c02('0x20')]);}_0x5e3b42['order']=qs[_0x7c02('0x3e')](_0x498bdc['query'][_0x7c02('0x3e')]);_0x5e3b42[_0x7c02('0x3f')]=qs[_0x7c02('0x37')](_[_0x7c02('0x40')](_0x498bdc[_0x7c02('0x35')],_0xce8aff[_0x7c02('0x37')]),_0x11baa5);if(_0x498bdc[_0x7c02('0x35')][_0x7c02('0x41')]){_0x5e3b42[_0x7c02('0x3f')]=_[_0x7c02('0x42')](_0x5e3b42[_0x7c02('0x3f')],{'$or':_[_0x7c02('0x30')](_0x11baa5,function(_0x3fa6f6){if(_0x3fa6f6['type']!=='VIRTUAL'){var _0x196325={};_0x196325[_0x3fa6f6['name']]={'$like':'%'+_0x498bdc[_0x7c02('0x35')][_0x7c02('0x41')]+'%'};return _0x196325;}})});}_0x5e3b42=_[_0x7c02('0x42')]({},_0x5e3b42,_0x498bdc[_0x7c02('0x43')]);var _0x34217d={'where':_0x5e3b42[_0x7c02('0x3f')]};return db[_0x7c02('0x31')]['count'](_0x34217d)[_0x7c02('0x2a')](function(_0x237114){_0x579339[_0x7c02('0x23')]=_0x237114;if(_0x498bdc[_0x7c02('0x35')][_0x7c02('0x44')]){_0x5e3b42['include']=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x5e3b42);})[_0x7c02('0x2a')](function(_0x537438){_0x579339['rows']=_0x537438;return _0x579339;})[_0x7c02('0x2a')](respondWithFilteredResult(_0x949df5,_0x5e3b42))['catch'](handleError(_0x949df5,null));};exports[_0x7c02('0x45')]=function(_0x3d699d,_0x1d4c9f){var _0x460cd2={'raw':!![],'where':{'id':_0x3d699d[_0x7c02('0x46')]['id']}},_0x491407={};_0x491407[_0x7c02('0x38')]=_[_0x7c02('0x36')](db['ChatInternalMessage'][_0x7c02('0x32')]);_0x491407[_0x7c02('0x35')]=_['keys'](_0x3d699d[_0x7c02('0x35')]);_0x491407[_0x7c02('0x37')]=_[_0x7c02('0x47')](_0x491407[_0x7c02('0x38')],_0x491407[_0x7c02('0x35')]);_0x460cd2[_0x7c02('0x3a')]=_[_0x7c02('0x47')](_0x491407[_0x7c02('0x38')],qs[_0x7c02('0x39')](_0x3d699d[_0x7c02('0x35')][_0x7c02('0x39')]));_0x460cd2[_0x7c02('0x3a')]=_0x460cd2[_0x7c02('0x3a')][_0x7c02('0x3b')]?_0x460cd2['attributes']:_0x491407['model'];if(_0x3d699d[_0x7c02('0x35')][_0x7c02('0x44')]){_0x460cd2[_0x7c02('0x48')]=[{'all':!![]}];}_0x460cd2=_[_0x7c02('0x42')]({},_0x460cd2,_0x3d699d['options']);return db[_0x7c02('0x31')][_0x7c02('0x49')](_0x460cd2)[_0x7c02('0x2a')](handleEntityNotFound(_0x1d4c9f,null))[_0x7c02('0x2a')](respondWithResult(_0x1d4c9f,null))[_0x7c02('0x4a')](handleError(_0x1d4c9f,null));};exports[_0x7c02('0x4b')]=function(_0x513ef2,_0x108f59){return db[_0x7c02('0x31')][_0x7c02('0x4b')](_0x513ef2[_0x7c02('0x4c')],{})[_0x7c02('0x2a')](respondWithResult(_0x108f59,0xc9))[_0x7c02('0x4a')](handleError(_0x108f59,null));};exports[_0x7c02('0x29')]=function(_0xa62f5,_0x16b8c6){if(_0xa62f5[_0x7c02('0x4c')]['id']){delete _0xa62f5['body']['id'];}return db[_0x7c02('0x31')][_0x7c02('0x49')]({'where':{'id':_0xa62f5['params']['id']}})[_0x7c02('0x2a')](handleEntityNotFound(_0x16b8c6,null))[_0x7c02('0x2a')](saveUpdates(_0xa62f5[_0x7c02('0x4c')],null))[_0x7c02('0x2a')](respondWithResult(_0x16b8c6,null))[_0x7c02('0x4a')](handleError(_0x16b8c6,null));};exports[_0x7c02('0x4d')]=function(_0x4dbe91,_0x5b7b68){return db[_0x7c02('0x31')][_0x7c02('0x49')]({'where':{'id':_0x4dbe91[_0x7c02('0x46')]['id']}})[_0x7c02('0x2a')](handleEntityNotFound(_0x5b7b68,null))[_0x7c02('0x2a')](removeEntity(_0x5b7b68,null))[_0x7c02('0x4a')](handleError(_0x5b7b68,null));};exports[_0x7c02('0x4e')]=function(_0x486b50,_0xddea67){return db[_0x7c02('0x31')][_0x7c02('0x4e')]()[_0x7c02('0x2a')](respondWithResult(_0xddea67,null))[_0x7c02('0x4a')](handleError(_0xddea67,null));};function wrapUser(_0x1a31b0){return function(_0x3449c3){var _0x5b3bf2=_0x1a31b0[_0x7c02('0x4f')]({'plain':!![]});_0x5b3bf2[_0x7c02('0x50')]=[];if(_0x3449c3){_0x5b3bf2[_0x7c02('0x51')]=_0x3449c3[_0x7c02('0x52')];_0x5b3bf2['lastMessage']=_0x3449c3;}else{_0x5b3bf2[_0x7c02('0x51')]=moment(0x0)[_0x7c02('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b3bf2[_0x7c02('0x54')]={};}return _0x5b3bf2;};}exports[_0x7c02('0x55')]=function(_0xe8b756,_0x4d763d,_0x4682d4){var _0x29bde6=[];return db[_0x7c02('0x56')][_0x7c02('0x57')]({'where':{'role':['agent','admin',_0x7c02('0x58')]},'attributes':['id',_0x7c02('0x59'),_0x7c02('0x2d'),_0x7c02('0x5a'),'userpic',_0x7c02('0x5b'),_0x7c02('0x5c'),_0x7c02('0x5d'),_0x7c02('0x5e'),_0x7c02('0x5f')],'order':qs[_0x7c02('0x3e')](_0x7c02('0x60')),'include':[{'model':db[_0x7c02('0x61')],'as':_0x7c02('0x62'),'attributes':['id',_0x7c02('0x2d'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x3b1bb7){if(_0x3b1bb7){var _0x5be4d4=_0xe8b756[_0x7c02('0x58')]['get']({'plain':!![]});if(!_0x5be4d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5be4d4[_0x7c02('0x5a')]===_0x7c02('0x58')){return db['UserProfileSection'][_0x7c02('0x49')]({'where':{'name':'Agents','userProfileId':_0x5be4d4['userProfileId']},'raw':!![]})[_0x7c02('0x2a')](function(_0x3b3ff0){if(_0x3b3ff0){if(_0x3b3ff0[_0x7c02('0x63')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3b3ff0['id']},'raw':!![]})['then'](function(_0x135ee1){var _0xae15cc=[];if(_[_0x7c02('0x64')](_0x135ee1)){_0xae15cc=_[_0x7c02('0x41')](_0x3b1bb7,function(_0x27237e){if(_0x27237e['role']!=='agent'){return _0x27237e;}});return _0xae15cc;}else{for(var _0x3e48d8=0x0;_0x3e48d8<_0x3b1bb7['length'];_0x3e48d8++){var _0x2a7dcb=_0x3b1bb7[_0x3e48d8];if(_0x2a7dcb[_0x7c02('0x5a')]===_0x7c02('0x65')){var _0xe5f2c4=_['find'](_0x135ee1,function(_0xaf7391){return _0xaf7391[_0x7c02('0x66')]===_0x2a7dcb['id'];});if(_0xe5f2c4)_0xae15cc['push'](_0x2a7dcb);}else{_0xae15cc[_0x7c02('0x67')](_0x2a7dcb);}}return _0xae15cc;}});}else{return _0x3b1bb7;}}else{var _0x3ef451=_[_0x7c02('0x41')](_0x3b1bb7,function(_0x47c902){if(_0x47c902[_0x7c02('0x5a')]!==_0x7c02('0x65')){return _0x47c902;}});return _0x3ef451;}});}else{return _0x3b1bb7;}}})[_0x7c02('0x2a')](function(_0x54d075){var _0x36f622=[];if(_0x54d075){_0x29bde6=_0x54d075;for(var _0x2a6e5b=0x0;_0x2a6e5b<_0x54d075[_0x7c02('0x3b')];_0x2a6e5b+=0x1){_0x29bde6[_0x2a6e5b][_0x7c02('0x50')]=[];_0x36f622[_0x7c02('0x67')](db['ChatInternalMessage'][_0x7c02('0x49')]({'where':{'FromId':[_0xe8b756[_0x7c02('0x58')]['id'],_0x54d075[_0x2a6e5b]['id']],'ToId':[_0xe8b756[_0x7c02('0x58')]['id'],_0x54d075[_0x2a6e5b]['id']],'ChatGroupId':null},'attributes':['id',_0x7c02('0x52'),'FromId',_0x7c02('0x68'),_0x7c02('0x69'),'body'],'order':qs[_0x7c02('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7c02('0x2a')](wrapUser(_0x54d075[_0x2a6e5b])));}return BPromise[_0x7c02('0x6a')](_0x36f622);}return[];})[_0x7c02('0x2a')](function(_0x20121c){return{'rows':_0x20121c,'count':_0x20121c[_0x7c02('0x3b')]};})[_0x7c02('0x2a')](respondWithResult(_0x4d763d,null))[_0x7c02('0x4a')](handleError(_0x4d763d,null));};
\ No newline at end of file
+var _0xd2ec=['bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','sendStatus','status','json','limit','undefined','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','agent','admin','fullname','role','userpic','lastLoginAt','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','user','FromId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2ec,0x1bb));var _0xcd2e=function(_0x3e2810,_0x104d34){_0x3e2810=_0x3e2810-0x0;var _0x577d18=_0xd2ec[_0x3e2810];return _0x577d18;};'use strict';var emlformat=require(_0xcd2e('0x0'));var rimraf=require(_0xcd2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd2e('0x2'));var rp=require(_0xcd2e('0x3'));var moment=require(_0xcd2e('0x4'));var BPromise=require(_0xcd2e('0x5'));var Mustache=require('mustache');var util=require(_0xcd2e('0x6'));var path=require(_0xcd2e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcd2e('0x8'));var fs=require('fs');var fs_extra=require(_0xcd2e('0x9'));var _=require(_0xcd2e('0xa'));var squel=require('squel');var crypto=require(_0xcd2e('0xb'));var jsforce=require(_0xcd2e('0xc'));var deskjs=require(_0xcd2e('0xd'));var toCsv=require(_0xcd2e('0xe'));var querystring=require(_0xcd2e('0xf'));var Papa=require(_0xcd2e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd2e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd2e('0x12'));var logger=require(_0xcd2e('0x13'))(_0xcd2e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcd2e('0x15'));var db=require(_0xcd2e('0x16'))['db'];config[_0xcd2e('0x17')]=_[_0xcd2e('0x18')](config['redis'],{'host':_0xcd2e('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcd2e('0x1a'))['register'](socket);function respondWithStatusCode(_0x789704,_0x5708cb){_0x5708cb=_0x5708cb||0xcc;return function(_0x4922a5){if(_0x4922a5){return _0x789704[_0xcd2e('0x1b')](_0x5708cb);}return _0x789704[_0xcd2e('0x1c')](_0x5708cb)['end']();};}function respondWithResult(_0x3d1ba8,_0x4713dd){_0x4713dd=_0x4713dd||0xc8;return function(_0x2970c1){if(_0x2970c1){return _0x3d1ba8['status'](_0x4713dd)[_0xcd2e('0x1d')](_0x2970c1);}};}function respondWithFilteredResult(_0x51a210,_0x3d8072){return function(_0x24a02f){if(_0x24a02f){var _0x4a5e37=typeof _0x3d8072['offset']==='undefined'&&typeof _0x3d8072[_0xcd2e('0x1e')]===_0xcd2e('0x1f');var _0xba33b4=_0x24a02f[_0xcd2e('0x20')];var _0x397229=_0x4a5e37?0x0:_0x3d8072['offset'];var _0x512eb2=_0x4a5e37?_0x24a02f[_0xcd2e('0x20')]:_0x3d8072['offset']+_0x3d8072[_0xcd2e('0x1e')];var _0x402540;if(_0x512eb2>=_0xba33b4){_0x512eb2=_0xba33b4;_0x402540=0xc8;}else{_0x402540=0xce;}_0x51a210[_0xcd2e('0x1c')](_0x402540);return _0x51a210[_0xcd2e('0x21')](_0xcd2e('0x22'),_0x397229+'-'+_0x512eb2+'/'+_0xba33b4)['json'](_0x24a02f);}return null;};}function patchUpdates(_0x545918){return function(_0x3238c3){try{jsonpatch['apply'](_0x3238c3,_0x545918,!![]);}catch(_0x579fbf){return BPromise[_0xcd2e('0x23')](_0x579fbf);}return _0x3238c3[_0xcd2e('0x24')]();};}function saveUpdates(_0x137967,_0x5cd389){return function(_0x316d93){if(_0x316d93){return _0x316d93[_0xcd2e('0x25')](_0x137967)[_0xcd2e('0x26')](function(_0x501c93){return _0x501c93;});}return null;};}function removeEntity(_0x2b57ff,_0x231c01){return function(_0x5d7f87){if(_0x5d7f87){return _0x5d7f87['destroy']()[_0xcd2e('0x26')](function(){_0x2b57ff['status'](0xcc)[_0xcd2e('0x27')]();});}};}function handleEntityNotFound(_0x5e0ac1,_0x300677){return function(_0x41f3f6){if(!_0x41f3f6){_0x5e0ac1[_0xcd2e('0x1b')](0x194);}return _0x41f3f6;};}function handleError(_0x5eaa9f,_0x38fe88){_0x38fe88=_0x38fe88||0x1f4;return function(_0x1f15da){logger[_0xcd2e('0x28')](_0x1f15da[_0xcd2e('0x29')]);if(_0x1f15da[_0xcd2e('0x2a')]){delete _0x1f15da[_0xcd2e('0x2a')];}_0x5eaa9f[_0xcd2e('0x1c')](_0x38fe88)[_0xcd2e('0x2b')](_0x1f15da);};}exports[_0xcd2e('0x2c')]=function(_0xb20524,_0x40cb69){var _0x2f70a0={},_0x1c0b91={},_0x454831={'count':0x0,'rows':[]};var _0x17c234=_[_0xcd2e('0x2d')](db[_0xcd2e('0x2e')][_0xcd2e('0x2f')],function(_0x2842f8){return{'name':_0x2842f8[_0xcd2e('0x30')],'type':_0x2842f8[_0xcd2e('0x31')][_0xcd2e('0x32')]};});_0x1c0b91['model']=_['map'](_0x17c234,_0xcd2e('0x2a'));_0x1c0b91[_0xcd2e('0x33')]=_['keys'](_0xb20524['query']);_0x1c0b91[_0xcd2e('0x34')]=_[_0xcd2e('0x35')](_0x1c0b91['model'],_0x1c0b91['query']);_0x2f70a0[_0xcd2e('0x36')]=_[_0xcd2e('0x35')](_0x1c0b91[_0xcd2e('0x37')],qs[_0xcd2e('0x38')](_0xb20524['query'][_0xcd2e('0x38')]));_0x2f70a0[_0xcd2e('0x36')]=_0x2f70a0[_0xcd2e('0x36')]['length']?_0x2f70a0['attributes']:_0x1c0b91[_0xcd2e('0x37')];if(!_0xb20524[_0xcd2e('0x33')][_0xcd2e('0x39')](_0xcd2e('0x3a'))){_0x2f70a0[_0xcd2e('0x1e')]=qs[_0xcd2e('0x1e')](_0xb20524['query']['limit']);_0x2f70a0[_0xcd2e('0x3b')]=qs[_0xcd2e('0x3b')](_0xb20524[_0xcd2e('0x33')][_0xcd2e('0x3b')]);}_0x2f70a0[_0xcd2e('0x3c')]=qs[_0xcd2e('0x3d')](_0xb20524['query'][_0xcd2e('0x3d')]);_0x2f70a0[_0xcd2e('0x3e')]=qs[_0xcd2e('0x34')](_[_0xcd2e('0x3f')](_0xb20524['query'],_0x1c0b91['filters']),_0x17c234);if(_0xb20524[_0xcd2e('0x33')][_0xcd2e('0x40')]){_0x2f70a0[_0xcd2e('0x3e')]=_[_0xcd2e('0x41')](_0x2f70a0['where'],{'$or':_['map'](_0x17c234,function(_0x3b08eb){if(_0x3b08eb[_0xcd2e('0x31')]!==_0xcd2e('0x42')){var _0x8d3b71={};_0x8d3b71[_0x3b08eb['name']]={'$like':'%'+_0xb20524[_0xcd2e('0x33')][_0xcd2e('0x40')]+'%'};return _0x8d3b71;}})});}_0x2f70a0=_[_0xcd2e('0x41')]({},_0x2f70a0,_0xb20524['options']);var _0x86bc21={'where':_0x2f70a0[_0xcd2e('0x3e')]};return db[_0xcd2e('0x2e')][_0xcd2e('0x20')](_0x86bc21)['then'](function(_0x591390){_0x454831[_0xcd2e('0x20')]=_0x591390;if(_0xb20524[_0xcd2e('0x33')][_0xcd2e('0x43')]){_0x2f70a0[_0xcd2e('0x44')]=[{'all':!![]}];}return db[_0xcd2e('0x2e')][_0xcd2e('0x45')](_0x2f70a0);})[_0xcd2e('0x26')](function(_0x5a80c0){_0x454831[_0xcd2e('0x46')]=_0x5a80c0;return _0x454831;})['then'](respondWithFilteredResult(_0x40cb69,_0x2f70a0))[_0xcd2e('0x47')](handleError(_0x40cb69,null));};exports[_0xcd2e('0x48')]=function(_0x29443b,_0x47ab6f){var _0xe589e9={'raw':!![],'where':{'id':_0x29443b[_0xcd2e('0x49')]['id']}},_0x4459d4={};_0x4459d4[_0xcd2e('0x37')]=_[_0xcd2e('0x4a')](db[_0xcd2e('0x2e')][_0xcd2e('0x2f')]);_0x4459d4[_0xcd2e('0x33')]=_[_0xcd2e('0x4a')](_0x29443b['query']);_0x4459d4[_0xcd2e('0x34')]=_[_0xcd2e('0x35')](_0x4459d4[_0xcd2e('0x37')],_0x4459d4[_0xcd2e('0x33')]);_0xe589e9[_0xcd2e('0x36')]=_[_0xcd2e('0x35')](_0x4459d4[_0xcd2e('0x37')],qs[_0xcd2e('0x38')](_0x29443b[_0xcd2e('0x33')]['fields']));_0xe589e9[_0xcd2e('0x36')]=_0xe589e9['attributes'][_0xcd2e('0x4b')]?_0xe589e9[_0xcd2e('0x36')]:_0x4459d4['model'];if(_0x29443b[_0xcd2e('0x33')]['includeAll']){_0xe589e9['include']=[{'all':!![]}];}_0xe589e9=_[_0xcd2e('0x41')]({},_0xe589e9,_0x29443b[_0xcd2e('0x4c')]);return db[_0xcd2e('0x2e')][_0xcd2e('0x4d')](_0xe589e9)[_0xcd2e('0x26')](handleEntityNotFound(_0x47ab6f,null))['then'](respondWithResult(_0x47ab6f,null))[_0xcd2e('0x47')](handleError(_0x47ab6f,null));};exports[_0xcd2e('0x4e')]=function(_0x4ea9e7,_0x2a4498){return db[_0xcd2e('0x2e')][_0xcd2e('0x4e')](_0x4ea9e7[_0xcd2e('0x4f')],{})[_0xcd2e('0x26')](respondWithResult(_0x2a4498,0xc9))['catch'](handleError(_0x2a4498,null));};exports[_0xcd2e('0x25')]=function(_0x3a0cd0,_0x5b87aa){if(_0x3a0cd0[_0xcd2e('0x4f')]['id']){delete _0x3a0cd0[_0xcd2e('0x4f')]['id'];}return db[_0xcd2e('0x2e')][_0xcd2e('0x4d')]({'where':{'id':_0x3a0cd0['params']['id']}})['then'](handleEntityNotFound(_0x5b87aa,null))[_0xcd2e('0x26')](saveUpdates(_0x3a0cd0['body'],null))[_0xcd2e('0x26')](respondWithResult(_0x5b87aa,null))[_0xcd2e('0x47')](handleError(_0x5b87aa,null));};exports[_0xcd2e('0x50')]=function(_0x4d302b,_0x55d8ca){return db[_0xcd2e('0x2e')][_0xcd2e('0x4d')]({'where':{'id':_0x4d302b[_0xcd2e('0x49')]['id']}})[_0xcd2e('0x26')](handleEntityNotFound(_0x55d8ca,null))['then'](removeEntity(_0x55d8ca,null))[_0xcd2e('0x47')](handleError(_0x55d8ca,null));};exports[_0xcd2e('0x51')]=function(_0xaba908,_0x5afe7d){return db[_0xcd2e('0x2e')][_0xcd2e('0x51')]()['then'](respondWithResult(_0x5afe7d,null))[_0xcd2e('0x47')](handleError(_0x5afe7d,null));};function wrapUser(_0x4a42de){return function(_0x313884){var _0x37843d=_0x4a42de[_0xcd2e('0x52')]({'plain':!![]});_0x37843d[_0xcd2e('0x53')]=[];if(_0x313884){_0x37843d[_0xcd2e('0x54')]=_0x313884[_0xcd2e('0x55')];_0x37843d['lastMessage']=_0x313884;}else{_0x37843d['lastMessageAt']=moment(0x0)[_0xcd2e('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x37843d[_0xcd2e('0x57')]={};}return _0x37843d;};}exports[_0xcd2e('0x58')]=function(_0x2309a0,_0x135d9d,_0x23d6b0){var _0x41e4ad=[];return db[_0xcd2e('0x59')][_0xcd2e('0x45')]({'where':{'role':[_0xcd2e('0x5a'),_0xcd2e('0x5b'),'user']},'attributes':['id',_0xcd2e('0x5c'),_0xcd2e('0x2a'),_0xcd2e('0x5d'),_0xcd2e('0x5e'),'internal','online',_0xcd2e('0x5f'),'allowmessenger',_0xcd2e('0x60')],'order':qs[_0xcd2e('0x3d')]('-online'),'include':[{'model':db[_0xcd2e('0x61')],'as':'VoiceQueues','attributes':['id','name',_0xcd2e('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x21cd5f){if(_0x21cd5f){var _0x2697a7=_0x2309a0['user']['get']({'plain':!![]});if(!_0x2697a7)throw new Error(_0xcd2e('0x62'));if(_0x2697a7['role']==='user'){return db[_0xcd2e('0x63')][_0xcd2e('0x4d')]({'where':{'name':_0xcd2e('0x64'),'userProfileId':_0x2697a7[_0xcd2e('0x65')]},'raw':!![]})[_0xcd2e('0x26')](function(_0x218c9b){if(_0x218c9b){if(_0x218c9b[_0xcd2e('0x66')]===0x0){return db[_0xcd2e('0x67')][_0xcd2e('0x45')]({'where':{'sectionId':_0x218c9b['id']},'raw':!![]})[_0xcd2e('0x26')](function(_0x15558f){var _0x4aadcf=[];if(_[_0xcd2e('0x68')](_0x15558f)){_0x4aadcf=_[_0xcd2e('0x40')](_0x21cd5f,function(_0x2cc612){if(_0x2cc612['role']!==_0xcd2e('0x5a')){return _0x2cc612;}});return _0x4aadcf;}else{for(var _0x5e2092=0x0;_0x5e2092<_0x21cd5f[_0xcd2e('0x4b')];_0x5e2092++){var _0x465004=_0x21cd5f[_0x5e2092];if(_0x465004[_0xcd2e('0x5d')]===_0xcd2e('0x5a')){var _0x2c18d1=_[_0xcd2e('0x4d')](_0x15558f,function(_0x534ac1){return _0x534ac1[_0xcd2e('0x69')]===_0x465004['id'];});if(_0x2c18d1)_0x4aadcf[_0xcd2e('0x6a')](_0x465004);}else{_0x4aadcf[_0xcd2e('0x6a')](_0x465004);}}return _0x4aadcf;}});}else{return _0x21cd5f;}}else{var _0x4518e8=_['filter'](_0x21cd5f,function(_0x5d9956){if(_0x5d9956[_0xcd2e('0x5d')]!=='agent'){return _0x5d9956;}});return _0x4518e8;}});}else{return _0x21cd5f;}}})[_0xcd2e('0x26')](function(_0x4c35cf){var _0x1232fc=[];if(_0x4c35cf){_0x41e4ad=_0x4c35cf;for(var _0x34c2e8=0x0;_0x34c2e8<_0x4c35cf[_0xcd2e('0x4b')];_0x34c2e8+=0x1){_0x41e4ad[_0x34c2e8][_0xcd2e('0x53')]=[];_0x1232fc[_0xcd2e('0x6a')](db[_0xcd2e('0x2e')][_0xcd2e('0x4d')]({'where':{'FromId':[_0x2309a0['user']['id'],_0x4c35cf[_0x34c2e8]['id']],'ToId':[_0x2309a0[_0xcd2e('0x6b')]['id'],_0x4c35cf[_0x34c2e8]['id']],'ChatGroupId':null},'attributes':['id',_0xcd2e('0x55'),_0xcd2e('0x6c'),'ToId',_0xcd2e('0x6d'),_0xcd2e('0x4f')],'order':qs[_0xcd2e('0x3d')](_0xcd2e('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xcd2e('0x26')](wrapUser(_0x4c35cf[_0x34c2e8])));}return BPromise[_0xcd2e('0x6f')](_0x1232fc);}return[];})[_0xcd2e('0x26')](function(_0x59d93e){return{'rows':_0x59d93e,'count':_0x59d93e['length']};})['then'](respondWithResult(_0x135d9d,null))['catch'](handleError(_0x135d9d,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 72aa08f..b1cf8ad 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 _0xbde6=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x36055a,_0x55613a){var _0x1eb71f=function(_0x489fc4){while(--_0x489fc4){_0x36055a['push'](_0x36055a['shift']());}};_0x1eb71f(++_0x55613a);}(_0xbde6,0xae));var _0x6bde=function(_0x14c606,_0x4d97f1){_0x14c606=_0x14c606-0x0;var _0x34fe6e=_0xbde6[_0x14c606];return _0x34fe6e;};'use strict';var EventEmitter=require(_0x6bde('0x0'));var ChatInternalMessage=require(_0x6bde('0x1'))['db'][_0x6bde('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6bde('0x3')](0x0);var events={'afterCreate':_0x6bde('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x185367){return function(_0x1e95b2,_0x24b635,_0x291732){ChatInternalMessageEvents[_0x6bde('0x5')](_0x185367+':'+_0x1e95b2['id'],_0x1e95b2);ChatInternalMessageEvents[_0x6bde('0x5')](_0x185367,_0x1e95b2);_0x291732(null);};}for(var e in events){if(events[_0x6bde('0x6')](e)){var event=events[e];ChatInternalMessage[_0x6bde('0x7')](e,emitEvent(event));}}module[_0x6bde('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x0476=['ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x33ad1f,_0xfc2fc8){var _0x26ef22=function(_0x58f97c){while(--_0x58f97c){_0x33ad1f['push'](_0x33ad1f['shift']());}};_0x26ef22(++_0xfc2fc8);}(_0x0476,0x177));var _0x6047=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x0476[_0x17406e];return _0x2bfc5a;};'use strict';var EventEmitter=require(_0x6047('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x6047('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6047('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6047('0x3'),'afterDestroy':_0x6047('0x4')};function emitEvent(_0x4eea46){return function(_0x1d37b6,_0x55a1ee,_0x21e0c8){ChatInternalMessageEvents[_0x6047('0x5')](_0x4eea46+':'+_0x1d37b6['id'],_0x1d37b6);ChatInternalMessageEvents[_0x6047('0x5')](_0x4eea46,_0x1d37b6);_0x21e0c8(null);};}for(var e in events){if(events[_0x6047('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x6047('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 0adcf13..e9e0ea0 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 _0x1135=['moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xaf0e4c,_0x4760ab){var _0x28b3f9=function(_0xc36c19){while(--_0xc36c19){_0xaf0e4c['push'](_0xaf0e4c['shift']());}};_0x28b3f9(++_0x4760ab);}(_0x1135,0x1b7));var _0x5113=function(_0x16ba90,_0x108eb7){_0x16ba90=_0x16ba90-0x0;var _0x2bc281=_0x1135[_0x16ba90];return _0x2bc281;};'use strict';var _=require(_0x5113('0x0'));var util=require(_0x5113('0x1'));var logger=require(_0x5113('0x2'))('api');var moment=require(_0x5113('0x3'));var BPromise=require('bluebird');var rp=require(_0x5113('0x4'));var fs=require('fs');var path=require(_0x5113('0x5'));var rimraf=require(_0x5113('0x6'));var config=require(_0x5113('0x7'));var attributes=require(_0x5113('0x8'));module[_0x5113('0x9')]=function(_0x1fcd0d,_0xb8fccd){return _0x1fcd0d[_0x5113('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5113('0xb'),'collate':_0x5113('0xc')});};
\ No newline at end of file
+var _0x183c=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x589274,_0xa3f1bd){var _0x21814b=function(_0x221253){while(--_0x221253){_0x589274['push'](_0x589274['shift']());}};_0x21814b(++_0xa3f1bd);}(_0x183c,0x1d5));var _0xc183=function(_0x5590da,_0x593a64){_0x5590da=_0x5590da-0x0;var _0x1aae1f=_0x183c[_0x5590da];return _0x1aae1f;};'use strict';var _=require(_0xc183('0x0'));var util=require('util');var logger=require(_0xc183('0x1'))('api');var moment=require(_0xc183('0x2'));var BPromise=require(_0xc183('0x3'));var rp=require(_0xc183('0x4'));var fs=require('fs');var path=require(_0xc183('0x5'));var rimraf=require(_0xc183('0x6'));var config=require(_0xc183('0x7'));var attributes=require(_0xc183('0x8'));module[_0xc183('0x9')]=function(_0x45321e,_0x1c7ac0){return _0x45321e[_0xc183('0xa')](_0xc183('0xb'),attributes,{'tableName':_0xc183('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc183('0xd'),'collate':_0xc183('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 4b27c2f..212529e 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 _0xdadf=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','request','then','info','request\x20sent','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x20bcef,_0x55607f){var _0x372a1d=function(_0x2c9b3e){while(--_0x2c9b3e){_0x20bcef['push'](_0x20bcef['shift']());}};_0x372a1d(++_0x55607f);}(_0xdadf,0xc8));var _0xfdad=function(_0x47bf5b,_0x4531da){_0x47bf5b=_0x47bf5b-0x0;var _0x34edac=_0xdadf[_0x47bf5b];return _0x34edac;};'use strict';var _=require(_0xfdad('0x0'));var util=require('util');var moment=require(_0xfdad('0x1'));var BPromise=require(_0xfdad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfdad('0x3'));var db=require(_0xfdad('0x4'))['db'];var utils=require(_0xfdad('0x5'));var logger=require(_0xfdad('0x6'))(_0xfdad('0x7'));var config=require(_0xfdad('0x8'));var jayson=require(_0xfdad('0x9'));var client=jayson['client'][_0xfdad('0xa')]({'port':0x232a});config[_0xfdad('0xb')]=_[_0xfdad('0xc')](config[_0xfdad('0xb')],{'host':_0xfdad('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdad('0xb')]));require(_0xfdad('0xe'))['register'](socket);function respondWithRpcPromise(_0xc5be48,_0x5889cd,_0x546cb9){return new BPromise(function(_0x48ee1e,_0x413a62){return client[_0xfdad('0xf')](_0xc5be48,_0x546cb9)[_0xfdad('0x10')](function(_0x29049c){logger[_0xfdad('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x5889cd,_0xfdad('0x12'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5889cd,_0xfdad('0x12'),JSON['stringify'](_0x29049c));if(_0x29049c[_0xfdad('0x13')]){if(_0x29049c['error'][_0xfdad('0x14')]===0x1f4){logger[_0xfdad('0x13')](_0xfdad('0x15'),_0x5889cd,_0x29049c['error'][_0xfdad('0x16')]);return _0x413a62(_0x29049c['error'][_0xfdad('0x16')]);}logger['error'](_0xfdad('0x15'),_0x5889cd,_0x29049c[_0xfdad('0x13')][_0xfdad('0x16')]);return _0x48ee1e(_0x29049c[_0xfdad('0x13')][_0xfdad('0x16')]);}else{logger['info'](_0xfdad('0x15'),_0x5889cd,_0xfdad('0x12'));_0x48ee1e(_0x29049c[_0xfdad('0x17')][_0xfdad('0x16')]);}})[_0xfdad('0x18')](function(_0x47cd2d){logger['error'](_0xfdad('0x15'),_0x5889cd,_0x47cd2d);_0x413a62(_0x47cd2d);});});}
\ No newline at end of file
+var _0x5c85=['then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','register','request'];(function(_0x51d7ee,_0x3493f6){var _0x1cf6f1=function(_0x29916f){while(--_0x29916f){_0x51d7ee['push'](_0x51d7ee['shift']());}};_0x1cf6f1(++_0x3493f6);}(_0x5c85,0xc1));var _0x55c8=function(_0x5bd136,_0x319250){_0x5bd136=_0x5bd136-0x0;var _0x1d4337=_0x5c85[_0x5bd136];return _0x1d4337;};'use strict';var _=require(_0x55c8('0x0'));var util=require(_0x55c8('0x1'));var moment=require(_0x55c8('0x2'));var BPromise=require(_0x55c8('0x3'));var rs=require(_0x55c8('0x4'));var fs=require('fs');var Redis=require(_0x55c8('0x5'));var db=require(_0x55c8('0x6'))['db'];var utils=require(_0x55c8('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x55c8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x55c8('0x9')]({'port':0x232a});config[_0x55c8('0xa')]=_[_0x55c8('0xb')](config['redis'],{'host':_0x55c8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x55c8('0xa')]));require('./chatInternalMessage.socket')[_0x55c8('0xd')](socket);function respondWithRpcPromise(_0x316791,_0x80f28e,_0x3064dc){return new BPromise(function(_0x26ed35,_0x1e548d){return client[_0x55c8('0xe')](_0x316791,_0x3064dc)[_0x55c8('0xf')](function(_0x3f994f){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x80f28e,'request\x20sent');logger[_0x55c8('0x10')](_0x55c8('0x11'),_0x80f28e,_0x55c8('0x12'),JSON[_0x55c8('0x13')](_0x3f994f));if(_0x3f994f[_0x55c8('0x14')]){if(_0x3f994f[_0x55c8('0x14')]['code']===0x1f4){logger['error'](_0x55c8('0x15'),_0x80f28e,_0x3f994f[_0x55c8('0x14')][_0x55c8('0x16')]);return _0x1e548d(_0x3f994f['error'][_0x55c8('0x16')]);}logger[_0x55c8('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x80f28e,_0x3f994f[_0x55c8('0x14')]['message']);return _0x26ed35(_0x3f994f[_0x55c8('0x14')][_0x55c8('0x16')]);}else{logger[_0x55c8('0x17')](_0x55c8('0x15'),_0x80f28e,_0x55c8('0x12'));_0x26ed35(_0x3f994f[_0x55c8('0x18')]['message']);}})[_0x55c8('0x19')](function(_0x1e83ef){logger[_0x55c8('0x14')](_0x55c8('0x15'),_0x80f28e,_0x1e83ef);_0x1e548d(_0x1e83ef);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4031087..008e2cb 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 _0x7f2e=['removeListener','chatInternalMessage:','./chatInternalMessage.events','remove','emit'];(function(_0x34fe2c,_0x3c12cc){var _0x4fef94=function(_0x761711){while(--_0x761711){_0x34fe2c['push'](_0x34fe2c['shift']());}};_0x4fef94(++_0x3c12cc);}(_0x7f2e,0x19c));var _0xe7f2=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x7f2e[_0x225f50];return _0x19d003;};'use strict';var ChatInternalMessageEvents=require(_0xe7f2('0x0'));var events=['save',_0xe7f2('0x1'),'update'];function createListener(_0x210ba0,_0x4fc5b3){return function(_0x4ad911){_0x4fc5b3[_0xe7f2('0x2')](_0x210ba0,_0x4ad911);};}function removeListener(_0x3c08cb,_0x1c5630){return function(){ChatInternalMessageEvents[_0xe7f2('0x3')](_0x3c08cb,_0x1c5630);};}exports['register']=function(_0x2de62f){for(var _0x14958f=0x0,_0xea3769=events['length'];_0x14958f<_0xea3769;_0x14958f++){var _0x15beaf=events[_0x14958f];var _0x329198=createListener(_0xe7f2('0x4')+_0x15beaf,_0x2de62f);ChatInternalMessageEvents['on'](_0x15beaf,_0x329198);}};
\ No newline at end of file
+var _0x9a9b=['save','remove','update','register','length','./chatInternalMessage.events'];(function(_0x3c1b2c,_0xc1c9e7){var _0x107d5b=function(_0x588383){while(--_0x588383){_0x3c1b2c['push'](_0x3c1b2c['shift']());}};_0x107d5b(++_0xc1c9e7);}(_0x9a9b,0x185));var _0xb9a9=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x9a9b[_0xdd2bfa];return _0x55397e;};'use strict';var ChatInternalMessageEvents=require(_0xb9a9('0x0'));var events=[_0xb9a9('0x1'),_0xb9a9('0x2'),_0xb9a9('0x3')];function createListener(_0x26a75a,_0x52d66e){return function(_0x27f0e7){_0x52d66e['emit'](_0x26a75a,_0x27f0e7);};}function removeListener(_0xa6806a,_0x13de64){return function(){ChatInternalMessageEvents['removeListener'](_0xa6806a,_0x13de64);};}exports[_0xb9a9('0x4')]=function(_0x54a064){for(var _0x37abe4=0x0,_0x19bb21=events[_0xb9a9('0x5')];_0x37abe4<_0x19bb21;_0x37abe4++){var _0x32601b=events[_0x37abe4];var _0x749923=createListener('chatInternalMessage:'+_0x32601b,_0x54a064);ChatInternalMessageEvents['on'](_0x32601b,_0x749923);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 6d27c2a..9a5b4b9 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 _0x2d3d=['delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','getUsers','/:id','show','post','create','put','update'];(function(_0x44adaf,_0xa3c961){var _0x1dad05=function(_0x5540e6){while(--_0x5540e6){_0x44adaf['push'](_0x44adaf['shift']());}};_0x1dad05(++_0xa3c961);}(_0x2d3d,0x1a3));var _0xd2d3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2d3d[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xd2d3('0x0'));var util=require(_0xd2d3('0x1'));var path=require(_0xd2d3('0x2'));var timeout=require(_0xd2d3('0x3'));var express=require(_0xd2d3('0x4'));var router=express[_0xd2d3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd2d3('0x6'));var interaction=require(_0xd2d3('0x7'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xd2d3('0x8')]('/',auth[_0xd2d3('0x9')](),controller['index']);router[_0xd2d3('0x8')]('/describe',auth[_0xd2d3('0x9')](),controller[_0xd2d3('0xa')]);router[_0xd2d3('0x8')]('/users',auth[_0xd2d3('0x9')](),controller[_0xd2d3('0xb')]);router[_0xd2d3('0x8')](_0xd2d3('0xc'),auth['isAuthenticated'](),controller[_0xd2d3('0xd')]);router[_0xd2d3('0xe')]('/',auth['isAuthenticated'](),controller[_0xd2d3('0xf')]);router[_0xd2d3('0x10')](_0xd2d3('0xc'),controller[_0xd2d3('0x11')]);router[_0xd2d3('0x12')](_0xd2d3('0xc'),auth[_0xd2d3('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x357f=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/users','getUsers','/:id','show','create','put','delete','destroy','exports','util'];(function(_0x2ffe16,_0x11955f){var _0x35a747=function(_0x33e76f){while(--_0x33e76f){_0x2ffe16['push'](_0x2ffe16['shift']());}};_0x35a747(++_0x11955f);}(_0x357f,0x77));var _0xf357=function(_0x114896,_0x3a741a){_0x114896=_0x114896-0x0;var _0x3f0136=_0x357f[_0x114896];return _0x3f0136;};'use strict';var multer=require('multer');var util=require(_0xf357('0x0'));var path=require(_0xf357('0x1'));var timeout=require(_0xf357('0x2'));var express=require('express');var router=express[_0xf357('0x3')]();var fs_extra=require(_0xf357('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf357('0x5'));var config=require(_0xf357('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xf357('0x7')]('/',auth['isAuthenticated'](),controller[_0xf357('0x8')]);router[_0xf357('0x7')](_0xf357('0x9'),auth[_0xf357('0xa')](),controller['describe']);router[_0xf357('0x7')](_0xf357('0xb'),auth[_0xf357('0xa')](),controller[_0xf357('0xc')]);router[_0xf357('0x7')](_0xf357('0xd'),auth[_0xf357('0xa')](),controller[_0xf357('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf357('0xf')]);router[_0xf357('0x10')](_0xf357('0xd'),controller['update']);router[_0xf357('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf357('0x12')]);module[_0xf357('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index fdfd7f8..94aa744 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 _0xc224=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x3afeda,_0x4b249f){var _0xb4c759=function(_0x4db382){while(--_0x4db382){_0x3afeda['push'](_0x3afeda['shift']());}};_0xb4c759(++_0x4b249f);}(_0xc224,0x1af));var _0x4c22=function(_0x5614ed,_0x180602){_0x5614ed=_0x5614ed-0x0;var _0xd0b252=_0xc224[_0x5614ed];return _0xd0b252;};'use strict';var Sequelize=require(_0x4c22('0x0'));module[_0x4c22('0x1')]={'body':{'type':Sequelize[_0x4c22('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4c22('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4c22('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4c22('0x4')]('in',_0x4c22('0x5')),'defaultValue':_0x4c22('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4c22('0x6')]},'providerName':{'type':Sequelize[_0x4c22('0x7')]},'providerResponse':{'type':Sequelize[_0x4c22('0x2')]}};
\ No newline at end of file
+var _0xb921=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x2d51cc,_0x2ca3e2){var _0x3dc46b=function(_0x14bc3b){while(--_0x14bc3b){_0x2d51cc['push'](_0x2d51cc['shift']());}};_0x3dc46b(++_0x2ca3e2);}(_0xb921,0x16a));var _0x1b92=function(_0x1b58b8,_0x3e1c2a){_0x1b58b8=_0x1b58b8-0x0;var _0x479502=_0xb921[_0x1b58b8];return _0x479502;};'use strict';var Sequelize=require(_0x1b92('0x0'));module[_0x1b92('0x1')]={'body':{'type':Sequelize[_0x1b92('0x2')](_0x1b92('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1b92('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1b92('0x5')),'defaultValue':_0x1b92('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1b92('0x6')]},'providerName':{'type':Sequelize[_0x1b92('0x7')]},'providerResponse':{'type':Sequelize[_0x1b92('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 55c5125..fb65375 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 _0xeddd=['user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','motionChannel','reject','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','create','update','body','params','describe','chat-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x292fbe,_0x1148ec){var _0x53ddce=function(_0x1890e5){while(--_0x1890e5){_0x292fbe['push'](_0x292fbe['shift']());}};_0x53ddce(++_0x1148ec);}(_0xeddd,0xa8));var _0xdedd=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xeddd[_0x45d55e];return _0x29812a;};'use strict';var emlformat=require(_0xdedd('0x0'));var rimraf=require(_0xdedd('0x1'));var zipdir=require(_0xdedd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdedd('0x3'));var moment=require('moment');var BPromise=require(_0xdedd('0x4'));var Mustache=require(_0xdedd('0x5'));var util=require(_0xdedd('0x6'));var path=require(_0xdedd('0x7'));var sox=require(_0xdedd('0x8'));var csv=require(_0xdedd('0x9'));var ejs=require(_0xdedd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdedd('0xb'));var squel=require('squel');var crypto=require(_0xdedd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdedd('0xd'));var toCsv=require(_0xdedd('0x9'));var querystring=require(_0xdedd('0xe'));var Papa=require(_0xdedd('0xf'));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(_0xdedd('0x10'));var logger=require(_0xdedd('0x11'))(_0xdedd('0x12'));var utils=require(_0xdedd('0x13'));var config=require(_0xdedd('0x14'));var licenseUtil=require(_0xdedd('0x15'));var db=require(_0xdedd('0x16'))['db'];config[_0xdedd('0x17')]=_[_0xdedd('0x18')](config[_0xdedd('0x17')],{'host':_0xdedd('0x19'),'port':0x18eb});var socket=require(_0xdedd('0x1a'))(new Redis(config[_0xdedd('0x17')]));require(_0xdedd('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdedd('0x1c')][_0xdedd('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xdedd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x491595,_0x443358,_0x3d6f09,_0x228aa1){return new BPromise(function(_0x20bb0f,_0x447a06){var _0x263938=_0x228aa1||client;return _0x263938[_0xdedd('0x1e')](_0x491595,_0x3d6f09)[_0xdedd('0x1f')](function(_0x220d39){logger[_0xdedd('0x20')]('ChatMessage,\x20%s,\x20%s',_0x443358,_0xdedd('0x21'));logger[_0xdedd('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x443358,_0xdedd('0x21'),JSON[_0xdedd('0x23')](_0x220d39));if(_0x220d39[_0xdedd('0x24')]){if(_0x220d39[_0xdedd('0x24')][_0xdedd('0x25')]===0x1f4){logger[_0xdedd('0x24')](_0xdedd('0x26'),_0x443358,_0x220d39['error']['message']);return _0x447a06(_0x220d39[_0xdedd('0x24')][_0xdedd('0x27')]);}logger['error'](_0xdedd('0x26'),_0x443358,_0x220d39[_0xdedd('0x24')]['message']);return _0x20bb0f(_0x220d39[_0xdedd('0x24')][_0xdedd('0x27')]);}else{logger['info'](_0xdedd('0x26'),_0x443358,_0xdedd('0x21'));_0x20bb0f(_0x220d39[_0xdedd('0x28')][_0xdedd('0x27')]);}})[_0xdedd('0x29')](function(_0x1ef903){logger['error'](_0xdedd('0x26'),_0x443358,_0x1ef903);_0x447a06(_0x1ef903);});});}function respondWithStatusCode(_0x42c8f7,_0x4abc9e){_0x4abc9e=_0x4abc9e||0xcc;return function(_0x316a9b){if(_0x316a9b){return _0x42c8f7[_0xdedd('0x2a')](_0x4abc9e);}return _0x42c8f7[_0xdedd('0x2b')](_0x4abc9e)[_0xdedd('0x2c')]();};}function respondWithResult(_0x8a1418,_0x73d9de){_0x73d9de=_0x73d9de||0xc8;return function(_0x5f0a15){if(_0x5f0a15){return _0x8a1418[_0xdedd('0x2b')](_0x73d9de)[_0xdedd('0x2d')](_0x5f0a15);}};}function respondWithFilteredResult(_0xa7d00b,_0x1051c6){return function(_0x2f0a29){if(_0x2f0a29){var _0x5bb57f=typeof _0x1051c6['offset']===_0xdedd('0x2e')&&typeof _0x1051c6['limit']===_0xdedd('0x2e');var _0x18a75d=_0x2f0a29[_0xdedd('0x2f')];var _0x5370c8=_0x5bb57f?0x0:_0x1051c6[_0xdedd('0x30')];var _0x351624=_0x5bb57f?_0x2f0a29[_0xdedd('0x2f')]:_0x1051c6['offset']+_0x1051c6[_0xdedd('0x31')];var _0x456329;if(_0x351624>=_0x18a75d){_0x351624=_0x18a75d;_0x456329=0xc8;}else{_0x456329=0xce;}_0xa7d00b[_0xdedd('0x2b')](_0x456329);return _0xa7d00b[_0xdedd('0x32')](_0xdedd('0x33'),_0x5370c8+'-'+_0x351624+'/'+_0x18a75d)[_0xdedd('0x2d')](_0x2f0a29);}return null;};}function patchUpdates(_0x3fa081){return function(_0x38d046){try{jsonpatch[_0xdedd('0x34')](_0x38d046,_0x3fa081,!![]);}catch(_0xbba0f2){return BPromise['reject'](_0xbba0f2);}return _0x38d046[_0xdedd('0x35')]();};}function saveUpdates(_0x4aa293,_0x12857c){return function(_0x28b169){if(_0x28b169){return _0x28b169['update'](_0x4aa293)[_0xdedd('0x1f')](function(_0x475abf){return _0x475abf;});}return null;};}function removeEntity(_0x17b537,_0x521f19){return function(_0x593c63){if(_0x593c63){return _0x593c63[_0xdedd('0x36')]()['then'](function(){_0x17b537[_0xdedd('0x2b')](0xcc)[_0xdedd('0x2c')]();});}};}function handleEntityNotFound(_0x53cc94,_0x590a3a){return function(_0x198416){if(!_0x198416){_0x53cc94[_0xdedd('0x2a')](0x194);}return _0x198416;};}function handleError(_0x4715d3,_0x310ff1){_0x310ff1=_0x310ff1||0x1f4;return function(_0x4b88be){logger[_0xdedd('0x24')](_0x4b88be[_0xdedd('0x37')]);if(_0x4b88be['name']){delete _0x4b88be[_0xdedd('0x38')];}_0x4715d3['status'](_0x310ff1)[_0xdedd('0x39')](_0x4b88be);};}exports[_0xdedd('0x3a')]=function(_0x283886,_0x31837f){var _0x454d74={},_0xeb4285={},_0x2692fe={'count':0x0,'rows':[]};var _0x5a6779=_[_0xdedd('0x3b')](db[_0xdedd('0x3c')]['rawAttributes'],function(_0xadc8e1){return{'name':_0xadc8e1[_0xdedd('0x3d')],'type':_0xadc8e1[_0xdedd('0x3e')][_0xdedd('0x3f')]};});_0xeb4285[_0xdedd('0x40')]=_[_0xdedd('0x3b')](_0x5a6779,_0xdedd('0x38'));_0xeb4285[_0xdedd('0x41')]=_[_0xdedd('0x42')](_0x283886[_0xdedd('0x41')]);_0xeb4285[_0xdedd('0x43')]=_[_0xdedd('0x44')](_0xeb4285[_0xdedd('0x40')],_0xeb4285[_0xdedd('0x41')]);_0x454d74[_0xdedd('0x45')]=_[_0xdedd('0x44')](_0xeb4285[_0xdedd('0x40')],qs[_0xdedd('0x46')](_0x283886['query'][_0xdedd('0x46')]));_0x454d74[_0xdedd('0x45')]=_0x454d74[_0xdedd('0x45')][_0xdedd('0x47')]?_0x454d74[_0xdedd('0x45')]:_0xeb4285[_0xdedd('0x40')];if(!_0x283886[_0xdedd('0x41')]['hasOwnProperty'](_0xdedd('0x48'))){_0x454d74[_0xdedd('0x31')]=qs['limit'](_0x283886[_0xdedd('0x41')][_0xdedd('0x31')]);_0x454d74[_0xdedd('0x30')]=qs[_0xdedd('0x30')](_0x283886[_0xdedd('0x41')][_0xdedd('0x30')]);}_0x454d74[_0xdedd('0x49')]=qs[_0xdedd('0x4a')](_0x283886[_0xdedd('0x41')][_0xdedd('0x4a')]);_0x454d74[_0xdedd('0x4b')]=qs[_0xdedd('0x43')](_[_0xdedd('0x4c')](_0x283886[_0xdedd('0x41')],_0xeb4285[_0xdedd('0x43')]),_0x5a6779);if(_0x283886[_0xdedd('0x41')]['filter']){_0x454d74['where']=_[_0xdedd('0x4d')](_0x454d74['where'],{'$or':_['map'](_0x5a6779,function(_0x864f11){if(_0x864f11[_0xdedd('0x3e')]!==_0xdedd('0x4e')){var _0x3bfedc={};_0x3bfedc[_0x864f11[_0xdedd('0x38')]]={'$like':'%'+_0x283886[_0xdedd('0x41')][_0xdedd('0x4f')]+'%'};return _0x3bfedc;}})});}_0x454d74=_[_0xdedd('0x4d')]({},_0x454d74,_0x283886[_0xdedd('0x50')]);var _0x2e805d={'where':_0x454d74['where']};return db['ChatMessage'][_0xdedd('0x2f')](_0x2e805d)[_0xdedd('0x1f')](function(_0x374e06){_0x2692fe[_0xdedd('0x2f')]=_0x374e06;if(_0x283886['query'][_0xdedd('0x51')]){_0x454d74[_0xdedd('0x52')]=[{'all':!![]}];}return db[_0xdedd('0x3c')][_0xdedd('0x53')](_0x454d74);})[_0xdedd('0x1f')](function(_0xe39b0){_0x2692fe[_0xdedd('0x54')]=_0xe39b0;return _0x2692fe;})[_0xdedd('0x1f')](respondWithFilteredResult(_0x31837f,_0x454d74))[_0xdedd('0x29')](handleError(_0x31837f,null));};exports[_0xdedd('0x55')]=function(_0x227602,_0x7697a7){var _0x4932bd={'raw':!![],'where':{'id':_0x227602['params']['id']}},_0x4bfc9c={};_0x4bfc9c[_0xdedd('0x40')]=_[_0xdedd('0x42')](db[_0xdedd('0x3c')]['rawAttributes']);_0x4bfc9c[_0xdedd('0x41')]=_[_0xdedd('0x42')](_0x227602[_0xdedd('0x41')]);_0x4bfc9c[_0xdedd('0x43')]=_[_0xdedd('0x44')](_0x4bfc9c[_0xdedd('0x40')],_0x4bfc9c[_0xdedd('0x41')]);_0x4932bd['attributes']=_[_0xdedd('0x44')](_0x4bfc9c['model'],qs['fields'](_0x227602[_0xdedd('0x41')][_0xdedd('0x46')]));_0x4932bd['attributes']=_0x4932bd[_0xdedd('0x45')]['length']?_0x4932bd[_0xdedd('0x45')]:_0x4bfc9c[_0xdedd('0x40')];if(_0x227602['query'][_0xdedd('0x51')]){_0x4932bd[_0xdedd('0x52')]=[{'all':!![]}];}_0x4932bd=_['merge']({},_0x4932bd,_0x227602['options']);return db[_0xdedd('0x3c')][_0xdedd('0x56')](_0x4932bd)[_0xdedd('0x1f')](handleEntityNotFound(_0x7697a7,null))[_0xdedd('0x1f')](respondWithResult(_0x7697a7,null))[_0xdedd('0x29')](handleError(_0x7697a7,null));};exports[_0xdedd('0x57')]=function(_0x2e7040,_0x5d3cd1){return db[_0xdedd('0x3c')][_0xdedd('0x57')](_0x2e7040['body'],{})['then'](respondWithResult(_0x5d3cd1,0xc9))['catch'](handleError(_0x5d3cd1,null));};exports[_0xdedd('0x58')]=function(_0x33b665,_0x2ad4b3){if(_0x33b665['body']['id']){delete _0x33b665[_0xdedd('0x59')]['id'];}return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x33b665['params']['id']}})[_0xdedd('0x1f')](handleEntityNotFound(_0x2ad4b3,null))[_0xdedd('0x1f')](saveUpdates(_0x33b665[_0xdedd('0x59')],null))[_0xdedd('0x1f')](respondWithResult(_0x2ad4b3,null))[_0xdedd('0x29')](handleError(_0x2ad4b3,null));};exports[_0xdedd('0x36')]=function(_0x8d74ba,_0x51920b){return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x8d74ba[_0xdedd('0x5a')]['id']}})['then'](handleEntityNotFound(_0x51920b,null))[_0xdedd('0x1f')](removeEntity(_0x51920b,null))[_0xdedd('0x29')](handleError(_0x51920b,null));};exports[_0xdedd('0x5b')]=function(_0x587ee1,_0x48cf67){return db['ChatMessage'][_0xdedd('0x5b')]()['then'](respondWithResult(_0x48cf67,null))[_0xdedd('0x29')](handleError(_0x48cf67,null));};var interaction_log=require(_0xdedd('0x11'))(_0xdedd('0x5c'));exports[_0xdedd('0x5d')]=function(_0x3f4518,_0x5daa53,_0x240c43){var _0x48fcce={'agent':{},'channel':'chat'};if(_0x3f4518['body']['id']){delete _0x3f4518[_0xdedd('0x59')]['id'];}_0x3f4518['body'][_0xdedd('0x5e')]=!![];_0x3f4518['body'][_0xdedd('0x5f')]=moment()['format'](_0xdedd('0x60'));_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')]=_0x3f4518[_0xdedd('0x59')]['UserId']||_0x3f4518[_0xdedd('0x62')]['id'];_0x48fcce[_0xdedd('0x63')]['id']=_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')];return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x3f4518['params']['id'],'UserId':null}})[_0xdedd('0x1f')](handleEntityNotFound(_0x5daa53,null))[_0xdedd('0x1f')](saveUpdates(_0x3f4518[_0xdedd('0x59')],null))[_0xdedd('0x1f')](function(_0x1c360d){if(_0x1c360d){_0x48fcce['message']=_0x1c360d[_0xdedd('0x64')]({'plain':!![]});return db[_0xdedd('0x65')][_0xdedd('0x56')]({'where':{'id':_0x1c360d[_0xdedd('0x66')]}});}return null;})[_0xdedd('0x1f')](handleEntityNotFound(_0x5daa53,null))[_0xdedd('0x1f')](function(_0x52ba38){if(_0x52ba38){return _0x52ba38[_0xdedd('0x58')]({'UserId':_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')],'read1stAt':_[_0xdedd('0x67')](_0x52ba38['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdedd('0x1f')](function(_0x45c484){if(_0x45c484){_0x48fcce[_0xdedd('0x68')]=_0x45c484[_0xdedd('0x64')]({'plain':!![]});interaction_log[_0xdedd('0x20')](_0xdedd('0x69'),_0x3f4518[_0xdedd('0x62')]['id'],_0x3f4518[_0xdedd('0x62')][_0xdedd('0x38')],_0x3f4518['user'][_0xdedd('0x6a')],_0x48fcce[_0xdedd('0x68')]['id'],_0x3f4518[_0xdedd('0x59')]?JSON[_0xdedd('0x23')](_0x3f4518[_0xdedd('0x59')]):'null');return respondWithRpcPromise(_0xdedd('0x6b'),_0xdedd('0x6c'),_0x48fcce);}return null;})[_0xdedd('0x1f')](function(_0x3ad6de){var _0x188041='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ad6de[_0xdedd('0x27')]['ContactId'];return db[_0xdedd('0x6d')][_0xdedd('0x41')](_0x188041,{'type':db[_0xdedd('0x6e')][_0xdedd('0x6f')][_0xdedd('0x70')],'raw':!![]})['then'](function(_0x2b69a5){return _0x2b69a5;});})[_0xdedd('0x1f')](function(_0x309bef){if(_0x309bef){_0x48fcce[_0xdedd('0x27')][_0xdedd('0x71')]=_0x309bef[0x0];if(!_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')])return;return db[_0xdedd('0x72')]['find']({'where':{'id':_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')],'role':_0xdedd('0x63')},'attributes':['id',_0xdedd('0x38'),_0xdedd('0x73'),_0xdedd('0x74'),'internal'],'raw':!![]});}return null;})[_0xdedd('0x1f')](function(_0x2002f7){if(!_0x2002f7)return null;_0x48fcce[_0xdedd('0x27')]['agent']=_0x2002f7;return _0x48fcce;})[_0xdedd('0x1f')](function(_0x1d0dcd){if(_0x1d0dcd){if(_0x3f4518[_0xdedd('0x59')]['manual']){_0x48fcce['message'][_0xdedd('0x75')]=util[_0xdedd('0x76')](_0xdedd('0x77'),_0x3f4518[_0xdedd('0x62')][_0xdedd('0x38')]);_0x48fcce['message']['channel']=_0x48fcce['channel'];_0x48fcce[_0xdedd('0x27')]['motionChannel']=_0x48fcce[_0xdedd('0x78')];_0x48fcce[_0xdedd('0x27')][_0xdedd('0x79')]=_0xdedd('0x5d');return respondWithRpcPromise(_0xdedd('0x7a'),_0xdedd('0x7a'),{'event':_0xdedd('0x7b'),'message':_['merge'](_0x48fcce[_0xdedd('0x27')],JSON[_0xdedd('0x7c')](_0x48fcce[_0xdedd('0x68')]['formData']))},client9002)['then'](function(){return _0x48fcce;});}return _0x48fcce;}return null;})[_0xdedd('0x1f')](respondWithResult(_0x5daa53,null))[_0xdedd('0x29')](handleError(_0x5daa53,null));};var interaction_log=require(_0xdedd('0x11'))(_0xdedd('0x5c'));exports['reject']=function(_0x1ad572,_0x21915f,_0x58445){var _0x472d73={'agent':{},'channel':'chat'};if(_0x1ad572[_0xdedd('0x59')]['id']){delete _0x1ad572[_0xdedd('0x59')]['id'];}_0x1ad572['body'][_0xdedd('0x61')]=_0x1ad572[_0xdedd('0x59')][_0xdedd('0x61')]||_0x1ad572[_0xdedd('0x62')]['id'];_0x472d73['agent']['id']=_0x1ad572[_0xdedd('0x59')][_0xdedd('0x61')];return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x1ad572[_0xdedd('0x5a')]['id'],'UserId':null}})[_0xdedd('0x1f')](handleEntityNotFound(_0x21915f,null))[_0xdedd('0x1f')](function(_0x32d865){if(_0x32d865){_0x472d73[_0xdedd('0x27')]=_0x32d865['get']({'plain':!![]});return db[_0xdedd('0x65')]['find']({'where':{'id':_0x32d865[_0xdedd('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x21915f,null))[_0xdedd('0x1f')](function(_0x1ff0a1){if(_0x1ff0a1){_0x472d73['interaction']=_0x1ff0a1[_0xdedd('0x64')]({'plain':!![]});interaction_log[_0xdedd('0x20')](_0xdedd('0x7d'),_0x1ad572[_0xdedd('0x62')]['id'],_0x1ad572['user'][_0xdedd('0x38')],_0x1ad572[_0xdedd('0x62')][_0xdedd('0x6a')],_0x472d73[_0xdedd('0x68')]['id'],_0x1ad572['body']?JSON[_0xdedd('0x23')](_0x1ad572['body']):_0xdedd('0x7e'));return respondWithRpcPromise(_0xdedd('0x7f'),_0xdedd('0x80'),_0x472d73);}return null;})[_0xdedd('0x1f')](function(_0x564f39){var _0x33e75f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x564f39[_0xdedd('0x27')]['ContactId'];return db[_0xdedd('0x6d')]['query'](_0x33e75f,{'type':db[_0xdedd('0x6e')][_0xdedd('0x6f')][_0xdedd('0x70')],'raw':!![]})[_0xdedd('0x1f')](function(_0x4ed250){return _0x4ed250;});})[_0xdedd('0x1f')](function(_0x25f6d0){if(_0x25f6d0){_0x472d73[_0xdedd('0x27')]['contact']=_0x25f6d0[0x0];if(!_0x1ad572['body'][_0xdedd('0x61')])return;return db[_0xdedd('0x72')][_0xdedd('0x56')]({'where':{'id':_0x1ad572[_0xdedd('0x59')][_0xdedd('0x61')],'role':_0xdedd('0x63')},'attributes':['id',_0xdedd('0x38'),_0xdedd('0x73'),_0xdedd('0x74'),'internal'],'raw':!![]});}return null;})[_0xdedd('0x1f')](function(_0x4a2267){if(!_0x4a2267)return null;_0x472d73[_0xdedd('0x27')][_0xdedd('0x63')]=_0x4a2267;return _0x472d73;})[_0xdedd('0x1f')](function(_0x5a34e3){if(_0x5a34e3){_0x5a34e3[_0xdedd('0x27')][_0xdedd('0x75')]=util[_0xdedd('0x76')](_0xdedd('0x77'),_0x1ad572[_0xdedd('0x62')][_0xdedd('0x38')]);_0x5a34e3[_0xdedd('0x27')][_0xdedd('0x78')]=_0x472d73[_0xdedd('0x78')];_0x5a34e3[_0xdedd('0x27')][_0xdedd('0x81')]=_0x472d73[_0xdedd('0x78')];_0x5a34e3['message']['event']=_0xdedd('0x82');respondWithRpcPromise(_0xdedd('0x7a'),_0xdedd('0x7a'),{'event':_0xdedd('0x83'),'message':_[_0xdedd('0x4d')](_0x472d73[_0xdedd('0x27')],JSON['parse'](_0x472d73['interaction'][_0xdedd('0x84')]))},client9002);return _0x472d73;}return null;})['then'](respondWithResult(_0x21915f,null))[_0xdedd('0x29')](handleError(_0x21915f,null));};
\ No newline at end of file
+var _0x9c2e=['set','Content-Range','apply','save','then','stack','name','send','index','map','fieldName','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','ChatMessage','includeAll','rows','show','keys','intersection','include','find','create','body','update','params','destroy','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','interaction','formData','reject','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','User','fullname','rejectmessage','parse','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x431f27,_0x152cc4){var _0x559a65=function(_0x1117ed){while(--_0x1117ed){_0x431f27['push'](_0x431f27['shift']());}};_0x559a65(++_0x152cc4);}(_0x9c2e,0x161));var _0xe9c2=function(_0x3ccc0d,_0xaf0382){_0x3ccc0d=_0x3ccc0d-0x0;var _0x1c2d89=_0x9c2e[_0x3ccc0d];return _0x1c2d89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9c2('0x0'));var zipdir=require(_0xe9c2('0x1'));var jsonpatch=require(_0xe9c2('0x2'));var rp=require(_0xe9c2('0x3'));var moment=require(_0xe9c2('0x4'));var BPromise=require(_0xe9c2('0x5'));var Mustache=require('mustache');var util=require(_0xe9c2('0x6'));var path=require(_0xe9c2('0x7'));var sox=require(_0xe9c2('0x8'));var csv=require('to-csv');var ejs=require(_0xe9c2('0x9'));var fs=require('fs');var fs_extra=require(_0xe9c2('0xa'));var _=require('lodash');var squel=require(_0xe9c2('0xb'));var crypto=require(_0xe9c2('0xc'));var jsforce=require(_0xe9c2('0xd'));var deskjs=require(_0xe9c2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe9c2('0xf'));var Papa=require(_0xe9c2('0x10'));var Redis=require(_0xe9c2('0x11'));var authService=require(_0xe9c2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe9c2('0x13'));var hardwareService=require(_0xe9c2('0x14'));var logger=require(_0xe9c2('0x15'))(_0xe9c2('0x16'));var utils=require(_0xe9c2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe9c2('0x18'));var db=require(_0xe9c2('0x19'))['db'];config[_0xe9c2('0x1a')]=_[_0xe9c2('0x1b')](config[_0xe9c2('0x1a')],{'host':_0xe9c2('0x1c'),'port':0x18eb});var socket=require(_0xe9c2('0x1d'))(new Redis(config[_0xe9c2('0x1a')]));require(_0xe9c2('0x1e'))['register'](socket);var jayson=require(_0xe9c2('0x1f'));var client=jayson[_0xe9c2('0x20')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18e5b5,_0xafde69,_0x1312e8,_0x2cd991){return new BPromise(function(_0x5da239,_0x4edff9){var _0x2eeabe=_0x2cd991||client;return _0x2eeabe[_0xe9c2('0x21')](_0x18e5b5,_0x1312e8)['then'](function(_0x38b4bc){logger[_0xe9c2('0x22')](_0xe9c2('0x23'),_0xafde69,_0xe9c2('0x24'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xafde69,_0xe9c2('0x24'),JSON[_0xe9c2('0x25')](_0x38b4bc));if(_0x38b4bc[_0xe9c2('0x26')]){if(_0x38b4bc[_0xe9c2('0x26')]['code']===0x1f4){logger[_0xe9c2('0x26')](_0xe9c2('0x23'),_0xafde69,_0x38b4bc[_0xe9c2('0x26')][_0xe9c2('0x27')]);return _0x4edff9(_0x38b4bc['error'][_0xe9c2('0x27')]);}logger[_0xe9c2('0x26')](_0xe9c2('0x23'),_0xafde69,_0x38b4bc[_0xe9c2('0x26')]['message']);return _0x5da239(_0x38b4bc['error'][_0xe9c2('0x27')]);}else{logger[_0xe9c2('0x22')](_0xe9c2('0x23'),_0xafde69,_0xe9c2('0x24'));_0x5da239(_0x38b4bc['result'][_0xe9c2('0x27')]);}})[_0xe9c2('0x28')](function(_0x4d882e){logger['error'](_0xe9c2('0x23'),_0xafde69,_0x4d882e);_0x4edff9(_0x4d882e);});});}function respondWithStatusCode(_0x1abcff,_0x2c3bf4){_0x2c3bf4=_0x2c3bf4||0xcc;return function(_0x46d614){if(_0x46d614){return _0x1abcff[_0xe9c2('0x29')](_0x2c3bf4);}return _0x1abcff[_0xe9c2('0x2a')](_0x2c3bf4)[_0xe9c2('0x2b')]();};}function respondWithResult(_0x23fccf,_0x4b992f){_0x4b992f=_0x4b992f||0xc8;return function(_0x5c0e1){if(_0x5c0e1){return _0x23fccf[_0xe9c2('0x2a')](_0x4b992f)[_0xe9c2('0x2c')](_0x5c0e1);}};}function respondWithFilteredResult(_0x3e9287,_0x402dc3){return function(_0x40f328){if(_0x40f328){var _0x6b49d8=typeof _0x402dc3[_0xe9c2('0x2d')]===_0xe9c2('0x2e')&&typeof _0x402dc3[_0xe9c2('0x2f')]===_0xe9c2('0x2e');var _0x31e7a5=_0x40f328[_0xe9c2('0x30')];var _0x4632e9=_0x6b49d8?0x0:_0x402dc3['offset'];var _0x665c6e=_0x6b49d8?_0x40f328[_0xe9c2('0x30')]:_0x402dc3[_0xe9c2('0x2d')]+_0x402dc3[_0xe9c2('0x2f')];var _0x49cfd3;if(_0x665c6e>=_0x31e7a5){_0x665c6e=_0x31e7a5;_0x49cfd3=0xc8;}else{_0x49cfd3=0xce;}_0x3e9287[_0xe9c2('0x2a')](_0x49cfd3);return _0x3e9287[_0xe9c2('0x31')](_0xe9c2('0x32'),_0x4632e9+'-'+_0x665c6e+'/'+_0x31e7a5)[_0xe9c2('0x2c')](_0x40f328);}return null;};}function patchUpdates(_0x2559d9){return function(_0x437ddb){try{jsonpatch[_0xe9c2('0x33')](_0x437ddb,_0x2559d9,!![]);}catch(_0x439626){return BPromise['reject'](_0x439626);}return _0x437ddb[_0xe9c2('0x34')]();};}function saveUpdates(_0x19b279,_0x274d57){return function(_0x34a890){if(_0x34a890){return _0x34a890['update'](_0x19b279)[_0xe9c2('0x35')](function(_0x35c0fc){return _0x35c0fc;});}return null;};}function removeEntity(_0x3acf3a,_0x36cc3b){return function(_0x376bc1){if(_0x376bc1){return _0x376bc1['destroy']()[_0xe9c2('0x35')](function(){_0x3acf3a[_0xe9c2('0x2a')](0xcc)[_0xe9c2('0x2b')]();});}};}function handleEntityNotFound(_0xe71bfe,_0x250574){return function(_0x3fd145){if(!_0x3fd145){_0xe71bfe[_0xe9c2('0x29')](0x194);}return _0x3fd145;};}function handleError(_0x2bbc79,_0x427748){_0x427748=_0x427748||0x1f4;return function(_0x351a82){logger[_0xe9c2('0x26')](_0x351a82[_0xe9c2('0x36')]);if(_0x351a82['name']){delete _0x351a82[_0xe9c2('0x37')];}_0x2bbc79['status'](_0x427748)[_0xe9c2('0x38')](_0x351a82);};}exports[_0xe9c2('0x39')]=function(_0x5bb081,_0x38041f){var _0x17ab53={},_0x530dea={},_0x195598={'count':0x0,'rows':[]};var _0x191509=_[_0xe9c2('0x3a')](db['ChatMessage']['rawAttributes'],function(_0x1eebba){return{'name':_0x1eebba[_0xe9c2('0x3b')],'type':_0x1eebba['type']['key']};});_0x530dea[_0xe9c2('0x3c')]=_[_0xe9c2('0x3a')](_0x191509,'name');_0x530dea[_0xe9c2('0x3d')]=_['keys'](_0x5bb081['query']);_0x530dea[_0xe9c2('0x3e')]=_['intersection'](_0x530dea['model'],_0x530dea[_0xe9c2('0x3d')]);_0x17ab53['attributes']=_['intersection'](_0x530dea['model'],qs[_0xe9c2('0x3f')](_0x5bb081['query']['fields']));_0x17ab53[_0xe9c2('0x40')]=_0x17ab53[_0xe9c2('0x40')][_0xe9c2('0x41')]?_0x17ab53[_0xe9c2('0x40')]:_0x530dea['model'];if(!_0x5bb081[_0xe9c2('0x3d')][_0xe9c2('0x42')](_0xe9c2('0x43'))){_0x17ab53[_0xe9c2('0x2f')]=qs['limit'](_0x5bb081['query']['limit']);_0x17ab53[_0xe9c2('0x2d')]=qs[_0xe9c2('0x2d')](_0x5bb081[_0xe9c2('0x3d')][_0xe9c2('0x2d')]);}_0x17ab53[_0xe9c2('0x44')]=qs['sort'](_0x5bb081[_0xe9c2('0x3d')][_0xe9c2('0x45')]);_0x17ab53['where']=qs['filters'](_[_0xe9c2('0x46')](_0x5bb081['query'],_0x530dea[_0xe9c2('0x3e')]),_0x191509);if(_0x5bb081['query'][_0xe9c2('0x47')]){_0x17ab53[_0xe9c2('0x48')]=_[_0xe9c2('0x49')](_0x17ab53[_0xe9c2('0x48')],{'$or':_['map'](_0x191509,function(_0x11b9cc){if(_0x11b9cc[_0xe9c2('0x4a')]!=='VIRTUAL'){var _0x252c93={};_0x252c93[_0x11b9cc[_0xe9c2('0x37')]]={'$like':'%'+_0x5bb081[_0xe9c2('0x3d')][_0xe9c2('0x47')]+'%'};return _0x252c93;}})});}_0x17ab53=_['merge']({},_0x17ab53,_0x5bb081[_0xe9c2('0x4b')]);var _0x526fe3={'where':_0x17ab53[_0xe9c2('0x48')]};return db[_0xe9c2('0x4c')][_0xe9c2('0x30')](_0x526fe3)['then'](function(_0x5e24fc){_0x195598[_0xe9c2('0x30')]=_0x5e24fc;if(_0x5bb081[_0xe9c2('0x3d')][_0xe9c2('0x4d')]){_0x17ab53['include']=[{'all':!![]}];}return db[_0xe9c2('0x4c')]['findAll'](_0x17ab53);})['then'](function(_0xad4397){_0x195598[_0xe9c2('0x4e')]=_0xad4397;return _0x195598;})[_0xe9c2('0x35')](respondWithFilteredResult(_0x38041f,_0x17ab53))[_0xe9c2('0x28')](handleError(_0x38041f,null));};exports[_0xe9c2('0x4f')]=function(_0x22d382,_0xece3d3){var _0x47dfc1={'raw':!![],'where':{'id':_0x22d382['params']['id']}},_0x5d75f1={};_0x5d75f1[_0xe9c2('0x3c')]=_['keys'](db[_0xe9c2('0x4c')]['rawAttributes']);_0x5d75f1[_0xe9c2('0x3d')]=_[_0xe9c2('0x50')](_0x22d382[_0xe9c2('0x3d')]);_0x5d75f1['filters']=_[_0xe9c2('0x51')](_0x5d75f1[_0xe9c2('0x3c')],_0x5d75f1[_0xe9c2('0x3d')]);_0x47dfc1[_0xe9c2('0x40')]=_[_0xe9c2('0x51')](_0x5d75f1[_0xe9c2('0x3c')],qs[_0xe9c2('0x3f')](_0x22d382['query']['fields']));_0x47dfc1[_0xe9c2('0x40')]=_0x47dfc1['attributes'][_0xe9c2('0x41')]?_0x47dfc1[_0xe9c2('0x40')]:_0x5d75f1[_0xe9c2('0x3c')];if(_0x22d382[_0xe9c2('0x3d')]['includeAll']){_0x47dfc1[_0xe9c2('0x52')]=[{'all':!![]}];}_0x47dfc1=_[_0xe9c2('0x49')]({},_0x47dfc1,_0x22d382[_0xe9c2('0x4b')]);return db['ChatMessage'][_0xe9c2('0x53')](_0x47dfc1)[_0xe9c2('0x35')](handleEntityNotFound(_0xece3d3,null))[_0xe9c2('0x35')](respondWithResult(_0xece3d3,null))[_0xe9c2('0x28')](handleError(_0xece3d3,null));};exports[_0xe9c2('0x54')]=function(_0x454c4e,_0x372b1a){return db[_0xe9c2('0x4c')]['create'](_0x454c4e[_0xe9c2('0x55')],{})[_0xe9c2('0x35')](respondWithResult(_0x372b1a,0xc9))[_0xe9c2('0x28')](handleError(_0x372b1a,null));};exports[_0xe9c2('0x56')]=function(_0x28400c,_0x3cfec4){if(_0x28400c[_0xe9c2('0x55')]['id']){delete _0x28400c[_0xe9c2('0x55')]['id'];}return db[_0xe9c2('0x4c')][_0xe9c2('0x53')]({'where':{'id':_0x28400c[_0xe9c2('0x57')]['id']}})[_0xe9c2('0x35')](handleEntityNotFound(_0x3cfec4,null))[_0xe9c2('0x35')](saveUpdates(_0x28400c[_0xe9c2('0x55')],null))[_0xe9c2('0x35')](respondWithResult(_0x3cfec4,null))[_0xe9c2('0x28')](handleError(_0x3cfec4,null));};exports[_0xe9c2('0x58')]=function(_0x30704f,_0x275ee7){return db[_0xe9c2('0x4c')][_0xe9c2('0x53')]({'where':{'id':_0x30704f[_0xe9c2('0x57')]['id']}})[_0xe9c2('0x35')](handleEntityNotFound(_0x275ee7,null))['then'](removeEntity(_0x275ee7,null))[_0xe9c2('0x28')](handleError(_0x275ee7,null));};exports['describe']=function(_0x397c4c,_0x35eb26){return db['ChatMessage']['describe']()[_0xe9c2('0x35')](respondWithResult(_0x35eb26,null))[_0xe9c2('0x28')](handleError(_0x35eb26,null));};var interaction_log=require(_0xe9c2('0x15'))(_0xe9c2('0x59'));exports[_0xe9c2('0x5a')]=function(_0x2cc084,_0x2ae29a,_0x4d77bf){var _0x2a7ff4={'agent':{},'channel':_0xe9c2('0x5b')};if(_0x2cc084['body']['id']){delete _0x2cc084['body']['id'];}_0x2cc084['body'][_0xe9c2('0x5c')]=!![];_0x2cc084['body'][_0xe9c2('0x5d')]=moment()[_0xe9c2('0x5e')](_0xe9c2('0x5f'));_0x2cc084[_0xe9c2('0x55')][_0xe9c2('0x60')]=_0x2cc084[_0xe9c2('0x55')][_0xe9c2('0x60')]||_0x2cc084[_0xe9c2('0x61')]['id'];_0x2a7ff4[_0xe9c2('0x62')]['id']=_0x2cc084['body'][_0xe9c2('0x60')];return db['ChatMessage'][_0xe9c2('0x53')]({'where':{'id':_0x2cc084[_0xe9c2('0x57')]['id'],'UserId':null}})[_0xe9c2('0x35')](handleEntityNotFound(_0x2ae29a,null))[_0xe9c2('0x35')](saveUpdates(_0x2cc084[_0xe9c2('0x55')],null))['then'](function(_0x280870){if(_0x280870){_0x2a7ff4[_0xe9c2('0x27')]=_0x280870[_0xe9c2('0x63')]({'plain':!![]});return db[_0xe9c2('0x64')][_0xe9c2('0x53')]({'where':{'id':_0x280870['ChatInteractionId']}});}return null;})[_0xe9c2('0x35')](handleEntityNotFound(_0x2ae29a,null))[_0xe9c2('0x35')](function(_0x428f35){if(_0x428f35){return _0x428f35['update']({'UserId':_0x2cc084[_0xe9c2('0x55')][_0xe9c2('0x60')],'read1stAt':_[_0xe9c2('0x65')](_0x428f35[_0xe9c2('0x66')])?moment()[_0xe9c2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe9c2('0x35')](function(_0x395b2c){if(_0x395b2c){_0x2a7ff4['interaction']=_0x395b2c[_0xe9c2('0x63')]({'plain':!![]});interaction_log['info'](_0xe9c2('0x67'),_0x2cc084[_0xe9c2('0x61')]['id'],_0x2cc084[_0xe9c2('0x61')][_0xe9c2('0x37')],_0x2cc084['user']['role'],_0x2a7ff4['interaction']['id'],_0x2cc084['body']?JSON[_0xe9c2('0x25')](_0x2cc084[_0xe9c2('0x55')]):_0xe9c2('0x68'));return respondWithRpcPromise(_0xe9c2('0x69'),_0xe9c2('0x6a'),_0x2a7ff4);}return null;})[_0xe9c2('0x35')](function(_0x5b0ff3){var _0x3cb6d3=_0xe9c2('0x6b')+_0x5b0ff3[_0xe9c2('0x27')][_0xe9c2('0x6c')];return db[_0xe9c2('0x6d')][_0xe9c2('0x3d')](_0x3cb6d3,{'type':db['Sequelize'][_0xe9c2('0x6e')][_0xe9c2('0x6f')],'raw':!![]})['then'](function(_0x579061){return _0x579061;});})[_0xe9c2('0x35')](function(_0x53026a){if(_0x53026a){_0x2a7ff4[_0xe9c2('0x27')][_0xe9c2('0x70')]=_0x53026a[0x0];if(!_0x2cc084[_0xe9c2('0x55')][_0xe9c2('0x60')])return;return db['User'][_0xe9c2('0x53')]({'where':{'id':_0x2cc084[_0xe9c2('0x55')][_0xe9c2('0x60')],'role':_0xe9c2('0x62')},'attributes':['id',_0xe9c2('0x37'),'fullname',_0xe9c2('0x71'),_0xe9c2('0x72')],'raw':!![]});}return null;})['then'](function(_0x3e448e){if(!_0x3e448e)return null;_0x2a7ff4['message'][_0xe9c2('0x62')]=_0x3e448e;return _0x2a7ff4;})[_0xe9c2('0x35')](function(_0xaf2def){if(_0xaf2def){if(_0x2cc084[_0xe9c2('0x55')][_0xe9c2('0x73')]){_0x2a7ff4[_0xe9c2('0x27')][_0xe9c2('0x74')]=util[_0xe9c2('0x5e')](_0xe9c2('0x75'),_0x2cc084[_0xe9c2('0x61')]['name']);_0x2a7ff4[_0xe9c2('0x27')][_0xe9c2('0x76')]=_0x2a7ff4[_0xe9c2('0x76')];_0x2a7ff4['message'][_0xe9c2('0x77')]=_0x2a7ff4[_0xe9c2('0x76')];_0x2a7ff4[_0xe9c2('0x27')][_0xe9c2('0x78')]=_0xe9c2('0x5a');return respondWithRpcPromise('EventManager',_0xe9c2('0x79'),{'event':'acceptmessage','message':_[_0xe9c2('0x49')](_0x2a7ff4[_0xe9c2('0x27')],JSON['parse'](_0x2a7ff4[_0xe9c2('0x7a')][_0xe9c2('0x7b')]))},client9002)[_0xe9c2('0x35')](function(){return _0x2a7ff4;});}return _0x2a7ff4;}return null;})[_0xe9c2('0x35')](respondWithResult(_0x2ae29a,null))[_0xe9c2('0x28')](handleError(_0x2ae29a,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xe9c2('0x7c')]=function(_0x121fbc,_0xe74144,_0x2e8206){var _0x571441={'agent':{},'channel':_0xe9c2('0x5b')};if(_0x121fbc[_0xe9c2('0x55')]['id']){delete _0x121fbc[_0xe9c2('0x55')]['id'];}_0x121fbc[_0xe9c2('0x55')][_0xe9c2('0x60')]=_0x121fbc['body']['UserId']||_0x121fbc[_0xe9c2('0x61')]['id'];_0x571441[_0xe9c2('0x62')]['id']=_0x121fbc['body'][_0xe9c2('0x60')];return db[_0xe9c2('0x4c')][_0xe9c2('0x53')]({'where':{'id':_0x121fbc[_0xe9c2('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe74144,null))[_0xe9c2('0x35')](function(_0x114979){if(_0x114979){_0x571441[_0xe9c2('0x27')]=_0x114979[_0xe9c2('0x63')]({'plain':!![]});return db[_0xe9c2('0x64')]['find']({'where':{'id':_0x114979[_0xe9c2('0x7d')]}});}return null;})[_0xe9c2('0x35')](handleEntityNotFound(_0xe74144,null))[_0xe9c2('0x35')](function(_0x190d98){if(_0x190d98){_0x571441[_0xe9c2('0x7a')]=_0x190d98[_0xe9c2('0x63')]({'plain':!![]});interaction_log[_0xe9c2('0x22')](_0xe9c2('0x7e'),_0x121fbc[_0xe9c2('0x61')]['id'],_0x121fbc[_0xe9c2('0x61')]['name'],_0x121fbc[_0xe9c2('0x61')][_0xe9c2('0x7f')],_0x571441['interaction']['id'],_0x121fbc[_0xe9c2('0x55')]?JSON['stringify'](_0x121fbc['body']):_0xe9c2('0x68'));return respondWithRpcPromise(_0xe9c2('0x80'),_0xe9c2('0x81'),_0x571441);}return null;})[_0xe9c2('0x35')](function(_0x3d8ef2){var _0xb6b9e5=_0xe9c2('0x6b')+_0x3d8ef2[_0xe9c2('0x27')]['ContactId'];return db['sequelize'][_0xe9c2('0x3d')](_0xb6b9e5,{'type':db['Sequelize'][_0xe9c2('0x6e')][_0xe9c2('0x6f')],'raw':!![]})[_0xe9c2('0x35')](function(_0x36341b){return _0x36341b;});})[_0xe9c2('0x35')](function(_0x46dc6b){if(_0x46dc6b){_0x571441['message'][_0xe9c2('0x70')]=_0x46dc6b[0x0];if(!_0x121fbc[_0xe9c2('0x55')][_0xe9c2('0x60')])return;return db[_0xe9c2('0x82')][_0xe9c2('0x53')]({'where':{'id':_0x121fbc[_0xe9c2('0x55')][_0xe9c2('0x60')],'role':_0xe9c2('0x62')},'attributes':['id',_0xe9c2('0x37'),_0xe9c2('0x83'),_0xe9c2('0x71'),'internal'],'raw':!![]});}return null;})['then'](function(_0x20dea9){if(!_0x20dea9)return null;_0x571441[_0xe9c2('0x27')][_0xe9c2('0x62')]=_0x20dea9;return _0x571441;})[_0xe9c2('0x35')](function(_0x44d21e){if(_0x44d21e){_0x44d21e['message']['interface']=util[_0xe9c2('0x5e')](_0xe9c2('0x75'),_0x121fbc[_0xe9c2('0x61')]['name']);_0x44d21e[_0xe9c2('0x27')][_0xe9c2('0x76')]=_0x571441['channel'];_0x44d21e[_0xe9c2('0x27')][_0xe9c2('0x77')]=_0x571441[_0xe9c2('0x76')];_0x44d21e[_0xe9c2('0x27')][_0xe9c2('0x78')]=_0xe9c2('0x7c');respondWithRpcPromise(_0xe9c2('0x79'),_0xe9c2('0x79'),{'event':_0xe9c2('0x84'),'message':_[_0xe9c2('0x49')](_0x571441[_0xe9c2('0x27')],JSON[_0xe9c2('0x85')](_0x571441['interaction'][_0xe9c2('0x7b')]))},client9002);return _0x571441;}return null;})[_0xe9c2('0x35')](respondWithResult(_0xe74144,null))[_0xe9c2('0x28')](handleError(_0xe74144,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 5c838b0..8aee763 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 _0x83aa=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x57a2be,_0x2900b6){var _0x7f99d3=function(_0x1732b4){while(--_0x1732b4){_0x57a2be['push'](_0x57a2be['shift']());}};_0x7f99d3(++_0x2900b6);}(_0x83aa,0xb3));var _0xa83a=function(_0x5ade89,_0x2a90b0){_0x5ade89=_0x5ade89-0x0;var _0x272f1f=_0x83aa[_0x5ade89];return _0x272f1f;};'use strict';var EventEmitter=require(_0xa83a('0x0'));var ChatMessage=require(_0xa83a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa83a('0x2')](0x0);var events={'afterCreate':_0xa83a('0x3'),'afterUpdate':_0xa83a('0x4'),'afterDestroy':_0xa83a('0x5')};function emitEvent(_0x2a6180){return function(_0x2e0ddd,_0x2c72fe,_0xce83d9){ChatMessageEvents['emit'](_0x2a6180+':'+_0x2e0ddd['id'],_0x2e0ddd);ChatMessageEvents[_0xa83a('0x6')](_0x2a6180,_0x2e0ddd);_0xce83d9(null);};}for(var e in events){if(events[_0xa83a('0x7')](e)){var event=events[e];ChatMessage[_0xa83a('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xdbf3=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x1c31fa,_0x2925cb){var _0xdf751=function(_0x51b6c9){while(--_0x51b6c9){_0x1c31fa['push'](_0x1c31fa['shift']());}};_0xdf751(++_0x2925cb);}(_0xdbf3,0x164));var _0x3dbf=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xdbf3[_0x1a36a5];return _0x746243;};'use strict';var EventEmitter=require(_0x3dbf('0x0'));var ChatMessage=require(_0x3dbf('0x1'))['db'][_0x3dbf('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3dbf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3dbf('0x4'),'afterDestroy':_0x3dbf('0x5')};function emitEvent(_0x1aeb40){return function(_0x5afe69,_0x5466a3,_0x6c050a){ChatMessageEvents[_0x3dbf('0x6')](_0x1aeb40+':'+_0x5afe69['id'],_0x5afe69);ChatMessageEvents['emit'](_0x1aeb40,_0x5afe69);_0x6c050a(null);};}for(var e in events){if(events[_0x3dbf('0x7')](e)){var event=events[e];ChatMessage[_0x3dbf('0x8')](e,emitEvent(event));}}module[_0x3dbf('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 593a053..a7f6424 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 _0xe131=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xe131,0x1b5));var _0x1e13=function(_0x496763,_0x43c2e1){_0x496763=_0x496763-0x0;var _0x19b652=_0xe131[_0x496763];return _0x19b652;};'use strict';var _=require(_0x1e13('0x0'));var util=require(_0x1e13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1e13('0x2'));var BPromise=require('bluebird');var rp=require(_0x1e13('0x3'));var fs=require('fs');var path=require(_0x1e13('0x4'));var rimraf=require(_0x1e13('0x5'));var config=require(_0x1e13('0x6'));var attributes=require(_0x1e13('0x7'));module[_0x1e13('0x8')]=function(_0x440239,_0x3ec2e6){return _0x440239[_0x1e13('0x9')](_0x1e13('0xa'),attributes,{'tableName':_0x1e13('0xb'),'paranoid':![],'indexes':[{'name':_0x1e13('0xc'),'fields':[_0x1e13('0xd')],'type':_0x1e13('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1569f3,_0x528329,_0x1012f4){var _0x39e8f1=_0x440239['models'];var _0x523f28=_0x1569f3[_0x1e13('0xf')]({'plain':!![]});if(_0x523f28[_0x1e13('0x10')][_0x1e13('0x11')]()==='in'||_0x523f28['direction'][_0x1e13('0x11')]()==='out'&&!_0x523f28[_0x1e13('0x12')]&&!_[_0x1e13('0x13')](_0x523f28['UserId'])){_0x39e8f1[_0x1e13('0x14')][_0x1e13('0x15')]({'where':{'id':_0x523f28['ChatInteractionId']}})[_0x1e13('0x16')](function(_0x2cc3d0){if(_0x2cc3d0){_0x2cc3d0[_0x1e13('0x17')]({'lastMsgAt':_0x523f28['createdAt'],'lastMsgDirection':_0x523f28[_0x1e13('0x10')][_0x1e13('0x11')]()});}})[_0x1e13('0x18')](function(_0x164aa8){console[_0x1e13('0x19')](_0x164aa8);});}_0x1012f4();}},'charset':_0x1e13('0x1a'),'collate':_0x1e13('0x1b')});};
\ No newline at end of file
+var _0x0896=['define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x24d06a,_0x59c850){var _0x4a987d=function(_0x3bd772){while(--_0x3bd772){_0x24d06a['push'](_0x24d06a['shift']());}};_0x4a987d(++_0x59c850);}(_0x0896,0xfb));var _0x6089=function(_0x1397bf,_0x33b141){_0x1397bf=_0x1397bf-0x0;var _0x30c835=_0x0896[_0x1397bf];return _0x30c835;};'use strict';var _=require(_0x6089('0x0'));var util=require(_0x6089('0x1'));var logger=require(_0x6089('0x2'))('api');var moment=require(_0x6089('0x3'));var BPromise=require(_0x6089('0x4'));var rp=require(_0x6089('0x5'));var fs=require('fs');var path=require(_0x6089('0x6'));var rimraf=require(_0x6089('0x7'));var config=require(_0x6089('0x8'));var attributes=require('./chatMessage.attributes');module[_0x6089('0x9')]=function(_0x4f195e,_0x5080a3){return _0x4f195e[_0x6089('0xa')](_0x6089('0xb'),attributes,{'tableName':_0x6089('0xc'),'paranoid':![],'indexes':[{'name':_0x6089('0xd'),'fields':[_0x6089('0xe')],'type':_0x6089('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a7673,_0x5769d8,_0x141d67){var _0xe2337b=_0x4f195e[_0x6089('0x10')];var _0x18a6de=_0x2a7673['get']({'plain':!![]});if(_0x18a6de[_0x6089('0x11')][_0x6089('0x12')]()==='in'||_0x18a6de['direction'][_0x6089('0x12')]()==='out'&&!_0x18a6de[_0x6089('0x13')]&&!_[_0x6089('0x14')](_0x18a6de['UserId'])){_0xe2337b[_0x6089('0x15')][_0x6089('0x16')]({'where':{'id':_0x18a6de[_0x6089('0x17')]}})[_0x6089('0x18')](function(_0x3f5623){if(_0x3f5623){_0x3f5623['update']({'lastMsgAt':_0x18a6de[_0x6089('0x19')],'lastMsgDirection':_0x18a6de[_0x6089('0x11')][_0x6089('0x12')]()});}})[_0x6089('0x1a')](function(_0x9e2d98){console[_0x6089('0x1b')](_0x9e2d98);});}_0x141d67();}},'charset':_0x6089('0x1c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 68b44e4..ea92f29 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 _0xe0b0=['localhost','socket.io-emitter','redis','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','then','CreateChatMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x5a4bf4,_0x574d36){var _0x4187e8=function(_0x4532b4){while(--_0x4532b4){_0x5a4bf4['push'](_0x5a4bf4['shift']());}};_0x4187e8(++_0x574d36);}(_0xe0b0,0x70));var _0x0e0b=function(_0x5bc683,_0x23fab6){_0x5bc683=_0x5bc683-0x0;var _0x10b119=_0xe0b0[_0x5bc683];return _0x10b119;};'use strict';var _=require(_0x0e0b('0x0'));var util=require(_0x0e0b('0x1'));var moment=require(_0x0e0b('0x2'));var BPromise=require(_0x0e0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e0b('0x4'));var db=require(_0x0e0b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0e0b('0x6'));var config=require(_0x0e0b('0x7'));var jayson=require(_0x0e0b('0x8'));var client=jayson[_0x0e0b('0x9')][_0x0e0b('0xa')]({'port':0x232a});config['redis']=_[_0x0e0b('0xb')](config['redis'],{'host':_0x0e0b('0xc'),'port':0x18eb});var socket=require(_0x0e0b('0xd'))(new Redis(config[_0x0e0b('0xe')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2fcc75,_0x3d7e51,_0x41f7fa){return new BPromise(function(_0x330756,_0x4d2157){return client['request'](_0x2fcc75,_0x41f7fa)['then'](function(_0x18019a){logger[_0x0e0b('0xf')](_0x0e0b('0x10'),_0x3d7e51,_0x0e0b('0x11'));logger['debug'](_0x0e0b('0x12'),_0x3d7e51,_0x0e0b('0x11'),JSON[_0x0e0b('0x13')](_0x18019a));if(_0x18019a[_0x0e0b('0x14')]){if(_0x18019a[_0x0e0b('0x14')][_0x0e0b('0x15')]===0x1f4){logger[_0x0e0b('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3d7e51,_0x18019a['error'][_0x0e0b('0x16')]);return _0x4d2157(_0x18019a[_0x0e0b('0x14')][_0x0e0b('0x16')]);}logger[_0x0e0b('0x14')](_0x0e0b('0x10'),_0x3d7e51,_0x18019a['error']['message']);return _0x330756(_0x18019a[_0x0e0b('0x14')]['message']);}else{logger[_0x0e0b('0xf')](_0x0e0b('0x10'),_0x3d7e51,_0x0e0b('0x11'));_0x330756(_0x18019a[_0x0e0b('0x17')][_0x0e0b('0x16')]);}})[_0x0e0b('0x18')](function(_0x3f665b){logger[_0x0e0b('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3d7e51,_0x3f665b);_0x4d2157(_0x3f665b);});});}exports['CreateChatMessage']=function(_0x28747a){var _0x435951=this;return new Promise(function(_0x2a3d0b,_0x3d7341){return db['ChatMessage'][_0x0e0b('0x19')](_0x28747a[_0x0e0b('0x1a')],{'raw':_0x28747a[_0x0e0b('0x1b')]?_0x28747a[_0x0e0b('0x1b')][_0x0e0b('0x1c')]===undefined?!![]:![]:!![]})[_0x0e0b('0x1d')](function(_0x9adbce){logger[_0x0e0b('0xf')](_0x0e0b('0x1e'),_0x28747a);logger['debug'](_0x0e0b('0x1e'),_0x28747a,JSON['stringify'](_0x9adbce));_0x2a3d0b(_0x9adbce);})[_0x0e0b('0x18')](function(_0x2171a6){logger[_0x0e0b('0x14')](_0x0e0b('0x1e'),_0x2171a6['message'],_0x28747a);_0x3d7341(_0x435951[_0x0e0b('0x14')](0x1f4,_0x2171a6[_0x0e0b('0x16')]));});});};
\ No newline at end of file
+var _0xa174=['info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','register','request','then'];(function(_0x3e8c65,_0x3b1527){var _0xdec56c=function(_0x5d526b){while(--_0x5d526b){_0x3e8c65['push'](_0x3e8c65['shift']());}};_0xdec56c(++_0x3b1527);}(_0xa174,0x1df));var _0x4a17=function(_0x16b12d,_0x59fb4e){_0x16b12d=_0x16b12d-0x0;var _0xcb647f=_0xa174[_0x16b12d];return _0xcb647f;};'use strict';var _=require('lodash');var util=require(_0x4a17('0x0'));var moment=require(_0x4a17('0x1'));var BPromise=require(_0x4a17('0x2'));var rs=require(_0x4a17('0x3'));var fs=require('fs');var Redis=require(_0x4a17('0x4'));var db=require(_0x4a17('0x5'))['db'];var utils=require(_0x4a17('0x6'));var logger=require(_0x4a17('0x7'))('rpc');var config=require(_0x4a17('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4a17('0x9')][_0x4a17('0xa')]({'port':0x232a});config['redis']=_[_0x4a17('0xb')](config[_0x4a17('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a17('0xc')]));require('./chatMessage.socket')[_0x4a17('0xd')](socket);function respondWithRpcPromise(_0x36f7c4,_0x256060,_0x571f01){return new BPromise(function(_0x7cd21b,_0x13a475){return client[_0x4a17('0xe')](_0x36f7c4,_0x571f01)[_0x4a17('0xf')](function(_0x49ce3d){logger[_0x4a17('0x10')]('ChatMessage,\x20%s,\x20%s',_0x256060,'request\x20sent');logger[_0x4a17('0x11')](_0x4a17('0x12'),_0x256060,_0x4a17('0x13'),JSON[_0x4a17('0x14')](_0x49ce3d));if(_0x49ce3d['error']){if(_0x49ce3d[_0x4a17('0x15')][_0x4a17('0x16')]===0x1f4){logger['error'](_0x4a17('0x17'),_0x256060,_0x49ce3d[_0x4a17('0x15')][_0x4a17('0x18')]);return _0x13a475(_0x49ce3d['error'][_0x4a17('0x18')]);}logger[_0x4a17('0x15')](_0x4a17('0x17'),_0x256060,_0x49ce3d['error'][_0x4a17('0x18')]);return _0x7cd21b(_0x49ce3d[_0x4a17('0x15')][_0x4a17('0x18')]);}else{logger[_0x4a17('0x10')]('ChatMessage,\x20%s,\x20%s',_0x256060,_0x4a17('0x13'));_0x7cd21b(_0x49ce3d[_0x4a17('0x19')][_0x4a17('0x18')]);}})[_0x4a17('0x1a')](function(_0x1e8902){logger[_0x4a17('0x15')](_0x4a17('0x17'),_0x256060,_0x1e8902);_0x13a475(_0x1e8902);});});}exports[_0x4a17('0x1b')]=function(_0xbc91d5){var _0x2a5be4=this;return new Promise(function(_0xcc16d4,_0x333e11){return db[_0x4a17('0x1c')][_0x4a17('0x1d')](_0xbc91d5[_0x4a17('0x1e')],{'raw':_0xbc91d5[_0x4a17('0x1f')]?_0xbc91d5[_0x4a17('0x1f')][_0x4a17('0x20')]===undefined?!![]:![]:!![]})[_0x4a17('0xf')](function(_0x137555){logger[_0x4a17('0x10')](_0x4a17('0x1b'),_0xbc91d5);logger[_0x4a17('0x11')](_0x4a17('0x1b'),_0xbc91d5,JSON[_0x4a17('0x14')](_0x137555));_0xcc16d4(_0x137555);})[_0x4a17('0x1a')](function(_0x5bc64e){logger[_0x4a17('0x15')](_0x4a17('0x1b'),_0x5bc64e[_0x4a17('0x18')],_0xbc91d5);_0x333e11(_0x2a5be4[_0x4a17('0x15')](0x1f4,_0x5bc64e['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 10f51e1..6d9814e 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 _0x2e88=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x4de2c5,_0x21aeb7){var _0x4ef52b=function(_0x5e52f4){while(--_0x5e52f4){_0x4de2c5['push'](_0x4de2c5['shift']());}};_0x4ef52b(++_0x21aeb7);}(_0x2e88,0x95));var _0x82e8=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x2e88[_0x5948dd];return _0xb1f8be;};'use strict';var ChatMessageEvents=require(_0x82e8('0x0'));var events=[_0x82e8('0x1'),_0x82e8('0x2'),_0x82e8('0x3')];function createListener(_0x9dd860,_0x46c27f){return function(_0x552153){_0x46c27f[_0x82e8('0x4')](_0x9dd860,_0x552153);};}function removeListener(_0x1d7415,_0x576435){return function(){ChatMessageEvents[_0x82e8('0x5')](_0x1d7415,_0x576435);};}exports[_0x82e8('0x6')]=function(_0x4e909a){for(var _0x3162d1=0x0,_0x1e2496=events[_0x82e8('0x7')];_0x3162d1<_0x1e2496;_0x3162d1++){var _0x27df44=events[_0x3162d1];var _0x393c2c=createListener(_0x82e8('0x8')+_0x27df44,_0x4e909a);ChatMessageEvents['on'](_0x27df44,_0x393c2c);}};
\ No newline at end of file
+var _0x7118=['length','chatMessage:','remove','update','emit','removeListener','register'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0x7118,0x159));var _0x8711=function(_0x25fbe4,_0xdcd3e7){_0x25fbe4=_0x25fbe4-0x0;var _0x39595f=_0x7118[_0x25fbe4];return _0x39595f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x8711('0x0'),_0x8711('0x1')];function createListener(_0x5c64d4,_0x1758c5){return function(_0x3ea36f){_0x1758c5[_0x8711('0x2')](_0x5c64d4,_0x3ea36f);};}function removeListener(_0x259c36,_0x12496b){return function(){ChatMessageEvents[_0x8711('0x3')](_0x259c36,_0x12496b);};}exports[_0x8711('0x4')]=function(_0x54885e){for(var _0x385033=0x0,_0x2244c2=events[_0x8711('0x5')];_0x385033<_0x2244c2;_0x385033++){var _0x3d82f2=events[_0x385033];var _0x189349=createListener(_0x8711('0x6')+_0x3d82f2,_0x54885e);ChatMessageEvents['on'](_0x3d82f2,_0x189349);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 0324787..820ef10 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 _0x88ae=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chat','chatmessage:create','put','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x27ba9c,_0x27a4b3){var _0xca605c=function(_0xb172bd){while(--_0xb172bd){_0x27ba9c['push'](_0x27ba9c['shift']());}};_0xca605c(++_0x27a4b3);}(_0x88ae,0xe5));var _0xe88a=function(_0x287cac,_0xb41eef){_0x287cac=_0x287cac-0x0;var _0x3dcd41=_0x88ae[_0x287cac];return _0x3dcd41;};'use strict';var multer=require('multer');var util=require(_0xe88a('0x0'));var path=require(_0xe88a('0x1'));var timeout=require(_0xe88a('0x2'));var express=require(_0xe88a('0x3'));var router=express['Router']();var fs_extra=require(_0xe88a('0x4'));var auth=require(_0xe88a('0x5'));var interaction=require(_0xe88a('0x6'));var config=require(_0xe88a('0x7'));var controller=require(_0xe88a('0x8'));router['get']('/',auth[_0xe88a('0x9')](),controller[_0xe88a('0xa')]);router[_0xe88a('0xb')](_0xe88a('0xc'),auth[_0xe88a('0x9')](),controller[_0xe88a('0xd')]);router['get'](_0xe88a('0xe'),auth['isAuthenticated'](),controller[_0xe88a('0xf')]);router[_0xe88a('0x10')]('/',auth[_0xe88a('0x9')](),interaction['tracked'](_0xe88a('0x11'),_0xe88a('0x12')),controller['create']);router[_0xe88a('0x13')](_0xe88a('0xe'),controller['update']);router[_0xe88a('0x13')]('/:id/accept',auth[_0xe88a('0x9')](),controller[_0xe88a('0x14')]);router['put'](_0xe88a('0x15'),auth[_0xe88a('0x9')](),controller[_0xe88a('0x16')]);router[_0xe88a('0x17')](_0xe88a('0xe'),auth['isAuthenticated'](),controller[_0xe88a('0x18')]);module[_0xe88a('0x19')]=router;
\ No newline at end of file
+var _0x7112=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','show','post','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','multer'];(function(_0x26a51d,_0x5aaa3a){var _0x1d8bef=function(_0x3335dd){while(--_0x3335dd){_0x26a51d['push'](_0x26a51d['shift']());}};_0x1d8bef(++_0x5aaa3a);}(_0x7112,0xa1));var _0x2711=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7112[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2711('0x0'));var util=require('util');var path=require(_0x2711('0x1'));var timeout=require(_0x2711('0x2'));var express=require(_0x2711('0x3'));var router=express['Router']();var fs_extra=require(_0x2711('0x4'));var auth=require(_0x2711('0x5'));var interaction=require(_0x2711('0x6'));var config=require(_0x2711('0x7'));var controller=require(_0x2711('0x8'));router[_0x2711('0x9')]('/',auth[_0x2711('0xa')](),controller[_0x2711('0xb')]);router[_0x2711('0x9')]('/describe',auth[_0x2711('0xa')](),controller[_0x2711('0xc')]);router['get']('/:id',auth[_0x2711('0xa')](),controller[_0x2711('0xd')]);router[_0x2711('0xe')]('/',auth['isAuthenticated'](),interaction['tracked']('chat',_0x2711('0xf')),controller[_0x2711('0x10')]);router[_0x2711('0x11')]('/:id',controller[_0x2711('0x12')]);router[_0x2711('0x11')](_0x2711('0x13'),auth[_0x2711('0xa')](),controller[_0x2711('0x14')]);router['put'](_0x2711('0x15'),auth[_0x2711('0xa')](),controller[_0x2711('0x16')]);router[_0x2711('0x17')](_0x2711('0x18'),auth[_0x2711('0xa')](),controller[_0x2711('0x19')]);module[_0x2711('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 7310dee..70e9ea5 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 _0x5f66=['medium','TEXT','exports'];(function(_0x2b8fa9,_0x296276){var _0x2583db=function(_0x2270e4){while(--_0x2270e4){_0x2b8fa9['push'](_0x2b8fa9['shift']());}};_0x2583db(++_0x296276);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x4ea064,_0x105b04){var _0x15a832=function(_0x1c1055){while(--_0x1c1055){_0x4ea064['push'](_0x4ea064['shift']());}};_0x15a832(++_0x105b04);}(_0x2032,0xd9));var _0x2203=function(_0x395c96,_0x4fe05a){_0x395c96=_0x395c96-0x0;var _0xae83e9=_0x2032[_0x395c96];return _0xae83e9;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index deb6ef8..5e0e5fe 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x7a54,0x106));var _0x47a5=function(_0x2cc64e,_0x9ba4ba){_0x2cc64e=_0x2cc64e-0x0;var _0x3e0080=_0x7a54[_0x2cc64e];return _0x3e0080;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x7a54,0x106));var _0x47a5=function(_0x4af0cf,_0x4555cf){_0x4af0cf=_0x4af0cf-0x0;var _0x4ea99e=_0x7a54[_0x4af0cf];return _0x4ea99e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 7d5de13..cbe308f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe29d=['events','../../mysqldb','ChatOfflineMessage','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x283152,_0x468a35){var _0x6cb80d=function(_0x17598a){while(--_0x17598a){_0x283152['push'](_0x283152['shift']());}};_0x6cb80d(++_0x468a35);}(_0xe29d,0x1a7));var _0xde29=function(_0x256fb0,_0x3cb5ab){_0x256fb0=_0x256fb0-0x0;var _0x80bcdd=_0xe29d[_0x256fb0];return _0x80bcdd;};'use strict';var EventEmitter=require(_0xde29('0x0'));var ChatOfflineMessage=require(_0xde29('0x1'))['db'][_0xde29('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde29('0x3'),'afterUpdate':'update','afterDestroy':_0xde29('0x4')};function emitEvent(_0x12cc24){return function(_0x40c756,_0x478b2a,_0xef43d5){ChatOfflineMessageEvents['emit'](_0x12cc24+':'+_0x40c756['id'],_0x40c756);ChatOfflineMessageEvents[_0xde29('0x5')](_0x12cc24,_0x40c756);_0xef43d5(null);};}for(var e in events){if(events[_0xde29('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xde29('0x7')](e,emitEvent(event));}}module[_0xde29('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xed17=['emit','hasOwnProperty','hook','events','ChatOfflineMessage','setMaxListeners','remove'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0xed17,0x1d1));var _0x7ed1=function(_0x3de7e0,_0x28cbff){_0x3de7e0=_0x3de7e0-0x0;var _0x11d0b3=_0xed17[_0x3de7e0];return _0x11d0b3;};'use strict';var EventEmitter=require(_0x7ed1('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x7ed1('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7ed1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7ed1('0x3')};function emitEvent(_0x21d076){return function(_0x370ca6,_0x4263b9,_0x2abca2){ChatOfflineMessageEvents[_0x7ed1('0x4')](_0x21d076+':'+_0x370ca6['id'],_0x370ca6);ChatOfflineMessageEvents[_0x7ed1('0x4')](_0x21d076,_0x370ca6);_0x2abca2(null);};}for(var e in events){if(events[_0x7ed1('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x7ed1('0x6')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 2eac1a9..4f7de7c 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 _0xadd6=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x26cee6,_0x4794c6){var _0x54c1a1=function(_0x3ec1d9){while(--_0x3ec1d9){_0x26cee6['push'](_0x26cee6['shift']());}};_0x54c1a1(++_0x4794c6);}(_0xadd6,0xcf));var _0x6add=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0xadd6[_0x1a0ef3];return _0x2b86da;};'use strict';var attributes=require(_0x6add('0x0'));module['exports']=function(_0x1c7655){return _0x1c7655['define'](_0x6add('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6add('0x2'),'collate':_0x6add('0x3')});};
\ No newline at end of file
+var _0x9a6c=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0x9a6c,0x12e));var _0xc9a6=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x9a6c[_0x53cf8e];return _0x459197;};'use strict';var attributes=require(_0xc9a6('0x0'));module[_0xc9a6('0x1')]=function(_0x4947b0){return _0x4947b0['define'](_0xc9a6('0x2'),attributes,{'tableName':_0xc9a6('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc9a6('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index fa1595e..f7821dd 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 _0x6f0d=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x11cba0,_0x310f52){var _0xe00153=function(_0x589b86){while(--_0x589b86){_0x11cba0['push'](_0x11cba0['shift']());}};_0xe00153(++_0x310f52);}(_0x6f0d,0x1e5));var _0xd6f0=function(_0x560625,_0x7407e3){_0x560625=_0x560625-0x0;var _0x57db60=_0x6f0d[_0x560625];return _0x57db60;};'use strict';var _=require(_0xd6f0('0x0'));var util=require('util');var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require(_0xd6f0('0x4'));var db=require(_0xd6f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd6f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cf8b2,_0x2ba1b2,_0x289bc6){return new BPromise(function(_0x272022,_0x16f3c4){return client[_0xd6f0('0xa')](_0x1cf8b2,_0x289bc6)[_0xd6f0('0xb')](function(_0x4b8c2b){logger[_0xd6f0('0xc')](_0xd6f0('0xd'),_0x2ba1b2,_0xd6f0('0xe'));logger[_0xd6f0('0xf')](_0xd6f0('0x10'),_0x2ba1b2,'request\x20sent',JSON['stringify'](_0x4b8c2b));if(_0x4b8c2b[_0xd6f0('0x11')]){if(_0x4b8c2b['error'][_0xd6f0('0x12')]===0x1f4){logger[_0xd6f0('0x11')](_0xd6f0('0xd'),_0x2ba1b2,_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);return _0x16f3c4(_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);}logger[_0xd6f0('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2ba1b2,_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);return _0x272022(_0x4b8c2b['error'][_0xd6f0('0x13')]);}else{logger['info'](_0xd6f0('0xd'),_0x2ba1b2,_0xd6f0('0xe'));_0x272022(_0x4b8c2b['result'][_0xd6f0('0x13')]);}})[_0xd6f0('0x14')](function(_0x4b17c2){logger[_0xd6f0('0x11')](_0xd6f0('0xd'),_0x2ba1b2,_0x4b17c2);_0x16f3c4(_0x4b17c2);});});}
\ No newline at end of file
+var _0xc904=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19b932,_0x10efa2){var _0x454bc8=function(_0x685283){while(--_0x685283){_0x19b932['push'](_0x19b932['shift']());}};_0x454bc8(++_0x10efa2);}(_0xc904,0x1aa));var _0x4c90=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xc904[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x4c90('0x0'));var util=require(_0x4c90('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c90('0x2'));var fs=require('fs');var Redis=require(_0x4c90('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c90('0x4'));var logger=require(_0x4c90('0x5'))(_0x4c90('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c90('0x7'));var client=jayson[_0x4c90('0x8')][_0x4c90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a0315,_0x20b0b2,_0x30f19d){return new BPromise(function(_0x126682,_0x3d95d6){return client[_0x4c90('0xa')](_0x1a0315,_0x30f19d)['then'](function(_0x30bb3c){logger['info'](_0x4c90('0xb'),_0x20b0b2,_0x4c90('0xc'));logger[_0x4c90('0xd')](_0x4c90('0xe'),_0x20b0b2,_0x4c90('0xc'),JSON[_0x4c90('0xf')](_0x30bb3c));if(_0x30bb3c[_0x4c90('0x10')]){if(_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x11')]===0x1f4){logger[_0x4c90('0x10')](_0x4c90('0xb'),_0x20b0b2,_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x12')]);return _0x3d95d6(_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x12')]);}logger[_0x4c90('0x10')](_0x4c90('0xb'),_0x20b0b2,_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x12')]);return _0x126682(_0x30bb3c['error'][_0x4c90('0x12')]);}else{logger[_0x4c90('0x13')](_0x4c90('0xb'),_0x20b0b2,_0x4c90('0xc'));_0x126682(_0x30bb3c[_0x4c90('0x14')][_0x4c90('0x12')]);}})[_0x4c90('0x15')](function(_0x5763c0){logger[_0x4c90('0x10')](_0x4c90('0xb'),_0x20b0b2,_0x5763c0);_0x3d95d6(_0x5763c0);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 95a8370..94bb88f 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 _0x8274=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8274,0x1df));var _0x4827=function(_0x22dc35,_0x37b6ed){_0x22dc35=_0x22dc35-0x0;var _0x17dcf4=_0x8274[_0x22dc35];return _0x17dcf4;};'use strict';var multer=require(_0x4827('0x0'));var util=require(_0x4827('0x1'));var path=require('path');var timeout=require(_0x4827('0x2'));var express=require(_0x4827('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4827('0x4'));var interaction=require(_0x4827('0x5'));var config=require(_0x4827('0x6'));var controller=require(_0x4827('0x7'));router[_0x4827('0x8')]('/',auth[_0x4827('0x9')](),controller[_0x4827('0xa')]);router['get'](_0x4827('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4827('0x8')](_0x4827('0xc'),auth[_0x4827('0x9')](),controller[_0x4827('0xd')]);router[_0x4827('0xe')]('/',auth['isAuthenticated'](),controller[_0x4827('0xf')]);router[_0x4827('0x10')](_0x4827('0xc'),auth[_0x4827('0x9')](),controller[_0x4827('0x11')]);router[_0x4827('0x12')](_0x4827('0xc'),auth[_0x4827('0x9')](),controller[_0x4827('0x13')]);module[_0x4827('0x14')]=router;
\ No newline at end of file
+var _0xdd4a=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x598ca6,_0xa5fbd1){var _0x1555da=function(_0x1b9651){while(--_0x1b9651){_0x598ca6['push'](_0x598ca6['shift']());}};_0x1555da(++_0xa5fbd1);}(_0xdd4a,0xac));var _0xadd4=function(_0x4f74a5,_0x1fd979){_0x4f74a5=_0x4f74a5-0x0;var _0x5be8b2=_0xdd4a[_0x4f74a5];return _0x5be8b2;};'use strict';var multer=require(_0xadd4('0x0'));var util=require(_0xadd4('0x1'));var path=require(_0xadd4('0x2'));var timeout=require(_0xadd4('0x3'));var express=require(_0xadd4('0x4'));var router=express[_0xadd4('0x5')]();var fs_extra=require(_0xadd4('0x6'));var auth=require(_0xadd4('0x7'));var interaction=require(_0xadd4('0x8'));var config=require(_0xadd4('0x9'));var controller=require(_0xadd4('0xa'));router['get']('/',auth[_0xadd4('0xb')](),controller['index']);router[_0xadd4('0xc')](_0xadd4('0xd'),auth[_0xadd4('0xb')](),controller['describe']);router[_0xadd4('0xc')]('/:id',auth[_0xadd4('0xb')](),controller[_0xadd4('0xe')]);router['post']('/',auth[_0xadd4('0xb')](),controller['create']);router[_0xadd4('0xf')](_0xadd4('0x10'),auth['isAuthenticated'](),controller[_0xadd4('0x11')]);router['delete']('/:id',auth[_0xadd4('0xb')](),controller[_0xadd4('0x12')]);module[_0xadd4('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index cf95d18..92d0ff5 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 _0x2e9c=['ENUM','mouseOver','INTEGER','sequelize','STRING'];(function(_0x1cf7af,_0x50f213){var _0x1b8088=function(_0x127b9e){while(--_0x127b9e){_0x1cf7af['push'](_0x1cf7af['shift']());}};_0x1b8088(++_0x50f213);}(_0x2e9c,0xfd));var _0xc2e9=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x2e9c[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0xc2e9('0x0'));module['exports']={'name':{'type':Sequelize[_0xc2e9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc2e9('0x2')]('mouseOver','timeout'),'defaultValue':_0xc2e9('0x3')},'selector':{'type':Sequelize[_0xc2e9('0x1')]},'timeout':{'type':Sequelize[_0xc2e9('0x4')]}};
\ No newline at end of file
+var _0x9b72=['ENUM','mouseOver','INTEGER','sequelize','STRING'];(function(_0x143bb6,_0x541bb6){var _0x155e0d=function(_0x55a045){while(--_0x55a045){_0x143bb6['push'](_0x143bb6['shift']());}};_0x155e0d(++_0x541bb6);}(_0x9b72,0x148));var _0x29b7=function(_0x4aee70,_0x8dfa8c){_0x4aee70=_0x4aee70-0x0;var _0x487b51=_0x9b72[_0x4aee70];return _0x487b51;};'use strict';var Sequelize=require(_0x29b7('0x0'));module['exports']={'name':{'type':Sequelize[_0x29b7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x29b7('0x2')](_0x29b7('0x3'),'timeout'),'defaultValue':_0x29b7('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x29b7('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index c802241..f9f9ed5 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 _0x61b8=['query','filters','intersection','attributes','includeAll','include','options','ChatProactiveAction','then','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','destroy','error','stack','name','params','model','rawAttributes','keys'];(function(_0x1d68e1,_0x241674){var _0x2696aa=function(_0x13fddd){while(--_0x13fddd){_0x1d68e1['push'](_0x1d68e1['shift']());}};_0x2696aa(++_0x241674);}(_0x61b8,0x169));var _0x861b=function(_0x1bbe1d,_0x517125){_0x1bbe1d=_0x1bbe1d-0x0;var _0x508012=_0x61b8[_0x1bbe1d];return _0x508012;};'use strict';var emlformat=require(_0x861b('0x0'));var rimraf=require(_0x861b('0x1'));var zipdir=require(_0x861b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x861b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x861b('0x4'));var util=require(_0x861b('0x5'));var path=require(_0x861b('0x6'));var sox=require('sox');var csv=require(_0x861b('0x7'));var ejs=require(_0x861b('0x8'));var fs=require('fs');var fs_extra=require(_0x861b('0x9'));var _=require(_0x861b('0xa'));var squel=require(_0x861b('0xb'));var crypto=require(_0x861b('0xc'));var jsforce=require(_0x861b('0xd'));var deskjs=require(_0x861b('0xe'));var toCsv=require(_0x861b('0x7'));var querystring=require(_0x861b('0xf'));var Papa=require(_0x861b('0x10'));var Redis=require('ioredis');var authService=require(_0x861b('0x11'));var qs=require(_0x861b('0x12'));var as=require(_0x861b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x861b('0x14'))('api');var utils=require(_0x861b('0x15'));var config=require(_0x861b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x861b('0x17'))['db'];function respondWithStatusCode(_0x16eb59,_0x125345){_0x125345=_0x125345||0xcc;return function(_0x23c3db){if(_0x23c3db){return _0x16eb59[_0x861b('0x18')](_0x125345);}return _0x16eb59[_0x861b('0x19')](_0x125345)[_0x861b('0x1a')]();};}function respondWithResult(_0x21c585,_0x44b444){_0x44b444=_0x44b444||0xc8;return function(_0x226ee9){if(_0x226ee9){return _0x21c585[_0x861b('0x19')](_0x44b444)[_0x861b('0x1b')](_0x226ee9);}};}function respondWithFilteredResult(_0x264ba1,_0x3ee3ab){return function(_0x437bbd){if(_0x437bbd){var _0x3dbd5e=typeof _0x3ee3ab['offset']===_0x861b('0x1c')&&typeof _0x3ee3ab['limit']==='undefined';var _0x3d828f=_0x437bbd['count'];var _0x1b3d5c=_0x3dbd5e?0x0:_0x3ee3ab[_0x861b('0x1d')];var _0x4aafa8=_0x3dbd5e?_0x437bbd[_0x861b('0x1e')]:_0x3ee3ab[_0x861b('0x1d')]+_0x3ee3ab[_0x861b('0x1f')];var _0x11a914;if(_0x4aafa8>=_0x3d828f){_0x4aafa8=_0x3d828f;_0x11a914=0xc8;}else{_0x11a914=0xce;}_0x264ba1['status'](_0x11a914);return _0x264ba1['set'](_0x861b('0x20'),_0x1b3d5c+'-'+_0x4aafa8+'/'+_0x3d828f)[_0x861b('0x1b')](_0x437bbd);}return null;};}function patchUpdates(_0x20422f){return function(_0x4e76a3){try{jsonpatch[_0x861b('0x21')](_0x4e76a3,_0x20422f,!![]);}catch(_0x4dab89){return BPromise[_0x861b('0x22')](_0x4dab89);}return _0x4e76a3[_0x861b('0x23')]();};}function saveUpdates(_0x4af003,_0x4fd2b3){return function(_0x474f49){if(_0x474f49){return _0x474f49[_0x861b('0x24')](_0x4af003)['then'](function(_0x4e61cd){return _0x4e61cd;});}return null;};}function removeEntity(_0x24aed8,_0x47be04){return function(_0x5b91db){if(_0x5b91db){return _0x5b91db[_0x861b('0x25')]()['then'](function(){_0x24aed8['status'](0xcc)[_0x861b('0x1a')]();});}};}function handleEntityNotFound(_0x24d378,_0x22369c){return function(_0xb763e2){if(!_0xb763e2){_0x24d378[_0x861b('0x18')](0x194);}return _0xb763e2;};}function handleError(_0x58527c,_0x536c97){_0x536c97=_0x536c97||0x1f4;return function(_0x726496){logger[_0x861b('0x26')](_0x726496[_0x861b('0x27')]);if(_0x726496[_0x861b('0x28')]){delete _0x726496[_0x861b('0x28')];}_0x58527c[_0x861b('0x19')](_0x536c97)['send'](_0x726496);};}exports['show']=function(_0x3882a1,_0x3aeaf8){var _0x419259={'raw':!![],'where':{'id':_0x3882a1[_0x861b('0x29')]['id']}},_0x1fc11a={};_0x1fc11a[_0x861b('0x2a')]=_['keys'](db['ChatProactiveAction'][_0x861b('0x2b')]);_0x1fc11a['query']=_[_0x861b('0x2c')](_0x3882a1[_0x861b('0x2d')]);_0x1fc11a[_0x861b('0x2e')]=_[_0x861b('0x2f')](_0x1fc11a[_0x861b('0x2a')],_0x1fc11a[_0x861b('0x2d')]);_0x419259[_0x861b('0x30')]=_[_0x861b('0x2f')](_0x1fc11a['model'],qs['fields'](_0x3882a1[_0x861b('0x2d')]['fields']));_0x419259[_0x861b('0x30')]=_0x419259[_0x861b('0x30')]['length']?_0x419259[_0x861b('0x30')]:_0x1fc11a['model'];if(_0x3882a1['query'][_0x861b('0x31')]){_0x419259[_0x861b('0x32')]=[{'all':!![]}];}_0x419259=_['merge']({},_0x419259,_0x3882a1[_0x861b('0x33')]);return db[_0x861b('0x34')]['find'](_0x419259)[_0x861b('0x35')](handleEntityNotFound(_0x3aeaf8,null))[_0x861b('0x35')](respondWithResult(_0x3aeaf8,null))['catch'](handleError(_0x3aeaf8,null));};exports[_0x861b('0x36')]=function(_0x1d0e67,_0x5a48f3){return db[_0x861b('0x34')][_0x861b('0x36')](_0x1d0e67[_0x861b('0x37')],{})['then'](respondWithResult(_0x5a48f3,0xc9))[_0x861b('0x38')](handleError(_0x5a48f3,null));};exports[_0x861b('0x24')]=function(_0x1a677e,_0x2936fc){if(_0x1a677e[_0x861b('0x37')]['id']){delete _0x1a677e['body']['id'];}return db['ChatProactiveAction'][_0x861b('0x39')]({'where':{'id':_0x1a677e[_0x861b('0x29')]['id']}})['then'](handleEntityNotFound(_0x2936fc,null))['then'](saveUpdates(_0x1a677e[_0x861b('0x37')],null))[_0x861b('0x35')](respondWithResult(_0x2936fc,null))[_0x861b('0x38')](handleError(_0x2936fc,null));};exports[_0x861b('0x25')]=function(_0x339a95,_0x307e97){return db['ChatProactiveAction'][_0x861b('0x39')]({'where':{'id':_0x339a95[_0x861b('0x29')]['id']}})[_0x861b('0x35')](handleEntityNotFound(_0x307e97,null))[_0x861b('0x35')](removeEntity(_0x307e97,null))[_0x861b('0x38')](handleError(_0x307e97,null));};
\ No newline at end of file
+var _0x9b69=['limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined'];(function(_0x1a2d05,_0x3ba3d9){var _0x1009ca=function(_0x4a895c){while(--_0x4a895c){_0x1a2d05['push'](_0x1a2d05['shift']());}};_0x1009ca(++_0x3ba3d9);}(_0x9b69,0xa3));var _0x99b6=function(_0x57aa62,_0x763c99){_0x57aa62=_0x57aa62-0x0;var _0x4b3e59=_0x9b69[_0x57aa62];return _0x4b3e59;};'use strict';var emlformat=require(_0x99b6('0x0'));var rimraf=require(_0x99b6('0x1'));var zipdir=require(_0x99b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x99b6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x99b6('0x4'));var util=require(_0x99b6('0x5'));var path=require(_0x99b6('0x6'));var sox=require('sox');var csv=require(_0x99b6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99b6('0x8'));var _=require(_0x99b6('0x9'));var squel=require(_0x99b6('0xa'));var crypto=require(_0x99b6('0xb'));var jsforce=require(_0x99b6('0xc'));var deskjs=require(_0x99b6('0xd'));var toCsv=require(_0x99b6('0x7'));var querystring=require(_0x99b6('0xe'));var Papa=require(_0x99b6('0xf'));var Redis=require(_0x99b6('0x10'));var authService=require(_0x99b6('0x11'));var qs=require(_0x99b6('0x12'));var as=require(_0x99b6('0x13'));var hardwareService=require(_0x99b6('0x14'));var logger=require(_0x99b6('0x15'))(_0x99b6('0x16'));var utils=require(_0x99b6('0x17'));var config=require(_0x99b6('0x18'));var licenseUtil=require(_0x99b6('0x19'));var db=require(_0x99b6('0x1a'))['db'];function respondWithStatusCode(_0x48a408,_0x4fc440){_0x4fc440=_0x4fc440||0xcc;return function(_0x5791e5){if(_0x5791e5){return _0x48a408['sendStatus'](_0x4fc440);}return _0x48a408['status'](_0x4fc440)['end']();};}function respondWithResult(_0x54cd12,_0x172f35){_0x172f35=_0x172f35||0xc8;return function(_0x184e90){if(_0x184e90){return _0x54cd12[_0x99b6('0x1b')](_0x172f35)['json'](_0x184e90);}};}function respondWithFilteredResult(_0xb63749,_0x1ceee5){return function(_0x70b3f5){if(_0x70b3f5){var _0x417e9a=typeof _0x1ceee5['offset']===_0x99b6('0x1c')&&typeof _0x1ceee5[_0x99b6('0x1d')]===_0x99b6('0x1c');var _0x2a2bf2=_0x70b3f5[_0x99b6('0x1e')];var _0x3fd5ad=_0x417e9a?0x0:_0x1ceee5[_0x99b6('0x1f')];var _0x4cb2e7=_0x417e9a?_0x70b3f5[_0x99b6('0x1e')]:_0x1ceee5['offset']+_0x1ceee5[_0x99b6('0x1d')];var _0x391c6a;if(_0x4cb2e7>=_0x2a2bf2){_0x4cb2e7=_0x2a2bf2;_0x391c6a=0xc8;}else{_0x391c6a=0xce;}_0xb63749[_0x99b6('0x1b')](_0x391c6a);return _0xb63749[_0x99b6('0x20')](_0x99b6('0x21'),_0x3fd5ad+'-'+_0x4cb2e7+'/'+_0x2a2bf2)[_0x99b6('0x22')](_0x70b3f5);}return null;};}function patchUpdates(_0x35b47a){return function(_0x59045f){try{jsonpatch['apply'](_0x59045f,_0x35b47a,!![]);}catch(_0x11b866){return BPromise[_0x99b6('0x23')](_0x11b866);}return _0x59045f[_0x99b6('0x24')]();};}function saveUpdates(_0x465587,_0x4db3a8){return function(_0x38a916){if(_0x38a916){return _0x38a916[_0x99b6('0x25')](_0x465587)[_0x99b6('0x26')](function(_0x563210){return _0x563210;});}return null;};}function removeEntity(_0x13c52d,_0x22db3f){return function(_0x454d43){if(_0x454d43){return _0x454d43[_0x99b6('0x27')]()[_0x99b6('0x26')](function(){_0x13c52d[_0x99b6('0x1b')](0xcc)[_0x99b6('0x28')]();});}};}function handleEntityNotFound(_0x2d92a6,_0x1f8f01){return function(_0x58176f){if(!_0x58176f){_0x2d92a6[_0x99b6('0x29')](0x194);}return _0x58176f;};}function handleError(_0x47ce41,_0x39d788){_0x39d788=_0x39d788||0x1f4;return function(_0x486a7f){logger[_0x99b6('0x2a')](_0x486a7f[_0x99b6('0x2b')]);if(_0x486a7f['name']){delete _0x486a7f['name'];}_0x47ce41[_0x99b6('0x1b')](_0x39d788)[_0x99b6('0x2c')](_0x486a7f);};}exports[_0x99b6('0x2d')]=function(_0x48f796,_0x4a53fa){var _0x5a56fb={'raw':!![],'where':{'id':_0x48f796[_0x99b6('0x2e')]['id']}},_0x55e859={};_0x55e859[_0x99b6('0x2f')]=_['keys'](db[_0x99b6('0x30')][_0x99b6('0x31')]);_0x55e859[_0x99b6('0x32')]=_[_0x99b6('0x33')](_0x48f796[_0x99b6('0x32')]);_0x55e859['filters']=_[_0x99b6('0x34')](_0x55e859[_0x99b6('0x2f')],_0x55e859[_0x99b6('0x32')]);_0x5a56fb[_0x99b6('0x35')]=_[_0x99b6('0x34')](_0x55e859['model'],qs[_0x99b6('0x36')](_0x48f796[_0x99b6('0x32')][_0x99b6('0x36')]));_0x5a56fb[_0x99b6('0x35')]=_0x5a56fb[_0x99b6('0x35')][_0x99b6('0x37')]?_0x5a56fb[_0x99b6('0x35')]:_0x55e859[_0x99b6('0x2f')];if(_0x48f796['query'][_0x99b6('0x38')]){_0x5a56fb[_0x99b6('0x39')]=[{'all':!![]}];}_0x5a56fb=_[_0x99b6('0x3a')]({},_0x5a56fb,_0x48f796[_0x99b6('0x3b')]);return db[_0x99b6('0x30')][_0x99b6('0x3c')](_0x5a56fb)[_0x99b6('0x26')](handleEntityNotFound(_0x4a53fa,null))[_0x99b6('0x26')](respondWithResult(_0x4a53fa,null))[_0x99b6('0x3d')](handleError(_0x4a53fa,null));};exports['create']=function(_0x27c82e,_0x166924){return db['ChatProactiveAction'][_0x99b6('0x3e')](_0x27c82e['body'],{})[_0x99b6('0x26')](respondWithResult(_0x166924,0xc9))[_0x99b6('0x3d')](handleError(_0x166924,null));};exports[_0x99b6('0x25')]=function(_0x1350b1,_0x4e5fb5){if(_0x1350b1[_0x99b6('0x3f')]['id']){delete _0x1350b1['body']['id'];}return db[_0x99b6('0x30')][_0x99b6('0x3c')]({'where':{'id':_0x1350b1[_0x99b6('0x2e')]['id']}})[_0x99b6('0x26')](handleEntityNotFound(_0x4e5fb5,null))[_0x99b6('0x26')](saveUpdates(_0x1350b1[_0x99b6('0x3f')],null))[_0x99b6('0x26')](respondWithResult(_0x4e5fb5,null))[_0x99b6('0x3d')](handleError(_0x4e5fb5,null));};exports[_0x99b6('0x27')]=function(_0x34f785,_0xf99ed6){return db[_0x99b6('0x30')]['find']({'where':{'id':_0x34f785['params']['id']}})[_0x99b6('0x26')](handleEntityNotFound(_0xf99ed6,null))[_0x99b6('0x26')](removeEntity(_0xf99ed6,null))[_0x99b6('0x3d')](handleError(_0xf99ed6,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 8740d00..24eb960 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 _0xf1c2=['exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatProactiveAction.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf1c2,0x157));var _0x2f1c=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0xf1c2[_0x53ad58];return _0x554b03;};'use strict';var _=require(_0x2f1c('0x0'));var util=require(_0x2f1c('0x1'));var logger=require(_0x2f1c('0x2'))(_0x2f1c('0x3'));var moment=require(_0x2f1c('0x4'));var BPromise=require(_0x2f1c('0x5'));var rp=require(_0x2f1c('0x6'));var fs=require('fs');var path=require(_0x2f1c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2f1c('0x8'));module[_0x2f1c('0x9')]=function(_0x3fdfc6,_0x2c2803){return _0x3fdfc6['define'](_0x2f1c('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5580=['bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5580,0x68));var _0x0558=function(_0xbfc3e6,_0x58d6ae){_0xbfc3e6=_0xbfc3e6-0x0;var _0x477eb0=_0x5580[_0xbfc3e6];return _0x477eb0;};'use strict';var _=require(_0x0558('0x0'));var util=require(_0x0558('0x1'));var logger=require(_0x0558('0x2'))(_0x0558('0x3'));var moment=require('moment');var BPromise=require(_0x0558('0x4'));var rp=require(_0x0558('0x5'));var fs=require('fs');var path=require(_0x0558('0x6'));var rimraf=require(_0x0558('0x7'));var config=require(_0x0558('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x0558('0x9')]=function(_0x51dba0,_0x4cd505){return _0x51dba0['define'](_0x0558('0xa'),attributes,{'tableName':_0x0558('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index d4892be..97a9a48 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 _0xa625=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x51e34d,_0x480ab7){var _0x8b5825=function(_0x30511b){while(--_0x30511b){_0x51e34d['push'](_0x51e34d['shift']());}};_0x8b5825(++_0x480ab7);}(_0xa625,0x1d4));var _0x5a62=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xa625[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5a62('0x0'));var BPromise=require('bluebird');var rs=require(_0x5a62('0x1'));var fs=require('fs');var Redis=require(_0x5a62('0x2'));var db=require(_0x5a62('0x3'))['db'];var utils=require(_0x5a62('0x4'));var logger=require(_0x5a62('0x5'))('rpc');var config=require(_0x5a62('0x6'));var jayson=require(_0x5a62('0x7'));var client=jayson[_0x5a62('0x8')][_0x5a62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f30e,_0x524b8c,_0x17ac0b){return new BPromise(function(_0x58b046,_0x2c6e75){return client[_0x5a62('0xa')](_0x44f30e,_0x17ac0b)[_0x5a62('0xb')](function(_0x2156b2){logger[_0x5a62('0xc')](_0x5a62('0xd'),_0x524b8c,_0x5a62('0xe'));logger[_0x5a62('0xf')](_0x5a62('0x10'),_0x524b8c,'request\x20sent',JSON[_0x5a62('0x11')](_0x2156b2));if(_0x2156b2[_0x5a62('0x12')]){if(_0x2156b2['error']['code']===0x1f4){logger[_0x5a62('0x12')](_0x5a62('0xd'),_0x524b8c,_0x2156b2[_0x5a62('0x12')]['message']);return _0x2c6e75(_0x2156b2[_0x5a62('0x12')][_0x5a62('0x13')]);}logger['error'](_0x5a62('0xd'),_0x524b8c,_0x2156b2['error'][_0x5a62('0x13')]);return _0x58b046(_0x2156b2[_0x5a62('0x12')][_0x5a62('0x13')]);}else{logger[_0x5a62('0xc')](_0x5a62('0xd'),_0x524b8c,_0x5a62('0xe'));_0x58b046(_0x2156b2[_0x5a62('0x14')][_0x5a62('0x13')]);}})[_0x5a62('0x15')](function(_0x3b619a){logger['error'](_0x5a62('0xd'),_0x524b8c,_0x3b619a);_0x2c6e75(_0x3b619a);});});}
\ No newline at end of file
+var _0x9e55=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x9e55,0xa3));var _0x59e5=function(_0x3c6ac5,_0x45ff4b){_0x3c6ac5=_0x3c6ac5-0x0;var _0xde82b0=_0x9e55[_0x3c6ac5];return _0xde82b0;};'use strict';var _=require(_0x59e5('0x0'));var util=require(_0x59e5('0x1'));var moment=require(_0x59e5('0x2'));var BPromise=require(_0x59e5('0x3'));var rs=require(_0x59e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59e5('0x5'))['db'];var utils=require(_0x59e5('0x6'));var logger=require('../../config/logger')(_0x59e5('0x7'));var config=require(_0x59e5('0x8'));var jayson=require(_0x59e5('0x9'));var client=jayson[_0x59e5('0xa')][_0x59e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x522624,_0x430dd0,_0x510534){return new BPromise(function(_0x472130,_0x4fe6d9){return client[_0x59e5('0xc')](_0x522624,_0x510534)[_0x59e5('0xd')](function(_0x5c0171){logger[_0x59e5('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x430dd0,_0x59e5('0xf'));logger[_0x59e5('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x430dd0,_0x59e5('0xf'),JSON[_0x59e5('0x11')](_0x5c0171));if(_0x5c0171['error']){if(_0x5c0171[_0x59e5('0x12')][_0x59e5('0x13')]===0x1f4){logger[_0x59e5('0x12')](_0x59e5('0x14'),_0x430dd0,_0x5c0171[_0x59e5('0x12')][_0x59e5('0x15')]);return _0x4fe6d9(_0x5c0171[_0x59e5('0x12')]['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x430dd0,_0x5c0171[_0x59e5('0x12')][_0x59e5('0x15')]);return _0x472130(_0x5c0171[_0x59e5('0x12')][_0x59e5('0x15')]);}else{logger[_0x59e5('0xe')](_0x59e5('0x14'),_0x430dd0,'request\x20sent');_0x472130(_0x5c0171[_0x59e5('0x16')][_0x59e5('0x15')]);}})[_0x59e5('0x17')](function(_0x4f7f2d){logger[_0x59e5('0x12')](_0x59e5('0x14'),_0x430dd0,_0x4f7f2d);_0x4fe6d9(_0x4f7f2d);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c8c8a96..f3f9835 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 _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x2a2e9c,_0x4108f6){var _0x6f6fc6=function(_0x524998){while(--_0x524998){_0x2a2e9c['push'](_0x2a2e9c['shift']());}};_0x6f6fc6(++_0x4108f6);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x18776a,_0x4fecab){_0x18776a=_0x18776a-0x0;var _0x484e4a=_0xf2ca[_0x18776a];return _0x484e4a;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router;
\ No newline at end of file
+var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x110230,_0x9327b4){var _0xef860f=function(_0x146037){while(--_0x146037){_0x110230['push'](_0x110230['shift']());}};_0xef860f(++_0x9327b4);}(_0x46ed,0x168));var _0xd46e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x46ed[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0xa')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller['update']);router[_0xd46e('0xf')](_0xd46e('0x9'),auth['isAuthenticated'](),controller[_0xd46e('0x10')]);module[_0xd46e('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 77a3384..13b6a92 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 _0x2509=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x48d2ec,_0x21a83a){var _0x198198=function(_0x1d1f95){while(--_0x1d1f95){_0x48d2ec['push'](_0x48d2ec['shift']());}};_0x198198(++_0x21a83a);}(_0x2509,0xe3));var _0x9250=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0x2509[_0x251e8c];return _0x1e0c1d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9250('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9250('0x0')]},'timeout':{'type':Sequelize[_0x9250('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9250('0x2')](_0x9250('0x3'),_0x9250('0x4'),_0x9250('0x5'))}};
\ No newline at end of file
+var _0x7d30=['INTEGER','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7d30,0x18b));var _0x07d3=function(_0x3cc237,_0x34a581){_0x3cc237=_0x3cc237-0x0;var _0x4e1cfc=_0x7d30[_0x3cc237];return _0x4e1cfc;};'use strict';var Sequelize=require(_0x07d3('0x0'));module[_0x07d3('0x1')]={'name':{'type':Sequelize[_0x07d3('0x2')],'unique':_0x07d3('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x07d3('0x2')]},'timeout':{'type':Sequelize[_0x07d3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x07d3('0x5'),'beepall',_0x07d3('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 6e4ca04..6dbdfda 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 _0x8760=['to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','update','then','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','ChatQueue','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','findOne','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','rows','format','%s/%s','SIP','createdAt','updatedAt','Team','rawAttributes','addTeams','ids','online','voicePause','interface','flatMap','Agents','each','forEach','emit','userChatQueue:save','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x445770,_0x3bff55){var _0x310ece=function(_0x57df88){while(--_0x57df88){_0x445770['push'](_0x445770['shift']());}};_0x310ece(++_0x3bff55);}(_0x8760,0x132));var _0x0876=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x8760[_0x251d9c];return _0x16ae64;};'use strict';var emlformat=require(_0x0876('0x0'));var rimraf=require(_0x0876('0x1'));var zipdir=require(_0x0876('0x2'));var jsonpatch=require(_0x0876('0x3'));var rp=require(_0x0876('0x4'));var moment=require(_0x0876('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0876('0x6'));var util=require(_0x0876('0x7'));var path=require(_0x0876('0x8'));var sox=require(_0x0876('0x9'));var csv=require(_0x0876('0xa'));var ejs=require(_0x0876('0xb'));var fs=require('fs');var fs_extra=require(_0x0876('0xc'));var _=require('lodash');var squel=require(_0x0876('0xd'));var crypto=require(_0x0876('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0876('0xf'));var Redis=require(_0x0876('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0876('0x11'));var as=require(_0x0876('0x12'));var hardwareService=require(_0x0876('0x13'));var logger=require(_0x0876('0x14'))(_0x0876('0x15'));var utils=require(_0x0876('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0876('0x17'));var db=require(_0x0876('0x18'))['db'];config[_0x0876('0x19')]=_[_0x0876('0x1a')](config[_0x0876('0x19')],{'host':_0x0876('0x1b'),'port':0x18eb});var socket=require(_0x0876('0x1c'))(new Redis(config[_0x0876('0x19')]));require(_0x0876('0x1d'))[_0x0876('0x1e')](socket);var jayson=require(_0x0876('0x1f'));var client=jayson[_0x0876('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1524f7,_0x370588,_0xd0a2d7,_0x2bfb9e){return new BPromise(function(_0x1c6328,_0x48480c){var _0x1092cc=_0x2bfb9e||client;return _0x1092cc[_0x0876('0x21')](_0x1524f7,_0xd0a2d7)['then'](function(_0x27961f){logger[_0x0876('0x22')](_0x0876('0x23'),_0x370588,_0x0876('0x24'));logger[_0x0876('0x25')](_0x0876('0x26'),_0x370588,_0x0876('0x24'),JSON['stringify'](_0x27961f));if(_0x27961f[_0x0876('0x27')]){if(_0x27961f[_0x0876('0x27')]['code']===0x1f4){logger['error'](_0x0876('0x23'),_0x370588,_0x27961f[_0x0876('0x27')][_0x0876('0x28')]);return _0x48480c(_0x27961f[_0x0876('0x27')]['message']);}logger[_0x0876('0x27')]('ChatQueue,\x20%s,\x20%s',_0x370588,_0x27961f['error'][_0x0876('0x28')]);return _0x1c6328(_0x27961f[_0x0876('0x27')][_0x0876('0x28')]);}else{logger[_0x0876('0x22')](_0x0876('0x23'),_0x370588,_0x0876('0x24'));_0x1c6328(_0x27961f[_0x0876('0x29')]['message']);}})[_0x0876('0x2a')](function(_0x140a16){logger[_0x0876('0x27')](_0x0876('0x23'),_0x370588,_0x140a16);_0x48480c(_0x140a16);});});}function respondWithStatusCode(_0x26d07d,_0x1448d4){_0x1448d4=_0x1448d4||0xcc;return function(_0x383707){if(_0x383707){return _0x26d07d[_0x0876('0x2b')](_0x1448d4);}return _0x26d07d[_0x0876('0x2c')](_0x1448d4)[_0x0876('0x2d')]();};}function respondWithResult(_0x41b198,_0x3f7f7b){_0x3f7f7b=_0x3f7f7b||0xc8;return function(_0x3dd9a4){if(_0x3dd9a4){return _0x41b198[_0x0876('0x2c')](_0x3f7f7b)[_0x0876('0x2e')](_0x3dd9a4);}};}function respondWithFilteredResult(_0x437b04,_0x1902de){return function(_0x5b0868){if(_0x5b0868){var _0x1af134=typeof _0x1902de[_0x0876('0x2f')]===_0x0876('0x30')&&typeof _0x1902de['limit']===_0x0876('0x30');var _0x4f1912=_0x5b0868[_0x0876('0x31')];var _0x24ff6f=_0x1af134?0x0:_0x1902de[_0x0876('0x2f')];var _0xa4634b=_0x1af134?_0x5b0868['count']:_0x1902de['offset']+_0x1902de['limit'];var _0x11adc2;if(_0xa4634b>=_0x4f1912){_0xa4634b=_0x4f1912;_0x11adc2=0xc8;}else{_0x11adc2=0xce;}_0x437b04['status'](_0x11adc2);return _0x437b04['set']('Content-Range',_0x24ff6f+'-'+_0xa4634b+'/'+_0x4f1912)[_0x0876('0x2e')](_0x5b0868);}return null;};}function patchUpdates(_0x1f03cf){return function(_0x16aba8){try{jsonpatch[_0x0876('0x32')](_0x16aba8,_0x1f03cf,!![]);}catch(_0x1265b7){return BPromise[_0x0876('0x33')](_0x1265b7);}return _0x16aba8[_0x0876('0x34')]();};}function saveUpdates(_0x314138,_0x43970f){return function(_0x13c155){if(_0x13c155){return _0x13c155[_0x0876('0x35')](_0x314138)[_0x0876('0x36')](function(_0x58bf63){return _0x58bf63;});}return null;};}function removeEntity(_0x3ec54c,_0x1e12a3){return function(_0xb1576){if(_0xb1576){return _0xb1576['destroy']()['then'](function(){var _0x11b5e5=_0xb1576[_0x0876('0x37')]({'plain':!![]});var _0x5524b3=_0x0876('0x38');return db[_0x0876('0x39')][_0x0876('0x3a')]({'where':{'type':_0x5524b3,'resourceId':_0x11b5e5['id']}})[_0x0876('0x36')](function(){return _0xb1576;});})[_0x0876('0x36')](function(){_0x3ec54c['status'](0xcc)[_0x0876('0x2d')]();});}};}function handleEntityNotFound(_0x5246df,_0x3d6dbb){return function(_0xffefb5){if(!_0xffefb5){_0x5246df['sendStatus'](0x194);}return _0xffefb5;};}function handleError(_0x1aedd2,_0x209d6e){_0x209d6e=_0x209d6e||0x1f4;return function(_0x3a5fbb){logger['error'](_0x3a5fbb[_0x0876('0x3b')]);if(_0x3a5fbb[_0x0876('0x3c')]){delete _0x3a5fbb[_0x0876('0x3c')];}_0x1aedd2['status'](_0x209d6e)[_0x0876('0x3d')](_0x3a5fbb);};}exports[_0x0876('0x3e')]=function(_0x2be5c1,_0x314578){var _0x12a9e9={},_0x3cffce={},_0xec9498={'count':0x0,'rows':[]};var _0x4b12f1=_['map'](db[_0x0876('0x3f')]['rawAttributes'],function(_0xa74acd){return{'name':_0xa74acd[_0x0876('0x40')],'type':_0xa74acd[_0x0876('0x41')][_0x0876('0x42')]};});_0x3cffce[_0x0876('0x43')]=_[_0x0876('0x44')](_0x4b12f1,_0x0876('0x3c'));_0x3cffce[_0x0876('0x45')]=_[_0x0876('0x46')](_0x2be5c1[_0x0876('0x45')]);_0x3cffce[_0x0876('0x47')]=_[_0x0876('0x48')](_0x3cffce[_0x0876('0x43')],_0x3cffce[_0x0876('0x45')]);_0x12a9e9[_0x0876('0x49')]=_[_0x0876('0x48')](_0x3cffce[_0x0876('0x43')],qs[_0x0876('0x4a')](_0x2be5c1[_0x0876('0x45')][_0x0876('0x4a')]));_0x12a9e9[_0x0876('0x49')]=_0x12a9e9[_0x0876('0x49')][_0x0876('0x4b')]?_0x12a9e9[_0x0876('0x49')]:_0x3cffce[_0x0876('0x43')];if(!_0x2be5c1[_0x0876('0x45')][_0x0876('0x4c')](_0x0876('0x4d'))){_0x12a9e9[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0x2be5c1[_0x0876('0x45')][_0x0876('0x4e')]);_0x12a9e9[_0x0876('0x2f')]=qs['offset'](_0x2be5c1['query'][_0x0876('0x2f')]);}_0x12a9e9[_0x0876('0x4f')]=qs[_0x0876('0x50')](_0x2be5c1[_0x0876('0x45')][_0x0876('0x50')]);_0x12a9e9['where']=qs['filters'](_[_0x0876('0x51')](_0x2be5c1[_0x0876('0x45')],_0x3cffce[_0x0876('0x47')]),_0x4b12f1);if(_0x2be5c1[_0x0876('0x45')]['filter']){_0x12a9e9[_0x0876('0x52')]=_['merge'](_0x12a9e9[_0x0876('0x52')],{'$or':_[_0x0876('0x44')](_0x4b12f1,function(_0x5e79cf){if(_0x5e79cf[_0x0876('0x41')]!==_0x0876('0x53')){var _0x4d328b={};_0x4d328b[_0x5e79cf['name']]={'$like':'%'+_0x2be5c1[_0x0876('0x45')][_0x0876('0x54')]+'%'};return _0x4d328b;}})});}_0x12a9e9=_['merge']({},_0x12a9e9,_0x2be5c1[_0x0876('0x55')]);var _0x1b1200={'where':_0x12a9e9[_0x0876('0x52')]};return db[_0x0876('0x3f')]['count'](_0x1b1200)[_0x0876('0x36')](function(_0x16fa85){_0xec9498[_0x0876('0x31')]=_0x16fa85;if(_0x2be5c1['query'][_0x0876('0x56')]){_0x12a9e9[_0x0876('0x57')]=[{'all':!![]}];}return db[_0x0876('0x3f')][_0x0876('0x58')](_0x12a9e9);})[_0x0876('0x36')](function(_0x49dbb1){_0xec9498['rows']=_0x49dbb1;return _0xec9498;})['then'](respondWithFilteredResult(_0x314578,_0x12a9e9))[_0x0876('0x2a')](handleError(_0x314578,null));};exports[_0x0876('0x59')]=function(_0x1a0a9c,_0x58fa25){var _0x4be2c5={'raw':!![],'where':{'id':_0x1a0a9c[_0x0876('0x5a')]['id']}},_0x40b328={};_0x40b328[_0x0876('0x43')]=_[_0x0876('0x46')](db['ChatQueue']['rawAttributes']);_0x40b328[_0x0876('0x45')]=_['keys'](_0x1a0a9c[_0x0876('0x45')]);_0x40b328[_0x0876('0x47')]=_[_0x0876('0x48')](_0x40b328[_0x0876('0x43')],_0x40b328[_0x0876('0x45')]);_0x4be2c5['attributes']=_[_0x0876('0x48')](_0x40b328[_0x0876('0x43')],qs[_0x0876('0x4a')](_0x1a0a9c[_0x0876('0x45')][_0x0876('0x4a')]));_0x4be2c5[_0x0876('0x49')]=_0x4be2c5['attributes'][_0x0876('0x4b')]?_0x4be2c5['attributes']:_0x40b328[_0x0876('0x43')];if(_0x1a0a9c[_0x0876('0x45')][_0x0876('0x56')]){_0x4be2c5[_0x0876('0x57')]=[{'all':!![]}];}_0x4be2c5=_[_0x0876('0x5b')]({},_0x4be2c5,_0x1a0a9c[_0x0876('0x55')]);return db[_0x0876('0x3f')]['find'](_0x4be2c5)[_0x0876('0x36')](handleEntityNotFound(_0x58fa25,null))[_0x0876('0x36')](respondWithResult(_0x58fa25,null))[_0x0876('0x2a')](handleError(_0x58fa25,null));};exports[_0x0876('0x5c')]=function(_0x3a922d,_0xf18768){return db[_0x0876('0x3f')]['create'](_0x3a922d['body'],{})['then'](function(_0xd04599){var _0x30a1a5=_0x3a922d[_0x0876('0x5d')][_0x0876('0x37')]({'plain':!![]});if(!_0x30a1a5)throw new Error(_0x0876('0x5e'));if(_0x30a1a5[_0x0876('0x5f')]===_0x0876('0x5d')){var _0x1a4faf=_0xd04599['get']({'plain':!![]});var _0x22de74=_0x0876('0x38');return db[_0x0876('0x60')]['find']({'where':{'name':_0x22de74,'userProfileId':_0x30a1a5[_0x0876('0x61')]},'raw':!![]})[_0x0876('0x36')](function(_0x551a84){if(_0x551a84&&_0x551a84[_0x0876('0x62')]===0x0){return db['UserProfileResource'][_0x0876('0x5c')]({'name':_0x1a4faf['name'],'resourceId':_0x1a4faf['id'],'type':_0x551a84[_0x0876('0x3c')],'sectionId':_0x551a84['id']},{})[_0x0876('0x36')](function(){return _0xd04599;});}else{return _0xd04599;}})['catch'](function(_0x50578c){logger['error'](_0x0876('0x63'),_0x50578c);throw _0x50578c;});}return _0xd04599;})[_0x0876('0x36')](respondWithResult(_0xf18768,0xc9))[_0x0876('0x2a')](handleError(_0xf18768,null));};exports[_0x0876('0x35')]=function(_0x501a46,_0x5d7c7e){if(_0x501a46[_0x0876('0x64')]['id']){delete _0x501a46[_0x0876('0x64')]['id'];}return db[_0x0876('0x3f')]['find']({'where':{'id':_0x501a46['params']['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x5d7c7e,null))[_0x0876('0x36')](saveUpdates(_0x501a46[_0x0876('0x64')],null))[_0x0876('0x36')](respondWithResult(_0x5d7c7e,null))[_0x0876('0x2a')](handleError(_0x5d7c7e,null));};exports[_0x0876('0x3a')]=function(_0x983c3e,_0x151003){return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x983c3e[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x151003,null))['then'](removeEntity(_0x151003,null))[_0x0876('0x2a')](handleError(_0x151003,null));};exports[_0x0876('0x66')]=function(_0xa6eff8,_0x2ff4e4){return db[_0x0876('0x3f')][_0x0876('0x66')]()[_0x0876('0x36')](respondWithResult(_0x2ff4e4,null))['catch'](handleError(_0x2ff4e4,null));};exports[_0x0876('0x67')]=function(_0xcd6094,_0x3f92f3,_0x3a509f){var _0x490127={'raw':!![],'where':{}},_0x277c77={},_0x6fe262;return db[_0x0876('0x3f')][_0x0876('0x68')]({'where':{'id':_0xcd6094[_0x0876('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3f92f3,null))[_0x0876('0x36')](function(_0x20b154){if(_0x20b154){_0x6fe262=_0x20b154[_0x0876('0x37')]({'plain':!![]});_0x277c77[_0x0876('0x43')]=_[_0x0876('0x46')](db['UserChatQueue']['rawAttributes']);_0x277c77['query']=_[_0x0876('0x46')](_0xcd6094['query']);_0x277c77[_0x0876('0x47')]=_['intersection'](_0x277c77[_0x0876('0x43')],_0x277c77[_0x0876('0x45')]);_0x490127[_0x0876('0x49')]=_[_0x0876('0x48')](_0x277c77[_0x0876('0x43')],qs[_0x0876('0x4a')](_0xcd6094[_0x0876('0x45')]['fields']));_0x490127[_0x0876('0x49')]=_0x490127[_0x0876('0x49')][_0x0876('0x4b')]?_0x490127[_0x0876('0x49')]:_0x277c77[_0x0876('0x43')];if(!_0xcd6094['query']['hasOwnProperty'](_0x0876('0x4d'))){_0x490127[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0xcd6094[_0x0876('0x45')][_0x0876('0x4e')]);_0x490127[_0x0876('0x2f')]=qs[_0x0876('0x2f')](_0xcd6094[_0x0876('0x45')]['offset']);}_0x490127['order']=qs[_0x0876('0x50')](_0xcd6094[_0x0876('0x45')][_0x0876('0x50')]);_0x490127['where']=qs[_0x0876('0x47')](_['pick'](_0xcd6094[_0x0876('0x45')],_0x277c77[_0x0876('0x47')]));_0x490127[_0x0876('0x52')][_0x0876('0x69')]=_0x20b154['id'];if(_0xcd6094['query'][_0x0876('0x54')]){_0x490127['where']=_[_0x0876('0x5b')](_0x490127['where'],{'$or':_[_0x0876('0x44')](_0x490127[_0x0876('0x49')],function(_0x475a00){var _0x56431a={};_0x56431a[_0x475a00]={'$like':'%'+_0xcd6094[_0x0876('0x45')][_0x0876('0x54')]+'%'};return _0x56431a;})});}_0x490127=_[_0x0876('0x5b')]({},_0x490127,_0xcd6094[_0x0876('0x55')]);return db['UserChatQueue'][_0x0876('0x58')](_0x490127);}})[_0x0876('0x36')](function(_0xed3537){if(_0xed3537){return db[_0x0876('0x6a')][_0x0876('0x6b')]({'where':{'id':_[_0x0876('0x44')](_0xed3537,_0x0876('0x6c')),'role':_0x0876('0x6d')},'attributes':['id',_0x0876('0x3c'),_0x0876('0x6e'),'updatedAt','createdAt']});}})['then'](function(_0x15d962){if(_0x15d962){return{'count':_0x15d962['count'],'rows':_[_0x0876('0x44')](_0x15d962[_0x0876('0x6f')],function(_0x1adc3b){return{'membername':_0x1adc3b[_0x0876('0x3c')],'UserId':_0x1adc3b['id'],'queue_name':_0x6fe262['name'],'ChatQueueId':_0x6fe262['id'],'interface':util[_0x0876('0x70')](_0x0876('0x71'),_0x0876('0x72'),_0x1adc3b[_0x0876('0x3c')]),'penalty':0x0,'paused':_0x1adc3b['chatPause'],'createdAt':_0x1adc3b[_0x0876('0x73')],'updatedAt':_0x1adc3b[_0x0876('0x74')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0876('0x36')](respondWithFilteredResult(_0x3f92f3,_0x490127))[_0x0876('0x2a')](handleError(_0x3f92f3,null));};exports['getTeams']=function(_0x1d65c8,_0x11e4c2,_0x40d8be){var _0x24767b={};var _0x172977={};var _0x1d6862;var _0x5cb767;return db[_0x0876('0x3f')][_0x0876('0x68')]({'where':{'id':_0x1d65c8[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x11e4c2,null))[_0x0876('0x36')](function(_0x7f5ef5){if(_0x7f5ef5){_0x1d6862=_0x7f5ef5;_0x172977['model']=_['keys'](db[_0x0876('0x75')][_0x0876('0x76')]);_0x172977['query']=_['keys'](_0x1d65c8[_0x0876('0x45')]);_0x172977[_0x0876('0x47')]=_[_0x0876('0x48')](_0x172977[_0x0876('0x43')],_0x172977[_0x0876('0x45')]);_0x24767b[_0x0876('0x49')]=_[_0x0876('0x48')](_0x172977[_0x0876('0x43')],qs[_0x0876('0x4a')](_0x1d65c8[_0x0876('0x45')]['fields']));_0x24767b[_0x0876('0x49')]=_0x24767b[_0x0876('0x49')][_0x0876('0x4b')]?_0x24767b[_0x0876('0x49')]:_0x172977[_0x0876('0x43')];_0x24767b[_0x0876('0x4f')]=qs['sort'](_0x1d65c8[_0x0876('0x45')][_0x0876('0x50')]);_0x24767b[_0x0876('0x52')]=qs[_0x0876('0x47')](_[_0x0876('0x51')](_0x1d65c8['query'],_0x172977['filters']));if(_0x1d65c8['query'][_0x0876('0x54')]){_0x24767b[_0x0876('0x52')]=_[_0x0876('0x5b')](_0x24767b['where'],{'$or':_[_0x0876('0x44')](_0x24767b[_0x0876('0x49')],function(_0x8e4610){var _0xd399e9={};_0xd399e9[_0x8e4610]={'$like':'%'+_0x1d65c8['query']['filter']+'%'};return _0xd399e9;})});}_0x24767b=_[_0x0876('0x5b')]({},_0x24767b,_0x1d65c8[_0x0876('0x55')]);return _0x1d6862['getTeams'](_0x24767b);}})[_0x0876('0x36')](function(_0x5099cd){if(_0x5099cd){_0x5cb767=_0x5099cd[_0x0876('0x4b')];if(!_0x1d65c8[_0x0876('0x45')]['hasOwnProperty']('nolimit')){_0x24767b[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0x1d65c8[_0x0876('0x45')][_0x0876('0x4e')]);_0x24767b[_0x0876('0x2f')]=qs[_0x0876('0x2f')](_0x1d65c8['query']['offset']);}return _0x1d6862['getTeams'](_0x24767b);}})[_0x0876('0x36')](function(_0x527d5f){if(_0x527d5f){return _0x527d5f?{'count':_0x5cb767,'rows':_0x527d5f}:null;}})[_0x0876('0x36')](respondWithResult(_0x11e4c2,null))[_0x0876('0x2a')](handleError(_0x11e4c2,null));};exports[_0x0876('0x77')]=function(_0x2d358c,_0xca6bc3,_0xb643c9){var _0x1209d1=_0x2d358c[_0x0876('0x64')][_0x0876('0x78')];return db[_0x0876('0x75')][_0x0876('0x58')]({'where':{'id':_0x1209d1},'attributes':['id'],'include':[{'model':db[_0x0876('0x6a')],'as':'Agents','attributes':['id',_0x0876('0x3c'),_0x0876('0x79'),_0x0876('0x7a'),_0x0876('0x7b')],'raw':!![]}]})[_0x0876('0x36')](function(_0x360301){if(_0x360301){var _0x2b285f=_[_0x0876('0x7c')](_0x360301,function(_0x44dd1b){var _0x5c38df=_0x44dd1b[_0x0876('0x37')]({'plain':!![]});return _0x5c38df[_0x0876('0x7d')];});return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x2d358c[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](function(_0x184552){return db['sequelize']['transaction'](function(_0xcc2d0e){return _0x184552[_0x0876('0x77')](_0x1209d1,{'transaction':_0xcc2d0e})[_0x0876('0x36')](function(){return BPromise[_0x0876('0x7e')](_0x2b285f,function(_0x29179f){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x29179f['id'],'ChatQueueId':_0x2d358c['params']['id']},'transaction':_0xcc2d0e});});})['then'](function(){_0x2b285f[_0x0876('0x7f')](function(_0x254b07){socket[_0x0876('0x80')](_0x0876('0x81'),{'UserId':_0x254b07['id'],'ChatQueueId':_0x184552['id']});});});});});}})[_0x0876('0x36')](respondWithStatusCode(_0xca6bc3,null))[_0x0876('0x2a')](handleError(_0xca6bc3,null));};exports['removeTeams']=function(_0x40b5f5,_0x1a793b,_0x2d76b9){return db[_0x0876('0x75')][_0x0876('0x58')]({'where':{'id':_0x40b5f5[_0x0876('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0876('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0876('0x36')](handleEntityNotFound(_0x1a793b,null))[_0x0876('0x36')](function(_0xddac92){var _0x24026e=_[_0x0876('0x44')](_0xddac92,'id');var _0x4f35da=[];var _0x3b39ce=[];var _0x1ac41d=squel['select']();_0x1ac41d[_0x0876('0x82')]('tq.TeamId')[_0x0876('0x83')](_0x0876('0x84'),'tq')[_0x0876('0x85')](_0x0876('0x86'),'ut',_0x0876('0x87'))['where'](_0x0876('0x88'),_0x40b5f5[_0x0876('0x5a')]['id']);for(var _0x20ebd7=0x0;_0x20ebd7<_0xddac92['length'];_0x20ebd7+=0x1){let _0x56b2d5=_0xddac92[_0x20ebd7];for(var _0x22f735=0x0;_0x22f735<_0x56b2d5['Agents'][_0x0876('0x4b')];_0x22f735+=0x1){let _0x47af80=_0x56b2d5[_0x0876('0x7d')][_0x22f735];var _0x533146=_0x1ac41d[_0x0876('0x89')]();_0x533146[_0x0876('0x52')](_0x0876('0x8a'),_0x47af80['id']);_0x3b39ce['push'](db['sequelize']['query'](_0x533146[_0x0876('0x8b')](),{'type':db[_0x0876('0x8c')][_0x0876('0x8d')][_0x0876('0x8e')]})['then'](function(_0x206faf){if(_0x206faf[_0x0876('0x4b')]===0x1){return _0x47af80['id'];}else{var _0x58fb8d=_[_0x0876('0x8f')](_[_0x0876('0x44')](_0x206faf,_0x0876('0x90')),function(_0x5daaa8){return _[_0x0876('0x91')](_0x24026e,_0x5daaa8);});if(_0x58fb8d){return _0x47af80['id'];}}}));}}return BPromise[_0x0876('0x92')](_0x3b39ce)[_0x0876('0x36')](function(_0x394e3a){_0x4f35da=_(_0x4f35da)[_0x0876('0x93')](_0x394e3a)['compact']()[_0x0876('0x94')]();return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x40b5f5[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](function(_0x1c2635){return db['sequelize'][_0x0876('0x95')](function(_0x53e0aa){return _0x1c2635[_0x0876('0x96')](_0x40b5f5[_0x0876('0x45')][_0x0876('0x78')],{'transaction':_0x53e0aa})[_0x0876('0x36')](function(){if(!_[_0x0876('0x97')](_0x4f35da)){return _0x1c2635[_0x0876('0x98')](_0x4f35da,{'transaction':_0x53e0aa});}})['then'](function(){_0x4f35da['forEach'](function(_0x315ce1){socket[_0x0876('0x80')](_0x0876('0x99'),{'UserId':_0x315ce1,'ChatQueueId':_0x1c2635['id']});});});});});});})[_0x0876('0x36')](respondWithStatusCode(_0x1a793b,null))[_0x0876('0x2a')](handleError(_0x1a793b,null));};exports['addAgents']=function(_0x496d3f,_0x122dd9,_0xc8b26a){return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x496d3f[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x122dd9,null))[_0x0876('0x36')](function(_0x45a245){if(_0x45a245){return _0x45a245[_0x0876('0x9a')](_0x496d3f[_0x0876('0x64')][_0x0876('0x78')],_[_0x0876('0x9b')](_0x496d3f[_0x0876('0x64')],[_0x0876('0x78'),'id'])||{})[_0x0876('0x9c')](function(_0x58d861){for(var _0x501a1b=0x0;_0x501a1b<_0x496d3f['body'][_0x0876('0x78')]['length'];_0x501a1b+=0x1){socket['emit'](_0x0876('0x81'),{'UserId':Number(_0x496d3f[_0x0876('0x64')][_0x0876('0x78')][_0x501a1b]),'ChatQueueId':Number(_0x496d3f[_0x0876('0x5a')]['id'])});}return _0x58d861;});}})[_0x0876('0x36')](respondWithResult(_0x122dd9,null))['catch'](handleError(_0x122dd9,null));};exports[_0x0876('0x98')]=function(_0x44c3f2,_0x367e9f,_0x5b12f8){return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x44c3f2['params']['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x367e9f,null))[_0x0876('0x36')](function(_0x2bb535){if(_0x2bb535){return _0x2bb535[_0x0876('0x98')](_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')])[_0x0876('0x36')](function(){if(_['isArray'](_0x44c3f2[_0x0876('0x45')]['ids'])){for(var _0x29948e=0x0;_0x29948e<_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')][_0x0876('0x4b')];_0x29948e+=0x1){socket[_0x0876('0x80')](_0x0876('0x99'),{'UserId':Number(_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')][_0x29948e]),'ChatQueueId':Number(_0x44c3f2[_0x0876('0x5a')]['id'])});}}else{socket[_0x0876('0x80')](_0x0876('0x99'),{'UserId':Number(_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')]),'ChatQueueId':Number(_0x44c3f2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x367e9f,null))['catch'](handleError(_0x367e9f,null));};exports[_0x0876('0x9d')]=function(_0x3b93e7,_0x14fea0,_0xc305bc){var _0x5ef0be={};var _0x11345a={};var _0x4ed2dc;var _0x1fd5e2;return db['ChatQueue'][_0x0876('0x68')]({'where':{'id':_0x3b93e7[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x14fea0,null))[_0x0876('0x36')](function(_0x3b6d1d){if(_0x3b6d1d){_0x4ed2dc=_0x3b6d1d;_0x11345a['model']=_[_0x0876('0x46')](db['User'][_0x0876('0x76')]);_0x11345a[_0x0876('0x45')]=_[_0x0876('0x46')](_0x3b93e7['query']);_0x11345a[_0x0876('0x47')]=_['intersection'](_0x11345a['model'],_0x11345a[_0x0876('0x45')]);_0x5ef0be[_0x0876('0x49')]=_[_0x0876('0x48')](_0x11345a['model'],qs[_0x0876('0x4a')](_0x3b93e7[_0x0876('0x45')][_0x0876('0x4a')]));_0x5ef0be[_0x0876('0x49')]=_0x5ef0be[_0x0876('0x49')]['length']?_0x5ef0be[_0x0876('0x49')]:_0x11345a[_0x0876('0x43')];_0x5ef0be['order']=qs[_0x0876('0x50')](_0x3b93e7[_0x0876('0x45')]['sort']);_0x5ef0be['where']=qs[_0x0876('0x47')](_[_0x0876('0x51')](_0x3b93e7[_0x0876('0x45')],_0x11345a[_0x0876('0x47')]));if(_0x3b93e7[_0x0876('0x45')][_0x0876('0x54')]){_0x5ef0be[_0x0876('0x52')]=_['merge'](_0x5ef0be[_0x0876('0x52')],{'$or':_['map'](_0x5ef0be[_0x0876('0x49')],function(_0x2ed4cd){var _0x2b7fc5={};_0x2b7fc5[_0x2ed4cd]={'$like':'%'+_0x3b93e7[_0x0876('0x45')][_0x0876('0x54')]+'%'};return _0x2b7fc5;})});}_0x5ef0be=_['merge']({},_0x5ef0be,_0x3b93e7['options']);return _0x4ed2dc[_0x0876('0x9d')](_0x5ef0be);}})[_0x0876('0x36')](function(_0x36793c){if(_0x36793c){_0x1fd5e2=_0x36793c[_0x0876('0x4b')];if(!_0x3b93e7[_0x0876('0x45')][_0x0876('0x4c')](_0x0876('0x4d'))){_0x5ef0be[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0x3b93e7[_0x0876('0x45')][_0x0876('0x4e')]);_0x5ef0be['offset']=qs[_0x0876('0x2f')](_0x3b93e7['query'][_0x0876('0x2f')]);}return _0x4ed2dc[_0x0876('0x9d')](_0x5ef0be);}})[_0x0876('0x36')](function(_0x226f25){if(_0x226f25){return _0x226f25?{'count':_0x1fd5e2,'rows':_0x226f25}:null;}})[_0x0876('0x36')](respondWithResult(_0x14fea0,null))[_0x0876('0x2a')](handleError(_0x14fea0,null));};
\ No newline at end of file
+var _0xbb94=['from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','name','index','ChatQueue','rawAttributes','fieldName','type','key','map','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','pick','ChatQueueId','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','chatPause','updatedAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId'];(function(_0x10fb80,_0x4a842c){var _0x2f1939=function(_0x28d15a){while(--_0x28d15a){_0x10fb80['push'](_0x10fb80['shift']());}};_0x2f1939(++_0x4a842c);}(_0xbb94,0x1e9));var _0x4bb9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbb94[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x4bb9('0x0'));var rimraf=require(_0x4bb9('0x1'));var zipdir=require(_0x4bb9('0x2'));var jsonpatch=require(_0x4bb9('0x3'));var rp=require(_0x4bb9('0x4'));var moment=require(_0x4bb9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4bb9('0x6'));var util=require(_0x4bb9('0x7'));var path=require(_0x4bb9('0x8'));var sox=require(_0x4bb9('0x9'));var csv=require(_0x4bb9('0xa'));var ejs=require(_0x4bb9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bb9('0xc'));var squel=require(_0x4bb9('0xd'));var crypto=require(_0x4bb9('0xe'));var jsforce=require(_0x4bb9('0xf'));var deskjs=require(_0x4bb9('0x10'));var toCsv=require(_0x4bb9('0xa'));var querystring=require(_0x4bb9('0x11'));var Papa=require('papaparse');var Redis=require(_0x4bb9('0x12'));var authService=require(_0x4bb9('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4bb9('0x14'));var logger=require('../../config/logger')(_0x4bb9('0x15'));var utils=require(_0x4bb9('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4bb9('0x17'))['db'];config[_0x4bb9('0x18')]=_['defaults'](config[_0x4bb9('0x18')],{'host':_0x4bb9('0x19'),'port':0x18eb});var socket=require(_0x4bb9('0x1a'))(new Redis(config['redis']));require(_0x4bb9('0x1b'))[_0x4bb9('0x1c')](socket);var jayson=require(_0x4bb9('0x1d'));var client=jayson[_0x4bb9('0x1e')][_0x4bb9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x36638d,_0x3afb3b,_0x57ff9c,_0x3d8c6f){return new BPromise(function(_0x5922f0,_0xbbb62b){var _0x322ab5=_0x3d8c6f||client;return _0x322ab5[_0x4bb9('0x20')](_0x36638d,_0x57ff9c)[_0x4bb9('0x21')](function(_0x4f82d7){logger[_0x4bb9('0x22')](_0x4bb9('0x23'),_0x3afb3b,_0x4bb9('0x24'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3afb3b,'request\x20sent',JSON[_0x4bb9('0x25')](_0x4f82d7));if(_0x4f82d7['error']){if(_0x4f82d7[_0x4bb9('0x26')]['code']===0x1f4){logger[_0x4bb9('0x26')](_0x4bb9('0x23'),_0x3afb3b,_0x4f82d7['error'][_0x4bb9('0x27')]);return _0xbbb62b(_0x4f82d7[_0x4bb9('0x26')][_0x4bb9('0x27')]);}logger[_0x4bb9('0x26')](_0x4bb9('0x23'),_0x3afb3b,_0x4f82d7[_0x4bb9('0x26')]['message']);return _0x5922f0(_0x4f82d7[_0x4bb9('0x26')][_0x4bb9('0x27')]);}else{logger[_0x4bb9('0x22')]('ChatQueue,\x20%s,\x20%s',_0x3afb3b,_0x4bb9('0x24'));_0x5922f0(_0x4f82d7[_0x4bb9('0x28')][_0x4bb9('0x27')]);}})[_0x4bb9('0x29')](function(_0x915584){logger[_0x4bb9('0x26')](_0x4bb9('0x23'),_0x3afb3b,_0x915584);_0xbbb62b(_0x915584);});});}function respondWithStatusCode(_0x4d0ab5,_0x16721a){_0x16721a=_0x16721a||0xcc;return function(_0x9c8f8c){if(_0x9c8f8c){return _0x4d0ab5[_0x4bb9('0x2a')](_0x16721a);}return _0x4d0ab5[_0x4bb9('0x2b')](_0x16721a)[_0x4bb9('0x2c')]();};}function respondWithResult(_0x1c22d3,_0x233c9b){_0x233c9b=_0x233c9b||0xc8;return function(_0x1524b1){if(_0x1524b1){return _0x1c22d3[_0x4bb9('0x2b')](_0x233c9b)[_0x4bb9('0x2d')](_0x1524b1);}};}function respondWithFilteredResult(_0x2b4c02,_0x3e8552){return function(_0x352eb2){if(_0x352eb2){var _0x1e0b56=typeof _0x3e8552['offset']==='undefined'&&typeof _0x3e8552['limit']==='undefined';var _0x38408c=_0x352eb2[_0x4bb9('0x2e')];var _0x33f03c=_0x1e0b56?0x0:_0x3e8552['offset'];var _0x463463=_0x1e0b56?_0x352eb2[_0x4bb9('0x2e')]:_0x3e8552[_0x4bb9('0x2f')]+_0x3e8552['limit'];var _0xc96305;if(_0x463463>=_0x38408c){_0x463463=_0x38408c;_0xc96305=0xc8;}else{_0xc96305=0xce;}_0x2b4c02[_0x4bb9('0x2b')](_0xc96305);return _0x2b4c02[_0x4bb9('0x30')](_0x4bb9('0x31'),_0x33f03c+'-'+_0x463463+'/'+_0x38408c)[_0x4bb9('0x2d')](_0x352eb2);}return null;};}function patchUpdates(_0x2feae6){return function(_0x27d38c){try{jsonpatch[_0x4bb9('0x32')](_0x27d38c,_0x2feae6,!![]);}catch(_0x4cf9db){return BPromise[_0x4bb9('0x33')](_0x4cf9db);}return _0x27d38c[_0x4bb9('0x34')]();};}function saveUpdates(_0x1a97da,_0x1bba9d){return function(_0xa058e2){if(_0xa058e2){return _0xa058e2['update'](_0x1a97da)[_0x4bb9('0x21')](function(_0x3888a1){return _0x3888a1;});}return null;};}function removeEntity(_0x4eabc4,_0x1c36a6){return function(_0x1f265d){if(_0x1f265d){return _0x1f265d[_0x4bb9('0x35')]()[_0x4bb9('0x21')](function(){var _0x495969=_0x1f265d[_0x4bb9('0x36')]({'plain':!![]});var _0x4df9a8=_0x4bb9('0x37');return db[_0x4bb9('0x38')][_0x4bb9('0x35')]({'where':{'type':_0x4df9a8,'resourceId':_0x495969['id']}})[_0x4bb9('0x21')](function(){return _0x1f265d;});})[_0x4bb9('0x21')](function(){_0x4eabc4[_0x4bb9('0x2b')](0xcc)[_0x4bb9('0x2c')]();});}};}function handleEntityNotFound(_0x1631ab,_0x599688){return function(_0x5550c3){if(!_0x5550c3){_0x1631ab[_0x4bb9('0x2a')](0x194);}return _0x5550c3;};}function handleError(_0x5ed065,_0x44a45b){_0x44a45b=_0x44a45b||0x1f4;return function(_0x31dff0){logger['error'](_0x31dff0['stack']);if(_0x31dff0[_0x4bb9('0x39')]){delete _0x31dff0[_0x4bb9('0x39')];}_0x5ed065['status'](_0x44a45b)['send'](_0x31dff0);};}exports[_0x4bb9('0x3a')]=function(_0x5ca061,_0x45d0cd){var _0x75b94e={},_0x41817b={},_0xc59070={'count':0x0,'rows':[]};var _0x27703b=_['map'](db[_0x4bb9('0x3b')][_0x4bb9('0x3c')],function(_0x15a5ad){return{'name':_0x15a5ad[_0x4bb9('0x3d')],'type':_0x15a5ad[_0x4bb9('0x3e')][_0x4bb9('0x3f')]};});_0x41817b['model']=_[_0x4bb9('0x40')](_0x27703b,_0x4bb9('0x39'));_0x41817b[_0x4bb9('0x41')]=_['keys'](_0x5ca061['query']);_0x41817b[_0x4bb9('0x42')]=_['intersection'](_0x41817b['model'],_0x41817b[_0x4bb9('0x41')]);_0x75b94e[_0x4bb9('0x43')]=_[_0x4bb9('0x44')](_0x41817b[_0x4bb9('0x45')],qs['fields'](_0x5ca061[_0x4bb9('0x41')][_0x4bb9('0x46')]));_0x75b94e['attributes']=_0x75b94e[_0x4bb9('0x43')][_0x4bb9('0x47')]?_0x75b94e[_0x4bb9('0x43')]:_0x41817b[_0x4bb9('0x45')];if(!_0x5ca061['query'][_0x4bb9('0x48')](_0x4bb9('0x49'))){_0x75b94e[_0x4bb9('0x4a')]=qs[_0x4bb9('0x4a')](_0x5ca061[_0x4bb9('0x41')][_0x4bb9('0x4a')]);_0x75b94e[_0x4bb9('0x2f')]=qs[_0x4bb9('0x2f')](_0x5ca061[_0x4bb9('0x41')][_0x4bb9('0x2f')]);}_0x75b94e['order']=qs[_0x4bb9('0x4b')](_0x5ca061['query'][_0x4bb9('0x4b')]);_0x75b94e[_0x4bb9('0x4c')]=qs[_0x4bb9('0x42')](_['pick'](_0x5ca061[_0x4bb9('0x41')],_0x41817b['filters']),_0x27703b);if(_0x5ca061[_0x4bb9('0x41')]['filter']){_0x75b94e[_0x4bb9('0x4c')]=_[_0x4bb9('0x4d')](_0x75b94e[_0x4bb9('0x4c')],{'$or':_[_0x4bb9('0x40')](_0x27703b,function(_0x182285){if(_0x182285[_0x4bb9('0x3e')]!==_0x4bb9('0x4e')){var _0x1a6fd8={};_0x1a6fd8[_0x182285[_0x4bb9('0x39')]]={'$like':'%'+_0x5ca061[_0x4bb9('0x41')][_0x4bb9('0x4f')]+'%'};return _0x1a6fd8;}})});}_0x75b94e=_[_0x4bb9('0x4d')]({},_0x75b94e,_0x5ca061['options']);var _0x111a9a={'where':_0x75b94e[_0x4bb9('0x4c')]};return db[_0x4bb9('0x3b')][_0x4bb9('0x2e')](_0x111a9a)['then'](function(_0x5c13c2){_0xc59070[_0x4bb9('0x2e')]=_0x5c13c2;if(_0x5ca061['query'][_0x4bb9('0x50')]){_0x75b94e['include']=[{'all':!![]}];}return db[_0x4bb9('0x3b')][_0x4bb9('0x51')](_0x75b94e);})[_0x4bb9('0x21')](function(_0x31c5fc){_0xc59070[_0x4bb9('0x52')]=_0x31c5fc;return _0xc59070;})['then'](respondWithFilteredResult(_0x45d0cd,_0x75b94e))['catch'](handleError(_0x45d0cd,null));};exports[_0x4bb9('0x53')]=function(_0x2dd027,_0xa6fa50){var _0x3cb440={'raw':!![],'where':{'id':_0x2dd027[_0x4bb9('0x54')]['id']}},_0x1d4170={};_0x1d4170[_0x4bb9('0x45')]=_[_0x4bb9('0x55')](db['ChatQueue'][_0x4bb9('0x3c')]);_0x1d4170[_0x4bb9('0x41')]=_['keys'](_0x2dd027[_0x4bb9('0x41')]);_0x1d4170[_0x4bb9('0x42')]=_['intersection'](_0x1d4170[_0x4bb9('0x45')],_0x1d4170[_0x4bb9('0x41')]);_0x3cb440[_0x4bb9('0x43')]=_['intersection'](_0x1d4170[_0x4bb9('0x45')],qs[_0x4bb9('0x46')](_0x2dd027['query'][_0x4bb9('0x46')]));_0x3cb440[_0x4bb9('0x43')]=_0x3cb440[_0x4bb9('0x43')][_0x4bb9('0x47')]?_0x3cb440['attributes']:_0x1d4170[_0x4bb9('0x45')];if(_0x2dd027[_0x4bb9('0x41')][_0x4bb9('0x50')]){_0x3cb440['include']=[{'all':!![]}];}_0x3cb440=_[_0x4bb9('0x4d')]({},_0x3cb440,_0x2dd027[_0x4bb9('0x56')]);return db[_0x4bb9('0x3b')]['find'](_0x3cb440)['then'](handleEntityNotFound(_0xa6fa50,null))[_0x4bb9('0x21')](respondWithResult(_0xa6fa50,null))[_0x4bb9('0x29')](handleError(_0xa6fa50,null));};exports[_0x4bb9('0x57')]=function(_0x210980,_0x516df3){return db[_0x4bb9('0x3b')]['create'](_0x210980[_0x4bb9('0x58')],{})['then'](function(_0x5e579d){var _0x4531f2=_0x210980[_0x4bb9('0x59')][_0x4bb9('0x36')]({'plain':!![]});if(!_0x4531f2)throw new Error(_0x4bb9('0x5a'));if(_0x4531f2[_0x4bb9('0x5b')]===_0x4bb9('0x59')){var _0x7f5fd1=_0x5e579d[_0x4bb9('0x36')]({'plain':!![]});var _0x589205=_0x4bb9('0x37');return db[_0x4bb9('0x5c')][_0x4bb9('0x5d')]({'where':{'name':_0x589205,'userProfileId':_0x4531f2[_0x4bb9('0x5e')]},'raw':!![]})[_0x4bb9('0x21')](function(_0x4c2458){if(_0x4c2458&&_0x4c2458[_0x4bb9('0x5f')]===0x0){return db[_0x4bb9('0x38')][_0x4bb9('0x57')]({'name':_0x7f5fd1[_0x4bb9('0x39')],'resourceId':_0x7f5fd1['id'],'type':_0x4c2458[_0x4bb9('0x39')],'sectionId':_0x4c2458['id']},{})['then'](function(){return _0x5e579d;});}else{return _0x5e579d;}})[_0x4bb9('0x29')](function(_0x2cc849){logger[_0x4bb9('0x26')](_0x4bb9('0x60'),_0x2cc849);throw _0x2cc849;});}return _0x5e579d;})[_0x4bb9('0x21')](respondWithResult(_0x516df3,0xc9))[_0x4bb9('0x29')](handleError(_0x516df3,null));};exports[_0x4bb9('0x61')]=function(_0x27f8ed,_0x21dd50){if(_0x27f8ed[_0x4bb9('0x58')]['id']){delete _0x27f8ed[_0x4bb9('0x58')]['id'];}return db[_0x4bb9('0x3b')][_0x4bb9('0x5d')]({'where':{'id':_0x27f8ed[_0x4bb9('0x54')]['id']}})[_0x4bb9('0x21')](handleEntityNotFound(_0x21dd50,null))[_0x4bb9('0x21')](saveUpdates(_0x27f8ed[_0x4bb9('0x58')],null))[_0x4bb9('0x21')](respondWithResult(_0x21dd50,null))[_0x4bb9('0x29')](handleError(_0x21dd50,null));};exports['destroy']=function(_0x34db84,_0x25dcb2){return db[_0x4bb9('0x3b')][_0x4bb9('0x5d')]({'where':{'id':_0x34db84[_0x4bb9('0x54')]['id']}})[_0x4bb9('0x21')](handleEntityNotFound(_0x25dcb2,null))['then'](removeEntity(_0x25dcb2,null))[_0x4bb9('0x29')](handleError(_0x25dcb2,null));};exports[_0x4bb9('0x62')]=function(_0x1541ce,_0x5d9896){return db['ChatQueue'][_0x4bb9('0x62')]()[_0x4bb9('0x21')](respondWithResult(_0x5d9896,null))[_0x4bb9('0x29')](handleError(_0x5d9896,null));};exports['getMembers']=function(_0x60cbbd,_0x35b8c0,_0x4af186){var _0x2691ec={'raw':!![],'where':{}},_0x5565a9={},_0x167cb5;return db[_0x4bb9('0x3b')][_0x4bb9('0x63')]({'where':{'id':_0x60cbbd[_0x4bb9('0x54')]['id']}})['then'](handleEntityNotFound(_0x35b8c0,null))[_0x4bb9('0x21')](function(_0x23e358){if(_0x23e358){_0x167cb5=_0x23e358[_0x4bb9('0x36')]({'plain':!![]});_0x5565a9[_0x4bb9('0x45')]=_['keys'](db[_0x4bb9('0x64')][_0x4bb9('0x3c')]);_0x5565a9[_0x4bb9('0x41')]=_[_0x4bb9('0x55')](_0x60cbbd[_0x4bb9('0x41')]);_0x5565a9[_0x4bb9('0x42')]=_[_0x4bb9('0x44')](_0x5565a9[_0x4bb9('0x45')],_0x5565a9['query']);_0x2691ec[_0x4bb9('0x43')]=_['intersection'](_0x5565a9[_0x4bb9('0x45')],qs[_0x4bb9('0x46')](_0x60cbbd['query'][_0x4bb9('0x46')]));_0x2691ec[_0x4bb9('0x43')]=_0x2691ec[_0x4bb9('0x43')][_0x4bb9('0x47')]?_0x2691ec['attributes']:_0x5565a9[_0x4bb9('0x45')];if(!_0x60cbbd[_0x4bb9('0x41')][_0x4bb9('0x48')](_0x4bb9('0x49'))){_0x2691ec[_0x4bb9('0x4a')]=qs[_0x4bb9('0x4a')](_0x60cbbd['query'][_0x4bb9('0x4a')]);_0x2691ec['offset']=qs[_0x4bb9('0x2f')](_0x60cbbd['query']['offset']);}_0x2691ec['order']=qs[_0x4bb9('0x4b')](_0x60cbbd[_0x4bb9('0x41')]['sort']);_0x2691ec[_0x4bb9('0x4c')]=qs[_0x4bb9('0x42')](_[_0x4bb9('0x65')](_0x60cbbd[_0x4bb9('0x41')],_0x5565a9[_0x4bb9('0x42')]));_0x2691ec[_0x4bb9('0x4c')][_0x4bb9('0x66')]=_0x23e358['id'];if(_0x60cbbd[_0x4bb9('0x41')][_0x4bb9('0x4f')]){_0x2691ec[_0x4bb9('0x4c')]=_[_0x4bb9('0x4d')](_0x2691ec[_0x4bb9('0x4c')],{'$or':_['map'](_0x2691ec[_0x4bb9('0x43')],function(_0x239a99){var _0x3fa887={};_0x3fa887[_0x239a99]={'$like':'%'+_0x60cbbd[_0x4bb9('0x41')][_0x4bb9('0x4f')]+'%'};return _0x3fa887;})});}_0x2691ec=_['merge']({},_0x2691ec,_0x60cbbd['options']);return db[_0x4bb9('0x64')]['findAll'](_0x2691ec);}})[_0x4bb9('0x21')](function(_0x2af289){if(_0x2af289){return db[_0x4bb9('0x67')][_0x4bb9('0x68')]({'where':{'id':_[_0x4bb9('0x40')](_0x2af289,_0x4bb9('0x69')),'role':_0x4bb9('0x6a')},'attributes':['id','name','chatPause','updatedAt',_0x4bb9('0x6b')]});}})[_0x4bb9('0x21')](function(_0x447b0b){if(_0x447b0b){return{'count':_0x447b0b[_0x4bb9('0x2e')],'rows':_[_0x4bb9('0x40')](_0x447b0b[_0x4bb9('0x52')],function(_0x2bbeca){return{'membername':_0x2bbeca[_0x4bb9('0x39')],'UserId':_0x2bbeca['id'],'queue_name':_0x167cb5[_0x4bb9('0x39')],'ChatQueueId':_0x167cb5['id'],'interface':util[_0x4bb9('0x6c')](_0x4bb9('0x6d'),_0x4bb9('0x6e'),_0x2bbeca['name']),'penalty':0x0,'paused':_0x2bbeca[_0x4bb9('0x6f')],'createdAt':_0x2bbeca['createdAt'],'updatedAt':_0x2bbeca[_0x4bb9('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4bb9('0x21')](respondWithFilteredResult(_0x35b8c0,_0x2691ec))[_0x4bb9('0x29')](handleError(_0x35b8c0,null));};exports['getTeams']=function(_0x1c3b01,_0x55ca12,_0x326597){var _0x32e78a={};var _0x5e280d={};var _0x1ea26a;var _0x5de92d;return db[_0x4bb9('0x3b')][_0x4bb9('0x63')]({'where':{'id':_0x1c3b01[_0x4bb9('0x54')]['id']}})[_0x4bb9('0x21')](handleEntityNotFound(_0x55ca12,null))[_0x4bb9('0x21')](function(_0x10618a){if(_0x10618a){_0x1ea26a=_0x10618a;_0x5e280d[_0x4bb9('0x45')]=_['keys'](db[_0x4bb9('0x71')][_0x4bb9('0x3c')]);_0x5e280d['query']=_['keys'](_0x1c3b01[_0x4bb9('0x41')]);_0x5e280d[_0x4bb9('0x42')]=_[_0x4bb9('0x44')](_0x5e280d['model'],_0x5e280d[_0x4bb9('0x41')]);_0x32e78a[_0x4bb9('0x43')]=_[_0x4bb9('0x44')](_0x5e280d[_0x4bb9('0x45')],qs[_0x4bb9('0x46')](_0x1c3b01[_0x4bb9('0x41')][_0x4bb9('0x46')]));_0x32e78a[_0x4bb9('0x43')]=_0x32e78a['attributes'][_0x4bb9('0x47')]?_0x32e78a[_0x4bb9('0x43')]:_0x5e280d['model'];_0x32e78a['order']=qs['sort'](_0x1c3b01[_0x4bb9('0x41')][_0x4bb9('0x4b')]);_0x32e78a['where']=qs[_0x4bb9('0x42')](_[_0x4bb9('0x65')](_0x1c3b01[_0x4bb9('0x41')],_0x5e280d[_0x4bb9('0x42')]));if(_0x1c3b01[_0x4bb9('0x41')][_0x4bb9('0x4f')]){_0x32e78a[_0x4bb9('0x4c')]=_['merge'](_0x32e78a[_0x4bb9('0x4c')],{'$or':_[_0x4bb9('0x40')](_0x32e78a[_0x4bb9('0x43')],function(_0x2f6366){var _0x3cf5cc={};_0x3cf5cc[_0x2f6366]={'$like':'%'+_0x1c3b01[_0x4bb9('0x41')][_0x4bb9('0x4f')]+'%'};return _0x3cf5cc;})});}_0x32e78a=_[_0x4bb9('0x4d')]({},_0x32e78a,_0x1c3b01[_0x4bb9('0x56')]);return _0x1ea26a[_0x4bb9('0x72')](_0x32e78a);}})[_0x4bb9('0x21')](function(_0x3a3ccd){if(_0x3a3ccd){_0x5de92d=_0x3a3ccd['length'];if(!_0x1c3b01[_0x4bb9('0x41')]['hasOwnProperty'](_0x4bb9('0x49'))){_0x32e78a[_0x4bb9('0x4a')]=qs[_0x4bb9('0x4a')](_0x1c3b01['query']['limit']);_0x32e78a[_0x4bb9('0x2f')]=qs['offset'](_0x1c3b01[_0x4bb9('0x41')][_0x4bb9('0x2f')]);}return _0x1ea26a[_0x4bb9('0x72')](_0x32e78a);}})[_0x4bb9('0x21')](function(_0x240c82){if(_0x240c82){return _0x240c82?{'count':_0x5de92d,'rows':_0x240c82}:null;}})['then'](respondWithResult(_0x55ca12,null))[_0x4bb9('0x29')](handleError(_0x55ca12,null));};exports[_0x4bb9('0x73')]=function(_0x3df0fb,_0x5c7b35,_0x184a1f){var _0x3edd6e=_0x3df0fb[_0x4bb9('0x58')][_0x4bb9('0x74')];return db[_0x4bb9('0x71')]['findAll']({'where':{'id':_0x3edd6e},'attributes':['id'],'include':[{'model':db[_0x4bb9('0x67')],'as':_0x4bb9('0x75'),'attributes':['id',_0x4bb9('0x39'),_0x4bb9('0x76'),_0x4bb9('0x77'),'interface'],'raw':!![]}]})['then'](function(_0x29578e){if(_0x29578e){var _0xfcf559=_[_0x4bb9('0x78')](_0x29578e,function(_0x2162c4){var _0x44f323=_0x2162c4[_0x4bb9('0x36')]({'plain':!![]});return _0x44f323[_0x4bb9('0x75')];});return db[_0x4bb9('0x3b')][_0x4bb9('0x5d')]({'where':{'id':_0x3df0fb[_0x4bb9('0x54')]['id']}})[_0x4bb9('0x21')](function(_0x1f7ae4){return db[_0x4bb9('0x79')][_0x4bb9('0x7a')](function(_0x164ff1){return _0x1f7ae4[_0x4bb9('0x73')](_0x3edd6e,{'transaction':_0x164ff1})[_0x4bb9('0x21')](function(){return BPromise[_0x4bb9('0x7b')](_0xfcf559,function(_0x2140bf){return db[_0x4bb9('0x64')][_0x4bb9('0x7c')]({'where':{'UserId':_0x2140bf['id'],'ChatQueueId':_0x3df0fb[_0x4bb9('0x54')]['id']},'transaction':_0x164ff1});});})[_0x4bb9('0x21')](function(){_0xfcf559[_0x4bb9('0x7d')](function(_0x4fe447){socket[_0x4bb9('0x7e')](_0x4bb9('0x7f'),{'UserId':_0x4fe447['id'],'ChatQueueId':_0x1f7ae4['id']});});});});});}})['then'](respondWithStatusCode(_0x5c7b35,null))[_0x4bb9('0x29')](handleError(_0x5c7b35,null));};exports[_0x4bb9('0x80')]=function(_0x165609,_0x44318e,_0x3e8b1c){return db['Team'][_0x4bb9('0x51')]({'where':{'id':_0x165609[_0x4bb9('0x41')][_0x4bb9('0x74')]},'attributes':['id'],'include':[{'model':db[_0x4bb9('0x67')],'as':_0x4bb9('0x75'),'attributes':['id'],'raw':!![]}]})[_0x4bb9('0x21')](handleEntityNotFound(_0x44318e,null))['then'](function(_0x15ff2a){var _0x68e41a=_[_0x4bb9('0x40')](_0x15ff2a,'id');var _0x58ef6f=[];var _0x35d0ce=[];var _0x146a73=squel['select']();_0x146a73[_0x4bb9('0x81')](_0x4bb9('0x82'))[_0x4bb9('0x83')](_0x4bb9('0x84'),'tq')[_0x4bb9('0x85')](_0x4bb9('0x86'),'ut',_0x4bb9('0x87'))['where'](_0x4bb9('0x88'),_0x165609['params']['id']);for(var _0x9ff78d=0x0;_0x9ff78d<_0x15ff2a['length'];_0x9ff78d+=0x1){let _0x2edb17=_0x15ff2a[_0x9ff78d];for(var _0xc08508=0x0;_0xc08508<_0x2edb17[_0x4bb9('0x75')]['length'];_0xc08508+=0x1){let _0x28955d=_0x2edb17[_0x4bb9('0x75')][_0xc08508];var _0xa51029=_0x146a73[_0x4bb9('0x89')]();_0xa51029['where']('ut.UserId\x20=\x20?',_0x28955d['id']);_0x35d0ce['push'](db['sequelize']['query'](_0xa51029[_0x4bb9('0x8a')](),{'type':db['sequelize'][_0x4bb9('0x8b')][_0x4bb9('0x8c')]})[_0x4bb9('0x21')](function(_0x49207d){if(_0x49207d['length']===0x1){return _0x28955d['id'];}else{var _0x492da7=_[_0x4bb9('0x8d')](_[_0x4bb9('0x40')](_0x49207d,_0x4bb9('0x8e')),function(_0x34f2d8){return _[_0x4bb9('0x8f')](_0x68e41a,_0x34f2d8);});if(_0x492da7){return _0x28955d['id'];}}}));}}return BPromise[_0x4bb9('0x90')](_0x35d0ce)[_0x4bb9('0x21')](function(_0x9fc6eb){_0x58ef6f=_(_0x58ef6f)[_0x4bb9('0x91')](_0x9fc6eb)['compact']()[_0x4bb9('0x92')]();return db['ChatQueue'][_0x4bb9('0x5d')]({'where':{'id':_0x165609[_0x4bb9('0x54')]['id']}})[_0x4bb9('0x21')](function(_0x5a0a0f){return db['sequelize'][_0x4bb9('0x7a')](function(_0x179a13){return _0x5a0a0f[_0x4bb9('0x80')](_0x165609['query'][_0x4bb9('0x74')],{'transaction':_0x179a13})[_0x4bb9('0x21')](function(){if(!_[_0x4bb9('0x93')](_0x58ef6f)){return _0x5a0a0f[_0x4bb9('0x94')](_0x58ef6f,{'transaction':_0x179a13});}})[_0x4bb9('0x21')](function(){_0x58ef6f[_0x4bb9('0x7d')](function(_0x7cc82f){socket[_0x4bb9('0x7e')](_0x4bb9('0x95'),{'UserId':_0x7cc82f,'ChatQueueId':_0x5a0a0f['id']});});});});});});})[_0x4bb9('0x21')](respondWithStatusCode(_0x44318e,null))[_0x4bb9('0x29')](handleError(_0x44318e,null));};exports[_0x4bb9('0x96')]=function(_0xc2e940,_0x328bad,_0x139930){return db[_0x4bb9('0x3b')][_0x4bb9('0x5d')]({'where':{'id':_0xc2e940[_0x4bb9('0x54')]['id']}})[_0x4bb9('0x21')](handleEntityNotFound(_0x328bad,null))[_0x4bb9('0x21')](function(_0x42a133){if(_0x42a133){return _0x42a133[_0x4bb9('0x96')](_0xc2e940[_0x4bb9('0x58')][_0x4bb9('0x74')],_[_0x4bb9('0x97')](_0xc2e940[_0x4bb9('0x58')],[_0x4bb9('0x74'),'id'])||{})[_0x4bb9('0x98')](function(_0x34d42e){for(var _0x1d8b26=0x0;_0x1d8b26<_0xc2e940[_0x4bb9('0x58')][_0x4bb9('0x74')][_0x4bb9('0x47')];_0x1d8b26+=0x1){socket[_0x4bb9('0x7e')](_0x4bb9('0x7f'),{'UserId':Number(_0xc2e940['body']['ids'][_0x1d8b26]),'ChatQueueId':Number(_0xc2e940['params']['id'])});}return _0x34d42e;});}})[_0x4bb9('0x21')](respondWithResult(_0x328bad,null))[_0x4bb9('0x29')](handleError(_0x328bad,null));};exports[_0x4bb9('0x94')]=function(_0x1e0163,_0x1b8f90,_0x1de811){return db[_0x4bb9('0x3b')][_0x4bb9('0x5d')]({'where':{'id':_0x1e0163[_0x4bb9('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b8f90,null))['then'](function(_0x26e0c0){if(_0x26e0c0){return _0x26e0c0[_0x4bb9('0x94')](_0x1e0163['query'][_0x4bb9('0x74')])[_0x4bb9('0x21')](function(){if(_[_0x4bb9('0x99')](_0x1e0163[_0x4bb9('0x41')][_0x4bb9('0x74')])){for(var _0x2cd780=0x0;_0x2cd780<_0x1e0163[_0x4bb9('0x41')][_0x4bb9('0x74')]['length'];_0x2cd780+=0x1){socket[_0x4bb9('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x1e0163[_0x4bb9('0x41')][_0x4bb9('0x74')][_0x2cd780]),'ChatQueueId':Number(_0x1e0163[_0x4bb9('0x54')]['id'])});}}else{socket[_0x4bb9('0x7e')](_0x4bb9('0x95'),{'UserId':Number(_0x1e0163[_0x4bb9('0x41')][_0x4bb9('0x74')]),'ChatQueueId':Number(_0x1e0163[_0x4bb9('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x1b8f90,null))['catch'](handleError(_0x1b8f90,null));};exports[_0x4bb9('0x9a')]=function(_0x282830,_0x52e563,_0x10973d){var _0x4b5c3f={};var _0x5ac39b={};var _0x4a279f;var _0x6cc014;return db[_0x4bb9('0x3b')][_0x4bb9('0x63')]({'where':{'id':_0x282830[_0x4bb9('0x54')]['id']}})['then'](handleEntityNotFound(_0x52e563,null))['then'](function(_0x105cf0){if(_0x105cf0){_0x4a279f=_0x105cf0;_0x5ac39b[_0x4bb9('0x45')]=_[_0x4bb9('0x55')](db[_0x4bb9('0x67')][_0x4bb9('0x3c')]);_0x5ac39b['query']=_[_0x4bb9('0x55')](_0x282830[_0x4bb9('0x41')]);_0x5ac39b[_0x4bb9('0x42')]=_[_0x4bb9('0x44')](_0x5ac39b[_0x4bb9('0x45')],_0x5ac39b[_0x4bb9('0x41')]);_0x4b5c3f[_0x4bb9('0x43')]=_[_0x4bb9('0x44')](_0x5ac39b[_0x4bb9('0x45')],qs[_0x4bb9('0x46')](_0x282830['query'][_0x4bb9('0x46')]));_0x4b5c3f[_0x4bb9('0x43')]=_0x4b5c3f[_0x4bb9('0x43')][_0x4bb9('0x47')]?_0x4b5c3f[_0x4bb9('0x43')]:_0x5ac39b[_0x4bb9('0x45')];_0x4b5c3f['order']=qs['sort'](_0x282830[_0x4bb9('0x41')][_0x4bb9('0x4b')]);_0x4b5c3f[_0x4bb9('0x4c')]=qs[_0x4bb9('0x42')](_[_0x4bb9('0x65')](_0x282830[_0x4bb9('0x41')],_0x5ac39b[_0x4bb9('0x42')]));if(_0x282830[_0x4bb9('0x41')][_0x4bb9('0x4f')]){_0x4b5c3f[_0x4bb9('0x4c')]=_[_0x4bb9('0x4d')](_0x4b5c3f[_0x4bb9('0x4c')],{'$or':_['map'](_0x4b5c3f[_0x4bb9('0x43')],function(_0x2d99f7){var _0x44a51f={};_0x44a51f[_0x2d99f7]={'$like':'%'+_0x282830[_0x4bb9('0x41')][_0x4bb9('0x4f')]+'%'};return _0x44a51f;})});}_0x4b5c3f=_[_0x4bb9('0x4d')]({},_0x4b5c3f,_0x282830[_0x4bb9('0x56')]);return _0x4a279f[_0x4bb9('0x9a')](_0x4b5c3f);}})[_0x4bb9('0x21')](function(_0x5537a8){if(_0x5537a8){_0x6cc014=_0x5537a8[_0x4bb9('0x47')];if(!_0x282830[_0x4bb9('0x41')][_0x4bb9('0x48')](_0x4bb9('0x49'))){_0x4b5c3f['limit']=qs[_0x4bb9('0x4a')](_0x282830[_0x4bb9('0x41')]['limit']);_0x4b5c3f[_0x4bb9('0x2f')]=qs[_0x4bb9('0x2f')](_0x282830['query'][_0x4bb9('0x2f')]);}return _0x4a279f['getAgents'](_0x4b5c3f);}})[_0x4bb9('0x21')](function(_0xe82fc7){if(_0xe82fc7){return _0xe82fc7?{'count':_0x6cc014,'rows':_0xe82fc7}:null;}})[_0x4bb9('0x21')](respondWithResult(_0x52e563,null))[_0x4bb9('0x29')](handleError(_0x52e563,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 19e0ece..dcfa0b7 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 _0xe528=['update','emit','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners','save'];(function(_0x3cf1b1,_0x445a0a){var _0x347602=function(_0x19c0a1){while(--_0x19c0a1){_0x3cf1b1['push'](_0x3cf1b1['shift']());}};_0x347602(++_0x445a0a);}(_0xe528,0x9d));var _0x8e52=function(_0x33f43e,_0x349e92){_0x33f43e=_0x33f43e-0x0;var _0xa9ae29=_0xe528[_0x33f43e];return _0xa9ae29;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x8e52('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8e52('0x1')](0x0);var events={'afterCreate':_0x8e52('0x2'),'afterUpdate':_0x8e52('0x3'),'afterDestroy':'remove'};function emitEvent(_0x59aed4){return function(_0x450338,_0x454f2d,_0x1bd4fb){ChatQueueEvents[_0x8e52('0x4')](_0x59aed4+':'+_0x450338['id'],_0x450338);ChatQueueEvents['emit'](_0x59aed4,_0x450338);_0x1bd4fb(null);};}for(var e in events){if(events[_0x8e52('0x5')](e)){var event=events[e];ChatQueue[_0x8e52('0x6')](e,emitEvent(event));}}module[_0x8e52('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xc1de=['ChatQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4f5a3e,_0x320eab){var _0x47d0a5=function(_0x38f4d1){while(--_0x38f4d1){_0x4f5a3e['push'](_0x4f5a3e['shift']());}};_0x47d0a5(++_0x320eab);}(_0xc1de,0xaa));var _0xec1d=function(_0xd66c60,_0x112c80){_0xd66c60=_0xd66c60-0x0;var _0x15e39a=_0xc1de[_0xd66c60];return _0x15e39a;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xec1d('0x0'))['db'][_0xec1d('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xec1d('0x2')](0x0);var events={'afterCreate':_0xec1d('0x3'),'afterUpdate':_0xec1d('0x4'),'afterDestroy':_0xec1d('0x5')};function emitEvent(_0xf50037){return function(_0x52e074,_0x396cc3,_0x4431d5){ChatQueueEvents['emit'](_0xf50037+':'+_0x52e074['id'],_0x52e074);ChatQueueEvents['emit'](_0xf50037,_0x52e074);_0x4431d5(null);};}for(var e in events){if(events[_0xec1d('0x6')](e)){var event=events[e];ChatQueue[_0xec1d('0x7')](e,emitEvent(event));}}module[_0xec1d('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index ca5bb1b..bd9c31d 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 _0xb7de=['bluebird','request-promise','./chatQueue.attributes','chat_queues','lodash','../../config/logger'];(function(_0x16ba5b,_0x34ba4c){var _0xc98ed9=function(_0x197167){while(--_0x197167){_0x16ba5b['push'](_0x16ba5b['shift']());}};_0xc98ed9(++_0x34ba4c);}(_0xb7de,0x70));var _0xeb7d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb7de[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xeb7d('0x0'));var util=require('util');var logger=require(_0xeb7d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xeb7d('0x2'));var rp=require(_0xeb7d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeb7d('0x4'));module['exports']=function(_0x3c65ba,_0x3b4c1f){return _0x3c65ba['define']('ChatQueue',attributes,{'tableName':_0xeb7d('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9be4=['../../config/environment','exports','define','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3e04b1,_0x474e5d){var _0x2a3a06=function(_0x78e666){while(--_0x78e666){_0x3e04b1['push'](_0x3e04b1['shift']());}};_0x2a3a06(++_0x474e5d);}(_0x9be4,0xb7));var _0x49be=function(_0x2b7dab,_0x2505fc){_0x2b7dab=_0x2b7dab-0x0;var _0x36cc35=_0x9be4[_0x2b7dab];return _0x36cc35;};'use strict';var _=require('lodash');var util=require(_0x49be('0x0'));var logger=require(_0x49be('0x1'))(_0x49be('0x2'));var moment=require(_0x49be('0x3'));var BPromise=require(_0x49be('0x4'));var rp=require(_0x49be('0x5'));var fs=require('fs');var path=require(_0x49be('0x6'));var rimraf=require('rimraf');var config=require(_0x49be('0x7'));var attributes=require('./chatQueue.attributes');module[_0x49be('0x8')]=function(_0x320106,_0x3a6429){return _0x320106[_0x49be('0x9')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 5715f59..acd3568 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 _0xebc4=['./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetChatQueue','ChatQueue','then','ShowChatQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','socket.io-emitter'];(function(_0x7b7e25,_0x36e928){var _0x24e1e5=function(_0x7711e6){while(--_0x7711e6){_0x7b7e25['push'](_0x7b7e25['shift']());}};_0x24e1e5(++_0x36e928);}(_0xebc4,0xf9));var _0x4ebc=function(_0x8df750,_0x22c0f5){_0x8df750=_0x8df750-0x0;var _0x290bc8=_0xebc4[_0x8df750];return _0x290bc8;};'use strict';var _=require('lodash');var util=require(_0x4ebc('0x0'));var moment=require(_0x4ebc('0x1'));var BPromise=require(_0x4ebc('0x2'));var rs=require(_0x4ebc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ebc('0x4'))['db'];var utils=require(_0x4ebc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4ebc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4ebc('0x7')]['http']({'port':0x232a});config[_0x4ebc('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4ebc('0x9'))(new Redis(config[_0x4ebc('0x8')]));require(_0x4ebc('0xa'))[_0x4ebc('0xb')](socket);function respondWithRpcPromise(_0x46e0dc,_0x5d6a99,_0x27a221){return new BPromise(function(_0x1b5dbc,_0x12e3c6){return client[_0x4ebc('0xc')](_0x46e0dc,_0x27a221)['then'](function(_0x1522b9){logger['info'](_0x4ebc('0xd'),_0x5d6a99,_0x4ebc('0xe'));logger[_0x4ebc('0xf')](_0x4ebc('0x10'),_0x5d6a99,'request\x20sent',JSON[_0x4ebc('0x11')](_0x1522b9));if(_0x1522b9['error']){if(_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x13')]===0x1f4){logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x14')]);return _0x12e3c6(_0x1522b9['error'][_0x4ebc('0x14')]);}logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x1522b9[_0x4ebc('0x12')]['message']);return _0x1b5dbc(_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5d6a99,_0x4ebc('0xe'));_0x1b5dbc(_0x1522b9[_0x4ebc('0x15')]['message']);}})[_0x4ebc('0x16')](function(_0x28571e){logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x28571e);_0x12e3c6(_0x28571e);});});}exports['GetChatQueue']=function(_0x59251b){var _0x249dcf=this;return new Promise(function(_0x3e6195,_0x137ec9){return db['ChatQueue'][_0x4ebc('0x17')]({'raw':_0x59251b['options']?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x19')]===undefined?!![]:![]:!![],'where':_0x59251b['options']?_0x59251b['options'][_0x4ebc('0x1a')]||null:null,'attributes':_0x59251b['options']?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1b')]||null:null,'limit':_0x59251b[_0x4ebc('0x18')]?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1c')]||null:null,'include':_0x59251b[_0x4ebc('0x18')]?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x59251b[_0x4ebc('0x18')]['include'],function(_0x376a83){return{'model':db[_0x376a83[_0x4ebc('0x1f')]],'as':_0x376a83['as'],'attributes':_0x376a83[_0x4ebc('0x1b')],'include':_0x376a83[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x376a83[_0x4ebc('0x1d')],function(_0x165924){return{'model':db[_0x165924[_0x4ebc('0x1f')]],'as':_0x165924['as'],'attributes':_0x165924[_0x4ebc('0x1b')],'include':_0x165924[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x165924['include'],function(_0x10b09a){return{'model':db[_0x10b09a[_0x4ebc('0x1f')]],'as':_0x10b09a['as'],'attributes':_0x10b09a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42590d){logger[_0x4ebc('0x20')](_0x4ebc('0x21'),_0x59251b);logger[_0x4ebc('0xf')](_0x4ebc('0x21'),_0x59251b,JSON[_0x4ebc('0x11')](_0x42590d));_0x3e6195(_0x42590d);})[_0x4ebc('0x16')](function(_0x1d3d15){logger[_0x4ebc('0x12')]('GetChatQueue',_0x1d3d15[_0x4ebc('0x14')],_0x59251b);_0x137ec9(_0x249dcf[_0x4ebc('0x12')](0x1f4,_0x1d3d15[_0x4ebc('0x14')]));});});};exports['ShowChatQueue']=function(_0x3f9c40){var _0xbf2673=this;return new Promise(function(_0x141869,_0x3da50a){return db[_0x4ebc('0x22')]['find']({'raw':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1a')]||null:null,'attributes':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1b')]||null:null,'include':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1d')]?_['map'](_0x3f9c40['options'][_0x4ebc('0x1d')],function(_0x136d78){return{'model':db[_0x136d78[_0x4ebc('0x1f')]],'as':_0x136d78['as'],'attributes':_0x136d78[_0x4ebc('0x1b')],'include':_0x136d78[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x136d78[_0x4ebc('0x1d')],function(_0x4af0ec){return{'model':db[_0x4af0ec[_0x4ebc('0x1f')]],'as':_0x4af0ec['as'],'attributes':_0x4af0ec['attributes'],'include':_0x4af0ec['include']?_[_0x4ebc('0x1e')](_0x4af0ec[_0x4ebc('0x1d')],function(_0x34b276){return{'model':db[_0x34b276[_0x4ebc('0x1f')]],'as':_0x34b276['as'],'attributes':_0x34b276[_0x4ebc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4ebc('0x23')](function(_0x4fcfb6){logger[_0x4ebc('0x20')]('ShowChatQueue',_0x3f9c40);logger['debug'](_0x4ebc('0x24'),_0x3f9c40,JSON[_0x4ebc('0x11')](_0x4fcfb6));_0x141869(_0x4fcfb6);})[_0x4ebc('0x16')](function(_0x28ab22){logger[_0x4ebc('0x12')](_0x4ebc('0x24'),_0x28ab22[_0x4ebc('0x14')],_0x3f9c40);_0x3da50a(_0xbf2673['error'](0x1f4,_0x28ab22['message']));});});};
\ No newline at end of file
+var _0x285b=['http','redis','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options','limit','include','map','model','attributes','ShowChatQueue','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x325061,_0x36f481){var _0x5ae23d=function(_0x1ffec0){while(--_0x1ffec0){_0x325061['push'](_0x325061['shift']());}};_0x5ae23d(++_0x36f481);}(_0x285b,0x171));var _0xb285=function(_0xf97f35,_0x43a1f7){_0xf97f35=_0xf97f35-0x0;var _0x23f958=_0x285b[_0xf97f35];return _0x23f958;};'use strict';var _=require(_0xb285('0x0'));var util=require('util');var moment=require(_0xb285('0x1'));var BPromise=require(_0xb285('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb285('0x3'));var db=require(_0xb285('0x4'))['db'];var utils=require(_0xb285('0x5'));var logger=require(_0xb285('0x6'))(_0xb285('0x7'));var config=require(_0xb285('0x8'));var jayson=require(_0xb285('0x9'));var client=jayson[_0xb285('0xa')][_0xb285('0xb')]({'port':0x232a});config[_0xb285('0xc')]=_['defaults'](config[_0xb285('0xc')],{'host':_0xb285('0xd'),'port':0x18eb});var socket=require(_0xb285('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xb285('0xf')](socket);function respondWithRpcPromise(_0x2556dc,_0x133cc7,_0xd138d8){return new BPromise(function(_0x4e5976,_0x3d2a2b){return client['request'](_0x2556dc,_0xd138d8)[_0xb285('0x10')](function(_0x46ef65){logger[_0xb285('0x11')](_0xb285('0x12'),_0x133cc7,_0xb285('0x13'));logger[_0xb285('0x14')](_0xb285('0x15'),_0x133cc7,_0xb285('0x13'),JSON[_0xb285('0x16')](_0x46ef65));if(_0x46ef65[_0xb285('0x17')]){if(_0x46ef65['error']['code']===0x1f4){logger[_0xb285('0x17')](_0xb285('0x12'),_0x133cc7,_0x46ef65[_0xb285('0x17')][_0xb285('0x18')]);return _0x3d2a2b(_0x46ef65['error'][_0xb285('0x18')]);}logger[_0xb285('0x17')](_0xb285('0x12'),_0x133cc7,_0x46ef65[_0xb285('0x17')]['message']);return _0x4e5976(_0x46ef65[_0xb285('0x17')]['message']);}else{logger[_0xb285('0x11')](_0xb285('0x12'),_0x133cc7,_0xb285('0x13'));_0x4e5976(_0x46ef65['result'][_0xb285('0x18')]);}})[_0xb285('0x19')](function(_0x99b1e6){logger[_0xb285('0x17')](_0xb285('0x12'),_0x133cc7,_0x99b1e6);_0x3d2a2b(_0x99b1e6);});});}exports[_0xb285('0x1a')]=function(_0x17ad6f){var _0x378069=this;return new Promise(function(_0x402822,_0x5d77cb){return db[_0xb285('0x1b')][_0xb285('0x1c')]({'raw':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')]['where']||null:null,'attributes':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')]['attributes']||null:null,'limit':_0x17ad6f['options']?_0x17ad6f[_0xb285('0x1d')][_0xb285('0x1e')]||null:null,'include':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')][_0xb285('0x1f')]?_[_0xb285('0x20')](_0x17ad6f[_0xb285('0x1d')][_0xb285('0x1f')],function(_0x8d9a16){return{'model':db[_0x8d9a16[_0xb285('0x21')]],'as':_0x8d9a16['as'],'attributes':_0x8d9a16[_0xb285('0x22')],'include':_0x8d9a16['include']?_[_0xb285('0x20')](_0x8d9a16[_0xb285('0x1f')],function(_0x56c81f){return{'model':db[_0x56c81f[_0xb285('0x21')]],'as':_0x56c81f['as'],'attributes':_0x56c81f['attributes'],'include':_0x56c81f[_0xb285('0x1f')]?_[_0xb285('0x20')](_0x56c81f[_0xb285('0x1f')],function(_0x4377aa){return{'model':db[_0x4377aa[_0xb285('0x21')]],'as':_0x4377aa['as'],'attributes':_0x4377aa[_0xb285('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb285('0x10')](function(_0x4a4408){logger[_0xb285('0x11')]('GetChatQueue',_0x17ad6f);logger[_0xb285('0x14')](_0xb285('0x1a'),_0x17ad6f,JSON[_0xb285('0x16')](_0x4a4408));_0x402822(_0x4a4408);})[_0xb285('0x19')](function(_0x3f7139){logger[_0xb285('0x17')](_0xb285('0x1a'),_0x3f7139['message'],_0x17ad6f);_0x5d77cb(_0x378069[_0xb285('0x17')](0x1f4,_0x3f7139[_0xb285('0x18')]));});});};exports[_0xb285('0x23')]=function(_0x2ece08){var _0x152e0d=this;return new Promise(function(_0x521837,_0x4ed2b5){return db[_0xb285('0x1b')][_0xb285('0x24')]({'raw':_0x2ece08[_0xb285('0x1d')]?_0x2ece08[_0xb285('0x1d')][_0xb285('0x25')]===undefined?!![]:![]:!![],'where':_0x2ece08[_0xb285('0x1d')]?_0x2ece08[_0xb285('0x1d')]['where']||null:null,'attributes':_0x2ece08[_0xb285('0x1d')]?_0x2ece08[_0xb285('0x1d')][_0xb285('0x22')]||null:null,'include':_0x2ece08[_0xb285('0x1d')]?_0x2ece08['options'][_0xb285('0x1f')]?_[_0xb285('0x20')](_0x2ece08[_0xb285('0x1d')][_0xb285('0x1f')],function(_0x2efbaf){return{'model':db[_0x2efbaf[_0xb285('0x21')]],'as':_0x2efbaf['as'],'attributes':_0x2efbaf['attributes'],'include':_0x2efbaf[_0xb285('0x1f')]?_[_0xb285('0x20')](_0x2efbaf['include'],function(_0x420fa8){return{'model':db[_0x420fa8[_0xb285('0x21')]],'as':_0x420fa8['as'],'attributes':_0x420fa8['attributes'],'include':_0x420fa8[_0xb285('0x1f')]?_[_0xb285('0x20')](_0x420fa8['include'],function(_0x14ef0d){return{'model':db[_0x14ef0d[_0xb285('0x21')]],'as':_0x14ef0d['as'],'attributes':_0x14ef0d[_0xb285('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb285('0x10')](function(_0x1afa35){logger[_0xb285('0x11')](_0xb285('0x23'),_0x2ece08);logger[_0xb285('0x14')](_0xb285('0x23'),_0x2ece08,JSON['stringify'](_0x1afa35));_0x521837(_0x1afa35);})[_0xb285('0x19')](function(_0x2346f4){logger[_0xb285('0x17')](_0xb285('0x23'),_0x2346f4[_0xb285('0x18')],_0x2ece08);_0x4ed2b5(_0x152e0d[_0xb285('0x17')](0x1f4,_0x2346f4['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 0b6fa75..0f25ddb 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 _0x54ef=['remove','emit','removeListener','length','./chatQueue.events','save'];(function(_0x42ffa2,_0x4b3b89){var _0x281f01=function(_0x101e47){while(--_0x101e47){_0x42ffa2['push'](_0x42ffa2['shift']());}};_0x281f01(++_0x4b3b89);}(_0x54ef,0x112));var _0xf54e=function(_0x12baa8,_0x30d9b6){_0x12baa8=_0x12baa8-0x0;var _0x3a0200=_0x54ef[_0x12baa8];return _0x3a0200;};'use strict';var ChatQueueEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){ChatQueueEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('chatQueue:'+_0x561870,_0x55e611);ChatQueueEvents['on'](_0x561870,_0x27e69b);}};
\ No newline at end of file
+var _0x5636=['save','emit','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x4aae4c,_0x3f4b73){var _0x25b7bb=function(_0x44b763){while(--_0x44b763){_0x4aae4c['push'](_0x4aae4c['shift']());}};_0x25b7bb(++_0x3f4b73);}(_0x5636,0x102));var _0x6563=function(_0x1e0a60,_0x37718e){_0x1e0a60=_0x1e0a60-0x0;var _0x54febc=_0x5636[_0x1e0a60];return _0x54febc;};'use strict';var ChatQueueEvents=require(_0x6563('0x0'));var events=[_0x6563('0x1'),'remove','update'];function createListener(_0x579d5c,_0x44872c){return function(_0x3a95f7){_0x44872c[_0x6563('0x2')](_0x579d5c,_0x3a95f7);};}function removeListener(_0x4ac653,_0x166a58){return function(){ChatQueueEvents[_0x6563('0x3')](_0x4ac653,_0x166a58);};}exports[_0x6563('0x4')]=function(_0x39792f){for(var _0x29f687=0x0,_0x193942=events[_0x6563('0x5')];_0x29f687<_0x193942;_0x29f687++){var _0x2d57d5=events[_0x29f687];var _0x2d0d5b=createListener(_0x6563('0x6')+_0x2d57d5,_0x39792f);ChatQueueEvents['on'](_0x2d57d5,_0x2d0d5b);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 56ff6f0..660e774 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x495acd,_0x2d5066){var _0x4a46d8=function(_0x5dec06){while(--_0x5dec06){_0x495acd['push'](_0x495acd['shift']());}};_0x4a46d8(++_0x2d5066);}(_0x55ca,0x126));var _0xa55c=function(_0x5530a9,_0x48e4c2){_0x5530a9=_0x5530a9-0x0;var _0x1c69f4=_0x55ca[_0x5530a9];return _0x1c69f4;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x546391,_0x5790a9){var _0x67d3d4=function(_0x391cb5){while(--_0x391cb5){_0x546391['push'](_0x546391['shift']());}};_0x67d3d4(++_0x5790a9);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 0bdb05a..c6e7b61 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 _0x2707=['STRING','DATE','moment'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x2707,0x143));var _0x7270=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x2707[_0x2e4e19];return _0x9ba20b;};'use strict';var moment=require(_0x7270('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7270('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7270('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7270('0x2')]},'reason':{'type':Sequelize[_0x7270('0x1')]}};
\ No newline at end of file
+var _0x4215=['STRING','DATE','moment'];(function(_0x5d87ce,_0x456653){var _0x5e7428=function(_0xf3d89b){while(--_0xf3d89b){_0x5d87ce['push'](_0x5d87ce['shift']());}};_0x5e7428(++_0x456653);}(_0x4215,0x6e));var _0x5421=function(_0x5829eb,_0x173950){_0x5829eb=_0x5829eb-0x0;var _0x472f7a=_0x4215[_0x5829eb];return _0x472f7a;};'use strict';var moment=require(_0x5421('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5421('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5421('0x1')]},'joinAt':{'type':Sequelize[_0x5421('0x2')]},'leaveAt':{'type':Sequelize[_0x5421('0x2')]},'acceptAt':{'type':Sequelize[_0x5421('0x2')]},'exitAt':{'type':Sequelize[_0x5421('0x2')]},'reason':{'type':Sequelize[_0x5421('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 41a7625..30550da 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 _0xacc6=['index','map','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ChatQueueReport','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send'];(function(_0x283290,_0x1bef2f){var _0x4c7e20=function(_0x44d8ad){while(--_0x44d8ad){_0x283290['push'](_0x283290['shift']());}};_0x4c7e20(++_0x1bef2f);}(_0xacc6,0x150));var _0x6acc=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xacc6[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0x6acc('0x0'));var rimraf=require(_0x6acc('0x1'));var zipdir=require(_0x6acc('0x2'));var jsonpatch=require(_0x6acc('0x3'));var rp=require(_0x6acc('0x4'));var moment=require('moment');var BPromise=require(_0x6acc('0x5'));var Mustache=require(_0x6acc('0x6'));var util=require(_0x6acc('0x7'));var path=require('path');var sox=require(_0x6acc('0x8'));var csv=require('to-csv');var ejs=require(_0x6acc('0x9'));var fs=require('fs');var fs_extra=require(_0x6acc('0xa'));var _=require('lodash');var squel=require(_0x6acc('0xb'));var crypto=require('crypto');var jsforce=require(_0x6acc('0xc'));var deskjs=require(_0x6acc('0xd'));var toCsv=require(_0x6acc('0xe'));var querystring=require(_0x6acc('0xf'));var Papa=require('papaparse');var Redis=require(_0x6acc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6acc('0x11'));var as=require(_0x6acc('0x12'));var hardwareService=require(_0x6acc('0x13'));var logger=require(_0x6acc('0x14'))(_0x6acc('0x15'));var utils=require(_0x6acc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6acc('0x17'));var db=require(_0x6acc('0x18'))['db'];function respondWithStatusCode(_0x1d951c,_0xcf8224){_0xcf8224=_0xcf8224||0xcc;return function(_0x1b95a6){if(_0x1b95a6){return _0x1d951c['sendStatus'](_0xcf8224);}return _0x1d951c['status'](_0xcf8224)[_0x6acc('0x19')]();};}function respondWithResult(_0x497356,_0x14a543){_0x14a543=_0x14a543||0xc8;return function(_0x230318){if(_0x230318){return _0x497356[_0x6acc('0x1a')](_0x14a543)[_0x6acc('0x1b')](_0x230318);}};}function respondWithFilteredResult(_0x3c4e61,_0x4034fb){return function(_0xf24527){if(_0xf24527){var _0xc07208=typeof _0x4034fb[_0x6acc('0x1c')]===_0x6acc('0x1d')&&typeof _0x4034fb[_0x6acc('0x1e')]===_0x6acc('0x1d');var _0x24f513=_0xf24527[_0x6acc('0x1f')];var _0x3818d8=_0xc07208?0x0:_0x4034fb[_0x6acc('0x1c')];var _0x4ee616=_0xc07208?_0xf24527[_0x6acc('0x1f')]:_0x4034fb[_0x6acc('0x1c')]+_0x4034fb[_0x6acc('0x1e')];var _0x151282;if(_0x4ee616>=_0x24f513){_0x4ee616=_0x24f513;_0x151282=0xc8;}else{_0x151282=0xce;}_0x3c4e61['status'](_0x151282);return _0x3c4e61[_0x6acc('0x20')]('Content-Range',_0x3818d8+'-'+_0x4ee616+'/'+_0x24f513)['json'](_0xf24527);}return null;};}function patchUpdates(_0x4af9e){return function(_0x5d5382){try{jsonpatch[_0x6acc('0x21')](_0x5d5382,_0x4af9e,!![]);}catch(_0x3edf4a){return BPromise[_0x6acc('0x22')](_0x3edf4a);}return _0x5d5382[_0x6acc('0x23')]();};}function saveUpdates(_0x245536,_0x5ecb25){return function(_0x3e4a71){if(_0x3e4a71){return _0x3e4a71[_0x6acc('0x24')](_0x245536)['then'](function(_0x334416){return _0x334416;});}return null;};}function removeEntity(_0x5ba0b6,_0x22abf1){return function(_0x1db7bd){if(_0x1db7bd){return _0x1db7bd[_0x6acc('0x25')]()[_0x6acc('0x26')](function(){_0x5ba0b6['status'](0xcc)[_0x6acc('0x19')]();});}};}function handleEntityNotFound(_0xa4d97c,_0x4a4ca1){return function(_0x10f286){if(!_0x10f286){_0xa4d97c[_0x6acc('0x27')](0x194);}return _0x10f286;};}function handleError(_0x441f90,_0x125084){_0x125084=_0x125084||0x1f4;return function(_0x212bde){logger[_0x6acc('0x28')](_0x212bde[_0x6acc('0x29')]);if(_0x212bde[_0x6acc('0x2a')]){delete _0x212bde['name'];}_0x441f90[_0x6acc('0x1a')](_0x125084)[_0x6acc('0x2b')](_0x212bde);};}exports[_0x6acc('0x2c')]=function(_0x490ce6,_0x1bcfad){var _0x8e75a9={},_0x3c8c95={},_0x259373={'count':0x0,'rows':[]};var _0x19fdd3=_[_0x6acc('0x2d')](db['ChatQueueReport']['rawAttributes'],function(_0x47ff48){return{'name':_0x47ff48['fieldName'],'type':_0x47ff48[_0x6acc('0x2e')][_0x6acc('0x2f')]};});_0x3c8c95[_0x6acc('0x30')]=_[_0x6acc('0x2d')](_0x19fdd3,_0x6acc('0x2a'));_0x3c8c95[_0x6acc('0x31')]=_['keys'](_0x490ce6['query']);_0x3c8c95[_0x6acc('0x32')]=_[_0x6acc('0x33')](_0x3c8c95[_0x6acc('0x30')],_0x3c8c95[_0x6acc('0x31')]);_0x8e75a9['attributes']=_[_0x6acc('0x33')](_0x3c8c95[_0x6acc('0x30')],qs['fields'](_0x490ce6[_0x6acc('0x31')][_0x6acc('0x34')]));_0x8e75a9[_0x6acc('0x35')]=_0x8e75a9['attributes']['length']?_0x8e75a9[_0x6acc('0x35')]:_0x3c8c95[_0x6acc('0x30')];if(!_0x490ce6['query']['hasOwnProperty'](_0x6acc('0x36'))){_0x8e75a9[_0x6acc('0x1e')]=qs[_0x6acc('0x1e')](_0x490ce6['query'][_0x6acc('0x1e')]);_0x8e75a9[_0x6acc('0x1c')]=qs[_0x6acc('0x1c')](_0x490ce6[_0x6acc('0x31')][_0x6acc('0x1c')]);}_0x8e75a9['order']=qs[_0x6acc('0x37')](_0x490ce6['query'][_0x6acc('0x37')]);_0x8e75a9[_0x6acc('0x38')]=qs['filters'](_[_0x6acc('0x39')](_0x490ce6['query'],_0x3c8c95['filters']),_0x19fdd3);if(_0x490ce6[_0x6acc('0x31')][_0x6acc('0x3a')]){_0x8e75a9[_0x6acc('0x38')]=_['merge'](_0x8e75a9[_0x6acc('0x38')],{'$or':_['map'](_0x19fdd3,function(_0x1841b1){if(_0x1841b1['type']!==_0x6acc('0x3b')){var _0x13f74a={};_0x13f74a[_0x1841b1['name']]={'$like':'%'+_0x490ce6[_0x6acc('0x31')][_0x6acc('0x3a')]+'%'};return _0x13f74a;}})});}_0x8e75a9=_[_0x6acc('0x3c')]({},_0x8e75a9,_0x490ce6[_0x6acc('0x3d')]);var _0x46f7db={'where':_0x8e75a9[_0x6acc('0x38')]};return db[_0x6acc('0x3e')]['count'](_0x46f7db)['then'](function(_0x3481ad){_0x259373[_0x6acc('0x1f')]=_0x3481ad;if(_0x490ce6[_0x6acc('0x31')]['includeAll']){_0x8e75a9[_0x6acc('0x3f')]=[{'all':!![]}];}return db[_0x6acc('0x3e')][_0x6acc('0x40')](_0x8e75a9);})[_0x6acc('0x26')](function(_0x3f848c){_0x259373[_0x6acc('0x41')]=_0x3f848c;return _0x259373;})[_0x6acc('0x26')](respondWithFilteredResult(_0x1bcfad,_0x8e75a9))[_0x6acc('0x42')](handleError(_0x1bcfad,null));};exports[_0x6acc('0x43')]=function(_0x1c2776,_0x114709){var _0x17f828={'raw':!![],'where':{'id':_0x1c2776['params']['id']}},_0x5c938d={};_0x5c938d['model']=_[_0x6acc('0x44')](db['ChatQueueReport']['rawAttributes']);_0x5c938d[_0x6acc('0x31')]=_[_0x6acc('0x44')](_0x1c2776[_0x6acc('0x31')]);_0x5c938d[_0x6acc('0x32')]=_[_0x6acc('0x33')](_0x5c938d[_0x6acc('0x30')],_0x5c938d[_0x6acc('0x31')]);_0x17f828[_0x6acc('0x35')]=_[_0x6acc('0x33')](_0x5c938d[_0x6acc('0x30')],qs[_0x6acc('0x34')](_0x1c2776[_0x6acc('0x31')][_0x6acc('0x34')]));_0x17f828['attributes']=_0x17f828[_0x6acc('0x35')][_0x6acc('0x45')]?_0x17f828['attributes']:_0x5c938d[_0x6acc('0x30')];if(_0x1c2776['query'][_0x6acc('0x46')]){_0x17f828[_0x6acc('0x3f')]=[{'all':!![]}];}_0x17f828=_['merge']({},_0x17f828,_0x1c2776[_0x6acc('0x3d')]);return db[_0x6acc('0x3e')][_0x6acc('0x47')](_0x17f828)[_0x6acc('0x26')](handleEntityNotFound(_0x114709,null))[_0x6acc('0x26')](respondWithResult(_0x114709,null))['catch'](handleError(_0x114709,null));};exports[_0x6acc('0x48')]=function(_0x391a4f,_0x45c5e0){return db[_0x6acc('0x3e')][_0x6acc('0x48')](_0x391a4f[_0x6acc('0x49')],{})[_0x6acc('0x26')](respondWithResult(_0x45c5e0,0xc9))[_0x6acc('0x42')](handleError(_0x45c5e0,null));};exports[_0x6acc('0x24')]=function(_0x28e601,_0x1989a6){if(_0x28e601[_0x6acc('0x49')]['id']){delete _0x28e601[_0x6acc('0x49')]['id'];}return db[_0x6acc('0x3e')][_0x6acc('0x47')]({'where':{'id':_0x28e601[_0x6acc('0x4a')]['id']}})[_0x6acc('0x26')](handleEntityNotFound(_0x1989a6,null))['then'](saveUpdates(_0x28e601['body'],null))['then'](respondWithResult(_0x1989a6,null))[_0x6acc('0x42')](handleError(_0x1989a6,null));};exports[_0x6acc('0x25')]=function(_0x5d63ee,_0x13e10e){return db[_0x6acc('0x3e')][_0x6acc('0x47')]({'where':{'id':_0x5d63ee[_0x6acc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x13e10e,null))[_0x6acc('0x26')](removeEntity(_0x13e10e,null))[_0x6acc('0x42')](handleError(_0x13e10e,null));};exports[_0x6acc('0x4b')]=function(_0x1a1e1f,_0x459b99){return db['ChatQueueReport'][_0x6acc('0x4b')]()[_0x6acc('0x26')](respondWithResult(_0x459b99,null))[_0x6acc('0x42')](handleError(_0x459b99,null));};
\ No newline at end of file
+var _0xd8fb=['catch','show','params','keys','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows'];(function(_0x1c6eaf,_0x51bf9c){var _0x1403b4=function(_0x5ea2b8){while(--_0x5ea2b8){_0x1c6eaf['push'](_0x1c6eaf['shift']());}};_0x1403b4(++_0x51bf9c);}(_0xd8fb,0x99));var _0xbd8f=function(_0x552133,_0x1fcd11){_0x552133=_0x552133-0x0;var _0xd83c57=_0xd8fb[_0x552133];return _0xd83c57;};'use strict';var emlformat=require(_0xbd8f('0x0'));var rimraf=require(_0xbd8f('0x1'));var zipdir=require(_0xbd8f('0x2'));var jsonpatch=require(_0xbd8f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd8f('0x4'));var util=require(_0xbd8f('0x5'));var path=require('path');var sox=require(_0xbd8f('0x6'));var csv=require(_0xbd8f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd8f('0x8'));var _=require('lodash');var squel=require(_0xbd8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd8f('0xa'));var deskjs=require(_0xbd8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd8f('0xc'));var Redis=require(_0xbd8f('0xd'));var authService=require(_0xbd8f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbd8f('0xf'));var hardwareService=require(_0xbd8f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xbd8f('0x11'));var config=require(_0xbd8f('0x12'));var licenseUtil=require(_0xbd8f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xcc;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0x14')](_0x159f09);}return _0x230988[_0xbd8f('0x15')](_0x159f09)[_0xbd8f('0x16')]();};}function respondWithResult(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0xc8;return function(_0x14606c){if(_0x14606c){return _0x37d4d5['status'](_0x29ffe8)[_0xbd8f('0x17')](_0x14606c);}};}function respondWithFilteredResult(_0x829fb2,_0xa57e91){return function(_0x10d72e){if(_0x10d72e){var _0x4da96f=typeof _0xa57e91[_0xbd8f('0x18')]===_0xbd8f('0x19')&&typeof _0xa57e91['limit']===_0xbd8f('0x19');var _0xf5e7a=_0x10d72e['count'];var _0x4435b9=_0x4da96f?0x0:_0xa57e91[_0xbd8f('0x18')];var _0x47d317=_0x4da96f?_0x10d72e['count']:_0xa57e91[_0xbd8f('0x18')]+_0xa57e91['limit'];var _0x5705c5;if(_0x47d317>=_0xf5e7a){_0x47d317=_0xf5e7a;_0x5705c5=0xc8;}else{_0x5705c5=0xce;}_0x829fb2[_0xbd8f('0x15')](_0x5705c5);return _0x829fb2['set'](_0xbd8f('0x1a'),_0x4435b9+'-'+_0x47d317+'/'+_0xf5e7a)[_0xbd8f('0x17')](_0x10d72e);}return null;};}function patchUpdates(_0xb47c8e){return function(_0x897f25){try{jsonpatch[_0xbd8f('0x1b')](_0x897f25,_0xb47c8e,!![]);}catch(_0x20cab7){return BPromise[_0xbd8f('0x1c')](_0x20cab7);}return _0x897f25[_0xbd8f('0x1d')]();};}function saveUpdates(_0x2fbe3b,_0x775acc){return function(_0xfe4048){if(_0xfe4048){return _0xfe4048[_0xbd8f('0x1e')](_0x2fbe3b)[_0xbd8f('0x1f')](function(_0x15c4a9){return _0x15c4a9;});}return null;};}function removeEntity(_0x320ede,_0xd11ae){return function(_0x395b1b){if(_0x395b1b){return _0x395b1b['destroy']()[_0xbd8f('0x1f')](function(){_0x320ede[_0xbd8f('0x15')](0xcc)[_0xbd8f('0x16')]();});}};}function handleEntityNotFound(_0x2f3df7,_0xa88414){return function(_0x2257fd){if(!_0x2257fd){_0x2f3df7[_0xbd8f('0x14')](0x194);}return _0x2257fd;};}function handleError(_0x264e62,_0x4ea554){_0x4ea554=_0x4ea554||0x1f4;return function(_0x40cb43){logger[_0xbd8f('0x20')](_0x40cb43['stack']);if(_0x40cb43[_0xbd8f('0x21')]){delete _0x40cb43['name'];}_0x264e62[_0xbd8f('0x15')](_0x4ea554)[_0xbd8f('0x22')](_0x40cb43);};}exports[_0xbd8f('0x23')]=function(_0x202126,_0x2aefa2){var _0x247b07={},_0x4c4431={},_0x166de7={'count':0x0,'rows':[]};var _0x14f3cb=_[_0xbd8f('0x24')](db[_0xbd8f('0x25')][_0xbd8f('0x26')],function(_0x2ac26f){return{'name':_0x2ac26f[_0xbd8f('0x27')],'type':_0x2ac26f['type'][_0xbd8f('0x28')]};});_0x4c4431[_0xbd8f('0x29')]=_[_0xbd8f('0x24')](_0x14f3cb,_0xbd8f('0x21'));_0x4c4431['query']=_['keys'](_0x202126[_0xbd8f('0x2a')]);_0x4c4431[_0xbd8f('0x2b')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],_0x4c4431['query']);_0x247b07[_0xbd8f('0x2d')]=_[_0xbd8f('0x2c')](_0x4c4431[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x202126[_0xbd8f('0x2a')]['fields']));_0x247b07[_0xbd8f('0x2d')]=_0x247b07[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x247b07[_0xbd8f('0x2d')]:_0x4c4431[_0xbd8f('0x29')];if(!_0x202126['query'][_0xbd8f('0x30')]('nolimit')){_0x247b07[_0xbd8f('0x31')]=qs[_0xbd8f('0x31')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x31')]);_0x247b07[_0xbd8f('0x18')]=qs[_0xbd8f('0x18')](_0x202126['query']['offset']);}_0x247b07['order']=qs[_0xbd8f('0x32')](_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x32')]);_0x247b07[_0xbd8f('0x33')]=qs[_0xbd8f('0x2b')](_[_0xbd8f('0x34')](_0x202126[_0xbd8f('0x2a')],_0x4c4431[_0xbd8f('0x2b')]),_0x14f3cb);if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]){_0x247b07[_0xbd8f('0x33')]=_[_0xbd8f('0x36')](_0x247b07[_0xbd8f('0x33')],{'$or':_[_0xbd8f('0x24')](_0x14f3cb,function(_0x391d45){if(_0x391d45['type']!==_0xbd8f('0x37')){var _0x4181e0={};_0x4181e0[_0x391d45['name']]={'$like':'%'+_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x35')]+'%'};return _0x4181e0;}})});}_0x247b07=_[_0xbd8f('0x36')]({},_0x247b07,_0x202126['options']);var _0x21da54={'where':_0x247b07['where']};return db[_0xbd8f('0x25')][_0xbd8f('0x38')](_0x21da54)[_0xbd8f('0x1f')](function(_0x4f2ebc){_0x166de7[_0xbd8f('0x38')]=_0x4f2ebc;if(_0x202126[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x247b07['include']=[{'all':!![]}];}return db[_0xbd8f('0x25')][_0xbd8f('0x3a')](_0x247b07);})[_0xbd8f('0x1f')](function(_0x351027){_0x166de7[_0xbd8f('0x3b')]=_0x351027;return _0x166de7;})[_0xbd8f('0x1f')](respondWithFilteredResult(_0x2aefa2,_0x247b07))[_0xbd8f('0x3c')](handleError(_0x2aefa2,null));};exports[_0xbd8f('0x3d')]=function(_0x14b768,_0x5e1e77){var _0x52c62b={'raw':!![],'where':{'id':_0x14b768[_0xbd8f('0x3e')]['id']}},_0x2907a3={};_0x2907a3[_0xbd8f('0x29')]=_[_0xbd8f('0x3f')](db['ChatQueueReport'][_0xbd8f('0x26')]);_0x2907a3[_0xbd8f('0x2a')]=_[_0xbd8f('0x3f')](_0x14b768[_0xbd8f('0x2a')]);_0x2907a3[_0xbd8f('0x2b')]=_['intersection'](_0x2907a3['model'],_0x2907a3[_0xbd8f('0x2a')]);_0x52c62b['attributes']=_[_0xbd8f('0x2c')](_0x2907a3[_0xbd8f('0x29')],qs[_0xbd8f('0x2e')](_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x2e')]));_0x52c62b[_0xbd8f('0x2d')]=_0x52c62b[_0xbd8f('0x2d')][_0xbd8f('0x2f')]?_0x52c62b['attributes']:_0x2907a3[_0xbd8f('0x29')];if(_0x14b768[_0xbd8f('0x2a')][_0xbd8f('0x39')]){_0x52c62b[_0xbd8f('0x40')]=[{'all':!![]}];}_0x52c62b=_[_0xbd8f('0x36')]({},_0x52c62b,_0x14b768[_0xbd8f('0x41')]);return db[_0xbd8f('0x25')][_0xbd8f('0x42')](_0x52c62b)['then'](handleEntityNotFound(_0x5e1e77,null))[_0xbd8f('0x1f')](respondWithResult(_0x5e1e77,null))[_0xbd8f('0x3c')](handleError(_0x5e1e77,null));};exports[_0xbd8f('0x43')]=function(_0x1f12dd,_0x2fdbd0){return db[_0xbd8f('0x25')][_0xbd8f('0x43')](_0x1f12dd[_0xbd8f('0x44')],{})[_0xbd8f('0x1f')](respondWithResult(_0x2fdbd0,0xc9))[_0xbd8f('0x3c')](handleError(_0x2fdbd0,null));};exports[_0xbd8f('0x1e')]=function(_0x255c59,_0x3d0ffa){if(_0x255c59[_0xbd8f('0x44')]['id']){delete _0x255c59[_0xbd8f('0x44')]['id'];}return db[_0xbd8f('0x25')][_0xbd8f('0x42')]({'where':{'id':_0x255c59[_0xbd8f('0x3e')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x3d0ffa,null))['then'](saveUpdates(_0x255c59[_0xbd8f('0x44')],null))[_0xbd8f('0x1f')](respondWithResult(_0x3d0ffa,null))[_0xbd8f('0x3c')](handleError(_0x3d0ffa,null));};exports[_0xbd8f('0x45')]=function(_0x4ce6b0,_0x1b38ad){return db['ChatQueueReport'][_0xbd8f('0x42')]({'where':{'id':_0x4ce6b0[_0xbd8f('0x3e')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x1b38ad,null))[_0xbd8f('0x1f')](removeEntity(_0x1b38ad,null))['catch'](handleError(_0x1b38ad,null));};exports[_0xbd8f('0x46')]=function(_0x35b814,_0x3b67ac){return db[_0xbd8f('0x25')][_0xbd8f('0x46')]()[_0xbd8f('0x1f')](respondWithResult(_0x3b67ac,null))['catch'](handleError(_0x3b67ac,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index e7ae753..fbdc01f 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x11d3b5,_0x13fce1){var _0x332d27=function(_0x346fcb){while(--_0x346fcb){_0x11d3b5['push'](_0x11d3b5['shift']());}};_0x332d27(++_0x13fce1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x513e58,_0x37c056){var _0x5cd7be=function(_0x26f680){while(--_0x26f680){_0x513e58['push'](_0x513e58['shift']());}};_0x5cd7be(++_0x37c056);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 9cef27f..cd06a4e 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 _0x0de2=['message','info','result','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','attributes','limit','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2ab5c1,_0x50cd7d){var _0x24a514=function(_0x48be12){while(--_0x48be12){_0x2ab5c1['push'](_0x2ab5c1['shift']());}};_0x24a514(++_0x50cd7d);}(_0x0de2,0xa4));var _0x20de=function(_0x422994,_0x99047b){_0x422994=_0x422994-0x0;var _0x43ad8f=_0x0de2[_0x422994];return _0x43ad8f;};'use strict';var _=require('lodash');var util=require(_0x20de('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x20de('0x1'));var fs=require('fs');var Redis=require(_0x20de('0x2'));var db=require(_0x20de('0x3'))['db'];var utils=require(_0x20de('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x20de('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x20de('0x6')][_0x20de('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e72e0,_0x92d904,_0x46a18e){return new BPromise(function(_0x3bc681,_0x157494){return client[_0x20de('0x8')](_0x5e72e0,_0x46a18e)[_0x20de('0x9')](function(_0x149e8c){logger['info'](_0x20de('0xa'),_0x92d904,_0x20de('0xb'));logger[_0x20de('0xc')](_0x20de('0xd'),_0x92d904,_0x20de('0xb'),JSON['stringify'](_0x149e8c));if(_0x149e8c[_0x20de('0xe')]){if(_0x149e8c[_0x20de('0xe')][_0x20de('0xf')]===0x1f4){logger[_0x20de('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x92d904,_0x149e8c[_0x20de('0xe')][_0x20de('0x10')]);return _0x157494(_0x149e8c['error'][_0x20de('0x10')]);}logger['error'](_0x20de('0xa'),_0x92d904,_0x149e8c[_0x20de('0xe')]['message']);return _0x3bc681(_0x149e8c[_0x20de('0xe')]['message']);}else{logger[_0x20de('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x92d904,_0x20de('0xb'));_0x3bc681(_0x149e8c[_0x20de('0x12')][_0x20de('0x10')]);}})['catch'](function(_0x4d76da){logger[_0x20de('0xe')](_0x20de('0xa'),_0x92d904,_0x4d76da);_0x157494(_0x4d76da);});});}exports['CreateChatQueueReport']=function(_0x35bd02){var _0x3c2924=this;return new Promise(function(_0x1fb1ce,_0x55d422){return db[_0x20de('0x13')][_0x20de('0x14')](_0x35bd02[_0x20de('0x15')],{'raw':_0x35bd02[_0x20de('0x16')]?_0x35bd02[_0x20de('0x16')][_0x20de('0x17')]===undefined?!![]:![]:!![]})[_0x20de('0x9')](function(_0x3ba9bb){logger[_0x20de('0x11')](_0x20de('0x18'),_0x35bd02);logger[_0x20de('0xc')](_0x20de('0x18'),_0x35bd02,JSON[_0x20de('0x19')](_0x3ba9bb));_0x1fb1ce(_0x3ba9bb);})['catch'](function(_0x57b938){logger[_0x20de('0xe')]('CreateChatQueueReport',_0x57b938[_0x20de('0x10')],_0x35bd02);_0x55d422(_0x3c2924['error'](0x1f4,_0x57b938[_0x20de('0x10')]));});});};exports[_0x20de('0x1a')]=function(_0x3ed8de){var _0x21bd82=this;return new Promise(function(_0x49dcd5,_0x4693c2){return db[_0x20de('0x13')]['update'](_0x3ed8de[_0x20de('0x15')],{'raw':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de['options'][_0x20de('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de['options']['where']||null:null,'attributes':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de[_0x20de('0x16')][_0x20de('0x1b')]||null:null,'limit':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de[_0x20de('0x16')][_0x20de('0x1c')]||null:null})[_0x20de('0x9')](function(_0x366839){logger[_0x20de('0x11')](_0x20de('0x1a'),_0x3ed8de);logger[_0x20de('0xc')](_0x20de('0x1a'),_0x3ed8de,JSON['stringify'](_0x366839));_0x49dcd5(_0x366839);})[_0x20de('0x1d')](function(_0x22ba5e){logger[_0x20de('0xe')](_0x20de('0x1a'),_0x22ba5e['message'],_0x3ed8de);_0x4693c2(_0x21bd82[_0x20de('0xe')](0x1f4,_0x22ba5e[_0x20de('0x10')]));});});};
\ No newline at end of file
+var _0x552a=['body','options','info','catch','update','limit','UpdateChatQueueReport','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create'];(function(_0x101bc1,_0xc2eb03){var _0x3a2bc0=function(_0x54bf68){while(--_0x54bf68){_0x101bc1['push'](_0x101bc1['shift']());}};_0x3a2bc0(++_0xc2eb03);}(_0x552a,0xaf));var _0xa552=function(_0x3cde5e,_0x4e2206){_0x3cde5e=_0x3cde5e-0x0;var _0x23c07b=_0x552a[_0x3cde5e];return _0x23c07b;};'use strict';var _=require('lodash');var util=require(_0xa552('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa552('0x1'));var fs=require('fs');var Redis=require(_0xa552('0x2'));var db=require(_0xa552('0x3'))['db'];var utils=require(_0xa552('0x4'));var logger=require('../../config/logger')(_0xa552('0x5'));var config=require('../../config/environment');var jayson=require(_0xa552('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a55bb,_0x341054,_0x42ae3e){return new BPromise(function(_0x26cacf,_0x400561){return client[_0xa552('0x7')](_0x5a55bb,_0x42ae3e)[_0xa552('0x8')](function(_0x47546d){logger['info'](_0xa552('0x9'),_0x341054,_0xa552('0xa'));logger[_0xa552('0xb')](_0xa552('0xc'),_0x341054,_0xa552('0xa'),JSON[_0xa552('0xd')](_0x47546d));if(_0x47546d[_0xa552('0xe')]){if(_0x47546d[_0xa552('0xe')][_0xa552('0xf')]===0x1f4){logger[_0xa552('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x341054,_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);return _0x400561(_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);}logger[_0xa552('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x341054,_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);return _0x26cacf(_0x47546d[_0xa552('0xe')][_0xa552('0x10')]);}else{logger['info'](_0xa552('0x9'),_0x341054,_0xa552('0xa'));_0x26cacf(_0x47546d[_0xa552('0x11')][_0xa552('0x10')]);}})['catch'](function(_0x169be4){logger[_0xa552('0xe')](_0xa552('0x9'),_0x341054,_0x169be4);_0x400561(_0x169be4);});});}exports[_0xa552('0x12')]=function(_0x5780ad){var _0x2db3df=this;return new Promise(function(_0x1cdb04,_0x3616f9){return db[_0xa552('0x13')][_0xa552('0x14')](_0x5780ad[_0xa552('0x15')],{'raw':_0x5780ad['options']?_0x5780ad[_0xa552('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xa552('0x8')](function(_0x9ac27d){logger[_0xa552('0x17')]('CreateChatQueueReport',_0x5780ad);logger[_0xa552('0xb')](_0xa552('0x12'),_0x5780ad,JSON[_0xa552('0xd')](_0x9ac27d));_0x1cdb04(_0x9ac27d);})[_0xa552('0x18')](function(_0x106097){logger[_0xa552('0xe')](_0xa552('0x12'),_0x106097['message'],_0x5780ad);_0x3616f9(_0x2db3df[_0xa552('0xe')](0x1f4,_0x106097[_0xa552('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x920756){var _0x53658b=this;return new Promise(function(_0x43e573,_0x2f3064){return db[_0xa552('0x13')][_0xa552('0x19')](_0x920756[_0xa552('0x15')],{'raw':_0x920756['options']?_0x920756[_0xa552('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x920756['options']?_0x920756[_0xa552('0x16')]['where']||null:null,'attributes':_0x920756[_0xa552('0x16')]?_0x920756[_0xa552('0x16')]['attributes']||null:null,'limit':_0x920756[_0xa552('0x16')]?_0x920756[_0xa552('0x16')][_0xa552('0x1a')]||null:null})[_0xa552('0x8')](function(_0x13f647){logger[_0xa552('0x17')](_0xa552('0x1b'),_0x920756);logger[_0xa552('0xb')]('UpdateChatQueueReport',_0x920756,JSON[_0xa552('0xd')](_0x13f647));_0x43e573(_0x13f647);})[_0xa552('0x18')](function(_0x45919a){logger['error'](_0xa552('0x1b'),_0x45919a[_0xa552('0x10')],_0x920756);_0x2f3064(_0x53658b['error'](0x1f4,_0x45919a[_0xa552('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 10ddfc3..3484745 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 _0xcea1=['isAuthenticated','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xcea1,0x7f));var _0x1cea=function(_0x3058bc,_0x391ddb){_0x3058bc=_0x3058bc-0x0;var _0x586a60=_0xcea1[_0x3058bc];return _0x586a60;};'use strict';var multer=require(_0x1cea('0x0'));var util=require(_0x1cea('0x1'));var path=require(_0x1cea('0x2'));var timeout=require(_0x1cea('0x3'));var express=require('express');var router=express[_0x1cea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1cea('0x5'));var interaction=require(_0x1cea('0x6'));var config=require(_0x1cea('0x7'));var controller=require('./chatQueueReport.controller');router[_0x1cea('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1cea('0x8')]('/describe',auth[_0x1cea('0x9')](),controller['describe']);router[_0x1cea('0x8')](_0x1cea('0xa'),auth[_0x1cea('0x9')](),controller[_0x1cea('0xb')]);router[_0x1cea('0xc')]('/',auth[_0x1cea('0x9')](),controller['create']);router[_0x1cea('0xd')](_0x1cea('0xa'),auth[_0x1cea('0x9')](),controller[_0x1cea('0xe')]);router[_0x1cea('0xf')](_0x1cea('0xa'),auth[_0x1cea('0x9')](),controller[_0x1cea('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x4e72=['isAuthenticated','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x12031f,_0x514040){var _0x4ae80e=function(_0x1e47a0){while(--_0x1e47a0){_0x12031f['push'](_0x12031f['shift']());}};_0x4ae80e(++_0x514040);}(_0x4e72,0x1e3));var _0x24e7=function(_0xb8baa9,_0x3fcc6a){_0xb8baa9=_0xb8baa9-0x0;var _0x464bd0=_0x4e72[_0xb8baa9];return _0x464bd0;};'use strict';var multer=require(_0x24e7('0x0'));var util=require('util');var path=require(_0x24e7('0x1'));var timeout=require(_0x24e7('0x2'));var express=require(_0x24e7('0x3'));var router=express[_0x24e7('0x4')]();var fs_extra=require(_0x24e7('0x5'));var auth=require(_0x24e7('0x6'));var interaction=require(_0x24e7('0x7'));var config=require(_0x24e7('0x8'));var controller=require(_0x24e7('0x9'));router[_0x24e7('0xa')]('/',auth[_0x24e7('0xb')](),controller['index']);router[_0x24e7('0xa')]('/describe',auth[_0x24e7('0xb')](),controller['describe']);router[_0x24e7('0xa')](_0x24e7('0xc'),auth[_0x24e7('0xb')](),controller['show']);router[_0x24e7('0xd')]('/',auth[_0x24e7('0xb')](),controller[_0x24e7('0xe')]);router[_0x24e7('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x24e7('0x10')]);router[_0x24e7('0x11')](_0x24e7('0xc'),auth[_0x24e7('0xb')](),controller['destroy']);module[_0x24e7('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index c336152..6bef608 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x214d3d,_0x1c7156){var _0x1d585e=function(_0x41ce57){while(--_0x41ce57){_0x214d3d['push'](_0x214d3d['shift']());}};_0x1d585e(++_0x1c7156);}(_0xe706,0xa3));var _0x6e70=function(_0x374870,_0x82a474){_0x374870=_0x374870-0x0;var _0x4de8f4=_0xe706[_0x374870];return _0x4de8f4;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1ea124,_0x2244b3){var _0x480f33=function(_0x287ef2){while(--_0x287ef2){_0x1ea124['push'](_0x1ea124['shift']());}};_0x480f33(++_0x2244b3);}(_0x34e8,0x12c));var _0x834e=function(_0x1834e7,_0x5211e4){_0x1834e7=_0x1834e7-0x0;var _0xbfbdc9=_0x34e8[_0x1834e7];return _0xbfbdc9;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 922497a..b77ac18 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 _0x09d9=['destroy','sendStatus','error','stack','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','count','offset','limit','status','set','Content-Range','reject','save','update','then'];(function(_0x27dc8d,_0x1f0639){var _0x3f7fd4=function(_0x3ca25d){while(--_0x3ca25d){_0x27dc8d['push'](_0x27dc8d['shift']());}};_0x3f7fd4(++_0x1f0639);}(_0x09d9,0x71));var _0x909d=function(_0x38838d,_0x15d035){_0x38838d=_0x38838d-0x0;var _0x9f6165=_0x09d9[_0x38838d];return _0x9f6165;};'use strict';var emlformat=require(_0x909d('0x0'));var rimraf=require(_0x909d('0x1'));var zipdir=require(_0x909d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x909d('0x3'));var moment=require(_0x909d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x909d('0x5'));var util=require('util');var path=require(_0x909d('0x6'));var sox=require(_0x909d('0x7'));var csv=require(_0x909d('0x8'));var ejs=require(_0x909d('0x9'));var fs=require('fs');var fs_extra=require(_0x909d('0xa'));var _=require(_0x909d('0xb'));var squel=require('squel');var crypto=require(_0x909d('0xc'));var jsforce=require(_0x909d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x909d('0x8'));var querystring=require(_0x909d('0xe'));var Papa=require(_0x909d('0xf'));var Redis=require('ioredis');var authService=require(_0x909d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x909d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x909d('0x12'));var utils=require(_0x909d('0x13'));var config=require(_0x909d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x909d('0x15'))['db'];function respondWithStatusCode(_0x30b7e3,_0x286a0e){_0x286a0e=_0x286a0e||0xcc;return function(_0x1e9495){if(_0x1e9495){return _0x30b7e3['sendStatus'](_0x286a0e);}return _0x30b7e3['status'](_0x286a0e)[_0x909d('0x16')]();};}function respondWithResult(_0xe0742c,_0x3651e1){_0x3651e1=_0x3651e1||0xc8;return function(_0x290d2c){if(_0x290d2c){return _0xe0742c['status'](_0x3651e1)[_0x909d('0x17')](_0x290d2c);}};}function respondWithFilteredResult(_0xc9fec0,_0x333d4f){return function(_0x44cd6f){if(_0x44cd6f){var _0x4b0fd6=typeof _0x333d4f['offset']===_0x909d('0x18')&&typeof _0x333d4f['limit']===_0x909d('0x18');var _0x38ee20=_0x44cd6f[_0x909d('0x19')];var _0x2f91c2=_0x4b0fd6?0x0:_0x333d4f[_0x909d('0x1a')];var _0x51eb39=_0x4b0fd6?_0x44cd6f[_0x909d('0x19')]:_0x333d4f[_0x909d('0x1a')]+_0x333d4f[_0x909d('0x1b')];var _0x114f74;if(_0x51eb39>=_0x38ee20){_0x51eb39=_0x38ee20;_0x114f74=0xc8;}else{_0x114f74=0xce;}_0xc9fec0[_0x909d('0x1c')](_0x114f74);return _0xc9fec0[_0x909d('0x1d')](_0x909d('0x1e'),_0x2f91c2+'-'+_0x51eb39+'/'+_0x38ee20)[_0x909d('0x17')](_0x44cd6f);}return null;};}function patchUpdates(_0x184144){return function(_0x1a818f){try{jsonpatch['apply'](_0x1a818f,_0x184144,!![]);}catch(_0x5f14cb){return BPromise[_0x909d('0x1f')](_0x5f14cb);}return _0x1a818f[_0x909d('0x20')]();};}function saveUpdates(_0x1e2400,_0x1a87c5){return function(_0x2d3a68){if(_0x2d3a68){return _0x2d3a68[_0x909d('0x21')](_0x1e2400)[_0x909d('0x22')](function(_0x3b0a71){return _0x3b0a71;});}return null;};}function removeEntity(_0x24e19d,_0x554ba7){return function(_0x36b126){if(_0x36b126){return _0x36b126[_0x909d('0x23')]()['then'](function(){_0x24e19d[_0x909d('0x1c')](0xcc)[_0x909d('0x16')]();});}};}function handleEntityNotFound(_0x57c829,_0x4b2ee3){return function(_0x47dc3b){if(!_0x47dc3b){_0x57c829[_0x909d('0x24')](0x194);}return _0x47dc3b;};}function handleError(_0x39a211,_0x3e24db){_0x3e24db=_0x3e24db||0x1f4;return function(_0x4d5169){logger[_0x909d('0x25')](_0x4d5169[_0x909d('0x26')]);if(_0x4d5169['name']){delete _0x4d5169['name'];}_0x39a211[_0x909d('0x1c')](_0x3e24db)[_0x909d('0x27')](_0x4d5169);};}exports['index']=function(_0x16f7e6,_0x209d66){var _0x4766ea={},_0x1b8f03={},_0x5a9cfc={'count':0x0,'rows':[]};var _0x5a5b70=_[_0x909d('0x28')](db[_0x909d('0x29')][_0x909d('0x2a')],function(_0x250e97){return{'name':_0x250e97[_0x909d('0x2b')],'type':_0x250e97[_0x909d('0x2c')][_0x909d('0x2d')]};});_0x1b8f03['model']=_[_0x909d('0x28')](_0x5a5b70,'name');_0x1b8f03[_0x909d('0x2e')]=_[_0x909d('0x2f')](_0x16f7e6[_0x909d('0x2e')]);_0x1b8f03[_0x909d('0x30')]=_[_0x909d('0x31')](_0x1b8f03[_0x909d('0x32')],_0x1b8f03[_0x909d('0x2e')]);_0x4766ea[_0x909d('0x33')]=_[_0x909d('0x31')](_0x1b8f03[_0x909d('0x32')],qs['fields'](_0x16f7e6[_0x909d('0x2e')][_0x909d('0x34')]));_0x4766ea[_0x909d('0x33')]=_0x4766ea[_0x909d('0x33')][_0x909d('0x35')]?_0x4766ea['attributes']:_0x1b8f03[_0x909d('0x32')];if(!_0x16f7e6['query'][_0x909d('0x36')](_0x909d('0x37'))){_0x4766ea['limit']=qs[_0x909d('0x1b')](_0x16f7e6[_0x909d('0x2e')][_0x909d('0x1b')]);_0x4766ea['offset']=qs[_0x909d('0x1a')](_0x16f7e6['query'][_0x909d('0x1a')]);}_0x4766ea['order']=qs['sort'](_0x16f7e6[_0x909d('0x2e')][_0x909d('0x38')]);_0x4766ea[_0x909d('0x39')]=qs[_0x909d('0x30')](_[_0x909d('0x3a')](_0x16f7e6['query'],_0x1b8f03['filters']),_0x5a5b70);if(_0x16f7e6[_0x909d('0x2e')]['filter']){_0x4766ea[_0x909d('0x39')]=_[_0x909d('0x3b')](_0x4766ea[_0x909d('0x39')],{'$or':_[_0x909d('0x28')](_0x5a5b70,function(_0x369a28){if(_0x369a28[_0x909d('0x2c')]!==_0x909d('0x3c')){var _0x3e8507={};_0x3e8507[_0x369a28[_0x909d('0x3d')]]={'$like':'%'+_0x16f7e6[_0x909d('0x2e')]['filter']+'%'};return _0x3e8507;}})});}_0x4766ea=_[_0x909d('0x3b')]({},_0x4766ea,_0x16f7e6[_0x909d('0x3e')]);var _0x58dc9={'where':_0x4766ea[_0x909d('0x39')]};return db[_0x909d('0x29')]['count'](_0x58dc9)[_0x909d('0x22')](function(_0x4b23ea){_0x5a9cfc['count']=_0x4b23ea;if(_0x16f7e6[_0x909d('0x2e')][_0x909d('0x3f')]){_0x4766ea[_0x909d('0x40')]=[{'all':!![]}];}return db[_0x909d('0x29')][_0x909d('0x41')](_0x4766ea);})[_0x909d('0x22')](function(_0x16db09){_0x5a9cfc[_0x909d('0x42')]=_0x16db09;return _0x5a9cfc;})[_0x909d('0x22')](respondWithFilteredResult(_0x209d66,_0x4766ea))[_0x909d('0x43')](handleError(_0x209d66,null));};exports[_0x909d('0x44')]=function(_0x3c2ec2,_0x1fb43b){var _0x2119d2={'raw':!![],'where':{'id':_0x3c2ec2['params']['id']}},_0x3ad6cc={};_0x3ad6cc[_0x909d('0x32')]=_[_0x909d('0x2f')](db['ChatTransferReport'][_0x909d('0x2a')]);_0x3ad6cc[_0x909d('0x2e')]=_[_0x909d('0x2f')](_0x3c2ec2['query']);_0x3ad6cc[_0x909d('0x30')]=_[_0x909d('0x31')](_0x3ad6cc['model'],_0x3ad6cc['query']);_0x2119d2['attributes']=_[_0x909d('0x31')](_0x3ad6cc['model'],qs[_0x909d('0x34')](_0x3c2ec2[_0x909d('0x2e')]['fields']));_0x2119d2['attributes']=_0x2119d2['attributes'][_0x909d('0x35')]?_0x2119d2[_0x909d('0x33')]:_0x3ad6cc[_0x909d('0x32')];if(_0x3c2ec2[_0x909d('0x2e')][_0x909d('0x3f')]){_0x2119d2['include']=[{'all':!![]}];}_0x2119d2=_[_0x909d('0x3b')]({},_0x2119d2,_0x3c2ec2[_0x909d('0x3e')]);return db[_0x909d('0x29')][_0x909d('0x45')](_0x2119d2)[_0x909d('0x22')](handleEntityNotFound(_0x1fb43b,null))[_0x909d('0x22')](respondWithResult(_0x1fb43b,null))['catch'](handleError(_0x1fb43b,null));};exports[_0x909d('0x46')]=function(_0x376a32,_0x49a6e6){return db[_0x909d('0x29')][_0x909d('0x46')](_0x376a32[_0x909d('0x47')],{})[_0x909d('0x22')](respondWithResult(_0x49a6e6,0xc9))[_0x909d('0x43')](handleError(_0x49a6e6,null));};exports[_0x909d('0x21')]=function(_0x442a63,_0x1aa101){if(_0x442a63['body']['id']){delete _0x442a63[_0x909d('0x47')]['id'];}return db[_0x909d('0x29')][_0x909d('0x45')]({'where':{'id':_0x442a63[_0x909d('0x48')]['id']}})[_0x909d('0x22')](handleEntityNotFound(_0x1aa101,null))[_0x909d('0x22')](saveUpdates(_0x442a63[_0x909d('0x47')],null))['then'](respondWithResult(_0x1aa101,null))[_0x909d('0x43')](handleError(_0x1aa101,null));};exports[_0x909d('0x23')]=function(_0x5009cb,_0x2b8c7a){return db[_0x909d('0x29')][_0x909d('0x45')]({'where':{'id':_0x5009cb[_0x909d('0x48')]['id']}})[_0x909d('0x22')](handleEntityNotFound(_0x2b8c7a,null))[_0x909d('0x22')](removeEntity(_0x2b8c7a,null))[_0x909d('0x43')](handleError(_0x2b8c7a,null));};exports[_0x909d('0x49')]=function(_0x465959,_0x4fbd23){return db['ChatTransferReport'][_0x909d('0x49')]()[_0x909d('0x22')](respondWithResult(_0x4fbd23,null))['catch'](handleError(_0x4fbd23,null));};
\ No newline at end of file
+var _0x9e61=['rows','catch','show','params','model','keys','rawAttributes','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include'];(function(_0x475b02,_0x344f93){var _0x2f75a7=function(_0x30842d){while(--_0x30842d){_0x475b02['push'](_0x475b02['shift']());}};_0x2f75a7(++_0x344f93);}(_0x9e61,0x149));var _0x19e6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9e61[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x19e6('0x0'));var rimraf=require(_0x19e6('0x1'));var zipdir=require(_0x19e6('0x2'));var jsonpatch=require(_0x19e6('0x3'));var rp=require(_0x19e6('0x4'));var moment=require(_0x19e6('0x5'));var BPromise=require(_0x19e6('0x6'));var Mustache=require('mustache');var util=require(_0x19e6('0x7'));var path=require(_0x19e6('0x8'));var sox=require(_0x19e6('0x9'));var csv=require('to-csv');var ejs=require(_0x19e6('0xa'));var fs=require('fs');var fs_extra=require(_0x19e6('0xb'));var _=require(_0x19e6('0xc'));var squel=require(_0x19e6('0xd'));var crypto=require(_0x19e6('0xe'));var jsforce=require(_0x19e6('0xf'));var deskjs=require(_0x19e6('0x10'));var toCsv=require(_0x19e6('0x11'));var querystring=require(_0x19e6('0x12'));var Papa=require(_0x19e6('0x13'));var Redis=require(_0x19e6('0x14'));var authService=require(_0x19e6('0x15'));var qs=require(_0x19e6('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x19e6('0x17'));var utils=require(_0x19e6('0x18'));var config=require(_0x19e6('0x19'));var licenseUtil=require(_0x19e6('0x1a'));var db=require(_0x19e6('0x1b'))['db'];function respondWithStatusCode(_0x14eb59,_0x1d9ed8){_0x1d9ed8=_0x1d9ed8||0xcc;return function(_0x5d0cad){if(_0x5d0cad){return _0x14eb59[_0x19e6('0x1c')](_0x1d9ed8);}return _0x14eb59['status'](_0x1d9ed8)[_0x19e6('0x1d')]();};}function respondWithResult(_0x20a3d6,_0x4ff093){_0x4ff093=_0x4ff093||0xc8;return function(_0x56dd21){if(_0x56dd21){return _0x20a3d6[_0x19e6('0x1e')](_0x4ff093)[_0x19e6('0x1f')](_0x56dd21);}};}function respondWithFilteredResult(_0x52b6b9,_0x3cd95a){return function(_0x3e2ff5){if(_0x3e2ff5){var _0x1d600d=typeof _0x3cd95a[_0x19e6('0x20')]===_0x19e6('0x21')&&typeof _0x3cd95a[_0x19e6('0x22')]===_0x19e6('0x21');var _0x3bd27b=_0x3e2ff5[_0x19e6('0x23')];var _0x4738a8=_0x1d600d?0x0:_0x3cd95a[_0x19e6('0x20')];var _0x3ee600=_0x1d600d?_0x3e2ff5[_0x19e6('0x23')]:_0x3cd95a[_0x19e6('0x20')]+_0x3cd95a[_0x19e6('0x22')];var _0x1cea59;if(_0x3ee600>=_0x3bd27b){_0x3ee600=_0x3bd27b;_0x1cea59=0xc8;}else{_0x1cea59=0xce;}_0x52b6b9[_0x19e6('0x1e')](_0x1cea59);return _0x52b6b9['set'](_0x19e6('0x24'),_0x4738a8+'-'+_0x3ee600+'/'+_0x3bd27b)[_0x19e6('0x1f')](_0x3e2ff5);}return null;};}function patchUpdates(_0x30124c){return function(_0x1c871f){try{jsonpatch[_0x19e6('0x25')](_0x1c871f,_0x30124c,!![]);}catch(_0x3c2cb7){return BPromise[_0x19e6('0x26')](_0x3c2cb7);}return _0x1c871f['save']();};}function saveUpdates(_0x707e16,_0x3f51df){return function(_0x11d4c1){if(_0x11d4c1){return _0x11d4c1[_0x19e6('0x27')](_0x707e16)[_0x19e6('0x28')](function(_0x56f323){return _0x56f323;});}return null;};}function removeEntity(_0x362176,_0x298f34){return function(_0x1bb9c7){if(_0x1bb9c7){return _0x1bb9c7['destroy']()[_0x19e6('0x28')](function(){_0x362176[_0x19e6('0x1e')](0xcc)[_0x19e6('0x1d')]();});}};}function handleEntityNotFound(_0x4a821d,_0x2d1b89){return function(_0x1288c0){if(!_0x1288c0){_0x4a821d[_0x19e6('0x1c')](0x194);}return _0x1288c0;};}function handleError(_0x4a80a0,_0x2cbaf0){_0x2cbaf0=_0x2cbaf0||0x1f4;return function(_0x4e018a){logger[_0x19e6('0x29')](_0x4e018a[_0x19e6('0x2a')]);if(_0x4e018a[_0x19e6('0x2b')]){delete _0x4e018a[_0x19e6('0x2b')];}_0x4a80a0['status'](_0x2cbaf0)[_0x19e6('0x2c')](_0x4e018a);};}exports[_0x19e6('0x2d')]=function(_0x46e5c7,_0x3ec307){var _0x4ea096={},_0x3ed057={},_0x20089b={'count':0x0,'rows':[]};var _0x48c18d=_[_0x19e6('0x2e')](db[_0x19e6('0x2f')]['rawAttributes'],function(_0x177d6c){return{'name':_0x177d6c[_0x19e6('0x30')],'type':_0x177d6c[_0x19e6('0x31')][_0x19e6('0x32')]};});_0x3ed057['model']=_['map'](_0x48c18d,_0x19e6('0x2b'));_0x3ed057[_0x19e6('0x33')]=_['keys'](_0x46e5c7[_0x19e6('0x33')]);_0x3ed057[_0x19e6('0x34')]=_[_0x19e6('0x35')](_0x3ed057['model'],_0x3ed057[_0x19e6('0x33')]);_0x4ea096[_0x19e6('0x36')]=_[_0x19e6('0x35')](_0x3ed057['model'],qs[_0x19e6('0x37')](_0x46e5c7[_0x19e6('0x33')][_0x19e6('0x37')]));_0x4ea096[_0x19e6('0x36')]=_0x4ea096[_0x19e6('0x36')]['length']?_0x4ea096[_0x19e6('0x36')]:_0x3ed057['model'];if(!_0x46e5c7[_0x19e6('0x33')][_0x19e6('0x38')]('nolimit')){_0x4ea096[_0x19e6('0x22')]=qs[_0x19e6('0x22')](_0x46e5c7['query'][_0x19e6('0x22')]);_0x4ea096['offset']=qs[_0x19e6('0x20')](_0x46e5c7[_0x19e6('0x33')][_0x19e6('0x20')]);}_0x4ea096[_0x19e6('0x39')]=qs[_0x19e6('0x3a')](_0x46e5c7[_0x19e6('0x33')][_0x19e6('0x3a')]);_0x4ea096['where']=qs[_0x19e6('0x34')](_[_0x19e6('0x3b')](_0x46e5c7[_0x19e6('0x33')],_0x3ed057['filters']),_0x48c18d);if(_0x46e5c7[_0x19e6('0x33')][_0x19e6('0x3c')]){_0x4ea096[_0x19e6('0x3d')]=_[_0x19e6('0x3e')](_0x4ea096[_0x19e6('0x3d')],{'$or':_[_0x19e6('0x2e')](_0x48c18d,function(_0xab7078){if(_0xab7078[_0x19e6('0x31')]!=='VIRTUAL'){var _0x3b59d0={};_0x3b59d0[_0xab7078[_0x19e6('0x2b')]]={'$like':'%'+_0x46e5c7['query']['filter']+'%'};return _0x3b59d0;}})});}_0x4ea096=_['merge']({},_0x4ea096,_0x46e5c7[_0x19e6('0x3f')]);var _0x10f2c5={'where':_0x4ea096[_0x19e6('0x3d')]};return db['ChatTransferReport'][_0x19e6('0x23')](_0x10f2c5)[_0x19e6('0x28')](function(_0xeb07d1){_0x20089b['count']=_0xeb07d1;if(_0x46e5c7[_0x19e6('0x33')][_0x19e6('0x40')]){_0x4ea096[_0x19e6('0x41')]=[{'all':!![]}];}return db[_0x19e6('0x2f')]['findAll'](_0x4ea096);})[_0x19e6('0x28')](function(_0x2eaa61){_0x20089b[_0x19e6('0x42')]=_0x2eaa61;return _0x20089b;})[_0x19e6('0x28')](respondWithFilteredResult(_0x3ec307,_0x4ea096))[_0x19e6('0x43')](handleError(_0x3ec307,null));};exports[_0x19e6('0x44')]=function(_0x55e048,_0x3de44a){var _0xacf0ca={'raw':!![],'where':{'id':_0x55e048[_0x19e6('0x45')]['id']}},_0x48a973={};_0x48a973[_0x19e6('0x46')]=_[_0x19e6('0x47')](db[_0x19e6('0x2f')][_0x19e6('0x48')]);_0x48a973['query']=_[_0x19e6('0x47')](_0x55e048[_0x19e6('0x33')]);_0x48a973[_0x19e6('0x34')]=_[_0x19e6('0x35')](_0x48a973[_0x19e6('0x46')],_0x48a973['query']);_0xacf0ca['attributes']=_[_0x19e6('0x35')](_0x48a973[_0x19e6('0x46')],qs['fields'](_0x55e048[_0x19e6('0x33')][_0x19e6('0x37')]));_0xacf0ca[_0x19e6('0x36')]=_0xacf0ca[_0x19e6('0x36')][_0x19e6('0x49')]?_0xacf0ca[_0x19e6('0x36')]:_0x48a973[_0x19e6('0x46')];if(_0x55e048[_0x19e6('0x33')]['includeAll']){_0xacf0ca['include']=[{'all':!![]}];}_0xacf0ca=_[_0x19e6('0x3e')]({},_0xacf0ca,_0x55e048[_0x19e6('0x3f')]);return db['ChatTransferReport'][_0x19e6('0x4a')](_0xacf0ca)['then'](handleEntityNotFound(_0x3de44a,null))[_0x19e6('0x28')](respondWithResult(_0x3de44a,null))[_0x19e6('0x43')](handleError(_0x3de44a,null));};exports[_0x19e6('0x4b')]=function(_0x4140fe,_0x1b447b){return db[_0x19e6('0x2f')][_0x19e6('0x4b')](_0x4140fe['body'],{})['then'](respondWithResult(_0x1b447b,0xc9))[_0x19e6('0x43')](handleError(_0x1b447b,null));};exports[_0x19e6('0x27')]=function(_0x185b45,_0x37931f){if(_0x185b45[_0x19e6('0x4c')]['id']){delete _0x185b45[_0x19e6('0x4c')]['id'];}return db[_0x19e6('0x2f')][_0x19e6('0x4a')]({'where':{'id':_0x185b45['params']['id']}})[_0x19e6('0x28')](handleEntityNotFound(_0x37931f,null))['then'](saveUpdates(_0x185b45[_0x19e6('0x4c')],null))[_0x19e6('0x28')](respondWithResult(_0x37931f,null))[_0x19e6('0x43')](handleError(_0x37931f,null));};exports[_0x19e6('0x4d')]=function(_0x2c2df8,_0x5d4ffe){return db[_0x19e6('0x2f')][_0x19e6('0x4a')]({'where':{'id':_0x2c2df8[_0x19e6('0x45')]['id']}})[_0x19e6('0x28')](handleEntityNotFound(_0x5d4ffe,null))[_0x19e6('0x28')](removeEntity(_0x5d4ffe,null))[_0x19e6('0x43')](handleError(_0x5d4ffe,null));};exports[_0x19e6('0x4e')]=function(_0x3dc4d2,_0x2efddf){return db[_0x19e6('0x2f')][_0x19e6('0x4e')]()[_0x19e6('0x28')](respondWithResult(_0x2efddf,null))[_0x19e6('0x43')](handleError(_0x2efddf,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 5045642..6ae7b46 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 _0xbbc4=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./chatTransferReport.attributes'];(function(_0x55c97d,_0x228ffc){var _0x1d5112=function(_0x2ab908){while(--_0x2ab908){_0x55c97d['push'](_0x55c97d['shift']());}};_0x1d5112(++_0x228ffc);}(_0xbbc4,0x1ba));var _0x4bbc=function(_0x56fad7,_0x69bcbd){_0x56fad7=_0x56fad7-0x0;var _0x21dad9=_0xbbc4[_0x56fad7];return _0x21dad9;};'use strict';var _=require(_0x4bbc('0x0'));var util=require(_0x4bbc('0x1'));var logger=require(_0x4bbc('0x2'))(_0x4bbc('0x3'));var moment=require(_0x4bbc('0x4'));var BPromise=require(_0x4bbc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4bbc('0x6'));var config=require('../../config/environment');var attributes=require(_0x4bbc('0x7'));module['exports']=function(_0xa2ea30,_0x41e035){return _0xa2ea30['define'](_0x4bbc('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x4bbc('0x9'),'fields':[_0x4bbc('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7420=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x1da811,_0x2e30db){var _0x53858b=function(_0x4e70ce){while(--_0x4e70ce){_0x1da811['push'](_0x1da811['shift']());}};_0x53858b(++_0x2e30db);}(_0x7420,0x16a));var _0x0742=function(_0x57802e,_0x103644){_0x57802e=_0x57802e-0x0;var _0x4fc542=_0x7420[_0x57802e];return _0x4fc542;};'use strict';var _=require(_0x0742('0x0'));var util=require('util');var logger=require(_0x0742('0x1'))(_0x0742('0x2'));var moment=require('moment');var BPromise=require(_0x0742('0x3'));var rp=require(_0x0742('0x4'));var fs=require('fs');var path=require(_0x0742('0x5'));var rimraf=require('rimraf');var config=require(_0x0742('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x0742('0x7')]=function(_0x1fa036,_0xf6503f){return _0x1fa036[_0x0742('0x8')](_0x0742('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x0742('0xa'),'fields':[_0x0742('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index be0c41a..dfddce6 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 _0x5d99=['../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x5d99,0x9a));var _0x95d9=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x5d99[_0x4b03c9];return _0x161ba2;};'use strict';var _=require(_0x95d9('0x0'));var util=require('util');var moment=require(_0x95d9('0x1'));var BPromise=require(_0x95d9('0x2'));var rs=require(_0x95d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x95d9('0x4'))(_0x95d9('0x5'));var config=require(_0x95d9('0x6'));var jayson=require(_0x95d9('0x7'));var client=jayson[_0x95d9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54c98a,_0x150407,_0x292a5b){return new BPromise(function(_0x51ee1a,_0x2ff389){return client['request'](_0x54c98a,_0x292a5b)[_0x95d9('0x9')](function(_0x472128){logger[_0x95d9('0xa')](_0x95d9('0xb'),_0x150407,_0x95d9('0xc'));logger['debug'](_0x95d9('0xd'),_0x150407,'request\x20sent',JSON[_0x95d9('0xe')](_0x472128));if(_0x472128[_0x95d9('0xf')]){if(_0x472128[_0x95d9('0xf')][_0x95d9('0x10')]===0x1f4){logger['error'](_0x95d9('0xb'),_0x150407,_0x472128[_0x95d9('0xf')][_0x95d9('0x11')]);return _0x2ff389(_0x472128[_0x95d9('0xf')][_0x95d9('0x11')]);}logger['error'](_0x95d9('0xb'),_0x150407,_0x472128['error']['message']);return _0x51ee1a(_0x472128[_0x95d9('0xf')][_0x95d9('0x11')]);}else{logger[_0x95d9('0xa')](_0x95d9('0xb'),_0x150407,_0x95d9('0xc'));_0x51ee1a(_0x472128[_0x95d9('0x12')]['message']);}})[_0x95d9('0x13')](function(_0x11f8d5){logger[_0x95d9('0xf')](_0x95d9('0xb'),_0x150407,_0x11f8d5);_0x2ff389(_0x11f8d5);});});}
\ No newline at end of file
+var _0x7a8d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x7a8d,0x165));var _0xd7a8=function(_0x368b27,_0x489fe5){_0x368b27=_0x368b27-0x0;var _0x77421c=_0x7a8d[_0x368b27];return _0x77421c;};'use strict';var _=require(_0xd7a8('0x0'));var util=require(_0xd7a8('0x1'));var moment=require(_0xd7a8('0x2'));var BPromise=require('bluebird');var rs=require(_0xd7a8('0x3'));var fs=require('fs');var Redis=require(_0xd7a8('0x4'));var db=require(_0xd7a8('0x5'))['db'];var utils=require(_0xd7a8('0x6'));var logger=require(_0xd7a8('0x7'))(_0xd7a8('0x8'));var config=require(_0xd7a8('0x9'));var jayson=require(_0xd7a8('0xa'));var client=jayson[_0xd7a8('0xb')][_0xd7a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a21c1,_0x1c9805,_0x298945){return new BPromise(function(_0x284f88,_0x550ec0){return client[_0xd7a8('0xd')](_0x4a21c1,_0x298945)[_0xd7a8('0xe')](function(_0x2c28b7){logger[_0xd7a8('0xf')](_0xd7a8('0x10'),_0x1c9805,_0xd7a8('0x11'));logger['debug'](_0xd7a8('0x12'),_0x1c9805,_0xd7a8('0x11'),JSON[_0xd7a8('0x13')](_0x2c28b7));if(_0x2c28b7[_0xd7a8('0x14')]){if(_0x2c28b7['error'][_0xd7a8('0x15')]===0x1f4){logger['error'](_0xd7a8('0x10'),_0x1c9805,_0x2c28b7[_0xd7a8('0x14')][_0xd7a8('0x16')]);return _0x550ec0(_0x2c28b7[_0xd7a8('0x14')]['message']);}logger[_0xd7a8('0x14')](_0xd7a8('0x10'),_0x1c9805,_0x2c28b7[_0xd7a8('0x14')][_0xd7a8('0x16')]);return _0x284f88(_0x2c28b7['error']['message']);}else{logger[_0xd7a8('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x1c9805,_0xd7a8('0x11'));_0x284f88(_0x2c28b7['result'][_0xd7a8('0x16')]);}})[_0xd7a8('0x17')](function(_0x10af9f){logger[_0xd7a8('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x1c9805,_0x10af9f);_0x550ec0(_0x10af9f);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index c80a0e0..ba7628c 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 _0xeedd=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','describe','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x41d0c6,_0x35a93e){var _0x50f407=function(_0x4cce17){while(--_0x4cce17){_0x41d0c6['push'](_0x41d0c6['shift']());}};_0x50f407(++_0x35a93e);}(_0xeedd,0x7d));var _0xdeed=function(_0x58b40b,_0x3c2dbf){_0x58b40b=_0x58b40b-0x0;var _0x5715e2=_0xeedd[_0x58b40b];return _0x5715e2;};'use strict';var multer=require(_0xdeed('0x0'));var util=require(_0xdeed('0x1'));var path=require(_0xdeed('0x2'));var timeout=require(_0xdeed('0x3'));var express=require(_0xdeed('0x4'));var router=express['Router']();var fs_extra=require(_0xdeed('0x5'));var auth=require(_0xdeed('0x6'));var interaction=require(_0xdeed('0x7'));var config=require(_0xdeed('0x8'));var controller=require(_0xdeed('0x9'));router[_0xdeed('0xa')]('/',auth[_0xdeed('0xb')](),controller['index']);router[_0xdeed('0xa')]('/describe',auth[_0xdeed('0xb')](),controller[_0xdeed('0xc')]);router['get'](_0xdeed('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdeed('0xe')](_0xdeed('0xd'),auth[_0xdeed('0xb')](),controller[_0xdeed('0xf')]);router[_0xdeed('0x10')](_0xdeed('0xd'),auth[_0xdeed('0xb')](),controller[_0xdeed('0x11')]);module[_0xdeed('0x12')]=router;
\ No newline at end of file
+var _0x5b57=['get','isAuthenticated','index','describe','/:id','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5b57,0x15d));var _0x75b5=function(_0x3f1500,_0x51abfc){_0x3f1500=_0x3f1500-0x0;var _0x472f31=_0x5b57[_0x3f1500];return _0x472f31;};'use strict';var multer=require(_0x75b5('0x0'));var util=require(_0x75b5('0x1'));var path=require(_0x75b5('0x2'));var timeout=require(_0x75b5('0x3'));var express=require(_0x75b5('0x4'));var router=express[_0x75b5('0x5')]();var fs_extra=require(_0x75b5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x75b5('0x7'));var controller=require('./chatTransferReport.controller');router[_0x75b5('0x8')]('/',auth[_0x75b5('0x9')](),controller[_0x75b5('0xa')]);router[_0x75b5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x75b5('0xb')]);router[_0x75b5('0x8')](_0x75b5('0xc'),auth[_0x75b5('0x9')](),controller['show']);router['post']('/',auth[_0x75b5('0x9')](),controller[_0x75b5('0xd')]);router[_0x75b5('0xe')](_0x75b5('0xc'),auth['isAuthenticated'](),controller[_0x75b5('0xf')]);router['delete'](_0x75b5('0xc'),auth[_0x75b5('0x9')](),controller[_0x75b5('0x10')]);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 d44d12f..d4af30f 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 _0x99e9=['System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x12bcf7,_0x20878d){var _0x516440=function(_0x26eff1){while(--_0x26eff1){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x516440(++_0x20878d);}(_0x99e9,0xb4));var _0x999e=function(_0x169e53,_0x46be55){_0x169e53=_0x169e53-0x0;var _0x252bb3=_0x99e9[_0x169e53];return _0x252bb3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x999e('0x0'));module[_0x999e('0x1')]={'name':{'type':Sequelize[_0x999e('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x999e('0x2')]},'mapKey':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x4')},'customerAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x999e('0x2')]},'animation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x999e('0x9')](_0x999e('0xa'),_0x999e('0xb')),'defaultValue':_0x999e('0xa')},'header_online':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xc')},'start_chat_button':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xf')},'download_transcript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x999e('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x13')},'noteTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x15')},'closingMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'skipMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'conditionAgreement':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x999e('0x18'),_0x999e('0x19')),'defaultValue':_0x999e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x999e('0x1c'),'helpText':''}},{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':_0x999e('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x999e('0x1d')](_0x999e('0x1e'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')]('onlineForm')):{};},'set':function(_0x2e1cc5){return this[_0x999e('0x20')](_0x999e('0x1e'),JSON[_0x999e('0x1a')](_0x2e1cc5));}},'offlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x999e('0x21')},'props':{'title':_0x999e('0x21'),'helpText':_0x999e('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x999e('0x23'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')](_0x999e('0x23'))):{};},'set':function(_0x15dca1){return this[_0x999e('0x20')](_0x999e('0x23'),JSON[_0x999e('0x1a')](_0x15dca1));}},'token':{'type':Sequelize[_0x999e('0x2')],'defaultValue':function(){return rs[_0x999e('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x999e('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x999e('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'sendUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x999e('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x999e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return _0x999e('0x27');}},'notificationSound':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x999e('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x28')},'systemAvatar':{'type':Sequelize[_0x999e('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x999e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'comment':_0x999e('0x29'),'set':function(_0x1e1229){if(!_0x1e1229)this[_0x999e('0x20')]('mandatoryDispositionPauseId',null);this[_0x999e('0x20')]('mandatoryDisposition',_0x1e1229);}},'vidaooEscalation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x999e('0x2')]},'vidaooTopic':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x2a')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x999e('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0x999e('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x22fb=['email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','TEXT','stringify','input','name','text','getDataValue','parse','setDataValue','textarea','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address'];(function(_0x31911a,_0x388623){var _0xc8d19=function(_0x388e02){while(--_0x388e02){_0x31911a['push'](_0x31911a['shift']());}};_0xc8d19(++_0x388623);}(_0x22fb,0x192));var _0xb22f=function(_0x52a195,_0x35dfbe){_0x52a195=_0x52a195-0x0;var _0x31a85c=_0x22fb[_0x52a195];return _0x31a85c;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb22f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'unique':_0xb22f('0x2')},'description':{'type':Sequelize[_0xb22f('0x1')]},'mapKey':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x3')},'key':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x4')},'customerAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb22f('0x1')]},'animation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xc')},'header_offline':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xd')},'download_transcript':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xf')},'noteTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x10')},'closingMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'skipMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x12')},'ratingType':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0x13'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'variable':null,'config':{'placeholder':_0xb22f('0x17'),'type':_0xb22f('0x18'),'required':!![]},'props':{'title':_0xb22f('0x17'),'helpText':''}},{'type':_0xb22f('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xb22f('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb22f('0x19')]('onlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')]('onlineForm')):{};},'set':function(_0x4687f2){return this[_0xb22f('0x1b')]('onlineForm',JSON[_0xb22f('0x15')](_0x4687f2));}},'offlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'props':{'title':_0xb22f('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb22f('0x3'),'type':_0xb22f('0x3')},'variable':null},{'type':_0xb22f('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb22f('0x19')]('offlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')](_0xb22f('0x1d'))):{};},'set':function(_0x413575){return this[_0xb22f('0x1b')]('offlineForm',JSON['stringify'](_0x413575));}},'token':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return rs[_0xb22f('0x1e')]();}},'autoclose':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb22f('0x1')]},'forwardOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x1f')},'waitingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x22')},'skipUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'sendUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return _0xb22f('0x23');}},'notificationSound':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb22f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x25')},'verticalAlignment':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x26')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xb22f('0x1')]},'customerAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb22f('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb22f('0x7')],'comment':_0xb22f('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb22f('0x29'),'set':function(_0x2d265c){if(!_0x2d265c)this[_0xb22f('0x1b')]('mandatoryDispositionPauseId',null);this[_0xb22f('0x1b')](_0xb22f('0x2a'),_0x2d265c);}},'vidaooEscalation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb22f('0x1')]},'vidaooTopic':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x2b')},'vidaooNote':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return _0xb22f('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index c65a8f5..798f267 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 _0x6691=['show','params','length','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','create','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','ChatApplication','List','applications','Applications','list','asc','account','ListId','contact','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','offline','send','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','openNewInteraction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','email','NotifyMailAccount','notifyMail','files','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','URL','address','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','textButtonColor','IntervalId','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','stack','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','url','defaults','redis','localhost','socket.io-emitter','register','html-to-text','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','end','json','undefined','count','offset','limit','status','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','name','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','ChatWebsite','includeAll','include','findAll','rows'];(function(_0x4e7f55,_0x3729f9){var _0xa2aee1=function(_0x1a66a2){while(--_0x1a66a2){_0x4e7f55['push'](_0x4e7f55['shift']());}};_0xa2aee1(++_0x3729f9);}(_0x6691,0xe7));var _0x1669=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6691[_0x1035c1];return _0x308d67;};'use strict';var BPromise=require(_0x1669('0x0'));var Mustache=require(_0x1669('0x1'));var util=require(_0x1669('0x2'));var path=require(_0x1669('0x3'));var ejs=require(_0x1669('0x4'));var fs=require('fs');var fs_extra=require(_0x1669('0x5'));var _=require(_0x1669('0x6'));var querystring=require(_0x1669('0x7'));var Redis=require(_0x1669('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x1669('0x9'))(_0x1669('0xa'));var config=require(_0x1669('0xb'));var url=require(_0x1669('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1669('0xd')](config[_0x1669('0xe')],{'host':_0x1669('0xf'),'port':0x18eb});var socket=require(_0x1669('0x10'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x1669('0x11')](socket);var htmlToText=require(_0x1669('0x12'));var jayson=require('jayson/promise');var client=jayson[_0x1669('0x13')][_0x1669('0x14')]({'port':0x232c});var client9002=jayson[_0x1669('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x1669('0x13')][_0x1669('0x14')]({'port':0x232b});var client9001=jayson[_0x1669('0x13')][_0x1669('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x2552a3,_0x5ebf12,_0x4ae9a7,_0x2100b7){return new BPromise(function(_0x4647db,_0x2d926e){var _0x3c352b=_0x2100b7||client;return _0x3c352b[_0x1669('0x15')](_0x2552a3,_0x4ae9a7)[_0x1669('0x16')](function(_0x5868be){logger['info'](_0x1669('0x17'),_0x5ebf12,_0x1669('0x18'));logger[_0x1669('0x19')](_0x1669('0x1a'),_0x5ebf12,'request\x20sent',JSON['stringify'](_0x5868be));if(_0x5868be[_0x1669('0x1b')]){if(_0x5868be[_0x1669('0x1b')][_0x1669('0x1c')]===0x1f4){logger[_0x1669('0x1b')](_0x1669('0x17'),_0x5ebf12,_0x5868be['error']['message']);return _0x2d926e(_0x5868be[_0x1669('0x1b')][_0x1669('0x1d')]);}logger[_0x1669('0x1b')](_0x1669('0x17'),_0x5ebf12,_0x5868be['error']['message']);return _0x4647db(_0x5868be[_0x1669('0x1b')]['message']);}else{logger['info'](_0x1669('0x17'),_0x5ebf12,_0x1669('0x18'));_0x4647db(_0x5868be['result'][_0x1669('0x1d')]);}})[_0x1669('0x1e')](function(_0x1345d8){logger['error'](_0x1669('0x17'),_0x5ebf12,_0x1345d8);_0x2d926e(_0x1345d8);});});}function respondWithStatusCode(_0x87b47b,_0x623948){_0x623948=_0x623948||0xcc;return function(_0x301dc7){if(_0x301dc7){return _0x87b47b['sendStatus'](_0x623948);}return _0x87b47b['status'](_0x623948)[_0x1669('0x1f')]();};}function respondWithResult(_0x43577b,_0x40612b){_0x40612b=_0x40612b||0xc8;return function(_0x321ccf){if(_0x321ccf){return _0x43577b['status'](_0x40612b)[_0x1669('0x20')](_0x321ccf);}};}function respondWithFilteredResult(_0x4401a2,_0x12470c){return function(_0x4a228e){if(_0x4a228e){var _0x3055aa=typeof _0x12470c['offset']===_0x1669('0x21')&&typeof _0x12470c['limit']==='undefined';var _0x1ab97b=_0x4a228e[_0x1669('0x22')];var _0x1f62ea=_0x3055aa?0x0:_0x12470c[_0x1669('0x23')];var _0x35c0ac=_0x3055aa?_0x4a228e[_0x1669('0x22')]:_0x12470c[_0x1669('0x23')]+_0x12470c[_0x1669('0x24')];var _0x57e754;if(_0x35c0ac>=_0x1ab97b){_0x35c0ac=_0x1ab97b;_0x57e754=0xc8;}else{_0x57e754=0xce;}_0x4401a2[_0x1669('0x25')](_0x57e754);return _0x4401a2[_0x1669('0x26')](_0x1669('0x27'),_0x1f62ea+'-'+_0x35c0ac+'/'+_0x1ab97b)[_0x1669('0x20')](_0x4a228e);}return null;};}function saveUpdates(_0x348c14){return function(_0x3b0437){if(_0x3b0437){return _0x3b0437[_0x1669('0x28')](_0x348c14)[_0x1669('0x16')](function(_0x15bebb){return _0x15bebb;});}return null;};}function removeEntity(_0x404d87){return function(_0x1af32e){if(_0x1af32e){return _0x1af32e['destroy']()[_0x1669('0x16')](function(){var _0x324fe9=_0x1af32e[_0x1669('0x29')]({'plain':!![]});var _0x1827e2=_0x1669('0x2a');return db[_0x1669('0x2b')][_0x1669('0x2c')]({'where':{'type':_0x1827e2,'resourceId':_0x324fe9['id']}})[_0x1669('0x16')](function(){return _0x1af32e;});})[_0x1669('0x16')](function(){_0x404d87[_0x1669('0x25')](0xcc)[_0x1669('0x1f')]();});}};}function handleEntityNotFound(_0x3938f1){return function(_0x182241){if(!_0x182241){_0x3938f1[_0x1669('0x2d')](0x194);}return _0x182241;};}function handleError(_0xa74528,_0x5c9be4){_0x5c9be4=_0x5c9be4||0x1f4;return function(_0x58c844){logger[_0x1669('0x1b')](_0x58c844['stack']);if(_0x58c844[_0x1669('0x2e')]){delete _0x58c844['name'];}_0xa74528[_0x1669('0x25')](_0x5c9be4)['send'](_0x58c844);};}exports['index']=function(_0x834182,_0x23bf51){var _0x6165df={'include':[{'model':db['Pause'],'as':_0x1669('0x2f')}]},_0x1fdd21={},_0x610175={'count':0x0,'rows':[]};var _0x22ab96=_[_0x1669('0x30')](db['ChatWebsite'][_0x1669('0x31')],function(_0x5925ff){return{'name':_0x5925ff['fieldName'],'type':_0x5925ff['type'][_0x1669('0x32')]};});_0x1fdd21[_0x1669('0x33')]=_[_0x1669('0x30')](_0x22ab96,_0x1669('0x2e'));_0x1fdd21[_0x1669('0x34')]=_[_0x1669('0x35')](_0x834182[_0x1669('0x34')]);_0x1fdd21['filters']=_[_0x1669('0x36')](_0x1fdd21[_0x1669('0x33')],_0x1fdd21[_0x1669('0x34')]);_0x6165df[_0x1669('0x37')]=_['intersection'](_0x1fdd21[_0x1669('0x33')],qs[_0x1669('0x38')](_0x834182[_0x1669('0x34')][_0x1669('0x38')]));_0x6165df[_0x1669('0x37')]=_0x6165df[_0x1669('0x37')]['length']?_0x6165df[_0x1669('0x37')]:_0x1fdd21[_0x1669('0x33')];if(!_0x834182[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x6165df[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x834182[_0x1669('0x34')][_0x1669('0x24')]);_0x6165df[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x834182[_0x1669('0x34')][_0x1669('0x23')]);}_0x6165df[_0x1669('0x3b')]=qs['sort'](_0x834182[_0x1669('0x34')][_0x1669('0x3c')]);_0x6165df[_0x1669('0x3d')]=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x834182[_0x1669('0x34')],_0x1fdd21['filters']),_0x22ab96);if(_0x834182['query'][_0x1669('0x40')]){_0x6165df[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x6165df[_0x1669('0x3d')],{'$or':_[_0x1669('0x30')](_0x22ab96,function(_0x5bb65a){if(_0x5bb65a[_0x1669('0x42')]!=='VIRTUAL'){var _0x5df323={};_0x5df323[_0x5bb65a[_0x1669('0x2e')]]={'$like':'%'+_0x834182[_0x1669('0x34')][_0x1669('0x40')]+'%'};return _0x5df323;}})});}_0x6165df=_[_0x1669('0x41')]({},_0x6165df,_0x834182['options']);var _0x174e2f={'where':_0x6165df['where']};return db[_0x1669('0x43')][_0x1669('0x22')](_0x174e2f)[_0x1669('0x16')](function(_0x19bdec){_0x610175[_0x1669('0x22')]=_0x19bdec;if(_0x834182[_0x1669('0x34')][_0x1669('0x44')]){_0x6165df[_0x1669('0x45')]=[{'all':!![]}];}return db[_0x1669('0x43')][_0x1669('0x46')](_0x6165df);})['then'](function(_0x1466a2){_0x610175[_0x1669('0x47')]=_0x1466a2;return _0x610175;})[_0x1669('0x16')](respondWithFilteredResult(_0x23bf51,_0x6165df))['catch'](handleError(_0x23bf51,null));};exports[_0x1669('0x48')]=function(_0x28a30d,_0x490ea2){var _0x19bf78={'raw':![],'where':{'id':_0x28a30d[_0x1669('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x1669('0x2f')}]},_0x115645={};_0x115645[_0x1669('0x33')]=_[_0x1669('0x35')](db['ChatWebsite']['rawAttributes']);_0x115645[_0x1669('0x34')]=_[_0x1669('0x35')](_0x28a30d[_0x1669('0x34')]);_0x115645[_0x1669('0x3e')]=_[_0x1669('0x36')](_0x115645[_0x1669('0x33')],_0x115645[_0x1669('0x34')]);_0x19bf78[_0x1669('0x37')]=_[_0x1669('0x36')](_0x115645[_0x1669('0x33')],qs[_0x1669('0x38')](_0x28a30d[_0x1669('0x34')][_0x1669('0x38')]));_0x19bf78[_0x1669('0x37')]=_0x19bf78[_0x1669('0x37')][_0x1669('0x4a')]?_0x19bf78[_0x1669('0x37')]:_0x115645[_0x1669('0x33')];if(_0x28a30d[_0x1669('0x34')][_0x1669('0x44')]){_0x19bf78[_0x1669('0x45')]=[{'all':!![]}];}_0x19bf78=_[_0x1669('0x41')]({},_0x19bf78,_0x28a30d[_0x1669('0x4b')]);return db[_0x1669('0x43')]['find'](_0x19bf78)[_0x1669('0x16')](handleEntityNotFound(_0x490ea2,null))['then'](respondWithResult(_0x490ea2,null))[_0x1669('0x1e')](handleError(_0x490ea2,null));};exports['create']=function(_0x5d527d,_0x575796){return db['ChatWebsite']['create'](_0x5d527d[_0x1669('0x4c')],{})[_0x1669('0x16')](function(_0x5b98c0){var _0x3d08f2=_0x5d527d['user'][_0x1669('0x29')]({'plain':!![]});if(!_0x3d08f2)throw new Error(_0x1669('0x4d'));if(_0x3d08f2[_0x1669('0x4e')]==='user'){var _0x2ecc38=_0x5b98c0[_0x1669('0x29')]({'plain':!![]});var _0x25695c=_0x1669('0x2a');return db[_0x1669('0x4f')][_0x1669('0x50')]({'where':{'name':_0x25695c,'userProfileId':_0x3d08f2['userProfileId']},'raw':!![]})[_0x1669('0x16')](function(_0x4964b0){if(_0x4964b0&&_0x4964b0[_0x1669('0x51')]===0x0){return db['UserProfileResource'][_0x1669('0x52')]({'name':_0x2ecc38[_0x1669('0x2e')],'resourceId':_0x2ecc38['id'],'type':_0x4964b0[_0x1669('0x2e')],'sectionId':_0x4964b0['id']},{})[_0x1669('0x16')](function(){return _0x5b98c0;});}else{return _0x5b98c0;}})['catch'](function(_0x3876cb){logger[_0x1669('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3876cb);throw _0x3876cb;});}return _0x5b98c0;})[_0x1669('0x16')](respondWithResult(_0x575796,0xc9))[_0x1669('0x1e')](handleError(_0x575796,null));};exports[_0x1669('0x28')]=function(_0x38cf1a,_0x2237ab){if(_0x38cf1a[_0x1669('0x4c')]['id']){delete _0x38cf1a[_0x1669('0x4c')]['id'];}return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x38cf1a[_0x1669('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x1669('0x2f')}]})[_0x1669('0x16')](handleEntityNotFound(_0x2237ab,null))[_0x1669('0x16')](saveUpdates(_0x38cf1a[_0x1669('0x4c')],null))['then'](respondWithResult(_0x2237ab,null))[_0x1669('0x1e')](handleError(_0x2237ab,null));};exports[_0x1669('0x2c')]=function(_0x3dfa73,_0x4a2eca){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x3dfa73[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4a2eca,null))[_0x1669('0x16')](removeEntity(_0x4a2eca,null))['catch'](handleError(_0x4a2eca,null));};exports[_0x1669('0x53')]=function(_0x2ab2f6,_0xa43a09){return db[_0x1669('0x43')]['describe']()['then'](respondWithResult(_0xa43a09,null))[_0x1669('0x1e')](handleError(_0xa43a09,null));};exports[_0x1669('0x54')]=function(_0x24fc6e,_0xea02bd){if(_0x24fc6e[_0x1669('0x4c')]['id']){delete _0x24fc6e[_0x1669('0x4c')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x24fc6e[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0xea02bd,null))[_0x1669('0x16')](function(_0x5037a8){if(_0x5037a8){_0x24fc6e[_0x1669('0x4c')][_0x1669('0x55')]=_0x5037a8['id'];return db[_0x1669('0x56')][_0x1669('0x52')](_0x24fc6e[_0x1669('0x4c')]);}})['then'](respondWithResult(_0xea02bd,null))[_0x1669('0x1e')](handleError(_0xea02bd,null));};exports[_0x1669('0x57')]=function(_0x3df7fd,_0x7d644){var _0x39f21b={'raw':![],'where':{}};var _0x6d0306={};var _0x272111={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1669('0x58')]({'where':{'id':_0x3df7fd['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x7d644,null))[_0x1669('0x16')](function(_0x4d566e){if(_0x4d566e){_0x6d0306[_0x1669('0x33')]=_['keys'](db[_0x1669('0x56')]['rawAttributes']);_0x6d0306[_0x1669('0x34')]=_['keys'](_0x3df7fd[_0x1669('0x34')]);_0x6d0306['filters']=_[_0x1669('0x36')](_0x6d0306['model'],_0x6d0306[_0x1669('0x34')]);_0x39f21b[_0x1669('0x37')]=_['intersection'](_0x6d0306[_0x1669('0x33')],qs[_0x1669('0x38')](_0x3df7fd[_0x1669('0x34')][_0x1669('0x38')]));_0x39f21b[_0x1669('0x37')]=_0x39f21b[_0x1669('0x37')]['length']?_0x39f21b[_0x1669('0x37')]:_0x6d0306['model'];if(!_0x3df7fd[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x39f21b[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x3df7fd[_0x1669('0x34')][_0x1669('0x24')]);_0x39f21b[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x3df7fd['query'][_0x1669('0x23')]);}_0x39f21b[_0x1669('0x3b')]=qs['sort'](_0x3df7fd[_0x1669('0x34')]['sort']);_0x39f21b['where']=qs[_0x1669('0x3e')](_['pick'](_0x3df7fd[_0x1669('0x34')],_0x6d0306[_0x1669('0x3e')]));_0x39f21b[_0x1669('0x3d')][_0x1669('0x55')]=_0x4d566e['id'];if(_0x3df7fd['query'][_0x1669('0x40')]){_0x39f21b[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x39f21b[_0x1669('0x3d')],{'$or':_['map'](_0x39f21b[_0x1669('0x37')],function(_0x3ca4ab){var _0x3d1dbf={};_0x3d1dbf[_0x3ca4ab]={'$like':'%'+_0x3df7fd[_0x1669('0x34')][_0x1669('0x40')]+'%'};return _0x3d1dbf;})});}_0x39f21b=_[_0x1669('0x41')]({},_0x39f21b,_0x3df7fd[_0x1669('0x4b')]);return db['Disposition'][_0x1669('0x22')]({'where':_0x39f21b[_0x1669('0x3d')]})['then'](function(_0x5db23d){_0x272111[_0x1669('0x22')]=_0x5db23d;if(_0x3df7fd[_0x1669('0x34')][_0x1669('0x44')]){_0x39f21b[_0x1669('0x45')]=[{'all':!![]}];}return db[_0x1669('0x56')][_0x1669('0x46')](_0x39f21b);})[_0x1669('0x16')](function(_0x533e59){_0x272111['rows']=_0x533e59;return _0x272111;});}})[_0x1669('0x16')](respondWithFilteredResult(_0x7d644,_0x39f21b))[_0x1669('0x1e')](handleError(_0x7d644,null));};exports[_0x1669('0x59')]=function(_0x56f211,_0x70a9ca){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x56f211[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x70a9ca,null))[_0x1669('0x16')](function(_0x1bebe1){if(_0x1bebe1){return _0x1bebe1['removeDispositions'](_0x56f211[_0x1669('0x34')][_0x1669('0x5a')]);}})[_0x1669('0x16')](respondWithStatusCode(_0x70a9ca,null))['catch'](handleError(_0x70a9ca,null));};exports['addAnswer']=function(_0x34d4ec,_0x1158d6){if(_0x34d4ec[_0x1669('0x4c')]['id']){delete _0x34d4ec[_0x1669('0x4c')]['id'];}return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x34d4ec[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x1158d6,null))[_0x1669('0x16')](function(_0x35597e){if(_0x35597e){_0x34d4ec[_0x1669('0x4c')][_0x1669('0x55')]=_0x35597e['id'];return db[_0x1669('0x5b')]['create'](_0x34d4ec[_0x1669('0x4c')]);}})[_0x1669('0x16')](respondWithResult(_0x1158d6,null))['catch'](handleError(_0x1158d6,null));};exports[_0x1669('0x5c')]=function(_0x418eed,_0x5b82bc){var _0x2b538c={'raw':![],'where':{}};var _0xe35d38={};var _0x4137fb={'count':0x0,'rows':[]};return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x418eed[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b82bc,null))['then'](function(_0x3704f4){if(_0x3704f4){_0xe35d38[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0x5b')][_0x1669('0x31')]);_0xe35d38['query']=_['keys'](_0x418eed['query']);_0xe35d38['filters']=_['intersection'](_0xe35d38['model'],_0xe35d38[_0x1669('0x34')]);_0x2b538c[_0x1669('0x37')]=_['intersection'](_0xe35d38[_0x1669('0x33')],qs[_0x1669('0x38')](_0x418eed[_0x1669('0x34')][_0x1669('0x38')]));_0x2b538c[_0x1669('0x37')]=_0x2b538c['attributes'][_0x1669('0x4a')]?_0x2b538c[_0x1669('0x37')]:_0xe35d38['model'];if(!_0x418eed[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x2b538c[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x418eed[_0x1669('0x34')]['limit']);_0x2b538c[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x418eed[_0x1669('0x34')][_0x1669('0x23')]);}_0x2b538c['order']=qs['sort'](_0x418eed[_0x1669('0x34')][_0x1669('0x3c')]);_0x2b538c['where']=qs['filters'](_[_0x1669('0x3f')](_0x418eed['query'],_0xe35d38[_0x1669('0x3e')]));_0x2b538c[_0x1669('0x3d')][_0x1669('0x55')]=_0x3704f4['id'];if(_0x418eed['query'][_0x1669('0x40')]){_0x2b538c[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x2b538c[_0x1669('0x3d')],{'$or':_['map'](_0x2b538c['attributes'],function(_0xe9b1b){var _0x32c53a={};_0x32c53a[_0xe9b1b]={'$like':'%'+_0x418eed['query'][_0x1669('0x40')]+'%'};return _0x32c53a;})});}_0x2b538c=_[_0x1669('0x41')]({},_0x2b538c,_0x418eed[_0x1669('0x4b')]);return db['CannedAnswer']['count']({'where':_0x2b538c[_0x1669('0x3d')]})[_0x1669('0x16')](function(_0x2e88e8){_0x4137fb[_0x1669('0x22')]=_0x2e88e8;if(_0x418eed[_0x1669('0x34')][_0x1669('0x44')]){_0x2b538c[_0x1669('0x45')]=[{'all':!![]}];}return db[_0x1669('0x5b')][_0x1669('0x46')](_0x2b538c);})[_0x1669('0x16')](function(_0xab854b){_0x4137fb[_0x1669('0x47')]=_0xab854b;return _0x4137fb;});}})['then'](respondWithFilteredResult(_0x5b82bc,_0x2b538c))['catch'](handleError(_0x5b82bc,null));};exports[_0x1669('0x5d')]=function(_0x52ec4b,_0x508b94){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x52ec4b[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x508b94,null))[_0x1669('0x16')](function(_0x1b4941){if(_0x1b4941){return _0x1b4941[_0x1669('0x5d')](_0x52ec4b[_0x1669('0x34')][_0x1669('0x5a')]);}})[_0x1669('0x16')](respondWithStatusCode(_0x508b94,null))[_0x1669('0x1e')](handleError(_0x508b94,null));};exports[_0x1669('0x5e')]=function(_0x247939,_0x4d461d){_0x247939['body'][_0x1669('0x5f')]=_0x247939[_0x1669('0x60')][_0x1669('0x61')];return db['ChatWebsite'][_0x1669('0x50')]({'where':{'id':_0x247939[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4d461d,null))['then'](saveUpdates(_0x247939['body'],null))['then'](respondWithResult(_0x4d461d,null))[_0x1669('0x1e')](handleError(_0x4d461d,null));};exports['addAvatar']=function(_0x1f2f4d,_0x4877aa){_0x1f2f4d['body'][_0x1669('0x62')]=_0x1f2f4d[_0x1669('0x60')][_0x1669('0x61')];return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x1f2f4d[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4877aa,null))['then'](saveUpdates(_0x1f2f4d[_0x1669('0x4c')],null))[_0x1669('0x16')](respondWithResult(_0x4877aa,null))[_0x1669('0x1e')](handleError(_0x4877aa,null));};exports[_0x1669('0x63')]=function(_0x563429,_0x25ef1a){_0x563429[_0x1669('0x4c')][_0x1669('0x64')]=_0x563429[_0x1669('0x60')]['filename'];return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x563429['params']['id']}})['then'](handleEntityNotFound(_0x25ef1a,null))[_0x1669('0x16')](saveUpdates(_0x563429[_0x1669('0x4c')],null))['then'](respondWithResult(_0x25ef1a,null))['catch'](handleError(_0x25ef1a,null));};exports[_0x1669('0x65')]=function(_0x35b279,_0xd90e09){_0x35b279['body'][_0x1669('0x66')]=_0x35b279[_0x1669('0x60')][_0x1669('0x61')];return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x35b279['params']['id']}})['then'](handleEntityNotFound(_0xd90e09,null))[_0x1669('0x16')](saveUpdates(_0x35b279['body'],null))[_0x1669('0x16')](respondWithResult(_0xd90e09,null))[_0x1669('0x1e')](handleError(_0xd90e09,null));};exports[_0x1669('0x67')]=function(_0x5862eb,_0x276b78){var _0x4353c2=path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0x6a'));var _0x2cab47={'where':{'id':_0x5862eb[_0x1669('0x49')]['id']},'attributes':['id',_0x1669('0x5f')],'raw':!![]};var _0x3679d0=![];return require(_0x1669('0x6b'))[_0x1669('0x6c')]()['then'](function(_0xcf579f){if(_0xcf579f){_0x3679d0=_0xcf579f[_0x1669('0x6d')];}})[_0x1669('0x16')](function(){return db['ChatWebsite'][_0x1669('0x50')](_0x2cab47);})[_0x1669('0x16')](handleEntityNotFound(_0x276b78,null))['then'](function(_0x49c2fe){if(_0x49c2fe){if(!_[_0x1669('0x6e')](_0x49c2fe[_0x1669('0x5f')])){if(fs[_0x1669('0x6f')](path[_0x1669('0x68')](config['root'],_0x1669('0x70'),_0x49c2fe[_0x1669('0x5f')]))&&_0x3679d0){_0x4353c2=path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0x70'),_0x49c2fe['sitepic']);}}return _0x276b78[_0x1669('0x71')](_0x4353c2);}})['catch'](handleError(_0x276b78,null));};exports[_0x1669('0x72')]=function(_0x344b11,_0x460d0e){var _0x2808ac=path[_0x1669('0x68')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x438abe={'where':{'id':_0x344b11['params']['id']},'attributes':['id',_0x1669('0x62')],'raw':!![]};return db[_0x1669('0x43')][_0x1669('0x50')](_0x438abe)[_0x1669('0x16')](handleEntityNotFound(_0x460d0e,null))[_0x1669('0x16')](function(_0x8c0af8){if(_0x8c0af8){if(!_[_0x1669('0x6e')](_0x8c0af8[_0x1669('0x62')])){if(fs[_0x1669('0x6f')](path['join'](config[_0x1669('0x69')],'server/files/images/avatars/',_0x8c0af8[_0x1669('0x62')]))){_0x2808ac=path[_0x1669('0x68')](config['root'],_0x1669('0x73'),_0x8c0af8['agentAvatar']);}}return _0x460d0e[_0x1669('0x71')](_0x2808ac);}})[_0x1669('0x1e')](handleError(_0x460d0e,null));};exports[_0x1669('0x74')]=function(_0x461af2,_0x337325){var _0x3b7dce=path['join'](config[_0x1669('0x69')],_0x1669('0x75'));var _0x29b2b7={'where':{'id':_0x461af2[_0x1669('0x49')]['id']},'attributes':['id',_0x1669('0x64'),_0x1669('0x76')],'raw':!![]};return db['ChatWebsite'][_0x1669('0x50')](_0x29b2b7)[_0x1669('0x16')](handleEntityNotFound(_0x337325,null))[_0x1669('0x16')](function(_0x55778a){if(_0x55778a){if(!_[_0x1669('0x6e')](_0x55778a[_0x1669('0x64')])){if(fs['existsSync'](path[_0x1669('0x68')](config['root'],_0x1669('0x73'),_0x55778a[_0x1669('0x64')]))&&_0x55778a[_0x1669('0x76')]){_0x3b7dce=path['join'](config['root'],_0x1669('0x73'),_0x55778a[_0x1669('0x64')]);}}return _0x337325[_0x1669('0x71')](_0x3b7dce);}})[_0x1669('0x1e')](handleError(_0x337325,null));};exports['getSystemAvatar']=function(_0x54c7d0,_0x4c379a){var _0x1259d0=path['join'](config[_0x1669('0x69')],_0x1669('0x77'));var _0x5ba281={'where':{'id':_0x54c7d0['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x1669('0x43')][_0x1669('0x50')](_0x5ba281)[_0x1669('0x16')](handleEntityNotFound(_0x4c379a,null))[_0x1669('0x16')](function(_0x1ab6fd){if(_0x1ab6fd){if(!_[_0x1669('0x6e')](_0x1ab6fd[_0x1669('0x66')])){if(fs[_0x1669('0x6f')](path['join'](config[_0x1669('0x69')],_0x1669('0x73'),_0x1ab6fd[_0x1669('0x66')]))){_0x1259d0=path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0x73'),_0x1ab6fd[_0x1669('0x66')]);}}return _0x4c379a[_0x1669('0x71')](_0x1259d0);}})['catch'](handleError(_0x4c379a,null));};exports[_0x1669('0x78')]=function(_0x288269,_0xe08359){var _0x71746a=require(_0x1669('0x79'));var _0x5f3181=new _0x71746a();var _0x2202a3=_0x5f3181[_0x1669('0x7a')](_0x288269['headers'][_0x1669('0x7b')])[_0x1669('0x7c')]();var _0x5a24d3={'body':_0x288269['body'],'channel':_0x1669('0x7d')};var _0x285875=[];var _0x18fd61=[];var _0x1c34af={};var _0x24eb12=![];return db[_0x1669('0x7e')][_0x1669('0x53')]()[_0x1669('0x16')](function(_0x774a7e){if(!_0x774a7e){throw new db['Sequelize'][(_0x1669('0x7f'))](_0x1669('0x80'));}_0x285875=_[_0x1669('0x81')](_['keys'](_0x774a7e),[_0x1669('0x82'),_0x1669('0x83')]);_0x18fd61=_[_0x1669('0x81')](_[_0x1669('0x35')](_0x774a7e),['createdAt',_0x1669('0x83'),_0x1669('0x84'),'ListId']);if(_0x288269['body']['id']){delete _0x288269[_0x1669('0x4c')]['id'];}if(_['isNil'](_0x288269[_0x1669('0x4c')][_0x1669('0x85')])){throw new db[(_0x1669('0x86'))][(_0x1669('0x7f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x288269['body'][_0x1669('0x4c')])||_0x288269['body']['body']===''){throw new db[(_0x1669('0x86'))][(_0x1669('0x7f'))](_0x1669('0x87'));}if(_[_0x1669('0x6e')](_0x288269[_0x1669('0x4c')][_0x1669('0x88')])){throw new db[(_0x1669('0x86'))][(_0x1669('0x7f'))](_0x1669('0x89')+_0x18fd61);}if(!_[_0x1669('0x8a')](_0x18fd61,_0x288269['body'][_0x1669('0x88')])){throw new db[(_0x1669('0x86'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18fd61);}_0x1c34af[_0x288269[_0x1669('0x4c')][_0x1669('0x88')]]=_0x288269[_0x1669('0x4c')][_0x1669('0x85')];})[_0x1669('0x16')](function(){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x288269[_0x1669('0x49')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1669('0x7e')],'as':_0x1669('0x8b'),'where':_0x1c34af,'limit':0x1,'order':[['updatedAt',_0x1669('0x8c')]]}]},{'model':db[_0x1669('0x8d')],'as':'Applications'}]});})[_0x1669('0x16')](handleEntityNotFound(_0xe08359,null))['then'](function(_0x81f3f2){if(_0x81f3f2&&_0x81f3f2[_0x1669('0x8e')]){_0x5a24d3['account']=_0x81f3f2;_0x5a24d3[_0x1669('0x8f')]=_0x81f3f2[_0x1669('0x90')];_0x5a24d3[_0x1669('0x91')]=_0x81f3f2['List'];_0x5a24d3[_0x1669('0x8f')]=_['orderBy'](_0x5a24d3[_0x1669('0x8f')],['priority'],[_0x1669('0x92')]);if(_0x5a24d3['account'][_0x1669('0x90')]){delete _0x5a24d3[_0x1669('0x93')][_0x1669('0x90')];}if(_0x5a24d3[_0x1669('0x93')]['List']&&_0x5a24d3[_0x1669('0x93')][_0x1669('0x8e')][_0x1669('0x8b')][_0x1669('0x4a')]){return _0x5a24d3['account'][_0x1669('0x8e')][_0x1669('0x8b')][0x0];}var _0x554124=_[_0x1669('0xd')](_0x288269[_0x1669('0x4c')],{'firstName':_0x288269[_0x1669('0x4c')]['from'],'ListId':_0x81f3f2[_0x1669('0x94')]});_0x554124[_0x288269[_0x1669('0x4c')][_0x1669('0x88')]]=_0x288269[_0x1669('0x4c')][_0x1669('0x85')];return db[_0x1669('0x7e')][_0x1669('0x52')](_0x554124,{'fields':_0x285875,'raw':!![]});}})[_0x1669('0x16')](handleEntityNotFound(_0xe08359,null))[_0x1669('0x16')](function(_0x2ca56e){_0x5a24d3[_0x1669('0x95')]=_0x2ca56e;var _0x51cc77=_0x288269['body'][_0x1669('0x96')];if(_0x288269[_0x1669('0x97')][_0x1669('0x98')]){_0x51cc77=_0x288269['headers'][_0x1669('0x98')];}else if(_0x288269['headers']['x-forwarded-for']){_0x51cc77=_[_0x1669('0x99')](_0x288269['headers'][_0x1669('0x9a')][_0x1669('0x9b')](','));}if(_0x2ca56e){var _0xfc8aaa={'ContactId':_0x2ca56e['id'],'ChatWebsiteId':_0x288269[_0x1669('0x49')]['id'],'from':(_0x2ca56e[_0x1669('0x9c')]||'')+'\x20'+(_0x2ca56e['lastName']||''),'customerIp':_0x51cc77,'customerPort':_0x288269[_0x1669('0x97')][_0x1669('0x9d')]?_0x288269[_0x1669('0x97')][_0x1669('0x9d')]:null,'referer':_0x288269[_0x1669('0x4c')][_0x1669('0x9e')],'browserName':_0x2202a3[_0x1669('0x9f')][_0x1669('0x2e')]&&_0x2202a3[_0x1669('0x9f')]['version']?util[_0x1669('0xa0')]('%s\x20%s',_0x2202a3[_0x1669('0x9f')]['name'],_0x2202a3[_0x1669('0x9f')][_0x1669('0xa1')]):'unknown','browserVersion':_0x2202a3[_0x1669('0x9f')]['version']||_0x1669('0xa2'),'osName':util[_0x1669('0xa0')](_0x1669('0xa3'),_0x2202a3['os'][_0x1669('0x2e')],_0x2202a3['os']['version']),'osVersion':_0x2202a3['os'][_0x1669('0xa1')],'deviceModel':_0x2202a3[_0x1669('0xa4')][_0x1669('0x33')]&&_0x2202a3[_0x1669('0xa4')][_0x1669('0xa5')]?util[_0x1669('0xa0')](_0x1669('0xa6'),_0x2202a3['device'][_0x1669('0x33')],_0x2202a3['device'][_0x1669('0xa5')],_0x2202a3[_0x1669('0xa4')][_0x1669('0x42')]):null,'deviceVendor':_0x2202a3[_0x1669('0xa4')][_0x1669('0xa5')],'deviceType':_0x2202a3['device']['type'],'formData':JSON[_0x1669('0xa7')](_0x288269['body'])};var _0x3b7010={'ChatWebsiteId':_0x288269[_0x1669('0x49')]['id'],'closed':![]};if(_0x288269[_0x1669('0x4c')][_0x1669('0xa8')]){_0x3b7010['threadId']=_0x288269[_0x1669('0x4c')]['threadId'];return db[_0x1669('0xa9')][_0x1669('0x50')]({'where':_0x3b7010})[_0x1669('0x16')](function(_0x4e68e2){if(_0x4e68e2){return[_0x4e68e2,![]];}_0xfc8aaa[_0x1669('0xa8')]=_0x288269[_0x1669('0x4c')]['threadId'];_0xfc8aaa['externalUrl']=_0x288269[_0x1669('0x4c')][_0x1669('0xaa')];return db[_0x1669('0xa9')][_0x1669('0x52')](_0xfc8aaa)[_0x1669('0x16')](function(_0x2c2237){return[_0x2c2237,!![]];});});}_0x3b7010[_0x1669('0xab')]=_0x2ca56e['id'];if(_0x288269['body'][_0x1669('0xac')]&&_0x288269[_0x1669('0x4c')]['interaction']['id']){_0x3b7010['id']=_0x288269[_0x1669('0x4c')]['interaction']['id'];return db['ChatInteraction'][_0x1669('0x50')]({'where':_0x3b7010})[_0x1669('0x16')](function(_0x212c10){if(_0x212c10){return[_0x212c10,![]];}return db['ChatInteraction'][_0x1669('0x52')](_0xfc8aaa)[_0x1669('0x16')](function(_0x9c0df9){return[_0x9c0df9,!![]];});});}return db[_0x1669('0xa9')]['create'](_0xfc8aaa)[_0x1669('0x16')](function(_0x1981ca){return[_0x1981ca,!![]];});}})[_0x1669('0xad')](function(_0x504c18,_0x4f87d4){if(_0x504c18){_0x24eb12=_0x4f87d4;if(!_0x4f87d4){var _0x481499={'from':(_0x5a24d3[_0x1669('0x95')][_0x1669('0x9c')]||'')+'\x20'+(_0x5a24d3['contact'][_0x1669('0xae')]||'')};if(_0x288269['body'][_0x1669('0xa8')]&&_0x288269[_0x1669('0x4c')]['messageId']&&_0x288269[_0x1669('0x4c')][_0x1669('0xa8')]!=_0x288269[_0x1669('0x4c')]['messageId']){_0x481499[_0x1669('0xa8')]=_0x288269[_0x1669('0x4c')][_0x1669('0xaf')];}return _0x504c18[_0x1669('0x28')](_0x481499);}else{return _0x504c18;}}})[_0x1669('0x16')](function(_0x2ae80f){_0x5a24d3[_0x1669('0xac')]=_0x2ae80f['get']({'plain':!![]});_0x5a24d3[_0x1669('0xac')][_0x1669('0xb0')]=_0x24eb12;if(_0x5a24d3[_0x1669('0xac')][_0x1669('0xb0')]){if(_0x5a24d3[_0x1669('0x93')][_0x1669('0xb1')]){_0x5a24d3['applications'][_0x1669('0xb2')]({'id':0x0,'priority':_0x5a24d3['applications'][_0x1669('0x4a')]+0x1,'app':_0x1669('0xb3'),'appdata':_0x1669('0xb4'),'interval':_0x1669('0xb5')});}}return db[_0x1669('0xb6')]['create']({'body':_0x288269['body']['body'],'ChatWebsiteId':_0x288269['params']['id'],'ChatInteractionId':_0x2ae80f['id'],'direction':'in','ContactId':_0x5a24d3[_0x1669('0x95')]['id'],'AttachmentId':_0x288269['body'][_0x1669('0xb7')]});})['then'](function(_0x40eea8){_0x5a24d3['message']=_0x40eea8;if(_0x5a24d3[_0x1669('0xac')]['UserId']){return db[_0x1669('0xb8')]['find']({'attributes':['id',_0x1669('0x2e')],'where':{'id':_0x5a24d3[_0x1669('0xac')][_0x1669('0xb9')]}})[_0x1669('0x16')](function(_0x33a8af){if(_0x33a8af){_0x5a24d3['applications'][_0x1669('0xba')]({'id':0x0,'priority':0x0,'app':_0x1669('0xbb'),'appdata':_0x33a8af['name']+','+(_0x5a24d3[_0x1669('0x93')][_0x1669('0xbc')]||0xa),'interval':_0x1669('0xb5')});_0x5a24d3[_0x1669('0xbd')]=!![];}return respondWithRpcPromise(_0x1669('0xbe'),'startRouting',_0x5a24d3);});}return respondWithRpcPromise(_0x1669('0xbe'),_0x1669('0xbf'),_0x5a24d3);})['then'](function(_0x3798a2){respondWithRpcPromise('EventManager','EventManager',{'event':_0x1669('0x78'),'message':_0x3798a2},client9002);return _0x3798a2;})[_0x1669('0x16')](respondWithResult(_0xe08359,null))[_0x1669('0x1e')](handleError(_0xe08359,null));};exports[_0x1669('0xc0')]=function(_0x21a63c,_0x4858d9){var _0x17a18f,_0x476300,_0x214bdd;var _0x1f54aa=[];var _0x5c6898={};var _0x1cd11a=_0x21a63c['files']||[];var _0x237dbb=[];var _0x18be40;return db[_0x1669('0x7e')]['describe']()[_0x1669('0x16')](function(_0x3efed6){if(!_0x3efed6){throw new db['Sequelize'][(_0x1669('0x7f'))]('no\x20available\x20attributes');}_0x1f54aa=_['difference'](_[_0x1669('0x35')](_0x3efed6),['createdAt',_0x1669('0x83'),'CompanyId',_0x1669('0x94')]);if(_0x21a63c[_0x1669('0x4c')]['id']){delete _0x21a63c[_0x1669('0x4c')]['id'];}if(_[_0x1669('0x6e')](_0x21a63c[_0x1669('0x4c')][_0x1669('0x85')])){throw _0x4858d9[_0x1669('0x25')](0x1f4)[_0x1669('0xc1')](new db[(_0x1669('0x86'))][(_0x1669('0x7f'))](_0x1669('0xc2')));}if(_['isNil'](_0x21a63c['body'][_0x1669('0x4c')])||_0x21a63c[_0x1669('0x4c')][_0x1669('0x4c')]===''){throw _0x4858d9[_0x1669('0x25')](0x1f4)[_0x1669('0xc1')](new db['Sequelize'][(_0x1669('0x7f'))](_0x1669('0x87')));}if(_[_0x1669('0x6e')](_0x21a63c[_0x1669('0x4c')]['mapKeyOffline'])){throw _0x4858d9['status'](0x1f4)[_0x1669('0xc1')](new db[(_0x1669('0x86'))]['ValidationError'](_0x1669('0xc3')+_0x1f54aa));}if(!_['includes'](_0x1f54aa,_0x21a63c[_0x1669('0x4c')][_0x1669('0xc4')])){throw _0x4858d9[_0x1669('0x25')](0x1f4)[_0x1669('0xc1')](new db['Sequelize'][(_0x1669('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f54aa));}_0x5c6898[_0x21a63c[_0x1669('0x4c')][_0x1669('0xc4')]]=_0x21a63c[_0x1669('0x4c')][_0x1669('0x85')];})[_0x1669('0x16')](function(){return db[_0x1669('0x43')]['find']({'where':{'id':_0x21a63c[_0x1669('0x49')]['id']},'include':[{'model':db[_0x1669('0xc5')],'as':'List'},{'model':db['MailAccount'],'as':_0x1669('0xc6')}]});})[_0x1669('0x16')](handleEntityNotFound(_0x4858d9,null))[_0x1669('0x16')](function(_0x47ff50){if(_0x47ff50&&_0x47ff50['List']){_0x476300=_0x47ff50;var _0xdcc339=_[_0x1669('0xd')](_0x21a63c[_0x1669('0x4c')],{'firstName':_0x21a63c['body']['from'],'phone':_0x21a63c[_0x1669('0x4c')][_0x1669('0x85')],'ListId':_0x47ff50[_0x1669('0x94')]});_0xdcc339[_0x21a63c[_0x1669('0x4c')][_0x1669('0xc4')]]=_0x21a63c['body'][_0x1669('0x85')];return db[_0x1669('0x7e')][_0x1669('0xc7')]({'where':_0x5c6898,'defaults':_0xdcc339});}})['spread'](function(_0x38c602){if(_0x38c602){_0x214bdd=_0x38c602;var _0x164e85=fs[_0x1669('0xc8')](path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0xc9')),_0x1669('0xca'));var _0x3c8975=ejs[_0x1669('0xcb')](_0x164e85,{'body':_[_0x1669('0xcc')](_0x21a63c[_0x1669('0x4c')][_0x1669('0x4c')]),'bodyTitle':_0x476300[_0x1669('0xcd')]});return db[_0x1669('0xce')][_0x1669('0x52')]({'body':_0x3c8975,'plainBody':htmlToText[_0x1669('0xcf')](_0x3c8975),'ContactId':_0x38c602['id'],'ChatWebsiteId':_0x476300['id']});}})['then'](function(_0x3cae4f){_0x18be40=_0x3cae4f;if(_0x1cd11a['length']){var _0xe147a4=_0x1cd11a[_0x1669('0x30')](function(_0x1cf9be){return{'name':_0x1cf9be[_0x1669('0xd0')],'basename':_0x1cf9be[_0x1669('0x61')],'type':_0x1cf9be['mimetype'],'ChatOfflineMessageId':_0x3cae4f['id']};});_0x237dbb=_0xe147a4[_0x1669('0x30')](_0x1f28cc=>{var _0x29e4c8={'filename':_0x1f28cc['name'],'path':path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0xd1'),'files','attachments','offline-chat',_0x1f28cc['basename'])};return _0x29e4c8;});if(!_0x476300[_0x1669('0xd2')]){return db['sequelize']['transaction'](function(_0x318c09){return db[_0x1669('0xd3')][_0x1669('0xd4')](_0xe147a4,{'transaction':_0x318c09});});}}})[_0x1669('0x16')](function(){if(_0x18be40){_0x17a18f=_0x18be40;return db[_0x1669('0xc6')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1669('0xd5'),'raw':!![],'include':[{'model':db[_0x1669('0xd6')],'as':_0x1669('0xd6'),'raw':!![]}]}]});}})[_0x1669('0x16')](function(_0x1c87f6){if(_0x1c87f6&&_0x1c87f6[_0x1669('0xd5')]&&_0x476300[_0x1669('0xd7')]&&_0x476300[_0x1669('0xd8')]){var _0xef67c=_0x1c87f6[_0x1669('0xd9')]();return respondWithRpcPromise('SendMail',_0x1669('0xda'),{'account':_0xef67c,'message':{'from':util[_0x1669('0xa0')](_0x1669('0xdb'),_0x1c87f6[_0x1669('0x2e')],_0x1c87f6['email']||_0x1c87f6[_0x1669('0xd5')]['user']),'to':_0x476300['forwardOfflineAddress'],'subject':_0x476300[_0x1669('0xdc')],'html':_0x17a18f[_0x1669('0x4c')],'attachments':_0x237dbb}},client9003)['then'](function(){return _0x17a18f;})[_0x1669('0x1e')](function(_0x51c454){logger[_0x1669('0x1b')](_0x51c454);});}})['then'](function(){if(_0x476300&&_0x476300[_0x1669('0xd2')]&&_0x476300[_0x1669('0xdd')]){var _0x2764ee=[];if(_0x1cd11a[_0x1669('0x4a')]){_0x2764ee=_0x1cd11a[_0x1669('0x30')](function(_0x50647b){return{'name':_0x50647b[_0x1669('0xd0')],'basename':_0x50647b['filename'],'type':_0x50647b[_0x1669('0xde')],'ChatOfflineMessageId':_0x18be40['id']};});}var _0x6832f1;if(!_['isNil'](_0x476300['subjectOffline'])){var _0x4cc3b5=_[_0x1669('0x30')](_0x21a63c[_0x1669('0x4c')],function(_0x583bf0){return _0x583bf0;});var _0x3790cd=_[_0x1669('0xdf')](_0x4cc3b5)[0x0];var _0x53ec59=_[_0x1669('0xe0')](_0x3790cd,function(_0x3339c9){return _0x3339c9;});_0x6832f1=_0x53ec59[0x1][_0x476300[_0x1669('0xe1')]];}var _0x5583ca={'from':_0x214bdd[_0x1669('0xe2')],'firstName':_0x214bdd[_0x1669('0x9c')],'lastName':_0x214bdd[_0x1669('0xae')],'mapKey':_0x1669('0xe2'),'message':{'from':_0x214bdd['email'],'to':_0x476300[_0x1669('0xc6')][_0x1669('0xe2')],'cc':'','subject':_[_0x1669('0x6e')](_0x6832f1)?_0x476300['offlineMessageSubject']:_0x6832f1,'messageId':'','sentAt':new Date(),'attach':_0x2764ee[_0x1669('0x4a')],'attachments':_0x2764ee,'originChannel':'Chat','ChatWebsiteId':_0x476300['id'],'ChatOfflineMessageId':_0x17a18f['id'],'originTo':_0x476300[_0x1669('0xc6')]['email']},'body':_0x17a18f[_0x1669('0x4c')]};var _0x1983f7={'account':{'id':_0x476300[_0x1669('0xdd')]},'body':_0x5583ca,'log':_0x1669('0xe3')};return respondWithRpcPromise(_0x1669('0xe3'),_0x1669('0xe4'),_0x1983f7,client9001)[_0x1669('0x16')](function(){return _0x17a18f;})[_0x1669('0x1e')](function(_0x2d4f44){logger[_0x1669('0x1b')](_0x2d4f44);});}return;})[_0x1669('0x16')](function(){if(_0x17a18f){return _0x17a18f;}})[_0x1669('0x16')](respondWithResult(_0x4858d9,null))[_0x1669('0x1e')](function(_0x4dbfb1){logger[_0x1669('0x1b')](_0x1669('0x1e'),_0x4dbfb1);for(var _0x2d70fb of _0x1cd11a){var _0x1df1bd=path['join'](config[_0x1669('0x69')],'server',_0x1669('0xe5'),'attachments',_0x1669('0xe6'),_0x2d70fb[_0x1669('0x61')]);fs_extra['remove'](_0x1df1bd)['catch'](function(_0x5e918c){logger[_0x1669('0x1b')](_0x1669('0xe7'),_0x1df1bd,_0x5e918c);});}});};exports['addInteraction']=function(_0x1bbf61,_0x4a657d){return db[_0x1669('0xa9')][_0x1669('0x50')]({'where':{'id':_0x1bbf61[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4a657d,null))[_0x1669('0x16')](function(_0x8e39f2){if(_0x8e39f2){return _0x8e39f2[_0x1669('0xe8')](_0x1bbf61[_0x1669('0x4c')][_0x1669('0x5a')],_[_0x1669('0xe9')](_0x1bbf61['body'],['ids','id'])||{});}})[_0x1669('0x16')](respondWithResult(_0x4a657d,null))[_0x1669('0x1e')](handleError(_0x4a657d,null));};exports[_0x1669('0xea')]=function(_0x36ac99,_0x3c9211){var _0x3e68d0={'raw':![],'where':{}};var _0x2fc665={};var _0x5679f6={'count':0x0,'rows':[]};return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x36ac99[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x3c9211,null))[_0x1669('0x16')](function(_0x3a3660){if(_0x3a3660){_0x2fc665[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0xa9')]['rawAttributes']);_0x2fc665['query']=_['keys'](_0x36ac99['query']);_0x2fc665[_0x1669('0x3e')]=_[_0x1669('0x36')](_0x2fc665[_0x1669('0x33')],_0x2fc665[_0x1669('0x34')]);_0x3e68d0['attributes']=_['intersection'](_0x2fc665[_0x1669('0x33')],qs[_0x1669('0x38')](_0x36ac99[_0x1669('0x34')][_0x1669('0x38')]));_0x3e68d0[_0x1669('0x37')]=_0x3e68d0[_0x1669('0x37')][_0x1669('0x4a')]?_0x3e68d0[_0x1669('0x37')]:_0x2fc665[_0x1669('0x33')];if(!_0x36ac99[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x3e68d0[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x36ac99[_0x1669('0x34')][_0x1669('0x24')]);_0x3e68d0[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x36ac99['query'][_0x1669('0x23')]);}_0x3e68d0[_0x1669('0x3b')]=qs[_0x1669('0x3c')](_0x36ac99[_0x1669('0x34')][_0x1669('0x3c')]);_0x3e68d0[_0x1669('0x3d')]=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x36ac99[_0x1669('0x34')],_0x2fc665[_0x1669('0x3e')]));_0x3e68d0[_0x1669('0x3d')][_0x1669('0x55')]=_0x3a3660['id'];if(_0x36ac99[_0x1669('0x34')][_0x1669('0x40')]){_0x3e68d0['where']=_[_0x1669('0x41')](_0x3e68d0['where'],{'$or':_[_0x1669('0x30')](_0x3e68d0[_0x1669('0x37')],function(_0x3fb779){var _0x5af99f={};_0x5af99f[_0x3fb779]={'$like':'%'+_0x36ac99['query'][_0x1669('0x40')]+'%'};return _0x5af99f;})});}_0x3e68d0=_[_0x1669('0x41')]({},_0x3e68d0,_0x36ac99[_0x1669('0x4b')]);return db[_0x1669('0xa9')][_0x1669('0x22')]({'where':_0x3e68d0['where']})[_0x1669('0x16')](function(_0xe46fd5){_0x5679f6[_0x1669('0x22')]=_0xe46fd5;if(_0x36ac99['query'][_0x1669('0x44')]){_0x3e68d0[_0x1669('0x45')]=[{'model':db[_0x1669('0x7e')],'as':_0x1669('0xeb'),'required':![]},{'model':db[_0x1669('0xb8')],'as':_0x1669('0xec'),'attributes':[_0x1669('0x2e'),'fullname',_0x1669('0xed')],'required':![]},{'model':db[_0x1669('0xee')],'as':_0x1669('0xef'),'attributes':['id',_0x1669('0x2e'),_0x1669('0xf0')],'where':_0x36ac99[_0x1669('0x34')]['tag']?{'id':_0x36ac99['query']['tag']}:undefined,'required':_0x36ac99[_0x1669('0x34')][_0x1669('0xf1')]?!![]:![]}];}return db[_0x1669('0xa9')][_0x1669('0x46')](_0x3e68d0);})[_0x1669('0x16')](function(_0x172854){_0x5679f6['rows']=_0x172854;return _0x5679f6;});}})['then'](respondWithFilteredResult(_0x3c9211,_0x3e68d0))[_0x1669('0x1e')](handleError(_0x3c9211,null));};function iftimePromise(_0x2d5324,_0x5bb7d1){return respondWithRpcPromise(_0x1669('0xf2'),_0x1669('0xf3'),{'command':_0x5bb7d1[_0x1669('0xf4')]?util[_0x1669('0xa0')]('iftime\x20%s,%s',_0x2d5324[_0x1669('0xf5')],_0x5bb7d1[_0x1669('0xf4')]):util['format'](_0x1669('0xf6'),_0x2d5324[_0x1669('0xf5')])},client9002)[_0x1669('0x16')](function(_0x427722){var _0x5d5768=_0x427722&&_0x427722[_0x1669('0xf7')](_0x1669('0xf8'))>=0x0?!![]:![];logger[_0x1669('0xf9')](_0x1669('0xfa'),_0x5bb7d1['id'],_0x2d5324['id'],_0x2d5324[_0x1669('0xf5')],_0x5d5768?_0x1669('0xfb'):_0x1669('0xfc'),_0x5bb7d1['timezone']?_0x5bb7d1[_0x1669('0xf4')]:'No\x20timezone');return _0x5d5768;})[_0x1669('0x1e')](function(_0x88d776){logger[_0x1669('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5bb7d1['id'],_0x2d5324['id'],_0x2d5324[_0x1669('0xf5')],util[_0x1669('0xfd')](_0x88d776,{'showHidden':![],'depth':null}),_0x5bb7d1[_0x1669('0xf4')]?_0x5bb7d1[_0x1669('0xf4')]:_0x1669('0xfe'));return![];});}exports['getSnippet']=function(_0x22926c,_0x3ac347){var _0x4ec729=0x0;var _0x165aad=0x0;var _0x1af2e4=![];var _0x31e171;var _0x5cb4a6;return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x22926c[_0x1669('0x49')]['id']},'include':[{'model':db[_0x1669('0xff')],'as':_0x1669('0xff'),'include':[{'model':db['Interval'],'as':_0x1669('0x100'),'attributes':['id',_0x1669('0xf5')],'raw':!![]}]}]})[_0x1669('0x16')](handleEntityNotFound(_0x3ac347,null))[_0x1669('0x16')](function(_0x3f73cc){if(_0x3f73cc){_0x31e171=_0x3f73cc;return _0x3f73cc[_0x1669('0x101')]({'raw':!![]});}})[_0x1669('0x16')](function(_0x1d9e6c){if(_0x31e171){if(_0x1d9e6c){_0x5cb4a6=_0x1d9e6c;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0x37475d){if(_0x37475d){_0x165aad=_0x37475d[_0x1669('0x102')];_0x1af2e4=_0x37475d[_0x1669('0x6d')];}})[_0x1669('0x16')](function(){return db[_0x1669('0xa9')][_0x1669('0x22')]({'where':{'closed':![]}});})[_0x1669('0x16')](function(_0x56ed3a){_0x4ec729=_0x56ed3a;if(_0x165aad&&_0x56ed3a>_0x165aad){return db['License'][_0x1669('0x58')]({'where':{'id':0x1}})[_0x1669('0x16')](function(_0x2a3db9){if(_0x2a3db9){_0x2a3db9[_0x1669('0x103')](_0x1669('0x104'));}});}})['then'](function(){if(_0x31e171[_0x1669('0xff')]&&_0x31e171['Interval'][_0x1669('0x100')]){var _0x83fec7=[];for(var _0x274b6a=0x0;_0x274b6a<_0x31e171[_0x1669('0xff')][_0x1669('0x100')][_0x1669('0x4a')];_0x274b6a++){var _0x272e35=_0x31e171[_0x1669('0xff')]['Intervals'][_0x274b6a][_0x1669('0x29')]({'plain':!![]});_0x83fec7[_0x1669('0xb2')](iftimePromise(_0x272e35,_0x31e171));}return BPromise[_0x1669('0x105')](_0x83fec7)[_0x1669('0x16')](function(_0x22afa0){return _['some'](_0x22afa0);});}else{return!![];}})[_0x1669('0x16')](function(_0x5f5e08){var _0x3cbb87=fs[_0x1669('0xc8')](path['join'](config[_0x1669('0x69')],_0x1669('0x106')),_0x1669('0xca'));var _0x5ca537=new url[(_0x1669('0x107'))](_0x31e171[_0x1669('0x108')])['origin'];var _0x247e03=_0x1669('0x109');var _0x39378d=![];var _0x2400a0={'chatVersion':_0x247e03,'chatWebsiteAddressOrigin':_0x5ca537,'remote':_0x31e171[_0x1669('0x10a')],'query':querystring['stringify'](_[_0x1669('0x41')](_0x31e171[_0x1669('0x29')]({'plain':!![]}),{'customerIp':_0x22926c['headers']['x-forwarded-for']||_0x22926c[_0x1669('0x97')][_0x1669('0x10b')]||_0x22926c[_0x1669('0x10c')][_0x1669('0x10d')]||_0x22926c['ip'],'referer':_0x22926c[_0x1669('0x97')]['referer'],'openedInteractions':_0x4ec729,'maxInteractions':_0x165aad,'virtual':_0x1af2e4['virtual'],'online':_0x5f5e08,'custom':_0x1af2e4}))[_0x1669('0x10e')](/'/g,'\x5c\x27')};_0x3ac347[_0x1669('0xc1')](ejs[_0x1669('0xcb')](Mustache[_0x1669('0xcb')](_0x3cbb87,_0x2400a0),{'proactiveActions':_0x5cb4a6,'alignment':_0x31e171[_0x1669('0x10f')],'verticalAlignment':_0x31e171['verticalAlignment'],'div_color':_0x31e171[_0x1669('0xf0')],'labelText':_0x31e171['labelText'],'text_color':_0x31e171[_0x1669('0x110')],'text_button_color':_0x31e171[_0x1669('0x111')],'button_color':_0x31e171['color_button'],'background_color':_0x31e171['backgroundColor'],'hideWhenOffline':_0x31e171['hideWhenOffline'],'intervalId':_0x31e171[_0x1669('0x112')],'isDevelopment':_0x39378d,'chatVersion':_0x247e03}));})[_0x1669('0x1e')](handleError(_0x3ac347,null));};exports[_0x1669('0x113')]=function(_0x1e33b0,_0x466e98){var _0x111746=_0x1e33b0[_0x1669('0x49')]['id'];var _0x2eff3a=_0x1e33b0[_0x1669('0x4c')];var _0x42bc59=0xc8;var _0x28fde8=null;return db[_0x1669('0x114')][_0x1669('0x115')]({'isolationLevel':db[_0x1669('0x114')]['Transaction'][_0x1669('0x116')][_0x1669('0x117')]},function(_0x3577bd){return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x111746},'transaction':_0x3577bd})[_0x1669('0x16')](function(_0xccac2){if(_0xccac2){return db['ChatApplication'][_0x1669('0x2c')]({'where':{'ChatWebsiteId':_0x111746},'transaction':_0x3577bd})[_0x1669('0x16')](function(){var _0x17d532=_[_0x1669('0x30')](_0x2eff3a,function(_0x1e81d2){_0x1e81d2[_0x1669('0x55')]=_0x111746;return _0x1e81d2;});return db[_0x1669('0x8d')][_0x1669('0xd4')](_0x17d532,{'transaction':_0x3577bd});});}else{_0x42bc59=0x194;_0x28fde8=[];}});})[_0x1669('0x16')](function(){if(_0x42bc59!==0x194){return db[_0x1669('0x8d')][_0x1669('0x118')]({'where':{'ChatWebsiteId':_0x111746},'order':_0x1669('0x119')})[_0x1669('0x16')](function(_0x520eba){_0x28fde8=_0x520eba;});}})[_0x1669('0x1e')](function(_0x320a7d){_0x42bc59=0x1f4;logger[_0x1669('0x1b')](_0x320a7d[_0x1669('0x11a')]);if(_0x320a7d['name']){delete _0x320a7d[_0x1669('0x2e')];}_0x28fde8=_0x320a7d;})[_0x1669('0x11b')](function(){if(_0x28fde8===null){_0x466e98[_0x1669('0x2d')](_0x42bc59);}else{if(_0x42bc59===0x1f4){_0x466e98['status'](_0x42bc59)[_0x1669('0xc1')](_0x28fde8);}else{_0x466e98[_0x1669('0x25')](_0x42bc59)[_0x1669('0x20')](_0x28fde8);}}});};exports[_0x1669('0x11c')]=function(_0xde3e5,_0x2a58cb){var _0x18c765={};var _0x3a583a={};var _0xaa7d34;var _0x7cce67;return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0xde3e5['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x2a58cb,null))['then'](function(_0x4e2aee){if(_0x4e2aee){_0xaa7d34=_0x4e2aee;_0x3a583a[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0x8d')][_0x1669('0x31')]);_0x3a583a['query']=_[_0x1669('0x35')](_0xde3e5[_0x1669('0x34')]);_0x3a583a[_0x1669('0x3e')]=_[_0x1669('0x36')](_0x3a583a['model'],_0x3a583a[_0x1669('0x34')]);_0x18c765[_0x1669('0x37')]=_[_0x1669('0x36')](_0x3a583a['model'],qs[_0x1669('0x38')](_0xde3e5[_0x1669('0x34')]['fields']));_0x18c765[_0x1669('0x37')]=_0x18c765[_0x1669('0x37')][_0x1669('0x4a')]?_0x18c765[_0x1669('0x37')]:_0x3a583a[_0x1669('0x33')];_0x18c765['order']=qs['sort'](_0xde3e5['query'][_0x1669('0x3c')]);_0x18c765[_0x1669('0x3d')]=qs['filters'](_['pick'](_0xde3e5[_0x1669('0x34')],_0x3a583a[_0x1669('0x3e')]));if(_0xde3e5[_0x1669('0x34')]['filter']){_0x18c765[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x18c765['where'],{'$or':_[_0x1669('0x30')](_0x18c765[_0x1669('0x37')],function(_0x14ade0){var _0x47c6d3={};_0x47c6d3[_0x14ade0]={'$like':'%'+_0xde3e5[_0x1669('0x34')]['filter']+'%'};return _0x47c6d3;})});}_0x18c765=_['merge']({},_0x18c765,_0xde3e5[_0x1669('0x4b')]);return _0xaa7d34[_0x1669('0x11c')](_0x18c765);}})[_0x1669('0x16')](function(_0x1df05c){if(_0x1df05c){_0x7cce67=_0x1df05c[_0x1669('0x4a')];if(!_0xde3e5[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x18c765['limit']=qs['limit'](_0xde3e5['query'][_0x1669('0x24')]);_0x18c765[_0x1669('0x23')]=qs['offset'](_0xde3e5['query'][_0x1669('0x23')]);}return _0xaa7d34[_0x1669('0x11c')](_0x18c765);}})['then'](function(_0x2d2911){if(_0x2d2911){return _0x2d2911?{'count':_0x7cce67,'rows':_0x2d2911}:null;}})[_0x1669('0x16')](respondWithResult(_0x2a58cb,null))[_0x1669('0x1e')](handleError(_0x2a58cb,null));};exports['addProactiveActions']=function(_0x39094e,_0x3981bb){return db[_0x1669('0x11d')][_0x1669('0x50')]({'where':{'id':_0x39094e[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x3981bb,null))[_0x1669('0x16')](function(_0x2a20f7){if(_0x2a20f7){return _0x2a20f7[_0x1669('0x11e')](_0x39094e[_0x1669('0x4c')][_0x1669('0x5a')],_[_0x1669('0xe9')](_0x39094e[_0x1669('0x4c')],['ids','id'])||{});}})[_0x1669('0x16')](respondWithResult(_0x3981bb,null))[_0x1669('0x1e')](handleError(_0x3981bb,null));};exports['getProactiveActions']=function(_0x372cef,_0xc4e95a){var _0x33a13d={};var _0x64a11b={};var _0x446a96;var _0x4d2a3c;return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x372cef[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0xc4e95a,null))[_0x1669('0x16')](function(_0x5cbf0a){if(_0x5cbf0a){_0x446a96=_0x5cbf0a;_0x64a11b[_0x1669('0x33')]=_['keys'](db[_0x1669('0x11f')][_0x1669('0x31')]);_0x64a11b[_0x1669('0x34')]=_[_0x1669('0x35')](_0x372cef[_0x1669('0x34')]);_0x64a11b[_0x1669('0x3e')]=_['intersection'](_0x64a11b[_0x1669('0x33')],_0x64a11b['query']);_0x33a13d[_0x1669('0x37')]=_[_0x1669('0x36')](_0x64a11b[_0x1669('0x33')],qs[_0x1669('0x38')](_0x372cef[_0x1669('0x34')][_0x1669('0x38')]));_0x33a13d[_0x1669('0x37')]=_0x33a13d[_0x1669('0x37')][_0x1669('0x4a')]?_0x33a13d[_0x1669('0x37')]:_0x64a11b['model'];_0x33a13d[_0x1669('0x3b')]=qs['sort'](_0x372cef['query'][_0x1669('0x3c')]);_0x33a13d['where']=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x372cef[_0x1669('0x34')],_0x64a11b['filters']));if(_0x372cef[_0x1669('0x34')][_0x1669('0x40')]){_0x33a13d[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x33a13d[_0x1669('0x3d')],{'$or':_[_0x1669('0x30')](_0x33a13d[_0x1669('0x37')],function(_0x1d7ba5){var _0x4dfdcf={};_0x4dfdcf[_0x1d7ba5]={'$like':'%'+_0x372cef['query'][_0x1669('0x40')]+'%'};return _0x4dfdcf;})});}_0x33a13d=_[_0x1669('0x41')]({},_0x33a13d,_0x372cef[_0x1669('0x4b')]);return _0x446a96['getProactiveActions'](_0x33a13d);}})[_0x1669('0x16')](function(_0x1de237){if(_0x1de237){_0x4d2a3c=_0x1de237[_0x1669('0x4a')];if(!_0x372cef[_0x1669('0x34')]['hasOwnProperty']('nolimit')){_0x33a13d['limit']=qs[_0x1669('0x24')](_0x372cef[_0x1669('0x34')]['limit']);_0x33a13d[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x372cef['query'][_0x1669('0x23')]);}return _0x446a96[_0x1669('0x101')](_0x33a13d);}})[_0x1669('0x16')](function(_0x43d980){if(_0x43d980){return _0x43d980?{'count':_0x4d2a3c,'rows':_0x43d980}:null;}})[_0x1669('0x16')](respondWithResult(_0xc4e95a,null))[_0x1669('0x1e')](handleError(_0xc4e95a,null));};exports[_0x1669('0x120')]=function(_0x10146c,_0x4c397f){var _0x1462fa=_0x10146c[_0x1669('0x34')][_0x1669('0x121')]===_0x1669('0x122')?_0x1669('0x123'):_0x1669('0x124');return db[_0x1669('0x43')][_0x1669('0x50')]({'attributes':['id',_0x1462fa],'where':{'id':_0x10146c[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4c397f,null))['then'](function(_0x3f97e2){if(_0x3f97e2){var _0x13120d=_0x3f97e2[_0x1462fa];var _0x43e785=_0x13120d&&_0x13120d[_0x1669('0x125')]?_0x13120d[_0x1669('0x125')]:[];_0x4c397f[_0x1669('0xc1')]({'fromKey':_[_0x1669('0x6e')](_0x13120d[_0x1669('0x126')])?undefined:_0x13120d['fromKey'],'count':_0x43e785[_0x1669('0x4a')],'rows':_0x43e785});}})[_0x1669('0x1e')](handleError(_0x4c397f,null));};exports[_0x1669('0x127')]=function(_0x2c7619,_0x48a989){var _0x439c90={'raw':![],'where':{}};var _0x2aba09={};var _0x25b0ab={'count':0x0,'rows':[]};return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x2c7619[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x48a989,null))['then'](function(_0x2e59f6){if(_0x2e59f6){_0x2aba09[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0xce')][_0x1669('0x31')]);_0x2aba09[_0x1669('0x34')]=_['keys'](_0x2c7619[_0x1669('0x34')]);_0x2aba09['filters']=_[_0x1669('0x36')](_0x2aba09[_0x1669('0x33')],_0x2aba09[_0x1669('0x34')]);_0x439c90[_0x1669('0x37')]=_[_0x1669('0x36')](_0x2aba09[_0x1669('0x33')],qs['fields'](_0x2c7619['query']['fields']));_0x439c90[_0x1669('0x37')]=_0x439c90[_0x1669('0x37')][_0x1669('0x4a')]?_0x439c90[_0x1669('0x37')]:_0x2aba09[_0x1669('0x33')];if(!_0x2c7619[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x439c90[_0x1669('0x24')]=qs['limit'](_0x2c7619['query'][_0x1669('0x24')]);_0x439c90['offset']=qs[_0x1669('0x23')](_0x2c7619[_0x1669('0x34')][_0x1669('0x23')]);}_0x439c90[_0x1669('0x3b')]=qs['sort'](_0x2c7619['query'][_0x1669('0x3c')]);_0x439c90[_0x1669('0x3d')]=qs['filters'](_['pick'](_0x2c7619['query'],_0x2aba09[_0x1669('0x3e')]));_0x439c90['where'][_0x1669('0x55')]=_0x2e59f6['id'];if(_0x2c7619[_0x1669('0x34')]['filter']){_0x439c90[_0x1669('0x3d')]=_['merge'](_0x439c90['where'],{'$or':_[_0x1669('0x30')](_0x439c90[_0x1669('0x37')],function(_0xe2aa1d){var _0x3e557c={};_0x3e557c[_0xe2aa1d]={'$like':'%'+_0x2c7619['query'][_0x1669('0x40')]+'%'};return _0x3e557c;})});}_0x439c90=_[_0x1669('0x41')]({},_0x439c90,_0x2c7619[_0x1669('0x4b')]);return db['ChatOfflineMessage'][_0x1669('0x22')]({'where':_0x439c90[_0x1669('0x3d')]})[_0x1669('0x16')](function(_0x4adb36){_0x25b0ab['count']=_0x4adb36;if(_0x2c7619[_0x1669('0x34')][_0x1669('0x44')]){_0x439c90[_0x1669('0x45')]=[{'all':!![]}];}else{_0x439c90['include']=[{'model':db['CmContact'],'as':_0x1669('0xeb'),'required':![]},{'model':db[_0x1669('0xd3')],'as':_0x1669('0x128'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x439c90);})[_0x1669('0x16')](function(_0x3e86ac){_0x25b0ab[_0x1669('0x47')]=_0x3e86ac;return _0x25b0ab;});}})[_0x1669('0x16')](respondWithFilteredResult(_0x48a989,_0x439c90))[_0x1669('0x1e')](handleError(_0x48a989,null));};exports[_0x1669('0x129')]=function(_0x4f899d,_0x5a89b2){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x4f899d['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x5a89b2,null))[_0x1669('0x16')](function(_0x895cb7){if(_0x895cb7){return _0x895cb7[_0x1669('0x129')](_0x4f899d[_0x1669('0x4c')][_0x1669('0x5a')],_[_0x1669('0xe9')](_0x4f899d['body'],[_0x1669('0x5a'),'id'])||{})['spread'](function(_0x1a9e25){for(var _0x3e1768=0x0;_0x3e1768<_0x4f899d[_0x1669('0x4c')]['ids'][_0x1669('0x4a')];_0x3e1768+=0x1){socket['emit'](_0x1669('0x12a'),{'UserId':Number(_0x4f899d[_0x1669('0x4c')]['ids'][_0x3e1768]),'ChatWebsiteId':Number(_0x4f899d['params']['id'])});}return _0x1a9e25;});}})[_0x1669('0x16')](respondWithResult(_0x5a89b2,null))[_0x1669('0x1e')](handleError(_0x5a89b2,null));};exports[_0x1669('0x12b')]=function(_0x1d60d1,_0x498179){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x1d60d1[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x498179,null))['then'](function(_0x489c63){if(_0x489c63){return _0x489c63[_0x1669('0x12b')](_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')])[_0x1669('0x16')](function(){if(_[_0x1669('0x12c')](_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')])){for(var _0x724f92=0x0;_0x724f92<_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')][_0x1669('0x4a')];_0x724f92+=0x1){socket[_0x1669('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')][_0x724f92]),'ChatWebsiteId':Number(_0x1d60d1[_0x1669('0x49')]['id'])});}}else{socket[_0x1669('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')]),'ChatWebsiteId':Number(_0x1d60d1['params']['id'])});}});}})[_0x1669('0x16')](respondWithStatusCode(_0x498179,null))[_0x1669('0x1e')](handleError(_0x498179,null));};exports[_0x1669('0x12e')]=function(_0x2f74e9,_0x917dc4){var _0x1d5e1b={};var _0x1e089b={};var _0x5293be;var _0xc13303;return db['ChatWebsite']['findOne']({'where':{'id':_0x2f74e9['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x917dc4,null))[_0x1669('0x16')](function(_0x4abb31){if(_0x4abb31){_0x5293be=_0x4abb31;_0x1e089b['model']=_[_0x1669('0x35')](db[_0x1669('0xb8')][_0x1669('0x31')]);_0x1e089b[_0x1669('0x34')]=_['keys'](_0x2f74e9['query']);_0x1e089b[_0x1669('0x3e')]=_['intersection'](_0x1e089b[_0x1669('0x33')],_0x1e089b[_0x1669('0x34')]);_0x1d5e1b['attributes']=_[_0x1669('0x36')](_0x1e089b[_0x1669('0x33')],qs['fields'](_0x2f74e9['query'][_0x1669('0x38')]));_0x1d5e1b[_0x1669('0x37')]=_0x1d5e1b[_0x1669('0x37')][_0x1669('0x4a')]?_0x1d5e1b[_0x1669('0x37')]:_0x1e089b[_0x1669('0x33')];_0x1d5e1b[_0x1669('0x3b')]=qs['sort'](_0x2f74e9[_0x1669('0x34')]['sort']);_0x1d5e1b[_0x1669('0x3d')]=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x2f74e9[_0x1669('0x34')],_0x1e089b[_0x1669('0x3e')]));if(_0x2f74e9[_0x1669('0x34')][_0x1669('0x40')]){_0x1d5e1b['where']=_[_0x1669('0x41')](_0x1d5e1b[_0x1669('0x3d')],{'$or':_[_0x1669('0x30')](_0x1d5e1b[_0x1669('0x37')],function(_0xe931a9){var _0x43d45d={};_0x43d45d[_0xe931a9]={'$like':'%'+_0x2f74e9[_0x1669('0x34')]['filter']+'%'};return _0x43d45d;})});}_0x1d5e1b=_[_0x1669('0x41')]({},_0x1d5e1b,_0x2f74e9[_0x1669('0x4b')]);return _0x5293be[_0x1669('0x12e')](_0x1d5e1b);}})[_0x1669('0x16')](function(_0x3f1589){if(_0x3f1589){_0xc13303=_0x3f1589[_0x1669('0x4a')];if(!_0x2f74e9[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x1d5e1b[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x2f74e9[_0x1669('0x34')][_0x1669('0x24')]);_0x1d5e1b[_0x1669('0x23')]=qs['offset'](_0x2f74e9[_0x1669('0x34')][_0x1669('0x23')]);}return _0x5293be['getAgents'](_0x1d5e1b);}})[_0x1669('0x16')](function(_0x475b98){if(_0x475b98){return _0x475b98?{'count':_0xc13303,'rows':_0x475b98}:null;}})['then'](respondWithResult(_0x917dc4,null))[_0x1669('0x1e')](handleError(_0x917dc4,null));};
\ No newline at end of file
+var _0x49ce=['client','http','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','findAll','rows','show','params','Pause','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','Disposition','getDispositions','pick','ChatWebsiteId','includeAll','include','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','join','root','sitepic','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','getResult','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','account','list','applications','priority','Contacts','defaults','ListId','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','bulkCreate','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','email','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','Owner','internal','Tags','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','getProactiveActions','../../config/license/util','getLicense','virtual','License','increment','Intervals','some','URL','address','origin','remote','stringify','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','html-to-text'];(function(_0x485e45,_0x35d726){var _0x246445=function(_0xa1c5c8){while(--_0xa1c5c8){_0x485e45['push'](_0x485e45['shift']());}};_0x246445(++_0x35d726);}(_0x49ce,0x11c));var _0xe49c=function(_0x13c38a,_0x522286){_0x13c38a=_0x13c38a-0x0;var _0x5c658a=_0x49ce[_0x13c38a];return _0x5c658a;};'use strict';var BPromise=require(_0xe49c('0x0'));var Mustache=require(_0xe49c('0x1'));var util=require(_0xe49c('0x2'));var path=require(_0xe49c('0x3'));var ejs=require(_0xe49c('0x4'));var fs=require('fs');var fs_extra=require(_0xe49c('0x5'));var _=require(_0xe49c('0x6'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xe49c('0x7'))(_0xe49c('0x8'));var config=require('../../config/environment');var url=require('url');var db=require(_0xe49c('0x9'))['db'];config[_0xe49c('0xa')]=_['defaults'](config[_0xe49c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe49c('0xb'))(new Redis(config[_0xe49c('0xa')]));require(_0xe49c('0xc'))['register'](socket);var htmlToText=require(_0xe49c('0xd'));var jayson=require('jayson/promise');var client=jayson[_0xe49c('0xe')][_0xe49c('0xf')]({'port':0x232c});var client9002=jayson[_0xe49c('0xe')][_0xe49c('0xf')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xe49c('0xe')][_0xe49c('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x31cfef,_0x33ebdd,_0x26689e,_0x2413b2){return new BPromise(function(_0x197f7e,_0x13d50b){var _0x59b25a=_0x2413b2||client;return _0x59b25a['request'](_0x31cfef,_0x26689e)['then'](function(_0x1f2be8){logger[_0xe49c('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x33ebdd,_0xe49c('0x11'));logger[_0xe49c('0x12')](_0xe49c('0x13'),_0x33ebdd,_0xe49c('0x11'),JSON['stringify'](_0x1f2be8));if(_0x1f2be8[_0xe49c('0x14')]){if(_0x1f2be8[_0xe49c('0x14')][_0xe49c('0x15')]===0x1f4){logger[_0xe49c('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x33ebdd,_0x1f2be8[_0xe49c('0x14')]['message']);return _0x13d50b(_0x1f2be8[_0xe49c('0x14')]['message']);}logger['error'](_0xe49c('0x16'),_0x33ebdd,_0x1f2be8[_0xe49c('0x14')][_0xe49c('0x17')]);return _0x197f7e(_0x1f2be8[_0xe49c('0x14')][_0xe49c('0x17')]);}else{logger[_0xe49c('0x10')](_0xe49c('0x16'),_0x33ebdd,_0xe49c('0x11'));_0x197f7e(_0x1f2be8['result'][_0xe49c('0x17')]);}})[_0xe49c('0x18')](function(_0x3ea0b2){logger['error'](_0xe49c('0x16'),_0x33ebdd,_0x3ea0b2);_0x13d50b(_0x3ea0b2);});});}function respondWithStatusCode(_0x5490d0,_0x50131e){_0x50131e=_0x50131e||0xcc;return function(_0x4720e6){if(_0x4720e6){return _0x5490d0[_0xe49c('0x19')](_0x50131e);}return _0x5490d0[_0xe49c('0x1a')](_0x50131e)[_0xe49c('0x1b')]();};}function respondWithResult(_0x1240d3,_0x1e3bba){_0x1e3bba=_0x1e3bba||0xc8;return function(_0x312169){if(_0x312169){return _0x1240d3['status'](_0x1e3bba)[_0xe49c('0x1c')](_0x312169);}};}function respondWithFilteredResult(_0x58bf64,_0x2e64b9){return function(_0x2e0457){if(_0x2e0457){var _0x489788=typeof _0x2e64b9[_0xe49c('0x1d')]===_0xe49c('0x1e')&&typeof _0x2e64b9[_0xe49c('0x1f')]==='undefined';var _0x4776f2=_0x2e0457[_0xe49c('0x20')];var _0x5b8b56=_0x489788?0x0:_0x2e64b9['offset'];var _0x154895=_0x489788?_0x2e0457[_0xe49c('0x20')]:_0x2e64b9[_0xe49c('0x1d')]+_0x2e64b9[_0xe49c('0x1f')];var _0x1c8e57;if(_0x154895>=_0x4776f2){_0x154895=_0x4776f2;_0x1c8e57=0xc8;}else{_0x1c8e57=0xce;}_0x58bf64[_0xe49c('0x1a')](_0x1c8e57);return _0x58bf64[_0xe49c('0x21')](_0xe49c('0x22'),_0x5b8b56+'-'+_0x154895+'/'+_0x4776f2)['json'](_0x2e0457);}return null;};}function saveUpdates(_0x22d365){return function(_0x129306){if(_0x129306){return _0x129306[_0xe49c('0x23')](_0x22d365)[_0xe49c('0x24')](function(_0x57e489){return _0x57e489;});}return null;};}function removeEntity(_0xc9e25){return function(_0x3fab8e){if(_0x3fab8e){return _0x3fab8e[_0xe49c('0x25')]()[_0xe49c('0x24')](function(){var _0x46ca2c=_0x3fab8e[_0xe49c('0x26')]({'plain':!![]});var _0x233a2d=_0xe49c('0x27');return db[_0xe49c('0x28')][_0xe49c('0x25')]({'where':{'type':_0x233a2d,'resourceId':_0x46ca2c['id']}})['then'](function(){return _0x3fab8e;});})['then'](function(){_0xc9e25[_0xe49c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1046a3){return function(_0x575999){if(!_0x575999){_0x1046a3[_0xe49c('0x19')](0x194);}return _0x575999;};}function handleError(_0x393875,_0x3a1e7a){_0x3a1e7a=_0x3a1e7a||0x1f4;return function(_0x5f4a93){logger['error'](_0x5f4a93[_0xe49c('0x29')]);if(_0x5f4a93[_0xe49c('0x2a')]){delete _0x5f4a93[_0xe49c('0x2a')];}_0x393875[_0xe49c('0x1a')](_0x3a1e7a)[_0xe49c('0x2b')](_0x5f4a93);};}exports[_0xe49c('0x2c')]=function(_0x38d06c,_0x491ee2){var _0x27afe6={'include':[{'model':db['Pause'],'as':_0xe49c('0x2d')}]},_0x72c2fb={},_0x2b1d89={'count':0x0,'rows':[]};var _0x50ea9d=_[_0xe49c('0x2e')](db[_0xe49c('0x2f')][_0xe49c('0x30')],function(_0x28530e){return{'name':_0x28530e[_0xe49c('0x31')],'type':_0x28530e[_0xe49c('0x32')][_0xe49c('0x33')]};});_0x72c2fb['model']=_[_0xe49c('0x2e')](_0x50ea9d,_0xe49c('0x2a'));_0x72c2fb[_0xe49c('0x34')]=_[_0xe49c('0x35')](_0x38d06c['query']);_0x72c2fb[_0xe49c('0x36')]=_['intersection'](_0x72c2fb[_0xe49c('0x37')],_0x72c2fb[_0xe49c('0x34')]);_0x27afe6[_0xe49c('0x38')]=_[_0xe49c('0x39')](_0x72c2fb['model'],qs['fields'](_0x38d06c[_0xe49c('0x34')][_0xe49c('0x3a')]));_0x27afe6[_0xe49c('0x38')]=_0x27afe6[_0xe49c('0x38')]['length']?_0x27afe6['attributes']:_0x72c2fb[_0xe49c('0x37')];if(!_0x38d06c[_0xe49c('0x34')][_0xe49c('0x3b')](_0xe49c('0x3c'))){_0x27afe6[_0xe49c('0x1f')]=qs[_0xe49c('0x1f')](_0x38d06c[_0xe49c('0x34')][_0xe49c('0x1f')]);_0x27afe6[_0xe49c('0x1d')]=qs[_0xe49c('0x1d')](_0x38d06c[_0xe49c('0x34')]['offset']);}_0x27afe6[_0xe49c('0x3d')]=qs[_0xe49c('0x3e')](_0x38d06c[_0xe49c('0x34')][_0xe49c('0x3e')]);_0x27afe6[_0xe49c('0x3f')]=qs[_0xe49c('0x36')](_['pick'](_0x38d06c[_0xe49c('0x34')],_0x72c2fb[_0xe49c('0x36')]),_0x50ea9d);if(_0x38d06c[_0xe49c('0x34')][_0xe49c('0x40')]){_0x27afe6[_0xe49c('0x3f')]=_[_0xe49c('0x41')](_0x27afe6[_0xe49c('0x3f')],{'$or':_['map'](_0x50ea9d,function(_0x452123){if(_0x452123['type']!=='VIRTUAL'){var _0x1f703d={};_0x1f703d[_0x452123['name']]={'$like':'%'+_0x38d06c[_0xe49c('0x34')]['filter']+'%'};return _0x1f703d;}})});}_0x27afe6=_[_0xe49c('0x41')]({},_0x27afe6,_0x38d06c['options']);var _0x17af45={'where':_0x27afe6[_0xe49c('0x3f')]};return db[_0xe49c('0x2f')][_0xe49c('0x20')](_0x17af45)[_0xe49c('0x24')](function(_0x1779a0){_0x2b1d89[_0xe49c('0x20')]=_0x1779a0;if(_0x38d06c[_0xe49c('0x34')]['includeAll']){_0x27afe6['include']=[{'all':!![]}];}return db[_0xe49c('0x2f')][_0xe49c('0x42')](_0x27afe6);})[_0xe49c('0x24')](function(_0x1c8325){_0x2b1d89[_0xe49c('0x43')]=_0x1c8325;return _0x2b1d89;})[_0xe49c('0x24')](respondWithFilteredResult(_0x491ee2,_0x27afe6))[_0xe49c('0x18')](handleError(_0x491ee2,null));};exports[_0xe49c('0x44')]=function(_0x483313,_0x21b5da){var _0x1acf5e={'raw':![],'where':{'id':_0x483313[_0xe49c('0x45')]['id']},'include':[{'model':db[_0xe49c('0x46')],'as':_0xe49c('0x2d')}]},_0x81e039={};_0x81e039[_0xe49c('0x37')]=_[_0xe49c('0x35')](db['ChatWebsite']['rawAttributes']);_0x81e039[_0xe49c('0x34')]=_[_0xe49c('0x35')](_0x483313[_0xe49c('0x34')]);_0x81e039[_0xe49c('0x36')]=_[_0xe49c('0x39')](_0x81e039[_0xe49c('0x37')],_0x81e039[_0xe49c('0x34')]);_0x1acf5e[_0xe49c('0x38')]=_['intersection'](_0x81e039[_0xe49c('0x37')],qs[_0xe49c('0x3a')](_0x483313['query']['fields']));_0x1acf5e[_0xe49c('0x38')]=_0x1acf5e[_0xe49c('0x38')][_0xe49c('0x47')]?_0x1acf5e[_0xe49c('0x38')]:_0x81e039['model'];if(_0x483313['query']['includeAll']){_0x1acf5e['include']=[{'all':!![]}];}_0x1acf5e=_['merge']({},_0x1acf5e,_0x483313[_0xe49c('0x48')]);return db[_0xe49c('0x2f')][_0xe49c('0x49')](_0x1acf5e)['then'](handleEntityNotFound(_0x21b5da,null))['then'](respondWithResult(_0x21b5da,null))[_0xe49c('0x18')](handleError(_0x21b5da,null));};exports['create']=function(_0x386e50,_0x1f7890){return db['ChatWebsite'][_0xe49c('0x4a')](_0x386e50[_0xe49c('0x4b')],{})[_0xe49c('0x24')](function(_0xd58c21){var _0x1a8adb=_0x386e50[_0xe49c('0x4c')][_0xe49c('0x26')]({'plain':!![]});if(!_0x1a8adb)throw new Error(_0xe49c('0x4d'));if(_0x1a8adb[_0xe49c('0x4e')]===_0xe49c('0x4c')){var _0x2b6a0f=_0xd58c21[_0xe49c('0x26')]({'plain':!![]});var _0x5a7702=_0xe49c('0x27');return db[_0xe49c('0x4f')][_0xe49c('0x49')]({'where':{'name':_0x5a7702,'userProfileId':_0x1a8adb['userProfileId']},'raw':!![]})[_0xe49c('0x24')](function(_0x5edec6){if(_0x5edec6&&_0x5edec6[_0xe49c('0x50')]===0x0){return db[_0xe49c('0x28')][_0xe49c('0x4a')]({'name':_0x2b6a0f['name'],'resourceId':_0x2b6a0f['id'],'type':_0x5edec6[_0xe49c('0x2a')],'sectionId':_0x5edec6['id']},{})[_0xe49c('0x24')](function(){return _0xd58c21;});}else{return _0xd58c21;}})[_0xe49c('0x18')](function(_0x27bf67){logger[_0xe49c('0x14')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27bf67);throw _0x27bf67;});}return _0xd58c21;})[_0xe49c('0x24')](respondWithResult(_0x1f7890,0xc9))[_0xe49c('0x18')](handleError(_0x1f7890,null));};exports[_0xe49c('0x23')]=function(_0x2e574b,_0x27b017){if(_0x2e574b[_0xe49c('0x4b')]['id']){delete _0x2e574b[_0xe49c('0x4b')]['id'];}return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'where':{'id':_0x2e574b['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xe49c('0x24')](handleEntityNotFound(_0x27b017,null))[_0xe49c('0x24')](saveUpdates(_0x2e574b['body'],null))['then'](respondWithResult(_0x27b017,null))[_0xe49c('0x18')](handleError(_0x27b017,null));};exports[_0xe49c('0x25')]=function(_0x358e01,_0x570f11){return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'where':{'id':_0x358e01['params']['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x570f11,null))[_0xe49c('0x24')](removeEntity(_0x570f11,null))[_0xe49c('0x18')](handleError(_0x570f11,null));};exports['describe']=function(_0x3ab31d,_0x4f4c01){return db[_0xe49c('0x2f')][_0xe49c('0x51')]()[_0xe49c('0x24')](respondWithResult(_0x4f4c01,null))[_0xe49c('0x18')](handleError(_0x4f4c01,null));};exports[_0xe49c('0x52')]=function(_0x349905,_0x5aab80){if(_0x349905['body']['id']){delete _0x349905[_0xe49c('0x4b')]['id'];}return db['ChatWebsite'][_0xe49c('0x49')]({'where':{'id':_0x349905['params']['id']}})['then'](handleEntityNotFound(_0x5aab80,null))[_0xe49c('0x24')](function(_0x9555b7){if(_0x9555b7){_0x349905['body']['ChatWebsiteId']=_0x9555b7['id'];return db[_0xe49c('0x53')]['create'](_0x349905[_0xe49c('0x4b')]);}})[_0xe49c('0x24')](respondWithResult(_0x5aab80,null))[_0xe49c('0x18')](handleError(_0x5aab80,null));};exports[_0xe49c('0x54')]=function(_0x47aede,_0x18bd52){var _0x37327a={'raw':![],'where':{}};var _0x3f8d2c={};var _0x8a0ac={'count':0x0,'rows':[]};return db[_0xe49c('0x2f')]['findOne']({'where':{'id':_0x47aede[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x18bd52,null))[_0xe49c('0x24')](function(_0x34e79b){if(_0x34e79b){_0x3f8d2c['model']=_[_0xe49c('0x35')](db[_0xe49c('0x53')]['rawAttributes']);_0x3f8d2c['query']=_[_0xe49c('0x35')](_0x47aede[_0xe49c('0x34')]);_0x3f8d2c['filters']=_[_0xe49c('0x39')](_0x3f8d2c[_0xe49c('0x37')],_0x3f8d2c[_0xe49c('0x34')]);_0x37327a['attributes']=_[_0xe49c('0x39')](_0x3f8d2c[_0xe49c('0x37')],qs['fields'](_0x47aede[_0xe49c('0x34')]['fields']));_0x37327a[_0xe49c('0x38')]=_0x37327a[_0xe49c('0x38')]['length']?_0x37327a[_0xe49c('0x38')]:_0x3f8d2c[_0xe49c('0x37')];if(!_0x47aede['query'][_0xe49c('0x3b')](_0xe49c('0x3c'))){_0x37327a[_0xe49c('0x1f')]=qs['limit'](_0x47aede[_0xe49c('0x34')][_0xe49c('0x1f')]);_0x37327a[_0xe49c('0x1d')]=qs['offset'](_0x47aede['query'][_0xe49c('0x1d')]);}_0x37327a[_0xe49c('0x3d')]=qs[_0xe49c('0x3e')](_0x47aede['query'][_0xe49c('0x3e')]);_0x37327a['where']=qs[_0xe49c('0x36')](_[_0xe49c('0x55')](_0x47aede[_0xe49c('0x34')],_0x3f8d2c[_0xe49c('0x36')]));_0x37327a[_0xe49c('0x3f')][_0xe49c('0x56')]=_0x34e79b['id'];if(_0x47aede[_0xe49c('0x34')][_0xe49c('0x40')]){_0x37327a[_0xe49c('0x3f')]=_[_0xe49c('0x41')](_0x37327a[_0xe49c('0x3f')],{'$or':_[_0xe49c('0x2e')](_0x37327a[_0xe49c('0x38')],function(_0x2dde29){var _0x299fab={};_0x299fab[_0x2dde29]={'$like':'%'+_0x47aede[_0xe49c('0x34')][_0xe49c('0x40')]+'%'};return _0x299fab;})});}_0x37327a=_[_0xe49c('0x41')]({},_0x37327a,_0x47aede[_0xe49c('0x48')]);return db[_0xe49c('0x53')][_0xe49c('0x20')]({'where':_0x37327a[_0xe49c('0x3f')]})['then'](function(_0x532860){_0x8a0ac[_0xe49c('0x20')]=_0x532860;if(_0x47aede[_0xe49c('0x34')][_0xe49c('0x57')]){_0x37327a[_0xe49c('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xe49c('0x42')](_0x37327a);})[_0xe49c('0x24')](function(_0x1e9a46){_0x8a0ac[_0xe49c('0x43')]=_0x1e9a46;return _0x8a0ac;});}})[_0xe49c('0x24')](respondWithFilteredResult(_0x18bd52,_0x37327a))[_0xe49c('0x18')](handleError(_0x18bd52,null));};exports[_0xe49c('0x59')]=function(_0x5102ea,_0x3ee98d){return db['ChatWebsite'][_0xe49c('0x49')]({'where':{'id':_0x5102ea['params']['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x3ee98d,null))[_0xe49c('0x24')](function(_0x16a287){if(_0x16a287){return _0x16a287[_0xe49c('0x59')](_0x5102ea[_0xe49c('0x34')][_0xe49c('0x5a')]);}})[_0xe49c('0x24')](respondWithStatusCode(_0x3ee98d,null))[_0xe49c('0x18')](handleError(_0x3ee98d,null));};exports[_0xe49c('0x5b')]=function(_0x4fbc1f,_0x1746fc){if(_0x4fbc1f[_0xe49c('0x4b')]['id']){delete _0x4fbc1f[_0xe49c('0x4b')]['id'];}return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'where':{'id':_0x4fbc1f['params']['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x1746fc,null))[_0xe49c('0x24')](function(_0x6a0881){if(_0x6a0881){_0x4fbc1f[_0xe49c('0x4b')][_0xe49c('0x56')]=_0x6a0881['id'];return db['CannedAnswer'][_0xe49c('0x4a')](_0x4fbc1f[_0xe49c('0x4b')]);}})['then'](respondWithResult(_0x1746fc,null))['catch'](handleError(_0x1746fc,null));};exports[_0xe49c('0x5c')]=function(_0xdf2ca,_0x942669){var _0xf3cead={'raw':![],'where':{}};var _0x10ebb8={};var _0x2b4e3a={'count':0x0,'rows':[]};return db[_0xe49c('0x2f')][_0xe49c('0x5d')]({'where':{'id':_0xdf2ca['params']['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x942669,null))[_0xe49c('0x24')](function(_0x1b25bb){if(_0x1b25bb){_0x10ebb8[_0xe49c('0x37')]=_[_0xe49c('0x35')](db[_0xe49c('0x5e')][_0xe49c('0x30')]);_0x10ebb8[_0xe49c('0x34')]=_[_0xe49c('0x35')](_0xdf2ca['query']);_0x10ebb8[_0xe49c('0x36')]=_[_0xe49c('0x39')](_0x10ebb8[_0xe49c('0x37')],_0x10ebb8[_0xe49c('0x34')]);_0xf3cead[_0xe49c('0x38')]=_['intersection'](_0x10ebb8[_0xe49c('0x37')],qs[_0xe49c('0x3a')](_0xdf2ca[_0xe49c('0x34')][_0xe49c('0x3a')]));_0xf3cead['attributes']=_0xf3cead[_0xe49c('0x38')][_0xe49c('0x47')]?_0xf3cead[_0xe49c('0x38')]:_0x10ebb8[_0xe49c('0x37')];if(!_0xdf2ca[_0xe49c('0x34')][_0xe49c('0x3b')](_0xe49c('0x3c'))){_0xf3cead['limit']=qs[_0xe49c('0x1f')](_0xdf2ca['query'][_0xe49c('0x1f')]);_0xf3cead[_0xe49c('0x1d')]=qs[_0xe49c('0x1d')](_0xdf2ca[_0xe49c('0x34')][_0xe49c('0x1d')]);}_0xf3cead[_0xe49c('0x3d')]=qs[_0xe49c('0x3e')](_0xdf2ca['query'][_0xe49c('0x3e')]);_0xf3cead[_0xe49c('0x3f')]=qs['filters'](_['pick'](_0xdf2ca[_0xe49c('0x34')],_0x10ebb8['filters']));_0xf3cead[_0xe49c('0x3f')]['ChatWebsiteId']=_0x1b25bb['id'];if(_0xdf2ca['query'][_0xe49c('0x40')]){_0xf3cead[_0xe49c('0x3f')]=_[_0xe49c('0x41')](_0xf3cead[_0xe49c('0x3f')],{'$or':_['map'](_0xf3cead[_0xe49c('0x38')],function(_0x335b3e){var _0x2e3587={};_0x2e3587[_0x335b3e]={'$like':'%'+_0xdf2ca['query'][_0xe49c('0x40')]+'%'};return _0x2e3587;})});}_0xf3cead=_['merge']({},_0xf3cead,_0xdf2ca[_0xe49c('0x48')]);return db[_0xe49c('0x5e')][_0xe49c('0x20')]({'where':_0xf3cead['where']})[_0xe49c('0x24')](function(_0x142e64){_0x2b4e3a[_0xe49c('0x20')]=_0x142e64;if(_0xdf2ca[_0xe49c('0x34')][_0xe49c('0x57')]){_0xf3cead[_0xe49c('0x58')]=[{'all':!![]}];}return db[_0xe49c('0x5e')][_0xe49c('0x42')](_0xf3cead);})[_0xe49c('0x24')](function(_0x21de96){_0x2b4e3a[_0xe49c('0x43')]=_0x21de96;return _0x2b4e3a;});}})[_0xe49c('0x24')](respondWithFilteredResult(_0x942669,_0xf3cead))[_0xe49c('0x18')](handleError(_0x942669,null));};exports[_0xe49c('0x5f')]=function(_0x41b4a7,_0x41b2b2){return db['ChatWebsite'][_0xe49c('0x49')]({'where':{'id':_0x41b4a7['params']['id']}})['then'](handleEntityNotFound(_0x41b2b2,null))[_0xe49c('0x24')](function(_0x56f76f){if(_0x56f76f){return _0x56f76f[_0xe49c('0x5f')](_0x41b4a7['query'][_0xe49c('0x5a')]);}})[_0xe49c('0x24')](respondWithStatusCode(_0x41b2b2,null))[_0xe49c('0x18')](handleError(_0x41b2b2,null));};exports[_0xe49c('0x60')]=function(_0x57903c,_0x5e84da){_0x57903c[_0xe49c('0x4b')]['sitepic']=_0x57903c[_0xe49c('0x61')][_0xe49c('0x62')];return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'where':{'id':_0x57903c['params']['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x5e84da,null))['then'](saveUpdates(_0x57903c['body'],null))[_0xe49c('0x24')](respondWithResult(_0x5e84da,null))[_0xe49c('0x18')](handleError(_0x5e84da,null));};exports[_0xe49c('0x63')]=function(_0x334e70,_0x461caf){_0x334e70['body'][_0xe49c('0x64')]=_0x334e70[_0xe49c('0x61')][_0xe49c('0x62')];return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'where':{'id':_0x334e70[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x461caf,null))[_0xe49c('0x24')](saveUpdates(_0x334e70['body'],null))[_0xe49c('0x24')](respondWithResult(_0x461caf,null))[_0xe49c('0x18')](handleError(_0x461caf,null));};exports[_0xe49c('0x65')]=function(_0x21cef1,_0x497af1){_0x21cef1[_0xe49c('0x4b')][_0xe49c('0x66')]=_0x21cef1[_0xe49c('0x61')][_0xe49c('0x62')];return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'where':{'id':_0x21cef1[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x497af1,null))[_0xe49c('0x24')](saveUpdates(_0x21cef1['body'],null))[_0xe49c('0x24')](respondWithResult(_0x497af1,null))['catch'](handleError(_0x497af1,null));};exports['addSystemAvatar']=function(_0x18cecd,_0x2a0a1d){_0x18cecd['body']['systemAvatar']=_0x18cecd[_0xe49c('0x61')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x18cecd[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x2a0a1d,null))[_0xe49c('0x24')](saveUpdates(_0x18cecd[_0xe49c('0x4b')],null))['then'](respondWithResult(_0x2a0a1d,null))['catch'](handleError(_0x2a0a1d,null));};exports[_0xe49c('0x67')]=function(_0x36c4be,_0x47716b){var _0x94e75a=path[_0xe49c('0x68')](config[_0xe49c('0x69')],'server/files/images/logos/default_logo.svg');var _0x2a9be0={'where':{'id':_0x36c4be[_0xe49c('0x45')]['id']},'attributes':['id',_0xe49c('0x6a')],'raw':!![]};var _0x3e8881=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x2c0f44){if(_0x2c0f44){_0x3e8881=_0x2c0f44[_0xe49c('0x6b')];}})['then'](function(){return db[_0xe49c('0x2f')][_0xe49c('0x49')](_0x2a9be0);})['then'](handleEntityNotFound(_0x47716b,null))[_0xe49c('0x24')](function(_0x7a63dd){if(_0x7a63dd){if(!_[_0xe49c('0x6c')](_0x7a63dd[_0xe49c('0x6a')])){if(fs[_0xe49c('0x6d')](path['join'](config[_0xe49c('0x69')],_0xe49c('0x6e'),_0x7a63dd['sitepic']))&&_0x3e8881){_0x94e75a=path[_0xe49c('0x68')](config[_0xe49c('0x69')],'server/files/images/logos/',_0x7a63dd[_0xe49c('0x6a')]);}}return _0x47716b[_0xe49c('0x6f')](_0x94e75a);}})[_0xe49c('0x18')](handleError(_0x47716b,null));};exports[_0xe49c('0x70')]=function(_0x307f56,_0x1cef16){var _0x4c5915=path[_0xe49c('0x68')](config['root'],_0xe49c('0x71'));var _0x74f807={'where':{'id':_0x307f56[_0xe49c('0x45')]['id']},'attributes':['id',_0xe49c('0x64')],'raw':!![]};return db[_0xe49c('0x2f')][_0xe49c('0x49')](_0x74f807)['then'](handleEntityNotFound(_0x1cef16,null))[_0xe49c('0x24')](function(_0x480363){if(_0x480363){if(!_[_0xe49c('0x6c')](_0x480363[_0xe49c('0x64')])){if(fs[_0xe49c('0x6d')](path['join'](config[_0xe49c('0x69')],_0xe49c('0x72'),_0x480363[_0xe49c('0x64')]))){_0x4c5915=path[_0xe49c('0x68')](config['root'],_0xe49c('0x72'),_0x480363[_0xe49c('0x64')]);}}return _0x1cef16[_0xe49c('0x6f')](_0x4c5915);}})[_0xe49c('0x18')](handleError(_0x1cef16,null));};exports[_0xe49c('0x73')]=function(_0x9a6944,_0x1bce53){var _0x53a7f8=path[_0xe49c('0x68')](config[_0xe49c('0x69')],'server/files/images/avatars/customer_avatar.png');var _0x4a8085={'where':{'id':_0x9a6944[_0xe49c('0x45')]['id']},'attributes':['id',_0xe49c('0x66'),_0xe49c('0x74')],'raw':!![]};return db[_0xe49c('0x2f')][_0xe49c('0x49')](_0x4a8085)[_0xe49c('0x24')](handleEntityNotFound(_0x1bce53,null))[_0xe49c('0x24')](function(_0x5537aa){if(_0x5537aa){if(!_[_0xe49c('0x6c')](_0x5537aa[_0xe49c('0x66')])){if(fs['existsSync'](path[_0xe49c('0x68')](config[_0xe49c('0x69')],_0xe49c('0x72'),_0x5537aa[_0xe49c('0x66')]))&&_0x5537aa[_0xe49c('0x74')]){_0x53a7f8=path[_0xe49c('0x68')](config['root'],'server/files/images/avatars/',_0x5537aa[_0xe49c('0x66')]);}}return _0x1bce53[_0xe49c('0x6f')](_0x53a7f8);}})[_0xe49c('0x18')](handleError(_0x1bce53,null));};exports[_0xe49c('0x75')]=function(_0x348b7a,_0x1110ed){var _0x18a7b7=path[_0xe49c('0x68')](config['root'],_0xe49c('0x76'));var _0x3649e1={'where':{'id':_0x348b7a[_0xe49c('0x45')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe49c('0x2f')][_0xe49c('0x49')](_0x3649e1)[_0xe49c('0x24')](handleEntityNotFound(_0x1110ed,null))[_0xe49c('0x24')](function(_0x5a3a5e){if(_0x5a3a5e){if(!_[_0xe49c('0x6c')](_0x5a3a5e['systemAvatar'])){if(fs['existsSync'](path[_0xe49c('0x68')](config[_0xe49c('0x69')],_0xe49c('0x72'),_0x5a3a5e[_0xe49c('0x77')]))){_0x18a7b7=path[_0xe49c('0x68')](config[_0xe49c('0x69')],'server/files/images/avatars/',_0x5a3a5e['systemAvatar']);}}return _0x1110ed['download'](_0x18a7b7);}})[_0xe49c('0x18')](handleError(_0x1110ed,null));};exports['notify']=function(_0x5aed91,_0x3334f0){var _0x47511b=require(_0xe49c('0x78'));var _0x5e4ece=new _0x47511b();var _0x92bb25=_0x5e4ece[_0xe49c('0x79')](_0x5aed91['headers']['user-agent'])[_0xe49c('0x7a')]();var _0x66bd52={'body':_0x5aed91[_0xe49c('0x4b')],'channel':'chat'};var _0x3794e9=[];var _0x143258=[];var _0x4aecd3={};var _0x23c7e5=![];return db[_0xe49c('0x7b')]['describe']()[_0xe49c('0x24')](function(_0x1e5ce2){if(!_0x1e5ce2){throw new db[(_0xe49c('0x7c'))]['ValidationError'](_0xe49c('0x7d'));}_0x3794e9=_[_0xe49c('0x7e')](_['keys'](_0x1e5ce2),[_0xe49c('0x7f'),_0xe49c('0x80')]);_0x143258=_[_0xe49c('0x7e')](_[_0xe49c('0x35')](_0x1e5ce2),[_0xe49c('0x7f'),_0xe49c('0x80'),_0xe49c('0x81'),'ListId']);if(_0x5aed91['body']['id']){delete _0x5aed91[_0xe49c('0x4b')]['id'];}if(_[_0xe49c('0x6c')](_0x5aed91[_0xe49c('0x4b')][_0xe49c('0x82')])){throw new db[(_0xe49c('0x7c'))][(_0xe49c('0x83'))](_0xe49c('0x84'));}if(_[_0xe49c('0x6c')](_0x5aed91[_0xe49c('0x4b')][_0xe49c('0x4b')])||_0x5aed91[_0xe49c('0x4b')][_0xe49c('0x4b')]===''){throw new db[(_0xe49c('0x7c'))][(_0xe49c('0x83'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe49c('0x6c')](_0x5aed91[_0xe49c('0x4b')][_0xe49c('0x85')])){throw new db['Sequelize'][(_0xe49c('0x83'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x143258);}if(!_[_0xe49c('0x86')](_0x143258,_0x5aed91['body'][_0xe49c('0x85')])){throw new db[(_0xe49c('0x7c'))][(_0xe49c('0x83'))](_0xe49c('0x87')+_0x143258);}_0x4aecd3[_0x5aed91['body']['mapKey']]=_0x5aed91[_0xe49c('0x4b')][_0xe49c('0x82')];})[_0xe49c('0x24')](function(){return db['ChatWebsite'][_0xe49c('0x49')]({'where':{'id':_0x5aed91[_0xe49c('0x45')]['id']},'include':[{'model':db[_0xe49c('0x88')],'as':_0xe49c('0x89'),'include':[{'model':db[_0xe49c('0x7b')],'as':'Contacts','where':_0x4aecd3,'limit':0x1,'order':[[_0xe49c('0x80'),_0xe49c('0x8a')]]}]},{'model':db[_0xe49c('0x8b')],'as':_0xe49c('0x8c')}]});})['then'](handleEntityNotFound(_0x3334f0,null))[_0xe49c('0x24')](function(_0x51d675){if(_0x51d675&&_0x51d675[_0xe49c('0x89')]){_0x66bd52[_0xe49c('0x8d')]=_0x51d675;_0x66bd52['applications']=_0x51d675[_0xe49c('0x8c')];_0x66bd52[_0xe49c('0x8e')]=_0x51d675['List'];_0x66bd52['applications']=_['orderBy'](_0x66bd52[_0xe49c('0x8f')],[_0xe49c('0x90')],['asc']);if(_0x66bd52[_0xe49c('0x8d')][_0xe49c('0x8c')]){delete _0x66bd52[_0xe49c('0x8d')]['Applications'];}if(_0x66bd52[_0xe49c('0x8d')][_0xe49c('0x89')]&&_0x66bd52[_0xe49c('0x8d')][_0xe49c('0x89')][_0xe49c('0x91')]['length']){return _0x66bd52['account']['List'][_0xe49c('0x91')][0x0];}var _0x2d2d0c=_[_0xe49c('0x92')](_0x5aed91['body'],{'firstName':_0x5aed91[_0xe49c('0x4b')][_0xe49c('0x82')],'ListId':_0x51d675[_0xe49c('0x93')]});_0x2d2d0c[_0x5aed91['body'][_0xe49c('0x85')]]=_0x5aed91[_0xe49c('0x4b')]['from'];return db['CmContact'][_0xe49c('0x4a')](_0x2d2d0c,{'fields':_0x3794e9,'raw':!![]});}})['then'](handleEntityNotFound(_0x3334f0,null))[_0xe49c('0x24')](function(_0x32642a){_0x66bd52[_0xe49c('0x94')]=_0x32642a;var _0x18de8c=_0x5aed91['body'][_0xe49c('0x95')];if(_0x5aed91[_0xe49c('0x96')][_0xe49c('0x97')]){_0x18de8c=_0x5aed91['headers'][_0xe49c('0x97')];}else if(_0x5aed91['headers'][_0xe49c('0x98')]){_0x18de8c=_[_0xe49c('0x99')](_0x5aed91['headers']['x-forwarded-for'][_0xe49c('0x9a')](','));}if(_0x32642a){var _0x6b6f66={'ContactId':_0x32642a['id'],'ChatWebsiteId':_0x5aed91[_0xe49c('0x45')]['id'],'from':(_0x32642a[_0xe49c('0x9b')]||'')+'\x20'+(_0x32642a['lastName']||''),'customerIp':_0x18de8c,'customerPort':_0x5aed91[_0xe49c('0x96')][_0xe49c('0x9c')]?_0x5aed91[_0xe49c('0x96')][_0xe49c('0x9c')]:null,'referer':_0x5aed91[_0xe49c('0x4b')][_0xe49c('0x9d')],'browserName':_0x92bb25[_0xe49c('0x9e')][_0xe49c('0x2a')]&&_0x92bb25[_0xe49c('0x9e')][_0xe49c('0x9f')]?util[_0xe49c('0xa0')](_0xe49c('0xa1'),_0x92bb25['browser'][_0xe49c('0x2a')],_0x92bb25['browser'][_0xe49c('0x9f')]):'unknown','browserVersion':_0x92bb25[_0xe49c('0x9e')]['version']||_0xe49c('0xa2'),'osName':util[_0xe49c('0xa0')]('%s\x20%s',_0x92bb25['os'][_0xe49c('0x2a')],_0x92bb25['os']['version']),'osVersion':_0x92bb25['os'][_0xe49c('0x9f')],'deviceModel':_0x92bb25[_0xe49c('0xa3')][_0xe49c('0x37')]&&_0x92bb25[_0xe49c('0xa3')][_0xe49c('0xa4')]?util[_0xe49c('0xa0')](_0xe49c('0xa5'),_0x92bb25[_0xe49c('0xa3')]['model'],_0x92bb25['device'][_0xe49c('0xa4')],_0x92bb25['device']['type']):null,'deviceVendor':_0x92bb25[_0xe49c('0xa3')][_0xe49c('0xa4')],'deviceType':_0x92bb25[_0xe49c('0xa3')]['type'],'formData':JSON['stringify'](_0x5aed91['body'])};var _0x2a7996={'ChatWebsiteId':_0x5aed91['params']['id'],'closed':![]};if(_0x5aed91['body'][_0xe49c('0xa6')]){_0x2a7996[_0xe49c('0xa6')]=_0x5aed91[_0xe49c('0x4b')]['threadId'];return db[_0xe49c('0xa7')][_0xe49c('0x49')]({'where':_0x2a7996})[_0xe49c('0x24')](function(_0xc3b3e7){if(_0xc3b3e7){return[_0xc3b3e7,![]];}_0x6b6f66[_0xe49c('0xa6')]=_0x5aed91[_0xe49c('0x4b')]['threadId'];_0x6b6f66[_0xe49c('0xa8')]=_0x5aed91[_0xe49c('0x4b')]['externalUrl'];return db[_0xe49c('0xa7')][_0xe49c('0x4a')](_0x6b6f66)[_0xe49c('0x24')](function(_0x121595){return[_0x121595,!![]];});});}_0x2a7996[_0xe49c('0xa9')]=_0x32642a['id'];if(_0x5aed91[_0xe49c('0x4b')][_0xe49c('0xaa')]&&_0x5aed91[_0xe49c('0x4b')][_0xe49c('0xaa')]['id']){_0x2a7996['id']=_0x5aed91[_0xe49c('0x4b')][_0xe49c('0xaa')]['id'];return db[_0xe49c('0xa7')]['find']({'where':_0x2a7996})[_0xe49c('0x24')](function(_0x7b1706){if(_0x7b1706){return[_0x7b1706,![]];}return db[_0xe49c('0xa7')][_0xe49c('0x4a')](_0x6b6f66)[_0xe49c('0x24')](function(_0x1219b8){return[_0x1219b8,!![]];});});}return db['ChatInteraction'][_0xe49c('0x4a')](_0x6b6f66)['then'](function(_0x369f2d){return[_0x369f2d,!![]];});}})[_0xe49c('0xab')](function(_0x25301e,_0x427494){if(_0x25301e){_0x23c7e5=_0x427494;if(!_0x427494){var _0x19549d={'from':(_0x66bd52['contact']['firstName']||'')+'\x20'+(_0x66bd52[_0xe49c('0x94')][_0xe49c('0xac')]||'')};if(_0x5aed91[_0xe49c('0x4b')][_0xe49c('0xa6')]&&_0x5aed91[_0xe49c('0x4b')][_0xe49c('0xad')]&&_0x5aed91[_0xe49c('0x4b')][_0xe49c('0xa6')]!=_0x5aed91[_0xe49c('0x4b')]['messageId']){_0x19549d['threadId']=_0x5aed91[_0xe49c('0x4b')][_0xe49c('0xad')];}return _0x25301e[_0xe49c('0x23')](_0x19549d);}else{return _0x25301e;}}})[_0xe49c('0x24')](function(_0x15d86f){_0x66bd52[_0xe49c('0xaa')]=_0x15d86f[_0xe49c('0x26')]({'plain':!![]});_0x66bd52['interaction'][_0xe49c('0xae')]=_0x23c7e5;if(_0x66bd52[_0xe49c('0xaa')]['created']){if(_0x66bd52['account']['autoclose']){_0x66bd52[_0xe49c('0x8f')][_0xe49c('0xaf')]({'id':0x0,'priority':_0x66bd52[_0xe49c('0x8f')][_0xe49c('0x47')]+0x1,'app':_0xe49c('0xb0'),'appdata':_0xe49c('0xb1'),'interval':_0xe49c('0xb2')});}}return db[_0xe49c('0xb3')][_0xe49c('0x4a')]({'body':_0x5aed91[_0xe49c('0x4b')]['body'],'ChatWebsiteId':_0x5aed91[_0xe49c('0x45')]['id'],'ChatInteractionId':_0x15d86f['id'],'direction':'in','ContactId':_0x66bd52[_0xe49c('0x94')]['id'],'AttachmentId':_0x5aed91['body'][_0xe49c('0xb4')]});})['then'](function(_0x6ef0f2){_0x66bd52[_0xe49c('0x17')]=_0x6ef0f2;if(_0x66bd52[_0xe49c('0xaa')][_0xe49c('0xb5')]){return db['User'][_0xe49c('0x49')]({'attributes':['id',_0xe49c('0x2a')],'where':{'id':_0x66bd52[_0xe49c('0xaa')]['UserId']}})[_0xe49c('0x24')](function(_0x3f2bbe){if(_0x3f2bbe){_0x66bd52[_0xe49c('0x8f')][_0xe49c('0xb6')]({'id':0x0,'priority':0x0,'app':_0xe49c('0xb7'),'appdata':_0x3f2bbe[_0xe49c('0x2a')]+','+(_0x66bd52[_0xe49c('0x8d')][_0xe49c('0xb8')]||0xa),'interval':_0xe49c('0xb2')});_0x66bd52[_0xe49c('0xb9')]=!![];}return respondWithRpcPromise(_0xe49c('0xba'),_0xe49c('0xbb'),_0x66bd52);});}return respondWithRpcPromise(_0xe49c('0xba'),_0xe49c('0xbb'),_0x66bd52);})[_0xe49c('0x24')](function(_0x41c488){respondWithRpcPromise('EventManager',_0xe49c('0xbc'),{'event':'notify','message':_0x41c488},client9002);return _0x41c488;})[_0xe49c('0x24')](respondWithResult(_0x3334f0,null))[_0xe49c('0x18')](handleError(_0x3334f0,null));};exports[_0xe49c('0xbd')]=function(_0xc70b2,_0x2cdc04){var _0x4f8a8b,_0x74482b,_0x3ba7b9;var _0x35a90c=[];var _0x54b908={};var _0x1a5c10=_0xc70b2[_0xe49c('0xbe')]||[];var _0x341016=[];var _0x277f3f;return db['CmContact']['describe']()['then'](function(_0x24be60){if(!_0x24be60){throw new db[(_0xe49c('0x7c'))]['ValidationError'](_0xe49c('0x7d'));}_0x35a90c=_[_0xe49c('0x7e')](_['keys'](_0x24be60),[_0xe49c('0x7f'),'updatedAt',_0xe49c('0x81'),_0xe49c('0x93')]);if(_0xc70b2['body']['id']){delete _0xc70b2[_0xe49c('0x4b')]['id'];}if(_[_0xe49c('0x6c')](_0xc70b2[_0xe49c('0x4b')][_0xe49c('0x82')])){throw _0x2cdc04[_0xe49c('0x1a')](0x1f4)[_0xe49c('0x2b')](new db[(_0xe49c('0x7c'))][(_0xe49c('0x83'))](_0xe49c('0x84')));}if(_[_0xe49c('0x6c')](_0xc70b2[_0xe49c('0x4b')][_0xe49c('0x4b')])||_0xc70b2[_0xe49c('0x4b')][_0xe49c('0x4b')]===''){throw _0x2cdc04['status'](0x1f4)['send'](new db[(_0xe49c('0x7c'))][(_0xe49c('0x83'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xe49c('0x6c')](_0xc70b2[_0xe49c('0x4b')][_0xe49c('0xbf')])){throw _0x2cdc04['status'](0x1f4)['send'](new db[(_0xe49c('0x7c'))][(_0xe49c('0x83'))](_0xe49c('0xc0')+_0x35a90c));}if(!_[_0xe49c('0x86')](_0x35a90c,_0xc70b2['body'][_0xe49c('0xbf')])){throw _0x2cdc04['status'](0x1f4)['send'](new db[(_0xe49c('0x7c'))][(_0xe49c('0x83'))](_0xe49c('0xc1')+_0x35a90c));}_0x54b908[_0xc70b2[_0xe49c('0x4b')][_0xe49c('0xbf')]]=_0xc70b2[_0xe49c('0x4b')][_0xe49c('0x82')];})[_0xe49c('0x24')](function(){return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'where':{'id':_0xc70b2[_0xe49c('0x45')]['id']},'include':[{'model':db[_0xe49c('0x88')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x2cdc04,null))[_0xe49c('0x24')](function(_0x412c0a){if(_0x412c0a&&_0x412c0a[_0xe49c('0x89')]){_0x74482b=_0x412c0a;var _0x4d8e37=_[_0xe49c('0x92')](_0xc70b2[_0xe49c('0x4b')],{'firstName':_0xc70b2[_0xe49c('0x4b')][_0xe49c('0x82')],'phone':_0xc70b2[_0xe49c('0x4b')][_0xe49c('0x82')],'ListId':_0x412c0a[_0xe49c('0x93')]});_0x4d8e37[_0xc70b2[_0xe49c('0x4b')][_0xe49c('0xbf')]]=_0xc70b2[_0xe49c('0x4b')][_0xe49c('0x82')];return db[_0xe49c('0x7b')][_0xe49c('0xc2')]({'where':_0x54b908,'defaults':_0x4d8e37});}})[_0xe49c('0xab')](function(_0x31e01e){if(_0x31e01e){_0x3ba7b9=_0x31e01e;var _0x49ab67=fs[_0xe49c('0xc3')](path[_0xe49c('0x68')](config[_0xe49c('0x69')],'server/files/templates/chatOfflineMessage.ejs'),_0xe49c('0xc4'));var _0x3a5c8d=ejs[_0xe49c('0xc5')](_0x49ab67,{'body':_[_0xe49c('0xc6')](_0xc70b2[_0xe49c('0x4b')][_0xe49c('0x4b')]),'bodyTitle':_0x74482b[_0xe49c('0xc7')]});return db[_0xe49c('0xc8')][_0xe49c('0x4a')]({'body':_0x3a5c8d,'plainBody':htmlToText['fromString'](_0x3a5c8d),'ContactId':_0x31e01e['id'],'ChatWebsiteId':_0x74482b['id']});}})[_0xe49c('0x24')](function(_0x31813a){_0x277f3f=_0x31813a;if(_0x1a5c10[_0xe49c('0x47')]){var _0x2e80c5=_0x1a5c10[_0xe49c('0x2e')](function(_0x1ca231){return{'name':_0x1ca231[_0xe49c('0xc9')],'basename':_0x1ca231[_0xe49c('0x62')],'type':_0x1ca231[_0xe49c('0xca')],'ChatOfflineMessageId':_0x31813a['id']};});_0x341016=_0x2e80c5['map'](_0x302d7d=>{var _0x4fa3ec={'filename':_0x302d7d[_0xe49c('0x2a')],'path':path[_0xe49c('0x68')](config[_0xe49c('0x69')],_0xe49c('0xcb'),_0xe49c('0xbe'),_0xe49c('0xcc'),_0xe49c('0xcd'),_0x302d7d[_0xe49c('0xce')])};return _0x4fa3ec;});if(!_0x74482b[_0xe49c('0xcf')]){return db['sequelize'][_0xe49c('0xd0')](function(_0x567a44){return db['Attachment'][_0xe49c('0xd1')](_0x2e80c5,{'transaction':_0x567a44});});}}})[_0xe49c('0x24')](function(){if(_0x277f3f){_0x4f8a8b=_0x277f3f;return db[_0xe49c('0xd2')][_0xe49c('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0xe49c('0xd3')],'as':_0xe49c('0xd4'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x3661ee){if(_0x3661ee&&_0x3661ee[_0xe49c('0xd4')]&&_0x74482b['forwardOffline']&&_0x74482b[_0xe49c('0xd5')]){var _0x15acef=_0x3661ee[_0xe49c('0xd6')]();return respondWithRpcPromise(_0xe49c('0xd7'),_0xe49c('0xd8'),{'account':_0x15acef,'message':{'from':util[_0xe49c('0xa0')]('\x22%s\x22\x20<%s>',_0x3661ee[_0xe49c('0x2a')],_0x3661ee['email']||_0x3661ee['Smtp']['user']),'to':_0x74482b['forwardOfflineAddress'],'subject':_0x74482b[_0xe49c('0xd9')],'html':_0x4f8a8b['body'],'attachments':_0x341016}},client9003)[_0xe49c('0x24')](function(){return _0x4f8a8b;})[_0xe49c('0x18')](function(_0x46ffc0){logger['error'](_0x46ffc0);});}})['then'](function(){if(_0x74482b&&_0x74482b[_0xe49c('0xcf')]&&_0x74482b['MailAccountId']){var _0x19ec9e=[];if(_0x1a5c10[_0xe49c('0x47')]){_0x19ec9e=_0x1a5c10['map'](function(_0x1e71a4){return{'name':_0x1e71a4[_0xe49c('0xc9')],'basename':_0x1e71a4[_0xe49c('0x62')],'type':_0x1e71a4[_0xe49c('0xca')],'ChatOfflineMessageId':_0x277f3f['id']};});}var _0x452f9d;if(!_[_0xe49c('0x6c')](_0x74482b[_0xe49c('0xda')])){var _0x5764b0=_['map'](_0xc70b2['body'],function(_0x58aa10){return _0x58aa10;});var _0x13b525=_[_0xe49c('0xdb')](_0x5764b0)[0x0];var _0x31b39c=_[_0xe49c('0xdc')](_0x13b525,function(_0x103ac3){return _0x103ac3;});_0x452f9d=_0x31b39c[0x1][_0x74482b[_0xe49c('0xda')]];}var _0x3a1cc7={'from':_0x3ba7b9[_0xe49c('0xdd')],'firstName':_0x3ba7b9[_0xe49c('0x9b')],'lastName':_0x3ba7b9[_0xe49c('0xac')],'mapKey':_0xe49c('0xdd'),'message':{'from':_0x3ba7b9[_0xe49c('0xdd')],'to':_0x74482b[_0xe49c('0xd2')]['email'],'cc':'','subject':_[_0xe49c('0x6c')](_0x452f9d)?_0x74482b[_0xe49c('0xd9')]:_0x452f9d,'messageId':'','sentAt':new Date(),'attach':_0x19ec9e[_0xe49c('0x47')],'attachments':_0x19ec9e,'originChannel':_0xe49c('0xde'),'ChatWebsiteId':_0x74482b['id'],'ChatOfflineMessageId':_0x4f8a8b['id'],'originTo':_0x74482b[_0xe49c('0xd2')][_0xe49c('0xdd')]},'body':_0x4f8a8b[_0xe49c('0x4b')]};var _0x5ec3f7={'account':{'id':_0x74482b[_0xe49c('0xdf')]},'body':_0x3a1cc7,'log':_0xe49c('0xe0')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x5ec3f7,client9001)[_0xe49c('0x24')](function(){return _0x4f8a8b;})[_0xe49c('0x18')](function(_0x11c76d){logger[_0xe49c('0x14')](_0x11c76d);});}return;})[_0xe49c('0x24')](function(){if(_0x4f8a8b){return _0x4f8a8b;}})[_0xe49c('0x24')](respondWithResult(_0x2cdc04,null))[_0xe49c('0x18')](function(_0x466fe7){logger[_0xe49c('0x14')]('catch',_0x466fe7);for(var _0x3ffca5 of _0x1a5c10){var _0x3933a8=path[_0xe49c('0x68')](config[_0xe49c('0x69')],_0xe49c('0xcb'),_0xe49c('0xbe'),_0xe49c('0xcc'),'offline-chat',_0x3ffca5[_0xe49c('0x62')]);fs_extra[_0xe49c('0xe1')](_0x3933a8)[_0xe49c('0x18')](function(_0x1c1e65){logger[_0xe49c('0x14')](_0xe49c('0xe2'),_0x3933a8,_0x1c1e65);});}});};exports['addInteraction']=function(_0x10de7c,_0x2a3071){return db[_0xe49c('0xa7')][_0xe49c('0x49')]({'where':{'id':_0x10de7c[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x2a3071,null))[_0xe49c('0x24')](function(_0x4ff387){if(_0x4ff387){return _0x4ff387[_0xe49c('0xe3')](_0x10de7c[_0xe49c('0x4b')][_0xe49c('0x5a')],_[_0xe49c('0xe4')](_0x10de7c['body'],[_0xe49c('0x5a'),'id'])||{});}})[_0xe49c('0x24')](respondWithResult(_0x2a3071,null))[_0xe49c('0x18')](handleError(_0x2a3071,null));};exports['getInteractions']=function(_0x1c6da5,_0x46f017){var _0x1446ee={'raw':![],'where':{}};var _0x148f01={};var _0x61904f={'count':0x0,'rows':[]};return db[_0xe49c('0x2f')][_0xe49c('0x5d')]({'where':{'id':_0x1c6da5['params']['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x46f017,null))[_0xe49c('0x24')](function(_0x4ec6c8){if(_0x4ec6c8){_0x148f01[_0xe49c('0x37')]=_[_0xe49c('0x35')](db[_0xe49c('0xa7')][_0xe49c('0x30')]);_0x148f01[_0xe49c('0x34')]=_[_0xe49c('0x35')](_0x1c6da5['query']);_0x148f01[_0xe49c('0x36')]=_[_0xe49c('0x39')](_0x148f01[_0xe49c('0x37')],_0x148f01[_0xe49c('0x34')]);_0x1446ee[_0xe49c('0x38')]=_[_0xe49c('0x39')](_0x148f01[_0xe49c('0x37')],qs['fields'](_0x1c6da5[_0xe49c('0x34')]['fields']));_0x1446ee['attributes']=_0x1446ee[_0xe49c('0x38')][_0xe49c('0x47')]?_0x1446ee[_0xe49c('0x38')]:_0x148f01[_0xe49c('0x37')];if(!_0x1c6da5['query'][_0xe49c('0x3b')]('nolimit')){_0x1446ee[_0xe49c('0x1f')]=qs[_0xe49c('0x1f')](_0x1c6da5['query'][_0xe49c('0x1f')]);_0x1446ee['offset']=qs[_0xe49c('0x1d')](_0x1c6da5[_0xe49c('0x34')][_0xe49c('0x1d')]);}_0x1446ee[_0xe49c('0x3d')]=qs[_0xe49c('0x3e')](_0x1c6da5['query'][_0xe49c('0x3e')]);_0x1446ee[_0xe49c('0x3f')]=qs['filters'](_[_0xe49c('0x55')](_0x1c6da5[_0xe49c('0x34')],_0x148f01['filters']));_0x1446ee[_0xe49c('0x3f')][_0xe49c('0x56')]=_0x4ec6c8['id'];if(_0x1c6da5[_0xe49c('0x34')][_0xe49c('0x40')]){_0x1446ee['where']=_[_0xe49c('0x41')](_0x1446ee['where'],{'$or':_[_0xe49c('0x2e')](_0x1446ee[_0xe49c('0x38')],function(_0x560119){var _0x15bc64={};_0x15bc64[_0x560119]={'$like':'%'+_0x1c6da5['query'][_0xe49c('0x40')]+'%'};return _0x15bc64;})});}_0x1446ee=_[_0xe49c('0x41')]({},_0x1446ee,_0x1c6da5[_0xe49c('0x48')]);return db[_0xe49c('0xa7')][_0xe49c('0x20')]({'where':_0x1446ee[_0xe49c('0x3f')]})['then'](function(_0x3652c3){_0x61904f[_0xe49c('0x20')]=_0x3652c3;if(_0x1c6da5[_0xe49c('0x34')]['includeAll']){_0x1446ee[_0xe49c('0x58')]=[{'model':db[_0xe49c('0x7b')],'as':_0xe49c('0xe5'),'required':![]},{'model':db[_0xe49c('0xe6')],'as':_0xe49c('0xe7'),'attributes':[_0xe49c('0x2a'),'fullname',_0xe49c('0xe8')],'required':![]},{'model':db['Tag'],'as':_0xe49c('0xe9'),'attributes':['id',_0xe49c('0x2a'),_0xe49c('0xea')],'where':_0x1c6da5[_0xe49c('0x34')][_0xe49c('0xeb')]?{'id':_0x1c6da5['query']['tag']}:undefined,'required':_0x1c6da5[_0xe49c('0x34')][_0xe49c('0xeb')]?!![]:![]}];}return db[_0xe49c('0xa7')]['findAll'](_0x1446ee);})['then'](function(_0x1926c9){_0x61904f[_0xe49c('0x43')]=_0x1926c9;return _0x61904f;});}})[_0xe49c('0x24')](respondWithFilteredResult(_0x46f017,_0x1446ee))[_0xe49c('0x18')](handleError(_0x46f017,null));};function iftimePromise(_0x4fc0d1,_0x12234a){return respondWithRpcPromise(_0xe49c('0xec'),'getSnippet',{'command':_0x12234a[_0xe49c('0xed')]?util[_0xe49c('0xa0')]('iftime\x20%s,%s',_0x4fc0d1[_0xe49c('0xee')],_0x12234a[_0xe49c('0xed')]):util[_0xe49c('0xa0')](_0xe49c('0xef'),_0x4fc0d1[_0xe49c('0xee')])},client9002)[_0xe49c('0x24')](function(_0x3b8b06){var _0x2e4d14=_0x3b8b06&&_0x3b8b06[_0xe49c('0xf0')](_0xe49c('0xf1'))>=0x0?!![]:![];logger[_0xe49c('0x10')](_0xe49c('0xf2'),_0x12234a['id'],_0x4fc0d1['id'],_0x4fc0d1[_0xe49c('0xee')],_0x2e4d14?_0xe49c('0xf3'):_0xe49c('0xf4'),_0x12234a[_0xe49c('0xed')]?_0x12234a[_0xe49c('0xed')]:_0xe49c('0xf5'));return _0x2e4d14;})['catch'](function(_0x295420){logger[_0xe49c('0x14')](_0xe49c('0xf2'),_0x12234a['id'],_0x4fc0d1['id'],_0x4fc0d1[_0xe49c('0xee')],util['inspect'](_0x295420,{'showHidden':![],'depth':null}),_0x12234a['timezone']?_0x12234a['timezone']:_0xe49c('0xf5'));return![];});}exports[_0xe49c('0xf6')]=function(_0x26f890,_0x394a16){var _0x341bca=0x0;var _0x3a251d=0x0;var _0x13bb65=![];var _0x954402;var _0x2e3a14;return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'where':{'id':_0x26f890['params']['id']},'include':[{'model':db[_0xe49c('0xf7')],'as':_0xe49c('0xf7'),'include':[{'model':db[_0xe49c('0xf7')],'as':'Intervals','attributes':['id',_0xe49c('0xee')],'raw':!![]}]}]})[_0xe49c('0x24')](handleEntityNotFound(_0x394a16,null))[_0xe49c('0x24')](function(_0x335de4){if(_0x335de4){_0x954402=_0x335de4;return _0x335de4[_0xe49c('0xf8')]({'raw':!![]});}})[_0xe49c('0x24')](function(_0x5bd215){if(_0x954402){if(_0x5bd215){_0x2e3a14=_0x5bd215;}}return require(_0xe49c('0xf9'))[_0xe49c('0xfa')]();})[_0xe49c('0x24')](function(_0x5d2add){if(_0x5d2add){_0x3a251d=_0x5d2add[_0xe49c('0xfb')];_0x13bb65=_0x5d2add[_0xe49c('0x6b')];}})[_0xe49c('0x24')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xe49c('0x24')](function(_0x44998a){_0x341bca=_0x44998a;if(_0x3a251d&&_0x44998a>_0x3a251d){return db[_0xe49c('0xfc')][_0xe49c('0x5d')]({'where':{'id':0x1}})[_0xe49c('0x24')](function(_0x55ddf5){if(_0x55ddf5){_0x55ddf5[_0xe49c('0xfd')]('chatLicenseExceeded');}});}})[_0xe49c('0x24')](function(){if(_0x954402[_0xe49c('0xf7')]&&_0x954402[_0xe49c('0xf7')][_0xe49c('0xfe')]){var _0xc09b02=[];for(var _0x48d7bc=0x0;_0x48d7bc<_0x954402[_0xe49c('0xf7')]['Intervals'][_0xe49c('0x47')];_0x48d7bc++){var _0xeb17af=_0x954402[_0xe49c('0xf7')][_0xe49c('0xfe')][_0x48d7bc]['get']({'plain':!![]});_0xc09b02[_0xe49c('0xaf')](iftimePromise(_0xeb17af,_0x954402));}return BPromise['all'](_0xc09b02)[_0xe49c('0x24')](function(_0x1ed58e){return _[_0xe49c('0xff')](_0x1ed58e);});}else{return!![];}})[_0xe49c('0x24')](function(_0x29fd78){var _0x11edb6=fs['readFileSync'](path[_0xe49c('0x68')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0x33c747=new url[(_0xe49c('0x100'))](_0x954402[_0xe49c('0x101')])[_0xe49c('0x102')];var _0x54bc2f='3.1.0';var _0x18fd0b=![];var _0x5d717b={'chatVersion':_0x54bc2f,'chatWebsiteAddressOrigin':_0x33c747,'remote':_0x954402[_0xe49c('0x103')],'query':querystring[_0xe49c('0x104')](_[_0xe49c('0x41')](_0x954402[_0xe49c('0x26')]({'plain':!![]}),{'customerIp':_0x26f890[_0xe49c('0x96')][_0xe49c('0x98')]||_0x26f890[_0xe49c('0x96')][_0xe49c('0x105')]||_0x26f890[_0xe49c('0x106')][_0xe49c('0x107')]||_0x26f890['ip'],'referer':_0x26f890[_0xe49c('0x96')]['referer'],'openedInteractions':_0x341bca,'maxInteractions':_0x3a251d,'virtual':_0x13bb65['virtual'],'online':_0x29fd78,'custom':_0x13bb65}))[_0xe49c('0x108')](/'/g,'\x5c\x27')};_0x394a16['send'](ejs[_0xe49c('0xc5')](Mustache['render'](_0x11edb6,_0x5d717b),{'proactiveActions':_0x2e3a14,'alignment':_0x954402[_0xe49c('0x109')],'verticalAlignment':_0x954402[_0xe49c('0x10a')],'div_color':_0x954402['color'],'labelText':_0x954402[_0xe49c('0x10b')],'text_color':_0x954402[_0xe49c('0x10c')],'text_button_color':_0x954402[_0xe49c('0x10d')],'button_color':_0x954402[_0xe49c('0x10e')],'background_color':_0x954402[_0xe49c('0x10f')],'hideWhenOffline':_0x954402[_0xe49c('0x110')],'intervalId':_0x954402[_0xe49c('0x111')],'isDevelopment':_0x18fd0b,'chatVersion':_0x54bc2f}));})[_0xe49c('0x18')](handleError(_0x394a16,null));};exports[_0xe49c('0x112')]=function(_0x5138dc,_0x285dc1){var _0x31c2f9=_0x5138dc[_0xe49c('0x45')]['id'];var _0x26090e=_0x5138dc[_0xe49c('0x4b')];var _0x55679=0xc8;var _0x2bb7fd=null;return db[_0xe49c('0x113')]['transaction']({'isolationLevel':db[_0xe49c('0x113')][_0xe49c('0x114')][_0xe49c('0x115')][_0xe49c('0x116')]},function(_0x1dce0b){return db[_0xe49c('0x2f')][_0xe49c('0x5d')]({'where':{'id':_0x31c2f9},'transaction':_0x1dce0b})['then'](function(_0x3b57c5){if(_0x3b57c5){return db[_0xe49c('0x8b')]['destroy']({'where':{'ChatWebsiteId':_0x31c2f9},'transaction':_0x1dce0b})['then'](function(){var _0x1e9f72=_[_0xe49c('0x2e')](_0x26090e,function(_0x4a8810){_0x4a8810['ChatWebsiteId']=_0x31c2f9;return _0x4a8810;});return db[_0xe49c('0x8b')][_0xe49c('0xd1')](_0x1e9f72,{'transaction':_0x1dce0b});});}else{_0x55679=0x194;_0x2bb7fd=[];}});})[_0xe49c('0x24')](function(){if(_0x55679!==0x194){return db[_0xe49c('0x8b')][_0xe49c('0x117')]({'where':{'ChatWebsiteId':_0x31c2f9},'order':_0xe49c('0x90')})['then'](function(_0xcfac53){_0x2bb7fd=_0xcfac53;});}})[_0xe49c('0x18')](function(_0x398d61){_0x55679=0x1f4;logger[_0xe49c('0x14')](_0x398d61[_0xe49c('0x29')]);if(_0x398d61[_0xe49c('0x2a')]){delete _0x398d61[_0xe49c('0x2a')];}_0x2bb7fd=_0x398d61;})[_0xe49c('0x118')](function(){if(_0x2bb7fd===null){_0x285dc1['sendStatus'](_0x55679);}else{if(_0x55679===0x1f4){_0x285dc1[_0xe49c('0x1a')](_0x55679)[_0xe49c('0x2b')](_0x2bb7fd);}else{_0x285dc1[_0xe49c('0x1a')](_0x55679)[_0xe49c('0x1c')](_0x2bb7fd);}}});};exports[_0xe49c('0x119')]=function(_0x271c61,_0x3d30b0){var _0x19acaf={};var _0x306d00={};var _0x35c5af;var _0x50df8a;return db[_0xe49c('0x2f')][_0xe49c('0x5d')]({'where':{'id':_0x271c61[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x3d30b0,null))[_0xe49c('0x24')](function(_0x3da1b0){if(_0x3da1b0){_0x35c5af=_0x3da1b0;_0x306d00[_0xe49c('0x37')]=_['keys'](db[_0xe49c('0x8b')][_0xe49c('0x30')]);_0x306d00[_0xe49c('0x34')]=_[_0xe49c('0x35')](_0x271c61[_0xe49c('0x34')]);_0x306d00[_0xe49c('0x36')]=_[_0xe49c('0x39')](_0x306d00[_0xe49c('0x37')],_0x306d00[_0xe49c('0x34')]);_0x19acaf[_0xe49c('0x38')]=_[_0xe49c('0x39')](_0x306d00[_0xe49c('0x37')],qs[_0xe49c('0x3a')](_0x271c61[_0xe49c('0x34')][_0xe49c('0x3a')]));_0x19acaf['attributes']=_0x19acaf[_0xe49c('0x38')][_0xe49c('0x47')]?_0x19acaf['attributes']:_0x306d00[_0xe49c('0x37')];_0x19acaf[_0xe49c('0x3d')]=qs[_0xe49c('0x3e')](_0x271c61['query'][_0xe49c('0x3e')]);_0x19acaf[_0xe49c('0x3f')]=qs[_0xe49c('0x36')](_[_0xe49c('0x55')](_0x271c61['query'],_0x306d00['filters']));if(_0x271c61[_0xe49c('0x34')][_0xe49c('0x40')]){_0x19acaf[_0xe49c('0x3f')]=_[_0xe49c('0x41')](_0x19acaf[_0xe49c('0x3f')],{'$or':_[_0xe49c('0x2e')](_0x19acaf[_0xe49c('0x38')],function(_0x2d5c91){var _0x76f940={};_0x76f940[_0x2d5c91]={'$like':'%'+_0x271c61[_0xe49c('0x34')][_0xe49c('0x40')]+'%'};return _0x76f940;})});}_0x19acaf=_[_0xe49c('0x41')]({},_0x19acaf,_0x271c61[_0xe49c('0x48')]);return _0x35c5af[_0xe49c('0x119')](_0x19acaf);}})['then'](function(_0x1bd815){if(_0x1bd815){_0x50df8a=_0x1bd815[_0xe49c('0x47')];if(!_0x271c61['query'][_0xe49c('0x3b')](_0xe49c('0x3c'))){_0x19acaf[_0xe49c('0x1f')]=qs['limit'](_0x271c61[_0xe49c('0x34')]['limit']);_0x19acaf[_0xe49c('0x1d')]=qs[_0xe49c('0x1d')](_0x271c61['query'][_0xe49c('0x1d')]);}return _0x35c5af[_0xe49c('0x119')](_0x19acaf);}})[_0xe49c('0x24')](function(_0x599c9c){if(_0x599c9c){return _0x599c9c?{'count':_0x50df8a,'rows':_0x599c9c}:null;}})[_0xe49c('0x24')](respondWithResult(_0x3d30b0,null))['catch'](handleError(_0x3d30b0,null));};exports['addProactiveActions']=function(_0x27d1cd,_0x31fd5e){return db['chatProactiveAction'][_0xe49c('0x49')]({'where':{'id':_0x27d1cd[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x31fd5e,null))[_0xe49c('0x24')](function(_0x17ff24){if(_0x17ff24){return _0x17ff24[_0xe49c('0x11a')](_0x27d1cd['body'][_0xe49c('0x5a')],_['omit'](_0x27d1cd[_0xe49c('0x4b')],[_0xe49c('0x5a'),'id'])||{});}})[_0xe49c('0x24')](respondWithResult(_0x31fd5e,null))[_0xe49c('0x18')](handleError(_0x31fd5e,null));};exports[_0xe49c('0xf8')]=function(_0x7cb665,_0xe3436e){var _0xf10535={};var _0x4db4c5={};var _0x159c71;var _0x12e926;return db['ChatWebsite'][_0xe49c('0x5d')]({'where':{'id':_0x7cb665[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0xe3436e,null))[_0xe49c('0x24')](function(_0x1c6c9d){if(_0x1c6c9d){_0x159c71=_0x1c6c9d;_0x4db4c5['model']=_[_0xe49c('0x35')](db[_0xe49c('0x11b')][_0xe49c('0x30')]);_0x4db4c5['query']=_[_0xe49c('0x35')](_0x7cb665[_0xe49c('0x34')]);_0x4db4c5['filters']=_[_0xe49c('0x39')](_0x4db4c5[_0xe49c('0x37')],_0x4db4c5[_0xe49c('0x34')]);_0xf10535['attributes']=_[_0xe49c('0x39')](_0x4db4c5[_0xe49c('0x37')],qs[_0xe49c('0x3a')](_0x7cb665[_0xe49c('0x34')][_0xe49c('0x3a')]));_0xf10535[_0xe49c('0x38')]=_0xf10535[_0xe49c('0x38')][_0xe49c('0x47')]?_0xf10535[_0xe49c('0x38')]:_0x4db4c5[_0xe49c('0x37')];_0xf10535[_0xe49c('0x3d')]=qs[_0xe49c('0x3e')](_0x7cb665['query'][_0xe49c('0x3e')]);_0xf10535[_0xe49c('0x3f')]=qs['filters'](_['pick'](_0x7cb665[_0xe49c('0x34')],_0x4db4c5['filters']));if(_0x7cb665['query'][_0xe49c('0x40')]){_0xf10535[_0xe49c('0x3f')]=_[_0xe49c('0x41')](_0xf10535[_0xe49c('0x3f')],{'$or':_[_0xe49c('0x2e')](_0xf10535[_0xe49c('0x38')],function(_0x391e87){var _0x48130e={};_0x48130e[_0x391e87]={'$like':'%'+_0x7cb665[_0xe49c('0x34')][_0xe49c('0x40')]+'%'};return _0x48130e;})});}_0xf10535=_[_0xe49c('0x41')]({},_0xf10535,_0x7cb665[_0xe49c('0x48')]);return _0x159c71['getProactiveActions'](_0xf10535);}})['then'](function(_0xb69b57){if(_0xb69b57){_0x12e926=_0xb69b57[_0xe49c('0x47')];if(!_0x7cb665['query']['hasOwnProperty'](_0xe49c('0x3c'))){_0xf10535[_0xe49c('0x1f')]=qs[_0xe49c('0x1f')](_0x7cb665[_0xe49c('0x34')]['limit']);_0xf10535[_0xe49c('0x1d')]=qs['offset'](_0x7cb665[_0xe49c('0x34')][_0xe49c('0x1d')]);}return _0x159c71[_0xe49c('0xf8')](_0xf10535);}})[_0xe49c('0x24')](function(_0x5bbf98){if(_0x5bbf98){return _0x5bbf98?{'count':_0x12e926,'rows':_0x5bbf98}:null;}})[_0xe49c('0x24')](respondWithResult(_0xe3436e,null))[_0xe49c('0x18')](handleError(_0xe3436e,null));};exports[_0xe49c('0x11c')]=function(_0x2a3d0b,_0x3ac575){var _0x895917=_0x2a3d0b[_0xe49c('0x34')]['online']===_0xe49c('0x11d')?_0xe49c('0x11e'):'onlineForm';return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'attributes':['id',_0x895917],'where':{'id':_0x2a3d0b[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x3ac575,null))[_0xe49c('0x24')](function(_0x37d0e1){if(_0x37d0e1){var _0x16484b=_0x37d0e1[_0x895917];var _0x53e4b3=_0x16484b&&_0x16484b['items']?_0x16484b[_0xe49c('0x11f')]:[];_0x3ac575[_0xe49c('0x2b')]({'fromKey':_[_0xe49c('0x6c')](_0x16484b['fromKey'])?undefined:_0x16484b[_0xe49c('0x120')],'count':_0x53e4b3[_0xe49c('0x47')],'rows':_0x53e4b3});}})[_0xe49c('0x18')](handleError(_0x3ac575,null));};exports[_0xe49c('0x121')]=function(_0x3c7f27,_0x2077c3){var _0x1eb64c={'raw':![],'where':{}};var _0x346aa0={};var _0x3a96ea={'count':0x0,'rows':[]};return db[_0xe49c('0x2f')][_0xe49c('0x5d')]({'where':{'id':_0x3c7f27[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x2077c3,null))[_0xe49c('0x24')](function(_0x21ec8f){if(_0x21ec8f){_0x346aa0[_0xe49c('0x37')]=_['keys'](db[_0xe49c('0xc8')][_0xe49c('0x30')]);_0x346aa0[_0xe49c('0x34')]=_[_0xe49c('0x35')](_0x3c7f27[_0xe49c('0x34')]);_0x346aa0[_0xe49c('0x36')]=_[_0xe49c('0x39')](_0x346aa0[_0xe49c('0x37')],_0x346aa0[_0xe49c('0x34')]);_0x1eb64c[_0xe49c('0x38')]=_[_0xe49c('0x39')](_0x346aa0[_0xe49c('0x37')],qs['fields'](_0x3c7f27[_0xe49c('0x34')][_0xe49c('0x3a')]));_0x1eb64c[_0xe49c('0x38')]=_0x1eb64c[_0xe49c('0x38')][_0xe49c('0x47')]?_0x1eb64c[_0xe49c('0x38')]:_0x346aa0[_0xe49c('0x37')];if(!_0x3c7f27[_0xe49c('0x34')][_0xe49c('0x3b')](_0xe49c('0x3c'))){_0x1eb64c[_0xe49c('0x1f')]=qs[_0xe49c('0x1f')](_0x3c7f27[_0xe49c('0x34')][_0xe49c('0x1f')]);_0x1eb64c[_0xe49c('0x1d')]=qs[_0xe49c('0x1d')](_0x3c7f27[_0xe49c('0x34')][_0xe49c('0x1d')]);}_0x1eb64c[_0xe49c('0x3d')]=qs[_0xe49c('0x3e')](_0x3c7f27[_0xe49c('0x34')][_0xe49c('0x3e')]);_0x1eb64c['where']=qs['filters'](_[_0xe49c('0x55')](_0x3c7f27['query'],_0x346aa0[_0xe49c('0x36')]));_0x1eb64c[_0xe49c('0x3f')][_0xe49c('0x56')]=_0x21ec8f['id'];if(_0x3c7f27[_0xe49c('0x34')][_0xe49c('0x40')]){_0x1eb64c['where']=_[_0xe49c('0x41')](_0x1eb64c[_0xe49c('0x3f')],{'$or':_[_0xe49c('0x2e')](_0x1eb64c['attributes'],function(_0x59b64b){var _0x5d0d80={};_0x5d0d80[_0x59b64b]={'$like':'%'+_0x3c7f27[_0xe49c('0x34')]['filter']+'%'};return _0x5d0d80;})});}_0x1eb64c=_[_0xe49c('0x41')]({},_0x1eb64c,_0x3c7f27['options']);return db[_0xe49c('0xc8')][_0xe49c('0x20')]({'where':_0x1eb64c[_0xe49c('0x3f')]})[_0xe49c('0x24')](function(_0x2593f9){_0x3a96ea[_0xe49c('0x20')]=_0x2593f9;if(_0x3c7f27[_0xe49c('0x34')][_0xe49c('0x57')]){_0x1eb64c[_0xe49c('0x58')]=[{'all':!![]}];}else{_0x1eb64c[_0xe49c('0x58')]=[{'model':db['CmContact'],'as':_0xe49c('0xe5'),'required':![]},{'model':db[_0xe49c('0x122')],'as':_0xe49c('0x123'),'required':![]}];}return db[_0xe49c('0xc8')][_0xe49c('0x42')](_0x1eb64c);})[_0xe49c('0x24')](function(_0x10205e){_0x3a96ea[_0xe49c('0x43')]=_0x10205e;return _0x3a96ea;});}})[_0xe49c('0x24')](respondWithFilteredResult(_0x2077c3,_0x1eb64c))[_0xe49c('0x18')](handleError(_0x2077c3,null));};exports['addAgents']=function(_0x4811d8,_0x1296ed){return db['ChatWebsite'][_0xe49c('0x49')]({'where':{'id':_0x4811d8[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x1296ed,null))['then'](function(_0x2b2ea6){if(_0x2b2ea6){return _0x2b2ea6[_0xe49c('0x124')](_0x4811d8[_0xe49c('0x4b')][_0xe49c('0x5a')],_[_0xe49c('0xe4')](_0x4811d8[_0xe49c('0x4b')],[_0xe49c('0x5a'),'id'])||{})[_0xe49c('0xab')](function(_0x35eb34){for(var _0xa5611a=0x0;_0xa5611a<_0x4811d8[_0xe49c('0x4b')][_0xe49c('0x5a')][_0xe49c('0x47')];_0xa5611a+=0x1){socket[_0xe49c('0x125')](_0xe49c('0x126'),{'UserId':Number(_0x4811d8[_0xe49c('0x4b')][_0xe49c('0x5a')][_0xa5611a]),'ChatWebsiteId':Number(_0x4811d8[_0xe49c('0x45')]['id'])});}return _0x35eb34;});}})[_0xe49c('0x24')](respondWithResult(_0x1296ed,null))[_0xe49c('0x18')](handleError(_0x1296ed,null));};exports['removeAgents']=function(_0x1cb864,_0x10b1e5){return db[_0xe49c('0x2f')][_0xe49c('0x49')]({'where':{'id':_0x1cb864[_0xe49c('0x45')]['id']}})['then'](handleEntityNotFound(_0x10b1e5,null))['then'](function(_0x121383){if(_0x121383){return _0x121383['removeAgents'](_0x1cb864[_0xe49c('0x34')][_0xe49c('0x5a')])['then'](function(){if(_[_0xe49c('0x127')](_0x1cb864[_0xe49c('0x34')][_0xe49c('0x5a')])){for(var _0x2383b5=0x0;_0x2383b5<_0x1cb864['query']['ids'][_0xe49c('0x47')];_0x2383b5+=0x1){socket[_0xe49c('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x1cb864[_0xe49c('0x34')][_0xe49c('0x5a')][_0x2383b5]),'ChatWebsiteId':Number(_0x1cb864[_0xe49c('0x45')]['id'])});}}else{socket[_0xe49c('0x125')](_0xe49c('0x128'),{'UserId':Number(_0x1cb864[_0xe49c('0x34')]['ids']),'ChatWebsiteId':Number(_0x1cb864[_0xe49c('0x45')]['id'])});}});}})[_0xe49c('0x24')](respondWithStatusCode(_0x10b1e5,null))[_0xe49c('0x18')](handleError(_0x10b1e5,null));};exports[_0xe49c('0x129')]=function(_0x15d41f,_0x299855){var _0x358f5e={};var _0x359c93={};var _0x426eb6;var _0x57e61d;return db[_0xe49c('0x2f')][_0xe49c('0x5d')]({'where':{'id':_0x15d41f[_0xe49c('0x45')]['id']}})[_0xe49c('0x24')](handleEntityNotFound(_0x299855,null))[_0xe49c('0x24')](function(_0x5aa1ef){if(_0x5aa1ef){_0x426eb6=_0x5aa1ef;_0x359c93['model']=_[_0xe49c('0x35')](db[_0xe49c('0xe6')][_0xe49c('0x30')]);_0x359c93[_0xe49c('0x34')]=_[_0xe49c('0x35')](_0x15d41f[_0xe49c('0x34')]);_0x359c93['filters']=_[_0xe49c('0x39')](_0x359c93['model'],_0x359c93[_0xe49c('0x34')]);_0x358f5e[_0xe49c('0x38')]=_[_0xe49c('0x39')](_0x359c93[_0xe49c('0x37')],qs[_0xe49c('0x3a')](_0x15d41f[_0xe49c('0x34')][_0xe49c('0x3a')]));_0x358f5e[_0xe49c('0x38')]=_0x358f5e[_0xe49c('0x38')][_0xe49c('0x47')]?_0x358f5e[_0xe49c('0x38')]:_0x359c93[_0xe49c('0x37')];_0x358f5e[_0xe49c('0x3d')]=qs[_0xe49c('0x3e')](_0x15d41f[_0xe49c('0x34')]['sort']);_0x358f5e[_0xe49c('0x3f')]=qs[_0xe49c('0x36')](_['pick'](_0x15d41f[_0xe49c('0x34')],_0x359c93['filters']));if(_0x15d41f[_0xe49c('0x34')][_0xe49c('0x40')]){_0x358f5e[_0xe49c('0x3f')]=_['merge'](_0x358f5e['where'],{'$or':_[_0xe49c('0x2e')](_0x358f5e[_0xe49c('0x38')],function(_0x39e475){var _0x36f194={};_0x36f194[_0x39e475]={'$like':'%'+_0x15d41f['query']['filter']+'%'};return _0x36f194;})});}_0x358f5e=_[_0xe49c('0x41')]({},_0x358f5e,_0x15d41f['options']);return _0x426eb6[_0xe49c('0x129')](_0x358f5e);}})[_0xe49c('0x24')](function(_0x52f025){if(_0x52f025){_0x57e61d=_0x52f025['length'];if(!_0x15d41f[_0xe49c('0x34')]['hasOwnProperty'](_0xe49c('0x3c'))){_0x358f5e['limit']=qs[_0xe49c('0x1f')](_0x15d41f[_0xe49c('0x34')][_0xe49c('0x1f')]);_0x358f5e[_0xe49c('0x1d')]=qs[_0xe49c('0x1d')](_0x15d41f[_0xe49c('0x34')]['offset']);}return _0x426eb6['getAgents'](_0x358f5e);}})[_0xe49c('0x24')](function(_0x31ed07){if(_0x31ed07){return _0x31ed07?{'count':_0x57e61d,'rows':_0x31ed07}:null;}})[_0xe49c('0x24')](respondWithResult(_0x299855,null))[_0xe49c('0x18')](handleError(_0x299855,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index d6d1dcb..7121e9a 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 _0xa9b1=['exports','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x1a9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1a9b('0x1')](0x0);var events={'afterCreate':_0x1a9b('0x2'),'afterUpdate':_0x1a9b('0x3'),'afterDestroy':_0x1a9b('0x4')};function emitEvent(_0x10c90c){return function(_0x52f55f,_0x57b453,_0x4914cd){ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c+':'+_0x52f55f['id'],_0x52f55f);ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c,_0x52f55f);_0x4914cd(null);};}for(var e in events){if(events[_0x1a9b('0x6')](e)){var event=events[e];ChatWebsite[_0x1a9b('0x7')](e,emitEvent(event));}}module[_0x1a9b('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xae1c=['hasOwnProperty','hook','exports','save','update','remove','emit'];(function(_0xec9c4e,_0x1f3b34){var _0x49cf7b=function(_0x34c86d){while(--_0x34c86d){_0xec9c4e['push'](_0xec9c4e['shift']());}};_0x49cf7b(++_0x1f3b34);}(_0xae1c,0xff));var _0xcae1=function(_0x31b1ab,_0x384147){_0x31b1ab=_0x31b1ab-0x0;var _0x58ed0a=_0xae1c[_0x31b1ab];return _0x58ed0a;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcae1('0x0'),'afterUpdate':_0xcae1('0x1'),'afterDestroy':_0xcae1('0x2')};function emitEvent(_0x32bfaa){return function(_0x1d37db,_0x2b6b57,_0x3d11cb){ChatWebsiteEvents[_0xcae1('0x3')](_0x32bfaa+':'+_0x1d37db['id'],_0x1d37db);ChatWebsiteEvents[_0xcae1('0x3')](_0x32bfaa,_0x1d37db);_0x3d11cb(null);};}for(var e in events){if(events[_0xcae1('0x4')](e)){var event=events[e];ChatWebsite[_0xcae1('0x5')](e,emitEvent(event));}}module[_0xcae1('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 843a767..f9ec6f8 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 _0x8704=['rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird'];(function(_0x58ce43,_0x4b7288){var _0x1351cd=function(_0x1664fd){while(--_0x1664fd){_0x58ce43['push'](_0x58ce43['shift']());}};_0x1351cd(++_0x4b7288);}(_0x8704,0x1ea));var _0x4870=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x8704[_0x15876a];return _0xbd900f;};'use strict';var _=require(_0x4870('0x0'));var util=require('util');var logger=require(_0x4870('0x1'))(_0x4870('0x2'));var moment=require(_0x4870('0x3'));var BPromise=require(_0x4870('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4870('0x5'));var config=require(_0x4870('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x4870('0x7')]=function(_0x44e866,_0x1dd9e3){return _0x44e866[_0x4870('0x8')](_0x4870('0x9'),attributes,{'tableName':_0x4870('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8adf=['define','lodash','util','../../config/logger','api','moment','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x2b4863,_0x25df31){var _0x49ab47=function(_0x8eea98){while(--_0x8eea98){_0x2b4863['push'](_0x2b4863['shift']());}};_0x49ab47(++_0x25df31);}(_0x8adf,0x1af));var _0xf8ad=function(_0xb47687,_0x4419f1){_0xb47687=_0xb47687-0x0;var _0x3c8516=_0x8adf[_0xb47687];return _0x3c8516;};'use strict';var _=require(_0xf8ad('0x0'));var util=require(_0xf8ad('0x1'));var logger=require(_0xf8ad('0x2'))(_0xf8ad('0x3'));var moment=require(_0xf8ad('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8ad('0x5'));var rimraf=require('rimraf');var config=require(_0xf8ad('0x6'));var attributes=require(_0xf8ad('0x7'));module[_0xf8ad('0x8')]=function(_0x4a1820,_0x2a6ec8){return _0x4a1820[_0xf8ad('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','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 cffcbe4..af474ba 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 _0xf2c3=['ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0xe3cdba,_0x3b92d0){var _0x3afefa=function(_0x1d9662){while(--_0x1d9662){_0xe3cdba['push'](_0xe3cdba['shift']());}};_0x3afefa(++_0x3b92d0);}(_0xf2c3,0x6c));var _0x3f2c=function(_0x15781b,_0x4db9bb){_0x15781b=_0x15781b-0x0;var _0x20f955=_0xf2c3[_0x15781b];return _0x20f955;};'use strict';var _=require('lodash');var util=require(_0x3f2c('0x0'));var moment=require(_0x3f2c('0x1'));var BPromise=require(_0x3f2c('0x2'));var rs=require(_0x3f2c('0x3'));var fs=require('fs');var Redis=require(_0x3f2c('0x4'));var db=require(_0x3f2c('0x5'))['db'];var utils=require(_0x3f2c('0x6'));var logger=require(_0x3f2c('0x7'))(_0x3f2c('0x8'));var config=require(_0x3f2c('0x9'));var jayson=require(_0x3f2c('0xa'));var client=jayson[_0x3f2c('0xb')][_0x3f2c('0xc')]({'port':0x232a});config[_0x3f2c('0xd')]=_['defaults'](config[_0x3f2c('0xd')],{'host':_0x3f2c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3f2c('0xf'))['register'](socket);function respondWithRpcPromise(_0x5088f1,_0x14c818,_0x1874b2){return new BPromise(function(_0x50ff46,_0x1e433a){return client[_0x3f2c('0x10')](_0x5088f1,_0x1874b2)['then'](function(_0x23ef11){logger[_0x3f2c('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x14c818,'request\x20sent');logger['debug'](_0x3f2c('0x12'),_0x14c818,_0x3f2c('0x13'),JSON['stringify'](_0x23ef11));if(_0x23ef11[_0x3f2c('0x14')]){if(_0x23ef11[_0x3f2c('0x14')][_0x3f2c('0x15')]===0x1f4){logger[_0x3f2c('0x14')](_0x3f2c('0x16'),_0x14c818,_0x23ef11[_0x3f2c('0x14')][_0x3f2c('0x17')]);return _0x1e433a(_0x23ef11[_0x3f2c('0x14')][_0x3f2c('0x17')]);}logger[_0x3f2c('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x14c818,_0x23ef11['error'][_0x3f2c('0x17')]);return _0x50ff46(_0x23ef11['error']['message']);}else{logger[_0x3f2c('0x11')](_0x3f2c('0x16'),_0x14c818,'request\x20sent');_0x50ff46(_0x23ef11[_0x3f2c('0x18')]['message']);}})[_0x3f2c('0x19')](function(_0x3ab112){logger[_0x3f2c('0x14')](_0x3f2c('0x16'),_0x14c818,_0x3ab112);_0x1e433a(_0x3ab112);});});}
\ No newline at end of file
+var _0x1c77=['rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','redis','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x204b3b,_0x90528c){var _0x212141=function(_0x2aa809){while(--_0x2aa809){_0x204b3b['push'](_0x204b3b['shift']());}};_0x212141(++_0x90528c);}(_0x1c77,0x164));var _0x71c7=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x1c77[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x71c7('0x0'));var util=require(_0x71c7('0x1'));var moment=require(_0x71c7('0x2'));var BPromise=require(_0x71c7('0x3'));var rs=require(_0x71c7('0x4'));var fs=require('fs');var Redis=require(_0x71c7('0x5'));var db=require(_0x71c7('0x6'))['db'];var utils=require(_0x71c7('0x7'));var logger=require('../../config/logger')(_0x71c7('0x8'));var config=require(_0x71c7('0x9'));var jayson=require(_0x71c7('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x71c7('0xb')](config['redis'],{'host':_0x71c7('0xc'),'port':0x18eb});var socket=require(_0x71c7('0xd'))(new Redis(config[_0x71c7('0xe')]));require('./chatWebsite.socket')[_0x71c7('0xf')](socket);function respondWithRpcPromise(_0x1951e9,_0x1a6e36,_0x5b8ee5){return new BPromise(function(_0x3ad3e8,_0x2aeb6d){return client[_0x71c7('0x10')](_0x1951e9,_0x5b8ee5)[_0x71c7('0x11')](function(_0x4d5746){logger[_0x71c7('0x12')](_0x71c7('0x13'),_0x1a6e36,'request\x20sent');logger[_0x71c7('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1a6e36,_0x71c7('0x15'),JSON[_0x71c7('0x16')](_0x4d5746));if(_0x4d5746[_0x71c7('0x17')]){if(_0x4d5746[_0x71c7('0x17')][_0x71c7('0x18')]===0x1f4){logger[_0x71c7('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a6e36,_0x4d5746[_0x71c7('0x17')][_0x71c7('0x19')]);return _0x2aeb6d(_0x4d5746[_0x71c7('0x17')][_0x71c7('0x19')]);}logger['error'](_0x71c7('0x13'),_0x1a6e36,_0x4d5746[_0x71c7('0x17')]['message']);return _0x3ad3e8(_0x4d5746[_0x71c7('0x17')]['message']);}else{logger['info'](_0x71c7('0x13'),_0x1a6e36,'request\x20sent');_0x3ad3e8(_0x4d5746[_0x71c7('0x1a')][_0x71c7('0x19')]);}})[_0x71c7('0x1b')](function(_0x479d55){logger[_0x71c7('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1a6e36,_0x479d55);_0x2aeb6d(_0x479d55);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 49209bc..b9dfbfe 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 _0xa7e8=['save','remove','update','emit','removeListener','length','./chatWebsite.events'];(function(_0x44591b,_0x148970){var _0xbb9e05=function(_0x1d37eb){while(--_0x1d37eb){_0x44591b['push'](_0x44591b['shift']());}};_0xbb9e05(++_0x148970);}(_0xa7e8,0xb5));var _0x8a7e=function(_0x2259d8,_0x47c9a1){_0x2259d8=_0x2259d8-0x0;var _0x291060=_0xa7e8[_0x2259d8];return _0x291060;};'use strict';var ChatWebsiteEvents=require(_0x8a7e('0x0'));var events=[_0x8a7e('0x1'),_0x8a7e('0x2'),_0x8a7e('0x3')];function createListener(_0x439c55,_0x445f83){return function(_0x39e35a){_0x445f83[_0x8a7e('0x4')](_0x439c55,_0x39e35a);};}function removeListener(_0x23ecc4,_0x26f80d){return function(){ChatWebsiteEvents[_0x8a7e('0x5')](_0x23ecc4,_0x26f80d);};}exports['register']=function(_0x44872a){for(var _0x36e5be=0x0,_0x1860e6=events[_0x8a7e('0x6')];_0x36e5be<_0x1860e6;_0x36e5be++){var _0x1f7a52=events[_0x36e5be];var _0x4a5199=createListener('chatWebsite:'+_0x1f7a52,_0x44872a);ChatWebsiteEvents['on'](_0x1f7a52,_0x4a5199);}};
\ No newline at end of file
+var _0xca19=['removeListener','register','save','remove','emit'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0xca19,0x10b));var _0x9ca1=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xca19[_0x1b7368];return _0x25d54c;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x9ca1('0x0'),_0x9ca1('0x1'),'update'];function createListener(_0x3b5d00,_0x21df07){return function(_0x4b2036){_0x21df07[_0x9ca1('0x2')](_0x3b5d00,_0x4b2036);};}function removeListener(_0x3a17ef,_0x451e21){return function(){ChatWebsiteEvents[_0x9ca1('0x3')](_0x3a17ef,_0x451e21);};}exports[_0x9ca1('0x4')]=function(_0x46949c){for(var _0x49e6cd=0x0,_0x5b373e=events['length'];_0x49e6cd<_0x5b373e;_0x49e6cd++){var _0x1f6842=events[_0x49e6cd];var _0x5f1e9=createListener('chatWebsite:'+_0x1f6842,_0x46949c);ChatWebsiteEvents['on'](_0x1f6842,_0x5f1e9);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 72c4455..6b1f5ca 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 _0x2b19=['root','%s-%s','now','file','addLogo','join','server/files/images/avatars/','originalname','/:id/avatar','single','addAvatar','format','/:id/system_avatar','addSystemAvatar','notify','server/files','attachments','offline-chat','replace','/:id/offline','offline','addInteraction','addApplications','addAgents','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage'];(function(_0x29bd19,_0x43928d){var _0x9551bf=function(_0x2c14a7){while(--_0x2c14a7){_0x29bd19['push'](_0x29bd19['shift']());}};_0x9551bf(++_0x43928d);}(_0x2b19,0x132));var _0x92b1=function(_0x145075,_0x202545){_0x145075=_0x145075-0x0;var _0x34bbd0=_0x2b19[_0x145075];return _0x34bbd0;};'use strict';var multer=require(_0x92b1('0x0'));var util=require(_0x92b1('0x1'));var path=require(_0x92b1('0x2'));var timeout=require(_0x92b1('0x3'));var express=require('express');var router=express[_0x92b1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x92b1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x92b1('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x92b1('0x7')](),controller['index']);router[_0x92b1('0x8')](_0x92b1('0x9'),auth['isAuthenticated'](),controller[_0x92b1('0xa')]);router[_0x92b1('0x8')](_0x92b1('0xb'),auth[_0x92b1('0x7')](),controller[_0x92b1('0xc')]);router['get'](_0x92b1('0xd'),auth[_0x92b1('0x7')](),controller[_0x92b1('0xe')]);router[_0x92b1('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x92b1('0xf')]);router[_0x92b1('0x8')](_0x92b1('0x10'),controller[_0x92b1('0x11')]);router[_0x92b1('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x92b1('0x8')](_0x92b1('0x12'),controller[_0x92b1('0x13')]);router[_0x92b1('0x8')]('/:id/system_avatar',controller[_0x92b1('0x14')]);router[_0x92b1('0x8')](_0x92b1('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x92b1('0x16'),controller[_0x92b1('0x17')]);router[_0x92b1('0x8')](_0x92b1('0x18'),auth[_0x92b1('0x7')](),controller['getApplications']);router[_0x92b1('0x8')](_0x92b1('0x19'),auth['isAuthenticated'](),controller[_0x92b1('0x1a')]);router[_0x92b1('0x8')](_0x92b1('0x1b'),controller[_0x92b1('0x1c')]);router['get'](_0x92b1('0x1d'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x1e')]);router['get'](_0x92b1('0x1f'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x20')]);router[_0x92b1('0x21')]('/',auth[_0x92b1('0x7')](),controller[_0x92b1('0x22')]);router[_0x92b1('0x21')](_0x92b1('0xd'),auth['isAuthenticated'](),controller[_0x92b1('0x23')]);router[_0x92b1('0x21')](_0x92b1('0x24'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x25')]);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x1cc6e5,_0x1ee6f0,_0xa4dc80){_0xa4dc80(null,path['join'](config[_0x92b1('0x27')],'server/files/images/logos/'));},'filename':function(_0x300666,_0x5a5204,_0x548e8d){_0x548e8d(null,util['format'](_0x92b1('0x28'),Date[_0x92b1('0x29')](),_0x5a5204['originalname']));}})});router[_0x92b1('0x21')](_0x92b1('0x10'),upload['single'](_0x92b1('0x2a')),controller[_0x92b1('0x2b')]);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x1f9a0d,_0x18406b,_0xe871ac){_0xe871ac(null,path[_0x92b1('0x2c')](config['root'],_0x92b1('0x2d')));},'filename':function(_0x5247a9,_0x22a01e,_0x94c551){_0x94c551(null,util['format'](_0x92b1('0x28'),Date[_0x92b1('0x29')](),_0x22a01e[_0x92b1('0x2e')]));}})});router[_0x92b1('0x21')](_0x92b1('0x2f'),upload[_0x92b1('0x30')](_0x92b1('0x2a')),controller[_0x92b1('0x31')]);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x4ba860,_0x6c50bb,_0x235694){_0x235694(null,path['join'](config['root'],_0x92b1('0x2d')));},'filename':function(_0x43207a,_0xf37e9,_0x223f26){_0x223f26(null,util[_0x92b1('0x32')](_0x92b1('0x28'),Date['now'](),_0xf37e9[_0x92b1('0x2e')]));}})});router[_0x92b1('0x21')](_0x92b1('0x12'),upload[_0x92b1('0x30')](_0x92b1('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x196837,_0x15e2d0,_0x33507b){_0x33507b(null,path[_0x92b1('0x2c')](config[_0x92b1('0x27')],_0x92b1('0x2d')));},'filename':function(_0x289ef1,_0x215e4f,_0x41a22e){_0x41a22e(null,util[_0x92b1('0x32')](_0x92b1('0x28'),Date[_0x92b1('0x29')](),_0x215e4f['originalname']));}})});router[_0x92b1('0x21')](_0x92b1('0x33'),upload[_0x92b1('0x30')](_0x92b1('0x2a')),controller[_0x92b1('0x34')]);router[_0x92b1('0x21')]('/:id/notify',controller[_0x92b1('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2c34c3,_0x530e98,_0x5418f1){const _0x5d4619=path[_0x92b1('0x2c')](config['root'],_0x92b1('0x36'),_0x92b1('0x37'),_0x92b1('0x38'));fs_extra['ensureDir'](_0x5d4619,function(){_0x5418f1(null,_0x5d4619);});},'filename':function(_0x2298f8,_0xbdd047,_0x282509){const _0x37fb5d=_0xbdd047[_0x92b1('0x2e')][_0x92b1('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5c3523=path['extname'](_0x37fb5d);const _0x9975d5=Date['now']()+'-'+_0x37fb5d[_0x92b1('0x39')](_0x5c3523,'')+_0x5c3523;_0x282509(null,_0x9975d5);}})});router[_0x92b1('0x21')](_0x92b1('0x3a'),offlineUploadMulter['any'](),controller[_0x92b1('0x3b')]);router[_0x92b1('0x21')]('/:id/interactions',auth[_0x92b1('0x7')](),controller[_0x92b1('0x3c')]);router[_0x92b1('0x21')](_0x92b1('0x18'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x3d')]);router['post'](_0x92b1('0x19'),auth[_0x92b1('0x7')](),controller['addProactiveActions']);router[_0x92b1('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0x92b1('0x3e')]);router['put'](_0x92b1('0xb'),auth[_0x92b1('0x7')](),controller['update']);router[_0x92b1('0x3f')](_0x92b1('0xb'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x40')]);router[_0x92b1('0x3f')](_0x92b1('0xd'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x41')]);router[_0x92b1('0x3f')](_0x92b1('0x24'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x42')]);router[_0x92b1('0x3f')](_0x92b1('0x1f'),auth['isAuthenticated'](),controller[_0x92b1('0x43')]);module[_0x92b1('0x44')]=router;
\ No newline at end of file
+var _0xb2b4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','%s-%s','now','originalname','single','file','addLogo','join','root','server/files/images/avatars/','format','/:id/avatar','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','any','offline','addApplications','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util'];(function(_0x4d0681,_0x3a594a){var _0x1cf1a3=function(_0x5a782e){while(--_0x5a782e){_0x4d0681['push'](_0x4d0681['shift']());}};_0x1cf1a3(++_0x3a594a);}(_0xb2b4,0x126));var _0x4b2b=function(_0x4fbaf9,_0x3b8190){_0x4fbaf9=_0x4fbaf9-0x0;var _0x1d89a0=_0xb2b4[_0x4fbaf9];return _0x1d89a0;};'use strict';var multer=require(_0x4b2b('0x0'));var util=require(_0x4b2b('0x1'));var path=require(_0x4b2b('0x2'));var timeout=require(_0x4b2b('0x3'));var express=require(_0x4b2b('0x4'));var router=express[_0x4b2b('0x5')]();var fs_extra=require(_0x4b2b('0x6'));var auth=require(_0x4b2b('0x7'));var interaction=require(_0x4b2b('0x8'));var config=require(_0x4b2b('0x9'));var controller=require(_0x4b2b('0xa'));router[_0x4b2b('0xb')]('/',auth[_0x4b2b('0xc')](),controller[_0x4b2b('0xd')]);router['get'](_0x4b2b('0xe'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0xf')]);router[_0x4b2b('0xb')](_0x4b2b('0x10'),auth[_0x4b2b('0xc')](),controller['show']);router[_0x4b2b('0xb')](_0x4b2b('0x11'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x12')]);router[_0x4b2b('0xb')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4b2b('0x13')]);router['get'](_0x4b2b('0x14'),controller[_0x4b2b('0x15')]);router[_0x4b2b('0xb')]('/:id/avatar',controller[_0x4b2b('0x16')]);router[_0x4b2b('0xb')]('/:id/customer_avatar',controller[_0x4b2b('0x17')]);router[_0x4b2b('0xb')](_0x4b2b('0x18'),controller[_0x4b2b('0x19')]);router[_0x4b2b('0xb')](_0x4b2b('0x1a'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x1b')]);router[_0x4b2b('0xb')]('/:id/snippet',controller[_0x4b2b('0x1c')]);router[_0x4b2b('0xb')](_0x4b2b('0x1d'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x1e')]);router['get'](_0x4b2b('0x1f'),auth[_0x4b2b('0xc')](),controller['getProactiveActions']);router['get'](_0x4b2b('0x20'),controller['getFields']);router[_0x4b2b('0xb')]('/:id/offline_messages',auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x21')]);router[_0x4b2b('0xb')](_0x4b2b('0x22'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x23')]);router[_0x4b2b('0x24')]('/',auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x25')]);router[_0x4b2b('0x24')](_0x4b2b('0x11'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x26')]);router[_0x4b2b('0x24')](_0x4b2b('0x27'),auth['isAuthenticated'](),controller[_0x4b2b('0x28')]);var upload=multer({'storage':multer[_0x4b2b('0x29')]({'destination':function(_0x55ea0f,_0x2d7403,_0x527268){_0x527268(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x276d21,_0x4d5291,_0x1d926b){_0x1d926b(null,util['format'](_0x4b2b('0x2a'),Date[_0x4b2b('0x2b')](),_0x4d5291[_0x4b2b('0x2c')]));}})});router['post'](_0x4b2b('0x14'),upload[_0x4b2b('0x2d')](_0x4b2b('0x2e')),controller[_0x4b2b('0x2f')]);var upload=multer({'storage':multer[_0x4b2b('0x29')]({'destination':function(_0x3e2e39,_0xb3a58c,_0x26b5a0){_0x26b5a0(null,path[_0x4b2b('0x30')](config[_0x4b2b('0x31')],_0x4b2b('0x32')));},'filename':function(_0x4ebdca,_0x4bb423,_0x3c8fff){_0x3c8fff(null,util[_0x4b2b('0x33')](_0x4b2b('0x2a'),Date['now'](),_0x4bb423[_0x4b2b('0x2c')]));}})});router[_0x4b2b('0x24')](_0x4b2b('0x34'),upload[_0x4b2b('0x2d')](_0x4b2b('0x2e')),controller[_0x4b2b('0x35')]);var upload=multer({'storage':multer[_0x4b2b('0x29')]({'destination':function(_0x1faf0c,_0x37ecac,_0x1bd053){_0x1bd053(null,path[_0x4b2b('0x30')](config['root'],_0x4b2b('0x32')));},'filename':function(_0x17cf6b,_0x12c9a6,_0x2868bd){_0x2868bd(null,util[_0x4b2b('0x33')](_0x4b2b('0x2a'),Date[_0x4b2b('0x2b')](),_0x12c9a6[_0x4b2b('0x2c')]));}})});router[_0x4b2b('0x24')](_0x4b2b('0x36'),upload[_0x4b2b('0x2d')](_0x4b2b('0x2e')),controller[_0x4b2b('0x37')]);var upload=multer({'storage':multer[_0x4b2b('0x29')]({'destination':function(_0xc768ca,_0x33b6a1,_0x5b4a00){_0x5b4a00(null,path['join'](config[_0x4b2b('0x31')],_0x4b2b('0x32')));},'filename':function(_0x14a474,_0x1fe039,_0x583786){_0x583786(null,util[_0x4b2b('0x33')](_0x4b2b('0x2a'),Date['now'](),_0x1fe039[_0x4b2b('0x2c')]));}})});router[_0x4b2b('0x24')](_0x4b2b('0x18'),upload['single']('file'),controller[_0x4b2b('0x38')]);router[_0x4b2b('0x24')](_0x4b2b('0x39'),controller[_0x4b2b('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0x4b2b('0x29')]({'destination':function(_0x1120a1,_0x141f39,_0x58a6fb){const _0x13301d=path['join'](config[_0x4b2b('0x31')],_0x4b2b('0x3b'),_0x4b2b('0x3c'),_0x4b2b('0x3d'));fs_extra['ensureDir'](_0x13301d,function(){_0x58a6fb(null,_0x13301d);});},'filename':function(_0x2abb7a,_0x273818,_0x19a878){const _0x46c0f7=_0x273818[_0x4b2b('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x41a6a4=path['extname'](_0x46c0f7);const _0x12155a=Date['now']()+'-'+_0x46c0f7[_0x4b2b('0x3e')](_0x41a6a4,'')+_0x41a6a4;_0x19a878(null,_0x12155a);}})});router[_0x4b2b('0x24')]('/:id/offline',offlineUploadMulter[_0x4b2b('0x3f')](),controller[_0x4b2b('0x40')]);router[_0x4b2b('0x24')](_0x4b2b('0x1a'),auth[_0x4b2b('0xc')](),controller['addInteraction']);router[_0x4b2b('0x24')](_0x4b2b('0x1d'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x41')]);router[_0x4b2b('0x24')](_0x4b2b('0x1f'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x42')]);router[_0x4b2b('0x24')](_0x4b2b('0x22'),auth['isAuthenticated'](),controller[_0x4b2b('0x43')]);router['put'](_0x4b2b('0x10'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x44')]);router[_0x4b2b('0x45')](_0x4b2b('0x10'),auth[_0x4b2b('0xc')](),controller[_0x4b2b('0x46')]);router[_0x4b2b('0x45')](_0x4b2b('0x11'),auth['isAuthenticated'](),controller[_0x4b2b('0x47')]);router[_0x4b2b('0x45')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4b2b('0x48')]);router['delete'](_0x4b2b('0x22'),auth['isAuthenticated'](),controller[_0x4b2b('0x49')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 39c8489..90af52d 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x010d=['isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x3c61c5,_0x425714){var _0x36ee96=function(_0x549335){while(--_0x549335){_0x3c61c5['push'](_0x3c61c5['shift']());}};_0x36ee96(++_0x425714);}(_0x010d,0x1ef));var _0xd010=function(_0x3a924a,_0x5b8ed3){_0x3a924a=_0x3a924a-0x0;var _0x144b03=_0x010d[_0x3a924a];return _0x144b03;};var beaverLogger=require(_0xd010('0x0'));var express=require(_0xd010('0x1'));var auth=require(_0xd010('0x2'));var config=require(_0xd010('0x3'));var router=express[_0xd010('0x4')]();var isProduction=config[_0xd010('0x5')]==='production'||![];function clientSideLogs(_0x50f5a4,_0x4e7a33,_0x465082){var _0x51afb7=_0x50f5a4[_0xd010('0x6')][_0xd010('0x7')](_0xd010('0x8'));if(!_0x51afb7){throw new Error(_0xd010('0x9'));}return beaverLogger[_0xd010('0xa')]({'uri':_0xd010('0xb'),'logger':_0x51afb7,'enableCors':!isProduction})(_0x50f5a4,_0x4e7a33,_0x465082);}router['use'](auth[_0xd010('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0xd7c8=['Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','express','../config/environment'];(function(_0x7aaac8,_0x3a4233){var _0x4a8013=function(_0x45cf4e){while(--_0x45cf4e){_0x7aaac8['push'](_0x7aaac8['shift']());}};_0x4a8013(++_0x3a4233);}(_0xd7c8,0xc1));var _0x8d7c=function(_0x66190f,_0x5ce078){_0x66190f=_0x66190f-0x0;var _0x4cd1d7=_0xd7c8[_0x66190f];return _0x4cd1d7;};var beaverLogger=require('beaver-logger/server');var express=require(_0x8d7c('0x0'));var auth=require('../components/auth/service');var config=require(_0x8d7c('0x1'));var router=express[_0x8d7c('0x2')]();var isProduction=config[_0x8d7c('0x3')]===_0x8d7c('0x4')||![];function clientSideLogs(_0x1973ef,_0x5d85fb,_0x173b98){var _0x20df24=_0x1973ef[_0x8d7c('0x5')][_0x8d7c('0x6')](_0x8d7c('0x7'));if(!_0x20df24){throw new Error(_0x8d7c('0x8'));}return beaverLogger[_0x8d7c('0x9')]({'uri':'/client-logs','logger':_0x20df24,'enableCors':!isProduction})(_0x1973ef,_0x5d85fb,_0x173b98);}router[_0x8d7c('0xa')](auth[_0x8d7c('0xb')](),clientSideLogs);module[_0x8d7c('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index f34f841..f29db23 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 _0x7f2b=['Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f2b,0x1f4));var _0xb7f2=function(_0x4ad683,_0x5d2b9b){_0x4ad683=_0x4ad683-0x0;var _0x297ec9=_0x7f2b[_0x4ad683];return _0x297ec9;};'use strict';var Sequelize=require(_0xb7f2('0x0'));module[_0xb7f2('0x1')]={'name':{'type':Sequelize[_0xb7f2('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb7f2('0x3')](_0xb7f2('0x4'),_0xb7f2('0x5'),_0xb7f2('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xb7f2('0x3')](_0xb7f2('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xb7f2('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xb7f2('0x9')},'data4':{'type':Sequelize[_0xb7f2('0x2')],'comment':_0xb7f2('0xa')},'data5':{'type':Sequelize[_0xb7f2('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xb7f2('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xb7f2('0xb')],'comment':_0xb7f2('0xc')}};
\ No newline at end of file
+var _0xb19e=['sequelize','STRING','AmazonAWS','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x3659b5,_0xec8922){var _0x4d8d40=function(_0x33c120){while(--_0x33c120){_0x3659b5['push'](_0x3659b5['shift']());}};_0x4d8d40(++_0xec8922);}(_0xb19e,0x7e));var _0xeb19=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0xb19e[_0x555069];return _0x100af7;};'use strict';var Sequelize=require(_0xeb19('0x0'));module['exports']={'name':{'type':Sequelize[_0xeb19('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xeb19('0x2'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xeb19('0x3')](_0xeb19('0x4'),_0xeb19('0x5'))},'data1':{'type':Sequelize[_0xeb19('0x1')],'comment':_0xeb19('0x6')},'data2':{'type':Sequelize[_0xeb19('0x1')],'comment':_0xeb19('0x7')},'data3':{'type':Sequelize[_0xeb19('0x1')],'comment':_0xeb19('0x8')},'data4':{'type':Sequelize[_0xeb19('0x1')],'comment':_0xeb19('0x9')},'data5':{'type':Sequelize[_0xeb19('0xa')],'comment':_0xeb19('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0xeb19('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0xeb19('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 5097bc9..2aa5cae 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 _0x6245=['lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','end','json','undefined','count','limit','Content-Range','update','then','destroy','error','stack','name','send','slice','index','map','CloudProvider','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','service','MicrosoftAzure','decryptString','data3','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','catch','find','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','parse','state','base64','toString','ascii','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','microsoftAuthorization:error','stringify'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x6245,0x164));var _0x5624=function(_0x3b2e0a,_0x49a3f9){_0x3b2e0a=_0x3b2e0a-0x0;var _0x4a84bd=_0x6245[_0x3b2e0a];return _0x4a84bd;};'use strict';var _=require(_0x5624('0x0'));var Redis=require(_0x5624('0x1'));var qs=require(_0x5624('0x2'));var encryptor=require(_0x5624('0x3'));var config=require(_0x5624('0x4'));var logger=require(_0x5624('0x5'))(_0x5624('0x6'));var db=require(_0x5624('0x7'))['db'];var oauth=require(_0x5624('0x8'));config[_0x5624('0x9')]=_['defaults'](config[_0x5624('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5624('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x5624('0x9')]);function respondWithStatusCode(_0x4b32e3,_0x1d5a46){_0x1d5a46=_0x1d5a46||0xcc;return function(_0x507e20){if(_0x507e20){return _0x4b32e3[_0x5624('0xb')](_0x1d5a46);}return _0x4b32e3[_0x5624('0xc')](_0x1d5a46)[_0x5624('0xd')]();};}function respondWithResult(_0x25722e,_0x20eae9){_0x20eae9=_0x20eae9||0xc8;return function(_0x110704){if(_0x110704){return _0x25722e[_0x5624('0xc')](_0x20eae9)[_0x5624('0xe')](_0x110704);}};}function respondWithFilteredResult(_0x2241a1,_0x12e597){return function(_0x4f373f){if(_0x4f373f){var _0x1c6454=typeof _0x12e597['offset']===_0x5624('0xf')&&typeof _0x12e597['limit']===_0x5624('0xf');var _0xa7dcdb=_0x4f373f[_0x5624('0x10')];var _0x900856=_0x1c6454?0x0:_0x12e597['offset'];var _0xcc6644=_0x1c6454?_0x4f373f[_0x5624('0x10')]:_0x12e597['offset']+_0x12e597[_0x5624('0x11')];var _0x519de3;if(_0xcc6644>=_0xa7dcdb){_0xcc6644=_0xa7dcdb;_0x519de3=0xc8;}else{_0x519de3=0xce;}_0x2241a1[_0x5624('0xc')](_0x519de3);return _0x2241a1['set'](_0x5624('0x12'),_0x900856+'-'+_0xcc6644+'/'+_0xa7dcdb)[_0x5624('0xe')](_0x4f373f);}return null;};}function saveUpdates(_0x2dcf32){return function(_0x15add5){if(_0x15add5){return _0x15add5[_0x5624('0x13')](_0x2dcf32)[_0x5624('0x14')](function(_0xcd02e3){return _0xcd02e3;});}return null;};}function removeEntity(_0x55f2bf){return function(_0x438fde){if(_0x438fde){return _0x438fde[_0x5624('0x15')]()[_0x5624('0x14')](function(){_0x55f2bf[_0x5624('0xc')](0xcc)[_0x5624('0xd')]();});}};}function handleEntityNotFound(_0x31a15f){return function(_0x4ed883){if(!_0x4ed883){_0x31a15f['sendStatus'](0x194);}return _0x4ed883;};}function handleError(_0x4d503f,_0x2749d1){_0x2749d1=_0x2749d1||0x1f4;return function(_0x23d787){logger[_0x5624('0x16')](_0x23d787[_0x5624('0x17')]);if(_0x23d787[_0x5624('0x18')]){delete _0x23d787[_0x5624('0x18')];}_0x4d503f[_0x5624('0xc')](_0x2749d1)[_0x5624('0x19')](_0x23d787);};}function maskClientSecret(_0x5d5b35){return _['padEnd'](_0x5d5b35[_0x5624('0x1a')](0x0,0x3),0x14,'*');}exports[_0x5624('0x1b')]=function(_0x42740a,_0x21f423){var _0x46353e={},_0x3076f0={},_0x1eed80={'count':0x0,'rows':[]};var _0x4d79d7=_[_0x5624('0x1c')](db[_0x5624('0x1d')][_0x5624('0x1e')],function(_0x572a2e){return{'name':_0x572a2e[_0x5624('0x1f')],'type':_0x572a2e[_0x5624('0x20')]['key']};});_0x3076f0[_0x5624('0x21')]=_[_0x5624('0x1c')](_0x4d79d7,_0x5624('0x18'));_0x3076f0[_0x5624('0x22')]=_[_0x5624('0x23')](_0x42740a['query']);_0x3076f0[_0x5624('0x24')]=_[_0x5624('0x25')](_0x3076f0[_0x5624('0x21')],_0x3076f0[_0x5624('0x22')]);_0x46353e[_0x5624('0x26')]=_[_0x5624('0x25')](_0x3076f0[_0x5624('0x21')],qs[_0x5624('0x27')](_0x42740a[_0x5624('0x22')][_0x5624('0x27')]));_0x46353e[_0x5624('0x26')]=_0x46353e['attributes'][_0x5624('0x28')]?_0x46353e['attributes']:_0x3076f0['model'];if(!_0x42740a[_0x5624('0x22')][_0x5624('0x29')](_0x5624('0x2a'))){_0x46353e['limit']=qs[_0x5624('0x11')](_0x42740a[_0x5624('0x22')]['limit']);_0x46353e[_0x5624('0x2b')]=qs[_0x5624('0x2b')](_0x42740a[_0x5624('0x22')][_0x5624('0x2b')]);}_0x46353e[_0x5624('0x2c')]=qs[_0x5624('0x2d')](_0x42740a[_0x5624('0x22')]['sort']);_0x46353e[_0x5624('0x2e')]=qs['filters'](_[_0x5624('0x2f')](_0x42740a[_0x5624('0x22')],_0x3076f0['filters']),_0x4d79d7);if(_0x42740a[_0x5624('0x22')][_0x5624('0x30')]){_0x46353e['where']=_[_0x5624('0x31')](_0x46353e['where'],{'$or':_[_0x5624('0x1c')](_0x4d79d7,function(_0x5c1404){if(_0x5c1404[_0x5624('0x20')]!==_0x5624('0x32')){var _0x244da0={};_0x244da0[_0x5c1404[_0x5624('0x18')]]={'$like':'%'+_0x42740a[_0x5624('0x22')][_0x5624('0x30')]+'%'};return _0x244da0;}})});}_0x46353e=_[_0x5624('0x31')]({},_0x46353e,_0x42740a[_0x5624('0x33')]);var _0x4962aa={'where':_0x46353e[_0x5624('0x2e')]};return db[_0x5624('0x1d')][_0x5624('0x10')](_0x4962aa)[_0x5624('0x14')](function(_0x30f404){_0x1eed80[_0x5624('0x10')]=_0x30f404;if(_0x42740a[_0x5624('0x22')]['includeAll']){_0x46353e[_0x5624('0x34')]=[{'all':!![]}];}return db[_0x5624('0x1d')][_0x5624('0x35')](_0x46353e);})[_0x5624('0x14')](function(_0x192380){_0x1eed80['rows']=_[_0x5624('0x1c')](_0x192380,function(_0x4bdf37){if(_0x4bdf37[_0x5624('0x36')]===_0x5624('0x37')){var _0x3dad41=encryptor[_0x5624('0x38')](_0x4bdf37[_0x5624('0x39')]);_0x4bdf37[_0x5624('0x39')]=maskClientSecret(_0x3dad41);}return _0x4bdf37;});return _0x1eed80;})[_0x5624('0x14')](respondWithFilteredResult(_0x21f423,_0x46353e))['catch'](handleError(_0x21f423,null));};exports['show']=function(_0x199030,_0x3054a9){var _0x4f68bb={'raw':!![],'where':{'id':_0x199030['params']['id']}},_0x42129b={};_0x42129b['model']=_['keys'](db[_0x5624('0x1d')][_0x5624('0x1e')]);_0x42129b['query']=_[_0x5624('0x23')](_0x199030[_0x5624('0x22')]);_0x42129b[_0x5624('0x24')]=_[_0x5624('0x25')](_0x42129b[_0x5624('0x21')],_0x42129b[_0x5624('0x22')]);_0x4f68bb['attributes']=_['intersection'](_0x42129b['model'],qs[_0x5624('0x27')](_0x199030[_0x5624('0x22')]['fields']));_0x4f68bb['attributes']=_0x4f68bb[_0x5624('0x26')][_0x5624('0x28')]?_0x4f68bb[_0x5624('0x26')]:_0x42129b['model'];if(_0x199030[_0x5624('0x22')]['includeAll']){_0x4f68bb['include']=[{'all':!![]}];}_0x4f68bb=_[_0x5624('0x31')]({},_0x4f68bb,_0x199030[_0x5624('0x33')]);return db[_0x5624('0x1d')]['find'](_0x4f68bb)[_0x5624('0x14')](handleEntityNotFound(_0x3054a9,null))[_0x5624('0x14')](function(_0x5b280d){if(_0x5b280d[_0x5624('0x36')]===_0x5624('0x37')){var _0x4247ea=encryptor[_0x5624('0x38')](_0x5b280d[_0x5624('0x39')]);_0x5b280d[_0x5624('0x39')]=maskClientSecret(_0x4247ea);}return _0x5b280d;})[_0x5624('0x14')](respondWithResult(_0x3054a9,null))['catch'](handleError(_0x3054a9,null));};exports[_0x5624('0x3a')]=function(_0x28c674,_0x5bcf11){if(!_0x28c674[_0x5624('0x3b')][_0x5624('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x28c674[_0x5624('0x3b')][_0x5624('0x36')])throw new Error(_0x5624('0x3c'));var _0x3698bf=db[_0x5624('0x1d')][_0x5624('0x1e')]['service'][_0x5624('0x3d')];if(!_0x3698bf[_0x5624('0x3e')](_0x28c674[_0x5624('0x3b')][_0x5624('0x36')]))throw new Error(_0x5624('0x3f')+_0x3698bf[_0x5624('0x40')](',\x20'));if(_0x28c674[_0x5624('0x3b')][_0x5624('0x36')]==='MicrosoftAzure'&&_0x28c674[_0x5624('0x3b')][_0x5624('0x39')]){_0x28c674[_0x5624('0x3b')][_0x5624('0x39')]=encryptor[_0x5624('0x41')](_0x28c674[_0x5624('0x3b')]['data3']);}return db[_0x5624('0x1d')][_0x5624('0x3a')](_0x28c674['body'],{})[_0x5624('0x14')](respondWithResult(_0x5bcf11,0xc9))[_0x5624('0x42')](handleError(_0x5bcf11,null));};exports[_0x5624('0x13')]=function(_0x51fe24,_0x2cee62){if(_0x51fe24[_0x5624('0x3b')]['id']){delete _0x51fe24[_0x5624('0x3b')]['id'];}return db[_0x5624('0x1d')][_0x5624('0x43')]({'where':{'id':_0x51fe24[_0x5624('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cee62,null))[_0x5624('0x14')](function(_0x5c7a30){if(_0x5c7a30[_0x5624('0x36')]===_0x5624('0x37')&&_0x51fe24[_0x5624('0x3b')]['data3']){_0x51fe24['body'][_0x5624('0x39')]=encryptor[_0x5624('0x41')](_0x51fe24[_0x5624('0x3b')][_0x5624('0x39')]);}return _0x5c7a30;})['then'](saveUpdates(_0x51fe24[_0x5624('0x3b')],null))[_0x5624('0x14')](respondWithResult(_0x2cee62,null))[_0x5624('0x42')](handleError(_0x2cee62,null));};exports[_0x5624('0x15')]=function(_0x3b9acf,_0x3015ec){return db['CloudProvider']['find']({'where':{'id':_0x3b9acf[_0x5624('0x44')]['id']}})['then'](handleEntityNotFound(_0x3015ec,null))[_0x5624('0x14')](removeEntity(_0x3015ec,null))[_0x5624('0x42')](handleError(_0x3015ec,null));};exports[_0x5624('0x45')]=function(_0x30f427,_0x146ac5){return db['CloudProvider']['findOne']({'where':{'id':_0x30f427['params']['id']},'raw':!![]})[_0x5624('0x14')](function(_0x41b2b1){if(!_0x41b2b1)return _0x146ac5[_0x5624('0xb')](0x194);return{'url':oauth[_0x5624('0x46')](_0x41b2b1,_0x30f427[_0x5624('0x47')]['id'])};})[_0x5624('0x14')](respondWithResult(_0x146ac5,null))[_0x5624('0x42')](handleError(_0x146ac5,null));};exports[_0x5624('0x48')]=function(_0x11dbc2,_0x1907d8){var _0x4cce28=_0x11dbc2[_0x5624('0x3b')];var _0x1d2aec;var _0x30d666;if(_0x4cce28[_0x5624('0x16')])throw _0x4cce28;redis['get'](_0x4cce28['state'])['then'](function(_0x245527){if(!_0x245527)throw new Error('Invalid\x20state\x20parameter');_0x1d2aec=JSON[_0x5624('0x49')](_0x245527);var _0x566850=Buffer['from'](_0x4cce28[_0x5624('0x4a')],_0x5624('0x4b'))[_0x5624('0x4c')](_0x5624('0x4d'));_0x30d666=JSON['parse'](_0x566850);if(!oauth[_0x5624('0x4e')](_0x4cce28['id_token'],_0x1d2aec['oauth2Claims']))throw new Error(_0x5624('0x4f'));redis[_0x5624('0x50')](_0x4cce28[_0x5624('0x4a')]);return oauth[_0x5624('0x51')](_0x4cce28[_0x5624('0x52')],_0x1d2aec);})[_0x5624('0x14')](function(_0x2acb8a){_0x1d2aec[_0x5624('0x53')]=_0x2acb8a[_0x5624('0x54')];_0x1d2aec[_0x5624('0x55')]=_0x2acb8a['refresh_token'];return db[_0x5624('0x1d')]['update']({'data5':_0x1d2aec[_0x5624('0x53')],'data6':_0x1d2aec[_0x5624('0x55')]},{'where':{'id':_0x1d2aec['id']}});})[_0x5624('0x14')](function(){oauth[_0x5624('0x56')](_0x1d2aec);socket['emit']('microsoftAuthorization:success',{'id':_0x30d666['id']});return;})[_0x5624('0x14')](respondWithStatusCode(_0x1907d8,null))[_0x5624('0x42')](function(_0x43515b){if(_0x30d666){socket['emit'](_0x5624('0x57'),{'id':_0x30d666['id']});}if(!_0x1d2aec){logger[_0x5624('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x43515b);return _0x1907d8['status'](0x1f4)[_0x5624('0x19')](_0x43515b['message']);}logger[_0x5624('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1d2aec['id'],JSON[_0x5624('0x58')](_0x43515b));});};
\ No newline at end of file
+var _0x2d29=['destroy','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','data6','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','set','update','then','error','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','catch','show','params','find','data3','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString'];(function(_0x524c0c,_0x31d379){var _0xe33cf4=function(_0x153545){while(--_0x153545){_0x524c0c['push'](_0x524c0c['shift']());}};_0xe33cf4(++_0x31d379);}(_0x2d29,0x11c));var _0x92d2=function(_0x3bff95,_0x5787c6){_0x3bff95=_0x3bff95-0x0;var _0x599bac=_0x2d29[_0x3bff95];return _0x599bac;};'use strict';var _=require(_0x92d2('0x0'));var Redis=require(_0x92d2('0x1'));var qs=require(_0x92d2('0x2'));var encryptor=require(_0x92d2('0x3'));var config=require(_0x92d2('0x4'));var logger=require('../../config/logger')('api');var db=require(_0x92d2('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x92d2('0x6')]=_[_0x92d2('0x7')](config[_0x92d2('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x92d2('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x92d2('0x6')]);function respondWithStatusCode(_0x5671c5,_0x2cec7a){_0x2cec7a=_0x2cec7a||0xcc;return function(_0x767132){if(_0x767132){return _0x5671c5[_0x92d2('0x9')](_0x2cec7a);}return _0x5671c5['status'](_0x2cec7a)[_0x92d2('0xa')]();};}function respondWithResult(_0x218fbf,_0xafe727){_0xafe727=_0xafe727||0xc8;return function(_0xfc619d){if(_0xfc619d){return _0x218fbf[_0x92d2('0xb')](_0xafe727)[_0x92d2('0xc')](_0xfc619d);}};}function respondWithFilteredResult(_0x387319,_0x516608){return function(_0x12ff5f){if(_0x12ff5f){var _0xafd15a=typeof _0x516608[_0x92d2('0xd')]===_0x92d2('0xe')&&typeof _0x516608[_0x92d2('0xf')]===_0x92d2('0xe');var _0xd5a67f=_0x12ff5f['count'];var _0x57cc5d=_0xafd15a?0x0:_0x516608['offset'];var _0x1ee672=_0xafd15a?_0x12ff5f[_0x92d2('0x10')]:_0x516608['offset']+_0x516608[_0x92d2('0xf')];var _0x33e6cd;if(_0x1ee672>=_0xd5a67f){_0x1ee672=_0xd5a67f;_0x33e6cd=0xc8;}else{_0x33e6cd=0xce;}_0x387319[_0x92d2('0xb')](_0x33e6cd);return _0x387319[_0x92d2('0x11')]('Content-Range',_0x57cc5d+'-'+_0x1ee672+'/'+_0xd5a67f)[_0x92d2('0xc')](_0x12ff5f);}return null;};}function saveUpdates(_0x318a5c){return function(_0x2e4241){if(_0x2e4241){return _0x2e4241[_0x92d2('0x12')](_0x318a5c)[_0x92d2('0x13')](function(_0x5c8590){return _0x5c8590;});}return null;};}function removeEntity(_0x13e020){return function(_0x35991f){if(_0x35991f){return _0x35991f['destroy']()[_0x92d2('0x13')](function(){_0x13e020[_0x92d2('0xb')](0xcc)[_0x92d2('0xa')]();});}};}function handleEntityNotFound(_0x5bcbe4){return function(_0x10a602){if(!_0x10a602){_0x5bcbe4[_0x92d2('0x9')](0x194);}return _0x10a602;};}function handleError(_0x2cc7a2,_0x3e0acc){_0x3e0acc=_0x3e0acc||0x1f4;return function(_0xc87bdb){logger[_0x92d2('0x14')](_0xc87bdb['stack']);if(_0xc87bdb[_0x92d2('0x15')]){delete _0xc87bdb[_0x92d2('0x15')];}_0x2cc7a2[_0x92d2('0xb')](_0x3e0acc)['send'](_0xc87bdb);};}function maskClientSecret(_0x3b3d1d){return _['padEnd'](_0x3b3d1d[_0x92d2('0x16')](0x0,0x3),0x14,'*');}exports[_0x92d2('0x17')]=function(_0x30e803,_0x88e432){var _0x3049f9={},_0x5d79b8={},_0xf7d449={'count':0x0,'rows':[]};var _0x59c536=_[_0x92d2('0x18')](db[_0x92d2('0x19')][_0x92d2('0x1a')],function(_0x5ba712){return{'name':_0x5ba712[_0x92d2('0x1b')],'type':_0x5ba712[_0x92d2('0x1c')][_0x92d2('0x1d')]};});_0x5d79b8[_0x92d2('0x1e')]=_['map'](_0x59c536,_0x92d2('0x15'));_0x5d79b8[_0x92d2('0x1f')]=_[_0x92d2('0x20')](_0x30e803['query']);_0x5d79b8[_0x92d2('0x21')]=_[_0x92d2('0x22')](_0x5d79b8[_0x92d2('0x1e')],_0x5d79b8[_0x92d2('0x1f')]);_0x3049f9[_0x92d2('0x23')]=_[_0x92d2('0x22')](_0x5d79b8[_0x92d2('0x1e')],qs[_0x92d2('0x24')](_0x30e803['query'][_0x92d2('0x24')]));_0x3049f9[_0x92d2('0x23')]=_0x3049f9[_0x92d2('0x23')][_0x92d2('0x25')]?_0x3049f9[_0x92d2('0x23')]:_0x5d79b8[_0x92d2('0x1e')];if(!_0x30e803[_0x92d2('0x1f')][_0x92d2('0x26')]('nolimit')){_0x3049f9[_0x92d2('0xf')]=qs[_0x92d2('0xf')](_0x30e803[_0x92d2('0x1f')][_0x92d2('0xf')]);_0x3049f9[_0x92d2('0xd')]=qs[_0x92d2('0xd')](_0x30e803['query'][_0x92d2('0xd')]);}_0x3049f9['order']=qs[_0x92d2('0x27')](_0x30e803[_0x92d2('0x1f')][_0x92d2('0x27')]);_0x3049f9[_0x92d2('0x28')]=qs[_0x92d2('0x21')](_['pick'](_0x30e803['query'],_0x5d79b8['filters']),_0x59c536);if(_0x30e803[_0x92d2('0x1f')][_0x92d2('0x29')]){_0x3049f9[_0x92d2('0x28')]=_[_0x92d2('0x2a')](_0x3049f9['where'],{'$or':_[_0x92d2('0x18')](_0x59c536,function(_0xb2928d){if(_0xb2928d[_0x92d2('0x1c')]!==_0x92d2('0x2b')){var _0xda199f={};_0xda199f[_0xb2928d[_0x92d2('0x15')]]={'$like':'%'+_0x30e803[_0x92d2('0x1f')][_0x92d2('0x29')]+'%'};return _0xda199f;}})});}_0x3049f9=_[_0x92d2('0x2a')]({},_0x3049f9,_0x30e803[_0x92d2('0x2c')]);var _0x3708cc={'where':_0x3049f9['where']};return db[_0x92d2('0x19')][_0x92d2('0x10')](_0x3708cc)[_0x92d2('0x13')](function(_0x1efd66){_0xf7d449[_0x92d2('0x10')]=_0x1efd66;if(_0x30e803['query'][_0x92d2('0x2d')]){_0x3049f9[_0x92d2('0x2e')]=[{'all':!![]}];}return db[_0x92d2('0x19')]['findAll'](_0x3049f9);})[_0x92d2('0x13')](function(_0x5b9381){_0xf7d449[_0x92d2('0x2f')]=_[_0x92d2('0x18')](_0x5b9381,function(_0x336df4){if(_0x336df4[_0x92d2('0x30')]===_0x92d2('0x31')){var _0xa86eb7=encryptor[_0x92d2('0x32')](_0x336df4['data3']);_0x336df4['data3']=maskClientSecret(_0xa86eb7);}return _0x336df4;});return _0xf7d449;})['then'](respondWithFilteredResult(_0x88e432,_0x3049f9))[_0x92d2('0x33')](handleError(_0x88e432,null));};exports[_0x92d2('0x34')]=function(_0x2d6623,_0x437c96){var _0x4fac4c={'raw':!![],'where':{'id':_0x2d6623[_0x92d2('0x35')]['id']}},_0x19970d={};_0x19970d['model']=_[_0x92d2('0x20')](db['CloudProvider'][_0x92d2('0x1a')]);_0x19970d[_0x92d2('0x1f')]=_[_0x92d2('0x20')](_0x2d6623[_0x92d2('0x1f')]);_0x19970d['filters']=_['intersection'](_0x19970d[_0x92d2('0x1e')],_0x19970d[_0x92d2('0x1f')]);_0x4fac4c['attributes']=_[_0x92d2('0x22')](_0x19970d['model'],qs[_0x92d2('0x24')](_0x2d6623[_0x92d2('0x1f')]['fields']));_0x4fac4c[_0x92d2('0x23')]=_0x4fac4c[_0x92d2('0x23')]['length']?_0x4fac4c['attributes']:_0x19970d['model'];if(_0x2d6623['query'][_0x92d2('0x2d')]){_0x4fac4c['include']=[{'all':!![]}];}_0x4fac4c=_[_0x92d2('0x2a')]({},_0x4fac4c,_0x2d6623['options']);return db['CloudProvider'][_0x92d2('0x36')](_0x4fac4c)[_0x92d2('0x13')](handleEntityNotFound(_0x437c96,null))[_0x92d2('0x13')](function(_0x512271){if(_0x512271[_0x92d2('0x30')]===_0x92d2('0x31')){var _0x29bb54=encryptor['decryptString'](_0x512271[_0x92d2('0x37')]);_0x512271[_0x92d2('0x37')]=maskClientSecret(_0x29bb54);}return _0x512271;})['then'](respondWithResult(_0x437c96,null))[_0x92d2('0x33')](handleError(_0x437c96,null));};exports[_0x92d2('0x38')]=function(_0x2d19f6,_0x2e0549){if(!_0x2d19f6['body'][_0x92d2('0x15')])throw new Error(_0x92d2('0x39'));if(!_0x2d19f6[_0x92d2('0x3a')][_0x92d2('0x30')])throw new Error(_0x92d2('0x3b'));var _0x646d3a=db['CloudProvider']['rawAttributes']['service'][_0x92d2('0x3c')];if(!_0x646d3a[_0x92d2('0x3d')](_0x2d19f6[_0x92d2('0x3a')]['service']))throw new Error(_0x92d2('0x3e')+_0x646d3a['join'](',\x20'));if(_0x2d19f6[_0x92d2('0x3a')][_0x92d2('0x30')]===_0x92d2('0x31')&&_0x2d19f6[_0x92d2('0x3a')]['data3']){_0x2d19f6[_0x92d2('0x3a')]['data3']=encryptor[_0x92d2('0x3f')](_0x2d19f6[_0x92d2('0x3a')][_0x92d2('0x37')]);}return db[_0x92d2('0x19')][_0x92d2('0x38')](_0x2d19f6[_0x92d2('0x3a')],{})['then'](respondWithResult(_0x2e0549,0xc9))[_0x92d2('0x33')](handleError(_0x2e0549,null));};exports[_0x92d2('0x12')]=function(_0x514ee3,_0x41979a){if(_0x514ee3[_0x92d2('0x3a')]['id']){delete _0x514ee3[_0x92d2('0x3a')]['id'];}return db[_0x92d2('0x19')]['find']({'where':{'id':_0x514ee3[_0x92d2('0x35')]['id']}})[_0x92d2('0x13')](handleEntityNotFound(_0x41979a,null))[_0x92d2('0x13')](function(_0x56206d){if(_0x56206d[_0x92d2('0x30')]===_0x92d2('0x31')&&_0x514ee3[_0x92d2('0x3a')][_0x92d2('0x37')]){_0x514ee3[_0x92d2('0x3a')][_0x92d2('0x37')]=encryptor['encryptString'](_0x514ee3[_0x92d2('0x3a')][_0x92d2('0x37')]);}return _0x56206d;})[_0x92d2('0x13')](saveUpdates(_0x514ee3['body'],null))[_0x92d2('0x13')](respondWithResult(_0x41979a,null))['catch'](handleError(_0x41979a,null));};exports[_0x92d2('0x40')]=function(_0x2548e4,_0x347d42){return db[_0x92d2('0x19')]['find']({'where':{'id':_0x2548e4[_0x92d2('0x35')]['id']}})['then'](handleEntityNotFound(_0x347d42,null))[_0x92d2('0x13')](removeEntity(_0x347d42,null))[_0x92d2('0x33')](handleError(_0x347d42,null));};exports['oauth2MicrosoftAuthorize']=function(_0x3a6270,_0x1e35bb){return db[_0x92d2('0x19')]['findOne']({'where':{'id':_0x3a6270[_0x92d2('0x35')]['id']},'raw':!![]})[_0x92d2('0x13')](function(_0x4a2c4f){if(!_0x4a2c4f)return _0x1e35bb['sendStatus'](0x194);return{'url':oauth[_0x92d2('0x41')](_0x4a2c4f,_0x3a6270[_0x92d2('0x42')]['id'])};})['then'](respondWithResult(_0x1e35bb,null))[_0x92d2('0x33')](handleError(_0x1e35bb,null));};exports[_0x92d2('0x43')]=function(_0x3ca76d,_0x4ea26a){var _0x2e2978=_0x3ca76d[_0x92d2('0x3a')];var _0x4678d5;var _0x5dd87a;if(_0x2e2978[_0x92d2('0x14')])throw _0x2e2978;redis['get'](_0x2e2978[_0x92d2('0x44')])[_0x92d2('0x13')](function(_0x59b7be){if(!_0x59b7be)throw new Error(_0x92d2('0x45'));_0x4678d5=JSON[_0x92d2('0x46')](_0x59b7be);var _0x1badfa=Buffer[_0x92d2('0x47')](_0x2e2978[_0x92d2('0x44')],_0x92d2('0x48'))[_0x92d2('0x49')](_0x92d2('0x4a'));_0x5dd87a=JSON[_0x92d2('0x46')](_0x1badfa);if(!oauth[_0x92d2('0x4b')](_0x2e2978[_0x92d2('0x4c')],_0x4678d5[_0x92d2('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x92d2('0x4e')](_0x2e2978[_0x92d2('0x44')]);return oauth[_0x92d2('0x4f')](_0x2e2978[_0x92d2('0x50')],_0x4678d5);})['then'](function(_0x429eef){_0x4678d5[_0x92d2('0x51')]=_0x429eef['access_token'];_0x4678d5[_0x92d2('0x52')]=_0x429eef['refresh_token'];return db['CloudProvider'][_0x92d2('0x12')]({'data5':_0x4678d5['data5'],'data6':_0x4678d5[_0x92d2('0x52')]},{'where':{'id':_0x4678d5['id']}});})[_0x92d2('0x13')](function(){oauth['startRefreshInterval'](_0x4678d5);socket[_0x92d2('0x53')]('microsoftAuthorization:success',{'id':_0x5dd87a['id']});return;})[_0x92d2('0x13')](respondWithStatusCode(_0x4ea26a,null))[_0x92d2('0x33')](function(_0x560d3a){if(_0x5dd87a){socket[_0x92d2('0x53')](_0x92d2('0x54'),{'id':_0x5dd87a['id']});}if(!_0x4678d5){logger[_0x92d2('0x14')](_0x92d2('0x55'),_0x560d3a);return _0x4ea26a['status'](0x1f4)[_0x92d2('0x56')](_0x560d3a['message']);}logger[_0x92d2('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4678d5['id'],JSON['stringify'](_0x560d3a));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 3f682ef..39aed82 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 _0x160d=['path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x160d,0x7e));var _0xd160=function(_0x5cae78,_0x398e85){_0x5cae78=_0x5cae78-0x0;var _0x5394b6=_0x160d[_0x5cae78];return _0x5394b6;};'use strict';var _=require('lodash');var util=require(_0xd160('0x0'));var logger=require(_0xd160('0x1'))(_0xd160('0x2'));var moment=require(_0xd160('0x3'));var BPromise=require(_0xd160('0x4'));var rp=require(_0xd160('0x5'));var fs=require('fs');var path=require(_0xd160('0x6'));var rimraf=require(_0xd160('0x7'));var config=require('../../config/environment');var attributes=require(_0xd160('0x8'));module[_0xd160('0x9')]=function(_0x14c4a9,_0x367006){return _0x14c4a9[_0xd160('0xa')](_0xd160('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf7da=['CloudProvider','cloud_providers','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./cloudProvider.attributes','exports','define'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xf7da,0x18e));var _0xaf7d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf7da[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xaf7d('0x0'));var util=require('util');var logger=require(_0xaf7d('0x1'))('api');var moment=require(_0xaf7d('0x2'));var BPromise=require(_0xaf7d('0x3'));var rp=require(_0xaf7d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf7d('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf7d('0x6'));module[_0xaf7d('0x7')]=function(_0x3de17c,_0x5daaa9){return _0x3de17c[_0xaf7d('0x8')](_0xaf7d('0x9'),attributes,{'tableName':_0xaf7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 8c92372..602ba73 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab4e=['join','Dynamics365','/.default','replace','data2','code','stringify','toString','base64','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','set','decode','iss','aud','audience','unix','exp','data3','refresh_token','data6','decryptString','{TENANT_ID}','then','data5','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','push','data7'];(function(_0x177777,_0x126b6b){var _0x5dd5c0=function(_0xe7de6e){while(--_0xe7de6e){_0x177777['push'](_0x177777['shift']());}};_0x5dd5c0(++_0x126b6b);}(_0xab4e,0x11a));var _0xeab4=function(_0x21e26a,_0x74beb4){_0x21e26a=_0x21e26a-0x0;var _0x33f236=_0xab4e[_0x21e26a];return _0x33f236;};'use strict';var _=require(_0xeab4('0x0'));var crypto=require(_0xeab4('0x1'));var jwt=require(_0xeab4('0x2'));var moment=require(_0xeab4('0x3'));var Redis=require(_0xeab4('0x4'));var rp=require('request-promise');var util=require(_0xeab4('0x5'));var encryptor=require(_0xeab4('0x6'));var config=require(_0xeab4('0x7'));var logger=require(_0xeab4('0x8'))('api');var schedule=require(_0xeab4('0x9'));var db=require(_0xeab4('0xa'))['db'];config[_0xeab4('0xb')]=_[_0xeab4('0xc')](config[_0xeab4('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xeab4('0xb')]);var MICROSOFT_AUTH_URL=_0xeab4('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xeab4('0xe'),_0xeab4('0xf'),_0xeab4('0x10'),_0xeab4('0x11'),_0xeab4('0x12'),_0xeab4('0x13'),_0xeab4('0x14')],'Dynamics365':[_0xeab4('0xe'),_0xeab4('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xeab4('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4cd173){var _0x48515c=_[_0xeab4('0x16')](AZURE_AUTH_SCOPES[_0x4cd173[_0xeab4('0x17')]]);if(_0x4cd173[_0xeab4('0x17')]==='Dynamics365')_0x48515c[_0xeab4('0x18')](_0x4cd173[_0xeab4('0x19')]+'/.default');return _0x48515c[_0xeab4('0x1a')]('\x20');}function getAccessTokenScope(_0x29f893){if(_0x29f893[_0xeab4('0x17')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x29f893[_0xeab4('0x17')]===_0xeab4('0x1b'))return _0x29f893['data7']+_0xeab4('0x1c');}function generateMicrosoftAuthorizationUrl(_0x4cec5a,_0x10941e){var _0x23c4dd=MICROSOFT_AUTH_URL[_0xeab4('0x1d')]('{TENANT_ID}',_0x4cec5a[_0xeab4('0x1e')]);var _0x55f6da=[_0xeab4('0x1f'),'id_token'];var _0x19979f=Buffer['from'](JSON[_0xeab4('0x20')]({'id':_0x10941e}))[_0xeab4('0x21')](_0xeab4('0x22'));var _0x2315dc=crypto['randomBytes'](0x10)['toString'](_0xeab4('0x23'));var _0x259bd5=getAuthorizationScopes(_0x4cec5a);var _0x77b6f0=[{'key':_0xeab4('0x24'),'value':_0x4cec5a[_0xeab4('0x25')]},{'key':_0xeab4('0x26'),'value':encodeURIComponent(_0x55f6da[_0xeab4('0x1a')]('\x20'))},{'key':_0xeab4('0x27'),'value':_0x4cec5a[_0xeab4('0x28')]},{'key':_0xeab4('0x29'),'value':_0xeab4('0x2a')},{'key':_0xeab4('0x2b'),'value':encodeURIComponent(_0x259bd5)},{'key':_0xeab4('0x2c'),'value':_0x19979f},{'key':_0xeab4('0x2d'),'value':_0x2315dc},{'key':_0xeab4('0x2e'),'value':_0xeab4('0x2f')}];var _0x256f58=_0x23c4dd+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x77b6f0,function(_0x56d471){return _0x56d471['key']+'='+_0x56d471[_0xeab4('0x30')];})[_0xeab4('0x1a')]('&');_0x4cec5a[_0xeab4('0x31')]={'issuer':_0x23c4dd[_0xeab4('0x1d')](_0xeab4('0x32'),''),'audience':_0x4cec5a[_0xeab4('0x25')],'state':_0x19979f,'nonce':_0x2315dc};redis[_0xeab4('0x33')](_0x19979f,JSON['stringify'](_0x4cec5a));return _0x256f58;}function isValidIdToken(_0x12057e,_0x5d4e7c){try{var _0x54712c=jwt[_0xeab4('0x34')](_0x12057e,{'complete':!![]});var _0x15486d=_0x54712c['payload'];if(_0x15486d[_0xeab4('0x35')]!==_0x5d4e7c['issuer'])return![];if(_0x15486d[_0xeab4('0x36')]!==_0x5d4e7c[_0xeab4('0x37')])return![];if(_0x15486d[_0xeab4('0x2d')]!==_0x5d4e7c[_0xeab4('0x2d')])return![];if(moment()['isAfter'](moment[_0xeab4('0x38')](_0x15486d[_0xeab4('0x39')])))return![];return!![];}catch(_0x3cb93b){throw _0x3cb93b;}}function refreshOauth2MicrosoftAccessToken(_0x2b06b5){return Promise['resolve']()['then'](function(){if(_0x2b06b5[_0xeab4('0x3a')])return _0x2b06b5;return db['CloudProvider']['findOne']({'where':{'id':_0x2b06b5['id']},'raw':!![]});})['then'](function(_0x5efec7){var _0x1f2b0e={'grant_type':_0xeab4('0x3b'),'refresh_token':_0x5efec7[_0xeab4('0x3c')],'scope':getAccessTokenScope(_0x5efec7),'redirect_uri':_0x5efec7[_0xeab4('0x28')],'client_id':_0x5efec7[_0xeab4('0x25')],'client_secret':encryptor[_0xeab4('0x3d')](_0x5efec7[_0xeab4('0x3a')])};var _0x15ed44={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xeab4('0x1d')](_0xeab4('0x3e'),_0x5efec7[_0xeab4('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f2b0e,'json':!![]};return rp(_0x15ed44);})[_0xeab4('0x3f')](function(_0x52894c){_0x2b06b5[_0xeab4('0x40')]=_0x52894c['access_token'];_0x2b06b5[_0xeab4('0x3c')]=_0x52894c[_0xeab4('0x3b')];return db[_0xeab4('0x41')][_0xeab4('0x42')]({'data5':_0x2b06b5['data5'],'data6':_0x2b06b5[_0xeab4('0x3c')]},{'where':{'id':_0x2b06b5['id']}});})[_0xeab4('0x3f')](function(){return _0x2b06b5;})[_0xeab4('0x43')](function(_0x14fc30){logger[_0xeab4('0x44')](_0xeab4('0x45'),_0x2b06b5['id'],_0x14fc30);});}function getOauth2MicrosoftAccessToken(_0x50d4f9,_0x4b0982){var _0x382fda={'grant_type':_0xeab4('0x46'),'code':_0x50d4f9,'scope':getAccessTokenScope(_0x4b0982),'redirect_uri':_0x4b0982[_0xeab4('0x28')],'client_id':_0x4b0982[_0xeab4('0x25')],'client_secret':encryptor[_0xeab4('0x3d')](_0x4b0982[_0xeab4('0x3a')])};var _0x324c6b={'method':_0xeab4('0x47'),'uri':MICROSOFT_AUTH_URL[_0xeab4('0x1d')](_0xeab4('0x3e'),_0x4b0982[_0xeab4('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x382fda,'json':!![]};return rp(_0x324c6b);}function startRefreshInterval(_0x31a0c9){var _0x2021cb=schedule[_0xeab4('0x48')];if(_0x2021cb[_0x31a0c9['id']])clearInterval(_0x2021cb[_0x31a0c9['id']]);_0x2021cb[_0x31a0c9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xeab4('0x49')](this,{'id':_0x31a0c9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xeab4('0x48')]=_0x2021cb;}function startAllRefreshIntervals(){return db[_0xeab4('0x41')][_0xeab4('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xeab4('0x3f')](function(_0x5c1048){var _0x91562=_0x5c1048[_0xeab4('0x16')](function(_0x208527){return refreshOauth2MicrosoftAccessToken(_0x208527)[_0xeab4('0x3f')](function(_0x5b8632){startRefreshInterval(_0x5b8632);});});return Promise[_0xeab4('0x4b')](_0x91562);})[_0xeab4('0x43')](function(_0x16eafa){var _0x2d5760=_0x16eafa?util['inspect'](_0x16eafa,{'showHidden':![],'depth':null}):'';logger[_0xeab4('0x44')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2d5760);});}module[_0xeab4('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x0ce8=['key','value','oauth2Claims','oauth2/','set','payload','iss','issuer','aud','audience','isAfter','exp','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data5','access_token','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','replace','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','api','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','map','type','push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','from','stringify','base64','randomBytes','toString','hex','client_id','data1','redirect_uri','data4','response_mode','scope','state','nonce','prompt'];(function(_0x291882,_0x20063d){var _0x229e64=function(_0x4c59e9){while(--_0x4c59e9){_0x291882['push'](_0x291882['shift']());}};_0x229e64(++_0x20063d);}(_0x0ce8,0x102));var _0x80ce=function(_0x38a077,_0x40ce2b){_0x38a077=_0x38a077-0x0;var _0xfce4a3=_0x0ce8[_0x38a077];return _0xfce4a3;};'use strict';var _=require('lodash');var crypto=require(_0x80ce('0x0'));var jwt=require(_0x80ce('0x1'));var moment=require(_0x80ce('0x2'));var Redis=require(_0x80ce('0x3'));var rp=require(_0x80ce('0x4'));var util=require('util');var encryptor=require(_0x80ce('0x5'));var config=require(_0x80ce('0x6'));var logger=require('../../config/logger')(_0x80ce('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x80ce('0x8'))['db'];config['redis']=_['defaults'](config[_0x80ce('0x9')],{'host':_0x80ce('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x80ce('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x80ce('0xc'),_0x80ce('0xd'),'email',_0x80ce('0xe'),_0x80ce('0xf'),_0x80ce('0x10'),_0x80ce('0x11')],'Dynamics365':[_0x80ce('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d5077){var _0x5c6dcd=_[_0x80ce('0x12')](AZURE_AUTH_SCOPES[_0x2d5077[_0x80ce('0x13')]]);if(_0x2d5077[_0x80ce('0x13')]==='Dynamics365')_0x5c6dcd[_0x80ce('0x14')](_0x2d5077[_0x80ce('0x15')]+_0x80ce('0x16'));return _0x5c6dcd[_0x80ce('0x17')]('\x20');}function getAccessTokenScope(_0x26daff){if(_0x26daff[_0x80ce('0x13')]===_0x80ce('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x26daff['type']==='Dynamics365')return _0x26daff[_0x80ce('0x15')]+_0x80ce('0x16');}function generateMicrosoftAuthorizationUrl(_0x2578bf,_0x5a0bbf){var _0x2b5a88=MICROSOFT_AUTH_URL['replace'](_0x80ce('0x19'),_0x2578bf[_0x80ce('0x1a')]);var _0x37d591=['code','id_token'];var _0x5db94c=Buffer[_0x80ce('0x1b')](JSON[_0x80ce('0x1c')]({'id':_0x5a0bbf}))['toString'](_0x80ce('0x1d'));var _0x510eb6=crypto[_0x80ce('0x1e')](0x10)[_0x80ce('0x1f')](_0x80ce('0x20'));var _0x515ece=getAuthorizationScopes(_0x2578bf);var _0x2c4246=[{'key':_0x80ce('0x21'),'value':_0x2578bf[_0x80ce('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x37d591['join']('\x20'))},{'key':_0x80ce('0x23'),'value':_0x2578bf[_0x80ce('0x24')]},{'key':_0x80ce('0x25'),'value':'form_post'},{'key':_0x80ce('0x26'),'value':encodeURIComponent(_0x515ece)},{'key':_0x80ce('0x27'),'value':_0x5db94c},{'key':_0x80ce('0x28'),'value':_0x510eb6},{'key':_0x80ce('0x29'),'value':'login'}];var _0x4ebd5a=_0x2b5a88+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x80ce('0x12')](_0x2c4246,function(_0x1c6e99){return _0x1c6e99[_0x80ce('0x2a')]+'='+_0x1c6e99[_0x80ce('0x2b')];})[_0x80ce('0x17')]('&');_0x2578bf[_0x80ce('0x2c')]={'issuer':_0x2b5a88['replace'](_0x80ce('0x2d'),''),'audience':_0x2578bf[_0x80ce('0x22')],'state':_0x5db94c,'nonce':_0x510eb6};redis[_0x80ce('0x2e')](_0x5db94c,JSON[_0x80ce('0x1c')](_0x2578bf));return _0x4ebd5a;}function isValidIdToken(_0x1efa15,_0x21464b){try{var _0x1d6d81=jwt['decode'](_0x1efa15,{'complete':!![]});var _0x553318=_0x1d6d81[_0x80ce('0x2f')];if(_0x553318[_0x80ce('0x30')]!==_0x21464b[_0x80ce('0x31')])return![];if(_0x553318[_0x80ce('0x32')]!==_0x21464b[_0x80ce('0x33')])return![];if(_0x553318[_0x80ce('0x28')]!==_0x21464b[_0x80ce('0x28')])return![];if(moment()[_0x80ce('0x34')](moment['unix'](_0x553318[_0x80ce('0x35')])))return![];return!![];}catch(_0xe2397){throw _0xe2397;}}function refreshOauth2MicrosoftAccessToken(_0x469865){return Promise[_0x80ce('0x36')]()[_0x80ce('0x37')](function(){if(_0x469865[_0x80ce('0x38')])return _0x469865;return db[_0x80ce('0x39')]['findOne']({'where':{'id':_0x469865['id']},'raw':!![]});})[_0x80ce('0x37')](function(_0x4f9d15){var _0xae0ab2={'grant_type':_0x80ce('0x3a'),'refresh_token':_0x4f9d15[_0x80ce('0x3b')],'scope':getAccessTokenScope(_0x4f9d15),'redirect_uri':_0x4f9d15[_0x80ce('0x24')],'client_id':_0x4f9d15[_0x80ce('0x22')],'client_secret':encryptor[_0x80ce('0x3c')](_0x4f9d15[_0x80ce('0x38')])};var _0x511e4f={'method':_0x80ce('0x3d'),'uri':MICROSOFT_AUTH_URL['replace'](_0x80ce('0x19'),_0x4f9d15[_0x80ce('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xae0ab2,'json':!![]};return rp(_0x511e4f);})[_0x80ce('0x37')](function(_0x4288ad){_0x469865[_0x80ce('0x3e')]=_0x4288ad[_0x80ce('0x3f')];_0x469865['data6']=_0x4288ad['refresh_token'];return db['CloudProvider']['update']({'data5':_0x469865[_0x80ce('0x3e')],'data6':_0x469865['data6']},{'where':{'id':_0x469865['id']}});})['then'](function(){return _0x469865;})[_0x80ce('0x40')](function(_0x5f2413){logger['error'](_0x80ce('0x41'),_0x469865['id'],_0x5f2413);});}function getOauth2MicrosoftAccessToken(_0x2484c9,_0x500187){var _0x25af0c={'grant_type':_0x80ce('0x42'),'code':_0x2484c9,'scope':getAccessTokenScope(_0x500187),'redirect_uri':_0x500187[_0x80ce('0x24')],'client_id':_0x500187[_0x80ce('0x22')],'client_secret':encryptor[_0x80ce('0x3c')](_0x500187['data3'])};var _0x53e30f={'method':_0x80ce('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x80ce('0x43')]('{TENANT_ID}',_0x500187[_0x80ce('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x25af0c,'json':!![]};return rp(_0x53e30f);}function startRefreshInterval(_0x53e447){var _0x579f41=schedule[_0x80ce('0x44')];if(_0x579f41[_0x53e447['id']])clearInterval(_0x579f41[_0x53e447['id']]);_0x579f41[_0x53e447['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x80ce('0x45')](this,{'id':_0x53e447['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x80ce('0x44')]=_0x579f41;}function startAllRefreshIntervals(){return db[_0x80ce('0x39')][_0x80ce('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x80ce('0x37')](function(_0x15be1b){var _0xd1f4a2=_0x15be1b[_0x80ce('0x12')](function(_0x442d93){return refreshOauth2MicrosoftAccessToken(_0x442d93)[_0x80ce('0x37')](function(_0x3a19bc){startRefreshInterval(_0x3a19bc);});});return Promise[_0x80ce('0x47')](_0xd1f4a2);})['catch'](function(_0x2b813b){var _0x21d169=_0x2b813b?util[_0x80ce('0x48')](_0x2b813b,{'showHidden':![],'depth':null}):'';logger[_0x80ce('0x49')](_0x80ce('0x4a'),_0x21d169);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index c093302..9ea3df4 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 _0x30d6=['client','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x30d6,0x1b0));var _0x630d=function(_0x3e3f8b,_0x98ea26){_0x3e3f8b=_0x3e3f8b-0x0;var _0x354e47=_0x30d6[_0x3e3f8b];return _0x354e47;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8950bb,_0x3aa6f4,_0x2c1b77){return new BPromise(function(_0x4b60c1,_0x533e4f){return client[_0x630d('0x9')](_0x8950bb,_0x2c1b77)[_0x630d('0xa')](function(_0x24d260){logger[_0x630d('0xb')]('CloudProvider,\x20%s,\x20%s',_0x3aa6f4,_0x630d('0xc'));logger[_0x630d('0xd')](_0x630d('0xe'),_0x3aa6f4,_0x630d('0xc'),JSON[_0x630d('0xf')](_0x24d260));if(_0x24d260[_0x630d('0x10')]){if(_0x24d260[_0x630d('0x10')][_0x630d('0x11')]===0x1f4){logger[_0x630d('0x10')](_0x630d('0x12'),_0x3aa6f4,_0x24d260['error'][_0x630d('0x13')]);return _0x533e4f(_0x24d260['error'][_0x630d('0x13')]);}logger[_0x630d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3aa6f4,_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);return _0x4b60c1(_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);}else{logger[_0x630d('0xb')](_0x630d('0x12'),_0x3aa6f4,_0x630d('0xc'));_0x4b60c1(_0x24d260[_0x630d('0x14')]['message']);}})[_0x630d('0x15')](function(_0x4db79d){logger[_0x630d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3aa6f4,_0x4db79d);_0x533e4f(_0x4db79d);});});}
\ 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(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xcefd,0x126));var _0xdcef=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0xcefd[_0x218994];return _0x3f350b;};'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 0b5c476..723961d 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x5ee49f,_0x317771){var _0x44cca1=function(_0x1f7b6f){while(--_0x1f7b6f){_0x5ee49f['push'](_0x5ee49f['shift']());}};_0x44cca1(++_0x317771);}(_0xdb28,0x106));var _0x8db2=function(_0x4c88c7,_0x3f0882){_0x4c88c7=_0x4c88c7-0x0;var _0x2c03e7=_0xdb28[_0x4c88c7];return _0x2c03e7;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x1261,0x144));var _0x1126=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0x1261[_0x474035];return _0x1b58e0;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index ea86756..0fbdc71 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 _0x5915=['sequelize','exports','STRING'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x5915,0x14a));var _0x5591=function(_0x2d4924,_0x34b36f){_0x2d4924=_0x2d4924-0x0;var _0x2db190=_0x5915[_0x2d4924];return _0x2db190;};'use strict';var Sequelize=require(_0x5591('0x0'));module[_0x5591('0x1')]={'name':{'type':Sequelize[_0x5591('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x5591('0x2')]},'website':{'type':Sequelize[_0x5591('0x2')]},'phone':{'type':Sequelize[_0x5591('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5591('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5591('0x2')]},'country':{'type':Sequelize[_0x5591('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5591('0x2')]},'sStreet':{'type':Sequelize[_0x5591('0x2')]},'sPostalCode':{'type':Sequelize[_0x5591('0x2')]},'sCity':{'type':Sequelize[_0x5591('0x2')]},'sCountry':{'type':Sequelize[_0x5591('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5a52=['exports','name','STRING','sequelize'];(function(_0x8468c5,_0x1c7ed4){var _0x4db462=function(_0xb557fa){while(--_0xb557fa){_0x8468c5['push'](_0x8468c5['shift']());}};_0x4db462(++_0x1c7ed4);}(_0x5a52,0xc3));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x25a5('0x0'));module[_0x25a5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x25a5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x25a5('0x3')]},'companyId':{'type':Sequelize[_0x25a5('0x3')]},'website':{'type':Sequelize[_0x25a5('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x25a5('0x3')]},'type':{'type':Sequelize[_0x25a5('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x25a5('0x3')]},'country':{'type':Sequelize[_0x25a5('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x25a5('0x3')]},'sStreet':{'type':Sequelize[_0x25a5('0x3')]},'sPostalCode':{'type':Sequelize[_0x25a5('0x3')]},'sCity':{'type':Sequelize[_0x25a5('0x3')]},'sCountry':{'type':Sequelize[_0x25a5('0x3')]},'description':{'type':Sequelize[_0x25a5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 7275b2b..98d107f 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 _0xbfb8=['../../mysqldb','status','end','offset','undefined','Content-Range','json','apply','reject','save','then','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','count','includeAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','autoAssociation','update','destroy','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x44ab0b,_0x4a2fc4){var _0x54f695=function(_0x27da24){while(--_0x27da24){_0x44ab0b['push'](_0x44ab0b['shift']());}};_0x54f695(++_0x4a2fc4);}(_0xbfb8,0x195));var _0x8bfb=function(_0xf7d2be,_0x559b6c){_0xf7d2be=_0xf7d2be-0x0;var _0x1e62c3=_0xbfb8[_0xf7d2be];return _0x1e62c3;};'use strict';var emlformat=require(_0x8bfb('0x0'));var rimraf=require(_0x8bfb('0x1'));var zipdir=require(_0x8bfb('0x2'));var jsonpatch=require(_0x8bfb('0x3'));var rp=require(_0x8bfb('0x4'));var moment=require(_0x8bfb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8bfb('0x6'));var util=require('util');var path=require(_0x8bfb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8bfb('0x8'));var fs=require('fs');var fs_extra=require(_0x8bfb('0x9'));var _=require(_0x8bfb('0xa'));var squel=require(_0x8bfb('0xb'));var crypto=require(_0x8bfb('0xc'));var jsforce=require(_0x8bfb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8bfb('0xe'));var querystring=require(_0x8bfb('0xf'));var Papa=require(_0x8bfb('0x10'));var Redis=require(_0x8bfb('0x11'));var authService=require(_0x8bfb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8bfb('0x13'));var hardwareService=require(_0x8bfb('0x14'));var logger=require(_0x8bfb('0x15'))(_0x8bfb('0x16'));var utils=require('../../config/utils');var config=require(_0x8bfb('0x17'));var licenseUtil=require(_0x8bfb('0x18'));var db=require(_0x8bfb('0x19'))['db'];function respondWithStatusCode(_0x12dec1,_0x4ac179){_0x4ac179=_0x4ac179||0xcc;return function(_0x4985c5){if(_0x4985c5){return _0x12dec1['sendStatus'](_0x4ac179);}return _0x12dec1[_0x8bfb('0x1a')](_0x4ac179)[_0x8bfb('0x1b')]();};}function respondWithResult(_0x48e8a0,_0x36657f){_0x36657f=_0x36657f||0xc8;return function(_0x52e22b){if(_0x52e22b){return _0x48e8a0[_0x8bfb('0x1a')](_0x36657f)['json'](_0x52e22b);}};}function respondWithFilteredResult(_0x5c615d,_0x31a02c){return function(_0x87c62a){if(_0x87c62a){var _0x1a10ad=typeof _0x31a02c[_0x8bfb('0x1c')]===_0x8bfb('0x1d')&&typeof _0x31a02c['limit']===_0x8bfb('0x1d');var _0xbe5c42=_0x87c62a['count'];var _0x2a7ea2=_0x1a10ad?0x0:_0x31a02c[_0x8bfb('0x1c')];var _0x301c8a=_0x1a10ad?_0x87c62a['count']:_0x31a02c[_0x8bfb('0x1c')]+_0x31a02c['limit'];var _0x4ca033;if(_0x301c8a>=_0xbe5c42){_0x301c8a=_0xbe5c42;_0x4ca033=0xc8;}else{_0x4ca033=0xce;}_0x5c615d[_0x8bfb('0x1a')](_0x4ca033);return _0x5c615d['set'](_0x8bfb('0x1e'),_0x2a7ea2+'-'+_0x301c8a+'/'+_0xbe5c42)[_0x8bfb('0x1f')](_0x87c62a);}return null;};}function patchUpdates(_0xc949c7){return function(_0x2da1c0){try{jsonpatch[_0x8bfb('0x20')](_0x2da1c0,_0xc949c7,!![]);}catch(_0x1e36f0){return BPromise[_0x8bfb('0x21')](_0x1e36f0);}return _0x2da1c0[_0x8bfb('0x22')]();};}function saveUpdates(_0x11d2fa,_0x1220ac){return function(_0x56a39c){if(_0x56a39c){return _0x56a39c['update'](_0x11d2fa)['then'](function(_0x31b718){return _0x31b718;});}return null;};}function removeEntity(_0x1a412b,_0x5a8673){return function(_0x259b18){if(_0x259b18){return _0x259b18['destroy']()[_0x8bfb('0x23')](function(){var _0x4622d7=_0x259b18['get']({'plain':!![]});var _0x2a290c='Companies';return db[_0x8bfb('0x24')]['destroy']({'where':{'type':_0x2a290c,'resourceId':_0x4622d7['id']}})[_0x8bfb('0x23')](function(){return _0x259b18;});})['then'](function(){_0x1a412b[_0x8bfb('0x1a')](0xcc)[_0x8bfb('0x1b')]();});}};}function handleEntityNotFound(_0x2be4de,_0x59e449){return function(_0x539c6b){if(!_0x539c6b){_0x2be4de[_0x8bfb('0x25')](0x194);}return _0x539c6b;};}function handleError(_0x187849,_0x487462){_0x487462=_0x487462||0x1f4;return function(_0x58bd61){logger[_0x8bfb('0x26')](_0x58bd61[_0x8bfb('0x27')]);if(_0x58bd61[_0x8bfb('0x28')]){delete _0x58bd61['name'];}_0x187849[_0x8bfb('0x1a')](_0x487462)[_0x8bfb('0x29')](_0x58bd61);};}exports[_0x8bfb('0x2a')]=function(_0x5bef19,_0xd6e3fe){var _0x5dfd1b={},_0x1b27da={},_0x6bd547={'count':0x0,'rows':[]};return db[_0x8bfb('0x2b')][_0x8bfb('0x2c')]()[_0x8bfb('0x23')](function(_0x48a054){_0x1b27da[_0x8bfb('0x2d')]=_[_0x8bfb('0x2e')](_0x48a054);_0x1b27da[_0x8bfb('0x2f')]=_[_0x8bfb('0x2e')](_0x5bef19[_0x8bfb('0x2f')]);_0x1b27da[_0x8bfb('0x30')]=_[_0x8bfb('0x31')](_0x1b27da[_0x8bfb('0x2d')],_0x1b27da[_0x8bfb('0x2f')]);_0x5dfd1b[_0x8bfb('0x32')]=_['intersection'](_0x1b27da[_0x8bfb('0x2d')],qs['fields'](_0x5bef19['query'][_0x8bfb('0x33')]));_0x5dfd1b[_0x8bfb('0x32')]=_0x5dfd1b[_0x8bfb('0x32')][_0x8bfb('0x34')]?_0x5dfd1b[_0x8bfb('0x32')]:_0x1b27da[_0x8bfb('0x2d')];if(!_0x5bef19[_0x8bfb('0x2f')][_0x8bfb('0x35')](_0x8bfb('0x36'))){_0x5dfd1b[_0x8bfb('0x37')]=qs[_0x8bfb('0x37')](_0x5bef19['query']['limit']);_0x5dfd1b[_0x8bfb('0x1c')]=qs['offset'](_0x5bef19[_0x8bfb('0x2f')][_0x8bfb('0x1c')]);}_0x5dfd1b['order']=qs[_0x8bfb('0x38')](_0x5bef19['query'][_0x8bfb('0x38')]);_0x5dfd1b[_0x8bfb('0x39')]=qs[_0x8bfb('0x30')](_['pick'](_0x5bef19['query'],_0x1b27da[_0x8bfb('0x30')]),_0x48a054);if(_0x5bef19['query'][_0x8bfb('0x3a')]){_0x5dfd1b['where']=_[_0x8bfb('0x3b')](_0x5dfd1b[_0x8bfb('0x39')],{'$or':_[_0x8bfb('0x3c')](_0x5dfd1b[_0x8bfb('0x32')],function(_0x485f38){var _0x4e7a15={};_0x4e7a15[_0x485f38]={'$like':'%'+_0x5bef19[_0x8bfb('0x2f')]['filter']+'%'};return _0x4e7a15;})});}_0x5dfd1b=_['merge']({},_0x5dfd1b,_0x5bef19['options']);var _0xbffa9d={'where':_0x5dfd1b['where']};return db[_0x8bfb('0x2b')][_0x8bfb('0x3d')](_0xbffa9d)[_0x8bfb('0x23')](function(_0x4b2163){_0x6bd547[_0x8bfb('0x3d')]=_0x4b2163;if(_0x5bef19[_0x8bfb('0x2f')][_0x8bfb('0x3e')]){_0x5dfd1b['include']=[{'all':!![]}];}return db[_0x8bfb('0x2b')]['findAll'](_0x5dfd1b);})[_0x8bfb('0x23')](function(_0x2855f6){_0x6bd547[_0x8bfb('0x3f')]=_0x2855f6;return _0x6bd547;})[_0x8bfb('0x23')](respondWithFilteredResult(_0xd6e3fe,_0x5dfd1b))[_0x8bfb('0x40')](handleError(_0xd6e3fe,null));})[_0x8bfb('0x40')](handleError(_0xd6e3fe,null));};exports[_0x8bfb('0x41')]=function(_0x4d5806,_0x527421){var _0x19f42e={'raw':![],'where':{'id':_0x4d5806[_0x8bfb('0x42')]['id']}},_0x5dbe5d={};_0x5dbe5d[_0x8bfb('0x2d')]=_['keys'](db[_0x8bfb('0x2b')][_0x8bfb('0x43')]);_0x5dbe5d[_0x8bfb('0x2f')]=_[_0x8bfb('0x2e')](_0x4d5806[_0x8bfb('0x2f')]);_0x5dbe5d[_0x8bfb('0x30')]=_['intersection'](_0x5dbe5d['model'],_0x5dbe5d[_0x8bfb('0x2f')]);_0x19f42e[_0x8bfb('0x32')]=_[_0x8bfb('0x31')](_0x5dbe5d['model'],qs[_0x8bfb('0x33')](_0x4d5806[_0x8bfb('0x2f')][_0x8bfb('0x33')]));_0x19f42e['attributes']=_0x19f42e[_0x8bfb('0x32')][_0x8bfb('0x34')]?_0x19f42e[_0x8bfb('0x32')]:_0x5dbe5d[_0x8bfb('0x2d')];if(_0x4d5806[_0x8bfb('0x2f')][_0x8bfb('0x3e')]){_0x19f42e[_0x8bfb('0x44')]=[{'all':!![]}];}_0x19f42e=_['merge']({},_0x19f42e,_0x4d5806[_0x8bfb('0x45')]);return db['CmCompany'][_0x8bfb('0x46')](_0x19f42e)['then'](handleEntityNotFound(_0x527421,null))[_0x8bfb('0x23')](respondWithResult(_0x527421,null))[_0x8bfb('0x40')](handleError(_0x527421,null));};exports['create']=function(_0x36742e,_0x97f27a){return db[_0x8bfb('0x2b')][_0x8bfb('0x47')](_0x36742e[_0x8bfb('0x48')],{})['then'](function(_0x567824){var _0x1f2bf2=_0x36742e['user'][_0x8bfb('0x49')]({'plain':!![]});if(!_0x1f2bf2)throw new Error(_0x8bfb('0x4a'));if(_0x1f2bf2[_0x8bfb('0x4b')]==='user'){var _0x1b2ef5=_0x567824[_0x8bfb('0x49')]({'plain':!![]});var _0x38e2aa=_0x8bfb('0x4c');return db[_0x8bfb('0x4d')][_0x8bfb('0x46')]({'where':{'name':_0x38e2aa,'userProfileId':_0x1f2bf2['userProfileId']},'raw':!![]})[_0x8bfb('0x23')](function(_0x173ca1){if(_0x173ca1&&_0x173ca1[_0x8bfb('0x4e')]===0x0){return db[_0x8bfb('0x24')][_0x8bfb('0x47')]({'name':_0x1b2ef5[_0x8bfb('0x28')],'resourceId':_0x1b2ef5['id'],'type':_0x173ca1[_0x8bfb('0x28')],'sectionId':_0x173ca1['id']},{})[_0x8bfb('0x23')](function(){return _0x567824;});}else{return _0x567824;}})['catch'](function(_0x24a89d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24a89d);throw _0x24a89d;});}return _0x567824;})[_0x8bfb('0x23')](respondWithResult(_0x97f27a,0xc9))[_0x8bfb('0x40')](handleError(_0x97f27a,null));};exports[_0x8bfb('0x4f')]=function(_0x429620,_0x2a731d){if(_0x429620['body']['id']){delete _0x429620[_0x8bfb('0x48')]['id'];}return db[_0x8bfb('0x2b')][_0x8bfb('0x46')]({'where':{'id':_0x429620[_0x8bfb('0x42')]['id']}})[_0x8bfb('0x23')](handleEntityNotFound(_0x2a731d,null))['then'](saveUpdates(_0x429620['body'],null))[_0x8bfb('0x23')](respondWithResult(_0x2a731d,null))[_0x8bfb('0x40')](handleError(_0x2a731d,null));};exports[_0x8bfb('0x50')]=function(_0x13754b,_0x24ae60){return db[_0x8bfb('0x2b')][_0x8bfb('0x46')]({'where':{'id':_0x13754b[_0x8bfb('0x42')]['id']}})[_0x8bfb('0x23')](handleEntityNotFound(_0x24ae60,null))['then'](removeEntity(_0x24ae60,null))[_0x8bfb('0x40')](handleError(_0x24ae60,null));};exports['describe']=function(_0x1121e7,_0x353e64){return db[_0x8bfb('0x2b')][_0x8bfb('0x2c')]()[_0x8bfb('0x23')](respondWithResult(_0x353e64,null))[_0x8bfb('0x40')](handleError(_0x353e64,null));};exports[_0x8bfb('0x51')]=function(_0x44360d,_0x5a63c9,_0xd1099b){return db[_0x8bfb('0x52')][_0x8bfb('0x46')]({'where':{'id':_0x44360d[_0x8bfb('0x42')]['id']}})[_0x8bfb('0x23')](handleEntityNotFound(_0x5a63c9,null))['then'](function(_0x90d476){if(_0x90d476){return _0x90d476['addContacts'](_0x44360d[_0x8bfb('0x48')][_0x8bfb('0x53')],_[_0x8bfb('0x54')](_0x44360d[_0x8bfb('0x48')],[_0x8bfb('0x53'),'id'])||{});}})[_0x8bfb('0x23')](respondWithResult(_0x5a63c9,null))[_0x8bfb('0x40')](handleError(_0x5a63c9,null));};exports['getContacts']=function(_0x405c91,_0x1a6631,_0x50715f){var _0x378879={};var _0x566903={};var _0x8ac9ce;var _0xbfb29b;return db[_0x8bfb('0x2b')]['findOne']({'where':{'id':_0x405c91[_0x8bfb('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a6631,null))['then'](function(_0x23d001){if(_0x23d001){_0x8ac9ce=_0x23d001;_0x566903[_0x8bfb('0x2d')]=_[_0x8bfb('0x2e')](db[_0x8bfb('0x52')][_0x8bfb('0x43')]);_0x566903[_0x8bfb('0x2f')]=_[_0x8bfb('0x2e')](_0x405c91[_0x8bfb('0x2f')]);_0x566903[_0x8bfb('0x30')]=_[_0x8bfb('0x31')](_0x566903[_0x8bfb('0x2d')],_0x566903[_0x8bfb('0x2f')]);_0x378879[_0x8bfb('0x32')]=_[_0x8bfb('0x31')](_0x566903[_0x8bfb('0x2d')],qs[_0x8bfb('0x33')](_0x405c91['query'][_0x8bfb('0x33')]));_0x378879[_0x8bfb('0x32')]=_0x378879[_0x8bfb('0x32')][_0x8bfb('0x34')]?_0x378879[_0x8bfb('0x32')]:_0x566903[_0x8bfb('0x2d')];_0x378879['order']=qs[_0x8bfb('0x38')](_0x405c91['query'][_0x8bfb('0x38')]);_0x378879[_0x8bfb('0x39')]=qs[_0x8bfb('0x30')](_['pick'](_0x405c91[_0x8bfb('0x2f')],_0x566903['filters']));if(_0x405c91[_0x8bfb('0x2f')][_0x8bfb('0x3a')]){_0x378879[_0x8bfb('0x39')]=_[_0x8bfb('0x3b')](_0x378879[_0x8bfb('0x39')],{'$or':_['map'](_0x378879[_0x8bfb('0x32')],function(_0x1d1312){var _0x360210={};_0x360210[_0x1d1312]={'$like':'%'+_0x405c91[_0x8bfb('0x2f')]['filter']+'%'};return _0x360210;})});}_0x378879=_[_0x8bfb('0x3b')]({},_0x378879,_0x405c91[_0x8bfb('0x45')]);return _0x8ac9ce[_0x8bfb('0x55')](_0x378879);}})[_0x8bfb('0x23')](function(_0x5580c0){if(_0x5580c0){_0xbfb29b=_0x5580c0[_0x8bfb('0x34')];if(!_0x405c91[_0x8bfb('0x2f')][_0x8bfb('0x35')]('nolimit')){_0x378879[_0x8bfb('0x37')]=qs[_0x8bfb('0x37')](_0x405c91[_0x8bfb('0x2f')][_0x8bfb('0x37')]);_0x378879['offset']=qs[_0x8bfb('0x1c')](_0x405c91['query'][_0x8bfb('0x1c')]);}return _0x8ac9ce['getContacts'](_0x378879);}})['then'](function(_0x32daf5){if(_0x32daf5){return _0x32daf5?{'count':_0xbfb29b,'rows':_0x32daf5}:null;}})['then'](respondWithResult(_0x1a6631,null))['catch'](handleError(_0x1a6631,null));};
\ No newline at end of file
+var _0x8997=['json','offset','undefined','limit','count','set','apply','reject','save','then','get','UserProfileResource','end','error','stack','name','send','index','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','merge','options','includeAll','include','catch','show','params','rawAttributes','CmCompany','find','create','body','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','CmContact','addContacts','omit','ids','findOne','order','filter','getContacts','fast-json-patch','request-promise','bluebird','mustache','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x50c89d,_0xb15283){var _0x2d4011=function(_0x2650fc){while(--_0x2650fc){_0x50c89d['push'](_0x50c89d['shift']());}};_0x2d4011(++_0xb15283);}(_0x8997,0x91));var _0x7899=function(_0x4256df,_0x28716d){_0x4256df=_0x4256df-0x0;var _0x389042=_0x8997[_0x4256df];return _0x389042;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7899('0x0'));var rp=require(_0x7899('0x1'));var moment=require('moment');var BPromise=require(_0x7899('0x2'));var Mustache=require(_0x7899('0x3'));var util=require('util');var path=require('path');var sox=require(_0x7899('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7899('0x5'));var crypto=require(_0x7899('0x6'));var jsforce=require('jsforce');var deskjs=require(_0x7899('0x7'));var toCsv=require(_0x7899('0x8'));var querystring=require(_0x7899('0x9'));var Papa=require(_0x7899('0xa'));var Redis=require(_0x7899('0xb'));var authService=require(_0x7899('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x7899('0xd'));var hardwareService=require(_0x7899('0xe'));var logger=require(_0x7899('0xf'))(_0x7899('0x10'));var utils=require(_0x7899('0x11'));var config=require(_0x7899('0x12'));var licenseUtil=require(_0x7899('0x13'));var db=require(_0x7899('0x14'))['db'];function respondWithStatusCode(_0x2f10ae,_0x567551){_0x567551=_0x567551||0xcc;return function(_0x1ac303){if(_0x1ac303){return _0x2f10ae[_0x7899('0x15')](_0x567551);}return _0x2f10ae[_0x7899('0x16')](_0x567551)['end']();};}function respondWithResult(_0xc31d1d,_0x580c9e){_0x580c9e=_0x580c9e||0xc8;return function(_0x3e2132){if(_0x3e2132){return _0xc31d1d[_0x7899('0x16')](_0x580c9e)[_0x7899('0x17')](_0x3e2132);}};}function respondWithFilteredResult(_0x12e9f3,_0x3a50d1){return function(_0x151108){if(_0x151108){var _0x9d0ecc=typeof _0x3a50d1[_0x7899('0x18')]===_0x7899('0x19')&&typeof _0x3a50d1[_0x7899('0x1a')]==='undefined';var _0x246a52=_0x151108['count'];var _0x5b0fa0=_0x9d0ecc?0x0:_0x3a50d1[_0x7899('0x18')];var _0x19b84c=_0x9d0ecc?_0x151108[_0x7899('0x1b')]:_0x3a50d1[_0x7899('0x18')]+_0x3a50d1[_0x7899('0x1a')];var _0x56cc27;if(_0x19b84c>=_0x246a52){_0x19b84c=_0x246a52;_0x56cc27=0xc8;}else{_0x56cc27=0xce;}_0x12e9f3[_0x7899('0x16')](_0x56cc27);return _0x12e9f3[_0x7899('0x1c')]('Content-Range',_0x5b0fa0+'-'+_0x19b84c+'/'+_0x246a52)['json'](_0x151108);}return null;};}function patchUpdates(_0x34b18a){return function(_0x44eab6){try{jsonpatch[_0x7899('0x1d')](_0x44eab6,_0x34b18a,!![]);}catch(_0x2e5103){return BPromise[_0x7899('0x1e')](_0x2e5103);}return _0x44eab6[_0x7899('0x1f')]();};}function saveUpdates(_0x370f55,_0x5799e0){return function(_0x1931b6){if(_0x1931b6){return _0x1931b6['update'](_0x370f55)[_0x7899('0x20')](function(_0x317a7d){return _0x317a7d;});}return null;};}function removeEntity(_0x19b659,_0x1fd7d5){return function(_0x5541bd){if(_0x5541bd){return _0x5541bd['destroy']()[_0x7899('0x20')](function(){var _0x54dac9=_0x5541bd[_0x7899('0x21')]({'plain':!![]});var _0x504436='Companies';return db[_0x7899('0x22')]['destroy']({'where':{'type':_0x504436,'resourceId':_0x54dac9['id']}})[_0x7899('0x20')](function(){return _0x5541bd;});})[_0x7899('0x20')](function(){_0x19b659[_0x7899('0x16')](0xcc)[_0x7899('0x23')]();});}};}function handleEntityNotFound(_0x413e01,_0x50f960){return function(_0x2078ea){if(!_0x2078ea){_0x413e01[_0x7899('0x15')](0x194);}return _0x2078ea;};}function handleError(_0x4e8088,_0x57483a){_0x57483a=_0x57483a||0x1f4;return function(_0x3f66e1){logger[_0x7899('0x24')](_0x3f66e1[_0x7899('0x25')]);if(_0x3f66e1[_0x7899('0x26')]){delete _0x3f66e1[_0x7899('0x26')];}_0x4e8088[_0x7899('0x16')](_0x57483a)[_0x7899('0x27')](_0x3f66e1);};}exports[_0x7899('0x28')]=function(_0x3848bb,_0x304331){var _0x51aef5={},_0x4ef86c={},_0x4213b5={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0x1aff66){_0x4ef86c['model']=_[_0x7899('0x29')](_0x1aff66);_0x4ef86c[_0x7899('0x2a')]=_[_0x7899('0x29')](_0x3848bb[_0x7899('0x2a')]);_0x4ef86c[_0x7899('0x2b')]=_[_0x7899('0x2c')](_0x4ef86c[_0x7899('0x2d')],_0x4ef86c['query']);_0x51aef5[_0x7899('0x2e')]=_[_0x7899('0x2c')](_0x4ef86c[_0x7899('0x2d')],qs[_0x7899('0x2f')](_0x3848bb[_0x7899('0x2a')]['fields']));_0x51aef5[_0x7899('0x2e')]=_0x51aef5[_0x7899('0x2e')][_0x7899('0x30')]?_0x51aef5[_0x7899('0x2e')]:_0x4ef86c[_0x7899('0x2d')];if(!_0x3848bb[_0x7899('0x2a')][_0x7899('0x31')](_0x7899('0x32'))){_0x51aef5[_0x7899('0x1a')]=qs[_0x7899('0x1a')](_0x3848bb[_0x7899('0x2a')][_0x7899('0x1a')]);_0x51aef5[_0x7899('0x18')]=qs[_0x7899('0x18')](_0x3848bb['query'][_0x7899('0x18')]);}_0x51aef5['order']=qs[_0x7899('0x33')](_0x3848bb[_0x7899('0x2a')][_0x7899('0x33')]);_0x51aef5[_0x7899('0x34')]=qs[_0x7899('0x2b')](_[_0x7899('0x35')](_0x3848bb[_0x7899('0x2a')],_0x4ef86c['filters']),_0x1aff66);if(_0x3848bb[_0x7899('0x2a')]['filter']){_0x51aef5['where']=_['merge'](_0x51aef5[_0x7899('0x34')],{'$or':_[_0x7899('0x36')](_0x51aef5[_0x7899('0x2e')],function(_0x4cf08e){var _0x31edee={};_0x31edee[_0x4cf08e]={'$like':'%'+_0x3848bb['query']['filter']+'%'};return _0x31edee;})});}_0x51aef5=_[_0x7899('0x37')]({},_0x51aef5,_0x3848bb[_0x7899('0x38')]);var _0x1527bf={'where':_0x51aef5[_0x7899('0x34')]};return db['CmCompany'][_0x7899('0x1b')](_0x1527bf)['then'](function(_0x2e7baf){_0x4213b5[_0x7899('0x1b')]=_0x2e7baf;if(_0x3848bb[_0x7899('0x2a')][_0x7899('0x39')]){_0x51aef5[_0x7899('0x3a')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x51aef5);})[_0x7899('0x20')](function(_0x51797c){_0x4213b5['rows']=_0x51797c;return _0x4213b5;})[_0x7899('0x20')](respondWithFilteredResult(_0x304331,_0x51aef5))[_0x7899('0x3b')](handleError(_0x304331,null));})[_0x7899('0x3b')](handleError(_0x304331,null));};exports[_0x7899('0x3c')]=function(_0x21cf80,_0x129771){var _0x1878e6={'raw':![],'where':{'id':_0x21cf80[_0x7899('0x3d')]['id']}},_0x17ea9b={};_0x17ea9b[_0x7899('0x2d')]=_[_0x7899('0x29')](db['CmCompany'][_0x7899('0x3e')]);_0x17ea9b['query']=_['keys'](_0x21cf80['query']);_0x17ea9b[_0x7899('0x2b')]=_['intersection'](_0x17ea9b[_0x7899('0x2d')],_0x17ea9b[_0x7899('0x2a')]);_0x1878e6['attributes']=_['intersection'](_0x17ea9b['model'],qs['fields'](_0x21cf80[_0x7899('0x2a')][_0x7899('0x2f')]));_0x1878e6['attributes']=_0x1878e6[_0x7899('0x2e')][_0x7899('0x30')]?_0x1878e6[_0x7899('0x2e')]:_0x17ea9b['model'];if(_0x21cf80[_0x7899('0x2a')][_0x7899('0x39')]){_0x1878e6[_0x7899('0x3a')]=[{'all':!![]}];}_0x1878e6=_[_0x7899('0x37')]({},_0x1878e6,_0x21cf80[_0x7899('0x38')]);return db[_0x7899('0x3f')][_0x7899('0x40')](_0x1878e6)[_0x7899('0x20')](handleEntityNotFound(_0x129771,null))[_0x7899('0x20')](respondWithResult(_0x129771,null))[_0x7899('0x3b')](handleError(_0x129771,null));};exports[_0x7899('0x41')]=function(_0x51e745,_0x12e7f9){return db[_0x7899('0x3f')][_0x7899('0x41')](_0x51e745[_0x7899('0x42')],{})['then'](function(_0x5ea572){var _0x4da096=_0x51e745['user']['get']({'plain':!![]});if(!_0x4da096)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4da096[_0x7899('0x43')]==='user'){var _0x15f70e=_0x5ea572[_0x7899('0x21')]({'plain':!![]});var _0x3d57b0=_0x7899('0x44');return db[_0x7899('0x45')][_0x7899('0x40')]({'where':{'name':_0x3d57b0,'userProfileId':_0x4da096[_0x7899('0x46')]},'raw':!![]})['then'](function(_0x50b3f6){if(_0x50b3f6&&_0x50b3f6[_0x7899('0x47')]===0x0){return db[_0x7899('0x22')]['create']({'name':_0x15f70e['name'],'resourceId':_0x15f70e['id'],'type':_0x50b3f6[_0x7899('0x26')],'sectionId':_0x50b3f6['id']},{})[_0x7899('0x20')](function(){return _0x5ea572;});}else{return _0x5ea572;}})['catch'](function(_0x3912b9){logger[_0x7899('0x24')](_0x7899('0x48'),_0x3912b9);throw _0x3912b9;});}return _0x5ea572;})[_0x7899('0x20')](respondWithResult(_0x12e7f9,0xc9))[_0x7899('0x3b')](handleError(_0x12e7f9,null));};exports[_0x7899('0x49')]=function(_0xd39e3c,_0x4ed274){if(_0xd39e3c[_0x7899('0x42')]['id']){delete _0xd39e3c['body']['id'];}return db[_0x7899('0x3f')][_0x7899('0x40')]({'where':{'id':_0xd39e3c['params']['id']}})[_0x7899('0x20')](handleEntityNotFound(_0x4ed274,null))['then'](saveUpdates(_0xd39e3c[_0x7899('0x42')],null))[_0x7899('0x20')](respondWithResult(_0x4ed274,null))[_0x7899('0x3b')](handleError(_0x4ed274,null));};exports[_0x7899('0x4a')]=function(_0x414525,_0x1129fb){return db[_0x7899('0x3f')]['find']({'where':{'id':_0x414525[_0x7899('0x3d')]['id']}})[_0x7899('0x20')](handleEntityNotFound(_0x1129fb,null))['then'](removeEntity(_0x1129fb,null))[_0x7899('0x3b')](handleError(_0x1129fb,null));};exports[_0x7899('0x4b')]=function(_0x124278,_0x581a36){return db[_0x7899('0x3f')][_0x7899('0x4b')]()['then'](respondWithResult(_0x581a36,null))['catch'](handleError(_0x581a36,null));};exports['addContacts']=function(_0x11f8cf,_0x1674f8,_0x50961f){return db[_0x7899('0x4c')]['find']({'where':{'id':_0x11f8cf[_0x7899('0x3d')]['id']}})[_0x7899('0x20')](handleEntityNotFound(_0x1674f8,null))['then'](function(_0x16302d){if(_0x16302d){return _0x16302d[_0x7899('0x4d')](_0x11f8cf['body']['ids'],_[_0x7899('0x4e')](_0x11f8cf[_0x7899('0x42')],[_0x7899('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x1674f8,null))[_0x7899('0x3b')](handleError(_0x1674f8,null));};exports['getContacts']=function(_0x130763,_0x2d7413,_0x18bef2){var _0x2ffdcb={};var _0x5ac46a={};var _0x29602a;var _0x266fd0;return db[_0x7899('0x3f')][_0x7899('0x50')]({'where':{'id':_0x130763[_0x7899('0x3d')]['id']}})[_0x7899('0x20')](handleEntityNotFound(_0x2d7413,null))[_0x7899('0x20')](function(_0x5a32ed){if(_0x5a32ed){_0x29602a=_0x5a32ed;_0x5ac46a[_0x7899('0x2d')]=_[_0x7899('0x29')](db[_0x7899('0x4c')]['rawAttributes']);_0x5ac46a['query']=_['keys'](_0x130763[_0x7899('0x2a')]);_0x5ac46a[_0x7899('0x2b')]=_[_0x7899('0x2c')](_0x5ac46a['model'],_0x5ac46a[_0x7899('0x2a')]);_0x2ffdcb[_0x7899('0x2e')]=_['intersection'](_0x5ac46a[_0x7899('0x2d')],qs[_0x7899('0x2f')](_0x130763[_0x7899('0x2a')][_0x7899('0x2f')]));_0x2ffdcb[_0x7899('0x2e')]=_0x2ffdcb[_0x7899('0x2e')][_0x7899('0x30')]?_0x2ffdcb[_0x7899('0x2e')]:_0x5ac46a[_0x7899('0x2d')];_0x2ffdcb[_0x7899('0x51')]=qs[_0x7899('0x33')](_0x130763[_0x7899('0x2a')]['sort']);_0x2ffdcb[_0x7899('0x34')]=qs[_0x7899('0x2b')](_[_0x7899('0x35')](_0x130763[_0x7899('0x2a')],_0x5ac46a[_0x7899('0x2b')]));if(_0x130763[_0x7899('0x2a')][_0x7899('0x52')]){_0x2ffdcb[_0x7899('0x34')]=_[_0x7899('0x37')](_0x2ffdcb[_0x7899('0x34')],{'$or':_[_0x7899('0x36')](_0x2ffdcb[_0x7899('0x2e')],function(_0x4952d9){var _0x17dbac={};_0x17dbac[_0x4952d9]={'$like':'%'+_0x130763[_0x7899('0x2a')][_0x7899('0x52')]+'%'};return _0x17dbac;})});}_0x2ffdcb=_[_0x7899('0x37')]({},_0x2ffdcb,_0x130763[_0x7899('0x38')]);return _0x29602a[_0x7899('0x53')](_0x2ffdcb);}})[_0x7899('0x20')](function(_0x476e29){if(_0x476e29){_0x266fd0=_0x476e29[_0x7899('0x30')];if(!_0x130763[_0x7899('0x2a')]['hasOwnProperty'](_0x7899('0x32'))){_0x2ffdcb[_0x7899('0x1a')]=qs['limit'](_0x130763['query'][_0x7899('0x1a')]);_0x2ffdcb[_0x7899('0x18')]=qs[_0x7899('0x18')](_0x130763[_0x7899('0x2a')][_0x7899('0x18')]);}return _0x29602a['getContacts'](_0x2ffdcb);}})[_0x7899('0x20')](function(_0x388f8d){if(_0x388f8d){return _0x388f8d?{'count':_0x266fd0,'rows':_0x388f8d}:null;}})[_0x7899('0x20')](respondWithResult(_0x2d7413,null))['catch'](handleError(_0x2d7413,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 6b916d1..a8b0b24 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 _0x42cd=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','define','CmCompany','cm_companies'];(function(_0x4d168e,_0x2c6b65){var _0x2009e1=function(_0x51b144){while(--_0x51b144){_0x4d168e['push'](_0x4d168e['shift']());}};_0x2009e1(++_0x2c6b65);}(_0x42cd,0xf0));var _0xd42c=function(_0x3282a2,_0xb4b2c9){_0x3282a2=_0x3282a2-0x0;var _0xdec417=_0x42cd[_0x3282a2];return _0xdec417;};'use strict';var _=require(_0xd42c('0x0'));var util=require(_0xd42c('0x1'));var logger=require(_0xd42c('0x2'))(_0xd42c('0x3'));var moment=require('moment');var BPromise=require(_0xd42c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd42c('0x5'));var rimraf=require('rimraf');var config=require(_0xd42c('0x6'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x29bc09,_0xa3d6f){return _0x29bc09[_0xd42c('0x7')](_0xd42c('0x8'),attributes,{'tableName':_0xd42c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x991d=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies'];(function(_0x47cf89,_0x3990bb){var _0x53fdf7=function(_0x1e5b81){while(--_0x1e5b81){_0x47cf89['push'](_0x47cf89['shift']());}};_0x53fdf7(++_0x3990bb);}(_0x991d,0xdc));var _0xd991=function(_0x170e68,_0x354ac5){_0x170e68=_0x170e68-0x0;var _0x4d2a76=_0x991d[_0x170e68];return _0x4d2a76;};'use strict';var _=require('lodash');var util=require(_0xd991('0x0'));var logger=require(_0xd991('0x1'))(_0xd991('0x2'));var moment=require('moment');var BPromise=require(_0xd991('0x3'));var rp=require(_0xd991('0x4'));var fs=require('fs');var path=require(_0xd991('0x5'));var rimraf=require('rimraf');var config=require(_0xd991('0x6'));var attributes=require(_0xd991('0x7'));module[_0xd991('0x8')]=function(_0x42f1ad,_0x16e098){return _0x42f1ad['define'](_0xd991('0x9'),attributes,{'tableName':_0xd991('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 18ea631..85645a9 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 _0xa59f=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa59f,0x16b));var _0xfa59=function(_0x51fe46,_0xb550d1){_0x51fe46=_0x51fe46-0x0;var _0x4d62c2=_0xa59f[_0x51fe46];return _0x4d62c2;};'use strict';var _=require(_0xfa59('0x0'));var util=require(_0xfa59('0x1'));var moment=require(_0xfa59('0x2'));var BPromise=require(_0xfa59('0x3'));var rs=require(_0xfa59('0x4'));var fs=require('fs');var Redis=require(_0xfa59('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfa59('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfa59('0x7')][_0xfa59('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x345d54,_0x2af8f9,_0xfcb4e7){return new BPromise(function(_0x262e83,_0x137313){return client[_0xfa59('0x9')](_0x345d54,_0xfcb4e7)['then'](function(_0x235563){logger[_0xfa59('0xa')](_0xfa59('0xb'),_0x2af8f9,'request\x20sent');logger[_0xfa59('0xc')](_0xfa59('0xd'),_0x2af8f9,'request\x20sent',JSON[_0xfa59('0xe')](_0x235563));if(_0x235563[_0xfa59('0xf')]){if(_0x235563[_0xfa59('0xf')][_0xfa59('0x10')]===0x1f4){logger['error'](_0xfa59('0xb'),_0x2af8f9,_0x235563[_0xfa59('0xf')][_0xfa59('0x11')]);return _0x137313(_0x235563[_0xfa59('0xf')][_0xfa59('0x11')]);}logger[_0xfa59('0xf')]('CmCompany,\x20%s,\x20%s',_0x2af8f9,_0x235563['error'][_0xfa59('0x11')]);return _0x262e83(_0x235563[_0xfa59('0xf')][_0xfa59('0x11')]);}else{logger[_0xfa59('0xa')]('CmCompany,\x20%s,\x20%s',_0x2af8f9,_0xfa59('0x12'));_0x262e83(_0x235563[_0xfa59('0x13')]['message']);}})[_0xfa59('0x14')](function(_0x3e7983){logger[_0xfa59('0xf')]('CmCompany,\x20%s,\x20%s',_0x2af8f9,_0x3e7983);_0x137313(_0x3e7983);});});}
\ No newline at end of file
+var _0x547c=['catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x278acc,_0x5dd4c6){var _0x4fac69=function(_0x2aed8f){while(--_0x2aed8f){_0x278acc['push'](_0x278acc['shift']());}};_0x4fac69(++_0x5dd4c6);}(_0x547c,0x1cf));var _0xc547=function(_0x5baeb5,_0x2eed5a){_0x5baeb5=_0x5baeb5-0x0;var _0x1f85bb=_0x547c[_0x5baeb5];return _0x1f85bb;};'use strict';var _=require(_0xc547('0x0'));var util=require('util');var moment=require(_0xc547('0x1'));var BPromise=require(_0xc547('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc547('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc547('0x4'));var logger=require(_0xc547('0x5'))(_0xc547('0x6'));var config=require(_0xc547('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc547('0x8')][_0xc547('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45fc58,_0x558320,_0x5def89){return new BPromise(function(_0x265b0e,_0x3de0fa){return client['request'](_0x45fc58,_0x5def89)[_0xc547('0xa')](function(_0x3b74be){logger[_0xc547('0xb')](_0xc547('0xc'),_0x558320,_0xc547('0xd'));logger[_0xc547('0xe')](_0xc547('0xf'),_0x558320,_0xc547('0xd'),JSON[_0xc547('0x10')](_0x3b74be));if(_0x3b74be[_0xc547('0x11')]){if(_0x3b74be[_0xc547('0x11')][_0xc547('0x12')]===0x1f4){logger['error'](_0xc547('0xc'),_0x558320,_0x3b74be[_0xc547('0x11')][_0xc547('0x13')]);return _0x3de0fa(_0x3b74be['error'][_0xc547('0x13')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x558320,_0x3b74be['error']['message']);return _0x265b0e(_0x3b74be[_0xc547('0x11')][_0xc547('0x13')]);}else{logger[_0xc547('0xb')](_0xc547('0xc'),_0x558320,_0xc547('0xd'));_0x265b0e(_0x3b74be['result']['message']);}})[_0xc547('0x14')](function(_0x53faaa){logger[_0xc547('0x11')](_0xc547('0xc'),_0x558320,_0x53faaa);_0x3de0fa(_0x53faaa);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 30bf0e2..3a7411c 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 _0x2477=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','post','addContacts'];(function(_0x371a41,_0x2a19cc){var _0x360d99=function(_0x17a760){while(--_0x17a760){_0x371a41['push'](_0x371a41['shift']());}};_0x360d99(++_0x2a19cc);}(_0x2477,0x138));var _0x7247=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x2477[_0x3bef2c];return _0x331503;};'use strict';var multer=require(_0x7247('0x0'));var util=require(_0x7247('0x1'));var path=require(_0x7247('0x2'));var timeout=require(_0x7247('0x3'));var express=require(_0x7247('0x4'));var router=express[_0x7247('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7247('0x6'));var interaction=require(_0x7247('0x7'));var config=require('../../config/environment');var controller=require(_0x7247('0x8'));router[_0x7247('0x9')]('/',auth[_0x7247('0xa')](),controller[_0x7247('0xb')]);router[_0x7247('0x9')](_0x7247('0xc'),auth[_0x7247('0xa')](),controller[_0x7247('0xd')]);router[_0x7247('0x9')]('/:id',auth[_0x7247('0xa')](),controller[_0x7247('0xe')]);router[_0x7247('0x9')](_0x7247('0xf'),auth[_0x7247('0xa')](),controller['getContacts']);router['post']('/',auth[_0x7247('0xa')](),controller['create']);router[_0x7247('0x10')]('/:id/contacts',auth[_0x7247('0xa')](),controller[_0x7247('0x11')]);router[_0x7247('0x12')]('/:id',auth[_0x7247('0xa')](),controller[_0x7247('0x13')]);router[_0x7247('0x14')]('/:id',auth[_0x7247('0xa')](),controller['destroy']);module[_0x7247('0x15')]=router;
\ No newline at end of file
+var _0x6c67=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','index','get','describe','show','getContacts','post','/:id/contacts','addContacts'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0x6c67,0x1af));var _0x76c6=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x6c67[_0x39096d];return _0x13da4f;};'use strict';var multer=require(_0x76c6('0x0'));var util=require(_0x76c6('0x1'));var path=require(_0x76c6('0x2'));var timeout=require(_0x76c6('0x3'));var express=require(_0x76c6('0x4'));var router=express[_0x76c6('0x5')]();var fs_extra=require(_0x76c6('0x6'));var auth=require(_0x76c6('0x7'));var interaction=require(_0x76c6('0x8'));var config=require('../../config/environment');var controller=require(_0x76c6('0x9'));router['get']('/',auth[_0x76c6('0xa')](),controller[_0x76c6('0xb')]);router[_0x76c6('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x76c6('0xd')]);router['get']('/:id',auth[_0x76c6('0xa')](),controller[_0x76c6('0xe')]);router[_0x76c6('0xc')]('/:id/contacts',auth[_0x76c6('0xa')](),controller[_0x76c6('0xf')]);router[_0x76c6('0x10')]('/',auth[_0x76c6('0xa')](),controller['create']);router[_0x76c6('0x10')](_0x76c6('0x11'),auth[_0x76c6('0xa')](),controller[_0x76c6('0x12')]);router[_0x76c6('0x13')](_0x76c6('0x14'),auth[_0x76c6('0xa')](),controller[_0x76c6('0x15')]);router[_0x76c6('0x16')](_0x76c6('0x14'),auth[_0x76c6('0xa')](),controller[_0x76c6('0x17')]);module[_0x76c6('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 6121b3a..de319d9 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 _0x80c1=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x80c1,0x68));var _0x180c=function(_0x437c62,_0x593e7a){_0x437c62=_0x437c62-0x0;var _0x6fb267=_0x80c1[_0x437c62];return _0x6fb267;};'use strict';var _=require('lodash');var Sequelize=require(_0x180c('0x0'));module[_0x180c('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x180c('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x180c('0x2')]},'country':{'type':Sequelize[_0x180c('0x2')]},'dateOfBirth':{'type':Sequelize[_0x180c('0x2')]},'description':{'type':Sequelize[_0x180c('0x3')]},'phone':{'type':Sequelize[_0x180c('0x2')]},'mobile':{'type':Sequelize[_0x180c('0x2')]},'fax':{'type':Sequelize[_0x180c('0x2')]},'email':{'type':Sequelize[_0x180c('0x2')]},'url':{'type':Sequelize[_0x180c('0x2')]},'facebook':{'type':Sequelize[_0x180c('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x180c('0x2')]},'skype':{'type':Sequelize[_0x180c('0x2')]},'teams':{'type':Sequelize[_0x180c('0x2')]},'viber':{'type':Sequelize[_0x180c('0x2')]},'line':{'type':Sequelize[_0x180c('0x2')]},'wechat':{'type':Sequelize[_0x180c('0x2')]},'telegram':{'type':Sequelize[_0x180c('0x2')]},'UserId':{'type':Sequelize[_0x180c('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x180c('0x2')]},'priority':{'type':Sequelize[_0x180c('0x4')](0x2)[_0x180c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x180c('0x6')],'defaultValue':Sequelize[_0x180c('0x7')]},'dialTimezone':{'type':Sequelize[_0x180c('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xea37=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x48cf1c,_0x232eea){var _0x3290e9=function(_0x5e5182){while(--_0x5e5182){_0x48cf1c['push'](_0x48cf1c['shift']());}};_0x3290e9(++_0x232eea);}(_0xea37,0xf6));var _0x7ea3=function(_0x5b7f3b,_0x58b085){_0x5b7f3b=_0x5b7f3b-0x0;var _0x13d5dc=_0xea37[_0x5b7f3b];return _0x13d5dc;};'use strict';var _=require(_0x7ea3('0x0'));var Sequelize=require('sequelize');module[_0x7ea3('0x1')]={'firstName':{'type':Sequelize[_0x7ea3('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7ea3('0x2')]},'street':{'type':Sequelize[_0x7ea3('0x2')]},'postalCode':{'type':Sequelize[_0x7ea3('0x2')]},'city':{'type':Sequelize[_0x7ea3('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7ea3('0x3')]},'phone':{'type':Sequelize[_0x7ea3('0x2')]},'mobile':{'type':Sequelize[_0x7ea3('0x2')]},'fax':{'type':Sequelize[_0x7ea3('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x7ea3('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x7ea3('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x7ea3('0x2')]},'line':{'type':Sequelize[_0x7ea3('0x2')]},'wechat':{'type':Sequelize[_0x7ea3('0x2')]},'telegram':{'type':Sequelize[_0x7ea3('0x2')]},'UserId':{'type':Sequelize[_0x7ea3('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x7ea3('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x7ea3('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x7ea3('0x6')]},'dialTimezone':{'type':Sequelize[_0x7ea3('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 8ffb047..733e5b2 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','path','node-tnef','../../../config/logger','../../../config/environment','head','value','address','@xcally.com','substring','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous'];(function(_0x18aca1,_0x27937d){var _0x571c90=function(_0x252ad6){while(--_0x252ad6){_0x18aca1['push'](_0x18aca1['shift']());}};_0x571c90(++_0x27937d);}(_0xb45b,0x1e3));var _0xbb45=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0xb45b[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0xbb45('0x0'));var moment=require('moment');var random=require(_0xbb45('0x1'));var fs=require('fs');var path=require(_0xbb45('0x2'));var util=require('util');var tnef=require(_0xbb45('0x3'));var logger=require(_0xbb45('0x4'))('email');var config=require(_0xbb45('0x5'));function getAddress(_0x30a184){var _0x34279e=_[_0xbb45('0x6')](_0x30a184[_0xbb45('0x7')]);return _0x34279e&&_0x34279e[_0xbb45('0x8')]?_0x34279e[_0xbb45('0x8')]:'anonymous'+random['generate'](0x6)+_0xbb45('0x9');}function getFirstName(_0x1f5732){var _0x971db5=_[_0xbb45('0x6')](_0x1f5732[_0xbb45('0x7')]);if(_0x971db5&&_0x971db5['name']){if(_0x971db5['name']==_0x971db5[_0xbb45('0x8')]){return _0x971db5['name'][_0xbb45('0xa')](0x0,_0x971db5[_0xbb45('0xb')][_0xbb45('0xc')]('@'));}var _0x458af2=_0x971db5['name'][_0xbb45('0xd')](/\s+/);return _0x458af2[_0xbb45('0xe')]>0x1?_0x458af2[_0xbb45('0xf')](0x0,-0x1)[_0xbb45('0x10')]('\x20'):_0x971db5[_0xbb45('0xb')];}return _0xbb45('0x11');}function getLastName(_0x30e527){var _0x47d66e=_[_0xbb45('0x6')](_0x30e527[_0xbb45('0x7')]);if(_0x47d66e&&_0x47d66e[_0xbb45('0xb')]){var _0x1fc0da=_0x47d66e[_0xbb45('0xb')][_0xbb45('0xd')](/\s+/);return _0x1fc0da[_0xbb45('0xe')]>0x1?_0x1fc0da[_0xbb45('0x12')]():'';}return'';}function getMails(_0x11178c,_0x4d6f50){var _0x27d1d6='';for(var _0x2491f9=0x0;_0x2491f9<_0x4d6f50[_0xbb45('0x7')]['length'];_0x2491f9+=0x1){if(_0x4d6f50['value'][_0x2491f9][_0xbb45('0x8')]!==_0x11178c){if(!_[_0xbb45('0x13')](_0x27d1d6)){_0x27d1d6+=',';}_0x27d1d6+=_0x4d6f50[_0xbb45('0x7')][_0x2491f9][_0xbb45('0xb')]||_0x4d6f50['value'][_0x2491f9][_0xbb45('0x8')]||'';_0x27d1d6+='\x20<';_0x27d1d6+=_0x4d6f50['value'][_0x2491f9][_0xbb45('0x8')]?_0x4d6f50[_0xbb45('0x7')][_0x2491f9][_0xbb45('0x8')]:_0xbb45('0x14')+random['generate'](0x6)+'@xcally.com';_0x27d1d6+='>';}}return _0x27d1d6;}function parseEmail(_0x599df6,_0x54c5fb,_0x23baf6){if(_0x54c5fb[_0xbb45('0x15')]){var _0x92a7a=/